Lumiera  0.pre.03
»edit your freedom«
ui-style.hpp
Go to the documentation of this file.
1 /*
2  UI-STYLE.hpp - manage coherent UI styling
3 
4  Copyright (C)
5  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6  2017, Hermann Vosseler <Ichthyostega@web.de>
7 
8   **Lumiera** is free software; you can redistribute it and/or modify it
9   under the terms of the GNU General Public License as published by the
10   Free Software Foundation; either version 2 of the License, or (at your
11   option) any later version. See the file COPYING for further details.
12 
13 */
14 
15 
27 #ifndef STAGE_WORKSPACE_UI_STYLE_H
28 #define STAGE_WORKSPACE_UI_STYLE_H
29 
30 #include "stage/gtk-base.hpp"
31 #include "common/advice.hpp"
32 #include "lib/symbol.hpp"
33 #include "lib/nocopy.hpp"
34 
35 #include <cairomm/cairomm.h>
36 #include <string>
37 
38 
39 namespace stage {
40 
41  namespace model { class Project; }
42  namespace controller { class Controller; }
43  namespace timeline { class TimelineWidget; }
44 
45  class UiBus;
46 
47 namespace workspace {
48 
49  using lib::Literal;
50  using std::string;
51 
53 
54 
55 
56 
63  class UiStyle
64  : public Gtk::UIManager
66  {
67 
68  string iconSearchPath_;
69  string resourceSerachPath_;
70 
71  StyleAdvice styleAdviceTrackBody_;
72  StyleAdvice styleAdviceTrackRuler_;
73 
74  public:
75 
80  static Gtk::IconSize GiantIconSize;
81 
86  static Gtk::IconSize MenuIconSize;
87 
88 
89  public:
96  UiStyle();
97 
104  void setTheme (string const& stylesheetName);
105 
120  void prepareStyleContext (timeline::TimelineWidget const&);
121 
122 
132  static Cairo::RefPtr<Cairo::SolidPattern>
133  readStyleColourProperty (Gtk::Widget &widget, const gchar *property_name,
134  guint16 red, guint16 green, guint16 blue);
135 
136  private:
137  void registerAppIconSizes();
138  void registerStockItems();
139 
149  bool
150  addStockIconSet (Glib::RefPtr<Gtk::IconFactory> const& factory
151  ,Literal iconName
152  ,Literal id
153  ,Literal label);
154 
164  bool
165  addStockIcon (Glib::RefPtr<Gtk::IconSet> const& icon_set
166  ,cuString& icon_name
167  ,Gtk::IconSize size
168  ,bool wildcard);
169 
178  bool
179  addThemeIconSource (Glib::RefPtr<Gtk::IconSet> const& icon_set
180  ,cuString& icon_name
181  ,Gtk::IconSize size
182  ,bool wildcard);
183 
193  bool
194  addNonThemeIconSource (Glib::RefPtr<Gtk::IconSet> const& icon_set
195  ,cuString& base_dir
196  ,cuString& icon_name
197  ,Gtk::IconSize size
198  ,bool wildcard);
199 
208  bool
209  addStockIconFromPath (string path
210  ,Glib::RefPtr<Gtk::IconSet> const& icon_set
211  ,Gtk::IconSize size
212  ,bool wildcard);
213 
214  };
215 
216 
217 
218 }}// namespace stage::workspace
219 #endif /*STAGE_WORKSPACE_UI_STYLE_H*/
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
inline string literal This is a marker type to indicate that
Definition: symbol.hpp:76
static Gtk::IconSize GiantIconSize
The registered icon size for giant 48x48 px icons.
Definition: ui-style.hpp:80
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Expecting Advice and giving Advice: a cross-cutting collaboration of loosely coupled participants...
Marker types to indicate a literal string and a Symbol.
static Gtk::IconSize MenuIconSize
The registered icon size for giant 16x16 px icons.
Definition: ui-style.hpp:86
Core timeline display (custom widget).
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37
A set of basic GTK includes for the UI.
Manage global concerns regarding a coherent user interface.
Definition: ui-style.hpp:63