47 using workspace::WorkspaceWindow;
51 PanelLocator::PanelLocator (WindowList& all_top_level_wndows)
52 : windowList_{all_top_level_wndows}
57 WindowLocator::WindowLocator (GlobalCtx& globals)
60 , panelLoc_{windowList_}
61 , elementAccess_{*
this, panelLoc_}
64 WindowLocator::~WindowLocator () { }
69 WindowLocator::newWindow ()
71 PWindow window (
new WorkspaceWindow{globalCtx_.uiManager_});
74 window->signal_delete_event().connect(sigc::mem_fun(
75 this, &WindowLocator::on_window_closed));
77 windowList_.push_back(window);
81 updateCloseWindowInMenus();
91 WindowLocator::closeWindow()
93 findActiveWindow().hide();
105 WindowLocator::findActiveWindow()
107 REQUIRE (not isnil (windowList_));
109 for (
auto pwin : windowList_)
110 if (pwin->is_active())
114 return *windowList_.front();
123 WindowLocator::findFocusWindow()
125 REQUIRE (not isnil (windowList_));
127 for (
auto pwin : windowList_)
128 if (pwin->has_focus())
132 return *windowList_.front();
137 WindowLocator::on_window_closed (GdkEventAny* event)
140 REQUIRE(event->window);
142 list<PWindow>::iterator iterator{windowList_.begin()};
144 while (iterator != windowList_.end())
146 PWindow workspace_window(*iterator);
147 REQUIRE(workspace_window);
149 Glib::RefPtr<Gdk::Window> window = workspace_window->get_window();
151 if (window->gobj() ==
event->window)
154 iterator = windowList_.erase(iterator);
160 if (windowList_.empty())
162 globalCtx_.uiManager_.terminateUI();
164 updateCloseWindowInMenus();
172 WindowLocator::updateCloseWindowInMenus()
174 globalCtx_.uiManager_.allowCloseWindow ( 1 < windowList_.size());
185 PanelLocator::preliminary_impl_PanelLookup (
int typeID)
187 REQUIRE (not isnil(windowList_));
189 for (
auto window : windowList_)
190 if (window->getPanelManager().hasPanel (typeID))
191 return window->getPanelManager().showPanel (typeID);
194 for (
auto window : windowList_)
195 if (window->is_active())
196 return window->getPanelManager().showPanel (typeID);
199 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...