Re: [Vala] Problem converting library

2009-05-15 Thread Hans Baier
2009/5/16 Matías De la Puente mfpuente...@gmail.com:

 You have to use vala-gen-introspect only for Glib/GObject based libs.
 For non-Glib libraries you have to write the vapi file by hand.
 Take a look at this page http://live.gnome.org/Vala/ExternalBindings
 And you will see glib and non-glib based libs and at the bottom a tutorial
 for Glib/GObject based libs

 Matias

Another trick could be mangling the headers until vala-gen-introspect
understands
them and then straighten the resulting file by hand.

vala-gen-introspect has difficulties with macros like GAULFUNC.

Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] why this new and innovative programming language called Vala?

2009-05-04 Thread Hans Baier
2009/5/4 Benjamin Solis lince2...@gmail.com:
 Hi:

 A query, why this new and innovative programming language called Vala?


http://live.gnome.org/Vala#head-76f9b12bb9c9258b22f6dd9ce2533481f9243cc9
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Error in allocating memory

2009-04-25 Thread Hans Baier

 GLib-ERROR **: /build/buildd/glib2.0-2.18.2/glib/gmem.c:136: failed to
 allocate 4294967295 bytes
 aborting...
 Aborted
Looks like a Vala bug I've seen here on the list before..

Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to initialize a Glib.Pid?

2009-04-17 Thread Hans Baier
2009/4/18 Jan Hudec b...@ucw.cz:
 Hello Folks,

 I have a switch, that will actually always initialize a variable of type
 Glib.Pid, but valac wouldn't trust me and say it might be uninitialized.

Using a cast
GLib.Pid pid = (GLib.Pid)0;
works for me.
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] GLib.IOFlags corrections

2009-04-04 Thread Hans Baier
Without the patch using the flags won't compile.

