Lumiera  0.pre.03
»edityourfreedom«
WindowLocator Class Reference

#include "gui/ctrl/window-locator.hpp"

Description

A centralised manager of all top level application windows.

Definition at line 67 of file window-locator.hpp.

Public Member Functions

 WindowLocator (GlobalCtx &)
 
 ~WindowLocator ()
 
void closeWindow ()
 close (and thus destroy) the current active window. More...
 
bool empty () const
 
workspace::WorkspaceWindowfindActiveWindow ()
 find and retrieve a WorkspaceWindow (top-level window) marked as 'active' by GTK. More...
 
workspace::WorkspaceWindowfindFocusWindow ()
 similar to findActiveWindow(), for the 'has_focus' property More...
 
PanelLocatorlocatePanel ()
 
void newWindow ()
 

Private Types

using PWindow = std::shared_ptr< workspace::WorkspaceWindow >
 
using Service_ElementAccess = lib::DependInject< model::ElementAccess >::ServiceInstance< ElemAccessDir >
 

Private Member Functions

bool on_window_closed (GdkEventAny *event)
 Event handler for when a window has been closed. More...
 
void updateCloseWindowInMenus ()
 On creating and closing of any window, handle enabling or disabling of the Window/Close Window menu option. More...
 
- Private Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
 ~NonCopyable ()=default
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Private Attributes

Service_ElementAccess elementAccess_
 
GlobalCtxglobalCtx_
 
PanelLocator panelLoc_
 
list< PWindowwindowList_
 

Member Typedef Documentation

◆ PWindow

Definition at line 70 of file window-locator.hpp.

◆ Service_ElementAccess

Definition at line 71 of file window-locator.hpp.

Constructor & Destructor Documentation

◆ WindowLocator()

◆ ~WindowLocator()

Definition at line 65 of file window-locator.cpp.

Member Function Documentation

◆ empty()

bool empty ( ) const
inline

Definition at line 119 of file window-locator.hpp.

◆ newWindow()

void newWindow ( )

Definition at line 70 of file window-locator.cpp.

References WindowLocator::globalCtx_, WindowLocator::on_window_closed(), GlobalCtx::uiManager_, WindowLocator::updateCloseWindowInMenus(), and WindowLocator::windowList_.

Referenced by Actions::populateMainActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closeWindow()

void closeWindow ( )

close (and thus destroy) the current active window.

Note
closing the last window terminates the application
Warning
when no window is currently active, the fist one in list will be killed

Definition at line 92 of file window-locator.cpp.

References WindowLocator::findActiveWindow().

Referenced by Actions::populateMainActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findActiveWindow()

WorkspaceWindow & findActiveWindow ( )

find and retrieve a WorkspaceWindow (top-level window) marked as 'active' by GTK.

Returns
the first matching window, or the first window in list, when no window is marked active
Note
never NULL, but assuming this function is only ever called when there is at least one Lumiera window.

Definition at line 106 of file window-locator.cpp.

References util::isnil(), and WindowLocator::windowList_.

Referenced by WindowLocator::closeWindow(), InteractionDirector::getWorkspaceWindow(), Wizard::launchTestCtrl(), Actions::populateShowPanelActions(), and Wizard::show_HelpAbout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findFocusWindow()

WorkspaceWindow & findFocusWindow ( )

similar to findActiveWindow(), for the 'has_focus' property

Note
likewise we return the first window in list, in case no window has keyboard focus. This may very well be the case.

Definition at line 124 of file window-locator.cpp.

References util::isnil(), and WindowLocator::windowList_.

+ Here is the call graph for this function:

◆ locatePanel()

PanelLocator& locatePanel ( )
inline

Definition at line 92 of file window-locator.hpp.

Referenced by InteractionDirector::injectTimeline(), and Wizard::Wizard().

+ Here is the caller graph for this function:

◆ on_window_closed()

bool on_window_closed ( GdkEventAny *  event)
private

Event handler for when a window has been closed.

Definition at line 138 of file window-locator.cpp.

References WindowLocator::globalCtx_, UiManager::terminateUI(), GlobalCtx::uiManager_, WindowLocator::updateCloseWindowInMenus(), and WindowLocator::windowList_.

Referenced by WindowLocator::newWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCloseWindowInMenus()

void updateCloseWindowInMenus ( )
private

On creating and closing of any window, handle enabling or disabling of the Window/Close Window menu option.

It should be enabled when there is more than one window and disabled otherwise.

Definition at line 173 of file window-locator.cpp.

References UiManager::allowCloseWindow(), WindowLocator::globalCtx_, GlobalCtx::uiManager_, and WindowLocator::windowList_.

Referenced by WindowLocator::newWindow(), and WindowLocator::on_window_closed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ globalCtx_

◆ windowList_

◆ panelLoc_

PanelLocator panelLoc_
private

Definition at line 75 of file window-locator.hpp.

Referenced by WindowLocator::WindowLocator().

◆ elementAccess_

Service_ElementAccess elementAccess_
private

Definition at line 77 of file window-locator.hpp.

Referenced by WindowLocator::WindowLocator().

+ Inheritance diagram for WindowLocator:
+ Collaboration diagram for WindowLocator:

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