--- nono/wx/wxmainview.h 2026/04/29 17:04:30 1.1.1.2 +++ nono/wx/wxmainview.h 2026/04/29 17:04:37 1.1.1.4 @@ -1,16 +1,18 @@ // // nono -// Copyright (C) 2018 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #pragma once +#include "wxheader.h" #include class WXMainView : public wxPanel { - typedef wxPanel inherited; + using inherited = wxPanel; public: WXMainView(wxWindow *); virtual ~WXMainView(); @@ -27,6 +29,8 @@ class WXMainView void SetMouseMode(bool enable); // マウスモードを取得 (キャプチャされているなら true) bool GetMouseMode() const { return mousemode; } + // アクティベートイベント + void OnActivate(wxActivateEvent& event); private: void OnPaint(wxPaintEvent& event); @@ -39,7 +43,7 @@ class WXMainView // 裏バッファ。 // VM がレンダリングするバッファ。 - uint8_t *ImageBuf = NULL; + std::unique_ptr ImageBuf {}; // 仮想画面サイズ (ピクセル) int rendwidth = 0; @@ -60,8 +64,12 @@ class WXMainView // マウスモード (キャプチャしていれば true) bool mousemode = false; - // 前回のマウス座標 + // 前回のマウス座標とボタン wxPoint prevpos {}; + bool prevlb {}; + bool prevmb {}; + bool prevrb {}; + // WarpPointer() による移動検出用 bool motion_by_warp_pointer = false; // マウスカーソルを移動させる