--- nono/wx/wxmainview.h 2026/04/29 17:05:04 1.1.1.10 +++ nono/wx/wxmainview.h 2026/04/29 17:05:31 1.1.1.15 @@ -4,21 +4,30 @@ // Licensed under nono-license.txt // +// +// メイン画面パネル +// + #pragma once #include "wxnono.h" -#include + +wxDECLARE_EVENT(NONO_EVT_MOUSEMODE, wxCommandEvent); + +class DumbKeyboard; +class Keyboard; +class Renderer; class WXMainView : public wxPanel { using inherited = wxPanel; public: - WXMainView(wxWindow *); + explicit WXMainView(wxWindow *); virtual ~WXMainView() override; bool Init(); - void DoRefresh(); + void Close(); void DoResize(double scale); // 現在のスケールを返す @@ -46,14 +55,9 @@ class WXMainView : public wxPanel void OnTimer(wxTimerEvent& event); void OnPaint(wxPaintEvent& event); void OnMouse(wxMouseEvent& event); - - // 裏バッファ。 - // VM がレンダリングするバッファ。 - std::unique_ptr ImageBuf {}; - - // 仮想画面サイズ (ピクセル) - int rendwidth {}; - int rendheight {}; + void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); + void OnRender(wxCommandEvent& event); + void OnMouseMode(wxCommandEvent& event); // 実画面サイズ (ピクセル) int viewwidth {}; @@ -80,11 +84,9 @@ class WXMainView : public wxPanel // マウスカーソルを移動させる void MyWarpPointer(wxSize pos); - // 再描画を律速する - wxTimer timer {}; - std::atomic paint_request {}; + DumbKeyboard *dumbkbd {}; + Keyboard *richkbd {}; + Renderer *renderer {}; wxDECLARE_EVENT_TABLE(); }; - -extern WXMainView *gMainView;