~ubuntu-branches/ubuntu/natty/libchamplain/natty

« back to all changes in this revision

Viewing changes to bindings/python/champlain/pychamplain.c

  • Committer: Bazaar Package Importer
  • Author(s): Sjoerd Simons, Laurent Bigonville, Sjoerd Simons
  • Date: 2009-09-15 00:01:41 UTC
  • mfrom: (1.1.3 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090915000141-i8fg5n1t02zxo79m
Tags: 0.4.0-1
[ Laurent Bigonville ]
* debian/control: Add libchamplain-0.3-dev dependency to
  libchamplain-gtk-0.3-dev

[ Sjoerd Simons ]
* New upstream release (0.4.0)

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 "pychamplain.override"
 
8
#include <Python.h>
 
9
#include <pygobject.h>
 
10
#include <champlain/champlain.h>
 
11
#include <clutter/clutter.h>
 
12
#include "pychamplain.h"
 
13
 
 
14
#line 15 "pychamplain.c"
 
15
 
 
16
 
 
17
/* ---------- types from other modules ---------- */
 
18
static PyTypeObject *_PyGObject_Type;
 
19
#define PyGObject_Type (*_PyGObject_Type)
 
20
static PyTypeObject *_PyClutterActor_Type;
 
21
#define PyClutterActor_Type (*_PyClutterActor_Type)
 
22
static PyTypeObject *_PyClutterGroup_Type;
 
23
#define PyClutterGroup_Type (*_PyClutterGroup_Type)
 
24
static PyTypeObject *_PyClutterColor_Type;
 
25
#define PyClutterColor_Type (*_PyClutterColor_Type)
 
26
 
 
27
 
 
28
/* ---------- forward type declarations ---------- */
 
29
PyTypeObject G_GNUC_INTERNAL PyChamplainPoint_Type;
 
30
PyTypeObject G_GNUC_INTERNAL PyChamplainMapSourceDesc_Type;
 
31
PyTypeObject G_GNUC_INTERNAL PyChamplainBaseMarker_Type;
 
32
PyTypeObject G_GNUC_INTERNAL PyChamplainCache_Type;
 
33
PyTypeObject G_GNUC_INTERNAL PyChamplainLayer_Type;
 
34
PyTypeObject G_GNUC_INTERNAL PyChamplainMapSource_Type;
 
35
PyTypeObject G_GNUC_INTERNAL PyChamplainMapSourceFactory_Type;
 
36
PyTypeObject G_GNUC_INTERNAL PyChamplainMarker_Type;
 
37
PyTypeObject G_GNUC_INTERNAL PyChamplainNetworkMapSource_Type;
 
38
PyTypeObject G_GNUC_INTERNAL PyChamplainPolygon_Type;
 
39
PyTypeObject G_GNUC_INTERNAL PyChamplainTile_Type;
 
40
PyTypeObject G_GNUC_INTERNAL PyChamplainView_Type;
 
41
PyTypeObject G_GNUC_INTERNAL PyChamplainZoomLevel_Type;
 
42
 
 
43
#line 44 "pychamplain.c"
 
44
 
 
45
 
 
46
 
 
47
/* ----------- ChamplainPoint ----------- */
 
48
 
 
49
static int
 
50
_wrap_champlain_point_new(PyGBoxed *self, PyObject *args, PyObject *kwargs)
 
51
{
 
52
    static char *kwlist[] = { "lat", "lon", NULL };
 
53
    double lat, lon;
 
54
 
 
55
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"dd:ChamplainPoint.__init__", kwlist, &lat, &lon))
 
56
        return -1;
 
57
    self->gtype = CHAMPLAIN_TYPE_POINT;
 
58
    self->free_on_dealloc = FALSE;
 
59
    self->boxed = champlain_point_new(lat, lon);
 
60
 
 
61
    if (!self->boxed) {
 
62
        PyErr_SetString(PyExc_RuntimeError, "could not create ChamplainPoint object");
 
63
        return -1;
 
64
    }
 
65
    self->free_on_dealloc = TRUE;
 
66
    return 0;
 
67
}
 
68
 
 
69
static PyObject *
 
70
_wrap_champlain_point_copy(PyObject *self)
 
71
{
 
72
    ChamplainPoint *ret;
 
73
 
 
74
    
 
75
    ret = champlain_point_copy(pyg_boxed_get(self, ChamplainPoint));
 
76
    
 
77
    /* pyg_boxed_new handles NULL checking */
 
78
    return pyg_boxed_new(CHAMPLAIN_TYPE_POINT, ret, TRUE, TRUE);
 
79
}
 
80
 
 
81
static PyObject *
 
82
_wrap_champlain_point_free(PyObject *self)
 
83
{
 
84
    
 
85
    champlain_point_free(pyg_boxed_get(self, ChamplainPoint));
 
86
    
 
87
    Py_INCREF(Py_None);
 
88
    return Py_None;
 
89
}
 
90
 
 
91
static const PyMethodDef _PyChamplainPoint_methods[] = {
 
92
    { "copy", (PyCFunction)_wrap_champlain_point_copy, METH_NOARGS,
 
93
      NULL },
 
94
    { "free", (PyCFunction)_wrap_champlain_point_free, METH_NOARGS,
 
95
      NULL },
 
96
    { NULL, NULL, 0, NULL }
 
97
};
 
98
 
 
99
static PyObject *
 
100
_wrap_champlain_point__get_lat(PyObject *self, void *closure)
 
101
{
 
102
    double ret;
 
103
 
 
104
    ret = pyg_boxed_get(self, ChamplainPoint)->lat;
 
105
    return PyFloat_FromDouble(ret);
 
106
}
 
107
 
 
108
static PyObject *
 
109
_wrap_champlain_point__get_lon(PyObject *self, void *closure)
 
110
{
 
111
    double ret;
 
112
 
 
113
    ret = pyg_boxed_get(self, ChamplainPoint)->lon;
 
114
    return PyFloat_FromDouble(ret);
 
115
}
 
116
 
 
117
static const PyGetSetDef champlain_point_getsets[] = {
 
118
    { "lat", (getter)_wrap_champlain_point__get_lat, (setter)0 },
 
119
    { "lon", (getter)_wrap_champlain_point__get_lon, (setter)0 },
 
120
    { NULL, (getter)0, (setter)0 },
 
121
};
 
122
 
 
123
PyTypeObject G_GNUC_INTERNAL PyChamplainPoint_Type = {
 
124
    PyObject_HEAD_INIT(NULL)
 
125
    0,                                 /* ob_size */
 
126
    "champlain.Point",                   /* tp_name */
 
127
    sizeof(PyGBoxed),          /* tp_basicsize */
 
128
    0,                                 /* tp_itemsize */
 
129
    /* methods */
 
130
    (destructor)0,        /* tp_dealloc */
 
131
    (printfunc)0,                      /* tp_print */
 
132
    (getattrfunc)0,       /* tp_getattr */
 
133
    (setattrfunc)0,       /* tp_setattr */
 
134
    (cmpfunc)0,           /* tp_compare */
 
135
    (reprfunc)0,             /* tp_repr */
 
136
    (PyNumberMethods*)0,     /* tp_as_number */
 
137
    (PySequenceMethods*)0, /* tp_as_sequence */
 
138
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
139
    (hashfunc)0,             /* tp_hash */
 
140
    (ternaryfunc)0,          /* tp_call */
 
141
    (reprfunc)0,              /* tp_str */
 
142
    (getattrofunc)0,     /* tp_getattro */
 
143
    (setattrofunc)0,     /* tp_setattro */
 
144
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
145
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
146
    NULL,                        /* Documentation string */
 
147
    (traverseproc)0,     /* tp_traverse */
 
148
    (inquiry)0,             /* tp_clear */
 
149
    (richcmpfunc)0,   /* tp_richcompare */
 
150
    0,             /* tp_weaklistoffset */
 
151
    (getiterfunc)0,          /* tp_iter */
 
152
    (iternextfunc)0,     /* tp_iternext */
 
153
    (struct PyMethodDef*)_PyChamplainPoint_methods, /* tp_methods */
 
154
    (struct PyMemberDef*)0,              /* tp_members */
 
155
    (struct PyGetSetDef*)champlain_point_getsets,  /* tp_getset */
 
156
    NULL,                              /* tp_base */
 
157
    NULL,                              /* tp_dict */
 
158
    (descrgetfunc)0,    /* tp_descr_get */
 
159
    (descrsetfunc)0,    /* tp_descr_set */
 
160
    0,                 /* tp_dictoffset */
 
161
    (initproc)_wrap_champlain_point_new,             /* tp_init */
 
162
    (allocfunc)0,           /* tp_alloc */
 
163
    (newfunc)0,               /* tp_new */
 
164
    (freefunc)0,             /* tp_free */
 
165
    (inquiry)0              /* tp_is_gc */
 
166
};
 
167
 
 
168
 
 
169
 
 
170
/* ----------- ChamplainMapSourceDesc ----------- */
 
171
 
 
172
#line 378 "pychamplain.override"
 
173
static int
 
174
_wrap_champlain_map_source_desc_new(PyGBoxed *self, PyObject *args, PyObject *kwargs)
 
175
{
 
176
    static char *kwlist[] = {"id", "name", "license", "license_uri", 
 
177
        "min_zoom_level", "max_zoom_level", "projection", "uri_format", NULL };
 
178
    ChamplainMapSourceDesc *desc = champlain_map_source_desc_new();
 
179
    PyObject *py_projection;
 
180
 
 
181
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ssssddOs:ChamplainMapSourceDesc.__init__", kwlist,
 
182
        &desc->id, &desc->name, &desc->license, &desc->license_uri, &desc->min_zoom_level, 
 
183
        &desc->max_zoom_level, &py_projection, &desc->uri_format))
 
184
        return -1;
 
185
 
 
186
    if (pyg_enum_get_value(CHAMPLAIN_TYPE_MAP_PROJECTION, py_projection, (gpointer)&desc->projection) != 0)
 
187
        return -1;
 
188
 
 
189
    self->gtype = CHAMPLAIN_TYPE_MAP_SOURCE_DESC;
 
190
    self->free_on_dealloc = FALSE;
 
191
    self->boxed = desc;
 
192
 
 
193
    if (!self->boxed) {
 
194
        PyErr_SetString(PyExc_RuntimeError, "could not create ChamplainMapSourceDesc object");
 
195
        return -1;
 
196
    }
 
197
    self->free_on_dealloc = TRUE;
 
198
    return 0;
 
199
}
 
200
#line 201 "pychamplain.c"
 
201
 
 
202
 
 
203
static PyObject *
 
204
_wrap_champlain_map_source_desc_copy(PyObject *self)
 
205
{
 
206
    ChamplainMapSourceDesc *ret;
 
207
 
 
208
    
 
209
    ret = champlain_map_source_desc_copy(pyg_boxed_get(self, ChamplainMapSourceDesc));
 
210
    
 
211
    /* pyg_boxed_new handles NULL checking */
 
212
    return pyg_boxed_new(CHAMPLAIN_TYPE_MAP_SOURCE_DESC, ret, TRUE, TRUE);
 
213
}
 
214
 
 
215
static PyObject *
 
216
_wrap_champlain_map_source_desc_free(PyObject *self)
 
217
{
 
218
    
 
219
    champlain_map_source_desc_free(pyg_boxed_get(self, ChamplainMapSourceDesc));
 
220
    
 
221
    Py_INCREF(Py_None);
 
222
    return Py_None;
 
223
}
 
224
 
 
225
static const PyMethodDef _PyChamplainMapSourceDesc_methods[] = {
 
226
    { "copy", (PyCFunction)_wrap_champlain_map_source_desc_copy, METH_NOARGS,
 
227
      NULL },
 
228
    { "free", (PyCFunction)_wrap_champlain_map_source_desc_free, METH_NOARGS,
 
229
      NULL },
 
230
    { NULL, NULL, 0, NULL }
 
231
};
 
232
 
 
233
#line 234 "pychamplain.override"
 
234
static int
 
235
_wrap_champlain_map_source_desc__set_id (PyGBoxed *self, PyObject *value, void *closure)
 
236
{
 
237
    gchar *val;
 
238
 
 
239
        val = PyString_AsString (value);
 
240
        if (PyErr_Occurred ())
 
241
                return -1;
 
242
 
 
243
        pyg_boxed_get (self, ChamplainMapSourceDesc)->id = val;
 
244
        return 0;
 
245
}
 
246
static PyObject *
 
247
_wrap_champlain_map_source_desc__get_id (PyGBoxed *self, void *closure)
 
248
{
 
249
    gchar *id = pyg_boxed_get(self, ChamplainMapSourceDesc)->id;
 
250
    return PyString_FromString (id);
 
251
}
 
252
#line 253 "pychamplain.c"
 
253
 
 
254
 
 
255
#line 255 "pychamplain.override"
 
256
static int
 
257
_wrap_champlain_map_source_desc__set_name (PyGBoxed *self, PyObject *value, void *closure)
 
258
{
 
259
    gchar *val;
 
260
 
 
261
        val = PyString_AsString (value);
 
262
        if (PyErr_Occurred ())
 
263
                return -1;
 
264
 
 
265
        pyg_boxed_get (self, ChamplainMapSourceDesc)->name = val;
 
266
        return 0;
 
267
}
 
268
static PyObject *
 
269
_wrap_champlain_map_source_desc__get_name (PyGBoxed *self, void *closure)
 
270
{
 
271
    gchar *name = pyg_boxed_get(self, ChamplainMapSourceDesc)->name;
 
272
    return PyString_FromString (name);
 
273
}
 
274
#line 275 "pychamplain.c"
 
275
 
 
276
 
 
277
#line 276 "pychamplain.override"
 
278
static int
 
279
_wrap_champlain_map_source_desc__set_license (PyGBoxed *self, PyObject *value, void *closure)
 
280
{
 
281
    gchar *val;
 
282
 
 
283
        val = PyString_AsString (value);
 
284
        if (PyErr_Occurred ())
 
285
                return -1;
 
286
 
 
287
        pyg_boxed_get (self, ChamplainMapSourceDesc)->license = val;
 
288
        return 0;
 
289
}
 
290
static PyObject *
 
291
_wrap_champlain_map_source_desc__get_license (PyGBoxed *self, void *closure)
 
292
{
 
293
    gchar *license = pyg_boxed_get(self, ChamplainMapSourceDesc)->license;
 
294
    return PyString_FromString (license);
 
295
}
 
296
#line 297 "pychamplain.c"
 
297
 
 
298
 
 
299
#line 296 "pychamplain.override"
 
300
static int
 
301
_wrap_champlain_map_source_desc__set_license_uri (PyGBoxed *self, PyObject *value, void *closure)
 
302
{
 
303
    gchar *val;
 
304
 
 
305
        val = PyString_AsString (value);
 
306
        if (PyErr_Occurred ())
 
307
                return -1;
 
308
 
 
309
        pyg_boxed_get (self, ChamplainMapSourceDesc)->license_uri = val;
 
310
        return 0;
 
311
}
 
312
static PyObject *
 
313
_wrap_champlain_map_source_desc__get_license_uri (PyGBoxed *self, void *closure)
 
314
{
 
315
    gchar *license_uri = pyg_boxed_get(self, ChamplainMapSourceDesc)->license_uri;
 
316
    return PyString_FromString (license_uri);
 
317
}
 
318
#line 319 "pychamplain.c"
 
319
 
 
320
 
 
321
#line 351 "pychamplain.override"
 
322
static int
 
323
_wrap_champlain_map_source_desc__set_min_zoom_level (PyGBoxed *self, PyObject *value, void *closure)
 
324
{
 
325
    glong val;
 
326
 
 
327
        val = PyLong_AsLong (value);
 
328
        if (PyErr_Occurred ())
 
329
                return -1;
 
330
 
 
331
        pyg_boxed_get (self, ChamplainMapSourceDesc)->min_zoom_level = val;
 
332
        return 0;
 
333
}
 
334
#line 335 "pychamplain.c"
 
335
 
 
336
 
 
337
static PyObject *
 
338
_wrap_champlain_map_source_desc__get_min_zoom_level(PyObject *self, void *closure)
 
339
{
 
340
    int ret;
 
341
 
 
342
    ret = pyg_boxed_get(self, ChamplainMapSourceDesc)->min_zoom_level;
 
343
    return PyInt_FromLong(ret);
 
344
}
 
345
 
 
346
#line 337 "pychamplain.override"
 
347
static int
 
348
_wrap_champlain_map_source_desc__set_max_zoom_level (PyGBoxed *self, PyObject *value, void *closure)
 
349
{
 
350
    glong val;
 
351
 
 
352
        val = PyLong_AsLong (value);
 
353
        if (PyErr_Occurred ())
 
354
                return -1;
 
355
 
 
356
        pyg_boxed_get (self, ChamplainMapSourceDesc)->max_zoom_level = val;
 
357
        return 0;
 
358
}
 
359
#line 360 "pychamplain.c"
 
360
 
 
361
 
 
362
static PyObject *
 
363
_wrap_champlain_map_source_desc__get_max_zoom_level(PyObject *self, void *closure)
 
364
{
 
365
    int ret;
 
366
 
 
367
    ret = pyg_boxed_get(self, ChamplainMapSourceDesc)->max_zoom_level;
 
368
    return PyInt_FromLong(ret);
 
369
}
 
370
 
 
371
#line 365 "pychamplain.override"
 
372
static int
 
373
_wrap_champlain_map_source_desc__set_projection (PyGBoxed *self, PyObject *value, void *closure)
 
374
{
 
375
    ChamplainMapProjection val;
 
376
 
 
377
    if (pyg_enum_get_value(CHAMPLAIN_TYPE_MAP_PROJECTION, value, (gpointer)&val) != 0)
 
378
        return -1;
 
379
 
 
380
        pyg_boxed_get (self, ChamplainMapSourceDesc)->projection = val;
 
381
        return 0;
 
382
}
 
383
#line 384 "pychamplain.c"
 
384
 
 
385
 
 
386
static PyObject *
 
387
_wrap_champlain_map_source_desc__get_projection(PyObject *self, void *closure)
 
388
{
 
389
    gint ret;
 
390
 
 
391
    ret = pyg_boxed_get(self, ChamplainMapSourceDesc)->projection;
 
392
    return pyg_enum_from_gtype(CHAMPLAIN_TYPE_MAP_PROJECTION, ret);
 
393
}
 
394
 
 
395
#line 317 "pychamplain.override"
 
396
static int
 
397
_wrap_champlain_map_source_desc__set_uri_format (PyGBoxed *self, PyObject *value, void *closure)
 
398
{
 
399
    gchar *val;
 
400
 
 
401
        val = PyString_AsString (value);
 
402
        if (PyErr_Occurred ())
 
403
                return -1;
 
404
 
 
405
        pyg_boxed_get (self, ChamplainMapSourceDesc)->uri_format = val;
 
406
        return 0;
 
407
}
 
408
static PyObject *
 
409
_wrap_champlain_map_source_desc__get_uri_format (PyGBoxed *self, void *closure)
 
410
{
 
411
    gchar *uri_format = pyg_boxed_get(self, ChamplainMapSourceDesc)->uri_format;
 
412
    return PyString_FromString (uri_format);
 
413
}
 
414
#line 415 "pychamplain.c"
 
415
 
 
416
 
 
417
static const PyGetSetDef champlain_map_source_desc_getsets[] = {
 
418
    { "id", (getter)_wrap_champlain_map_source_desc__get_id, (setter)_wrap_champlain_map_source_desc__set_id },
 
419
    { "name", (getter)_wrap_champlain_map_source_desc__get_name, (setter)_wrap_champlain_map_source_desc__set_name },
 
420
    { "license", (getter)_wrap_champlain_map_source_desc__get_license, (setter)_wrap_champlain_map_source_desc__set_license },
 
421
    { "license_uri", (getter)_wrap_champlain_map_source_desc__get_license_uri, (setter)_wrap_champlain_map_source_desc__set_license_uri },
 
422
    { "min_zoom_level", (getter)_wrap_champlain_map_source_desc__get_min_zoom_level, (setter)_wrap_champlain_map_source_desc__set_min_zoom_level },
 
423
    { "max_zoom_level", (getter)_wrap_champlain_map_source_desc__get_max_zoom_level, (setter)_wrap_champlain_map_source_desc__set_max_zoom_level },
 
424
    { "projection", (getter)_wrap_champlain_map_source_desc__get_projection, (setter)_wrap_champlain_map_source_desc__set_projection },
 
425
    { "uri_format", (getter)_wrap_champlain_map_source_desc__get_uri_format, (setter)_wrap_champlain_map_source_desc__set_uri_format },
 
426
    { NULL, (getter)0, (setter)0 },
 
427
};
 
428
 
 
429
PyTypeObject G_GNUC_INTERNAL PyChamplainMapSourceDesc_Type = {
 
430
    PyObject_HEAD_INIT(NULL)
 
431
    0,                                 /* ob_size */
 
432
    "champlain.MapSourceDesc",                   /* tp_name */
 
433
    sizeof(PyGBoxed),          /* tp_basicsize */
 
434
    0,                                 /* tp_itemsize */
 
435
    /* methods */
 
436
    (destructor)0,        /* tp_dealloc */
 
437
    (printfunc)0,                      /* tp_print */
 
438
    (getattrfunc)0,       /* tp_getattr */
 
439
    (setattrfunc)0,       /* tp_setattr */
 
440
    (cmpfunc)0,           /* tp_compare */
 
441
    (reprfunc)0,             /* tp_repr */
 
442
    (PyNumberMethods*)0,     /* tp_as_number */
 
443
    (PySequenceMethods*)0, /* tp_as_sequence */
 
444
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
445
    (hashfunc)0,             /* tp_hash */
 
446
    (ternaryfunc)0,          /* tp_call */
 
447
    (reprfunc)0,              /* tp_str */
 
448
    (getattrofunc)0,     /* tp_getattro */
 
449
    (setattrofunc)0,     /* tp_setattro */
 
450
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
451
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
452
    NULL,                        /* Documentation string */
 
453
    (traverseproc)0,     /* tp_traverse */
 
454
    (inquiry)0,             /* tp_clear */
 
455
    (richcmpfunc)0,   /* tp_richcompare */
 
456
    0,             /* tp_weaklistoffset */
 
457
    (getiterfunc)0,          /* tp_iter */
 
458
    (iternextfunc)0,     /* tp_iternext */
 
459
    (struct PyMethodDef*)_PyChamplainMapSourceDesc_methods, /* tp_methods */
 
460
    (struct PyMemberDef*)0,              /* tp_members */
 
461
    (struct PyGetSetDef*)champlain_map_source_desc_getsets,  /* tp_getset */
 
462
    NULL,                              /* tp_base */
 
463
    NULL,                              /* tp_dict */
 
464
    (descrgetfunc)0,    /* tp_descr_get */
 
465
    (descrsetfunc)0,    /* tp_descr_set */
 
466
    0,                 /* tp_dictoffset */
 
467
    (initproc)_wrap_champlain_map_source_desc_new,             /* tp_init */
 
468
    (allocfunc)0,           /* tp_alloc */
 
469
    (newfunc)0,               /* tp_new */
 
470
    (freefunc)0,             /* tp_free */
 
471
    (inquiry)0              /* tp_is_gc */
 
472
};
 
473
 
 
474
 
 
475
 
 
476
/* ----------- ChamplainBaseMarker ----------- */
 
477
 
 
478
static int
 
479
_wrap_champlain_base_marker_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
480
{
 
481
    static char* kwlist[] = { NULL };
 
482
 
 
483
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
484
                                     ":champlain.BaseMarker.__init__",
 
485
                                     kwlist))
 
486
        return -1;
 
487
 
 
488
    pygobject_constructv(self, 0, NULL);
 
489
    if (!self->obj) {
 
490
        PyErr_SetString(
 
491
            PyExc_RuntimeError, 
 
492
            "could not create champlain.BaseMarker object");
 
493
        return -1;
 
494
    }
 
495
    return 0;
 
496
}
 
497
 
 
498
static PyObject *
 
499
_wrap_champlain_base_marker_set_position(PyGObject *self, PyObject *args, PyObject *kwargs)
 
500
{
 
501
    static char *kwlist[] = { "longitude", "latitude", NULL };
 
502
    double longitude, latitude;
 
503
 
 
504
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"dd:ChamplainBaseMarker.set_position", kwlist, &longitude, &latitude))
 
505
        return NULL;
 
506
    
 
507
    champlain_base_marker_set_position(CHAMPLAIN_BASE_MARKER(self->obj), longitude, latitude);
 
508
    
 
509
    Py_INCREF(Py_None);
 
510
    return Py_None;
 
511
}
 
512
 
 
513
static PyObject *
 
514
_wrap_champlain_base_marker_set_highlighted(PyGObject *self, PyObject *args, PyObject *kwargs)
 
