Lumiera  0.pre.03
»edit your freedom«
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 &)
 
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.
 
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 (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Private Attributes

Service_ElementAccess elementAccess_
 
GlobalCtxglobalCtx_
 
PanelLocator panelLoc_
 
list< PWindowwindowList_
 

Member Function Documentation

◆ 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.

◆ 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.

Referenced by 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.

◆ 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.

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

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