wiki:pyclutter_notes

Version 28 (modified by Martin Kolman, 14 years ago) (diff)

--

Python-Clutter development notes

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:
http://www.modrana.org/pyclutter for the package.

official documentation improved by Paolo Marti, from his GitHub page:
http://www.modrana.org/pyclutter_marti

PyClutter tutorial, also by Paolo Marti:
http://www.modrana.org/pyclutter_tutorial

complete examples for the above mentioned tutorial:
http://www.modrana.org/pyclutter_tutorial/examples

a short PyClutter tutorial by TuxRadar:
http://www.tuxradar.com/content/code-project-monitor-proc-python-and-clutter

a small PyClutter recipe:
http://otherwiseingle.blogspot.com/2010/02/pyclutter-recipes.html

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

summary of available methods