[Vala] connecting/disconnecting a signal to a static member function?

2010-10-08 Thread Yu Feng
Dear List, Now that += and -= are deprecated syntax for signal handlers, I am trying to update some signal code into the connect/disconnect syntax on Vala 0.11.0. Here is the problem I couldn't get myself out from: 1. the signal connecting / disconnecting is performed in a static member

[Vala] Leak on arrays?

2010-04-03 Thread Yu Feng
Dear List, The following line is a ccode from ParamSpec[] specs = klass.list_properties(); ---CCode -- specs = (_tmp5_ = (_tmp4_ = g_object_class_list_properties (klass, _tmp3_), (_tmp4_ == NULL) ? ((gpointer) _tmp4_) : _vala_array_dup1 (_tmp4_, _tmp3_)), specs_length1 = _tmp3_, _specs_size_

[Vala] Sharing a trick to use some C macros in VALA

2009-10-31 Thread Yu Feng
Dear list, I found this trick today, in case it is not already dinosaur.. [CCode (cname=G_STRUCT_OFFSET(MyBaseClassClass, my_function))] extern const int MyFunctionOffset; basically you can call in this way any c macros that are otherwise not directly bindable to vala, given that the return

[Vala] params string[] foo?

2009-09-25 Thread Yu Feng
Dear List, How do I use the params syntax? I see it added in the parser but looks like the codegen is not dealing with it properly, or maybe I am missing something. This naive code fails: public void va(params string[] foo) { return; } public void call_va() { va(a, b, c); } /tmp/t.vala.c:

[Vala] A note about weak/unowned struct

2009-09-14 Thread Yu Feng
Dear List, Here is some of my observation regarding to weak/unowned struct, which I would like to share with you. I am not sure if the feature has landed or not, but currently a weak/unowned struct is compiled into a bitwise copy of the memory content of the referred struct. in other words, it

Re: [Vala] Wrapping Errors

2009-09-03 Thread Yu Feng
On Thu, 2009-09-03 at 13:38 +0100, Phil Housley wrote: 2009/8/22 Jan Hudec b...@ucw.cz: On Thu, Aug 20, 2009 at 22:09:21 -0400, Yu Feng wrote: GError doesn't support error wrapping as Java does. Is GLib is purposely avoiding it? If not, it will become a useful feature as the number

[Vala] Improving the i18n binding in GLib

2009-09-01 Thread Yu Feng
Dear Maintainers, The attachment is a patch that adds a few more gettext functions to the glib-2.0.vapi. Also in the patch I moved the gettext functions to Intl namespace, while leaving the _ macros under the GLib namespace. If it possible I would also suggest using the name I18N as the

[Vala] Bug 591972

2009-08-31 Thread Yu Feng
Dear Maintainers, Could someone look at Bug 591972? I am depending on this. Some lower-level coding still needs the GTypes of the fundamental types. Most of them are OK, but G_TYPE_BOXED and those who deeply entangle with VALA are not. Since the `typeof' operator doesn't operate on `struct',

Re: [Vala] [Bug 590324] Syntax sugar for notifications

2009-08-30 Thread Yu Feng
On Sun, 2009-08-30 at 19:03 +, Maciej Piechotka wrote: Frederik scumm_fr...@... writes: The current syntax is: object.notify[property] += ... // deprecated or object.notify[property].connect (...) How is this hard? Best regards, Frederik Point for

Re: [Vala] Why do regular reference types leak null?

2009-08-22 Thread Yu Feng
On Sat, 2009-08-15 at 00:12 +0200, Jiří Zárevúcky wrote: On 08/14/2009 10:57 PM, Sam Danielson wrote: Why shouldn't they be null? IMO, it would just add much more trouble. Checking nulls is responsibility of the programmer. That is consistent with every other language I know, including

Re: [Vala] Wrapping Errors in the vala way

2009-08-22 Thread Yu Feng
On Sat, 2009-08-22 at 21:03 +0200, Jan Hudec wrote: On Sat, Aug 22, 2009 at 11:52:01 -0400, Yu Feng wrote: On Sat, 2009-08-22 at 09:24 +0200, Jan Hudec wrote: [...] Well, so the code further up the call stack is not going to look at the inner exception anyway except to print

Re: [Vala] GObject-introspection and vapi

2009-08-19 Thread Yu Feng
On 3), 3) I don't think a record should be treated as struct, because the GLib-2.0.gir from GI repository uses that to annotate all the non-gobject classes like IOChannel, which are reference types. So what is the correct way to handle them? (guess I can look into glib-2.0.vapi,

[Vala] Errors handling in vala compiler

2009-07-14 Thread Yu Feng
Dear list, Is there any documents/instructions on how grammar/semantics erros handled by the compiler? I can see there is a 'check' method for each node which recursively checks the children of the node. It returns a false on error, and writes the error message to stderr. But how and why does

