XTkWidgetsImpl.mesa
Copyright Ó 1988, 1989, 1990, 1991, 1992 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, October 18, 1988 11:22:01 am PDT
Christian Jacobi, April 8, 1992 2:48 pm PDT
DIRECTORY
IO,
Rope,
Xl,
XTk,
XTkBasics,
XTkButtons,
XTkCommon,
XTkContainers,
XTkFields,
XTkLabels,
XTkStreamWidgets,
XTkWidgets,
XTkChoiceWidgets,
XTkShellWidgets;
XTkWidgetsImpl:
CEDAR
MONITOR
IMPORTS XTkBasics, XTkButtons, XTkCommon, XTkChoiceWidgets, XTkContainers, XTkFields, XTkLabels, XTkStreamWidgets, XTkShellWidgets
EXPORTS XTkWidgets =
BEGIN OPEN XTk, XTkWidgets;
queryDBFont: PUBLIC Xl.Font ¬ XTkCommon.queryDBFont;
--Containers--------------------------------------
CreateContainer:
PUBLIC
PROC [widgetSpec: WidgetSpec ¬ [], children:
LIST
OF Widget ¬
NIL]
RETURNS [widget: Widget] = {
widget ¬ XTkContainers.CreateContainer[widgetSpec, children];
};
AppendChild:
PUBLIC
PROC [container: Widget, child: Widget, startReconfigure:
BOOL] = {
XTkContainers.AppendChild[container, child, startReconfigure]
};
AppendChildren:
PUBLIC
PROC [container: Widget, children:
LIST
OF Widget, startReconfigure:
BOOL ¬
TRUE] = {
XTkContainers.AppendChildren[container, children, startReconfigure];
};
RemoveChild:
PUBLIC
PROC [container: ContainerWidget, child: Widget, destroyChild:
BOOL ¬
TRUE, startReconfigure:
BOOL ¬
TRUE] = {
XTkContainers.RemoveChild[container, child, destroyChild, startReconfigure];
};
SetForce:
PUBLIC
PROC [container: ContainerWidget, force:
INT] = {
XTkContainers.SetForce[container, force];
};
CreateXStack:
PUBLIC
PROC [widgetSpec: WidgetSpec, stack:
LIST
OF Widget ¬
NIL, force:
INT ¬ -1]
RETURNS [widget: Widget] = {
widget ¬ XTkContainers.CreateXStack[widgetSpec, stack, force];
};
CreateYStack:
PUBLIC
PROC [widgetSpec: WidgetSpec, stack:
LIST
OF Widget ¬
NIL, force:
INT ¬ -1]
RETURNS [widget: Widget] = {
widget ¬ XTkContainers.CreateYStack[widgetSpec, stack, force];
};
--Ruler--------------------------------------
CreateRuler:
PUBLIC
PROC [widgetSpec: WidgetSpec ¬ []]
RETURNS [Widget] = {
RETURN [XTkBasics.CreateRuler[widgetSpec]];
};
HRule:
PUBLIC
PROC [height:
INT ← 1]
RETURNS [XTk.Widget] = {
RETURN [XTkBasics.HRule[height]];
};
VRule:
PUBLIC
PROC [width:
INT ← 1]
RETURNS [XTk.Widget] = {
RETURN [XTkBasics.VRule[width]];
};
CreateSpace:
PUBLIC
PROC [widgetSpec: XTk.WidgetSpec ¬ []]
RETURNS [XTk.Widget] = {
RETURN [XTkBasics.CreateSpace[widgetSpec]];
};
HSpace:
PUBLIC
PROC [width:
INT ← 1]
RETURNS [XTk.Widget] = {
RETURN [XTkBasics.HSpace[width]];
};
VSpace:
PUBLIC
PROC [height:
INT ← 1]
RETURNS [XTk.Widget] = {
RETURN [XTkBasics.VSpace[height]];
};
CreateBareWidget:
PUBLIC
PROC [widgetSpec: WidgetSpec ¬ []]
RETURNS [Widget] = {
RETURN [XTkBasics.CreateBare[widgetSpec]];
};
--Re-Exporters--------------------------------------
CreateLabel:
PUBLIC
PROC [widgetSpec: WidgetSpec, text: Rope.
ROPE ¬
NIL, style: StyleSpec]
RETURNS [widget: Widget] = {
widget ¬ XTkLabels.CreateLabel[
widgetSpec: widgetSpec,
text: text, style: style
];
};
GetText:
PUBLIC
PROC [widget: TextWidget]
RETURNS [
ROPE] = {
RETURN [XTkLabels.GetText[widget]]
};
SetText:
PUBLIC
PROC [widget: TextWidget, text:
ROPE, repaint: RepaintMode ¬ immediately] = {
XTkLabels.SetText[widget, text, repaint]
};
SetFont:
PUBLIC
PROC [widget: TextWidget, font: Xl.Font, repaint: RepaintMode ¬ immediately] = {
XTkLabels.SetStyleSpec[widget, [font: font], repaint]
};
SetStyleKey:
PUBLIC
PROC [widget: TextWidget, style:
ATOM, repaint: RepaintMode ¬ immediately] = {
XTkLabels.SetStyleKey[widget, style, repaint]
};
CreateButton:
PUBLIC
PROC [widgetSpec: WidgetSpec, text: Rope.
ROPE ¬
NIL, style: StyleSpec, hitProc: ButtonHitProcType, registerData, callData:
REF ¬
NIL, tq:
TQ ¬
NIL, help: Rope.
ROPE ¬
NIL]
RETURNS [widget: Widget] = {
widget ¬ XTkButtons.CreateButton[
widgetSpec: widgetSpec,
text: text, style: style,
hitProc: hitProc, registerData: registerData, callData: callData, hitTQ: tq,
help: help
];
};
CreateField:
PUBLIC
PROC [widgetSpec: WidgetSpec ¬ [], text: Rope.
ROPE ¬
NIL, style: StyleSpec ¬ []]
RETURNS [TextWidget] = {
RETURN [XTkFields.CreateField[
widgetSpec: widgetSpec,
text: text, style: style
]];
};
CreateLabeledField:
PUBLIC
PROC [widgetSpec: WidgetSpec ¬ [], label, init:
ROPE ¬
NIL, style: StyleSpec ¬ [], labelWidth, fieldWidth:
INT ¬ 0]
RETURNS [TextWidget] = {
RETURN [XTkFields.CreateLabeledField[
widgetSpec: widgetSpec,
label: label, init: init, style: style,
labelWidth: labelWidth, fieldWidth: fieldWidth
]];
CreateStreamWidget:
PUBLIC PROC [widgetSpec: XTk.WidgetSpec ¬ [], widgetStream:
IO.
STREAM ¬
NIL]
RETURNS [XTk.Widget] = {
RETURN [XTkStreamWidgets.CreateStreamWidget[widgetSpec, widgetStream]]
};
CreateStream:
PUBLIC PROC [w: XTk.Widget ¬
NIL]
RETURNS [widgetStream:
IO.
STREAM] = {
RETURN [XTkStreamWidgets.CreateStream[w]]
};
BindStream:
PUBLIC PROC [w: XTk.Widget, widgetStream:
IO.
STREAM] = {
XTkStreamWidgets.BindStream[w, widgetStream]
};
-- Shells
CreateShell:
PUBLIC PROC [widgetSpec: WidgetSpec ¬ [], child: Widget ¬
NIL, windowHeader:
ROPE ¬
NIL, iconName:
ROPE ¬
NIL, className:
ATOM ¬
NIL, packageName:
ROPE ¬
NIL, shortName:
ROPE ¬
NIL, rootTQ:
TQ ¬
NIL, dontQueryGeometry:
BOOL ¬
FALSE, deletionProtocol:
BOOL ¬
TRUE, focusProtocol:
BOOL ¬
TRUE, standardMigration:
BOOL]
RETURNS [ShellWidget] = {
RETURN [XTkShellWidgets.CreateShell[widgetSpec, child, windowHeader, iconName, className, packageName, shortName, rootTQ, dontQueryGeometry, deletionProtocol, focusProtocol, standardMigration]]
};
BindScreenShell:
PUBLIC
PROC [shell: ShellWidget, connection:
REF ¬
NIL, parentWindow: Xl.Window ¬ Xl.nullWindow] = {
XTkShellWidgets.BindScreenShell[shell, connection, parentWindow]
};
RegisterCallWMDeleteWindow:
PUBLIC
PROC [shell: ShellWidget, proc: WidgetNotifyProc, registerData:
REF ¬
NIL] = {
XTkShellWidgets.RegisterCallWMDeleteWindow[shell, proc, registerData]
};
RegisterCallConnectionDied:
PUBLIC
PROC [shell: ShellWidget, proc: WidgetNotifyProc, registerData:
REF ¬
NIL] = {
XTkShellWidgets.RegisterCallConnectionDied[shell, proc, registerData]
};
RegisterCallWindowDied:
PUBLIC
PROC [shell: ShellWidget, proc: WidgetNotifyProc, registerData:
REF ¬
NIL] = {
XTkShellWidgets.RegisterCallWindowDied[shell, proc, registerData]
};
SetShellChild:
PUBLIC
PROC [shell: ShellWidget, child: Widget] = {
XTkShellWidgets.SetShellChild[shell, child];
};
ForkRealizeShell:
PUBLIC
PROC [shell: ShellWidget, geometry: Xl.Geometry ¬ [], mapping: XTk.Mapping ¬ mapped, reConsiderChildren:
BOOL ¬
TRUE] = {
XTkShellWidgets.ForkRealizeShell[shell, geometry, mapping, reConsiderChildren]
};
RealizeShell:
PUBLIC
PROC [shell: ShellWidget, geometry: Xl.Geometry ¬ [], mapping: XTk.Mapping ¬ mapped, reConsiderChildren:
BOOL ¬
TRUE] = {
XTkShellWidgets.RealizeShell[shell, geometry, mapping, reConsiderChildren];
};
ForgetScreenShell:
PUBLIC
PROC [shell: ShellWidget] = {
XTkShellWidgets.ForgetScreenShell[shell];
};
DestroyShell:
PUBLIC
PROC [shell: ShellWidget] = {
XTkShellWidgets.DestroyShell[shell];
};
SetFocusMethod:
PUBLIC
PROC [shell: ShellWidget, focusProtocol, inputHint: Xl.
BOOL3] = {
XTkShellWidgets.SetFocusMethod[shell, focusProtocol, inputHint];
};
SetFocus:
PUBLIC
PROC [shell: ShellWidget, time: Xl.TimeStamp, child:
REF ¬
NIL] = {
XTkShellWidgets.SetFocus[shell, time, child];
};
SetFocusTarget:
PUBLIC
PROC [shell: ShellWidget, child:
REF ¬
NIL, time: Xl.TimeStamp ¬ [0]] = {
XTkShellWidgets.SetFocusTarget[shell, child, time];
};
FocusTime:
PUBLIC
PROC [shell: ShellWidget]
RETURNS [Xl.TimeStamp] = {
RETURN [XTkShellWidgets.FocusTime[shell]];
};
OpenIcon:
PUBLIC
PROC [shell: ShellWidget] = {
XTkShellWidgets.OpenIcon[shell];
};
Iconify:
PUBLIC
PROC [shell: ShellWidget] = {
XTkShellWidgets.Iconify[shell];
};
WithDraw:
PUBLIC
PROC [shell: ShellWidget] = {
XTkShellWidgets.WithDraw[shell];
};
TrackColorMap:
PUBLIC
PROC [shell: ShellWidget, w: Widget] = {
XTkShellWidgets.TrackColorMap[shell, w];
};
GetHints:
PUBLIC
PROC [shell: ShellWidget]
RETURNS [
REF ICCCMHints] = {
RETURN [XTkShellWidgets.GetHints[shell]]
};
UpdateHints:
PUBLIC
PROC [shell: ShellWidget] = {
XTkShellWidgets.UpdateHints[shell]
};
CreateInteroperabilityShell:
PUBLIC
PROC [widgetSpec: WidgetSpec ¬ [], child: Widget ¬
NIL, className:
ATOM ¬
NIL, rootTQ: Xl.
TQ ¬
NIL ]
RETURNS [ShellWidget] = {
RETURN [XTkShellWidgets.CreateInteroperabilityShell[widgetSpec, child, className, rootTQ]]
};
BindInteroperabilityShell:
PUBLIC
PROC [shell: ShellWidget, connection: Xl.Connection, foreignParent: Xl.Window] = {
XTkShellWidgets.BindInteroperabilityShell[shell, connection, foreignParent];
};
CurrentChoice:
PUBLIC PROC [widget: ChoiceWidget]
RETURNS [
REF
ANY] = {
RETURN [XTkChoiceWidgets.CurrentChoice[widget]]
};
Choose:
PUBLIC PROC [widget: ChoiceWidget, ce: ChoiceElement] = {
XTkChoiceWidgets.Choose[widget, ce]
};
CreateChoices:
PUBLIC PROC [widgetSpec: WidgetSpec ¬ [], choices: ChoiceList, horizontal:
BOOL ¬
TRUE, hitProc: XTk.WidgetNotifyProc ¬
NIL, registerData:
REF ¬
NIL, tq:
TQ ¬
NIL, style: StyleSpec ¬ []]
RETURNS [ChoiceWidget] = {
RETURN [XTkChoiceWidgets.CreateChoices[
widgetSpec: widgetSpec, choices: choices, horizontal: horizontal,
hitProc: hitProc, registerData: registerData, tq: tq,
style: style
]]
};
CreateToggle:
PUBLIC PROC [widgetSpec: WidgetSpec ¬ [], choices: ChoiceList, hitProc: XTk.WidgetNotifyProc ¬
NIL, registerData:
REF ¬
NIL, tq:
TQ ¬
NIL, style: StyleSpec ¬ []]
RETURNS [ChoiceWidget] = {
RETURN [XTkChoiceWidgets.CreateToggle[
widgetSpec: widgetSpec, choices: choices,
hitProc: hitProc, registerData: registerData, tq: tq,
style: style
]]
};
END.