Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UiManager Class Reference

#include "gui/ctrl/ui-manager.hpp"

Description

The Lumiera UI framework and backbone object.

Initialises the GTK and GLib framework, starts and stops the GTK event loop, and manages global concerns regarding a coherent user interface. Offers access to some global UI resources, and establishes further global services to create workspace windows, to bind menu / command actions and to create interface widgets for working with the the top-level model parts.

Note
UiManager itself is not a model::Controller, and thus not directly connected as a first-class entity to the Bus, but it operates the GlobalCtx, and thus in turn holds the interact::InteractionDirector, which corresponds to the model root.

Definition at line 94 of file ui-manager.hpp.

Public Member Functions

 UiManager (UiBus &bus)
 Initialise the GTK framework and the Lumiera UI backbone. More...
 
 ~UiManager ()
 
void allowCloseWindow (bool yes)
 
void createApplicationWindow ()
 Set up the first top-level application window. More...
 
void performMainLoop ()
 start the GTK Main loop and thus activate the UI. More...
 
void terminateUI ()
 Cause the main event loop to terminate, so the application as a whole unwinds. More...
 
void updateWindowFocusRelatedActions ()
 

Private Attributes

unique_ptr< Actionsactions_
 
unique_ptr< Facadefacade_
 
unique_ptr< GlobalCtxglobals_
 
unique_ptr
< workspace::StyleManager
styleManager_
 

Additional Inherited Members

- Protected Member Functions inherited from ApplicationBase
 ApplicationBase ()
 Initialise the GTK framework libraries. More...
 
 ~ApplicationBase ()
 

Constructor & Destructor Documentation

UiManager ( UiBus bus)

Initialise the GTK framework and the Lumiera UI backbone.

There is one global UiManager instance, which is created by the Application.

See also
performMainLoop
Remarks
Creating the UiManager initialises the interface globally on application start. It wires the global services and attaches to the UI-Bus, defines the main application menu and binds the corresponding actions. Moreover, the StyleManager register the icon configuration and sizes and loads the icon definitions.

Definition at line 100 of file ui-manager.cpp.

~UiManager ( )

Definition at line 62 of file ui-manager.cpp.

Member Function Documentation

void createApplicationWindow ( )

Set up the first top-level application window.

This triggers the build-up of the user interface widgets.

Remarks
this function is invoked once from the main application object, immediately prior to starting the GTK event loop.

Definition at line 117 of file ui-manager.cpp.

References UiManager::globals_.

void performMainLoop ( )

start the GTK Main loop and thus activate the UI.

Run the GTK UI.

Note
this function does not return until UI shutdown.

Also activate the UI the external interfaces.

Remarks
this function is equivalent to calling Gtk::Main::run() In GTK-3.0.3, the implementation is already based on libGIO; after possibly handling command line arguments (which does not apply in our case), it invokes g_main_loop_run(), which in turn ends up polling the main context via g_main_context_iterate(), until the use count drops to zero. This is the "event loop".

Definition at line 134 of file ui-manager.cpp.

References UiManager::facade_, and UiManager::globals_.

void terminateUI ( )

Cause the main event loop to terminate, so the application as a whole unwinds.

Note
this function can be invoked from an UI event, since it just signals shutdown to the GTK event loop by invoking gtk_main_quit(). The latter will finish processing of the current event and then return from the UiManager::performmainLoop() call, which eventually causes the UI subsystem to signal termination to the Lumiera application as a whole.

Definition at line 152 of file ui-manager.cpp.

Referenced by WindowLocator::on_window_closed(), Actions::populateMainActions(), and NotificationService::triggerGuiShutdown().

+ Here is the caller graph for this function:

void updateWindowFocusRelatedActions ( )
Todo:
find a solution how to enable/disable menu entries according to focus /////////////////////////////////////////////////TICKET #1076 find out how to handle this properly

Definition at line 158 of file ui-manager.cpp.

References UiManager::actions_, and UiManager::globals_.

void allowCloseWindow ( bool  yes)

Definition at line 166 of file ui-manager.cpp.

Referenced by WindowLocator::updateCloseWindowInMenus().

+ Here is the caller graph for this function:

Member Data Documentation

unique_ptr<Actions> actions_
private

Definition at line 99 of file ui-manager.hpp.

Referenced by UiManager::updateWindowFocusRelatedActions().

unique_ptr<Facade> facade_
private

Definition at line 100 of file ui-manager.hpp.

Referenced by UiManager::performMainLoop().

unique_ptr<workspace::StyleManager> styleManager_
private

Definition at line 102 of file ui-manager.hpp.

+ Inheritance diagram for UiManager:
+ Collaboration diagram for UiManager:

The documentation for this class was generated from the following files: