gimpprocedure-params.h 34.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
/* LIBGIMP - The GIMP Library
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * gimpprocedure-params.h
 * Copyright (C) 2019  Michael Natterer <mitch@gimp.org>
 *
 * 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
 * Library 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_H_INSIDE__) && !defined (GIMP_COMPILATION)
#error "Only <libgimp/gimp.h> can be included directly."
#endif

#ifndef __GIMP_PROCEDURE_PARAMS_H__
#define __GIMP_PROCEDURE_PARAMS_H__

G_BEGIN_DECLS

/* For information look into the C source or the html documentation */


/**
 * SECTION: gimpprocedure-params
 * @title: GimpProcedure-params
 * @short_description: Macros and defines to add procedure arguments
 *                     and return values.
 *
 * Macros and defines to add procedure arguments and return values.
 **/


44 45
/*  boolean  */

46 47 48 49 50 51
#define GIMP_PROC_ARG_BOOLEAN(class, name, nick, blurb, default, flags) \
  gimp_procedure_add_argument (procedure,\
                               g_param_spec_boolean (name, nick, blurb,\
                               default,\
                               flags))

52 53 54 55 56 57
#define GIMP_PROC_AUX_ARG_BOOLEAN(class, name, nick, blurb, default, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   g_param_spec_boolean (name, nick, blurb,\
                                   default,\
                                   flags))

58 59 60 61 62 63
#define GIMP_PROC_VAL_BOOLEAN(class, name, nick, blurb, default, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   g_param_spec_boolean (name, nick, blurb,\
                                   default,\
                                   flags))

64 65 66 67 68 69 70 71 72
#define GIMP_VALUES_GET_BOOLEAN(args, n) \
  g_value_get_boolean (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_BOOLEAN(args, n, value) \
  g_value_set_boolean (gimp_value_array_index (args, n), value)


/*  int  */

73 74 75 76 77 78
#define GIMP_PROC_ARG_INT(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_argument (procedure,\
                               g_param_spec_int (name, nick, blurb,\
                               min, max, default,\
                               flags))

79 80 81 82 83 84
#define GIMP_PROC_AUX_ARG_INT(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   g_param_spec_int (name, nick, blurb,\
                                   min, max, default,\
                                   flags))

85 86 87 88 89 90
#define GIMP_PROC_VAL_INT(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   g_param_spec_int (name, nick, blurb,\
                                   min, max, default,\
                                   flags))

91 92 93 94 95 96 97 98 99
#define GIMP_VALUES_GET_INT(args, n) \
  g_value_get_int (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_INT(args, n, value) \
  g_value_set_int (gimp_value_array_index (args, n), value)


/*  uint  */

100 101 102 103 104 105
#define GIMP_PROC_ARG_UINT(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_argument (procedure,\
                               g_param_spec_uint (name, nick, blurb,\
                               min, max, default,\
                               flags))

106 107 108 109 110 111
#define GIMP_PROC_AUX_ARG_UINT(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   g_param_spec_uint (name, nick, blurb,\
                                   min, max, default,\
                                   flags))

112 113 114 115 116 117
#define GIMP_PROC_VAL_UINT(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   g_param_spec_uint (name, nick, blurb,\
                                   min, max, default,\
                                   flags))

118 119 120 121 122 123
#define GIMP_VALUES_GET_UINT(args, n) \
  g_value_get_uint (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_UINT(args, n, value) \
  g_value_set_uint (gimp_value_array_index (args, n), value)

124 125 126

/* uchar  */

127 128 129 130 131 132
#define GIMP_PROC_ARG_UCHAR(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_argument (procedure,\
                               g_param_spec_uchar (name, nick, blurb,\
                               min, max, default,\
                               flags))

133 134 135 136 137 138
#define GIMP_PROC_AUX_ARG_UCHAR(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   g_param_spec_uchar (name, nick, blurb,\
                                   min, max, default,\
                                   flags))

139 140 141 142 143 144
#define GIMP_PROC_VAL_UCHAR(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   g_param_spec_uchar (name, nick, blurb,\
                                   min, max, default,\
                                   flags))

