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

« back to all changes in this revision

Viewing changes to libgimp/gimpgrid_pdb.c

  • 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
/* LIBGIMP - The GIMP Library
 
2
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
 
3
 *
 
4
 * gimpgrid_pdb.c
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Lesser General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with this library; if not, write to the
 
18
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
19
 * Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
/* NOTE: This file is auto-generated by pdbgen.pl */
 
23
 
 
24
#include "config.h"
 
25
 
 
26
#include "gimp.h"
 
27
 
 
28
/**
 
29
 * gimp_image_grid_get_spacing:
 
30
 * @image_ID: The image.
 
31
 * @xspacing: The image's grid horizontal spacing.
 
32
 * @yspacing: The image's grid vertical spacing.
 
33
 *
 
34
 * Gets the spacing of an image's grid.
 
35
 *
 
36
 * This procedure retrieves the horizontal and vertical spacing of an
 
37
 * image's grid. It takes the image as parameter.
 
38
 *
 
39
 * Returns: TRUE on success.
 
40
 *
 
41
 * Since: GIMP 2.4
 
42
 */
 
43
gboolean
 
44
gimp_image_grid_get_spacing (gint32   image_ID,
 
45
                             gdouble *xspacing,
 
46
                             gdouble *yspacing)
 
47
{
 
48
  GimpParam *return_vals;
 
49
  gint nreturn_vals;
 
50
  gboolean success = TRUE;
 
51
 
 
52
  return_vals = gimp_run_procedure ("gimp-image-grid-get-spacing",
 
53
                                    &nreturn_vals,
 
54
                                    GIMP_PDB_IMAGE, image_ID,
 
55
                                    GIMP_PDB_END);
 
56
 
 
57
  *xspacing = 0.0;
 
58
  *yspacing = 0.0;
 
59
 
 
60
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
61
 
 
62
  if (success)
 
63
    {
 
64
      *xspacing = return_vals[1].data.d_float;
 
65
      *yspacing = return_vals[2].data.d_float;
 
66
    }
 
67
 
 
68
  gimp_destroy_params (return_vals, nreturn_vals);
 
69
 
 
70
  return success;
 
71
}
 
72
 
 
73
/**
 
74
 * gimp_image_grid_set_spacing:
 
75
 * @image_ID: The image.
 
76
 * @xspacing: The image's grid horizontal spacing.
 
77
 * @yspacing: The image's grid vertical spacing.
 
78
 *
 
79
 * Sets the spacing of an image's grid.
 
80
 *
 
81
 * This procedure sets the horizontal and vertical spacing of an
 
82
 * image's grid.
 
83
 *
 
84
 * Returns: TRUE on success.
 
85
 *
 
86
 * Since: GIMP 2.4
 
87
 */
 
88
gboolean
 
89
gimp_image_grid_set_spacing (gint32  image_ID,
 
90
                             gdouble xspacing,
 
91
                             gdouble yspacing)
 
92
{
 
93
  GimpParam *return_vals;
 
94
  gint nreturn_vals;
 
95
  gboolean success = TRUE;
 
96
 
 
97
  return_vals = gimp_run_procedure ("gimp-image-grid-set-spacing",
 
98
                                    &nreturn_vals,
 
99
                                    GIMP_PDB_IMAGE, image_ID,
 
100
                                    GIMP_PDB_FLOAT, xspacing,
 
101
                                    GIMP_PDB_FLOAT, yspacing,
 
102
                                    GIMP_PDB_END);
 
103
 
 
104
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
105
 
 
106
  gimp_destroy_params (return_vals, nreturn_vals);
 
107
 
 
108
  return success;
 
109
}
 
110
 
 
111
/**
 
112
 * gimp_image_grid_get_offset:
 
113
 * @image_ID: The image.
 
114
 * @xoffset: The image's grid horizontal offset.
 
115
 * @yoffset: The image's grid vertical offset.
 
116
 *
 
117
 * Gets the offset of an image's grid.
 
118
 *
 
119
 * This procedure retrieves the horizontal and vertical offset of an
 
120
 * image's grid. It takes the image as parameter.
 
121
 *
 
122
 * Returns: TRUE on success.
 
123
 *
 
124
 * Since: GIMP 2.4
 
125
 */
 
126
gboolean
 
127
gimp_image_grid_get_offset (gint32   image_ID,
 
128
                            gdouble *xoffset,
 
129
                            gdouble *yoffset)
 
