Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/giscanner/glibast.py
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-02-20 22:34:20 (GMT)
committer Colin Walters <walters@verbum.org>2009-02-25 22:31:49 (GMT)
commit251de52b083d3e0e42f25cb164a46865c2c2b9a9 (patch)
tree99db442fd1bb299466f5d277561becfca4b220ee /giscanner/glibast.py
parent0b9dda0e725446882dca84b6a64688c8f0e5a4e3 (diff)
Bug 572434 - Associate interfaces with their C structures
Similar to GObject class structs, we pair up GInterfaces with their C structures. Also, move some GLib-specific things into glibast.py, and make the naming more generic.
Diffstat (limited to 'giscanner/glibast.py')
-rw-r--r--giscanner/glibast.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/giscanner/glibast.py b/giscanner/glibast.py
index f61cd5f..e2a9d5b 100644
--- a/giscanner/glibast.py
+++ b/giscanner/glibast.py
@@ -19,7 +19,7 @@
#
from .ast import (Bitfield, Class, Enum, Interface, Member, Node,
- Property, Struct, Union)
+ Property, Struct, Union, Record)
from .ast import (
type_names, default_array_types,
TYPE_STRING, TYPE_INT8, TYPE_UINT8, TYPE_INT16, TYPE_UINT16,
@@ -62,6 +62,22 @@ type_names['gushort'] = TYPE_UINT16
default_array_types['guint8*'] = TYPE_UINT8
default_array_types['gchar**'] = TYPE_STRING
+class GLibRecord(Record):
+ def __init__(self, *args, **kwargs):
+ Record.__init__(self, *args, **kwargs)
+
+ @classmethod
+ def from_record(cls, record):
+ obj = cls(record.name, record.symbol)
+ obj.fields = record.fields
+ obj.constructors = record.constructors
+ obj.disguised = record.disguised
+ obj.doc = record.doc
+ obj.methods = record.methods
+ # If true, this record defines the FooClass C structure
+ # for some Foo GObject (or similar for GInterface)
+ obj.is_gtype_struct_for = False
+ return obj
class GLibEnum(Enum):