Re: [Vala] Unregister a GType

2013-05-04 Thread PCMan
On Sun, May 5, 2013 at 2:15 AM, Igor Azevedo igor.azev...@neticle.pt wrote: 2013/5/4 Luca Bruno lethalma...@gmail.com On Sat, May 4, 2013 at 6:29 PM, Igor Azevedo igor.azev...@neticle.ptwrote: Hello, I'm developing an application that dynamically loads plugins using GModule. Each of the

Re: [Vala] Generated vapi file for a library not compilable.

2012-11-29 Thread PCMan
need to run the command everytime after the vapi file is generated. However, I cannot find a proper automake mechanism to do it automatically. Any suggestions? On Thu, Nov 29, 2012 at 1:40 PM, Axel FILMORE axel.film...@gmail.comwrote: On Thu, 29 Nov 2012 13:09:53 +0800 PCMan pcman...@gmail.com

Re: [Vala] Generated vapi file for a library not compilable.

2012-11-29 Thread PCMan
, Jürg Billeter j...@bitron.ch wrote: On Thu, 2012-11-29 at 10:13 +0800, PCMan wrote: All of the errors I got are like these: VALAC lxpanel2_vala.stamp lxpanel-applet.vapi:10.27-10.49: error: The type name `Lxpanel.AppletInfo' could not be found In lxpanel2.vala you have a class

Re: [Vala] Generated vapi file for a library not compilable.

2012-11-29 Thread PCMan
Really thank you , Jürg Billeter. My problem is solved by renaming that class to avoid conflicts. Mailing list is good. I spent hours and hours trying to workaround this and did not find any clue. I should have came here earlier. Thanks! On Thu, Nov 29, 2012 at 5:26 PM, PCMan pcman...@gmail.com

Re: [Vala] Is creating dbus interfaces in type modules (plugins) broken?

2012-11-29 Thread PCMan
, PCMan wrote: I tried to develop some type modules for my program. Everything works fine initially and [ModuleInit] registered GObject dynamic classes automagically as expected. However, after I move a previously working dbus interface to that type module, I got crashes. Support for dynamic

[Vala] Is creating dbus interfaces in type modules (plugins) broken?

2012-11-28 Thread PCMan
Hello, I tried to develop some type modules for my program. Everything works fine initially and [ModuleInit] registered GObject dynamic classes automagically as expected. However, after I move a previously working dbus interface to that type module, I got crashes. My source code is here:

[Vala] Generated vapi file for a library not compilable.

2012-11-28 Thread PCMan
Hello, I got another issue with vala. I moved the core part of my program to a separate library, and let the main program call that library. The library itself compiles correctly. However, the genrated vapi file is not usable by the main program. Both parts are written in vala. The generated vapi

Re: [Vala] Generated vapi file for a library not compilable.

2012-11-28 Thread PCMan
Sorry that I forgot to paste the complete vapi file generated It's here: http://pastebin.com/v2j6CnXq Thanks a lot! On Thu, Nov 29, 2012 at 10:13 AM, PCMan pcman...@gmail.com wrote: Hello, I got another issue with vala. I moved the core part of my program to a separate library, and let

Re: [Vala] Generated vapi file for a library not compilable.

2012-11-28 Thread PCMan
vala code directly. So, it seems that it's a bug in valac? On Thu, Nov 29, 2012 at 12:07 PM, Axel FILMORE axel.film...@gmail.comwrote: On Thu, 29 Nov 2012 10:13:40 +0800 PCMan pcman...@gmail.com wrote: Hello, I got another issue with vala. I moved the core part of my program to a separate

Re: [Vala] ftp library with vala

2012-08-13 Thread PCMan
Hello, To the best of my knowledge, libcurl is the most comprehensive and reliable one. I'd suggest using it. Since its APIs are very simple, it won't be too hard to fix the binding. The most parts of libcurl are controlled by flags defined with #defines and enum values. The real API functions are

Re: [Vala] Get default terminal emulator?

2012-06-22 Thread PCMan
On Fri, Jun 22, 2012 at 6:46 PM, Thomas Jollans t...@jollybox.de wrote: Hi list, How do I get the user's default terminal emulator with GLib/GIO? I would assume it involves GLib.AppInfo in some way, but it's not as straightforward as that since there isn't really a MIME type associated with

Re: [Vala] Too many arguments in generated code

2012-04-05 Thread PCMan
On Thu, Apr 5, 2012 at 4:53 PM, tomw t...@ubilix.com wrote: Hi, I'm about to port the Skeltrack [1] skeleton tracker to Vala. So far everything works fine, except getting the actual joints from the joint list. The code in C is pretty straight forward: head = skeltrack_joint_list_get_joint

[Vala] How to use [ModuleInit] and GTypeModule?

2012-02-16 Thread PCMan
The sample here did not mention GTypeModule and did not contain [ModuleInit], either. https://live.gnome.org/Vala/TypeModules Though its title is TypeModules, it did not show how to use GTypeModule. I tried to google for some exmples and found that three is an undocumented attribute [ModuleInit].

Re: [Vala] Safe call operator

2012-02-01 Thread PCMan
This can induce hard to debug errors. For example, something should raise an error or an execption now may return 0 only. This return value might accidentally be used by other parts of the program. When the project become larger, it's hard to trace this bug. On Tue, Jan 31, 2012 at 11:27 PM,

[Vala] How to define a const string array in Vala?

2011-12-21 Thread PCMan
I C language, I can do this: const char* strs[] = { string1, string2, string3, NULL }; In Vala, I cannot find a way to do the same. Defining a string[] will cause copy of every constant string. If I use unowned, like this: unowned string strs[] = { ... }; This did not generate the

Re: [Vala] Debugging

2011-12-16 Thread PCMan
I believe that he is talking about reading generated C code during debugging. When there is a crash, gdb listed generated C code rather than vala source. As everyone knows, the C code generated by vala is not quite readable and contains quite a lot of temporary variables, which makes debugging

Re: [Vala] Can adding new virtual method break ABI?

2011-12-16 Thread PCMan
If you need to do these things manually, then what's the point in using vala? It's the job of compilers. People who like to do the job of compilers manually should use GObject/C instead. Manually filling a virtual function table and calculate offset of pointers are really of fun. lol Creating some

[Vala] Queue failed to free elements during destruction

2011-11-16 Thread PCMan
Hi list, Is it by design or it's a bug? I noticed that data elements of Queue are not freed during destruction of the queue. For example: [Compact] class Data { public string data1; public string data2; } class Test { Test() { } private QueueData? queue; } The generated C code did

[Vala] Returning StringBuilder.str in functions causes unnecessary strdup().

2011-11-06 Thread PCMan
Hello, I examined the code generated by vala and found a problem. Vala does an unnecessary g_strdup() call if I return StringBuilder.str as return value. For example: function string get_str() { var str = new StringBuilder(); str.append(some stuff); return str.str } Ideally this should

[Vala] How to get a const substring without copying?

2011-11-06 Thread PCMan
Hello, It's me again. In C language, sometimes we do this: char* uri = ftp://140.112.172.1;; char* ip = str + 6; // get the IP part of the string without copying. With vala, either string.substring() or string[start:end] needs copying. Is it possible to do the above in vala? In trivial cases

[Vala] How to generate inline C functions?

2011-11-05 Thread PCMan
Hi list, Is there any CCode attribute to make the generated C function inline? Or, is it possible to generate C macros instead of functions with vala? For example: class Test { inline public void func1() { } [Macro] public void func2() { } } The generated result: inline void

[Vala] How to ignore exceptions?

2011-10-30 Thread PCMan
Hi all, I started using Vala recently and I'm confused by exception handling in Vala. I'm quite used to write C/GObject code and handles GError. However, with exceptions, flow-control becomes quite different. For example, I'm reading values from a KeyFile. With C/glib, I can pass NULL GError*

Re: [Vala] How to ignore exceptions?

2011-10-30 Thread PCMan
= kf.get_string(group, key); This will give you a warning during compile but should be the thing you are looking for. jm. Am Sonntag, den 30.10.2011, 19:04 +0800 schrieb PCMan: Hi all, I started using Vala recently and I'm confused by exception handling in Vala. I'm quite used to write C

Re: [Vala] How to mix vala code and C code in one automake-based project correctly?

2011-10-27 Thread PCMan
build. Basically: 1. Write a binding file for your C code. 2. Make vala generate and use one header file for your vala files. This can be done by the vala_args makefile argument (see gmpc src/makefile). Good luck, feel free to mail if you need help. R, Q On Oct 27, 2011 6:54 AM, PCMan pcman

Re: [Vala] How to mix vala code and C code in one automake-based project correctly?

2011-10-27 Thread PCMan
For C from Vala calls, feel free to borrow ideas from Spek: https://github.com/alexkay/spek Also check out Sampala: https://github.com/tadeboro/Sampala and how about the opposite, calling vala from C? Adding --header or -H to vala flags will only generate a single large header file for all

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

2010-03-27 Thread PCMan
+0800, PCMan wrote: So, the problem is that the function return values are falsely marked as unowned in the VAPI. I reported a bug for it at https://bugzilla.gnome.org/show_bug.cgi?id=614044 However, with Vala, how can I make vala methods return a newly allocated GList with all objects

[Vala] PolicyKit vapi for Vala?

2010-03-27 Thread PCMan
Hi all, Another question, does anyone have a vapi file for Policykit? I tried to generate one with vala-gen-introspect according to vala tutorial but failed. Running vala-gen-introspect results in error messages + crashes. Have anyone tried this? As policykit is used more and more in conjunction

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

2010-03-26 Thread PCMan
Hi list, I tried to use Vala for the first time and the following code failed to generate correct C code. Is this a bug of vala or what's wrong with my code? (code is attached to the end of this mail) In addition, if I want to override a virtual function in a parent class with the prototype like

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

2010-03-26 Thread PCMan
On Sat, Mar 27, 2010 at 3:06 AM, Julian Andres Klode j...@jak-linux.org wrote: On Sat, Mar 27, 2010 at 02:37:37AM +0800, PCMan wrote: On Sat, Mar 27, 2010 at 12:17 AM, Julian Andres Klode j...@jak-linux.org wrote: Well, than f_finish() should probably not be there in the Volume interface