Changeset View
Changeset View
Standalone View
Standalone View
src/structs.h
Show All 36 Lines | 35 | enum class BindingType { | |||
---|---|---|---|---|---|
37 | UChar, | 37 | UChar, | ||
38 | Int, | 38 | Int, | ||
39 | UInt, | 39 | UInt, | ||
40 | ULongLong, | 40 | ULongLong, | ||
41 | Float, | 41 | Float, | ||
42 | QString, | 42 | QString, | ||
43 | QByteArray, | 43 | QByteArray, | ||
44 | Object, | 44 | Object, | ||
45 | Void, | ||||
45 | }; | 46 | }; | ||
46 | 47 | | |||
47 | struct BindingTypeProperties { | 48 | struct BindingTypeProperties { | ||
48 | BindingType type; | 49 | BindingType type; | ||
49 | QString name; | 50 | QString name; | ||
50 | QString cppSetType; | 51 | QString cppSetType; | ||
51 | QString cSetType; | 52 | QString cSetType; | ||
52 | QString rustType; | 53 | QString rustType; | ||
Show All 14 Lines | |||||
67 | struct Property { | 68 | struct Property { | ||
68 | QString name; | 69 | QString name; | ||
69 | BindingTypeProperties type; | 70 | BindingTypeProperties type; | ||
70 | bool write; | 71 | bool write; | ||
71 | bool optional; | 72 | bool optional; | ||
72 | bool rustByValue; | 73 | bool rustByValue; | ||
73 | }; | 74 | }; | ||
74 | 75 | | |||
76 | struct Argument { | ||||
77 | QString name; | ||||
78 | BindingTypeProperties type; | ||||
79 | }; | ||||
80 | | ||||
81 | struct Function { | ||||
82 | QString name; | ||||
83 | BindingTypeProperties type; | ||||
84 | QList<Argument> args; | ||||
85 | bool mut; | ||||
86 | }; | ||||
87 | | ||||
75 | struct ItemProperty { | 88 | struct ItemProperty { | ||
76 | QString name; | 89 | QString name; | ||
77 | BindingTypeProperties type; | 90 | BindingTypeProperties type; | ||
78 | bool write; | 91 | bool write; | ||
79 | bool optional; | 92 | bool optional; | ||
80 | bool rustByValue; | 93 | bool rustByValue; | ||
81 | QList<QList<Qt::ItemDataRole>> roles; | 94 | QList<QList<Qt::ItemDataRole>> roles; | ||
82 | }; | 95 | }; | ||
83 | 96 | | |||
84 | struct Object { | 97 | struct Object { | ||
85 | QString name; | 98 | QString name; | ||
86 | ObjectType type; | 99 | ObjectType type; | ||
87 | QList<Property> properties; | 100 | QList<Property> properties; | ||
88 | QList<ItemProperty> itemProperties; | 101 | QList<ItemProperty> itemProperties; | ||
102 | QList<Function> functions; | ||||
89 | int columnCount; | 103 | int columnCount; | ||
90 | bool containsObject() { | 104 | bool containsObject() { | ||
91 | for (auto p: properties) { | 105 | for (auto p: properties) { | ||
92 | if (p.type.type == BindingType::Object) { | 106 | if (p.type.type == BindingType::Object) { | ||
93 | return true; | 107 | return true; | ||
94 | } | 108 | } | ||
95 | } | 109 | } | ||
96 | return false; | 110 | return false; | ||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |