Cairo__CStructure.st
author Jan Vrany <jan.vrany@labware.com>
Mon, 15 Jun 2020 15:16:56 +0100
changeset 90 b808c338d5c3
parent 88 9d51db2ba641
permissions -rw-r--r--
Fix `SimpleView >> redrawWithCairoBuffered:...` after an API change ...which happened a loong time ago but went unnoticed.

"
stx:goodies/libcairo - Cairo graphics bindings for Smalltalk/X

Copyright (C) 2008-2019 Jan Vrany

This code is licensed under Creative Commons Attribution-NonCommercial License.
For full text of the license, see file LICENSE.txt
"
"{ Package: 'stx:goodies/libcairo' }"

"{ NameSpace: Cairo }"

ByteArray variableByteSubclass:#CStructure
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Cairo-Objects'
!

CStructure class instanceVariableNames:'fields'

"
 No other class instance variables are inherited by this class.
"
!

!CStructure class methodsFor:'documentation'!

copyright
"
stx:goodies/libcairo - Cairo graphics bindings for Smalltalk/X

Copyright (C) 2008-2019 Jan Vrany

This code is licensed under Creative Commons Attribution-NonCommercial License.
For full text of the license, see file LICENSE.txt
"
! !

!CStructure class methodsFor:'instance creation'!

new
    ^self basicNew: self sizeof

    "Created: / 16-02-2016 / 14:22:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

new: size
    self shouldNotImplement

    "Created: / 16-02-2016 / 14:22:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!CStructure class methodsFor:'accessing'!

sizeof
    ^ self subclassResponsibility

    "Created: / 16-02-2016 / 14:21:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!CStructure class methodsFor:'private'!

fields
    ^ fields

    "Created: / 18-02-2016 / 09:05:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!CStructure methodsFor:'inserting'!

inspectorExtraAttributes
    | attrs |

    attrs := super inspectorExtraAttributes.
    self class fields notNil ifTrue:[ 
        self class fields do:[:field | 
            attrs at: '-', field put: [ self perform: field ]
        ].
    ].
    ^ attrs

    "Created: / 18-02-2016 / 09:11:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !