GDDM V3R2 Base Application Programming Reference
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF | BOOK


CGLOAD

GDDM V3R2 Base Application Programming Reference
SC33-0868-02



Function


To import (load) a picture from a Computer Graphics Metafile (CGM).


   CGLOAD      (cgm-count,cgm-name,profile,opt-count,opt-array,seg-count,
               desc-len1,descriptor1,ret-len1,desc-len2,descriptor2,ret-len2)

APL code 669 GDDM RCP code: X'0C0C1F00' (202120960)


Parameters


cgm-count (specified by user) (fullword integer)
The number of 8-byte name parts in cgm-name. Valid range is 1 through 3 under VM, 1 through 7 otherwise.


cgm-name (specified by user) (array of 8-byte character tokens)
The name-parts that constitute the name by which the CGM file is known to the underlying subsystem. GDDM left-justifies each name part. The number of name parts that can be specified is subsystem-dependent. Under VM/CMS, there are three elements in the array, defined as follows:

1
The CMS filename of the file. Can be any valid CMS file name.
2
The CMS filetype of the file. Can be any valid CMS file type. If cgm-count<2, a filetype of "CGM" is assumed.
3
The CMS filemode of the file. Can be any valid CMS filemode, or "*," indicating the first occurrence of the file in the CMS search order. if cgm-count<3, a filemode of "*" is assumed.

Under TSO or MVS/Batch, this specifies either

  • An allocated ddname, or
  • A fully qualified data set name, such as 'CGM.PICTURE.NO43', or
  • If the file is part of a partitioned data set, a name and member name such as 'CGM.PICTURE.EXTRACTS(NO43)', or
  • If the quotation marks are omitted and the parameter is not a ddname, a name to which a data set qualifier is added to the front in the usual TSO way.
    
    
If the name exceeds eight characters in length, it must be placed in consecutive members of the array and, if necessary, padded with blanks.

For example, if the DSNAME is contained in quotes and is


         aaaa.bbbb.ccc

it looks like this:


                  ___ ___ ___ ___ ___ ___ ___ ___ 
   cgm-name(1) = | ' | a | a | a | a | . | b | b |
                 |___|___|___|___|___|___|___|___|

___ ___ ___ ___ ___ ___ ___ ___ cgm-name(2) = | b | b | . | c | c | c | ' | | |___|___|___|___|___|___|___|___|


profile (specified by user) (8-byte character string)
The name (left-justified) of the CGM profile. If this parameter is not specified, the default is ADM. However, on CMS, the default is the CGM filetype specified.

opt-count (specified by user) (fullword integer)
The number of elements specified in the opt-array parameter.

opt-array (specified by user) (an array of fullword integers)
Specifies how CGLOAD is to restore a picture from the CGM file. The parameter has six elements. If an element is not specified, the action taken is the same as if it had been specified as 0.

1 - picture-number
The sequence number within the CGM of the picture to be loaded. CGM source files may contain more than one picture and in this case the pictures are considered to be numbered sequentially starting with 1. picture-number is defined as follows:
-1
Loads all pictures in the input file
0
the default, as specified in the profile. If the picture number is not specified in the conversion profile or is specified as zero, -1 is used.
1
Specifies the number of the (single) picture to be loaded from the input file
If more than one picture is loaded, the individual pictures are not identifiable in terms of segment numbers.
2 - seg-base
Identifies which segment is used as the starting point for loading into the GDDM page. Segments are created using the next unused segments greater than or equal to seg-base. Allowed values are:
0
The default, as specified in the profile. If the seg-base is not specified in the conversion profile or is specified as zero, 1 is used.
1
The CGM picture is loaded in unused segments with identifiers seg-base.
3 - load-type
Specifies how the picture is to be restored from the CGM. The options are:
0
The default, as specified in the profile. If the load-type is not specified in the conversion profile or is specified as zero, 2 is used.
1
The picture is restored without transformation, using the page's current window and viewport coordinate system. To restore the saved data satisfactorily, a window coordinate system that corresponds to the coordinates used in the CGM must be defined using a GSWIN call or a GSUWIN call.
2
The picture space of the CGM picture is accommodated within the current viewport, preserving the aspect ratio that the picture had when it was saved. Any primitives outside the picture space of the CGM picture may be lost.
3
Reserved.
4
At the time of the CGLOAD, the shape of the picture held in the file to be loaded is used to define the picture space, and the rest of the graphics hierarchy is defaulted. The load then proceeds as for load-type = 2.

If the picture space has been defined (or defaulted), this load-type is equivalent to load-type = 2.
4 - symbol-set
Specifies the action to be taken when loading a CGM picture that contains fonts. Note that GDDM loads symbol sets to emulate CGM fonts. The options are:
0
The default, as specified in the profile. If the symbol-set is not specified in the conversion profile or is specified as zero, 2 is used.
1
GDDM loads the symbol sets corresponding to the fonts in the CGM input file after mapping according to the profile. They are loaded with the identifiers specified in the profile. Any symbol sets that are already loaded are overwritten (unless the symbol set already loaded is the one that is actually required; that is, has the same name, type, and LCID, in which case it is not loaded again).

This option should be used to ensure that the values of the GDF_FONT_INDEXs specified in the profile are used as LCIDs without change.
2
Same action as in 1 except that no existing symbol sets are overwritten. Symbol sets which, if loaded, would clash with the LCID of one already loaded are moved to new LCIDs. The largest unused identifiers are used for this purpose. References to fonts in the CGM file are mapped to the new LCIDs if they have been moved, not to the LCID corresponding to the GDF_FONT_INDEX in the profile.