145 146 147 148 149 150 151 152 153
#define GIMP_VALUES_GET_UCHAR(args, n) \
  g_value_get_uchar (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_UCHAR(args, n, value) \
  g_value_set_uchar (gimp_value_array_index (args, n), value)


/*  unit  */

154 155 156 157 158 159
#define GIMP_PROC_ARG_UNIT(class, name, nick, blurb, pixels, percent, default, flags) \
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_unit (name, nick, blurb,\
                               pixels, percent, default,\
                               flags))

160 161 162 163 164 165
#define GIMP_PROC_AUX_ARG_UNIT(class, name, nick, blurb, pixels, percent, default, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_unit (name, nick, blurb,\
                                   pixels, percent, default,\
                                   flags))

166 167 168 169 170 171
#define GIMP_PROC_VAL_UNIT(class, name, nick, blurb, pixels, percent, default, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   gimp_param_spec_unit (name, nick, blurb,\
                                   pixels, percent, default,\
                                   flags))

172 173 174

/*  double  */

175 176 177 178 179 180
#define GIMP_PROC_ARG_DOUBLE(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_argument (procedure,\
                               g_param_spec_double (name, nick, blurb,\
                               min, max, default,\
                               flags))

181 182 183 184 185 186
#define GIMP_PROC_AUX_ARG_DOUBLE(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   g_param_spec_double (name, nick, blurb,\
                                   min, max, default,\
                                   flags))

187 188 189 190 191 192
#define GIMP_PROC_VAL_DOUBLE(class, name, nick, blurb, min, max, default, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   g_param_spec_double (name, nick, blurb,\
                                   min, max, default,\
                                   flags))

193 194 195 196 197 198 199 200 201
#define GIMP_VALUES_GET_DOUBLE(args, n) \
  g_value_get_double (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_DOUBLE(args, n, value) \
  g_value_set_double (gimp_value_array_index (args, n), value)


/*  enum  */

202 203 204 205 206 207
#define GIMP_PROC_ARG_ENUM(class, name, nick, blurb, enum_type, default, flags) \
  gimp_procedure_add_argument (procedure,\
                               g_param_spec_enum (name, nick, blurb,\
                               enum_type, default,\
                               flags))

208 209 210 211 212 213
#define GIMP_PROC_AUX_ARG_ENUM(class, name, nick, blurb, enum_type, default, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   g_param_spec_enum (name, nick, blurb,\
                                   enum_type, default,\
                                   flags))

214 215 216 217 218 219
#define GIMP_PROC_VAL_ENUM(class, name, nick, blurb, enum_type, default, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   g_param_spec_enum (name, nick, blurb,\
                                   enum_type, default,\
                                   flags))

220 221 222 223 224 225 226 227 228
#define GIMP_VALUES_GET_ENUM(args, n) \
  g_value_get_enum (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_ENUM(args, n, value) \
  g_value_set_enum (gimp_value_array_index (args, n), value)


/*  string  */

229 230 231 232 233 234
#define GIMP_PROC_ARG_STRING(class, name, nick, blurb, default, flags) \
  gimp_procedure_add_argument (procedure,\
                               g_param_spec_string (name, nick, blurb,\
                               default,\
                               flags))

235 236 237 238 239 240
#define GIMP_PROC_AUX_ARG_STRING(class, name, nick, blurb, default, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   g_param_spec_string (name, nick, blurb,\
                                   default,\
                                   flags))

241 242 243 244 245 246
#define GIMP_PROC_VAL_STRING(class, name, nick, blurb, default, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   g_param_spec_string (name, nick, blurb,\
                                   default,\
                                   flags))

247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
#define GIMP_VALUES_GET_STRING(args, n) \
  g_value_get_string (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_STRING(args, n) \
  g_value_dup_string (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_STRING(args, n, value) \
  g_value_set_string (gimp_value_array_index (args, n), value)

#define GIMP_VALUES_TAKE_STRING(args, n, value) \
  g_value_take_string (gimp_value_array_index (args, n), value)


/*  rgb  */

262 263 264 265 266 267
#define GIMP_PROC_ARG_RGB(class, name, nick, blurb, has_alpha, default, flags) \
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_rgb (name, nick, blurb,\
                               has_alpha, default, \
                               flags))

268 269 270 271 272 273
#define GIMP_PROC_AUX_ARG_RGB(class, name, nick, blurb, has_alpha, default, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_rgb (name, nick, blurb,\
                                   has_alpha, default, \
                                   flags))

