GraphicsMedium.st
author Claus Gittinger <cg@exept.de>
Fri, 11 Oct 2019 10:25:07 +0200
changeset 8823 17c3eb806e69
parent 8819 45aeb6887a73
child 8912 ca500f5b8ed6
permissions -rw-r--r--
#REFACTORING by exept class: GraphicsMedium moved: #defaultFont
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
3339
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
    12
"{ Package: 'stx:libview' }"
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
    13
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    14
"{ NameSpace: Smalltalk }"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    15
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    16
Object subclass:#GraphicsMedium
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    17
	instanceVariableNames:'device gc width height realized'
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Graphics-Support'
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!GraphicsMedium class methodsFor:'documentation'!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 1989 by Claus Gittinger
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	      All Rights Reserved
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    this is an abstract superclass for all kinds of drawables which
7658
45e7c54d5c1f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7644
diff changeset
    42
    have a physical representation (i.e. have an extent). 
45e7c54d5c1f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7644
diff changeset
    43
    Don't use messages from here - it will vanish soon.
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    [Instance variables:]
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
7658
45e7c54d5c1f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7644
diff changeset
    47
        width           <SmallInteger>  the width (device dependent, usually pixels or inches)
45e7c54d5c1f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7644
diff changeset
    48
        height          <SmallInteger>  the height (device dependent, usually pixels or inches)
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    [author:]
7658
45e7c54d5c1f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7644
diff changeset
    51
        Claus Gittinger
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    55
!GraphicsMedium class methodsFor:'instance creation'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    56
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    57
new
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    58
    "create a new drawable - take the current display as
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    59
     its device (for now, this may be changed until the view is
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    60
     physically created)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    61
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    62
"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    63
    'Warning: DeviceGraphicsContext (' print. self name print. ') should not be created with new' printNL.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    64
"
7644
3b313151b97b #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 7558
diff changeset
    65
    |device|
3b313151b97b #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 7558
diff changeset
    66
7671
465f33f58b2e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7658
diff changeset
    67
    device := Screen current.
7644
3b313151b97b #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 7558
diff changeset
    68
    device isNil ifTrue:[
3b313151b97b #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 7558
diff changeset
    69
        "/ there seems to be no current screen; open one.
8311
44eef55df60c #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 8298
diff changeset
    70
        device := Smalltalk lateOpenDisplay.
44eef55df60c #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 8298
diff changeset
    71
        device isNil ifTrue:[ 
44eef55df60c #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 8298
diff changeset
    72
            Screen deviceOpenErrorSignal raiseErrorString:'no screen device'. 
44eef55df60c #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 8298
diff changeset
    73
        ]
7644
3b313151b97b #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 7558
diff changeset
    74
    ].
3b313151b97b #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 7558
diff changeset
    75
    
7671
465f33f58b2e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7658
diff changeset
    76
    ^ self onDevice:device.
8311
44eef55df60c #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 8298
diff changeset
    77
