add m4 to ACLOCAL_AMFLAGS
[pywebkitgtk.git] / webkitmodule.c
blobaf66223b5825267b72e86b6bcd70ed505eb2a298
1 /*
2 * Copyright (C) 2006-2007, Red Hat, Inc.
3 * Copyright (C) 2007-2008 Jan Michael Alonzo <jmalonzo@unpluggable.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
20 #include <Python.h>
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif
25 /* include this first, before NO_IMPORT_PYGOBJECT is defined */
26 #include <pygobject.h>
27 #include <pygtk/pygtk.h>
29 extern PyMethodDef pywebkit_functions[];
31 void pywebkit_register_classes (PyObject *d);
33 DL_EXPORT(void)
34 initwebkit(void)
36 PyObject *m, *d;
38 if (!pygobject_init(-1, -1, -1)) {
39 PyErr_Print();
40 Py_FatalError ("can't initialise module gobject");
43 init_pygtk();
45 m = Py_InitModule ("webkit", pywebkit_functions);
46 d = PyModule_GetDict (m);
48 pywebkit_register_classes (d);
50 if (PyErr_Occurred ()) {
51 PyErr_Print();
52 Py_FatalError ("can't initialise module webkit");