274 275 276 277 278 279
#define GIMP_PROC_VAL_RGB(class, name, nick, blurb, has_alpha, default, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   gimp_param_spec_rgb (name, nick, blurb,\
                                   has_alpha, default, \
                                   flags))

280 281 282 283 284 285 286
#define GIMP_VALUES_GET_RGB(args, n, value) \
  gimp_value_get_rgb (gimp_value_array_index (args, n), value)

#define GIMP_VALUES_SET_RGB(args, n, value) \
  gimp_value_set_rgb (gimp_value_array_index (args, n), value)


287 288 289 290 291 292 293
/*  parasite  */

#define GIMP_PROC_ARG_PARASITE(class, name, nick, blurb, flags) \
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_parasite (name, nick, blurb,\
                               flags))

294 295 296 297 298
#define GIMP_PROC_AUX_ARG_PARASITE(class, name, nick, blurb, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_parasite (name, nick, blurb,\
                                   flags))

299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
#define GIMP_PROC_VAL_PARASITE(class, name, nick, blurb, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   gimp_param_spec_parasite (name, nick, blurb,\
                                   flags))

#define GIMP_VALUES_GET_PARASITE(args, n) \
  g_value_get_boxed (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_PARASITE(args, n) \
  g_value_dup_boxed (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_PARASITE(args, n, value) \
  g_value_set_boxed (gimp_value_array_index (args, n), value)

#define GIMP_VALUES_TAKE_PARASITE(args, n, value)                \
  g_value_take_boxed (gimp_value_array_index (args, n), value)


/*  param  */

#define GIMP_PROC_ARG_PARAM(class, name, nick, blurb, param_type, flags) \
  gimp_procedure_add_argument (procedure,\
                               g_param_spec_param (name, nick, blurb, param_type, \
                               flags))

324 325 326 327 328
#define GIMP_PROC_AUX_ARG_PARAM(class, name, nick, blurb, param_type, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   g_param_spec_param (name, nick, blurb, param_type, \
                                   flags))

329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
#define GIMP_PROC_VAL_PARAM(class, name, nick, blurb, param_type, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   g_param_spec_param (name, nick, blurb, param_type, \
                                   flags))

#define GIMP_VALUES_GET_PARAM(args, n) \
  g_value_get_param (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_PARAM(args, n) \
  g_value_dup_param (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_PARAM(args, n, value) \
  g_value_set_param (gimp_value_array_index (args, n), value)

#define GIMP_VALUES_TAKE_PARAM(args, n, value)                \
  g_value_take_param (gimp_value_array_index (args, n), value)


347 348
/*  uint8 array  */

349
#define GIMP_PROC_ARG_UINT8_ARRAY(class, name, nick, blurb, flags) \
350 351 352 353
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_uint8_array (name, nick, blurb,\
                               flags))

354 355 356 357 358
#define GIMP_PROC_AUX_ARG_UINT8_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_uint8_array (name, nick, blurb,\
                                   flags))

359 360 361 362 363
#define GIMP_PROC_VAL_UINT8_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   gimp_param_spec_uint8_array (name, nick, blurb,\
                                   flags))

364 365 366 367 368 369
#define GIMP_VALUES_GET_UINT8_ARRAY(args, n) \
  gimp_value_get_uint8_array (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_UINT8_ARRAY(args, n) \
  gimp_value_dup_uint8_array (gimp_value_array_index (args, n))

370 371
#define GIMP_VALUES_SET_UINT8_ARRAY(args, n, value, length) \
  gimp_value_set_uint8_array (gimp_value_array_index (args, n), value, length)
372

373 374
#define GIMP_VALUES_TAKE_UINT8_ARRAY(args, n, value, length) \
  gimp_value_take_uint8_array (gimp_value_array_index (args, n), value, length)
375 376 377 378


/*  int16 array  */

379 380 381 382 383
#define GIMP_PROC_ARG_INT16_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_int16_array (name, nick, blurb,\
                               flags))

