GdlDockMaster

GdlDockMaster — Manage all dock widgets

Stability Level

Unstable, unless otherwise indicated

Functions

Properties

char * default-title Read / Write
int locked Read / Write
GdlSwitcherStyle switcher-style Read / Write
GtkPositionType tab-pos Read / Write
gboolean tab-reorderable Read / Write

Signals

Types and Values

Object Hierarchy

    GEnum
    ╰── GdlSwitcherStyle
    GObject
    ╰── GdlDockMaster

Description

For the toplevel docks to be able to interact with each other, when the user drags items from one place to another, they're all kept in a user-invisible and automatic object called the master. To participate in docking operations every GdlDockObject must have the same master, the binding to the master is done automatically.

The master also keeps track of the manual items, mostly those created with gdl_dock_*_new functions which are in the dock. This is so the user doesn't need to keep track of them, but can perform operations like hiding and such.

The master is responsible for creating automatically compound widgets. When the user drops a widget on a simple one, a notebook or a paned compound widget containing both widgets is created and replace it. Such widgets are hidden automatically when they have less than two children.

One of the top level dock item of the master is considered as the controller. This controller is an user visible representation of the master. A floating dock widget will use a dock object having the same properties than this controller. You can show or hide all dock widgets of the master by showing or hiding the controller. This controller is assigned to the master automatically. If the controller dock widget is removed, a new top level dock widget will be automatically used as controller. If there is no other dock widget, the master will be destroyed.

Functions

GDL_DOCK_OBJECT_GET_MASTER()

#define             GDL_DOCK_OBJECT_GET_MASTER(object)

GDL_DOCK_OBJECT_GET_MASTER has been deprecated since version 3.6 and should not be used in newly-written code.

Use gdl_dock_object_get_master()

Retrieve the GdlDockMaster object managing the object.

Parameters

object

A GdlDockObject

 

gdl_dock_master_add ()

void
gdl_dock_master_add (GdlDockMaster *master,
                     GdlDockObject *object);

Add a new dock widget to the master.

Parameters

master

a GdlDockMaster

 

object

a GdlDockObject

 

gdl_dock_master_remove ()

void
gdl_dock_master_remove (GdlDockMaster *master,
                        GdlDockObject *object);

Remove one dock widget from the master.

Parameters

master

a GdlDockMaster

 

object

a GdlDockObject

 

gdl_dock_master_set_controller ()

void
gdl_dock_master_set_controller (GdlDockMaster *master,
                                GdlDockObject *new_controller);

Set a new controller. The controller must be a top level GdlDockObject.

Parameters

master

a GdlDockMaster

 

new_controller

a GdlDockObject

 

gdl_dock_master_get_controller ()

GdlDockObject *
gdl_dock_master_get_controller (GdlDockMaster *master);

Retrieves the GdlDockObject acting as the controller.

Parameters

master

a GdlDockMaster

 

Returns

A GdlDockObject.

[transfer none]


gdl_dock_master_get_object ()

GdlDockObject *
gdl_dock_master_get_object (GdlDockMaster *master,
                            const gchar *nick_name);

Looks for a GdlDockObject named nick_name .

Parameters

master

a GdlDockMaster

 

nick_name

the name of the dock widget.

 

Returns

A GdlDockObject named nick_name or NULL if it does not exist.

[allow-none][transfer none]


gdl_dock_master_foreach ()

void
gdl_dock_master_foreach (GdlDockMaster *master,
                         GFunc function,
                         gpointer user_data);

Call function on each dock widget of the master.

Parameters

master

a GdlDockMaster

 

function

the function to call with each element's data.

[scope call]

user_data

user data to pass to the function

 

gdl_dock_master_foreach_toplevel ()

void
gdl_dock_master_foreach_toplevel (GdlDockMaster *master,
                                  gboolean include_controller,
                                  GFunc function,
                                  gpointer user_data);

Call function on each top level dock widget of the master, including or not the controller.

Parameters

master

a GdlDockMaster

 

include_controller

TRUE to include the controller

 

function

the function to call with each element's data.

[scope call]

user_data

user data to pass to the function

 

Types and Values

struct GdlDockMaster

struct GdlDockMaster;

enum GdlSwitcherStyle

Used to customize the appearance of the tabs in GdlDockNotebook.

Members

GDL_SWITCHER_STYLE_TEXT

Tabs display only text labels.

 

GDL_SWITCHER_STYLE_ICON

Tabs display only icons.

 

GDL_SWITCHER_STYLE_BOTH

Tabs display text and icons.

 

GDL_SWITCHER_STYLE_TOOLBAR

Same as GDL_SWITCHER_STYLE_BOTH .

 

GDL_SWITCHER_STYLE_TABS

Tabs display like notebook tabs.

 

GDL_SWITCHER_STYLE_NONE

Do not display tabs.

 

Property Details

The “default-title” property

  “default-title”            char *

Default title for newly created floating docks.

Owner: GdlDockMaster

Flags: Read / Write

Default value: NULL


The “locked” property

  “locked”                   int

If is set to 1, all the dock items bound to the master are locked; if it's 0, all are unlocked; -1 indicates inconsistency among the items.

Owner: GdlDockMaster

Flags: Read / Write

Allowed values: [-1,1]

Default value: 0


The “switcher-style” property

  “switcher-style”           GdlSwitcherStyle

Switcher buttons style.

Owner: GdlDockMaster

Flags: Read / Write

Default value: GDL_SWITCHER_STYLE_BOTH


The “tab-pos” property

  “tab-pos”                  GtkPositionType

Which side of the notebook holds the tabs.

Owner: GdlDockMaster

Flags: Read / Write

Default value: GTK_POS_BOTTOM


The “tab-reorderable” property

  “tab-reorderable”          gboolean

Whether the tab is reorderable by user action.

Owner: GdlDockMaster

Flags: Read / Write

Default value: FALSE

Signal Details

The “layout-changed” signal

void
user_function (GdlDockMaster *gdldockmaster,
               gpointer       user_data)

Signals that the layout has changed, one or more widgets have been moved, added or removed.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

See Also

GdlDockObject, GdlDockNotebook, GdlDockPaned