Re: [Vala] GLib.SList as a property

2009-07-08 Thread Yu Feng
On Tue, 2009-07-07 at 10:50 -0300, Lucas Hermann Negri wrote: Just: But how is h_labels defined? unonwed h_labels? Yu public SListstring labels { get{return h_labels;} set{h_labels = value;} } On Tue, Jul 7, 2009 at 12:44 AM, Yu Fengrainwood...@gmail.com wrote: On Mon, 2009-07-06 at

Re: [Vala] GLib.SList as a property

2009-07-06 Thread Yu Feng
On Sun, 2009-07-05 at 00:55 -0300, Lucas Hermann Negri wrote: Hello, I have a property of GLib.SList type, defined this way: public SListstring labels { get{return h_labels;} set{h_labels = value;} } But this leaks memory. What's the correct way of doing this? I don't think

Re: [Vala] GLib.SList as a property

2009-07-06 Thread Yu Feng
On Mon, 2009-07-06 at 13:08 -0300, Lucas Hermann Negri wrote: I didn't added anything to the list. Just created and destroyed the class that had this property, and it leaked. How could it be? Could you post the code? I am confused. Yu On Mon, Jul 6, 2009 at 3:28 AM, Yu

Re: [Vala] Port Tomboy?

2009-07-01 Thread Yu Feng
On Sat, 2009-06-27 at 14:24 +0200, Jiří Zárevúcky wrote: 2009/6/27 Yu Feng rainwood...@gmail.com: On Sat, 2009-06-27 at 08:03 +0100, Sam Liddicott wrote: 4. Port Tomboy as a show-case project port 4 seems to be very fun; how large is the codebase of tomboy? BTW: What

Re: [Vala] Working with GLib.List and memory management

2009-07-01 Thread Yu Feng
On Wed, 2009-07-01 at 01:24 +0400, Кутейников Дмитрий wrote: It is some sort of a bug (or a feature). Vala inserts g_object_ref in generated C-code after myList.prepend(myWidget); but it doesn't decrease ref_counter after remove. The only way is to use g_object_unref manually. What you said

[Vala] Port Tomboy?

2009-06-27 Thread Yu Feng
On Sat, 2009-06-27 at 08:03 +0100, Sam Liddicott wrote: Raphael Bosshard wrote: I'd rather like a possibility to automatically convert (or semi-convert, with manual fixes) C# code to Vala. There are some C#/Mono libraries out there (like Banshees ListView implementation) which provide a

Re: [Vala] DBus object at multiple paths

2009-06-26 Thread Yu Feng
Dear Michael, On Fri, 2009-06-26 at 14:41 +0200, Michael 'Mickey' Lauer wrote: Dear Yu, Am Freitag, den 26.06.2009, 08:52 +0800 schrieb Yu Feng: Long time ago before the DBus is rewritten we can use Connection.register_object in dbus-glib-1.vapi Not sure if it is still useful

Re: [Vala] enum typing

2009-06-26 Thread Yu Feng
On Fri, 2009-06-26 at 21:40 -0600, Shawn Ferris wrote: Hello again, As you know, I've been working on the Oracle OCI bindings. Now that it's funcational, I wanna wrap it into a more friendly, vala style interface. I would like more of the options as properties, but I'm not sure if there's a

[Vala] libyaml-glib: YAML and GObject

2009-06-25 Thread Yu Feng
Dear list(s), I have been playing around GLib and libyaml with vala for a couple of months. While I don't see a clear future of the code, I would like to post a link to my code in case it will be useful to others. The library is written in VALA, but one can write applications and link against it

Re: [Vala] Loop not found?

2009-06-25 Thread Yu Feng
On Thu, 2009-06-25 at 09:24 +0200, Jürg Billeter wrote: On Thu, 2009-06-25 at 07:17 +0800, Yu Feng wrote: I was trying to catch up with recent vala master branch, but I get this error: valacodevisitor.vala:308.34-308.37: error: The type name `Loop' could not be found public

[Vala] [PATCH] GType is a IntegerType + SimpleType

2009-06-25 Thread Yu Feng
Refer to Sam's email on Jun 24th Switch statement on GType. I can't access mail-archive in china; weird. --- vapi/gobject-2.0.vapi |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/vapi/gobject-2.0.vapi b/vapi/gobject-2.0.vapi index 54b53e0..d902452 100644 ---

[Vala] [Patch] Small improvements on gsl bindings

2009-06-25 Thread Yu Feng
Dear list, Here are a few small improvements on gsl bindings. Several places the pointers are properly replaced by arrays, and several delegates are handled the native vala way. - Yu --- vapi/gsl.vapi 2009-06-19 15:45:23.0 +0800 +++ ../vala/vapi/gsl.vapi 2009-06-25 07:06:59.0

[Vala] Loop not found?

2009-06-24 Thread Yu Feng
Dear list, I was trying to catch up with recent vala master branch, but I get this error: valacodevisitor.vala:308.34-308.37: error: The type name `Loop' could not be found public virtual void visit_loop (Loop stmt) {

