File: uimodule.c

package info (click to toggle)
gnome-python 2.28.1%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,288 kB
  • ctags: 1,032
  • sloc: sh: 10,219; ansic: 7,997; xml: 2,464; python: 1,886; makefile: 394
file content (37 lines) | stat: -rw-r--r-- 983 bytes parent folder | download | duplicates (5)
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
/* -*- Mode: C; c-basic-offset: 4 -*- */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

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

#include <libgnomeui/libgnomeui.h>

void pyui_register_classes (PyObject *d);
void pyui_add_constants(PyObject *module, const gchar *strip_prefix);
extern PyMethodDef pyui_functions[];

DL_EXPORT(void)
initui (void)
{
    PyObject *m, *d;
	
    init_pygobject ();
    init_pygnomevfs ();

    m = Py_InitModule ("ui", pyui_functions);
    d = PyModule_GetDict (m);
	
    pyui_register_classes (d);
    pyui_add_constants (m, "GNOME_");
    
    PyDict_SetItemString(d, "PAD", PyInt_FromLong(GNOME_PAD));
    PyDict_SetItemString(d, "PAD_SMALL", PyInt_FromLong(GNOME_PAD_SMALL));
    PyDict_SetItemString(d, "PAD_BIG", PyInt_FromLong(GNOME_PAD_BIG));
        
    if (!gnome_program_module_registered(LIBGNOMEUI_MODULE))
        gnome_program_module_register(LIBGNOMEUI_MODULE);
}