[Vala] libexif vapi bindings

2009-04-06 Thread Jim Nelson
encounter bugs. The vapi can be found at http://trac.yorba.org:8000/browser/photo/trunk/libexif.vapi i've attached it below as well. Enjoy, -- Jim Nelson Yorba -- [CCode ( cprefix = Exif, lower_case_cprefix=exif_ )] namespace Exif { [CCode

[Vala] Gtk.TreeSelection bindings

2009-04-16 Thread Jim Nelson
for the target, I'm not sure its necessary. -- Jim Nelson Yorba ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

[Vala] NativeVolumeMonitor binding

2009-04-17 Thread Jim Nelson
pointer for a method call? Because this is a virtual method, it can't be static. Thanks, -- Jim Nelson Yorba ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

[Vala] valac 0.7.1 bug: Delegates are typedef'd before enums in generated C code.

2009-04-27 Thread Jim Nelson
, TEST_ENUM_xyzzy, xyzzy}, {0, NULL, NULL}}; test_enum_type_id = g_enum_register_static (TestEnum, values); } return test_enum_type_id; } void _main (void) { } int main (int argc, char ** argv) { g_type_init (); _main (); return 0; } Thanks, -- Jim Nelson Yorba

[Vala] lock (this) not available?

2009-05-13 Thread Jim Nelson
I noticed while coding with threads that the statement lock (this) is not available. valac returns this error: error: Expression is either not a member access or does not denote a lockable member Is it part of the language spec that only members can be locked and not the this object itself? I

Re: [Vala] Libgee's Roadmap proposal

2009-07-21 Thread Jim Nelson
- Are there some things missing ? How about remove() for Iterator? -- Jim ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

[Vala] Vala 0.7.7: unsupported lvalue in postfix expression

2009-09-28 Thread Jim Nelson
Hello, When I build with the new 0.7.7 compiler I see these sorts of errors: error: unsupported lvalue in postfix expression for these sorts of lines: a[ctr]++; where a is (for example): int[] a = new int[3]; The solution seems to be to replace the postfix with the assignment infix

[Vala] Questions about Launchpad PPA

2009-12-29 Thread Jim Nelson
, -- Jim Nelson ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Support for method overloading.

2010-01-07 Thread Jim Nelson
Discussed here: http://live.gnome.org/Vala/ValaForJavaProgrammers#Method_Overloading (The whole page is worth reading, in fact.) -- Jim On Thu, Jan 7, 2010 at 2:01 PM, Fabzter fabos...@gmail.com wrote: Hi. I have been playing with Vala for some months. I find it to be a really cool language,

Re: [Vala] Construct exceptions from numeric error codes

2010-02-11 Thread Jim Nelson
You want to use an errordomain, not instantiate your own GLib.Error. As you said earlier, this is a non-GLib library. It probably shouldn't be throwing GLib errors. I've dealt with this when writing code with a non-GLib library (Sqlite), trapping its error codes, and then throwing exceptions

Re: [Vala] IDE ?

2010-03-16 Thread Jim Nelson
There is limited support for autotools. Valencia can detect your project root (i.e. the master Makefile) for an autotools project and execute make when you select the Project - Build command, but it won't know which executable you want when you select Project - Run. More information can be found

Re: [Vala] Binding a function that return a structure, not a pointer

2010-04-12 Thread Jim Nelson
Just to add to this, I've created a VAPI for libexif we use in Shotwell. I've not submitted it because it's incomplete. You might want to check it out: http://trac.yorba.org/browser/shotwell/trunk/vapi/libexif.vapi -- Jim On Mon, Apr 12, 2010 at 5:05 AM, Abderrahim Kitouni

Re: [Vala] metadata file format

2010-07-12 Thread Jim Nelson
THANK YOU. This is invaluable. I second Frederick, it would be great to get this on a Wiki. -- Jim On Sat, Jul 10, 2010 at 8:32 PM, tecywiz121 tecywiz...@hotmail.com wrote: So, I'm a little sick and tired of not being able to find a reference on the metadata file format used when binding a

Re: [Vala] this = Object

2010-09-28 Thread Jim Nelson
If you're trying to use a delegate from C, you need to be aware of the delegate's target, which is a hidden parameter to Vala code but visible in C. If you compile your code with the --save-temps flag enabled, you can see how a delegate is constructed in C. For example: delegate void

Re: [Vala] vala code generation too constrained?

2011-01-11 Thread Jim Nelson
I'll jump in here. The original poster is asking that Vala relax some of its restrictions that are in place due to its relationship with C. The only restriction that's been named so far (unless I missed something) is overloaded method names. Although I used overloaded methods a lot in my past

Re: [Vala] Behavior on null pointers

2011-01-17 Thread Jim Nelson
On Sat, Jan 15, 2011 at 12:23 PM, Thomas Müller muell...@googlemail.comwrote: Shouldn't a programming language, that offers exception handling, throw some kind of null pointer exception? A lot of languages do, but it's not set in stone. Vala doesn't for a variety of reasons. On top of

[Vala] warning: copying delegates is discouraged

2011-06-08 Thread Jim Nelson
Running valac from master, I'm seeing this warning pop up a lot: warning: copying delegates is discouraged Can someone explain the rationale for this? (I'm guessing it has to do with references.) Are there any blessed workarounds (other than not copying delegates)? -- Jim

Re: [Vala] async method and delegate

2011-06-20 Thread Jim Nelson
Regarding copying delegates, it is intentional. The Vala Journal has a nice write-up about ways to work around the problem: http://valajournal.blogspot.com/2011/06/vala-0130-released.html -- Jim On Sun, Jun 19, 2011 at 9:20 PM, Nor Jaidi Tuah norjaidi.t...@ubd.edu.bnwrote: valac version:

Re: [Vala] What is the right syntax for defining pointers or references or aliases in Vala ?

2011-06-21 Thread Jim Nelson
Actually, string.strip() (which uses g_strstrip) returns a new string. However, you're right, string is not immutable. This works: void main() { string a = abc; stdout.printf(%s\n, a); a.data[0] = 'A'; stdout.printf(%s\n, a); } -- Jim On Tue, Jun 21, 2011 at 12:27 AM,

Re: [Vala] async method and delegate

2011-06-21 Thread Jim Nelson
On Mon, Jun 20, 2011 at 6:27 PM, Nor Jaidi Tuah norjaidi.t...@ubd.edu.bnwrote: On Mon, 2011-06-20 at 17:37 -0700, Jim Nelson wrote: With async, the delegate *is* copied, you just don't see it in the Vala code. With an async method, when the thread of execution yields, the state

[Vala] VAPI metadata problem

2011-07-04 Thread Jim Nelson
Hello, I'm attempting to build a VAPI for GMime. (If anyone can point me to a completed version, it would be appreciated!) The problem I'm running into is this: The namespace for the module is GMime. The class GMimeStream's type conversion macro is GMIME_STREAM but valac auto-generates it as

Re: [Vala] Why is my menubar not showing up?

