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

« back to all changes in this revision

Viewing changes to plug-ins/pygimp/gimpui.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
/* -- THIS FILE IS GENERATED - DO NOT EDIT *//* -*- Mode: C; c-basic-offset: 4 -*- */
 
2
 
 
3
#include <Python.h>
 
4
 
 
5
 
 
6
 
 
7
#line 3 "gimpui.override"
 
8
#include <Python.h>
 
9
 
 
10
#define NO_IMPORT_PYGOBJECT
 
11
#include <pygobject.h>
 
12
 
 
13
#include <libgimp/gimp.h>
 
14
#include <libgimp/gimpui.h>
 
15
 
 
16
#define NO_IMPORT_PYGIMP
 
17
#include "pygimp-api.h"
 
18
 
 
19
#define NO_IMPORT_PYGIMPCOLOR
 
20
#include "pygimpcolor-api.h"
 
21
 
 
22
typedef struct {
 
23
    PyObject *constraint;
 
24
    PyObject *user_data;
 
25
} PyGimpConstraintData;
 
26
#line 27 "gimpui.c"
 
27
 
 
28
 
 
29
/* ---------- types from other modules ---------- */
 
30
static PyTypeObject *_PyGObject_Type;
 
31
#define PyGObject_Type (*_PyGObject_Type)
 
32
static PyTypeObject *_PyGdkPixbuf_Type;
 
33
#define PyGdkPixbuf_Type (*_PyGdkPixbuf_Type)
 
34
static PyTypeObject *_PyGtkObject_Type;
 
35
#define PyGtkObject_Type (*_PyGtkObject_Type)
 
36
static PyTypeObject *_PyGtkWidget_Type;
 
37
#define PyGtkWidget_Type (*_PyGtkWidget_Type)
 
38
static PyTypeObject *_PyGtkDialog_Type;
 
39
#define PyGtkDialog_Type (*_PyGtkDialog_Type)
 
40
static PyTypeObject *_PyGtkWindow_Type;
 
41
#define PyGtkWindow_Type (*_PyGtkWindow_Type)
 
42
static PyTypeObject *_PyGtkLabel_Type;
 
43
#define PyGtkLabel_Type (*_PyGtkLabel_Type)
 
44
static PyTypeObject *_PyGtkButton_Type;
 
45
#define PyGtkButton_Type (*_PyGtkButton_Type)
 
46
static PyTypeObject *_PyGtkToggleButton_Type;
 
47
#define PyGtkToggleButton_Type (*_PyGtkToggleButton_Type)
 
48
static PyTypeObject *_PyGtkRadioButton_Type;
 
49
#define PyGtkRadioButton_Type (*_PyGtkRadioButton_Type)
 
50
static PyTypeObject *_PyGtkSpinButton_Type;
 
51
#define PyGtkSpinButton_Type (*_PyGtkSpinButton_Type)
 
52
static PyTypeObject *_PyGtkEntry_Type;
 
53
#define PyGtkEntry_Type (*_PyGtkEntry_Type)
 
54
static PyTypeObject *_PyGtkDrawingArea_Type;
 
55
#define PyGtkDrawingArea_Type (*_PyGtkDrawingArea_Type)
 
56
static PyTypeObject *_PyGtkTable_Type;
 
57
#define PyGtkTable_Type (*_PyGtkTable_Type)
 
58
static PyTypeObject *_PyGtkFrame_Type;
 
59
#define PyGtkFrame_Type (*_PyGtkFrame_Type)
 
60
static PyTypeObject *_PyGtkHBox_Type;
 
61
#define PyGtkHBox_Type (*_PyGtkHBox_Type)
 
62
static PyTypeObject *_PyGtkVBox_Type;
 
63
#define PyGtkVBox_Type (*_PyGtkVBox_Type)
 
64
static PyTypeObject *_PyGtkHPaned_Type;
 
65
#define PyGtkHPaned_Type (*_PyGtkHPaned_Type)
 
66
static PyTypeObject *_PyGtkVPaned_Type;
 
67
#define PyGtkVPaned_Type (*_PyGtkVPaned_Type)
 
68
static PyTypeObject *_PyGtkScale_Type;
 
69
#define PyGtkScale_Type (*_PyGtkScale_Type)
 
70
static PyTypeObject *_PyGtkProgressBar_Type;
 
71
#define PyGtkProgressBar_Type (*_PyGtkProgressBar_Type)
 
72
static PyTypeObject *_PyGtkOptionMenu_Type;
 
73
#define PyGtkOptionMenu_Type (*_PyGtkOptionMenu_Type)
 
74
static PyTypeObject *_PyGtkComboBox_Type;
 
75
#define PyGtkComboBox_Type (*_PyGtkComboBox_Type)
 
76
static PyTypeObject *_PyGtkListStore_Type;
 
77
#define PyGtkListStore_Type (*_PyGtkListStore_Type)
 
78
static PyTypeObject *_PyGtkTreeModel_Type;
 
79
#define PyGtkTreeModel_Type (*_PyGtkTreeModel_Type)
 
80
static PyTypeObject *_PyGtkCellRenderer_Type;
 
81
#define PyGtkCellRenderer_Type (*_PyGtkCellRenderer_Type)
 
82
static PyTypeObject *_PyGtkCellRendererToggle_Type;
 
83
#define PyGtkCellRendererToggle_Type (*_PyGtkCellRendererToggle_Type)
 
84
 
 
85
 
 
86
/* ---------- forward type declarations ---------- */
 
87
PyTypeObject G_GNUC_INTERNAL PyGimpBrowser_Type;
 
88
PyTypeObject G_GNUC_INTERNAL PyGimpButton_Type;
 
89
PyTypeObject G_GNUC_INTERNAL PyGimpCellRendererColor_Type;
 
90
PyTypeObject G_GNUC_INTERNAL PyGimpCellRendererToggle_Type;
 
91
PyTypeObject G_GNUC_INTERNAL PyGimpChainButton_Type;
 
92
PyTypeObject G_GNUC_INTERNAL PyGimpColorArea_Type;
 
93
PyTypeObject G_GNUC_INTERNAL PyGimpColorButton_Type;
 
94
PyTypeObject G_GNUC_INTERNAL PyGimpColorDisplay_Type;
 
95
PyTypeObject G_GNUC_INTERNAL PyGimpColorDisplayStack_Type;
 
96
PyTypeObject G_GNUC_INTERNAL PyGimpColorHexEntry_Type;
 
97
PyTypeObject G_GNUC_INTERNAL PyGimpColorScale_Type;
 
98
PyTypeObject G_GNUC_INTERNAL PyGimpColorSelection_Type;
 
99
PyTypeObject G_GNUC_INTERNAL PyGimpColorSelector_Type;
 
100
PyTypeObject G_GNUC_INTERNAL PyGimpColorNotebook_Type;
 
101
PyTypeObject G_GNUC_INTERNAL PyGimpDialog_Type;
 
102
PyTypeObject G_GNUC_INTERNAL PyGimpEnumLabel_Type;
 
103
PyTypeObject G_GNUC_INTERNAL PyGimpFrame_Type;
 
104
PyTypeObject G_GNUC_INTERNAL PyGimpHintBox_Type;
 
105
PyTypeObject G_GNUC_INTERNAL PyGimpIntComboBox_Type;
 
106
PyTypeObject G_GNUC_INTERNAL PyGimpEnumComboBox_Type;
 
107
PyTypeObject G_GNUC_INTERNAL PyGimpIntStore_Type;
 
108
PyTypeObject G_GNUC_INTERNAL PyGimpEnumStore_Type;
 
109
PyTypeObject G_GNUC_INTERNAL PyGimpMemsizeEntry_Type;
 
110
PyTypeObject G_GNUC_INTERNAL PyGimpOffsetArea_Type;
 
111
PyTypeObject G_GNUC_INTERNAL PyGimpPageSelector_Type;
 
112
PyTypeObject G_GNUC_INTERNAL PyGimpPathEditor_Type;
 
113
PyTypeObject G_GNUC_INTERNAL PyGimpPickButton_Type;
 
114
PyTypeObject G_GNUC_INTERNAL PyGimpPreview_Type;
 
115
PyTypeObject G_GNUC_INTERNAL PyGimpAspectPreview_Type;
 
116
PyTypeObject G_GNUC_INTERNAL PyGimpPreviewArea_Type;
 
117
PyTypeObject G_GNUC_INTERNAL PyGimpProcBrowserDialog_Type;
 
118
PyTypeObject G_GNUC_INTERNAL PyGimpProgressBar_Type;
 
119
PyTypeObject G_GNUC_INTERNAL PyGimpResolutionEntry_Type;
 
120
PyTypeObject G_GNUC_INTERNAL PyGimpScrolledPreview_Type;
 
121
PyTypeObject G_GNUC_INTERNAL PyGimpDrawablePreview_Type;
 
122
PyTypeObject G_GNUC_INTERNAL PyGimpSelectButton_Type;
 
123
PyTypeObject G_GNUC_INTERNAL PyGimpPatternSelectButton_Type;
 
124
PyTypeObject G_GNUC_INTERNAL PyGimpPaletteSelectButton_Type;
 
125
PyTypeObject G_GNUC_INTERNAL PyGimpGradientSelectButton_Type;
 
126
PyTypeObject G_GNUC_INTERNAL PyGimpFontSelectButton_Type;
 
127
PyTypeObject G_GNUC_INTERNAL PyGimpBrushSelectButton_Type;
 
128
PyTypeObject G_GNUC_INTERNAL PyGimpSizeEntry_Type;
 
129
PyTypeObject G_GNUC_INTERNAL PyGimpUnitMenu_Type;
 
130
PyTypeObject G_GNUC_INTERNAL PyGimpZoomModel_Type;
 
131
PyTypeObject G_GNUC_INTERNAL PyGimpZoomPreview_Type;
 
132
PyTypeObject G_GNUC_INTERNAL PyGimpDrawableComboBox_Type;
 
133
PyTypeObject G_GNUC_INTERNAL PyGimpChannelComboBox_Type;
 
134
PyTypeObject G_GNUC_INTERNAL PyGimpLayerComboBox_Type;
 
135
PyTypeObject G_GNUC_INTERNAL PyGimpVectorsComboBox_Type;
 
136
PyTypeObject G_GNUC_INTERNAL PyGimpImageComboBox_Type;
 
137
 
 
138
#line 139 "gimpui.c"
 
139
 
 
140
 
 
141
 
 
142
/* ----------- GimpBrowser ----------- */
 
143
 
 
144
static int
 
145
_wrap_gimp_browser_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
146
{
 
147
    static char* kwlist[] = { NULL };
 
148
 
 
149
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
150
                                     ":gimpui.Browser.__init__",
 
151
                                     kwlist))
 
152
        return -1;
 
153
 
 
154
    pygobject_constructv(self, 0, NULL);
 
155
    if (!self->obj) {
 
156
        PyErr_SetString(
 
157
            PyExc_RuntimeError, 
 
158
            "could not create gimpui.Browser object");
 
159
        return -1;
 
160
    }
 
161
    return 0;
 
162
}
 
163
 
 
164
#line 1133 "gimpui.override"
 
165
static PyObject *
 
166
_wrap_gimp_browser_add_search_types(PyGObject *self, PyObject *args, PyObject *kwargs)
 
167
{
 
168
    PyObject *py_types = NULL;
 
169
    int len, i;
 
170
 
 
171
    static char *kwlist[] = { "search_types", NULL };
 
172
 
 
173
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
174
                                     "O:GimpBrowser.add_search_types",
 
175
                                     kwlist,
 
176
                                     &py_types))
 
177
        return NULL;
 
178
 
 
179
    if (PyTuple_Check(py_types))
 
180
        len = PyTuple_Size(py_types);
 
181
    else {
 
182
        PyErr_SetString(PyExc_TypeError,
 
183
                        "search_types must be a tuple containing label/id "
 
184
                        "pairs");
 
185
        return NULL;
 
186
    }
 
187
 
 
188
    if (len % 2) {
 
189
        PyErr_SetString(PyExc_RuntimeError,
 
190
                        "search_types tuple must contain label/id pairs");
 
191
        return NULL;
 
192
    }
 
193
 
 
194
    for (i = 0; i < len; i += 2) {
 
195
        PyObject *label = PyTuple_GetItem(py_types, i);
 
196
        PyObject *id = PyTuple_GetItem(py_types, i + 1);
 
197
 
 
198
        if (!PyString_Check(label)) {
 
199
            PyErr_SetString(PyExc_RuntimeError,
 
200
                            "first member of each label/id pair "
 
201
                            "must be a string");
 
202
            return NULL;
 
203
        }
 
204
 
 
205
        if (!PyInt_Check(id)) {
 
206
            PyErr_SetString(PyExc_RuntimeError,
 
207
                            "second member of each label/id pair "
 
208
                            "must be a number");
 
209
            return NULL;
 
210
        }
 
211
 
 
212
        gimp_browser_add_search_types(GIMP_BROWSER(self->obj),
 
213
                                      PyString_AsString(label),
 
214
                                      PyInt_AsLong(id),
 
215
                                      NULL);
 
216
    }
 
217
 
 
218
    Py_INCREF(Py_None);
 
219
    return Py_None;
 
220
}
 
221
#line 222 "gimpui.c"
 
222
 
 
223
 
 
224
static PyObject *
 
225
_wrap_gimp_browser_set_widget(PyGObject *self, PyObject *args, PyObject *kwargs)
 
226
{
 
227
    static char *kwlist[] = { "widget", NULL };
 
228
    PyGObject *widget;
 
229
 
 
230
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:GimpBrowser.set_widget", kwlist, &PyGtkWidget_Type, &widget))
 
231
        return NULL;
 
232
    
 
233
    gimp_browser_set_widget(GIMP_BROWSER(self->obj), GTK_WIDGET(widget->obj));
 
234
    
 
235
    Py_INCREF(Py_None);
 
236
    return Py_None;
 
237
}
 
238
 
 
239
static PyObject *
 
240
_wrap_gimp_browser_show_message(PyGObject *self, PyObject *args, PyObject *kwargs)
 
241
{
 
242
    static char *kwlist[] = { "message", NULL };
 
243
    char *message;
 
244
 
 
245
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpBrowser.show_message", kwlist, &message))
 
246
        return NULL;
 
247
    
 
248
    gimp_browser_show_message(GIMP_BROWSER(self->obj), message);
 
249
    
 
250
    Py_INCREF(Py_None);
 
251
    return Py_None;
 
252
}
 
253
 
 
254
static const PyMethodDef _PyGimpBrowser_methods[] = {
 
255
    { "add_search_types", (PyCFunction)_wrap_gimp_browser_add_search_types, METH_VARARGS|METH_KEYWORDS,
 
256
      NULL },
 
257
    { "set_widget", (PyCFunction)_wrap_gimp_browser_set_widget, METH_VARARGS|METH_KEYWORDS,
 
258
      NULL },
 
259
    { "show_message", (PyCFunction)_wrap_gimp_browser_show_message, METH_VARARGS|METH_KEYWORDS,
 
260
      NULL },
 
261
    { NULL, NULL, 0, NULL }
 
262
};
 
263
 
 
264
PyTypeObject G_GNUC_INTERNAL PyGimpBrowser_Type = {
 
265
    PyObject_HEAD_INIT(NULL)
 
266
    0,                                 /* ob_size */
 
267
    "gimpui.Browser",                   /* tp_name */
 
268
    sizeof(PyGObject),          /* tp_basicsize */
 
269
    0,                                 /* tp_itemsize */
 
270
    /* methods */
 
271
    (destructor)0,        /* tp_dealloc */
 
272
    (printfunc)0,                      /* tp_print */
 
273
    (getattrfunc)0,       /* tp_getattr */
 
274
    (setattrfunc)0,       /* tp_setattr */
 
275
    (cmpfunc)0,           /* tp_compare */
 
276
    (reprfunc)0,             /* tp_repr */
 
277
    (PyNumberMethods*)0,     /* tp_as_number */
 
278
    (PySequenceMethods*)0, /* tp_as_sequence */
 
279
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
280
    (hashfunc)0,             /* tp_hash */
 
281
    (ternaryfunc)0,          /* tp_call */
 
282
    (reprfunc)0,              /* tp_str */
 
283
    (getattrofunc)0,     /* tp_getattro */
 
284
    (setattrofunc)0,     /* tp_setattro */
 
285
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
286
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
287
    NULL,                        /* Documentation string */
 
288
    (traverseproc)0,     /* tp_traverse */
 
289
    (inquiry)0,             /* tp_clear */
 
290
    (richcmpfunc)0,   /* tp_richcompare */
 
291
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
292
    (getiterfunc)0,          /* tp_iter */
 
293
    (iternextfunc)0,     /* tp_iternext */
 
294
    (struct PyMethodDef*)_PyGimpBrowser_methods, /* tp_methods */
 
295
    (struct PyMemberDef*)0,              /* tp_members */
 
296
    (struct PyGetSetDef*)0,  /* tp_getset */
 
297
    NULL,                              /* tp_base */
 
298
    NULL,                              /* tp_dict */
 
299
    (descrgetfunc)0,    /* tp_descr_get */
 
300
    (descrsetfunc)0,    /* tp_descr_set */
 
301
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
302
    (initproc)_wrap_gimp_browser_new,             /* tp_init */
 
303
    (allocfunc)0,           /* tp_alloc */
 
304
    (newfunc)0,               /* tp_new */
 
305
    (freefunc)0,             /* tp_free */
 
306
    (inquiry)0              /* tp_is_gc */
 
307
};
 
308
 
 
309
 
 
310
 
 
311
/* ----------- GimpButton ----------- */
 
312
 
 
313
static int
 
314
_wrap_gimp_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
315
{
 
316
    static char* kwlist[] = { NULL };
 
317
 
 
318
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
319
                                     ":gimpui.Button.__init__",
 
320
                                     kwlist))
 
321
        return -1;
 
322
 
 
323
    pygobject_constructv(self, 0, NULL);
 
324
    if (!self->obj) {
 
325
        PyErr_SetString(
 
326
            PyExc_RuntimeError, 
 
327
            "could not create gimpui.Button object");
 
328
        return -1;
 
329
    }
 
330
    return 0;
 
331
}
 
332
 
 
333
static PyObject *
 
334
_wrap_gimp_button_extended_clicked(PyGObject *self, PyObject *args, PyObject *kwargs)
 
335
{
 
336
    static char *kwlist[] = { "state", NULL };
 
337
    PyObject *py_state = NULL;
 
338
    GdkModifierType state;
 
339
 
 
340
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpButton.extended_clicked", kwlist, &py_state))
 
341
        return NULL;
 
342
    if (pyg_flags_get_value(GDK_TYPE_MODIFIER_TYPE, py_state, (gpointer)&state))
 
343
        return NULL;
 
344
    
 
345
    gimp_button_extended_clicked(GIMP_BUTTON(self->obj), state);
 
346
    
 
347
    Py_INCREF(Py_None);
 
348
    return Py_None;
 
349
}
 
350
 
 
351
static const PyMethodDef _PyGimpButton_methods[] = {
 
352
    { "extended_clicked", (PyCFunction)_wrap_gimp_button_extended_clicked, METH_VARARGS|METH_KEYWORDS,
 
353
      NULL },
 
354
    { NULL, NULL, 0, NULL }
 
355
};
 
356
 
 
357
PyTypeObject G_GNUC_INTERNAL PyGimpButton_Type = {
 
358
    PyObject_HEAD_INIT(NULL)
 
359
    0,                                 /* ob_size */
 
360
    "gimpui.Button",                   /* tp_name */
 
361
    sizeof(PyGObject),          /* tp_basicsize */
 
362
    0,                                 /* tp_itemsize */
 
363
    /* methods */
 
364
    (destructor)0,        /* tp_dealloc */
 
365
    (printfunc)0,                      /* tp_print */
 
366
    (getattrfunc)0,       /* tp_getattr */
 
367
    (setattrfunc)0,       /* tp_setattr */
 
368
    (cmpfunc)0,           /* tp_compare */
 
369
    (reprfunc)0,             /* tp_repr */
 
370
    (PyNumberMethods*)0,     /* tp_as_number */
 
371
    (PySequenceMethods*)0, /* tp_as_sequence */
 
372
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
373
    (hashfunc)0,             /* tp_hash */
 
374
    (ternaryfunc)0,          /* tp_call */
 
375
    (reprfunc)0,              /* tp_str */
 
376
    (getattrofunc)0,     /* tp_getattro */
 
377
    (setattrofunc)0,     /* tp_setattro */
 
378
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
379
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
380
    NULL,                        /* Documentation string */
 
381
    (traverseproc)0,     /* tp_traverse */
 
382
    (inquiry)0,             /* tp_clear */
 
383
    (richcmpfunc)0,   /* tp_richcompare */
 
384
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
385
    (getiterfunc)0,          /* tp_iter */
 
386
    (iternextfunc)0,     /* tp_iternext */
 
387
    (struct PyMethodDef*)_PyGimpButton_methods, /* tp_methods */
 
388
    (struct PyMemberDef*)0,              /* tp_members */
 
389
    (struct PyGetSetDef*)0,  /* tp_getset */
 
390
    NULL,                              /* tp_base */
 
391
    NULL,                              /* tp_dict */
 
392
    (descrgetfunc)0,    /* tp_descr_get */
 
393
    (descrsetfunc)0,    /* tp_descr_set */
 
394
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
395
    (initproc)_wrap_gimp_button_new,             /* tp_init */
 
396
    (allocfunc)0,           /* tp_alloc */
 
397
    (newfunc)0,               /* tp_new */
 
398
    (freefunc)0,             /* tp_free */
 
399
    (inquiry)0              /* tp_is_gc */
 
400
};
 
401
 
 
402
 
 
403
 
 
404
/* ----------- GimpCellRendererColor ----------- */
 
405
 
 
406
static int
 
407
_wrap_gimp_cell_renderer_color_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
408
{
 
409
    static char* kwlist[] = { NULL };
 
410
 
 
411
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
412
                                     ":gimpui.CellRendererColor.__init__",
 
413
                                     kwlist))
 
414
        return -1;
 
415
 
 
416
    pygobject_constructv(self, 0, NULL);
 
417
    if (!self->obj) {
 
418
        PyErr_SetString(
 
419
            PyExc_RuntimeError, 
 
420
            "could not create gimpui.CellRendererColor object");
 
421
        return -1;
 
422
    }
 
423
    return 0;
 
424
}
 
425
 
 
426
PyTypeObject G_GNUC_INTERNAL PyGimpCellRendererColor_Type = {
 
427
    PyObject_HEAD_INIT(NULL)
 
428
    0,                                 /* ob_size */
 
429
    "gimpui.CellRendererColor",                   /* tp_name */
 
430
    sizeof(PyGObject),          /* tp_basicsize */
 
431
    0,                                 /* tp_itemsize */
 
432
    /* methods */
 
433
    (destructor)0,        /* tp_dealloc */
 
434
    (printfunc)0,                      /* tp_print */
 
435
    (getattrfunc)0,       /* tp_getattr */
 
436
    (setattrfunc)0,       /* tp_setattr */
 
437
    (cmpfunc)0,           /* tp_compare */
 
438
    (reprfunc)0,             /* tp_repr */
 
439
    (PyNumberMethods*)0,     /* tp_as_number */
 
440
    (PySequenceMethods*)0, /* tp_as_sequence */
 
441
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
442
    (hashfunc)0,             /* tp_hash */
 
443
    (ternaryfunc)0,          /* tp_call */
 
444
    (reprfunc)0,              /* tp_str */
 
445
    (getattrofunc)0,     /* tp_getattro */
 
446
    (setattrofunc)0,     /* tp_setattro */
 
447
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
448
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
449
    NULL,                        /* Documentation string */
 
450
    (traverseproc)0,     /* tp_traverse */
 
451
    (inquiry)0,             /* tp_clear */
 
452
    (richcmpfunc)0,   /* tp_richcompare */
 
453
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
454
    (getiterfunc)0,          /* tp_iter */
 
455
    (iternextfunc)0,     /* tp_iternext */
 
456
    (struct PyMethodDef*)NULL, /* tp_methods */
 
457
    (struct PyMemberDef*)0,              /* tp_members */
 
458
    (struct PyGetSetDef*)0,  /* tp_getset */
 
459
    NULL,                              /* tp_base */
 
460
    NULL,                              /* tp_dict */
 
461
    (descrgetfunc)0,    /* tp_descr_get */
 
462
    (descrsetfunc)0,    /* tp_descr_set */
 
463
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
464
    (initproc)_wrap_gimp_cell_renderer_color_new,             /* tp_init */
 
465
    (allocfunc)0,           /* tp_alloc */
 
466
    (newfunc)0,               /* tp_new */
 
467
    (freefunc)0,             /* tp_free */
 
468
    (inquiry)0              /* tp_is_gc */
 
469
};
 
470
 
 
471
 
 
472
 
 
473
/* ----------- GimpCellRendererToggle ----------- */
 
474
 
 
475
static int
 
476
_wrap_gimp_cell_renderer_toggle_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
477
{
 
478
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
479
    GParameter params[1];
 
480
    PyObject *parsed_args[1] = {NULL, };
 
481
    char *arg_names[] = {"stock_id", NULL };
 
482
    char *prop_names[] = {"stock-id", NULL };
 
483
    guint nparams, i;
 
484
 
 
485
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:gimpui.CellRendererToggle.__init__" , arg_names , &parsed_args[0]))
 
486
        return -1;
 
487
 
 
488
    memset(params, 0, sizeof(GParameter)*1);
 
489
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
490
                                    prop_names, params, 
 
491
                                    &nparams, parsed_args))
 
492
        return -1;
 
493
    pygobject_constructv(self, nparams, params);
 
494
    for (i = 0; i < nparams; ++i)
 
495
        g_value_unset(&params[i].value);
 
496
    if (!self->obj) {
 
497
        PyErr_SetString(
 
498
            PyExc_RuntimeError, 
 
499
            "could not create gimpui.CellRendererToggle object");
 
500
        return -1;
 
501
    }
 
502
    return 0;
 
503
}
 
504
 
 
505
static PyObject *
 
506
_wrap_gimp_cell_renderer_toggle_clicked(PyGObject *self, PyObject *args, PyObject *kwargs)
 
507
{
 
508
    static char *kwlist[] = { "path", "state", NULL };
 
509
    char *path;
 
510
    PyObject *py_state = NULL;
 
511
    GdkModifierType state;
 
512
 
 
513
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"sO:GimpCellRendererToggle.clicked", kwlist, &path, &py_state))
 
514
        return NULL;
 
515
    if (pyg_flags_get_value(GDK_TYPE_MODIFIER_TYPE, py_state, (gpointer)&state))
 
516
        return NULL;
 
517
    
 
518
    gimp_cell_renderer_toggle_clicked(GIMP_CELL_RENDERER_TOGGLE(self->obj), path, state);
 
519
    
 
520
    Py_INCREF(Py_None);
 
521
    return Py_None;
 
522
}
 
523
 
 
524
static const PyMethodDef _PyGimpCellRendererToggle_methods[] = {
 
525
    { "clicked", (PyCFunction)_wrap_gimp_cell_renderer_toggle_clicked, METH_VARARGS|METH_KEYWORDS,
 
526
      NULL },
 
527
    { NULL, NULL, 0, NULL }
 
528
};
 
529
 
 
530
PyTypeObject G_GNUC_INTERNAL PyGimpCellRendererToggle_Type = {
 
531
    PyObject_HEAD_INIT(NULL)
 
532
    0,                                 /* ob_size */
 
533
    "gimpui.CellRendererToggle",                   /* tp_name */
 
534
    sizeof(PyGObject),          /* tp_basicsize */
 
535
    0,                                 /* tp_itemsize */
 
536
    /* methods */
 
537
    (destructor)0,        /* tp_dealloc */
 
538
    (printfunc)0,                      /* tp_print */
 
539
    (getattrfunc)0,       /* tp_getattr */
 
540
    (setattrfunc)0,       /* tp_setattr */
 
541
    (cmpfunc)0,           /* tp_compare */
 
542
    (reprfunc)0,             /* tp_repr */
 
543
    (PyNumberMethods*)0,     /* tp_as_number */
 
544
    (PySequenceMethods*)0, /* tp_as_sequence */
 
545
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
546
    (hashfunc)0,             /* tp_hash */
 
547
    (ternaryfunc)0,          /* tp_call */
 
548
    (reprfunc)0,              /* tp_str */
 
549
    (getattrofunc)0,     /* tp_getattro */
 
550
    (setattrofunc)0,     /* tp_setattro */
 
551
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
552
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
553
    NULL,                        /* Documentation string */
 
554
    (traverseproc)0,     /* tp_traverse */
 
555
    (inquiry)0,             /* tp_clear */
 
556
    (richcmpfunc)0,   /* tp_richcompare */
 
557
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
558
    (getiterfunc)0,          /* tp_iter */
 
559
    (iternextfunc)0,     /* tp_iternext */
 
560
    (struct PyMethodDef*)_PyGimpCellRendererToggle_methods, /* tp_methods */
 
561
    (struct PyMemberDef*)0,              /* tp_members */
 
562
    (struct PyGetSetDef*)0,  /* tp_getset */
 
563
    NULL,                              /* tp_base */
 
564
    NULL,                              /* tp_dict */
 
565
    (descrgetfunc)0,    /* tp_descr_get */
 
566
    (descrsetfunc)0,    /* tp_descr_set */
 
567
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
568
    (initproc)_wrap_gimp_cell_renderer_toggle_new,             /* tp_init */
 
569
    (allocfunc)0,           /* tp_alloc */
 
570
    (newfunc)0,               /* tp_new */
 
571
    (freefunc)0,             /* tp_free */
 
572
    (inquiry)0              /* tp_is_gc */
 
573
};
 
574
 
 
575
 
 
576
 
 
577
/* ----------- GimpChainButton ----------- */
 
578
 
 
579
 static int
 
580
_wrap_gimp_chain_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
581
{
 
582
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
583
    GParameter params[1];
 
584
    PyObject *parsed_args[1] = {NULL, };
 
585
    char *arg_names[] = {"position", NULL };
 
586
    char *prop_names[] = {"position", NULL };
 
587
    guint nparams, i;
 
588
 
 
589
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gimpui.ChainButton.__init__" , arg_names , &parsed_args[0]))
 
590
        return -1;
 
591
 
 
592
    memset(params, 0, sizeof(GParameter)*1);
 
593
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
594
                                    prop_names, params, 
 
595
                                    &nparams, parsed_args))
 
596
        return -1;
 
597
    pygobject_constructv(self, nparams, params);
 
598
    for (i = 0; i < nparams; ++i)
 
599
        g_value_unset(&params[i].value);
 
600
    if (!self->obj) {
 
601
        PyErr_SetString(
 
602
            PyExc_RuntimeError, 
 
603
            "could not create gimpui.ChainButton object");
 
604
        return -1;
 
605
    }
 
606
    return 0;
 
607
}
 
608
 
 
609
static PyObject *
 
610
_wrap_gimp_chain_button_set_active(PyGObject *self, PyObject *args, PyObject *kwargs)
 
611
{
 
612
    static char *kwlist[] = { "active", NULL };
 
613
    int active;
 
614
 
 
615
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpChainButton.set_active", kwlist, &active))
 
616
        return NULL;
 
617
    
 
618
    gimp_chain_button_set_active(GIMP_CHAIN_BUTTON(self->obj), active);
 
619
    
 
620
    Py_INCREF(Py_None);
 
621
    return Py_None;
 
622
}
 
623
 
 
624
static PyObject *
 
625
_wrap_gimp_chain_button_get_active(PyGObject *self)
 
626
{
 
627
    int ret;
 
628
 
 
629
    
 
630
    ret = gimp_chain_button_get_active(GIMP_CHAIN_BUTTON(self->obj));
 
631
    
 
632
    return PyBool_FromLong(ret);
 
633
 
 
634
}
 
635
 
 
636
static const PyMethodDef _PyGimpChainButton_methods[] = {
 
637
    { "set_active", (PyCFunction)_wrap_gimp_chain_button_set_active, METH_VARARGS|METH_KEYWORDS,
 
638
      NULL },
 
639
    { "get_active", (PyCFunction)_wrap_gimp_chain_button_get_active, METH_NOARGS,
 
640
      NULL },
 
641
    { NULL, NULL, 0, NULL }
 
642
};
 
643
 
 
644
PyTypeObject G_GNUC_INTERNAL PyGimpChainButton_Type = {
 
645
    PyObject_HEAD_INIT(NULL)
 
646
    0,                                 /* ob_size */
 
647
    "gimpui.ChainButton",                   /* tp_name */
 
648
    sizeof(PyGObject),          /* tp_basicsize */
 
649
    0,                                 /* tp_itemsize */
 
650
    /* methods */
 
651
    (destructor)0,        /* tp_dealloc */
 
652
    (printfunc)0,                      /* tp_print */
 
653
    (getattrfunc)0,       /* tp_getattr */
 
654
    (setattrfunc)0,       /* tp_setattr */
 
655
    (cmpfunc)0,           /* tp_compare */
 
656
    (reprfunc)0,             /* tp_repr */
 
657
    (PyNumberMethods*)0,     /* tp_as_number */
 
658
    (PySequenceMethods*)0, /* tp_as_sequence */
 
659
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
660
    (hashfunc)0,             /* tp_hash */
 
661
    (ternaryfunc)0,          /* tp_call */
 
662
    (reprfunc)0,              /* tp_str */
 
663
    (getattrofunc)0,     /* tp_getattro */
 
664
    (setattrofunc)0,     /* tp_setattro */
 
665
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
666
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
667
    NULL,                        /* Documentation string */
 
668
    (traverseproc)0,     /* tp_traverse */
 
669
    (inquiry)0,             /* tp_clear */
 
670
    (richcmpfunc)0,   /* tp_richcompare */
 
671
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
672
    (getiterfunc)0,          /* tp_iter */
 
673
    (iternextfunc)0,     /* tp_iternext */
 
674
    (struct PyMethodDef*)_PyGimpChainButton_methods, /* tp_methods */
 
675
    (struct PyMemberDef*)0,              /* tp_members */
 
676
    (struct PyGetSetDef*)0,  /* tp_getset */
 
677
    NULL,                              /* tp_base */
 
678
    NULL,                              /* tp_dict */
 
679
    (descrgetfunc)0,    /* tp_descr_get */
 
680
    (descrsetfunc)0,    /* tp_descr_set */
 
681
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
682
    (initproc)_wrap_gimp_chain_button_new,             /* tp_init */
 
683
    (allocfunc)0,           /* tp_alloc */
 
684
    (newfunc)0,               /* tp_new */
 
685
    (freefunc)0,             /* tp_free */
 
686
    (inquiry)0              /* tp_is_gc */
 
687
};
 
688
 
 
689
 
 
690
 
 
691
/* ----------- GimpColorArea ----------- */
 
692
 
 
693
 static int
 
694
_wrap_gimp_color_area_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
695
{
 
696
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
697
    GParameter params[3];
 
698
    PyObject *parsed_args[3] = {NULL, };
 
699
    char *arg_names[] = {"color", "type", "drag_mask", NULL };
 
700
    char *prop_names[] = {"color", "type", "drag-mask", NULL };
 
701
    guint nparams, i;
 
702
 
 
703
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOO:gimpui.ColorArea.__init__" , arg_names , &parsed_args[0] , &parsed_args[1] , &parsed_args[2]))
 
704
        return -1;
 
705
 
 
706
    memset(params, 0, sizeof(GParameter)*3);
 
707
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
708
                                    prop_names, params, 
 
709
                                    &nparams, parsed_args))
 
710
        return -1;
 
711
    pygobject_constructv(self, nparams, params);
 
712
    for (i = 0; i < nparams; ++i)
 
713
        g_value_unset(&params[i].value);
 
714
    if (!self->obj) {
 
715
        PyErr_SetString(
 
716
            PyExc_RuntimeError, 
 
717
            "could not create gimpui.ColorArea object");
 
718
        return -1;
 
719
    }
 
720
    return 0;
 
721
}
 
722
 
 
723
static PyObject *
 
724
_wrap_gimp_color_area_set_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
725
{
 
726
    static char *kwlist[] = { "color", NULL };
 
727
    PyObject *py_color;
 
728
    GimpRGB *color = NULL;
 
729
 
 
730
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorArea.set_color", kwlist, &py_color))
 
731
        return NULL;
 
732
    if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
733
        color = pyg_boxed_get(py_color, GimpRGB);
 
734
    else {
 
735
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB");
 
736
        return NULL;
 
737
    }
 
738
    
 
739
    gimp_color_area_set_color(GIMP_COLOR_AREA(self->obj), color);
 
740
    
 
741
    Py_INCREF(Py_None);
 
742
    return Py_None;
 
743
}
 
744
 
 
745
static PyObject *
 
746
_wrap_gimp_color_area_get_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
747
{
 
748
    static char *kwlist[] = { "color", NULL };
 
749
    PyObject *py_color;
 
750
    GimpRGB *color = NULL;
 
751
 
 
752
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorArea.get_color", kwlist, &py_color))
 
753
        return NULL;
 
754
    if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
755
        color = pyg_boxed_get(py_color, GimpRGB);
 
756
    else {
 
757
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB");
 
758
        return NULL;
 
759
    }
 
760
    
 
761
    gimp_color_area_get_color(GIMP_COLOR_AREA(self->obj), color);
 
762
    
 
763
    Py_INCREF(Py_None);
 
764
    return Py_None;
 
765
}
 
766
 
 
767
static PyObject *
 
768
_wrap_gimp_color_area_has_alpha(PyGObject *self)
 
769
{
 
770
    int ret;
 
771
 
 
772
    
 
773
    ret = gimp_color_area_has_alpha(GIMP_COLOR_AREA(self->obj));
 
774
    
 
775
    return PyBool_FromLong(ret);
 
776
 
 
777
}
 
778
 
 
779
static PyObject *
 
780
_wrap_gimp_color_area_set_type(PyGObject *self, PyObject *args, PyObject *kwargs)
 
781
{
 
782
    static char *kwlist[] = { "type", NULL };
 
783
    PyObject *py_type = NULL;
 
784
    GimpColorAreaType type;
 
785
 
 
786
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorArea.set_type", kwlist, &py_type))
 
787
        return NULL;
 
788
    if (pyg_enum_get_value(GIMP_TYPE_COLOR_AREA_TYPE, py_type, (gpointer)&type))
 
789
        return NULL;
 
790
    
 
791
    gimp_color_area_set_type(GIMP_COLOR_AREA(self->obj), type);
 
792
    
 
793
    Py_INCREF(Py_None);
 
794
    return Py_None;
 
795
}
 
796
 
 
797
static PyObject *
 
798
_wrap_gimp_color_area_set_draw_border(PyGObject *self, PyObject *args, PyObject *kwargs)
 
799
{
 
800
    static char *kwlist[] = { "draw_border", NULL };
 
801
    int draw_border;
 
802
 
 
803
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpColorArea.set_draw_border", kwlist, &draw_border))
 
804
        return NULL;
 
805
    
 
806
    gimp_color_area_set_draw_border(GIMP_COLOR_AREA(self->obj), draw_border);
 
807
    
 
808
    Py_INCREF(Py_None);
 
809
    return Py_None;
 
810
}
 
811
 
 
812
static const PyMethodDef _PyGimpColorArea_methods[] = {
 
813
    { "set_color", (PyCFunction)_wrap_gimp_color_area_set_color, METH_VARARGS|METH_KEYWORDS,
 
814
      NULL },
 
815
    { "get_color", (PyCFunction)_wrap_gimp_color_area_get_color, METH_VARARGS|METH_KEYWORDS,
 
816
      NULL },
 
817
    { "has_alpha", (PyCFunction)_wrap_gimp_color_area_has_alpha, METH_NOARGS,
 
818
      NULL },
 
819
    { "set_type", (PyCFunction)_wrap_gimp_color_area_set_type, METH_VARARGS|METH_KEYWORDS,
 
820
      NULL },
 
821
    { "set_draw_border", (PyCFunction)_wrap_gimp_color_area_set_draw_border, METH_VARARGS|METH_KEYWORDS,
 
822
      NULL },
 
823
    { NULL, NULL, 0, NULL }
 
824
};
 
825
 
 
826
PyTypeObject G_GNUC_INTERNAL PyGimpColorArea_Type = {
 
827
    PyObject_HEAD_INIT(NULL)
 
828
    0,                                 /* ob_size */
 
829
    "gimpui.ColorArea",                   /* tp_name */
 
830
    sizeof(PyGObject),          /* tp_basicsize */
 
831
    0,                                 /* tp_itemsize */
 
832
    /* methods */
 
833
    (destructor)0,        /* tp_dealloc */
 
834
    (printfunc)0,                      /* tp_print */
 
835
    (getattrfunc)0,       /* tp_getattr */
 
836
    (setattrfunc)0,       /* tp_setattr */
 
837
    (cmpfunc)0,           /* tp_compare */
 
838
    (reprfunc)0,             /* tp_repr */
 
839
    (PyNumberMethods*)0,     /* tp_as_number */
 
840
    (PySequenceMethods*)0, /* tp_as_sequence */
 
841
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
842
    (hashfunc)0,             /* tp_hash */
 
843
    (ternaryfunc)0,          /* tp_call */
 
844
    (reprfunc)0,              /* tp_str */
 
845
    (getattrofunc)0,     /* tp_getattro */
 
846
    (setattrofunc)0,     /* tp_setattro */
 
847
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
848
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
849
    NULL,                        /* Documentation string */
 
850
    (traverseproc)0,     /* tp_traverse */
 
851
    (inquiry)0,             /* tp_clear */
 
852
    (richcmpfunc)0,   /* tp_richcompare */
 
853
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
854
    (getiterfunc)0,          /* tp_iter */
 
855
    (iternextfunc)0,     /* tp_iternext */
 
856
    (struct PyMethodDef*)_PyGimpColorArea_methods, /* tp_methods */
 
857
    (struct PyMemberDef*)0,              /* tp_members */
 
858
    (struct PyGetSetDef*)0,  /* tp_getset */
 
859
    NULL,                              /* tp_base */
 
860
    NULL,                              /* tp_dict */
 
861
    (descrgetfunc)0,    /* tp_descr_get */
 
862
    (descrsetfunc)0,    /* tp_descr_set */
 
863
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
864
    (initproc)_wrap_gimp_color_area_new,             /* tp_init */
 
865
    (allocfunc)0,           /* tp_alloc */
 
866
    (newfunc)0,               /* tp_new */
 
867
    (freefunc)0,             /* tp_free */
 
868
    (inquiry)0              /* tp_is_gc */
 
869
};
 
870
 
 
871
 
 
872
 
 
873
/* ----------- GimpColorButton ----------- */
 
874
 
 
875
#line 905 "gimpui.override"
 
876
static int
 
877
_wrap_gimp_color_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
878
{
 
879
    gchar *title = NULL;
 
880
    gint width = -1, height = -1;
 
881
    PyObject *py_color = NULL, *py_type = NULL;
 
882
    GimpRGB *color, default_color = { 0.0, 0.0, 0.0, 100.0 };
 
883
    GimpColorAreaType type;
 
884
    
 
885
    static char *kwlist[] = { "title", "width", "height", "color", "type",
 
886
                              NULL };
 
887
 
 
888
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
889
                                     "|ziiOO:gimpui.ColorButton.__init__",
 
890
                                     kwlist,
 
891
                                     &title, &width, &height,
 
892
                                     &py_color, &py_type))
 
893
        return -1;
 
894
 
 
895
    if (py_color == NULL || (PyObject*)py_color == Py_None)
 
896
        color = &default_color;
 
897
    else if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
898
        color = pyg_boxed_get(py_color, GimpRGB);
 
899
    else {
 
900
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB or None");
 
901
        return -1;
 
902
    }
 
903
 
 
904
    if (py_type == NULL || (PyObject*)py_type == Py_None)
 
905
       type = GIMP_COLOR_AREA_FLAT;
 
906
    else if (pyg_enum_get_value(GIMP_TYPE_COLOR_AREA_TYPE, py_type, (gint*)&type))
 
907
       return -1;
 
908
 
 
909
    if (pygobject_construct(self,
 
910
                            "title", title,
 
911
                            "type", type,
 
912
                            "color", color,
 
913
                            NULL))
 
914
        return -1;
 
915
 
 
916
    gtk_widget_set_size_request(GIMP_COLOR_BUTTON(self->obj)->color_area,
 
917
                                width, height);
 
918
    return 0;
 
919
}
 
920
#line 921 "gimpui.c"
 
921
 
 
922
 
 
923
static PyObject *
 
924
_wrap_gimp_color_button_set_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
925
{
 
926
    static char *kwlist[] = { "color", NULL };
 
927
    PyObject *py_color;
 
928
    GimpRGB *color = NULL;
 
929
 
 
930
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorButton.set_color", kwlist, &py_color))
 
931
        return NULL;
 
932
    if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
933
        color = pyg_boxed_get(py_color, GimpRGB);
 
934
    else {
 
935
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB");
 
936
        return NULL;
 
937
    }
 
938
    
 
939
    gimp_color_button_set_color(GIMP_COLOR_BUTTON(self->obj), color);
 
940
    
 
941
    Py_INCREF(Py_None);
 
942
    return Py_None;
 
943
}
 
944
 
 
945
#line 867 "gimpui.override"
 
946
static PyObject *
 
947
_wrap_gimp_color_button_get_color(PyGObject *self)
 
948
{
 
949
    GimpRGB rgb;
 
950
 
 
951
    gimp_color_button_get_color(GIMP_COLOR_BUTTON(self->obj), &rgb);
 
952
 
 
953
    return pygimp_rgb_new(&rgb);
 
954
}
 
955
#line 956 "gimpui.c"
 
956
 
 
957
 
 
958
static PyObject *
 
959
_wrap_gimp_color_button_has_alpha(PyGObject *self)
 
960
{
 
961
    int ret;
 
962
 
 
963
    
 
964
    ret = gimp_color_button_has_alpha(GIMP_COLOR_BUTTON(self->obj));
 
965
    
 
966
    return PyBool_FromLong(ret);
 
967
 
 
968
}
 
969
 
 
970
static PyObject *
 
971
_wrap_gimp_color_button_set_type(PyGObject *self, PyObject *args, PyObject *kwargs)
 
972
{
 
973
    static char *kwlist[] = { "type", NULL };
 
974
    PyObject *py_type = NULL;
 
975
    GimpColorAreaType type;
 
976
 
 
977
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorButton.set_type", kwlist, &py_type))
 
978
        return NULL;
 
979
    if (pyg_enum_get_value(GIMP_TYPE_COLOR_AREA_TYPE, py_type, (gpointer)&type))
 
980
        return NULL;
 
981
    
 
982
    gimp_color_button_set_type(GIMP_COLOR_BUTTON(self->obj), type);
 
983
    
 
984
    Py_INCREF(Py_None);
 
985
    return Py_None;
 
986
}
 
987
 
 
988
static PyObject *
 
989
_wrap_gimp_color_button_get_update(PyGObject *self)
 
990
{
 
991
    int ret;
 
992
 
 
993
    
 
994
    ret = gimp_color_button_get_update(GIMP_COLOR_BUTTON(self->obj));
 
995
    
 
996
    return PyBool_FromLong(ret);
 
997
 
 
998
}
 
999
 
 
1000
static PyObject *
 
1001
_wrap_gimp_color_button_set_update(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1002
{
 
1003
    static char *kwlist[] = { "continuous", NULL };
 
1004
    int continuous;
 
1005
 
 
1006
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpColorButton.set_update", kwlist, &continuous))
 
1007
        return NULL;
 
1008
    
 
1009
    gimp_color_button_set_update(GIMP_COLOR_BUTTON(self->obj), continuous);
 
1010
    
 
1011
    Py_INCREF(Py_None);
 
1012
    return Py_None;
 
1013
}
 
1014
 
 
1015
static const PyMethodDef _PyGimpColorButton_methods[] = {
 
1016
    { "set_color", (PyCFunction)_wrap_gimp_color_button_set_color, METH_VARARGS|METH_KEYWORDS,
 
1017
      NULL },
 
1018
    { "get_color", (PyCFunction)_wrap_gimp_color_button_get_color, METH_NOARGS,
 
1019
      NULL },
 
1020
    { "has_alpha", (PyCFunction)_wrap_gimp_color_button_has_alpha, METH_NOARGS,
 
1021
      NULL },
 
1022
    { "set_type", (PyCFunction)_wrap_gimp_color_button_set_type, METH_VARARGS|METH_KEYWORDS,
 
1023
      NULL },
 
1024
    { "get_update", (PyCFunction)_wrap_gimp_color_button_get_update, METH_NOARGS,
 
1025
      NULL },
 
1026
    { "set_update", (PyCFunction)_wrap_gimp_color_button_set_update, METH_VARARGS|METH_KEYWORDS,
 
1027
      NULL },
 
1028
    { NULL, NULL, 0, NULL }
 
1029
};
 
1030
 
 
1031
PyTypeObject G_GNUC_INTERNAL PyGimpColorButton_Type = {
 
1032
    PyObject_HEAD_INIT(NULL)
 
1033
    0,                                 /* ob_size */
 
1034
    "gimpui.ColorButton",                   /* tp_name */
 
1035
    sizeof(PyGObject),          /* tp_basicsize */
 
1036
    0,                                 /* tp_itemsize */
 
1037
    /* methods */
 
1038
    (destructor)0,        /* tp_dealloc */
 
1039
    (printfunc)0,                      /* tp_print */
 
1040
    (getattrfunc)0,       /* tp_getattr */
 
1041
    (setattrfunc)0,       /* tp_setattr */
 
1042
    (cmpfunc)0,           /* tp_compare */
 
1043
    (reprfunc)0,             /* tp_repr */
 
1044
    (PyNumberMethods*)0,     /* tp_as_number */
 
1045
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1046
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1047
    (hashfunc)0,             /* tp_hash */
 
1048
    (ternaryfunc)0,          /* tp_call */
 
1049
    (reprfunc)0,              /* tp_str */
 
1050
    (getattrofunc)0,     /* tp_getattro */
 
1051
    (setattrofunc)0,     /* tp_setattro */
 
1052
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1053
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1054
    NULL,                        /* Documentation string */
 
1055
    (traverseproc)0,     /* tp_traverse */
 
1056
    (inquiry)0,             /* tp_clear */
 
1057
    (richcmpfunc)0,   /* tp_richcompare */
 
1058
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1059
    (getiterfunc)0,          /* tp_iter */
 
1060
    (iternextfunc)0,     /* tp_iternext */
 
1061
    (struct PyMethodDef*)_PyGimpColorButton_methods, /* tp_methods */
 
1062
    (struct PyMemberDef*)0,              /* tp_members */
 
1063
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1064
    NULL,                              /* tp_base */
 
1065
    NULL,                              /* tp_dict */
 
1066
    (descrgetfunc)0,    /* tp_descr_get */
 
1067
    (descrsetfunc)0,    /* tp_descr_set */
 
1068
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1069
    (initproc)_wrap_gimp_color_button_new,             /* tp_init */
 
1070
    (allocfunc)0,           /* tp_alloc */
 
1071
    (newfunc)0,               /* tp_new */
 
1072
    (freefunc)0,             /* tp_free */
 
1073
    (inquiry)0              /* tp_is_gc */
 
1074
};
 
1075
 
 
1076
 
 
1077
 
 
1078
/* ----------- GimpColorDisplay ----------- */
 
1079
 
 
1080
static int
 
1081
_wrap_gimp_color_display_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1082
{
 
1083
    static char *kwlist[] = { "display_type", NULL };
 
1084
    PyObject *py_display_type = NULL;
 
1085
    GType display_type;
 
1086
 
 
1087
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorDisplay.__init__", kwlist, &py_display_type))
 
1088
        return -1;
 
1089
    if ((display_type = pyg_type_from_object(py_display_type)) == 0)
 
1090
        return -1;
 
1091
    self->obj = (GObject *)gimp_color_display_new(display_type);
 
1092
 
 
1093
    if (!self->obj) {
 
1094
        PyErr_SetString(PyExc_RuntimeError, "could not create GimpColorDisplay object");
 
1095
        return -1;
 
1096
    }
 
1097
    pygobject_register_wrapper((PyObject *)self);
 
1098
    return 0;
 
1099
}
 
1100
 
 
1101
static PyObject *
 
1102
_wrap_gimp_color_display_clone(PyGObject *self)
 
1103
{
 
1104
    GimpColorDisplay *ret;
 
1105
 
 
1106
    
 
1107
    ret = gimp_color_display_clone(GIMP_COLOR_DISPLAY(self->obj));
 
1108
    
 
1109
    /* pygobject_new handles NULL checking */
 
1110
    return pygobject_new((GObject *)ret);
 
1111
}
 
1112
 
 
1113
static PyObject *
 
1114
_wrap_gimp_color_display_convert(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1115
{
 
1116
    static char *kwlist[] = { "buf", "width", "height", "bpp", "bpl", NULL };
 
1117
    int buf_len, width, height, bpp, bpl;
 
1118
    guchar *buf;
 
1119
 
 
1120
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s#iiii:GimpColorDisplay.convert", kwlist, &buf, &buf_len, &width, &height, &bpp, &bpl))
 
1121
        return NULL;
 
1122
    
 
1123
    gimp_color_display_convert(GIMP_COLOR_DISPLAY(self->obj), buf, width, height, bpp, bpl);
 
1124
    
 
1125
    Py_INCREF(Py_None);
 
1126
    return Py_None;
 
1127
}
 
1128
 
 
1129
static PyObject *
 
1130
_wrap_gimp_color_display_configure(PyGObject *self)
 
1131
{
 
1132
    GtkWidget *ret;
 
1133
 
 
1134
    
 
1135
    ret = gimp_color_display_configure(GIMP_COLOR_DISPLAY(self->obj));
 
1136
    
 
1137
    /* pygobject_new handles NULL checking */
 
1138
    return pygobject_new((GObject *)ret);
 
1139
}
 
1140
 
 
1141
static PyObject *
 
1142
_wrap_gimp_color_display_configure_reset(PyGObject *self)
 
1143
{
 
1144
    
 
1145
    gimp_color_display_configure_reset(GIMP_COLOR_DISPLAY(self->obj));
 
1146
    
 
1147
    Py_INCREF(Py_None);
 
1148
    return Py_None;
 
1149
}
 
1150
 
 
1151
static PyObject *
 
1152
_wrap_gimp_color_display_changed(PyGObject *self)
 
1153
{
 
1154
    
 
1155
    gimp_color_display_changed(GIMP_COLOR_DISPLAY(self->obj));
 
1156
    
 
1157
    Py_INCREF(Py_None);
 
1158
    return Py_None;
 
1159
}
 
1160
 
 
1161
static PyObject *
 
1162
_wrap_gimp_color_display_set_enabled(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1163
{
 
1164
    static char *kwlist[] = { "enabled", NULL };
 
1165
    int enabled;
 
1166
 
 
1167
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpColorDisplay.set_enabled", kwlist, &enabled))
 
1168
        return NULL;
 
1169
    
 
1170
    gimp_color_display_set_enabled(GIMP_COLOR_DISPLAY(self->obj), enabled);
 
1171
    
 
1172
    Py_INCREF(Py_None);
 
1173
    return Py_None;
 
1174
}
 
1175
 
 
1176
static PyObject *
 
1177
_wrap_gimp_color_display_get_enabled(PyGObject *self)
 
1178
{
 
1179
    int ret;
 
1180
 
 
1181
    
 
1182
    ret = gimp_color_display_get_enabled(GIMP_COLOR_DISPLAY(self->obj));
 
1183
    
 
1184
    return PyBool_FromLong(ret);
 
1185
 
 
1186
}
 
1187
 
 
1188
static const PyMethodDef _PyGimpColorDisplay_methods[] = {
 
1189
    { "clone", (PyCFunction)_wrap_gimp_color_display_clone, METH_NOARGS,
 
1190
      NULL },
 
1191
    { "convert", (PyCFunction)_wrap_gimp_color_display_convert, METH_VARARGS|METH_KEYWORDS,
 
1192
      NULL },
 
1193
    { "configure", (PyCFunction)_wrap_gimp_color_display_configure, METH_NOARGS,
 
1194
      NULL },
 
1195
    { "configure_reset", (PyCFunction)_wrap_gimp_color_display_configure_reset, METH_NOARGS,
 
1196
      NULL },
 
1197
    { "changed", (PyCFunction)_wrap_gimp_color_display_changed, METH_NOARGS,
 
1198
      NULL },
 
1199
    { "set_enabled", (PyCFunction)_wrap_gimp_color_display_set_enabled, METH_VARARGS|METH_KEYWORDS,
 
1200
      NULL },
 
1201
    { "get_enabled", (PyCFunction)_wrap_gimp_color_display_get_enabled, METH_NOARGS,
 
1202
      NULL },
 
1203
    { NULL, NULL, 0, NULL }
 
1204
};
 
1205
 
 
1206
PyTypeObject G_GNUC_INTERNAL PyGimpColorDisplay_Type = {
 
1207
    PyObject_HEAD_INIT(NULL)
 
1208
    0,                                 /* ob_size */
 
1209
    "gimpui.ColorDisplay",                   /* tp_name */
 
1210
    sizeof(PyGObject),          /* tp_basicsize */
 
1211
    0,                                 /* tp_itemsize */
 
1212
    /* methods */
 
1213
    (destructor)0,        /* tp_dealloc */
 
1214
    (printfunc)0,                      /* tp_print */
 
1215
    (getattrfunc)0,       /* tp_getattr */
 
1216
    (setattrfunc)0,       /* tp_setattr */
 
1217
    (cmpfunc)0,           /* tp_compare */
 
1218
    (reprfunc)0,             /* tp_repr */
 
1219
    (PyNumberMethods*)0,     /* tp_as_number */
 
1220
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1221
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1222
    (hashfunc)0,             /* tp_hash */
 
1223
    (ternaryfunc)0,          /* tp_call */
 
1224
    (reprfunc)0,              /* tp_str */
 
1225
    (getattrofunc)0,     /* tp_getattro */
 
1226
    (setattrofunc)0,     /* tp_setattro */
 
1227
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1228
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1229
    NULL,                        /* Documentation string */
 
1230
    (traverseproc)0,     /* tp_traverse */
 
1231
    (inquiry)0,             /* tp_clear */
 
1232
    (richcmpfunc)0,   /* tp_richcompare */
 
1233
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1234
    (getiterfunc)0,          /* tp_iter */
 
1235
    (iternextfunc)0,     /* tp_iternext */
 
1236
    (struct PyMethodDef*)_PyGimpColorDisplay_methods, /* tp_methods */
 
1237
    (struct PyMemberDef*)0,              /* tp_members */
 
1238
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1239
    NULL,                              /* tp_base */
 
1240
    NULL,                              /* tp_dict */
 
1241
    (descrgetfunc)0,    /* tp_descr_get */
 
1242
    (descrsetfunc)0,    /* tp_descr_set */
 
1243
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1244
    (initproc)_wrap_gimp_color_display_new,             /* tp_init */
 
1245
    (allocfunc)0,           /* tp_alloc */
 
1246
    (newfunc)0,               /* tp_new */
 
1247
    (freefunc)0,             /* tp_free */
 
1248
    (inquiry)0              /* tp_is_gc */
 
1249
};
 
1250
 
 
1251
 
 
1252
 
 
1253
/* ----------- GimpColorDisplayStack ----------- */
 
1254
 
 
1255
 static int
 
1256
_wrap_gimp_color_display_stack_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1257
{
 
1258
    static char* kwlist[] = { NULL };
 
1259
 
 
1260
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
1261
                                     ":gimpui.ColorDisplayStack.__init__",
 
1262
                                     kwlist))
 
1263
        return -1;
 
1264
 
 
1265
    pygobject_constructv(self, 0, NULL);
 
1266
    if (!self->obj) {
 
1267
        PyErr_SetString(
 
1268
            PyExc_RuntimeError, 
 
1269
            "could not create gimpui.ColorDisplayStack object");
 
1270
        return -1;
 
1271
    }
 
1272
    return 0;
 
1273
}
 
1274
 
 
1275
static PyObject *
 
1276
_wrap_gimp_color_display_stack_clone(PyGObject *self)
 
1277
{
 
1278
    GimpColorDisplayStack *ret;
 
1279
 
 
1280
    
 
1281
    ret = gimp_color_display_stack_clone(GIMP_COLOR_DISPLAY_STACK(self->obj));
 
1282
    
 
1283
    /* pygobject_new handles NULL checking */
 
1284
    return pygobject_new((GObject *)ret);
 
1285
}
 
1286
 
 
1287
static PyObject *
 
1288
_wrap_gimp_color_display_stack_changed(PyGObject *self)
 
1289
{
 
1290
    
 
1291
    gimp_color_display_stack_changed(GIMP_COLOR_DISPLAY_STACK(self->obj));
 
1292
    
 
1293
    Py_INCREF(Py_None);
 
1294
    return Py_None;
 
1295
}
 
1296
 
 
1297
static PyObject *
 
1298
_wrap_gimp_color_display_stack_add(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1299
{
 
1300
    static char *kwlist[] = { "display", NULL };
 
1301
    PyGObject *display;
 
1302
 
 
1303
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:GimpColorDisplayStack.add", kwlist, &PyGimpColorDisplay_Type, &display))
 
1304
        return NULL;
 
1305
    
 
1306
    gimp_color_display_stack_add(GIMP_COLOR_DISPLAY_STACK(self->obj), GIMP_COLOR_DISPLAY(display->obj));
 
1307
    
 
1308
    Py_INCREF(Py_None);
 
1309
    return Py_None;
 
1310
}
 
1311
 
 
1312
static PyObject *
 
1313
_wrap_gimp_color_display_stack_remove(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1314
{
 
1315
    static char *kwlist[] = { "display", NULL };
 
1316
    PyGObject *display;
 
1317
 
 
1318
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:GimpColorDisplayStack.remove", kwlist, &PyGimpColorDisplay_Type, &display))
 
1319
        return NULL;
 
1320
    
 
1321
    gimp_color_display_stack_remove(GIMP_COLOR_DISPLAY_STACK(self->obj), GIMP_COLOR_DISPLAY(display->obj));
 
1322
    
 
1323
    Py_INCREF(Py_None);
 
1324
    return Py_None;
 
1325
}
 
1326
 
 
1327
static PyObject *
 
1328
_wrap_gimp_color_display_stack_reorder_up(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1329
{
 
1330
    static char *kwlist[] = { "display", NULL };
 
1331
    PyGObject *display;
 
1332
 
 
1333
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:GimpColorDisplayStack.reorder_up", kwlist, &PyGimpColorDisplay_Type, &display))
 
1334
        return NULL;
 
1335
    
 
1336
    gimp_color_display_stack_reorder_up(GIMP_COLOR_DISPLAY_STACK(self->obj), GIMP_COLOR_DISPLAY(display->obj));
 
1337
    
 
1338
    Py_INCREF(Py_None);
 
1339
    return Py_None;
 
1340
}
 
1341
 
 
1342
static PyObject *
 
1343
_wrap_gimp_color_display_stack_reorder_down(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1344
{
 
1345
    static char *kwlist[] = { "display", NULL };
 
1346
    PyGObject *display;
 
1347
 
 
1348
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:GimpColorDisplayStack.reorder_down", kwlist, &PyGimpColorDisplay_Type, &display))
 
1349
        return NULL;
 
1350
    
 
1351
    gimp_color_display_stack_reorder_down(GIMP_COLOR_DISPLAY_STACK(self->obj), GIMP_COLOR_DISPLAY(display->obj));
 
1352
    
 
1353
    Py_INCREF(Py_None);
 
1354
    return Py_None;
 
1355
}
 
1356
 
 
1357
static PyObject *
 
1358
_wrap_gimp_color_display_stack_convert(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1359
{
 
1360
    static char *kwlist[] = { "buf", "width", "height", "bpp", "bpl", NULL };
 
1361
    int buf_len, width, height, bpp, bpl;
 
1362
    guchar *buf;
 
1363
 
 
1364
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s#iiii:GimpColorDisplayStack.convert", kwlist, &buf, &buf_len, &width, &height, &bpp, &bpl))
 
1365
        return NULL;
 
1366
    
 
1367
    gimp_color_display_stack_convert(GIMP_COLOR_DISPLAY_STACK(self->obj), buf, width, height, bpp, bpl);
 
1368
    
 
1369
    Py_INCREF(Py_None);
 
1370
    return Py_None;
 
1371
}
 
1372
 
 
1373
static const PyMethodDef _PyGimpColorDisplayStack_methods[] = {
 
1374
    { "clone", (PyCFunction)_wrap_gimp_color_display_stack_clone, METH_NOARGS,
 
1375
      NULL },
 
1376
    { "changed", (PyCFunction)_wrap_gimp_color_display_stack_changed, METH_NOARGS,
 
1377
      NULL },
 
1378
    { "add", (PyCFunction)_wrap_gimp_color_display_stack_add, METH_VARARGS|METH_KEYWORDS,
 
1379
      NULL },
 
1380
    { "remove", (PyCFunction)_wrap_gimp_color_display_stack_remove, METH_VARARGS|METH_KEYWORDS,
 
1381
      NULL },
 
1382
    { "reorder_up", (PyCFunction)_wrap_gimp_color_display_stack_reorder_up, METH_VARARGS|METH_KEYWORDS,
 
1383
      NULL },
 
1384
    { "reorder_down", (PyCFunction)_wrap_gimp_color_display_stack_reorder_down, METH_VARARGS|METH_KEYWORDS,
 
1385
      NULL },
 
1386
    { "convert", (PyCFunction)_wrap_gimp_color_display_stack_convert, METH_VARARGS|METH_KEYWORDS,
 
1387
      NULL },
 
1388
    { NULL, NULL, 0, NULL }
 
1389
};
 
1390
 
 
1391
PyTypeObject G_GNUC_INTERNAL PyGimpColorDisplayStack_Type = {
 
1392
    PyObject_HEAD_INIT(NULL)
 
1393
    0,                                 /* ob_size */
 
1394
    "gimpui.ColorDisplayStack",                   /* tp_name */
 
1395
    sizeof(PyGObject),          /* tp_basicsize */
 
1396
    0,                                 /* tp_itemsize */
 
1397
    /* methods */
 
1398
    (destructor)0,        /* tp_dealloc */
 
1399
    (printfunc)0,                      /* tp_print */
 
1400
    (getattrfunc)0,       /* tp_getattr */
 
1401
    (setattrfunc)0,       /* tp_setattr */
 
1402
    (cmpfunc)0,           /* tp_compare */
 
1403
    (reprfunc)0,             /* tp_repr */
 
1404
    (PyNumberMethods*)0,     /* tp_as_number */
 
1405
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1406
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1407
    (hashfunc)0,             /* tp_hash */
 
1408
    (ternaryfunc)0,          /* tp_call */
 
1409
    (reprfunc)0,              /* tp_str */
 
1410
    (getattrofunc)0,     /* tp_getattro */
 
1411
    (setattrofunc)0,     /* tp_setattro */
 
1412
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1413
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1414
    NULL,                        /* Documentation string */
 
1415
    (traverseproc)0,     /* tp_traverse */
 
1416
    (inquiry)0,             /* tp_clear */
 
1417
    (richcmpfunc)0,   /* tp_richcompare */
 
1418
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1419
    (getiterfunc)0,          /* tp_iter */
 
1420
    (iternextfunc)0,     /* tp_iternext */
 
1421
    (struct PyMethodDef*)_PyGimpColorDisplayStack_methods, /* tp_methods */
 
1422
    (struct PyMemberDef*)0,              /* tp_members */
 
1423
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1424
    NULL,                              /* tp_base */
 
1425
    NULL,                              /* tp_dict */
 
1426
    (descrgetfunc)0,    /* tp_descr_get */
 
1427
    (descrsetfunc)0,    /* tp_descr_set */
 
1428
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1429
    (initproc)_wrap_gimp_color_display_stack_new,             /* tp_init */
 
1430
    (allocfunc)0,           /* tp_alloc */
 
1431
    (newfunc)0,               /* tp_new */
 
1432
    (freefunc)0,             /* tp_free */
 
1433
    (inquiry)0              /* tp_is_gc */
 
1434
};
 
1435
 
 
1436
 
 
1437
 
 
1438
/* ----------- GimpColorHexEntry ----------- */
 
1439
 
 
1440
static int
 
1441
_wrap_gimp_color_hex_entry_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1442
{
 
1443
    static char* kwlist[] = { NULL };
 
1444
 
 
1445
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
1446
                                     ":gimpui.ColorHexEntry.__init__",
 
1447
                                     kwlist))
 
1448
        return -1;
 
1449
 
 
1450
    pygobject_constructv(self, 0, NULL);
 
1451
    if (!self->obj) {
 
1452
        PyErr_SetString(
 
1453
            PyExc_RuntimeError, 
 
1454
            "could not create gimpui.ColorHexEntry object");
 
1455
        return -1;
 
1456
    }
 
1457
    return 0;
 
1458
}
 
1459
 
 
1460
static PyObject *
 
1461
_wrap_gimp_color_hex_entry_set_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1462
{
 
1463
    static char *kwlist[] = { "color", NULL };
 
1464
    PyObject *py_color;
 
1465
    GimpRGB *color = NULL;
 
1466
 
 
1467
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorHexEntry.set_color", kwlist, &py_color))
 
1468
        return NULL;
 
1469
    if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
1470
        color = pyg_boxed_get(py_color, GimpRGB);
 
1471
    else {
 
1472
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB");
 
1473
        return NULL;
 
1474
    }
 
1475
    
 
1476
    gimp_color_hex_entry_set_color(GIMP_COLOR_HEX_ENTRY(self->obj), color);
 
1477
    
 
1478
    Py_INCREF(Py_None);
 
1479
    return Py_None;
 
1480
}
 
1481
 
 
1482
static PyObject *
 
1483
_wrap_gimp_color_hex_entry_get_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1484
{
 
1485
    static char *kwlist[] = { "color", NULL };
 
1486
    PyObject *py_color;
 
1487
    GimpRGB *color = NULL;
 
1488
 
 
1489
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorHexEntry.get_color", kwlist, &py_color))
 
1490
        return NULL;
 
1491
    if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
1492
        color = pyg_boxed_get(py_color, GimpRGB);
 
1493
    else {
 
1494
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB");
 
1495
        return NULL;
 
1496
    }
 
1497
    
 
1498
    gimp_color_hex_entry_get_color(GIMP_COLOR_HEX_ENTRY(self->obj), color);
 
1499
    
 
1500
    Py_INCREF(Py_None);
 
1501
    return Py_None;
 
1502
}
 
1503
 
 
1504
static const PyMethodDef _PyGimpColorHexEntry_methods[] = {
 
1505
    { "set_color", (PyCFunction)_wrap_gimp_color_hex_entry_set_color, METH_VARARGS|METH_KEYWORDS,
 
1506
      NULL },
 
1507
    { "get_color", (PyCFunction)_wrap_gimp_color_hex_entry_get_color, METH_VARARGS|METH_KEYWORDS,
 
1508
      NULL },
 
1509
    { NULL, NULL, 0, NULL }
 
1510
};
 
1511
 
 
1512
PyTypeObject G_GNUC_INTERNAL PyGimpColorHexEntry_Type = {
 
1513
    PyObject_HEAD_INIT(NULL)
 
1514
    0,                                 /* ob_size */
 
1515
    "gimpui.ColorHexEntry",                   /* tp_name */
 
1516
    sizeof(PyGObject),          /* tp_basicsize */
 
1517
    0,                                 /* tp_itemsize */
 
1518
    /* methods */
 
1519
    (destructor)0,        /* tp_dealloc */
 
1520
    (printfunc)0,                      /* tp_print */
 
1521
    (getattrfunc)0,       /* tp_getattr */
 
1522
    (setattrfunc)0,       /* tp_setattr */
 
1523
    (cmpfunc)0,           /* tp_compare */
 
1524
    (reprfunc)0,             /* tp_repr */
 
1525
    (PyNumberMethods*)0,     /* tp_as_number */
 
1526
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1527
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1528
    (hashfunc)0,             /* tp_hash */
 
1529
    (ternaryfunc)0,          /* tp_call */
 
1530
    (reprfunc)0,              /* tp_str */
 
1531
    (getattrofunc)0,     /* tp_getattro */
 
1532
    (setattrofunc)0,     /* tp_setattro */
 
1533
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1534
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1535
    NULL,                        /* Documentation string */
 
1536
    (traverseproc)0,     /* tp_traverse */
 
1537
    (inquiry)0,             /* tp_clear */
 
1538
    (richcmpfunc)0,   /* tp_richcompare */
 
1539
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1540
    (getiterfunc)0,          /* tp_iter */
 
1541
    (iternextfunc)0,     /* tp_iternext */
 
1542
    (struct PyMethodDef*)_PyGimpColorHexEntry_methods, /* tp_methods */
 
1543
    (struct PyMemberDef*)0,              /* tp_members */
 
1544
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1545
    NULL,                              /* tp_base */
 
1546
    NULL,                              /* tp_dict */
 
1547
    (descrgetfunc)0,    /* tp_descr_get */
 
1548
    (descrsetfunc)0,    /* tp_descr_set */
 
1549
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1550
    (initproc)_wrap_gimp_color_hex_entry_new,             /* tp_init */
 
1551
    (allocfunc)0,           /* tp_alloc */
 
1552
    (newfunc)0,               /* tp_new */
 
1553
    (freefunc)0,             /* tp_free */
 
1554
    (inquiry)0              /* tp_is_gc */
 
1555
};
 
1556
 
 
1557
 
 
1558
 
 
1559
/* ----------- GimpColorScale ----------- */
 
1560
 
 
1561
#line 953 "gimpui.override"
 
1562
static int
 
1563
_wrap_gimp_color_scale_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1564
{
 
1565
    PyObject *py_orientation, *py_channel;
 
1566
    GtkOrientation orientation;
 
1567
    GimpColorSelectorChannel channel;
 
1568
    GimpColorScale *scale;
 
1569
    GtkRange *range;
 
1570
 
 
1571
    static char *kwlist[] = { "orientation", "channel", NULL };
 
1572
 
 
1573
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
1574
                                     "OO:gimpui.ColorScale.__init__",
 
1575
                                     kwlist,
 
1576
                                     &py_orientation, &py_channel))
 
1577
        return -1;
 
1578
 
 
1579
    if (pyg_enum_get_value(GTK_TYPE_ORIENTATION, py_orientation,
 
1580
                           (gint*)&orientation))
 
1581
        return -1;
 
1582
 
 
1583
    if (pyg_enum_get_value(GIMP_TYPE_COLOR_SELECTOR_CHANNEL, py_channel, 
 
1584
                           (gint*)&channel))
 
1585
        return -1;
 
1586
 
 
1587
    if (pygobject_construct(self, NULL))
 
1588
        return -1;
 
1589
 
 
1590
    scale = GIMP_COLOR_SCALE(self->obj);
 
1591
    scale->channel = channel;
 
1592
 
 
1593
    range = GTK_RANGE(scale);
 
1594
    range->orientation = orientation;
 
1595
    range->flippable   = (orientation == GTK_ORIENTATION_HORIZONTAL);
 
1596
    
 
1597
    return 0;
 
1598
}
 
1599
#line 1600 "gimpui.c"
 
1600
 
 
1601
 
 
1602
static PyObject *
 
1603
_wrap_gimp_color_scale_set_channel(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1604
{
 
1605
    static char *kwlist[] = { "channel", NULL };
 
1606
    GimpColorSelectorChannel channel;
 
1607
    PyObject *py_channel = NULL;
 
1608
 
 
1609
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorScale.set_channel", kwlist, &py_channel))
 
1610
        return NULL;
 
1611
    if (pyg_enum_get_value(GIMP_TYPE_COLOR_SELECTOR_CHANNEL, py_channel, (gpointer)&channel))
 
1612
        return NULL;
 
1613
    
 
1614
    gimp_color_scale_set_channel(GIMP_COLOR_SCALE(self->obj), channel);
 
1615
    
 
1616
    Py_INCREF(Py_None);
 
1617
    return Py_None;
 
1618
}
 
1619
 
 
1620
static PyObject *
 
1621
_wrap_gimp_color_scale_set_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1622
{
 
1623
    static char *kwlist[] = { "rgb", "hsv", NULL };
 
1624
    PyObject *py_rgb, *py_hsv;
 
1625
    GimpHSV *hsv = NULL;
 
1626
    GimpRGB *rgb = NULL;
 
1627
 
 
1628
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"OO:GimpColorScale.set_color", kwlist, &py_rgb, &py_hsv))
 
1629
        return NULL;
 
1630
    if (pyg_boxed_check(py_rgb, GIMP_TYPE_RGB))
 
1631
        rgb = pyg_boxed_get(py_rgb, GimpRGB);
 
1632
    else {
 
1633
        PyErr_SetString(PyExc_TypeError, "rgb should be a GimpRGB");
 
1634
        return NULL;
 
1635
    }
 
1636
    if (pyg_boxed_check(py_hsv, GIMP_TYPE_HSV))
 
1637
        hsv = pyg_boxed_get(py_hsv, GimpHSV);
 
1638
    else {
 
1639
        PyErr_SetString(PyExc_TypeError, "hsv should be a GimpHSV");
 
1640
        return NULL;
 
1641
    }
 
1642
    
 
1643
    gimp_color_scale_set_color(GIMP_COLOR_SCALE(self->obj), rgb, hsv);
 
1644
    
 
1645
    Py_INCREF(Py_None);
 
1646
    return Py_None;
 
1647
}
 
1648
 
 
1649
static const PyMethodDef _PyGimpColorScale_methods[] = {
 
1650
    { "set_channel", (PyCFunction)_wrap_gimp_color_scale_set_channel, METH_VARARGS|METH_KEYWORDS,
 
1651
      NULL },
 
1652
    { "set_color", (PyCFunction)_wrap_gimp_color_scale_set_color, METH_VARARGS|METH_KEYWORDS,
 
1653
      NULL },
 
1654
    { NULL, NULL, 0, NULL }
 
1655
};
 
1656
 
 
1657
PyTypeObject G_GNUC_INTERNAL PyGimpColorScale_Type = {
 
1658
    PyObject_HEAD_INIT(NULL)
 
1659
    0,                                 /* ob_size */
 
1660
    "gimpui.ColorScale",                   /* tp_name */
 
1661
    sizeof(PyGObject),          /* tp_basicsize */
 
1662
    0,                                 /* tp_itemsize */
 
1663
    /* methods */
 
1664
    (destructor)0,        /* tp_dealloc */
 
1665
    (printfunc)0,                      /* tp_print */
 
1666
    (getattrfunc)0,       /* tp_getattr */
 
1667
    (setattrfunc)0,       /* tp_setattr */
 
1668
    (cmpfunc)0,           /* tp_compare */
 
1669
    (reprfunc)0,             /* tp_repr */
 
1670
    (PyNumberMethods*)0,     /* tp_as_number */
 
1671
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1672
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1673
    (hashfunc)0,             /* tp_hash */
 
1674
    (ternaryfunc)0,          /* tp_call */
 
1675
    (reprfunc)0,              /* tp_str */
 
1676
    (getattrofunc)0,     /* tp_getattro */
 
1677
    (setattrofunc)0,     /* tp_setattro */
 
1678
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1679
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1680
    NULL,                        /* Documentation string */
 
1681
    (traverseproc)0,     /* tp_traverse */
 
1682
    (inquiry)0,             /* tp_clear */
 
1683
    (richcmpfunc)0,   /* tp_richcompare */
 
1684
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1685
    (getiterfunc)0,          /* tp_iter */
 
1686
    (iternextfunc)0,     /* tp_iternext */
 
1687
    (struct PyMethodDef*)_PyGimpColorScale_methods, /* tp_methods */
 
1688
    (struct PyMemberDef*)0,              /* tp_members */
 
1689
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1690
    NULL,                              /* tp_base */
 
1691
    NULL,                              /* tp_dict */
 
1692
    (descrgetfunc)0,    /* tp_descr_get */
 
1693
    (descrsetfunc)0,    /* tp_descr_set */
 
1694
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1695
    (initproc)_wrap_gimp_color_scale_new,             /* tp_init */
 
1696
    (allocfunc)0,           /* tp_alloc */
 
1697
    (newfunc)0,               /* tp_new */
 
1698
    (freefunc)0,             /* tp_free */
 
1699
    (inquiry)0              /* tp_is_gc */
 
1700
};
 
1701
 
 
1702
 
 
1703
 
 
1704
/* ----------- GimpColorSelection ----------- */
 
1705
 
 
1706
static int
 
1707
_wrap_gimp_color_selection_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1708
{
 
1709
    static char* kwlist[] = { NULL };
 
1710
 
 
1711
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
1712
                                     ":gimpui.ColorSelection.__init__",
 
1713
                                     kwlist))
 
1714
        return -1;
 
1715
 
 
1716
    pygobject_constructv(self, 0, NULL);
 
1717
    if (!self->obj) {
 
1718
        PyErr_SetString(
 
1719
            PyExc_RuntimeError, 
 
1720
            "could not create gimpui.ColorSelection object");
 
1721
        return -1;
 
1722
    }
 
1723
    return 0;
 
1724
}
 
1725
 
 
1726
static PyObject *
 
1727
_wrap_gimp_color_selection_set_show_alpha(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1728
{
 
1729
    static char *kwlist[] = { "show_alpha", NULL };
 
1730
    int show_alpha;
 
1731
 
 
1732
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpColorSelection.set_show_alpha", kwlist, &show_alpha))
 
1733
        return NULL;
 
1734
    
 
1735
    gimp_color_selection_set_show_alpha(GIMP_COLOR_SELECTION(self->obj), show_alpha);
 
1736
    
 
1737
    Py_INCREF(Py_None);
 
1738
    return Py_None;
 
1739
}
 
1740
 
 
1741
static PyObject *
 
1742
_wrap_gimp_color_selection_get_show_alpha(PyGObject *self)
 
1743
{
 
1744
    int ret;
 
1745
 
 
1746
    
 
1747
    ret = gimp_color_selection_get_show_alpha(GIMP_COLOR_SELECTION(self->obj));
 
1748
    
 
1749
    return PyBool_FromLong(ret);
 
1750
 
 
1751
}
 
1752
 
 
1753
static PyObject *
 
1754
_wrap_gimp_color_selection_set_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1755
{
 
1756
    static char *kwlist[] = { "color", NULL };
 
1757
    PyObject *py_color;
 
1758
    GimpRGB *color = NULL;
 
1759
 
 
1760
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorSelection.set_color", kwlist, &py_color))
 
1761
        return NULL;
 
1762
    if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
1763
        color = pyg_boxed_get(py_color, GimpRGB);
 
1764
    else {
 
1765
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB");
 
1766
        return NULL;
 
1767
    }
 
1768
    
 
1769
    gimp_color_selection_set_color(GIMP_COLOR_SELECTION(self->obj), color);
 
1770
    
 
1771
    Py_INCREF(Py_None);
 
1772
    return Py_None;
 
1773
}
 
1774
 
 
1775
static PyObject *
 
1776
_wrap_gimp_color_selection_get_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1777
{
 
1778
    static char *kwlist[] = { "color", NULL };
 
1779
    PyObject *py_color;
 
1780
    GimpRGB *color = NULL;
 
1781
 
 
1782
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorSelection.get_color", kwlist, &py_color))
 
1783
        return NULL;
 
1784
    if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
1785
        color = pyg_boxed_get(py_color, GimpRGB);
 
1786
    else {
 
1787
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB");
 
1788
        return NULL;
 
1789
    }
 
1790
    
 
1791
    gimp_color_selection_get_color(GIMP_COLOR_SELECTION(self->obj), color);
 
1792
    
 
1793
    Py_INCREF(Py_None);
 
1794
    return Py_None;
 
1795
}
 
1796
 
 
1797
static PyObject *
 
1798
_wrap_gimp_color_selection_set_old_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1799
{
 
1800
    static char *kwlist[] = { "color", NULL };
 
1801
    PyObject *py_color;
 
1802
    GimpRGB *color = NULL;
 
1803
 
 
1804
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorSelection.set_old_color", kwlist, &py_color))
 
1805
        return NULL;
 
1806
    if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
1807
        color = pyg_boxed_get(py_color, GimpRGB);
 
1808
    else {
 
1809
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB");
 
1810
        return NULL;
 
1811
    }
 
1812
    
 
1813
    gimp_color_selection_set_old_color(GIMP_COLOR_SELECTION(self->obj), color);
 
1814
    
 
1815
    Py_INCREF(Py_None);
 
1816
    return Py_None;
 
1817
}
 
1818
 
 
1819
static PyObject *
 
1820
_wrap_gimp_color_selection_get_old_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1821
{
 
1822
    static char *kwlist[] = { "color", NULL };
 
1823
    PyObject *py_color;
 
1824
    GimpRGB *color = NULL;
 
1825
 
 
1826
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorSelection.get_old_color", kwlist, &py_color))
 
1827
        return NULL;
 
1828
    if (pyg_boxed_check(py_color, GIMP_TYPE_RGB))
 
1829
        color = pyg_boxed_get(py_color, GimpRGB);
 
1830
    else {
 
1831
        PyErr_SetString(PyExc_TypeError, "color should be a GimpRGB");
 
1832
        return NULL;
 
1833
    }
 
1834
    
 
1835
    gimp_color_selection_get_old_color(GIMP_COLOR_SELECTION(self->obj), color);
 
1836
    
 
1837
    Py_INCREF(Py_None);
 
1838
    return Py_None;
 
1839
}
 
1840
 
 
1841
static PyObject *
 
1842
_wrap_gimp_color_selection_reset(PyGObject *self)
 
1843
{
 
1844
    
 
1845
    gimp_color_selection_reset(GIMP_COLOR_SELECTION(self->obj));
 
1846
    
 
1847
    Py_INCREF(Py_None);
 
1848
    return Py_None;
 
1849
}
 
1850
 
 
1851
static PyObject *
 
1852
_wrap_gimp_color_selection_color_changed(PyGObject *self)
 
1853
{
 
1854
    
 
1855
    gimp_color_selection_color_changed(GIMP_COLOR_SELECTION(self->obj));
 
1856
    
 
1857
    Py_INCREF(Py_None);
 
1858
    return Py_None;
 
1859
}
 
1860
 
 
1861
static const PyMethodDef _PyGimpColorSelection_methods[] = {
 
1862
    { "set_show_alpha", (PyCFunction)_wrap_gimp_color_selection_set_show_alpha, METH_VARARGS|METH_KEYWORDS,
 
1863
      NULL },
 
1864
    { "get_show_alpha", (PyCFunction)_wrap_gimp_color_selection_get_show_alpha, METH_NOARGS,
 
1865
      NULL },
 
1866
    { "set_color", (PyCFunction)_wrap_gimp_color_selection_set_color, METH_VARARGS|METH_KEYWORDS,
 
1867
      NULL },
 
1868
    { "get_color", (PyCFunction)_wrap_gimp_color_selection_get_color, METH_VARARGS|METH_KEYWORDS,
 
1869
      NULL },
 
1870
    { "set_old_color", (PyCFunction)_wrap_gimp_color_selection_set_old_color, METH_VARARGS|METH_KEYWORDS,
 
1871
      NULL },
 
1872
    { "get_old_color", (PyCFunction)_wrap_gimp_color_selection_get_old_color, METH_VARARGS|METH_KEYWORDS,
 
1873
      NULL },
 
1874
    { "reset", (PyCFunction)_wrap_gimp_color_selection_reset, METH_NOARGS,
 
1875
      NULL },
 
1876
    { "color_changed", (PyCFunction)_wrap_gimp_color_selection_color_changed, METH_NOARGS,
 
1877
      NULL },
 
1878
    { NULL, NULL, 0, NULL }
 
1879
};
 
1880
 
 
1881
PyTypeObject G_GNUC_INTERNAL PyGimpColorSelection_Type = {
 
1882
    PyObject_HEAD_INIT(NULL)
 
1883
    0,                                 /* ob_size */
 
1884
    "gimpui.ColorSelection",                   /* tp_name */
 
1885
    sizeof(PyGObject),          /* tp_basicsize */
 
1886
    0,                                 /* tp_itemsize */
 
1887
    /* methods */
 
1888
    (destructor)0,        /* tp_dealloc */
 
1889
    (printfunc)0,                      /* tp_print */
 
1890
    (getattrfunc)0,       /* tp_getattr */
 
1891
    (setattrfunc)0,       /* tp_setattr */
 
1892
    (cmpfunc)0,           /* tp_compare */
 
1893
    (reprfunc)0,             /* tp_repr */
 
1894
    (PyNumberMethods*)0,     /* tp_as_number */
 
1895
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1896
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1897
    (hashfunc)0,             /* tp_hash */
 
1898
    (ternaryfunc)0,          /* tp_call */
 
1899
    (reprfunc)0,              /* tp_str */
 
1900
    (getattrofunc)0,     /* tp_getattro */
 
1901
    (setattrofunc)0,     /* tp_setattro */
 
1902
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1903
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1904
    NULL,                        /* Documentation string */
 
1905
    (traverseproc)0,     /* tp_traverse */
 
1906
    (inquiry)0,             /* tp_clear */
 
1907
    (richcmpfunc)0,   /* tp_richcompare */
 
1908
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1909
    (getiterfunc)0,          /* tp_iter */
 
1910
    (iternextfunc)0,     /* tp_iternext */
 
1911
    (struct PyMethodDef*)_PyGimpColorSelection_methods, /* tp_methods */
 
1912
    (struct PyMemberDef*)0,              /* tp_members */
 
1913
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1914
    NULL,                              /* tp_base */
 
1915
    NULL,                              /* tp_dict */
 
1916
    (descrgetfunc)0,    /* tp_descr_get */
 
1917
    (descrsetfunc)0,    /* tp_descr_set */
 
1918
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1919
    (initproc)_wrap_gimp_color_selection_new,             /* tp_init */
 
1920
    (allocfunc)0,           /* tp_alloc */
 
1921
    (newfunc)0,               /* tp_new */
 
1922
    (freefunc)0,             /* tp_free */
 
1923
    (inquiry)0              /* tp_is_gc */
 
1924
};
 
1925
 
 
1926
 
 
1927
 
 
1928
/* ----------- GimpColorSelector ----------- */
 
1929
 
 
1930
static int
 
1931
_wrap_gimp_color_selector_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1932
{
 
1933
    static char *kwlist[] = { "selector_type", "rgb", "hsv", "channel", NULL };
 
1934
    PyObject *py_selector_type = NULL, *py_rgb, *py_hsv, *py_channel = NULL;
 
1935
    GimpHSV *hsv = NULL;
 
1936
    GType selector_type;
 
1937
    GimpColorSelectorChannel channel;
 
1938
    GimpRGB *rgb = NULL;
 
1939
 
 
1940
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"OOOO:GimpColorSelector.__init__", kwlist, &py_selector_type, &py_rgb, &py_hsv, &py_channel))
 
1941
        return -1;
 
1942
    if ((selector_type = pyg_type_from_object(py_selector_type)) == 0)
 
1943
        return -1;
 
1944
    if (pyg_boxed_check(py_rgb, GIMP_TYPE_RGB))
 
1945
        rgb = pyg_boxed_get(py_rgb, GimpRGB);
 
1946
    else {
 
1947
        PyErr_SetString(PyExc_TypeError, "rgb should be a GimpRGB");
 
1948
        return -1;
 
1949
    }
 
1950
    if (pyg_boxed_check(py_hsv, GIMP_TYPE_HSV))
 
1951
        hsv = pyg_boxed_get(py_hsv, GimpHSV);
 
1952
    else {
 
1953
        PyErr_SetString(PyExc_TypeError, "hsv should be a GimpHSV");
 
1954
        return -1;
 
1955
    }
 
1956
    if (pyg_enum_get_value(GIMP_TYPE_COLOR_SELECTOR_CHANNEL, py_channel, (gpointer)&channel))
 
1957
        return -1;
 
1958
    self->obj = (GObject *)gimp_color_selector_new(selector_type, rgb, hsv, channel);
 
1959
 
 
1960
    if (!self->obj) {
 
1961
        PyErr_SetString(PyExc_RuntimeError, "could not create GimpColorSelector object");
 
1962
        return -1;
 
1963
    }
 
1964
    pygobject_register_wrapper((PyObject *)self);
 
1965
    return 0;
 
1966
}
 
1967
 
 
1968
static PyObject *
 
1969
_wrap_gimp_color_selector_set_toggles_visible(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1970
{
 
1971
    static char *kwlist[] = { "visible", NULL };
 
1972
    int visible;
 
1973
 
 
1974
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpColorSelector.set_toggles_visible", kwlist, &visible))
 
1975
        return NULL;
 
1976
    
 
1977
    gimp_color_selector_set_toggles_visible(GIMP_COLOR_SELECTOR(self->obj), visible);
 
1978
    
 
1979
    Py_INCREF(Py_None);
 
1980
    return Py_None;
 
1981
}
 
1982
 
 
1983
static PyObject *
 
1984
_wrap_gimp_color_selector_set_toggles_sensitive(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1985
{
 
1986
    static char *kwlist[] = { "sensitive", NULL };
 
1987
    int sensitive;
 
1988
 
 
1989
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpColorSelector.set_toggles_sensitive", kwlist, &sensitive))
 
1990
        return NULL;
 
1991
    
 
1992
    gimp_color_selector_set_toggles_sensitive(GIMP_COLOR_SELECTOR(self->obj), sensitive);
 
1993
    
 
1994
    Py_INCREF(Py_None);
 
1995
    return Py_None;
 
1996
}
 
1997
 
 
1998
static PyObject *
 
1999
_wrap_gimp_color_selector_set_show_alpha(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2000
{
 
2001
    static char *kwlist[] = { "show_alpha", NULL };
 
2002
    int show_alpha;
 
2003
 
 
2004
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpColorSelector.set_show_alpha", kwlist, &show_alpha))
 
2005
        return NULL;
 
2006
    
 
2007
    gimp_color_selector_set_show_alpha(GIMP_COLOR_SELECTOR(self->obj), show_alpha);
 
2008
    
 
2009
    Py_INCREF(Py_None);
 
2010
    return Py_None;
 
2011
}
 
2012
 
 
2013
static PyObject *
 
2014
_wrap_gimp_color_selector_set_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2015
{
 
2016
    static char *kwlist[] = { "rgb", "hsv", NULL };
 
2017
    PyObject *py_rgb, *py_hsv;
 
2018
    GimpHSV *hsv = NULL;
 
2019
    GimpRGB *rgb = NULL;
 
2020
 
 
2021
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"OO:GimpColorSelector.set_color", kwlist, &py_rgb, &py_hsv))
 
2022
        return NULL;
 
2023
    if (pyg_boxed_check(py_rgb, GIMP_TYPE_RGB))
 
2024
        rgb = pyg_boxed_get(py_rgb, GimpRGB);
 
2025
    else {
 
2026
        PyErr_SetString(PyExc_TypeError, "rgb should be a GimpRGB");
 
2027
        return NULL;
 
2028
    }
 
2029
    if (pyg_boxed_check(py_hsv, GIMP_TYPE_HSV))
 
2030
        hsv = pyg_boxed_get(py_hsv, GimpHSV);
 
2031
    else {
 
2032
        PyErr_SetString(PyExc_TypeError, "hsv should be a GimpHSV");
 
2033
        return NULL;
 
2034
    }
 
2035
    
 
2036
    gimp_color_selector_set_color(GIMP_COLOR_SELECTOR(self->obj), rgb, hsv);
 
2037
    
 
2038
    Py_INCREF(Py_None);
 
2039
    return Py_None;
 
2040
}
 
2041
 
 
2042
static PyObject *
 
2043
_wrap_gimp_color_selector_set_channel(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2044
{
 
2045
    static char *kwlist[] = { "channel", NULL };
 
2046
    GimpColorSelectorChannel channel;
 
2047
    PyObject *py_channel = NULL;
 
2048
 
 
2049
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpColorSelector.set_channel", kwlist, &py_channel))
 
2050
        return NULL;
 
2051
    if (pyg_enum_get_value(GIMP_TYPE_COLOR_SELECTOR_CHANNEL, py_channel, (gpointer)&channel))
 
2052
        return NULL;
 
2053
    
 
2054
    gimp_color_selector_set_channel(GIMP_COLOR_SELECTOR(self->obj), channel);
 
2055
    
 
2056
    Py_INCREF(Py_None);
 
2057
    return Py_None;
 
2058
}
 
2059
 
 
2060
static PyObject *
 
2061
_wrap_gimp_color_selector_color_changed(PyGObject *self)
 
2062
{
 
2063
    
 
2064
    gimp_color_selector_color_changed(GIMP_COLOR_SELECTOR(self->obj));
 
2065
    
 
2066
    Py_INCREF(Py_None);
 
2067
    return Py_None;
 
2068
}
 
2069
 
 
2070
static PyObject *
 
2071
_wrap_gimp_color_selector_channel_changed(PyGObject *self)
 
2072
{
 
2073
    
 
2074
    gimp_color_selector_channel_changed(GIMP_COLOR_SELECTOR(self->obj));
 
2075
    
 
2076
    Py_INCREF(Py_None);
 
2077
    return Py_None;
 
2078
}
 
2079
 
 
2080
static const PyMethodDef _PyGimpColorSelector_methods[] = {
 
2081
    { "set_toggles_visible", (PyCFunction)_wrap_gimp_color_selector_set_toggles_visible, METH_VARARGS|METH_KEYWORDS,
 
2082
      NULL },
 
2083
    { "set_toggles_sensitive", (PyCFunction)_wrap_gimp_color_selector_set_toggles_sensitive, METH_VARARGS|METH_KEYWORDS,
 
2084
      NULL },
 
2085
    { "set_show_alpha", (PyCFunction)_wrap_gimp_color_selector_set_show_alpha, METH_VARARGS|METH_KEYWORDS,
 
2086
      NULL },
 
2087
    { "set_color", (PyCFunction)_wrap_gimp_color_selector_set_color, METH_VARARGS|METH_KEYWORDS,
 
2088
      NULL },
 
2089
    { "set_channel", (PyCFunction)_wrap_gimp_color_selector_set_channel, METH_VARARGS|METH_KEYWORDS,
 
2090
      NULL },
 
2091
    { "color_changed", (PyCFunction)_wrap_gimp_color_selector_color_changed, METH_NOARGS,
 
2092
      NULL },
 
2093
    { "channel_changed", (PyCFunction)_wrap_gimp_color_selector_channel_changed, METH_NOARGS,
 
2094
      NULL },
 
2095
    { NULL, NULL, 0, NULL }
 
2096
};
 
2097
 
 
2098
PyTypeObject G_GNUC_INTERNAL PyGimpColorSelector_Type = {
 
2099
    PyObject_HEAD_INIT(NULL)
 
2100
    0,                                 /* ob_size */
 
2101
    "gimpui.ColorSelector",                   /* tp_name */
 
2102
    sizeof(PyGObject),          /* tp_basicsize */
 
2103
    0,                                 /* tp_itemsize */
 
2104
    /* methods */
 
2105
    (destructor)0,        /* tp_dealloc */
 
2106
    (printfunc)0,                      /* tp_print */
 
2107
    (getattrfunc)0,       /* tp_getattr */
 
2108
    (setattrfunc)0,       /* tp_setattr */
 
2109
    (cmpfunc)0,           /* tp_compare */
 
2110
    (reprfunc)0,             /* tp_repr */
 
2111
    (PyNumberMethods*)0,     /* tp_as_number */
 
2112
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2113
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2114
    (hashfunc)0,             /* tp_hash */
 
2115
    (ternaryfunc)0,          /* tp_call */
 
2116
    (reprfunc)0,              /* tp_str */
 
2117
    (getattrofunc)0,     /* tp_getattro */
 
2118
    (setattrofunc)0,     /* tp_setattro */
 
2119
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2120
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2121
    NULL,                        /* Documentation string */
 
2122
    (traverseproc)0,     /* tp_traverse */
 
2123
    (inquiry)0,             /* tp_clear */
 
2124
    (richcmpfunc)0,   /* tp_richcompare */
 
2125
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2126
    (getiterfunc)0,          /* tp_iter */
 
2127
    (iternextfunc)0,     /* tp_iternext */
 
2128
    (struct PyMethodDef*)_PyGimpColorSelector_methods, /* tp_methods */
 
2129
    (struct PyMemberDef*)0,              /* tp_members */
 
2130
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2131
    NULL,                              /* tp_base */
 
2132
    NULL,                              /* tp_dict */
 
2133
    (descrgetfunc)0,    /* tp_descr_get */
 
2134
    (descrsetfunc)0,    /* tp_descr_set */
 
2135
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2136
    (initproc)_wrap_gimp_color_selector_new,             /* tp_init */
 
2137
    (allocfunc)0,           /* tp_alloc */
 
2138
    (newfunc)0,               /* tp_new */
 
2139
    (freefunc)0,             /* tp_free */
 
2140
    (inquiry)0              /* tp_is_gc */
 
2141
};
 
2142
 
 
2143
 
 
2144
 
 
2145
/* ----------- GimpColorNotebook ----------- */
 
2146
 
 
2147
static PyObject *
 
2148
_wrap_gimp_color_notebook_set_has_page(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2149
{
 
2150
    static char *kwlist[] = { "page_type", "has_page", NULL };
 
2151
    PyObject *py_page_type = NULL;
 
2152
    int has_page;
 
2153
    GType page_type;
 
2154
    GtkWidget *ret;
 
2155
 
 
2156
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"Oi:GimpColorNotebook.set_has_page", kwlist, &py_page_type, &has_page))
 
2157
        return NULL;
 
2158
    if ((page_type = pyg_type_from_object(py_page_type)) == 0)
 
2159
        return NULL;
 
2160
    
 
2161
    ret = gimp_color_notebook_set_has_page(GIMP_COLOR_NOTEBOOK(self->obj), page_type, has_page);
 
2162
    
 
2163
    /* pygobject_new handles NULL checking */
 
2164
    return pygobject_new((GObject *)ret);
 
2165
}
 
2166
 
 
2167
static const PyMethodDef _PyGimpColorNotebook_methods[] = {
 
2168
    { "set_has_page", (PyCFunction)_wrap_gimp_color_notebook_set_has_page, METH_VARARGS|METH_KEYWORDS,
 
2169
      NULL },
 
2170
    { NULL, NULL, 0, NULL }
 
2171
};
 
2172
 
 
2173
PyTypeObject G_GNUC_INTERNAL PyGimpColorNotebook_Type = {
 
2174
    PyObject_HEAD_INIT(NULL)
 
2175
    0,                                 /* ob_size */
 
2176
    "gimpui.ColorNotebook",                   /* tp_name */
 
2177
    sizeof(PyGObject),          /* tp_basicsize */
 
2178
    0,                                 /* tp_itemsize */
 
2179
    /* methods */
 
2180
    (destructor)0,        /* tp_dealloc */
 
2181
    (printfunc)0,                      /* tp_print */
 
2182
    (getattrfunc)0,       /* tp_getattr */
 
2183
    (setattrfunc)0,       /* tp_setattr */
 
2184
    (cmpfunc)0,           /* tp_compare */
 
2185
    (reprfunc)0,             /* tp_repr */
 
2186
    (PyNumberMethods*)0,     /* tp_as_number */
 
2187
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2188
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2189
    (hashfunc)0,             /* tp_hash */
 
2190
    (ternaryfunc)0,          /* tp_call */
 
2191
    (reprfunc)0,              /* tp_str */
 
2192
    (getattrofunc)0,     /* tp_getattro */
 
2193
    (setattrofunc)0,     /* tp_setattro */
 
2194
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2195
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2196
    NULL,                        /* Documentation string */
 
2197
    (traverseproc)0,     /* tp_traverse */
 
2198
    (inquiry)0,             /* tp_clear */
 
2199
    (richcmpfunc)0,   /* tp_richcompare */
 
2200
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2201
    (getiterfunc)0,          /* tp_iter */
 
2202
    (iternextfunc)0,     /* tp_iternext */
 
2203
    (struct PyMethodDef*)_PyGimpColorNotebook_methods, /* tp_methods */
 
2204
    (struct PyMemberDef*)0,              /* tp_members */
 
2205
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2206
    NULL,                              /* tp_base */
 
2207
    NULL,                              /* tp_dict */
 
2208
    (descrgetfunc)0,    /* tp_descr_get */
 
2209
    (descrsetfunc)0,    /* tp_descr_set */
 
2210
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2211
    (initproc)0,             /* tp_init */
 
2212
    (allocfunc)0,           /* tp_alloc */
 
2213
    (newfunc)0,               /* tp_new */
 
2214
    (freefunc)0,             /* tp_free */
 
2215
    (inquiry)0              /* tp_is_gc */
 
2216
};
 
2217
 
 
2218
 
 
2219
 
 
2220
/* ----------- GimpDialog ----------- */
 
2221
 
 
2222
#line 697 "gimpui.override"
 
2223
static void
 
2224
pygimp_help_func_marshal(const gchar *help_id, gpointer help_data)
 
2225
{
 
2226
    GObject *dialog = help_data;
 
2227
    PyObject *py_dialog, *help_func, *ret;
 
2228
 
 
2229
    py_dialog = g_object_get_data(dialog, "pygimp-dialog-pyobject");
 
2230
    help_func = g_object_get_data(dialog, "pygimp-dialog-help_func");
 
2231
 
 
2232
    ret = PyObject_CallFunction(help_func, "sO", help_id, py_dialog);
 
2233
 
 
2234
    if (ret)
 
2235
        Py_DECREF(ret);
 
2236
    else
 
2237
        PyErr_Print();
 
2238
}
 
2239
 
 
2240
static void
 
2241
pygimp_help_func_destroy(gpointer data)
 
2242
{
 
2243
    PyObject *help_func = data;
 
2244
 
 
2245
    Py_DECREF(help_func);
 
2246
}
 
2247
 
 
2248
static void
 
2249
pygimp_dialog_close(GtkWidget *widget)
 
2250
{
 
2251
    /* Synthesize delete_event to close dialog. */
 
2252
 
 
2253
    if (widget->window) {
 
2254
        GdkEvent *event = gdk_event_new(GDK_DELETE);
 
2255
 
 
2256
        event->any.window     = g_object_ref(widget->window);
 
2257
        event->any.send_event = TRUE;
 
2258
 
 
2259
        gtk_main_do_event(event);
 
2260
        gdk_event_free(event);
 
2261
    }
 
2262
}
 
2263
 
 
2264
static int
 
2265
_wrap_gimp_dialog_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2266
{
 
2267
    gchar *title, *role;
 
2268
    PyGObject *py_window = NULL;
 
2269
    PyObject *py_flags = NULL, *py_buttons = Py_None;
 
2270
    PyObject *help_func = NULL;
 
2271
    gchar *help_id = NULL;
 
2272
    GtkDialogFlags flags = 0;
 
2273
    int len, i;
 
2274
    GtkWidget *parent;
 
2275
    GimpHelpFunc func;
 
2276
 
 
2277
    static char *kwlist[] = { "title", "role", "parent", "flags",
 
2278
                              "help_func", "help_id", "buttons", NULL };
 
2279
 
 
2280
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
2281
                                     "zz|OOOzO:gimpui.GimpDialog.__init__",
 
2282
                                     kwlist,
 
2283
                                     &title, &role, &py_window, &py_flags,
 
2284
                                     &help_func, &help_id, &py_buttons))
 
2285
        return -1;
 
2286
 
 
2287
    if (py_window == NULL || (PyObject*)py_window == Py_None)
 
2288
        parent = NULL;
 
2289
    else if (pygobject_check(py_window, &PyGtkWindow_Type))
 
2290
        parent = GTK_WIDGET(py_window->obj);
 
2291
    else {
 
2292
        PyErr_SetString(PyExc_TypeError, "parent must be a GtkWindow or None");
 
2293
        return -1;
 
2294
    }
 
2295
 
 
2296
    if (pyg_flags_get_value(GTK_TYPE_DIALOG_FLAGS, py_flags, (gint *)&flags))
 
2297
        return -1;
 
2298
 
 
2299
    if (help_func) {
 
2300
        if (help_func != Py_None) {
 
2301
            if (!PyCallable_Check(help_func)) {
 
2302
                PyErr_SetString(PyExc_TypeError, "help_func must be callable");
 
2303
                return -1;
 
2304
            }
 
2305
 
 
2306
            func = pygimp_help_func_marshal;
 
2307
 
 
2308
            g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
 
2309
 
 
2310
            Py_INCREF(help_func);
 
2311
            g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
 
2312
                                   help_func, pygimp_help_func_destroy);
 
2313
        } else {
 
2314
            func = gimp_standard_help_func;
 
2315
        }
 
2316
    } else {
 
2317
        func = gimp_standard_help_func;
 
2318
    }
 
2319
 
 
2320
    if (py_buttons == Py_None)
 
2321
        len = 0;
 
2322
    else if (PyTuple_Check(py_buttons))
 
2323
        len = PyTuple_Size(py_buttons);
 
2324
    else {
 
2325
        PyErr_SetString(PyExc_TypeError, "buttons must be a tuple containing text/response pairs or None");
 
2326
        return -1;
 
2327
    }
 
2328
 
 
2329
    if (len % 2) {
 
2330
        PyErr_SetString(PyExc_RuntimeError,
 
2331
                        "buttons tuple must contain text/response id pairs");
 
2332
        return -1;
 
2333
    }
 
2334
 
 
2335
    pygobject_construct(self,
 
2336
                        "title",     title,
 
2337
                        "role",      role,
 
2338
                        "modal",     (flags & GTK_DIALOG_MODAL),
 
2339
                        "help-func", func,
 
2340
                        "help-id",   help_id,
 
2341
                        NULL);
 
2342
 
 
2343
    if (!self->obj) {
 
2344
        PyErr_SetString(PyExc_RuntimeError,
 
2345
                        "could not create GimpDialog object");
 
2346
        return -1;
 
2347
    }
 
2348
 
 
2349
    if (parent) {
 
2350
        if (GTK_IS_WINDOW(parent))
 
2351
            gtk_window_set_transient_for(GTK_WINDOW(self->obj),
 
2352
                                         GTK_WINDOW(parent));
 
2353
        else
 
2354
            gtk_window_set_screen(GTK_WINDOW(self->obj),
 
2355
                                  gtk_widget_get_screen(parent));
 
2356
 
 
2357
        if (flags & GTK_DIALOG_DESTROY_WITH_PARENT)
 
2358
            g_signal_connect_object(parent, "destroy",
 
2359
                                    G_CALLBACK(pygimp_dialog_close),
 
2360
                                    self->obj, G_CONNECT_SWAPPED);
 
2361
    }
 
2362
 
 
2363
    for (i = 0; i < len; i += 2) {
 
2364
        PyObject *text = PyTuple_GetItem(py_buttons, i);
 
2365
        PyObject *id = PyTuple_GetItem(py_buttons, i + 1);
 
2366
        if (!PyString_Check(text) && !PyUnicode_Check(text)) {
 
2367
            gtk_object_destroy(GTK_OBJECT(self->obj));
 
2368
            self->obj = NULL;
 
2369
            PyErr_SetString(PyExc_RuntimeError,
 
2370
                            "first member of each text/response id pair "
 
2371
                            "must be a string");
 
2372
            return -1;
 
2373
        }
 
2374
        if (!PyInt_Check(id)) {
 
2375
            gtk_object_destroy(GTK_OBJECT(self->obj));
 
2376
            self->obj = NULL;
 
2377
            PyErr_SetString(PyExc_RuntimeError,
 
2378
                            "second member of each text/response id pair "
 
2379
                            "must be a number");
 
2380
            return -1;
 
2381
        }
 
2382
 
 
2383
        gimp_dialog_add_button(GIMP_DIALOG(self->obj), PyString_AsString(text),
 
2384
                               PyInt_AsLong(id));
 
2385
    }
 
2386
 
 
2387
    return 0;
 
2388
}
 
2389
#line 2390 "gimpui.c"
 
2390
 
 
2391
 
 
2392
static PyObject *
 
2393
_wrap_gimp_dialog_add_button(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2394
{
 
2395
    static char *kwlist[] = { "button_text", "response_id", NULL };
 
2396
    char *button_text;
 
2397
    int response_id;
 
2398
    GtkWidget *ret;
 
2399
 
 
2400
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"si:GimpDialog.add_button", kwlist, &button_text, &response_id))
 
2401
        return NULL;
 
2402
    
 
2403
    ret = gimp_dialog_add_button(GIMP_DIALOG(self->obj), button_text, response_id);
 
2404
    
 
2405
    /* pygobject_new handles NULL checking */
 
2406
    return pygobject_new((GObject *)ret);
 
2407
}
 
2408
 
 
2409
static PyObject *
 
2410
_wrap_gimp_dialog_run(PyGObject *self)
 
2411
{
 
2412
    int ret;
 
2413
 
 
2414
    
 
2415
    ret = gimp_dialog_run(GIMP_DIALOG(self->obj));
 
2416
    
 
2417
    return PyInt_FromLong(ret);
 
2418
}
 
2419
 
 
2420
#line 896 "gimpui.override"
 
2421
static PyObject *
 
2422
_wrap_gimp_window_set_transient(PyGObject *self)
 
2423
{
 
2424
    gimp_window_set_transient(GTK_WINDOW(self->obj));
 
2425
    Py_INCREF(Py_None);
 
2426
    return Py_None;
 
2427
}
 
2428
#line 2429 "gimpui.c"
 
2429
 
 
2430
 
 
2431
static const PyMethodDef _PyGimpDialog_methods[] = {
 
2432
    { "add_button", (PyCFunction)_wrap_gimp_dialog_add_button, METH_VARARGS|METH_KEYWORDS,
 
2433
      NULL },
 
2434
    { "run", (PyCFunction)_wrap_gimp_dialog_run, METH_NOARGS,
 
2435
      NULL },
 
2436
    { "set_transient", (PyCFunction)_wrap_gimp_window_set_transient, METH_VARARGS,
 
2437
      NULL },
 
2438
    { NULL, NULL, 0, NULL }
 
2439
};
 
2440
 
 
2441
PyTypeObject G_GNUC_INTERNAL PyGimpDialog_Type = {
 
2442
    PyObject_HEAD_INIT(NULL)
 
2443
    0,                                 /* ob_size */
 
2444
    "gimpui.Dialog",                   /* tp_name */
 
2445
    sizeof(PyGObject),          /* tp_basicsize */
 
2446
    0,                                 /* tp_itemsize */
 
2447
    /* methods */
 
2448
    (destructor)0,        /* tp_dealloc */
 
2449
    (printfunc)0,                      /* tp_print */
 
2450
    (getattrfunc)0,       /* tp_getattr */
 
2451
    (setattrfunc)0,       /* tp_setattr */
 
2452
    (cmpfunc)0,           /* tp_compare */
 
2453
    (reprfunc)0,             /* tp_repr */
 
2454
    (PyNumberMethods*)0,     /* tp_as_number */
 
2455
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2456
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2457
    (hashfunc)0,             /* tp_hash */
 
2458
    (ternaryfunc)0,          /* tp_call */
 
2459
    (reprfunc)0,              /* tp_str */
 
2460
    (getattrofunc)0,     /* tp_getattro */
 
2461
    (setattrofunc)0,     /* tp_setattro */
 
2462
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2463
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2464
    NULL,                        /* Documentation string */
 
2465
    (traverseproc)0,     /* tp_traverse */
 
2466
    (inquiry)0,             /* tp_clear */
 
2467
    (richcmpfunc)0,   /* tp_richcompare */
 
2468
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2469
    (getiterfunc)0,          /* tp_iter */
 
2470
    (iternextfunc)0,     /* tp_iternext */
 
2471
    (struct PyMethodDef*)_PyGimpDialog_methods, /* tp_methods */
 
2472
    (struct PyMemberDef*)0,              /* tp_members */
 
2473
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2474
    NULL,                              /* tp_base */
 
2475
    NULL,                              /* tp_dict */
 
2476
    (descrgetfunc)0,    /* tp_descr_get */
 
2477
    (descrsetfunc)0,    /* tp_descr_set */
 
2478
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2479
    (initproc)_wrap_gimp_dialog_new,             /* tp_init */
 
2480
    (allocfunc)0,           /* tp_alloc */
 
2481
    (newfunc)0,               /* tp_new */
 
2482
    (freefunc)0,             /* tp_free */
 
2483
    (inquiry)0              /* tp_is_gc */
 
2484
};
 
2485
 
 
2486
 
 
2487
 
 
2488
/* ----------- GimpEnumLabel ----------- */
 
2489
 
 
2490
#line 994 "gimpui.override"
 
2491
static int
 
2492
_wrap_gimp_enum_label_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2493
{
 
2494
    PyObject *py_enum_type = NULL;
 
2495
    gint value;
 
2496
    GType enum_type;
 
2497
    GimpEnumLabel *label;
 
2498
 
 
2499
    static char *kwlist[] = { "enum_type", "value", NULL };
 
2500
 
 
2501
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
2502
                                     "Oi:gimpui.GimpEnumLabel.__init__",
 
2503
                                     kwlist,
 
2504
                                     &py_enum_type, &value))
 
2505
        return -1;
 
2506
 
 
2507
    if ((enum_type = pyg_type_from_object(py_enum_type)) == 0)
 
2508
        return -1;
 
2509
 
 
2510
    if (pygobject_construct(self, NULL))
 
2511
        return -1;
 
2512
 
 
2513
    label = GIMP_ENUM_LABEL(self->obj);
 
2514
 
 
2515
    label->enum_class = g_type_class_ref(enum_type);
 
2516
 
 
2517
    gimp_enum_label_set_value (label, value);
 
2518
 
 
2519
    return 0; 
 
2520
}
 
2521
#line 2522 "gimpui.c"
 
2522
 
 
2523
 
 
2524
static PyObject *
 
2525
_wrap_gimp_enum_label_set_value(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2526
{
 
2527
    static char *kwlist[] = { "value", NULL };
 
2528
    int value;
 
2529
 
 
2530
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpEnumLabel.set_value", kwlist, &value))
 
2531
        return NULL;
 
2532
    
 
2533
    gimp_enum_label_set_value(GIMP_ENUM_LABEL(self->obj), value);
 
2534
    
 
2535
    Py_INCREF(Py_None);
 
2536
    return Py_None;
 
2537
}
 
2538
 
 
2539
static const PyMethodDef _PyGimpEnumLabel_methods[] = {
 
2540
    { "set_value", (PyCFunction)_wrap_gimp_enum_label_set_value, METH_VARARGS|METH_KEYWORDS,
 
2541
      NULL },
 
2542
    { NULL, NULL, 0, NULL }
 
2543
};
 
2544
 
 
2545
PyTypeObject G_GNUC_INTERNAL PyGimpEnumLabel_Type = {
 
2546
    PyObject_HEAD_INIT(NULL)
 
2547
    0,                                 /* ob_size */
 
2548
    "gimpui.EnumLabel",                   /* tp_name */
 
2549
    sizeof(PyGObject),          /* tp_basicsize */
 
2550
    0,                                 /* tp_itemsize */
 
2551
    /* methods */
 
2552
    (destructor)0,        /* tp_dealloc */
 
2553
    (printfunc)0,                      /* tp_print */
 
2554
    (getattrfunc)0,       /* tp_getattr */
 
2555
    (setattrfunc)0,       /* tp_setattr */
 
2556
    (cmpfunc)0,           /* tp_compare */
 
2557
    (reprfunc)0,             /* tp_repr */
 
2558
    (PyNumberMethods*)0,     /* tp_as_number */
 
2559
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2560
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2561
    (hashfunc)0,             /* tp_hash */
 
2562
    (ternaryfunc)0,          /* tp_call */
 
2563
    (reprfunc)0,              /* tp_str */
 
2564
    (getattrofunc)0,     /* tp_getattro */
 
2565
    (setattrofunc)0,     /* tp_setattro */
 
2566
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2567
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2568
    NULL,                        /* Documentation string */
 
2569
    (traverseproc)0,     /* tp_traverse */
 
2570
    (inquiry)0,             /* tp_clear */
 
2571
    (richcmpfunc)0,   /* tp_richcompare */
 
2572
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2573
    (getiterfunc)0,          /* tp_iter */
 
2574
    (iternextfunc)0,     /* tp_iternext */
 
2575
    (struct PyMethodDef*)_PyGimpEnumLabel_methods, /* tp_methods */
 
2576
    (struct PyMemberDef*)0,              /* tp_members */
 
2577
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2578
    NULL,                              /* tp_base */
 
2579
    NULL,                              /* tp_dict */
 
2580
    (descrgetfunc)0,    /* tp_descr_get */
 
2581
    (descrsetfunc)0,    /* tp_descr_set */
 
2582
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2583
    (initproc)_wrap_gimp_enum_label_new,             /* tp_init */
 
2584
    (allocfunc)0,           /* tp_alloc */
 
2585
    (newfunc)0,               /* tp_new */
 
2586
    (freefunc)0,             /* tp_free */
 
2587
    (inquiry)0              /* tp_is_gc */
 
2588
};
 
2589
 
 
2590
 
 
2591
 
 
2592
/* ----------- GimpFrame ----------- */
 
2593
 
 
2594
static int
 
2595
_wrap_gimp_frame_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2596
{
 
2597
    static char *kwlist[] = { "label", NULL };
 
2598
    char *label;
 
2599
 
 
2600
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpFrame.__init__", kwlist, &label))
 
2601
        return -1;
 
2602
    self->obj = (GObject *)gimp_frame_new(label);
 
2603
 
 
2604
    if (!self->obj) {
 
2605
        PyErr_SetString(PyExc_RuntimeError, "could not create GimpFrame object");
 
2606
        return -1;
 
2607
    }
 
2608
    pygobject_register_wrapper((PyObject *)self);
 
2609
    return 0;
 
2610
}
 
2611
 
 
2612
PyTypeObject G_GNUC_INTERNAL PyGimpFrame_Type = {
 
2613
    PyObject_HEAD_INIT(NULL)
 
2614
    0,                                 /* ob_size */
 
2615
    "gimpui.Frame",                   /* tp_name */
 
2616
    sizeof(PyGObject),          /* tp_basicsize */
 
2617
    0,                                 /* tp_itemsize */
 
2618
    /* methods */
 
2619
    (destructor)0,        /* tp_dealloc */
 
2620
    (printfunc)0,                      /* tp_print */
 
2621
    (getattrfunc)0,       /* tp_getattr */
 
2622
    (setattrfunc)0,       /* tp_setattr */
 
2623
    (cmpfunc)0,           /* tp_compare */
 
2624
    (reprfunc)0,             /* tp_repr */
 
2625
    (PyNumberMethods*)0,     /* tp_as_number */
 
2626
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2627
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2628
    (hashfunc)0,             /* tp_hash */
 
2629
    (ternaryfunc)0,          /* tp_call */
 
2630
    (reprfunc)0,              /* tp_str */
 
2631
    (getattrofunc)0,     /* tp_getattro */
 
2632
    (setattrofunc)0,     /* tp_setattro */
 
2633
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2634
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2635
    NULL,                        /* Documentation string */
 
2636
    (traverseproc)0,     /* tp_traverse */
 
2637
    (inquiry)0,             /* tp_clear */
 
2638
    (richcmpfunc)0,   /* tp_richcompare */
 
2639
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2640
    (getiterfunc)0,          /* tp_iter */
 
2641
    (iternextfunc)0,     /* tp_iternext */
 
2642
    (struct PyMethodDef*)NULL, /* tp_methods */
 
2643
    (struct PyMemberDef*)0,              /* tp_members */
 
2644
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2645
    NULL,                              /* tp_base */
 
2646
    NULL,                              /* tp_dict */
 
2647
    (descrgetfunc)0,    /* tp_descr_get */
 
2648
    (descrsetfunc)0,    /* tp_descr_set */
 
2649
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2650
    (initproc)_wrap_gimp_frame_new,             /* tp_init */
 
2651
    (allocfunc)0,           /* tp_alloc */
 
2652
    (newfunc)0,               /* tp_new */
 
2653
    (freefunc)0,             /* tp_free */
 
2654
    (inquiry)0              /* tp_is_gc */
 
2655
};
 
2656
 
 
2657
 
 
2658
 
 
2659
/* ----------- GimpHintBox ----------- */
 
2660
 
 
2661
static int
 
2662
_wrap_gimp_hint_box_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2663
{
 
2664
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
2665
    GParameter params[2];
 
2666
    PyObject *parsed_args[2] = {NULL, };
 
2667
    char *arg_names[] = {"hint", "stock-id", NULL };
 
2668
    char *prop_names[] = {"hint", "stock-id", NULL };
 
2669
    guint nparams, i;
 
2670
 
 
2671
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:gimpui.HintBox.__init__" , arg_names , &parsed_args[0] , &parsed_args[1]))
 
2672
        return -1;
 
2673
 
 
2674
    memset(params, 0, sizeof(GParameter)*2);
 
2675
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
2676
                                    prop_names, params, 
 
2677
                                    &nparams, parsed_args))
 
2678
        return -1;
 
2679
    pygobject_constructv(self, nparams, params);
 
2680
    for (i = 0; i < nparams; ++i)
 
2681
        g_value_unset(&params[i].value);
 
2682
    if (!self->obj) {
 
2683
        PyErr_SetString(
 
2684
            PyExc_RuntimeError, 
 
2685
            "could not create gimpui.HintBox object");
 
2686
        return -1;
 
2687
    }
 
2688
    return 0;
 
2689
}
 
2690
 
 
2691
PyTypeObject G_GNUC_INTERNAL PyGimpHintBox_Type = {
 
2692
    PyObject_HEAD_INIT(NULL)
 
2693
    0,                                 /* ob_size */
 
2694
    "gimpui.HintBox",                   /* tp_name */
 
2695
    sizeof(PyGObject),          /* tp_basicsize */
 
2696
    0,                                 /* tp_itemsize */
 
2697
    /* methods */
 
2698
    (destructor)0,        /* tp_dealloc */
 
2699
    (printfunc)0,                      /* tp_print */
 
2700
    (getattrfunc)0,       /* tp_getattr */
 
2701
    (setattrfunc)0,       /* tp_setattr */
 
2702
    (cmpfunc)0,           /* tp_compare */
 
2703
    (reprfunc)0,             /* tp_repr */
 
2704
    (PyNumberMethods*)0,     /* tp_as_number */
 
2705
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2706
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2707
    (hashfunc)0,             /* tp_hash */
 
2708
    (ternaryfunc)0,          /* tp_call */
 
2709
    (reprfunc)0,              /* tp_str */
 
2710
    (getattrofunc)0,     /* tp_getattro */
 
2711
    (setattrofunc)0,     /* tp_setattro */
 
2712
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2713
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2714
    NULL,                        /* Documentation string */
 
2715
    (traverseproc)0,     /* tp_traverse */
 
2716
    (inquiry)0,             /* tp_clear */
 
2717
    (richcmpfunc)0,   /* tp_richcompare */
 
2718
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2719
    (getiterfunc)0,          /* tp_iter */
 
2720
    (iternextfunc)0,     /* tp_iternext */
 
2721
    (struct PyMethodDef*)NULL, /* tp_methods */
 
2722
    (struct PyMemberDef*)0,              /* tp_members */
 
2723
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2724
    NULL,                              /* tp_base */
 
2725
    NULL,                              /* tp_dict */
 
2726
    (descrgetfunc)0,    /* tp_descr_get */
 
2727
    (descrsetfunc)0,    /* tp_descr_set */
 
2728
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2729
    (initproc)_wrap_gimp_hint_box_new,             /* tp_init */
 
2730
    (allocfunc)0,           /* tp_alloc */
 
2731
    (newfunc)0,               /* tp_new */
 
2732
    (freefunc)0,             /* tp_free */
 
2733
    (inquiry)0              /* tp_is_gc */
 
2734
};
 
2735
 
 
2736
 
 
2737
 
 
2738
/* ----------- GimpIntComboBox ----------- */
 
2739
 
 
2740
#line 1028 "gimpui.override"
 
2741
static int
 
2742
_wrap_gimp_int_combo_box_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2743
{
 
2744
    PyObject *py_items = NULL;
 
2745
    int len, i;
 
2746
 
 
2747
    static char *kwlist[] = { "items", NULL };
 
2748
 
 
2749
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
2750
                                     "|O:gimpui.IntComboBox.__init__",
 
2751
                                     kwlist,
 
2752
                                     &py_items))
 
2753
        return -1; 
 
2754
 
 
2755
    if (py_items == NULL || py_items == Py_None)
 
2756
        len = 0;
 
2757
    else if (PyTuple_Check(py_items))
 
2758
        len = PyTuple_Size(py_items);
 
2759
    else {
 
2760
        PyErr_SetString(PyExc_TypeError,
 
2761
                        "items must be a tuple containing label/value pairs "
 
2762
                        "or None");
 
2763
        return -1;
 
2764
    }
 
2765
 
 
2766
    if (len % 2) {
 
2767
        PyErr_SetString(PyExc_RuntimeError,
 
2768
                        "items tuple must contain label/value pairs");
 
2769
        return -1;
 
2770
    }
 
2771
 
 
2772
    if (pygobject_construct(self, NULL))
 
2773
        return -1;
 
2774
 
 
2775
    for (i = 0; i < len; i += 2) {
 
2776
        PyObject *label = PyTuple_GetItem(py_items, i);
 
2777
        PyObject *value = PyTuple_GetItem(py_items, i + 1);
 
2778
 
 
2779
        if (!PyString_Check(label)) {
 
2780
            gtk_object_destroy(GTK_OBJECT(self->obj));
 
2781
            self->obj = NULL;
 
2782
            PyErr_SetString(PyExc_RuntimeError,
 
2783
                            "first member of each label/value pair "
 
2784
                            "must be a string");
 
2785
            return -1;
 
2786
        }
 
2787
 
 
2788
        if (!PyInt_Check(value)) {
 
2789
            gtk_object_destroy(GTK_OBJECT(self->obj));
 
2790
            self->obj = NULL;
 
2791
            PyErr_SetString(PyExc_RuntimeError,
 
2792
                            "second member of each label/value pair "
 
2793
                            "must be a number");
 
2794
            return -1;
 
2795
        }
 
2796
 
 
2797
        gimp_int_combo_box_append(GIMP_INT_COMBO_BOX(self->obj),
 
2798
                                  PyString_AsString(label),
 
2799
                                  PyInt_AsLong(value),
 
2800
                                  -1);
 
2801
    }
 
2802
 
 
2803
    return 0;
 
2804
}
 
2805
#line 2806 "gimpui.c"
 
2806
 
 
2807
 
 
2808
#line 1109 "gimpui.override"
 
2809
static PyObject *
 
2810
_wrap_gimp_int_combo_box_set_active(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2811
{
 
2812
    int value;
 
2813
 
 
2814
    static char *kwlist[] = { "value", NULL };
 
2815
 
 
2816
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
 
2817
                                     "i:GimpIntComboBox.set_active", kwlist,
 
2818
                                     &value))
 
2819
        return NULL;
 
2820
 
 
2821
    if (!gimp_int_combo_box_set_active(GIMP_INT_COMBO_BOX(self->obj), value)) {
 
2822
        PyErr_Format(pygimp_error,
 
2823
                     "Value %d does not exist in GimpIntComboBox",
 
2824
                     value);
 
2825
        return NULL;
 
2826
    }
 
2827
 
 
2828
    Py_INCREF(Py_None);
 
2829
    return Py_None;
 
2830
}
 
2831
#line 2832 "gimpui.c"
 
2832
 
 
2833
 
 
2834
#line 1096 "gimpui.override"
 
2835
static PyObject *
 
2836
_wrap_gimp_int_combo_box_get_active(PyGObject *self)
 
2837
{
 
2838
    int value;
 
2839
 
 
2840
    if (gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(self->obj), &value))
 
2841
        return PyLong_FromLong(value);
 
2842
 
 
2843
    Py_INCREF(Py_None);
 
2844
    return Py_None;
 
2845
}
 
2846
#line 2847 "gimpui.c"
 
2847
 
 
2848
 
 
2849
static const PyMethodDef _PyGimpIntComboBox_methods[] = {
 
2850
    { "set_active", (PyCFunction)_wrap_gimp_int_combo_box_set_active, METH_VARARGS|METH_KEYWORDS,
 
2851
      NULL },
 
2852
    { "get_active", (PyCFunction)_wrap_gimp_int_combo_box_get_active, METH_NOARGS,
 
2853
      NULL },
 
2854
    { NULL, NULL, 0, NULL }
 
2855
};
 
2856
 
 
2857
PyTypeObject G_GNUC_INTERNAL PyGimpIntComboBox_Type = {
 
2858
    PyObject_HEAD_INIT(NULL)
 
2859
    0,                                 /* ob_size */
 
2860
    "gimpui.IntComboBox",                   /* tp_name */
 
2861
    sizeof(PyGObject),          /* tp_basicsize */
 
2862
    0,                                 /* tp_itemsize */
 
2863
    /* methods */
 
2864
    (destructor)0,        /* tp_dealloc */
 
2865
    (printfunc)0,                      /* tp_print */
 
2866
    (getattrfunc)0,       /* tp_getattr */
 
2867
    (setattrfunc)0,       /* tp_setattr */
 
2868
    (cmpfunc)0,           /* tp_compare */
 
2869
    (reprfunc)0,             /* tp_repr */
 
2870
    (PyNumberMethods*)0,     /* tp_as_number */
 
2871
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2872
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2873
    (hashfunc)0,             /* tp_hash */
 
2874
    (ternaryfunc)0,          /* tp_call */
 
2875
    (reprfunc)0,              /* tp_str */
 
2876
    (getattrofunc)0,     /* tp_getattro */
 
2877
    (setattrofunc)0,     /* tp_setattro */
 
2878
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2879
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2880
    NULL,                        /* Documentation string */
 
2881
    (traverseproc)0,     /* tp_traverse */
 
2882
    (inquiry)0,             /* tp_clear */
 
2883
    (richcmpfunc)0,   /* tp_richcompare */
 
2884
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2885
    (getiterfunc)0,          /* tp_iter */
 
2886
    (iternextfunc)0,     /* tp_iternext */
 
2887
    (struct PyMethodDef*)_PyGimpIntComboBox_methods, /* tp_methods */
 
2888
    (struct PyMemberDef*)0,              /* tp_members */
 
2889
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2890
    NULL,                              /* tp_base */
 
2891
    NULL,                              /* tp_dict */
 
2892
    (descrgetfunc)0,    /* tp_descr_get */
 
2893
    (descrsetfunc)0,    /* tp_descr_set */
 
2894
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2895
    (initproc)_wrap_gimp_int_combo_box_new,             /* tp_init */
 
2896
    (allocfunc)0,           /* tp_alloc */
 
2897
    (newfunc)0,               /* tp_new */
 
2898
    (freefunc)0,             /* tp_free */
 
2899
    (inquiry)0              /* tp_is_gc */
 
2900
};
 
2901
 
 
2902
 
 
2903
 
 
2904
/* ----------- GimpEnumComboBox ----------- */
 
2905
 
 
2906
static int
 
2907
_wrap_gimp_enum_combo_box_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2908
{
 
2909
    static char *kwlist[] = { "enum_type", NULL };
 
2910
    PyObject *py_enum_type = NULL;
 
2911
    GType enum_type;
 
2912
 
 
2913
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpEnumComboBox.__init__", kwlist, &py_enum_type))
 
2914
        return -1;
 
2915
    if ((enum_type = pyg_type_from_object(py_enum_type)) == 0)
 
2916
        return -1;
 
2917
    self->obj = (GObject *)gimp_enum_combo_box_new(enum_type);
 
2918
 
 
2919
    if (!self->obj) {
 
2920
        PyErr_SetString(PyExc_RuntimeError, "could not create GimpEnumComboBox object");
 
2921
        return -1;
 
2922
    }
 
2923
    pygobject_register_wrapper((PyObject *)self);
 
2924
    return 0;
 
2925
}
 
2926
 
 
2927
static PyObject *
 
2928
_wrap_gimp_enum_combo_box_set_stock_prefix(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2929
{
 
2930
    static char *kwlist[] = { "stock_prefix", NULL };
 
2931
    char *stock_prefix;
 
2932
 
 
2933
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpEnumComboBox.set_stock_prefix", kwlist, &stock_prefix))
 
2934
        return NULL;
 
2935
    
 
2936
    gimp_enum_combo_box_set_stock_prefix(GIMP_ENUM_COMBO_BOX(self->obj), stock_prefix);
 
2937
    
 
2938
    Py_INCREF(Py_None);
 
2939
    return Py_None;
 
2940
}
 
2941
 
 
2942
static const PyMethodDef _PyGimpEnumComboBox_methods[] = {
 
2943
    { "set_stock_prefix", (PyCFunction)_wrap_gimp_enum_combo_box_set_stock_prefix, METH_VARARGS|METH_KEYWORDS,
 
2944
      NULL },
 
2945
    { NULL, NULL, 0, NULL }
 
2946
};
 
2947
 
 
2948
PyTypeObject G_GNUC_INTERNAL PyGimpEnumComboBox_Type = {
 
2949
    PyObject_HEAD_INIT(NULL)
 
2950
    0,                                 /* ob_size */
 
2951
    "gimpui.EnumComboBox",                   /* tp_name */
 
2952
    sizeof(PyGObject),          /* tp_basicsize */
 
2953
    0,                                 /* tp_itemsize */
 
2954
    /* methods */
 
2955
    (destructor)0,        /* tp_dealloc */
 
2956
    (printfunc)0,                      /* tp_print */
 
2957
    (getattrfunc)0,       /* tp_getattr */
 
2958
    (setattrfunc)0,       /* tp_setattr */
 
2959
    (cmpfunc)0,           /* tp_compare */
 
2960
    (reprfunc)0,             /* tp_repr */
 
2961
    (PyNumberMethods*)0,     /* tp_as_number */
 
2962
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2963
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2964
    (hashfunc)0,             /* tp_hash */
 
2965
    (ternaryfunc)0,          /* tp_call */
 
2966
    (reprfunc)0,              /* tp_str */
 
2967
    (getattrofunc)0,     /* tp_getattro */
 
2968
    (setattrofunc)0,     /* tp_setattro */
 
2969
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2970
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2971
    NULL,                        /* Documentation string */
 
2972
    (traverseproc)0,     /* tp_traverse */
 
2973
    (inquiry)0,             /* tp_clear */
 
2974
    (richcmpfunc)0,   /* tp_richcompare */
 
2975
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2976
    (getiterfunc)0,          /* tp_iter */
 
2977
    (iternextfunc)0,     /* tp_iternext */
 
2978
    (struct PyMethodDef*)_PyGimpEnumComboBox_methods, /* tp_methods */
 
2979
    (struct PyMemberDef*)0,              /* tp_members */
 
2980
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2981
    NULL,                              /* tp_base */
 
2982
    NULL,                              /* tp_dict */
 
2983
    (descrgetfunc)0,    /* tp_descr_get */
 
2984
    (descrsetfunc)0,    /* tp_descr_set */
 
2985
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2986
    (initproc)_wrap_gimp_enum_combo_box_new,             /* tp_init */
 
2987
    (allocfunc)0,           /* tp_alloc */
 
2988
    (newfunc)0,               /* tp_new */
 
2989
    (freefunc)0,             /* tp_free */
 
2990
    (inquiry)0              /* tp_is_gc */
 
2991
};
 
2992
 
 
2993
 
 
2994
 
 
2995
/* ----------- GimpIntStore ----------- */
 
2996
 
 
2997
 static int
 
2998
_wrap_gimp_int_store_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2999
{
 
3000
    static char* kwlist[] = { NULL };
 
3001
 
 
3002
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
3003
                                     ":gimpui.IntStore.__init__",
 
3004
                                     kwlist))
 
3005
        return -1;
 
3006
 
 
3007
    pygobject_constructv(self, 0, NULL);
 
3008
    if (!self->obj) {
 
3009
        PyErr_SetString(
 
3010
            PyExc_RuntimeError, 
 
3011
            "could not create gimpui.IntStore object");
 
3012
        return -1;
 
3013
    }
 
3014
    return 0;
 
3015
}
 
3016
 
 
3017
PyTypeObject G_GNUC_INTERNAL PyGimpIntStore_Type = {
 
3018
    PyObject_HEAD_INIT(NULL)
 
3019
    0,                                 /* ob_size */
 
3020
    "gimpui.IntStore",                   /* tp_name */
 
3021
    sizeof(PyGObject),          /* tp_basicsize */
 
3022
    0,                                 /* tp_itemsize */
 
3023
    /* methods */
 
3024
    (destructor)0,        /* tp_dealloc */
 
3025
    (printfunc)0,                      /* tp_print */
 
3026
    (getattrfunc)0,       /* tp_getattr */
 
3027
    (setattrfunc)0,       /* tp_setattr */
 
3028
    (cmpfunc)0,           /* tp_compare */
 
3029
    (reprfunc)0,             /* tp_repr */
 
3030
    (PyNumberMethods*)0,     /* tp_as_number */
 
3031
    (PySequenceMethods*)0, /* tp_as_sequence */
 
3032
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
3033
    (hashfunc)0,             /* tp_hash */
 
3034
    (ternaryfunc)0,          /* tp_call */
 
3035
    (reprfunc)0,              /* tp_str */
 
3036
    (getattrofunc)0,     /* tp_getattro */
 
3037
    (setattrofunc)0,     /* tp_setattro */
 
3038
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
3039
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
3040
    NULL,                        /* Documentation string */
 
3041
    (traverseproc)0,     /* tp_traverse */
 
3042
    (inquiry)0,             /* tp_clear */
 
3043
    (richcmpfunc)0,   /* tp_richcompare */
 
3044
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
3045
    (getiterfunc)0,          /* tp_iter */
 
3046
    (iternextfunc)0,     /* tp_iternext */
 
3047
    (struct PyMethodDef*)NULL, /* tp_methods */
 
3048
    (struct PyMemberDef*)0,              /* tp_members */
 
3049
    (struct PyGetSetDef*)0,  /* tp_getset */
 
3050
    NULL,                              /* tp_base */
 
3051
    NULL,                              /* tp_dict */
 
3052
    (descrgetfunc)0,    /* tp_descr_get */
 
3053
    (descrsetfunc)0,    /* tp_descr_set */
 
3054
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
3055
    (initproc)_wrap_gimp_int_store_new,             /* tp_init */
 
3056
    (allocfunc)0,           /* tp_alloc */
 
3057
    (newfunc)0,               /* tp_new */
 
3058
    (freefunc)0,             /* tp_free */
 
3059
    (inquiry)0              /* tp_is_gc */
 
3060
};
 
3061
 
 
3062
 
 
3063
 
 
3064
/* ----------- GimpEnumStore ----------- */
 
3065
 
 
3066
static int
 
3067
_wrap_gimp_enum_store_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3068
{
 
3069
    static char *kwlist[] = { "enum_type", NULL };
 
3070
    PyObject *py_enum_type = NULL;
 
3071
    GType enum_type;
 
3072
 
 
3073
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpEnumStore.__init__", kwlist, &py_enum_type))
 
3074
        return -1;
 
3075
    if ((enum_type = pyg_type_from_object(py_enum_type)) == 0)
 
3076
        return -1;
 
3077
    self->obj = (GObject *)gimp_enum_store_new(enum_type);
 
3078
 
 
3079
    if (!self->obj) {
 
3080
        PyErr_SetString(PyExc_RuntimeError, "could not create GimpEnumStore object");
 
3081
        return -1;
 
3082
    }
 
3083
    pygobject_register_wrapper((PyObject *)self);
 
3084
    return 0;
 
3085
}
 
3086
 
 
3087
static PyObject *
 
3088
_wrap_gimp_enum_store_set_stock_prefix(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3089
{
 
3090
    static char *kwlist[] = { "stock_prefix", NULL };
 
3091
    char *stock_prefix;
 
3092
 
 
3093
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpEnumStore.set_stock_prefix", kwlist, &stock_prefix))
 
3094
        return NULL;
 
3095
    
 
3096
    gimp_enum_store_set_stock_prefix(GIMP_ENUM_STORE(self->obj), stock_prefix);
 
3097
    
 
3098
    Py_INCREF(Py_None);
 
3099
    return Py_None;
 
3100
}
 
3101
 
 
3102
static const PyMethodDef _PyGimpEnumStore_methods[] = {
 
3103
    { "set_stock_prefix", (PyCFunction)_wrap_gimp_enum_store_set_stock_prefix, METH_VARARGS|METH_KEYWORDS,
 
3104
      NULL },
 
3105
    { NULL, NULL, 0, NULL }
 
3106
};
 
3107
 
 
3108
PyTypeObject G_GNUC_INTERNAL PyGimpEnumStore_Type = {
 
3109
    PyObject_HEAD_INIT(NULL)
 
3110
    0,                                 /* ob_size */
 
3111
    "gimpui.EnumStore",                   /* tp_name */
 
3112
    sizeof(PyGObject),          /* tp_basicsize */
 
3113
    0,                                 /* tp_itemsize */
 
3114
    /* methods */
 
3115
    (destructor)0,        /* tp_dealloc */
 
3116
    (printfunc)0,                      /* tp_print */
 
3117
    (getattrfunc)0,       /* tp_getattr */
 
3118
    (setattrfunc)0,       /* tp_setattr */
 
3119
    (cmpfunc)0,           /* tp_compare */
 
3120
    (reprfunc)0,             /* tp_repr */
 
3121
    (PyNumberMethods*)0,     /* tp_as_number */
 
3122
    (PySequenceMethods*)0, /* tp_as_sequence */
 
3123
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
3124
    (hashfunc)0,             /* tp_hash */
 
3125
    (ternaryfunc)0,          /* tp_call */
 
3126
    (reprfunc)0,              /* tp_str */
 
3127
    (getattrofunc)0,     /* tp_getattro */
 
3128
    (setattrofunc)0,     /* tp_setattro */
 
3129
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
3130
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
3131
    NULL,                        /* Documentation string */
 
3132
    (traverseproc)0,     /* tp_traverse */
 
3133
    (inquiry)0,             /* tp_clear */
 
3134
    (richcmpfunc)0,   /* tp_richcompare */
 
3135
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
3136
    (getiterfunc)0,          /* tp_iter */
 
3137
    (iternextfunc)0,     /* tp_iternext */
 
3138
    (struct PyMethodDef*)_PyGimpEnumStore_methods, /* tp_methods */
 
3139
    (struct PyMemberDef*)0,              /* tp_members */
 
3140
    (struct PyGetSetDef*)0,  /* tp_getset */
 
3141
    NULL,                              /* tp_base */
 
3142
    NULL,                              /* tp_dict */
 
3143
    (descrgetfunc)0,    /* tp_descr_get */
 
3144
    (descrsetfunc)0,    /* tp_descr_set */
 
3145
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
3146
    (initproc)_wrap_gimp_enum_store_new,             /* tp_init */
 
3147
    (allocfunc)0,           /* tp_alloc */
 
3148
    (newfunc)0,               /* tp_new */
 
3149
    (freefunc)0,             /* tp_free */
 
3150
    (inquiry)0              /* tp_is_gc */
 
3151
};
 
3152
 
 
3153
 
 
3154
 
 
3155
/* ----------- GimpMemsizeEntry ----------- */
 
3156
 
 
3157
static int
 
3158
_wrap_gimp_memsize_entry_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3159
{
 
3160
    static char *kwlist[] = { "value", "lower", "upper", NULL };
 
3161
    PyObject *py_value = NULL, *py_lower = NULL, *py_upper = NULL;
 
3162
    guint64 value, lower, upper;
 
3163
 
 
3164
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!O!O!:GimpMemsizeEntry.__init__", kwlist, &PyLong_Type, &py_value, &PyLong_Type, &py_lower, &PyLong_Type, &py_upper))
 
3165
        return -1;
 
3166
    value = PyLong_AsUnsignedLongLong(py_value);
 
3167
    lower = PyLong_AsUnsignedLongLong(py_lower);
 
3168
    upper = PyLong_AsUnsignedLongLong(py_upper);
 
3169
    self->obj = (GObject *)gimp_memsize_entry_new(value, lower, upper);
 
3170
 
 
3171
    if (!self->obj) {
 
3172
        PyErr_SetString(PyExc_RuntimeError, "could not create GimpMemsizeEntry object");
 
3173
        return -1;
 
3174
    }
 
3175
    pygobject_register_wrapper((PyObject *)self);
 
3176
    return 0;
 
3177
}
 
3178
 
 
3179
static PyObject *
 
3180
_wrap_gimp_memsize_entry_set_value(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3181
{
 
3182
    static char *kwlist[] = { "value", NULL };
 
3183
    PyObject *py_value = NULL;
 
3184
    guint64 value;
 
3185
 
 
3186
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:GimpMemsizeEntry.set_value", kwlist, &PyLong_Type, &py_value))
 
3187
        return NULL;
 
3188
    value = PyLong_AsUnsignedLongLong(py_value);
 
3189
    
 
3190
    gimp_memsize_entry_set_value(GIMP_MEMSIZE_ENTRY(self->obj), value);
 
3191
    
 
3192
    Py_INCREF(Py_None);
 
3193
    return Py_None;
 
3194
}
 
3195
 
 
3196
static PyObject *
 
3197
_wrap_gimp_memsize_entry_get_value(PyGObject *self)
 
3198
{
 
3199
    guint64 ret;
 
3200
 
 
3201
    
 
3202
    ret = gimp_memsize_entry_get_value(GIMP_MEMSIZE_ENTRY(self->obj));
 
3203
    
 
3204
    return PyLong_FromUnsignedLongLong(ret);
 
3205
}
 
3206
 
 
3207
static const PyMethodDef _PyGimpMemsizeEntry_methods[] = {
 
3208
    { "set_value", (PyCFunction)_wrap_gimp_memsize_entry_set_value, METH_VARARGS|METH_KEYWORDS,
 
3209
      NULL },
 
3210
    { "get_value", (PyCFunction)_wrap_gimp_memsize_entry_get_value, METH_NOARGS,
 
3211
      NULL },
 
3212
    { NULL, NULL, 0, NULL }
 
3213
};
 
3214
 
 
3215
PyTypeObject G_GNUC_INTERNAL PyGimpMemsizeEntry_Type = {
 
3216
    PyObject_HEAD_INIT(NULL)
 
3217
    0,                                 /* ob_size */
 
3218
    "gimpui.MemsizeEntry",                   /* tp_name */
 
3219
    sizeof(PyGObject),          /* tp_basicsize */
 
3220
    0,                                 /* tp_itemsize */
 
3221
    /* methods */
 
3222
    (destructor)0,        /* tp_dealloc */
 
3223
    (printfunc)0,                      /* tp_print */
 
3224
    (getattrfunc)0,       /* tp_getattr */
 
3225
    (setattrfunc)0,       /* tp_setattr */
 
3226
    (cmpfunc)0,           /* tp_compare */
 
3227
    (reprfunc)0,             /* tp_repr */
 
3228
    (PyNumberMethods*)0,     /* tp_as_number */
 
3229
    (PySequenceMethods*)0, /* tp_as_sequence */
 
3230
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
3231
    (hashfunc)0,             /* tp_hash */
 
3232
    (ternaryfunc)0,          /* tp_call */
 
3233
    (reprfunc)0,              /* tp_str */
 
3234
    (getattrofunc)0,     /* tp_getattro */
 
3235
    (setattrofunc)0,     /* tp_setattro */
 
3236
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
3237
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
3238
    NULL,                        /* Documentation string */
 
3239
    (traverseproc)0,     /* tp_traverse */
 
3240
    (inquiry)0,             /* tp_clear */
 
3241
    (richcmpfunc)0,   /* tp_richcompare */
 
3242
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
3243
    (getiterfunc)0,          /* tp_iter */
 
3244
    (iternextfunc)0,     /* tp_iternext */
 
3245
    (struct PyMethodDef*)_PyGimpMemsizeEntry_methods, /* tp_methods */
 
3246
    (struct PyMemberDef*)0,              /* tp_members */
 
3247
    (struct PyGetSetDef*)0,  /* tp_getset */
 
3248
    NULL,                              /* tp_base */
 
3249
    NULL,                              /* tp_dict */
 
3250
    (descrgetfunc)0,    /* tp_descr_get */
 
3251
    (descrsetfunc)0,    /* tp_descr_set */
 
3252
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
3253
    (initproc)_wrap_gimp_memsize_entry_new,             /* tp_init */
 
3254
    (allocfunc)0,           /* tp_alloc */
 
3255
    (newfunc)0,               /* tp_new */
 
3256
    (freefunc)0,             /* tp_free */
 
3257
    (inquiry)0              /* tp_is_gc */
 
3258
};
 
3259
 
 
3260
 
 
3261
 
 
3262
/* ----------- GimpOffsetArea ----------- */
 
3263
 
 
3264
static int
 
3265
_wrap_gimp_offset_area_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3266
{
 
3267
    static char *kwlist[] = { "orig_width", "orig_height", NULL };
 
3268
    int orig_width, orig_height;
 
3269
 
 
3270
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ii:GimpOffsetArea.__init__", kwlist, &orig_width, &orig_height))
 
3271
        return -1;
 
3272
    self->obj = (GObject *)gimp_offset_area_new(orig_width, orig_height);
 
3273
 
 
3274
    if (!self->obj) {
 
3275
        PyErr_SetString(PyExc_RuntimeError, "could not create GimpOffsetArea object");
 
3276
        return -1;
 
3277
    }
 
3278
    pygobject_register_wrapper((PyObject *)self);
 
3279
    return 0;
 
3280
}
 
3281
 
 
3282
static PyObject *
 
3283
_wrap_gimp_offset_area_set_pixbuf(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3284
{
 
3285
    static char *kwlist[] = { "pixbuf", NULL };
 
3286
    PyGObject *pixbuf;
 
3287
 
 
3288
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:GimpOffsetArea.set_pixbuf", kwlist, &PyGdkPixbuf_Type, &pixbuf))
 
3289
        return NULL;
 
3290
    
 
3291
    gimp_offset_area_set_pixbuf(GIMP_OFFSET_AREA(self->obj), GDK_PIXBUF(pixbuf->obj));
 
3292
    
 
3293
    Py_INCREF(Py_None);
 
3294
    return Py_None;
 
3295
}
 
3296
 
 
3297
static PyObject *
 
3298
_wrap_gimp_offset_area_set_size(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3299
{
 
3300
    static char *kwlist[] = { "width", "height", NULL };
 
3301
    int width, height;
 
3302
 
 
3303
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ii:GimpOffsetArea.set_size", kwlist, &width, &height))
 
3304
        return NULL;
 
3305
    
 
3306
    gimp_offset_area_set_size(GIMP_OFFSET_AREA(self->obj), width, height);
 
3307
    
 
3308
    Py_INCREF(Py_None);
 
3309
    return Py_None;
 
3310
}
 
3311
 
 
3312
static PyObject *
 
3313
_wrap_gimp_offset_area_set_offsets(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3314
{
 
3315
    static char *kwlist[] = { "offset_x", "offset_y", NULL };
 
3316
    int offset_x, offset_y;
 
3317
 
 
3318
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ii:GimpOffsetArea.set_offsets", kwlist, &offset_x, &offset_y))
 
3319
        return NULL;
 
3320
    
 
3321
    gimp_offset_area_set_offsets(GIMP_OFFSET_AREA(self->obj), offset_x, offset_y);
 
3322
    
 
3323
    Py_INCREF(Py_None);
 
3324
    return Py_None;
 
3325
}
 
3326
 
 
3327
static const PyMethodDef _PyGimpOffsetArea_methods[] = {
 
3328
    { "set_pixbuf", (PyCFunction)_wrap_gimp_offset_area_set_pixbuf, METH_VARARGS|METH_KEYWORDS,
 
3329
      NULL },
 
3330
    { "set_size", (PyCFunction)_wrap_gimp_offset_area_set_size, METH_VARARGS|METH_KEYWORDS,
 
3331
      NULL },
 
3332
    { "set_offsets", (PyCFunction)_wrap_gimp_offset_area_set_offsets, METH_VARARGS|METH_KEYWORDS,
 
3333
      NULL },
 
3334
    { NULL, NULL, 0, NULL }
 
3335
};
 
3336
 
 
3337
PyTypeObject G_GNUC_INTERNAL PyGimpOffsetArea_Type = {
 
3338
    PyObject_HEAD_INIT(NULL)
 
3339
    0,                                 /* ob_size */
 
3340
    "gimpui.OffsetArea",                   /* tp_name */
 
3341
    sizeof(PyGObject),          /* tp_basicsize */
 
3342
    0,                                 /* tp_itemsize */
 
3343
    /* methods */
 
3344
    (destructor)0,        /* tp_dealloc */
 
3345
    (printfunc)0,                      /* tp_print */
 
3346
    (getattrfunc)0,       /* tp_getattr */
 
3347
    (setattrfunc)0,       /* tp_setattr */
 
3348
    (cmpfunc)0,           /* tp_compare */
 
3349
    (reprfunc)0,             /* tp_repr */
 
3350
    (PyNumberMethods*)0,     /* tp_as_number */
 
3351
    (PySequenceMethods*)0, /* tp_as_sequence */
 
3352
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
3353
    (hashfunc)0,             /* tp_hash */
 
3354
    (ternaryfunc)0,          /* tp_call */
 
3355
    (reprfunc)0,              /* tp_str */
 
3356
    (getattrofunc)0,     /* tp_getattro */
 
3357
    (setattrofunc)0,     /* tp_setattro */
 
3358
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
3359
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
3360
    NULL,                        /* Documentation string */
 
3361
    (traverseproc)0,     /* tp_traverse */
 
3362
    (inquiry)0,             /* tp_clear */
 
3363
    (richcmpfunc)0,   /* tp_richcompare */
 
3364
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
3365
    (getiterfunc)0,          /* tp_iter */
 
3366
    (iternextfunc)0,     /* tp_iternext */
 
3367
    (struct PyMethodDef*)_PyGimpOffsetArea_methods, /* tp_methods */
 
3368
    (struct PyMemberDef*)0,              /* tp_members */
 
3369
    (struct PyGetSetDef*)0,  /* tp_getset */
 
3370
    NULL,                              /* tp_base */
 
3371
    NULL,                              /* tp_dict */
 
3372
    (descrgetfunc)0,    /* tp_descr_get */
 
3373
    (descrsetfunc)0,    /* tp_descr_set */
 
3374
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
3375
    (initproc)_wrap_gimp_offset_area_new,             /* tp_init */
 
3376
    (allocfunc)0,           /* tp_alloc */
 
3377
    (newfunc)0,               /* tp_new */
 
3378
    (freefunc)0,             /* tp_free */
 
3379
    (inquiry)0              /* tp_is_gc */
 
3380
};
 
3381
 
 
3382
 
 
3383
 
 
3384
/* ----------- GimpPageSelector ----------- */
 
3385
 
 
3386
static int
 
3387
_wrap_gimp_page_selector_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3388
{
 
3389
    static char* kwlist[] = { NULL };
 
3390
 
 
3391
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
3392
                                     ":gimpui.PageSelector.__init__",
 
3393
                                     kwlist))
 
3394
        return -1;
 
3395
 
 
3396
    pygobject_constructv(self, 0, NULL);
 
3397
    if (!self->obj) {
 
3398
        PyErr_SetString(
 
3399
            PyExc_RuntimeError, 
 
3400
            "could not create gimpui.PageSelector object");
 
3401
        return -1;
 
3402
    }
 
3403
    return 0;
 
3404
}
 
3405
 
 
3406
static PyObject *
 
3407
_wrap_gimp_page_selector_set_n_pages(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3408
{
 
3409
    static char *kwlist[] = { "n_pages", NULL };
 
3410
    int n_pages;
 
3411
 
 
3412
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpPageSelector.set_n_pages", kwlist, &n_pages))
 
3413
        return NULL;
 
3414
    
 
3415
    gimp_page_selector_set_n_pages(GIMP_PAGE_SELECTOR(self->obj), n_pages);
 
3416
    
 
3417
    Py_INCREF(Py_None);
 
3418
    return Py_None;
 
3419
}
 
3420
 
 
3421
static PyObject *
 
3422
_wrap_gimp_page_selector_get_n_pages(PyGObject *self)
 
3423
{
 
3424
    int ret;
 
3425
 
 
3426
    
 
3427
    ret = gimp_page_selector_get_n_pages(GIMP_PAGE_SELECTOR(self->obj));
 
3428
    
 
3429
    return PyInt_FromLong(ret);
 
3430
}
 
3431
 
 
3432
static PyObject *
 
3433
_wrap_gimp_page_selector_set_target(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3434
{
 
3435
    static char *kwlist[] = { "target", NULL };
 
3436
    GimpPageSelectorTarget target;
 
3437
    PyObject *py_target = NULL;
 
3438
 
 
3439
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpPageSelector.set_target", kwlist, &py_target))
 
3440
        return NULL;
 
3441
    if (pyg_enum_get_value(GIMP_TYPE_PAGE_SELECTOR_TARGET, py_target, (gpointer)&target))
 
3442
        return NULL;
 
3443
    
 
3444
    gimp_page_selector_set_target(GIMP_PAGE_SELECTOR(self->obj), target);
 
3445
    
 
3446
    Py_INCREF(Py_None);
 
3447
    return Py_None;
 
3448
}
 
3449
 
 
3450
static PyObject *
 
3451
_wrap_gimp_page_selector_get_target(PyGObject *self)
 
3452
{
 
3453
    gint ret;
 
3454
 
 
3455
    
 
3456
    ret = gimp_page_selector_get_target(GIMP_PAGE_SELECTOR(self->obj));
 
3457
    
 
3458
    return pyg_enum_from_gtype(GIMP_TYPE_PAGE_SELECTOR_TARGET, ret);
 
3459
}
 
3460
 
 
3461
static PyObject *
 
3462
_wrap_gimp_page_selector_set_page_thumbnail(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3463
{
 
3464
    static char *kwlist[] = { "page_no", "thumbnail", NULL };
 
3465
    int page_no;
 
3466
    PyGObject *thumbnail;
 
3467
 
 
3468
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"iO!:GimpPageSelector.set_page_thumbnail", kwlist, &page_no, &PyGdkPixbuf_Type, &thumbnail))
 
3469
        return NULL;
 
3470
    
 
3471
    gimp_page_selector_set_page_thumbnail(GIMP_PAGE_SELECTOR(self->obj), page_no, GDK_PIXBUF(thumbnail->obj));
 
3472
    
 
3473
    Py_INCREF(Py_None);
 
3474
    return Py_None;
 
3475
}
 
3476
 
 
3477
static PyObject *
 
3478
_wrap_gimp_page_selector_get_page_thumbnail(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3479
{
 
3480
    static char *kwlist[] = { "page_no", NULL };
 
3481
    int page_no;
 
3482
    GdkPixbuf *ret;
 
3483
 
 
3484
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpPageSelector.get_page_thumbnail", kwlist, &page_no))
 
3485
        return NULL;
 
3486
    
 
3487
    ret = gimp_page_selector_get_page_thumbnail(GIMP_PAGE_SELECTOR(self->obj), page_no);
 
3488
    
 
3489
    /* pygobject_new handles NULL checking */
 
3490
    return pygobject_new((GObject *)ret);
 
3491
}
 
3492
 
 
3493
static PyObject *
 
3494
_wrap_gimp_page_selector_set_page_label(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3495
{
 
3496
    static char *kwlist[] = { "page_no", "label", NULL };
 
3497
    int page_no;
 
3498
    char *label;
 
3499
 
 
3500
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"is:GimpPageSelector.set_page_label", kwlist, &page_no, &label))
 
3501
        return NULL;
 
3502
    
 
3503
    gimp_page_selector_set_page_label(GIMP_PAGE_SELECTOR(self->obj), page_no, label);
 
3504
    
 
3505
    Py_INCREF(Py_None);
 
3506
    return Py_None;
 
3507
}
 
3508
 
 
3509
static PyObject *
 
3510
_wrap_gimp_page_selector_get_page_label(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3511
{
 
3512
    static char *kwlist[] = { "page_no", NULL };
 
3513
    int page_no;
 
3514
    gchar *ret;
 
3515
 
 
3516
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpPageSelector.get_page_label", kwlist, &page_no))
 
3517
        return NULL;
 
3518
    
 
3519
    ret = gimp_page_selector_get_page_label(GIMP_PAGE_SELECTOR(self->obj), page_no);
 
3520
    
 
3521
    if (ret) {
 
3522
        PyObject *py_ret = PyString_FromString(ret);
 
3523
        g_free(ret);
 
3524
        return py_ret;
 
3525
    }
 
3526
    Py_INCREF(Py_None);
 
3527
    return Py_None;
 
3528
}
 
3529
 
 
3530
static PyObject *
 
3531
_wrap_gimp_page_selector_select_all(PyGObject *self)
 
3532
{
 
3533
    
 
3534
    gimp_page_selector_select_all(GIMP_PAGE_SELECTOR(self->obj));
 
3535
    
 
3536
    Py_INCREF(Py_None);
 
3537
    return Py_None;
 
3538
}
 
3539
 
 
3540
static PyObject *
 
3541
_wrap_gimp_page_selector_unselect_all(PyGObject *self)
 
3542
{
 
3543
    
 
3544
    gimp_page_selector_unselect_all(GIMP_PAGE_SELECTOR(self->obj));
 
3545
    
 
3546
    Py_INCREF(Py_None);
 
3547
    return Py_None;
 
3548
}
 
3549
 
 
3550
static PyObject *
 
3551
_wrap_gimp_page_selector_select_page(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3552
{
 
3553
    static char *kwlist[] = { "page_no", NULL };
 
3554
    int page_no;
 
3555
 
 
3556
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpPageSelector.select_page", kwlist, &page_no))
 
3557
        return NULL;
 
3558
    
 
3559
    gimp_page_selector_select_page(GIMP_PAGE_SELECTOR(self->obj), page_no);
 
3560
    
 
3561
    Py_INCREF(Py_None);
 
3562
    return Py_None;
 
3563
}
 
3564
 
 
3565
static PyObject *
 
3566
_wrap_gimp_page_selector_unselect_page(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3567
{
 
3568
    static char *kwlist[] = { "page_no", NULL };
 
3569
    int page_no;
 
3570
 
 
3571
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpPageSelector.unselect_page", kwlist, &page_no))
 
3572
        return NULL;
 
3573
    
 
3574
    gimp_page_selector_unselect_page(GIMP_PAGE_SELECTOR(self->obj), page_no);
 
3575
    
 
3576
    Py_INCREF(Py_None);
 
3577
    return Py_None;
 
3578
}
 
3579
 
 
3580
static PyObject *
 
3581
_wrap_gimp_page_selector_page_is_selected(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3582
{
 
3583
    static char *kwlist[] = { "page_no", NULL };
 
3584
    int page_no, ret;
 
3585
 
 
3586
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpPageSelector.page_is_selected", kwlist, &page_no))
 
3587
        return NULL;
 
3588
    
 
3589
    ret = gimp_page_selector_page_is_selected(GIMP_PAGE_SELECTOR(self->obj), page_no);
 
3590
    
 
3591
    return PyBool_FromLong(ret);
 
3592
 
 
3593
}
 
3594
 
 
3595
static PyObject *
 
3596
_wrap_gimp_page_selector_select_range(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3597
{
 
3598
    static char *kwlist[] = { "range", NULL };
 
3599
    char *range;
 
3600
 
 
3601
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpPageSelector.select_range", kwlist, &range))
 
3602
        return NULL;
 
3603
    
 
3604
    gimp_page_selector_select_range(GIMP_PAGE_SELECTOR(self->obj), range);
 
3605
    
 
3606
    Py_INCREF(Py_None);
 
3607
    return Py_None;
 
3608
}
 
3609
 
 
3610
static PyObject *
 
3611
_wrap_gimp_page_selector_get_selected_range(PyGObject *self)
 
3612
{
 
3613
    gchar *ret;
 
3614
 
 
3615
    
 
3616
    ret = gimp_page_selector_get_selected_range(GIMP_PAGE_SELECTOR(self->obj));
 
3617
    
 
3618
    if (ret) {
 
3619
        PyObject *py_ret = PyString_FromString(ret);
 
3620
        g_free(ret);
 
3621
        return py_ret;
 
3622
    }
 
3623
    Py_INCREF(Py_None);
 
3624
    return Py_None;
 
3625
}
 
3626
 
 
3627
static const PyMethodDef _PyGimpPageSelector_methods[] = {
 
3628
    { "set_n_pages", (PyCFunction)_wrap_gimp_page_selector_set_n_pages, METH_VARARGS|METH_KEYWORDS,
 
3629
      NULL },
 
3630
    { "get_n_pages", (PyCFunction)_wrap_gimp_page_selector_get_n_pages, METH_NOARGS,
 
3631
      NULL },
 
3632
    { "set_target", (PyCFunction)_wrap_gimp_page_selector_set_target, METH_VARARGS|METH_KEYWORDS,
 
3633
      NULL },
 
3634
    { "get_target", (PyCFunction)_wrap_gimp_page_selector_get_target, METH_NOARGS,
 
3635
      NULL },
 
3636
    { "set_page_thumbnail", (PyCFunction)_wrap_gimp_page_selector_set_page_thumbnail, METH_VARARGS|METH_KEYWORDS,
 
3637
      NULL },
 
3638
    { "get_page_thumbnail", (PyCFunction)_wrap_gimp_page_selector_get_page_thumbnail, METH_VARARGS|METH_KEYWORDS,
 
3639
      NULL },
 
3640
    { "set_page_label", (PyCFunction)_wrap_gimp_page_selector_set_page_label, METH_VARARGS|METH_KEYWORDS,
 
3641
      NULL },
 
3642
    { "get_page_label", (PyCFunction)_wrap_gimp_page_selector_get_page_label, METH_VARARGS|METH_KEYWORDS,
 
3643
      NULL },
 
3644
    { "select_all", (PyCFunction)_wrap_gimp_page_selector_select_all, METH_NOARGS,
 
3645
      NULL },
 
3646
    { "unselect_all", (PyCFunction)_wrap_gimp_page_selector_unselect_all, METH_NOARGS,
 
3647
      NULL },
 
3648
    { "select_page", (PyCFunction)_wrap_gimp_page_selector_select_page, METH_VARARGS|METH_KEYWORDS,
 
3649
      NULL },
 
3650
    { "unselect_page", (PyCFunction)_wrap_gimp_page_selector_unselect_page, METH_VARARGS|METH_KEYWORDS,
 
3651
      NULL },
 
3652
    { "page_is_selected", (PyCFunction)_wrap_gimp_page_selector_page_is_selected, METH_VARARGS|METH_KEYWORDS,
 
3653
      NULL },
 
3654
    { "select_range", (PyCFunction)_wrap_gimp_page_selector_select_range, METH_VARARGS|METH_KEYWORDS,
 
3655
      NULL },
 
3656
    { "get_selected_range", (PyCFunction)_wrap_gimp_page_selector_get_selected_range, METH_NOARGS,
 
3657
      NULL },
 
3658
    { NULL, NULL, 0, NULL }
 
3659
};
 
3660
 
 
3661
PyTypeObject G_GNUC_INTERNAL PyGimpPageSelector_Type = {
 
3662
    PyObject_HEAD_INIT(NULL)
 
3663
    0,                                 /* ob_size */
 
3664
    "gimpui.PageSelector",                   /* tp_name */
 
3665
    sizeof(PyGObject),          /* tp_basicsize */
 
3666
    0,                                 /* tp_itemsize */
 
3667
    /* methods */
 
3668
    (destructor)0,        /* tp_dealloc */
 
3669
    (printfunc)0,                      /* tp_print */
 
3670
    (getattrfunc)0,       /* tp_getattr */
 
3671
    (setattrfunc)0,       /* tp_setattr */
 
3672
    (cmpfunc)0,           /* tp_compare */
 
3673
    (reprfunc)0,             /* tp_repr */
 
3674
    (PyNumberMethods*)0,     /* tp_as_number */
 
3675
    (PySequenceMethods*)0, /* tp_as_sequence */
 
3676
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
3677
    (hashfunc)0,             /* tp_hash */
 
3678
    (ternaryfunc)0,          /* tp_call */
 
3679
    (reprfunc)0,              /* tp_str */
 
3680
    (getattrofunc)0,     /* tp_getattro */
 
3681
    (setattrofunc)0,     /* tp_setattro */
 
3682
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
3683
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
3684
    NULL,                        /* Documentation string */
 
3685
    (traverseproc)0,     /* tp_traverse */
 
3686
    (inquiry)0,             /* tp_clear */
 
3687
    (richcmpfunc)0,   /* tp_richcompare */
 
3688
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
3689
    (getiterfunc)0,          /* tp_iter */
 
3690
    (iternextfunc)0,     /* tp_iternext */
 
3691
    (struct PyMethodDef*)_PyGimpPageSelector_methods, /* tp_methods */
 
3692
    (struct PyMemberDef*)0,              /* tp_members */
 
3693
    (struct PyGetSetDef*)0,  /* tp_getset */
 
3694
    NULL,                              /* tp_base */
 
3695
    NULL,                              /* tp_dict */
 
3696
    (descrgetfunc)0,    /* tp_descr_get */
 
3697
    (descrsetfunc)0,    /* tp_descr_set */
 
3698
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
3699
    (initproc)_wrap_gimp_page_selector_new,             /* tp_init */
 
3700
    (allocfunc)0,           /* tp_alloc */
 
3701
    (newfunc)0,               /* tp_new */
 
3702
    (freefunc)0,             /* tp_free */
 
3703
    (inquiry)0              /* tp_is_gc */
 
3704
};
 
3705
 
 
3706
 
 
3707
 
 
3708
/* ----------- GimpPathEditor ----------- */
 
3709
 
 
3710
static int
 
3711
_wrap_gimp_path_editor_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3712
{
 
3713
    static char *kwlist[] = { "title", "path", NULL };
 
3714
    char *title, *path;
 
3715
 
 
3716
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ss:GimpPathEditor.__init__", kwlist, &title, &path))
 
3717
        return -1;
 
3718
    self->obj = (GObject *)gimp_path_editor_new(title, path);
 
3719
 
 
3720
    if (!self->obj) {
 
3721
        PyErr_SetString(PyExc_RuntimeError, "could not create GimpPathEditor object");
 
3722
        return -1;
 
3723
    }
 
3724
    pygobject_register_wrapper((PyObject *)self);
 
3725
    return 0;
 
3726
}
 
3727
 
 
3728
static PyObject *
 
3729
_wrap_gimp_path_editor_get_path(PyGObject *self)
 
3730
{
 
3731
    gchar *ret;
 
3732
 
 
3733
    
 
3734
    ret = gimp_path_editor_get_path(GIMP_PATH_EDITOR(self->obj));
 
3735
    
 
3736
    if (ret) {
 
3737
        PyObject *py_ret = PyString_FromString(ret);
 
3738
        g_free(ret);
 
3739
        return py_ret;
 
3740
    }
 
3741
    Py_INCREF(Py_None);
 
3742
    return Py_None;
 
3743
}
 
3744
 
 
3745
static PyObject *
 
3746
_wrap_gimp_path_editor_set_path(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3747
{
 
3748
    static char *kwlist[] = { "path", NULL };
 
3749
    char *path;
 
3750
 
 
3751
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpPathEditor.set_path", kwlist, &path))
 
3752
        return NULL;
 
3753
    
 
3754
    gimp_path_editor_set_path(GIMP_PATH_EDITOR(self->obj), path);
 
3755
    
 
3756
    Py_INCREF(Py_None);
 
3757
    return Py_None;
 
3758
}
 
3759
 
 
3760
static PyObject *
 
3761
_wrap_gimp_path_editor_get_writable_path(PyGObject *self)
 
3762
{
 
3763
    gchar *ret;
 
3764
 
 
3765
    
 
3766
    ret = gimp_path_editor_get_writable_path(GIMP_PATH_EDITOR(self->obj));
 
3767
    
 
3768
    if (ret) {
 
3769
        PyObject *py_ret = PyString_FromString(ret);
 
3770
        g_free(ret);
 
3771
        return py_ret;
 
3772
    }
 
3773
    Py_INCREF(Py_None);
 
3774
    return Py_None;
 
3775
}
 
3776
 
 
3777
static PyObject *
 
3778
_wrap_gimp_path_editor_set_writable_path(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3779
{
 
3780
    static char *kwlist[] = { "path", NULL };
 
3781
    char *path;
 
3782
 
 
3783
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpPathEditor.set_writable_path", kwlist, &path))
 
3784
        return NULL;
 
3785
    
 
3786
    gimp_path_editor_set_writable_path(GIMP_PATH_EDITOR(self->obj), path);
 
3787
    
 
3788
    Py_INCREF(Py_None);
 
3789
    return Py_None;
 
3790
}
 
3791
 
 
3792
static PyObject *
 
3793
_wrap_gimp_path_editor_get_dir_writable(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3794
{
 
3795
    static char *kwlist[] = { "directory", NULL };
 
3796
    char *directory;
 
3797
    int ret;
 
3798
 
 
3799
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpPathEditor.get_dir_writable", kwlist, &directory))
 
3800
        return NULL;
 
3801
    
 
3802
    ret = gimp_path_editor_get_dir_writable(GIMP_PATH_EDITOR(self->obj), directory);
 
3803
    
 
3804
    return PyBool_FromLong(ret);
 
3805
 
 
3806
}
 
3807
 
 
3808
static PyObject *
 
3809
_wrap_gimp_path_editor_set_dir_writable(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3810
{
 
3811
    static char *kwlist[] = { "directory", "writable", NULL };
 
3812
    char *directory;
 
3813
    int writable;
 
3814
 
 
3815
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"si:GimpPathEditor.set_dir_writable", kwlist, &directory, &writable))
 
3816
        return NULL;
 
3817
    
 
3818
    gimp_path_editor_set_dir_writable(GIMP_PATH_EDITOR(self->obj), directory, writable);
 
3819
    
 
3820
    Py_INCREF(Py_None);
 
3821
    return Py_None;
 
3822
}
 
3823
 
 
3824
static const PyMethodDef _PyGimpPathEditor_methods[] = {
 
3825
    { "get_path", (PyCFunction)_wrap_gimp_path_editor_get_path, METH_NOARGS,
 
3826
      NULL },
 
3827
    { "set_path", (PyCFunction)_wrap_gimp_path_editor_set_path, METH_VARARGS|METH_KEYWORDS,
 
3828
      NULL },
 
3829
    { "get_writable_path", (PyCFunction)_wrap_gimp_path_editor_get_writable_path, METH_NOARGS,
 
3830
      NULL },
 
3831
    { "set_writable_path", (PyCFunction)_wrap_gimp_path_editor_set_writable_path, METH_VARARGS|METH_KEYWORDS,
 
3832
      NULL },
 
3833
    { "get_dir_writable", (PyCFunction)_wrap_gimp_path_editor_get_dir_writable, METH_VARARGS|METH_KEYWORDS,
 
3834
      NULL },
 
3835
    { "set_dir_writable", (PyCFunction)_wrap_gimp_path_editor_set_dir_writable, METH_VARARGS|METH_KEYWORDS,
 
3836
      NULL },
 
3837
    { NULL, NULL, 0, NULL }
 
3838
};
 
3839
 
 
3840
PyTypeObject G_GNUC_INTERNAL PyGimpPathEditor_Type = {
 
3841
    PyObject_HEAD_INIT(NULL)
 
3842
    0,                                 /* ob_size */
 
3843
    "gimpui.PathEditor",                   /* tp_name */
 
3844
    sizeof(PyGObject),          /* tp_basicsize */
 
3845
    0,                                 /* tp_itemsize */
 
3846
    /* methods */
 
3847
    (destructor)0,        /* tp_dealloc */
 
3848
    (printfunc)0,                      /* tp_print */
 
3849
    (getattrfunc)0,       /* tp_getattr */
 
3850
    (setattrfunc)0,       /* tp_setattr */
 
3851
    (cmpfunc)0,           /* tp_compare */
 
3852
    (reprfunc)0,             /* tp_repr */
 
3853
    (PyNumberMethods*)0,     /* tp_as_number */
 
3854
    (PySequenceMethods*)0, /* tp_as_sequence */
 
3855
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
3856
    (hashfunc)0,             /* tp_hash */
 
3857
    (ternaryfunc)0,          /* tp_call */
 
3858
    (reprfunc)0,              /* tp_str */
 
3859
    (getattrofunc)0,     /* tp_getattro */
 
3860
    (setattrofunc)0,     /* tp_setattro */
 
3861
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
3862
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
3863
    NULL,                        /* Documentation string */
 
3864
    (traverseproc)0,     /* tp_traverse */
 
3865
    (inquiry)0,             /* tp_clear */
 
3866
    (richcmpfunc)0,   /* tp_richcompare */
 
3867
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
3868
    (getiterfunc)0,          /* tp_iter */
 
3869
    (iternextfunc)0,     /* tp_iternext */
 
3870
    (struct PyMethodDef*)_PyGimpPathEditor_methods, /* tp_methods */
 
3871
    (struct PyMemberDef*)0,              /* tp_members */
 
3872
    (struct PyGetSetDef*)0,  /* tp_getset */
 
3873
    NULL,                              /* tp_base */
 
3874
    NULL,                              /* tp_dict */
 
3875
    (descrgetfunc)0,    /* tp_descr_get */
 
3876
    (descrsetfunc)0,    /* tp_descr_set */
 
3877
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
3878
    (initproc)_wrap_gimp_path_editor_new,             /* tp_init */
 
3879
    (allocfunc)0,           /* tp_alloc */
 
3880
    (newfunc)0,               /* tp_new */
 
3881
    (freefunc)0,             /* tp_free */
 
3882
    (inquiry)0              /* tp_is_gc */
 
3883
};
 
3884
 
 
3885
 
 
3886
 
 
3887
/* ----------- GimpPickButton ----------- */
 
3888
 
 
3889
static int
 
3890
_wrap_gimp_pick_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3891
{
 
3892
    static char* kwlist[] = { NULL };
 
3893
 
 
3894
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
3895
                                     ":gimpui.PickButton.__init__",
 
3896
                                     kwlist))
 
3897
        return -1;
 
3898
 
 
3899
    pygobject_constructv(self, 0, NULL);
 
3900
    if (!self->obj) {
 
3901
        PyErr_SetString(
 
3902
            PyExc_RuntimeError, 
 
3903
            "could not create gimpui.PickButton object");
 
3904
        return -1;
 
3905
    }
 
3906
    return 0;
 
3907
}
 
3908
 
 
3909
PyTypeObject G_GNUC_INTERNAL PyGimpPickButton_Type = {
 
3910
    PyObject_HEAD_INIT(NULL)
 
3911
    0,                                 /* ob_size */
 
3912
    "gimpui.PickButton",                   /* tp_name */
 
3913
    sizeof(PyGObject),          /* tp_basicsize */
 
3914
    0,                                 /* tp_itemsize */
 
3915
    /* methods */
 
3916
    (destructor)0,        /* tp_dealloc */
 
3917
    (printfunc)0,                      /* tp_print */
 
3918
    (getattrfunc)0,       /* tp_getattr */
 
3919
    (setattrfunc)0,       /* tp_setattr */
 
3920
    (cmpfunc)0,           /* tp_compare */
 
3921
    (reprfunc)0,             /* tp_repr */
 
3922
    (PyNumberMethods*)0,     /* tp_as_number */
 
3923
    (PySequenceMethods*)0, /* tp_as_sequence */
 
3924
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
3925
    (hashfunc)0,             /* tp_hash */
 
3926
    (ternaryfunc)0,          /* tp_call */
 
3927
    (reprfunc)0,              /* tp_str */
 
3928
    (getattrofunc)0,     /* tp_getattro */
 
3929
    (setattrofunc)0,     /* tp_setattro */
 
3930
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
3931
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
3932
    NULL,                        /* Documentation string */
 
3933
    (traverseproc)0,     /* tp_traverse */
 
3934
    (inquiry)0,             /* tp_clear */
 
3935
    (richcmpfunc)0,   /* tp_richcompare */
 
3936
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
3937
    (getiterfunc)0,          /* tp_iter */
 
3938
    (iternextfunc)0,     /* tp_iternext */
 
3939
    (struct PyMethodDef*)NULL, /* tp_methods */
 
3940
    (struct PyMemberDef*)0,              /* tp_members */
 
3941
    (struct PyGetSetDef*)0,  /* tp_getset */
 
3942
    NULL,                              /* tp_base */
 
3943
    NULL,                              /* tp_dict */
 
3944
    (descrgetfunc)0,    /* tp_descr_get */
 
3945
    (descrsetfunc)0,    /* tp_descr_set */
 
3946
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
3947
    (initproc)_wrap_gimp_pick_button_new,             /* tp_init */
 
3948
    (allocfunc)0,           /* tp_alloc */
 
3949
    (newfunc)0,               /* tp_new */
 
3950
    (freefunc)0,             /* tp_free */
 
3951
    (inquiry)0              /* tp_is_gc */
 
3952
};
 
3953
 
 
3954
 
 
3955
 
 
3956
/* ----------- GimpPreview ----------- */
 
3957
 
 
3958
static PyObject *
 
3959
_wrap_gimp_preview_set_update(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3960
{
 
3961
    static char *kwlist[] = { "update", NULL };
 
3962
    int update;
 
3963
 
 
3964
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpPreview.set_update", kwlist, &update))
 
3965
        return NULL;
 
3966
    
 
3967
    gimp_preview_set_update(GIMP_PREVIEW(self->obj), update);
 
3968
    
 
3969
    Py_INCREF(Py_None);
 
3970
    return Py_None;
 
3971
}
 
3972
 
 
3973
static PyObject *
 
3974
_wrap_gimp_preview_get_update(PyGObject *self)
 
3975
{
 
3976
    int ret;
 
3977
 
 
3978
    
 
3979
    ret = gimp_preview_get_update(GIMP_PREVIEW(self->obj));
 
3980
    
 
3981
    return PyBool_FromLong(ret);
 
3982
 
 
3983
}
 
3984
 
 
3985
static PyObject *
 
3986
_wrap_gimp_preview_set_bounds(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3987
{
 
3988
    static char *kwlist[] = { "xmin", "ymin", "xmax", "ymax", NULL };
 
3989
    int xmin, ymin, xmax, ymax;
 
3990
 
 
3991
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"iiii:GimpPreview.set_bounds", kwlist, &xmin, &ymin, &xmax, &ymax))
 
3992
        return NULL;
 
3993
    
 
3994
    gimp_preview_set_bounds(GIMP_PREVIEW(self->obj), xmin, ymin, xmax, ymax);
 
3995
    
 
3996
    Py_INCREF(Py_None);
 
3997
    return Py_None;
 
3998
}
 
3999
 
 
4000
static PyObject *
 
4001
_wrap_gimp_preview_get_area(PyGObject *self)
 
4002
{
 
4003
    GtkWidget *ret;
 
4004
 
 
4005
    
 
4006
    ret = gimp_preview_get_area(GIMP_PREVIEW(self->obj));
 
4007
    
 
4008
    /* pygobject_new handles NULL checking */
 
4009
    return pygobject_new((GObject *)ret);
 
4010
}
 
4011
 
 
4012
static PyObject *
 
4013
_wrap_gimp_preview_draw(PyGObject *self)
 
4014
{
 
4015
    
 
4016
    gimp_preview_draw(GIMP_PREVIEW(self->obj));
 
4017
    
 
4018
    Py_INCREF(Py_None);
 
4019
    return Py_None;
 
4020
}
 
4021
 
 
4022
static PyObject *
 
4023
_wrap_gimp_preview_draw_buffer(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4024
{
 
4025
    static char *kwlist[] = { "buffer", "rowstride", NULL };
 
4026
    int buffer_len, rowstride;
 
4027
    guchar *buffer;
 
4028
 
 
4029
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s#i:GimpPreview.draw_buffer", kwlist, &buffer, &buffer_len, &rowstride))
 
4030
        return NULL;
 
4031
    
 
4032
    gimp_preview_draw_buffer(GIMP_PREVIEW(self->obj), buffer, rowstride);
 
4033
    
 
4034
    Py_INCREF(Py_None);
 
4035
    return Py_None;
 
4036
}
 
4037
 
 
4038
static PyObject *
 
4039
_wrap_gimp_preview_invalidate(PyGObject *self)
 
4040
{
 
4041
    
 
4042
    gimp_preview_invalidate(GIMP_PREVIEW(self->obj));
 
4043
    
 
4044
    Py_INCREF(Py_None);
 
4045
    return Py_None;
 
4046
}
 
4047
 
 
4048
static PyObject *
 
4049
_wrap_gimp_preview_set_default_cursor(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4050
{
 
4051
    static char *kwlist[] = { "cursor", NULL };
 
4052
    PyObject *py_cursor;
 
4053
    GdkCursor *cursor = NULL;
 
4054
 
 
4055
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpPreview.set_default_cursor", kwlist, &py_cursor))
 
4056
        return NULL;
 
4057
    if (pyg_boxed_check(py_cursor, GDK_TYPE_CURSOR))
 
4058
        cursor = pyg_boxed_get(py_cursor, GdkCursor);
 
4059
    else {
 
4060
        PyErr_SetString(PyExc_TypeError, "cursor should be a GdkCursor");
 
4061
        return NULL;
 
4062
    }
 
4063
    
 
4064
    gimp_preview_set_default_cursor(GIMP_PREVIEW(self->obj), cursor);
 
4065
    
 
4066
    Py_INCREF(Py_None);
 
4067
    return Py_None;
 
4068
}
 
4069
 
 
4070
static PyObject *
 
4071
_wrap_gimp_preview_get_controls(PyGObject *self)
 
4072
{
 
4073
    GtkWidget *ret;
 
4074
 
 
4075
    
 
4076
    ret = gimp_preview_get_controls(GIMP_PREVIEW(self->obj));
 
4077
    
 
4078
    /* pygobject_new handles NULL checking */
 
4079
    return pygobject_new((GObject *)ret);
 
4080
}
 
4081
 
 
4082
static const PyMethodDef _PyGimpPreview_methods[] = {
 
4083
    { "set_update", (PyCFunction)_wrap_gimp_preview_set_update, METH_VARARGS|METH_KEYWORDS,
 
4084
      NULL },
 
4085
    { "get_update", (PyCFunction)_wrap_gimp_preview_get_update, METH_NOARGS,
 
4086
      NULL },
 
4087
    { "set_bounds", (PyCFunction)_wrap_gimp_preview_set_bounds, METH_VARARGS|METH_KEYWORDS,
 
4088
      NULL },
 
4089
    { "get_area", (PyCFunction)_wrap_gimp_preview_get_area, METH_NOARGS,
 
4090
      NULL },
 
4091
    { "draw", (PyCFunction)_wrap_gimp_preview_draw, METH_NOARGS,
 
4092
      NULL },
 
4093
    { "draw_buffer", (PyCFunction)_wrap_gimp_preview_draw_buffer, METH_VARARGS|METH_KEYWORDS,
 
4094
      NULL },
 
4095
    { "invalidate", (PyCFunction)_wrap_gimp_preview_invalidate, METH_NOARGS,
 
4096
      NULL },
 
4097
    { "set_default_cursor", (PyCFunction)_wrap_gimp_preview_set_default_cursor, METH_VARARGS|METH_KEYWORDS,
 
4098
      NULL },
 
4099
    { "get_controls", (PyCFunction)_wrap_gimp_preview_get_controls, METH_NOARGS,
 
4100
      NULL },
 
4101
    { NULL, NULL, 0, NULL }
 
4102
};
 
4103
 
 
4104
PyTypeObject G_GNUC_INTERNAL PyGimpPreview_Type = {
 
4105
    PyObject_HEAD_INIT(NULL)
 
4106
    0,                                 /* ob_size */
 
4107
    "gimpui.Preview",                   /* tp_name */
 
4108
    sizeof(PyGObject),          /* tp_basicsize */
 
4109
    0,                                 /* tp_itemsize */
 
4110
    /* methods */
 
4111
    (destructor)0,        /* tp_dealloc */
 
4112
    (printfunc)0,                      /* tp_print */
 
4113
    (getattrfunc)0,       /* tp_getattr */
 
4114
    (setattrfunc)0,       /* tp_setattr */
 
4115
    (cmpfunc)0,           /* tp_compare */
 
4116
    (reprfunc)0,             /* tp_repr */
 
4117
    (PyNumberMethods*)0,     /* tp_as_number */
 
4118
    (PySequenceMethods*)0, /* tp_as_sequence */
 
4119
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
4120
    (hashfunc)0,             /* tp_hash */
 
4121
    (ternaryfunc)0,          /* tp_call */
 
4122
    (reprfunc)0,              /* tp_str */
 
4123
    (getattrofunc)0,     /* tp_getattro */
 
4124
    (setattrofunc)0,     /* tp_setattro */
 
4125
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
4126
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
4127
    NULL,                        /* Documentation string */
 
4128
    (traverseproc)0,     /* tp_traverse */
 
4129
    (inquiry)0,             /* tp_clear */
 
4130
    (richcmpfunc)0,   /* tp_richcompare */
 
4131
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
4132
    (getiterfunc)0,          /* tp_iter */
 
4133
    (iternextfunc)0,     /* tp_iternext */
 
4134
    (struct PyMethodDef*)_PyGimpPreview_methods, /* tp_methods */
 
4135
    (struct PyMemberDef*)0,              /* tp_members */
 
4136
    (struct PyGetSetDef*)0,  /* tp_getset */
 
4137
    NULL,                              /* tp_base */
 
4138
    NULL,                              /* tp_dict */
 
4139
    (descrgetfunc)0,    /* tp_descr_get */
 
4140
    (descrsetfunc)0,    /* tp_descr_set */
 
4141
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
4142
    (initproc)0,             /* tp_init */
 
4143
    (allocfunc)0,           /* tp_alloc */
 
4144
    (newfunc)0,               /* tp_new */
 
4145
    (freefunc)0,             /* tp_free */
 
4146
    (inquiry)0              /* tp_is_gc */
 
4147
};
 
4148
 
 
4149
 
 
4150
 
 
4151
/* ----------- GimpAspectPreview ----------- */
 
4152
 
 
4153
static int
 
4154
_wrap_gimp_aspect_preview_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4155
{
 
4156
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
4157
    GParameter params[1];
 
4158
    PyObject *parsed_args[1] = {NULL, };
 
4159
    char *arg_names[] = {"drawable", NULL };
 
4160
    char *prop_names[] = {"drawable", NULL };
 
4161
    guint nparams, i;
 
4162
 
 
4163
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gimpui.AspectPreview.__init__" , arg_names , &parsed_args[0]))
 
4164
        return -1;
 
4165
 
 
4166
    memset(params, 0, sizeof(GParameter)*1);
 
4167
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
4168
                                    prop_names, params, 
 
4169
                                    &nparams, parsed_args))
 
4170
        return -1;
 
4171
    pygobject_constructv(self, nparams, params);
 
4172
    for (i = 0; i < nparams; ++i)
 
4173
        g_value_unset(&params[i].value);
 
4174
    if (!self->obj) {
 
4175
        PyErr_SetString(
 
4176
            PyExc_RuntimeError, 
 
4177
            "could not create gimpui.AspectPreview object");
 
4178
        return -1;
 
4179
    }
 
4180
    return 0;
 
4181
}
 
4182
 
 
4183
PyTypeObject G_GNUC_INTERNAL PyGimpAspectPreview_Type = {
 
4184
    PyObject_HEAD_INIT(NULL)
 
4185
    0,                                 /* ob_size */
 
4186
    "gimpui.AspectPreview",                   /* tp_name */
 
4187
    sizeof(PyGObject),          /* tp_basicsize */
 
4188
    0,                                 /* tp_itemsize */
 
4189
    /* methods */
 
4190
    (destructor)0,        /* tp_dealloc */
 
4191
    (printfunc)0,                      /* tp_print */
 
4192
    (getattrfunc)0,       /* tp_getattr */
 
4193
    (setattrfunc)0,       /* tp_setattr */
 
4194
    (cmpfunc)0,           /* tp_compare */
 
4195
    (reprfunc)0,             /* tp_repr */
 
4196
    (PyNumberMethods*)0,     /* tp_as_number */
 
4197
    (PySequenceMethods*)0, /* tp_as_sequence */
 
4198
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
4199
    (hashfunc)0,             /* tp_hash */
 
4200
    (ternaryfunc)0,          /* tp_call */
 
4201
    (reprfunc)0,              /* tp_str */
 
4202
    (getattrofunc)0,     /* tp_getattro */
 
4203
    (setattrofunc)0,     /* tp_setattro */
 
4204
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
4205
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
4206
    NULL,                        /* Documentation string */
 
4207
    (traverseproc)0,     /* tp_traverse */
 
4208
    (inquiry)0,             /* tp_clear */
 
4209
    (richcmpfunc)0,   /* tp_richcompare */
 
4210
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
4211
    (getiterfunc)0,          /* tp_iter */
 
4212
    (iternextfunc)0,     /* tp_iternext */
 
4213
    (struct PyMethodDef*)NULL, /* tp_methods */
 
4214
    (struct PyMemberDef*)0,              /* tp_members */
 
4215
    (struct PyGetSetDef*)0,  /* tp_getset */
 
4216
    NULL,                              /* tp_base */
 
4217
    NULL,                              /* tp_dict */
 
4218
    (descrgetfunc)0,    /* tp_descr_get */
 
4219
    (descrsetfunc)0,    /* tp_descr_set */
 
4220
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
4221
    (initproc)_wrap_gimp_aspect_preview_new,             /* tp_init */
 
4222
    (allocfunc)0,           /* tp_alloc */
 
4223
    (newfunc)0,               /* tp_new */
 
4224
    (freefunc)0,             /* tp_free */
 
4225
    (inquiry)0              /* tp_is_gc */
 
4226
};
 
4227
 
 
4228
 
 
4229
 
 
4230
/* ----------- GimpPreviewArea ----------- */
 
4231
 
 
4232
 static int
 
4233
_wrap_gimp_preview_area_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4234
{
 
4235
    static char* kwlist[] = { NULL };
 
4236
 
 
4237
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
4238
                                     ":gimpui.PreviewArea.__init__",
 
4239
                                     kwlist))
 
4240
        return -1;
 
4241
 
 
4242
    pygobject_constructv(self, 0, NULL);
 
4243
    if (!self->obj) {
 
4244
        PyErr_SetString(
 
4245
            PyExc_RuntimeError, 
 
4246
            "could not create gimpui.PreviewArea object");
 
4247
        return -1;
 
4248
    }
 
4249
    return 0;
 
4250
}
 
4251
 
 
4252
static PyObject *
 
4253
_wrap_gimp_preview_area_fill(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4254
{
 
4255
    static char *kwlist[] = { "x", "y", "width", "height", "red", "green", "blue", NULL };
 
4256
    int x, y, width, height;
 
4257
    char red, green, blue;
 
4258
 
 
4259
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"iiiiccc:GimpPreviewArea.fill", kwlist, &x, &y, &width, &height, &red, &green, &blue))
 
4260
        return NULL;
 
4261
    
 
4262
    gimp_preview_area_fill(GIMP_PREVIEW_AREA(self->obj), x, y, width, height, red, green, blue);
 
4263
    
 
4264
    Py_INCREF(Py_None);
 
4265
    return Py_None;
 
4266
}
 
4267
 
 
4268
static PyObject *
 
4269
_wrap_gimp_preview_area_set_offsets(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4270
{
 
4271
    static char *kwlist[] = { "x", "y", NULL };
 
4272
    int x, y;
 
4273
 
 
4274
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ii:GimpPreviewArea.set_offsets", kwlist, &x, &y))
 
4275
        return NULL;
 
4276
    
 
4277
    gimp_preview_area_set_offsets(GIMP_PREVIEW_AREA(self->obj), x, y);
 
4278
    
 
4279
    Py_INCREF(Py_None);
 
4280
    return Py_None;
 
4281
}
 
4282
 
 
4283
static PyObject *
 
4284
_wrap_gimp_preview_area_set_colormap(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4285
{
 
4286
    static char *kwlist[] = { "colormap", "num_colors", NULL };
 
4287
    int colormap_len, num_colors;
 
4288
    guchar *colormap;
 
4289
 
 
4290
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s#i:GimpPreviewArea.set_colormap", kwlist, &colormap, &colormap_len, &num_colors))
 
4291
        return NULL;
 
4292
    
 
4293
    gimp_preview_area_set_colormap(GIMP_PREVIEW_AREA(self->obj), colormap, num_colors);
 
4294
    
 
4295
    Py_INCREF(Py_None);
 
4296
    return Py_None;
 
4297
}
 
4298
 
 
4299
static PyObject *
 
4300
_wrap_gimp_preview_area_set_max_size(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4301
{
 
4302
    static char *kwlist[] = { "width", "height", NULL };
 
4303
    int width, height;
 
4304
 
 
4305
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ii:GimpPreviewArea.set_max_size", kwlist, &width, &height))
 
4306
        return NULL;
 
4307
    
 
4308
    gimp_preview_area_set_max_size(GIMP_PREVIEW_AREA(self->obj), width, height);
 
4309
    
 
4310
    Py_INCREF(Py_None);
 
4311
    return Py_None;
 
4312
}
 
4313
 
 
4314
static PyObject *
 
4315
_wrap_gimp_preview_area_menu_popup(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4316
{
 
4317
    static char *kwlist[] = { "event", NULL };
 
4318
    GdkEvent *event = NULL;
 
4319
    PyObject *py_event;
 
4320
 
 
4321
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GimpPreviewArea.menu_popup", kwlist, &py_event))
 
4322
        return NULL;
 
4323
    if (pyg_boxed_check(py_event, GDK_TYPE_EVENT))
 
4324
        event = pyg_boxed_get(py_event, GdkEvent);
 
4325
    else {
 
4326
        PyErr_SetString(PyExc_TypeError, "event should be a GdkEvent");
 
4327
        return NULL;
 
4328
    }
 
4329
    
 
4330
    gimp_preview_area_menu_popup(GIMP_PREVIEW_AREA(self->obj), (GdkEventButton *)event);
 
4331
    
 
4332
    Py_INCREF(Py_None);
 
4333
    return Py_None;
 
4334
}
 
4335
 
 
4336
static const PyMethodDef _PyGimpPreviewArea_methods[] = {
 
4337
    { "fill", (PyCFunction)_wrap_gimp_preview_area_fill, METH_VARARGS|METH_KEYWORDS,
 
4338
      NULL },
 
4339
    { "set_offsets", (PyCFunction)_wrap_gimp_preview_area_set_offsets, METH_VARARGS|METH_KEYWORDS,
 
4340
      NULL },
 
4341
    { "set_colormap", (PyCFunction)_wrap_gimp_preview_area_set_colormap, METH_VARARGS|METH_KEYWORDS,
 
4342
      NULL },
 
4343
    { "set_max_size", (PyCFunction)_wrap_gimp_preview_area_set_max_size, METH_VARARGS|METH_KEYWORDS,
 
4344
      NULL },
 
4345
    { "menu_popup", (PyCFunction)_wrap_gimp_preview_area_menu_popup, METH_VARARGS|METH_KEYWORDS,
 
4346
      NULL },
 
4347
    { NULL, NULL, 0, NULL }
 
4348
};
 
4349
 
 
4350
PyTypeObject G_GNUC_INTERNAL PyGimpPreviewArea_Type = {
 
4351
    PyObject_HEAD_INIT(NULL)
 
4352
    0,                                 /* ob_size */
 
4353
    "gimpui.PreviewArea",                   /* tp_name */
 
4354
    sizeof(PyGObject),          /* tp_basicsize */
 
4355
    0,                                 /* tp_itemsize */
 
4356
    /* methods */
 
4357
    (destructor)0,        /* tp_dealloc */
 
4358
    (printfunc)0,                      /* tp_print */
 
4359
    (getattrfunc)0,       /* tp_getattr */
 
4360
    (setattrfunc)0,       /* tp_setattr */
 
4361
    (cmpfunc)0,           /* tp_compare */
 
4362
    (reprfunc)0,             /* tp_repr */
 
4363
    (PyNumberMethods*)0,     /* tp_as_number */
 
4364
    (PySequenceMethods*)0, /* tp_as_sequence */
 
4365
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
4366
    (hashfunc)0,             /* tp_hash */
 
4367
    (ternaryfunc)0,          /* tp_call */
 
4368
    (reprfunc)0,              /* tp_str */
 
4369
    (getattrofunc)0,     /* tp_getattro */
 
4370
    (setattrofunc)0,     /* tp_setattro */
 
4371
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
4372
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
4373
    NULL,                        /* Documentation string */
 
4374
    (traverseproc)0,     /* tp_traverse */
 
4375
    (inquiry)0,             /* tp_clear */
 
4376
    (richcmpfunc)0,   /* tp_richcompare */
 
4377
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
4378
    (getiterfunc)0,          /* tp_iter */
 
4379
    (iternextfunc)0,     /* tp_iternext */
 
4380
    (struct PyMethodDef*)_PyGimpPreviewArea_methods, /* tp_methods */
 
4381
    (struct PyMemberDef*)0,              /* tp_members */
 
4382
    (struct PyGetSetDef*)0,  /* tp_getset */
 
4383
    NULL,                              /* tp_base */
 
4384
    NULL,                              /* tp_dict */
 
4385
    (descrgetfunc)0,    /* tp_descr_get */
 
4386
    (descrsetfunc)0,    /* tp_descr_set */
 
4387
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
4388
    (initproc)_wrap_gimp_preview_area_new,             /* tp_init */
 
4389
    (allocfunc)0,           /* tp_alloc */
 
4390
    (newfunc)0,               /* tp_new */
 
4391
    (freefunc)0,             /* tp_free */
 
4392
    (inquiry)0              /* tp_is_gc */
 
4393
};
 
4394
 
 
4395
 
 
4396
 
 
4397
/* ----------- GimpProcBrowserDialog ----------- */
 
4398
 
 
4399
#line 1191 "gimpui.override"
 
4400
static int
 
4401
_wrap_gimp_proc_browser_dialog_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4402
{
 
4403
    gchar *title, *role;
 
4404
    PyObject *py_buttons = Py_None;
 
4405
    PyObject *help_func = NULL;
 
4406
    gchar *help_id = NULL;
 
4407
    int len, i;
 
4408
    GimpHelpFunc func;
 
4409
 
 
4410
    static char *kwlist[] = { "title", "role", "help_func", "help_id",
 
4411
                              "buttons", NULL };
 
4412
 
 
4413
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
4414
                                     "zz|OzO:gimpui.GimpProcBrowserDialog.__init__",
 
4415
                                     kwlist,
 
4416
                                     &title, &role, &help_func, &help_id,
 
4417
                                     &py_buttons))
 
4418
        return -1;
 
4419
 
 
4420
    if (help_func) {
 
4421
        if (help_func != Py_None) {
 
4422
            if (!PyCallable_Check(help_func)) {
 
4423
                PyErr_SetString(PyExc_TypeError, "help_func must be callable");
 
4424
                return -1;
 
4425
            }
 
4426
 
 
4427
            func = pygimp_help_func_marshal;
 
4428
 
 
4429
            g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
 
4430
 
 
4431
            Py_INCREF(help_func);
 
4432
            g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
 
4433
                                   help_func, pygimp_help_func_destroy);
 
4434
        } else {
 
4435
            func = gimp_standard_help_func;
 
4436
        }
 
4437
    } else {
 
4438
        func = gimp_standard_help_func;
 
4439
    }
 
4440
 
 
4441
    if (py_buttons == Py_None)
 
4442
        len = 0;
 
4443
    else if (PyTuple_Check(py_buttons))
 
4444
        len = PyTuple_Size(py_buttons);
 
4445
    else {
 
4446
        PyErr_SetString(PyExc_TypeError, "buttons must be a tuple containing text/response pairs or None");
 
4447
        return -1;
 
4448
    }
 
4449
 
 
4450
    if (len % 2) {
 
4451
        PyErr_SetString(PyExc_RuntimeError,
 
4452
                        "buttons tuple must contain text/response id pairs");
 
4453
        return -1;
 
4454
    }
 
4455
 
 
4456
    pygobject_construct(self,
 
4457
                        "title",     title,
 
4458
                        "role",      role,
 
4459
                        "help-func", func,
 
4460
                        "help-id",   help_id,
 
4461
                        NULL);
 
4462
 
 
4463
    if (!self->obj) {
 
4464
        PyErr_SetString(PyExc_RuntimeError,
 
4465
                        "could not create GimpProcBrowserDialog object");
 
4466
        return -1;
 
4467
    }
 
4468
 
 
4469
    for (i = 0; i < len; i += 2) {
 
4470
        PyObject *text = PyTuple_GetItem(py_buttons, i);
 
4471
        PyObject *id = PyTuple_GetItem(py_buttons, i + 1);
 
4472
        if (!PyString_Check(text) && !PyUnicode_Check(text)) {
 
4473
            gtk_object_destroy(GTK_OBJECT(self->obj));
 
4474
            self->obj = NULL;
 
4475
            PyErr_SetString(PyExc_RuntimeError,
 
4476
                            "first member of each text/response id pair "
 
4477
                            "must be a string");
 
4478
            return -1;
 
4479
        }
 
4480
        if (!PyInt_Check(id)) {
 
4481
            gtk_object_destroy(GTK_OBJECT(self->obj));
 
4482
            self->obj = NULL;
 
4483
            PyErr_SetString(PyExc_RuntimeError,
 
4484
                            "second member of each text/response id pair "
 
4485
                            "must be a number");
 
4486
            return -1;
 
4487
        }
 
4488
 
 
4489
        gimp_dialog_add_button(GIMP_DIALOG(self->obj), PyString_AsString(text),
 
4490
                               PyInt_AsLong(id));
 
4491
    }
 
4492
 
 
4493
    g_signal_emit_by_name(GIMP_PROC_BROWSER_DIALOG(self->obj)->browser,
 
4494
                          "search", "", 0, self->obj);
 
4495
    return 0;
 
4496
}
 
4497
#line 4498 "gimpui.c"
 
4498
 
 
4499
 
 
4500
static PyObject *
 
4501
_wrap_gimp_proc_browser_dialog_get_selected(PyGObject *self)
 
4502
{
 
4503
    gchar *ret;
 
4504
 
 
4505
    
 
4506
    ret = gimp_proc_browser_dialog_get_selected(GIMP_PROC_BROWSER_DIALOG(self->obj));
 
4507
    
 
4508
    if (ret) {
 
4509
        PyObject *py_ret = PyString_FromString(ret);
 
4510
        g_free(ret);
 
4511
        return py_ret;
 
4512
    }
 
4513
    Py_INCREF(Py_None);
 
4514
    return Py_None;
 
4515
}
 
4516
 
 
4517
static const PyMethodDef _PyGimpProcBrowserDialog_methods[] = {
 
4518
    { "get_selected", (PyCFunction)_wrap_gimp_proc_browser_dialog_get_selected, METH_NOARGS,
 
4519
      NULL },
 
4520
    { NULL, NULL, 0, NULL }
 
4521
};
 
4522
 
 
4523
PyTypeObject G_GNUC_INTERNAL PyGimpProcBrowserDialog_Type = {
 
4524
    PyObject_HEAD_INIT(NULL)
 
4525
    0,                                 /* ob_size */
 
4526
    "gimpui.ProcBrowserDialog",                   /* tp_name */
 
4527
    sizeof(PyGObject),          /* tp_basicsize */
 
4528
    0,                                 /* tp_itemsize */
 
4529
    /* methods */
 
4530
    (destructor)0,        /* tp_dealloc */
 
4531
    (printfunc)0,                      /* tp_print */
 
4532
    (getattrfunc)0,       /* tp_getattr */
 
4533
    (setattrfunc)0,       /* tp_setattr */
 
4534
    (cmpfunc)0,           /* tp_compare */
 
4535
    (reprfunc)0,             /* tp_repr */
 
4536
    (PyNumberMethods*)0,     /* tp_as_number */
 
4537
    (PySequenceMethods*)0, /* tp_as_sequence */
 
4538
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
4539
    (hashfunc)0,             /* tp_hash */
 
4540
    (ternaryfunc)0,          /* tp_call */
 
4541
    (reprfunc)0,              /* tp_str */
 
4542
    (getattrofunc)0,     /* tp_getattro */
 
4543
    (setattrofunc)0,     /* tp_setattro */
 
4544
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
4545
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
4546
    NULL,                        /* Documentation string */
 
4547
    (traverseproc)0,     /* tp_traverse */
 
4548
    (inquiry)0,             /* tp_clear */
 
4549
    (richcmpfunc)0,   /* tp_richcompare */
 
4550
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
4551
    (getiterfunc)0,          /* tp_iter */
 
4552
    (iternextfunc)0,     /* tp_iternext */
 
4553
    (struct PyMethodDef*)_PyGimpProcBrowserDialog_methods, /* tp_methods */
 
4554
    (struct PyMemberDef*)0,              /* tp_members */
 
4555
    (struct PyGetSetDef*)0,  /* tp_getset */
 
4556
    NULL,                              /* tp_base */
 
4557
    NULL,                              /* tp_dict */
 
4558
    (descrgetfunc)0,    /* tp_descr_get */
 
4559
    (descrsetfunc)0,    /* tp_descr_set */
 
4560
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
4561
    (initproc)_wrap_gimp_proc_browser_dialog_new,             /* tp_init */
 
4562
    (allocfunc)0,           /* tp_alloc */
 
4563
    (newfunc)0,               /* tp_new */
 
4564
    (freefunc)0,             /* tp_free */
 
4565
    (inquiry)0              /* tp_is_gc */
 
4566
};
 
4567
 
 
4568
 
 
4569
 
 
4570
/* ----------- GimpProgressBar ----------- */
 
4571
 
 
4572
static int
 
4573
_wrap_gimp_progress_bar_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4574
{
 
4575
    static char* kwlist[] = { NULL };
 
4576
 
 
4577
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
4578
                                     ":gimpui.ProgressBar.__init__",
 
4579
                                     kwlist))
 
4580
        return -1;
 
4581
 
 
4582
    pygobject_constructv(self, 0, NULL);
 
4583
    if (!self->obj) {
 
4584
        PyErr_SetString(
 
4585
            PyExc_RuntimeError, 
 
4586
            "could not create gimpui.ProgressBar object");
 
4587
        return -1;
 
4588
    }
 
4589
    return 0;
 
4590
}
 
4591
 
 
4592
PyTypeObject G_GNUC_INTERNAL PyGimpProgressBar_Type = {
 
4593
    PyObject_HEAD_INIT(NULL)
 
4594
    0,                                 /* ob_size */
 
4595
    "gimpui.ProgressBar",                   /* tp_name */
 
4596
    sizeof(PyGObject),          /* tp_basicsize */
 
4597
    0,                                 /* tp_itemsize */
 
4598
    /* methods */
 
4599
    (destructor)0,        /* tp_dealloc */
 
4600
    (printfunc)0,                      /* tp_print */
 
4601
    (getattrfunc)0,       /* tp_getattr */
 
4602
    (setattrfunc)0,       /* tp_setattr */
 
4603
    (cmpfunc)0,           /* tp_compare */
 
4604
    (reprfunc)0,             /* tp_repr */
 
4605
    (PyNumberMethods*)0,     /* tp_as_number */
 
4606
    (PySequenceMethods*)0, /* tp_as_sequence */
 
4607
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
4608
    (hashfunc)0,             /* tp_hash */
 
4609
    (ternaryfunc)0,          /* tp_call */
 
4610
    (reprfunc)0,              /* tp_str */
 
4611
    (getattrofunc)0,     /* tp_getattro */
 
4612
    (setattrofunc)0,     /* tp_setattro */
 
4613
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
4614
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
4615
    NULL,                        /* Documentation string */
 
4616
    (traverseproc)0,     /* tp_traverse */
 
4617
    (inquiry)0,             /* tp_clear */
 
4618
    (richcmpfunc)0,   /* tp_richcompare */
 
4619
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
4620
    (getiterfunc)0,          /* tp_iter */
 
4621
    (iternextfunc)0,     /* tp_iternext */
 
4622
    (struct PyMethodDef*)NULL, /* tp_methods */
 
4623
    (struct PyMemberDef*)0,              /* tp_members */
 
4624
    (struct PyGetSetDef*)0,  /* tp_getset */
 
4625
    NULL,                              /* tp_base */
 
4626
    NULL,                              /* tp_dict */
 
4627
    (descrgetfunc)0,    /* tp_descr_get */
 
4628
    (descrsetfunc)0,    /* tp_descr_set */
 
4629
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
4630
    (initproc)_wrap_gimp_progress_bar_new,             /* tp_init */
 
4631
    (allocfunc)0,           /* tp_alloc */
 
4632
    (newfunc)0,               /* tp_new */
 
4633
    (freefunc)0,             /* tp_free */
 
4634
    (inquiry)0              /* tp_is_gc */
 
4635
};
 
4636
 
 
4637
 
 
4638
 
 
4639
/* ----------- GimpResolutionEntry ----------- */
 
4640
 
 
4641
PyTypeObject G_GNUC_INTERNAL PyGimpResolutionEntry_Type = {
 
4642
    PyObject_HEAD_INIT(NULL)
 
4643
    0,                                 /* ob_size */
 
4644
    "gimpui.ResolutionEntry",                   /* tp_name */
 
4645
    sizeof(PyGObject),          /* tp_basicsize */
 
4646
    0,                                 /* tp_itemsize */
 
4647
    /* methods */
 
4648
    (destructor)0,        /* tp_dealloc */
 
4649
    (printfunc)0,                      /* tp_print */
 
4650
    (getattrfunc)0,       /* tp_getattr */
 
4651
    (setattrfunc)0,       /* tp_setattr */
 
4652
    (cmpfunc)0,           /* tp_compare */
 
4653
    (reprfunc)0,             /* tp_repr */
 
4654
    (PyNumberMethods*)0,     /* tp_as_number */
 
4655
    (PySequenceMethods*)0, /* tp_as_sequence */
 
4656
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
4657
    (hashfunc)0,             /* tp_hash */
 
4658
    (ternaryfunc)0,          /* tp_call */
 
4659
    (reprfunc)0,              /* tp_str */
 
4660
    (getattrofunc)0,     /* tp_getattro */
 
4661
    (setattrofunc)0,     /* tp_setattro */
 
4662
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
4663
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
4664
    NULL,                        /* Documentation string */
 
4665
    (traverseproc)0,     /* tp_traverse */
 
4666
    (inquiry)0,             /* tp_clear */
 
4667
    (richcmpfunc)0,   /* tp_richcompare */
 
4668
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
4669
    (getiterfunc)0,          /* tp_iter */
 
4670
    (iternextfunc)0,     /* tp_iternext */
 
4671
    (struct PyMethodDef*)NULL, /* tp_methods */
 
4672
    (struct PyMemberDef*)0,              /* tp_members */
 
4673
    (struct PyGetSetDef*)0,  /* tp_getset */
 
4674
    NULL,                              /* tp_base */
 
4675
    NULL,                              /* tp_dict */
 
4676
    (descrgetfunc)0,    /* tp_descr_get */
 
4677
    (descrsetfunc)0,    /* tp_descr_set */
 
4678
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
4679
    (initproc)0,             /* tp_init */
 
4680
    (allocfunc)0,           /* tp_alloc */
 
4681
    (newfunc)0,               /* tp_new */
 
4682
    (freefunc)0,             /* tp_free */
 
4683
    (inquiry)0              /* tp_is_gc */
 
4684
};
 
4685
 
 
4686
 
 
4687
 
 
4688
/* ----------- GimpScrolledPreview ----------- */
 
4689
 
 
4690
static PyObject *
 
4691
_wrap_gimp_scrolled_preview_set_position(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4692
{
 
4693
    static char *kwlist[] = { "x", "y", NULL };
 
4694
    int x, y;
 
4695
 
 
4696
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ii:GimpScrolledPreview.set_position", kwlist, &x, &y))
 
4697
        return NULL;
 
4698
    
 
4699
    gimp_scrolled_preview_set_position(GIMP_SCROLLED_PREVIEW(self->obj), x, y);
 
4700
    
 
4701
    Py_INCREF(Py_None);
 
4702
    return Py_None;
 
4703
}
 
4704
 
 
4705
static PyObject *
 
4706
_wrap_gimp_scrolled_preview_set_policy(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4707
{
 
4708
    static char *kwlist[] = { "hscrollbar_policy", "vscrollbar_policy", NULL };
 
4709
    PyObject *py_hscrollbar_policy = NULL, *py_vscrollbar_policy = NULL;
 
4710
    GtkPolicyType hscrollbar_policy, vscrollbar_policy;
 
4711
 
 
4712
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"OO:GimpScrolledPreview.set_policy", kwlist, &py_hscrollbar_policy, &py_vscrollbar_policy))
 
4713
        return NULL;
 
4714
    if (pyg_enum_get_value(GTK_TYPE_POLICY_TYPE, py_hscrollbar_policy, (gpointer)&hscrollbar_policy))
 
4715
        return NULL;
 
4716
    if (pyg_enum_get_value(GTK_TYPE_POLICY_TYPE, py_vscrollbar_policy, (gpointer)&vscrollbar_policy))
 
4717
        return NULL;
 
4718
    
 
4719
    gimp_scrolled_preview_set_policy(GIMP_SCROLLED_PREVIEW(self->obj), hscrollbar_policy, vscrollbar_policy);
 
4720
    
 
4721
    Py_INCREF(Py_None);
 
4722
    return Py_None;
 
4723
}
 
4724
 
 
4725
static PyObject *
 
4726
_wrap_gimp_scrolled_preview_freeze(PyGObject *self)
 
4727
{
 
4728
    
 
4729
    gimp_scrolled_preview_freeze(GIMP_SCROLLED_PREVIEW(self->obj));
 
4730
    
 
4731
    Py_INCREF(Py_None);
 
4732
    return Py_None;
 
4733
}
 
4734
 
 
4735
static PyObject *
 
4736
_wrap_gimp_scrolled_preview_thaw(PyGObject *self)
 
4737
{
 
4738
    
 
4739
    gimp_scrolled_preview_thaw(GIMP_SCROLLED_PREVIEW(self->obj));
 
4740
    
 
4741
    Py_INCREF(Py_None);
 
4742
    return Py_None;
 
4743
}
 
4744
 
 
4745
static const PyMethodDef _PyGimpScrolledPreview_methods[] = {
 
4746
    { "set_position", (PyCFunction)_wrap_gimp_scrolled_preview_set_position, METH_VARARGS|METH_KEYWORDS,
 
4747
      NULL },
 
4748
    { "set_policy", (PyCFunction)_wrap_gimp_scrolled_preview_set_policy, METH_VARARGS|METH_KEYWORDS,
 
4749
      NULL },
 
4750
    { "freeze", (PyCFunction)_wrap_gimp_scrolled_preview_freeze, METH_NOARGS,
 
4751
      NULL },
 
4752
    { "thaw", (PyCFunction)_wrap_gimp_scrolled_preview_thaw, METH_NOARGS,
 
4753
      NULL },
 
4754
    { NULL, NULL, 0, NULL }
 
4755
};
 
4756
 
 
4757
PyTypeObject G_GNUC_INTERNAL PyGimpScrolledPreview_Type = {
 
4758
    PyObject_HEAD_INIT(NULL)
 
4759
    0,                                 /* ob_size */
 
4760
    "gimpui.ScrolledPreview",                   /* tp_name */
 
4761
    sizeof(PyGObject),          /* tp_basicsize */
 
4762
    0,                                 /* tp_itemsize */
 
4763
    /* methods */
 
4764
    (destructor)0,        /* tp_dealloc */
 
4765
    (printfunc)0,                      /* tp_print */
 
4766
    (getattrfunc)0,       /* tp_getattr */
 
4767
    (setattrfunc)0,       /* tp_setattr */
 
4768
    (cmpfunc)0,           /* tp_compare */
 
4769
    (reprfunc)0,             /* tp_repr */
 
4770
    (PyNumberMethods*)0,     /* tp_as_number */
 
4771
    (PySequenceMethods*)0, /* tp_as_sequence */
 
4772
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
4773
    (hashfunc)0,             /* tp_hash */
 
4774
    (ternaryfunc)0,          /* tp_call */
 
4775
    (reprfunc)0,              /* tp_str */
 
4776
    (getattrofunc)0,     /* tp_getattro */
 
4777
    (setattrofunc)0,     /* tp_setattro */
 
4778
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
4779
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
4780
    NULL,                        /* Documentation string */
 
4781
    (traverseproc)0,     /* tp_traverse */
 
4782
    (inquiry)0,             /* tp_clear */
 
4783
    (richcmpfunc)0,   /* tp_richcompare */
 
4784
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
4785
    (getiterfunc)0,          /* tp_iter */
 
4786
    (iternextfunc)0,     /* tp_iternext */
 
4787
    (struct PyMethodDef*)_PyGimpScrolledPreview_methods, /* tp_methods */
 
4788
    (struct PyMemberDef*)0,              /* tp_members */
 
4789
    (struct PyGetSetDef*)0,  /* tp_getset */
 
4790
    NULL,                              /* tp_base */
 
4791
    NULL,                              /* tp_dict */
 
4792
    (descrgetfunc)0,    /* tp_descr_get */
 
4793
    (descrsetfunc)0,    /* tp_descr_set */
 
4794
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
4795
    (initproc)0,             /* tp_init */
 
4796
    (allocfunc)0,           /* tp_alloc */
 
4797
    (newfunc)0,               /* tp_new */
 
4798
    (freefunc)0,             /* tp_free */
 
4799
    (inquiry)0              /* tp_is_gc */
 
4800
};
 
4801
 
 
4802
 
 
4803
 
 
4804
/* ----------- GimpDrawablePreview ----------- */
 
4805
 
 
4806
static int
 
4807
_wrap_gimp_drawable_preview_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4808
{
 
4809
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
4810
    GParameter params[1];
 
4811
    PyObject *parsed_args[1] = {NULL, };
 
4812
    char *arg_names[] = {"drawable", NULL };
 
4813
    char *prop_names[] = {"drawable", NULL };
 
4814
    guint nparams, i;
 
4815
 
 
4816
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gimpui.DrawablePreview.__init__" , arg_names , &parsed_args[0]))
 
4817
        return -1;
 
4818
 
 
4819
    memset(params, 0, sizeof(GParameter)*1);
 
4820
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
4821
                                    prop_names, params, 
 
4822
                                    &nparams, parsed_args))
 
4823
        return -1;
 
4824
    pygobject_constructv(self, nparams, params);
 
4825
    for (i = 0; i < nparams; ++i)
 
4826
        g_value_unset(&params[i].value);
 
4827
    if (!self->obj) {
 
4828
        PyErr_SetString(
 
4829
            PyExc_RuntimeError, 
 
4830
            "could not create gimpui.DrawablePreview object");
 
4831
        return -1;
 
4832
    }
 
4833
    return 0;
 
4834
}
 
4835
 
 
4836
PyTypeObject G_GNUC_INTERNAL PyGimpDrawablePreview_Type = {
 
4837
    PyObject_HEAD_INIT(NULL)
 
4838
    0,                                 /* ob_size */
 
4839
    "gimpui.DrawablePreview",                   /* tp_name */
 
4840
    sizeof(PyGObject),          /* tp_basicsize */
 
4841
    0,                                 /* tp_itemsize */
 
4842
    /* methods */
 
4843
    (destructor)0,        /* tp_dealloc */
 
4844
    (printfunc)0,                      /* tp_print */
 
4845
    (getattrfunc)0,       /* tp_getattr */
 
4846
    (setattrfunc)0,       /* tp_setattr */
 
4847
    (cmpfunc)0,           /* tp_compare */
 
4848
    (reprfunc)0,             /* tp_repr */
 
4849
    (PyNumberMethods*)0,     /* tp_as_number */
 
4850
    (PySequenceMethods*)0, /* tp_as_sequence */
 
4851
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
4852
    (hashfunc)0,             /* tp_hash */
 
4853
    (ternaryfunc)0,          /* tp_call */
 
4854
    (reprfunc)0,              /* tp_str */
 
4855
    (getattrofunc)0,     /* tp_getattro */
 
4856
    (setattrofunc)0,     /* tp_setattro */
 
4857
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
4858
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
4859
    NULL,                        /* Documentation string */
 
4860
    (traverseproc)0,     /* tp_traverse */
 
4861
    (inquiry)0,             /* tp_clear */
 
4862
    (richcmpfunc)0,   /* tp_richcompare */
 
4863
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
4864
    (getiterfunc)0,          /* tp_iter */
 
4865
    (iternextfunc)0,     /* tp_iternext */
 
4866
    (struct PyMethodDef*)NULL, /* tp_methods */
 
4867
    (struct PyMemberDef*)0,              /* tp_members */
 
4868
    (struct PyGetSetDef*)0,  /* tp_getset */
 
4869
    NULL,                              /* tp_base */
 
4870
    NULL,                              /* tp_dict */
 
4871
    (descrgetfunc)0,    /* tp_descr_get */
 
4872
    (descrsetfunc)0,    /* tp_descr_set */
 
4873
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
4874
    (initproc)_wrap_gimp_drawable_preview_new,             /* tp_init */
 
4875
    (allocfunc)0,           /* tp_alloc */
 
4876
    (newfunc)0,               /* tp_new */
 
4877
    (freefunc)0,             /* tp_free */
 
4878
    (inquiry)0              /* tp_is_gc */
 
4879
};
 
4880
 
 
4881
 
 
4882
 
 
4883
/* ----------- GimpSelectButton ----------- */
 
4884
 
 
4885
static PyObject *
 
4886
_wrap_gimp_select_button_close_popup(PyGObject *self)
 
4887
{
 
4888
    
 
4889
    gimp_select_button_close_popup(GIMP_SELECT_BUTTON(self->obj));
 
4890
    
 
4891
    Py_INCREF(Py_None);
 
4892
    return Py_None;
 
4893
}
 
4894
 
 
4895
static const PyMethodDef _PyGimpSelectButton_methods[] = {
 
4896
    { "close_popup", (PyCFunction)_wrap_gimp_select_button_close_popup, METH_NOARGS,
 
4897
      NULL },
 
4898
    { NULL, NULL, 0, NULL }
 
4899
};
 
4900
 
 
4901
PyTypeObject G_GNUC_INTERNAL PyGimpSelectButton_Type = {
 
4902
    PyObject_HEAD_INIT(NULL)
 
4903
    0,                                 /* ob_size */
 
4904
    "gimpui.SelectButton",                   /* tp_name */
 
4905
    sizeof(PyGObject),          /* tp_basicsize */
 
4906
    0,                                 /* tp_itemsize */
 
4907
    /* methods */
 
4908
    (destructor)0,        /* tp_dealloc */
 
4909
    (printfunc)0,                      /* tp_print */
 
4910
    (getattrfunc)0,       /* tp_getattr */
 
4911
    (setattrfunc)0,       /* tp_setattr */
 
4912
    (cmpfunc)0,           /* tp_compare */
 
4913
    (reprfunc)0,             /* tp_repr */
 
4914
    (PyNumberMethods*)0,     /* tp_as_number */
 
4915
    (PySequenceMethods*)0, /* tp_as_sequence */
 
4916
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
4917
    (hashfunc)0,             /* tp_hash */
 
4918
    (ternaryfunc)0,          /* tp_call */
 
4919
    (reprfunc)0,              /* tp_str */
 
4920
    (getattrofunc)0,     /* tp_getattro */
 
4921
    (setattrofunc)0,     /* tp_setattro */
 
4922
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
4923
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
4924
    NULL,                        /* Documentation string */
 
4925
    (traverseproc)0,     /* tp_traverse */
 
4926
    (inquiry)0,             /* tp_clear */
 
4927
    (richcmpfunc)0,   /* tp_richcompare */
 
4928
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
4929
    (getiterfunc)0,          /* tp_iter */
 
4930
    (iternextfunc)0,     /* tp_iternext */
 
4931
    (struct PyMethodDef*)_PyGimpSelectButton_methods, /* tp_methods */
 
4932
    (struct PyMemberDef*)0,              /* tp_members */
 
4933
    (struct PyGetSetDef*)0,  /* tp_getset */
 
4934
    NULL,                              /* tp_base */
 
4935
    NULL,                              /* tp_dict */
 
4936
    (descrgetfunc)0,    /* tp_descr_get */
 
4937
    (descrsetfunc)0,    /* tp_descr_set */
 
4938
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
4939
    (initproc)0,             /* tp_init */
 
4940
    (allocfunc)0,           /* tp_alloc */
 
4941
    (newfunc)0,               /* tp_new */
 
4942
    (freefunc)0,             /* tp_free */
 
4943
    (inquiry)0              /* tp_is_gc */
 
4944
};
 
4945
 
 
4946
 
 
4947
 
 
4948
/* ----------- GimpPatternSelectButton ----------- */
 
4949
 
 
4950
 static int
 
4951
_wrap_gimp_pattern_select_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4952
{
 
4953
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
4954
    GParameter params[2];
 
4955
    PyObject *parsed_args[2] = {NULL, };
 
4956
    char *arg_names[] = {"title", "pattern_name", NULL };
 
4957
    char *prop_names[] = {"title", "pattern-name", NULL };
 
4958
    guint nparams, i;
 
4959
 
 
4960
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:gimpui.PatternSelectButton.__init__" , arg_names , &parsed_args[0] , &parsed_args[1]))
 
4961
        return -1;
 
4962
 
 
4963
    memset(params, 0, sizeof(GParameter)*2);
 
4964
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
4965
                                    prop_names, params, 
 
4966
                                    &nparams, parsed_args))
 
4967
        return -1;
 
4968
    pygobject_constructv(self, nparams, params);
 
4969
    for (i = 0; i < nparams; ++i)
 
4970
        g_value_unset(&params[i].value);
 
4971
    if (!self->obj) {
 
4972
        PyErr_SetString(
 
4973
            PyExc_RuntimeError, 
 
4974
            "could not create gimpui.PatternSelectButton object");
 
4975
        return -1;
 
4976
    }
 
4977
    return 0;
 
4978
}
 
4979
 
 
4980
static PyObject *
 
4981
_wrap_gimp_pattern_select_button_get_pattern(PyGObject *self)
 
4982
{
 
4983
    const gchar *ret;
 
4984
 
 
4985
    
 
4986
    ret = gimp_pattern_select_button_get_pattern(GIMP_PATTERN_SELECT_BUTTON(self->obj));
 
4987
    
 
4988
    if (ret)
 
4989
        return PyString_FromString(ret);
 
4990
    Py_INCREF(Py_None);
 
4991
    return Py_None;
 
4992
}
 
4993
 
 
4994
static PyObject *
 
4995
_wrap_gimp_pattern_select_button_set_pattern(PyGObject *self, PyObject *args, PyObject *kwargs)
 
4996
{
 
4997
    static char *kwlist[] = { "pattern_name", NULL };
 
4998
    char *pattern_name;
 
4999
 
 
5000
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpPatternSelectButton.set_pattern", kwlist, &pattern_name))
 
5001
        return NULL;
 
5002
    
 
5003
    gimp_pattern_select_button_set_pattern(GIMP_PATTERN_SELECT_BUTTON(self->obj), pattern_name);
 
5004
    
 
5005
    Py_INCREF(Py_None);
 
5006
    return Py_None;
 
5007
}
 
5008
 
 
5009
static const PyMethodDef _PyGimpPatternSelectButton_methods[] = {
 
5010
    { "get_pattern", (PyCFunction)_wrap_gimp_pattern_select_button_get_pattern, METH_NOARGS,
 
5011
      NULL },
 
5012
    { "set_pattern", (PyCFunction)_wrap_gimp_pattern_select_button_set_pattern, METH_VARARGS|METH_KEYWORDS,
 
5013
      NULL },
 
5014
    { NULL, NULL, 0, NULL }
 
5015
};
 
5016
 
 
5017
PyTypeObject G_GNUC_INTERNAL PyGimpPatternSelectButton_Type = {
 
5018
    PyObject_HEAD_INIT(NULL)
 
5019
    0,                                 /* ob_size */
 
5020
    "gimpui.PatternSelectButton",                   /* tp_name */
 
5021
    sizeof(PyGObject),          /* tp_basicsize */
 
5022
    0,                                 /* tp_itemsize */
 
5023
    /* methods */
 
5024
    (destructor)0,        /* tp_dealloc */
 
5025
    (printfunc)0,                      /* tp_print */
 
5026
    (getattrfunc)0,       /* tp_getattr */
 
5027
    (setattrfunc)0,       /* tp_setattr */
 
5028
    (cmpfunc)0,           /* tp_compare */
 
5029
    (reprfunc)0,             /* tp_repr */
 
5030
    (PyNumberMethods*)0,     /* tp_as_number */
 
5031
    (PySequenceMethods*)0, /* tp_as_sequence */
 
5032
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
5033
    (hashfunc)0,             /* tp_hash */
 
5034
    (ternaryfunc)0,          /* tp_call */
 
5035
    (reprfunc)0,              /* tp_str */
 
5036
    (getattrofunc)0,     /* tp_getattro */
 
5037
    (setattrofunc)0,     /* tp_setattro */
 
5038
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
5039
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
5040
    NULL,                        /* Documentation string */
 
5041
    (traverseproc)0,     /* tp_traverse */
 
5042
    (inquiry)0,             /* tp_clear */
 
5043
    (richcmpfunc)0,   /* tp_richcompare */
 
5044
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
5045
    (getiterfunc)0,          /* tp_iter */
 
5046
    (iternextfunc)0,     /* tp_iternext */
 
5047
    (struct PyMethodDef*)_PyGimpPatternSelectButton_methods, /* tp_methods */
 
5048
    (struct PyMemberDef*)0,              /* tp_members */
 
5049
    (struct PyGetSetDef*)0,  /* tp_getset */
 
5050
    NULL,                              /* tp_base */
 
5051
    NULL,                              /* tp_dict */
 
5052
    (descrgetfunc)0,    /* tp_descr_get */
 
5053
    (descrsetfunc)0,    /* tp_descr_set */
 
5054
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
5055
    (initproc)_wrap_gimp_pattern_select_button_new,             /* tp_init */
 
5056
    (allocfunc)0,           /* tp_alloc */
 
5057
    (newfunc)0,               /* tp_new */
 
5058
    (freefunc)0,             /* tp_free */
 
5059
    (inquiry)0              /* tp_is_gc */
 
5060
};
 
5061
 
 
5062
 
 
5063
 
 
5064
/* ----------- GimpPaletteSelectButton ----------- */
 
5065
 
 
5066
 static int
 
5067
_wrap_gimp_palette_select_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5068
{
 
5069
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
5070
    GParameter params[2];
 
5071
    PyObject *parsed_args[2] = {NULL, };
 
5072
    char *arg_names[] = {"title", "palette_name", NULL };
 
5073
    char *prop_names[] = {"title", "palette-name", NULL };
 
5074
    guint nparams, i;
 
5075
 
 
5076
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:gimpui.PaletteSelectButton.__init__" , arg_names , &parsed_args[0] , &parsed_args[1]))
 
5077
        return -1;
 
5078
 
 
5079
    memset(params, 0, sizeof(GParameter)*2);
 
5080
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
5081
                                    prop_names, params, 
 
5082
                                    &nparams, parsed_args))
 
5083
        return -1;
 
5084
    pygobject_constructv(self, nparams, params);
 
5085
    for (i = 0; i < nparams; ++i)
 
5086
        g_value_unset(&params[i].value);
 
5087
    if (!self->obj) {
 
5088
        PyErr_SetString(
 
5089
            PyExc_RuntimeError, 
 
5090
            "could not create gimpui.PaletteSelectButton object");
 
5091
        return -1;
 
5092
    }
 
5093
    return 0;
 
5094
}
 
5095
 
 
5096
static PyObject *
 
5097
_wrap_gimp_palette_select_button_get_palette(PyGObject *self)
 
5098
{
 
5099
    const gchar *ret;
 
5100
 
 
5101
    
 
5102
    ret = gimp_palette_select_button_get_palette(GIMP_PALETTE_SELECT_BUTTON(self->obj));
 
5103
    
 
5104
    if (ret)
 
5105
        return PyString_FromString(ret);
 
5106
    Py_INCREF(Py_None);
 
5107
    return Py_None;
 
5108
}
 
5109
 
 
5110
static PyObject *
 
5111
_wrap_gimp_palette_select_button_set_palette(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5112
{
 
5113
    static char *kwlist[] = { "palette_name", NULL };
 
5114
    char *palette_name;
 
5115
 
 
5116
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpPaletteSelectButton.set_palette", kwlist, &palette_name))
 
5117
        return NULL;
 
5118
    
 
5119
    gimp_palette_select_button_set_palette(GIMP_PALETTE_SELECT_BUTTON(self->obj), palette_name);
 
5120
    
 
5121
    Py_INCREF(Py_None);
 
5122
    return Py_None;
 
5123
}
 
5124
 
 
5125
static const PyMethodDef _PyGimpPaletteSelectButton_methods[] = {
 
5126
    { "get_palette", (PyCFunction)_wrap_gimp_palette_select_button_get_palette, METH_NOARGS,
 
5127
      NULL },
 
5128
    { "set_palette", (PyCFunction)_wrap_gimp_palette_select_button_set_palette, METH_VARARGS|METH_KEYWORDS,
 
5129
      NULL },
 
5130
    { NULL, NULL, 0, NULL }
 
5131
};
 
5132
 
 
5133
PyTypeObject G_GNUC_INTERNAL PyGimpPaletteSelectButton_Type = {
 
5134
    PyObject_HEAD_INIT(NULL)
 
5135
    0,                                 /* ob_size */
 
5136
    "gimpui.PaletteSelectButton",                   /* tp_name */
 
5137
    sizeof(PyGObject),          /* tp_basicsize */
 
5138
    0,                                 /* tp_itemsize */
 
5139
    /* methods */
 
5140
    (destructor)0,        /* tp_dealloc */
 
5141
    (printfunc)0,                      /* tp_print */
 
5142
    (getattrfunc)0,       /* tp_getattr */
 
5143
    (setattrfunc)0,       /* tp_setattr */
 
5144
    (cmpfunc)0,           /* tp_compare */
 
5145
    (reprfunc)0,             /* tp_repr */
 
5146
    (PyNumberMethods*)0,     /* tp_as_number */
 
5147
    (PySequenceMethods*)0, /* tp_as_sequence */
 
5148
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
5149
    (hashfunc)0,             /* tp_hash */
 
5150
    (ternaryfunc)0,          /* tp_call */
 
5151
    (reprfunc)0,              /* tp_str */
 
5152
    (getattrofunc)0,     /* tp_getattro */
 
5153
    (setattrofunc)0,     /* tp_setattro */
 
5154
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
5155
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
5156
    NULL,                        /* Documentation string */
 
5157
    (traverseproc)0,     /* tp_traverse */
 
5158
    (inquiry)0,             /* tp_clear */
 
5159
    (richcmpfunc)0,   /* tp_richcompare */
 
5160
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
5161
    (getiterfunc)0,          /* tp_iter */
 
5162
    (iternextfunc)0,     /* tp_iternext */
 
5163
    (struct PyMethodDef*)_PyGimpPaletteSelectButton_methods, /* tp_methods */
 
5164
    (struct PyMemberDef*)0,              /* tp_members */
 
5165
    (struct PyGetSetDef*)0,  /* tp_getset */
 
5166
    NULL,                              /* tp_base */
 
5167
    NULL,                              /* tp_dict */
 
5168
    (descrgetfunc)0,    /* tp_descr_get */
 
5169
    (descrsetfunc)0,    /* tp_descr_set */
 
5170
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
5171
    (initproc)_wrap_gimp_palette_select_button_new,             /* tp_init */
 
5172
    (allocfunc)0,           /* tp_alloc */
 
5173
    (newfunc)0,               /* tp_new */
 
5174
    (freefunc)0,             /* tp_free */
 
5175
    (inquiry)0              /* tp_is_gc */
 
5176
};
 
5177
 
 
5178
 
 
5179
 
 
5180
/* ----------- GimpGradientSelectButton ----------- */
 
5181
 
 
5182
 static int
 
5183
_wrap_gimp_gradient_select_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5184
{
 
5185
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
5186
    GParameter params[2];
 
5187
    PyObject *parsed_args[2] = {NULL, };
 
5188
    char *arg_names[] = {"title", "gradient_name", NULL };
 
5189
    char *prop_names[] = {"title", "gradient-name", NULL };
 
5190
    guint nparams, i;
 
5191
 
 
5192
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:gimpui.GradientSelectButton.__init__" , arg_names , &parsed_args[0] , &parsed_args[1]))
 
5193
        return -1;
 
5194
 
 
5195
    memset(params, 0, sizeof(GParameter)*2);
 
5196
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
5197
                                    prop_names, params, 
 
5198
                                    &nparams, parsed_args))
 
5199
        return -1;
 
5200
    pygobject_constructv(self, nparams, params);
 
5201
    for (i = 0; i < nparams; ++i)
 
5202
        g_value_unset(&params[i].value);
 
5203
    if (!self->obj) {
 
5204
        PyErr_SetString(
 
5205
            PyExc_RuntimeError, 
 
5206
            "could not create gimpui.GradientSelectButton object");
 
5207
        return -1;
 
5208
    }
 
5209
    return 0;
 
5210
}
 
5211
 
 
5212
static PyObject *
 
5213
_wrap_gimp_gradient_select_button_get_gradient(PyGObject *self)
 
5214
{
 
5215
    const gchar *ret;
 
5216
 
 
5217
    
 
5218
    ret = gimp_gradient_select_button_get_gradient(GIMP_GRADIENT_SELECT_BUTTON(self->obj));
 
5219
    
 
5220
    if (ret)
 
5221
        return PyString_FromString(ret);
 
5222
    Py_INCREF(Py_None);
 
5223
    return Py_None;
 
5224
}
 
5225
 
 
5226
static PyObject *
 
5227
_wrap_gimp_gradient_select_button_set_gradient(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5228
{
 
5229
    static char *kwlist[] = { "gradient_name", NULL };
 
5230
    char *gradient_name;
 
5231
 
 
5232
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpGradientSelectButton.set_gradient", kwlist, &gradient_name))
 
5233
        return NULL;
 
5234
    
 
5235
    gimp_gradient_select_button_set_gradient(GIMP_GRADIENT_SELECT_BUTTON(self->obj), gradient_name);
 
5236
    
 
5237
    Py_INCREF(Py_None);
 
5238
    return Py_None;
 
5239
}
 
5240
 
 
5241
static const PyMethodDef _PyGimpGradientSelectButton_methods[] = {
 
5242
    { "get_gradient", (PyCFunction)_wrap_gimp_gradient_select_button_get_gradient, METH_NOARGS,
 
5243
      NULL },
 
5244
    { "set_gradient", (PyCFunction)_wrap_gimp_gradient_select_button_set_gradient, METH_VARARGS|METH_KEYWORDS,
 
5245
      NULL },
 
5246
    { NULL, NULL, 0, NULL }
 
5247
};
 
5248
 
 
5249
PyTypeObject G_GNUC_INTERNAL PyGimpGradientSelectButton_Type = {
 
5250
    PyObject_HEAD_INIT(NULL)
 
5251
    0,                                 /* ob_size */
 
5252
    "gimpui.GradientSelectButton",                   /* tp_name */
 
5253
    sizeof(PyGObject),          /* tp_basicsize */
 
5254
    0,                                 /* tp_itemsize */
 
5255
    /* methods */
 
5256
    (destructor)0,        /* tp_dealloc */
 
5257
    (printfunc)0,                      /* tp_print */
 
5258
    (getattrfunc)0,       /* tp_getattr */
 
5259
    (setattrfunc)0,       /* tp_setattr */
 
5260
    (cmpfunc)0,           /* tp_compare */
 
5261
    (reprfunc)0,             /* tp_repr */
 
5262
    (PyNumberMethods*)0,     /* tp_as_number */
 
5263
    (PySequenceMethods*)0, /* tp_as_sequence */
 
5264
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
5265
    (hashfunc)0,             /* tp_hash */
 
5266
    (ternaryfunc)0,          /* tp_call */
 
5267
    (reprfunc)0,              /* tp_str */
 
5268
    (getattrofunc)0,     /* tp_getattro */
 
5269
    (setattrofunc)0,     /* tp_setattro */
 
5270
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
5271
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
5272
    NULL,                        /* Documentation string */
 
5273
    (traverseproc)0,     /* tp_traverse */
 
5274
    (inquiry)0,             /* tp_clear */
 
5275
    (richcmpfunc)0,   /* tp_richcompare */
 
5276
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
5277
    (getiterfunc)0,          /* tp_iter */
 
5278
    (iternextfunc)0,     /* tp_iternext */
 
5279
    (struct PyMethodDef*)_PyGimpGradientSelectButton_methods, /* tp_methods */
 
5280
    (struct PyMemberDef*)0,              /* tp_members */
 
5281
    (struct PyGetSetDef*)0,  /* tp_getset */
 
5282
    NULL,                              /* tp_base */
 
5283
    NULL,                              /* tp_dict */
 
5284
    (descrgetfunc)0,    /* tp_descr_get */
 
5285
    (descrsetfunc)0,    /* tp_descr_set */
 
5286
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
5287
    (initproc)_wrap_gimp_gradient_select_button_new,             /* tp_init */
 
5288
    (allocfunc)0,           /* tp_alloc */
 
5289
    (newfunc)0,               /* tp_new */
 
5290
    (freefunc)0,             /* tp_free */
 
5291
    (inquiry)0              /* tp_is_gc */
 
5292
};
 
5293
 
 
5294
 
 
5295
 
 
5296
/* ----------- GimpFontSelectButton ----------- */
 
5297
 
 
5298
 static int
 
5299
_wrap_gimp_font_select_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5300
{
 
5301
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
5302
    GParameter params[2];
 
5303
    PyObject *parsed_args[2] = {NULL, };
 
5304
    char *arg_names[] = {"title", "font_name", NULL };
 
5305
    char *prop_names[] = {"title", "font-name", NULL };
 
5306
    guint nparams, i;
 
5307
 
 
5308
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:gimpui.FontSelectButton.__init__" , arg_names , &parsed_args[0] , &parsed_args[1]))
 
5309
        return -1;
 
5310
 
 
5311
    memset(params, 0, sizeof(GParameter)*2);
 
5312
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
5313
                                    prop_names, params, 
 
5314
                                    &nparams, parsed_args))
 
5315
        return -1;
 
5316
    pygobject_constructv(self, nparams, params);
 
5317
    for (i = 0; i < nparams; ++i)
 
5318
        g_value_unset(&params[i].value);
 
5319
    if (!self->obj) {
 
5320
        PyErr_SetString(
 
5321
            PyExc_RuntimeError, 
 
5322
            "could not create gimpui.FontSelectButton object");
 
5323
        return -1;
 
5324
    }
 
5325
    return 0;
 
5326
}
 
5327
 
 
5328
static PyObject *
 
5329
_wrap_gimp_font_select_button_get_font(PyGObject *self)
 
5330
{
 
5331
    const gchar *ret;
 
5332
 
 
5333
    
 
5334
    ret = gimp_font_select_button_get_font(GIMP_FONT_SELECT_BUTTON(self->obj));
 
5335
    
 
5336
    if (ret)
 
5337
        return PyString_FromString(ret);
 
5338
    Py_INCREF(Py_None);
 
5339
    return Py_None;
 
5340
}
 
5341
 
 
5342
static PyObject *
 
5343
_wrap_gimp_font_select_button_set_font(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5344
{
 
5345
    static char *kwlist[] = { "font_name", NULL };
 
5346
    char *font_name;
 
5347
 
 
5348
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:GimpFontSelectButton.set_font", kwlist, &font_name))
 
5349
        return NULL;
 
5350
    
 
5351
    gimp_font_select_button_set_font(GIMP_FONT_SELECT_BUTTON(self->obj), font_name);
 
5352
    
 
5353
    Py_INCREF(Py_None);
 
5354
    return Py_None;
 
5355
}
 
5356
 
 
5357
static const PyMethodDef _PyGimpFontSelectButton_methods[] = {
 
5358
    { "get_font", (PyCFunction)_wrap_gimp_font_select_button_get_font, METH_NOARGS,
 
5359
      NULL },
 
5360
    { "set_font", (PyCFunction)_wrap_gimp_font_select_button_set_font, METH_VARARGS|METH_KEYWORDS,
 
5361
      NULL },
 
5362
    { NULL, NULL, 0, NULL }
 
5363
};
 
5364
 
 
5365
PyTypeObject G_GNUC_INTERNAL PyGimpFontSelectButton_Type = {
 
5366
    PyObject_HEAD_INIT(NULL)
 
5367
    0,                                 /* ob_size */
 
5368
    "gimpui.FontSelectButton",                   /* tp_name */
 
5369
    sizeof(PyGObject),          /* tp_basicsize */
 
5370
    0,                                 /* tp_itemsize */
 
5371
    /* methods */
 
5372
    (destructor)0,        /* tp_dealloc */
 
5373
    (printfunc)0,                      /* tp_print */
 
5374
    (getattrfunc)0,       /* tp_getattr */
 
5375
    (setattrfunc)0,       /* tp_setattr */
 
5376
    (cmpfunc)0,           /* tp_compare */
 
5377
    (reprfunc)0,             /* tp_repr */
 
5378
    (PyNumberMethods*)0,     /* tp_as_number */
 
5379
    (PySequenceMethods*)0, /* tp_as_sequence */
 
5380
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
5381
    (hashfunc)0,             /* tp_hash */
 
5382
    (ternaryfunc)0,          /* tp_call */
 
5383
    (reprfunc)0,              /* tp_str */
 
5384
    (getattrofunc)0,     /* tp_getattro */
 
5385
    (setattrofunc)0,     /* tp_setattro */
 
5386
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
5387
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
5388
    NULL,                        /* Documentation string */
 
5389
    (traverseproc)0,     /* tp_traverse */
 
5390
    (inquiry)0,             /* tp_clear */
 
5391
    (richcmpfunc)0,   /* tp_richcompare */
 
5392
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
5393
    (getiterfunc)0,          /* tp_iter */
 
5394
    (iternextfunc)0,     /* tp_iternext */
 
5395
    (struct PyMethodDef*)_PyGimpFontSelectButton_methods, /* tp_methods */
 
5396
    (struct PyMemberDef*)0,              /* tp_members */
 
5397
    (struct PyGetSetDef*)0,  /* tp_getset */
 
5398
    NULL,                              /* tp_base */
 
5399
    NULL,                              /* tp_dict */
 
5400
    (descrgetfunc)0,    /* tp_descr_get */
 
5401
    (descrsetfunc)0,    /* tp_descr_set */
 
5402
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
5403
    (initproc)_wrap_gimp_font_select_button_new,             /* tp_init */
 
5404
    (allocfunc)0,           /* tp_alloc */
 
5405
    (newfunc)0,               /* tp_new */
 
5406
    (freefunc)0,             /* tp_free */
 
5407
    (inquiry)0              /* tp_is_gc */
 
5408
};
 
5409
 
 
5410
 
 
5411
 
 
5412
/* ----------- GimpBrushSelectButton ----------- */
 
5413
 
 
5414
 static int
 
5415
_wrap_gimp_brush_select_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5416
{
 
5417
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
5418
    GParameter params[5];
 
5419
    PyObject *parsed_args[5] = {NULL, };
 
5420
    char *arg_names[] = {"title", "brush_name", "opacity", "spacing", "paint_mode", NULL };
 
5421
    char *prop_names[] = {"title", "brush-name", "brush-opacity", "brush-spacing", "brush-paint-mode", NULL };
 
5422
    guint nparams, i;
 
5423
 
 
5424
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOOOO:gimpui.BrushSelectButton.__init__" , arg_names , &parsed_args[0] , &parsed_args[1] , &parsed_args[2] , &parsed_args[3] , &parsed_args[4]))
 
5425
        return -1;
 
5426
 
 
5427
    memset(params, 0, sizeof(GParameter)*5);
 
5428
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
5429
                                    prop_names, params, 
 
5430
                                    &nparams, parsed_args))
 
5431
        return -1;
 
5432
    pygobject_constructv(self, nparams, params);
 
5433
    for (i = 0; i < nparams; ++i)
 
5434
        g_value_unset(&params[i].value);
 
5435
    if (!self->obj) {
 
5436
        PyErr_SetString(
 
5437
            PyExc_RuntimeError, 
 
5438
            "could not create gimpui.BrushSelectButton object");
 
5439
        return -1;
 
5440
    }
 
5441
    return 0;
 
5442
}
 
5443
 
 
5444
#line 878 "gimpui.override"
 
5445
static PyObject *
 
5446
_wrap_gimp_brush_select_button_get_brush(PyGObject *self)
 
5447
{
 
5448
    const gchar *brush_name;
 
5449
    gdouble opacity;
 
5450
    gint spacing;
 
5451
    GimpLayerModeEffects paint_mode;
 
5452
 
 
5453
    brush_name =
 
5454
        gimp_brush_select_button_get_brush(GIMP_BRUSH_SELECT_BUTTON(self->obj),
 
5455
                                           &opacity, &spacing, &paint_mode);
 
5456
 
 
5457
    return Py_BuildValue("(sdiN)", brush_name, opacity, spacing,
 
5458
                         pyg_enum_from_gtype(GIMP_TYPE_LAYER_MODE_EFFECTS,
 
5459
                                             paint_mode));
 
5460
}
 
5461
#line 5462 "gimpui.c"
 
5462
 
 
5463
 
 
5464
static PyObject *
 
5465
_wrap_gimp_brush_select_button_set_brush(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5466
{
 
5467
    static char *kwlist[] = { "brush_name", "opacity", "spacing", "paint_mode", NULL };
 
5468
    char *brush_name;
 
5469
    double opacity;
 
5470
    int spacing;
 
5471
    PyObject *py_paint_mode = NULL;
 
5472
    GimpLayerModeEffects paint_mode;
 
5473
 
 
5474
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"sdiO:GimpBrushSelectButton.set_brush", kwlist, &brush_name, &opacity, &spacing, &py_paint_mode))
 
5475
        return NULL;
 
5476
    if (pyg_enum_get_value(GIMP_TYPE_LAYER_MODE_EFFECTS, py_paint_mode, (gpointer)&paint_mode))
 
5477
        return NULL;
 
5478
    
 
5479
    gimp_brush_select_button_set_brush(GIMP_BRUSH_SELECT_BUTTON(self->obj), brush_name, opacity, spacing, paint_mode);
 
5480
    
 
5481
    Py_INCREF(Py_None);
 
5482
    return Py_None;
 
5483
}
 
5484
 
 
5485
static const PyMethodDef _PyGimpBrushSelectButton_methods[] = {
 
5486
    { "get_brush", (PyCFunction)_wrap_gimp_brush_select_button_get_brush, METH_NOARGS,
 
5487
      NULL },
 
5488
    { "set_brush", (PyCFunction)_wrap_gimp_brush_select_button_set_brush, METH_VARARGS|METH_KEYWORDS,
 
5489
      NULL },
 
5490
    { NULL, NULL, 0, NULL }
 
5491
};
 
5492
 
 
5493
PyTypeObject G_GNUC_INTERNAL PyGimpBrushSelectButton_Type = {
 
5494
    PyObject_HEAD_INIT(NULL)
 
5495
    0,                                 /* ob_size */
 
5496
    "gimpui.BrushSelectButton",                   /* tp_name */
 
5497
    sizeof(PyGObject),          /* tp_basicsize */
 
5498
    0,                                 /* tp_itemsize */
 
5499
    /* methods */
 
5500
    (destructor)0,        /* tp_dealloc */
 
5501
    (printfunc)0,                      /* tp_print */
 
5502
    (getattrfunc)0,       /* tp_getattr */
 
5503
    (setattrfunc)0,       /* tp_setattr */
 
5504
    (cmpfunc)0,           /* tp_compare */
 
5505
    (reprfunc)0,             /* tp_repr */
 
5506
    (PyNumberMethods*)0,     /* tp_as_number */
 
5507
    (PySequenceMethods*)0, /* tp_as_sequence */
 
5508
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
5509
    (hashfunc)0,             /* tp_hash */
 
5510
    (ternaryfunc)0,          /* tp_call */
 
5511
    (reprfunc)0,              /* tp_str */
 
5512
    (getattrofunc)0,     /* tp_getattro */
 
5513
    (setattrofunc)0,     /* tp_setattro */
 
5514
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
5515
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
5516
    NULL,                        /* Documentation string */
 
5517
    (traverseproc)0,     /* tp_traverse */
 
5518
    (inquiry)0,             /* tp_clear */
 
5519
    (richcmpfunc)0,   /* tp_richcompare */
 
5520
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
5521
    (getiterfunc)0,          /* tp_iter */
 
5522
    (iternextfunc)0,     /* tp_iternext */
 
5523
    (struct PyMethodDef*)_PyGimpBrushSelectButton_methods, /* tp_methods */
 
5524
    (struct PyMemberDef*)0,              /* tp_members */
 
5525
    (struct PyGetSetDef*)0,  /* tp_getset */
 
5526
    NULL,                              /* tp_base */
 
5527
    NULL,                              /* tp_dict */
 
5528
    (descrgetfunc)0,    /* tp_descr_get */
 
5529
    (descrsetfunc)0,    /* tp_descr_set */
 
5530
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
5531
    (initproc)_wrap_gimp_brush_select_button_new,             /* tp_init */
 
5532
    (allocfunc)0,           /* tp_alloc */
 
5533
    (newfunc)0,               /* tp_new */
 
5534
    (freefunc)0,             /* tp_free */
 
5535
    (inquiry)0              /* tp_is_gc */
 
5536
};
 
5537
 
 
5538
 
 
5539
 
 
5540
/* ----------- GimpSizeEntry ----------- */
 
5541
 
 
5542
static int
 
5543
pygobject_no_constructor(PyObject *self, PyObject *args, PyObject *kwargs)
 
5544
{
 
5545
    gchar buf[512];
 
5546
 
 
5547
    g_snprintf(buf, sizeof(buf), "%s is an abstract widget", self->ob_type->tp_name);
 
5548
    PyErr_SetString(PyExc_NotImplementedError, buf);
 
5549
    return -1;
 
5550
}
 
5551
 
 
5552
static PyObject *
 
5553
_wrap_gimp_size_entry_add_field(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5554
{
 
5555
    static char *kwlist[] = { "value_spinbutton", "refval_spinbutton", NULL };
 
5556
    PyGObject *value_spinbutton, *refval_spinbutton;
 
5557
 
 
5558
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!O!:GimpSizeEntry.add_field", kwlist, &PyGtkSpinButton_Type, &value_spinbutton, &PyGtkSpinButton_Type, &refval_spinbutton))
 
5559
        return NULL;
 
5560
    
 
5561
    gimp_size_entry_add_field(GIMP_SIZE_ENTRY(self->obj), GTK_SPIN_BUTTON(value_spinbutton->obj), GTK_SPIN_BUTTON(refval_spinbutton->obj));
 
5562
    
 
5563
    Py_INCREF(Py_None);
 
5564
    return Py_None;
 
5565
}
 
5566
 
 
5567
static PyObject *
 
5568
_wrap_gimp_size_entry_attach_label(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5569
{
 
5570
    static char *kwlist[] = { "text", "row", "column", "alignment", NULL };
 
5571
    char *text;
 
5572
    int row, column;
 
5573
    GtkWidget *ret;
 
5574
    double alignment;
 
5575
 
 
5576
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"siid:GimpSizeEntry.attach_label", kwlist, &text, &row, &column, &alignment))
 
5577
        return NULL;
 
5578
    
 
5579
    ret = gimp_size_entry_attach_label(GIMP_SIZE_ENTRY(self->obj), text, row, column, alignment);
 
5580
    
 
5581
    /* pygobject_new handles NULL checking */
 
5582
    return pygobject_new((GObject *)ret);
 
5583
}
 
5584
 
 
5585
static PyObject *
 
5586
_wrap_gimp_size_entry_set_resolution(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5587
{
 
5588
    static char *kwlist[] = { "field", "resolution", "keep_size", NULL };
 
5589
    int field, keep_size;
 
5590
    double resolution;
 
5591
 
 
5592
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"idi:GimpSizeEntry.set_resolution", kwlist, &field, &resolution, &keep_size))
 
5593
        return NULL;
 
5594
    
 
5595
    gimp_size_entry_set_resolution(GIMP_SIZE_ENTRY(self->obj), field, resolution, keep_size);
 
5596
    
 
5597
    Py_INCREF(Py_None);
 
5598
    return Py_None;
 
5599
}
 
5600
 
 
5601
static PyObject *
 
5602
_wrap_gimp_size_entry_set_size(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5603
{
 
5604
    static char *kwlist[] = { "field", "lower", "upper", NULL };
 
5605
    int field;
 
5606
    double lower, upper;
 
5607
 
 
5608
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"idd:GimpSizeEntry.set_size", kwlist, &field, &lower, &upper))
 
5609
        return NULL;
 
5610
    
 
5611
    gimp_size_entry_set_size(GIMP_SIZE_ENTRY(self->obj), field, lower, upper);
 
5612
    
 
5613
    Py_INCREF(Py_None);
 
5614
    return Py_None;
 
5615
}
 
5616
 
 
5617
static PyObject *
 
5618
_wrap_gimp_size_entry_set_value_boundaries(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5619
{
 
5620
    static char *kwlist[] = { "field", "lower", "upper", NULL };
 
5621
    int field;
 
5622
    double lower, upper;
 
5623
 
 
5624
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"idd:GimpSizeEntry.set_value_boundaries", kwlist, &field, &lower, &upper))
 
5625
        return NULL;
 
5626
    
 
5627
    gimp_size_entry_set_value_boundaries(GIMP_SIZE_ENTRY(self->obj), field, lower, upper);
 
5628
    
 
5629
    Py_INCREF(Py_None);
 
5630
    return Py_None;
 
5631
}
 
5632
 
 
5633
static PyObject *
 
5634
_wrap_gimp_size_entry_get_value(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5635
{
 
5636
    static char *kwlist[] = { "field", NULL };
 
5637
    int field;
 
5638
    double ret;
 
5639
 
 
5640
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpSizeEntry.get_value", kwlist, &field))
 
5641
        return NULL;
 
5642
    
 
5643
    ret = gimp_size_entry_get_value(GIMP_SIZE_ENTRY(self->obj), field);
 
5644
    
 
5645
    return PyFloat_FromDouble(ret);
 
5646
}
 
5647
 
 
5648
static PyObject *
 
5649
_wrap_gimp_size_entry_set_value(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5650
{
 
5651
    static char *kwlist[] = { "field", "value", NULL };
 
5652
    int field;
 
5653
    double value;
 
5654
 
 
5655
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"id:GimpSizeEntry.set_value", kwlist, &field, &value))
 
5656
        return NULL;
 
5657
    
 
5658
    gimp_size_entry_set_value(GIMP_SIZE_ENTRY(self->obj), field, value);
 
5659
    
 
5660
    Py_INCREF(Py_None);
 
5661
    return Py_None;
 
5662
}
 
5663
 
 
5664
static PyObject *
 
5665
_wrap_gimp_size_entry_set_refval_boundaries(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5666
{
 
5667
    static char *kwlist[] = { "field", "lower", "upper", NULL };
 
5668
    int field;
 
5669
    double lower, upper;
 
5670
 
 
5671
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"idd:GimpSizeEntry.set_refval_boundaries", kwlist, &field, &lower, &upper))
 
5672
        return NULL;
 
5673
    
 
5674
    gimp_size_entry_set_refval_boundaries(GIMP_SIZE_ENTRY(self->obj), field, lower, upper);
 
5675
    
 
5676
    Py_INCREF(Py_None);
 
5677
    return Py_None;
 
5678
}
 
5679
 
 
5680
static PyObject *
 
5681
_wrap_gimp_size_entry_set_refval_digits(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5682
{
 
5683
    static char *kwlist[] = { "field", "digits", NULL };
 
5684
    int field, digits;
 
5685
 
 
5686
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ii:GimpSizeEntry.set_refval_digits", kwlist, &field, &digits))
 
5687
        return NULL;
 
5688
    
 
5689
    gimp_size_entry_set_refval_digits(GIMP_SIZE_ENTRY(self->obj), field, digits);
 
5690
    
 
5691
    Py_INCREF(Py_None);
 
5692
    return Py_None;
 
5693
}
 
5694
 
 
5695
static PyObject *
 
5696
_wrap_gimp_size_entry_get_refval(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5697
{
 
5698
    static char *kwlist[] = { "field", NULL };
 
5699
    int field;
 
5700
    double ret;
 
5701
 
 
5702
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpSizeEntry.get_refval", kwlist, &field))
 
5703
        return NULL;
 
5704
    
 
5705
    ret = gimp_size_entry_get_refval(GIMP_SIZE_ENTRY(self->obj), field);
 
5706
    
 
5707
    return PyFloat_FromDouble(ret);
 
5708
}
 
5709
 
 
5710
static PyObject *
 
5711
_wrap_gimp_size_entry_set_refval(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5712
{
 
5713
    static char *kwlist[] = { "field", "refval", NULL };
 
5714
    int field;
 
5715
    double refval;
 
5716
 
 
5717
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"id:GimpSizeEntry.set_refval", kwlist, &field, &refval))
 
5718
        return NULL;
 
5719
    
 
5720
    gimp_size_entry_set_refval(GIMP_SIZE_ENTRY(self->obj), field, refval);
 
5721
    
 
5722
    Py_INCREF(Py_None);
 
5723
    return Py_None;
 
5724
}
 
5725
 
 
5726
static PyObject *
 
5727
_wrap_gimp_size_entry_show_unit_menu(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5728
{
 
5729
    static char *kwlist[] = { "show", NULL };
 
5730
    int show;
 
5731
 
 
5732
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpSizeEntry.show_unit_menu", kwlist, &show))
 
5733
        return NULL;
 
5734
    
 
5735
    gimp_size_entry_show_unit_menu(GIMP_SIZE_ENTRY(self->obj), show);
 
5736
    
 
5737
    Py_INCREF(Py_None);
 
5738
    return Py_None;
 
5739
}
 
5740
 
 
5741
static PyObject *
 
5742
_wrap_gimp_size_entry_set_pixel_digits(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5743
{
 
5744
    static char *kwlist[] = { "digits", NULL };
 
5745
    int digits;
 
5746
 
 
5747
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpSizeEntry.set_pixel_digits", kwlist, &digits))
 
5748
        return NULL;
 
5749
    
 
5750
    gimp_size_entry_set_pixel_digits(GIMP_SIZE_ENTRY(self->obj), digits);
 
5751
    
 
5752
    Py_INCREF(Py_None);
 
5753
    return Py_None;
 
5754
}
 
5755
 
 
5756
static PyObject *
 
5757
_wrap_gimp_size_entry_grab_focus(PyGObject *self)
 
5758
{
 
5759
    
 
5760
    gimp_size_entry_grab_focus(GIMP_SIZE_ENTRY(self->obj));
 
5761
    
 
5762
    Py_INCREF(Py_None);
 
5763
    return Py_None;
 
5764
}
 
5765
 
 
5766
static PyObject *
 
5767
_wrap_gimp_size_entry_set_activates_default(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5768
{
 
5769
    static char *kwlist[] = { "setting", NULL };
 
5770
    int setting;
 
5771
 
 
5772
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpSizeEntry.set_activates_default", kwlist, &setting))
 
5773
        return NULL;
 
5774
    
 
5775
    gimp_size_entry_set_activates_default(GIMP_SIZE_ENTRY(self->obj), setting);
 
5776
    
 
5777
    Py_INCREF(Py_None);
 
5778
    return Py_None;
 
5779
}
 
5780
 
 
5781
static PyObject *
 
5782
_wrap_gimp_size_entry_get_help_widget(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5783
{
 
5784
    static char *kwlist[] = { "field", NULL };
 
5785
    int field;
 
5786
    GtkWidget *ret;
 
5787
 
 
5788
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpSizeEntry.get_help_widget", kwlist, &field))
 
5789
        return NULL;
 
5790
    
 
5791
    ret = gimp_size_entry_get_help_widget(GIMP_SIZE_ENTRY(self->obj), field);
 
5792
    
 
5793
    /* pygobject_new handles NULL checking */
 
5794
    return pygobject_new((GObject *)ret);
 
5795
}
 
5796
 
 
5797
static const PyMethodDef _PyGimpSizeEntry_methods[] = {
 
5798
    { "add_field", (PyCFunction)_wrap_gimp_size_entry_add_field, METH_VARARGS|METH_KEYWORDS,
 
5799
      NULL },
 
5800
    { "attach_label", (PyCFunction)_wrap_gimp_size_entry_attach_label, METH_VARARGS|METH_KEYWORDS,
 
5801
      NULL },
 
5802
    { "set_resolution", (PyCFunction)_wrap_gimp_size_entry_set_resolution, METH_VARARGS|METH_KEYWORDS,
 
5803
      NULL },
 
5804
    { "set_size", (PyCFunction)_wrap_gimp_size_entry_set_size, METH_VARARGS|METH_KEYWORDS,
 
5805
      NULL },
 
5806
    { "set_value_boundaries", (PyCFunction)_wrap_gimp_size_entry_set_value_boundaries, METH_VARARGS|METH_KEYWORDS,
 
5807
      NULL },
 
5808
    { "get_value", (PyCFunction)_wrap_gimp_size_entry_get_value, METH_VARARGS|METH_KEYWORDS,
 
5809
      NULL },
 
5810
    { "set_value", (PyCFunction)_wrap_gimp_size_entry_set_value, METH_VARARGS|METH_KEYWORDS,
 
5811
      NULL },
 
5812
    { "set_refval_boundaries", (PyCFunction)_wrap_gimp_size_entry_set_refval_boundaries, METH_VARARGS|METH_KEYWORDS,
 
5813
      NULL },
 
5814
    { "set_refval_digits", (PyCFunction)_wrap_gimp_size_entry_set_refval_digits, METH_VARARGS|METH_KEYWORDS,
 
5815
      NULL },
 
5816
    { "get_refval", (PyCFunction)_wrap_gimp_size_entry_get_refval, METH_VARARGS|METH_KEYWORDS,
 
5817
      NULL },
 
5818
    { "set_refval", (PyCFunction)_wrap_gimp_size_entry_set_refval, METH_VARARGS|METH_KEYWORDS,
 
5819
      NULL },
 
5820
    { "show_unit_menu", (PyCFunction)_wrap_gimp_size_entry_show_unit_menu, METH_VARARGS|METH_KEYWORDS,
 
5821
      NULL },
 
5822
    { "set_pixel_digits", (PyCFunction)_wrap_gimp_size_entry_set_pixel_digits, METH_VARARGS|METH_KEYWORDS,
 
5823
      NULL },
 
5824
    { "grab_focus", (PyCFunction)_wrap_gimp_size_entry_grab_focus, METH_NOARGS,
 
5825
      NULL },
 
5826
    { "set_activates_default", (PyCFunction)_wrap_gimp_size_entry_set_activates_default, METH_VARARGS|METH_KEYWORDS,
 
5827
      NULL },
 
5828
    { "get_help_widget", (PyCFunction)_wrap_gimp_size_entry_get_help_widget, METH_VARARGS|METH_KEYWORDS,
 
5829
      NULL },
 
5830
    { NULL, NULL, 0, NULL }
 
5831
};
 
5832
 
 
5833
PyTypeObject G_GNUC_INTERNAL PyGimpSizeEntry_Type = {
 
5834
    PyObject_HEAD_INIT(NULL)
 
5835
    0,                                 /* ob_size */
 
5836
    "gimpui.SizeEntry",                   /* tp_name */
 
5837
    sizeof(PyGObject),          /* tp_basicsize */
 
5838
    0,                                 /* tp_itemsize */
 
5839
    /* methods */
 
5840
    (destructor)0,        /* tp_dealloc */
 
5841
    (printfunc)0,                      /* tp_print */
 
5842
    (getattrfunc)0,       /* tp_getattr */
 
5843
    (setattrfunc)0,       /* tp_setattr */
 
5844
    (cmpfunc)0,           /* tp_compare */
 
5845
    (reprfunc)0,             /* tp_repr */
 
5846
    (PyNumberMethods*)0,     /* tp_as_number */
 
5847
    (PySequenceMethods*)0, /* tp_as_sequence */
 
5848
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
5849
    (hashfunc)0,             /* tp_hash */
 
5850
    (ternaryfunc)0,          /* tp_call */
 
5851
    (reprfunc)0,              /* tp_str */
 
5852
    (getattrofunc)0,     /* tp_getattro */
 
5853
    (setattrofunc)0,     /* tp_setattro */
 
5854
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
5855
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
5856
    NULL,                        /* Documentation string */
 
5857
    (traverseproc)0,     /* tp_traverse */
 
5858
    (inquiry)0,             /* tp_clear */
 
5859
    (richcmpfunc)0,   /* tp_richcompare */
 
5860
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
5861
    (getiterfunc)0,          /* tp_iter */
 
5862
    (iternextfunc)0,     /* tp_iternext */
 
5863
    (struct PyMethodDef*)_PyGimpSizeEntry_methods, /* tp_methods */
 
5864
    (struct PyMemberDef*)0,              /* tp_members */
 
5865
    (struct PyGetSetDef*)0,  /* tp_getset */
 
5866
    NULL,                              /* tp_base */
 
5867
    NULL,                              /* tp_dict */
 
5868
    (descrgetfunc)0,    /* tp_descr_get */
 
5869
    (descrsetfunc)0,    /* tp_descr_set */
 
5870
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
5871
    (initproc)pygobject_no_constructor,             /* tp_init */
 
5872
    (allocfunc)0,           /* tp_alloc */
 
5873
    (newfunc)0,               /* tp_new */
 
5874
    (freefunc)0,             /* tp_free */
 
5875
    (inquiry)0              /* tp_is_gc */
 
5876
};
 
5877
 
 
5878
 
 
5879
 
 
5880
/* ----------- GimpUnitMenu ----------- */
 
5881
 
 
5882
static PyObject *
 
5883
_wrap_gimp_unit_menu_set_pixel_digits(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5884
{
 
5885
    static char *kwlist[] = { "digits", NULL };
 
5886
    int digits;
 
5887
 
 
5888
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:GimpUnitMenu.set_pixel_digits", kwlist, &digits))
 
5889
        return NULL;
 
5890
    
 
5891
    gimp_unit_menu_set_pixel_digits(GIMP_UNIT_MENU(self->obj), digits);
 
5892
    
 
5893
    Py_INCREF(Py_None);
 
5894
    return Py_None;
 
5895
}
 
5896
 
 
5897
static PyObject *
 
5898
_wrap_gimp_unit_menu_get_pixel_digits(PyGObject *self)
 
5899
{
 
5900
    int ret;
 
5901
 
 
5902
    
 
5903
    ret = gimp_unit_menu_get_pixel_digits(GIMP_UNIT_MENU(self->obj));
 
5904
    
 
5905
    return PyInt_FromLong(ret);
 
5906
}
 
5907
 
 
5908
static const PyMethodDef _PyGimpUnitMenu_methods[] = {
 
5909
    { "set_pixel_digits", (PyCFunction)_wrap_gimp_unit_menu_set_pixel_digits, METH_VARARGS|METH_KEYWORDS,
 
5910
      NULL },
 
5911
    { "get_pixel_digits", (PyCFunction)_wrap_gimp_unit_menu_get_pixel_digits, METH_NOARGS,
 
5912
      NULL },
 
5913
    { NULL, NULL, 0, NULL }
 
5914
};
 
5915
 
 
5916
PyTypeObject G_GNUC_INTERNAL PyGimpUnitMenu_Type = {
 
5917
    PyObject_HEAD_INIT(NULL)
 
5918
    0,                                 /* ob_size */
 
5919
    "gimpui.UnitMenu",                   /* tp_name */
 
5920
    sizeof(PyGObject),          /* tp_basicsize */
 
5921
    0,                                 /* tp_itemsize */
 
5922
    /* methods */
 
5923
    (destructor)0,        /* tp_dealloc */
 
5924
    (printfunc)0,                      /* tp_print */
 
5925
    (getattrfunc)0,       /* tp_getattr */
 
5926
    (setattrfunc)0,       /* tp_setattr */
 
5927
    (cmpfunc)0,           /* tp_compare */
 
5928
    (reprfunc)0,             /* tp_repr */
 
5929
    (PyNumberMethods*)0,     /* tp_as_number */
 
5930
    (PySequenceMethods*)0, /* tp_as_sequence */
 
5931
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
5932
    (hashfunc)0,             /* tp_hash */
 
5933
    (ternaryfunc)0,          /* tp_call */
 
5934
    (reprfunc)0,              /* tp_str */
 
5935
    (getattrofunc)0,     /* tp_getattro */
 
5936
    (setattrofunc)0,     /* tp_setattro */
 
5937
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
5938
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
5939
    NULL,                        /* Documentation string */
 
5940
    (traverseproc)0,     /* tp_traverse */
 
5941
    (inquiry)0,             /* tp_clear */
 
5942
    (richcmpfunc)0,   /* tp_richcompare */
 
5943
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
5944
    (getiterfunc)0,          /* tp_iter */
 
5945
    (iternextfunc)0,     /* tp_iternext */
 
5946
    (struct PyMethodDef*)_PyGimpUnitMenu_methods, /* tp_methods */
 
5947
    (struct PyMemberDef*)0,              /* tp_members */
 
5948
    (struct PyGetSetDef*)0,  /* tp_getset */
 
5949
    NULL,                              /* tp_base */
 
5950
    NULL,                              /* tp_dict */
 
5951
    (descrgetfunc)0,    /* tp_descr_get */
 
5952
    (descrsetfunc)0,    /* tp_descr_set */
 
5953
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
5954
    (initproc)pygobject_no_constructor,             /* tp_init */
 
5955
    (allocfunc)0,           /* tp_alloc */
 
5956
    (newfunc)0,               /* tp_new */
 
5957
    (freefunc)0,             /* tp_free */
 
5958
    (inquiry)0              /* tp_is_gc */
 
5959
};
 
5960
 
 
5961
 
 
5962
 
 
5963
/* ----------- GimpZoomModel ----------- */
 
5964
 
 
5965
 static int
 
5966
_wrap_gimp_zoom_model_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5967
{
 
5968
    static char* kwlist[] = { NULL };
 
5969
 
 
5970
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
5971
                                     ":gimpui.ZoomModel.__init__",
 
5972
                                     kwlist))
 
5973
        return -1;
 
5974
 
 
5975
    pygobject_constructv(self, 0, NULL);
 
5976
    if (!self->obj) {
 
5977
        PyErr_SetString(
 
5978
            PyExc_RuntimeError, 
 
5979
            "could not create gimpui.ZoomModel object");
 
5980
        return -1;
 
5981
    }
 
5982
    return 0;
 
5983
}
 
5984
 
 
5985
static PyObject *
 
5986
_wrap_gimp_zoom_model_set_range(PyGObject *self, PyObject *args, PyObject *kwargs)
 
5987
{
 
5988
    static char *kwlist[] = { "min", "max", NULL };
 
5989
    double min, max;
 
5990
 
 
5991
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"dd:GimpZoomModel.set_range", kwlist, &min, &max))
 
5992
        return NULL;
 
5993
    
 
5994
    gimp_zoom_model_set_range(GIMP_ZOOM_MODEL(self->obj), min, max);
 
5995
    
 
5996
    Py_INCREF(Py_None);
 
5997
    return Py_None;
 
5998
}
 
5999
 
 
6000
static PyObject *
 
6001
_wrap_gimp_zoom_model_zoom(PyGObject *self, PyObject *args, PyObject *kwargs)
 
6002
{
 
6003
    static char *kwlist[] = { "zoom_type", "scale", NULL };
 
6004
    PyObject *py_zoom_type = NULL;
 
6005
    double scale;
 
6006
    GimpZoomType zoom_type;
 
6007
 
 
6008
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"Od:GimpZoomModel.zoom", kwlist, &py_zoom_type, &scale))
 
6009
        return NULL;
 
6010
    if (pyg_enum_get_value(GIMP_TYPE_ZOOM_TYPE, py_zoom_type, (gpointer)&zoom_type))
 
6011
        return NULL;
 
6012
    
 
6013
    gimp_zoom_model_zoom(GIMP_ZOOM_MODEL(self->obj), zoom_type, scale);
 
6014
    
 
6015
    Py_INCREF(Py_None);
 
6016
    return Py_None;
 
6017
}
 
6018
 
 
6019
static PyObject *
 
6020
_wrap_gimp_zoom_model_get_factor(PyGObject *self)
 
6021
{
 
6022
    double ret;
 
6023
 
 
6024
    
 
6025
    ret = gimp_zoom_model_get_factor(GIMP_ZOOM_MODEL(self->obj));
 
6026
    
 
6027
    return PyFloat_FromDouble(ret);
 
6028
}
 
6029
 
 
6030
static const PyMethodDef _PyGimpZoomModel_methods[] = {
 
6031
    { "set_range", (PyCFunction)_wrap_gimp_zoom_model_set_range, METH_VARARGS|METH_KEYWORDS,
 
6032
      NULL },
 
6033
    { "zoom", (PyCFunction)_wrap_gimp_zoom_model_zoom, METH_VARARGS|METH_KEYWORDS,
 
6034
      NULL },
 
6035
    { "get_factor", (PyCFunction)_wrap_gimp_zoom_model_get_factor, METH_NOARGS,
 
6036
      NULL },
 
6037
    { NULL, NULL, 0, NULL }
 
6038
};
 
6039
 
 
6040
PyTypeObject G_GNUC_INTERNAL PyGimpZoomModel_Type = {
 
6041
    PyObject_HEAD_INIT(NULL)
 
6042
    0,                                 /* ob_size */
 
6043
    "gimpui.ZoomModel",                   /* tp_name */
 
6044
    sizeof(PyGObject),          /* tp_basicsize */
 
6045
    0,                                 /* tp_itemsize */
 
6046
    /* methods */
 
6047
    (destructor)0,        /* tp_dealloc */
 
6048
    (printfunc)0,                      /* tp_print */
 
6049
    (getattrfunc)0,       /* tp_getattr */
 
6050
    (setattrfunc)0,       /* tp_setattr */
 
6051
    (cmpfunc)0,           /* tp_compare */
 
6052
    (reprfunc)0,             /* tp_repr */
 
6053
    (PyNumberMethods*)0,     /* tp_as_number */
 
6054
    (PySequenceMethods*)0, /* tp_as_sequence */
 
6055
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
6056
    (hashfunc)0,             /* tp_hash */
 
6057
    (ternaryfunc)0,          /* tp_call */
 
6058
    (reprfunc)0,              /* tp_str */
 
6059
    (getattrofunc)0,     /* tp_getattro */
 
6060
    (setattrofunc)0,     /* tp_setattro */
 
6061
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
6062
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
6063
    NULL,                        /* Documentation string */
 
6064
    (traverseproc)0,     /* tp_traverse */
 
6065
    (inquiry)0,             /* tp_clear */
 
6066
    (richcmpfunc)0,   /* tp_richcompare */
 
6067
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
6068
    (getiterfunc)0,          /* tp_iter */
 
6069
    (iternextfunc)0,     /* tp_iternext */
 
6070
    (struct PyMethodDef*)_PyGimpZoomModel_methods, /* tp_methods */
 
6071
    (struct PyMemberDef*)0,              /* tp_members */
 
6072
    (struct PyGetSetDef*)0,  /* tp_getset */
 
6073
    NULL,                              /* tp_base */
 
6074
    NULL,                              /* tp_dict */
 
6075
    (descrgetfunc)0,    /* tp_descr_get */
 
6076
    (descrsetfunc)0,    /* tp_descr_set */
 
6077
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
6078
    (initproc)_wrap_gimp_zoom_model_new,             /* tp_init */
 
6079
    (allocfunc)0,           /* tp_alloc */
 
6080
    (newfunc)0,               /* tp_new */
 
6081
    (freefunc)0,             /* tp_free */
 
6082
    (inquiry)0              /* tp_is_gc */
 
6083
};
 
6084
 
 
6085
 
 
6086
 
 
6087
/* ----------- GimpZoomPreview ----------- */
 
6088
 
 
6089
static int
 
6090
_wrap_gimp_zoom_preview_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
6091
{
 
6092
    GType obj_type = pyg_type_from_object((PyObject *) self);
 
6093
    GParameter params[1];
 
6094
    PyObject *parsed_args[1] = {NULL, };
 
6095
    char *arg_names[] = {"drawable", NULL };
 
6096
    char *prop_names[] = {"drawable", NULL };
 
6097
    guint nparams, i;
 
6098
 
 
6099
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gimpui.ZoomPreview.__init__" , arg_names , &parsed_args[0]))
 
6100
        return -1;
 
6101
 
 
6102
    memset(params, 0, sizeof(GParameter)*1);
 
6103
    if (!pyg_parse_constructor_args(obj_type, arg_names,
 
6104
                                    prop_names, params, 
 
6105
                                    &nparams, parsed_args))
 
6106
        return -1;
 
6107
    pygobject_constructv(self, nparams, params);
 
6108
    for (i = 0; i < nparams; ++i)
 
6109
        g_value_unset(&params[i].value);
 
6110
    if (!self->obj) {
 
6111
        PyErr_SetString(
 
6112
            PyExc_RuntimeError, 
 
6113
            "could not create gimpui.ZoomPreview object");
 
6114
        return -1;
 
6115
    }
 
6116
    return 0;
 
6117
}
 
6118
 
 
6119
static PyObject *
 
6120
_wrap_gimp_zoom_preview_get_factor(PyGObject *self)
 
6121
{
 
6122
    double ret;
 
6123
 
 
6124
    
 
6125
    ret = gimp_zoom_preview_get_factor(GIMP_ZOOM_PREVIEW(self->obj));
 
6126
    
 
6127
    return PyFloat_FromDouble(ret);
 
6128
}
 
6129
 
 
6130
static const PyMethodDef _PyGimpZoomPreview_methods[] = {
 
6131
    { "get_factor", (PyCFunction)_wrap_gimp_zoom_preview_get_factor, METH_NOARGS,
 
6132
      NULL },
 
6133
    { NULL, NULL, 0, NULL }
 
6134
};
 
6135
 
 
6136
PyTypeObject G_GNUC_INTERNAL PyGimpZoomPreview_Type = {
 
6137
    PyObject_HEAD_INIT(NULL)
 
6138
    0,                                 /* ob_size */
 
6139
    "gimpui.ZoomPreview",                   /* tp_name */
 
6140
    sizeof(PyGObject),          /* tp_basicsize */
 
6141
    0,                                 /* tp_itemsize */
 
6142
    /* methods */
 
6143
    (destructor)0,        /* tp_dealloc */
 
6144
    (printfunc)0,                      /* tp_print */
 
6145
    (getattrfunc)0,       /* tp_getattr */
 
6146
    (setattrfunc)0,       /* tp_setattr */
 
6147
    (cmpfunc)0,           /* tp_compare */
 
6148
    (reprfunc)0,             /* tp_repr */
 
6149
    (PyNumberMethods*)0,     /* tp_as_number */
 
6150
    (PySequenceMethods*)0, /* tp_as_sequence */
 
6151
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
6152
    (hashfunc)0,             /* tp_hash */
 
6153
    (ternaryfunc)0,          /* tp_call */
 
6154
    (reprfunc)0,              /* tp_str */
 
6155
    (getattrofunc)0,     /* tp_getattro */
 
6156
    (setattrofunc)0,     /* tp_setattro */
 
6157
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
6158
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
6159
    NULL,                        /* Documentation string */
 
6160
    (traverseproc)0,     /* tp_traverse */
 
6161
    (inquiry)0,             /* tp_clear */
 
6162
    (richcmpfunc)0,   /* tp_richcompare */
 
6163
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
6164
    (getiterfunc)0,          /* tp_iter */
 
6165
    (iternextfunc)0,     /* tp_iternext */
 
6166
    (struct PyMethodDef*)_PyGimpZoomPreview_methods, /* tp_methods */
 
6167
    (struct PyMemberDef*)0,              /* tp_members */
 
6168
    (struct PyGetSetDef*)0,  /* tp_getset */
 
6169
    NULL,                              /* tp_base */
 
6170
    NULL,                              /* tp_dict */
 
6171
    (descrgetfunc)0,    /* tp_descr_get */
 
6172
    (descrsetfunc)0,    /* tp_descr_set */
 
6173
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
6174
    (initproc)_wrap_gimp_zoom_preview_new,             /* tp_init */
 
6175
    (allocfunc)0,           /* tp_alloc */
 
6176
    (newfunc)0,               /* tp_new */
 
6177
    (freefunc)0,             /* tp_free */
 
6178
    (inquiry)0              /* tp_is_gc */
 
6179
};
 
6180
 
 
6181
 
 
6182
 
 
6183
/* ----------- GimpDrawableComboBox ----------- */
 
6184
 
 
6185
#line 61 "gimpui.override"
 
6186
static gboolean
 
6187
pygimp_drawable_constraint_marshal(gint32 image_id, gint32 drawable_id,
 
6188
                                   gpointer user_data)
 
6189
{
 
6190
    PyObject *img, *drw, *ret;
 
6191
    gboolean res;
 
6192
    PyGimpConstraintData *data = user_data;
 
6193
 
 
6194
    img = pygimp_image_new(image_id);
 
6195
    if (!img) {
 
6196
        PyErr_Print();
 
6197
        return FALSE;
 
6198
    }
 
6199
 
 
6200
    drw = pygimp_drawable_new(NULL, drawable_id);
 
6201
    if (!drw) {
 
6202
        PyErr_Print();
 
6203
        Py_DECREF(img);
 
6204
        return FALSE;
 
6205
    }
 
6206
 
 
6207
    if (data->user_data && data->user_data != Py_None)
 
6208
        ret = PyObject_CallFunctionObjArgs(data->constraint, img, drw,
 
6209
                                           data->user_data, NULL);
 
6210
    else
 
6211
        ret = PyObject_CallFunctionObjArgs(data->constraint, img, drw, NULL);
 
6212
 
 
6213
    if (!ret) {
 
6214
        PyErr_Print();
 
6215
        res = FALSE;
 
6216
    } else {
 
6217
        res = PyObject_IsTrue(ret);
 
6218
        Py_DECREF(ret);
 
6219
    }
 
6220
 
 
6221
    Py_DECREF(drw);
 
6222
    Py_DECREF(img);
 
6223
 
 
6224
    return res;
 
6225
}
 
6226
 
 
6227
static int
 
6228
_wrap_gimp_drawable_combo_box_new(PyGObject *self, PyObject *args,
 
6229
                                  PyObject *kwargs)
 
6230
{
 
6231
    PyObject *constraint = NULL, *user_data = NULL;
 
6232
    GimpDrawableConstraintFunc func = NULL;
 
6233
    PyGimpConstraintData *data = NULL;
 
6234
 
 
6235
    static char *kwlist[] = { "constraint", "data", NULL };
 
6236
 
 
6237
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
6238
                                     "|OO:gimpui.DrawableComboBox.__init__",
 
6239
                                     kwlist,
 
6240
                                     &constraint, &user_data))
 
6241
        return -1;
 
6242
 
 
6243
    if (constraint && constraint != Py_None) {
 
6244
        if (!PyCallable_Check(constraint)) {
 
6245
            PyErr_SetString(PyExc_TypeError, "first arg must be callable");
 
6246
            return -1;
 
6247
        }
 
6248
 
 
6249
        data = g_new(PyGimpConstraintData, 1);
 
6250
 
 
6251
        data->constraint = constraint;
 
6252
        Py_XINCREF(constraint);
 
6253
 
 
6254
        data->user_data = user_data;
 
6255
        Py_XINCREF(user_data);
 
6256
 
 
6257
        func = pygimp_drawable_constraint_marshal;
 
6258
    }
 
6259
 
 
6260
    self->obj = (GObject *)gimp_drawable_combo_box_new(func, data);
 
6261
 
 
6262
    Py_XDECREF(constraint);
 
6263
    Py_XDECREF(user_data);
 
6264
    g_free(data);
 
6265
 
 
6266
    if (pyg_type_from_object((PyObject *)self) != GIMP_TYPE_DRAWABLE_COMBO_BOX) {
 
6267
        PyErr_SetString(PyExc_RuntimeError, "__gobject_init__ must be used "
 
6268
                        "when subclassing gimpui.DrawableComboBox");
 
6269
        return -1;
 
6270
    }
 
6271
 
 
6272
    pygobject_register_wrapper((PyObject *)self);
 
6273
    return 0;
 
6274
}
 
6275
#line 6276 "gimpui.c"
 
6276
 
 
6277
 
 
6278
#line 152 "gimpui.override"
 
6279
static PyObject *
 
6280
_wrap_gimp_drawable_combo_box_set_active_drawable(PyGObject *self, PyObject *args, PyObject *kwargs)
 
6281
{
 
6282
    PyGimpDrawable *drw;
 
6283
 
 
6284
    static char *kwlist[] = { "drawable", NULL };
 
6285
 
 
6286
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
 
6287
                                     "O!:GimpDrawableComboBox.set_active_drawable",
 
6288
                                     kwlist,
 
6289
                                     PyGimpDrawable_Type, &drw))
 
6290
        return NULL;
 
6291
 
 
6292
    if (!gimp_int_combo_box_set_active(GIMP_INT_COMBO_BOX(self->obj), drw->ID)) {
 
6293
        PyErr_Format(pygimp_error,
 
6294
                     "Drawable (ID %d) does not exist in GimpDrawableComboBox",
 
6295
                     drw->ID);
 
6296
        return NULL;
 
6297
    }
 
6298
 
 
6299
    Py_INCREF(Py_None);
 
6300
    return Py_None;
 
6301
}
 
6302
#line 6303 "gimpui.c"
 
6303
 
 
6304
 
 
6305
#line 177 "gimpui.override"
 
6306
static PyObject *
 
6307
_wrap_gimp_drawable_combo_box_get_active_drawable(PyGObject *self)
 
6308
{
 
6309
    int value;
 
6310
 
 
6311
    if (gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(self->obj), &value))
 
6312
        return pygimp_drawable_new(NULL, value);
 
6313
 
 
6314
    Py_INCREF(Py_None);
 
6315
    return Py_None;
 
6316
}
 
6317
#line 6318 "gimpui.c"
 
6318
 
 
6319
 
 
6320
static const PyMethodDef _PyGimpDrawableComboBox_methods[] = {
 
6321
    { "set_active_drawable", (PyCFunction)_wrap_gimp_drawable_combo_box_set_active_drawable, METH_VARARGS|METH_KEYWORDS,
 
6322
      NULL },
 
6323
    { "get_active_drawable", (PyCFunction)_wrap_gimp_drawable_combo_box_get_active_drawable, METH_NOARGS,
 
6324
      NULL },
 
6325
    { NULL, NULL, 0, NULL }
 
6326
};
 
6327
 
 
6328
PyTypeObject G_GNUC_INTERNAL PyGimpDrawableComboBox_Type = {
 
6329
    PyObject_HEAD_INIT(NULL)
 
6330
    0,                                 /* ob_size */
 
6331
    "gimpui.DrawableComboBox",                   /* tp_name */
 
6332
    sizeof(PyGObject),          /* tp_basicsize */
 
6333
    0,                                 /* tp_itemsize */
 
6334
    /* methods */
 
6335
    (destructor)0,        /* tp_dealloc */
 
6336
    (printfunc)0,                      /* tp_print */
 
6337
    (getattrfunc)0,       /* tp_getattr */
 
6338
    (setattrfunc)0,       /* tp_setattr */
 
6339
    (cmpfunc)0,           /* tp_compare */
 
6340
    (reprfunc)0,             /* tp_repr */
 
6341
    (PyNumberMethods*)0,     /* tp_as_number */
 
6342
    (PySequenceMethods*)0, /* tp_as_sequence */
 
6343
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
6344
    (hashfunc)0,             /* tp_hash */
 
6345
    (ternaryfunc)0,          /* tp_call */
 
6346
    (reprfunc)0,              /* tp_str */
 
6347
    (getattrofunc)0,     /* tp_getattro */
 
6348
    (setattrofunc)0,     /* tp_setattro */
 
6349
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
6350
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
6351
    NULL,                        /* Documentation string */
 
6352
    (traverseproc)0,     /* tp_traverse */
 
6353
    (inquiry)0,             /* tp_clear */
 
6354
    (richcmpfunc)0,   /* tp_richcompare */
 
6355
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
6356
    (getiterfunc)0,          /* tp_iter */
 
6357
    (iternextfunc)0,     /* tp_iternext */
 
6358
    (struct PyMethodDef*)_PyGimpDrawableComboBox_methods, /* tp_methods */
 
6359
    (struct PyMemberDef*)0,              /* tp_members */
 
6360
    (struct PyGetSetDef*)0,  /* tp_getset */
 
6361
    NULL,                              /* tp_base */
 
6362
    NULL,                              /* tp_dict */
 
6363
    (descrgetfunc)0,    /* tp_descr_get */
 
6364
    (descrsetfunc)0,    /* tp_descr_set */
 
6365
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
6366
    (initproc)_wrap_gimp_drawable_combo_box_new,             /* tp_init */
 
6367
    (allocfunc)0,           /* tp_alloc */
 
6368
    (newfunc)0,               /* tp_new */
 
6369
    (freefunc)0,             /* tp_free */
 
6370
    (inquiry)0              /* tp_is_gc */
 
6371
};
 
6372
 
 
6373
 
 
6374
 
 
6375
/* ----------- GimpChannelComboBox ----------- */
 
6376
 
 
6377
#line 190 "gimpui.override"
 
6378
static gboolean
 
6379
pygimp_channel_constraint_marshal(gint32 image_id, gint32 channel_id,
 
6380
                                  gpointer user_data)
 
6381
{
 
6382
    PyObject *img, *chn, *ret;
 
6383
    gboolean res;
 
6384
    PyGimpConstraintData *data = user_data;
 
6385
 
 
6386
    img = pygimp_image_new(image_id);
 
6387
    if (!img) {
 
6388
        PyErr_Print();
 
6389
        return FALSE;
 
6390
    }
 
6391
 
 
6392
    chn = pygimp_channel_new(channel_id);
 
6393
    if (!chn) {
 
6394
        PyErr_Print();
 
6395
        Py_DECREF(img);
 
6396
        return FALSE;
 
6397
    }
 
6398
 
 
6399
    if (data->user_data && data->user_data != Py_None)
 
6400
        ret = PyObject_CallFunctionObjArgs(data->constraint, img, chn,
 
6401
                                           data->user_data, NULL);
 
6402
    else
 
6403
        ret = PyObject_CallFunctionObjArgs(data->constraint, img, chn, NULL);
 
6404
 
 
6405
    if (!ret) {
 
6406
        PyErr_Print();
 
6407
        res = FALSE;
 
6408
    } else {
 
6409
        res = PyObject_IsTrue(ret);
 
6410
        Py_DECREF(ret);
 
6411
    }
 
6412
 
 
6413
    Py_DECREF(chn);
 
6414
    Py_DECREF(img);
 
6415
 
 
6416
    return res;
 
6417
}
 
6418
 
 
6419
static int
 
6420
_wrap_gimp_channel_combo_box_new(PyGObject *self, PyObject *args,
 
6421
                                 PyObject *kwargs)
 
6422
{
 
6423
    PyObject *constraint = NULL, *user_data = NULL;
 
6424
    GimpDrawableConstraintFunc func = NULL;
 
6425
    PyGimpConstraintData *data = NULL;
 
6426
 
 
6427
    static char *kwlist[] = { "constraint", "data", NULL };
 
6428
 
 
6429
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
6430
                                     "|OO:gimpui.ChannelComboBox.__init__",
 
6431
                                     kwlist,
 
6432
                                     &constraint, &user_data))
 
6433
        return -1;
 
6434
 
 
6435
    if (constraint && constraint != Py_None) {
 
6436
        if (!PyCallable_Check(constraint)) {
 
6437
            PyErr_SetString(PyExc_TypeError, "first arg must be callable");
 
6438
            return -1;
 
6439
        }
 
6440
 
 
6441
        data = g_new(PyGimpConstraintData, 1);
 
6442
 
 
6443
        data->constraint = constraint;
 
6444
        Py_INCREF(constraint);
 
6445
 
 
6446
        data->user_data = user_data;
 
6447
        Py_XINCREF(user_data);
 
6448
 
 
6449
        func = pygimp_channel_constraint_marshal;
 
6450
    }
 
6451
 
 
6452
    self->obj = (GObject *)gimp_channel_combo_box_new(func, data);
 
6453
 
 
6454
    Py_XDECREF(constraint);
 
6455
    Py_XDECREF(user_data);
 
6456
    g_free(data);
 
6457
 
 
6458
    if (pyg_type_from_object((PyObject *)self) != GIMP_TYPE_CHANNEL_COMBO_BOX) {
 
6459
        PyErr_SetString(PyExc_RuntimeError, "__gobject_init__ must be used "
 
6460
                        "when subclassing gimpui.ChannelComboBox");
 
6461
        return -1;
 
6462
    }
 
6463
 
 
6464
    pygobject_register_wrapper((PyObject *)self);
 
6465
    return 0;
 
6466
}
 
6467
#line 6468 "gimpui.c"
 
6468
 
 
6469
 
 
6470
#line 281 "gimpui.override"
 
6471
static PyObject *
 
6472
_wrap_gimp_channel_combo_box_set_active_channel(PyGObject *self, PyObject *args, PyObject *kwargs)
 
6473
{
 
6474
    PyGimpChannel *chn;
 
6475
 
 
6476
    static char *kwlist[] = { "channel", NULL };
 
6477
 
 
6478
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
 
6479
                                     "O!:GimpChannelComboBox.set_active_channel",
 
6480
                                     kwlist,
 
6481
                                     PyGimpChannel_Type, &chn))
 
6482
        return NULL;
 
6483
 
 
6484
    if (!gimp_int_combo_box_set_active(GIMP_INT_COMBO_BOX(self->obj), chn->ID)) {
 
6485
        PyErr_Format(pygimp_error,
 
6486
                     "Channel (ID %d) does not exist in GimpChannelComboBox",
 
6487
                     chn->ID);
 
6488
        return NULL;
 
6489
    }
 
6490
 
 
6491
    Py_INCREF(Py_None);
 
6492
    return Py_None;
 
6493
}
 
6494
#line 6495 "gimpui.c"
 
6495
 
 
6496
 
 
6497
#line 306 "gimpui.override"
 
6498
static PyObject *
 
6499
_wrap_gimp_channel_combo_box_get_active_channel(PyGObject *self)
 
6500
{
 
6501
    int value;
 
6502
 
 
6503
    if (gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(self->obj), &value))
 
6504
        return pygimp_channel_new(value);
 
6505
 
 
6506
    Py_INCREF(Py_None);
 
6507
    return Py_None;
 
6508
}
 
6509
#line 6510 "gimpui.c"
 
6510
 
 
6511
 
 
6512
static const PyMethodDef _PyGimpChannelComboBox_methods[] = {
 
6513
    { "set_active_channel", (PyCFunction)_wrap_gimp_channel_combo_box_set_active_channel, METH_VARARGS|METH_KEYWORDS,
 
6514
      NULL },
 
6515
    { "get_active_channel", (PyCFunction)_wrap_gimp_channel_combo_box_get_active_channel, METH_NOARGS,
 
6516
      NULL },
 
6517
    { NULL, NULL, 0, NULL }
 
6518
};
 
6519
 
 
6520
PyTypeObject G_GNUC_INTERNAL PyGimpChannelComboBox_Type = {
 
6521
    PyObject_HEAD_INIT(NULL)
 
6522
    0,                                 /* ob_size */
 
6523
    "gimpui.ChannelComboBox",                   /* tp_name */
 
6524
    sizeof(PyGObject),          /* tp_basicsize */
 
6525
    0,                                 /* tp_itemsize */
 
6526
    /* methods */
 
6527
    (destructor)0,        /* tp_dealloc */
 
6528
    (printfunc)0,                      /* tp_print */
 
6529
    (getattrfunc)0,       /* tp_getattr */
 
6530
    (setattrfunc)0,       /* tp_setattr */
 
6531
    (cmpfunc)0,           /* tp_compare */
 
6532
    (reprfunc)0,             /* tp_repr */
 
6533
    (PyNumberMethods*)0,     /* tp_as_number */
 
6534
    (PySequenceMethods*)0, /* tp_as_sequence */
 
6535
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
6536
    (hashfunc)0,             /* tp_hash */
 
6537
    (ternaryfunc)0,          /* tp_call */
 
6538
    (reprfunc)0,              /* tp_str */
 
6539
    (getattrofunc)0,     /* tp_getattro */
 
6540
    (setattrofunc)0,     /* tp_setattro */
 
6541
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
6542
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
6543
    NULL,                        /* Documentation string */
 
6544
    (traverseproc)0,     /* tp_traverse */
 
6545
    (inquiry)0,             /* tp_clear */
 
6546
    (richcmpfunc)0,   /* tp_richcompare */
 
6547
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
6548
    (getiterfunc)0,          /* tp_iter */
 
6549
    (iternextfunc)0,     /* tp_iternext */
 
6550
    (struct PyMethodDef*)_PyGimpChannelComboBox_methods, /* tp_methods */
 
6551
    (struct PyMemberDef*)0,              /* tp_members */
 
6552
    (struct PyGetSetDef*)0,  /* tp_getset */
 
6553
    NULL,                              /* tp_base */
 
6554
    NULL,                              /* tp_dict */
 
6555
    (descrgetfunc)0,    /* tp_descr_get */
 
6556
    (descrsetfunc)0,    /* tp_descr_set */
 
6557
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
6558
    (initproc)_wrap_gimp_channel_combo_box_new,             /* tp_init */
 
6559
    (allocfunc)0,           /* tp_alloc */
 
6560
    (newfunc)0,               /* tp_new */
 
6561
    (freefunc)0,             /* tp_free */
 
6562
    (inquiry)0              /* tp_is_gc */
 
6563
};
 
6564
 
 
6565
 
 
6566
 
 
6567
/* ----------- GimpLayerComboBox ----------- */
 
6568
 
 
6569
#line 319 "gimpui.override"
 
6570
static gboolean
 
6571
pygimp_layer_constraint_marshal(gint32 image_id, gint32 layer_id,
 
6572
                                gpointer user_data)
 
6573
{
 
6574
    PyObject *img, *lay, *ret;
 
6575
    gboolean res;
 
6576
    PyGimpConstraintData *data = user_data;
 
6577
 
 
6578
    img = pygimp_image_new(image_id);
 
6579
    if (!img) {
 
6580
        PyErr_Print();
 
6581
        return FALSE;
 
6582
    }
 
6583
 
 
6584
    lay = pygimp_layer_new(layer_id);
 
6585
    if (!lay) {
 
6586
        PyErr_Print();
 
6587
        Py_DECREF(img);
 
6588
        return FALSE;
 
6589
    }
 
6590
 
 
6591
    if (data->user_data && data->user_data != Py_None)
 
6592
        ret = PyObject_CallFunctionObjArgs(data->constraint, img, lay,
 
6593
                                           data->user_data, NULL);
 
6594
    else
 
6595
        ret = PyObject_CallFunctionObjArgs(data->constraint, img, lay, NULL);
 
6596
 
 
6597
    if (!ret) {
 
6598
        PyErr_Print();
 
6599
        res = FALSE;
 
6600
    } else {
 
6601
        res = PyObject_IsTrue(ret);
 
6602
        Py_DECREF(ret);
 
6603
    }
 
6604
 
 
6605
    Py_DECREF(lay);
 
6606
    Py_DECREF(img);
 
6607
 
 
6608
    return res;
 
6609
}
 
6610
 
 
6611
static int
 
6612
_wrap_gimp_layer_combo_box_new(PyGObject *self, PyObject *args,
 
6613
                               PyObject *kwargs)
 
6614
{
 
6615
    PyObject *constraint = NULL, *user_data = NULL;
 
6616
    GimpDrawableConstraintFunc func = NULL;
 
6617
    PyGimpConstraintData *data = NULL;
 
6618
 
 
6619
    static char *kwlist[] = { "constraint", "data", NULL };
 
6620
 
 
6621
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
6622
                                     "|OO:gimpui.LayerComboBox.__init__",
 
6623
                                     kwlist,
 
6624
                                     &constraint, &user_data))
 
6625
        return -1;
 
6626
 
 
6627
    if (constraint && constraint != Py_None) {
 
6628
        if (!PyCallable_Check(constraint)) {
 
6629
            PyErr_SetString(PyExc_TypeError, "first arg must be callable");
 
6630
            return -1;
 
6631
        }
 
6632
 
 
6633
        data = g_new(PyGimpConstraintData, 1);
 
6634
 
 
6635
        data->constraint = constraint;
 
6636
        Py_INCREF(constraint);
 
6637
 
 
6638
        data->user_data = user_data;
 
6639
        Py_XINCREF(user_data);
 
6640
 
 
6641
        func = pygimp_layer_constraint_marshal;
 
6642
    }
 
6643
 
 
6644
    self->obj = (GObject *)gimp_layer_combo_box_new(func, data);
 
6645
 
 
6646
    Py_XDECREF(constraint);
 
6647
    Py_XDECREF(user_data);
 
6648
    g_free(data);
 
6649
 
 
6650
    if (pyg_type_from_object((PyObject *)self) != GIMP_TYPE_LAYER_COMBO_BOX) {
 
6651
        PyErr_SetString(PyExc_RuntimeError, "__gobject_init__ must be used "
 
6652
                        "when subclassing gimpui.LayerComboBox");
 
6653
        return -1;
 
6654
    }
 
6655
 
 
6656
    pygobject_register_wrapper((PyObject *)self);
 
6657
    return 0;
 
6658
}
 
6659
#line 6660 "gimpui.c"
 
6660
 
 
6661
 
 
6662
#line 435 "gimpui.override"
 
6663
static PyObject *
 
6664
_wrap_gimp_layer_combo_box_get_active_layer(PyGObject *self)
 
6665
{
 
6666
    int value;
 
6667
 
 
6668
    if (gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(self->obj), &value))
 
6669
        return pygimp_layer_new(value);
 
6670
 
 
6671
    Py_INCREF(Py_None);
 
6672
    return Py_None;
 
6673
}
 
6674
#line 6675 "gimpui.c"
 
6675
 
 
6676
 
 
6677
#line 410 "gimpui.override"
 
6678
static PyObject *
 
6679
_wrap_gimp_layer_combo_box_set_active_layer(PyGObject *self, PyObject *args, PyObject *kwargs)
 
6680
{
 
6681
    PyGimpLayer *lay;
 
6682
 
 
6683
    static char *kwlist[] = { "layer", NULL };
 
6684
 
 
6685
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
 
6686
                                     "O!:GimpLayerComboBox.set_active_layer",
 
6687
                                     kwlist,
 
6688
                                     PyGimpLayer_Type, &lay))
 
6689
        return NULL;
 
6690
 
 
6691
    if (!gimp_int_combo_box_set_active(GIMP_INT_COMBO_BOX(self->obj), lay->ID)) {
 
6692
        PyErr_Format(pygimp_error,
 
6693
                     "Layer (ID %d) does not exist in GimpLayerComboBox",
 
6694
                     lay->ID);
 
6695
        return NULL;
 
6696
    }
 
6697
 
 
6698
    Py_INCREF(Py_None);
 
6699
    return Py_None;
 
6700
}
 
6701
#line 6702 "gimpui.c"
 
6702
 
 
6703
 
 
6704
static const PyMethodDef _PyGimpLayerComboBox_methods[] = {
 
6705
    { "get_active_layer", (PyCFunction)_wrap_gimp_layer_combo_box_get_active_layer, METH_NOARGS,
 
6706
      NULL },
 
6707
    { "set_active_layer", (PyCFunction)_wrap_gimp_layer_combo_box_set_active_layer, METH_VARARGS|METH_KEYWORDS,
 
6708
      NULL },
 
6709
    { NULL, NULL, 0, NULL }
 
6710
};
 
6711
 
 
6712
PyTypeObject G_GNUC_INTERNAL PyGimpLayerComboBox_Type = {
 
6713
    PyObject_HEAD_INIT(NULL)
 
6714
    0,                                 /* ob_size */
 
6715
    "gimpui.LayerComboBox",                   /* tp_name */
 
6716
    sizeof(PyGObject),          /* tp_basicsize */
 
6717
    0,                                 /* tp_itemsize */
 
6718
    /* methods */
 
6719
    (destructor)0,        /* tp_dealloc */
 
6720
    (printfunc)0,                      /* tp_print */
 
6721
    (getattrfunc)0,       /* tp_getattr */
 
6722
    (setattrfunc)0,       /* tp_setattr */
 
6723
    (cmpfunc)0,           /* tp_compare */
 
6724
    (reprfunc)0,             /* tp_repr */
 
6725
    (PyNumberMethods*)0,     /* tp_as_number */
 
6726
    (PySequenceMethods*)0, /* tp_as_sequence */
 
6727
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
6728
    (hashfunc)0,             /* tp_hash */
 
6729
    (ternaryfunc)0,          /* tp_call */
 
6730
    (reprfunc)0,              /* tp_str */
 
6731
    (getattrofunc)0,     /* tp_getattro */
 
6732
    (setattrofunc)0,     /* tp_setattro */
 
6733
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
6734
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
6735
    NULL,                        /* Documentation string */
 
6736
    (traverseproc)0,     /* tp_traverse */
 
6737
    (inquiry)0,             /* tp_clear */
 
6738
    (richcmpfunc)0,   /* tp_richcompare */
 
6739
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
6740
    (getiterfunc)0,          /* tp_iter */
 
6741
    (iternextfunc)0,     /* tp_iternext */
 
6742
    (struct PyMethodDef*)_PyGimpLayerComboBox_methods, /* tp_methods */
 
6743
    (struct PyMemberDef*)0,              /* tp_members */
 
6744
    (struct PyGetSetDef*)0,  /* tp_getset */
 
6745
    NULL,                              /* tp_base */
 
6746
    NULL,                              /* tp_dict */
 
6747
    (descrgetfunc)0,    /* tp_descr_get */
 
6748
    (descrsetfunc)0,    /* tp_descr_set */
 
6749
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
6750
    (initproc)_wrap_gimp_layer_combo_box_new,             /* tp_init */
 
6751
    (allocfunc)0,           /* tp_alloc */
 
6752
    (newfunc)0,               /* tp_new */
 
6753
    (freefunc)0,             /* tp_free */
 
6754
    (inquiry)0              /* tp_is_gc */
 
6755
};
 
6756
 
 
6757
 
 
6758
 
 
6759
/* ----------- GimpVectorsComboBox ----------- */
 
6760
 
 
6761
#line 448 "gimpui.override"
 
6762
static gboolean
 
6763
pygimp_vectors_constraint_marshal(gint32 image_id, gint32 vectors_id,
 
6764
                                  gpointer user_data)
 
6765
{
 
6766
    PyObject *img, *vect, *ret;
 
6767
    gboolean res;
 
6768
    PyGimpConstraintData *data = user_data;
 
6769
 
 
6770
    img = pygimp_image_new(image_id);
 
6771
    if (!img) {
 
6772
        PyErr_Print();
 
6773
        return FALSE;
 
6774
    }
 
6775
 
 
6776
    vect = pygimp_vectors_new(vectors_id);
 
6777
    if (!vect) {
 
6778
        PyErr_Print();
 
6779
        Py_DECREF(img);
 
6780
        return FALSE;
 
6781
    }
 
6782
 
 
6783
    if (data->user_data && data->user_data != Py_None)
 
6784
        ret = PyObject_CallFunctionObjArgs(data->constraint, img, vect,
 
6785
                                           data->user_data, NULL);
 
6786
    else
 
6787
        ret = PyObject_CallFunctionObjArgs(data->constraint, img, vect, NULL);
 
6788
 
 
6789
    if (!ret) {
 
6790
        PyErr_Print();
 
6791
        res = FALSE;
 
6792
    } else {
 
6793
        res = PyObject_IsTrue(ret);
 
6794
        Py_DECREF(ret);
 
6795
    }
 
6796
 
 
6797
    Py_DECREF(vect);
 
6798
    Py_DECREF(img);
 
6799
 
 
6800
    return res;
 
6801
}
 
6802
 
 
6803
static int
 
6804
_wrap_gimp_vectors_combo_box_new(PyGObject *self, PyObject *args,
 
6805
                                 PyObject *kwargs)
 
6806
{
 
6807
    PyObject *constraint = NULL, *user_data = NULL;
 
6808
    GimpVectorsConstraintFunc func = NULL;
 
6809
    PyGimpConstraintData *data = NULL;
 
6810
 
 
6811
    static char *kwlist[] = { "constraint", "data", NULL };
 
6812
 
 
6813
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
6814
                                     "|OO:gimpui.VectorsComboBox.__init__",
 
6815
                                     kwlist,
 
6816
                                     &constraint, &user_data))
 
6817
        return -1;
 
6818
 
 
6819
    if (constraint && constraint != Py_None) {
 
6820
        if (!PyCallable_Check(constraint)) {
 
6821
            PyErr_SetString(PyExc_TypeError, "first arg must be callable");
 
6822
            return -1;
 
6823
        }
 
6824
 
 
6825
        data = g_new(PyGimpConstraintData, 1);
 
6826
 
 
6827
        data->constraint = constraint;
 
6828
        Py_INCREF(constraint);
 
6829
 
 
6830
        data->user_data = user_data;
 
6831
        Py_XINCREF(user_data);
 
6832
 
 
6833
        func = pygimp_vectors_constraint_marshal;
 
6834
    }
 
6835
 
 
6836
    self->obj = (GObject *)gimp_vectors_combo_box_new(func, data);
 
6837
 
 
6838
    Py_XDECREF(constraint);
 
6839
    Py_XDECREF(user_data);
 
6840
    g_free(data);
 
6841
 
 
6842
    if (pyg_type_from_object((PyObject *)self) != GIMP_TYPE_VECTORS_COMBO_BOX) {
 
6843
        PyErr_SetString(PyExc_RuntimeError, "__gobject_init__ must be used "
 
6844
                        "when subclassing gimpui.VectorsComboBox");
 
6845
        return -1;
 
6846
    }
 
6847
 
 
6848
    pygobject_register_wrapper((PyObject *)self);
 
6849
    return 0;
 
6850
}
 
6851
#line 6852 "gimpui.c"
 
6852
 
 
6853
 
 
6854
#line 564 "gimpui.override"
 
6855
static PyObject *
 
6856
_wrap_gimp_vectors_combo_box_get_active_vectors(PyGObject *self)
 
6857
{
 
6858
    int value;
 
6859
 
 
6860
    if (gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(self->obj), &value))
 
6861
        return pygimp_vectors_new(value);
 
6862
 
 
6863
    Py_INCREF(Py_None);
 
6864
    return Py_None;
 
6865
}
 
6866
#line 6867 "gimpui.c"
 
6867
 
 
6868
 
 
6869
#line 539 "gimpui.override"
 
6870
static PyObject *
 
6871
_wrap_gimp_vectors_combo_box_set_active_vectors(PyGObject *self, PyObject *args, PyObject *kwargs)
 
6872
{
 
6873
    PyGimpVectors *vect;
 
6874
 
 
6875
    static char *kwlist[] = { "vectors", NULL };
 
6876
 
 
6877
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
 
6878
                                     "O!:GimpVectorsComboBox.set_active_vectors",
 
6879
                                     kwlist,
 
6880
                                     PyGimpVectors_Type, &vect))
 
6881
        return NULL;
 
6882
 
 
6883
    if (!gimp_int_combo_box_set_active(GIMP_INT_COMBO_BOX(self->obj), vect->ID)) {
 
6884
        PyErr_Format(pygimp_error,
 
6885
                     "Vectors (ID %d) does not exist in GimpVectorsComboBox",
 
6886
                     vect->ID);
 
6887
        return NULL;
 
6888
    }
 
6889
 
 
6890
    Py_INCREF(Py_None);
 
6891
    return Py_None;
 
6892
}
 
6893
#line 6894 "gimpui.c"
 
6894
 
 
6895
 
 
6896
static const PyMethodDef _PyGimpVectorsComboBox_methods[] = {
 
6897
    { "get_active_vectors", (PyCFunction)_wrap_gimp_vectors_combo_box_get_active_vectors, METH_NOARGS,
 
6898
      NULL },
 
6899
    { "set_active_vectors", (PyCFunction)_wrap_gimp_vectors_combo_box_set_active_vectors, METH_VARARGS|METH_KEYWORDS,
 
6900
      NULL },
 
6901
    { NULL, NULL, 0, NULL }
 
6902
};
 
6903
 
 
6904
PyTypeObject G_GNUC_INTERNAL PyGimpVectorsComboBox_Type = {
 
6905
    PyObject_HEAD_INIT(NULL)
 
6906
    0,                                 /* ob_size */
 
6907
    "gimpui.VectorsComboBox",                   /* tp_name */
 
6908
    sizeof(PyGObject),          /* tp_basicsize */
 
6909
    0,                                 /* tp_itemsize */
 
6910
    /* methods */
 
6911
    (destructor)0,        /* tp_dealloc */
 
6912
    (printfunc)0,                      /* tp_print */
 
6913
    (getattrfunc)0,       /* tp_getattr */
 
6914
    (setattrfunc)0,       /* tp_setattr */
 
6915
    (cmpfunc)0,           /* tp_compare */
 
6916
    (reprfunc)0,             /* tp_repr */
 
6917
    (PyNumberMethods*)0,     /* tp_as_number */
 
6918
    (PySequenceMethods*)0, /* tp_as_sequence */
 
6919
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
6920
    (hashfunc)0,             /* tp_hash */
 
6921
    (ternaryfunc)0,          /* tp_call */
 
6922
    (reprfunc)0,              /* tp_str */
 
6923
    (getattrofunc)0,     /* tp_getattro */
 
6924
    (setattrofunc)0,     /* tp_setattro */
 
6925
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
6926
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
6927
    NULL,                        /* Documentation string */
 
6928
    (traverseproc)0,     /* tp_traverse */
 
6929
    (inquiry)0,             /* tp_clear */
 
6930
    (richcmpfunc)0,   /* tp_richcompare */
 
6931
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
6932
    (getiterfunc)0,          /* tp_iter */
 
6933
    (iternextfunc)0,     /* tp_iternext */
 
6934
    (struct PyMethodDef*)_PyGimpVectorsComboBox_methods, /* tp_methods */
 
6935
    (struct PyMemberDef*)0,              /* tp_members */
 
6936
    (struct PyGetSetDef*)0,  /* tp_getset */
 
6937
    NULL,                              /* tp_base */
 
6938
    NULL,                              /* tp_dict */
 
6939
    (descrgetfunc)0,    /* tp_descr_get */
 
6940
    (descrsetfunc)0,    /* tp_descr_set */
 
6941
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
6942
    (initproc)_wrap_gimp_vectors_combo_box_new,             /* tp_init */
 
6943
    (allocfunc)0,           /* tp_alloc */
 
6944
    (newfunc)0,               /* tp_new */
 
6945
    (freefunc)0,             /* tp_free */
 
6946
    (inquiry)0              /* tp_is_gc */
 
6947
};
 
6948
 
 
6949
 
 
6950
 
 
6951
/* ----------- GimpImageComboBox ----------- */
 
6952
 
 
6953
#line 577 "gimpui.override"
 
6954
static gboolean
 
6955
pygimp_image_constraint_marshal(gint32 image_id, gpointer user_data)
 
6956
{
 
6957
    PyObject *img, *ret;
 
6958
    gboolean res;
 
6959
    PyGimpConstraintData *data = user_data;
 
6960
 
 
6961
    img = pygimp_image_new(image_id);
 
6962
    if (!img) {
 
6963
        PyErr_Print();
 
6964
        return FALSE;
 
6965
    }
 
6966
 
 
6967
    if (data->user_data && data->user_data != Py_None)
 
6968
        ret = PyObject_CallFunctionObjArgs(data->constraint, img,
 
6969
                                           data->user_data, NULL);
 
6970
    else
 
6971
        ret = PyObject_CallFunctionObjArgs(data->constraint, img, NULL);
 
6972
 
 
6973
    if (!ret) {
 
6974
        PyErr_Print();
 
6975
        res = FALSE;
 
6976
    } else {
 
6977
        res = PyObject_IsTrue(ret);
 
6978
        Py_DECREF(ret);
 
6979
    }
 
6980
 
 
6981
    Py_DECREF(img);
 
6982
 
 
6983
    return res;
 
6984
}
 
6985
 
 
6986
static int
 
6987
_wrap_gimp_image_combo_box_new(PyGObject *self, PyObject *args,
 
6988
                               PyObject *kwargs)
 
6989
{
 
6990
    PyObject *constraint = NULL, *user_data = NULL;
 
6991
    GimpImageConstraintFunc func = NULL;
 
6992
    PyGimpConstraintData *data = NULL;
 
6993
 
 
6994
    static char *kwlist[] = { "constraint", "data", NULL };
 
6995
 
 
6996
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
6997
                                     "|OO:gimpui.ImageComboBox.__init__",
 
6998
                                     kwlist,
 
6999
                                     &constraint, &user_data))
 
7000
        return -1;
 
7001
 
 
7002
    if (constraint && constraint != Py_None) {
 
7003
        if (!PyCallable_Check(constraint)) {
 
7004
            PyErr_SetString(PyExc_TypeError, "first arg must be callable");
 
7005
            return -1;
 
7006
        }
 
7007
 
 
7008
        data = g_new(PyGimpConstraintData, 1);
 
7009
 
 
7010
        data->constraint = constraint;
 
7011
        Py_INCREF(constraint);
 
7012
 
 
7013
        data->user_data = user_data;
 
7014
        Py_XINCREF(user_data);
 
7015
 
 
7016
        func = pygimp_image_constraint_marshal;
 
7017
    }
 
7018
 
 
7019
    self->obj = (GObject *)gimp_image_combo_box_new(func, data);
 
7020
 
 
7021
    Py_XDECREF(constraint);
 
7022
    Py_XDECREF(user_data);
 
7023
    g_free(data);
 
7024
 
 
7025
    if (pyg_type_from_object((PyObject *)self) != GIMP_TYPE_IMAGE_COMBO_BOX) {
 
7026
        PyErr_SetString(PyExc_RuntimeError, "__gobject_init__ must be used "
 
7027
                        "when subclassing gimpui.ImageComboBox");
 
7028
        return -1;
 
7029
    }
 
7030
 
 
7031
    pygobject_register_wrapper((PyObject *)self);
 
7032
    return 0;
 
7033
}
 
7034
#line 7035 "gimpui.c"
 
7035
 
 
7036
 
 
7037
#line 684 "gimpui.override"
 
7038
static PyObject *
 
7039
_wrap_gimp_image_combo_box_get_active_image(PyGObject *self)
 
7040
{
 
7041
    int value;
 
7042
 
 
7043
    if (gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(self->obj), &value))
 
7044
        return pygimp_image_new(value);
 
7045
 
 
7046
    Py_INCREF(Py_None);
 
7047
    return Py_None;
 
7048
}
 
7049
#line 7050 "gimpui.c"
 
7050
 
 
7051
 
 
7052
#line 659 "gimpui.override"
 
7053
static PyObject *
 
7054
_wrap_gimp_image_combo_box_set_active_image(PyGObject *self, PyObject *args, PyObject *kwargs)
 
7055
{
 
7056
    PyGimpImage *img;
 
7057
 
 
7058
    static char *kwlist[] = { "image", NULL };
 
7059
 
 
7060
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
 
7061
                                     "O!:GimpImageComboBox.set_active_image",
 
7062
                                     kwlist,
 
7063
                                     PyGimpImage_Type, &img))
 
7064
        return NULL;
 
7065
 
 
7066
    if (!gimp_int_combo_box_set_active(GIMP_INT_COMBO_BOX(self->obj), img->ID)) {
 
7067
        PyErr_Format(pygimp_error,
 
7068
                     "Image (ID %d) does not exist in GimpImageComboBox",
 
7069
                     img->ID);
 
7070
        return NULL;
 
7071
    }
 
7072
 
 
7073
    Py_INCREF(Py_None);
 
7074
    return Py_None;
 
7075
}
 
7076
#line 7077 "gimpui.c"
 
7077
 
 
7078
 
 
7079
static const PyMethodDef _PyGimpImageComboBox_methods[] = {
 
7080
    { "get_active_image", (PyCFunction)_wrap_gimp_image_combo_box_get_active_image, METH_NOARGS,
 
7081
      NULL },
 
7082
    { "set_active_image", (PyCFunction)_wrap_gimp_image_combo_box_set_active_image, METH_VARARGS|METH_KEYWORDS,
 
7083
      NULL },
 
7084
    { NULL, NULL, 0, NULL }
 
7085
};
 
7086
 
 
7087
PyTypeObject G_GNUC_INTERNAL PyGimpImageComboBox_Type = {
 
7088
    PyObject_HEAD_INIT(NULL)
 
7089
    0,                                 /* ob_size */
 
7090
    "gimpui.ImageComboBox",                   /* tp_name */
 
7091
    sizeof(PyGObject),          /* tp_basicsize */
 
7092
    0,                                 /* tp_itemsize */
 
7093
    /* methods */
 
7094
    (destructor)0,        /* tp_dealloc */
 
7095
    (printfunc)0,                      /* tp_print */
 
7096
    (getattrfunc)0,       /* tp_getattr */
 
7097
    (setattrfunc)0,       /* tp_setattr */
 
7098
    (cmpfunc)0,           /* tp_compare */
 
7099
    (reprfunc)0,             /* tp_repr */
 
7100
    (PyNumberMethods*)0,     /* tp_as_number */
 
7101
    (PySequenceMethods*)0, /* tp_as_sequence */
 
7102
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
7103
    (hashfunc)0,             /* tp_hash */
 
7104
    (ternaryfunc)0,          /* tp_call */
 
7105
    (reprfunc)0,              /* tp_str */
 
7106
    (getattrofunc)0,     /* tp_getattro */
 
7107
    (setattrofunc)0,     /* tp_setattro */
 
7108
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
7109
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
7110
    NULL,                        /* Documentation string */
 
7111
    (traverseproc)0,     /* tp_traverse */
 
7112
    (inquiry)0,             /* tp_clear */
 
7113
    (richcmpfunc)0,   /* tp_richcompare */
 
7114
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
7115
    (getiterfunc)0,          /* tp_iter */
 
7116
    (iternextfunc)0,     /* tp_iternext */
 
7117
    (struct PyMethodDef*)_PyGimpImageComboBox_methods, /* tp_methods */
 
7118
    (struct PyMemberDef*)0,              /* tp_members */
 
7119
    (struct PyGetSetDef*)0,  /* tp_getset */
 
7120
    NULL,                              /* tp_base */
 
7121
    NULL,                              /* tp_dict */
 
7122
    (descrgetfunc)0,    /* tp_descr_get */
 
7123
    (descrsetfunc)0,    /* tp_descr_set */
 
7124
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
7125
    (initproc)_wrap_gimp_image_combo_box_new,             /* tp_init */
 
7126
    (allocfunc)0,           /* tp_alloc */
 
7127
    (newfunc)0,               /* tp_new */
 
7128
    (freefunc)0,             /* tp_free */
 
7129
    (inquiry)0              /* tp_is_gc */
 
7130
};
 
7131
 
 
7132
 
 
7133
 
 
7134
/* ----------- functions ----------- */
 
7135
 
 
7136
static PyObject *
 
7137
_wrap_gimp_dialogs_show_help_button(PyObject *self, PyObject *args, PyObject *kwargs)
 
7138
{
 
7139
    static char *kwlist[] = { "show", NULL };
 
7140
    int show;
 
7141
 
 
7142
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:gimp_dialogs_show_help_button", kwlist, &show))
 
7143
        return NULL;
 
7144
    
 
7145
    gimp_dialogs_show_help_button(show);
 
7146
    
 
7147
    Py_INCREF(Py_None);
 
7148
    return Py_None;
 
7149
}
 
7150
 
 
7151
static PyObject *
 
7152
_wrap_gimp_enum_stock_box_set_child_padding(PyObject *self, PyObject *args, PyObject *kwargs)
 
7153
{
 
7154
    static char *kwlist[] = { "stock_box", "xpad", "ypad", NULL };
 
7155
    PyGObject *stock_box;
 
7156
    int xpad, ypad;
 
7157
 
 
7158
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!ii:gimp_enum_stock_box_set_child_padding", kwlist, &PyGtkWidget_Type, &stock_box, &xpad, &ypad))
 
7159
        return NULL;
 
7160
    
 
7161
    gimp_enum_stock_box_set_child_padding(GTK_WIDGET(stock_box->obj), xpad, ypad);
 
7162
    
 
7163
    Py_INCREF(Py_None);
 
7164
    return Py_None;
 
7165
}
 
7166
 
 
7167
static PyObject *
 
7168
_wrap_gimp_int_store_lookup_by_value(PyObject *self, PyObject *args, PyObject *kwargs)
 
7169
{
 
7170
    static char *kwlist[] = { "model", "value", "iter", NULL };
 
7171
    PyGObject *model;
 
7172
    int value, ret;
 
7173
    PyObject *py_iter;
 
7174
    GtkTreeIter *iter = NULL;
 
7175
 
 
7176
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!iO:gimp_int_store_lookup_by_value", kwlist, &PyGtkTreeModel_Type, &model, &value, &py_iter))
 
7177
        return NULL;
 
7178
    if (pyg_boxed_check(py_iter, GTK_TYPE_TREE_ITER))
 
7179
        iter = pyg_boxed_get(py_iter, GtkTreeIter);
 
7180
    else {
 
7181
        PyErr_SetString(PyExc_TypeError, "iter should be a GtkTreeIter");
 
7182
        return NULL;
 
7183
    }
 
7184
    
 
7185
    ret = gimp_int_store_lookup_by_value(GTK_TREE_MODEL(model->obj), value, iter);
 
7186
    
 
7187
    return PyBool_FromLong(ret);
 
7188
 
 
7189
}
 
7190
 
 
7191
static PyObject *
 
7192
_wrap_gimp_prop_coordinates_connect(PyObject *self, PyObject *args, PyObject *kwargs)
 
7193
{
 
7194
    static char *kwlist[] = { "config", "x_property_name", "y_property_name", "unit_property_name", "sizeentry", "chainbutton", "xresolution", "yresolution", NULL };
 
7195
    PyGObject *config, *sizeentry, *chainbutton;
 
7196
    char *x_property_name, *y_property_name, *unit_property_name;
 
7197
    int ret;
 
7198
    double xresolution, yresolution;
 
7199
 
 
7200
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!sssO!O!dd:gimp_prop_coordinates_connect", kwlist, &PyGObject_Type, &config, &x_property_name, &y_property_name, &unit_property_name, &PyGtkWidget_Type, &sizeentry, &PyGtkWidget_Type, &chainbutton, &xresolution, &yresolution))
 
7201
        return NULL;
 
7202
    
 
7203
    ret = gimp_prop_coordinates_connect(G_OBJECT(config->obj), x_property_name, y_property_name, unit_property_name, GTK_WIDGET(sizeentry->obj), GTK_WIDGET(chainbutton->obj), xresolution, yresolution);
 
7204
    
 
7205
    return PyBool_FromLong(ret);
 
7206
 
 
7207
}
 
7208
 
 
7209
static PyObject *
 
7210
_wrap_gimp_int_radio_group_set_active(PyObject *self, PyObject *args, PyObject *kwargs)
 
7211
{
 
7212
    static char *kwlist[] = { "radio_button", "item_data", NULL };
 
7213
    PyGObject *radio_button;
 
7214
    int item_data;
 
7215
 
 
7216
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!i:gimp_int_radio_group_set_active", kwlist, &PyGtkRadioButton_Type, &radio_button, &item_data))
 
7217
        return NULL;
 
7218
    
 
7219
    gimp_int_radio_group_set_active(GTK_RADIO_BUTTON(radio_button->obj), item_data);
 
7220
    
 
7221
    Py_INCREF(Py_None);
 
7222
    return Py_None;
 
7223
}
 
7224
 
 
7225
static PyObject *
 
7226
_wrap_gimp_scale_entry_set_sensitive(PyObject *self, PyObject *args, PyObject *kwargs)
 
7227
{
 
7228
    static char *kwlist[] = { "adjustment", "sensitive", NULL };
 
7229
    PyGObject *adjustment;
 
7230
    int sensitive;
 
7231
 
 
7232
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!i:gimp_scale_entry_set_sensitive", kwlist, &PyGtkObject_Type, &adjustment, &sensitive))
 
7233
        return NULL;
 
7234
    
 
7235
    gimp_scale_entry_set_sensitive(GTK_OBJECT(adjustment->obj), sensitive);
 
7236
    
 
7237
    Py_INCREF(Py_None);
 
7238
    return Py_None;
 
7239
}
 
7240
 
 
7241
static PyObject *
 
7242
_wrap_gimp_scale_entry_set_logarithmic(PyObject *self, PyObject *args, PyObject *kwargs)
 
7243
{
 
7244
    static char *kwlist[] = { "adjustment", "logarithmic", NULL };
 
7245
    PyGObject *adjustment;
 
7246
    int logarithmic;
 
7247
 
 
7248
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!i:gimp_scale_entry_set_logarithmic", kwlist, &PyGtkObject_Type, &adjustment, &logarithmic))
 
7249
        return NULL;
 
7250
    
 
7251
    gimp_scale_entry_set_logarithmic(GTK_OBJECT(adjustment->obj), logarithmic);
 
7252
    
 
7253
    Py_INCREF(Py_None);
 
7254
    return Py_None;
 
7255
}
 
7256
 
 
7257
static PyObject *
 
7258
_wrap_gimp_scale_entry_get_logarithmic(PyObject *self, PyObject *args, PyObject *kwargs)
 
7259
{
 
7260
    static char *kwlist[] = { "adjustment", NULL };
 
7261
    PyGObject *adjustment;
 
7262
    int ret;
 
7263
 
 
7264
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:gimp_scale_entry_get_logarithmic", kwlist, &PyGtkObject_Type, &adjustment))
 
7265
        return NULL;
 
7266
    
 
7267
    ret = gimp_scale_entry_get_logarithmic(GTK_OBJECT(adjustment->obj));
 
7268
    
 
7269
    return PyBool_FromLong(ret);
 
7270
 
 
7271
}
 
7272
 
 
7273
static PyObject *
 
7274
_wrap_gimp_toggle_button_sensitive_update(PyObject *self, PyObject *args, PyObject *kwargs)
 
7275
{
 
7276
    static char *kwlist[] = { "toggle_button", NULL };
 
7277
    PyGObject *toggle_button;
 
7278
 
 
7279
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:gimp_toggle_button_sensitive_update", kwlist, &PyGtkToggleButton_Type, &toggle_button))
 
7280
        return NULL;
 
7281
    
 
7282
    gimp_toggle_button_sensitive_update(GTK_TOGGLE_BUTTON(toggle_button->obj));
 
7283
    
 
7284
    Py_INCREF(Py_None);
 
7285
    return Py_None;
 
7286
}
 
7287
 
 
7288
static PyObject *
 
7289
_wrap_gimp_table_attach_aligned(PyObject *self, PyObject *args, PyObject *kwargs)
 
7290
{
 
7291
    static char *kwlist[] = { "table", "column", "row", "label_text", "xalign", "yalign", "widget", "colspan", "left_align", NULL };
 
7292
    PyGObject *table, *widget;
 
7293
    int column, row, colspan, left_align;
 
7294
    char *label_text;
 
7295
    GtkWidget *ret;
 
7296
    double xalign, yalign;
 
7297
 
 
7298
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!iisddO!ii:gimp_table_attach_aligned", kwlist, &PyGtkTable_Type, &table, &column, &row, &label_text, &xalign, &yalign, &PyGtkWidget_Type, &widget, &colspan, &left_align))
 
7299
        return NULL;
 
7300
    
 
7301
    ret = gimp_table_attach_aligned(GTK_TABLE(table->obj), column, row, label_text, xalign, yalign, GTK_WIDGET(widget->obj), colspan, left_align);
 
7302
    
 
7303
    /* pygobject_new handles NULL checking */
 
7304
    return pygobject_new((GObject *)ret);
 
7305
}
 
7306
 
 
7307
static PyObject *
 
7308
_wrap_gimp_zoom_model_zoom_step(PyObject *self, PyObject *args, PyObject *kwargs)
 
7309
{
 
7310
    static char *kwlist[] = { "zoom_type", "scale", NULL };
 
7311
    PyObject *py_zoom_type = NULL;
 
7312
    double scale, ret;
 
7313
    GimpZoomType zoom_type;
 
7314
 
 
7315
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"Od:gimp_zoom_model_zoom_step", kwlist, &py_zoom_type, &scale))
 
7316
        return NULL;
 
7317
    if (pyg_enum_get_value(GIMP_TYPE_ZOOM_TYPE, py_zoom_type, (gpointer)&zoom_type))
 
7318
        return NULL;
 
7319
    
 
7320
    ret = gimp_zoom_model_zoom_step(zoom_type, scale);
 
7321
    
 
7322
    return PyFloat_FromDouble(ret);
 
7323
}
 
7324
 
 
7325
const PyMethodDef gimpui_functions[] = {
 
7326
    { "gimp_dialogs_show_help_button", (PyCFunction)_wrap_gimp_dialogs_show_help_button, METH_VARARGS|METH_KEYWORDS,
 
7327
      NULL },
 
7328
    { "gimp_enum_stock_box_set_child_padding", (PyCFunction)_wrap_gimp_enum_stock_box_set_child_padding, METH_VARARGS|METH_KEYWORDS,
 
7329
      NULL },
 
7330
    { "gimp_int_store_lookup_by_value", (PyCFunction)_wrap_gimp_int_store_lookup_by_value, METH_VARARGS|METH_KEYWORDS,
 
7331
      NULL },
 
7332
    { "gimp_prop_coordinates_connect", (PyCFunction)_wrap_gimp_prop_coordinates_connect, METH_VARARGS|METH_KEYWORDS,
 
7333
      NULL },
 
7334
    { "gimp_int_radio_group_set_active", (PyCFunction)_wrap_gimp_int_radio_group_set_active, METH_VARARGS|METH_KEYWORDS,
 
7335
      NULL },
 
7336
    { "gimp_scale_entry_set_sensitive", (PyCFunction)_wrap_gimp_scale_entry_set_sensitive, METH_VARARGS|METH_KEYWORDS,
 
7337
      NULL },
 
7338
    { "gimp_scale_entry_set_logarithmic", (PyCFunction)_wrap_gimp_scale_entry_set_logarithmic, METH_VARARGS|METH_KEYWORDS,
 
7339
      NULL },
 
7340
    { "gimp_scale_entry_get_logarithmic", (PyCFunction)_wrap_gimp_scale_entry_get_logarithmic, METH_VARARGS|METH_KEYWORDS,
 
7341
      NULL },
 
7342
    { "gimp_toggle_button_sensitive_update", (PyCFunction)_wrap_gimp_toggle_button_sensitive_update, METH_VARARGS|METH_KEYWORDS,
 
7343
      NULL },
 
7344
    { "gimp_table_attach_aligned", (PyCFunction)_wrap_gimp_table_attach_aligned, METH_VARARGS|METH_KEYWORDS,
 
7345
      NULL },
 
7346
    { "gimp_zoom_model_zoom_step", (PyCFunction)_wrap_gimp_zoom_model_zoom_step, METH_VARARGS|METH_KEYWORDS,
 
7347
      NULL },
 
7348
    { NULL, NULL, 0, NULL }
 
7349
};
 
7350
 
 
7351
 
 
7352
/* ----------- enums and flags ----------- */
 
7353
 
 
7354
void
 
7355
gimpui_add_constants(PyObject *module, const gchar *strip_prefix)
 
7356
{
 
7357
  pyg_enum_add(module, "ChainPosition", strip_prefix, GIMP_TYPE_CHAIN_POSITION);
 
7358
  pyg_enum_add(module, "ColorAreaType", strip_prefix, GIMP_TYPE_COLOR_AREA_TYPE);
 
7359
  pyg_enum_add(module, "ColorSelectorChannel", strip_prefix, GIMP_TYPE_COLOR_SELECTOR_CHANNEL);
 
7360
  pyg_enum_add(module, "PageSelectorTarget", strip_prefix, GIMP_TYPE_PAGE_SELECTOR_TARGET);
 
7361
  pyg_enum_add(module, "SizeEntryUpdatePolicy", strip_prefix, GIMP_TYPE_SIZE_ENTRY_UPDATE_POLICY);
 
7362
  pyg_enum_add(module, "ZoomType", strip_prefix, GIMP_TYPE_ZOOM_TYPE);
 
7363
 
 
7364
  if (PyErr_Occurred())
 
7365
    PyErr_Print();
 
7366
}
 
7367
 
 
7368
/* initialise stuff extension classes */
 
7369
void
 
7370
gimpui_register_classes(PyObject *d)
 
7371
{
 
7372
    PyObject *module;
 
7373
 
 
7374
    if ((module = PyImport_ImportModule("gobject")) != NULL) {
 
7375
        _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
 
7376
        if (_PyGObject_Type == NULL) {
 
7377
            PyErr_SetString(PyExc_ImportError,
 
7378
                "cannot import name GObject from gobject");
 
7379
            return ;
 
7380
        }
 
7381
    } else {
 
7382
        PyErr_SetString(PyExc_ImportError,
 
7383
            "could not import gobject");
 
7384
        return ;
 
7385
    }
 
7386
    if ((module = PyImport_ImportModule("gtk")) != NULL) {
 
7387
        _PyGtkObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Object");
 
7388
        if (_PyGtkObject_Type == NULL) {
 
7389
            PyErr_SetString(PyExc_ImportError,
 
7390
                "cannot import name Object from gtk");
 
7391
            return ;
 
7392
        }
 
7393
        _PyGtkWidget_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Widget");
 
7394
        if (_PyGtkWidget_Type == NULL) {
 
7395
            PyErr_SetString(PyExc_ImportError,
 
7396
                "cannot import name Widget from gtk");
 
7397
            return ;
 
7398
        }
 
7399
        _PyGtkDialog_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Dialog");
 
7400
        if (_PyGtkDialog_Type == NULL) {
 
7401
            PyErr_SetString(PyExc_ImportError,
 
7402
                "cannot import name Dialog from gtk");
 
7403
            return ;
 
7404
        }
 
7405
        _PyGtkWindow_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Window");
 
7406
        if (_PyGtkWindow_Type == NULL) {
 
7407
            PyErr_SetString(PyExc_ImportError,
 
7408
                "cannot import name Window from gtk");
 
7409
            return ;
 
7410
        }
 
7411
        _PyGtkLabel_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Label");
 
7412
        if (_PyGtkLabel_Type == NULL) {
 
7413
            PyErr_SetString(PyExc_ImportError,
 
7414
                "cannot import name Label from gtk");
 
7415
            return ;
 
7416
        }
 
7417
        _PyGtkButton_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Button");
 
7418
        if (_PyGtkButton_Type == NULL) {
 
7419
            PyErr_SetString(PyExc_ImportError,
 
7420
                "cannot import name Button from gtk");
 
7421
            return ;
 
7422
        }
 
7423
        _PyGtkToggleButton_Type = (PyTypeObject *)PyObject_GetAttrString(module, "ToggleButton");
 
7424
        if (_PyGtkToggleButton_Type == NULL) {
 
7425
            PyErr_SetString(PyExc_ImportError,
 
7426
                "cannot import name ToggleButton from gtk");
 
7427
            return ;
 
7428
        }
 
7429
        _PyGtkRadioButton_Type = (PyTypeObject *)PyObject_GetAttrString(module, "RadioButton");
 
7430
        if (_PyGtkRadioButton_Type == NULL) {
 
7431
            PyErr_SetString(PyExc_ImportError,
 
7432
                "cannot import name RadioButton from gtk");
 
7433
            return ;
 
7434
        }
 
7435
        _PyGtkSpinButton_Type = (PyTypeObject *)PyObject_GetAttrString(module, "SpinButton");
 
7436
        if (_PyGtkSpinButton_Type == NULL) {
 
7437
            PyErr_SetString(PyExc_ImportError,
 
7438
                "cannot import name SpinButton from gtk");
 
7439
            return ;
 
7440
        }
 
7441
        _PyGtkEntry_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Entry");
 
7442
        if (_PyGtkEntry_Type == NULL) {
 
7443
            PyErr_SetString(PyExc_ImportError,
 
7444
                "cannot import name Entry from gtk");
 
7445
            return ;
 
7446
        }
 
7447
        _PyGtkDrawingArea_Type = (PyTypeObject *)PyObject_GetAttrString(module, "DrawingArea");
 
7448
        if (_PyGtkDrawingArea_Type == NULL) {
 
7449
            PyErr_SetString(PyExc_ImportError,
 
7450
                "cannot import name DrawingArea from gtk");
 
7451
            return ;
 
7452
        }
 
7453
        _PyGtkTable_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Table");
 
7454
        if (_PyGtkTable_Type == NULL) {
 
7455
            PyErr_SetString(PyExc_ImportError,
 
7456
                "cannot import name Table from gtk");
 
7457
            return ;
 
7458
        }
 
7459
        _PyGtkFrame_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Frame");
 
7460
        if (_PyGtkFrame_Type == NULL) {
 
7461
            PyErr_SetString(PyExc_ImportError,
 
7462
                "cannot import name Frame from gtk");
 
7463
            return ;
 
7464
        }
 
7465
        _PyGtkHBox_Type = (PyTypeObject *)PyObject_GetAttrString(module, "HBox");
 
7466
        if (_PyGtkHBox_Type == NULL) {
 
7467
            PyErr_SetString(PyExc_ImportError,
 
7468
                "cannot import name HBox from gtk");
 
7469
            return ;
 
7470
        }
 
7471
        _PyGtkVBox_Type = (PyTypeObject *)PyObject_GetAttrString(module, "VBox");
 
7472
        if (_PyGtkVBox_Type == NULL) {
 
7473
            PyErr_SetString(PyExc_ImportError,
 
7474
                "cannot import name VBox from gtk");
 
7475
            return ;
 
7476
        }
 
7477
        _PyGtkHPaned_Type = (PyTypeObject *)PyObject_GetAttrString(module, "HPaned");
 
7478
        if (_PyGtkHPaned_Type == NULL) {
 
7479
            PyErr_SetString(PyExc_ImportError,
 
7480
                "cannot import name HPaned from gtk");
 
7481
            return ;
 
7482
        }
 
7483
        _PyGtkVPaned_Type = (PyTypeObject *)PyObject_GetAttrString(module, "VPaned");
 
7484
        if (_PyGtkVPaned_Type == NULL) {
 
7485
            PyErr_SetString(PyExc_ImportError,
 
7486
                "cannot import name VPaned from gtk");
 
7487
            return ;
 
7488
        }
 
7489
        _PyGtkScale_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Scale");
 
7490
        if (_PyGtkScale_Type == NULL) {
 
7491
            PyErr_SetString(PyExc_ImportError,
 
7492
                "cannot import name Scale from gtk");
 
7493
            return ;
 
7494
        }
 
7495
        _PyGtkProgressBar_Type = (PyTypeObject *)PyObject_GetAttrString(module, "ProgressBar");
 
7496
        if (_PyGtkProgressBar_Type == NULL) {
 
7497
            PyErr_SetString(PyExc_ImportError,
 
7498
                "cannot import name ProgressBar from gtk");
 
7499
            return ;
 
7500
        }
 
7501
        _PyGtkOptionMenu_Type = (PyTypeObject *)PyObject_GetAttrString(module, "OptionMenu");
 
7502
        if (_PyGtkOptionMenu_Type == NULL) {
 
7503
            PyErr_SetString(PyExc_ImportError,
 
7504
                "cannot import name OptionMenu from gtk");
 
7505
            return ;
 
7506
        }
 
7507
        _PyGtkComboBox_Type = (PyTypeObject *)PyObject_GetAttrString(module, "ComboBox");
 
7508
        if (_PyGtkComboBox_Type == NULL) {
 
7509
            PyErr_SetString(PyExc_ImportError,
 
7510
                "cannot import name ComboBox from gtk");
 
7511
            return ;
 
7512
        }
 
7513
        _PyGtkListStore_Type = (PyTypeObject *)PyObject_GetAttrString(module, "ListStore");
 
7514
        if (_PyGtkListStore_Type == NULL) {
 
7515
            PyErr_SetString(PyExc_ImportError,
 
7516
                "cannot import name ListStore from gtk");
 
7517
            return ;
 
7518
        }
 
7519
        _PyGtkTreeModel_Type = (PyTypeObject *)PyObject_GetAttrString(module, "TreeModel");
 
7520
        if (_PyGtkTreeModel_Type == NULL) {
 
7521
            PyErr_SetString(PyExc_ImportError,
 
7522
                "cannot import name TreeModel from gtk");
 
7523
            return ;
 
7524
        }
 
7525
        _PyGtkCellRenderer_Type = (PyTypeObject *)PyObject_GetAttrString(module, "CellRenderer");
 
7526
        if (_PyGtkCellRenderer_Type == NULL) {
 
7527
            PyErr_SetString(PyExc_ImportError,
 
7528
                "cannot import name CellRenderer from gtk");
 
7529
            return ;
 
7530
        }
 
7531
        _PyGtkCellRendererToggle_Type = (PyTypeObject *)PyObject_GetAttrString(module, "CellRendererToggle");
 
7532
        if (_PyGtkCellRendererToggle_Type == NULL) {
 
7533
            PyErr_SetString(PyExc_ImportError,
 
7534
                "cannot import name CellRendererToggle from gtk");
 
7535
            return ;
 
7536
        }
 
7537
    } else {
 
7538
        PyErr_SetString(PyExc_ImportError,
 
7539
            "could not import gtk");
 
7540
        return ;
 
7541
    }
 
7542
    if ((module = PyImport_ImportModule("gtk.gdk")) != NULL) {
 
7543
        _PyGdkPixbuf_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Pixbuf");
 
7544
        if (_PyGdkPixbuf_Type == NULL) {
 
7545
            PyErr_SetString(PyExc_ImportError,
 
7546
                "cannot import name Pixbuf from gtk.gdk");
 
7547
            return ;
 
7548
        }
 
7549
    } else {
 
7550
        PyErr_SetString(PyExc_ImportError,
 
7551
            "could not import gtk.gdk");
 
7552
        return ;
 
7553
    }
 
7554
 
 
7555
 
 
7556
#line 7557 "gimpui.c"
 
7557
    pygobject_register_class(d, "GimpBrowser", GIMP_TYPE_BROWSER, &PyGimpBrowser_Type, Py_BuildValue("(O)", &PyGtkHPaned_Type));
 
7558
    pyg_set_object_has_new_constructor(GIMP_TYPE_BROWSER);
 
7559
    pygobject_register_class(d, "GimpButton", GIMP_TYPE_BUTTON, &PyGimpButton_Type, Py_BuildValue("(O)", &PyGtkButton_Type));
 
7560
    pyg_set_object_has_new_constructor(GIMP_TYPE_BUTTON);
 
7561
    pygobject_register_class(d, "GimpCellRendererColor", GIMP_TYPE_CELL_RENDERER_COLOR, &PyGimpCellRendererColor_Type, Py_BuildValue("(O)", &PyGtkCellRenderer_Type));
 
7562
    pyg_set_object_has_new_constructor(GIMP_TYPE_CELL_RENDERER_COLOR);
 
7563
    pygobject_register_class(d, "GimpCellRendererToggle", GIMP_TYPE_CELL_RENDERER_TOGGLE, &PyGimpCellRendererToggle_Type, Py_BuildValue("(O)", &PyGtkCellRendererToggle_Type));
 
7564
    pyg_set_object_has_new_constructor(GIMP_TYPE_CELL_RENDERER_TOGGLE);
 
7565
    pygobject_register_class(d, "GimpChainButton", GIMP_TYPE_CHAIN_BUTTON, &PyGimpChainButton_Type, Py_BuildValue("(O)", &PyGtkTable_Type));
 
7566
    pyg_set_object_has_new_constructor(GIMP_TYPE_CHAIN_BUTTON);
 
7567
    pygobject_register_class(d, "GimpColorArea", GIMP_TYPE_COLOR_AREA, &PyGimpColorArea_Type, Py_BuildValue("(O)", &PyGtkDrawingArea_Type));
 
7568
    pyg_set_object_has_new_constructor(GIMP_TYPE_COLOR_AREA);
 
7569
    pygobject_register_class(d, "GimpColorButton", GIMP_TYPE_COLOR_BUTTON, &PyGimpColorButton_Type, Py_BuildValue("(O)", &PyGimpButton_Type));
 
7570
    pyg_set_object_has_new_constructor(GIMP_TYPE_COLOR_BUTTON);
 
7571
    pygobject_register_class(d, "GimpColorDisplay", GIMP_TYPE_COLOR_DISPLAY, &PyGimpColorDisplay_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
7572
    pygobject_register_class(d, "GimpColorDisplayStack", GIMP_TYPE_COLOR_DISPLAY_STACK, &PyGimpColorDisplayStack_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
7573
    pyg_set_object_has_new_constructor(GIMP_TYPE_COLOR_DISPLAY_STACK);
 
7574
    pygobject_register_class(d, "GimpColorHexEntry", GIMP_TYPE_COLOR_HEX_ENTRY, &PyGimpColorHexEntry_Type, Py_BuildValue("(O)", &PyGtkEntry_Type));
 
7575
    pyg_set_object_has_new_constructor(GIMP_TYPE_COLOR_HEX_ENTRY);
 
7576
    pygobject_register_class(d, "GimpColorScale", GIMP_TYPE_COLOR_SCALE, &PyGimpColorScale_Type, Py_BuildValue("(O)", &PyGtkScale_Type));
 
7577
    pyg_set_object_has_new_constructor(GIMP_TYPE_COLOR_SCALE);
 
7578
    pygobject_register_class(d, "GimpColorSelection", GIMP_TYPE_COLOR_SELECTION, &PyGimpColorSelection_Type, Py_BuildValue("(O)", &PyGtkVBox_Type));
 
7579
    pyg_set_object_has_new_constructor(GIMP_TYPE_COLOR_SELECTION);
 
7580
    pygobject_register_class(d, "GimpColorSelector", GIMP_TYPE_COLOR_SELECTOR, &PyGimpColorSelector_Type, Py_BuildValue("(O)", &PyGtkVBox_Type));
 
7581
    pygobject_register_class(d, "GimpColorNotebook", GIMP_TYPE_COLOR_NOTEBOOK, &PyGimpColorNotebook_Type, Py_BuildValue("(O)", &PyGimpColorSelector_Type));
 
7582
    pygobject_register_class(d, "GimpDialog", GIMP_TYPE_DIALOG, &PyGimpDialog_Type, Py_BuildValue("(O)", &PyGtkDialog_Type));
 
7583
    pyg_set_object_has_new_constructor(GIMP_TYPE_DIALOG);
 
7584
    pygobject_register_class(d, "GimpEnumLabel", GIMP_TYPE_ENUM_LABEL, &PyGimpEnumLabel_Type, Py_BuildValue("(O)", &PyGtkLabel_Type));
 
7585
    pyg_set_object_has_new_constructor(GIMP_TYPE_ENUM_LABEL);
 
7586
    pygobject_register_class(d, "GimpFrame", GIMP_TYPE_FRAME, &PyGimpFrame_Type, Py_BuildValue("(O)", &PyGtkFrame_Type));
 
7587
    pygobject_register_class(d, "GimpHintBox", GIMP_TYPE_HINT_BOX, &PyGimpHintBox_Type, Py_BuildValue("(O)", &PyGtkHBox_Type));
 
7588
    pyg_set_object_has_new_constructor(GIMP_TYPE_HINT_BOX);
 
7589
    pygobject_register_class(d, "GimpIntComboBox", GIMP_TYPE_INT_COMBO_BOX, &PyGimpIntComboBox_Type, Py_BuildValue("(O)", &PyGtkComboBox_Type));
 
7590
    pyg_set_object_has_new_constructor(GIMP_TYPE_INT_COMBO_BOX);
 
7591
    pygobject_register_class(d, "GimpEnumComboBox", GIMP_TYPE_ENUM_COMBO_BOX, &PyGimpEnumComboBox_Type, Py_BuildValue("(O)", &PyGimpIntComboBox_Type));
 
7592
    pygobject_register_class(d, "GimpIntStore", GIMP_TYPE_INT_STORE, &PyGimpIntStore_Type, Py_BuildValue("(O)", &PyGtkListStore_Type));
 
7593
    pyg_set_object_has_new_constructor(GIMP_TYPE_INT_STORE);
 
7594
    pygobject_register_class(d, "GimpEnumStore", GIMP_TYPE_ENUM_STORE, &PyGimpEnumStore_Type, Py_BuildValue("(O)", &PyGimpIntStore_Type));
 
7595
    pygobject_register_class(d, "GimpMemsizeEntry", GIMP_TYPE_MEMSIZE_ENTRY, &PyGimpMemsizeEntry_Type, Py_BuildValue("(O)", &PyGtkHBox_Type));
 
7596
    pygobject_register_class(d, "GimpOffsetArea", GIMP_TYPE_OFFSET_AREA, &PyGimpOffsetArea_Type, Py_BuildValue("(O)", &PyGtkDrawingArea_Type));
 
7597
    pygobject_register_class(d, "GimpPageSelector", GIMP_TYPE_PAGE_SELECTOR, &PyGimpPageSelector_Type, Py_BuildValue("(O)", &PyGtkVBox_Type));
 
7598
    pyg_set_object_has_new_constructor(GIMP_TYPE_PAGE_SELECTOR);
 
7599
    pygobject_register_class(d, "GimpPathEditor", GIMP_TYPE_PATH_EDITOR, &PyGimpPathEditor_Type, Py_BuildValue("(O)", &PyGtkVBox_Type));
 
7600
    pygobject_register_class(d, "GimpPickButton", GIMP_TYPE_PICK_BUTTON, &PyGimpPickButton_Type, Py_BuildValue("(O)", &PyGtkButton_Type));
 
7601
    pyg_set_object_has_new_constructor(GIMP_TYPE_PICK_BUTTON);
 
7602
    pygobject_register_class(d, "GimpPreview", GIMP_TYPE_PREVIEW, &PyGimpPreview_Type, Py_BuildValue("(O)", &PyGtkVBox_Type));
 
7603
    pygobject_register_class(d, "GimpAspectPreview", GIMP_TYPE_ASPECT_PREVIEW, &PyGimpAspectPreview_Type, Py_BuildValue("(O)", &PyGimpPreview_Type));
 
7604
    pyg_set_object_has_new_constructor(GIMP_TYPE_ASPECT_PREVIEW);
 
7605
    pygobject_register_class(d, "GimpPreviewArea", GIMP_TYPE_PREVIEW_AREA, &PyGimpPreviewArea_Type, Py_BuildValue("(O)", &PyGtkDrawingArea_Type));
 
7606
    pyg_set_object_has_new_constructor(GIMP_TYPE_PREVIEW_AREA);
 
7607
    pygobject_register_class(d, "GimpProcBrowserDialog", GIMP_TYPE_PROC_BROWSER_DIALOG, &PyGimpProcBrowserDialog_Type, Py_BuildValue("(O)", &PyGimpDialog_Type));
 
7608
    pyg_set_object_has_new_constructor(GIMP_TYPE_PROC_BROWSER_DIALOG);
 
7609
    pygobject_register_class(d, "GimpProgressBar", GIMP_TYPE_PROGRESS_BAR, &PyGimpProgressBar_Type, Py_BuildValue("(O)", &PyGtkProgressBar_Type));
 
7610
    pyg_set_object_has_new_constructor(GIMP_TYPE_PROGRESS_BAR);
 
7611
    pygobject_register_class(d, "GimpResolutionEntry", GIMP_TYPE_RESOLUTION_ENTRY, &PyGimpResolutionEntry_Type, Py_BuildValue("(O)", &PyGtkTable_Type));
 
7612
    pygobject_register_class(d, "GimpScrolledPreview", GIMP_TYPE_SCROLLED_PREVIEW, &PyGimpScrolledPreview_Type, Py_BuildValue("(O)", &PyGimpPreview_Type));
 
7613
    pygobject_register_class(d, "GimpDrawablePreview", GIMP_TYPE_DRAWABLE_PREVIEW, &PyGimpDrawablePreview_Type, Py_BuildValue("(O)", &PyGimpScrolledPreview_Type));
 
7614
    pyg_set_object_has_new_constructor(GIMP_TYPE_DRAWABLE_PREVIEW);
 
7615
    pygobject_register_class(d, "GimpSelectButton", GIMP_TYPE_SELECT_BUTTON, &PyGimpSelectButton_Type, Py_BuildValue("(O)", &PyGtkHBox_Type));
 
7616
    pygobject_register_class(d, "GimpPatternSelectButton", GIMP_TYPE_PATTERN_SELECT_BUTTON, &PyGimpPatternSelectButton_Type, Py_BuildValue("(O)", &PyGimpSelectButton_Type));
 
7617
    pyg_set_object_has_new_constructor(GIMP_TYPE_PATTERN_SELECT_BUTTON);
 
7618
    pygobject_register_class(d, "GimpPaletteSelectButton", GIMP_TYPE_PALETTE_SELECT_BUTTON, &PyGimpPaletteSelectButton_Type, Py_BuildValue("(O)", &PyGimpSelectButton_Type));
 
7619
    pyg_set_object_has_new_constructor(GIMP_TYPE_PALETTE_SELECT_BUTTON);
 
7620
    pygobject_register_class(d, "GimpGradientSelectButton", GIMP_TYPE_GRADIENT_SELECT_BUTTON, &PyGimpGradientSelectButton_Type, Py_BuildValue("(O)", &PyGimpSelectButton_Type));
 
7621
    pyg_set_object_has_new_constructor(GIMP_TYPE_GRADIENT_SELECT_BUTTON);
 
7622
    pygobject_register_class(d, "GimpFontSelectButton", GIMP_TYPE_FONT_SELECT_BUTTON, &PyGimpFontSelectButton_Type, Py_BuildValue("(O)", &PyGimpSelectButton_Type));
 
7623
    pyg_set_object_has_new_constructor(GIMP_TYPE_FONT_SELECT_BUTTON);
 
7624
    pygobject_register_class(d, "GimpBrushSelectButton", GIMP_TYPE_BRUSH_SELECT_BUTTON, &PyGimpBrushSelectButton_Type, Py_BuildValue("(O)", &PyGimpSelectButton_Type));
 
7625
    pyg_set_object_has_new_constructor(GIMP_TYPE_BRUSH_SELECT_BUTTON);
 
7626
    pygobject_register_class(d, "GimpSizeEntry", GIMP_TYPE_SIZE_ENTRY, &PyGimpSizeEntry_Type, Py_BuildValue("(O)", &PyGtkTable_Type));
 
7627
    pygobject_register_class(d, "GimpUnitMenu", GIMP_TYPE_UNIT_MENU, &PyGimpUnitMenu_Type, Py_BuildValue("(O)", &PyGtkOptionMenu_Type));
 
7628
    pygobject_register_class(d, "GimpZoomModel", GIMP_TYPE_ZOOM_MODEL, &PyGimpZoomModel_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
7629
    pyg_set_object_has_new_constructor(GIMP_TYPE_ZOOM_MODEL);
 
7630
    pygobject_register_class(d, "GimpZoomPreview", GIMP_TYPE_ZOOM_PREVIEW, &PyGimpZoomPreview_Type, Py_BuildValue("(O)", &PyGimpScrolledPreview_Type));
 
7631
    pyg_set_object_has_new_constructor(GIMP_TYPE_ZOOM_PREVIEW);
 
7632
    pygobject_register_class(d, "GimpDrawableComboBox", GIMP_TYPE_DRAWABLE_COMBO_BOX, &PyGimpDrawableComboBox_Type, Py_BuildValue("(O)", &PyGimpIntComboBox_Type));
 
7633
    pygobject_register_class(d, "GimpChannelComboBox", GIMP_TYPE_CHANNEL_COMBO_BOX, &PyGimpChannelComboBox_Type, Py_BuildValue("(O)", &PyGimpIntComboBox_Type));
 
7634
    pygobject_register_class(d, "GimpLayerComboBox", GIMP_TYPE_LAYER_COMBO_BOX, &PyGimpLayerComboBox_Type, Py_BuildValue("(O)", &PyGimpIntComboBox_Type));
 
7635
    pygobject_register_class(d, "GimpVectorsComboBox", GIMP_TYPE_VECTORS_COMBO_BOX, &PyGimpVectorsComboBox_Type, Py_BuildValue("(O)", &PyGimpIntComboBox_Type));
 
7636
    pygobject_register_class(d, "GimpImageComboBox", GIMP_TYPE_IMAGE_COMBO_BOX, &PyGimpImageComboBox_Type, Py_BuildValue("(O)", &PyGimpIntComboBox_Type));
 
7637
}