XTkBitmapScroller.mesa
Copyright Ó 1990, 1991 by Xerox Corporation. All rights reserved.
Christian Jacobi, October 25, 1990 5:48:06 pm PDT
Christian Jacobi, March 15, 1991 2:08 pm PST
DIRECTORY
Imager USING [Context],
SF USING [Box, Vec],
Xl USING [Point, Size, TQ],
XlBitmap USING [Bitmap],
XTk USING [dontUse, Widget, WidgetSpec];
XTkBitmapScroller:
CEDAR
DEFINITIONS ~
BEGIN
CreateBitmapScroller:
PROC [widgetSpec: XTk.WidgetSpec ¬ [], scrolledCallBack: ScrolledCallBackProc ¬
NIL, scrollTQ: Xl.
TQ ¬
NIL, scrollData:
REF ¬
NIL, insideSize: Xl.Size ¬ [XTk.dontUse, XTk.dontUse]]
RETURNS [XTk.Widget];
Creates one...
insideSize: If specified, widgetSpec.size is overwritten with insideSize+Size[ScrollBar]
ScrolledCallBackProc:
TYPE =
PROC [scroller: XTk.Widget, pos: Xl.Point, data:
REF];
pos: relative to inside area or impl widget where origin of bitmap is displayed.
SetBitmap:
PROC [scroller: XTk.Widget, bitmap: XlBitmap.Bitmap, surfaceUnitsPerPixel:
NAT ¬ 1, pos: Xl.Point ¬ [0, 0]];
Forces scroller to display a new bitmap. Returns immediately, maybe before bits are painted.
Scrolls so that origin in bitmap is displayed at position pos of widget.
GetBitmap:
PROC [scroller: XTk.Widget]
RETURNS [bitmap: XlBitmap.Bitmap, surfaceUnitsPerPixel:
NAT];
Returns currently displayed bitmap.
CreateAndSetBitmap:
PROC [scroller: XTk.Widget, size:
SF.Vec, bpp:
NAT ¬ 1, surfaceUnitsPerPixel:
NAT ¬ 1, pos: Xl.Point ¬ [0, 0]];
Conveniance procedure.
CreateContext:
PROC [scroller: XTk.Widget]
RETURNS [context: Imager.Context];
Conveniance procedure: creates context drawing into current bitmap of widget.
ScrollTo:
PROC [scroller: XTk.Widget, pos: Xl.Point ¬ [0, 0]];
Scrolls so that origin in bitmap is displayed at position pos of inside or impl widget.
GetScrollPos:
PROC [scroller: XTk.Widget]
RETURNS [Xl.Point];
Returns position relative to inside area or impl widget where origin of bitmap is displayed.
Not monitored; use scrollTQ to guarantee both coordinates from the same time.
GetVisibleBox:
PROC [scroller: XTk.Widget]
RETURNS [
SF.Box];
Returns box of bitmap currently visible in scroller. (Undefined if scroller not visible).
box is in bitmap's coordinate system but it is not clipped to size of bitmap.
Not monitored; use scrollTQ to guarantee all 4 returned numbers from same time.
Wait:
PROC [scroller: XTk.Widget, server:
BOOL ¬
FALSE];
Waits until all requests are "performed".
server: TRUE: waits until server acknowledges having seen requests.
server: FALSE: waits until requests are removed from internal buffer.
GetImplData:
PRIVATE
PROC [scroller: XTk.Widget]
RETURNS [
REF];
Wizards only.
GetImplWidget:
PROC [scroller: XTk.Widget]
RETURNS [XTk.Widget];
Returns widget implementing inside area, usefull to carry events.
END.