Re: [Vala] Switch statement on GType.

2009-06-22 Thread Yu Feng
On Sat, 2009-06-20 at 09:34 -0700, Sam Danielson wrote: Under Vala 0.6 the following worked. switch (tree_store.get_column_type (n)) { case typeof(string): ... break; } In Vala 0.7 it does not -- error: Integer or string expression expected. Should it actually be

[Vala] [Patch] GCC error with markup parser

2009-06-07 Thread Yu Feng
Hi Jiri, I think it is a bug in glib-2.0.vapi. Although it looks irrelevant, this patch solves your problem. - Yu On Sun, 2009-06-07 at 02:26 +0200, Jiří Zárevúcky wrote: Hi, I'm trying to use GLib's markup parser, but I'm getting the following error. Is that a bug or some mistake on my

Re: [Vala] List problem in Valide

2009-06-01 Thread Yu Feng
On Sat, 2009-05-30 at 22:22 +0200, Nicolas Joseph wrote: Hello, Your first problem is due to the '' character, could you post an issue so that I will not forget: http://code.google.com/p/valide/issues/list libgee is now included in libvala-1.0.dll, you just add the vala-1.0 package. A

Re: [Vala] file.copy problem

2009-06-01 Thread Yu Feng
I guess it is a problem of GIO on Windows. You can catch the error with try { ... } catch(IOError.EXISTS e) { // trash the old file and copy again. } - Yu On Mon, 2009-06-01 at 10:12 +0200, Joss 4 wrote: oops, sorry , I forgot part of the error line... Hi, I have got this problem

Re: [Vala] Problems with virtual extern methods.

2009-06-01 Thread Yu Feng
Hi Jiri, Why doesn't it make sense? extern is just saying the code is written somewhere else with another language. I guess you were thinking of extern in C++ or something? Think about implementing the GtkBuildable interface(the interface itself) with VALA. If the interface definition is

Re: [Vala] Problems with virtual extern methods.

2009-06-01 Thread Yu Feng
On Mon, 2009-06-01 at 12:15 +0200, Jürg Billeter wrote: On Mon, 2009-06-01 at 05:23 -0400, Yu Feng wrote: Think about implementing the GtkBuildable interface(the interface itself) with VALA. If the interface definition is written in VALA to take the advantages of Vala, several

Re: [Vala] Problems with virtual extern methods.

2009-06-01 Thread Yu Feng
On Mon, 2009-06-01 at 18:38 +0200, Jiří Zárevúcky wrote: Dne 1. červen 2009 11:23 Yu Feng rainwood...@gmail.com napsal(a): If the interface definition is written in VALA to take the advantages of Vala You lost me at this line. Is VALA something else then Vala? My bad grammars. VALA

[Vala] Nested anonymous struct

2009-05-10 Thread Yu Feng
Dear list, Currently the vala compiler (0.7.2) doesn't compiler the following code: public struct Large { public struct { int small; int verysmall; } foo; } neither does it accept the code in a vapi file. One year ago Sam expressed the need in a

Re: [Vala] Vala support for automake

2009-04-26 Thread Yu Feng
On Sun, 2009-04-26 at 09:50 +0200, Ralf Wildenhues wrote: * Yu Feng wrote on Sun, Apr 26, 2009 at 03:51:50AM CEST: Is it possible to also add valadoc support in automake together with vala support? What does valadoc do, where is it documented, what kind of rules do you use instead

Re: [Vala] Vala support for automake

2009-04-25 Thread Yu Feng
Is it possible to also add valadoc support in automake together with vala support? Yu On Thu, 2009-04-16 at 21:19 +0200, Jürg Billeter wrote: On Thu, 2009-04-16 at 21:09 +0200, Ralf Wildenhues wrote: * Jürg Billeter wrote on Thu, Apr 16, 2009 at 09:02:30PM CEST: On Thu, 2009-04-16 at 20:49

Re: [Vala] Starting with Vala, problems with strings

2009-04-19 Thread Yu Feng
Hi Diego, private static int my_string_handler(string str)/*no '*'*/ { } If possible use unichar, string.next_char, string.get_char, to manipulate string is better than directly access the char by its location because all strings are utf8 encoded. StringBuilder sb = new StringBuilder();

Re: [Vala] empty ListT is null - bug or feature?

2009-04-07 Thread Yu Feng
:) - but I'm definitelly not the best programmer in the world, so can you explain to me if the fact that you havent seen that is because it's not a good programming practice (why?), or it's just that you've never seen it :) ? Jan Spurny On Mon, 06 Apr 2009 23:05:16 +0200 (CEST) Yu Feng

