------------------------------------------------------------------ -- -- NAME: INQ_PRIMITIVE_ATTRIBUTES -- DISCREPANCY REPORTS: -- ------------------------------------------------------------------ -- file: inq_prim_attr_b.ada -- level: all levels with GKS_OPERATING_STATE_LIST; with GKS_ERRORS; with GKS_STATE_LIST; use GKS_OPERATING_STATE_LIST; use GKS_ERRORS; package body INQ_PRIMITIVE_ATTRIBUTES is -- This is the package body for inquiring the primitive -- attribute values. -- -- Each of the procedures in this package inquires the -- GKS_OPERATING_STATE_LIST to check if GKS is in one -- of the states GKOP, WSOP, WSAC, or SGOP. If it is not, -- error indicator 8 occurs but no exception is raised. procedure INQ_CHAR_HEIGHT (ERROR_INDICATOR : out ERROR_NUMBER; HEIGHT : out WC.MAGNITUDE) is -- This procedure inquires the GKS_STATE_LIST to obtain the -- value of the current character height. If the inquired infor- -- mation is available, the error indicator is returned as 0 and -- the value is returned. -- -- ERROR_INDICATOR - This is the error indicator. Its numeric value -- represents -- the type of error, if any, that occurred. -- HEIGHT - This is the nominal height of the capital letter -- character. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 HEIGHT := 1.0; else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 HEIGHT := GKS_STATE_LIST.CURRENT_CHAR_HEIGHT; end if; end INQ_CHAR_HEIGHT; procedure INQ_CHAR_UP_VECTOR (ERROR_INDICATOR : out ERROR_NUMBER; VECTOR : out WC.VECTOR) is -- This procedure inquires the GKS_STATE_LIST to obtain the -- value of the current character up vector. If the inquired -- information is available, the error indicator is returned as 0 -- and the value is returned. -- -- ERROR_INDICATOR - This is the error indicator. Its numeric value -- represents -- the type of error, if any, that occurred. -- VECTOR - Indicates the up direction of the character. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 VECTOR := (0.0,0.0); else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 VECTOR := GKS_STATE_LIST.CURRENT_CHAR_UP_VECTOR; end if; end INQ_CHAR_UP_VECTOR; procedure INQ_TEXT_PATH (ERROR_INDICATOR : out ERROR_NUMBER; PATH : out TEXT_PATH) is -- This procedure inquires the GKS_STATE_LIST to obtain the -- value of the current text path. If the inquired information -- is available, the error indicator is returned as 0 and the -- value is returned. -- -- ERROR_INDICATOR - This is the error indicator. Its numeric value -- represents -- the type of error, if any, that occurred. -- PATH - Indicates the direction taken by the text string. It may -- be RIGHT, LEFT, UP, or DOWN. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 PATH := TEXT_PATH'FIRST; else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 PATH := GKS_STATE_LIST.CURRENT_TEXT_PATH; end if; end INQ_TEXT_PATH; procedure INQ_TEXT_ALIGNMENT (ERROR_INDICATOR : out ERROR_NUMBER; ALIGNMENT : out TEXT_ALIGNMENT) is -- This procedure inquires the GKS_STATE_LIST to obtain the -- value of the current text alignment. If the inquired infor- -- mation is available, the error indicator is returned as 0 and -- the value is returned. -- -- ERROR_INDICATOR - This is the error indicator. Its numeric value -- represents -- the type of error, if any, that occurred. -- ALIGNMENT - Indicates the positioning of the text extent -- rectangle in relation to the text position. It is a -- record with a HORIZONTAL component and a VERTICAL -- component. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 ALIGNMENT := (NORMAL,NORMAL); else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 ALIGNMENT := GKS_STATE_LIST.CURRENT_TEXT_ALIGNMENT; end if; end INQ_TEXT_ALIGNMENT; procedure INQ_PATTERN_REFERENCE_POINT (ERROR_INDICATOR : out ERROR_NUMBER; REFERENCE_POINT : out WC.POINT) is -- This procedure inquires the GKS_STATE_LIST to obtain the -- value of the current pattern reference point. If the inquired -- information is available, the error indicator is returned as 0 -- and the value is returned. -- -- ERROR_INDICATOR - This is the error indicator. Its numeric value -- represents -- the type of error, if any, that occurred. -- REFERENCE_POINT - This is the world coordinate point giving the -- position for the start of the pattern. It is a record type -- with X and Y components. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 REFERENCE_POINT := (0.0,0.0); else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 REFERENCE_POINT := GKS_STATE_LIST. CURRENT_PATTERN_REFERENCE_POINT; end if; end INQ_PATTERN_REFERENCE_POINT; procedure INQ_PATTERN_HEIGHT_VECTOR (ERROR_INDICATOR : out ERROR_NUMBER; VECTOR : out WC.VECTOR) is -- This procedure inquires the GKS_STATE_LIST to obtain the -- value of the current pattern height vector. If the inquired -- information is available, the error indicator is returned as 0 -- and the value is returned. -- -- ERROR_INDICATOR - This is the error indicator. Its numeric value -- represents -- the type of error, if any, that occurred. -- VECTOR - Indicates the pattern height vector. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 VECTOR := (0.0,0.0); else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 VECTOR := GKS_STATE_LIST.CURRENT_PATTERN_HEIGHT_VECTOR; end if; end INQ_PATTERN_HEIGHT_VECTOR; procedure INQ_PATTERN_WIDTH_VECTOR (ERROR_INDICATOR : out ERROR_NUMBER; WIDTH : out WC.VECTOR) is -- This procedure inquires the GKS_STATE_LIST to obtain the -- value of the current pattern width vector. If the inquired -- information is available, the error indicator is returned as 0 -- and the value is returned. -- -- ERROR_INDICATOR - This is the error indicator. Its numeric value -- represents -- the type of error, if any, that occurred. -- WIDTH - This is a vector in world coordinates describing the -- pattern width. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 WIDTH := (0.0,0.0); else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 WIDTH := GKS_STATE_LIST.CURRENT_PATTERN_WIDTH_VECTOR; end if; end INQ_PATTERN_WIDTH_VECTOR; procedure INQ_CHAR_WIDTH (ERROR_INDICATOR : out ERROR_NUMBER; WIDTH : out WC.MAGNITUDE) is -- This procedure inquires the GKS_STATE_LIST to obtain the -- value of the current character nominal width. If the inquired -- information is available, the error indicator is returned as 0 -- and the value is returned. -- -- ERROR_INDICATOR - This is the error indicator. Its numeric value -- represents -- the type of error, if any, that occurred. -- WIDTH - Indicates the nominal width of characters. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 WIDTH := 1.0; else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 WIDTH := GKS_STATE_LIST.CURRENT_CHAR_WIDTH; end if; end INQ_CHAR_WIDTH; procedure INQ_CHAR_BASE_VECTOR (ERROR_INDICATOR : out ERROR_NUMBER; VECTOR : out WC.VECTOR) is -- This procedure inquires the GKS_STATE_LIST to obtain the -- value of the current character base vector. If the inquired -- information is available, the error indicator is returned as 0 -- and the value is returned. -- -- ERROR_INDICATOR - This is the error indicator. Its numeric value -- represents -- the type of error, if any, that occurred. -- VECTOR - Indicates the character base vector in world coordinates. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 VECTOR := (0.0,0.0); else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 VECTOR := GKS_STATE_LIST.CURRENT_CHAR_BASE_VECTOR; end if; end INQ_CHAR_BASE_VECTOR; procedure INQ_CURRENT_PRIMITIVE_ATTRIBUTE_VALUES (ERROR_INDICATOR : out ERROR_NUMBER; ATTRIBUTES : out PRIMITIVE_ATTRIBUTE_VALUES) is -- This procedure returns the primitive attributes in a single -- record rather than calling several procedures. -- The values returned by the procedure include: -- the current polyline index -- the current polymarker index -- the current text index -- the current character height -- the current character up vector -- the current character width -- the current character base vector -- the current text path -- the current text alignment -- the current fill area index -- the current pattern width vector -- the current pattern height vector -- the current pattern reference point -- which are contained in the record PRIMITIVE_ATTRIBUTES. -- If the inquired information is available, the error indicator -- is returned as 0 and the value is returned. -- -- ATTRIBUTES - This record contains the values for the current -- primitive attributes and the bundle indices as described -- above. begin -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then ERROR_INDICATOR := NOT_GKOP_WSOP_WSAC_SGOP; -- Error 8 ATTRIBUTES.INDEX_POLYLINE := POLYLINE_INDEX'FIRST; ATTRIBUTES.INDEX_POLYMARKER := POLYMARKER_INDEX'FIRST; ATTRIBUTES.INDEX_TEXT := TEXT_INDEX'FIRST; ATTRIBUTES.CHAR_HEIGHT := 0.01; ATTRIBUTES.CHAR_UP_VECTOR := (0.0,0.0); ATTRIBUTES.CHAR_WIDTH := 0.01; ATTRIBUTES.CHAR_BASE_VECTOR := (0.0,0.0); ATTRIBUTES.PATH := TEXT_PATH'FIRST; ATTRIBUTES.ALIGNMENT := (NORMAL,NORMAL); ATTRIBUTES.INDEX_FILL_AREA := FILL_AREA_INDEX'FIRST; ATTRIBUTES.PATTERN_WIDTH_VECTOR := (0.0,0.0); ATTRIBUTES.PATTERN_HEIGHT_VECTOR := (0.0,0.0); ATTRIBUTES.PATTERN_REFERENCE_POINT := (0.0,0.0); else ERROR_INDICATOR := SUCCESSFUL; -- Error 0 ATTRIBUTES.INDEX_POLYLINE := GKS_STATE_LIST. CURRENT_POLYLINE_INDEX; ATTRIBUTES.INDEX_POLYMARKER := GKS_STATE_LIST. CURRENT_POLYMARKER_INDEX; ATTRIBUTES.INDEX_TEXT := GKS_STATE_LIST. CURRENT_TEXT_INDEX; ATTRIBUTES.CHAR_HEIGHT := GKS_STATE_LIST. CURRENT_CHAR_HEIGHT; ATTRIBUTES.CHAR_UP_VECTOR := GKS_STATE_LIST. CURRENT_CHAR_UP_VECTOR; ATTRIBUTES.CHAR_WIDTH := GKS_STATE_LIST. CURRENT_CHAR_WIDTH; ATTRIBUTES.CHAR_BASE_VECTOR := GKS_STATE_LIST. CURRENT_CHAR_BASE_VECTOR; ATTRIBUTES.PATH := GKS_STATE_LIST. CURRENT_TEXT_PATH; ATTRIBUTES.ALIGNMENT := GKS_STATE_LIST. CURRENT_TEXT_ALIGNMENT; ATTRIBUTES.INDEX_FILL_AREA := GKS_STATE_LIST. CURRENT_FILL_AREA_INDEX; ATTRIBUTES.PATTERN_WIDTH_VECTOR := GKS_STATE_LIST. CURRENT_PATTERN_WIDTH_VECTOR; ATTRIBUTES.PATTERN_HEIGHT_VECTOR := GKS_STATE_LIST. CURRENT_PATTERN_HEIGHT_VECTOR; ATTRIBUTES.PATTERN_REFERENCE_POINT := GKS_STATE_LIST. CURRENT_PATTERN_REFERENCE_POINT; end if; end INQ_CURRENT_PRIMITIVE_ATTRIBUTE_VALUES; end INQ_PRIMITIVE_ATTRIBUTES;