130
{
 
131
  GimpParam *return_vals;
 
132
  gint nreturn_vals;
 
133
  gboolean success = TRUE;
 
134
 
 
135
  return_vals = gimp_run_procedure ("gimp-image-grid-get-offset",
 
136
                                    &nreturn_vals,
 
137
                                    GIMP_PDB_IMAGE, image_ID,
 
138
                                    GIMP_PDB_END);
 
139
 
 
140
  *xoffset = 0.0;
 
141
  *yoffset = 0.0;
 
142
 
 
143
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
144
 
 
145
  if (success)
 
146
    {
 
147
      *xoffset = return_vals[1].data.d_float;
 
148
      *yoffset = return_vals[2].data.d_float;
 
149
    }
 
150
 
 
151
  gimp_destroy_params (return_vals, nreturn_vals);
 
152
 
 
153
  return success;
 
154
}
 
155
 
 
156
/**
 
157
 * gimp_image_grid_set_offset:
 
158
 * @image_ID: The image.
 
159
 * @xoffset: The image's grid horizontal offset.
 
160
 * @yoffset: The image's grid vertical offset.
 
161
 *
 
162
 * Sets the offset of an image's grid.
 
163
 *
 
164
 * This procedure sets the horizontal and vertical offset of an image's
 
165
 * grid.
 
166
 *
 
167
 * Returns: TRUE on success.
 
168
 *
 
169
 * Since: GIMP 2.4
 
170
 */
 
171
gboolean
 
172
gimp_image_grid_set_offset (gint32  image_ID,
 
173
                            gdouble xoffset,
 
174
                            gdouble yoffset)
 
175
{
 
176
  GimpParam *return_vals;
 
177
  gint nreturn_vals;
 
178
  gboolean success = TRUE;
 
179
 
 
180
  return_vals = gimp_run_procedure ("gimp-image-grid-set-offset",
 
181
                                    &nreturn_vals,
 
182
                                    GIMP_PDB_IMAGE, image_ID,
 
183
                                    GIMP_PDB_FLOAT, xoffset,
 
184
                                    GIMP_PDB_FLOAT, yoffset,
 
185
                                    GIMP_PDB_END);
 
186
 
 
187
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
188
 
 
189
  gimp_destroy_params (return_vals, nreturn_vals);
 
190
 
 
191
  return success;
 
192
}
 
193
 
 
194
/**
 
195
 * gimp_image_grid_get_foreground_color:
 
196
 * @image_ID: The image.
 
197
 * @fgcolor: The image's grid foreground color.
 
198
 *
 
199
 * Sets the foreground color of an image's grid.
 
200
 *
 
201
 * This procedure gets the foreground color of an image's grid.
 
202
 *
 
203
 * Returns: TRUE on success.
 
204
 *
 
205
 * Since: GIMP 2.4
 
206
 */
 
207
gboolean
 
208
gimp_image_grid_get_foreground_color (gint32   image_ID,
 
209
                                      GimpRGB *fgcolor)
 
210
{
 
211
  GimpParam *return_vals;
 
212
  gint nreturn_vals;
 
213
  gboolean success = TRUE;
 
214
 
 
215
  return_vals = gimp_run_procedure ("gimp-image-grid-get-foreground-color",
 
216
                                    &nreturn_vals,
 
217
                                    GIMP_PDB_IMAGE, image_ID,
 
218
                                    GIMP_PDB_END);
 
219
 
 
220
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
221
 
 
222
  if (success)
 
223
    *fgcolor = return_vals[1].data.d_color;
 
224
 
 
225
  gimp_destroy_params (return_vals, nreturn_vals);
 
226
 
 
227
  return success;
 
228
}
 
229
 
 
230
/**
 
231
 * gimp_image_grid_set_foreground_color:
 
232
 * @image_ID: The image.
 
233
 * @fgcolor: The new foreground color.
 
234
 *
 
235
 * Gets the foreground color of an image's grid.
 
236
 *
 
237
 * This procedure sets the foreground color of an image's grid.
 
238
 *
 
239
 * Returns: TRUE on success.
 
240
 *
 
241
 * Since: GIMP 2.4
 
242
 */
 
243
gboolean
 
244
gimp_image_grid_set_foreground_color (gint32         image_ID,
 
245
                                      const GimpRGB *fgcolor)
 
246
{
 
247
  GimpParam *return_vals;
 
248
  gint nreturn_vals;
 
249
  gboolean success = TRUE;
 
250
 
 
251
  return_vals = gimp_run_procedure ("gimp-image-grid-set-foreground-color",
 
252
                                    &nreturn_vals,
 
253
                                    GIMP_PDB_IMAGE, image_ID,
 
254
                                    GIMP_PDB_COLOR, fgcolor,
 
255
                                    GIMP_PDB_END);
 
256
 
 
257
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
258
 
 
259
  gimp_destroy_params (return_vals, nreturn_vals);
 
260
 
 
261
  return success;
 
262
}
 
