API PATCH #2 or so

This commit is contained in:
Marc Lehmann 1999-10-17 00:07:55 +00:00
parent 0975e3dae4
commit ec40ac728b
257 changed files with 5520 additions and 4113 deletions

View file

@ -1,3 +1,9 @@
Sun Oct 17 00:55:38 CEST 1999 Marc Lehmann <marc@gimp.org>
* (221 files): Corrected ~20 pdb function names by choosing the
class/selector syntax over the various other syntaxes floating
around. Maybe more to come before 1.2.
1999-10-16 Michael Natterer <mitch@gimp.org> 1999-10-16 Michael Natterer <mitch@gimp.org>
* app/gimprc.c: preview_size_to_str() uses the new set of preview * app/gimprc.c: preview_size_to_str() uses the new set of preview

View file

@ -189,7 +189,7 @@ curves_colour_update (Tool *tool,
return; return;
sample_type = gimp_drawable_type(drawable); sample_type = gimp_drawable_type(drawable);
is_indexed = gimp_drawable_indexed (drawable); is_indexed = gimp_drawable_is_indexed (drawable);
has_alpha = TYPE_HAS_ALPHA(sample_type); has_alpha = TYPE_HAS_ALPHA(sample_type);
curves_dialog->col_value[HISTOGRAM_RED] = color[RED_PIX]; curves_dialog->col_value[HISTOGRAM_RED] = color[RED_PIX];

View file

@ -44,7 +44,7 @@ batch_init ()
/* until --batch-interp=xxx or something similar is implemented /* until --batch-interp=xxx or something similar is implemented
* and gimp-1.0 is not extinct use a shortcut to speed up starting the * and gimp-1.0 is not extinct use a shortcut to speed up starting the
* perl-server tremendously. This is also fully compatible to 1.0. * perl-server tremendously. This is also fully compatible with 1.0.
*/ */
{ {
int run_mode, flags, extra; int run_mode, flags, extra;

View file

@ -91,7 +91,7 @@ brightness_contrast_invoker (Argument *args)
if (success) if (success)
{ {
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
success = FALSE; success = FALSE;
else else
{ {
@ -207,8 +207,8 @@ levels_invoker (Argument *args)
if (success) if (success)
{ {
if (gimp_drawable_indexed (drawable) || if (gimp_drawable_is_indexed (drawable) ||
(gimp_drawable_gray (drawable) && channel != GRAY_LUT)) (gimp_drawable_is_gray (drawable) && channel != GRAY_LUT))
success = FALSE; success = FALSE;
else else
{ {
@ -328,7 +328,7 @@ posterize_invoker (Argument *args)
if (success) if (success)
{ {
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
success = FALSE; success = FALSE;
else else
{ {
@ -447,7 +447,7 @@ equalize_invoker (Argument *args)
if (success) if (success)
{ {
if (! gimp_drawable_indexed (drawable)) if (! gimp_drawable_is_indexed (drawable))
equalize (drawable_gimage (drawable), drawable, mask_only); equalize (drawable_gimage (drawable), drawable, mask_only);
else else
success = FALSE; success = FALSE;
@ -498,7 +498,7 @@ invert_invoker (Argument *args)
if (success) if (success)
{ {
if (! gimp_drawable_indexed (drawable)) if (! gimp_drawable_is_indexed (drawable))
invert (drawable); invert (drawable);
else else
success = FALSE; success = FALSE;
@ -561,8 +561,8 @@ curves_spline_invoker (Argument *args)
if (success) if (success)
{ {
if (gimp_drawable_indexed (drawable) || (num_points & 1) || if (gimp_drawable_is_indexed (drawable) || (num_points & 1) ||
(gimp_drawable_gray (drawable) && channel != GRAY_LUT)) (gimp_drawable_is_gray (drawable) && channel != GRAY_LUT))
success = FALSE; success = FALSE;
else else
{ {
@ -680,8 +680,8 @@ curves_explicit_invoker (Argument *args)
if (success) if (success)
{ {
if (gimp_drawable_indexed (drawable) || (num_bytes != 256) || if (gimp_drawable_is_indexed (drawable) || (num_bytes != 256) ||
(gimp_drawable_gray (drawable) && channel != GRAY_LUT)) (gimp_drawable_is_gray (drawable) && channel != GRAY_LUT))
success = FALSE; success = FALSE;
else else
{ {
@ -799,7 +799,7 @@ color_balance_invoker (Argument *args)
if (success) if (success)
{ {
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
success = FALSE; success = FALSE;
else else
{ {
@ -921,8 +921,8 @@ histogram_invoker (Argument *args)
if (success) if (success)
{ {
if (gimp_drawable_indexed (drawable) || if (gimp_drawable_is_indexed (drawable) ||
(gimp_drawable_gray (drawable) && channel != GRAY_LUT)) (gimp_drawable_is_gray (drawable) && channel != GRAY_LUT))
success = FALSE; success = FALSE;
else else
{ {
@ -1089,7 +1089,7 @@ hue_saturation_invoker (Argument *args)
if (success) if (success)
{ {
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
success = FALSE; success = FALSE;
else else
{ {
@ -1197,7 +1197,7 @@ threshold_invoker (Argument *args)
if (success) if (success)
{ {
if (gimp_drawable_indexed (drawable) || (low_threshold >= high_threshold)) if (gimp_drawable_is_indexed (drawable) || (low_threshold >= high_threshold))
success = FALSE; success = FALSE;
else else
{ {

View file

@ -487,7 +487,7 @@ pick_color_do (GimpImage *gimage,
y -= offy; y -= offy;
sample_type = gimp_drawable_type (drawable); sample_type = gimp_drawable_type (drawable);
is_indexed = gimp_drawable_indexed (drawable); is_indexed = gimp_drawable_is_indexed (drawable);
get_color_func = (GetColorFunc) gimp_drawable_get_color_at; get_color_func = (GetColorFunc) gimp_drawable_get_color_at;
get_color_obj = GTK_OBJECT (drawable); get_color_obj = GTK_OBJECT (drawable);

View file

@ -42,19 +42,19 @@ gimp_init_parasites()
} }
void void
gimp_attach_parasite (Parasite *p) gimp_parasite_attach (Parasite *p)
{ {
parasite_list_add(parasites, p); parasite_list_add(parasites, p);
} }
void void
gimp_detach_parasite (const char *name) gimp_parasite_detach (const char *name)
{ {
parasite_list_remove(parasites, name); parasite_list_remove(parasites, name);
} }
Parasite * Parasite *
gimp_find_parasite (const char *name) gimp_parasite_find (const char *name)
{ {
return parasite_list_find(parasites, name); return parasite_list_find(parasites, name);
} }

View file

@ -21,9 +21,9 @@
#include "libgimp/parasiteF.h" #include "libgimp/parasiteF.h"
void gimp_init_parasites (void); void gimp_init_parasites (void);
void gimp_attach_parasite (Parasite *p); void gimp_parasite_attach (Parasite *p);
void gimp_detach_parasite (const char *name); void gimp_parasite_detach (const char *name);
Parasite * gimp_find_parasite (const char *name); Parasite * gimp_parasite_find (const char *name);
char ** gimp_parasite_list (gint *count); char ** gimp_parasite_list (gint *count);
void gimp_parasiterc_save (void); void gimp_parasiterc_save (void);
void gimp_parasiterc_load (void); void gimp_parasiterc_load (void);

View file

@ -31,7 +31,7 @@ image_equalize (GimpImage *gimage)
drawable = gimage_active_drawable (gimage); drawable = gimage_active_drawable (gimage);
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
{ {
g_message (_("Equalize does not operate on indexed drawables.")); g_message (_("Equalize does not operate on indexed drawables."));
return; return;

View file

@ -38,7 +38,7 @@ image_invert (GimpImage *gimage)
drawable = gimage_active_drawable (gimage); drawable = gimage_active_drawable (gimage);
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
{ {
g_message (_("Invert does not operate on indexed drawables.")); g_message (_("Invert does not operate on indexed drawables."));
return; return;

View file

@ -407,7 +407,7 @@ gimp_drawable_get_color_at (GimpDrawable *drawable,
guchar *dest; guchar *dest;
if (!drawable || if (!drawable ||
(!gimp_drawable_gimage (drawable) && gimp_drawable_indexed (drawable)) (!gimp_drawable_gimage (drawable) && gimp_drawable_is_indexed (drawable))
|| x < 0 || y < 0 || || x < 0 || y < 0 ||
x >= drawable->width || y >= drawable->height) x >= drawable->width || y >= drawable->height)
{ {
@ -423,7 +423,7 @@ gimp_drawable_get_color_at (GimpDrawable *drawable,
dest[3] = src[gimp_drawable_bytes (drawable) - 1]; dest[3] = src[gimp_drawable_bytes (drawable) - 1];
else else
dest[3] = 255; dest[3] = 255;
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
dest[4] = src[0]; dest[4] = src[0];
else else
dest[4] = 0; dest[4] = 0;
@ -432,7 +432,7 @@ gimp_drawable_get_color_at (GimpDrawable *drawable,
} }
Parasite * Parasite *
gimp_drawable_find_parasite (const GimpDrawable *drawable, gimp_drawable_parasite_find (const GimpDrawable *drawable,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (drawable->parasites, name); return parasite_list_find (drawable->parasites, name);
@ -461,7 +461,7 @@ gimp_drawable_parasite_list (GimpDrawable *drawable,
} }
void void
gimp_drawable_attach_parasite (GimpDrawable *drawable, gimp_drawable_parasite_attach (GimpDrawable *drawable,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -475,7 +475,7 @@ gimp_drawable_attach_parasite (GimpDrawable *drawable,
} }
else if (parasite_is_persistent(parasite) && else if (parasite_is_persistent(parasite) &&
!parasite_compare( parasite, !parasite_compare( parasite,
gimp_drawable_find_parasite gimp_drawable_parasite_find
(drawable, parasite_name (parasite)))) (drawable, parasite_name (parasite))))
undo_push_cantundo (drawable->gimage, _("parasite attach to drawable")); undo_push_cantundo (drawable->gimage, _("parasite attach to drawable"));
@ -483,13 +483,13 @@ gimp_drawable_attach_parasite (GimpDrawable *drawable,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_image_attach_parasite (drawable->gimage, parasite); gimp_image_parasite_attach (drawable->gimage, parasite);
} }
else if (parasite_has_flag (parasite, PARASITE_ATTACH_GRANDPARENT)) else if (parasite_has_flag (parasite, PARASITE_ATTACH_GRANDPARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
if (parasite_is_undoable (parasite)) if (parasite_is_undoable (parasite))
{ {
@ -498,7 +498,7 @@ gimp_drawable_attach_parasite (GimpDrawable *drawable,
} }
void void
gimp_drawable_detach_parasite (GimpDrawable *drawable, gimp_drawable_parasite_detach (GimpDrawable *drawable,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -532,7 +532,7 @@ gimp_drawable_color (GimpDrawable *drawable)
} }
gboolean gboolean
gimp_drawable_gray (GimpDrawable *drawable) gimp_drawable_is_gray (GimpDrawable *drawable)
{ {
if (gimp_drawable_type (drawable) == GRAYA_GIMAGE || if (gimp_drawable_type (drawable) == GRAYA_GIMAGE ||
gimp_drawable_type (drawable) == GRAY_GIMAGE) gimp_drawable_type (drawable) == GRAY_GIMAGE)
@ -542,7 +542,7 @@ gimp_drawable_gray (GimpDrawable *drawable)
} }
gboolean gboolean
gimp_drawable_indexed (GimpDrawable *drawable) gimp_drawable_is_indexed (GimpDrawable *drawable)
{ {
if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE || if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE ||
gimp_drawable_type (drawable) == INDEXED_GIMAGE) gimp_drawable_type (drawable) == INDEXED_GIMAGE)

View file

@ -51,8 +51,8 @@ gboolean gimp_drawable_has_alpha (GimpDrawable *);
GimpImageType gimp_drawable_type (GimpDrawable *); GimpImageType gimp_drawable_type (GimpDrawable *);
GimpImageType gimp_drawable_type_with_alpha (GimpDrawable *); GimpImageType gimp_drawable_type_with_alpha (GimpDrawable *);
gboolean gimp_drawable_color (GimpDrawable *); gboolean gimp_drawable_color (GimpDrawable *);
gboolean gimp_drawable_gray (GimpDrawable *); gboolean gimp_drawable_is_gray (GimpDrawable *);
gboolean gimp_drawable_indexed (GimpDrawable *); gboolean gimp_drawable_is_indexed (GimpDrawable *);
TileManager * gimp_drawable_data (GimpDrawable *); TileManager * gimp_drawable_data (GimpDrawable *);
TileManager * gimp_drawable_shadow (GimpDrawable *); TileManager * gimp_drawable_shadow (GimpDrawable *);
gint gimp_drawable_bytes (GimpDrawable *); gint gimp_drawable_bytes (GimpDrawable *);
@ -69,12 +69,10 @@ void gimp_drawable_set_name (GimpDrawable *, gchar *);
guchar * gimp_drawable_get_color_at (GimpDrawable *, guchar * gimp_drawable_get_color_at (GimpDrawable *,
gint x, gint y); gint x, gint y);
Parasite * gimp_drawable_find_parasite (const GimpDrawable *, void gimp_drawable_parasite_attach (GimpDrawable *, Parasite *);
const gchar *name); void gimp_drawable_parasite_detach (GimpDrawable *,
void gimp_drawable_attach_parasite (GimpDrawable *, Parasite *);
void gimp_drawable_detach_parasite (GimpDrawable *,
const gchar *); const gchar *);
Parasite * gimp_drawable_find_parasite (const GimpDrawable *, Parasite * gimp_drawable_parasite_find (const GimpDrawable *,
const gchar *); const gchar *);
gchar ** gimp_drawable_parasite_list (GimpDrawable *drawable, gchar ** gimp_drawable_parasite_list (GimpDrawable *drawable,
gint *count); gint *count);

View file

@ -1079,7 +1079,7 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite * Parasite *
gimp_image_find_parasite (const GimpImage *gimage, gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (gimage->parasites, name); return parasite_list_find (gimage->parasites, name);
@ -1108,7 +1108,7 @@ gimp_image_parasite_list (GimpImage *image,
} }
void void
gimp_image_attach_parasite (GimpImage *gimage, gimp_image_parasite_attach (GimpImage *gimage,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -1117,7 +1117,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
undo_push_image_parasite (gimage, parasite); undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent (parasite) if (parasite_is_persistent (parasite)
&& !parasite_compare (parasite, && !parasite_compare (parasite,
gimp_image_find_parasite(gimage, gimp_image_parasite_find(gimage,
parasite_name(parasite)))) parasite_name(parasite))))
undo_push_cantundo (gimage, _("attach parasite to image")); undo_push_cantundo (gimage, _("attach parasite to image"));
@ -1126,12 +1126,12 @@ gimp_image_attach_parasite (GimpImage *gimage,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
} }
void void
gimp_image_detach_parasite (GimpImage *gimage, gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -3149,7 +3149,7 @@ gimp_image_filename (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_freeze_undo (GimpImage *gimage) gimp_image_undo_freeze (GimpImage *gimage)
{ {
gimage->undo_on = FALSE; gimage->undo_on = FALSE;
@ -3157,7 +3157,7 @@ gimp_image_freeze_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_thaw_undo (GimpImage *gimage) gimp_image_undo_thaw (GimpImage *gimage)
{ {
gimage->undo_on = TRUE; gimage->undo_on = TRUE;
@ -3165,18 +3165,18 @@ gimp_image_thaw_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_disable_undo (GimpImage *gimage) gimp_image_undo_disable (GimpImage *gimage)
{ {
return gimp_image_freeze_undo (gimage); return gimp_image_undo_freeze (gimage);
} }
gboolean gboolean
gimp_image_enable_undo (GimpImage *gimage) gimp_image_undo_enable (GimpImage *gimage)
{ {
/* Free all undo steps as they are now invalidated */ /* Free all undo steps as they are now invalidated */
undo_free (gimage); undo_free (gimage);
return gimp_image_thaw_undo (gimage); return gimp_image_undo_thaw (gimage);
} }
void void

View file

@ -160,12 +160,12 @@ void gimp_image_add_guide (GimpImage *, Guide *);
void gimp_image_remove_guide (GimpImage *, Guide *); void gimp_image_remove_guide (GimpImage *, Guide *);
void gimp_image_delete_guide (GimpImage *, Guide *); void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *, Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name); const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image, gchar ** gimp_image_parasite_list (GimpImage *image,
gint *count); gint *count);
void gimp_image_attach_parasite (GimpImage *, Parasite *); void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const gchar *); void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *); Tattoo gimp_image_get_new_tattoo (GimpImage *);
@ -248,10 +248,10 @@ GimpDrawable * gimp_image_active_drawable (GimpImage *);
GimpImageBaseType gimp_image_base_type (GimpImage *); GimpImageBaseType gimp_image_base_type (GimpImage *);
GimpImageType gimp_image_base_type_with_alpha (GimpImage *); GimpImageType gimp_image_base_type_with_alpha (GimpImage *);
gchar * gimp_image_filename (GimpImage *); gchar * gimp_image_filename (GimpImage *);
gboolean gimp_image_enable_undo (GimpImage *); gboolean gimp_image_undo_enable (GimpImage *);
gboolean gimp_image_disable_undo (GimpImage *); gboolean gimp_image_undo_disable (GimpImage *);
gboolean gimp_image_freeze_undo (GimpImage *); gboolean gimp_image_undo_freeze (GimpImage *);
gboolean gimp_image_thaw_undo (GimpImage *); gboolean gimp_image_undo_thaw (GimpImage *);
void gimp_image_undo_event (GimpImage *, int); void gimp_image_undo_event (GimpImage *, int);
gint gimp_image_dirty (GimpImage *); gint gimp_image_dirty (GimpImage *);
gint gimp_image_clean (GimpImage *); gint gimp_image_clean (GimpImage *);

View file

@ -1079,7 +1079,7 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite * Parasite *
gimp_image_find_parasite (const GimpImage *gimage, gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (gimage->parasites, name); return parasite_list_find (gimage->parasites, name);
@ -1108,7 +1108,7 @@ gimp_image_parasite_list (GimpImage *image,
} }
void void
gimp_image_attach_parasite (GimpImage *gimage, gimp_image_parasite_attach (GimpImage *gimage,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -1117,7 +1117,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
undo_push_image_parasite (gimage, parasite); undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent (parasite) if (parasite_is_persistent (parasite)
&& !parasite_compare (parasite, && !parasite_compare (parasite,
gimp_image_find_parasite(gimage, gimp_image_parasite_find(gimage,
parasite_name(parasite)))) parasite_name(parasite))))
undo_push_cantundo (gimage, _("attach parasite to image")); undo_push_cantundo (gimage, _("attach parasite to image"));
@ -1126,12 +1126,12 @@ gimp_image_attach_parasite (GimpImage *gimage,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
} }
void void
gimp_image_detach_parasite (GimpImage *gimage, gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -3149,7 +3149,7 @@ gimp_image_filename (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_freeze_undo (GimpImage *gimage) gimp_image_undo_freeze (GimpImage *gimage)
{ {
gimage->undo_on = FALSE; gimage->undo_on = FALSE;
@ -3157,7 +3157,7 @@ gimp_image_freeze_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_thaw_undo (GimpImage *gimage) gimp_image_undo_thaw (GimpImage *gimage)
{ {
gimage->undo_on = TRUE; gimage->undo_on = TRUE;
@ -3165,18 +3165,18 @@ gimp_image_thaw_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_disable_undo (GimpImage *gimage) gimp_image_undo_disable (GimpImage *gimage)
{ {
return gimp_image_freeze_undo (gimage); return gimp_image_undo_freeze (gimage);
} }
gboolean gboolean
gimp_image_enable_undo (GimpImage *gimage) gimp_image_undo_enable (GimpImage *gimage)
{ {
/* Free all undo steps as they are now invalidated */ /* Free all undo steps as they are now invalidated */
undo_free (gimage); undo_free (gimage);
return gimp_image_thaw_undo (gimage); return gimp_image_undo_thaw (gimage);
} }
void void

View file

@ -160,12 +160,12 @@ void gimp_image_add_guide (GimpImage *, Guide *);
void gimp_image_remove_guide (GimpImage *, Guide *); void gimp_image_remove_guide (GimpImage *, Guide *);
void gimp_image_delete_guide (GimpImage *, Guide *); void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *, Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name); const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image, gchar ** gimp_image_parasite_list (GimpImage *image,
gint *count); gint *count);
void gimp_image_attach_parasite (GimpImage *, Parasite *); void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const gchar *); void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *); Tattoo gimp_image_get_new_tattoo (GimpImage *);
@ -248,10 +248,10 @@ GimpDrawable * gimp_image_active_drawable (GimpImage *);
GimpImageBaseType gimp_image_base_type (GimpImage *); GimpImageBaseType gimp_image_base_type (GimpImage *);
GimpImageType gimp_image_base_type_with_alpha (GimpImage *); GimpImageType gimp_image_base_type_with_alpha (GimpImage *);
gchar * gimp_image_filename (GimpImage *); gchar * gimp_image_filename (GimpImage *);
gboolean gimp_image_enable_undo (GimpImage *); gboolean gimp_image_undo_enable (GimpImage *);
gboolean gimp_image_disable_undo (GimpImage *); gboolean gimp_image_undo_disable (GimpImage *);
gboolean gimp_image_freeze_undo (GimpImage *); gboolean gimp_image_undo_freeze (GimpImage *);
gboolean gimp_image_thaw_undo (GimpImage *); gboolean gimp_image_undo_thaw (GimpImage *);
void gimp_image_undo_event (GimpImage *, int); void gimp_image_undo_event (GimpImage *, int);
gint gimp_image_dirty (GimpImage *); gint gimp_image_dirty (GimpImage *);
gint gimp_image_clean (GimpImage *); gint gimp_image_clean (GimpImage *);

View file

@ -1079,7 +1079,7 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite * Parasite *
gimp_image_find_parasite (const GimpImage *gimage, gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (gimage->parasites, name); return parasite_list_find (gimage->parasites, name);
@ -1108,7 +1108,7 @@ gimp_image_parasite_list (GimpImage *image,
} }
void void
gimp_image_attach_parasite (GimpImage *gimage, gimp_image_parasite_attach (GimpImage *gimage,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -1117,7 +1117,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
undo_push_image_parasite (gimage, parasite); undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent (parasite) if (parasite_is_persistent (parasite)
&& !parasite_compare (parasite, && !parasite_compare (parasite,
gimp_image_find_parasite(gimage, gimp_image_parasite_find(gimage,
parasite_name(parasite)))) parasite_name(parasite))))
undo_push_cantundo (gimage, _("attach parasite to image")); undo_push_cantundo (gimage, _("attach parasite to image"));
@ -1126,12 +1126,12 @@ gimp_image_attach_parasite (GimpImage *gimage,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
} }
void void
gimp_image_detach_parasite (GimpImage *gimage, gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -3149,7 +3149,7 @@ gimp_image_filename (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_freeze_undo (GimpImage *gimage) gimp_image_undo_freeze (GimpImage *gimage)
{ {
gimage->undo_on = FALSE; gimage->undo_on = FALSE;
@ -3157,7 +3157,7 @@ gimp_image_freeze_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_thaw_undo (GimpImage *gimage) gimp_image_undo_thaw (GimpImage *gimage)
{ {
gimage->undo_on = TRUE; gimage->undo_on = TRUE;
@ -3165,18 +3165,18 @@ gimp_image_thaw_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_disable_undo (GimpImage *gimage) gimp_image_undo_disable (GimpImage *gimage)
{ {
return gimp_image_freeze_undo (gimage); return gimp_image_undo_freeze (gimage);
} }
gboolean gboolean
gimp_image_enable_undo (GimpImage *gimage) gimp_image_undo_enable (GimpImage *gimage)
{ {
/* Free all undo steps as they are now invalidated */ /* Free all undo steps as they are now invalidated */
undo_free (gimage); undo_free (gimage);
return gimp_image_thaw_undo (gimage); return gimp_image_undo_thaw (gimage);
} }
void void

View file

@ -160,12 +160,12 @@ void gimp_image_add_guide (GimpImage *, Guide *);
void gimp_image_remove_guide (GimpImage *, Guide *); void gimp_image_remove_guide (GimpImage *, Guide *);
void gimp_image_delete_guide (GimpImage *, Guide *); void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *, Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name); const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image, gchar ** gimp_image_parasite_list (GimpImage *image,
gint *count); gint *count);
void gimp_image_attach_parasite (GimpImage *, Parasite *); void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const gchar *); void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *); Tattoo gimp_image_get_new_tattoo (GimpImage *);
@ -248,10 +248,10 @@ GimpDrawable * gimp_image_active_drawable (GimpImage *);
GimpImageBaseType gimp_image_base_type (GimpImage *); GimpImageBaseType gimp_image_base_type (GimpImage *);
GimpImageType gimp_image_base_type_with_alpha (GimpImage *); GimpImageType gimp_image_base_type_with_alpha (GimpImage *);
gchar * gimp_image_filename (GimpImage *); gchar * gimp_image_filename (GimpImage *);
gboolean gimp_image_enable_undo (GimpImage *); gboolean gimp_image_undo_enable (GimpImage *);
gboolean gimp_image_disable_undo (GimpImage *); gboolean gimp_image_undo_disable (GimpImage *);
gboolean gimp_image_freeze_undo (GimpImage *); gboolean gimp_image_undo_freeze (GimpImage *);
gboolean gimp_image_thaw_undo (GimpImage *); gboolean gimp_image_undo_thaw (GimpImage *);
void gimp_image_undo_event (GimpImage *, int); void gimp_image_undo_event (GimpImage *, int);
gint gimp_image_dirty (GimpImage *); gint gimp_image_dirty (GimpImage *);
gint gimp_image_clean (GimpImage *); gint gimp_image_clean (GimpImage *);

View file

@ -1079,7 +1079,7 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite * Parasite *
gimp_image_find_parasite (const GimpImage *gimage, gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (gimage->parasites, name); return parasite_list_find (gimage->parasites, name);
@ -1108,7 +1108,7 @@ gimp_image_parasite_list (GimpImage *image,
} }
void void
gimp_image_attach_parasite (GimpImage *gimage, gimp_image_parasite_attach (GimpImage *gimage,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -1117,7 +1117,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
undo_push_image_parasite (gimage, parasite); undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent (parasite) if (parasite_is_persistent (parasite)
&& !parasite_compare (parasite, && !parasite_compare (parasite,
gimp_image_find_parasite(gimage, gimp_image_parasite_find(gimage,
parasite_name(parasite)))) parasite_name(parasite))))
undo_push_cantundo (gimage, _("attach parasite to image")); undo_push_cantundo (gimage, _("attach parasite to image"));
@ -1126,12 +1126,12 @@ gimp_image_attach_parasite (GimpImage *gimage,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
} }
void void
gimp_image_detach_parasite (GimpImage *gimage, gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -3149,7 +3149,7 @@ gimp_image_filename (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_freeze_undo (GimpImage *gimage) gimp_image_undo_freeze (GimpImage *gimage)
{ {
gimage->undo_on = FALSE; gimage->undo_on = FALSE;
@ -3157,7 +3157,7 @@ gimp_image_freeze_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_thaw_undo (GimpImage *gimage) gimp_image_undo_thaw (GimpImage *gimage)
{ {
gimage->undo_on = TRUE; gimage->undo_on = TRUE;
@ -3165,18 +3165,18 @@ gimp_image_thaw_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_disable_undo (GimpImage *gimage) gimp_image_undo_disable (GimpImage *gimage)
{ {
return gimp_image_freeze_undo (gimage); return gimp_image_undo_freeze (gimage);
} }
gboolean gboolean
gimp_image_enable_undo (GimpImage *gimage) gimp_image_undo_enable (GimpImage *gimage)
{ {
/* Free all undo steps as they are now invalidated */ /* Free all undo steps as they are now invalidated */
undo_free (gimage); undo_free (gimage);
return gimp_image_thaw_undo (gimage); return gimp_image_undo_thaw (gimage);
} }
void void

View file

@ -160,12 +160,12 @@ void gimp_image_add_guide (GimpImage *, Guide *);
void gimp_image_remove_guide (GimpImage *, Guide *); void gimp_image_remove_guide (GimpImage *, Guide *);
void gimp_image_delete_guide (GimpImage *, Guide *); void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *, Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name); const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image, gchar ** gimp_image_parasite_list (GimpImage *image,
gint *count); gint *count);
void gimp_image_attach_parasite (GimpImage *, Parasite *); void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const gchar *); void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *); Tattoo gimp_image_get_new_tattoo (GimpImage *);
@ -248,10 +248,10 @@ GimpDrawable * gimp_image_active_drawable (GimpImage *);
GimpImageBaseType gimp_image_base_type (GimpImage *); GimpImageBaseType gimp_image_base_type (GimpImage *);
GimpImageType gimp_image_base_type_with_alpha (GimpImage *); GimpImageType gimp_image_base_type_with_alpha (GimpImage *);
gchar * gimp_image_filename (GimpImage *); gchar * gimp_image_filename (GimpImage *);
gboolean gimp_image_enable_undo (GimpImage *); gboolean gimp_image_undo_enable (GimpImage *);
gboolean gimp_image_disable_undo (GimpImage *); gboolean gimp_image_undo_disable (GimpImage *);
gboolean gimp_image_freeze_undo (GimpImage *); gboolean gimp_image_undo_freeze (GimpImage *);
gboolean gimp_image_thaw_undo (GimpImage *); gboolean gimp_image_undo_thaw (GimpImage *);
void gimp_image_undo_event (GimpImage *, int); void gimp_image_undo_event (GimpImage *, int);
gint gimp_image_dirty (GimpImage *); gint gimp_image_dirty (GimpImage *);
gint gimp_image_clean (GimpImage *); gint gimp_image_clean (GimpImage *);

View file

@ -1079,7 +1079,7 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite * Parasite *
gimp_image_find_parasite (const GimpImage *gimage, gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (gimage->parasites, name); return parasite_list_find (gimage->parasites, name);
@ -1108,7 +1108,7 @@ gimp_image_parasite_list (GimpImage *image,
} }
void void
gimp_image_attach_parasite (GimpImage *gimage, gimp_image_parasite_attach (GimpImage *gimage,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -1117,7 +1117,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
undo_push_image_parasite (gimage, parasite); undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent (parasite) if (parasite_is_persistent (parasite)
&& !parasite_compare (parasite, && !parasite_compare (parasite,
gimp_image_find_parasite(gimage, gimp_image_parasite_find(gimage,
parasite_name(parasite)))) parasite_name(parasite))))
undo_push_cantundo (gimage, _("attach parasite to image")); undo_push_cantundo (gimage, _("attach parasite to image"));
@ -1126,12 +1126,12 @@ gimp_image_attach_parasite (GimpImage *gimage,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
} }
void void
gimp_image_detach_parasite (GimpImage *gimage, gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -3149,7 +3149,7 @@ gimp_image_filename (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_freeze_undo (GimpImage *gimage) gimp_image_undo_freeze (GimpImage *gimage)
{ {
gimage->undo_on = FALSE; gimage->undo_on = FALSE;
@ -3157,7 +3157,7 @@ gimp_image_freeze_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_thaw_undo (GimpImage *gimage) gimp_image_undo_thaw (GimpImage *gimage)
{ {
gimage->undo_on = TRUE; gimage->undo_on = TRUE;
@ -3165,18 +3165,18 @@ gimp_image_thaw_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_disable_undo (GimpImage *gimage) gimp_image_undo_disable (GimpImage *gimage)
{ {
return gimp_image_freeze_undo (gimage); return gimp_image_undo_freeze (gimage);
} }
gboolean gboolean
gimp_image_enable_undo (GimpImage *gimage) gimp_image_undo_enable (GimpImage *gimage)
{ {
/* Free all undo steps as they are now invalidated */ /* Free all undo steps as they are now invalidated */
undo_free (gimage); undo_free (gimage);
return gimp_image_thaw_undo (gimage); return gimp_image_undo_thaw (gimage);
} }
void void

View file

@ -160,12 +160,12 @@ void gimp_image_add_guide (GimpImage *, Guide *);
void gimp_image_remove_guide (GimpImage *, Guide *); void gimp_image_remove_guide (GimpImage *, Guide *);
void gimp_image_delete_guide (GimpImage *, Guide *); void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *, Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name); const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image, gchar ** gimp_image_parasite_list (GimpImage *image,
gint *count); gint *count);
void gimp_image_attach_parasite (GimpImage *, Parasite *); void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const gchar *); void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *); Tattoo gimp_image_get_new_tattoo (GimpImage *);
@ -248,10 +248,10 @@ GimpDrawable * gimp_image_active_drawable (GimpImage *);
GimpImageBaseType gimp_image_base_type (GimpImage *); GimpImageBaseType gimp_image_base_type (GimpImage *);
GimpImageType gimp_image_base_type_with_alpha (GimpImage *); GimpImageType gimp_image_base_type_with_alpha (GimpImage *);
gchar * gimp_image_filename (GimpImage *); gchar * gimp_image_filename (GimpImage *);
gboolean gimp_image_enable_undo (GimpImage *); gboolean gimp_image_undo_enable (GimpImage *);
gboolean gimp_image_disable_undo (GimpImage *); gboolean gimp_image_undo_disable (GimpImage *);
gboolean gimp_image_freeze_undo (GimpImage *); gboolean gimp_image_undo_freeze (GimpImage *);
gboolean gimp_image_thaw_undo (GimpImage *); gboolean gimp_image_undo_thaw (GimpImage *);
void gimp_image_undo_event (GimpImage *, int); void gimp_image_undo_event (GimpImage *, int);
gint gimp_image_dirty (GimpImage *); gint gimp_image_dirty (GimpImage *);
gint gimp_image_clean (GimpImage *); gint gimp_image_clean (GimpImage *);

View file

@ -2446,7 +2446,7 @@ undo_push_image_parasite (GImage *gimage,
data->gimage = gimage; data->gimage = gimage;
data->drawable = NULL; data->drawable = NULL;
data->name = g_strdup (parasite_name (parasite)); data->name = g_strdup (parasite_name (parasite));
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->name)); data->parasite = parasite_copy (gimp_image_parasite_find (gimage, data->name));
return TRUE; return TRUE;
} }
@ -2474,7 +2474,7 @@ undo_push_image_parasite_remove (GImage *gimage,
data->gimage = gimage; data->gimage = gimage;
data->drawable = NULL; data->drawable = NULL;
data->name = g_strdup (name); data->name = g_strdup (name);
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->name)); data->parasite = parasite_copy (gimp_image_parasite_find (gimage, data->name));
return TRUE; return TRUE;
} }
@ -2503,7 +2503,7 @@ undo_push_drawable_parasite (GImage *gimage,
data->gimage = NULL; data->gimage = NULL;
data->drawable = drawable; data->drawable = drawable;
data->name = g_strdup (parasite_name (parasite)); data->name = g_strdup (parasite_name (parasite));
data->parasite = parasite_copy (gimp_drawable_find_parasite (drawable, data->name)); data->parasite = parasite_copy (gimp_drawable_parasite_find (drawable, data->name));
return TRUE; return TRUE;
} }
@ -2531,7 +2531,7 @@ undo_push_drawable_parasite_remove (GImage *gimage,
data->gimage = NULL; data->gimage = NULL;
data->drawable = drawable; data->drawable = drawable;
data->name = g_strdup (name); data->name = g_strdup (name);
data->parasite = parasite_copy (gimp_drawable_find_parasite (drawable, data->name)); data->parasite = parasite_copy (gimp_drawable_parasite_find (drawable, data->name));
return TRUE; return TRUE;
} }
@ -2554,7 +2554,7 @@ undo_pop_parasite (GImage *gimage,
if (data->gimage) if (data->gimage)
{ {
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->parasite = parasite_copy (gimp_image_parasite_find (gimage,
data->name)); data->name));
if (tmp) if (tmp)
parasite_list_add (data->gimage->parasites, tmp); parasite_list_add (data->gimage->parasites, tmp);
@ -2563,7 +2563,7 @@ undo_pop_parasite (GImage *gimage,
} }
else if (data->drawable) else if (data->drawable)
{ {
data->parasite = parasite_copy (gimp_drawable_find_parasite (data->drawable, data->parasite = parasite_copy (gimp_drawable_parasite_find (data->drawable,
data->name)); data->name));
if (tmp) if (tmp)
parasite_list_add (data->drawable->parasites, tmp); parasite_list_add (data->drawable->parasites, tmp);
@ -2572,11 +2572,11 @@ undo_pop_parasite (GImage *gimage,
} }
else else
{ {
data->parasite = parasite_copy (gimp_find_parasite (data->name)); data->parasite = parasite_copy (gimp_parasite_find (data->name));
if (tmp) if (tmp)
gimp_attach_parasite (tmp); gimp_parasite_attach (tmp);
else else
gimp_detach_parasite (data->name); gimp_parasite_detach (data->name);
} }
if (tmp) if (tmp)

View file

@ -1079,7 +1079,7 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite * Parasite *
gimp_image_find_parasite (const GimpImage *gimage, gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (gimage->parasites, name); return parasite_list_find (gimage->parasites, name);
@ -1108,7 +1108,7 @@ gimp_image_parasite_list (GimpImage *image,
} }
void void
gimp_image_attach_parasite (GimpImage *gimage, gimp_image_parasite_attach (GimpImage *gimage,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -1117,7 +1117,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
undo_push_image_parasite (gimage, parasite); undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent (parasite) if (parasite_is_persistent (parasite)
&& !parasite_compare (parasite, && !parasite_compare (parasite,
gimp_image_find_parasite(gimage, gimp_image_parasite_find(gimage,
parasite_name(parasite)))) parasite_name(parasite))))
undo_push_cantundo (gimage, _("attach parasite to image")); undo_push_cantundo (gimage, _("attach parasite to image"));
@ -1126,12 +1126,12 @@ gimp_image_attach_parasite (GimpImage *gimage,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
} }
void void
gimp_image_detach_parasite (GimpImage *gimage, gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -3149,7 +3149,7 @@ gimp_image_filename (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_freeze_undo (GimpImage *gimage) gimp_image_undo_freeze (GimpImage *gimage)
{ {
gimage->undo_on = FALSE; gimage->undo_on = FALSE;
@ -3157,7 +3157,7 @@ gimp_image_freeze_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_thaw_undo (GimpImage *gimage) gimp_image_undo_thaw (GimpImage *gimage)
{ {
gimage->undo_on = TRUE; gimage->undo_on = TRUE;
@ -3165,18 +3165,18 @@ gimp_image_thaw_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_disable_undo (GimpImage *gimage) gimp_image_undo_disable (GimpImage *gimage)
{ {
return gimp_image_freeze_undo (gimage); return gimp_image_undo_freeze (gimage);
} }
gboolean gboolean
gimp_image_enable_undo (GimpImage *gimage) gimp_image_undo_enable (GimpImage *gimage)
{ {
/* Free all undo steps as they are now invalidated */ /* Free all undo steps as they are now invalidated */
undo_free (gimage); undo_free (gimage);
return gimp_image_thaw_undo (gimage); return gimp_image_undo_thaw (gimage);
} }
void void

View file

@ -160,12 +160,12 @@ void gimp_image_add_guide (GimpImage *, Guide *);
void gimp_image_remove_guide (GimpImage *, Guide *); void gimp_image_remove_guide (GimpImage *, Guide *);
void gimp_image_delete_guide (GimpImage *, Guide *); void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *, Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name); const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image, gchar ** gimp_image_parasite_list (GimpImage *image,
gint *count); gint *count);
void gimp_image_attach_parasite (GimpImage *, Parasite *); void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const gchar *); void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *); Tattoo gimp_image_get_new_tattoo (GimpImage *);
@ -248,10 +248,10 @@ GimpDrawable * gimp_image_active_drawable (GimpImage *);
GimpImageBaseType gimp_image_base_type (GimpImage *); GimpImageBaseType gimp_image_base_type (GimpImage *);
GimpImageType gimp_image_base_type_with_alpha (GimpImage *); GimpImageType gimp_image_base_type_with_alpha (GimpImage *);
gchar * gimp_image_filename (GimpImage *); gchar * gimp_image_filename (GimpImage *);
gboolean gimp_image_enable_undo (GimpImage *); gboolean gimp_image_undo_enable (GimpImage *);
gboolean gimp_image_disable_undo (GimpImage *); gboolean gimp_image_undo_disable (GimpImage *);
gboolean gimp_image_freeze_undo (GimpImage *); gboolean gimp_image_undo_freeze (GimpImage *);
gboolean gimp_image_thaw_undo (GimpImage *); gboolean gimp_image_undo_thaw (GimpImage *);
void gimp_image_undo_event (GimpImage *, int); void gimp_image_undo_event (GimpImage *, int);
gint gimp_image_dirty (GimpImage *); gint gimp_image_dirty (GimpImage *);
gint gimp_image_clean (GimpImage *); gint gimp_image_clean (GimpImage *);

View file

@ -320,7 +320,7 @@ image_map_get_color_at (ImageMap image_map, int x, int y)
if (!image_map || if (!image_map ||
(!gimp_drawable_gimage(_image_map->drawable) && (!gimp_drawable_gimage(_image_map->drawable) &&
gimp_drawable_indexed(_image_map->drawable)) || gimp_drawable_is_indexed(_image_map->drawable)) ||
x < 0 || y < 0 || x < 0 || y < 0 ||
x >= _image_map->undo_tiles->width || x >= _image_map->undo_tiles->width ||
y >= _image_map->undo_tiles->height) y >= _image_map->undo_tiles->height)
@ -342,7 +342,7 @@ image_map_get_color_at (ImageMap image_map, int x, int y)
dest[3] = src[gimp_drawable_bytes (_image_map->drawable) - 1]; dest[3] = src[gimp_drawable_bytes (_image_map->drawable) - 1];
else else
dest[3] = 255; dest[3] = 255;
if (gimp_drawable_indexed(_image_map->drawable)) if (gimp_drawable_is_indexed(_image_map->drawable))
dest[4] = src[0]; dest[4] = src[0];
else else
dest[4] = 0; dest[4] = 0;

View file

@ -42,19 +42,19 @@ gimp_init_parasites()
} }
void void
gimp_attach_parasite (Parasite *p) gimp_parasite_attach (Parasite *p)
{ {
parasite_list_add(parasites, p); parasite_list_add(parasites, p);
} }
void void
gimp_detach_parasite (const char *name) gimp_parasite_detach (const char *name)
{ {
parasite_list_remove(parasites, name); parasite_list_remove(parasites, name);
} }
Parasite * Parasite *
gimp_find_parasite (const char *name) gimp_parasite_find (const char *name)
{ {
return parasite_list_find(parasites, name); return parasite_list_find(parasites, name);
} }

View file

@ -21,9 +21,9 @@
#include "libgimp/parasiteF.h" #include "libgimp/parasiteF.h"
void gimp_init_parasites (void); void gimp_init_parasites (void);
void gimp_attach_parasite (Parasite *p); void gimp_parasite_attach (Parasite *p);
void gimp_detach_parasite (const char *name); void gimp_parasite_detach (const char *name);
Parasite * gimp_find_parasite (const char *name); Parasite * gimp_parasite_find (const char *name);
char ** gimp_parasite_list (gint *count); char ** gimp_parasite_list (gint *count);
void gimp_parasiterc_save (void); void gimp_parasiterc_save (void);
void gimp_parasiterc_load (void); void gimp_parasiterc_load (void);

View file

@ -1079,7 +1079,7 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite * Parasite *
gimp_image_find_parasite (const GimpImage *gimage, gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (gimage->parasites, name); return parasite_list_find (gimage->parasites, name);
@ -1108,7 +1108,7 @@ gimp_image_parasite_list (GimpImage *image,
} }
void void
gimp_image_attach_parasite (GimpImage *gimage, gimp_image_parasite_attach (GimpImage *gimage,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -1117,7 +1117,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
undo_push_image_parasite (gimage, parasite); undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent (parasite) if (parasite_is_persistent (parasite)
&& !parasite_compare (parasite, && !parasite_compare (parasite,
gimp_image_find_parasite(gimage, gimp_image_parasite_find(gimage,
parasite_name(parasite)))) parasite_name(parasite))))
undo_push_cantundo (gimage, _("attach parasite to image")); undo_push_cantundo (gimage, _("attach parasite to image"));
@ -1126,12 +1126,12 @@ gimp_image_attach_parasite (GimpImage *gimage,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
} }
void void
gimp_image_detach_parasite (GimpImage *gimage, gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -3149,7 +3149,7 @@ gimp_image_filename (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_freeze_undo (GimpImage *gimage) gimp_image_undo_freeze (GimpImage *gimage)
{ {
gimage->undo_on = FALSE; gimage->undo_on = FALSE;
@ -3157,7 +3157,7 @@ gimp_image_freeze_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_thaw_undo (GimpImage *gimage) gimp_image_undo_thaw (GimpImage *gimage)
{ {
gimage->undo_on = TRUE; gimage->undo_on = TRUE;
@ -3165,18 +3165,18 @@ gimp_image_thaw_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_disable_undo (GimpImage *gimage) gimp_image_undo_disable (GimpImage *gimage)
{ {
return gimp_image_freeze_undo (gimage); return gimp_image_undo_freeze (gimage);
} }
gboolean gboolean
gimp_image_enable_undo (GimpImage *gimage) gimp_image_undo_enable (GimpImage *gimage)
{ {
/* Free all undo steps as they are now invalidated */ /* Free all undo steps as they are now invalidated */
undo_free (gimage); undo_free (gimage);
return gimp_image_thaw_undo (gimage); return gimp_image_undo_thaw (gimage);
} }
void void

View file

@ -160,12 +160,12 @@ void gimp_image_add_guide (GimpImage *, Guide *);
void gimp_image_remove_guide (GimpImage *, Guide *); void gimp_image_remove_guide (GimpImage *, Guide *);
void gimp_image_delete_guide (GimpImage *, Guide *); void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *, Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name); const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image, gchar ** gimp_image_parasite_list (GimpImage *image,
gint *count); gint *count);
void gimp_image_attach_parasite (GimpImage *, Parasite *); void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const gchar *); void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *); Tattoo gimp_image_get_new_tattoo (GimpImage *);
@ -248,10 +248,10 @@ GimpDrawable * gimp_image_active_drawable (GimpImage *);
GimpImageBaseType gimp_image_base_type (GimpImage *); GimpImageBaseType gimp_image_base_type (GimpImage *);
GimpImageType gimp_image_base_type_with_alpha (GimpImage *); GimpImageType gimp_image_base_type_with_alpha (GimpImage *);
gchar * gimp_image_filename (GimpImage *); gchar * gimp_image_filename (GimpImage *);
gboolean gimp_image_enable_undo (GimpImage *); gboolean gimp_image_undo_enable (GimpImage *);
gboolean gimp_image_disable_undo (GimpImage *); gboolean gimp_image_undo_disable (GimpImage *);
gboolean gimp_image_freeze_undo (GimpImage *); gboolean gimp_image_undo_freeze (GimpImage *);
gboolean gimp_image_thaw_undo (GimpImage *); gboolean gimp_image_undo_thaw (GimpImage *);
void gimp_image_undo_event (GimpImage *, int); void gimp_image_undo_event (GimpImage *, int);
gint gimp_image_dirty (GimpImage *); gint gimp_image_dirty (GimpImage *);
gint gimp_image_clean (GimpImage *); gint gimp_image_clean (GimpImage *);

View file

@ -21,7 +21,7 @@
#include <gdk/gdktypes.h> #include <gdk/gdktypes.h>
#if defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_X11) #if defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_X11)
/* Stopgap measure to detect build with current CVS GTk+ */ /* Stopgap measure to detect build with current CVS GTk+ */
#include <gdk/gdkcursor.h> //#include <gdk/gdkcursor.h>
#endif #endif
typedef enum typedef enum

View file

@ -189,7 +189,7 @@ curves_colour_update (Tool *tool,
return; return;
sample_type = gimp_drawable_type(drawable); sample_type = gimp_drawable_type(drawable);
is_indexed = gimp_drawable_indexed (drawable); is_indexed = gimp_drawable_is_indexed (drawable);
has_alpha = TYPE_HAS_ALPHA(sample_type); has_alpha = TYPE_HAS_ALPHA(sample_type);
curves_dialog->col_value[HISTOGRAM_RED] = color[RED_PIX]; curves_dialog->col_value[HISTOGRAM_RED] = color[RED_PIX];

View file

@ -37,8 +37,8 @@ void drawable_apply_image (GimpDrawable *, gint, gint, gint, gint,
#define drawable_has_alpha gimp_drawable_has_alpha #define drawable_has_alpha gimp_drawable_has_alpha
#define drawable_type_with_alpha gimp_drawable_type_with_alpha #define drawable_type_with_alpha gimp_drawable_type_with_alpha
#define drawable_color gimp_drawable_color #define drawable_color gimp_drawable_color
#define drawable_gray gimp_drawable_gray #define drawable_gray gimp_drawable_is_gray
#define drawable_indexed gimp_drawable_indexed #define drawable_indexed gimp_drawable_is_indexed
#define drawable_data gimp_drawable_data #define drawable_data gimp_drawable_data
#define drawable_shadow gimp_drawable_shadow #define drawable_shadow gimp_drawable_shadow
#define drawable_bytes gimp_drawable_bytes #define drawable_bytes gimp_drawable_bytes

View file

@ -31,7 +31,7 @@ image_equalize (GimpImage *gimage)
drawable = gimage_active_drawable (gimage); drawable = gimage_active_drawable (gimage);
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
{ {
g_message (_("Equalize does not operate on indexed drawables.")); g_message (_("Equalize does not operate on indexed drawables."));
return; return;

View file

@ -102,10 +102,10 @@ void gimage_foreach (GFunc func,
#define gimage_base_type gimp_image_base_type #define gimage_base_type gimp_image_base_type
#define gimage_base_type_with_alpha gimp_image_base_type_with_alpha #define gimage_base_type_with_alpha gimp_image_base_type_with_alpha
#define gimage_filename gimp_image_filename #define gimage_filename gimp_image_filename
#define gimage_enable_undo gimp_image_enable_undo #define gimage_enable_undo gimp_image_undo_enable
#define gimage_disable_undo gimp_image_disable_undo #define gimage_disable_undo gimp_image_undo_disable
#define gimage_thaw_undo gimp_image_thaw_undo #define gimage_thaw_undo gimp_image_undo_thaw
#define gimage_freeze_undo gimp_image_freeze_undo #define gimage_freeze_undo gimp_image_undo_freeze
#define gimage_dirty gimp_image_dirty #define gimage_dirty gimp_image_dirty
#define gimage_clean gimp_image_clean #define gimage_clean gimp_image_clean
#define gimage_clean_all gimp_image_clean_all #define gimage_clean_all gimp_image_clean_all

View file

@ -32,7 +32,7 @@
#include "layer.h" #include "layer.h"
#include "layer_pvt.h" #include "layer_pvt.h"
static ProcRecord list_images_proc; static ProcRecord image_list_proc;
static ProcRecord image_new_proc; static ProcRecord image_new_proc;
static ProcRecord image_resize_proc; static ProcRecord image_resize_proc;
static ProcRecord image_scale_proc; static ProcRecord image_scale_proc;
@ -61,10 +61,10 @@ static ProcRecord image_active_drawable_proc;
static ProcRecord image_base_type_proc; static ProcRecord image_base_type_proc;
static ProcRecord image_get_cmap_proc; static ProcRecord image_get_cmap_proc;
static ProcRecord image_set_cmap_proc; static ProcRecord image_set_cmap_proc;
static ProcRecord image_enable_undo_proc; static ProcRecord image_undo_enable_proc;
static ProcRecord image_disable_undo_proc; static ProcRecord image_undo_disable_proc;
static ProcRecord image_freeze_undo_proc; static ProcRecord image_undo_freeze_proc;
static ProcRecord image_thaw_undo_proc; static ProcRecord image_undo_thaw_proc;
static ProcRecord image_clean_all_proc; static ProcRecord image_clean_all_proc;
static ProcRecord image_floating_selection_proc; static ProcRecord image_floating_selection_proc;
static ProcRecord image_floating_sel_attached_to_proc; static ProcRecord image_floating_sel_attached_to_proc;
@ -92,7 +92,7 @@ static ProcRecord image_get_channel_by_tattoo_proc;
void void
register_gimage_procs (void) register_gimage_procs (void)
{ {
procedural_db_register (&list_images_proc); procedural_db_register (&image_list_proc);
procedural_db_register (&image_new_proc); procedural_db_register (&image_new_proc);
procedural_db_register (&image_resize_proc); procedural_db_register (&image_resize_proc);
procedural_db_register (&image_scale_proc); procedural_db_register (&image_scale_proc);
@ -121,10 +121,10 @@ register_gimage_procs (void)
procedural_db_register (&image_base_type_proc); procedural_db_register (&image_base_type_proc);
procedural_db_register (&image_get_cmap_proc); procedural_db_register (&image_get_cmap_proc);
procedural_db_register (&image_set_cmap_proc); procedural_db_register (&image_set_cmap_proc);
procedural_db_register (&image_enable_undo_proc); procedural_db_register (&image_undo_enable_proc);
procedural_db_register (&image_disable_undo_proc); procedural_db_register (&image_undo_disable_proc);
procedural_db_register (&image_freeze_undo_proc); procedural_db_register (&image_undo_freeze_proc);
procedural_db_register (&image_thaw_undo_proc); procedural_db_register (&image_undo_thaw_proc);
procedural_db_register (&image_clean_all_proc); procedural_db_register (&image_clean_all_proc);
procedural_db_register (&image_floating_selection_proc); procedural_db_register (&image_floating_selection_proc);
procedural_db_register (&image_floating_sel_attached_to_proc); procedural_db_register (&image_floating_sel_attached_to_proc);
@ -161,7 +161,7 @@ gimlist_cb (gpointer im,
} }
static Argument * static Argument *
list_images_invoker (Argument *args) image_list_invoker (Argument *args)
{ {
Argument *return_args; Argument *return_args;
gint32 num_images = 0; gint32 num_images = 0;
@ -179,7 +179,7 @@ list_images_invoker (Argument *args)
image_ids[i] = pdb_image_to_id (GIMP_IMAGE (list->data)); image_ids[i] = pdb_image_to_id (GIMP_IMAGE (list->data));
} }
return_args = procedural_db_return_args (&list_images_proc, TRUE); return_args = procedural_db_return_args (&image_list_proc, TRUE);
return_args[1].value.pdb_int = num_images; return_args[1].value.pdb_int = num_images;
return_args[2].value.pdb_pointer = image_ids; return_args[2].value.pdb_pointer = image_ids;
@ -187,7 +187,7 @@ list_images_invoker (Argument *args)
return return_args; return return_args;
} }
static ProcArg list_images_outargs[] = static ProcArg image_list_outargs[] =
{ {
{ {
PDB_INT32, PDB_INT32,
@ -201,9 +201,9 @@ static ProcArg list_images_outargs[] =
} }
}; };
static ProcRecord list_images_proc = static ProcRecord image_list_proc =
{ {
"gimp_list_images", "gimp_image_list",
"Returns the list of images currently open.", "Returns the list of images currently open.",
"This procedure returns the list of images currently open in the GIMP.", "This procedure returns the list of images currently open in the GIMP.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
@ -213,8 +213,8 @@ static ProcRecord list_images_proc =
0, 0,
NULL, NULL,
2, 2,
list_images_outargs, image_list_outargs,
{ { list_images_invoker } } { { image_list_invoker } }
}; };
static Argument * static Argument *
@ -1911,7 +1911,7 @@ static ProcRecord image_set_cmap_proc =
}; };
static Argument * static Argument *
image_enable_undo_invoker (Argument *args) image_undo_enable_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1924,7 +1924,7 @@ image_enable_undo_invoker (Argument *args)
if (success) if (success)
success = gimage_enable_undo (gimage); success = gimage_enable_undo (gimage);
return_args = procedural_db_return_args (&image_enable_undo_proc, success); return_args = procedural_db_return_args (&image_undo_enable_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = success ? TRUE : FALSE; return_args[1].value.pdb_int = success ? TRUE : FALSE;
@ -1932,7 +1932,7 @@ image_enable_undo_invoker (Argument *args)
return return_args; return return_args;
} }
static ProcArg image_enable_undo_inargs[] = static ProcArg image_undo_enable_inargs[] =
{ {
{ {
PDB_IMAGE, PDB_IMAGE,
@ -1941,7 +1941,7 @@ static ProcArg image_enable_undo_inargs[] =
} }
}; };
static ProcArg image_enable_undo_outargs[] = static ProcArg image_undo_enable_outargs[] =
{ {
{ {
PDB_INT32, PDB_INT32,
@ -1950,24 +1950,24 @@ static ProcArg image_enable_undo_outargs[] =
} }
}; };
static ProcRecord image_enable_undo_proc = static ProcRecord image_undo_enable_proc =
{ {
"gimp_image_enable_undo", "gimp_image_undo_enable",
"Enable the image's undo stack.", "Enable the image's undo stack.",
"This procedure enables the image's undo stack, allowing subsequent operations to store their undo steps. This is generally called in conjunction with 'gimp_image_disable_undo' to temporarily disable an image undo stack.", "This procedure enables the image's undo stack, allowing subsequent operations to store their undo steps. This is generally called in conjunction with 'gimp_image_undo_disable' to temporarily disable an image undo stack.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"1995-1996", "1995-1996",
PDB_INTERNAL, PDB_INTERNAL,
1, 1,
image_enable_undo_inargs, image_undo_enable_inargs,
1, 1,
image_enable_undo_outargs, image_undo_enable_outargs,
{ { image_enable_undo_invoker } } { { image_undo_enable_invoker } }
}; };
static Argument * static Argument *
image_disable_undo_invoker (Argument *args) image_undo_disable_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1980,7 +1980,7 @@ image_disable_undo_invoker (Argument *args)
if (success) if (success)
success = gimage_disable_undo (gimage); success = gimage_disable_undo (gimage);
return_args = procedural_db_return_args (&image_disable_undo_proc, success); return_args = procedural_db_return_args (&image_undo_disable_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = success ? TRUE : FALSE; return_args[1].value.pdb_int = success ? TRUE : FALSE;
@ -1988,7 +1988,7 @@ image_disable_undo_invoker (Argument *args)
return return_args; return return_args;
} }
static ProcArg image_disable_undo_inargs[] = static ProcArg image_undo_disable_inargs[] =
{ {
{ {
PDB_IMAGE, PDB_IMAGE,
@ -1997,7 +1997,7 @@ static ProcArg image_disable_undo_inargs[] =
} }
}; };
static ProcArg image_disable_undo_outargs[] = static ProcArg image_undo_disable_outargs[] =
{ {
{ {
PDB_INT32, PDB_INT32,
@ -2006,24 +2006,24 @@ static ProcArg image_disable_undo_outargs[] =
} }
}; };
static ProcRecord image_disable_undo_proc = static ProcRecord image_undo_disable_proc =
{ {
"gimp_image_disable_undo", "gimp_image_undo_disable",
"Disable the image's undo stack.", "Disable the image's undo stack.",
"This procedure disables the image's undo stack, allowing subsequent operations to ignore their undo steps. This is generally called in conjunction with 'gimp_image_enable_undo' to temporarily disable an image undo stack. This is advantageous because saving undo steps can be time and memory intensive.", "This procedure disables the image's undo stack, allowing subsequent operations to ignore their undo steps. This is generally called in conjunction with 'gimp_image_undo_enable' to temporarily disable an image undo stack. This is advantageous because saving undo steps can be time and memory intensive.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"1995-1996", "1995-1996",
PDB_INTERNAL, PDB_INTERNAL,
1, 1,
image_disable_undo_inargs, image_undo_disable_inargs,
1, 1,
image_disable_undo_outargs, image_undo_disable_outargs,
{ { image_disable_undo_invoker } } { { image_undo_disable_invoker } }
}; };
static Argument * static Argument *
image_freeze_undo_invoker (Argument *args) image_undo_freeze_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -2036,7 +2036,7 @@ image_freeze_undo_invoker (Argument *args)
if (success) if (success)
success = gimage_freeze_undo (gimage); success = gimage_freeze_undo (gimage);
return_args = procedural_db_return_args (&image_freeze_undo_proc, success); return_args = procedural_db_return_args (&image_undo_freeze_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = success ? TRUE : FALSE; return_args[1].value.pdb_int = success ? TRUE : FALSE;
@ -2044,7 +2044,7 @@ image_freeze_undo_invoker (Argument *args)
return return_args; return return_args;
} }
static ProcArg image_freeze_undo_inargs[] = static ProcArg image_undo_freeze_inargs[] =
{ {
{ {
PDB_IMAGE, PDB_IMAGE,
@ -2053,7 +2053,7 @@ static ProcArg image_freeze_undo_inargs[] =
} }
}; };
static ProcArg image_freeze_undo_outargs[] = static ProcArg image_undo_freeze_outargs[] =
{ {
{ {
PDB_INT32, PDB_INT32,
@ -2062,24 +2062,24 @@ static ProcArg image_freeze_undo_outargs[] =
} }
}; };
static ProcRecord image_freeze_undo_proc = static ProcRecord image_undo_freeze_proc =
{ {
"gimp_image_freeze_undo", "gimp_image_undo_freeze",
"Freeze the image's undo stack.", "Freeze the image's undo stack.",
"This procedure freezes the image's undo stack, allowing subsequent operations to ignore their undo steps. This is generally called in conjunction with 'gimp_image_thaw_undo' to temporarily disable an image undo stack. This is advantageous because saving undo steps can be time and memory intensive. 'gimp_image_{freeze,thaw}_undo' and 'gimp_image_{disable,enable}_undo' differ in that the former does not free up all undo steps when undo is thawed, so is more suited to interactive in-situ previews. It is important in this case that the image is back to the same state it was frozen in before thawing, else 'undo' behaviour is undefined.", "This procedure freezes the image's undo stack, allowing subsequent operations to ignore their undo steps. This is generally called in conjunction with 'gimp_image_undo_thaw' to temporarily disable an image undo stack. This is advantageous because saving undo steps can be time and memory intensive. 'gimp_image_undo_{freeze,thaw}' and 'gimp_image_undo_{disable,enable}' differ in that the former does not free up all undo steps when undo is thawed, so is more suited to interactive in-situ previews. It is important in this case that the image is back to the same state it was frozen in before thawing, else 'undo' behaviour is undefined.",
"Adam D. Moss", "Adam D. Moss",
"Adam D. Moss", "Adam D. Moss",
"1999", "1999",
PDB_INTERNAL, PDB_INTERNAL,
1, 1,
image_freeze_undo_inargs, image_undo_freeze_inargs,
1, 1,
image_freeze_undo_outargs, image_undo_freeze_outargs,
{ { image_freeze_undo_invoker } } { { image_undo_freeze_invoker } }
}; };
static Argument * static Argument *
image_thaw_undo_invoker (Argument *args) image_undo_thaw_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -2092,7 +2092,7 @@ image_thaw_undo_invoker (Argument *args)
if (success) if (success)
success = gimage_thaw_undo (gimage); success = gimage_thaw_undo (gimage);
return_args = procedural_db_return_args (&image_thaw_undo_proc, success); return_args = procedural_db_return_args (&image_undo_thaw_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = success ? TRUE : FALSE; return_args[1].value.pdb_int = success ? TRUE : FALSE;
@ -2100,7 +2100,7 @@ image_thaw_undo_invoker (Argument *args)
return return_args; return return_args;
} }
static ProcArg image_thaw_undo_inargs[] = static ProcArg image_undo_thaw_inargs[] =
{ {
{ {
PDB_IMAGE, PDB_IMAGE,
@ -2109,7 +2109,7 @@ static ProcArg image_thaw_undo_inargs[] =
} }
}; };
static ProcArg image_thaw_undo_outargs[] = static ProcArg image_undo_thaw_outargs[] =
{ {
{ {
PDB_INT32, PDB_INT32,
@ -2118,20 +2118,20 @@ static ProcArg image_thaw_undo_outargs[] =
} }
}; };
static ProcRecord image_thaw_undo_proc = static ProcRecord image_undo_thaw_proc =
{ {
"gimp_image_thaw_undo", "gimp_image_undo_thaw",
"Thaw the image's undo stack.", "Thaw the image's undo stack.",
"This procedure thaws the image's undo stack, allowing subsequent operations to store their undo steps. This is generally called in conjunction with 'gimp_image_disable_freeze' to temporarily freeze an image undo stack. 'gimp_image_thaw_undo' does NOT free the undo stack as 'gimp_image_enable_undo' does, so is suited for situations where one wishes to leave the undo stack in the same state in which one found it despite non-destructively playing with the image in the meantime. An example would be in-situ plugin previews. Balancing freezes and thaws and ensuring image consistancy is the responsibility of the caller.", "This procedure thaws the image's undo stack, allowing subsequent operations to store their undo steps. This is generally called in conjunction with 'gimp_image_undo_freeze' to temporarily freeze an image undo stack. 'gimp_image_undo_thaw' does NOT free the undo stack as 'gimp_image_undo_enable' does, so is suited for situations where one wishes to leave the undo stack in the same state in which one found it despite non-destructively playing with the image in the meantime. An example would be in-situ plugin previews. Balancing freezes and thaws and ensuring image consistancy is the responsibility of the caller.",
"Adam D. Moss", "Adam D. Moss",
"Adam D. Moss", "Adam D. Moss",
"1999", "1999",
PDB_INTERNAL, PDB_INTERNAL,
1, 1,
image_thaw_undo_inargs, image_undo_thaw_inargs,
1, 1,
image_thaw_undo_outargs, image_undo_thaw_outargs,
{ { image_thaw_undo_invoker } } { { image_undo_thaw_invoker } }
}; };
static Argument * static Argument *

View file

@ -31,7 +31,7 @@ image_equalize (GimpImage *gimage)
drawable = gimage_active_drawable (gimage); drawable = gimage_active_drawable (gimage);
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
{ {
g_message (_("Equalize does not operate on indexed drawables.")); g_message (_("Equalize does not operate on indexed drawables."));
return; return;

View file

@ -38,7 +38,7 @@ image_invert (GimpImage *gimage)
drawable = gimage_active_drawable (gimage); drawable = gimage_active_drawable (gimage);
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
{ {
g_message (_("Invert does not operate on indexed drawables.")); g_message (_("Invert does not operate on indexed drawables."));
return; return;

View file

@ -407,7 +407,7 @@ gimp_drawable_get_color_at (GimpDrawable *drawable,
guchar *dest; guchar *dest;
if (!drawable || if (!drawable ||
(!gimp_drawable_gimage (drawable) && gimp_drawable_indexed (drawable)) (!gimp_drawable_gimage (drawable) && gimp_drawable_is_indexed (drawable))
|| x < 0 || y < 0 || || x < 0 || y < 0 ||
x >= drawable->width || y >= drawable->height) x >= drawable->width || y >= drawable->height)
{ {
@ -423,7 +423,7 @@ gimp_drawable_get_color_at (GimpDrawable *drawable,
dest[3] = src[gimp_drawable_bytes (drawable) - 1]; dest[3] = src[gimp_drawable_bytes (drawable) - 1];
else else
dest[3] = 255; dest[3] = 255;
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
dest[4] = src[0]; dest[4] = src[0];
else else
dest[4] = 0; dest[4] = 0;
@ -432,7 +432,7 @@ gimp_drawable_get_color_at (GimpDrawable *drawable,
} }
Parasite * Parasite *
gimp_drawable_find_parasite (const GimpDrawable *drawable, gimp_drawable_parasite_find (const GimpDrawable *drawable,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (drawable->parasites, name); return parasite_list_find (drawable->parasites, name);
@ -461,7 +461,7 @@ gimp_drawable_parasite_list (GimpDrawable *drawable,
} }
void void
gimp_drawable_attach_parasite (GimpDrawable *drawable, gimp_drawable_parasite_attach (GimpDrawable *drawable,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -475,7 +475,7 @@ gimp_drawable_attach_parasite (GimpDrawable *drawable,
} }
else if (parasite_is_persistent(parasite) && else if (parasite_is_persistent(parasite) &&
!parasite_compare( parasite, !parasite_compare( parasite,
gimp_drawable_find_parasite gimp_drawable_parasite_find
(drawable, parasite_name (parasite)))) (drawable, parasite_name (parasite))))
undo_push_cantundo (drawable->gimage, _("parasite attach to drawable")); undo_push_cantundo (drawable->gimage, _("parasite attach to drawable"));
@ -483,13 +483,13 @@ gimp_drawable_attach_parasite (GimpDrawable *drawable,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_image_attach_parasite (drawable->gimage, parasite); gimp_image_parasite_attach (drawable->gimage, parasite);
} }
else if (parasite_has_flag (parasite, PARASITE_ATTACH_GRANDPARENT)) else if (parasite_has_flag (parasite, PARASITE_ATTACH_GRANDPARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
if (parasite_is_undoable (parasite)) if (parasite_is_undoable (parasite))
{ {
@ -498,7 +498,7 @@ gimp_drawable_attach_parasite (GimpDrawable *drawable,
} }
void void
gimp_drawable_detach_parasite (GimpDrawable *drawable, gimp_drawable_parasite_detach (GimpDrawable *drawable,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -532,7 +532,7 @@ gimp_drawable_color (GimpDrawable *drawable)
} }
gboolean gboolean
gimp_drawable_gray (GimpDrawable *drawable) gimp_drawable_is_gray (GimpDrawable *drawable)
{ {
if (gimp_drawable_type (drawable) == GRAYA_GIMAGE || if (gimp_drawable_type (drawable) == GRAYA_GIMAGE ||
gimp_drawable_type (drawable) == GRAY_GIMAGE) gimp_drawable_type (drawable) == GRAY_GIMAGE)
@ -542,7 +542,7 @@ gimp_drawable_gray (GimpDrawable *drawable)
} }
gboolean gboolean
gimp_drawable_indexed (GimpDrawable *drawable) gimp_drawable_is_indexed (GimpDrawable *drawable)
{ {
if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE || if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE ||
gimp_drawable_type (drawable) == INDEXED_GIMAGE) gimp_drawable_type (drawable) == INDEXED_GIMAGE)

View file

@ -51,8 +51,8 @@ gboolean gimp_drawable_has_alpha (GimpDrawable *);
GimpImageType gimp_drawable_type (GimpDrawable *); GimpImageType gimp_drawable_type (GimpDrawable *);
GimpImageType gimp_drawable_type_with_alpha (GimpDrawable *); GimpImageType gimp_drawable_type_with_alpha (GimpDrawable *);
gboolean gimp_drawable_color (GimpDrawable *); gboolean gimp_drawable_color (GimpDrawable *);
gboolean gimp_drawable_gray (GimpDrawable *); gboolean gimp_drawable_is_gray (GimpDrawable *);
gboolean gimp_drawable_indexed (GimpDrawable *); gboolean gimp_drawable_is_indexed (GimpDrawable *);
TileManager * gimp_drawable_data (GimpDrawable *); TileManager * gimp_drawable_data (GimpDrawable *);
TileManager * gimp_drawable_shadow (GimpDrawable *); TileManager * gimp_drawable_shadow (GimpDrawable *);
gint gimp_drawable_bytes (GimpDrawable *); gint gimp_drawable_bytes (GimpDrawable *);
@ -69,12 +69,10 @@ void gimp_drawable_set_name (GimpDrawable *, gchar *);
guchar * gimp_drawable_get_color_at (GimpDrawable *, guchar * gimp_drawable_get_color_at (GimpDrawable *,
gint x, gint y); gint x, gint y);
Parasite * gimp_drawable_find_parasite (const GimpDrawable *, void gimp_drawable_parasite_attach (GimpDrawable *, Parasite *);
const gchar *name); void gimp_drawable_parasite_detach (GimpDrawable *,
void gimp_drawable_attach_parasite (GimpDrawable *, Parasite *);
void gimp_drawable_detach_parasite (GimpDrawable *,
const gchar *); const gchar *);
Parasite * gimp_drawable_find_parasite (const GimpDrawable *, Parasite * gimp_drawable_parasite_find (const GimpDrawable *,
const gchar *); const gchar *);
gchar ** gimp_drawable_parasite_list (GimpDrawable *drawable, gchar ** gimp_drawable_parasite_list (GimpDrawable *drawable,
gint *count); gint *count);

View file

@ -1079,7 +1079,7 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite * Parasite *
gimp_image_find_parasite (const GimpImage *gimage, gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
return parasite_list_find (gimage->parasites, name); return parasite_list_find (gimage->parasites, name);
@ -1108,7 +1108,7 @@ gimp_image_parasite_list (GimpImage *image,
} }
void void
gimp_image_attach_parasite (GimpImage *gimage, gimp_image_parasite_attach (GimpImage *gimage,
Parasite *parasite) Parasite *parasite)
{ {
/* only set the dirty bit manually if we can be saved and the new /* only set the dirty bit manually if we can be saved and the new
@ -1117,7 +1117,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
undo_push_image_parasite (gimage, parasite); undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent (parasite) if (parasite_is_persistent (parasite)
&& !parasite_compare (parasite, && !parasite_compare (parasite,
gimp_image_find_parasite(gimage, gimp_image_parasite_find(gimage,
parasite_name(parasite)))) parasite_name(parasite))))
undo_push_cantundo (gimage, _("attach parasite to image")); undo_push_cantundo (gimage, _("attach parasite to image"));
@ -1126,12 +1126,12 @@ gimp_image_attach_parasite (GimpImage *gimage,
if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT)) if (parasite_has_flag (parasite, PARASITE_ATTACH_PARENT))
{ {
parasite_shift_parent (parasite); parasite_shift_parent (parasite);
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
} }
} }
void void
gimp_image_detach_parasite (GimpImage *gimage, gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite) const gchar *parasite)
{ {
Parasite *p; Parasite *p;
@ -3149,7 +3149,7 @@ gimp_image_filename (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_freeze_undo (GimpImage *gimage) gimp_image_undo_freeze (GimpImage *gimage)
{ {
gimage->undo_on = FALSE; gimage->undo_on = FALSE;
@ -3157,7 +3157,7 @@ gimp_image_freeze_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_thaw_undo (GimpImage *gimage) gimp_image_undo_thaw (GimpImage *gimage)
{ {
gimage->undo_on = TRUE; gimage->undo_on = TRUE;
@ -3165,18 +3165,18 @@ gimp_image_thaw_undo (GimpImage *gimage)
} }
gboolean gboolean
gimp_image_disable_undo (GimpImage *gimage) gimp_image_undo_disable (GimpImage *gimage)
{ {
return gimp_image_freeze_undo (gimage); return gimp_image_undo_freeze (gimage);
} }
gboolean gboolean
gimp_image_enable_undo (GimpImage *gimage) gimp_image_undo_enable (GimpImage *gimage)
{ {
/* Free all undo steps as they are now invalidated */ /* Free all undo steps as they are now invalidated */
undo_free (gimage); undo_free (gimage);
return gimp_image_thaw_undo (gimage); return gimp_image_undo_thaw (gimage);
} }
void void

View file

@ -160,12 +160,12 @@ void gimp_image_add_guide (GimpImage *, Guide *);
void gimp_image_remove_guide (GimpImage *, Guide *); void gimp_image_remove_guide (GimpImage *, Guide *);
void gimp_image_delete_guide (GimpImage *, Guide *); void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *, Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name); const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image, gchar ** gimp_image_parasite_list (GimpImage *image,
gint *count); gint *count);
void gimp_image_attach_parasite (GimpImage *, Parasite *); void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const gchar *); void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *); Tattoo gimp_image_get_new_tattoo (GimpImage *);
@ -248,10 +248,10 @@ GimpDrawable * gimp_image_active_drawable (GimpImage *);
GimpImageBaseType gimp_image_base_type (GimpImage *); GimpImageBaseType gimp_image_base_type (GimpImage *);
GimpImageType gimp_image_base_type_with_alpha (GimpImage *); GimpImageType gimp_image_base_type_with_alpha (GimpImage *);
gchar * gimp_image_filename (GimpImage *); gchar * gimp_image_filename (GimpImage *);
gboolean gimp_image_enable_undo (GimpImage *); gboolean gimp_image_undo_enable (GimpImage *);
gboolean gimp_image_disable_undo (GimpImage *); gboolean gimp_image_undo_disable (GimpImage *);
gboolean gimp_image_freeze_undo (GimpImage *); gboolean gimp_image_undo_freeze (GimpImage *);
gboolean gimp_image_thaw_undo (GimpImage *); gboolean gimp_image_undo_thaw (GimpImage *);
void gimp_image_undo_event (GimpImage *, int); void gimp_image_undo_event (GimpImage *, int);
gint gimp_image_dirty (GimpImage *); gint gimp_image_dirty (GimpImage *);
gint gimp_image_clean (GimpImage *); gint gimp_image_clean (GimpImage *);

View file

@ -42,19 +42,19 @@ gimp_init_parasites()
} }
void void
gimp_attach_parasite (Parasite *p) gimp_parasite_attach (Parasite *p)
{ {
parasite_list_add(parasites, p); parasite_list_add(parasites, p);
} }
void void
gimp_detach_parasite (const char *name) gimp_parasite_detach (const char *name)
{ {
parasite_list_remove(parasites, name); parasite_list_remove(parasites, name);
} }
Parasite * Parasite *
gimp_find_parasite (const char *name) gimp_parasite_find (const char *name)
{ {
return parasite_list_find(parasites, name); return parasite_list_find(parasites, name);
} }

View file

@ -21,9 +21,9 @@
#include "libgimp/parasiteF.h" #include "libgimp/parasiteF.h"
void gimp_init_parasites (void); void gimp_init_parasites (void);
void gimp_attach_parasite (Parasite *p); void gimp_parasite_attach (Parasite *p);
void gimp_detach_parasite (const char *name); void gimp_parasite_detach (const char *name);
Parasite * gimp_find_parasite (const char *name); Parasite * gimp_parasite_find (const char *name);
char ** gimp_parasite_list (gint *count); char ** gimp_parasite_list (gint *count);
void gimp_parasiterc_save (void); void gimp_parasiterc_save (void);
void gimp_parasiterc_load (void); void gimp_parasiterc_load (void);

View file

@ -2315,7 +2315,7 @@ parse_parasite (gpointer val1p,
if (token != TOKEN_STRING) if (token != TOKEN_STRING)
goto error; goto error;
gimp_attach_parasite (parasite_new (identifier, flags, token_int, token_str)); gimp_parasite_attach (parasite_new (identifier, flags, token_int, token_str));
token = get_next_token (); token = get_next_token ();
if (token != TOKEN_RIGHT_PAREN) if (token != TOKEN_RIGHT_PAREN)

View file

@ -74,6 +74,7 @@ typedef enum
{ {
GRAD_IMPORT = 0, GRAD_IMPORT = 0,
IMAGE_IMPORT = 1, IMAGE_IMPORT = 1,
INDEXED_IMPORT = 2,
} ImportType; } ImportType;
typedef struct _ImportDialog ImportDialog; typedef struct _ImportDialog ImportDialog;
@ -87,6 +88,7 @@ struct _ImportDialog
GtkWidget *select; GtkWidget *select;
GtkWidget *image_list; GtkWidget *image_list;
GtkWidget *image_menu_item_image; GtkWidget *image_menu_item_image;
GtkWidget *image_menu_item_indexed;
GtkWidget *image_menu_item_gradient; GtkWidget *image_menu_item_gradient;
GtkWidget *optionmenu1_menu; GtkWidget *optionmenu1_menu;
GtkWidget *type_option; GtkWidget *type_option;
@ -151,6 +153,9 @@ static void palette_scroll_top_left (PaletteDialog *palette);
static ImportDialog * palette_import_dialog (PaletteDialog *palette); static ImportDialog * palette_import_dialog (PaletteDialog *palette);
static void palette_import_dialog_callback (GtkWidget *, gpointer); static void palette_import_dialog_callback (GtkWidget *, gpointer);
static void import_palette_create_from_indexed (GImage *gimage,
guchar *pname,
PaletteDialog *palette);
static void import_palette_create_from_image (GImage *gimage, static void import_palette_create_from_image (GImage *gimage,
guchar *pname, guchar *pname,
PaletteDialog *palette); PaletteDialog *palette);
@ -2420,6 +2425,10 @@ import_dialog_import_callback (GtkWidget *widget,
import_palette_create_from_image (import_dialog->gimage, import_palette_create_from_image (import_dialog->gimage,
pname, palette); pname, palette);
break; break;
case INDEXED_IMPORT:
import_palette_create_from_indexed (import_dialog->gimage,
pname, palette);
break;
default: default:
break; break;
} }
@ -2589,6 +2598,19 @@ gimlist_cb (gpointer im,
*l = g_slist_prepend (*l, im); *l = g_slist_prepend (*l, im);
} }
static void
gimlist_indexed_cb (gpointer im,
gpointer data)
{
GimpImage *gimage = GIMP_IMAGE (im);
GSList** l;
if (gimage_base_type (gimage) == INDEXED) {
l = (GSList**) data;
*l = g_slist_prepend (*l, im);
}
}
static void static void
import_image_update_image_preview (GimpImage *gimage) import_image_update_image_preview (GimpImage *gimage)
{ {
@ -2690,7 +2712,7 @@ import_image_menu_add (GimpImage *gimage)
/* Last Param gives us control over what goes in the menu on a delete oper */ /* Last Param gives us control over what goes in the menu on a delete oper */
static void static void
import_image_menu_activate (gint redo, import_image_menu_activate (gint redo, ImportType type,
GimpImage *del_image) GimpImage *del_image)
{ {
GSList *list=NULL; GSList *list=NULL;
@ -2701,105 +2723,123 @@ import_image_menu_activate (gint redo,
gint count = 0; gint count = 0;
gchar *lab; gchar *lab;
if (import_dialog) if (!import_dialog)
return;
if (import_dialog->import_type == type && !redo)
return;
/* Destroy existing widget if necessary */
if (import_dialog->image_list)
{ {
if (import_dialog->import_type == IMAGE_IMPORT) if (redo) /* Preserve settings in this case */
{ last_img = import_dialog->gimage;
if (!redo) gtk_widget_hide (import_dialog->image_list);
return; gtk_widget_destroy (import_dialog->image_list);
else import_dialog->image_list = NULL;
{ }
if (import_dialog->image_list)
{
last_img = import_dialog->gimage;
gtk_widget_hide (import_dialog->image_list);
gtk_widget_destroy (import_dialog->image_list);
import_dialog->image_list = NULL;
}
}
}
import_dialog->import_type = IMAGE_IMPORT;
/* Get list of images */ import_dialog->import_type= type;
/* Get list of images */
if (import_dialog->import_type == INDEXED_IMPORT)
{
gimage_foreach (gimlist_indexed_cb, &list);
}
else
{
gimage_foreach (gimlist_cb, &list); gimage_foreach (gimlist_cb, &list);
num_images = g_slist_length (list); }
num_images = g_slist_length (list);
if (num_images) if (num_images)
{ {
gint i; gint i;
GtkWidget *optionmenu1; GtkWidget *optionmenu1;
GtkWidget *optionmenu1_menu; GtkWidget *optionmenu1_menu;
import_dialog->image_list = optionmenu1 = gtk_option_menu_new (); import_dialog->image_list = optionmenu1 = gtk_option_menu_new ();
gtk_widget_set_usize (optionmenu1, IMPORT_PREVIEW_WIDTH, -1); gtk_widget_set_usize (optionmenu1, IMPORT_PREVIEW_WIDTH, -1);
import_dialog->optionmenu1_menu = optionmenu1_menu = gtk_menu_new (); import_dialog->optionmenu1_menu = optionmenu1_menu = gtk_menu_new ();
for (i = 0; i < num_images; i++, list = g_slist_next (list)) for (i = 0; i < num_images; i++, list = g_slist_next (list))
{ {
if (GIMP_IMAGE (list->data) != del_image) if (GIMP_IMAGE (list->data) != del_image)
{ {
if (first_img == NULL) if (first_img == NULL)
first_img = GIMP_IMAGE (list->data); first_img = GIMP_IMAGE (list->data);
import_image_menu_add (GIMP_IMAGE (list->data)); import_image_menu_add (GIMP_IMAGE (list->data));
if (last_img == GIMP_IMAGE (list->data)) if (last_img == GIMP_IMAGE (list->data))
act_num = count; act_num = count;
else else
count++; count++;
}
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu1),
optionmenu1_menu);
gtk_widget_hide (import_dialog->select);
gtk_box_pack_start (GTK_BOX (import_dialog->select_area),
optionmenu1, FALSE, FALSE, 0);
if(last_img != NULL && last_img != del_image)
import_image_update_image_preview (last_img);
else if (first_img != NULL)
import_image_update_image_preview (first_img);
gtk_widget_show (optionmenu1);
/* reset to last one */
if(redo && act_num >= 0)
{
gchar *lab =
g_strdup_printf ("%s-%d",
g_basename (gimage_filename (import_dialog->gimage)),
pdb_image_to_id (import_dialog->gimage));
gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu1), act_num);
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab);
} }
} }
g_slist_free (list);
lab = gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu1),
g_strdup_printf ("%s-%d", optionmenu1_menu);
gtk_widget_hide (import_dialog->select);
gtk_box_pack_start (GTK_BOX (import_dialog->select_area),
optionmenu1, FALSE, FALSE, 0);
if(last_img != NULL && last_img != del_image)
import_image_update_image_preview (last_img);
else if (first_img != NULL)
import_image_update_image_preview (first_img);
gtk_widget_show (optionmenu1);
/* reset to last one */
if (redo && act_num >= 0)
{
gchar *lab = g_strdup_printf ("%s-%d",
g_basename (gimage_filename (import_dialog->gimage)), g_basename (gimage_filename (import_dialog->gimage)),
pdb_image_to_id (import_dialog->gimage)); pdb_image_to_id (import_dialog->gimage));
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab); gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu1), act_num);
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab);
}
} }
g_slist_free (list);
lab = g_strdup_printf ("%s-%d",
g_basename (gimage_filename (import_dialog->gimage)),
pdb_image_to_id (import_dialog->gimage));
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab);
} }
static void static void
import_image_callback (GtkWidget *widget, import_image_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
import_image_menu_activate (FALSE, NULL); import_image_menu_activate (FALSE, IMAGE_IMPORT, NULL);
gtk_widget_set_sensitive (import_dialog->threshold_scale, TRUE); gtk_widget_set_sensitive (import_dialog->threshold_scale, TRUE);
gtk_widget_set_sensitive (import_dialog->threshold_text, TRUE); gtk_widget_set_sensitive (import_dialog->threshold_text, TRUE);
} }
static void
import_indexed_callback (GtkWidget *widget,
gpointer data)
{
import_image_menu_activate (FALSE, INDEXED_IMPORT, NULL);
gtk_widget_set_sensitive (import_dialog->threshold_scale, FALSE);
gtk_widget_set_sensitive (import_dialog->threshold_text, FALSE);
}
static gint static gint
image_count () image_count (ImportType type)
{ {
GSList *list=NULL; GSList *list=NULL;
gint num_images = 0; gint num_images = 0;
gimage_foreach (gimlist_cb, &list); if (type == INDEXED_IMPORT) {
gimage_foreach (gimlist_indexed_cb, &list);
} else {
gimage_foreach (gimlist_cb, &list);
}
num_images = g_slist_length (list); num_images = g_slist_length (list);
g_slist_free (list); g_slist_free (list);
@ -2903,9 +2943,18 @@ palette_import_dialog (PaletteDialog *palette)
(gpointer) import_dialog); (gpointer) import_dialog);
gtk_menu_append (GTK_MENU (optionmenu_menu), menuitem); gtk_menu_append (GTK_MENU (optionmenu_menu), menuitem);
gtk_widget_show (menuitem); gtk_widget_show (menuitem);
gtk_widget_set_sensitive (menuitem, image_count(IMAGE_IMPORT) > 0);
menuitem = import_dialog->image_menu_item_indexed =
gtk_menu_item_new_with_label ("Indexed Palette");
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
(GtkSignalFunc) import_indexed_callback,
(gpointer) import_dialog);
gtk_menu_append (GTK_MENU (optionmenu_menu), menuitem);
gtk_widget_show (menuitem);
gtk_widget_set_sensitive (menuitem, image_count(INDEXED_IMPORT) > 0);
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), optionmenu_menu); gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), optionmenu_menu);
gtk_widget_set_sensitive (menuitem, image_count() > 0);
gtk_widget_show (optionmenu); gtk_widget_show (optionmenu);
/* The sample size */ /* The sample size */
@ -2985,10 +3034,18 @@ palette_import_image_new (GimpImage * gimage)
return; return;
} }
/* Now fill in the names if image menu shown */ if (!GTK_WIDGET_IS_SENSITIVE (import_dialog->image_menu_item_indexed) &&
if (import_dialog->import_type == IMAGE_IMPORT) gimage_base_type(gimage) == INDEXED)
{ {
import_image_menu_activate (TRUE, NULL); gtk_widget_set_sensitive (import_dialog->image_menu_item_indexed, TRUE);
return;
}
/* Now fill in the names if image menu shown */
if (import_dialog->import_type == IMAGE_IMPORT ||
import_dialog->import_type == INDEXED_IMPORT)
{
import_image_menu_activate (TRUE, import_dialog->import_type, NULL);
} }
} }
@ -3000,7 +3057,7 @@ palette_import_image_destroyed (GimpImage* gimage)
if (!import_dialog) if (!import_dialog)
return; return;
if (image_count() <= 1) if (image_count(import_dialog->import_type) <= 1)
{ {
/* Back to gradient type */ /* Back to gradient type */
gtk_option_menu_set_history (GTK_OPTION_MENU (import_dialog->type_option), 0); gtk_option_menu_set_history (GTK_OPTION_MENU (import_dialog->type_option), 0);
@ -3010,9 +3067,10 @@ palette_import_image_destroyed (GimpImage* gimage)
return; return;
} }
if (import_dialog->import_type == IMAGE_IMPORT) if (import_dialog->import_type == IMAGE_IMPORT ||
import_dialog->import_type == INDEXED_IMPORT)
{ {
import_image_menu_activate (TRUE, gimage); import_image_menu_activate (TRUE, import_dialog->import_type, gimage);
} }
} }
@ -3020,9 +3078,10 @@ void
palette_import_image_renamed (GimpImage* gimage) palette_import_image_renamed (GimpImage* gimage)
{ {
/* Now fill in the names if image menu shown */ /* Now fill in the names if image menu shown */
if(import_dialog && import_dialog->import_type == IMAGE_IMPORT) if (import_dialog && (import_dialog->import_type == IMAGE_IMPORT ||
import_dialog->import_type == INDEXED_IMPORT))
{ {
import_image_menu_activate (TRUE, NULL); import_image_menu_activate (TRUE, import_dialog->import_type, NULL);
} }
} }
@ -3279,3 +3338,38 @@ import_palette_create_from_image (GImage *gimage,
/* Make palette from the store_array */ /* Make palette from the store_array */
import_image_make_palette (store_array, pname, palette); import_image_make_palette (store_array, pname, palette);
} }
static void
import_palette_create_from_indexed (GImage *gimage,
guchar *pname,
PaletteDialog *palette)
{
gint samples, count;
PaletteEntriesP entries;
samples = (gint) import_dialog->sample->value;
if (gimage == NULL)
return;
if (gimage_base_type (gimage) != INDEXED)
return;
entries= palette_create_entries (palette, pname);
for (count= 0; count < samples && count < gimage->num_cols; ++count)
{
palette_add_entry (entries, NULL, gimage->cmap[count*3],
gimage->cmap[count*3+1],
gimage->cmap[count*3+2]);
}
/* Redraw with new palette */
palette_update_small_preview (palette);
redraw_palette (palette);
/* Update other selectors on screen */
palette_select_clist_insert_all (entries);
palette_select2_clist_insert_all (entries);
palette_scroll_clist_to_current (palette);
}

View file

@ -320,7 +320,7 @@ image_map_get_color_at (ImageMap image_map, int x, int y)
if (!image_map || if (!image_map ||
(!gimp_drawable_gimage(_image_map->drawable) && (!gimp_drawable_gimage(_image_map->drawable) &&
gimp_drawable_indexed(_image_map->drawable)) || gimp_drawable_is_indexed(_image_map->drawable)) ||
x < 0 || y < 0 || x < 0 || y < 0 ||
x >= _image_map->undo_tiles->width || x >= _image_map->undo_tiles->width ||
y >= _image_map->undo_tiles->height) y >= _image_map->undo_tiles->height)
@ -342,7 +342,7 @@ image_map_get_color_at (ImageMap image_map, int x, int y)
dest[3] = src[gimp_drawable_bytes (_image_map->drawable) - 1]; dest[3] = src[gimp_drawable_bytes (_image_map->drawable) - 1];
else else
dest[3] = 255; dest[3] = 255;
if (gimp_drawable_indexed(_image_map->drawable)) if (gimp_drawable_is_indexed(_image_map->drawable))
dest[4] = src[0]; dest[4] = src[0];
else else
dest[4] = 0; dest[4] = 0;

View file

@ -226,9 +226,9 @@ image_new_create_image (const GimpImageNewValues *values)
if (layer) if (layer)
{ {
/* add the new layer to the gimage */ /* add the new layer to the gimage */
gimp_image_disable_undo (image); gimp_image_undo_disable (image);
gimp_image_add_layer (image, layer, 0); gimp_image_add_layer (image, layer, 0);
gimp_image_enable_undo (image); gimp_image_undo_enable (image);
drawable_fill (GIMP_DRAWABLE (layer), values->fill_type); drawable_fill (GIMP_DRAWABLE (layer), values->fill_type);

View file

@ -38,7 +38,7 @@ image_invert (GimpImage *gimage)
drawable = gimage_active_drawable (gimage); drawable = gimage_active_drawable (gimage);
if (gimp_drawable_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
{ {
g_message (_("Invert does not operate on indexed drawables.")); g_message (_("Invert does not operate on indexed drawables."));
return; return;

View file

@ -74,6 +74,7 @@ typedef enum
{ {
GRAD_IMPORT = 0, GRAD_IMPORT = 0,
IMAGE_IMPORT = 1, IMAGE_IMPORT = 1,
INDEXED_IMPORT = 2,
} ImportType; } ImportType;
typedef struct _ImportDialog ImportDialog; typedef struct _ImportDialog ImportDialog;
@ -87,6 +88,7 @@ struct _ImportDialog
GtkWidget *select; GtkWidget *select;
GtkWidget *image_list; GtkWidget *image_list;
GtkWidget *image_menu_item_image; GtkWidget *image_menu_item_image;
GtkWidget *image_menu_item_indexed;
GtkWidget *image_menu_item_gradient; GtkWidget *image_menu_item_gradient;
GtkWidget *optionmenu1_menu; GtkWidget *optionmenu1_menu;
GtkWidget *type_option; GtkWidget *type_option;
@ -151,6 +153,9 @@ static void palette_scroll_top_left (PaletteDialog *palette);
static ImportDialog * palette_import_dialog (PaletteDialog *palette); static ImportDialog * palette_import_dialog (PaletteDialog *palette);
static void palette_import_dialog_callback (GtkWidget *, gpointer); static void palette_import_dialog_callback (GtkWidget *, gpointer);
static void import_palette_create_from_indexed (GImage *gimage,
guchar *pname,
PaletteDialog *palette);
static void import_palette_create_from_image (GImage *gimage, static void import_palette_create_from_image (GImage *gimage,
guchar *pname, guchar *pname,
PaletteDialog *palette); PaletteDialog *palette);
@ -2420,6 +2425,10 @@ import_dialog_import_callback (GtkWidget *widget,
import_palette_create_from_image (import_dialog->gimage, import_palette_create_from_image (import_dialog->gimage,
pname, palette); pname, palette);
break; break;
case INDEXED_IMPORT:
import_palette_create_from_indexed (import_dialog->gimage,
pname, palette);
break;
default: default:
break; break;
} }
@ -2589,6 +2598,19 @@ gimlist_cb (gpointer im,
*l = g_slist_prepend (*l, im); *l = g_slist_prepend (*l, im);
} }
static void
gimlist_indexed_cb (gpointer im,
gpointer data)
{
GimpImage *gimage = GIMP_IMAGE (im);
GSList** l;
if (gimage_base_type (gimage) == INDEXED) {
l = (GSList**) data;
*l = g_slist_prepend (*l, im);
}
}
static void static void
import_image_update_image_preview (GimpImage *gimage) import_image_update_image_preview (GimpImage *gimage)
{ {
@ -2690,7 +2712,7 @@ import_image_menu_add (GimpImage *gimage)
/* Last Param gives us control over what goes in the menu on a delete oper */ /* Last Param gives us control over what goes in the menu on a delete oper */
static void static void
import_image_menu_activate (gint redo, import_image_menu_activate (gint redo, ImportType type,
GimpImage *del_image) GimpImage *del_image)
{ {
GSList *list=NULL; GSList *list=NULL;
@ -2701,105 +2723,123 @@ import_image_menu_activate (gint redo,
gint count = 0; gint count = 0;
gchar *lab; gchar *lab;
if (import_dialog) if (!import_dialog)
return;
if (import_dialog->import_type == type && !redo)
return;
/* Destroy existing widget if necessary */
if (import_dialog->image_list)
{ {
if (import_dialog->import_type == IMAGE_IMPORT) if (redo) /* Preserve settings in this case */
{ last_img = import_dialog->gimage;
if (!redo) gtk_widget_hide (import_dialog->image_list);
return; gtk_widget_destroy (import_dialog->image_list);
else import_dialog->image_list = NULL;
{ }
if (import_dialog->image_list)
{
last_img = import_dialog->gimage;
gtk_widget_hide (import_dialog->image_list);
gtk_widget_destroy (import_dialog->image_list);
import_dialog->image_list = NULL;
}
}
}
import_dialog->import_type = IMAGE_IMPORT;
/* Get list of images */ import_dialog->import_type= type;
/* Get list of images */
if (import_dialog->import_type == INDEXED_IMPORT)
{
gimage_foreach (gimlist_indexed_cb, &list);
}
else
{
gimage_foreach (gimlist_cb, &list); gimage_foreach (gimlist_cb, &list);
num_images = g_slist_length (list); }
num_images = g_slist_length (list);
if (num_images) if (num_images)
{ {
gint i; gint i;
GtkWidget *optionmenu1; GtkWidget *optionmenu1;
GtkWidget *optionmenu1_menu; GtkWidget *optionmenu1_menu;
import_dialog->image_list = optionmenu1 = gtk_option_menu_new (); import_dialog->image_list = optionmenu1 = gtk_option_menu_new ();
gtk_widget_set_usize (optionmenu1, IMPORT_PREVIEW_WIDTH, -1); gtk_widget_set_usize (optionmenu1, IMPORT_PREVIEW_WIDTH, -1);
import_dialog->optionmenu1_menu = optionmenu1_menu = gtk_menu_new (); import_dialog->optionmenu1_menu = optionmenu1_menu = gtk_menu_new ();
for (i = 0; i < num_images; i++, list = g_slist_next (list)) for (i = 0; i < num_images; i++, list = g_slist_next (list))
{ {
if (GIMP_IMAGE (list->data) != del_image) if (GIMP_IMAGE (list->data) != del_image)
{ {
if (first_img == NULL) if (first_img == NULL)
first_img = GIMP_IMAGE (list->data); first_img = GIMP_IMAGE (list->data);
import_image_menu_add (GIMP_IMAGE (list->data)); import_image_menu_add (GIMP_IMAGE (list->data));
if (last_img == GIMP_IMAGE (list->data)) if (last_img == GIMP_IMAGE (list->data))
act_num = count; act_num = count;
else else
count++; count++;
}
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu1),
optionmenu1_menu);
gtk_widget_hide (import_dialog->select);
gtk_box_pack_start (GTK_BOX (import_dialog->select_area),
optionmenu1, FALSE, FALSE, 0);
if(last_img != NULL && last_img != del_image)
import_image_update_image_preview (last_img);
else if (first_img != NULL)
import_image_update_image_preview (first_img);
gtk_widget_show (optionmenu1);
/* reset to last one */
if(redo && act_num >= 0)
{
gchar *lab =
g_strdup_printf ("%s-%d",
g_basename (gimage_filename (import_dialog->gimage)),
pdb_image_to_id (import_dialog->gimage));
gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu1), act_num);
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab);
} }
} }
g_slist_free (list);
lab = gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu1),
g_strdup_printf ("%s-%d", optionmenu1_menu);
gtk_widget_hide (import_dialog->select);
gtk_box_pack_start (GTK_BOX (import_dialog->select_area),
optionmenu1, FALSE, FALSE, 0);
if(last_img != NULL && last_img != del_image)
import_image_update_image_preview (last_img);
else if (first_img != NULL)
import_image_update_image_preview (first_img);
gtk_widget_show (optionmenu1);
/* reset to last one */
if (redo && act_num >= 0)
{
gchar *lab = g_strdup_printf ("%s-%d",
g_basename (gimage_filename (import_dialog->gimage)), g_basename (gimage_filename (import_dialog->gimage)),
pdb_image_to_id (import_dialog->gimage)); pdb_image_to_id (import_dialog->gimage));
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab); gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu1), act_num);
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab);
}
} }
g_slist_free (list);
lab = g_strdup_printf ("%s-%d",
g_basename (gimage_filename (import_dialog->gimage)),
pdb_image_to_id (import_dialog->gimage));
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab);
} }
static void static void
import_image_callback (GtkWidget *widget, import_image_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
import_image_menu_activate (FALSE, NULL); import_image_menu_activate (FALSE, IMAGE_IMPORT, NULL);
gtk_widget_set_sensitive (import_dialog->threshold_scale, TRUE); gtk_widget_set_sensitive (import_dialog->threshold_scale, TRUE);
gtk_widget_set_sensitive (import_dialog->threshold_text, TRUE); gtk_widget_set_sensitive (import_dialog->threshold_text, TRUE);
} }
static void
import_indexed_callback (GtkWidget *widget,
gpointer data)
{
import_image_menu_activate (FALSE, INDEXED_IMPORT, NULL);
gtk_widget_set_sensitive (import_dialog->threshold_scale, FALSE);
gtk_widget_set_sensitive (import_dialog->threshold_text, FALSE);
}
static gint static gint
image_count () image_count (ImportType type)
{ {
GSList *list=NULL; GSList *list=NULL;
gint num_images = 0; gint num_images = 0;
gimage_foreach (gimlist_cb, &list); if (type == INDEXED_IMPORT) {
gimage_foreach (gimlist_indexed_cb, &list);
} else {
gimage_foreach (gimlist_cb, &list);
}
num_images = g_slist_length (list); num_images = g_slist_length (list);
g_slist_free (list); g_slist_free (list);
@ -2903,9 +2943,18 @@ palette_import_dialog (PaletteDialog *palette)
(gpointer) import_dialog); (gpointer) import_dialog);
gtk_menu_append (GTK_MENU (optionmenu_menu), menuitem); gtk_menu_append (GTK_MENU (optionmenu_menu), menuitem);
gtk_widget_show (menuitem); gtk_widget_show (menuitem);
gtk_widget_set_sensitive (menuitem, image_count(IMAGE_IMPORT) > 0);
menuitem = import_dialog->image_menu_item_indexed =
gtk_menu_item_new_with_label ("Indexed Palette");
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
(GtkSignalFunc) import_indexed_callback,
(gpointer) import_dialog);
gtk_menu_append (GTK_MENU (optionmenu_menu), menuitem);
gtk_widget_show (menuitem);
gtk_widget_set_sensitive (menuitem, image_count(INDEXED_IMPORT) > 0);
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), optionmenu_menu); gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), optionmenu_menu);
gtk_widget_set_sensitive (menuitem, image_count() > 0);
gtk_widget_show (optionmenu); gtk_widget_show (optionmenu);
/* The sample size */ /* The sample size */
@ -2985,10 +3034,18 @@ palette_import_image_new (GimpImage * gimage)
return; return;
} }
/* Now fill in the names if image menu shown */ if (!GTK_WIDGET_IS_SENSITIVE (import_dialog->image_menu_item_indexed) &&
if (import_dialog->import_type == IMAGE_IMPORT) gimage_base_type(gimage) == INDEXED)
{ {
import_image_menu_activate (TRUE, NULL); gtk_widget_set_sensitive (import_dialog->image_menu_item_indexed, TRUE);
return;
}
/* Now fill in the names if image menu shown */
if (import_dialog->import_type == IMAGE_IMPORT ||
import_dialog->import_type == INDEXED_IMPORT)
{
import_image_menu_activate (TRUE, import_dialog->import_type, NULL);
} }
} }
@ -3000,7 +3057,7 @@ palette_import_image_destroyed (GimpImage* gimage)
if (!import_dialog) if (!import_dialog)
return; return;
if (image_count() <= 1) if (image_count(import_dialog->import_type) <= 1)
{ {
/* Back to gradient type */ /* Back to gradient type */
gtk_option_menu_set_history (GTK_OPTION_MENU (import_dialog->type_option), 0); gtk_option_menu_set_history (GTK_OPTION_MENU (import_dialog->type_option), 0);
@ -3010,9 +3067,10 @@ palette_import_image_destroyed (GimpImage* gimage)
return; return;
} }
if (import_dialog->import_type == IMAGE_IMPORT) if (import_dialog->import_type == IMAGE_IMPORT ||
import_dialog->import_type == INDEXED_IMPORT)
{ {
import_image_menu_activate (TRUE, gimage); import_image_menu_activate (TRUE, import_dialog->import_type, gimage);
} }
} }
@ -3020,9 +3078,10 @@ void
palette_import_image_renamed (GimpImage* gimage) palette_import_image_renamed (GimpImage* gimage)
{ {
/* Now fill in the names if image menu shown */ /* Now fill in the names if image menu shown */
if(import_dialog && import_dialog->import_type == IMAGE_IMPORT) if (import_dialog && (import_dialog->import_type == IMAGE_IMPORT ||
import_dialog->import_type == INDEXED_IMPORT))
{ {
import_image_menu_activate (TRUE, NULL); import_image_menu_activate (TRUE, import_dialog->import_type, NULL);
} }
} }
@ -3279,3 +3338,38 @@ import_palette_create_from_image (GImage *gimage,
/* Make palette from the store_array */ /* Make palette from the store_array */
import_image_make_palette (store_array, pname, palette); import_image_make_palette (store_array, pname, palette);
} }
static void
import_palette_create_from_indexed (GImage *gimage,
guchar *pname,
PaletteDialog *palette)
{
gint samples, count;
PaletteEntriesP entries;
samples = (gint) import_dialog->sample->value;
if (gimage == NULL)
return;
if (gimage_base_type (gimage) != INDEXED)
return;
entries= palette_create_entries (palette, pname);
for (count= 0; count < samples && count < gimage->num_cols; ++count)
{
palette_add_entry (entries, NULL, gimage->cmap[count*3],
gimage->cmap[count*3+1],
gimage->cmap[count*3+2]);
}
/* Redraw with new palette */
palette_update_small_preview (palette);
redraw_palette (palette);
/* Update other selectors on screen */
palette_select_clist_insert_all (entries);
palette_select2_clist_insert_all (entries);
palette_scroll_clist_to_current (palette);
}

View file

@ -155,7 +155,7 @@ find_parasite_invoker (Argument *args)
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
parasite = parasite_copy (gimp_find_parasite (name)); parasite = parasite_copy (gimp_parasite_find (name));
success = parasite != NULL; success = parasite != NULL;
return_args = procedural_db_return_args (&find_parasite_proc, success); return_args = procedural_db_return_args (&find_parasite_proc, success);
@ -211,7 +211,7 @@ attach_parasite_invoker (Argument *args)
success = FALSE; success = FALSE;
if (success) if (success)
gimp_attach_parasite (parasite); gimp_parasite_attach (parasite);
return procedural_db_return_args (&attach_parasite_proc, success); return procedural_db_return_args (&attach_parasite_proc, success);
} }
@ -252,7 +252,7 @@ detach_parasite_invoker (Argument *args)
success = FALSE; success = FALSE;
if (success) if (success)
gimp_detach_parasite (name); gimp_parasite_detach (name);
return procedural_db_return_args (&detach_parasite_proc, success); return procedural_db_return_args (&detach_parasite_proc, success);
} }
@ -346,7 +346,7 @@ drawable_find_parasite_invoker (Argument *args)
if (success) if (success)
{ {
parasite = parasite_copy (gimp_drawable_find_parasite (drawable, name)); parasite = parasite_copy (gimp_drawable_parasite_find (drawable, name));
success = parasite != NULL; success = parasite != NULL;
} }
@ -413,7 +413,7 @@ drawable_attach_parasite_invoker (Argument *args)
success = FALSE; success = FALSE;
if (success) if (success)
gimp_drawable_attach_parasite (drawable, parasite); gimp_drawable_parasite_attach (drawable, parasite);
return procedural_db_return_args (&drawable_attach_parasite_proc, success); return procedural_db_return_args (&drawable_attach_parasite_proc, success);
} }
@ -464,7 +464,7 @@ drawable_detach_parasite_invoker (Argument *args)
success = FALSE; success = FALSE;
if (success) if (success)
gimp_drawable_detach_parasite (drawable, name); gimp_drawable_parasite_detach (drawable, name);
return procedural_db_return_args (&drawable_detach_parasite_proc, success); return procedural_db_return_args (&drawable_detach_parasite_proc, success);
} }
@ -582,7 +582,7 @@ image_find_parasite_invoker (Argument *args)
if (success) if (success)
{ {
parasite = parasite_copy (gimp_image_find_parasite (gimage, name)); parasite = parasite_copy (gimp_image_parasite_find (gimage, name));
success = parasite != NULL; success = parasite != NULL;
} }
@ -649,7 +649,7 @@ image_attach_parasite_invoker (Argument *args)
success = FALSE; success = FALSE;
if (success) if (success)
gimp_image_attach_parasite (gimage, parasite); gimp_image_parasite_attach (gimage, parasite);
return procedural_db_return_args (&image_attach_parasite_proc, success); return procedural_db_return_args (&image_attach_parasite_proc, success);
} }
@ -700,7 +700,7 @@ image_detach_parasite_invoker (Argument *args)
success = FALSE; success = FALSE;
if (success) if (success)
gimp_image_detach_parasite (gimage, name); gimp_image_parasite_detach (gimage, name);
return procedural_db_return_args (&image_detach_parasite_proc, success); return procedural_db_return_args (&image_detach_parasite_proc, success);
} }

View file

@ -487,7 +487,7 @@ pick_color_do (GimpImage *gimage,
y -= offy; y -= offy;
sample_type = gimp_drawable_type (drawable); sample_type = gimp_drawable_type (drawable);
is_indexed = gimp_drawable_indexed (drawable); is_indexed = gimp_drawable_is_indexed (drawable);
get_color_func = (GetColorFunc) gimp_drawable_get_color_at; get_color_func = (GetColorFunc) gimp_drawable_get_color_at;
get_color_obj = GTK_OBJECT (drawable); get_color_obj = GTK_OBJECT (drawable);

View file

@ -189,7 +189,7 @@ curves_colour_update (Tool *tool,
return; return;
sample_type = gimp_drawable_type(drawable); sample_type = gimp_drawable_type(drawable);
is_indexed = gimp_drawable_indexed (drawable); is_indexed = gimp_drawable_is_indexed (drawable);
has_alpha = TYPE_HAS_ALPHA(sample_type); has_alpha = TYPE_HAS_ALPHA(sample_type);
curves_dialog->col_value[HISTOGRAM_RED] = color[RED_PIX]; curves_dialog->col_value[HISTOGRAM_RED] = color[RED_PIX];

View file

@ -189,7 +189,7 @@ curves_colour_update (Tool *tool,
return; return;
sample_type = gimp_drawable_type(drawable); sample_type = gimp_drawable_type(drawable);
is_indexed = gimp_drawable_indexed (drawable); is_indexed = gimp_drawable_is_indexed (drawable);
has_alpha = TYPE_HAS_ALPHA(sample_type); has_alpha = TYPE_HAS_ALPHA(sample_type);
curves_dialog->col_value[HISTOGRAM_RED] = color[RED_PIX]; curves_dialog->col_value[HISTOGRAM_RED] = color[RED_PIX];

View file

@ -2446,7 +2446,7 @@ undo_push_image_parasite (GImage *gimage,
data->gimage = gimage; data->gimage = gimage;
data->drawable = NULL; data->drawable = NULL;
data->name = g_strdup (parasite_name (parasite)); data->name = g_strdup (parasite_name (parasite));
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->name)); data->parasite = parasite_copy (gimp_image_parasite_find (gimage, data->name));
return TRUE; return TRUE;
} }
@ -2474,7 +2474,7 @@ undo_push_image_parasite_remove (GImage *gimage,
data->gimage = gimage; data->gimage = gimage;
data->drawable = NULL; data->drawable = NULL;
data->name = g_strdup (name); data->name = g_strdup (name);
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->name)); data->parasite = parasite_copy (gimp_image_parasite_find (gimage, data->name));
return TRUE; return TRUE;
} }
@ -2503,7 +2503,7 @@ undo_push_drawable_parasite (GImage *gimage,
data->gimage = NULL; data->gimage = NULL;
data->drawable = drawable; data->drawable = drawable;
data->name = g_strdup (parasite_name (parasite)); data->name = g_strdup (parasite_name (parasite));
data->parasite = parasite_copy (gimp_drawable_find_parasite (drawable, data->name)); data->parasite = parasite_copy (gimp_drawable_parasite_find (drawable, data->name));
return TRUE; return TRUE;
} }
@ -2531,7 +2531,7 @@ undo_push_drawable_parasite_remove (GImage *gimage,
data->gimage = NULL; data->gimage = NULL;
data->drawable = drawable; data->drawable = drawable;
data->name = g_strdup (name); data->name = g_strdup (name);
data->parasite = parasite_copy (gimp_drawable_find_parasite (drawable, data->name)); data->parasite = parasite_copy (gimp_drawable_parasite_find (drawable, data->name));
return TRUE; return TRUE;
} }
@ -2554,7 +2554,7 @@ undo_pop_parasite (GImage *gimage,
if (data->gimage) if (data->gimage)
{ {
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->parasite = parasite_copy (gimp_image_parasite_find (gimage,
data->name)); data->name));
if (tmp) if (tmp)
parasite_list_add (data->gimage->parasites, tmp); parasite_list_add (data->gimage->parasites, tmp);
@ -2563,7 +2563,7 @@ undo_pop_parasite (GImage *gimage,
} }
else if (data->drawable) else if (data->drawable)
{ {
data->parasite = parasite_copy (gimp_drawable_find_parasite (data->drawable, data->parasite = parasite_copy (gimp_drawable_parasite_find (data->drawable,
data->name)); data->name));
if (tmp) if (tmp)
parasite_list_add (data->drawable->parasites, tmp); parasite_list_add (data->drawable->parasites, tmp);
@ -2572,11 +2572,11 @@ undo_pop_parasite (GImage *gimage,
} }
else else
{ {
data->parasite = parasite_copy (gimp_find_parasite (data->name)); data->parasite = parasite_copy (gimp_parasite_find (data->name));
if (tmp) if (tmp)
gimp_attach_parasite (tmp); gimp_parasite_attach (tmp);
else else
gimp_detach_parasite (data->name); gimp_parasite_detach (data->name);
} }
if (tmp) if (tmp)

View file

@ -21,7 +21,7 @@
#include <gdk/gdktypes.h> #include <gdk/gdktypes.h>
#if defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_X11) #if defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_X11)
/* Stopgap measure to detect build with current CVS GTk+ */ /* Stopgap measure to detect build with current CVS GTk+ */
#include <gdk/gdkcursor.h> //#include <gdk/gdkcursor.h>
#endif #endif
typedef enum typedef enum

View file

@ -74,6 +74,7 @@ typedef enum
{ {
GRAD_IMPORT = 0, GRAD_IMPORT = 0,
IMAGE_IMPORT = 1, IMAGE_IMPORT = 1,
INDEXED_IMPORT = 2,
} ImportType; } ImportType;
typedef struct _ImportDialog ImportDialog; typedef struct _ImportDialog ImportDialog;
@ -87,6 +88,7 @@ struct _ImportDialog
GtkWidget *select; GtkWidget *select;
GtkWidget *image_list; GtkWidget *image_list;
GtkWidget *image_menu_item_image; GtkWidget *image_menu_item_image;
GtkWidget *image_menu_item_indexed;
GtkWidget *image_menu_item_gradient; GtkWidget *image_menu_item_gradient;
GtkWidget *optionmenu1_menu; GtkWidget *optionmenu1_menu;
GtkWidget *type_option; GtkWidget *type_option;
@ -151,6 +153,9 @@ static void palette_scroll_top_left (PaletteDialog *palette);
static ImportDialog * palette_import_dialog (PaletteDialog *palette); static ImportDialog * palette_import_dialog (PaletteDialog *palette);
static void palette_import_dialog_callback (GtkWidget *, gpointer); static void palette_import_dialog_callback (GtkWidget *, gpointer);
static void import_palette_create_from_indexed (GImage *gimage,
guchar *pname,
PaletteDialog *palette);
static void import_palette_create_from_image (GImage *gimage, static void import_palette_create_from_image (GImage *gimage,
guchar *pname, guchar *pname,
PaletteDialog *palette); PaletteDialog *palette);
@ -2420,6 +2425,10 @@ import_dialog_import_callback (GtkWidget *widget,
import_palette_create_from_image (import_dialog->gimage, import_palette_create_from_image (import_dialog->gimage,
pname, palette); pname, palette);
break; break;
case INDEXED_IMPORT:
import_palette_create_from_indexed (import_dialog->gimage,
pname, palette);
break;
default: default:
break; break;
} }
@ -2589,6 +2598,19 @@ gimlist_cb (gpointer im,
*l = g_slist_prepend (*l, im); *l = g_slist_prepend (*l, im);
} }
static void
gimlist_indexed_cb (gpointer im,
gpointer data)
{
GimpImage *gimage = GIMP_IMAGE (im);
GSList** l;
if (gimage_base_type (gimage) == INDEXED) {
l = (GSList**) data;
*l = g_slist_prepend (*l, im);
}
}
static void static void
import_image_update_image_preview (GimpImage *gimage) import_image_update_image_preview (GimpImage *gimage)
{ {
@ -2690,7 +2712,7 @@ import_image_menu_add (GimpImage *gimage)
/* Last Param gives us control over what goes in the menu on a delete oper */ /* Last Param gives us control over what goes in the menu on a delete oper */
static void static void
import_image_menu_activate (gint redo, import_image_menu_activate (gint redo, ImportType type,
GimpImage *del_image) GimpImage *del_image)
{ {
GSList *list=NULL; GSList *list=NULL;
@ -2701,105 +2723,123 @@ import_image_menu_activate (gint redo,
gint count = 0; gint count = 0;
gchar *lab; gchar *lab;
if (import_dialog) if (!import_dialog)
return;
if (import_dialog->import_type == type && !redo)
return;
/* Destroy existing widget if necessary */
if (import_dialog->image_list)
{ {
if (import_dialog->import_type == IMAGE_IMPORT) if (redo) /* Preserve settings in this case */
{ last_img = import_dialog->gimage;
if (!redo) gtk_widget_hide (import_dialog->image_list);
return; gtk_widget_destroy (import_dialog->image_list);
else import_dialog->image_list = NULL;
{ }
if (import_dialog->image_list)
{
last_img = import_dialog->gimage;
gtk_widget_hide (import_dialog->image_list);
gtk_widget_destroy (import_dialog->image_list);
import_dialog->image_list = NULL;
}
}
}
import_dialog->import_type = IMAGE_IMPORT;
/* Get list of images */ import_dialog->import_type= type;
/* Get list of images */
if (import_dialog->import_type == INDEXED_IMPORT)
{
gimage_foreach (gimlist_indexed_cb, &list);
}
else
{
gimage_foreach (gimlist_cb, &list); gimage_foreach (gimlist_cb, &list);
num_images = g_slist_length (list); }
num_images = g_slist_length (list);
if (num_images) if (num_images)
{ {
gint i; gint i;
GtkWidget *optionmenu1; GtkWidget *optionmenu1;
GtkWidget *optionmenu1_menu; GtkWidget *optionmenu1_menu;
import_dialog->image_list = optionmenu1 = gtk_option_menu_new (); import_dialog->image_list = optionmenu1 = gtk_option_menu_new ();
gtk_widget_set_usize (optionmenu1, IMPORT_PREVIEW_WIDTH, -1); gtk_widget_set_usize (optionmenu1, IMPORT_PREVIEW_WIDTH, -1);
import_dialog->optionmenu1_menu = optionmenu1_menu = gtk_menu_new (); import_dialog->optionmenu1_menu = optionmenu1_menu = gtk_menu_new ();
for (i = 0; i < num_images; i++, list = g_slist_next (list)) for (i = 0; i < num_images; i++, list = g_slist_next (list))
{ {
if (GIMP_IMAGE (list->data) != del_image) if (GIMP_IMAGE (list->data) != del_image)
{ {
if (first_img == NULL) if (first_img == NULL)
first_img = GIMP_IMAGE (list->data); first_img = GIMP_IMAGE (list->data);
import_image_menu_add (GIMP_IMAGE (list->data)); import_image_menu_add (GIMP_IMAGE (list->data));
if (last_img == GIMP_IMAGE (list->data)) if (last_img == GIMP_IMAGE (list->data))
act_num = count; act_num = count;
else else
count++; count++;
}
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu1),
optionmenu1_menu);
gtk_widget_hide (import_dialog->select);
gtk_box_pack_start (GTK_BOX (import_dialog->select_area),
optionmenu1, FALSE, FALSE, 0);
if(last_img != NULL && last_img != del_image)
import_image_update_image_preview (last_img);
else if (first_img != NULL)
import_image_update_image_preview (first_img);
gtk_widget_show (optionmenu1);
/* reset to last one */
if(redo && act_num >= 0)
{
gchar *lab =
g_strdup_printf ("%s-%d",
g_basename (gimage_filename (import_dialog->gimage)),
pdb_image_to_id (import_dialog->gimage));
gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu1), act_num);
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab);
} }
} }
g_slist_free (list);
lab = gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu1),
g_strdup_printf ("%s-%d", optionmenu1_menu);
gtk_widget_hide (import_dialog->select);
gtk_box_pack_start (GTK_BOX (import_dialog->select_area),
optionmenu1, FALSE, FALSE, 0);
if(last_img != NULL && last_img != del_image)
import_image_update_image_preview (last_img);
else if (first_img != NULL)
import_image_update_image_preview (first_img);
gtk_widget_show (optionmenu1);
/* reset to last one */
if (redo && act_num >= 0)
{
gchar *lab = g_strdup_printf ("%s-%d",
g_basename (gimage_filename (import_dialog->gimage)), g_basename (gimage_filename (import_dialog->gimage)),
pdb_image_to_id (import_dialog->gimage)); pdb_image_to_id (import_dialog->gimage));
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab); gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu1), act_num);
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab);
}
} }
g_slist_free (list);
lab = g_strdup_printf ("%s-%d",
g_basename (gimage_filename (import_dialog->gimage)),
pdb_image_to_id (import_dialog->gimage));
gtk_entry_set_text (GTK_ENTRY (import_dialog->entry), lab);
} }
static void static void
import_image_callback (GtkWidget *widget, import_image_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
import_image_menu_activate (FALSE, NULL); import_image_menu_activate (FALSE, IMAGE_IMPORT, NULL);
gtk_widget_set_sensitive (import_dialog->threshold_scale, TRUE); gtk_widget_set_sensitive (import_dialog->threshold_scale, TRUE);
gtk_widget_set_sensitive (import_dialog->threshold_text, TRUE); gtk_widget_set_sensitive (import_dialog->threshold_text, TRUE);
} }
static void
import_indexed_callback (GtkWidget *widget,
gpointer data)
{
import_image_menu_activate (FALSE, INDEXED_IMPORT, NULL);
gtk_widget_set_sensitive (import_dialog->threshold_scale, FALSE);
gtk_widget_set_sensitive (import_dialog->threshold_text, FALSE);
}
static gint static gint
image_count () image_count (ImportType type)
{ {
GSList *list=NULL; GSList *list=NULL;
gint num_images = 0; gint num_images = 0;
gimage_foreach (gimlist_cb, &list); if (type == INDEXED_IMPORT) {
gimage_foreach (gimlist_indexed_cb, &list);
} else {
gimage_foreach (gimlist_cb, &list);
}
num_images = g_slist_length (list); num_images = g_slist_length (list);
g_slist_free (list); g_slist_free (list);
@ -2903,9 +2943,18 @@ palette_import_dialog (PaletteDialog *palette)
(gpointer) import_dialog); (gpointer) import_dialog);
gtk_menu_append (GTK_MENU (optionmenu_menu), menuitem); gtk_menu_append (GTK_MENU (optionmenu_menu), menuitem);
gtk_widget_show (menuitem); gtk_widget_show (menuitem);
gtk_widget_set_sensitive (menuitem, image_count(IMAGE_IMPORT) > 0);
menuitem = import_dialog->image_menu_item_indexed =
gtk_menu_item_new_with_label ("Indexed Palette");
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
(GtkSignalFunc) import_indexed_callback,
(gpointer) import_dialog);
gtk_menu_append (GTK_MENU (optionmenu_menu), menuitem);
gtk_widget_show (menuitem);
gtk_widget_set_sensitive (menuitem, image_count(INDEXED_IMPORT) > 0);
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), optionmenu_menu); gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), optionmenu_menu);
gtk_widget_set_sensitive (menuitem, image_count() > 0);
gtk_widget_show (optionmenu); gtk_widget_show (optionmenu);
/* The sample size */ /* The sample size */
@ -2985,10 +3034,18 @@ palette_import_image_new (GimpImage * gimage)
return; return;
} }
/* Now fill in the names if image menu shown */ if (!GTK_WIDGET_IS_SENSITIVE (import_dialog->image_menu_item_indexed) &&
if (import_dialog->import_type == IMAGE_IMPORT) gimage_base_type(gimage) == INDEXED)
{ {
import_image_menu_activate (TRUE, NULL); gtk_widget_set_sensitive (import_dialog->image_menu_item_indexed, TRUE);
return;
}
/* Now fill in the names if image menu shown */
if (import_dialog->import_type == IMAGE_IMPORT ||
import_dialog->import_type == INDEXED_IMPORT)
{
import_image_menu_activate (TRUE, import_dialog->import_type, NULL);
} }
} }
@ -3000,7 +3057,7 @@ palette_import_image_destroyed (GimpImage* gimage)
if (!import_dialog) if (!import_dialog)
return; return;
if (image_count() <= 1) if (image_count(import_dialog->import_type) <= 1)
{ {
/* Back to gradient type */ /* Back to gradient type */
gtk_option_menu_set_history (GTK_OPTION_MENU (import_dialog->type_option), 0); gtk_option_menu_set_history (GTK_OPTION_MENU (import_dialog->type_option), 0);
@ -3010,9 +3067,10 @@ palette_import_image_destroyed (GimpImage* gimage)
return; return;
} }
if (import_dialog->import_type == IMAGE_IMPORT) if (import_dialog->import_type == IMAGE_IMPORT ||
import_dialog->import_type == INDEXED_IMPORT)
{ {
import_image_menu_activate (TRUE, gimage); import_image_menu_activate (TRUE, import_dialog->import_type, gimage);
} }
} }
@ -3020,9 +3078,10 @@ void
palette_import_image_renamed (GimpImage* gimage) palette_import_image_renamed (GimpImage* gimage)
{ {
/* Now fill in the names if image menu shown */ /* Now fill in the names if image menu shown */
if(import_dialog && import_dialog->import_type == IMAGE_IMPORT) if (import_dialog && (import_dialog->import_type == IMAGE_IMPORT ||
import_dialog->import_type == INDEXED_IMPORT))
{ {
import_image_menu_activate (TRUE, NULL); import_image_menu_activate (TRUE, import_dialog->import_type, NULL);
} }
} }
@ -3279,3 +3338,38 @@ import_palette_create_from_image (GImage *gimage,
/* Make palette from the store_array */ /* Make palette from the store_array */
import_image_make_palette (store_array, pname, palette); import_image_make_palette (store_array, pname, palette);
} }
static void
import_palette_create_from_indexed (GImage *gimage,
guchar *pname,
PaletteDialog *palette)
{
gint samples, count;
PaletteEntriesP entries;
samples = (gint) import_dialog->sample->value;
if (gimage == NULL)
return;
if (gimage_base_type (gimage) != INDEXED)
return;
entries= palette_create_entries (palette, pname);
for (count= 0; count < samples && count < gimage->num_cols; ++count)
{
palette_add_entry (entries, NULL, gimage->cmap[count*3],
gimage->cmap[count*3+1],
gimage->cmap[count*3+2]);
}
/* Redraw with new palette */
palette_update_small_preview (palette);
redraw_palette (palette);
/* Update other selectors on screen */
palette_select_clist_insert_all (entries);
palette_select2_clist_insert_all (entries);
palette_scroll_clist_to_current (palette);
}

View file

@ -1850,7 +1850,7 @@ xcf_load_image_props (XcfInfo *info,
while (info->cp - base < prop_size) while (info->cp - base < prop_size)
{ {
p = read_a_parasite(info); p = read_a_parasite(info);
gimp_image_attach_parasite(gimage, p); gimp_image_parasite_attach(gimage, p);
parasite_free(p); parasite_free(p);
} }
if (info->cp - base != prop_size) if (info->cp - base != prop_size)
@ -2013,7 +2013,7 @@ xcf_load_layer_props (XcfInfo *info,
while (info->cp - base < prop_size) while (info->cp - base < prop_size)
{ {
p = read_a_parasite(info); p = read_a_parasite(info);
gimp_drawable_attach_parasite(GIMP_DRAWABLE(layer), p); gimp_drawable_parasite_attach(GIMP_DRAWABLE(layer), p);
parasite_free(p); parasite_free(p);
} }
if (info->cp - base != prop_size) if (info->cp - base != prop_size)
@ -2090,7 +2090,7 @@ xcf_load_channel_props (XcfInfo *info,
while ((info->cp - base) < prop_size) while ((info->cp - base) < prop_size)
{ {
p = read_a_parasite(info); p = read_a_parasite(info);
gimp_drawable_attach_parasite(GIMP_DRAWABLE(channel), p); gimp_drawable_parasite_attach(GIMP_DRAWABLE(channel), p);
parasite_free(p); parasite_free(p);
} }
if (info->cp - base != prop_size) if (info->cp - base != prop_size)

View file

@ -1850,7 +1850,7 @@ xcf_load_image_props (XcfInfo *info,
while (info->cp - base < prop_size) while (info->cp - base < prop_size)
{ {
p = read_a_parasite(info); p = read_a_parasite(info);
gimp_image_attach_parasite(gimage, p); gimp_image_parasite_attach(gimage, p);
parasite_free(p); parasite_free(p);
} }
if (info->cp - base != prop_size) if (info->cp - base != prop_size)
@ -2013,7 +2013,7 @@ xcf_load_layer_props (XcfInfo *info,
while (info->cp - base < prop_size) while (info->cp - base < prop_size)
{ {
p = read_a_parasite(info); p = read_a_parasite(info);
gimp_drawable_attach_parasite(GIMP_DRAWABLE(layer), p); gimp_drawable_parasite_attach(GIMP_DRAWABLE(layer), p);
parasite_free(p); parasite_free(p);
} }
if (info->cp - base != prop_size) if (info->cp - base != prop_size)
@ -2090,7 +2090,7 @@ xcf_load_channel_props (XcfInfo *info,
while ((info->cp - base) < prop_size) while ((info->cp - base) < prop_size)
{ {
p = read_a_parasite(info); p = read_a_parasite(info);
gimp_drawable_attach_parasite(GIMP_DRAWABLE(channel), p); gimp_drawable_parasite_attach(GIMP_DRAWABLE(channel), p);
parasite_free(p); parasite_free(p);
} }
if (info->cp - base != prop_size) if (info->cp - base != prop_size)

View file

@ -576,7 +576,7 @@ come a long way in two years.
(shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 MULTIPLY))) (shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 MULTIPLY)))
(old-fg (car (gimp-palette-get-foreground))) (old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background)))) (old-bg (car (gimp-palette-get-background))))
(gimp-image-disable-undo img) (gimp-image-undo-disable img)
(gimp-image-resize img width height 0 0) (gimp-image-resize img width height 0 0)
(gimp-image-add-layer img bg-layer 1) (gimp-image-add-layer img bg-layer 1)
(gimp-image-add-layer img shadow-layer 1) (gimp-image-add-layer img shadow-layer 1)
@ -603,7 +603,7 @@ come a long way in two years.
(gimp-layer-set-name highlight-layer "Highlight") (gimp-layer-set-name highlight-layer "Highlight")
(gimp-palette-set-background old-bg) (gimp-palette-set-background old-bg)
(gimp-palette-set-foreground old-fg) (gimp-palette-set-foreground old-fg)
(gimp-image-enable-undo img) (gimp-image-undo-enable img)
(gimp-display-new img))) (gimp-display-new img)))
\end{verbatim}} \end{verbatim}}
@ -697,7 +697,7 @@ come a long way in two years.
(gimp-image-delete banding-img) (gimp-image-delete banding-img)
(gimp-image-delete back-img) (gimp-image-delete back-img)
(gimp-image-delete tile-img) (gimp-image-delete tile-img)
(gimp-image-disable-undo img) (gimp-image-undo-disable img)
(gimp-image-resize img width height 0 0) (gimp-image-resize img width height 0 0)
(gimp-image-add-layer img layer3 0) (gimp-image-add-layer img layer3 0)
(gimp-image-add-layer img layer2 0) (gimp-image-add-layer img layer2 0)
@ -776,7 +776,7 @@ come a long way in two years.
(gimp-palette-set-foreground old-fg) (gimp-palette-set-foreground old-fg)
(gimp-palette-set-background old-bg) (gimp-palette-set-background old-bg)
(gimp-brushes-set-brush old-brush) (gimp-brushes-set-brush old-brush)
(gimp-image-enable-undo img) (gimp-image-undo-enable img)
(gimp-display-new img))) (gimp-display-new img)))
\end{verbatim}} \end{verbatim}}
\twocolumn \twocolumn

View file

@ -554,7 +554,7 @@ gimp_query_images (int *nimages)
int nreturn_vals; int nreturn_vals;
gint32 *images; gint32 *images;
return_vals = gimp_run_procedure ("gimp_list_images", return_vals = gimp_run_procedure ("gimp_image_list",
&nreturn_vals, &nreturn_vals,
PARAM_END); PARAM_END);

View file

@ -27,19 +27,19 @@ EXPORTS
gimp_default_display gimp_default_display
gimp_destroy_paramdefs gimp_destroy_paramdefs
gimp_destroy_params gimp_destroy_params
gimp_detach_parasite gimp_parasite_detach
gimp_directory gimp_directory
gimp_display_delete gimp_display_delete
gimp_display_new gimp_display_new
gimp_displays_flush gimp_displays_flush
gimp_drawable_attach_new_parasite gimp_drawable_attach_new_parasite
gimp_drawable_attach_parasite gimp_drawable_parasite_attach
gimp_drawable_bpp gimp_drawable_bpp
gimp_drawable_channel gimp_drawable_is_channel
gimp_drawable_color gimp_drawable_color
gimp_drawable_delete gimp_drawable_delete
gimp_drawable_detach gimp_drawable_detach
gimp_drawable_detach_parasite gimp_drawable_parasite_detach
gimp_drawable_fill gimp_drawable_fill
gimp_drawable_find_parasite gimp_drawable_find_parasite
gimp_drawable_flush gimp_drawable_flush
@ -47,13 +47,13 @@ EXPORTS
gimp_drawable_get_thumbnail_data gimp_drawable_get_thumbnail_data
gimp_drawable_get_tile gimp_drawable_get_tile
gimp_drawable_get_tile2 gimp_drawable_get_tile2
gimp_drawable_gray gimp_drawable_is_gray
gimp_drawable_has_alpha gimp_drawable_has_alpha
gimp_drawable_height gimp_drawable_height
gimp_drawable_image_id gimp_drawable_image_id
gimp_drawable_indexed gimp_drawable_is_indexed
gimp_drawable_layer gimp_drawable_is_layer
gimp_drawable_layer_mask gimp_drawable_is_layer_mask
gimp_drawable_mask_bounds gimp_drawable_mask_bounds
gimp_drawable_merge_shadow gimp_drawable_merge_shadow
gimp_drawable_name gimp_drawable_name
@ -66,7 +66,7 @@ EXPORTS
gimp_drawable_width gimp_drawable_width
gimp_extension_ack gimp_extension_ack
gimp_extension_process gimp_extension_process
gimp_find_parasite gimp_parasite_find
gimp_gamma gimp_gamma
gimp_get_data gimp_get_data
gimp_get_data_size gimp_get_data_size
@ -82,7 +82,7 @@ EXPORTS
gimp_image_add_layer_mask gimp_image_add_layer_mask
gimp_image_add_vguide gimp_image_add_vguide
gimp_image_attach_new_parasite gimp_image_attach_new_parasite
gimp_image_attach_parasite gimp_image_parasite_attach
gimp_image_base_type gimp_image_base_type
gimp_image_clean_all gimp_image_clean_all
gimp_image_convert_grayscale gimp_image_convert_grayscale
@ -90,15 +90,15 @@ EXPORTS
gimp_image_convert_rgb gimp_image_convert_rgb
gimp_image_delete gimp_image_delete
gimp_image_delete_guide gimp_image_delete_guide
gimp_image_detach_parasite gimp_image_parasite_detach
gimp_image_disable_undo gimp_image_undo_disable
gimp_image_duplicate gimp_image_duplicate
gimp_image_enable_undo gimp_image_undo_enable
gimp_image_find_next_guide gimp_image_find_next_guide
gimp_image_find_parasite gimp_image_parasite_find
gimp_image_flatten gimp_image_flatten
gimp_image_floating_selection gimp_image_floating_selection
gimp_image_freeze_undo gimp_image_undo_freeze
gimp_image_get_active_channel gimp_image_get_active_channel
gimp_image_get_active_layer gimp_image_get_active_layer
gimp_image_get_channel_by_tattoo gimp_image_get_channel_by_tattoo
@ -135,7 +135,7 @@ EXPORTS
gimp_image_set_filename gimp_image_set_filename
gimp_image_set_resolution gimp_image_set_resolution
gimp_image_set_unit gimp_image_set_unit
gimp_image_thaw_undo gimp_image_undo_thaw
gimp_image_width gimp_image_width
gimp_install_cmap gimp_install_cmap
gimp_install_procedure gimp_install_procedure

