DeviceHandle.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 26 Nov 2016 21:09:32 +0000
branchjv
changeset 7719 c2f802dd340a
parent 7541 39940e2446a5
permissions -rw-r--r--
XFT: Forbid XFT rendering on bitmaps (depth-1 pixmaps) In theory it could work if XFT would just turn gray into either black or white. But XFT doesn't do it and simply draw nothing without failing in any way. To prevent this silent failures, forbid drawing XFT onto bitmaps (depth-1 pixmaps). After all, the while point of XFT is to use anti-aliased fonts.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
164
claus
parents: 151
diff changeset
     1
"
claus
parents: 151
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
175
claus
parents: 164
diff changeset
     3
	      All Rights Reserved
164
claus
parents: 151
diff changeset
     4
claus
parents: 151
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents: 151
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents: 151
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents: 151
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents: 151
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents: 151
diff changeset
    10
 hereby transferred.
claus
parents: 151
diff changeset
    11
"
3611
8b4384c9e660 Use #finalize instead of #disposed
Stefan Vogel <sv@exept.de>
parents: 2913
diff changeset
    12
"{ Package: 'stx:libview' }"
8b4384c9e660 Use #finalize instead of #disposed
Stefan Vogel <sv@exept.de>
parents: 2913
diff changeset
    13
7541
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6524 7416
diff changeset
    14
"{ NameSpace: Smalltalk }"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6524 7416
diff changeset
    15
151
claus
parents:
diff changeset
    16
Object subclass:#DeviceHandle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6347
diff changeset
    17
	instanceVariableNames:'device drawableId gcId'
601
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    18
	classVariableNames:''
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    19
	poolDictionaries:''
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    20
	category:'Graphics-Support'
151
claus
parents:
diff changeset
    21
!
claus
parents:
diff changeset
    22
164
claus
parents: 151
diff changeset
    23
!DeviceHandle class methodsFor:'documentation'!
claus
parents: 151
diff changeset
    24
claus
parents: 151
diff changeset
    25
copyright
claus
parents: 151
diff changeset
    26
"
claus
parents: 151
diff changeset
    27
 COPYRIGHT (c) 1995 by Claus Gittinger
175
claus
parents: 164
diff changeset
    28
	      All Rights Reserved
164
claus
parents: 151
diff changeset
    29
claus
parents: 151
diff changeset
    30
 This software is furnished under a license and may be used
claus
parents: 151
diff changeset
    31
 only in accordance with the terms of that license and with the
claus
parents: 151
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
claus
parents: 151
diff changeset
    33
 be provided or otherwise made available to, or used by, any
claus
parents: 151
diff changeset
    34
 other person.  No title to or ownership of the software is
claus
parents: 151
diff changeset
    35
 hereby transferred.
claus
parents: 151
diff changeset
    36
"
claus
parents: 151
diff changeset
    37
!
claus
parents: 151
diff changeset
    38
175
claus
parents: 164
diff changeset
    39
documentation
claus
parents: 164
diff changeset
    40
"
claus
parents: 164
diff changeset
    41
    This is an abstract class for device handles which are responsible
claus
parents: 164
diff changeset
    42
    for finalization i.e. to destroy underlying system resources, when the GC
claus
parents: 164
diff changeset
    43
    frees an object which has created some system object.
claus
parents: 164
diff changeset
    44
    Currently, these are forms and views (streams, cursors, colors and
claus
parents: 164
diff changeset
    45
    fonts could also make use of this class - however, for historical reasons,
claus
parents: 164
diff changeset
    46
    they continue to use their own private finalization machanisms. This may
claus
parents: 164
diff changeset
    47
    change in future versions).
601
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    48
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    49
    [see also:]
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    50
        DeviceDrawable
611
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
    51
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
    52
    [author:]
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
    53
        Claus Gittinger
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
    54
175
claus
parents: 164
diff changeset
    55
"
164
claus
parents: 151
diff changeset
    56
! !
claus
parents: 151
diff changeset
    57
151
claus
parents:
diff changeset
    58
!DeviceHandle methodsFor:'accessing'!
claus
parents:
diff changeset
    59
4436
05eadeb4b603 In #cleanUpLobbyForChildrenOfView...
Stefan Vogel <sv@exept.de>
parents: 4434
diff changeset
    60
device
05eadeb4b603 In #cleanUpLobbyForChildrenOfView...
Stefan Vogel <sv@exept.de>
parents: 4434
diff changeset
    61
    ^ device
05eadeb4b603 In #cleanUpLobbyForChildrenOfView...
Stefan Vogel <sv@exept.de>
parents: 4434
diff changeset
    62
!
05eadeb4b603 In #cleanUpLobbyForChildrenOfView...
Stefan Vogel <sv@exept.de>
parents: 4434
diff changeset
    63
1471
ba228f3678d9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    64
id
ba228f3678d9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    65
    "return the id of the dravable"
ba228f3678d9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    66
ba228f3678d9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    67
    ^ drawableId
ba228f3678d9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    68
ba228f3678d9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    69
    "Modified: 20.3.1997 / 16:34:00 / cg"
ba228f3678d9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    70
! !
ba228f3678d9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    71
1518
aa610d7fd205 catch abstract method.
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
    72
!DeviceHandle methodsFor:'finalization'!
aa610d7fd205 catch abstract method.
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
    73
3611
8b4384c9e660 Use #finalize instead of #disposed
Stefan Vogel <sv@exept.de>
parents: 2913
diff changeset
    74
finalize
1518
aa610d7fd205 catch abstract method.
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
    75
    "I am abstract"
aa610d7fd205 catch abstract method.
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
    76
2913
c51ac85e9aa2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
    77
    self subclassResponsibility
1518
aa610d7fd205 catch abstract method.
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
    78
aa610d7fd205 catch abstract method.
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
    79
    "Created: 2.4.1997 / 19:23:14 / cg"
aa610d7fd205 catch abstract method.
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
    80
! !
aa610d7fd205 catch abstract method.
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
    81
3878
28052cae1ad3 method category rename
Claus Gittinger <cg@exept.de>
parents: 3611
diff changeset
    82
!DeviceHandle methodsFor:'private-accessing'!
1471
ba228f3678d9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    83
151
claus
parents:
diff changeset
    84
setDevice:aDevice id:aDrawableId gcId:aGCId
601
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    85
    "set the handles contents"
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    86
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    87
    device := aDevice.
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    88
    drawableId := aDrawableId.
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    89
    gcId := aGCId
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    90
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    91
    "Modified: 23.4.1996 / 22:10:26 / cg"
151
claus
parents:
diff changeset
    92
! !
601
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    93
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    94
!DeviceHandle class methodsFor:'documentation'!
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    95
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    96
version
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6347
diff changeset
    97
    ^ '$Header$'
601
2c4c1e797909 commentary
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    98
! !
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6347
diff changeset
    99