GraphicsDevice.st
author Stefan Vogel <sv@exept.de>
Tue, 28 Apr 2020 15:28:14 +0200
changeset 9038 dd177fea6408
parent 8927 970fc2d97125
permissions -rw-r--r--
#REFACTORING by stefan class: Font changed: #setFamily:face:style:size:sizeUnit:encoding:device:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8560
bf1d2db73ae5 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 8006
diff changeset
     1
"{ Encoding: utf8 }"
bf1d2db73ae5 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 8006
diff changeset
     2
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"
1283
ba106a6b1c5b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
     4
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
3222
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
     5
	      All Rights Reserved
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 This software is furnished under a license and may be used
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
 hereby transferred.
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    14
"{ Package: 'stx:libview' }"
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    15
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    16
"{ NameSpace: Smalltalk }"
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    17
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
Object subclass:#GraphicsDevice
3443
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    19
	instanceVariableNames:'displayId screen eventListeners deviceType'
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'Interface-Graphics'
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    25
AllocationFailure subclass:#GraphicResourceAllocationFailure
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    26
	instanceVariableNames:''
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    27
	classVariableNames:''
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    28
	poolDictionaries:''
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    29
	privateIn:GraphicsDevice
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    30
!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    31
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
!GraphicsDevice class methodsFor:'documentation'!
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
copyright
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
1283
ba106a6b1c5b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
    36
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
3222
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
    37
	      All Rights Reserved
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 This software is furnished under a license and may be used
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 only in accordance with the terms of that license and with the
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
 inclusion of the above copyright notice.   This software may not
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
 be provided or otherwise made available to, or used by, any
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
 other person.  No title to or ownership of the software is
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
 hereby transferred.
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
!
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
documentation
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
"
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    this abstract class was inserted to provide a home for ST-80 classes
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    (previously, DeviceWorkstation was directly under Object).
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
1283
ba106a6b1c5b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
    54
    In ST/X, this is mostly dummy.
ba106a6b1c5b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
    55
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    [instance variables:]
3443
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    57
      displayId       <Handle>            the device handle
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    58
      screen          any                 another some device specific id
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    59
      eventListeners  <Collection> | nil  bunch of objects interested in events.
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    60
      deviceType      <Symbol>             some arbitrary symbol, used to choose windowSpecs.
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    [see also:]
3222
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
    63
	DeviceWorkstation XWorkstation
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    [author:]
3222
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
    66
	Claus Gittinger
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
"
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
! !
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
3445
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
    71
!GraphicsDevice methodsFor:'accessing & queries'!
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    72
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    73
addEventListener:aListener
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    74
    "add a local eventListener (with new protocol - #processEvent:)
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    75
     This one gets a chance to intercept all events for this device"
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    76
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    77
    eventListeners isNil ifTrue:[
3488
b6605e20bfde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3445
diff changeset
    78
        eventListeners := OrderedCollection new:2
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    79
    ].
3488
b6605e20bfde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3445
diff changeset
    80
    (eventListeners includesIdentical:aListener) ifFalse:[
b6605e20bfde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3445
diff changeset
    81
        eventListeners add:aListener
b6605e20bfde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3445
diff changeset
    82
    ].
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    83
!
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    84
3445
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
    85
bePDA
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
    86
    self deviceType:#pda
3443
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    87
!
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    88
3443
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    89
deviceType
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    90
    ^ deviceType
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    91
!
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
    92
3443
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    93
deviceType:aSymbol
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    94
    deviceType := aSymbol
3445
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
    95
!
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
    96
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
    97
isPDA
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
    98
    ^ self deviceType == #pda
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
    99
!
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   100
5561
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   101
isWebServiceDevice
8693
294ef31da5dd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
   102
    "I am not a WebService pseudo-device"
5561
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   103
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   104
    ^ false
8693
294ef31da5dd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
   105
294ef31da5dd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
   106
    "Modified (comment): / 27-05-2019 / 20:05:12 / Claus Gittinger"
5561
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   107
!
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   108
8560
bf1d2db73ae5 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 8006
diff changeset
   109
literalArrayEncoding
bf1d2db73ae5 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 8006
diff changeset
   110
    self shouldNeverBeSent
bf1d2db73ae5 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 8006
diff changeset
   111
bf1d2db73ae5 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 8006
diff changeset
   112
    "Created: / 28-10-2018 / 11:34:08 / Claus Gittinger"
bf1d2db73ae5 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 8006
diff changeset
   113
!
bf1d2db73ae5 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 8006
diff changeset
   114
3445
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   115
removeEventListener:aListener
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   116
    "remove a local eventListener (with new protocol - #processEvent:)"
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   117
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   118
    eventListeners notNil ifTrue:[
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   119
	eventListeners removeIdentical:aListener ifAbsent:nil
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   120
    ].
7998
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   121
!
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   122
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   123
supportsAlphaChannel
8006
55f3c1132660 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7998
diff changeset
   124
    "return true, if this device supports alpha information.
7998
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   125
     Currently none does"    
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   126
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   127
    ^ false
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   128
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   129
    "
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   130
     Display supportsAlpha
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   131
    "
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   132
3267eabbad27 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
   133
    "Created: / 11-04-2017 / 01:41:52 / cg"
8006
55f3c1132660 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7998
diff changeset
   134
    "Modified (comment): / 12-04-2017 / 09:57:43 / cg"
