26 |
26 |
27 class LDDocument; |
27 class LDDocument; |
28 class Ui_MakePrimUI; |
28 class Ui_MakePrimUI; |
29 class PrimitiveCategory; |
29 class PrimitiveCategory; |
30 struct Primitive |
30 struct Primitive |
31 { str name, title; |
31 { |
|
32 str name, title; |
32 PrimitiveCategory* cat; |
33 PrimitiveCategory* cat; |
33 }; |
34 }; |
34 |
35 |
35 class PrimitiveCategory : public QObject |
36 class PrimitiveCategory : public QObject |
36 { Q_OBJECT |
37 { |
|
38 Q_OBJECT |
37 PROPERTY (public, str, Name, STR_OPS, STOCK_WRITE) |
39 PROPERTY (public, str, Name, STR_OPS, STOCK_WRITE) |
38 |
40 |
39 public: |
41 public: |
40 enum ERegexType |
42 enum ERegexType |
41 { EFilenameRegex, |
43 { |
|
44 EFilenameRegex, |
42 ETitleRegex |
45 ETitleRegex |
43 }; |
46 }; |
44 |
47 |
45 struct RegexEntry |
48 struct RegexEntry |
46 { QRegExp regex; |
49 { |
|
50 QRegExp regex; |
47 ERegexType type; |
51 ERegexType type; |
48 }; |
52 }; |
49 |
53 |
50 QList<RegexEntry> regexes; |
54 QList<RegexEntry> regexes; |
51 QList<Primitive> prims; |
55 QList<Primitive> prims; |
64 // |
68 // |
65 // Worker object that scans the primitives folder for primitives and |
69 // Worker object that scans the primitives folder for primitives and |
66 // builds an index of them. |
70 // builds an index of them. |
67 // ============================================================================= |
71 // ============================================================================= |
68 class PrimitiveLister : public QObject |
72 class PrimitiveLister : public QObject |
69 { Q_OBJECT |
73 { |
|
74 Q_OBJECT |
70 |
75 |
71 public: |
76 public: |
72 explicit PrimitiveLister (QObject* parent = 0); |
77 explicit PrimitiveLister (QObject* parent = 0); |
73 virtual ~PrimitiveLister(); |
78 virtual ~PrimitiveLister(); |
74 static void start(); |
79 static void start(); |
92 |
97 |
93 void loadPrimitives(); |
98 void loadPrimitives(); |
94 PrimitiveLister* getPrimitiveLister(); |
99 PrimitiveLister* getPrimitiveLister(); |
95 |
100 |
96 enum PrimitiveType |
101 enum PrimitiveType |
97 { Circle, |
102 { |
|
103 Circle, |
98 Cylinder, |
104 Cylinder, |
99 Disc, |
105 Disc, |
100 DiscNeg, |
106 DiscNeg, |
101 Ring, |
107 Ring, |
102 Cone, |
108 Cone, |
103 }; |
109 }; |
104 |
110 |
105 // ============================================================================= |
111 // ============================================================================= |
106 class PrimitivePrompt : public QDialog |
112 class PrimitivePrompt : public QDialog |
107 { Q_OBJECT |
113 { |
|
114 Q_OBJECT |
108 |
115 |
109 public: |
116 public: |
110 explicit PrimitivePrompt (QWidget* parent = null, Qt::WindowFlags f = 0); |
117 explicit PrimitivePrompt (QWidget* parent = null, Qt::WindowFlags f = 0); |
111 virtual ~PrimitivePrompt(); |
118 virtual ~PrimitivePrompt(); |
112 Ui_MakePrimUI* ui; |
119 Ui_MakePrimUI* ui; |