Nano-X Library API

Gary James

Sr Software Engineer
Critical Link, LLC

            gjames@twcny.rr.com
            gary.james@criticallink.com
          


Table of Contents
Release Information
1. Nano-X Function Groups
General Functions
Window Functions
Graphics Context Functions
Graphics Drawing Functions
Event Functions
Font Functions
Color Functions
Region Functions
Misc. Functions
2. Nano-X Function Reference
GrArc() — Draw an arc
GrArcAngle() — Draw an arc
GrArea() — Draw a pixel array
GrBell() — Ring bell on server
GrBitmap() — Draw a monochrome bitmap
GrCheckNextEvent() — Get an event from the queue
GrClearWindow() — Clear a window
GrClose() — Close the connection to the nano-X server
GrCloseWindow() — Close the specified window
GrCopyArea() — Copy from one drawable to another
GrCopyGC() — Copy a graphics context into a new graphics context
GrCreateFont() — Create a font
GrDefaultErrorHandler() — The default error handler
GrDestroyFont() — Destroy a font
GrDestroyGC() — Destroy a graphics context
GrDestroyRegion() — Destroy a region
GrDestroyWindow() — Destroy a window
GrDrawImageBits() — Draw an image
GrDrawImageFromFile() — Draw an image from a file
GrDrawImageToFit() — Draw an image with scaling
GrDrawLines() — Draw a set of lines
GrEllipse() — Draw an ellipse or circle
GrEmptyRegion() — Test for empty region
GrEqualRegion() — Test two regions for equality
GrFillEllipse() — Draw a filled ellipse or circle
GrFillPoly() — Draw a filled polygon
GrFillRect() — Draw a filled rectangle
GrFindColor() — Find closest color match
GrFlush() — Flushes the client/server message buffer
GrFreeImage() — Destroy an image buffer
GrGetFocus() — Get the current focus window
GrGetFontInfo() — Get information about a font
GrGetGCInfo() — Retrieve graphics context settings
GrGetGCTextSize() — Calculate size of a text drawing
GrGetImageInfo() — Retrieve information about an image
GrGetNextEvent() — Get an event from the queue
GrGetNextEventTimeout() — Get an event from the queue
GrGetRegionBox() — Get a region's bounding rectangle
GrGetScreenInfo() — Return screen properties
GrGetSysColor() — Get color by palette index
GrGetSystemPalette() — Get the colors of the system palette
GrGetWindowInfo() — Retrieve window information
GrGetWMProperties() — Retrieve a window's properties
GrInjectKeyboardEvent() — Simulate a keyboard event
GrInjectPointerEvent() — Simulate a pointer event
GrIntersectRegion() — Form a region from the intersection of two regions
GrKillWindow() — Kill the specified window
GrLine() — Draw a line
GrLoadImageFromFile() — Load an image from a file into memory
GrLowerWindow() — Lower a window
GrMainLoop() — Generic application event dispatch loop
GrMapWindow() — Map a window and it's children
GrMoveCursor() — Move the mouse cursor
GrMoveWindow() — Move a window
GrNewGC() — Create a new graphics context
GrNewInputWindow() — Create a new input window
GrNewPixmap() — Create a new pixmap
GrNewPixmapFromData() — Create a new pixmap and initialize it
GrNewPolygonRegion() — Create a polygon region
GrNewRegion() — Create a new region
GrNewWindow() — Create a new window
GrNewWindowEx() — Create a new window
GrOffsetRegion() — Offset a region
GrOpen() — Open a connection to the nano-X server
GrPeekEvent() — Peek an event from the queue
GrPoint() — Draw a point
GrPointInRegion() — Test for point in region
GrPoints() — Draw a set of points
GrPoly() — Draw a polygon
GrPrepareSelect() — Prepare an fdset for a select
GrRaiseWindow() — Raise a window
GrReadArea() — Read pixel data from a drawable
GrRect() — Draw a rectangle
GrRectInRegion() — Test for rectangle in region
GrRegisterInput() — Register a file descriptor to generate events
GrReparentWindow() — Change a window's parent
GrReqShmCmds() — Setup a shared memory interface
GrResizeWindow() — Resize a window
GR_RGB() — Create a color by RGB components
GrSelectEvents() — Select event types to receive
GrServiceSelect() — Dispatch nano-X events
GrSetBackgroundPixmap() — Set the windows background image
GrSetBorderColor() — Set a window's border color
GrSetCursor() — Specify a mouse cursor image
GrSetErrorHandler() — Setup an error handler
GrSetFocus() — Set the window focus
GrSetFontAttr() — Change font attributes
GrSetFontRotation() — Set the angle of a font
GrSetFontSize() — Set the size of a font
GrSetGCBackground() — Change the background color of a graphics context
GrSetGCFont() — Select a font to draw with
GrSetGCForeground() — Change the foreground color of a graphics context
GrSetGCMode() — Set the drawing mode of a graphics context
GrSetGCRegion() — Set the clipping region for a graphics context
GrSetGCUseBackground() — Enables/disables background usage
GrSetScreenSaverTimeout() — Set screen saver timeout
GrSetSystemPalette() — Set the colors of the system palette
GrSetWMProperties() — Set a window's properties
GrSetWindowBackgroundColor() — Set a window's background color
GrSetWindowBorderColor() — Set a window's border color
GrSetWindowBorderSize() — Set a window's border width
GrSetWindowTitle() — Set a window's title
GrSubtractRegion() — Form a region from the difference of two regions
GrText() — Draw text
GrUnionRectWithRegion() — Form union of rectangle and region
GrUnionRegion() — Form a region from the union of two other regions
GrUnmapWindow() — Unmap a window and it's children
GrXorRegion() — Form a region form the XOR two regions
3. Nano-X Data Types
GR_BITMAP — Bitmap unit
GR_BOOL — Boolean type
GR_BUTTON — Mouse button codes
GR_CHAR — Text character
GR_CHAR_WIDTH — Character width
GR_COORD — Coordinate value
GR_COLOR — Color value
GR_COUNT — Number of items
GR_DRAW_ID — Drawable ID
GR_ERROR — Error event codes
GR_EVENT — Generic event structure
GR_EVENT_BUTTON — Mouse button event structure
GR_EVENT_ERROR — Error event structure
GR_EVENT_EXPOSURE — Window exposure event structure
GR_EVENT_FDINPUT — File descriptor input event structure
GR_EVENT_GENERAL — General purpose event structure
GR_EVENT_KEYSTROKE — Keyboard event structure
GR_EVENT_MASK — Event masks
GR_EVENT_MOUSE — Mouse position event structure
GR_EVENT_SCREENSAVER — Screen saver event structure
GR_EVENT_TYPE — Event types
GR_EVENT_UPDATE — Window update event structure
GR_FNCALLBACKEVENT — Call back function prototype
GR_FONT_ID — Font ID
GR_FONT_INFO — Font properties
GR_FUNC_NAME — Function name string
GR_GC_ID — Graphics context ID
GR_GC_INFO — Graphics context information
GR_ID — Generic ID type
GR_IMAGE_ID — Image ID
GR_IMAGE_INFO — Image properties
GR_IMAGE_HDR — Image header
GR_KEY — Keyboard key codes
GR_KEYMOD — Keyboard modifier key codes
GR_LOGFONT — Font properties
GR_PALENTRY — Palette entry
GR_PALETTE — Color palette
GR_PIXELVAL — Hardware dependent color value
GR_POINT — Point structure
GR_RECT — Rectangle structure
GR_REGION_ID — Region ID
GR_SCANCODE — OEM keyboard scancode
GR_SCREEN_INFO — Screen properties
GR_SIZE — Graphic object size
GR_TIMEOUT — Time out value
GR_UPDATE_TYPE — Window update event, event subtypes
GR_WINDOW_ID — Window ID
GR_WINDOW_INFO — Retrieve window properties
GR_WM_PROPS — Window manager properties
GR_WM_PROPERTIES — Window manager property configuration
List of Tables
2-1. ROP Codes
2-1. GrSetBackgroundPixmap Flags
2-1. Font Attribute Flags
2-1. Drawing Modes
3-1. Mouse Buton Enumerations
3-1. 32bit Color Value
3-2. Basic Color Definitions
3-3. System Color Definitions
3-1. Error Codes
3-1. Event Mask Bits
3-1. Event Type Enumerations
3-1. Drawing Modes
3-1. Key Codes
3-1. Modifier Key Codes
3-1. GR_LOGFONT Macros
3-1. Update Enumerations
3-1. Window Manager Properties
3-1. GR_WM_PROPERTIES Flags
List of Examples
2-1. Using GrClose()
2-1. Using GrGetNextEvent()
2-1. Using GrMainLoop()
2-1. Using GrMapWindow()
2-1. Using GrNewWindowEx()
2-1. Using GrOpen()
2-1. Using GrSelectEvents()
2-1. Using GrSetCursor()
2-1. Using GrSetScreenSaverTimeout()
2-1. Using GrText()
3-1. Using GR_BITMAP
3-1. Using GR_EVENT
3-1. Using GR_EVENT_ERROR
3-1. Using GR_EVENT_TYPE_EXPOSURE
3-1. Using GR_EVENT_TYPE_CLOSE_REQ
3-1. Using GR_EVENT_KEYSTROKE
3-1. Using GR_EVENT_SCREENSAVER