Re: [Vala] Problem with notifications

2008-06-04 Thread Juerg Billeter
On Wed, June 4, 2008 13:12, Maciej Piechotka wrote: > I have a read-only property. However in some cases it is changed within > the class (by _property). How to send notification about it? > To call notify I have to get ParamSpec which I can receive by > find_property > to which I need to access Ob

Re: [Vala] How to keep an object alive if it's going out of scope

2008-06-02 Thread Juerg Billeter
Hi Jaap, On Mon, June 2, 2008 08:16, Jaap A. Haitsma wrote: > I'm working on porting cheese to vala. I'm running into a problem when > trying to convert gst-audio-play.c [1] to vala. > > The gst-audio-play has a function play_file and what it does is the > following in semi vala code > > public st

Re: [Vala] private fields vs bodyless properties

2008-05-30 Thread Juerg Billeter
On Fri, May 30, 2008 10:28, Yu Feng wrote: > On Fri, 2008-05-30 at 06:57 +0200, Jaap A. Haitsma wrote: >> The reason for this is that the objects are gobjects and these are >> created by a g_object_new call [1]. That function can only set >> properties. So you need to have a property if you want to

Re: [Vala] private fields vs bodyless properties

2008-05-30 Thread Juerg Billeter
Hi Hans, On Fri, May 30, 2008 02:05, Hans Vercammen wrote: > The strange thing is, that whenever "private int foo { get; set; }" is > used as an rvalue it translates to something like self->priv->_foo, but > when I use it as an lvalue the setter method gets invoked, which can > cause overhead in s

Re: [Vala] Check if pointer is null

2008-05-07 Thread Juerg Billeter
On Wed, May 7, 2008 09:38, Frederik wrote: > How do I check if a pointer is null? > > pointer my_pointer = null; > if (null == my_pointer) { > GLib.print("pointer is null\n"); > } Don't use `pointer', it has been replaced by native pointer support some time ago and

Re: [Vala] Setting property doesn't emit notify signal

2008-04-30 Thread Juerg Billeter
On Tue, April 29, 2008 23:13, Yu Feng wrote: > > vala will translate setting property: > --- > a.prop = "value" > > to > --- > class_a_set_prop (a, "value"); > --- > and this won't emit a notify signal, because the signal is only emitted > by g_object_set. > > However, if I want to catch the s

Re: [Vala] How to call a gst_object_ref in vala?

2008-04-28 Thread Juerg Billeter
On Mon, April 28, 2008 16:31, Jaap A. Haitsma wrote: > I'm rewriting cheese [1] in vala and I have video and a photo sink and > I need to switch between the two, but I don't want to rebuild them all > the time whenever I switch > > So what I want is when a users switches from photo to video mode >

Re: [Vala] Improving Vala DBus

2008-04-28 Thread Juerg Billeter
Hi Yu, On Mon, April 28, 2008 06:34, Yu Feng wrote: > I would like to help on improving Vala's DBus Service supporting(Because > I am using vala to write a DBus service). > > Where can I find the existed direction/plan for it, if there is any? There is no detailed D-Bus roadmap for Vala at the mo

Re: [Vala] ABI stable code?

2008-04-28 Thread Juerg Billeter
On Sat, April 26, 2008 14:15, David Keijser wrote: > 2008/4/26 Daniel Svensson <[EMAIL PROTECTED]>: >> 2008/4/26 Mikkel Kamstrup Erlandsen <[EMAIL PROTECTED]>: >> >> > I am wondering if it is possible to write a lib in Vala that can be >> ABI >> > stable... Both varying (ABI stable) code changes,

Re: [Vala] libgee and non-null types

2008-04-28 Thread Juerg Billeter
On Fri, April 25, 2008 11:41, Ed Schouten wrote: > Hello Jurg, > > * Jürg Billeter <[EMAIL PROTECTED]> wrote: >> [...] >> >> Changes since 0.2.0 >> * Enable non-null types by default. > > Yesterday I updated the MacPort for Vala to 0.3.1. I also wanted to add > a libgee port, but it turns out libg

Re: [Vala] Some problems with migration to Vala 0.3.1

2008-04-28 Thread Juerg Billeter
On Thu, April 24, 2008 20:40, gege2061 wrote: > Second, with length function : > > Xml.NodeSet* node = ...; > > nodes->length (); > > > i

Re: [Vala] Some basic problems with gstreamer

2008-04-28 Thread Juerg Billeter
On Wed, April 23, 2008 15:47, Klaus Rotter wrote: > Phil Housley wrote: >> Vala will use the data argument of a callback registering function to >> pass a "this" pointer, it's that which allows you to use an instance >> method as a callback. If you run valac with the --save-temps argument >> you c