384 385 386 387 388 389
#define GIMP_PROC_AUX_ARG_INT16_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_int16_array (name, nick, blurb,\
                                   flags))

#define GIMP_PROC_VAL_INT16_ARRAY(class, name, nick, blurb, flags) \
390 391 392 393
  gimp_procedure_add_return_value (procedure,\
                                   gimp_param_spec_int16_array (name, nick, blurb,\
                                   flags))

394
#define GIMP_VALUES_GET_INT16_ARRAY(args, n) \
395 396
  gimp_value_get_int16_array (gimp_value_array_index (args, n))

397
#define GIMP_VALUES_DUP_INT16_ARRAY(args, n) \
398 399
  gimp_value_dup_int16_array (gimp_value_array_index (args, n))

400 401
#define GIMP_VALUES_SET_INT16_ARRAY(args, n, value, length) \
  gimp_value_set_int16_array (gimp_value_array_index (args, n), value, length)
402

403 404
#define GIMP_VALUES_TAKE_INT16_ARRAY(args, n, value, length) \
  gimp_value_take_int16_array (gimp_value_array_index (args, n), value, length)
405 406 407 408


/*  int32 array  */

409 410 411 412 413
#define GIMP_PROC_ARG_INT32_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_int32_array (name, nick, blurb,\
                               flags))

414 415 416 417 418 419
#define GIMP_PROC_AUX_ARG_INT32_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_int32_array (name, nick, blurb,\
                                   flags))

#define GIMP_PROC_VAL_INT32_ARRAY(class, name, nick, blurb, flags) \
420 421 422 423
  gimp_procedure_add_return_value (procedure,\
                                   gimp_param_spec_int32_array (name, nick, blurb,\
                                   flags))

424 425 426 427 428 429
#define GIMP_VALUES_GET_INT32_ARRAY(args, n) \
  gimp_value_get_int32_array (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_INT32_ARRAY(args, n) \
  gimp_value_dup_int32_array (gimp_value_array_index (args, n))

430 431
#define GIMP_VALUES_SET_INT32_ARRAY(args, n, value, length) \
  gimp_value_set_int32_array (gimp_value_array_index (args, n), value, length)
432

433 434
#define GIMP_VALUES_TAKE_INT32_ARRAY(args, n, value, length) \
  gimp_value_take_int32_array (gimp_value_array_index (args, n), value, length)
435 436 437 438


/*  float array  */

439
#define GIMP_PROC_ARG_FLOAT_ARRAY(class, name, nick, blurb, flags) \
440 441 442 443
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_float_array (name, nick, blurb,\
                               flags))

444 445 446 447 448
#define GIMP_PROC_AUX_ARG_FLOAT_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_float_array (name, nick, blurb,\
                                   flags))

449 450 451 452 453
#define GIMP_PROC_VAL_FLOAT_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   gimp_param_spec_float_array (name, nick, blurb,\
                                   flags))

454 455 456 457 458 459
#define GIMP_VALUES_GET_FLOAT_ARRAY(args, n) \
  gimp_value_get_float_array (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_FLOAT_ARRAY(args, n) \
  gimp_value_dup_float_array (gimp_value_array_index (args, n))

460 461
#define GIMP_VALUES_SET_FLOAT_ARRAY(args, n, value, length) \
  gimp_value_set_float_array (gimp_value_array_index (args, n), value, length)
462

463 464
#define GIMP_VALUES_TAKE_FLOAT_ARRAY(args, n, value, length) \
  gimp_value_take_float_array (gimp_value_array_index (args, n), value, length)
465 466 467 468


/*  string array  */

469
#define GIMP_PROC_ARG_STRING_ARRAY(class, name, nick, blurb, flags) \
470 471 472 473
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_string_array (name, nick, blurb,\
                               flags))

474 475 476 477 478
#define GIMP_PROC_AUX_ARG_STRING_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_string_array (name, nick, blurb,\
                                   flags))

479 480 481 482 483
#define GIMP_PROC_VAL_STRING_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   gimp_param_spec_string_array (name, nick, blurb,\
                                   flags))

