Annotation of nono/wx/wxdumpmonitor.h, revision 1.1.1.8

1.1       root        1: //
                      2: // nono
1.1.1.2   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
1.1.1.6   root        7: //
                      8: // メモリダンプウィンドウ
                      9: //
                     10: 
1.1       root       11: #pragma once
                     12: 
                     13: #include "wxsubwindow.h"
1.1.1.8 ! root       14: #include "wxbutton.h"
1.1.1.7   root       15: #include "wxmonitor.h"
1.1.1.8 ! root       16: #include "memdump.h"
1.1.1.6   root       17: #include <array>
1.1       root       18: 
1.1.1.7   root       19: class WXMemdumpWindow : public WXSubWindow
1.1       root       20: {
1.1.1.7   root       21:        using inherited = WXSubWindow;
1.1       root       22:  public:
1.1.1.8 ! root       23:        WXMemdumpWindow(wxWindow *parent, int monid);
1.1.1.3   root       24:        virtual ~WXMemdumpWindow() override;
                     25: 
1.1.1.7   root       26:        bool Layout() override;
1.1.1.8 ! root       27:        void FontChanged() override;
1.1.1.7   root       28: 
1.1       root       29:  private:
                     30:        // テキスト入力イベント
                     31:        void OnTextEnter(wxCommandEvent& event);
                     32: 
1.1.1.8 ! root       33:        // ボタンイベント
        !            34:        void OnPrevLine(wxCommandEvent& event);
        !            35:        void OnPrevPage(wxCommandEvent& event);
        !            36:        void OnNextLine(wxCommandEvent& event);
        !            37:        void OnNextPage(wxCommandEvent& event);
        !            38: 
        !            39:        // 表示フォーマット変更イベント
        !            40:        void OnFormat(wxCommandEvent& event);
        !            41:        void DoFormat(Memdump::Format fmt_);
        !            42: 
        !            43:        // マウスイベント
        !            44:        void OnMouseWheel(wxMouseEvent& event);
        !            45:        void OnDClick(wxMouseEvent& event);
        !            46: 
        !            47:        uint64 GetAddrAtHexdump(int x, int y, int len);
        !            48:        uint64 GetAddrAtPageShort(int x, int y);
        !            49:        uint64 GetAddrAtDisasm(int x, int y, int instlen);
1.1       root       50: 
1.1.1.5   root       51:        // アドレス欄を更新
                     52:        void UpdateAddr();
1.1       root       53: 
1.1.1.8 ! root       54:        // フォーマット番号とセレクション番号の相互変換
        !            55:        Memdump::Format Selection2Format(int idx);
        !            56:        int Format2Selection(Memdump::Format fmt_);
        !            57:        wxString Format2String(Memdump::Format fmt_);
        !            58: 
1.1.1.5   root       59:        // コントロール
                     60:        wxTextCtrl *addrctrl {};
1.1.1.8 ! root       61:        std::array<WXButton *, 4> buttons {};
        !            62:        wxChoice *fmtctrl {};
        !            63: 
        !            64:        // 表示フォーマットの選択肢
        !            65:        std::vector<std::pair<Memdump::Format, wxString>> fmts {};
1.1       root       66: 
1.1.1.3   root       67:        // コントロールパネルを格納する sizer
                     68:        wxBoxSizer *ctrlbox {};
                     69: 
1.1.1.7   root       70:        // コントロールパネル部分の長さ
                     71:        int fixed_height {};
                     72: 
                     73:        WXMonitorPanel *screen {};
                     74: 
1.1.1.8 ! root       75:        // モニタ ID
        !            76:        int monid {};
        !            77: 
1.1.1.5   root       78:        // メモリダンプウィンドウは複数枚あるので自分がそのうちの何番目か。
1.1.1.8 ! root       79:        int myidx {};
        !            80: 
        !            81:        // メモリダンプ
        !            82:        MemdumpMonitor *memdump {};
1.1       root       83: 
                     84:        // イベントテーブル
                     85:        wxDECLARE_EVENT_TABLE();
1.1.1.8 ! root       86: };
        !            87: 
        !            88: // 編集ダイアログ
        !            89: class MemEditDialog : public wxDialog
        !            90: {
        !            91:        using inherited = wxDialog;
        !            92:  public:
        !            93:        MemEditDialog(wxWindow *parent, uint32 addr, uint32 data, int len,
        !            94:                const std::string& sizestr);
        !            95:        ~MemEditDialog() override;
        !            96: 
        !            97:        // テキストコントロールの値を返す
        !            98:        uint64 GetData() const;
        !            99: 
        !           100:  private:
        !           101:        void OnTextEnter(wxCommandEvent& event);
        !           102: 
        !           103:        // 値入力欄
        !           104:        wxTextCtrl *datactrl {};
1.1.1.5   root      105: 
1.1.1.8 ! root      106:        // イベントテーブル
        !           107:        wxDECLARE_EVENT_TABLE();
1.1       root      108: };

unix.superglobalmegacorp.com

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