app, libgimpbase: move lots of GValue and GParamSpec types to libgimpbase

all the stuff from app/core/gimpparamspecs.[ch] that is not about
image, drawable etc IDs, these will have to go to libgimp with
different implementations than in app/.
This commit is contained in:
Michael Natterer 2019-07-26 15:54:33 +02:00
parent 5c7134f3a5
commit 76ee0f6559
12 changed files with 2152 additions and 2002 deletions

File diff suppressed because it is too large Load Diff

View File

@ -15,155 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_PARAM_SPECS_H__
#define __GIMP_PARAM_SPECS_H__
/*
* Keep in sync with libgimpconfig/gimpconfig-params.h
*/
#define GIMP_PARAM_NO_VALIDATE (1 << (6 + G_PARAM_USER_SHIFT))
/*
* GIMP_TYPE_INT32
*/
#define GIMP_TYPE_INT32 (gimp_int32_get_type ())
#define GIMP_VALUE_HOLDS_INT32(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
GIMP_TYPE_INT32))
GType gimp_int32_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT32
*/
#define GIMP_TYPE_PARAM_INT32 (gimp_param_int32_get_type ())
#define GIMP_PARAM_SPEC_INT32(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT32, GimpParamSpecInt32))
#define GIMP_IS_PARAM_SPEC_INT32(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT32))
typedef struct _GimpParamSpecInt32 GimpParamSpecInt32;
struct _GimpParamSpecInt32
{
GParamSpecInt parent_instance;
};
GType gimp_param_int32_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int32 (const gchar *name,
const gchar *nick,
const gchar *blurb,
gint minimum,
gint maximum,
gint default_value,
GParamFlags flags);
/*
* GIMP_TYPE_INT16
*/
#define GIMP_TYPE_INT16 (gimp_int16_get_type ())
#define GIMP_VALUE_HOLDS_INT16(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
GIMP_TYPE_INT16))
GType gimp_int16_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT16
*/
#define GIMP_TYPE_PARAM_INT16 (gimp_param_int16_get_type ())
#define GIMP_PARAM_SPEC_INT16(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT16, GimpParamSpecInt16))
#define GIMP_IS_PARAM_SPEC_INT16(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT16))
typedef struct _GimpParamSpecInt16 GimpParamSpecInt16;
struct _GimpParamSpecInt16
{
GParamSpecInt parent_instance;
};
GType gimp_param_int16_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int16 (const gchar *name,
const gchar *nick,
const gchar *blurb,
gint minimum,
gint maximum,
gint default_value,
GParamFlags flags);
/*
* GIMP_TYPE_INT8
*/
#define GIMP_TYPE_INT8 (gimp_int8_get_type ())
#define GIMP_VALUE_HOLDS_INT8(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
GIMP_TYPE_INT8))
GType gimp_int8_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT8
*/
#define GIMP_TYPE_PARAM_INT8 (gimp_param_int8_get_type ())
#define GIMP_PARAM_SPEC_INT8(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT8, GimpParamSpecInt8))
#define GIMP_IS_PARAM_SPEC_INT8(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT8))
typedef struct _GimpParamSpecInt8 GimpParamSpecInt8;
struct _GimpParamSpecInt8
{
GParamSpecUInt parent_instance;
};
GType gimp_param_int8_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int8 (const gchar *name,
const gchar *nick,
const gchar *blurb,
guint minimum,
guint maximum,
guint default_value,
GParamFlags flags);
/*
* GIMP_TYPE_PARAM_STRING
*/
#define GIMP_TYPE_PARAM_STRING (gimp_param_string_get_type ())
#define GIMP_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_STRING, GimpParamSpecString))
#define GIMP_IS_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_STRING))
typedef struct _GimpParamSpecString GimpParamSpecString;
struct _GimpParamSpecString
{
GParamSpecString parent_instance;
guint allow_non_utf8 : 1;
guint non_empty : 1;
};
GType gimp_param_string_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_string (const gchar *name,
const gchar *nick,
const gchar *blurb,
gboolean allow_non_utf8,
gboolean null_ok,
gboolean non_empty,
const gchar *default_value,
GParamFlags flags);
#ifndef __APP_GIMP_PARAM_SPECS_H__
#define __APP_GIMP_PARAM_SPECS_H__
/*
@ -577,328 +430,4 @@ void gimp_value_set_display (GValue *value,
GimpObject *display);
/*
* GIMP_TYPE_ARRAY
*/
typedef struct _GimpArray GimpArray;
struct _GimpArray
{
guint8 *data;
gsize length;
gboolean static_data;
};
GimpArray * gimp_array_new (const guint8 *data,
gsize length,
gboolean static_data);
GimpArray * gimp_array_copy (const GimpArray *array);
void gimp_array_free (GimpArray *array);
#define GIMP_TYPE_ARRAY (gimp_array_get_type ())
#define GIMP_VALUE_HOLDS_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_ARRAY))
GType gimp_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_ARRAY
*/
#define GIMP_TYPE_PARAM_ARRAY (gimp_param_array_get_type ())
#define GIMP_PARAM_SPEC_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_ARRAY, GimpParamSpecArray))
#define GIMP_IS_PARAM_SPEC_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_ARRAY))
typedef struct _GimpParamSpecArray GimpParamSpecArray;
struct _GimpParamSpecArray
{
GParamSpecBoxed parent_instance;
};
GType gimp_param_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
/*
* GIMP_TYPE_INT8_ARRAY
*/
#define GIMP_TYPE_INT8_ARRAY (gimp_int8_array_get_type ())
#define GIMP_VALUE_HOLDS_INT8_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_INT8_ARRAY))
GType gimp_int8_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT8_ARRAY
*/
#define GIMP_TYPE_PARAM_INT8_ARRAY (gimp_param_int8_array_get_type ())
#define GIMP_PARAM_SPEC_INT8_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT8_ARRAY, GimpParamSpecInt8Array))
#define GIMP_IS_PARAM_SPEC_INT8_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT8_ARRAY))
typedef struct _GimpParamSpecInt8Array GimpParamSpecInt8Array;
struct _GimpParamSpecInt8Array
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_int8_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int8_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const guint8 * gimp_value_get_int8_array (const GValue *value);
guint8 * gimp_value_dup_int8_array (const GValue *value);
void gimp_value_set_int8_array (GValue *value,
const guint8 *array,
gsize length);
void gimp_value_set_static_int8_array (GValue *value,
const guint8 *array,
gsize length);
void gimp_value_take_int8_array (GValue *value,
guint8 *array,
gsize length);
/*
* GIMP_TYPE_INT16_ARRAY
*/
#define GIMP_TYPE_INT16_ARRAY (gimp_int16_array_get_type ())
#define GIMP_VALUE_HOLDS_INT16_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_INT16_ARRAY))
GType gimp_int16_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT16_ARRAY
*/
#define GIMP_TYPE_PARAM_INT16_ARRAY (gimp_param_int16_array_get_type ())
#define GIMP_PARAM_SPEC_INT16_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT16_ARRAY, GimpParamSpecInt16Array))
#define GIMP_IS_PARAM_SPEC_INT16_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT16_ARRAY))
typedef struct _GimpParamSpecInt16Array GimpParamSpecInt16Array;
struct _GimpParamSpecInt16Array
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_int16_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int16_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gint16 * gimp_value_get_int16_array (const GValue *value);
gint16 * gimp_value_dup_int16_array (const GValue *value);
void gimp_value_set_int16_array (GValue *value,
const gint16 *array,
gsize length);
void gimp_value_set_static_int16_array (GValue *value,
const gint16 *array,
gsize length);
void gimp_value_take_int16_array (GValue *value,
gint16 *array,
gsize length);
/*
* GIMP_TYPE_INT32_ARRAY
*/
#define GIMP_TYPE_INT32_ARRAY (gimp_int32_array_get_type ())
#define GIMP_VALUE_HOLDS_INT32_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_INT32_ARRAY))
GType gimp_int32_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT32_ARRAY
*/
#define GIMP_TYPE_PARAM_INT32_ARRAY (gimp_param_int32_array_get_type ())
#define GIMP_PARAM_SPEC_INT32_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT32_ARRAY, GimpParamSpecInt32Array))
#define GIMP_IS_PARAM_SPEC_INT32_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT32_ARRAY))
typedef struct _GimpParamSpecInt32Array GimpParamSpecInt32Array;
struct _GimpParamSpecInt32Array
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_int32_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int32_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gint32 * gimp_value_get_int32_array (const GValue *value);
gint32 * gimp_value_dup_int32_array (const GValue *value);
void gimp_value_set_int32_array (GValue *value,
const gint32 *array,
gsize length);
void gimp_value_set_static_int32_array (GValue *value,
const gint32 *array,
gsize length);
void gimp_value_take_int32_array (GValue *value,
gint32 *array,
gsize length);
/*
* GIMP_TYPE_FLOAT_ARRAY
*/
#define GIMP_TYPE_FLOAT_ARRAY (gimp_float_array_get_type ())
#define GIMP_VALUE_HOLDS_FLOAT_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_FLOAT_ARRAY))
GType gimp_float_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_FLOAT_ARRAY
*/
#define GIMP_TYPE_PARAM_FLOAT_ARRAY (gimp_param_float_array_get_type ())
#define GIMP_PARAM_SPEC_FLOAT_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_FLOAT_ARRAY, GimpParamSpecFloatArray))
#define GIMP_IS_PARAM_SPEC_FLOAT_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_FLOAT_ARRAY))
typedef struct _GimpParamSpecFloatArray GimpParamSpecFloatArray;
struct _GimpParamSpecFloatArray
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_float_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_float_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gdouble * gimp_value_get_float_array (const GValue *value);
gdouble * gimp_value_dup_float_array (const GValue *value);
void gimp_value_set_float_array (GValue *value,
const gdouble *array,
gsize length);
void gimp_value_set_static_float_array (GValue *value,
const gdouble *array,
gsize length);
void gimp_value_take_float_array (GValue *value,
gdouble *array,
gsize length);
/*
* GIMP_TYPE_STRING_ARRAY
*/
GimpArray * gimp_string_array_new (const gchar **data,
gsize length,
gboolean static_data);
GimpArray * gimp_string_array_copy (const GimpArray *array);
void gimp_string_array_free (GimpArray *array);
#define GIMP_TYPE_STRING_ARRAY (gimp_string_array_get_type ())
#define GIMP_VALUE_HOLDS_STRING_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_STRING_ARRAY))
GType gimp_string_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_STRING_ARRAY
*/
#define GIMP_TYPE_PARAM_STRING_ARRAY (gimp_param_string_array_get_type ())
#define GIMP_PARAM_SPEC_STRING_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_STRING_ARRAY, GimpParamSpecStringArray))
#define GIMP_IS_PARAM_SPEC_STRING_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_STRING_ARRAY))
typedef struct _GimpParamSpecStringArray GimpParamSpecStringArray;
struct _GimpParamSpecStringArray
{
GParamSpecBoxed parent_instance;
};
GType gimp_param_string_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_string_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gchar ** gimp_value_get_string_array (const GValue *value);
gchar ** gimp_value_dup_string_array (const GValue *value);
void gimp_value_set_string_array (GValue *value,
const gchar **array,
gsize length);
void gimp_value_set_static_string_array (GValue *value,
const gchar **array,
gsize length);
void gimp_value_take_string_array (GValue *value,
gchar **array,
gsize length);
/*
* GIMP_TYPE_RGB_ARRAY
*/
#define GIMP_TYPE_RGB_ARRAY (gimp_rgb_array_get_type ())
#define GIMP_VALUE_HOLDS_RGB_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_RGB_ARRAY))
GType gimp_rgb_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_RGB_ARRAY
*/
#define GIMP_TYPE_PARAM_RGB_ARRAY (gimp_param_rgb_array_get_type ())
#define GIMP_PARAM_SPEC_RGB_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_RGB_ARRAY, GimpParamSpecRGBArray))
#define GIMP_IS_PARAM_SPEC_RGB_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_RGB_ARRAY))
typedef struct _GimpParamSpecRGBArray GimpParamSpecRGBArray;
struct _GimpParamSpecRGBArray
{
GParamSpecBoxed parent_instance;
};
GType gimp_param_rgb_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_rgb_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const GimpRGB * gimp_value_get_rgb_array (const GValue *value);
GimpRGB * gimp_value_dup_rgb_array (const GValue *value);
void gimp_value_set_rgb_array (GValue *value,
const GimpRGB *array,
gsize length);
void gimp_value_set_static_rgb_array (GValue *value,
const GimpRGB *array,
gsize length);
void gimp_value_take_rgb_array (GValue *value,
GimpRGB *array,
gsize length);
#endif /* __GIMP_PARAM_SPECS_H__ */
#endif /* __APP_GIMP_PARAM_SPECS_H__ */