484 485 486 487 488 489
#define GIMP_VALUES_GET_STRING_ARRAY(args, n) \
  gimp_value_get_string_array (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_STRING_ARRAY(args, n) \
  gimp_value_dup_string_array (gimp_value_array_index (args, n))

490 491
#define GIMP_VALUES_SET_STRING_ARRAY(args, n, value, length) \
  gimp_value_set_string_array (gimp_value_array_index (args, n), value, length)
492

493 494
#define GIMP_VALUES_TAKE_STRING_ARRAY(args, n, value, length) \
  gimp_value_take_string_array (gimp_value_array_index (args, n), value, length)
495 496 497 498


/*  rgb array  */

499
#define GIMP_PROC_ARG_RGB_ARRAY(class, name, nick, blurb, flags) \
500 501 502 503
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_rgb_array (name, nick, blurb,\
                               flags))

504 505 506 507 508
#define GIMP_PROC_AUX_ARG_RGB_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_rgb_array (name, nick, blurb,\
                                   flags))

509 510 511 512 513
#define GIMP_PROC_VAL_RGB_ARRAY(class, name, nick, blurb, flags) \
  gimp_procedure_add_return_value (procedure,\
                                   gimp_param_spec_rgb_array (name, nick, blurb,\
                                   flags))

514 515 516 517 518 519
#define GIMP_VALUES_GET_RGB_ARRAY(args, n) \
  gimp_value_get_rgb_array (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_RGB_ARRAY(args, n) \
  gimp_value_dup_rgb_array (gimp_value_array_index (args, n))

520 521
#define GIMP_VALUES_SET_RGB_ARRAY(args, n, value, length) \
  gimp_value_set_rgb_array (gimp_value_array_index (args, n), value, length)
522

523 524
#define GIMP_VALUES_TAKE_RGB_ARRAY(args, n, value, length) \
  gimp_value_take_rgb_array (gimp_value_array_index (args, n), value, length)
525 526


527 528 529 530 531 532 533
/*  object array  */

#define GIMP_PROC_ARG_OBJECT_ARRAY(class, name, nick, blurb, object_type, flags) \
  gimp_procedure_add_argument (procedure,\
                               gimp_param_spec_object_array (name, nick, blurb,\
                                                             object_type, flags))

534 535 536 537 538
#define GIMP_PROC_AUX_ARG_OBJECT_ARRAY(class, name, nick, blurb, object_type, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_object_array (name, nick, blurb,\
                                                                 object_type, flags))

539 540
#define GIMP_PROC_VAL_OBJECT_ARRAY(class, name, nick, blurb, object_type, flags) \
  gimp_procedure_add_return_value (procedure,\
541
                                   gimp_param_spec_object_array (name, nick, blurb,\
542 543 544 545 546 547 548 549
                                                                 object_type, flags))

#define GIMP_VALUES_GET_OBJECT_ARRAY(args, n) \
  (gpointer) gimp_value_get_object_array (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_OBJECT_ARRAY(args, n) \
  (gpointer) gimp_value_dup_object_array (gimp_value_array_index (args, n))

550
#define GIMP_VALUES_SET_OBJECT_ARRAY(args, n, object_type, value, length) \
551
  gimp_value_set_object_array (gimp_value_array_index (args, n),\
552
                               object_type, (gpointer) value, length)
553

554
#define GIMP_VALUES_TAKE_OBJECT_ARRAY(args, n, object_type, value, length) \
555
  gimp_value_take_object_array (gimp_value_array_index (args, n),\
556
                                object_type, (gpointer) value, length)
557 558


559 560
/*  display  */

561
#define GIMP_PROC_ARG_DISPLAY(class, name, nick, blurb, none_ok, flags) \
562
  gimp_procedure_add_argument (procedure,\
563
                               gimp_param_spec_display (name, nick, blurb,\
564
                               none_ok,\
565 566
                               flags))

567 568 569 570 571 572 573
#define GIMP_PROC_AUX_ARG_DISPLAY(class, name, nick, blurb, none_ok, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_display (name, nick, blurb,\
                                   none_ok,\
                                   flags))