Re: [Vala] [ANNOUNCE] Vala 0.7.0 - Compiler for the GObject type system

2009-04-07 Thread Yu Feng
On Tue, 2009-04-07 at 17:53 +0200, Jürg Billeter wrote: On Tue, 2009-04-07 at 01:50 -0400, Yu Feng wrote: Vala 0.7.0 is affected by Bug 578191 which may interfere with many programs written in VALA. Would you please take a look at the patch before the next major/minor release? The master

[Vala] private extern class methods.

2009-04-06 Thread Yu Feng
Dear list, I encountered a very hidden problem with private extern class methods, which I would like to share with you. The scenario is like this. It compiles, links. everything seems fine until the library is installed: the produced .so file will have a wrong reloc symbol which doesn't work

Re: [Vala] private extern class methods.

2009-04-06 Thread Yu Feng
in an application. well.. default linux allows you to do this, but its a bit ugly workaround ;) Yu Feng wrote: Dear list, I encountered a very hidden problem with private extern class methods, which I would like to share with you. The scenario is like this. It compiles, links. everything

Re: [Vala] [ANNOUNCE] Vala 0.7.0 - Compiler for the GObject type system

2009-04-06 Thread Yu Feng
Hi Jurg, Vala 0.7.0 is affected by Bug 578191 which may interfere with many programs written in VALA. Would you please take a look at the patch before the next major/minor release? The master branch is self-compilable with the patch applied. Regards, Yu 05 at 17:54 +0200, Jürg Billeter

Re: [Vala] Multidimensional arrays - help with using them.

2009-04-05 Thread Yu Feng
); public set(int x, int y, int value); public void resize(int NNX, int NNY); } Yu Leonti On Fri, Apr 3, 2009 at 11:46 PM, Yu Feng rainwood...@gmail.com wrote: I remember back in some versions array[1, 2] works Yu On Fri, 2009-04-03 at 21:05 +0200, Leonti Bielski

Re: [Vala] [ANNOUNCE] Vala 0.7.0 - Compiler for the GObject type system

2009-04-05 Thread Yu Feng
Hi Jürg, On Sun, 2009-04-05 at 17:54 +0200, Jürg Billeter wrote: We are pleased to announce version 0.7.0 of Vala, a compiler for the GObject type system. Vala 0.7.0 is now available for download at: http://download.gnome.org/sources/vala/0.7/ Changes since 0.6.0 * Do not generate

Re: [Vala] Vala support for automake

2009-03-31 Thread Yu Feng
Dear Jurg, I have two questions: If a VALA package depends on the features provided in the patch, will the distributed tarball(make dist) be compilable on a system with a unpatched automake? Is VALA itself going to make use of the features once the they are accepted in the automake upstream? If

Re: [Vala] Dynamic arrays in Vala - example for newbie

2009-03-30 Thread Yu Feng
I bet it is a bug. Yu On Tue, 2009-03-31 at 00:14 +0200, Leonti Bielski wrote: Ok, thanks for the advise then. Now I have different problem. If I do the code below inside a function, it works: /--- string[] a; a= {}; a += sometext;

[Vala] Quaternions

2009-03-26 Thread Yu Feng
If I remember correctly, the inverse of a quaternion (w, x, y, z) is then defined as (w, x, y, z)^-1 = (w, -x, -y, -z) With the inverse defined, the quotient is defined as q/p = q * p^(-1) In that sense (0, 0, 0, 1)/(0, 1, 0, 0) = (0, 0, 0, 1) * (0, -1, 0, 0) which is well-defined. Yu On

Re: [Vala] Operator overloading

2009-03-24 Thread Yu Feng
Would it be reasonable to write some Vala compiler modules that implements these types internally? The implementations can then be shared across the entire vala user base. Yet these modules can be release under different packages, eg, vala-ccode-currency, vala-ccode-vector, vala-ccode-complex ...

Re: [Vala] Operator overloading

2009-03-22 Thread Yu Feng
On Sun, 2009-03-22 at 15:27 +, pancake wrote: Are there any plans to implement operator overloading in Vala? I will find them really useful because it is a really nice addition feature for the language. Using it will allow us to wrap all the arithmetic access to use APIs like GMP for

Re: [Vala] DBus services in shared modules implementing interfaces defined in a shared library

2009-03-19 Thread Yu Feng
Hi Michael, The types of internally used libraries are not registered if ModuleInit is used. I solved the same issue recently, in a rather convoluted way. A noinst convenient library libcore.la Another noinst convenient library libmain.la Each is built with one call to valac. They are then

[Vala] any workarounds for bug 575475?

