~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/pdb/procedural_db.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
2
 
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; either version 2 of the License, or
7
 
 * (at your option) any later version.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
 * GNU General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software
16
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
 
 */
18
 
 
19
 
#ifndef __PROCEDURAL_DB_H__
20
 
#define __PROCEDURAL_DB_H__
21
 
 
22
 
 
23
 
struct _Argument
24
 
{
25
 
  GimpPDBArgType  arg_type;       /*  argument type        */
26
 
 
27
 
  union _ArgValue
28
 
  {
29
 
    gint32      pdb_int;        /*  Integer type         */
30
 
    gdouble     pdb_float;      /*  Floating point type  */
31
 
    gpointer    pdb_pointer;    /*  Pointer type         */
32
 
    GimpRGB     pdb_color;      /*  Color type           */
33
 
  } value;
34
 
};
35
 
 
36
 
 
37
 
/*  Argument marshalling procedures  */
38
 
typedef Argument * (* ArgMarshal) (Gimp         *gimp,
39
 
                                   GimpContext  *context,
40
 
                                   GimpProgress *progress,
41
 
                                   Argument     *args);
42
 
 
43
 
 
44
 
/*  Execution types  */
45
 
typedef struct _IntExec    IntExec;
46
 
typedef struct _PlugInExec PlugInExec;
47
 
typedef struct _ExtExec    ExtExec;
48
 
typedef struct _TempExec   TempExec;
49
 
typedef struct _NetExec    NetExec;
50
 
 
51
 
 
52
 
struct _IntExec
53
 
{
54
 
  ArgMarshal  marshal_func;   /*  Function called to marshal arguments  */
55
 
};
56
 
 
57
 
struct _PlugInExec
58
 
{
59
 
  gchar      *filename;       /*  Where is the executable on disk?  */
60
 
};
61
 
 
62
 
struct _ExtExec
63
 
{
64
 
  gchar      *filename;       /*  Where is the executable on disk?  */
65
 
};
66
 
 
67
 
struct _TempExec
68
 
{
69
 
  void       *plug_in;        /*  Plug-in that registered this temp proc  */
70
 
};
71
 
 
72
 
struct _NetExec
73
 
{
74
 
  gchar      *host;           /*  Host responsible for procedure execution  */
75
 
  gint32      port;           /*  Port on host to send data to  */
76
 
};
77
 
 
78
 
 
79
 
/*  Structure for a procedure argument  */
80
 
 
81
 
struct _ProcArg
82
 
{
83
 
  GimpPDBArgType  arg_type;    /*  Argument type (int, char, char *, etc)  */
84
 
  gchar          *name;        /*  Argument name  */
85
 
  gchar          *description; /*  Argument description  */
86
 
};
87
 
 
88
 
 
89
 
/*  Structure for a procedure  */
90
 
 
91
 
struct _ProcRecord
92
 
{
93
 
  /*  Procedure information  */
94
 
  gchar       *name;          /*  Procedure name  */
95
 
  gchar       *blurb;         /*  Short procedure description  */
96
 
  gchar       *help;          /*  Detailed help instructions  */
97
 
  gchar       *author;        /*  Author field  */
98
 
  gchar       *copyright;     /*  Copyright field  */
99
 
  gchar       *date;          /*  Date field  */
100
 
 
101
 
  gchar       *deprecated;    /*  Replacement if the procedure is deprecated  */
102
 
 
103
 
  /*  Procedure type  */
104
 
  GimpPDBProcType  proc_type; /*  Type of procedure--Internal, Plug-In, Extension  */
105
 
 
106
 
  /*  Input arguments  */
107
 
  gint32       num_args;      /*  Number of procedure arguments  */
108
 
  ProcArg     *args;          /*  Array of procedure arguments  */
109
 
 
110
 
  /*  Output values  */
111
 
  gint32       num_values;    /*  Number of return values  */
112
 
  ProcArg     *values;        /*  Array of return values  */
113
 
 
114
 
  /*  Method of procedure execution  */
115
 
  union _ExecMethod
116
 
  {
117
 
    IntExec     internal;     /*  Execution information for internal procs  */
118
 
    PlugInExec  plug_in;      /*  ..................... for plug-ins  */
119
 
    ExtExec     extension;    /*  ..................... for extensions  */
120
 
    TempExec    temporary;    /*  ..................... for temp procs  */
121
 
  } exec_method;
122
 
};
123
 
 
124
 
 
125
 
/*  Functions  */
126
 
 
127
 
void           procedural_db_init          (Gimp               *gimp);
128
 
void           procedural_db_free          (Gimp               *gimp);
129
 
 
130
 
void           procedural_db_init_procs    (Gimp               *gimp,
131
 
                                            GimpInitStatusFunc  status_callback);
132
 
 
133
 
void           procedural_db_register      (Gimp               *gimp,
134
 
                                            ProcRecord         *procedure);
135
 
void           procedural_db_unregister    (Gimp               *gimp,
136
 
                                            const gchar        *name);
137
 
ProcRecord   * procedural_db_lookup        (Gimp               *gimp,
138
 
                                            const gchar        *name);
139
 
 
140
 
Argument     * procedural_db_execute       (Gimp               *gimp,
141
 
                                            GimpContext        *context,
142
 
                                            GimpProgress       *progress,
143
 
                                            const gchar        *name,
144
 
                                            Argument           *args);
145
 
Argument     * procedural_db_run_proc      (Gimp               *gimp,
146
 
                                            GimpContext        *context,
147
 
                                            GimpProgress       *progress,
148
 
                                            const gchar        *name,
149
 
                                            gint               *nreturn_vals,
150
 
                                            ...);
151
 
 
152
 
Argument     * procedural_db_return_args   (ProcRecord         *procedure,
153
 
                                            gboolean            success);
154
 
void           procedural_db_destroy_args  (Argument           *args,
155
 
                                            gint                nargs);
156
 
 
157
 
void           procedural_db_free_data     (Gimp                *gimp);
158
 
void           procedural_db_set_data      (Gimp               *gimp,
159
 
                                            const gchar        *identifier,
160
 
                                            gint32              bytes,
161
 
                                            const guint8        *data);
162
 
const guint8 * procedural_db_get_data      (Gimp                *gimp,
163
 
                                            const gchar         *identifier,
164
 
                                            gint32              *bytes);
165
 
 
166
 
 
167
 
/* "type" should really be a GimpPDBArgType, but we can cope with
168
 
 *  out-of-range values.
169
 
 */
170
 
const gchar  * pdb_type_name (gint type); /* really exists in _cmds.c file */
171
 
 
172
 
 
173
 
#endif  /*  __PROCEDURAL_DB_H__  */