[gobject-introspection] [scanner] Revert static method pairing



commit 144cb10d51888a9565721088d2b61794468742e9
Author: Johan Dahlin <johan gnome org>
Date:   Mon Sep 6 17:02:06 2010 -0300

    [scanner] Revert static method pairing
    
    Static method pairing changes the API and should be futher
    discussed in https://bugzilla.gnome.org/show_bug.cgi?id=572408

 giscanner/maintransformer.py           |    9 +-
 tests/scanner/Foo-1.0-expected.gir     |   70 +++++++-------
 tests/scanner/Regress-1.0-expected.gir |  165 ++++++++++++++++----------------
 3 files changed, 125 insertions(+), 119 deletions(-)
---
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index dc09ae2..cd6f8e9 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -800,9 +800,12 @@ method or constructor of some type."""
         if not isinstance(node, (ast.Class, ast.Interface,
                                  ast.Record, ast.Union, glibast.GLibBoxedOther)):
             return False
-        self._namespace.float(func)
-        func.name = funcname
-        node.static_methods.append(func)
+
+        # FIXME: https://bugzilla.gnome.org/show_bug.cgi?id=572408
+        #self._namespace.float(func)
+        #func.name = funcname
+        #node.static_methods.append(func)
+        return True
 
     def _pair_constructor(self, func, subsymbol):
         if not (func.symbol.find('_new_') >= 0 or func.symbol.endswith('_new')):
diff --git a/tests/scanner/Foo-1.0-expected.gir b/tests/scanner/Foo-1.0-expected.gir
index 105de42..6bf904b 100644
--- a/tests/scanner/Foo-1.0-expected.gir
+++ b/tests/scanner/Foo-1.0-expected.gir
@@ -318,19 +318,6 @@ and/or use gtk-doc annotations.  -->
           <type name="Object" c:type="FooObject*"/>
         </return-value>
       </constructor>
-      <function name="get_default" c:identifier="foo_object_get_default">
-        <doc xml:whitespace="preserve">This function is intended to match clutter_stage_get_default which
-uses a C sugar return type.</doc>
-        <return-value transfer-ownership="none">
-          <doc xml:whitespace="preserve">The global #FooSubobject</doc>
-          <type name="Subobject"/>
-        </return-value>
-      </function>
-      <function name="static_meth" c:identifier="foo_object_static_meth">
-        <return-value transfer-ownership="none">
-          <type name="gint" c:type="int"/>
-        </return-value>
-      </function>
       <virtual-method name="read_fn" invoker="read">
         <doc xml:whitespace="preserve">Read some stuff.</doc>
         <return-value transfer-ownership="none">
@@ -576,27 +563,6 @@ uses a C sugar return type.</doc>
           </parameter>
         </parameters>
       </method>
-      <function name="new" c:identifier="foo_rectangle_new" introspectable="0">
-        <doc xml:whitespace="preserve">This is a C convenience constructor; we have to (skip)
-it because it's not a boxed type.</doc>
-        <return-value>
-          <type name="Rectangle" c:type="FooRectangle*"/>
-        </return-value>
-        <parameters>
-          <parameter name="x" transfer-ownership="none">
-            <type name="gint" c:type="int"/>
-          </parameter>
-          <parameter name="y" transfer-ownership="none">
-            <type name="gint" c:type="int"/>
-          </parameter>
-          <parameter name="width" transfer-ownership="none">
-            <type name="gint" c:type="int"/>
-          </parameter>
-          <parameter name="height" transfer-ownership="none">
-            <type name="gint" c:type="int"/>
-          </parameter>
-        </parameters>
-      </function>
     </record>
     <constant name="SUCCESS_INT" value="4408">
       <type name="gint" c:type="gint"/>
@@ -941,6 +907,42 @@ exposed to language bindings.</doc>
         </parameter>
       </parameters>
     </function>
+    <function name="object_get_default" c:identifier="foo_object_get_default">
+      <doc xml:whitespace="preserve">This function is intended to match clutter_stage_get_default which
+uses a C sugar return type.</doc>
+      <return-value transfer-ownership="none">
+        <doc xml:whitespace="preserve">The global #FooSubobject</doc>
+        <type name="Subobject"/>
+      </return-value>
+    </function>
+    <function name="object_static_meth" c:identifier="foo_object_static_meth">
+      <return-value transfer-ownership="none">
+        <type name="gint" c:type="int"/>
+      </return-value>
+    </function>
+    <function name="rectangle_new"
+              c:identifier="foo_rectangle_new"
+              introspectable="0">
+      <doc xml:whitespace="preserve">This is a C convenience constructor; we have to (skip)
+it because it's not a boxed type.</doc>
+      <return-value>
+        <type name="Rectangle" c:type="FooRectangle*"/>
+      </return-value>
+      <parameters>
+        <parameter name="x" transfer-ownership="none">
+          <type name="gint" c:type="int"/>
+        </parameter>
+        <parameter name="y" transfer-ownership="none">
+          <type name="gint" c:type="int"/>
+        </parameter>
+        <parameter name="width" transfer-ownership="none">
+          <type name="gint" c:type="int"/>
+        </parameter>
+        <parameter name="height" transfer-ownership="none">
+          <type name="gint" c:type="int"/>
+        </parameter>
+      </parameters>
+    </function>
     <function name="skip_me" c:identifier="foo_skip_me" introspectable="0">
       <doc xml:whitespace="preserve">Does something that's only interesting from C and should not be
 exposed to language bindings.</doc>
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 4014e5e..e604a7b 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -330,46 +330,6 @@ and/or use gtk-doc annotations.  -->
           </parameter>
         </parameters>
       </constructor>
-      <function name="null_out" c:identifier="regress_test_obj_null_out">
-        <return-value transfer-ownership="none">
-          <type name="none" c:type="void"/>
-        </return-value>
-        <parameters>
-          <parameter name="obj"
-                     direction="out"
-                     caller-allocates="0"
-                     transfer-ownership="full"
-                     allow-none="1">
-            <doc xml:whitespace="preserve">A #RegressTestObj</doc>
-            <type name="TestObj" c:type="RegressTestObj**"/>
-          </parameter>
-        </parameters>
-      </function>
-      <function name="static_method"
-                c:identifier="regress_test_obj_static_method">
-        <return-value transfer-ownership="none">
-          <type name="gdouble" c:type="double"/>
-        </return-value>
-        <parameters>
-          <parameter name="x" transfer-ownership="none">
-            <type name="gint" c:type="int"/>
-          </parameter>
-        </parameters>
-      </function>
-      <function name="static_method_callback"
-                c:identifier="regress_test_obj_static_method_callback">
-        <return-value transfer-ownership="none">
-          <type name="none" c:type="void"/>
-        </return-value>
-        <parameters>
-          <parameter name="callback"
-                     transfer-ownership="none"
-                     allow-none="1"
-                     scope="call">
-            <type name="TestCallback" c:type="RegressTestCallback"/>
-          </parameter>
-        </parameters>
-      </function>
       <virtual-method name="matrix" invoker="do_matrix">
         <doc xml:whitespace="preserve">This method is virtual.  Notably its name differs from the virtual
 slot name, which makes it useful for testing bindings handle this
@@ -643,12 +603,6 @@ case.</doc>
           </parameter>
         </parameters>
       </method>
-      <function name="const_return"
-                c:identifier="regress_test_simple_boxed_a_const_return">
-        <return-value transfer-ownership="none">
-          <type name="TestSimpleBoxedA" c:type="RegressTestSimpleBoxedA*"/>
-        </return-value>
-      </function>
     </record>
     <record name="TestSimpleBoxedB"
             c:type="RegressTestSimpleBoxedB"
@@ -770,42 +724,6 @@ case.</doc>
           <type name="TestWi8021x" c:type="RegressTestWi8021x*"/>
         </return-value>
       </constructor>
-      <function name="get_testbool"
-                c:identifier="regress_test_wi_802_1x_get_testbool">
-        <return-value transfer-ownership="none">
-          <type name="gboolean" c:type="gboolean"/>
-        </return-value>
-        <parameters>
-          <parameter name="obj" transfer-ownership="none">
-            <type name="TestWi8021x" c:type="RegressTestWi8021x*"/>
-          </parameter>
-        </parameters>
-      </function>
-      <function name="set_testbool"
-                c:identifier="regress_test_wi_802_1x_set_testbool">
-        <return-value transfer-ownership="none">
-          <type name="none" c:type="void"/>
-        </return-value>
-        <parameters>
-          <parameter name="obj" transfer-ownership="none">
-            <type name="TestWi8021x" c:type="RegressTestWi8021x*"/>
-          </parameter>
-          <parameter name="v" transfer-ownership="none">
-            <type name="gboolean" c:type="gboolean"/>
-          </parameter>
-        </parameters>
-      </function>
-      <function name="static_method"
-                c:identifier="regress_test_wi_802_1x_static_method">
-        <return-value transfer-ownership="none">
-          <type name="gint" c:type="int"/>
-        </return-value>
-        <parameters>
-          <parameter name="x" transfer-ownership="none">
-            <type name="gint" c:type="int"/>
-          </parameter>
-        </parameters>
-      </function>
       <property name="testbool" writable="1" transfer-ownership="none">
         <type name="gboolean"/>
       </property>
@@ -1944,6 +1862,47 @@ call and can be released on return.</doc>
         </parameter>
       </parameters>
     </function>
+    <function name="test_obj_null_out"
+              c:identifier="regress_test_obj_null_out">
+      <return-value transfer-ownership="none">
+        <type name="none" c:type="void"/>
+      </return-value>
+      <parameters>
+        <parameter name="obj"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full"
+                   allow-none="1">
+          <doc xml:whitespace="preserve">A #RegressTestObj</doc>
+          <type name="TestObj" c:type="RegressTestObj**"/>
+        </parameter>
+      </parameters>
+    </function>
+    <function name="test_obj_static_method"
+              c:identifier="regress_test_obj_static_method">
+      <return-value transfer-ownership="none">
+        <type name="gdouble" c:type="double"/>
+      </return-value>
+      <parameters>
+        <parameter name="x" transfer-ownership="none">
+          <type name="gint" c:type="int"/>
+        </parameter>
+      </parameters>
+    </function>
+    <function name="test_obj_static_method_callback"
+              c:identifier="regress_test_obj_static_method_callback">
+      <return-value transfer-ownership="none">
+        <type name="none" c:type="void"/>
+      </return-value>
+      <parameters>
+        <parameter name="callback"
+                   transfer-ownership="none"
+                   allow-none="1"
+                   scope="call">
+          <type name="TestCallback" c:type="RegressTestCallback"/>
+        </parameter>
+      </parameters>
+    </function>
     <function name="test_short" c:identifier="regress_test_short">
       <return-value transfer-ownership="none">
         <type name="gshort" c:type="gshort"/>
@@ -1954,6 +1913,12 @@ call and can be released on return.</doc>
         </parameter>
       </parameters>
     </function>
+    <function name="test_simple_boxed_a_const_return"
+              c:identifier="regress_test_simple_boxed_a_const_return">
+      <return-value transfer-ownership="none">
+        <type name="TestSimpleBoxedA" c:type="RegressTestSimpleBoxedA*"/>
+      </return-value>
+    </function>
     <function name="test_simple_callback"
               c:identifier="regress_test_simple_callback">
       <return-value transfer-ownership="none">
@@ -2426,5 +2391,41 @@ call and can be released on return.</doc>
         </parameter>
       </parameters>
     </function>
+    <function name="test_wi_802_1x_get_testbool"
+              c:identifier="regress_test_wi_802_1x_get_testbool">
+      <return-value transfer-ownership="none">
+        <type name="gboolean" c:type="gboolean"/>
+      </return-value>
+      <parameters>
+        <parameter name="obj" transfer-ownership="none">
+          <type name="TestWi8021x" c:type="RegressTestWi8021x*"/>
+        </parameter>
+      </parameters>
+    </function>
+    <function name="test_wi_802_1x_set_testbool"
+              c:identifier="regress_test_wi_802_1x_set_testbool">
+      <return-value transfer-ownership="none">
+        <type name="none" c:type="void"/>
+      </return-value>
+      <parameters>
+        <parameter name="obj" transfer-ownership="none">
+          <type name="TestWi8021x" c:type="RegressTestWi8021x*"/>
+        </parameter>
+        <parameter name="v" transfer-ownership="none">
+          <type name="gboolean" c:type="gboolean"/>
+        </parameter>
+      </parameters>
+    </function>
+    <function name="test_wi_802_1x_static_method"
+              c:identifier="regress_test_wi_802_1x_static_method">
+      <return-value transfer-ownership="none">
+        <type name="gint" c:type="int"/>
+      </return-value>
+      <parameters>
+        <parameter name="x" transfer-ownership="none">
+          <type name="gint" c:type="int"/>
+        </parameter>
+      </parameters>
+    </function>
   </namespace>
 </repository>



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