If there are insufficient unused identifiers for all the symbol sets to be loaded, the device default symbol set is used.

This option should be used where the application needs to ensure that no existing symbol sets or LCIDs are altered.
5 - seg-use
Specifies how many segments are to be created when loading a CGM picture. The options are:
0
The default, as specified in the profile. If the seg-use is not specified in the conversion profile or is specified as zero, 2 is used.
1
All CGM primitives are placed into separate segments. This option should be used where the resultant GDF file is intended to be edited.
2
The entire CGM picture (or pictures) loaded is placed in a single GDDM segment. This option should be used where the resultant GDF file is required to be small or where no subsequent editing of the file is required.
6 - code-page
Specifies the code page that was used by the CGM generating application. This option determines the way all text strings are translated. It is unlikely that the application writer using the CGLOAD call knows the required information; it is, therefore, recommended that this parameter is coded as zero, so that the information is obtained from the conversion profile. Allowed values are:
0
the default, as specified in the profile. If the code page is not specified in the conversion profile or is specified as zero, 850 is used.
437
Code page 437 (United States), as shown in the GDDM System Customization and Administration book.
819
Code page 819 (ISO/ANSI Multilingual), as shown in the GDDM System Customization and Administration book. This 8-bit ASCII code page contains all the characters in the GDDM CECP code pages.
850
Code page 850 (Multilingual), as shown in the GDDM System Customization and Administration book.
Other
Code page specified in the user modifiable ADMDATRN module.

seg-count (returned by GDDM) (fullword integer)
Count of the number of segments created. The result depends on the setting of the seg-use parameter.

desc-len1 (specified by user) (fullword integer)
The maximum number of bytes to be returned in the descriptor1 parameter.

descriptor1 (returned by GDDM) (character string)
A character string of at least desc-len1 bytes to receive the text from the "Begin Metafile" element of the metafile followed by a X'15' byte followed by the text from the "Metafile Descriptor" element of the metafile. The number of bytes placed in descriptor1 is returned in the ret-len1 parameter.

ret-len1 (returned by GDDM) (fullword integer)
The number of bytes of information returned in descriptor1.

desc-len2 (specified by user) (fullword integer)
The maximum number of bytes to be returned in the descriptor2 parameter.

descriptor2 (returned by GDDM) (character string)
A character string of at least desc-len2 bytes to receive the picture name (from begin picture element) from the metafile. If more than one picture is being loaded (that is, picture-number=-1), the descriptors for these are concatenated together, with a x'15' byte placed in between each. The number of bytes placed in descriptor2 is returned in the ret-len2 parameter.

ret-len2 (returned by GDDM) (fullword integer)
The number of bytes of information returned in descriptor2.

Description


Retrieves one or all pictures from a Computer Graphics Metafile (CGM) on auxiliary storage and loads it into the current GDDM page. A segment must not be open when the CGLOAD call is made; CGLOAD does not leave any segment open. CGLOAD loads the CGM picture into the GDDM page, with the window, viewport, picture space and so on, under control of the load-type parameter. If GDDM detects an error, the picture reverts to its original state, without any changes applied.

CGLOAD loads primitives into their own unique segment, to assist with later editing of the picture, or can load the entire picture into one segment under control of the seg-use parameter.

The drawing defaults within the CGM file are incorporated into the segment data to be loaded. The current drawing defaults are not modified. Thus the loaded data reflects the drawing defaults in the CGM file, but CGLOAD does not affect any data currently displayed.

The way that CGM orders are converted to GDF orders and the limitations and restrictions of this process are described in "Computer Graphics Metafiles" in topic 13.0.

The corresponding CGM save function is provided by the CGSAVE call.

The permitted formats of the CGMs and conversion profiles handled by this call are defined in "Computer Graphics Metafiles" in topic 13.0.

CGLOAD is only available under the CMS, TSO and MVS/Batch environments. When CGLOAD is invoked in an unsupported environment, the error ADM3292 (listed below) is returned.

Principal errors


ADM0117 E
SYMBOL SET IDENTIFIER n IS INVALID
ADM0118 E
SYMBOL SET TYPE n IS INVALID
ADM0125 E
SYMBOL SET n CODE POINT X'xx' IS INVALID
ADM0128 W
SYMBOL SET n OPTION UNSUPPORTED
ADM0135 E
SYMBOL SET n TYPE UNSUPPORTED
ADM0146 E
ARRAY COUNT n IS INVALID
ADM0173 E
STRING LENGTH n IS INVALID
ADM0182 W
INVALID CHARACTER CODE X'xx' IN STRING
ADM0232 E
CODE PAGE n IS NOT SUPPORTED
ADM0307 E
FILE 'a' NOT FOUND
ADM0313 E
FILE 'a' HAS INVALID RECORD CONTENT
ADM3157 E
SYMBOL SET IDENTIFIER n ALREADY IN USE
ADM3158 E
NO MATCH IN FONT FOR CODE PAGE INDEX ENTRY
ADM3270 W
MORE SYMBOL SETS THAN SYMBOL-SET IDENTIFIERS
ADM3290 E
INVALID CGM ORDER X'xx', LINE n1 OFFSET n2
ADM3291 E
INVALID VALUE n1 FOR ELEMENT n2 OF OPTION ARRAY
ADM3292 E
CGM FUNCTIONS ARE NOT SUPPORTED IN THIS ENVIRONMENT
ADM3293 E
ERROR AT ITEM n KEYWORD a1 IN FILE 'a2'
ADM3294 E
CGM ERROR CODE abbcc AT LINE n1 OFFSET n2
ADM3295 E
INVALID OR UNSUPPORTED CGM ORDER X'xx'

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012