GraphicsMedium.st
author Claus Gittinger <cg@exept.de>
Tue, 23 Apr 2019 16:30:55 +0200
changeset 8674 e29a561c0fbe
parent 8559 9f7e552ce3f8
child 8690 83fadb9e5567
permissions -rw-r--r--
#FEATURE by cg class: SimpleView added: #isDialogBox
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.
8559
9f7e552ce3f8 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 8388
diff changeset
   834
9f7e552ce3f8 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 8388
diff changeset
   835
    "Modified: / 27-10-2018 / 22:58:48 / Claus Gittinger"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   836
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   837
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   838
function
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   839
    "return the current drawing function"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   840
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   841
    ^ gc function
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   844
function:aSymbol
8298
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   845
    "set the drawing function if it has changed.
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   846
     The argument is one of:
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   847
            #copy,#copyInverted,#xor,#and,#andReverse
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   848
            #andInverted,#or,#orReverse,#orInverted
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   849
            #invert,#clear,#set,#noop,#equiv,#nand
e294c3b46b2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8291
diff changeset
   850
     Notice: not all graphicMedia support all functions"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   851
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   852
    gc function:aSymbol
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   855
gcId
8193
486de380f4e7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8153
diff changeset
   856
    "return the receiver's graphic context id on the device"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   857
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   858
    gc isNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
   859
        ^ nil.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   860
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   861
    ^ gc gcId.
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   864
graphicsContext
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   865
    ^ gc
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   868
graphicsContext:newGc
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   869
    "set the graphics context"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   870
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   871
    gc == newGc ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   872
        ^ self.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   873
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   874
    gc := newGc.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   875
    device := newGc device.
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   878
graphicsDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   879
    "same as #device, for ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   880
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   881
    ^ device
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   882
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   883
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   884
height
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   885
    "return the height of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   886
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   887
    ^ height
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
height:anInteger
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   891
    "set the height of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   892
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
    height := anInteger
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   894
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   895
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   896
id
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   897
    "return the id of the drawable on the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   898
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   899
    ^ self drawableId
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   902
joinStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   903
    "return the current join-style for polygon-drawing.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   904
     possible styles are: #miter, #bevel, #round"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   905
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   906
    ^ gc joinStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   907
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   908
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   909
joinStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   910
    "set the join-style of lines in polygon-drawing;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   911
     possible styles are: #miter, #bevel, #round"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   912
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   913
    gc joinStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   914
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   915
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   916
left
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   917
    "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
   918
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   919
    ^ 0
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   922
leftCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   923
    "return the leftCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   924
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   925
    ^ (self left) @ (self top + (height // 2) - 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   926
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   927
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   928
lineStyle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   929
    "return the current line-drawing-style.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   930
     possible styles are: #solid, #dashed, #doubleDashed,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   931
     #dotted, #dashDot or #dashDotDot."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   932
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   933
    ^ gc lineStyle
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   936
lineStyle:aStyleSymbol
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   937
    "set the line-drawing-style;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   938
     possible styles are: #solid, #dashed, #doubleDashed,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   939
     #dotted, #dashDot or #dashDotDot."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   940
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   941
    gc lineStyle:aStyleSymbol
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   944
lineWidth
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   945
    "return the current drawing linewidth"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   946
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   947
    ^ gc lineWidth
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   950
lineWidth:aNumber
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   951
    "set the line drawing width in pixels"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   952
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   953
    gc lineWidth:aNumber
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   956
mask
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   957
    "return the current drawing mask"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   958
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   959
    ^ gc mask
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   962
mask:aForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   963
    "set the drawing mask"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   964
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   965
    gc mask:aForm
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   968
maskOrigin
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   969
    "return the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   970
     Should be redefined in classes which support it.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   971
     This is an alias for ST-80's #phase"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   972
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   973
    ^ gc maskOrigin
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   976
maskOrigin:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   977
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   978
     Should be redefined in classes which support it.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   979
     This is an alias for ST-80's #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   980
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   981
    gc maskOrigin:aPoint
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   984
maskOriginX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   985
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   986
     Should be redefined in classes which support it.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   987
     This is an alias for ST-80's #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   988
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   989
    self maskOrigin:(x @ y)
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   992
medium
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   993
    "return the destination medium i.e. the underlying graphics device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   994
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   995
    ^ gc graphicsDevice
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   998
noClipByChildren
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
   999
    "drawing shall also be done into subviews"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1000
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1001
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1002
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1003
    self obsoleteMethodWarning:'use #clippedByChildren:false'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1004
    ^ self clippedByChildren:false
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1005
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1006
    "Created: 17.7.1996 / 14:15:54 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1007
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1008
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1009
origin
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1010
    "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
  1011
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1012
    ^ 0 @ 0
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1013
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1014
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1015
paint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1016
    "return the current paint drawing color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1017
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1018
    ^ gc paint
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1021
paint:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1022
    "set the drawing painting color, aColor can be a dithered one"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1023
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1024
    gc paint:aColor
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1027
paint:fgColor on:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1028
    "set the paint and backgroundPaint, used for text and bitmaps.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1029
     Both colors may be dithered colors"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1030
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1031
    gc paint:fgColor on:bgColor
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1034
paint:fgColor on:bgColor function:f
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1035
    "set paint, background-paint and function"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1036
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1037
    self paint:fgColor on:bgColor.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1038
    self function:f
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1039
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1040
    "Modified: 16.5.1996 / 15:36:35 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1041
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1042
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1043
realized
2954
0182e5ac0247 added #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2947
diff changeset
  1044
    "return true, if the receiver is realized.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1045
     The receiver may still be unmapped, if the container is unrealized.
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1046
     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
  1047
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1048
    ^ realized
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1049
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1050
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1051
reallyRealized
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1052
    "return true, if the receiver is realized and all containers
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1053
     are realized."
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1054
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1055
    ^ self realized
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1056
2955
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1057
!
8b8000553767 renamed #fullyRealized
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1058
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1059
rightCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1060
    "return the leftCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1061
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1062
    ^ (self left + width - 1) @ (self top + (height // 2) - 1)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1063
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1064
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1065
setClippingBounds:aRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1066
    gc setClippingBounds:aRectangleOrNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1067
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1068
7704
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1069
setDevice:aDevice
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1070
    "set the device"
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1071
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1072
    device := aDevice.
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1073
    gc setDevice:aDevice
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1074
!
491e7a86f2b9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7671
diff changeset
  1075
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1076
setGraphicsExposures:aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1077
    "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
  1078
     of graphics exposures"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1079
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1080
    gc setGraphicsExposures:aBoolean
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1083
setMaskOrigin:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1084
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1085
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1086
     OBSOLETE: use #maskOrigin: or #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1087
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1088
    self obsoleteMethodWarning:'use #maskOrigin:'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1089
    ^ self maskOriginX:aPoint x y:aPoint y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1090
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1091
    "Modified: / 26.1.1998 / 18:54:14 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1094
setMaskOriginX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1095
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1096
    "set the origin within the mask (used to draw with patterns).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1097
     OBSOLETE: use #maskOriginX:y: or #phase:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1098
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1099
    self obsoleteMethodWarning:'use #maskOriginX:y:'.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1100
    ^ self maskOriginX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1101
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1102
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
setWidth:w height:h
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
    "set both width and height - not to be redefined"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
    width := w.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
    height := h
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1110
top
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
    "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
  1112
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
    ^ 0
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
topCenter
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1117
    "return the topCenter point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1118
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1119
    ^ (self left + (width//2) - 1) @ (self top)
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1122
topRight
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1123
    "return the topRight point"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1124
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1125
    ^ (self left + width - 1) @ (self top)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1126
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1127
2030
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1128
viewBackground
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1129
    "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
  1130
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1131
    ^ self backgroundPaint
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1134
viewOrigin
8388
4f61000dd8ea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  1135
    "return the drawable's visible origin (for scrolling)"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1136
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1137
    ^ 0@0
8388
4f61000dd8ea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  1138
4f61000dd8ea #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  1139
    "Modified (comment): / 14-06-2018 / 10:16:52 / Claus Gittinger"
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1142
whiteColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1143
    gc isNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1144
        ^ Color white.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1145
    ].
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1146
    ^ gc whiteColor
2030
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1147
!
5b29d7626887 added #viewBackground for protocol compatibility with real views.
ca
parents: 741
diff changeset
  1148
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1149
width
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1150
    "return the width of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1151
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1152
    ^ width
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
width:anInteger
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1156
    "set the width of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1157
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1158
    width := anInteger
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
width:w height:h
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
    "set both width and height of the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1163
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1164
    width := w.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1165
    height := h
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1166
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1167
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1168
!GraphicsMedium methodsFor:'accessing-internals'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1169
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1170
background
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1171
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1172
    "return the current background drawing color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1173
     OBSOLETE: use #paint: / #backgroundPaint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1174
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1175
    ^ gc background
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1176
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1177
    "Modified: 12.5.1996 / 22:28:09 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1180
background:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1181
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1182
    "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
  1183
     OBSOLETE: this method will vanish; use #paint: / #backgroundPaint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1184
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1185
    gc background:aColor
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1188
foreground
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1189
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1190
    "return the current foreground drawing color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1191
     OBSOLETE: use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1192
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1193
    ^ gc foreground
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1196
foreground:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1197
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1198
    "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
  1199
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1200
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1201
    gc foreground:aColor
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1204
foreground:fgColor background:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1205
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1206
    "set both internal foreground and internal background colors
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1207
     - these must be real colors.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1208
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1209
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1210
    gc foreground:fgColor background:bgColor
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1213
foreground:fgColor background:bgColor function:fun
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1214
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1215
    "set foreground, background colors and function.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1216
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1217
7464
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
  1218
    gc foreground:fgColor background:bgColor.
694f640cee34 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7461
diff changeset
  1219
    gc function:fun
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1220
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1221
    "Modified: 12.5.1996 / 22:28:34 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1224
foreground:aColor function:fun
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1225
    <resource: #obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1226
    "set the foreground color and function for drawing.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1227
     OBSOLETE: this method will vanish; use #paint: / #paint:on:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1228
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1229
    gc foreground:aColor function:fun
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1232
setRealized:aBoolean
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1233
    "low level special interface to manipulate the realized state.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1234
     Non-public interface, only to be used by experts.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1235
     (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
  1236
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1237
    realized := aBoolean
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1240
!GraphicsMedium methodsFor:'accessing-transformation'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1241
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1242
scale
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1243
    "return the scale factor (as point) of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1244
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1245
    ^ gc scale
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1248
scale:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1249
    "set the scale factor of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1250
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1251
    ^ gc scale:aPoint
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1254
transformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1255
    "return the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1256
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1257
    ^ gc transformation
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1260
transformation:aTransformation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1261
    "set the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1262
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1263
    ^ gc transformation:aTransformation
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1266
translateBy:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1267
    "add to the translation offset of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1268
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1269
    ^ gc translateBy:aPoint
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1272
translation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1273
    "return the translation factor (as point) of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1274
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1275
    ^ gc translation
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1276
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1277
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1278
translation:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1279
    "set the translation offset of the transformation"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1280
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1281
    ^ gc translation:aPoint
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1284
!GraphicsMedium methodsFor:'basic drawing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1285
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1286
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
  1287
    "draw an arc in a box
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1288
     - this could be recoded to draw using displayLine"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1289
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1290
    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
  1291
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1292
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1293
displayDottedRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1294
    "draw a dotted-line rectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1295
     A general implementation is found here; deviceGC's
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1296
     may reimplement this if directly supported by the device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1297
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1298
    gc displayDottedRectangleX:x y:y width:w height:h
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1301
displayHorizontalWavelineFromX:x0 y:y0 toX:x1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1302
    "draw a horizontal wave-line from x0/y0 to x1/y0"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1303
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1304
    gc displayHorizontalWavelineFromX:x0 y:y0 toX:x1
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1307
displayLineFromX:x0 y:y0 toX:x1 y:y1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1308
    "draw a line from x0/y0 to x1/y1"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1309
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1310
    gc displayLineFromX:x0 y:y0 toX:x1 y:y1
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1313
displayOpaqueForm:aForm x:x y:y
8153
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1314
    "draw a form at x/y; 
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1315
     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
  1316
     drawn in current fg, 0's in current bg color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1317
     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
  1318
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1319
    gc displayOpaqueForm:aForm x:x y:y
8153
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1320
45bf33d4e1a3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7888
diff changeset
  1321
    "Modified (comment): / 31-08-2017 / 19:26:34 / cg"
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1324
displayOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1325
    "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
  1326
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1327
    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
  1328
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1329
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1330
displayPolygon:aPolygon
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1331
    "draw a polygon
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1332
     - this could be recoded to draw using displayLine"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1333
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1334
    gc displayPolygon:aPolygon
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1337
displayRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1338
    "draw a rectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1339
     - this could be recoded to draw using displayLine"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1340
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1341
    gc displayRectangleX:x y:y width:w height:h
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1344
displayString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1345
    "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
  1346
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1347
    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
  1348
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1349
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1350
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
  1351
    "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
  1352
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1353
    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
  1354
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1355
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1356
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
  1357
    "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
  1358
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1359
    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
  1360
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1361
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1362
!GraphicsMedium methodsFor:'basic filling'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1363
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1364
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
  1365
    "fill an arc with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1366
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1367
    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
  1368
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1369
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1370
fillPolygon:points
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1371
    "fill a polygon with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1372
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1373
    gc fillPolygon:points
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1376
fillRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1377
    "fill a rectangle with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1378
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1379
    gc fillRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1380
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1381
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1382
fillRectangleX:x y:y width:w height:h color:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1383
    "fill a rectangle with given color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1384
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1385
    gc fillRectangleX:x y:y width:w height:h color:aColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1386
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1387
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1388
!GraphicsMedium methodsFor:'bit blitting'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1389
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1390
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
  1391
    "copy bits from a smalltalk byteArray.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1392
     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
  1393
     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
  1394
     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
  1395
     method to whatever the device needs."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1396
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1397
    gc 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
  1398
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1399
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1400
copyFrom:aGC toX:dstX y:dstY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1401
    "copy from a drawable - maybe self"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1402
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1403
    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
  1404
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1405
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1406
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
  1407
    "copy from a drawable - maybe self"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1408
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1409
    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
  1410
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1411
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1412
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
  1413
    "copy from aDrawable into the receiver;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1414
     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
  1415
     All coordinates are in device coordinates.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1416
     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
  1417
     - otherwise, it returns when the scroll operation is finished.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1418
     (not all devices care for this).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1419
     If the receiver is a pixmap, the call always returns immediately."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1420
7748
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1421
    |deviceDrawable mustWait sourceDepth|
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1422
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1423
    ((aDrawable graphicsDevice ~~ device)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1424
     or:[aDrawable isImage]) ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1425
        deviceDrawable := aDrawable asFormOn:device.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1426
    ] ifFalse:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1427
        deviceDrawable := aDrawable
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1428
    ].
7745
c8a5b8bca250 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7741
diff changeset
  1429
    sourceDepth := deviceDrawable depth.
7748
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1430
    mustWait := async not 
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1431
                    and:[deviceDrawable isView 
21bafd8d396e #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 7745
diff changeset
  1432
                    and:[(sourceDepth ~~ 1) or:[device depth == 1]]].
7467
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  1433
    mustWait ifTrue:[
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  1434
        mustWait := self catchExpose.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1435
    ].
7745
c8a5b8bca250 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7741
diff changeset
  1436
    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
  1437
    mustWait ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1438
        self waitForExpose
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1442
copyFrom:aGC x:dstX y:dstY width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1443
    "copy from a drawable - maybe self"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1444
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1445
    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
  1446
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1447
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1448
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
  1449
    "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
  1450
     background, while 1's are drawn with foreground color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1451
     The depth of aDrawable must (should) be 1.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1452
     The drawable must have been allocated on the same device.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1453
     All coordinates are in device coordinates."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1454
7458
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1455
    |deviceDrawable|
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1456
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1457
    ((aDrawable graphicsDevice ~~ device)
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1458
    or:[aDrawable isImage]) ifTrue:[
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1459
        deviceDrawable := aDrawable asFormOn:device.
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1460
    ] ifFalse:[
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1461
        deviceDrawable := aDrawable
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
9391a17dc669 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7447
diff changeset
  1464
    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
  1465
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1466
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1467
!GraphicsMedium methodsFor:'copying'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1468
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1469
postCopy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1470
    "this may not be enough to allow copying of views ..."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1471
7843
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1472
    <modifier: #super> "must be called if redefined"
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1473
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1474
    "/ super postCopy.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1475
    realized := false.
7843
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1476
c6576fab3e80 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7800
diff changeset
  1477
    "Modified: / 08-02-2017 / 00:19:33 / cg"
4403
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1478
!
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1479
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1480
postDeepCopy
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1481
    super postDeepCopy.
3342601d3fed +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1482
    realized := false.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1483
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1484
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1485
!GraphicsMedium methodsFor:'drawing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1486
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1487
display:someObject at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1488
    "draw someObject - this must understand the #displayOn:at: message"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1489
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1490
    someObject displayOn:self at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1491
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1492
    "Created: 28.5.1996 / 14:22:57 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1495
displayArcIn:aRectangle from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1496
    "draw an arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1497
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1498
    gc displayArcX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1499
       width:(aRectangle width) height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1500
       from:startAngle angle:angle
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1503
displayArcOrigin:origin corner:corner from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1504
    "draw an arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1505
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1506
    |left top right bot|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1507
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1508
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1509
    top := origin y.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1510
    right := corner x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1511
    bot := corner y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1512
    gc displayArcX:left y:top
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1513
       width:(right - left + 1) height:(bot - top + 1)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1514
       from:startAngle angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1515
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1516
    "Modified: 8.5.1996 / 08:35:25 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1519
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
  1520
    "draw an arc; apply transformation if nonNil"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1521
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1522
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1523
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1524
    self obsoleteMethodWarning:'use #displayArcX:y:width:height:from:angle:'.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1525
    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
  1526
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1527
    "Modified: 8.5.1996 / 08:46:56 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1530
displayCircle:aPoint radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1531
    "draw a circle around a center point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1532
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1533
    gc displayCircleX:(aPoint x) y:(aPoint y) radius:r
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1536
displayCircleIn:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1537
    "draw a circle in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1538
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1539
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1540
        displayArcX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1541
        width:(aRectangle width) height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1542
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1543
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1544
    "Modified: 8.5.1996 / 08:35:40 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1547
displayCircleX:x y:y radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1548
    "draw a circle around a center point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1549
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1550
    |d|
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1551
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1552
    d := 2 * r.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1553
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1554
        displayArcX:(x - r) y:(y - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1555
        width:d height:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1556
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1557
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1558
    "Modified: 8.5.1996 / 08:36:03 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1561
displayForm:aFormOrImage
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1562
    "draw a form (or image) at the origin"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1563
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1564
    gc displayForm:aFormOrImage x:0 y:0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1565
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1566
    "Modified: / 24.4.1997 / 16:00:11 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1567
    "Created: / 9.11.1997 / 00:50:52 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1570
displayForm:aFormOrImage at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1571
    "draw a form (or image)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1572
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1573
    gc displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1574
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1575
    "Modified: 24.4.1997 / 16:00:11 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1578
displayForm:formToDraw x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1579
    "draw a form or image non opaque;
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1580
     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
  1581
     current paint-color, leaving pixels with 0-bits unchanged
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1582
     (i.e. only 1-bits are drawn from the form).
7883
94bb868d80e6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7861
diff changeset
  1583
     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
  1584
     settings are ignored and the form is drawn as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1585
     Care must be taken, that the paint color is correctly allocated
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1586
     (by sending #on: to the color) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1587
     Using functions other than #copy only makes sense if you are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1588
     certain, that the colors are real colors (actually, only for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1589
     noColor or allColor)."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1590
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1591
    gc displayForm:formToDraw x:x y:y
7883
94bb868d80e6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7861
diff changeset
  1592
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1593
    "Modified (comment): / 13-02-2017 / 20:19:56 / cg"
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1596
displayForm:aFormOrImage x:x y:y opaque:opaque
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1597
    "draw a form (or image) at x/y;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1598
     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
  1599
     drawn in current paint color, 0's are ignored.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1600
     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
  1601
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1602
    opaque ifTrue:[
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1603
        gc displayOpaqueForm:aFormOrImage x:x y:y
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1604
    ] ifFalse:[
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1605
        gc displayForm:aFormOrImage x:x y:y
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1609
displayImage:aFormOrImage
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1610
    "draw an image (or form).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1611
     Provided for ST-80 compatibilty;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1612
     in ST/X, images are also handled by #displayForm:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1613
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1614
    gc displayForm:aFormOrImage x:0 y:0
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1617
displayImage:aFormOrImage at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1618
    "draw an image (or form).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1619
     Provided for ST-80 compatibilty;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1620
     in ST/X, images are also handled by #displayForm:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1621
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1622
    gc displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1623
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1624
    "Modified: 24.4.1997 / 16:02:43 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1627
displayImage:aFormOrImage x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1628
    "draw an image (or form).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1629
     Provided for ST-80 compatibilty;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1630
     in ST/X, images are also handled by #displayForm:"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1631
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1632
    gc displayForm:aFormOrImage x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1633
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1634
    "Created: 24.4.1997 / 16:03:03 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1637
displayLineFrom:point1 to:point2
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1638
    "draw a line"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1639
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1640
    gc displayLineFromX:(point1 x) y:(point1 y)
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1641
                    toX:(point2 x) y:(point2 y)
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1644
displayLineFromX:xStart y:yStart toX:xEnd y:yEnd brush:aForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1645
    "draw a line using a brush.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1646
     Here, a slow fallback is used, drawing into a
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1647
     temporary bitmap first, which is then displayed"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1648
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1649
    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
  1650
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1651
    "Modified: 1.4.1997 / 21:29:06 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1654
displayOpaqueString:aString at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1655
    "draw a string with both fg and bg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1656
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1657
    gc displayOpaqueString:aString x:(aPoint x) y:(aPoint y)
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1660
displayOpaqueString:aString from:start to:stop at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1661
    "draw part of a string - drawing both fg and bg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1662
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1663
    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
  1664
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1665
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1666
displayOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1667
    "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
  1668
     background pixels in bgPaint color. If the transformation involves scaling,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1669
     the fonts point-size is scaled as appropriate.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1670
     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
  1671
     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
  1672
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1673
    gc displayOpaqueString:aString x:x y:y
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1676
displayOpaqueString:aString x:x y:y angle:drawAngle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1677
    "draw a string along a (possibly non-horizontal) line,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1678
     drawing both fg and bg pixels.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1679
     The angle is in degrees, clock-wise, starting with 0 for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1680
     a horizontal draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1681
     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
  1682
     which is rotated and finally drawn as usual.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1683
     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
  1684
             operation - not to be used with cillions of strings ..."
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1685
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1686
    gc displayString:aString x:x y:y angle:drawAngle opaque:true
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
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1689
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1690
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1691
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1692
     v extent:300@200.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1693
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1694
     0 to:360 by:45 do:[:a |
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1695
         v paint:Color black on:Color red.
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1696
         v displayOpaqueString:'hello world' x:100 y:100 angle:a.
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1700
    "in contrast to non-opaque draw:
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1701
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1702
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1703
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1704
     v extent:300@200.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1705
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1706
     0 to:360 by:45 do:[:a |
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1707
         v paint:Color black on:Color red.
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1708
         v displayString:'hello world' x:100 y:100 angle:a.
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1712
    "Modified: 23.4.1997 / 17:50:23 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1715
displayPoint:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1716
    "draw a pixel"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1717
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1718
    gc displayPointX:(aPoint x) y:(aPoint y)
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1721
displayPointX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1722
    "draw a point (with current paint-color); apply transformation if nonNil"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1723
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1724
    gc displayPointX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1725
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1726
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1727
displayRectangle:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1728
    "draw a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1729
7791
66d7e8e6d807 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7760
diff changeset
  1730
    gc displayRectangleX:(aRectangle left) y:(aRectangle top)
66d7e8e6d807 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7760
diff changeset
  1731
       width:(aRectangle width) height:(aRectangle height)
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1734
displayRectangleOrigin:origin corner:corner
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1735
    "draw a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1736
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1737
    |top left|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1738
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1739
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1740
    top := origin y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1741
    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
  1742
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1743
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1744
displayRectangleOrigin:origin extent:extent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1745
    "draw a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1746
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1747
    gc displayRectangleX:(origin x) y:(origin y)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1748
       width:(extent x) height:(extent y)
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1751
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
  1752
    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
  1753
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1754
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1755
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1756
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1757
     (v := View new) extent:200@200; openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1758
     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
  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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1762
displayString:aString at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1763
    "draw a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1764
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1765
    gc displayString:aString x:aPoint x y:aPoint y
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1768
displayString:aString centeredAt:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1769
    "draw a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1770
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1771
    gc displayString:aString centeredAtX:aPoint x y:aPoint y
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1774
displayString:aString centeredAtX:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1775
    "draw a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1776
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1777
    |w h|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1778
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1779
    w := aString widthOn:self.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1780
    h := aString heightOn:self.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1781
    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
  1782
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1783
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1784
displayString:aString from:start to:stop at:aPoint
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1785
    "draw part of a string - drawing fg only"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1786
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1787
    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
  1788
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1789
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1790
displayString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1791
    "draw a string at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1792
     draw foreground-pixels only (in current paint-color),
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1793
     leaving background as-is. If the transformation involves scaling,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1794
     the fonts point-size is scaled as appropriate."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1795
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1796
    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
  1797
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1798
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1799
displayString:aString x:x y:y angle:drawAngle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1800
    "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
  1801
     The angle is in degrees, clock-wise, starting with 0 for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1802
     a horizontal draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1803
     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
  1804
     which is rotated and finally drawn as usual.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1805
     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
  1806
             operation - not to be used with cillions of strings ..."
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1807
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1808
    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
  1809
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1810
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1811
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1812
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1813
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1814
     v extent:300@200.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1815
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1816
     0 to:360 by:90 do:[:a |
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1817
         v paint:Color black.
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1818
         v displayString:'hello world' x:100 y:100 angle:a.
7416
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
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1822
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1823
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1824
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1825
     v extent:400@400.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1826
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1827
     0 to:360 by:5 do:[:a |
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1828
         v paint:Color black.
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1829
         v displayString:'.........hello' x:200 y:200 angle:a.
7416
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
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1833
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1834
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1835
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1836
     v extent:200@100.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1837
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1838
     v displayString:' hello' x:90 y:50 angle:0.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1839
     v displayString:' hello' x:90 y:50 angle:45.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1840
     v displayString:' hello' x:90 y:50 angle:90.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1841
     v displayString:' hello' x:90 y:50 angle:180.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1842
     v displayString:' hello' x:90 y:50 angle:270.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1843
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1844
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1845
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1846
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1847
     v := View new.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1848
     v extent:200@100.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1849
     v openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1850
     v displayString:'hello' x:50 y:50 angle:0.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1851
     v displayString:'hello' x:50 y:50 angle:45.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1852
     v displayString:'hello' x:50 y:50 angle:90.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1853
     v displayString:'hello' x:50 y:50 angle:135.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1854
     v displayString:'hello' x:50 y:50 angle:180.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1855
     v displayString:'hello' x:50 y:50 angle:225.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1856
     v displayString:'hello' x:50 y:50 angle:270.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1857
     v displayString:'hello' x:50 y:50 angle:315.
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1860
    "Modified: 24.4.1997 / 12:51:25 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1863
displayString:aString x:x y:y angle:drawAngle opaque:opaque
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1864
    "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
  1865
     The angle is in degrees, clock-wise, starting with 0 for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1866
     a horizontal draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1867
     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
  1868
     which is rotated and finally drawn as usual.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1869
     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
  1870
             operation - not to be used with cillions of strings ...
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1871
     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
  1872
             this can (currently) only be done opaque"
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1873
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1874
    gc displayString:aString x:x y:y angle:drawAngle opaque:opaque
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1877
displayUnscaledForm:formToDraw x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1878
    "draw a form or image non opaque and unscaled;
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1879
     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
  1880
     current paint-color, leaving pixels with 0-bits unchanged
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1881
     (i.e. only 1-bits are drawn from the form).
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1882
     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
  1883
     settings are ignored and the form is drawn as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1884
     Care must be taken, that the paint color is correctly allocated
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1885
     (by sending #on: to the color) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1886
     Using functions other than #copy only makes sense if you are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1887
     certain, that the colors are real colors (actually, only for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1888
     noColor or allColor).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1889
     The origins coordinate is transformed, but the image itself is unscaled."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1890
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1891
    gc displayUnscaledForm:formToDraw x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1892
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1893
    "Modified (comment): / 13-02-2017 / 20:20:09 / cg"
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1896
displayUnscaledOpaqueForm:formToDraw x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1897
    "draw a form or image opaque and unscaled;
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1898
     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
  1899
     current paint-color, 0 bits in background color.
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1900
     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
  1901
     settings are ignored and the form is drawn as-is (opaque).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1902
     The origins coordinate is transformed, but the image itself is unscaled."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1903
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1904
    gc displayUnscaledOpaqueForm:formToDraw x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1905
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1906
    "Modified (comment): / 13-02-2017 / 20:20:15 / cg"
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1909
displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1910
    "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
  1911
     Draw foreground pixels in paint-color, background pixels in bgPaint color."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1912
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1913
    gc displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1916
displayUnscaledOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1917
    "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
  1918
     Draw foreground pixels in paint-color, background pixels in bgPaint color."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1919
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1920
    gc displayUnscaledOpaqueString:aString x:x y:y
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1923
displayUnscaledString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1924
    "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
  1925
     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
  1926
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1927
    gc displayUnscaledString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1928
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1929
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1930
displayUnscaledString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1931
    "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
  1932
     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
  1933
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1934
    gc displayUnscaledString:aString x:x y:y
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1937
!GraphicsMedium methodsFor:'drawing in device coordinates'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1938
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1939
displayDeviceForm:aForm x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1940
    "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
  1941
     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
  1942
     current paint-color, leaving pixels with 0-bits unchanged
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1943
     (i.e. only 1-bits are drawn from the form).
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1944
     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
  1945
     settings are ignored and the form is drawn as-is;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1946
     however, the mask is applied if present.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1947
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1948
     The form should must have been allocated on the same device,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1949
     otherwise its converted here, which slows down the draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1950
     No transformation or scaling is done.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1951
     Care must be taken, that the paint color is correctly allocated
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1952
     (by sending #on: to the color) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1953
     Using functions other than #copy only makes sense if you are
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1954
     certain, that the colors are real colors (actually, only for
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1955
     noColor or allColor)."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1956
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1957
    gc displayDeviceForm:aForm x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1958
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1959
    "Modified (comment): / 13-02-2017 / 20:19:47 / cg"
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1962
displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1963
    "draw a line in device coordinates"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1964
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1965
    gc displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1968
displayDeviceOpaqueForm:aForm x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1969
    "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
  1970
     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
  1971
     current paint-color and 0-bits in the bgPaint color.
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1972
     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
  1973
     settings are ignored and the form drawn as-is.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1974
     Any mask is ignored.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1975
     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
  1976
     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
  1977
     to the colors) before doing so.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1978
     The form should have been allocated on the same device; otherwise,
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1979
     its converted here, which slows down the draw.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1980
     Drawing is in device coordinates; no scaling is done."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1981
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1982
    gc displayDeviceOpaqueForm:aForm x:x y:y
7888
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1983
2618ac4978d3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7883
diff changeset
  1984
    "Modified (comment): / 13-02-2017 / 20:19:52 / cg"
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1987
displayDeviceOpaqueString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1988
    "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
  1989
     paint-color and background pixels in bgPaint-color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1990
     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
  1991
     the case where paint and/or bgPaint are dithered colors.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1992
     No translation or scaling is done."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1993
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  1994
    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
  1995
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1996
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1997
displayDeviceOpaqueString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  1998
    "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
  1999
     paint-color and background pixels in bgPaint-color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2000
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2001
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2002
    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
  2003
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2004
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2005
displayDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2006
    "draw a rectangle in device coordinates"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2007
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2008
    gc displayDeviceRectangleX:x y:y width:w height:h
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2011
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
  2012
    "draw a substring at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2013
     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
  2014
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2015
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2016
    gc 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
  2017
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2018
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2019
displayDeviceString:aString from:index1 to:index2 x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2020
    "draw a substring at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2021
     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
  2022
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2023
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2024
    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
  2025
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2026
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2027
displayDeviceString:aString x:x y:y
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2028
    "draw a string at the coordinate x/y -
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2029
     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
  2030
     No translation or scaling is done"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2031
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2032
    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
  2033
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2034
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2035
fillDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2036
    "fill a rectangle with current paint color (device coordinates)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2037
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2038
    gc fillDeviceRectangleX:x y:y width:w height:h
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2041
!GraphicsMedium methodsFor:'edge drawing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2042
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2043
drawEdgesForX:x y:y width:w height:h level:l
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2044
    "draw 3D edges into a rectangle"
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2045
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2046
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2047
        drawEdgesForX:x y:y width:w height:h level:l
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2048
        shadow:self blackColor light:self whiteColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2049
        halfShadow:nil halfLight:nil
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2050
        style:nil
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2051
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2052
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2053
drawEdgesForX:x y:y width:w height:h level:l
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2054
                shadow:shadowColor light:lightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2055
                halfShadow:halfShadowColor halfLight:halfLightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2056
                style:edgeStyle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2057
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2058
    "draw 3D edges into a rectangle"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2059
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2060
    gc drawEdgesForX:x y:y width:w height:h level:l
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2061
       shadow:shadowColor light:lightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2062
       halfShadow:halfShadowColor halfLight:halfLightColor
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2063
       style:edgeStyle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2064
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2065
    "Modified: / 24.8.1998 / 18:23:02 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2068
edgeDrawn:whichOne
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2069
    "a redefinable hook for views which like to draw
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2070
     over their edges (some checkToggles do).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2071
     Nothing done here."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2072
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2073
    "Created: 7.3.1997 / 17:59:07 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2076
!GraphicsMedium methodsFor:'evaluating in another context'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2077
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2078
reverseDo:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2079
    "evaluate aBlock with foreground and background interchanged.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2080
     This can be reimplemented here in a faster way."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2081
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2082
    gc reverseDo:aBlock
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2085
withBackground:fgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2086
    "evaluate aBlock with changed background."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2087
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2088
    gc withBackground:fgColor do:aBlock
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2091
withForeground:fgColor background:bgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2092
    "evaluate aBlock with changed foreground and background."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2093
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2094
    gc withForeground:fgColor background:bgColor do:aBlock
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2097
withForeground:fgColor background:bgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2098
    "evaluate aBlock with foreground, background and function"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2099
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2100
    gc withForeground:fgColor background:bgColor function:aFunction do:aBlock
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2103
withForeground:fgColor background:bgColor mask:aMask do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2104
    "evaluate aBlock with foreground, background and mask"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2105
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2106
    gc withForeground:fgColor background:bgColor mask:aMask do:aBlock
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2109
withForeground:fgColor do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2110
    "evaluate aBlock with changed foreground."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2111
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2112
    gc withForeground:fgColor do:aBlock
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2115
withForeground:fgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2116
    "evaluate aBlock with changed foreground and function."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2117
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2118
    gc withForeground:fgColor function:aFunction do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2119
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2120
7760
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2121
withPaint:aColor do:aBlock
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2122
    "evaluate aBlock with changed paint color."
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2123
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2124
    gc withPaint:aColor do:aBlock
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2125
!
4e4cae3921ea #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7750
diff changeset
  2126
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2127
xoring:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2128
    "evaluate aBlock with function xoring"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2129
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2130
    gc xoring:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2131
! !
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2132
7467
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2133
!GraphicsMedium methodsFor:'event handling'!
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2134
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2135
catchExpose
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2136
    "expose event handling is only required for views."
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2137
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2138
    ^ false.
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
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2141
waitForExpose
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2142
    "expose event handling is only required for views."
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2143
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2144
    ^ self.
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2145
! !
b28e8bfab43d #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7464
diff changeset
  2146
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2147
!GraphicsMedium methodsFor:'filling'!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2148
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2149
black
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2150
    "fill the receiver with black"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2151
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2152
    self fill:self blackColor
721
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2155
clear
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2156
    "clear the receiver with background"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2157
4068
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2158
    self clearView.
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2159
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2160
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2161
clearDeviceRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2162
    "clear a rectangular area to background"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2163
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2164
    gc clearDeviceRectangleX:x y:y width:w height:h.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2165
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2166
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2167
clearInside
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2168
    "clear the receiver with background - ST-80 compatibility"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2169
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2170
    self clear
721
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2173
clearRectangle:aRectangle
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2174
    "clear the rectangular area in the receiver to background"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2175
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2176
    self clearRectangleX:(aRectangle left)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2177
		       y:(aRectangle top)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2178
		   width:(aRectangle width)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2179
		  height:(aRectangle height)
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2180
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2181
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2182
clearRectangleX:x y:y width:w height:h
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2183
    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
  2184
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2185
4068
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2186
clearView
8268
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2187
    "clear the receiver with its view background"
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2188
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2189
    "/ 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
  2190
    "/ is redefined to use viewBackground instead of background-drawing color.
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2191
    "/ consider this a kludge.
42d68d6aeab2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2192
    self clearDeviceRectangleX:0 y:0 width:width height:height
4068
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2193
!
d5b2636b048b clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
  2194
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2195
fill:something
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2196
    "fill the receiver with something;
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2197
     something may be a Form, Color or colorIndex"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2198
7794
1ccbf79e1506 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7791
diff changeset
  2199
    gc fillRectangle:(self boundingBox) color:something
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2200
!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2201
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2202
fillArc:origin radius:r from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2203
    "draw a filled arc around a point"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2204
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2205
    |d|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2206
    d := 2 * r.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2207
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2208
        fillArcX:(origin x - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2209
               y:(origin y - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2210
           width:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2211
          height:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2212
            from:startAngle
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2213
           angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2214
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2215
    "Modified: 8.5.1996 / 08:41:54 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2218
fillArcIn:aRectangle from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2219
    "draw a filled arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2220
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2221
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2222
        fillArcX:(aRectangle left)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2223
               y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2224
           width:(aRectangle width)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2225
          height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2226
            from:startAngle
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2227
           angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2228
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2229
    "Created: 13.4.1996 / 20:56:03 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2230
    "Modified: 8.5.1996 / 08:42:13 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2233
fillArcOrigin:origin corner:corner from:startAngle angle:angle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2234
    "draw a filled arc in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2235
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2236
    |left top right bot|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2237
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2238
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2239
    top := origin y.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2240
    right := corner x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2241
    bot := corner y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2242
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2243
        fillArcX:left
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2244
        y:top
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2245
        width:(right - left + 1)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2246
        height:(bot - top + 1)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2247
        from:startAngle
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2248
        angle:angle
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2249
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2250
    "Created: 13.4.1996 / 20:56:56 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2251
    "Modified: 8.5.1996 / 08:42:23 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2254
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
  2255
    "draw a filled arc; apply transformation if nonNil"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2256
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2257
    <resource:#obsolete>
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2258
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2259
    self obsoleteMethodWarning:'use #fillArcX:y:width:height:from:angle:'.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2260
    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
  2261
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2262
    "Modified: 8.5.1996 / 08:47:52 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2265
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
  2266
    "draw a filled arc in a box, given startAngle and endAngle."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2267
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2268
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2269
        fillArcX:x y:y
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2270
        width:w height:h
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2271
        from:startAngle angle:(endAngle - startAngle)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2272
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2273
    "Created: 8.5.1996 / 08:52:41 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2276
fillCircle:aPoint radius:aNumber
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2277
    "draw a filled circle around aPoint"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2278
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2279
    gc fillCircleX:(aPoint x) y:(aPoint y) radius:aNumber
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2282
fillCircleIn:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2283
    "draw a filled circle in a box"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2284
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2285
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2286
        fillArcX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2287
        width:(aRectangle width) height:(aRectangle height)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2288
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2289
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2290
    "Created: 13.4.1996 / 20:57:41 / cg"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2291
    "Modified: 8.5.1996 / 08:42:38 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2294
fillCircleX:x y:y radius:r
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2295
    "draw a filled circle around x@y"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2296
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2297
    |d|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2298
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2299
    d := 2 * r.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2300
    gc
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2301
        fillArcX:(x - r) y:(y - r)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2302
        width:d height:d
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2303
        from:0 angle:360
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2304
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2305
    "Modified: 8.5.1996 / 08:43:02 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2308
fillRectangle:aRectangle
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2309
    "fill a rectangle with current paint color"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2310
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2311
    gc fillRectangleX:(aRectangle left) y:(aRectangle top)
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2312
       width:(aRectangle width) height:(aRectangle height)
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2315
fillRectangleLeft:left top:top right:cornerX bottom:cornerY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2316
    "draw a filled rectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2317
     Notice: the cornerPoint itself is NOT included"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2318
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2319
    gc fillRectangleX:left y:top width:(cornerX - left) height:(cornerY - top)
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2322
fillRectangleOrigin:origin corner:corner
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2323
    "draw a filled rectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2324
     Notice: the cornerPoint itself is NOT included"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2325
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2326
    |top left|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2327
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2328
    left := origin x.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2329
    top := origin y.
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2330
    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
  2331
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2332
    "Created: 13.4.1996 / 20:58:16 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2335
fillRectangleOrigin:origin extent:extent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2336
    "draw a filled rectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2337
     Notice: the cornerPoint itself is NOT included"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2338
8267
93d0af7d74c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 8193
diff changeset
  2339
    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
  2340
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2341
8291
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2342
fillRectangleOrigin:origin width:w height:h
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2343
    "draw a filled rectangle.
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2344
     Notice: the cornerPoint itself is NOT included"
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2345
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2346
    gc fillRectangleX:(origin x) y:(origin y) width:w height:h
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2347
!
909a69b193d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
  2348
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2349
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
  2350
    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
  2351
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2352
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2353
     |v|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2354
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2355
     (v := View new) extent:200@200; openAndWait.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2356
     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
  2357
    "
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2358
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2359
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2360
invertRectangle:aRectangle
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2361
    "invert a rectangle in the receiver"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2362
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2363
    self xoring:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2364
	self fillRectangle:aRectangle
721
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
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2368
white
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2369
    "fill the receiver with white"
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2370
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  2371
    self fill:self whiteColor
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2372
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2373
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2374
!GraphicsMedium methodsFor:'initialization & release'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2375
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2376
close
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2377
    "same as destroy - for ST-80 compatibility"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2378
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2379
    self destroy
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2380
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2381
    "Created: 2.4.1997 / 19:31:27 / cg"
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2384
destroy
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2385
    "destroy a medium - here the gc is completely destroyed"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2386
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2387
    gc notNil ifTrue:[
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2388
        gc destroy.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2389
    ].
7741
061327740950 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7704
diff changeset
  2390
    "keep device, maybe we want to re-open the view later"
061327740950 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7704
diff changeset
  2391
"/    device := nil.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2392
    realized := false.
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2395
initGC
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2396
    "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
  2397
     really drawn, none is created.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2398
     This method is sent, when the first drawing happens"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2399
7750
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2400
    ^ gc initGC
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2401
!
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2402
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2403
initialize
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2404
    super initialize.
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2405
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2406
    width := 0.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2407
    height := 0.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2408
    realized := false.
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2411
initializeForDevice:aDevice
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2412
    "allocate a GraphicsContext for a device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2413
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2414
    aDevice notNil ifTrue:[
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2415
        device := aDevice.
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2416
        gc := aDevice newGraphicsContextFor:self.
7485
24a3795170f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7469
diff changeset
  2417
        gc font:self class defaultFont.
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2420
    self initialize.
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2423
recreate
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2424
    "reacreate a medium after snapIn"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2425
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2426
    gc notNil ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2427
	gc recreate.
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2431
releaseGC
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2432
    "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
  2433
     display if you know that you are done with a drawable."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2434
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2435
    gc notNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  2436
        gc releaseGC.
7416
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2440
!GraphicsMedium methodsFor:'misc'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2441
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2442
clippedTo:aRectangle do:aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2443
    |oldClip|
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2444
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2445
    oldClip := gc deviceClippingBoundsOrNil.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2446
    gc clippingBounds:aRectangle.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2447
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2448
    aBlock
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2449
	ensure:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2450
	    gc deviceClippingBounds:oldClip
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2454
flush
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2455
    "send all buffered drawing to the device."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2456
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2457
    gc flush
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2460
setDevice:aDevice id:aDrawbleId gcId:aGCId
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2461
    "private"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2462
7443
e2d05b756727 Use devices registry
Stefan Vogel <sv@exept.de>
parents: 7420
diff changeset
  2463
    device := aDevice.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2464
    gc notNil ifTrue:[
7420
c1c1c574f217 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  2465
        gc setDevice:aDevice id:aDrawbleId gcId:aGCId
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2466
    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2467
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2468
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2469
setPaint:fgColor on:bgColor
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2470
    "set the paint and background-paint color.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2471
     The bg-paint is used in opaque-draw operations.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2472
     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
  2473
     Used on initialization."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2474
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2475
    gc setPaint:fgColor on:bgColor
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2476
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2477
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2478
sync
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2479
    "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
  2480
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2481
    gc sync
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2484
!GraphicsMedium methodsFor:'printing & storing'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2485
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2486
storeOn:aStream
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2487
    "blocked: ascii storeString not possible (recursive - view - subviews - container)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2488
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2489
    self shouldNotImplement.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2490
    "if proceeded from exception..."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2491
    self printOn:aStream.
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2494
!GraphicsMedium methodsFor:'queries'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2495
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2496
fontAscent
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2497
    "answer the ascent of the current font on the current device"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2498
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2499
    ^ gc fontAscent
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2502
horizontalIntegerPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2503
    "return the (rounded) number of pixels per millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2504
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2505
    ^ self horizontalPixelPerMillimeter asInteger
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2508
horizontalPixelPerInch
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2509
    "return the number of horizontal pixels per inch of the display"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2510
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2511
    ^ self horizontalPixelPerMillimeter * 25.4
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2514
horizontalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2515
    "return the number of pixels per millimeter (not rounded)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2516
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2517
    ^ gc horizontalPixelPerMillimeter
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2520
horizontalPixelPerMillimeter:millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2521
    "return the number of pixels (not rounded) for millis millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2522
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2523
    ^ self horizontalPixelPerMillimeter * millis
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2526
resolution
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2527
    "return a point consisting of pixel-per-inch horizontally and vertically."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2528
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2529
    ^ gc resolution
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2530
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2531
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2532
verticalIntegerPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2533
    "return the (rounded) number of pixels per millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2534
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2535
    ^ self verticalPixelPerMillimeter rounded
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2538
verticalPixelPerInch
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2539
    "return the number of vertical pixels per inch of the display"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2540
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2541
    ^ self verticalPixelPerMillimeter * 25.4
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2544
verticalPixelPerMillimeter
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2545
    "return the number of pixels per millimeter (not rounded)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2546
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2547
    ^ gc verticalPixelPerMillimeter
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2550
verticalPixelPerMillimeter:millis
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2551
    "return the number of pixels (not rounded) for millis millimeter"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2552
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2553
    ^ self verticalPixelPerMillimeter * millis
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2556
!GraphicsMedium methodsFor:'view creation'!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2557
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2558
createBitmapFromArray:data width:width height:height
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2559
    "create a bitmap from data and set the drawableId"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2560
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2561
    gc createBitmapFromArray:data width:width height:height
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2562
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2563
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2564
createPixmapWidth:w height:h depth:d
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2565
    "create a pixmap and set the drawableId"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2566
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2567
    gc createPixmapWidth:w height:h depth:d
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2568
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2569
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2570
createRootWindow
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2571
    gc createRootWindowFor:self
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
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2574
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
  2575
    "create a window and set the drawableId"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2576
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2577
    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
  2578
! !
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2579
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2580
!GraphicsMedium class methodsFor:'documentation'!
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2581
7750
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2582
version
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2583
    ^ '$Header$'
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2584
!
7b574569192e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7748
diff changeset
  2585
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2586
version_CVS
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 6247
diff changeset
  2587
    ^ '$Header$'
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2588
! !
6045
0e3df803d990 class: GraphicsMedium
Claus Gittinger <cg@exept.de>
parents: 5321
diff changeset
  2589