Annotation of nono/wx/wxmainframe.h, revision 1.1.1.15

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.