= Python-Clutter development notes = [[PageOutline]] ModRana will in the future use Clutter as an alternative to the current non-accelerated GTK GUI. Unfortunately, the documentation to the Python bindings for Clutter is in a sad state. This page serves as a compilation of various Clutter & Python related development notes, with the hope to piece together some sort of documentation for the most needed elements :) '''NOTE: all of this information concerns Python bindings for Clutter 1.0''' == Gathered resources == === documentation from various sources === official incomplete documentation, taken from Debian !PyClutter package:[[br]] [http://www.modrana.org/pyclutter http://www.modrana.org/pyclutter] for the package.[[br]] official documentation improved by Paolo Marti, from [https://github.com/pmarti/pyclutter his GitHub page]:[[br]] [http://www.modrana.org/pyclutter_marti http://www.modrana.org/pyclutter_marti][[br]] !PyClutter tutorial, also by Paolo Marti:[[br]] [http://www.modrana.org/pyclutter_tutorial http://www.modrana.org/pyclutter_tutorial][[br]] complete examples for the above mentioned tutorial:[[br]] [http://www.modrana.org/pyclutter_tutorial/examples http://www.modrana.org/pyclutter_tutorial/examples][[br]] a short !PyClutter tutorial by TuxRadar:[[br]] [http://www.tuxradar.com/content/code-project-monitor-proc-python-and-clutter][[br]] a small !PyClutter recipe:[[br]] [http://otherwiseingle.blogspot.com/2010/02/pyclutter-recipes.html][[br]] == issues == === actors not getting motion notify events === Call set_reactive(True) on the actor and it will start receiving motion notify events. Clutter does this probably as an optimization, eq. it has to handle the motion notify event only for actors that request it. == compiling more recent clutter version == Raw notes {{{ # compile dependencies libffi4-dev libjson-glib-dev gobject-introspection export PATH=/opt/bin:$PATH export LD_LIBRARY_PATH=/opt/lib:/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib export PKG_CONFIG_PATH=/opt/lib/pkgconfig/ ./configure --enable-gtk-doc --enable-docs=yes --enable-introspection=yes checking for XEXT extension... configure: error: Not found ???? # libffi4-dev: CCLD g-ir-compiler ../girepository/.libs/libgirepository-1.0.so: undefined reference to `ffi_prep_closure_loc' ../girepository/.libs/libgirepository-1.0.so: undefined reference to `ffi_closure_free' ../girepository/.libs/libgirepository-1.0.so: undefined reference to `ffi_closure_alloc' collect2: ld returned 1 exit status make[2]: *** [g-ir-compiler] Error 1 # libffi-dev: CC libgirepository_1_0_la-gdump.lo CC libgirepository_1_0_la-gfield.lo In file included from gfield.c:4: girffi.h:24:17: error: ffi.h: No such file or directory In file included from gfield.c:4: girffi.h:29: error: expected ')' before '*' token girffi.h:37: error: expected specifier-qualifier-list before 'ffi_cif' girffi.h:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token girffi.h:52: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token girffi.h:57: error: expected declaration specifiers or '...' before 'ffi_closure' make[2]: *** [libgirepository_1_0_la-gfield.lo] Error 1 }}} Compiling gobject-introspection in Maemo scratchbox 1. install libffi-dev 2. symlink libffi header files to correct place {{{ fakeroot ln -s /usr/include/arm-linux-gnueabi/ffi.h /usr/include/ffi.h fakeroot ln -s /usr/include/arm-linux-gnueabi/ffitarget.h /usr/include/ffitarget.h }}} 3. comment out offending constructs in /targets/FREMANTLE_ARMEL/usr/include/sys/stat.h == available methods == [wiki:pyclutter_method_summary summary of available methods]