Commit 6fabca2e authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Added configurable styles for dockable tabs (fixes bug #87376):

2003-07-08  Michael Natterer  <mitch@gimp.org>

	Added configurable styles for dockable tabs (fixes bug #87376):

	* app/widgets/widgets-enums.[ch]: added new enum GimpTabStyle
	which can be one on { ICON, NAME, ICON_NAME, ICON_BLURB }.

	* app/widgets/gimpdockable.[ch]: added a GimpTabStyle member to
	the GimpDockable struct which defaults to GIMP_TAB_STYLE_ICON.
	Renamed "short_name" to "name" and "name" to "blurb". Renamed
	GimpDockableGetTabFunc to GimpDockableGetIconFunc. Implemented all
	tab styles in gimp_dockable_real_get_tab_widget() and use the
	"get_icon_func" only for creating the tab's icon, not the entire
	tab widget.

	* app/widgets/gimpdockbook.[ch]: changed accordingly. Create the
	menu widgets and the DND icon using gimp_dockable_get_tab_widget()
	with tab_style == GIMP_TAB_STYLE_ICON_BLURB instead of duplicating
	tons of code. Made gimp_dockbook_get_tab_widget() public because
	it's needed for exchanging tabs on-the-fly.

	* app/widgets/gimpimagedock.c: changed accordingly.

	* app/widgets/gimpdialogfactory.c: remember the dockables' tab
	style in sessionrc.

	* app/gui/dialogs-menu.c: added a submenu to select the tab style
	for each dockable.

	* app/gui/dialogs-commands.[ch]: new callback
	dialogs_tab_style_cmd_callback().

	* app/gui/dialogs-constructors.[ch]: added stock_ids to all
	dockables, swapped the "name" and "blurb" parameters, reordered
	functions, cleanup.

	* app/gui/dialogs-menu.c
	* app/gui/image-menu.c
	* app/gui/toolbox-menu.c: use GIMP_STOCK_DEFAULT_COLORS for the
	color editor dockable and renamed it to "FG/BG Color".
parent efb6ff5b
2003-07-08 Michael Natterer <mitch@gimp.org>
Added configurable styles for dockable tabs (fixes bug #87376):
* app/widgets/widgets-enums.[ch]: added new enum GimpTabStyle
which can be one on { ICON, NAME, ICON_NAME, ICON_BLURB }.
* app/widgets/gimpdockable.[ch]: added a GimpTabStyle member to
the GimpDockable struct which defaults to GIMP_TAB_STYLE_ICON.
Renamed "short_name" to "name" and "name" to "blurb". Renamed
GimpDockableGetTabFunc to GimpDockableGetIconFunc. Implemented all
tab styles in gimp_dockable_real_get_tab_widget() and use the
"get_icon_func" only for creating the tab's icon, not the entire
tab widget.
* app/widgets/gimpdockbook.[ch]: changed accordingly. Create the
menu widgets and the DND icon using gimp_dockable_get_tab_widget()
with tab_style == GIMP_TAB_STYLE_ICON_BLURB instead of duplicating
tons of code. Made gimp_dockbook_get_tab_widget() public because
it's needed for exchanging tabs on-the-fly.
* app/widgets/gimpimagedock.c: changed accordingly.
* app/widgets/gimpdialogfactory.c: remember the dockables' tab
style in sessionrc.
* app/gui/dialogs-menu.c: added a submenu to select the tab style
for each dockable.
* app/gui/dialogs-commands.[ch]: new callback
dialogs_tab_style_cmd_callback().
* app/gui/dialogs-constructors.[ch]: added stock_ids to all
dockables, swapped the "name" and "blurb" parameters, reordered
functions, cleanup.
* app/gui/dialogs-menu.c
* app/gui/image-menu.c
* app/gui/toolbox-menu.c: use GIMP_STOCK_DEFAULT_COLORS for the
color editor dockable and renamed it to "FG/BG Color".
2003-07-08 Michael Natterer <mitch@gimp.org>
* app/core/core-types.h: added GimpGradientSegment typedef.
......@@ -267,6 +267,46 @@ dialogs_preview_size_cmd_callback (GtkWidget *widget,
}
}
void
dialogs_tab_style_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook;
GimpTabStyle tab_style;
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
dockbook = (GimpDockbook *) gtk_item_factory_popup_data_from_widget (widget);
tab_style = (gint) action;
if (dockbook)
{
GimpDockable *dockable;
gint page_num;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
{
GtkWidget *tab_widget;
dockable->tab_style = tab_style;
tab_widget = gimp_dockbook_get_tab_widget (dockbook, dockable);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (dockbook),
GTK_WIDGET (dockable),
tab_widget);
}
}
}
void
dialogs_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data,
......
......@@ -43,6 +43,9 @@ void dialogs_toggle_view_cmd_callback (GtkWidget *widget,
void dialogs_preview_size_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_tab_style_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data,
......
This diff is collapsed.
......@@ -88,6 +88,12 @@ GtkWidget * dialogs_tool_list_view_new (GimpDialogFactory *factory,
GtkWidget * dialogs_buffer_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_template_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_image_grid_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -113,6 +119,9 @@ GtkWidget * dialogs_tool_grid_view_new (GimpDialogFactory *factory,
GtkWidget * dialogs_buffer_grid_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_grid_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_layer_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -136,18 +145,11 @@ GtkWidget * dialogs_undo_history_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_grid_new (GimpDialogFactory *factory,
GtkWidget * dialogs_navigation_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_template_list_new (GimpDialogFactory *factory,
GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
......@@ -166,9 +168,5 @@ GtkWidget * dialogs_palette_editor_get (GimpDialogFactory *factory,
gint preview_size);
void dialogs_edit_palette_func (GimpData *data);
GtkWidget * dialogs_navigation_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
#endif /* __DIALOGS_CONSTRUCTORS_H__ */
......@@ -267,6 +267,46 @@ dialogs_preview_size_cmd_callback (GtkWidget *widget,
}
}
void
dialogs_tab_style_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook;
GimpTabStyle tab_style;
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
dockbook = (GimpDockbook *) gtk_item_factory_popup_data_from_widget (widget);
tab_style = (gint) action;
if (dockbook)
{
GimpDockable *dockable;
gint page_num;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
{
GtkWidget *tab_widget;
dockable->tab_style = tab_style;
tab_widget = gimp_dockbook_get_tab_widget (dockbook, dockable);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (dockbook),
GTK_WIDGET (dockable),
tab_widget);
}
}
}
void
dialogs_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data,
......
......@@ -43,6 +43,9 @@ void dialogs_toggle_view_cmd_callback (GtkWidget *widget,
void dialogs_preview_size_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_tab_style_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data,
......
This diff is collapsed.
......@@ -88,6 +88,12 @@ GtkWidget * dialogs_tool_list_view_new (GimpDialogFactory *factory,
GtkWidget * dialogs_buffer_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_template_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_image_grid_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -113,6 +119,9 @@ GtkWidget * dialogs_tool_grid_view_new (GimpDialogFactory *factory,
GtkWidget * dialogs_buffer_grid_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_grid_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_layer_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -136,18 +145,11 @@ GtkWidget * dialogs_undo_history_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_grid_new (GimpDialogFactory *factory,
GtkWidget * dialogs_navigation_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_template_list_new (GimpDialogFactory *factory,
GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
......@@ -166,9 +168,5 @@ GtkWidget * dialogs_palette_editor_get (GimpDialogFactory *factory,
gint preview_size);
void dialogs_edit_palette_func (GimpData *data);
GtkWidget * dialogs_navigation_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
#endif /* __DIALOGS_CONSTRUCTORS_H__ */
......@@ -29,6 +29,7 @@
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpcontainerview-utils.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpimagedock.h"
#include "widgets/gimpitemfactory.h"
......@@ -46,6 +47,9 @@
#define PREVIEW_SIZE(path,size) \
{ { (path), NULL, dialogs_preview_size_cmd_callback, \
(size), "/Preview Size/Tiny" }, NULL, NULL, NULL }
#define TAB_STYLE(path,style) \
{ { (path), NULL, dialogs_tab_style_cmd_callback, \
(style), "/Tab Style/Icon" }, NULL, NULL, NULL }
GimpItemFactoryEntry dialogs_menu_entries[] =
......@@ -78,7 +82,7 @@ GimpItemFactoryEntry dialogs_menu_entries[] =
MENU_SEPARATOR ("/Add Tab/---"),
ADD_TAB (N_("/Add Tab/Colors..."), "gimp-color-editor",
"<StockItem>", GTK_STOCK_SELECT_COLOR),
"<StockItem>", GIMP_STOCK_DEFAULT_COLORS),
ADD_TAB (N_("/Add Tab/Brushes..."), "gimp-brush-grid",
"<StockItem>", GIMP_STOCK_TOOL_PAINTBRUSH),
ADD_TAB (N_("/Add Tab/Patterns..."), "gimp-pattern-grid",
......@@ -112,7 +116,7 @@ GimpItemFactoryEntry dialogs_menu_entries[] =
"<StockItem>", GTK_STOCK_REMOVE },
NULL, NULL, NULL },
MENU_SEPARATOR ("/view-type-separator"),
MENU_SEPARATOR ("/---"),
MENU_BRANCH ("/Preview Size"),
......@@ -130,6 +134,16 @@ GimpItemFactoryEntry dialogs_menu_entries[] =
PREVIEW_SIZE (N_("/Preview Size/Enormous"), GIMP_PREVIEW_SIZE_ENORMOUS),
PREVIEW_SIZE (N_("/Preview Size/Gigantic"), GIMP_PREVIEW_SIZE_GIGANTIC),
MENU_BRANCH ("/Tab Style"),
{ { N_("/Tab Style/Icon"), NULL,
dialogs_tab_style_cmd_callback,
GIMP_TAB_STYLE_ICON, "<RadioItem>" },
NULL, NULL, NULL },
TAB_STYLE (N_("/Tab Style/Text"), GIMP_TAB_STYLE_NAME),
TAB_STYLE (N_("/Tab Style/Icon & Text"), GIMP_TAB_STYLE_ICON_NAME),
{ { N_("/View as List"), NULL,
dialogs_toggle_view_cmd_callback, GIMP_VIEW_TYPE_LIST, "<RadioItem>" },
NULL, NULL, NULL },
......@@ -149,6 +163,7 @@ GimpItemFactoryEntry dialogs_menu_entries[] =
#undef ADD_TAB
#undef PREVIEW_SIZE
#undef TAB_STYLE
gint n_dialogs_menu_entries = G_N_ELEMENTS (dialogs_menu_entries);
......@@ -171,6 +186,7 @@ dialogs_menu_update (GtkItemFactory *factory,
gboolean list_view_available = FALSE;
gboolean grid_view_available = FALSE;
GimpPreviewSize preview_size = -1;
GimpTabStyle tab_style;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
......@@ -213,6 +229,8 @@ dialogs_menu_update (GtkItemFactory *factory,
if (view)
preview_size = view->preview_size;
tab_style = dockable->tab_style;
#define SET_ACTIVE(path,active) \
gimp_item_factory_set_active (factory, (path), (active))
#define SET_VISIBLE(path,active) \
......@@ -220,9 +238,6 @@ dialogs_menu_update (GtkItemFactory *factory,
#define SET_SENSITIVE(path,sensitive) \
gimp_item_factory_set_sensitive (factory, (path), (sensitive))
SET_VISIBLE ("/view-type-separator",
preview_size != -1 || view_type != -1);
SET_VISIBLE ("/Preview Size", preview_size != -1);
if (preview_size != -1)
......@@ -265,6 +280,13 @@ dialogs_menu_update (GtkItemFactory *factory,
}
}
if (tab_style == GIMP_TAB_STYLE_ICON)
SET_ACTIVE ("/Tab Style/Icon", TRUE);
else if (tab_style == GIMP_TAB_STYLE_NAME)
SET_ACTIVE ("/Tab Style/Text", TRUE);
else if (tab_style == GIMP_TAB_STYLE_ICON_NAME)
SET_ACTIVE ("/Tab Style/Icon & Text", TRUE);
SET_VISIBLE ("/View as Grid", view_type != -1);
SET_VISIBLE ("/View as List", view_type != -1);
......
......@@ -923,7 +923,7 @@ GimpItemFactoryEntry image_menu_entries[] =
{ { N_("/Dialogs/Colo_rs..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_SELECT_COLOR },
"<StockItem>", GIMP_STOCK_DEFAULT_COLORS },
"gimp-color-editor",
NULL, NULL },
{ { N_("/Dialogs/Brus_hes..."), "<control><shift>B",
......
......@@ -157,7 +157,7 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
{ { N_("/File/Dialogs/Colo_rs..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_SELECT_COLOR },
"<StockItem>", GIMP_STOCK_DEFAULT_COLORS },
"gimp-color-editor",
NULL, NULL },
{ { N_("/File/Dialogs/Brus_hes..."), "<control><shift>B",
......
......@@ -923,7 +923,7 @@ GimpItemFactoryEntry image_menu_entries[] =
{ { N_("/Dialogs/Colo_rs..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_SELECT_COLOR },
"<StockItem>", GIMP_STOCK_DEFAULT_COLORS },
"gimp-color-editor",
NULL, NULL },
{ { N_("/Dialogs/Brus_hes..."), "<control><shift>B",
......
......@@ -157,7 +157,7 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
{ { N_("/File/Dialogs/Colo_rs..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_SELECT_COLOR },
"<StockItem>", GIMP_STOCK_DEFAULT_COLORS },
"gimp-color-editor",
NULL, NULL },
{ { N_("/File/Dialogs/Brus_hes..."), "<control><shift>B",
......
......@@ -1146,7 +1146,10 @@ gimp_dialog_factories_save_foreach (gchar *name,
GimpDialogFactory *factory,
GimpConfigWriter *writer)
{
GList *list;
GEnumClass *enum_class;
GList *list;
enum_class = g_type_class_ref (GIMP_TYPE_TAB_STYLE);
for (list = factory->session_infos; list; list = g_list_next (list))
{
......@@ -1249,28 +1252,36 @@ gimp_dialog_factories_save_foreach (gchar *name,
if (entry)
{
GimpContainerView *view;
GEnumValue *enum_value;
gchar *tab_style = "icon";
gint preview_size = -1;
gimp_config_writer_linefeed (writer);
enum_value = g_enum_get_value (enum_class,
dockable->tab_style);
if (enum_value)
tab_style = enum_value->value_nick;
view = gimp_container_view_get_by_dockable (dockable);
if (view && view->preview_size >= GIMP_PREVIEW_SIZE_TINY)
{
preview_size = view->preview_size;
}
preview_size = view->preview_size;
if (preview_size > 0 &&
preview_size != entry->preview_size)
{
gimp_config_writer_printf (writer, "\"%s@%d\"",
gimp_config_writer_printf (writer, "\"%s@%s:%d\"",
entry->identifier,
tab_style,
preview_size);
}
else
{
gimp_config_writer_printf (writer, "\"%s\"",
entry->identifier);
gimp_config_writer_printf (writer, "\"%s@%s\"",
entry->identifier,
tab_style);
}
}
}
......@@ -1285,6 +1296,8 @@ gimp_dialog_factories_save_foreach (gchar *name,
gimp_config_writer_close (writer); /* session-info */
}
g_type_class_unref (enum_class);
}
static void
......@@ -1319,11 +1332,14 @@ gimp_dialog_factories_restore_foreach (gchar *name,
}
else
{
GimpDock *dock;
GList *books;
GimpDock *dock;
GList *books;
GEnumClass *enum_class;
dock = GIMP_DOCK (gimp_dialog_factory_dock_new (factory));
enum_class = g_type_class_ref (GIMP_TYPE_TAB_STYLE);
if (dock && info->aux_info)
gimp_dialog_factory_set_aux_info (GTK_WIDGET (dock), info);
......@@ -1338,24 +1354,51 @@ gimp_dialog_factories_restore_foreach (gchar *name,
for (pages = books->data; pages; pages = g_list_next (pages))
{
GtkWidget *dockable;
gchar *identifier;
gchar *substring;
gint preview_size = -1;
GtkWidget *dockable;
gchar *identifier;
gchar *substring;
gint preview_size = -1;
GimpTabStyle tab_style = GIMP_TAB_STYLE_ICON;
identifier = (gchar *) pages->data;
if ((substring = strstr (identifier, "@")))
{
gchar **split;
*substring = '\0';
substring++;
split = g_strsplit (substring, ":", 16);
preview_size = atoi (substring + 1);
if (split[0])
{
if (split[1] || ! g_ascii_isdigit (split[0][0]))
{
GEnumValue *enum_value;
enum_value = g_enum_get_value_by_nick (enum_class,
split[0]);
if (enum_value)
tab_style = enum_value->value;
}
else
{
preview_size = atoi (split[0]);
}
}
if (preview_size < GIMP_PREVIEW_SIZE_TINY ||
preview_size > GIMP_PREVIEW_SIZE_GIGANTIC)
preview_size = -1;
if (split[1])
preview_size = atoi (split[1]);
g_strfreev (split);
}
if (preview_size < GIMP_PREVIEW_SIZE_TINY ||
preview_size > GIMP_PREVIEW_SIZE_GIGANTIC)
preview_size = -1;
/* use the new dock's dialog factory to create dockables
* because it may be different from the dialog factory
* the dock was created from.
......@@ -1366,6 +1409,8 @@ gimp_dialog_factories_restore_foreach (gchar *name,
identifier,
preview_size);
GIMP_DOCKABLE (dockable)->tab_style = tab_style;
if (dockable)
gimp_dockbook_add (GIMP_DOCKBOOK (dockbook),
GIMP_DOCKABLE (dockable), -1);
......@@ -1380,6 +1425,8 @@ gimp_dialog_factories_restore_foreach (gchar *name,
info->sub_dialogs = NULL;
gtk_widget_show (GTK_WIDGET (dock));
g_type_class_unref (enum_class);
}
g_list_foreach (info->aux_info, (GFunc) g_free, NULL);
......
......@@ -43,7 +43,8 @@ static void gimp_dockable_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static GtkWidget * gimp_dockable_real_get_tab_widget (GimpDockable *dockable,
GimpDockbook *dockbook,
GimpContext *context,
GimpTabStyle tab_style,
GtkIconSize size);
static void gimp_dockable_real_set_context (GimpDockable *dockable,
GimpContext *context);
......@@ -113,12 +114,13 @@ static void
gimp_dockable_init (GimpDockable *dockable)
{
dockable->name = NULL;
dockable->short_name = NULL;
dockable->blurb = NULL;
dockable->stock_id = NULL;
dockable->tab_style = GIMP_TAB_STYLE_ICON;
dockable->dockbook = NULL;
dockable->context = NULL;
dockable->get_tab_func = NULL;
dockable->get_tab_data = NULL;
dockable->get_icon_func = NULL;
dockable->get_icon_data = NULL;
dockable->set_context_func = NULL;
}
......@@ -138,10 +140,10 @@ gimp_dockable_destroy (GtkObject *object)
dockable->name = NULL;
}
if (dockable->short_name)
if (dockable->blurb)
{
g_free (dockable->short_name);
dockable->short_name = NULL;
g_free (dockable->blurb);
dockable->blurb = NULL;
}
if (dockable->stock_id)
......@@ -216,25 +218,26 @@ gimp_dockable_style_set (GtkWidget *widget,
GtkWidget *
gimp_dockable_new (const gchar *name,
const gchar *short_name,
const gchar *blurb,
const gchar *stock_id,
GimpDockableGetTabFunc get_tab_func,
gpointer get_tab_data,
GimpDockableGetIconFunc get_icon_func,
gpointer get_icon_data,
GimpDockableSetContextFunc set_context_func)
{
GimpDockable *dockable;
g_return_val_if_fail