extensions.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 24 Dec 2014 12:34:27 +0100
changeset 22 834ae4dd6815
parent 21 34bf952f3f60
child 28 1bd3d147cd77
permissions -rw-r--r--
Removed extension XWorkstation>>queryDefaultVisual This method is now in stx:libview

"{ 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>"
! !

!stx_goodies_libcairo class methodsFor:'documentation'!

extensionsVersion_HG

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