summaryrefslogtreecommitdiff
path: root/atk.override
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 /atk.override
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 'atk.override')
-rw-r--r--atk.override54
1 files changed, 54 insertions, 0 deletions
diff --git a/atk.override b/atk.override
new file mode 100644
index 00000000..08babd60
--- /dev/null
+++ b/atk.override
@@ -0,0 +1,54 @@
+/* -*- Mode: C; c-basic-offset: 4 -*- */
+%%
+headers
+#include <Python.h>
+
+#include "pygobject.h"
+#include <atk/atk.h>
+#include <atk/atknoopobjectfactory.h>
+#include <atk/atknoopobject.h>
+%%
+import gobject.GObject as PyGObject_Type
+%%
+ignore-glob
+ *_get_type
+%%
+override atk_relation_new kwargs
+static PyObject *
+_wrap_atk_relation_new(PyGBoxed *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "targets", "relationship", NULL };
+ AtkObject **targets;
+ AtkRelation *ret;
+ int relationship, count, i;
+ PyObject *py_targets;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "Oi#:relation_new", kwlist,
+ &py_targets, &relationship))
+ return NULL;
+
+ if (!PySequence_Check(py_targets)) {
+ PyErr_SetString(PyExc_TypeError, "targets argument must be a sequence");
+ return NULL;
+ }
+
+ count = PySequence_Length(py_targets);
+ targets = g_new(AtkObject *, count);
+ for (i = 0; i < count; i++) {
+ PyObject *item = PySequence_GetItem(py_targets, i);
+ Py_DECREF(item); /* PySequence_GetItem INCREF's */
+ if (!pygobject_check(item, &PyAtkObject_Type)) {
+ PyErr_SetString(PyExc_TypeError, "targets argument must be a sequence of AtkObjects.");
+ g_free(targets);
+ return NULL;
+ }
+
+ targets[i] = (AtkObject *) pygobject_get(item);
+ }
+
+ ret = atk_relation_new(targets, count, relationship);
+ g_free(targets);
+
+ return pygobject_new((GObject *) ret);
+}