GraphicsDevice.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 11 May 2016 09:38:32 +0200
branchjv
changeset 7365 05f5fe42c919
parent 7166 1f7489fd814e
parent 7357 bfc2b9583931
child 7366 18c5cd709f5c
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
     1
"{ Encoding: utf8 }"
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
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
7166
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    19
	instanceVariableNames:'displayId screen eventListeners deviceType graphicsContextClass'
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
7166
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    25
GraphicsDevice class instanceVariableNames:'graphicsContextClass'
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    26
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    27
"
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    28
 No other class instance variables are inherited by this class.
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    29
"
7365
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7166 7357
diff changeset
    30
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7166 7357
diff changeset
    31
!
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    32
AllocationFailure subclass:#GraphicResourceAllocationFailure
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    33
	instanceVariableNames:''
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    34
	classVariableNames:''
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    35
	poolDictionaries:''
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    36
	privateIn:GraphicsDevice
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    37
!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
    38
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!GraphicsDevice class methodsFor:'documentation'!
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
copyright
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
1283
ba106a6b1c5b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
    43
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
3222
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
    44
	      All Rights Reserved
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
 This software is furnished under a license and may be used
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
 only in accordance with the terms of that license and with the
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
 inclusion of the above copyright notice.   This software may not
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
 be provided or otherwise made available to, or used by, any
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
 other person.  No title to or ownership of the software is
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
 hereby transferred.
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
"
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
!
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
documentation
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
"
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    this abstract class was inserted to provide a home for ST-80 classes
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    (previously, DeviceWorkstation was directly under Object).
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
1283
ba106a6b1c5b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
    61
    In ST/X, this is mostly dummy.
ba106a6b1c5b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1282
diff changeset
    62
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    [instance variables:]
3443
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    64
      displayId       <Handle>            the device handle
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    65
      screen          any                 another some device specific id
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    66
      eventListeners  <Collection> | nil  bunch of objects interested in events.
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
    67
      deviceType      <Symbol>             some arbitrary symbol, used to choose windowSpecs.
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    [see also:]
3222
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
    70
	DeviceWorkstation XWorkstation
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    [author:]
3222
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
    73
	Claus Gittinger
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
"
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
! !
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
7166
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    78
!GraphicsDevice class methodsFor:'accessing'!
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    79
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    80
graphicsContextClass
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    81
    "Return a graphics context class to use for this graphics device type.
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    82
     Default is to use DeviceGraphicsContext"
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    83
    ^ graphicsContextClass ? DeviceGraphicsContext
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    84
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    85
    "Modified (comment): / 25-02-2016 / 07:30:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    86
!
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    87
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    88
graphicsContextClass:aClass
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    89
    "Set a graphics context class to use for this graphics device type.
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    90
     Usually there's no need set this, just stich with defaults." 
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    91
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    92
    graphicsContextClass := aClass.
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    93
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    94
    "Modified (comment): / 25-02-2016 / 07:30:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    95
! !
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    96
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    97
!GraphicsDevice methodsFor:'accessing'!
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    98
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
    99
graphicsContextClass
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   100
    "Return a graphics context class to use for this device.
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   101
     Default is to use DeviceGraphicsContext"
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   102
    graphicsContextClass isNil ifTrue:[ 
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   103
        graphicsContextClass := self class graphicsContextClass.         
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   104
    ].
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   105
    ^ graphicsContextClass
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   106
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   107
    "Modified: / 25-02-2016 / 07:31:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   108
!
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   109
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   110
graphicsContextClass:aClass
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   111
    "Set a graphics context class to use for this device.
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   112
     Usually there's no need set this, just stich with defaults." 
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   113
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   114
    graphicsContextClass := aClass.
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   115
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   116
    "Modified (comment): / 25-02-2016 / 07:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   117
! !
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   118
3445
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   119
!GraphicsDevice methodsFor:'accessing & queries'!
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   120
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   121
addEventListener:aListener
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   122
    "add a local eventListener (with new protocol - #processEvent:)
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   123
     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
   124
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   125
    eventListeners isNil ifTrue:[
3488
b6605e20bfde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3445
diff changeset
   126
        eventListeners := OrderedCollection new:2
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   127
    ].
3488
b6605e20bfde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3445
diff changeset
   128
    (eventListeners includesIdentical:aListener) ifFalse:[
b6605e20bfde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3445
diff changeset
   129
        eventListeners add:aListener
b6605e20bfde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3445
diff changeset
   130
    ].
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   131
!
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   132
3445
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   133
bePDA
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   134
    self deviceType:#pda
3443
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
   135
!
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   136
3443
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
   137
deviceType
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
   138
    ^ deviceType
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
   139
!
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   140
3443
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
   141
deviceType:aSymbol
ab7697bff56c added deviceType
Claus Gittinger <cg@exept.de>
parents: 3222
diff changeset
   142
    deviceType := aSymbol
