Re: [Vala] Thread unsafe GObject?

2011-01-20 Thread Julian Andres Klode
of type T, the list returned by get_values() is: List -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/. ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Question about GHashTable-style foreach

2010-12-09 Thread Julian Andres Klode
cord, NULL); > > So, the parameter passed as "user_data" is NULL. But, I need to pass > something. What am I doing wrong? You shouldn't pass user data pointers in Vala, Vala does this automatic (the current scope for lambda expressions, the object when passing obj.method, and

Re: [Vala] GINT_TO_POINTER

2010-12-09 Thread Julian Andres Klode
t;GINT_TO_POINTER")] vapi/glib-2.0.vapi- public void* to_pointer (); -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/. ___ vala-list mailing list vala-list@g

Re: [Vala] Two small new features

2010-09-28 Thread Julian Andres Klode
y. Python documentation of 'for' = When the items are exhausted (which is immediately when the sequence is empty), the suite in the ``else`` clause, if present, is executed, and the loop terminates. A ``break`` statement executed in the first suite

Re: [Vala] Void*, how to deal with it

2010-06-30 Thread Julian Andres Klode
> You shouldn't expect something like this to work, as you basically dereference a void* (buffer[i] would be void, but void has no size, so that won't work). You must always cast it to a pointer of a type with a size, such as char. -- Julian Andres Klode - Debia

Re: [Vala] Manual VAPI writing

2010-06-30 Thread Julian Andres Klode
T= 0x41 > } > } > > but the C output goes like so SNDFILE_FILE_MODE_SFM_READ while I want > SFM_READ. > I hoped that the cname="" would clear the SNDFILE_FILE_MODE_ from the > start but it didnt.. > > Any po

Re: [Vala] [Announce] xnoise - a media player written in vala

2010-06-19 Thread Julian Andres Klode
rch functions > * Single instance (thanks to libunique) > * ... >From looking at the website, it seems to be a no-go: It misses the menu bar. -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/. _

Re: [Vala] Where should I change Vala version number before I compile it from source?

2010-04-14 Thread Julian Andres Klode
sion* > I get -* UNKNOWN* > > If you need some more details, I need to know which... Well, use the git repository and not a bzr branch created by a 3rd party. The git repository is located at git://git.gnome.org/vala -- Julian Andres Klode - Debian Developer, Ubuntu M

Re: [Vala] nullable generic types

2010-04-05 Thread Julian Andres Klode
he previous message: edit out all the irrelevant material." and don't do any kind of top posting (or explain why you *must* do it). Thank you. -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/. pgpVK7

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread Julian Andres Klode
On Sat, Mar 27, 2010 at 02:37:37AM +0800, PCMan wrote: > On Sat, Mar 27, 2010 at 12:17 AM, Julian Andres Klode > wrote: > > Well, than f_finish() should probably not be there in the Volume > > interface; so I think that's a bug. > So how can I fix this? Ship with a

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread Julian Andres Klode
On Fri, Mar 26, 2010 at 11:56:04PM +0800, PCMan wrote: > Thanks for the fast reply. > > On Fri, Mar 26, 2010 at 6:45 PM, Julian Andres Klode > wrote: > > On Fri, Mar 26, 2010 at 11:07:20AM +0800, PCMan wrote: > >> Hi list, > >> I tried to use Vala for t

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread Julian Andres Klode
ething like this should work: public override unowned GLib.List get_volumes() { return list; } You of course need a reference to the list somewhere in your class. -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlo

[Vala] Vala does not register string[] properties

2010-03-25 Thread Julian Andres Klode
it be possible for Vala to do the same, so I don't have to convert arrays manually when working with json-glib? Also see http://library.gnome.org/devel/gobject/unstable/gobject-Boxed-Types.html#G-TYPE-STRV:CAPS -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.de

Re: [Vala] Construct exceptions from numeric error codes

2010-02-11 Thread Julian Andres Klode
Am Donnerstag, den 11.02.2010, 21:46 +0100 schrieb Julian Andres Klode: > Am Donnerstag, den 11.02.2010, 12:49 -0600 schrieb Sandino Flores > Moreno: > > Hello. > > > > Is there a way to construct a throwable error instance from an error code? > > > > I w

Re: [Vala] Construct exceptions from numeric error codes

2010-02-11 Thread Julian Andres Klode
Error e = new Error (Quark.from_string ("My Error"), err_code, "TEST"); ^^^^^^^^ So I think there is a bug in Vala. Regards, Julian -- Julian Andres Klode - Debian Developer, Ubuntu Memb

Re: [Vala] internalization

2010-02-04 Thread Julian Andres Klode
_' for translated strings. When compiling, add -DGETTEXT_PACKAGE="" to the CFLAGS. Until valadoc.org is online again, http://library.gnome.org/devel/glib/2.22/glib-I18N.html should help you a bit, in combination with looking at the functions in glib-2.0.vapi. Regards, Julian --

Re: [Vala] Vapi generation problem

