File: diaviewmodule.c

package info (click to toggle)
diacanvas2 0.14.4-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,640 kB
  • ctags: 2,553
  • sloc: sh: 157,554; ansic: 21,714; xml: 8,167; python: 668; makefile: 427
file content (37 lines) | stat: -rw-r--r-- 714 bytes parent folder | download | duplicates (2)
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
36
37
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif

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


void pydiaview_register_classes (PyObject *d);

extern PyMethodDef pydiaview_functions[];

DL_EXPORT(void)
initview (void)
{
	PyObject *m, *d;

	/* Standard initialization: */
	init_pygobject ();
	init_pygtk ();

	if (!PyImport_ImportModule("diacanvas._canvas")) {
		Py_FatalError("could not import diacanvas._canvas");
		return;
	}

	m = Py_InitModule ("diacanvas.view", pydiaview_functions);
	d = PyModule_GetDict (m);

	pydiaview_register_classes (d);

	if (PyErr_Occurred ()) {
		Py_FatalError ("can't initialise module diacanvas.view");
	}
}