extensions.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 21 Sep 2014 01:08:15 +0100
changeset 21 34bf952f3f60
parent 20 18a3e6b5f310
child 22 834ae4dd6815
permissions -rw-r--r--
Fixes for recent Smalltalk/X

"{ Package: 'stx:goodies/libcairo' }"!

!DeviceGraphicsContext methodsFor:'cairo support'!

drawableId

    ^drawableId

    "Created: / 10-07-2008 / 10:20:04 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!GraphicsDevice methodsFor:'cairo support'!

cairoSurfaceFor: view

    self error:'Graphics device not supported'

    "Created: / 10-07-2008 / 10:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!GraphicsDevice methodsFor:'accessing'!

displayId
    ^ displayId

    "Created: / 04-07-2008 / 12:58:56 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!SimpleView methodsFor:'cairo support'!

cairo
    ^ Cairo::GraphicsContext on:self cairoSurface

    "Created: / 10-09-2008 / 18:23:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!SimpleView methodsFor:'cairo support'!

cairoSurface

    ^Cairo::Surface forView: self

    "Created: / 10-07-2008 / 19:39:58 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!XWorkstation methodsFor:'cairo support'!

cairoSurfaceFor: view

    | surface |
    surface := Cairo::Surface
                forXlib: displayId
                drawable: view drawableId address
                visual: self queryDefaultVisual
                width: view width
                height: view height.
    surface setView: view.
    "/view addDependent: surface.
    ^surface

    "Created: / 10-07-2008 / 10:16:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
    "Modified: / 09-09-2008 / 22:57:22 / Jan Vrany <vranyj1@fel.cvut.cz>"
    "Modified: / 21-09-2014 / 00:54:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!XWorkstation methodsFor:'initialization & release'!

queryDefaultVisual
%{  /* NOCONTEXT */

    if (ISCONNECTED) {
        Display *dpy;
        Visual *visual;

        dpy = myDpy;
        visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(dpy));
        RETURN ( __MKEXTERNALADDRESS( visual ) );
    }
%}.
    ^ nil

    "
     Display queryDefaultVisualType
    "

    "Created: / 21-09-2014 / 00:53:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!stx_goodies_libcairo class methodsFor:'documentation'!

extensionsVersion_HG

    ^ '$Changeset: <not expanded> $'
! !