46 using namespace boost;
53 const DockArea::PanelDescription
54 DockArea::panelDescriptionList[] = {
56 DockArea::Panel<TimelinePanel>(), 57 DockArea::Panel<InfoBoxPanel>(),
58 DockArea::Panel<ViewerPanel>(),
59 DockArea::Panel<AssetsPanel>()
63 unsigned short DockArea::panelID = 0;
67 DockArea::DockArea (WorkspaceWindow& owner)
68 : workspaceWindow_(owner)
74 dockLayout_ = Gdl::DockLayout::create(dock_);
77 Glib::RefPtr<Gdl::DockMaster> dock_master = dock_.property_master();
78 dock_master->property_switcher_style() = Gdl::SWITCHER_STYLE_ICON;
80 memset(&dockPlaceholders_, 0,
sizeof(dockPlaceholders_));
91 for(int i = 0; i < 4; i++) 93 if(dockPlaceholders_[i])
94 g_object_unref(dockPlaceholders_[i]);
103 DockArea::setupDock()
107 REQUIRE(dockPlaceholders_[0] == NULL && dockPlaceholders_[1] == NULL &&
108 dockPlaceholders_[2] == NULL && dockPlaceholders_[3] == NULL);
109 dockPlaceholders_[0] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
110 "ph1", GDL_DOCK_OBJECT(dock_.gobj()), GDL_DOCK_TOP, FALSE));
111 dockPlaceholders_[1] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
112 "ph2", GDL_DOCK_OBJECT(dock_.gobj()), GDL_DOCK_BOTTOM, FALSE));
113 dockPlaceholders_[2] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
114 "ph3", GDL_DOCK_OBJECT(dock_.gobj()), GDL_DOCK_LEFT, FALSE));
115 dockPlaceholders_[3] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
116 "ph4", GDL_DOCK_OBJECT(dock_.gobj()), GDL_DOCK_RIGHT, FALSE));
117 ENSURE(dockPlaceholders_[0] && dockPlaceholders_[1] &&
118 dockPlaceholders_[2] && dockPlaceholders_[3]);
132 DockArea::getDockBar()
139 DockArea::getWorkspaceWindow()
141 return workspaceWindow_;
146 DockArea::hasPanel (
const int description_index)
150 return getPanelType(panel) == description_index;
155 DockArea::showPanel (
const int description_index)
158 list< panel::Panel* >::iterator i;
159 for(i = panels_.begin(); i != panels_.end(); i++)
162 if (getPanelType(panel) == description_index)
164 if (!panel->is_shown()) panel->
show();
168 dock_item.present(dock_);
175 panel::Panel *new_panel = createPanel_by_index (description_index);
178 dock_.add_item(new_panel->
getDockItem(), Gdl::DOCK_FLOATING);
186 DockArea::switchPanel (
panel::Panel& old_panel,
const int description_index)
188 REQUIRE (description_index >= 0 &&
189 description_index < getPanelDescriptionCount());
192 Gdl::DockItem &dock_item = old_panel.
getDockItem();
195 removePanel (&old_panel);
198 createPanel_by_index (description_index, dock_item);
203 DockArea::splitPanel (
panel::Panel& panel, Gtk::Orientation split_direction)
207 const int index = getPanelType(&panel);
211 Gdl::DockPlacement placement = Gdl::DOCK_NONE;
212 switch(split_direction)
214 case ORIENTATION_HORIZONTAL:
215 placement = Gdl::DOCK_RIGHT;
218 case ORIENTATION_VERTICAL:
219 placement = Gdl::DOCK_BOTTOM;
223 ERROR(
stage,
"Unknown split_direction: %d", split_direction);
234 DockArea::getPanelDescriptionCount()
241 DockArea::getPanelStockID (
int index)
243 REQUIRE (index >= 0 && index < getPanelDescriptionCount());
244 return panelDescriptionList[index].getStockID();
249 DockArea::getPanelTitle (
int index)
251 REQUIRE (index >= 0 && index < getPanelDescriptionCount());
252 return panelDescriptionList[index].getTitle();
257 DockArea::createPanels()
260 panel::Panel* assetsPanel = createPanel_by_name(
"AssetsPanel");
261 panel::Panel* viewerPanel = createPanel_by_name(
"InfoBoxPanel");
262 panel::Panel* timelinePanel = createPanel_by_name(
"TimelinePanel");
264 dock_.add_item(assetsPanel->
getDockItem(),Gdl::DOCK_LEFT);
265 dock_.add_item(timelinePanel->
getDockItem(),Gdl::DOCK_BOTTOM);
266 dock_.add_item(viewerPanel->
getDockItem(),Gdl::DOCK_RIGHT);
271 DockArea::findPanelDescription (
const char* class_name)
275 const int count = getPanelDescriptionCount();
276 for(
int i = 0; i < count; i++)
278 if (strstr(panelDescriptionList[i].getClassName(), class_name))
282 ERROR (
stage,
"Unable to find a description with class name %s", class_name);
288 DockArea::createPanel_by_index (
const int index)
290 REQUIRE(index >= 0 && index < getPanelDescriptionCount());
294 snprintf(name,
sizeof(name),
"%X", panelID++);
297 return createPanel_by_index(index,
298 *
new Gdl::DockItem(name,
"",Gdl::DOCK_ITEM_BEH_NORMAL));
303 DockArea::createPanel_by_index (
const int index, Gdl::DockItem &dock_item)
306 panel::Panel *panel = panelDescriptionList[index].create(*
this, dock_item);
312 sigc::mem_fun(*
this, &DockArea::on_panel_shown), panel));
315 panels_.push_back(panel);
322 DockArea::createPanel_by_name (
const char* class_name)
325 const int index = findPanelDescription(class_name);
326 return createPanel_by_index(index);
335 const type_info &info =
typeid(*panel);
336 const int count = getPanelDescriptionCount();
337 for(
int i = 0; i < count; i++)
339 if(info == panelDescriptionList[i].getClassInfo())
343 ERROR(
stage,
"Unable to find a description with with this class type");
353 list< panel::Panel* >::iterator i;
354 for(i = panels_.begin(); i != panels_.end(); i++)
367 DockArea::clearPanels()
371 list< panel::Panel* >::iterator i;
372 for(i = panels_.begin(); i != panels_.end(); i++)
Management of dockable panels within each top-level WorkspaceWindow.
This header is for including and configuring NoBug.
bool is_iconified() const
void show(bool show=true)
Shows or hides the panel.
A (dockable) panel to organise the assets of a project.
The base class for all dockable panels.
Lumiera GTK UI implementation root.
A class to describe and instantiate Panel types.
A (dockable) panel to display and manage information and parameters.
The main Lumiera workspace window.
Definition of a dockable panel to hold the video viewers.
sigc::signal< void > & signal_hidePanel()
fires when the dock item gets hidden.
Gdl::DockItem & getDockItem()
Perform operations "for each element" of a collection.
A dockable container to hold a notebook of timeline displays.