------------------------------------------------------------------ -- -- NAME: SEGMENT_STATE_LIST_TYPES -- DISCREPANCY REPORTS: -- ------------------------------------------------------------------ -- File: SEG_ST_LST_TYP.ADA -- Level: 1a,2a,1b,2b,1c,2c with UNCHECKED_DEALLOCATION; with GKS_TYPES; with CGI; use GKS_TYPES; use CGI; package SEGMENT_STATE_LIST_TYPES is -- This package defines the data structures necessary for implementing -- segment storage. The data structures are designed to accomodate -- the basic operations on segments. These are dynamic creation of -- segments, Redraw segments from lowest priority to highest priority, -- and locating Picks from highest priority to lowest priority. -- -- To allow for easy dynamic creation of segments, access types are used -- for both the segment state list and segment components. -- The segment state lists are kept in an ordered doubly linked list -- according to segment priority so that Redraw and Pick operations -- are easily supported. -- -- The elements of a stored segment are appropriate CGI_INSTR's. -- This package also contains procedures and functions which -- perform operations on state list types and can be used by -- the Workstation drivers as well as the Workstation manager. type SEG_ELEMENT; type SEG_ELEMENT_PTR is access SEG_ELEMENT; -- The pointer used for linking CGI_INSTR's. type SEG_ELEMENT is record NEXT_ELEMENT: SEG_ELEMENT_PTR; ELEMENT: CGI.CGI_INSTR; end record; -- A linked list of CGI instructions. generic with procedure PROCESS_INSTR (INSTR : in out CGI . CGI_INSTR) is <>; procedure PROCESS_SEGMENT (SEGMENT_ELEMENT_PTR : in SEGMENT_STATE_LIST_TYPES . SEG_ELEMENT_PTR); type SEG_STATE_LIST; type SEG_STATE_LIST_PTR is access SEG_STATE_LIST; -- The pointer used for linking SEGMENT_STATE_LIST's. type SEG_STATE_LIST is record LOWER_PRIORITY_SEG, HIGHER_PRIORITY_SEG: SEG_STATE_LIST_PTR; -- points to the next lowest and highest in the link. FIRST_ELEMENT : SEG_ELEMENT_PTR; LAST_ELEMENT : SEG_ELEMENT_PTR; -- points to the first element to move though the list and the -- last element to add items quickly. SEG_NAME : SEGMENT_NAME; -- the segment name associated with all the following attributes. ASSOCIATED_WS : WS_IDS.LIST_OF := WS_IDS.NULL_LIST; -- the set of workstations on which the segment appears. SEG_TRANSFORMATION : TRANSFORMATION_MATRIX := ((1.0,0.0,0.0), (0.0,1.0,0.0)); -- the appropriate segment transformation. SEG_VISIBILITY : SEGMENT_VISIBILITY := VISIBLE; SEG_HIGHLIGHTING : SEGMENT_HIGHLIGHTING := NORMAL; SEG_PRIORITY : SEGMENT_PRIORITY := 0.0; SEG_DETECTABILITY : SEGMENT_DETECTABILITY := UNDETECTABLE; -- Attributes for the appearance of the segment. end record; -- The SEGMENT STATE LIST record contains all the segment -- attributes. It is a double linked list ordered lowest -- priority to highest. type LIST_OF_SEGMENT_STATE_LISTS is record LOW_PRIORITY_SEG : SEG_STATE_LIST_PTR:=NULL; HIGH_PRIORITY_SEG : SEG_STATE_LIST_PTR:=NULL; end record; -- The pointers to the doubly linked list mention above. -- Allows access to the doubly linked list by pointing to -- the segment state lists with the lowest and highest priority -- values. procedure FREE_SEGMENT_ELEMENT is new UNCHECKED_DEALLOCATION(SEG_ELEMENT,SEG_ELEMENT_PTR); procedure FREE_SEGMENT_STATE_LIST is new UNCHECKED_DEALLOCATION(SEG_STATE_LIST,SEG_STATE_LIST_PTR); function GET_SEGMENT_STATE_LIST (SEGMENT_LIST : in LIST_OF_SEGMENT_STATE_LISTS; SEGMENT : in SEGMENT_NAME) return SEG_STATE_LIST_PTR; procedure SEGMENT_PRIORITY_INSERT (SEGMENT_LIST : in out LIST_OF_SEGMENT_STATE_LISTS; SEG_INSERT_PTR : in SEG_STATE_LIST_PTR); procedure SEGMENT_PRIORITY_DELETE (SEGMENT_LIST : in out LIST_OF_SEGMENT_STATE_LISTS; SEGMENT : in SEGMENT_NAME; SEG_DELETE_PTR : out SEG_STATE_LIST_PTR); procedure DEALLOCATE_SEGMENT (SEGMENT_PTR : in out SEG_STATE_LIST_PTR); end SEGMENT_STATE_LIST_TYPES;