Re: [Vala] Hackers' Guide to Vala

2008-04-28 Thread Juerg Billeter
On Mon, April 21, 2008 20:05, Rodney Lorrimar wrote: > As I have been browsing through the Vala code, I have started writing > a document about various aspects of Vala that would be interesting for > developers who would like to make their own changes. > > http://rodney.id.au/dev/vala/hackers.html

Re: [Vala] Action signals

2008-04-28 Thread Juerg Billeter
On Wed, April 23, 2008 00:28, Andrea Bolognani wrote: > On Mon, 21 Apr 2008 23:07:29 +0200 > Andrea Bolognani <[EMAIL PROTECTED]> wrote: > >> Is there any way to declare a signal as an action signal? I grep'd a bit >> around the valac source code but I couldn't find anything. Not yet, feel free to

Re: [Vala] Language Documentation

2008-04-28 Thread Juerg Billeter
On Mon, April 21, 2008 20:14, Rodney Lorrimar wrote: > Regarding the language documentation planned for 0.3.2 (12th May), has > anyone volunteered for this? Or is it something you have some good > ideas for and would like to write yourself? I certainly accept patches :-) I write myself what nobody

Re: [Vala] How to call a gst_object_ref in vala?

2008-04-28 Thread Juerg Billeter
On Mon, April 28, 2008 15:43, Jaap A. Haitsma wrote: > On Mon, Apr 28, 2008 at 1:44 PM, Juerg Billeter <[EMAIL PROTECTED]> wrote: >> On Mon, April 28, 2008 12:55, Jaap A. Haitsma wrote: >> > I want to use a gst_bin_remove function [1], but I want the Element >> >

Re: [Vala] Difference between Gee.List and ArrayList

2008-04-28 Thread Juerg Billeter
On Mon, April 21, 2008 22:11, Jaap A. Haitsma wrote: > On Mon, Apr 21, 2008 at 8:17 AM, Jürg Billeter <[EMAIL PROTECTED]> wrote: >> On Mon, 2008-04-21 at 07:43 +0200, Jaap A. Haitsma wrote: >> > However when I change "Gee.List list = new ArrayList ();" to >> > "var list = new ArrayList ();" it do

Re: [Vala] direct field access when field not documented?

2008-04-28 Thread Juerg Billeter
On Mon, April 7, 2008 22:35, Vlad Grecescu wrote: > Question: aren't these direct field access supposed to be deprecated in > Gtk? > (at least that field didn't show up in the docs) > How can one change the vapi binding to call set_sort_column_id on setting > the sort_column_id property, given that

Re: [Vala] sorting an array

2008-04-28 Thread Juerg Billeter
On Fri, April 4, 2008 08:04, Michael Lawrence wrote: > What is the idiom for sorting an array in Vala? > > There does not appear to be any qsort binding (though one could easily be > added to e.g. glib.vapi). I looked at GLib.Array but that's not really > usable since there is no way to retrieve va

Re: [Vala] Signal problem

2008-04-28 Thread Juerg Billeter
On Thu, April 3, 2008 16:19, Andreas Sliwka wrote: > I'd like to create a Gtk widget that is pluggable into a > GtkScrolledWindow. For that it has to have a handler for the > gtk_widget_set_scroll_adjustments signal, and there lies my problem. > > GtkWidget (according to gth gtk+-2.0.vapi file,

Re: [Vala] How to call a gst_object_ref in vala?

2008-04-28 Thread Juerg Billeter
On Mon, April 28, 2008 12:55, Jaap A. Haitsma wrote: > I want to use a gst_bin_remove function [1], but I want the Element > that is removes not to be freed. For that I need to call > gst_object_ref before gst_bin_remove (See also [1]). How do I call > gst_object_ref in vala? This essentially mean

Re: [Vala] How to write a string to an IOChannel

2008-04-28 Thread Juerg Billeter
On Mon, April 28, 2008 10:15, Frederik wrote: > I would like to write a string to a GLib IOChannel (a file), but > IOChannel.write_chars() wants a char[] as argument. We should probably add a get_bytes() or get_utf8_bytes() method to the string class that returns the UTF-8 bytes. Not sure whether

Re: [Vala] protected classes

2008-04-02 Thread Juerg Billeter
On Wed, April 2, 2008 14:46, Vlad Grecescu wrote: > Juerg Billeter wrote: >> On Tue, March 4, 2008 17:16, Vlad Grecescu wrote: >> >>> Currently Vala uses >>> - 'public' classes for classes that end up in the headers /and/ in the >>> library

Re: [Vala] [PATCH] gtk_action_group_add_*_actions add user_data

2008-04-02 Thread Juerg Billeter
On Wed, April 2, 2008 08:37, Jaap A. Haitsma wrote: > I've just discovered a bug with the action entries. The signature of > the callbacks is always like > static void sample_on_about (Sample* self, GtkAction* action) > while it needs to be > static void sample_on_about (GtkAction* action, Sample*

Re: [Vala] [PATCH] gtk_action_group_add_*_actions add user_data

2008-04-02 Thread Juerg Billeter
On Wed, April 2, 2008 07:34, Jaap A. Haitsma wrote: > I've ran into an issue when using ActionGroup.add_toggle_actions or > ActionGroup.add_radio_actions. The field user_data is not being set by > the vala compiler so the C compiler complains. Attached patch should > resolve this I think. In my opi

Re: [Vala] Is there a reason why I can't define a const variable in a method?

2008-04-02 Thread Juerg Billeter
On Mon, March 31, 2008 03:02, Jaap A. Haitsma wrote: > Having a const variable inside a method gives a compiler error. Is > this intentional or just a missing feature from the compiler? That's just not implemented right now. I don't really see a reason to not support method-private constants. We s

Re: [Vala] Critical error of valac when using ActionEntry

2008-04-02 Thread Juerg Billeter
On Mon, March 31, 2008 02:24, Jaap A. Haitsma wrote: > Hi, > > When I compile attached sample program, vala gives the following error > > ** (valac:23138): CRITICAL **: vala_data_type_get_transfers_ownership: > assertion `VALA_IS_DATA_TYPE (self)' failed I'll look into it, thanks for the report.

Re: [Vala] Problem adding gstreamer option group to context?

2008-04-02 Thread Juerg Billeter
On Sun, March 30, 2008 21:56, Jaap A. Haitsma wrote: > On Sun, Mar 30, 2008 at 7:47 PM, Sandino Flores Moreno <[EMAIL PROTECTED]> > wrote: >> This line is wrong: >> >> context.add_group (Gst.init_get_option_group ()); >> >> It should be replaced as follows: >> weak GLib.OptionGroup gst_opt

Re: [Vala] dbus question

2008-04-02 Thread Juerg Billeter
On Sat, March 29, 2008 10:34, Zsombor wrote: > I'm trying to call some dbus methods, but I'm confused with the syntax > little bit. One of the dbus method returns an array of string, the other > returns an array of string tuples, the dbus types are : 'as' and 'a(ss)'. > How can I call this methods?

Re: [Vala] Gee tests and extension proposal

2008-04-02 Thread Juerg Billeter
On Mon, March 24, 2008 00:52, Quikee wrote: > I have extended the tests in Gee library. Now they cover all methods > provided by the interfaces they extend so that future changes to the > library can be done without fear to break the behavior of those > methods. The extended tests are attached to t

Re: [Vala] Some basic questions

2008-04-02 Thread Juerg Billeter
On Sat, March 22, 2008 20:06, Mikael Hermansson wrote: > 1: > > If I want a copy of Gtk.TreePath I have to use weak but the problem is > howto free it after use? That's a bug in the bindings, copy should obviously not return a weak reference. > 2: > > Another problem probadly a binding bug: > > w

Re: [Vala] idea: do later w/ g_idle_add

2008-04-02 Thread Juerg Billeter
On Tue, March 18, 2008 12:22, Vlad Grecescu wrote: > While reading through JavaFX's docs, i kind of liked the idea of > > do later { > > } > > (here's the link: > https://openjfx.dev.java.net/JavaFX_Programming_Language.html#do_later) > > I suppose java.awt.EventQueue.invokeLater functiona

Re: [Vala] [long][libgee] TreeSet support

2008-04-02 Thread Juerg Billeter
On Thu, March 13, 2008 22:48, Maciej Piechotka wrote: > Although the Hashtables are very common and efficient way of storing sets > and maps it is not always the case since: > 1. We do intensive inserting/removing which is usually ineffitient in the > hashtables (at least it was a case in GLib impl

Re: [Vala] default-property-value syntax

2008-04-02 Thread Juerg Billeter
On Thu, March 6, 2008 00:36, Florian Brosch wrote: > A new feature of valac 0.1.8 is a way to set the default-value of a > property: > > public int rank { > construct set; > private get; > default ( 5 ); > } > > > We talked about the syntax in #vala. Chipzz and I think that following > looks

Re: [Vala] protected classes

2008-04-02 Thread Juerg Billeter
On Tue, March 4, 2008 17:16, Vlad Grecescu wrote: > Currently Vala uses > - 'public' classes for classes that end up in the headers /and/ in the > library (if you're building one) > - 'private' classes for classes that don't end up in neither headers > /nor/ in the created libraries. The idea is t