|
|
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.8 root 26: void FontChanged() override;
1.1.1.9 ! root 27: void Fit() override;
! 28: bool Layout() override;
1.1.1.7 root 29:
1.1 root 30: private:
1.1.1.9 ! root 31: wxSize DoSizeHints();
! 32:
1.1 root 33: // テキスト入力イベント
34: void OnTextEnter(wxCommandEvent& event);
35:
1.1.1.8 root 36: // ボタンイベント
37: void OnPrevLine(wxCommandEvent& event);
38: void OnPrevPage(wxCommandEvent& event);
39: void OnNextLine(wxCommandEvent& event);
40: void OnNextPage(wxCommandEvent& event);
41:
42: // 表示フォーマット変更イベント
43: void OnFormat(wxCommandEvent& event);
44: void DoFormat(Memdump::Format fmt_);
45:
46: // マウスイベント
47: void OnMouseWheel(wxMouseEvent& event);
48: void OnDClick(wxMouseEvent& event);
49:
50: uint64 GetAddrAtHexdump(int x, int y, int len);
51: uint64 GetAddrAtPageShort(int x, int y);
52: uint64 GetAddrAtDisasm(int x, int y, int instlen);
1.1 root 53:
1.1.1.5 root 54: // アドレス欄を更新
55: void UpdateAddr();
1.1 root 56:
1.1.1.8 root 57: // フォーマット番号とセレクション番号の相互変換
58: Memdump::Format Selection2Format(int idx);
59: int Format2Selection(Memdump::Format fmt_);
60: wxString Format2String(Memdump::Format fmt_);
61:
1.1.1.5 root 62: // コントロール
63: wxTextCtrl *addrctrl {};
1.1.1.8 root 64: std::array<WXButton *, 4> buttons {};
65: wxChoice *fmtctrl {};
66:
67: // 表示フォーマットの選択肢
68: std::vector<std::pair<Memdump::Format, wxString>> fmts {};
1.1 root 69:
1.1.1.3 root 70: // コントロールパネルを格納する sizer
71: wxBoxSizer *ctrlbox {};
72:
1.1.1.7 root 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:
1.1.1.9 ! root 84: // 前回のウィンドウマージン (クライアント領域の外側)
! 85: wxSize oldmargin {};
! 86:
! 87: // 謎のリサイズ対策
! 88: bool layout_pass2 {};
! 89:
1.1 root 90: // イベントテーブル
91: wxDECLARE_EVENT_TABLE();
1.1.1.8 root 92: };
93:
94: // 編集ダイアログ
95: class MemEditDialog : public wxDialog
96: {
97: using inherited = wxDialog;
98: public:
99: MemEditDialog(wxWindow *parent, uint32 addr, uint32 data, int len,
100: const std::string& sizestr);
101: ~MemEditDialog() override;
102:
103: // テキストコントロールの値を返す
104: uint64 GetData() const;
105:
106: private:
107: void OnTextEnter(wxCommandEvent& event);
108:
109: // 値入力欄
110: wxTextCtrl *datactrl {};
1.1.1.5 root 111:
1.1.1.8 root 112: // イベントテーブル
113: wxDECLARE_EVENT_TABLE();
1.1 root 114: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.