kill whitespace in blank lines.

2004-03-26  Manish Singh  <yosh@gimp.org>

        * tools/pdbgen/app.pl: kill whitespace in blank lines.

        * app/pdb/*.c: regenerated, no code changes, only whitespace.
This commit is contained in:
Manish Singh 2004-03-26 16:38:44 +00:00 committed by Manish Singh
parent ef798bbcc3
commit 5c592d52c1
34 changed files with 367 additions and 359 deletions

View File

@ -1,3 +1,9 @@
2004-03-26 Manish Singh <yosh@gimp.org>
* tools/pdbgen/app.pl: kill whitespace in blank lines.
* app/pdb/*.c: regenerated, no code changes, only whitespace.
2004-03-26 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable-transform.c

View File

@ -249,20 +249,20 @@ brushes_set_popup_invoker (Gimp *gimp,
GimpBrush *active = (GimpBrush *)
gimp_container_get_child_by_name (gimp->brush_factory->container,
brush_name);
if (active)
{
GtkAdjustment *spacing_adj;
spacing_adj = GIMP_BRUSH_FACTORY_VIEW (brush_select->view)->spacing_adjustment;
gimp_context_set_brush (brush_select->context, active);
gimp_context_set_opacity (brush_select->context, opacity / 100.0);
gimp_context_set_paint_mode (brush_select->context, paint_mode);
if (spacing >= 0)
gtk_adjustment_set_value (spacing_adj, spacing);
gtk_window_present (GTK_WINDOW (brush_select->shell));
}
else

View File

@ -236,7 +236,7 @@ brushes_set_brush_invoker (Gimp *gimp,
{
brush = (GimpBrush *)
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
if (brush)
gimp_context_set_brush (gimp_get_current_context (gimp), brush);
else
@ -534,7 +534,7 @@ brushes_get_brush_data_invoker (Gimp *gimp,
{
brush = gimp_context_get_brush (gimp_get_current_context (gimp));
}
if (brush)
{
length = brush->mask->height * brush->mask->width;

View File

@ -97,7 +97,7 @@ channel_new_invoker (Gimp *gimp,
if (success)
{
GimpRGB rgb_color = color;
rgb_color.a = opacity / 100.0;
channel = gimp_channel_new (gimage, width, height, name, &rgb_color);
success = channel != NULL;
@ -597,7 +597,7 @@ channel_set_color_invoker (Gimp *gimp,
if (success)
{
GimpRGB rgb_color = color;
rgb_color.a = channel->color.a;
gimp_channel_set_color (channel, &rgb_color, TRUE);
}

View File

@ -109,28 +109,28 @@ brightness_contrast_invoker (Gimp *gimp,
{
if (gimp_drawable_is_indexed (drawable))
success = FALSE;
if (success)
{
gimage = gimp_item_get_image (GIMP_ITEM (drawable));
lut = brightness_contrast_lut_new (brightness / 255.0,
contrast / 127.0,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE, _("Brightness-Contrast"));
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
@ -227,42 +227,42 @@ levels_invoker (Gimp *gimp,
(gimp_drawable_is_gray (drawable) &&
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
success = FALSE;
if (success)
{
/* FIXME: hack */
if (gimp_drawable_is_gray (drawable) && gimp_drawable_has_alpha (drawable))
channel = (channel > 1) ? 2 : 1;
lut = gimp_lut_new ();
levels_init (&l);
l.low_input[channel] = low_input;
l.high_input[channel] = high_input;
l.gamma[channel] = gamma;
l.low_output[channel] = low_output;
l.high_output[channel] = high_output;
/* setup the lut */
gimp_lut_setup (lut,
(GimpLutFunc) levels_lut_func,
&l,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE, _("Levels"));
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
@ -347,40 +347,40 @@ levels_auto_invoker (Gimp *gimp,
{
if (gimp_drawable_is_indexed (drawable))
success = FALSE;
if (success)
{
/* Build the histogram */
image = gimp_item_get_image (GIMP_ITEM (drawable));
hist = gimp_histogram_new (GIMP_BASE_CONFIG (image->gimp->config));
gimp_drawable_calculate_histogram (drawable, hist);
/* Calculate the levels */
levels_init (&levels);
levels_auto (&levels, hist, ! gimp_drawable_is_gray (drawable));
/* Set up the lut */
lut = gimp_lut_new ();
gimp_lut_setup (lut,
(GimpLutFunc) levels_lut_func,
&levels,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_histogram_free (hist);
gimp_drawable_merge_shadow (drawable, TRUE, _("Levels"));
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
@ -438,26 +438,26 @@ posterize_invoker (Gimp *gimp,
{
if (gimp_drawable_is_indexed (drawable))
success = FALSE;
if (success)
{
gimage = gimp_item_get_image (GIMP_ITEM (drawable));
lut = posterize_lut_new (levels, gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE, _("Posterize"));
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
@ -682,43 +682,43 @@ curves_spline_invoker (Gimp *gimp,
(gimp_drawable_is_gray (drawable) &&
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
success = FALSE;
if (success)
{
/* FIXME: hack */
if (gimp_drawable_is_gray (drawable) && gimp_drawable_has_alpha (drawable))
channel = (channel > 1) ? 2 : 1;
lut = gimp_lut_new ();
curves_init (&c);
for (j = 0; j < num_points / 2; j++)
{
c.points[channel][j][0] = control_pts[j * 2];
c.points[channel][j][1] = control_pts[j * 2 + 1];
}
curves_calculate_curve (&c, channel);
gimp_lut_setup (lut,
(GimpLutFunc) curves_lut_func,
&c,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE, _("Curves"));
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
@ -804,38 +804,38 @@ curves_explicit_invoker (Gimp *gimp,
(gimp_drawable_is_gray (drawable) &&
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
success = FALSE;
if (success)
{
/* FIXME: hack */
if (gimp_drawable_is_gray (drawable) && gimp_drawable_has_alpha (drawable))
channel = (channel > 1) ? 2 : 1;
lut = gimp_lut_new ();
curves_init (&c);
for (j = 0; j < 256; j++)
c.curve[channel][j] = curve[j];
gimp_lut_setup (lut,
(GimpLutFunc) curves_lut_func,
&c,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE, _("Curves"));
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
@ -926,34 +926,34 @@ color_balance_invoker (Gimp *gimp,
{
if (gimp_drawable_is_indexed (drawable))
success = FALSE;
if (success)
{
color_balance_init (&cb);
cb.preserve_luminosity = preserve_lum;
cb.cyan_red[transfer_mode] = cyan_red;
cb.magenta_green[transfer_mode] = magenta_green;
cb.yellow_blue[transfer_mode] = yellow_blue;
color_balance_create_lookup_tables (&cb);
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
for (pr = pixel_regions_register (2, &srcPR, &destPR);
pr;
pr = pixel_regions_process (pr))
{
color_balance (&srcPR, &destPR, &cb);
}
gimp_drawable_merge_shadow (drawable, TRUE, _("Color Balance"));
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
@ -1053,15 +1053,15 @@ histogram_invoker (Gimp *gimp,
(gimp_drawable_is_gray (drawable) &&
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
success = FALSE;
if (success)
{
GimpHistogram *histogram;
histogram = gimp_histogram_new (GIMP_BASE_CONFIG (gimp->config));
gimp_drawable_calculate_histogram (drawable, histogram);
mean = gimp_histogram_get_mean (histogram, channel,
start_range, end_range);
std_dev = gimp_histogram_get_std_dev (histogram, channel,
@ -1072,7 +1072,7 @@ histogram_invoker (Gimp *gimp,
count = gimp_histogram_get_count (histogram, channel,
start_range, end_range);
percentile = count / pixels;
gimp_histogram_free (histogram);
}
}
@ -1205,33 +1205,33 @@ hue_saturation_invoker (Gimp *gimp,
{
if (gimp_drawable_is_indexed (drawable))
success = FALSE;
if (success)
{
hue_saturation_init (&hs);
hs.hue[hue_range] = hue_offset;
hs.lightness[hue_range] = lightness;
hs.saturation[hue_range] = saturation;
/* Calculate the transfer arrays */
hue_saturation_calculate_transfers (&hs);
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
for (pr = pixel_regions_register (2, &srcPR, &destPR);
pr;
pr = pixel_regions_process (pr))
{
hue_saturation (&srcPR, &destPR, &hs);
}
gimp_drawable_merge_shadow (drawable, TRUE, _("Hue-Saturation"));
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
@ -1313,24 +1313,24 @@ threshold_invoker (Gimp *gimp,
{
if (gimp_drawable_is_indexed (drawable) || (low_threshold >= high_threshold))
success = FALSE;
if (success)
{
tr.color = gimp_drawable_is_rgb (drawable);
tr.low_threshold = low_threshold;
tr.high_threshold = high_threshold;
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) threshold_2, &tr, 2,
&srcPR, &destPR);
gimp_drawable_merge_shadow (drawable, TRUE, _("Threshold"));
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}

View File

@ -179,7 +179,7 @@ image_convert_indexed_invoker (Gimp *gimp,
if (success)
{
GimpPalette *palette = NULL;
if (gimp_image_base_type (gimage) != GIMP_INDEXED)
{
switch (palette_type)
@ -188,20 +188,20 @@ image_convert_indexed_invoker (Gimp *gimp,
if (num_cols < 1 || num_cols > MAXNUMCOLORS)
success = FALSE;
break;
case GIMP_CUSTOM_PALETTE:
if (! gimp->palette_factory->container->num_children)
gimp_data_factory_data_init (gimp->palette_factory, FALSE);
palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container,
palette_name);
if (palette == NULL)
success = FALSE;
break;
default:
break;
}
@ -210,7 +210,7 @@ image_convert_indexed_invoker (Gimp *gimp,
{
success = FALSE;
}
if (success)
gimp_image_convert (gimage, GIMP_INDEXED, num_cols, dither_type,
alpha_dither, remove_unused, palette_type, palette);

View File

@ -65,9 +65,9 @@ display_new_invoker (Gimp *gimp,
if (success)
{
display = (GimpDisplay *) gimp_create_display (gimp, gimage, 1.0);
success = (display != NULL);
/* the first display takes ownership of the image */
if (success && gimage->disp_count == 1)
g_object_unref (gimage);

View File

@ -1511,12 +1511,12 @@ drawable_merge_shadow_invoker (Gimp *gimp,
{
if (gimp->current_plug_in)
undo_desc = plug_in_get_undo_desc (gimp->current_plug_in);
if (! undo_desc)
undo_desc = g_strdup (_("Plug-In"));
gimp_drawable_merge_shadow (drawable, undo, undo_desc);
g_free (undo_desc);
}
@ -1661,17 +1661,17 @@ drawable_get_pixel_invoker (Gimp *gimp,
{
num_channels = gimp_drawable_bytes (drawable);
pixel = g_new (guint8, num_channels);
tile = tile_manager_get_tile (gimp_drawable_data (drawable), x, y,
TRUE, TRUE);
x %= TILE_WIDTH;
y %= TILE_HEIGHT;
p = tile_data_pointer (tile, x, y);
for (b = 0; b < num_channels; b++)
pixel[b] = p[b];
tile_release (tile, FALSE);
}
else
@ -1776,14 +1776,14 @@ drawable_set_pixel_invoker (Gimp *gimp,
{
tile = tile_manager_get_tile (gimp_drawable_data (drawable), x, y,
TRUE, TRUE);
x %= TILE_WIDTH;
y %= TILE_HEIGHT;
p = tile_data_pointer (tile, x, y);
for (b = 0; b < num_channels; b++)
*p++ = *pixel++;
tile_release (tile, TRUE);
}
else
@ -2000,16 +2000,16 @@ drawable_thumbnail_invoker (Gimp *gimp,
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
TempBuf *buf;
gint dwidth, dheight;
/* Adjust the width/height ratio */
dwidth = gimp_item_width (GIMP_ITEM (drawable));
dheight = gimp_item_height (GIMP_ITEM (drawable));
if (dwidth > dheight)
req_height = MAX (1, (req_width * dheight) / dwidth);
else
req_width = MAX (1, (req_height * dwidth) / dheight);
if (gimage->gimp->config->layer_previews)
buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (drawable),
req_width, req_height);
@ -2018,7 +2018,7 @@ drawable_thumbnail_invoker (Gimp *gimp,
req_width, req_height,
gimp_drawable_has_alpha (drawable) ?
4 : 3);
if (buf)
{
num_bytes = buf->height * buf->width * buf->bytes;
@ -2026,7 +2026,7 @@ drawable_thumbnail_invoker (Gimp *gimp,
width = buf->width;
height = buf->height;
bpp = buf->bytes;
temp_buf_free (buf);
}
else

View File

@ -205,7 +205,7 @@ edit_paste_invoker (Gimp *gimp,
{
success = (gimp_item_is_attached (GIMP_ITEM (drawable)) &&
gimp->global_buffer != NULL);
if (success)
{
layer = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
@ -408,7 +408,7 @@ edit_bucket_fill_invoker (Gimp *gimp,
if (success)
{
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
if (! gimage)
{
success = FALSE;
@ -416,9 +416,9 @@ edit_bucket_fill_invoker (Gimp *gimp,
else
{
gboolean do_seed_fill;
do_seed_fill = gimp_channel_is_empty (gimp_image_get_mask (gimage));
gimp_drawable_bucket_fill (drawable, fill_mode,
paint_mode, opacity / 100.0,
do_seed_fill,
@ -701,11 +701,11 @@ edit_stroke_invoker (Gimp *gimp,
{
GimpImage *gimage;
GimpToolInfo *tool_info;
gimage = gimp_item_get_image (GIMP_ITEM (drawable));
tool_info = gimp_context_get_tool (gimp_get_current_context (gimp));
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (gimage)),
drawable,
GIMP_OBJECT (tool_info->paint_info),

View File

@ -271,49 +271,49 @@ file_load_thumbnail_invoker (Gimp *gimp,
if (success)
{
uri = g_filename_to_uri (filename, NULL, NULL);
if (uri)
{
thumbnail = gimp_thumbnail_new ();
gimp_thumbnail_set_uri (thumbnail, uri);
pixbuf = gimp_thumbnail_load_thumb (thumbnail,
GIMP_THUMBNAIL_SIZE_NORMAL,
NULL);
}
if (pixbuf)
{
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
if (gdk_pixbuf_get_n_channels (pixbuf) != 3)
{
GdkPixbuf *tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8,
width, height);
gdk_pixbuf_composite_color (pixbuf, tmp,
0, 0, width, height, 0, 0, 1.0, 1.0,
GDK_INTERP_NEAREST, 255,
0, 0, GIMP_SMALL_CHECKS,
0x666666ff, 0x999999ff);
g_object_unref (pixbuf);
pixbuf = tmp;
}
num_bytes = 3 * width * height;
thumb_data = g_memdup (gdk_pixbuf_get_pixels (pixbuf), num_bytes);
g_object_unref (pixbuf);
success = TRUE;
}
else
{
success = FALSE;
}
g_free (uri);
}
@ -403,25 +403,25 @@ file_save_thumbnail_invoker (Gimp *gimp,
image_uri = gimp_object_get_name (GIMP_OBJECT (gimage));
if (! image_uri)
success = FALSE;
if (success)
{
uri = g_filename_to_uri (filename, NULL, NULL);
if (! uri)
success = FALSE;
if (success)
{
if (strcmp (uri, image_uri))
success = FALSE;
if (success)
{
imagefile = gimp_imagefile_new (gimp, uri);
success = gimp_imagefile_save_thumbnail (imagefile, gimage);
g_object_unref (imagefile);
}
g_free (uri);
}
}
@ -481,15 +481,15 @@ temp_name_invoker (Gimp *gimp,
{
if (id == 0)
pid = getpid ();
filename = g_strdup_printf ("gimp_temp_%d%d.%s",
pid, id++, extension);
path = gimp_config_path_expand (GIMP_BASE_CONFIG (gimp->config)->temp_path,
TRUE, NULL);
name = g_build_filename (path, filename, NULL);
g_free (path);
g_free (filename);
}
@ -561,9 +561,9 @@ register_magic_load_handler_invoker (Gimp *gimp,
if (success)
{
success = FALSE;
proc = procedural_db_lookup (gimp, name);
if (proc && ((proc->num_args < 3) ||
(proc->num_values < 1) ||
(proc->args[0].arg_type != GIMP_PDB_INT32) ||
@ -575,21 +575,21 @@ register_magic_load_handler_invoker (Gimp *gimp,
name);
goto done;
}
file_proc = plug_ins_file_handler (gimp, name, extensions, prefixes, magics);
if (! file_proc)
{
g_message ("attempt to register non-existant load handler \"%s\"",
name);
goto done;
}
if (! g_slist_find (gimp->load_procs, file_proc))
gimp->load_procs = g_slist_prepend (gimp->load_procs, file_proc);
success = TRUE;
done: ;
}
@ -709,9 +709,9 @@ register_save_handler_invoker (Gimp *gimp,
if (success)
{
success = FALSE;
proc = procedural_db_lookup (gimp, name);
if (proc && ((proc->num_args < 5) ||
(proc->args[0].arg_type != GIMP_PDB_INT32) ||
(proc->args[1].arg_type != GIMP_PDB_IMAGE) ||
@ -723,21 +723,21 @@ register_save_handler_invoker (Gimp *gimp,
name);
goto done;
}
file_proc = plug_ins_file_handler (gimp, name, extensions, prefixes, NULL);
if (! file_proc)
{
g_message ("attempt to register non-existant save handler \"%s\"",
name);
goto done;
}
if (! g_slist_find (gimp->save_procs, file_proc))
gimp->save_procs = g_slist_prepend (gimp->save_procs, file_proc);
success = TRUE;
done: ;
}

View File

@ -210,7 +210,7 @@ floating_sel_attach_invoker (Gimp *gimp,
if (success)
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
floating_sel_attach (layer, drawable);
}

View File

@ -196,11 +196,11 @@ fonts_set_popup_invoker (Gimp *gimp,
{
GimpFont *active = (GimpFont *)
gimp_container_get_child_by_name (gimp->fonts, font_name);
if (active)
{
gimp_context_set_font (font_select->context, active);
gtk_window_present (GTK_WINDOW (font_select->shell));
}
else

View File

@ -72,7 +72,7 @@ gimprc_query_invoker (Gimp *gimp,
{
/* use edit_config because unknown tokens are set there */
value = gimp_rc_query (GIMP_RC (gimp->edit_config), token);
if (! value)
success = FALSE;
}

View File

@ -212,11 +212,11 @@ gradients_set_popup_invoker (Gimp *gimp,
GimpGradient *active = (GimpGradient *)
gimp_container_get_child_by_name (gimp->gradient_factory->container,
gradient_name);
if (active)
{
gimp_context_set_gradient (gradient_select->context, active);
gtk_window_present (GTK_WINDOW (gradient_select->shell));
}
else

View File

@ -207,7 +207,7 @@ gradients_set_gradient_invoker (Gimp *gimp,
{
gradient = (GimpGradient *)
gimp_container_get_child_by_name (gimp->gradient_factory->container, name);
if (gradient)
gimp_context_set_gradient (gimp_get_current_context (gimp), gradient);
else
@ -267,22 +267,22 @@ gradients_sample_uniform_invoker (Gimp *gimp,
{
pos = 0.0;
delta = 1.0 / (i - 1);
array_length = i * 4;
pv = color_samples = g_new (gdouble, array_length);
gradient = gimp_context_get_gradient (gimp_get_current_context (gimp));
while (i--)
{
gimp_gradient_get_color_at (gradient, pos, reverse, &color);
*pv++ = color.r;
*pv++ = color.g;
*pv++ = color.b;
*pv++ = color.a;
pos += delta;
}
}
@ -368,20 +368,20 @@ gradients_sample_custom_invoker (Gimp *gimp,
if (success)
{
array_length = i * 4;
pv = color_samples = g_new (gdouble, array_length);
gradient = gimp_context_get_gradient (gimp_get_current_context (gimp));
while (i--)
{
gimp_gradient_get_color_at (gradient, *pos, reverse, &color);
*pv++ = color.r;
*pv++ = color.g;
*pv++ = color.b;
*pv++ = color.a;
pos++;
}
}
@ -480,29 +480,29 @@ gradients_get_gradient_data_invoker (Gimp *gimp,
{
gradient = gimp_context_get_gradient (gimp_get_current_context (gimp));
}
if (gradient)
{
gdouble *pv;
gdouble pos, delta;
GimpRGB color;
gint i;
i = sample_size;
pos = 0.0;
delta = 1.0 / (i - 1);
pv = values = g_new (gdouble, i * 4);
while (i--)
{
gimp_gradient_get_color_at (gradient, pos, reverse, &color);
*pv++ = color.r;
*pv++ = color.g;
*pv++ = color.b;
*pv++ = color.a;
pos += delta;
}
}

View File

@ -223,11 +223,11 @@ image_delete_guide_invoker (Gimp *gimp,
if (success)
{
success = FALSE;
for (guides = gimage->guides; guides; guides = g_list_next (guides))
{
GimpGuide *g = (GimpGuide *) guides->data;
if ((g->guide_ID == guide) && (g->position >= 0))
{
gimp_image_remove_guide (gimage, g, TRUE);
@ -294,22 +294,22 @@ image_find_next_guide_invoker (Gimp *gimp,
{
success = FALSE;
guide_found = FALSE;
for (guides = gimage->guides; guides; guides = g_list_next (guides))
{
GimpGuide *g = (GimpGuide *) guides->data;
if (g->position < 0)
continue;
if (guide == 0) /* init - Return first guide ID in list */
{
next_guide = g->guide_ID;
guide_found = TRUE;
break;
}
if (! guide_found)
{
if (g->guide_ID == guide)
@ -321,7 +321,7 @@ image_find_next_guide_invoker (Gimp *gimp,
break;
}
}
if (guide_found)
success = TRUE;
}
@ -394,15 +394,15 @@ image_get_guide_orientation_invoker (Gimp *gimp,
if (success)
{
success = FALSE;
for (guides = gimage->guides; guides; guides = g_list_next (guides))
{
GimpGuide *g = (GimpGuide *) guides->data;
if ((g->guide_ID == guide) && (g->position >= 0))
{
orientation = g->orientation;
success = TRUE;
break;
}
@ -476,15 +476,15 @@ image_get_guide_position_invoker (Gimp *gimp,
if (success)
{
success = FALSE;
for (guides = gimage->guides; guides; guides = g_list_next (guides))
{
GimpGuide *g = (GimpGuide *) guides->data;
if ((g->guide_ID == guide) && (g->position >= 0))
{
position = g->position;
success = TRUE;
break;
}

View File

@ -62,7 +62,7 @@ help_invoker (Gimp *gimp,
if (! help_domain && gimp->current_plug_in)
help_domain = (gchar *)
plug_ins_help_domain (gimp, gimp->current_plug_in->prog, NULL);
gimp_help (gimp, help_domain, help_id);
}

View File

@ -1011,7 +1011,7 @@ image_get_layers_invoker (Gimp *gimp,
{
list = GIMP_LIST (gimage->layers)->list;
num_layers = g_list_length (list);
if (num_layers)
{
layer_ids = g_new (gint32, num_layers);
@ -1090,7 +1090,7 @@ image_get_channels_invoker (Gimp *gimp,
{
list = GIMP_LIST (gimage->channels)->list;
num_channels = g_list_length (list);
if (num_channels)
{
channel_ids = g_new (gint32, num_channels);
@ -1324,7 +1324,7 @@ image_floating_sel_attached_to_invoker (Gimp *gimp,
if (success)
{
floating_sel = gimp_image_floating_sel (gimage);
if (floating_sel)
drawable = GIMP_DRAWABLE (GIMP_LAYER (floating_sel)->fs.drawable);
else
@ -1411,7 +1411,7 @@ image_pick_color_invoker (Gimp *gimp,
if (!sample_merged)
if (!drawable || (gimp_item_get_image (GIMP_ITEM (drawable)) != gimage))
success = FALSE;
if (success)
success = gimp_image_pick_color (gimage,
drawable,
@ -2713,18 +2713,18 @@ image_thumbnail_invoker (Gimp *gimp,
{
TempBuf *buf;
gint dwidth, dheight;
g_assert (GIMP_VIEWABLE_MAX_PREVIEW_SIZE >= 1024);
/* Adjust the width/height ratio */
dwidth = gimp_image_get_width (gimage);
dheight = gimp_image_get_height (gimage);
if (dwidth > dheight)
req_height = MAX (1, (req_width * dheight) / dwidth);
else
req_width = MAX (1, (req_height * dwidth) / dheight);
if (gimage->gimp->config->layer_previews)
buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (gimage),
req_width, req_height);
@ -2733,7 +2733,7 @@ image_thumbnail_invoker (Gimp *gimp,
req_width, req_height,
gimp_image_has_alpha (gimage) ?
4 : 3);
if (buf)
{
num_bytes = buf->height * buf->width * buf->bytes;
@ -2741,7 +2741,7 @@ image_thumbnail_invoker (Gimp *gimp,
width = buf->width;
height = buf->height;
bpp = buf->bytes;
temp_buf_free (buf);
}
else
@ -3207,7 +3207,7 @@ image_set_component_active_invoker (Gimp *gimp,
success = gimp_image_base_type (gimage) == GIMP_INDEXED;
else
success = gimp_image_base_type (gimage) == GIMP_RGB;
if (success)
gimp_image_set_component_active (gimage, component, active);
}
@ -3351,7 +3351,7 @@ image_set_component_visible_invoker (Gimp *gimp,
success = gimp_image_base_type (gimage) == GIMP_INDEXED;
else
success = gimp_image_base_type (gimage) == GIMP_RGB;
if (success)
gimp_image_set_component_visible (gimage, component, visible);
}
@ -3517,7 +3517,7 @@ image_get_name_invoker (Gimp *gimp,
if (success)
{
filename = gimp_image_get_filename (gimage);
if (filename)
{
name = g_path_get_basename (filename);

View File

@ -76,7 +76,7 @@ internal_procs_init (Gimp *gimp,
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (status_callback != NULL);
(* status_callback) (_("Internal Procedures"), _("Brush UI"), 0.0);
register_brush_select_procs (gimp);

View File

@ -245,17 +245,17 @@ layer_new_from_drawable_invoker (Gimp *gimp,
{
GType new_type;
GimpItem *new_item;
if (GIMP_IS_LAYER (drawable))
new_type = G_TYPE_FROM_INSTANCE (drawable);
else
new_type = GIMP_TYPE_LAYER;
if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type, TRUE);
else
new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type, TRUE);
if (new_item)
layer_copy = GIMP_LAYER (new_item);
else
@ -448,18 +448,18 @@ layer_scale_invoker (Gimp *gimp,
if ((gimage = gimp_item_get_image (GIMP_ITEM (layer))))
{
floating_layer = gimp_image_floating_sel (gimage);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_SCALE,
_("Scale Layer"));
if (floating_layer)
floating_sel_relax (floating_layer, TRUE);
gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height, gimp->config->interpolation_type, NULL, NULL, local_origin);
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gimp_image_undo_group_end (gimage);
}
else
@ -543,18 +543,18 @@ layer_resize_invoker (Gimp *gimp,
if ((gimage = gimp_item_get_image (GIMP_ITEM (layer))))
{
floating_layer = gimp_image_floating_sel (gimage);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_RESIZE,
_("Resize Layer"));
if (floating_layer)
floating_sel_relax (floating_layer, TRUE);
gimp_item_resize (GIMP_ITEM (layer), new_width, new_height, offx, offy);
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gimp_image_undo_group_end (gimage);
}
else
@ -680,27 +680,27 @@ layer_translate_invoker (Gimp *gimp,
if ((gimage = gimp_item_get_image (GIMP_ITEM (layer))))
{
floating_layer = gimp_image_floating_sel (gimage);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_DISPLACE,
_("Move Layer"));
if (floating_layer)
floating_sel_relax (floating_layer, TRUE);
gimp_item_translate (GIMP_ITEM (layer),
offx,
offy,
TRUE);
if (gimp_item_get_linked (GIMP_ITEM (layer)))
gimp_item_linked_translate (GIMP_ITEM (layer),
offx,
offy,
TRUE);
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gimp_image_undo_group_end (gimage);
}
else
@ -769,27 +769,27 @@ layer_set_offsets_invoker (Gimp *gimp,
if ((gimage = gimp_item_get_image (GIMP_ITEM (layer))))
{
floating_layer = gimp_image_floating_sel (gimage);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_DISPLACE,
_("Move Layer"));
if (floating_layer)
floating_sel_relax (floating_layer, TRUE);
gimp_item_translate (GIMP_ITEM (layer),
offx - GIMP_ITEM (layer)->offset_x,
offy - GIMP_ITEM (layer)->offset_y,
TRUE);
if (gimp_item_get_linked (GIMP_ITEM (layer)))
gimp_item_linked_translate (GIMP_ITEM (layer),
offx,
offy,
TRUE);
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);
gimp_image_undo_group_end (gimage);
}
else

View File

@ -59,12 +59,12 @@ message_invoker (Gimp *gimp,
if (success)
{
gchar *domain = NULL;
if (gimp->current_plug_in)
domain = plug_in_get_undo_desc (gimp->current_plug_in);
gimp_message (gimp, domain, message);
g_free (domain);
}

View File

@ -163,9 +163,9 @@ airbrush_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_AIRBRUSH_OPTIONS);
GIMP_AIRBRUSH_OPTIONS (options)->pressure = pressure;
success = paint_tools_stroke (gimp,
GIMP_TYPE_AIRBRUSH,
options,
@ -241,7 +241,7 @@ airbrush_default_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_AIRBRUSH_OPTIONS);
success = paint_tools_stroke (gimp,
GIMP_TYPE_AIRBRUSH,
options,
@ -328,20 +328,20 @@ clone_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_CLONE_OPTIONS);
GIMP_CLONE_OPTIONS (options)->clone_type = clone_type;
#ifdef __GNUC__
#warning FIXME: re-enable clone src_drawable
#endif
#if 0
FIXME
core->src_drawable = src_drawable;
core->src_x = srx_x;
core->src_y = src_y;
#endif
success = paint_tools_stroke (gimp,
GIMP_TYPE_CLONE,
options,
@ -432,7 +432,7 @@ clone_default_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_CLONE_OPTIONS);
success = paint_tools_stroke (gimp,
GIMP_TYPE_CLONE,
options,
@ -513,12 +513,12 @@ convolve_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_CONVOLVE_OPTIONS);
g_object_set (options,
"type", convolve_type,
"rate", pressure,
NULL);
success = paint_tools_stroke (gimp,
GIMP_TYPE_CONVOLVE,
options,
@ -599,7 +599,7 @@ convolve_default_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_CONVOLVE_OPTIONS);
success = paint_tools_stroke (gimp,
GIMP_TYPE_CONVOLVE,
options,
@ -685,13 +685,13 @@ dodgeburn_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_DODGE_BURN_OPTIONS);
g_object_set (options,
"type", dodgeburn_type,
"mode", dodgeburn_mode,
"exposure", exposure,
NULL);
success = paint_tools_stroke (gimp,
GIMP_TYPE_DODGE_BURN,
options,
@ -777,7 +777,7 @@ dodgeburn_default_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_DODGE_BURN_OPTIONS);
success = paint_tools_stroke (gimp,
GIMP_TYPE_DODGE_BURN,
options,
@ -858,12 +858,12 @@ eraser_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_ERASER_OPTIONS);
g_object_set (options,
"application-mode", method,
"hard", hardness,
NULL);
success = paint_tools_stroke (gimp,
GIMP_TYPE_ERASER,
options,
@ -944,7 +944,7 @@ eraser_default_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_ERASER_OPTIONS);
success = paint_tools_stroke (gimp,
GIMP_TYPE_ERASER,
options,
@ -1030,7 +1030,7 @@ paintbrush_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_PAINT_OPTIONS);
g_object_set (options,
"application-mode", method,
"use-fade", fade_out > 0.0,
@ -1038,7 +1038,7 @@ paintbrush_invoker (Gimp *gimp,
"use-gradient", gradient_length > 0.0,
"gradient-length", gradient_length,
NULL);
success = paint_tools_stroke (gimp,
GIMP_TYPE_PAINTBRUSH,
options,
@ -1124,7 +1124,7 @@ paintbrush_default_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_PAINT_OPTIONS);
success = paint_tools_stroke (gimp,
GIMP_TYPE_PAINTBRUSH,
options,
@ -1195,7 +1195,7 @@ pencil_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_PENCIL_OPTIONS);
success = paint_tools_stroke (gimp,
GIMP_TYPE_PENCIL,
options,
@ -1271,11 +1271,11 @@ smudge_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_SMUDGE_OPTIONS);
g_object_set (options,
"rate", pressure,
NULL);
success = paint_tools_stroke (gimp,
GIMP_TYPE_SMUDGE,
options,
@ -1351,7 +1351,7 @@ smudge_default_invoker (Gimp *gimp,
if (success)
{
options = gimp_paint_options_new (gimp, GIMP_TYPE_SMUDGE_OPTIONS);
success = paint_tools_stroke (gimp,
GIMP_TYPE_SMUDGE,
options,

View File

@ -200,11 +200,11 @@ palettes_set_popup_invoker (Gimp *gimp,
GimpPalette *active = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container,
palette_name);
if (active)
{
gimp_context_set_palette (palette_select->context, active);
gtk_window_present (GTK_WINDOW (palette_select->shell));
}
else

View File

@ -213,7 +213,7 @@ palettes_set_palette_invoker (Gimp *gimp,
{
palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette)
gimp_context_set_palette (gimp_get_current_context (gimp), palette);
else
@ -277,7 +277,7 @@ palettes_get_palette_entry_invoker (Gimp *gimp,
{
palette = gimp_context_get_palette (gimp_get_current_context (gimp));
}
if (palette)
{
if (entry_num < 0 || entry_num >= palette->n_colors)
@ -287,10 +287,10 @@ palettes_get_palette_entry_invoker (Gimp *gimp,
else
{
GimpPaletteEntry *entry;
entry = (GimpPaletteEntry *)
g_list_nth_data (palette->colors, entry_num);
color = entry->color;
}
}

View File

@ -162,7 +162,7 @@ path_get_current_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_active_vectors (gimage);
if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
else
@ -231,7 +231,7 @@ path_set_current_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_image_set_active_vectors (gimage, vectors);
else
@ -291,7 +291,7 @@ path_delete_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_image_remove_vectors (gimage, vectors);
else
@ -356,26 +356,26 @@ path_get_points_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
{
GimpVectorsCompatPoint *points;
gint num_points;
path_type = 1; /* BEZIER (1.2 compat) */
points = gimp_vectors_compat_get_points (vectors, &num_points,
&path_closed);
num_point_details = num_points * 3;
if (points)
{
gdouble *curr_point;
gint i;
points_pairs = g_new0 (gdouble, num_point_details);
for (i = 0, curr_point = points_pairs;
i < num_points;
i++, curr_point += 3)
@ -384,7 +384,7 @@ path_get_points_invoker (Gimp *gimp,
curr_point[1] = points[i].y;
curr_point[2] = points[i].type;
}
g_free (points);
}
else
@ -495,7 +495,7 @@ path_set_points_invoker (Gimp *gimp,
closed = TRUE;
else if ((num_path_points / 3) % 3 != 2)
success = FALSE;
if (success)
{
GimpVectors *vectors;
@ -503,11 +503,11 @@ path_set_points_invoker (Gimp *gimp,
GimpVectorsCompatPoint *points;
gint n_points;
gint i;
n_points = num_path_points / 3;
points = g_new0 (GimpVectorsCompatPoint, n_points);
for (i = 0, curr_point_pair = points_pairs;
i < n_points;
i++, curr_point_pair += 3)
@ -516,12 +516,12 @@ path_set_points_invoker (Gimp *gimp,
points[i].y = curr_point_pair[1];
points[i].type = curr_point_pair[2];
}
vectors = gimp_vectors_compat_new (gimage, name, points, n_points,
closed);
g_free (points);
if (vectors)
gimp_image_add_vectors (gimage, vectors, 0);
else
@ -594,13 +594,13 @@ path_stroke_current_invoker (Gimp *gimp,
{
vectors = gimp_image_get_active_vectors (gimage);
drawable = gimp_image_active_drawable (gimage);
if (vectors && drawable)
{
GimpToolInfo *tool_info;
tool_info = gimp_context_get_tool (gimp_get_current_context (gimp));
success = gimp_item_stroke (GIMP_ITEM (vectors), drawable,
GIMP_OBJECT (tool_info->paint_info),
TRUE /* use defaults, not tool option values */);
@ -659,7 +659,7 @@ path_get_point_at_dist_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_active_vectors (gimage);
if (vectors)
{
g_warning ("FIXME: path_get_point_at_dist() is unimplemented");
@ -752,7 +752,7 @@ path_get_tattoo_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
else
@ -829,7 +829,7 @@ path_set_tattoo_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue);
else
@ -894,7 +894,7 @@ get_path_by_tattoo_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo);
if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
else
@ -970,7 +970,7 @@ path_get_locked_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
lockstatus = gimp_item_get_linked (GIMP_ITEM (vectors));
else
@ -1047,7 +1047,7 @@ path_set_locked_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_item_set_linked (GIMP_ITEM (vectors), lockstatus, TRUE);
else
@ -1129,7 +1129,7 @@ path_to_selection_invoker (Gimp *gimp,
if (success)
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
_("Path to Selection"),

View File

@ -200,11 +200,11 @@ patterns_set_popup_invoker (Gimp *gimp,
GimpPattern *active = (GimpPattern *)
gimp_container_get_child_by_name (gimp->pattern_factory->container,
pattern_name);
if (active)
{
gimp_context_set_pattern (pattern_select->context, active);
gtk_window_present (GTK_WINDOW (pattern_select->shell));
}
else

View File

@ -218,7 +218,7 @@ patterns_set_pattern_invoker (Gimp *gimp,
{
pattern = (GimpPattern *)
gimp_container_get_child_by_name (gimp->pattern_factory->container, name);
if (success)
gimp_context_set_pattern (gimp_get_current_context (gimp), pattern);
else
@ -280,7 +280,7 @@ patterns_get_pattern_data_invoker (Gimp *gimp,
{
pattern = gimp_context_get_pattern (gimp_get_current_context (gimp));
}
if (pattern)
{
length = pattern->mask->height * pattern->mask->width *

View File

@ -480,20 +480,20 @@ procedural_db_query_invoker (Gimp *gimp,
regcomp (&pdb_query.copyright_regex, copyright, 0);
regcomp (&pdb_query.date_regex, date, 0);
regcomp (&pdb_query.proc_type_regex, proc_type, 0);
pdb_query.gimp = gimp;
pdb_query.list_of_procs = NULL;
pdb_query.num_procs = 0;
pdb_query.querying_compat = FALSE;
g_hash_table_foreach (gimp->procedural_ht,
procedural_db_query_entry, &pdb_query);
pdb_query.querying_compat = TRUE;
g_hash_table_foreach (gimp->procedural_compat_ht,
procedural_db_query_entry, &pdb_query);
regfree (&pdb_query.name_regex);
regfree (&pdb_query.blurb_regex);
regfree (&pdb_query.help_regex);
@ -600,7 +600,7 @@ procedural_db_proc_info_invoker (Gimp *gimp,
if (success)
{
proc = procedural_db_lookup (gimp, proc_name);
if (proc)
{
get_pdb_strings (&strings, proc, FALSE);
@ -608,18 +608,18 @@ procedural_db_proc_info_invoker (Gimp *gimp,
else
{
const gchar *compat_name;
compat_name = g_hash_table_lookup (gimp->procedural_compat_ht, proc_name);
if (compat_name)
{
proc = procedural_db_lookup (gimp, compat_name);
if (proc)
get_pdb_strings (&strings, proc, TRUE);
}
}
success = (proc != NULL);
}
@ -729,17 +729,17 @@ procedural_db_proc_arg_invoker (Gimp *gimp,
if (success)
{
proc = procedural_db_lookup (gimp, proc_name);
if (! proc)
{
const gchar *compat_name;
compat_name = g_hash_table_lookup (gimp->procedural_compat_ht, proc_name);
if (compat_name)
proc = procedural_db_lookup (gimp, compat_name);
}
if (proc && (arg_num >= 0 && arg_num < proc->num_args))
arg = &proc->args[arg_num];
else
@ -827,17 +827,17 @@ procedural_db_proc_val_invoker (Gimp *gimp,
if (success)
{
proc = procedural_db_lookup (gimp, proc_name);
if (! proc)
{
const gchar *compat_name;
compat_name = g_hash_table_lookup (gimp->procedural_compat_ht, proc_name);
if (compat_name)
proc = procedural_db_lookup (gimp, compat_name);
}
if (proc && (val_num >= 0 && val_num < proc->num_values))
val = &proc->values[val_num];
else
@ -924,7 +924,7 @@ procedural_db_get_data_invoker (Gimp *gimp,
{
data = procedural_db_get_data (gimp, identifier, &bytes);
success = (data != NULL);
if (success)
data_copy = g_memdup (data, bytes);
}

View File

@ -370,11 +370,11 @@ selection_float_invoker (Gimp *gimp,
if (success)
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
layer = gimp_selection_float (gimp_image_get_mask (gimage),
drawable, TRUE, offx, offy);
if (! layer)
@ -915,10 +915,10 @@ selection_load_invoker (Gimp *gimp,
{
GimpImage *gimage;
gint off_x, off_y;
gimage = gimp_item_get_image (GIMP_ITEM (channel));
gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y);
gimp_channel_select_channel (gimp_image_get_mask (gimage),
_("Channel to Selection"),
channel,
@ -1033,10 +1033,10 @@ selection_combine_invoker (Gimp *gimp,
{
GimpImage *gimage;
gint off_x, off_y;
gimage = gimp_item_get_image (GIMP_ITEM (channel));
gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y);
gimp_channel_select_channel (gimp_image_get_mask (gimage),
_("Channel to Selection"),
channel,

View File

@ -91,7 +91,7 @@ by_color_select_invoker (Gimp *gimp,
if (success)
{
gimage = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_by_color (gimp_image_get_mask (gimage), drawable,
sample_merged,
&color,
@ -433,7 +433,7 @@ fuzzy_select_invoker (Gimp *gimp,
if (success)
{
gimage = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_fuzzy (gimp_image_get_mask (gimage),
drawable,
sample_merged,

View File

@ -103,16 +103,16 @@ text_fontname_invoker (Gimp *gimp,
{
if (drawable && ! gimp_item_is_attached (GIMP_ITEM (drawable)))
success = FALSE;
if (success)
{
gchar *real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size);
text_layer = text_render (gimage, drawable, x, y, real_fontname, text,
border, antialias);
if (text_layer == NULL)
success = FALSE;
g_free (real_fontname);
}
}
@ -239,11 +239,11 @@ text_get_extents_fontname_invoker (Gimp *gimp,
if (success)
{
real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size);
success = text_get_extents (real_fontname, text,
&width, &height,
&ascent, &descent);
g_free (real_fontname);
}
@ -413,16 +413,16 @@ text_invoker (Gimp *gimp,
{
if (drawable && ! gimp_item_is_attached (GIMP_ITEM (drawable)))
success = FALSE;
if (success)
{
gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
text_layer = text_render (gimage, drawable, x, y, real_fontname, text,
border, antialias);
if (text_layer == NULL)
success = FALSE;
g_free (real_fontname);
}
}
@ -620,11 +620,11 @@ text_get_extents_invoker (Gimp *gimp,
if (success)
{
real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
success = text_get_extents (real_fontname, text,
&width, &height,
&ascent, &descent);
g_free (real_fontname);
}

View File

@ -75,7 +75,7 @@ flip_invoker (Gimp *gimp,
if (success)
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
success = gimp_drawable_transform_flip (drawable, flip_type);
}
@ -162,15 +162,15 @@ perspective_invoker (Gimp *gimp,
if (success)
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
gint x1, y1, x2, y2;
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type;
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
/* Assemble the transformation matrix */
gimp_transform_matrix_perspective (x1, y1, x2, y2,
trans_info[X0], trans_info[Y0],
@ -178,12 +178,12 @@ perspective_invoker (Gimp *gimp,
trans_info[X2], trans_info[Y2],
trans_info[X3], trans_info[Y3],
&matrix);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Perspective the selection */
success = gimp_drawable_transform_affine (drawable,
&matrix, GIMP_TRANSFORM_FORWARD,
@ -301,23 +301,23 @@ rotate_invoker (Gimp *gimp,
if (success)
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
gint x1, y1, x2, y2;
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type;
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
/* Assemble the transformation matrix */
gimp_transform_matrix_rotate (x1, y1, x2, y2, angle, &matrix);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Rotate the selection */
success = gimp_drawable_transform_affine (drawable,
&matrix, GIMP_TRANSFORM_FORWARD,
@ -407,26 +407,26 @@ scale_invoker (Gimp *gimp,
success = (gimp_item_is_attached (GIMP_ITEM (drawable)) &&
trans_info[X0] < trans_info[X1] &&
trans_info[Y0] < trans_info[X1]);
if (success)
{
gint x1, y1, x2, y2;
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type;
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
/* Assemble the transformation matrix */
gimp_transform_matrix_scale (x1, y1, x2, y2,
trans_info[X0], trans_info[Y0],
trans_info[X1], trans_info[Y1],
&matrix);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Scale the selection */
success = gimp_drawable_transform_affine (drawable,
&matrix, GIMP_TRANSFORM_FORWARD,
@ -528,25 +528,25 @@ shear_invoker (Gimp *gimp,
if (success)
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
gint x1, y1, x2, y2;
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type;
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
/* Assemble the transformation matrix */
gimp_transform_matrix_shear (x1, y1, x2, y2,
shear_type, magnitude,
&matrix);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Shear the selection */
success = gimp_drawable_transform_affine (drawable,
&matrix, GIMP_TRANSFORM_FORWARD,
@ -651,24 +651,24 @@ transform_2d_invoker (Gimp *gimp,
if (success)
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type;
/* Assemble the transformation matrix */
gimp_matrix3_identity (&matrix);
gimp_matrix3_translate (&matrix, -source_x, -source_y);
gimp_matrix3_scale (&matrix, scale_x, scale_y);
gimp_matrix3_rotate (&matrix, angle);
gimp_matrix3_translate (&matrix, dest_x, dest_y);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Transform the selection */
success = gimp_drawable_transform_affine (drawable,
&matrix, GIMP_TRANSFORM_FORWARD,

View File

@ -69,9 +69,9 @@ image_undo_group_start_invoker (Gimp *gimp,
{
if (gimp->current_plug_in)
undo_desc = plug_in_get_undo_desc (gimp->current_plug_in);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_MISC, undo_desc);
if (undo_desc)
g_free (undo_desc);
}

View File

@ -57,6 +57,8 @@ sub format_code_frag {
while ($code =~ /^\t* {8}/m) { $code =~ s/^(\t*) {8}/$1\t/mg }
$code .= "\n";
$code =~ s/^\s+$//mg;
$code;
}
@ -883,7 +885,7 @@ internal_procs_init (Gimp *gimp,
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (status_callback != NULL);
$group_procs
}
BODY