gimp r24570 - in trunk: . app/actions app/core app/display app/file app/pdb app/text app/vectors app/widgets tools/pdbgen/pdb
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r24570 - in trunk: . app/actions app/core app/display app/file app/pdb app/text app/vectors app/widgets tools/pdbgen/pdb
- Date: Tue, 8 Jan 2008 11:46:16 +0000 (GMT)
Author: neo
Date: Tue Jan 8 11:46:15 2008
New Revision: 24570
URL: http://svn.gnome.org/viewvc/gimp?rev=24570&view=rev
Log:
2008-01-08 Sven Neumann <sven gimp org>
* app/core/gimpitem.[ch]: removed "add_alpha" parameter from
gimp_item_duplicate() and gimp_item_convert(). This is a relict
from the time when only the bottom layer was allowed to have no
alpha channel.
* app/actions/channels-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimpchannel.c
* app/core/gimpdrawable.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimplayer.c
* app/core/gimplayermask.c
* app/core/gimpselection.c
* app/display/gimpdisplayshell-dnd.c
* app/file/file-open.c
* app/pdb/channel_cmds.c
* app/pdb/layer_cmds.c
* app/text/gimptextlayer.c
* app/vectors/gimpvectors.c
* app/vectors/gimpvectorsmodundo.c
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimptoolbox-dnd.c
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/layer.pdb: changed accordingly.
Modified:
trunk/ChangeLog
trunk/app/actions/channels-commands.c
trunk/app/actions/layers-commands.c
trunk/app/actions/vectors-commands.c
trunk/app/core/gimpchannel.c
trunk/app/core/gimpdrawable.c
trunk/app/core/gimpimage-duplicate.c
trunk/app/core/gimpimage-merge.c
trunk/app/core/gimpimage-quick-mask.c
trunk/app/core/gimpitem.c
trunk/app/core/gimpitem.h
trunk/app/core/gimplayer.c
trunk/app/core/gimplayermask.c
trunk/app/core/gimpselection.c
trunk/app/display/gimpdisplayshell-dnd.c
trunk/app/file/file-open.c
trunk/app/pdb/channel_cmds.c
trunk/app/pdb/layer_cmds.c
trunk/app/text/gimptextlayer.c
trunk/app/vectors/gimpvectors.c
trunk/app/vectors/gimpvectorsmodundo.c
trunk/app/widgets/gimpchanneltreeview.c
trunk/app/widgets/gimpitemtreeview.c
trunk/app/widgets/gimplayertreeview.c
trunk/app/widgets/gimptoolbox-dnd.c
trunk/tools/pdbgen/pdb/channel.pdb
trunk/tools/pdbgen/pdb/layer.pdb
Modified: trunk/app/actions/channels-commands.c
==============================================================================
--- trunk/app/actions/channels-commands.c (original)
+++ trunk/app/actions/channels-commands.c Tue Jan 8 11:46:15 2008
@@ -259,8 +259,7 @@
new_channel =
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
- G_TYPE_FROM_INSTANCE (channel),
- TRUE));
+ G_TYPE_FROM_INSTANCE (channel)));
}
gimp_image_add_channel (image, new_channel, -1);
@@ -339,8 +338,7 @@
new_channel =
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection),
- GIMP_TYPE_CHANNEL,
- FALSE));
+ GIMP_TYPE_CHANNEL));
gimp_object_set_name (GIMP_OBJECT (new_channel), channel_name);
gimp_channel_set_color (new_channel, &channel_color, FALSE);
Modified: trunk/app/actions/layers-commands.c
==============================================================================
--- trunk/app/actions/layers-commands.c (original)
+++ trunk/app/actions/layers-commands.c Tue Jan 8 11:46:15 2008
@@ -414,10 +414,8 @@
GimpLayer *new_layer;
return_if_no_layer (image, layer, data);
- new_layer =
- GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
- G_TYPE_FROM_INSTANCE (layer),
- TRUE));
+ new_layer = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
+ G_TYPE_FROM_INSTANCE (layer)));
gimp_image_add_layer (image, new_layer, -1);
gimp_image_flush (image);
Modified: trunk/app/actions/vectors-commands.c
==============================================================================
--- trunk/app/actions/vectors-commands.c (original)
+++ trunk/app/actions/vectors-commands.c Tue Jan 8 11:46:15 2008
@@ -249,10 +249,8 @@
GimpVectors *new_vectors;
return_if_no_vectors (image, vectors, data);
- new_vectors =
- GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
- G_TYPE_FROM_INSTANCE (vectors),
- TRUE));
+ new_vectors = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
+ G_TYPE_FROM_INSTANCE (vectors)));
gimp_image_add_vectors (image, new_vectors, -1);
gimp_image_flush (image);
}
Modified: trunk/app/core/gimpchannel.c
==============================================================================
--- trunk/app/core/gimpchannel.c (original)
+++ trunk/app/core/gimpchannel.c Tue Jan 8 11:46:15 2008
@@ -77,8 +77,7 @@
static gboolean gimp_channel_is_attached (GimpItem *item);
static GimpItem * gimp_channel_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
static void gimp_channel_convert (GimpItem *item,
GimpImage *dest_image);
static void gimp_channel_translate (GimpItem *item,
@@ -376,18 +375,13 @@
static GimpItem *
gimp_channel_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha)
+ GType new_type)
{
GimpItem *new_item;
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_DRAWABLE), NULL);
- if (g_type_is_a (new_type, GIMP_TYPE_CHANNEL))
- add_alpha = FALSE;
-
- new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type,
- add_alpha);
+ new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type);
if (GIMP_IS_CHANNEL (new_item))
{
Modified: trunk/app/core/gimpdrawable.c
==============================================================================
--- trunk/app/core/gimpdrawable.c (original)
+++ trunk/app/core/gimpdrawable.c Tue Jan 8 11:46:15 2008
@@ -75,8 +75,7 @@
static void gimp_drawable_invalidate_preview (GimpViewable *viewable);
static GimpItem * gimp_drawable_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
static void gimp_drawable_translate (GimpItem *item,
gint offset_x,
gint offset_y,
@@ -307,36 +306,28 @@
static GimpItem *
gimp_drawable_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha)
+ GType new_type)
{
GimpItem *new_item;
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_DRAWABLE), NULL);
- new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type,
- add_alpha);
+ new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type);
if (GIMP_IS_DRAWABLE (new_item))
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
GimpDrawable *new_drawable = GIMP_DRAWABLE (new_item);
- GimpImageType new_image_type;
PixelRegion srcPR;
PixelRegion destPR;
- if (add_alpha)
- new_image_type = gimp_drawable_type_with_alpha (drawable);
- else
- new_image_type = gimp_drawable_type (drawable);
-
gimp_drawable_configure (new_drawable,
gimp_item_get_image (item),
item->offset_x,
item->offset_y,
gimp_item_width (item),
gimp_item_height (item),
- new_image_type,
+ gimp_drawable_type (drawable),
GIMP_OBJECT (new_drawable)->name);
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
@@ -350,10 +341,7 @@
gimp_item_height (new_item),
TRUE);
- if (new_image_type == drawable->type)
- copy_region (&srcPR, &destPR);
- else
- add_alpha_region (&srcPR, &destPR);
+ copy_region (&srcPR, &destPR);
}
return new_item;
Modified: trunk/app/core/gimpimage-duplicate.c
==============================================================================
--- trunk/app/core/gimpimage-duplicate.c (original)
+++ trunk/app/core/gimpimage-duplicate.c Tue Jan 8 11:46:15 2008
@@ -114,8 +114,7 @@
new_layer = GIMP_LAYER (gimp_item_convert (GIMP_ITEM (layer),
new_image,
- G_TYPE_FROM_INSTANCE (layer),
- FALSE));
+ G_TYPE_FROM_INSTANCE (layer)));
/* Make sure the copied layer doesn't say: "<old layer> copy" */
gimp_object_set_name (GIMP_OBJECT (new_layer),
@@ -149,11 +148,9 @@
GimpChannel *channel = list->data;
GimpChannel *new_channel;
- new_channel =
- GIMP_CHANNEL (gimp_item_convert (GIMP_ITEM (channel),
- new_image,
- G_TYPE_FROM_INSTANCE (channel),
- FALSE));
+ new_channel = GIMP_CHANNEL (gimp_item_convert (GIMP_ITEM (channel),
+ new_image,
+ G_TYPE_FROM_INSTANCE (channel)));
/* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_object_set_name (GIMP_OBJECT (new_channel),
@@ -176,11 +173,9 @@
GimpVectors *vectors = list->data;
GimpVectors *new_vectors;
- new_vectors =
- GIMP_VECTORS (gimp_item_convert (GIMP_ITEM (vectors),
- new_image,
- G_TYPE_FROM_INSTANCE (vectors),
- FALSE));
+ new_vectors = GIMP_VECTORS (gimp_item_convert (GIMP_ITEM (vectors),
+ new_image,
+ G_TYPE_FROM_INSTANCE (vectors)));
/* Make sure the copied vectors doesn't say: "<old vectors> copy" */
gimp_object_set_name (GIMP_OBJECT (new_vectors),
Modified: trunk/app/core/gimpimage-merge.c
==============================================================================
--- trunk/app/core/gimpimage-merge.c (original)
+++ trunk/app/core/gimpimage-merge.c Tue Jan 8 11:46:15 2008
@@ -257,10 +257,8 @@
vectors = GIMP_VECTORS (cur_item->data);
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
- target_vectors = GIMP_VECTORS (
- gimp_item_duplicate (GIMP_ITEM (vectors),
- GIMP_TYPE_VECTORS,
- FALSE));
+ target_vectors = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
+ GIMP_TYPE_VECTORS));
pos = gimp_image_get_vectors_index (image, vectors);
gimp_image_remove_vectors (image, vectors);
cur_item = cur_item->next;
Modified: trunk/app/core/gimpimage-quick-mask.c
==============================================================================
--- trunk/app/core/gimpimage-quick-mask.c (original)
+++ trunk/app/core/gimpimage-quick-mask.c Tue Jan 8 11:46:15 2008
@@ -104,8 +104,7 @@
/* if selection */
mask = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection),
- GIMP_TYPE_CHANNEL,
- FALSE));
+ GIMP_TYPE_CHANNEL));
/* Clear the selection */
gimp_channel_clear (selection, NULL, TRUE);
Modified: trunk/app/core/gimpitem.c
==============================================================================
--- trunk/app/core/gimpitem.c (original)
+++ trunk/app/core/gimpitem.c Tue Jan 8 11:46:15 2008
@@ -78,8 +78,7 @@
gint64 *gui_size);
static GimpItem * gimp_item_real_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
static void gimp_item_real_convert (GimpItem *item,
GimpImage *dest_image);
static gboolean gimp_item_real_rename (GimpItem *item,
@@ -289,8 +288,7 @@
static GimpItem *
gimp_item_real_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha)
+ GType new_type)
{
GimpItem *new_item;
gchar *new_name;
@@ -525,22 +523,20 @@
/**
* gimp_item_duplicate:
- * @item: The #GimpItem to duplicate.
- * @new_type: The type to make the new item.
- * @add_alpha: #TRUE if an alpha channel should be added to the new item.
+ * @item: The #GimpItem to duplicate.
+ * @new_type: The type to make the new item.
*
* Returns: the newly created item.
*/
GimpItem *
gimp_item_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha)
+ GType new_type)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (item->image), NULL);
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_ITEM), NULL);
- return GIMP_ITEM_GET_CLASS (item)->duplicate (item, new_type, add_alpha);
+ return GIMP_ITEM_GET_CLASS (item)->duplicate (item, new_type);
}
/**
@@ -548,15 +544,13 @@
* @item: The #GimpItem to convert.
* @dest_image: The #GimpImage in which to place the converted item.
* @new_type: The type to convert the item to.
- * @add_alpha: #TRUE if an alpha channel should be added to the converted item.
*
* Returns: the new item that results from the conversion.
*/
GimpItem *
gimp_item_convert (GimpItem *item,
GimpImage *dest_image,
- GType new_type,
- gboolean add_alpha)
+ GType new_type)
{
GimpItem *new_item;
@@ -565,7 +559,7 @@
g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL);
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_ITEM), NULL);
- new_item = gimp_item_duplicate (item, new_type, add_alpha);
+ new_item = gimp_item_duplicate (item, new_type);
if (new_item)
GIMP_ITEM_GET_CLASS (new_item)->convert (new_item, dest_image);
Modified: trunk/app/core/gimpitem.h
==============================================================================
--- trunk/app/core/gimpitem.h (original)
+++ trunk/app/core/gimpitem.h Tue Jan 8 11:46:15 2008
@@ -65,8 +65,7 @@
/* virtual functions */
gboolean (* is_attached) (GimpItem *item);
GimpItem * (* duplicate) (GimpItem *item,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
void (* convert) (GimpItem *item,
GimpImage *dest_image);
gboolean (* rename) (GimpItem *item,
@@ -142,12 +141,10 @@
gint height,
const gchar *name);
GimpItem * gimp_item_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
GimpItem * gimp_item_convert (GimpItem *item,
GimpImage *dest_image,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
gboolean gimp_item_rename (GimpItem *item,
const gchar *new_name,
Modified: trunk/app/core/gimplayer.c
==============================================================================
--- trunk/app/core/gimplayer.c (original)
+++ trunk/app/core/gimplayer.c Tue Jan 8 11:46:15 2008
@@ -93,8 +93,7 @@
static void gimp_layer_removed (GimpItem *item);
static gboolean gimp_layer_is_attached (GimpItem *item);
static GimpItem * gimp_layer_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
static void gimp_layer_convert (GimpItem *item,
GimpImage *dest_image);
static gboolean gimp_layer_rename (GimpItem *item,
@@ -512,15 +511,13 @@
static GimpItem *
gimp_layer_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha)
+ GType new_type)
{
GimpItem *new_item;
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_DRAWABLE), NULL);
- new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type,
- add_alpha);
+ new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type);
if (GIMP_IS_LAYER (new_item))
{
@@ -537,11 +534,11 @@
/* duplicate the layer mask if necessary */
if (layer->mask)
{
- GimpItem *new_mask =
- gimp_item_duplicate (GIMP_ITEM (layer->mask),
- G_TYPE_FROM_INSTANCE (layer->mask),
- FALSE);
- gimp_layer_add_mask (new_layer, GIMP_LAYER_MASK (new_mask), FALSE);
+ GimpItem *mask;
+
+ mask = gimp_item_duplicate (GIMP_ITEM (layer->mask),
+ G_TYPE_FROM_INSTANCE (layer->mask));
+ gimp_layer_add_mask (new_layer, GIMP_LAYER_MASK (mask), FALSE);
}
}
Modified: trunk/app/core/gimplayermask.c
==============================================================================
--- trunk/app/core/gimplayermask.c (original)
+++ trunk/app/core/gimplayermask.c Tue Jan 8 11:46:15 2008
@@ -47,8 +47,7 @@
static gboolean gimp_layer_mask_is_attached (GimpItem *item);
static GimpItem * gimp_layer_mask_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
static gboolean gimp_layer_mask_rename (GimpItem *item,
const gchar *new_name,
const gchar *undo_desc,
@@ -129,15 +128,13 @@
static GimpItem *
gimp_layer_mask_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha)
+ GType new_type)
{
GimpItem *new_item;
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_DRAWABLE), NULL);
- new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type,
- add_alpha);
+ new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type);
if (GIMP_IS_LAYER_MASK (new_item))
{
Modified: trunk/app/core/gimpselection.c
==============================================================================
--- trunk/app/core/gimpselection.c (original)
+++ trunk/app/core/gimpselection.c Tue Jan 8 11:46:15 2008
@@ -582,8 +582,7 @@
image = gimp_item_get_image (GIMP_ITEM (selection));
new_channel = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection),
- GIMP_TYPE_CHANNEL,
- FALSE));
+ GIMP_TYPE_CHANNEL));
/* saved selections are not visible by default */
gimp_item_set_visible (GIMP_ITEM (new_channel), FALSE, FALSE);
Modified: trunk/app/display/gimpdisplayshell-dnd.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-dnd.c (original)
+++ trunk/app/display/gimpdisplayshell-dnd.c Tue Jan 8 11:46:15 2008
@@ -195,7 +195,7 @@
else
new_type = GIMP_TYPE_LAYER;
- new_item = gimp_item_convert (GIMP_ITEM (viewable), image, new_type, TRUE);
+ new_item = gimp_item_convert (GIMP_ITEM (viewable), image, new_type);
if (new_item)
{
@@ -243,8 +243,8 @@
if (image->gimp->busy)
return;
- new_item = gimp_item_convert (GIMP_ITEM (viewable), image,
- G_TYPE_FROM_INSTANCE (viewable), TRUE);
+ new_item = gimp_item_convert (GIMP_ITEM (viewable),
+ image, G_TYPE_FROM_INSTANCE (viewable));
if (new_item)
{
@@ -472,9 +472,8 @@
channel = gimp_channel_new_from_component (image, component, NULL, NULL);
- new_item = gimp_item_convert (GIMP_ITEM (channel), dest_image,
- GIMP_TYPE_LAYER, TRUE);
-
+ new_item = gimp_item_convert (GIMP_ITEM (channel),
+ dest_image, GIMP_TYPE_LAYER);
g_object_unref (channel);
if (new_item)
Modified: trunk/app/file/file-open.c
==============================================================================
--- trunk/app/file/file-open.c (original)
+++ trunk/app/file/file-open.c Tue Jan 8 11:46:15 2008
@@ -571,8 +571,7 @@
GimpItem *src = list->data;
GimpItem *item;
- item = gimp_item_convert (src, dest_image,
- G_TYPE_FROM_INSTANCE (src), TRUE);
+ item = gimp_item_convert (src, dest_image, G_TYPE_FROM_INSTANCE (src));
if (g_list_length (items) == 1)
{
Modified: trunk/app/pdb/channel_cmds.c
==============================================================================
--- trunk/app/pdb/channel_cmds.c (original)
+++ trunk/app/pdb/channel_cmds.c Tue Jan 8 11:46:15 2008
@@ -140,7 +140,7 @@
if (success)
{
channel_copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
- G_TYPE_FROM_INSTANCE (channel), FALSE));
+ G_TYPE_FROM_INSTANCE (channel)));
if (! channel_copy)
success = FALSE;
Modified: trunk/app/pdb/layer_cmds.c
==============================================================================
--- trunk/app/pdb/layer_cmds.c (original)
+++ trunk/app/pdb/layer_cmds.c Tue Jan 8 11:46:15 2008
@@ -115,9 +115,9 @@
new_type = GIMP_TYPE_LAYER;
if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
- new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type, TRUE);
+ new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type);
else
- new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type, TRUE);
+ new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
if (new_item)
layer_copy = GIMP_LAYER (new_item);
@@ -153,10 +153,16 @@
if (success)
{
layer_copy = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
- G_TYPE_FROM_INSTANCE (layer),
- add_alpha));
- if (! layer_copy)
- success = FALSE;
+ G_TYPE_FROM_INSTANCE (layer)));
+ if (layer_copy)
+ {
+ if (add_alpha)
+ gimp_layer_add_alpha (layer_copy);
+ }
+ else
+ {
+ success = FALSE;
+ }
}
return_vals = gimp_procedure_get_return_values (procedure, success);
Modified: trunk/app/text/gimptextlayer.c
==============================================================================
--- trunk/app/text/gimptextlayer.c (original)
+++ trunk/app/text/gimptextlayer.c Tue Jan 8 11:46:15 2008
@@ -75,8 +75,7 @@
gint64 *gui_size);
static GimpItem * gimp_text_layer_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
static gboolean gimp_text_layer_rename (GimpItem *item,
const gchar *new_name,
const gchar *undo_desc,
@@ -239,16 +238,13 @@
static GimpItem *
gimp_text_layer_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha)
+ GType new_type)
{
GimpItem *new_item;
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_DRAWABLE), NULL);
- new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item,
- new_type,
- add_alpha);
+ new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type);
if (GIMP_IS_TEXT_LAYER (new_item))
{
Modified: trunk/app/vectors/gimpvectors.c
==============================================================================
--- trunk/app/vectors/gimpvectors.c (original)
+++ trunk/app/vectors/gimpvectors.c Tue Jan 8 11:46:15 2008
@@ -65,8 +65,7 @@
static gboolean gimp_vectors_is_attached (GimpItem *item);
static GimpItem * gimp_vectors_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha);
+ GType new_type);
static void gimp_vectors_convert (GimpItem *item,
GimpImage *dest_image);
static void gimp_vectors_translate (GimpItem *item,
@@ -271,15 +270,13 @@
static GimpItem *
gimp_vectors_duplicate (GimpItem *item,
- GType new_type,
- gboolean add_alpha)
+ GType new_type)
{
GimpItem *new_item;
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_VECTORS), NULL);
- new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type,
- add_alpha);
+ new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type);
if (GIMP_IS_VECTORS (new_item))
{
Modified: trunk/app/vectors/gimpvectorsmodundo.c
==============================================================================
--- trunk/app/vectors/gimpvectorsmodundo.c (original)
+++ trunk/app/vectors/gimpvectorsmodundo.c Tue Jan 8 11:46:15 2008
@@ -84,8 +84,7 @@
vectors_mod_undo->vectors =
GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
- G_TYPE_FROM_INSTANCE (vectors),
- FALSE));
+ G_TYPE_FROM_INSTANCE (vectors)));
return object;
}
@@ -119,8 +118,7 @@
vectors_mod_undo->vectors =
GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
- G_TYPE_FROM_INSTANCE (vectors),
- FALSE));
+ G_TYPE_FROM_INSTANCE (vectors)));
gimp_vectors_freeze (vectors);
Modified: trunk/app/widgets/gimpchanneltreeview.c
==============================================================================
--- trunk/app/widgets/gimpchanneltreeview.c (original)
+++ trunk/app/widgets/gimpchanneltreeview.c Tue Jan 8 11:46:15 2008
@@ -207,7 +207,7 @@
new_item = gimp_item_convert (GIMP_ITEM (src_viewable),
item_view->image,
- item_view_class->item_type, FALSE);
+ item_view_class->item_type);
gimp_item_set_linked (new_item, FALSE, FALSE);
Modified: trunk/app/widgets/gimpitemtreeview.c
==============================================================================
--- trunk/app/widgets/gimpitemtreeview.c (original)
+++ trunk/app/widgets/gimpitemtreeview.c Tue Jan 8 11:46:15 2008
@@ -736,7 +736,7 @@
dest_index++;
new_item = gimp_item_convert (GIMP_ITEM (src_viewable),
- item_view->image, item_type, TRUE);
+ item_view->image, item_type);
gimp_item_set_linked (new_item, FALSE, FALSE);
Modified: trunk/app/widgets/gimplayertreeview.c
==============================================================================
--- trunk/app/widgets/gimplayertreeview.c (original)
+++ trunk/app/widgets/gimplayertreeview.c Tue Jan 8 11:46:15 2008
@@ -764,7 +764,7 @@
channel = gimp_channel_new_from_component (src_image, component, NULL, NULL);
new_item = gimp_item_convert (GIMP_ITEM (channel), item_view->image,
- GIMP_TYPE_LAYER, TRUE);
+ GIMP_TYPE_LAYER);
g_object_unref (channel);
Modified: trunk/app/widgets/gimptoolbox-dnd.c
==============================================================================
--- trunk/app/widgets/gimptoolbox-dnd.c (original)
+++ trunk/app/widgets/gimptoolbox-dnd.c Tue Jan 8 11:46:15 2008
@@ -212,8 +212,8 @@
else
new_type = GIMP_TYPE_LAYER;
- new_layer = GIMP_LAYER (gimp_item_convert (GIMP_ITEM (drawable), new_image,
- new_type, FALSE));
+ new_layer = GIMP_LAYER (gimp_item_convert (GIMP_ITEM (drawable),
+ new_image, new_type));
gimp_object_set_name (GIMP_OBJECT (new_layer),
gimp_object_get_name (GIMP_OBJECT (drawable)));
@@ -303,9 +303,8 @@
channel = gimp_channel_new_from_component (image, component, NULL, NULL);
- new_layer = GIMP_LAYER (gimp_item_convert (GIMP_ITEM (channel), new_image,
- GIMP_TYPE_LAYER, FALSE));
-
+ new_layer = GIMP_LAYER (gimp_item_convert (GIMP_ITEM (channel),
+ new_image, GIMP_TYPE_LAYER));
g_object_unref (channel);
gimp_enum_get_value (GIMP_TYPE_CHANNEL_TYPE, component,
Modified: trunk/tools/pdbgen/pdb/channel.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/channel.pdb (original)
+++ trunk/tools/pdbgen/pdb/channel.pdb Tue Jan 8 11:46:15 2008
@@ -90,7 +90,7 @@
code => <<'CODE'
{
channel_copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
- G_TYPE_FROM_INSTANCE (channel), FALSE));
+ G_TYPE_FROM_INSTANCE (channel)));
if (! channel_copy)
success = FALSE;
Modified: trunk/tools/pdbgen/pdb/layer.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/layer.pdb (original)
+++ trunk/tools/pdbgen/pdb/layer.pdb Tue Jan 8 11:46:15 2008
@@ -94,10 +94,16 @@
code => <<'CODE'
{
layer_copy = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
- G_TYPE_FROM_INSTANCE (layer),
- add_alpha));
- if (! layer_copy)
- success = FALSE;
+ G_TYPE_FROM_INSTANCE (layer)));
+ if (layer_copy)
+ {
+ if (add_alpha)
+ gimp_layer_add_alpha (layer_copy);
+ }
+ else
+ {
+ success = FALSE;
+ }
}
CODE
);
@@ -588,9 +594,9 @@
new_type = GIMP_TYPE_LAYER;
if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
- new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type, TRUE);
+ new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type);
else
- new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type, TRUE);
+ new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
if (new_item)
layer_copy = GIMP_LAYER (new_item);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]