|
Class: GraphicsMedium
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--Form
- Package:
- stx:libview
- Category:
- Graphics-Support
- Version:
- rev:
1.89
date: 2023/11/21 14:09:25
- user: cg
- file: GraphicsMedium.st directory: libview
- module: stx stc-classLibrary: libview
this is an abstract superclass for all kinds of drawables which
have a physical representation (i.e. have an extent).
Don't use messages from here - it will vanish soon.
[Instance variables:]
width <SmallInteger> the width (device dependent, usually pixels or inches)
height <SmallInteger> the height (device dependent, usually pixels or inches)
copyrightCOPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
Signal constants
-
drawingOnClosedDrawableSignal
-
return the signal which is raised, if drawing is attempted
on a closed drawable.
This is especially useful, if a forked thread animates
a view in the background, and is not properly synchronized
with the window thread - i.e. the window gets closed by the user,
and the background process continues to draw.
In this case, the background thread should handle this signal
and terminate itself in the handler.
accessing-defaults
-
defaultFont
-
get the default font used for drawing
-
defaultFont: aFont
-
set the default font used for drawing
instance creation
-
new
-
create a new drawable - take the current display as
its device (for now, this may be changed until the view is
physically created)
Usage example(s):
'Warning: DeviceGraphicsContext (' print. self name print. ') should not be created with new' printNL.
|
-
on: aDevice
-
create a new drawable on aDevice
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
onDevice: aDevice
-
create a new drawable on aDevice
queries
-
isAbstract
-
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.
Compatibility-ST80
-
displayArc: origin radius: radius from: startAngle angle: angle
-
draw an arc around a point
-
displayArcBoundedBy: boundingBox startAngle: startAngle sweepAngle: sweepAngle
-
draw an arc/circle/ellipse - ST-80 compatibility
-
displayArcBoundedBy: boundingBox startAngle: startAngle sweepAngle: sweepAngle at: origin
-
draw an arc/circle/ellipse - ST-80 compatibility
-
displayLineFrom: startPoint to: endPoint translateBy: anOffset
-
draw a line - ST-80 compatibility
-
displayPolyline: aPolygon
-
draw a polygon - ST-80 compatibility
-
displayRectangularBorder: aRectangle
-
draw a rectangle - ST-80 compatibility
-
displayRectangularBorder: aRectangle at: aPoint
-
draw a rectangle - ST-80 compatibility
-
displayWedgeBoundedBy: boundingBox startAngle: startAngle sweepAngle: sweepAngle
-
fill an arc/circle/ellipse - ST-80 compatibility.
The angles may be floats or integer - they are given in degrees.
Positive angles are taken clockwise, negative angles are counterclockwise.
-
displayWedgeBoundedBy: boundingBox startAngle: startAngle sweepAngle: sweepAngle at: origin
-
fill an arc/circle/ellipse - ST-80 compatibility.
The angles may be floats or integer - they are given in degrees.
Positive angles are taken clockwise, negative angles are counterclockwise.
-
findFont: aFontDescription
-
given a fontDescription, return a device-font for it
on my device.
-
key
-
-
phase
-
return the origin within the mask (used to draw with patterns).
This is an alias for ST/X's #maskOrigin
-
phase: aPoint
-
set the origin within the mask (used to draw with patterns).
This is an alias for ST/X's #maskOrigin:
-
setDevicePattern: aColorOrMask
-
ST/X can paint in any color or image
-
tilePhase
-
return the origin within the mask (used to draw with patterns).
This is an alias for ST/X's #maskOrigin
-
tilePhase: aPoint
-
set the origin within the mask (used to draw with patterns).
This is an alias for ST/X's #maskOrigin
-
widthOfString: aString
-
given a string, return its width in pixels if
drawn on the receiver's device.
-
widthOfString: aString from: start to: stop
-
given a string, return the width in pixels if
a substring is drawn on the receiver's device.
Compatibility-Squeak
-
copyBits: aRectangle from: aForm at: srcOrigin clippingBox: clippingBox rule: rule fillColor: fillColor
-
ST-80 compatibility: numeric rule
Usage example(s):
|dst src|
dst := Form width:8 height:8 fromArray:#[
2r00000000
2r00000000
2r00000000
2r00000000
2r11111111
2r11111111
2r11111111
2r11111111
].
src := Form width:8 height:8 fromArray:#[
2r00001111
2r00001111
2r00001111
2r00001111
2r00001111
2r00001111
2r00001111
2r00001111
].
dst copyBits:(0@0 corner:8@8) from:src at:0@0 clippingBox:(0@0 corner:8@8) rule:15 fillColor:Color black.
dst inspect
|
Usage example(s):
|dst src|
dst := Form width:8 height:8 fromArray:#[
2r00000000
2r00000000
2r00000000
2r00000000
2r11111111
2r11111111
2r11111111
2r11111111
].
src := Form width:8 height:8 fromArray:#[
2r00001111
2r00001111
2r00001111
2r00001111
2r00001111
2r00001111
2r00001111
2r00001111
].
dst copyBits:(0@0 corner:8@8) from:src at:0@0 clippingBox:(0@0 corner:8@8) rule:15 fillColor:Color black.
dst inspect
|
-
fill: aRectangle fillColor: aColor
-
fill the rectangular area specified by aRectangle with the black color
-
fillBlack: aRectangle
-
fill the rectangular area specified by aRectangle with the black color
-
fillColor: something
-
fill the receiver with something;
something may be a Form, Color or colorIndex
-
fillRectangle: aRectangle color: aColor
-
fill a rectangle with the given paint color
-
fillWhite
-
fill all of the receiver with the white color
-
fillWhite: aRectangle
-
fill the rectangular area specified by aRectangle with the white color
Compatibility-VW
-
displayBackgroundIfNeededOn: aGraphicsContext
-
-
inactiveForegroundColor
-
a dummy method to support VW widgets
-
selectionBackgroundColor
-
a dummy method to support VW widgets
-
selectionForegroundColor
-
a dummy method to support VW widgets
-
separatorColor
-
a dummy method to support VW widgets
accessing
-
at: aPoint
-
return the pixel at the coordinate given by aPoint
-
at: aPoint put: aPixelColor
-
set a pixel
Usage example(s):
Display rootView at:(0@0) put:(Color red).
Display rootView at:(1@1) put:(Color red).
Display rootView at:(2@2) put:(Color red).
Display rootView at:(3@3) put:(Color red).
Display rootView at:(4@4) put:(Color red).
Display rootView at:(5@5) put:(Color red).
|
-
atX: x y: y
-
return the pixel at the coordinate given by x/y
-
atX: x y: y put: aPixelColor
-
set a pixel
-
backgroundPaint
-
return the background paint color.
(used for opaqueForms and opaqueStrings)
-
backgroundPaint: aColor
-
set the background-paint color; this is used in opaque-draw
operations
-
basicFont
-
return the font for drawing
-
basicFont: aFont
-
set the font for drawing if it has changed.
This is a low level entry, which is not to be redefined
(i.e. it must not imply a redraw operation)
-
blackColor
-
-
bottomCenter
-
return the topCenter point
-
bottomLeft
-
return the bottomLeft point
-
boundingBox
-
-
capStyle
-
return the current cap-style for line-drawing.
possible styles are: #notLast, #butt, #round, #projecting
-
capStyle: aStyleSymbol
-
set the cap-style for line-drawing;
possible styles are: #notLast, #butt, #round, #projecting
-
center
-
return the point at the center of the receiver
-
characterEncoding
-
returns a symbol describing how the contents is encoded internally.
For now, this should be the same encoding as my fonts encoding (otherwise, mappings would
occur when drawing).
This is (currently) only passed down from the fileBrowser,
and required when japanese/chinese/korean text is edited.
(encoding is something like #'iso8859-5' #euc, #sjis, #jis7, #gb, #big5 or #ksc)
-
characterEncoding: encodingArg
-
define how the contents is encoded internally.
This should normally never be required, as ST/X now assumes
unicode (of which iso8859-1 is a subset) encoding.
The possibility to change the characterEncoding is provided as
a backward compatibility hook for programs which want to use
another encoding internally. One such view is the CharacterSetView,
which wants to show character as they are actually present in a font.
-
clipByChildren
-
drawing shall be done into my view only (default)
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
clipRect
-
return the clip-rectangle for drawing.
If there is currently no active clip, return the underlying
displaySurfaces (i.e. views) bounds. Added for ST-80 compatibility.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
clipRect: aRectangle
-
set the drawing clip-rectangle
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
clippedByChildren: aBoolean
-
turn on/off drawing over children.
If on, a superview may draw 'over' its children.
If off (the default), drawing is 'under' its children.
Only useful for the rootView, to draw over any visible views.
(for example, when dragging a rubber-line)
-
clippingBounds
-
return the clipping rectangle for drawing (in logical coordinates),
nil if there is none.
-
clippingBounds: aRectangleOrNil
-
set the clipping rectangle for drawing (in logical coordinates);
a nil argument turn off clipping (i.e. whole view is drawable)
-
clippingBoundsOrNil
-
return the clipping rectangle for drawing, nil if there is none.
-
clippingRectangle: aRectangleOrNil
-
set the clipping rectangle for drawing (in logical coordinates);
a nil argument turn off clipping (i.e. whole view is drawable)
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
clippingRectangleOrNil
-
return the clipping rectangle for drawing, nil if there is none.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
colorAt: aPoint
-
return the color of the pixel at the coordinate given by x@y
-
colorAtX: x y: y
-
return the color of the pixel at the coordinate given by aPoint
-
container
-
return my container - for protocol compatibility
-
corner
-
return the corner point i.e. the bottom-right point
-
corner: aPoint
-
set the corner point i.e. change extent so that corner will be
aPoint while leaving the origin unchanging
-
dashStyle: aDashList offset: dashOffset
-
define dashes. Each element of the dashList specifies the length
of a corresponding dash. For example, setting it to [4 4]
defines 4on-4off dashing;
Setting it to [1 2 4 2] defines 1on-2off-4on-2off dashes.
The dashOffset specifies where in the dashList the dashing starts.
Ignored here - this may not be supported by all graphics devices.
-
depth
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
device
-
return the device, the receiver is associated with.
Please use graphicsDevice for ST80 compatibility.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
device: aDevice
-
set the device
-
deviceClippingBounds: aRectangleOrNil
-
set the clipping rectangle for drawing (in device coordinates);
a nil argument turns off clipping (i.e. whole view is drawable - incl. margins)
-
deviceClippingBoundsOrNil
-
return the clipping rectangle as physical coordinated for drawing, nil if there is none.
-
deviceClippingRectangle: aRectangleOrNil
-
set the clipping rectangle for drawing (in device coordinates);
a nil argument turns off clipping (i.e. whole view is drawable - incl. margins)
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
deviceFont
-
return the current drawing font as a device font
-
drawableId
-
return the id of the drawable on the device
-
font
-
return the current drawing font
-
font: aFont
-
set the font for drawing if it has changed.
This should be redefined in some widget to perform an automatic
redraw/invalidate. See also: #basicFont:
-
function
-
return the current drawing function
-
function: aSymbol
-
set the drawing function if it has changed.
The argument is one of:
#copy,#copyInverted,#xor,#and,#andReverse
#andInverted,#or,#orReverse,#orInverted
#invert,#clear,#set,#noop,#equiv,#nand
Notice: not all graphicMedia support all functions
-
gcId
-
return the receiver's graphic context id on the device
-
graphicsContext
-
-
graphicsContext: newGc
-
set the graphics context
-
graphicsDevice
-
same as #device, for ST-80 compatibility
-
id
-
return the id of the drawable on the device.
Obsolete, use #drawableId!
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
joinStyle
-
return the current join-style for polygon-drawing.
possible styles are: #miter, #bevel, #round
-
joinStyle: aStyleSymbol
-
set the join-style of lines in polygon-drawing;
possible styles are: #miter, #bevel, #round
-
left
-
return the left i.e. x-coordinate of top-left of the receiver
-
leftCenter
-
return the leftCenter point
-
lineStyle
-
return the current line-drawing-style.
possible styles are: #solid, #dashed, #doubleDashed,
#dotted, #dashDot or #dashDotDot.
-
lineStyle: aStyleSymbol
-
set the line-drawing-style;
possible styles are: #solid, #dashed, #doubleDashed,
#dotted, #dashDot or #dashDotDot.
-
lineWidth
-
return the current drawing linewidth
-
lineWidth: aNumber
-
set the line drawing width in pixels
-
mask
-
return the current drawing mask
-
mask: aForm
-
set the drawing mask
-
maskOrigin
-
return the origin within the mask (used to draw with patterns).
Should be redefined in classes which support it.
This is an alias for ST-80's #phase
-
maskOrigin: aPoint
-
set the origin within the mask (used to draw with patterns).
Should be redefined in classes which support it.
This is an alias for ST-80's #phase:
-
maskOriginX: x y: y
-
set the origin within the mask (used to draw with patterns).
Should be redefined in classes which support it.
This is an alias for ST-80's #phase:
-
medium
-
return the destination medium i.e. the underlying graphics device
-
noClipByChildren
-
drawing shall also be done into subviews
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
origin
-
return the origin i.e. coordinate of top-left of the receiver
-
paint
-
return the current paint drawing color
-
paint: aColor
-
set the drawing painting color, aColor can be a dithered one
-
paint: fgColor on: bgColor
-
set the paint and backgroundPaint, used for text and bitmaps.
Both colors may be dithered colors
-
paint: fgColor on: bgColor function: f
-
set paint, background-paint and function
-
realized
-
return true, if the receiver is realized.
The receiver may still be unmapped, if the container is unrealized.
Use reallyRealized to make certain that I am really mapped.
-
reallyRealized
-
return true, if the receiver is realized and all containers
are realized.
-
rightCenter
-
return the leftCenter point
-
setClippingBounds: aRectangleOrNil
-
-
setDevice: aDevice
-
set the device
-
setGraphicsExposures: aBoolean
-
want to if aBoolean is true - or don't want to be notified
of graphics exposures
-
setMaskOrigin: aPoint
-
set the origin within the mask (used to draw with patterns).
OBSOLETE: use #maskOrigin: or #phase:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
setMaskOriginX: x y: y
-
set the origin within the mask (used to draw with patterns).
OBSOLETE: use #maskOriginX:y: or #phase:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
top
-
return the top i.e. y-coordinate of top-left of the receiver
-
topCenter
-
return the topCenter point
-
topRight
-
return the topRight point
-
viewBackground
-
for protocol compatibility with view; return my background paint color here
-
viewOrigin
-
return the drawable's visible origin (for scrolling)
-
whiteColor
-
accessing-dimensions
-
extent
-
return the extent;
i.e. a point with width as x, height as y coordinate
-
extent: extent
-
set the extent.
Might be redefined to perform other actions (especially notifications)
-
height
-
return the height of the receiver
-
height: anInteger
-
set the height of the receiver.
Might be redefined to perform other actions (especially notifications)
-
setHeight: anInteger
-
set the view's height in pixels.
Direct setter, not redefined in subclasses
-
setWidth: anInteger
-
set the view's width in pixels.
Direct setter, not redefined in subclasses
-
setWidth: w height: h
-
set both width and height.
Direct setter, not redefined in subclasses
-
width
-
return the width of the receiver
-
width: anInteger
-
set the width of the receiver.
Might be redefined to perform other actions (especially notifications)
-
width: w height: h
-
set both width and height of the receiver.
Might be redefined to perform other actions (especially notifications)
accessing-internals
-
background
-
return the current background drawing color.
OBSOLETE: use #paint: / #backgroundPaint: / #paint:on:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
background: aColor
-
set the internal background color for drawing - aColor must be a real color.
OBSOLETE: this method will vanish; use #paint: / #backgroundPaint: / #paint:on:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
foreground
-
return the current foreground drawing color.
OBSOLETE: use #paint: / #paint:on:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
foreground: aColor
-
set the internal foreground color for drawing - aColor must be a real color.
OBSOLETE: this method will vanish; use #paint: / #paint:on:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
foreground: fgColor background: bgColor
-
set both internal foreground and internal background colors
- these must be real colors.
OBSOLETE: this method will vanish; use #paint: / #paint:on:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
foreground: fgColor background: bgColor function: fun
-
set foreground, background colors and function.
OBSOLETE: this method will vanish; use #paint: / #paint:on:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
foreground: aColor function: fun
-
set the foreground color and function for drawing.
OBSOLETE: this method will vanish; use #paint: / #paint:on:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
setRealized: aBoolean
-
low level special interface to manipulate the realized state.
Non-public interface, only to be used by experts.
(use to pretend a view has been realized - for example with alien views)
accessing-transformation
-
scale
-
return the scale factor (as point) of the transformation
-
scale: aPoint
-
set the scale factor of the transformation
-
transformation
-
return the transformation
-
transformation: aTransformation
-
set the transformation
-
translateBy: aPoint
-
add to the translation offset of the transformation
-
translation
-
return the translation factor (as point) of the transformation
-
translation: aPoint
-
set the translation offset of the transformation
basic drawing
-
displayArcX: x y: y width: width height: height from: startAngle angle: angle
-
draw an arc in a box
- this could be recoded to draw using displayLine.
The angles may be float or integer - they are given in degrees.
Positive angles are taken clockwise, negative angles are counterclockwise.
-
displayDottedRectangleX: x y: y width: w height: h
-
draw a dotted-line rectangle
A general implementation is found here; deviceGC's
may reimplement this if directly supported by the device
-
displayHorizontalWavelineFromX: x0 y: y0 toX: x1
-
draw a horizontal wave-line from x0/y0 to x1/y0
-
displayLineFromX: x0 y: y0 toX: x1 y: y1
-
draw a line from x0/y0 to x1/y1
-
displayOpaqueForm: aForm x: x y: y
-
draw a form at x/y;
if the form has depth 1, 1's in the form are
drawn in current fg, 0's in current bg color.
If the form has depth ~~ 1, it is copied as is onto the receiver
-
displayOpaqueString: aString from: index1 to: index2 x: x y: y
-
draw part of a string with both fg and bg at x/y in current font
-
displayPolygon: aPolygon
-
draw a polygon
- this could be recoded to draw using displayLine
-
displayRectangleX: x y: y width: w height: h
-
draw a rectangle
- this could be recoded to draw using displayLine
-
displayString: aString from: index1 to: index2 x: x y: y
-
draw part of a string with fg at x/y in current font
-
displayString: aString from: index1 to: index2 x: x y: y opaque: opaque
-
draw part of a string with both fg and bg at x/y in current font
-
displayString: aString from: index1 to: index2 x: x y: y opaque: opaque maxWidth: maxWidth
-
draw part of a string with both fg and bg at x/y in current font
basic filling
-
fillArcX: x y: y width: w height: h from: start angle: angle
-
fill an arc with current paint color.
The angles may be floats or integer - they are given in degrees.
Positive angles are taken clockwise, negative angles are counterclockwise.
-
fillPolygon: points
-
fill a polygon with current paint color
-
fillRectangleX: x y: y width: w height: h
-
fill a rectangle with current paint color
-
fillRectangleX: x y: y width: w height: h color: aColor
-
fill a rectangle with given color
bit blitting
-
copyBitsFrom: aByteArray bitsPerPixel: bpp depth: depth padding: pad width: srcW height: srcH x: srcX y: srcY toX: dstX y: dstY
-
copy bits from a smalltalk byteArray.
The bits found there are supposed to be in the devices native format (i.e.
translated to allocated color indices on pseudoColor devices and padded as required.
The byteOrder is MSB and will be converted as appropriate by the underlying devices
method to whatever the device needs.
-
copyFrom: aGC toX: dstX y: dstY
-
copy from a drawable - maybe self
-
copyFrom: aGC x: srcX y: srcY toX: dstX y: dstY width: w height: h
-
copy from a drawable - maybe self
-
copyFrom: aDrawable x: srcX y: srcY toX: dstX y: dstY width: w height: h async: async
-
copy from aDrawable into the receiver;
the source may be the receiver as well - in this case its a scroll.
All coordinates are in device coordinates.
If the receiver is a view AND async is true, the call returns immediately
- otherwise, it returns when the scroll operation is finished.
(not all devices care for this).
If the receiver is a pixmap, the call always returns immediately.
-
copyFrom: aGC x: dstX y: dstY width: w height: h
-
copy from a drawable - maybe self
-
copyPlaneFrom: aDrawable x: srcX y: srcY toX: dstX y: dstY width: w height: h
-
copy one plane from aDrawable into the receiver. 0's are drawn in
background, while 1's are drawn with foreground color.
The depth of aDrawable must (should) be 1.
The drawable must have been allocated on the same device.
All coordinates are in device coordinates.
coordinate translation
-
translatePoint: aPoint from: anotherWindowOrNilForScreen
-
translate a point in anotherWindowOrNilForScreen (or root window if nil) to myself.
anotherWindowOrNilForScreen must be on the same display
-
translatePoint: aPoint to: anotherWindowOrNilForScreen
-
translate a point in myself to anotherWindowOrNilForScreen (or root window if nil).
anotherWindowOrNilForScreen must be on the same display
-
translatePointFromRoot: aPoint
-
translate a point in root window coordinates to myself.
-
translatePointToRoot: aPoint
-
translate a point in myself to root window coordinates.
copying-private
-
postCopy
-
this may not be enough to allow copying of views ...
Usage example(s):
-
postDeepCopy
-
(comment from inherited method)
allows for cleanup after deep copying.
To be redefined in subclasses.
drawing
-
display: someObject at: aPoint
-
draw someObject - this must understand the #displayOn:at: message
-
displayArcIn: aRectangle from: startAngle angle: angle
-
draw an arc in a box
-
displayArcOrigin: origin corner: corner from: startAngle angle: angle
-
draw an arc in a box
-
displayArcX: x y: y w: w h: h from: startAngle angle: angle
-
draw an arc; apply transformation if nonNil
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
displayCircle: aPoint radius: r
-
draw a circle around a center point
-
displayCircleIn: aRectangle
-
draw a circle in a box
-
displayCircleX: x y: y radius: r
-
draw a circle around a center point
-
displayForm: aFormOrImage
-
draw a form (or image) at the origin
-
displayForm: aFormOrImage at: aPoint
-
draw a form (or image)
-
displayForm: formToDraw x: x y: y
-
draw a form or image non opaque;
if it's a 1-plane bitmap, 1-bits are drawn in the
current paint-color, leaving pixels with 0-bits unchanged
(i.e. only 1-bits are drawn from the form).
If it's a deep form (i.e. a pixmap) the current paint
settings are ignored and the form is drawn as-is.
Care must be taken, that the paint color is correctly allocated
(by sending #on: to the color) before doing so.
Using functions other than #copy only makes sense if you are
certain, that the colors are real colors (actually, only for
noColor or allColor).
-
displayForm: aFormOrImage x: x y: y opaque: opaque
-
draw a form (or image) at x/y;
if the form has depth 1, 1's in the form are
drawn in current paint color, 0's are ignored.
If the form has depth ~~ 1, the current fg color setting is ignored.
-
displayImage: aFormOrImage
-
draw an image (or form).
Provided for ST-80 compatibilty;
in ST/X, images are also handled by #displayForm:
-
displayImage: aFormOrImage at: aPoint
-
draw an image (or form).
Provided for ST-80 compatibilty;
in ST/X, images are also handled by #displayForm:
-
displayImage: aFormOrImage x: x y: y
-
draw an image (or form).
Provided for ST-80 compatibilty;
in ST/X, images are also handled by #displayForm:
-
displayLineFrom: point1 to: point2
-
draw a line
-
displayLineFromX: xStart y: yStart toX: xEnd y: yEnd brush: aForm
-
draw a line using a brush.
Here, a slow fallback is used, drawing into a
temporary bitmap first, which is then displayed
-
displayOpaqueString: aString at: aPoint
-
draw a string with both fg and bg
-
displayOpaqueString: aString from: start to: stop at: aPoint
-
draw part of a string - drawing both fg and bg
-
displayOpaqueString: aString x: x y: y
-
draw a string at the coordinate x/y - draw foreground pixels in paint-color,
background pixels in bgPaint color. If the transformation involves scaling,
the fonts point-size is scaled as appropriate.
Assuming that device can only draw in device colors, we have to handle
the case where paint and/or bgPaint are dithered colors or images.
-
displayOpaqueString: aString x: x y: y angle: drawAngle
-
draw a string along a (possibly non-horizontal) line,
drawing both fg and bg pixels.
The angle is in degrees, clock-wise, starting with 0 for
a horizontal draw.
Drawing is done by first drawing the string into a temporary bitmap,
which is rotated and finally drawn as usual.
NOTICE: due to the rotation of the temporary bitmap, this is a slow
operation - not to be used with cillions of strings ...
Usage example(s):
|v|
v := View new.
v extent:300@200.
v openAndWaitUntilVisible.
0 to:360 by:45 do:[:a |
v paint:Color black on:Color red.
v displayOpaqueString:'hello world' x:100 y:100 angle:a.
].
|
-
displayPoint: aPoint
-
draw a pixel
-
displayPointX: x y: y
-
draw a point (with current paint-color); apply transformation if nonNil
-
displayRectangle: aRectangle
-
draw a rectangle
-
displayRectangleOrigin: origin corner: corner
-
draw a rectangle
-
displayRectangleOrigin: origin extent: extent
-
draw a rectangle
-
displayRoundRectangleX: left y: top width: width height: height wCorner: wCorn hCorner: hCorn
-
|v|
(v := View new) extent:200@200; openAndWaitUntilVisible.
v displayRoundRectangleX:10 y:10 width:100 height:100 wCorner:20 hCorner:20
-
displayString: aString at: aPoint
-
draw a string - drawing fg only
-
displayString: aString centeredAt: aPoint
-
draw a string - drawing fg only
-
displayString: aString centeredAtX: x y: y
-
draw a string - drawing fg only
-
displayString: aString from: start to: stop at: aPoint
-
draw part of a string - drawing fg only
-
displayString: aString x: x y: y
-
draw a string at the coordinate x/y -
draw foreground-pixels only (in current paint-color),
leaving background as-is. If the transformation involves scaling,
the fonts point-size is scaled as appropriate.
-
displayString: aString x: x y: y angle: drawAngle
-
draw a string along a (possibly non-horizontal) line - drawing fg only.
The angle is in degrees, clock-wise, starting with 0 for
a horizontal draw.
Drawing is done by first drawing the string into a temporary bitmap,
which is rotated and finally drawn as usual.
NOTICE: due to the rotation of the temporary bitmap, this is a slow
operation - not to be used with cillions of strings ...
Usage example(s):
|v|
v := View new.
v extent:300@200.
v openAndWaitUntilVisible.
0 to:360 by:90 do:[:a |
v paint:Color black.
v displayString:'hello world' x:100 y:100 angle:a.
].
|
Usage example(s):
|v|
v := View new.
v extent:400@400.
v openAndWaitUntilVisible.
0 to:360 by:5 do:[:a |
v paint:Color black.
v displayString:'.........hello' x:200 y:200 angle:a.
].
|
Usage example(s):
|v|
v := View new.
v extent:200@100.
v openAndWaitUntilVisible.
v displayString:' hello' x:90 y:50 angle:0.
v displayString:' hello' x:90 y:50 angle:45.
v displayString:' hello' x:90 y:50 angle:90.
v displayString:' hello' x:90 y:50 angle:180.
v displayString:' hello' x:90 y:50 angle:270.
|
Usage example(s):
|v|
v := View new.
v extent:200@100.
v openAndWaitUntilVisible.
v displayString:'hello' x:50 y:50 angle:0.
v displayString:'hello' x:50 y:50 angle:45.
v displayString:'hello' x:50 y:50 angle:90.
v displayString:'hello' x:50 y:50 angle:135.
v displayString:'hello' x:50 y:50 angle:180.
v displayString:'hello' x:50 y:50 angle:225.
v displayString:'hello' x:50 y:50 angle:270.
v displayString:'hello' x:50 y:50 angle:315.
|
-
displayString: aString x: x y: y angle: drawAngle opaque: opaque
-
common code to draw a string along a (possibly non-horizontal) line.
The angle is in degrees, clock-wise, starting with 0 for
a horizontal draw.
Drawing is done by first drawing the string into a temporary bitmap,
which is rotated and finally drawn as usual.
NOTICE: due to the rotation of the temporary bitmap, this is a slow
operation - not to be used with cillions of strings ...
CAVEAT: if the string is not a real string (i.e. a LabelAndIcon),
this can (currently) only be done opaque
-
displayUnscaledForm: formToDraw x: x y: y
-
draw a form or image non opaque and unscaled;
if it's a 1-plane bitmap, 1-bits are drawn in the
current paint-color, leaving pixels with 0-bits unchanged
(i.e. only 1-bits are drawn from the form).
If it's a deep form (i.e. a pixmap) the current paint
settings are ignored and the form is drawn as-is.
Care must be taken, that the paint color is correctly allocated
(by sending #on: to the color) before doing so.
Using functions other than #copy only makes sense if you are
certain, that the colors are real colors (actually, only for
noColor or allColor).
The origins coordinate is transformed, but the image itself is unscaled.
-
displayUnscaledOpaqueForm: formToDraw x: x y: y
-
draw a form or image opaque and unscaled;
if it's a 1-plane bitmap, 1-bits are drawn in the
current paint-color, 0 bits in background color.
If it's a deep form (i.e. a pixmap) the current paint
settings are ignored and the form is drawn as-is (opaque).
The origins coordinate is transformed, but the image itself is unscaled.
-
displayUnscaledOpaqueString: aString from: index1 to: index2 x: x y: y
-
draw a substring at the transformed coordinate x/y but do not scale the font.
Draw foreground pixels in paint-color, background pixels in bgPaint color.
-
displayUnscaledOpaqueString: aString x: x y: y
-
draw a string at the transformed coordinate x/y but do not scale the font.
Draw foreground pixels in paint-color, background pixels in bgPaint color.
-
displayUnscaledString: aString from: index1 to: index2 x: x y: y
-
draw a substring at the transformed coordinate x/y but do not scale the font.
draw foreground-pixels only (in current paint-color), leaving background as-is.
-
displayUnscaledString: aString x: x y: y
-
draw a string at the transformed coordinate x/y but do not scale the font.
draw foreground-pixels only (in current paint-color), leaving background as-is.
drawing in device coordinates
-
displayDeviceForm: aForm x: x y: y
-
draw a form or image non opaque (i.e. only foreground color is drawn);
If it's a 1-plane bitmap, 1-bits are drawn in the
current paint-color, leaving pixels with 0-bits unchanged
(i.e. only 1-bits are drawn from the form).
If it's a deep form (i.e. a pixmap) the current paint
settings are ignored and the form is drawn as-is;
however, the mask is applied if present.
The form should must have been allocated on the same device,
otherwise its converted here, which slows down the draw.
No transformation or scaling is done.
Care must be taken, that the paint color is correctly allocated
(by sending #on: to the color) before doing so.
Using functions other than #copy only makes sense if you are
certain, that the colors are real colors (actually, only for
noColor or allColor).
-
displayDeviceLineFromX: x1 y: y1 toX: x2 y: y2
-
draw a line in device coordinates
-
displayDeviceOpaqueForm: aForm x: x y: y
-
draw a form or image opaque (i.e. both fg and bg is drawn);
If it's a 1-plane bitmap, 1-bits are drawn in the
current paint-color and 0-bits in the bgPaint color.
If it's a deep form (i.e. a pixmap) the current paint/bgPaint
settings are ignored and the form drawn as-is.
Any mask is ignored.
In the 1-plane case, special care must be taken if paint and/or bgPaint
dithered colors or patterns, since are that the colors are correctly allocated (by sending #on:
to the colors) before doing so.
The form should have been allocated on the same device; otherwise,
its converted here, which slows down the draw.
Drawing is in device coordinates; no scaling is done.
-
displayDeviceOpaqueString: aString from: index1 to: index2 x: x y: y
-
draw a substring at the coordinate x/y - draw foreground pixels in
paint-color and background pixels in bgPaint-color.
Assuming that device can only draw in device colors, we have to handle
the case where paint and/or bgPaint are dithered colors.
No translation or scaling is done.
-
displayDeviceOpaqueString: aString x: x y: y
-
draw a string at the coordinate x/y - draw foreground pixels in
paint-color and background pixels in bgPaint-color.
No translation or scaling is done
-
displayDeviceRectangleX: x y: y width: w height: h
-
draw a rectangle in device coordinates
-
displayDeviceString: aString from: index1 to: index2 in: font x: x y: y
-
draw a substring at the coordinate x/y -
draw foreground-pixels only (in current paint-color), leaving background as-is.
No translation or scaling is done
-
displayDeviceString: aString from: index1 to: index2 x: x y: y
-
draw a substring at the coordinate x/y -
draw foreground-pixels only (in current paint-color), leaving background as-is.
No translation or scaling is done
-
displayDeviceString: aString x: x y: y
-
draw a string at the coordinate x/y -
draw foreground-pixels only (in current paint-color), leaving background as-is.
No translation or scaling is done
-
fillDeviceRectangleX: x y: y width: w height: h
-
fill a rectangle with current paint color (device coordinates)
edge drawing
-
drawEdgesForX: x y: y width: w height: h level: l
-
draw 3D edges into a rectangle
-
drawEdgesForX: x y: y width: w height: h level: l shadow: shadowColor light: lightColor halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
draw 3D edges into a rectangle
-
edgeDrawn: whichOne
-
a redefinable hook for views which like to draw
over their edges (some checkToggles do).
Nothing done here.
evaluating in another context
-
reverseDo: aBlock
-
evaluate aBlock with foreground and background interchanged.
This can be reimplemented here in a faster way.
-
withBackground: fgColor do: aBlock
-
marked as obsolete by cg at 03-11-2021
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
withForeground: fgColor background: bgColor do: aBlock
-
marked as obsolete by cg at 03-11-2021
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
withForeground: fgColor background: bgColor mask: aMask do: aBlock
-
marked as obsolete by cg at 03-11-2021
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
withForeground: fgColor do: aBlock
-
marked as obsolete by cg at 03-11-2021
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
withPaint: aColor do: aBlock
-
evaluate aBlock with changed paint color.
-
xoring: aBlock
-
evaluate aBlock with function xoring
event handling
-
catchExpose
-
expose event handling is only required for views.
-
waitForExpose
-
expose event handling is only required for views.
filling
-
black
-
fill the receiver with black
-
clear
-
clear the receiver with background
-
clearDeviceRectangleX: x y: y width: w height: h
-
clear a rectangular area to background
-
clearInside
-
clear the receiver with background - ST-80 compatibility
-
clearRectangle: aRectangle
-
clear the rectangular area in the receiver to background
-
clearRectangleX: x y: y width: w height: h
-
-
clearView
-
clear the receiver with its view background
-
fill: aColorOrFormOrColorIndex
-
fill the receiver with aColorOrFormOrColorIndex;
something may be a Form, Color or colorIndex
-
fillArc: origin radius: r from: startAngle angle: angle
-
draw a filled arc around a point.
The angles may be floats or integer - they are given in degrees.
Positive angles are taken clockwise, negative angles are counterclockwise.
-
fillArcIn: aRectangle from: startAngle angle: angle
-
draw a filled arc in a box.
The angles may be floats or integer - they are given in degrees.
Positive angles are taken clockwise, negative angles are counterclockwise.
-
fillArcOrigin: origin corner: corner from: startAngle angle: angle
-
draw a filled arc in a box.
The angles may be floats or integer - they are given in degrees.
Positive angles are taken clockwise, negative angles are counterclockwise.
-
fillArcX: x y: y w: w h: h from: startAngle angle: angle
-
draw a filled arc; apply transformation if nonNil.
The angles may be floats or integer - they are given in degrees.
Positive angles are taken clockwise, negative angles are counterclockwise.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
fillArcX: x y: y width: w height: h from: startAngle to: endAngle
-
draw a filled arc in a box, given startAngle and endAngle.
The angles may be floats or integer - they are given in degrees.
Positive angles are taken clockwise, negative angles are counterclockwise.
-
fillCircle: aPoint radius: aNumber
-
draw a filled circle around aPoint
-
fillCircleIn: aRectangle
-
draw a filled circle in a box
-
fillCircleX: x y: y radius: r
-
draw a filled circle around x@y
-
fillRectangle: aRectangle
-
fill a rectangle with current paint color
-
fillRectangleLeft: left top: top right: cornerX bottom: cornerY
-
draw a filled rectangle.
Notice: the cornerPoint itself is NOT included
-
fillRectangleOrigin: origin corner: corner
-
draw a filled rectangle.
Notice: the cornerPoint itself is NOT included
-
fillRectangleOrigin: origin extent: extent
-
draw a filled rectangle.
Notice: the cornerPoint itself is NOT included
-
fillRectangleOrigin: origin width: w height: h
-
draw a filled rectangle.
Notice: the cornerPoint itself is NOT included
-
fillRoundRectangleX: left y: top width: width height: height wCorner: wCorn hCorner: hCorn
-
|v|
(v := View new) extent:200@200; openAndWaitUntilVisible.
v fillRoundRectangleX:10 y:10 width:100 height:100 wCorner:20 hCorner:20
-
invertRectangle: aRectangle
-
invert a rectangle in the receiver
-
white
-
fill the receiver with white
initialization & release
-
close
-
same as destroy - for ST-80 compatibility
-
defaultFont
-
-
destroy
-
destroy a medium - here the gc is completely destroyed
-
initGC
-
since we do not need a gc-object for the drawable until something is
really drawn, none is created.
This method is sent, when the first drawing happens
-
initialize
-
must be called if redefined
Usage example(s):
-
initializeForDevice: aDevice
-
allocate a GraphicsContext for a device
-
recreate
-
reacreate a medium after snapIn
-
releaseGC
-
destroy the associated device GC resource - can be done to be nice to the
display if you know that you are done with a drawable.
misc
-
clippedTo: aRectangle do: aBlock
-
-
flush
-
send all buffered drawing to the device.
-
setDevice: aDevice id: aDrawbleId gcId: aGCId
-
private
-
setPaint: fgColor on: bgColor
-
set the paint and background-paint color.
The bg-paint is used in opaque-draw operations.
Only set the variables, but do not send it to the device,
Used on initialization.
-
sync
-
send all buffered drawing to the device and wait until the device responds
printing & storing
-
storeOn: aStream
-
blocked: ascii storeString not possible (recursive - view - subviews - container)
queries
-
fontAscent
-
answer the ascent of the current font on the current device
-
hasRectangularBounds
-
can be redefined, but then it should also provide handles
-
horizontalIntegerPixelPerMillimeter
-
return the (rounded) number of pixels per millimeter
-
horizontalPixelPerInch
-
return the number of horizontal pixels per inch of the display
-
horizontalPixelPerMillimeter
-
return the number of pixels per millimeter (not rounded)
-
horizontalPixelPerMillimeter: millis
-
return the number of pixels (not rounded) for millis millimeter
-
resolution
-
return a point consisting of pixel-per-inch horizontally and vertically.
-
verticalIntegerPixelPerMillimeter
-
return the (rounded) number of pixels per millimeter
-
verticalPixelPerInch
-
return the number of vertical pixels per inch of the display
-
verticalPixelPerMillimeter
-
return the number of pixels per millimeter (not rounded)
-
verticalPixelPerMillimeter: millis
-
return the number of pixels (not rounded) for millis millimeter
testing
-
isPSGraphicsContext
-
view creation
-
createBitmapFromArray: data width: width height: height
-
create a bitmap from data and set the drawableId
-
createPixmapWidth: w height: h depth: d
-
create a pixmap and set the drawableId
-
createRootWindow
-
-
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
-
create a window and set the drawableId
|