Commit 930b621b authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/widgets/widgets-types.h made GimpContainerView an interface. Added

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

	* app/widgets/widgets-types.h
	* app/widgets/gimpcontainerview.[ch]: made GimpContainerView an
	interface. Added accessors for all members in the private struct
	and made it really private.

	* app/widgets/gimpcontainerbox.[ch]: derive it from GimpEditor and
	implement GimpContainerViewInterface and its properties.

	* app/widgets/gimpchanneltreeview.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainertreeview.c
	* app/widgets/gimpcontainertreeview-dnd.c
	* app/widgets/gimpdrawabletreeview.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimpvectorstreeview.c: implement
	GimpContainerViewInterface and use the new accessor functions.

	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimpdocumentview.c: changed accordingly.

	* app/widgets/gimptemplateview.c
	* app/widgets/gimpcontainereditor.c
	* app/widgets/gimpundoeditor.c
	* app/actions/palettes-commands.c: #include "gimpcontainerview.h"
parent 2589d2ec
2004-05-11 Michael Natterer <mitch@gimp.org>
* app/widgets/widgets-types.h
* app/widgets/gimpcontainerview.[ch]: made GimpContainerView an
interface. Added accessors for all members in the private struct
and made it really private.
* app/widgets/gimpcontainerbox.[ch]: derive it from GimpEditor and
implement GimpContainerViewInterface and its properties.
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainertreeview.c
* app/widgets/gimpcontainertreeview-dnd.c
* app/widgets/gimpdrawabletreeview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c: implement
GimpContainerViewInterface and use the new accessor functions.
* app/widgets/gimpcontainerpopup.c
* app/widgets/gimpdocumentview.c: changed accordingly.
* app/widgets/gimptemplateview.c
* app/widgets/gimpcontainereditor.c
* app/widgets/gimpundoeditor.c
* app/actions/palettes-commands.c: #include "gimpcontainerview.h"
2004-05-11 Sven Neumann <sven@gimp.org>
* libgimp/gimp.def
......
......@@ -29,6 +29,7 @@
#include "core/gimpcontext.h"
#include "widgets/gimpcontainertreeview.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimppreview.h"
......
......@@ -35,6 +35,7 @@
#include "gimpchanneltreeview.h"
#include "gimpcomponenteditor.h"
#include "gimpcontainerview.h"
#include "gimpdnd.h"
#include "gimphelp-ids.h"
#include "gimpwidgets-utils.h"
......@@ -45,6 +46,8 @@
static void gimp_channel_tree_view_class_init (GimpChannelTreeViewClass *klass);
static void gimp_channel_tree_view_init (GimpChannelTreeView *view);
static void gimp_channel_tree_view_view_iface_init (GimpContainerViewInterface *view_iface);
static void gimp_channel_tree_view_set_image (GimpItemTreeView *item_view,
GimpImage *gimage);
......@@ -62,7 +65,8 @@ static void gimp_channel_tree_view_toselection_extended_clicked
GimpChannelTreeView *view);
static GimpDrawableTreeViewClass *parent_class = NULL;
static GimpDrawableTreeViewClass *parent_class = NULL;
static GimpContainerViewInterface *parent_view_iface = NULL;
GType
......@@ -85,9 +89,19 @@ gimp_channel_tree_view_get_type (void)
(GInstanceInitFunc) gimp_channel_tree_view_init,
};
static const GInterfaceInfo view_iface_info =
{
(GInterfaceInitFunc) gimp_channel_tree_view_view_iface_init,
NULL, /* iface_finalize */
NULL /* iface_data */
};
view_type = g_type_register_static (GIMP_TYPE_DRAWABLE_TREE_VIEW,
"GimpChannelTreeView",
&view_info, 0);
g_type_add_interface_static (view_type, GIMP_TYPE_CONTAINER_VIEW,
&view_iface_info);
}
return view_type;
......@@ -96,17 +110,10 @@ gimp_channel_tree_view_get_type (void)
static void
gimp_channel_tree_view_class_init (GimpChannelTreeViewClass *klass)
{
GimpContainerViewClass *container_view_class;
GimpItemTreeViewClass *item_view_class;
container_view_class = GIMP_CONTAINER_VIEW_CLASS (klass);
item_view_class = GIMP_ITEM_TREE_VIEW_CLASS (klass);
GimpItemTreeViewClass *item_view_class = GIMP_ITEM_TREE_VIEW_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
container_view_class->select_item = gimp_channel_tree_view_select_item;
container_view_class->set_preview_size = gimp_channel_tree_view_set_preview_size;
item_view_class->set_image = gimp_channel_tree_view_set_image;
item_view_class->get_container = gimp_image_get_channels;
......@@ -171,6 +178,15 @@ gimp_channel_tree_view_init (GimpChannelTreeView *view)
gtk_widget_set_sensitive (view->toselection_button, FALSE);
}
static void
gimp_channel_tree_view_view_iface_init (GimpContainerViewInterface *view_iface)
{
parent_view_iface = g_type_interface_peek_parent (view_iface);
view_iface->select_item = gimp_channel_tree_view_select_item;
view_iface->set_preview_size = gimp_channel_tree_view_set_preview_size;
}
/* GimpItemTreeView methods */
......@@ -216,15 +232,11 @@ gimp_channel_tree_view_select_item (GimpContainerView *view,
GimpViewable *item,
gpointer insert_data)
{
GimpItemTreeView *item_view;
GimpChannelTreeView *tree_view;
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (view);
GimpChannelTreeView *tree_view = GIMP_CHANNEL_TREE_VIEW (view);
gboolean success;
item_view = GIMP_ITEM_TREE_VIEW (view);
tree_view = GIMP_CHANNEL_TREE_VIEW (view);
success = GIMP_CONTAINER_VIEW_CLASS (parent_class)->select_item (view, item,
insert_data);
success = parent_view_iface->select_item (view, item, insert_data);
if (item_view->gimage)
{
......@@ -247,9 +259,9 @@ gimp_channel_tree_view_set_preview_size (GimpContainerView *view)
GimpChannelTreeView *channel_view = GIMP_CHANNEL_TREE_VIEW (view);
gint preview_size;
preview_size = gimp_container_view_get_preview_size (view, NULL);
parent_view_iface->set_preview_size (view);
GIMP_CONTAINER_VIEW_CLASS (parent_class)->set_preview_size (view);
preview_size = gimp_container_view_get_preview_size (view, NULL);
if (channel_view->component_editor)
gimp_component_editor_set_preview_size (GIMP_COMPONENT_EDITOR (channel_view->component_editor),
......
......@@ -33,6 +33,7 @@
#include "core/gimpcontext.h"
#include "gimpcontainerbox.h"
#include "gimpcontainerview.h"
#include "gimpdnd.h"
#include "gimpdocked.h"
#include "gimppreview.h"
......@@ -40,19 +41,38 @@
#include "gimppropwidgets.h"
enum
{
PROP_0,
PROP_CONTAINER,
PROP_CONTEXT,
PROP_REORDERABLE
};
static void gimp_container_box_class_init (GimpContainerBoxClass *klass);
static void gimp_container_box_init (GimpContainerBox *box);
static void gimp_container_box_view_iface_init (GimpContainerViewInterface *view_iface);
static void gimp_container_box_docked_iface_init (GimpDockedInterface *docked_iface);
static GtkWidget * gimp_container_box_get_preview (GimpDocked *docked,
GimpContext *context,
GtkIconSize size);
static void gimp_container_box_set_context (GimpDocked *docked,
GimpContext *context,
GimpContext *prev_context);
static void gimp_container_box_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_container_box_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static GtkWidget * gimp_container_box_get_preview (GimpDocked *docked,
GimpContext *context,
GtkIconSize size);
static void gimp_container_box_set_context (GimpDocked *docked,
GimpContext *context,
GimpContext *prev_context);
static GimpContainerViewClass *parent_class = NULL;
static GimpEditorClass *parent_class = NULL;
GType
......@@ -75,6 +95,12 @@ gimp_container_box_get_type (void)
(GInstanceInitFunc) gimp_container_box_init,
};
static const GInterfaceInfo view_iface_info =
{
(GInterfaceInitFunc) gimp_container_box_view_iface_init,
NULL, /* iface_finalize */
NULL /* iface_data */
};
static const GInterfaceInfo docked_iface_info =
{
(GInterfaceInitFunc) gimp_container_box_docked_iface_init,
......@@ -82,10 +108,12 @@ gimp_container_box_get_type (void)
NULL /* iface_data */
};
type = g_type_register_static (GIMP_TYPE_CONTAINER_VIEW,
type = g_type_register_static (GIMP_TYPE_EDITOR,
"GimpContainerBox",
&box_info, 0);
g_type_add_interface_static (type, GIMP_TYPE_CONTAINER_VIEW,
&view_iface_info);
g_type_add_interface_static (type, GIMP_TYPE_DOCKED,
&docked_iface_info);
}
......@@ -96,16 +124,25 @@ gimp_container_box_get_type (void)
static void
gimp_container_box_class_init (GimpContainerBoxClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->set_property = gimp_container_box_set_property;
object_class->get_property = gimp_container_box_get_property;
g_object_class_override_property (object_class, PROP_CONTAINER,
"container");
g_object_class_override_property (object_class, PROP_CONTEXT,
"context");
g_object_class_override_property (object_class, PROP_REORDERABLE,
"reorderable");
}
static void
gimp_container_box_init (GimpContainerBox *box)
{
GimpContainerView *view = GIMP_CONTAINER_VIEW (box);
GimpContainerViewPrivate *private;
private = GIMP_CONTAINER_VIEW_GET_PRIVATE (view);
GimpContainerView *view = GIMP_CONTAINER_VIEW (box);
box->scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (box), box->scrolled_win, TRUE, TRUE, 0);
......@@ -114,7 +151,12 @@ gimp_container_box_init (GimpContainerBox *box)
GTK_WIDGET_UNSET_FLAGS (GTK_SCROLLED_WINDOW (box->scrolled_win)->vscrollbar,
GTK_CAN_FOCUS);
private->dnd_widget = box->scrolled_win;
gimp_container_view_set_dnd_widget (view, box->scrolled_win);
}
static void
gimp_container_box_view_iface_init (GimpContainerViewInterface *view_iface)
{
}
static void
......@@ -124,6 +166,56 @@ gimp_container_box_docked_iface_init (GimpDockedInterface *docked_iface)
docked_iface->set_context = gimp_container_box_set_context;
}
static void
gimp_container_box_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpContainerView *view = GIMP_CONTAINER_VIEW (object);
switch (property_id)
{
case PROP_CONTAINER:
gimp_container_view_set_container (view, g_value_get_object (value));
break;
case PROP_CONTEXT:
gimp_container_view_set_context (view, g_value_get_object (value));
break;
case PROP_REORDERABLE:
gimp_container_view_set_reorderable (view, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_container_box_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpContainerView *view = GIMP_CONTAINER_VIEW (object);
switch (property_id)
{
case PROP_CONTAINER:
g_value_set_object (value, gimp_container_view_get_container (view));
break;
case PROP_CONTEXT:
g_value_set_object (value, gimp_container_view_get_context (view));
break;
case PROP_REORDERABLE:
g_value_set_boolean (value, gimp_container_view_get_reorderable (view));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
void
gimp_container_box_set_size_request (GimpContainerBox *box,
gint width,
......
......@@ -23,7 +23,7 @@
#define __GIMP_CONTAINER_BOX_H__
#include "gimpcontainerview.h"
#include "gimpeditor.h"
#define GIMP_TYPE_CONTAINER_BOX (gimp_container_box_get_type ())
......@@ -38,14 +38,14 @@ typedef struct _GimpContainerBoxClass GimpContainerBoxClass;
struct _GimpContainerBox
{
GimpContainerView parent_instance;
GimpEditor parent_instance;
GtkWidget *scrolled_win;
};
struct _GimpContainerBoxClass
{
GimpContainerViewClass parent_class;
GimpEditorClass parent_class;
};
......
......@@ -34,6 +34,7 @@
#include "gimpcontainereditor.h"
#include "gimpcontainergridview.h"
#include "gimpcontainertreeview.h"
#include "gimpcontainerview.h"
#include "gimpdocked.h"
#include "gimpmenufactory.h"
#include "gimppreviewrenderer.h"
......
......@@ -34,6 +34,7 @@
#include "core/gimpviewable.h"
#include "gimpcontainergridview.h"
#include "gimpcontainerview.h"
#include "gimppreview.h"
#include "gimppreviewrenderer.h"
#include "gimpuimanager.h"
......@@ -53,6 +54,8 @@ enum
static void gimp_container_grid_view_class_init (GimpContainerGridViewClass *klass);
static void gimp_container_grid_view_init (GimpContainerGridView *view);
static void gimp_container_grid_view_view_iface_init (GimpContainerViewInterface *view_iface);
static gboolean gimp_container_grid_view_move_cursor (GimpContainerGridView *view,
GtkMovementStep step,
gint count);
......@@ -94,7 +97,8 @@ static void gimp_container_grid_view_viewport_resized (GtkWidget *w
GimpContainerGridView *view);
static GimpContainerBoxClass *parent_class = NULL;
static GimpContainerBoxClass *parent_class = NULL;
static GimpContainerViewInterface *parent_view_iface = NULL;
static guint grid_view_signals[LAST_SIGNAL] = { 0 };
......@@ -122,9 +126,19 @@ gimp_container_grid_view_get_type (void)
(GInstanceInitFunc) gimp_container_grid_view_init,
};
static const GInterfaceInfo view_iface_info =
{
(GInterfaceInitFunc) gimp_container_grid_view_view_iface_init,
NULL, /* iface_finalize */
NULL /* iface_data */
};
view_type = g_type_register_static (GIMP_TYPE_CONTAINER_BOX,
"GimpContainerGridView",
&view_info, 0);
g_type_add_interface_static (view_type, GIMP_TYPE_CONTAINER_VIEW,
&view_iface_info);
}
return view_type;
......@@ -133,28 +147,16 @@ gimp_container_grid_view_get_type (void)
static void
gimp_container_grid_view_class_init (GimpContainerGridViewClass *klass)
{
GimpContainerViewClass *container_view_class;
GtkWidgetClass *widget_class;
GtkBindingSet *binding_set;
container_view_class = GIMP_CONTAINER_VIEW_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkBindingSet *binding_set;
parent_class = g_type_class_peek_parent (klass);
binding_set = gtk_binding_set_by_class (klass);
widget_class->focus = gimp_container_grid_view_focus;
widget_class->popup_menu = gimp_container_grid_view_popup_menu;
widget_class->focus = gimp_container_grid_view_focus;
widget_class->popup_menu = gimp_container_grid_view_popup_menu;
container_view_class->insert_item = gimp_container_grid_view_insert_item;
container_view_class->remove_item = gimp_container_grid_view_remove_item;
container_view_class->reorder_item = gimp_container_grid_view_reorder_item;
container_view_class->rename_item = gimp_container_grid_view_rename_item;
container_view_class->select_item = gimp_container_grid_view_select_item;
container_view_class->clear_items = gimp_container_grid_view_clear_items;
container_view_class->set_preview_size = gimp_container_grid_view_set_preview_size;
klass->move_cursor = gimp_container_grid_view_move_cursor;
klass->move_cursor = gimp_container_grid_view_move_cursor;
grid_view_signals[MOVE_CURSOR] =
g_signal_new ("move_cursor",
......@@ -220,6 +222,21 @@ gimp_container_grid_view_init (GimpContainerGridView *grid_view)
GTK_WIDGET_SET_FLAGS (grid_view, GTK_CAN_FOCUS);
}
static void
gimp_container_grid_view_view_iface_init (GimpContainerViewInterface *view_iface)
{
parent_view_iface = g_type_interface_peek_parent (view_iface);
view_iface->insert_item = gimp_container_grid_view_insert_item;
view_iface->remove_item = gimp_container_grid_view_remove_item;
view_iface->reorder_item = gimp_container_grid_view_reorder_item;
view_iface->rename_item = gimp_container_grid_view_rename_item;
view_iface->select_item = gimp_container_grid_view_select_item;
view_iface->clear_items = gimp_container_grid_view_clear_items;
view_iface->set_preview_size = gimp_container_grid_view_set_preview_size;
}
GtkWidget *
gimp_container_grid_view_new (GimpContainer *container,
GimpContext *context,
......@@ -228,6 +245,7 @@ gimp_container_grid_view_new (GimpContainer *container,
gboolean reorderable)
{
GimpContainerGridView *grid_view;
GimpContainerView *view;
g_return_val_if_fail (container == NULL || GIMP_IS_CONTAINER (container),
NULL);
......@@ -238,12 +256,20 @@ gimp_container_grid_view_new (GimpContainer *container,
preview_border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH,
NULL);
grid_view = g_object_new (GIMP_TYPE_CONTAINER_GRID_VIEW, NULL);
grid_view = g_object_new (GIMP_TYPE_CONTAINER_GRID_VIEW,
"reorderable", reorderable,
NULL);
view = GIMP_CONTAINER_VIEW (grid_view);
gimp_container_view_set_preview_size (view, preview_size,
preview_border_width);
if (container)
gimp_container_view_set_container (view, container);
gimp_container_view_construct (GIMP_CONTAINER_VIEW (grid_view),
container, context,
preview_size, preview_border_width,
reorderable);
if (context)
gimp_container_view_set_context (view, context);
return GTK_WIDGET (grid_view);
}
......@@ -504,7 +530,7 @@ gimp_container_grid_view_clear_items (GimpContainerView *view)
gtk_container_remove (GTK_CONTAINER (grid_view->wrap_box),
GTK_WRAP_BOX (grid_view->wrap_box)->children->widget);
GIMP_CONTAINER_VIEW_CLASS (parent_class)->clear_items (view);
parent_view_iface->clear_items (view);
}
static void
......
......@@ -37,6 +37,7 @@
#include "gimpcontainerpopup.h"
#include "gimpcontainergridview.h"
#include "gimpcontainertreeview.h"
#include "gimpcontainerview.h"
#include "gimpdialogfactory.h"
#include "gimppreviewrenderer.h"
......@@ -531,12 +532,12 @@ static void
gimp_container_popup_smaller_clicked (GtkWidget *button,
GimpContainerPopup *popup)
{
GimpContainerViewPrivate *private;
gint preview_size;
gint preview_size;
private = GIMP_CONTAINER_VIEW_GET_PRIVATE (popup->editor->view);
preview_size = gimp_container_view_get_preview_size (popup->editor->view,
NULL);
preview_size = MAX (GIMP_PREVIEW_SIZE_TINY, private->preview_size * 0.8);
preview_size = MAX (GIMP_PREVIEW_SIZE_TINY, preview_size * 0.8);
if (preview_size != popup->preview_size)
{
......@@ -552,12 +553,12 @@ static void
gimp_container_popup_larger_clicked (GtkWidget *button,
GimpContainerPopup *popup)
{
GimpContainerViewPrivate *private;
gint preview_size;
gint preview_size;
private = GIMP_CONTAINER_VIEW_GET_PRIVATE (popup->editor->view);
preview_size = gimp_container_view_get_preview_size (popup->editor->view,
NULL);
preview_size = MIN (GIMP_PREVIEW_SIZE_HUGE, private->preview_size * 1.2);
preview_size = MAX (GIMP_PREVIEW_SIZE_TINY, preview_size * 1.2);
if (preview_size != popup->preview_size)
{
......
......@@ -30,6 +30,7 @@
#include "gimpcontainertreeview.h"
#include "gimpcontainertreeview-dnd.h"
#include "gimpcontainerview.h"
#include "gimpdnd.h"
#include "gimppreviewrenderer.h"
......@@ -45,14 +46,11 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
GimpViewable **return_dest,
GtkTreeViewDropPosition *return_pos)
{
GimpContainerViewPrivate *private;
GtkWidget *src_widget;
GimpViewable *src_viewable;
GtkTreePath *path;
GtkWidget *src_widget;
GimpViewable *src_viewable;
GtkTreePath *path;
private = GIMP_CONTAINER_VIEW_GET_PRIVATE (tree_view);
if (! private->reorderable)
if (! gimp_container_view_get_reorderable (GIMP_CONTAINER_VIEW (tree_view)))
return FALSE;
src_widget = gtk_drag_get_source_widget (context);
......
......@@ -37,6 +37,7 @@
#include "gimpcellrendererviewable.h"
#include "gimpcontainertreeview.h"
#include "gimpcontainertreeview-dnd.h"
#include "gimpcontainerview.h"
#include "gimpdnd.h"
#include "gimppreviewrenderer.h"
#include "gimpuimanager.h"
......@@ -55,6 +56,8 @@ 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 GObject *gimp_container_tree_view_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
......@@ -96,7 +99,8 @@ static GimpViewable * gimp_container_tree_view_drag_viewable (GtkWidget *w
gpointer data);
static GimpContainerBoxClass *parent_class = NULL;
static GimpContainerBoxClass *parent_class = NULL;
static GimpContainerViewInterface *parent_view_iface = NULL;
GType
......@@ -119,9 +123,19 @@ gimp_container_tree_view_get_type (void)
(GInstanceInitFunc) gimp_container_tree_view_init,
};
static const GInterfaceInfo view_iface_info =
{
(GInterfaceInitFunc) gimp_container_tree_view_view_iface_init,
NULL, /* iface_finalize */
NULL /* iface_data */
};
view_type = g_type_register_static (GIMP_TYPE_CONTAINER_BOX,
"GimpContainerTreeView",
&view_info, 0);
g_type_add_interface_static (view_type, GIMP_TYPE_CONTAINER_VIEW,
&view_iface_info);
}
return view_type;
......@@ -130,31 +144,19 @@ gimp_container_tree_view_get_type (void)
static void
gimp_container_tree_view_class_init (GimpContainerTreeViewClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GimpContainerViewClass *container_view_class = GIMP_CONTAINER_VIEW_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->constructor = gimp_container_tree_view_constructor;
object_class->constructor = gimp_container_tree_view_constructor;
widget_class->unrealize = gimp_container_tree_view_unrealize;
widget_class->unmap = gimp_container_tree_view_unmap;
widget_class->popup_menu = gimp_container_tree_view_popup_menu;
widget_class->unrealize = gimp_container_tree_view_unrealize;
widget_class->unmap = gimp_container_tree_view_unmap;
widget_class->popup_menu = gimp_container_tree_view_popup_menu;
container_view_class->set_container = gimp_container_tree_view_set_container;
container_view_class->insert_item = gimp_container_tree_view_insert_item;
container_view_class->remove_item = gimp_container_tree_view_remove_item;
container_view_class->reorder_item = gimp_container_tree_view_reorder_item;
container_view_class->rename_item = gimp_container_tree_view_rename_item;
container_view_class->select_item = gimp_container_tree_view_select_item;
container_view_class->clear_items = gimp_container_tree_view_clear_items;
container_view_class->set_preview_size = gimp_container_tree_view_set_preview_size;
container_view_class->insert_data_free = (GDestroyNotify) g_free;
klass->drop_possible = gimp_container_tree_view_real_drop_possible;
klass->drop = gimp_container_tree_view_real_drop;
klass->drop_possible = gimp_container_tree_view_real_drop_possible;
klass->drop = gimp_container_tree_view_real_drop;
}
static void
......@@ -178,24 +180,40 @@ gimp_container_tree_view_init (GimpContainerTreeView *tree_view)
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
}
static void
gimp_container_tree_view_view_iface_init (GimpContainerViewInterface *view_iface)
{
parent_view_iface = g_type_interface_peek_parent (view_iface);
view_iface->set_container = gimp_container_tree_view_set_container;
view_iface->insert_item = gimp_container_tree_view_insert_item;
view_iface->remove_item = gimp_container_tree_view_remove_item;
view_iface->reorder_item = gimp_container_tree_view_reorder_item;
view_iface->rename_item = gimp_container_tree_view_rename_item;
view_iface->select_item = gimp_container_tree_view_select_item;
view_iface->clear_items = gimp_container_tree_view_clear_items;
view_iface->set_preview_size = gimp_container_tree_view_set_preview_size;
view_iface->insert_data_free = (GDestroyNotify) g_free;
}
static GObject *
gimp_container_tree_view_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GimpContainerTreeView *tree_view;
GimpContainerView *view;
GimpContainerBox *box;
GimpContainerViewPrivate *private;
GtkListStore *list;
GObject *object;
GimpContainerTreeView *tree_view;
GimpContainerView *view;
GimpContainerBox *box;
GtkListStore *list;
GObject *object;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
tree_view = GIMP_CONTAINER_TREE_VIEW (object);
view = GIMP_CONTAINER_VIEW (object);
box = GIMP_CONTAINER_BOX (object);
private = GIMP_CONTAINER_VIEW_GET_PRIVATE (view);
list = gtk_list_store_newv (tree_view->n_model_columns,
tree_view->model_columns);
......@@ -210,7 +228,7 @@ gimp_container_tree_view_constructor (GType type,
GTK_WIDGET (tree_view->view));
gtk_widget_show (GTK_WIDGET (tree_view->view));
private->dnd_widget = GTK_WIDGET (tree_view->view);
gimp_container_view_set_dnd_widget (view, GTK_WIDGET (tree_view->view));
tree_view->main_column = gtk_tree_view_column_new ();
gtk_tree_view_insert_column (tree_view->view, tree_view->main_column, 0);
......@@ -379,6 +397,7 @@ gimp_container_tree_view_new (GimpContainer *container,
gboolean reorderable)
{
GimpContainerTreeView *tree_view;
GimpContainerView *view;