515
{
 
516
    static char *kwlist[] = { "value", NULL };
 
517
    int value;
 
518
 
 
519
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainBaseMarker.set_highlighted", kwlist, &value))
 
520
        return NULL;
 
521
    
 
522
    champlain_base_marker_set_highlighted(CHAMPLAIN_BASE_MARKER(self->obj), value);
 
523
    
 
524
    Py_INCREF(Py_None);
 
525
    return Py_None;
 
526
}
 
527
 
 
528
static PyObject *
 
529
_wrap_champlain_base_marker_get_highlighted(PyGObject *self)
 
530
{
 
531
    int ret;
 
532
 
 
533
    
 
534
    ret = champlain_base_marker_get_highlighted(CHAMPLAIN_BASE_MARKER(self->obj));
 
535
    
 
536
    return PyBool_FromLong(ret);
 
537
 
 
538
}
 
539
 
 
540
static PyObject *
 
541
_wrap_champlain_base_marker_animate_in(PyGObject *self)
 
542
{
 
543
    
 
544
    champlain_base_marker_animate_in(CHAMPLAIN_BASE_MARKER(self->obj));
 
545
    
 
546
    Py_INCREF(Py_None);
 
547
    return Py_None;
 
548
}
 
549
 
 
550
static PyObject *
 
551
_wrap_champlain_base_marker_animate_in_with_delay(PyGObject *self, PyObject *args, PyObject *kwargs)
 
552
{
 
553
    static char *kwlist[] = { "delay", NULL };
 
554
    PyObject *py_delay = NULL;
 
555
    guint delay = 0;
 
556
 
 
557
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainBaseMarker.animate_in_with_delay", kwlist, &py_delay))
 
558
        return NULL;
 
559
    if (py_delay) {
 
560
        if (PyLong_Check(py_delay))
 
561
            delay = PyLong_AsUnsignedLong(py_delay);
 
562
        else if (PyInt_Check(py_delay))
 
563
            delay = PyInt_AsLong(py_delay);
 
564
        else
 
565
            PyErr_SetString(PyExc_TypeError, "Parameter 'delay' must be an int or a long");
 
566
        if (PyErr_Occurred())
 
567
            return NULL;
 
568
    }
 
569
    
 
570
    champlain_base_marker_animate_in_with_delay(CHAMPLAIN_BASE_MARKER(self->obj), delay);
 
571
    
 
572
    Py_INCREF(Py_None);
 
573
    return Py_None;
 
574
}
 
575
 
 
576
static PyObject *
 
577
_wrap_champlain_base_marker_animate_out(PyGObject *self)
 
578
{
 
579
    
 
580
    champlain_base_marker_animate_out(CHAMPLAIN_BASE_MARKER(self->obj));
 
581
    
 
582
    Py_INCREF(Py_None);
 
583
    return Py_None;
 
584
}
 
585
 
 
586
static PyObject *
 
587
_wrap_champlain_base_marker_animate_out_with_delay(PyGObject *self, PyObject *args, PyObject *kwargs)
 
588
{
 
589
    static char *kwlist[] = { "delay", NULL };
 
590
    PyObject *py_delay = NULL;
 
591
    guint delay = 0;
 
592
 
 
593
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainBaseMarker.animate_out_with_delay", kwlist, &py_delay))
 
594
        return NULL;
 
595
    if (py_delay) {
 
596
        if (PyLong_Check(py_delay))
 
597
            delay = PyLong_AsUnsignedLong(py_delay);
 
598
        else if (PyInt_Check(py_delay))
 
599
            delay = PyInt_AsLong(py_delay);
 
600
        else
 
601
            PyErr_SetString(PyExc_TypeError, "Parameter 'delay' must be an int or a long");
 
602
        if (PyErr_Occurred())
 
603
            return NULL;
 
604
    }
 
605
    
 
606
    champlain_base_marker_animate_out_with_delay(CHAMPLAIN_BASE_MARKER(self->obj), delay);
 
607
    
 
608
    Py_INCREF(Py_None);
 
609
    return Py_None;
 
610
}
 
611
 
 
612
static const PyMethodDef _PyChamplainBaseMarker_methods[] = {
 
613
    { "set_position", (PyCFunction)_wrap_champlain_base_marker_set_position, METH_VARARGS|METH_KEYWORDS,
 
614
      NULL },
 
615
    { "set_highlighted", (PyCFunction)_wrap_champlain_base_marker_set_highlighted, METH_VARARGS|METH_KEYWORDS,
 
616
      NULL },
 
617
    { "get_highlighted", (PyCFunction)_wrap_champlain_base_marker_get_highlighted, METH_NOARGS,
 
618
      NULL },
 
619
    { "animate_in", (PyCFunction)_wrap_champlain_base_marker_animate_in, METH_NOARGS,
 
620
      NULL },
 
621
    { "animate_in_with_delay", (PyCFunction)_wrap_champlain_base_marker_animate_in_with_delay, METH_VARARGS|METH_KEYWORDS,
 
622
      NULL },
 
623
    { "animate_out", (PyCFunction)_wrap_champlain_base_marker_animate_out, METH_NOARGS,
 
624
      NULL },
 
625
    { "animate_out_with_delay", (PyCFunction)_wrap_champlain_base_marker_animate_out_with_delay, METH_VARARGS|METH_KEYWORDS,
 
626
      NULL },
 
627
    { NULL, NULL, 0, NULL }
 
628
};
 
629
 
 
630
PyTypeObject G_GNUC_INTERNAL PyChamplainBaseMarker_Type = {
 
631
    PyObject_HEAD_INIT(NULL)
 
632
    0,                                 /* ob_size */
 
633
    "champlain.BaseMarker",                   /* tp_name */
 
634
    sizeof(PyGObject),          /* tp_basicsize */
 
635
    0,                                 /* tp_itemsize */
 
636
    /* methods */
 
637
    (destructor)0,        /* tp_dealloc */
 
638
    (printfunc)0,                      /* tp_print */
 
639
    (getattrfunc)0,       /* tp_getattr */
 
640
    (setattrfunc)0,       /* tp_setattr */
 
641
    (cmpfunc)0,           /* tp_compare */
 
642
    (reprfunc)0,             /* tp_repr */
 
643
    (PyNumberMethods*)0,     /* tp_as_number */
 
644
    (PySequenceMethods*)0, /* tp_as_sequence */
 
645
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
646
    (hashfunc)0,             /* tp_hash */
 
647
    (ternaryfunc)0,          /* tp_call */
 
648
    (reprfunc)0,              /* tp_str */
 
649
    (getattrofunc)0,     /* tp_getattro */
 
650
    (setattrofunc)0,     /* tp_setattro */
 
651
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
652
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
653
    NULL,                        /* Documentation string */
 
654
    (traverseproc)0,     /* tp_traverse */
 
655
    (inquiry)0,             /* tp_clear */
 
656
    (richcmpfunc)0,   /* tp_richcompare */
 
657
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
658
    (getiterfunc)0,          /* tp_iter */
 
659
    (iternextfunc)0,     /* tp_iternext */
 
660
    (struct PyMethodDef*)_PyChamplainBaseMarker_methods, /* tp_methods */
 
661
    (struct PyMemberDef*)0,              /* tp_members */
 
662
    (struct PyGetSetDef*)0,  /* tp_getset */
 
663
    NULL,                              /* tp_base */
 
664
    NULL,                              /* tp_dict */
 
665
    (descrgetfunc)0,    /* tp_descr_get */
 
666
    (descrsetfunc)0,    /* tp_descr_set */
 
667
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
668
    (initproc)_wrap_champlain_base_marker_new,             /* tp_init */
 
669
    (allocfunc)0,           /* tp_alloc */
 
670
    (newfunc)0,               /* tp_new */
 
671
    (freefunc)0,             /* tp_free */
 
672
    (inquiry)0              /* tp_is_gc */
 
673
};
 
674
 
 
675
 
 
676
 
 
677
/* ----------- ChamplainCache ----------- */
 
678
 
 
679
static PyObject *
 
680
_wrap_champlain_cache_update_tile(PyGObject *self, PyObject *args, PyObject *kwargs)
 
681
{
 
682
    static char *kwlist[] = { "tile", "filesize", NULL };
 
683
    PyGObject *tile;
 
684
    PyObject *py_filesize = NULL;
 
685
    guint filesize = 0;
 
686
 
 
687
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!O:ChamplainCache.update_tile", kwlist, &PyChamplainTile_Type, &tile, &py_filesize))
 
688
        return NULL;
 
689
    if (py_filesize) {
 
690
        if (PyLong_Check(py_filesize))
 
691
            filesize = PyLong_AsUnsignedLong(py_filesize);
 
692
        else if (PyInt_Check(py_filesize))
 
693
            filesize = PyInt_AsLong(py_filesize);
 
694
        else
 
695
            PyErr_SetString(PyExc_TypeError, "Parameter 'filesize' must be an int or a long");
 
696
        if (PyErr_Occurred())
 
697
            return NULL;
 
698
    }
 
699
    
 
700
    champlain_cache_update_tile(CHAMPLAIN_CACHE(self->obj), CHAMPLAIN_TILE(tile->obj), filesize);
 
701
    
 
702
    Py_INCREF(Py_None);
 
703
    return Py_None;
 
704
}
 
705
 
 
706
static PyObject *
 
707
_wrap_champlain_cache_fill_tile(PyGObject *self, PyObject *args, PyObject *kwargs)
 
708
{
 
709
    static char *kwlist[] = { "tile", NULL };
 
710
    PyGObject *tile;
 
711
    int ret;
 
712
 
 
713
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainCache.fill_tile", kwlist, &PyChamplainTile_Type, &tile))
 
714
        return NULL;
 
715
    
 
716
    ret = champlain_cache_fill_tile(CHAMPLAIN_CACHE(self->obj), CHAMPLAIN_TILE(tile->obj));
 
717
    
 
718
    return PyBool_FromLong(ret);
 
719
 
 
720
}
 
721
 
 
722
static PyObject *
 
723
_wrap_champlain_cache_tile_is_expired(PyGObject *self, PyObject *args, PyObject *kwargs)
 
724
{
 
725
    static char *kwlist[] = { "tile", NULL };
 
726
    PyGObject *tile;
 
727
    int ret;
 
728
 
 
729
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainCache.tile_is_expired", kwlist, &PyChamplainTile_Type, &tile))
 
730
        return NULL;
 
731
    
 
732
    ret = champlain_cache_tile_is_expired(CHAMPLAIN_CACHE(self->obj), CHAMPLAIN_TILE(tile->obj));
 
733
    
 
734
    return PyBool_FromLong(ret);
 
735
 
 
736
}
 
737
 
 
738
static PyObject *
 
739
_wrap_champlain_cache_set_size_limit(PyGObject *self, PyObject *args, PyObject *kwargs)
 
740
{
 
741
    static char *kwlist[] = { "size_limit", NULL };
 
742
    PyObject *py_size_limit = NULL;
 
743
    guint size_limit = 0;
 
744
 
 
745
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainCache.set_size_limit", kwlist, &py_size_limit))
 
746
        return NULL;
 
747
    if (py_size_limit) {
 
748
        if (PyLong_Check(py_size_limit))
 
749
            size_limit = PyLong_AsUnsignedLong(py_size_limit);
 
750
        else if (PyInt_Check(py_size_limit))
 
751
            size_limit = PyInt_AsLong(py_size_limit);
 
752
        else
 
753
            PyErr_SetString(PyExc_TypeError, "Parameter 'size_limit' must be an int or a long");
 
754
        if (PyErr_Occurred())
 
755
            return NULL;
 
756
    }
 
757
    
 
758
    champlain_cache_set_size_limit(CHAMPLAIN_CACHE(self->obj), size_limit);
 
759
    
 
760
    Py_INCREF(Py_None);
 
761
    return Py_None;
 
762
}
 
763
 
 
764
static PyObject *
 
765
_wrap_champlain_cache_get_size_limit(PyGObject *self)
 
766
{
 
767
    guint ret;
 
768
 
 
769
    
 
770
    ret = champlain_cache_get_size_limit(CHAMPLAIN_CACHE(self->obj));
 
771
    
 
772
    return PyLong_FromUnsignedLong(ret);
 
773
}
 
774
 
 
775
static PyObject *
 
776
_wrap_champlain_cache_purge(PyGObject *self)
 
777
{
 
778
    
 
779
    champlain_cache_purge(CHAMPLAIN_CACHE(self->obj));
 
780
    
 
781
    Py_INCREF(Py_None);
 
782
    return Py_None;
 
783
}
 
784
 
 
785
static PyObject *
 
786
_wrap_champlain_cache_purge_on_idle(PyGObject *self)
 
787
{
 
788
    
 
789
    champlain_cache_purge_on_idle(CHAMPLAIN_CACHE(self->obj));
 
790
    
 
791
    Py_INCREF(Py_None);
 
792
    return Py_None;
 
793
}
 
794
 
 
795
static const PyMethodDef _PyChamplainCache_methods[] = {
 
796
    { "update_tile", (PyCFunction)_wrap_champlain_cache_update_tile, METH_VARARGS|METH_KEYWORDS,
 
797
      NULL },
 
798
    { "fill_tile", (PyCFunction)_wrap_champlain_cache_fill_tile, METH_VARARGS|METH_KEYWORDS,
 
799
      NULL },
 
800
    { "tile_is_expired", (PyCFunction)_wrap_champlain_cache_tile_is_expired, METH_VARARGS|METH_KEYWORDS,
 
801
      NULL },
 
802
    { "set_size_limit", (PyCFunction)_wrap_champlain_cache_set_size_limit, METH_VARARGS|METH_KEYWORDS,
 
803
      NULL },
 
804
    { "get_size_limit", (PyCFunction)_wrap_champlain_cache_get_size_limit, METH_NOARGS,
 
805
      NULL },
 
806
    { "purge", (PyCFunction)_wrap_champlain_cache_purge, METH_NOARGS,
 
807
      NULL },
 
808
    { "purge_on_idle", (PyCFunction)_wrap_champlain_cache_purge_on_idle, METH_NOARGS,
 
809
      NULL },
 
810
    { NULL, NULL, 0, NULL }
 
811
};
 
812
 
 
813
PyTypeObject G_GNUC_INTERNAL PyChamplainCache_Type = {
 
814
    PyObject_HEAD_INIT(NULL)
 
815
    0,                                 /* ob_size */
 
816
    "champlain.Cache",                   /* tp_name */
 
817
    sizeof(PyGObject),          /* tp_basicsize */
 
818
    0,                                 /* tp_itemsize */
 
819
    /* methods */
 
820
    (destructor)0,        /* tp_dealloc */
 
821
    (printfunc)0,                      /* tp_print */
 
822
    (getattrfunc)0,       /* tp_getattr */
 
823
    (setattrfunc)0,       /* tp_setattr */
 
824
    (cmpfunc)0,           /* tp_compare */
 
825
    (reprfunc)0,             /* tp_repr */
 
826
    (PyNumberMethods*)0,     /* tp_as_number */
 
827
    (PySequenceMethods*)0, /* tp_as_sequence */
 
828
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
829
    (hashfunc)0,             /* tp_hash */
 
830
    (ternaryfunc)0,          /* tp_call */
 
831
    (reprfunc)0,              /* tp_str */
 
832
    (getattrofunc)0,     /* tp_getattro */
 
833
    (setattrofunc)0,     /* tp_setattro */
 
834
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
835
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
836
    NULL,                        /* Documentation string */
 
837
    (traverseproc)0,     /* tp_traverse */
 
838
    (inquiry)0,             /* tp_clear */
 
839
    (richcmpfunc)0,   /* tp_richcompare */
 
840
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
841
    (getiterfunc)0,          /* tp_iter */
 
842
    (iternextfunc)0,     /* tp_iternext */
 
843
    (struct PyMethodDef*)_PyChamplainCache_methods, /* tp_methods */
 
844
    (struct PyMemberDef*)0,              /* tp_members */
 
845
    (struct PyGetSetDef*)0,  /* tp_getset */
 
846
    NULL,                              /* tp_base */
 
847
    NULL,                              /* tp_dict */
 
848
    (descrgetfunc)0,    /* tp_descr_get */
 
849
    (descrsetfunc)0,    /* tp_descr_set */
 
850
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
851
    (initproc)0,             /* tp_init */
 
852
    (allocfunc)0,           /* tp_alloc */
 
853
    (newfunc)0,               /* tp_new */
 
854
    (freefunc)0,             /* tp_free */
 
855
    (inquiry)0              /* tp_is_gc */
 
856
};
 
857
 
 
858
 
 
859
 
 
860
/* ----------- ChamplainLayer ----------- */
 
861
 
 
862
static int
 
863
_wrap_champlain_layer_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
864
{
 
865
    static char* kwlist[] = { NULL };
 
866
 
 
867
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
868
                                     ":champlain.Layer.__init__",
 
869
                                     kwlist))
 
870
        return -1;
 
871
 
 
872
    pygobject_constructv(self, 0, NULL);
 
873
    if (!self->obj) {
 
874
        PyErr_SetString(
 
875
            PyExc_RuntimeError, 
 
876
            "could not create champlain.Layer object");
 
877
        return -1;
 
878
    }
 
879
    return 0;
 
880
}
 
881
 
 
882
static PyObject *
 
883
_wrap_champlain_layer_show(PyGObject *self)
 
884
{
 
885
    
 
886
    champlain_layer_show(CHAMPLAIN_LAYER(self->obj));
 
887
    
 
888
    Py_INCREF(Py_None);
 
889
    return Py_None;
 
890
}
 
891
 
 
892
static PyObject *
 
893
_wrap_champlain_layer_hide(PyGObject *self)
 
894
{
 
895
    
 
896
    champlain_layer_hide(CHAMPLAIN_LAYER(self->obj));
 
897
    
 
898
    Py_INCREF(Py_None);
 
899
    return Py_None;
 
900
}
 
901
 
 
902
static PyObject *
 
903
_wrap_champlain_layer_add_marker(PyGObject *self, PyObject *args, PyObject *kwargs)
 
904
{
 
905
    static char *kwlist[] = { "marker", NULL };
 
906
    PyGObject *marker;
 
907
 
 
908
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainLayer.add_marker", kwlist, &PyChamplainBaseMarker_Type, &marker))
 
909
        return NULL;
 
910
    
 
911
    champlain_layer_add_marker(CHAMPLAIN_LAYER(self->obj), CHAMPLAIN_BASE_MARKER(marker->obj));
 
912
    
 
913
    Py_INCREF(Py_None);
 
914
    return Py_None;
 
915
}
 
916
 
 
917
static PyObject *
 
918
_wrap_champlain_layer_remove_marker(PyGObject *self, PyObject *args, PyObject *kwargs)
 
919
{
 
920
    static char *kwlist[] = { "marker", NULL };
 
921
    PyGObject *marker;
 
922
 
 
923
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainLayer.remove_marker", kwlist, &PyChamplainBaseMarker_Type, &marker))
 
924
        return NULL;
 
925
    
 
926
    champlain_layer_remove_marker(CHAMPLAIN_LAYER(self->obj), CHAMPLAIN_BASE_MARKER(marker->obj));
 
927
    
 
928
    Py_INCREF(Py_None);
 
929
    return Py_None;
 
930
}
 
931
 
 
932
static PyObject *
 
933
_wrap_champlain_layer_animate_in_all_markers(PyGObject *self)
 
934
{
 
935
    
 
936
    champlain_layer_animate_in_all_markers(CHAMPLAIN_LAYER(self->obj));
 
937
    
 
938
    Py_INCREF(Py_None);
 
939
    return Py_None;
 
940
}
 
941
 
 
942
static PyObject *
 
943
_wrap_champlain_layer_animate_out_all_markers(PyGObject *self)
 
944
{
 
945
    
 
946
    champlain_layer_animate_out_all_markers(CHAMPLAIN_LAYER(self->obj));
 
947
    
 
948
    Py_INCREF(Py_None);
 
949
    return Py_None;
 
950
}
 
951
 
 
952
static PyObject *
 
953
_wrap_champlain_layer_show_all_markers(PyGObject *self)
 
954
{
 
955
    
 
956
    champlain_layer_show_all_markers(CHAMPLAIN_LAYER(self->obj));
 
957
    
 
958
    Py_INCREF(Py_None);
 
959
    return Py_None;
 
960
}
 
961
 
 
962
static PyObject *
 
963
_wrap_champlain_layer_hide_all_markers(PyGObject *self)
 
964
{
 
965
    
 
966
    champlain_layer_hide_all_markers(CHAMPLAIN_LAYER(self->obj));
 
967
    
 
968
    Py_INCREF(Py_None);
 
969
    return Py_None;
 
970
}
 
971
 
 
972
static const PyMethodDef _PyChamplainLayer_methods[] = {
 
973
    { "show", (PyCFunction)_wrap_champlain_layer_show, METH_NOARGS,
 
974
      NULL },
 
975
    { "hide", (PyCFunction)_wrap_champlain_layer_hide, METH_NOARGS,
 
976
      NULL },
 
977
    { "add_marker", (PyCFunction)_wrap_champlain_layer_add_marker, METH_VARARGS|METH_KEYWORDS,
 
978
      NULL },
 
979
    { "remove_marker", (PyCFunction)_wrap_champlain_layer_remove_marker, METH_VARARGS|METH_KEYWORDS,
 
980
      NULL },
 
981
    { "animate_in_all_markers", (PyCFunction)_wrap_champlain_layer_animate_in_all_markers, METH_NOARGS,
 
982
      NULL },
 
983
    { "animate_out_all_markers", (PyCFunction)_wrap_champlain_layer_animate_out_all_markers, METH_NOARGS,
 
984
      NULL },
 
985
    { "show_all_markers", (PyCFunction)_wrap_champlain_layer_show_all_markers, METH_NOARGS,
 
986
      NULL },
 
987
    { "hide_all_markers", (PyCFunction)_wrap_champlain_layer_hide_all_markers, METH_NOARGS,
 
988
      NULL },
 
989
    { NULL, NULL, 0, NULL }
 
990
};
 
991
 
 
992
PyTypeObject G_GNUC_INTERNAL PyChamplainLayer_Type = {
 
993
    PyObject_HEAD_INIT(NULL)
 
994
    0,                                 /* ob_size */
 
995
    "champlain.Layer",                   /* tp_name */
 
996
    sizeof(PyGObject),          /* tp_basicsize */
 
997
    0,                                 /* tp_itemsize */
 
998
    /* methods */
 
999
    (destructor)0,        /* tp_dealloc */
 
1000
    (printfunc)0,                      /* tp_print */
 
1001
    (getattrfunc)0,       /* tp_getattr */
 
1002
    (setattrfunc)0,       /* tp_setattr */
 
1003
    (cmpfunc)0,           /* tp_compare */
 
1004
    (reprfunc)0,             /* tp_repr */
 
1005
    (PyNumberMethods*)0,     /* tp_as_number */
 
1006
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1007
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1008
    (hashfunc)0,             /* tp_hash */
 
1009
    (ternaryfunc)0,          /* tp_call */
 
1010
    (reprfunc)0,              /* tp_str */
 
1011
    (getattrofunc)0,     /* tp_getattro */
 
1012
    (setattrofunc)0,     /* tp_setattro */
 
1013
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1014
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1015
    NULL,                        /* Documentation string */
 
1016
    (traverseproc)0,     /* tp_traverse */
 
1017
    (inquiry)0,             /* tp_clear */
 
1018
    (richcmpfunc)0,   /* tp_richcompare */
 
1019
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1020
    (getiterfunc)0,          /* tp_iter */
 
1021
    (iternextfunc)0,     /* tp_iternext */
 
1022
    (struct PyMethodDef*)_PyChamplainLayer_methods, /* tp_methods */
 
1023
    (struct PyMemberDef*)0,              /* tp_members */
 
1024
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1025
    NULL,                              /* tp_base */
 
1026
    NULL,                              /* tp_dict */
 
1027
    (descrgetfunc)0,    /* tp_descr_get */
 
1028
    (descrsetfunc)0,    /* tp_descr_set */
 
1029
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1030
    (initproc)_wrap_champlain_layer_new,             /* tp_init */
 
1031
    (allocfunc)0,           /* tp_alloc */
 
1032
    (newfunc)0,               /* tp_new */
 
1033
    (freefunc)0,             /* tp_free */
 
1034
    (inquiry)0              /* tp_is_gc */
 
1035
};
 
1036
 
 
1037
 
 
1038
 
 
1039
/* ----------- ChamplainMapSource ----------- */
 
1040
 
 
1041
static PyObject *
 
1042
_wrap_champlain_map_source_get_min_zoom_level(PyGObject *self)
 
1043
{
 
1044
    int ret;
 
1045
 
 
1046
    
 
1047
    ret = champlain_map_source_get_min_zoom_level(CHAMPLAIN_MAP_SOURCE(self->obj));
 
1048
    
 
1049
    return PyInt_FromLong(ret);
 
1050
}
 
