extensions.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 10 Jul 2008 09:30:44 +0000
changeset 1 2439fb18f3dc
child 2 c2f163833877
permissions -rw-r--r--
Initial commit.

"{ 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>"
! !
!GraphicsDevice methodsFor:'accessing'!

screen
    ^ screen

    "Created: / 04-07-2008 / 13:12:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
!XWorkstation methodsFor:'cairo support'!

cairoSurfaceFor: view

    ^Cairo::Surface 
        forXlib: displayId
        drawable: view drawableId address 
        visual: self visualStructure 
        width: view width 
        height: view height

    "Created: / 10-07-2008 / 10:16:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
!XWorkstation methodsFor:'cairo support'!

visualStructure

    | screenNumber |
    screenNumber := screen.

    %{
        return __MKEXTERNALADDRESS( DefaultVisual( myDpy , __intVal ( screenNumber ) ) );
    %}.
    ^nil

    "
        Screen current visualStructure    
    "

    "Created: / 10-07-2008 / 11:03:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !