GGStateImpl.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last edited by Bier on March 4, 1987 4:40:22 pm PST
Contents: Routines for getting and setting values in the Gargoyle user interface state.
DIRECTORY
AtomButtons, GGInterfaceTypes, GGModelTypes, GGState;
GGStateImpl:
CEDAR
PROGRAM
IMPORTS AtomButtons
EXPORTS GGState =
BEGIN
ExtendMode: TYPE = GGModelTypes.ExtendMode;
GGData: TYPE = GGInterfaceTypes.GGData;
GravityType: TYPE = GGInterfaceTypes.GravityType;
SelectMode: TYPE = GGModelTypes.SelectMode;
GetShowColors:
PUBLIC
PROC [ggData: GGData]
RETURNS [
BOOL] = {
RETURN[AtomButtons.GetButtonState[ggData.refresh.showColors] = on];
};
SetShowColors:
PUBLIC
PROC [ggData: GGData, showColors:
BOOL] = {
AtomButtons.SetButtonState[ggData.refresh.showColors, IF showColors THEN on ELSE off];
};
GetGravityType:
PUBLIC
PROC [ggData: GGData]
RETURNS [gravityType: GravityType] = {
RETURN[ggData.hitTest.gravityType];
};
SetGravityType:
PUBLIC
PROC [ggData: GGData, gravityType: GravityType] = {
ggData.hitTest.gravityType ← gravityType;
};
Gravity:
PUBLIC
PROC [ggData: GGData]
RETURNS [
BOOL] = {
RETURN[AtomButtons.GetButtonState[ggData.hitTest.gravButton] = on];
};
SetGravity:
PUBLIC
PROC [ggData: GGData, gravityOn:
BOOL] = {
AtomButtons.SetButtonState[ggData.hitTest.gravButton, IF gravityOn THEN on ELSE off];
};
Midpoints:
PUBLIC
PROC [ggData: GGData]
RETURNS [
BOOL] = {
RETURN[AtomButtons.GetButtonState[ggData.hitTest.midpointButton] = on];
};
SetMidpoints:
PUBLIC
PROC [ggData: GGData, midpointsOn:
BOOL] = {
AtomButtons.SetButtonState[ggData.hitTest.midpointButton, IF midpointsOn THEN on ELSE off];
};
Heuristics:
PUBLIC
PROC [ggData: GGData]
RETURNS [
BOOL] = {
RETURN[AtomButtons.GetButtonState[ggData.hitTest.heuristicsButton] = on];
};
SetHeuristics:
PUBLIC
PROC [ggData: GGData, heuristicsOn:
BOOL] = {
AtomButtons.SetButtonState[ggData.hitTest.heuristicsButton, IF heuristicsOn THEN on ELSE off];
};
ShowAlignments:
PUBLIC
PROC [ggData: GGData]
RETURNS [
BOOL] = {
RETURN[NOT ggData.camera.hideAlignments];
};
SetShowAlignments:
PUBLIC
PROC [ggData: GGData, showAlignments:
BOOL] = {
ggData.camera.hideAlignments ← NOT showAlignments;
};
GetSelectMode:
PUBLIC
PROC [ggData: GGData]
RETURNS [selectMode: SelectMode] = {
RETURN[ggData.drag.selectState];
};
SetSelectMode:
PUBLIC
PROC [ggData: GGData, selectMode: SelectMode] = {
ggData.drag.selectState ← selectMode;
};
GetExtendMode:
PUBLIC
PROC [ggData: GGData]
RETURNS [extendMode: ExtendMode] = {
RETURN[ggData.drag.extendMode];
};
SetExtendMode:
PUBLIC
PROC [ggData: GGData, extendMode: ExtendMode] = {
ggData.drag.extendMode ← extendMode;
};
Debugging and Experiments
precomputeMidpoints: BOOL ← FALSE;
PrecomputeMidpoints:
PUBLIC
PROC []
RETURNS [
BOOL] = {
RETURN[precomputeMidpoints];
};
END.