1051
 
 
1052
static PyObject *
 
1053
_wrap_champlain_map_source_get_max_zoom_level(PyGObject *self)
 
1054
{
 
1055
    int ret;
 
1056
 
 
1057
    
 
1058
    ret = champlain_map_source_get_max_zoom_level(CHAMPLAIN_MAP_SOURCE(self->obj));
 
1059
    
 
1060
    return PyInt_FromLong(ret);
 
1061
}
 
1062
 
 
1063
static PyObject *
 
1064
_wrap_champlain_map_source_get_tile_size(PyGObject *self)
 
1065
{
 
1066
    guint ret;
 
1067
 
 
1068
    
 
1069
    ret = champlain_map_source_get_tile_size(CHAMPLAIN_MAP_SOURCE(self->obj));
 
1070
    
 
1071
    return PyLong_FromUnsignedLong(ret);
 
1072
}
 
1073
 
 
1074
static PyObject *
 
1075
_wrap_champlain_map_source_get_x(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1076
{
 
1077
    static char *kwlist[] = { "zoom_level", "longitude", NULL };
 
1078
    int zoom_level;
 
1079
    double longitude;
 
1080
    guint ret;
 
1081
 
 
1082
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"id:ChamplainMapSource.get_x", kwlist, &zoom_level, &longitude))
 
1083
        return NULL;
 
1084
    
 
1085
    ret = champlain_map_source_get_x(CHAMPLAIN_MAP_SOURCE(self->obj), zoom_level, longitude);
 
1086
    
 
1087
    return PyLong_FromUnsignedLong(ret);
 
1088
}
 
1089
 
 
1090
static PyObject *
 
1091
_wrap_champlain_map_source_get_y(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1092
{
 
1093
    static char *kwlist[] = { "zoom_level", "latitude", NULL };
 
1094
    int zoom_level;
 
1095
    double latitude;
 
1096
    guint ret;
 
1097
 
 
1098
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"id:ChamplainMapSource.get_y", kwlist, &zoom_level, &latitude))
 
1099
        return NULL;
 
1100
    
 
1101
    ret = champlain_map_source_get_y(CHAMPLAIN_MAP_SOURCE(self->obj), zoom_level, latitude);
 
1102
    
 
1103
    return PyLong_FromUnsignedLong(ret);
 
1104
}
 
1105
 
 
1106
static PyObject *
 
1107
_wrap_champlain_map_source_get_longitude(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1108
{
 
1109
    static char *kwlist[] = { "zoom_level", "x", NULL };
 
1110
    int zoom_level;
 
1111
    PyObject *py_x = NULL;
 
1112
    guint x = 0;
 
1113
    double ret;
 
1114
 
 
1115
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"iO:ChamplainMapSource.get_longitude", kwlist, &zoom_level, &py_x))
 
1116
        return NULL;
 
1117
    if (py_x) {
 
1118
        if (PyLong_Check(py_x))
 
1119
            x = PyLong_AsUnsignedLong(py_x);
 
1120
        else if (PyInt_Check(py_x))
 
1121
            x = PyInt_AsLong(py_x);
 
1122
        else
 
1123
            PyErr_SetString(PyExc_TypeError, "Parameter 'x' must be an int or a long");
 
1124
        if (PyErr_Occurred())
 
1125
            return NULL;
 
1126
    }
 
1127
    
 
1128
    ret = champlain_map_source_get_longitude(CHAMPLAIN_MAP_SOURCE(self->obj), zoom_level, x);
 
1129
    
 
1130
    return PyFloat_FromDouble(ret);
 
1131
}
 
1132
 
 
1133
static PyObject *
 
1134
_wrap_champlain_map_source_get_latitude(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1135
{
 
1136
    static char *kwlist[] = { "zoom_level", "y", NULL };
 
1137
    int zoom_level;
 
1138
    PyObject *py_y = NULL;
 
1139
    guint y = 0;
 
1140
    double ret;
 
1141
 
 
1142
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"iO:ChamplainMapSource.get_latitude", kwlist, &zoom_level, &py_y))
 
1143
        return NULL;
 
1144
    if (py_y) {
 
1145
        if (PyLong_Check(py_y))
 
1146
            y = PyLong_AsUnsignedLong(py_y);
 
1147
        else if (PyInt_Check(py_y))
 
1148
            y = PyInt_AsLong(py_y);
 
1149
        else
 
1150
            PyErr_SetString(PyExc_TypeError, "Parameter 'y' must be an int or a long");
 
1151
        if (PyErr_Occurred())
 
1152
            return NULL;
 
1153
    }
 
1154
    
 
1155
    ret = champlain_map_source_get_latitude(CHAMPLAIN_MAP_SOURCE(self->obj), zoom_level, y);
 
1156
    
 
1157
    return PyFloat_FromDouble(ret);
 
1158
}
 
1159
 
 
1160
static PyObject *
 
