Re: [Vala] using a non-glib c library

2009-09-26 Thread Mr. Maxwell .
One more thing, a lot of the functions return C style strings, (char *) are they the same as vala strings? (so I can replace char * with string?) Yes, string in vala corresponds to char * in C. You will just have to find out which strings you have to free and which not and mark the later

Re: [Vala] GStreamer Gst.Pad

2009-09-26 Thread Jan Hudec
On Sat, Sep 26, 2009 at 08:51:17 +, John - wrote: Hi, I am doing some test with GStreamer and Vala. In other program language, i usually use Gst.Pad.add_buffer_probe method but in Vala i don't know how to use it. I try to do : Pad.add_buffer_probe.connect(test_buffer());

[Vala] GStreamer Gst.Pad

2009-09-26 Thread John -
Hi, I am doing some test with GStreamer and Vala. In other program language, i usually use Gst.Pad.add_buffer_probe method but in Vala i don't know how to use it. I try to do : Pad.add_buffer_probe.connect(test_buffer()); I get : The name `connect' does not exist in the context of

[Vala] Gee and sorting?

2009-09-26 Thread Magnus Therning
The collection types in Gee are really useful, but the list types seem to be missing a sorting function. Is that deliberate, because it should be done in some other way, an oversight, or simply something that still is TBD? /M -- Magnus Therning(OpenPGP: 0xAB4DFBA4)

[Vala] Sorting a GLib.Liststring

2009-09-26 Thread Magnus Therning
What function should I use to sort a list of strings to avoid the compiler warning I get with strcmp: ... my_list.sort( strcmp ); ... Test.vala:60: warning: passing argument 2 of ‘g_list_sort’ from incompatible pointer type /usr/include/glib-2.0/glib/glist.h:101: note: expected

Re: [Vala] Final / Sealed classes in Vala

2009-09-26 Thread Phil Housley
2009/9/26 Michael B. Trausch m...@zest.trausch.us: The idea of a sealed/final class can be used to mean a few things: ... --- Mike I agree with everything Mike said there, so no need to repeat it, I just want to add a real example. I work a lot with a Java web framework called

Re: [Vala] Sorting a GLib.Liststring

2009-09-26 Thread Didier 'Ptitjes'
Hi Magnus, Magnus Therning wrote: What function should I use to sort a list of strings to avoid the compiler warning I get with strcmp: ... my_list.sort( strcmp ); ... Test.vala:60: warning: passing argument 2 of ‘g_list_sort’ from incompatible pointer type

Re: [Vala] GStreamer Gst.Pad

2009-09-26 Thread John -
I try with : Pad.add_buffer_probe(this.test_buffer); public bool test_buffer (Pad pad, Buffer buffer) {} And I get : expected ‘GCallback’ but argument is of type ‘gboolean (*)(struct GstPad *, struct GstBuffer *, void *)’] Hi, I am doing some test with GStreamer and Vala.

[Vala] [PATCH 0/2] Improve generation of async methods and implicit parameters to .gir

2009-09-26 Thread Jan Hudec
These two patches are needed to make .gir with async methods usable. The first causes async methods to be generated as pair of begin and end method and the second fixes generation of callback arguments. It also fixes generation of array parameters with length. Without these two patches, attempt

[Vala] [PATCH 1/2] Fix .gir generation for async methods.

2009-09-26 Thread Jan Hudec
GObject-Introspection does not have any special support for async methods, so we need to write them out as two entries corresponding to the .begin and .end submethods respectively. To avoid code duplication, the Vala.GirWriter.write_signature method is split in two. The inner one takes all

Re: [Vala] ListStore and SQLite

2009-09-26 Thread Nicolas
You mean, like libgda[1]? I don't think there are vala bindings for it already, but it shouldn't be too difficult to do since it's a gobject based library. Hi, For libgda, take a look at: https://bugzilla.gnome.org/show_bug.cgi?id=570372 Nicolas.

Re: [Vala] Final / Sealed classes in Vala

2009-09-26 Thread Michael B. Trausch
On Fri, 2009-09-25 at 20:52 +0200, Jan Hudec wrote: But in the end it comes down to language design and in vala's case, enforcing compile time errors instead of deferring critical errors and misbehavior at runtime. (just like abstract classes are not instantiatable, even if they don't

[Vala] [PATCH 2/2 v2] Fix generation of array and delegate parameters to .gir.

2009-09-26 Thread Jan Hudec
Array and delegate parameters correspond to multiple parameters at the C level. GObject-introspection expects them them to be written separately, with special attributes refering to the main ones. Since implicit output arguments must be generated for return values, writing params and return

Re: [Vala] Sorting a GLib.Liststring

2009-09-26 Thread Julian Andres Klode
On Sat, Sep 26, 2009 at 05:36:54PM +0200, Didier 'Ptitjes' wrote: Hi Magnus, Magnus Therning wrote: What function should I use to sort a list of strings to avoid the compiler warning I get with strcmp: ... my_list.sort( strcmp ); ... Test.vala:60: warning: passing argument 2 of

Re: [Vala] using a non-glib c library

2009-09-26 Thread Jan Hudec
On Sat, Sep 26, 2009 at 11:42:01 -0500, Mr. Maxwell . wrote: One more thing, a lot of the functions return C style strings, (char *) are they the same as vala strings? (so I can replace char * with string?) Yes, string in vala corresponds to char * in C. You will just have to find

Re: [Vala] GStreamer Gst.Pad

2009-09-26 Thread Jan Hudec
On Sat, Sep 26, 2009 at 15:11:29 +, John - wrote: I try with : Pad.add_buffer_probe(this.test_buffer); public bool test_buffer (Pad pad, Buffer buffer) {} And I get : expected ‘GCallback’ but argument is of type ‘gboolean (*)(struct GstPad *, struct GstBuffer *, void *)’]

[Vala] Why not use g_strcmp0 instead of a custom _vala_strcmp0?

2009-09-26 Thread Julian Andres Klode
Hi, Vala currently writes a _vala_strcmp0 into almost every C file. This function is exactly the same as glib's g_strcmp0. Wouldn't it be better to use g_strcmp0 instead? Regards, Julian -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and

Re: [Vala] Why not use g_strcmp0 instead of a custom _vala_strcmp0?

2009-09-26 Thread Jürg Billeter
On Sat, 2009-09-26 at 20:47 +0200, Julian Andres Klode wrote: Vala currently writes a _vala_strcmp0 into almost every C file. This function is exactly the same as glib's g_strcmp0. Wouldn't it be better to use g_strcmp0 instead? g_strcmp0 is available since GLib 2.16, however, Vala currently