Commit | Line | Data |
---|---|---|
cf76e892 | 1 | // |
570dad92 | 2 | // heapallocatorbrowser.h: Memory heap allocation |
cf76e892 | 3 | // |
570dad92 | 4 | // by Jean-Paul Mari |
cf76e892 JPM |
5 | // |
6 | ||
7 | #ifndef __HEAPALLOCATORBROWSER_H__ | |
8 | #define __HEAPALLOCATORBROWSER_H__ | |
9 | ||
2b91c435 | 10 | //#define HA_LAYOUTTEXTS // Use a layout with just texts |
5d765b04 | 11 | |
cf76e892 JPM |
12 | #include <QtWidgets> |
13 | #include <stdint.h> | |
14 | ||
5d765b04 | 15 | // Error code definitions |
2b91c435 JPM |
16 | #define HA_NOERROR 0x00 |
17 | #define HA_ERROR 0x80 | |
18 | #define HA_WARNING 0x40 | |
19 | #define HA_UNABLENEXTMEMORYALLOC (0x01 | HA_ERROR) | |
20 | #define HA_UNABLEALLOCATEMEMORYUSAGE (0x02 | HA_ERROR) | |
21 | #define HA_MEMORYBLOCKSIZEPROBLEM (0x03 | HA_ERROR) | |
22 | #define HA_MEMORYALLOCATIONPROBLEM (0x04 | HA_ERROR) | |
23 | #define HA_HAANDSPSHARESPACE (0x05 | HA_ERROR) | |
24 | #define HA_MEMORYALLOCATORNOTEXIST (0x06 | HA_WARNING) | |
25 | #define HA_MEMORYALLOCATORNOTCOMPATIBLE (0x07 | HA_WARNING) | |
26 | #define HA_MEMORYALLOCATORNOTINITIALIZED (0x08 | HA_WARNING) | |
27 | ||
5d765b04 JPM |
28 | |
29 | // | |
cf76e892 JPM |
30 | class HeapAllocatorBrowserWindow: public QWidget |
31 | { | |
32 | Q_OBJECT | |
33 | ||
570dad92 | 34 | typedef struct HeapAllocation |
cf76e892 | 35 | { |
cf76e892 | 36 | uint32_t nextalloc; |
cf76e892 | 37 | uint32_t size; |
cf76e892 | 38 | uint16_t used; |
2b91c435 JPM |
39 | } |
40 | S_HeapAllocation; | |
cf76e892 JPM |
41 | |
42 | public: | |
43 | HeapAllocatorBrowserWindow(QWidget *parent = 0); | |
44 | ~HeapAllocatorBrowserWindow(void); | |
45 | ||
46 | public slots: | |
cf76e892 | 47 | void RefreshContents(void); |
a2dfb8e5 | 48 | void Reset(void); |
cf76e892 JPM |
49 | |
50 | protected: | |
a2dfb8e5 | 51 | void keyPressEvent(QKeyEvent *); |
cf76e892 JPM |
52 | |
53 | private: | |
54 | QVBoxLayout *layout; | |
2b91c435 | 55 | #ifdef HA_LAYOUTTEXTS |
cf76e892 | 56 | QTextBrowser *text; |
2b91c435 JPM |
57 | #else |
58 | QTableView *TableView; | |
59 | QStandardItemModel *model; | |
60 | QSortFilterProxyModel *proxyModel; | |
61 | #endif | |
62 | QStatusBar *statusbar; | |
cf76e892 | 63 | size_t Adr; |
cf76e892 JPM |
64 | }; |
65 | ||
66 | #endif // __HEAPALLOCATORBROWSER_H__ |