1161
_wrap_champlain_map_source_get_row_count(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1162
{
 
1163
    static char *kwlist[] = { "zoom_level", NULL };
 
1164
    int zoom_level;
 
1165
    guint ret;
 
1166
 
 
1167
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainMapSource.get_row_count", kwlist, &zoom_level))
 
1168
        return NULL;
 
1169
    
 
1170
    ret = champlain_map_source_get_row_count(CHAMPLAIN_MAP_SOURCE(self->obj), zoom_level);
 
1171
    
 
1172
    return PyLong_FromUnsignedLong(ret);
 
1173
}
 
1174
 
 
1175
static PyObject *
 
1176
_wrap_champlain_map_source_get_column_count(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1177
{
 
1178
    static char *kwlist[] = { "zoom_level", NULL };
 
1179
    int zoom_level;
 
1180
    guint ret;
 
1181
 
 
1182
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainMapSource.get_column_count", kwlist, &zoom_level))
 
1183
        return NULL;
 
1184
    
 
1185
    ret = champlain_map_source_get_column_count(CHAMPLAIN_MAP_SOURCE(self->obj), zoom_level);
 
1186
    
 
1187
    return PyLong_FromUnsignedLong(ret);
 
1188
}
 
1189
 
 
1190
static PyObject *
 
1191
_wrap_champlain_map_source_fill_tile(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1192
{
 
1193
    static char *kwlist[] = { "tile", NULL };
 
1194
    PyGObject *tile;
 
1195
 
 
1196
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainMapSource.fill_tile", kwlist, &PyChamplainTile_Type, &tile))
 
1197
        return NULL;
 
1198
    
 
1199
    champlain_map_source_fill_tile(CHAMPLAIN_MAP_SOURCE(self->obj), CHAMPLAIN_TILE(tile->obj));
 
1200
    
 
1201
    Py_INCREF(Py_None);
 
1202
    return Py_None;
 
1203
}
 
1204
 
 
1205
static PyObject *
 
1206
_wrap_champlain_map_source_set_id(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1207
{
 
1208
    static char *kwlist[] = { "id", NULL };
 
1209
    char *id;
 
1210
 
 
1211
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainMapSource.set_id", kwlist, &id))
 
1212
        return NULL;
 
1213
    
 
1214
    champlain_map_source_set_id(CHAMPLAIN_MAP_SOURCE(self->obj), id);
 
1215
    
 
1216
    Py_INCREF(Py_None);
 
1217
    return Py_None;
 
1218
}
 
1219
 
 
1220
static PyObject *
 
1221
_wrap_champlain_map_source_get_id(PyGObject *self)
 
1222
{
 
1223
    const gchar *ret;
 
1224
 
 
1225
    
 
1226
    ret = champlain_map_source_get_id(CHAMPLAIN_MAP_SOURCE(self->obj));
 
1227
    
 
1228
    if (ret)
 
1229
        return PyString_FromString(ret);
 
1230
    Py_INCREF(Py_None);
 
1231
    return Py_None;
 
1232
}
 
1233
 
 
1234
static PyObject *
 
1235
_wrap_champlain_map_source_set_name(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1236
{
 
1237
    static char *kwlist[] = { "name", NULL };
 
1238
    char *name;
 
1239
 
 
1240
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainMapSource.set_name", kwlist, &name))
 
1241
        return NULL;
 
1242
    
 
1243
    champlain_map_source_set_name(CHAMPLAIN_MAP_SOURCE(self->obj), name);
 
1244
    
 
1245
    Py_INCREF(Py_None);
 
1246
    return Py_None;
 
1247
}
 
1248
 
 
1249
static PyObject *
 
1250
_wrap_champlain_map_source_get_name(PyGObject *self)
 
1251
{
 
1252
    const gchar *ret;
 
1253
 
 
1254
    
 
1255
    ret = champlain_map_source_get_name(CHAMPLAIN_MAP_SOURCE(self->obj));
 
1256
    
 
1257
    if (ret)
 
1258
        return PyString_FromString(ret);
 
1259
    Py_INCREF(Py_None);
 
1260
    return Py_None;
 
1261
}
 
1262
 
 
1263
static PyObject *
 
1264
_wrap_champlain_map_source_set_license(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1265
{
 
1266
    static char *kwlist[] = { "license", NULL };
 
1267
    char *license;
 
1268
 
 
1269
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainMapSource.set_license", kwlist, &license))
 
1270
        return NULL;
 
1271
    
 
1272
    champlain_map_source_set_license(CHAMPLAIN_MAP_SOURCE(self->obj), license);
 
1273
    
 
1274
    Py_INCREF(Py_None);
 
1275
    return Py_None;
 
1276
}
 
1277
 
 
1278
static PyObject *
 
1279
_wrap_champlain_map_source_get_license(PyGObject *self)
 
1280
{
 
1281
    const gchar *ret;
 
1282
 
 
1283
    
 
1284
    ret = champlain_map_source_get_license(CHAMPLAIN_MAP_SOURCE(self->obj));
 
1285
    
 
1286
    if (ret)
 
1287
        return PyString_FromString(ret);
 
1288
    Py_INCREF(Py_None);
 
1289
    return Py_None;
 
1290
}
 
1291
 
 
1292
static PyObject *
 
1293
_wrap_champlain_map_source_set_license_uri(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1294
{
 
1295
    static char *kwlist[] = { "license_uri", NULL };
 
1296
    char *license_uri;
 
1297
 
 
1298
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainMapSource.set_license_uri", kwlist, &license_uri))
 
1299
        return NULL;
 
1300
    
 
1301
    champlain_map_source_set_license_uri(CHAMPLAIN_MAP_SOURCE(self->obj), license_uri);
 
1302
    
 
1303
    Py_INCREF(Py_None);
 
1304
    return Py_None;
 
1305
}
 
1306
 
 
1307
static PyObject *
 
1308
_wrap_champlain_map_source_get_license_uri(PyGObject *self)
 
1309
{
 
1310
    const gchar *ret;
 
1311
 
 
1312
    
 
1313
    ret = champlain_map_source_get_license_uri(CHAMPLAIN_MAP_SOURCE(self->obj));
 
1314
    
 
1315
    if (ret)
 
1316
        return PyString_FromString(ret);
 
1317
    Py_INCREF(Py_None);
 
1318
    return Py_None;
 
1319
}
 
1320
 
 
1321
static PyObject *
 
1322
_wrap_champlain_map_source_set_projection(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1323
{
 
1324
    static char *kwlist[] = { "projection", NULL };
 
1325
    PyObject *py_projection = NULL;
 
1326
    ChamplainMapProjection projection;
 
1327
 
 
1328
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainMapSource.set_projection", kwlist, &py_projection))
 
1329
        return NULL;
 
1330
    if (pyg_enum_get_value(CHAMPLAIN_TYPE_MAP_PROJECTION, py_projection, (gpointer)&projection))
 
1331
        return NULL;
 
1332
    
 
1333
    champlain_map_source_set_projection(CHAMPLAIN_MAP_SOURCE(self->obj), projection);
 
1334
    
 
1335
    Py_INCREF(Py_None);
 
1336
    return Py_None;
 
1337
}
 
1338
 
 
1339
static PyObject *
 
1340
_wrap_champlain_map_source_get_projection(PyGObject *self)
 
1341
{
 
1342
    gint ret;
 
1343
 
 
1344
    
 
1345
    ret = champlain_map_source_get_projection(CHAMPLAIN_MAP_SOURCE(self->obj));
 
1346
    
 
1347
    return pyg_enum_from_gtype(CHAMPLAIN_TYPE_MAP_PROJECTION, ret);
 
1348
}
 
1349
 
 
1350
static const PyMethodDef _PyChamplainMapSource_methods[] = {
 
1351
    { "get_min_zoom_level", (PyCFunction)_wrap_champlain_map_source_get_min_zoom_level, METH_NOARGS,
 
1352
      NULL },
 
1353
    { "get_max_zoom_level", (PyCFunction)_wrap_champlain_map_source_get_max_zoom_level, METH_NOARGS,
 
1354
      NULL },
 
1355
    { "get_tile_size", (PyCFunction)_wrap_champlain_map_source_get_tile_size, METH_NOARGS,
 
1356
      NULL },
 
1357
    { "get_x", (PyCFunction)_wrap_champlain_map_source_get_x, METH_VARARGS|METH_KEYWORDS,
 
1358
      NULL },
 
1359
    { "get_y", (PyCFunction)_wrap_champlain_map_source_get_y, METH_VARARGS|METH_KEYWORDS,
 
1360
      NULL },
 
1361
    { "get_longitude", (PyCFunction)_wrap_champlain_map_source_get_longitude, METH_VARARGS|METH_KEYWORDS,
 
1362
      NULL },
 
1363
    { "get_latitude", (PyCFunction)_wrap_champlain_map_source_get_latitude, METH_VARARGS|METH_KEYWORDS,
 
1364
      NULL },
 
1365
    { "get_row_count", (PyCFunction)_wrap_champlain_map_source_get_row_count, METH_VARARGS|METH_KEYWORDS,
 
1366
      NULL },
 
1367
    { "get_column_count", (PyCFunction)_wrap_champlain_map_source_get_column_count, METH_VARARGS|METH_KEYWORDS,
 
1368
      NULL },
 
1369
    { "fill_tile", (PyCFunction)_wrap_champlain_map_source_fill_tile, METH_VARARGS|METH_KEYWORDS,
 
1370
      NULL },
 
1371
    { "set_id", (PyCFunction)_wrap_champlain_map_source_set_id, METH_VARARGS|METH_KEYWORDS,
 
1372
      NULL },
 
1373
    { "get_id", (PyCFunction)_wrap_champlain_map_source_get_id, METH_NOARGS,
 
1374
      NULL },
 
1375
    { "set_name", (PyCFunction)_wrap_champlain_map_source_set_name, METH_VARARGS|METH_KEYWORDS,
 
1376
      NULL },
 
1377
    { "get_name", (PyCFunction)_wrap_champlain_map_source_get_name, METH_NOARGS,
 
1378
      NULL },
 
1379
    { "set_license", (PyCFunction)_wrap_champlain_map_source_set_license, METH_VARARGS|METH_KEYWORDS,
 
1380
      NULL },
 
1381
    { "get_license", (PyCFunction)_wrap_champlain_map_source_get_license, METH_NOARGS,
 
1382
      NULL },
 
1383
    { "set_license_uri", (PyCFunction)_wrap_champlain_map_source_set_license_uri, METH_VARARGS|METH_KEYWORDS,
 
1384
      NULL },
 
1385
    { "get_license_uri", (PyCFunction)_wrap_champlain_map_source_get_license_uri, METH_NOARGS,
 
1386
      NULL },
 
1387
    { "set_projection", (PyCFunction)_wrap_champlain_map_source_set_projection, METH_VARARGS|METH_KEYWORDS,
 
1388
      NULL },
 
1389
    { "get_projection", (PyCFunction)_wrap_champlain_map_source_get_projection, METH_NOARGS,
 
1390
      NULL },
 
1391
    { NULL, NULL, 0, NULL }
 
1392
};
 
1393
 
 
1394
PyTypeObject G_GNUC_INTERNAL PyChamplainMapSource_Type = {
 
1395
    PyObject_HEAD_INIT(NULL)
 
1396
    0,                                 /* ob_size */
 
1397
    "champlain.MapSource",                   /* tp_name */
 
1398
    sizeof(PyGObject),          /* tp_basicsize */
 
1399
    0,                                 /* tp_itemsize */
 
1400
    /* methods */
 
1401
    (destructor)0,        /* tp_dealloc */
 
1402
    (printfunc)0,                      /* tp_print */
 
1403
    (getattrfunc)0,       /* tp_getattr */
 
1404
    (setattrfunc)0,       /* tp_setattr */
 
1405
    (cmpfunc)0,           /* tp_compare */
 
1406
    (reprfunc)0,             /* tp_repr */
 
1407
    (PyNumberMethods*)0,     /* tp_as_number */
 
1408
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1409
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1410
    (hashfunc)0,             /* tp_hash */
 
1411
    (ternaryfunc)0,          /* tp_call */
 
1412
    (reprfunc)0,              /* tp_str */
 
1413
    (getattrofunc)0,     /* tp_getattro */
 
1414
    (setattrofunc)0,     /* tp_setattro */
 
1415
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1416
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1417
    NULL,                        /* Documentation string */
 
1418
    (traverseproc)0,     /* tp_traverse */
 
1419
    (inquiry)0,             /* tp_clear */
 
1420
    (richcmpfunc)0,   /* tp_richcompare */
 
1421
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1422
    (getiterfunc)0,          /* tp_iter */
 
1423
    (iternextfunc)0,     /* tp_iternext */
 
1424
    (struct PyMethodDef*)_PyChamplainMapSource_methods, /* tp_methods */
 
1425
    (struct PyMemberDef*)0,              /* tp_members */
 
1426
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1427
    NULL,                              /* tp_base */
 
1428
    NULL,                              /* tp_dict */
 
1429
    (descrgetfunc)0,    /* tp_descr_get */
 
1430
    (descrsetfunc)0,    /* tp_descr_set */
 
1431
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1432
    (initproc)0,             /* tp_init */
 
1433
    (allocfunc)0,           /* tp_alloc */
 
1434
    (newfunc)0,               /* tp_new */
 
1435
    (freefunc)0,             /* tp_free */
 
1436
    (inquiry)0              /* tp_is_gc */
 
1437
};
 
1438
 
 
1439
 
 
1440
 
 
1441
/* ----------- ChamplainMapSourceFactory ----------- */
 
1442
 
 
1443
#line 30 "pychamplain.override"
 
1444
static PyObject *
 
1445
_wrap_champlain_map_source_factory_dup_list(PyGObject *self) {
 
1446
        GSList *iter, *list;
 
1447
        PyObject *ret;
 
1448
        PyObject *pydesc; 
 
1449
 
 
1450
        list = champlain_map_source_factory_dup_list(CHAMPLAIN_MAP_SOURCE_FACTORY(self->obj));
 
1451
        
 
1452
        ret = PyList_New(0);
 
1453
        for(iter = list; iter != NULL; iter = iter->next) {
 
1454
                ChamplainMapSourceDesc *desc = (ChamplainMapSourceDesc *) iter->data;
 
1455
        pydesc = pyg_boxed_new(CHAMPLAIN_TYPE_MAP_SOURCE_DESC, desc, TRUE, TRUE);
 
1456
                PyList_Append(ret, pydesc);
 
1457
        }
 
1458
 
 
1459
        g_slist_free(list);
 
1460
        g_slist_free(iter);
 
1461
 
 
1462
        return ret;
 
1463
}
 
1464
#line 1465 "pychamplain.c"
 
1465
 
 
1466
 
 
1467
static PyObject *
 
1468
_wrap_champlain_map_source_factory_create(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1469
{
 
1470
    static char *kwlist[] = { "id", NULL };
 
1471
    char *id;
 
1472
    ChamplainMapSource *ret;
 
1473
 
 
1474
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainMapSourceFactory.create", kwlist, &id))
 
1475
        return NULL;
 
1476
    
 
1477
    ret = champlain_map_source_factory_create(CHAMPLAIN_MAP_SOURCE_FACTORY(self->obj), id);
 
1478
    
 
1479
    /* pygobject_new handles NULL checking */
 
1480
    return pygobject_new((GObject *)ret);
 
1481
}
 
1482
 
 
1483
#line 52 "pychamplain.override"
 
1484
static PyObject *_pycallback = NULL;
 
1485
 
 
1486
static ChamplainMapSource *
 
1487
champlain_map_source_constructor (ChamplainMapSourceDesc *desc, gpointer data)
 
1488
{
 
1489
    PyObject *pymap_source = NULL;
 
1490
    PyObject *pydesc;
 
1491
 
 
1492
    pydesc = pyg_boxed_new(CHAMPLAIN_TYPE_MAP_SOURCE_DESC, desc, TRUE, TRUE);
 
1493
    pymap_source = PyObject_CallFunction(_pycallback, "(OO)", pydesc, data);
 
1494
    if (!pymap_source)
 
1495
        return NULL;
 
1496
    return CHAMPLAIN_MAP_SOURCE(((PyGObject *)pymap_source)->obj);
 
1497
}
 
1498
 
 
1499
static PyObject *
 
1500
_wrap_champlain_map_source_factory_register(PyGObject *self, PyObject *args, PyObject *kargs) 
 
1501
{
 
1502
    ChamplainMapSourceDesc *desc;
 
1503
    PyObject *pydesc = NULL, *pyconstructor = NULL, *pyuser_data = NULL;
 
1504
    static char *kwlist[] = {"desc", "constructor", "user_data", NULL};
 
1505
 
 
1506
    if (!PyArg_ParseTupleAndKeywords(args, kargs, "OO|O:ChamplainMapSourceFactory.register", 
 
1507
        kwlist, &pydesc, &pyconstructor, &pyuser_data))
 
1508
        return NULL;
 
1509
   
 
1510
    if (pyg_boxed_check(pydesc, CHAMPLAIN_TYPE_MAP_SOURCE_DESC))
 
1511
        desc = pyg_boxed_get(pydesc, ChamplainMapSourceDesc);
 
1512
    else {
 
1513
        PyErr_SetString(PyExc_TypeError, "desc must be a MapSourceDesc");
 
1514
        return NULL;
 
1515
    }
 
1516
 
 
1517
    if (!pyconstructor || !PyCallable_Check(pyconstructor)) {
 
1518
        PyErr_SetString(PyExc_TypeError, "constructor parameter must be callable");
 
1519
        return NULL;
 
1520
    }
 
1521
    Py_XINCREF(pyconstructor);  /* Add a reference to new callback */
 
1522
    Py_XDECREF(_pycallback); /* Dispose of previous callback */
 
1523
    _pycallback = pyconstructor;
 
1524
    return PyBool_FromLong(champlain_map_source_factory_register(
 
1525
        CHAMPLAIN_MAP_SOURCE_FACTORY(self->obj), desc, champlain_map_source_constructor, 
 
1526
        (gpointer)pyuser_data));
 
1527
}
 
1528
#line 1529 "pychamplain.c"
 
1529
 
 
1530
 
 
1531
static const PyMethodDef _PyChamplainMapSourceFactory_methods[] = {
 
1532
    { "dup_list", (PyCFunction)_wrap_champlain_map_source_factory_dup_list, METH_VARARGS|METH_KEYWORDS,
 
1533
      NULL },
 
1534
    { "create", (PyCFunction)_wrap_champlain_map_source_factory_create, METH_VARARGS|METH_KEYWORDS,
 
1535
      NULL },
 
1536
    { "register", (PyCFunction)_wrap_champlain_map_source_factory_register, METH_VARARGS|METH_KEYWORDS,
 
1537
      NULL },
 
1538
    { NULL, NULL, 0, NULL }
 
1539
};
 
1540
 
 
1541
PyTypeObject G_GNUC_INTERNAL PyChamplainMapSourceFactory_Type = {
 
1542
    PyObject_HEAD_INIT(NULL)
 
1543
    0,                                 /* ob_size */
 
1544
    "champlain.MapSourceFactory",                   /* tp_name */
 
1545
    sizeof(PyGObject),          /* tp_basicsize */
 
1546
    0,                                 /* tp_itemsize */
 
1547
    /* methods */
 
1548
    (destructor)0,        /* tp_dealloc */
 
1549
    (printfunc)0,                      /* tp_print */
 
1550
    (getattrfunc)0,       /* tp_getattr */
 
1551
    (setattrfunc)0,       /* tp_setattr */
 
1552
    (cmpfunc)0,           /* tp_compare */
 
1553
    (reprfunc)0,             /* tp_repr */
 
1554
    (PyNumberMethods*)0,     /* tp_as_number */
 
1555
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1556
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1557
    (hashfunc)0,             /* tp_hash */
 
1558
    (ternaryfunc)0,          /* tp_call */
 
1559
    (reprfunc)0,              /* tp_str */
 
1560
    (getattrofunc)0,     /* tp_getattro */
 
1561
    (setattrofunc)0,     /* tp_setattro */
 
1562
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1563
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1564
    NULL,                        /* Documentation string */
 
1565
    (traverseproc)0,     /* tp_traverse */
 
1566
    (inquiry)0,             /* tp_clear */
 
1567
    (richcmpfunc)0,   /* tp_richcompare */
 
1568
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1569
    (getiterfunc)0,          /* tp_iter */
 
1570
    (iternextfunc)0,     /* tp_iternext */
 
1571
    (struct PyMethodDef*)_PyChamplainMapSourceFactory_methods, /* tp_methods */
 
1572
    (struct PyMemberDef*)0,              /* tp_members */
 
1573
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1574
    NULL,                              /* tp_base */
 
1575
    NULL,                              /* tp_dict */
 
1576
    (descrgetfunc)0,    /* tp_descr_get */
 
1577
    (descrsetfunc)0,    /* tp_descr_set */
 
1578
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1579
    (initproc)0,             /* tp_init */
 
1580
    (allocfunc)0,           /* tp_alloc */
 
1581
    (newfunc)0,               /* tp_new */
 
1582
    (freefunc)0,             /* tp_free */
 
1583
    (inquiry)0              /* tp_is_gc */
 
1584
};
 
1585
 
 
1586
 
 
1587
 
 
1588
/* ----------- ChamplainMarker ----------- */
 
1589
 
 
1590
static int
 
1591
_wrap_champlain_marker_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1592
{
 
1593
    static char* kwlist[] = { NULL };
 
1594
 
 
1595
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
1596
                                     ":champlain.Marker.__init__",
 
1597
                                     kwlist))
 
1598
        return -1;
 
1599
 
 
1600
    pygobject_constructv(self, 0, NULL);
 
1601
    if (!self->obj) {
 
1602
        PyErr_SetString(
 
1603
            PyExc_RuntimeError, 
 
1604
            "could not create champlain.Marker object");
 
1605
        return -1;
 
1606
    }
 
1607
    return 0;
 
1608
}
 
1609
 
 
1610
static PyObject *
 
1611
_wrap_champlain_marker_set_text(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1612
{
 
1613
    static char *kwlist[] = { "text", NULL };
 
1614
    char *text;
 
1615
 
 
1616
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainMarker.set_text", kwlist, &text))
 
1617
        return NULL;
 
1618
    
 
1619
    champlain_marker_set_text(CHAMPLAIN_MARKER(self->obj), text);
 
1620
    
 
1621
    Py_INCREF(Py_None);
 
1622
    return Py_None;
 
1623
}
 
1624
 
 
1625
static PyObject *
 
1626
_wrap_champlain_marker_set_image(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1627
{
 
1628
    static char *kwlist[] = { "image", NULL };
 
1629
    PyGObject *image;
 
1630
 
 
1631
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainMarker.set_image", kwlist, &PyClutterActor_Type, &image))
 
1632
        return NULL;
 
1633
    
 
1634
    champlain_marker_set_image(CHAMPLAIN_MARKER(self->obj), CLUTTER_ACTOR(image->obj));
 
1635
    
 
1636
    Py_INCREF(Py_None);
 
1637
    return Py_None;
 
1638
}
 
1639
 
 
1640
static PyObject *
 
1641
_wrap_champlain_marker_set_use_markup(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1642
{
 
1643
    static char *kwlist[] = { "use_markup", NULL };
 
1644
    int use_markup;
 
1645
 
 
1646
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainMarker.set_use_markup", kwlist, &use_markup))
 
1647
        return NULL;
 
1648
    
 
1649
    champlain_marker_set_use_markup(CHAMPLAIN_MARKER(self->obj), use_markup);
 
1650
    
 
1651
    Py_INCREF(Py_None);
 
1652
    return Py_None;
 
1653
}
 
1654
 
 
1655
static PyObject *
 
1656
_wrap_champlain_marker_set_alignment(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1657
{
 
1658
    static char *kwlist[] = { "alignment", NULL };
 
1659
    PyObject *py_alignment = NULL;
 
1660
    PangoAlignment alignment;
 
1661
 
 
1662
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainMarker.set_alignment", kwlist, &py_alignment))
 
1663
        return NULL;
 
1664
    if (pyg_enum_get_value(PANGO_TYPE_ALIGNMENT, py_alignment, (gpointer)&alignment))
 
1665
        return NULL;
 
1666
    
 
1667
    champlain_marker_set_alignment(CHAMPLAIN_MARKER(self->obj), alignment);
 
1668
    
 
1669
    Py_INCREF(Py_None);
 
1670
    return Py_None;
 
1671
}
 
1672
 
 
1673
static PyObject *
 
1674
_wrap_champlain_marker_set_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1675
{
 
1676
    static char *kwlist[] = { "color", NULL };
 
1677
    ClutterColor *color = NULL;
 
1678
    PyObject *py_color;
 
1679
 
 
1680
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainMarker.set_color", kwlist, &py_color))
 
1681
        return NULL;
 
1682
    if (pyg_boxed_check(py_color, CLUTTER_TYPE_COLOR))
 
1683
        color = pyg_boxed_get(py_color, ClutterColor);
 
1684
    else {
 
1685
        PyErr_SetString(PyExc_TypeError, "color should be a ClutterColor");
 
1686
        return NULL;
 
1687
    }
 
1688
    
 
1689
    champlain_marker_set_color(CHAMPLAIN_MARKER(self->obj), color);
 
1690
    
 
1691
    Py_INCREF(Py_None);
 
1692
    return Py_None;
 
1693
}
 
1694
 
 
1695
static PyObject *
 
1696
_wrap_champlain_marker_set_text_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1697
{
 
1698
    static char *kwlist[] = { "color", NULL };
 
1699
    ClutterColor *color = NULL;
 
1700
    PyObject *py_color;
 
1701
 
 
1702
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainMarker.set_text_color", kwlist, &py_color))
 
1703
        return NULL;
 
1704
    if (pyg_boxed_check(py_color, CLUTTER_TYPE_COLOR))
 
1705
        color = pyg_boxed_get(py_color, ClutterColor);
 
1706
    else {
 
1707
        PyErr_SetString(PyExc_TypeError, "color should be a ClutterColor");
 
1708
        return NULL;
 
1709
    }
 
1710
    
 
1711
    champlain_marker_set_text_color(CHAMPLAIN_MARKER(self->obj), color);
 
1712
    
 
1713
    Py_INCREF(Py_None);
 
1714
    return Py_None;
 
1715
}
 
1716
 
 
1717
static PyObject *
 
1718
_wrap_champlain_marker_set_font_name(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1719
{
 
1720
    static char *kwlist[] = { "font_name", NULL };
 
1721
    char *font_name;
 
1722
 
 
1723
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainMarker.set_font_name", kwlist, &font_name))
 
1724
        return NULL;
 
1725
    
 
1726
    champlain_marker_set_font_name(CHAMPLAIN_MARKER(self->obj), font_name);
 
1727
    
 
1728
    Py_INCREF(Py_None);
 
1729
    return Py_None;
 
1730
}
 
1731
 
 
1732
static PyObject *
 
1733
_wrap_champlain_marker_set_wrap(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1734
{
 
1735
    static char *kwlist[] = { "wrap", NULL };
 
1736
    int wrap;
 
1737
 
 
1738
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainMarker.set_wrap", kwlist, &wrap))
 
1739
        return NULL;
 
1740
    
 
1741
    champlain_marker_set_wrap(CHAMPLAIN_MARKER(self->obj), wrap);
 
1742
    
 
1743
    Py_INCREF(Py_None);
 
1744
    return Py_None;
 
1745
}
 
1746
 
 
1747
static PyObject *
 
1748
_wrap_champlain_marker_set_wrap_mode(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1749
{
 
1750
    static char *kwlist[] = { "wrap_mode", NULL };
 
1751
    PyObject *py_wrap_mode = NULL;
 
1752
    PangoWrapMode wrap_mode;
 
1753
 
 
1754
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainMarker.set_wrap_mode", kwlist, &py_wrap_mode))
 
1755
        return NULL;
 
1756
    if (pyg_enum_get_value(PANGO_TYPE_WRAP_MODE, py_wrap_mode, (gpointer)&wrap_mode))
 
1757
        return NULL;
 
1758
    
 
1759
    champlain_marker_set_wrap_mode(CHAMPLAIN_MARKER(self->obj), wrap_mode);
 
1760
    
 
1761
    Py_INCREF(Py_None);
 
1762
    return Py_None;
 
1763
}
 
1764
 
 
1765
static PyObject *
 
1766
_wrap_champlain_marker_set_attributes(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1767
{
 
1768
    static char *kwlist[] = { "list", NULL };
 
1769
    PyObject *py_list;
 
1770
    PangoAttrList *list = NULL;
 
1771
 
 
1772
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainMarker.set_attributes", kwlist, &py_list))
 
1773
        return NULL;
 
1774
    if (pyg_boxed_check(py_list, PANGO_TYPE_ATTR_LIST))
 
1775
        list = pyg_boxed_get(py_list, PangoAttrList);
 
1776
    else {
 
1777
        PyErr_SetString(PyExc_TypeError, "list should be a PangoAttrList");
 
1778
        return NULL;
 
1779
    }
 
1780
    
 
1781
    champlain_marker_set_attributes(CHAMPLAIN_MARKER(self->obj), list);
 
1782
    
 
1783
    Py_INCREF(Py_None);
 
1784
    return Py_None;
 
1785
}
 
1786
 
 
1787
static PyObject *
 
1788
_wrap_champlain_marker_set_single_line_mode(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1789
{
 
1790
    static char *kwlist[] = { "mode", NULL };
 
1791
    int mode;
 
1792
 
 
1793
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainMarker.set_single_line_mode", kwlist, &mode))
 
1794
        return NULL;
 
1795
    
 
1796
    champlain_marker_set_single_line_mode(CHAMPLAIN_MARKER(self->obj), mode);
 
1797
    
 
1798
    Py_INCREF(Py_None);
 
1799
    return Py_None;
 
1800
}
 
1801
 
 
1802
static PyObject *
 
1803
_wrap_champlain_marker_set_ellipsize(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1804
{
 
1805
    static char *kwlist[] = { "mode", NULL };
 
1806
    PyObject *py_mode = NULL;
 
1807
    PangoEllipsizeMode mode;
 
1808
 
 
1809
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainMarker.set_ellipsize", kwlist, &py_mode))
 
1810
        return NULL;
 
1811
    if (pyg_enum_get_value(PANGO_TYPE_ELLIPSIZE_MODE, py_mode, (gpointer)&mode))
 
1812
        return NULL;
 
1813
    
 
1814
    champlain_marker_set_ellipsize(CHAMPLAIN_MARKER(self->obj), mode);
 
1815
    
 
1816
    Py_INCREF(Py_None);
 
1817
    return Py_None;
 
1818
}
 
1819
 
 
1820
static PyObject *
 
1821
_wrap_champlain_marker_set_draw_background(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1822
{
 
1823
    static char *kwlist[] = { "background", NULL };
 
1824
    int background;
 
1825
 
 
1826
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainMarker.set_draw_background", kwlist, &background))
 
1827
        return NULL;
 
1828
    
 
1829
    champlain_marker_set_draw_background(CHAMPLAIN_MARKER(self->obj), background);
 
1830
    
 
1831
    Py_INCREF(Py_None);
 
1832
    return Py_None;
 
1833
}
 
1834
 
 
1835
static PyObject *
 
1836
_wrap_champlain_marker_get_use_markup(PyGObject *self)
 
1837
{
 
1838
    int ret;
 
1839
 
 
1840
    
 
1841
    ret = champlain_marker_get_use_markup(CHAMPLAIN_MARKER(self->obj));
 
1842
    
 
1843
    return PyBool_FromLong(ret);
 
1844
 
 
1845
}
 
1846
 
 
1847
static PyObject *
 
1848
_wrap_champlain_marker_get_text(PyGObject *self)
 
1849
{
 
1850
    const gchar *ret;
 
1851
 
 
1852
    
 
1853
    ret = champlain_marker_get_text(CHAMPLAIN_MARKER(self->obj));
 
1854
    
 
1855
    if (ret)
 
1856
        return PyString_FromString(ret);
 
1857
    Py_INCREF(Py_None);
 
1858
    return Py_None;
 
1859
}
 
1860
 
 
1861
static PyObject *
 
1862
_wrap_champlain_marker_get_image(PyGObject *self)
 
1863
{
 
1864
    ClutterActor *ret;
 
1865
 
 
1866
    
 
1867
    ret = champlain_marker_get_image(CHAMPLAIN_MARKER(self->obj));
 
1868
    
 
1869
    /* pygobject_new handles NULL checking */
 
1870
    return pygobject_new((GObject *)ret);
 
1871
}
 
1872
 
 
1873
static PyObject *
 
1874
_wrap_champlain_marker_get_alignment(PyGObject *self)
 
1875
{
 
1876
    gint ret;
 
1877
 
 
1878
    
 
1879
    ret = champlain_marker_get_alignment(CHAMPLAIN_MARKER(self->obj));
 
1880
    
 
1881
    return pyg_enum_from_gtype(PANGO_TYPE_ALIGNMENT, ret);
 
1882
}
 
1883
 
 
1884
static PyObject *
 
1885
_wrap_champlain_marker_get_color(PyGObject *self)
 
1886
{
 
1887
    ClutterColor *ret;
 
1888
 
 
1889
    
 
1890
    ret = champlain_marker_get_color(CHAMPLAIN_MARKER(self->obj));
 
1891
    
 
1892
    /* pyg_boxed_new handles NULL checking */
 
1893
    return pyg_boxed_new(CLUTTER_TYPE_COLOR, ret, TRUE, TRUE);
 
1894
}
 
1895
 
 
1896
static PyObject *
 
1897
_wrap_champlain_marker_get_text_color(PyGObject *self)
 
1898
{
 
1899
    ClutterColor *ret;
 
1900
 
 
1901
    
 
1902
    ret = champlain_marker_get_text_color(CHAMPLAIN_MARKER(self->obj));
 
1903
    
 
1904
    /* pyg_boxed_new handles NULL checking */
 
1905
    return pyg_boxed_new(CLUTTER_TYPE_COLOR, ret, TRUE, TRUE);
 
1906
}
 
1907
 
 
1908
static PyObject *
 
1909
_wrap_champlain_marker_get_font_name(PyGObject *self)
 
1910
{
 
1911
    const gchar *ret;
 
1912
 
 
1913
    
 
1914
    ret = champlain_marker_get_font_name(CHAMPLAIN_MARKER(self->obj));
 
1915
    
 
1916
    if (ret)
 
1917
        return PyString_FromString(ret);
 
1918
    Py_INCREF(Py_None);
 
1919
    return Py_None;
 
1920
}
 
1921
 
 
1922
static PyObject *
 
1923
_wrap_champlain_marker_get_wrap(PyGObject *self)
 
1924
{
 
1925
    int ret;
 
1926
 
 
1927
    
 
1928
    ret = champlain_marker_get_wrap(CHAMPLAIN_MARKER(self->obj));
 
1929
    
 
1930
    return PyBool_FromLong(ret);
 
1931
 
 
1932
}
 
1933
 
 
1934
static PyObject *
 
1935
_wrap_champlain_marker_get_wrap_mode(PyGObject *self)
 
1936
{
 
1937
    gint ret;
 
1938
 
 
1939
    
 
1940
    ret = champlain_marker_get_wrap_mode(CHAMPLAIN_MARKER(self->obj));
 
1941
    
 
1942
    return pyg_enum_from_gtype(PANGO_TYPE_WRAP_MODE, ret);
 
1943
}
 
1944
 
 
1945
static PyObject *
 
1946
_wrap_champlain_marker_get_ellipsize(PyGObject *self)
 
1947
{
 
1948
    gint ret;
 
1949
 
 
1950
    
 
1951
    ret = champlain_marker_get_ellipsize(CHAMPLAIN_MARKER(self->obj));
 
1952
    
 
1953
    return pyg_enum_from_gtype(PANGO_TYPE_ELLIPSIZE_MODE, ret);
 
1954
}
 
1955
 
 
1956
static PyObject *
 
1957
_wrap_champlain_marker_get_single_line_mode(PyGObject *self)
 
1958
{
 
1959
    int ret;
 
1960
 
 
1961
    
 
1962
    ret = champlain_marker_get_single_line_mode(CHAMPLAIN_MARKER(self->obj));
 
1963
    
 
1964
    return PyBool_FromLong(ret);
 
1965
 
 
1966
}
 
1967
 
 
1968
static PyObject *
 
1969
_wrap_champlain_marker_get_draw_background(PyGObject *self)
 
1970
{
 
1971
    int ret;
 
1972
 
 
1973
    
 
1974
    ret = champlain_marker_get_draw_background(CHAMPLAIN_MARKER(self->obj));
 
1975
    
 
1976
    return PyBool_FromLong(ret);
 
1977
 
 
1978
}
 
1979
 
 
1980
static const PyMethodDef _PyChamplainMarker_methods[] = {
 
1981
    { "set_text", (PyCFunction)_wrap_champlain_marker_set_text, METH_VARARGS|METH_KEYWORDS,
 
1982
      NULL },
 
1983
    { "set_image", (PyCFunction)_wrap_champlain_marker_set_image, METH_VARARGS|METH_KEYWORDS,
 
1984
      NULL },
 
1985
    { "set_use_markup", (PyCFunction)_wrap_champlain_marker_set_use_markup, METH_VARARGS|METH_KEYWORDS,
 
1986
      NULL },
 
1987
    { "set_alignment", (PyCFunction)_wrap_champlain_marker_set_alignment, METH_VARARGS|METH_KEYWORDS,
 
1988
      NULL },
 
1989
    { "set_color", (PyCFunction)_wrap_champlain_marker_set_color, METH_VARARGS|METH_KEYWORDS,
 
1990
      NULL },
 
1991
    { "set_text_color", (PyCFunction)_wrap_champlain_marker_set_text_color, METH_VARARGS|METH_KEYWORDS,
 
1992
      NULL },
 
1993
    { "set_font_name", (PyCFunction)_wrap_champlain_marker_set_font_name, METH_VARARGS|METH_KEYWORDS,
 
1994
      NULL },
 
1995
    { "set_wrap", (PyCFunction)_wrap_champlain_marker_set_wrap, METH_VARARGS|METH_KEYWORDS,
 
1996
      NULL },
 
1997
    { "set_wrap_mode", (PyCFunction)_wrap_champlain_marker_set_wrap_mode, METH_VARARGS|METH_KEYWORDS,
 
1998
      NULL },
 
1999
    { "set_attributes", (PyCFunction)_wrap_champlain_marker_set_attributes, METH_VARARGS|METH_KEYWORDS,
 
2000
      NULL },
 
2001
    { "set_single_line_mode", (PyCFunction)_wrap_champlain_marker_set_single_line_mode, METH_VARARGS|METH_KEYWORDS,
 
2002
      NULL },
 
2003
    { "set_ellipsize", (PyCFunction)_wrap_champlain_marker_set_ellipsize, METH_VARARGS|METH_KEYWORDS,
 
2004
      NULL },
 
2005
    { "set_draw_background", (PyCFunction)_wrap_champlain_marker_set_draw_background, METH_VARARGS|METH_KEYWORDS,
 
2006
      NULL },
 
2007
    { "get_use_markup", (PyCFunction)_wrap_champlain_marker_get_use_markup, METH_NOARGS,
 
2008
      NULL },
 
2009
    { "get_text", (PyCFunction)_wrap_champlain_marker_get_text, METH_NOARGS,
 
2010
      NULL },
 
2011
    { "get_image", (PyCFunction)_wrap_champlain_marker_get_image, METH_NOARGS,
 
2012
      NULL },
 
2013
    { "get_alignment", (PyCFunction)_wrap_champlain_marker_get_alignment, METH_NOARGS,
 
2014
      NULL },
 
2015
    { "get_color", (PyCFunction)_wrap_champlain_marker_get_color, METH_NOARGS,
 
2016
      NULL },
 
2017
    { "get_text_color", (PyCFunction)_wrap_champlain_marker_get_text_color, METH_NOARGS,
 
2018
      NULL },
 
2019
    { "get_font_name", (PyCFunction)_wrap_champlain_marker_get_font_name, METH_NOARGS,
 
2020
      NULL },
 
2021
    { "get_wrap", (PyCFunction)_wrap_champlain_marker_get_wrap, METH_NOARGS,
 
2022
      NULL },
 
2023
    { "get_wrap_mode", (PyCFunction)_wrap_champlain_marker_get_wrap_mode, METH_NOARGS,
 
2024
      NULL },
 
2025
    { "get_ellipsize", (PyCFunction)_wrap_champlain_marker_get_ellipsize, METH_NOARGS,
 
2026
      NULL },
 
2027
    { "get_single_line_mode", (PyCFunction)_wrap_champlain_marker_get_single_line_mode, METH_NOARGS,
 
2028
      NULL },
 
2029
    { "get_draw_background", (PyCFunction)_wrap_champlain_marker_get_draw_background, METH_NOARGS,
 
2030
      NULL },
 
2031
    { NULL, NULL, 0, NULL }
 
2032
};
 
2033
 
 
2034
PyTypeObject G_GNUC_INTERNAL PyChamplainMarker_Type = {
 
2035
    PyObject_HEAD_INIT(NULL)
 
2036
    0,                                 /* ob_size */
 
2037
    "champlain.Marker",                   /* tp_name */
 
2038
    sizeof(PyGObject),          /* tp_basicsize */
 
2039
    0,                                 /* tp_itemsize */
 
2040
    /* methods */
 
2041
    (destructor)0,        /* tp_dealloc */
 
2042
    (printfunc)0,                      /* tp_print */
 
2043
    (getattrfunc)0,       /* tp_getattr */
 
2044
    (setattrfunc)0,       /* tp_setattr */
 
2045
    (cmpfunc)0,           /* tp_compare */
 
2046
    (reprfunc)0,             /* tp_repr */
 
2047
    (PyNumberMethods*)0,     /* tp_as_number */
 
2048
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2049
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2050
    (hashfunc)0,             /* tp_hash */
 
2051
    (ternaryfunc)0,          /* tp_call */
 
2052
    (reprfunc)0,              /* tp_str */
 
2053
    (getattrofunc)0,     /* tp_getattro */
 
2054
    (setattrofunc)0,     /* tp_setattro */
 
2055
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2056
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2057
    NULL,                        /* Documentation string */
 
2058
    (traverseproc)0,     /* tp_traverse */
 
2059
    (inquiry)0,             /* tp_clear */
 
2060
    (richcmpfunc)0,   /* tp_richcompare */
 
2061
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2062
    (getiterfunc)0,          /* tp_iter */
 
2063
    (iternextfunc)0,     /* tp_iternext */
 
2064
    (struct PyMethodDef*)_PyChamplainMarker_methods, /* tp_methods */
 
2065
    (struct PyMemberDef*)0,              /* tp_members */
 
2066
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2067
    NULL,                              /* tp_base */
 
2068
    NULL,                              /* tp_dict */
 
2069
    (descrgetfunc)0,    /* tp_descr_get */
 
2070
    (descrsetfunc)0,    /* tp_descr_set */
 
2071
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2072
    (initproc)_wrap_champlain_marker_new,             /* tp_init */
 
2073
    (allocfunc)0,           /* tp_alloc */
 
2074
    (newfunc)0,               /* tp_new */
 
2075
    (freefunc)0,             /* tp_free */
 
2076
    (inquiry)0              /* tp_is_gc */
 
2077
};
 
2078
 
 
2079
 
 
2080
 
 
2081
/* ----------- ChamplainNetworkMapSource ----------- */
 
2082
 
 
2083
static PyObject *
 
2084
_wrap_champlain_network_map_source_get_tile_uri(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2085
{
 
2086
    static char *kwlist[] = { "x", "y", "z", NULL };
 
2087
    int x, y, z;
 
2088
    gchar *ret;
 
2089
 
 
2090
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"iii:ChamplainNetworkMapSource.get_tile_uri", kwlist, &x, &y, &z))
 
2091
        return NULL;
 
2092
    
 
2093
    ret = champlain_network_map_source_get_tile_uri(CHAMPLAIN_NETWORK_MAP_SOURCE(self->obj), x, y, z);
 
2094
    
 
2095
    if (ret) {
 
2096
        PyObject *py_ret = PyString_FromString(ret);
 
2097
        g_free(ret);
 
2098
        return py_ret;
 
2099
    }
 
2100
    Py_INCREF(Py_None);
 
2101
    return Py_None;
 
2102
}
 
2103
 
 
2104
static PyObject *
 
2105
_wrap_champlain_network_map_source_set_uri_format(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2106
{
 
2107
    static char *kwlist[] = { "uri_format", NULL };
 
2108
    char *uri_format;
 
2109
 
 
2110
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainNetworkMapSource.set_uri_format", kwlist, &uri_format))
 
2111
        return NULL;
 
2112
    
 
2113
    champlain_network_map_source_set_uri_format(CHAMPLAIN_NETWORK_MAP_SOURCE(self->obj), uri_format);
 
2114
    
 
2115
    Py_INCREF(Py_None);
 
2116
    return Py_None;
 
2117
}
 
2118
 
 
2119
static const PyMethodDef _PyChamplainNetworkMapSource_methods[] = {
 
2120
    { "get_tile_uri", (PyCFunction)_wrap_champlain_network_map_source_get_tile_uri, METH_VARARGS|METH_KEYWORDS,
 
2121
      NULL },
 
2122
    { "set_uri_format", (PyCFunction)_wrap_champlain_network_map_source_set_uri_format, METH_VARARGS|METH_KEYWORDS,
 
2123
      NULL },
 
2124
    { NULL, NULL, 0, NULL }
 
2125
};
 
2126
 
 
2127
PyTypeObject G_GNUC_INTERNAL PyChamplainNetworkMapSource_Type = {
 
2128
    PyObject_HEAD_INIT(NULL)
 
2129
    0,                                 /* ob_size */
 
2130
    "champlain.NetworkMapSource",                   /* tp_name */
 
2131
    sizeof(PyGObject),          /* tp_basicsize */
 
2132
    0,                                 /* tp_itemsize */
 
2133
    /* methods */
 
2134
    (destructor)0,        /* tp_dealloc */
 
2135
    (printfunc)0,                      /* tp_print */
 
2136
    (getattrfunc)0,       /* tp_getattr */
 
2137
    (setattrfunc)0,       /* tp_setattr */
 
2138
    (cmpfunc)0,           /* tp_compare */
 
2139
    (reprfunc)0,             /* tp_repr */
 
2140
    (PyNumberMethods*)0,     /* tp_as_number */
 
2141
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2142
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2143
    (hashfunc)0,             /* tp_hash */
 
2144
    (ternaryfunc)0,          /* tp_call */
 
2145
    (reprfunc)0,              /* tp_str */
 
2146
    (getattrofunc)0,     /* tp_getattro */
 
2147
    (setattrofunc)0,     /* tp_setattro */
 
2148
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2149
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2150
    NULL,                        /* Documentation string */
 
2151
    (traverseproc)0,     /* tp_traverse */
 
2152
    (inquiry)0,             /* tp_clear */
 
2153
    (richcmpfunc)0,   /* tp_richcompare */
 
2154
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2155
    (getiterfunc)0,          /* tp_iter */
 
2156
    (iternextfunc)0,     /* tp_iternext */
 
2157
    (struct PyMethodDef*)_PyChamplainNetworkMapSource_methods, /* tp_methods */
 
2158
    (struct PyMemberDef*)0,              /* tp_members */
 
2159
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2160
    NULL,                              /* tp_base */
 
2161
    NULL,                              /* tp_dict */
 
2162
    (descrgetfunc)0,    /* tp_descr_get */
 
2163
    (descrsetfunc)0,    /* tp_descr_set */
 
2164
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2165
    (initproc)0,             /* tp_init */
 
2166
    (allocfunc)0,           /* tp_alloc */
 
2167
    (newfunc)0,               /* tp_new */
 
2168
    (freefunc)0,             /* tp_free */
 
2169
    (inquiry)0              /* tp_is_gc */
 
2170
};
 
2171
 
 
2172
 
 
2173
 
 
2174
/* ----------- ChamplainPolygon ----------- */
 
2175
 
 
2176
static int
 
2177
_wrap_champlain_polygon_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2178
{
 
2179
    static char* kwlist[] = { NULL };
 
2180
 
 
2181
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
2182
                                     ":champlain.Polygon.__init__",
 
2183
                                     kwlist))
 
2184
        return -1;
 
2185
 
 
2186
    pygobject_constructv(self, 0, NULL);
 
2187
    if (!self->obj) {
 
2188
        PyErr_SetString(
 
2189
            PyExc_RuntimeError, 
 
2190
            "could not create champlain.Polygon object");
 
2191
        return -1;
 
2192
    }
 
2193
    return 0;
 
2194
}
 
2195
 
 
2196
static PyObject *
 
2197
_wrap_champlain_polygon_append_point(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2198
{
 
2199
    static char *kwlist[] = { "lat", "lon", NULL };
 
2200
    double lat, lon;
 
2201
    ChamplainPoint *ret;
 
2202
 
 
2203
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"dd:ChamplainPolygon.append_point", kwlist, &lat, &lon))
 
2204
        return NULL;
 
2205
    
 
2206
    ret = champlain_polygon_append_point(CHAMPLAIN_POLYGON(self->obj), lat, lon);
 
2207
    
 
2208
    /* pyg_boxed_new handles NULL checking */
 
2209
    return pyg_boxed_new(CHAMPLAIN_TYPE_POINT, ret, TRUE, TRUE);
 
2210
}
 
2211
 
 
2212
static PyObject *
 
2213
_wrap_champlain_polygon_insert_point(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2214
{
 
2215
    static char *kwlist[] = { "lat", "lon", "pos", NULL };
 
2216
    int pos;
 
2217
    double lat, lon;
 
2218
    ChamplainPoint *ret;
 
2219
 
 
2220
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ddi:ChamplainPolygon.insert_point", kwlist, &lat, &lon, &pos))
 
2221
        return NULL;
 
2222
    
 
2223
    ret = champlain_polygon_insert_point(CHAMPLAIN_POLYGON(self->obj), lat, lon, pos);
 
2224
    
 
2225
    /* pyg_boxed_new handles NULL checking */
 
2226
    return pyg_boxed_new(CHAMPLAIN_TYPE_POINT, ret, TRUE, TRUE);
 
2227
}
 
2228
 
 
2229
static PyObject *
 
2230
_wrap_champlain_polygon_remove_point(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2231
{
 
2232
    static char *kwlist[] = { "point", NULL };
 
2233
    PyObject *py_point;
 
2234
    ChamplainPoint *point = NULL;
 
2235
 
 
2236
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainPolygon.remove_point", kwlist, &py_point))
 
2237
        return NULL;
 
2238
    if (pyg_boxed_check(py_point, CHAMPLAIN_TYPE_POINT))
 
2239
        point = pyg_boxed_get(py_point, ChamplainPoint);
 
2240
    else {
 
2241
        PyErr_SetString(PyExc_TypeError, "point should be a ChamplainPoint");
 
2242
        return NULL;
 
2243
    }
 
2244
    
 
2245
    champlain_polygon_remove_point(CHAMPLAIN_POLYGON(self->obj), point);
 
2246
    
 
2247
    Py_INCREF(Py_None);
 
2248
    return Py_None;
 
2249
}
 
2250
 
 
2251
static PyObject *
 
2252
_wrap_champlain_polygon_clear_points(PyGObject *self)
 
2253
{
 
2254
    
 
2255
    champlain_polygon_clear_points(CHAMPLAIN_POLYGON(self->obj));
 
2256
    
 
2257
    Py_INCREF(Py_None);
 
2258
    return Py_None;
 
2259
}
 
2260
 
 
2261
#line 98 "pychamplain.override"
 
2262
static PyObject *
 
2263
_wrap_champlain_polygon_get_points(PyGObject *self, PyObject *args) 
 
2264
{
 
2265
    GList *iter, *list = champlain_polygon_get_points(CHAMPLAIN_POLYGON(self->obj));
 
2266
    PyObject *ret = PyList_New(0);
 
2267
    PyObject *pypoint;
 
2268
 
 
2269
        for(iter = list; iter != NULL; iter = iter->next) {
 
2270
                ChamplainPoint *point = (ChamplainPoint *) iter->data;
 
2271
        pypoint = pyg_boxed_new(CHAMPLAIN_TYPE_POINT, point, TRUE, TRUE);
 
2272
                PyList_Append(ret, pypoint);
 
2273
                Py_DECREF(pypoint);
 
2274
    }
 
2275
    return ret;
 
2276
}
 
2277
#line 2278 "pychamplain.c"
 
2278
 
 
2279
 
 
2280
static PyObject *
 
2281
_wrap_champlain_polygon_set_fill_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2282
{
 
2283
    static char *kwlist[] = { "color", NULL };
 
2284
    ClutterColor *color = NULL;
 
2285
    PyObject *py_color;
 
2286
 
 
2287
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainPolygon.set_fill_color", kwlist, &py_color))
 
2288
        return NULL;
 
2289
    if (pyg_boxed_check(py_color, CLUTTER_TYPE_COLOR))
 
2290
        color = pyg_boxed_get(py_color, ClutterColor);
 
2291
    else {
 
2292
        PyErr_SetString(PyExc_TypeError, "color should be a ClutterColor");
 
2293
        return NULL;
 
2294
    }
 
2295
    
 
2296
    champlain_polygon_set_fill_color(CHAMPLAIN_POLYGON(self->obj), color);
 
2297
    
 
2298
    Py_INCREF(Py_None);
 
2299
    return Py_None;
 
2300
}
 
2301
 
 
2302
static PyObject *
 
2303
_wrap_champlain_polygon_set_stroke_color(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2304
{
 
2305
    static char *kwlist[] = { "color", NULL };
 
2306
    ClutterColor *color = NULL;
 
2307
    PyObject *py_color;
 
2308
 
 
2309
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainPolygon.set_stroke_color", kwlist, &py_color))
 
2310
        return NULL;
 
2311
    if (pyg_boxed_check(py_color, CLUTTER_TYPE_COLOR))
 
2312
        color = pyg_boxed_get(py_color, ClutterColor);
 
2313
    else {
 
2314
        PyErr_SetString(PyExc_TypeError, "color should be a ClutterColor");
 
2315
        return NULL;
 
2316
    }
 
2317
    
 
2318
    champlain_polygon_set_stroke_color(CHAMPLAIN_POLYGON(self->obj), color);
 
2319
    
 
2320
    Py_INCREF(Py_None);
 
2321
    return Py_None;
 
2322
}
 
2323
 
 
2324
static PyObject *
 
2325
_wrap_champlain_polygon_get_fill_color(PyGObject *self)
 
2326
{
 
2327
    ClutterColor *ret;
 
2328
 
 
2329
    
 
2330
    ret = champlain_polygon_get_fill_color(CHAMPLAIN_POLYGON(self->obj));
 
2331
    
 
2332
    /* pyg_boxed_new handles NULL checking */
 
2333
    return pyg_boxed_new(CLUTTER_TYPE_COLOR, ret, TRUE, TRUE);
 
2334
}
 
2335
 
 
2336
static PyObject *
 
2337
_wrap_champlain_polygon_get_stroke_color(PyGObject *self)
 
2338
{
 
2339
    ClutterColor *ret;
 
2340
 
 
2341
    
 
2342
    ret = champlain_polygon_get_stroke_color(CHAMPLAIN_POLYGON(self->obj));
 
2343
    
 
2344
    /* pyg_boxed_new handles NULL checking */
 
2345
    return pyg_boxed_new(CLUTTER_TYPE_COLOR, ret, TRUE, TRUE);
 
2346
}
 
2347
 
 
2348
static PyObject *
 
2349
_wrap_champlain_polygon_get_fill(PyGObject *self)
 
2350
{
 
2351
    int ret;
 
2352
 
 
2353
    
 
2354
    ret = champlain_polygon_get_fill(CHAMPLAIN_POLYGON(self->obj));
 
2355
    
 
2356
    return PyBool_FromLong(ret);
 
2357
 
 
2358
}
 
2359
 
 
2360
static PyObject *
 
2361
_wrap_champlain_polygon_set_fill(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2362
{
 
2363
    static char *kwlist[] = { "value", NULL };
 
2364
    int value;
 
2365
 
 
2366
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainPolygon.set_fill", kwlist, &value))
 
2367
        return NULL;
 
2368
    
 
2369
    champlain_polygon_set_fill(CHAMPLAIN_POLYGON(self->obj), value);
 
2370
    
 
2371
    Py_INCREF(Py_None);
 
2372
    return Py_None;
 
2373
}
 
2374
 
 
2375
static PyObject *
 
2376
_wrap_champlain_polygon_get_stroke(PyGObject *self)
 
2377
{
 
2378
    int ret;
 
2379
 
 
2380
    
 
2381
    ret = champlain_polygon_get_stroke(CHAMPLAIN_POLYGON(self->obj));
 
2382
    
 
2383
    return PyBool_FromLong(ret);
 
2384
 
 
2385
}
 
2386
 
 
2387
static PyObject *
 
2388
_wrap_champlain_polygon_set_stroke(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2389
{
 
2390
    static char *kwlist[] = { "value", NULL };
 
2391
    int value;
 
2392
 
 
2393
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainPolygon.set_stroke", kwlist, &value))
 
2394
        return NULL;
 
2395
    
 
2396
    champlain_polygon_set_stroke(CHAMPLAIN_POLYGON(self->obj), value);
 
2397
    
 
2398
    Py_INCREF(Py_None);
 
2399
    return Py_None;
 
2400
}
 
2401
 
 
2402
static PyObject *
 
2403
_wrap_champlain_polygon_set_stroke_width(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2404
{
 
2405
    static char *kwlist[] = { "value", NULL };
 
2406
    double value;
 
2407
 
 
2408
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"d:ChamplainPolygon.set_stroke_width", kwlist, &value))
 
2409
        return NULL;
 
2410
    
 
2411
    champlain_polygon_set_stroke_width(CHAMPLAIN_POLYGON(self->obj), value);
 
2412
    
 
2413
    Py_INCREF(Py_None);
 
2414
    return Py_None;
 
2415
}
 
2416
 
 
2417
static PyObject *
 
2418
_wrap_champlain_polygon_get_stroke_width(PyGObject *self)
 
2419
{
 
2420
    double ret;
 
2421
 
 
2422
    
 
2423
    ret = champlain_polygon_get_stroke_width(CHAMPLAIN_POLYGON(self->obj));
 
2424
    
 
2425
    return PyFloat_FromDouble(ret);
 
2426
}
 
2427
 
 
2428
static PyObject *
 
2429
_wrap_champlain_polygon_show(PyGObject *self)
 
2430
{
 
2431
    
 
2432
    champlain_polygon_show(CHAMPLAIN_POLYGON(self->obj));
 
2433
    
 
2434
    Py_INCREF(Py_None);
 
2435
    return Py_None;
 
2436
}
 
2437
 
 
2438
static PyObject *
 
2439
_wrap_champlain_polygon_hide(PyGObject *self)
 
2440
{
 
2441
    
 
2442
    champlain_polygon_hide(CHAMPLAIN_POLYGON(self->obj));
 
2443
    
 
2444
    Py_INCREF(Py_None);
 
2445
    return Py_None;
 
2446
}
 
2447
 
 
2448
static const PyMethodDef _PyChamplainPolygon_methods[] = {
 
2449
    { "append_point", (PyCFunction)_wrap_champlain_polygon_append_point, METH_VARARGS|METH_KEYWORDS,
 
2450
      NULL },
 
2451
    { "insert_point", (PyCFunction)_wrap_champlain_polygon_insert_point, METH_VARARGS|METH_KEYWORDS,
 
2452
      NULL },
 
2453
    { "remove_point", (PyCFunction)_wrap_champlain_polygon_remove_point, METH_VARARGS|METH_KEYWORDS,
 
2454
      NULL },
 
2455
    { "clear_points", (PyCFunction)_wrap_champlain_polygon_clear_points, METH_NOARGS,
 
2456
      NULL },
 
2457
    { "get_points", (PyCFunction)_wrap_champlain_polygon_get_points, METH_VARARGS|METH_KEYWORDS,
 
2458
      NULL },
 
2459
    { "set_fill_color", (PyCFunction)_wrap_champlain_polygon_set_fill_color, METH_VARARGS|METH_KEYWORDS,
 
2460
      NULL },
 
2461
    { "set_stroke_color", (PyCFunction)_wrap_champlain_polygon_set_stroke_color, METH_VARARGS|METH_KEYWORDS,
 
2462
      NULL },
 
2463
    { "get_fill_color", (PyCFunction)_wrap_champlain_polygon_get_fill_color, METH_NOARGS,
 
2464
      NULL },
 
2465
    { "get_stroke_color", (PyCFunction)_wrap_champlain_polygon_get_stroke_color, METH_NOARGS,
 
2466
      NULL },
 
2467
    { "get_fill", (PyCFunction)_wrap_champlain_polygon_get_fill, METH_NOARGS,
 
2468
      NULL },
 
2469
    { "set_fill", (PyCFunction)_wrap_champlain_polygon_set_fill, METH_VARARGS|METH_KEYWORDS,
 
2470
      NULL },
 
2471
    { "get_stroke", (PyCFunction)_wrap_champlain_polygon_get_stroke, METH_NOARGS,
 
2472
      NULL },
 
2473
    { "set_stroke", (PyCFunction)_wrap_champlain_polygon_set_stroke, METH_VARARGS|METH_KEYWORDS,
 
2474
      NULL },
 
2475
    { "set_stroke_width", (PyCFunction)_wrap_champlain_polygon_set_stroke_width, METH_VARARGS|METH_KEYWORDS,
 
2476
      NULL },
 
2477
    { "get_stroke_width", (PyCFunction)_wrap_champlain_polygon_get_stroke_width, METH_NOARGS,
 
2478
      NULL },
 
2479
    { "show", (PyCFunction)_wrap_champlain_polygon_show, METH_NOARGS,
 
2480
      NULL },
 
2481
    { "hide", (PyCFunction)_wrap_champlain_polygon_hide, METH_NOARGS,
 
2482
      NULL },
 
2483
    { NULL, NULL, 0, NULL }
 
2484
};
 
2485
 
 
2486
PyTypeObject G_GNUC_INTERNAL PyChamplainPolygon_Type = {
 
2487
    PyObject_HEAD_INIT(NULL)
 
2488
    0,                                 /* ob_size */
 
2489
    "champlain.Polygon",                   /* tp_name */
 
2490
    sizeof(PyGObject),          /* tp_basicsize */
 
2491
    0,                                 /* tp_itemsize */
 
2492
    /* methods */
 
2493
    (destructor)0,        /* tp_dealloc */
 
2494
    (printfunc)0,                      /* tp_print */
 
2495
    (getattrfunc)0,       /* tp_getattr */
 
2496
    (setattrfunc)0,       /* tp_setattr */
 
2497
    (cmpfunc)0,           /* tp_compare */
 
2498
    (reprfunc)0,             /* tp_repr */
 
2499
    (PyNumberMethods*)0,     /* tp_as_number */
 
2500
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2501
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2502
    (hashfunc)0,             /* tp_hash */
 
2503
    (ternaryfunc)0,          /* tp_call */
 
2504
    (reprfunc)0,              /* tp_str */
 
2505
    (getattrofunc)0,     /* tp_getattro */
 
2506
    (setattrofunc)0,     /* tp_setattro */
 
2507
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2508
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2509
    NULL,                        /* Documentation string */
 
2510
    (traverseproc)0,     /* tp_traverse */
 
2511
    (inquiry)0,             /* tp_clear */
 
2512
    (richcmpfunc)0,   /* tp_richcompare */
 
2513
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2514
    (getiterfunc)0,          /* tp_iter */
 
2515
    (iternextfunc)0,     /* tp_iternext */
 
2516
    (struct PyMethodDef*)_PyChamplainPolygon_methods, /* tp_methods */
 
2517
    (struct PyMemberDef*)0,              /* tp_members */
 
2518
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2519
    NULL,                              /* tp_base */
 
2520
    NULL,                              /* tp_dict */
 
2521
    (descrgetfunc)0,    /* tp_descr_get */
 
2522
    (descrsetfunc)0,    /* tp_descr_set */
 
2523
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2524
    (initproc)_wrap_champlain_polygon_new,             /* tp_init */
 
2525
    (allocfunc)0,           /* tp_alloc */
 
2526
    (newfunc)0,               /* tp_new */
 
2527
    (freefunc)0,             /* tp_free */
 
2528
    (inquiry)0              /* tp_is_gc */
 
2529
};
 
2530
 
 
2531
 
 
2532
 
 
2533
/* ----------- ChamplainTile ----------- */
 
2534
 
 
2535
static int
 
2536
_wrap_champlain_tile_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2537
{
 
2538
    static char* kwlist[] = { NULL };
 
2539
 
 
2540
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
2541
                                     ":champlain.Tile.__init__",
 
2542
                                     kwlist))
 
2543
        return -1;
 
2544
 
 
2545
    pygobject_constructv(self, 0, NULL);
 
2546
    if (!self->obj) {
 
2547
        PyErr_SetString(
 
2548
            PyExc_RuntimeError, 
 
2549
            "could not create champlain.Tile object");
 
2550
        return -1;
 
2551
    }
 
2552
    return 0;
 
2553
}
 
2554
 
 
2555
static PyObject *
 
2556
_wrap_champlain_tile_get_x(PyGObject *self)
 
2557
{
 
2558
    int ret;
 
2559
 
 
2560
    
 
2561
    ret = champlain_tile_get_x(CHAMPLAIN_TILE(self->obj));
 
2562
    
 
2563
    return PyInt_FromLong(ret);
 
2564
}
 
2565
 
 
2566
static PyObject *
 
2567
_wrap_champlain_tile_get_y(PyGObject *self)
 
2568
{
 
2569
    int ret;
 
2570
 
 
2571
    
 
2572
    ret = champlain_tile_get_y(CHAMPLAIN_TILE(self->obj));
 
2573
    
 
2574
    return PyInt_FromLong(ret);
 
2575
}
 
2576
 
 
2577
static PyObject *
 
2578
_wrap_champlain_tile_get_zoom_level(PyGObject *self)
 
2579
{
 
2580
    int ret;
 
2581
 
 
2582
    
 
2583
    ret = champlain_tile_get_zoom_level(CHAMPLAIN_TILE(self->obj));
 
2584
    
 
2585
    return PyInt_FromLong(ret);
 
2586
}
 
2587
 
 
2588
static PyObject *
 
2589
_wrap_champlain_tile_get_size(PyGObject *self)
 
2590
{
 
2591
    guint ret;
 
2592
 
 
2593
    
 
2594
    ret = champlain_tile_get_size(CHAMPLAIN_TILE(self->obj));
 
2595
    
 
2596
    return PyLong_FromUnsignedLong(ret);
 
2597
}
 
2598
 
 
2599
static PyObject *
 
2600
_wrap_champlain_tile_get_state(PyGObject *self)
 
2601
{
 
2602
    gint ret;
 
2603
 
 
2604
    
 
2605
    ret = champlain_tile_get_state(CHAMPLAIN_TILE(self->obj));
 
2606
    
 
2607
    return pyg_enum_from_gtype(CHAMPLAIN_TYPE_STATE, ret);
 
2608
}
 
2609
 
 
2610
static PyObject *
 
2611
_wrap_champlain_tile_get_uri(PyGObject *self)
 
2612
{
 
2613
    const gchar *ret;
 
2614
 
 
2615
    
 
2616
    ret = champlain_tile_get_uri(CHAMPLAIN_TILE(self->obj));
 
2617
    
 
2618
    if (ret)
 
2619
        return PyString_FromString(ret);
 
2620
    Py_INCREF(Py_None);
 
2621
    return Py_None;
 
2622
}
 
2623
 
 
2624
static PyObject *
 
2625
_wrap_champlain_tile_get_filename(PyGObject *self)
 
2626
{
 
2627
    const gchar *ret;
 
2628
 
 
2629
    
 
2630
    ret = champlain_tile_get_filename(CHAMPLAIN_TILE(self->obj));
 
2631
    
 
2632
    if (ret)
 
2633
        return PyString_FromString(ret);
 
2634
    Py_INCREF(Py_None);
 
2635
    return Py_None;
 
2636
}
 
2637
 
 
2638
static PyObject *
 
2639
_wrap_champlain_tile_get_actor(PyGObject *self)
 
2640
{
 
2641
    ClutterActor *ret;
 
2642
 
 
2643
    
 
2644
    ret = champlain_tile_get_actor(CHAMPLAIN_TILE(self->obj));
 
2645
    
 
2646
    /* pygobject_new handles NULL checking */
 
2647
    return pygobject_new((GObject *)ret);
 
2648
}
 
2649
 
 
2650
static PyObject *
 
2651
_wrap_champlain_tile_get_content(PyGObject *self)
 
2652
{
 
2653
    ClutterActor *ret;
 
2654
 
 
2655
    
 
2656
    ret = champlain_tile_get_content(CHAMPLAIN_TILE(self->obj));
 
2657
    
 
2658
    /* pygobject_new handles NULL checking */
 
2659
    return pygobject_new((GObject *)ret);
 
2660
}
 
2661
 
 
2662
#line 218 "pychamplain.override"
 
2663
static PyObject *
 
2664
_wrap_champlain_tile_get_modified_time(PyGObject *self, PyObject *args) 
 
2665
{
 
2666
    const GTimeVal *modified_time = NULL;
 
2667
 
 
2668
    modified_time = champlain_tile_get_modified_time(CHAMPLAIN_TILE(self->obj));
 
2669
    if (modified_time == NULL){
 
2670
        Py_INCREF(Py_None);
 
2671
        return Py_None;
 
2672
    }
 
2673
 
 
2674
    return PyFloat_FromDouble((double)modified_time->tv_sec + \
 
2675
        (double)modified_time->tv_usec * 0.000001);
 
2676
}
 
2677
#line 2678 "pychamplain.c"
 
2678
 
 
2679
 
 
2680
static PyObject *
 
2681
_wrap_champlain_tile_get_modified_time_string(PyGObject *self)
 
2682
{
 
2683
    gchar *ret;
 
2684
 
 
2685
    
 
2686
    ret = champlain_tile_get_modified_time_string(CHAMPLAIN_TILE(self->obj));
 
2687
    
 
2688
    if (ret) {
 
2689
        PyObject *py_ret = PyString_FromString(ret);
 
2690
        g_free(ret);
 
2691
        return py_ret;
 
2692
    }
 
2693
    Py_INCREF(Py_None);
 
2694
    return Py_None;
 
2695
}
 
2696
 
 
2697
static PyObject *
 
2698
_wrap_champlain_tile_get_etag(PyGObject *self)
 
2699
{
 
2700
    const gchar *ret;
 
2701
 
 
2702
    
 
2703
    ret = champlain_tile_get_etag(CHAMPLAIN_TILE(self->obj));
 
2704
    
 
2705
    if (ret)
 
2706
        return PyString_FromString(ret);
 
2707
    Py_INCREF(Py_None);
 
2708
    return Py_None;
 
2709
}
 
2710
 
 
2711
static PyObject *
 
2712
_wrap_champlain_tile_set_x(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2713
{
 
2714
    static char *kwlist[] = { "x", NULL };
 
2715
    int x;
 
2716
 
 
2717
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainTile.set_x", kwlist, &x))
 
2718
        return NULL;
 
2719
    
 
2720
    champlain_tile_set_x(CHAMPLAIN_TILE(self->obj), x);
 
2721
    
 
2722
    Py_INCREF(Py_None);
 
2723
    return Py_None;
 
2724
}
 
2725
 
 
2726
static PyObject *
 
2727
_wrap_champlain_tile_set_y(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2728
{
 
2729
    static char *kwlist[] = { "y", NULL };
 
2730
    int y;
 
2731
 
 
2732
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainTile.set_y", kwlist, &y))
 
2733
        return NULL;
 
2734
    
 
2735
    champlain_tile_set_y(CHAMPLAIN_TILE(self->obj), y);
 
2736
    
 
2737
    Py_INCREF(Py_None);
 
2738
    return Py_None;
 
2739
}
 
2740
 
 
2741
static PyObject *
 
2742
_wrap_champlain_tile_set_zoom_level(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2743
{
 
2744
    static char *kwlist[] = { "zoom_level", NULL };
 
2745
    int zoom_level;
 
2746
 
 
2747
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainTile.set_zoom_level", kwlist, &zoom_level))
 
2748
        return NULL;
 
2749
    
 
2750
    champlain_tile_set_zoom_level(CHAMPLAIN_TILE(self->obj), zoom_level);
 
2751
    
 
2752
    Py_INCREF(Py_None);
 
2753
    return Py_None;
 
2754
}
 
2755
 
 
2756
static PyObject *
 
2757
_wrap_champlain_tile_set_size(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2758
{
 
2759
    static char *kwlist[] = { "size", NULL };
 
2760
    PyObject *py_size = NULL;
 
2761
    guint size = 0;
 
2762
 
 
2763
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainTile.set_size", kwlist, &py_size))
 
2764
        return NULL;
 
2765
    if (py_size) {
 
2766
        if (PyLong_Check(py_size))
 
2767
            size = PyLong_AsUnsignedLong(py_size);
 
2768
        else if (PyInt_Check(py_size))
 
2769
            size = PyInt_AsLong(py_size);
 
2770
        else
 
2771
            PyErr_SetString(PyExc_TypeError, "Parameter 'size' must be an int or a long");
 
2772
        if (PyErr_Occurred())
 
2773
            return NULL;
 
2774
    }
 
2775
    
 
2776
    champlain_tile_set_size(CHAMPLAIN_TILE(self->obj), size);
 
2777
    
 
2778
    Py_INCREF(Py_None);
 
2779
    return Py_None;
 
2780
}
 
2781
 
 
2782
static PyObject *
 
2783
_wrap_champlain_tile_set_state(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2784
{
 
2785
    static char *kwlist[] = { "state", NULL };
 
2786
    PyObject *py_state = NULL;
 
2787
    ChamplainState state;
 
2788
 
 
2789
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainTile.set_state", kwlist, &py_state))
 
2790
        return NULL;
 
2791
    if (pyg_enum_get_value(CHAMPLAIN_TYPE_STATE, py_state, (gpointer)&state))
 
2792
        return NULL;
 
2793
    
 
2794
    champlain_tile_set_state(CHAMPLAIN_TILE(self->obj), state);
 
2795
    
 
2796
    Py_INCREF(Py_None);
 
2797
    return Py_None;
 
2798
}
 
2799
 
 
2800
static PyObject *
 
2801
_wrap_champlain_tile_set_uri(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2802
{
 
2803
    static char *kwlist[] = { "uri", NULL };
 
2804
    char *uri;
 
2805
 
 
2806
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainTile.set_uri", kwlist, &uri))
 
2807
        return NULL;
 
2808
    
 
2809
    champlain_tile_set_uri(CHAMPLAIN_TILE(self->obj), uri);
 
2810
    
 
2811
    Py_INCREF(Py_None);
 
2812
    return Py_None;
 
2813
}
 
2814
 
 
2815
static PyObject *
 
2816
_wrap_champlain_tile_set_filename(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2817
{
 
2818
    static char *kwlist[] = { "filename", NULL };
 
2819
    char *filename;
 
2820
 
 
2821
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainTile.set_filename", kwlist, &filename))
 
2822
        return NULL;
 
2823
    
 
2824
    champlain_tile_set_filename(CHAMPLAIN_TILE(self->obj), filename);
 
2825
    
 
2826
    Py_INCREF(Py_None);
 
2827
    return Py_None;
 
2828
}
 
2829
 
 
2830
static PyObject *
 
2831
_wrap_champlain_tile_set_content(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2832
{
 
2833
    static char *kwlist[] = { "actor", "fade_in", NULL };
 
2834
    PyGObject *actor;
 
2835
    int fade_in;
 
2836
 
 
2837
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!i:ChamplainTile.set_content", kwlist, &PyClutterActor_Type, &actor, &fade_in))
 
2838
        return NULL;
 
2839
    
 
2840
    champlain_tile_set_content(CHAMPLAIN_TILE(self->obj), CLUTTER_ACTOR(actor->obj), fade_in);
 
2841
    
 
2842
    Py_INCREF(Py_None);
 
2843
    return Py_None;
 
2844
}
 
2845
 
 
2846
static PyObject *
 
2847
_wrap_champlain_tile_set_etag(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2848
{
 
2849
    static char *kwlist[] = { "etag", NULL };
 
2850
    char *etag;
 
2851
 
 
2852
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:ChamplainTile.set_etag", kwlist, &etag))
 
2853
        return NULL;
 
2854
    
 
2855
    champlain_tile_set_etag(CHAMPLAIN_TILE(self->obj), etag);
 
2856
    
 
2857
    Py_INCREF(Py_None);
 
2858
    return Py_None;
 
2859
}
 
2860
 
 
2861
#line 189 "pychamplain.override"
 
2862
static PyObject *
 
2863
_wrap_champlain_tile_set_modified_time(PyGObject *self, PyObject *args, PyObject *kwargs) 
 
2864
{
 
2865
    static char *kwlist[] = {"modified_time", NULL};
 
2866
    double pymodified_time = 0.0;
 
2867
    GTimeVal modified_time = {0,};
 
2868
 
 
2869
    if (!PyArg_ParseTupleAndKeywords(
 
2870
            args, kwargs, "d:ChamplainTile.set_modified_time",
 
2871
            kwlist, &pymodified_time))
 
2872
        return NULL;
 
2873
 
 
2874
    if (pymodified_time < 0.0) {
 
2875
        PyErr_SetString(PyExc_ValueError, "modified_time must be >= 0.0");
 
2876
        return NULL;
 
2877
    }
 
2878
 
 
2879
    if (pymodified_time > 0.0) {
 
2880
        modified_time.tv_sec = (glong) pymodified_time;
 
2881
        modified_time.tv_usec = (glong)((pymodified_time - modified_time.tv_sec)
 
2882
                                    * G_USEC_PER_SEC);
 
2883
    } 
 
2884
    champlain_tile_set_modified_time(CHAMPLAIN_TILE(self->obj), &modified_time);
 
2885
 
 
2886
    Py_INCREF(Py_None);
 
2887
    return Py_None;
 
2888
}
 
2889
#line 2890 "pychamplain.c"
 
2890
 
 
2891
 
 
2892
static const PyMethodDef _PyChamplainTile_methods[] = {
 
2893
    { "get_x", (PyCFunction)_wrap_champlain_tile_get_x, METH_NOARGS,
 
2894
      NULL },
 
2895
    { "get_y", (PyCFunction)_wrap_champlain_tile_get_y, METH_NOARGS,
 
2896
      NULL },
 
2897
    { "get_zoom_level", (PyCFunction)_wrap_champlain_tile_get_zoom_level, METH_NOARGS,
 
2898
      NULL },
 
2899
    { "get_size", (PyCFunction)_wrap_champlain_tile_get_size, METH_NOARGS,
 
2900
      NULL },
 
2901
    { "get_state", (PyCFunction)_wrap_champlain_tile_get_state, METH_NOARGS,
 
2902
      NULL },
 
2903
    { "get_uri", (PyCFunction)_wrap_champlain_tile_get_uri, METH_NOARGS,
 
2904
      NULL },
 
2905
    { "get_filename", (PyCFunction)_wrap_champlain_tile_get_filename, METH_NOARGS,
 
2906
      NULL },
 
2907
    { "get_actor", (PyCFunction)_wrap_champlain_tile_get_actor, METH_NOARGS,
 
2908
      NULL },
 
2909
    { "get_content", (PyCFunction)_wrap_champlain_tile_get_content, METH_NOARGS,
 
2910
      NULL },
 
2911
    { "get_modified_time", (PyCFunction)_wrap_champlain_tile_get_modified_time, METH_VARARGS|METH_KEYWORDS,
 
2912
      NULL },
 
2913
    { "get_modified_time_string", (PyCFunction)_wrap_champlain_tile_get_modified_time_string, METH_NOARGS,
 
2914
      NULL },
 
2915
    { "get_etag", (PyCFunction)_wrap_champlain_tile_get_etag, METH_NOARGS,
 
2916
      NULL },
 
2917
    { "set_x", (PyCFunction)_wrap_champlain_tile_set_x, METH_VARARGS|METH_KEYWORDS,
 
2918
      NULL },
 
2919
    { "set_y", (PyCFunction)_wrap_champlain_tile_set_y, METH_VARARGS|METH_KEYWORDS,
 
2920
      NULL },
 
2921
    { "set_zoom_level", (PyCFunction)_wrap_champlain_tile_set_zoom_level, METH_VARARGS|METH_KEYWORDS,
 
2922
      NULL },
 
2923
    { "set_size", (PyCFunction)_wrap_champlain_tile_set_size, METH_VARARGS|METH_KEYWORDS,
 
2924
      NULL },
 
2925
    { "set_state", (PyCFunction)_wrap_champlain_tile_set_state, METH_VARARGS|METH_KEYWORDS,
 
2926
      NULL },
 
2927
    { "set_uri", (PyCFunction)_wrap_champlain_tile_set_uri, METH_VARARGS|METH_KEYWORDS,
 
2928
      NULL },
 
2929
    { "set_filename", (PyCFunction)_wrap_champlain_tile_set_filename, METH_VARARGS|METH_KEYWORDS,
 
2930
      NULL },
 
2931
    { "set_content", (PyCFunction)_wrap_champlain_tile_set_content, METH_VARARGS|METH_KEYWORDS,
 
2932
      NULL },
 
2933
    { "set_etag", (PyCFunction)_wrap_champlain_tile_set_etag, METH_VARARGS|METH_KEYWORDS,
 
2934
      NULL },
 
2935
    { "set_modified_time", (PyCFunction)_wrap_champlain_tile_set_modified_time, METH_VARARGS|METH_KEYWORDS,
 
2936
      NULL },
 
2937
    { NULL, NULL, 0, NULL }
 
2938
};
 
2939
 
 
2940
PyTypeObject G_GNUC_INTERNAL PyChamplainTile_Type = {
 
2941
    PyObject_HEAD_INIT(NULL)
 
2942
    0,                                 /* ob_size */
 
2943
    "champlain.Tile",                   /* tp_name */
 
2944
    sizeof(PyGObject),          /* tp_basicsize */
 
2945
    0,                                 /* tp_itemsize */
 
2946
    /* methods */
 
2947
    (destructor)0,        /* tp_dealloc */
 
2948
    (printfunc)0,                      /* tp_print */
 
2949
    (getattrfunc)0,       /* tp_getattr */
 
2950
    (setattrfunc)0,       /* tp_setattr */
 
2951
    (cmpfunc)0,           /* tp_compare */
 
2952
    (reprfunc)0,             /* tp_repr */
 
2953
    (PyNumberMethods*)0,     /* tp_as_number */
 
2954
    (PySequenceMethods*)0, /* tp_as_sequence */
 
2955
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
2956
    (hashfunc)0,             /* tp_hash */
 
2957
    (ternaryfunc)0,          /* tp_call */
 
2958
    (reprfunc)0,              /* tp_str */
 
2959
    (getattrofunc)0,     /* tp_getattro */
 
2960
    (setattrofunc)0,     /* tp_setattro */
 
2961
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
2962
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
2963
    NULL,                        /* Documentation string */
 
2964
    (traverseproc)0,     /* tp_traverse */
 
2965
    (inquiry)0,             /* tp_clear */
 
2966
    (richcmpfunc)0,   /* tp_richcompare */
 
2967
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
2968
    (getiterfunc)0,          /* tp_iter */
 
2969
    (iternextfunc)0,     /* tp_iternext */
 
2970
    (struct PyMethodDef*)_PyChamplainTile_methods, /* tp_methods */
 
2971
    (struct PyMemberDef*)0,              /* tp_members */
 
2972
    (struct PyGetSetDef*)0,  /* tp_getset */
 
2973
    NULL,                              /* tp_base */
 
2974
    NULL,                              /* tp_dict */
 
2975
    (descrgetfunc)0,    /* tp_descr_get */
 
2976
    (descrsetfunc)0,    /* tp_descr_set */
 
2977
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
2978
    (initproc)_wrap_champlain_tile_new,             /* tp_init */
 
2979
    (allocfunc)0,           /* tp_alloc */
 
2980
    (newfunc)0,               /* tp_new */
 
2981
    (freefunc)0,             /* tp_free */
 
2982
    (inquiry)0              /* tp_is_gc */
 
2983
};
 
2984
 
 
2985
 
 
2986
 
 
2987
/* ----------- ChamplainView ----------- */
 
2988
 
 
2989
static int
 
2990
_wrap_champlain_view_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
2991
{
 
2992
    static char* kwlist[] = { NULL };
 
2993
 
 
2994
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
2995
                                     ":champlain.View.__init__",
 
2996
                                     kwlist))
 
2997
        return -1;
 
2998
 
 
2999
    pygobject_constructv(self, 0, NULL);
 
3000
    if (!self->obj) {
 
3001
        PyErr_SetString(
 
3002
            PyExc_RuntimeError, 
 
3003
            "could not create champlain.View object");
 
3004
        return -1;
 
3005
    }
 
3006
    return 0;
 
3007
}
 
3008
 
 
3009
static PyObject *
 
3010
_wrap_champlain_view_center_on(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3011
{
 
3012
    static char *kwlist[] = { "latitude", "longitude", NULL };
 
3013
    double latitude, longitude;
 
3014
 
 
3015
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"dd:ChamplainView.center_on", kwlist, &latitude, &longitude))
 
3016
        return NULL;
 
3017
    
 
3018
    champlain_view_center_on(CHAMPLAIN_VIEW(self->obj), latitude, longitude);
 
3019
    
 
3020
    Py_INCREF(Py_None);
 
3021
    return Py_None;
 
3022
}
 
3023
 
 
3024
static PyObject *
 
3025
_wrap_champlain_view_go_to(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3026
{
 
3027
    static char *kwlist[] = { "latitude", "longitude", NULL };
 
3028
    double latitude, longitude;
 
3029
 
 
3030
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"dd:ChamplainView.go_to", kwlist, &latitude, &longitude))
 
3031
        return NULL;
 
3032
    
 
3033
    champlain_view_go_to(CHAMPLAIN_VIEW(self->obj), latitude, longitude);
 
3034
    
 
3035
    Py_INCREF(Py_None);
 
3036
    return Py_None;
 
3037
}
 
3038
 
 
3039
static PyObject *
 
3040
_wrap_champlain_view_stop_go_to(PyGObject *self)
 
3041
{
 
3042
    
 
3043
    champlain_view_stop_go_to(CHAMPLAIN_VIEW(self->obj));
 
3044
    
 
3045
    Py_INCREF(Py_None);
 
3046
    return Py_None;
 
3047
}
 
3048
 
 
3049
static PyObject *
 
3050
_wrap_champlain_view_zoom_in(PyGObject *self)
 
3051
{
 
3052
    
 
3053
    champlain_view_zoom_in(CHAMPLAIN_VIEW(self->obj));
 
3054
    
 
3055
    Py_INCREF(Py_None);
 
3056
    return Py_None;
 
3057
}
 
3058
 
 
3059
static PyObject *
 
3060
_wrap_champlain_view_zoom_out(PyGObject *self)
 
3061
{
 
3062
    
 
3063
    champlain_view_zoom_out(CHAMPLAIN_VIEW(self->obj));
 
3064
    
 
3065
    Py_INCREF(Py_None);
 
3066
    return Py_None;
 
3067
}
 
3068
 
 
3069
static PyObject *
 
3070
_wrap_champlain_view_set_zoom_level(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3071
{
 
3072
    static char *kwlist[] = { "zoom_level", NULL };
 
3073
    int zoom_level;
 
3074
 
 
3075
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainView.set_zoom_level", kwlist, &zoom_level))
 
3076
        return NULL;
 
3077
    
 
3078
    champlain_view_set_zoom_level(CHAMPLAIN_VIEW(self->obj), zoom_level);
 
3079
    
 
3080
    Py_INCREF(Py_None);
 
3081
    return Py_None;
 
3082
}
 
3083
 
 
3084
static PyObject *
 
3085
_wrap_champlain_view_set_min_zoom_level(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3086
{
 
3087
    static char *kwlist[] = { "zoom_level", NULL };
 
3088
    int zoom_level;
 
3089
 
 
3090
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainView.set_min_zoom_level", kwlist, &zoom_level))
 
3091
        return NULL;
 
3092
    
 
3093
    champlain_view_set_min_zoom_level(CHAMPLAIN_VIEW(self->obj), zoom_level);
 
3094
    
 
3095
    Py_INCREF(Py_None);
 
3096
    return Py_None;
 
3097
}
 
3098
 
 
3099
static PyObject *
 
3100
_wrap_champlain_view_set_max_zoom_level(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3101
{
 
3102
    static char *kwlist[] = { "zoom_level", NULL };
 
3103
    int zoom_level;
 
3104
 
 
3105
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainView.set_max_zoom_level", kwlist, &zoom_level))
 
3106
        return NULL;
 
3107
    
 
3108
    champlain_view_set_max_zoom_level(CHAMPLAIN_VIEW(self->obj), zoom_level);
 
3109
    
 
3110
    Py_INCREF(Py_None);
 
3111
    return Py_None;
 
3112
}
 
3113
 
 
3114
static PyObject *
 
3115
_wrap_champlain_view_ensure_visible(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3116
{
 
3117
    static char *kwlist[] = { "lat1", "lon1", "lat2", "lon2", "animate", NULL };
 
3118
    int animate;
 
3119
    double lat1, lon1, lat2, lon2;
 
3120
 
 
3121
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ddddi:ChamplainView.ensure_visible", kwlist, &lat1, &lon1, &lat2, &lon2, &animate))
 
3122
        return NULL;
 
3123
    
 
3124
    champlain_view_ensure_visible(CHAMPLAIN_VIEW(self->obj), lat1, lon1, lat2, lon2, animate);
 
3125
    
 
3126
    Py_INCREF(Py_None);
 
3127
    return Py_None;
 
3128
}
 
3129
 
 
3130
#line 152 "pychamplain.override"
 
3131
static PyObject *
 
3132
_wrap_champlain_view_ensure_markers_visible(PyGObject *self, PyObject *args) 
 
3133
{
 
3134
    PyObject *pymarkers, *pyanimate=0;
 
3135
    gboolean animate = 1; 
 
3136
    long i = 0;
 
3137
    ChamplainBaseMarker **markers = NULL;
 
3138
 
 
3139
    if (!PyArg_ParseTuple(args, "O|O:ChamplainView.ensure_markers_visible", 
 
3140
        &pymarkers, &pyanimate)){
 
3141
        return NULL;
 
3142
    }
 
3143
 
 
3144
    if (!PySequence_Check(pymarkers)){
 
3145
        PyErr_SetString(PyExc_TypeError, "must be called with a list of markers as first argument");
 
3146
        return NULL;
 
3147
    }
 
3148
 
 
3149
    if (pyanimate){
 
3150
        if (!PyObject_IsTrue(pyanimate))
 
3151
            animate = 0;
 
3152
    }
 
3153
 
 
3154
    markers = g_new0(ChamplainBaseMarker*, PyList_Size(pymarkers)+2);
 
3155
    for (i=0; i < PyList_Size(pymarkers); i++){
 
3156
        ChamplainBaseMarker *marker = pyg_boxed_get(PyList_GetItem(pymarkers, i), ChamplainBaseMarker);
 
3157
        markers[i] = marker;
 
3158
    }
 
3159
 
 
3160
    champlain_view_ensure_markers_visible(CHAMPLAIN_VIEW(self->obj), markers, animate);
 
3161
    g_free(markers);
 
3162
 
 
3163
    Py_INCREF(Py_None);
 
3164
    return Py_None;
 
3165
}
 
3166
#line 3167 "pychamplain.c"
 
3167
 
 
3168
 
 
3169
static PyObject *
 
3170
_wrap_champlain_view_set_map_source(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3171
{
 
3172
    static char *kwlist[] = { "map_source", NULL };
 
3173
    PyGObject *map_source;
 
3174
 
 
3175
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainView.set_map_source", kwlist, &PyChamplainMapSource_Type, &map_source))
 
3176
        return NULL;
 
3177
    
 
3178
    champlain_view_set_map_source(CHAMPLAIN_VIEW(self->obj), CHAMPLAIN_MAP_SOURCE(map_source->obj));
 
3179
    
 
3180
    Py_INCREF(Py_None);
 
3181
    return Py_None;
 
3182
}
 
3183
 
 
3184
static PyObject *
 
3185
_wrap_champlain_view_set_size(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3186
{
 
3187
    static char *kwlist[] = { "width", "height", NULL };
 
3188
    PyObject *py_width = NULL, *py_height = NULL;
 
3189
    guint width = 0, height = 0;
 
3190
 
 
3191
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"OO:ChamplainView.set_size", kwlist, &py_width, &py_height))
 
3192
        return NULL;
 
3193
    if (py_width) {
 
3194
        if (PyLong_Check(py_width))
 
3195
            width = PyLong_AsUnsignedLong(py_width);
 
3196
        else if (PyInt_Check(py_width))
 
3197
            width = PyInt_AsLong(py_width);
 
3198
        else
 
3199
            PyErr_SetString(PyExc_TypeError, "Parameter 'width' must be an int or a long");
 
3200
        if (PyErr_Occurred())
 
3201
            return NULL;
 
3202
    }
 
3203
    if (py_height) {
 
3204
        if (PyLong_Check(py_height))
 
3205
            height = PyLong_AsUnsignedLong(py_height);
 
3206
        else if (PyInt_Check(py_height))
 
3207
            height = PyInt_AsLong(py_height);
 
3208
        else
 
3209
            PyErr_SetString(PyExc_TypeError, "Parameter 'height' must be an int or a long");
 
3210
        if (PyErr_Occurred())
 
3211
            return NULL;
 
3212
    }
 
3213
    
 
3214
    champlain_view_set_size(CHAMPLAIN_VIEW(self->obj), width, height);
 
3215
    
 
3216
    Py_INCREF(Py_None);
 
3217
    return Py_None;
 
3218
}
 
3219
 
 
3220
static PyObject *
 
3221
_wrap_champlain_view_set_decel_rate(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3222
{
 
3223
    static char *kwlist[] = { "rate", NULL };
 
3224
    double rate;
 
3225
 
 
3226
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"d:ChamplainView.set_decel_rate", kwlist, &rate))
 
3227
        return NULL;
 
3228
    
 
3229
    champlain_view_set_decel_rate(CHAMPLAIN_VIEW(self->obj), rate);
 
3230
    
 
3231
    Py_INCREF(Py_None);
 
3232
    return Py_None;
 
3233
}
 
3234
 
 
3235
static PyObject *
 
3236
_wrap_champlain_view_set_scroll_mode(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3237
{
 
3238
    static char *kwlist[] = { "mode", NULL };
 
3239
    ChamplainScrollMode mode;
 
3240
    PyObject *py_mode = NULL;
 
3241
 
 
3242
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainView.set_scroll_mode", kwlist, &py_mode))
 
3243
        return NULL;
 
3244
    if (pyg_enum_get_value(CHAMPLAIN_TYPE_SCROLL_MODE, py_mode, (gpointer)&mode))
 
3245
        return NULL;
 
3246
    
 
3247
    champlain_view_set_scroll_mode(CHAMPLAIN_VIEW(self->obj), mode);
 
3248
    
 
3249
    Py_INCREF(Py_None);
 
3250
    return Py_None;
 
3251
}
 
3252
 
 
3253
static PyObject *
 
3254
_wrap_champlain_view_set_keep_center_on_resize(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3255
{
 
3256
    static char *kwlist[] = { "value", NULL };
 
3257
    int value;
 
3258
 
 
3259
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainView.set_keep_center_on_resize", kwlist, &value))
 
3260
        return NULL;
 
3261
    
 
3262
    champlain_view_set_keep_center_on_resize(CHAMPLAIN_VIEW(self->obj), value);
 
3263
    
 
3264
    Py_INCREF(Py_None);
 
3265
    return Py_None;
 
3266
}
 
3267
 
 
3268
static PyObject *
 
3269
_wrap_champlain_view_set_show_license(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3270
{
 
3271
    static char *kwlist[] = { "value", NULL };
 
3272
    int value;
 
3273
 
 
3274
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainView.set_show_license", kwlist, &value))
 
3275
        return NULL;
 
3276
    
 
3277
    champlain_view_set_show_license(CHAMPLAIN_VIEW(self->obj), value);
 
3278
    
 
3279
    Py_INCREF(Py_None);
 
3280
    return Py_None;
 
3281
}
 
3282
 
 
3283
static PyObject *
 
3284
_wrap_champlain_view_set_zoom_on_double_click(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3285
{
 
3286
    static char *kwlist[] = { "value", NULL };
 
3287
    int value;
 
3288
 
 
3289
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainView.set_zoom_on_double_click", kwlist, &value))
 
3290
        return NULL;
 
3291
    
 
3292
    champlain_view_set_zoom_on_double_click(CHAMPLAIN_VIEW(self->obj), value);
 
3293
    
 
3294
    Py_INCREF(Py_None);
 
3295
    return Py_None;
 
3296
}
 
3297
 
 
3298
static PyObject *
 
3299
_wrap_champlain_view_add_layer(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3300
{
 
3301
    static char *kwlist[] = { "layer", NULL };
 
3302
    PyGObject *layer;
 
3303
 
 
3304
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainView.add_layer", kwlist, &PyChamplainLayer_Type, &layer))
 
3305
        return NULL;
 
3306
    
 
3307
    champlain_view_add_layer(CHAMPLAIN_VIEW(self->obj), CHAMPLAIN_LAYER(layer->obj));
 
3308
    
 
3309
    Py_INCREF(Py_None);
 
3310
    return Py_None;
 
3311
}
 
3312
 
 
3313
#line 115 "pychamplain.override"
 
3314
static PyObject *
 
3315
_wrap_champlain_view_get_coords_from_event(PyGObject *self, PyObject *args, PyObject *kargs) 
 
3316
{
 
3317
    static char *kwlist[] = {"event", NULL};
 
3318
    gdouble lat, lon;
 
3319
    PyObject *pyevent;
 
3320
    ClutterEvent *event;
 
3321
 
 
3322
    if (!PyArg_ParseTupleAndKeywords(args, kargs, "O:ChamplainView.get_coords_from_event", kwlist, &pyevent))
 
3323
        return NULL;
 
3324
 
 
3325
    if (pyg_boxed_check(pyevent, CLUTTER_TYPE_EVENT))
 
3326
        event = pyg_boxed_get(pyevent, ClutterEvent);
 
3327
    else {
 
3328
        PyErr_SetString(PyExc_TypeError, "event must be a ClutterEvent");
 
3329
        return NULL;
 
3330
    }
 
3331
 
 
3332
    champlain_view_get_coords_from_event(CHAMPLAIN_VIEW(self->obj), event, &lat, &lon);
 
3333
    return Py_BuildValue("(dd)", lat, lon);
 
3334
}
 
3335
#line 3336 "pychamplain.c"
 
3336
 
 
3337
 
 
3338
#line 138 "pychamplain.override"
 
3339
static PyObject *
 
3340
_wrap_champlain_view_get_coords_at(PyGObject *self, PyObject *args) 
 
3341
{
 
3342
    guint x, y;
 
3343
    gdouble lat, lon;
 
3344
 
 
3345
    if (!PyArg_ParseTuple(args, "ii:ChamplainView.get_coords_at", &x, &y))
 
3346
        return NULL;
 
3347
 
 
3348
    champlain_view_get_coords_at(CHAMPLAIN_VIEW(self->obj), x, y, &lat, &lon);
 
3349
    return Py_BuildValue("(dd)", lat, lon);
 
3350
}
 
3351
#line 3352 "pychamplain.c"
 
3352
 
 
3353
 
 
3354
static PyObject *
 
3355
_wrap_champlain_view_get_zoom_level(PyGObject *self)
 
3356
{
 
3357
    int ret;
 
3358
 
 
3359
    
 
3360
    ret = champlain_view_get_zoom_level(CHAMPLAIN_VIEW(self->obj));
 
3361
    
 
3362
    return PyInt_FromLong(ret);
 
3363
}
 
3364
 
 
3365
static PyObject *
 
3366
_wrap_champlain_view_get_min_zoom_level(PyGObject *self)
 
3367
{
 
3368
    int ret;
 
3369
 
 
3370
    
 
3371
    ret = champlain_view_get_min_zoom_level(CHAMPLAIN_VIEW(self->obj));
 
3372
    
 
3373
    return PyInt_FromLong(ret);
 
3374
}
 
3375
 
 
3376
static PyObject *
 
3377
_wrap_champlain_view_get_max_zoom_level(PyGObject *self)
 
3378
{
 
3379
    int ret;
 
3380
 
 
3381
    
 
3382
    ret = champlain_view_get_max_zoom_level(CHAMPLAIN_VIEW(self->obj));
 
3383
    
 
3384
    return PyInt_FromLong(ret);
 
3385
}
 
3386
 
 
3387
static PyObject *
 
3388
_wrap_champlain_view_get_map_source(PyGObject *self)
 
3389
{
 
3390
    ChamplainMapSource *ret;
 
3391
 
 
3392
    
 
3393
    ret = champlain_view_get_map_source(CHAMPLAIN_VIEW(self->obj));
 
3394
    
 
3395
    /* pygobject_new handles NULL checking */
 
3396
    return pygobject_new((GObject *)ret);
 
3397
}
 
3398
 
 
3399
static PyObject *
 
3400
_wrap_champlain_view_get_decel_rate(PyGObject *self)
 
3401
{
 
3402
    double ret;
 
3403
 
 
3404
    
 
3405
    ret = champlain_view_get_decel_rate(CHAMPLAIN_VIEW(self->obj));
 
3406
    
 
3407
    return PyFloat_FromDouble(ret);
 
3408
}
 
3409
 
 
3410
static PyObject *
 
3411
_wrap_champlain_view_get_scroll_mode(PyGObject *self)
 
3412
{
 
3413
    gint ret;
 
3414
 
 
3415
    
 
3416
    ret = champlain_view_get_scroll_mode(CHAMPLAIN_VIEW(self->obj));
 
3417
    
 
3418
    return pyg_enum_from_gtype(CHAMPLAIN_TYPE_SCROLL_MODE, ret);
 
3419
}
 
3420
 
 
3421
static PyObject *
 
3422
_wrap_champlain_view_get_keep_center_on_resize(PyGObject *self)
 
3423
{
 
3424
    int ret;
 
3425
 
 
3426
    
 
3427
    ret = champlain_view_get_keep_center_on_resize(CHAMPLAIN_VIEW(self->obj));
 
3428
    
 
3429
    return PyBool_FromLong(ret);
 
3430
 
 
3431
}
 
3432
 
 
3433
static PyObject *
 
3434
_wrap_champlain_view_get_show_license(PyGObject *self)
 
3435
{
 
3436
    int ret;
 
3437
 
 
3438
    
 
3439
    ret = champlain_view_get_show_license(CHAMPLAIN_VIEW(self->obj));
 
3440
    
 
3441
    return PyBool_FromLong(ret);
 
3442
 
 
3443
}
 
3444
 
 
3445
static PyObject *
 
3446
_wrap_champlain_view_get_zoom_on_double_click(PyGObject *self)
 
3447
{
 
3448
    int ret;
 
3449
 
 
3450
    
 
3451
    ret = champlain_view_get_zoom_on_double_click(CHAMPLAIN_VIEW(self->obj));
 
3452
    
 
3453
    return PyBool_FromLong(ret);
 
3454
 
 
3455
}
 
3456
 
 
3457
static PyObject *
 
3458
_wrap_champlain_view_add_polygon(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3459
{
 
3460
    static char *kwlist[] = { "polygon", NULL };
 
3461
    PyGObject *polygon;
 
3462
 
 
3463
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainView.add_polygon", kwlist, &PyChamplainPolygon_Type, &polygon))
 
3464
        return NULL;
 
3465
    
 
3466
    champlain_view_add_polygon(CHAMPLAIN_VIEW(self->obj), CHAMPLAIN_POLYGON(polygon->obj));
 
3467
    
 
3468
    Py_INCREF(Py_None);
 
3469
    return Py_None;
 
3470
}
 
3471
 
 
3472
static PyObject *
 
3473
_wrap_champlain_view_remove_polygon(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3474
{
 
3475
    static char *kwlist[] = { "polygon", NULL };
 
3476
    PyGObject *polygon;
 
3477
 
 
3478
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainView.remove_polygon", kwlist, &PyChamplainPolygon_Type, &polygon))
 
3479
        return NULL;
 
3480
    
 
3481
    champlain_view_remove_polygon(CHAMPLAIN_VIEW(self->obj), CHAMPLAIN_POLYGON(polygon->obj));
 
3482
    
 
3483
    Py_INCREF(Py_None);
 
3484
    return Py_None;
 
3485
}
 
3486
 
 
3487
static const PyMethodDef _PyChamplainView_methods[] = {
 
3488
    { "center_on", (PyCFunction)_wrap_champlain_view_center_on, METH_VARARGS|METH_KEYWORDS,
 
3489
      NULL },
 
3490
    { "go_to", (PyCFunction)_wrap_champlain_view_go_to, METH_VARARGS|METH_KEYWORDS,
 
3491
      NULL },
 
3492
    { "stop_go_to", (PyCFunction)_wrap_champlain_view_stop_go_to, METH_NOARGS,
 
3493
      NULL },
 
3494
    { "zoom_in", (PyCFunction)_wrap_champlain_view_zoom_in, METH_NOARGS,
 
3495
      NULL },
 
3496
    { "zoom_out", (PyCFunction)_wrap_champlain_view_zoom_out, METH_NOARGS,
 
3497
      NULL },
 
3498
    { "set_zoom_level", (PyCFunction)_wrap_champlain_view_set_zoom_level, METH_VARARGS|METH_KEYWORDS,
 
3499
      NULL },
 
3500
    { "set_min_zoom_level", (PyCFunction)_wrap_champlain_view_set_min_zoom_level, METH_VARARGS|METH_KEYWORDS,
 
3501
      NULL },
 
3502
    { "set_max_zoom_level", (PyCFunction)_wrap_champlain_view_set_max_zoom_level, METH_VARARGS|METH_KEYWORDS,
 
3503
      NULL },
 
3504
    { "ensure_visible", (PyCFunction)_wrap_champlain_view_ensure_visible, METH_VARARGS|METH_KEYWORDS,
 
3505
      NULL },
 
3506
    { "ensure_markers_visible", (PyCFunction)_wrap_champlain_view_ensure_markers_visible, METH_VARARGS|METH_KEYWORDS,
 
3507
      NULL },
 
3508
    { "set_map_source", (PyCFunction)_wrap_champlain_view_set_map_source, METH_VARARGS|METH_KEYWORDS,
 
3509
      NULL },
 
3510
    { "set_size", (PyCFunction)_wrap_champlain_view_set_size, METH_VARARGS|METH_KEYWORDS,
 
3511
      NULL },
 
3512
    { "set_decel_rate", (PyCFunction)_wrap_champlain_view_set_decel_rate, METH_VARARGS|METH_KEYWORDS,
 
3513
      NULL },
 
3514
    { "set_scroll_mode", (PyCFunction)_wrap_champlain_view_set_scroll_mode, METH_VARARGS|METH_KEYWORDS,
 
3515
      NULL },
 
3516
    { "set_keep_center_on_resize", (PyCFunction)_wrap_champlain_view_set_keep_center_on_resize, METH_VARARGS|METH_KEYWORDS,
 
3517
      NULL },
 
3518
    { "set_show_license", (PyCFunction)_wrap_champlain_view_set_show_license, METH_VARARGS|METH_KEYWORDS,
 
3519
      NULL },
 
3520
    { "set_zoom_on_double_click", (PyCFunction)_wrap_champlain_view_set_zoom_on_double_click, METH_VARARGS|METH_KEYWORDS,
 
3521
      NULL },
 
3522
    { "add_layer", (PyCFunction)_wrap_champlain_view_add_layer, METH_VARARGS|METH_KEYWORDS,
 
3523
      NULL },
 
3524
    { "get_coords_from_event", (PyCFunction)_wrap_champlain_view_get_coords_from_event, METH_VARARGS|METH_KEYWORDS,
 
3525
      NULL },
 
3526
    { "get_coords_at", (PyCFunction)_wrap_champlain_view_get_coords_at, METH_VARARGS|METH_KEYWORDS,
 
3527
      NULL },
 
3528
    { "get_zoom_level", (PyCFunction)_wrap_champlain_view_get_zoom_level, METH_NOARGS,
 
3529
      NULL },
 
3530
    { "get_min_zoom_level", (PyCFunction)_wrap_champlain_view_get_min_zoom_level, METH_NOARGS,
 
3531
      NULL },
 
3532
    { "get_max_zoom_level", (PyCFunction)_wrap_champlain_view_get_max_zoom_level, METH_NOARGS,
 
3533
      NULL },
 
3534
    { "get_map_source", (PyCFunction)_wrap_champlain_view_get_map_source, METH_NOARGS,
 
3535
      NULL },
 
3536
    { "get_decel_rate", (PyCFunction)_wrap_champlain_view_get_decel_rate, METH_NOARGS,
 
3537
      NULL },
 
3538
    { "get_scroll_mode", (PyCFunction)_wrap_champlain_view_get_scroll_mode, METH_NOARGS,
 
3539
      NULL },
 
3540
    { "get_keep_center_on_resize", (PyCFunction)_wrap_champlain_view_get_keep_center_on_resize, METH_NOARGS,
 
3541
      NULL },
 
3542
    { "get_show_license", (PyCFunction)_wrap_champlain_view_get_show_license, METH_NOARGS,
 
3543
      NULL },
 
3544
    { "get_zoom_on_double_click", (PyCFunction)_wrap_champlain_view_get_zoom_on_double_click, METH_NOARGS,
 
3545
      NULL },
 
3546
    { "add_polygon", (PyCFunction)_wrap_champlain_view_add_polygon, METH_VARARGS|METH_KEYWORDS,
 
3547
      NULL },
 
3548
    { "remove_polygon", (PyCFunction)_wrap_champlain_view_remove_polygon, METH_VARARGS|METH_KEYWORDS,
 
3549
      NULL },
 
3550
    { NULL, NULL, 0, NULL }
 
3551
};
 
3552
 
 
3553
PyTypeObject G_GNUC_INTERNAL PyChamplainView_Type = {
 
3554
    PyObject_HEAD_INIT(NULL)
 
3555
    0,                                 /* ob_size */
 
3556
    "champlain.View",                   /* tp_name */
 
3557
    sizeof(PyGObject),          /* tp_basicsize */
 
3558
    0,                                 /* tp_itemsize */
 
3559
    /* methods */
 
3560
    (destructor)0,        /* tp_dealloc */
 
3561
    (printfunc)0,                      /* tp_print */
 
3562
    (getattrfunc)0,       /* tp_getattr */
 
3563
    (setattrfunc)0,       /* tp_setattr */
 
3564
    (cmpfunc)0,           /* tp_compare */
 
3565
    (reprfunc)0,             /* tp_repr */
 
3566
    (PyNumberMethods*)0,     /* tp_as_number */
 
3567
    (PySequenceMethods*)0, /* tp_as_sequence */
 
3568
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
3569
    (hashfunc)0,             /* tp_hash */
 
3570
    (ternaryfunc)0,          /* tp_call */
 
3571
    (reprfunc)0,              /* tp_str */
 
3572
    (getattrofunc)0,     /* tp_getattro */
 
3573
    (setattrofunc)0,     /* tp_setattro */
 
3574
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
3575
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
3576
    NULL,                        /* Documentation string */
 
3577
    (traverseproc)0,     /* tp_traverse */
 
3578
    (inquiry)0,             /* tp_clear */
 
3579
    (richcmpfunc)0,   /* tp_richcompare */
 
3580
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
3581
    (getiterfunc)0,          /* tp_iter */
 
3582
    (iternextfunc)0,     /* tp_iternext */
 
3583
    (struct PyMethodDef*)_PyChamplainView_methods, /* tp_methods */
 
3584
    (struct PyMemberDef*)0,              /* tp_members */
 
3585
    (struct PyGetSetDef*)0,  /* tp_getset */
 
3586
    NULL,                              /* tp_base */
 
3587
    NULL,                              /* tp_dict */
 
3588
    (descrgetfunc)0,    /* tp_descr_get */
 
3589
    (descrsetfunc)0,    /* tp_descr_set */
 
3590
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
3591
    (initproc)_wrap_champlain_view_new,             /* tp_init */
 
3592
    (allocfunc)0,           /* tp_alloc */
 
3593
    (newfunc)0,               /* tp_new */
 
3594
    (freefunc)0,             /* tp_free */
 
3595
    (inquiry)0              /* tp_is_gc */
 
3596
};
 
3597
 
 
3598
 
 
3599
 
 
3600
/* ----------- ChamplainZoomLevel ----------- */
 
3601
 
 
3602
static int
 
3603
_wrap_champlain_zoom_level_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3604
{
 
3605
    static char* kwlist[] = { NULL };
 
3606
 
 
3607
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
 
3608
                                     ":champlain.ZoomLevel.__init__",
 
3609
                                     kwlist))
 
3610
        return -1;
 
3611
 
 
3612
    pygobject_constructv(self, 0, NULL);
 
3613
    if (!self->obj) {
 
3614
        PyErr_SetString(
 
3615
            PyExc_RuntimeError, 
 
3616
            "could not create champlain.ZoomLevel object");
 
3617
        return -1;
 
3618
    }
 
3619
    return 0;
 
3620
}
 
3621
 
 
3622
static PyObject *
 
3623
_wrap_champlain_zoom_level_get_width(PyGObject *self)
 
3624
{
 
3625
    guint ret;
 
3626
 
 
3627
    
 
3628
    ret = champlain_zoom_level_get_width(CHAMPLAIN_ZOOM_LEVEL(self->obj));
 
3629
    
 
3630
    return PyLong_FromUnsignedLong(ret);
 
3631
}
 
3632
 
 
3633
static PyObject *
 
3634
_wrap_champlain_zoom_level_get_height(PyGObject *self)
 
3635
{
 
3636
    guint ret;
 
3637
 
 
3638
    
 
3639
    ret = champlain_zoom_level_get_height(CHAMPLAIN_ZOOM_LEVEL(self->obj));
 
3640
    
 
3641
    return PyLong_FromUnsignedLong(ret);
 
3642
}
 
3643
 
 
3644
static PyObject *
 
3645
_wrap_champlain_zoom_level_get_zoom_level(PyGObject *self)
 
3646
{
 
3647
    int ret;
 
3648
 
 
3649
    
 
3650
    ret = champlain_zoom_level_get_zoom_level(CHAMPLAIN_ZOOM_LEVEL(self->obj));
 
3651
    
 
3652
    return PyInt_FromLong(ret);
 
3653
}
 
3654
 
 
3655
static PyObject *
 
3656
_wrap_champlain_zoom_level_get_actor(PyGObject *self)
 
3657
{
 
3658
    ClutterActor *ret;
 
3659
 
 
3660
    
 
3661
    ret = champlain_zoom_level_get_actor(CHAMPLAIN_ZOOM_LEVEL(self->obj));
 
3662
    
 
3663
    /* pygobject_new handles NULL checking */
 
3664
    return pygobject_new((GObject *)ret);
 
3665
}
 
3666
 
 
3667
static PyObject *
 
3668
_wrap_champlain_zoom_level_set_width(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3669
{
 
3670
    static char *kwlist[] = { "width", NULL };
 
3671
    PyObject *py_width = NULL;
 
3672
    guint width = 0;
 
3673
 
 
3674
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainZoomLevel.set_width", kwlist, &py_width))
 
3675
        return NULL;
 
3676
    if (py_width) {
 
3677
        if (PyLong_Check(py_width))
 
3678
            width = PyLong_AsUnsignedLong(py_width);
 
3679
        else if (PyInt_Check(py_width))
 
3680
            width = PyInt_AsLong(py_width);
 
3681
        else
 
3682
            PyErr_SetString(PyExc_TypeError, "Parameter 'width' must be an int or a long");
 
3683
        if (PyErr_Occurred())
 
3684
            return NULL;
 
3685
    }
 
3686
    
 
3687
    champlain_zoom_level_set_width(CHAMPLAIN_ZOOM_LEVEL(self->obj), width);
 
3688
    
 
3689
    Py_INCREF(Py_None);
 
3690
    return Py_None;
 
3691
}
 
3692
 
 
3693
static PyObject *
 
3694
_wrap_champlain_zoom_level_set_height(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3695
{
 
3696
    static char *kwlist[] = { "height", NULL };
 
3697
    PyObject *py_height = NULL;
 
3698
    guint height = 0;
 
3699
 
 
3700
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainZoomLevel.set_height", kwlist, &py_height))
 
3701
        return NULL;
 
3702
    if (py_height) {
 
3703
        if (PyLong_Check(py_height))
 
3704
            height = PyLong_AsUnsignedLong(py_height);
 
3705
        else if (PyInt_Check(py_height))
 
3706
            height = PyInt_AsLong(py_height);
 
3707
        else
 
3708
            PyErr_SetString(PyExc_TypeError, "Parameter 'height' must be an int or a long");
 
3709
        if (PyErr_Occurred())
 
3710
            return NULL;
 
3711
    }
 
3712
    
 
3713
    champlain_zoom_level_set_height(CHAMPLAIN_ZOOM_LEVEL(self->obj), height);
 
3714
    
 
3715
    Py_INCREF(Py_None);
 
3716
    return Py_None;
 
3717
}
 
3718
 
 
3719
static PyObject *
 
3720
_wrap_champlain_zoom_level_set_zoom_level(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3721
{
 
3722
    static char *kwlist[] = { "zoom_level", NULL };
 
3723
    int zoom_level;
 
3724
 
 
3725
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:ChamplainZoomLevel.set_zoom_level", kwlist, &zoom_level))
 
3726
        return NULL;
 
3727
    
 
3728
    champlain_zoom_level_set_zoom_level(CHAMPLAIN_ZOOM_LEVEL(self->obj), zoom_level);
 
3729
    
 
3730
    Py_INCREF(Py_None);
 
3731
    return Py_None;
 
3732
}
 
3733
 
 
3734
static PyObject *
 
3735
_wrap_champlain_zoom_level_add_tile(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3736
{
 
3737
    static char *kwlist[] = { "tile", NULL };
 
3738
    PyGObject *tile;
 
3739
 
 
3740
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainZoomLevel.add_tile", kwlist, &PyChamplainTile_Type, &tile))
 
3741
        return NULL;
 
3742
    
 
3743
    champlain_zoom_level_add_tile(CHAMPLAIN_ZOOM_LEVEL(self->obj), CHAMPLAIN_TILE(tile->obj));
 
3744
    
 
3745
    Py_INCREF(Py_None);
 
3746
    return Py_None;
 
3747
}
 
3748
 
 
3749
static PyObject *
 
3750
_wrap_champlain_zoom_level_remove_tile(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3751
{
 
3752
    static char *kwlist[] = { "tile", NULL };
 
3753
    PyGObject *tile;
 
3754
 
 
3755
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:ChamplainZoomLevel.remove_tile", kwlist, &PyChamplainTile_Type, &tile))
 
3756
        return NULL;
 
3757
    
 
3758
    champlain_zoom_level_remove_tile(CHAMPLAIN_ZOOM_LEVEL(self->obj), CHAMPLAIN_TILE(tile->obj));
 
3759
    
 
3760
    Py_INCREF(Py_None);
 
3761
    return Py_None;
 
3762
}
 
3763
 
 
3764
static PyObject *
 
3765
_wrap_champlain_zoom_level_tile_count(PyGObject *self)
 
3766
{
 
3767
    guint ret;
 
3768
 
 
3769
    
 
3770
    ret = champlain_zoom_level_tile_count(CHAMPLAIN_ZOOM_LEVEL(self->obj));
 
3771
    
 
3772
    return PyLong_FromUnsignedLong(ret);
 
3773
}
 
3774
 
 
3775
static PyObject *
 
3776
_wrap_champlain_zoom_level_get_nth_tile(PyGObject *self, PyObject *args, PyObject *kwargs)
 
3777
{
 
3778
    static char *kwlist[] = { "index", NULL };
 
3779
    PyObject *py_index = NULL;
 
3780
    ChamplainTile *ret;
 
3781
    guint index = 0;
 
3782
 
 
3783
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:ChamplainZoomLevel.get_nth_tile", kwlist, &py_index))
 
3784
        return NULL;
 
3785
    if (py_index) {
 
3786
        if (PyLong_Check(py_index))
 
3787
            index = PyLong_AsUnsignedLong(py_index);
 
3788
        else if (PyInt_Check(py_index))
 
3789
            index = PyInt_AsLong(py_index);
 
3790
        else
 
3791
            PyErr_SetString(PyExc_TypeError, "Parameter 'index' must be an int or a long");
 
3792
        if (PyErr_Occurred())
 
3793
            return NULL;
 
3794
    }
 
3795
    
 
3796
    ret = champlain_zoom_level_get_nth_tile(CHAMPLAIN_ZOOM_LEVEL(self->obj), index);
 
3797
    
 
3798
    /* pygobject_new handles NULL checking */
 
3799
    return pygobject_new((GObject *)ret);
 
3800
}
 
3801
 
 
3802
static const PyMethodDef _PyChamplainZoomLevel_methods[] = {
 
3803
    { "get_width", (PyCFunction)_wrap_champlain_zoom_level_get_width, METH_NOARGS,
 
3804
      NULL },
 
3805
    { "get_height", (PyCFunction)_wrap_champlain_zoom_level_get_height, METH_NOARGS,
 
3806
      NULL },
 
3807
    { "get_zoom_level", (PyCFunction)_wrap_champlain_zoom_level_get_zoom_level, METH_NOARGS,
 
3808
      NULL },
 
3809
    { "get_actor", (PyCFunction)_wrap_champlain_zoom_level_get_actor, METH_NOARGS,
 
3810
      NULL },
 
3811
    { "set_width", (PyCFunction)_wrap_champlain_zoom_level_set_width, METH_VARARGS|METH_KEYWORDS,
 
3812
      NULL },
 
3813
    { "set_height", (PyCFunction)_wrap_champlain_zoom_level_set_height, METH_VARARGS|METH_KEYWORDS,
 
3814
      NULL },
 
3815
    { "set_zoom_level", (PyCFunction)_wrap_champlain_zoom_level_set_zoom_level, METH_VARARGS|METH_KEYWORDS,
 
3816
      NULL },
 
3817
    { "add_tile", (PyCFunction)_wrap_champlain_zoom_level_add_tile, METH_VARARGS|METH_KEYWORDS,
 
3818
      NULL },
 
3819
    { "remove_tile", (PyCFunction)_wrap_champlain_zoom_level_remove_tile, METH_VARARGS|METH_KEYWORDS,
 
3820
      NULL },
 
3821
    { "tile_count", (PyCFunction)_wrap_champlain_zoom_level_tile_count, METH_NOARGS,
 
3822
      NULL },
 
3823
    { "get_nth_tile", (PyCFunction)_wrap_champlain_zoom_level_get_nth_tile, METH_VARARGS|METH_KEYWORDS,
 
3824
      NULL },
 
3825
    { NULL, NULL, 0, NULL }
 
3826
};
 
3827
 
 
3828
PyTypeObject G_GNUC_INTERNAL PyChamplainZoomLevel_Type = {
 
3829
    PyObject_HEAD_INIT(NULL)
 
3830
    0,                                 /* ob_size */
 
3831
    "champlain.ZoomLevel",                   /* tp_name */
 
3832
    sizeof(PyGObject),          /* tp_basicsize */
 
3833
    0,                                 /* tp_itemsize */
 
3834
    /* methods */
 
3835
    (destructor)0,        /* tp_dealloc */
 
3836
    (printfunc)0,                      /* tp_print */
 
3837
    (getattrfunc)0,       /* tp_getattr */
 
3838
    (setattrfunc)0,       /* tp_setattr */
 
3839
    (cmpfunc)0,           /* tp_compare */
 
3840
    (reprfunc)0,             /* tp_repr */
 
3841
    (PyNumberMethods*)0,     /* tp_as_number */
 
3842
    (PySequenceMethods*)0, /* tp_as_sequence */
 
3843
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
3844
    (hashfunc)0,             /* tp_hash */
 
3845
    (ternaryfunc)0,          /* tp_call */
 
3846
    (reprfunc)0,              /* tp_str */
 
3847
    (getattrofunc)0,     /* tp_getattro */
 
3848
    (setattrofunc)0,     /* tp_setattro */
 
3849
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
3850
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
3851
    NULL,                        /* Documentation string */
 
3852
    (traverseproc)0,     /* tp_traverse */
 
3853
    (inquiry)0,             /* tp_clear */
 
3854
    (richcmpfunc)0,   /* tp_richcompare */
 
3855
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
3856
    (getiterfunc)0,          /* tp_iter */
 
3857
    (iternextfunc)0,     /* tp_iternext */
 
3858
    (struct PyMethodDef*)_PyChamplainZoomLevel_methods, /* tp_methods */
 
3859
    (struct PyMemberDef*)0,              /* tp_members */
 
3860
    (struct PyGetSetDef*)0,  /* tp_getset */
 
3861
    NULL,                              /* tp_base */
 
3862
    NULL,                              /* tp_dict */
 
3863
    (descrgetfunc)0,    /* tp_descr_get */
 
3864
    (descrsetfunc)0,    /* tp_descr_set */
 
3865
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
3866
    (initproc)_wrap_champlain_zoom_level_new,             /* tp_init */
 
3867
    (allocfunc)0,           /* tp_alloc */
 
3868
    (newfunc)0,               /* tp_new */
 
3869
    (freefunc)0,             /* tp_free */
 
3870
    (inquiry)0              /* tp_is_gc */
 
3871
};
 
3872
 
 
3873
 
 
3874
 
 
3875
/* ----------- functions ----------- */
 
3876
 
 
3877
static PyObject *
 
3878
_wrap_champlain_cache_dup_default(PyObject *self)
 
3879
{
 
3880
    ChamplainCache *ret;
 
3881
 
 
3882
    
 
3883
    ret = champlain_cache_dup_default();
 
3884
    
 
3885
    /* pygobject_new handles NULL checking */
 
3886
    return pygobject_new((GObject *)ret);
 
3887
}
 
3888
 
 
3889
static PyObject *
 
3890
_wrap_champlain_map_source_factory_dup_default(PyObject *self)
 
3891
{
 
3892
    ChamplainMapSourceFactory *ret;
 
3893
 
 
3894
    
 
3895
    ret = champlain_map_source_factory_dup_default();
 
3896
    
 
3897
    /* pygobject_new handles NULL checking */
 
3898
    return pygobject_new((GObject *)ret);
 
3899
}
 
3900
 
 
3901
static PyObject *
 
3902
_wrap_champlain_network_map_source_new_full(PyObject *self, PyObject *args, PyObject *kwargs)
 
3903
{
 
3904
    static char *kwlist[] = { "id", "name", "license", "license_uri", "min_zoom", "max_zoom", "tile_size", "projection", "uri_format", NULL };
 
3905
    char *id, *name, *license, *license_uri, *uri_format;
 
3906
    PyObject *py_min_zoom = NULL, *py_max_zoom = NULL, *py_tile_size = NULL, *py_projection = NULL;
 
3907
    ChamplainNetworkMapSource *ret;
 
3908
    ChamplainMapProjection projection;
 
3909
    guint min_zoom = 0, max_zoom = 0, tile_size = 0;
 
3910
 
 
3911
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ssssOOOOs:network_map_source_new_full", kwlist, &id, &name, &license, &license_uri, &py_min_zoom, &py_max_zoom, &py_tile_size, &py_projection, &uri_format))
 
3912
        return NULL;
 
3913
    if (py_min_zoom) {
 
3914
        if (PyLong_Check(py_min_zoom))
 
3915
            min_zoom = PyLong_AsUnsignedLong(py_min_zoom);
 
3916
        else if (PyInt_Check(py_min_zoom))
 
3917
            min_zoom = PyInt_AsLong(py_min_zoom);
 
3918
        else
 
3919
            PyErr_SetString(PyExc_TypeError, "Parameter 'min_zoom' must be an int or a long");
 
3920
        if (PyErr_Occurred())
 
3921
            return NULL;
 
3922
    }
 
3923
    if (py_max_zoom) {
 
3924
        if (PyLong_Check(py_max_zoom))
 
3925
            max_zoom = PyLong_AsUnsignedLong(py_max_zoom);
 
3926
        else if (PyInt_Check(py_max_zoom))
 
3927
            max_zoom = PyInt_AsLong(py_max_zoom);
 
3928
        else
 
3929
            PyErr_SetString(PyExc_TypeError, "Parameter 'max_zoom' must be an int or a long");
 
3930
        if (PyErr_Occurred())
 
3931
            return NULL;
 
3932
    }
 
3933
    if (py_tile_size) {
 
3934
        if (PyLong_Check(py_tile_size))
 
3935
            tile_size = PyLong_AsUnsignedLong(py_tile_size);
 
3936
        else if (PyInt_Check(py_tile_size))
 
3937
            tile_size = PyInt_AsLong(py_tile_size);
 
3938
        else
 
3939
            PyErr_SetString(PyExc_TypeError, "Parameter 'tile_size' must be an int or a long");
 
3940
        if (PyErr_Occurred())
 
3941
            return NULL;
 
3942
    }
 
3943
    if (pyg_enum_get_value(CHAMPLAIN_TYPE_MAP_PROJECTION, py_projection, (gpointer)&projection))
 
3944
        return NULL;
 
3945
    
 
3946
    ret = champlain_network_map_source_new_full(id, name, license, license_uri, min_zoom, max_zoom, tile_size, projection, uri_format);
 
3947
    
 
3948
    /* pygobject_new handles NULL checking */
 
3949
    return pygobject_new((GObject *)ret);
 
3950
}
 
3951
 
 
3952
static PyObject *
 
3953
_wrap_champlain_marker_new_with_text(PyObject *self, PyObject *args, PyObject *kwargs)
 
3954
{
 
3955
    static char *kwlist[] = { "text", "font", "text_color", "marker_color", NULL };
 
3956
    char *text, *font;
 
3957
    ClutterColor *text_color = NULL, *marker_color = NULL;
 
3958
    ClutterActor *ret;
 
3959
    PyObject *py_text_color, *py_marker_color;
 
3960
 
 
3961
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ssOO:marker_new_with_text", kwlist, &text, &font, &py_text_color, &py_marker_color))
 
3962
        return NULL;
 
3963
    if (pyg_boxed_check(py_text_color, CLUTTER_TYPE_COLOR))
 
3964
        text_color = pyg_boxed_get(py_text_color, ClutterColor);
 
3965
    else {
 
3966
        PyErr_SetString(PyExc_TypeError, "text_color should be a ClutterColor");
 
3967
        return NULL;
 
3968
    }
 
3969
    if (pyg_boxed_check(py_marker_color, CLUTTER_TYPE_COLOR))
 
3970
        marker_color = pyg_boxed_get(py_marker_color, ClutterColor);
 
3971
    else {
 
3972
        PyErr_SetString(PyExc_TypeError, "marker_color should be a ClutterColor");
 
3973
        return NULL;
 
3974
    }
 
3975
    
 
3976
    ret = champlain_marker_new_with_text(text, font, text_color, marker_color);
 
3977
    
 
3978
    /* pygobject_new handles NULL checking */
 
3979
    return pygobject_new((GObject *)ret);
 
3980
}
 
3981
 
 
3982
static PyObject *
 
3983
_wrap_champlain_marker_new_with_image(PyObject *self, PyObject *args, PyObject *kwargs)
 
3984
{
 
3985
    static char *kwlist[] = { "actor", NULL };
 
3986
    PyGObject *actor;
 
3987
    ClutterActor *ret;
 
3988
 
 
3989
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:marker_new_with_image", kwlist, &PyClutterActor_Type, &actor))
 
3990
        return NULL;
 
3991
    
 
3992
    ret = champlain_marker_new_with_image(CLUTTER_ACTOR(actor->obj));
 
3993
    
 
3994
    /* pygobject_new handles NULL checking */
 
3995
    return pygobject_new((GObject *)ret);
 
3996
}
 
3997
 
 
3998
static PyObject *
 
3999
_wrap_champlain_marker_new_from_file(PyObject *self, PyObject *args, PyObject *kwargs)
 
4000
{
 
4001
    static char *kwlist[] = { "filename", NULL };
 
4002
    char *filename;
 
4003
    GError *error = NULL;
 
4004
    ClutterActor *ret;
 
4005
 
 
4006
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:marker_new_from_file", kwlist, &filename))
 
4007
        return NULL;
 
4008
    
 
4009
    ret = champlain_marker_new_from_file(filename, &error);
 
4010
    
 
4011
    if (pyg_error_check(&error))
 
4012
        return NULL;
 
4013
    /* pygobject_new handles NULL checking */
 
4014
    return pygobject_new((GObject *)ret);
 
4015
}
 
4016
 
 
4017
static PyObject *
 
4018
_wrap_champlain_marker_new_full(PyObject *self, PyObject *args, PyObject *kwargs)
 
4019
{
 
4020
    static char *kwlist[] = { "text", "actor", NULL };
 
4021
    char *text;
 
4022
    PyGObject *actor;
 
4023
    ClutterActor *ret;
 
4024
 
 
4025
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"sO!:marker_new_full", kwlist, &text, &PyClutterActor_Type, &actor))
 
4026
        return NULL;
 
4027
    
 
4028
    ret = champlain_marker_new_full(text, CLUTTER_ACTOR(actor->obj));
 
4029
    
 
4030
    /* pygobject_new handles NULL checking */
 
4031
    return pygobject_new((GObject *)ret);
 
4032
}
 
4033
 
 
4034
static PyObject *
 
4035
_wrap_champlain_marker_set_highlight_color(PyObject *self, PyObject *args, PyObject *kwargs)
 
4036
{
 
4037
    static char *kwlist[] = { "color", NULL };
 
4038
    ClutterColor *color = NULL;
 
4039
    PyObject *py_color;
 
4040
 
 
4041
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:marker_set_highlight_color", kwlist, &py_color))
 
4042
        return NULL;
 
4043
    if (pyg_boxed_check(py_color, CLUTTER_TYPE_COLOR))
 
4044
        color = pyg_boxed_get(py_color, ClutterColor);
 
4045
    else {
 
4046
        PyErr_SetString(PyExc_TypeError, "color should be a ClutterColor");
 
4047
        return NULL;
 
4048
    }
 
4049
    
 
4050
    champlain_marker_set_highlight_color(color);
 
4051
    
 
4052
    Py_INCREF(Py_None);
 
4053
    return Py_None;
 
4054
}
 
4055
 
 
4056
static PyObject *
 
4057
_wrap_champlain_tile_new_full(PyObject *self, PyObject *args, PyObject *kwargs)
 
4058
{
 
4059
    static char *kwlist[] = { "x", "y", "size", "zoom_level", NULL };
 
4060
    int x, y, zoom_level;
 
4061
    PyObject *py_size = NULL;
 
4062
    guint size = 0;
 
4063
    ChamplainTile *ret;
 
4064
 
 
4065
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"iiOi:tile_new_full", kwlist, &x, &y, &py_size, &zoom_level))
 
4066
        return NULL;
 
4067
    if (py_size) {
 
4068
        if (PyLong_Check(py_size))
 
4069
            size = PyLong_AsUnsignedLong(py_size);
 
4070
        else if (PyInt_Check(py_size))
 
4071
            size = PyInt_AsLong(py_size);
 
4072
        else
 
4073
            PyErr_SetString(PyExc_TypeError, "Parameter 'size' must be an int or a long");
 
4074
        if (PyErr_Occurred())
 
4075
            return NULL;
 
4076
    }
 
4077
    
 
4078
    ret = champlain_tile_new_full(x, y, size, zoom_level);
 
4079
    
 
4080
    /* pygobject_new handles NULL checking */
 
4081
    return pygobject_new((GObject *)ret);
 
4082
}
 
4083
 
 
4084
const PyMethodDef champlain_functions[] = {
 
4085
    { "cache_dup_default", (PyCFunction)_wrap_champlain_cache_dup_default, METH_NOARGS,
 
4086
      NULL },
 
4087
    { "map_source_factory_dup_default", (PyCFunction)_wrap_champlain_map_source_factory_dup_default, METH_NOARGS,
 
4088
      NULL },
 
4089
    { "network_map_source_new_full", (PyCFunction)_wrap_champlain_network_map_source_new_full, METH_VARARGS|METH_KEYWORDS,
 
4090
      NULL },
 
4091
    { "marker_new_with_text", (PyCFunction)_wrap_champlain_marker_new_with_text, METH_VARARGS|METH_KEYWORDS,
 
4092
      NULL },
 
4093
    { "marker_new_with_image", (PyCFunction)_wrap_champlain_marker_new_with_image, METH_VARARGS|METH_KEYWORDS,
 
4094
      NULL },
 
4095
    { "marker_new_from_file", (PyCFunction)_wrap_champlain_marker_new_from_file, METH_VARARGS|METH_KEYWORDS,
 
4096
      NULL },
 
4097
    { "marker_new_full", (PyCFunction)_wrap_champlain_marker_new_full, METH_VARARGS|METH_KEYWORDS,
 
4098
      NULL },
 
4099
    { "marker_set_highlight_color", (PyCFunction)_wrap_champlain_marker_set_highlight_color, METH_VARARGS|METH_KEYWORDS,
 
4100
      NULL },
 
4101
    { "tile_new_full", (PyCFunction)_wrap_champlain_tile_new_full, METH_VARARGS|METH_KEYWORDS,
 
4102
      NULL },
 
4103
    { NULL, NULL, 0, NULL }
 
4104
};
 
4105
 
 
4106
 
 
4107
/* ----------- enums and flags ----------- */
 
4108
 
 
4109
void
 
4110
champlain_add_constants(PyObject *module, const gchar *strip_prefix)
 
4111
{
 
4112
#ifdef VERSION
 
4113
    PyModule_AddStringConstant(module, "__version__", VERSION);
 
4114
#endif
 
4115
  pyg_enum_add(module, "ScrollMode", strip_prefix, CHAMPLAIN_TYPE_SCROLL_MODE);
 
4116
  pyg_enum_add(module, "State", strip_prefix, CHAMPLAIN_TYPE_STATE);
 
4117
  pyg_enum_add(module, "MapProjection", strip_prefix, CHAMPLAIN_TYPE_MAP_PROJECTION);
 
4118
 
 
4119
  if (PyErr_Occurred())
 
4120
    PyErr_Print();
 
4121
}
 
4122
 
 
4123
/* initialise stuff extension classes */
 
4124
void
 
4125
champlain_register_classes(PyObject *d)
 
4126
{
 
4127
    PyObject *module;
 
4128
 
 
4129
    if ((module = PyImport_ImportModule("gobject")) != NULL) {
 
4130
        _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
 
4131
        if (_PyGObject_Type == NULL) {
 
4132
            PyErr_SetString(PyExc_ImportError,
 
4133
                "cannot import name GObject from gobject");
 
4134
            return ;
 
4135
        }
 
4136
    } else {
 
4137
        PyErr_SetString(PyExc_ImportError,
 
4138
            "could not import gobject");
 
4139
        return ;
 
4140
    }
 
4141
    if ((module = PyImport_ImportModule("clutter")) != NULL) {
 
4142
        _PyClutterActor_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Actor");
 
4143
        if (_PyClutterActor_Type == NULL) {
 
4144
            PyErr_SetString(PyExc_ImportError,
 
4145
                "cannot import name Actor from clutter");
 
4146
            return ;
 
4147
        }
 
4148
        _PyClutterGroup_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Group");
 
4149
        if (_PyClutterGroup_Type == NULL) {
 
4150
            PyErr_SetString(PyExc_ImportError,
 
4151
                "cannot import name Group from clutter");
 
4152
            return ;
 
4153
        }
 
4154
        _PyClutterColor_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Color");
 
4155
        if (_PyClutterColor_Type == NULL) {
 
4156
            PyErr_SetString(PyExc_ImportError,
 
4157
                "cannot import name Color from clutter");
 
4158
            return ;
 
4159
        }
 
4160
    } else {
 
4161
        PyErr_SetString(PyExc_ImportError,
 
4162
            "could not import clutter");
 
4163
        return ;
 
4164
    }
 
4165
 
 
4166
 
 
4167
#line 4168 "pychamplain.c"
 
4168
    pyg_register_boxed(d, "Point", CHAMPLAIN_TYPE_POINT, &PyChamplainPoint_Type);
 
4169
    pyg_register_boxed(d, "MapSourceDesc", CHAMPLAIN_TYPE_MAP_SOURCE_DESC, &PyChamplainMapSourceDesc_Type);
 
4170
    pygobject_register_class(d, "ChamplainBaseMarker", CHAMPLAIN_TYPE_BASE_MARKER, &PyChamplainBaseMarker_Type, Py_BuildValue("(O)", &PyClutterGroup_Type));
 
4171
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_BASE_MARKER);
 
4172
    pygobject_register_class(d, "ChamplainCache", CHAMPLAIN_TYPE_CACHE, &PyChamplainCache_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
4173
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_CACHE);
 
4174
    pygobject_register_class(d, "ChamplainLayer", CHAMPLAIN_TYPE_LAYER, &PyChamplainLayer_Type, Py_BuildValue("(O)", &PyClutterGroup_Type));
 
4175
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_LAYER);
 
4176
    pygobject_register_class(d, "ChamplainMapSource", CHAMPLAIN_TYPE_MAP_SOURCE, &PyChamplainMapSource_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
4177
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_MAP_SOURCE);
 
4178
    pygobject_register_class(d, "ChamplainMapSourceFactory", CHAMPLAIN_TYPE_MAP_SOURCE_FACTORY, &PyChamplainMapSourceFactory_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
4179
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_MAP_SOURCE_FACTORY);
 
4180
    pygobject_register_class(d, "ChamplainMarker", CHAMPLAIN_TYPE_MARKER, &PyChamplainMarker_Type, Py_BuildValue("(O)", &PyChamplainBaseMarker_Type));
 
4181
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_MARKER);
 
4182
    pygobject_register_class(d, "ChamplainNetworkMapSource", CHAMPLAIN_TYPE_NETWORK_MAP_SOURCE, &PyChamplainNetworkMapSource_Type, Py_BuildValue("(O)", &PyChamplainMapSource_Type));
 
4183
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_NETWORK_MAP_SOURCE);
 
4184
    pygobject_register_class(d, "ChamplainPolygon", CHAMPLAIN_TYPE_POLYGON, &PyChamplainPolygon_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
4185
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_POLYGON);
 
4186
    pygobject_register_class(d, "ChamplainTile", CHAMPLAIN_TYPE_TILE, &PyChamplainTile_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
4187
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_TILE);
 
4188
    pygobject_register_class(d, "ChamplainView", CHAMPLAIN_TYPE_VIEW, &PyChamplainView_Type, Py_BuildValue("(O)", &PyClutterGroup_Type));
 
4189
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_VIEW);
 
4190
    pygobject_register_class(d, "ChamplainZoomLevel", CHAMPLAIN_TYPE_ZOOM_LEVEL, &PyChamplainZoomLevel_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
4191
    pyg_set_object_has_new_constructor(CHAMPLAIN_TYPE_ZOOM_LEVEL);
 
4192
}