summaryrefslogtreecommitdiff
path: root/atkmodule.c
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-11-27 17:49:53 +0000
committerMatt Wilson <msw@src.gnome.org>2001-11-27 17:49:53 +0000
commitaa5113459041cf86db2243a1e47e6c19f9a57b9a (patch)
tree409e665c0334116be1d52b1be3b37c2f0ba42b86 /atkmodule.c
parent9299d897e9188b55b196174db2ffaf6e2a2d944f (diff)
downloadpygtk-aa5113459041cf86db2243a1e47e6c19f9a57b9a.tar.gz
added start of atk wrapper
2001-11-27 Matt Wilson <msw@redhat.com> * atk.defs, atk.override, atkmodule.c: added start of atk wrapper * gtk/Makefile.am (DISTCLEANFILES): remove generated files ($(srcdir)/gtk.c): modify targets to output generated files in the builddir, not the srcdir. ($(srcdir)/gdk.c): likewise. ($(srcdir)/libglade.c): likewise. * codegen/h2def.py (define_func): add check to workaround broken string.replace semantics on python 1.5 * codegen/codegen.py (write_enums): if the enum or flag doesn't have a GType, just add those enum values listed in the defs file by hand. * codegen/argtypes.py (ArgMatcher.register_enum): if defs file doesn't specify a GType for the enum, use G_TYPE_NONE. (ArgMatcher.register_flag): likewise. * gobjectmodule.c (pyg_enum_get_value): allow enums to pass G_TYPE_NONE in as the type, disabling the string to value conversion. (pyg_flags_get_value): likewise. (pyg_constant_strip_prefix): new function to combine common codepath. (pyg_enum_add_constants): use pyg_constant_strip_prefix (pyg_flags_add_constants): likewise. (functions): make pyg_constant_strip_prefix available to users of pygobject * pygobject.h: added pyg_constant_strip_prefix wrapper * configure.in: added ATK test, subst for ATK_CFLAGS and ATK_LIBS. * Makefile.am (%.c): added generic codegen target for pango and atk. Added DISTCLEANFILES so that generated files will be removed. Added atk targets, cflags, ldflags.
Diffstat (limited to 'atkmodule.c')
-rw-r--r--atkmodule.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/atkmodule.c b/atkmodule.c
new file mode 100644
index 00000000..70bab607
--- /dev/null
+++ b/atkmodule.c
@@ -0,0 +1,31 @@
+/* -*- 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>
+
+void pyatk_register_classes (PyObject *d);
+void pyatk_add_constants(PyObject *module, const gchar *strip_prefix);
+
+extern PyMethodDef pyatk_functions[];
+
+DL_EXPORT(void)
+initatk(void)
+{
+ PyObject *m, *d;
+
+ init_pygobject ();
+
+ m = Py_InitModule ("atk", pyatk_functions);
+ d = PyModule_GetDict (m);
+
+ pyatk_register_classes (d);
+ pyatk_add_constants(m, "ATK_");
+
+ if (PyErr_Occurred ()) {
+ Py_FatalError ("can't initialise module atk");
+ }
+}