View File

@ -755,7 +755,8 @@ gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
null_name = TRUE;
}
else if (! (VALIDATE (proc_install->params[i].name) &&
VALIDATE_OR_NULL (proc_install->params[i].description)))
VALIDATE_OR_NULL (proc_install->params[i].nick) &&
VALIDATE_OR_NULL (proc_install->params[i].blurb)))
{
valid_utf8 = FALSE;
}
@ -768,7 +769,8 @@ gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
null_name = TRUE;
}
else if (! (VALIDATE (proc_install->return_vals[i].name) &&
VALIDATE_OR_NULL (proc_install->return_vals[i].description)))
VALIDATE_OR_NULL (proc_install->return_vals[i].nick) &&
VALIDATE_OR_NULL (proc_install->return_vals[i].blurb)))
{
valid_utf8 = FALSE;
}
@ -861,7 +863,8 @@ gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
gimp_pdb_compat_param_spec (plug_in->manager->gimp,
proc_install->params[i].type,
proc_install->params[i].name,
proc_install->params[i].description);
proc_install->params[i].nick,
proc_install->params[i].blurb);
gimp_procedure_add_argument (procedure, pspec);
}
@ -872,7 +875,8 @@ gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
gimp_pdb_compat_param_spec (plug_in->manager->gimp,
proc_install->return_vals[i].type,
proc_install->return_vals[i].name,
proc_install->return_vals[i].description);
proc_install->return_vals[i].nick,
proc_install->return_vals[i].blurb);
gimp_procedure_add_return_value (procedure, pspec);
}

