Add new vfunc GimpContainerView::insert_item_after()

The new function is called after the item is inserted. This is a much
smaller change than turning all vfuncs into signals just to be able
connect_after to one of them.
This commit is contained in:
Michael Natterer 2009-09-16 19:53:13 +02:00
parent 6700caafb2
commit ebe72148dd
2 changed files with 52 additions and 42 deletions

View File

@ -197,21 +197,22 @@ gimp_container_view_iface_base_init (GimpContainerViewInterface *view_iface)
GIMP_TYPE_OBJECT,
G_TYPE_POINTER);
view_iface->select_item = NULL;
view_iface->activate_item = NULL;
view_iface->context_item = NULL;
view_iface->select_item = NULL;
view_iface->activate_item = NULL;
view_iface->context_item = NULL;
view_iface->set_container = gimp_container_view_real_set_container;
view_iface->set_context = gimp_container_view_real_set_context;
view_iface->insert_item = NULL;
view_iface->remove_item = NULL;
view_iface->reorder_item = NULL;
view_iface->rename_item = NULL;
view_iface->clear_items = gimp_container_view_real_clear_items;
view_iface->set_view_size = NULL;
view_iface->set_container = gimp_container_view_real_set_container;
view_iface->set_context = gimp_container_view_real_set_context;
view_iface->insert_item = NULL;
view_iface->insert_item_after = NULL;
view_iface->remove_item = NULL;
view_iface->reorder_item = NULL;
view_iface->rename_item = NULL;
view_iface->clear_items = gimp_container_view_real_clear_items;
view_iface->set_view_size = NULL;
view_iface->insert_data_free = NULL;
view_iface->model_is_tree = FALSE;
view_iface->insert_data_free = NULL;
view_iface->model_is_tree = FALSE;
g_object_interface_install_property (view_iface,
g_param_spec_object ("container",
@ -904,6 +905,9 @@ gimp_container_view_add_foreach (GimpViewable *viewable,
g_hash_table_insert (private->item_hash, viewable, insert_data);
if (view_iface->insert_item_after)
view_iface->insert_item_after (view, viewable, insert_data);
children = gimp_viewable_get_children (viewable);
if (children)
@ -939,6 +943,9 @@ gimp_container_view_add (GimpContainerView *view,
g_hash_table_insert (private->item_hash, viewable, insert_data);
if (view_iface->insert_item_after)
view_iface->insert_item_after (view, viewable, insert_data);
children = gimp_viewable_get_children (viewable);
if (children)

View File

@ -47,37 +47,40 @@ struct _GimpContainerViewInterface
GTypeInterface base_iface;
/* signals */
gboolean (* select_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
void (* activate_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
void (* context_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
gboolean (* select_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
void (* activate_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
void (* context_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
/* virtual functions */
void (* set_container) (GimpContainerView *view,
GimpContainer *container);
void (* set_context) (GimpContainerView *view,
GimpContext *context);
gpointer (* insert_item) (GimpContainerView *view,
GimpViewable *object,
gpointer parent_insert_data,
gint index);
void (* remove_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
void (* reorder_item) (GimpContainerView *view,
GimpViewable *object,
gint new_index,
gpointer insert_data);
void (* rename_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
void (* clear_items) (GimpContainerView *view);
void (* set_view_size) (GimpContainerView *view);
void (* set_container) (GimpContainerView *view,
GimpContainer *container);
void (* set_context) (GimpContainerView *view,
GimpContext *context);
gpointer (* insert_item) (GimpContainerView *view,
GimpViewable *object,
gpointer parent_insert_data,
gint index);
void (* insert_item_after) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
void (* remove_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
void (* reorder_item) (GimpContainerView *view,
GimpViewable *object,
gint new_index,
gpointer insert_data);
void (* rename_item) (GimpContainerView *view,
GimpViewable *object,
gpointer insert_data);
void (* clear_items) (GimpContainerView *view);
void (* set_view_size) (GimpContainerView *view);
/* the destroy notifier for private->hash_table's values */
GDestroyNotify insert_data_free;