Page 1 of 1

[Beta] GObjectIntrospection Support [Updated]

Posted: Sat Sep 18, 2010 9:23 pm
by remi_meier
Hi there

I had some time today and tried to wrap my head
around the gir stuff that is coming up in the Gnome
universe.
This means for you that you can now generate PB
includes (imports) of most gnome libraries with a
simple script (which is actually written in Python
which should not disturb you much :mrgreen: ).
As I have just written this code in a few hours, the
includes will not have alpha quality. Actually I only
tested the GDK-gir, which compiles.
You may notice, that structures are commented. This
has three reasons. First the PB compiler rejects those
that are already declared, second the structures actually
are different (a wee bit) and third they certainly contain
bugs.
Another to-do are prototypes (just because I am lazy),
documentation support and if popular enough, I may
write a version that produces nice interfaces instead
of imports.

It would be very nice if some people help me test the
imports, especially 64bit people!

The usage is quite simple. Run the following command
in the extracted directory and you will get a gdk2.0.pbi.
Maybe you need a "chmod +x gir2pb.py" first:

Code: Select all

./gir2pb.py gir-files/Gdk-2.0.gir > gdk2.0.pbi
The code is of course included:
http://remi.secretly.de/downloads/gir2pbV4.tar.bz2

Read more about GObjectIntrospection here:
http://live.gnome.org/GObjectIntrospection

greetz
remi

Re: [Alpha] GObjectIntrospection Support

Posted: Sun Sep 19, 2010 1:17 pm
by remi_meier
Fixed a few bugs and added a .pbi which
imports all the girs in the gir-files directory.
But sadly those ~20900 lines crash my PB
compiler :mrgreen:

So anybody who is interested in:
  • - ATK
    - Clutter
    - COGL
    - Epiphany
    - GConf
    - Gdk, -pixbuf, -X11
    - GMenu
    - GnomeGames
    - GStreamer, -app, -audio, -base, -check, -controller, -Fft, -interfaces, -net, -netbuffer, -pbutils, -riff, -rtp, -rtsp, -sdp, -tag, -video
    - Gtk
    - Json
    - Pango
    - Wnck
or wants to use his/her Vala classes in PB has
something to play with now.

Re: [Alpha] GObjectIntrospection Support

Posted: Tue Sep 21, 2010 7:07 pm
by Rook Zimbabwe
Remi this is good work! I haveintended to play more with OGRE this year and this should CERTAINLY come in useful!!! :D

Keep up the GOOD WORKS!!! :mrgreen:

Re: [Alpha] GObjectIntrospection Support

Posted: Thu Oct 07, 2010 7:14 pm
by hallodri
Uhhh. geil...

Thanks Remi, finally all the gtk functions in one place. Thank you.

Win32 Python 3.1.2, may not "print" without parentheses.

Re: [Alpha] GObjectIntrospection Support

Posted: Sat Oct 16, 2010 9:18 am
by remi_meier
Sorry for the late reply, there was a lot going on
in RL :)

@Rook Zimbabwe:
I'm not really sure how this would help you, but
thanks!

@hallodri:
I surely hope all the gtk functions are imported
correctly. Let me know if you find any problems!
About the "print" error: Yep, I'm still using Python
2.6... Meanwhile, you might wanna try '2to3' until
I adapt to Python3 in some distant future.
http://diveintopython3.org/porting-code ... -2to3.html

greetz
Remi

Re: [Alpha] GObjectIntrospection Support

Posted: Sun Apr 24, 2011 4:48 am
by idle
That's really handy thanks.
Will have a go at doing this natively in PB, not that there's anything wrong with python.

Re: [Alpha] GObjectIntrospection Support

Posted: Wed Apr 27, 2011 4:43 pm
by remi_meier
That's perfect as I probably will not really go any
further with this. I hope you will be successful and
also implement the missing stuff like prototypes
and perhaps nice interfaces :)
Since Gnome3 is released, a lot of new components
support introspection. Here is a short list of those
that have easily installable bindings in Ubuntu 11.04:

- Buzztard
- Lightdm
- AppIndicator
- ATK
- ATSPI
- Champlain
- Clutter, -GST, -GTK
- CouchDB
- DBusMenu
- Dee
- Gee
- GES
- Desktopcouch
- Evince
- Freedesktop
- GConf
- GDA
- GData
- GDKPixBuf
- GLib
- GMenu
- GNOME Games
- Grip
- GSSDP
- GStreamer
- GTK2/3
- GTKSource
- GTop
- GUdev
- GUPNP

And of course a lot more that are not in the Ubuntu
repositories. It's an awesome time to use GNOME :mrgreen:

greetz
remi

Re: [Beta] GObjectIntrospection Support [Updated]

Posted: Thu Jan 12, 2012 11:38 am
by remi_meier
Update:
- fix bug when function can "throw" an error
- comment duplicate function declarations
- fix library path problems using pkg-config
- add type safe prototype / callback support

For download see first post.

Re: [Beta] GObjectIntrospection Support [Updated]

Posted: Thu Jan 12, 2012 7:30 pm
by idle
Great thanks

Re: [Beta] GObjectIntrospection Support [Updated]

Posted: Thu Jan 12, 2012 8:20 pm
by remi_meier
You're welcome :)

Just fixed another issue about methods of
"Unions" not being imported.

Re: [Beta] GObjectIntrospection Support [Updated]

Posted: Thu Jan 12, 2012 8:49 pm
by idle
thanks, I'd really like to contribute but alas I'm idle in python :wink:

Re: [Beta] GObjectIntrospection Support [Updated]

Posted: Thu Jan 12, 2012 9:43 pm
by remi_meier
:D
Let me know if you want to get active :wink:

Re: [Beta] GObjectIntrospection Support [Updated]

Posted: Fri Jan 13, 2012 4:50 pm
by remi_meier
Update:
- do manual x86 / x64 and unicode / ascii paddings in structures
- handle constant name clashes because of case-insensitivity

E.g. Clutter.gir now exports all constants.

Re: [Beta] GObjectIntrospection Support [Updated]

Posted: Tue Jan 08, 2013 10:17 pm
by uwekel
Thank you very much! Now i can even work with Glade GUI designer :-)

Still a problem are the existing GTK2 bindings of PB, which often get a naming conflict. I decided just to take the synopsis without any structures. Structure i will add when they are required and different from GTK2.