3445
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   143
!
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   144
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   145
isPDA
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   146
    ^ self deviceType == #pda
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   147
!
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   148
5561
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   149
isWebServiceDevice
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   150
    "I am not a WebService pseude-device"
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   151
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   152
    ^ false
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   153
!
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   154
3445
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   155
removeEventListener:aListener
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   156
    "remove a local eventListener (with new protocol - #processEvent:)"
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   157
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   158
    eventListeners notNil ifTrue:[
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   159
	eventListeners removeIdentical:aListener ifAbsent:nil
0967a57d0350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3443
diff changeset
   160
    ].
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   161
! !
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   162
6220
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   163
!GraphicsDevice methodsFor:'creating graphics contexts'!
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   164
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   165
newGraphicsContextFor:aGraphicsMedium
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   166
    "create a new graphics context.
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   167
     The defaults is to use the inherited graphics context.
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   168
     Subclasses may redefine this to use their own graphics context"
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   169
6357
bc674a4f8cfd class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 6334
diff changeset
   170
    |gc|
bc674a4f8cfd class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 6334
diff changeset
   171
bc674a4f8cfd class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 6334
diff changeset
   172
    GraphicsMedium superclass == DeviceGraphicsContext ifTrue:[
bc674a4f8cfd class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 6334
diff changeset
   173
        "this is for transition to delegatest GC"
bc674a4f8cfd class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 6334
diff changeset
   174
        ^ aGraphicsMedium.
bc674a4f8cfd class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 6334
diff changeset
   175
    ].
7166
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   176
    graphicsContextClass isNil ifTrue:[ 
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   177
        graphicsContextClass := self class graphicsContextClass.
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   178
    ].
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   179
    gc := graphicsContextClass onDevice:self.
6357
bc674a4f8cfd class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 6334
diff changeset
   180
    gc font:aGraphicsMedium class defaultFont.
bc674a4f8cfd class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 6334
diff changeset
   181
    ^ gc.
7166
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   182
1f7489fd814e Allow to configure a graphics context class to use with given graphics device type
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6357
diff changeset
   183
    "Modified: / 25-02-2016 / 07:32:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6220
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   184
! !
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   185
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   186
!GraphicsDevice methodsFor:'event processing'!
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   187
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   188
notifyEventListenersAbout:anEvent
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   189
    "notify all eventHandlers about an incoming event.
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   190
     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
   191
     enqueued (i.e. not passed to the windowGroup process)"
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   192
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   193
    |anyListenerReturnedTrue|
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   194
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   195
    anyListenerReturnedTrue := false.
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   196
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   197
    "/ local listeners ...
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   198
    eventListeners notNil ifTrue:[
3222
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   199
	eventListeners do:[:aListener |
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   200
	    anyListenerReturnedTrue := anyListenerReturnedTrue |
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   201
				       (aListener processEvent:anEvent)
0bb571e07c0e moved screen instance variable
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   202
	]
3198
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   203
    ].
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   204
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   205
    ^ anyListenerReturnedTrue.
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   206
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   207
! !
84ed1e2f1bd6 Add per device eventListeners.
Stefan Vogel <sv@exept.de>
parents: 1287
diff changeset
   208
3577
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   209
!GraphicsDevice methodsFor:'misc'!
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   210
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   211
roundTripTime
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   212
    "answer the round trip time in milliseconds.
5561
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   213
     May be used to detect slow device connections.
3577
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   214
     Subclasses redefine this. Assume a fast Diplay connection
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   215
     and answer 0 here"
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   216
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   217
    ^ 0
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
    "
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   220
     Screen current roundTripTime
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   221
    "
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   222
! !
c0282d4e18d6 Define #roundTripTime
Stefan Vogel <sv@exept.de>
parents: 3488
diff changeset
   223
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   224
!GraphicsDevice::GraphicResourceAllocationFailure class methodsFor:'documentation'!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   225
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   226
copyright
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   227
"
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   228
 COPYRIGHT (c) 2016 by eXept Software AG
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   229
              All Rights Reserved
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   230
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   231
 This software is furnished under a license and may be used
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   232
 only in accordance with the terms of that license and with the
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   233
 inclusion of the above copyright notice.   This software may not
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   234
 be provided or otherwise made available to, or used by, any
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   235
 other person.  No title to or ownership of the software is
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   236
 hereby transferred.
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   237
"
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   238
!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   239
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   240
documentation
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   241
"
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   242
    raised when allocation of a graphics resource (pixmap, bitmap, cursor, font, etc.)
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   243
    fails.
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   244
"
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
!GraphicsDevice::GraphicResourceAllocationFailure class methodsFor:'queries'!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   248
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   249
defaultAnswer
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   250
    ^ nil
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   251
!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   252
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   253
isQuerySignal
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   254
    ^ true
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   255
! !
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   256
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   257
!GraphicsDevice::GraphicResourceAllocationFailure class methodsFor:'raising'!
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   258
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   259
query
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   260
    ^ self raiseAsQuery
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   261
! !
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   262
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
!GraphicsDevice class methodsFor:'documentation'!
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
version
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   266
    ^ '$Header$'
5561
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   267
!
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   268
5d0f94937438 added: #isWebServiceDevice
Stefan Vogel <sv@exept.de>
parents: 3577
diff changeset
   269
version_CVS
7357
bfc2b9583931 #FEATURE by sr
sr
parents: 6357
diff changeset
   270
    ^ '$Header$'
1282
46629b32e1d7 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
! !
6220
67d0b77833c6 class: GraphicsDevice
Stefan Vogel <sv@exept.de>
parents: 5561
diff changeset
   272