Lumiera  0.pre.03
»edit your freedom«
DockArea Class Reference

#include "stage/workspace/dock-area.hpp"

Description

A class to manage DockItem objects for WorkspaceWindow.

Todo:
this code is smelly and needs some clean-up ///////////////////////////////TICKET #1026

Definition at line 49 of file dock-area.hpp.

Public Member Functions

 DockArea (WorkspaceWindow &)
 
Gdl::Dock & getDock ()
 Gets a pointer to the dock object. More...
 
Gdl::DockBar & getDockBar ()
 Gets a pointer to the dock bar. More...
 
WorkspaceWindowgetWorkspaceWindow ()
 Returns a reference to the owner workspace window.
 
bool hasPanel (const int description_index)
 was the indicated panel already allocated within this PanelManager's realm?
 
void setupDock ()
 Initialises this dock manager and creates the dock and all it's widgets. More...
 
panel::PanelshowPanel (const int description_index)
 Shows a panel given a description index. More...
 
void splitPanel (panel::Panel &panel, Gtk::Orientation split_direction)
 Splits a panel into two panels of the same type. More...
 
void switchPanel (panel::Panel &old_panel, const int description_index)
 Switches a panel from one type to another, without touching the underlying GdlDockItem. More...
 

Static Public Member Functions

template<class P >
static int findPanelID ()
 retrieve the internal type-ID corresponding to the given panel implementation type. More...
 
static int getPanelDescriptionCount ()
 Gets the number of panel descriptions. More...
 
static const gchar * getPanelStockID (const int index)
 Gets a panel description's stock id. More...
 
static const char * getPanelTitle (int index)
 Gets a panel description's title. More...
 

Classes

class  Panel
 A helper class that will create PanelDescription objects. More...
 
class  PanelDescription
 A class to describe and instantiate Panel types. More...
 

Private Member Functions

void clearPanels ()
 Removes all panels from the panel list and deletes them. More...
 
panel::PanelcreatePanel_by_index (const int index)
 Creates a panel by description index. More...
 
panel::PanelcreatePanel_by_index (const int index, Gdl::DockItem &dock_item)
 Creates a panel by description index with a given GdlDockItem. More...
 
panel::PanelcreatePanel_by_name (const char *class_name)
 Creates a panel by class name. More...
 
void createPanels ()
 Creates the standard panel layout. More...
 
int getPanelType (panel::Panel *const panel) const
 Gets the type of a given panel. More...
 
void on_panel_shown (panel::Panel *panel)
 An event handler for when the panel is shown or hidden. More...
 
void removePanel (panel::Panel *const panel)
 Removes a panel from the panel list and deletes it. More...
 

Static Private Member Functions

static int findPanelDescription (const char *class_name)
 Find the index of a panel description given the class name. More...
 

Private Attributes

Gdl::Dock dock_
 The pointer to GDL dock widget. More...
 
Gdl::DockBar dockBar_
 The pointer to GDL dock bar widget. More...
 
Glib::RefPtr< Gdl::DockLayout > dockLayout_
 The pointer to GDL dock layout object. More...
 
GdlDockPlaceholder * dockPlaceholders_ [4]
 Pointers to the 4 root place holders. More...
 
std::list< panel::Panel * > panels_
 list of all panels created
 
WorkspaceWindowworkspaceWindow_
 reference to the owner workspace window object
 

Static Private Attributes

static const PanelDescription panelDescriptionList []
 The list of panel descriptions. More...
 
static unsigned short panelID = 0
 An accumulator for the panel id.
 

Member Function Documentation

◆ setupDock()

void setupDock ( )

Initialises this dock manager and creates the dock and all it's widgets.

Remarks
This function must be called only once as the first call after construction.
Deprecated:
///////////////////////////////////////////////////////////////////////////////////TICKET #1145 UI must not populate itself!!!!!

Definition at line 94 of file dock-area.cpp.

◆ getDock()

Gdl::Dock & getDock ( )

Gets a pointer to the dock object.

Remarks
Note that this must not be called before setup_dock. ///////////////////////////////TICKET #1026 : code smell

Definition at line 116 of file dock-area.cpp.

◆ getDockBar()

Gdl::DockBar & getDockBar ( )

Gets a pointer to the dock bar.

Remarks
Note that this must not be called before setup_dock.

Definition at line 123 of file dock-area.cpp.

◆ showPanel()

panel::Panel & showPanel ( const int  description_index)

Shows a panel given a description index.

Parameters
description_indexThe index of the panel type to show.
Returns
existing or new Panel, docked within the realm of this PanelManager.

Definition at line 146 of file dock-area.cpp.

◆ switchPanel()

void switchPanel ( panel::Panel old_panel,
const int  description_index 
)

Switches a panel from one type to another, without touching the underlying GdlDockItem.

Parameters
old_panelThe panel which will be transformed to a new type.
description_indexThe index of the panel description that will be instantiated.

Definition at line 177 of file dock-area.cpp.

References Panel::getDockItem().

+ Here is the call graph for this function:

◆ splitPanel()

void splitPanel ( panel::Panel panel,
Gtk::Orientation  split_direction 
)

