HostGraphicsDevice.st
author Claus Gittinger <cg@exept.de>
Wed, 18 Aug 1999 18:44:12 +0200
changeset 2840 c8f5ba536263
parent 2839 36f61177428c
child 2843 e13e0c53924a
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1284
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
2840
c8f5ba536263 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2839
diff changeset
     3
	      All Rights Reserved
1284
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
GraphicsDevice subclass:#HostGraphicsDevice
2840
c8f5ba536263 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2839
diff changeset
    16
	instanceVariableNames:'deviceColors deviceFonts deviceViews deviceForms deviceCursors'
1284
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'Interface-Graphics'
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!HostGraphicsDevice class methodsFor:'documentation'!
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
copyright
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
2840
c8f5ba536263 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2839
diff changeset
    27
	      All Rights Reserved
1284
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 This software is furnished under a license and may be used
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 hereby transferred.
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
!
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    this abstract class was inserted to provide a home for ST-80 classes
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    (previously, DeviceWorkstation was directly under Object).
2813
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    44
    We will (over time) move common functionality from there into this class.
1284
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    In ST/X, this is mostly dummy.
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    [see also:]
2840
c8f5ba536263 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2839
diff changeset
    49
	DeviceWorkstation XWorkstation
1284
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [author:]
2840
c8f5ba536263 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2839
diff changeset
    52
	Claus Gittinger
1284
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
"
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
! !
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
1365
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    58
!HostGraphicsDevice methodsFor:'accessing'!
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    59
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    60
deviceColors
1371
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
    61
    "return the registry keeping track of colors which were allocated
2813
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    62
     on this device."
1365
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    63
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    64
    ^ deviceColors
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    65
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    66
    "Created: 24.2.1997 / 18:01:41 / cg"
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    67
!
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    68
1371
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
    69
deviceFonts
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
    70
    "return the registry keeping track of fonts which were allocated
2813
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    71
     on this device."
1365
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    72
1371
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
    73
    ^ deviceFonts
2813
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    74
!
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    75
2839
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
    76
deviceForms
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
    77
    "return the registry keeping track of forms which were allocated
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
    78
     on this device."
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
    79
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
    80
    ^ deviceForms
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
    81
!
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
    82
2813
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    83
deviceViews
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    84
    "return the registry keeping track of views which were allocated
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    85
     on this device."
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    86
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
    87
    ^ deviceViews
1365
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    88
! !
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    89
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    90
!HostGraphicsDevice methodsFor:'color stuff'!
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    91
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    92
registerColor:aColor
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    93
    deviceColors register:aColor.
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    94
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    95
    "Created: 24.2.1997 / 18:29:10 / cg"
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    96
!
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    97
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    98
unregisterColor:aColor
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
    99
    deviceColors unregister:aColor.
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   100
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   101
    "Created: 24.2.1997 / 18:29:14 / cg"
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   102
! !
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   103
1371
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   104
!HostGraphicsDevice methodsFor:'font stuff'!
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   105
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   106
registerFont:aFont
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   107
    deviceFonts register:aFont.
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   108
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   109
    "Created: 24.2.1997 / 18:29:10 / cg"
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   110
!
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   111
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   112
unregisterFont:aFont
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   113
    deviceFonts unregister:aFont.
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   114
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   115
    "Created: 24.2.1997 / 18:29:14 / cg"
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   116
! !
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   117
1365
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   118
!HostGraphicsDevice methodsFor:'initialize / release'!
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   119
1367
84941299a4df *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1365
diff changeset
   120
initializeDeviceResourceTables
2813
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
   121
    deviceViews := Registry new.
913aca399962 preps to keep the view & form lobbies on a per-display basis.
Claus Gittinger <cg@exept.de>
parents: 2809
diff changeset
   122
    deviceForms := Registry new.
1365
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   123
    deviceColors := Registry new.
2809
96f6b7b449c7 use a CachingRegistry for fonts.
Claus Gittinger <cg@exept.de>
parents: 1371
diff changeset
   124
    deviceFonts := CachingRegistry new cacheSize:10.
1365
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   125
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   126
    "Created: 24.2.1997 / 18:29:53 / cg"
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   127
!
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   128
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   129
releaseDeviceColors
2839
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
   130
    deviceColors do:[:aColor |
2840
c8f5ba536263 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2839
diff changeset
   131
	aColor setDevice:nil colorId:nil
2839
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
   132
    ].
1365
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   133
    deviceColors := Registry new.
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   134
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   135
    "Created: 24.2.1997 / 18:07:49 / cg"
2839
36f61177428c color release
Claus Gittinger <cg@exept.de>
parents: 2813
diff changeset
   136
1371
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   137
!
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   138
22f586987cd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   139
releaseDeviceFonts
2809
96f6b7b449c7 use a CachingRegistry for fonts.
Claus Gittinger <cg@exept.de>
parents: 1371
diff changeset
   140
    deviceFonts := CachingRegistry new cacheSize:10.
1365
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   141
! !
37a9e7ac4dbc moved color registration from Color class to per-device lobby
Claus Gittinger <cg@exept.de>
parents: 1315
diff changeset
   142
1284
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
!HostGraphicsDevice class methodsFor:'documentation'!
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
version
2840
c8f5ba536263 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2839
diff changeset
   146
    ^ '$Header: /cvs/stx/stx/libview/HostGraphicsDevice.st,v 1.9 1999-08-18 16:44:12 cg Exp $'
1284
d17f4d91174d intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
! !