From 2f25fb132f15b77c5f3e0d25159bfcf8f959e0e4 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 20 Nov 2008 23:43:58 +0000 Subject: [PATCH] Use GimpContainer getters instead of poking into the class instance struct. * app/actions/context-commands.c * app/actions/data-commands.c * app/actions/plug-in-commands.c * app/actions/templates-commands.c * app/core/gimp-utils.c * app/core/gimpdrawablestack.c * app/core/gimpitemstack.c * app/core/gimplist.c * app/gui/gui-vtable.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview-dnd.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpcontainerview-utils.c * app/widgets/gimpcontainerview.c * app/widgets/gimpdataeditor.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpsettingsbox.c * app/widgets/gimpviewablebutton.c svn path=/trunk/; revision=27693 --- ChangeLog | 29 ++++++++++++++++++ app/actions/context-commands.c | 6 ++-- app/actions/data-commands.c | 16 +++++----- app/actions/plug-in-commands.c | 2 +- app/actions/templates-commands.c | 5 ++-- app/core/gimp-utils.c | 3 +- app/core/gimpdrawablestack.c | 3 +- app/core/gimpitemstack.c | 3 +- app/core/gimplist.c | 7 +++-- app/gui/gui-vtable.c | 39 +++++++++++++------------ app/widgets/gimpcontainerbox.c | 2 +- app/widgets/gimpcontainercombobox.c | 2 +- app/widgets/gimpcontainereditor.c | 2 +- app/widgets/gimpcontainerentry.c | 3 +- app/widgets/gimpcontainergridview.c | 6 ++-- app/widgets/gimpcontainerpopup.c | 6 ++-- app/widgets/gimpcontainertreeview-dnd.c | 4 +-- app/widgets/gimpcontainertreeview.c | 13 +++++---- app/widgets/gimpcontainerview-utils.c | 5 ++-- app/widgets/gimpcontainerview.c | 16 +++++----- app/widgets/gimpdataeditor.c | 6 ++-- app/widgets/gimpdatafactoryview.c | 6 ++-- app/widgets/gimpsettingsbox.c | 2 +- app/widgets/gimpviewablebutton.c | 6 ++-- 24 files changed, 116 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe9d5b24f9..6cf5c96c41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2008-11-20 Martin Nordholts + + Use GimpContainer getters instead of poking into the class + instance struct. + + * app/actions/context-commands.c + * app/actions/data-commands.c + * app/actions/plug-in-commands.c + * app/actions/templates-commands.c + * app/core/gimp-utils.c + * app/core/gimpdrawablestack.c + * app/core/gimpitemstack.c + * app/core/gimplist.c + * app/gui/gui-vtable.c + * app/widgets/gimpcontainerbox.c + * app/widgets/gimpcontainercombobox.c + * app/widgets/gimpcontainereditor.c + * app/widgets/gimpcontainerentry.c + * app/widgets/gimpcontainergridview.c + * app/widgets/gimpcontainerpopup.c + * app/widgets/gimpcontainertreeview-dnd.c + * app/widgets/gimpcontainertreeview.c + * app/widgets/gimpcontainerview-utils.c + * app/widgets/gimpcontainerview.c + * app/widgets/gimpdataeditor.c + * app/widgets/gimpdatafactoryview.c + * app/widgets/gimpsettingsbox.c + * app/widgets/gimpviewablebutton.c + 2008-11-20 Martin Nordholts s/gimp_container_children_type/gimp_container_get_children_type/ diff --git a/app/actions/context-commands.c b/app/actions/context-commands.c index ab58d4a9bf..8b66422713 100644 --- a/app/actions/context-commands.c +++ b/app/actions/context-commands.c @@ -679,12 +679,14 @@ context_select_object (GimpActionSelectType select_type, { GimpObject *current; - current = gimp_context_get_by_type (context, container->children_type); + current = gimp_context_get_by_type (context, + gimp_container_get_children_type (container)); current = action_select_object (select_type, container, current); if (current) - gimp_context_set_by_type (context, container->children_type, current); + gimp_context_set_by_type (context, + gimp_container_get_children_type (container), current); } static gint diff --git a/app/actions/data-commands.c b/app/actions/data-commands.c index d1360f8bb2..2a48e7864f 100644 --- a/app/actions/data-commands.c +++ b/app/actions/data-commands.c @@ -82,7 +82,7 @@ data_open_as_image_cmd_callback (GtkAction *action, data = (GimpData *) gimp_context_get_by_type (context, - view->factory->container->children_type); + gimp_container_get_children_type (view->factory->container)); if (data && data->filename) { @@ -135,7 +135,7 @@ data_new_cmd_callback (GtkAction *action, if (data) { gimp_context_set_by_type (context, - view->factory->container->children_type, + gimp_container_get_children_type (view->factory->container), GIMP_OBJECT (data)); gtk_button_clicked (GTK_BUTTON (view->edit_button)); @@ -155,7 +155,7 @@ data_duplicate_cmd_callback (GtkAction *action, data = (GimpData *) gimp_context_get_by_type (context, - view->factory->container->children_type); + gimp_container_get_children_type (view->factory->container)); if (data && gimp_container_have (view->factory->container, GIMP_OBJECT (data))) @@ -167,7 +167,7 @@ data_duplicate_cmd_callback (GtkAction *action, if (new_data) { gimp_context_set_by_type (context, - view->factory->container->children_type, + gimp_container_get_children_type (view->factory->container), GIMP_OBJECT (new_data)); gtk_button_clicked (GTK_BUTTON (view->edit_button)); @@ -187,7 +187,7 @@ data_copy_location_cmd_callback (GtkAction *action, data = (GimpData *) gimp_context_get_by_type (context, - view->factory->container->children_type); + gimp_container_get_children_type (view->factory->container)); if (data && data->filename && *data->filename) { @@ -214,7 +214,7 @@ data_delete_cmd_callback (GtkAction *action, data = (GimpData *) gimp_context_get_by_type (context, - view->factory->container->children_type); + gimp_container_get_children_type (view->factory->container)); if (data && data->deletable && gimp_container_have (view->factory->container, GIMP_OBJECT (data))) @@ -288,7 +288,7 @@ data_edit_cmd_callback (GtkAction *action, data = (GimpData *) gimp_context_get_by_type (context, - view->factory->container->children_type); + gimp_container_get_children_type (view->factory->container)); if (data && gimp_container_have (view->factory->container, GIMP_OBJECT (data))) @@ -335,7 +335,7 @@ data_delete_confirm_response (GtkWidget *dialog, if (new_active) gimp_context_set_by_type (delete_data->context, - factory->container->children_type, + gimp_container_get_children_type (factory->container), new_active); } diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index 6c5fdb1ccd..c8fa0bf2f4 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -135,7 +135,7 @@ plug_in_run_cmd_callback (GtkAction *action, context = gimp_container_view_get_context (editor->view); object = gimp_context_get_by_type (context, - container->children_type); + gimp_container_get_children_type (container)); n_args = plug_in_collect_data_args (action, object, procedure->args, diff --git a/app/actions/templates-commands.c b/app/actions/templates-commands.c index a650f5377f..2cbfa10bb7 100644 --- a/app/actions/templates-commands.c +++ b/app/actions/templates-commands.c @@ -144,7 +144,8 @@ templates_duplicate_cmd_callback (GtkAction *action, new_template = gimp_config_duplicate (GIMP_CONFIG (template)); gimp_container_add (container, GIMP_OBJECT (new_template)); - gimp_context_set_by_type (context, container->children_type, + gimp_context_set_by_type (context, + gimp_container_get_children_type (container), GIMP_OBJECT (new_template)); g_object_unref (new_template); @@ -299,7 +300,7 @@ templates_delete_response (GtkWidget *dialog, { if (new_active) gimp_context_set_by_type (delete_data->context, - delete_data->container->children_type, + gimp_container_get_children_type (delete_data->container), new_active); gimp_container_remove (delete_data->container, diff --git a/app/core/gimp-utils.c b/app/core/gimp-utils.c index 302d65544d..e5b2c3dc6f 100644 --- a/app/core/gimp-utils.c +++ b/app/core/gimp-utils.c @@ -508,7 +508,8 @@ gimp_container_get_neighbor_of_active (GimpContainer *container, g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_OBJECT (active), NULL); - if (active == gimp_context_get_by_type (context, container->children_type)) + if (active == gimp_context_get_by_type (context, + gimp_container_get_children_type (container))) { gint index = gimp_container_get_child_index (container, active); diff --git a/app/core/gimpdrawablestack.c b/app/core/gimpdrawablestack.c index 2143e8bc6f..4a60498c28 100644 --- a/app/core/gimpdrawablestack.c +++ b/app/core/gimpdrawablestack.c @@ -136,7 +136,8 @@ gimp_drawable_stack_constructor (GType type, container = GIMP_CONTAINER (object); - g_assert (g_type_is_a (container->children_type, GIMP_TYPE_DRAWABLE)); + g_assert (g_type_is_a (gimp_container_get_children_type (container), + GIMP_TYPE_DRAWABLE)); gimp_container_add_handler (container, "update", G_CALLBACK (gimp_drawable_stack_drawable_update), diff --git a/app/core/gimpitemstack.c b/app/core/gimpitemstack.c index e3d5fff6dd..38ea212547 100644 --- a/app/core/gimpitemstack.c +++ b/app/core/gimpitemstack.c @@ -75,7 +75,8 @@ gimp_item_stack_constructor (GType type, container = GIMP_CONTAINER (object); - g_assert (g_type_is_a (container->children_type, GIMP_TYPE_ITEM)); + g_assert (g_type_is_a (gimp_container_get_children_type (container), + GIMP_TYPE_ITEM)); return object; } diff --git a/app/core/gimplist.c b/app/core/gimplist.c index 06dd306b31..1d58ad690e 100644 --- a/app/core/gimplist.c +++ b/app/core/gimplist.c @@ -259,7 +259,8 @@ gimp_list_reorder (GimpContainer *container, list->list = g_list_remove (list->list, object); - if (new_index == -1 || new_index == container->num_children - 1) + if (new_index == -1 || + new_index == gimp_container_get_n_children (container) - 1) list->list = g_list_append (list->list, object); else list->list = g_list_insert (list->list, object, new_index); @@ -414,7 +415,7 @@ gimp_list_reverse (GimpList *list) { g_return_if_fail (GIMP_IS_LIST (list)); - if (GIMP_CONTAINER (list)->num_children > 1) + if (gimp_container_get_n_children (GIMP_CONTAINER (list)) > 1) { gimp_container_freeze (GIMP_CONTAINER (list)); list->list = g_list_reverse (list->list); @@ -462,7 +463,7 @@ gimp_list_sort (GimpList *list, g_return_if_fail (GIMP_IS_LIST (list)); g_return_if_fail (sort_func != NULL); - if (GIMP_CONTAINER (list)->num_children > 1) + if (gimp_container_get_n_children (GIMP_CONTAINER (list)) > 1) { gimp_container_freeze (GIMP_CONTAINER (list)); list->list = g_list_sort (list->list, sort_func); diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c index cba822dcc2..040f3e7d90 100644 --- a/app/gui/gui-vtable.c +++ b/app/gui/gui-vtable.c @@ -421,31 +421,31 @@ gui_pdb_dialog_new (Gimp *gimp, const gchar *dialog_role = NULL; const gchar *help_id = NULL; - if (container->children_type == GIMP_TYPE_BRUSH) + if (gimp_container_get_children_type (container) == GIMP_TYPE_BRUSH) { dialog_type = GIMP_TYPE_BRUSH_SELECT; dialog_role = "gimp-brush-selection"; help_id = GIMP_HELP_BRUSH_DIALOG; } - else if (container->children_type == GIMP_TYPE_FONT) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_FONT) { dialog_type = GIMP_TYPE_FONT_SELECT; dialog_role = "gimp-font-selection"; help_id = GIMP_HELP_FONT_DIALOG; } - else if (container->children_type == GIMP_TYPE_GRADIENT) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_GRADIENT) { dialog_type = GIMP_TYPE_GRADIENT_SELECT; dialog_role = "gimp-gradient-selection"; help_id = GIMP_HELP_GRADIENT_DIALOG; } - else if (container->children_type == GIMP_TYPE_PALETTE) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_PALETTE) { dialog_type = GIMP_TYPE_PALETTE_SELECT; dialog_role = "gimp-palette-selection"; help_id = GIMP_HELP_PALETTE_DIALOG; } - else if (container->children_type == GIMP_TYPE_PATTERN) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_PATTERN) { dialog_type = GIMP_TYPE_PATTERN_SELECT; dialog_role = "gimp-pattern-selection"; @@ -460,7 +460,8 @@ gui_pdb_dialog_new (Gimp *gimp, object = gimp_container_get_child_by_name (container, object_name); if (! object) - object = gimp_context_get_by_type (context, container->children_type); + object = gimp_context_get_by_type (context, + gimp_container_get_children_type (container)); if (object) { @@ -476,7 +477,7 @@ gui_pdb_dialog_new (Gimp *gimp, "help-id", help_id, "pdb", gimp->pdb, "context", context, - "select-type", container->children_type, + "select-type", gimp_container_get_children_type (container), "initial-object", object, "callback-name", callback_name, "menu-factory", global_menu_factory, @@ -533,15 +534,15 @@ gui_pdb_dialog_set (Gimp *gimp, { GimpPdbDialogClass *klass = NULL; - if (container->children_type == GIMP_TYPE_BRUSH) + if (gimp_container_get_children_type (container) == GIMP_TYPE_BRUSH) klass = g_type_class_peek (GIMP_TYPE_BRUSH_SELECT); - else if (container->children_type == GIMP_TYPE_FONT) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_FONT) klass = g_type_class_peek (GIMP_TYPE_FONT_SELECT); - else if (container->children_type == GIMP_TYPE_GRADIENT) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_GRADIENT) klass = g_type_class_peek (GIMP_TYPE_GRADIENT_SELECT); - else if (container->children_type == GIMP_TYPE_PALETTE) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_PALETTE) klass = g_type_class_peek (GIMP_TYPE_PALETTE_SELECT); - else if (container->children_type == GIMP_TYPE_PATTERN) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_PATTERN) klass = g_type_class_peek (GIMP_TYPE_PATTERN_SELECT); if (klass) @@ -550,7 +551,7 @@ gui_pdb_dialog_set (Gimp *gimp, dialog = gimp_pdb_dialog_get_by_callback (klass, callback_name); - if (dialog && dialog->select_type == container->children_type) + if (dialog && dialog->select_type == gimp_container_get_children_type (container)) { GimpObject *object; @@ -583,15 +584,15 @@ gui_pdb_dialog_close (Gimp *gimp, { GimpPdbDialogClass *klass = NULL; - if (container->children_type == GIMP_TYPE_BRUSH) + if (gimp_container_get_children_type (container) == GIMP_TYPE_BRUSH) klass = g_type_class_peek (GIMP_TYPE_BRUSH_SELECT); - else if (container->children_type == GIMP_TYPE_FONT) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_FONT) klass = g_type_class_peek (GIMP_TYPE_FONT_SELECT); - else if (container->children_type == GIMP_TYPE_GRADIENT) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_GRADIENT) klass = g_type_class_peek (GIMP_TYPE_GRADIENT_SELECT); - else if (container->children_type == GIMP_TYPE_PALETTE) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_PALETTE) klass = g_type_class_peek (GIMP_TYPE_PALETTE_SELECT); - else if (container->children_type == GIMP_TYPE_PATTERN) + else if (gimp_container_get_children_type (container) == GIMP_TYPE_PATTERN) klass = g_type_class_peek (GIMP_TYPE_PATTERN_SELECT); if (klass) @@ -600,7 +601,7 @@ gui_pdb_dialog_close (Gimp *gimp, dialog = gimp_pdb_dialog_get_by_callback (klass, callback_name); - if (dialog && dialog->select_type == container->children_type) + if (dialog && dialog->select_type == gimp_container_get_children_type (container)) { gtk_widget_destroy (GTK_WIDGET (dialog)); return TRUE; diff --git a/app/widgets/gimpcontainerbox.c b/app/widgets/gimpcontainerbox.c index 9477c29404..4b7a67a26f 100644 --- a/app/widgets/gimpcontainerbox.c +++ b/app/widgets/gimpcontainerbox.c @@ -175,7 +175,7 @@ gimp_container_box_get_preview (GimpDocked *docked, gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (GTK_WIDGET (box)), size, &width, &height); - prop_name = gimp_context_type_to_prop_name (container->children_type); + prop_name = gimp_context_type_to_prop_name (gimp_container_get_children_type (container)); preview = gimp_prop_view_new (G_OBJECT (context), prop_name, context, height); diff --git a/app/widgets/gimpcontainercombobox.c b/app/widgets/gimpcontainercombobox.c index ec1e71548e..d12538641a 100644 --- a/app/widgets/gimpcontainercombobox.c +++ b/app/widgets/gimpcontainercombobox.c @@ -379,7 +379,7 @@ gimp_container_combo_box_reorder_item (GimpContainerView *view, if (!iter) return; - if (new_index == -1 || new_index == container->num_children - 1) + if (new_index == -1 || new_index == gimp_container_get_n_children (container) - 1) { gtk_list_store_move_before (GTK_LIST_STORE (model), iter, NULL); } diff --git a/app/widgets/gimpcontainereditor.c b/app/widgets/gimpcontainereditor.c index 0dda304fb9..bba75f6b6c 100644 --- a/app/widgets/gimpcontainereditor.c +++ b/app/widgets/gimpcontainereditor.c @@ -175,7 +175,7 @@ gimp_container_editor_construct (GimpContainerEditor *editor, { GimpObject *object = gimp_context_get_by_type (context, - container->children_type); + gimp_container_get_children_type (container)); gimp_container_editor_select_item (GTK_WIDGET (editor->view), (GimpViewable *) object, NULL, diff --git a/app/widgets/gimpcontainerentry.c b/app/widgets/gimpcontainerentry.c index ccc3439b29..b5b7e90d1c 100644 --- a/app/widgets/gimpcontainerentry.c +++ b/app/widgets/gimpcontainerentry.c @@ -297,7 +297,8 @@ gimp_container_entry_reorder_item (GimpContainerView *view, if (!iter) return; - if (new_index == -1 || new_index == container->num_children - 1) + if (new_index == -1 || + new_index == gimp_container_get_n_children (container) - 1) { gtk_list_store_move_before (GTK_LIST_STORE (model), iter, NULL); } diff --git a/app/widgets/gimpcontainergridview.c b/app/widgets/gimpcontainergridview.c index 57f6f4d9a8..b102bfd77f 100644 --- a/app/widgets/gimpcontainergridview.c +++ b/app/widgets/gimpcontainergridview.c @@ -263,12 +263,12 @@ gimp_container_grid_view_move_by (GimpContainerGridView *grid_view, index = gimp_container_get_child_index (container, GIMP_OBJECT (item)); index += x; - index = CLAMP (index, 0, container->num_children - 1); + index = CLAMP (index, 0, gimp_container_get_n_children (container) - 1); index += y * grid_view->columns; while (index < 0) index += grid_view->columns; - while (index >= container->num_children) + while (index >= gimp_container_get_n_children (container)) index -= grid_view->columns; item = (GimpViewable *) gimp_container_get_child_by_index (container, index); @@ -299,7 +299,7 @@ gimp_container_grid_view_move_cursor (GimpContainerGridView *grid_view, count * grid_view->visible_rows); case GTK_MOVEMENT_BUFFER_ENDS: - count = count < 0 ? 0 : container->num_children - 1; + count = count < 0 ? 0 : gimp_container_get_n_children (container) - 1; item = (GimpViewable *) gimp_container_get_child_by_index (container, count); diff --git a/app/widgets/gimpcontainerpopup.c b/app/widgets/gimpcontainerpopup.c index cc825e95cf..67ec6a46ab 100644 --- a/app/widgets/gimpcontainerpopup.c +++ b/app/widgets/gimpcontainerpopup.c @@ -287,9 +287,9 @@ gimp_container_popup_real_confirm (GimpContainerPopup *popup) GimpObject *object; object = gimp_context_get_by_type (popup->context, - popup->container->children_type); + gimp_container_get_children_type (popup->container)); gimp_context_set_by_type (popup->orig_context, - popup->container->children_type, + gimp_container_get_children_type (popup->container), object); if (gtk_grab_get_current () == widget) @@ -369,7 +369,7 @@ gimp_container_popup_new (GimpContainer *container, popup->view_border_width = view_border_width; g_signal_connect (popup->context, - gimp_context_type_to_signal_name (container->children_type), + gimp_context_type_to_signal_name (gimp_container_get_children_type (container)), G_CALLBACK (gimp_container_popup_context_changed), popup); diff --git a/app/widgets/gimpcontainertreeview-dnd.c b/app/widgets/gimpcontainertreeview-dnd.c index 6a9ecc69e4..4e7b1d75d5 100644 --- a/app/widgets/gimpcontainertreeview-dnd.c +++ b/app/widgets/gimpcontainertreeview-dnd.c @@ -485,7 +485,7 @@ gimp_container_tree_view_real_drop_possible (GimpContainerTreeView *tree_view, gint dest_index = -1; if (src_viewable && g_type_is_a (G_TYPE_FROM_INSTANCE (src_viewable), - container->children_type)) + gimp_container_get_children_type (container))) { if (src_viewable == dest_viewable) return FALSE; @@ -525,7 +525,7 @@ gimp_container_tree_view_real_drop_possible (GimpContainerTreeView *tree_view, if (return_drag_action) { if (src_viewable && g_type_is_a (G_TYPE_FROM_INSTANCE (src_viewable), - container->children_type)) + gimp_container_get_children_type (container))) *return_drag_action = GDK_ACTION_MOVE; else *return_drag_action = GDK_ACTION_COPY; diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c index e9d35a0ad8..a25bb948e4 100644 --- a/app/widgets/gimpcontainertreeview.c +++ b/app/widgets/gimpcontainertreeview.c @@ -509,9 +509,9 @@ gimp_container_tree_view_set_container (GimpContainerView *view, if (! container) { if (gimp_dnd_viewable_source_remove (GTK_WIDGET (tree_view->view), - old_container->children_type)) + gimp_container_get_children_type (old_container))) { - if (GIMP_VIEWABLE_CLASS (g_type_class_peek (old_container->children_type))->get_size) + if (GIMP_VIEWABLE_CLASS (g_type_class_peek (gimp_container_get_children_type (old_container)))->get_size) gimp_dnd_pixbuf_source_remove (GTK_WIDGET (tree_view->view)); gtk_drag_source_unset (GTK_WIDGET (tree_view->view)); @@ -526,15 +526,15 @@ gimp_container_tree_view_set_container (GimpContainerView *view, { if (gimp_dnd_drag_source_set_by_type (GTK_WIDGET (tree_view->view), GDK_BUTTON1_MASK | GDK_BUTTON2_MASK, - container->children_type, + gimp_container_get_children_type (container), GDK_ACTION_COPY)) { gimp_dnd_viewable_source_add (GTK_WIDGET (tree_view->view), - container->children_type, + gimp_container_get_children_type (container), gimp_container_tree_view_drag_viewable, tree_view); - if (GIMP_VIEWABLE_CLASS (g_type_class_peek (container->children_type))->get_size) + if (GIMP_VIEWABLE_CLASS (g_type_class_peek (gimp_container_get_children_type (container)))->get_size) gimp_dnd_pixbuf_source_add (GTK_WIDGET (tree_view->view), gimp_container_tree_view_drag_pixbuf, tree_view); @@ -663,7 +663,8 @@ gimp_container_tree_view_reorder_item (GimpContainerView *view, g_object_unref (renderer); } - if (new_index == -1 || new_index == container->num_children - 1) + if (new_index == -1 || + new_index == gimp_container_get_n_children (container) - 1) { gtk_list_store_move_before (GTK_LIST_STORE (tree_view->model), iter, NULL); diff --git a/app/widgets/gimpcontainerview-utils.c b/app/widgets/gimpcontainerview-utils.c index 6bc661b875..3016c4cc94 100644 --- a/app/widgets/gimpcontainerview-utils.c +++ b/app/widgets/gimpcontainerview-utils.c @@ -73,7 +73,7 @@ gimp_container_view_remove_active (GimpContainerView *view) { GimpObject *active; - active = gimp_context_get_by_type (context, container->children_type); + active = gimp_context_get_by_type (context, gimp_container_get_children_type (container)); if (active) { @@ -83,7 +83,8 @@ gimp_container_view_remove_active (GimpContainerView *view) active); if (new) - gimp_context_set_by_type (context, container->children_type, + gimp_context_set_by_type (context, + gimp_container_get_children_type (container), new); gimp_container_remove (container, active); diff --git a/app/widgets/gimpcontainerview.c b/app/widgets/gimpcontainerview.c index 27f996c5da..b3fa7ffe47 100644 --- a/app/widgets/gimpcontainerview.c +++ b/app/widgets/gimpcontainerview.c @@ -347,7 +347,7 @@ gimp_container_view_set_container (GimpContainerView *view, g_return_if_fail (GIMP_IS_CONTAINER_VIEW (view)); g_return_if_fail (container == NULL || GIMP_IS_CONTAINER (container)); if (container) - g_return_if_fail (g_type_is_a (container->children_type, + g_return_if_fail (g_type_is_a (gimp_container_get_children_type (container), GIMP_TYPE_VIEWABLE)); private = GIMP_CONTAINER_VIEW_GET_PRIVATE (view); @@ -392,7 +392,7 @@ gimp_container_view_real_set_container (GimpContainerView *view, if (private->context) { - GType children_type = private->container->children_type; + GType children_type = gimp_container_get_children_type (private->container); const gchar *signal_name; signal_name = gimp_context_type_to_signal_name (children_type); @@ -417,7 +417,7 @@ gimp_container_view_real_set_container (GimpContainerView *view, if (private->container) { - GType children_type = private->container->children_type; + GType children_type = gimp_container_get_children_type (private->container); GimpViewableClass *viewable_class; viewable_class = g_type_class_ref (children_type); @@ -526,7 +526,7 @@ gimp_container_view_real_set_context (GimpContainerView *view, { if (private->container) { - GType children_type = private->container->children_type; + GType children_type = gimp_container_get_children_type (private->container); const gchar *signal_name; signal_name = gimp_context_type_to_signal_name (children_type); @@ -557,7 +557,7 @@ gimp_container_view_real_set_context (GimpContainerView *view, if (private->container) { - GType children_type = private->container->children_type; + GType children_type = gimp_container_get_children_type (private->container); const gchar *signal_name; signal_name = gimp_context_type_to_signal_name (children_type); @@ -800,7 +800,7 @@ gimp_container_view_item_selected (GimpContainerView *view, /* HACK */ if (private->container && private->context) { - GType children_type = private->container->children_type; + GType children_type = gimp_container_get_children_type (private->container); const gchar *signal_name; signal_name = gimp_context_type_to_signal_name (children_type); @@ -830,7 +830,7 @@ gimp_container_view_item_selected (GimpContainerView *view, view); gimp_context_set_by_type (context, - private->container->children_type, + gimp_container_get_children_type (private->container), GIMP_OBJECT (viewable)); g_signal_handlers_unblock_by_func (context, @@ -1081,7 +1081,7 @@ gimp_container_view_thaw (GimpContainerView *view, if (private->context) { - GType children_type = private->container->children_type; + GType children_type = gimp_container_get_children_type (private->container); const gchar *signal_name; signal_name = gimp_context_type_to_signal_name (children_type); diff --git a/app/widgets/gimpdataeditor.c b/app/widgets/gimpdataeditor.c index 5cc68f3847..3c013b8c86 100644 --- a/app/widgets/gimpdataeditor.c +++ b/app/widgets/gimpdataeditor.c @@ -353,7 +353,7 @@ gimp_data_editor_set_context (GimpDocked *docked, g_object_ref (editor->context); - data_type = editor->data_factory->container->children_type; + data_type = gimp_container_get_children_type (editor->data_factory->container); data = GIMP_DATA (gimp_context_get_by_type (editor->context, data_type)); g_signal_connect (editor->context, @@ -496,7 +496,7 @@ gimp_data_editor_set_data (GimpDataEditor *editor, g_return_if_fail (data == NULL || GIMP_IS_DATA (data)); g_return_if_fail (data == NULL || g_type_is_a (G_TYPE_FROM_INSTANCE (data), - editor->data_factory->container->children_type)); + gimp_container_get_children_type (editor->data_factory->container))); if (editor->data != data) { @@ -533,7 +533,7 @@ gimp_data_editor_set_edit_active (GimpDataEditor *editor, GType data_type; GimpData *data; - data_type = editor->data_factory->container->children_type; + data_type = gimp_container_get_children_type (editor->data_factory->container); data = GIMP_DATA (gimp_context_get_by_type (editor->context, data_type)); diff --git a/app/widgets/gimpdatafactoryview.c b/app/widgets/gimpdatafactoryview.c index fd05be3c21..999963c35c 100644 --- a/app/widgets/gimpdatafactoryview.c +++ b/app/widgets/gimpdatafactoryview.c @@ -198,13 +198,13 @@ gimp_data_factory_view_construct (GimpDataFactoryView *factory_view, gimp_container_view_enable_dnd (editor->view, GTK_BUTTON (factory_view->edit_button), - factory->container->children_type); + gimp_container_get_children_type (factory->container)); gimp_container_view_enable_dnd (editor->view, GTK_BUTTON (factory_view->duplicate_button), - factory->container->children_type); + gimp_container_get_children_type (factory->container)); gimp_container_view_enable_dnd (editor->view, GTK_BUTTON (factory_view->delete_button), - factory->container->children_type); + gimp_container_get_children_type (factory->container)); gimp_ui_manager_update (GIMP_EDITOR (editor->view)->ui_manager, editor); diff --git a/app/widgets/gimpsettingsbox.c b/app/widgets/gimpsettingsbox.c index 2d548c3eaf..89c7663bc7 100644 --- a/app/widgets/gimpsettingsbox.c +++ b/app/widgets/gimpsettingsbox.c @@ -427,7 +427,7 @@ gimp_settings_box_get_property (GObject *object, static void gimp_settings_box_separator_add (GimpContainer *container) { - GimpObject *sep = g_object_new (container->children_type, NULL); + GimpObject *sep = g_object_new (gimp_container_get_children_type (container), NULL); gimp_container_add (container, sep); g_object_unref (sep); diff --git a/app/widgets/gimpviewablebutton.c b/app/widgets/gimpviewablebutton.c index 9028ab3c09..e6ca6baed9 100644 --- a/app/widgets/gimpviewablebutton.c +++ b/app/widgets/gimpviewablebutton.c @@ -190,7 +190,7 @@ gimp_viewable_button_scroll_event (GtkWidget *widget, gint index; object = gimp_context_get_by_type (button->context, - button->container->children_type); + gimp_container_get_children_type (button->container)); index = gimp_container_get_child_index (button->container, object); @@ -223,7 +223,7 @@ gimp_viewable_button_scroll_event (GtkWidget *widget, if (object) gimp_context_set_by_type (button->context, - button->container->children_type, + gimp_container_get_children_type (button->container), object); } } @@ -321,7 +321,7 @@ gimp_viewable_button_new (GimpContainer *container, button->dialog_tooltip = g_strdup (dialog_tooltip); } - prop_name = gimp_context_type_to_prop_name (container->children_type); + prop_name = gimp_context_type_to_prop_name (gimp_container_get_children_type (container)); button->view = gimp_prop_view_new (G_OBJECT (context), prop_name, context, button->button_view_size);