#define GIMP_PROC_VAL_DISPLAY(class, name, nick, blurb, none_ok, flags) \
574
  gimp_procedure_add_return_value (procedure,\
575
                                   gimp_param_spec_display (name, nick, blurb,\
576
                                   none_ok,\
577 578
                                   flags))

579 580 581
#define GIMP_VALUES_GET_DISPLAY(args, n) \
  g_value_get_object (gimp_value_array_index (args, n))

582 583 584
#define GIMP_VALUES_GET_DISPLAY_ID(args, n) \
  gimp_display_get_id (g_value_get_object (gimp_value_array_index (args, n)))

585 586 587
#define GIMP_VALUES_SET_DISPLAY(args, n, value) \
  g_value_set_object (gimp_value_array_index (args, n), value)

588 589 590

/*  image  */

591
#define GIMP_PROC_ARG_IMAGE(class, name, nick, blurb, none_ok, flags) \
592
  gimp_procedure_add_argument (procedure,\
593
                               gimp_param_spec_image (name, nick, blurb,\
594
                               none_ok,\
595 596
                               flags))

597 598 599 600 601 602 603
#define GIMP_PROC_AUX_ARG_IMAGE(class, name, nick, blurb, none_ok, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                               gimp_param_spec_image (name, nick, blurb,\
                               none_ok,\
                               flags))

#define GIMP_PROC_VAL_IMAGE(class, name, nick, blurb, none_ok, flags) \
604
  gimp_procedure_add_return_value (procedure,\
605
                                   gimp_param_spec_image (name, nick, blurb,\
606
                                   none_ok,\
607 608
                                   flags))

609
#define GIMP_VALUES_GET_IMAGE(args, n) \
610
  g_value_get_object (gimp_value_array_index (args, n))
611

612 613 614
#define GIMP_VALUES_GET_IMAGE_ID(args, n) \
  gimp_image_get_id (g_value_get_object (gimp_value_array_index (args, n)))

615
#define GIMP_VALUES_SET_IMAGE(args, n, value) \
616
  g_value_set_object (gimp_value_array_index (args, n), value)
617 618 619 620


/*  item  */

621
#define GIMP_PROC_ARG_ITEM(class, name, nick, blurb, none_ok, flags) \
622
  gimp_procedure_add_argument (procedure,\
623
                               gimp_param_spec_item (name, nick, blurb,\
624
                               none_ok,\
625 626
                               flags))

627 628 629 630 631 632 633
#define GIMP_PROC_AUX_ARG_ITEM(class, name, nick, blurb, none_ok, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_item (name, nick, blurb,\
                                   none_ok,\
                                   flags))

#define GIMP_PROC_VAL_ITEM(class, name, nick, blurb, none_ok, flags) \
634
  gimp_procedure_add_return_value (procedure,\
635
                                   gimp_param_spec_item (name, nick, blurb,\
636
                                   none_ok,\
637 638
                                   flags))

639
#define GIMP_VALUES_GET_ITEM(args, n) \
640
  g_value_get_object (gimp_value_array_index (args, n))
641

642 643 644
#define GIMP_VALUES_GET_ITEM_ID(args, n) \
  gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))

645
#define GIMP_VALUES_SET_ITEM(args, n, value) \
646
  g_value_set_object (gimp_value_array_index (args, n), value)
647 648 649 650


/*  drawable  */

651
#define GIMP_PROC_ARG_DRAWABLE(class, name, nick, blurb, none_ok, flags) \
652
  gimp_procedure_add_argument (procedure,\
653
                               gimp_param_spec_drawable (name, nick, blurb,\
654
                               none_ok,\
655 656
                               flags))

657 658 659 660 661 662
#define GIMP_PROC_AUX_ARG_DRAWABLE(class, name, nick, blurb, none_ok, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_drawable (name, nick, blurb,\
                                   none_ok,\
                                   flags))

663
#define GIMP_PROC_VAL_DRAWABLE(class, name, nick, blurb, none_ok, flags) \
664
  gimp_procedure_add_return_value (procedure,\
665
                                   gimp_param_spec_drawable (name, nick, blurb,\
666
                                   none_ok,\
667 668
                                   flags))

