SRGP(local)

." @(#)SRGP v1.0

NAME
SRGP - Simple Raster Graphics Package (v1.0)

DESCRIPTION
The fundamentals of this package is described fully in Chapter 2 of "Computer Graphics" by Foley, van Dam, Feiner, and Hughes. A complete reference manual is included with all shipments of SPHIGS. This manpage only lists the functions, their parameters' data types, and their return values, and offers no insight into the functionality thereof. The functions are listed twice: once arranged categorically, and once alphabetically.

DEFINED TYPES USED IN PROTOTYPES
typedef struct {int x, y;}                      point;
typedef struct {point bottom_left, top_right;}	rectangle;
typedef struct {int seconds, ticks;}		srgp_timestamp;
typedef struct {
   point position;
   buttonStatus button_chord[3];  /* indexed by {LEFT,MIDDLE,RIGHT}_BUTTON */
   int button_of_last_transition;  /* one of {LEFT,MIDDLE,RIGHT}_BUTTON */
} locator_measure;
typedef enum {WRITE_REPLACE=0, WRITE_XOR, WRITE_OR, WRITE_AND} writeMode;
typedef enum {SOLID, PIXMAP_PATTERN,
              BITMAP_PATTERN_TRANSPARENT, BITMAP_PATTERN_OPAQUE} drawStyle;
typedef enum {CONTINUOUS=0, DASHED, DOTTED, DOT_DASHED} lineStyle;
typedef enum {MARKER_CIRCLE=0, MARKER_SQUARE, MARKER_X} markerStyle;
typedef enum {NO_DEVICE=0, KEYBOARD, LOCATOR} inputDevice;
typedef enum {INACTIVE=0, SAMPLE, EVENT} inputMode;
typedef enum {EDIT=0, RAW} keyboardMode;
typedef enum {NO_ECHO=0, CURSOR, RUBBER_LINE, RUBBER_RECT} echoType;
typedef enum {UP=0, DOWN} buttonStatus;
typedef int buttonMask;  /* {LEFT,MIDDLE,RIGHT}_BUTTON_MASK, or OR'd combo */
typedef int cursorShape;  /* see reference manual */
typedef struct {
   point position;
   buttonStatus button_chord[3];
   int button_of_last_transition;
   buttonStatus modifier_chord[3];  /* indexed by SHIFT, CONTROL, META */
   srgp_timestamp timestamp;
} deluxe_locator_measure;
typedef struct {
   char *buffer;
   int buffer_length;
   buttonStatus modifier_chord[3];
   point position;
   srgp_timestamp timestamp;
} deluxe_keyboard_measure;
typedef int canvasID;
typedef enum {FALSE, TRUE} boolean;
typedef unsigned short  ush;
typedef int (*funcptr)();
typedef struct {
   writeMode write_mode;
   rectangle clip_rectangle;
   int font;
   lineStyle line_style;
   int line_width;
   markerStyle marker_style;
   int marker_size;
   int color, background_color;
   int plane_mask;
   drawStyle fill_style;
   int fill_pixmap_pattern_id;
   int fill_bitmap_pattern_id;
   drawStyle pen_style;
   int pen_pixmap_pattern_id;
   int pen_bitmap_pattern_id;
} attribute_group;
typedef enum {FATAL_ERRORS, NON_FATAL_ERRORS} errorHandlingMode;

GLOBAL VARIABLES
extern int SRGP_errorOccurred;

