File: script-fu-enums.h

package info (click to toggle)
gimp 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 222,880 kB
  • sloc: ansic: 870,914; python: 10,965; lisp: 10,857; cpp: 7,355; perl: 4,536; sh: 1,753; xml: 972; yacc: 609; lex: 348; javascript: 150; makefile: 42
file content (89 lines) | stat: -rw-r--r-- 2,870 bytes parent folder | download | duplicates (3)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* GIMP - The GNU Image Manipulation Program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (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
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef __SCRIPT_FU_ENUMS_H__
#define __SCRIPT_FU_ENUMS_H__

/* Note these are C names with underbar.
 * The Scheme names are usually the same with hyphen substituted for underbar.
 */

/*  script-fu argument types  */
typedef enum
{
  SF_IMAGE = 0,
  SF_DRAWABLE,
  SF_LAYER,
  SF_CHANNEL,
  SF_VECTORS,
  SF_COLOR,
  SF_TOGGLE,
  SF_STRING,
  SF_ADJUSTMENT,
  SF_FONT,
  SF_PATTERN,
  SF_BRUSH,
  SF_GRADIENT,
  SF_FILENAME,
  SF_DIRNAME,
  SF_OPTION,
  SF_PALETTE,
  SF_TEXT,
  SF_ENUM,
  SF_DISPLAY
} SFArgType;

typedef enum
{
  SF_SLIDER = 0,
  SF_SPINNER
} SFAdjustmentType;

/* This enum is local to ScriptFu
 * but the notion is general to other plugins.
 *
 * A GimpImageProcedure has drawable  arity > 1.
 * A GimpProcedure often does not take any drawables, i.e. arity zero.
 * Some GimpProcedure may take drawables i.e. arity > 0,
 * but the procedure's menu item is always sensitive,
 * and the drawable can be chosen in the plugin's dialog.
 *
 * Script author does not use SF-NO-DRAWABLE, for now.
 *
 * Scripts of class GimpProcedure are declared by script-fu-register.
 * Their GUI is handled by ScriptFu, script-fu-interface.c
 * An author does not declare drawable_arity.
 *
 * Scripts of class GimpImageProcedure are declared by script-fu-register-filter.
 * Their GUI is handled by libgimpui, GimpProcedureDialog.
 * Their drawable_arity is declared by the author of the script.
 *
 * For backward compatibility, GIMP deprecates but allows PDB procedures
 * to take a single drawable, and sets their sensitivity automatically.
 * Their drawable_arity is inferred by ScriptFu.
 * FUTURE insist that an author use script-fu-register-filter (not script-fu-register)
 * for GimpImageProcedure taking image and one or more drawables.
 */
typedef enum
{
  SF_NO_DRAWABLE = 0,       /* GimpProcedure. */
  SF_ONE_DRAWABLE,          /* GimpImageProcedure, but only process one layer */
  SF_ONE_OR_MORE_DRAWABLE,  /* GimpImageProcedure, multilayer capable */
  SF_TWO_OR_MORE_DRAWABLE,  /* GimpImageProcedure, requires at least two drawables. */
} SFDrawableArity;

#endif /*  __SCRIPT_FU_ENUMS__  */