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/