<<>> <> <> <> <> <> <> <> <<>> DIRECTORY Rope, ViewerClasses, EBTypes; EmbeddedButtons: CEDAR DEFINITIONS = BEGIN ActiveButton: TYPE = EBTypes.ActiveButton; ActiveDoc: TYPE = EBTypes.ActiveDoc; ButtonInfo: TYPE = EBTypes.ButtonInfo; EBLanguageProc: TYPE = EBTypes.EBLanguageProc; ROPE: TYPE = Rope.ROPE; Viewer: TYPE = ViewerClasses.Viewer; <> <> <> <> <> <> <> <> Error: PROC [screenMessage: ROPE, fileMessage: ROPE ¬ NIL]; <> <> <<(1) To make an EmbeddedButtons application that is available from all active documents, simply register a new procedure by calling EBApplications.RegisterApplication (see below).>> <<(2) To use an active document as the control panel for a particular application, running in a particular window, link the window to the active document using LinkDocToApplication below.>> <> <> <> <<(1) The "buttonInfo" argument describes the button that was pressed and the document that the button is in. Usually, this argument can be ignored.>> <<(2) The "events" argument comes from the button itself, describing that entry in the "Menu" or "UpClickMessage" fields that was triggered by the current button click. Often application procedures will use these arguments to parameterize their behavior.>> <<(3) The targetViewer describes the viewer that the pressed button is linked to. This value will be NIL unless LinkDocToApplication has been performed on the active document containing this button.>> <<(4) The applicationData field contains that data that was provided by the LinkDocToApplication call, if any, that linked this document to an application. If this document is not acting as an application control panel, this field will be NIL.>> <> <> <> <> <> NotifyProc: TYPE = PROC [buttonInfo: ButtonInfo, events: LIST OF REF ANY, targetViewer: Viewer, applicationData: REF] RETURNS [result: REF ¬ NIL]; RegisteredNotifyProc: TYPE = PROC [events: LIST OF REF ANY, buttonInfo: ButtonInfo] RETURNS [result: REF ¬ NIL]; <> LinkDocToApplication: PROC [doc: ActiveDoc, target: ATOM, targetViewer: Viewer ¬ NIL, applicationData: REF ¬ NIL, notifyProc: NotifyProc ¬ NIL]; <> <<>> RegisterApplication: PROC [target: ATOM, notifyProc: RegisteredNotifyProc]; <> <<>> RegisterPoppyProc: PROC [procedureName: ATOM, proc: EBLanguageProc, interpreted: BOOL ¬ TRUE]; <. For example, the SetCursor routine is often called in Poppy feedback statements as: (MouseMotion ).>> <<>> PassEventToApplication: PROC[event: LIST OF REF ANY, buttonInfo: ButtonInfo, application: ATOM ¬ $MessageHandlers]; <> <> <<>> GetApplications: PROC[buttonInfo: ButtonInfo] RETURNS [applications: LIST OF ATOM]; < command. If a MessageHandler field is provided, messages go to the applications listed in that field. If no application exists, GetApplications returns NIL.>> <> <> <<>> GetFieldRope: PROC [key: ATOM, buttonInfo: ButtonInfo] RETURNS [rope: ROPE]; <> <<>> GetFieldAtom: PROC [key: ATOM, buttonInfo: ButtonInfo] RETURNS [atom: ATOM]; <> <<>> GetFieldRef: PROC [key: ATOM, buttonInfo: ButtonInfo] RETURNS [ref: REF]; <> <<>> SetFieldRope: PROC [key: ATOM, rope: ROPE, buttonInfo: ButtonInfo]; <> <<>> SetFieldAtom: PROC [key: ATOM, atom: ATOM, buttonInfo: ButtonInfo]; <> <<>> SetFieldRef: PROC [key: ATOM, ref: REF, buttonInfo: ButtonInfo]; <> <<>> GetButtonClass: PROC [buttonInfo: ButtonInfo] RETURNS [REF]; <> <<>> GetButtonName: PROC [buttonInfo: ButtonInfo] RETURNS [name: ATOM]; <> <> <> <<>> GetAtom: PROC [key: ATOM, buttonInfo: ButtonInfo] RETURNS [atom: ATOM]; <> SetAtom: PROC [key: ATOM, atom: ATOM, buttonInfo: ButtonInfo, edited: BOOL]; <> GetRope: PROC [key: ATOM, buttonInfo: ButtonInfo] RETURNS [rope: ROPE]; <> SetRope: PROC [key: ATOM, rope: ROPE, buttonInfo: ButtonInfo, edited: BOOL]; <> GetRef: PROC [key: ATOM, buttonInfo: ButtonInfo] RETURNS [ref: REF]; <> SetRef: PROC [key: ATOM, ref: REF, buttonInfo: ButtonInfo, edited: BOOL]; <> GetText: PROC [buttonInfo: ButtonInfo] RETURNS [text: ROPE]; <> GetDocName: PROC [buttonInfo: ButtonInfo] RETURNS [name: ROPE]; <> LookUpActiveDoc: PROC [viewer: Viewer] RETURNS [doc: ActiveDoc]; <> <<>> <> <<>> FeedbackNotify: PROC [feedbackEvent: LIST OF REF ANY, buttonInfo: ButtonInfo]; <> <<>> InButton: PROC [x, y: INTEGER, buttonInfo: ButtonInfo] RETURNS[BOOL]; <> <<>> EachButtonProc: TYPE = PROC [button: ActiveButton, doc: ActiveDoc] RETURNS [done: BOOL ¬ FALSE]; MapButtons: PROC [doc: ActiveDoc, proc: EachButtonProc] RETURNS [aborted: BOOL ¬ FALSE]; <> <