Commit 7c964523 authored by Martin Nordholts's avatar Martin Nordholts

Make instance members private.

* app/widgets/gimpdock.[ch]: Make instance members private.

(gimp_dock_get_context)
(gimp_dock_get_dialog_factory)
(gimp_dock_get_dockbooks)
(gimp_dock_get_main_vbox)
(gimp_dock_get_vbox)
(gimp_dock_get_id): New getters.

* app/actions/actions.c
* app/actions/dockable-actions.c
* app/actions/dockable-commands.c
* app/actions/windows-actions.c
* app/menus/windows-menu.c
* app/widgets/gimpdialogfactory.c
* app/widgets/gimpdock.c
* app/widgets/gimpdock.h
* app/widgets/gimpdockable.c
* app/widgets/gimpdockbook.c
* app/widgets/gimpdockseparator.c
* app/widgets/gimpimagedock.c
* app/widgets/gimpmenudock.c
* app/widgets/gimpsessioninfo-book.c
* app/widgets/gimpsessioninfo-dock.c
* app/widgets/gimpsessioninfo-dockable.c
* app/widgets/gimptoolbox-color-area.c
* app/widgets/gimptoolbox-dnd.c
* app/widgets/gimptoolbox-image-area.c
* app/widgets/gimptoolbox-indicator-area.c
* app/widgets/gimptoolbox.c: Use new getters.

