Vala/Geanie C integration and Python

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
kilon
Posts: 17
Joined: Fri 19 Jun 2009, 07:07

Vala/Geanie C integration and Python

#1 Post by kilon »

hi there , I am very interested in Vala and especially in Geanie as I am already a python developer.

I was wondering how easy is for Geanie to use existing C libraries. I know already that Vala needs a VAPI file that defines classes and functions , but what about geanie ?

If I am not asking to much , can someone compare Geanie/Vala C integration with Python's ctypes ?

Thank you!!!

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

Genie uses the same vapi files as Vala.
For exmple Puppybrowser written in Genie uses /usr/share/vala/vapi/gtkmozembed.vapi.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

kilon
Posts: 17
Joined: Fri 19 Jun 2009, 07:07

#3 Post by kilon »

MU wrote:Genie uses the same vapi files as Vala.
For exmple Puppybrowser written in Genie uses /usr/share/vala/vapi/gtkmozembed.vapi.

Mark
thanks for the fast reply.

Another question , let us say that I want to use only a small portion of a C library , do I have to declare all the function/classes in the VAPI or only the classes/functions that I intend to use ?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#4 Post by MU »

I'm absolutely no expert in this, but as far as I understand it, only the functions you need.
For example, Nicolas works on NicEdit, a editor using gtksourceview.

I tried to add syntax highlighting to one of the first versions.
Using the original gtksourceview-2.0.vapi I could not use the function "Gtk.SourceLanguage guess_language", as it was not included there.

Via google I found the missing definition that I had to add to the vapi file, and now I can use this function.
This indicates, that some vapi files may be incomplete, and so if you create your own one, you need to add only what you need.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

kilon
Posts: 17
Joined: Fri 19 Jun 2009, 07:07

#5 Post by kilon »

MU wrote:I'm absolutely no expert in this, but as far as I understand it, only the functions you need.
For example, Nicolas works on NicEdit, a editor using gtksourceview.

I tried to add syntax highlighting to one of the first versions.
Using the original gtksourceview-2.0.vapi I could not use the function "Gtk.SourceLanguage guess_language", as it was not included there.

Via google I found the missing definition that I had to add to the vapi file, and now I can use this function.
This indicates, that some vapi files may be incomplete, and so if you create your own one, you need to add only what you need.

Mark
MARK you are amazing , thanks again for the super fast reply.

Well this is excellent news and I feel obliged to give Geanie a try.

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#6 Post by ttuuxxx »

I came across a Vala image viewer/editor today, I couldn't compile it because i'm using 2.14X, but here's the link for other using woof http://www.yorba.org/shotwell/
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#7 Post by BarryK »

And of course one of the great big selling points of Vala and Genie, compared with Python, is that no runtime bindings are required to access any of the C shared libraries. Result, very small and fast executables, as small as programs coded in C.

Ttuuxxx,
As Gtkam is unstable -- though I haven't tested the very latest version -- every previous release has been flakey -- I'm always on the lookout for an alternative.

Shotwell looks good, but I wonder about the "Gnome" part of the description... I just looked:

Shotwell's other dependencies include:

* gee-1.0 (0.1.5) (Included with Vala 0.7.3)
* gtk+-2.0 (2.14.4)
* libgphoto2 (2.4.2)
* libexif (0.6.16)
* sqlite3 (3.5.9)
* unique-1.0 (1.0.0)
* hal (0.5.11)
* dbus-glib-1 (0.76)

...don't know what 'unique' is. Oh 'hal', that's a nuisance. A bit of a problem to put into the Puppy4 series, but fine for Upup.

Note the statement that 'gee' is included with 'vala'. No it isn't. There is an internal 'gee' in vala, but to use the extended data types when writing programs you have to install the separate 'libgee' package -- that was an issue that was explained to me in the vala mail list awhile back.
[url]https://bkhome.org/news/[/url]

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#8 Post by ttuuxxx »

Hi Barry I did some searching about gtkam and found a inersting writeup about how it works and alternative programs http://www.linux.com/archive/feature/56128 , probably you or one of the other developers could make a Pcam program, based on libgphoto2,
actually if could even be better than any factory built camera software,
I take it the frontend would be vala using libgphoto2 and dcraw http://www.cybercom.net/~dcoffin/dcraw/ also gphoto2 could be used with libgphoto. http://www.gphoto.org/proj/gphoto2/
But DCraw does standout as the best quality by far. Then you also have openraw http://www.openraw.org/. well thats the start of my quest for camera knowledge. :)
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#9 Post by aragon »

@bk + ttuuxxx
an alternative to building a gui would be to use gphotofs and incorporate a cam-mount-option in pmount.

http://www.gphoto.org/proj/gphotofs/

aragon

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#10 Post by ttuuxxx »

aragon wrote:@bk + ttuuxxx
an alternative to building a gui would be to use gphotofs and incorporate a cam-mount-option in pmount.

http://www.gphoto.org/proj/gphotofs/

aragon
Yes That would be cool, you plug the camera in and hotpup loads it automatically and the you just drag and drop images.videos from the folders. :)
ttuuxxx

Ps that method still uses libgphoto2 which is somewhat large.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

Post Reply