DIRECTORY NSString USING [String], Rope USING [ROPE]; XMessage: CEDAR DEFINITIONS = BEGIN ROPE: TYPE ~ Rope.ROPE; ClientData: TYPE = REF; DestroyMsgsProc: TYPE = PROCEDURE [clientData: ClientData]; Handle: TYPE = REF Object; Object: TYPE; MsgID: TYPE = CARDINAL; MsgKey: TYPE = CARDINAL; MsgKeyList: TYPE = RECORD [ data: SEQUENCE length: CARDINAL OF MsgKey]; StringArray: TYPE = RECORD [ data: SEQUENCE length: CARDINAL OF NSString.String]; Messages: TYPE = RECORD [ data: SEQUENCE length: CARDINAL OF MsgEntry]; MsgEntry: TYPE = RECORD [ msgKey: MsgKey, -- runtime mesage access handle msg: NSString.String, -- message body translationNote: NSString.String _ NIL, -- special instructions to the translators translatable: BOOLEAN _ TRUE, -- IF FALSE do not translate type: MsgType _ userMsg, -- assertion as to who the client is id: MsgID]; -- unique handle for the life time of message MsgType: TYPE = {userMsg, template, argList, menuItem, pSheetItem, commandItem, errorMsg, infoMsg, promptItem, windowMenuCommand, others}; Error: ERROR [type: ErrorType]; ErrorType: TYPE = {arrayMismatch, invalidMsgKeyList, invalidStringArray, invalidString, notEnoughArguments}; Get: PROCEDURE [h: Handle, msgKey: MsgKey] RETURNS [msg: NSString.String]; GetList: PROCEDURE [h: Handle, msgKeys: REF MsgKeyList, msgs: REF StringArray]; Compose: PROCEDURE [source: NSString.String, args: REF StringArray] RETURNS [NSString.String]; ComposeOne: PROCEDURE [source: NSString.String, arg: NSString.String] RETURNS [NSString.String]; Decompose: PROCEDURE [source: NSString.String] RETURNS [args: REF StringArray]; AllocateMessages: PROCEDURE [applicationName: NSString.String, maxMessages: CARDINAL, clientData: ClientData, proc: DestroyMsgsProc] RETURNS [h: Handle]; DestroyMessages:PROCEDURE [h: Handle]; RegisterMessages: PROCEDURE [h: Handle, messages: REF Messages, stringBodiesAreReal: BOOL]; MessagesFromFile: PROCEDURE [fileName: ROPE, clientData: ClientData, proc: DestroyMsgsProc] RETURNS [msgDomains: REF MsgDomains]; MsgDomains: TYPE = RECORD [ data: SEQUENCE length: CARDINAL OF MsgDomain]; MsgDomain: TYPE = RECORD [applicationName: NSString.String, handle: Handle]; FreeMsgDomainsStorage: PROCEDURE [msgDomains: REF MsgDomains]; MessagesFromReference: PROCEDURE [file: ROPE, clientData: ClientData, proc: DestroyMsgsProc] RETURNS [msgDomains: REF MsgDomains]; END. -- of Message <File: XMessage.mesa - last edit: Copyright (C) 1984, 1986 by Xerox Corporation Tim Diebert: November 24, 1986 3:42:17 pm PST Types Operations for obtaining messages Returns message corresponding to the given msgKey. Fills the client-supplied array with the requested messages. Operations for inserting/extracting arguments into a message template composes a message consisting of the passed message template and inserted arguments.* Add a single argument to a message template. Template has no numbered argument, e.g., "The <> field should be filled in". Returns an array of strings that resulted from parsing the supplied source.* Message initialization operations allocates and initializes a data structure for subsequent message registry and access. The DestroyMsgsProc is used when the message data structure is to be destroyed (unloading Tool or application). deletes all the messages in currently registered (by calling the registered DestroyMsgProc) and then destroys any private data structures. Allows a client to initialize a range of messages. If the value of BOOLEAN stringBodiesAreReal is TRUE it indicates to the implementor of RegisterMessages that it is ok to use the pointer messages[n].msg in your private data structures. If this BOOLEAN = FALSE then the string body must be copied if its value is to be retained after the call. Message initialization from a file MessagesFromFile will look in the system files for a file named fileName or filename.messages. The return parameter msgDomains will contain an entry for message domain in the message file. It should be freed using the operation FreeMsgDomainsStorage. MessagesFromReference will get the messages from file. The return parameter msgDomains will contain an entry for message domain in the message file. It should be freed using the operation FreeMsgDomainsStorage. Ê‚˜codešœ ™ Kšœ-™-K™-—K˜šÏk ˜ Kšœ œ ˜Kšœœœ˜K˜—KšÏnœœ œ˜$K˜Kšœ™˜Kšœœœ˜K˜Kšœ œœ˜Kšœœ œ˜;K˜Kšœœœ ˜Kšœœ˜ K˜Kšœœœ˜Kšœœœ˜Kš œ œœ œ œœ ˜GKš œ œœ œ œœ˜QKš œ œœ œ œœ ˜Gšœ œœ˜KšœÏc˜0KšœŸ˜&Kšœ#œŸ*˜RKšœœœŸ˜:KšœŸ$˜=KšœŸ-˜;—K˜Kšœ œ}˜ŠKšžœœ˜Kšœ œ]˜lK˜—Kšœ!™!˜šžœ œœ˜JKšœ2™2—K˜šžœ œœœ˜OKšœ<™—˜š žœ œœ1œœ ˜‚KšœÒ™ÒK˜——K˜KšœŸ ˜—…— j(