Author: johan
Date: Sun Feb 10 22:14:25 2008
New Revision: 112
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=112&view=rev

Log:
2008-02-10  Johan Dahlin  <[EMAIL PROTECTED]>

        * tests/parser/Foo-expected.gidl:
        * tests/parser/foo-object.h:
        * tests/parser/foo.c: (foo_boxed_copy), (foo_boxed_free),
        (foo_boxed_get_type), (foo_boxed_new), (foo_boxed_method):
        Add boxed test.



Modified:
   trunk/ChangeLog
   trunk/tests/parser/Foo-expected.gidl
   trunk/tests/parser/foo-object.h
   trunk/tests/parser/foo.c

Modified: trunk/tests/parser/Foo-expected.gidl
==============================================================================
--- trunk/tests/parser/Foo-expected.gidl        (original)
+++ trunk/tests/parser/Foo-expected.gidl        Sun Feb 10 22:14:25 2008
@@ -4,6 +4,17 @@
                <function name="init" symbol="foo_init" deprecated="1">
                        <return-type type="gint"/>
                </function>
+               <boxed name="FooBoxed" type-name="FooBoxed" 
get-type="foo_boxed_get_type">
+                       <method name="method" symbol="foo_boxed_method">
+                               <return-type type="void"/>
+                               <parameters>
+                                       <parameter name="boxed" 
type="FooBoxed*"/>
+                               </parameters>
+                       </method>
+                       <constructor name="new" symbol="foo_boxed_new">
+                               <return-type type="FooBoxed*"/>
+                       </constructor>
+               </boxed>
                <enum name="FooEnumType">
                        <member name="FOO_ENUM_ALPHA" value="0"/>
                        <member name="FOO_ENUM_BETA" value="1"/>

Modified: trunk/tests/parser/foo-object.h
==============================================================================
--- trunk/tests/parser/foo-object.h     (original)
+++ trunk/tests/parser/foo-object.h     Sun Feb 10 22:14:25 2008
@@ -79,6 +79,12 @@
 
 GType foo_flags_get_type (void);
 
+typedef struct _FooBoxed FooBoxed;
+
+GType                 foo_boxed_get_type       (void) G_GNUC_CONST;
+FooBoxed*             foo_boxed_new            (void);
+void                  foo_boxed_method         (FooBoxed* boxed);
+
 /* Invalid comments, should be ignored */
 
 /* @ */

Modified: trunk/tests/parser/foo.c
==============================================================================
--- trunk/tests/parser/foo.c    (original)
+++ trunk/tests/parser/foo.c    Sun Feb 10 22:14:25 2008
@@ -95,3 +95,45 @@
     return etype;
 }
 
+struct _FooBoxed
+{
+  int private;
+};
+
+
+FooBoxed *
+foo_boxed_copy (const FooBoxed *boxed)
+{
+  return (FooBoxed *)g_memdup (boxed, sizeof (FooBoxed));
+}
+
+void
+foo_boxed_free (FooBoxed *boxed)
+{
+  g_slice_free (FooBoxed, boxed);
+}
+
+
+GType
+foo_boxed_get_type (void)
+{
+  static GType our_type = 0;
+  
+  if (our_type == 0)
+    our_type = g_boxed_type_register_static ("FooBoxed",
+                                            (GBoxedCopyFunc) foo_boxed_copy,
+                                            (GBoxedFreeFunc) foo_boxed_free);
+  return our_type;
+}
+
+FooBoxed *
+foo_boxed_new (void)
+{
+  return g_slice_new0 (FooBoxed);
+}
+
+void
+foo_boxed_method (FooBoxed *boxed)
+{
+
+}
_______________________________________________
SVN-commits-list mailing list (read only)
http://mail.gnome.org/mailman/listinfo/svn-commits-list

Want to limit the commits to a few modules? Go to above URL, log in to edit 
your options and select the modules ('topics') you want.
Module maintainer? It is possible to set the reply-to to your development 
mailing list. Email [EMAIL PROTECTED] if interested.

Reply via email to