HostGraphicsDevice.st
author Claus Gittinger <cg@exept.de>
Wed, 18 Aug 1999 20:22:02 +0200
changeset 2846 05c5fdd17641
parent 2845 0794fef6db4a
child 2847 8ef5b35346ff
permissions -rw-r--r--
checkin from browser

"
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"



GraphicsDevice subclass:#HostGraphicsDevice
	instanceVariableNames:'deviceColors deviceFonts deviceViews deviceForms deviceCursors'
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Graphics'
!

!HostGraphicsDevice class methodsFor:'documentation'!

copyright
"
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"


!

documentation
"
    this abstract class was inserted to provide a home for ST-80 classes
    (previously, DeviceWorkstation was directly under Object).
    We will (over time) move common functionality from there into this class.

    In ST/X, this is mostly dummy.

    [see also:]
	DeviceWorkstation XWorkstation

    [author:]
	Claus Gittinger
"


! !

!HostGraphicsDevice methodsFor:'accessing'!

deviceColors
    "return the registry keeping track of colors which were allocated
     on this device."

    ^ deviceColors

    "Created: 24.2.1997 / 18:01:41 / cg"
!

deviceCursors
    "return the registry keeping track of cursors which were allocated
     on this device."

    ^ deviceCursors

    "Created: 24.2.1997 / 18:01:41 / cg"
!

deviceFonts
    "return the registry keeping track of fonts which were allocated
     on this device."

    ^ deviceFonts
!

deviceForms
    "return the registry keeping track of forms which were allocated
     on this device."

    ^ deviceForms
!

deviceViews
    "return the registry keeping track of views which were allocated
     on this device."

    ^ deviceViews
! !

!HostGraphicsDevice methodsFor:'initialize / release'!

initializeDeviceResourceTables
    deviceViews := Registry new.
    deviceForms := Registry new.
    deviceColors := Registry new.
    deviceCursors := Registry new.
    deviceFonts := CachingRegistry new cacheSize:10.

    "Created: 24.2.1997 / 18:29:53 / cg"
!

releaseDeviceColors
    deviceColors do:[:aColor |
        aColor releaseFromDevice
    ].
    deviceColors := Registry new.

    "Created: 24.2.1997 / 18:07:49 / cg"

!

releaseDeviceCursors
    deviceCursors deviceCursors do:[:aCursor |
        aCursor releaseFromDevice
    ].
    deviceCursors := Registry new.

    "Created: 24.2.1997 / 18:07:49 / cg"

!

releaseDeviceFonts
    deviceFonts do:[:aFont |
        aFont releaseFromDevice.
    ].
    deviceFonts := CachingRegistry new cacheSize:10.
! !

!HostGraphicsDevice methodsFor:'registration'!

registerColor:aColor
    deviceColors register:aColor.

    "Created: 24.2.1997 / 18:29:10 / cg"
!

registerCursor:aCursor
    deviceCursors register:aCursor.

    "Created: 24.2.1997 / 18:29:10 / cg"
!

registerFont:aFont
    deviceFonts register:aFont.

    "Created: 24.2.1997 / 18:29:10 / cg"
!

registerForm:aForm
    deviceForms register:aForm.

    "Created: 24.2.1997 / 18:29:10 / cg"
!

registerView:aView
    deviceViews register:aView.

    "Created: 24.2.1997 / 18:29:10 / cg"
!

unregisterColor:aColor
    deviceColors unregister:aColor.

    "Created: 24.2.1997 / 18:29:14 / cg"
!

unregisterCursor:aCursor
    deviceCursors unregister:aCursor.

    "Created: 24.2.1997 / 18:29:14 / cg"
!

unregisterFont:aFont
    deviceFonts unregister:aFont.

    "Created: 24.2.1997 / 18:29:14 / cg"
!

unregisterForm:aForm
    deviceForms unregister:aForm.

    "Created: 24.2.1997 / 18:29:14 / cg"
!

unregisterView:aView
    deviceViews unregister:aView.

    "Created: 24.2.1997 / 18:29:14 / cg"
! !

!HostGraphicsDevice class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview/HostGraphicsDevice.st,v 1.12 1999-08-18 18:21:35 cg Exp $'
! !