2011-07-29 Thread Jim Nelson
It works for me. Are you sure you're building it correctly? -- Jim On Fri, Jul 29, 2011 at 12:26 PM, Fred van Zwieten fvzwie...@gmail.comwrote: Yes, Sorry, that was the first try, of course, but that also doesn't work. Code: using Gtk; class menusystem : Gtk.Window { public

Re: [Vala] Why is my menubar not showing up?

2011-07-29 Thread Jim Nelson
code and gtk code, so i'm not sure what causes it. But great you wanna help out anyways. Greetz, Fred 2011/7/29 Jim Nelson j...@yorba.org: I built it that way. I see the window and the menu bar. Maybe you should tell me what you're seeing and how that's different than what

Re: [Vala] Safe call operator

2012-02-01 Thread Jim Nelson
I was going to mention that as well. Null handling in Java is not analogous to Vala's strategy, if for no other reason than there's no NPE. It looks to me the idea of a future Vala that emphasizes code correctness is that it will catch things like this: Xyxxy? x = get_xyzzy(); int result =

Re: [Vala] [PATCH] enum: foreach capability

2012-04-10 Thread Jim Nelson
I too would like to see this. Maybe Team Vala could take a look at the patch and comment? https://bugzilla.gnome.org/show_bug.cgi?id=624691 (Sebastian, I'm assuming the patch you attached to the above ticket is your latest code.) -- Jim On Fri, Mar 23, 2012 at 8:53 PM, Sebastian Reichel

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

2012-06-04 Thread Jim Nelson
On Sat, Jun 2, 2012 at 9:46 AM, Jürg Billeter j...@bitron.ch wrote: * Add --enable-gobject-tracing commandline option. Is there any documentation to explain what GObject tracing is and how to use it? -- Jim___ vala-list mailing list

Re: [Vala] sqlheavy?

2012-07-02 Thread Jim Nelson
Let me explain the situation with Geary and SQLHeavy. The ticket Eric referred to earlier does not fully describe our issues. (Warning: this is *long*.) First, I have to correct what Eric said earlier. It's not that SQLHeavy isn't up-to-date, rather, the features Geary most heavily relies upon

[Vala] .typelib support in Vala

2012-08-30 Thread Jim Nelson
Last year there was some discussion on the list about Vala's .gir support (https://mail.gnome.org/archives/vala-list/2011-April/msg3.html).  Jürg said that Vala only reads the XML (.gir files) and not the .typelib files. My question is, how should a developer deal with a situation where a

Re: [Vala] .typelib support in Vala

2012-08-30 Thread Jim Nelson
Thanks for the quick reply, Evan.  To answer some of your questions: Evan Nemerson e...@coeus-group.com wrote: Sometimes you may have to install an extra package, but the GIRs should be available. I'll probably open a ticket with Ubuntu about this. You should pass the pkg-config names of

Re: [Vala] .typelib support in Vala

2012-08-30 Thread Jim Nelson
On Thu, Aug 30, 2012 at 4:52 PM, Evan Nemerson e...@coeus-group.com wrote: Assuming you're talking about GLib, GObject, and Gio, Debian/Ubuntu already distribute the relevant GIRs. They're in libgirepository1.0-dev. I figured that out five minutes ago.  Thanks.  B-) Sorry, what I wrote is

Re: [Vala] How to get return values from async methods

2012-10-17 Thread Jim Nelson
Yes, your closure isn't being called until some time after get_results() returns. Remember, async works with the event loop.  A good way to think of it is like this: some_async_method.begin() doesn't call the method, rather .begin schedules the method on the event loop for later execution.  

Re: [Vala] How to get return values from async methods

2012-10-17 Thread Jim Nelson
at 1:45 PM, tomw t...@ubilix.com wrote: On Mi, 2012-10-17 at 20:26 -0007, Jim Nelson wrote: Yes, your closure isn't being called until some time after get_results() returns. Remember, async works with the event loop. A good way to think of it is like this: some_async_method.begin() doesn't

Re: [Vala] Unit Testing in Vala

2012-10-19 Thread Jim Nelson
For the record, Yorba attempted to contact the original developer of Valadate and received no response.  We had some testing needs awhile back, and so we forked.  The work we did was not to add features, but merely to rip things out to get it to compile with the then-current version of Vala.

Re: [Vala] Unit Testing in Vala

2012-10-19 Thread Jim Nelson
On Fri, Oct 19, 2012 at 12:49 PM, Steven Oliver oliver.ste...@gmail.com wrote: I am sorry if I made it sound like you guys had done something wrong. That was not my intention! No problem.  No offense was taken. Is there a reason you're not currently using it, even if you aren't further

Re: [Vala] Bug in async methods?

2012-10-22 Thread Jim Nelson
For async to work properly, you must run the GLib MainLoop.  MainLoop is where your async closure for test_function.begin() is called.  It's where all callbacks are scheduled, actually. The only reason this works is that in the case of DO_YIELD you stash the test_function.callback and then

Re: [Vala] Bug in async methods?

2012-10-22 Thread Jim Nelson
called even without a main loop :? Thanks! El 23/10/12 00:03, Jim Nelson escribió: For async to work properly, you must run the GLib MainLoop. MainLoop is where your async closure for test_function.begin() is called. It's where all callbacks are scheduled, actually

Re: [Vala] Bug in async methods?

