summaryrefslogtreecommitdiffstats
path: root/gobject/pygflags.h
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2004-07-17 16:38:46 +0000
committerJohan Dahlin <johan@src.gnome.org>2004-07-17 16:38:46 +0000
commitb889f44c6adeaf10d5e1ae0a2e69ef5ee218ccad (patch)
tree6db2e280696773afe0d2d54425441ed1abc5ee4b /gobject/pygflags.h
parent8238d9cc0fce600328f50efa139db1f575058ae8 (diff)
downloadpygobject-b889f44c6adeaf10d5e1ae0a2e69ef5ee218ccad.tar.gz
pygobject-b889f44c6adeaf10d5e1ae0a2e69ef5ee218ccad.tar.xz
pygobject-b889f44c6adeaf10d5e1ae0a2e69ef5ee218ccad.zip
gtk/*.override
* gtk/*.override * codegen/codegen.py: * codegen/argtypes.py: Update for enums * pygtype.c (pyg_value_as_pyobject): Use new enum/flag functions * pygenum.[ch]: Handle GFlag * pygflags.[ch]: Handle GFlag * atk-types.defs: Fix gtype-id for all enums * gobjectmodule.c (initgobject): Clean up and add convinience macros * tests/enum.py: New file * tests/common.py: New file, also stole from gst-python
Diffstat (limited to 'gobject/pygflags.h')
-rw-r--r--gobject/pygflags.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/gobject/pygflags.h b/gobject/pygflags.h
new file mode 100644
index 0000000..6bf93cd
--- /dev/null
+++ b/gobject/pygflags.h
@@ -0,0 +1,52 @@
+/* -*- Mode: C; c-basic-offset: 4 -*-
+ * pygtk- Python bindings for the GTK toolkit.
+ * Copyright (C) 1998-2003 James Henstridge
+ * Copyright (C) 2004 Johan Dahlin
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#ifndef __PYGFLAGS_H__
+#define __PYGFLAGS_H__
+
+#include <Python.h>
+#include <glib-object.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef struct {
+ PyIntObject parent;
+ GType gtype;
+} PyGFlags;
+
+PyTypeObject PyGFlags_Type;
+
+#define PyGFlags_Check(x) (g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_FLAGS))
+
+PyObject * pyg_flags_add (PyObject * module,
+ const char * typename,
+ const char * strip_prefix,
+ GType gtype);
+PyObject * pyg_flags_from_gtype (GType gtype,
+ int value);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __PYGFLAGS_H__ */