Hans
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 3eaa980..2a31671 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -1553,9 +1553,9 @@ namespace GLib {
 	public enum IOFlags {
 		APPEND,
 		NONBLOCK,
-		READABLE,
-		WRITEABLE,
-		SEEKABLE,
+		IS_READABLE,
+		IS_WRITEABLE,
+		IS_SEEKABLE,
 		MASK,
 		GET_MASK,
 		SET_MASK
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Anyone working on alsa.vapi?

2009-03-27 Thread Hans Baier
Hi,

in order to avoid duplicated effort: Has
anyone worked on an ALSA vapi file?

Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] libglade-2.0.vapi / metadata: nullable arguments for register_widget

2009-03-25 Thread Hans Baier

From 97a1664c46b37a323969546c9098da5cb17e73bd Mon Sep 17 00:00:00 2001
From: Hans Baier hansfba...@googlemail.com
Date: Thu, 26 Mar 2009 04:59:12 +0700
Subject: [PATCH] libglade-2.0.vapi: nullable arguments in register_widget

---
 vapi/libglade-2.0.vapi   |2 +-
 vapi/packages/libglade-2.0/libglade-2.0.metadata |2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/vapi/libglade-2.0.vapi b/vapi/libglade-2.0.vapi
index c12ca64..6238fb1 100644
--- a/vapi/libglade-2.0.vapi
+++ b/vapi/libglade-2.0.vapi
@@ -140,7 +140,7 @@ namespace Glade {
 	[CCode (cheader_filename = glade/glade.h)]
 	public static void register_custom_prop (GLib.Type type, string prop_name, Glade.ApplyCustomPropFunc apply_prop);
 	[CCode (cheader_filename = glade/glade.h)]
-	public static void register_widget (GLib.Type type, Glade.NewFunc new_func, Glade.BuildChildrenFunc build_children, Glade.FindInternalChildFunc find_internal_child);
+	public static void register_widget (GLib.Type type, Glade.NewFunc new_func, Glade.BuildChildrenFunc? build_children, Glade.FindInternalChildFunc? find_internal_child);
 	[CCode (cheader_filename = glade/glade.h)]
 	public static void require (string library);
 	[CCode (cheader_filename = glade/glade.h)]
diff --git a/vapi/packages/libglade-2.0/libglade-2.0.metadata b/vapi/packages/libglade-2.0/libglade-2.0.metadata
index 9c148d3..cf70d84 100644
--- a/vapi/packages/libglade-2.0/libglade-2.0.metadata
+++ b/vapi/packages/libglade-2.0/libglade-2.0.metadata
@@ -6,4 +6,6 @@ glade_xml_new.root nullable=1
 glade_xml_new.domain nullable=1
 glade_xml_new_from_buffer.root nullable=1
 glade_xml_new_from_buffer.domain nullable=1
+glade_register_widget.build_children nullable=1
+glade_register_widget.find_internal_child nullable=1
 GladeNewFunc transfer_ownership=1
-- 
1.5.4.3

___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Simple HTML viewer in genie syntax

2009-03-10 Thread Hans Baier
 It's so beautifully simple! The thing is though, I'm stuck on one
 thing and I was wondering if someone on this mail-list could advise a
 solution. I want to grey-out the forward and back buttons
 as-appropriate, and I have a update_buttons() method in the code, but
 I don't know how to call it when a window page changes.

Gtk.Widget.sensitive = false

 Another problem is I would like to tell it to use a different font,
 especially to display antialiased.

The Gtk.Widget.get_style () / set_style () methods might help.

Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Bug: Implementing properties in vala Interfaces fails with Genie

2009-03-10 Thread Hans Baier
                ^
 Compilation failed: 6 error(s), 0 warning(s)

P.S.: used latest git commit 66d126e6bebca5cb6ea286979764b3ce15da24a7
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Friend class?

2009-03-09 Thread Hans Baier
2009/3/10 Yu Feng rainwood...@gmail.com:
 Dear list,

 Are friend classes available in VALA? If not, are there any particular
 reason against it, and are there any alternatives for friend classes?

 Regards,

 Yu

If you need friend classes, you should probably redesign the code.

What do you need them for?

Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] jack binding

2009-03-05 Thread Hans Baier
Here is my jack.vapi, that I use in
http://www.hans-baier.de/wordpress/jackpanel

http://repo.or.cz/w/jackpanel.git?a=blob;f=jack.vapi;hb=HEAD

Sincerely,
Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Fwd: jack binding

2009-03-05 Thread Hans Baier
-- Forwarded message --
From: Hans Baier hansfba...@googlemail.com
Date: 2009/3/6
Subject: Re: [Vala] jack binding
To: Alberto Colombo a.colo...@kingston.ac.uk


2009/3/6 Hans Baier hansfba...@googlemail.com:
 Here is my jack.vapi, that I use in
 http://www.hans-baier.de/wordpress/jackpanel

 http://repo.or.cz/w/jackpanel.git?a=blob;f=jack.vapi;hb=HEAD

 Sincerely,
 Hans


I must admit mine is a bit hackish and more plain C-style, but If your
one works, then I will use it too, since it is much more elegant.

Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Added kill and pid_t to posix.vapi

2009-03-05 Thread Hans Baier
2009/3/6 Michael 'Mickey' Lauer mic...@vanille-media.de:
 Added the IntegerType descriptor. Can we apply the attached patch then?


Maybe you could consider altering glib.vapi too,
because there, Pid is defined as:

[SimpleType]
[CCode (default_value = 0)]
public struct Pid {
}

Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Added kill to posix.vapi

2009-03-03 Thread Hans Baier
see patch
From c1010cd2704d946660801d02a2cd31f34c7f00a4 Mon Sep 17 00:00:00 2001
From: Hans Baier hansfba...@googlemail.com
Date: Wed, 4 Mar 2009 05:13:51 +0700
Subject: [PATCH] posix.vapi: added kill

---
 vapi/posix.vapi |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/vapi/posix.vapi b/vapi/posix.vapi
index 9e401ca..2e91e8d 100644
--- a/vapi/posix.vapi
+++ b/vapi/posix.vapi
@@ -359,6 +359,9 @@ namespace Posix {
 
 	[CCode (cheader_filename = signal.h)]
 	public sighandler_t signal (int signum, sighandler_t handler);
+	[CCode (cheader_filename = signal.h)]
+	public int kill (GLib.Pid pid, int signum);
+	
 
 	[CCode (cheader_filename = string.h)]
 	public int memcmp (void* s1, void* s2, size_t n);
-- 
1.5.4.3

___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Added kill and pid_t to posix.vapi

2009-03-03 Thread Hans Baier
Now it doesnt depend on GLib anymore
From b68a32b73a1aecefd25809777b8e5a948c0e3c9a Mon Sep 17 00:00:00 2001
From: Hans Baier hansfba...@googlemail.com
Date: Wed, 4 Mar 2009 06:17:53 +0700
Subject: [PATCH] posix.vapi: Added kill and pid_t

---
 vapi/posix.vapi |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/vapi/posix.vapi b/vapi/posix.vapi
index 9e401ca..bc14675 100644
--- a/vapi/posix.vapi
+++ b/vapi/posix.vapi
@@ -357,8 +357,15 @@ namespace Posix {
 
 	public static delegate void sighandler_t (int signal);
 
+	[SimpleType]
+	[CCode (cname = jack_nframes_t, default_value = 0, cheader_filename = signal.h)]
+	public struct pid_t {
+	}
 	[CCode (cheader_filename = signal.h)]
 	public sighandler_t signal (int signum, sighandler_t handler);
+	[CCode (cheader_filename = signal.h)]
+	public int kill (pid_t pid, int signum);
+	
 
 	[CCode (cheader_filename = string.h)]
 	public int memcmp (void* s1, void* s2, size_t n);
-- 
1.5.4.3

___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Auto-generate C++ wrappers for vala-libs, how?

2009-01-29 Thread Hans Baier
Hello,
since Vala is ideal for writing custom Gtk+ widgets,
I wonder whether there already is a tool to autogenerate
C++ wrappers a la/based on glibmm for a given vala library.

Thanks,
Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Feature-Question: Compiler-API / AST of vala exposed to the programming language?

2009-01-23 Thread Hans Baier
Hi,

I didnt look into the details of vala, but what is of great value
(especially for tool support) is a standard compiler API and
standard AST form of vala code so that every vala program can parse

its own code and modify it.
This is essential for IDE tools like automated refactoring
and code generation. (And metaprogramming).

Would be great if Vala had that from the beginning.

Kind regards,
Hans

Thanks for the good work,
IMHO vala is the best language to write GNOME apps in!
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Generated librsvg-bindings for vala

2009-01-20 Thread Hans Baier
Hi,

I just generated librsvg-bindings.
the output of vapigen needed some manual tweaking,
but now it seems to run...

I hope this is useful,
and maybe can be contributed.

License: public domain.

Cheers,
Hans


librsvg-2.0.vapi
Description: Binary data
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] just a suggestion

2009-01-19 Thread Hans Baier
 I still have a long way to learn Vala.
 Since someone is successfully using Vala in a number
 of projects I think they already have a good knowledge
 of common pitfalls, best practices and the like.

Writing a book is one of the most efficient ways to
learn. Believe me, that is how I learnt linux.
Just start, it doesnt have to be perfact in the beginning.
It can grow over time.

That is how open source happens

Kind regards,
Hans
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list