Commit ad5e1cd0 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

tools/pdbgen/pdb/channel.pdb tools/pdbgen/pdb/display.pdb

2003-12-08  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/display.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/image.pdb: don't use "alias"es just to rename
	variables, they just clutter the code and there is no reason why
	e.g. a GimpDisplay variable must be called "gdisp" instead of
	"display". Cleanup.

	* app/pdb/channel_cmds.c
	* app/pdb/display_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c: regenerated.
parent 95c13dad
2003-12-08 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/display.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/image.pdb: don't use "alias"es just to rename
variables, they just clutter the code and there is no reason why
e.g. a GimpDisplay variable must be called "gdisp" instead of
"display". Cleanup.
* app/pdb/channel_cmds.c
* app/pdb/display_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/image_cmds.c: regenerated.
2003-12-08 Michael Natterer <mitch@gimp.org> 2003-12-08 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/brushes.pdb
...@@ -177,19 +177,23 @@ channel_copy_invoker (Gimp *gimp, ...@@ -177,19 +177,23 @@ channel_copy_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpChannel *channel; GimpChannel *channel;
GimpChannel *copy = NULL; GimpChannel *channel_copy = NULL;
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_CHANNEL (channel)) if (! GIMP_IS_CHANNEL (channel))
success = FALSE; success = FALSE;
if (success) if (success)
success = (copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel), G_TYPE_FROM_INSTANCE (channel), FALSE))) != NULL; {
channel_copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
G_TYPE_FROM_INSTANCE (channel), FALSE));
success = (channel_copy != NULL);
}
return_args = procedural_db_return_args (&channel_copy_proc, success); return_args = procedural_db_return_args (&channel_copy_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (copy)); return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (channel_copy));
return return_args; return return_args;
} }
......
...@@ -56,7 +56,7 @@ display_new_invoker (Gimp *gimp, ...@@ -56,7 +56,7 @@ display_new_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *gimage;
GimpDisplay *gdisp = NULL; GimpDisplay *display = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
...@@ -64,9 +64,9 @@ display_new_invoker (Gimp *gimp, ...@@ -64,9 +64,9 @@ display_new_invoker (Gimp *gimp,
if (success) if (success)
{ {
gdisp = (GimpDisplay *) gimp_create_display (gimp, gimage, 0x0101); display = (GimpDisplay *) gimp_create_display (gimp, gimage, 0x0101);
success = (gdisp != NULL); success = (display != NULL);
/* the first display takes ownership of the image */ /* the first display takes ownership of the image */
if (success && gimage->disp_count == 1) if (success && gimage->disp_count == 1)
...@@ -76,7 +76,7 @@ display_new_invoker (Gimp *gimp, ...@@ -76,7 +76,7 @@ display_new_invoker (Gimp *gimp,
return_args = procedural_db_return_args (&display_new_proc, success); return_args = procedural_db_return_args (&display_new_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = gimp_display_get_ID (gdisp); return_args[1].value.pdb_int = gimp_display_get_ID (display);
return return_args; return return_args;
} }
...@@ -120,14 +120,14 @@ display_delete_invoker (Gimp *gimp, ...@@ -120,14 +120,14 @@ display_delete_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDisplay *gdisp; GimpDisplay *display;
gdisp = gimp_display_get_by_ID (gimp, args[0].value.pdb_int); display = gimp_display_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_DISPLAY (gdisp)) if (! GIMP_IS_DISPLAY (display))
success = FALSE; success = FALSE;
if (success) if (success)
gimp_display_delete (gdisp); gimp_display_delete (display);
return procedural_db_return_args (&display_delete_proc, success); return procedural_db_return_args (&display_delete_proc, success);
} }
...@@ -186,19 +186,19 @@ displays_reconnect_invoker (Gimp *gimp, ...@@ -186,19 +186,19 @@ displays_reconnect_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage_old; GimpImage *old_image;
GimpImage *gimage_new; GimpImage *new_image;
gimage_old = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); old_image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage_old)) if (! GIMP_IS_IMAGE (old_image))
success = FALSE; success = FALSE;
gimage_new = gimp_image_get_by_ID (gimp, args[1].value.pdb_int); new_image = gimp_image_get_by_ID (gimp, args[1].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage_new)) if (! GIMP_IS_IMAGE (new_image))
success = FALSE; success = FALSE;
if (success) if (success)
gimp_displays_reconnect (gimp, gimage_old, gimage_new); gimp_displays_reconnect (gimp, old_image, new_image);
return procedural_db_return_args (&displays_reconnect_proc, success); return procedural_db_return_args (&displays_reconnect_proc, success);
} }
......
...@@ -1871,8 +1871,8 @@ drawable_thumbnail_invoker (Gimp *gimp, ...@@ -1871,8 +1871,8 @@ drawable_thumbnail_invoker (Gimp *gimp,
if (success) if (success)
{ {
TempBuf * buf; TempBuf *buf;
gint dwidth, dheight; gint dwidth, dheight;
if (req_width <= 128 && req_height <= 128) if (req_width <= 128 && req_height <= 128)
{ {
...@@ -1890,11 +1890,11 @@ drawable_thumbnail_invoker (Gimp *gimp, ...@@ -1890,11 +1890,11 @@ drawable_thumbnail_invoker (Gimp *gimp,
if (buf) if (buf)
{ {
num_bytes = buf->height * buf->width * buf->bytes; num_bytes = buf->height * buf->width * buf->bytes;
thumbnail_data = g_memdup (temp_buf_data (buf), num_bytes); thumbnail_data = g_memdup (temp_buf_data (buf), num_bytes);
width = buf->width; width = buf->width;
height = buf->height; height = buf->height;
bpp = buf->bytes; bpp = buf->bytes;
} }
} }
} }
......
...@@ -207,7 +207,7 @@ image_list_invoker (Gimp *gimp, ...@@ -207,7 +207,7 @@ image_list_invoker (Gimp *gimp,
gint32 num_images = 0; gint32 num_images = 0;
gint32 *image_ids = NULL; gint32 *image_ids = NULL;
GList *list = NULL; GList *list = NULL;
int i; gint i;
gimp_container_foreach (gimp->images, gimlist_cb, &list); gimp_container_foreach (gimp->images, gimlist_cb, &list);
num_images = g_list_length (list); num_images = g_list_length (list);
...@@ -266,7 +266,7 @@ image_new_invoker (Gimp *gimp, ...@@ -266,7 +266,7 @@ image_new_invoker (Gimp *gimp,
gint32 width; gint32 width;
gint32 height; gint32 height;
gint32 type; gint32 type;
GimpImage *gimage = NULL; GimpImage *image = NULL;
width = args[0].value.pdb_int; width = args[0].value.pdb_int;
if (width <= 0) if (width <= 0)
...@@ -281,12 +281,15 @@ image_new_invoker (Gimp *gimp, ...@@ -281,12 +281,15 @@ image_new_invoker (Gimp *gimp,
success = FALSE; success = FALSE;
if (success) if (success)
success = (gimage = gimp_create_image (gimp, width, height, type, FALSE)) != NULL; {
image = gimp_create_image (gimp, width, height, type, FALSE);
success = (image != NULL);
}
return_args = procedural_db_return_args (&image_new_proc, success); return_args = procedural_db_return_args (&image_new_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = gimp_image_get_ID (gimage); return_args[1].value.pdb_int = gimp_image_get_ID (image);
return return_args; return return_args;
} }
...@@ -783,7 +786,7 @@ image_get_layers_invoker (Gimp *gimp, ...@@ -783,7 +786,7 @@ image_get_layers_invoker (Gimp *gimp,
gint32 num_layers = 0; gint32 num_layers = 0;
gint32 *layer_ids = NULL; gint32 *layer_ids = NULL;
GList *list = NULL; GList *list = NULL;
int i; gint i;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
...@@ -862,7 +865,7 @@ image_get_channels_invoker (Gimp *gimp, ...@@ -862,7 +865,7 @@ image_get_channels_invoker (Gimp *gimp,
gint32 num_channels = 0; gint32 num_channels = 0;
gint32 *channel_ids = NULL; gint32 *channel_ids = NULL;
GList *list = NULL; GList *list = NULL;
int i; gint i;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
...@@ -2373,8 +2376,8 @@ image_thumbnail_invoker (Gimp *gimp, ...@@ -2373,8 +2376,8 @@ image_thumbnail_invoker (Gimp *gimp,
if (success) if (success)
{ {
TempBuf * buf; TempBuf *buf;
gint dwidth, dheight; gint dwidth, dheight;
g_assert (GIMP_VIEWABLE_MAX_PREVIEW_SIZE >= 1024); g_assert (GIMP_VIEWABLE_MAX_PREVIEW_SIZE >= 1024);
...@@ -2392,11 +2395,12 @@ image_thumbnail_invoker (Gimp *gimp, ...@@ -2392,11 +2395,12 @@ image_thumbnail_invoker (Gimp *gimp,
if (buf) if (buf)
{ {
num_bytes = buf->height * buf->width * buf->bytes; num_bytes = buf->height * buf->width * buf->bytes;
thumbnail_data = g_memdup (temp_buf_data (buf), num_bytes); thumbnail_data = g_memdup (temp_buf_data (buf), num_bytes);
width = buf->width; width = buf->width;
height = buf->height; height = buf->height;
bpp = buf->bytes; bpp = buf->bytes;
temp_buf_free (buf); temp_buf_free (buf);
} }
} }
...@@ -2495,7 +2499,7 @@ image_set_tattoo_state_invoker (Gimp *gimp, ...@@ -2495,7 +2499,7 @@ image_set_tattoo_state_invoker (Gimp *gimp,
if (success) if (success)
{ {
success = gimp_image_set_tattoo_state(gimage,tattoo); success = gimp_image_set_tattoo_state (gimage, tattoo);
} }
return procedural_db_return_args (&image_set_tattoo_state_proc, success); return procedural_db_return_args (&image_set_tattoo_state_proc, success);
...@@ -2546,7 +2550,7 @@ image_get_tattoo_state_invoker (Gimp *gimp, ...@@ -2546,7 +2550,7 @@ image_get_tattoo_state_invoker (Gimp *gimp,
if (success) if (success)
{ {
tattoo = gimp_image_get_tattoo_state(gimage); tattoo = gimp_image_get_tattoo_state (gimage);
} }
return_args = procedural_db_return_args (&image_get_tattoo_state_proc, success); return_args = procedural_db_return_args (&image_get_tattoo_state_proc, success);
...@@ -2598,19 +2602,19 @@ image_duplicate_invoker (Gimp *gimp, ...@@ -2598,19 +2602,19 @@ image_duplicate_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *gimage;
GimpImage *new_gimage = NULL; GimpImage *new_image = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
success = FALSE; success = FALSE;
if (success) if (success)
success = (new_gimage = gimp_image_duplicate (gimage)) != NULL; success = (new_image = gimp_image_duplicate (gimage)) != NULL;
return_args = procedural_db_return_args (&image_duplicate_proc, success); return_args = procedural_db_return_args (&image_duplicate_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = gimp_image_get_ID (new_gimage); return_args[1].value.pdb_int = gimp_image_get_ID (new_image);
return return_args; return return_args;
} }
......
...@@ -193,10 +193,18 @@ HELP ...@@ -193,10 +193,18 @@ HELP
@outargs = ( @outargs = (
{ name => 'channel_copy', type => 'channel', init => 1, { name => 'channel_copy', type => 'channel', init => 1,
desc => 'The newly copied channel', alias => 'copy' } desc => 'The newly copied channel' }
); );
%invoke = ( code => 'success = (copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel), G_TYPE_FROM_INSTANCE (channel), FALSE))) != NULL;' ); %invoke = (
code => <<'CODE'
{
channel_copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
G_TYPE_FROM_INSTANCE (channel), FALSE));
success = (channel_copy != NULL);
}
CODE
);
} }
sub channel_combine_masks { sub channel_combine_masks {
......
...@@ -36,15 +36,15 @@ HELP ...@@ -36,15 +36,15 @@ HELP
@outargs = ( @outargs = (
{ name => 'display', type => 'display', { name => 'display', type => 'display',
desc => 'The new display', alias => 'gdisp', init => 1 } desc => 'The new display', init => 1 }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gdisp = (GimpDisplay *) gimp_create_display (gimp, gimage, 0x0101); display = (GimpDisplay *) gimp_create_display (gimp, gimage, 0x0101);
success = (gdisp != NULL); success = (display != NULL);
/* the first display takes ownership of the image */ /* the first display takes ownership of the image */
if (success && gimage->disp_count == 1) if (success && gimage->disp_count == 1)
...@@ -66,10 +66,10 @@ HELP ...@@ -66,10 +66,10 @@ HELP
@inargs = ( @inargs = (
{ name => 'display', type => 'display', { name => 'display', type => 'display',
desc => 'The display to delete', alias => 'gdisp' } desc => 'The display to delete' }
); );
%invoke = ( code => 'gimp_display_delete (gdisp);' ); %invoke = ( code => 'gimp_display_delete (display);' );
} }
sub displays_flush { sub displays_flush {
...@@ -104,14 +104,12 @@ HELP ...@@ -104,14 +104,12 @@ HELP
@inargs = ( @inargs = (
{ name => 'old_image', type => 'image', { name => 'old_image', type => 'image',
desc => 'The old image (should have at least one display)', desc => 'The old image (should have at least one display)' },
alias => 'gimage_old' },
{ name => 'new_image', type => 'image', { name => 'new_image', type => 'image',
desc => 'The new image (must not have a display)', desc => 'The new image (must not have a display)' }
alias => 'gimage_new' }
); );
%invoke = ( code => 'gimp_displays_reconnect (gimp, gimage_old, gimage_new);' ); %invoke = ( code => 'gimp_displays_reconnect (gimp, old_image, new_image);' );
} }
@headers = qw("core/gimp.h" "display/display-types.h" "display/gimpdisplay.h" @headers = qw("core/gimp.h" "display/display-types.h" "display/gimpdisplay.h"
......
...@@ -596,8 +596,8 @@ HELP ...@@ -596,8 +596,8 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
TempBuf * buf; TempBuf *buf;
gint dwidth, dheight; gint dwidth, dheight;
if (req_width <= 128 && req_height <= 128) if (req_width <= 128 && req_height <= 128)
{ {
...@@ -615,11 +615,11 @@ HELP ...@@ -615,11 +615,11 @@ HELP
if (buf) if (buf)
{ {
num_bytes = buf->height * buf->width * buf->bytes; num_bytes = buf->height * buf->width * buf->bytes;
thumbnail_data = g_memdup (temp_buf_data (buf), num_bytes); thumbnail_data = g_memdup (temp_buf_data (buf), num_bytes);
width = buf->width; width = buf->width;
height = buf->height; height = buf->height;
bpp = buf->bytes; bpp = buf->bytes;
} }
} }
} }
......
...@@ -57,7 +57,7 @@ HELP ...@@ -57,7 +57,7 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GList *list = NULL', 'int i' ], vars => [ 'GList *list = NULL', 'gint i' ],
code => <<CODE code => <<CODE
{ {
list = GIMP_LIST (gimage->${type}s)->list; list = GIMP_LIST (gimage->${type}s)->list;
...@@ -256,13 +256,16 @@ HELP ...@@ -256,13 +256,16 @@ HELP
} }
@outargs = ( @outargs = (
{ name => 'image', type => 'image', alias => 'gimage', init => 1, { name => 'image', type => 'image', init => 1,
desc => 'The ID of the newly created image' } desc => 'The ID of the newly created image' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
success = (gimage = gimp_create_image (gimp, width, height, type, FALSE)) != NULL; {
image = gimp_create_image (gimp, width, height, type, FALSE);
success = (image != NULL);
}
CODE CODE
); );
} }
...@@ -1325,8 +1328,8 @@ HELP ...@@ -1325,8 +1328,8 @@ HELP
headers => [ qw(<string.h> "core/gimpviewable.h") ], headers => [ qw(<string.h> "core/gimpviewable.h") ],
code => <<'CODE' code => <<'CODE'
{ {
TempBuf * buf; TempBuf *buf;
gint dwidth, dheight; gint dwidth, dheight;
g_assert (GIMP_VIEWABLE_MAX_PREVIEW_SIZE >= 1024); g_assert (GIMP_VIEWABLE_MAX_PREVIEW_SIZE >= 1024);
...@@ -1344,11 +1347,12 @@ HELP ...@@ -1344,11 +1347,12 @@ HELP
if (buf) if (buf)
{ {
num_bytes = buf->height * buf->width * buf->bytes; num_bytes = buf->height * buf->width * buf->bytes;
thumbnail_data = g_memdup (temp_buf_data (buf), num_bytes); thumbnail_data = g_memdup (temp_buf_data (buf), num_bytes);
width = buf->width; width = buf->width;
height = buf->height; height = buf->height;
bpp = buf->bytes; bpp = buf->bytes;
temp_buf_free (buf); temp_buf_free (buf);
} }
} }
...@@ -1378,7 +1382,7 @@ HELP ...@@ -1378,7 +1382,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
tattoo = gimp_image_get_tattoo_state(gimage); tattoo = gimp_image_get_tattoo_state (gimage);
} }
CODE CODE
); );
...@@ -1406,14 +1410,13 @@ HELP ...@@ -1406,14 +1410,13 @@ HELP
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
{ name => 'tattoo', type => 'int32', { name => 'tattoo', type => 'int32',
desc => 'The new tattoo state of the image' desc => 'The new tattoo state of the image' }
}
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
success = gimp_image_set_tattoo_state(gimage,tattoo); success = gimp_image_set_tattoo_state (gimage, tattoo);
} }
CODE CODE
); );
...@@ -1434,14 +1437,13 @@ HELP ...@@ -1434,14 +1437,13 @@ HELP
@outargs = ( @outargs = (
{ name => 'new_image', type => 'image', { name => 'new_image', type => 'image',
desc => 'The new, duplicated image', desc => 'The new, duplicated image', init => 1 }
alias => 'new_gimage', init => 1 }
); );
%invoke = ( %invoke = (
headers => [ qw("core/gimpimage-duplicate.h") ], headers => [ qw("core/gimpimage-duplicate.h") ],
code => <<'CODE' code => <<'CODE'
success = (new_gimage = gimp_image_duplicate (gimage)) != NULL; success = (new_image = gimp_image_duplicate (gimage)) != NULL;
CODE CODE
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment