I checked in some big updates to kaa.display.  Most of the X11 display
code has been rewritten from scratch.  There's now a separate X11Display
class, as well as X11Window.  It supports imlib2 (via
X11Window.render_imlib2_image) and also evas, via the EvasWindow class.
(kaa.evas isn't checked in yet, probably tomorrow.)

So you should have something like this ...

        from kaa import imlib2, display
        from select import select
        
        win = display.X11Window(size = (800,600), title = "Testing")
        win.show()
        img = imlib2.open("foobar.png")
        win.render_imlib2_image(img)
        while True:
           if select([win.get_display().socket], [], [], 1)[0] != []:
              win.get_display().handle_events()
        
X11Window will open the default display.  But you could also do this:

        disp = display.X11Display("someserver:0")
        win = display.X11Window(disp, size = (800, 600), title = "Blahblah")

Once kaa.evas is checked in, you could do:

        win = display.EvasWindow("gl_x11", size=(800,600), title = "Evas")
        img = win.get_evas().object_image_add("foobar.png")
        img.show()
        win.show()
        [ ... ]

There are a few remaining issues, most of which are mentioned as FIXMEs
in the code.

I updated mevas to use kaa.display for Imlib2Canvas, and it's tested and
works.  I also updated freevo/src/input/plugins/x11.py to reflect the
changes to mevas, but I haven't tested this code at all, and it might be
very broken.  Needs review and testing.

Tired now.  Will write more tomorrow. :)

Jason.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to