37 using namespace boost;
44 const DockArea::PanelDescription
45 DockArea::panelDescriptionList[] = {
47 DockArea::Panel<TimelinePanel>(), 48 DockArea::Panel<InfoBoxPanel>(),
49 DockArea::Panel<ViewerPanel>(),
50 DockArea::Panel<AssetsPanel>()
54 unsigned short DockArea::panelID = 0;
58 DockArea::DockArea (WorkspaceWindow& owner)
59 : workspaceWindow_(owner)
65 dockLayout_ = Gdl::DockLayout::create(dock_);
68 Glib::RefPtr<Gdl::DockMaster> dock_master = dock_.property_master();
69 dock_master->property_switcher_style() = Gdl::SWITCHER_STYLE_ICON;
71 memset(&dockPlaceholders_, 0,
sizeof(dockPlaceholders_));
82 for(int i = 0; i < 4; i++) 84 if(dockPlaceholders_[i])
85 g_object_unref(dockPlaceholders_[i]);
98 REQUIRE(dockPlaceholders_[0] == NULL && dockPlaceholders_[1] == NULL &&
99 dockPlaceholders_[2] == NULL && dockPlaceholders_[3] == NULL);
100 dockPlaceholders_[0] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
101 "ph1", GDL_DOCK_OBJECT(dock_.gobj()), GDL_DOCK_TOP, FALSE));
102 dockPlaceholders_[1] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
103 "ph2", GDL_DOCK_OBJECT(dock_.gobj()), GDL_DOCK_BOTTOM, FALSE));
104 dockPlaceholders_[2] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
105 "ph3", GDL_DOCK_OBJECT(dock_.gobj()), GDL_DOCK_LEFT, FALSE));
106 dockPlaceholders_[3] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
107 "ph4", GDL_DOCK_OBJECT(dock_.gobj()), GDL_DOCK_RIGHT, FALSE));
108 ENSURE(dockPlaceholders_[0] && dockPlaceholders_[1] &&
109 dockPlaceholders_[2] && dockPlaceholders_[3]);
123 DockArea::getDockBar()
130 DockArea::getWorkspaceWindow()
132 return workspaceWindow_;
137 DockArea::hasPanel (
const int description_index)
141 return getPanelType(panel) == description_index;
146 DockArea::showPanel (
const int description_index)
149 list< panel::Panel* >::iterator i;
150 for(i = panels_.begin(); i != panels_.end(); i++)
153 if (getPanelType(panel) == description_index)
155 if (!panel->is_shown()) panel->
show();
159 dock_item.present(dock_);
166 panel::Panel *new_panel = createPanel_by_index (description_index);
169 dock_.add_item(new_panel->
getDockItem(), Gdl::DOCK_FLOATING);
177 DockArea::switchPanel (
panel::Panel& old_panel,
const int description_index)
179 REQUIRE (description_index >= 0 &&
180 description_index < getPanelDescriptionCount());
183 Gdl::DockItem &dock_item = old_panel.
getDockItem();
186 removePanel (&old_panel);
189 createPanel_by_index (description_index, dock_item);
194 DockArea::splitPanel (
panel::Panel& panel, Gtk::Orientation split_direction)
198 const int index = getPanelType(&panel);
202 Gdl::DockPlacement placement = Gdl::DOCK_NONE;
203 switch(split_direction)
205 case ORIENTATION_HORIZONTAL:
206 placement = Gdl::DOCK_RIGHT;
209 case ORIENTATION_VERTICAL:
210 placement = Gdl::DOCK_BOTTOM;
214 ERROR(
stage,
"Unknown split_direction: %d", split_direction);
225 DockArea::getPanelDescriptionCount()
232 DockArea::getPanelStockID (
int index)
234 REQUIRE (index >= 0 && index < getPanelDescriptionCount());
235 return panelDescriptionList[index].getStockID();
240 DockArea::getPanelTitle (
int index)
242 REQUIRE (index >= 0 && index < getPanelDescriptionCount());
243 return panelDescriptionList[index].getTitle();
248 DockArea::createPanels()
251 panel::Panel* assetsPanel = createPanel_by_name(
"AssetsPanel");
252 panel::Panel* viewerPanel = createPanel_by_name(
"InfoBoxPanel");
253 panel::Panel* timelinePanel = createPanel_by_name(
"TimelinePanel");
255 dock_.add_item(assetsPanel->
getDockItem(),Gdl::DOCK_LEFT);
256 dock_.add_item(timelinePanel->
getDockItem(),Gdl::DOCK_BOTTOM);
257 dock_.add_item(viewerPanel->
getDockItem(),Gdl::DOCK_RIGHT);
262 DockArea::findPanelDescription (
const char* class_name)
266 const int count = getPanelDescriptionCount();
267 for(
int i = 0; i < count; i++)
269 if (strstr(panelDescriptionList[i].getClassName(), class_name))
273 ERROR (
stage,
"Unable to find a description with class name %s", class_name);
279 DockArea::createPanel_by_index (
const int index)
281 REQUIRE(index >= 0 && index < getPanelDescriptionCount());
285 snprintf(name,
sizeof(name),
"%X", panelID++);
288 return createPanel_by_index(index,
289 *
new Gdl::DockItem(name,
"",Gdl::DOCK_ITEM_BEH_NORMAL));
294 DockArea::createPanel_by_index (
const int index, Gdl::DockItem &dock_item)
297 panel::Panel *panel = panelDescriptionList[index].create(*
this, dock_item);
303 sigc::mem_fun(*
this, &DockArea::on_panel_shown), panel));
306 panels_.push_back(panel);
313 DockArea::createPanel_by_name (
const char* class_name)
316 const int index = findPanelDescription(class_name);
317 return createPanel_by_index(index);
326 const type_info &info =
typeid(*panel);
327 const int count = getPanelDescriptionCount();
328 for(
int i = 0; i < count; i++)
330 if(info == panelDescriptionList[i].getClassInfo())
334 ERROR(
stage,
"Unable to find a description with with this class type");
344 list< panel::Panel* >::iterator i;
345 for(i = panels_.begin(); i != panels_.end(); i++)
358 DockArea::clearPanels()
362 list< panel::Panel* >::iterator i;
363 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.