669
#define GIMP_VALUES_GET_DRAWABLE(args, n) \
670
  g_value_get_object (gimp_value_array_index (args, n))
671

672 673 674
#define GIMP_VALUES_GET_DRAWABLE_ID(args, n) \
  gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))

675
#define GIMP_VALUES_SET_DRAWABLE(args, n, value) \
676
  g_value_set_object (gimp_value_array_index (args, n), value)
677 678 679 680


/*  layer */

681
#define GIMP_PROC_ARG_LAYER(class, name, nick, blurb, none_ok, flags) \
682
  gimp_procedure_add_argument (procedure,\
683
                               gimp_param_spec_layer (name, nick, blurb,\
684
                               none_ok,\
685 686
                               flags))

687 688 689 690 691 692 693
#define GIMP_PROC_AUX_ARG_LAYER(class, name, nick, blurb, none_ok, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_layer (name, nick, blurb,\
                                   none_ok,\
                                   flags))

#define GIMP_PROC_VAL_LAYER(class, name, nick, blurb, none_ok, flags) \
694
  gimp_procedure_add_return_value (procedure,\
695
                                   gimp_param_spec_layer (name, nick, blurb,\
696
                                   none_ok,\
697 698
                                   flags))

699
#define GIMP_VALUES_GET_LAYER(args, n) \
700
  g_value_get_object (gimp_value_array_index (args, n))
701

702 703 704
#define GIMP_VALUES_GET_LAYER_ID(args, n) \
  gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))

705
#define GIMP_VALUES_SET_LAYER(args, n, value) \
706
  g_value_set_object (gimp_value_array_index (args, n), value)
707 708 709 710


/*  channel  */

711
#define GIMP_PROC_ARG_CHANNEL(class, name, nick, blurb, none_ok, flags) \
712
  gimp_procedure_add_argument (procedure,\
713
                               gimp_param_spec_channel (name, nick, blurb,\
714
                               none_ok,\
715 716
                               flags))

717 718 719 720 721 722
#define GIMP_PROC_AUX_ARG_CHANNEL(class, name, nick, blurb, none_ok, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_channel (name, nick, blurb,\
                                   none_ok,\
                                   flags))

723
#define GIMP_PROC_VAL_CHANNEL(class, name, nick, blurb, none_ok, flags)  \
724
  gimp_procedure_add_return_value (procedure,\
725
                                   gimp_param_spec_channe (name, nick, blurb,\
726
                                   none_ok,\
727 728
                                   flags))

729
#define GIMP_VALUES_GET_CHANNEL(args, n) \
730
  g_value_get_object (gimp_value_array_index (args, n))
731

732 733 734
#define GIMP_VALUES_GET_CHANNEL_ID(args, n) \
  gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))

735
#define GIMP_VALUES_SET_CHANNEL(args, n, value) \
736
  g_value_set_object (gimp_value_array_index (args, n), value)
737 738 739 740


/*  layer mask  */

741
#define GIMP_PROC_ARG_LAYER_MASK(class, name, nick, blurb, none_ok, flags) \
742
  gimp_procedure_add_argument (procedure,\
743
                               gimp_param_spec_layer_mask (name, nick, blurb,\
744
                               none_ok,\
745 746
                               flags))

747 748 749 750 751 752
#define GIMP_PROC_AUX_ARG_LAYER_MASK(class, name, nick, blurb, none_ok, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_layer_mask (name, nick, blurb,\
                                   none_ok,\
                                   flags))

753
#define GIMP_PROC_VAL_LAYER_MASK(class, name, nick, blurb, none_ok, flags) \
754
  gimp_procedure_add_return_value (procedure,\
755
                                   gimp_param_spec_layer_mask (name, nick, blurb,\
756
                                   none_ok,\
757 758
                                   flags))

759
#define GIMP_VALUES_GET_LAYER_MASK(args, n) \
760
  g_value_get_object (gimp_value_array_index (args, n))
761

762 763 764
#define GIMP_VALUES_GET_LAYER_MASK_ID(args, n) \
  gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))

765
#define GIMP_VALUES_SET_LAYER_MASK(args, n, value) \
766
  g_value_set_object (gimp_value_array_index (args, n), value)
