Commit 205cdf13 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Added GtkTreeView versions of layers/channels/vectors:

2003-03-16  Michael Natterer  <mitch@gimp.org>

	Added GtkTreeView versions of layers/channels/vectors:

	* app/core/core-enums.[ch]: renamed GIMP_UNDO_GROUP_LAYER_PROPERTIES
	to GIMP_UNDO_GROUP_ITEM_PROPERTIES.

	* app/core/gimpcontainer.c (gimp_container_reorder): don't try
	to reorder containers with num_children == 1.

	* app/core/gimpmarshal.list: added VOID: STRING, UINT marshaller.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpchanneltreeview.[ch]
	* app/widgets/gimpdrawabletreeview.[ch]
	* app/widgets/gimpitemtreeview.[ch]
	* app/widgets/gimplayertreeview.[ch]
	* app/widgets/gimpvectorstreeview.[ch]: new widgets.

	* app/widgets/gimpcellrenderertoggle.c: draw the frame only if the
	cell is prelit.

	* app/widgets/gimpcellrendererviewable.[ch]: added "clicked"
	signal, unref the renderer in finalize(). Set the renderer's
	border color to black if the cell is not selected (a hack that
	saves tons of code in GimpLayerTreeView).

	* app/widgets/gimpcomponenteditor.c: no need to gtk_list_store_set()
	stuff we just got from the store.

	* app/widgets/gimpcontainertreeview.[ch]: added lots of state used
	by the new subclasses to the GimpContainerTreeView struct.  Create
	the GtkListStore/GtkTreeView in GObject::constructor() and only
	collect parameters in init() so subclasses can modify store/view
	creation. Do most of the button_press_event stuff manually and
	return TRUE from the handler.

	* app/widgets/gimpcontainerview.c: cleanup.

	* app/widgets/gimpitemlistview.h
	* app/widgets/gimpvectorslistview.h: temp hacks before they die.

	* app/widgets/gimppreviewrenderer.[ch]: added
	gimp_preview_renderer_update_idle() which idle-emits "update"
	without invalidating.

	* app/gui/dialogs-constructors.[ch]
	* app/gui/dialogs.c: added constructors for the new dialogs.

	* app/gui/channels-commands.c
	* app/gui/channels-menu.c
	* app/gui/layers-commands.c
	* app/gui/layers-menu.c
	* app/gui/vectors-commands.c
	* app/gui/vectors-menu.c: accept tree views as callback data.
