Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / src / genericgui / Resource.hxx
1 // Copyright (C) 2006-2012  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _RESOURCE_HXX_
21 #define _RESOURCE_HXX_
22
23 #include "GenericGuiExport.hxx"
24
25 #include <QColor>
26 #include <QFont>
27
28 // Define the general names of the resources
29 // -----------------------------------------
30
31 #define _COMPONENT_INSTANCE_NEW "COMPONENT_INSTANCE_NEW"
32
33 // Define the names of the resources for colors
34 // --------------------------------------------
35
36 #define _editedNodeBrushColor "editedNodeBrushColor"
37 #define _normalNodeBrushColor "normalNodeBrushColor"
38 #define _runNodeBrushColor    "runNodeBrushColor"
39 #define _validNodeColor       "validNodeColor"
40 #define _invalidNodeColor     "invalidNodeColor"
41
42 #define _NOTYETINITIALIZED    "NOTYETINITIALIZED"
43 #define _INITIALISED          "INITIALISED"
44 #define _RUNNING              "RUNNING"
45 #define _WAITINGTASKS         "WAITINGTASKS"
46 #define _PAUSED               "PAUSED"
47 #define _FINISHED             "FINISHED"
48 #define _STOPPED              "STOPPED"
49 #define _UNKNOWN              "UNKNOWN"
50
51 #define _UNDEFINED            "UNDEFINED"
52 #define _INVALID              "INVALID"
53 #define _READY                "READY"
54 #define _TOLOAD               "TOLOAD"
55 #define _LOADED               "LOADED"
56 #define _TOACTIVATE           "TOACTIVATE"
57 #define _ACTIVATED            "ACTIVATED"
58 #define _DESACTIVATED         "DESACTIVATED"
59 #define _DONE                 "DONE"
60 #define _SUSPENDED            "SUSPENDED"
61 #define _LOADFAILED           "LOADFAILED"
62 #define _EXECFAILED           "EXECFAILED"
63 #define _PAUSE                "PAUSE"
64 #define _INTERNALERR          "INTERNALERR"
65 #define _DISABLED             "DISABLED"
66 #define _FAILED               "FAILED"
67 #define _ERROR                "ERROR"
68 #define _DEFAULT              "DEFAULT"
69
70 #define _Scene_pen              "Scene_pen"
71 #define _Scene_hiPen            "Scene_hiPen"
72 #define _Scene_brush            "Scene_brush"
73 #define _Scene_hiBrush          "Scene_hiBrush"
74 #define _ComposedNode_brush     "ComposedNode_brush"
75 #define _ComposedNode_hiBrush   "ComposedNode_hiBrush"
76 #define _ComposedNode_pen       "ComposedNode_pen"
77 #define _ComposedNode_hiPen     "ComposedNode_hiPen"
78 #define _ElementaryNode_brush   "ElementaryNode_brush"
79 #define _ElementaryNode_hiBrush "ElementaryNode_hiBrush"
80 #define _ElementaryNode_pen     "ElementaryNode_pen"
81 #define _ElementaryNode_hiPen   "ElementaryNode_hiPen"
82 #define _Header_brush           "Header_brush"
83 #define _Header_hiBrush         "Header_hiBrush"
84 #define _Header_pen             "Header_pen"
85 #define _Header_hiPen           "Header_hiPen"
86 #define _CtrlPort_brush         "CtrlPort_brush"
87 #define _CtrlPort_hiBrush       "CtrlPort_hiBrush"
88 #define _CtrlPort_pen           "CtrlPort_pen"
89 #define _CtrlPort_hiPen         "CtrlPort_hiPen"
90 #define _DataPort_brush         "DataPort_brush"
91 #define _DataPort_hiBrush       "DataPort_hiBrush"
92 #define _DataPort_pen           "DataPort_pen"
93 #define _DataPort_hiPen         "DataPort_hiPen"
94 #define _DataStreamPort_brush         "DataStreamPort_brush"
95 #define _DataStreamPort_hiBrush       "DataStreamPort_hiBrush"
96 #define _DataStreamPort_pen           "DataStreamPort_pen"
97 #define _DataStreamPort_hiPen         "DataStreamPort_hiPen"
98
99 #define __dragOver       "dragOver"
100
101 // Default values
102 // --------------
103
104 #define COMPONENTINSTANCENEW    true
105 #define PYTHONFONT              QFont("Courier")
106 #define PYTHONEXTERNALEDITOR    ""
107 #define USERCATALOG             "YACSUserCatalog.xml"
108 #define ADDROWCOLS              true
109 #define STRAIGHTLINKS           false
110 #define AUTOCOMPUTELINKS        true
111 #define SIMPLIFYLINK            true
112 #define ENSUREVISIBLEWHENMOVED  true
113 #define TABPANELSUP             true
114 #define DOCKWIDGETPRIORITY      0
115
116 #define EDITEDNODEBRUSHCOLOR    QColor(255, 255, 190)
117 #define NORMALNODEBRUSHCOLOR    QColor(230, 235, 255)
118 #define RUNNODEBRUSHCOLOR       QColor(205, 218, 255)
119 #define VALIDNODECOLOR          QColor(128, 255, 128)
120 #define INVALIDNODECOLOR        QColor(255, 128, 128)
121
122 #define EMPHASIZEBRUSHCOLOR     QColor(  0, 255,   0)
123
124 #define NOTYETINITIALIZED_      QColor(255, 243, 205)
125 #define INITIALISED_            QColor(230, 255, 205)
126 #define RUNNING_                QColor(205, 255, 218)
127 #define WAITINGTASKS_           QColor(205, 255, 255)
128 #define PAUSED_                 QColor(205, 218, 255)
129 #define FINISHED_               QColor(230, 205, 255)
130 #define STOPPED_                QColor(255, 205, 243)
131 #define UNKNOWN_                QColor(255, 205, 205)
132
133 #define UNDEFINED_      Qt::lightGray
134 #define INVALID_        Qt::red
135 #define READY_          Qt::gray
136 #define TOLOAD_         Qt::darkYellow
137 #define LOADED_         Qt::darkMagenta
138 #define TOACTIVATE_     Qt::darkCyan
139 #define ACTIVATED_      Qt::darkBlue
140 #define DESACTIVATED_   Qt::gray
141 #define DONE_           Qt::darkGreen
142 #define SUSPENDED_      Qt::gray
143 #define LOADFAILED_     QColor(255, 0, 170)
144 #define EXECFAILED_     QColor(255, 85, 0)
145 #define PAUSE_          QColor(0, 255, 255)
146 #define INTERNALERR_    QColor(255, 0, 85)
147 #define DISABLED_       QColor(255, 170, 0)
148 #define FAILED_         QColor(170,  85, 0)
149 #define ERROR_          QColor(255, 0, 0)
150 #define DEFAULT_        Qt::lightGray
151
152 #define LINKDRAW_COLOR            QColor(  0,   0, 192)
153 #define LINK_SELECT_COLOR         QColor(192, 192, 255)
154 #define STREAMLINKDRAW_COLOR      QColor(192, 192,   0)
155 #define STREAMLINK_SELECT_COLOR   QColor(255, 255, 192)
156 #define CTRLLINKDRAW_COLOR        QColor(192,   0, 192)
157 #define CTRLLINK_SELECT_COLOR     QColor(255, 192, 255)
158 #define LINK_PEN_DARKNESS         150
159 #define LINK_THICKNESS            1.0
160 #define LINK_SEPARATION_WEIGHT    10
161
162 #define Scene_pen_              QColor(  0,   0, 128)
163 #define Scene_hiPen_            QColor(  0,   0, 190)
164 #define Scene_brush_            QColor(128, 128, 128)
165 #define Scene_hiBrush_          QColor(190, 190, 190)
166 #define ComposedNode_brush_     QColor(213, 213, 213)
167 #define ComposedNode_hiBrush_   QColor(225, 225, 225)
168 #define ComposedNode_pen_       QColor(120, 120, 120)
169 #define ComposedNode_hiPen_     QColor( 60,  60,  60)
170 #define ElementaryNode_brush_   QColor(189, 230, 185)
171 #define ElementaryNode_hiBrush_ QColor(209, 255, 205)
172 #define ElementaryNode_pen_     QColor( 15, 180,   0)
173 #define ElementaryNode_hiPen_   QColor( 11, 128,   0)
174 #define Header_brush_           QColor(215, 220, 238)
175 #define Header_hiBrush_         QColor(161, 178, 238)
176 #define Header_pen_             QColor(120, 120, 120)
177 #define Header_hiPen_           QColor( 60,  60,  60)
178 #define CtrlPort_brush_         QColor(205, 210, 227)
179 #define CtrlPort_hiBrush_       QColor(161, 176, 227)
180 #define CtrlPort_pen_           QColor(120, 120, 120)
181 #define CtrlPort_hiPen_         QColor( 60,  60,  60)
182 #define DataPort_brush_         QColor(158, 227, 151)
183 #define DataPort_hiBrush_       QColor(127, 227, 116)
184 #define DataPort_pen_           QColor( 15, 180,   0)
185 #define DataPort_hiPen_         QColor( 11, 128,   0)
186 #define DataStreamPort_brush_   QColor(158, 227, 151)
187 #define DataStreamPort_hiBrush_ QColor(127, 227, 116)
188 #define DataStreamPort_pen_     QColor( 15, 180,   0)
189 #define DataStreamPort_hiPen_   QColor( 11, 128,   0)
190
191 #define dragOver_               QColor(255,   0,   0)
192
193 // Define Resource class
194 // ---------------------
195
196 namespace YACS {
197   namespace HMI {
198     class GENERICGUI_EXPORT Resource {
199       public:
200         Resource();
201
202       public:
203         // General resource
204         static bool COMPONENT_INSTANCE_NEW;
205         static QString userCatalog;
206         static QString pythonExternalEditor;
207         static bool addRowCols;
208         static bool straightLinks;
209         static bool autoComputeLinks;
210         static bool simplifyLink;
211         static bool ensureVisibleWhenMoved;
212         static int  dockWidgetPriority;
213
214         // Colors of state of nodes
215         static QColor editedNodeBrushColor;
216         static QColor normalNodeBrushColor;
217         static QColor runNodeBrushColor;
218         static QColor validNodeColor;
219         static QColor invalidNodeColor;
220
221         static QColor emphasizeBrushColor;
222
223         static QColor NOTYETINITIALIZED;
224         static QColor INITIALISED;
225         static QColor RUNNING;
226         static QColor WAITINGTASKS;
227         static QColor PAUSED;
228         static QColor FINISHED;
229         static QColor STOPPED;
230         static QColor UNKNOWN;
231
232         static QColor UNDEFINED;
233         static QColor INVALID;
234         static QColor READY;
235         static QColor TOLOAD;
236         static QColor LOADED;
237         static QColor TOACTIVATE;
238         static QColor ACTIVATED;
239         static QColor DESACTIVATED;
240         static QColor DONE;
241         static QColor SUSPENDED;
242         static QColor LOADFAILED;
243         static QColor EXECFAILED;
244         static QColor PAUSE;
245         static QColor INTERNALERR;
246         static QColor DISABLED;
247         static QColor FAILED;
248         static QColor ERROR;
249         static QColor DEFAULT;
250
251         // Python font
252         static QFont  pythonfont;
253
254         // Link colors
255         static QColor link_draw_color;
256         static QColor stream_link_draw_color;
257         static QColor link_select_color;
258         static QColor stream_link_select_color;
259         static QColor control_link_draw_color;
260         static QColor control_link_select_color;
261
262         static int link_pen_darkness;
263         static int link_separation_weight;
264         static double link_thickness;
265
266         // Node colors
267         static QColor Scene_pen;
268         static QColor Scene_hiPen;
269         static QColor Scene_brush;
270         static QColor Scene_hiBrush;
271         static QColor ComposedNode_brush;
272         static QColor ComposedNode_hiBrush;
273         static QColor ComposedNode_pen;
274         static QColor ComposedNode_hiPen;
275         static QColor ElementaryNode_brush;
276         static QColor ElementaryNode_hiBrush;
277         static QColor ElementaryNode_pen;
278         static QColor ElementaryNode_hiPen;
279         static QColor Header_brush;
280         static QColor Header_hiBrush;
281         static QColor Header_pen;
282         static QColor Header_hiPen;
283         static QColor CtrlPort_brush;
284         static QColor CtrlPort_hiBrush;
285         static QColor CtrlPort_pen;
286         static QColor CtrlPort_hiPen;
287         static QColor DataPort_brush;
288         static QColor DataPort_hiBrush;
289         static QColor DataPort_pen;
290         static QColor DataPort_hiPen;
291         static QColor DataStreamPort_brush;
292         static QColor DataStreamPort_hiBrush;
293         static QColor DataStreamPort_pen;
294         static QColor DataStreamPort_hiPen;
295
296         static QColor dragOver;
297
298         // Node parameters
299         static int CtrlPort_Width;
300         static int CtrlPort_Height;
301         static int DataPort_Width;
302         static int DataPort_Height;
303
304         static int Thickness;
305
306         static int Border_Margin;
307         static int Space_Margin;
308
309         static int Line_Space;
310         static int Line_Width;
311
312         static int Text_DX;
313
314         static int Corner_Margin;
315         static int Header_Height;
316         static int Radius;
317
318         static bool tabPanelsUp;
319     };
320   }
321 }
322
323 #endif