ROUTINES (arranged by SRGP source modules)
/******************** attribute.c */
void 	    SRGP_setAttributes (attribute_group*);
void	    SRGP_setBackgroundColor (int value);
void	    SRGP_setClipRectangle (rect);
void 	    SRGP_setColor (int value);
void 	    SRGP_setFillBitmapPattern (int value);
void 	    SRGP_setFillPixmapPattern (int value);
void	    SRGP_setFillStyle (drawStyle);
void	    SRGP_setFont (int value);
void	    SRGP_setLineStyle (lineStyle);
void	    SRGP_setLineWidth (int value);
void	    SRGP_setMarkerStyle (markerStyle);
void	    SRGP_setMarkerSize (int value);
void	    SRGP_setPenBitmapPattern (int value);
void	    SRGP_setPenPixmapPattern (int value);
void 	    SRGP_setPenStyle (drawStyle);
void 	    SRGP_setPlaneMask (int value);
void 	    SRGP_setWriteMode (writeMode);
/******************** canvas.c */
canvasID    SRGP_createCanvas (int width, int height);
void	    SRGP_useCanvas (canvasID);
void	    SRGP_deleteCanvas (canvasID);
/******************** color.c */
void   	    SRGP_loadCommonColor (int entry, char *name);
void        SRGP_loadColorTable (int start, int cnt, ush *r, ush *g, ush *b);
/******************** cursor.c, font.c, patterntable.c */
void	    SRGP_loadCursor (int index, cursorShape);
void	    SRGP_loadFont (int font_index, char* filename);
int	    SRGP_loadBitmapPatternsFromFile (FILE*);
int         SRGP_loadPixmapPatternsFromFile (FILE*);
void	    SRGP_loadBitmapPattern (int index, char *data);
void        SRGP_loadPixmapPattern (int index, int *data);
/******************** input.c */
void	    SRGP_setInputMode (inputDevice, inputMode);
inputDevice SRGP_waitEvent (int maximum_wait_time);
void	    SRGP_getLocator (srgp__locator_measure*);
void	    SRGP_getKeyboard (char *measure, int bufsize);
void	    SRGP_getDeluxeLocator (srgp__deluxe_locator_measure*);
void	    SRGP_getDeluxeKeyboard (srgp__deluxe_keyboard_measure*);
void	    SRGP_sampleLocator (srgp__locator_measure*);
void	    SRGP_sampleKeyboard (char *measure, int bufsize);
void	    SRGP_sampleDeluxeLocator (srgp__deluxe_locator_measure*);
void	    SRGP_sampleDeluxeKeyboard (srgp__deluxe_keyboard_measure*);
void	    SRGP_setLocatorMeasure (pt position);
void	    SRGP_setKeyboardMeasure (char*);
void	    SRGP_setLocatorEchoType (echoType);
void 	    SRGP_setLocatorEchoCursorShape (int id);
void	    SRGP_setLocatorEchoRubberAnchor (pt position);
void	    SRGP_setLocatorButtonMask (buttonMask);
void	    SRGP_setKeyboardProcessingMode (keyboardMode);
void	    SRGP_setKeyboardEchoColor (int value);
void	    SRGP_setKeyboardEchoOrigin (pt position);
void	    SRGP_setKeyboardEchoFont (int fontindex);
/******************** inquire.c */
void	    SRGP_inquireAttributes (attribute_group *att_group);
canvasID    SRGP_inquireActiveCanvas (void);
rect 	    SRGP_inquireCanvasExtent (canvasID);
void	    SRGP_inquireCanvasSize (canvasID, int *w, int *h);
int	    SRGP_inquireCanvasDepth (void);
void	    SRGP_inquireTextExtent (char *, int *w, int *h, int *d);
void	    SRGP_inquireColorTable (int start, int cnt, ush *r, ush *g, ush *b);
/******************** output.c */
pt          SRGP_defPoint (int x, int y);
rect        SRGP_defRectangle (int lx, int by, int rx, int t);
void        SRGP_beep (void);
void        SRGP_pointCoord (int x, int y);
void        SRGP_point (pt);
void        SRGP_polyPoint (int vCount, point *vertices);
void        SRGP_polyPointCoord (int vCount, int *xs, int *ys);
void        SRGP_markerCoord (int x, int y);
void        SRGP_marker (pt);
void        SRGP_polyMarker (int vCount, point *vertices);
void        SRGP_polyMarkerCoord (int vCount, int *xlist, int *ylist);
void        SRGP_lineCoord (int x1, int y1, int x2, int y2);
void        SRGP_line (pt, pt);
void        SRGP_rectangleCoord (int lx, int by, int rx, int ty);
void        SRGP_rectanglePt (point bottom_left, point top_right);
void        SRGP_rectangle (rect);
void        SRGP_polyLine (int vCount, pt *vertices);
void        SRGP_polyLineCoord (int vxCount, int *xlist, int *ylist);
void        SRGP_polygon (int vCount, pt *vertices);
void        SRGP_polygonCoord (int vCount, int *xlist, int *ylist);
void        SRGP_fillRectangleCoord (int lx, int by, int rx, int ty);
void        SRGP_fillRectanglePt (pt bl, pt tr);
void        SRGP_fillRectangle (rect);
void        SRGP_fillPolygon (int vCount, pt *vertices);
void        SRGP_fillPolygonCoord (int vCount, int *xlist, int *ylist);
void        SRGP_ellipse (rect);
void        SRGP_ellipseArc (rect, double a1, double a2);
void        SRGP_fillEllipse (rect);
void        SRGP_fillEllipseArc (rect, double a1, double a2);
void        SRGP_text (pt, char*);
void        SRGP_refresh (void);
/******************** raster.c */
void        SRGP_copyPixel (canvasID src, rect s, pt d);
/******************** state.c */
void        SRGP_begin (char *name, int w, int h, int planes, boolean trace);
void        SRGP_disableDebugAids (void);
void        SRGP_setErrorHandlingMode (errorHandlingMode);
void        SRGP_enableSynchronous (void);
void        SRGP_tracing (boolean);
void	    SRGP_allowResize (boolean);
void 	    SRGP_registerResizeCallback (funcptr);
void 	    SRGP_changeScreenCanvasSize (int newwidth, int newheight);
void	    SRGP_end (void);
void 	    SRGP_setMaxCanvasIndex (int);
void 	    SRGP_setMaxPatternIndex (int);
void 	    SRGP_setMaxCursorIndex (int);
void 	    SRGP_setMaxFontIndex (int);
void 	    SRGP_setMaxPointlistSize (int);
void 	    SRGP_setMaxStringSize (int);

