Re: [Vala] Thoughts on asynchronous methods

2009-09-16 Thread Jürg Billeter
On Wed, 2009-09-16 at 13:34 +1000, Magentus wrote: On Sun, 13 Sep 2009 17:40:33 +0200, Jürg Billeter j...@bitron.ch wrote: This should be `yield return i;'. We do not use/need `yield return' for async methods, and I'm planning to add support for `yield return' for generators in Vala the

[Vala] Getting/sending sequence of keyboard keys to/from active application

2009-09-16 Thread Arkadi Viner
Hello. I want to write a program which should record pressed sequences of keys and if it receives some shortcut key it will send delete key to erase wrong typed content, then it will convert from one language characters to an another (according to some translation map) and then send them again to

Re: [Vala] Getting/sending sequence of keyboard keys to/from active application

2009-09-16 Thread Jan Hudec
On Wed, Sep 16, 2009 at 10:29:02 +0300, Arkadi Viner wrote: Hello. I want to write a program which should record pressed sequences of keys and if it receives some shortcut key it will send delete key to erase wrong typed content, then it will convert from one language characters to an another

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Michael B. Trausch
Mr. Maxwell, sorry for the dupe. Forgot to cc the list. On Tue, 2009-09-15 at 17:14 -0500, Mr. Maxwell . wrote: What do I do with the typedef struct declarations? This is what I have but I don't think it's right. c code typedef struct { char _dummy; } ID3Tag; vala code

Re: [Vala] [PATCH 2/2] vapi/posix.vapi: Introduce ftruncate() and truncate().

2009-09-16 Thread Julian Andres Klode
On Sun, Aug 30, 2009 at 01:42:33PM +0200, Julian Andres Klode wrote: Signed-off-by: Julian Andres Klode j...@jak-linux.org --- vapi/posix.vapi |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/vapi/posix.vapi b/vapi/posix.vapi index cfc9bb3..0c4c0f8 100644 ---

Re: [Vala] [PATCH 2/2] vapi/posix.vapi: Introduce ftruncate() and truncate().

2009-09-16 Thread Jürg Billeter
On Wed, 2009-09-16 at 16:44 +0200, Julian Andres Klode wrote: There has been no answer to my 2 patches yet, so I ask again. Having mmap() and file truncation support is kind of needed for maintaining a binary cache on the disk. And writing a package manager[1] without such a cache would be

Re: [Vala] [PATCH 2/2] vapi/posix.vapi: Introduce ftruncate() and truncate().

2009-09-16 Thread Julian Andres Klode
On Wed, Sep 16, 2009 at 05:07:50PM +0200, Jürg Billeter wrote: On Sun, Aug 30, 2009 at 01:42:33PM +0200, Julian Andres Klode wrote: + [CCode (cheader_filename = unistd.h)] + public int truncate(const char *path, off_t length); I've changed this to `string path' and applied both patches,

[Vala] [PATCH] vapi/linux.vapi: Add mremap(2) call.

2009-09-16 Thread Julian Andres Klode
This is a Linux-specific enhancement to the mmap() function set implemented in posix.vapi. Signed-off-by: Julian Andres Klode j...@jak-linux.org --- vapi/linux.vapi | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/vapi/linux.vapi b/vapi/linux.vapi index

Re: [Vala] [PATCH] vapi/linux.vapi: Add mremap(2) call.

2009-09-16 Thread Jürg Billeter
On Wed, 2009-09-16 at 19:13 +0200, Julian Andres Klode wrote: This is a Linux-specific enhancement to the mmap() function set implemented in posix.vapi. +public enum MremapFlags { [...] +public void *mremap(void *old_address, size_t old_size, size_t new_size, +

[Vala] Some thoughts about multidimensional arrays

2009-09-16 Thread Frederik Sdun
Hi, I wrote some code using multidimensional arrays yesterday and realized it is not perfect, especially if you use strings. Every array uses an additional _length and and _size gint. size is the allocated size, length the actual use fields. Because every array uses such data, why not pack

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Jan Hudec
On Wed, Sep 16, 2009 at 10:33:22 -0400, Michael B. Trausch wrote: Mr. Maxwell, sorry for the dupe. Forgot to cc the list. On Tue, 2009-09-15 at 17:14 -0500, Mr. Maxwell . wrote: What do I do with the typedef struct declarations? This is what I have but I don't think it's right. c

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Michael B. Trausch
On Wed, 2009-09-16 at 21:34 +0200, Jan Hudec wrote: [...] However, there is one small problem: You can *not* use the structure as a [SimpleType], due to a bug in Vala (see bug 588280). If you attempt Why do you think it is a [SimpleType]. SimpleTypes are only the built-in non-structured

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Michael B. Trausch
On Wed, 2009-09-16 at 15:41 -0400, Michael B. Trausch wrote: Did the meaning of [SimpleType] change somewhere? I thought it meant pass by value. And pardon me, I'm not thinking very clearly. That sounds wrong. My thought was that a SimpleType could be allocated statically, and passing it

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Jürg Billeter
On Wed, 2009-09-16 at 15:46 -0400, Michael B. Trausch wrote: On Wed, 2009-09-16 at 15:41 -0400, Michael B. Trausch wrote: Did the meaning of [SimpleType] change somewhere? I thought it meant pass by value. And pardon me, I'm not thinking very clearly. That sounds wrong. My thought

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Jürg Billeter
On Wed, 2009-09-16 at 15:41 -0400, Michael B. Trausch wrote: The bug is memset code generation is incorrect, so I'm not sure how you can say Vala should not generate invalid code, but this bug is indeed invalid. The bug is that the code generation is incorrect. Whether or not the binding

Re: [Vala] Some thoughts about multidimensional arrays

2009-09-16 Thread Jürg Billeter
Hi, On Wed, 2009-09-16 at 20:03 +0200, Frederik Sdun wrote: I wrote some code using multidimensional arrays yesterday and realized it is not perfect, especially if you use strings. Every array uses an additional _length and and _size gint. size is the allocated size, length the actual

Re: [Vala] [PATCH] Add is_out for Gst.ChildProxy.get_property value parameter

2009-09-16 Thread Jürg Billeter
On Wed, 2009-09-16 at 20:50 +0200, Frederik Sdun wrote: +gst_child_proxy-get_property.value is_out=1 As far as I know, this should be a `ref' parameter, as the get_property method requires an already initialized GValue. Jürg ___ Vala-list mailing