mirror of https://github.com/GNOME/gimp.git
plug-ins: cleanup in the recently GEGL-ported plug-ins
Mostly formatting consistency paranoia.
This commit is contained in:
parent
e61b1f7603
commit
67dda14e77
|
@ -192,15 +192,14 @@ run (const gchar *name,
|
|||
GimpRunMode run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (run_mode == GIMP_RUN_NONINTERACTIVE && n_params != 3)
|
||||
{
|
||||
status = GIMP_PDB_CALLING_ERROR;
|
||||
|
|
|
@ -96,7 +96,7 @@ query (void)
|
|||
"Tim Newsome <nuisance@cmu.edu>",
|
||||
"1997",
|
||||
N_("ASCII art"),
|
||||
"*",
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
GIMP_PLUGIN,
|
||||
G_N_ELEMENTS (save_args), 0,
|
||||
save_args, NULL);
|
||||
|
@ -144,29 +144,28 @@ run (const gchar *name,
|
|||
GimpExportReturn export = GIMP_EXPORT_CANCEL;
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
/* Set us up to return a status. */
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
values[0].type = GIMP_PDB_STATUS;
|
||||
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
image_ID = param[1].data.d_int32;
|
||||
drawable_ID = param[2].data.d_int32;
|
||||
|
||||
/* eventually export the image */
|
||||
switch (run_mode)
|
||||
{
|
||||
case GIMP_RUN_INTERACTIVE:
|
||||
case GIMP_RUN_WITH_LAST_VALS:
|
||||
gimp_ui_init (PLUG_IN_BINARY, FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, NULL,
|
||||
(GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
||||
GIMP_EXPORT_CAN_HANDLE_ALPHA ));
|
||||
GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
||||
GIMP_EXPORT_CAN_HANDLE_ALPHA);
|
||||
if (export == GIMP_EXPORT_CANCEL)
|
||||
{
|
||||
values[0].data.d_status = GIMP_PDB_CANCEL;
|
||||
|
|
|
@ -151,7 +151,7 @@ query (void)
|
|||
"Tim Newsome, Jens Lautenbacher, Sven Neumann",
|
||||
"1997-2000",
|
||||
N_("GIMP brush"),
|
||||
"*",
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
GIMP_PLUGIN,
|
||||
G_N_ELEMENTS (save_args), 0,
|
||||
save_args, NULL);
|
||||
|
@ -221,8 +221,9 @@ run (const gchar *name,
|
|||
case GIMP_RUN_WITH_LAST_VALS:
|
||||
gimp_ui_init (PLUG_IN_BINARY, FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, NULL,
|
||||
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||
GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||
GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
||||
GIMP_EXPORT_CAN_HANDLE_ALPHA);
|
||||
if (export == GIMP_EXPORT_CANCEL)
|
||||
{
|
||||
|
|
|
@ -196,15 +196,14 @@ run (const gchar *name,
|
|||
GError *error = NULL;
|
||||
gint i;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
values[0].type = GIMP_PDB_STATUS;
|
||||
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
|
||||
|
||||
|
|
|
@ -188,7 +188,6 @@ run (const gchar *name,
|
|||
gint32 image_ID;
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
*nreturn_vals = 1;
|
||||
|
|
|
@ -196,12 +196,11 @@ run (const gchar *name,
|
|||
GimpExportReturn export = GIMP_EXPORT_CANCEL;
|
||||
GError *error = NULL;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
|
|
|
@ -222,19 +222,17 @@ save_image (const gchar *filename,
|
|||
GeglBuffer *buffer,
|
||||
GError **error)
|
||||
{
|
||||
const Babl *format = babl_format ("R'G'B'A u8");
|
||||
gint row, col, cols, rows, x, y;
|
||||
gint colcount, colspan, rowspan;
|
||||
gint *palloc;
|
||||
guchar *buf, *buf2;
|
||||
gchar *width, *height;
|
||||
FILE *fp;
|
||||
const Babl *format = babl_format ("R'G'B'A u8");
|
||||
gint row, col, cols, rows, x, y;
|
||||
gint colcount, colspan, rowspan;
|
||||
gint *palloc;
|
||||
guchar *buf, *buf2;
|
||||
gchar *width, *height;
|
||||
FILE *fp;
|
||||
|
||||
cols = gegl_buffer_get_width (buffer);
|
||||
rows = gegl_buffer_get_height (buffer);
|
||||
|
||||
palloc = g_new (int, rows * cols);
|
||||
|
||||
fp = g_fopen (filename, "w");
|
||||
|
||||
if (! fp)
|
||||
|
@ -242,10 +240,11 @@ save_image (const gchar *filename,
|
|||
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
|
||||
_("Could not open '%s' for writing: %s"),
|
||||
gimp_filename_to_utf8 (filename), g_strerror (errno));
|
||||
g_free (palloc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
palloc = g_new (int, rows * cols);
|
||||
|
||||
if (gtmvals.fulldoc)
|
||||
{
|
||||
fprintf (fp, "<HTML>\n<HEAD><TITLE>%s</TITLE></HEAD>\n<BODY>\n",
|
||||
|
|
|
@ -407,12 +407,11 @@ run (const gchar *name,
|
|||
GError *error = NULL;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
values[0].type = GIMP_PDB_STATUS;
|
||||
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ static void run (const gchar *name,
|
|||
|
||||
static gboolean load_dialog (TIFF *tif,
|
||||
TiffSelectedPages *pages);
|
||||
|
||||
|
||||
static gint32 load_image (const gchar *filename,
|
||||
TIFF *tif,
|
||||
TiffSelectedPages *pages,
|
||||
|
@ -210,15 +210,14 @@ run (const gchar *name,
|
|||
gint32 image;
|
||||
TiffSelectedPages pages;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
values[0].type = GIMP_PDB_STATUS;
|
||||
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
|
||||
|
||||
|
|
|
@ -85,16 +85,15 @@ run (const gchar *name,
|
|||
gint32 drawable_id;
|
||||
gint x, y, width, height;
|
||||
|
||||
INIT_I18N();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
values[0].type = GIMP_PDB_STATUS;
|
||||
values[0].data.d_status = status;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
drawable_id = param[2].data.d_drawable;
|
||||
|
||||
if (gimp_drawable_mask_intersect (drawable_id, &x, &y, &width, &height))
|
||||
|
|
|
@ -288,23 +288,22 @@ run (const gchar *name,
|
|||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
GimpRunMode run_mode = param[0].data.d_int32;
|
||||
static GimpParam values[2];
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
GimpRunMode run_mode;
|
||||
GdkScreen *screen = NULL;
|
||||
gint32 image_ID;
|
||||
|
||||
static GimpParam values[2];
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
/* initialize the return of the status */
|
||||
values[0].type = GIMP_PDB_STATUS;
|
||||
values[0].data.d_status = status;
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
values[0].type = GIMP_PDB_STATUS;
|
||||
values[0].data.d_status = status;
|
||||
|
||||
/* how are we running today? */
|
||||
switch (run_mode)
|
||||
|
|
|
@ -164,14 +164,14 @@ run (const gchar *name,
|
|||
GimpExportReturn export = GIMP_EXPORT_CANCEL;
|
||||
GError *error = NULL;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
INIT_I18N ();
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
values[0].type = GIMP_PDB_STATUS;
|
||||
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
|
||||
|
||||
|
|
|
@ -126,6 +126,7 @@ run (const gchar *name,
|
|||
gint32 image_ID;
|
||||
GError *error = NULL;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
*nreturn_vals = 1;
|
||||
|
@ -136,8 +137,6 @@ run (const gchar *name,
|
|||
|
||||
if (strcmp (name, LOAD_PROC) == 0)
|
||||
{
|
||||
INIT_I18N ();
|
||||
|
||||
image_ID = load_image (param[1].data.d_string, &error);
|
||||
|
||||
if (image_ID != -1)
|
||||
|
|
|
@ -139,7 +139,7 @@ query (void)
|
|||
"Copyright 1997-1998 by Michael Sweet",
|
||||
PLUG_IN_VERSION,
|
||||
N_("Silicon Graphics IRIS image"),
|
||||
"*",
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
GIMP_PLUGIN,
|
||||
G_N_ELEMENTS (save_args),
|
||||
0,
|
||||
|
@ -165,17 +165,17 @@ run (const gchar *name,
|
|||
GimpExportReturn export = GIMP_EXPORT_CANCEL;
|
||||
GError *error = NULL;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
values[0].type = GIMP_PDB_STATUS;
|
||||
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (strcmp (name, LOAD_PROC) == 0)
|
||||
{
|
||||
image_ID = load_image (param[1].data.d_string, &error);
|
||||
|
@ -203,10 +203,10 @@ run (const gchar *name,
|
|||
case GIMP_RUN_WITH_LAST_VALS:
|
||||
gimp_ui_init (PLUG_IN_BINARY, FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, NULL,
|
||||
(GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
||||
GIMP_EXPORT_CAN_HANDLE_ALPHA));
|
||||
GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
||||
GIMP_EXPORT_CAN_HANDLE_ALPHA);
|
||||
if (export == GIMP_EXPORT_CANCEL)
|
||||
{
|
||||
values[0].data.d_status = GIMP_PDB_CANCEL;
|
||||
|
@ -546,20 +546,24 @@ save_image (const gchar *filename,
|
|||
zsize = 1;
|
||||
format = babl_format ("Y' u8");
|
||||
break;
|
||||
|
||||
case GIMP_GRAYA_IMAGE:
|
||||
zsize = 2;
|
||||
format = babl_format ("Y'A u8");
|
||||
break;
|
||||
|
||||
case GIMP_RGB_IMAGE:
|
||||
case GIMP_INDEXED_IMAGE:
|
||||
zsize = 3;
|
||||
format = babl_format ("R'G'B' u8");
|
||||
break;
|
||||
|
||||
case GIMP_RGBA_IMAGE:
|
||||
case GIMP_INDEXEDA_IMAGE:
|
||||
format = babl_format ("R'G'B'A u8");
|
||||
zsize = 4;
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -152,12 +152,11 @@ run (const gchar *name,
|
|||
gint32 image_ID;
|
||||
GError *error = NULL;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
|
|
Loading…
Reference in New Issue