2009-03-15 Thread Yu Feng
Hi buddies, I ran into problems when trying to upgrade global menu into vala 0.5.7. I really appreciate if anyone can come up with a workaround. Thanks! http://bugzilla.gnome.org/show_bug.cgi?id=575475 Rebards, Yu ___ Vala-list mailing list

Re: [Vala] Friend class?

2009-03-10 Thread Yu Feng
On Tue, 2009-03-10 at 08:25 +0700, Hans Baier wrote: 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

Re: [Vala] Friend class?

2009-03-10 Thread Yu Feng
On Tue, 2009-03-10 at 08:07 +0100, Jürg Billeter wrote: On Mon, 2009-03-09 at 20:36 -0400, Yu Feng wrote: 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? There is no plan to support

[Vala] Friend class?

2009-03-09 Thread Yu Feng
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 ___ Vala-list mailing list Vala-list@gnome.org

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

2009-03-05 Thread Yu Feng
Curious: What does rank mean? Yu On Wed, 2009-03-04 at 14:15 +0100, Jürg Billeter wrote: On Wed, 2009-03-04 at 13:50 +0100, pancake wrote: mmh, pid_t is not a struct, is an 'int', in which whay do you get the (int) value of this empty struct? I would rather prefer to do it in another way

Re: [Vala] Generics: constraints and 'new T ()' on type parameters?

2009-02-26 Thread Yu Feng
Hi Sam, On Thu, 2009-02-26 at 19:52 -0500, Sam Danielson wrote: I'm writing some ORM where a database view is wrapped in a factory object that produces records. Ideally I would think a Factory T should be able to return new T's but I can't figure out how to do this. The work around is to

Re: [Vala] Ellipsis syntax (Was: Ellipsis as an argument..)

2009-02-26 Thread Yu Feng
Hi, On Tue, 2009-02-24 at 22:43 +0100, Didier Ptitjes wrote: I asked the same to Jürg on the channel, and it appears there is only for now a syntax for typed ellipsis. The following is an example of the syntax : public static void foo(params string[] args) { // ... } So

Re: [Vala] Binding questions

2009-02-15 Thread Yu Feng
[SimpleType] ? On Sun, 2009-02-15 at 20:41 -0500, Michael B. Trausch wrote: I am trying to create a small Xlib binding for Vala, with a little bit of difficulty. I think I just don't understand what it is that I am doing fully. Starting with what Frederik gave as an initial set of code, I

Re: [Vala] [Having fun with Vala] Multiboot kernel using Vala!

2009-02-11 Thread Yu Feng
Hi Matias, I am curious about how GLib was staticly linked to your kernel. I didn't see any flags on this in your makefile. Yu On Mon, 2009-02-09 at 12:45 -0200, Matías De la Puente wrote: Hello all!, I was playing with vala to see if it's posible to write a minimal kernel using vala.

Re: [Vala] reading and writing binary data

2009-01-26 Thread Yu Feng
Not sure if helpful, but apparently uchar[] stands for byte arrays, string stands for utf8 string. I believe a patch to glib-2.0.vapi should be made to include the -data member in class ByteArray. - Yu On Mon, 2009-01-26 at 18:52 -0800, jezra lickter wrote: Hello, I am using GNet to read

Re: [Vala] [Wikibooks] Cover Page

2009-01-23 Thread Yu Feng
It is the discussion page of the book provided by wikibook site? Yu On Fri, 2009-01-23 at 11:48 +0100, Luca Dionisi wrote: I've created a cover page for the book http://en.wikibooks.org/wiki/Vala_Programming/Cover There's a list of contributors. So, if you contribute you are invited to

[Vala] Vala generated .gir file incompatible with g-ir.

2009-01-23 Thread Yu Feng
Hi Jurge, I was trying to run g-ir-compiler with a vala generated .gir file. Apparently there are two issues: 1. the default file name generated by vala differ from the namespace name, and g-ir-compiler complains about this. 2. g-ir-compiler expects a value for the members of enumerations

Re: [Vala] just a suggestion

2009-01-21 Thread Yu Feng
* Threads * Scripting (Lua, JavaScript) * Setting Up a Build System * Internationalization * Creating Your Own Library I'm agree with this suggestion. Of course adding a science chapter as proposed Yu Feng. I'll be fully ready

Re: [Vala] just a suggestion

2009-01-20 Thread Yu Feng
On Tue, 2009-01-20 at 12:21 +, Karl Lattimer wrote: On Tue, 2009-01-20 at 10:44 +, Alberto Ruiz wrote: 2009/1/20 Karl Lattimer k...@qdh.org.uk: On Tue, 2009-01-20 at 09:44 +0700, Hans Baier wrote: I still have a long way to learn Vala. Since someone is successfully using Vala

Re: [Vala] just a suggestion

2009-01-19 Thread Yu Feng
On Mon, 2009-01-19 at 15:44 +0100, Luca Dionisi wrote: On Mon, Jan 19, 2009 at 3:25 PM, Alberto Ruiz ar...@gnome.org wrote: 2009/1/19 Luca Dionisi luca.dion...@gmail.com: Has anyone on this list ever thought about producing a wikibook (http://en.wikibooks.org/wiki) on Programming in Vala

Re: [Vala] [ANNOUNCE] Vala 0.5.6 - Compiler for the GObject type system

2009-01-18 Thread Yu Feng
Nice job! I notice all 'weak' return values in bindings are now replaced with 'unowned'. Has the difference between these two been documented anywhere yet? Regards, Yu On Sun, 2009-01-18 at 16:50 +0100, Jürg Billeter wrote: We are pleased to announce version 0.5.6 of Vala, a compiler for the

Re: [Vala] [ANNOUNCE] Vala 0.5.6 - Compiler for the GObject type system

2009-01-18 Thread Yu Feng
On Sun, 2009-01-18 at 17:56 +0100, Jürg Billeter wrote: change has been announced in a thread[1] on the mailing list. The compiler does not yet distinguish between `weak' and `unowned', however, future versions will use g_object_*_weak_pointer for `weak' object references, and you will need

[Vala] static abstract member functions?

2009-01-12 Thread Yu Feng
Hi, I am curious but are there any reasons to avoid static abstract member functions? They seem to be pretty doable because the class structure is instance-independent. Regards, Yu ___ Vala-list mailing list Vala-list@gnome.org

Re: [Vala] Header file generation

2009-01-12 Thread Yu Feng
On Mon, 2009-01-12 at 14:32 +0100, Jürg Billeter wrote: On Sun, 2009-01-11 at 10:52 -0500, Yu Feng wrote: Therefore my opinion on the cycles is that there should not be unsolvable typedef cycles ( with .h, -priv.h and .c) in a properly designed program, because these cycles represents solid

Re: [Vala] subclassing a template class

2009-01-11 Thread Yu Feng
On Sun, 2009-01-11 at 14:50 +0100, Jürg Billeter wrote: On Sat, 2009-01-10 at 19:32 -0500, Yu Feng wrote: I made a patch to accept the following syntax: class ContainerT { ... } class Stuff: ContainerWidget { Stuff() { baseWidget(); } } Bug #567319

Re: [Vala] exposing the unref and ref member for gtypeinstance classes?

2009-01-11 Thread Yu Feng
On Sun, 2009-01-11 at 15:07 +0100, Jürg Billeter wrote: Hi Yu, On Sat, 2009-01-10 at 13:11 -0500, Yu Feng wrote: Is it possible to expose ref and unref member of gtypeinstance classes? They will be useful with GHashTable.new_full I am currently using a dirty workaround like

Re: [Vala] Header file generation

2009-01-11 Thread Yu Feng
My point on this. I took a look at gtkwidget.c and gtkcontainer.c. GtkWidget has a parent reference to GtkContainer so it should have circular header files. It turns out they avoid the cycle by defining the parent member of GtkWidget as a GtkWidget instead of what it should be (GtkContaienr).

[Vala] HashTableQuark, void* broken in trunk.

2009-01-11 Thread Yu Feng
Dear Jurg, HashTableQuark, void* is broken in trunk with an error: error: `GLib.Quark' is not a supported generic type argument, use `?' to box value types But Quark is actually a SimpleType. Is SimpleType no longer propagated? Yu ___ Vala-list

[Vala] volatile variables?

2009-01-11 Thread Yu Feng
Hi all, How do I declare a volatile double variable? Yu ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] volatile variables?

2009-01-11 Thread Yu Feng
on a double variable the result of the program changes. Are there any ohter helpful keywords then? Yu On Sun, 2009-01-11 at 18:12 -0800, Christian Hergert wrote: Is that even be possible on 32bit? sizeof(gdouble) is 8. -- Christian On Sun, 2009-01-11 at 17:54 -0500, Yu Feng wrote: Hi all

Re: [Vala] use weak and var together

2009-01-10 Thread Yu Feng
On Sat, 2009-01-10 at 09:24 +0100, Jürg Billeter wrote: On Sat, 2009-01-10 at 01:04 -0500, Yu Feng wrote: On Fri, 2008-12-12 at 08:08 +0100, Jürg Billeter wrote: On Thu, 2008-12-11 at 23:56 -0500, Yu Feng wrote: Talking about circular references, is it possible to have a circular ref

Re: [Vala] Does vala still depend on FLEX anymore?

2009-01-10 Thread Yu Feng
On Sat, 2009-01-10 at 10:35 +0100, Jürg Billeter wrote: On Thu, 2009-01-08 at 22:31 -0500, Yu Feng wrote: On Fri, 2009-01-09 at 00:31 +0100, Jürg Billeter wrote: On Thu, 2009-01-08 at 18:16 -0500, Yu Feng wrote: Hi Jurg, If I am correct VALA no more depends on FLEX

Re: [Vala] use weak and var together

2009-01-10 Thread Yu Feng
On Sat, 2009-01-10 at 19:36 +0100, Jürg Billeter wrote: On Sat, 2009-01-10 at 13:07 -0500, Yu Feng wrote: On Sat, 2009-01-10 at 18:35 +0100, Jürg Billeter wrote: Right, but I'm not sure that you need to change anything in the unref function to get dispose functionality working. Can you

Re: [Vala] use weak and var together

2009-01-10 Thread Yu Feng
On Sat, 2009-01-10 at 23:48 +0100, Hans Vercammen wrote: On Sat, 2009-01-10 at 13:07 -0500, Yu Feng wrote: On Sat, 2009-01-10 at 18:35 +0100, Jürg Billeter wrote: On Sat, 2009-01-10 at 12:19 -0500, Yu Feng wrote: On Sat, 2009-01-10 at 09:24 +0100, Jürg Billeter wrote: On Sat, 2009

Re: [Vala] use weak and var together

2009-01-09 Thread Yu Feng
Hi Jurg, Sorry for digging such an old post but I discovered something. See the end of the message. On Fri, 2008-12-12 at 08:08 +0100, Jürg Billeter wrote: On Thu, 2008-12-11 at 23:56 -0500, Yu Feng wrote: On Thu, 2008-12-11 at 22:11 +0100, Jürg Billeter wrote: On Wed, 2008-12-03 at 14:05

[Vala] Does vala still depend on FLEX anymore?

2009-01-08 Thread Yu Feng
Hi Jurg, If I am correct VALA no more depends on FLEX. But configure.ac still checks for it. Yu ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Does vala still depend on FLEX anymore?

2009-01-08 Thread Yu Feng
Ignore this mail. gen-introspection still depends on flex. Sorry. On Thu, 2009-01-08 at 18:16 -0500, Yu Feng wrote: Hi Jurg, If I am correct VALA no more depends on FLEX. But configure.ac still checks for it. Yu ___ Vala-list mailing list

Re: [Vala] g_object_unref issues with autotools structure

2009-01-05 Thread Yu Feng
Would you post a stack backtrace here? I'll be glad to help but I don't have a git client by hand. Yu On Mon, 2009-01-05 at 01:19 -0200, Gabriel Falcão wrote: Hi Folks, there I am again with foolish questions, but I can ensure that I am learning SO MUCH, and hope to can help Vala project

Re: [Vala] Action signals

2009-01-05 Thread Yu Feng
Based on my understanding of valac before the recent refactoring, it should be a few line patch around 'signal binding' related code; get a new CCode attribute such as 'action_signal = true' and change the type of the signal to ACTION if so. Yu On Mon, 2009-01-05 at 20:04 +0100, gege2061 wrote:

[Vala] screen-changed signal emitted before constructor is invoked?

2009-01-05 Thread Yu Feng
Dear developers, I created an Widget and overrode the constructor of the GObject interface to initialize private members. Then I listened to screen-changed signal of the widget. in the signal handler a private member was accessed; The private member was not properly initialized when the first

[Vala] Problems with ref functions that returns void.

2008-12-30 Thread Yu Feng
Hi, gconf_entry_ref returns nothing; How to handle this? Shall someone file a bug to GConf to ask them to return the object pointer in gconf_entry_ref? Yu ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Ownership syntax changes

2008-12-21 Thread Yu Feng
On Sun, 2008-12-21 at 00:16 +0100, Jürg Billeter wrote: On Sat, 2008-12-20 at 23:57 +0100, Hans Vercammen wrote: On Sat, 2008-12-20 at 08:24 +0100, Jürg Billeter wrote: On Sat, 2008-12-20 at 02:19 +0100, Hans Vercammen wrote: On Fri, 2008-12-19 at 12:10 +0100, Jürg Billeter wrote:

Re: [Vala] Ownership syntax changes

2008-12-21 Thread Yu Feng
On Sat, 2008-12-20 at 23:57 +0100, Hans Vercammen wrote: On Sat, 2008-12-20 at 08:24 +0100, Jürg Billeter wrote: On Sat, 2008-12-20 at 02:19 +0100, Hans Vercammen wrote: On Fri, 2008-12-19 at 12:10 +0100, Jürg Billeter wrote: * `(owned)' cast replaces `#' reference transfer

[Vala] FYI: [Fwd: EggDBus]

2008-12-21 Thread Yu Feng
Is it possible to: (1) Write a similar dbus binding with the just-finished new dbus support in vala? (2) factor out the code in vala to form a similar dbus library? The awareness of DBus in gnome stack is increasing. Best, Yu Forwarded Message From: David Zeuthen

Re: [Vala] Ownership syntax changes

2008-12-20 Thread Yu Feng
On Sat, 2008-12-20 at 12:19 +0100, Xavier Bestel wrote: Le vendredi 19 décembre 2008 à 12:10 +0100, Jürg Billeter a écrit : I just committed some ownership syntax changes to trunk. The old syntax will continue to be supported but is planned to be deprecated after the release of Vala 0.5.4.

Re: [Vala] Ownership syntax changes

2008-12-20 Thread Yu Feng
On Sat, 2008-12-20 at 13:04 +0100, Jürg Billeter wrote: On Sat, 2008-12-20 at 12:19 +0100, Xavier Bestel wrote: Le vendredi 19 décembre 2008 à 12:10 +0100, Jürg Billeter a écrit : I just committed some ownership syntax changes to trunk. The old syntax will continue to be supported but is

Re: [Vala] inline C

2008-12-15 Thread Yu Feng
On Mon, 2008-12-15 at 09:18 -0800, Conrad Steenberg wrote: On Sat, 2008-12-13 at 13:00 -0500, Jamie McCracken wrote: The disadvantage to inlining is it destroys the platform independence - IE you would not be able to create a gcc front end for vala nor would you be able to have vala-c++ or

Re: [Vala] inline C

2008-12-14 Thread Yu Feng
On Sun, 2008-12-14 at 07:45 +0100, Hans Vercammen wrote: On Sun, 2008-12-14 at 05:23 +0100, Hans Vercammen wrote: On Sat, 2008-12-13 at 22:05 -0500, Yu Feng wrote: Machines can be happy if the ccode are written carefully, but a bilingual text is usually difficult for human beings

Re: [Vala] inline C

2008-12-13 Thread Yu Feng
On Sun, 2008-12-14 at 00:55 +0100, Hans Vercammen wrote: On Sun, 2008-12-14 at 00:51 +0600, Ildar Mulyukov wrote: On 14.12.2008 00:00:31, Jamie McCracken wrote: On Sat, 2008-12-13 at 17:46 +, Karl Lattimer wrote: On Sat, 2008-12-13 at 23:44 +0600, Ildar Mulyukov wrote: What do you

[Vala] Signals for GType fundanmental classes.

2008-11-23 Thread Yu Feng
http://bugzilla.gnome.org/show_bug.cgi?id=561989 test case: class AAA { public AAA() { } public signal void changed(); public void change() { changed(); } public static int main(string[] args) { AAA aaa = new AAA(); aaa.changed+= (o) = {

Re: [Vala] Chaining up constructors.

2008-11-23 Thread Yu Feng
On Sun, 2008-11-23 at 10:03 +0100, Jürg Billeter wrote: On Sun, 2008-11-23 at 00:13 -0500, Yu Feng wrote: Both vala 0.5.1 and trunk fails to smoothly switching the parent classes. if I have extra stuff in the creation methods. Do you have an example or bugzilla link? I was experiencing

Re: [Vala] Chaining up constructors.

2008-11-23 Thread Yu Feng
On Sun, 2008-11-23 at 09:40 +0100, Hans Vercammen wrote: On Sun, 2008-11-23 at 00:13 -0500, Yu Feng wrote: Hi Hans, Thanks for the reply. To avoid confusion, can we use CreationMethod and construct block to refer the entities? sure, no problem. For class types I will use

Re: [Vala] Chaining up constructors.

2008-11-23 Thread Yu Feng
On Sun, 2008-11-23 at 11:32 +0100, Jürg Billeter wrote: On Sun, 2008-11-23 at 05:07 -0500, Yu Feng wrote: On Sun, 2008-11-23 at 11:00 +0100, Jürg Billeter wrote: On Sun, 2008-11-23 at 04:53 -0500, Yu Feng wrote: On Sun, 2008-11-23 at 10:03 +0100, Jürg Billeter wrote: On Sun, 2008-11

Re: [Vala] Chaining up constructors.

2008-11-23 Thread Yu Feng
On Sun, 2008-11-23 at 20:24 +0100, Jürg Billeter wrote: On Sun, 2008-11-23 at 14:01 -0500, Yu Feng wrote: On Sun, 2008-11-23 at 11:32 +0100, Jürg Billeter wrote: On Sun, 2008-11-23 at 05:07 -0500, Yu Feng wrote: On Sun, 2008-11-23 at 11:00 +0100, Jürg Billeter wrote: You should use

[Vala] construct block for gtype fundamental classes.

2008-11-23 Thread Yu Feng
Jurg: I am glad to come up with the second patch to symmetrize the GObject and non-compact classes: Bug 562070. We already have the _constructor function in CCode for GType classes if there is a construct block, this patch changes the signature of the function by a little bit, and invokes the

  1   2   >