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) Lumiera.org
5  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6  2017, Hermann Vosseler <Ichthyostega@web.de>
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of
11  the License, or (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 
22 */
23 
24 
36 #ifndef STAGE_WORKSPACE_UI_STYLE_H
37 #define STAGE_WORKSPACE_UI_STYLE_H
38 
39 #include "stage/gtk-base.hpp"
40 #include "common/advice.hpp"
41 #include "lib/symbol.hpp"
42 #include "lib/nocopy.hpp"
43 
44 #include <cairomm/cairomm.h>
45 #include <string>
46 
47 
48 namespace stage {
49 
50  namespace model { class Project; }
51  namespace controller { class Controller; }
52  namespace timeline { class TimelineWidget; }
53 
54  class UiBus;
55 
56 namespace workspace {
57 
58  using lib::Literal;
59  using std::string;
60 
62 
63 
64 
65 
72  class UiStyle
73  : public Gtk::UIManager
75  {
76 
77  string iconSearchPath_;
78  string resourceSerachPath_;
79 
80  StyleAdvice styleAdviceTrackBody_;
81  StyleAdvice styleAdviceTrackRuler_;
82 
83  public:
84 
89  static Gtk::IconSize GiantIconSize;
90 
95  static Gtk::IconSize MenuIconSize;
96 
97 
98  public:
105  UiStyle();
106 
113  void setTheme (string const& stylesheetName);
114 
129  void prepareStyleContext (timeline::TimelineWidget const&);
130 
131 
141  static Cairo::RefPtr<Cairo::SolidPattern>
142  readStyleColourProperty (Gtk::Widget &widget, const gchar *property_name,
143  guint16 red, guint16 green, guint16 blue);
144 
145  private:
146  void registerAppIconSizes();
147  void registerStockItems();
148 
158  bool
159  addStockIconSet (Glib::RefPtr<Gtk::IconFactory> const& factory
160  ,Literal iconName
161  ,Literal id
162  ,Literal label);
163 
173  bool
174  addStockIcon (Glib::RefPtr<Gtk::IconSet> const& icon_set
175  ,cuString& icon_name
176  ,Gtk::IconSize size
177  ,bool wildcard);
178 
187  bool
188  addThemeIconSource (Glib::RefPtr<Gtk::IconSet> const& icon_set
189  ,cuString& icon_name
190  ,Gtk::IconSize size
191  ,bool wildcard);
192 
202  bool
203  addNonThemeIconSource (Glib::RefPtr<Gtk::IconSet> const& icon_set
204  ,cuString& base_dir
205  ,cuString& icon_name
206  ,Gtk::IconSize size
207  ,bool wildcard);
208 
217  bool
218  addStockIconFromPath (string path
219  ,Glib::RefPtr<Gtk::IconSet> const& icon_set
220  ,Gtk::IconSize size
221  ,bool wildcard);
222 
223  };
224 
225 
226 
227 }}// namespace stage::workspace
228 #endif /*STAGE_WORKSPACE_UI_STYLE_H*/
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
inline string literal This is a marker type to indicate that
Definition: symbol.hpp:85
static Gtk::IconSize GiantIconSize
The registered icon size for giant 48x48 px icons.
Definition: ui-style.hpp:89
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:95
Core timeline display (custom widget).
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
A set of basic GTK includes for the UI.
Manage global concerns regarding a coherent user interface.
Definition: ui-style.hpp:72