|
|
1.1 root 1: //
2: // nono
1.1.1.4 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
1.1.1.11 root 7: //
8: // メイン画面パネル
9: //
10:
1.1 root 11: #pragma once
12:
1.1.1.9 root 13: #include "wxnono.h"
1.1 root 14:
1.1.1.9 root 15: class WXMainView : public wxPanel
1.1 root 16: {
1.1.1.4 root 17: using inherited = wxPanel;
1.1 root 18: public:
19: WXMainView(wxWindow *);
1.1.1.7 root 20: virtual ~WXMainView() override;
1.1 root 21:
1.1.1.10 root 22: bool Init();
23:
1.1.1.11 root 24: void Close();
1.1 root 25: void DoResize(double scale);
26:
27: // 現在のスケールを返す
28: double GetScale() const;
29: // 現在のスケール (wxapp が初期値を指定するため static 変数にしてある)
30: static double screen_scale;
31:
1.1.1.10 root 32: // 文字入力モードを取得・設定
33: bool GetCharInputMode() const { return is_charinput; }
34: void SetCharInputMode(bool enable);
35:
1.1.1.2 root 36: // マウスモードを設定
37: void SetMouseMode(bool enable);
38: // マウスモードを取得 (キャプチャされているなら true)
39: bool GetMouseMode() const { return mousemode; }
1.1.1.4 root 40: // アクティベートイベント
41: void OnActivate(wxActivateEvent& event);
1.1.1.2 root 42:
1.1.1.8 root 43: // キー入力イベント (WXSoftKeyPanel からも呼ばれる)
44: void OnKeyDown(wxKeyEvent& event);
45: void OnKeyUp(wxKeyEvent& event);
1.1.1.10 root 46: void OnChar(wxKeyEvent& event);
1.1.1.8 root 47:
1.1 root 48: private:
1.1.1.5 root 49: void OnTimer(wxTimerEvent& event);
1.1 root 50: void OnPaint(wxPaintEvent& event);
1.1.1.2 root 51: void OnMouse(wxMouseEvent& event);
1.1.1.12! root 52: void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
1.1.1.11 root 53: void OnRender(wxCommandEvent& event);
1.1 root 54:
55: // 仮想画面サイズ (ピクセル)
1.1.1.6 root 56: int rendwidth {};
57: int rendheight {};
1.1 root 58:
59: // 実画面サイズ (ピクセル)
1.1.1.6 root 60: int viewwidth {};
61: int viewheight {};
1.1 root 62:
63: // 共通キーコードを取得する
64: int GetKeyCode(wxKeyEvent& event);
65:
1.1.1.8 root 66: static const int keycode_table[0x190];
1.1 root 67:
1.1.1.10 root 68: // 文字入力モードなら true
69: bool is_charinput {};
70:
1.1.1.2 root 71: // マウスモード (キャプチャしていれば true)
1.1.1.6 root 72: bool mousemode {};
1.1.1.3 root 73: // 前回のマウス座標とボタン
1.1.1.2 root 74: wxPoint prevpos {};
1.1.1.3 root 75: bool prevlb {};
76: bool prevmb {};
77: bool prevrb {};
78:
1.1.1.2 root 79: // WarpPointer() による移動検出用
1.1.1.6 root 80: bool motion_by_warp_pointer {};
1.1.1.2 root 81: // マウスカーソルを移動させる
82: void MyWarpPointer(wxSize pos);
83:
1.1 root 84: wxDECLARE_EVENT_TABLE();
85: };
86:
87: extern WXMainView *gMainView;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.