-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiwingpluginstructwrapper.h
94 lines (82 loc) · 3.54 KB
/
iwingpluginstructwrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef IWINGPLUGINSTRUCTWRAPPER_H
#define IWINGPLUGINSTRUCTWRAPPER_H
#include "../WingHexExplorer/WingHexExplorer/plugin/iwingplugin.h"
#include <QObject>
class IWingPluginStructWrapper : public QObject {
Q_OBJECT
public slots:
// HexPosition
HexPosition *new_HexPosition() {
auto h = new HexPosition;
h->line = 0;
h->column = 0;
h->nibbleindex = 0;
h->lineWidth = 16; //编辑器固定列数是16
return h;
}
void delete_HexPosition(HexPosition *pos) { delete pos; }
qint64 offset(HexPosition *hexpos) { return hexpos->offset(); }
quint64 line(HexPosition *hexpos) { return hexpos->line; }
int column(HexPosition *hexpos) { return hexpos->column; }
quint8 lineWidth(HexPosition *hexpos) { return hexpos->lineWidth; }
int nibbleindex(HexPosition *hexpos) { return hexpos->nibbleindex; }
void setLine(HexPosition *hexpos, quint64 line) { hexpos->line = line; }
void setColumn(HexPosition *hexpos, int column) { hexpos->column = column; }
void setNibbleindex(HexPosition *hexpos, int nibbleindex) {
hexpos->nibbleindex = nibbleindex;
}
// BookMark
BookMark *new_BookMark() { return new BookMark; }
void delete_BookMark(BookMark *bm) { delete bm; }
qlonglong pos(BookMark *bm) { return bm->pos; }
QString comment(BookMark *bm) { return bm->comment; }
void setPos(BookMark *bm, qlonglong pos) { bm->pos = pos; }
void setComment(BookMark *bm, QString comment) { bm->comment = comment; }
// FindResult
int fid(FindResult *fr) { return fr->fid; }
QList<int> indices(FindResult *fr) { return fr->indices; }
// HexMetadataAbsoluteItem
HexMetadataAbsoluteItem *new_HexMetadataAbsoluteItem(qint64 begin, qint64 end,
QColor foreground,
QColor background,
QString comment) {
auto meta = new HexMetadataAbsoluteItem;
meta->begin = begin;
meta->end = end;
meta->foreground = foreground;
meta->background = background;
meta->comment = comment;
return meta;
}
void delete_HexMetadataAbsoluteItem(HexMetadataAbsoluteItem *meta) {
delete meta;
}
qint64 begin(HexMetadataAbsoluteItem *meta) { return meta->begin; }
qint64 end(HexMetadataAbsoluteItem *meta) { return meta->end; }
QColor foreground(HexMetadataAbsoluteItem *meta) { return meta->foreground; }
QColor background(HexMetadataAbsoluteItem *meta) { return meta->background; }
QString comment(HexMetadataAbsoluteItem *meta) { return meta->comment; }
// HexMetadataItem
HexMetadataItem *new_HexMetadataItem(quint64 line, int start, int length,
QColor foreground, QColor background,
QString comment) {
auto meta = new HexMetadataItem;
meta->line = line;
meta->start = start;
meta->length = length;
meta->foreground = foreground;
meta->background = background;
meta->comment = comment;
return meta;
}
void delete_HexMetadataItem(HexMetadataItem *meta) { delete meta; }
quint64 line(HexMetadataItem *meta) { return meta->line; }
int start(HexMetadataItem *meta) { return meta->start; }
int length(HexMetadataItem *meta) { return meta->length; }
QColor foreground(HexMetadataItem *meta) { return meta->foreground; }
QColor background(HexMetadataItem *meta) { return meta->background; }
QString comment(HexMetadataItem *meta) { return meta->comment; }
// ErrFile
int value(ErrFile *err) { return int(*err); }
};
#endif // IWINGPLUGINSTRUCTWRAPPER_H