Dimitri Jakov | 1 Mar 2012 03:14

[Vala] Avant Window Navigator

Hi,

I am trying to fix Avant Window Navigator so that it builds with recent
Vala. Here you can see an excerpt from the build log:
http://pastebin.com/ni4whHBp

That "DBus.BusName sender" errors seem to be trivial to fix, we'll only
need to make "sender" the last argument, not the first one (right?)

But what's about "GVariant serialization of GLib.Value" - the only
solution I've come up with is to port both servant (Vala) and its
clients (C) to [G]Variant instead of [G]Values. I'll appreciate any
helpful information on this issue.

Thank you!
Dimitri
Luca Bruno | 1 Mar 2012 12:02
Picon
Gravatar

Re: [Vala] Avant Window Navigator

On Thu, Mar 1, 2012 at 3:14 AM, Dimitri Jakov <mitya@...> wrote:

> Hi,
>
> I am trying to fix Avant Window Navigator so that it builds with recent
> Vala. Here you can see an excerpt from the build log:
> http://pastebin.com/ni4whHBp
>
> That "DBus.BusName sender" errors seem to be trivial to fix, we'll only
> need to make "sender" the last argument, not the first one (right?)
>
> But what's about "GVariant serialization of GLib.Value" - the only
> solution I've come up with is to port both servant (Vala) and its
> clients (C) to [G]Variant instead of [G]Values. I'll appreciate any
> helpful information on this issue.
>

Yes, try with Variant.

--

-- 
www.debian.org - The Universal Operating System
_______________________________________________
vala-list mailing list
vala-list@...
http://mail.gnome.org/mailman/listinfo/vala-list
Luca Bruno | 1 Mar 2012 12:59
Picon
Gravatar

Re: [Vala] Thread error 'assignment makes pointer from integer without a cast'

On Tue, Feb 28, 2012 at 10:52 PM, David M <dmlh02@...> wrote:

> Following upgrading to Vala verion 0.15.2, I get the warning
> 'GLib.Thread.create
> has been deprecated since 2.32. Use new Thread<T> ()'. So I did as it
> suggested,
> but then I get the errors as follows:
>
> In function ?thread_demo_main?:
> warning: assignment makes pointer from integer without a cast [enabled by
> default]
> undefined reference to `g_thread_new'
> undefined reference to `g_thread_free'
>
> Is this a bug in Vala or am I phrasing the call incorrectly?
>

You don't have recent glib. Just stick with the old code until you upgrade
it.

--

-- 
www.debian.org - The Universal Operating System
_______________________________________________
vala-list mailing list
vala-list@...
http://mail.gnome.org/mailman/listinfo/vala-list
David López González | 1 Mar 2012 17:14

[Vala] Generate the .vapi for libmodbus

Hi,

I'm trying to generate the .vapi file for one of the latest versions of 
libmodbus (3.0.2).
I'm using the following commands to get the vapi file:
   vala-gen-introspect modbus modbus
   vapigen --library modbus modbus/modbus.gi

And the output for the second one is:
   modbus.gi:0.0-0.0: error: construction methods may only be declared 
within classes and structs
   modbus.gi:0.0-0.0: error: construction methods may only be declared 
within classes and structs
   modbus.gi:0.0-0.0: error: construction methods may only be declared 
within classes and structs
   Generation failed: 3 error(s), 0 warning(s)

I've noticed that the problem is because there are three functions in 
the modbus.gi file starting with the word "new".
I've modified the libmodus code to change the word "new" in the three 
functions.
After changing the code, I successfully generated the .vapi file with 
the two commands.

The problem is that I don't want to change the libmodbus code to 
generate the .vapi file.
There is any way to avoid the vapigen errors without changing the 
libmodbus source code?
I'll appreciate any helpful information on this issue.

(Continue reading)

David M | 2 Mar 2012 13:24
Picon

Re: [Vala] Thread error 'assignment makes pointer from integer without a cast'

Thanks a lot Jens and Luca for your help with this - much appreciated.
Chris Elston | 5 Mar 2012 15:12

[Vala] Help me find the right Vala idiom

Hello list,

I have a pattern I commonly use in C which I've so far failed to
translate to an equivalent Vala or indeed OO equivalent.  I was hoping
that those more used to thinking in such terms would be able to point me
in the right direction.

Attached is a C file which (dumbly) parses a config file with entries of
the format:

	key=value

Where a given key is uniquely associated with a particular type of data
(string, int etc...)

My aim is to parse the config file data into appropriately typed
variables, but to do so using a table based lookup on the key to find
the appropriate function to parse the data and the address of the
location to place the data.

Hopefully the C is clear enough, I apologise for posting C to this list,
but I'm not confident enough of my terminology to communicate the ideas
in Vala.

