Debugger source code clean-up
[clinton/Virtual-Jaguar-Rx.git] / src / debugger / CartFilesListWin.h
CommitLineData
24470541
JPM
1//
2// CartFilesListWin.h: List files from directory
3//
4// by Jean-Paul Mari
5//
6
7#ifndef __CARTFILESLISTWIN_H__
8#define __CARTFILESLISTWIN_H__
9
10#include <QtWidgets>
11#include <stdint.h>
12
13//
14//#define CFL_BUFFERTREAM // Display the buffer stream
15
16// Error code definitions
17#define CFL_NOERROR 0x00
18#define CFL_ERROR 0x80
19#define CFL_WARNING 0x40
20#define CFL_NOFILESLIST (0x01 | CFL_WARNING)
21#define CFL_NODIRECTORYLIST (0x02 | CFL_WARNING)
22#define CFL_NODIRUSE (0x04 | CFL_WARNING)
23
24// Cart directory type
25#define CFL_NOTYPE 0x00
26#define CFL_OSJAGTYPE 0x01
27
28
29//
30class CartFilesListWindow: public QWidget
31{
32 Q_OBJECT
33
34 typedef struct _fileitem
35 {
36 size_t column;
37 QStandardItem *PreviousItem;
38 QStandardItem *Item;
39 }Sfileitem;
40
41 typedef struct S_CARTDIRINFO
42 {
43 bool valid;
44 char *PtrFilename;
45 size_t SizeFile;
46 size_t PtrDataFile;
47 size_t CurrentSeek;
48 size_t PtrBufferStream;
49 }
50 CARTDIRINFO;
51
52 typedef struct S_OSJAGDir
53 {
54 long PtrDataFile;
55 long SizeFile;
56 char Filename[];
57 }
58 OSJAGDir;
59
60 public:
61 CartFilesListWindow(QWidget *parent = 0);
62 ~CartFilesListWindow(void);
63 void RefreshContents(void);
64 void Reset(void);
65
66 private:
67 void *AddItem(char *ItemName, size_t ItemPos);
68 void AddFilename(char *FileName, QStandardItem *root, size_t ItemPos);
69 void UpdateInfos(void);
70 void *CreateInfos(void);
71 size_t GetDirType(void);
72 size_t GetNbrFiles(void);
73 void GetFileInfos(CARTDIRINFO *Ptr, size_t index);
74
75 protected:
76 void keyPressEvent(QKeyEvent * e);
77
78 private:
79 size_t nbItem, CartDirType, CartNbrFiles, CartUsedBytes;
80 QVBoxLayout *layout;
6642f781
JPM
81 QVBoxLayout *TVlayout;
82 QVBoxLayout *Mlayout;
24470541
JPM
83 QTreeView *treeView;
84 QStandardItemModel *standardModel;
85 QStandardItem *rootNode;
86 CARTDIRINFO *CartDirectory;
6642f781 87 QStatusBar *TVstatusbar;
24470541
JPM
88 Sfileitem *fileItems;
89 QStandardItemModel *model;
90 QTableView *TableView;
91};
92
93#endif // __CARTFILESLISTWIN_H__