38 using workspace::WorkspaceWindow;
42 PanelLocator::PanelLocator (WindowList& all_top_level_wndows)
43 : windowList_{all_top_level_wndows}
48 WindowLocator::WindowLocator (GlobalCtx& globals)
51 , panelLoc_{windowList_}
52 , elementAccess_{*
this, panelLoc_}
55 WindowLocator::~WindowLocator () { }
60 WindowLocator::newWindow ()
62 PWindow window (
new WorkspaceWindow{globalCtx_.uiManager_});
65 window->signal_delete_event().connect(sigc::mem_fun(
66 this, &WindowLocator::on_window_closed));
68 windowList_.push_back(window);
72 updateCloseWindowInMenus();
82 WindowLocator::closeWindow()
84 findActiveWindow().hide();
96 WindowLocator::findActiveWindow()
98 REQUIRE (not isnil (windowList_));
100 for (
auto pwin : windowList_)
101 if (pwin->is_active())
105 return *windowList_.front();
114 WindowLocator::findFocusWindow()
116 REQUIRE (not isnil (windowList_));
118 for (
auto pwin : windowList_)
119 if (pwin->has_focus())
123 return *windowList_.front();
128 WindowLocator::on_window_closed (GdkEventAny* event)
131 REQUIRE(event->window);
133 list<PWindow>::iterator iterator{windowList_.begin()};
135 while (iterator != windowList_.end())
137 PWindow workspace_window(*iterator);
138 REQUIRE(workspace_window);
140 Glib::RefPtr<Gdk::Window> window = workspace_window->get_window();
142 if (window->gobj() ==
event->window)
145 iterator = windowList_.erase(iterator);
151 if (windowList_.empty())
153 globalCtx_.uiManager_.terminateUI();
155 updateCloseWindowInMenus();
163 WindowLocator::updateCloseWindowInMenus()
165 globalCtx_.uiManager_.allowCloseWindow ( 1 < windowList_.size());
176 PanelLocator::preliminary_impl_PanelLookup (
int typeID)
178 REQUIRE (not isnil(windowList_));
180 for (
auto window : windowList_)
181 if (window->getPanelManager().hasPanel (typeID))
182 return window->getPanelManager().showPanel (typeID);
185 for (
auto window : windowList_)
186 if (window->is_active())
187 return window->getPanelManager().showPanel (typeID);
190 return windowList_.front()->getPanelManager().showPanel (typeID);
Dependency context to hold all the global UI top-level entities.
The base class for all dockable panels.
Lumiera GTK UI implementation root.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Access and query front-end to locate, access and place docking panels.
Manager for all top level application windows.
The main Lumiera workspace window.
A service to discover and access raw UI elements in a cross cutting way.
This file contains the definition of the main workspace window parent, which is the toplevel parent o...