Re-hallo,

Ok, this case is now solved.
I was informed about the Python's ctypes module. Ctypes is used to call external functions from Python. So I can call libXfixes.so library and its XFixesGetCursorImage() function from Python.

For more info, read this thread.
http://www.daa.com.au/pipermail/pygtk/2010-March/018337.html
Includes also an example.

Thanks.

Cheers
  Osmo (moma) Antero

Osmo Maatta wrote:
Hello,
I would like to get cursor/mouse-pointer image for an application window in Linux. 
I have studied several libraries that support Python, but haven't found a suitable function to read cursor or mouse-pointer image.

PyGTK : http://www.pygtk.org/docs/pygtk/index.html  No success.
Wnck python library: http://library.gnome.org/devel/libwnck/stable/index.html  No success.
Xlib Python: http://python-xlib.sourceforge.net/doc/html/index.html Did not find any suitable function. Did I miss something?

I've done it in c-code earlier and it works well. It uses XFixesGetCursorImage(display) function.
The c-code is here: http://code.google.com/p/gscreendump/source/browse/trunk/src/sd_xutils.c


GdkPixbuf *get_cursor_pixbuf(Display *display, GdkWindow *gdk_win, gint *cursor_x,
                 gint *cursor_y, gint *offset_x , gint *offset_y/*x-y hot spot */) {

        GdkWindow *gdk_root = gdk_get_default_root_window();

        /* Cursor image */
        GdkPixbuf *cursor_pixbuf = NULL;

        /* Check if the XFIXES extension is present in the Xorg. */
        int event, error;
        if (XFixesQueryExtension(display, &event, &error))
        {
                XFixesCursorImage *cur = XFixesGetCursorImage(display);
.....
--------

Does Python-Xlib have this function?
I would like to use a Python library on Linux.
Can you help?

My system is: Ubuntu 9.10 64bit.
http:/www.futuredesktop.org (.com)