Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
WindowLocator Class Reference

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

Description

A centralised manager of all top level application windows.

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

Public Member Functions

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

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.
 
void updateCloseWindowInMenus ()
 On creating and closing of any window, handle enabling or disabling of the Window/Close Window menu option.
 
- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Private Attributes

GlobalCtxglobalCtx_
 
list< PWindowwindowList_
 
PanelLocator panelLoc_
 
Service_ElementAccess elementAccess_
 

Constructor & Destructor Documentation

◆ WindowLocator()

WindowLocator ( GlobalCtx globals)

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

◆ ~WindowLocator()

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

Member Typedef Documentation

◆ PWindow

using PWindow = std::shared_ptr<workspace::WorkspaceWindow>
private

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

◆ Service_ElementAccess

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

Member Function Documentation

◆ empty()

bool empty ( ) const
inline

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

References WindowLocator::windowList_.

◆ newWindow()

void newWindow ( )

Definition at line 60 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 82 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 96 of file window-locator.cpp.

References WindowLocator::windowList_.

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

+ 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 114 of file window-locator.cpp.

References WindowLocator::windowList_.

◆ locatePanel()

PanelLocator & locatePanel ( )
inline

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

References WindowLocator::panelLoc_.

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

+ 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 128 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 163 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 66 of file window-locator.hpp.

Referenced by WindowLocator::locatePanel().

◆ elementAccess_

Service_ElementAccess elementAccess_
private

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

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

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