;;; -*- Mode:Common-Lisp; Package:GLOSS; Fonts:(COURIER HL12B HL12BI); Base:10 -*-

;1;;                           RESTRICTED RIGHTS LEGEND*

;1;;Use, duplication, or disclosure by the Government is subject to*
;1;;restrictions as set forth in subdivision (b)(3)(ii) of the Rights in*
;1;;Technical Data and Computer Software clause at 52.227-7013.*
;1;;*
;1;;                     TEXAS INSTRUMENTS INCORPORATED.*
;1;;                              P.O. BOX 2909*
;1;;                           AUSTIN, TEXAS 78769*
;1;;                                 MS 2151*
;1;;*
;1;; Copyright (C) 1984,1987 Texas Instruments Incorporated. All rights reserved.*

;1;;This file contains misc. macros (many via defstructs) that make the internals*
;1;;of the glossary more understandable/flexible*

(DEFSTRUCT (text-line (:type :list*)	   ;1Use list* to remain compatible with earlier version*
		      (:conc-name text-line-))
  "This is a line of text in a glossary entry.
  A glossary entry consists of a list of text-lines."
  string      ;1The actual text for this line of the entry*
  xref-list   ;1The list of cross references for this line of the entry*
) 

(DEFSTRUCT (xref (:type :list)
		 (:conc-name xref-))
  "This is a cross reference within a glossary entry"
  start-index	     ;1The starting position of the entry name in the text*
  end-index	     ;1The ending position of the entry name in the text*
  entry-object)	     ;1The actual entry object that is being xref'd to*

(DEFSTRUCT (menu-item (:type :list)
		      (:conc-name menu-item-))
  "An element of a menu-item-list"
  display-string     ;1The string that is displayed in the menu*
  (keyword :value)   ;1The keyword used in the menu item*
  value	             ;1The argument value of the menu item*
  (documentation-keyword :documentation)     ;1Always the same*
  (documentation "Click here to select this menu item.")	     ;1The wholine documentation*
  (font-keyword :font)	     ;1Always the same*
  (font nil) ;1Use the default font for the entry by default*
  )	

(DEFMACRO command-menu-item (display-string message doc-string)
  "2Macro used to define menu items for the command menu. (primarily for glossary tools.).*"
  (DECLARE (SPECIAL *command-menu-alt-font*))
  `(QUOTE
     (,display-string :eval (SEND *glossary-frame* ,message)
      :documentation ,doc-string
      :font ,*command-menu-alt-font*)))  

(DEFSTRUCT (name-item (:type :list)
		      (:conc-name name-item-))
  "This is one type of line in the text pane"
  (keyword :name)
  name	     ;1A string*
  entry	     ;1The actual glossary entry object*
  )

(DEFSTRUCT (text-item (:type :list)
		      (:conc-name text-item-))
  "The text of a glossary entry that is displayed"
  (keyword :text)
  text	     ;1A text-line (defined above)*
  entry	     ;1The glossary entry object this line of text belongs to*
  (line-number 0)    ;1The number of the line within the entry (starting with 0)*
  )

(DEFSTRUCT (mouse-xref (:type :list)
		       (:conc-name mouse-xref-)
		       :named
		       :predicate)
  "The cross reference that is mouse selected and returned from the text display list."
  entry-object	     ;1The glossary entry object that was selected.*
  xref	             ;1The xref structure (above) that defines this xref entry*
  text-line          ;1The text-line (above)  this entry was selected from.*
  )  

