GdlDockMaster

GdlDockMaster — Manage all dock widgets

Stability Level

Unstable, unless otherwise indicated

Synopsis

#define             GDL_DOCK_OBJECT_GET_MASTER          (object)
struct              GdlDockMaster;
enum                GdlSwitcherStyle;
void                gdl_dock_master_add                 (GdlDockMaster *master,
                                                         GdlDockObject *object);
void                gdl_dock_master_remove              (GdlDockMaster *master,
                                                         GdlDockObject *object);
void                gdl_dock_master_set_controller      (GdlDockMaster *master,
                                                         GdlDockObject *new_controller);
GdlDockObject *     gdl_dock_master_get_controller      (GdlDockMaster *master);
GdlDockObject *     gdl_dock_master_get_object          (GdlDockMaster *master,
                                                         const gchar *nick_name);
void                gdl_dock_master_foreach             (GdlDockMaster *master,
                                                         GFunc function,
                                                         gpointer user_data);
void                gdl_dock_master_foreach_toplevel    (GdlDockMaster *master,
                                                         gboolean include_controller,
                                                         GFunc function,
                                                         gpointer user_data);

Object Hierarchy

  GObject
   +----GdlDockMaster

Properties

  "default-title"            gchar*                : Read / Write
  "locked"                   gint                  : Read / Write
  "switcher-style"           GdlSwitcherStyle      : Read / Write

Signals

  "layout-changed"                                 : Run Last

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.

Details

GDL_DOCK_OBJECT_GET_MASTER()

#define             GDL_DOCK_OBJECT_GET_MASTER(object)

Warning

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.

object :

A GdlDockObject

struct GdlDockMaster

struct GdlDockMaster;


enum GdlSwitcherStyle

typedef enum {
    GDL_SWITCHER_STYLE_TEXT,
    GDL_SWITCHER_STYLE_ICON,
    GDL_SWITCHER_STYLE_BOTH,
    GDL_SWITCHER_STYLE_TOOLBAR,
    GDL_SWITCHER_STYLE_TABS,
    GDL_SWITCHER_STYLE_NONE
} GdlSwitcherStyle;

Used to customize the appearance of the tabs in GdlDockNotebook.

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.

gdl_dock_master_add ()

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

Add a new dock widget to the master.

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.

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.

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.

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.

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.

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.

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

Property Details

The "default-title" property

  "default-title"            gchar*                : Read / Write

Default title for newly created floating docks.

Default value: NULL


The "locked" property

  "locked"                   gint                  : Read / Write

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.

Allowed values: [G_MAXULONG,1]

Default value: 0


The "switcher-style" property

  "switcher-style"           GdlSwitcherStyle      : Read / Write

Switcher buttons style.

Default value: GDL_SWITCHER_STYLE_BOTH

Signal Details

The "layout-changed" signal

void                user_function                      (GdlDockMaster *arg0,
                                                        gpointer       user_data)      : Run Last

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

user_data :

user data set when the signal handler was connected.

See Also

GdlDockObject, GdlDockNotebook, GdlDockPaned