Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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
39namespace stage {
40
41 namespace model { class Project; }
42 namespace controller { class Controller; }
43 namespace timeline { class TimelineWidget; }
44
45 class UiBus;
46
47namespace workspace {
48
49 using lib::Literal;
50 using std::string;
51
53
54
55
56
63 class UiStyle
64 : public Gtk::UIManager
66 {
67
70
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
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:
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*/
Expecting Advice and giving Advice: a cross-cutting collaboration of loosely coupled participants.
Inline string literal.
Definition symbol.hpp:78
Core timeline display (custom widget).
Manage global concerns regarding a coherent user interface.
Definition ui-style.hpp:66
StyleAdvice styleAdviceTrackRuler_
Definition ui-style.hpp:72
bool addStockIcon(Glib::RefPtr< Gtk::IconSet > const &icon_set, cuString &icon_name, Gtk::IconSize size, bool wildcard)
Loads an icon, searching standard icon locations, and adds it to an icon set.
Definition ui-style.cpp:256
static Gtk::IconSize GiantIconSize
The registered icon size for giant 48x48 px icons.
Definition ui-style.hpp:80
bool addThemeIconSource(Glib::RefPtr< Gtk::IconSet > const &icon_set, cuString &icon_name, Gtk::IconSize size, bool wildcard)
Loads an icon from a the icon theme.
Definition ui-style.cpp:280
StyleAdvice styleAdviceTrackBody_
Definition ui-style.hpp:71
bool addStockIconFromPath(string path, Glib::RefPtr< Gtk::IconSet > const &icon_set, Gtk::IconSize size, bool wildcard)
Loads an icon from a specific path and adds it to an icon set.
Definition ui-style.cpp:326
static Cairo::RefPtr< Cairo::SolidPattern > readStyleColourProperty(Gtk::Widget &widget, const gchar *property_name, guint16 red, guint16 green, guint16 blue)
A utility function which reads a colour style from the GTK Style.
Definition ui-style.cpp:147
bool addNonThemeIconSource(Glib::RefPtr< Gtk::IconSet > const &icon_set, cuString &base_dir, cuString &icon_name, Gtk::IconSize size, bool wildcard)
Loads an icon from a non theme set.
Definition ui-style.cpp:306
UiStyle()
Set up a coherent theming and styling for the application.
Definition ui-style.cpp:57
void prepareStyleContext(timeline::TimelineWidget const &)
Use the existing TimelineWidget's GTK-WidgetPath to establish a systematic CSS styling context,...
Definition ui-style.cpp:115
void registerStockItems()
Registers application stock items: icons and labels associated with IDs.
Definition ui-style.cpp:192
static Gtk::IconSize MenuIconSize
The registered icon size for giant 16x16 px icons.
Definition ui-style.hpp:86
void setTheme(string const &stylesheetName)
Sets the theme to use for the Lumiera GUI.
Definition ui-style.cpp:75
bool addStockIconSet(Glib::RefPtr< Gtk::IconFactory > const &factory, Literal iconName, Literal id, Literal label)
Adds an icon (in different sizes) to the icon factory.
Definition ui-style.cpp:223
Any copy and copy construction prohibited.
Definition nocopy.hpp:38
A set of basic GTK includes for the UI.
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
const uString cuString
Definition gtk-base.hpp:93
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Marker types to indicate a literal string and a Symbol.