1 /* -*- Mode: C; c-basic-offset: 4 -*-
2  * pygtk- Python bindings for the GTK toolkit.
3  * Copyright (C) 2006  John Finlay
4  *
5  *   gtkunixprintmodule.c: wrapper for the gtkunixprint library.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 #ifdef HAVE_CONFIG_H
23 #  include "config.h"
24 #endif
25 #include <Python.h>
26 /* include this first, before NO_IMPORT_PYGOBJECT is defined */
27 #include <pygobject.h>
28 #include <pygtk.h>
29 #include <gtk/gtk.h>
30 #include <gtk/gtkunixprint.h>
31 
32 # include <pylcairo.h>
33 Pycairo_CAPI_t *Pycairo_CAPI;
34 
35 void pygtkunixprint_register_classes(PyObject *d);
36 void pygtkunixprint_add_constants(PyObject *module, const gchar *strip_prefix);
37 extern PyMethodDef pygtkunixprint_functions[];
38 
39 DL_EXPORT(void)
initgtkunixprint(void)40 initgtkunixprint(void)
41 {
42     PyObject *m, *d;
43 
44     m = Py_InitModule("gtkunixprint", pygtkunixprint_functions);
45     d = PyModule_GetDict(m);
46 
47     init_pygobject();
48     Pycairo_IMPORT;
49     init_pygtk();
50 
51     pygtkunixprint_register_classes(d);
52     pygtkunixprint_add_constants(m, "GTK_");
53 }
54