1、INTERNATIONAL STANDARD INTERNATIONAL ORGANIZATION FOR STANDARDIZATION ORGANISATION INTERNATIONALE DE NORMALISATION MEwYHAPOjJHAR OPrAHkl3AklR tl0 CTAHAPTM3AMM Information processing systems - Computer graphics - Graphical Kernel System (GKS) language bindings - Part 2 : Pascal Systkmes de traitement
2、 de linformation - lnfographie - Syst&me graphique de base (GKS) - fnterface langage Partie 2 : Pascal IS0 8651-2 First edition 1988-02-01 Reference number Foreword IS0 (the international Organization for Standardization) is a worldwide federation of national standards bodies (IS.0 member bodies). T
3、he work of preparing International Standards is normally carried out through IS0 technical committees. Each member body interested in a subject for which a technical committee has been established has the right to be represented on that committee. International organizations, govern- mental and non-
4、governmental, in liaison with ISO, also take part in the work. Draft International Standards adopted by the technical committees are circulated to the member bodies for approval before their acceptance as International Standards by the IS0 Council. They are approved in accordance with IS0 procedures
5、 requiring at least 75 % approval by the member bodies voting. International Standard IS0 9551-2 was prepared by Technical Committee ISO/TC 97, Information processing systems. Users should note that all International Standards undergo revision from time to time and that any reference made herein to
6、any other International Standard implies its latest edition, unless otherwise stated. ,a International Organization for Standardization, 1988 l Printed in Switzerland ii IS0 8651-2 : 1988 (E) Contents 0 Introduction .l 1 Scope and field of application .2 2 References 3 3 The Pascal language binding
7、of GKS 4 3.1 Specification 4 3.2 Mapping of GKS function names to Pascal procedure names.4 3.3 The many-one nature of the Pascal interface . .4 3.4 The one-one nature of the Pascal interface .4 3.5 The one-many nature of the Pascal interface . .J 3.6 Implementation of the interfaces . 5 3.7 Represen
8、tation of GKS data types . .25 3.8 Naming conventions for data types .25 3.9 Implementation-dependent characteristics .25 3.10 Data Records Subject to Registration . .26 3.11 Return Parameter Arrays .27 3.12 Level of Pascal 27 3.13 Registration . 29 4 Error handling . 30 4.1 The error handling funct
9、ion . .30 4.2 Pascal specific GKS errors 30 5 Pascal GKS data structures .31 5.1 Implementation-defined constants . .31 5.2 Implementation-defined types .31 5.2.1 General types .31 5.2.2 Record types 32 5.3 Required constants . 33 5.4 General types . 33 5.5 Names used by GKS .34 5.6 GKS enumerated t
10、ypes 34 5.7 Array types . .35 5.8 Set types . .36 . . . 111 IS0 8651-2 : 1988 (E) 6 GKSfunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 Notational conventions . .44 Control functions . 4 4 Output functio
11、ns . 48 Output attributes . s 4 6.4.1 Workstation Independent primitive attributes . .54 6.4.2 Workstation attributes (Representations) .58 Transformation functions . 60 6.5.1 Normalization transformation .60 6.5.2 Workstation transformation . .61 Segment functions 62 6.6.1 Segment manipulation func
12、tions . .62 6.6.2 Segment attributes . 63 Input functions 64 6.7.1 Initialisation of input devices . .64 6.7.2 Setting the mode of input devices . .68 6.7.3 Request input functions . .71 6.7.4 Sample input functions 73 6.7.5 Event input functions . 75 Metafile functions 78 Inquiry functions . 80 6.9
13、.1 Convention 80 6.9.2 Inquiry function for operating state value .80 6.9.3 Inquiry functions for GKS description table . .80 6.9.4 Inquiry functions for GKS state list . .82 6.9.5 Inquiry functions for workstation state list . .94 6.9.6 Inquiry functions for workstation description table . .lll 6.9
14、.7 Inquiry functions for segment state list .124 6.9.8 Pixel inquiries .125 6.9.9 Inquiry function for GKS error state list .126 Utility functions .126 Error handling .127 Annexes A Data types in compilation order . .128 A.1 Implementation defined constants .128 A.2 Required constants .128 A.3 Imple
15、mentation defined tag types .128 A.4 Error logging and connection files .129 A.5 General types 129 A.6 Types applicable to workstation control procedures . .129 A.7 Types applicable to transformation procedures .130 A.8 Types applicable to attribute setting procedures . .130 A.9 Types applicable to
16、segment procedures . .130 A.10 Types applicable to input procedures .130 A.11 Types applicable to GKS description . .130 A.12 Types applicable to GKS state .131 A.13 Types applicable to workstation state .131 A.14 Types applicable to workstation description .131 A.15 Types applicable to segment stat
17、e .131 A.16 GKS data records .131 A.17 Types applicable to the one-one procedures. . 132 A.18 Types applicable to the many-one procedures 132 iv IS0 8651-2 : 1988 (E) B Metafile Item Types 133 C Example Programs . .135 C.l Program STAR . .135 C.2 Program IRON . .138 C.3 Program MAP .146 (2.4 Program
18、 MANIPULATE . 149 C.5 Program SHOWLN . .158 D Function lists .164 D.l GKS functions .164 D.2 Pascal functions .166 V INTERNATIONAL STANDARD IS0 8651-2 : 1988 (E) Information processing systems - Computer graphics - Graphical Kernel System (GKS) language bindings - Part 2 : Pascal 0 Introduction The
19、Graphical Kernel System (GKS), the functional description of which is given in IS0 7942, is speci- fied in a language-independent manner and needs to be embedded in language-dependent layers (language bindings) for use with particular programming languages. The purpose of this part of IS0 8651 is to
20、 define a standard binding for the Pascal computer programming language. 1 IS0 8651-2 : 1988 (E) 1 Scope and field of application IS0 7942 specifies a language-independent nucleus of a graphics system. For integration into a program- ming language, GKS is embedded in a language-dependent layer obeyi
21、ng the particular conventions of that language. This part of IS0 8651 specifies such a language-dependent layer for the Pascal language. IS0 8651-2 : 1988 (E) 2 References IS0 7942, Information processing systems - Computer graphics - Graphical Kernel System (GKS) functional description. IS0 7185, P
22、rogramming languages - Pascal. IS0 2382-13, Data processing - Vocabulary - Part 13: Computer Graphics. IS0 8651-2 : 1988 (E) 3 The Pascal language binding of GKS 3.1 Specification The GKS language binding interface for IS0 Pascal (IS0 7185) shall be as described in clauses 3, 4, 5, and 6. 3.2 Mappin
23、g of GKS function names to Pascal procedure names The function names of GKS are all mapped to Pascal procedures which begin with the letter “G”. Words and phrases used in the GKS function names are often abbreviated in the Pascal representation. There is a set of such abbreviations given in table 1
24、and the resulting Pascal procedure names are listed in tables 2, 3, and 4. For example, the abbreviation for the GKS function DELETE SEGMENT FROM WORKS- TATION is GDelSegWs. “Del”, “Seg”, “Ws” are the abbreviations for DELETE, SEGMENT and WORKSTATION. Conjunctives such as “from”, “and”, “of and “to”
25、 are mapped to null strings, as are a number of other words used in the GKS abstract names. For example, INQUIRE MAXIMUM LENGTH OF WORKSTATION STATE TABLES is mapped to GInqMaxWsSt. Here LENGTH and TABLFS are represented by null strings. 3.3 The many-one nature of the Pascal interface There is not a
26、 strict one-to-one correspondence between GKS abstract functions and Pascal procedures. A method employing variant records is used to represent several logically related GKS abstract functions by one Pascal procedure. The first parameter of such a procedure is always an enumerated type which is the
27、tag field of a variant record which is itself a parameter of the Pascal procedure. This technique is used across two classes of abstract functions - those relating to the setting and inquiring of output primitive representations, and those relating to the setting and inquiring of the input classes.
28、Where this method is used, the rules for deriving the Pascal name of the GKS abstract function are a) Output Primitive Representations 1) The GKS words Polyline, Polymarker, Text, and Fill Area are replaced by “Prim” (which is the abbreviation for Pm). 2) The first parameter of the function is an en
29、umerated type (GEPrim) which has one of the values GVPolyline , GVPolymarker , GVText , GVFillArea. b) Input Classes 1) The GKS words Locator, Stroke, Valuator, Choice, Pick, and String are replaced by “Input”. 2) The first parameter of the function is an enumerated type (GEInputClass) which has one
30、 of the values GVLocator, GVStroke, GWaluator, GVChoice, GVPick, GVString. 3.4 The one-one nature of the Pascal interface The Pascal interface to GKS described in 3.3 reflects the GKS major dimensions of Output Primitive Representations and Input Classes. However, the possibility exists that on smal
31、l systems such an interface might cause difficulties, especially with respect to implementation of the Input Classes. Therefore, the Pascal Binding also adopts a mandatory representation which uses a one-one mapping for the setting of primitive representations and input classes. 3.5 The one-many nat
32、ure of the Pascal interface The GKS abstract functions INQUIRE CURRENT PRIMITIVE ATTRIBUTE VALUES and INQUIRE CURRENT INDIVIDUAL ATTRIBUTE VALUES are represented by the method described in 3.4. In addition, to allow for the possible frequent use of only some of the information, these 4 IS0 8651-2 :
33、1988 (E) The Pascal language binding of GKS The one-many nature of the Pascal interface functions have also been split into a number of Pascal procedures. Both representations are mandatory. 3.6 Implementation of the interfaces Since any of the methods referred to in 3.3, 3.4 and 3.5 can be implemen
34、ted easily in terms of another, the additional interfaces do not present a great burden for the implementor, nor does it cause an addi- tional burden for application programs. Implementors are encouraged to use one method in the core of their implementation. In any event all sets of procedures shall
35、 be provided. Table 1 - Abbreviations ordered alphabetically Abbreviation Yl _-_ _- ACCUMULATE ALIGNMENT ALL AND ASPECT SOURCE FLAGS ASSOCIATE ATTRIBUTE ATTRIBUTES AVAILABLE CHARACI-ER CLASSIFICATION CLIPPING COLOUR CONNECTION CURRENT DEFAULT DEFERRAL DELETE DETECTABILITY DIMENSIONS DYNAMIC Accum Al
36、ign NULL NULL ASF A&%X Attr Attr NULL Char Class clip Colr Conn Cur Def Defer Del Det Dim W EVALUATE Eval EXPANSION Expan FACILITIES Facil FACTOR NULL FILL AREA Fill FROM NULL 3ENERALIZED DRAWING PRIMITIVE GDP SRAPHICAL KERNEL SYSTEM GKS SKSM NULL HIGHLIGHTING Highlight IDENTIFIER Id M NULL NDEX Ind
37、 NDICATOR NULL NDICES Ind NDIVIDUAL Indiv NITLALISE rnit NPUT NULL NQUIRE Inq NTERIOR Int IS0 8651-2 : 1988 (E) Table 1 - Abbreviations ordered alphabetically The Pascal language binding of GKS GKS word Abbreviation LENGTH NULL LIST NULL LOGICAL NULL MATRIX NULL MAXIMUM Max MODIFICATION Mod NAME NUL
38、L NORMALIZATION Norm NUMBER Num NUMBERS Num OF NULL ON NULL OPERATING OP POLYLINE Line POLYMARKER Marker PRECISION Prec PREDEFMED Pred PRIMITIVE Prim QUEUE NULL REFERENCE Ref REPRESENTATION Rep REQUEST Req SEGMENT SEGMENTS SET SIMULTANEOUS SPACE STATE SUPPORTED TABLES TO TRANSFORMATION UPDATE USE VA
39、LUE VALUES VISIBILITY WITH WORKSTATION *g *I2 NULL NULL NULL St NULL NULL NULL Tran Upa NULL NULL NULL Vis NULL WS NOTE - NULL repsents the null string IS0 8651-2 : 1988 (E) The Pascal language binding of GKS Table 2 - GKS function names and Pascal names ordered by Pascal name GKS Function Name Leve
40、l Pascal Name ACCUMULATE TRANSFORMATION MATRIX Lla GAccumTran ACTIVATE WORKSTATION Ma GActivateWs ASSOCIATE SEGMENT WITH WORKSTATION L2a GAssocSegWs AWAIT EVENT MC GAwaitEvent CELL ARRAY Ma GCellArray CLEAR WORKSTATION Ma GClearWs CLOSE GKS LOa GCloseGKS CLOSE SEGMENT Lla GCloseSeg CLOSE WORKSTATION
41、 Ma GCloseWs COPY SEGMENT TO WORKSTATION L2a GCopySegWs CREATE SEGMENT Lla GCreateSeg DEACTIVATE WORKSTATION Ma GDeactivateWs DELETE SEGMENT Lla GDclSeg DELETE SEGMENT FROM WORKSTATION Lla GDelSegWs EMERGENCY CLOSE GKS Ma GEmergencyCloseGKS ERROR HANDLING Ma GErrorHandling ERROR LOGGING Lila GErrorL
42、ogging ESCAPE Lila GEscape ESCAPE LOa GFscapeGeneralized EVALUATE TRANSFORMATION MATRIX Lla GEvalTran FILL AREA Ma GFill FLUSH DEVICE EVENTS MC GFlushDeviceEvents GENERALIZED DRAWING PRIMITIVE (GDP) Ma GGDP GENERALIZED DRAWING PRIMITIVE (GDP) LOa GGDPGeneralized GET CHOICE LOC GGetChoice GET CHOICE
43、MC GGetInput(Choice GET LOCATOR LOC GGetInput(Locator GET PICK Llc GGetInput(Pick GET STRING LOC GGetInput(String GET STROKE LOC GGetIoput(Stroke GET VALUATOR LOC GGetInput(Valuator GET ITEM TYPE FROM GKSM LOa GGetItemType GET LOCATOR LOC GGetLocator GET PICK Llc GGetPick GET STRING MC GGetString GE
44、T STROKE MC GGetStroke GET VALUATOR MC GGetValuator INITIALISE CHOICE LOb GInitChoice INITIALISE CHOICE LOb GInitInput(Choice INITIALISE LOCATOR Mb GInitI nput(Locator INITIALISE PICK Llb GInitInput(Pick INITIALISE STRING L4lb GInitInput(String INITIALISE STROKE LOb GInitInput(Stroke INITIALISE VALU
45、ATOR LOb GInitInput(Valuator INITIALISE LOCATOR LOb GInitLocator INITIALISE PICK Llb G InitPick INITIALISE STRING LOb GInitString INITIALISE STROKE Mb GInitStroke INITIALISE VALUATOR Mb GInitValuator 7 IS0 8651-2 : 1988 (E) Table 2 - Names ordered by Pascal name The Pascal language binding of GKS GK
46、S Function Name Level Pascal Name INQUIRE ASPECI SOURCE FLAGS INQUIRE SET OF ACTIVE WORKSTATIONS INQUIRE SET OF ASSOCIATED WORKSTATIONS INQUIRE CHARACTER BASE VECTOR INQUIRE CHARACTER EXPANSION FACTOR INQUIRE CHARACTER HEIGHT INQUIRE CHARACIER SPACING INQUIRE CHARACTER UP VECTOR INQUIRE CHARACTER WI
47、DTH INQUIRE CHOICE DEVICE STATE INQUIRE CLIPPING NQUIRE COLOUR FACILITIES INQUIRE COLOUR REPRESENTATION NQUIRE CURRENT INDIVIDUAL ATTRIBUTE VALUES NQUIRE CURRENT NORMALIZATION TRANSFORMATION NUMBER NQUIRE CURRENT PICK IDENTIFIER NQUIRE CURRENT PRIMITIVE ATTRIBUTE VALUES NQUIRE DEFAULT CHOICE DEVICE
48、DATA NQUIRE DEFAULT DEFERRAL STATE VALUES !NQUIRE DEFAULT CHOICE DEVICE DATA NQUIRE DEFAULT LOCATOR DEVICE DATA NQUIRE DEFAULT PICK DEVICE DATA NQUIRE DEFAULT STRING DEVICE DATA SQUIRE DEFAULT !3-ROKE DEVICE DATA NQUIRE DEFAULT VALUATOR DEVICE DATA NQUIRE DEFAULT LOCATOR DEVICE DATA HQUIRE DEFAULT P
49、ICK DEVICE DATA :NQUIRE DEFAULT STRING DEVICE DATA NQUIRE DEFAULT STROKE DEVICE DATA NQUIRE DEFAULT VALUATOR DEVICE DATA WQUIRE DISPLAY SPACE SIZE HQUIRE DYNAMIC MODIFICATION OF SEGMENT ATTRIBUTES NQUIRE DYNAMIC MODIFICATION OF WORKSTATION ATTRIBUTES :NQUIRE FILL AREA COLOUR INDEX NQUIRE FILL AREA FACILITIES NQUIRE FILL AREA INDEX :NQUIRE FILL AREA INTERIOR STYLE INQUIRE FILL AREA REPRESENTATION INQUIRE FILL AREA STYLE INDEX INQUIRE GENERALIZED DRAWING PRIMITIVE INQUIRE CHOICE DEVICE STATE INQUIRE LOCATOR DEVICE STATE INQUIRE PICK DEVICE STATE INQUIRE STRING DEVICE STATE M