View file

@ -439,10 +439,10 @@ void gimp_image_add_layer_mask (gint32 image_ID,
gint32 layer_ID, gint32 layer_ID,
gint32 mask_ID); gint32 mask_ID);
void gimp_image_clean_all (gint32 image_ID); void gimp_image_clean_all (gint32 image_ID);
void gimp_image_disable_undo (gint32 image_ID); void gimp_image_undo_disable (gint32 image_ID);
void gimp_image_enable_undo (gint32 image_ID); void gimp_image_undo_enable (gint32 image_ID);
void gimp_image_freeze_undo (gint32 image_ID); void gimp_image_undo_freeze (gint32 image_ID);
void gimp_image_thaw_undo (gint32 image_ID); void gimp_image_undo_thaw (gint32 image_ID);
void gimp_undo_push_group_start (gint32 image_ID); void gimp_undo_push_group_start (gint32 image_ID);
void gimp_undo_push_group_end (gint32 image_ID); void gimp_undo_push_group_end (gint32 image_ID);
void gimp_image_clean_all (gint32 image_ID); void gimp_image_clean_all (gint32 image_ID);
@ -501,16 +501,16 @@ void gimp_image_set_component_visible (gint32 image_ID,
gint visible); gint visible);
void gimp_image_set_filename (gint32 image_ID, void gimp_image_set_filename (gint32 image_ID,
char *name); char *name);
Parasite *gimp_image_find_parasite (gint32 image_ID, Parasite *gimp_image_parasite_find (gint32 image_ID,
const char *name); const char *name);
void gimp_image_attach_parasite (gint32 image_ID, void gimp_image_parasite_attach (gint32 image_ID,
const Parasite *p); const Parasite *p);
void gimp_image_attach_new_parasite (gint32 image_ID, void gimp_image_attach_new_parasite (gint32 image_ID,
const char *name, const char *name,
int flags, int flags,
int size, int size,
const void *data); const void *data);
void gimp_image_detach_parasite (gint32 image_ID, void gimp_image_parasite_detach (gint32 image_ID,
const char *name); const char *name);
void gimp_image_set_resolution (gint32 image_ID, void gimp_image_set_resolution (gint32 image_ID,
double xresolution, double xresolution,
@ -693,13 +693,13 @@ guint gimp_drawable_height (gint32 drawable_ID);
guint gimp_drawable_bpp (gint32 drawable_ID); guint gimp_drawable_bpp (gint32 drawable_ID);
GDrawableType gimp_drawable_type (gint32 drawable_ID); GDrawableType gimp_drawable_type (gint32 drawable_ID);
gint gimp_drawable_visible (gint32 drawable_ID); gint gimp_drawable_visible (gint32 drawable_ID);
gint gimp_drawable_channel (gint32 drawable_ID); gint gimp_drawable_is_channel (gint32 drawable_ID);
gint gimp_drawable_color (gint32 drawable_ID); gint gimp_drawable_color (gint32 drawable_ID);
gint gimp_drawable_gray (gint32 drawable_ID); gint gimp_drawable_is_gray (gint32 drawable_ID);
gint gimp_drawable_has_alpha (gint32 drawable_ID); gint gimp_drawable_has_alpha (gint32 drawable_ID);
gint gimp_drawable_indexed (gint32 drawable_ID); gint gimp_drawable_is_indexed (gint32 drawable_ID);
gint gimp_drawable_layer (gint32 drawable_ID); gint gimp_drawable_is_layer (gint32 drawable_ID);
gint gimp_drawable_layer_mask (gint32 drawable_ID); gint gimp_drawable_is_layer_mask (gint32 drawable_ID);
gint gimp_drawable_mask_bounds (gint32 drawable_ID, gint gimp_drawable_mask_bounds (gint32 drawable_ID,
gint *x1, gint *x1,
gint *y1, gint *y1,
@ -724,12 +724,12 @@ GTile* gimp_drawable_get_tile2 (GDrawable *drawable,
gint y); gint y);
Parasite *gimp_drawable_find_parasite (gint32 drawable, Parasite *gimp_drawable_find_parasite (gint32 drawable,
const char *name); const char *name);
void gimp_drawable_attach_parasite (gint32 drawable, void gimp_drawable_parasite_attach (gint32 drawable,
const Parasite *p); const Parasite *p);
void gimp_layer_attach_new_parasite(gint32 drawable, void gimp_layer_attach_new_parasite(gint32 drawable,
const char *name, int flags, const char *name, int flags,
int size, const void *data); int size, const void *data);
void gimp_drawable_detach_parasite (gint32 drawable, void gimp_drawable_parasite_detach (gint32 drawable,
const char *name); const char *name);
guchar * gimp_drawable_get_thumbnail_data (gint32 drawable_ID, guchar * gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
gint *width, gint *width,
@ -847,11 +847,11 @@ gdouble* gimp_gradients_sample_custom (gint num_samples,
* Parasites * * Parasites *
****************************************/ ****************************************/
Parasite *gimp_find_parasite (const char *name); Parasite *gimp_parasite_find (const char *name);
void gimp_attach_parasite (const Parasite *p); void gimp_parasite_attach (const Parasite *p);
void gimp_attach_new_parasite (const char *name, int flags, void gimp_attach_new_parasite (const char *name, int flags,
int size, const void *data); int size, const void *data);
void gimp_detach_parasite (const char *name); void gimp_parasite_detach (const char *name);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -97,7 +97,7 @@ gimp_drawable_delete (GDrawable *drawable)
{ {
if (drawable) if (drawable)
{ {
if (gimp_drawable_layer (drawable->id)) if (gimp_drawable_is_layer (drawable->id))
gimp_layer_delete (drawable->id); gimp_layer_delete (drawable->id);
else else
gimp_channel_delete (drawable->id); gimp_channel_delete (drawable->id);
@ -166,7 +166,7 @@ gimp_drawable_image_id (gint32 drawable_ID)
char* char*
gimp_drawable_name (gint32 drawable_ID) gimp_drawable_name (gint32 drawable_ID)
{ {
if (gimp_drawable_layer (drawable_ID)) if (gimp_drawable_is_layer (drawable_ID))
return gimp_layer_get_name (drawable_ID); return gimp_layer_get_name (drawable_ID);
return gimp_channel_get_name (drawable_ID); return gimp_channel_get_name (drawable_ID);
} }
@ -258,19 +258,19 @@ gimp_drawable_type (gint32 drawable_ID)
gint gint
gimp_drawable_visible (gint32 drawable_ID) gimp_drawable_visible (gint32 drawable_ID)
{ {
if (gimp_drawable_layer (drawable_ID)) if (gimp_drawable_is_layer (drawable_ID))
return gimp_layer_get_visible (drawable_ID); return gimp_layer_get_visible (drawable_ID);
return gimp_channel_get_visible (drawable_ID); return gimp_channel_get_visible (drawable_ID);
} }
gint gint
gimp_drawable_channel (gint32 drawable_ID) gimp_drawable_is_channel (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_channel", return_vals = gimp_run_procedure ("gimp_drawable_is_channel",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -306,13 +306,13 @@ gimp_drawable_color (gint32 drawable_ID)
} }
gint gint
gimp_drawable_gray (gint32 drawable_ID) gimp_drawable_is_gray (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_gray", return_vals = gimp_run_procedure ("gimp_drawable_is_gray",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -348,13 +348,13 @@ gimp_drawable_has_alpha (gint32 drawable_ID)
} }
gint gint
gimp_drawable_indexed (gint32 drawable_ID) gimp_drawable_is_indexed (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_indexed", return_vals = gimp_run_procedure ("gimp_drawable_is_indexed",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -369,13 +369,13 @@ gimp_drawable_indexed (gint32 drawable_ID)
} }
gint gint
gimp_drawable_layer (gint32 drawable_ID) gimp_drawable_is_layer (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_layer", return_vals = gimp_run_procedure ("gimp_drawable_is_layer",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -390,13 +390,13 @@ gimp_drawable_layer (gint32 drawable_ID)
} }
gint gint
gimp_drawable_layer_mask (gint32 drawable_ID) gimp_drawable_is_layer_mask (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_layer_mask", return_vals = gimp_run_procedure ("gimp_drawable_is_layer_mask",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -483,7 +483,7 @@ void
gimp_drawable_set_name (gint32 drawable_ID, gimp_drawable_set_name (gint32 drawable_ID,
char *name) char *name)
{ {
if (gimp_drawable_layer (drawable_ID)) if (gimp_drawable_is_layer (drawable_ID))
gimp_layer_set_name (drawable_ID, name); gimp_layer_set_name (drawable_ID, name);
else else
gimp_channel_set_name (drawable_ID, name); gimp_channel_set_name (drawable_ID, name);
@ -493,7 +493,7 @@ void
gimp_drawable_set_visible (gint32 drawable_ID, gimp_drawable_set_visible (gint32 drawable_ID,
gint visible) gint visible)
{ {
if (gimp_drawable_layer (drawable_ID)) if (gimp_drawable_is_layer (drawable_ID))
gimp_layer_set_visible (drawable_ID, visible); gimp_layer_set_visible (drawable_ID, visible);
else else
gimp_channel_set_visible (drawable_ID, visible); gimp_channel_set_visible (drawable_ID, visible);
@ -605,13 +605,13 @@ gimp_drawable_find_parasite (gint32 drawable_ID,
} }
void void
gimp_drawable_attach_parasite (gint32 drawable_ID, gimp_drawable_parasite_attach (gint32 drawable_ID,
const Parasite *p) const Parasite *p)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_drawable_attach_parasite", return_vals = gimp_run_procedure ("gimp_drawable_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_PARASITE, p, PARAM_PARASITE, p,
@ -629,7 +629,7 @@ gimp_drawable_attach_new_parasite (gint32 drawable, const char *name, int flags,
int nreturn_vals; int nreturn_vals;
Parasite *p = parasite_new(name, flags, size, data); Parasite *p = parasite_new(name, flags, size, data);
return_vals = gimp_run_procedure ("gimp_drawable_attach_parasite", return_vals = gimp_run_procedure ("gimp_drawable_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable, PARAM_DRAWABLE, drawable,
PARAM_PARASITE, p, PARAM_PARASITE, p,
@ -640,13 +640,13 @@ gimp_drawable_attach_new_parasite (gint32 drawable, const char *name, int flags,
} }
void void
gimp_drawable_detach_parasite (gint32 drawable_ID, gimp_drawable_parasite_detach (gint32 drawable_ID,
const char *name) const char *name)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_drawable_detach_parasite", return_vals = gimp_run_procedure ("gimp_drawable_parasite_detach",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_STRING, name, PARAM_STRING, name,

View file

@ -97,7 +97,7 @@ gimp_drawable_delete (GDrawable *drawable)
{ {
if (drawable) if (drawable)
{ {
if (gimp_drawable_layer (drawable->id)) if (gimp_drawable_is_layer (drawable->id))
gimp_layer_delete (drawable->id); gimp_layer_delete (drawable->id);
else else
gimp_channel_delete (drawable->id); gimp_channel_delete (drawable->id);
@ -166,7 +166,7 @@ gimp_drawable_image_id (gint32 drawable_ID)
char* char*
gimp_drawable_name (gint32 drawable_ID) gimp_drawable_name (gint32 drawable_ID)
{ {
if (gimp_drawable_layer (drawable_ID)) if (gimp_drawable_is_layer (drawable_ID))
return gimp_layer_get_name (drawable_ID); return gimp_layer_get_name (drawable_ID);
return gimp_channel_get_name (drawable_ID); return gimp_channel_get_name (drawable_ID);
} }
@ -258,19 +258,19 @@ gimp_drawable_type (gint32 drawable_ID)
gint gint
gimp_drawable_visible (gint32 drawable_ID) gimp_drawable_visible (gint32 drawable_ID)
{ {
if (gimp_drawable_layer (drawable_ID)) if (gimp_drawable_is_layer (drawable_ID))
return gimp_layer_get_visible (drawable_ID); return gimp_layer_get_visible (drawable_ID);
return gimp_channel_get_visible (drawable_ID); return gimp_channel_get_visible (drawable_ID);
} }
gint gint
gimp_drawable_channel (gint32 drawable_ID) gimp_drawable_is_channel (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_channel", return_vals = gimp_run_procedure ("gimp_drawable_is_channel",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -306,13 +306,13 @@ gimp_drawable_color (gint32 drawable_ID)
} }
gint gint
gimp_drawable_gray (gint32 drawable_ID) gimp_drawable_is_gray (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_gray", return_vals = gimp_run_procedure ("gimp_drawable_is_gray",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -348,13 +348,13 @@ gimp_drawable_has_alpha (gint32 drawable_ID)
} }
gint gint
gimp_drawable_indexed (gint32 drawable_ID) gimp_drawable_is_indexed (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_indexed", return_vals = gimp_run_procedure ("gimp_drawable_is_indexed",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -369,13 +369,13 @@ gimp_drawable_indexed (gint32 drawable_ID)
} }
gint gint
gimp_drawable_layer (gint32 drawable_ID) gimp_drawable_is_layer (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_layer", return_vals = gimp_run_procedure ("gimp_drawable_is_layer",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -390,13 +390,13 @@ gimp_drawable_layer (gint32 drawable_ID)
} }
gint gint
gimp_drawable_layer_mask (gint32 drawable_ID) gimp_drawable_is_layer_mask (gint32 drawable_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
int result; int result;
return_vals = gimp_run_procedure ("gimp_drawable_layer_mask", return_vals = gimp_run_procedure ("gimp_drawable_is_layer_mask",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_END); PARAM_END);
@ -483,7 +483,7 @@ void
gimp_drawable_set_name (gint32 drawable_ID, gimp_drawable_set_name (gint32 drawable_ID,
char *name) char *name)
{ {
if (gimp_drawable_layer (drawable_ID)) if (gimp_drawable_is_layer (drawable_ID))
gimp_layer_set_name (drawable_ID, name); gimp_layer_set_name (drawable_ID, name);
else else
gimp_channel_set_name (drawable_ID, name); gimp_channel_set_name (drawable_ID, name);
@ -493,7 +493,7 @@ void
gimp_drawable_set_visible (gint32 drawable_ID, gimp_drawable_set_visible (gint32 drawable_ID,
gint visible) gint visible)
{ {
if (gimp_drawable_layer (drawable_ID)) if (gimp_drawable_is_layer (drawable_ID))
gimp_layer_set_visible (drawable_ID, visible); gimp_layer_set_visible (drawable_ID, visible);
else else
gimp_channel_set_visible (drawable_ID, visible); gimp_channel_set_visible (drawable_ID, visible);
@ -605,13 +605,13 @@ gimp_drawable_find_parasite (gint32 drawable_ID,
} }
void void
gimp_drawable_attach_parasite (gint32 drawable_ID, gimp_drawable_parasite_attach (gint32 drawable_ID,
const Parasite *p) const Parasite *p)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_drawable_attach_parasite", return_vals = gimp_run_procedure ("gimp_drawable_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_PARASITE, p, PARAM_PARASITE, p,
@ -629,7 +629,7 @@ gimp_drawable_attach_new_parasite (gint32 drawable, const char *name, int flags,
int nreturn_vals; int nreturn_vals;
Parasite *p = parasite_new(name, flags, size, data); Parasite *p = parasite_new(name, flags, size, data);
return_vals = gimp_run_procedure ("gimp_drawable_attach_parasite", return_vals = gimp_run_procedure ("gimp_drawable_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable, PARAM_DRAWABLE, drawable,
PARAM_PARASITE, p, PARAM_PARASITE, p,
@ -640,13 +640,13 @@ gimp_drawable_attach_new_parasite (gint32 drawable, const char *name, int flags,
} }
void void
gimp_drawable_detach_parasite (gint32 drawable_ID, gimp_drawable_parasite_detach (gint32 drawable_ID,
const char *name) const char *name)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_drawable_detach_parasite", return_vals = gimp_run_procedure ("gimp_drawable_parasite_detach",
&nreturn_vals, &nreturn_vals,
PARAM_DRAWABLE, drawable_ID, PARAM_DRAWABLE, drawable_ID,
PARAM_STRING, name, PARAM_STRING, name,

View file

@ -470,7 +470,7 @@ gimp_export_image (gint32 *image_ID_ptr,
{ {
*image_ID_ptr = gimp_image_duplicate (*image_ID_ptr); *image_ID_ptr = gimp_image_duplicate (*image_ID_ptr);
*drawable_ID_ptr = gimp_image_get_active_layer (*image_ID_ptr); *drawable_ID_ptr = gimp_image_get_active_layer (*image_ID_ptr);
gimp_image_disable_undo (*image_ID_ptr); gimp_image_undo_disable (*image_ID_ptr);
for (list = actions; list; list = list->next) for (list = actions; list; list = list->next)
{ {
action = (ExportAction*)(list->data); action = (ExportAction*)(list->data);

View file

@ -355,12 +355,12 @@ gimp_image_add_layer_mask (gint32 image_ID,
} }
void void
gimp_image_disable_undo (gint32 image_ID) gimp_image_undo_disable (gint32 image_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_disable_undo", return_vals = gimp_run_procedure ("gimp_image_undo_disable",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_END); PARAM_END);
@ -369,12 +369,12 @@ gimp_image_disable_undo (gint32 image_ID)
} }
void void
gimp_image_enable_undo (gint32 image_ID) gimp_image_undo_enable (gint32 image_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_enable_undo", return_vals = gimp_run_procedure ("gimp_image_undo_enable",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_END); PARAM_END);
@ -383,12 +383,12 @@ gimp_image_enable_undo (gint32 image_ID)
} }
void void
gimp_image_freeze_undo (gint32 image_ID) gimp_image_undo_freeze (gint32 image_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_freeze_undo", return_vals = gimp_run_procedure ("gimp_image_undo_freeze",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_END); PARAM_END);
@ -397,12 +397,12 @@ gimp_image_freeze_undo (gint32 image_ID)
} }
void void
gimp_image_thaw_undo (gint32 image_ID) gimp_image_undo_thaw (gint32 image_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_thaw_undo", return_vals = gimp_run_procedure ("gimp_image_undo_thaw",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_END); PARAM_END);
@ -976,13 +976,13 @@ gimp_image_set_filename (gint32 image_ID,
} }
Parasite * Parasite *
gimp_image_find_parasite (gint32 image_ID, gimp_image_parasite_find (gint32 image_ID,
const char *name) const char *name)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
Parasite *parasite; Parasite *parasite;
return_vals = gimp_run_procedure ("gimp_image_find_parasite", return_vals = gimp_run_procedure ("gimp_image_parasite_find",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_STRING, name, PARAM_STRING, name,
@ -1001,13 +1001,13 @@ gimp_image_find_parasite (gint32 image_ID,
} }
void void
gimp_image_attach_parasite (gint32 image_ID, gimp_image_parasite_attach (gint32 image_ID,
const Parasite *p) const Parasite *p)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_attach_parasite", return_vals = gimp_run_procedure ("gimp_image_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_PARASITE, p, PARAM_PARASITE, p,
@ -1027,7 +1027,7 @@ gimp_image_attach_new_parasite (gint32 image_ID,
int nreturn_vals; int nreturn_vals;
Parasite *p = parasite_new(name, flags, size, data); Parasite *p = parasite_new(name, flags, size, data);
return_vals = gimp_run_procedure ("gimp_image_attach_parasite", return_vals = gimp_run_procedure ("gimp_image_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_PARASITE, p, PARAM_PARASITE, p,
@ -1038,13 +1038,13 @@ gimp_image_attach_new_parasite (gint32 image_ID,
} }
void void
gimp_image_detach_parasite (gint32 image_ID, gimp_image_parasite_detach (gint32 image_ID,
const char *name) const char *name)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_detach_parasite", return_vals = gimp_run_procedure ("gimp_image_parasite_detach",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_STRING, name, PARAM_STRING, name,

View file

@ -355,12 +355,12 @@ gimp_image_add_layer_mask (gint32 image_ID,
} }
void void
gimp_image_disable_undo (gint32 image_ID) gimp_image_undo_disable (gint32 image_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_disable_undo", return_vals = gimp_run_procedure ("gimp_image_undo_disable",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_END); PARAM_END);
@ -369,12 +369,12 @@ gimp_image_disable_undo (gint32 image_ID)
} }
void void
gimp_image_enable_undo (gint32 image_ID) gimp_image_undo_enable (gint32 image_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_enable_undo", return_vals = gimp_run_procedure ("gimp_image_undo_enable",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_END); PARAM_END);
@ -383,12 +383,12 @@ gimp_image_enable_undo (gint32 image_ID)
} }
void void
gimp_image_freeze_undo (gint32 image_ID) gimp_image_undo_freeze (gint32 image_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_freeze_undo", return_vals = gimp_run_procedure ("gimp_image_undo_freeze",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_END); PARAM_END);
@ -397,12 +397,12 @@ gimp_image_freeze_undo (gint32 image_ID)
} }
void void
gimp_image_thaw_undo (gint32 image_ID) gimp_image_undo_thaw (gint32 image_ID)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_thaw_undo", return_vals = gimp_run_procedure ("gimp_image_undo_thaw",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_END); PARAM_END);
@ -976,13 +976,13 @@ gimp_image_set_filename (gint32 image_ID,
} }
Parasite * Parasite *
gimp_image_find_parasite (gint32 image_ID, gimp_image_parasite_find (gint32 image_ID,
const char *name) const char *name)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
Parasite *parasite; Parasite *parasite;
return_vals = gimp_run_procedure ("gimp_image_find_parasite", return_vals = gimp_run_procedure ("gimp_image_parasite_find",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_STRING, name, PARAM_STRING, name,
@ -1001,13 +1001,13 @@ gimp_image_find_parasite (gint32 image_ID,
} }
void void
gimp_image_attach_parasite (gint32 image_ID, gimp_image_parasite_attach (gint32 image_ID,
const Parasite *p) const Parasite *p)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_attach_parasite", return_vals = gimp_run_procedure ("gimp_image_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_PARASITE, p, PARAM_PARASITE, p,
@ -1027,7 +1027,7 @@ gimp_image_attach_new_parasite (gint32 image_ID,
int nreturn_vals; int nreturn_vals;
Parasite *p = parasite_new(name, flags, size, data); Parasite *p = parasite_new(name, flags, size, data);
return_vals = gimp_run_procedure ("gimp_image_attach_parasite", return_vals = gimp_run_procedure ("gimp_image_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_PARASITE, p, PARAM_PARASITE, p,
@ -1038,13 +1038,13 @@ gimp_image_attach_new_parasite (gint32 image_ID,
} }
void void
gimp_image_detach_parasite (gint32 image_ID, gimp_image_parasite_detach (gint32 image_ID,
const char *name) const char *name)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_image_detach_parasite", return_vals = gimp_run_procedure ("gimp_image_parasite_detach",
&nreturn_vals, &nreturn_vals,
PARAM_IMAGE, image_ID, PARAM_IMAGE, image_ID,
PARAM_STRING, name, PARAM_STRING, name,

View file

@ -1,12 +1,12 @@
#include "gimp.h" #include "gimp.h"
Parasite * Parasite *
gimp_find_parasite (const char *name) gimp_parasite_find (const char *name)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
Parasite *parasite; Parasite *parasite;
return_vals = gimp_run_procedure ("gimp_find_parasite", return_vals = gimp_run_procedure ("gimp_parasite_find",
&nreturn_vals, &nreturn_vals,
PARAM_STRING, name, PARAM_STRING, name,
PARAM_END); PARAM_END);
@ -25,12 +25,12 @@ gimp_find_parasite (const char *name)
void void
gimp_attach_parasite (const Parasite *p) gimp_parasite_attach (const Parasite *p)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_attach_parasite", return_vals = gimp_run_procedure ("gimp_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_PARASITE, p, PARAM_PARASITE, p,
PARAM_END); PARAM_END);
@ -46,7 +46,7 @@ gimp_attach_new_parasite (const char *name, int flags,
int nreturn_vals; int nreturn_vals;
Parasite *p = parasite_new(name, flags, size, data); Parasite *p = parasite_new(name, flags, size, data);
return_vals = gimp_run_procedure ("gimp_attach_parasite", return_vals = gimp_run_procedure ("gimp_parasite_attach",
&nreturn_vals, &nreturn_vals,
PARAM_PARASITE, p, PARAM_PARASITE, p,
PARAM_END); PARAM_END);
@ -56,12 +56,12 @@ gimp_attach_new_parasite (const char *name, int flags,
} }
void void
gimp_detach_parasite (const char *name) gimp_parasite_detach (const char *name)
{ {
GParam *return_vals; GParam *return_vals;
int nreturn_vals; int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_detach_parasite", return_vals = gimp_run_procedure ("gimp_parasite_detach",
&nreturn_vals, &nreturn_vals,
PARAM_STRING, name, PARAM_STRING, name,
PARAM_END); PARAM_END);

View file

@ -102,7 +102,7 @@ void check_drawables(void)
/* Check if bump-map is grayscale and of the same size as the input drawable */ /* Check if bump-map is grayscale and of the same size as the input drawable */
/* ========================================================================= */ /* ========================================================================= */
if (!gimp_drawable_gray(mapvals.bumpmap_id) || if (!gimp_drawable_is_gray(mapvals.bumpmap_id) ||
gimp_drawable_width(mapvals.drawable_id)!=gimp_drawable_width(mapvals.bumpmap_id) || gimp_drawable_width(mapvals.drawable_id)!=gimp_drawable_width(mapvals.bumpmap_id) ||
gimp_drawable_height(mapvals.drawable_id)!=gimp_drawable_height(mapvals.bumpmap_id)) gimp_drawable_height(mapvals.drawable_id)!=gimp_drawable_height(mapvals.bumpmap_id))
{ {
@ -119,7 +119,7 @@ void check_drawables(void)
/* Check if env-map is grayscale or has alpha */ /* Check if env-map is grayscale or has alpha */
/* ========================================== */ /* ========================================== */
if (gimp_drawable_gray(mapvals.envmap_id) || if (gimp_drawable_is_gray(mapvals.envmap_id) ||
gimp_drawable_has_alpha(mapvals.envmap_id)) gimp_drawable_has_alpha(mapvals.envmap_id))
{ {
/* If it has then we silently disable env mapping */ /* If it has then we silently disable env mapping */

View file

@ -480,7 +480,7 @@ gint bumpmap_constrain(gint32 image_id, gint32 drawable_id, gpointer data)
if (drawable_id == -1) if (drawable_id == -1)
return(TRUE); return(TRUE);
return (gimp_drawable_gray(drawable_id) && !gimp_drawable_has_alpha(drawable_id) && return (gimp_drawable_is_gray(drawable_id) && !gimp_drawable_has_alpha(drawable_id) &&
gimp_drawable_width(drawable_id)==gimp_drawable_width(mapvals.drawable_id) && gimp_drawable_width(drawable_id)==gimp_drawable_width(mapvals.drawable_id) &&
gimp_drawable_height(drawable_id)==gimp_drawable_height(mapvals.drawable_id)); gimp_drawable_height(drawable_id)==gimp_drawable_height(mapvals.drawable_id));
} }
@ -495,7 +495,7 @@ gint envmap_constrain(gint32 image_id, gint32 drawable_id, gpointer data)
if (drawable_id == -1) if (drawable_id == -1)
return(TRUE); return(TRUE);
return (!gimp_drawable_gray(drawable_id) && !gimp_drawable_has_alpha(drawable_id)); return (!gimp_drawable_is_gray(drawable_id) && !gimp_drawable_has_alpha(drawable_id));
} }
void envmap_drawable_callback(gint32 id, gpointer data) void envmap_drawable_callback(gint32 id, gpointer data)

View file

@ -102,7 +102,7 @@ void check_drawables(GDrawable *drawable)
mapvals.boxmap_id[i] = drawable->id; mapvals.boxmap_id[i] = drawable->id;
else if (mapvals.boxmap_id[i]!=-1 && gimp_drawable_image_id(mapvals.boxmap_id[i])==-1) else if (mapvals.boxmap_id[i]!=-1 && gimp_drawable_image_id(mapvals.boxmap_id[i])==-1)
mapvals.boxmap_id[i] = drawable->id; mapvals.boxmap_id[i] = drawable->id;
else if (gimp_drawable_gray(mapvals.boxmap_id[i])) else if (gimp_drawable_is_gray(mapvals.boxmap_id[i]))
mapvals.boxmap_id[i] = drawable->id; mapvals.boxmap_id[i] = drawable->id;
} }
@ -116,7 +116,7 @@ void check_drawables(GDrawable *drawable)
else if (mapvals.cylindermap_id[i]!=-1 && else if (mapvals.cylindermap_id[i]!=-1 &&
gimp_drawable_image_id(mapvals.cylindermap_id[i])==-1) gimp_drawable_image_id(mapvals.cylindermap_id[i])==-1)
mapvals.cylindermap_id[i] = drawable->id; mapvals.cylindermap_id[i] = drawable->id;
else if (gimp_drawable_gray(mapvals.cylindermap_id[i])) else if (gimp_drawable_is_gray(mapvals.cylindermap_id[i]))
mapvals.cylindermap_id[i] = drawable->id; mapvals.cylindermap_id[i] = drawable->id;
} }
} }

View file

@ -568,7 +568,7 @@ gint box_constrain(gint32 image_id, gint32 drawable_id, gpointer data)
if (drawable_id == -1) if (drawable_id == -1)
return(TRUE); return(TRUE);
return (gimp_drawable_color(drawable_id) && !gimp_drawable_indexed(drawable_id)); return (gimp_drawable_color(drawable_id) && !gimp_drawable_is_indexed(drawable_id));
} }
void box_drawable_callback(gint32 id, gpointer data) void box_drawable_callback(gint32 id, gpointer data)
@ -585,7 +585,7 @@ gint cylinder_constrain(gint32 image_id, gint32 drawable_id, gpointer data)
if (drawable_id == -1) if (drawable_id == -1)
return(TRUE); return(TRUE);
return (gimp_drawable_color(drawable_id) && !gimp_drawable_indexed(drawable_id)); return (gimp_drawable_color(drawable_id) && !gimp_drawable_is_indexed(drawable_id));
} }
void cylinder_drawable_callback(gint32 id, gpointer data) void cylinder_drawable_callback(gint32 id, gpointer data)

View file

@ -598,7 +598,7 @@ MAIN_FUNCTION (gint preview_p)
drawable = gimp_drawable_get (drawable_id); drawable = gimp_drawable_get (drawable_id);
gimp_drawable_mask_bounds (drawable_id, &x1, &y1, &x2, &y2); gimp_drawable_mask_bounds (drawable_id, &x1, &y1, &x2, &y2);
src_has_alpha = dest_has_alpha = gimp_drawable_has_alpha (drawable_id); src_has_alpha = dest_has_alpha = gimp_drawable_has_alpha (drawable_id);
src_is_gray = dest_is_gray = gimp_drawable_gray (drawable_id); src_is_gray = dest_is_gray = gimp_drawable_is_gray (drawable_id);
src_bpp = dest_bpp = (src_is_gray ? 1 : 3) + (src_has_alpha ? 1 : 0); src_bpp = dest_bpp = (src_is_gray ? 1 : 3) + (src_has_alpha ? 1 : 0);
if (preview_p) if (preview_p)

View file

@ -99,8 +99,8 @@ static void run(char *name, int n_params, GParam * param, int *nreturn_vals,
/* Make sure that the drawable is gray or RGB color */ /* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_color(drawable->id) || if (gimp_drawable_color(drawable->id) ||
gimp_drawable_gray(drawable->id) || gimp_drawable_is_gray(drawable->id) ||
gimp_drawable_indexed(drawable->id)) gimp_drawable_is_indexed(drawable->id))
{ {
gimp_progress_init(_("Cropping...")); gimp_progress_init(_("Cropping..."));
gimp_tile_cache_ntiles(2 * (drawable->width / gimp_tile_width() + 1)); gimp_tile_cache_ntiles(2 * (drawable->width / gimp_tile_width() + 1));

View file

@ -114,7 +114,7 @@ run (char *name,
image_ID = param[1].data.d_image; image_ID = param[1].data.d_image;
/* Make sure that the drawable is gray or RGB color */ /* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) if (gimp_drawable_color (drawable->id) || gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init (_("Auto-Stretching HSV...")); gimp_progress_init (_("Auto-Stretching HSV..."));
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1)); gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
@ -123,7 +123,7 @@ run (char *name,
if (run_mode != RUN_NONINTERACTIVE) if (run_mode != RUN_NONINTERACTIVE)
gimp_displays_flush (); gimp_displays_flush ();
} }
else if (gimp_drawable_indexed (drawable->id)) else if (gimp_drawable_is_indexed (drawable->id))
{ {
indexed_autostretch_hsv (image_ID); indexed_autostretch_hsv (image_ID);

View file

@ -260,7 +260,7 @@ run (gchar *name,
break; break;
} }
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) if (gimp_drawable_color (drawable->id) || gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init ("Adding Blinds ..."); gimp_progress_init ("Adding Blinds ...");

View file

@ -261,7 +261,7 @@ run(char *name, int nparams, GParam *param, int *nreturn_vals,
* Make sure the drawable type is appropriate. * Make sure the drawable type is appropriate.
*/ */
if (gimp_drawable_color(drawable->id) || if (gimp_drawable_color(drawable->id) ||
gimp_drawable_gray(drawable->id)) { gimp_drawable_is_gray(drawable->id)) {
switch (run_mode) { switch (run_mode) {
/* /*

View file

@ -444,7 +444,7 @@ run(char *name,
if (status == STATUS_SUCCESS) { if (status == STATUS_SUCCESS) {
if ((gimp_drawable_color(drawable->id) || if ((gimp_drawable_color(drawable->id) ||
gimp_drawable_gray(drawable->id))) { gimp_drawable_is_gray(drawable->id))) {
/* Set the tile cache size */ /* Set the tile cache size */
gimp_tile_cache_ntiles(2*(drawable->width + gimp_tile_cache_ntiles(2*(drawable->width +
@ -1546,7 +1546,7 @@ dialog_constrain(gint32 image_id, gint32 drawable_id, gpointer data)
if (drawable_id == -1) if (drawable_id == -1)
return TRUE; return TRUE;
return (gimp_drawable_color(drawable_id) || gimp_drawable_gray(drawable_id)); return (gimp_drawable_color(drawable_id) || gimp_drawable_is_gray(drawable_id));
} /* dialog_constrain */ } /* dialog_constrain */

View file

@ -110,7 +110,7 @@ run (char *name,
image_ID = param[1].data.d_image; image_ID = param[1].data.d_image;
/* Make sure that the drawable is gray or RGB color */ /* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) if (gimp_drawable_color (drawable->id) || gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init (_("Auto-Stretching Contrast...")); gimp_progress_init (_("Auto-Stretching Contrast..."));
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1)); gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
@ -119,7 +119,7 @@ run (char *name,
if (run_mode != RUN_NONINTERACTIVE) if (run_mode != RUN_NONINTERACTIVE)
gimp_displays_flush (); gimp_displays_flush ();
} }
else if (gimp_drawable_indexed (drawable->id)) else if (gimp_drawable_is_indexed (drawable->id))
{ {
indexed_c_astretch (image_ID); indexed_c_astretch (image_ID);

View file

@ -159,7 +159,7 @@ run (gchar *name,
break; break;
} }
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) if (gimp_drawable_color (drawable->id) || gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init (_("Adding Checkerboard...")); gimp_progress_init (_("Adding Checkerboard..."));

View file

@ -116,7 +116,7 @@ run (char *name,
image_ID = param[1].data.d_image; image_ID = param[1].data.d_image;
/* Make sure that the drawable is gray or RGB color */ /* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) if (gimp_drawable_color (drawable->id) || gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init (_("Color Enhance...")); gimp_progress_init (_("Color Enhance..."));
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1)); gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
@ -125,7 +125,7 @@ run (char *name,
if (run_mode != RUN_NONINTERACTIVE) if (run_mode != RUN_NONINTERACTIVE)
gimp_displays_flush (); gimp_displays_flush ();
} }
else if (gimp_drawable_indexed (drawable->id)) else if (gimp_drawable_is_indexed (drawable->id))
{ {
indexed_Color_Enhance (image_ID); indexed_Color_Enhance (image_ID);

View file

@ -363,7 +363,7 @@ run (char *name,
else else
{ {
values[1].data.d_int32 = image_ID; values[1].data.d_int32 = image_ID;
gimp_image_enable_undo (image_ID); gimp_image_undo_enable (image_ID);
gimp_image_clean_all (image_ID); gimp_image_clean_all (image_ID);
if (run_mode != RUN_NONINTERACTIVE) if (run_mode != RUN_NONINTERACTIVE)
gimp_display_new (image_ID); gimp_display_new (image_ID);

View file

@ -235,7 +235,7 @@ static void run(char *name, int n_params, GParam * param,
/* Make sure that the drawable is gray or RGB color */ /* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_color(drawable->id) || if (gimp_drawable_color(drawable->id) ||
gimp_drawable_gray(drawable->id)) { gimp_drawable_is_gray(drawable->id)) {
gimp_progress_init(_("Applying convolution")); gimp_progress_init(_("Applying convolution"));
gimp_tile_cache_ntiles(2 * (drawable->width / gimp_tile_cache_ntiles(2 * (drawable->width /
gimp_tile_width() + 1)); gimp_tile_width() + 1));
@ -607,7 +607,7 @@ static void check_config(void){
my_config.channels[i]=0; my_config.channels[i]=0;
if(gimp_drawable_color(drawable->id)) if(gimp_drawable_color(drawable->id))
my_config.channels[0]=-1; my_config.channels[0]=-1;
else if(gimp_drawable_gray(drawable->id)) else if(gimp_drawable_is_gray(drawable->id))
for(i=1;i<4;i++) for(i=1;i<4;i++)
my_config.channels[i]=-1; my_config.channels[i]=-1;
if(!gimp_drawable_has_alpha(drawable->id)){ if(!gimp_drawable_has_alpha(drawable->id)){

View file

@ -137,7 +137,7 @@ run (gchar *name,
drawable_type == GRAYA_IMAGE || drawable_type == GRAYA_IMAGE ||
drawable_type == INDEXEDA_IMAGE); drawable_type == INDEXEDA_IMAGE);
parasite = gimp_image_find_parasite (image_ID, "gimp-comment"); parasite = gimp_image_parasite_find (image_ID, "gimp-comment");
if (parasite) if (parasite)
{ {
config.comment = g_strdup (parasite->data); config.comment = g_strdup (parasite->data);
@ -151,14 +151,14 @@ run (gchar *name,
!(x && config.comment && strcmp (x, config.comment) == 0)) !(x && config.comment && strcmp (x, config.comment) == 0))
{ {
if (!config.comment || !config.comment[0]) if (!config.comment || !config.comment[0])
gimp_image_detach_parasite (image_ID, "gimp-comment"); gimp_image_parasite_detach (image_ID, "gimp-comment");
else else
{ {
parasite = parasite_new ("gimp-comment", parasite = parasite_new ("gimp-comment",
PARASITE_PERSISTENT, PARASITE_PERSISTENT,
strlen (config.comment) + 1, strlen (config.comment) + 1,
config.comment); config.comment);
gimp_image_attach_parasite (image_ID, parasite); gimp_image_parasite_attach (image_ID, parasite);
parasite_free (parasite); parasite_free (parasite);
} }
} }

View file

@ -243,7 +243,7 @@ run (char *name,
/* Render the cubism effect */ /* Render the cubism effect */
if ((status == STATUS_SUCCESS) && if ((status == STATUS_SUCCESS) &&
(gimp_drawable_color (active_drawable->id) || gimp_drawable_gray (active_drawable->id))) (gimp_drawable_color (active_drawable->id) || gimp_drawable_is_gray (active_drawable->id)))
{ {
/* set cache size */ /* set cache size */
gimp_tile_cache_ntiles (SQR (4 * cvals.tile_size * cvals.tile_saturation) / SQR (gimp_tile_width ())); gimp_tile_cache_ntiles (SQR (4 * cvals.tile_size * cvals.tile_saturation) / SQR (gimp_tile_width ()));

View file

@ -840,7 +840,7 @@ run (char *name, /* name of plugin */
gimp_run_procedure ("gimp_undo_push_group_start", &l_nreturn_vals, gimp_run_procedure ("gimp_undo_push_group_start", &l_nreturn_vals,
PARAM_IMAGE, l_image_id, PARAM_END); PARAM_IMAGE, l_image_id, PARAM_END);
if(!gimp_drawable_layer(l_layer_id)) if(!gimp_drawable_is_layer(l_layer_id))
{ {
gimp_message(PLUG_IN_PRINT_NAME " operates on layers only (but was called on channel or mask)"); gimp_message(PLUG_IN_PRINT_NAME " operates on layers only (but was called on channel or mask)");
printf("Passed drawable is no Layer\n"); printf("Passed drawable is no Layer\n");

View file

@ -320,7 +320,7 @@ run (char *name,
for (j = 0; j < num_images; j++) for (j = 0; j < num_images; j++)
{ {
values[j+1].data.d_int32 = image_ID_extract[j]; values[j+1].data.d_int32 = image_ID_extract[j];
gimp_image_enable_undo (image_ID_extract[j]); gimp_image_undo_enable (image_ID_extract[j]);
gimp_image_clean_all (image_ID_extract[j]); gimp_image_clean_all (image_ID_extract[j]);
if (run_mode != RUN_NONINTERACTIVE) if (run_mode != RUN_NONINTERACTIVE)
gimp_display_new (image_ID_extract[j]); gimp_display_new (image_ID_extract[j]);

View file

@ -126,7 +126,7 @@ run (char *name,
if (status == STATUS_SUCCESS) if (status == STATUS_SUCCESS)
{ {
/* Make sure that the drawable is gray or RGB color */ /* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) if (gimp_drawable_color (drawable->id) || gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init ("deinterlace"); gimp_progress_init ("deinterlace");
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1)); gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));

View file

@ -962,7 +962,7 @@ gint constraintResultSizeAndResultColorOrGray(gint32 imageId,
gimp_drawable_height(dm->params.result)) && gimp_drawable_height(dm->params.result)) &&
((gimp_drawable_color(drawableId) && ((gimp_drawable_color(drawableId) &&
(gimp_drawable_color(dm->params.result))) || (gimp_drawable_color(dm->params.result))) ||
gimp_drawable_gray( drawableId)))); gimp_drawable_is_gray( drawableId))));
} }
gint constraintResultSizeAndGray(gint32 imageId, gint constraintResultSizeAndGray(gint32 imageId,
@ -974,7 +974,7 @@ gint constraintResultSizeAndGray(gint32 imageId,
gimp_drawable_width( dm->params.result)) && gimp_drawable_width( dm->params.result)) &&
(gimp_drawable_height(drawableId) == (gimp_drawable_height(drawableId) ==
gimp_drawable_height(dm->params.result)) && gimp_drawable_height(dm->params.result)) &&
(gimp_drawable_gray( drawableId)))); (gimp_drawable_is_gray( drawableId))));
} }
void dialogOkCallback(GtkWidget *widget, gpointer data) { void dialogOkCallback(GtkWidget *widget, gpointer data) {

View file

@ -43,6 +43,9 @@
* Revision History: * Revision History:
* *
* $Log$ * $Log$
* Revision 1.16 1999/10/17 00:07:38 pcg
* API PATCH #2 or so
*
* Revision 1.15 1999/04/23 06:35:14 asbjoer * Revision 1.15 1999/04/23 06:35:14 asbjoer
* use MAIN macro * use MAIN macro
* *
@ -394,7 +397,7 @@ run(char *name, /* I - Name of filter program. */
if (status == STATUS_SUCCESS) if (status == STATUS_SUCCESS)
{ {
if ((gimp_drawable_color(drawable->id) || if ((gimp_drawable_color(drawable->id) ||
gimp_drawable_gray(drawable->id))) gimp_drawable_is_gray(drawable->id)))
{ {
/* /*
* Set the tile cache size... * Set the tile cache size...

View file

@ -251,7 +251,7 @@ run(char *name, /* I - Name of filter program. */
if (status == STATUS_SUCCESS) if (status == STATUS_SUCCESS)
{ {
if ((gimp_drawable_color(drawable->id) || if ((gimp_drawable_color(drawable->id) ||
gimp_drawable_gray(drawable->id))) gimp_drawable_is_gray(drawable->id)))
{ {
/* /*
* Set the tile cache size... * Set the tile cache size...

View file

@ -226,7 +226,7 @@ run (gchar *name,
} }
/* make sure the drawable exist and is not indexed */ /* make sure the drawable exist and is not indexed */
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) if (gimp_drawable_color (drawable->id) || gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init ("Edge detection..."); gimp_progress_init ("Edge detection...");

View file

@ -344,7 +344,7 @@ run (char *name,
else else
{ {
values[1].data.d_int32 = image_ID; values[1].data.d_int32 = image_ID;
gimp_image_enable_undo (image_ID); gimp_image_undo_enable (image_ID);
gimp_image_clean_all (image_ID); gimp_image_clean_all (image_ID);
if (run_mode != RUN_NONINTERACTIVE) if (run_mode != RUN_NONINTERACTIVE)
gimp_display_new (image_ID); gimp_display_new (image_ID);

View file

@ -254,7 +254,7 @@ static void run (gchar *name,
if (status == STATUS_SUCCESS) if (status == STATUS_SUCCESS)
{ {
/* Make sure that the drawable is gray or RGB color */ /* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) if (gimp_drawable_color (drawable->id) || gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init ("Render flare..."); gimp_progress_init ("Render flare...");
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1)); gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));

View file

@ -92,7 +92,7 @@ run (char *name,
drawable = gimp_drawable_get (param[2].data.d_drawable); drawable = gimp_drawable_get (param[2].data.d_drawable);
mask=gimp_drawable_get(gimp_image_get_selection(param[1].data.d_image)); mask=gimp_drawable_get(gimp_image_get_selection(param[1].data.d_image));
if (gimp_drawable_indexed (drawable->id) ||gimp_drawable_gray (drawable->id) ) { if (gimp_drawable_is_indexed (drawable->id) ||gimp_drawable_is_gray (drawable->id) ) {
ErrorMessage("Convert the image to RGB first!"); ErrorMessage("Convert the image to RGB first!");
status = STATUS_EXECUTION_ERROR; status = STATUS_EXECUTION_ERROR;
} }

View file

@ -188,7 +188,7 @@ static void run( char *name, int argc, GParam *args, int *retc, GParam **rets )
pixels_init( drawable ); pixels_init( drawable );
if( !gimp_drawable_color( drawable->id ) && if( !gimp_drawable_color( drawable->id ) &&
!gimp_drawable_gray( drawable->id ) ){ !gimp_drawable_is_gray( drawable->id ) ){
status = STATUS_EXECUTION_ERROR; status = STATUS_EXECUTION_ERROR;
} }

View file

@ -202,7 +202,7 @@ run (gchar *name,
/* Make sure that the drawable is gray or RGB color */ /* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_color (drawable->id) || if (gimp_drawable_color (drawable->id) ||
gimp_drawable_gray (drawable->id)) gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init ("IIR Gaussian Blur"); gimp_progress_init ("IIR Gaussian Blur");

View file

@ -195,7 +195,7 @@ run (gchar *name,
/* Make sure that the drawable is gray or RGB color */ /* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_color (drawable->id) || if (gimp_drawable_color (drawable->id) ||
gimp_drawable_gray (drawable->id)) gimp_drawable_is_gray (drawable->id))
{ {
gimp_progress_init ("RLE Gaussian Blur"); gimp_progress_init ("RLE Gaussian Blur");

View file

@ -889,7 +889,7 @@ save_image (char *filename,
comment_parasite = parasite_new ("gimp-comment", PARASITE_PERSISTENT, comment_parasite = parasite_new ("gimp-comment", PARASITE_PERSISTENT,
strlen (globalcomment)+1, strlen (globalcomment)+1,
(void*) globalcomment); (void*) globalcomment);
gimp_image_attach_parasite (orig_image_ID, comment_parasite); gimp_image_parasite_attach (orig_image_ID, comment_parasite);
parasite_free (comment_parasite); parasite_free (comment_parasite);
comment_parasite = NULL; comment_parasite = NULL;
} }
@ -1349,7 +1349,7 @@ save_dialog ( gint32 image_ID )
g_free(globalcomment); g_free(globalcomment);
} }
#ifdef FACEHUGGERS #ifdef FACEHUGGERS
GIF2_CMNT = gimp_image_find_parasite (image_ID, "gimp-comment"); GIF2_CMNT = gimp_image_parasite_find (image_ID, "gimp-comment");
if (GIF2_CMNT) if (GIF2_CMNT)
{ {
globalcomment = g_malloc(GIF2_CMNT->size); globalcomment = g_malloc(GIF2_CMNT->size);

View file

@ -422,7 +422,7 @@ load_image (char *filename)
#ifdef FACEHUGGERS #ifdef FACEHUGGERS
if (comment_parasite != NULL) if (comment_parasite != NULL)
{ {
gimp_image_attach_parasite (image_ID, comment_parasite); gimp_image_parasite_attach (image_ID, comment_parasite);
parasite_free (comment_parasite); parasite_free (comment_parasite);
comment_parasite = NULL; comment_parasite = NULL;
} }

Some files were not shown because too many files have changed in this diff Show more