Salome HOME
Merge branch 'master' into omu/workloadmanager
[modules/yacs.git] / src / genericgui / Resource.hxx
1 // Copyright (C) 2006-2020  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, or (at your option) any later version.
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 #define PROGRESSBARCOLOR        Qt::darkGreen
116 #define PROGRESSBARLABEL        2
117
118 #define EDITEDNODEBRUSHCOLOR    QColor(255, 255, 190)
119 #define NORMALNODEBRUSHCOLOR    QColor(230, 235, 255)
120 #define RUNNODEBRUSHCOLOR       QColor(205, 218, 255)
121 #define VALIDNODECOLOR          QColor(128, 255, 128)
122 #define INVALIDNODECOLOR        QColor(255, 128, 128)
123
124 #define EMPHASIZEBRUSHCOLOR     QColor(  0, 255,   0)
125
126 #define NOTYETINITIALIZED_      QColor(255, 243, 205)
127 #define INITIALISED_            QColor(230, 255, 205)
128 #define RUNNING_                QColor(205, 255, 218)
129 #define WAITINGTASKS_           QColor(205, 255, 255)
130 #define PAUSED_                 QColor(205, 218, 255)
131 #define FINISHED_               QColor(230, 205, 255)
132 #define STOPPED_                QColor(255, 205, 243)
133 #define UNKNOWN_                QColor(255, 205, 205)
134
135 #define UNDEFINED_      Qt::lightGray
136 #define INVALID_        Qt::red
137 #define READY_          Qt::gray
138 #define TOLOAD_         Qt::darkYellow
139 #define LOADED_         Qt::darkMagenta
140 #define TOACTIVATE_     Qt::darkCyan
141 #define ACTIVATED_      Qt::darkBlue
142 #define DESACTIVATED_   Qt::gray
143 #define DONE_           Qt::darkGreen
144 #define SUSPENDED_      Qt::gray
145 #define LOADFAILED_     QColor(255, 0, 170)
146 #define EXECFAILED_     QColor(255, 85, 0)
147 #define PAUSE_          QColor(0, 255, 255)
148 #define INTERNALERR_    QColor(255, 0, 85)
149 #define DISABLED_       QColor(255, 170, 0)
150 #define FAILED_         QColor(170,  85, 0)
151 #define ERROR_          QColor(255, 0, 0)
152 #define DEFAULT_        Qt::lightGray
153
154 #define LINKDRAW_COLOR            QColor(  0,   0, 192)
155 #define LINK_SELECT_COLOR         QColor(192, 192, 255)
156 #define STREAMLINKDRAW_COLOR      QColor(192, 192,   0)
157 #define STREAMLINK_SELECT_COLOR   QColor(255, 255, 192)
158 #define CTRLLINKDRAW_COLOR        QColor(192,   0, 192)
159 #define CTRLLINK_SELECT_COLOR     QColor(255, 192, 255)
160 #define LINK_PEN_DARKNESS         150
161 #define LINK_THICKNESS            1.0
162 #define LINK_SEPARATION_WEIGHT    10
163
164 #define Scene_pen_              QColor(  0,   0, 128)
165 #define Scene_hiPen_            QColor(  0,   0, 190)
166 #define Scene_brush_            QColor(128, 128, 128)
167 #define Scene_hiBrush_          QColor(190, 190, 190)
168 #define ComposedNode_brush_     QColor(213, 213, 213)
169 #define ComposedNode_hiBrush_   QColor(225, 225, 225)
170 #define ComposedNode_pen_       QColor(120, 120, 120)
171 #define ComposedNode_hiPen_     QColor( 60,  60,  60)
172 #define ElementaryNode_brush_   QColor(189, 230, 185)
173 #define ElementaryNode_hiBrush_ QColor(209, 255, 205)
174 #define ElementaryNode_pen_     QColor( 15, 180,   0)
175 #define ElementaryNode_hiPen_   QColor( 11, 128,   0)
176 #define Header_brush_           QColor(215, 220, 238)
177 #define Header_hiBrush_         QColor(161, 178, 238)
178 #define Header_pen_             QColor(120, 120, 120)
179 #define Header_hiPen_           QColor( 60,  60,  60)
180 #define CtrlPort_brush_         QColor(205, 210, 227)
181 #define CtrlPort_hiBrush_       QColor(161, 176, 227)
182 #define CtrlPort_pen_           QColor(120, 120, 120)
183 #define CtrlPort_hiPen_         QColor( 60,  60,  60)
184 #define DataPort_brush_         QColor(158, 227, 151)
185 #define DataPort_hiBrush_       QColor(127, 227, 116)
186 #define DataPort_pen_           QColor( 15, 180,   0)
187 #define DataPort_hiPen_         QColor( 11, 128,   0)
188 #define DataStreamPort_brush_   QColor(158, 227, 151)
189 #define DataStreamPort_hiBrush_ QColor(127, 227, 116)
190 #define DataStreamPort_pen_     QColor( 15, 180,   0)
191 #define DataStreamPort_hiPen_   QColor( 11, 128,   0)
192
193 #define dragOver_               QColor(255,   0,   0)
194
195 // Define Resource class
196 // ---------------------
197
198 namespace YACS {
199   namespace HMI {
200     class GENERICGUI_EXPORT Resource {
201       public:
202         Resource();
203
204       public:
205         // General resource
206         static bool COMPONENT_INSTANCE_NEW;
207         static QString userCatalog;
208         static QString pythonExternalEditor;
209         static bool addRowCols;
210         static bool straightLinks;
211         static bool autoComputeLinks;
212         static bool simplifyLink;
213         static bool ensureVisibleWhenMoved;
214         static int  dockWidgetPriority;
215         static QColor progressBarColor;
216         static int    progressBarLabel;
217
218         // Colors of state of nodes
219         static QColor editedNodeBrushColor;
220         static QColor normalNodeBrushColor;
221         static QColor runNodeBrushColor;
222         static QColor validNodeColor;
223         static QColor invalidNodeColor;
224
225         static QColor emphasizeBrushColor;
226
227         static QColor NOTYETINITIALIZED;
228         static QColor INITIALISED;
229         static QColor RUNNING;
230         static QColor WAITINGTASKS;
231         static QColor PAUSED;
232         static QColor FINISHED;
233         static QColor STOPPED;
234         static QColor UNKNOWN;
235
236         static QColor UNDEFINED;
237         static QColor INVALID;
238         static QColor READY;
239         static QColor TOLOAD;
240         static QColor LOADED;
241         static QColor TOACTIVATE;
242         static QColor ACTIVATED;
243         static QColor DESACTIVATED;
244         static QColor DONE;
245         static QColor SUSPENDED;
246         static QColor LOADFAILED;
247         static QColor EXECFAILED;
248         static QColor PAUSE;
249         static QColor INTERNALERR;
250         static QColor DISABLED;
251         static QColor FAILED;
252         static QColor ERROR;
253         static QColor DEFAULT;
254
255         // Python font
256         static QFont  pythonfont;
257
258         // Link colors
259         static QColor link_draw_color;
260         static QColor stream_link_draw_color;
261         static QColor link_select_color;
262         static QColor stream_link_select_color;
263         static QColor control_link_draw_color;
264         static QColor control_link_select_color;
265
266         static int link_pen_darkness;
267         static int link_separation_weight;
268         static double link_thickness;
269
270         // Node colors
271         static QColor Scene_pen;
272         static QColor Scene_hiPen;
273         static QColor Scene_brush;
274         static QColor Scene_hiBrush;
275         static QColor ComposedNode_brush;
276         static QColor ComposedNode_hiBrush;
277         static QColor ComposedNode_pen;
278         static QColor ComposedNode_hiPen;
279         static QColor ElementaryNode_brush;
280         static QColor ElementaryNode_hiBrush;
281         static QColor ElementaryNode_pen;
282         static QColor ElementaryNode_hiPen;
283         static QColor Header_brush;
284         static QColor Header_hiBrush;
285         static QColor Header_pen;
286         static QColor Header_hiPen;
287         static QColor CtrlPort_brush;
288         static QColor CtrlPort_hiBrush;
289         static QColor CtrlPort_pen;
290         static QColor CtrlPort_hiPen;
291         static QColor DataPort_brush;
292         static QColor DataPort_hiBrush;
293         static QColor DataPort_pen;
294         static QColor DataPort_hiPen;
295         static QColor DataStreamPort_brush;
296         static QColor DataStreamPort_hiBrush;
297         static QColor DataStreamPort_pen;
298         static QColor DataStreamPort_hiPen;
299
300         static QColor dragOver;
301
302         // Node parameters
303         static int CtrlPort_Width;
304         static int CtrlPort_Height;
305         static int DataPort_Width;
306         static int DataPort_Height;
307
308         static int Thickness;
309
310         static int Border_Margin;
311         static int Space_Margin;
312
313         static int Line_Space;
314         static int Line_Width;
315
316         static int Text_DX;
317
318         static int Corner_Margin;
319         static int Header_Height;
320         static int Radius;
321
322         static int progressBar_Height;
323
324         static bool tabPanelsUp;
325     };
326   }
327 }
328
329 #endif