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