2006-12-10 05:33:38 +08:00
|
|
|
# GIMP - The GNU Image Manipulation Program
|
2003-07-03 08:47:26 +08:00
|
|
|
# Copyright (C) 1998-2003 Manish Singh <yosh@gimp.org>
|
1998-10-24 13:19:30 +08:00
|
|
|
|
2009-01-18 06:28:01 +08:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
1998-10-24 13:19:30 +08:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
1998-10-24 13:19:30 +08:00
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
# This program 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 General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2018-07-12 05:27:07 +08:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
1998-10-24 13:19:30 +08:00
|
|
|
|
|
|
|
package Gimp::CodeGen::pdb;
|
|
|
|
|
|
|
|
%arg_types = (
|
2019-07-30 16:39:56 +08:00
|
|
|
int32 => { name => 'INT32',
|
2019-08-15 20:04:56 +08:00
|
|
|
gtype => 'G_TYPE_INT',
|
|
|
|
type => 'gint ',
|
|
|
|
const_type => 'gint ',
|
2019-07-30 16:39:56 +08:00
|
|
|
init_value => '0',
|
|
|
|
get_value_func => '$var = g_value_get_int ($value)',
|
|
|
|
dup_value_func => '$var = g_value_get_int ($value)',
|
|
|
|
set_value_func => 'g_value_set_int ($value, $var)',
|
|
|
|
take_value_func => 'g_value_set_int ($value, $var)' },
|
|
|
|
|
2019-08-15 21:11:18 +08:00
|
|
|
uchar => { name => 'UCHAR',
|
2019-08-15 19:34:11 +08:00
|
|
|
gtype => 'G_TYPE_UCHAR',
|
2019-08-15 21:11:18 +08:00
|
|
|
type => 'guchar ',
|
|
|
|
const_type => 'guchar ',
|
2019-07-30 16:39:56 +08:00
|
|
|
init_value => '0',
|
2019-08-15 19:34:11 +08:00
|
|
|
get_value_func => '$var = g_value_get_uchar ($value)',
|
|
|
|
dup_value_func => '$var = g_value_get_uchar ($value)',
|
|
|
|
set_value_func => 'g_value_set_uchar ($value, $var)',
|
|
|
|
take_value_func => 'g_value_set_uchar ($value, $var)' },
|
2019-07-30 16:39:56 +08:00
|
|
|
|
|
|
|
float => { name => 'FLOAT',
|
|
|
|
gtype => 'G_TYPE_DOUBLE',
|
|
|
|
type => 'gdouble ',
|
|
|
|
const_type => 'gdouble ',
|
|
|
|
init_value => '0.0',
|
|
|
|
get_value_func => '$var = g_value_get_double ($value)',
|
|
|
|
dup_value_func => '$var = g_value_get_double ($value)',
|
|
|
|
set_value_func => 'g_value_set_double ($value, $var)',
|
|
|
|
take_value_func => 'g_value_set_double ($value, $var)' },
|
|
|
|
|
|
|
|
string => { name => 'STRING',
|
|
|
|
gtype => 'G_TYPE_STRING',
|
|
|
|
type => 'gchar *',
|
|
|
|
const_type => 'const gchar *',
|
|
|
|
init_value => 'NULL',
|
2019-08-01 00:58:52 +08:00
|
|
|
out_annotate => '(transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = g_value_get_string ($value)',
|
|
|
|
dup_value_func => '$var = g_value_dup_string ($value)',
|
|
|
|
set_value_func => 'g_value_set_string ($value, $var)',
|
|
|
|
take_value_func => 'g_value_take_string ($value, $var)' },
|
|
|
|
|
|
|
|
int32array => { name => 'INT32ARRAY',
|
|
|
|
gtype => 'GIMP_TYPE_INT32_ARRAY',
|
|
|
|
type => 'gint32 *',
|
|
|
|
const_type => 'const gint32 *',
|
|
|
|
array => 1,
|
|
|
|
init_value => 'NULL',
|
2019-08-01 00:58:52 +08:00
|
|
|
in_annotate => '(element-type gint32)',
|
|
|
|
out_annotate => '(element-type gint32) (transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_int32_array ($value)',
|
|
|
|
dup_value_func => '$var = gimp_value_dup_int32_array ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_int32_array ($value, $var, $var_len)',
|
|
|
|
take_value_func => 'gimp_value_take_int32_array ($value, $var, $var_len)' },
|
|
|
|
|
|
|
|
int16array => { name => 'INT16ARRAY',
|
|
|
|
gtype => 'GIMP_TYPE_INT16_ARRAY',
|
|
|
|
type => 'gint16 *',
|
|
|
|
const_type => 'const gint16 *',
|
|
|
|
array => 1,
|
|
|
|
init_value => 'NULL',
|
2019-08-01 00:58:52 +08:00
|
|
|
in_annotate => '(element-type gint16)',
|
|
|
|
out_annotate => '(element-type gint16) (transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_int16_array ($value)',
|
|
|
|
dup_value_func => '$var = gimp_value_dup_int16_array ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_int16_array ($value, $var, $var_len)',
|
|
|
|
take_value_func => 'gimp_value_take_int16_array ($value, $var, $var_len)' },
|
|
|
|
|
|
|
|
int8array => { name => 'INT8ARRAY',
|
2019-08-15 21:04:34 +08:00
|
|
|
gtype => 'GIMP_TYPE_UINT8_ARRAY',
|
2019-07-30 16:39:56 +08:00
|
|
|
type => 'guint8 *',
|
|
|
|
const_type => 'const guint8 *',
|
|
|
|
array => 1,
|
|
|
|
init_value => 'NULL',
|
2019-08-01 00:58:52 +08:00
|
|
|
in_annotate => '(element-type guint8)',
|
|
|
|
out_annotate => '(element-type guint8) (transfer full)',
|
2019-08-15 21:04:34 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_uint8_array ($value)',
|
|
|
|
dup_value_func => '$var = gimp_value_dup_uint8_array ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_uint8_array ($value, $var, $var_len)',
|
|
|
|
take_value_func => 'gimp_value_take_uint8_array ($value, $var, $var_len)' },
|
2019-07-30 16:39:56 +08:00
|
|
|
|
|
|
|
floatarray => { name => 'FLOATARRAY',
|
|
|
|
gtype => 'GIMP_TYPE_FLOAT_ARRAY',
|
|
|
|
type => 'gdouble *',
|
|
|
|
const_type => 'const gdouble *',
|
|
|
|
array => 1,
|
|
|
|
init_value => 'NULL',
|
2019-08-01 00:58:52 +08:00
|
|
|
in_annotate => '(element-type gdouble)',
|
|
|
|
out_annotate => '(element-type gdouble) (transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_float_array ($value)',
|
|
|
|
dup_value_func => '$var = gimp_value_dup_float_array ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_float_array ($value, $var, $var_len)',
|
|
|
|
take_value_func => 'gimp_value_take_float_array ($value, $var, $var_len)' },
|
|
|
|
|
|
|
|
stringarray => { name => 'STRINGARRAY',
|
|
|
|
gtype => 'GIMP_TYPE_STRING_ARRAY',
|
|
|
|
type => 'gchar **',
|
|
|
|
const_type => 'const gchar **',
|
|
|
|
array => 1,
|
|
|
|
init_value => 'NULL',
|
2019-08-01 00:58:52 +08:00
|
|
|
in_annotate => '(element-type gchar*)',
|
|
|
|
out_annotate => '(element-type gchar*) (transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_string_array ($value)',
|
|
|
|
dup_value_func => '$var = gimp_value_dup_string_array ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_string_array ($value, $var, $var_len)',
|
|
|
|
take_value_func => 'gimp_value_take_string_array ($value, $var, $var_len)' },
|
|
|
|
|
|
|
|
colorarray => { name => 'COLORARRAY',
|
|
|
|
gtype => 'GIMP_TYPE_RGB_ARRAY',
|
|
|
|
type => 'GimpRGB *',
|
|
|
|
const_type => 'const GimpRGB *',
|
|
|
|
array => 1,
|
|
|
|
init_value => 'NULL',
|
2019-08-01 00:58:52 +08:00
|
|
|
in_annotate => '(element-type GimpRGB)',
|
|
|
|
out_annotate => '(element-type GimpRGB) (transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_rgb_array ($value)',
|
|
|
|
dup_value_func => '$var = gimp_value_dup_rgb_array ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_rgb_array ($value, $var, $var_len)',
|
|
|
|
take_value_func => 'gimp_value_take_rgb_array ($value, $var, $var_len)' },
|
|
|
|
|
|
|
|
color => { name => 'COLOR',
|
|
|
|
gtype => 'GIMP_TYPE_RGB',
|
|
|
|
type => 'GimpRGB ',
|
|
|
|
const_type => 'GimpRGB ',
|
|
|
|
struct => 1,
|
|
|
|
init_value => '{ 0.0, 0.0, 0.0, 1.0 }',
|
|
|
|
get_value_func => 'gimp_value_get_rgb ($value, &$var)',
|
|
|
|
dup_value_func => 'gimp_value_get_rgb ($value, &$var)',
|
|
|
|
set_value_func => 'gimp_value_set_rgb ($value, $var)',
|
|
|
|
take_value_func => 'gimp_value_set_rgb ($value, &$var)',
|
|
|
|
headers => [ qw(<cairo.h> "libgimpcolor/gimpcolor.h") ] },
|
|
|
|
|
|
|
|
display => { name => 'DISPLAY',
|
|
|
|
gtype => 'GIMP_TYPE_DISPLAY_ID',
|
|
|
|
type => 'GimpObject *',
|
|
|
|
const_type => 'GimpObject *',
|
|
|
|
id => 1,
|
|
|
|
init_value => 'NULL',
|
|
|
|
get_value_func => '$var = gimp_value_get_display ($value, gimp)',
|
|
|
|
dup_value_func => '$var = gimp_value_get_display_id ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_display_id ($value, $var)',
|
|
|
|
take_value_func => 'gimp_value_set_display ($value, $var)' },
|
|
|
|
|
|
|
|
image => { name => 'IMAGE',
|
|
|
|
gtype => 'GIMP_TYPE_IMAGE_ID',
|
|
|
|
type => 'GimpImage *',
|
|
|
|
const_type => 'GimpImage *',
|
|
|
|
init_value => 'NULL',
|
2019-08-11 20:20:05 +08:00
|
|
|
out_annotate => '(transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_image ($value, gimp)',
|
2019-08-12 20:44:07 +08:00
|
|
|
dup_value_func => '$var = gimp_image_new_by_id (gimp_value_get_image_id ($value))',
|
|
|
|
dup_value_func_d=> '$var = gimp_value_get_image_id ($value)',
|
2019-08-11 20:20:05 +08:00
|
|
|
set_value_func => 'gimp_value_set_image_id ($value, gimp_image_get_id ($var))',
|
2019-07-30 16:39:56 +08:00
|
|
|
take_value_func => 'gimp_value_set_image ($value, $var)',
|
2019-08-11 20:20:05 +08:00
|
|
|
convert_func => 'gimp_image_get_id ($var)',
|
2019-07-30 16:39:56 +08:00
|
|
|
headers => [ qw("core/gimpimage.h") ] },
|
|
|
|
|
|
|
|
item => { name => 'ITEM',
|
|
|
|
gtype => 'GIMP_TYPE_ITEM_ID',
|
|
|
|
type => 'GimpItem *',
|
|
|
|
const_type => 'GimpItem *',
|
|
|
|
init_value => 'NULL',
|
2019-08-13 19:59:33 +08:00
|
|
|
out_annotate => '(transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_item ($value, gimp)',
|
2019-08-13 19:59:33 +08:00
|
|
|
dup_value_func => '$var = gimp_item_new_by_id (gimp_value_get_item_id ($value))',
|
|
|
|
dup_value_func_d=> '$var = gimp_value_get_item_id ($value)',
|
2019-07-30 16:39:56 +08:00
|
|
|
set_value_func => 'gimp_value_set_item_id ($value, $var)',
|
|
|
|
take_value_func => 'gimp_value_set_item ($value, $var)',
|
2019-08-13 19:59:33 +08:00
|
|
|
convert_func => 'gimp_item_get_id (GIMP_ITEM ($var))',
|
2019-07-30 16:39:56 +08:00
|
|
|
headers => [ qw("core/gimpitem.h") ] },
|
|
|
|
|
|
|
|
layer => { name => 'LAYER',
|
|
|
|
gtype => 'GIMP_TYPE_LAYER_ID',
|
|
|
|
type => 'GimpLayer *',
|
|
|
|
const_type => 'GimpLayer *',
|
|
|
|
init_value => 'NULL',
|
2019-08-13 19:59:33 +08:00
|
|
|
out_annotate => '(transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_layer ($value, gimp)',
|
2019-08-13 19:59:33 +08:00
|
|
|
dup_value_func => '$var = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id ($value)))',
|
|
|
|
dup_value_func_d=> '$var = gimp_value_get_layer_id ($value)',
|
2019-07-30 16:39:56 +08:00
|
|
|
set_value_func => 'gimp_value_set_layer_id ($value, $var)',
|
|
|
|
take_value_func => 'gimp_value_set_layer ($value, $var)',
|
2019-08-13 19:59:33 +08:00
|
|
|
convert_func => 'gimp_item_get_id (GIMP_ITEM ($var))',
|
2019-07-30 16:39:56 +08:00
|
|
|
headers => [ qw("core/gimplayer.h") ] },
|
|
|
|
|
|
|
|
channel => { name => 'CHANNEL',
|
|
|
|
gtype => 'GIMP_TYPE_CHANNEL_ID',
|
|
|
|
type => 'GimpChannel *',
|
|
|
|
const_type => 'GimpChannel *',
|
|
|
|
id => 1,
|
|
|
|
init_value => 'NULL',
|
|
|
|
get_value_func => '$var = gimp_value_get_channel ($value, gimp)',
|
|
|
|
dup_value_func => '$var = gimp_value_get_channel_id ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_channel_id ($value, $var)',
|
|
|
|
take_value_func => 'gimp_value_set_channel ($value, $var)',
|
|
|
|
headers => [ qw("core/gimpchannel.h") ] },
|
|
|
|
|
|
|
|
drawable => { name => 'DRAWABLE',
|
|
|
|
gtype => 'GIMP_TYPE_DRAWABLE_ID',
|
|
|
|
type => 'GimpDrawable *',
|
|
|
|
const_type => 'GimpDrawable *',
|
|
|
|
init_value => 'NULL',
|
2019-08-13 19:59:33 +08:00
|
|
|
out_annotate => '(transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = gimp_value_get_drawable ($value, gimp)',
|
2019-08-13 19:59:33 +08:00
|
|
|
dup_value_func => '$var = GIMP_DRAWABLE (gimp_item_new_by_id (gimp_value_get_drawable_id ($value)))',
|
|
|
|
dup_value_func_d=> '$var = gimp_value_get_drawable_id ($value)',
|
2019-07-30 16:39:56 +08:00
|
|
|
set_value_func => 'gimp_value_set_drawable_id ($value, $var)',
|
|
|
|
take_value_func => 'gimp_value_set_drawable ($value, $var)',
|
2019-08-13 19:59:33 +08:00
|
|
|
convert_func => 'gimp_item_get_id (GIMP_ITEM ($var))',
|
2019-07-30 16:39:56 +08:00
|
|
|
headers => [ qw("core/gimpdrawable.h") ] },
|
|
|
|
|
|
|
|
selection => { name => 'SELECTION',
|
|
|
|
gtype => 'GIMP_TYPE_SELECTION_ID',
|
|
|
|
type => 'GimpSelection *',
|
|
|
|
const_type => 'GimpSelection *',
|
|
|
|
id => 1,
|
|
|
|
init_value => 'NULL',
|
|
|
|
get_value_func => '$var = gimp_value_get_selection ($value, gimp)',
|
|
|
|
dup_value_func => '$var = gimp_value_get_selection_id ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_selection_id ($value, $var)',
|
|
|
|
take_value_func => 'gimp_value_set_selection ($value, $var)',
|
|
|
|
headers => [ qw("core/gimpselection.h") ] },
|
|
|
|
|
|
|
|
layer_mask => { name => 'CHANNEL',
|
|
|
|
gtype => 'GIMP_TYPE_LAYER_MASK_ID',
|
|
|
|
type => 'GimpLayerMask *',
|
|
|
|
const_type => 'GimpLayerMask *',
|
|
|
|
id => 1,
|
|
|
|
init_value => 'NULL',
|
|
|
|
get_value_func => '$var = gimp_value_get_layer_mask ($value, gimp)',
|
|
|
|
dup_value_func => '$var = gimp_value_get_layer_mask_id ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_layer_mask_id ($value, $var)',
|
|
|
|
take_value_func => 'gimp_value_set_layer_mask ($value, $var)',
|
|
|
|
headers => [ qw("core/gimplayermask.h") ] },
|
|
|
|
|
|
|
|
vectors => { name => 'VECTORS',
|
|
|
|
gtype => 'GIMP_TYPE_VECTORS_ID',
|
|
|
|
type => 'GimpVectors *',
|
|
|
|
const_type => 'GimpVectors *',
|
|
|
|
id => 1,
|
|
|
|
init_value => 'NULL',
|
|
|
|
get_value_func => '$var = gimp_value_get_vectors ($value, gimp)',
|
|
|
|
dup_value_func => '$var = gimp_value_get_vectors_id ($value)',
|
|
|
|
set_value_func => 'gimp_value_set_vectors_id ($value, $var)',
|
|
|
|
take_value_func => 'gimp_value_set_vectors ($value, $var)',
|
|
|
|
headers => [ qw("vectors/gimpvectors.h") ] },
|
|
|
|
|
|
|
|
parasite => { name => 'PARASITE',
|
|
|
|
gtype => 'GIMP_TYPE_PARASITE',
|
|
|
|
type => 'GimpParasite *',
|
|
|
|
const_type => 'const GimpParasite *',
|
|
|
|
init_value => 'NULL',
|
2019-08-01 00:58:52 +08:00
|
|
|
out_annotate => '(transfer full)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = g_value_get_boxed ($value)',
|
|
|
|
dup_value_func => '$var = g_value_dup_boxed ($value)',
|
|
|
|
set_value_func => 'g_value_set_boxed ($value, $var)',
|
|
|
|
take_value_func => 'g_value_take_boxed ($value, $var)',
|
|
|
|
headers => [ qw("libgimpbase/gimpbase.h") ] },
|
1998-10-24 13:19:30 +08:00
|
|
|
|
2019-08-05 16:46:55 +08:00
|
|
|
param => { name => 'PARAM',
|
|
|
|
gtype => 'G_TYPE_PARAM_SPEC',
|
|
|
|
type => 'GParamSpec *',
|
|
|
|
const_type => 'GParamSpec *',
|
|
|
|
init_value => 'NULL',
|
|
|
|
out_annotate => '(transfer full)',
|
|
|
|
get_value_func => '$var = g_value_get_param ($value)',
|
|
|
|
dup_value_func => '$var = g_value_dup_param ($value)',
|
|
|
|
set_value_func => 'g_value_set_param ($value, $var)',
|
|
|
|
take_value_func => 'g_value_take_param ($value, $var)' },
|
|
|
|
|
1998-10-24 13:19:30 +08:00
|
|
|
# Special cases
|
2019-08-15 22:41:39 +08:00
|
|
|
enum => { name => 'ENUM',
|
2019-07-30 16:39:56 +08:00
|
|
|
gtype => 'G_TYPE_ENUM',
|
2019-08-15 20:04:56 +08:00
|
|
|
type => 'gint ',
|
|
|
|
const_type => 'gint ',
|
2019-07-30 16:39:56 +08:00
|
|
|
init_value => '0',
|
|
|
|
get_value_func => '$var = g_value_get_enum ($value)',
|
|
|
|
dup_value_func => '$var = g_value_get_enum ($value)',
|
|
|
|
set_value_func => 'g_value_set_enum ($value, $var)',
|
|
|
|
take_value_func => 'g_value_set_enum ($value, $var)' },
|
|
|
|
|
2019-08-15 22:41:39 +08:00
|
|
|
boolean => { name => 'BOOLEAN',
|
2019-07-30 16:39:56 +08:00
|
|
|
gtype => 'G_TYPE_BOOLEAN',
|
|
|
|
type => 'gboolean ',
|
|
|
|
const_type => 'gboolean ',
|
|
|
|
init_value => 'FALSE',
|
|
|
|
get_value_func => '$var = g_value_get_boolean ($value)',
|
|
|
|
dup_value_func => '$var = g_value_get_boolean ($value)',
|
|
|
|
set_value_func => 'g_value_set_boolean ($value, $var)',
|
|
|
|
take_value_func => 'g_value_set_boolean ($value, $var)' },
|
|
|
|
|
2019-08-15 22:41:39 +08:00
|
|
|
tattoo => { name => 'TATTOO',
|
|
|
|
gtype => 'G_TYPE_UINT',
|
|
|
|
type => 'guint ',
|
|
|
|
const_type => 'guint ',
|
2019-07-30 16:39:56 +08:00
|
|
|
init_value => '0',
|
|
|
|
get_value_func => '$var = g_value_get_uint ($value)',
|
|
|
|
dup_value_func => '$var = g_value_get_uint ($value)',
|
|
|
|
set_value_func => 'g_value_set_uint ($value, $var)',
|
|
|
|
take_value_func => 'g_value_set_uint ($value, $var)' },
|
|
|
|
|
2019-08-15 22:41:39 +08:00
|
|
|
guide => { name => 'GUIDE',
|
|
|
|
gtype => 'G_TYPE_UINT',
|
|
|
|
type => 'guint ',
|
|
|
|
const_type => 'guint ',
|
2019-07-30 16:39:56 +08:00
|
|
|
id => 1,
|
|
|
|
init_value => '0',
|
|
|
|
get_value_func => '$var = g_value_get_uint ($value)',
|
|
|
|
dup_value_func => '$var = g_value_get_uint ($value)',
|
|
|
|
set_value_func => 'g_value_set_uint ($value, $var)',
|
|
|
|
take_value_func => 'g_value_set_uint ($value, $var)' },
|
|
|
|
|
2019-08-15 22:41:39 +08:00
|
|
|
sample_point => { name => 'SAMPLE_POINT',
|
|
|
|
gtype => 'G_TYPE_UINT',
|
|
|
|
type => 'guint ',
|
|
|
|
const_type => 'guint ',
|
2019-07-30 16:39:56 +08:00
|
|
|
id => 1,
|
|
|
|
init_value => '0',
|
|
|
|
get_value_func => '$var = g_value_get_uint ($value)',
|
|
|
|
dup_value_func => '$var = g_value_get_uint ($value)',
|
|
|
|
set_value_func => 'g_value_set_uint ($value, $var)',
|
|
|
|
take_value_func => 'g_value_set_uint ($value, $var)' },
|
|
|
|
|
2019-08-15 22:41:39 +08:00
|
|
|
unit => { name => 'UNIT',
|
2019-07-30 16:39:56 +08:00
|
|
|
gtype => 'GIMP_TYPE_UNIT',
|
|
|
|
type => 'GimpUnit ',
|
|
|
|
const_type => 'GimpUnit ',
|
2019-08-15 22:41:39 +08:00
|
|
|
init_value => 'GIMP_UNIT_PIXEL',
|
2019-08-05 21:31:12 +08:00
|
|
|
out_annotate => '(transfer none)',
|
2019-07-30 16:39:56 +08:00
|
|
|
get_value_func => '$var = g_value_get_int ($value)',
|
|
|
|
dup_value_func => '$var = g_value_get_int ($value)',
|
|
|
|
set_value_func => 'g_value_set_int ($value, $var)',
|
|
|
|
take_value_func => 'g_value_set_int ($value, $var)' }
|
1998-10-24 13:19:30 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
# Split out the parts of an arg constraint
|
|
|
|
sub arg_parse {
|
|
|
|
my $arg = shift;
|
1999-03-18 07:08:08 +08:00
|
|
|
|
|
|
|
if ($arg =~ /^enum (\w+)(.*)/) {
|
|
|
|
my ($name, $remove) = ($1, $2);
|
|
|
|
my @retvals = ('enum', $name);
|
|
|
|
|
1999-03-28 14:36:11 +08:00
|
|
|
if ($remove && $remove =~ m@ \(no @) {
|
|
|
|
chop $remove; ($remove = substr($remove, 5)) =~ s/ $//;
|
1999-03-18 07:08:08 +08:00
|
|
|
push @retvals, split(/,\s*/, $remove);
|
|
|
|
}
|
|
|
|
|
|
|
|
return @retvals;
|
1998-10-24 13:19:30 +08:00
|
|
|
}
|
1999-04-27 12:33:41 +08:00
|
|
|
elsif ($arg =~ /^unit(?: \(min (.*?)\))?/) {
|
|
|
|
my @retvals = ('unit');
|
|
|
|
push @retvals, $1 if $1;
|
|
|
|
return @retvals;
|
|
|
|
}
|
2007-07-05 22:31:42 +08:00
|
|
|
elsif ($arg =~ /^(?:([+-.\dA-Z_][^\s]*) \s* (<=|<))?
|
1999-03-21 10:14:08 +08:00
|
|
|
\s* (\w+) \s*
|
2007-07-05 22:31:42 +08:00
|
|
|
(?:(<=|<) \s* ([+-.\dA-Z_][^\s]*))?
|
1999-03-20 07:04:16 +08:00
|
|
|
/x) {
|
2010-06-06 01:26:06 +08:00
|
|
|
return ($3, $1, $2, $5, $4);
|
1998-10-24 13:19:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-04-04 13:59:08 +08:00
|
|
|
1;
|