Re: [Vala] canberra.vapi



Hi,

just mark them as out parameters, and the destroy() functions are free
functions:

 [Compact]
 [CCode (cname = "ca_proplist", free_function = "ca_proplist_destroy")]
 public class Proplist {
     public static int create( out Proplist p );
 //  public Error destroy();   // not needed anymore
 // ...
 }

 [Compact]
 [CCode (cname = "ca_context", free_function = "ca_context_destroy")]
 public class Context {
     public static Error create( out Context context );
 //  public Error destroy();   // not needed anymore
 // ...
 }


Usage:

 Canberra.Context c;
 Canberra.Context.create (out c);

Thanks, that's slightly better, still I'd love to have a classical constructor 
way of creating a context, like:

var c = new Canberra.Context();

Is this impossible without changes in the library itself?

Cheers,

:M:




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