263
 
 
264
/**
 
265
 * gimp_image_grid_get_background_color:
 
266
 * @image_ID: The image.
 
267
 * @bgcolor: The image's grid background color.
 
268
 *
 
269
 * Sets the background color of an image's grid.
 
270
 *
 
271
 * This procedure gets the background color of an image's grid.
 
272
 *
 
273
 * Returns: TRUE on success.
 
274
 *
 
275
 * Since: GIMP 2.4
 
276
 */
 
277
gboolean
 
278
gimp_image_grid_get_background_color (gint32   image_ID,
 
279
                                      GimpRGB *bgcolor)
 
280
{
 
281
  GimpParam *return_vals;
 
282
  gint nreturn_vals;
 
283
  gboolean success = TRUE;
 
284
 
 
285
  return_vals = gimp_run_procedure ("gimp-image-grid-get-background-color",
 
286
                                    &nreturn_vals,
 
287
                                    GIMP_PDB_IMAGE, image_ID,
 
288
                                    GIMP_PDB_END);
 
289
 
 
290
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
291
 
 
292
  if (success)
 
293
    *bgcolor = return_vals[1].data.d_color;
 
294
 
 
295
  gimp_destroy_params (return_vals, nreturn_vals);
 
296
 
 
297
  return success;
 
298
}
 
299
 
 
300
/**
 
301
 * gimp_image_grid_set_background_color:
 
302
 * @image_ID: The image.
 
303
 * @bgcolor: The new background color.
 
304
 *
 
305
 * Gets the background color of an image's grid.
 
306
 *
 
307
 * This procedure sets the background color of an image's grid.
 
308
 *
 
309
 * Returns: TRUE on success.
 
310
 *
 
311
 * Since: GIMP 2.4
 
312
 */
 
313
gboolean
 
314
gimp_image_grid_set_background_color (gint32         image_ID,
 
315
                                      const GimpRGB *bgcolor)
 
316
{
 
317
  GimpParam *return_vals;
 
318
  gint nreturn_vals;
 
319
  gboolean success = TRUE;
 
320
 
 
321
  return_vals = gimp_run_procedure ("gimp-image-grid-set-background-color",
 
322
                                    &nreturn_vals,
 
323
                                    GIMP_PDB_IMAGE, image_ID,
 
324
                                    GIMP_PDB_COLOR, bgcolor,
 
325
                                    GIMP_PDB_END);
 
326
 
 
327
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
328
 
 
329
  gimp_destroy_params (return_vals, nreturn_vals);
 
330
 
 
331
  return success;
 
332
}
 
333
 
 
334
/**
 
335
 * gimp_image_grid_get_style:
 
336
 * @image_ID: The image.
 
337
 *
 
338
 * Gets the style of an image's grid.
 
339
 *
 
340
 * This procedure retrieves the style of an image's grid.
 
341
 *
 
342
 * Returns: The image's grid style.
 
343
 *
 
344
 * Since: GIMP 2.4
 
345
 */
 
346
GimpGridStyle
 
347
gimp_image_grid_get_style (gint32 image_ID)
 
348
{
 
349
  GimpParam *return_vals;
 
350
  gint nreturn_vals;
 
351
  GimpGridStyle style = 0;
 
352
 
 
353
  return_vals = gimp_run_procedure ("gimp-image-grid-get-style",
 
354
                                    &nreturn_vals,
 
355
                                    GIMP_PDB_IMAGE, image_ID,
 
356
                                    GIMP_PDB_END);
 
357
 
 
358
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
359
    style = return_vals[1].data.d_int32;
 
360
 
 
361
  gimp_destroy_params (return_vals, nreturn_vals);
 
362
 
 
363
  return style;
 
364
}
 
365
 
 
366
/**
 
367
 * gimp_image_grid_set_style:
 
368
 * @image_ID: The image.
 
369
 * @style: The image's grid style.
 
370
 *
 
371
 * Sets the style unit of an image's grid.
 
372
 *
 
373
 * This procedure sets the style of an image's grid. It takes the image
 
374
 * and the new style as parameters.
 
375
 *
 
376
 * Returns: TRUE on success.
 
377
 *
 
378
 * Since: GIMP 2.4
 
379
 */
 
380
gboolean
 
381
gimp_image_grid_set_style (gint32        image_ID,
 
382
                           GimpGridStyle style)
 
383
{
 
384
  GimpParam *return_vals;
 
385
  gint nreturn_vals;
 
386
  gboolean success = TRUE;
 
387
 
 
388
  return_vals = gimp_run_procedure ("gimp-image-grid-set-style",
 
389
                                    &nreturn_vals,
 
390
                                    GIMP_PDB_IMAGE, image_ID,
 
391
                                    GIMP_PDB_INT32, style,
 
392
                                    GIMP_PDB_END);
 
393
 
 
394
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
395
 
 
396
  gimp_destroy_params (return_vals, nreturn_vals);
 
397
 
 
398
  return success;
 
399
}