ROUTINES (arranged alphabetically)
void        SRGP_allowResize (boolean);
void        SRGP_beep (void);
void        SRGP_begin (char *name, int w, int h, int planes, boolean trace);
void 	    SRGP_changeScreenCanvasSize (int newwidth, int newheight);
void        SRGP_copyPixel (canvasID src, rect s, pt d);
canvasID    SRGP_createCanvas (int width, int height);
pt          SRGP_defPoint (int x, int y);
rect        SRGP_defRectangle (int lx, int by, int rx, int t);
void        SRGP_deleteCanvas (canvasID);
void        SRGP_disableDebugAids (void);
void        SRGP_ellipse (rect);
void        SRGP_ellipseArc (rect, double a1, double a2);
void        SRGP_enableSynchronous (void);
void        SRGP_end (void);
void	    SRGP_fillEllipse (rect);
void        SRGP_fillEllipseArc (rect, double a1, double a2);
void        SRGP_fillPolygon (int vCount, pt *vertices);
void        SRGP_fillPolygonCoord (int vCount, int *xlist, int *ylist);
void        SRGP_fillRectangle (rect);
void        SRGP_fillRectangleCoord (int lx, int by, int rx, int ty);
void        SRGP_fillRectanglePt (pt bl, pt tr);
void	    SRGP_getDeluxeLocator (srgp__deluxe_locator_measure*);
void	    SRGP_getDeluxeKeyboard (srgp__deluxe_keyboard_measure*);
void        SRGP_getKeyboard (char *measure, int bufsize);
void        SRGP_getLocator (srgp__locator_measure*);
canvasID    SRGP_inquireActiveCanvas (void);
void        SRGP_inquireAttributes (attribute_group *att_group);
int         SRGP_inquireCanvasDepth (void);
rect        SRGP_inquireCanvasExtent (canvasID);
void	    SRGP_inquireCanvasSize (canvasID, int* w, int *h);
void	    SRGP_inquireColorTable (int start, int cnt, ush *r, ush *g, ush *b);
rect        SRGP_inquireClipRectangle (void);
int         SRGP_inquireColor (void);
int         SRGP_inquireFont (void);
int         SRGP_inquireLineStyle (void);
int         SRGP_inquirePattern (void);
void        SRGP_inquireTextExtent (char *, int *w, int *h, int *d);
int         SRGP_inquireWriteMode (void);
void        SRGP_line (pt, pt);
void        SRGP_lineCoord (int x1, int y1, int x2, int y2);
void	    SRGP_loadBitmapPattern (int index, char *data);
int         SRGP_loadBitmapPatternsFromFile (FILE*);
void        SRGP_loadColorTable (int start, int cnt, ush *r, ush *g, ush *b);
void        SRGP_loadCommonColor (int entry, char *name);
void        SRGP_loadCursor (int index, cursorShape);
void        SRGP_loadFont (int font_index, char* filename);
void        SRGP_loadPixmapPattern (int index, int *data);
int         SRGP_loadPixmapPatternsFromFile (FILE*);
void        SRGP_marker (pt);
void        SRGP_markerCoord (int x, int y);
void        SRGP_point (pt);
void        SRGP_pointCoord (int x, int y);
void        SRGP_polygon (int vCount, pt *vertices);
void        SRGP_polygonCoord (int vCount, int *xlist, int *ylist);
void        SRGP_polyLine (int vCount, pt *vertices);
void        SRGP_polyLineCoord (int vxCount, int *xlist, int *ylist);
void        SRGP_polyMarker (int vCount, point *vertices);
void        SRGP_polyMarkerCoord (int vCount, int *xlist, int *ylist);
void        SRGP_polyPoint (int vCount, point *vertices);
void        SRGP_polyPointCoord (int vCount, int *xs, int *ys);
void        SRGP_rectangle (rect);
void        SRGP_rectangleCoord (int lx, int by, int rx, int ty);
void        SRGP_rectanglePt (point bottom_left, point top_right);
void        SRGP_refresh (void);
void        SRGP_registerResizeCallback (funcptr);
void	    SRGP_sampleDeluxeLocator (srgp__deluxe_locator_measure*);
void	    SRGP_sampleDeluxeKeyboard (srgp__deluxe_keyboard_measure*);
void        SRGP_sampleKeyboard (char *measure, int bufsize);
void        SRGP_sampleLocator (srgp__locator_measure*);
void        SRGP_setAttributes (attribute_group*);
void        SRGP_setBackgroundColor (int value);
void        SRGP_setClipRectangle (rect);
void        SRGP_setColor (int value);
void        SRGP_setErrorHandlingMode (errorHandlingMode);
void        SRGP_setFillBitmapPattern (int value);
void        SRGP_setFillPixmapPattern (int value);
void        SRGP_setFillStyle (drawStyle);
void        SRGP_setFont (int value);
void        SRGP_setInputMode (inputDevice, inputMode);
void        SRGP_setKeyboardEchoColor (int value);
void        SRGP_setKeyboardEchoFont (int fontindex);
void        SRGP_setKeyboardEchoOrigin (pt position);
void        SRGP_setKeyboardMeasure (char*);
void        SRGP_setKeyboardProcessingMode (keyboardMode);
void        SRGP_setLineStyle (lineStyle);
void        SRGP_setLineWidth (int value);
void        SRGP_setLocatorButtonMask (buttonMask);
void        SRGP_setLocatorEchoCursorShape (int id);
void        SRGP_setLocatorEchoRubberAnchor (pt position);
void        SRGP_setLocatorEchoType (echoType);
void        SRGP_setLocatorMeasure (pt position);
void        SRGP_setMarkerSize (int value);
void        SRGP_setMarkerStyle (markerStyle);
void 	    SRGP_setMaxCanvasIndex (int);
void 	    SRGP_setMaxPatternIndex (int);
void 	    SRGP_setMaxCursorIndex (int);
void 	    SRGP_setMaxFontIndex (int);
void 	    SRGP_setMaxPointlistSize (int);
void 	    SRGP_setMaxStringSize (int);
void        SRGP_setPenBitmapPattern (int value);
void        SRGP_setPenPixmapPattern (int value);
void        SRGP_setPenStyle (drawStyle);
void        SRGP_setPlaneMask (int value);
void        SRGP_setWriteMode (writeMode);
void        SRGP_text (pt, char*);
void        SRGP_tracing (boolean);
void        SRGP_useCanvas (canvasID);
inputDevice SRGP_waitEvent (int maximum_wait_time);

AUTHOR
David Sklar