FINAL CUT
fwidgetcolors.h
1 /***********************************************************************
2 * fwidgetcolors.h - Set widget color theme *
3 * *
4 * This file is part of the FINAL CUT widget toolkit *
5 * *
6 * Copyright 2018-2024 Markus Gans *
7 * *
8 * FINAL CUT is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as *
10 * published by the Free Software Foundation; either version 3 of *
11 * the License, or (at your option) any later version. *
12 * *
13 * FINAL CUT is distributed in the hope that it will be useful, but *
14 * WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this program. If not, see *
20 * <http://www.gnu.org/licenses/>. *
21 ***********************************************************************/
22 
23 /* Standalone class
24  * ════════════════
25  *
26  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
27  * ▕ FWidgetColors ▏
28  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
29  */
30 
31 #ifndef FWIDGETCOLORS_H
32 #define FWIDGETCOLORS_H
33 
34 #if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
35  #error "Only <final/final.h> can be included directly."
36 #endif
37 
38 #include "final/fc.h"
39 #include "final/util/fstring.h"
40 
41 namespace finalcut
42 {
43 
44 //----------------------------------------------------------------------
45 // class FWidgetColors
46 //----------------------------------------------------------------------
47 
49 {
50  public:
51  // Constructor
52  FWidgetColors() = default;
53 
54  // Destructor
55  virtual ~FWidgetColors() noexcept;
56 
57  // Method
58  virtual auto getClassName() const -> FString;
59  virtual void setColorTheme() = 0;
60 
62  {
63  FColor fg{FColor::Default};
64  FColor bg{FColor::Default};
65  };
66 
67  struct DialogColors
68  {
69  FColor fg{FColor::Default};
70  FColor bg{FColor::Default};
71  FColor resize_fg{FColor::Default};
72  FColor emphasis_fg{FColor::Default};
73  };
74 
75  struct TextColors
76  {
77  FColor fg{FColor::Default};
78  FColor bg{FColor::Default};
79  FColor selected_fg{FColor::Default};
80  FColor selected_bg{FColor::Default};
81  FColor selected_focus_fg{FColor::Default};
82  FColor selected_focus_bg{FColor::Default};
83  };
84 
86  {
87  FColor fg{FColor::Default};
88  FColor bg{FColor::Default};
89  FColor emphasis_fg{FColor::Default};
90  };
91 
93  {
94  FColor fg{FColor::Default};
95  FColor bg{FColor::Default};
96  FColor focus_fg{FColor::Default};
97  FColor focus_bg{FColor::Default};
98  FColor inc_search_fg{FColor::Default};
99  FColor selected_fg{FColor::Default};
100  FColor selected_bg{FColor::Default};
101  FColor selected_focus_fg{FColor::Default};
102  FColor selected_focus_bg{FColor::Default};
103  };
104 
105  struct ListColors
106  {
107  FColor fg{FColor::Default};
108  FColor bg{FColor::Default};
109  FColor selected_fg{FColor::Default};
110  FColor selected_bg{FColor::Default};
111  };
112 
113  struct LabelColors
114  {
115  FColor fg{FColor::Default};
116  FColor bg{FColor::Default};
117  FColor inactive_fg{FColor::Default};
118  FColor inactive_bg{FColor::Default};
119  FColor hotkey_fg{FColor::Default};
120  FColor hotkey_bg{FColor::Default};
121  FColor emphasis_fg{FColor::Default};
122  FColor ellipsis_fg{FColor::Default};
123  };
124 
126  {
127  FColor fg{FColor::Default};
128  FColor bg{FColor::Default};
129  FColor focus_fg{FColor::Default};
130  FColor focus_bg{FColor::Default};
131  FColor inactive_fg{FColor::Default};
132  FColor inactive_bg{FColor::Default};
133  };
134 
136  {
137  FColor fg{FColor::Default};
138  FColor bg{FColor::Default};
139  FColor focus_fg{FColor::Default};
140  FColor focus_bg{FColor::Default};
141  FColor inactive_fg{FColor::Default};
142  FColor inactive_bg{FColor::Default};
143  };
144 
146  {
147  FColor fg{FColor::Default};
148  FColor bg{FColor::Default};
149  FColor focus_fg{FColor::Default};
150  FColor focus_bg{FColor::Default};
151  FColor inactive_fg{FColor::Default};
152  FColor inactive_bg{FColor::Default};
153  FColor hotkey_fg{FColor::Default};
154  };
155 
157  {
158  FColor fg{FColor::Default};
159  FColor bg{FColor::Default};
160  FColor inactive_fg{FColor::Default};
161  FColor inactive_bg{FColor::Default};
162  FColor button_fg{FColor::Default};
163  FColor button_bg{FColor::Default};
164  FColor button_focus_fg{FColor::Default};
165  FColor button_focus_bg{FColor::Default};
166  };
167 
168  struct MenuColors
169  {
170  FColor fg{FColor::Default};
171  FColor bg{FColor::Default};
172  FColor focus_fg{FColor::Default};
173  FColor focus_bg{FColor::Default};
174  FColor inactive_fg{FColor::Default};
175  FColor inactive_bg{FColor::Default};
176  FColor hotkey_fg{FColor::Default};
177  FColor hotkey_bg{FColor::Default};
178  };
179 
181  {
182  FColor fg{FColor::Default};
183  FColor bg{FColor::Default};
184  FColor focus_fg{FColor::Default};
185  FColor focus_bg{FColor::Default};
186  FColor separator_fg{FColor::Default};
187  FColor hotkey_fg{FColor::Default};
188  FColor hotkey_bg{FColor::Default};
189  FColor focus_hotkey_fg{FColor::Default};
190  FColor focus_hotkey_bg{FColor::Default};
191  };
192 
194  {
195  FColor fg{FColor::Default};
196  FColor bg{FColor::Default};
197  FColor button_fg{FColor::Default};
198  FColor button_bg{FColor::Default};
199  FColor button_inactive_fg{FColor::Default};
200  FColor button_inactive_bg{FColor::Default};
201  };
202 
203  // Data members
204  NonContextualColors term{};
205  DialogColors dialog{};
206  TextColors text{};
207  ErrorBoxColors error_box{};
208  NonContextualColors tooltip{};
209  NonContextualColors shadow{};
210  CurrentElementColors current_element{};
211  ListColors list{};
212  LabelColors label{};
213  InputFieldColors input_field{};
214  ToggleButtonColors toggle_button{};
215  ButtonColors button{};
216  TitlebarColors titlebar{};
217  MenuColors menu{};
218  StatusbarColors statusbar{};
219  ScrollbarColors scrollbar{};
220  NonContextualColors progressbar{};
221 };
222 
223 // FWidgetColors inline functions
224 //----------------------------------------------------------------------
225 inline auto FWidgetColors::getClassName() const -> FString
226 { return "FWidgetColors"; }
227 
228 
229 /* Inheritance diagram
230  * ═══════════════════
231  *
232  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
233  * ▕ FWidgetColors ▏
234  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
235  * ▲
236  * │
237  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
238  * ▕ default8ColorTheme ▏
239  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
240  */
241 
242 //----------------------------------------------------------------------
243 // class default8ColorTheme
244 //----------------------------------------------------------------------
245 
246 class default8ColorTheme final : public FWidgetColors
247 {
248  public:
249  // Constructor
251 
252  // Destructor
253  ~default8ColorTheme() noexcept override;
254 
255  // Method
256  auto getClassName() const -> FString override;
257  void setColorTheme() override;
258 
259  private:
260  void setTermColors();
261  void setDialogColors();
262  void setTextColors();
263  void setErrorBoxColors();
264  void setTooltipColors();
265  void setShadowColors();
266  void setCurrentElementColors();
267  void setListColors();
268  void setLabelColors();
269  void setInputFieldColors();
270  void setToggleButtonColors();
271  void setButtonColors();
272  void setTitlebarColors();
273  void setMenuColors();
274  void setStatusbarColors();
275  void setScrollbarColors();
276  void setProgressbarColors();
277 };
278 
279 // default8ColorTheme inline functions
280 //----------------------------------------------------------------------
281 inline auto default8ColorTheme::getClassName() const -> FString
282 { return "default8ColorTheme"; }
283 
284 
285 /* Inheritance diagram
286  * ═══════════════════
287  *
288  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
289  * ▕ FWidgetColors ▏
290  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
291  * ▲
292  * │
293  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
294  * ▕ default16ColorTheme ▏
295  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
296  */
297 
298 //----------------------------------------------------------------------
299 // class default16ColorTheme
300 //----------------------------------------------------------------------
301 
302 class default16ColorTheme final : public FWidgetColors
303 {
304  public:
305  // Constructor
307 
308  // Destructor
309  ~default16ColorTheme() noexcept override;
310 
311  // Method
312  auto getClassName() const -> FString override;
313  void setColorTheme() override;
314 
315  private:
316  void setTermColors();
317  void setDialogColors();
318  void setTextColors();
319  void setErrorBoxColors();
320  void setTooltipColors();
321  void setShadowColors();
322  void setCurrentElementColors();
323  void setListColors();
324  void setLabelColors();
325  void setInputFieldColors();
326  void setToggleButtonColors();
327  void setButtonColors();
328  void setTitlebarColors();
329  void setMenuColors();
330  void setStatusbarColors();
331  void setScrollbarColors();
332  void setProgressbarColors();
333 };
334 
335 // default16ColorTheme inline functions
336 //----------------------------------------------------------------------
337 inline auto default16ColorTheme::getClassName() const -> FString
338 { return "default16ColorTheme"; }
339 
340 
341 /* Inheritance diagram
342  * ═══════════════════
343  *
344  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
345  * ▕ FWidgetColors ▏
346  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
347  * ▲
348  * │
349  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
350  * ▕ default8ColorDarkTheme ▏
351  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
352  */
353 
354 //----------------------------------------------------------------------
355 // class default8ColorDarkTheme
356 //----------------------------------------------------------------------
357 
359 {
360  public:
361  // Constructor
363 
364  // Destructor
365  ~default8ColorDarkTheme() noexcept override;
366 
367  // Method
368  auto getClassName() const -> FString override;
369  void setColorTheme() override;
370 
371  private:
372  void setTermColors();
373  void setDialogColors();
374  void setTextColors();
375  void setErrorBoxColors();
376  void setTooltipColors();
377  void setShadowColors();
378  void setCurrentElementColors();
379  void setListColors();
380  void setLabelColors();
381  void setInputFieldColors();
382  void setToggleButtonColors();
383  void setButtonColors();
384  void setTitlebarColors();
385  void setMenuColors();
386  void setStatusbarColors();
387  void setScrollbarColors();
388  void setProgressbarColors();
389 };
390 
391 // default8ColorDarkTheme inline functions
392 //----------------------------------------------------------------------
393 inline auto default8ColorDarkTheme::getClassName() const -> FString
394 { return "default8ColorDarkTheme"; }
395 
396 
397 /* Inheritance diagram
398  * ═══════════════════
399  *
400  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
401  * ▕ FWidgetColors ▏
402  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
403  * ▲
404  * │
405  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
406  * ▕ default16ColorDarkTheme ▏
407  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
408  */
409 
410 //----------------------------------------------------------------------
411 // class default16ColorDarkTheme
412 //----------------------------------------------------------------------
413 
415 {
416  public:
417  // Constructor
419 
420  // Destructor
421  ~default16ColorDarkTheme() noexcept override;
422 
423  // Method
424  auto getClassName() const -> FString override;
425  void setColorTheme() override;
426 
427  private:
428  void setTermColors();
429  void setDialogColors();
430  void setTextColors();
431  void setErrorBoxColors();
432  void setTooltipColors();
433  void setShadowColors();
434  void setCurrentElementColors();
435  void setListColors();
436  void setLabelColors();
437  void setInputFieldColors();
438  void setToggleButtonColors();
439  void setButtonColors();
440  void setTitlebarColors();
441  void setMenuColors();
442  void setStatusbarColors();
443  void setScrollbarColors();
444  void setProgressbarColors();
445 };
446 
447 // default16ColorDarkTheme inline functions
448 //----------------------------------------------------------------------
449 inline auto default16ColorDarkTheme::getClassName() const -> FString
450 { return "default16ColorDarkTheme"; }
451 
452 } // namespace finalcut
453 
454 #endif // FWIDGETCOLORS_H
Definition: fwidgetcolors.h:135
Definition: fwidgetcolors.h:125
Definition: fwidgetcolors.h:61
Definition: fwidgetcolors.h:105
Definition: fwidgetcolors.h:358
Definition: fwidgetcolors.h:180
Definition: fwidgetcolors.h:193
Definition: class_template.cpp:25
Definition: fwidgetcolors.h:48
Definition: fwidgetcolors.h:75
Definition: fwidgetcolors.h:156
Definition: fwidgetcolors.h:168
Definition: fwidgetcolors.h:92
Definition: fwidgetcolors.h:85
Definition: fwidgetcolors.h:414
Definition: fstring.h:79
Definition: fwidgetcolors.h:67
Definition: fwidgetcolors.h:113
Definition: fwidgetcolors.h:145
Definition: fwidgetcolors.h:246
Definition: fwidgetcolors.h:302