2001-05-03 20:26:05 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2003-03-16 19:14:29 +08:00
|
|
|
* gimpchanneltreeview.c
|
2004-05-13 02:36:33 +08:00
|
|
|
* Copyright (C) 2001-2004 Michael Natterer <mitch@gimp.org>
|
2001-05-03 20:26:05 +08:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2005-01-16 03:17:11 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2004-10-16 23:48:23 +08:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2001-05-03 20:26:05 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-05-08 11:48:54 +08:00
|
|
|
#include "widgets-types.h"
|
|
|
|
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpchannel.h"
|
|
|
|
#include "core/gimpcontainer.h"
|
|
|
|
#include "core/gimpimage.h"
|
2004-10-16 23:48:23 +08:00
|
|
|
#include "core/gimpimage-undo.h"
|
2005-01-16 05:15:43 +08:00
|
|
|
#include "core/gimplayer.h"
|
|
|
|
#include "core/gimplayermask.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2003-03-16 19:14:29 +08:00
|
|
|
#include "gimpchanneltreeview.h"
|
2003-03-13 01:12:01 +08:00
|
|
|
#include "gimpcomponenteditor.h"
|
2004-05-11 07:22:39 +08:00
|
|
|
#include "gimpcontainerview.h"
|
2001-05-08 11:48:54 +08:00
|
|
|
#include "gimpdnd.h"
|
2004-11-17 02:36:48 +08:00
|
|
|
#include "gimpdocked.h"
|
2003-08-24 21:52:51 +08:00
|
|
|
#include "gimphelp-ids.h"
|
2002-12-20 00:33:29 +08:00
|
|
|
#include "gimpwidgets-utils.h"
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2001-05-03 20:26:05 +08:00
|
|
|
|
|
|
|
|
2005-12-20 06:37:49 +08:00
|
|
|
static void gimp_channel_tree_view_view_iface_init (GimpContainerViewInterface *iface);
|
|
|
|
static void gimp_channel_tree_view_docked_iface_init (GimpDockedInterface *iface);
|
2004-05-11 07:22:39 +08:00
|
|
|
|
2004-05-13 02:36:33 +08:00
|
|
|
static GObject * gimp_channel_tree_view_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params);
|
2005-01-16 05:15:43 +08:00
|
|
|
static void gimp_channel_tree_view_drop_viewable (GimpContainerTreeView *view,
|
|
|
|
GimpViewable *src_viewable,
|
|
|
|
GimpViewable *dest_viewable,
|
|
|
|
GtkTreeViewDropPosition drop_pos);
|
2005-01-16 03:17:11 +08:00
|
|
|
static void gimp_channel_tree_view_drop_component (GimpContainerTreeView *tree_view,
|
|
|
|
GimpImage *gimage,
|
|
|
|
GimpChannelType component,
|
|
|
|
GimpViewable *dest_viewable,
|
|
|
|
GtkTreeViewDropPosition drop_pos);
|
2004-05-13 02:36:33 +08:00
|
|
|
static void gimp_channel_tree_view_set_image (GimpItemTreeView *item_view,
|
|
|
|
GimpImage *gimage);
|
2004-10-16 23:48:23 +08:00
|
|
|
static GimpItem * gimp_channel_tree_view_item_new (GimpImage *image);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2003-03-16 19:14:29 +08:00
|
|
|
static void gimp_channel_tree_view_set_preview_size (GimpContainerView *view);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2004-11-17 02:36:48 +08:00
|
|
|
static void gimp_channel_tree_view_set_context (GimpDocked *docked,
|
|
|
|
GimpContext *context);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2004-11-17 02:36:48 +08:00
|
|
|
|
2005-12-20 06:37:49 +08:00
|
|
|
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));
|
|
|
|
|
|
|
|
#define parent_class gimp_channel_tree_view_parent_class
|
|
|
|
|
2004-11-17 02:36:48 +08:00
|
|
|
static GimpContainerViewInterface *parent_view_iface = NULL;
|
|
|
|
static GimpDockedInterface *parent_docked_iface = NULL;
|
2001-05-03 20:26:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
2003-03-16 19:14:29 +08:00
|
|
|
gimp_channel_tree_view_class_init (GimpChannelTreeViewClass *klass)
|
2001-05-03 20:26:05 +08:00
|
|
|
{
|
2005-12-20 06:37:49 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GimpContainerTreeViewClass *view_class = GIMP_CONTAINER_TREE_VIEW_CLASS (klass);
|
|
|
|
GimpItemTreeViewClass *iv_class = GIMP_ITEM_TREE_VIEW_CLASS (klass);
|
|
|
|
|
|
|
|
object_class->constructor = gimp_channel_tree_view_constructor;
|
|
|
|
|
|
|
|
view_class->drop_viewable = gimp_channel_tree_view_drop_viewable;
|
|
|
|
view_class->drop_component = gimp_channel_tree_view_drop_component;
|
|
|
|
|
|
|
|
iv_class->set_image = gimp_channel_tree_view_set_image;
|
|
|
|
|
|
|
|
iv_class->item_type = GIMP_TYPE_CHANNEL;
|
|
|
|
iv_class->signal_name = "active-channel-changed";
|
|
|
|
|
|
|
|
iv_class->get_container = gimp_image_get_channels;
|
|
|
|
iv_class->get_active_item = (GimpGetItemFunc) gimp_image_get_active_channel;
|
|
|
|
iv_class->set_active_item = (GimpSetItemFunc) gimp_image_set_active_channel;
|
|
|
|
iv_class->reorder_item = (GimpReorderItemFunc) gimp_image_position_channel;
|
|
|
|
iv_class->add_item = (GimpAddItemFunc) gimp_image_add_channel;
|
|
|
|
iv_class->remove_item = (GimpRemoveItemFunc) gimp_image_remove_channel;
|
|
|
|
iv_class->new_item = gimp_channel_tree_view_item_new;
|
|
|
|
|
|
|
|
iv_class->action_group = "channels";
|
|
|
|
iv_class->activate_action = "channels-edit-attributes";
|
|
|
|
iv_class->edit_action = "channels-edit-attributes";
|
|
|
|
iv_class->new_action = "channels-new";
|
|
|
|
iv_class->new_default_action = "channels-new-last-values";
|
|
|
|
iv_class->raise_action = "channels-raise";
|
|
|
|
iv_class->raise_top_action = "channels-raise-to-top";
|
|
|
|
iv_class->lower_action = "channels-lower";
|
|
|
|
iv_class->lower_bottom_action = "channels-lower-to-bottom";
|
|
|
|
iv_class->duplicate_action = "channels-duplicate";
|
|
|
|
iv_class->delete_action = "channels-delete";
|
|
|
|
iv_class->reorder_desc = _("Reorder Channel");
|
2001-05-03 20:26:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-03-16 19:14:29 +08:00
|
|
|
gimp_channel_tree_view_init (GimpChannelTreeView *view)
|
2001-05-03 20:26:05 +08:00
|
|
|
{
|
2004-05-13 02:36:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_channel_tree_view_view_iface_init (GimpContainerViewInterface *view_iface)
|
|
|
|
{
|
|
|
|
parent_view_iface = g_type_interface_peek_parent (view_iface);
|
|
|
|
|
|
|
|
view_iface->set_preview_size = gimp_channel_tree_view_set_preview_size;
|
|
|
|
}
|
|
|
|
|
2004-11-17 02:36:48 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2004-05-13 02:36:33 +08:00
|
|
|
static GObject *
|
|
|
|
gimp_channel_tree_view_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params)
|
|
|
|
{
|
2005-01-16 03:17:11 +08:00
|
|
|
GObject *object;
|
|
|
|
GimpEditor *editor;
|
|
|
|
GimpChannelTreeView *view;
|
|
|
|
GimpContainerTreeView *tree_view;
|
2004-05-13 02:36:33 +08:00
|
|
|
|
|
|
|
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
|
|
|
|
|
2005-01-16 03:17:11 +08:00
|
|
|
editor = GIMP_EDITOR (object);
|
|
|
|
view = GIMP_CHANNEL_TREE_VIEW (object);
|
|
|
|
tree_view = GIMP_CONTAINER_TREE_VIEW (object);
|
|
|
|
|
2005-01-16 05:15:43 +08:00
|
|
|
gimp_dnd_viewable_dest_add (GTK_WIDGET (tree_view->view), GIMP_TYPE_LAYER,
|
|
|
|
NULL, tree_view);
|
|
|
|
gimp_dnd_viewable_dest_add (GTK_WIDGET (tree_view->view), GIMP_TYPE_LAYER_MASK,
|
|
|
|
NULL, tree_view);
|
2005-01-16 03:17:11 +08:00
|
|
|
gimp_dnd_component_dest_add (GTK_WIDGET (tree_view->view),
|
|
|
|
NULL, tree_view);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2001-08-05 04:38:54 +08:00
|
|
|
view->toselection_button =
|
2004-05-13 02:36:33 +08:00
|
|
|
gimp_editor_add_action_button (GIMP_EDITOR (view), "channels",
|
|
|
|
"channels-selection-replace",
|
|
|
|
"channels-selection-add",
|
|
|
|
GDK_SHIFT_MASK,
|
2004-10-17 01:10:04 +08:00
|
|
|
"channels-selection-subtract",
|
|
|
|
GDK_CONTROL_MASK,
|
|
|
|
"channels-selection-intersect",
|
|
|
|
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
2004-05-13 02:36:33 +08:00
|
|
|
NULL);
|
2003-03-13 01:12:01 +08:00
|
|
|
gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (view),
|
2001-08-05 04:38:54 +08:00
|
|
|
GTK_BUTTON (view->toselection_button),
|
|
|
|
GIMP_TYPE_CHANNEL);
|
2004-10-17 01:10:04 +08:00
|
|
|
gtk_box_reorder_child (GTK_BOX (GIMP_EDITOR (view)->button_box),
|
|
|
|
view->toselection_button, 5);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2004-05-13 02:36:33 +08:00
|
|
|
return object;
|
2004-05-11 07:22:39 +08:00
|
|
|
}
|
|
|
|
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2005-01-16 03:17:11 +08:00
|
|
|
/* GimpContainerTreeView methods */
|
|
|
|
|
2005-01-16 05:15:43 +08:00
|
|
|
static void
|
|
|
|
gimp_channel_tree_view_drop_viewable (GimpContainerTreeView *tree_view,
|
|
|
|
GimpViewable *src_viewable,
|
|
|
|
GimpViewable *dest_viewable,
|
|
|
|
GtkTreeViewDropPosition drop_pos)
|
|
|
|
{
|
2005-01-17 23:28:08 +08:00
|
|
|
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (tree_view);
|
2005-01-16 05:15:43 +08:00
|
|
|
GimpItemTreeViewClass *item_view_class;
|
|
|
|
|
|
|
|
item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (item_view);
|
|
|
|
|
2005-01-17 23:28:08 +08:00
|
|
|
if (GIMP_IS_DRAWABLE (src_viewable) &&
|
|
|
|
(item_view->gimage != gimp_item_get_image (GIMP_ITEM (src_viewable)) ||
|
|
|
|
G_TYPE_FROM_INSTANCE (src_viewable) != item_view_class->item_type))
|
2005-01-16 05:15:43 +08:00
|
|
|
{
|
|
|
|
GimpItem *new_item;
|
2005-01-17 23:28:08 +08:00
|
|
|
gint index = -1;
|
2005-01-16 05:15:43 +08:00
|
|
|
|
2005-01-17 23:28:08 +08:00
|
|
|
if (dest_viewable)
|
|
|
|
{
|
|
|
|
index = gimp_image_get_channel_index (item_view->gimage,
|
|
|
|
GIMP_CHANNEL (dest_viewable));
|
2005-01-16 05:15:43 +08:00
|
|
|
|
2005-01-17 23:28:08 +08:00
|
|
|
if (drop_pos == GTK_TREE_VIEW_DROP_AFTER)
|
|
|
|
index++;
|
|
|
|
}
|
2005-01-16 05:15:43 +08:00
|
|
|
|
|
|
|
new_item = gimp_item_convert (GIMP_ITEM (src_viewable),
|
|
|
|
item_view->gimage,
|
|
|
|
item_view_class->item_type, FALSE);
|
|
|
|
|
2005-01-17 23:28:08 +08:00
|
|
|
item_view_class->add_item (item_view->gimage, new_item, index);
|
2005-01-16 05:15:43 +08:00
|
|
|
gimp_image_flush (item_view->gimage);
|
2005-01-17 23:28:08 +08:00
|
|
|
return;
|
2005-01-16 05:15:43 +08:00
|
|
|
}
|
2005-01-17 23:28:08 +08:00
|
|
|
|
|
|
|
GIMP_CONTAINER_TREE_VIEW_CLASS (parent_class)->drop_viewable (tree_view,
|
|
|
|
src_viewable,
|
|
|
|
dest_viewable,
|
|
|
|
drop_pos);
|
2005-01-16 05:15:43 +08:00
|
|
|
}
|
|
|
|
|
2005-01-16 03:17:11 +08:00
|
|
|
static void
|
|
|
|
gimp_channel_tree_view_drop_component (GimpContainerTreeView *tree_view,
|
|
|
|
GimpImage *src_image,
|
|
|
|
GimpChannelType component,
|
|
|
|
GimpViewable *dest_viewable,
|
|
|
|
GtkTreeViewDropPosition drop_pos)
|
|
|
|
{
|
2005-01-17 23:28:08 +08:00
|
|
|
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (tree_view);
|
|
|
|
GimpItem *new_item;
|
|
|
|
gint index = -1;
|
2005-01-16 03:17:11 +08:00
|
|
|
const gchar *desc;
|
|
|
|
gchar *name;
|
|
|
|
|
2005-01-17 23:28:08 +08:00
|
|
|
if (dest_viewable)
|
|
|
|
{
|
|
|
|
index = gimp_image_get_channel_index (item_view->gimage,
|
|
|
|
GIMP_CHANNEL (dest_viewable));
|
2005-01-16 03:17:11 +08:00
|
|
|
|
2005-01-17 23:28:08 +08:00
|
|
|
if (drop_pos == GTK_TREE_VIEW_DROP_AFTER)
|
|
|
|
index++;
|
|
|
|
}
|
2005-01-16 03:17:11 +08:00
|
|
|
|
|
|
|
gimp_enum_get_value (GIMP_TYPE_CHANNEL_TYPE, component,
|
|
|
|
NULL, NULL, &desc, NULL);
|
|
|
|
name = g_strdup_printf (_("%s Channel Copy"), desc);
|
|
|
|
|
2005-01-17 23:28:08 +08:00
|
|
|
new_item = GIMP_ITEM (gimp_channel_new_from_component (src_image, component,
|
|
|
|
name, NULL));
|
2005-01-16 03:17:11 +08:00
|
|
|
|
|
|
|
/* copied components are invisible by default so subsequent copies
|
|
|
|
* of components don't affect each other
|
|
|
|
*/
|
2005-01-17 23:28:08 +08:00
|
|
|
gimp_item_set_visible (new_item, FALSE, FALSE);
|
2005-01-16 03:17:11 +08:00
|
|
|
|
|
|
|
g_free (name);
|
|
|
|
|
2005-01-17 23:28:08 +08:00
|
|
|
if (src_image != item_view->gimage)
|
|
|
|
GIMP_ITEM_GET_CLASS (new_item)->convert (new_item, item_view->gimage);
|
2005-01-16 03:17:11 +08:00
|
|
|
|
2005-01-17 23:28:08 +08:00
|
|
|
gimp_image_add_channel (item_view->gimage, GIMP_CHANNEL (new_item), index);
|
|
|
|
gimp_image_flush (item_view->gimage);
|
2005-01-16 03:17:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-16 19:14:29 +08:00
|
|
|
/* GimpItemTreeView methods */
|
2001-05-03 20:26:05 +08:00
|
|
|
|
|
|
|
static void
|
2003-03-16 19:14:29 +08:00
|
|
|
gimp_channel_tree_view_set_image (GimpItemTreeView *item_view,
|
2002-02-26 01:58:50 +08:00
|
|
|
GimpImage *gimage)
|
2001-05-03 20:26:05 +08:00
|
|
|
{
|
2004-05-11 01:16:50 +08:00
|
|
|
GimpChannelTreeView *channel_view = GIMP_CHANNEL_TREE_VIEW (item_view);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2003-03-13 01:12:01 +08:00
|
|
|
if (! channel_view->component_editor)
|
2001-05-03 20:26:05 +08:00
|
|
|
{
|
2004-05-11 01:16:50 +08:00
|
|
|
GimpContainerView *view = GIMP_CONTAINER_VIEW (item_view);
|
|
|
|
gint preview_size;
|
|
|
|
|
|
|
|
preview_size = gimp_container_view_get_preview_size (view, NULL);
|
|
|
|
|
2003-03-13 01:12:01 +08:00
|
|
|
channel_view->component_editor =
|
2004-05-11 01:16:50 +08:00
|
|
|
gimp_component_editor_new (preview_size,
|
2003-03-21 19:47:37 +08:00
|
|
|
GIMP_EDITOR (item_view)->menu_factory);
|
2004-11-17 02:36:48 +08:00
|
|
|
gimp_docked_set_context (GIMP_DOCKED (channel_view->component_editor),
|
|
|
|
item_view->context);
|
2003-03-13 01:12:01 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (item_view), channel_view->component_editor,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_box_reorder_child (GTK_BOX (item_view),
|
|
|
|
channel_view->component_editor, 0);
|
|
|
|
}
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2003-03-13 01:12:01 +08:00
|
|
|
if (! gimage)
|
|
|
|
gtk_widget_hide (channel_view->component_editor);
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2003-03-13 01:12:01 +08:00
|
|
|
gimp_image_editor_set_image (GIMP_IMAGE_EDITOR (channel_view->component_editor),
|
|
|
|
gimage);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2003-03-16 19:14:29 +08:00
|
|
|
GIMP_ITEM_TREE_VIEW_CLASS (parent_class)->set_image (item_view, gimage);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2002-02-26 01:58:50 +08:00
|
|
|
if (item_view->gimage)
|
2003-03-13 01:12:01 +08:00
|
|
|
gtk_widget_show (channel_view->component_editor);
|
2001-05-03 20:26:05 +08:00
|
|
|
}
|
|
|
|
|
2004-10-16 23:48:23 +08:00
|
|
|
static GimpItem *
|
|
|
|
gimp_channel_tree_view_item_new (GimpImage *image)
|
|
|
|
{
|
|
|
|
GimpChannel *new_channel;
|
|
|
|
GimpRGB color;
|
|
|
|
|
|
|
|
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 0.5);
|
|
|
|
|
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
|
|
|
|
_("New Channel"));
|
|
|
|
|
|
|
|
new_channel = gimp_channel_new (image,
|
|
|
|
gimp_image_get_width (image),
|
|
|
|
gimp_image_get_height (image),
|
|
|
|
_("Empty Channel"), &color);
|
|
|
|
|
|
|
|
gimp_image_add_channel (image, new_channel, -1);
|
|
|
|
|
|
|
|
gimp_image_undo_group_end (image);
|
|
|
|
|
|
|
|
return GIMP_ITEM (new_channel);
|
|
|
|
}
|
|
|
|
|
2001-05-03 20:26:05 +08:00
|
|
|
|
|
|
|
/* GimpContainerView methods */
|
|
|
|
|
2001-05-07 01:56:10 +08:00
|
|
|
static void
|
2003-03-16 19:14:29 +08:00
|
|
|
gimp_channel_tree_view_set_preview_size (GimpContainerView *view)
|
2001-05-07 01:56:10 +08:00
|
|
|
{
|
2004-05-11 01:16:50 +08:00
|
|
|
GimpChannelTreeView *channel_view = GIMP_CHANNEL_TREE_VIEW (view);
|
|
|
|
gint preview_size;
|
2001-05-07 01:56:10 +08:00
|
|
|
|
2004-05-11 07:22:39 +08:00
|
|
|
parent_view_iface->set_preview_size (view);
|
2001-05-07 01:56:10 +08:00
|
|
|
|
2004-05-11 07:22:39 +08:00
|
|
|
preview_size = gimp_container_view_get_preview_size (view, NULL);
|
2001-05-07 01:56:10 +08:00
|
|
|
|
2003-03-27 01:49:42 +08:00
|
|
|
if (channel_view->component_editor)
|
|
|
|
gimp_component_editor_set_preview_size (GIMP_COMPONENT_EDITOR (channel_view->component_editor),
|
2004-05-11 01:16:50 +08:00
|
|
|
preview_size);
|
2001-05-07 01:56:10 +08:00
|
|
|
}
|
2004-11-17 02:36:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* 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);
|
|
|
|
}
|