libgimp: generate functions both for old and new GimpImage APIs.

This way, it would still be possible to use the old API. WIP.
This commit is contained in:
Jehan 2019-08-12 14:44:07 +02:00
parent 688c3230d0
commit 17a40b049f
40 changed files with 9732 additions and 980 deletions

View File

@ -94,6 +94,66 @@ _gimp_channel_new (GimpImage *image,
return channel_ID;
}
/**
* __gimp_channel_new: (skip)
* @image_ID: The image to which to add the channel.
* @width: The channel width.
* @height: The channel height.
* @name: The channel name.
* @opacity: The channel opacity.
* @color: The channel compositing color.
*
* Create a new channel.
*
* This procedure creates a new channel with the specified width,
* height, name, opacity and color.
* The new channel still needs to be added to the image, as this is not
* automatic. Add the new channel with gimp_image_insert_channel().
* Other attributes, such as channel visibility, should be set with
* explicit procedure calls.
* The channel's contents are undefined initially.
*
* Returns: The newly created channel.
**/
gint32
__gimp_channel_new (gint32 image_ID,
gint width,
gint height,
const gchar *name,
gdouble opacity,
const GimpRGB *color)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 channel_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, width,
G_TYPE_INT, height,
G_TYPE_STRING, name,
G_TYPE_DOUBLE, opacity,
GIMP_TYPE_RGB, color,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-channel-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
channel_ID = gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return channel_ID;
}
/**
* gimp_channel_new_from_component:
* @image: The image to which to add the channel.
@ -145,6 +205,57 @@ gimp_channel_new_from_component (GimpImage *image,
return channel_ID;
}
/**
* _gimp_channel_new_from_component: (skip)
* @image_ID: The image to which to add the channel.
* @component: The image component.
* @name: The channel name.
*
* Create a new channel from a color component
*
* This procedure creates a new channel from a color component.
* The new channel still needs to be added to the image, as this is not
* automatic. Add the new channel with gimp_image_insert_channel().
* Other attributes, such as channel visibility, should be set with
* explicit procedure calls.
*
* Returns: The newly created channel.
*
* Since: 2.4
**/
gint32
_gimp_channel_new_from_component (gint32 image_ID,
GimpChannelType component,
const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 channel_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_CHANNEL_TYPE, component,
G_TYPE_STRING, name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-new-from-component",
args);
else
return_vals = gimp_run_procedure_array ("gimp-channel-new-from-component",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
channel_ID = gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return channel_ID;
}
/**
* gimp_channel_copy:
* @channel_ID: The channel to copy.

View File

@ -38,9 +38,20 @@ G_GNUC_INTERNAL gint32 _gimp_channel_new (GimpImage *image,
const gchar *name,
gdouble opacity,
const GimpRGB *color);
GIMP_DEPRECATED_FOR(_gimp_channel_new)
G_GNUC_INTERNAL gint32 __gimp_channel_new (gint32 image_ID,
gint width,
gint height,
const gchar *name,
gdouble opacity,
const GimpRGB *color);
gint32 gimp_channel_new_from_component (GimpImage *image,
GimpChannelType component,
const gchar *name);
GIMP_DEPRECATED_FOR(gimp_channel_new_from_component)
G_GNUC_INTERNAL gint32 _gimp_channel_new_from_component (gint32 image_ID,
GimpChannelType component,
const gchar *name);
gint32 gimp_channel_copy (gint32 channel_ID);
gboolean gimp_channel_combine_masks (gint32 channel1_ID,
gint32 channel2_ID,

View File

@ -120,6 +120,50 @@ gimp_display_new (GimpImage *image)
return display_ID;
}
/**
* _gimp_display_new: (skip)
* @image_ID: The image.
*
* Create a new display for the specified image.
*
* Creates a new display for the specified image. If the image already
* has a display, another is added. Multiple displays are handled
* transparently by GIMP. The newly created display is returned and can
* be subsequently destroyed with a call to gimp_display_delete(). This
* procedure only makes sense for use with the GIMP UI, and will result
* in an execution error if called when GIMP has no UI.
*
* Returns: The new display.
**/
gint32
_gimp_display_new (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 display_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-display-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-display-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
display_ID = gimp_value_get_display_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return display_ID;
}
/**
* gimp_display_delete:
* @display_ID: The display to delete.
@ -289,3 +333,47 @@ gimp_displays_reconnect (GimpImage *old_image,
return success;
}
/**
* _gimp_displays_reconnect: (skip)
* @old_image_ID: The old image (must have at least one display).
* @new_image_ID: The new image (must not have a display).
*
* Reconnect displays from one image to another image.
*
* This procedure connects all displays of the old_image to the
* new_image. If the old_image has no display or new_image already has
* a display the reconnect is not performed and the procedure returns
* without success. You should rarely need to use this function.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_displays_reconnect (gint32 old_image_ID,
gint32 new_image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, old_image_ID,
GIMP_TYPE_IMAGE_ID, new_image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-displays-reconnect",
args);
else
return_vals = gimp_run_procedure_array ("gimp-displays-reconnect",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}

View File

@ -34,11 +34,16 @@ G_BEGIN_DECLS
gboolean gimp_display_is_valid (gint32 display_ID);
gint32 gimp_display_new (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_display_new)
G_GNUC_INTERNAL gint32 _gimp_display_new (gint32 image_ID);
gboolean gimp_display_delete (gint32 display_ID);
gint gimp_display_get_window_handle (gint32 display_ID);
gboolean gimp_displays_flush (void);
gboolean gimp_displays_reconnect (GimpImage *old_image,
GimpImage *new_image);
GIMP_DEPRECATED_FOR(gimp_displays_reconnect)
G_GNUC_INTERNAL gboolean _gimp_displays_reconnect (gint32 old_image_ID,
gint32 new_image_ID);
G_END_DECLS

View File

@ -172,6 +172,52 @@ gimp_edit_copy_visible (GimpImage *image)
return non_empty;
}
/**
* _gimp_edit_copy_visible: (skip)
* @image_ID: The image to copy from.
*
* Copy from the projection.
*
* If there is a selection in the image, then the area specified by the
* selection is copied from the projection and placed in an internal
* GIMP edit buffer. It can subsequently be retrieved using the
* gimp_edit_paste() command. If there is no selection, then the
* projection's contents will be stored in the internal GIMP edit
* buffer.
*
* Returns: TRUE if the copy was successful.
*
* Since: 2.2
**/
gboolean
_gimp_edit_copy_visible (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean non_empty = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-edit-copy-visible",
args);
else
return_vals = gimp_run_procedure_array ("gimp-edit-copy-visible",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
non_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return non_empty;
}
/**
* gimp_edit_paste:
* @drawable_ID: The drawable to paste to.
@ -263,13 +309,55 @@ gimp_edit_paste_as_new_image (void)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image = gimp_image_new_by_id (g_value_get_int (gimp_value_array_index (return_vals, 1)));
image = gimp_image_new_by_id (gimp_value_get_image_id (gimp_value_array_index (return_vals, 1)));
gimp_value_array_unref (return_vals);
return image;
}
/**
* _gimp_edit_paste_as_new_image: (skip)
*
* Paste buffer to a new image.
*
* This procedure pastes a copy of the internal GIMP edit buffer to a
* new image. The GIMP edit buffer will be empty unless a call was
* previously made to either gimp_edit_cut() or gimp_edit_copy(). This
* procedure returns the new image or -1 if the edit buffer was empty.
*
* Returns: The new image.
*
* Since: 2.10
**/
gint32
_gimp_edit_paste_as_new_image (void)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 image_ID = -1;
args = gimp_value_array_new_from_types (NULL,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-edit-paste-as-new-image",
args);
else
return_vals = gimp_run_procedure_array ("gimp-edit-paste-as-new-image",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return image_ID;
}
/**
* gimp_edit_named_cut:
* @drawable_ID: The drawable to cut from.
@ -417,6 +505,54 @@ gimp_edit_named_copy_visible (GimpImage *image,
return real_name;
}
/**
* _gimp_edit_named_copy_visible: (skip)
* @image_ID: The image to copy from.
* @buffer_name: The name of the buffer to create.
*
* Copy from the projection into a named buffer.
*
* This procedure works like gimp_edit_copy_visible(), but additionally
* stores the copied buffer into a named buffer that will stay
* available for later pasting, regardless of any intermediate copy or
* cut operations.
*
* Returns: The real name given to the buffer, or NULL if the copy failed.
* The returned value must be freed with g_free().
*
* Since: 2.4
**/
gchar *
_gimp_edit_named_copy_visible (gint32 image_ID,
const gchar *buffer_name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gchar *real_name = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, buffer_name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-edit-named-copy-visible",
args);
else
return_vals = gimp_run_procedure_array ("gimp-edit-named-copy-visible",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
real_name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return real_name;
}
/**
* gimp_edit_named_paste:
* @drawable_ID: The drawable to paste to.
@ -500,9 +636,51 @@ gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image = gimp_image_new_by_id (g_value_get_int (gimp_value_array_index (return_vals, 1)));
image = gimp_image_new_by_id (gimp_value_get_image_id (gimp_value_array_index (return_vals, 1)));
gimp_value_array_unref (return_vals);
return image;
}
/**
* _gimp_edit_named_paste_as_new_image: (skip)
* @buffer_name: The name of the buffer to paste.
*
* Paste named buffer to a new image.
*
* This procedure works like gimp_edit_paste_as_new_image() but pastes
* a named buffer instead of the global buffer.
*
* Returns: The new image.
*
* Since: 2.10
**/
gint32
_gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 image_ID = -1;
args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, buffer_name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-edit-named-paste-as-new-image",
args);
else
return_vals = gimp_run_procedure_array ("gimp-edit-named-paste-as-new-image",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return image_ID;
}

View File

@ -35,19 +35,28 @@ G_BEGIN_DECLS
gboolean gimp_edit_cut (gint32 drawable_ID);
gboolean gimp_edit_copy (gint32 drawable_ID);
gboolean gimp_edit_copy_visible (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_edit_copy_visible)
G_GNUC_INTERNAL gboolean _gimp_edit_copy_visible (gint32 image_ID);
gint32 gimp_edit_paste (gint32 drawable_ID,
gboolean paste_into);
GimpImage* gimp_edit_paste_as_new_image (void);
GIMP_DEPRECATED_FOR(gimp_edit_paste_as_new_image)
G_GNUC_INTERNAL gint32 _gimp_edit_paste_as_new_image (void);
gchar* gimp_edit_named_cut (gint32 drawable_ID,
const gchar *buffer_name);
gchar* gimp_edit_named_copy (gint32 drawable_ID,
const gchar *buffer_name);
gchar* gimp_edit_named_copy_visible (GimpImage *image,
const gchar *buffer_name);
GIMP_DEPRECATED_FOR(gimp_edit_named_copy_visible)
G_GNUC_INTERNAL gchar* _gimp_edit_named_copy_visible (gint32 image_ID,
const gchar *buffer_name);
gint32 gimp_edit_named_paste (gint32 drawable_ID,
const gchar *buffer_name,
gboolean paste_into);
GimpImage* gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
GIMP_DEPRECATED_FOR(gimp_edit_named_paste_as_new_image)
G_GNUC_INTERNAL gint32 _gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
G_END_DECLS

View File

