Commit 79b319cf authored by Jehan's avatar Jehan

libgimp, pdb: add GimpItem > GimpDrawable > GimpLayer classes.

Only class and subclasses creation and PDB generation for this first
step.
I'll later do other types of items.
parent 793cba66
......@@ -119,6 +119,7 @@ libgimp_introspectable_headers = \
../libgimp/gimpimage.h \
../libgimp/gimpimagecolorprofile.h \
../libgimp/gimpimageprocedure.h \
../libgimp/gimpitem.h \
../libgimp/gimplayer.h \
../libgimp/gimploadprocedure.h \
../libgimp/gimppaletteselect.h \
......@@ -147,6 +148,7 @@ libgimp_introspectable = \
../libgimp/gimpimage.c \
../libgimp/gimpimagecolorprofile.c \
../libgimp/gimpimageprocedure.c \
../libgimp/gimpitem.c \
../libgimp/gimplayer.c \
../libgimp/gimploadprocedure.c \
../libgimp/gimppaletteselect.c \
......
......@@ -44,6 +44,7 @@
#include <libgimp/gimpimage.h>
#include <libgimp/gimpimagecolorprofile.h>
#include <libgimp/gimpimageprocedure.h>
#include <libgimp/gimpitem.h>
#include <libgimp/gimplayer.h>
#include <libgimp/gimploadprocedure.h>
#include <libgimp/gimplegacy.h>
......
......@@ -26,6 +26,24 @@
#include "gimptilebackendplugin.h"
G_DEFINE_ABSTRACT_TYPE (GimpDrawable, gimp_drawable, GIMP_TYPE_ITEM)
#define parent_class gimp_drawable_parent_class
static void
gimp_drawable_class_init (GimpDrawableClass *klass)
{
}
static void
gimp_drawable_init (GimpDrawable *drawable)
{
}
/* Public API. */
guchar *
gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
gint *width,
......
......@@ -29,6 +29,40 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#include <libgimp/gimpitem.h>
#define GIMP_TYPE_DRAWABLE (gimp_drawable_get_type ())
#define GIMP_DRAWABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DRAWABLE, GimpDrawable))
#define GIMP_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DRAWABLE, GimpDrawableClass))
#define GIMP_IS_DRAWABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DRAWABLE))
#define GIMP_IS_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DRAWABLE))
#define GIMP_DRAWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DRAWABLE, GimpDrawableClass))
typedef struct _GimpDrawableClass GimpDrawableClass;
struct _GimpDrawable
{
GimpItem parent_instance;
};
struct _GimpDrawableClass
{
GimpItemClass parent_class;
/* Padding for future expansion */
void (*_gimp_reserved1) (void);
void (*_gimp_reserved2) (void);
void (*_gimp_reserved3) (void);
void (*_gimp_reserved4) (void);
void (*_gimp_reserved5) (void);
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};
GType gimp_drawable_get_type (void) G_GNUC_CONST;
GeglBuffer * gimp_drawable_get_buffer (gint32 drawable_ID);
GeglBuffer * gimp_drawable_get_shadow_buffer (gint32 drawable_ID);
......
This diff is collapsed.
......@@ -32,55 +32,59 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
G_GNUC_INTERNAL gchar* _gimp_drawable_get_format (gint32 drawable_ID);
G_GNUC_INTERNAL gchar* _gimp_drawable_get_thumbnail_format (gint32 drawable_ID);
GimpImageType gimp_drawable_type (gint32 drawable_ID);
GimpImageType gimp_drawable_type_with_alpha (gint32 drawable_ID);
gboolean gimp_drawable_has_alpha (gint32 drawable_ID);
gboolean gimp_drawable_is_rgb (gint32 drawable_ID);
gboolean gimp_drawable_is_gray (gint32 drawable_ID);
gboolean gimp_drawable_is_indexed (gint32 drawable_ID);
gint gimp_drawable_bpp (gint32 drawable_ID);
gint gimp_drawable_width (gint32 drawable_ID);
gint gimp_drawable_height (gint32 drawable_ID);
gboolean gimp_drawable_offsets (gint32 drawable_ID,
#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
G_GNUC_INTERNAL gchar* _gimp_drawable_get_format (GimpDrawable *drawable);
G_GNUC_INTERNAL gchar* _gimp_drawable_get_thumbnail_format (GimpDrawable *drawable);
GimpImageType gimp_drawable_type (GimpDrawable *drawable);
GimpImageType gimp_drawable_type_with_alpha (GimpDrawable *drawable);
gboolean gimp_drawable_has_alpha (GimpDrawable *drawable);
gboolean gimp_drawable_is_rgb (GimpDrawable *drawable);
gboolean gimp_drawable_is_gray (GimpDrawable *drawable);
gboolean gimp_drawable_is_indexed (GimpDrawable *drawable);
gint gimp_drawable_bpp (GimpDrawable *drawable);
gint gimp_drawable_width (GimpDrawable *drawable);
gint gimp_drawable_height (GimpDrawable *drawable);
gboolean gimp_drawable_offsets (GimpDrawable *drawable,
gint *offset_x,
gint *offset_y);
gboolean gimp_drawable_mask_bounds (gint32 drawable_ID,
gboolean gimp_drawable_mask_bounds (GimpDrawable *drawable,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gboolean gimp_drawable_mask_intersect (gint32 drawable_ID,
gboolean gimp_drawable_mask_intersect (GimpDrawable *drawable,
gint *x,
gint *y,
gint *width,
gint *height);
gboolean gimp_drawable_merge_shadow (gint32 drawable_ID,
gboolean gimp_drawable_merge_shadow (GimpDrawable *drawable,
gboolean undo);
gboolean gimp_drawable_free_shadow (gint32 drawable_ID);
gboolean gimp_drawable_update (gint32 drawable_ID,
gboolean gimp_drawable_free_shadow (GimpDrawable *drawable);
gboolean gimp_drawable_update (GimpDrawable *drawable,
gint x,
gint y,
gint width,
gint height);
guint8* gimp_drawable_get_pixel (gint32 drawable_ID,
guint8* gimp_drawable_get_pixel (GimpDrawable *drawable,
gint x_coord,
gint y_coord,
gint *num_channels);
gboolean gimp_drawable_set_pixel (gint32 drawable_ID,
gboolean gimp_drawable_set_pixel (GimpDrawable *drawable,
gint x_coord,
gint y_coord,
gint num_channels,
const guint8 *pixel);
gboolean gimp_drawable_fill (gint32 drawable_ID,
gboolean gimp_drawable_fill (GimpDrawable *drawable,
GimpFillType fill_type);
gboolean gimp_drawable_offset (gint32 drawable_ID,
gboolean gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y);
G_GNUC_INTERNAL gboolean _gimp_drawable_thumbnail (gint32 drawable_ID,
G_GNUC_INTERNAL gboolean _gimp_drawable_thumbnail (GimpDrawable *drawable,
gint width,
gint height,
gint *actual_width,
......@@ -88,7 +92,7 @@ G_GNUC_INTERNAL gboolean _gimp_drawable_thumbnail (gint32
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
G_GNUC_INTERNAL gboolean _gimp_drawable_sub_thumbnail (gint32 drawable_ID,
G_GNUC_INTERNAL gboolean _gimp_drawable_sub_thumbnail (GimpDrawable *drawable,
gint src_x,
gint src_y,
gint src_width,
......@@ -100,16 +104,36 @@ G_GNUC_INTERNAL gboolean _gimp_drawable_sub_thumbnail (gint32
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
gboolean gimp_drawable_foreground_extract (gint32 drawable_ID,
gboolean gimp_drawable_foreground_extract (GimpDrawable *drawable,
GimpForegroundExtractMode mode,
gint32 mask_ID);
#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
GimpDrawable *mask);
#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
#define _gimp_drawable_get_format __gimp_drawable_get_format
#define _gimp_drawable_get_thumbnail_format __gimp_drawable_get_thumbnail_format
#define gimp_drawable_type _gimp_drawable_type
#define gimp_drawable_type_with_alpha _gimp_drawable_type_with_alpha
#define gimp_drawable_has_alpha _gimp_drawable_has_alpha
#define gimp_drawable_is_rgb _gimp_drawable_is_rgb
#define gimp_drawable_is_gray _gimp_drawable_is_gray
#define gimp_drawable_is_indexed _gimp_drawable_is_indexed
#define gimp_drawable_bpp _gimp_drawable_bpp
#define gimp_drawable_width _gimp_drawable_width
#define gimp_drawable_height _gimp_drawable_height
#define gimp_drawable_offsets _gimp_drawable_offsets
#define gimp_drawable_mask_bounds _gimp_drawable_mask_bounds
#define gimp_drawable_mask_intersect _gimp_drawable_mask_intersect
#define gimp_drawable_merge_shadow _gimp_drawable_merge_shadow
#define gimp_drawable_free_shadow _gimp_drawable_free_shadow
#define gimp_drawable_update _gimp_drawable_update
#define gimp_drawable_get_pixel _gimp_drawable_get_pixel
#define gimp_drawable_set_pixel _gimp_drawable_set_pixel
#define gimp_drawable_fill _gimp_drawable_fill
#define gimp_drawable_offset _gimp_drawable_offset
#define _gimp_drawable_thumbnail __gimp_drawable_thumbnail
#define _gimp_drawable_sub_thumbnail __gimp_drawable_sub_thumbnail
#define gimp_drawable_foreground_extract _gimp_drawable_foreground_extract
#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
......@@ -118,7 +142,77 @@ gboolean gimp_drawable_foreground_extract (gint32
* They are not marked internal as a trick to keep the old API alive for now.
*/
gchar* __gimp_drawable_get_format (gint32 drawable_ID);
gchar* __gimp_drawable_get_thumbnail_format (gint32 drawable_ID);
GimpImageType _gimp_drawable_type (gint32 drawable_ID);
GimpImageType _gimp_drawable_type_with_alpha (gint32 drawable_ID);
gboolean _gimp_drawable_has_alpha (gint32 drawable_ID);
gboolean _gimp_drawable_is_rgb (gint32 drawable_ID);
gboolean _gimp_drawable_is_gray (gint32 drawable_ID);
gboolean _gimp_drawable_is_indexed (gint32 drawable_ID);
gint _gimp_drawable_bpp (gint32 drawable_ID);
gint _gimp_drawable_width (gint32 drawable_ID);
gint _gimp_drawable_height (gint32 drawable_ID);
gboolean _gimp_drawable_offsets (gint32 drawable_ID,
gint *offset_x,
gint *offset_y);
gboolean _gimp_drawable_mask_bounds (gint32 drawable_ID,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gboolean _gimp_drawable_mask_intersect (gint32 drawable_ID,
gint *x,
gint *y,
gint *width,
gint *height);
gboolean _gimp_drawable_merge_shadow (gint32 drawable_ID,
gboolean undo);
gboolean _gimp_drawable_free_shadow (gint32 drawable_ID);
gboolean _gimp_drawable_update (gint32 drawable_ID,
gint x,
gint y,
gint width,
gint height);
guint8* _gimp_drawable_get_pixel (gint32 drawable_ID,
gint x_coord,
gint y_coord,
gint *num_channels);
gboolean _gimp_drawable_set_pixel (gint32 drawable_ID,
gint x_coord,
gint y_coord,
gint num_channels,
const guint8 *pixel);
gboolean _gimp_drawable_fill (gint32 drawable_ID,
GimpFillType fill_type);
gboolean _gimp_drawable_offset (gint32 drawable_ID,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y);
gboolean __gimp_drawable_thumbnail (gint32 drawable_ID,
gint width,
gint height,
gint *actual_width,
gint *actual_height,
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
gboolean __gimp_drawable_sub_thumbnail (gint32 drawable_ID,
gint src_x,
gint src_y,
gint src_width,
gint src_height,
gint dest_width,
gint dest_height,
gint *width,
gint *height,
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
gboolean _gimp_drawable_foreground_extract (gint32 drawable_ID,
GimpForegroundExtractMode mode,
gint32 mask_ID);
G_END_DECLS
......
This diff is collapsed.
......@@ -32,32 +32,36 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_drawable_brightness_contrast (gint32 drawable_ID,
#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
gboolean gimp_drawable_brightness_contrast (GimpDrawable *drawable,
gdouble brightness,
gdouble contrast);
gboolean gimp_drawable_color_balance (gint32 drawable_ID,
gboolean gimp_drawable_color_balance (GimpDrawable *drawable,
GimpTransferMode transfer_mode,
gboolean preserve_lum,
gdouble cyan_red,
gdouble magenta_green,
gdouble yellow_blue);
gboolean gimp_drawable_colorize_hsl (gint32 drawable_ID,
gboolean gimp_drawable_colorize_hsl (GimpDrawable *drawable,
gdouble hue,
gdouble saturation,
gdouble lightness);
gboolean gimp_drawable_curves_explicit (gint32 drawable_ID,
gboolean gimp_drawable_curves_explicit (GimpDrawable *drawable,
GimpHistogramChannel channel,
gint num_values,
const gdouble *values);
gboolean gimp_drawable_curves_spline (gint32 drawable_ID,
gboolean gimp_drawable_curves_spline (GimpDrawable *drawable,
GimpHistogramChannel channel,
gint num_points,
const gdouble *points);
gboolean gimp_drawable_desaturate (gint32 drawable_ID,
gboolean gimp_drawable_desaturate (GimpDrawable *drawable,
GimpDesaturateMode desaturate_mode);
gboolean gimp_drawable_equalize (gint32 drawable_ID,
gboolean gimp_drawable_equalize (GimpDrawable *drawable,
gboolean mask_only);
gboolean gimp_drawable_histogram (gint32 drawable_ID,
gboolean gimp_drawable_histogram (GimpDrawable *drawable,
GimpHistogramChannel channel,
gdouble start_range,
gdouble end_range,
......@@ -67,15 +71,15 @@ gboolean gimp_drawable_histogram (gint32 drawable_ID,
gdouble *pixels,
gdouble *count,
gdouble *percentile);
gboolean gimp_drawable_hue_saturation (gint32 drawable_ID,
gboolean gimp_drawable_hue_saturation (GimpDrawable *drawable,
GimpHueRange hue_range,
gdouble hue_offset,
gdouble lightness,
gdouble saturation,
gdouble overlap);
gboolean gimp_drawable_invert (gint32 drawable_ID,
gboolean gimp_drawable_invert (GimpDrawable *drawable,
gboolean linear);
gboolean gimp_drawable_levels (gint32 drawable_ID,
gboolean gimp_drawable_levels (GimpDrawable *drawable,
GimpHistogramChannel channel,
gdouble low_input,
gdouble high_input,
......@@ -84,20 +88,30 @@ gboolean gimp_drawable_levels (gint32 drawable_ID,
gdouble low_output,
gdouble high_output,
gboolean clamp_output);
gboolean gimp_drawable_levels_stretch (gint32 drawable_ID);
gboolean gimp_drawable_posterize (gint32 drawable_ID,
gboolean gimp_drawable_levels_stretch (GimpDrawable *drawable);
gboolean gimp_drawable_posterize (GimpDrawable *drawable,
gint levels);
gboolean gimp_drawable_threshold (gint32 drawable_ID,
gboolean gimp_drawable_threshold (GimpDrawable *drawable,
GimpHistogramChannel channel,
gdouble low_threshold,
gdouble high_threshold);
#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
#define gimp_drawable_brightness_contrast _gimp_drawable_brightness_contrast
#define gimp_drawable_color_balance _gimp_drawable_color_balance
#define gimp_drawable_colorize_hsl _gimp_drawable_colorize_hsl
#define gimp_drawable_curves_explicit _gimp_drawable_curves_explicit
#define gimp_drawable_curves_spline _gimp_drawable_curves_spline
#define gimp_drawable_desaturate _gimp_drawable_desaturate
#define gimp_drawable_equalize _gimp_drawable_equalize
#define gimp_drawable_histogram _gimp_drawable_histogram
#define gimp_drawable_hue_saturation _gimp_drawable_hue_saturation
#define gimp_drawable_invert _gimp_drawable_invert
#define gimp_drawable_levels _gimp_drawable_levels
#define gimp_drawable_levels_stretch _gimp_drawable_levels_stretch
#define gimp_drawable_posterize _gimp_drawable_posterize
#define gimp_drawable_threshold _gimp_drawable_threshold
#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
......@@ -106,7 +120,65 @@ gboolean gimp_drawable_threshold (gint32 drawable_ID,
* They are not marked internal as a trick to keep the old API alive for now.
*/
gboolean _gimp_drawable_brightness_contrast (gint32 drawable_ID,
gdouble brightness,
gdouble contrast);
gboolean _gimp_drawable_color_balance (gint32 drawable_ID,
GimpTransferMode transfer_mode,
gboolean preserve_lum,
gdouble cyan_red,
gdouble magenta_green,
gdouble yellow_blue);
gboolean _gimp_drawable_colorize_hsl (gint32 drawable_ID,
gdouble hue,
gdouble saturation,
gdouble lightness);
gboolean _gimp_drawable_curves_explicit (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_values,
const gdouble *values);
gboolean _gimp_drawable_curves_spline (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_points,
const gdouble *points);
gboolean _gimp_drawable_desaturate (gint32 drawable_ID,
GimpDesaturateMode desaturate_mode);
gboolean _gimp_drawable_equalize (gint32 drawable_ID,
gboolean mask_only);
gboolean _gimp_drawable_histogram (gint32 drawable_ID,
GimpHistogramChannel channel,
gdouble start_range,
gdouble end_range,
gdouble *mean,
gdouble *std_dev,
gdouble *median,
gdouble *pixels,
gdouble *count,
gdouble *percentile);
gboolean _gimp_drawable_hue_saturation (gint32 drawable_ID,
GimpHueRange hue_range,
gdouble hue_offset,
gdouble lightness,
gdouble saturation,
gdouble overlap);
gboolean _gimp_drawable_invert (gint32 drawable_ID,
gboolean linear);
gboolean _gimp_drawable_levels (gint32 drawable_ID,
GimpHistogramChannel channel,
gdouble low_input,
gdouble high_input,
gboolean clamp_input,
gdouble gamma,
gdouble low_output,
gdouble high_output,
gboolean clamp_output);
gboolean _gimp_drawable_levels_stretch (gint32 drawable_ID);
gboolean _gimp_drawable_posterize (gint32 drawable_ID,
gint levels);
gboolean _gimp_drawable_threshold (gint32 drawable_ID,
GimpHistogramChannel channel,
gdouble low_threshold,
gdouble high_threshold);
G_END_DECLS
......
......@@ -36,6 +36,51 @@
/**
* gimp_drawable_edit_clear:
* @drawable: 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.
*
* This procedure is affected by the following context setters:
* gimp_context_set_background().
*
* Returns: TRUE on success.
**/
gboolean
gimp_drawable_edit_clear (GimpDrawable *drawable)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE_ID, gimp_item_get_id (GIMP_ITEM (drawable)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-drawable-edit-clear",
args);
else
return_vals = gimp_run_procedure_array ("gimp-drawable-edit-clear",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_drawable_edit_clear: (skip)
* @drawable_ID: The drawable to clear from.
*
* Clear selected area of drawable.
......@@ -52,7 +97,7 @@
* Returns: TRUE on success.
**/
gboolean
gimp_drawable_edit_clear (gint32 drawable_ID)
_gimp_drawable_edit_clear (gint32 drawable_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -81,6 +126,55 @@ gimp_drawable_edit_clear (gint32 drawable_ID)
/**
* gimp_drawable_edit_fill:
* @drawable: The drawable to fill to.
* @fill_type: The type of fill.
*
* Fill selected area of drawable.
*
* This procedure fills the specified drawable according to fill mode.
* This procedure only affects regions within a selection if there is a
* selection active. If you want to fill the whole drawable, regardless
* of the selection, use gimp_drawable_fill().
*
* This procedure is affected by the following context setters:
* gimp_context_set_opacity(), gimp_context_set_paint_mode(),
* gimp_context_set_foreground(), gimp_context_set_background(),
* gimp_context_set_pattern().
*
* Returns: TRUE on success.
**/
gboolean
gimp_drawable_edit_fill (GimpDrawable *drawable,
GimpFillType fill_type)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE_ID, gimp_item_get_id (GIMP_ITEM (drawable)),
GIMP_TYPE_FILL_TYPE, fill_type,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-drawable-edit-fill",
args);
else
return_vals = gimp_run_procedure_array ("gimp-drawable-edit-fill",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_drawable_edit_fill: (skip)
* @drawable_ID: The drawable to fill to.
* @fill_type: The type of fill.
*
......@@ -99,8 +193,8 @@ gimp_drawable_edit_clear (gint32 drawable_ID)
* Returns: TRUE on success.
**/
gboolean
gimp_drawable_edit_fill (gint32 drawable_ID,
GimpFillType fill_type)
_gimp_drawable_edit_fill (gint32 drawable_ID,
GimpFillType fill_type)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -130,6 +224,67 @@ gimp_drawable_edit_fill (gint32 drawable_ID,
/**
* gimp_drawable_edit_bucket_fill:
* @drawable: The affected drawable.
* @fill_type: The type of fill.
* @x: The x coordinate of this bucket fill's application.
* @y: The y coordinate of this bucket fill's application.
*
* Fill the area by a seed fill starting at the specified coordinates.
*
* This procedure does a seed fill at the specified coordinates, using
* various parameters from the current context.
* In the case of merged sampling, the x and y coordinates are relative
* to the image's origin; otherwise, they are relative to the
* drawable's origin.
*
* This procedure is affected by the following context setters:
* gimp_context_set_opacity(), gimp_context_set_paint_mode(),
* gimp_context_set_foreground(), gimp_context_set_background(),
* gimp_context_set_pattern(), gimp_context_set_sample_threshold(),
* gimp_context_set_sample_merged(),
* gimp_context_set_sample_criterion(),
* gimp_context_set_diagonal_neighbors(), gimp_context_set_antialias().
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
gimp_drawable_edit_bucket_fill (GimpDrawable *drawable,
GimpFillType fill_type,
gdouble x,
gdouble y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE_ID, gimp_item_get_id (GIMP_ITEM (drawable)),
GIMP_TYPE_FILL_TYPE, fill_type,
G_TYPE_DOUBLE, x,
G_TYPE_DOUBLE, y,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-drawable-edit-bucket-fill",
args);
else
return_vals = gimp_run_procedure_array ("gimp-drawable-edit-bucket-fill",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_drawable_edit_bucket_fill: (skip)
* @drawable_ID: The affected drawable.
* @fill_type: The type of fill.
* @x: The x coordinate of this bucket fill's application.
......@@ -156,10 +311,10 @@ gimp_drawable_edit_fill (gint32 drawable_ID,
* Since: 2.10
**/
gboolean
gimp_drawable_edit_bucket_fill (gint32 drawable_ID,
GimpFillType fill_type,
gdouble x,
gdouble y)
_gimp_drawable_edit_bucket_fill (gint32 drawable_ID,
GimpFillType fill_type,
gdouble x,
gdouble y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -191,6 +346,87 @@ gimp_drawable_edit_bucket_fill (gint32 drawable_ID,
/**
* gimp_drawable_edit_gradient_fill:
* @drawable: The affected drawable.
* @gradient_type: The type of gradient.
* @offset: Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.
* @supersample: Do adaptive supersampling.
* @supersample_max_depth: Maximum recursion levels for supersampling.
* @supersample_threshold: Supersampling threshold.
* @dither: Use dithering to reduce banding.
* @x1: The x coordinate of this gradient's starting point.
* @y1: The y coordinate of this gradient's starting point.
* @x2: The x coordinate of this gradient's ending point.
* @y2: The y coordinate of this gradient's ending point.
*
* Draw a gradient between the starting and ending coordinates with the
* specified gradient type.
*
* This tool requires information on the gradient type. It creates