2009-12-18 Thread Julian Andres Klode
uct my_instance {} > > When i use this structure (test_instance), vala generate this: > my_instance test_instance; > > But i need this: > my_instance *test_instance; > > There is a way to say to vala to generate the second one ? If you always need a pointer, you can use [

Re: [Vala] [PATCH 1/1] sqlite3: Add Context and Database.create_function() bindings.

2009-12-17 Thread Julian Andres Klode
Am Freitag, den 11.12.2009, 18:04 +0100 schrieb Julian Andres Klode: > Am Freitag, den 11.12.2009, 17:52 +0100 schrieb Julian Andres Klode: > > > + public class Context { > [...] > > + } > I was missing the binding for Context.db_handle(), I am attaching the > fixed

Re: [Vala] Simple question about gchar

2009-12-15 Thread Julian Andres Klode
Am Dienstag, den 15.12.2009, 19:09 +0100 schrieb Nicolas: > Hello, > > If someone can explain me if it's possible to create this on vala: > > gchar *options[] = {"somethings", NULL}; > > it could be great, string?[] options = {"somethings", null}

Re: [Vala] Generating .po files for Vala sources

2009-12-15 Thread Julian Andres Klode
ve tested it and it works if I use gettext but not when I use _ (I > didn't even try -L C#). So I guess the problem is that xgettext > doesn't check for _ by default (I don't know how to to it though) It is 'xgettext -k_ [files]', see the manpage of xgettext. -- Julia

Re: [Vala] [PATCH 1/1] sqlite3: Add Context and Database.create_function() bindings.

2009-12-11 Thread Julian Andres Klode
Am Freitag, den 11.12.2009, 17:52 +0100 schrieb Julian Andres Klode: > + public class Context { [...] > + } I was missing the binding for Context.db_handle(), I am attaching the fixed patch. -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debi

[Vala] [PATCH 1/1] sqlite3: Add Context and Database.create_function() bindings.

2009-12-11 Thread Julian Andres Klode
/sqlite3.vapi +++ b/vapi/sqlite3.vapi @@ -18,6 +18,7 @@ * * Author: * Jürg Billeter + * Julian Andres Klode */ [CCode (lower_case_cprefix = "sqlite3_", cheader_filename = "sqlite3.h")] @@ -49,8 +50,17 @@ namespace Sqlite { public void p

[Vala] [PATCH 0/1] Add Context and Database.create_function() bindings.

2009-12-11 Thread Julian Andres Klode
it easier for a programmer to see what he/she is doing. I have done the same in the libarchive bindings, if you want to take a look at how this would look. Regards, Julian Julian Andres Klode (1): sqlite3: Add Context and Database.create_function() bindings. vapi/sqlite3.v

Re: [Vala] Fwd: Getting path to my program's directory

2009-12-05 Thread Julian Andres Klode
he process id. All those files are symlinks to your program. Please note that proc is optional on FreeBSD, and that Debian GNU/kFreeBSD has linprocfs mounted on /proc and thus behaves like the Linux one. Regards, Julian -- Julian Andres Klode - Debian Developer

Re: [Vala] [PATCH] Add libarchive bindings.

2009-12-02 Thread Julian Andres Klode
Am Mittwoch, den 02.12.2009, 12:23 +0100 schrieb Julian Andres Klode: > I attached the patch with the changes included. I was not able to do a > in-depth test of the bindings, but I expect them to work (I tested the > read part and verified all functions 2 times against their C > defi

Re: [Vala] libgpgme and tar

2009-12-02 Thread Julian Andres Klode
Am Mittwoch, den 02.12.2009, 04:27 -0700 schrieb Mark Dewey: > Julian Andres Klode wrote: > > Am Mittwoch, den 02.12.2009, 03:29 -0700 schrieb Mark Dewey: > >> Also, are there any libraries for Vala that deal with tar files? I know > >> Python has some that worked gr

Re: [Vala] [PATCH] Add libarchive bindings.

2009-12-02 Thread Julian Andres Klode
Am Sonntag, den 22.11.2009, 11:18 -0800 schrieb Evan Nemerson: > On Sun, 2009-11-22 at 18:37 +0100, Julian Andres Klode wrote: > > On Sun, Nov 22, 2009 at 05:32:36PM +0100, Michael 'Mickey' Lauer wrote: > > > Hi Julian, > > > > > > this looks mostl

Re: [Vala] libgpgme and tar

2009-12-02 Thread Julian Andres Klode
rmat will accept an empty file) * raw (read only, starting in libarchive 2.8) I guess that this will be more than enough for you. -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-

Re: [Vala] [PATCH] Add libarchive bindings.

2009-11-22 Thread Julian Andres Klode
all callbacks. I want have the delegate be: public delegate off_t SkipCallback (off_t request); and the method: public Result open (OpenCallback ocb, ReadCallback rcb, CloseCallback ccb); How should I do this? -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.or

[Vala] [PATCH] Add libarchive bindings.

2009-11-22 Thread Julian Andres Klode
s, Julian -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/. From c9857ad22d30889fde6ee58660363fc70879b665 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 22 Nov 2009 00:22:34 +0100 Subject: [PATCH] Add libarc

Re: [Vala] vala-list.gnome.org

2009-11-18 Thread Julian Andres Klode
: > > using Gee (ArrayList); > > So if you useArrayList in the code. The compiler will get it from > Gee. Likethe from import syntax in python or the static import in > java. or doing it the C# way of: using ArrayList = Gee.ArrayList; Which explains itself very well.

Re: [Vala] Maintaining bindings

2009-10-27 Thread Julian Andres Klode
bindings maintainer needs a lot less time and will > only need to handle requests for new bindings and bindings that don't > have separate maintainers. I'd normally say yes, but my 4 patches (IIRC) are not really many contributions and I'm not really a Vala super-expert. And

Re: [Vala] [patch] G.Scanner

2009-10-27 Thread Julian Andres Klode
to your cur_value() function not being weak although it probably should be (as it just returns the 'value' member), but I'm not sure here. Of this patch, the only thing that looks useful to me is the default value in the constructor. The remaining changes

Re: [Vala] [Genie] simple string example no longer compiles

2009-10-26 Thread Julian Andres Klode
Am Montag, den 26.10.2009, 05:30 +0800 schrieb Barry Kauler: > Hi guys, > There is a very simple Genie program that compiled ok early in 2009: > > init > var s = new string > s += "My name is Barry" > print s > > I have got Vala out of git yesterday, and the above program will n

Re: [Vala] List with composed type

2009-10-25 Thread Julian Andres Klode
Am Sonntag, den 25.10.2009, 22:30 +0100 schrieb Johan: > Hi, > > I want to construct a List (can be any kind of linked list) where each > element is a struct (or it could be an object): > > struct StructType{ >string s1; >string s2; >string s3; >} > > var list = ne

Re: [Vala] [PATCH] glib-2.0: Add ScannerMsgFunc and Scanner.msg_handler

2009-10-06 Thread Julian Andres Klode
On Tue, Oct 06, 2009 at 09:08:08PM +0200, Julian Andres Klode wrote: > --- > vapi/glib-2.0.vapi |3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi > index 89740e8..a0e1527 100644 > --- a/vapi/glib-2.0.vapi

[Vala] [PATCH] glib-2.0: Add ScannerMsgFunc and Scanner.msg_handler

2009-10-06 Thread Julian Andres Klode
--- vapi/glib-2.0.vapi |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 89740e8..a0e1527 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -2115,6 +2115,8 @@ namespace GLib { public string format_size_for_dis

Re: [Vala] Downloading a file from the internet to some directory.

2009-09-27 Thread Julian Andres Klode
#x27;t this require gvfsd-http? I am also looking at file downloads for APT2 and everytime I use a http url, it starts gvfsd-http. And installing all the gvfs backends is not really acceptable for APT2. -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/Julian

[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/JulianAndre

Re: [Vala] Sorting a GLib.List

2009-09-26 Thread Julian Andres Klode
d to > be (finally) released on Monday September 29, 2009 (or master from > git). > > Gee.List.sort uses an efficient TimSort algorithm, and for free you get: Sounds great, this will finally allow APT2 to read a sorted list of files from a dire

Re: [Vala] Sorting a GLib.List

2009-09-26 Thread Julian Andres Klode
2 of ‘g_list_sort’ from > incompatible pointer type > /usr/include/glib-2.0/glib/glist.h:101: note: expected > ‘GCompareFunc’ but argument is of type ‘int (*)(const char *, const > char *)’ > GLib.strcmp() seems right to me. Vala should probably cast it to GCompareFunc in the C code. --

[Vala] Storing strings inside structs fails.

2009-09-20 Thread Julian Andres Klode
'uri' member being set to the result of calling g_strdup() on the uninitialized 'uri' variable. The problem exists in Vala 0.7.6 and 0.7.5, I have not tested older versions. -- Julian Andres Klode - Debian Developer, Ubuntu Member See http:

[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 --- vapi/linux.vapi | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/vapi/linux.vapi b/vapi/linux.vapi index c293c13..3ea4544 100644

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

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 > --- > vapi/posix.vapi |5 + > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/vapi/posix.vapi b/vapi/posix.vapi > index cfc9bb3..0c4c0f

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

2009-08-30 Thread Julian Andres Klode
Signed-off-by: Julian Andres Klode --- 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 --- a/vapi/posix.vapi +++ b/vapi/posix.vapi @@ -1576,6 +1576,11 @@ namespace Posix { [CCode

[Vala] [PATCH 1/2] vapi/posix.vapi: Add sys/mman.h memory management functions.

2009-08-30 Thread Julian Andres Klode
Add support for the complete POSIX set of functions in mman.h like mmap(), munmap() and mprotect() and also support the MLR and XSI extension functions. Signed-off-by: Julian Andres Klode --- vapi/posix.vapi | 36 1 files changed, 36 insertions(+), 0