Splits a panel into two panels of the same type.

Parameters
panelThe panel to split.
split_directionThe direction to split the panel in.

Definition at line 194 of file dock-area.cpp.

References Panel::getDockItem().

+ Here is the call graph for this function:

◆ findPanelID()

int findPanelID ( )
inlinestatic

retrieve the internal type-ID corresponding to the given panel implementation type.

Returns
internal index into the panelDescriptionList, or -1 if not found.
Deprecated:
the whole concept of panel identification needs overhaul 8/2018

Definition at line 352 of file dock-area.hpp.

References stage::widget::name().

+ Here is the call graph for this function:

◆ getPanelDescriptionCount()

int getPanelDescriptionCount ( )
static

Gets the number of panel descriptions.

Definition at line 225 of file dock-area.cpp.

◆ getPanelStockID()

const gchar * getPanelStockID ( const int  index)
static

Gets a panel description's stock id.

Parameters
indexThe index of the panel to retrieve.
Returns
Returns the stock id of a panel at this index.

Definition at line 232 of file dock-area.cpp.

◆ getPanelTitle()

const char * getPanelTitle ( int  index)
static

Gets a panel description's title.

Parameters
indexThe index of the panel to retrieve.
Returns
Returns the title of a panel at this index.

Definition at line 240 of file dock-area.cpp.

◆ createPanels()

void createPanels ( )
private

Creates the standard panel layout.

Definition at line 248 of file dock-area.cpp.

References Panel::getDockItem().

+ Here is the call graph for this function:

◆ findPanelDescription()

int findPanelDescription ( const char *  class_name)
staticprivate

Find the index of a panel description given the class name.

Parameters
class_nameThe name of the object class to search for.
Returns
Returns the index of the panel description found, or -1 if no description was found for this type.

Definition at line 262 of file dock-area.cpp.

◆ createPanel_by_index() [1/2]

panel::Panel * createPanel_by_index ( const int  index)
private

Creates a panel by description index.

Parameters
indexThe index of the description to instantiate.
Returns
Returns a pointer to the new instantiated panel object.

Definition at line 279 of file dock-area.cpp.

References stage::widget::name().

+ Here is the call graph for this function:

◆ createPanel_by_index() [2/2]

panel::Panel * createPanel_by_index ( const int  index,
Gdl::DockItem &  dock_item 
)
private

Creates a panel by description index with a given GdlDockItem.

Parameters
indexThe index of the description to instantiate.
dock_itemThe GdlDockItem to attach this panel to
Returns
Returns a pointer to the new instantiated panel object.

Definition at line 294 of file dock-area.cpp.

References Panel::signal_hidePanel().

+ Here is the call graph for this function:

◆ createPanel_by_name()

panel::Panel * createPanel_by_name ( const char *  class_name)
private

Creates a panel by class name.

Parameters
class_nameThe name of the object class to create.
Returns
Returns a pointer to the new instantiated panel object.

Definition at line 313 of file dock-area.cpp.

◆ getPanelType()

int getPanelType ( panel::Panel *const  panel) const
private

Gets the type of a given panel.

Parameters
panelThe Panel to get the type of
Returns
Returns the index of the panel description found, or -1 if no description was found for this type.

Definition at line 322 of file dock-area.cpp.

◆ removePanel()

void removePanel ( panel::Panel *const  panel)
private

Removes a panel from the panel list and deletes it.

Parameters
panelThe panel to remove and delete.

Definition at line 340 of file dock-area.cpp.

◆ clearPanels()

void clearPanels ( )
private

Removes all panels from the panel list and deletes them.

Definition at line 358 of file dock-area.cpp.

◆ on_panel_shown()

void on_panel_shown ( panel::Panel panel)
private

An event handler for when the panel is shown or hidden.

Parameters
panelA pointer to the panel that was hidden.

Definition at line 370 of file dock-area.cpp.

References Panel::is_iconified().

+ Here is the call graph for this function:

Member Data Documentation

◆ dock_

Gdl::Dock dock_
private

The pointer to GDL dock widget.

Remarks
This value is NULL until setup_dock has been called.

Definition at line 57 of file dock-area.hpp.

◆ dockBar_

Gdl::DockBar dockBar_
private

The pointer to GDL dock bar widget.

Remarks
This value is NULL until setup_dock has been called.

Definition at line 62 of file dock-area.hpp.

◆ dockLayout_

Glib::RefPtr<Gdl::DockLayout> dockLayout_
private

The pointer to GDL dock layout object.

Remarks
This value is NULL until setup_dock has been called.

Definition at line 67 of file dock-area.hpp.

◆ dockPlaceholders_

GdlDockPlaceholder* dockPlaceholders_[4]
private

Pointers to the 4 root place holders.

Remarks
All 4 entries are NULL until setup_dock has been called.

Definition at line 72 of file dock-area.hpp.

◆ panelDescriptionList

const DockArea::PanelDescription panelDescriptionList
staticprivate
Initial value:
= {
}

The list of panel descriptions.

Definition at line 344 of file dock-area.hpp.

+ Collaboration diagram for DockArea:

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