Introduce GObject
Introspection
HanIRC #gnome
gana코코아
Typical GObject Application
Development Layer
GLib/GObject
ATK Pango
GTK+
Clutter Gstreamer
Ext Libraries
PyGTK Gtk#
java-
gnome
Gtk2-
Perl
Ruby-
Gnome2
C
Apps
Python
Apps
Mono
Apps
Java
Apps
Perl
Apps
Ruby
Apps
If Library apis are changed...
●Library bump version
●PyGtk bump version
●gtk-sharp bump version
●java-gnome bump version
●Gtk2-Perl bump version
●Ruby-Gnome2 bump version
●듣보잡 language binding bump version
GI Enabled Development Layer
GLib/GObject
ATK Pango
GTK+
Clutter Gstreamer
Ext Libraries
libffi/libgirepository
C
Apps
Python
Apps
Mono
Apps
Java
Apps
Perl
Apps
Ruby
Apps
Typelib
Typelib
Typelib
Typelib
TypelibTypelib
Typelib
Typelib
If Library apis are changed...
●Library bump version (with TypeLib)
●don't need to change each language binding.
Overview of GI's Architecture
●http://live.gnome.org/GObjectIntrospection/Architecture
●Annotations in library source codes
ogtk_window_resize()
 http://goo.gl/8i7dx
ogtk_window_get_size()
 http://goo.gl/MOr8a
The Difference between GI and CLI
●TypeLib are not bytecodes
but metadata.
●Each Language Host are
just using each C libraries
with libgirepository.
●Each Libraries are CIL
bytecodes.
●Each Language Host must
build/run on CLR.
Example 1 for python binding
# using pygtk
import gtk
w = gtk.Window()
w.show_all()
gtk.main()
# using gir
import gi
gi.require_version("Gtk", "2.0")
from gi.repository import Gtk
w = Gtk.Window()
w.show_all()
Gtk.main()
Example 2 for js binding (gjs, seed)
imports.gi.versions.Gtk = '3.0'
const Gtk = imports.gi.Gtk;
Gtk.init(null, 0)
w = new Gtk.Window({ type: Gtk.WindowType.TOPLEVEL })
w.show_all()
Gtk.main()
Example 3
●WebPreview
ojs version
 http://goo.gl/W4wt3
opython version
 http://goo.gl/lHspm
References
●http://live.gnome.org/GObjectIntrospection and subpages
●http://git.gnome.org/browse/

Introduce gobject introspection

  • 1.
  • 2.
    Typical GObject Application DevelopmentLayer GLib/GObject ATK Pango GTK+ Clutter Gstreamer Ext Libraries PyGTK Gtk# java- gnome Gtk2- Perl Ruby- Gnome2 C Apps Python Apps Mono Apps Java Apps Perl Apps Ruby Apps
  • 3.
    If Library apisare changed... ●Library bump version ●PyGtk bump version ●gtk-sharp bump version ●java-gnome bump version ●Gtk2-Perl bump version ●Ruby-Gnome2 bump version ●듣보잡 language binding bump version
  • 5.
    GI Enabled DevelopmentLayer GLib/GObject ATK Pango GTK+ Clutter Gstreamer Ext Libraries libffi/libgirepository C Apps Python Apps Mono Apps Java Apps Perl Apps Ruby Apps Typelib Typelib Typelib Typelib TypelibTypelib Typelib Typelib
  • 6.
    If Library apisare changed... ●Library bump version (with TypeLib) ●don't need to change each language binding.
  • 7.
    Overview of GI'sArchitecture ●http://live.gnome.org/GObjectIntrospection/Architecture ●Annotations in library source codes ogtk_window_resize()  http://goo.gl/8i7dx ogtk_window_get_size()  http://goo.gl/MOr8a
  • 8.
    The Difference betweenGI and CLI ●TypeLib are not bytecodes but metadata. ●Each Language Host are just using each C libraries with libgirepository. ●Each Libraries are CIL bytecodes. ●Each Language Host must build/run on CLR.
  • 9.
    Example 1 forpython binding # using pygtk import gtk w = gtk.Window() w.show_all() gtk.main() # using gir import gi gi.require_version("Gtk", "2.0") from gi.repository import Gtk w = Gtk.Window() w.show_all() Gtk.main()
  • 10.
    Example 2 forjs binding (gjs, seed) imports.gi.versions.Gtk = '3.0' const Gtk = imports.gi.Gtk; Gtk.init(null, 0) w = new Gtk.Window({ type: Gtk.WindowType.TOPLEVEL }) w.show_all() Gtk.main()
  • 11.
    Example 3 ●WebPreview ojs version http://goo.gl/W4wt3 opython version  http://goo.gl/lHspm
  • 12.