LibGGI API Manual

Steve Cheng

Hartmut Niemann

This document describes the application programming interface for LibGGI, an extremely flexible and extensible, dynamic drawing library developed by the GGI project.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Table of Contents
Preface
1. Introduction
2. General
3. Library control
ggiInit — Initialize and uninitialize LibGGI
ggiPanic — Exit LibGGI programs for fatal errors
4. Visual management
ggiOpen — Open and close a visual
5. Mode management
The ggi_mode struct
ggi_graphtype
GGI_AUTO
Mode negotiation
Functions
ggiSetMode — Set, check or get a mode on a visual
ggiSetGraphMode — Set and check a text/graphics mode on a visual
ggiParseMode — Operate on formatted strings specifying LibGGI modes
6. Frame management
ggiSetDisplayFrame — Set or get the current frame for display, writing and reading
7. Color and palette
Basic data types
ggi_color
ggi_pixel
Color functions
ggiMapColor — Convert from ggi_color(s) to ggi_pixel(s) and vice versa
ggiSetPalette — Manipulate the palette of a visual
ggiSetColorfulPalette — Set a palette with a full range of all colors
ggiSetGamma — Manipulate the gamma maps and the gamma correction of a visual
8. ggi_pixelformat
ggiGetPixelFormat — Get a structure describing the format of a pixelvalue from a visual
9. Graphics context
ggiSetGCForeground — Set or get the foreground and background colors used in drawing operations in a visual
ggiSetGCClipping — Set or get the clipping rectangle for a visual
10. Primitives
ggiDrawPixel — Draw, put, and get a single pixel from a visual
ggiDrawHLine — Draw, put, and get a horizontal line from a visual
ggiDrawVLine — Draw, put, and get a vertical line from a visual
ggiDrawBox — Draw, put, and get a rectangle from a visual
ggiFillscreen — Fills the entire virtual screen
ggiDrawLine — Draw a line on a visual
11. DirectBuffer
Types of Buffers
Framebuffer
Pixel Linear Buffer
Accessing the Buffer
Paged Buffers
DirectBuffer Structures
Getting DirectBuffers
ggiDBGetBuffer — Get DirectBuffers from a visual
12. Miscellaneous functions
ggiResourceAcquire — Acquire and release a LibGGI resource
ggiSetFlags — Set or get flags affecting operation on a visual
ggiFlush — Flush pending output
13. Blits
ggiCopyBox — Copy a rectangular area
ggiCrossBlit — Copy a rectangular area between two visuals
14. Origin
ggiSetOrigin — Set and get origin of virtual screen
15. Character Output
ggiPutc — Draw one or more characters on visual
16. Event handling
ggiEventPoll — Event management for LibGGI visual
ggiGetc — Convenience functions for simplistic keyboard input