File: rsvgmodule.c

package info (click to toggle)
gnome-python-desktop 2.32.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 4,528 kB
  • ctags: 983
  • sloc: sh: 10,214; xml: 8,851; ansic: 3,428; python: 1,457; makefile: 664
file content (35 lines) | stat: -rw-r--r-- 808 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/* include this first, before NO_IMPORT_PYGOBJECT is defined */
#include <pygobject.h>
#include <pycairo.h>
#include <librsvg/rsvg.h>

Pycairo_CAPI_t *Pycairo_CAPI;

void pyrsvg_register_classes(PyObject *d);

extern const PyMethodDef pyrsvg_functions[];


DL_EXPORT(void)
initrsvg(void)
{
    PyObject *rsvg_module = NULL;
    PyObject *dict = NULL;

    init_pygobject();
    rsvg_init();

    Pycairo_IMPORT;

    rsvg_module = Py_InitModule3("rsvg", (PyMethodDef*) pyrsvg_functions,
                                 "rsvg module.");

    dict = PyModule_GetDict(rsvg_module);
    pyrsvg_register_classes(dict);
    if (PyErr_Occurred()) {
        PyErr_Print();
        Py_FatalError("can't initialise module rsvg");
    }
}