support setting a context even if the viewed container's children_type is
2006-08-31 Michael Natterer <mitch@gimp.org> * app/widgets/gimpcontainerview.c (gimp_container_view_real_set_container) (gimp_container_view_real_set_context) (gimp_container_view_item_selected) (gimp_container_view_thaw): support setting a context even if the viewed container's children_type is *not* a property of GimpContext. This removes a major restriction of container views and allows to get rid of some hacks: * app/widgets/gimpitemtreeview.[ch]: removed GimpContext member and implement GimpContainerView::set_context() instead of GimpDocked::set_context(). * app/widgets/gimpchanneltreeview.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimplayertreeview.c: use GimpContainerView's context instead of GimpItemTreeView's and implement GimpContainerView's set_context() instead of GimpDocked's. * app/actions/actions.c (action_data_get_gimp) (action_data_get_context): don't special-case GimpItemTreeView any more, it's just like a normal GimpContainerView now. * app/widgets/gimpcontrollerlist.c (gimp_controller_list_constructor): set a context on the GimpContainerView so its renderers have a context to use.
This commit is contained in:
parent
c1456a3371
commit
875342af5d
11 changed files with 295 additions and 321 deletions
31
ChangeLog
31
ChangeLog
|
|
@ -1,3 +1,34 @@
|
|||
2006-08-31 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpcontainerview.c
|
||||
(gimp_container_view_real_set_container)
|
||||
(gimp_container_view_real_set_context)
|
||||
(gimp_container_view_item_selected)
|
||||
(gimp_container_view_thaw): support setting a context even if
|
||||
the viewed container's children_type is *not* a property of
|
||||
GimpContext. This removes a major restriction of container
|
||||
views and allows to get rid of some hacks:
|
||||
|
||||
* app/widgets/gimpitemtreeview.[ch]: removed GimpContext member
|
||||
and implement GimpContainerView::set_context() instead of
|
||||
GimpDocked::set_context().
|
||||
|
||||
* app/widgets/gimpchanneltreeview.c
|
||||
* app/widgets/gimpcontainergridview.c
|
||||
* app/widgets/gimpcontainertreeview.c
|
||||
* app/widgets/gimpdrawabletreeview.c
|
||||
* app/widgets/gimplayertreeview.c: use GimpContainerView's context
|
||||
instead of GimpItemTreeView's and implement GimpContainerView's
|
||||
set_context() instead of GimpDocked's.
|
||||
|
||||
* app/actions/actions.c (action_data_get_gimp)
|
||||
(action_data_get_context): don't special-case GimpItemTreeView any
|
||||
more, it's just like a normal GimpContainerView now.
|
||||
|
||||
* app/widgets/gimpcontrollerlist.c
|
||||
(gimp_controller_list_constructor): set a context on the
|
||||
GimpContainerView so its renderers have a context to use.
|
||||
|
||||
2006-08-31 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpthumbbox.[ch]: remember the context passed to
|
||||
|
|
|
|||
|
|
@ -256,8 +256,6 @@ action_data_get_gimp (gpointer data)
|
|||
return data;
|
||||
else if (GIMP_IS_DOCK (data))
|
||||
context = ((GimpDock *) data)->context;
|
||||
else if (GIMP_IS_ITEM_TREE_VIEW (data))
|
||||
context = ((GimpItemTreeView *) data)->context;
|
||||
else if (GIMP_IS_CONTAINER_VIEW (data))
|
||||
context = gimp_container_view_get_context ((GimpContainerView *) data);
|
||||
else if (GIMP_IS_CONTAINER_EDITOR (data))
|
||||
|
|
@ -285,8 +283,6 @@ action_data_get_context (gpointer data)
|
|||
return gimp_get_user_context (data);
|
||||
else if (GIMP_IS_DOCK (data))
|
||||
return ((GimpDock *) data)->context;
|
||||
else if (GIMP_IS_ITEM_TREE_VIEW (data))
|
||||
return ((GimpItemTreeView *) data)->context;
|
||||
else if (GIMP_IS_CONTAINER_VIEW (data))
|
||||
return gimp_container_view_get_context ((GimpContainerView *) data);
|
||||
else if (GIMP_IS_CONTAINER_EDITOR (data))
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@
|
|||
|
||||
|
||||
static void gimp_channel_tree_view_view_iface_init (GimpContainerViewInterface *iface);
|
||||
static void gimp_channel_tree_view_docked_iface_init (GimpDockedInterface *iface);
|
||||
|
||||
static GObject * gimp_channel_tree_view_constructor (GType type,
|
||||
guint n_params,
|
||||
|
|
@ -66,23 +65,19 @@ static void gimp_channel_tree_view_set_image (GimpItemTreeView *item_v
|
|||
GimpImage *image);
|
||||
static GimpItem * gimp_channel_tree_view_item_new (GimpImage *image);
|
||||
|
||||
static void gimp_channel_tree_view_set_view_size (GimpContainerView *view);
|
||||
|
||||
static void gimp_channel_tree_view_set_context (GimpDocked *docked,
|
||||
static void gimp_channel_tree_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context);
|
||||
static void gimp_channel_tree_view_set_view_size (GimpContainerView *view);
|
||||
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GimpChannelTreeView, gimp_channel_tree_view,
|
||||
GIMP_TYPE_DRAWABLE_TREE_VIEW,
|
||||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
|
||||
gimp_channel_tree_view_view_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
|
||||
gimp_channel_tree_view_docked_iface_init))
|
||||
gimp_channel_tree_view_view_iface_init))
|
||||
|
||||
#define parent_class gimp_channel_tree_view_parent_class
|
||||
|
||||
static GimpContainerViewInterface *parent_view_iface = NULL;
|
||||
static GimpDockedInterface *parent_docked_iface = NULL;
|
||||
static GimpContainerViewInterface *parent_view_iface = NULL;
|
||||
|
||||
|
||||
static void
|
||||
|
|
@ -129,17 +124,10 @@ gimp_channel_tree_view_view_iface_init (GimpContainerViewInterface *view_iface)
|
|||
{
|
||||
parent_view_iface = g_type_interface_peek_parent (view_iface);
|
||||
|
||||
view_iface->set_context = gimp_channel_tree_view_set_context;
|
||||
view_iface->set_view_size = gimp_channel_tree_view_set_view_size;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_channel_tree_view_docked_iface_init (GimpDockedInterface *docked_iface)
|
||||
{
|
||||
parent_docked_iface = g_type_interface_peek_parent (docked_iface);
|
||||
|
||||
docked_iface->set_context = gimp_channel_tree_view_set_context;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_channel_tree_view_init (GimpChannelTreeView *view)
|
||||
{
|
||||
|
|
@ -295,7 +283,7 @@ gimp_channel_tree_view_set_image (GimpItemTreeView *item_view,
|
|||
gimp_component_editor_new (view_size,
|
||||
GIMP_EDITOR (item_view)->menu_factory);
|
||||
gimp_docked_set_context (GIMP_DOCKED (channel_view->component_editor),
|
||||
item_view->context);
|
||||
gimp_container_view_get_context (view));
|
||||
gtk_box_pack_start (GTK_BOX (item_view), channel_view->component_editor,
|
||||
FALSE, FALSE, 0);
|
||||
gtk_box_reorder_child (GTK_BOX (item_view),
|
||||
|
|
@ -340,6 +328,19 @@ gimp_channel_tree_view_item_new (GimpImage *image)
|
|||
|
||||
/* GimpContainerView methods */
|
||||
|
||||
static void
|
||||
gimp_channel_tree_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpChannelTreeView *channel_view = GIMP_CHANNEL_TREE_VIEW (view);
|
||||
|
||||
parent_view_iface->set_context (view, context);
|
||||
|
||||
if (channel_view->component_editor)
|
||||
gimp_docked_set_context (GIMP_DOCKED (channel_view->component_editor),
|
||||
context);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_channel_tree_view_set_view_size (GimpContainerView *view)
|
||||
{
|
||||
|
|
@ -354,19 +355,3 @@ gimp_channel_tree_view_set_view_size (GimpContainerView *view)
|
|||
gimp_component_editor_set_view_size (GIMP_COMPONENT_EDITOR (channel_view->component_editor),
|
||||
view_size);
|
||||
}
|
||||
|
||||
|
||||
/* GimpDocked methods */
|
||||
|
||||
static void
|
||||
gimp_channel_tree_view_set_context (GimpDocked *docked,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpChannelTreeView *channel_view = GIMP_CHANNEL_TREE_VIEW (docked);
|
||||
|
||||
parent_docked_iface->set_context (docked, context);
|
||||
|
||||
if (channel_view->component_editor)
|
||||
gimp_docked_set_context (GIMP_DOCKED (channel_view->component_editor),
|
||||
context);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
#include "gimpcontainergridview.h"
|
||||
#include "gimpcontainerview.h"
|
||||
#include "gimpdocked.h"
|
||||
#include "gimpview.h"
|
||||
#include "gimpviewrenderer.h"
|
||||
#include "gimpwidgets-utils.h"
|
||||
|
|
@ -52,8 +51,7 @@ enum
|
|||
};
|
||||
|
||||
|
||||
static void gimp_container_grid_view_view_iface_init (GimpContainerViewInterface *iface);
|
||||
static void gimp_container_grid_view_docked_iface_init (GimpDockedInterface *iface);
|
||||
static void gimp_container_grid_view_view_iface_init (GimpContainerViewInterface *iface);
|
||||
|
||||
static gboolean gimp_container_grid_view_move_cursor (GimpContainerGridView *view,
|
||||
GtkMovementStep step,
|
||||
|
|
@ -62,6 +60,8 @@ static gboolean gimp_container_grid_view_focus (GtkWidget *w
|
|||
GtkDirectionType direction);
|
||||
static gboolean gimp_container_grid_view_popup_menu (GtkWidget *widget);
|
||||
|
||||
static void gimp_container_grid_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context);
|
||||
static gpointer gimp_container_grid_view_insert_item (GimpContainerView *view,
|
||||
GimpViewable *viewable,
|
||||
gint index);
|
||||
|
|
@ -80,8 +80,6 @@ static gboolean gimp_container_grid_view_select_item (GimpContainerView *v
|
|||
gpointer insert_data);
|
||||
static void gimp_container_grid_view_clear_items (GimpContainerView *view);
|
||||
static void gimp_container_grid_view_set_view_size (GimpContainerView *view);
|
||||
static void gimp_container_grid_view_set_context (GimpDocked *docked,
|
||||
GimpContext *context);
|
||||
|
||||
static gboolean gimp_container_grid_view_item_selected(GtkWidget *widget,
|
||||
GdkEventButton *bevent,
|
||||
|
|
@ -105,14 +103,11 @@ static gboolean gimp_container_grid_view_button_press (GtkWidget *w
|
|||
G_DEFINE_TYPE_WITH_CODE (GimpContainerGridView, gimp_container_grid_view,
|
||||
GIMP_TYPE_CONTAINER_BOX,
|
||||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
|
||||
gimp_container_grid_view_view_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
|
||||
gimp_container_grid_view_docked_iface_init))
|
||||
gimp_container_grid_view_view_iface_init))
|
||||
|
||||
#define parent_class gimp_container_grid_view_parent_class
|
||||
|
||||
static GimpContainerViewInterface *parent_view_iface = NULL;
|
||||
static GimpDockedInterface *parent_docked_iface = NULL;
|
||||
static GimpContainerViewInterface *parent_view_iface = NULL;
|
||||
|
||||
static guint grid_view_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
|
|
@ -170,6 +165,7 @@ gimp_container_grid_view_view_iface_init (GimpContainerViewInterface *iface)
|
|||
{
|
||||
parent_view_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
iface->set_context = gimp_container_grid_view_set_context;
|
||||
iface->insert_item = gimp_container_grid_view_insert_item;
|
||||
iface->remove_item = gimp_container_grid_view_remove_item;
|
||||
iface->reorder_item = gimp_container_grid_view_reorder_item;
|
||||
|
|
@ -179,17 +175,6 @@ gimp_container_grid_view_view_iface_init (GimpContainerViewInterface *iface)
|
|||
iface->set_view_size = gimp_container_grid_view_set_view_size;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_grid_view_docked_iface_init (GimpDockedInterface *iface)
|
||||
{
|
||||
parent_docked_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
if (! parent_docked_iface)
|
||||
parent_docked_iface = g_type_default_interface_peek (GIMP_TYPE_DOCKED);
|
||||
|
||||
iface->set_context = gimp_container_grid_view_set_context;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_grid_view_init (GimpContainerGridView *grid_view)
|
||||
{
|
||||
|
|
@ -406,6 +391,25 @@ gimp_container_grid_view_popup_menu (GtkWidget *widget)
|
|||
grid_view);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_grid_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpContainerGridView *grid_view = GIMP_CONTAINER_GRID_VIEW (view);
|
||||
GtkWrapBoxChild *child;
|
||||
|
||||
parent_view_iface->set_context (view, context);
|
||||
|
||||
for (child = GTK_WRAP_BOX (grid_view->wrap_box)->children;
|
||||
child;
|
||||
child = child->next)
|
||||
{
|
||||
GimpView *view = GIMP_VIEW (child->widget);
|
||||
|
||||
gimp_view_renderer_set_context (view->renderer, context);
|
||||
}
|
||||
}
|
||||
|
||||
static gpointer
|
||||
gimp_container_grid_view_insert_item (GimpContainerView *container_view,
|
||||
GimpViewable *viewable,
|
||||
|
|
@ -538,25 +542,6 @@ gimp_container_grid_view_set_view_size (GimpContainerView *view)
|
|||
gtk_widget_queue_resize (grid_view->wrap_box);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_grid_view_set_context (GimpDocked *docked,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpContainerGridView *grid_view = GIMP_CONTAINER_GRID_VIEW (docked);
|
||||
GtkWrapBoxChild *child;
|
||||
|
||||
parent_docked_iface->set_context (docked, context);
|
||||
|
||||
for (child = GTK_WRAP_BOX (grid_view->wrap_box)->children;
|
||||
child;
|
||||
child = child->next)
|
||||
{
|
||||
GimpView *view = GIMP_VIEW (child->widget);
|
||||
|
||||
gimp_view_renderer_set_context (view->renderer, context);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_container_grid_view_item_selected (GtkWidget *widget,
|
||||
GdkEventButton *bevent,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
#include "gimpcontainertreeview-dnd.h"
|
||||
#include "gimpcontainerview.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpdocked.h"
|
||||
#include "gimpviewrenderer.h"
|
||||
#include "gimpwidgets-utils.h"
|
||||
|
||||
|
|
@ -52,8 +51,7 @@ enum
|
|||
};
|
||||
|
||||
|
||||
static void gimp_container_tree_view_view_iface_init (GimpContainerViewInterface *iface);
|
||||
static void gimp_container_tree_view_docked_iface_init (GimpDockedInterface *iface);
|
||||
static void gimp_container_tree_view_view_iface_init (GimpContainerViewInterface *iface);
|
||||
|
||||
static GObject *gimp_container_tree_view_constructor (GType type,
|
||||
guint n_params,
|
||||
|
|
@ -65,6 +63,8 @@ static gboolean gimp_container_tree_view_popup_menu (GtkWidget *w
|
|||
|
||||
static void gimp_container_tree_view_set_container (GimpContainerView *view,
|
||||
GimpContainer *container);
|
||||
static void gimp_container_tree_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context);
|
||||
static gpointer gimp_container_tree_view_insert_item (GimpContainerView *view,
|
||||
GimpViewable *viewable,
|
||||
gint index);
|
||||
|
|
@ -87,9 +87,6 @@ static void gimp_container_tree_view_set_view_size (GimpContainerView *v
|
|||
static void gimp_container_tree_view_name_canceled (GtkCellRendererText *cell,
|
||||
GimpContainerTreeView *tree_view);
|
||||
|
||||
static void gimp_container_tree_view_set_context (GimpDocked *view,
|
||||
GimpContext *context);
|
||||
|
||||
static void gimp_container_tree_view_selection_changed (GtkTreeSelection *sel,
|
||||
GimpContainerTreeView *tree_view);
|
||||
static gboolean gimp_container_tree_view_button_press (GtkWidget *widget,
|
||||
|
|
@ -108,14 +105,11 @@ static GdkPixbuf * gimp_container_tree_view_drag_pixbuf (GtkWidget *w
|
|||
G_DEFINE_TYPE_WITH_CODE (GimpContainerTreeView, gimp_container_tree_view,
|
||||
GIMP_TYPE_CONTAINER_BOX,
|
||||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
|
||||
gimp_container_tree_view_view_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
|
||||
gimp_container_tree_view_docked_iface_init))
|
||||
gimp_container_tree_view_view_iface_init))
|
||||
|
||||
#define parent_class gimp_container_tree_view_parent_class
|
||||
|
||||
static GimpContainerViewInterface *parent_view_iface = NULL;
|
||||
static GimpDockedInterface *parent_docked_iface = NULL;
|
||||
static GimpContainerViewInterface *parent_view_iface = NULL;
|
||||
|
||||
|
||||
static void
|
||||
|
|
@ -145,6 +139,7 @@ gimp_container_tree_view_view_iface_init (GimpContainerViewInterface *iface)
|
|||
parent_view_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
iface->set_container = gimp_container_tree_view_set_container;
|
||||
iface->set_context = gimp_container_tree_view_set_context;
|
||||
iface->insert_item = gimp_container_tree_view_insert_item;
|
||||
iface->remove_item = gimp_container_tree_view_remove_item;
|
||||
iface->reorder_item = gimp_container_tree_view_reorder_item;
|
||||
|
|
@ -156,17 +151,6 @@ gimp_container_tree_view_view_iface_init (GimpContainerViewInterface *iface)
|
|||
iface->insert_data_free = (GDestroyNotify) g_free;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_tree_view_docked_iface_init (GimpDockedInterface *iface)
|
||||
{
|
||||
parent_docked_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
if (! parent_docked_iface)
|
||||
parent_docked_iface = g_type_default_interface_peek (GIMP_TYPE_DOCKED);
|
||||
|
||||
iface->set_context = gimp_container_tree_view_set_context;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_tree_view_init (GimpContainerTreeView *tree_view)
|
||||
{
|
||||
|
|
@ -494,6 +478,35 @@ gimp_container_tree_view_set_container (GimpContainerView *view,
|
|||
parent_view_iface->set_container (view, container);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_tree_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
|
||||
|
||||
parent_view_iface->set_context (view, context);
|
||||
|
||||
if (tree_view->model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean iter_valid;
|
||||
|
||||
for (iter_valid = gtk_tree_model_get_iter_first (tree_view->model, &iter);
|
||||
iter_valid;
|
||||
iter_valid = gtk_tree_model_iter_next (tree_view->model, &iter))
|
||||
{
|
||||
GimpViewRenderer *renderer;
|
||||
|
||||
gtk_tree_model_get (tree_view->model, &iter,
|
||||
COLUMN_RENDERER, &renderer,
|
||||
-1);
|
||||
|
||||
gimp_view_renderer_set_context (renderer, context);
|
||||
g_object_unref (renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gpointer
|
||||
gimp_container_tree_view_insert_item (GimpContainerView *view,
|
||||
GimpViewable *viewable,
|
||||
|
|
@ -760,38 +773,6 @@ gimp_container_tree_view_set_view_size (GimpContainerView *view)
|
|||
}
|
||||
|
||||
|
||||
/* GimpDocked methods */
|
||||
|
||||
static void
|
||||
gimp_container_tree_view_set_context (GimpDocked *docked,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (docked);
|
||||
|
||||
parent_docked_iface->set_context (docked, context);
|
||||
|
||||
if (tree_view->model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean iter_valid;
|
||||
|
||||
for (iter_valid = gtk_tree_model_get_iter_first (tree_view->model, &iter);
|
||||
iter_valid;
|
||||
iter_valid = gtk_tree_model_iter_next (tree_view->model, &iter))
|
||||
{
|
||||
GimpViewRenderer *renderer;
|
||||
|
||||
gtk_tree_model_get (tree_view->model, &iter,
|
||||
COLUMN_RENDERER, &renderer,
|
||||
-1);
|
||||
|
||||
gimp_view_renderer_set_context (renderer, context);
|
||||
g_object_unref (renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* callbacks */
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -389,15 +389,23 @@ gimp_container_view_real_set_container (GimpContainerView *view,
|
|||
|
||||
if (private->context)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (private->context,
|
||||
gimp_container_view_context_changed,
|
||||
view);
|
||||
GType children_type = private->container->children_type;
|
||||
const gchar *signal_name;
|
||||
|
||||
if (private->dnd_widget)
|
||||
signal_name = gimp_context_type_to_signal_name (children_type);
|
||||
|
||||
if (signal_name)
|
||||
{
|
||||
gtk_drag_dest_unset (private->dnd_widget);
|
||||
gimp_dnd_viewable_dest_remove (private->dnd_widget,
|
||||
private->container->children_type);
|
||||
g_signal_handlers_disconnect_by_func (private->context,
|
||||
gimp_container_view_context_changed,
|
||||
view);
|
||||
|
||||
if (private->dnd_widget)
|
||||
{
|
||||
gtk_drag_dest_unset (private->dnd_widget);
|
||||
gimp_dnd_viewable_dest_remove (private->dnd_widget,
|
||||
children_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -406,9 +414,10 @@ gimp_container_view_real_set_container (GimpContainerView *view,
|
|||
|
||||
if (private->container)
|
||||
{
|
||||
GType children_type = private->container->children_type;
|
||||
GimpViewableClass *viewable_class;
|
||||
|
||||
viewable_class = g_type_class_ref (container->children_type);
|
||||
viewable_class = g_type_class_ref (children_type);
|
||||
|
||||
gimp_container_foreach (private->container,
|
||||
(GFunc) gimp_container_view_add_foreach,
|
||||
|
|
@ -445,27 +454,30 @@ gimp_container_view_real_set_container (GimpContainerView *view,
|
|||
|
||||
if (private->context)
|
||||
{
|
||||
GimpObject *object;
|
||||
const gchar *signal_name;
|
||||
|
||||
signal_name =
|
||||
gimp_context_type_to_signal_name (private->container->children_type);
|
||||
signal_name = gimp_context_type_to_signal_name (children_type);
|
||||
|
||||
g_signal_connect_object (private->context, signal_name,
|
||||
G_CALLBACK (gimp_container_view_context_changed),
|
||||
view,
|
||||
0);
|
||||
if (signal_name)
|
||||
{
|
||||
GimpObject *object;
|
||||
|
||||
object = gimp_context_get_by_type (private->context,
|
||||
private->container->children_type);
|
||||
g_signal_connect_object (private->context, signal_name,
|
||||
G_CALLBACK (gimp_container_view_context_changed),
|
||||
view,
|
||||
0);
|
||||
|
||||
gimp_container_view_select_item (view, GIMP_VIEWABLE (object));
|
||||
object = gimp_context_get_by_type (private->context,
|
||||
children_type);
|
||||
|
||||
if (private->dnd_widget)
|
||||
gimp_dnd_viewable_dest_add (private->dnd_widget,
|
||||
private->container->children_type,
|
||||
gimp_container_view_viewable_dropped,
|
||||
view);
|
||||
gimp_container_view_select_item (view, GIMP_VIEWABLE (object));
|
||||
|
||||
if (private->dnd_widget)
|
||||
gimp_dnd_viewable_dest_add (private->dnd_widget,
|
||||
children_type,
|
||||
gimp_container_view_viewable_dropped,
|
||||
view);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -511,15 +523,23 @@ gimp_container_view_real_set_context (GimpContainerView *view,
|
|||
{
|
||||
if (private->container)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (private->context,
|
||||
gimp_container_view_context_changed,
|
||||
view);
|
||||
GType children_type = private->container->children_type;
|
||||
const gchar *signal_name;
|
||||
|
||||
if (private->dnd_widget)
|
||||
signal_name = gimp_context_type_to_signal_name (children_type);
|
||||
|
||||
if (signal_name)
|
||||
{
|
||||
gtk_drag_dest_unset (private->dnd_widget);
|
||||
gimp_dnd_viewable_dest_remove (private->dnd_widget,
|
||||
private->container->children_type);
|
||||
g_signal_handlers_disconnect_by_func (private->context,
|
||||
gimp_container_view_context_changed,
|
||||
view);
|
||||
|
||||
if (private->dnd_widget)
|
||||
{
|
||||
gtk_drag_dest_unset (private->dnd_widget);
|
||||
gimp_dnd_viewable_dest_remove (private->dnd_widget,
|
||||
children_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -534,27 +554,31 @@ gimp_container_view_real_set_context (GimpContainerView *view,
|
|||
|
||||
if (private->container)
|
||||
{
|
||||
GimpObject *object;
|
||||
GType children_type = private->container->children_type;
|
||||
const gchar *signal_name;
|
||||
|
||||
signal_name =
|
||||
gimp_context_type_to_signal_name (private->container->children_type);
|
||||
signal_name = gimp_context_type_to_signal_name (children_type);
|
||||
|
||||
g_signal_connect_object (private->context, signal_name,
|
||||
G_CALLBACK (gimp_container_view_context_changed),
|
||||
view,
|
||||
0);
|
||||
if (signal_name)
|
||||
{
|
||||
GimpObject *object;
|
||||
|
||||
object = gimp_context_get_by_type (private->context,
|
||||
private->container->children_type);
|
||||
g_signal_connect_object (private->context, signal_name,
|
||||
G_CALLBACK (gimp_container_view_context_changed),
|
||||
view,
|
||||
0);
|
||||
|
||||
gimp_container_view_select_item (view, GIMP_VIEWABLE (object));
|
||||
object = gimp_context_get_by_type (private->context,
|
||||
children_type);
|
||||
|
||||
if (private->dnd_widget)
|
||||
gimp_dnd_viewable_dest_add (private->dnd_widget,
|
||||
private->container->children_type,
|
||||
gimp_container_view_viewable_dropped,
|
||||
view);
|
||||
gimp_container_view_select_item (view, GIMP_VIEWABLE (object));
|
||||
|
||||
if (private->dnd_widget)
|
||||
gimp_dnd_viewable_dest_add (private->dnd_widget,
|
||||
children_type,
|
||||
gimp_container_view_viewable_dropped,
|
||||
view);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -773,11 +797,17 @@ gimp_container_view_item_selected (GimpContainerView *view,
|
|||
/* HACK */
|
||||
if (private->container && private->context)
|
||||
{
|
||||
gimp_context_set_by_type (private->context,
|
||||
private->container->children_type,
|
||||
GIMP_OBJECT (viewable));
|
||||
GType children_type = private->container->children_type;
|
||||
const gchar *signal_name;
|
||||
|
||||
return TRUE;
|
||||
signal_name = gimp_context_type_to_signal_name (children_type);
|
||||
|
||||
if (signal_name)
|
||||
{
|
||||
gimp_context_set_by_type (private->context, children_type,
|
||||
GIMP_OBJECT (viewable));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
success = gimp_container_view_select_item (view, viewable);
|
||||
|
|
@ -1048,12 +1078,19 @@ gimp_container_view_thaw (GimpContainerView *view,
|
|||
|
||||
if (private->context)
|
||||
{
|
||||
GimpObject *object;
|
||||
GType children_type = private->container->children_type;
|
||||
const gchar *signal_name;
|
||||
|
||||
object = gimp_context_get_by_type (private->context,
|
||||
private->container->children_type);
|
||||
signal_name = gimp_context_type_to_signal_name (children_type);
|
||||
|
||||
gimp_container_view_select_item (view, GIMP_VIEWABLE (object));
|
||||
if (signal_name)
|
||||
{
|
||||
GimpObject *object;
|
||||
|
||||
object = gimp_context_get_by_type (private->context, children_type);
|
||||
|
||||
gimp_container_view_select_item (view, GIMP_VIEWABLE (object));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -332,6 +332,9 @@ gimp_controller_list_constructor (GType type,
|
|||
gimp_container_view_set_container (GIMP_CONTAINER_VIEW (list->dest),
|
||||
gimp_controllers_get_list (list->gimp));
|
||||
|
||||
gimp_container_view_set_context (GIMP_CONTAINER_VIEW (list->dest),
|
||||
gimp_get_user_context (list->gimp));
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ gimp_drawable_tree_view_new_dropped (GimpItemTreeView *view,
|
|||
if (tool_info && tool_info->tool_options)
|
||||
context = GIMP_CONTEXT (tool_info->tool_options);
|
||||
else
|
||||
context = view->context;
|
||||
context = gimp_container_view_get_context (GIMP_CONTAINER_VIEW (view));
|
||||
|
||||
gimp_drawable_bucket_fill_full (drawable,
|
||||
fill_mode,
|
||||
|
|
|
|||
|
|
@ -65,9 +65,6 @@ enum
|
|||
static void gimp_item_tree_view_view_iface_init (GimpContainerViewInterface *view_iface);
|
||||
static void gimp_item_tree_view_docked_iface_init (GimpDockedInterface *docked_iface);
|
||||
|
||||
static void gimp_item_tree_view_set_context (GimpDocked *docked,
|
||||
GimpContext *context);
|
||||
|
||||
static GObject * gimp_item_tree_view_constructor (GType type,
|
||||
guint n_params,
|
||||
GObjectConstructParam *params);
|
||||
|
|
@ -82,6 +79,9 @@ static void gimp_item_tree_view_image_flush (GimpImage *image,
|
|||
|
||||
static void gimp_item_tree_view_set_container (GimpContainerView *view,
|
||||
GimpContainer *container);
|
||||
static void gimp_item_tree_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context);
|
||||
|
||||
static gpointer gimp_item_tree_view_insert_item (GimpContainerView *view,
|
||||
GimpViewable *viewable,
|
||||
gint index);
|
||||
|
|
@ -219,6 +219,7 @@ gimp_item_tree_view_view_iface_init (GimpContainerViewInterface *iface)
|
|||
parent_view_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
iface->set_container = gimp_item_tree_view_set_container;
|
||||
iface->set_context = gimp_item_tree_view_set_context;
|
||||
iface->insert_item = gimp_item_tree_view_insert_item;
|
||||
iface->select_item = gimp_item_tree_view_select_item;
|
||||
iface->activate_item = gimp_item_tree_view_activate_item;
|
||||
|
|
@ -229,7 +230,6 @@ static void
|
|||
gimp_item_tree_view_docked_iface_init (GimpDockedInterface *iface)
|
||||
{
|
||||
iface->get_preview = NULL;
|
||||
iface->set_context = gimp_item_tree_view_set_context;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -256,66 +256,12 @@ gimp_item_tree_view_init (GimpItemTreeView *view)
|
|||
|
||||
tree_view->dnd_drop_to_empty = TRUE;
|
||||
|
||||
view->context = NULL;
|
||||
view->image = NULL;
|
||||
|
||||
view->visible_changed_handler_id = 0;
|
||||
view->linked_changed_handler_id = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_item_tree_view_set_context (GimpDocked *docked,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (docked);
|
||||
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (docked);
|
||||
GimpImage *image = NULL;
|
||||
|
||||
if (item_view->context)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (item_view->context,
|
||||
gimp_item_tree_view_set_image,
|
||||
item_view);
|
||||
}
|
||||
|
||||
item_view->context = context;
|
||||
|
||||
if (context)
|
||||
{
|
||||
if (! tree_view->dnd_gimp)
|
||||
tree_view->dnd_gimp = context->gimp;
|
||||
|
||||
g_signal_connect_swapped (context, "image-changed",
|
||||
G_CALLBACK (gimp_item_tree_view_set_image),
|
||||
item_view);
|
||||
|
||||
image = gimp_context_get_image (context);
|
||||
}
|
||||
|
||||
gimp_item_tree_view_set_image (item_view, image);
|
||||
|
||||
/* ugly: don't upchain but reimplement what our parent class does */
|
||||
if (tree_view->model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean iter_valid;
|
||||
|
||||
for (iter_valid = gtk_tree_model_get_iter_first (tree_view->model, &iter);
|
||||
iter_valid;
|
||||
iter_valid = gtk_tree_model_iter_next (tree_view->model, &iter))
|
||||
{
|
||||
GimpViewRenderer *renderer;
|
||||
|
||||
gtk_tree_model_get (tree_view->model, &iter,
|
||||
tree_view->model_column_renderer, &renderer,
|
||||
-1);
|
||||
|
||||
gimp_view_renderer_set_context (renderer, context);
|
||||
g_object_unref (renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GObject *
|
||||
gimp_item_tree_view_constructor (GType type,
|
||||
guint n_params,
|
||||
|
|
@ -602,6 +548,41 @@ gimp_item_tree_view_set_container (GimpContainerView *view,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_item_tree_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
|
||||
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (view);
|
||||
GimpImage *image = NULL;
|
||||
GimpContext *old_context;
|
||||
|
||||
old_context = gimp_container_view_get_context (view);
|
||||
|
||||
if (old_context)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (old_context,
|
||||
gimp_item_tree_view_set_image,
|
||||
item_view);
|
||||
}
|
||||
|
||||
parent_view_iface->set_context (view, context);
|
||||
|
||||
if (context)
|
||||
{
|
||||
if (! tree_view->dnd_gimp)
|
||||
tree_view->dnd_gimp = context->gimp;
|
||||
|
||||
g_signal_connect_swapped (context, "image-changed",
|
||||
G_CALLBACK (gimp_item_tree_view_set_image),
|
||||
item_view);
|
||||
|
||||
image = gimp_context_get_image (context);
|
||||
}
|
||||
|
||||
gimp_item_tree_view_set_image (item_view, image);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
gimp_item_tree_view_insert_item (GimpContainerView *view,
|
||||
GimpViewable *viewable,
|
||||
|
|
@ -611,7 +592,6 @@ gimp_item_tree_view_insert_item (GimpContainerView *view,
|
|||
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (view);
|
||||
GimpItem *item = GIMP_ITEM (viewable);
|
||||
GtkTreeIter *iter;
|
||||
GimpViewRenderer *renderer;
|
||||
|
||||
iter = parent_view_iface->insert_item (view, viewable, index);
|
||||
|
||||
|
|
@ -622,13 +602,6 @@ gimp_item_tree_view_insert_item (GimpContainerView *view,
|
|||
gimp_item_get_linked (item),
|
||||
-1);
|
||||
|
||||
gtk_tree_model_get (tree_view->model, iter,
|
||||
tree_view->model_column_renderer, &renderer,
|
||||
-1);
|
||||
|
||||
gimp_view_renderer_set_context (renderer, item_view->context);
|
||||
g_object_unref (renderer);
|
||||
|
||||
return iter;
|
||||
}
|
||||
|
||||
|
|
@ -1020,11 +993,14 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle,
|
|||
|
||||
if (gtk_tree_model_get_iter (tree_view->model, &iter, path))
|
||||
{
|
||||
GimpContext *context;
|
||||
GimpViewRenderer *renderer;
|
||||
GimpItem *item;
|
||||
GimpImage *image;
|
||||
gboolean active;
|
||||
|
||||
context = gimp_container_view_get_context (GIMP_CONTAINER_VIEW (view));
|
||||
|
||||
gtk_tree_model_get (tree_view->model, &iter,
|
||||
tree_view->model_column_renderer, &renderer,
|
||||
-1);
|
||||
|
|
@ -1106,7 +1082,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle,
|
|||
}
|
||||
else
|
||||
{
|
||||
gimp_undo_refresh_preview (undo, view->context);
|
||||
gimp_undo_refresh_preview (undo, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1140,7 +1116,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle,
|
|||
setter (item, ! active, push_undo);
|
||||
|
||||
if (!push_undo)
|
||||
gimp_undo_refresh_preview (undo, view->context);
|
||||
gimp_undo_refresh_preview (undo, context);
|
||||
}
|
||||
|
||||
gimp_image_flush (image);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ struct _GimpItemTreeView
|
|||
{
|
||||
GimpContainerTreeView parent_instance;
|
||||
|
||||
GimpContext *context;
|
||||
GimpImage *image;
|
||||
|
||||
GtkWidget *edit_button;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@
|
|||
#include "gimpcellrendererviewable.h"
|
||||
#include "gimpcontainerview.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpdocked.h"
|
||||
#include "gimphelp-ids.h"
|
||||
#include "gimplayertreeview.h"
|
||||
#include "gimpviewrenderer.h"
|
||||
|
|
@ -59,8 +58,7 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static void gimp_layer_tree_view_view_iface_init (GimpContainerViewInterface *iface);
|
||||
static void gimp_layer_tree_view_docked_iface_init (GimpDockedInterface *docked_iface);
|
||||
static void gimp_layer_tree_view_view_iface_init (GimpContainerViewInterface *iface);
|
||||
|
||||
static GObject * gimp_layer_tree_view_constructor (GType type,
|
||||
guint n_params,
|
||||
|
|
@ -73,6 +71,8 @@ static void gimp_layer_tree_view_style_set (GtkWidget *widget,
|
|||
|
||||
static void gimp_layer_tree_view_set_container (GimpContainerView *view,
|
||||
GimpContainer *container);
|
||||
static void gimp_layer_tree_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context);
|
||||
static gpointer gimp_layer_tree_view_insert_item (GimpContainerView *view,
|
||||
GimpViewable *viewable,
|
||||
gint index);
|
||||
|
|
@ -81,9 +81,6 @@ static gboolean gimp_layer_tree_view_select_item (GimpContainerView *view,
|
|||
gpointer insert_data);
|
||||
static void gimp_layer_tree_view_set_view_size (GimpContainerView *view);
|
||||
|
||||
static void gimp_layer_tree_view_set_context (GimpDocked *docked,
|
||||
GimpContext *context);
|
||||
|
||||
static gboolean gimp_layer_tree_view_drop_possible(GimpContainerTreeView *view,
|
||||
GimpDndType src_type,
|
||||
GimpViewable *src_viewable,
|
||||
|
|
@ -166,14 +163,11 @@ static void gimp_layer_tree_view_alpha_changed (GimpLayer *layer,
|
|||
G_DEFINE_TYPE_WITH_CODE (GimpLayerTreeView, gimp_layer_tree_view,
|
||||
GIMP_TYPE_DRAWABLE_TREE_VIEW,
|
||||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
|
||||
gimp_layer_tree_view_view_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
|
||||
gimp_layer_tree_view_docked_iface_init))
|
||||
gimp_layer_tree_view_view_iface_init))
|
||||
|
||||
#define parent_class gimp_layer_tree_view_parent_class
|
||||
|
||||
static GimpContainerViewInterface *parent_view_iface = NULL;
|
||||
static GimpDockedInterface *parent_docked_iface = NULL;
|
||||
static GimpContainerViewInterface *parent_view_iface = NULL;
|
||||
|
||||
|
||||
static void
|
||||
|
|
@ -233,22 +227,12 @@ gimp_layer_tree_view_view_iface_init (GimpContainerViewInterface *iface)
|
|||
parent_view_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
iface->set_container = gimp_layer_tree_view_set_container;
|
||||
iface->set_context = gimp_layer_tree_view_set_context;
|
||||
iface->insert_item = gimp_layer_tree_view_insert_item;
|
||||
iface->select_item = gimp_layer_tree_view_select_item;
|
||||
iface->set_view_size = gimp_layer_tree_view_set_view_size;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_layer_tree_view_docked_iface_init (GimpDockedInterface *iface)
|
||||
{
|
||||
parent_docked_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
if (! parent_docked_iface)
|
||||
parent_docked_iface = g_type_default_interface_peek (GIMP_TYPE_DOCKED);
|
||||
|
||||
iface->set_context = gimp_layer_tree_view_set_context;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_layer_tree_view_init (GimpLayerTreeView *view)
|
||||
{
|
||||
|
|
@ -542,6 +526,36 @@ gimp_layer_tree_view_set_container (GimpContainerView *view,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_layer_tree_view_set_context (GimpContainerView *view,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
|
||||
GimpLayerTreeView *layer_view = GIMP_LAYER_TREE_VIEW (view);
|
||||
|
||||
parent_view_iface->set_context (view, context);
|
||||
|
||||
if (tree_view->model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean iter_valid;
|
||||
|
||||
for (iter_valid = gtk_tree_model_get_iter_first (tree_view->model, &iter);
|
||||
iter_valid;
|
||||
iter_valid = gtk_tree_model_iter_next (tree_view->model, &iter))
|
||||
{
|
||||
GimpViewRenderer *renderer;
|
||||
|
||||
gtk_tree_model_get (tree_view->model, &iter,
|
||||
layer_view->model_column_mask, &renderer,
|
||||
-1);
|
||||
|
||||
gimp_view_renderer_set_context (renderer, context);
|
||||
g_object_unref (renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gpointer
|
||||
gimp_layer_tree_view_insert_item (GimpContainerView *view,
|
||||
GimpViewable *viewable,
|
||||
|
|
@ -635,39 +649,6 @@ gimp_layer_tree_view_set_view_size (GimpContainerView *view)
|
|||
}
|
||||
|
||||
|
||||
/* GimpDocked methods */
|
||||
|
||||
static void
|
||||
gimp_layer_tree_view_set_context (GimpDocked *docked,
|
||||
GimpContext *context)
|
||||
{
|
||||
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (docked);
|
||||
GimpLayerTreeView *layer_view = GIMP_LAYER_TREE_VIEW (docked);
|
||||
|
||||
parent_docked_iface->set_context (docked, context);
|
||||
|
||||
if (tree_view->model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean iter_valid;
|
||||
|
||||
for (iter_valid = gtk_tree_model_get_iter_first (tree_view->model, &iter);
|
||||
iter_valid;
|
||||
iter_valid = gtk_tree_model_iter_next (tree_view->model, &iter))
|
||||
{
|
||||
GimpViewRenderer *renderer;
|
||||
|
||||
gtk_tree_model_get (tree_view->model, &iter,
|
||||
layer_view->model_column_mask, &renderer,
|
||||
-1);
|
||||
|
||||
gimp_view_renderer_set_context (renderer, context);
|
||||
g_object_unref (renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* GimpContainerTreeView methods */
|
||||
|
||||
static gboolean
|
||||
|
|
@ -730,10 +711,11 @@ gimp_layer_tree_view_drop_uri_list (GimpContainerTreeView *view,
|
|||
GimpViewable *dest_viewable,
|
||||
GtkTreeViewDropPosition drop_pos)
|
||||
{
|
||||
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (view);
|
||||
GimpImage *image = item_view->image;
|
||||
gint index = -1;
|
||||
GList *list;
|
||||
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (view);
|
||||
GimpContainerView *cont_view = GIMP_CONTAINER_VIEW (view);
|
||||
GimpImage *image = item_view->image;
|
||||
gint index = -1;
|
||||
GList *list;
|
||||
|
||||
if (dest_viewable)
|
||||
{
|
||||
|
|
@ -750,7 +732,9 @@ gimp_layer_tree_view_drop_uri_list (GimpContainerTreeView *view,
|
|||
GimpPDBStatusType status;
|
||||
GError *error = NULL;
|
||||
|
||||
new_layer = file_open_layer (image->gimp, item_view->context, NULL,
|
||||
new_layer = file_open_layer (image->gimp,
|
||||
gimp_container_view_get_context (cont_view),
|
||||
NULL,
|
||||
image, uri, GIMP_RUN_INTERACTIVE, NULL,
|
||||
&status, &error);
|
||||
|
||||
|
|
@ -991,8 +975,7 @@ gimp_layer_tree_view_paint_mode_menu_callback (GtkWidget *widget,
|
|||
gimp_image_flush (image);
|
||||
|
||||
if (! push_undo)
|
||||
gimp_undo_refresh_preview (undo,
|
||||
GIMP_ITEM_TREE_VIEW (view)->context);
|
||||
gimp_undo_refresh_preview (undo, gimp_container_view_get_context (GIMP_CONTAINER_VIEW (view)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1071,8 +1054,7 @@ gimp_layer_tree_view_opacity_scale_changed (GtkAdjustment *adjustment,
|
|||
gimp_image_flush (image);
|
||||
|
||||
if (! push_undo)
|
||||
gimp_undo_refresh_preview (undo,
|
||||
GIMP_ITEM_TREE_VIEW (view)->context);
|
||||
gimp_undo_refresh_preview (undo, gimp_container_view_get_context (GIMP_CONTAINER_VIEW (view)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1178,7 +1160,6 @@ gimp_layer_tree_view_mask_update (GimpLayerTreeView *layer_view,
|
|||
{
|
||||
GimpContainerView *view = GIMP_CONTAINER_VIEW (layer_view);
|
||||
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (layer_view);
|
||||
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (layer_view);
|
||||
GimpLayerMask *mask;
|
||||
GimpViewRenderer *renderer = NULL;
|
||||
gboolean mask_visible = FALSE;
|
||||
|
|
@ -1195,7 +1176,7 @@ gimp_layer_tree_view_mask_update (GimpLayerTreeView *layer_view,
|
|||
|
||||
mask_visible = TRUE;
|
||||
|
||||
renderer = gimp_view_renderer_new (item_view->context,
|
||||
renderer = gimp_view_renderer_new (gimp_container_view_get_context (view),
|
||||
G_TYPE_FROM_INSTANCE (mask),
|
||||
view_size, border_width,
|
||||
FALSE);
|
||||
|
|
|
|||
Loading…
Reference in a new issue