[Vala] [PATCH] gobject-2.0: Bind g_object_newv



Signed-off-by: Jan Hudec <bulb ucw cz>
---

On Sun, Sep 13, 2009 at 20:47:22 +0200, Jürg Billeter wrote:
On Sun, 2009-09-13 at 16:35 +0200, Jan Hudec wrote:
I want to use the GParameter structure (GLib.Parameter in gobject-2.0.vapi).
However, vala requires a copy and destroy functions for it and none are
defined in the gobject header. I can define them (they are simple but not
empty), but how do I tell vala to actually generate them when it needs them?

I've just added two new boolean CCode attributes for structs,
has_copy_function and has_destroy_function, and fixed the GParameter
binding. This should fix the problem.

Thanks. It seems to indeed do the right thing.

Can you please add the binding for g_object_newv (GLib.Object.newv), as that
was the main reason to have GParameter working (it is the only public user in
gobject).

Regards,

Jan

 vapi/gobject-2.0.vapi |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/vapi/gobject-2.0.vapi b/vapi/gobject-2.0.vapi
index 983b567..252f355 100644
--- a/vapi/gobject-2.0.vapi
+++ b/vapi/gobject-2.0.vapi
@@ -184,6 +184,7 @@ namespace GLib {
 #if VALA_0_7_6_NEW_METHODS
                public static Object @new (Type type, ...);
 #endif
+               public static Object newv (Type type, [CCode (array_length_pos = 1.9)] Parameter[] 
parameters);
 
                [CCode (cname = "G_TYPE_FROM_INSTANCE")]
                public Type get_type ();
-- 
1.6.3.3




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