[gobject-introspection] Revert "Apply `(type bitfield)' annotations for enums"



commit 24d989b151b1c553ce0ee65a7c9f43c1da1f2b90
Author: Johan Dahlin <johan gnome org>
Date:   Wed Oct 6 11:26:37 2010 -0300

    Revert "Apply `(type bitfield)' annotations for enums"
    
    This reverts commit d15e386c8e10dd6b645a444e29cc053100089a07.

 giscanner/maintransformer.py              |   11 ++---------
 tests/scanner/Annotation-1.0-expected.gir |    4 ----
 tests/scanner/annotation.h                |    9 ---------
 3 files changed, 2 insertions(+), 22 deletions(-)
---
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 9053abf..89f7ff6 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -219,9 +219,8 @@ usage is void (*_gtk_reserved1)(void);"""
             self._apply_annotations_function(node, chain)
         if isinstance(node, ast.Callback):
             self._apply_annotations_callable(node, chain, block = self._get_block(node))
-        if isinstance(node, (ast.Enum, ast.Bitfield)):
-            self._apply_annotations_enum(node, self._get_block(node))
-        if isinstance(node, (ast.Class, ast.Interface, ast.Union, ast.Callback)):
+        if isinstance(node, (ast.Class, ast.Interface, ast.Union, ast.Enum,
+                             ast.Bitfield, ast.Callback)):
             self._apply_annotations_annotated(node, self._get_block(node))
         if isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union)):
             block = self._get_block(node)
@@ -410,12 +409,6 @@ usage is void (*_gtk_reserved1)(void);"""
             message.warn_node(parent,
                 "Unknown container %r for element-type annotation" % (node.type, ))
 
-    def _apply_annotations_enum(self, node, block):
-        enum_type = block.options.get(OPT_TYPE)
-        if enum_type and enum_type.one() == 'bitfield':
-            node.__class__ = ast.Bitfield
-        self._apply_annotations_annotated(node, block)
-
     def _get_transfer_default_param(self, parent, node):
         if node.direction in [ast.PARAM_DIRECTION_INOUT,
                               ast.PARAM_DIRECTION_OUT]:
diff --git a/tests/scanner/Annotation-1.0-expected.gir b/tests/scanner/Annotation-1.0-expected.gir
index 92d4ff2..050d888 100644
--- a/tests/scanner/Annotation-1.0-expected.gir
+++ b/tests/scanner/Annotation-1.0-expected.gir
@@ -15,10 +15,6 @@ and/or use gtk-doc annotations.  -->
              shared-library="libannotation.so"
              c:identifier-prefixes="Annotation"
              c:symbol-prefixes="annotation">
-    <bitfield name="Bitfield" c:type="AnnotationBitfield">
-      <member name="foo" value="1" c:identifier="ANNOTATION_FLAG_FOO"/>
-      <member name="bar" value="2" c:identifier="ANNOTATION_FLAG_BAR"/>
-    </bitfield>
     <callback name="Callback" c:type="AnnotationCallback">
       <doc xml:whitespace="preserve">This is a callback.</doc>
       <return-value transfer-ownership="none">
diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h
index 9559e40..ef05ddb 100644
--- a/tests/scanner/annotation.h
+++ b/tests/scanner/annotation.h
@@ -4,15 +4,6 @@
 #include <glib-object.h>
 
 /**
- * AnnotationBitfield: (type bitfield)
- **/
-typedef enum
-{
-  ANNOTATION_FLAG_FOO = 1,
-  ANNOTATION_FLAG_BAR = 2
-} AnnotationBitfield;
-
-/**
  * AnnotationCallback:
  * @in: (in) (transfer none): array of ints
  *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]