gobject-introspection r791 - trunk/giscanner
- From: tko svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r791 - trunk/giscanner
- Date: Thu, 23 Oct 2008 17:40:16 +0000 (UTC)
Author: tko
Date: Thu Oct 23 17:40:15 2008
New Revision: 791
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=791&view=rev
Log:
build fundamental types same way as glib
* giscanner/cgobject.py: build fundamental types same way as glib
Modified:
trunk/giscanner/cgobject.py
Modified: trunk/giscanner/cgobject.py
==============================================================================
--- trunk/giscanner/cgobject.py (original)
+++ trunk/giscanner/cgobject.py Thu Oct 23 17:40:15 2008
@@ -36,15 +36,35 @@
# Constants
-# FIXME: Are these stable?
-TYPE_INVALID = 0
-TYPE_INTERFACE = 8
-TYPE_ENUM = 48
-TYPE_FLAGS = 52
-TYPE_STRING = 64
-TYPE_POINTER = 68
-TYPE_BOXED = 72
-TYPE_OBJECT = 80
+# from gobject/gtype.h
+
+
+def _make_fundamental(x):
+ G_TYPE_FUNDAMENTAL_SHIFT = 2
+ return x << G_TYPE_FUNDAMENTAL_SHIFT
+
+
+TYPE_INVALID = _make_fundamental(0)
+TYPE_NONE = _make_fundamental(1)
+TYPE_INTERFACE = _make_fundamental(2)
+TYPE_CHAR = _make_fundamental(3)
+TYPE_UCHAR = _make_fundamental(4)
+TYPE_BOOLEAN = _make_fundamental(5)
+TYPE_INT = _make_fundamental(6)
+TYPE_UINT = _make_fundamental(7)
+TYPE_LONG = _make_fundamental(8)
+TYPE_ULONG = _make_fundamental(9)
+TYPE_INT64 = _make_fundamental(10)
+TYPE_UINT64 = _make_fundamental(11)
+TYPE_ENUM = _make_fundamental(12)
+TYPE_FLAGS = _make_fundamental(13)
+TYPE_FLOAT = _make_fundamental(14)
+TYPE_DOUBLE = _make_fundamental(15)
+TYPE_STRING = _make_fundamental(16)
+TYPE_POINTER = _make_fundamental(17)
+TYPE_BOXED = _make_fundamental(18)
+TYPE_PARAM = _make_fundamental(19)
+TYPE_OBJECT = _make_fundamental(20)
# Typedefs
@@ -281,4 +301,3 @@
yield info
TYPE_GTYPE = type_from_name('GType')
-TYPE_POINTER = type_from_name('gpointer')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]