| 22 #include <QListWidget> |
22 #include <QListWidget> |
| 23 #include <QRadioButton> |
23 #include <QRadioButton> |
| 24 #include "configuration.h" |
24 #include "configuration.h" |
| 25 #include "ldObject.h" |
25 #include "ldObject.h" |
| 26 #include "ui_ldforge.h" |
26 #include "ui_ldforge.h" |
| |
27 #include "colors.h" |
| 27 |
28 |
| 28 class MessageManager; |
29 class MessageManager; |
| 29 class MainWindow; |
30 class MainWindow; |
| 30 class LDColor; |
31 class LDColorData; |
| 31 class QToolButton; |
32 class QToolButton; |
| 32 class QDialogButtonBox; |
33 class QDialogButtonBox; |
| 33 class GLRenderer; |
34 class GLRenderer; |
| 34 class QComboBox; |
35 class QComboBox; |
| 35 class QProgressBar; |
36 class QProgressBar; |
| 56 #define CTRL_SHIFT(N) (Qt::CTRL | Qt::SHIFT | Qt::Key_##N) |
57 #define CTRL_SHIFT(N) (Qt::CTRL | Qt::SHIFT | Qt::Key_##N) |
| 57 |
58 |
| 58 // ============================================================================= |
59 // ============================================================================= |
| 59 class LDQuickColor |
60 class LDQuickColor |
| 60 { |
61 { |
| 61 PROPERTY (public, LDColor*, color, setColor, STOCK_WRITE) |
62 PROPERTY (public, LDColor, color, setColor, STOCK_WRITE) |
| 62 PROPERTY (public, QToolButton*, toolButton, setToolButton, STOCK_WRITE) |
63 PROPERTY (public, QToolButton*, toolButton, setToolButton, STOCK_WRITE) |
| 63 |
64 |
| 64 public: |
65 public: |
| 65 LDQuickColor (LDColor* color, QToolButton* toolButton); |
66 LDQuickColor (LDColor color, QToolButton* toolButton); |
| 66 bool isSeparator() const; |
67 bool isSeparator() const; |
| 67 |
68 |
| 68 static LDQuickColor getSeparator(); |
69 static LDQuickColor getSeparator(); |
| 69 }; |
70 }; |
| 70 |
71 |
| 127 // document list is rebuilt instead. |
128 // document list is rebuilt instead. |
| 128 void updateDocumentListItem (LDDocumentPtr doc); |
129 void updateDocumentListItem (LDDocumentPtr doc); |
| 129 |
130 |
| 130 // Returns the uniform selected color (i.e. 4 if everything selected is |
131 // Returns the uniform selected color (i.e. 4 if everything selected is |
| 131 // red), -1 if there is no such consensus. |
132 // red), -1 if there is no such consensus. |
| 132 int getSelectedColor(); |
133 LDColor getSelectedColor(); |
| 133 |
134 |
| 134 // Automatically scrolls the object list so that it points to the first |
135 // Automatically scrolls the object list so that it points to the first |
| 135 // selected object. |
136 // selected object. |
| 136 void scrollToSelection(); |
137 void scrollToSelection(); |
| 137 |
138 |
| 140 |
141 |
| 141 // Deletes all selected objects, returns the count of deleted objects. |
142 // Deletes all selected objects, returns the count of deleted objects. |
| 142 int deleteSelection(); |
143 int deleteSelection(); |
| 143 |
144 |
| 144 // Deletes all objects by the given color number. |
145 // Deletes all objects by the given color number. |
| 145 void deleteByColor (int colnum); |
146 void deleteByColor (LDColor color); |
| 146 |
147 |
| 147 // Tries to save the given document. |
148 // Tries to save the given document. |
| 148 bool save (LDDocumentPtr doc, bool saveAs); |
149 bool save (LDDocumentPtr doc, bool saveAs); |
| 149 |
150 |
| 150 // Updates various actions, undo/redo are set enabled/disabled where |
151 // Updates various actions, undo/redo are set enabled/disabled where |
| 329 |
330 |
| 330 //! Displays an error prompt with the given \c message |
331 //! Displays an error prompt with the given \c message |
| 331 void critical (const QString& message); |
332 void critical (const QString& message); |
| 332 |
333 |
| 333 //! Makes an icon of \c size x \c size pixels to represent \c colinfo |
334 //! Makes an icon of \c size x \c size pixels to represent \c colinfo |
| 334 QIcon makeColorIcon (LDColor* colinfo, const int size); |
335 QIcon makeColorIcon (LDColor colinfo, const int size); |
| 335 |
336 |
| 336 //! Fills the given combo-box with color information |
337 //! Fills the given combo-box with color information |
| 337 void makeColorComboBox (QComboBox* box); |
338 void makeColorComboBox (QComboBox* box); |
| 338 |
339 |
| 339 //! \returns a QImage from the given raw GL \c data |
340 //! \returns a QImage from the given raw GL \c data |