------------------------------------------------------------------ -- -- NAME: INQ_WS_STATE_LIST_1A - BODY -- DISCREPANCY REPORTS: ------------------------------------------------------------------ -- file: INQ_WS_ST_LST_B.ADA -- level: 1a, 2a with GKS_STATE_LIST; with CGI_SUBTYPES_A; with WSM; with GKS_OPERATING_STATE_LIST; with GKS_ERRORS; use CGI_SUBTYPES_A; use WSM; use GKS_OPERATING_STATE_LIST; use GKS_ERRORS; package body INQ_WS_STATE_LIST_1A is -- The package INQ_WS_STATE_LIST_1a contains procedures that inquire -- from the workstation state list. -- -- This package INQ_WS_STATE_LIST_1A contains procedures that check -- the operating state. If there are no workstations open, error #7 -- is returned via ERROR_INDICATOR. They also check the specified -- workstation. -- If it is not open, error #25 is returned via ERROR_INDICATOR. -- Otherwise, the -- WS_MANAGER is called. procedure INQ_LIST_OF_POLYLINE_INDICES (WS : in WS_ID; ERROR_INDICATOR : out ERROR_NUMBER; INDICES : out POLYLINE_INDICES.LIST_OF) is -- WS_MANAGER can detect errors #33, #35, and #36. If such an -- error occurs it is passed back to the application program -- via ERROR_INDICATOR. Otherwise the set of polyline indices is passed -- back with an ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation on which the -- polyline indices are being inquired. -- -- ERROR_INDICATOR - This is the error indicator. Its value represents -- the type of error, if any, that occurred. -- -- INDICES - This is the set of polyline indices. GKS_INSTR : CGI_INQ_LIST_OF_POLYLINE_INDICES; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 INDICES := POLYLINE_INDICES.NULL_LIST; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 INDICES := POLYLINE_INDICES.NULL_LIST; else -- Call the workstation manager with the workstation -- parameter. GKS_INSTR.WS_TO_INQ_LIST_OF_POLYLINE_INDICES := WS; WS_MANAGER(GKS_INSTR); ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return the information inquired. INDICES := GKS_INSTR.LIST_OF_POLYLINE_INDICES_INQ; end if; end INQ_LIST_OF_POLYLINE_INDICES; procedure INQ_POLYLINE_REPRESENTATION (WS : in WS_ID; INDEX : in POLYLINE_INDEX; RETURNED_VALUES : in RETURN_VALUE_TYPE; ERROR_INDICATOR : out ERROR_NUMBER; TYPE_OF_LINE : out LINETYPE; WIDTH : out LINEWIDTH; LINE_COLOUR : out COLOUR_INDEX) is -- WS_MANAGER can detect errors #33, #35, #36, and #61 -- If such an error occurs it is passed back to the application -- program via ERROR_INDICATOR. Otherwise the line type, linewidth scale -- factor, and the polyline colour index are returned with -- ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation on which the polyline -- representation is being inquired. -- -- INDEX - This is the identifier of the index into the set of -- polylines discerning which polyline representation is -- being inquired. -- -- RETURNED_VALUES - Indicates whether the returned values should -- as they were set by the program or as they were -- actually realized. -- -- ERROR_INDICATOR - This is the error indicator. Its value represents -- the type of error, if any, that occurred. -- -- TYPE_OF_LINE - This is the line type. -- -- WIDTH - This is the line width. -- -- LINE_COLOUR - This is the colour index. GKS_INSTR : CGI_INQ_POLYLINE_REPRESENTATION; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 TYPE_OF_LINE := LINETYPE'first; WIDTH := LINEWIDTH'first; LINE_COLOUR := COLOUR_INDEX'first; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 TYPE_OF_LINE := LINETYPE'first; WIDTH := LINEWIDTH'first; LINE_COLOUR := COLOUR_INDEX'first; else -- Call the workstation manager with the workstation -- parameter. GKS_INSTR.WS_TO_INQ_POLYLINE_REP := WS; GKS_INSTR.POLYLINE_INDEX_TO_INQ_POLYLINE_REP := INDEX; GKS_INSTR.RETURN_VALUES_TO_INQ_POLYLINE_REP := RETURNED_VALUES; WS_MANAGER(GKS_INSTR); ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return information inquired. TYPE_OF_LINE := GKS_INSTR.POLYLINE_TYPE_INQ; WIDTH := GKS_INSTR.POLYLINE_WIDTH_INQ; LINE_COLOUR := GKS_INSTR.POLYLINE_COLOUR_INQ; end if; end INQ_POLYLINE_REPRESENTATION; procedure INQ_LIST_OF_POLYMARKER_INDICES (WS : in WS_ID; ERROR_INDICATOR : out ERROR_NUMBER; INDICES : out POLYMARKER_INDICES.LIST_OF) is -- WS_MANAGER can detect errors #33, #35, and #36. -- If such an error occurs it is passed back to the application -- program via ERROR_INDICATOR. Otherwise the set of polymarker -- indices is passed -- back with an ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation on which the set of -- polymarker indices are being inquired. -- -- ERROR_INDICATOR - This is the error indicator. Its value represents -- the type of error, if any, that occurred. -- -- INDICES - This is the list of polymarker indices. GKS_INSTR : CGI_INQ_LIST_OF_POLYMARKER_INDICES; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 INDICES := POLYMARKER_INDICES.NULL_LIST; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 INDICES := POLYMARKER_INDICES.NULL_LIST; else -- Call workstation manager with parameters. GKS_INSTR.WS_TO_INQ_LIST_OF_POLYMARKER_INDICES := WS; WS_MANAGER(GKS_INSTR); ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return information inquired. INDICES := GKS_INSTR.LIST_OF_POLYMARKER_INDICES_INQ; end if; end INQ_LIST_OF_POLYMARKER_INDICES; procedure INQ_POLYMARKER_REPRESENTATION (WS : in WS_ID; INDEX : in POLYMARKER_INDEX; RETURNED_VALUES : in RETURN_VALUE_TYPE; ERROR_INDICATOR : out ERROR_NUMBER; TYPE_OF_MARKER : out MARKER_TYPE; SIZE : out MARKER_SIZE; MARKER_COLOUR : out COLOUR_INDEX) is -- The WS_MANAGER can detect errors #33, #35, #36, and #67. -- If such an error occurs it is passed back to the application -- program via ERROR_INDICATOR. Otherwise the marker type, marker -- size scale -- factor, and the polymarker colour index are returned with an -- ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation on which the -- polymarker representation is being inquired. -- -- INDEX - This is the identifier of the index into the list -- of polymarkers discerning which polymarker representation -- is being inquired. -- -- RETURNED_VALUES - Indicates whether the returned values should -- as they were set by the program or as they were -- actually realized. -- -- ERROR_INDICATOR - This is the error indicator. -- the type of error, if any, that occurred. -- -- TYPE_OF_MARKER - This is the marker type. -- -- SIZE - This is the marker size. -- -- MARKER_COLOUR - This is the marker colour. GKS_INSTR : CGI_INQ_POLYMARKER_REPRESENTATION; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 TYPE_OF_MARKER := MARKER_TYPE'first; SIZE := MARKER_SIZE'first; MARKER_COLOUR := COLOUR_INDEX'first; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 TYPE_OF_MARKER := MARKER_TYPE'first; SIZE := MARKER_SIZE'first; MARKER_COLOUR := COLOUR_INDEX'first; else -- Call the workstation manager with parameters. GKS_INSTR.WS_TO_INQ_POLYMARKER_REP := WS; GKS_INSTR.POLYMARKER_INDEX_TO_INQ_POLYMARKER_REP := INDEX; GKS_INSTR.RETURN_VALUES_TO_INQ_POLYMARKER_REP := RETURNED_VALUES; WS_MANAGER(GKS_INSTR); ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return information inquired. TYPE_OF_MARKER := GKS_INSTR.POLYMARKER_REP_TYPE_INQ; SIZE := GKS_INSTR.POLYMARKER_SIZE_INQ; MARKER_COLOUR := GKS_INSTR.POLYMARKER_COLOUR_INQ; end if; end INQ_POLYMARKER_REPRESENTATION; procedure INQ_LIST_OF_TEXT_INDICES (WS : in WS_ID; ERROR_INDICATOR : out ERROR_NUMBER; INDICES : out TEXT_INDICES.LIST_OF) is -- The WS_MANAGER can detect errors #33, #35, and #36. If such -- an error occurs it is passed back to the application program -- via ERROR_INDICATOR. Otherwise the set of text indices is passed -- back with -- an ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation on which the set of -- text indices is being inquired. -- -- ERROR_INDICATOR - This is the error indicator. Its value represents -- the type of error, if any, that occurred. -- -- INDICES - This is the list of text indices. GKS_INSTR : CGI_INQ_LIST_OF_TEXT_INDICES; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 INDICES := TEXT_INDICES.NULL_LIST; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 INDICES := TEXT_INDICES.NULL_LIST; else -- Call workstation manager with workstation parameter. GKS_INSTR.WS_TO_INQ_LIST_OF_TEXT_INDICES := WS; WS_MANAGER(GKS_INSTR); ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return information inquired. INDICES := GKS_INSTR.LIST_OF_TEXT_INDICES_INQ; end if; end INQ_LIST_OF_TEXT_INDICES; procedure INQ_TEXT_REPRESENTATION (WS : in WS_ID; INDEX : in TEXT_INDEX; RETURNED_VALUES : in RETURN_VALUE_TYPE; ERROR_INDICATOR : out ERROR_NUMBER; FONT_PRECISION : out TEXT_FONT_PRECISION; EXPANSION : out CHAR_EXPANSION; SPACING : out CHAR_SPACING; TEXT_COLOUR : out COLOUR_INDEX) is -- The WS_MANAGER can detect errors #33, #35, #36, and #73. -- If such an error occurs it is passed back to the application -- program via ERROR_INDICATOR. Otherwise the text font and precision, -- character expansion factor, character spacing, and text colour -- index are returned with an ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation on which the text -- representation is being inquired. -- -- INDEX -This is the identifier of the index into the set of -- text types discerning which text representation is being -- inquired. -- -- RETURNED_VALUES - Indicates whether the returned values should -- as they were set by the program or as they were -- actually realized. -- -- ERROR_INDICATOR - This is the error indicator. -- -- FONT_PRECISION - This is the font precision of the text -- representation. -- -- EXPANSION - This is the character expansion of the text -- representation. -- -- SPACING - This is the character spacing. -- -- TEXT_COLOUR - This is the colour of the text. GKS_INSTR : CGI_INQ_TEXT_REPRESENTATION; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 FONT_PRECISION := (FONT=>TEXT_FONT'first, PRECISION=>TEXT_PRECISION'first); EXPANSION := CHAR_EXPANSION'first; SPACING := CHAR_SPACING'first; TEXT_COLOUR := COLOUR_INDEX'first; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 FONT_PRECISION := (FONT=>TEXT_FONT'first, PRECISION=>TEXT_PRECISION'first); EXPANSION := CHAR_EXPANSION'first; SPACING := CHAR_SPACING'first; TEXT_COLOUR := COLOUR_INDEX'first; else -- Call workstation manager with parameters. GKS_INSTR.WS_TO_INQ_TEXT_REP := WS; GKS_INSTR.TEXT_INDEX_TO_INQ_TEXT_REP := INDEX; GKS_INSTR.RETURN_VALUES_TO_INQ_TEXT_REP := RETURNED_VALUES; WS_MANAGER(GKS_INSTR); -- Set error indicator. ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return information inquired. FONT_PRECISION := GKS_INSTR.TEXT_FONT_PRECISION_INQ; EXPANSION := GKS_INSTR.TEXT_CHAR_EXPANSION_INQ; SPACING := GKS_INSTR.TEXT_CHAR_SPACING_INQ; TEXT_COLOUR := GKS_INSTR.TEXT_COLOUR_INQ; end if; end INQ_TEXT_REPRESENTATION; procedure INQ_LIST_OF_FILL_AREA_INDICES (WS : in WS_ID; ERROR_INDICATOR : out ERROR_NUMBER; INDICES : out FILL_AREA_INDICES.LIST_OF) is -- The WS_MANAGER can detect errors #33, #35, and #36. If such -- an error occurs it is passed back to the application program -- via ERROR_INDICATOR. Otherwise the set of fill area indices is passed -- back with an ERROR_INDICATOR of 0 . -- -- WS - The identifier of the workstation on which the set of -- fill area indices are being inquired. -- -- ERROR_INDICATOR - This is the error indicator. Its value represents -- the type of error, if any, that occurred. -- -- INDICES - This is the list of fill area indices. GKS_INSTR : CGI_INQ_LIST_OF_FILL_AREA_INDICES; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 INDICES := FILL_AREA_INDICES.NULL_LIST; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 INDICES := FILL_AREA_INDICES.NULL_LIST; else -- Call the workstation manager with the workstation -- parameter. GKS_INSTR.WS_TO_INQ_LIST_OF_FILL_AREA_INDICES := WS; WS_MANAGER(GKS_INSTR); -- Set error indicator. ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return the information inquired. INDICES := GKS_INSTR.LIST_OF_FILL_AREA_INDICES_INQ; end if; end INQ_LIST_OF_FILL_AREA_INDICES; procedure INQ_FILL_AREA_REPRESENTATION (WS : in WS_ID; INDEX : in FILL_AREA_INDEX; RETURNED_VALUES : in RETURN_VALUE_TYPE; ERROR_INDICATOR : out ERROR_NUMBER; INTERIOR : out INTERIOR_STYLE; STYLE : out STYLE_INDEX; FILL_AREA_COLOUR: out COLOUR_INDEX) is -- The WS_MANAGER can detect errors #33, #35, #36, and #81. -- If such an error occurs it is passed back to the application -- program via ERROR_INDICATOR. Otherwise the fill area interior -- style, fill -- area style index, and fill area colour index are returned -- with an ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation on which the fill area -- representation is being inquired. -- -- INDEX - This is the identifier of the index into the set of -- fill areas discerning which fill area representation is -- being inquired. -- -- RETURNED_VALUES - Indicates whether the returned values should -- as they were set by the program or as they were -- actually realized. -- -- ERROR_INDICATOR - This is the error indicator. Its value represents -- the type of error, if any, that occurred. -- -- INTERIOR - This enumerated type defines the fill area interior -- styles. -- STYLE - This is the style type of the fill area. -- -- FILL_AREA_COLOUR -This is the colour of the fill area. GKS_INSTR : CGI_INQ_FILL_AREA_REPRESENTATION; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 INTERIOR := INTERIOR_STYLE'first; STYLE := STYLE_INDEX'first; FILL_AREA_COLOUR := COLOUR_INDEX'first; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 INTERIOR := INTERIOR_STYLE'first; STYLE := STYLE_INDEX'first; FILL_AREA_COLOUR := COLOUR_INDEX'first; else -- Call the workstation manager with the workstation -- parameter. GKS_INSTR.WS_TO_INQ_FILL_AREA_REP := WS; GKS_INSTR.FILL_AREA_INDEX_TO_INQ_FILL_AREA_REP := INDEX; GKS_INSTR.RETURN_VALUES_TO_INQ_FILL_AREA_REP := RETURNED_VALUES; WS_MANAGER(GKS_INSTR); ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return information inquired. INTERIOR := GKS_INSTR.FILL_AREA_INTERIOR_INQ; STYLE := GKS_INSTR.FILL_AREA_STYLE_INQ; FILL_AREA_COLOUR := GKS_INSTR.FILL_AREA_COLOUR_INQ; end if; end INQ_FILL_AREA_REPRESENTATION; procedure INQ_LIST_OF_PATTERN_INDICES (WS : in WS_ID; ERROR_INDICATOR : out ERROR_NUMBER; INDICES : out PATTERN_INDICES.LIST_OF) is -- The WS_MANAGER can detect errors #33, #35, and #36. If such -- an error occurs it is passed back to the application program -- via ERROR_INDICATOR. Otherwise the set of pattern indices is -- passed back -- with an ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation on which the list of -- pattern indices is being inquired. -- -- ERROR_INDICATOR - This is the error indicator. Its value represents -- the type of error, if any, that occurred. -- -- INDICES - This is the set of pattern indices. GKS_INSTR : CGI_INQ_LIST_OF_PATTERN_INDICES; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 INDICES := PATTERN_INDICES.NULL_LIST; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 INDICES := PATTERN_INDICES.NULL_LIST; else -- Call the workstation manager with the workstation -- parameter. GKS_INSTR.WS_TO_INQ_LIST_OF_PATTERN_INDICES := WS; WS_MANAGER(GKS_INSTR); ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return information inquired. INDICES := GKS_INSTR.LIST_OF_PATTERN_INDICES_INQ; end if; end INQ_LIST_OF_PATTERN_INDICES; procedure INQ_PATTERN_REPRESENTATION (WS : in WS_ID; INDEX : in PATTERN_INDEX; RETURNED_VALUES : in RETURN_VALUE_TYPE; ERROR_INDICATOR : out ERROR_NUMBER; PATTERN : out VARIABLE_COLOUR_MATRIX)is -- The WS_MANAGER can detect errors #33, #35, #36, #85, #88 and #90. -- If such an error occurs it is passed back to the application -- program via ERROR_INDICATOR. Otherwise the pattern array -- dimensions and the -- pattern array are returned with an ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation in which the pattern -- indices are being inquired. -- -- INDEX -This is the identifier of the index into the set of -- patterns discerning which pattern representation is being -- inquired. -- -- RETURNED_VALUES - Indicates whether the returned values should -- as they were set by the program or as they were -- actually realized. -- -- ERROR_INDICATOR - This is the error indicator. Its value represents -- the type of error, if any, that occurred. -- -- PATTERN - This is a record defining a matrix that contains colour -- indices as elements. It should be unconstrained so that any -- size matrix can be returned. If it is constrained, then the -- actual pattern matrix will be truncated or will fill only a -- portion of the returned object GKS_INSTR : CGI_INQ_PATTERN_REPRESENTATION; PATTERN_RETURN : VARIABLE_COLOUR_MATRIX (PATTERN.DX, PATTERN.DY); -- The dummy variable to return when the state is incorrect. begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 PATTERN := PATTERN_RETURN; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 PATTERN := PATTERN_RETURN; else -- Call the workstation manager with the workstation -- parameter. GKS_INSTR.WS_TO_INQ_PATTERN_REP := WS; GKS_INSTR.PATTERN_INDEX_TO_INQ_PATTERN_REP := INDEX; GKS_INSTR.RETURN_VALUES_TO_INQ_PATTERN_REP := RETURNED_VALUES; WS_MANAGER(GKS_INSTR); ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; if GKS_INSTR.ERROR_INDICATOR /= SUCCESSFUL then PATTERN := PATTERN_RETURN; else -- Return information inquired. if not PATTERN'constrained then PATTERN := ( DX => GKS_INSTR.PATTERN_REP_INQ'LENGTH(1), DY => GKS_INSTR.PATTERN_REP_INQ'LENGTH(2), MATRIX => GKS_INSTR.PATTERN_REP_INQ.all); else if (PATTERN.DX < SMALL_NATURAL(GKS_INSTR. PATTERN_REP_INQ'LENGTH(1))) then for INDEX1 in POSITIVE(1) .. POSITIVE(PATTERN.DX) loop if PATTERN.DY < SMALL_NATURAL(GKS_INSTR. PATTERN_REP_INQ'LENGTH(2)) then for INDEX2 in POSITIVE(1) .. POSITIVE(PATTERN.DY) loop PATTERN.MATRIX(INDEX1,INDEX2) := GKS_INSTR.PATTERN_REP_INQ(INDEX1,INDEX2); end loop; else for INDEX2 in POSITIVE(1) .. POSITIVE(GKS_INSTR. PATTERN_REP_INQ'LENGTH(2)) loop PATTERN.MATRIX(INDEX1,INDEX2) := GKS_INSTR.PATTERN_REP_INQ(INDEX1,INDEX2); end loop; end if; end loop; else for INDEX1 in POSITIVE(1) .. POSITIVE(GKS_INSTR. PATTERN_REP_INQ'LENGTH(1)) loop if PATTERN.DY < SMALL_NATURAL(GKS_INSTR. PATTERN_REP_INQ'LENGTH(2)) then for INDEX2 in POSITIVE(1) .. POSITIVE(PATTERN.DY) loop PATTERN.MATRIX(INDEX1,INDEX2) := GKS_INSTR.PATTERN_REP_INQ(INDEX1,INDEX2); end loop; else for INDEX2 in POSITIVE(1) .. POSITIVE(GKS_INSTR. PATTERN_REP_INQ'LENGTH(2)) loop PATTERN.MATRIX(INDEX1,INDEX2) := GKS_INSTR.PATTERN_REP_INQ(INDEX1,INDEX2); end loop; end if; end loop; end if; end if; end if; FREE_COLOUR_MATRIX (GKS_INSTR.PATTERN_REP_INQ); end if; end INQ_PATTERN_REPRESENTATION; procedure INQ_SET_OF_SEGMENT_NAMES_ON_WS (WS : in WS_ID; ERROR_INDICATOR : out ERROR_NUMBER; SEGMENTS : out SEGMENT_NAMES.LIST_OF) is -- The WS_MANAGER can detect errors #33, and #35. If such and error -- occurs it is passed back to the application program. Otherwise, -- the set of segments is passed back with an ERROR_INDICATOR of 0. -- -- WS - The identifier of the workstation on which the segment -- names are being inquired. -- -- ERROR_INDICATOR - This is the error indicator. Its value represents -- the type of error, if any, that occurred. -- -- SEGMENTS - This is the set of segment names. GKS_INSTR : CGI_INQ_SET_OF_SEGMENT_NAMES_ON_WS; begin -- The following if inquires the GKS_OPERATING_STATE_LIST to -- see if GKS is in the proper state before proceeding with the -- call to the WS_MANAGER. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate the workstation is open. -- Otherwise an error exists. ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- error 7 SEGMENTS := SEGMENT_NAMES.NULL_LIST; -- Check if the specified workstation is open. elsif not WS_IDS.IS_IN_LIST (WS, GKS_STATE_LIST.LIST_OF_OPEN_WS) then -- The workstation must be open. -- Otherwise an error exists. ERROR_INDICATOR := WS_NOT_OPEN; -- error 25 SEGMENTS := SEGMENT_NAMES.NULL_LIST; else -- Call the workstation manager with the workstation -- parameter. GKS_INSTR.WS_TO_INQ_SET_OF_SEGMENT_NAMES := WS; WS_MANAGER(GKS_INSTR); ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; -- Return information inquired. SEGMENTS := GKS_INSTR.SEGMENTS_ON_WS; end if; end INQ_SET_OF_SEGMENT_NAMES_ON_WS; end INQ_WS_STATE_LIST_1A;