View File

@ -22,6 +22,8 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "plug-in-types.h"
#include "core/gimp.h"

View File

@ -24,6 +24,8 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "plug-in-types.h"
#include "core/gimp.h"

View File

@ -744,7 +744,8 @@ plug_in_proc_arg_deserialize (GScanner *scanner,
GTokenType token;
gint arg_type;
gchar *name = NULL;
gchar *desc = NULL;
gchar *nick = NULL;
gchar *blurb = NULL;
GParamSpec *pspec;
if (! gimp_scanner_parse_token (scanner, G_TOKEN_LEFT_PAREN))
@ -770,7 +771,12 @@ plug_in_proc_arg_deserialize (GScanner *scanner,
token = G_TOKEN_STRING;
goto error;
}
if (! gimp_scanner_parse_string (scanner, &desc))
if (! gimp_scanner_parse_string (scanner, &nick))
{
token = G_TOKEN_STRING;
goto error;
}
if (! gimp_scanner_parse_string (scanner, &blurb))
{
token = G_TOKEN_STRING;
goto error;
@ -784,7 +790,7 @@ plug_in_proc_arg_deserialize (GScanner *scanner,
token = G_TOKEN_LEFT_PAREN;
pspec = gimp_pdb_compat_param_spec (gimp, arg_type, name, desc);
pspec = gimp_pdb_compat_param_spec (gimp, arg_type, name, nick, blurb);
if (return_value)
gimp_procedure_add_return_value (procedure, pspec);
@ -794,7 +800,8 @@ plug_in_proc_arg_deserialize (GScanner *scanner,
error:
g_free (name);
g_free (desc);
g_free (nick);
g_free (blurb);
return token;
}
@ -1063,6 +1070,8 @@ plug_in_rc_write (GSList *plug_in_defs,
gimp_config_writer_string (writer,
g_param_spec_get_name (pspec));
gimp_config_writer_string (writer,
g_param_spec_get_nick (pspec));
gimp_config_writer_string (writer,
g_param_spec_get_blurb (pspec));
@ -1079,6 +1088,8 @@ plug_in_rc_write (GSList *plug_in_defs,
gimp_config_writer_string (writer,
g_param_spec_get_name (pspec));
gimp_config_writer_string (writer,
g_param_spec_get_nick (pspec));
gimp_config_writer_string (writer,
g_param_spec_get_blurb (pspec));

View File

@ -125,6 +125,7 @@ libgimpbaseinclude_HEADERS = \
gimpcpuaccel.h \
gimplimits.h \
gimpparam.h \
gimpparamspecs.h \
gimpversion.h \
\
gimpchecks.h \

View File

@ -18,6 +18,8 @@ libgimpbase_introspectable = \
$(top_srcdir)/libgimpbase/gimpmemsize.h \
$(top_srcdir)/libgimpbase/gimpmetadata.c \
$(top_srcdir)/libgimpbase/gimpmetadata.h \
$(top_srcdir)/libgimpbase/gimpparamspecs.c \
$(top_srcdir)/libgimpbase/gimpparamspecs.h \
$(top_srcdir)/libgimpbase/gimpparasite.c \
$(top_srcdir)/libgimpbase/gimpparasite.h \
$(top_srcdir)/libgimpbase/gimpparasiteio.c \

View File

@ -1,6 +1,10 @@
EXPORTS
gimp_add_mask_type_get_type
gimp_any_to_utf8
gimp_array_copy
gimp_array_free
gimp_array_get_type
gimp_array_new
gimp_base_compat_enums_init
gimp_base_init
gimp_blend_mode_get_type
@ -47,6 +51,7 @@ EXPORTS
gimp_flags_value_get_abbrev
gimp_flags_value_get_desc
gimp_flags_value_get_help
gimp_float_array_get_type
gimp_foreground_extract_mode_get_type
gimp_gradient_blend_color_space_get_type
gimp_gradient_segment_color_get_type
@ -61,6 +66,12 @@ EXPORTS
gimp_ink_blob_type_get_type
gimp_installation_directory
gimp_installation_directory_file
gimp_int16_array_get_type
gimp_int16_get_type
gimp_int32_array_get_type
gimp_int32_get_type
gimp_int8_array_get_type
gimp_int8_get_type
gimp_interpolation_type_get_type
gimp_join_style_get_type
gimp_locale_directory
@ -96,12 +107,34 @@ EXPORTS
gimp_offset_type_get_type
gimp_orientation_type_get_type
gimp_paint_application_mode_get_type
gimp_param_array_get_type
gimp_param_float_array_get_type
gimp_param_int16_array_get_type
gimp_param_int16_get_type
gimp_param_int32_array_get_type
gimp_param_int32_get_type
gimp_param_int8_array_get_type
gimp_param_int8_get_type
gimp_param_memsize_get_type
gimp_param_parasite_get_type
gimp_param_rgb_array_get_type
gimp_param_spec_array
gimp_param_spec_float_array
gimp_param_spec_int16
gimp_param_spec_int16_array
gimp_param_spec_int32
gimp_param_spec_int32_array
gimp_param_spec_int8
gimp_param_spec_int8_array
gimp_param_spec_memsize
gimp_param_spec_parasite
gimp_param_spec_rgb_array
gimp_param_spec_string
gimp_param_spec_string_array
gimp_param_spec_unit
gimp_param_spec_value_array
gimp_param_string_array_get_type
gimp_param_string_get_type
gimp_param_unit_get_type
gimp_param_value_array_get_type
gimp_parasite_compare
@ -138,6 +171,7 @@ EXPORTS
gimp_rectangle_intersect
gimp_rectangle_union
gimp_repeat_mode_get_type
gimp_rgb_array_get_type
gimp_rotation_type_get_type
gimp_run_mode_get_type
gimp_select_criterion_get_type
@ -147,6 +181,10 @@ EXPORTS
gimp_stack_trace_mode_get_type
gimp_stack_trace_print
gimp_stack_trace_query
gimp_string_array_copy
gimp_string_array_free
gimp_string_array_get_type
gimp_string_array_new
gimp_strip_uline
gimp_stroke_method_get_type
gimp_sysconf_directory
@ -192,6 +230,36 @@ EXPORTS
gimp_value_array_remove
gimp_value_array_truncate
gimp_value_array_unref
gimp_value_dup_float_array
gimp_value_dup_int16_array
gimp_value_dup_int32_array
gimp_value_dup_int8_array
gimp_value_dup_rgb_array
gimp_value_dup_string_array
gimp_value_get_float_array
gimp_value_get_int16_array
gimp_value_get_int32_array
gimp_value_get_int8_array
gimp_value_get_rgb_array
gimp_value_get_string_array
gimp_value_set_float_array
gimp_value_set_int16_array
gimp_value_set_int32_array
gimp_value_set_int8_array
gimp_value_set_rgb_array
gimp_value_set_static_float_array
gimp_value_set_static_int16_array
gimp_value_set_static_int32_array
gimp_value_set_static_int8_array
gimp_value_set_static_rgb_array
gimp_value_set_static_string_array
gimp_value_set_string_array
gimp_value_take_float_array
gimp_value_take_int16_array
gimp_value_take_int32_array
gimp_value_take_int8_array
gimp_value_take_rgb_array
gimp_value_take_string_array
gimp_vectors_stroke_type_get_type
gimp_wire_clear_error
gimp_wire_destroy

View File

@ -29,6 +29,7 @@
#include <libgimpbase/gimplimits.h>
#include <libgimpbase/gimpmemsize.h>
#include <libgimpbase/gimpmetadata.h>
#include <libgimpbase/gimpparamspecs.h>
#include <libgimpbase/gimpparasite.h>
#include <libgimpbase/gimprectangle.h>
#include <libgimpbase/gimpunit.h>

1542
libgimpbase/gimpparamspecs.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,505 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpparamspecs.h
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <https://www.gnu.org/licenses/>.
*/
#if !defined (__GIMP_BASE_H_INSIDE__) && !defined (GIMP_BASE_COMPILATION)
#error "Only <libgimpbase/gimpbase.h> can be included directly."
#endif
#ifndef __GIMP_PARAM_SPECS_H__
#define __GIMP_PARAM_SPECS_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
/*
* Keep in sync with libgimpconfig/gimpconfig-params.h
*/
#define GIMP_PARAM_NO_VALIDATE (1 << (6 + G_PARAM_USER_SHIFT))
/*
* GIMP_TYPE_INT32
*/
#define GIMP_TYPE_INT32 (gimp_int32_get_type ())
#define GIMP_VALUE_HOLDS_INT32(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
GIMP_TYPE_INT32))
GType gimp_int32_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT32
*/
#define GIMP_TYPE_PARAM_INT32 (gimp_param_int32_get_type ())
#define GIMP_PARAM_SPEC_INT32(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT32, GimpParamSpecInt32))
#define GIMP_IS_PARAM_SPEC_INT32(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT32))
typedef struct _GimpParamSpecInt32 GimpParamSpecInt32;
struct _GimpParamSpecInt32
{
GParamSpecInt parent_instance;
};
GType gimp_param_int32_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int32 (const gchar *name,
const gchar *nick,
const gchar *blurb,
gint minimum,
gint maximum,
gint default_value,
GParamFlags flags);
/*
* GIMP_TYPE_INT16
*/
#define GIMP_TYPE_INT16 (gimp_int16_get_type ())
#define GIMP_VALUE_HOLDS_INT16(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
GIMP_TYPE_INT16))
GType gimp_int16_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT16
*/
#define GIMP_TYPE_PARAM_INT16 (gimp_param_int16_get_type ())
#define GIMP_PARAM_SPEC_INT16(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT16, GimpParamSpecInt16))
#define GIMP_IS_PARAM_SPEC_INT16(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT16))
typedef struct _GimpParamSpecInt16 GimpParamSpecInt16;
struct _GimpParamSpecInt16
{
GParamSpecInt parent_instance;
};
GType gimp_param_int16_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int16 (const gchar *name,
const gchar *nick,
const gchar *blurb,
gint minimum,
gint maximum,
gint default_value,
GParamFlags flags);
/*
* GIMP_TYPE_INT8
*/
#define GIMP_TYPE_INT8 (gimp_int8_get_type ())
#define GIMP_VALUE_HOLDS_INT8(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
GIMP_TYPE_INT8))
GType gimp_int8_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT8
*/
#define GIMP_TYPE_PARAM_INT8 (gimp_param_int8_get_type ())
#define GIMP_PARAM_SPEC_INT8(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT8, GimpParamSpecInt8))
#define GIMP_IS_PARAM_SPEC_INT8(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT8))
typedef struct _GimpParamSpecInt8 GimpParamSpecInt8;
struct _GimpParamSpecInt8
{
GParamSpecUInt parent_instance;
};
GType gimp_param_int8_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int8 (const gchar *name,
const gchar *nick,
const gchar *blurb,
guint minimum,
guint maximum,
guint default_value,
GParamFlags flags);
/*
* GIMP_TYPE_PARAM_STRING
*/
#define GIMP_TYPE_PARAM_STRING (gimp_param_string_get_type ())
#define GIMP_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_STRING, GimpParamSpecString))
#define GIMP_IS_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_STRING))
typedef struct _GimpParamSpecString GimpParamSpecString;
struct _GimpParamSpecString
{
GParamSpecString parent_instance;
guint allow_non_utf8 : 1;
guint non_empty : 1;
};
GType gimp_param_string_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_string (const gchar *name,
const gchar *nick,
const gchar *blurb,
gboolean allow_non_utf8,
gboolean null_ok,
gboolean non_empty,
const gchar *default_value,
GParamFlags flags);
/*
* GIMP_TYPE_ARRAY
*/
typedef struct _GimpArray GimpArray;
struct _GimpArray
{
guint8 *data;
gsize length;
gboolean static_data;
};
GimpArray * gimp_array_new (const guint8 *data,
gsize length,
gboolean static_data);
GimpArray * gimp_array_copy (const GimpArray *array);
void gimp_array_free (GimpArray *array);
#define GIMP_TYPE_ARRAY (gimp_array_get_type ())
#define GIMP_VALUE_HOLDS_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_ARRAY))
GType gimp_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_ARRAY
*/
#define GIMP_TYPE_PARAM_ARRAY (gimp_param_array_get_type ())
#define GIMP_PARAM_SPEC_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_ARRAY, GimpParamSpecArray))
#define GIMP_IS_PARAM_SPEC_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_ARRAY))
typedef struct _GimpParamSpecArray GimpParamSpecArray;
struct _GimpParamSpecArray
{
GParamSpecBoxed parent_instance;
};
GType gimp_param_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
/*
* GIMP_TYPE_INT8_ARRAY
*/
#define GIMP_TYPE_INT8_ARRAY (gimp_int8_array_get_type ())
#define GIMP_VALUE_HOLDS_INT8_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_INT8_ARRAY))
GType gimp_int8_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT8_ARRAY
*/
#define GIMP_TYPE_PARAM_INT8_ARRAY (gimp_param_int8_array_get_type ())
#define GIMP_PARAM_SPEC_INT8_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT8_ARRAY, GimpParamSpecInt8Array))
#define GIMP_IS_PARAM_SPEC_INT8_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT8_ARRAY))
typedef struct _GimpParamSpecInt8Array GimpParamSpecInt8Array;
struct _GimpParamSpecInt8Array
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_int8_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int8_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const guint8 * gimp_value_get_int8_array (const GValue *value);
guint8 * gimp_value_dup_int8_array (const GValue *value);
void gimp_value_set_int8_array (GValue *value,
const guint8 *array,
gsize length);
void gimp_value_set_static_int8_array (GValue *value,
const guint8 *array,
gsize length);
void gimp_value_take_int8_array (GValue *value,
guint8 *array,
gsize length);
/*
* GIMP_TYPE_INT16_ARRAY
*/
#define GIMP_TYPE_INT16_ARRAY (gimp_int16_array_get_type ())
#define GIMP_VALUE_HOLDS_INT16_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_INT16_ARRAY))
GType gimp_int16_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT16_ARRAY
*/
#define GIMP_TYPE_PARAM_INT16_ARRAY (gimp_param_int16_array_get_type ())
#define GIMP_PARAM_SPEC_INT16_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT16_ARRAY, GimpParamSpecInt16Array))
#define GIMP_IS_PARAM_SPEC_INT16_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT16_ARRAY))
typedef struct _GimpParamSpecInt16Array GimpParamSpecInt16Array;
struct _GimpParamSpecInt16Array
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_int16_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int16_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gint16 * gimp_value_get_int16_array (const GValue *value);
gint16 * gimp_value_dup_int16_array (const GValue *value);
void gimp_value_set_int16_array (GValue *value,
const gint16 *array,
gsize length);
void gimp_value_set_static_int16_array (GValue *value,
const gint16 *array,
gsize length);
void gimp_value_take_int16_array (GValue *value,
gint16 *array,
gsize length);
/*
* GIMP_TYPE_INT32_ARRAY
*/
#define GIMP_TYPE_INT32_ARRAY (gimp_int32_array_get_type ())
#define GIMP_VALUE_HOLDS_INT32_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_INT32_ARRAY))
GType gimp_int32_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT32_ARRAY
*/
#define GIMP_TYPE_PARAM_INT32_ARRAY (gimp_param_int32_array_get_type ())
#define GIMP_PARAM_SPEC_INT32_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT32_ARRAY, GimpParamSpecInt32Array))
#define GIMP_IS_PARAM_SPEC_INT32_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT32_ARRAY))
typedef struct _GimpParamSpecInt32Array GimpParamSpecInt32Array;
struct _GimpParamSpecInt32Array
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_int32_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int32_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gint32 * gimp_value_get_int32_array (const GValue *value);
gint32 * gimp_value_dup_int32_array (const GValue *value);
void gimp_value_set_int32_array (GValue *value,
const gint32 *array,
gsize length);
void gimp_value_set_static_int32_array (GValue *value,
const gint32 *array,
gsize length);
void gimp_value_take_int32_array (GValue *value,
gint32 *array,
gsize length);
/*
* GIMP_TYPE_FLOAT_ARRAY
*/
#define GIMP_TYPE_FLOAT_ARRAY (gimp_float_array_get_type ())
#define GIMP_VALUE_HOLDS_FLOAT_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_FLOAT_ARRAY))
GType gimp_float_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_FLOAT_ARRAY
*/
#define GIMP_TYPE_PARAM_FLOAT_ARRAY (gimp_param_float_array_get_type ())
#define GIMP_PARAM_SPEC_FLOAT_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_FLOAT_ARRAY, GimpParamSpecFloatArray))
#define GIMP_IS_PARAM_SPEC_FLOAT_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_FLOAT_ARRAY))
typedef struct _GimpParamSpecFloatArray GimpParamSpecFloatArray;
struct _GimpParamSpecFloatArray
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_float_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_float_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gdouble * gimp_value_get_float_array (const GValue *value);
gdouble * gimp_value_dup_float_array (const GValue *value);
void gimp_value_set_float_array (GValue *value,
const gdouble *array,
gsize length);
void gimp_value_set_static_float_array (GValue *value,
const gdouble *array,
gsize length);
void gimp_value_take_float_array (GValue *value,
gdouble *array,
gsize length);
/*
* GIMP_TYPE_STRING_ARRAY
*/
GimpArray * gimp_string_array_new (const gchar **data,
gsize length,
gboolean static_data);
GimpArray * gimp_string_array_copy (const GimpArray *array);
void gimp_string_array_free (GimpArray *array);
#define GIMP_TYPE_STRING_ARRAY (gimp_string_array_get_type ())
#define GIMP_VALUE_HOLDS_STRING_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_STRING_ARRAY))
GType gimp_string_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_STRING_ARRAY
*/
#define GIMP_TYPE_PARAM_STRING_ARRAY (gimp_param_string_array_get_type ())
#define GIMP_PARAM_SPEC_STRING_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_STRING_ARRAY, GimpParamSpecStringArray))
#define GIMP_IS_PARAM_SPEC_STRING_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_STRING_ARRAY))
typedef struct _GimpParamSpecStringArray GimpParamSpecStringArray;
struct _GimpParamSpecStringArray
{
GParamSpecBoxed parent_instance;
};
GType gimp_param_string_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_string_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gchar ** gimp_value_get_string_array (const GValue *value);
gchar ** gimp_value_dup_string_array (const GValue *value);
void gimp_value_set_string_array (GValue *value,
const gchar **array,
gsize length);
void gimp_value_set_static_string_array (GValue *value,
const gchar **array,
gsize length);
void gimp_value_take_string_array (GValue *value,
gchar **array,
gsize length);
/*
* GIMP_TYPE_RGB_ARRAY
*/
#define GIMP_TYPE_RGB_ARRAY (gimp_rgb_array_get_type ())
#define GIMP_VALUE_HOLDS_RGB_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_RGB_ARRAY))
GType gimp_rgb_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_RGB_ARRAY
*/
#define GIMP_TYPE_PARAM_RGB_ARRAY (gimp_param_rgb_array_get_type ())
#define GIMP_PARAM_SPEC_RGB_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_RGB_ARRAY, GimpParamSpecRGBArray))
#define GIMP_IS_PARAM_SPEC_RGB_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_RGB_ARRAY))
typedef struct _GimpParamSpecRGBArray GimpParamSpecRGBArray;
struct _GimpParamSpecRGBArray
{
GParamSpecBoxed parent_instance;
};
GType gimp_param_rgb_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_rgb_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const GimpRGB * gimp_value_get_rgb_array (const GValue *value);
GimpRGB * gimp_value_dup_rgb_array (const GValue *value);
void gimp_value_set_rgb_array (GValue *value,
const GimpRGB *array,
gsize length);
void gimp_value_set_static_rgb_array (GValue *value,
const GimpRGB *array,
gsize length);
void gimp_value_take_rgb_array (GValue *value,
GimpRGB *array,
gsize length);
G_END_DECLS
#endif /* __GIMP_PARAM_SPECS_H__ */