GraphicsMedium.st
author Claus Gittinger <cg@exept.de>
Mon, 27 May 2019 15:09:54 +0200
changeset 8690 83fadb9e5567
parent 8559 9f7e552ce3f8
child 8700 9f593fb9dc72
permissions -rw-r--r--
#OTHER by cg category of: #postCopy #postDeepCopy
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   749
    "return the device, the receiver is associated with"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   750
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   751
    ^ device
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   752
!
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
device:aDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   755
    "set the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   756
7485
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   757
    (aDevice isNil or:[device == aDevice]) ifTrue:[
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   758
        ^ self.
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   759
    ].
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
    gc isNil ifTrue:[
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
   762
        self initializeForDevice:aDevice.
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   763
        ^ self.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   764
    ].
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
    device := aDevice.
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   767
    gc device:aDevice
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   768
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   769
7469
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   770
deviceClippingBounds:aRectangleOrNil
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   771
    "set the clipping rectangle for drawing (in device coordinates);
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   772
     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
   773
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   774
    gc deviceClippingBounds:aRectangleOrNil
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   775
!
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
deviceClippingBoundsOrNil
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   778
    "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
   779
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   780
    ^ gc deviceClippingBoundsOrNil
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   781
!
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   782
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   783
deviceClippingRectangle:aRectangleOrNil
7469
9bdf9516a7bf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7467
diff changeset
   784
    <resource: #obsolete>
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   785
    "set the clipping rectangle for drawing (in device coordinates);
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   786
     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
   787
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
   788
    gc deviceClippingBounds:aRectangleOrNil
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   789
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   790
7504
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   791
deviceFont
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   792
    "return the current drawing font as a device font"
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   793
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   794
    ^ self font onDevice:device.
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   795
!
371f71deee69 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7485
diff changeset
   796
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   797
drawableId
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   798
    "return the id of the drawable on the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   799
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   800
    gc isNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   801
        ^ nil.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   802
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   803
    ^ gc drawableId
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   804
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   805
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   806
extent
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   807
    "return the extent i.e. a point with width as x, height as y
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   808
     coordinate"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   809
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   810
    ^ width @ height
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   811
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   812
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   813
extent:extent
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   814
    "set the extent"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   815
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   816
    width := extent x.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   817
    height := extent y
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   818
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   819
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   820
font
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   821
    "return the current drawing font"
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
    ^ gc font
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   824
!
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
font:aFont
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   827
    "set the font for drawing if it has changed.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   828
     This should be redefined in some widget to perform an automatic
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   829
     redraw. See also: #basicFont:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   830
7558
fe6f5d533b37 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7504
diff changeset
   831
    gc font:aFont.
8559
9f7e552ce3f8 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 8388
diff changeset
   832
9f7e552ce3f8 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 8388
diff changeset
   833
    "Modified: / 27-10-2018 / 22:58:48 / Claus Gittinger"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   834
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   835
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   836
function
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   837
    "return the current drawing function"
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
    ^ gc function
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   840
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   841
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   842
function:aSymbol
8298
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   843
    "set the drawing function if it has changed.
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   844
     The argument is one of:
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   845
            #copy,#copyInverted,#xor,#and,#andReverse
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   846
            #andInverted,#or,#orReverse,#orInverted
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   847
            #invert,#clear,#set,#noop,#equiv,#nand
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   848
     Notice: not all graphicMedia support all functions"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   849
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   850
    gc function:aSymbol
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
gcId
8193
486de380f4e7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8153
diff changeset
   854
    "return the receiver's graphic context id on the device"
7416
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 isNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   857
        ^ nil.
