Commit 181a581f authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/widgets/gimpchanneltreeview.c app/widgets/gimpcontainerbox.[ch]

2004-05-11  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpchanneltreeview.c
	* app/widgets/gimpcontainerbox.[ch]
	* app/widgets/gimpcontainereditor.c
	* app/widgets/gimpcontainergridview.[ch]
	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimpcontainertreeview.[ch]
	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimpdocumentview.c
	* app/widgets/gimpfontview.c
	* app/widgets/gimpimageview.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimppatternfactoryview.c
	* app/widgets/gimptemplateview.c
	* app/widgets/gimpvectorstreeview.c: code review / cleanup.
parent 930b621b
2004-05-11 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpcontainerbox.[ch]
* app/widgets/gimpcontainereditor.c
* app/widgets/gimpcontainergridview.[ch]
* app/widgets/gimpcontainerpopup.c
* app/widgets/gimpcontainertreeview.[ch]
* app/widgets/gimpdatafactoryview.c
* app/widgets/gimpdocumentview.c
* app/widgets/gimpfontview.c
* app/widgets/gimpimageview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimppatternfactoryview.c
* app/widgets/gimptemplateview.c
* app/widgets/gimpvectorstreeview.c: code review / cleanup.
2004-05-11 Michael Natterer <mitch@gimp.org>
* app/widgets/widgets-types.h
......
......@@ -157,7 +157,6 @@ gimp_channel_tree_view_init (GimpChannelTreeView *view)
gimp_get_mod_separator (),
gimp_get_mod_name_control ());
/* To Selection button */
view->toselection_button =
gimp_editor_add_button (GIMP_EDITOR (view),
GIMP_STOCK_SELECTION_REPLACE, str,
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpcontainerbox.c
* Copyright (C) 2001-2003 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2004 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpcontainerbox.h
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2004 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -93,6 +93,7 @@ gimp_container_editor_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gimp_container_editor_init,
};
static const GInterfaceInfo docked_iface_info =
{
(GInterfaceInitFunc) gimp_container_editor_docked_iface_init,
......@@ -163,8 +164,8 @@ gimp_container_editor_construct (GimpContainerEditor *editor,
case GIMP_VIEW_TYPE_GRID:
editor->view =
GIMP_CONTAINER_VIEW (gimp_container_grid_view_new (container,
context,
preview_size,
context,
preview_size,
preview_border_width,
reorderable));
break;
......@@ -172,14 +173,14 @@ gimp_container_editor_construct (GimpContainerEditor *editor,
case GIMP_VIEW_TYPE_LIST:
editor->view =
GIMP_CONTAINER_VIEW (gimp_container_tree_view_new (container,
context,
preview_size,
context,
preview_size,
preview_border_width,
reorderable));
break;
default:
g_warning ("%s(): unknown GimpViewType passed", G_GNUC_FUNCTION);
g_warning ("%s: unknown GimpViewType passed", G_STRFUNC);
return FALSE;
}
......@@ -192,19 +193,14 @@ gimp_container_editor_construct (GimpContainerEditor *editor,
gtk_widget_show (GTK_WIDGET (editor->view));
g_signal_connect_object (editor->view, "select_item",
G_CALLBACK (gimp_container_editor_select_item),
editor,
0);
G_CALLBACK (gimp_container_editor_select_item),
editor, 0);
g_signal_connect_object (editor->view, "activate_item",
G_CALLBACK (gimp_container_editor_activate_item),
editor,
0);
G_CALLBACK (gimp_container_editor_activate_item),
editor, 0);
g_signal_connect_object (editor->view, "context_item",
G_CALLBACK (gimp_container_editor_context_item),
editor,
0);
G_CALLBACK (gimp_container_editor_context_item),
editor, 0);
return TRUE;
}
......@@ -218,9 +214,7 @@ gimp_container_editor_select_item (GtkWidget *widget,
gpointer insert_data,
GimpContainerEditor *editor)
{
GimpContainerEditorClass *klass;
klass = GIMP_CONTAINER_EDITOR_GET_CLASS (editor);
GimpContainerEditorClass *klass = GIMP_CONTAINER_EDITOR_GET_CLASS (editor);
if (klass->select_item)
klass->select_item (editor, viewable);
......@@ -234,9 +228,7 @@ gimp_container_editor_activate_item (GtkWidget *widget,
gpointer insert_data,
GimpContainerEditor *editor)
{
GimpContainerEditorClass *klass;
klass = GIMP_CONTAINER_EDITOR_GET_CLASS (editor);
GimpContainerEditorClass *klass = GIMP_CONTAINER_EDITOR_GET_CLASS (editor);
if (klass->activate_item)
klass->activate_item (editor, viewable);
......@@ -248,9 +240,7 @@ gimp_container_editor_context_item (GtkWidget *widget,
gpointer insert_data,
GimpContainerEditor *editor)
{
GimpContainerEditorClass *klass;
klass = GIMP_CONTAINER_EDITOR_GET_CLASS (editor);
GimpContainerEditorClass *klass = GIMP_CONTAINER_EDITOR_GET_CLASS (editor);
if (klass->context_item)
klass->context_item (editor, viewable);
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpcontainergridview.c
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2001-2004 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -239,8 +239,8 @@ gimp_container_grid_view_view_iface_init (GimpContainerViewInterface *view_iface
GtkWidget *
gimp_container_grid_view_new (GimpContainer *container,
GimpContext *context,
gint preview_size,
GimpContext *context,
gint preview_size,
gint preview_border_width,
gboolean reorderable)
{
......@@ -352,7 +352,7 @@ gimp_container_grid_view_focus (GtkWidget *widget,
{
GimpContainerGridView *view = GIMP_CONTAINER_GRID_VIEW (widget);
if (GTK_WIDGET_CAN_FOCUS (widget) && !GTK_WIDGET_HAS_FOCUS (widget))
if (GTK_WIDGET_CAN_FOCUS (widget) && ! GTK_WIDGET_HAS_FOCUS (widget))
{
gtk_widget_grab_focus (GTK_WIDGET (widget));
return TRUE;
......@@ -563,7 +563,7 @@ gimp_container_grid_view_item_selected (GtkWidget *widget,
{
if (bevent->type == GDK_BUTTON_PRESS && bevent->button == 1)
{
if (GTK_WIDGET_CAN_FOCUS (data) && !GTK_WIDGET_HAS_FOCUS (data))
if (GTK_WIDGET_CAN_FOCUS (data) && ! GTK_WIDGET_HAS_FOCUS (data))
gtk_widget_grab_focus (GTK_WIDGET (data));
gimp_container_view_item_selected (GIMP_CONTAINER_VIEW (data),
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpcontainergridview.h
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2001-2004 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -34,7 +34,7 @@
#define GIMP_CONTAINER_GRID_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CONTAINER_GRID_VIEW, GimpContainerGridViewClass))
typedef struct _GimpContainerGridViewClass GimpContainerGridViewClass;
typedef struct _GimpContainerGridViewClass GimpContainerGridViewClass;
struct _GimpContainerGridView
{
......
......@@ -112,13 +112,10 @@ gimp_container_popup_get_type (void)
static void
gimp_container_popup_class_init (GimpContainerPopupClass *klass)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkBindingSet *binding_set;
object_class = G_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
popup_signals[CANCEL] =
......@@ -242,13 +239,10 @@ static gboolean
gimp_container_popup_button_press (GtkWidget *widget,
GdkEventButton *bevent)
{
GimpContainerPopup *popup;
GtkWidget *event_widget;
gboolean cancel = FALSE;
popup = GIMP_CONTAINER_POPUP (widget);
GtkWidget *event_widget;
gboolean cancel = FALSE;
event_widget = gtk_get_event_widget ((GdkEvent *) bevent);
event_widget = gtk_get_event_widget ((GdkEvent *) bevent);
if (event_widget == widget)
{
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpcontainertreeview.c
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2003-2004 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -56,7 +56,7 @@ enum
static void gimp_container_tree_view_class_init (GimpContainerTreeViewClass *klass);
static void gimp_container_tree_view_init (GimpContainerTreeView *view);
static void gimp_container_tree_view_view_iface_init (GimpContainerViewInterface *view_iface);
static void gimp_container_tree_view_view_iface_init (GimpContainerViewInterface *view_iface);
static GObject *gimp_container_tree_view_constructor (GType type,
guint n_params,
......@@ -156,7 +156,7 @@ gimp_container_tree_view_class_init (GimpContainerTreeViewClass *klass)
widget_class->popup_menu = gimp_container_tree_view_popup_menu;
klass->drop_possible = gimp_container_tree_view_real_drop_possible;
klass->drop = gimp_container_tree_view_real_drop;
klass->drop = gimp_container_tree_view_real_drop;
}
static void
......@@ -195,7 +195,6 @@ gimp_container_tree_view_view_iface_init (GimpContainerViewInterface *view_iface
view_iface->set_preview_size = gimp_container_tree_view_set_preview_size;
view_iface->insert_data_free = (GDestroyNotify) g_free;
}
static GObject *
......@@ -324,13 +323,10 @@ gimp_container_tree_view_menu_position (GtkMenu *menu,
gint *y,
gpointer data)
{
GimpContainerTreeView *tree_view;
GtkWidget *widget;
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (data);
GtkWidget *widget = GTK_WIDGET (tree_view->view);
GtkTreeIter selected_iter;
tree_view = GIMP_CONTAINER_TREE_VIEW (data);
widget = GTK_WIDGET (tree_view->view);
gdk_window_get_origin (widget->window, x, y);
if (GTK_WIDGET_NO_WINDOW (widget))
......@@ -365,11 +361,8 @@ gimp_container_tree_view_menu_position (GtkMenu *menu,
static gboolean
gimp_container_tree_view_popup_menu (GtkWidget *widget)
{
GimpContainerTreeView *tree_view;
GimpEditor *editor;
tree_view = GIMP_CONTAINER_TREE_VIEW (widget);
editor = GIMP_EDITOR (widget);
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (widget);
GimpEditor *editor = GIMP_EDITOR (widget);
if (gtk_tree_selection_get_selected (tree_view->selection, NULL, NULL) &&
editor->ui_manager)
......@@ -392,7 +385,7 @@ gimp_container_tree_view_popup_menu (GtkWidget *widget)
GtkWidget *
gimp_container_tree_view_new (GimpContainer *container,
GimpContext *context,
gint preview_size,
gint preview_size,
gint preview_border_width,
gboolean reorderable)
{
......@@ -439,8 +432,6 @@ gimp_container_tree_view_set (GimpContainerTreeView *tree_view,
preview_size = gimp_container_view_get_preview_size (view, &border_width);
name = gimp_viewable_get_description (viewable, NULL);
renderer = gimp_preview_renderer_new (G_TYPE_FROM_INSTANCE (viewable),
preview_size, border_width,
FALSE);
......@@ -451,13 +442,15 @@ gimp_container_tree_view_set (GimpContainerTreeView *tree_view,
G_CALLBACK (gimp_container_tree_view_renderer_update),
tree_view);
name = gimp_viewable_get_description (viewable, NULL);
gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
COLUMN_RENDERER, renderer,
COLUMN_NAME, name,
-1);
g_object_unref (renderer);
g_free (name);
g_object_unref (renderer);
}
/* GimpContainerView methods */
......@@ -536,9 +529,7 @@ gimp_container_tree_view_remove_item (GimpContainerView *view,
gpointer insert_data)
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GtkTreeIter *iter;
iter = (GtkTreeIter *) insert_data;
GtkTreeIter *iter = (GtkTreeIter *) insert_data;
if (iter)
gtk_list_store_remove (GTK_LIST_STORE (tree_view->model), iter);
......@@ -551,16 +542,16 @@ gimp_container_tree_view_reorder_item (GimpContainerView *view,
gpointer insert_data)
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GimpContainer *container;
GtkTreeIter *iter = (GtkTreeIter *) insert_data;
container = gimp_container_view_get_container (view);
if (iter)
{
GtkTreePath *path;
GtkTreeIter selected_iter;
gboolean selected;
GimpContainer *container;
GtkTreePath *path;
GtkTreeIter selected_iter;
gboolean selected;
container = gimp_container_view_get_container (view);
selected = gtk_tree_selection_get_selected (tree_view->selection,
NULL, &selected_iter);
......@@ -624,9 +615,7 @@ gimp_container_tree_view_rename_item (GimpContainerView *view,
gpointer insert_data)
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GtkTreeIter *iter;
iter = (GtkTreeIter *) insert_data;
GtkTreeIter *iter = (GtkTreeIter *) insert_data;
if (iter)
{
......@@ -646,9 +635,7 @@ gimp_container_tree_view_select_item (GimpContainerView *view,
gpointer insert_data)
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GtkTreeIter *iter;
iter = (GtkTreeIter *) insert_data;
GtkTreeIter *iter = (GtkTreeIter *) insert_data;
if (iter)
{
......@@ -806,12 +793,10 @@ gimp_container_tree_view_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpContainerTreeView *tree_view)
{
GimpContainerView *container_view;
GimpContainerView *container_view = GIMP_CONTAINER_VIEW (tree_view);
GtkTreeViewColumn *column;
GtkTreePath *path;
container_view = GIMP_CONTAINER_VIEW (tree_view);
tree_view->dnd_viewable = NULL;
if (! GTK_WIDGET_HAS_FOCUS (widget))
......@@ -997,9 +982,7 @@ gimp_container_tree_view_renderer_update (GimpPreviewRenderer *renderer,
GtkTreePath *path;
path = gtk_tree_model_get_path (tree_view->model, iter);
gtk_tree_model_row_changed (tree_view->model, path, iter);
gtk_tree_path_free (path);
}
}
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpcontainertreeview.h
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2003-2004 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -34,7 +34,7 @@
#define GIMP_CONTAINER_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CONTAINER_TREE_VIEW, GimpContainerTreeViewClass))
typedef struct _GimpContainerTreeViewClass GimpContainerTreeViewClass;
typedef struct _GimpContainerTreeViewClass GimpContainerTreeViewClass;
struct _GimpContainerTreeView
{
......
......@@ -105,9 +105,7 @@ gimp_data_factory_view_get_type (void)
static void
gimp_data_factory_view_class_init (GimpDataFactoryViewClass *klass)
{
GimpContainerEditorClass *editor_class;
editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
GimpContainerEditorClass *editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......
......@@ -115,9 +115,7 @@ gimp_document_view_get_type (void)
static void
gimp_document_view_class_init (GimpDocumentViewClass *klass)
{
GimpContainerEditorClass *editor_class;
editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
GimpContainerEditorClass *editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -269,13 +267,10 @@ static void
gimp_document_view_raise_display (gpointer data,
gpointer user_data)
{
GimpDisplay *gdisp;
RaiseClosure *closure;
GimpDisplay *gdisp = (GimpDisplay *) data;
RaiseClosure *closure = (RaiseClosure *) user_data;
const gchar *uri;
gdisp = (GimpDisplay *) data;
closure = (RaiseClosure *) user_data;
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
if (uri && ! strcmp (closure->name, uri))
......
......@@ -86,9 +86,7 @@ gimp_font_view_get_type (void)
static void
gimp_font_view_class_init (GimpFontViewClass *klass)
{
GimpContainerEditorClass *editor_class;
editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
GimpContainerEditorClass *editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......
......@@ -39,20 +39,20 @@
#include "gimp-intl.h"
static void gimp_image_view_class_init (GimpImageViewClass *klass);
static void gimp_image_view_init (GimpImageView *view);
static void gimp_image_view_class_init (GimpImageViewClass *klass);
static void gimp_image_view_init (GimpImageView *view);
static void gimp_image_view_raise_clicked (GtkWidget *widget,
GimpImageView *view);
static void gimp_image_view_new_clicked (GtkWidget *widget,
GimpImageView *view);
static void gimp_image_view_delete_clicked (GtkWidget *widget,
GimpImageView *view);
static void gimp_image_view_raise_clicked (GtkWidget *widget,
GimpImageView *view);
static void gimp_image_view_new_clicked (GtkWidget *widget,
GimpImageView *view);
static void gimp_image_view_delete_clicked (GtkWidget *widget,
GimpImageView *view);
static void gimp_image_view_select_item (GimpContainerEditor *editor,
GimpViewable *viewable);
static void gimp_image_view_activate_item (GimpContainerEditor *editor,
GimpViewable *viewable);
static void gimp_image_view_select_item (GimpContainerEditor *editor,
GimpViewable *viewable);
static void gimp_image_view_activate_item (GimpContainerEditor *editor,
GimpViewable *viewable);
static GimpContainerEditorClass *parent_class = NULL;
......@@ -89,9 +89,7 @@ gimp_image_view_get_type (void)
static void
gimp_image_view_class_init (GimpImageViewClass *klass)
{
GimpContainerEditorClass *editor_class;
editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
GimpContainerEditorClass *editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -244,12 +242,11 @@ static void
gimp_image_view_select_item (GimpContainerEditor *editor,
GimpViewable *viewable)
{
GimpImageView *view = GIMP_IMAGE_VIEW (editor);
GimpImageView *view = GIMP_IMAGE_VIEW (editor);
GimpContainer *container;
gboolean raise_sensitive = FALSE;
gboolean new_sensitive = FALSE;
gboolean delete_sensitive = FALSE;
gboolean raise_sensitive = FALSE;
gboolean new_sensitive = FALSE;
gboolean delete_sensitive = FALSE;
if (GIMP_CONTAINER_EDITOR_CLASS (parent_class)->select_item)
GIMP_CONTAINER_EDITOR_CLASS (parent_class)->select_item (editor, viewable);
......
......@@ -295,16 +295,14 @@ gimp_item_tree_view_class_init (GimpItemTreeViewClass *klass)
klass->lower_to_bottom_desc = NULL;
klass->lower_to_bottom_help_id = NULL;
g_object_class_install_property (object_class,
PROP_ITEM_TYPE,
g_param_spec_pointer ("item-type",
g_object_class_install_property (object_class, PROP_ITEM_TYPE,
g_param_spec_pointer ("item-type",
NULL, NULL,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class,
PROP_SIGNAL_NAME,
g_param_spec_string ("signal-name",
g_object_class_install_property (object_class, PROP_SIGNAL_NAME,
g_param_spec_string ("signal-name",
NULL, NULL,
NULL,
G_PARAM_READWRITE |
......@@ -315,13 +313,10 @@ static void
gimp_item_tree_view_init (GimpItemTreeView *view,
GimpItemTreeViewClass *view_class)
{
GimpContainerTreeView *tree_view;
GimpEditor *editor;
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GimpEditor *editor = GIMP_EDITOR (view);
gchar *str;
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
editor = GIMP_EDITOR (view);
/* The following used to read:
*
* tree_view->model_columns[tree_view->n_model_columns++] = ...
......@@ -695,7 +690,7 @@ gimp_item_tree_view_set_image (GimpItemTreeView *view,
GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_ITEM_TREE_VIEW (view));
g_return_if_fail (! gimage || GIMP_IS_IMAGE (gimage));
g_return_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage));
g_signal_emit (view, view_signals[SET_IMAGE], 0, gimage);
}
......@@ -704,9 +699,6 @@ static void
gimp_item_tree_view_real_set_image (GimpItemTreeView *view,
GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_ITEM_TREE_VIEW (view));
g_return_if_fail (! gimage || GIMP_IS_IMAGE (gimage));
if (view->gimage == gimage)
return;
......@@ -789,18 +781,13 @@ gimp_item_tree_view_insert_item (GimpContainerView *view,
GimpViewable *viewable,
gint index)
{
GimpContainerTreeView *tree_view;
GimpItemTreeView *item_view;
GimpItem *item;
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (view);
GimpItem *item = GIMP_ITEM (viewable);
GtkTreeIter *iter;
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
item_view = GIMP_ITEM_TREE_VIEW (view);
iter = parent_view_iface->insert_item (view, viewable, index);
item = GIMP_ITEM (viewable);
gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
item_view->model_column_visible,
gimp_item_get_visible (item),
......@@ -914,10 +901,6 @@ gimp_item_tree_view_drop_possible (GimpContainerTreeView *tree_view,
GtkTreeViewDropPosition drop_pos,
GdkDragAction *drag_action)
{
GimpItemTreeView *item_view;
item_view = GIMP_ITEM_TREE_VIEW (tree_view);
if (gimp_item_get_image (GIMP_ITEM (src_viewable)) !=
gimp_item_get_image (GIMP_ITEM (dest_viewable)))
{
......@@ -940,8 +923,8 @@ gimp_item_tree_view_drop (GimpContainerTreeView *tree_view,
GimpViewable *dest_viewable,
GtkTreeViewDropPosition drop_pos)
{
GimpContainerView *container_view;
GimpItemTreeView *item_view;
GimpContainerView *container_view = GIMP_CONTAINER_VIEW (tree_view);
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (tree_view);
GimpItemTreeViewClass *item_view_class;
GimpContainer *container;
GimpObject *src_object;
......@@ -949,9 +932,6 @@ gimp_item_tree_view_drop (GimpContainerTreeView *tree_view,
gint src_index;
gint dest_index;
container_view = GIMP_CONTAINER_VIEW (tree_view);
item_view = GIMP_ITEM_TREE_VIEW (tree_view);
container = gimp_container_view_get_container (container_view);
src_object = GIMP_OBJECT (src_viewable);
......@@ -974,9 +954,7 @@ gimp_item_tree_view_drop (GimpContainerTreeView *tree_view,
G_TYPE_FROM_INSTANCE (src_viewable),
TRUE);
item_view_class->add_item (item_view->gimage,
new_item,
dest_index);
item_view_class->add_item (item_view->gimage, new_item, dest_index);
}
else
{
......@@ -1068,11 +1046,9 @@ gimp_item_tree_view_duplicate_clicked (GtkWidget *widget,
if (item)
{
GimpItem *new_item;
new_item = gimp_item_duplicate (item,
G_TYPE_FROM_INSTANCE (item),
TRUE);
GimpItem *new_item = gimp_item_duplicate (item,
G_TYPE_FROM_INSTANCE (item),
TRUE);
if (new_item)
{
......
......@@ -231,17 +231,13 @@ gimp_layer_tree_view_class_init (GimpLayerTreeViewClass *klass)
static void
gimp_layer_tree_view_init (GimpLayerTreeView *view)
{
GimpContainerTreeView *tree_view;
GimpDrawableTreeView *drawable_view;
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GtkWidget *hbox;
GtkWidget *toggle;
GtkWidget *image;
GtkIconSize icon_size;
PangoAttribute *attr;
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
drawable_view = GIMP_DRAWABLE_TREE_VIEW (view);
/* The following used to read:
*
* tree_view->model_columns[tree_view->n_model_columns++] = ...
......@@ -463,12 +459,10 @@ static void
gimp_layer_tree_view_style_set (GtkWidget *widget,
GtkStyle *prev_style)
{
GimpLayerTreeView *layer_view;
GimpLayerTreeView *layer_view = GIMP_LAYER_TREE_VIEW (widget);
gint content_spacing;
gint button_spacing;
layer_view = GIMP_LAYER_TREE_VIEW (widget);
gtk_widget_style_get (widget,
"content_spacing", &content_spacing,
"button_spacing", &button_spacing,
......@@ -562,16 +556,13 @@ gimp_layer_tree_view_select_item (GimpContainerView *view,
GimpViewable *item,
gpointer insert_data)
{
GimpItemTreeView *item_view;
GimpLayerTreeView *layer_view;
gboolean options_sensitive = FALSE;
gboolean anchor_sensitive = FALSE;
gboolean raise_sensitive = FALSE;
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (view);
GimpLayerTreeView *layer_view = GIMP_LAYER_TREE_VIEW (view);
gboolean options_sensitive = FALSE;
gboolean anchor_sensitive = FALSE;
gboolean raise_sensitive = FALSE;
gboolean success;
item_view = GIMP_ITEM_TREE_VIEW (view);
layer_view = GIMP_LAYER_TREE_VIEW (view);
success = parent_view_iface->select_item (view, item, insert_data);
if (item)
......@@ -656,16 +647,10 @@ gimp_layer_tree_view_drop_possible (GimpContainerTreeView *tree_view,
GtkTreeViewDropPosition drop_pos,