|
|
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.12 root 7: //
8: // メインウィンドウ
9: //
10:
1.1 root 11: #pragma once
12:
1.1.1.9 root 13: #include "wxnono.h"
14: #include "monitor.h"
1.1.1.4 root 15: #include "vm.h"
1.1 root 16: #include <array>
17:
1.1.1.13 root 18: class FDDDevice;
1.1.1.14! root 19: class Keyboard;
! 20: class PowerDevice;
! 21: class Syncer;
! 22: class WXMainView;
! 23: class WXStatusPanel;
1.1.1.13 root 24:
1.1.1.9 root 25: class WXMainFrame : public wxFrame
1.1 root 26: {
1.1.1.9 root 27: using inherited = wxFrame;
1.1 root 28: public:
29: WXMainFrame(wxWindow *);
1.1.1.7 root 30: virtual ~WXMainFrame() override;
1.1 root 31:
1.1.1.11 root 32: // (設定反映などの) 初期化
33: bool Init();
34:
1.1.1.12 root 35: bool Layout() override;
36:
1.1 root 37: // ウィンドウをリストから削除する。
38: // ウィンドウをクローズする際に呼び出すこと。
1.1.1.9 root 39: void DeleteWindow(wxWindow *);
1.1 root 40:
1.1.1.9 root 41: // 起動時にオープンするサブウィンドウの一覧
42: static std::array<bool, ID_SUBWIN_MAX> subwindow_start;
1.1 root 43:
1.1.1.14! root 44: // モニタウィンドウの更新頻度取得・設定
! 45: static int GetMonitorRate() { return monitor_rate; }
! 46: static void SetMonitorRate(int val) { monitor_rate = val; }
! 47:
! 48: // メンバの取得
! 49: WXMainView *GetMainView() { return mainview; }
1.1.1.5 root 50:
1.1.1.13 root 51: // SCSI リムーバブルデバイス、FD 用のメニューを作成して返す
1.1.1.10 root 52: wxMenu *CreateSCSIRemovableMenu(uint id) const;
1.1.1.13 root 53: wxMenu *CreateFDMenu(int unit) const;
54:
55: // FD を挿入する
56: void InsertFD(int unit, const std::string& path);
57: // FD をイジェクトする
58: void EjectFD(int unit, bool force);
1.1.1.10 root 59:
60: // CD を挿入する
61: void InsertCD(int id, const std::string& path);
62: // CD をイジェクトする
63: void EjectCD(int id, bool force);
64:
1.1 root 65: private:
1.1.1.10 root 66: void OnIdle(wxIdleEvent& event);
1.1.1.3 root 67: void OnClose(wxCloseEvent& event);
1.1.1.4 root 68: void OnActivate(wxActivateEvent& event);
1.1 root 69:
1.1.1.8 root 70: void OnRestartVM(wxCommandEvent& event);
1.1 root 71: void OnExit(wxCommandEvent&);
72:
1.1.1.11 root 73: void OnFullSpeed(wxCommandEvent& event);
74: void OnFullSpeedUI(wxUpdateUIEvent& event);
75: void OnMenuInput(wxCommandEvent& event);
76: void OnMenuInputUI(wxUpdateUIEvent& event);
77:
1.1 root 78: void OnMenuScale(wxCommandEvent& event);
79: void OnMenuScaleUI(wxUpdateUIEvent& event);
80: void OnMenuFontSize(wxCommandEvent& event);
81: void OnMenuFontSizeUI(wxUpdateUIEvent& event);
1.1.1.5 root 82: void OnMenuMonRate(wxCommandEvent& event);
83: void OnMenuMonRateUI(wxUpdateUIEvent& event);
1.1.1.8 root 84: void OnShowStatusPanel(wxCommandEvent& event);
85: void OnShowStatusPanelUI(wxUpdateUIEvent& event);
1.1 root 86:
1.1.1.13 root 87: void OnFDInsert(wxCommandEvent& event);
88: void OnFDInsertUI(wxUpdateUIEvent& event);
89: void OnFDEject(wxCommandEvent& event);
90: void OnFDEjectUI(wxUpdateUIEvent& event);
91: void OnFDForce(wxCommandEvent& event);
92: void OnFDForceUI(wxUpdateUIEvent& event);
1.1.1.10 root 93: void OnCDInsert(wxCommandEvent& event);
94: void OnCDInsertUI(wxUpdateUIEvent& event);
95: void OnCDEject(wxCommandEvent& event);
96: void OnCDEjectUI(wxUpdateUIEvent& event);
97: void OnCDForce(wxCommandEvent& event);
98: void OnCDForceUI(wxUpdateUIEvent& event);
1.1.1.2 root 99: void OnMouseMode(wxCommandEvent& event);
100: void OnMouseModeUI(wxUpdateUIEvent& event);
1.1.1.13 root 101: void OnPowerButton(wxCommandEvent& event);
102: void OnPowerButtonUI(wxUpdateUIEvent& event);
1.1.1.8 root 103: void OnResetButton(wxCommandEvent& event);
1.1.1.12 root 104: void OnNMIButton(wxCommandEvent& event);
105: void OnKeyboardConnect(wxCommandEvent& event);
106: void OnKeyboardConnectUI(wxUpdateUIEvent& event);
1.1.1.2 root 107:
1.1 root 108: void OnWindow(wxCommandEvent&);
109: void DoWindow(int id, bool enable);
110: void OnWindowUI(wxUpdateUIEvent&);
111:
1.1.1.4 root 112: void OnAbout(wxCommandEvent&);
113:
1.1.1.14! root 114: int CreateMainviewScaleTable();
! 115: int CreateMonRateTable();
! 116:
1.1.1.10 root 117: // リムーバブルデバイス用のメニューを作成して追加する
118: void CreateRemovableMenu(wxMenu *);
119:
1.1 root 120: // ウィンドウをリストに追加する。
121: void AddWindow(int id, wxWindow *);
122:
123: // 指定 ID のサブウィンドウがリストにあれば true を返す
124: bool IsExistWindow(int id);
125:
1.1.1.14! root 126: // MPU 名を返す
! 127: wxString MPUName() const;
! 128:
1.1 root 129: // サブウィンドウリスト
1.1.1.9 root 130: std::unique_ptr<wxWindow> windows[ID_SUBWIN_MAX] {};
1.1.1.4 root 131:
1.1.1.10 root 132: // メニュー操作用の SCSI デバイス
133: // (ホストアダプタが増えた時のことは考えていない)
134: std::array<SCSITarget *, 8> scsidev {};
135:
1.1.1.13 root 136: // メニュー操作用の FDD デバイス
137: // (6台構成のことは考えていない)
138: std::array<FDDDevice *, 4> fdd_array {};
139:
1.1.1.10 root 140: // ファイルダイアログを表示する際のカレントディレクトリ
141: std::string current_dir {};
142:
1.1.1.4 root 143: // ダブルバスフォールト・イベント
144: void OnHaltNotify(wxCommandEvent& event);
1.1.1.10 root 145: // メディア挿入失敗通知
1.1.1.13 root 146: void OnInsertFailed(wxCommandEvent& event);
1.1 root 147:
1.1.1.14! root 148: WXMainView *mainview {};
! 149: WXStatusPanel *statuspanel {};
! 150:
! 151: Keyboard *keyboard {};
! 152: PowerDevice *power {};
! 153: Syncer *syncer {};
! 154:
! 155: // 表示スケールの選択肢
! 156: static std::vector<double> view_scales;
! 157:
! 158: // モニタの更新頻度(これが実行中の一次情報)
! 159: static int monitor_rate;
! 160: // モニタ更新頻度の選択肢
! 161: static std::vector<int> monrates;
! 162:
1.1 root 163: wxDECLARE_EVENT_TABLE();
164: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.