parent db2f3e05
2003-03-16 Michael Natterer <mitch@gimp.org>
Added GtkTreeView versions of layers/channels/vectors:
* app/core/core-enums.[ch]: renamed GIMP_UNDO_GROUP_LAYER_PROPERTIES
to GIMP_UNDO_GROUP_ITEM_PROPERTIES.
* app/core/gimpcontainer.c (gimp_container_reorder): don't try
to reorder containers with num_children == 1.
* app/core/gimpmarshal.list: added VOID: STRING, UINT marshaller.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpchanneltreeview.[ch]
* app/widgets/gimpdrawabletreeview.[ch]
* app/widgets/gimpitemtreeview.[ch]
* app/widgets/gimplayertreeview.[ch]
* app/widgets/gimpvectorstreeview.[ch]: new widgets.
* app/widgets/gimpcellrenderertoggle.c: draw the frame only if the
cell is prelit.
* app/widgets/gimpcellrendererviewable.[ch]: added "clicked"
signal, unref the renderer in finalize(). Set the renderer's
border color to black if the cell is not selected (a hack that
saves tons of code in GimpLayerTreeView).
* app/widgets/gimpcomponenteditor.c: no need to gtk_list_store_set()
stuff we just got from the store.
* app/widgets/gimpcontainertreeview.[ch]: added lots of state used
by the new subclasses to the GimpContainerTreeView struct. Create
the GtkListStore/GtkTreeView in GObject::constructor() and only
collect parameters in init() so subclasses can modify store/view
creation. Do most of the button_press_event stuff manually and
return TRUE from the handler.
* app/widgets/gimpcontainerview.c: cleanup.
* app/widgets/gimpitemlistview.h
* app/widgets/gimpvectorslistview.h: temp hacks before they die.
* app/widgets/gimppreviewrenderer.[ch]: added
gimp_preview_renderer_update_idle() which idle-emits "update"
without invalidating.
* app/gui/dialogs-constructors.[ch]
* app/gui/dialogs.c: added constructors for the new dialogs.
* app/gui/channels-commands.c
* app/gui/channels-menu.c
* app/gui/layers-commands.c
* app/gui/layers-menu.c
* app/gui/vectors-commands.c
* app/gui/vectors-menu.c: accept tree views as callback data.
2003-03-15 Sven Neumann <sven@gimp.org>
* app/base/levels.c (levels_adjust_by_colors): implemented this
......@@ -39,6 +39,7 @@
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpcomponenteditor.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
......@@ -65,6 +66,8 @@ static void channels_color_changed (GimpColorButton *button,
gimage = ((GimpImageEditor *) data)->gimage; \
else if (GIMP_IS_ITEM_LIST_VIEW (data)) \
gimage = ((GimpItemListView *) data)->gimage; \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
......
......@@ -44,6 +44,7 @@
#include "widgets/gimpenummenu.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
......@@ -70,6 +71,8 @@ static void layers_resize_layer_query (GimpImage *gimage,
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_ITEM_LIST_VIEW (data)) \
gimage = ((GimpItemListView *) data)->gimage; \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
......@@ -737,7 +740,7 @@ edit_layer_query_ok_callback (GtkWidget *widget,
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (layer))))
{
gimp_image_undo_group_start (options->gimage,
GIMP_UNDO_GROUP_LAYER_PROPERTIES,
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
_("Rename Layer"));
if (gimp_layer_is_floating_sel (layer))
......
......@@ -44,6 +44,7 @@
#include "vectors/gimpvectors.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
......@@ -64,6 +65,8 @@
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_ITEM_LIST_VIEW (data)) \
gimage = ((GimpItemListView *) data)->gimage; \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
......
......@@ -435,7 +435,7 @@ static const GEnumValue gimp_undo_type_enum_values[] =
{ GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, N_("Merge Layers"), "group-image-layers-merge" },
{ GIMP_UNDO_GROUP_IMAGE_QMASK, N_("QuickMask"), "group-image-qmask" },
{ GIMP_UNDO_GROUP_IMAGE_GUIDE, N_("Guide"), "group-image-guide" },
{ GIMP_UNDO_GROUP_LAYER_PROPERTIES, N_("Layer Properties"), "group-layer-properties" },
{ GIMP_UNDO_GROUP_ITEM_PROPERTIES, N_("Item Properties"), "group-item-properties" },
{ GIMP_UNDO_GROUP_LAYER_SCALE, N_("Scale Layer"), "group-layer-scale" },
{ GIMP_UNDO_GROUP_LAYER_RESIZE, N_("Resize Layer"), "group-layer-resize" },
{ GIMP_UNDO_GROUP_LAYER_DISPLACE, N_("Move Layer"), "group-layer-displace" },
......
......@@ -329,7 +329,7 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, /*< desc="Merge Layers" >*/
GIMP_UNDO_GROUP_IMAGE_QMASK, /*< desc="QuickMask" >*/
GIMP_UNDO_GROUP_IMAGE_GUIDE, /*< desc="Guide" >*/
GIMP_UNDO_GROUP_LAYER_PROPERTIES, /*< desc="Layer Properties" >*/
GIMP_UNDO_GROUP_ITEM_PROPERTIES, /*< desc="Item Properties" >*/
GIMP_UNDO_GROUP_LAYER_SCALE, /*< desc="Scale Layer" >*/
GIMP_UNDO_GROUP_LAYER_RESIZE, /*< desc="Resize Layer" >*/
GIMP_UNDO_GROUP_LAYER_DISPLACE, /*< desc="Move Layer" >*/
......
......@@ -759,6 +759,9 @@ gimp_container_reorder (GimpContainer *container,
return FALSE;
}
if (container->num_children == 1)
return TRUE;
g_signal_emit (container, container_signals[REORDER], 0,
object, new_index);
......
......@@ -36,5 +36,6 @@ VOID: OBJECT
VOID: OBJECT, INT
VOID: OBJECT, POINTER
VOID: POINTER
VOID: STRING, UINT
VOID: UINT
VOID: VOID
......@@ -52,6 +52,7 @@
#include "widgets/gimpimagedock.h"
#include "widgets/gimpimageview.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpdocumentview.h"
......@@ -65,6 +66,7 @@
#include "widgets/gimptoolbox-color-area.h"
#include "widgets/gimpundoeditor.h"
#include "widgets/gimpvectorslistview.h"
#include "widgets/gimpvectorstreeview.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
......@@ -140,7 +142,7 @@ static GtkWidget * dialogs_dockable_new (GtkWidget *widget,
static void dialogs_image_item_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpItemListView *view);
GimpContainerView *view);
static void dialogs_path_view_image_changed (GimpContext *context,
GimpImage *gimage,
GtkWidget *view);
......@@ -774,6 +776,40 @@ dialogs_layer_list_view_new (GimpDialogFactory *factory,
return dockable;
}
GtkWidget *
dialogs_layer_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GimpImage *gimage;
GtkWidget *view;
GtkWidget *dockable;
gimage = gimp_context_get_image (context);
if (preview_size < 1)
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimage,
GIMP_TYPE_LAYER,
"active_layer_changed",
(GimpNewItemFunc) layers_new_layer_query,
(GimpEditItemFunc) layers_edit_layer_query,
(GimpActivateItemFunc) layers_edit_layer_query,
factory->menu_factory, "<Layers>");
dockable = dialogs_dockable_new (view,
"Layer Tree", _("Layers"), NULL,
NULL,
dialogs_set_image_item_context_func);
gimp_dockable_set_context (GIMP_DOCKABLE (dockable), context);
return dockable;
}
GtkWidget *
dialogs_channel_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -808,6 +844,40 @@ dialogs_channel_list_view_new (GimpDialogFactory *factory,
return dockable;
}
GtkWidget *
dialogs_channel_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GimpImage *gimage;
GtkWidget *view;
GtkWidget *dockable;
gimage = gimp_context_get_image (context);
if (preview_size < 1)
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimage,
GIMP_TYPE_CHANNEL,
"active_channel_changed",
(GimpNewItemFunc) channels_new_channel_query,
(GimpEditItemFunc) channels_edit_channel_query,
(GimpActivateItemFunc) channels_edit_channel_query,
factory->menu_factory, "<Channels>");
dockable = dialogs_dockable_new (view,
"Channel Tree", _("Channels"), NULL,
NULL,
dialogs_set_image_item_context_func);
gimp_dockable_set_context (GIMP_DOCKABLE (dockable), context);
return dockable;
}
GtkWidget *
dialogs_vectors_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -847,6 +917,45 @@ dialogs_vectors_list_view_new (GimpDialogFactory *factory,
return dockable;
}
GtkWidget *
dialogs_vectors_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GimpImage *gimage;
GimpVectorsTreeView *vectors_view;
GtkWidget *view;
GtkWidget *dockable;
gimage = gimp_context_get_image (context);
if (preview_size < 1)
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimage,
GIMP_TYPE_VECTORS,
"active_vectors_changed",
(GimpNewItemFunc) vectors_new_vectors_query,
(GimpEditItemFunc) vectors_edit_vectors_query,
(GimpActivateItemFunc) vectors_vectors_tool,
factory->menu_factory, "<Vectors>");
vectors_view = GIMP_VECTORS_TREE_VIEW (view);
vectors_view->stroke_item_func = vectors_stroke_vectors;
dockable = dialogs_dockable_new (view,
"Paths Tree", _("Paths"), NULL,
NULL,
dialogs_set_image_item_context_func);
gimp_dockable_set_context (GIMP_DOCKABLE (dockable), context);
return dockable;
}
GtkWidget *
dialogs_path_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -1453,10 +1562,10 @@ static void
dialogs_set_image_item_context_func (GimpDockable *dockable,
GimpContext *context)
{
GimpItemListView *view;
GimpContainerView *view;
view = (GimpItemListView *) g_object_get_data (G_OBJECT (dockable),
"gimp-dialogs-view");
view = (GimpContainerView *) g_object_get_data (G_OBJECT (dockable),
"gimp-dialogs-view");
if (! view)
return;
......@@ -1613,11 +1722,14 @@ dialogs_dockable_new (GtkWidget *widget,
}
static void
dialogs_image_item_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpItemListView *view)
{
gimp_item_list_view_set_image (view, gimage);
dialogs_image_item_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpContainerView *view)
{
if (GIMP_IS_ITEM_LIST_VIEW (view))
gimp_item_list_view_set_image (GIMP_ITEM_LIST_VIEW (view), gimage);
else if (GIMP_IS_ITEM_TREE_VIEW (view))
gimp_item_tree_view_set_image (GIMP_ITEM_TREE_VIEW (view), gimage);
}
static void
......
......@@ -130,12 +130,21 @@ GtkWidget * dialogs_buffer_tree_view_new (GimpDialogFactory *factory,
GtkWidget * dialogs_layer_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_layer_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_channel_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_channel_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_vectors_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_vectors_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_path_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
......
......@@ -108,10 +108,16 @@ static const GimpDialogFactoryEntry dock_entries[] =
{ "gimp-layer-list", dialogs_layer_list_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-layer-tree", dialogs_layer_tree_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-channel-list", dialogs_channel_list_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-channel-tree", dialogs_channel_tree_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-vectors-list", dialogs_vectors_list_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-vectors-tree", dialogs_vectors_tree_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-path-list", dialogs_path_list_view_new,
0, TRUE, FALSE, FALSE, TRUE },
{ "gimp-indexed-palette", dialogs_indexed_palette_new,
......
......@@ -39,6 +39,7 @@
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpcomponenteditor.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
......@@ -65,6 +66,8 @@ static void channels_color_changed (GimpColorButton *button,
gimage = ((GimpImageEditor *) data)->gimage; \
else if (GIMP_IS_ITEM_LIST_VIEW (data)) \
gimage = ((GimpItemListView *) data)->gimage; \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
......
......@@ -28,8 +28,9 @@
#include "core/gimplist.h"
#include "widgets/gimpcomponenteditor.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "channels-commands.h"
#include "channels-menu.h"
......@@ -126,7 +127,12 @@ channels_menu_update (GtkItemFactory *factory,
{
GList *list;
gimage = GIMP_ITEM_LIST_VIEW (data)->gimage;
if (GIMP_IS_ITEM_LIST_VIEW (data))
gimage = GIMP_ITEM_LIST_VIEW (data)->gimage;
else if (GIMP_IS_ITEM_TREE_VIEW (data))
gimage = GIMP_ITEM_TREE_VIEW (data)->gimage;
else
return;
channel = gimp_image_get_active_channel (gimage);
......
......@@ -52,6 +52,7 @@
#include "widgets/gimpimagedock.h"
#include "widgets/gimpimageview.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpdocumentview.h"
......@@ -65,6 +66,7 @@
#include "widgets/gimptoolbox-color-area.h"
#include "widgets/gimpundoeditor.h"
#include "widgets/gimpvectorslistview.h"
#include "widgets/gimpvectorstreeview.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
......@@ -140,7 +142,7 @@ static GtkWidget * dialogs_dockable_new (GtkWidget *widget,
static void dialogs_image_item_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpItemListView *view);
GimpContainerView *view);
static void dialogs_path_view_image_changed (GimpContext *context,
GimpImage *gimage,
GtkWidget *view);
......@@ -774,6 +776,40 @@ dialogs_layer_list_view_new (GimpDialogFactory *factory,
return dockable;
}
GtkWidget *
dialogs_layer_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GimpImage *gimage;
GtkWidget *view;
GtkWidget *dockable;
gimage = gimp_context_get_image (context);
if (preview_size < 1)
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimage,
GIMP_TYPE_LAYER,
"active_layer_changed",
(GimpNewItemFunc) layers_new_layer_query,
(GimpEditItemFunc) layers_edit_layer_query,
(GimpActivateItemFunc) layers_edit_layer_query,
factory->menu_factory, "<Layers>");
dockable = dialogs_dockable_new (view,
"Layer Tree", _("Layers"), NULL,
NULL,
dialogs_set_image_item_context_func);
gimp_dockable_set_context (GIMP_DOCKABLE (dockable), context);
return dockable;
}
GtkWidget *
dialogs_channel_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -808,6 +844,40 @@ dialogs_channel_list_view_new (GimpDialogFactory *factory,
return dockable;
}
GtkWidget *
dialogs_channel_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GimpImage *gimage;
GtkWidget *view;
GtkWidget *dockable;
gimage = gimp_context_get_image (context);
if (preview_size < 1)
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimage,
GIMP_TYPE_CHANNEL,
"active_channel_changed",
(GimpNewItemFunc) channels_new_channel_query,
(GimpEditItemFunc) channels_edit_channel_query,
(GimpActivateItemFunc) channels_edit_channel_query,
factory->menu_factory, "<Channels>");
dockable = dialogs_dockable_new (view,
"Channel Tree", _("Channels"), NULL,
NULL,
dialogs_set_image_item_context_func);
gimp_dockable_set_context (GIMP_DOCKABLE (dockable), context);
return dockable;
}
GtkWidget *
dialogs_vectors_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -847,6 +917,45 @@ dialogs_vectors_list_view_new (GimpDialogFactory *factory,
return dockable;
}
GtkWidget *
dialogs_vectors_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GimpImage *gimage;
GimpVectorsTreeView *vectors_view;
GtkWidget *view;
GtkWidget *dockable;
gimage = gimp_context_get_image (context);
if (preview_size < 1)
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimage,
GIMP_TYPE_VECTORS,
"active_vectors_changed",
(GimpNewItemFunc) vectors_new_vectors_query,
(GimpEditItemFunc) vectors_edit_vectors_query,
(GimpActivateItemFunc) vectors_vectors_tool,
factory->menu_factory, "<Vectors>");
vectors_view = GIMP_VECTORS_TREE_VIEW (view);
vectors_view->stroke_item_func = vectors_stroke_vectors;
dockable = dialogs_dockable_new (view,
"Paths Tree", _("Paths"), NULL,
NULL,
dialogs_set_image_item_context_func);
gimp_dockable_set_context (GIMP_DOCKABLE (dockable), context);
return dockable;
}
GtkWidget *
dialogs_path_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
......@@ -1453,10 +1562,10 @@ static void
dialogs_set_image_item_context_func (GimpDockable *dockable,
GimpContext *context)
{
GimpItemListView *view;
GimpContainerView *view;
view = (GimpItemListView *) g_object_get_data (G_OBJECT (dockable),
"gimp-dialogs-view");
view = (GimpContainerView *) g_object_get_data (G_OBJECT (dockable),
"gimp-dialogs-view");
if (! view)
return;
......@@ -1613,11 +1722,14 @@ dialogs_dockable_new (GtkWidget *widget,
}
static void
dialogs_image_item_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpItemListView *view)
{
gimp_item_list_view_set_image (view, gimage);
dialogs_image_item_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpContainerView *view)
{
if (GIMP_IS_ITEM_LIST_VIEW (view))
gimp_item_list_view_set_image (GIMP_ITEM_LIST_VIEW (view), gimage);
else if (GIMP_IS_ITEM_TREE_VIEW (view))
gimp_item_tree_view_set_image (GIMP_ITEM_TREE_VIEW (view), gimage);
}
static void
......
......@@ -130,12 +130,21 @@ GtkWidget * dialogs_buffer_tree_view_new (GimpDialogFactory *factory,
GtkWidget * dialogs_layer_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_layer_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_channel_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_channel_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_vectors_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_vectors_tree_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_path_list_view_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
......
......@@ -108,10 +108,16 @@ static const GimpDialogFactoryEntry dock_entries[] =
{ "gimp-layer-list", dialogs_layer_list_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-layer-tree", dialogs_layer_tree_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-channel-list", dialogs_channel_list_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-channel-tree", dialogs_channel_tree_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-vectors-list", dialogs_vectors_list_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-vectors-tree", dialogs_vectors_tree_view_new,
0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-path-list", dialogs_path_list_view_new,
0, TRUE, FALSE, FALSE, TRUE },
{ "gimp-indexed-palette", dialogs_indexed_palette_new,
......
......@@ -44,6 +44,7 @@
#include "widgets/gimpenummenu.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
......@@ -70,6 +71,8 @@ static void layers_resize_layer_query (GimpImage *gimage,
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_ITEM_LIST_VIEW (data)) \
gimage = ((GimpItemListView *) data)->gimage; \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
......@@ -737,7 +740,7 @@ edit_layer_query_ok_callback (GtkWidget *widget,
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (layer))))
{
gimp_image_undo_group_start (options->gimage,
GIMP_UNDO_GROUP_LAYER_PROPERTIES,
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
_("Rename Layer"));
if (gimp_layer_is_floating_sel (layer))
......
......@@ -30,6 +30,7 @@
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "layers-commands.h"
#include "layers-menu.h"
......@@ -168,7 +169,12 @@ layers_menu_update (GtkItemFactory *factory,
GList *next = NULL;
GList *prev = NULL;
gimage = GIMP_ITEM_LIST_VIEW (data)->gimage;
if (GIMP_IS_ITEM_LIST_VIEW (data))
gimage = GIMP_ITEM_LIST_VIEW (data)->gimage;
else if (GIMP_IS_ITEM_TREE_VIEW (data))
gimage = GIMP_ITEM_TREE_VIEW (data)->gimage;
else
return;
layer = gimp_image_get_active_layer (gimage);
......
......@@ -44,6 +44,7 @@
#include "vectors/gimpvectors.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
......@@ -64,6 +65,8 @@
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_ITEM_LIST_VIEW (data)) \
gimage = ((GimpItemListView *) data)->gimage; \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
......