8924
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   135
!
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   136
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   137
supportsJPGImages
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   138
    "return true, if this device directly supports jpg images.
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   139
     Currently none does (except browser windows)"    
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   140
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   141
    ^ false
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   142
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   143
    "
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   144
     Display supportsJPGImages
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   145
    "
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   146
!
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   147
8927
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   148
supportsNativeImages
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   149
    "return true, if this device directly supports images (png, jpg, tiff, etc.).
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   150
     If true is returned, the concrete image format to use must be negotiated further.
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   151
     Currently none does (except browser windows and electron)"    
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   152
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   153
    ^ false
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   154
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   155
    "
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   156
     Display supportsPNGImages
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   157
    "
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   158
!
970fc2d97125 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8924
diff changeset
   159
8924
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   160
supportsPNGImages
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   161
    "return true, if this device directly supports png images.
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   162
     Currently none does (except browser windows)"    
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   163
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   164
    ^ false
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   165
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   166
    "
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   167
     Display supportsPNGImages
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   168
    "
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   169
!
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   170
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   171
supportsTIFFImages
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   172
    "return true, if this device directly supports tiff images.
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   173
     Currently none does (except browser windows)"    
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   174
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   175
    ^ false
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   176
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   177
    "
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   178
     Display supportsTIFFImages
10fc9ca91267 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   179
    "
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   180
! !
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   181
6220
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   182
!GraphicsDevice methodsFor:'creating graphics contexts'!
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   183
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   184
newGraphicsContextFor:aGraphicsMedium
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   185
    "create a new graphics context.
8774
b7b97afe2599 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 8693
diff changeset
   186
     The default is to use the inherited graphics context.
6220
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   187
     Subclasses may redefine this to use their own graphics context"
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   188
7487
39fb74b4ade1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7362
diff changeset
   189
    ^ DeviceGraphicsContext onDevice:self.
6220
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   190
! !
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   191
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   192
!GraphicsDevice methodsFor:'event processing'!
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   193
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   194
notifyEventListenersAbout:anEvent
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   195
    "notify all eventHandlers about an incoming event.
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   196
     If any returns true, it is assumed to be eaten by the handler and not
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   197
     enqueued (i.e. not passed to the windowGroup process)"
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   199
    |anyListenerReturnedTrue|
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   200
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   201
    anyListenerReturnedTrue := false.
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   202
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   203
    "/ local listeners ...
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   204
    eventListeners notNil ifTrue:[
7362
8ac49e48c3a9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7357
diff changeset
   205
        eventListeners do:[:aListener |
8ac49e48c3a9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7357
diff changeset
   206
            "/ notice: evaluating or here; all listeners get a chance
8ac49e48c3a9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7357
diff changeset
   207
            anyListenerReturnedTrue := anyListenerReturnedTrue |
8ac49e48c3a9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7357
diff changeset
   208
                                       (aListener processEvent:anEvent)
8ac49e48c3a9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7357
diff changeset
   209
        ]
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   210
    ].
8839
f16f60109900 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 8774
diff changeset
   211
    "/ anyListenerReturnedTrue ifTrue:[
f16f60109900 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 8774
diff changeset
   212
    "/     'eaten by device listener' infoPrintCR.
f16f60109900 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 8774
diff changeset
   213
    "/ ].
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   214
    ^ anyListenerReturnedTrue.
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   215
! !
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   216
3577
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   217
!GraphicsDevice methodsFor:'misc'!
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   218
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   219
roundTripTime
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   220
    "answer the round trip time in milliseconds.
5561
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   221
     May be used to detect slow device connections.
3577
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   222
     Subclasses redefine this. Assume a fast Diplay connection
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   223
     and answer 0 here"
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   224
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   225
    ^ 0
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   226
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   227
    "
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   228
     Screen current roundTripTime
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   229
    "
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   230
! !
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   231
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   232
!GraphicsDevice::GraphicResourceAllocationFailure class methodsFor:'documentation'!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   233
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   234
copyright
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   235
"
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   236
 COPYRIGHT (c) 2016 by eXept Software AG
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   237
              All Rights Reserved
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   238
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   239
 This software is furnished under a license and may be used
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   240
 only in accordance with the terms of that license and with the
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   241
 inclusion of the above copyright notice.   This software may not
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   242
 be provided or otherwise made available to, or used by, any
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   243
 other person.  No title to or ownership of the software is
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   244
 hereby transferred.
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   245
"
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   246
!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   247
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   248
documentation
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   249
"
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   250
    raised when allocation of a graphics resource (pixmap, bitmap, cursor, font, etc.)
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   251
    fails.
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   252
"
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   253
! !
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   254
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   255
!GraphicsDevice::GraphicResourceAllocationFailure class methodsFor:'queries'!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   256
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   257
defaultAnswer
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   258
    ^ nil
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   259
!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   260
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   261
isQuerySignal
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   262
    ^ true
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   263
! !
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   264
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   265
!GraphicsDevice::GraphicResourceAllocationFailure class methodsFor:'raising'!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   266
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   267
query
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   268
    ^ self raiseAsQuery
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   269
! !
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   270
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
!GraphicsDevice class methodsFor:'documentation'!
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
version
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   274
    ^ '$Header$'
5561
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   275
!
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   276
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   277
version_CVS
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   278
    ^ '$Header$'
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
! !
6220
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   280