In addition to hardcopy, CompBase provides a set of convenience functions to map user coordinates to and from device coordinates. The CompBase widget class is a metaclass and cannot be instantiated directly.
| Name | Type | Default |
|---|---|---|
| XmNfontPath | char * | NULL |
| XmNwarning | int | XintWARNING_POST |
| Resource Value | Description |
|---|---|
| XintWARNING_NONE | No message will be output. |
| XintWARNING_PRINT | Message will be written to stderr. |
| XintWARNING_POST (default) | Message will be displayed in a dialog box. |
You can combine destinations using a logical OR or an arithmetic + operation. For instance, specify XintWARNING_PRINT + XintWARNING_POST to have any warning message displayed on the screen and written to stderr.
| Function Name | Description |
|---|---|
| XintCGMDrawBox | To tell the CGM output whether or not to draw a box around a CGM plot. |
| XintCGMGetDimensions | Gets the size in inches used by a widget. |
| XintCGMPixelToInch | Converts a size specified in pixels to a size specified in inches. |
| XintCGMSetEdgeWidthMode | Sets the edge width mode for drawing primitives in the CGM display. |
| XintCGMSetLineWidthMode | Sets the line width mode for drawing primitives in the CGM display. |
| XintCGMSetVDCType | Selects either real or integer output coordinates for CGM. |
| XintGetWidgetSize | Returns the size in pixels that a widget will occupy when output to hardcopy. |
| XintHorizontalPixelToUser | Pixel to User coordinates conversion in the horizontal direction. |
| XintHorizontalUserToPixel | User coordinates to Pixel conversion in the horizontal direction. |
| XintOutputCGM | Creates a CGM file containing the graphic representation of a single widget or of all of the widgets that are children of a composite widget. |
| XintOutputMontageCGM | Creates a CGM file containing a montage composed of several widgets. |
| XintOutputMontagePostscript | Creates a PostScript file containing a montage composed of several widgets. |
| XintOutputPostscript | Creates a PostScript file containing the graphic representation of a single widget or of all of the widgets that are children of a composite widget. |
| XintPostscriptGetCompressImage | Returns the value of the flag controlling how PostScript images are output. |
| XintPostscriptGetDefaults | Gets the PostScript page characteristics. |
| XintPostscriptSetBackground | Sets the background for PostScript output. |
| XintPostscriptSetCompressImage | Sets whether an 8 bit image is output in compressed mode or output as rgb values. |
| XintPostscriptSetDefaults | Sets the PostScript page characteristics. |
| XintVerticalPixelToUser | Pixel to User coordinates conversion in the vertical direction. |
| XintVerticalUserToPixel | User coordinates to Pixel conversion in the vertical direction. |
void XintCGMDrawBox (Boolean flag)where flag is a Boolean variable that should be set to True to have the box drawn around the plot.
void XintCGMGetDimensions (...)
| Widget | widget | The ID of the widget to be output. |
| float * | width | Width in inches of the widget's extent. |
| float * | height | Height in inches of the widget's extent. |
void XintCGMPixelToInch (...)
| Widget | widget | The ID of the widget. |
| int | pwidth | Width in pixels. |
| int | pheight | Height in pixels. |
| float * | width | Returns the width in inches. |
| float * | height | Returns the height in inches. |
void XintCGMSetEdgeWidthMode (...)
| int | mode | Specify one of the values below. |
| Resource Value | Description |
|---|---|
| XintCGM_WIDTH_MODE_ABSOLUTE | The edge width in the CGM display is the edge width of the primitive multiplied by the nominal line width of the target device, usually one pixel or device coordinate. |
| XintCGM_WIDTH_MODE_SCALED (default) | The edge width in the CGM display is specified in the world coordinates of the plot. |
void XintCGMSetLineWidthMode (...)
| int | mode | Specify one of the values below. |
| Resource Value | Description |
|---|---|
| XintCGM_WIDTH_MODE_ABSOLUTE | The line width in the CGM display is the line width of the primitive multiplied by the nominal line width of the target device, usually one pixel or device coordinate. |
| XintCGM_WIDTH_MODE_SCALED (default) | The line width in the CGM display is specified in the world coordinates of the plot. |
void XintCGMSetVDCType (...)
| int | type | Specify one of the values below. |
| Resource Value | Description |
|---|---|
| XintCGM_VDC_TYPE_INTEGER | The coordinates are output in 16 bit integer format, as required by the CGM/PIP (Petroleum Industry Profile) specification. |
| XintCGM_VDC_TYPE_REAL | The coordinates are output in fixed point floating format, as required by the CGM/PIP (Petroleum Industry Profile) specification. This is the default. |
void XintGetWidgetSize (...)
| Widget | widget | The ID of the widget. |
| int * | width | Returns the width in pixels. |
| int * | height | Returns the height in pixels. |
Boolean XintHorizontalPixelToUser (...)
| Widget | widget | The ID of the CompBase derived widget. |
| int | pixel | Specifies the horizontal window coordinate. |
| float * | user | Returns the corresponding user coordinate. |
The function returns False if pixel is outside the widget's window.
Boolean XintHorizontalUserToPixel (...)
| Widget | widget | The ID of the CompBase derived widget. |
| float | user | Specifies the horizontal user coordinate. |
| int * | pixel | Returns the corresponding window coordinate. |
The function returns False if user is outside the widget's window.
Boolean XintOutputCGM (...)
| Widget | widget | Widget for output. |
| char * | filename | Name of CGM file to be created. |
| float | plot_width | Specifies the width in inches of the CGM plot to be generated. |
| float | plot_height | Specifies the height in inches of the CGM plot to be generated. |
In case of error, the function returns a warning message to the end-user (as controlled by resource XmNwarning) and returns False. Otherwise, it returns True.
Boolean XintOutputMontageCGM (...)
| Data Type | Arg Name | Description |
|---|---|---|
| widget * | widget_list | List of widgets to output. |
| int * | xpos_list | List of x coordinates for the widgets. |
| int * | ypos_list | List of y coordinates for the widgets. |
| int | count | Number of widgets to output. |
| char * | filename | Name of CGM file to be created. |
| int | canvas_width | Width of canvas in pixels. |
| int | canvas_height | Height of canvas in pixels. |
| float | width | Width of plot in inches. |
| float | height | Height of plot in inches. |
In case of error, the function displays a warning message (as controlled by resource XmNwarning) to the end user and returns False; otherwise, it returns True.
Boolean XintOutputMontagePostscript (...)
| Widget * | widget_list | List of widgets to output. |
| int * | xpos_list | List of x coordinates for the widgets. |
| int * | ypos_list | List of y coordinates for the widgets. |
| int | count | Number of widgets to output. |
| char * | filename | Name of PostScript file to be created. |
| int | canvas_width | Width of canvas in pixels. |
| int | canvas_height | Height of canvas in pixels. |
| float | scale_factor | Specify a real number greater than 0 (see below). |
| int | color_model | Specify XintMONOCHROME for monochrome output or XintCOLOR for color output. |
| int | orientation | Specify one of the values below. |
When the color_model argument is specified as XintCOLOR for a monochrome device, a grayscale display will be produced. Specification of XintMONOCHROME sets all lines and text to black. All fill areas will be grayscale.
| Resource Value | Description |
|---|---|
| XintORIENTATION_PORTRAIT | Image will be oriented as on screen. |
| XintORIENTATION_LANDSCAPE | Image will be rotated 90 degrees clockwise from the screen image. |
| XintORIENTATION_AUTOMATIC | Image will be oriented so that the longest dimension (height or width) will be along the longest dimension of the page. |
The scale_factor argument in the function call specifies how the image inside the widget window will be scaled when output to the PostScript file. If you specify 1, then the image will be fitted to the page. If you specify a fractional number greater than 0 and less than 1, then the image will be scaled to that fraction of the page. If you specify a number greater than 1, then the image will be scaled by that number and multiple pages, as required by the amount of scaling, will be output to the PostScript file.
In case of error, the function displays a warning message to the end user (as controlled by resource XmNwarning) and returns False; otherwise, it returns True.
Boolean XintOutputPostscript (...)
| Widget | widget | Widget for output. |
| char * | filename | Name of PostScript file to be created. |
| float | scale_factor | Specify a real number greater than 0 (see below). |
| int | color_model | Specify XintMONOCHROME for monochrome output or XintCOLOR for color output. |
| int | orientation | Specify one of the values below. |
When the color_model argument is specified as XintCOLOR for a monochrome device, a grayscale display will be produced. Specification of XintMONOCHROME sets all lines and text to black. All fill areas will be grayscale.
| Resource Value | Description |
|---|---|
| XintORIENTATION_PORTRAIT | Image will be oriented as on screen. |
| XintORIENTATION_LANDSCAPE | Image will be rotated 90 degrees clockwise from the screen image. |
| XintORIENTATION_AUTOMATIC | Image will be oriented so that the longest dimension (height or width) will be along the longest dimension of the page. |
The scale_factor argument in the function call specifies how the image inside the widget window will be scaled when output to the PostScript file. If you specify 1, then the image will be fitted to the page. If you specify a fractional number greater than 0 and less than 1, then the image will be scaled to that fraction of the page. If you specify a number greater than 1, then the image will be scaled by that number and multiple pages, as required by the amount of scaling, will be output.
In case of error, the function displays a warning message to the end user (as controlled by resource XmNwarning) and returns False; otherwise, it returns True.
int XintPostscriptGetCompressImage (void)
If value returned is True then compression mode is on. If value returned is False then compression mode is off and image is output as rgb values.
void XintPostscriptGetDefaults (...)
| int * | resolution | Returns a pointer to an integer specifying the page resolution in dots per inch. |
| float * | page_width | Returns a pointer to a floating point number specifying the page width in inches. |
| float * | page_height | Returns a pointer to a floating point number specifying the page height in inches. |
void XintPostscriptSetBackground (Pixel fill_color)
where fill_color is a Pixel value. Set fill_color to XintNO_FILL to have no background painted.
void XintPostscriptSetCompressImage (int flag)
When set to True, images are output in compressed mode (index into a color table). When set to False, images are output as rgb values. The compress mode generates smaller files (close to 3 times smaller), however, the printing takes much longer for large images compared to the case where the image is not compressed. The default flag is True.
void XintPostscriptSetDefaults (...)
| int | resolutation | Specifies the page resolution in dots per inch. |
| float | page_width | Specifies the page width in inches. |
| float | page_height | Specifies the page height in inches. |
Boolean XintVerticalPixelToUser (...)
| Widget | widget | The ID of the CompBase widget. |
| int | pixel | Specifies the pixel location in the vertical direction. |
| float * | user | Returns the user coordinate corresponding to argument pixel. |
The function returns False if argument pixel is outside the widget's boundaries.
Boolean XintVerticalUserToPixel (...)
| Widget | widget | The ID of the CompBase widget. |
| float | user | Specifies the user location in the vertical direction. |
| int * | pixel | Returns the pixel coordinate corresponding to argument user. |
The function returns False if argument user is outside the widget's boundaries.