|
|
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.10! root 24: ~WXMemdumpWindow() override;
1.1.1.3 root 25:
1.1.1.8 root 26: void FontChanged() override;
1.1.1.9 root 27: bool Layout() override;
1.1.1.7 root 28:
1.1 root 29: private:
1.1.1.10! root 30: bool GetMySizeHints(wxSize *, wxSize *, wxSize *, wxSize *) override;
1.1.1.9 root 31:
1.1 root 32: // テキスト入力イベント
33: void OnTextEnter(wxCommandEvent& event);
34:
1.1.1.8 root 35: // ボタンイベント
36: void OnPrevLine(wxCommandEvent& event);
37: void OnPrevPage(wxCommandEvent& event);
38: void OnNextLine(wxCommandEvent& event);
39: void OnNextPage(wxCommandEvent& event);
40:
41: // 表示フォーマット変更イベント
42: void OnFormat(wxCommandEvent& event);
43: void DoFormat(Memdump::Format fmt_);
44:
45: // マウスイベント
46: void OnMouseWheel(wxMouseEvent& event);
47: void OnDClick(wxMouseEvent& event);
48:
49: uint64 GetAddrAtHexdump(int x, int y, int len);
50: uint64 GetAddrAtPageShort(int x, int y);
51: uint64 GetAddrAtDisasm(int x, int y, int instlen);
1.1 root 52:
1.1.1.5 root 53: // アドレス欄を更新
54: void UpdateAddr();
1.1 root 55:
1.1.1.8 root 56: // フォーマット番号とセレクション番号の相互変換
57: Memdump::Format Selection2Format(int idx);
58: int Format2Selection(Memdump::Format fmt_);
59: wxString Format2String(Memdump::Format fmt_);
60:
1.1.1.5 root 61: // コントロール
62: wxTextCtrl *addrctrl {};
1.1.1.8 root 63: std::array<WXButton *, 4> buttons {};
64: wxChoice *fmtctrl {};
65:
66: // 表示フォーマットの選択肢
67: std::vector<std::pair<Memdump::Format, wxString>> fmts {};
1.1 root 68:
1.1.1.3 root 69: // コントロールパネルを格納する sizer
70: wxBoxSizer *ctrlbox {};
71:
1.1.1.7 root 72: WXMonitorPanel *screen {};
73:
1.1.1.8 root 74: // モニタ ID
75: int monid {};
76:
1.1.1.5 root 77: // メモリダンプウィンドウは複数枚あるので自分がそのうちの何番目か。
1.1.1.8 root 78: int myidx {};
79:
80: // メモリダンプ
81: MemdumpMonitor *memdump {};
1.1 root 82:
83: // イベントテーブル
84: wxDECLARE_EVENT_TABLE();
1.1.1.8 root 85: };
86:
87: // 編集ダイアログ
88: class MemEditDialog : public wxDialog
89: {
90: using inherited = wxDialog;
91: public:
92: MemEditDialog(wxWindow *parent, uint32 addr, uint32 data, int len,
93: const std::string& sizestr);
94: ~MemEditDialog() override;
95:
96: // テキストコントロールの値を返す
97: uint64 GetData() const;
98:
99: private:
100: void OnTextEnter(wxCommandEvent& event);
101:
102: // 値入力欄
103: wxTextCtrl *datactrl {};
1.1.1.5 root 104:
1.1.1.8 root 105: // イベントテーブル
106: wxDECLARE_EVENT_TABLE();
1.1 root 107: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.