![]() |
![]() |
![]() |
GNOME Docking Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
struct GdlDockLayout; GdlDockLayout * gdl_dock_layout_new (GObject *master
); void gdl_dock_layout_attach (GdlDockLayout *layout
,GdlDockMaster *master
); void gdl_dock_layout_delete_layout (GdlDockLayout *layout
,const gchar *name
); GList * gdl_dock_layout_get_layouts (GdlDockLayout *layout
,gboolean include_default
); gboolean gdl_dock_layout_is_dirty (GdlDockLayout *layout
); gboolean gdl_dock_layout_load_layout (GdlDockLayout *layout
,const gchar *name
); gboolean gdl_dock_layout_load_from_file (GdlDockLayout *layout
,const gchar *filename
); void gdl_dock_layout_save_layout (GdlDockLayout *layout
,const gchar *name
); gboolean gdl_dock_layout_save_to_file (GdlDockLayout *layout
,const gchar *filename
);
The layout of all docking widgets can be saved using this GdlDockLayout object. It automatically monitors the layout_changed signal of the dock master and stores the position of all widgets in memory after each change.
The layout "dirty" property is set to TRUE
when the widget position in
memory is updated.
To keep an external file in sync with the dock, monitor this "dirty"
property and call gdl_dock_layout_save_to_file when
this changes to TRUE
. Informations are stored in XML format.
struct GdlDockLayout;
The GdlDockLayout struct contains only private fields and should not be directly accessed.
GdlDockLayout * gdl_dock_layout_new (GObject *master
);
Creates a new GdlDockLayout. Instead of setting master
directly with a master object, it is possible to use a GdlDockObject, in
this case the layout will be attached to the same master than the dock
object.
|
A master or a dock object to which the layout will be attached. |
Returns : |
New GdlDockLayout item. |
void gdl_dock_layout_attach (GdlDockLayout *layout
,GdlDockMaster *master
);
gdl_dock_layout_attach
is deprecated and should not be used in newly-written code.
Attach the layout
to the master
and delete the reference to
the master that the layout attached previously.
Deprecated 3.6: Use gdl_dock_layout_set_master()
instead.
|
The layout object |
|
The master object to which the layout will be attached |
void gdl_dock_layout_delete_layout (GdlDockLayout *layout
,const gchar *name
);
Deletes the layout with the given name from the memory.
This will set "dirty" to TRUE
.
|
The dock item. |
|
The name of the layout to delete. |
GList * gdl_dock_layout_get_layouts (GdlDockLayout *layout
,gboolean include_default
);
Get the list of layout names including or not the default layout.
|
The layout item. |
|
TRUE to include the default layout. |
Returns : |
a GList list
holding the layout names. You must first free each element in the list
with g_free() , then free the list itself with g_list_free() . [element-type utf8][transfer full]
|
gboolean gdl_dock_layout_is_dirty (GdlDockLayout *layout
);
Checks whether the XML tree in memory is different from the file where the layout was saved.
|
The layout item. |
Returns : |
TRUE is the layout in the memory is different from the file, else FALSE . |
gboolean gdl_dock_layout_load_layout (GdlDockLayout *layout
,const gchar *name
);
Loads the layout with the given name from the memory.
This will set "dirty" to TRUE
.
See also gdl_dock_layout_load_from_file()
|
The dock item. |
|
The name of the layout to load or NULL for a default layout name. [allow-none]
|
Returns : |
TRUE if layout successfully loaded else FALSE
|
gboolean gdl_dock_layout_load_from_file (GdlDockLayout *layout
,const gchar *filename
);
Loads the layout from file with the given filename
.
This will set "dirty" to FALSE
.
|
The layout item. |
|
The name of the file to load. |
Returns : |
TRUE if layout successfully loaded else FALSE
|
void gdl_dock_layout_save_layout (GdlDockLayout *layout
,const gchar *name
);
Saves the layout
with the given name to the memory.
This will set "dirty" to TRUE
.
See also gdl_dock_layout_save_to_file()
.
|
The dock item. |
|
The name of the layout to save or NULL for a default layout name. [allow-none]
|
gboolean gdl_dock_layout_save_to_file (GdlDockLayout *layout
,const gchar *filename
);
This function saves the current layout in XML format to
the file with the given filename
.
|
The layout item. |
|
Name of the file we want to save in layout |
Returns : |
TRUE if layout successfuly save to the file, otherwise FALSE . |