@ -78,13 +78,64 @@ gimp_file_load (GimpRunMode run_mode,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image = gimp_image_new_by_id (g_value_get_int (gimp_value_array_index (return_vals, 1)));
image = gimp_image_new_by_id (gimp_value_get_image_id (gimp_value_array_index (return_vals, 1)));
gimp_value_array_unref (return_vals);
return image;
}
/**
* _gimp_file_load: (skip)
* @run_mode: The run mode.
* @filename: The name of the file to load.
* @raw_filename: The name as entered by the user.
*
* Loads an image file by invoking the right load handler.
*
* This procedure invokes the correct file load handler using magic if
* possible, and falling back on the file's extension and/or prefix if
* not. The name of the file to load is typically a full pathname, and
* the name entered is what the user actually typed before prepending a
* directory path. The reason for this is that if the user types
* https://www.gimp.org/foo.png he wants to fetch a URL, and the full
* pathname will not look like a URL.
*
* Returns: The output image.
**/
gint32
_gimp_file_load (GimpRunMode run_mode,
const gchar *filename,
const gchar *raw_filename)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 image_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_RUN_MODE, run_mode,
G_TYPE_STRING, filename,
G_TYPE_STRING, raw_filename,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-file-load",
args);
else
return_vals = gimp_run_procedure_array ("gimp-file-load",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return image_ID;
}
/**
* gimp_file_load_layer:
* @run_mode: The run mode.
@ -135,6 +186,56 @@ gimp_file_load_layer (GimpRunMode run_mode,
return layer_ID;
}
/**
* _gimp_file_load_layer: (skip)
* @run_mode: The run mode.
* @image_ID: Destination image.
* @filename: The name of the file to load.
*
* Loads an image file as a layer for an existing image.
*
* This procedure behaves like the file-load procedure but opens the
* specified image as a layer for an existing image. The returned layer
* needs to be added to the existing image with
* gimp_image_insert_layer().
*
* Returns: The layer created when loading the image file.
*
* Since: 2.4
**/
gint32
_gimp_file_load_layer (GimpRunMode run_mode,
gint32 image_ID,
const gchar *filename)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_RUN_MODE, run_mode,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, filename,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-file-load-layer",
args);
else
return_vals = gimp_run_procedure_array ("gimp-file-load-layer",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_ID;
}
/**
* gimp_file_load_layers:
* @run_mode: The run mode.
@ -194,6 +295,64 @@ gimp_file_load_layers (GimpRunMode run_mode,
return layer_ids;
}
/**
* _gimp_file_load_layers: (skip)
* @run_mode: The run mode.
* @image_ID: Destination image.
* @filename: The name of the file to load.
* @num_layers: (out): The number of loaded layers.
*
* Loads an image file as layers for an existing image.
*
* This procedure behaves like the file-load procedure but opens the
* specified image as layers for an existing image. The returned layers
* needs to be added to the existing image with
* gimp_image_insert_layer().
*
* Returns: (array length=num_layers): The list of loaded layers.
* The returned value must be freed with g_free().
*
* Since: 2.4
**/
gint *
_gimp_file_load_layers (GimpRunMode run_mode,
gint32 image_ID,
const gchar *filename,
gint *num_layers)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint *layer_ids = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_RUN_MODE, run_mode,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, filename,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-file-load-layers",
args);
else
return_vals = gimp_run_procedure_array ("gimp-file-load-layers",
args);
gimp_value_array_unref (args);
*num_layers = 0;
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
{
*num_layers = g_value_get_int (gimp_value_array_index (return_vals, 1));
layer_ids = gimp_value_dup_int32_array (gimp_value_array_index (return_vals, 2));
}
gimp_value_array_unref (return_vals);
return layer_ids;
}
/**
* gimp_file_save:
* @run_mode: The run mode.
@ -250,6 +409,62 @@ gimp_file_save (GimpRunMode run_mode,
return success;
}
/**
* _gimp_file_save: (skip)
* @run_mode: The run mode.
* @image_ID: Input image.
* @drawable_ID: Drawable to save.
* @filename: The name of the file to save the image in.
* @raw_filename: The name as entered by the user.
*
* Saves a file by extension.
*
* This procedure invokes the correct file save handler according to
* the file's extension and/or prefix. The name of the file to save is
* typically a full pathname, and the name entered is what the user
* actually typed before prepending a directory path. The reason for
* this is that if the user types https://www.gimp.org/foo.png she
* wants to fetch a URL, and the full pathname will not look like a
* URL.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_file_save (GimpRunMode run_mode,
gint32 image_ID,
gint32 drawable_ID,
const gchar *filename,
const gchar *raw_filename)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_RUN_MODE, run_mode,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_DRAWABLE_ID, drawable_ID,
G_TYPE_STRING, filename,
G_TYPE_STRING, raw_filename,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-file-save",
args);
else
return_vals = gimp_run_procedure_array ("gimp-file-save",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_file_save_thumbnail:
* @image: The image.
@ -296,6 +511,52 @@ gimp_file_save_thumbnail (GimpImage *image,
return success;
}
/**
* _gimp_file_save_thumbnail: (skip)
* @image_ID: The image.
* @filename: The name of the file the thumbnail belongs to.
*
* Saves a thumbnail for the given image
*
* This procedure saves a thumbnail for the given image according to
* the Free Desktop Thumbnail Managing Standard. The thumbnail is saved
* so that it belongs to the file with the given filename. This means
* you have to save the image under this name first, otherwise this
* procedure will fail. This procedure may become useful if you want to
* explicitly save a thumbnail with a file.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_file_save_thumbnail (gint32 image_ID,
const gchar *filename)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, filename,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-file-save-thumbnail",
args);
else
return_vals = gimp_run_procedure_array ("gimp-file-save-thumbnail",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_register_magic_load_handler:
* @procedure_name: The name of the procedure to be used for loading.

View File

@ -35,20 +35,42 @@ G_BEGIN_DECLS
GimpImage* gimp_file_load (GimpRunMode run_mode,
const gchar *filename,
const gchar *raw_filename);
GIMP_DEPRECATED_FOR(gimp_file_load)
G_GNUC_INTERNAL gint32 _gimp_file_load (GimpRunMode run_mode,
const gchar *filename,
const gchar *raw_filename);
gint32 gimp_file_load_layer (GimpRunMode run_mode,
GimpImage *image,
const gchar *filename);
GIMP_DEPRECATED_FOR(gimp_file_load_layer)
G_GNUC_INTERNAL gint32 _gimp_file_load_layer (GimpRunMode run_mode,
gint32 image_ID,
const gchar *filename);
gint* gimp_file_load_layers (GimpRunMode run_mode,
GimpImage *image,
const gchar *filename,
gint *num_layers);
GIMP_DEPRECATED_FOR(gimp_file_load_layers)
G_GNUC_INTERNAL gint* _gimp_file_load_layers (GimpRunMode run_mode,
gint32 image_ID,
const gchar *filename,
gint *num_layers);
gboolean gimp_file_save (GimpRunMode run_mode,
GimpImage *image,
gint32 drawable_ID,
const gchar *filename,
const gchar *raw_filename);
GIMP_DEPRECATED_FOR(gimp_file_save)
G_GNUC_INTERNAL gboolean _gimp_file_save (GimpRunMode run_mode,
gint32 image_ID,
gint32 drawable_ID,
const gchar *filename,
const gchar *raw_filename);
gboolean gimp_file_save_thumbnail (GimpImage *image,
const gchar *filename);
GIMP_DEPRECATED_FOR(gimp_file_save_thumbnail)
G_GNUC_INTERNAL gboolean _gimp_file_save_thumbnail (gint32 image_ID,
const gchar *filename);
G_GNUC_INTERNAL gboolean _gimp_register_magic_load_handler (const gchar *procedure_name,
const gchar *extensions,
const gchar *prefixes,

File diff suppressed because it is too large Load Diff

View File

@ -33,31 +33,73 @@ G_BEGIN_DECLS
gboolean gimp_image_is_valid (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_is_valid)
G_GNUC_INTERNAL gboolean _gimp_image_is_valid (gint32 image_ID);
gint* gimp_image_list (gint *num_images);
GimpImage* gimp_image_new (gint width,
gint height,
GimpImageBaseType type);
GIMP_DEPRECATED_FOR(gimp_image_new)
G_GNUC_INTERNAL gint32 _gimp_image_new (gint width,
gint height,
GimpImageBaseType type);
GimpImage* gimp_image_new_with_precision (gint width,
gint height,
GimpImageBaseType type,
GimpPrecision precision);
GIMP_DEPRECATED_FOR(gimp_image_new_with_precision)
G_GNUC_INTERNAL gint32 _gimp_image_new_with_precision (gint width,
gint height,
GimpImageBaseType type,
GimpPrecision precision);
GimpImage* gimp_image_duplicate (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_duplicate)
G_GNUC_INTERNAL gint32 _gimp_image_duplicate (gint32 image_ID);
gboolean gimp_image_delete (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_delete)
G_GNUC_INTERNAL gboolean _gimp_image_delete (gint32 image_ID);
GimpImageBaseType gimp_image_base_type (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_base_type)
G_GNUC_INTERNAL GimpImageBaseType _gimp_image_base_type (gint32 image_ID);
GimpPrecision gimp_image_get_precision (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_precision)
G_GNUC_INTERNAL GimpPrecision _gimp_image_get_precision (gint32 image_ID);
GimpLayerMode gimp_image_get_default_new_layer_mode (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_default_new_layer_mode)
G_GNUC_INTERNAL GimpLayerMode _gimp_image_get_default_new_layer_mode (gint32 image_ID);
gint gimp_image_width (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_width)
G_GNUC_INTERNAL gint _gimp_image_width (gint32 image_ID);
gint gimp_image_height (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_height)
G_GNUC_INTERNAL gint _gimp_image_height (gint32 image_ID);
gint* gimp_image_get_layers (GimpImage *image,
gint *num_layers);
GIMP_DEPRECATED_FOR(gimp_image_get_layers)
G_GNUC_INTERNAL gint* _gimp_image_get_layers (gint32 image_ID,
gint *num_layers);
gint* gimp_image_get_channels (GimpImage *image,
gint *num_channels);
GIMP_DEPRECATED_FOR(gimp_image_get_channels)
G_GNUC_INTERNAL gint* _gimp_image_get_channels (gint32 image_ID,
gint *num_channels);
gint* gimp_image_get_vectors (GimpImage *image,
gint *num_vectors);
GIMP_DEPRECATED_FOR(gimp_image_get_vectors)
G_GNUC_INTERNAL gint* _gimp_image_get_vectors (gint32 image_ID,
gint *num_vectors);
gint32 gimp_image_get_active_drawable (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_active_drawable)
G_GNUC_INTERNAL gint32 _gimp_image_get_active_drawable (gint32 image_ID);
gboolean gimp_image_unset_active_channel (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_unset_active_channel)
G_GNUC_INTERNAL gboolean _gimp_image_unset_active_channel (gint32 image_ID);
gint32 gimp_image_get_floating_sel (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_floating_sel)
G_GNUC_INTERNAL gint32 _gimp_image_get_floating_sel (gint32 image_ID);
gint32 gimp_image_floating_sel_attached_to (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_floating_sel_attached_to)
G_GNUC_INTERNAL gint32 _gimp_image_floating_sel_attached_to (gint32 image_ID);
gboolean gimp_image_pick_color (GimpImage *image,
gint32 drawable_ID,
gdouble x,
@ -66,63 +108,157 @@ gboolean gimp_image_pick_color (GimpImage
gboolean sample_average,
gdouble average_radius,
GimpRGB *color);
GIMP_DEPRECATED_FOR(gimp_image_pick_color)
G_GNUC_INTERNAL gboolean _gimp_image_pick_color (gint32 image_ID,
gint32 drawable_ID,
gdouble x,
gdouble y,
gboolean sample_merged,
gboolean sample_average,
gdouble average_radius,
GimpRGB *color);
gint32 gimp_image_pick_correlate_layer (GimpImage *image,
gint x,
gint y);
GIMP_DEPRECATED_FOR(gimp_image_pick_correlate_layer)
G_GNUC_INTERNAL gint32 _gimp_image_pick_correlate_layer (gint32 image_ID,
gint x,
gint y);
gboolean gimp_image_insert_layer (GimpImage *image,
gint32 layer_ID,
gint32 parent_ID,
gint position);
GIMP_DEPRECATED_FOR(gimp_image_insert_layer)
G_GNUC_INTERNAL gboolean _gimp_image_insert_layer (gint32 image_ID,
gint32 layer_ID,
gint32 parent_ID,
gint position);
gboolean gimp_image_remove_layer (GimpImage *image,
gint32 layer_ID);
GIMP_DEPRECATED_FOR(gimp_image_remove_layer)
G_GNUC_INTERNAL gboolean _gimp_image_remove_layer (gint32 image_ID,
gint32 layer_ID);
gboolean gimp_image_freeze_layers (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_freeze_layers)
G_GNUC_INTERNAL gboolean _gimp_image_freeze_layers (gint32 image_ID);
gboolean gimp_image_thaw_layers (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_thaw_layers)
G_GNUC_INTERNAL gboolean _gimp_image_thaw_layers (gint32 image_ID);
gboolean gimp_image_insert_channel (GimpImage *image,
gint32 channel_ID,
gint32 parent_ID,
gint position);
GIMP_DEPRECATED_FOR(gimp_image_insert_channel)
G_GNUC_INTERNAL gboolean _gimp_image_insert_channel (gint32 image_ID,
gint32 channel_ID,
gint32 parent_ID,
gint position);
gboolean gimp_image_remove_channel (GimpImage *image,
gint32 channel_ID);
GIMP_DEPRECATED_FOR(gimp_image_remove_channel)
G_GNUC_INTERNAL gboolean _gimp_image_remove_channel (gint32 image_ID,
gint32 channel_ID);
gboolean gimp_image_freeze_channels (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_freeze_channels)
G_GNUC_INTERNAL gboolean _gimp_image_freeze_channels (gint32 image_ID);
gboolean gimp_image_thaw_channels (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_thaw_channels)
G_GNUC_INTERNAL gboolean _gimp_image_thaw_channels (gint32 image_ID);
gboolean gimp_image_insert_vectors (GimpImage *image,
gint32 vectors_ID,
gint32 parent_ID,
gint position);
GIMP_DEPRECATED_FOR(gimp_image_insert_vectors)
G_GNUC_INTERNAL gboolean _gimp_image_insert_vectors (gint32 image_ID,
gint32 vectors_ID,
gint32 parent_ID,
gint position);
gboolean gimp_image_remove_vectors (GimpImage *image,
gint32 vectors_ID);
GIMP_DEPRECATED_FOR(gimp_image_remove_vectors)
G_GNUC_INTERNAL gboolean _gimp_image_remove_vectors (gint32 image_ID,
gint32 vectors_ID);
gboolean gimp_image_freeze_vectors (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_freeze_vectors)
G_GNUC_INTERNAL gboolean _gimp_image_freeze_vectors (gint32 image_ID);
gboolean gimp_image_thaw_vectors (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_thaw_vectors)
G_GNUC_INTERNAL gboolean _gimp_image_thaw_vectors (gint32 image_ID);
gint gimp_image_get_item_position (GimpImage *image,
gint32 item_ID);
GIMP_DEPRECATED_FOR(gimp_image_get_item_position)
G_GNUC_INTERNAL gint _gimp_image_get_item_position (gint32 image_ID,
gint32 item_ID);
gboolean gimp_image_raise_item (GimpImage *image,
gint32 item_ID);
GIMP_DEPRECATED_FOR(gimp_image_raise_item)
G_GNUC_INTERNAL gboolean _gimp_image_raise_item (gint32 image_ID,
gint32 item_ID);
gboolean gimp_image_lower_item (GimpImage *image,
gint32 item_ID);
GIMP_DEPRECATED_FOR(gimp_image_lower_item)
G_GNUC_INTERNAL gboolean _gimp_image_lower_item (gint32 image_ID,
gint32 item_ID);
gboolean gimp_image_raise_item_to_top (GimpImage *image,
gint32 item_ID);
GIMP_DEPRECATED_FOR(gimp_image_raise_item_to_top)
G_GNUC_INTERNAL gboolean _gimp_image_raise_item_to_top (gint32 image_ID,
gint32 item_ID);
gboolean gimp_image_lower_item_to_bottom (GimpImage *image,
gint32 item_ID);
GIMP_DEPRECATED_FOR(gimp_image_lower_item_to_bottom)
G_GNUC_INTERNAL gboolean _gimp_image_lower_item_to_bottom (gint32 image_ID,
gint32 item_ID);
gboolean gimp_image_reorder_item (GimpImage *image,
gint32 item_ID,
gint32 parent_ID,
gint position);
GIMP_DEPRECATED_FOR(gimp_image_reorder_item)
G_GNUC_INTERNAL gboolean _gimp_image_reorder_item (gint32 image_ID,
gint32 item_ID,
gint32 parent_ID,
gint position);
gint32 gimp_image_flatten (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_flatten)
G_GNUC_INTERNAL gint32 _gimp_image_flatten (gint32 image_ID);
gint32 gimp_image_merge_visible_layers (GimpImage *image,
GimpMergeType merge_type);
GIMP_DEPRECATED_FOR(gimp_image_merge_visible_layers)
G_GNUC_INTERNAL gint32 _gimp_image_merge_visible_layers (gint32 image_ID,
GimpMergeType merge_type);
gint32 gimp_image_merge_down (GimpImage *image,
gint32 merge_layer_ID,
GimpMergeType merge_type);
GIMP_DEPRECATED_FOR(gimp_image_merge_down)
G_GNUC_INTERNAL gint32 _gimp_image_merge_down (gint32 image_ID,
gint32 merge_layer_ID,
GimpMergeType merge_type);
G_GNUC_INTERNAL guint8* _gimp_image_get_colormap (GimpImage *image,
gint *num_bytes);
GIMP_DEPRECATED_FOR(_gimp_image_get_colormap)
G_GNUC_INTERNAL guint8* __gimp_image_get_colormap (gint32 image_ID,
gint *num_bytes);
G_GNUC_INTERNAL gboolean _gimp_image_set_colormap (GimpImage *image,
gint num_bytes,
const guint8 *colormap);
GIMP_DEPRECATED_FOR(_gimp_image_set_colormap)
G_GNUC_INTERNAL gboolean __gimp_image_set_colormap (gint32 image_ID,
gint num_bytes,
const guint8 *colormap);
G_GNUC_INTERNAL gchar* _gimp_image_get_metadata (GimpImage *image);
GIMP_DEPRECATED_FOR(_gimp_image_get_metadata)
G_GNUC_INTERNAL gchar* __gimp_image_get_metadata (gint32 image_ID);
G_GNUC_INTERNAL gboolean _gimp_image_set_metadata (GimpImage *image,
const gchar *metadata_string);
GIMP_DEPRECATED_FOR(_gimp_image_set_metadata)
G_GNUC_INTERNAL gboolean __gimp_image_set_metadata (gint32 image_ID,
const gchar *metadata_string);
gboolean gimp_image_clean_all (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_clean_all)
G_GNUC_INTERNAL gboolean _gimp_image_clean_all (gint32 image_ID);
gboolean gimp_image_is_dirty (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_is_dirty)
G_GNUC_INTERNAL gboolean _gimp_image_is_dirty (gint32 image_ID);
G_GNUC_INTERNAL gboolean _gimp_image_thumbnail (GimpImage *image,
gint width,
gint height,
@ -131,66 +267,169 @@ G_GNUC_INTERNAL gboolean _gimp_image_thumbnail (GimpImage
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
GIMP_DEPRECATED_FOR(_gimp_image_thumbnail)
G_GNUC_INTERNAL gboolean __gimp_image_thumbnail (gint32 image_ID,
gint width,
gint height,
gint *actual_width,
gint *actual_height,
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
gint32 gimp_image_get_active_layer (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_active_layer)
G_GNUC_INTERNAL gint32 _gimp_image_get_active_layer (gint32 image_ID);
gboolean gimp_image_set_active_layer (GimpImage *image,
gint32 active_layer_ID);
GIMP_DEPRECATED_FOR(gimp_image_set_active_layer)
G_GNUC_INTERNAL gboolean _gimp_image_set_active_layer (gint32 image_ID,
gint32 active_layer_ID);
gint32 gimp_image_get_active_channel (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_active_channel)
G_GNUC_INTERNAL gint32 _gimp_image_get_active_channel (gint32 image_ID);
gboolean gimp_image_set_active_channel (GimpImage *image,
gint32 active_channel_ID);
GIMP_DEPRECATED_FOR(gimp_image_set_active_channel)
G_GNUC_INTERNAL gboolean _gimp_image_set_active_channel (gint32 image_ID,
gint32 active_channel_ID);
gint32 gimp_image_get_active_vectors (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_active_vectors)
G_GNUC_INTERNAL gint32 _gimp_image_get_active_vectors (gint32 image_ID);
gboolean gimp_image_set_active_vectors (GimpImage *image,
gint32 active_vectors_ID);
GIMP_DEPRECATED_FOR(gimp_image_set_active_vectors)
G_GNUC_INTERNAL gboolean _gimp_image_set_active_vectors (gint32 image_ID,
gint32 active_vectors_ID);
gint32 gimp_image_get_selection (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_selection)
G_GNUC_INTERNAL gint32 _gimp_image_get_selection (gint32 image_ID);
gboolean gimp_image_get_component_active (GimpImage *image,
GimpChannelType component);
GIMP_DEPRECATED_FOR(gimp_image_get_component_active)
G_GNUC_INTERNAL gboolean _gimp_image_get_component_active (gint32 image_ID,
GimpChannelType component);
gboolean gimp_image_set_component_active (GimpImage *image,
GimpChannelType component,
gboolean active);
GIMP_DEPRECATED_FOR(gimp_image_set_component_active)
G_GNUC_INTERNAL gboolean _gimp_image_set_component_active (gint32 image_ID,
GimpChannelType component,
gboolean active);
gboolean gimp_image_get_component_visible (GimpImage *image,
GimpChannelType component);
GIMP_DEPRECATED_FOR(gimp_image_get_component_visible)
G_GNUC_INTERNAL gboolean _gimp_image_get_component_visible (gint32 image_ID,
GimpChannelType component);
gboolean gimp_image_set_component_visible (GimpImage *image,
GimpChannelType component,
gboolean visible);
GIMP_DEPRECATED_FOR(gimp_image_set_component_visible)
G_GNUC_INTERNAL gboolean _gimp_image_set_component_visible (gint32 image_ID,
GimpChannelType component,
gboolean visible);
gchar* gimp_image_get_filename (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_filename)
G_GNUC_INTERNAL gchar* _gimp_image_get_filename (gint32 image_ID);
gboolean gimp_image_set_filename (GimpImage *image,
const gchar *filename);
GIMP_DEPRECATED_FOR(gimp_image_set_filename)
G_GNUC_INTERNAL gboolean _gimp_image_set_filename (gint32 image_ID,
const gchar *filename);
gchar* gimp_image_get_uri (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_uri)
G_GNUC_INTERNAL gchar* _gimp_image_get_uri (gint32 image_ID);
gchar* gimp_image_get_xcf_uri (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_xcf_uri)
G_GNUC_INTERNAL gchar* _gimp_image_get_xcf_uri (gint32 image_ID);
gchar* gimp_image_get_imported_uri (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_imported_uri)
G_GNUC_INTERNAL gchar* _gimp_image_get_imported_uri (gint32 image_ID);
gchar* gimp_image_get_exported_uri (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_exported_uri)
G_GNUC_INTERNAL gchar* _gimp_image_get_exported_uri (gint32 image_ID);
gchar* gimp_image_get_name (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_name)
G_GNUC_INTERNAL gchar* _gimp_image_get_name (gint32 image_ID);
gboolean gimp_image_get_resolution (GimpImage *image,
gdouble *xresolution,
gdouble *yresolution);
GIMP_DEPRECATED_FOR(gimp_image_get_resolution)
G_GNUC_INTERNAL gboolean _gimp_image_get_resolution (gint32 image_ID,
gdouble *xresolution,
gdouble *yresolution);
gboolean gimp_image_set_resolution (GimpImage *image,
gdouble xresolution,
gdouble yresolution);
GIMP_DEPRECATED_FOR(gimp_image_set_resolution)
G_GNUC_INTERNAL gboolean _gimp_image_set_resolution (gint32 image_ID,
gdouble xresolution,
gdouble yresolution);
GimpUnit gimp_image_get_unit (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_unit)
G_GNUC_INTERNAL GimpUnit _gimp_image_get_unit (gint32 image_ID);
gboolean gimp_image_set_unit (GimpImage *image,
GimpUnit unit);
GIMP_DEPRECATED_FOR(gimp_image_set_unit)
G_GNUC_INTERNAL gboolean _gimp_image_set_unit (gint32 image_ID,
GimpUnit unit);
guint gimp_image_get_tattoo_state (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_get_tattoo_state)
G_GNUC_INTERNAL guint _gimp_image_get_tattoo_state (gint32 image_ID);
gboolean gimp_image_set_tattoo_state (GimpImage *image,
guint tattoo_state);
GIMP_DEPRECATED_FOR(gimp_image_set_tattoo_state)
G_GNUC_INTERNAL gboolean _gimp_image_set_tattoo_state (gint32 image_ID,
guint tattoo_state);
gint32 gimp_image_get_layer_by_tattoo (GimpImage *image,
guint tattoo);
GIMP_DEPRECATED_FOR(gimp_image_get_layer_by_tattoo)
G_GNUC_INTERNAL gint32 _gimp_image_get_layer_by_tattoo (gint32 image_ID,
guint tattoo);
gint32 gimp_image_get_channel_by_tattoo (GimpImage *image,
guint tattoo);
GIMP_DEPRECATED_FOR(gimp_image_get_channel_by_tattoo)
G_GNUC_INTERNAL gint32 _gimp_image_get_channel_by_tattoo (gint32 image_ID,
guint tattoo);
gint32 gimp_image_get_vectors_by_tattoo (GimpImage *image,
guint tattoo);
GIMP_DEPRECATED_FOR(gimp_image_get_vectors_by_tattoo)
G_GNUC_INTERNAL gint32 _gimp_image_get_vectors_by_tattoo (gint32 image_ID,
guint tattoo);
gint32 gimp_image_get_layer_by_name (GimpImage *image,
const gchar *name);
GIMP_DEPRECATED_FOR(gimp_image_get_layer_by_name)
G_GNUC_INTERNAL gint32 _gimp_image_get_layer_by_name (gint32 image_ID,
const gchar *name);
gint32 gimp_image_get_channel_by_name (GimpImage *image,
const gchar *name);
GIMP_DEPRECATED_FOR(gimp_image_get_channel_by_name)
G_GNUC_INTERNAL gint32 _gimp_image_get_channel_by_name (gint32 image_ID,
const gchar *name);
gint32 gimp_image_get_vectors_by_name (GimpImage *image,
const gchar *name);
GIMP_DEPRECATED_FOR(gimp_image_get_vectors_by_name)
G_GNUC_INTERNAL gint32 _gimp_image_get_vectors_by_name (gint32 image_ID,
const gchar *name);
gboolean gimp_image_attach_parasite (GimpImage *image,
const GimpParasite *parasite);
GIMP_DEPRECATED_FOR(gimp_image_attach_parasite)
G_GNUC_INTERNAL gboolean _gimp_image_attach_parasite (gint32 image_ID,
const GimpParasite *parasite);
gboolean gimp_image_detach_parasite (GimpImage *image,
const gchar *name);
GIMP_DEPRECATED_FOR(gimp_image_detach_parasite)
G_GNUC_INTERNAL gboolean _gimp_image_detach_parasite (gint32 image_ID,
const gchar *name);
GimpParasite* gimp_image_get_parasite (GimpImage *image,
const gchar *name);
GIMP_DEPRECATED_FOR(gimp_image_get_parasite)
G_GNUC_INTERNAL GimpParasite* _gimp_image_get_parasite (gint32 image_ID,
const gchar *name);
gchar** gimp_image_get_parasite_list (GimpImage *image,
gint *num_parasites);
GIMP_DEPRECATED_FOR(gimp_image_get_parasite_list)
G_GNUC_INTERNAL gchar** _gimp_image_get_parasite_list (gint32 image_ID,
gint *num_parasites);
G_END_DECLS

View File

@ -85,6 +85,56 @@ _gimp_image_get_color_profile (GimpImage *image,
return profile_data;
}
/**
* __gimp_image_get_color_profile: (skip)
* @image_ID: The image.
* @num_bytes: (out): Number of bytes in the color_profile array.
*
* Returns the image's color profile
*
* This procedure returns the image's color profile, or NULL if the
* image has no color profile assigned.
*
* Returns: (array length=num_bytes): The image's serialized color profile.
* The returned value must be freed with g_free().
*
* Since: 2.10
**/
guint8 *
__gimp_image_get_color_profile (gint32 image_ID,
gint *num_bytes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
guint8 *profile_data = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-get-color-profile",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-get-color-profile",
args);
gimp_value_array_unref (args);
*num_bytes = 0;
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
{
*num_bytes = g_value_get_int (gimp_value_array_index (return_vals, 1));
profile_data = gimp_value_dup_uint8_array (gimp_value_array_index (return_vals, 2));
}
gimp_value_array_unref (return_vals);
return profile_data;
}
/**
* _gimp_image_get_effective_color_profile:
* @image: The image.
@ -139,6 +189,59 @@ _gimp_image_get_effective_color_profile (GimpImage *image,
return profile_data;
}
/**
* __gimp_image_get_effective_color_profile: (skip)
* @image_ID: The image.
* @num_bytes: (out): Number of bytes in the color_profile array.
*
* Returns the color profile that is used for the image
*
* This procedure returns the color profile that is actually used for
* this image, which is the profile returned by
* gimp_image_get_color_profile() if the image has a profile assigned,
* or a generated default RGB or grayscale profile, according to the
* image's type.
*
* Returns: (array length=num_bytes): The image's serialized color profile.
* The returned value must be freed with g_free().
*
* Since: 2.10
**/
guint8 *
__gimp_image_get_effective_color_profile (gint32 image_ID,
gint *num_bytes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
guint8 *profile_data = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-get-effective-color-profile",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-get-effective-color-profile",
args);
gimp_value_array_unref (args);
*num_bytes = 0;
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
{
*num_bytes = g_value_get_int (gimp_value_array_index (return_vals, 1));
profile_data = gimp_value_dup_uint8_array (gimp_value_array_index (return_vals, 2));
}
gimp_value_array_unref (return_vals);
return profile_data;
}
/**
* _gimp_image_set_color_profile:
* @image: The image.
@ -190,6 +293,57 @@ _gimp_image_set_color_profile (GimpImage *image,
return success;
}
/**
* __gimp_image_set_color_profile: (skip)
* @image_ID: The image.
* @num_bytes: Number of bytes in the color_profile array.
* @color_profile: (array length=num_bytes) (element-type guint8): The new serialized color profile.
*
* Sets the image's color profile
*
* This procedure sets the image's color profile, or unsets it if NULL
* is passed as 'color_profile'. This procedure does no color
* conversion. However, it will change the pixel format of all layers
* to contain the babl space matching the profile. You must call this
* procedure before adding layers to the image.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
__gimp_image_set_color_profile (gint32 image_ID,
gint num_bytes,
const guint8 *color_profile)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, num_bytes,
GIMP_TYPE_UINT8_ARRAY, NULL,
G_TYPE_NONE);
gimp_value_set_uint8_array (gimp_value_array_index (args, 2), color_profile, num_bytes);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-set-color-profile",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-set-color-profile",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_set_color_profile_from_file:
* @image: The image.
@ -238,6 +392,54 @@ gimp_image_set_color_profile_from_file (GimpImage *image,
return success;
}
/**
* _gimp_image_set_color_profile_from_file: (skip)
* @image_ID: The image.
* @uri: The URI of the file containing the new color profile.
*
* Sets the image's color profile from an ICC file
*
* This procedure sets the image's color profile from a file containing
* an ICC profile, or unsets it if NULL is passed as 'uri'. This
* procedure does no color conversion. However, it will change the
* pixel format of all layers to contain the babl space matching the
* profile. You must call this procedure before adding layers to the
* image.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
_gimp_image_set_color_profile_from_file (gint32 image_ID,
const gchar *uri)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, uri,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-set-color-profile-from-file",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-set-color-profile-from-file",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_image_convert_color_profile:
* @image: The image.
@ -294,6 +496,62 @@ _gimp_image_convert_color_profile (GimpImage *image,
return success;
}
/**
* __gimp_image_convert_color_profile: (skip)
* @image_ID: The image.
* @num_bytes: Number of bytes in the color_profile array.
* @color_profile: (array length=num_bytes) (element-type guint8): The serialized color profile.
* @intent: Rendering intent.
* @bpc: Black point compensation.
*
* Convert the image's layers to a color profile
*
* This procedure converts from the image's color profile (or the
* default RGB or grayscale profile if none is set) to the given color
* profile. Only RGB and grayscale color profiles are accepted,
* according to the image's type.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
__gimp_image_convert_color_profile (gint32 image_ID,
gint num_bytes,
const guint8 *color_profile,
GimpColorRenderingIntent intent,
gboolean bpc)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, num_bytes,
GIMP_TYPE_UINT8_ARRAY, NULL,
GIMP_TYPE_COLOR_RENDERING_INTENT, intent,
G_TYPE_BOOLEAN, bpc,
G_TYPE_NONE);
gimp_value_set_uint8_array (gimp_value_array_index (args, 2), color_profile, num_bytes);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-convert-color-profile",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-convert-color-profile",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_convert_color_profile_from_file:
* @image: The image.
@ -345,3 +603,55 @@ gimp_image_convert_color_profile_from_file (GimpImage *image,
return success;
}
/**
* _gimp_image_convert_color_profile_from_file: (skip)
* @image_ID: The image.
* @uri: The URI of the file containing the new color profile.
* @intent: Rendering intent.
* @bpc: Black point compensation.
*
* Convert the image's layers to a color profile
*
* This procedure converts from the image's color profile (or the
* default RGB or grayscale profile if none is set) to an ICC profile
* specified by 'uri'. Only RGB and grayscale color profiles are
* accepted, according to the image's type.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
_gimp_image_convert_color_profile_from_file (gint32 image_ID,
const gchar *uri,
GimpColorRenderingIntent intent,
gboolean bpc)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, uri,
GIMP_TYPE_COLOR_RENDERING_INTENT, intent,
G_TYPE_BOOLEAN, bpc,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-convert-color-profile-from-file",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-convert-color-profile-from-file",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}

View File

@ -34,22 +34,46 @@ G_BEGIN_DECLS
G_GNUC_INTERNAL guint8* _gimp_image_get_color_profile (GimpImage *image,
gint *num_bytes);
GIMP_DEPRECATED_FOR(_gimp_image_get_color_profile)
G_GNUC_INTERNAL guint8* __gimp_image_get_color_profile (gint32 image_ID,
gint *num_bytes);
G_GNUC_INTERNAL guint8* _gimp_image_get_effective_color_profile (GimpImage *image,
gint *num_bytes);
GIMP_DEPRECATED_FOR(_gimp_image_get_effective_color_profile)
G_GNUC_INTERNAL guint8* __gimp_image_get_effective_color_profile (gint32 image_ID,
gint *num_bytes);
G_GNUC_INTERNAL gboolean _gimp_image_set_color_profile (GimpImage *image,
gint num_bytes,
const guint8 *color_profile);
GIMP_DEPRECATED_FOR(_gimp_image_set_color_profile)
G_GNUC_INTERNAL gboolean __gimp_image_set_color_profile (gint32 image_ID,
gint num_bytes,
const guint8 *color_profile);
gboolean gimp_image_set_color_profile_from_file (GimpImage *image,
const gchar *uri);
GIMP_DEPRECATED_FOR(gimp_image_set_color_profile_from_file)
G_GNUC_INTERNAL gboolean _gimp_image_set_color_profile_from_file (gint32 image_ID,
const gchar *uri);
G_GNUC_INTERNAL gboolean _gimp_image_convert_color_profile (GimpImage *image,
gint num_bytes,
const guint8 *color_profile,
GimpColorRenderingIntent intent,
gboolean bpc);
GIMP_DEPRECATED_FOR(_gimp_image_convert_color_profile)
G_GNUC_INTERNAL gboolean __gimp_image_convert_color_profile (gint32 image_ID,
gint num_bytes,
const guint8 *color_profile,
GimpColorRenderingIntent intent,
gboolean bpc);
gboolean gimp_image_convert_color_profile_from_file (GimpImage *image,
const gchar *uri,
GimpColorRenderingIntent intent,
gboolean bpc);
GIMP_DEPRECATED_FOR(gimp_image_convert_color_profile_from_file)
G_GNUC_INTERNAL gboolean _gimp_image_convert_color_profile_from_file (gint32 image_ID,
const gchar *uri,
GimpColorRenderingIntent intent,
gboolean bpc);
G_END_DECLS

View File

@ -75,6 +75,47 @@ gimp_image_convert_rgb (GimpImage *image)
return success;
}
/**
* _gimp_image_convert_rgb: (skip)
* @image_ID: The image.
*
* Convert specified image to RGB color
*
* This procedure converts the specified image to RGB color. This
* process requires an image in Grayscale or Indexed color mode. No
* image content is lost in this process aside from the colormap for an
* indexed image.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_convert_rgb (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-convert-rgb",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-convert-rgb",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_convert_grayscale:
* @image: The image.
@ -114,6 +155,45 @@ gimp_image_convert_grayscale (GimpImage *image)
return success;
}
/**
* _gimp_image_convert_grayscale: (skip)
* @image_ID: The image.
*
* Convert specified image to grayscale
*
* This procedure converts the specified image to grayscale. This
* process requires an image in RGB or Indexed color mode.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_convert_grayscale (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-convert-grayscale",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-convert-grayscale",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_convert_indexed:
* @image: The image.
@ -182,6 +262,74 @@ gimp_image_convert_indexed (GimpImage *image,
return success;
}
/**
* _gimp_image_convert_indexed: (skip)
* @image_ID: The image.
* @dither_type: The dither type to use.
* @palette_type: The type of palette to use.
* @num_cols: The number of colors to quantize to, ignored unless (palette_type == GIMP_CONVERT_PALETTE_GENERATE).
* @alpha_dither: Dither transparency to fake partial opacity.
* @remove_unused: Remove unused or duplicate color entries from final palette, ignored if (palette_type == GIMP_CONVERT_PALETTE_GENERATE).
* @palette: The name of the custom palette to use, ignored unless (palette_type == GIMP_CONVERT_PALETTE_CUSTOM).
*
* Convert specified image to and Indexed image
*
* This procedure converts the specified image to 'indexed' color. This
* process requires an image in RGB or Grayscale mode. The
* 'palette_type' specifies what kind of palette to use, A type of '0'
* means to use an optimal palette of 'num_cols' generated from the
* colors in the image. A type of '1' means to re-use the previous
* palette (not currently implemented). A type of '2' means to use the
* so-called WWW-optimized palette. Type '3' means to use only black
* and white colors. A type of '4' means to use a palette from the gimp
* palettes directories. The 'dither type' specifies what kind of
* dithering to use. '0' means no dithering, '1' means standard
* Floyd-Steinberg error diffusion, '2' means Floyd-Steinberg error
* diffusion with reduced bleeding, '3' means dithering based on pixel
* location ('Fixed' dithering).
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_convert_indexed (gint32 image_ID,
GimpConvertDitherType dither_type,
GimpConvertPaletteType palette_type,
gint num_cols,
gboolean alpha_dither,
gboolean remove_unused,
const gchar *palette)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_CONVERT_DITHER_TYPE, dither_type,
GIMP_TYPE_CONVERT_PALETTE_TYPE, palette_type,
G_TYPE_INT, num_cols,
G_TYPE_BOOLEAN, alpha_dither,
G_TYPE_BOOLEAN, remove_unused,
G_TYPE_STRING, palette,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-convert-indexed",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-convert-indexed",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_convert_set_dither_matrix:
* @width: Width of the matrix (0 to reset to default matrix).
@ -277,3 +425,48 @@ gimp_image_convert_precision (GimpImage *image,
return success;
}
/**
* _gimp_image_convert_precision: (skip)
* @image_ID: The image.
* @precision: The new precision.
*
* Convert the image to the specified precision
*
* This procedure converts the image to the specified precision. Note
* that indexed images cannot be converted and are always in
* GIMP_PRECISION_U8.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
_gimp_image_convert_precision (gint32 image_ID,
GimpPrecision precision)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_PRECISION, precision,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-convert-precision",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-convert-precision",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}

View File

@ -33,7 +33,11 @@ G_BEGIN_DECLS
gboolean gimp_image_convert_rgb (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_convert_rgb)
G_GNUC_INTERNAL gboolean _gimp_image_convert_rgb (gint32 image_ID);
gboolean gimp_image_convert_grayscale (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_convert_grayscale)
G_GNUC_INTERNAL gboolean _gimp_image_convert_grayscale (gint32 image_ID);
gboolean gimp_image_convert_indexed (GimpImage *image,
GimpConvertDitherType dither_type,
GimpConvertPaletteType palette_type,
@ -41,12 +45,23 @@ gboolean gimp_image_convert_indexed (GimpImage *image,
gboolean alpha_dither,
gboolean remove_unused,
const gchar *palette);
GIMP_DEPRECATED_FOR(gimp_image_convert_indexed)
G_GNUC_INTERNAL gboolean _gimp_image_convert_indexed (gint32 image_ID,
GimpConvertDitherType dither_type,
GimpConvertPaletteType palette_type,
gint num_cols,
gboolean alpha_dither,
gboolean remove_unused,
const gchar *palette);
gboolean gimp_image_convert_set_dither_matrix (gint width,
gint height,
gint matrix_length,
const guint8 *matrix);
gboolean gimp_image_convert_precision (GimpImage *image,
GimpPrecision precision);
GIMP_DEPRECATED_FOR(gimp_image_convert_precision)
G_GNUC_INTERNAL gboolean _gimp_image_convert_precision (gint32 image_ID,
GimpPrecision precision);
G_END_DECLS

View File

@ -88,6 +88,60 @@ gimp_image_grid_get_spacing (GimpImage *image,
return success;
}
/**
* _gimp_image_grid_get_spacing: (skip)
* @image_ID: The image.
* @xspacing: (out): The image's grid horizontal spacing.
* @yspacing: (out): The image's grid vertical spacing.
*
* Gets the spacing of an image's grid.
*
* This procedure retrieves the horizontal and vertical spacing of an
* image's grid. It takes the image as parameter.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_image_grid_get_spacing (gint32 image_ID,
gdouble *xspacing,
gdouble *yspacing)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-get-spacing",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-get-spacing",
args);
gimp_value_array_unref (args);
*xspacing = 0.0;
*yspacing = 0.0;
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
if (success)
{
*xspacing = g_value_get_double (gimp_value_array_index (return_vals, 1));
*yspacing = g_value_get_double (gimp_value_array_index (return_vals, 2));
}
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_grid_set_spacing:
* @image: The image.
@ -135,6 +189,53 @@ gimp_image_grid_set_spacing (GimpImage *image,
return success;
}
/**
* _gimp_image_grid_set_spacing: (skip)
* @image_ID: The image.
* @xspacing: The image's grid horizontal spacing.
* @yspacing: The image's grid vertical spacing.
*
* Sets the spacing of an image's grid.
*
* This procedure sets the horizontal and vertical spacing of an
* image's grid.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_image_grid_set_spacing (gint32 image_ID,
gdouble xspacing,
gdouble yspacing)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_DOUBLE, xspacing,
G_TYPE_DOUBLE, yspacing,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-set-spacing",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-set-spacing",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_grid_get_offset:
* @image: The image.
@ -189,6 +290,60 @@ gimp_image_grid_get_offset (GimpImage *image,
return success;
}
/**
* _gimp_image_grid_get_offset: (skip)
* @image_ID: The image.
* @xoffset: (out): The image's grid horizontal offset.
* @yoffset: (out): The image's grid vertical offset.
*
* Gets the offset of an image's grid.
*
* This procedure retrieves the horizontal and vertical offset of an
* image's grid. It takes the image as parameter.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_image_grid_get_offset (gint32 image_ID,
gdouble *xoffset,
gdouble *yoffset)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-get-offset",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-get-offset",
args);
gimp_value_array_unref (args);
*xoffset = 0.0;
*yoffset = 0.0;
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
if (success)
{
*xoffset = g_value_get_double (gimp_value_array_index (return_vals, 1));
*yoffset = g_value_get_double (gimp_value_array_index (return_vals, 2));
}
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_grid_set_offset:
* @image: The image.
@ -236,6 +391,53 @@ gimp_image_grid_set_offset (GimpImage *image,
return success;
}
/**
* _gimp_image_grid_set_offset: (skip)
* @image_ID: The image.
* @xoffset: The image's grid horizontal offset.
* @yoffset: The image's grid vertical offset.
*
* Sets the offset of an image's grid.
*
* This procedure sets the horizontal and vertical offset of an image's
* grid.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_image_grid_set_offset (gint32 image_ID,
gdouble xoffset,
gdouble yoffset)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_DOUBLE, xoffset,
G_TYPE_DOUBLE, yoffset,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-set-offset",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-set-offset",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_grid_get_foreground_color:
* @image: The image.
@ -281,6 +483,51 @@ gimp_image_grid_get_foreground_color (GimpImage *image,
return success;
}
/**
* _gimp_image_grid_get_foreground_color: (skip)
* @image_ID: The image.
* @fgcolor: (out caller-allocates): The image's grid foreground color.
*
* Sets the foreground color of an image's grid.
*
* This procedure gets the foreground color of an image's grid.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_image_grid_get_foreground_color (gint32 image_ID,
GimpRGB *fgcolor)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-get-foreground-color",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-get-foreground-color",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
if (success)
gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*fgcolor);
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_grid_set_foreground_color:
* @image: The image.
@ -324,6 +571,49 @@ gimp_image_grid_set_foreground_color (GimpImage *image,
return success;
}
/**
* _gimp_image_grid_set_foreground_color: (skip)
* @image_ID: The image.
* @fgcolor: The new foreground color.
*
* Gets the foreground color of an image's grid.
*
* This procedure sets the foreground color of an image's grid.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_image_grid_set_foreground_color (gint32 image_ID,
const GimpRGB *fgcolor)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_RGB, fgcolor,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-set-foreground-color",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-set-foreground-color",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_grid_get_background_color:
* @image: The image.
@ -369,6 +659,51 @@ gimp_image_grid_get_background_color (GimpImage *image,
return success;
}
/**
* _gimp_image_grid_get_background_color: (skip)
* @image_ID: The image.
* @bgcolor: (out caller-allocates): The image's grid background color.
*
* Sets the background color of an image's grid.
*
* This procedure gets the background color of an image's grid.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_image_grid_get_background_color (gint32 image_ID,
GimpRGB *bgcolor)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-get-background-color",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-get-background-color",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
if (success)
gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*bgcolor);
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_grid_set_background_color:
* @image: The image.
@ -412,6 +747,49 @@ gimp_image_grid_set_background_color (GimpImage *image,
return success;
}
/**
* _gimp_image_grid_set_background_color: (skip)
* @image_ID: The image.
* @bgcolor: The new background color.
*
* Gets the background color of an image's grid.
*
* This procedure sets the background color of an image's grid.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_image_grid_set_background_color (gint32 image_ID,
const GimpRGB *bgcolor)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_RGB, bgcolor,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-set-background-color",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-set-background-color",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_grid_get_style:
* @image: The image.
@ -453,6 +831,47 @@ gimp_image_grid_get_style (GimpImage *image)
return style;
}
/**
* _gimp_image_grid_get_style: (skip)
* @image_ID: The image.
*
* Gets the style of an image's grid.
*
* This procedure retrieves the style of an image's grid.
*
* Returns: The image's grid style.
*
* Since: 2.4
**/
GimpGridStyle
_gimp_image_grid_get_style (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpGridStyle style = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-get-style",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-get-style",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
style = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return style;
}
/**
* gimp_image_grid_set_style:
* @image: The image.
@ -496,3 +915,47 @@ gimp_image_grid_set_style (GimpImage *image,
return success;
}
/**
* _gimp_image_grid_set_style: (skip)
* @image_ID: The image.
* @style: The image's grid style.
*
* Sets the style unit of an image's grid.
*
* This procedure sets the style of an image's grid. It takes the image
* and the new style as parameters.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_image_grid_set_style (gint32 image_ID,
GimpGridStyle style)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_GRID_STYLE, style,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-grid-set-style",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-grid-set-style",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}

View File

@ -35,26 +35,59 @@ G_BEGIN_DECLS
gboolean gimp_image_grid_get_spacing (GimpImage *image,
gdouble *xspacing,
gdouble *yspacing);
GIMP_DEPRECATED_FOR(gimp_image_grid_get_spacing)
G_GNUC_INTERNAL gboolean _gimp_image_grid_get_spacing (gint32 image_ID,
gdouble *xspacing,
gdouble *yspacing);
gboolean gimp_image_grid_set_spacing (GimpImage *image,
gdouble xspacing,
gdouble yspacing);
GIMP_DEPRECATED_FOR(gimp_image_grid_set_spacing)
G_GNUC_INTERNAL gboolean _gimp_image_grid_set_spacing (gint32 image_ID,
gdouble xspacing,
gdouble yspacing);
gboolean gimp_image_grid_get_offset (GimpImage *image,
gdouble *xoffset,
gdouble *yoffset);
GIMP_DEPRECATED_FOR(gimp_image_grid_get_offset)
G_GNUC_INTERNAL gboolean _gimp_image_grid_get_offset (gint32 image_ID,
gdouble *xoffset,
gdouble *yoffset);
gboolean gimp_image_grid_set_offset (GimpImage *image,
gdouble xoffset,
gdouble yoffset);
GIMP_DEPRECATED_FOR(gimp_image_grid_set_offset)
G_GNUC_INTERNAL gboolean _gimp_image_grid_set_offset (gint32 image_ID,
gdouble xoffset,
gdouble yoffset);
gboolean gimp_image_grid_get_foreground_color (GimpImage *image,
GimpRGB *fgcolor);
GIMP_DEPRECATED_FOR(gimp_image_grid_get_foreground_color)
G_GNUC_INTERNAL gboolean _gimp_image_grid_get_foreground_color (gint32 image_ID,
GimpRGB *fgcolor);
gboolean gimp_image_grid_set_foreground_color (GimpImage *image,
const GimpRGB *fgcolor);
GIMP_DEPRECATED_FOR(gimp_image_grid_set_foreground_color)
G_GNUC_INTERNAL gboolean _gimp_image_grid_set_foreground_color (gint32 image_ID,
const GimpRGB *fgcolor);
gboolean gimp_image_grid_get_background_color (GimpImage *image,
GimpRGB *bgcolor);
GIMP_DEPRECATED_FOR(gimp_image_grid_get_background_color)
G_GNUC_INTERNAL gboolean _gimp_image_grid_get_background_color (gint32 image_ID,
GimpRGB *bgcolor);
gboolean gimp_image_grid_set_background_color (GimpImage *image,
const GimpRGB *bgcolor);
GIMP_DEPRECATED_FOR(gimp_image_grid_set_background_color)
G_GNUC_INTERNAL gboolean _gimp_image_grid_set_background_color (gint32 image_ID,
const GimpRGB *bgcolor);
GimpGridStyle gimp_image_grid_get_style (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_grid_get_style)
G_GNUC_INTERNAL GimpGridStyle _gimp_image_grid_get_style (gint32 image_ID);
gboolean gimp_image_grid_set_style (GimpImage *image,
GimpGridStyle style);
GIMP_DEPRECATED_FOR(gimp_image_grid_set_style)
G_GNUC_INTERNAL gboolean _gimp_image_grid_set_style (gint32 image_ID,
GimpGridStyle style);
G_END_DECLS

View File

@ -78,6 +78,50 @@ gimp_image_add_hguide (GimpImage *image,
return guide_ID;
}
/**
* _gimp_image_add_hguide: (skip)
* @image_ID: The image.
* @yposition: The guide's y-offset from top of image.
*
* Add a horizontal guide to an image.
*
* This procedure adds a horizontal guide to an image. It takes the
* input image and the y-position of the new guide as parameters. It
* returns the guide ID of the new guide.
*
* Returns: The new guide.
**/
gint32
_gimp_image_add_hguide (gint32 image_ID,
gint yposition)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 guide_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, yposition,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-add-hguide",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-add-hguide",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
guide_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return guide_ID;
}
/**
* gimp_image_add_vguide:
* @image: The image.
@ -122,6 +166,50 @@ gimp_image_add_vguide (GimpImage *image,
return guide_ID;
}
/**
* _gimp_image_add_vguide: (skip)
* @image_ID: The image.
* @xposition: The guide's x-offset from left of image.
*
* Add a vertical guide to an image.
*
* This procedure adds a vertical guide to an image. It takes the input
* image and the x-position of the new guide as parameters. It returns
* the guide ID of the new guide.
*
* Returns: The new guide.
**/
gint32
_gimp_image_add_vguide (gint32 image_ID,
gint xposition)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 guide_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, xposition,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-add-vguide",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-add-vguide",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
guide_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return guide_ID;
}
/**
* gimp_image_delete_guide:
* @image: The image.
@ -164,6 +252,48 @@ gimp_image_delete_guide (GimpImage *image,
return success;
}
/**
* _gimp_image_delete_guide: (skip)
* @image_ID: The image.
* @guide_ID: The ID of the guide to be removed.
*
* Deletes a guide from an image.
*
* This procedure takes an image and a guide ID as input and removes
* the specified guide from the specified image.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_delete_guide (gint32 image_ID,
gint32 guide_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_UINT, guide_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-delete-guide",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-delete-guide",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_find_next_guide:
* @image: The image.
@ -210,6 +340,52 @@ gimp_image_find_next_guide (GimpImage *image,
return next_guide_ID;
}
/**
* _gimp_image_find_next_guide: (skip)
* @image_ID: The image.
* @guide_ID: The ID of the current guide (0 if first invocation).
*
* Find next guide on an image.
*
* This procedure takes an image and a guide ID as input and finds the
* guide ID of the successor of the given guide ID in the image's guide
* list. If the supplied guide ID is 0, the procedure will return the
* first Guide. The procedure will return 0 if given the final guide ID
* as an argument or the image has no guides.
*
* Returns: The next guide's ID.
**/
gint32
_gimp_image_find_next_guide (gint32 image_ID,
gint32 guide_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 next_guide_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_UINT, guide_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-find-next-guide",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-find-next-guide",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
next_guide_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return next_guide_ID;
}
/**
* gimp_image_get_guide_orientation:
* @image: The image.
@ -253,6 +429,49 @@ gimp_image_get_guide_orientation (GimpImage *image,
return orientation;
}
/**
* _gimp_image_get_guide_orientation: (skip)
* @image_ID: The image.
* @guide_ID: The guide.
*
* Get orientation of a guide on an image.
*
* This procedure takes an image and a guide ID as input and returns
* the orientations of the guide.
*
* Returns: The guide's orientation.
**/
GimpOrientationType
_gimp_image_get_guide_orientation (gint32 image_ID,
gint32 guide_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpOrientationType orientation = GIMP_ORIENTATION_UNKNOWN;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_UINT, guide_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-get-guide-orientation",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-get-guide-orientation",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
orientation = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return orientation;
}
/**
* gimp_image_get_guide_position:
* @image: The image.
@ -295,3 +514,46 @@ gimp_image_get_guide_position (GimpImage *image,
return position;
}
/**
* _gimp_image_get_guide_position: (skip)
* @image_ID: The image.
* @guide_ID: The guide.
*
* Get position of a guide on an image.
*
* This procedure takes an image and a guide ID as input and returns
* the position of the guide relative to the top or left of the image.
*
* Returns: The guide's position relative to top or left of image.
**/
gint
_gimp_image_get_guide_position (gint32 image_ID,
gint32 guide_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint position = G_MININT /* GIMP_GUIDE_POSITION_UNDEFINED */;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_UINT, guide_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-get-guide-position",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-get-guide-position",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
position = g_value_get_int (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return position;
}

View File

@ -34,16 +34,34 @@ G_BEGIN_DECLS
gint32 gimp_image_add_hguide (GimpImage *image,
gint yposition);
GIMP_DEPRECATED_FOR(gimp_image_add_hguide)
G_GNUC_INTERNAL gint32 _gimp_image_add_hguide (gint32 image_ID,
gint yposition);
gint32 gimp_image_add_vguide (GimpImage *image,
gint xposition);
GIMP_DEPRECATED_FOR(gimp_image_add_vguide)
G_GNUC_INTERNAL gint32 _gimp_image_add_vguide (gint32 image_ID,
gint xposition);
gboolean gimp_image_delete_guide (GimpImage *image,
gint32 guide_ID);
GIMP_DEPRECATED_FOR(gimp_image_delete_guide)
G_GNUC_INTERNAL gboolean _gimp_image_delete_guide (gint32 image_ID,
gint32 guide_ID);
gint32 gimp_image_find_next_guide (GimpImage *image,
gint32 guide_ID);
GIMP_DEPRECATED_FOR(gimp_image_find_next_guide)
G_GNUC_INTERNAL gint32 _gimp_image_find_next_guide (gint32 image_ID,
gint32 guide_ID);
GimpOrientationType gimp_image_get_guide_orientation (GimpImage *image,
gint32 guide_ID);
GIMP_DEPRECATED_FOR(gimp_image_get_guide_orientation)
G_GNUC_INTERNAL GimpOrientationType _gimp_image_get_guide_orientation (gint32 image_ID,
gint32 guide_ID);
gint gimp_image_get_guide_position (GimpImage *image,
gint32 guide_ID);
GIMP_DEPRECATED_FOR(gimp_image_get_guide_position)
G_GNUC_INTERNAL gint _gimp_image_get_guide_position (gint32 image_ID,
gint32 guide_ID);
G_END_DECLS

View File

@ -83,6 +83,55 @@ gimp_image_add_sample_point (GimpImage *image,
return sample_point_ID;
}
/**
* _gimp_image_add_sample_point: (skip)
* @image_ID: The image.
* @position_x: The guide'sample points x-offset from left of image.
* @position_y: The guide'sample points y-offset from top of image.
*
* Add a sample point to an image.
*
* This procedure adds a sample point to an image. It takes the input
* image and the position of the new sample points as parameters. It
* returns the sample point ID of the new sample point.
*
* Returns: The new sample point.
*
* Since: 2.10
**/
gint32
_gimp_image_add_sample_point (gint32 image_ID,
gint position_x,
gint position_y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 sample_point_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, position_x,
G_TYPE_INT, position_y,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-add-sample-point",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-add-sample-point",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
sample_point_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return sample_point_ID;
}
/**
* gimp_image_delete_sample_point:
* @image: The image.
@ -127,6 +176,50 @@ gimp_image_delete_sample_point (GimpImage *image,
return success;
}
/**
* _gimp_image_delete_sample_point: (skip)
* @image_ID: The image.
* @sample_point_ID: The ID of the sample point to be removed.
*
* Deletes a sample point from an image.
*
* This procedure takes an image and a sample point ID as input and
* removes the specified sample point from the specified image.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
_gimp_image_delete_sample_point (gint32 image_ID,
gint32 sample_point_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_UINT, sample_point_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-delete-sample-point",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-delete-sample-point",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_find_next_sample_point:
* @image: The image.
@ -176,6 +269,55 @@ gimp_image_find_next_sample_point (GimpImage *image,
return next_sample_point_ID;
}
/**
* _gimp_image_find_next_sample_point: (skip)
* @image_ID: The image.
* @sample_point_ID: The ID of the current sample point (0 if first invocation).
*
* Find next sample point on an image.
*
* This procedure takes an image and a sample point ID as input and
* finds the sample point ID of the successor of the given sample point
* ID in the image's sample point list. If the supplied sample point ID
* is 0, the procedure will return the first sample point. The
* procedure will return 0 if given the final sample point ID as an
* argument or the image has no sample points.
*
* Returns: The next sample point's ID.
*
* Since: 2.10
**/
gint32
_gimp_image_find_next_sample_point (gint32 image_ID,
gint32 sample_point_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 next_sample_point_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_UINT, sample_point_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-find-next-sample-point",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-find-next-sample-point",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
next_sample_point_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return next_sample_point_ID;
}
/**
* gimp_image_get_sample_point_position:
* @image: The image.
@ -226,3 +368,54 @@ gimp_image_get_sample_point_position (GimpImage *image,
return position_x;
}
/**
* _gimp_image_get_sample_point_position: (skip)
* @image_ID: The image.
* @sample_point_ID: The guide.
* @position_y: (out): The sample points's position relative to top of image.
*
* Get position of a sample point on an image.
*
* This procedure takes an image and a sample point ID as input and
* returns the position of the sample point relative to the top and
* left of the image.
*
* Returns: The sample points's position relative to top of image.
*
* Since: 2.10
**/
gint
_gimp_image_get_sample_point_position (gint32 image_ID,
gint32 sample_point_ID,
gint *position_y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint position_x = G_MININT;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_UINT, sample_point_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-get-sample-point-position",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-get-sample-point-position",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
{
position_x = g_value_get_int (gimp_value_array_index (return_vals, 1));
*position_y = g_value_get_int (gimp_value_array_index (return_vals, 2));
}
gimp_value_array_unref (return_vals);
return position_x;
}

View File

@ -35,13 +35,27 @@ G_BEGIN_DECLS
gint32 gimp_image_add_sample_point (GimpImage *image,
gint position_x,
gint position_y);
GIMP_DEPRECATED_FOR(gimp_image_add_sample_point)
G_GNUC_INTERNAL gint32 _gimp_image_add_sample_point (gint32 image_ID,
gint position_x,
gint position_y);
gboolean gimp_image_delete_sample_point (GimpImage *image,
gint32 sample_point_ID);
GIMP_DEPRECATED_FOR(gimp_image_delete_sample_point)
G_GNUC_INTERNAL gboolean _gimp_image_delete_sample_point (gint32 image_ID,
gint32 sample_point_ID);
gint32 gimp_image_find_next_sample_point (GimpImage *image,
gint32 sample_point_ID);
GIMP_DEPRECATED_FOR(gimp_image_find_next_sample_point)
G_GNUC_INTERNAL gint32 _gimp_image_find_next_sample_point (gint32 image_ID,
gint32 sample_point_ID);
gint gimp_image_get_sample_point_position (GimpImage *image,
gint32 sample_point_ID,
gint *position_y);
GIMP_DEPRECATED_FOR(gimp_image_get_sample_point_position)
G_GNUC_INTERNAL gint _gimp_image_get_sample_point_position (gint32 image_ID,
gint32 sample_point_ID,
gint *position_y);
G_END_DECLS

View File

@ -99,6 +99,71 @@ gimp_image_select_color (GimpImage *image,
return success;
}
/**
* _gimp_image_select_color: (skip)
* @image_ID: The affected image.
* @operation: The selection operation.
* @drawable_ID: The affected drawable.
* @color: The color to select.
*
* Create a selection by selecting all pixels (in the specified
* drawable) with the same (or similar) color to that specified.
*
* This tool creates a selection over the specified image. A by-color
* selection is determined by the supplied color under the constraints
* of the current context settings. Essentially, all pixels (in the
* drawable) that have color sufficiently close to the specified color
* (as determined by the threshold and criterion context values) are
* included in the selection. To select transparent regions, the color
* specified must also have minimum alpha.
*
* This procedure is affected by the following context setters:
* gimp_context_set_antialias(), gimp_context_set_feather(),
* gimp_context_set_feather_radius(), gimp_context_set_sample_merged(),
* gimp_context_set_sample_criterion(),
* gimp_context_set_sample_threshold(),
* gimp_context_set_sample_transparent().
*
* In the case of a merged sampling, the supplied drawable is ignored.
*
* Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
_gimp_image_select_color (gint32 image_ID,
GimpChannelOps operation,
gint32 drawable_ID,
const GimpRGB *color)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_CHANNEL_OPS, operation,
GIMP_TYPE_DRAWABLE_ID, drawable_ID,
GIMP_TYPE_RGB, color,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-select-color",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-select-color",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_select_contiguous_color:
* @image: The affected image.
@ -176,6 +241,83 @@ gimp_image_select_contiguous_color (GimpImage *image,
return success;
}
/**
* _gimp_image_select_contiguous_color: (skip)
* @image_ID: The affected image.
* @operation: The selection operation.
* @drawable_ID: The affected drawable.
* @x: x coordinate of initial seed fill point: (image coordinates).
* @y: y coordinate of initial seed fill point: (image coordinates).
*
* Create a selection by selecting all pixels around specified
* coordinates with the same (or similar) color to that at the
* coordinates.
*
* This tool creates a contiguous selection over the specified image. A
* contiguous color selection is determined by a seed fill under the
* constraints of the current context settings. Essentially, the color
* at the specified coordinates (in the drawable) is measured and the
* selection expands outwards from that point to any adjacent pixels
* which are not significantly different (as determined by the
* threshold and criterion context settings). This process continues
* until no more expansion is possible. If antialiasing is turned on,
* the final selection mask will contain intermediate values based on
* close misses to the threshold bar at pixels along the seed fill
* boundary.
*
* This procedure is affected by the following context setters:
* gimp_context_set_antialias(), gimp_context_set_feather(),
* gimp_context_set_feather_radius(), gimp_context_set_sample_merged(),
* gimp_context_set_sample_criterion(),
* gimp_context_set_sample_threshold(),
* gimp_context_set_sample_transparent(),
* gimp_context_set_diagonal_neighbors().
*
* In the case of a merged sampling, the supplied drawable is ignored.
* If the sample is merged, the specified coordinates are relative to
* the image origin; otherwise, they are relative to the drawable's
* origin.
*
* Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
_gimp_image_select_contiguous_color (gint32 image_ID,
GimpChannelOps operation,
gint32 drawable_ID,
gdouble x,
gdouble y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_CHANNEL_OPS, operation,
GIMP_TYPE_DRAWABLE_ID, drawable_ID,
G_TYPE_DOUBLE, x,
G_TYPE_DOUBLE, y,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-select-contiguous-color",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-select-contiguous-color",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_select_rectangle:
* @image: The image.
@ -236,6 +378,66 @@ gimp_image_select_rectangle (GimpImage *image,
return success;
}
/**
* _gimp_image_select_rectangle: (skip)
* @image_ID: The image.
* @operation: The selection operation.
* @x: x coordinate of upper-left corner of rectangle.
* @y: y coordinate of upper-left corner of rectangle.
* @width: The width of the rectangle.
* @height: The height of the rectangle.
*
* Create a rectangular selection over the specified image;
*
* This tool creates a rectangular selection over the specified image.
* The rectangular region can be either added to, subtracted from, or
* replace the contents of the previous selection mask.
*
* This procedure is affected by the following context setters:
* gimp_context_set_feather(), gimp_context_set_feather_radius().
*
* Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
_gimp_image_select_rectangle (gint32 image_ID,
GimpChannelOps operation,
gdouble x,
gdouble y,
gdouble width,
gdouble height)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_CHANNEL_OPS, operation,
G_TYPE_DOUBLE, x,
G_TYPE_DOUBLE, y,
G_TYPE_DOUBLE, width,
G_TYPE_DOUBLE, height,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-select-rectangle",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-select-rectangle",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_select_round_rectangle:
* @image: The image.
@ -305,6 +507,75 @@ gimp_image_select_round_rectangle (GimpImage *image,
return success;
}
/**
* _gimp_image_select_round_rectangle: (skip)
* @image_ID: The image.
* @operation: The selection operation.
* @x: x coordinate of upper-left corner of rectangle.
* @y: y coordinate of upper-left corner of rectangle.
* @width: The width of the rectangle.
* @height: The height of the rectangle.
* @corner_radius_x: The corner radius in X direction.
* @corner_radius_y: The corner radius in Y direction.
*
* Create a rectangular selection with round corners over the specified
* image;
*
* This tool creates a rectangular selection with round corners over
* the specified image. The rectangular region can be either added to,
* subtracted from, or replace the contents of the previous selection
* mask.
*
* This procedure is affected by the following context setters:
* gimp_context_set_antialias(), gimp_context_set_feather(),
* gimp_context_set_feather_radius().
*
* Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
_gimp_image_select_round_rectangle (gint32 image_ID,
GimpChannelOps operation,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
gdouble corner_radius_x,
gdouble corner_radius_y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_CHANNEL_OPS, operation,
G_TYPE_DOUBLE, x,
G_TYPE_DOUBLE, y,
G_TYPE_DOUBLE, width,
G_TYPE_DOUBLE, height,
G_TYPE_DOUBLE, corner_radius_x,
G_TYPE_DOUBLE, corner_radius_y,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-select-round-rectangle",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-select-round-rectangle",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_select_ellipse:
* @image: The image.
@ -366,6 +637,67 @@ gimp_image_select_ellipse (GimpImage *image,
return success;
}
/**
* _gimp_image_select_ellipse: (skip)
* @image_ID: The image.
* @operation: The selection operation.
* @x: x coordinate of upper-left corner of ellipse bounding box.
* @y: y coordinate of upper-left corner of ellipse bounding box.
* @width: The width of the ellipse.
* @height: The height of the ellipse.
*
* Create an elliptical selection over the specified image.
*
* This tool creates an elliptical selection over the specified image.
* The elliptical region can be either added to, subtracted from, or
* replace the contents of the previous selection mask.
*
* This procedure is affected by the following context setters:
* gimp_context_set_antialias(), gimp_context_set_feather(),
* gimp_context_set_feather_radius().
*
* Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
_gimp_image_select_ellipse (gint32 image_ID,
GimpChannelOps operation,
gdouble x,
gdouble y,
gdouble width,
gdouble height)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_CHANNEL_OPS, operation,
G_TYPE_DOUBLE, x,
G_TYPE_DOUBLE, y,
G_TYPE_DOUBLE, width,
G_TYPE_DOUBLE, height,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-select-ellipse",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-select-ellipse",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_select_polygon:
* @image: The image.
@ -427,6 +759,67 @@ gimp_image_select_polygon (GimpImage *image,
return success;
}
/**
* _gimp_image_select_polygon: (skip)
* @image_ID: The image.
* @operation: The selection operation.
* @num_segs: Number of points (count 1 coordinate as two points).
* @segs: (array length=num_segs) (element-type gdouble): Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}.
*
* Create a polygonal selection over the specified image.
*
* This tool creates a polygonal selection over the specified image.
* The polygonal region can be either added to, subtracted from, or
* replace the contents of the previous selection mask. The polygon is
* specified through an array of floating point numbers and its length.
* The length of array must be 2n, where n is the number of points.
* Each point is defined by 2 floating point values which correspond to
* the x and y coordinates. If the final point does not connect to the
* starting point, a connecting segment is automatically added.
*
* This procedure is affected by the following context setters:
* gimp_context_set_antialias(), gimp_context_set_feather(),
* gimp_context_set_feather_radius().
*
* Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
_gimp_image_select_polygon (gint32 image_ID,
GimpChannelOps operation,
gint num_segs,
const gdouble *segs)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_CHANNEL_OPS, operation,
G_TYPE_INT, num_segs,
GIMP_TYPE_FLOAT_ARRAY, NULL,
G_TYPE_NONE);
gimp_value_set_float_array (gimp_value_array_index (args, 3), segs, num_segs);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-select-polygon",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-select-polygon",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_select_item:
* @image: The image.
@ -479,3 +872,56 @@ gimp_image_select_item (GimpImage *image,
return success;
}
/**
* _gimp_image_select_item: (skip)
* @image_ID: The image.
* @operation: The desired operation with current selection.
* @item_ID: The item to render to the selection.
*
* Transforms the specified item into a selection
*
* This procedure renders the item's outline into the current selection
* of the image the item belongs to. What exactly the item's outline is
* depends on the item type: for layers, it's the layer's alpha
* channel, for vectors the vector's shape.
*
* This procedure is affected by the following context setters:
* gimp_context_set_antialias(), gimp_context_set_feather(),
* gimp_context_set_feather_radius().
*
* Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
_gimp_image_select_item (gint32 image_ID,
GimpChannelOps operation,
gint32 item_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_CHANNEL_OPS, operation,
GIMP_TYPE_ITEM_ID, item_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-select-item",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-select-item",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}

View File

@ -36,17 +36,35 @@ gboolean gimp_image_select_color (GimpImage *image,
GimpChannelOps operation,
gint32 drawable_ID,
const GimpRGB *color);
GIMP_DEPRECATED_FOR(gimp_image_select_color)
G_GNUC_INTERNAL gboolean _gimp_image_select_color (gint32 image_ID,
GimpChannelOps operation,
gint32 drawable_ID,
const GimpRGB *color);
gboolean gimp_image_select_contiguous_color (GimpImage *image,
GimpChannelOps operation,
gint32 drawable_ID,
gdouble x,
gdouble y);
GIMP_DEPRECATED_FOR(gimp_image_select_contiguous_color)
G_GNUC_INTERNAL gboolean _gimp_image_select_contiguous_color (gint32 image_ID,
GimpChannelOps operation,
gint32 drawable_ID,
gdouble x,
gdouble y);
gboolean gimp_image_select_rectangle (GimpImage *image,
GimpChannelOps operation,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
GIMP_DEPRECATED_FOR(gimp_image_select_rectangle)
G_GNUC_INTERNAL gboolean _gimp_image_select_rectangle (gint32 image_ID,
GimpChannelOps operation,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
gboolean gimp_image_select_round_rectangle (GimpImage *image,
GimpChannelOps operation,
gdouble x,
@ -55,19 +73,44 @@ gboolean gimp_image_select_round_rectangle (GimpImage *image,
gdouble height,
gdouble corner_radius_x,
gdouble corner_radius_y);
GIMP_DEPRECATED_FOR(gimp_image_select_round_rectangle)
G_GNUC_INTERNAL gboolean _gimp_image_select_round_rectangle (gint32 image_ID,
GimpChannelOps operation,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
gdouble corner_radius_x,
gdouble corner_radius_y);
gboolean gimp_image_select_ellipse (GimpImage *image,
GimpChannelOps operation,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
GIMP_DEPRECATED_FOR(gimp_image_select_ellipse)
G_GNUC_INTERNAL gboolean _gimp_image_select_ellipse (gint32 image_ID,
GimpChannelOps operation,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
gboolean gimp_image_select_polygon (GimpImage *image,
GimpChannelOps operation,
gint num_segs,
const gdouble *segs);
GIMP_DEPRECATED_FOR(gimp_image_select_polygon)
G_GNUC_INTERNAL gboolean _gimp_image_select_polygon (gint32 image_ID,
GimpChannelOps operation,
gint num_segs,
const gdouble *segs);
gboolean gimp_image_select_item (GimpImage *image,
GimpChannelOps operation,
gint32 item_ID);
GIMP_DEPRECATED_FOR(gimp_image_select_item)
G_GNUC_INTERNAL gboolean _gimp_image_select_item (gint32 image_ID,
GimpChannelOps operation,
gint32 item_ID);
G_END_DECLS

View File

@ -90,6 +90,62 @@ gimp_image_resize (GimpImage *image,
return success;
}
/**
* _gimp_image_resize: (skip)
* @image_ID: The image.
* @new_width: New image width.
* @new_height: New image height.
* @offx: x offset between upper left corner of old and new images: (new - old).
* @offy: y offset between upper left corner of old and new images: (new - old).
*
* Resize the image to the specified extents.
*
* This procedure resizes the image so that it's new width and height
* are equal to the supplied parameters. Offsets are also provided
* which describe the position of the previous image's content. All
* channels within the image are resized according to the specified
* parameters; this includes the image selection mask. All layers
* within the image are repositioned according to the specified
* offsets.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_resize (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, new_width,
G_TYPE_INT, new_height,
G_TYPE_INT, offx,
G_TYPE_INT, offy,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-resize",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-resize",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_resize_to_layers:
* @image: The image.
@ -133,6 +189,49 @@ gimp_image_resize_to_layers (GimpImage *image)
return success;
}
/**
* _gimp_image_resize_to_layers: (skip)
* @image_ID: The image.
*
* Resize the image to fit all layers.
*
* This procedure resizes the image to the bounding box of all layers
* of the image. All channels within the image are resized to the new
* size; this includes the image selection mask. All layers within the
* image are repositioned to the new image area.
*
* Returns: TRUE on success.
*
* Since: 2.2
**/
gboolean
_gimp_image_resize_to_layers (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-resize-to-layers",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-resize-to-layers",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_scale:
* @image: The image.
@ -181,6 +280,54 @@ gimp_image_scale (GimpImage *image,
return success;
}
/**
* _gimp_image_scale: (skip)
* @image_ID: The image.
* @new_width: New image width.
* @new_height: New image height.
*
* Scale the image using the default interpolation method.
*
* This procedure scales the image so that its new width and height are
* equal to the supplied parameters. All layers and channels within the
* image are scaled according to the specified parameters; this
* includes the image selection mask. The interpolation method used can
* be set with gimp_context_set_interpolation().
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_scale (gint32 image_ID,
gint new_width,
gint new_height)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, new_width,
G_TYPE_INT, new_height,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-scale",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-scale",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_crop:
* @image: The image.
@ -236,6 +383,61 @@ gimp_image_crop (GimpImage *image,
return success;
}
/**
* _gimp_image_crop: (skip)
* @image_ID: The image.
* @new_width: New image width: (0 < new_width <= width).
* @new_height: New image height: (0 < new_height <= height).
* @offx: X offset: (0 <= offx <= (width - new_width)).
* @offy: Y offset: (0 <= offy <= (height - new_height)).
*
* Crop the image to the specified extents.
*
* This procedure crops the image so that it's new width and height are
* equal to the supplied parameters. Offsets are also provided which
* describe the position of the previous image's content. All channels
* and layers within the image are cropped to the new image extents;
* this includes the image selection mask. If any parameters are out of
* range, an error is returned.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_crop (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, new_width,
G_TYPE_INT, new_height,
G_TYPE_INT, offx,
G_TYPE_INT, offy,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-crop",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-crop",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_flip:
* @image: The image.
@ -277,6 +479,47 @@ gimp_image_flip (GimpImage *image,
return success;
}
/**
* _gimp_image_flip: (skip)
* @image_ID: The image.
* @flip_type: Type of flip.
*
* Flips the image horizontally or vertically.
*
* This procedure flips (mirrors) the image.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_flip (gint32 image_ID,
GimpOrientationType flip_type)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_ORIENTATION_TYPE, flip_type,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-flip",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-flip",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_rotate:
* @image: The image.
@ -317,3 +560,44 @@ gimp_image_rotate (GimpImage *image,
return success;
}
/**
* _gimp_image_rotate: (skip)
* @image_ID: The image.
* @rotate_type: Angle of rotation.
*
* Rotates the image by the specified degrees.
*
* This procedure rotates the image.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_rotate (gint32 image_ID,
GimpRotationType rotate_type)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_ROTATION_TYPE, rotate_type,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-rotate",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-rotate",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}

View File

@ -37,19 +37,43 @@ gboolean gimp_image_resize (GimpImage *image,
gint new_height,
gint offx,
gint offy);
GIMP_DEPRECATED_FOR(gimp_image_resize)
G_GNUC_INTERNAL gboolean _gimp_image_resize (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy);
gboolean gimp_image_resize_to_layers (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_resize_to_layers)
G_GNUC_INTERNAL gboolean _gimp_image_resize_to_layers (gint32 image_ID);
gboolean gimp_image_scale (GimpImage *image,
gint new_width,
gint new_height);
GIMP_DEPRECATED_FOR(gimp_image_scale)
G_GNUC_INTERNAL gboolean _gimp_image_scale (gint32 image_ID,
gint new_width,
gint new_height);
gboolean gimp_image_crop (GimpImage *image,
gint new_width,
gint new_height,
gint offx,
gint offy);
GIMP_DEPRECATED_FOR(gimp_image_crop)
G_GNUC_INTERNAL gboolean _gimp_image_crop (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy);
gboolean gimp_image_flip (GimpImage *image,
GimpOrientationType flip_type);
GIMP_DEPRECATED_FOR(gimp_image_flip)
G_GNUC_INTERNAL gboolean _gimp_image_flip (gint32 image_ID,
GimpOrientationType flip_type);
gboolean gimp_image_rotate (GimpImage *image,
GimpRotationType rotate_type);
GIMP_DEPRECATED_FOR(gimp_image_rotate)
G_GNUC_INTERNAL gboolean _gimp_image_rotate (gint32 image_ID,
GimpRotationType rotate_type);
G_END_DECLS

View File

@ -75,6 +75,47 @@ gimp_image_undo_group_start (GimpImage *image)
return success;
}
/**
* _gimp_image_undo_group_start: (skip)
* @image_ID: The ID of the image in which to open an undo group.
*
* Starts a group undo.
*
* This function is used to start a group undo--necessary for logically
* combining two or more undo operations into a single operation. This
* call must be used in conjunction with a gimp_image_undo_group_end()
* call.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_undo_group_start (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-undo-group-start",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-undo-group-start",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_undo_group_end:
* @image: The ID of the image in which to close an undo group.
@ -114,6 +155,45 @@ gimp_image_undo_group_end (GimpImage *image)
return success;
}
/**
* _gimp_image_undo_group_end: (skip)
* @image_ID: The ID of the image in which to close an undo group.
*
* Finish a group undo.
*
* This function must be called once for each
* gimp_image_undo_group_start() call that is made.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_image_undo_group_end (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-undo-group-end",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-undo-group-end",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_image_undo_is_enabled:
* @image: The image.
@ -156,6 +236,48 @@ gimp_image_undo_is_enabled (GimpImage *image)
return enabled;
}
/**
* _gimp_image_undo_is_enabled: (skip)
* @image_ID: The image.
*
* Check if the image's undo stack is enabled.
*
* This procedure checks if the image's undo stack is currently enabled
* or disabled. This is useful when several plug-ins or scripts call
* each other and want to check if their caller has already used
* gimp_image_undo_disable() or gimp_image_undo_freeze().
*
* Returns: TRUE if undo is enabled for this image.
**/
gboolean
_gimp_image_undo_is_enabled (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean enabled = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-undo-is-enabled",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-undo-is-enabled",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
enabled = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return enabled;
}
/**
* gimp_image_undo_disable:
* @image: The image.
@ -199,6 +321,49 @@ gimp_image_undo_disable (GimpImage *image)
return disabled;
}
/**
* _gimp_image_undo_disable: (skip)
* @image_ID: The image.
*
* 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_undo_enable() to temporarily disable an
* image undo stack. This is advantageous because saving undo steps can
* be time and memory intensive.
*
* Returns: TRUE if the image undo has been disabled.
**/
gboolean
_gimp_image_undo_disable (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean disabled = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-undo-disable",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-undo-disable",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
disabled = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return disabled;
}
/**
* gimp_image_undo_enable:
* @image: The image.
@ -241,6 +406,48 @@ gimp_image_undo_enable (GimpImage *image)
return enabled;
}
/**
* _gimp_image_undo_enable: (skip)
* @image_ID: The image.
*
* 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_undo_disable() to temporarily disable an
* image undo stack.
*
* Returns: TRUE if the image undo has been enabled.
**/
gboolean
_gimp_image_undo_enable (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean enabled = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-undo-enable",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-undo-enable",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
enabled = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return enabled;
}
/**
* gimp_image_undo_freeze:
* @image: The image.
@ -290,6 +497,55 @@ gimp_image_undo_freeze (GimpImage *image)
return frozen;
}
/**
* _gimp_image_undo_freeze: (skip)
* @image_ID: The image.
*
* 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_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() /
* gimp_image_undo_thaw() and gimp_image_undo_disable() /
* gimp_image_undo_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.
*
* Returns: TRUE if the image undo has been frozen.
**/
gboolean
_gimp_image_undo_freeze (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean frozen = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-undo-freeze",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-undo-freeze",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
frozen = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return frozen;
}
/**
* gimp_image_undo_thaw:
* @image: The image.
@ -337,3 +593,51 @@ gimp_image_undo_thaw (GimpImage *image)
return thawed;
}
/**
* _gimp_image_undo_thaw: (skip)
* @image_ID: The image.
*
* 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_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 plug-in previews. Balancing
* freezes and thaws and ensuring image consistency is the
* responsibility of the caller.
*
* Returns: TRUE if the image undo has been thawed.
**/
gboolean
_gimp_image_undo_thaw (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean thawed = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-image-undo-thaw",
args);
else
return_vals = gimp_run_procedure_array ("gimp-image-undo-thaw",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
thawed = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return thawed;
}

View File

@ -33,12 +33,26 @@ G_BEGIN_DECLS
gboolean gimp_image_undo_group_start (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_undo_group_start)
G_GNUC_INTERNAL gboolean _gimp_image_undo_group_start (gint32 image_ID);
gboolean gimp_image_undo_group_end (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_undo_group_end)
G_GNUC_INTERNAL gboolean _gimp_image_undo_group_end (gint32 image_ID);
gboolean gimp_image_undo_is_enabled (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_undo_is_enabled)
G_GNUC_INTERNAL gboolean _gimp_image_undo_is_enabled (gint32 image_ID);
gboolean gimp_image_undo_disable (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_undo_disable)
G_GNUC_INTERNAL gboolean _gimp_image_undo_disable (gint32 image_ID);
gboolean gimp_image_undo_enable (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_undo_enable)
G_GNUC_INTERNAL gboolean _gimp_image_undo_enable (gint32 image_ID);
gboolean gimp_image_undo_freeze (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_undo_freeze)
G_GNUC_INTERNAL gboolean _gimp_image_undo_freeze (gint32 image_ID);
gboolean gimp_image_undo_thaw (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_image_undo_thaw)
G_GNUC_INTERNAL gboolean _gimp_image_undo_thaw (gint32 image_ID);
G_END_DECLS

View File

@ -110,13 +110,54 @@ gimp_item_get_image (gint32 item_ID)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image = gimp_image_new_by_id (g_value_get_int (gimp_value_array_index (return_vals, 1)));
image = gimp_image_new_by_id (gimp_value_get_image_id (gimp_value_array_index (return_vals, 1)));
gimp_value_array_unref (return_vals);
return image;
}
/**
* _gimp_item_get_image: (skip)
* @item_ID: The item.
*
* Returns the item's image.
*
* This procedure returns the item's image.
*
* Returns: The item's image.
*
* Since: 2.8
**/
gint32
_gimp_item_get_image (gint32 item_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 image_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM_ID, item_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-item-get-image",
args);
else
return_vals = gimp_run_procedure_array ("gimp-item-get-image",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return image_ID;
}
/**
* gimp_item_delete:
* @item_ID: The item to delete.

View File

@ -34,6 +34,8 @@ G_BEGIN_DECLS
gboolean gimp_item_is_valid (gint32 item_ID);
GimpImage* gimp_item_get_image (gint32 item_ID);
GIMP_DEPRECATED_FOR(gimp_item_get_image)
G_GNUC_INTERNAL gint32 _gimp_item_get_image (gint32 item_ID);
gboolean gimp_item_delete (gint32 item_ID);
gboolean gimp_item_is_drawable (gint32 item_ID);
gboolean gimp_item_is_layer (gint32 item_ID);

View File

@ -96,6 +96,68 @@ _gimp_layer_new (GimpImage *image,
return layer_ID;
}
/**
* __gimp_layer_new: (skip)
* @image_ID: The image to which to add the layer.
* @width: The layer width.
* @height: The layer height.
* @type: The layer type.
* @name: The layer name.
* @opacity: The layer opacity.
* @mode: The layer combination mode.
*
* Create a new layer.
*
* This procedure creates a new layer with the specified width, height,
* and type. Name, opacity, and mode are also supplied parameters. The
* new layer still needs to be added to the image, as this is not
* automatic. Add the new layer with the gimp_image_insert_layer()
* command. Other attributes such as layer mask modes, and offsets
* should be set with explicit procedure calls.
*
* Returns: The newly created layer.
**/
gint32
__gimp_layer_new (gint32 image_ID,
gint width,
gint height,
GimpImageType type,
const gchar *name,
gdouble opacity,
GimpLayerMode mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, width,
G_TYPE_INT, height,
GIMP_TYPE_IMAGE_TYPE, type,
G_TYPE_STRING, name,
G_TYPE_DOUBLE, opacity,
GIMP_TYPE_LAYER_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_ID;
}
/**
* gimp_layer_new_from_visible:
* @image: The source image from where the content is copied.
@ -147,6 +209,57 @@ gimp_layer_new_from_visible (GimpImage *image,
return layer_ID;
}
/**
* _gimp_layer_new_from_visible: (skip)
* @image_ID: The source image from where the content is copied.
* @dest_image_ID: The destination image to which to add the layer.
* @name: The layer name.
*
* Create a new layer from what is visible in an image.
*
* This procedure creates a new layer from what is visible in the given
* image. The new layer still needs to be added to the destination
* image, as this is not automatic. Add the new layer with the
* gimp_image_insert_layer() command. Other attributes such as layer
* mask modes, and offsets should be set with explicit procedure calls.
*
* Returns: The newly created layer.
*
* Since: 2.6
**/
gint32
_gimp_layer_new_from_visible (gint32 image_ID,
gint32 dest_image_ID,
const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, dest_image_ID,
G_TYPE_STRING, name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-new-from-visible",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-new-from-visible",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_ID;
}
/**
* gimp_layer_new_from_drawable:
* @drawable_ID: The source drawable from where the new layer is copied.
@ -193,6 +306,52 @@ gimp_layer_new_from_drawable (gint32 drawable_ID,
return layer_copy_ID;
}
/**
* _gimp_layer_new_from_drawable: (skip)
* @drawable_ID: The source drawable from where the new layer is copied.
* @dest_image_ID: The destination image to which to add the layer.
*
* Create a new layer by copying an existing drawable.
*
* This procedure creates a new layer as a copy of the specified
* drawable. The new layer still needs to be added to the image, as
* this is not automatic. Add the new layer with the
* gimp_image_insert_layer() command. Other attributes such as layer
* mask modes, and offsets should be set with explicit procedure calls.
*
* Returns: The newly copied layer.
**/
gint32
_gimp_layer_new_from_drawable (gint32 drawable_ID,
gint32 dest_image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_copy_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE_ID, drawable_ID,
GIMP_TYPE_IMAGE_ID, dest_image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-new-from-drawable",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-new-from-drawable",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_copy_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_copy_ID;
}
/**
* gimp_layer_group_new:
* @image: The image to which to add the layer group.
@ -240,6 +399,53 @@ gimp_layer_group_new (GimpImage *image)
return layer_group_ID;
}
/**
* _gimp_layer_group_new: (skip)
* @image_ID: The image to which to add the layer group.
*
* Create a new layer group.
*
* This procedure creates a new layer group. Attributes such as layer
* mode and opacity should be set with explicit procedure calls. Add
* the new layer group (which is a kind of layer) with the
* gimp_image_insert_layer() command.
* Other procedures useful with layer groups:
* gimp_image_reorder_item(), gimp_item_get_parent(),
* gimp_item_get_children(), gimp_item_is_group().
*
* Returns: The newly created layer group.
*
* Since: 2.8
**/
gint32
_gimp_layer_group_new (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_group_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-group-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-group-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_group_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_group_ID;
}
/**
* _gimp_layer_copy:
* @layer_ID: The layer to copy.

View File

@ -39,12 +39,29 @@ G_GNUC_INTERNAL gint32 _gimp_layer_new (GimpImage *
const gchar *name,
gdouble opacity,
GimpLayerMode mode);
GIMP_DEPRECATED_FOR(_gimp_layer_new)
G_GNUC_INTERNAL gint32 __gimp_layer_new (gint32 image_ID,
gint width,
gint height,
GimpImageType type,
const gchar *name,
gdouble opacity,
GimpLayerMode mode);
gint32 gimp_layer_new_from_visible (GimpImage *image,
GimpImage *dest_image,
const gchar *name);
GIMP_DEPRECATED_FOR(gimp_layer_new_from_visible)
G_GNUC_INTERNAL gint32 _gimp_layer_new_from_visible (gint32 image_ID,
gint32 dest_image_ID,
const gchar *name);
gint32 gimp_layer_new_from_drawable (gint32 drawable_ID,
GimpImage *dest_image);
GIMP_DEPRECATED_FOR(gimp_layer_new_from_drawable)
G_GNUC_INTERNAL gint32 _gimp_layer_new_from_drawable (gint32 drawable_ID,
gint32 dest_image_ID);
gint32 gimp_layer_group_new (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_layer_group_new)
G_GNUC_INTERNAL gint32 _gimp_layer_group_new (gint32 image_ID);
G_GNUC_INTERNAL gint32 _gimp_layer_copy (gint32 layer_ID,
gboolean add_alpha);
gboolean gimp_layer_add_alpha (gint32 layer_ID);

View File

@ -104,6 +104,76 @@ gimp_selection_bounds (GimpImage *image,
return success;
}
/**
* _gimp_selection_bounds: (skip)
* @image_ID: The image.
* @non_empty: (out): TRUE if there is a selection.
* @x1: (out): x coordinate of upper left corner of selection bounds.
* @y1: (out): y coordinate of upper left corner of selection bounds.
* @x2: (out): x coordinate of lower right corner of selection bounds.
* @y2: (out): y coordinate of lower right corner of selection bounds.
*
* Find the bounding box of the current selection.
*
* This procedure returns whether there is a selection for the
* specified image. If there is one, the upper left and lower right
* corners of the bounding box are returned. These coordinates are
* relative to the image. Please note that the pixel specified by the
* lower right coordinate of the bounding box is not part of the
* selection. The selection ends at the upper left corner of this
* pixel. This means the width of the selection can be calculated as
* (x2 - x1), its height as (y2 - y1).
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_bounds (gint32 image_ID,
gboolean *non_empty,
gint *x1,
gint *y1,
gint *x2,
gint *y2)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-bounds",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-bounds",
args);
gimp_value_array_unref (args);
*non_empty = FALSE;
*x1 = 0;
*y1 = 0;
*x2 = 0;
*y2 = 0;
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
if (success)
{
*non_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
*x1 = g_value_get_int (gimp_value_array_index (return_vals, 2));
*y1 = g_value_get_int (gimp_value_array_index (return_vals, 3));
*x2 = g_value_get_int (gimp_value_array_index (return_vals, 4));
*y2 = g_value_get_int (gimp_value_array_index (return_vals, 5));
}
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_value:
* @image: The image.
@ -150,6 +220,52 @@ gimp_selection_value (GimpImage *image,
return value;
}
/**
* _gimp_selection_value: (skip)
* @image_ID: The image.
* @x: x coordinate of value.
* @y: y coordinate of value.
*
* Find the value of the selection at the specified coordinates.
*
* This procedure returns the value of the selection at the specified
* coordinates. If the coordinates lie out of bounds, 0 is returned.
*
* Returns: Value of the selection.
**/
gint
_gimp_selection_value (gint32 image_ID,
gint x,
gint y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint value = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, x,
G_TYPE_INT, y,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-value",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-value",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
value = g_value_get_int (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return value;
}
/**
* gimp_selection_is_empty:
* @image: The image.
@ -190,6 +306,46 @@ gimp_selection_is_empty (GimpImage *image)
return is_empty;
}
/**
* _gimp_selection_is_empty: (skip)
* @image_ID: The image.
*
* Determine whether the selection is empty.
*
* This procedure returns TRUE if the selection for the specified image
* is empty.
*
* Returns: Is the selection empty?
**/
gboolean
_gimp_selection_is_empty (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean is_empty = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-is-empty",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-is-empty",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
is_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return is_empty;
}
/**
* gimp_selection_translate:
* @image: The image.
@ -238,6 +394,54 @@ gimp_selection_translate (GimpImage *image,
return success;
}
/**
* _gimp_selection_translate: (skip)
* @image_ID: The image.
* @offx: x offset for translation.
* @offy: y offset for translation.
*
* Translate the selection by the specified offsets.
*
* This procedure actually translates the selection for the specified
* image by the specified offsets. Regions that are translated from
* beyond the bounds of the image are set to empty. Valid regions of
* the selection which are translated beyond the bounds of the image
* because of this call are lost.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_translate (gint32 image_ID,
gint offx,
gint offy)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, offx,
G_TYPE_INT, offy,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-translate",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-translate",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_selection_float:
* @drawable_ID: The drawable from which to float selection.
@ -327,6 +531,45 @@ gimp_selection_invert (GimpImage *image)
return success;
}
/**
* _gimp_selection_invert: (skip)
* @image_ID: The image.
*
* Invert the selection mask.
*
* This procedure inverts the selection mask. For every pixel in the
* selection channel, its new value is calculated as (255 - old-value).
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_invert (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-invert",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-invert",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_sharpen:
* @image: The image.
@ -368,6 +611,47 @@ gimp_selection_sharpen (GimpImage *image)
return success;
}
/**
* _gimp_selection_sharpen: (skip)
* @image_ID: The image.
*
* Sharpen the selection mask.
*
* This procedure sharpens the selection mask. For every pixel in the
* selection channel, if the value is &gt; 127, the new pixel is
* assigned a value of 255. This removes any \"anti-aliasing\" that
* might exist in the selection mask's boundary.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_sharpen (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-sharpen",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-sharpen",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_all:
* @image: The image.
@ -407,6 +691,45 @@ gimp_selection_all (GimpImage *image)
return success;
}
/**
* _gimp_selection_all: (skip)
* @image_ID: The image.
*
* Select all of the image.
*
* This procedure sets the selection mask to completely encompass the
* image. Every pixel in the selection channel is set to 255.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_all (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-all",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-all",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_none:
* @image: The image.
@ -446,6 +769,45 @@ gimp_selection_none (GimpImage *image)
return success;
}
/**
* _gimp_selection_none: (skip)
* @image_ID: The image.
*
* Deselect the entire image.
*
* This procedure deselects the entire image. Every pixel in the
* selection channel is set to 0.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_none (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-none",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-none",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_feather:
* @image: The image.
@ -488,6 +850,48 @@ gimp_selection_feather (GimpImage *image,
return success;
}
/**
* _gimp_selection_feather: (skip)
* @image_ID: The image.
* @radius: Radius of feather (in pixels).
*
* Feather the image's selection
*
* This procedure feathers the selection. Feathering is implemented
* using a gaussian blur.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_feather (gint32 image_ID,
gdouble radius)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_DOUBLE, radius,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-feather",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-feather",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_border:
* @image: The image.
@ -531,6 +935,49 @@ gimp_selection_border (GimpImage *image,
return success;
}
/**
* _gimp_selection_border: (skip)
* @image_ID: The image.
* @radius: Radius of border (in pixels).
*
* Border the image's selection
*
* This procedure borders the selection. Bordering creates a new
* selection which is defined along the boundary of the previous
* selection at every point within the specified radius.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_border (gint32 image_ID,
gint radius)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, radius,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-border",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-border",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_grow:
* @image: The image.
@ -573,6 +1020,48 @@ gimp_selection_grow (GimpImage *image,
return success;
}
/**
* _gimp_selection_grow: (skip)
* @image_ID: The image.
* @steps: Steps of grow (in pixels).
*
* Grow the image's selection
*
* This procedure grows the selection. Growing involves expanding the
* boundary in all directions by the specified pixel amount.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_grow (gint32 image_ID,
gint steps)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, steps,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-grow",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-grow",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_shrink:
* @image: The image.
@ -616,6 +1105,49 @@ gimp_selection_shrink (GimpImage *image,
return success;
}
/**
* _gimp_selection_shrink: (skip)
* @image_ID: The image.
* @steps: Steps of shrink (in pixels).
*
* Shrink the image's selection
*
* This procedure shrinks the selection. Shrinking involves trimming
* the existing selection boundary on all sides by the specified number
* of pixels.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_selection_shrink (gint32 image_ID,
gint steps)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, steps,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-shrink",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-shrink",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_flood:
* @image: The image.
@ -659,6 +1191,49 @@ gimp_selection_flood (GimpImage *image)
return success;
}
/**
* _gimp_selection_flood: (skip)
* @image_ID: The image.
*
* Remove holes from the image's selection
*
* This procedure removes holes from the selection, that can come from
* selecting a patchy area with the Fuzzy Select Tool. In technical
* terms this procedure floods the selection. See the Algorithms page
* in the developer wiki for details.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
_gimp_selection_flood (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-flood",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-flood",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_selection_save:
* @image: The image.
@ -699,3 +1274,44 @@ gimp_selection_save (GimpImage *image)
return channel_ID;
}
/**
* _gimp_selection_save: (skip)
* @image_ID: The image.
*
* Copy the selection mask to a new channel.
*
* This procedure copies the selection mask and stores the content in a
* new channel. The new channel is automatically inserted into the
* image's list of channels.
*
* Returns: The new channel.
**/
gint32
_gimp_selection_save (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 channel_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-selection-save",
args);
else
return_vals = gimp_run_procedure_array ("gimp-selection-save",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
channel_ID = gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return channel_ID;
}

View File

@ -38,30 +38,71 @@ gboolean gimp_selection_bounds (GimpImage *image,
gint *y1,
gint *x2,
gint *y2);
GIMP_DEPRECATED_FOR(gimp_selection_bounds)
G_GNUC_INTERNAL gboolean _gimp_selection_bounds (gint32 image_ID,
gboolean *non_empty,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gint gimp_selection_value (GimpImage *image,
gint x,
gint y);
GIMP_DEPRECATED_FOR(gimp_selection_value)
G_GNUC_INTERNAL gint _gimp_selection_value (gint32 image_ID,
gint x,
gint y);
gboolean gimp_selection_is_empty (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_selection_is_empty)
G_GNUC_INTERNAL gboolean _gimp_selection_is_empty (gint32 image_ID);
gboolean gimp_selection_translate (GimpImage *image,
gint offx,
gint offy);
GIMP_DEPRECATED_FOR(gimp_selection_translate)
G_GNUC_INTERNAL gboolean _gimp_selection_translate (gint32 image_ID,
gint offx,
gint offy);
G_GNUC_INTERNAL gint32 _gimp_selection_float (gint32 drawable_ID,
gint offx,
gint offy);
gboolean gimp_selection_invert (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_selection_invert)
G_GNUC_INTERNAL gboolean _gimp_selection_invert (gint32 image_ID);
gboolean gimp_selection_sharpen (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_selection_sharpen)
G_GNUC_INTERNAL gboolean _gimp_selection_sharpen (gint32 image_ID);
gboolean gimp_selection_all (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_selection_all)
G_GNUC_INTERNAL gboolean _gimp_selection_all (gint32 image_ID);
gboolean gimp_selection_none (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_selection_none)
G_GNUC_INTERNAL gboolean _gimp_selection_none (gint32 image_ID);
gboolean gimp_selection_feather (GimpImage *image,
gdouble radius);
GIMP_DEPRECATED_FOR(gimp_selection_feather)
G_GNUC_INTERNAL gboolean _gimp_selection_feather (gint32 image_ID,
gdouble radius);
gboolean gimp_selection_border (GimpImage *image,
gint radius);
GIMP_DEPRECATED_FOR(gimp_selection_border)
G_GNUC_INTERNAL gboolean _gimp_selection_border (gint32 image_ID,
gint radius);
gboolean gimp_selection_grow (GimpImage *image,
gint steps);
GIMP_DEPRECATED_FOR(gimp_selection_grow)
G_GNUC_INTERNAL gboolean _gimp_selection_grow (gint32 image_ID,
gint steps);
gboolean gimp_selection_shrink (GimpImage *image,
gint steps);
GIMP_DEPRECATED_FOR(gimp_selection_shrink)
G_GNUC_INTERNAL gboolean _gimp_selection_shrink (gint32 image_ID,
gint steps);
gboolean gimp_selection_flood (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_selection_flood)
G_GNUC_INTERNAL gboolean _gimp_selection_flood (gint32 image_ID);
gint32 gimp_selection_save (GimpImage *image);
GIMP_DEPRECATED_FOR(gimp_selection_save)
G_GNUC_INTERNAL gint32 _gimp_selection_save (gint32 image_ID);
G_END_DECLS

View File

@ -92,6 +92,64 @@ gimp_text_layer_new (GimpImage *image,
return layer_ID;
}
/**
* _gimp_text_layer_new: (skip)
* @image_ID: The image.
* @text: The text to generate (in UTF-8 encoding).
* @fontname: The name of the font.
* @size: The size of text in either pixels or points.
* @unit: The units of specified size.
*
* Creates a new text layer.
*
* This procedure creates a new text layer. The arguments are kept as
* simple as necessary for the normal case. All text attributes,
* however, can be modified with the appropriate
* gimp_text_layer_set_*() procedures. The new layer still needs to be
* added to the image, as this is not automatic. Add the new layer
* using gimp_image_insert_layer().
*
* Returns: The new text layer.
*
* Since: 2.6
**/
gint32
_gimp_text_layer_new (gint32 image_ID,
const gchar *text,
const gchar *fontname,
gdouble size,
GimpUnit unit)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, text,
G_TYPE_STRING, fontname,
G_TYPE_DOUBLE, size,
GIMP_TYPE_UNIT, unit,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-text-layer-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-text-layer-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_ID;
}
/**
* gimp_text_layer_get_text:
* @layer_ID: The text layer.

View File

@ -37,6 +37,12 @@ gint32 gimp_text_layer_new (GimpImage
const gchar *fontname,
gdouble size,
GimpUnit unit);
GIMP_DEPRECATED_FOR(gimp_text_layer_new)
G_GNUC_INTERNAL gint32 _gimp_text_layer_new (gint32 image_ID,
const gchar *text,
const gchar *fontname,
gdouble size,
GimpUnit unit);
gchar* gimp_text_layer_get_text (gint32 layer_ID);
gboolean gimp_text_layer_set_text (gint32 layer_ID,
const gchar *text);

View File

@ -113,6 +113,85 @@ gimp_text_fontname (GimpImage *image,
return text_layer_ID;
}
/**
* _gimp_text_fontname: (skip)
* @image_ID: The image.
* @drawable_ID: The affected drawable: (-1 for a new text layer).
* @x: The x coordinate for the left of the text bounding box.
* @y: The y coordinate for the top of the text bounding box.
* @text: The text to generate (in UTF-8 encoding).
* @border: The size of the border.
* @antialias: Antialiasing.
* @size: The size of text in either pixels or points.
* @size_type: The units of specified size.
* @fontname: The name of the font.
*
* Add text at the specified location as a floating selection or a new
* layer.
*
* This tool requires a fontname matching an installed PangoFT2 font.
* You can specify the fontsize in units of pixels or points, and the
* appropriate metric is specified using the size_type argument. The x
* and y parameters together control the placement of the new text by
* specifying the upper left corner of the text bounding box. If the
* specified drawable parameter is valid, the text will be created as a
* floating selection attached to the drawable. If the drawable
* parameter is not valid (-1), the text will appear as a new layer.
* Finally, a border can be specified around the final rendered text.
* The border is measured in pixels. Parameter size-type is not used
* and is currently ignored. If you need to display a font in points,
* divide the size in points by 72.0 and multiply it by the image's
* vertical resolution.
*
* Returns: The new text layer or -1 if no layer was created.
**/
gint32
_gimp_text_fontname (gint32 image_ID,
gint32 drawable_ID,
gdouble x,
gdouble y,
const gchar *text,
gint border,
gboolean antialias,
gdouble size,
GimpSizeType size_type,
const gchar *fontname)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 text_layer_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_DRAWABLE_ID, drawable_ID,
G_TYPE_DOUBLE, x,
G_TYPE_DOUBLE, y,
G_TYPE_STRING, text,
G_TYPE_INT, border,
G_TYPE_BOOLEAN, antialias,
G_TYPE_DOUBLE, size,
GIMP_TYPE_SIZE_TYPE, size_type,
G_TYPE_STRING, fontname,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-text-fontname",
args);
else
return_vals = gimp_run_procedure_array ("gimp-text-fontname",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
text_layer_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return text_layer_ID;
}
/**
* gimp_text_get_extents_fontname:
* @text: The text to generate (in UTF-8 encoding).

View File

@ -42,6 +42,17 @@ gint32 gimp_text_fontname (GimpImage *image,
gdouble size,
GimpSizeType size_type,
const gchar *fontname);
GIMP_DEPRECATED_FOR(gimp_text_fontname)
G_GNUC_INTERNAL gint32 _gimp_text_fontname (gint32 image_ID,
gint32 drawable_ID,
gdouble x,
gdouble y,
const gchar *text,
gint border,
gboolean antialias,
gdouble size,
GimpSizeType size_type,
const gchar *fontname);
gboolean gimp_text_get_extents_fontname (const gchar *text,
gdouble size,
GimpSizeType size_type,

View File

@ -79,6 +79,51 @@ gimp_vectors_new (GimpImage *image,
return vectors_ID;
}
/**
* _gimp_vectors_new: (skip)
* @image_ID: The image.
* @name: the name of the new vector object.
*
* Creates a new empty vectors object.
*
* Creates a new empty vectors object. The vectors object needs to be
* added to the image using gimp_image_insert_vectors().
*
* Returns: the current vector object, 0 if no vector exists in the image.
*
* Since: 2.4
**/
gint32
_gimp_vectors_new (gint32 image_ID,
const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 vectors_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-vectors-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-vectors-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
vectors_ID = gimp_value_get_vectors_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return vectors_ID;
}
/**
* gimp_vectors_new_from_text_layer:
* @image: The image.
@ -124,6 +169,51 @@ gimp_vectors_new_from_text_layer (GimpImage *image,
return vectors_ID;
}
/**
* _gimp_vectors_new_from_text_layer: (skip)
* @image_ID: The image.
* @layer_ID: The text layer.
*
* Creates a new vectors object from a text layer.
*
* Creates a new vectors object from a text layer. The vectors object
* needs to be added to the image using gimp_image_insert_vectors().
*
* Returns: The vectors of the text layer.
*
* Since: 2.6
**/
gint32
_gimp_vectors_new_from_text_layer (gint32 image_ID,
gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 vectors_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-vectors-new-from-text-layer",
args);
else
return_vals = gimp_run_procedure_array ("gimp-vectors-new-from-text-layer",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
vectors_ID = gimp_value_get_vectors_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return vectors_ID;
}
/**
* gimp_vectors_copy:
* @vectors_ID: The vectors object to copy.
@ -1194,6 +1284,69 @@ gimp_vectors_import_from_file (GimpImage *image,
return success;
}
/**
* _gimp_vectors_import_from_file: (skip)
* @image_ID: The image.
* @filename: The name of the SVG file to import.
* @merge: Merge paths into a single vectors object.
* @scale: Scale the SVG to image dimensions.
* @num_vectors: (out): The number of newly created vectors.
* @vectors_ids: (out) (array length=num_vectors): The list of newly created vectors.
*
* Import paths from an SVG file.
*
* This procedure imports paths from an SVG file. SVG elements other
* than paths and basic shapes are ignored.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_vectors_import_from_file (gint32 image_ID,
const gchar *filename,
gboolean merge,
gboolean scale,
gint *num_vectors,
gint **vectors_ids)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, filename,
G_TYPE_BOOLEAN, merge,
G_TYPE_BOOLEAN, scale,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-vectors-import-from-file",
args);
else
return_vals = gimp_run_procedure_array ("gimp-vectors-import-from-file",
args);
gimp_value_array_unref (args);
*num_vectors = 0;
*vectors_ids = NULL;
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
if (success)
{
*num_vectors = g_value_get_int (gimp_value_array_index (return_vals, 1));
*vectors_ids = gimp_value_dup_int32_array (gimp_value_array_index (return_vals, 2));
}
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_vectors_import_from_string:
* @image: The image.
@ -1261,6 +1414,73 @@ gimp_vectors_import_from_string (GimpImage *image,
return success;
}
/**
* _gimp_vectors_import_from_string: (skip)
* @image_ID: The image.
* @string: A string that must be a complete and valid SVG document.
* @length: Number of bytes in string or -1 if the string is NULL terminated.
* @merge: Merge paths into a single vectors object.
* @scale: Scale the SVG to image dimensions.
* @num_vectors: (out): The number of newly created vectors.
* @vectors_ids: (out) (array length=num_vectors): The list of newly created vectors.
*
* Import paths from an SVG string.
*
* This procedure works like gimp_vectors_import_from_file() but takes
* a string rather than reading the SVG from a file. This allows you to
* write scripts that generate SVG and feed it to GIMP.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_vectors_import_from_string (gint32 image_ID,
const gchar *string,
gint length,
gboolean merge,
gboolean scale,
gint *num_vectors,
gint **vectors_ids)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, string,
G_TYPE_INT, length,
G_TYPE_BOOLEAN, merge,
G_TYPE_BOOLEAN, scale,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-vectors-import-from-string",
args);
else
return_vals = gimp_run_procedure_array ("gimp-vectors-import-from-string",
args);
gimp_value_array_unref (args);
*num_vectors = 0;
*vectors_ids = NULL;
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
if (success)
{
*num_vectors = g_value_get_int (gimp_value_array_index (return_vals, 1));
*vectors_ids = gimp_value_dup_int32_array (gimp_value_array_index (return_vals, 2));
}
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_vectors_export_to_file:
* @image: The image.
@ -1310,6 +1530,55 @@ gimp_vectors_export_to_file (GimpImage *image,
return success;
}
/**
* _gimp_vectors_export_to_file: (skip)
* @image_ID: The image.
* @filename: The name of the SVG file to create.
* @vectors_ID: The vectors object to be saved, or 0 for all in the image.
*
* save a path as an SVG file.
*
* This procedure creates an SVG file to save a Vectors object, that
* is, a path. The resulting file can be edited using a vector graphics
* application, or later reloaded into GIMP. If you pass 0 as the
* 'vectors' argument, then all paths in the image will be exported.
*
* Returns: TRUE on success.
*
* Since: 2.6
**/
gboolean
_gimp_vectors_export_to_file (gint32 image_ID,
const gchar *filename,
gint32 vectors_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_STRING, filename,
GIMP_TYPE_VECTORS_ID, vectors_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-vectors-export-to-file",
args);
else
return_vals = gimp_run_procedure_array ("gimp-vectors-export-to-file",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_vectors_export_to_string:
* @image: The image.
@ -1358,3 +1627,51 @@ gimp_vectors_export_to_string (GimpImage *image,
return string;
}
/**
* _gimp_vectors_export_to_string: (skip)
* @image_ID: The image.
* @vectors_ID: The vectors object to save, or 0 for all in the image.
*
* Save a path as an SVG string.
*
* This procedure works like gimp_vectors_export_to_file() but creates
* a string rather than a file. The contents are a NUL-terminated
* string that holds a complete XML document. If you pass 0 as the
* 'vectors' argument, then all paths in the image will be exported.
*
* Returns: A string whose contents are a complete SVG document.
* The returned value must be freed with g_free().
*
* Since: 2.6
**/
gchar *
_gimp_vectors_export_to_string (gint32 image_ID,
gint32 vectors_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gchar *string = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_VECTORS_ID, vectors_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-vectors-export-to-string",
args);
else
return_vals = gimp_run_procedure_array ("gimp-vectors-export-to-string",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
string = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return string;
}

View File

@ -34,8 +34,14 @@ G_BEGIN_DECLS
gint32 gimp_vectors_new (GimpImage *image,
const gchar *name);
GIMP_DEPRECATED_FOR(gimp_vectors_new)
G_GNUC_INTERNAL gint32 _gimp_vectors_new (gint32 image_ID,
const gchar *name);
gint32 gimp_vectors_new_from_text_layer (GimpImage *image,
gint32 layer_ID);
GIMP_DEPRECATED_FOR(gimp_vectors_new_from_text_layer)
G_GNUC_INTERNAL gint32 _gimp_vectors_new_from_text_layer (gint32 image_ID,
gint32 layer_ID);
gint32 gimp_vectors_copy (gint32 vectors_ID);
gint* gimp_vectors_get_strokes (gint32 vectors_ID,
gint *num_strokes);
@ -125,6 +131,13 @@ gboolean gimp_vectors_import_from_file (GimpImage
gboolean scale,
gint *num_vectors,
gint **vectors_ids);
GIMP_DEPRECATED_FOR(gimp_vectors_import_from_file)
G_GNUC_INTERNAL gboolean _gimp_vectors_import_from_file (gint32 image_ID,
const gchar *filename,
gboolean merge,
gboolean scale,
gint *num_vectors,
gint **vectors_ids);
gboolean gimp_vectors_import_from_string (GimpImage *image,
const gchar *string,
gint length,
@ -132,11 +145,26 @@ gboolean gimp_vectors_import_from_string (GimpImage
gboolean scale,
gint *num_vectors,
gint **vectors_ids);
GIMP_DEPRECATED_FOR(gimp_vectors_import_from_string)
G_GNUC_INTERNAL gboolean _gimp_vectors_import_from_string (gint32 image_ID,
const gchar *string,
gint length,
gboolean merge,
gboolean scale,
gint *num_vectors,
gint **vectors_ids);
gboolean gimp_vectors_export_to_file (GimpImage *image,
const gchar *filename,
gint32 vectors_ID);
GIMP_DEPRECATED_FOR(gimp_vectors_export_to_file)
G_GNUC_INTERNAL gboolean _gimp_vectors_export_to_file (gint32 image_ID,
const gchar *filename,
gint32 vectors_ID);
gchar* gimp_vectors_export_to_string (GimpImage *image,
gint32 vectors_ID);
GIMP_DEPRECATED_FOR(gimp_vectors_export_to_string)
G_GNUC_INTERNAL gchar* _gimp_vectors_export_to_string (gint32 image_ID,
gint32 vectors_ID);
G_END_DECLS

View File

@ -45,17 +45,23 @@ sub desc_wrap {
return $wrapped;
}
sub generate {
my @procs = @{(shift)};
my %out;
sub generate_fun {
my ($proc, $out, $api_deprecated) = @_;
my @inargs = @{$proc->{inargs}} if (defined $proc->{inargs});
my @outargs = @{$proc->{outargs}} if (defined $proc->{outargs});
sub libtype {
my $arg = shift;
my $outarg = shift;
my $api_deprecated = shift;
my ($type, $name) = &arg_parse($arg->{type});
my $argtype = $arg_types{$type};
my $rettype = '';
if ($api_deprecated && $argtype->{name} eq 'IMAGE') {
return 'gint32 ';
}
if (exists $argtype->{id}) {
return 'gint32 ';
}
@ -79,23 +85,21 @@ sub generate {
return $rettype;
}
foreach $name (@procs) {
my $proc = $main::pdb{$name};
my $out = \%{$out{$proc->{group}}};
my @inargs = @{$proc->{inargs}} if (defined $proc->{inargs});
my @outargs = @{$proc->{outargs}} if (defined $proc->{outargs});
my $funcname = "gimp_$name";
my $wrapped = "";
my %usednames;
my $retdesc = " * Returns:";
my $func_annotations = "";
if ($proc->{lib_private}) {
$wrapped = '_';
}
if ($proc->{deprecated}) {
if ($api_deprecated) {
push @{$out->{protos}}, "GIMP_DEPRECATED_FOR($wrapped$funcname)\n";
$func_annotations .= " (skip)";
}
elsif ($proc->{deprecated}) {
if ($proc->{deprecated} eq 'NONE') {
push @{$out->{protos}}, "GIMP_DEPRECATED\n";
}
@ -107,6 +111,12 @@ sub generate {
}
}
# Add an underscore for deprecated API. If the original was already
# private, this will be 2 underscores.
if ($api_deprecated) {
$wrapped .= '_';
}
# Find the return argument (defaults to the first arg if not
# explicitly set
my $retarg = undef;
@ -132,7 +142,7 @@ sub generate {
my ($type) = &arg_parse($retarg->{type});
my $argtype = $arg_types{$type};
my $annotate = "";
$rettype = &libtype($retarg, 1);
$rettype = &libtype($retarg, 1, $api_deprecated);
chop $rettype unless $rettype =~ /\*$/;
$retarg->{retval} = 1;
@ -141,7 +151,12 @@ sub generate {
$annotate = " (array length=$retarg->{array}->{name})";
}
if (exists $argtype->{out_annotate}) {
if ($api_deprecated) {
if (exists $argtype->{out_annotate_d}) {
$annotate .= " $argtype->{out_annotate_d}";
}
}
elsif (exists $argtype->{out_annotate}) {
$annotate .= " $argtype->{out_annotate}";
}
@ -194,8 +209,9 @@ sub generate {
my $desc = exists $_->{desc} ? $_->{desc} : "";
my $var_len;
my $value;
my $is_id = ($arg->{id} || ($api_deprecated && $arg->{name} eq 'IMAGE'));
$var .= '_ID' if $arg->{id};
$var .= '_ID' if $is_id;
# This gets passed to gimp_value_array_new_with_types()
if ($type eq 'enum') {
@ -215,7 +231,7 @@ sub generate {
if (exists $_->{array}) {
$value_array .= "NULL";
}
elsif (exists $arg->{convert_func}) {
elsif (exists $arg->{convert_func} && ! $api_deprecated) {
$value_array .= eval qq/"$arg->{convert_func}"/;
}
else {
@ -242,13 +258,13 @@ sub generate {
$usednames{$_->{name}}++;
$arglist .= &libtype($_, 0);
$arglist .= &libtype($_, 0, $api_deprecated);
$arglist .= $_->{name};
$arglist .= '_ID' if $arg->{id};
$arglist .= '_ID' if $is_id;
$arglist .= ', ';
$argdesc .= " * \@$_->{name}";
$argdesc .= '_ID' if $arg->{id};
$argdesc .= '_ID' if $is_id;
$argdesc .= ":";
if (exists $arg->{array}) {
@ -291,6 +307,7 @@ sub generate {
my ($type) = &arg_parse($_->{type});
my $arg = $arg_types{$type};
my $var;
my $is_id = ($arg->{id} || ($api_deprecated && $arg->{name} eq 'IMAGE'));
$return_marshal = "" unless $once++;
@ -304,17 +321,17 @@ sub generate {
}
elsif (exists $_->{retval}) {
$return_args .= "\n" . ' ' x 2;
$return_args .= &libtype($_, 1);
$return_args .= &libtype($_, 1, $api_deprecated);
# The return value variable
$var = $_->{libname};
$var .= '_ID' if $arg->{id};
$var .= '_ID' if $is_id;
$return_args .= $var;
# Save the first var to "return" it
$firstvar = $var unless defined $firstvar;
if ($arg->{id}) {
if ($is_id) {
# Initialize all IDs to -1
$return_args .= " = -1";
}
@ -371,6 +388,7 @@ CODE
my ($type) = &arg_parse($_->{type});
my $desc = exists $_->{desc} ? $_->{desc} : "";
my $arg = $arg_types{$type};
my $is_id = ($arg->{id} || ($api_deprecated && $arg->{name} eq 'IMAGE'));
my $var;
# The return value variable
@ -381,11 +399,11 @@ CODE
$arglist .= &libtype($_, 1);
$arglist .= '*' unless exists $arg->{struct};
$arglist .= "$_->{libname}";
$arglist .= '_ID' if $arg->{id};
$arglist .= '_ID' if $is_id;
$arglist .= ', ';
$argdesc .= " * \@$_->{libname}";
$argdesc .= '_ID' if $arg->{id};
$argdesc .= '_ID' if $is_id;
if ($arg->{name} eq 'COLOR') {
$argdesc .= ": (out caller-allocates)";
@ -398,7 +416,12 @@ CODE
$argdesc .= " (array length=@outargs[$argc - 2]->{name})";
}
if (exists $arg->{out_annotate}) {
if ($api_deprecated) {
if (exists $arg->{out_annotate_d}) {
$argdesc .= " $arg->{out_annotate_d}";
}
}
elsif (exists $arg->{out_annotate}) {
$argdesc .= " $arg->{out_annotate}";
}
@ -407,12 +430,17 @@ CODE
$var = exists $_->{retval} ? "" : '*';
$var .= $_->{libname};
$var .= '_ID' if $arg->{id};
$var .= '_ID' if $is_id;
$value = "gimp_value_array_index (return_vals, $argc)";
$return_marshal .= ' ' x 2 if $#outargs;
if ($api_deprecated && $arg->{dup_value_func_d}) {
$return_marshal .= eval qq/" $arg->{dup_value_func_d};\n"/;
}
else {
$return_marshal .= eval qq/" $arg->{dup_value_func};\n"/;
}
if ($argdesc) {
unless ($argdesc =~ /[\.\!\?]$/) { $argdesc .= '.' }
@ -528,11 +556,10 @@ CODE
$procdesc = &desc_wrap($proc->{blurb}) . "\n *\n" .
&desc_wrap($proc->{help});
}
$out->{code} .= <<CODE;
return <<CODE;
/**
* $wrapped$funcname:
* $wrapped$funcname:$func_annotations
$argdesc *
$procdesc
*
@ -562,6 +589,43 @@ $arg_array
CODE
}
sub generate {
my @procs = @{(shift)};
my %out;
foreach $name (@procs) {
my $proc = $main::pdb{$name};
my $out = \%{$out{$proc->{group}}};
my @inargs = @{$proc->{inargs}} if (defined $proc->{inargs});
my @outargs = @{$proc->{outargs}} if (defined $proc->{outargs});
# Check if any of the argument or returned value is an image.
$has_image_arg = 0;
foreach (@outargs) {
my ($type, @typeinfo) = &arg_parse($_->{type});
my $arg = $arg_types{$type};
if ($arg->{name} eq 'IMAGE') {
$has_image_arg = 1;
last;
}
}
unless ($has_image_arg) {
foreach (@inargs) {
my ($type, @typeinfo) = &arg_parse($_->{type});
my $arg = $arg_types{$type};
if ($arg->{name} eq 'IMAGE') {
$has_image_arg = 1;
last;
}
}
}
$out->{code} .= generate_fun($proc, $out, 0);
if ($has_image_arg) {
$out->{code} .= generate_fun($proc, $out, 1);
}
}
my $lgpl_top = <<'LGPL';
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball

View File

@ -166,7 +166,8 @@ package Gimp::CodeGen::pdb;
init_value => 'NULL',
out_annotate => '(transfer full)',
get_value_func => '$var = gimp_value_get_image ($value, gimp)',
dup_value_func => '$var = gimp_image_new_by_id (g_value_get_int ($value))',
dup_value_func => '$var = gimp_image_new_by_id (gimp_value_get_image_id ($value))',
dup_value_func_d=> '$var = gimp_value_get_image_id ($value)',
set_value_func => 'gimp_value_set_image_id ($value, gimp_image_get_id ($var))',
take_value_func => 'gimp_value_set_image ($value, $var)',
convert_func => 'gimp_image_get_id ($var)',