2012-10-22 Thread Jim Nelson
to SimPy (this is, based on async methods) and it would be much more convenient to be able to work that way in those cases. El 23/10/12 00:22, Jim Nelson escribió: It would take me a bit of time to explain async (I've thought about blogging about it), but the short answer is: Vala's

Re: [Vala] delegates in vala

2013-02-13 Thread Jim Nelson
Although the compiler messages have changed, there is a long-standing bug with delegates and the ternary operator: https://bugzilla.gnome.org/show_bug.cgi?id=599349 -- Jim On Wed, Feb 13, 2013 at 11:48 AM, Albert Hopkins mar...@letterboxes.org wrote: On Wed, Feb 13, 2013, at 01:49 PM, Albert

Re: [Vala] [Announce] Repository for third-party Vala bindings

2013-02-22 Thread Jim Nelson
Hi Evan, Is there any thought that this repo might be a staging ground for migrating VAPIs into Vala distribution? Also, will there be packaging efforts to get these out into the distros? -- Jim On Fri, Feb 22, 2013 at 3:41 AM, Evan Nemerson e...@coeus-group.com wrote: I've created a

Re: [Vala] Call default mail app (like evolution) from a Vala/Gtk+ app

2013-02-27 Thread Jim Nelson
I would think Gtk.show_uri() or AppInfo.launch_default_for_uri() would do the trick. -- Jim On Wed, Feb 27, 2013 at 5:39 PM, jezra je...@jezra.net wrote: Hello, I do not have a default email program, but the following code may work for you. It calls a command line tool to launch email.

Re: [Vala] How track memory leaks ?

2013-03-18 Thread Jim Nelson
This is a problem we faced in Geary.  We went several directions before adding this, which helped immensely: http://redmine.yorba.org/projects/geary/repository/revisions/master/entry/src/engine/api/geary-base-object.vala Note that this approach is of limited utility, as it requires *all* your

Re: [Vala] GSOC Idea: LLVM Backend?

2013-04-29 Thread Jim Nelson
Kenny, I'm not on the Vala team, so take the following only as the opinion of a long-term Vala coder. I don't find a LLVM code generator for valac to be very exciting.  Even if you could complete an LLVM generator this summer, I'd be highly hesitant to move a project like Shotwell or Geary

Re: [Vala] GSOC Idea: LLVM Backend?

2013-04-30 Thread Jim Nelson
On Tue, Apr 30, 2013 at 12:16 AM, Luca Bruno lethalma...@gmail.com wrote: Il 30/04/2013 02:15, Jim Nelson ha scritto: https://bugzilla.gnome.org/show_bug.cgi?id=684742 ‘2’ My mistake, I meant this ternary bug: https://bugzilla.gnome.org/show_bug.cgi?id=599349 https://bugzilla.gnome.org

Re: [Vala] memory management with structs

2013-05-20 Thread Jim Nelson
If you're using structs in Vala, be aware of this issue: https://bugzilla.gnome.org/show_bug.cgi?id=661041 -- Jim On Sat, May 18, 2013 at 2:41 AM, rastersoft ras...@rastersoft.com wrote: Hi all: How is the memory management in vala when using structs instead of classes? I presume they are

Re: [Vala] shared access to sqlite database

2013-08-07 Thread Jim Nelson
To chime in some agreement, we attempted many strategies to parallelize transactions and work around SQLite's locking issues in Geary before finally waving the white flag. Evan's correct, SQLite's built-in busy handler is what you want to use. In fact, we use a single background thread to

Re: [Vala] Tryout adding simple support for extension methods to valac

2013-10-14 Thread Jim Nelson
I'd like to jump in and say I think this is a great proposal and hope this comes to fruition. One question (for now): will this work for generic classes as well? -- Jim On Mon, Oct 14, 2013 at 2:09 PM, Luca Bruno lethalma...@gmail.com wrote: On Mon, Oct 14, 2013 at 7:31 PM, Philip Van Hoof

Re: [Vala] Tryout adding simple support for extension methods to valac

2013-10-17 Thread Jim Nelson
On Mon, Oct 14, 2013 at 12:57 PM, Luca Bruno lethalma...@gmail.com wrote: Generics are private and can't be accessed from the extern. I'm not sure what this means. Do you mean that the generic type is private and can't be accessed? What I'd like to know is if something like this would

Re: [Vala] Bug with cleared Gee.ArrayList

2013-11-11 Thread Jim Nelson
My bet is that it's a bounds error, i.e. you called ArrayList.get() with index 0 or index = ArrayList.size. (Note that the [] operator is actually a call to the .get() method.) -- Jim On Mon, Nov 11, 2013 at 11:15 AM, Daniel Brendle grindh...@skarphed.org wrote: Hi, fellow vala-people.

Re: [Vala] .gir and .metadata file warnings and errors

2013-12-11 Thread Jim Nelson
On Wed, Dec 11, 2013 at 3:47 PM, Evan Nemerson e...@coeus-group.com wrote: Don't use the GIR directly. GIRs take forever to parse anyways, why parse it every time you run valac? Use vapigen (without fatal warnings enabled) to parse the GIR to a VAPI, then use the VAPI. ... which means

Re: [Vala] .gir and .metadata file warnings and errors

2013-12-12 Thread Jim Nelson
On Thu, Dec 12, 2013 at 12:29 AM, Evan Nemerson e...@coeus-group.com wrote: You can still do this step as part of your build process—you don't need to include the generated VAPI in your repository. If you're worried about the user updating WebKit between Geary compilations while there is a

[Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-06 Thread Jim Nelson
Just wanted to give everyone a head's-up about a change that appeared in Vala 0.23. Previously you could do this in Vala: uint8[] ar = new uint8[10]; // ... fill ar with interesting bytes ... process((owned) ar, ar.length); ... where process() takes an array and a length field (sometimes

Re: [Vala] Planet Vala? (was: Re: [Genie] Re: Vala on Android)

2014-03-18 Thread Jim Nelson
I'm very interested. As far as blogs to add, I can't name any dedicated active Vala blogs (although I haven't looked recently). What I like about your proposal is that it would encourage more blog activity about Vala. -- Jim On Mon, Mar 17, 2014 at 7:48 PM, Evan Nemerson

Re: [Vala] Planet Vala

2014-03-21 Thread Jim Nelson
I tag all my Vala blog posts with a vala keyword. Can Planet Vala pull from a particular tag feed? -- Jim On Fri, Mar 21, 2014 at 12:21 AM, Evan Nemerson e...@coeus-group.com wrote: I've gone ahead and launched a blog aggregator for Vala at http://planet.vala-project.org (thanks to Jürg for

Re: [Vala] Thread Support

2014-08-14 Thread Jim Nelson
Adding some more descriptions like add and valac's --target-glib=2.32 flagtext to replacement attribute, in order to help developer how to proceed. Is this description correct? developer must use --target-glib in order to enable new features? --target-glib is simply telling Vala which

Re: [Vala] Gtk+ bindings update

2014-08-21 Thread Jim Nelson
Is this on a branch somewhere? I'd like to know how this affects Geary (and Yorba's other projects). -- Jim On Thu, Aug 21, 2014 at 11:41 AM, Luca Bruno lethalma...@gmail.com wrote: Thanks for your hard work. Is this change a requirement for the new stable release? Blocking some software?

Re: [Vala] Gtk+ bindings update

2014-08-21 Thread Jim Nelson
lethalma...@gmail.com wrote: Why is it a requirement? For which applications? On Thu, Aug 21, 2014 at 8:57 PM, Jim Nelson j...@yorba.org wrote: Is this on a branch somewhere? I'd like to know how this affects Geary (and Yorba's other projects). -- Jim On Thu, Aug 21, 2014 at 11:41 AM, Luca

Re: [Vala] Gtk+ bindings update

2014-08-21 Thread Jim Nelson
I will probably patch the set_default_icon_list() bug today using Evan's suggested patch just because it looks like a time-bomb waiting to go off. It turns out Shotwell has same problem, although that code has been in place since 2010, so the time-bomb has a slow-burning fuse. Shotwell has

Re: [Vala] Gtk+ bindings update

2014-08-26 Thread Jim Nelson
On Sat, Aug 23, 2014 at 8:12 AM, Michael Catanzaro mcatanz...@gnome.org wrote: Non-GNOME programs certainly will not care one way or the other whether they are broken by vala 0.26 or by vala 0.28. And the changes are certainly bugfixes, not features or UI changes that would be affected by

[Vala] A suggestion for future releases

2013-11-20 Thread Jim Nelson
Geary 0.4.1 (released a little over a week ago) fails to compile with Vala 0.22.1. This is due to two changes in Vala: * The libnotify binding change * Vala 0.22.1 catches binding errors in WebKitGTK's .gir file that were not caught in 0.22.0. These are documented at