libgimp/gimp*_pdb.c autogenerate gtkdoc comments for all PDB wrappers.

2000-08-25  Sven Neumann  <sven@gimp.org>

        * libgimp/gimp*_pdb.c
        * tools/pdbgen/lib.pl: autogenerate gtkdoc comments for all PDB
        wrappers.
This commit is contained in:
Sven Neumann 2000-08-24 23:06:53 +00:00 committed by Sven Neumann
parent adcb223e6a
commit c9b302652f
34 changed files with 4335 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2000-08-25 Sven Neumann <sven@gimp.org>
* libgimp/gimp*_pdb.c
* tools/pdbgen/lib.pl: autogenerate gtkdoc comments for all PDB
wrappers.
Thu Aug 24 23:37:46 CEST 2000 Marc Lehmann <pcg@goof.com>
* gimp.m4: Make it work with 1.1 again without sacrifing 1.0

View file

@ -23,6 +23,26 @@
#include "gimp.h"
/**
* gimp_brushes_get_brush_data:
* @name: the brush name (\"\" means current active pattern).
* @opacity: The brush opacity.
* @spacing: The brush spacing.
* @paint_mode: The paint mode.
* @width: The brush width.
* @height: The brush height.
* @length: Length of brush mask data.
* @mask_data: The brush mask data.
*
* Retrieve information about the currently active brush (including
* data).
*
* This procedure retrieves information about the currently active
* brush. This includes the brush name, and the brush extents (width
* and height). It also returns the brush data.
*
* Returns: The brush name.
*/
gchar *
gimp_brushes_get_brush_data (gchar *name,
gdouble *opacity,

View file

@ -23,6 +23,21 @@
#include "gimp.h"
/**
* gimp_brushes_popup:
* @brush_callback: The callback PDB proc to call when brush selection is made.
* @popup_title: Title to give the brush popup window.
* @initial_brush: The name of the brush to set as the first selected.
* @opacity: The initial opacity of the brush.
* @spacing: The initial spacing of the brush (if < 0 then use brush default spacing).
* @paint_mode: The initial paint mode.
*
* Invokes the Gimp brush selection.
*
* This procedure popups the brush selection dialog.
*
* Returns: TRUE on success.
*/
gboolean
gimp_brushes_popup (gchar *brush_callback,
gchar *popup_title,
@ -52,6 +67,16 @@ gimp_brushes_popup (gchar *brush_callback,
return success;
}
/**
* gimp_brushes_close_popup:
* @brush_callback: The name of the callback registered for this popup.
*
* Popdown the Gimp brush selection.
*
* This procedure closes an opened brush selection dialog.
*
* Returns: TRUE on success.
*/
gboolean
gimp_brushes_close_popup (gchar *brush_callback)
{
@ -71,6 +96,20 @@ gimp_brushes_close_popup (gchar *brush_callback)
return success;
}
/**
* gimp_brushes_set_popup:
* @brush_callback: The name of the callback registered for this popup.
* @brush_name: The name of the brush to set as selected.
* @opacity: The initial opacity of the brush.
* @spacing: The initial spacing of the brush (if < 0 then use brush default spacing).
* @paint_mode: The initial paint mode.
*
* Sets the current brush selection in a popup.
*
* Sets the current brush selection in a popup.
*
* Returns: TRUE on success.
*/
gboolean
gimp_brushes_set_popup (gchar *brush_callback,
gchar *brush_name,

View file

@ -23,6 +23,29 @@
#include "gimp.h"
/**
* _gimp_channel_new:
* @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.
* @red:
* @green:
* @blue: The channel compositing color.
*
* Create a new channel.
*
* This procedure creates a new channel with the specified width and
* height. Name, opacity, and color are also supplied parameters. The
* new channel still needs to be added to the image, as this is not
* automatic. Add the new channel with the 'gimp_image_add_channel'
* command. Other attributes such as channel show masked, 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,
@ -60,6 +83,16 @@ _gimp_channel_new (gint32 image_ID,
return channel_ID;
}
/**
* gimp_channel_copy:
* @channel_ID: The channel to copy.
*
* Copy a channel.
*
* This procedure copies the specified channel and returns the copy.
*
* Returns: The newly copied channel.
*/
gint32
gimp_channel_copy (gint32 channel_ID)
{
@ -80,6 +113,17 @@ gimp_channel_copy (gint32 channel_ID)
return channel_copy_ID;
}
/**
* gimp_channel_delete:
* @channel_ID: The channel to delete.
*
* Delete a channel.
*
* This procedure deletes the specified channel. This does not need to
* be done if a gimage containing this channel was already deleted.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_delete (gint32 channel_ID)
{
@ -99,6 +143,16 @@ gimp_channel_delete (gint32 channel_ID)
return success;
}
/**
* gimp_channel_get_name:
* @channel_ID: The channel.
*
* Get the name of the specified channel.
*
* This procedure returns the specified channel's name.
*
* Returns: The channel name.
*/
gchar *
gimp_channel_get_name (gint32 channel_ID)
{
@ -119,6 +173,17 @@ gimp_channel_get_name (gint32 channel_ID)
return name;
}
/**
* gimp_channel_set_name:
* @channel_ID: The channel.
* @name: The new channel name.
*
* Set the name of the specified channel.
*
* This procedure sets the specified channel's name.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_set_name (gint32 channel_ID,
gchar *name)
@ -140,6 +205,16 @@ gimp_channel_set_name (gint32 channel_ID,
return success;
}
/**
* gimp_channel_get_visible:
* @channel_ID: The channel.
*
* Get the visibility of the specified channel.
*
* This procedure returns the specified channel's visibility.
*
* Returns: The channel visibility.
*/
gboolean
gimp_channel_get_visible (gint32 channel_ID)
{
@ -160,6 +235,17 @@ gimp_channel_get_visible (gint32 channel_ID)
return visible;
}
/**
* gimp_channel_set_visible:
* @channel_ID: The channel.
* @visible: The new channel visibility.
*
* Set the visibility of the specified channel.
*
* This procedure sets the specified channel's visibility.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_set_visible (gint32 channel_ID,
gboolean visible)
@ -181,6 +267,19 @@ gimp_channel_set_visible (gint32 channel_ID,
return success;
}
/**
* gimp_channel_get_show_masked:
* @channel_ID: The channel.
*
* Get the composite method of the specified channel.
*
* This procedure returns the specified channel's composite method. If
* it is non-zero, then the channel is composited with the image so
* that masked regions are shown. Otherwise, selected regions are
* shown.
*
* Returns: The channel composite method.
*/
gboolean
gimp_channel_get_show_masked (gint32 channel_ID)
{
@ -201,6 +300,19 @@ gimp_channel_get_show_masked (gint32 channel_ID)
return show_masked;
}
/**
* gimp_channel_set_show_masked:
* @channel_ID: The channel.
* @show_masked: The new channel composite method.
*
* Set the composite method of the specified channel.
*
* This procedure sets the specified channel's composite method. If it
* is non-zero, then the channel is composited with the image so that
* masked regions are shown. Otherwise, selected regions are shown.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_set_show_masked (gint32 channel_ID,
gboolean show_masked)
@ -222,6 +334,16 @@ gimp_channel_set_show_masked (gint32 channel_ID,
return success;
}
/**
* gimp_channel_get_opacity:
* @channel_ID: The channel.
*
* Get the opacity of the specified channel.
*
* This procedure returns the specified channel's opacity.
*
* Returns: The channel opacity.
*/
gdouble
gimp_channel_get_opacity (gint32 channel_ID)
{
@ -242,6 +364,17 @@ gimp_channel_get_opacity (gint32 channel_ID)
return opacity;
}
/**
* gimp_channel_set_opacity:
* @channel_ID: The channel.
* @opacity: The new channel opacity.
*
* Set the opacity of the specified channel.
*
* This procedure sets the specified channel's opacity.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_set_opacity (gint32 channel_ID,
gdouble opacity)
@ -263,6 +396,19 @@ gimp_channel_set_opacity (gint32 channel_ID,
return success;
}
/**
* gimp_channel_get_color:
* @channel_ID: The channel.
* @red:
* @green:
* @blue: The channel compositing color.
*
* Get the compositing color of the specified channel.
*
* This procedure returns the specified channel's compositing color.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_get_color (gint32 channel_ID,
guchar *red,
@ -292,6 +438,19 @@ gimp_channel_get_color (gint32 channel_ID,
return success;
}
/**
* gimp_channel_set_color:
* @channel_ID: The channel.
* @red:
* @green:
* @blue: The new channel compositing color.
*
* Set the compositing color of the specified channel.
*
* This procedure sets the specified channel's compositing color.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_set_color (gint32 channel_ID,
guchar red,
@ -320,6 +479,19 @@ gimp_channel_set_color (gint32 channel_ID,
return success;
}
/**
* gimp_channel_get_tattoo:
* @channel_ID: The channel.
*
* Get the tattoo of the specified channel.
*
* This procedure returns the specified channel's tattoo. A tattoo is a
* unique and permanent identifier attached to a channel that can be
* used to uniquely identify a channel within an image even between
* sessions.
*
* Returns: The channel tattoo.
*/
gint
gimp_channel_get_tattoo (gint32 channel_ID)
{
@ -340,6 +512,20 @@ gimp_channel_get_tattoo (gint32 channel_ID)
return tattoo;
}
/**
* gimp_channel_set_tattoo:
* @channel_ID: The channel.
* @tattoo: The new channel tattoo.
*
* Set the tattoo of the specified channel.
*
* This procedure sets the specified channel's tattoo. A tattoo is a
* unique and permanent identifier attached to a channel that can be
* used to uniquely identify a channel within an image even between
* sessions.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_set_tattoo (gint32 channel_ID,
gint tattoo)

View file

@ -23,6 +23,26 @@
#include "gimp.h"
/**
* gimp_channel_ops_offset:
* @drawable_ID: The drawable to offset.
* @wrap_around: wrap image around or fill vacated regions.
* @fill_type: fill vacated regions of drawable with background or transparent.
* @offset_x: offset by this amount in X direction.
* @offset_y: offset by this amount in Y direction.
*
* Offset the drawable by the specified amounts in the X and Y
* directions
*
* This procedure offsets the specified drawable by the amounts
* specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to
* TRUE, then portions of the drawable which are offset out of bounds
* are wrapped around. Alternatively, the undefined regions of the
* drawable can be filled with transparency or the background color, as
* specified by the 'fill_type' parameter.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_ops_offset (gint32 drawable_ID,
gboolean wrap_around,
@ -50,6 +70,17 @@ gimp_channel_ops_offset (gint32 drawable_ID,
return success;
}
/**
* gimp_channel_ops_duplicate:
* @image_ID: The image.
*
* Duplicate the specified image
*
* This procedure duplicates the specified image, copying all layers,
* channels, and image information.
*
* Returns: The new, duplicated image.
*/
gint32
gimp_channel_ops_duplicate (gint32 image_ID)
{

View file

@ -23,6 +23,20 @@
#include "gimp.h"
/**
* gimp_brightness_contrast:
* @drawable_ID: The drawable.
* @brightness: Brightness adjustment.
* @contrast: Contrast adjustment.
*
* Modify brightness/contrast in the specified drawable.
*
* This procedures allows the brightness and contrast of the specified
* drawable to be modified. Both 'brightness' and 'contrast' parameters
* are defined between -127 and 127.
*
* Returns: TRUE on success.
*/
gboolean
gimp_brightness_contrast (gint32 drawable_ID,
gint brightness,
@ -46,6 +60,33 @@ gimp_brightness_contrast (gint32 drawable_ID,
return success;
}
/**
* gimp_levels:
* @drawable_ID: The drawable.
* @channel: The channel to modify.
* @low_input: Intensity of lowest input.
* @high_input: Intensity of highest input.
* @gamma: Gamma correction factor.
* @low_output: Intensity of lowest output.
* @high_output: Intensity of highest output.
*
* Modifies intensity levels in the specified drawable.
*
* This tool allows intensity levels in the specified drawable to be
* remapped according to a set of parameters. The low/high input levels
* specify an initial mapping from the source intensities. The gamma
* value determines how intensities between the low and high input
* intensities are interpolated. A gamma value of 1.0 results in a
* linear interpolation. Higher gamma values result in more high-level
* intensities. Lower gamma values result in more low-level
* intensities. The low/high output levels constrain the final
* intensity mapping--that is, no final intensity will be lower than
* the low output level and no final intensity will be higher than the
* high output level. This tool is only valid on RGB color and
* grayscale images. It will not operate on indexed drawables.
*
* Returns: TRUE on success.
*/
gboolean
gimp_levels (gint32 drawable_ID,
GimpChannelLutType channel,
@ -77,6 +118,18 @@ gimp_levels (gint32 drawable_ID,
return success;
}
/**
* gimp_posterize:
* @drawable_ID: The drawable.
* @levels: Levels of posterization.
*
* Posterize the specified drawable.
*
* This procedures reduces the number of shades allows in each
* intensity channel to the specified 'levels' parameter.
*
* Returns: TRUE on success.
*/
gboolean
gimp_posterize (gint32 drawable_ID,
gint levels)
@ -98,6 +151,17 @@ gimp_posterize (gint32 drawable_ID,
return success;
}
/**
* gimp_desaturate:
* @drawable_ID: The drawable.
*
* Desaturate the contents of the specified drawable.
*
* This procedure desaturates the contents of the specified drawable.
* This procedure only works on drawables of type RGB color.
*
* Returns: TRUE on success.
*/
gboolean
gimp_desaturate (gint32 drawable_ID)
{
@ -117,6 +181,24 @@ gimp_desaturate (gint32 drawable_ID)
return success;
}
/**
* gimp_equalize:
* @drawable_ID: The drawable.
* @mask_only: Equalization option.
*
* Equalize the contents of the specified drawable.
*
* This procedure equalizes the contents of the specified drawable.
* Each intensity channel is equalizeed independently. The equalized
* intensity is given as inten' = (255 - inten). Indexed color
* drawables are not valid for this operation. The 'mask_only' option
* specifies whether to adjust only the area of the image within the
* selection bounds, or the entire image based on the histogram of the
* selected area. If there is no selection, the entire image is
* adjusted based on the histogram for the entire image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_equalize (gint32 drawable_ID,
gboolean mask_only)
@ -138,6 +220,19 @@ gimp_equalize (gint32 drawable_ID,
return success;
}
/**
* gimp_invert:
* @drawable_ID: The drawable.
*
* Invert the contents of the specified drawable.
*
* This procedure inverts the contents of the specified drawable. Each
* intensity channel is inverted independently. The inverted intensity
* is given as inten' = (255 - inten). Indexed color drawables are not
* valid for this operation.
*
* Returns: TRUE on success.
*/
gboolean
gimp_invert (gint32 drawable_ID)
{
@ -157,6 +252,25 @@ gimp_invert (gint32 drawable_ID)
return success;
}
/**
* gimp_curves_spline:
* @drawable_ID: The drawable.
* @channel: The channel to modify.
* @num_points: The number of values in the control point array.
* @control_pts: The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }.
*
* Modifies the intensity curve(s) for specified drawable.
*
* Modifies the intensity mapping for one channel in the specified
* drawable. The drawable must be either grayscale or RGB, and the
* channel can be either an intensity component, or the value. The
* 'control_pts' parameter is an array of integers which define a set
* of control points which describe a Catmull Rom spline which yields
* the final intensity curve. Use the 'gimp_curves_explicit' function
* to explicitly modify intensity levels.
*
* Returns: TRUE on success.
*/
gboolean
gimp_curves_spline (gint32 drawable_ID,
GimpChannelLutType channel,
@ -182,6 +296,25 @@ gimp_curves_spline (gint32 drawable_ID,
return success;
}
/**
* gimp_curves_explicit:
* @drawable_ID: The drawable.
* @channel: The channel to modify.
* @num_bytes: The number of bytes in the new curve (always 256).
* @curve: The explicit curve.
*
* Modifies the intensity curve(s) for specified drawable.
*
* Modifies the intensity mapping for one channel in the specified
* drawable. The drawable must be either grayscale or RGB, and the
* channel can be either an intensity component, or the value. The
* 'curve' parameter is an array of bytes which explicitly defines how
* each pixel value in the drawable will be modified. Use the
* 'gimp_curves_spline' function to modify intensity levels with
* Catmull Rom splines.
*
* Returns: TRUE on success.
*/
gboolean
gimp_curves_explicit (gint32 drawable_ID,
GimpChannelLutType channel,
@ -207,6 +340,28 @@ gimp_curves_explicit (gint32 drawable_ID,
return success;
}
/**
* gimp_color_balance:
* @drawable_ID: The drawable.
* @transfer_mode: Transfer mode.
* @preserve_lum: Preserve luminosity values at each pixel.
* @cyan_red: Cyan-Red color balance.
* @magenta_green: Magenta-Green color balance.
* @yellow_blue: Yellow-Blue color balance.
*
* Modify the color balance of the specified drawable.
*
* Modify the color balance of the specified drawable. There are three
* axis which can be modified: cyan-red, magenta-green, and
* yellow-blue. Negative values increase the amount of the former,
* positive values increase the amount of the latter. Color balance can
* be controlled with the 'transfer_mode' setting, which allows
* shadows, midtones, and highlights in an image to be affected
* differently. The 'preserve_lum' parameter, if non-zero, ensures that
* the luminosity of each pixel remains fixed.
*
* Returns: TRUE on success.
*/
gboolean
gimp_color_balance (gint32 drawable_ID,
GimpTransferMode transfer_mode,
@ -236,6 +391,38 @@ gimp_color_balance (gint32 drawable_ID,
return success;
}
/**
* gimp_histogram:
* @drawable_ID: The drawable.
* @channel: The channel to modify.
* @start_range: Start of the intensity measurement range.
* @end_range: End of the intensity measurement range.
* @mean: Mean itensity value.
* @std_dev: Standard deviation of intensity values.
* @median: Median itensity value.
* @pixels: Alpha-weighted pixel count for entire image.
* @count: Alpha-weighted pixel count for range.
* @percentile: Percentile that range falls under.
*
* Returns information on the intensity histogram for the specified
* drawable.
*
* This tool makes it possible to gather information about the
* intensity histogram of a drawable. A channel to examine is first
* specified. This can be either value, red, green, or blue, depending
* on whether the drawable is of type color or grayscale. The drawable
* may not be indexed. Second, a range of intensities are specified.
* The gimp_histogram function returns statistics based on the pixels
* in the drawable that fall under this range of values. Mean, standard
* deviation, median, number of pixels, and percentile are all
* returned. Additionally, the total count of pixels in the image is
* returned. Counts of pixels are weighted by any associated alpha
* values and by the current selection mask. That is, pixels that lie
* outside an active selection mask will not be counted. Similarly,
* pixels with transparent alpha values will not be counted.
*
* Returns: TRUE on success.
*/
gboolean
gimp_histogram (gint32 drawable_ID,
GimpChannelLutType channel,
@ -284,6 +471,22 @@ gimp_histogram (gint32 drawable_ID,
return success;
}
/**
* gimp_hue_saturation:
* @drawable_ID: The drawable.
* @hue_range: Range of affected hues.
* @hue_offset: Hue offset in degrees.
* @lightness: lightness modification.
* @saturation: saturation modification.
*
* Modify hue, lightness, and saturation in the specified drawable.
*
* This procedures allows the hue, lightness, and saturation in the
* specified drawable to be modified. The 'hue_range' parameter
* provides the capability to limit range of affected hues.
*
* Returns: TRUE on success.
*/
gboolean
gimp_hue_saturation (gint32 drawable_ID,
GimpHueRange hue_range,
@ -311,6 +514,21 @@ gimp_hue_saturation (gint32 drawable_ID,
return success;
}
/**
* gimp_threshold:
* @drawable_ID: The drawable.
* @low_threshold: The low threshold value.
* @high_threshold: The high threshold value.
*
* Threshold the specified drawable.
*
* This procedures generates a threshold map of the specified drawable.
* All pixels between the values of 'low_threshold' and
* 'high_threshold' are replaced with white, and all other pixels with
* black.
*
* Returns: TRUE on success.
*/
gboolean
gimp_threshold (gint32 drawable_ID,
gint low_threshold,

View file

@ -23,6 +23,19 @@
#include "gimp.h"
/**
* gimp_convert_rgb:
* @image_ID: The image.
*
* Convert specified image to RGB color
*
* This procedure converts the specified image to RGB color. This
* process requires an image of type GRAY or INDEXED. No image content
* is lost in this process aside from the colormap for an indexed
* image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_convert_rgb (gint32 image_ID)
{
@ -42,6 +55,18 @@ gimp_convert_rgb (gint32 image_ID)
return success;
}
/**
* gimp_convert_grayscale:
* @image_ID: The image.
*
* Convert specified image to grayscale (256 intensity levels)
*
* This procedure converts the specified image to grayscale with 8 bits
* per pixel (256 intensity levels). This process requires an image of
* type RGB or INDEXED.
*
* Returns: TRUE on success.
*/
gboolean
gimp_convert_grayscale (gint32 image_ID)
{
@ -61,6 +86,34 @@ gimp_convert_grayscale (gint32 image_ID)
return success;
}
/**
* gimp_convert_indexed:
* @image_ID: The image.
* @dither_type: dither type (0=none, 1=fs, 2=fs/low-bleed 3=fixed).
* @palette_type: The type of palette to use.
* @num_cols: the number of colors to quantize to, ignored unless (palette_type == MAKE_PALETTE).
* @alpha_dither: dither transparency to fake partial opacity.
* @remove_unused: remove unused or duplicate colour entries from final palette, ignored if (palette_type == MAKE_PALETTE).
* @palette: The name of the custom palette to use, ignored unless (palette_type == CUSTOM_PALETTE).
*
* Convert specified image to and Indexed image
*
* This procedure converts the specified image to 'indexed' color. This
* process requires an image of type GRAY or RGB. 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_convert_indexed (gint32 image_ID,
GimpConvertDitherType dither_type,

View file

@ -23,6 +23,20 @@
#include "gimp.h"
/**
* gimp_display_new:
* @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 the 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.
*
* Returns: The new display.
*/
gint32
gimp_display_new (gint32 image_ID)
{
@ -43,6 +57,18 @@ gimp_display_new (gint32 image_ID)
return display_ID;
}
/**
* gimp_display_delete:
* @display_ID: The display to delete.
*
* Delete the specified display.
*
* This procedure removes the specified display. If this is the last
* remaining display for the underlying image, then the image is
* deleted also.
*
* Returns: TRUE on success.
*/
gboolean
gimp_display_delete (gint32 display_ID)
{
@ -62,6 +88,18 @@ gimp_display_delete (gint32 display_ID)
return success;
}
/**
* gimp_displays_flush:
*
* Flush all internal changes to the user interface
*
* This procedure takes no arguments and returns nothing except a
* success status. Its purpose is to flush all pending updates of image
* manipulations to the user interface. It should be called whenever
* appropriate.
*
* Returns: TRUE on success.
*/
gboolean
gimp_displays_flush (void)
{

View file

@ -23,6 +23,20 @@
#include "gimp.h"
/**
* gimp_drawable_merge_shadow:
* @drawable_ID: The drawable.
* @undo: Push merge to undo stack?
*
* Merge the shadow buffer with the specified drawable.
*
* This procedure combines the contents of the image's shadow buffer
* (for temporary processing) with the specified drawable. The \"undo\"
* parameter specifies whether to add an undo step for the operation.
* Requesting no undo is useful for such applications as 'auto-apply'.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_merge_shadow (gint32 drawable_ID,
gboolean undo)
@ -44,6 +58,25 @@ gimp_drawable_merge_shadow (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_fill:
* @drawable_ID: The drawable.
* @fill_type: The type of fill.
*
* Fill the drawable with the specified fill mode.
*
* This procedure fills the drawable with the fill mode. If the fill
* mode is foreground the current foreground color is used. If the fill
* mode is background, the current background color is used. If the
* fill type is white, then white is used. Transparent fill only
* affects layers with an alpha channel, in which case the alpha
* channel is set to transparent. If the drawable has no alpha channel,
* it is filled to white. No fill leaves the drawable's contents
* undefined. This procedure is unlike the bucket fill tool because it
* fills regardless of a selection
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_fill (gint32 drawable_ID,
GimpFillType fill_type)
@ -65,6 +98,23 @@ gimp_drawable_fill (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_update:
* @drawable_ID: The drawable.
* @x: x coordinate of upper left corner of update region.
* @y: y coordinate of upper left corner of update region.
* @width: Width of update region.
* @height: Height of update region.
*
* Update the specified region of the drawable.
*
* This procedure updates the specified region of the drawable. The (x,
* y) coordinate pair is relative to the drawable's origin, not to the
* image origin. Therefore, the entire drawable can be updated with:
* {x->0, y->0, w->width, h->height }.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_update (gint32 drawable_ID,
gint x,
@ -92,6 +142,24 @@ gimp_drawable_update (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_mask_bounds:
* @drawable_ID: The drawable.
* @x1: x coordinate of the upper left corner of selection bounds.
* @y1: y coordinate of the upper left corner of selection bounds.
* @x2: x coordinate of the lower right corner of selection bounds.
* @y2: y coordinate of the lower right corner of selection bounds.
*
* Find the bounding box of the current selection in relation to the
* specified drawable.
*
* This procedure returns the whether there is a selection. If there is
* one, the upper left and lower righthand corners of its bounding box
* are returned. These coordinates are specified relative to the
* drawable's origin, and bounded by the drawable's extents.
*
* Returns: TRUE if there is a selection.
*/
gboolean
gimp_drawable_mask_bounds (gint32 drawable_ID,
gint *x1,
@ -122,6 +190,16 @@ gimp_drawable_mask_bounds (gint32 drawable_ID,
return non_empty;
}
/**
* gimp_drawable_image:
* @drawable_ID: The drawable.
*
* Returns the drawable's image.
*
* This procedure returns the drawable's image.
*
* Returns: The drawable's image.
*/
gint32
gimp_drawable_image (gint32 drawable_ID)
{
@ -142,6 +220,16 @@ gimp_drawable_image (gint32 drawable_ID)
return image_ID;
}
/**
* gimp_drawable_type:
* @drawable_ID: The drawable.
*
* Returns the drawable's type.
*
* This procedure returns the drawable's type.
*
* Returns: The drawable's type.
*/
GimpImageType
gimp_drawable_type (gint32 drawable_ID)
{
@ -162,6 +250,18 @@ gimp_drawable_type (gint32 drawable_ID)
return type;
}
/**
* gimp_drawable_has_alpha:
* @drawable_ID: The drawable.
*
* Returns non-zero if the drawable has an alpha channel.
*
* This procedure returns whether the specified drawable has an alpha
* channel. This can only be true for layers, and the associated type
* will be one of: { RGBA , GRAYA, INDEXEDA }.
*
* Returns: Does the drawable have an alpha channel?
*/
gboolean
gimp_drawable_has_alpha (gint32 drawable_ID)
{
@ -182,6 +282,19 @@ gimp_drawable_has_alpha (gint32 drawable_ID)
return has_alpha;
}
/**
* gimp_drawable_type_with_alpha:
* @drawable_ID: The drawable.
*
* Returns the drawable's type with alpha.
*
* This procedure returns the drawable's type if an alpha channel were
* added. If the type is currently Gray, for instance, the returned
* type would be GrayA. If the drawable already has an alpha channel,
* the drawable's type is simply returned.
*
* Returns: The drawable's type with alpha.
*/
GimpImageType
gimp_drawable_type_with_alpha (gint32 drawable_ID)
{
@ -202,6 +315,17 @@ gimp_drawable_type_with_alpha (gint32 drawable_ID)
return type_with_alpha;
}
/**
* gimp_drawable_is_rgb:
* @drawable_ID: The drawable.
*
* Returns whether the drawable is an RGB type.
*
* This procedure returns non-zero if the specified drawable is of type
* { RGB, RGBA }.
*
* Returns: non-zero if the drawable is an RGB type.
*/
gboolean
gimp_drawable_is_rgb (gint32 drawable_ID)
{
@ -222,6 +346,17 @@ gimp_drawable_is_rgb (gint32 drawable_ID)
return color;
}
/**
* gimp_drawable_is_gray:
* @drawable_ID: The drawable.
*
* Returns whether the drawable is a grayscale type.
*
* This procedure returns non-zero if the specified drawable is of type
* { Gray, GrayA }.
*
* Returns: non-zero if the drawable is a grayscale type.
*/
gboolean
gimp_drawable_is_gray (gint32 drawable_ID)
{
@ -242,6 +377,17 @@ gimp_drawable_is_gray (gint32 drawable_ID)
return gray;
}
/**
* gimp_drawable_is_indexed:
* @drawable_ID: The drawable.
*
* Returns whether the drawable is an indexed type.
*
* This procedure returns non-zero if the specified drawable is of type
* { Indexed, IndexedA }.
*
* Returns: non-zero if the drawable is an indexed type.
*/
gboolean
gimp_drawable_is_indexed (gint32 drawable_ID)
{
@ -262,6 +408,17 @@ gimp_drawable_is_indexed (gint32 drawable_ID)
return indexed;
}
/**
* gimp_drawable_bytes:
* @drawable_ID: The drawable.
*
* Returns the bytes per pixel.
*
* This procedure returns the number of bytes per pixel (or the number
* of channels) for the specified drawable.
*
* Returns: Bytes per pixel.
*/
gint
gimp_drawable_bytes (gint32 drawable_ID)
{
@ -282,6 +439,16 @@ gimp_drawable_bytes (gint32 drawable_ID)
return bytes;
}
/**
* gimp_drawable_width:
* @drawable_ID: The drawable.
*
* Returns the width of the drawable.
*
* This procedure returns the specified drawable's width in pixels.
*
* Returns: Width of drawable.
*/
gint
gimp_drawable_width (gint32 drawable_ID)
{
@ -302,6 +469,16 @@ gimp_drawable_width (gint32 drawable_ID)
return width;
}
/**
* gimp_drawable_height:
* @drawable_ID: The drawable.
*
* Returns the height of the drawable.
*
* This procedure returns the specified drawable's height in pixels.
*
* Returns: Height of drawable.
*/
gint
gimp_drawable_height (gint32 drawable_ID)
{
@ -322,6 +499,20 @@ gimp_drawable_height (gint32 drawable_ID)
return height;
}
/**
* gimp_drawable_offsets:
* @drawable_ID: The drawable.
* @offset_x: x offset of drawable.
* @offset_y: y offset of drawable.
*
* Returns the offsets for the drawable.
*
* This procedure returns the specified drawable's offsets. This only
* makes sense if the drawable is a layer since channels are anchored.
* The offsets of a channel will be returned as 0.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_offsets (gint32 drawable_ID,
gint *offset_x,
@ -352,6 +543,17 @@ gimp_drawable_offsets (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_is_layer:
* @drawable_ID: The drawable.
*
* Returns whether the drawable is a layer.
*
* This procedure returns non-zero if the specified drawable is a
* layer.
*
* Returns: Non-zero if the drawable is a layer.
*/
gboolean
gimp_drawable_is_layer (gint32 drawable_ID)
{
@ -372,6 +574,17 @@ gimp_drawable_is_layer (gint32 drawable_ID)
return layer;
}
/**
* gimp_drawable_is_layer_mask:
* @drawable_ID: The drawable.
*
* Returns whether the drawable is a layer mask.
*
* This procedure returns non-zero if the specified drawable is a layer
* mask.
*
* Returns: Non-zero if the drawable is a layer mask.
*/
gboolean
gimp_drawable_is_layer_mask (gint32 drawable_ID)
{
@ -392,6 +605,17 @@ gimp_drawable_is_layer_mask (gint32 drawable_ID)
return layer_mask;
}
/**
* gimp_drawable_is_channel:
* @drawable_ID: The drawable.
*
* Returns whether the drawable is a channel.
*
* This procedure returns non-zero if the specified drawable is a
* channel.
*
* Returns: Non-zero if the drawable is a channel.
*/
gboolean
gimp_drawable_is_channel (gint32 drawable_ID)
{
@ -412,6 +636,27 @@ gimp_drawable_is_channel (gint32 drawable_ID)
return channel;
}
/**
* _gimp_drawable_thumbnail:
* @drawable_ID: The drawable.
* @width: The thumbnail width.
* @height: The thumbnail height.
* @ret_width: The previews width.
* @ret_height: The previews height.
* @bpp: The previews bpp.
* @thumbnail_data_count: The number of pixels in thumbnail data.
* @thumbnail_data: The thumbnail data.
*
* Get a thumbnail of a drawable.
*
* This function gets data from which a thumbnail of a drawable preview
* can be created. Maximum x or y dimension is 128 pixels. The pixels
* are returned in the RGB[A] format. The bpp return value gives the
* number of bytes in the image. The alpha channel also returned if the
* drawable has one.
*
* Returns: TRUE on success.
*/
gboolean
_gimp_drawable_thumbnail (gint32 drawable_ID,
gint width,

View file

@ -23,6 +23,22 @@
#include "gimp.h"
/**
* gimp_edit_cut:
* @drawable_ID: The drawable to cut from.
*
* Cut from the specified drawable.
*
* If there is a selection in the image, then the area specified by the
* selection is cut from the specified drawable 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
* specified drawable will be removed and its contents stored in the
* internal GIMP edit buffer. The drawable MUST belong to the specified
* image, or an error is returned.
*
* Returns: TRUE on success.
*/
gboolean
gimp_edit_cut (gint32 drawable_ID)
{
@ -42,6 +58,22 @@ gimp_edit_cut (gint32 drawable_ID)
return success;
}
/**
* gimp_edit_copy:
* @drawable_ID: The drawable to copy from.
*
* Copy from the specified drawable.
*
* If there is a selection in the image, then the area specified by the
* selection is copied from the specified drawable 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
* specified drawable's contents will be stored in the internal GIMP
* edit buffer. The drawable MUST belong to the specified image, or an
* error is returned.
*
* Returns: TRUE on success.
*/
gboolean
gimp_edit_copy (gint32 drawable_ID)
{
@ -61,6 +93,31 @@ gimp_edit_copy (gint32 drawable_ID)
return success;
}
/**
* gimp_edit_paste:
* @drawable_ID: The drawable to paste to.
* @paste_into: Clear selection, or paste behind it?
*
* Paste buffer to the specified drawable.
*
* This procedure pastes a copy of the internal GIMP edit buffer to the
* specified drawable. The GIMP edit buffer will be empty unless a call
* was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'.
* The \"paste_into\" option specifies whether to clear the current
* image selection, or to paste the buffer \"behind\" the selection.
* This allows the selection to act as a mask for the pasted buffer.
* Anywhere that the selection mask is non-zero, the pasted buffer will
* show through. The pasted buffer will be a new layer in the image
* which is designated as the image floating selection. If the image
* has a floating selection at the time of pasting, the old floating
* selection will be anchored to it's drawable before the new floating
* selection is added. This procedure returns the new floating layer.
* The resulting floating selection will already be attached to the
* specified drawable, and a subsequent call to floating_sel_attach is
* not needed.
*
* Returns: The new floating selection.
*/
gint32
gimp_edit_paste (gint32 drawable_ID,
gboolean paste_into)
@ -83,6 +140,20 @@ gimp_edit_paste (gint32 drawable_ID,
return floating_sel_ID;
}
/**
* gimp_edit_clear:
* @drawable_ID: The drawable to clear from.
*
* Clear selected area of drawable.
*
* This procedure clears the specified drawable. If the drawable has an
* alpha channel, the cleared pixels will become transparent. If the
* drawable does not have an alpha channel, cleared pixels will be set
* to the background color. This procedure only affects regions within
* a selection if there is a selection active.
*
* Returns: TRUE on success.
*/
gboolean
gimp_edit_clear (gint32 drawable_ID)
{
@ -102,6 +173,21 @@ gimp_edit_clear (gint32 drawable_ID)
return success;
}
/**
* gimp_edit_fill:
* @drawable_ID: The drawable to fill to.
* @fill_type: The type of fill.
*
* Fill selected area of drawable.
*
* This procedure fills the specified drawable with the fill mode. If
* the fill mode is foreground, the current foreground color is used.
* If the fill mode is background, the current background color is
* used. Other fill modes should not be used. This procedure only
* affects regions within a selection if there is a selection active.
*
* Returns: TRUE on success.
*/
gboolean
gimp_edit_fill (gint32 drawable_ID,
GimpFillType fill_type)
@ -123,6 +209,19 @@ gimp_edit_fill (gint32 drawable_ID,
return success;
}
/**
* gimp_edit_stroke:
* @drawable_ID: The drawable to stroke to.
*
* Stroke the current selection
*
* This procedure strokes the current selection, painting along the
* selection boundary with the active brush and foreground color. The
* paint is applied to the specified drawable regardless of the active
* selection.
*
* Returns: TRUE on success.
*/
gboolean
gimp_edit_stroke (gint32 drawable_ID)
{

View file

@ -23,6 +23,20 @@
#include "gimp.h"
/**
* gimp_register_magic_load_handler:
* @procedure_name: The name of the procedure to be used for loading.
* @extensions: comma separated list of extensions this handler can load (i.e. \"jpg,jpeg\").
* @prefixes: comma separated list of prefixes this handler can load (i.e. \"http:,ftp:\").
* @magics: comma separated list of magic file information this handler can load (i.e. \"0,string,GIF\").
*
* Registers a file load handler procedure.
*
* Registers a procedural database procedure to be called to load files
* of a particular file format using magic file information.
*
* Returns: TRUE on success.
*/
gboolean
gimp_register_magic_load_handler (gchar *procedure_name,
gchar *extensions,
@ -48,6 +62,19 @@ gimp_register_magic_load_handler (gchar *procedure_name,
return success;
}
/**
* gimp_register_load_handler:
* @procedure_name: The name of the procedure to be used for loading.
* @extensions: comma separated list of extensions this handler can load (i.e. \"jpg,jpeg\").
* @prefixes: comma separated list of prefixes this handler can load (i.e. \"http:,ftp:\").
*
* Registers a file load handler procedure.
*
* Registers a procedural database procedure to be called to load files
* of a particular file format.
*
* Returns: TRUE on success.
*/
gboolean
gimp_register_load_handler (gchar *procedure_name,
gchar *extensions,
@ -71,6 +98,19 @@ gimp_register_load_handler (gchar *procedure_name,
return success;
}
/**
* gimp_register_save_handler:
* @procedure_name: The name of the procedure to be used for saving.
* @extensions: comma separated list of extensions this handler can save (i.e. \"jpg,jpeg\").
* @prefixes: comma separated list of prefixes this handler can save (i.e. \"http:,ftp:\").
*
* Registers a file save handler procedure.
*
* Registers a procedural database procedure to be called to save files
* in a particular file format.
*
* Returns: TRUE on success.
*/
gboolean
gimp_register_save_handler (gchar *procedure_name,
gchar *extensions,

View file

@ -23,6 +23,18 @@
#include "gimp.h"
/**
* gimp_floating_sel_remove:
* @floating_sel_ID: The floating selection.
*
* Remove the specified floating selection from its associated
* drawable.
*
* This procedure removes the floating selection completely, without
* any side effects. The associated drawable is then set to active.
*
* Returns: TRUE on success.
*/
gboolean
gimp_floating_sel_remove (gint32 floating_sel_ID)
{
@ -42,6 +54,19 @@ gimp_floating_sel_remove (gint32 floating_sel_ID)
return success;
}
/**
* gimp_floating_sel_anchor:
* @floating_sel_ID: The floating selection.
*
* Anchor the specified floating selection to its associated drawable.
*
* This procedure anchors the floating selection to its associated
* drawable. This is similar to merging with a merge type of
* ClipToBottomLayer. The floating selection layer is no longer valid
* after this operation.
*
* Returns: TRUE on success.
*/
gboolean
gimp_floating_sel_anchor (gint32 floating_sel_ID)
{
@ -61,6 +86,23 @@ gimp_floating_sel_anchor (gint32 floating_sel_ID)
return success;
}
/**
* gimp_floating_sel_to_layer:
* @floating_sel_ID: The floating selection.
*
* Transforms the specified floating selection into a layer.
*
* This procedure transforms the specified floating selection into a
* layer with the same offsets and extents. The composited image will
* look precisely the same, but the floating selection layer will no
* longer be clipped to the extents of the drawable it was attached to.
* The floating selection will become the active layer. This procedure
* will not work if the floating selection has a different base type
* from the underlying image. This might be the case if the floating
* selection is above an auxillary channel or a layer mask.
*
* Returns: TRUE on success.
*/
gboolean
gimp_floating_sel_to_layer (gint32 floating_sel_ID)
{
@ -80,6 +122,18 @@ gimp_floating_sel_to_layer (gint32 floating_sel_ID)
return success;
}
/**
* gimp_floating_sel_attach:
* @layer_ID: The layer (is attached as floating selection).
* @drawable_ID: The drawable (where to attach the floating selection).
*
* Attach the specified layer as floating to the specified drawable.
*
* This procedure attaches the layer as floating selection to the
* drawable.
*
* Returns: TRUE on success.
*/
gboolean
gimp_floating_sel_attach (gint32 layer_ID,
gint32 drawable_ID)
@ -101,6 +155,17 @@ gimp_floating_sel_attach (gint32 layer_ID,
return success;
}
/**
* gimp_floating_sel_rigor:
* @floating_sel_ID: The floating selection.
* @undo: %%desc%%.
*
* Rigor the floating selection.
*
* This procedure rigors the floating selection.
*
* Returns: TRUE on success.
*/
gboolean
gimp_floating_sel_rigor (gint32 floating_sel_ID,
gboolean undo)
@ -122,6 +187,17 @@ gimp_floating_sel_rigor (gint32 floating_sel_ID,
return success;
}
/**
* gimp_floating_sel_relax:
* @floating_sel_ID: The floating selection.
* @undo: %%desc%%.
*
* Relax the floating selection.
*
* This procedure relaxes the floating selection.
*
* Returns: TRUE on success.
*/
gboolean
gimp_floating_sel_relax (gint32 floating_sel_ID,
gboolean undo)

View file

@ -23,6 +23,24 @@
#include "gimp.h"
/**
* gimp_gimprc_query:
* @token: The token to query for.
*
* Queries the gimprc file parser for information on a specified token.
*
* This procedure is used to locate additional information contained in
* the gimprc file considered extraneous to the operation of the GIMP.
* Plug-ins that need configuration information can expect it will be
* stored in the user gimprc file and can use this procedure to
* retrieve it. This query procedure will return the value associated
* with the specified token. This corresponds _only_ to entries with
* the format: (<token> <value>). The value must be a string. Entries
* not corresponding to this format will cause warnings to be issued on
* gimprc parsing a nd will not be queryable.
*
* Returns: The value associated with the queried token.
*/
gchar *
gimp_gimprc_query (gchar *token)
{
@ -43,6 +61,25 @@ gimp_gimprc_query (gchar *token)
return value;
}
/**
* gimp_gimprc_set:
* @token: The token to modify.
* @value: The value to set the token to.
*
* Sets a gimprc token to a value and saves it in the gimprc.
*
* This procedure is used to add or change additional information in
* the gimprc file that is considered extraneous to the operation of
* the GIMP. Plug-ins that need configuration information can use this
* function to store it, and gimp_gimprc_query to retrieve it. This
* will accept _only_ parameters in the format of (<token> <value>),
* where <token> and <value> must be strings. Entries not corresponding
* to this format will be eaten and no action will be performed. If the
* gimprc can not be written for whatever reason, gimp will complain
* loudly and the old gimprc will be saved in gimprc.old.
*
* Returns: TRUE on success.
*/
gboolean
gimp_gimprc_set (gchar *token,
gchar *value)
@ -64,6 +101,20 @@ gimp_gimprc_set (gchar *token,
return success;
}
/**
* gimp_get_monitor_resolution:
* @xres: X resolution.
* @yres: Y resolution.
*
* Get the monitor resolution as specified in the Preferences.
*
* Returns the resolution of the monitor in pixels/inch. This value is
* taken from the Preferences (or the X-Server if this is set in the
* Preferences) and there's no guarantee for the value to be
* reasonable.
*
* Returns: TRUE on success.
*/
gboolean
gimp_get_monitor_resolution (gdouble *xres,
gdouble *yres)

View file

@ -23,6 +23,18 @@
#include "gimp.h"
/**
* gimp_gradients_get_list:
* @num_gradients: The number of loaded gradients.
*
* Retrieve the list of loaded gradients.
*
* This procedure returns a list of the gradients that are currently
* loaded in the gradient editor. You can later use the
* gimp_gradients_set_active function to set the active gradient.
*
* Returns: The list of gradient names.
*/
gchar **
gimp_gradients_get_list (gint *num_gradients)
{
@ -50,6 +62,16 @@ gimp_gradients_get_list (gint *num_gradients)
return gradient_names;
}
/**
* gimp_gradients_get_active:
*
* Retrieve the name of the active gradient.
*
* This procedure returns the name of the active gradient in the
* gradient editor.
*
* Returns: The name of the active gradient.
*/
gchar *
gimp_gradients_get_active (void)
{
@ -69,6 +91,21 @@ gimp_gradients_get_active (void)
return name;
}
/**
* gimp_gradients_set_active:
* @name: The name of the gradient to set.
*
* Sets the specified gradient as the active gradient.
*
* This procedure lets you set the specified gradient as the active or
* \"current\" one. The name is simply a string which corresponds to
* one of the loaded gradients in the gradient editor. If no matching
* gradient is found, this procedure will return an error. Otherwise,
* the specified gradient will become active and will be used for
* subsequent custom gradient operations.
*
* Returns: TRUE on success.
*/
gboolean
gimp_gradients_set_active (gchar *name)
{
@ -88,6 +125,22 @@ gimp_gradients_set_active (gchar *name)
return success;
}
/**
* gimp_gradients_sample_uniform:
* @num_samples: The number of samples to take.
*
* Sample the active gradient in uniform parts.
*
* This procedure samples the active gradient from the gradient editor
* in the specified number of uniform parts. It returns a list of
* floating-point values which correspond to the RGBA values for each
* sample. The minimum number of samples to take is 2, in which case
* the returned colors will correspond to the { 0.0, 1.0 } positions in
* the gradient. For example, if the number of samples is 3, the
* procedure will return the colors at positions { 0.0, 0.5, 1.0 }.
*
* Returns: Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
*/
gdouble *
gimp_gradients_sample_uniform (gint num_samples)
{
@ -114,6 +167,22 @@ gimp_gradients_sample_uniform (gint num_samples)
return color_samples;
}
/**
* gimp_gradients_sample_custom:
* @num_samples: The number of samples to take.
* @positions: The list of positions to sample along the gradient.
*
* Sample the active gradient in custom positions.
*
* This procedure samples the active gradient from the gradient editor
* in the specified number of points. The procedure will sample the
* gradient in the specified positions from the list. The left endpoint
* of the gradient corresponds to position 0.0, and the right endpoint
* corresponds to 1.0. The procedure returns a list of floating-point
* values which correspond to the RGBA values for each sample.
*
* Returns: Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
*/
gdouble *
gimp_gradients_sample_custom (gint num_samples,
gdouble *positions)

View file

@ -23,6 +23,19 @@
#include "gimp.h"
/**
* gimp_gradients_popup:
* @gradients_callback: The callback PDB proc to call when gradient selection is made.
* @popup_title: Title to give the gradient popup window.
* @initial_gradient: The name of the pattern to set as the first selected.
* @sample_size: Size of the sample to return when the gradient is changed.
*
* Invokes the Gimp gradients selection.
*
* This procedure popups the gradients selection dialog.
*
* Returns: TRUE on success.
*/
gboolean
gimp_gradients_popup (gchar *gradients_callback,
gchar *popup_title,
@ -48,6 +61,16 @@ gimp_gradients_popup (gchar *gradients_callback,
return success;
}
/**
* gimp_gradients_close_popup:
* @gradients_callback: The name of the callback registered for this popup.
*
* Popdown the Gimp gradient selection.
*
* This procedure closes an opened gradient selection dialog.
*
* Returns: TRUE on success.
*/
gboolean
gimp_gradients_close_popup (gchar *gradients_callback)
{
@ -67,6 +90,17 @@ gimp_gradients_close_popup (gchar *gradients_callback)
return success;
}
/**
* gimp_gradients_set_popup:
* @gradients_callback: The name of the callback registered for this popup.
* @gradient_name: The name of the gradient to set as selected.
*
* Sets the current gradient selection in a popup.
*
* Sets the current gradient selection in a popup.
*
* Returns: TRUE on success.
*/
gboolean
gimp_gradients_set_popup (gchar *gradients_callback,
gchar *gradient_name)
@ -88,6 +122,20 @@ gimp_gradients_set_popup (gchar *gradients_callback,
return success;
}
/**
* _gimp_gradients_get_gradient_data:
* @name: The gradient name (\"\" means current active gradient).
* @sample_size: Size of the sample to return when the gradient is changed.
* @width: The gradient sample width (r,g,b,a).
* @grad_data: The gradient sample data.
*
* Retrieve information about the specified gradient (including data).
*
* This procedure retrieves information about the gradient. This
* includes the gradient name, and the sample data for the gradient.
*
* Returns: The gradient name.
*/
gchar *
_gimp_gradients_get_gradient_data (gchar *name,
gint sample_size,

View file

@ -23,6 +23,19 @@
#include "gimp.h"
/**
* gimp_image_add_hguide:
* @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)
@ -45,6 +58,19 @@ gimp_image_add_hguide (gint32 image_ID,
return guide_ID;
}
/**
* gimp_image_add_vguide:
* @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)
@ -67,6 +93,18 @@ gimp_image_add_vguide (gint32 image_ID,
return guide_ID;
}
/**
* gimp_image_delete_guide:
* @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)
@ -88,6 +126,21 @@ gimp_image_delete_guide (gint32 image_ID,
return success;
}
/**
* gimp_image_find_next_guide:
* @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)
@ -110,6 +163,18 @@ gimp_image_find_next_guide (gint32 image_ID,
return next_guide_ID;
}
/**
* gimp_image_get_guide_orientation:
* @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)
@ -132,6 +197,18 @@ gimp_image_get_guide_orientation (gint32 image_ID,
return orientation;
}
/**
* gimp_image_get_guide_position:
* @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)

View file

@ -23,6 +23,24 @@
#include "gimp.h"
/**
* gimp_help:
* @prog_name: The plug-in's executable name or an empty string.
* @help_page: The location of the help page.
*
* Load a help page.
*
* This procedure loads the specified help page into the helpbrowser or
* what ever is configured as help viewer. The location of the help
* page is given relative to the help rootdir. The help rootdir is
* determined from the prog_name: if prog_name is NULL, we use the help
* rootdir of the main GIMP installation, if the plug-in's full
* executable name is passed as prog_name, the GIMP will use this
* information to look up the help path the plug-in has registered
* before with gimp-plugin-help-register.
*
* Returns: TRUE on success.
*/
gboolean
gimp_help (gchar *prog_name,
gchar *help_page)

File diff suppressed because it is too large Load diff

View file

@ -23,6 +23,27 @@
#include "gimp.h"
/**
* _gimp_layer_new:
* @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_add_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,
@ -55,6 +76,22 @@ _gimp_layer_new (gint32 image_ID,
return layer_ID;
}
/**
* _gimp_layer_copy:
* @layer_ID: The layer to copy.
* @add_alpha: Add an alpha channel to the copied layer.
*
* Copy a layer.
*
* This procedure copies the specified layer and returns the copy. The
* newly copied layer is for use within the original layer's image. It
* should not be subsequently added to any other image. The copied
* layer can optionally have an added alpha channel. This is useful if
* the background layer in an image is being copied and added to the
* same image.
*
* Returns: The newly copied layer.
*/
gint32
_gimp_layer_copy (gint32 layer_ID,
gboolean add_alpha)
@ -77,6 +114,25 @@ _gimp_layer_copy (gint32 layer_ID,
return layer_copy_ID;
}
/**
* gimp_layer_create_mask:
* @layer_ID: The layer to which to add the mask.
* @mask_type: The type of mask.
*
* Create a layer mask for the specified specified layer.
*
* This procedure creates a layer mask for the specified layer. Layer
* masks serve as an additional alpha channel for a layer. Three
* different types of masks are allowed initially: completely white
* masks (which will leave the layer fully visible), completely black
* masks (which will give the layer complete transparency, and the
* layer's already existing alpha channel (which will leave the layer
* fully visible, but which may be more useful than a white mask). The
* layer mask still needs to be added to the layer. This can be done
* with a call to 'gimage_add_layer_mask'.
*
* Returns: The newly created mask.
*/
gint32
gimp_layer_create_mask (gint32 layer_ID,
GimpAddMaskType mask_type)
@ -99,6 +155,23 @@ gimp_layer_create_mask (gint32 layer_ID,
return mask_ID;
}
/**
* gimp_layer_scale:
* @layer_ID: The layer.
* @new_width: New layer width.
* @new_height: New layer height.
* @local_origin: Use a local origin (as opposed to the image origin).
*
* Scale the layer to the specified extents.
*
* This procedure scales the layer so that it's new width and height
* are equal to the supplied parameters. The \"local_origin\" parameter
* specifies whether to scale from the center of the layer, or from the
* image origin. This operation only works if the layer has been added
* to an image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_scale (gint32 layer_ID,
gint new_width,
@ -124,6 +197,23 @@ gimp_layer_scale (gint32 layer_ID,
return success;
}
/**
* gimp_layer_resize:
* @layer_ID: The layer.
* @new_width: New layer width.
* @new_height: New layer height.
* @offx: x offset between upper left corner of old and new layers: (new - old).
* @offy: y offset between upper left corner of old and new layers: (new - old).
*
* Resize the layer to the specified extents.
*
* This procedure resizes the layer 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 layer's content. This
* operation only works if the layer has been added to an image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_resize (gint32 layer_ID,
gint new_width,
@ -151,6 +241,17 @@ gimp_layer_resize (gint32 layer_ID,
return success;
}
/**
* gimp_layer_delete:
* @layer_ID: The layer to delete.
*
* Delete a layer.
*
* This procedure deletes the specified layer. This does not need to be
* done if a gimage containing this layer was already deleted.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_delete (gint32 layer_ID)
{
@ -170,6 +271,23 @@ gimp_layer_delete (gint32 layer_ID)
return success;
}
/**
* gimp_layer_translate:
* @layer_ID: The layer.
* @offx: Offset in x direction.
* @offy: Offset in y direction.
*
* Translate the layer by the specified offsets.
*
* This procedure translates the layer by the amounts specified in the
* x and y arguments. These can be negative, and are considered offsets
* from the current position. This command only works if the layer has
* been added to an image. All additional layers contained in the image
* which have the linked flag set to TRUE w ill also be translated by
* the specified offsets.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_translate (gint32 layer_ID,
gint offx,
@ -193,6 +311,21 @@ gimp_layer_translate (gint32 layer_ID,
return success;
}
/**
* gimp_layer_add_alpha:
* @layer_ID: The layer.
*
* Add an alpha channel to the layer if it doesn't already have one.
*
* This procedure adds an additional component to the specified layer
* if it does not already possess an alpha channel. An alpha channel
* makes it possible to move a layer from the bottom of the layer stack
* and to clear and erase to transparency, instead of the background
* color. This transforms images of type RGB to RGBA, GRAY to GRAYA,
* and INDEXED to INDEXEDA.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_add_alpha (gint32 layer_ID)
{
@ -212,6 +345,20 @@ gimp_layer_add_alpha (gint32 layer_ID)
return success;
}
/**
* gimp_layer_set_offsets:
* @layer_ID: The layer.
* @offx: Offset in x direction.
* @offy: Offset in y direction.
*
* Set the layer offsets.
*
* This procedure sets the offsets for the specified layer. The offsets
* are relative to the image origin and can be any values. This
* operation is valid only on layers which have been added to an image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_offsets (gint32 layer_ID,
gint offx,
@ -235,6 +382,17 @@ gimp_layer_set_offsets (gint32 layer_ID,
return success;
}
/**
* gimp_layer_mask:
* @layer_ID: The layer.
*
* Get the specified layer's mask if it exists.
*
* This procedure returns the specified layer's mask, or -1 if none
* exists.
*
* Returns: The layer mask.
*/
gint32
gimp_layer_mask (gint32 layer_ID)
{
@ -255,6 +413,18 @@ gimp_layer_mask (gint32 layer_ID)
return mask_ID;
}
/**
* gimp_layer_is_floating_sel:
* @layer_ID: The layer.
*
* Is the specified layer a floating selection?
*
* This procedure returns whether the layer is a floating selection.
* Floating selections are special cases of layers which are attached
* to a specific drawable.
*
* Returns: Non-zero if the layer is a floating selection.
*/
gboolean
gimp_layer_is_floating_sel (gint32 layer_ID)
{
@ -275,6 +445,16 @@ gimp_layer_is_floating_sel (gint32 layer_ID)
return is_floating_sel;
}
/**
* gimp_layer_get_name:
* @layer_ID: The layer.
*
* Get the name of the specified layer.
*
* This procedure returns the specified layer's name.
*
* Returns: The layer name.
*/
gchar *
gimp_layer_get_name (gint32 layer_ID)
{
@ -295,6 +475,17 @@ gimp_layer_get_name (gint32 layer_ID)
return name;
}
/**
* gimp_layer_set_name:
* @layer_ID: The layer.
* @name: The new layer name.
*
* Set the name of the specified layer.
*
* This procedure sets the specified layer's name.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_name (gint32 layer_ID,
gchar *name)
@ -316,6 +507,16 @@ gimp_layer_set_name (gint32 layer_ID,
return success;
}
/**
* gimp_layer_get_visible:
* @layer_ID: The layer.
*
* Get the visibility of the specified layer.
*
* This procedure returns the specified layer's visibility.
*
* Returns: The layer visibility.
*/
gboolean
gimp_layer_get_visible (gint32 layer_ID)
{
@ -336,6 +537,17 @@ gimp_layer_get_visible (gint32 layer_ID)
return visible;
}
/**
* gimp_layer_set_visible:
* @layer_ID: The layer.
* @visible: The new layer visibility.
*
* Set the visibility of the specified layer.
*
* This procedure sets the specified layer's visibility.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_visible (gint32 layer_ID,
gboolean visible)
@ -357,6 +569,17 @@ gimp_layer_set_visible (gint32 layer_ID,
return success;
}
/**
* gimp_layer_get_preserve_trans:
* @layer_ID: The layer.
*
* Get the preserve transperancy setting of the specified layer.
*
* This procedure returns the specified layer's preserve transperancy
* setting.
*
* Returns: The layer's preserve transperancy setting.
*/
gboolean
gimp_layer_get_preserve_trans (gint32 layer_ID)
{
@ -377,6 +600,18 @@ gimp_layer_get_preserve_trans (gint32 layer_ID)
return preserve_trans;
}
/**
* gimp_layer_set_preserve_trans:
* @layer_ID: The layer.
* @preserve_trans: The new layer's preserve transperancy setting.
*
* Set the preserve transperancy setting of the specified layer.
*
* This procedure sets the specified layer's preserve transperancy
* setting.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_preserve_trans (gint32 layer_ID,
gboolean preserve_trans)
@ -398,6 +633,18 @@ gimp_layer_set_preserve_trans (gint32 layer_ID,
return success;
}
/**
* gimp_layer_get_apply_mask:
* @layer_ID: The layer.
*
* Get the apply mask setting of the specified layer.
*
* This procedure returns the specified layer's apply mask setting. If
* the value is non-zero, then the layer mask for this layer is
* currently being composited with the layer's alpha channel.
*
* Returns: The layer's apply mask setting.
*/
gboolean
gimp_layer_get_apply_mask (gint32 layer_ID)
{
@ -418,6 +665,20 @@ gimp_layer_get_apply_mask (gint32 layer_ID)
return apply_mask;
}
/**
* gimp_layer_set_apply_mask:
* @layer_ID: The layer.
* @apply_mask: The new layer's apply mask setting.
*
* Set the apply mask setting of the specified layer.
*
* This procedure sets the specified layer's apply mask setting. This
* controls whether the layer's mask is currently affecting the alpha
* channel. If there is no layer mask, this function will return an
* error.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_apply_mask (gint32 layer_ID,
gboolean apply_mask)
@ -439,6 +700,18 @@ gimp_layer_set_apply_mask (gint32 layer_ID,
return success;
}
/**
* gimp_layer_get_show_mask:
* @layer_ID: The layer.
*
* Get the show mask setting of the specified layer.
*
* This procedure returns the specified layer's show mask setting. If
* the value is non-zero, then the layer mask for this layer is
* currently being shown instead of the layer.
*
* Returns: The layer's show mask setting.
*/
gboolean
gimp_layer_get_show_mask (gint32 layer_ID)
{
@ -459,6 +732,20 @@ gimp_layer_get_show_mask (gint32 layer_ID)
return show_mask;
}
/**
* gimp_layer_set_show_mask:
* @layer_ID: The layer.
* @show_mask: The new layer's show mask setting.
*
* Set the show mask setting of the specified layer.
*
* This procedure sets the specified layer's show mask setting. This
* controls whether the layer or it's mask is visible. Non-zero values
* indicate that the mask should be visible. If the layer has no mask,
* then this function returns an error.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_show_mask (gint32 layer_ID,
gboolean show_mask)
@ -480,6 +767,18 @@ gimp_layer_set_show_mask (gint32 layer_ID,
return success;
}
/**
* gimp_layer_get_edit_mask:
* @layer_ID: The layer.
*
* Get the show mask setting of the specified layer.
*
* This procedure returns the specified layer's show mask setting. If
* the value is non-zero, then the layer mask for this layer is
* currently active, and not the layer.
*
* Returns: The layer's show mask setting.
*/
gboolean
gimp_layer_get_edit_mask (gint32 layer_ID)
{
@ -500,6 +799,20 @@ gimp_layer_get_edit_mask (gint32 layer_ID)
return edit_mask;
}
/**
* gimp_layer_set_edit_mask:
* @layer_ID: The layer.
* @edit_mask: The new layer's show mask setting.
*
* Set the show mask setting of the specified layer.
*
* This procedure sets the specified layer's show mask setting. This
* controls whether the layer or it's mask is currently active for
* editing. If the specified layer has no layer mask, then this
* procedure will return an error.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_edit_mask (gint32 layer_ID,
gboolean edit_mask)
@ -521,6 +834,16 @@ gimp_layer_set_edit_mask (gint32 layer_ID,
return success;
}
/**
* gimp_layer_get_opacity:
* @layer_ID: The layer.
*
* Get the opacity of the specified layer.
*
* This procedure returns the specified layer's opacity.
*
* Returns: The layer opacity.
*/
gdouble
gimp_layer_get_opacity (gint32 layer_ID)
{
@ -541,6 +864,17 @@ gimp_layer_get_opacity (gint32 layer_ID)
return opacity;
}
/**
* gimp_layer_set_opacity:
* @layer_ID: The layer.
* @opacity: The new layer opacity.
*
* Set the opacity of the specified layer.
*
* This procedure sets the specified layer's opacity.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_opacity (gint32 layer_ID,
gdouble opacity)
@ -562,6 +896,16 @@ gimp_layer_set_opacity (gint32 layer_ID,
return success;
}
/**
* gimp_layer_get_mode:
* @layer_ID: The layer.
*
* Get the combination mode of the specified layer.
*
* This procedure returns the specified layer's combination mode.
*
* Returns: The layer combination mode.
*/
GimpLayerModeEffects
gimp_layer_get_mode (gint32 layer_ID)
{
@ -582,6 +926,17 @@ gimp_layer_get_mode (gint32 layer_ID)
return mode;
}
/**
* gimp_layer_set_mode:
* @layer_ID: The layer.
* @mode: The new layer combination mode.
*
* Set the combination mode of the specified layer.
*
* This procedure sets the specified layer's combination mode.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_mode (gint32 layer_ID,
GimpLayerModeEffects mode)
@ -603,6 +958,16 @@ gimp_layer_set_mode (gint32 layer_ID,
return success;
}
/**
* gimp_layer_get_linked:
* @layer_ID: The layer.
*
* Get the linked state of the specified layer.
*
* This procedure returns the specified layer's linked state.
*
* Returns: The layer linked state (for moves).
*/
gboolean
gimp_layer_get_linked (gint32 layer_ID)
{
@ -623,6 +988,17 @@ gimp_layer_get_linked (gint32 layer_ID)
return linked;
}
/**
* gimp_layer_set_linked:
* @layer_ID: The layer.
* @linked: The new layer linked state.
*
* Set the linked state of the specified layer.
*
* This procedure sets the specified layer's linked state.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_linked (gint32 layer_ID,
gboolean linked)
@ -644,6 +1020,18 @@ gimp_layer_set_linked (gint32 layer_ID,
return success;
}
/**
* gimp_layer_get_tattoo:
* @layer_ID: The layer.
*
* Get the tattoo of the specified layer.
*
* This procedure returns the specified layer's tattoo. A tattoo is a
* unique and permanent identifier attached to a layer that can be used
* to uniquely identify a layer within an image even between sessions
*
* Returns: The layer tattoo.
*/
gint
gimp_layer_get_tattoo (gint32 layer_ID)
{
@ -664,6 +1052,19 @@ gimp_layer_get_tattoo (gint32 layer_ID)
return tattoo;
}
/**
* gimp_layer_set_tattoo:
* @layer_ID: The layer.
* @tattoo: The new layer tattoo.
*
* Set the tattoo of the specified layer.
*
* This procedure sets the specified layer's tattoo. A tattoo is a
* unique and permanent identifier attached to a layer that can be used
* to uniquely identify a layer within an image even between sessions
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_set_tattoo (gint32 layer_ID,
gint tattoo)

View file

@ -23,6 +23,17 @@
#include "gimp.h"
/**
* gimp_message:
* @message: Message to display in the dialog.
*
* Displays a dialog box with a message.
*
* Displays a dialog box with a message. Useful for status or error
* reporting.
*
* Returns: TRUE on success.
*/
gboolean
gimp_message (gchar *message)
{
@ -42,6 +53,17 @@ gimp_message (gchar *message)
return success;
}
/**
* gimp_message_get_handler:
*
* Returns the current state of where warning messages are displayed.
*
* This procedure returns the way g_message warnings are displayed.
* They can be shown in a dialog box or printed on the console where
* gimp was started.
*
* Returns: The current handler type.
*/
GimpMessageHandlerType
gimp_message_get_handler (void)
{
@ -61,6 +83,18 @@ gimp_message_get_handler (void)
return handler;
}
/**
* gimp_message_set_handler:
* @handler: The new handler type.
*
* Controls where warning messages are displayed.
*
* This procedure controls how g_message warnings are displayed. They
* can be shown in a dialog box or printed on the console where gimp
* was started.
*
* Returns: TRUE on success.
*/
gboolean
gimp_message_set_handler (GimpMessageHandlerType handler)
{

View file

@ -23,6 +23,16 @@
#include "gimp.h"
/**
* gimp_version:
*
* Returns the host gimp version.
*
* This procedure returns the version number of the currently running
* gimp.
*
* Returns: The gimp version.
*/
gchar *
gimp_version (void)
{

View file

@ -23,6 +23,20 @@
#include "gimp.h"
/**
* gimp_palette_get_foreground:
* @red:
* @green:
* @blue: The foreground color.
*
* Get the current GIMP foreground color.
*
* This procedure retrieves the current GIMP foreground color. The
* foreground color is used in a variety of tools such as paint tools,
* blending, and bucket fill.
*
* Returns: TRUE on success.
*/
gboolean
gimp_palette_get_foreground (guchar *red,
guchar *green,
@ -50,6 +64,20 @@ gimp_palette_get_foreground (guchar *red,
return success;
}
/**
* gimp_palette_get_background:
* @red:
* @green:
* @blue: The background color.
*
* Get the current GIMP background color.
*
* This procedure retrieves the current GIMP background color. The
* background color is used in a variety of tools such as blending,
* erasing (with non-alpha images), and image filling.
*
* Returns: TRUE on success.
*/
gboolean
gimp_palette_get_background (guchar *red,
guchar *green,
@ -77,6 +105,20 @@ gimp_palette_get_background (guchar *red,
return success;
}
/**
* gimp_palette_set_foreground:
* @red:
* @green:
* @blue: The foreground color.
*
* Set the current GIMP foreground color.
*
* This procedure sets the current GIMP foreground color. After this is
* set, operations which use foreground such as paint tools, blending,
* and bucket fill will use the new value.
*
* Returns: TRUE on success.
*/
gboolean
gimp_palette_set_foreground (guchar red,
guchar green,
@ -103,6 +145,21 @@ gimp_palette_set_foreground (guchar red,
return success;
}
/**
* gimp_palette_set_background:
* @red:
* @green:
* @blue: The background color.
*
* Set the current GIMP background color.
*
* This procedure sets the current GIMP background color. After this is
* set, operations which use background such as blending, filling
* images, clearing, and erasing (in non-alpha images) will use the new
* value.
*
* Returns: TRUE on success.
*/
gboolean
gimp_palette_set_background (guchar red,
guchar green,
@ -129,6 +186,17 @@ gimp_palette_set_background (guchar red,
return success;
}
/**
* gimp_palette_set_default_colors:
*
* Set the current GIMP foreground and background colors to black and
* white.
*
* This procedure sets the current GIMP foreground and background
* colors to their initial default values, black and white.
*
* Returns: TRUE on success.
*/
gboolean
gimp_palette_set_default_colors (void)
{
@ -147,6 +215,17 @@ gimp_palette_set_default_colors (void)
return success;
}
/**
* gimp_palette_swap_colors:
*
* Swap the current GIMP foreground and background colors.
*
* This procedure swaps the current GIMP foreground and background
* colors, so that the new foreground color becomes the old background
* color and vice versa.
*
* Returns: TRUE on success.
*/
gboolean
gimp_palette_swap_colors (void)
{
@ -165,6 +244,16 @@ gimp_palette_swap_colors (void)
return success;
}
/**
* gimp_palette_refresh:
*
* Refreshes current palettes.
*
* This procedure incorporates all palettes currently in the users
* palette path.
*
* Returns: TRUE on success.
*/
gboolean
gimp_palette_refresh (void)
{

View file

@ -23,6 +23,17 @@
#include "gimp.h"
/**
* gimp_parasite_find:
* @name: The name of the parasite to find.
*
* Finds the named parasite.
*
* Finds and returns the named parasite that was previously attached to
* the gimp.
*
* Returns: The found parasite.
*/
GimpParasite *
gimp_parasite_find (gchar *name)
{
@ -43,6 +54,17 @@ gimp_parasite_find (gchar *name)
return parasite;
}
/**
* gimp_parasite_attach:
* @parasite: The parasite to attach to the gimp.
*
* Add a parasite to the gimp.
*
* This procedure attaches a parasite to the gimp. It has no return
* values.
*
* Returns: TRUE on success.
*/
gboolean
gimp_parasite_attach (GimpParasite *parasite)
{
@ -62,6 +84,17 @@ gimp_parasite_attach (GimpParasite *parasite)
return success;
}
/**
* gimp_parasite_detach:
* @name: The name of the parasite to detach from the gimp.
*
* Removes a parasite from the gimp.
*
* This procedure detaches a parasite from the gimp. It has no return
* values.
*
* Returns: TRUE on success.
*/
gboolean
gimp_parasite_detach (gchar *name)
{
@ -81,6 +114,17 @@ gimp_parasite_detach (gchar *name)
return success;
}
/**
* gimp_parasite_list:
* @num_parasites: The number of attached parasites.
* @parasites: The names of currently attached parasites.
*
* List all parasites.
*
* Returns a list of all currently attached parasites.
*
* Returns: TRUE on success.
*/
gboolean
gimp_parasite_list (gint *num_parasites,
gchar ***parasites)
@ -112,6 +156,18 @@ gimp_parasite_list (gint *num_parasites,
return success;
}
/**
* gimp_drawable_parasite_find:
* @drawable_ID: The drawable.
* @name: The name of the parasite to find.
*
* Finds the named parasite in a drawable
*
* Finds and returns the named parasite that was previously attached to
* a drawable.
*
* Returns: The found parasite.
*/
GimpParasite *
gimp_drawable_parasite_find (gint32 drawable_ID,
gchar *name)
@ -134,6 +190,18 @@ gimp_drawable_parasite_find (gint32 drawable_ID,
return parasite;
}
/**
* gimp_drawable_parasite_attach:
* @drawable_ID: The drawable.
* @parasite: The parasite to attach to a drawable.
*
* Add a parasite to a drawable.
*
* This procedure attaches a parasite to a drawable. It has no return
* values.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_parasite_attach (gint32 drawable_ID,
GimpParasite *parasite)
@ -155,6 +223,18 @@ gimp_drawable_parasite_attach (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_parasite_detach:
* @drawable_ID: The drawable.
* @name: The name of the parasite to detach from a drawable.
*
* Removes a parasite from a drawable.
*
* This procedure detaches a parasite from a drawable. It has no return
* values.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_parasite_detach (gint32 drawable_ID,
gchar *name)
@ -176,6 +256,18 @@ gimp_drawable_parasite_detach (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_parasite_list:
* @drawable_ID: The drawable.
* @num_parasites: The number of attached parasites.
* @parasites: The names of currently attached parasites.
*
* List all parasites.
*
* Returns a list of all currently attached parasites.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_parasite_list (gint32 drawable_ID,
gint *num_parasites,
@ -209,6 +301,18 @@ gimp_drawable_parasite_list (gint32 drawable_ID,
return success;
}
/**
* gimp_image_parasite_find:
* @image_ID: The image.
* @name: The name of the parasite to find.
*
* Finds the named parasite in an image
*
* Finds and returns the named parasite that was previously attached to
* an image.
*
* Returns: The found parasite.
*/
GimpParasite *
gimp_image_parasite_find (gint32 image_ID,
gchar *name)
@ -231,6 +335,18 @@ gimp_image_parasite_find (gint32 image_ID,
return parasite;
}
/**
* gimp_image_parasite_attach:
* @image_ID: The image.
* @parasite: The parasite to attach to an image.
*
* Add a parasite to an image.
*
* This procedure attaches a parasite to an image. It has no return
* values.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_parasite_attach (gint32 image_ID,
GimpParasite *parasite)
@ -252,6 +368,18 @@ gimp_image_parasite_attach (gint32 image_ID,
return success;
}
/**
* gimp_image_parasite_detach:
* @image_ID: The image.
* @name: The name of the parasite to detach from an image.
*
* Removes a parasite from an image.
*
* This procedure detaches a parasite from an image. It has no return
* values.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_parasite_detach (gint32 image_ID,
gchar *name)
@ -273,6 +401,18 @@ gimp_image_parasite_detach (gint32 image_ID,
return success;
}
/**
* gimp_image_parasite_list:
* @image_ID: The image.
* @num_parasites: The number of attached parasites.
* @parasites: The names of currently attached parasites.
*
* List all parasites.
*
* Returns a list of all currently attached parasites.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_parasite_list (gint32 image_ID,
gint *num_parasites,

View file

@ -23,6 +23,17 @@
#include "gimp.h"
/**
* gimp_path_list:
* @image_ID: The ID of the image to list the paths from.
* @num_paths: The number of paths returned.
*
* List the paths associated with the passed image.
*
* List the paths associated with the passed image.
*
* Returns: List of the paths belonging to this image.
*/
gchar **
gimp_path_list (gint32 image_ID,
gint *num_paths)
@ -52,6 +63,20 @@ gimp_path_list (gint32 image_ID,
return path_list;
}
/**
* gimp_path_get_points:
* @image_ID: The ID of the image to list the paths from.
* @pathname: the name of the path whose points should be listed.
* @path_closed: Return if the path is closed. {0=path open, 1= path closed}.
* @num_path_point_details: The number of points returned. Each point is made up of (x,y,pnt_type) of floats.
* @points_pairs: The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be {1.0= BEZIER_ANCHOR, 2.0= BEZIER_CONTROL}. Note all points are returned in pixel resolution.
*
* List the points associated with the named path.
*
* List the points associated with the named path.
*
* Returns: The type of the path. Currently only one type (1 = Bezier) is supported.
*/
gint
gimp_path_get_points (gint32 image_ID,
gchar *pathname,
@ -86,6 +111,16 @@ gimp_path_get_points (gint32 image_ID,
return path_type;
}
/**
* gimp_path_get_current:
* @image_ID: The ID of the image to get the current paths from.
*
* The name of the current path. Error if no paths.
*
* The name of the current path. Error if no paths.
*
* Returns: The name of the current path.
*/
gchar *
gimp_path_get_current (gint32 image_ID)
{
@ -106,6 +141,17 @@ gimp_path_get_current (gint32 image_ID)
return current_path_name;
}
/**
* gimp_path_set_current:
* @image_ID: The ID of the image to list set the paths in.
* @set_current_path_name: The name of the path to set the current path to.
*
* List the paths associated with the passed image.
*
* List the paths associated with the passed image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_path_set_current (gint32 image_ID,
gchar *set_current_path_name)
@ -127,6 +173,20 @@ gimp_path_set_current (gint32 image_ID,
return success;
}
/**
* gimp_path_set_points:
* @image_ID: The ID of the image to set the paths in.
* @pathname: The name of the path to create (if it exists then a unique name will be created - query the list of paths if you want to make sure that the name of the path you create is unique. This will be set as the current path.
* @ptype: The type of the path. Currently only one type (1 = Bezier) is supported.
* @num_path_points: The number of points in the path. Each point is made up of (x,y,type) of floats. Currently only the creation of bezier curves is allowed. The type parameter must be set to (1) to indicate a BEZIER type curve. For BEZIERS. Note the that points must be given in the following order... ACCACCAC ... If the path is not closed the last control point is missed off. Points consist of three control points (control/anchor/control) so for a curve that is not closed there must be at least two points passed (2 x,y pairs). If num_path_pnts % 3 = 0 then the path is assumed to be closed and the points are ACCACCACCACC.
* @points_pairs: The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be {1.0= BEZIER_ANCHOR, 2.0= BEZIER_CONTROL}. Note all points are returned in pixel resolution.
*
* Set the points associated with the named path.
*
* Set the points associated with the named path.
*
* Returns: TRUE on success.
*/
gboolean
gimp_path_set_points (gint32 image_ID,
gchar *pathname,
@ -154,6 +214,16 @@ gimp_path_set_points (gint32 image_ID,
return success;
}
/**
* gimp_path_stroke_current:
* @image_ID: The ID of the image which contains the path to stroke.
*
* Stroke the current path in the passed image.
*
* Stroke the current path in the passed image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_path_stroke_current (gint32 image_ID)
{
@ -173,6 +243,24 @@ gimp_path_stroke_current (gint32 image_ID)
return success;
}
/**
* gimp_path_get_point_at_dist:
* @image_ID: The ID of the image the paths belongs to.
* @distance: The distance along the path.
* @y_point: The y position of the point.
* @gradient: The gradient at the specified point.
*
* Get point on a path at a specified distance along the path.
*
* This will return the x,y position of a point at a given distance
* along the bezier curve. The distance will the obtained by first
* digitizing the curve internally an then walking along the curve. For
* a closed curve the start of the path is the first point on the path
* that was created. This might not be obvious. Note the current path
* is used.
*
* Returns: The x position of the point.
*/
gint
gimp_path_get_point_at_dist (gint32 image_ID,
gdouble distance,
@ -201,6 +289,20 @@ gimp_path_get_point_at_dist (gint32 image_ID,
return x_point;
}
/**
* gimp_path_get_tattoo:
* @image_ID: The image.
* @pathname: the name of the path whose tattoo should be obtained.
*
* Returns the tattoo associated with the name path.
*
* This procedure returns the tattoo associated with the specified
* path. A tattoo is a unique and permanent identifier attached to a
* path that can be used to uniquely identify a path within an image
* even between sessions.
*
* Returns: The tattoo associated with the name path.
*/
gint
gimp_path_get_tattoo (gint32 image_ID,
gchar *pathname)
@ -223,6 +325,21 @@ gimp_path_get_tattoo (gint32 image_ID,
return tattoo;
}
/**
* gimp_get_path_by_tattoo:
* @image_ID: The image.
* @tattoo: The tattoo of the required path.
*
* Return the name of the path with the given tattoo.
*
* The procedure returns the name of the path in the specified image
* which has the passed tattoo. The tattoos are unique within the image
* and will be preserved across sessions and through renaming of the
* path. An error is returned if no path woth the specified tattoo can
* be found.
*
* Returns: The name of the path with the specified tattoo.
*/
gchar *
gimp_get_path_by_tattoo (gint32 image_ID,
gint tattoo)
@ -245,6 +362,17 @@ gimp_get_path_by_tattoo (gint32 image_ID,
return path_name;
}
/**
* gimp_path_delete:
* @image_ID: The ID of the image to list delete the paths from.
* @path_name_to_del: The name of the path to delete.
*
* Delete the named paths associated with the passed image.
*
* Delete the named path.
*
* Returns: TRUE on success.
*/
gboolean
gimp_path_delete (gint32 image_ID,
gchar *path_name_to_del)
@ -266,6 +394,19 @@ gimp_path_delete (gint32 image_ID,
return success;
}
/**
* gimp_path_get_locked:
* @image_ID: The image.
* @pathname: the name of the path whose locked status should be obtained.
*
* Returns the locked status associated with the name path.
*
* This procedure returns the lock status associated with the specified
* path. A path can be \"locked\" which means that the transformation
* tool operations will also apply to the path.
*
* Returns: The lock status associated with the name path. 0 returned if the path is not locked. 1 is returned if the path is locked.
*/
gint
gimp_path_get_locked (gint32 image_ID,
gchar *pathname)
@ -288,6 +429,20 @@ gimp_path_get_locked (gint32 image_ID,
return lockstatus;
}
/**
* gimp_path_set_locked:
* @image_ID: The image.
* @pathname: the name of the path whose locked status should be set.
* @lockstatus: The lock status associated with the name path. 0 if the path is not locked. 1 if the path is to be locked.
*
* Set the locked status associated with the name path.
*
* This procedure sets the lock status associated with the specified
* path. A path can be \"locked\" which means that the transformation
* tool operations will also apply to the path.
*
* Returns: TRUE on success.
*/
gboolean
gimp_path_set_locked (gint32 image_ID,
gchar *pathname,
@ -311,6 +466,22 @@ gimp_path_set_locked (gint32 image_ID,
return success;
}
/**
* gimp_path_set_tattoo:
* @image_ID: The image.
* @pathname: the name of the path whose tattoo should be set.
* @tattovalue: The tattoo associated with the name path. Only values returned from 'path_get_tattoo' should be used here.
*
* Sets the tattoo associated with the name path.
*
* This procedure sets the tattoo associated with the specified path. A
* tattoo is a unique and permenant identifier attached to a path that
* can be used to uniquely identify a path within an image even between
* sessions. Note that the value passed to this function must have been
* obtained from a previous call to path_get_tattoo.
*
* Returns: TRUE on success.
*/
gboolean
gimp_path_set_tattoo (gint32 image_ID,
gchar *pathname,

View file

@ -23,6 +23,24 @@
#include "gimp.h"
/**
* gimp_patterns_get_pattern_data:
* @name: the pattern name (\"\" means current active pattern).
* @width: The pattern width.
* @height: The pattern height.
* @mask_bpp: Pattern bytes per pixel.
* @length: Length of pattern mask data.
* @mask_data: The pattern mask data.
*
* Retrieve information about the currently active pattern (including
* data).
*
* This procedure retrieves information about the currently active
* pattern. This includes the pattern name, and the pattern extents
* (width and height). It also returns the pattern data.
*
* Returns: The pattern name.
*/
gchar *
gimp_patterns_get_pattern_data (gchar *name,
gint *width,

View file

@ -23,6 +23,18 @@
#include "gimp.h"
/**
* gimp_patterns_popup:
* @pattern_callback: The callback PDB proc to call when pattern selection is made.
* @popup_title: Title to give the pattern popup window.
* @initial_pattern: The name of the pattern to set as the first selected.
*
* Invokes the Gimp pattern selection.
*
* This procedure popups the pattern selection dialog.
*
* Returns: TRUE on success.
*/
gboolean
gimp_patterns_popup (gchar *pattern_callback,
gchar *popup_title,
@ -46,6 +58,16 @@ gimp_patterns_popup (gchar *pattern_callback,
return success;
}
/**
* gimp_patterns_close_popup:
* @pattern_callback: The name of the callback registered for this popup.
*
* Popdown the Gimp pattern selection.
*
* This procedure closes an opened pattern selection dialog.
*
* Returns: TRUE on success.
*/
gboolean
gimp_patterns_close_popup (gchar *pattern_callback)
{
@ -65,6 +87,17 @@ gimp_patterns_close_popup (gchar *pattern_callback)
return success;
}
/**
* gimp_patterns_set_popup:
* @pattern_callback: The name of the callback registered for this popup.
* @pattern_name: The name of the pattern to set as selected.
*
* Sets the current pattern selection in a popup.
*
* Sets the current pattern selection in a popup.
*
* Returns: TRUE on success.
*/
gboolean
gimp_patterns_set_popup (gchar *pattern_callback,
gchar *pattern_name)

View file

@ -23,6 +23,18 @@
#include "gimp.h"
/**
* gimp_progress_init:
* @message: Message to use in the progress dialog.
*
* Initializes the progress bar for the current plug-in.
*
* Initializes the progress bar for the current plug-in. It is only
* valid to call this procedure from a plug-in.
*
* Returns: TRUE on success.
*/
gboolean
gimp_progress_init (gchar *message)
{
@ -43,6 +55,17 @@ gimp_progress_init (gchar *message)
return success;
}
/**
* gimp_progress_update:
* @percentage: Percentage of progress completed.
*
* Updates the progress bar for the current plug-in.
*
* Updates the progress bar for the current plug-in. It is only valid
* to call this procedure from a plug-in.
*
* Returns: TRUE on success.
*/
gboolean
gimp_progress_update (gdouble percentage)
{
@ -62,6 +85,17 @@ gimp_progress_update (gdouble percentage)
return success;
}
/**
* gimp_temp_PDB_name:
*
* Generates a unique temporary PDB name.
*
* This procedure generates a temporary PDB entry name that is
* guaranteed to be unique. It is many used by the interactive popup
* dialogs to generate a PDB entry name.
*
* Returns: A unique temporary name for a temporary PDB entry.
*/
gchar *
gimp_temp_PDB_name (void)
{
@ -81,6 +115,24 @@ gimp_temp_PDB_name (void)
return temp_name;
}
/**
* gimp_plugin_domain_register:
* @domain_name: The name of the textdomain (must be unique).
* @domain_path: The absolute path to the compiled message catalog (may be NULL).
*
* Registers a textdomain for localisation.
*
* This procedure adds a textdomain to the list of domains Gimp
* searches for strings when translating its menu entries. There is no
* need to call this function for plug-ins that have their strings
* included in the gimp-std-plugins domain as that is used by default.
* If the compiled message catalog is not in the standard location, you
* may specify an absolute path to another location. This procedure can
* only be called in the query function of a plug-in and it has to be
* called before any procedure is installed.
*
* Returns: TRUE on success.
*/
gboolean
gimp_plugin_domain_register (gchar *domain_name,
gchar *domain_path)
@ -102,6 +154,20 @@ gimp_plugin_domain_register (gchar *domain_name,
return success;
}
/**
* gimp_plugin_help_register:
* @help_path: The rootdir of the plug-in's help pages.
*
* Register a help path for a plug-in.
*
* This procedure changes the help rootdir for the plug-in which calls
* it. All subsequent calls of gimp_help from this plug-in will be
* interpreted relative to this rootdir. This procedure can only be
* called in the query function of a plug-in and it has to be called
* before any procedure is installed.
*
* Returns: TRUE on success.
*/
gboolean
gimp_plugin_help_register (gchar *help_path)
{

View file

@ -23,6 +23,20 @@
#include "gimp.h"
/**
* gimp_procedural_db_dump:
* @filename: The dump filename.
*
* Dumps the current contents of the procedural database
*
* This procedure dumps the contents of the procedural database to the
* specified file. The file will contain all of the information
* provided for each registered procedure. This file is in a format
* appropriate for use with the supplied \"pdb_self_doc.el\" Elisp
* script, which generates a texinfo document.
*
* Returns: TRUE on success.
*/
gboolean
gimp_procedural_db_dump (gchar *filename)
{
@ -42,6 +56,36 @@ gimp_procedural_db_dump (gchar *filename)
return success;
}
/**
* gimp_procedural_db_query:
* @name: The regex for procedure name.
* @blurb: The regex for procedure blurb.
* @help: The regex for procedure help.
* @author: The regex for procedure author.
* @copyright: The regex for procedure copyright.
* @date: The regex for procedure date.
* @proc_type: The regex for procedure type: { 'Internal GIMP procedure', 'GIMP Plug-in', 'GIMP Extension' }.
* @num_matches: The number of matching procedures.
* @procedure_names: The list of procedure names.
*
* Queries the procedural database for its contents using regular
* expression matching.
*
* This procedure queries the contents of the procedural database. It
* is supplied with seven arguments matching procedures on { name,
* blurb, help, author, copyright, date, procedure type}. This is
* accomplished using regular expression matching. For instance, to
* find all procedures with \"jpeg\" listed in the blurb, all seven
* arguments can be supplied as \".*\", except for the second, which
* can be supplied as \".*jpeg.*\". There are two return arguments for
* this procedure. The first is the number of procedures matching the
* query. The second is a concatenated list of procedure names
* corresponding to those matching the query. If no matching entries
* are found, then the returned string is NULL and the number of
* entries is 0.
*
* Returns: TRUE on success.
*/
gboolean
gimp_procedural_db_query (gchar *name,
gchar *blurb,
@ -87,6 +131,30 @@ gimp_procedural_db_query (gchar *name,
return success;
}
/**
* _gimp_procedural_db_proc_info:
* @procedure: The procedure name.
* @blurb: A short blurb.
* @help: Detailed procedure help.
* @author: Author(s) of the procedure.
* @copyright: The copyright.
* @date: Copyright date.
* @proc_type: The procedure type.
* @num_args: The number of input arguments.
* @num_values: The number of return values.
*
* Queries the procedural database for information on the specified
* procedure.
*
* This procedure returns information on the specified procedure. A
* short blurb, detailed help, author(s), copyright information,
* procedure type, number of input, and number of return values are
* returned. For specific information on each input argument and return
* value, use the 'gimp_procedural_db_proc_arg' and
* 'gimp_procedural_db_proc_val' procedures.
*
* Returns: TRUE on success.
*/
gboolean
_gimp_procedural_db_proc_info (gchar *procedure,
gchar **blurb,
@ -135,6 +203,22 @@ _gimp_procedural_db_proc_info (gchar *procedure,
return success;
}
/**
* gimp_procedural_db_proc_arg:
* @procedure: The procedure name.
* @arg_num: The argument number.
* @arg_type: The type of argument.
* @arg_name: The name of the argument.
* @arg_desc: A description of the argument.
*
* Queries the procedural database for information on the specified
* procedure's argument.
*
* This procedure returns information on the specified procedure's
* argument. The argument type, name, and a description are retrieved.
*
* Returns: TRUE on success.
*/
gboolean
gimp_procedural_db_proc_arg (gchar *procedure,
gint arg_num,
@ -170,6 +254,23 @@ gimp_procedural_db_proc_arg (gchar *procedure,
return success;
}
/**
* gimp_procedural_db_proc_val:
* @procedure: The procedure name.
* @val_num: The return value number.
* @val_type: The type of return value.
* @val_name: The name of the return value.
* @val_desc: A description of the return value.
*
* Queries the procedural database for information on the specified
* procedure's return value.
*
* This procedure returns information on the specified procedure's
* return value. The return value type, name, and a description are
* retrieved.
*
* Returns: TRUE on success.
*/
gboolean
gimp_procedural_db_proc_val (gchar *procedure,
gint val_num,
@ -205,6 +306,21 @@ gimp_procedural_db_proc_val (gchar *procedure,
return success;
}
/**
* _gimp_procedural_db_get_data:
* @identifier: The identifier associated with data.
* @bytes: The number of bytes in the data.
* @data: A byte array containing data.
*
* Returns data associated with the specified identifier.
*
* This procedure returns any data which may have been associated with
* the specified identifier. The data is a variable length array of
* bytes. If no data has been associated with the identifier, an error
* is returned.
*
* Returns: TRUE on success.
*/
gboolean
_gimp_procedural_db_get_data (gchar *identifier,
gint *bytes,
@ -237,6 +353,18 @@ _gimp_procedural_db_get_data (gchar *identifier,
return success;
}
/**
* gimp_procedural_db_get_data_size:
* @identifier: The identifier associated with data.
*
* Returns size of data associated with the specified identifier.
*
* This procedure returns the size of any data which may have been
* associated with the specified identifier. If no data has been
* associated with the identifier, an error is returned.
*
* Returns: The number of bytes in the data.
*/
gint
gimp_procedural_db_get_data_size (gchar *identifier)
{
@ -257,6 +385,20 @@ gimp_procedural_db_get_data_size (gchar *identifier)
return bytes;
}
/**
* _gimp_procedural_db_set_data:
* @identifier: The identifier associated with data.
* @bytes: The number of bytes in the data.
* @data: A byte array containing data.
*
* Associates the specified identifier with the supplied data.
*
* This procedure associates the supplied data with the provided
* identifier. The data may be subsequently retrieved by a call to
* 'procedural-db-get-data'.
*
* Returns: TRUE on success.
*/
gboolean
_gimp_procedural_db_set_data (gchar *identifier,
gint bytes,

View file

@ -23,6 +23,24 @@
#include "gimp.h"
/**
* gimp_selection_bounds:
* @image_ID: The image.
* @non_empty: True if there is a selection.
* @x1: x coordinate of upper left corner of selection bounds.
* @y1: y coordinate of upper left corner of selection bounds.
* @x2: x coordinate of lower right corner of selection bounds.
* @y2: 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.
*
* Returns: TRUE on success.
*/
gboolean
gimp_selection_bounds (gint32 image_ID,
gboolean *non_empty,
@ -62,6 +80,17 @@ gimp_selection_bounds (gint32 image_ID,
return success;
}
/**
* gimp_selection_is_empty:
* @image_ID: The image.
*
* Determine whether the selection is empty.
*
* This procedure returns non-zero if the selection for the specified
* image is not empty.
*
* Returns: Is the selection empty?
*/
gboolean
gimp_selection_is_empty (gint32 image_ID)
{
@ -82,6 +111,23 @@ gimp_selection_is_empty (gint32 image_ID)
return is_empty;
}
/**
* _gimp_selection_float:
* @drawable_ID: The drawable from which to float selection.
* @offx: x offset for translation.
* @offy: y offset for translation.
*
* Float the selection from the specified drawable with initial offsets
* as specified.
*
* This procedure determines the region of the specified drawable that
* lies beneath the current selection. The region is then cut from the
* drawable and the resulting data is made into a new layer which is
* instantiated as a floating selection. The offsets allow initial
* positioning of the new floating selection.
*
* Returns: The floated layer.
*/
gint32
_gimp_selection_float (gint32 drawable_ID,
gint offx,
@ -106,6 +152,17 @@ _gimp_selection_float (gint32 drawable_ID,
return layer_ID;
}
/**
* gimp_selection_none:
* @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)
{

View file

@ -23,6 +23,42 @@
#include "gimp.h"
/**
* gimp_text_fontname:
* @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.
* @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 fontname (conforming to the X Logical Font Description Conventions).
*
* Add text at the specified location as a floating selection or a new
* layer.
*
* This tool requires font information as a fontname conforming to the
* 'X Logical Font Description Conventions'. 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 antialias
* parameter is non-zero, the generated text will blend more smoothly
* with underlying layers. This option requires more time and memory to
* compute than non-antialiased text; the resulting floating selection
* or layer, however, will require the same amount of memory with or
* without antialiasing. 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. If the border
* is specified as -1, empty spaces around the text will not be
* cropped.
*
* Returns: The new text layer.
*/
gint32
gimp_text_fontname (gint32 image_ID,
gint32 drawable_ID,
@ -61,6 +97,25 @@ gimp_text_fontname (gint32 image_ID,
return text_layer_ID;
}
/**
* gimp_text_get_extents_fontname:
* @text: The text to generate.
* @size: The size of text in either pixels or points.
* @size_type: The units of specified size.
* @fontname: The fontname (conforming to the X Logical Font Description Conventions).
* @width: The width of the specified font.
* @height: The height of the specified font.
* @ascent: The ascent of the specified font.
* @descent: The descent of the specified font.
*
* Get extents of the bounding box for the specified text.
*
* This tool returns the width and height of a bounding box for the
* specified text string with the specified font information. Ascent
* and descent for the specified font are returned as well.
*
* Returns: TRUE on success.
*/
gboolean
gimp_text_get_extents_fontname (gchar *text,
gdouble size,
@ -103,6 +158,49 @@ gimp_text_get_extents_fontname (gchar *text,
return success;
}
/**
* gimp_text:
* @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.
* @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.
* @foundry: The font foundry, \"*\" for any.
* @family: The font family, \"*\" for any.
* @weight: The font weight, \"*\" for any.
* @slant: The font slant, \"*\" for any.
* @set_width: The font set-width, \"*\" for any.
* @spacing: The font spacing, \"*\" for any.
* @registry: The font registry, \"*\" for any.
* @encoding: The font encoding, \"*\" for any.
*
* Add text at the specified location as a floating selection or a new
* layer.
*
* This tool requires font information in the form of nine parameters:
* size, foundry, family, weight, slant, set_width, spacing, registry,
* encoding. The font size can either be specified 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 antialias parameter is non-zero, the
* generated text will blend more smoothly with underlying layers. This
* option requires more time and memory to compute than non-antialiased
* text; the resulting floating selection or layer, however, will
* require the same amount of memory with or without antialiasing. 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. If the border is specified as -1,
* empty spaces around the text will not be cropped.
*
* Returns: The new text layer.
*/
gint32
gimp_text (gint32 image_ID,
gint32 drawable_ID,
@ -155,6 +253,32 @@ gimp_text (gint32 image_ID,
return text_layer_ID;
}
/**
* gimp_text_get_extents:
* @text: The text to generate.
* @size: The size of text in either pixels or points.
* @size_type: The units of specified size.
* @foundry: The font foundry, \"*\" for any.
* @family: The font family, \"*\" for any.
* @weight: The font weight, \"*\" for any.
* @slant: The font slant, \"*\" for any.
* @set_width: The font set-width, \"*\" for any.
* @spacing: The font spacing, \"*\" for any.
* @registry: The font registry, \"*\" for any.
* @encoding: The font encoding, \"*\" for any.
* @width: The width of the specified font.
* @height: The height of the specified font.
* @ascent: The ascent of the specified font.
* @descent: The descent of the specified font.
*
* Get extents of the bounding box for the specified text.
*
* This tool returns the width and height of a bounding box for the
* specified text string with the specified font information. Ascent
* and descent for the specified font are returned as well.
*
* Returns: TRUE on success.
*/
gboolean
gimp_text_get_extents (gchar *text,
gdouble size,

View file

@ -23,6 +23,23 @@
#include "gimp.h"
/**
* gimp_airbrush:
* @drawable_ID: The affected drawable.
* @pressure: The pressure of the airbrush strokes.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Paint in the current brush with varying pressure. Paint application
* is time-dependent.
*
* This tool simulates the use of an airbrush. Paint pressure
* represents the relative intensity of the paint application. High
* pressure results in a thicker layer of paint while low pressure
* results in a thinner layer.
*
* Returns: TRUE on success.
*/
gboolean
gimp_airbrush (gint32 drawable_ID,
gdouble pressure,
@ -48,6 +65,22 @@ gimp_airbrush (gint32 drawable_ID,
return success;
}
/**
* gimp_airbrush_default:
* @drawable_ID: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Paint in the current brush with varying pressure. Paint application
* is time-dependent.
*
* This tool simulates the use of an airbrush. It is similar to
* gimp_airbrush except that the pressure is derived from the airbrush
* tools options box. It the option has not been set the default for
* the option will be used.
*
* Returns: TRUE on success.
*/
gboolean
gimp_airbrush_default (gint32 drawable_ID,
gint num_strokes,
@ -71,6 +104,33 @@ gimp_airbrush_default (gint32 drawable_ID,
return success;
}
/**
* gimp_blend:
* @drawable_ID: The affected drawable.
* @blend_mode: The type of blend.
* @paint_mode: The paint application mode.
* @gradient_type: The type of gradient.
* @opacity: The opacity of the final blend.
* @offset: Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.
* @repeat: Repeat mode.
* @supersample: Do adaptive supersampling.
* @max_depth: Maximum recursion levels for supersampling.
* @threshold: Supersampling threshold.
* @x1: The x coordinate of this blend's starting point.
* @y1: The y coordinate of this blend's starting point.
* @x2: The x coordinate of this blend's ending point.
* @y2: The y coordinate of this blend's ending point.
*
* Blend between the starting and ending coordinates with the specified
* blend mode and gradient type.
*
* This tool requires information on the paint application mode, the
* blend mode, and the gradient type. It creates the specified variety
* of blend using the starting and ending coordinates as defined for
* each gradient type.
*
* Returns: TRUE on success.
*/
gboolean
gimp_blend (gint32 drawable_ID,
GimpBlendMode blend_mode,
@ -116,6 +176,35 @@ gimp_blend (gint32 drawable_ID,
return success;
}
/**
* gimp_bucket_fill:
* @drawable_ID: The affected drawable.
* @fill_mode: The type of fill.
* @paint_mode: The paint application mode.
* @opacity: The opacity of the final bucket fill.
* @threshold: The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels . This parameter is only valid when there is no selection in the specified image.
* @sample_merged: Use the composite image, not the drawable.
* @x: The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
* @y: The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
*
* Fill the area specified either by the current selection if there is
* one, or by a seed fill starting at the specified coordinates.
*
* This tool requires information on the paint application mode, and
* the fill mode, which can either be in the foreground color, or in
* the currently active pattern. If there is no selection, a seed fill
* is executed at the specified coordinates and extends outward in
* keeping with the threshold parameter. If there is a selection in the
* target image, the threshold, sample merged, x, and y arguments are
* unused. If the sample_merged parameter is non-zero, the data of the
* composite image will be used instead of that for the specified
* drawable. This is equivalent to sampling for colors after merging
* all visible layers. In the case of merged sampling, the x,y
* coordinates are relative to the image's origin; otherwise, they are
* relative to the drawable's origin.
*
* Returns: TRUE on success.
*/
gboolean
gimp_bucket_fill (gint32 drawable_ID,
GimpBucketFillMode fill_mode,
@ -149,6 +238,38 @@ gimp_bucket_fill (gint32 drawable_ID,
return success;
}
/**
* gimp_by_color_select:
* @drawable_ID: The affected drawable.
* @red:
* @green:
* @blue: The color to select.
* @threshold: Threshold in intensity levels %%desc%%.
* @operation: The selection operation.
* @antialias: Antialiasing.
* @feather: Feather option for selections.
* @feather_radius: Radius for feather operation.
* @sample_merged: Use the composite image, not the drawable.
*
* 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 specified threshold. Essentially, all pixels (in the
* drawable) that have color sufficiently close to the specified color
* (as determined by the threshold value) are included in the
* selection. The antialiasing parameter allows the final selection
* mask to contain intermediate values based on close misses to the
* threshold bar. Feathering can be enabled optionally and is
* controlled with the \"feather_radius\" parameter. If the
* sample_merged parameter is non-zero, the data of the composite image
* will be used instead of that for the specified drawable. This is
* equivalent to sampling for colors after merging all visible layers.
* In the case of a merged sampling, the supplied drawable is ignored.
*
* Returns: TRUE on success.
*/
gboolean
gimp_by_color_select (gint32 drawable_ID,
guchar red,
@ -189,6 +310,33 @@ gimp_by_color_select (gint32 drawable_ID,
return success;
}
/**
* gimp_clone:
* @drawable_ID: The affected drawable.
* @src_drawable_ID: The source drawable.
* @clone_type: The type of clone.
* @src_x: The x coordinate in the source image.
* @src_y: The y coordinate in the source image.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Clone from the source to the dest drawable using the current brush
*
* This tool clones (copies) from the source drawable starting at the
* specified source coordinates to the dest drawable. If the
* \"clone_type\" argument is set to PATTERN-CLONE, then the current
* pattern is used as the source and the \"src_drawable\" argument is
* ignored. Pattern cloning assumes a tileable pattern and mods the sum
* of the src coordinates and subsequent stroke offsets with the width
* and height of the pattern. For image cloning, if the sum of the src
* coordinates and subsequent stroke offsets exceeds the extents of the
* src drawable, then no paint is transferred. The clone tool is
* capable of transforming between any image types including
* RGB->Indexed--although converting from any type to indexed is
* significantly slower.
*
* Returns: TRUE on success.
*/
gboolean
gimp_clone (gint32 drawable_ID,
gint32 src_drawable_ID,
@ -220,6 +368,23 @@ gimp_clone (gint32 drawable_ID,
return success;
}
/**
* gimp_clone_default:
* @drawable_ID: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Clone from the source to the dest drawable using the current brush
*
* This tool clones (copies) from the source drawable starting at the
* specified source coordinates to the dest drawable. This function
* performs exactly the same as the gimp_clone function except that the
* tools arguments are obtained from the clones option dialog. It this
* dialog has not been activated then the dialogs default values will
* be used.
*
* Returns: TRUE on success.
*/
gboolean
gimp_clone_default (gint32 drawable_ID,
gint num_strokes,
@ -243,6 +408,36 @@ gimp_clone_default (gint32 drawable_ID,
return success;
}
/**
* gimp_color_picker:
* @image_ID: The image.
* @drawable_ID: The affected drawable.
* @x: x coordinate of upper-left corner of rectangle.
* @y: y coordinate of upper-left corner of rectangle.
* @sample_merged: Use the composite image, not the drawable.
* @sample_average: Average the color of all the pixels in a specified radius.
* @average_radius: The radius of pixels to average.
* @save_color: Save the color to the active palette.
* @red:
* @green:
* @blue: The return color.
*
* Determine the color at the given drawable coordinates
*
* This tool determines the color at the specified coordinates. The
* returned color is an RGB triplet even for grayscale and indexed
* drawables. If the coordinates lie outside of the extents of the
* specified drawable, then an error is returned. If the drawable has
* an alpha channel, the algorithm examines the alpha value of the
* drawable at the coordinates. If the alpha value is completely
* transparent (0), then an error is returned. If the sample_merged
* parameter is non-zero, the data of the composite image will be used
* instead of that for the specified drawable. This is equivalent to
* sampling for colors after merging all visible layers. In the case of
* a merged sampling, the supplied drawable is ignored.
*
* Returns: TRUE on success.
*/
gboolean
gimp_color_picker (gint32 image_ID,
gint32 drawable_ID,
@ -286,6 +481,23 @@ gimp_color_picker (gint32 image_ID,
return success;
}
/**
* gimp_convolve:
* @drawable_ID: The affected drawable.
* @pressure: The pressure.
* @convolve_type: Convolve type.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Convolve (Blur, Sharpen) using the current brush.
*
* This tool convolves the specified drawable with either a sharpening
* or blurring kernel. The pressure parameter controls the magnitude of
* the operation. Like the paintbrush, this tool linearly interpolates
* between the specified stroke coordinates.
*
* Returns: TRUE on success.
*/
gboolean
gimp_convolve (gint32 drawable_ID,
gdouble pressure,
@ -313,6 +525,22 @@ gimp_convolve (gint32 drawable_ID,
return success;
}
/**
* gimp_convolve_default:
* @drawable_ID: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Convolve (Blur, Sharpen) using the current brush.
*
* This tool convolves the specified drawable with either a sharpening
* or blurring kernel. This function performs exactly the same as the
* gimp_convolve function except that the tools arguments are obtained
* from the convolve option dialog. It this dialog has not been
* activated then the dialogs default values will be used.
*
* Returns: TRUE on success.
*/
gboolean
gimp_convolve_default (gint32 drawable_ID,
gint num_strokes,
@ -336,6 +564,25 @@ gimp_convolve_default (gint32 drawable_ID,
return success;
}
/**
* gimp_crop:
* @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_crop (gint32 image_ID,
gint new_width,
@ -363,6 +610,21 @@ gimp_crop (gint32 image_ID,
return success;
}
/**
* gimp_dodgeburn:
* @drawable_ID: The affected drawable.
* @exposure: The exposer of the strokes.
* @dodgeburn_type: The type either dodge or burn.
* @dodgeburn_mode: The mode.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Dodgeburn image with varying exposure.
*
* Dodgebure. More details here later.
*
* Returns: TRUE on success.
*/
gboolean
gimp_dodgeburn (gint32 drawable_ID,
gdouble exposure,
@ -392,6 +654,21 @@ gimp_dodgeburn (gint32 drawable_ID,
return success;
}
/**
* gimp_dodgeburn_default:
* @drawable_ID: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Dodgeburn image with varying exposure. This is the same as the
* gimp_dodgeburn function except that the exposure, type and mode are
* taken from the tools option dialog. If the dialog has not been
* activated then the defaults as used by the dialog will be used.
*
* Dodgebure. More details here later.
*
* Returns: TRUE on success.
*/
gboolean
gimp_dodgeburn_default (gint32 drawable_ID,
gint num_strokes,
@ -415,6 +692,32 @@ gimp_dodgeburn_default (gint32 drawable_ID,
return success;
}
/**
* gimp_ellipse_select:
* @image_ID: The image.
* @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.
* @operation: The selection operation.
* @antialias: Antialiasing.
* @feather: Feather option for selections.
* @feather_radius: Radius for feather operation.
*
* 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. If antialiasing
* is turned on, the edges of the elliptical region will contain
* intermediate values which give the appearance of a sharper, less
* pixelized edge. This should be set as TRUE most of the time. If the
* feather option is enabled, the resulting selection is blurred before
* combining. The blur is a gaussian blur with the specified feather
* radius.
*
* Returns: TRUE on success.
*/
gboolean
gimp_ellipse_select (gint32 image_ID,
gdouble x,
@ -450,6 +753,24 @@ gimp_ellipse_select (gint32 image_ID,
return success;
}
/**
* gimp_eraser:
* @drawable_ID: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
* @hardness: %%desc%%.
* @method: %%desc%%.
*
* Erase using the current brush.
*
* This tool erases using the current brush mask. If the specified
* drawable contains an alpha channel, then the erased pixels will
* become transparent. Otherwise, the eraser tool replaces the contents
* of the drawable with the background color. Like paintbrush, this
* tool linearly interpolates between the specified stroke coordinates.
*
* Returns: TRUE on success.
*/
gboolean
gimp_eraser (gint32 drawable_ID,
gint num_strokes,
@ -477,6 +798,22 @@ gimp_eraser (gint32 drawable_ID,
return success;
}
/**
* gimp_eraser_default:
* @drawable_ID: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Erase using the current brush.
*
* This tool erases using the current brush mask. This function
* performs exactly the same as the gimp_eraser function except that
* the tools arguments are obtained from the eraser option dialog. It
* this dialog has not been activated then the dialogs default values
* will be used.
*
* Returns: TRUE on success.
*/
gboolean
gimp_eraser_default (gint32 drawable_ID,
gint num_strokes,
@ -500,6 +837,26 @@ gimp_eraser_default (gint32 drawable_ID,
return success;
}
/**
* gimp_flip:
* @drawable_ID: The affected drawable.
* @flip_type: Type of flip.
*
* Flip the specified drawable about its center either vertically or
* horizontally.
*
* This tool flips the specified drawable if no selection exists. If a
* selection exists, the portion of the drawable which lies under the
* selection is cut from the drawable and made into a floating
* selection which is then flipd by the specified amount. The return
* value is the ID of the flipped drawable. If there was no selection,
* this will be equal to the drawable ID supplied as input. Otherwise,
* this will be the newly created and flipped drawable. The flip type
* parameter indicates whether the flip will be applied horizontally or
* vertically.
*
* Returns: The flipped drawable.
*/
gint32
gimp_flip (gint32 drawable_ID,
GimpOrientationType flip_type)
@ -522,6 +879,32 @@ gimp_flip (gint32 drawable_ID,
return ret_drawable_ID;
}
/**
* gimp_free_select:
* @image_ID: The image.
* @num_segs: Number of points (count 1 coordinate as two points).
* @segs: Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}.
* @operation: The selection operation.
* @antialias: Antialiasing.
* @feather: Feather option for selections.
* @feather_radius: Radius for feather operation.
*
* 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. If the
* feather option is enabled, the resulting selection is blurred before
* combining. The blur is a gaussian blur with the specified feather
* radius.
*
* Returns: TRUE on success.
*/
gboolean
gimp_free_select (gint32 image_ID,
gint num_segs,
@ -553,6 +936,42 @@ gimp_free_select (gint32 image_ID,
return success;
}
/**
* gimp_fuzzy_select:
* @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).
* @threshold: Threshold in intensity levels %%desc%%.
* @operation: The selection operation.
* @antialias: Antialiasing.
* @feather: Feather option for selections.
* @feather_radius: Radius for feather operation.
* @sample_merged: Use the composite image, not the drawable.
*
* Create a fuzzy selection starting at the specified coordinates on
* the specified drawable.
*
* This tool creates a fuzzy selection over the specified image. A
* fuzzy selection is determined by a seed fill under the constraints
* of the specified threshold. 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 value). This
* process continues until no more expansion is possible. The
* antialiasing parameter allows the final selection mask to contain
* intermediate values based on close misses to the threshold bar at
* pixels along the seed fill boundary. Feathering can be enabled
* optionally and is controlled with the \"feather_radius\" paramter.
* If the sample_merged parameter is non-zero, the data of the
* composite image will be used instead of that for the specified
* drawable. This is equivalent to sampling for colors after merging
* all visible layers. 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.
*/
gboolean
gimp_fuzzy_select (gint32 drawable_ID,
gdouble x,
@ -588,6 +1007,31 @@ gimp_fuzzy_select (gint32 drawable_ID,
return success;
}
/**
* gimp_paintbrush:
* @drawable_ID: The affected drawable.
* @fade_out: Fade out parameter.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
* @method: %%desc%%.
* @gradient_length: Length of gradient to draw.
*
* Paint in the current brush with optional fade out parameter and pull
* colors from a gradient.
*
* This tool is the standard paintbrush. It draws linearly interpolated
* lines through the specified stroke coordinates. It operates on the
* specified drawable in the foreground color with the active brush.
* The \"fade_out\" parameter is measured in pixels and allows the
* brush stroke to linearly fall off. The pressure is set to the
* maximum at the beginning of the stroke. As the distance of the
* stroke nears the fade_out value, the pressure will approach zero.
* The gradient_length is the distance to spread the gradient over. It
* is measured in pixels. If the gradient_length is 0, no gradient is
* used.
*
* Returns: TRUE on success.
*/
gboolean
gimp_paintbrush (gint32 drawable_ID,
gdouble fade_out,
@ -617,6 +1061,31 @@ gimp_paintbrush (gint32 drawable_ID,
return success;
}
/**
* gimp_paintbrush_default:
* @drawable_ID: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Paint in the current brush. The fade out parameter and pull colors
* from a gradient parameter are set from the paintbrush options
* dialog. If this dialog has not been activated then the dialog
* defaults will be used.
*
* This tool is similar to the standard paintbrush. It draws linearly
* interpolated lines through the specified stroke coordinates. It
* operates on the specified drawable in the foreground color with the
* active brush. The \"fade_out\" parameter is measured in pixels and
* allows the brush stroke to linearly fall off (value obtained from
* the option dialog). The pressure is set to the maximum at the
* beginning of the stroke. As the distance of the stroke nears the
* fade_out value, the pressure will approach zero. The gradient_length
* (value obtained from the option dialog) is the distance to spread
* the gradient over. It is measured in pixels. If the gradient_length
* is 0, no gradient is used.
*
* Returns: TRUE on success.
*/
gboolean
gimp_paintbrush_default (gint32 drawable_ID,
gint num_strokes,
@ -640,6 +1109,23 @@ gimp_paintbrush_default (gint32 drawable_ID,
return success;
}
/**
* gimp_pencil:
* @drawable_ID: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Paint in the current brush without sub-pixel sampling.
*
* This tool is the standard pencil. It draws linearly interpolated
* lines through the specified stroke coordinates. It operates on the
* specified drawable in the foreground color with the active brush.
* The brush mask is treated as though it contains only black and white
* values. Any value below half is treated as black; any above half, as
* white.
*
* Returns: TRUE on success.
*/
gboolean
gimp_pencil (gint32 drawable_ID,
gint num_strokes,
@ -663,6 +1149,43 @@ gimp_pencil (gint32 drawable_ID,
return success;
}
/**
* gimp_perspective:
* @drawable_ID: The affected drawable.
* @interpolation: Whether to use interpolation.
* @x0: The new x coordinate of upper-left corner of original bounding box.
* @y0: The new y coordinate of upper-left corner of original bounding box.
* @x1: The new x coordinate of upper-right corner of original bounding box.
* @y1: The new y coordinate of upper-right corner of original bounding box.
* @x2: The new x coordinate of lower-left corner of original bounding box.
* @y2: The new y coordinate of lower-left corner of original bounding box.
* @x3: The new x coordinate of lower-right corner of original bounding box.
* @y3: The new y coordinate of lower-right corner of original bounding box.
*
* Perform a possibly non-affine transformation on the specified
* drawable.
*
* This tool performs a possibly non-affine transformation on the
* specified drawable by allowing the corners of the original bounding
* box to be arbitrarily remapped to any values. The specified drawable
* is remapped if no selection exists. However, if a selection exists,
* the portion of the drawable which lies under the selection is cut
* from the drawable and made into a floating selection which is then
* remapped as specified. The interpolation parameter can be set to
* TRUE to indicate that either linear or cubic interpolation should be
* used to smooth the resulting remapped drawable. The return value is
* the ID of the remapped drawable. If there was no selection, this
* will be equal to the drawable ID supplied as input. Otherwise, this
* will be the newly created and remapped drawable. The 4 coordinates
* specify the new locations of each corner of the original bounding
* box. By specifying these values, any affine transformation
* (rotation, scaling, translation) can be affected. Additionally,
* these values can be specified such that the resulting transformed
* drawable will appear to have been projected via a perspective
* transform.
*
* Returns: The newly mapped drawable.
*/
gint32
gimp_perspective (gint32 drawable_ID,
gboolean interpolation,
@ -701,6 +1224,28 @@ gimp_perspective (gint32 drawable_ID,
return ret_drawable_ID;
}
/**
* gimp_rect_select:
* @image_ID: The image.
* @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.
* @operation: The selection operation.
* @feather: Feather option for selections.
* @feather_radius: Radius for feather operation.
*
* 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. If the feather
* option is enabled, the resulting selection is blurred before
* combining. The blur is a gaussian blur with the specified feather
* radius.
*
* Returns: TRUE on success.
*/
gboolean
gimp_rect_select (gint32 image_ID,
gdouble x,
@ -734,6 +1279,28 @@ gimp_rect_select (gint32 image_ID,
return success;
}
/**
* gimp_rotate:
* @drawable_ID: The affected drawable.
* @interpolation: Whether to use interpolation.
* @angle: The angle of rotation (radians).
*
* Rotate the specified drawable about its center through the specified
* angle.
*
* This tool rotates the specified drawable if no selection exists. If
* a selection exists, the portion of the drawable which lies under the
* selection is cut from the drawable and made into a floating
* selection which is then rotated by the specified amount. The
* interpolation parameter can be set to TRUE to indicate that either
* linear or cubic interpolation should be used to smooth the resulting
* rotated drawable. The return value is the ID of the rotated
* drawable. If there was no selection, this will be equal to the
* drawable ID supplied as input. Otherwise, this will be the newly
* created and rotated drawable.
*
* Returns: The rotated drawable.
*/
gint32
gimp_rotate (gint32 drawable_ID,
gboolean interpolation,
@ -758,6 +1325,30 @@ gimp_rotate (gint32 drawable_ID,
return ret_drawable_ID;
}
/**
* gimp_scale:
* @drawable_ID: The affected drawable.
* @interpolation: Whether to use interpolation.
* @x0: The new x coordinate of upper-left corner of newly scaled region.
* @y0: The new y coordinate of upper-left corner of newly scaled region.
* @x1: The new x coordinate of lower-right corner of newly scaled region.
* @y1: The new y coordinate of lower-right corner of newly scaled region.
*
* Scale the specified drawable.
*
* This tool scales the specified drawable if no selection exists. If a
* selection exists, the portion of the drawable which lies under the
* selection is cut from the drawable and made into a floating
* selection which is then scaled by the specified amount. The
* interpolation parameter can be set to TRUE to indicate that either
* linear or cubic interpolation should be used to smooth the resulting
* scaled drawable. The return value is the ID of the scaled drawable.
* If there was no selection, this will be equal to the drawable ID
* supplied as input. Otherwise, this will be the newly created and
* scaled drawable.
*
* Returns: The scaled drawable.
*/
gint32
gimp_scale (gint32 drawable_ID,
gboolean interpolation,
@ -788,6 +1379,32 @@ gimp_scale (gint32 drawable_ID,
return ret_drawable_ID;
}
/**
* gimp_shear:
* @drawable_ID: The affected drawable.
* @interpolation: Whether to use interpolation.
* @shear_type: Type of shear.
* @magnitude: The magnitude of the shear.
*
* Shear the specified drawable about its center by the specified
* magnitude.
*
* This tool shears the specified drawable if no selection exists. If a
* selection exists, the portion of the drawable which lies under the
* selection is cut from the drawable and made into a floating
* selection which is then sheard by the specified amount. The
* interpolation parameter can be set to TRUE to indicate that either
* linear or cubic interpolation should be used to smooth the resulting
* sheared drawable. The return value is the ID of the sheard drawable.
* If there was no selection, this will be equal to the drawable ID
* supplied as input. Otherwise, this will be the newly created and
* sheard drawable. The shear type parameter indicates whether the
* shear will be applied horizontally or vertically. The magnitude can
* be either positive or negative and indicates the extent (in pixels)
* to shear by.
*
* Returns: The sheared drawable.
*/
gint32
gimp_shear (gint32 drawable_ID,
gboolean interpolation,
@ -814,6 +1431,21 @@ gimp_shear (gint32 drawable_ID,
return ret_drawable_ID;
}
/**
* gimp_smudge:
* @drawable_ID: The affected drawable.
* @pressure: The pressure of the smudge strokes.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Smudge image with varying pressure.
*
* This tool simulates a smudge using the current brush. High pressure
* results in a greater smudge of paint while low pressure results in a
* lesser smudge.
*
* Returns: TRUE on success.
*/
gboolean
gimp_smudge (gint32 drawable_ID,
gdouble pressure,
@ -839,6 +1471,21 @@ gimp_smudge (gint32 drawable_ID,
return success;
}
/**
* gimp_smudge_default:
* @drawable_ID: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
*
* Smudge image with varying pressure.
*
* This tool simulates a smudge using the current brush. It behaves
* exactly the same as gimp_smudge except that the pressure value is
* taken from the smudge tool options or the options default if the
* tools option dialog has not been activated.
*
* Returns: TRUE on success.
*/
gboolean
gimp_smudge_default (gint32 drawable_ID,
gint num_strokes,
@ -862,6 +1509,35 @@ gimp_smudge_default (gint32 drawable_ID,
return success;
}
/**
* gimp_transform_2d:
* @drawable_ID: The affected drawable.
* @interpolation: Whether to use interpolation.
* @source_x: X coordinate of the transformation center.
* @source_y: Y coordinate of the transformation center.
* @scale_x: Amount to scale in x direction.
* @scale_y: Amount to scale in y direction.
* @angle: The angle of rotation (radians).
* @dest_x: X coordinate of where the centre goes.
* @dest_y: Y coordinate of where the centre goes.
*
* Transform the specified drawable in 2d.
*
* This tool transforms the specified drawable if no selection exists.
* If a selection exists, the portion of the drawable which lies under
* the selection is cut from the drawable and made into a floating
* selection which is then transformed. The interpolation parameter can
* be set to TRUE to indicate that either linear or cubic interpolation
* should be used to smooth the resulting drawable. The transformation
* is done by scaling the image by the x and y scale factors about the
* point (source_x, source_y), then rotating around the same point,
* then translating that point to the new position (dest_x, dest_y).
* The return value is the ID of the rotated drawable. If there was no
* selection, this will be equal to the drawable ID supplied as input.
* Otherwise, this will be the newly created and transformed drawable.
*
* Returns: The transformed drawable.
*/
gint32
gimp_transform_2d (gint32 drawable_ID,
gboolean interpolation,

View file

@ -23,6 +23,19 @@
#include "gimp.h"
/**
* gimp_undo_push_group_start:
* @image_ID: The ID of the image in which to pop 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-undo-push-group-end'
* call.
*
* Returns: TRUE on success.
*/
gboolean
gimp_undo_push_group_start (gint32 image_ID)
{
@ -42,6 +55,17 @@ gimp_undo_push_group_start (gint32 image_ID)
return success;
}
/**
* gimp_undo_push_group_end:
* @image_ID: The ID of the image in which to pop an undo group.
*
* Finish a group undo.
*
* This function must be called once for each gimp-undo-push-group call
* that is made.
*
* Returns: TRUE on success.
*/
gboolean
gimp_undo_push_group_end (gint32 image_ID)
{

View file

@ -23,6 +23,15 @@
#include "gimp.h"
/**
* _gimp_unit_get_number_of_units:
*
* Returns the number of units.
*
* This procedure returns the number of defined units.
*
* Returns: The number of units.
*/
gint
_gimp_unit_get_number_of_units (void)
{
@ -42,6 +51,16 @@ _gimp_unit_get_number_of_units (void)
return num_units;
}
/**
* _gimp_unit_get_number_of_built_in_units:
*
* Returns the number of built-in units.
*
* This procedure returns the number of defined units built-in to the
* GIMP.
*
* Returns: The number of built-in units.
*/
gint
_gimp_unit_get_number_of_built_in_units (void)
{
@ -61,6 +80,25 @@ _gimp_unit_get_number_of_built_in_units (void)
return num_units;
}
/**
* _gimp_unit_new:
* @identifier: The new unit's identifier.
* @factor: The new unit's factor.
* @digits: The new unit's digits.
* @symbol: The new unit's symbol.
* @abbreviation: The new unit's abbreviation.
* @singular: The new unit's singular form.
* @plural: The new unit's plural form.
*
* Creates a new unit and returns it's integer ID.
*
* This procedure creates a new unit and returns it's integer ID. Note
* that the new unit will have it's deletion flag set to TRUE, so you
* will have to set it to FALSE with gimp_unit_set_deletion_flag to
* make it persistent.
*
* Returns: The new unit's ID.
*/
GimpUnit
_gimp_unit_new (gchar *identifier,
gdouble factor,
@ -93,6 +131,18 @@ _gimp_unit_new (gchar *identifier,
return unit_id;
}
/**
* _gimp_unit_get_deletion_flag:
* @unit_id: The unit's integer ID.
*
* Returns the deletion flag of the unit.
*
* This procedure returns the deletion flag of the unit. If this value
* is TRUE the unit's definition will not be saved in the user's unitrc
* file on gimp exit.
*
* Returns: The unit's deletion flag.
*/
gboolean
_gimp_unit_get_deletion_flag (GimpUnit unit_id)
{
@ -113,6 +163,19 @@ _gimp_unit_get_deletion_flag (GimpUnit unit_id)
return deletion_flag;
}
/**
* _gimp_unit_set_deletion_flag:
* @unit_id: The unit's integer ID.
* @deletion_flag: The new deletion flag of the unit.
*
* Sets the deletion flag of a unit.
*
* This procedure sets the unit's deletion flag. If the deletion flag
* of a unit is TRUE on gimp exit, this unit's definition will not be
* saved in the user's unitrc.
*
* Returns: TRUE on success.
*/
gboolean
_gimp_unit_set_deletion_flag (GimpUnit unit_id,
gboolean deletion_flag)
@ -134,6 +197,18 @@ _gimp_unit_set_deletion_flag (GimpUnit unit_id,
return success;
}
/**
* _gimp_unit_get_identifier:
* @unit_id: The unit's integer ID.
*
* Returns the textual identifier of the unit.
*
* This procedure returns the textual identifier of the unit. For
* built-in units it will be the english singular form of the unit's
* name. For user-defined units this should equal to the singular form.
*
* Returns: The unit's textual identifier.
*/
gchar *
_gimp_unit_get_identifier (GimpUnit unit_id)
{
@ -154,6 +229,18 @@ _gimp_unit_get_identifier (GimpUnit unit_id)
return identifier;
}
/**
* _gimp_unit_get_factor:
* @unit_id: The unit's integer ID.
*
* Returns the factor of the unit.
*
* This procedure returns the unit's factor which indicates how many
* units make up an inch. Note that asking for the factor of \"pixels\"
* will produce an error.
*
* Returns: The unit's factor.
*/
gdouble
_gimp_unit_get_factor (GimpUnit unit_id)
{
@ -174,6 +261,19 @@ _gimp_unit_get_factor (GimpUnit unit_id)
return factor;
}
/**
* _gimp_unit_get_digits:
* @unit_id: The unit's integer ID.
*
* Returns the number of digits of the unit.
*
* This procedure returns the number of digits you should provide in
* input or output functions to get approximately the same accuracy as
* with two digits and inches. Note that asking for the digits of
* \"pixels\" will produce an error.
*
* Returns: The unit's number of digits.
*/
gint
_gimp_unit_get_digits (GimpUnit unit_id)
{
@ -194,6 +294,16 @@ _gimp_unit_get_digits (GimpUnit unit_id)
return digits;
}
/**
* _gimp_unit_get_symbol:
* @unit_id: The unit's integer ID.
*
* Returns the symbol of the unit.
*
* This procedure returns the symbol of the unit (\"''\" for inches).
*
* Returns: The unit's symbol.
*/
gchar *
_gimp_unit_get_symbol (GimpUnit unit_id)
{
@ -214,6 +324,17 @@ _gimp_unit_get_symbol (GimpUnit unit_id)
return symbol;
}
/**
* _gimp_unit_get_abbreviation:
* @unit_id: The unit's integer ID.
*
* Returns the abbreviation of the unit.
*
* This procedure returns the abbreviation of the unit (\"in\" for
* inches).
*
* Returns: The unit's abbreviation.
*/
gchar *
_gimp_unit_get_abbreviation (GimpUnit unit_id)
{
@ -234,6 +355,16 @@ _gimp_unit_get_abbreviation (GimpUnit unit_id)
return abbreviation;
}
/**
* _gimp_unit_get_singular:
* @unit_id: The unit's integer ID.
*
* Returns the singular form of the unit.
*
* This procedure returns the singular form of the unit.
*
* Returns: The unit's singular form.
*/
gchar *
_gimp_unit_get_singular (GimpUnit unit_id)
{
@ -254,6 +385,16 @@ _gimp_unit_get_singular (GimpUnit unit_id)
return singular;
}
/**
* _gimp_unit_get_plural:
* @unit_id: The unit's integer ID.
*
* Returns the plural form of the unit.
*
* This procedure returns the plural form of the unit.
*
* Returns: The unit's plural form.
*/
gchar *
_gimp_unit_get_plural (GimpUnit unit_id)
{

View file

@ -28,6 +28,25 @@ $destdir = "$main::destdir/libgimp";
*write_file = \&Gimp::CodeGen::util::write_file;
*FILE_EXT = \$Gimp::CodeGen::util::FILE_EXT;
use Text::Wrap qw(wrap);
sub desc_wrap {
my ($str) = @_;
my $leading = ' * ';
$Text::Wrap::columns = 72;
wrap($leading, $leading, $str);
}
sub desc_clean {
my ($str) = @_;
$str =~ s/\(\s*%%desc%%\s*\)//g;
$str =~ s/:\s*%%desc%%//g;
$str =~ s/\{\s*%%desc%%\s*\}//g;
$str =~ s/\s*$//g;
$str =~ s/:$//g;
$str;
}
sub generate {
my @procs = @{(shift)};
my %out;
@ -59,6 +78,7 @@ sub generate {
my @outargs = @{$proc->{outargs}} if exists $proc->{outargs};
my $funcname = "gimp_$name"; my $wrapped = ""; my %usednames;
my $retdesc = "";
# The 'color' argument is special cased to accept and return the
# individual color components. This is to maintain backwards
@ -94,6 +114,8 @@ sub generate {
}
$retarg->{retval} = 1;
$retdesc = &desc_clean ($retarg->{desc});
}
else {
# No return values
@ -101,9 +123,11 @@ sub generate {
}
# The parameters to the function
my $arglist = ""; my $argpass = ""; my $color = ""; my $privatevars = 0;
my $arglist = ""; my $argpass = ""; my $color = ""; my $privatevars = 0;
my $argdesc = "";
foreach (@inargs) {
my ($type) = &arg_parse($_->{type});
my $desc = &desc_clean($_->{desc});
my $arg = $arg_types{$type};
my $id = exists $arg->{id_func} || $_->{type} =~ /guide/;
@ -119,6 +143,10 @@ sub generate {
$arglist .= $_->{name};
$arglist .= '_ID' if $id;
$arglist .= ', ';
$argdesc .= " * \@$_->{name}";
$argdesc .= '_ID' if $id;
$argdesc .= ": $desc";
}
else {
# A color needs to stick the components into a 3-element array
@ -132,6 +160,8 @@ sub generate {
CODE
$arglist .= "guchar red, guchar green, guchar blue, ";
$argdesc .= " * \@red:\n * \@green:\n * \@blue: $desc";
}
# This is what's passed into gimp_run_procedure
@ -147,6 +177,9 @@ CODE
}
$argpass .= ',';
unless ($argdesc =~ /[\.\!\?]$/) { $argdesc .= '.' }
$argdesc .= "\n";
}
# This marshals the return value(s)
@ -156,6 +189,7 @@ CODE
# return success/failure boolean if we don't have anything else
if ($rettype eq 'void') {
$return_args .= "\n" . ' ' x 2 . "gboolean success = TRUE;";
$retdesc = "TRUE on success.";
}
# We only need to bother with this if we have to return a value
@ -257,10 +291,11 @@ CODE
my $argc = 1; my ($numpos, $numtype);
foreach (@outargs) {
my ($type) = &arg_parse($_->{type});
my $desc = &desc_clean($_->{desc});
my $arg = $arg_types{$type};
my $id = $arg->{id_ret_func} || $_->{type} =~ /guide/;
my $var;
my $ch = ""; my $cf = "";
if ($type =~ /^string(array)?/) {
$ch = 'g_strdup (';
@ -279,6 +314,7 @@ CODE
$numtype = $type;
if (!exists $_->{no_lib}) {
$arglist .= "gint \*$_->{libname}, ";
$argdesc .= " * \@$_->{libname}: $desc";
}
}
elsif (exists $_->{array}) {
@ -295,6 +331,7 @@ CODE
else {
$arglist .= "$datatype **$_->{libname}";
}
$argdesc .= " * \@$_->{libname}: $desc";
}
if ($ch || $cf) {
@ -314,7 +351,7 @@ CP1
memcpy ($var, return_vals[$argc].data.d_$type,
$numvar * sizeof ($datatype));
CP2
}
}
elsif ($type ne 'color') {
# The return value variable
$var = "";
@ -325,6 +362,10 @@ CP2
$arglist .= "*$_->{libname}";
$arglist .= '_ID' if $id;
$arglist .= ', ';
$argdesc .= " * \@$_->{libname}";
$argdesc .= '_ID' if $id;
$argdesc .= ": $desc";
}
$var = exists $_->{retval} ? "" : '*';
@ -339,15 +380,20 @@ CODE
else {
# Colors are returned in parts using pointers
$arglist .= "guchar \*red, guchar \*green, guchar \*blue, ";
$return_marshal .= <<CODE
$return_marshal .= <<CODE;
{
\*red = return_vals[$argc].data.d_color.red;
\*green = return_vals[$argc].data.d_color.green;
\*blue = return_vals[$argc].data.d_color.blue;
}
CODE
$argdesc .= " * \@red:\n * \@green:\n * \@blue: $desc";
}
if ($argdesc) {
unless ($argdesc =~ /[\.\!\?]$/) { $argdesc .= '.' }
unless ($argdesc =~ /\n$/) { $argdesc .= "\n" }
}
$argc++;
}
@ -373,6 +419,7 @@ success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
return success;
CODE
chop $return_marshal;
}
@ -420,8 +467,19 @@ CODE
my $padding = "\t" x $padtab . ' ' x $padspace;
$clist =~ s/\t/$padding/eg;
unless ($retdesc =~ /[\.\!\?]$/) { $retdesc .= '.' }
$out->{code} .= <<CODE;
/**
* $wrapped$funcname:
$argdesc *
@{[ &desc_wrap($proc->{blurb}) ]}
*
@{[ &desc_wrap($proc->{help}) ]}
*
* Returns: $retdesc
*/
$rettype
$wrapped$funcname ($clist)
{