support gobject introspection in ftk

19 views
Skip to first unread message

tao yu

unread,
Aug 26, 2012, 3:01:50 AM8/26/12
to ftk mail list
All:

I just enable gobject introspection in ftk for a test, and now I could use javascript and python to call ftk in an simple example.

$cat test.js
===========
const Ftk = imports.gi.Ftk;

Ftk.init(1, "");

Ftk.run()
===========

run this test:
src/demos$ gjs ../../test.js

===========
src/demos$ cat ../../test.py
from gi.repository import Ftk
Ftk.init(1, "")
Ftk.run()
===========

src/demos$ python ../../test.py

please check attached simple.patch for the most important part.
1. add gobject introspection to configure.in and src/Makefile.am
refer:
https://live.gnome.org/GObjectIntrospection/AutotoolsIntegration
2. change multi-define in:
src/ftk_allocator.h, ftk_default_allocator
src/ftk_dialog.h, src/ftk_dialog.h
3. g-ir-scanner error in:
src/ftk_event.h, struct _Idle

NOTE:
in full.patch, I need to replace all "Ret" with "Ftk_Ret", otherwise, g-ir-scanner will say "Ret" does not have a namespace.

Of course, there are still many functions could not be "introspection", and so many warnings during g-ir-scanner, so my test is just a try of gobject introspection.

Does Ftk want to support gobject introspection?
https://live.gnome.org/GObjectIntrospection/
full.patch
simple.patch

李先静

unread,
Aug 26, 2012, 9:21:24 PM8/26/12
to funnyt...@googlegroups.com
呵,javascript我喜欢。

2012/8/26 tao yu <yut...@gmail.com>
Reply all
Reply to author
Forward
0 new messages