767 768 769 770


/*  selection  */

771
#define GIMP_PROC_ARG_SELECTION(class, name, nick, blurb, none_ok, flags) \
772
  gimp_procedure_add_argument (procedure,\
773
                               gimp_param_spec_selection (name, nick, blurb,\
774
                               none_ok,\
775 776
                               flags))

777 778 779 780 781 782
#define GIMP_PROC_AUX_ARG_SELECTION(class, name, nick, blurb, none_ok, flags) \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_selection (name, nick, blurb,\
                                   none_ok,\
                                   flags))

783
#define GIMP_PROC_VAL_SELECTION(class, name, nick, blurb, none_ok, flags) \
784
  gimp_procedure_add_return_value (procedure,\
785
                                   gimp_param_spec_selection (name, nick, blurb,\
786
                                   none_ok,\
787 788
                                   flags))

789
#define GIMP_VALUES_GET_SELECTION(args, n) \
790
  g_value_get_object (gimp_value_array_index (args, n))
791

792 793 794
#define GIMP_VALUES_GET_SELECTION_ID(args, n) \
  gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))

795
#define GIMP_VALUES_SET_SELECTION(args, n, value) \
796
  g_value_set_object (gimp_value_array_index (args, n), value)
797 798 799 800


/*  vectors  */

801
#define GIMP_PROC_ARG_VECTORS(class, name, nick, blurb, none_ok, flags)  \
802
  gimp_procedure_add_argument (procedure,\
803
                               gimp_param_spec_vectors (name, nick, blurb,\
804
                               none_ok,\
805 806
                               flags))

807 808 809 810 811 812
#define GIMP_PROC_AUX_ARG_VECTORS(class, name, nick, blurb, none_ok, flags)  \
  gimp_procedure_add_aux_argument (procedure,\
                                   gimp_param_spec_vectors (name, nick, blurb,\
                                   none_ok,\
                                   flags))

813
#define GIMP_PROC_VAL_VECTORS(class, name, nick, blurb, none_ok, flags)  \
814
  gimp_procedure_add_return_value (procedure,\
815
                                   gimp_param_spec_vectors (name, nick, blurb,\
816
                                   none_ok,\
817 818
                                   flags))

819
#define GIMP_VALUES_GET_VECTORS(args, n) \
820
  g_value_get_object (gimp_value_array_index (args, n))
821

822 823 824
#define GIMP_VALUES_GET_VECTORS_ID(args, n) \
  gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))

825
#define GIMP_VALUES_SET_VECTORS(args, n, value) \
826
  g_value_set_object (gimp_value_array_index (args, n), value)
827

828

829 830 831 832 833 834 835 836
/*  file  */

#define GIMP_PROC_ARG_FILE(class, name, nick, blurb, flags)  \
  gimp_procedure_add_argument (procedure,\
                               g_param_spec_object (name, nick, blurb,\
                                                    G_TYPE_FILE,\
                                                    flags))

837 838 839 840 841 842
#define GIMP_PROC_AUX_ARG_FILE(class, name, nick, blurb, flags)  \
  gimp_procedure_add_aux_argument (procedure,\
                                   g_param_spec_object (name, nick, blurb,\
                                                        G_TYPE_FILE,\
                                                        flags))

843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861
#define GIMP_PROC_VAL_FILE(class, name, nick, blurb, none_ok, flags)  \
  gimp_procedure_add_return_value (procedure,\
                                   g_param_spec_object (name, nick, blurb,\
                                                        G_TYPE_FILE,\
                                                        flags))

#define GIMP_VALUES_GET_FILE(args, n) \
  g_value_get_object (gimp_value_array_index (args, n))

#define GIMP_VALUES_DUP_FILE(args, n) \
  g_value_dup_object (gimp_value_array_index (args, n))

#define GIMP_VALUES_SET_FILE(args, n, value) \
  g_value_set_object (gimp_value_array_index (args, n), value)

#define GIMP_VALUES_TAKE_FILE(args, n, value) \
  g_value_take_object (gimp_value_array_index (args, n), value)


862 863 864
G_END_DECLS

#endif /* __GIMP_PROCEDURE_PARAMS_H__ */