7416
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 gcId.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   860
!
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
graphicsContext
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   863
    ^ gc
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   864
!
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
graphicsContext:newGc
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   867
    "set the graphics context"
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
    gc == newGc ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   870
        ^ self.
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
    gc := newGc.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   873
    device := newGc device.
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   876
graphicsDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   877
    "same as #device, for ST-80 compatibility"
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
    ^ device
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
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   882
height
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   883
    "return the height of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   884
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   885
    ^ height
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   886
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   887
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   888
height:anInteger
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   889
    "set the height of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   891
    height := anInteger
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   892
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   894
id
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   895
    "return the id of the drawable on the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   896
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   897
    ^ self drawableId
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   898
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   899
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   900
joinStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   901
    "return the current join-style for polygon-drawing.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   902
     possible styles are: #miter, #bevel, #round"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   903
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   904
    ^ gc joinStyle
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   907
joinStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   908
    "set the join-style of lines in polygon-drawing;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   909
     possible styles are: #miter, #bevel, #round"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   910
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   911
    gc joinStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   912
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   913
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
left
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   915
    "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
   916
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   917
    ^ 0
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   918
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   919
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   920
leftCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   921
    "return the leftCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   922
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   923
    ^ (self left) @ (self top + (height // 2) - 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   924
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   925
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   926
lineStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   927
    "return the current line-drawing-style.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   928
     possible styles are: #solid, #dashed, #doubleDashed,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   929
     #dotted, #dashDot or #dashDotDot."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   930
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   931
    ^ gc lineStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   932
!
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
lineStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   935
    "set the line-drawing-style;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   936
     possible styles are: #solid, #dashed, #doubleDashed,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   937
     #dotted, #dashDot or #dashDotDot."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   938
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   939
    gc lineStyle:aStyleSymbol
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   942
lineWidth
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   943
    "return the current drawing linewidth"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   944
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   945
    ^ gc lineWidth
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   946
!
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
lineWidth:aNumber
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   949
    "set the line drawing width in pixels"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   950
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   951
    gc lineWidth:aNumber
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   952
!
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
mask
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   955
    "return the current drawing mask"
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
    ^ gc mask
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   958
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   959
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   960
mask:aForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   961
    "set the drawing mask"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   962
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   963
    gc mask:aForm
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   966
maskOrigin
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   967
    "return the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   968
     Should be redefined in classes which support it.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   969
     This is an alias for ST-80's #phase"
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
    ^ gc maskOrigin
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   972
!
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
maskOrigin:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   975
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   976
     Should be redefined in classes which support it.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   977
     This is an alias for ST-80's #phase:"
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
    gc maskOrigin:aPoint
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   982
maskOriginX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   983
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   984
     Should be redefined in classes which support it.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   985
     This is an alias for ST-80's #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   986
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   987
    self maskOrigin:(x @ y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   988
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   989
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   990
medium
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   991
    "return the destination medium i.e. the underlying graphics device"
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
    ^ gc graphicsDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   994
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   995
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   996
noClipByChildren
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   997
    "drawing shall also be done into subviews"
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
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1000
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1001
    self obsoleteMethodWarning:'use #clippedByChildren:false'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1002
    ^ self clippedByChildren:false
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
    "Created: 17.7.1996 / 14:15:54 / cg"
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
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1007
origin
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1008
    "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
  1009
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1010
    ^ 0 @ 0
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1011
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1012
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1013
paint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1014
    "return the current paint drawing color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1015
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1016
    ^ gc paint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1017
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1018
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1019
paint:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1020
    "set the drawing painting color, aColor can be a dithered one"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1021
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1022
    gc paint:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1023
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1024
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1025
paint:fgColor on:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1026
    "set the paint and backgroundPaint, used for text and bitmaps.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1027
     Both colors may be dithered colors"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1028
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1029
    gc paint:fgColor on:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1030
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1031
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1032
paint:fgColor on:bgColor function:f
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1033
    "set paint, background-paint and function"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1034
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1035
    self paint:fgColor on:bgColor.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1036
    self function:f
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1037
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1038
    "Modified: 16.5.1996 / 15:36:35 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1039
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1040
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1041
realized
2954
0182e5ac0247 added #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2947
diff changeset
  1042
    "return true, if the receiver is realized.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1043
     The receiver may still be unmapped, if the container is unrealized.
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1044
     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
  1045
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1046
    ^ realized
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1047
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1048
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1049
reallyRealized
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1050
    "return true, if the receiver is realized and all containers
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1051
     are realized."
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1052
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1053
    ^ self realized
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1054
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1055
!
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1056
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1057
rightCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1058
    "return the leftCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1059
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1060
    ^ (self left + width - 1) @ (self top + (height // 2) - 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1061
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1062
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1063
setClippingBounds:aRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1064
    gc setClippingBounds:aRectangleOrNil
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
7704
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1067
setDevice:aDevice
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1068
    "set the device"
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1069
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1070
    device := aDevice.
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1071
    gc setDevice:aDevice
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1072
!
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1073
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1074
setGraphicsExposures:aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1075
    "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
  1076
     of graphics exposures"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1077
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1078
    gc setGraphicsExposures:aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1079
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1080
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1081
setMaskOrigin:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1082
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1083
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1084
     OBSOLETE: use #maskOrigin: or #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1085
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1086
    self obsoleteMethodWarning:'use #maskOrigin:'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1087
    ^ self maskOriginX:aPoint x y:aPoint y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1088
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1089
    "Modified: / 26.1.1998 / 18:54:14 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1090
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1091
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1092
setMaskOriginX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1093
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1094
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1095
     OBSOLETE: use #maskOriginX:y: or #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1096
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1097
    self obsoleteMethodWarning:'use #maskOriginX:y:'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1098
    ^ self maskOriginX:x y:y
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
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
setWidth:w height:h
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
    "set both width and height - not to be redefined"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
    width := w.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
    height := h
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
top
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1109
    "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
  1110
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
    ^ 0
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1112
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1114
topCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1115
    "return the topCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1117
    ^ (self left + (width//2) - 1) @ (self top)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1118
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1119
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1120
topRight
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1121
    "return the topRight point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1122
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1123
    ^ (self left + width - 1) @ (self top)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1124
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1125
2030
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1126
viewBackground
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1127
    "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
  1128
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1129
    ^ self backgroundPaint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1130
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1131
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1132
viewOrigin
8388
4f61000dd8ea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  1133
    "return the drawable's visible origin (for scrolling)"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1134
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1135
    ^ 0@0
8388
4f61000dd8ea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  1136
4f61000dd8ea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  1137
    "Modified (comment): / 14-06-2018 / 10:16:52 / Claus Gittinger"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1138
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1139
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1140
whiteColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1141
    gc isNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1142
        ^ Color white.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1143
    ].
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1144
    ^ gc whiteColor
2030
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1145
!
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1146
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1147
width
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1148
    "return the width of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1149
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1150
    ^ width
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1151
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1152
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1153
width:anInteger
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1154
    "set the width of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1156
    width := anInteger
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1157
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1158
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1159
width:w height:h
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1160
    "set both width and height of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
    width := w.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1163
    height := h
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1164
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1165
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1166
!GraphicsMedium methodsFor:'accessing-internals'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1167
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1168
background
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1169
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1170
    "return the current background drawing color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1171
     OBSOLETE: use #paint: / #backgroundPaint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1172
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1173
    ^ gc background
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1174
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1175
    "Modified: 12.5.1996 / 22:28:09 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1176
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1177
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1178
background:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1179
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1180
    "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
  1181
     OBSOLETE: this method will vanish; use #paint: / #backgroundPaint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1182
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1183
    gc background:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1184
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1185
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1186
foreground
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1187
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1188
    "return the current foreground drawing color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1189
     OBSOLETE: use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1190
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1191
    ^ gc foreground
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1192
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1193
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1194
foreground:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1195
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1196
    "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
  1197
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1198
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1199
    gc foreground:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1200
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1201
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1202
foreground:fgColor background:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1203
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1204
    "set both internal foreground and internal background colors
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1205
     - these must be real colors.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1206
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
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
    gc foreground:fgColor background:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1209
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1210
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1211
foreground:fgColor background:bgColor function:fun
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1212
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1213
    "set foreground, background colors and function.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1214
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1215
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
  1216
    gc foreground:fgColor background:bgColor.
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
  1217
    gc function:fun
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1218
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1219
    "Modified: 12.5.1996 / 22:28:34 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1220
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1221
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1222
foreground:aColor function:fun
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1223
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1224
    "set the foreground color and function for drawing.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1225
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1226
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1227
    gc foreground:aColor function:fun
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1228
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1229
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1230
setRealized:aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1231
    "low level special interface to manipulate the realized state.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1232
     Non-public interface, only to be used by experts.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1233
     (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
  1234
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1235
    realized := aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1236
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1237
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1238
!GraphicsMedium methodsFor:'accessing-transformation'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1239
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1240
scale
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1241
    "return the scale factor (as point) of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1242
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1243
    ^ gc scale
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1244
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1245
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1246
scale:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1247
    "set the scale factor of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1248
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1249
    ^ gc scale:aPoint
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1252
transformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1253
    "return the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1254
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1255
    ^ gc transformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1256
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1257
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1258
transformation:aTransformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1259
    "set the transformation"
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
    ^ gc transformation:aTransformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1262
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1263
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1264
translateBy:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1265
    "add to the translation offset of the transformation"
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 translateBy:aPoint
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
translation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1271
    "return the translation factor (as point) of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1272
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1273
    ^ gc translation
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1276
translation:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1277
    "set the translation offset of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1278
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1279
    ^ gc translation:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1280
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1281
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1282
!GraphicsMedium methodsFor:'basic drawing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1283
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1284
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
  1285
    "draw an arc in a box
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1286
     - this could be recoded to draw using displayLine"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1287
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1288
    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
  1289
!
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
displayDottedRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1292
    "draw a dotted-line rectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1293
     A general implementation is found here; deviceGC's
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1294
     may reimplement this if directly supported by the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1295
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1296
    gc displayDottedRectangleX:x y:y width:w height:h
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1299
displayHorizontalWavelineFromX:x0 y:y0 toX:x1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1300
    "draw a horizontal wave-line from x0/y0 to x1/y0"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1301
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1302
    gc displayHorizontalWavelineFromX:x0 y:y0 toX:x1
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1305
displayLineFromX:x0 y:y0 toX:x1 y:y1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1306
    "draw a line from x0/y0 to x1/y1"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1307
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1308
    gc displayLineFromX:x0 y:y0 toX:x1 y:y1
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1311
displayOpaqueForm:aForm x:x y:y
8153
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1312
    "draw a form at x/y; 
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1313
     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
  1314
     drawn in current fg, 0's in current bg color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1315
     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
  1316
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1317
    gc displayOpaqueForm:aForm x:x y:y
8153
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1318
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1319
    "Modified (comment): / 31-08-2017 / 19:26:34 / cg"
7416
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
displayOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1323
    "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
  1324
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1325
    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
  1326
!
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
displayPolygon:aPolygon
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1329
    "draw a polygon
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1330
     - this could be recoded to draw using displayLine"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1331
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1332
    gc displayPolygon:aPolygon
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1333
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1334
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1335
displayRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1336
    "draw a rectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1337
     - this could be recoded to draw using displayLine"
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
    gc displayRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1340
!
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
displayString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1343
    "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
  1344
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1345
    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
  1346
!
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
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
  1349
    "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
  1350
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1351
    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
  1352
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1353
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1354
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
  1355
    "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
  1356
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1357
    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
  1358
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1359
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1360
!GraphicsMedium methodsFor:'basic filling'!
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
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
  1363
    "fill an arc with current paint color"
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 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
  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
fillPolygon:points
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1369
    "fill a polygon with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1370
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1371
    gc fillPolygon:points
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1372
!
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
fillRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1375
    "fill a rectangle with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1376
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1377
    gc fillRectangleX:x y:y width:w height:h
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1380
fillRectangleX:x y:y width:w height:h color:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1381
    "fill a rectangle with given color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1382
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1383
    gc fillRectangleX:x y:y width:w height:h color:aColor
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1386
!GraphicsMedium methodsFor:'bit blitting'!
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
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
  1389
    "copy bits from a smalltalk byteArray.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1390
     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
  1391
     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
  1392
     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
  1393
     method to whatever the device needs."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1394
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1395
    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
  1396
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1397
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1398
copyFrom:aGC toX:dstX y:dstY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1399
    "copy from a drawable - maybe self"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1400
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1401
    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
  1402
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1403
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1404
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
  1405
    "copy from a drawable - maybe self"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1406
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1407
    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
  1408
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1409
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1410
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
  1411
    "copy from aDrawable into the receiver;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1412
     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
  1413
     All coordinates are in device coordinates.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1414
     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
  1415
     - otherwise, it returns when the scroll operation is finished.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1416
     (not all devices care for this).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1417
     If the receiver is a pixmap, the call always returns immediately."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1418
7748
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1419
    |deviceDrawable mustWait sourceDepth|
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1421
    ((aDrawable graphicsDevice ~~ device)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1422
     or:[aDrawable isImage]) ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1423
        deviceDrawable := aDrawable asFormOn:device.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1424
    ] ifFalse:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1425
        deviceDrawable := aDrawable
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1426
    ].
7745
c8a5b8bca250 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7741
diff changeset
  1427
    sourceDepth := deviceDrawable depth.
7748
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1428
    mustWait := async not 
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1429
                    and:[deviceDrawable isView 
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1430
                    and:[(sourceDepth ~~ 1) or:[device depth == 1]]].
7467
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  1431
    mustWait ifTrue:[
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  1432
        mustWait := self catchExpose.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1433
    ].
7745
c8a5b8bca250 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7741
diff changeset
  1434
    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
  1435
    mustWait ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1436
        self waitForExpose
7416
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
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1439
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1440
copyFrom:aGC x:dstX y:dstY width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1441
    "copy from a drawable - maybe self"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1442
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1443
    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
  1444
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1445
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1446
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
  1447
    "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
  1448
     background, while 1's are drawn with foreground color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1449
     The depth of aDrawable must (should) be 1.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1450
     The drawable must have been allocated on the same device.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1451
     All coordinates are in device coordinates."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1452
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1453
    |deviceDrawable|
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1454
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1455
    ((aDrawable graphicsDevice ~~ device)
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1456
    or:[aDrawable isImage]) ifTrue:[
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1457
        deviceDrawable := aDrawable asFormOn:device.
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1458
    ] ifFalse:[
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1459
        deviceDrawable := aDrawable
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1460
    ].
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1461
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1462
    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
  1463
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1464
8690
83fadb9e5567 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 8559
diff changeset
  1465
!GraphicsMedium methodsFor:'copying-private'!
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1466
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1467
postCopy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1468
    "this may not be enough to allow copying of views ..."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1469
7843
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1470
    <modifier: #super> "must be called if redefined"
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1471
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1472
    "/ super postCopy.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1473
    realized := false.
7843
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1474
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1475
    "Modified: / 08-02-2017 / 00:19:33 / cg"
4403
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1476
!
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1477
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1478
postDeepCopy
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1479
    super postDeepCopy.
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1480
    realized := false.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1481
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1482
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1483
!GraphicsMedium methodsFor:'drawing'!
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
display:someObject at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1486
    "draw someObject - this must understand the #displayOn:at: message"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1487
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1488
    someObject displayOn:self at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1489
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1490
    "Created: 28.5.1996 / 14:22:57 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1491
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1492
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1493
displayArcIn:aRectangle from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1494
    "draw an arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1495
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1496
    gc displayArcX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1497
       width:(aRectangle width) height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1498
       from:startAngle angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1499
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1500
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1501
displayArcOrigin:origin corner:corner from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1502
    "draw an arc in a box"
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
    |left top right bot|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1505
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1506
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1507
    top := origin y.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1508
    right := corner x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1509
    bot := corner y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1510
    gc displayArcX:left y:top
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1511
       width:(right - left + 1) height:(bot - top + 1)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1512
       from:startAngle angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1513
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1514
    "Modified: 8.5.1996 / 08:35:25 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1515
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1516
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1517
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
  1518
    "draw an arc; apply transformation if nonNil"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1519
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1520
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1521
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1522
    self obsoleteMethodWarning:'use #displayArcX:y:width:height:from:angle:'.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1523
    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
  1524
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1525
    "Modified: 8.5.1996 / 08:46:56 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1526
!
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
displayCircle:aPoint radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1529
    "draw a circle around a center point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1530
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1531
    gc displayCircleX:(aPoint x) y:(aPoint y) radius:r
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1534
displayCircleIn:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1535
    "draw a circle in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1536
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1537
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1538
        displayArcX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1539
        width:(aRectangle width) height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1540
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1541
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1542
    "Modified: 8.5.1996 / 08:35:40 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1545
displayCircleX:x y:y radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1546
    "draw a circle around a center point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1547
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1548
    |d|
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1549
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1550
    d := 2 * r.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1551
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1552
        displayArcX:(x - r) y:(y - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1553
        width:d height:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1554
        from:0 angle:360
7416
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
    "Modified: 8.5.1996 / 08:36:03 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1557
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1558
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1559
displayForm:aFormOrImage
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1560
    "draw a form (or image) at the origin"
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
    gc displayForm:aFormOrImage x:0 y:0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1563
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1564
    "Modified: / 24.4.1997 / 16:00:11 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1565
    "Created: / 9.11.1997 / 00:50:52 / 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
displayForm:aFormOrImage at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1569
    "draw a form (or image)"
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 displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
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
    "Modified: 24.4.1997 / 16:00:11 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1574
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1575
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1576
displayForm:formToDraw x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1577
    "draw a form or image non opaque;
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1578
     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
  1579
     current paint-color, leaving pixels with 0-bits unchanged
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1580
     (i.e. only 1-bits are drawn from the form).
7883
94bb868d80e6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7861
diff changeset
  1581
     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
  1582
     settings are ignored and the form is drawn as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1583
     Care must be taken, that the paint color is correctly allocated
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1584
     (by sending #on: to the color) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1585
     Using functions other than #copy only makes sense if you are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1586
     certain, that the colors are real colors (actually, only for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1587
     noColor or allColor)."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1588
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1589
    gc displayForm:formToDraw x:x y:y
7883
94bb868d80e6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7861
diff changeset
  1590
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1591
    "Modified (comment): / 13-02-2017 / 20:19:56 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1592
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1593
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1594
displayForm:aFormOrImage x:x y:y opaque:opaque
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1595
    "draw a form (or image) at x/y;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1596
     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
  1597
     drawn in current paint color, 0's are ignored.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1598
     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
  1599
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1600
    opaque ifTrue:[
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1601
        gc displayOpaqueForm:aFormOrImage x:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1602
    ] ifFalse:[
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1603
        gc displayForm:aFormOrImage x:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1604
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1605
!
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
displayImage:aFormOrImage
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1608
    "draw an image (or form).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1609
     Provided for ST-80 compatibilty;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1610
     in ST/X, images are also handled by #displayForm:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1611
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1612
    gc displayForm:aFormOrImage x:0 y:0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1613
!
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
displayImage:aFormOrImage at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1616
    "draw an image (or form).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1617
     Provided for ST-80 compatibilty;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1618
     in ST/X, images are also handled by #displayForm:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1619
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1620
    gc displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1621
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1622
    "Modified: 24.4.1997 / 16:02:43 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1623
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1624
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1625
displayImage:aFormOrImage x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1626
    "draw an image (or form).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1627
     Provided for ST-80 compatibilty;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1628
     in ST/X, images are also handled by #displayForm:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1629
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1630
    gc displayForm:aFormOrImage x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1631
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1632
    "Created: 24.4.1997 / 16:03:03 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1635
displayLineFrom:point1 to:point2
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1636
    "draw a line"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1637
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1638
    gc displayLineFromX:(point1 x) y:(point1 y)
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1639
                    toX:(point2 x) y:(point2 y)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1640
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1641
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1642
displayLineFromX:xStart y:yStart toX:xEnd y:yEnd brush:aForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1643
    "draw a line using a brush.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1644
     Here, a slow fallback is used, drawing into a
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1645
     temporary bitmap first, which is then displayed"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1646
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1647
    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
  1648
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1649
    "Modified: 1.4.1997 / 21:29:06 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1650
!
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
displayOpaqueString:aString at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1653
    "draw a string with both fg and bg"
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
    gc displayOpaqueString:aString x:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1656
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1657
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1658
displayOpaqueString:aString from:start to:stop at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1659
    "draw part of a string - drawing both fg and bg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1660
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1661
    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
  1662
!
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
displayOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1665
    "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
  1666
     background pixels in bgPaint color. If the transformation involves scaling,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1667
     the fonts point-size is scaled as appropriate.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1668
     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
  1669
     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
  1670
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1671
    gc displayOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1672
!
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
displayOpaqueString:aString x:x y:y angle:drawAngle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1675
    "draw a string along a (possibly non-horizontal) line,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1676
     drawing both fg and bg pixels.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1677
     The angle is in degrees, clock-wise, starting with 0 for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1678
     a horizontal draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1679
     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
  1680
     which is rotated and finally drawn as usual.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1681
     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
  1682
             operation - not to be used with cillions of strings ..."
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1683
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1684
    gc displayString:aString x:x y:y angle:drawAngle opaque:true
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1685
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1686
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1687
     |v|
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
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1690
     v extent:300@200.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1691
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1692
     0 to:360 by:45 do:[:a |
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1693
         v paint:Color black on:Color red.
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1694
         v displayOpaqueString:'hello world' x:100 y:100 angle:a.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1695
     ].
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
    "in contrast to non-opaque draw:
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1699
     |v|
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
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1702
     v extent:300@200.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1703
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1704
     0 to:360 by:45 do:[:a |
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1705
         v paint:Color black on:Color red.
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1706
         v displayString:'hello world' x:100 y:100 angle:a.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1707
     ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1708
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1709
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1710
    "Modified: 23.4.1997 / 17:50:23 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1711
!
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
displayPoint:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1714
    "draw a pixel"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1715
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1716
    gc displayPointX:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1717
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1718
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1719
displayPointX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1720
    "draw a point (with current paint-color); apply transformation if nonNil"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1721
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1722
    gc displayPointX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1723
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1724
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1725
displayRectangle:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1726
    "draw a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1727
7791
66d7e8e6d807 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7760
diff changeset
  1728
    gc displayRectangleX:(aRectangle left) y:(aRectangle top)
66d7e8e6d807 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7760
diff changeset
  1729
       width:(aRectangle width) height:(aRectangle height)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1730
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1731
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1732
displayRectangleOrigin:origin corner:corner
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1733
    "draw a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1734
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1735
    |top left|
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
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1738
    top := origin y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1739
    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
  1740
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1741
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1742
displayRectangleOrigin:origin extent:extent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1743
    "draw a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1744
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1745
    gc displayRectangleX:(origin x) y:(origin y)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1746
       width:(extent x) height:(extent y)
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
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
  1750
    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
  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
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1754
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1755
     (v := View new) extent:200@200; openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1756
     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
  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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1760
displayString:aString at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1761
    "draw a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1762
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1763
    gc displayString:aString x:aPoint x y:aPoint y
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1766
displayString:aString centeredAt:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1767
    "draw a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1768
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1769
    gc displayString:aString centeredAtX:aPoint x y:aPoint y
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
displayString:aString centeredAtX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1773
    "draw a string - drawing fg only"
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
    |w h|
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
    w := aString widthOn:self.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1778
    h := aString heightOn:self.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1779
    gc displayString:aString x:x-(w/2) y:y-(h/2)
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
displayString:aString from:start to:stop at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1783
    "draw part of a string - drawing fg only"
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 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
  1786
!
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
displayString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1789
    "draw a string at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1790
     draw foreground-pixels only (in current paint-color),
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1791
     leaving background as-is. If the transformation involves scaling,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1792
     the fonts point-size is scaled as appropriate."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1793
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1794
    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
  1795
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1796
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1797
displayString:aString x:x y:y angle:drawAngle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1798
    "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
  1799
     The angle is in degrees, clock-wise, starting with 0 for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1800
     a horizontal draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1801
     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
  1802
     which is rotated and finally drawn as usual.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1803
     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
  1804
             operation - not to be used with cillions of strings ..."
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1805
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1806
    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
  1807
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1808
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1809
     |v|
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
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1812
     v extent:300@200.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1813
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1814
     0 to:360 by:90 do:[:a |
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1815
         v paint:Color black.
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1816
         v displayString:'hello world' x:100 y:100 angle:a.
7416
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
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1819
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1820
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1821
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1822
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1823
     v extent:400@400.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1824
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1825
     0 to:360 by:5 do:[:a |
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1826
         v paint:Color black.
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1827
         v displayString:'.........hello' x:200 y:200 angle:a.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1828
     ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1829
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1830
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1831
     |v|
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
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1834
     v extent:200@100.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1835
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1836
     v displayString:' hello' x:90 y:50 angle:0.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1837
     v displayString:' hello' x:90 y:50 angle:45.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1838
     v displayString:' hello' x:90 y:50 angle:90.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1839
     v displayString:' hello' x:90 y:50 angle:180.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1840
     v displayString:' hello' x:90 y:50 angle:270.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1841
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1842
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1843
     |v|
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 := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1846
     v extent:200@100.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1847
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1848
     v displayString:'hello' x:50 y:50 angle:0.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1849
     v displayString:'hello' x:50 y:50 angle:45.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1850
     v displayString:'hello' x:50 y:50 angle:90.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1851
     v displayString:'hello' x:50 y:50 angle:135.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1852
     v displayString:'hello' x:50 y:50 angle:180.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1853
     v displayString:'hello' x:50 y:50 angle:225.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1854
     v displayString:'hello' x:50 y:50 angle:270.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1855
     v displayString:'hello' x:50 y:50 angle:315.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1856
    "
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
    "Modified: 24.4.1997 / 12:51:25 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1859
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1860
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1861
displayString:aString x:x y:y angle:drawAngle opaque:opaque
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1862
    "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
  1863
     The angle is in degrees, clock-wise, starting with 0 for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1864
     a horizontal draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1865
     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
  1866
     which is rotated and finally drawn as usual.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1867
     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
  1868
             operation - not to be used with cillions of strings ...
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1869
     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
  1870
             this can (currently) only be done opaque"
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1871
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1872
    gc displayString:aString x:x y:y angle:drawAngle opaque:opaque
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1873
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1874
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1875
displayUnscaledForm:formToDraw x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1876
    "draw a form or image non opaque and unscaled;
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1877
     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
  1878
     current paint-color, leaving pixels with 0-bits unchanged
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1879
     (i.e. only 1-bits are drawn from the form).
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1880
     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
  1881
     settings are ignored and the form is drawn as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1882
     Care must be taken, that the paint color is correctly allocated
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1883
     (by sending #on: to the color) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1884
     Using functions other than #copy only makes sense if you are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1885
     certain, that the colors are real colors (actually, only for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1886
     noColor or allColor).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1887
     The origins coordinate is transformed, but the image itself is unscaled."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1888
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1889
    gc displayUnscaledForm:formToDraw x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1890
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1891
    "Modified (comment): / 13-02-2017 / 20:20:09 / cg"
7416
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
displayUnscaledOpaqueForm:formToDraw x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1895
    "draw a form or image opaque and unscaled;
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1896
     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
  1897
     current paint-color, 0 bits in background color.
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1898
     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
  1899
     settings are ignored and the form is drawn as-is (opaque).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1900
     The origins coordinate is transformed, but the image itself is unscaled."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1901
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1902
    gc displayUnscaledOpaqueForm:formToDraw x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1903
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1904
    "Modified (comment): / 13-02-2017 / 20:20:15 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1905
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1906
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1907
displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1908
    "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
  1909
     Draw foreground pixels in paint-color, background pixels in bgPaint color."
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
    gc displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1912
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1913
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1914
displayUnscaledOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1915
    "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
  1916
     Draw foreground pixels in paint-color, background pixels in bgPaint color."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1917
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1918
    gc displayUnscaledOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1919
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1920
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1921
displayUnscaledString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1922
    "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
  1923
     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
  1924
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1925
    gc displayUnscaledString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1926
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1927
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1928
displayUnscaledString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1929
    "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
  1930
     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
  1931
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1932
    gc displayUnscaledString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1933
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1934
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1935
!GraphicsMedium methodsFor:'drawing in device coordinates'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1936
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1937
displayDeviceForm:aForm x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1938
    "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
  1939
     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
  1940
     current paint-color, leaving pixels with 0-bits unchanged
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1941
     (i.e. only 1-bits are drawn from the form).
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1942
     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
  1943
     settings are ignored and the form is drawn as-is;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1944
     however, the mask is applied if present.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1945
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1946
     The form should must have been allocated on the same device,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1947
     otherwise its converted here, which slows down the draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1948
     No transformation or scaling is done.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1949
     Care must be taken, that the paint color is correctly allocated
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1950
     (by sending #on: to the color) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1951
     Using functions other than #copy only makes sense if you are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1952
     certain, that the colors are real colors (actually, only for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1953
     noColor or allColor)."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1954
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1955
    gc displayDeviceForm:aForm x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1956
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1957
    "Modified (comment): / 13-02-2017 / 20:19:47 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1958
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1959
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1960
displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1961
    "draw a line in device coordinates"
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
    gc displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1964
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1965
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1966
displayDeviceOpaqueForm:aForm x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1967
    "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
  1968
     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
  1969
     current paint-color and 0-bits in the bgPaint color.
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1970
     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
  1971
     settings are ignored and the form drawn as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1972
     Any mask is ignored.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1973
     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
  1974
     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
  1975
     to the colors) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1976
     The form should have been allocated on the same device; otherwise,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1977
     its converted here, which slows down the draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1978
     Drawing is in device coordinates; no scaling is done."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1979
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1980
    gc displayDeviceOpaqueForm:aForm x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1981
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1982
    "Modified (comment): / 13-02-2017 / 20:19:52 / cg"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1983
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1984
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1985
displayDeviceOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1986
    "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
  1987
     paint-color and background pixels in bgPaint-color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1988
     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
  1989
     the case where paint and/or bgPaint are dithered colors.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1990
     No translation or scaling is done."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1991
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1992
    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
  1993
!
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
displayDeviceOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1996
    "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
  1997
     paint-color and background pixels in bgPaint-color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1998
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1999
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2000
    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
  2001
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2002
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2003
displayDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2004
    "draw a rectangle in device coordinates"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2005
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2006
    gc displayDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2007
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2008
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2009
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
  2010
    "draw a substring at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2011
     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
  2012
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2013
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2014
    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
  2015
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2016
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2017
displayDeviceString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2018
    "draw a substring at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2019
     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
  2020
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2021
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2022
    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
  2023
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2024
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2025
displayDeviceString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2026
    "draw a string at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2027
     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
  2028
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2029
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2030
    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
  2031
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2032
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2033
fillDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2034
    "fill a rectangle with current paint color (device coordinates)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2035
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2036
    gc fillDeviceRectangleX:x y:y width:w height:h
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
!GraphicsMedium methodsFor:'edge drawing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2040
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2041
drawEdgesForX:x y:y width:w height:h level:l
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2042
    "draw 3D edges into a rectangle"
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2043
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2044
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2045
        drawEdgesForX:x y:y width:w height:h level:l
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2046
        shadow:self blackColor light:self whiteColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2047
        halfShadow:nil halfLight:nil
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2048
        style:nil
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2051
drawEdgesForX:x y:y width:w height:h level:l
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2052
                shadow:shadowColor light:lightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2053
                halfShadow:halfShadowColor halfLight:halfLightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2054
                style:edgeStyle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2055
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2056
    "draw 3D edges into a rectangle"
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 drawEdgesForX:x y:y width:w height:h level:l
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2059
       shadow:shadowColor light:lightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2060
       halfShadow:halfShadowColor halfLight:halfLightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2061
       style:edgeStyle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2062
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2063
    "Modified: / 24.8.1998 / 18:23:02 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2064
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2065
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2066
edgeDrawn:whichOne
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2067
    "a redefinable hook for views which like to draw
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2068
     over their edges (some checkToggles do).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2069
     Nothing done here."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2070
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2071
    "Created: 7.3.1997 / 17:59:07 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2072
! !
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
!GraphicsMedium methodsFor:'evaluating in another context'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2075
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2076
reverseDo:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2077
    "evaluate aBlock with foreground and background interchanged.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2078
     This can be reimplemented here in a faster way."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2079
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2080
    gc reverseDo:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2081
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2082
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2083
withBackground:fgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2084
    "evaluate aBlock with changed background."
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
    gc withBackground:fgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2087
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2088
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2089
withForeground:fgColor background:bgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2090
    "evaluate aBlock with changed foreground and background."
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
    gc withForeground:fgColor background:bgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2093
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2094
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2095
withForeground:fgColor background:bgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2096
    "evaluate aBlock with foreground, background and function"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2097
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2098
    gc withForeground:fgColor background:bgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2099
!
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
withForeground:fgColor background:bgColor mask:aMask do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2102
    "evaluate aBlock with foreground, background and mask"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2103
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2104
    gc withForeground:fgColor background:bgColor mask:aMask do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2105
!
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
withForeground:fgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2108
    "evaluate aBlock with changed foreground."
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
    gc withForeground:fgColor do:aBlock
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2113
withForeground:fgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2114
    "evaluate aBlock with changed foreground and function."
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 withForeground:fgColor function:aFunction do: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
7760
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2119
withPaint:aColor do:aBlock
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2120
    "evaluate aBlock with changed paint color."
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2121
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2122
    gc withPaint:aColor do:aBlock
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2123
!
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2124
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2125
xoring:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2126
    "evaluate aBlock with function xoring"
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 xoring: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
7467
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2131
!GraphicsMedium methodsFor:'event handling'!
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2132
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2133
catchExpose
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2134
    "expose event handling is only required for views."
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2135
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2136
    ^ false.
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2137
!
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2138
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2139
waitForExpose
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2140
    "expose event handling is only required for views."
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2141
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2142
    ^ self.
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2143
! !
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2144
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2145
!GraphicsMedium methodsFor:'filling'!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2146
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2147
black
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2148
    "fill the receiver with black"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2149
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2150
    self fill:self blackColor
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2151
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2152
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2153
clear
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2154
    "clear the receiver with background"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2155
4068
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2156
    self clearView.
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2157
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2158
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2159
clearDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2160
    "clear a rectangular area to background"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2161
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2162
    gc clearDeviceRectangleX:x y:y width:w height:h.
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
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2165
clearInside
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2166
    "clear the receiver with background - ST-80 compatibility"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2167
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2168
    self clear
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2169
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2170
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2171
clearRectangle:aRectangle
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2172
    "clear the rectangular area in the receiver to background"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2173
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2174
    self clearRectangleX:(aRectangle left)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2175
		       y:(aRectangle top)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2176
		   width:(aRectangle width)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2177
		  height:(aRectangle height)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2178
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2179
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2180
clearRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2181
    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
  2182
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2183
4068
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2184
clearView
8268
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2185
    "clear the receiver with its view background"
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2186
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2187
    "/ 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
  2188
    "/ is redefined to use viewBackground instead of background-drawing color.
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2189
    "/ consider this a kludge.
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2190
    self clearDeviceRectangleX:0 y:0 width:width height:height
4068
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2191
!
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2192
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2193
fill:something
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2194
    "fill the receiver with something;
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2195
     something may be a Form, Color or colorIndex"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2196
7794
1ccbf79e1506 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7791
diff changeset
  2197
    gc fillRectangle:(self boundingBox) color:something
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2198
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2199
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2200
fillArc:origin radius:r from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2201
    "draw a filled arc around a point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2202
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2203
    |d|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2204
    d := 2 * r.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2205
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2206
        fillArcX:(origin x - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2207
               y:(origin y - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2208
           width:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2209
          height:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2210
            from:startAngle
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2211
           angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2212
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2213
    "Modified: 8.5.1996 / 08:41:54 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2214
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2215
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2216
fillArcIn:aRectangle from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2217
    "draw a filled arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2218
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2219
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2220
        fillArcX:(aRectangle left)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2221
               y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2222
           width:(aRectangle width)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2223
          height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2224
            from:startAngle
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2225
           angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2226
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2227
    "Created: 13.4.1996 / 20:56:03 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2228
    "Modified: 8.5.1996 / 08:42:13 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2229
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2230
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2231
fillArcOrigin:origin corner:corner from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2232
    "draw a filled arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2233
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2234
    |left top right bot|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2235
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2236
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2237
    top := origin y.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2238
    right := corner x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2239
    bot := corner y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2240
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2241
        fillArcX:left
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2242
        y:top
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2243
        width:(right - left + 1)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2244
        height:(bot - top + 1)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2245
        from:startAngle
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2246
        angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2247
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2248
    "Created: 13.4.1996 / 20:56:56 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2249
    "Modified: 8.5.1996 / 08:42:23 / 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
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
  2253
    "draw a filled arc; apply transformation if nonNil"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2254
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2255
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2256
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2257
    self obsoleteMethodWarning:'use #fillArcX:y:width:height:from:angle:'.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2258
    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
  2259
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2260
    "Modified: 8.5.1996 / 08:47:52 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2261
!
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
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
  2264
    "draw a filled arc in a box, given startAngle and endAngle."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2265
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2266
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2267
        fillArcX:x y:y
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2268
        width:w height:h
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2269
        from:startAngle angle:(endAngle - startAngle)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2270
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2271
    "Created: 8.5.1996 / 08:52:41 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2272
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2273
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2274
fillCircle:aPoint radius:aNumber
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2275
    "draw a filled circle around aPoint"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2276
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2277
    gc fillCircleX:(aPoint x) y:(aPoint y) radius:aNumber
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2278
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2279
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2280
fillCircleIn:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2281
    "draw a filled circle in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2282
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2283
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2284
        fillArcX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2285
        width:(aRectangle width) height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2286
        from:0 angle:360
7416
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
    "Created: 13.4.1996 / 20:57:41 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2289
    "Modified: 8.5.1996 / 08:42:38 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2292
fillCircleX:x y:y radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2293
    "draw a filled circle around x@y"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2294
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2295
    |d|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2296
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2297
    d := 2 * r.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2298
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2299
        fillArcX:(x - r) y:(y - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2300
        width:d height:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2301
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2302
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2303
    "Modified: 8.5.1996 / 08:43:02 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2304
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2305
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2306
fillRectangle:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2307
    "fill a rectangle with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2308
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2309
    gc fillRectangleX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2310
       width:(aRectangle width) height:(aRectangle height)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2311
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2312
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2313
fillRectangleLeft:left top:top right:cornerX bottom:cornerY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2314
    "draw a filled rectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2315
     Notice: the cornerPoint itself is NOT included"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2316
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2317
    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
  2318
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2319
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2320
fillRectangleOrigin:origin corner:corner
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2321
    "draw a filled rectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2322
     Notice: the cornerPoint itself is NOT included"
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
    |top left|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2325
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2326
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2327
    top := origin y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2328
    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
  2329
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2330
    "Created: 13.4.1996 / 20:58:16 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2331
!
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
fillRectangleOrigin:origin extent:extent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2334
    "draw a filled rectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2335
     Notice: the cornerPoint itself is NOT included"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2336
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2337
    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
  2338
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2339
8291
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2340
fillRectangleOrigin:origin width:w height:h
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2341
    "draw a filled rectangle.
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2342
     Notice: the cornerPoint itself is NOT included"
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2343
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2344
    gc fillRectangleX:(origin x) y:(origin y) width:w height:h
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2345
!
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2346
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2347
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
  2348
    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
  2349
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2350
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2351
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2352
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2353
     (v := View new) extent:200@200; openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2354
     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
  2355
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2356
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2357
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2358
invertRectangle:aRectangle
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2359
    "invert a rectangle in the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2361
    self xoring:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2362
	self fillRectangle:aRectangle
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2363
    ]
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2364
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2365
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2366
white
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2367
    "fill the receiver with white"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2368
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  2369
    self fill:self whiteColor
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2370
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2371
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2372
!GraphicsMedium methodsFor:'initialization & release'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2373
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2374
close
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2375
    "same as destroy - for ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2376
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2377
    self destroy
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2378
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2379
    "Created: 2.4.1997 / 19:31:27 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2380
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2381
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2382
destroy
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2383
    "destroy a medium - here the gc is completely destroyed"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2384
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2385
    gc notNil ifTrue:[
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2386
        gc destroy.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2387
    ].
7741
061327740950 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7704
diff changeset
  2388
    "keep device, maybe we want to re-open the view later"
061327740950 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7704
diff changeset
  2389
"/    device := nil.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2390
    realized := false.
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
initGC
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2394
    "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
  2395
     really drawn, none is created.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2396
     This method is sent, when the first drawing happens"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2397
7750
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2398
    ^ gc initGC
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2399
!
721
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
initialize
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2402
    super initialize.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2403
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2404
    width := 0.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2405
    height := 0.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2406
    realized := false.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2407
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2408
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2409
initializeForDevice:aDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2410
    "allocate a GraphicsContext for a device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2411
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2412
    aDevice notNil ifTrue:[
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2413
        device := aDevice.
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2414
        gc := aDevice newGraphicsContextFor:self.
7485
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
  2415
        gc font:self class defaultFont.
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2418
    self initialize.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2419
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2420
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2421
recreate
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2422
    "reacreate a medium after snapIn"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2423
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2424
    gc notNil ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2425
	gc recreate.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2426
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2427
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2428
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2429
releaseGC
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2430
    "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
  2431
     display if you know that you are done with a drawable."
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
    gc notNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  2434
        gc releaseGC.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2435
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2436
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2437
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2438
!GraphicsMedium methodsFor:'misc'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2439
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2440
clippedTo:aRectangle do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2441
    |oldClip|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2442
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2443
    oldClip := gc deviceClippingBoundsOrNil.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2444
    gc clippingBounds:aRectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2445
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2446
    aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2447
	ensure:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2448
	    gc deviceClippingBounds:oldClip
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2449
	]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2450
!
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
flush
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2453
    "send all buffered drawing to the device."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2454
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2455
    gc flush
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
setDevice:aDevice id:aDrawbleId gcId:aGCId
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2459
    "private"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2460
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2461
    device := aDevice.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2462
    gc notNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  2463
        gc setDevice:aDevice id:aDrawbleId gcId:aGCId
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2464
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2465
!
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
setPaint:fgColor on:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2468
    "set the paint and background-paint color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2469
     The bg-paint is used in opaque-draw operations.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2470
     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
  2471
     Used on initialization."
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 setPaint:fgColor on:bgColor
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2474
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2475
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2476
sync
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2477
    "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
  2478
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2479
    gc sync
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2480
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2481
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2482
!GraphicsMedium methodsFor:'printing & storing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2483
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2484
storeOn:aStream
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2485
    "blocked: ascii storeString not possible (recursive - view - subviews - container)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2486
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2487
    self shouldNotImplement.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2488
    "if proceeded from exception..."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2489
    self printOn:aStream.
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
!GraphicsMedium methodsFor:'queries'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2493
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2494
fontAscent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2495
    "answer the ascent of the current font on the current device"
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
    ^ gc fontAscent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2498
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2499
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2500
horizontalIntegerPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2501
    "return the (rounded) number of pixels per millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2502
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2503
    ^ self horizontalPixelPerMillimeter asInteger
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
horizontalPixelPerInch
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2507
    "return the number of horizontal pixels per inch of the display"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2508
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2509
    ^ self horizontalPixelPerMillimeter * 25.4
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2510
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2511
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2512
horizontalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2513
    "return the number of pixels per millimeter (not rounded)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2514
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2515
    ^ gc horizontalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2516
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2517
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2518
horizontalPixelPerMillimeter:millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2519
    "return the number of pixels (not rounded) for millis millimeter"
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
    ^ self horizontalPixelPerMillimeter * millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2522
!
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
resolution
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2525
    "return a point consisting of pixel-per-inch horizontally and vertically."
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
    ^ gc resolution
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2528
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2529
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2530
verticalIntegerPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2531
    "return the (rounded) number of pixels per millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2532
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2533
    ^ self verticalPixelPerMillimeter rounded
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2534
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2535
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2536
verticalPixelPerInch
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2537
    "return the number of vertical pixels per inch of the display"
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
    ^ self verticalPixelPerMillimeter * 25.4
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2540
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2541
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2542
verticalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2543
    "return the number of pixels per millimeter (not rounded)"
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
    ^ gc verticalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2546
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2547
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2548
verticalPixelPerMillimeter:millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2549
    "return the number of pixels (not rounded) for millis millimeter"
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
    ^ self verticalPixelPerMillimeter * millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2552
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2553
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2554
!GraphicsMedium methodsFor:'view creation'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2555
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2556
createBitmapFromArray:data width:width height:height
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2557
    "create a bitmap from data and set the drawableId"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2558
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2559
    gc createBitmapFromArray:data width:width height:height
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2562
createPixmapWidth:w height:h depth:d
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2563
    "create a pixmap and set the drawableId"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2564
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2565
    gc createPixmapWidth:w height:h depth:d
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2568
createRootWindow
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2569
    gc createRootWindowFor:self
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2570
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2571
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2572
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
  2573
    "create a window and set the drawableId"
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
    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
  2576
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2577
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2578
!GraphicsMedium class methodsFor:'documentation'!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2579
7750
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2580
version
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2581
    ^ '$Header$'
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2582
!
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2583
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2584
version_CVS
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2585
    ^ '$Header$'
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2586
! !
6045
0e3df803d990 class: GraphicsMedium
Claus Gittinger <cg@exept.de>
parents: 5321
diff changeset
  2587