44eef55df60c #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 8298
diff changeset
    78
    "Modified: / 20-03-2018 / 12:49:17 / stefan"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    79
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    80
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    81
on:aDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    82
    "create a new drawable on aDevice"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    83
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    84
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    85
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    86
    "/ send out a warning: #on: is typically used to create a view
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    87
    "/ operating on a model.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    88
    "/ Please use #onDevice: to avoid confusion.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    89
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    90
    self obsoleteMethodWarning:'use #onDevice:'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    91
    ^ self onDevice:aDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    92
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    93
    "Modified: 5.6.1997 / 21:04:16 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    94
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    95
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    96
onDevice:aDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    97
    "create a new drawable on aDevice"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    98
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
    99
    ^ self basicNew initializeForDevice:aDevice.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   100
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   101
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   102
!GraphicsMedium class methodsFor:'Signal constants'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   103
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   104
drawingOnClosedDrawableSignal
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   105
    "return the signal which is raised, if drawing is attempted
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   106
     on a closed drawable.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   107
     This is especially useful, if a forked thread animates
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   108
     a view in the background, and is not properly synchronized
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   109
     with the window thread - i.e. the window gets closed by the user,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   110
     and the background process continues to draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   111
     In this case, the background thread should handle this signal
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   112
     and terminate itself in the handler."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   113
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   114
    ^ GraphicsContext drawingOnClosedDrawableSignal
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   115
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   116
    "demonstration1: (error if closed by the windowManager):
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   117
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   118
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   119
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   120
     v := StandardSystemView new openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   121
     [
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   122
	[true] whileTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   123
	    |x y|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   124
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   125
	    x := Random nextIntegerBetween:0 and:(v width).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   126
	    y := Random nextIntegerBetween:0 and:(v height).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   127
	    v displayString:'hello' x:x y:y.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   128
	    Delay waitForSeconds:0.5.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   129
	]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   130
     ] fork.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   131
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   132
    "demonstration2: (no error if closed by the windowManager):
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   133
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   134
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   135
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   136
     v := StandardSystemView new openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   137
     [
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   138
	v class drawingOnClosedDrawableSignal handle:[:ex |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   139
	    ex return
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   140
	] do:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   141
	    [true] whileTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   142
		|x y|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   143
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   144
		x := Random nextIntegerBetween:0 and:(v width).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   145
		y := Random nextIntegerBetween:0 and:(v height).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   146
		v displayString:'hello' x:x y:y.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   147
		Delay waitForSeconds:0.5.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   148
	    ]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   149
	]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   150
     ] fork.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   151
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   152
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   153
    "Created: / 29.1.1998 / 13:10:41 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   154
    "Modified: / 29.1.1998 / 13:11:14 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   155
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   156
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   157
!GraphicsMedium class methodsFor:'accessing-defaults'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   158
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   159
defaultFont
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   160
    "get the default font used for drawing"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   161
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   162
    ^ GraphicsContext defaultFont
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   163
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   164
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   165
defaultFont:aFont
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   166
    "set the default font used for drawing"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   167
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   168
    GraphicsContext defaultFont:aFont
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   169
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   170
7861
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   171
!GraphicsMedium class methodsFor:'queries'!
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   172
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   173
isAbstract
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   174
    "Return if this class is an abstract class.
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   175
     True is returned here for myself only; false for subclasses.
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   176
     Abstract subclasses must redefine this again."
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   177
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   178
    ^ self == GraphicsMedium.
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   179
! !
a337711a1112 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7843
diff changeset
   180
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   181
!GraphicsMedium methodsFor:'Compatibility-ST80'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   182
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   183
displayArc:origin radius:radius from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   184
    "draw an arc around a point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   185
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   186
    gc displayArcX:(origin x - radius) y:(origin y - radius)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   187
       width:(radius * 2) height:(radius * 2)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   188
       from:startAngle angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   189
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   190
    "Modified: 8.5.1996 / 08:34:43 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   191
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   192
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   193
displayArcBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   194
   "draw an arc/circle/ellipse - ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   195
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   196
   gc displayArcX:(boundingBox left) y:(boundingBox top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   197
      width:(boundingBox width) height:(boundingBox height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   198
      from:startAngle angle:sweepAngle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   199
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   200
    "Created: / 14.11.1997 / 21:04:19 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   201
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   202
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   203
displayArcBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle at:origin
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   204
   "draw an arc/circle/ellipse - ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   205
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   206
   gc displayArcX:(boundingBox left + origin x) y:(boundingBox top + origin y)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   207
      width:(boundingBox width) height:(boundingBox height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   208
      from:startAngle angle:sweepAngle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   209
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   210
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   211
displayLineFrom:startPoint to:endPoint translateBy:anOffset
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   212
    "draw a line - ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   213
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   214
    gc displayLineFrom:(startPoint + anOffset) to:(endPoint + anOffset)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   215
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   216
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   217
displayPolyline:aPolygon
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   218
    "draw a polygon - ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   219
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   220
    gc displayPolygon:aPolygon
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   221
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   222
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   223
displayRectangularBorder:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   224
    "draw a rectangle - ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   225
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   226
    gc displayRectangle:aRectangle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   227
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   228
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   229
displayRectangularBorder:aRectangle at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   230
    "draw a rectangle - ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   231
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   232
    gc displayRectangle:(aRectangle translateBy:aPoint)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   233
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   234
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   235
displayWedgeBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   236
   "fill an arc/circle/ellipse - ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   237
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   238
   gc fillArcX:(boundingBox left) y:(boundingBox top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   239
      width:(boundingBox width) height:(boundingBox height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   240
      from:startAngle angle:sweepAngle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   241
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   242
    "Created: 27.1.1997 / 15:50:14 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   243
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   244
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   245
displayWedgeBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle at:origin
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   246
   "fill an arc/circle/ellipse - ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   247
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   248
   gc fillArcX:(boundingBox left + origin x) y:(boundingBox top + origin y)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   249
      width:(boundingBox width) height:(boundingBox height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
   250
      from:startAngle angle:sweepAngle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   251
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   252
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   253
findFont:aFontDescription
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   254
    "given a fontDescription, return a device font for it
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   255
     on my device."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   256
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   257
    ^ aFontDescription onDevice:self device
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   258
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   259
    "Modified: 28.5.1996 / 20:22:29 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   260
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   261
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   262
key
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   263
    ^ self drawableId
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   264
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   265
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   266
phase
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   267
    "return the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   268
     This is an alias for ST/X's #maskOrigin"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   269
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   270
    ^ self maskOrigin
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   271
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   272
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   273
phase:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   274
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   275
     This is an alias for ST/X's #maskOrigin:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   276
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   277
    ^ self maskOrigin:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   278
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   279
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   280
setDevicePattern:aColorOrMask
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   281
    "ST/X can paint in any color or image"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   282
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   283
    self paint:aColorOrMask
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   284
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   285
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   286
tilePhase
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   287
    "return the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   288
     This is an alias for ST/X's #maskOrigin"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   289
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   290
    ^ self maskOrigin
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   291
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   292
    "Created: 4.6.1996 / 15:26:39 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   293
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   294
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   295
tilePhase:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   296
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   297
     This is an alias for ST/X's #maskOrigin"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   298
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   299
    ^ self maskOrigin:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   300
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   301
    "Created: 4.6.1996 / 15:26:49 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   302
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   303
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   304
widthOfString:aString
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   305
    "given a string, return its width in pixels if
8364
d5cdbd177a03 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8311
diff changeset
   306
     drawn on the receiver's device."
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   307
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   308
    ^ gc widthOfString:aString.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   309
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   310
    "Modified: 28.5.1996 / 20:22:22 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   311
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   312
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   313
widthOfString:aString from:start to:stop
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   314
    "given a string, return the width in pixels if
8364
d5cdbd177a03 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8311
diff changeset
   315
     a substring is drawn on the receiver's device."
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   316
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   317
    ^ gc widthOfString:aString from:start to:stop.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   318
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   319
    "Modified: 28.5.1996 / 20:22:18 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   320
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   321
3880
c4c8268a2d9f method category rename
Claus Gittinger <cg@exept.de>
parents: 3396
diff changeset
   322
!GraphicsMedium methodsFor:'Compatibility-Squeak'!
2947
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   323
3339
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   324
copyBits:aRectangle from:aForm at:srcOrigin clippingBox:clippingBox rule:rule fillColor:fillColor
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   325
    |f oldClip oldFunction|
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   326
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   327
    (f := rule) isInteger ifTrue:[
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   328
        "/ ST-80 compatibility: numeric rule
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   329
        f := #(clear and andReverse  copy andInverted noop xor or nor equiv invert orInverted copyInverted
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   330
               orReverse nand set) at:(rule + 1).
3339
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   331
    ].
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   332
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   333
    oldFunction := gc function.
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   334
    oldClip := gc clippingBoundsOrNil.
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   335
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   336
    gc clippingBounds:clippingBox.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   337
    gc function:f.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   338
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   339
    gc
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   340
        copyFrom:aForm
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   341
        x:srcOrigin x y:srcOrigin y
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   342
        toX:aRectangle left y:aRectangle top
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   343
        width:aRectangle width height:aRectangle height.
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   344
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   345
    gc clippingBounds:oldClip.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   346
    gc function:oldFunction.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   347
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   348
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   349
      |dst src|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   350
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   351
      dst := Form width:8 height:8 fromArray:#[
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   352
                                              2r00000000
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   353
                                              2r00000000
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   354
                                              2r00000000
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   355
                                              2r00000000
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   356
                                              2r11111111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   357
                                              2r11111111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   358
                                              2r11111111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   359
                                              2r11111111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   360
                                             ].
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   361
      src := Form width:8 height:8 fromArray:#[
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   362
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   363
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   364
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   365
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   366
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   367
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   368
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   369
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   370
                                             ].
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   371
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   372
    dst copyBits:(0@0 corner:8@8) from:src at:0@0 clippingBox:(0@0 corner:8@8) rule:15 fillColor:Color black.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   373
    dst inspect
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   374
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   375
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   376
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   377
    "Modified: / 23.10.2000 / 16:50:44 / martin"
3339
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   378
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   379
    "
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   380
      |dst src|
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   381
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   382
      dst := Form width:8 height:8 fromArray:#[
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   383
                                              2r00000000
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   384
                                              2r00000000
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   385
                                              2r00000000
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   386
                                              2r00000000
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   387
                                              2r11111111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   388
                                              2r11111111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   389
                                              2r11111111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   390
                                              2r11111111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   391
                                             ].
3339
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   392
      src := Form width:8 height:8 fromArray:#[
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   393
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   394
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   395
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   396
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   397
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   398
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   399
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   400
                                              2r00001111
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   401
                                             ].
3339
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   402
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   403
    dst copyBits:(0@0 corner:8@8) from:src at:0@0 clippingBox:(0@0 corner:8@8) rule:15 fillColor:Color black.
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   404
    dst inspect
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   405
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   406
    "
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   407
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   408
    "Modified: / 23.10.2000 / 16:50:44 / martin"
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   409
!
760315aa0412 st80 bitBlt moved up
martin
parents: 3034
diff changeset
   410
3396
18f99e9fc5ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3339
diff changeset
   411
fill:aRectangle fillColor:aColor
3022
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   412
    "fill the rectangular area specified by aRectangle with the black color"
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   413
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   414
    gc fill:aRectangle fillColor:aColor
3396
18f99e9fc5ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3339
diff changeset
   415
!
3022
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   416
3396
18f99e9fc5ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3339
diff changeset
   417
fillBlack:aRectangle
18f99e9fc5ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3339
diff changeset
   418
    "fill the rectangular area specified by aRectangle with the black color"
18f99e9fc5ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3339
diff changeset
   419
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   420
    self fill:aRectangle fillColor:self blackColor
3022
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   421
!
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   422
2947
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   423
fillColor:something
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   424
    "fill the receiver with something;
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   425
     something may be a Form, Color or colorIndex"
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   426
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   427
    self fill:something
3022
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   428
!
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   429
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   430
fillRectangle:aRectangle color:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   431
    "fill a rectangle with the given paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   432
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   433
    gc fillRectangle:aRectangle color:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   434
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   435
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   436
fillWhite
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   437
    "fill all of the receiver with the white color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   438
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   439
    self fill:self whiteColor
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   440
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   441
3022
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   442
fillWhite:aRectangle
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   443
    "fill the rectangular area specified by aRectangle with the white color"
72a01d644ce1 Squeak compatibility
ps
parents: 2955
diff changeset
   444
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   445
    self fill:aRectangle fillColor:self whiteColor
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   446
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   447
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   448
!GraphicsMedium methodsFor:'Compatibility-VW'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   449
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   450
displayBackgroundIfNeededOn: aGraphicsContext
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   451
    aGraphicsContext clearView.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   452
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   453
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   454
inactiveForegroundColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   455
    "a dummy method to support VW widgets"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   456
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   457
    ^ self foregroundColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   458
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   459
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   460
selectionBackgroundColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   461
    "a dummy method to support VW widgets"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   462
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   463
    ^ self foregroundColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   464
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   465
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   466
selectionForegroundColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   467
    "a dummy method to support VW widgets"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   468
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   469
    ^ self backgroundColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   470
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   471
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   472
separatorColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   473
    "a dummy method to support VW widgets"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   474
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   475
    ^ self foregroundColor
2947
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   476
! !
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   477
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
!GraphicsMedium methodsFor:'accessing'!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   479
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   480
at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   481
    "return the pixel at the coordinate given by aPoint"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   482
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   483
    ^ self atX:aPoint x y:aPoint y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   484
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   485
    "Modified: / 29.1.2000 / 12:17:42 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   486
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   487
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   488
at:aPoint put:aPixelColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   489
    "set a pixel"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   490
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   491
    ^ self atX:aPoint x y:aPoint y put:aPixelColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   492
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   493
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   494
     Display rootView at:(0@0) put:(Color red).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   495
     Display rootView at:(1@1) put:(Color red).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   496
     Display rootView at:(2@2) put:(Color red).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   497
     Display rootView at:(3@3) put:(Color red).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   498
     Display rootView at:(4@4) put:(Color red).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   499
     Display rootView at:(5@5) put:(Color red).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   500
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   501
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   502
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   503
atX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   504
    "return the pixel at the coordinate given by x/y"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   505
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   506
    ^ gc atX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   507
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   508
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   509
atX:x y:y put:aPixelColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   510
    "set a pixel"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   511
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   512
    gc atX:x y:y put:aPixelColor.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   513
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   514
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   515
backgroundPaint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   516
    "return the background paint color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   517
     (used for opaqueForms and opaqueStrings)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   518
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   519
    ^ gc backgroundPaint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   520
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   521
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   522
backgroundPaint:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   523
    "set the background-paint color; this is used in opaque-draw
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   524
     operations"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   525
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   526
    gc backgroundPaint:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   527
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   528
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   529
basicFont
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   530
    "return the font for drawing"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   531
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   532
    ^ gc basicFont
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   533
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   534
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   535
basicFont:aFont
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   536
    "set the font for drawing if it has changed.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   537
     This is a low level entry, which is not to be redefined
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   538
     (i.e. it must not imply a redraw operation)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   539
7558
fe6f5d533b37 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7504
diff changeset
   540
    gc font:aFont
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   541
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   542
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   543
blackColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   544
    gc isNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   545
        ^ Color black.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   546
    ].
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   547
    ^ gc blackColor
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   548
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   549
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
bottomCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
    "return the topCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   553
    ^ (self left + (width//2) - 1) @ (self top + height - 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
bottomLeft
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
    "return the bottomLeft point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
    ^ (self left) @ (self top + height - 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
2947
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   562
boundingBox
5321
714fd27c7de8 *** empty log message ***
sr
parents: 4403
diff changeset
   563
    ^ Rectangle
714fd27c7de8 *** empty log message ***
sr
parents: 4403
diff changeset
   564
	origin: 0 @ 0
714fd27c7de8 *** empty log message ***
sr
parents: 4403
diff changeset
   565
	corner: width @ height
2947
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   566
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   567
!
53f0ea77b1e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   568
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   569
capStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   570
    "return the current cap-style for line-drawing.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   571
     possible styles are: #notLast, #butt, #round, #projecting"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   572
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   573
    ^ gc capStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   574
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   575
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   576
capStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   577
    "set the cap-style for line-drawing;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   578
     possible styles are: #notLast, #butt, #round, #projecting"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   579
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   580
    gc capStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   581
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   582
    "Modified: 12.5.1996 / 22:24:30 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   583
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   584
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   585
center
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
    "return the point at the center of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
    ^ (self left + (width // 2)) @ (self top + (height // 2))
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   591
characterEncoding
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   592
    "returns a symbol describing how the contents is encoded internally.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   593
     For now, this should be the same encoding as my fonts encoding (otherwise, mappings would
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   594
     occur when drawing).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   595
     This is (currently) only passed down from the fileBrowser,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   596
     and required when japanese/chinese/korean text is edited.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   597
     (encoding is something like #'iso8859-5' #euc, #sjis, #jis7, #gb, #big5 or #ksc)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   598
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   599
    ^ gc characterEncoding
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   600
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   601
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   602
characterEncoding:encodingArg
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   603
    "define how the contents is encoded internally.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   604
     This should normally never be required, as ST/X now assumes
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   605
     unicode (of which iso8859-1 is a subset) encoding.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   606
     The possibility to change the characterEncoding is provided as
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   607
     a backward compatibility hook for programs which want to use
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   608
     another encoding internally. One such view is the CharacterSetView,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   609
     which wants to show character as they are actually present in a font."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   610
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   611
    gc characterEncoding:encodingArg
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   612
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   613
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   614
clipByChildren
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   615
    "drawing shall be done into my view only (default)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   616
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   617
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   618
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   619
    self obsoleteMethodWarning:'use #clippedByChildren:true'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   620
    ^ self clippedByChildren:true
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   621
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   622
    "Created: 17.7.1996 / 13:25:55 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   623
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   624
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   625
clipRect
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   626
    "return the clip-rectangle for drawing.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   627
     If there is currently no active clip, return the underlying
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   628
     displaySurfaces (i.e. views) bounds. Added for ST-80 compatibility."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   629
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   630
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   631
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   632
    self obsoleteMethodWarning:'use #clippingBounds'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   633
    ^ self clippingBounds.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   634
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   635
    "Modified: 28.5.1996 / 14:14:53 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   636
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   637
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   638
clipRect:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   639
    "set the drawing clip-rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   640
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   641
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   642
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   643
    self obsoleteMethodWarning:'use #deviceClippingBounds:'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   644
    ^ gc deviceClippingBounds:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   645
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   646
    "Modified: 28.5.1996 / 14:13:09 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   647
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   648
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   649
clippedByChildren:aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   650
    "turn on/off drawing over children.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   651
     If on, a superview may draw 'over' its children.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   652
     If off (the default), drawing is 'under' its children.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   653
     Only useful for the rootView, to draw over any visible views.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   654
     (for example, when dragging a rubber-line)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   655
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   656
    gc clippedByChildren:aBoolean.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   657
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   658
    "Created: 17.7.1996 / 13:25:16 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   659
    "Modified: 29.4.1997 / 15:33:55 / dq"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   660
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   661
6217
a8a86bfb5cb5 class: GraphicsMedium
Stefan Vogel <sv@exept.de>
parents: 6045
diff changeset
   662
clippingBounds
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   663
    "return the clipping rectangle for drawing, nil if there is none."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   664
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   665
    ^ gc clippingBounds
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   666
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   667
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   668
clippingBounds:aRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   669
    "set the clipping rectangle for drawing (in logical coordinates);
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   670
     a nil argument turn off clipping (i.e. whole view is drawable)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   671
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   672
    gc clippingBounds:aRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   673
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   674
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   675
clippingBoundsOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   676
    "return the clipping rectangle for drawing, nil if there is none."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   677
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   678
    ^ gc clippingBoundsOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   679
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   680
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   681
clippingRectangle:aRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   682
    "set the clipping rectangle for drawing (in logical coordinates);
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   683
     a nil argument turn off clipping (i.e. whole view is drawable)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   684
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   685
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   686
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   687
    self clippingBounds:aRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   688
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   689
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   690
clippingRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   691
    "return the clipping rectangle for drawing, nil if there is none."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   692
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   693
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   694
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   695
    ^ self clippingBoundsOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   696
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   697
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   698
colorAt:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   699
    "return the color of the pixel at the coordinate given by x@y"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   700
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   701
    ^ self colorAtX:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   702
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   703
    "Modified: 1.8.1997 / 20:01:58 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   704
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   705
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   706
colorAtX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   707
    "return the color of the pixel at the coordinate given by aPoint"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   708
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   709
    ^ gc colorAtX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   710
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   711
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   712
container
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   713
    "return my container - for protocol compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   714
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   715
    ^ nil
6217
a8a86bfb5cb5 class: GraphicsMedium
Stefan Vogel <sv@exept.de>
parents: 6045
diff changeset
   716
!
a8a86bfb5cb5 class: GraphicsMedium
Stefan Vogel <sv@exept.de>
parents: 6045
diff changeset
   717
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   718
corner
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   719
    "return the corner point i.e. the bottom-right point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   720
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   721
    ^ (self left + width - 1) @ (self top + height - 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   722
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   723
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   724
corner:aPoint
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   725
    "set the corner point i.e. change extent so that corner will be
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   726
     aPoint while leaving the origin unchanging "
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   727
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   728
    self extent:(aPoint x - self left + 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   729
		@
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
		(aPoint y - self top + 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   732
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   733
dashStyle:aDashList offset:dashOffset
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   734
    "define dashes. Each element of the dashList specifies the length
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   735
     of a corresponding dash. For example, setting it to [4 4]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   736
     defines 4on-4off dashing;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   737
     Setting it to [1 2 4 2] defines 1on-2off-4on-2off dashes.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   738
     The dashOffset specifies where in the dashList the dashing starts.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   739
     Ignored here - this may not be supported by all graphics devices."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   740
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   741
    ^ gc dashStyle:aDashList offset:dashOffset
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   742
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   743
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
   744
depth
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
   745
    ^ self subclassResponsibility
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
   746
!
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
   747
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   748
device
8809
8ad6940178de #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 8753
diff changeset
   749
    "return the device, the receiver is associated with.
8ad6940178de #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 8753
diff changeset
   750
     Please use graphicsDevice for ST80 compatibility."
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   751
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   752
    ^ device
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   753
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   754
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   755
device:aDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   756
    "set the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   757
7485
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   758
    (aDevice isNil or:[device == aDevice]) ifTrue:[
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   759
        ^ self.
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   760
    ].
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   761
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   762
    gc isNil ifTrue:[
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   763
        self initializeForDevice:aDevice.
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   764
        ^ self.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   765
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   766
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   767
    device := aDevice.
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   768
    gc device:aDevice
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   769
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   770
7469
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   771
deviceClippingBounds:aRectangleOrNil
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   772
    "set the clipping rectangle for drawing (in device coordinates);
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   773
     a nil argument turns off clipping (i.e. whole view is drawable - incl. margins)"
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   774
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   775
    gc deviceClippingBounds:aRectangleOrNil
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   776
!
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   777
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   778
deviceClippingBoundsOrNil
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   779
    "return the clipping rectangle as physical coordinated for drawing, nil if there is none."
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   780
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   781
    ^ gc deviceClippingBoundsOrNil
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   782
!
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   783
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   784
deviceClippingRectangle:aRectangleOrNil
7469
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   785
    <resource: #obsolete>
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   786
    "set the clipping rectangle for drawing (in device coordinates);
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   787
     a nil argument turns off clipping (i.e. whole view is drawable - incl. margins)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   788
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   789
    gc deviceClippingBounds:aRectangleOrNil
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   790
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   791
7504
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   792
deviceFont
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   793
    "return the current drawing font as a device font"
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   794
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   795
    ^ self font onDevice:device.
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   796
!
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   797
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   798
drawableId
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   799
    "return the id of the drawable on the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   800
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   801
    gc isNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   802
        ^ nil.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   803
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   804
    ^ gc drawableId
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   805
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   806
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   807
font
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   808
    "return the current drawing font"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   809
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   810
    ^ gc font
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   811
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   812
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   813
font:aFont
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   814
    "set the font for drawing if it has changed.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   815
     This should be redefined in some widget to perform an automatic
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   816
     redraw. See also: #basicFont:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   817
7558
fe6f5d533b37 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7504
diff changeset
   818
    gc font:aFont.
8559
9f7e552ce3f8 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 8388
diff changeset
   819
9f7e552ce3f8 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 8388
diff changeset
   820
    "Modified: / 27-10-2018 / 22:58:48 / Claus Gittinger"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   821
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   822
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   823
function
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   824
    "return the current drawing function"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   825
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   826
    ^ gc function
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   827
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   828
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   829
function:aSymbol
8298
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   830
    "set the drawing function if it has changed.
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   831
     The argument is one of:
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   832
            #copy,#copyInverted,#xor,#and,#andReverse
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   833
            #andInverted,#or,#orReverse,#orInverted
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   834
            #invert,#clear,#set,#noop,#equiv,#nand
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   835
     Notice: not all graphicMedia support all functions"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   836
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   837
    gc function:aSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   838
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   839
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   840
gcId
8193
486de380f4e7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8153
diff changeset
   841
    "return the receiver's graphic context id on the device"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   842
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   843
    gc isNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   844
        ^ nil.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   845
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   846
    ^ gc gcId.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   847
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   848
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   849
graphicsContext
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   850
    ^ gc
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   851
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   852
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   853
graphicsContext:newGc
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   854
    "set the graphics context"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   855
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   856
    gc == newGc ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   857
        ^ self.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   858
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   859
    gc := newGc.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   860
    device := newGc device.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   861
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   862
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   863
graphicsDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   864
    "same as #device, for ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   865
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   866
    ^ device
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   867
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   868
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   869
id
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   870
    "return the id of the drawable on the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   871
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   872
    ^ self drawableId
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   873
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   874
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   875
joinStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   876
    "return the current join-style for polygon-drawing.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   877
     possible styles are: #miter, #bevel, #round"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   878
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   879
    ^ gc joinStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   880
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   881
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   882
joinStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   883
    "set the join-style of lines in polygon-drawing;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   884
     possible styles are: #miter, #bevel, #round"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   885
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   886
    gc joinStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   887
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   888
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   889
left
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
    "return the left i.e. x-coordinate of top-left of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   891
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   892
    ^ 0
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   894
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   895
leftCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   896
    "return the leftCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   897
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   898
    ^ (self left) @ (self top + (height // 2) - 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   899
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   900
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   901
lineStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   902
    "return the current line-drawing-style.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   903
     possible styles are: #solid, #dashed, #doubleDashed,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   904
     #dotted, #dashDot or #dashDotDot."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   905
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   906
    ^ gc lineStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   907
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   908
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   909
lineStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   910
    "set the line-drawing-style;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   911
     possible styles are: #solid, #dashed, #doubleDashed,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   912
     #dotted, #dashDot or #dashDotDot."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   913
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   914
    gc lineStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   915
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   916
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   917
lineWidth
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   918
    "return the current drawing linewidth"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   919
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   920
    ^ gc lineWidth
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   921
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   922
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   923
lineWidth:aNumber
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   924
    "set the line drawing width in pixels"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   925
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   926
    gc lineWidth:aNumber
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   927
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   928
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   929
mask
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   930
    "return the current drawing mask"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   931
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   932
    ^ gc mask
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   933
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   934
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   935
mask:aForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   936
    "set the drawing mask"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   937
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   938
    gc mask:aForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   939
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   940
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   941
maskOrigin
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   942
    "return the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   943
     Should be redefined in classes which support it.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   944
     This is an alias for ST-80's #phase"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   945
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   946
    ^ gc maskOrigin
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   947
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   948
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   949
maskOrigin:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   950
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   951
     Should be redefined in classes which support it.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   952
     This is an alias for ST-80's #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   953
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   954
    gc maskOrigin:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   955
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   956
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   957
maskOriginX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   958
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   959
     Should be redefined in classes which support it.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   960
     This is an alias for ST-80's #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   961
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   962
    self maskOrigin:(x @ y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   963
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   964
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   965
medium
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   966
    "return the destination medium i.e. the underlying graphics device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   967
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   968
    ^ gc graphicsDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   969
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   970
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   971
noClipByChildren
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   972
    "drawing shall also be done into subviews"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   973
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   974
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   975
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   976
    self obsoleteMethodWarning:'use #clippedByChildren:false'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   977
    ^ self clippedByChildren:false
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   978
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   979
    "Created: 17.7.1996 / 14:15:54 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   980
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   981
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   982
origin
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   983
    "return the origin i.e. coordinate of top-left of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   984
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   985
    ^ 0 @ 0
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   986
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   987
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   988
paint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   989
    "return the current paint drawing color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   990
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   991
    ^ gc paint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   992
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   993
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   994
paint:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   995
    "set the drawing painting color, aColor can be a dithered one"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   996
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   997
    gc paint:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   998
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   999
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1000
paint:fgColor on:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1001
    "set the paint and backgroundPaint, used for text and bitmaps.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1002
     Both colors may be dithered colors"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1003
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1004
    gc paint:fgColor on:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1005
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1006
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1007
paint:fgColor on:bgColor function:f
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1008
    "set paint, background-paint and function"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1009
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1010
    self paint:fgColor on:bgColor.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1011
    self function:f
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1012
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1013
    "Modified: 16.5.1996 / 15:36:35 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1014
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1015
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1016
realized
2954
0182e5ac0247 added #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2947
diff changeset
  1017
    "return true, if the receiver is realized.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1018
     The receiver may still be unmapped, if the container is unrealized.
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1019
     Use reallyRealized to make certain that I am really mapped."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1020
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1021
    ^ realized
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1022
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1023
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1024
reallyRealized
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1025
    "return true, if the receiver is realized and all containers
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1026
     are realized."
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1027
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1028
    ^ self realized
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1029
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1030
!
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1031
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1032
rightCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1033
    "return the leftCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1034
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1035
    ^ (self left + width - 1) @ (self top + (height // 2) - 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1036
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1037
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1038
setClippingBounds:aRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1039
    gc setClippingBounds:aRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1040
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1041
7704
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1042
setDevice:aDevice
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1043
    "set the device"
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1044
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1045
    device := aDevice.
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1046
    gc setDevice:aDevice
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1047
!
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1048
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1049
setGraphicsExposures:aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1050
    "want to if aBoolean is true - or don't want to be notified
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1051
     of graphics exposures"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1052
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1053
    gc setGraphicsExposures:aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1054
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1055
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1056
setMaskOrigin:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1057
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1058
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1059
     OBSOLETE: use #maskOrigin: or #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1060
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1061
    self obsoleteMethodWarning:'use #maskOrigin:'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1062
    ^ self maskOriginX:aPoint x y:aPoint y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1063
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1064
    "Modified: / 26.1.1998 / 18:54:14 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1065
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1066
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1067
setMaskOriginX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1068
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1069
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1070
     OBSOLETE: use #maskOriginX:y: or #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1071
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1072
    self obsoleteMethodWarning:'use #maskOriginX:y:'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1073
    ^ self maskOriginX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1074
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1075
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1076
top
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1077
    "return the top i.e. y-coordinate of top-left of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1078
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1079
    ^ 0
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1080
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1081
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1082
topCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1083
    "return the topCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1084
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1085
    ^ (self left + (width//2) - 1) @ (self top)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1086
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1087
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1088
topRight
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1089
    "return the topRight point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1090
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1091
    ^ (self left + width - 1) @ (self top)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1093
2030
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1094
viewBackground
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1095
    "for protocol compatibility with view; return my background paint color here"
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1096
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1097
    ^ self backgroundPaint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1098
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1099
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1100
viewOrigin
8388
4f61000dd8ea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  1101
    "return the drawable's visible origin (for scrolling)"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1102
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1103
    ^ 0@0
8388
4f61000dd8ea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  1104
4f61000dd8ea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  1105
    "Modified (comment): / 14-06-2018 / 10:16:52 / Claus Gittinger"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1106
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1107
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1108
whiteColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1109
    gc isNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1110
        ^ Color white.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1111
    ].
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1112
    ^ gc whiteColor
8700
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1113
! !
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1114
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1115
!GraphicsMedium methodsFor:'accessing-dimensions'!
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1116
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1117
extent
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1118
    "return the extent;
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1119
     i.e. a point with width as x, height as y coordinate"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1120
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1121
    ^ width @ height
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1122
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1123
    "Modified (comment): / 30-05-2019 / 10:51:26 / Claus Gittinger"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1124
!
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1125
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1126
extent:extent
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1127
    "set the extent.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1128
     Might be redefined to perform other actions (especially notifications)"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1129
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1130
    width := extent x.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1131
    height := extent y
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1132
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1133
    "Modified (comment): / 30-05-2019 / 10:53:37 / Claus Gittinger"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1134
!
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1135
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1136
height
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1137
    "return the height of the receiver"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1138
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1139
    ^ height
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1140
!
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1141
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1142
height:anInteger
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1143
    "set the height of the receiver.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1144
     Might be redefined to perform other actions (especially notifications)"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1145
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1146
    height := anInteger
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1147
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1148
    "Modified (comment): / 30-05-2019 / 10:53:32 / Claus Gittinger"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1149
!
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1150
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1151
setHeight:aNumber
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1152
    "set the view's height in pixels.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1153
     Direct setter, not redefined in subclasses"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1154
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1155
    height := aNumber.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1156
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1157
    "Created: / 01-02-2011 / 23:34:51 / cg"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1158
    "Modified (comment): / 30-05-2019 / 10:52:41 / Claus Gittinger"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1159
!
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1160
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1161
setWidth:aNumber
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1162
    "set the view's width in pixels.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1163
     Direct setter, not redefined in subclasses"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1164
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1165
    width := aNumber.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1166
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1167
    "Created: / 01-02-2011 / 23:36:44 / cg"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1168
    "Modified (comment): / 30-05-2019 / 10:52:45 / Claus Gittinger"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1169
!
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1170
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1171
setWidth:w height:h
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1172
    "set both width and height.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1173
     Direct setter, not redefined in subclasses"
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1174
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1175
    width := w.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1176
    height := h
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1177
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1178
    "Modified (comment): / 30-05-2019 / 10:52:48 / Claus Gittinger"
2030
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1179
!
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1180
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1181
width
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1182
    "return the width of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1183
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1184
    ^ width
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1185
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1186
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1187
width:anInteger
8700
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1188
    "set the width of the receiver.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1189
     Might be redefined to perform other actions (especially notifications)"
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1190
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1191
    width := anInteger
8700
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1192
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1193
    "Modified (comment): / 30-05-2019 / 10:53:20 / Claus Gittinger"
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1194
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1195
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1196
width:w height:h
8700
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1197
    "set both width and height of the receiver.
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1198
     Might be redefined to perform other actions (especially notifications)"
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1199
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1200
    width := w.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1201
    height := h
8700
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1202
9f593fb9dc72 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8690
diff changeset
  1203
    "Modified (comment): / 30-05-2019 / 10:53:26 / Claus Gittinger"
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1204
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1205
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1206
!GraphicsMedium methodsFor:'accessing-internals'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1207
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1208
background
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1209
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1210
    "return the current background drawing color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1211
     OBSOLETE: use #paint: / #backgroundPaint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1212
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1213
    ^ gc background
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1214
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1215
    "Modified: 12.5.1996 / 22:28:09 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1216
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1217
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1218
background:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1219
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1220
    "set the internal background color for drawing - aColor must be a real color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1221
     OBSOLETE: this method will vanish; use #paint: / #backgroundPaint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1222
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1223
    gc background:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1224
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1225
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1226
foreground
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1227
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1228
    "return the current foreground drawing color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1229
     OBSOLETE: use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1230
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1231
    ^ gc foreground
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1232
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1233
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1234
foreground:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1235
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1236
    "set the internal foreground color for drawing - aColor must be a real color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1237
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1238
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1239
    gc foreground:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1240
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1241
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1242
foreground:fgColor background:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1243
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1244
    "set both internal foreground and internal background colors
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1245
     - these must be real colors.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1246
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1247
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1248
    gc foreground:fgColor background:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1249
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1250
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1251
foreground:fgColor background:bgColor function:fun
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1252
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1253
    "set foreground, background colors and function.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1254
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1255
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
  1256
    gc foreground:fgColor background:bgColor.
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
  1257
    gc function:fun
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1258
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1259
    "Modified: 12.5.1996 / 22:28:34 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1260
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1261
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1262
foreground:aColor function:fun
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1263
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1264
    "set the foreground color and function for drawing.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1265
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1266
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1267
    gc foreground:aColor function:fun
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1268
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1269
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1270
setRealized:aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1271
    "low level special interface to manipulate the realized state.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1272
     Non-public interface, only to be used by experts.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1273
     (use to pretend a view has been realized - for example with alien views)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1274
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1275
    realized := aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1276
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1277
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1278
!GraphicsMedium methodsFor:'accessing-transformation'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1279
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1280
scale
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1281
    "return the scale factor (as point) of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1282
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1283
    ^ gc scale
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1284
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1285
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1286
scale:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1287
    "set the scale factor of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1288
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1289
    ^ gc scale:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1290
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1291
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1292
transformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1293
    "return the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1294
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1295
    ^ gc transformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1296
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1297
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1298
transformation:aTransformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1299
    "set the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1300
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1301
    ^ gc transformation:aTransformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1302
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1303
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1304
translateBy:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1305
    "add to the translation offset of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1306
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1307
    ^ gc translateBy:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1308
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1309
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1310
translation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1311
    "return the translation factor (as point) of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1312
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1313
    ^ gc translation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1314
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1315
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1316
translation:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1317
    "set the translation offset of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1318
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1319
    ^ gc translation:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1320
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1321
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1322
!GraphicsMedium methodsFor:'basic drawing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1323
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1324
displayArcX:x y:y width:width height:height from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1325
    "draw an arc in a box
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1326
     - this could be recoded to draw using displayLine"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1327
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1328
    gc displayArcX:x y:y width:width height:height from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1329
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1330
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1331
displayDottedRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1332
    "draw a dotted-line rectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1333
     A general implementation is found here; deviceGC's
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1334
     may reimplement this if directly supported by the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1335
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1336
    gc displayDottedRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1337
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1338
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1339
displayHorizontalWavelineFromX:x0 y:y0 toX:x1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1340
    "draw a horizontal wave-line from x0/y0 to x1/y0"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1341
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1342
    gc displayHorizontalWavelineFromX:x0 y:y0 toX:x1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1343
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1344
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1345
displayLineFromX:x0 y:y0 toX:x1 y:y1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1346
    "draw a line from x0/y0 to x1/y1"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1347
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1348
    gc displayLineFromX:x0 y:y0 toX:x1 y:y1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1349
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1350
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1351
displayOpaqueForm:aForm x:x y:y
8153
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1352
    "draw a form at x/y; 
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1353
     if the form has depth 1, 1's in the form are
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1354
     drawn in current fg, 0's in current bg color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1355
     If the form has depth ~~ 1, it is copied as is onto the receiver"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1356
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1357
    gc displayOpaqueForm:aForm x:x y:y
8153
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1358
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1359
    "Modified (comment): / 31-08-2017 / 19:26:34 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1360
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1361
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1362
displayOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1363
    "draw part of a string with both fg and bg at x/y in current font"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1364
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1365
    gc displayString:aString from:index1 to:index2 x:x y:y opaque:true maxWidth:self width
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1366
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1367
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1368
displayPolygon:aPolygon
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1369
    "draw a polygon
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1370
     - this could be recoded to draw using displayLine"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1371
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1372
    gc displayPolygon:aPolygon
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1373
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1374
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1375
displayRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1376
    "draw a rectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1377
     - this could be recoded to draw using displayLine"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1378
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1379
    gc displayRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1380
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1381
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1382
displayString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1383
    "draw part of a string with fg at x/y in current font"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1384
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1385
    gc displayString:aString from:index1 to:index2 x:x y:y opaque:false maxWidth:self width
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1386
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1387
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1388
displayString:aString from:index1 to:index2 x:x y:y opaque:opaque
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1389
    "draw part of a string with both fg and bg at x/y in current font"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1390
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1391
    gc displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:self width.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1392
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1393
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1394
displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWidth
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1395
    "draw part of a string with both fg and bg at x/y in current font"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1396
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1397
    gc displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWidth
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1398
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1399
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1400
!GraphicsMedium methodsFor:'basic filling'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1401
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1402
fillArcX:x y:y width:w height:h from:start angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1403
    "fill an arc with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1404
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1405
    gc fillArcX:x y:y width:w height:h from:start angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1406
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1407
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1408
fillPolygon:points
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1409
    "fill a polygon with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1410
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1411
    gc fillPolygon:points
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1412
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1413
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1414
fillRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1415
    "fill a rectangle with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1417
    gc fillRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1418
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1419
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1420
fillRectangleX:x y:y width:w height:h color:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1421
    "fill a rectangle with given color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1422
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1423
    gc fillRectangleX:x y:y width:w height:h color:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1424
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1425
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1426
!GraphicsMedium methodsFor:'bit blitting'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1427
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1428
copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth padding:pad width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1429
    "copy bits from a smalltalk byteArray.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1430
     The bits found there are supposed to be in the devices native format (i.e.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1431
     translated to allocated color indices on pseudoColor devices and padded as required.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1432
     The byteOrder is MSB and will be converted as appropriate by the underlying devices
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1433
     method to whatever the device needs."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1434
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1435
    gc copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth padding:pad width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1436
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1437
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1438
copyFrom:aGC toX:dstX y:dstY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1439
    "copy from a drawable - maybe self"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1440
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1441
    self copyFrom:aGC x:0 y:0 toX:dstX y:dstY width:aGC width height:aGC height async:false
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1442
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1443
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1444
copyFrom:aGC x:srcX y:srcY toX:dstX y:dstY width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1445
    "copy from a drawable - maybe self"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1446
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1447
    self copyFrom:aGC x:srcX y:srcY toX:dstX y:dstY width:w height:h async:false
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1448
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1449
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1450
copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1451
    "copy from aDrawable into the receiver;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1452
     the source may be the receiver as well - in this case its a scroll.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1453
     All coordinates are in device coordinates.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1454
     If the receiver is a view AND async is true, the call returns immediately
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1455
     - otherwise, it returns when the scroll operation is finished.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1456
     (not all devices care for this).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1457
     If the receiver is a pixmap, the call always returns immediately."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1458
7748
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1459
    |deviceDrawable mustWait sourceDepth|
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1460
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1461
    ((aDrawable graphicsDevice ~~ device)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1462
     or:[aDrawable isImage]) ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1463
        deviceDrawable := aDrawable asFormOn:device.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1464
    ] ifFalse:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1465
        deviceDrawable := aDrawable
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1466
    ].
7745
c8a5b8bca250 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7741
diff changeset
  1467
    sourceDepth := deviceDrawable depth.
7748
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1468
    mustWait := async not 
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1469
                    and:[deviceDrawable isView 
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1470
                    and:[(sourceDepth ~~ 1) or:[device depth == 1]]].
7467
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  1471
    mustWait ifTrue:[
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  1472
        mustWait := self catchExpose.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1473
    ].
7745
c8a5b8bca250 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7741
diff changeset
  1474
    gc copyFrom:deviceDrawable graphicsContext x:srcX y:srcY toX:dstX y:dstY width:w height:h depth:sourceDepth.
7467
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  1475
    mustWait ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1476
        self waitForExpose
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1477
    ]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1478
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1479
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1480
copyFrom:aGC x:dstX y:dstY width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1481
    "copy from a drawable - maybe self"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1482
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1483
    self copyFrom:aGC x:0 y:0 toX:dstX y:dstY width:w height:h async:false
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1484
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1485
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1486
copyPlaneFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1487
    "copy one plane from aDrawable into the receiver. 0's are drawn in
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1488
     background, while 1's are drawn with foreground color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1489
     The depth of aDrawable must (should) be 1.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1490
     The drawable must have been allocated on the same device.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1491
     All coordinates are in device coordinates."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1492
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1493
    |deviceDrawable|
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1494
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1495
    ((aDrawable graphicsDevice ~~ device)
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1496
    or:[aDrawable isImage]) ifTrue:[
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1497
        deviceDrawable := aDrawable asFormOn:device.
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1498
    ] ifFalse:[
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1499
        deviceDrawable := aDrawable
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1500
    ].
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1501
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1502
    gc copyPlaneFrom:deviceDrawable graphicsContext x:srcX y:srcY toX:dstX y:dstY width:w height:h
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1503
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1504
8690
83fadb9e5567 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 8559
diff changeset
  1505
!GraphicsMedium methodsFor:'copying-private'!
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1506
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1507
postCopy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1508
    "this may not be enough to allow copying of views ..."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1509
7843
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1510
    <modifier: #super> "must be called if redefined"
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1511
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1512
    "/ super postCopy.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1513
    realized := false.
7843
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1514
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1515
    "Modified: / 08-02-2017 / 00:19:33 / cg"
4403
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1516
!
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1517
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1518
postDeepCopy
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1519
    super postDeepCopy.
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1520
    realized := false.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1521
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1522
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1523
!GraphicsMedium methodsFor:'drawing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1524
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1525
display:someObject at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1526
    "draw someObject - this must understand the #displayOn:at: message"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1527
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1528
    someObject displayOn:self at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1529
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1530
    "Created: 28.5.1996 / 14:22:57 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1531
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1532
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1533
displayArcIn:aRectangle from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1534
    "draw an arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1535
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1536
    gc displayArcX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1537
       width:(aRectangle width) height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1538
       from:startAngle angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1539
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1540
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1541
displayArcOrigin:origin corner:corner from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1542
    "draw an arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1543
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1544
    |left top right bot|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1545
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1546
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1547
    top := origin y.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1548
    right := corner x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1549
    bot := corner y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1550
    gc displayArcX:left y:top
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1551
       width:(right - left + 1) height:(bot - top + 1)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1552
       from:startAngle angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1553
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1554
    "Modified: 8.5.1996 / 08:35:25 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1555
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1556
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1557
displayArcX:x y:y w:w h:h from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1558
    "draw an arc; apply transformation if nonNil"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1559
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1560
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1561
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1562
    self obsoleteMethodWarning:'use #displayArcX:y:width:height:from:angle:'.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1563
    gc displayArcX:x y:y width:w height:h from:startAngle angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1564
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1565
    "Modified: 8.5.1996 / 08:46:56 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1566
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1567
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1568
displayCircle:aPoint radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1569
    "draw a circle around a center point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1570
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1571
    gc displayCircleX:(aPoint x) y:(aPoint y) radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1572
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1573
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1574
displayCircleIn:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1575
    "draw a circle in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1576
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1577
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1578
        displayArcX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1579
        width:(aRectangle width) height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1580
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1581
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1582
    "Modified: 8.5.1996 / 08:35:40 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1583
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1584
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1585
displayCircleX:x y:y radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1586
    "draw a circle around a center point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1587
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1588
    |d|
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1589
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1590
    d := 2 * r.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1591
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1592
        displayArcX:(x - r) y:(y - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1593
        width:d height:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1594
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1595
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1596
    "Modified: 8.5.1996 / 08:36:03 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1597
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1598
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1599
displayForm:aFormOrImage
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1600
    "draw a form (or image) at the origin"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1601
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1602
    gc displayForm:aFormOrImage x:0 y:0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1603
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1604
    "Modified: / 24.4.1997 / 16:00:11 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1605
    "Created: / 9.11.1997 / 00:50:52 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1606
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1607
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1608
displayForm:aFormOrImage at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1609
    "draw a form (or image)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1610
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1611
    gc displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1612
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1613
    "Modified: 24.4.1997 / 16:00:11 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1614
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1615
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1616
displayForm:formToDraw x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1617
    "draw a form or image non opaque;
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1618
     if it's a 1-plane bitmap, 1-bits are drawn in the
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1619
     current paint-color, leaving pixels with 0-bits unchanged
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1620
     (i.e. only 1-bits are drawn from the form).
7883
94bb868d80e6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7861
diff changeset
  1621
     If it's a deep form (i.e. a pixmap) the current paint
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1622
     settings are ignored and the form is drawn as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1623
     Care must be taken, that the paint color is correctly allocated
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1624
     (by sending #on: to the color) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1625
     Using functions other than #copy only makes sense if you are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1626
     certain, that the colors are real colors (actually, only for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1627
     noColor or allColor)."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1628
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1629
    gc displayForm:formToDraw x:x y:y
7883
94bb868d80e6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7861
diff changeset
  1630
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1631
    "Modified (comment): / 13-02-2017 / 20:19:56 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1632
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1633
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1634
displayForm:aFormOrImage x:x y:y opaque:opaque
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1635
    "draw a form (or image) at x/y;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1636
     if the form has depth 1, 1's in the form are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1637
     drawn in current paint color, 0's are ignored.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1638
     If the form has depth ~~ 1, the current fg color setting is ignored."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1639
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1640
    opaque ifTrue:[
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1641
        gc displayOpaqueForm:aFormOrImage x:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1642
    ] ifFalse:[
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1643
        gc displayForm:aFormOrImage x:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1644
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1645
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1646
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1647
displayImage:aFormOrImage
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1648
    "draw an image (or form).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1649
     Provided for ST-80 compatibilty;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1650
     in ST/X, images are also handled by #displayForm:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1651
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1652
    gc displayForm:aFormOrImage x:0 y:0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1653
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1654
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1655
displayImage:aFormOrImage at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1656
    "draw an image (or form).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1657
     Provided for ST-80 compatibilty;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1658
     in ST/X, images are also handled by #displayForm:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1659
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1660
    gc displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1661
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1662
    "Modified: 24.4.1997 / 16:02:43 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1663
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1664
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1665
displayImage:aFormOrImage x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1666
    "draw an image (or form).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1667
     Provided for ST-80 compatibilty;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1668
     in ST/X, images are also handled by #displayForm:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1669
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1670
    gc displayForm:aFormOrImage x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1671
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1672
    "Created: 24.4.1997 / 16:03:03 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1673
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1674
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1675
displayLineFrom:point1 to:point2
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1676
    "draw a line"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1677
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1678
    gc displayLineFromX:(point1 x) y:(point1 y)
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1679
                    toX:(point2 x) y:(point2 y)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1680
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1681
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1682
displayLineFromX:xStart y:yStart toX:xEnd y:yEnd brush:aForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1683
    "draw a line using a brush.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1684
     Here, a slow fallback is used, drawing into a
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1685
     temporary bitmap first, which is then displayed"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1686
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1687
    gc displayLineFromX:xStart y:yStart toX:xEnd y:yEnd brush:aForm.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1688
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1689
    "Modified: 1.4.1997 / 21:29:06 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1690
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1691
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1692
displayOpaqueString:aString at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1693
    "draw a string with both fg and bg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1694
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1695
    gc displayOpaqueString:aString x:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1696
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1697
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1698
displayOpaqueString:aString from:start to:stop at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1699
    "draw part of a string - drawing both fg and bg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1700
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1701
    gc displayString:aString from:start to:stop x:aPoint x y:aPoint x opaque:true maxWidth:self width.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1702
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1703
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1704
displayOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1705
    "draw a string at the coordinate x/y - draw foreground pixels in paint-color,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1706
     background pixels in bgPaint color. If the transformation involves scaling,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1707
     the fonts point-size is scaled as appropriate.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1708
     Assuming that device can only draw in device colors, we have to handle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1709
     the case where paint and/or bgPaint are dithered colors or images."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1710
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1711
    gc displayOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1712
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1713
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1714
displayOpaqueString:aString x:x y:y angle:drawAngle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1715
    "draw a string along a (possibly non-horizontal) line,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1716
     drawing both fg and bg pixels.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1717
     The angle is in degrees, clock-wise, starting with 0 for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1718
     a horizontal draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1719
     Drawing is done by first drawing the string into a temporary bitmap,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1720
     which is rotated and finally drawn as usual.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1721
     NOTICE: due to the rotation of the temporary bitmap, this is a slow
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1722
             operation - not to be used with cillions of strings ..."
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1723
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1724
    gc displayString:aString x:x y:y angle:drawAngle opaque:true
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1725
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1726
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1727
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1728
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1729
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1730
     v extent:300@200.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1731
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1732
     0 to:360 by:45 do:[:a |
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1733
         v paint:Color black on:Color red.
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1734
         v displayOpaqueString:'hello world' x:100 y:100 angle:a.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1735
     ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1736
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1737
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1738
    "in contrast to non-opaque draw:
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1739
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1740
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1741
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1742
     v extent:300@200.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1743
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1744
     0 to:360 by:45 do:[:a |
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1745
         v paint:Color black on:Color red.
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1746
         v displayString:'hello world' x:100 y:100 angle:a.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1747
     ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1748
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1749
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1750
    "Modified: 23.4.1997 / 17:50:23 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1751
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1752
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1753
displayPoint:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1754
    "draw a pixel"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1755
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1756
    gc displayPointX:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1757
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1758
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1759
displayPointX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1760
    "draw a point (with current paint-color); apply transformation if nonNil"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1761
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1762
    gc displayPointX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1763
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1764
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1765
displayRectangle:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1766
    "draw a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1767
7791
66d7e8e6d807 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7760
diff changeset
  1768
    gc displayRectangleX:(aRectangle left) y:(aRectangle top)
66d7e8e6d807 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7760
diff changeset
  1769
       width:(aRectangle width) height:(aRectangle height)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1770
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1771
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1772
displayRectangleOrigin:origin corner:corner
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1773
    "draw a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1774
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1775
    |top left|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1776
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1777
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1778
    top := origin y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1779
    gc displayRectangleX:left y:top width:(corner x - left) height:(corner y - top)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1780
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1781
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1782
displayRectangleOrigin:origin extent:extent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1783
    "draw a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1784
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1785
    gc displayRectangleX:(origin x) y:(origin y)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1786
       width:(extent x) height:(extent y)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1787
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1788
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1789
displayRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1790
    gc displayRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1791
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1792
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1793
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1794
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1795
     (v := View new) extent:200@200; openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1796
     v displayRoundRectangleX:10 y:10 width:100 height:100 wCorner:20 hCorner:20
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1797
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1798
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1799
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1800
displayString:aString at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1801
    "draw a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1802
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1803
    gc displayString:aString x:aPoint x y:aPoint y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1804
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1805
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1806
displayString:aString centeredAt:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1807
    "draw a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1808
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1809
    gc displayString:aString centeredAtX:aPoint x y:aPoint y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1810
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1811
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1812
displayString:aString centeredAtX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1813
    "draw a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1814
8753
c9041c91afcb #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 8700
diff changeset
  1815
    gc displayString:aString centeredAtX:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1816
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1817
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1818
displayString:aString from:start to:stop at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1819
    "draw part of a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1820
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1821
    gc displayString:aString from:start to:stop x:aPoint x y:aPoint y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1822
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1823
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1824
displayString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1825
    "draw a string at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1826
     draw foreground-pixels only (in current paint-color),
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1827
     leaving background as-is. If the transformation involves scaling,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1828
     the fonts point-size is scaled as appropriate."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1829
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1830
    gc displayString:aString from:1 to:aString size x:x y:y opaque:false maxWidth:self width.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1831
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1832
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1833
displayString:aString x:x y:y angle:drawAngle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1834
    "draw a string along a (possibly non-horizontal) line - drawing fg only.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1835
     The angle is in degrees, clock-wise, starting with 0 for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1836
     a horizontal draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1837
     Drawing is done by first drawing the string into a temporary bitmap,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1838
     which is rotated and finally drawn as usual.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1839
     NOTICE: due to the rotation of the temporary bitmap, this is a slow
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1840
             operation - not to be used with cillions of strings ..."
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1841
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1842
    gc displayString:aString x:x y:y angle:drawAngle opaque:false
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1843
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1844
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1845
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1846
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1847
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1848
     v extent:300@200.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1849
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1850
     0 to:360 by:90 do:[:a |
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1851
         v paint:Color black.
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1852
         v displayString:'hello world' x:100 y:100 angle:a.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1853
     ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1854
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1855
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1856
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1857
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1858
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1859
     v extent:400@400.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1860
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1861
     0 to:360 by:5 do:[:a |
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1862
         v paint:Color black.
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1863
         v displayString:'.........hello' x:200 y:200 angle:a.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1864
     ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1865
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1866
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1867
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1868
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1869
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1870
     v extent:200@100.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1871
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1872
     v displayString:' hello' x:90 y:50 angle:0.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1873
     v displayString:' hello' x:90 y:50 angle:45.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1874
     v displayString:' hello' x:90 y:50 angle:90.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1875
     v displayString:' hello' x:90 y:50 angle:180.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1876
     v displayString:' hello' x:90 y:50 angle:270.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1877
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1878
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1879
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1880
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1881
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1882
     v extent:200@100.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1883
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1884
     v displayString:'hello' x:50 y:50 angle:0.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1885
     v displayString:'hello' x:50 y:50 angle:45.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1886
     v displayString:'hello' x:50 y:50 angle:90.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1887
     v displayString:'hello' x:50 y:50 angle:135.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1888
     v displayString:'hello' x:50 y:50 angle:180.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1889
     v displayString:'hello' x:50 y:50 angle:225.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1890
     v displayString:'hello' x:50 y:50 angle:270.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1891
     v displayString:'hello' x:50 y:50 angle:315.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1892
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1893
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1894
    "Modified: 24.4.1997 / 12:51:25 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1895
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1896
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1897
displayString:aString x:x y:y angle:drawAngle opaque:opaque
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1898
    "common code to draw a string along a (possibly non-horizontal) line.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1899
     The angle is in degrees, clock-wise, starting with 0 for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1900
     a horizontal draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1901
     Drawing is done by first drawing the string into a temporary bitmap,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1902
     which is rotated and finally drawn as usual.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1903
     NOTICE: due to the rotation of the temporary bitmap, this is a slow
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1904
             operation - not to be used with cillions of strings ...
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1905
     CAVEAT: if the string is not a real string (i.e. a LabelAndIcon),
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1906
             this can (currently) only be done opaque"
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1907
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1908
    gc displayString:aString x:x y:y angle:drawAngle opaque:opaque
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1909
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1910
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1911
displayUnscaledForm:formToDraw x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1912
    "draw a form or image non opaque and unscaled;
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1913
     if it's a 1-plane bitmap, 1-bits are drawn in the
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1914
     current paint-color, leaving pixels with 0-bits unchanged
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1915
     (i.e. only 1-bits are drawn from the form).
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1916
     If it's a deep form (i.e. a pixmap) the current paint
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1917
     settings are ignored and the form is drawn as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1918
     Care must be taken, that the paint color is correctly allocated
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1919
     (by sending #on: to the color) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1920
     Using functions other than #copy only makes sense if you are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1921
     certain, that the colors are real colors (actually, only for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1922
     noColor or allColor).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1923
     The origins coordinate is transformed, but the image itself is unscaled."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1924
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1925
    gc displayUnscaledForm:formToDraw x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1926
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1927
    "Modified (comment): / 13-02-2017 / 20:20:09 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1928
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1929
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1930
displayUnscaledOpaqueForm:formToDraw x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1931
    "draw a form or image opaque and unscaled;
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1932
     if it's a 1-plane bitmap, 1-bits are drawn in the
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1933
     current paint-color, 0 bits in background color.
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1934
     If it's a deep form (i.e. a pixmap) the current paint
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1935
     settings are ignored and the form is drawn as-is (opaque).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1936
     The origins coordinate is transformed, but the image itself is unscaled."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1937
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1938
    gc displayUnscaledOpaqueForm:formToDraw x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1939
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1940
    "Modified (comment): / 13-02-2017 / 20:20:15 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1941
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1942
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1943
displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1944
    "draw a substring at the transformed coordinate x/y but do not scale the font.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1945
     Draw foreground pixels in paint-color, background pixels in bgPaint color."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1946
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1947
    gc displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1948
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1949
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1950
displayUnscaledOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1951
    "draw a string at the transformed coordinate x/y but do not scale the font.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1952
     Draw foreground pixels in paint-color, background pixels in bgPaint color."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1953
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1954
    gc displayUnscaledOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1955
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1956
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1957
displayUnscaledString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1958
    "draw a substring at the transformed coordinate x/y but do not scale the font.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1959
     draw foreground-pixels only (in current paint-color), leaving background as-is."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1960
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1961
    gc displayUnscaledString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1962
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1963
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1964
displayUnscaledString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1965
    "draw a string at the transformed coordinate x/y but do not scale the font.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1966
     draw foreground-pixels only (in current paint-color), leaving background as-is."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1967
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1968
    gc displayUnscaledString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1969
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1970
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1971
!GraphicsMedium methodsFor:'drawing in device coordinates'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1972
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1973
displayDeviceForm:aForm x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1974
    "draw a form or image non opaque (i.e. only foreground color is drawn);
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1975
     If it's a 1-plane bitmap, 1-bits are drawn in the
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1976
     current paint-color, leaving pixels with 0-bits unchanged
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1977
     (i.e. only 1-bits are drawn from the form).
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1978
     If it's a deep form (i.e. a pixmap) the current paint
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1979
     settings are ignored and the form is drawn as-is;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1980
     however, the mask is applied if present.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1981
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1982
     The form should must have been allocated on the same device,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1983
     otherwise its converted here, which slows down the draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1984
     No transformation or scaling is done.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1985
     Care must be taken, that the paint color is correctly allocated
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1986
     (by sending #on: to the color) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1987
     Using functions other than #copy only makes sense if you are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1988
     certain, that the colors are real colors (actually, only for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1989
     noColor or allColor)."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1990
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1991
    gc displayDeviceForm:aForm x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1992
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1993
    "Modified (comment): / 13-02-2017 / 20:19:47 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1994
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1995
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1996
displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1997
    "draw a line in device coordinates"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1998
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1999
    gc displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2000
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2001
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2002
displayDeviceOpaqueForm:aForm x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2003
    "draw a form or image opaque (i.e. both fg and bg is drawn);
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  2004
     If it's a 1-plane bitmap, 1-bits are drawn in the
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2005
     current paint-color and 0-bits in the bgPaint color.
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  2006
     If it's a deep form (i.e. a pixmap) the current paint/bgPaint
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2007
     settings are ignored and the form drawn as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2008
     Any mask is ignored.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2009
     In the 1-plane case, special care must be taken if paint and/or bgPaint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2010
     dithered colors or patterns, since are that the colors are correctly allocated (by sending #on:
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2011
     to the colors) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2012
     The form should have been allocated on the same device; otherwise,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2013
     its converted here, which slows down the draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2014
     Drawing is in device coordinates; no scaling is done."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2015
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2016
    gc displayDeviceOpaqueForm:aForm x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  2017
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  2018
    "Modified (comment): / 13-02-2017 / 20:19:52 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2019
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2020
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2021
displayDeviceOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2022
    "draw a substring at the coordinate x/y - draw foreground pixels in
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2023
     paint-color and background pixels in bgPaint-color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2024
     Assuming that device can only draw in device colors, we have to handle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2025
     the case where paint and/or bgPaint are dithered colors.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2026
     No translation or scaling is done."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2027
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2028
    gc displayDeviceOpaqueString:aString from:index1 to:index2 in:self font x:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2029
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2030
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2031
displayDeviceOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2032
    "draw a string at the coordinate x/y - draw foreground pixels in
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2033
     paint-color and background pixels in bgPaint-color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2034
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2035
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2036
    gc displayDeviceOpaqueString:aString from:1 to:(aString size) in:self font x:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2037
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2038
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2039
displayDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2040
    "draw a rectangle in device coordinates"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2041
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2042
    gc displayDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2043
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2044
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2045
displayDeviceString:aString from:index1 to:index2 in:font x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2046
    "draw a substring at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2047
     draw foreground-pixels only (in current paint-color), leaving background as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2048
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2049
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2050
    gc displayDeviceString:aString from:index1 to:index2 in:font x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2051
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2052
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2053
displayDeviceString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2054
    "draw a substring at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2055
     draw foreground-pixels only (in current paint-color), leaving background as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2056
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2057
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2058
    gc displayDeviceString:aString from:index1 to:index2 in:self font x:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2059
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2060
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2061
displayDeviceString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2062
    "draw a string at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2063
     draw foreground-pixels only (in current paint-color), leaving background as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2064
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2065
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2066
    gc displayDeviceString:aString from:1 to:(aString size) in:self font x:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2067
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2068
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2069
fillDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2070
    "fill a rectangle with current paint color (device coordinates)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2071
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2072
    gc fillDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2073
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2074
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2075
!GraphicsMedium methodsFor:'edge drawing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2076
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2077
drawEdgesForX:x y:y width:w height:h level:l
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2078
    "draw 3D edges into a rectangle"
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2079
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2080
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2081
        drawEdgesForX:x y:y width:w height:h level:l
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2082
        shadow:self blackColor light:self whiteColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2083
        halfShadow:nil halfLight:nil
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2084
        style:nil
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2085
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2086
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2087
drawEdgesForX:x y:y width:w height:h level:l
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2088
                shadow:shadowColor light:lightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2089
                halfShadow:halfShadowColor halfLight:halfLightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2090
                style:edgeStyle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2091
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2092
    "draw 3D edges into a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2093
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2094
    gc drawEdgesForX:x y:y width:w height:h level:l
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2095
       shadow:shadowColor light:lightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2096
       halfShadow:halfShadowColor halfLight:halfLightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2097
       style:edgeStyle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2098
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2099
    "Modified: / 24.8.1998 / 18:23:02 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2100
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2101
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2102
edgeDrawn:whichOne
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2103
    "a redefinable hook for views which like to draw
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2104
     over their edges (some checkToggles do).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2105
     Nothing done here."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2106
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2107
    "Created: 7.3.1997 / 17:59:07 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2108
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2109
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2110
!GraphicsMedium methodsFor:'evaluating in another context'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2111
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2112
reverseDo:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2113
    "evaluate aBlock with foreground and background interchanged.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2114
     This can be reimplemented here in a faster way."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2115
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2116
    gc reverseDo:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2117
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2118
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2119
withBackground:fgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2120
    "evaluate aBlock with changed background."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2121
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2122
    gc withBackground:fgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2123
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2124
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2125
withForeground:fgColor background:bgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2126
    "evaluate aBlock with changed foreground and background."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2127
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2128
    gc withForeground:fgColor background:bgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2129
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2130
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2131
withForeground:fgColor background:bgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2132
    "evaluate aBlock with foreground, background and function"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2133
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2134
    gc withForeground:fgColor background:bgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2135
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2136
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2137
withForeground:fgColor background:bgColor mask:aMask do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2138
    "evaluate aBlock with foreground, background and mask"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2139
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2140
    gc withForeground:fgColor background:bgColor mask:aMask do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2141
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2142
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2143
withForeground:fgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2144
    "evaluate aBlock with changed foreground."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2145
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2146
    gc withForeground:fgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2147
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2148
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2149
withForeground:fgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2150
    "evaluate aBlock with changed foreground and function."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2151
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2152
    gc withForeground:fgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2153
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2154
7760
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2155
withPaint:aColor do:aBlock
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2156
    "evaluate aBlock with changed paint color."
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2157
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2158
    gc withPaint:aColor do:aBlock
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2159
!
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2160
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2161
xoring:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2162
    "evaluate aBlock with function xoring"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2163
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2164
    gc xoring:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2165
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2166
7467
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2167
!GraphicsMedium methodsFor:'event handling'!
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2168
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2169
catchExpose
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2170
    "expose event handling is only required for views."
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2171
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2172
    ^ false.
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2173
!
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2174
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2175
waitForExpose
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2176
    "expose event handling is only required for views."
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2177
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2178
    ^ self.
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2179
! !
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2180
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2181
!GraphicsMedium methodsFor:'filling'!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2182
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2183
black
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2184
    "fill the receiver with black"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2185
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2186
    self fill:self blackColor
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2187
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2188
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2189
clear
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2190
    "clear the receiver with background"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2191
4068
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2192
    self clearView.
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2193
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2194
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2195
clearDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2196
    "clear a rectangular area to background"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2197
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2198
    gc clearDeviceRectangleX:x y:y width:w height:h.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2199
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2200
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2201
clearInside
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2202
    "clear the receiver with background - ST-80 compatibility"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2203
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2204
    self clear
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2205
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2206
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2207
clearRectangle:aRectangle
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2208
    "clear the rectangular area in the receiver to background"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2209
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2210
    self clearRectangleX:(aRectangle left)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2211
		       y:(aRectangle top)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2212
		   width:(aRectangle width)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2213
		  height:(aRectangle height)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2214
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2215
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2216
clearRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2217
    gc clearRectangleX:x y:y width:w height:h.
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2218
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2219
4068
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2220
clearView
8268
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2221
    "clear the receiver with its view background"
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2222
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2223
    "/ do not send to gc here, because clearDeviceRectangleX:0 y:0 width:width height:height
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2224
    "/ is redefined to use viewBackground instead of background-drawing color.
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2225
    "/ consider this a kludge.
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2226
    self clearDeviceRectangleX:0 y:0 width:width height:height
4068
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2227
!
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2228
8819
45aeb6887a73 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 8814
diff changeset
  2229
fill:aColorOrFormOrColorIndex
45aeb6887a73 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 8814
diff changeset
  2230
    "fill the receiver with aColorOrFormOrColorIndex;
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2231
     something may be a Form, Color or colorIndex"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2232
8819
45aeb6887a73 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 8814
diff changeset
  2233
    gc fillRectangle:(self boundingBox) color:aColorOrFormOrColorIndex
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2234
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2235
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2236
fillArc:origin radius:r from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2237
    "draw a filled arc around a point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2238
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2239
    |d|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2240
    d := 2 * r.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2241
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2242
        fillArcX:(origin x - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2243
               y:(origin y - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2244
           width:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2245
          height:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2246
            from:startAngle
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2247
           angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2248
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2249
    "Modified: 8.5.1996 / 08:41:54 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2250
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2251
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2252
fillArcIn:aRectangle from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2253
    "draw a filled arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2254
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2255
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2256
        fillArcX:(aRectangle left)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2257
               y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2258
           width:(aRectangle width)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2259
          height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2260
            from:startAngle
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2261
           angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2262
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2263
    "Created: 13.4.1996 / 20:56:03 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2264
    "Modified: 8.5.1996 / 08:42:13 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2265
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2266
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2267
fillArcOrigin:origin corner:corner from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2268
    "draw a filled arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2269
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2270
    |left top right bot|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2271
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2272
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2273
    top := origin y.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2274
    right := corner x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2275
    bot := corner y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2276
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2277
        fillArcX:left
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2278
        y:top
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2279
        width:(right - left + 1)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2280
        height:(bot - top + 1)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2281
        from:startAngle
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2282
        angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2283
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2284
    "Created: 13.4.1996 / 20:56:56 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2285
    "Modified: 8.5.1996 / 08:42:23 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2286
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2287
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2288
fillArcX:x y:y w:w h:h from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2289
    "draw a filled arc; apply transformation if nonNil"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2290
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2291
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2292
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2293
    self obsoleteMethodWarning:'use #fillArcX:y:width:height:from:angle:'.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2294
    gc fillArcX:x y:y width:w height:h from:startAngle angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2295
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2296
    "Modified: 8.5.1996 / 08:47:52 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2297
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2298
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2299
fillArcX:x y:y width:w height:h from:startAngle to:endAngle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2300
    "draw a filled arc in a box, given startAngle and endAngle."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2301
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2302
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2303
        fillArcX:x y:y
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2304
        width:w height:h
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2305
        from:startAngle angle:(endAngle - startAngle)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2306
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2307
    "Created: 8.5.1996 / 08:52:41 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2308
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2309
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2310
fillCircle:aPoint radius:aNumber
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2311
    "draw a filled circle around aPoint"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2312
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2313
    gc fillCircleX:(aPoint x) y:(aPoint y) radius:aNumber
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2314
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2315
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2316
fillCircleIn:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2317
    "draw a filled circle in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2318
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2319
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2320
        fillArcX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2321
        width:(aRectangle width) height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2322
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2323
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2324
    "Created: 13.4.1996 / 20:57:41 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2325
    "Modified: 8.5.1996 / 08:42:38 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2326
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2327
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2328
fillCircleX:x y:y radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2329
    "draw a filled circle around x@y"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2330
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2331
    |d|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2332
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2333
    d := 2 * r.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2334
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2335
        fillArcX:(x - r) y:(y - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2336
        width:d height:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2337
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2338
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2339
    "Modified: 8.5.1996 / 08:43:02 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2340
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2341
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2342
fillRectangle:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2343
    "fill a rectangle with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2344
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2345
    gc fillRectangleX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2346
       width:(aRectangle width) height:(aRectangle height)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2347
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2348
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2349
fillRectangleLeft:left top:top right:cornerX bottom:cornerY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2350
    "draw a filled rectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2351
     Notice: the cornerPoint itself is NOT included"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2352
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2353
    gc fillRectangleX:left y:top width:(cornerX - left) height:(cornerY - top)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2354
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2355
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2356
fillRectangleOrigin:origin corner:corner
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2357
    "draw a filled rectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2358
     Notice: the cornerPoint itself is NOT included"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2359
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2360
    |top left|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2361
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2362
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2363
    top := origin y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2364
    gc fillRectangleX:left y:top width:(corner x - left) height:(corner y - top)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2365
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2366
    "Created: 13.4.1996 / 20:58:16 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2367
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2368
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2369
fillRectangleOrigin:origin extent:extent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2370
    "draw a filled rectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2371
     Notice: the cornerPoint itself is NOT included"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2372
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2373
    gc fillRectangleX:(origin x) y:(origin y) width:(extent x) height:(extent y)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2374
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2375
8291
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2376
fillRectangleOrigin:origin width:w height:h
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2377
    "draw a filled rectangle.
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2378
     Notice: the cornerPoint itself is NOT included"
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2379
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2380
    gc fillRectangleX:(origin x) y:(origin y) width:w height:h
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2381
!
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2382
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2383
fillRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2384
    gc fillRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2385
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2386
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2387
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2388
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2389
     (v := View new) extent:200@200; openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2390
     v fillRoundRectangleX:10 y:10 width:100 height:100 wCorner:20 hCorner:20
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2391
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2392
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2393
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2394
invertRectangle:aRectangle
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2395
    "invert a rectangle in the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2396
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2397
    self xoring:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2398
	self fillRectangle:aRectangle
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2399
    ]
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2400
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2401
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2402
white
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2403
    "fill the receiver with white"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2404
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  2405
    self fill:self whiteColor
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2406
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2407
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2408
!GraphicsMedium methodsFor:'initialization & release'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2409
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2410
close
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2411
    "same as destroy - for ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2412
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2413
    self destroy
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2414
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2415
    "Created: 2.4.1997 / 19:31:27 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2416
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2417
8823
17c3eb806e69 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 8819
diff changeset
  2418
defaultFont
17c3eb806e69 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 8819
diff changeset
  2419
    ^ self class defaultFont
17c3eb806e69 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 8819
diff changeset
  2420
!
17c3eb806e69 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 8819
diff changeset
  2421
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2422
destroy
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2423
    "destroy a medium - here the gc is completely destroyed"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2424
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2425
    gc notNil ifTrue:[
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2426
        gc destroy.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2427
    ].
7741
061327740950 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7704
diff changeset
  2428
    "keep device, maybe we want to re-open the view later"
061327740950 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7704
diff changeset
  2429
"/    device := nil.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2430
    realized := false.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2431
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2432
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2433
initGC
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2434
    "since we do not need a gc-object for the drawable until something is
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2435
     really drawn, none is created.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2436
     This method is sent, when the first drawing happens"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2437
7750
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2438
    ^ gc initGC
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2439
!
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2440
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2441
initialize
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2442
    super initialize.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2443
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2444
    width := 0.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2445
    height := 0.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2446
    realized := false.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2447
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2448
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2449
initializeForDevice:aDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2450
    "allocate a GraphicsContext for a device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2451
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2452
    aDevice notNil ifTrue:[
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2453
        device := aDevice.
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2454
        gc := aDevice newGraphicsContextFor:self.
7485
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
  2455
        gc font:self class defaultFont.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2456
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2457
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2458
    self initialize.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2459
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2460
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2461
recreate
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2462
    "reacreate a medium after snapIn"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2463
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2464
    gc notNil ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2465
	gc recreate.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2466
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2467
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2468
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2469
releaseGC
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2470
    "destroy the associated device GC resource - can be done to be nice to the
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2471
     display if you know that you are done with a drawable."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2472
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2473
    gc notNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  2474
        gc releaseGC.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2475
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2476
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2477
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2478
!GraphicsMedium methodsFor:'misc'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2479
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2480
clippedTo:aRectangle do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2481
    |oldClip|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2482
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2483
    oldClip := gc deviceClippingBoundsOrNil.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2484
    gc clippingBounds:aRectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2485
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2486
    aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2487
	ensure:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2488
	    gc deviceClippingBounds:oldClip
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2489
	]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2490
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2491
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2492
flush
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2493
    "send all buffered drawing to the device."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2494
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2495
    gc flush
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2496
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2497
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2498
setDevice:aDevice id:aDrawbleId gcId:aGCId
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2499
    "private"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2500
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2501
    device := aDevice.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2502
    gc notNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  2503
        gc setDevice:aDevice id:aDrawbleId gcId:aGCId
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2504
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2505
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2506
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2507
setPaint:fgColor on:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2508
    "set the paint and background-paint color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2509
     The bg-paint is used in opaque-draw operations.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2510
     Only set the variables, but do not send it to the device,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2511
     Used on initialization."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2512
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2513
    gc setPaint:fgColor on:bgColor
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2514
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2515
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2516
sync
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2517
    "send all buffered drawing to the device and wait until the device responds"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2518
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2519
    gc sync
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2520
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2521
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2522
!GraphicsMedium methodsFor:'printing & storing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2523
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2524
storeOn:aStream
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2525
    "blocked: ascii storeString not possible (recursive - view - subviews - container)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2526
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2527
    self shouldNotImplement.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2528
    "if proceeded from exception..."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2529
    self printOn:aStream.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2530
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2531
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2532
!GraphicsMedium methodsFor:'queries'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2533
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2534
fontAscent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2535
    "answer the ascent of the current font on the current device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2536
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2537
    ^ gc fontAscent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2538
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2539
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2540
horizontalIntegerPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2541
    "return the (rounded) number of pixels per millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2542
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2543
    ^ self horizontalPixelPerMillimeter asInteger
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2544
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2545
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2546
horizontalPixelPerInch
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2547
    "return the number of horizontal pixels per inch of the display"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2548
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2549
    ^ self horizontalPixelPerMillimeter * 25.4
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2550
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2551
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2552
horizontalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2553
    "return the number of pixels per millimeter (not rounded)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2554
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2555
    ^ gc horizontalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2556
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2557
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2558
horizontalPixelPerMillimeter:millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2559
    "return the number of pixels (not rounded) for millis millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2560
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2561
    ^ self horizontalPixelPerMillimeter * millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2562
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2563
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2564
resolution
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2565
    "return a point consisting of pixel-per-inch horizontally and vertically."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2566
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2567
    ^ gc resolution
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2568
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2569
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2570
verticalIntegerPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2571
    "return the (rounded) number of pixels per millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2572
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2573
    ^ self verticalPixelPerMillimeter rounded
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2574
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2575
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2576
verticalPixelPerInch
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2577
    "return the number of vertical pixels per inch of the display"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2578
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2579
    ^ self verticalPixelPerMillimeter * 25.4
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2580
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2581
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2582
verticalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2583
    "return the number of pixels per millimeter (not rounded)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2584
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2585
    ^ gc verticalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2586
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2587
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2588
verticalPixelPerMillimeter:millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2589
    "return the number of pixels (not rounded) for millis millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2590
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2591
    ^ self verticalPixelPerMillimeter * millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2592
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2593
8814
efd25f7363ac #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8809
diff changeset
  2594
!GraphicsMedium methodsFor:'testing'!
efd25f7363ac #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8809
diff changeset
  2595
efd25f7363ac #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8809
diff changeset
  2596
isPSGraphicsContext
efd25f7363ac #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8809
diff changeset
  2597
    ^ false.
efd25f7363ac #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8809
diff changeset
  2598
! !
efd25f7363ac #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 8809
diff changeset
  2599
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2600
!GraphicsMedium methodsFor:'view creation'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2601
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2602
createBitmapFromArray:data width:width height:height
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2603
    "create a bitmap from data and set the drawableId"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2604
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2605
    gc createBitmapFromArray:data width:width height:height
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2606
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2607
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2608
createPixmapWidth:w height:h depth:d
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2609
    "create a pixmap and set the drawableId"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2610
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2611
    gc createPixmapWidth:w height:h depth:d
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2612
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2613
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2614
createRootWindow
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2615
    gc createRootWindowFor:self
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2616
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2617
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2618
createWindowFor:aView type:typeSymbol origin:org extent:ext minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv style:styleSymbol inputOnly:inp label:label owner:owner icon:icn iconMask:icnM iconView:icnV
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2619
    "create a window and set the drawableId"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2620
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2621
    gc createWindowFor:aView type:typeSymbol origin:org extent:ext minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv style:styleSymbol inputOnly:inp label:label owner:owner icon:icn iconMask:icnM iconView:icnV
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2622
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2623
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2624
!GraphicsMedium class methodsFor:'documentation'!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2625
7750
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2626
version
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2627
    ^ '$Header$'
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2628
!
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2629
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2630
version_CVS
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2631
    ^ '$Header$'
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2632
! !
6045
0e3df803d990 class: GraphicsMedium
Claus Gittinger <cg@exept.de>
parents: 5321
diff changeset
  2633