summaryrefslogtreecommitdiff
path: root/gir
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-03-09 12:28:22 -0300
committerJohan Dahlin <johan@gnome.org>2010-03-09 12:29:00 -0300
commitab2da23f4793016bfe4b2b327ddf6e10a94ea907 (patch)
tree95a8caa36cc4d30503d6ecc591c4d90d9788e1c1 /gir
parent54434e0cd9fae1cd8f9c03538629a97ad6fdde67 (diff)
downloadgobject-introspection-ab2da23f4793016bfe4b2b327ddf6e10a94ea907.tar.gz
[everything] Add alternative boxed constructors
Diffstat (limited to 'gir')
-rw-r--r--gir/Everything-1.0-expected.gir36
-rw-r--r--gir/everything.c34
-rw-r--r--gir/everything.h4
3 files changed, 74 insertions, 0 deletions
diff --git a/gir/Everything-1.0-expected.gir b/gir/Everything-1.0-expected.gir
index 6bf6c8b7..a284c44d 100644
--- a/gir/Everything-1.0-expected.gir
+++ b/gir/Everything-1.0-expected.gir
@@ -31,6 +31,42 @@ and/or use gtk-doc annotations. -->
<type name="TestBoxed" c:type="TestBoxed*"/>
</return-value>
</constructor>
+ <constructor name="new_alternative_constructor1"
+ c:identifier="test_boxed_new_alternative_constructor1">
+ <return-value transfer-ownership="full">
+ <type name="TestBoxed" c:type="TestBoxed*"/>
+ </return-value>
+ <parameters>
+ <parameter name="i" transfer-ownership="none">
+ <type name="int" c:type="int"/>
+ </parameter>
+ </parameters>
+ </constructor>
+ <constructor name="new_alternative_constructor2"
+ c:identifier="test_boxed_new_alternative_constructor2">
+ <return-value transfer-ownership="full">
+ <type name="TestBoxed" c:type="TestBoxed*"/>
+ </return-value>
+ <parameters>
+ <parameter name="i" transfer-ownership="none">
+ <type name="int" c:type="int"/>
+ </parameter>
+ <parameter name="j" transfer-ownership="none">
+ <type name="int" c:type="int"/>
+ </parameter>
+ </parameters>
+ </constructor>
+ <constructor name="new_alternative_constructor3"
+ c:identifier="test_boxed_new_alternative_constructor3">
+ <return-value transfer-ownership="full">
+ <type name="TestBoxed" c:type="TestBoxed*"/>
+ </return-value>
+ <parameters>
+ <parameter name="s" transfer-ownership="full">
+ <type name="utf8" c:type="char*"/>
+ </parameter>
+ </parameters>
+ </constructor>
<method name="copy" c:identifier="test_boxed_copy">
<return-value transfer-ownership="full">
<type name="TestBoxed" c:type="TestBoxed*"/>
diff --git a/gir/everything.c b/gir/everything.c
index 67960889..3957d06d 100644
--- a/gir/everything.c
+++ b/gir/everything.c
@@ -1,4 +1,5 @@
#include <string.h>
+#include <stdlib.h>
#include "everything.h"
#include <gio/gio.h>
@@ -1257,6 +1258,39 @@ test_boxed_new (void)
}
TestBoxed *
+test_boxed_new_alternative_constructor1 (int i)
+{
+ TestBoxed *boxed = g_slice_new0(TestBoxed);
+ boxed->priv = g_slice_new0(TestBoxedPrivate);
+ boxed->priv->magic = 0xdeadbeef;
+ boxed->some_int8 = i;
+
+ return boxed;
+}
+
+TestBoxed *
+test_boxed_new_alternative_constructor2 (int i, int j)
+{
+ TestBoxed *boxed = g_slice_new0(TestBoxed);
+ boxed->priv = g_slice_new0(TestBoxedPrivate);
+ boxed->priv->magic = 0xdeadbeef;
+ boxed->some_int8 = i + j;
+
+ return boxed;
+}
+
+TestBoxed *
+test_boxed_new_alternative_constructor3 (char *s)
+{
+ TestBoxed *boxed = g_slice_new0(TestBoxed);
+ boxed->priv = g_slice_new0(TestBoxedPrivate);
+ boxed->priv->magic = 0xdeadbeef;
+ boxed->some_int8 = atoi(s);
+
+ return boxed;
+}
+
+TestBoxed *
test_boxed_copy (TestBoxed *boxed)
{
TestBoxed *new_boxed = test_boxed_new();
diff --git a/gir/everything.h b/gir/everything.h
index be4f6c6f..04c27d70 100644
--- a/gir/everything.h
+++ b/gir/everything.h
@@ -216,6 +216,10 @@ struct _TestBoxed
GType test_boxed_get_type (void);
TestBoxed *test_boxed_new (void);
+TestBoxed *test_boxed_new_alternative_constructor1 (int i);
+TestBoxed *test_boxed_new_alternative_constructor2 (int i, int j);
+TestBoxed *test_boxed_new_alternative_constructor3 (char *s);
+
TestBoxed *test_boxed_copy (TestBoxed *boxed);
gboolean test_boxed_equals (TestBoxed *boxed,
TestBoxed *other);