Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
ui-manager.cpp
Go to the documentation of this file.
1/*
2 UiManager - Global UI Manager
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#include "stage/gtk-base.hpp"
28#include "stage/config-keys.hpp"
32#include "stage/ctrl/facade.hpp"
34#include "lib/searchpath.hpp"
35#include "lib/util.hpp"
36
37#include <gdlmm.h>
38
39using util::isnil;
40
41
42namespace stage {
43namespace ctrl {
44
45 using Gtk::IconSize;
46 using Gtk::IconFactory;
47
48 using workspace::UiStyle;
49
50
51
52
53 // dtors via smart-ptr invoked from here...
55
56
67 {
68 Glib::thread_init();
69 //---------------------------------------------copied from Gtk::Main
70 gtk_init (nullptr, nullptr);
71 Gtk::Main::init_gtkmm_internals();
72 //---------------------------------------------copied from Gtk::Main
73 Gdl::init();
74 }
75
77 {
78 //---------------------------------------------copied from Gtk::Main
79 // Release the gtkmm type registration tables,
80 // allowing Main to be instantiated again:
81 Glib::wrap_register_cleanup();
82 Glib::Error::register_cleanup();
83 //---------------------------------------------copied from Gtk::Main
84
85 // NOTE: GtkMainConnectionNode only serves the deprecated key_snooper API as of 2018
86 }
87
88
97 , Gtk::UIManager()
98 , globals_{new GlobalCtx{bus, *this}}
99 , uiStyle_{new UiStyle{}}
100 , actions_{new Actions{*globals_}}
101 , facade_{} // note: not activated yet
102 {
104 }
105
106
111 void
113 {
114 if (globals_->windowLoc_.empty())
115 globals_->windowLoc_.newWindow();
116 }
117
118
128 void
130 {
131 facade_.reset (new Facade{globals_->uiBus_, *this});
132
133 gtk_main(); // GTK event loop
134
135 facade_.reset (nullptr);
136 }
137
138
146 void
148 {
149 gtk_main_quit();
150 }
151
152
160 void
162 {
163 UNIMPLEMENTED ("TICKET #1151 build a suitable dispatcher into the GTK loop");
164 }
165
166
167 void
169 {
171 actions_->updateActionState (globals_->windowLoc_.findActiveWindow());
172 }
173
174
175 void
177 {
178 this->get_action("/MenuBar/WindowMenu/WindowCloseWindow")
179 ->set_sensitive (yes);
180 }
181
182
183 void
185 {
186 uiStyle_->prepareStyleContext (timeline);
187 }
188
189
190
191}}// namespace stage::ctrl
Setup of global actions for the main menu.
Backbone of the Lumiera GTK GUI.
Definition ui-bus.hpp:124
A helper class which registers global user actions and populates the main menu and toolbar.
Definition actions.hpp:71
void populateMainActions(Gtk::UIManager &uiManager)
Populates the uiManager with the main set of global actions.
Definition actions.hpp:90
Framework initialisation base.
ApplicationBase()
Initialise the GTK framework libraries.
A context to hold and manage the implementation of all UI facade interfaces.
A global circle of top-level UI management facilities.
unique_ptr< Facade > facade_
unique_ptr< Actions > actions_
unique_ptr< UiStyle > uiStyle_
void updateWindowFocusRelatedActions()
UiManager(UiBus &bus)
Initialise the GTK framework and the Lumiera UI backbone.
std::function< void(void)> Operation
void configureStyle(timeline::TimelineWidget const &)
void performMainLoop()
start the GTK Main loop and thus activate the UI.
void allowCloseWindow(bool yes)
void terminateUI()
Cause the main event loop to terminate, so the application as a whole unwinds.
void createApplicationWindow()
Set up the first top-level application window.
unique_ptr< GlobalCtx > globals_
void schedule(Operation &&task)
perform an action within the UI event loop (GTK loop).
Core timeline display (custom widget).
Manage global concerns regarding a coherent user interface.
Definition ui-style.hpp:66
Definition of access keys for global UI configuration.
Dependency context to hold all the global UI top-level entities.
A set of basic GTK includes for the UI.
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
bool isnil(lib::time::Duration const &dur)
Helpers to handle directory search paths.
Manage the lifecycle of the public UI facade interface(s).
Manager for global user interface concerns, framework integration and global state.
Service for global theming and style related concerns.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...