|
|
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.11! root 52: void OnRender(wxCommandEvent& event);
1.1 root 53:
54: // 仮想画面サイズ (ピクセル)
1.1.1.6 root 55: int rendwidth {};
56: int rendheight {};
1.1 root 57:
58: // 実画面サイズ (ピクセル)
1.1.1.6 root 59: int viewwidth {};
60: int viewheight {};
1.1 root 61:
62: // 共通キーコードを取得する
63: int GetKeyCode(wxKeyEvent& event);
64:
1.1.1.8 root 65: static const int keycode_table[0x190];
1.1 root 66:
1.1.1.10 root 67: // 文字入力モードなら true
68: bool is_charinput {};
69:
1.1.1.2 root 70: // マウスモード (キャプチャしていれば true)
1.1.1.6 root 71: bool mousemode {};
1.1.1.3 root 72: // 前回のマウス座標とボタン
1.1.1.2 root 73: wxPoint prevpos {};
1.1.1.3 root 74: bool prevlb {};
75: bool prevmb {};
76: bool prevrb {};
77:
1.1.1.2 root 78: // WarpPointer() による移動検出用
1.1.1.6 root 79: bool motion_by_warp_pointer {};
1.1.1.2 root 80: // マウスカーソルを移動させる
81: void MyWarpPointer(wxSize pos);
82:
1.1 root 83: wxDECLARE_EVENT_TABLE();
84: };
85:
86: extern WXMainView *gMainView;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.