Cairo__RectangleInt.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 16 Feb 2016 07:46:52 +0000
changeset 39 8af34937e1ec
parent 29 6ba06265e543
child 88 9d51db2ba641
permissions -rw-r--r--
More work for using CairoGrahicsContext for rendering views * Added GraphicsMedium>>cairoify to change from device rendering to Cairo rendering. * Handle lineWidth: 0 specially as it actually means lineWidth = 1. * Small cleanup / fixes in text displaying (this would need more work, though)

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

"{ NameSpace: Cairo }"

ExternalAddress subclass:#RectangleInt
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Cairo-Constants'
!

!RectangleInt class methodsFor:'accessing'!

libraryName

    OperatingSystem isUNIXlike ifTrue:[^'libcairo.so.2'].

    OperatingSystem isMSWINDOWSlike ifTrue:[^'cairo.dll'].

    self error:'Library name for host OS is not known'
!

sizeof
    "Returns size of undelaying structure in bytes"

    ^16
! !

!RectangleInt methodsFor:'accessing'!

height
    "Returns int32"

    ^self longAt:1 + 12
!

height: value

    self longAt:1 + 12 put:value
!

width
    "Returns int32"

    ^self longAt:1 + 8
!

width: value

    self longAt:1 + 8 put:value
!

x
    "Returns int32"

    ^self longAt:1 + 0
!

x: value

    self longAt:1 + 0 put:value
!

y
    "Returns int32"

    ^self longAt:1 + 4
!

y: value

    self longAt:1 + 4 put:value
! !