I'm looking to produce a Vala class which is able to parse <some text
data> into it's own member variables, based on a table lookup. The
important bit for me isn't the parsing, it's the lookup from key to
parse function and destination for the data.

Suggestions gratefully received!
(Continue reading)

Chris Elston | 5 Mar 2012 15:39

Re: [Vala] Help me find the right Vala idiom

Hi Jan,

I am indeed using KeyFile for the key/value parsing in my
work-in-progress Vala code - I'd like to take the parsed values out of
the KeyFile object and make them members of my own configuration class.

I suspect I *could* make it work leaving the values in the KeyFile, but
I'd like to be able to do things like compare instances of my
configuration class, which I think might be easier if the values were
real members of the class in question.

The important bit to me isn't really the parsing of the data, what I
seek is the flexible table based method of making that data into member
variables of the class.

Cheers,

Chris.

On Mon, 2012-03-05 at 15:29 +0100, Jan Spurný wrote:
> Hi,
> 
> I'm not sure if that's what you need - but since vala uses glib internaly (of course unless you use that new
profile..), why don't you just use this: http://valadoc.org/glib-2.0/GLib.KeyFile.html ?
> 
> I use it a lot when I need just a couple of key=value items and when things get complicated, I go for JSON or XML.
> 
> Jan Spurny
> 
> > ------------ Původní zpráva ------------
(Continue reading)

Jan Spurný | 5 Mar 2012 15:29
Picon
Favicon

Re: [Vala] Help me find the right Vala idiom

Hi,

I'm not sure if that's what you need - but since vala uses glib internaly (of course unless you use that new
profile..), why don't you just use this: http://valadoc.org/glib-2.0/GLib.KeyFile.html ?

I use it a lot when I need just a couple of key=value items and when things get complicated, I go for JSON or XML.

Jan Spurny

> ------------ Původní zpráva ------------
> Od: Chris Elston <celston <at> katalix.com>
> Předmět: [Vala] Help me find the right Vala idiom
> Datum: 05.3.2012 15:22:04
> ----------------------------------------
> Hello list,
> 
> I have a pattern I commonly use in C which I've so far failed to
> translate to an equivalent Vala or indeed OO equivalent.  I was hoping
> that those more used to thinking in such terms would be able to point me
> in the right direction.
> 
> Attached is a C file which (dumbly) parses a config file with entries of
> the format:
> 
> 	key=value
> 
> Where a given key is uniquely associated with a particular type of data
> (string, int etc...)
> 
> My aim is to parse the config file data into appropriately typed
(Continue reading)

Thomas | 5 Mar 2012 21:12
Picon

[Vala] GStreamer signal connection in Vala

Hi,

I am new to Vala. I am trying to develop a simple application using
Gstreamer and Vala, but I fail with the connection of signlas defined
within the Gstreamer Element cairoooverlay
(http://developer.gnome.org/gst-plugins-libs/unstable/gst-plugins-good-plugins-cairooverlay.html).
What i am Trying to do ist the following:

this.pipeline =  (Pipeline)Gst.parse_launch("... cairooverlay
name=overlay ...");
...
Element ov = this.pipeline.get_by_name("overlay");
ov.connect("caps_changed", this.caps_changed_cb);

The code compiles fine, but I get the runtime warning and the signal
is not connected.

GLib-GObject-WARNING **: g_object_connect: invalid signal spec "caps_changed"

What is standard way to connect to this signal with a proper callback
in Vala? The function to connect the signal from C is
g_signal_connect.

Cheers
Thomas
Fabian Deutsch | 5 Mar 2012 21:19
Picon
Picon
Gravatar

Re: [Vala] GStreamer signal connection in Vala

Hi,

Am Montag, den 05.03.2012, 20:12 +0000 schrieb Thomas:
> I am new to Vala. I am trying to develop a simple application using
> Gstreamer and Vala, but I fail with the connection of signlas defined
> within the Gstreamer Element cairoooverlay
> (http://developer.gnome.org/gst-plugins-libs/unstable/gst-plugins-good-plugins-cairooverlay.html).
> What i am Trying to do ist the following:
> 
> this.pipeline =  (Pipeline)Gst.parse_launch("... cairooverlay
> name=overlay ...");
> ...
> Element ov = this.pipeline.get_by_name("overlay");
> ov.connect("caps_changed", this.caps_changed_cb);

Just one hint about Gstreamer Elements: Use Vala's dynamic keyword.
Using this keyword you can access properties and signals of the lements
without using the getters or connect methods.

dynamic Element ov = ...
ov.name = "overlay";
ov.caps_changed.connect (this.caps_changed_cb);

Sorry that I can't tell you the right sinal, but the docs might help you
here (or gst-inspect cairooverlay)

Greetings
fabian

> The code compiles fine, but I get the runtime warning and the signal
(Continue reading)


Gmane