svn path=/trunk/; revision=27881
parent dff24a3d
2009-01-04 Martin Nordholts <martinn@svn.gnome.org>
* app/widgets/gimpdock.[ch]: Make instance members private.
(gimp_dock_get_context)
(gimp_dock_get_dialog_factory)
(gimp_dock_get_dockbooks)
(gimp_dock_get_main_vbox)
(gimp_dock_get_vbox)
(gimp_dock_get_id): New getters.
* app/actions/actions.c
* app/actions/dockable-actions.c
* app/actions/dockable-commands.c
* app/actions/windows-actions.c
* app/menus/windows-menu.c
* app/widgets/gimpdialogfactory.c
* app/widgets/gimpdock.c
* app/widgets/gimpdock.h
* app/widgets/gimpdockable.c
* app/widgets/gimpdockbook.c
* app/widgets/gimpdockseparator.c
* app/widgets/gimpimagedock.c
* app/widgets/gimpmenudock.c
* app/widgets/gimpsessioninfo-book.c
* app/widgets/gimpsessioninfo-dock.c
* app/widgets/gimpsessioninfo-dockable.c
* app/widgets/gimptoolbox-color-area.c
* app/widgets/gimptoolbox-dnd.c
* app/widgets/gimptoolbox-image-area.c
* app/widgets/gimptoolbox-indicator-area.c
* app/widgets/gimptoolbox.c: Use new getters.
2009-01-03 Martin Nordholts <martinn@svn.gnome.org> 2009-01-03 Martin Nordholts <martinn@svn.gnome.org>
* app/widgets/gimpcontainertreeview.c: Format static function * app/widgets/gimpcontainertreeview.c: Format static function
......
...@@ -269,7 +269,7 @@ action_data_get_gimp (gpointer data) ...@@ -269,7 +269,7 @@ action_data_get_gimp (gpointer data)
else if (GIMP_IS_GIMP (data)) else if (GIMP_IS_GIMP (data))
return data; return data;
else if (GIMP_IS_DOCK (data)) else if (GIMP_IS_DOCK (data))
context = ((GimpDock *) data)->context; context = gimp_dock_get_context (((GimpDock *) data));
else if (GIMP_IS_CONTAINER_VIEW (data)) else if (GIMP_IS_CONTAINER_VIEW (data))
context = gimp_container_view_get_context ((GimpContainerView *) data); context = gimp_container_view_get_context ((GimpContainerView *) data);
else if (GIMP_IS_CONTAINER_EDITOR (data)) else if (GIMP_IS_CONTAINER_EDITOR (data))
...@@ -296,7 +296,7 @@ action_data_get_context (gpointer data) ...@@ -296,7 +296,7 @@ action_data_get_context (gpointer data)
else if (GIMP_IS_GIMP (data)) else if (GIMP_IS_GIMP (data))
return gimp_get_user_context (data); return gimp_get_user_context (data);
else if (GIMP_IS_DOCK (data)) else if (GIMP_IS_DOCK (data))
return ((GimpDock *) data)->context; return gimp_dock_get_context ((GimpDock *) data);
else if (GIMP_IS_CONTAINER_VIEW (data)) else if (GIMP_IS_CONTAINER_VIEW (data))
return gimp_container_view_get_context ((GimpContainerView *) data); return gimp_container_view_get_context ((GimpContainerView *) data);
else if (GIMP_IS_CONTAINER_EDITOR (data)) else if (GIMP_IS_CONTAINER_EDITOR (data))
...@@ -322,7 +322,7 @@ action_data_get_image (gpointer data) ...@@ -322,7 +322,7 @@ action_data_get_image (gpointer data)
else if (GIMP_IS_GIMP (data)) else if (GIMP_IS_GIMP (data))
context = gimp_get_user_context (data); context = gimp_get_user_context (data);
else if (GIMP_IS_DOCK (data)) else if (GIMP_IS_DOCK (data))
context = ((GimpDock *) data)->context; context = gimp_dock_get_context ((GimpDock *) data);
else if (GIMP_IS_ITEM_TREE_VIEW (data)) else if (GIMP_IS_ITEM_TREE_VIEW (data))
return gimp_item_tree_view_get_image ((GimpItemTreeView *) data); return gimp_item_tree_view_get_image ((GimpItemTreeView *) data);
else if (GIMP_IS_IMAGE_EDITOR (data)) else if (GIMP_IS_IMAGE_EDITOR (data))
...@@ -349,7 +349,7 @@ action_data_get_display (gpointer data) ...@@ -349,7 +349,7 @@ action_data_get_display (gpointer data)
else if (GIMP_IS_GIMP (data)) else if (GIMP_IS_GIMP (data))
context = gimp_get_user_context (data); context = gimp_get_user_context (data);
else if (GIMP_IS_DOCK (data)) else if (GIMP_IS_DOCK (data))
context = ((GimpDock *) data)->context; context = gimp_dock_get_context ((GimpDock *) data);
else if (GIMP_IS_NAVIGATION_EDITOR (data)) else if (GIMP_IS_NAVIGATION_EDITOR (data))
context = ((GimpNavigationEditor *) data)->context; context = ((GimpNavigationEditor *) data)->context;
......
...@@ -246,12 +246,12 @@ dockable_actions_update (GimpActionGroup *group, ...@@ -246,12 +246,12 @@ dockable_actions_update (GimpActionGroup *group,
if (substring) if (substring)
{ {
memcpy (substring, "list", 4); memcpy (substring, "list", 4);
if (gimp_dialog_factory_find_entry (dockbook->dock->dialog_factory, if (gimp_dialog_factory_find_entry (gimp_dock_get_dialog_factory (dockbook->dock),
identifier)) identifier))
list_view_available = TRUE; list_view_available = TRUE;
memcpy (substring, "grid", 4); memcpy (substring, "grid", 4);
if (gimp_dialog_factory_find_entry (dockbook->dock->dialog_factory, if (gimp_dialog_factory_find_entry (gimp_dock_get_dialog_factory (dockbook->dock),
identifier)) identifier))
grid_view_available = TRUE; grid_view_available = TRUE;
} }
...@@ -267,7 +267,7 @@ dockable_actions_update (GimpActionGroup *group, ...@@ -267,7 +267,7 @@ dockable_actions_update (GimpActionGroup *group,
tab_style = dockable->tab_style; tab_style = dockable->tab_style;
n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (dockbook)); n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (dockbook));
n_books = g_list_length (dockbook->dock->dockbooks); n_books = g_list_length (gimp_dock_get_dockbooks (dockbook->dock));
#define SET_ACTIVE(action,active) \ #define SET_ACTIVE(action,active) \
gimp_action_group_set_action_active (group, action, (active) != 0) gimp_action_group_set_action_active (group, action, (active) != 0)
......
...@@ -66,7 +66,7 @@ dockable_add_tab_cmd_callback (GtkAction *action, ...@@ -66,7 +66,7 @@ dockable_add_tab_cmd_callback (GtkAction *action,
*p = '\0'; *p = '\0';
dockable = dockable =
gimp_dialog_factory_dockable_new (dockbook->dock->dialog_factory, gimp_dialog_factory_dockable_new (gimp_dock_get_dialog_factory (dockbook->dock),
dockbook->dock, dockbook->dock,
identifier, -1); identifier, -1);
...@@ -180,7 +180,7 @@ dockable_toggle_view_cmd_callback (GtkAction *action, ...@@ -180,7 +180,7 @@ dockable_toggle_view_cmd_callback (GtkAction *action,
new_dockable = new_dockable =
gimp_dialog_factory_dockable_new (dockbook->dock->dialog_factory, gimp_dialog_factory_dockable_new (gimp_dock_get_dialog_factory (dockbook->dock),
dockbook->dock, dockbook->dock,
identifier, identifier,
view_size); view_size);
......
...@@ -273,7 +273,7 @@ windows_actions_dock_added (GimpDialogFactory *factory, ...@@ -273,7 +273,7 @@ windows_actions_dock_added (GimpDialogFactory *factory,
GtkAction *action; GtkAction *action;
GimpActionEntry entry; GimpActionEntry entry;
gchar *action_name = g_strdup_printf ("windows-dock-%04d", gchar *action_name = g_strdup_printf ("windows-dock-%04d",
dock->ID); gimp_dock_get_id (dock));
entry.name = action_name; entry.name = action_name;
entry.stock_id = NULL; entry.stock_id = NULL;
...@@ -310,7 +310,7 @@ windows_actions_dock_removed (GimpDialogFactory *factory, ...@@ -310,7 +310,7 @@ windows_actions_dock_removed (GimpDialogFactory *factory,
GimpActionGroup *group) GimpActionGroup *group)
{ {
GtkAction *action; GtkAction *action;
gchar *action_name = g_strdup_printf ("windows-dock-%04d", dock->ID); gchar *action_name = g_strdup_printf ("windows-dock-%04d", gimp_dock_get_id (dock));
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name); action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name);
...@@ -328,7 +328,7 @@ windows_actions_dock_notify (GimpDock *dock, ...@@ -328,7 +328,7 @@ windows_actions_dock_notify (GimpDock *dock,
GtkAction *action; GtkAction *action;
gchar *action_name; gchar *action_name;
action_name = g_strdup_printf ("windows-dock-%04d", dock->ID); action_name = g_strdup_printf ("windows-dock-%04d", gimp_dock_get_id (dock));
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name); action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name);
g_free (action_name); g_free (action_name);
......
...@@ -256,10 +256,10 @@ windows_menu_dock_added (GimpDialogFactory *factory, ...@@ -256,10 +256,10 @@ windows_menu_dock_added (GimpDialogFactory *factory,
ui_path = g_object_get_data (G_OBJECT (manager), "image-menu-ui-path"); ui_path = g_object_get_data (G_OBJECT (manager), "image-menu-ui-path");
action_name = g_strdup_printf ("windows-dock-%04d", dock->ID); action_name = g_strdup_printf ("windows-dock-%04d", gimp_dock_get_id (dock));
action_path = g_strdup_printf ("%s/Windows/Docks", ui_path); action_path = g_strdup_printf ("%s/Windows/Docks", ui_path);
merge_key = g_strdup_printf ("windows-dock-%04d-merge-id", dock->ID); merge_key = g_strdup_printf ("windows-dock-%04d-merge-id", gimp_dock_get_id (dock));
merge_id = gtk_ui_manager_new_merge_id (GTK_UI_MANAGER (manager)); merge_id = gtk_ui_manager_new_merge_id (GTK_UI_MANAGER (manager));
g_object_set_data (G_OBJECT (manager), merge_key, g_object_set_data (G_OBJECT (manager), merge_key,
...@@ -280,7 +280,7 @@ windows_menu_dock_removed (GimpDialogFactory *factory, ...@@ -280,7 +280,7 @@ windows_menu_dock_removed (GimpDialogFactory *factory,
GimpDock *dock, GimpDock *dock,
GimpUIManager *manager) GimpUIManager *manager)
{ {
gchar *merge_key = g_strdup_printf ("windows-dock-%04d-merge-id", dock->ID); gchar *merge_key = g_strdup_printf ("windows-dock-%04d-merge-id", gimp_dock_get_id (dock));
guint merge_id; guint merge_id;
merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager), merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
......
...@@ -480,7 +480,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory, ...@@ -480,7 +480,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
view_size); view_size);
else if (dock) else if (dock)
dialog = factory->constructor (factory, entry, dialog = factory->constructor (factory, entry,
GIMP_DOCK (dock)->context, gimp_dock_get_context (GIMP_DOCK (dock)),
view_size); view_size);
else else
dialog = factory->constructor (factory, entry, dialog = factory->constructor (factory, entry,
...@@ -706,7 +706,7 @@ gimp_dialog_factory_dockable_new (GimpDialogFactory *factory, ...@@ -706,7 +706,7 @@ gimp_dialog_factory_dockable_new (GimpDialogFactory *factory,
return gimp_dialog_factory_dialog_new_internal (factory, return gimp_dialog_factory_dialog_new_internal (factory,
gtk_widget_get_screen (GTK_WIDGET (dock)), gtk_widget_get_screen (GTK_WIDGET (dock)),
dock->context, gimp_dock_get_context (dock),
identifier, identifier,
view_size, view_size,
FALSE, FALSE,
......
...@@ -65,6 +65,20 @@ enum ...@@ -65,6 +65,20 @@ enum
}; };
struct _GimpDockPriv
{
GimpDialogFactory *dialog_factory;
GimpContext *context;
GtkWidget *main_vbox;
GtkWidget *vbox;
GList *dockbooks;
gint ID; /* for themeing */
};
static GObject * gimp_dock_constructor (GType type, static GObject * gimp_dock_constructor (GType type,
guint n_params, guint n_params,
GObjectConstructParam *params); GObjectConstructParam *params);
...@@ -163,6 +177,8 @@ gimp_dock_class_init (GimpDockClass *klass) ...@@ -163,6 +177,8 @@ gimp_dock_class_init (GimpDockClass *klass)
G_MAXDOUBLE, G_MAXDOUBLE,
DEFAULT_DOCK_FONT_SCALE, DEFAULT_DOCK_FONT_SCALE,
GIMP_PARAM_READABLE)); GIMP_PARAM_READABLE));
g_type_class_add_private (klass, sizeof (GimpDockPriv));
} }
static void static void
...@@ -172,12 +188,15 @@ gimp_dock_init (GimpDock *dock) ...@@ -172,12 +188,15 @@ gimp_dock_init (GimpDock *dock)
GtkWidget *separator; GtkWidget *separator;
gchar *name; gchar *name;
dock->context = NULL; dock->priv = G_TYPE_INSTANCE_GET_PRIVATE (dock,
dock->dialog_factory = NULL; GIMP_TYPE_DOCK,
dock->dockbooks = NULL; GimpDockPriv);
dock->ID = dock_ID++; dock->priv->context = NULL;
dock->priv->dialog_factory = NULL;
dock->priv->dockbooks = NULL;
dock->priv->ID = dock_ID++;
name = g_strdup_printf ("gimp-dock-%d", dock->ID); name = g_strdup_printf ("gimp-dock-%d", dock->priv->ID);
gtk_widget_set_name (GTK_WIDGET (dock), name); gtk_widget_set_name (GTK_WIDGET (dock), name);
g_free (name); g_free (name);
...@@ -185,16 +204,16 @@ gimp_dock_init (GimpDock *dock) ...@@ -185,16 +204,16 @@ gimp_dock_init (GimpDock *dock)
gtk_window_set_resizable (GTK_WINDOW (dock), TRUE); gtk_window_set_resizable (GTK_WINDOW (dock), TRUE);
gtk_window_set_focus_on_map (GTK_WINDOW (dock), FALSE); gtk_window_set_focus_on_map (GTK_WINDOW (dock), FALSE);
dock->main_vbox = gtk_vbox_new (FALSE, 0); dock->priv->main_vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (dock), dock->main_vbox); gtk_container_add (GTK_CONTAINER (dock), dock->priv->main_vbox);
gtk_widget_show (dock->main_vbox); gtk_widget_show (dock->priv->main_vbox);
dock->vbox = gtk_vbox_new (FALSE, 0); dock->priv->vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (dock->main_vbox), dock->vbox); gtk_container_add (GTK_CONTAINER (dock->priv->main_vbox), dock->priv->vbox);
gtk_widget_show (dock->vbox); gtk_widget_show (dock->priv->vbox);
separator = gimp_dock_separator_new (dock, GTK_ANCHOR_NORTH); separator = gimp_dock_separator_new (dock, GTK_ANCHOR_NORTH);
gtk_box_pack_start (GTK_BOX (dock->vbox), separator, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (dock->priv->vbox), separator, FALSE, FALSE, 0);
gtk_widget_show (separator); gtk_widget_show (separator);
} }
...@@ -211,10 +230,10 @@ gimp_dock_constructor (GType type, ...@@ -211,10 +230,10 @@ gimp_dock_constructor (GType type,
dock = GIMP_DOCK (object); dock = GIMP_DOCK (object);
g_assert (GIMP_IS_CONTEXT (dock->context)); g_assert (GIMP_IS_CONTEXT (dock->priv->context));
g_assert (GIMP_IS_DIALOG_FACTORY (dock->dialog_factory)); g_assert (GIMP_IS_DIALOG_FACTORY (dock->priv->dialog_factory));
config = GIMP_GUI_CONFIG (dock->context->gimp->config); config = GIMP_GUI_CONFIG (dock->priv->context->gimp->config);
gimp_window_set_hint (GTK_WINDOW (dock), config->dock_window_hint); gimp_window_set_hint (GTK_WINDOW (dock), config->dock_window_hint);
...@@ -232,11 +251,11 @@ gimp_dock_set_property (GObject *object, ...@@ -232,11 +251,11 @@ gimp_dock_set_property (GObject *object,
switch (property_id) switch (property_id)
{ {
case PROP_CONTEXT: case PROP_CONTEXT:
dock->context = g_value_dup_object (value); dock->priv->context = g_value_dup_object (value);
break; break;
case PROP_DIALOG_FACTORY: case PROP_DIALOG_FACTORY:
dock->dialog_factory = g_value_get_object (value); dock->priv->dialog_factory = g_value_get_object (value);
break; break;
default: default:
...@@ -256,11 +275,11 @@ gimp_dock_get_property (GObject *object, ...@@ -256,11 +275,11 @@ gimp_dock_get_property (GObject *object,
switch (property_id) switch (property_id)
{ {
case PROP_CONTEXT: case PROP_CONTEXT:
g_value_set_object (value, dock->context); g_value_set_object (value, dock->priv->context);
break; break;
case PROP_DIALOG_FACTORY: case PROP_DIALOG_FACTORY:
g_value_set_object (value, dock->dialog_factory); g_value_set_object (value, dock->priv->dialog_factory);
break; break;
default: default:
...@@ -274,13 +293,13 @@ gimp_dock_destroy (GtkObject *object) ...@@ -274,13 +293,13 @@ gimp_dock_destroy (GtkObject *object)
{ {
GimpDock *dock = GIMP_DOCK (object); GimpDock *dock = GIMP_DOCK (object);
while (dock->dockbooks) while (dock->priv->dockbooks)
gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->dockbooks->data)); gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->priv->dockbooks->data));
if (dock->context) if (dock->priv->context)
{ {
g_object_unref (dock->context); g_object_unref (dock->priv->context);
dock->context = NULL; dock->priv->context = NULL;
} }
GTK_OBJECT_CLASS (parent_class)->destroy (object); GTK_OBJECT_CLASS (parent_class)->destroy (object);
...@@ -294,7 +313,7 @@ gimp_dock_delete_event (GtkWidget *widget, ...@@ -294,7 +313,7 @@ gimp_dock_delete_event (GtkWidget *widget,
GList *list; GList *list;
gint n; gint n;
for (list = dock->dockbooks, n = 0; list; list = list->next) for (list = dock->priv->dockbooks, n = 0; list; list = list->next)
n += gtk_notebook_get_n_pages (GTK_NOTEBOOK (list->data)); n += gtk_notebook_get_n_pages (GTK_NOTEBOOK (list->data));
if (n > 1) if (n > 1)
...@@ -357,7 +376,7 @@ gimp_dock_style_set (GtkWidget *widget, ...@@ -357,7 +376,7 @@ gimp_dock_style_set (GtkWidget *widget,
"}" "}"
"widget \"gimp-dock-%d.*\" style \"gimp-dock-style\"", "widget \"gimp-dock-%d.*\" style \"gimp-dock-style\"",
font_str, font_str,
GIMP_DOCK (widget)->ID); GIMP_DOCK (widget)->priv->ID);
g_free (font_str); g_free (font_str);
gtk_rc_parse_string (rc_string); gtk_rc_parse_string (rc_string);
...@@ -378,7 +397,7 @@ static void ...@@ -378,7 +397,7 @@ static void
gimp_dock_real_book_removed (GimpDock *dock, gimp_dock_real_book_removed (GimpDock *dock,
GimpDockbook *dockbook) GimpDockbook *dockbook)
{ {
if (dock->dockbooks == NULL) if (dock->priv->dockbooks == NULL)
gtk_widget_destroy (GTK_WIDGET (dock)); gtk_widget_destroy (GTK_WIDGET (dock));
} }
...@@ -417,6 +436,54 @@ gimp_dock_get_aux_info (GimpDock *dock) ...@@ -417,6 +436,54 @@ gimp_dock_get_aux_info (GimpDock *dock)
return NULL; return NULL;
} }
GimpContext *
gimp_dock_get_context (GimpDock *dock)
{
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
return dock->priv->context;
}
GimpDialogFactory *
gimp_dock_get_dialog_factory (GimpDock *dock)
{
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
return dock->priv->dialog_factory;
}
GList *
gimp_dock_get_dockbooks (GimpDock *dock)
{
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
return dock->priv->dockbooks;
}
GtkWidget *
gimp_dock_get_main_vbox (GimpDock *dock)
{
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
return dock->priv->main_vbox;
}
GtkWidget *
gimp_dock_get_vbox (GimpDock *dock)
{
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
return dock->priv->vbox;
}
gint
gimp_dock_get_id (GimpDock *dock)
{
g_return_val_if_fail (GIMP_IS_DOCK (dock), 0);
return dock->priv->ID;
}
void void
gimp_dock_add (GimpDock *dock, gimp_dock_add (GimpDock *dock,
GimpDockable *dockable, GimpDockable *dockable,
...@@ -429,7 +496,7 @@ gimp_dock_add (GimpDock *dock, ...@@ -429,7 +496,7 @@ gimp_dock_add (GimpDock *dock,
g_return_if_fail (GIMP_IS_DOCKABLE (dockable)); g_return_if_fail (GIMP_IS_DOCKABLE (dockable));
g_return_if_fail (dockable->dockbook == NULL); g_return_if_fail (dockable->dockbook == NULL);
dockbook = GIMP_DOCKBOOK (dock->dockbooks->data); dockbook = GIMP_DOCKBOOK (dock->priv->dockbooks->data);
gimp_dockbook_add (dockbook, dockable, position); gimp_dockbook_add (dockbook, dockable, position);
} }
...@@ -457,23 +524,23 @@ gimp_dock_add_book (GimpDock *dock, ...@@ -457,23 +524,23 @@ gimp_dock_add_book (GimpDock *dock,
g_return_if_fail (GIMP_IS_DOCKBOOK (dockbook)); g_return_if_fail (GIMP_IS_DOCKBOOK (dockbook));
g_return_if_fail (dockbook->dock == NULL); g_return_if_fail (dockbook->dock == NULL);
old_length = g_list_length (dock->dockbooks); old_length = g_list_length (dock->priv->dockbooks);
if (index >= old_length || index < 0) if (index >= old_length || index < 0)
index = old_length; index = old_length;
dockbook->dock = dock; dockbook->dock = dock;
dock->dockbooks = g_list_insert (dock->dockbooks, dockbook, index); dock->priv->dockbooks = g_list_insert (dock->priv->dockbooks, dockbook, index);
if (old_length == 0) if (old_length == 0)
{ {
GtkWidget *separator; GtkWidget *separator;
gtk_box_pack_start (GTK_BOX (dock->vbox), GTK_WIDGET (dockbook), gtk_box_pack_start (GTK_BOX (dock->priv->vbox), GTK_WIDGET (dockbook),
TRUE, TRUE, 0); TRUE, TRUE, 0);
separator = gimp_dock_separator_new (dock, GTK_ANCHOR_SOUTH); separator = gimp_dock_separator_new (dock, GTK_ANCHOR_SOUTH);
gtk_box_pack_end (GTK_BOX (dock->vbox), separator, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (dock->priv->vbox), separator, FALSE, FALSE, 0);
gtk_widget_show (separator); gtk_widget_show (separator);
} }
else else
...@@ -483,9 +550,9 @@ gimp_dock_add_book (GimpDock *dock, ...@@ -483,9 +550,9 @@ gimp_dock_add_book (GimpDock *dock,
GtkWidget *paned; GtkWidget *paned;
if (index == 0) if (index == 0)
old_book = g_list_nth_data (dock->dockbooks, index + 1); old_book = g_list_nth_data (dock->priv->dockbooks, index + 1);
else else
old_book = g_list_nth_data (dock->dockbooks, index - 1); old_book = g_list_nth_data (dock->priv->dockbooks, index - 1);
parent = gtk_widget_get_parent (old_book); parent = gtk_widget_get_parent (old_book);
...@@ -547,11 +614,11 @@ gimp_dock_remove_book (GimpDock *dock, ...@@ -547,11 +614,11 @@ gimp_dock_remove_book (GimpDock *dock,
g_return_if_fail (dockbook->dock == dock); g_return_if_fail (dockbook->dock == dock);
old_length = g_list_length (dock->dockbooks); old_length = g_list_length (dock->priv->dockbooks);
index = g_list_index (dock->dockbooks, dockbook); index = g_list_index (dock->priv->dockbooks, dockbook);
dockbook->dock = NULL; dockbook->dock = NULL;
dock->dockbooks = g_list_remove (dock->dockbooks, dockbook); dock->priv->dockbooks = g_list_remove (dock->priv->dockbooks, dockbook);
g_object_ref (dockbook); g_object_ref (dockbook);
...@@ -560,12 +627,12 @@ gimp_dock_remove_book (GimpDock *dock, ...@@ -560,12 +627,12 @@ gimp_dock_remove_book (GimpDock *dock,
GtkWidget *separator;