/usr/include/ggi/internal/structs.h is in libggi2-dev 1:2.2.2-5ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | /* $Id: structs.h,v 1.18 2005/09/06 15:22:58 pekberg Exp $
******************************************************************************
LibGGI internal functions and macros
??? Add yourself in ???
Copyright (C) 1998 Andrew Apted [andrew@ggi-project.org]
Copyright (C) 1998-2000 Marcus Sundberg [marcus@ggi-project.org]
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.
******************************************************************************
*/
#ifndef _GGI_INTERNAL_STRUCTS_H
#define _GGI_INTERNAL_STRUCTS_H
struct ggi_visual;
struct ggi_resource;
typedef struct ggi_visual *ggi_visual_t;
typedef struct ggi_dlhandle *ggi_lib_id;
typedef struct ggi_resource *ggi_resource_t;
#include <ggi/types.h>
#include <ggi/ggi_ext.h>
#include <ggi/internal/dltypes.h>
#include <ggi/gg-queue.h>
#define GGI_VERSION_DLL 1
/* Create a OP version number from the library and structure revisions
* for (ABI compatability)
*/
#define GGI_VERSION_MK(st_rev) ((GGI_VERSION_DLL<<16)|st_rev)
#define GGI_LIBRARY_REVISION(vers) (((uint32_t)vers)>>16)
#define GGI_STRUCTURE_REVISION(vers) ((vers) & 0xFFFF)
/*
******************************************************************************
Misc internal structures
******************************************************************************
*/
/* Direct Buffer container */
typedef struct {
int num;
ggi_directbuffer **bufs;
int first_targetbuf, last_targetbuf;
} ggi_db_list;
/* GC structure */
#define GGI_GCCHANGED_FG (1<<0)
#define GGI_GCCHANGED_BG (1<<1)
#define GGI_GCCHANGED_CLIP (1<<2)
typedef struct ggi_gc
{
unsigned int version;
ggi_pixel fg_color; /* foreground pixel value */
ggi_pixel bg_color; /* background pixel value */
ggi_coord cliptl, clipbr; /* clipping rectangle */
ggi_pixel plane_mask; /* plane mask bits */
} ggi_gc;
/* Colormap */
enum ggi_colormap_region {
GGI_COLORMAP_RW_REGION = 0,
GGI_COLORMAP_RO_REGION = 1,
GGI_COLORMAP_RW_RO_REGION = 2
};
typedef struct ggi_colormap {
ggi_clut clut; /* color lookup table */
size_t rw_start; /* start index of r/w indeces */
size_t rw_stop; /* end index of r/w indices */
size_t ro_start; /* start index of r/o indices */
size_t ro_stop; /* end index of r/o indices */
void *priv; /* hook for target specific data */
/* Function hooks for target specific operations */
/* Returns the size of the void *priv */
size_t (*getPrivSize)(ggi_visual_t vis);
int (*setRW)(ggi_visual_t vis, size_t start, size_t end);
int (*setRO)(ggi_visual_t vis, size_t start, size_t end);
int (*getRW)(ggi_visual_t vis, size_t *start, size_t *end);
int (*getRO)(ggi_visual_t vis, size_t *start, size_t *end);
/* sets the palette and automatically determine the rw/ro start/end indeces */
ggifunc_setPalette* setPalette;
ssize_t (*findByColor)(ggi_visual_t vis, const ggi_color *color,
enum ggi_colormap_region region);
ssize_t (*findByIdx)(ggi_visual_t vis, size_t idx,
enum ggi_colormap_region region);
int (*matchByColor)(ggi_visual_t vis,
const ggi_color *color1,
const ggi_color *color2,
enum ggi_colormap_region region);
int (*matchByIdx)(ggi_visual_t vis, size_t idx1, size_t idx2,
enum ggi_colormap_region region);
} ggi_colormap;
/* Gamma state structure. */
typedef struct ggi_gammastate
{
ggi_float gamma_r, gamma_g, gamma_b; /* gamma factors */
ggi_color *map; /* Explicitly provided map */
/* Number of writeable/readable entries in map. */
/* maxwrite_* == -1 means only factors usable. */
int maxwrite_r, maxwrite_g, maxwrite_b;
int maxread_r, maxread_g, maxread_b;
int start; /* first index in .map */
int len; /* number of map fields */
} ggi_gammastate;
/* Resource structure */
struct ggi_resource;
typedef struct ggi_resource {
ggifunc_resacquire *acquire;
ggifunc_resrelease *release;
void *self; /* The structure being locked */
void *priv; /* Private data needed for acquire/release: */
int count; /* Usage counter */
uint32_t curactype; /* Current access type */
} ggi_resource;
/* Variables needed to support physical units like
* dpi and mm in a target (optional, stored in target-private area)
*/
#define PHYSZ_DATA \
int physzflags; \
ggi_coord physz; \
/*
******************************************************************************
Structures to manage dynamicly loaded modules
******************************************************************************
*/
typedef struct ggi_dlhandle {
gg_module *handle;
char *name;
int usecnt;
int type;
struct ggi_visual *visual;
ggifunc_dlentry *entry;
ggifunc_open *open;
ggifunc_exit *exit;
ggifunc_close *close;
} ggi_dlhandle;
typedef struct ggi_dlhandle_l {
struct ggi_dlhandle *handle;
GG_SLIST_ENTRY(ggi_dlhandle_l) dllist;
} ggi_dlhandle_l;
typedef struct ggi_extension {
char name[32];
int id;
int initcount;
size_t size;
int (*paramchange)(ggi_visual_t,int whatchanged);
GG_TAILQ_ENTRY(ggi_extension) extlist;
} ggi_extension;
typedef struct {
int attachcount;
void *priv;
} ggi_extlist;
/*
******************************************************************************
ggi_visual structure and operations
******************************************************************************
*/
#define _GGI_NROF_HELPERS 20
/*
* Increment the version number every time you add
* new features.
*/
#define GGI_VERSION_VISUAL GGI_VERSION_MK(1)
typedef struct ggi_visual {
unsigned int version;
void *mutex; /* Lock when changing.. */
GG_SLIST_ENTRY(ggi_visual) vislist; /* Single visual list */
ggi_flags flags; /* Flags */
/* used to be gamma. pad for binary compat until next major release. */
ggi_float dummy1, dummy2, dummy3;
/*
Integer values [9/15]
*/
int fd; /* File descriptor for use by target */
int d_frame_num; /* Current display frame */
int r_frame_num; /* Current read frame */
int w_frame_num; /* Current write frame */
int origin_x; /* Current origin */
int origin_y;
int numknownext; /* Number of registered extensions */
int needidleaccel; /* Accelerator must be idled before
accessing framebuffer */
int accelactive; /* Accelerator is active */
int dummyint[6]; /* For future expansion */
/*
Operation struct pointers [4/10]
*/
struct ggi_visual_opdisplay *opdisplay; /* Display open/mode setting */
struct ggi_visual_opgc *opgc; /* GC operations */
struct ggi_visual_opcolor *opcolor; /* Color & Palette Ops */
struct ggi_visual_opdraw *opdraw; /* Drawing operations */
void *opdummy[5]; /* For future expansion */
GG_SLIST_HEAD(generic_ext,ggi_dlhandle_l) generic_ext; /* extensions for generic libs */
/*
Other pointers [36/36] (Adding stuff to the end of the visual is no
problem as all dynamic libraries only handles
pointers to visuals)
*/
ggi_directbuffer *r_frame; /* Quick access pointers for the */
ggi_directbuffer *w_frame; /* linear-* libraries */
ggi_gc *gc; /* Graphics context */
ggi_colormap *palette; /* Current palette */
ggi_mode *mode; /* Current mode */
ggi_pixelformat *pixfmt; /* Format of the pixels */
struct gii_input *input; /* Input handle for visual */
void *targetpriv; /* Target private data */
ggi_db_list *app_dbs; /* List of public DBs */
ggi_db_list *priv_dbs; /* List of private DBs */
GG_SLIST_HEAD(dlhandle,ggi_dlhandle_l) dlhandle; /* Handles to dynamic libs */
/* Extension stuff */
GG_SLIST_HEAD(extlib,ggi_dlhandle_l) extlib; /* Dynamic libs from extensions */
ggi_extlist *extlist; /* Pointer to array of private data */
void *drvpriv[_GGI_NROF_HELPERS]; /* Driver private data */
void *helperpriv; /* Helper library private data */
ggi_gammastate *gamma; /* was genericpriv (obselete) */
void *colorpriv; /* Color library private data */
} ggi_visual;
#define GGI_DL_ERROR 0x80000000
#define GGI_DL_OPDISPLAY 0x00000001
#define GGI_DL_OPCOLOR 0x00000002
#define GGI_DL_OPDRAW 0x00000004
#define GGI_DL_EXTENSION 0x00000008
#define GGI_DL_OPGC 0x00000010
#define GGI_DLTYPE_INTERNAL 0x01
#define GGI_DLTYPE_EXTENSION 0x02
#define GGI_DLTYPE_GLOBAL 0x04 /* Resolve library's exported symbols */
struct ggi_op_head {
unsigned int version;
GG_SLIST_HEAD(_dlhandle,ggi_dlhandle_l) dlhandle;
void *dummy; /* For future expansion */
};
/* Display and mode setting management
* Increment the version number every time you change/add a function.
*/
#define GGI_VERSION_VISUAL_OPDISPLAY GGI_VERSION_MK(1)
#define GGI_OPDISPLAY_NUMFUNCS 20
struct ggi_visual_opdisplay {
struct ggi_op_head head;
/*------- Section: Misc management (5/10 slots) -------------*/
/* Flush all pending operations */
ggifunc_flush *flush;
/* Send a KGI command if possible */
ggifunc_kgicommand *kgicommand;
/* Get current list of active APIs */
ggifunc_getapi *getapi;
/* Set various flags for visual, e.g. ASYNC mode */
ggifunc_setflags *setflags;
/* Idle the accelerator */
ggifunc_idleaccel *idleaccel;
void *dummy_miscman[5]; /* Place holder */
/*------- Section: Mode management (3/5 slots) -------------*/
/* Get the display mode */
ggifunc_getmode *getmode;
/* Check the display mode */
ggifunc_checkmode *checkmode;
/* Set the display mode */
ggifunc_setmode *setmode;
void *dummy_mode[2]; /* Place holder */
/*------- Section: Event management (0/5 slots) ------------*/
ggifunc_sendevent *sendevent;
void *dummy_event[4];/* Place holder */
};
/* Color and palette management
* Increment the version number every time you change/add a function.
*/
#define GGI_VERSION_VISUAL_OPCOLOR GGI_VERSION_MK(1)
#define GGI_OPCOLOR_NUMFUNCS 20
struct ggi_visual_opcolor {
struct ggi_op_head head;
/*------- Section: Color (6/10 slots) -------------*/
/* Map a color into a ggi_pixel - used for the drawinfo structure */
ggifunc_mapcolor *mapcolor;
/* Map a ggi_pixel into a color */
ggifunc_unmappixel *unmappixel;
/* Pack a len size array of ggi_color into buffer - use getbpp! */
ggifunc_packcolors *packcolors;
/* Unpack an array of pixels into an array of colors */
ggifunc_unpackpixels *unpackpixels;
/* Set palette */
ggifunc_setpalvec *setpalvec;
/* Get palette */
ggifunc_getpalvec *getpalvec;
void *dummy_color[4]; /* Place holder */
/*------- Section: Gamma (4/10 slots) -------------*/
/* Get the gamma value */
ggifunc_getgamma *getgamma;
/* Set the gamma value */
ggifunc_setgamma *setgamma;
/* Get the gamma map explicitly */
ggifunc_getgammamap *getgammamap;
/* Set the gamma map explicitly */
ggifunc_setgammamap *setgammamap;
void *dummy_gamma[6]; /* Place holder */
};
/* Drawing functions
* Increment the version number every time you change/add a function.
*/
#define GGI_VERSION_VISUAL_OPDRAW GGI_VERSION_MK(1)
#define GGI_OPDRAW_NUMFUNCS 55
struct ggi_visual_opdraw {
struct ggi_op_head head;
/*------- Section: Framebuffer (4/10 slots) -------------*/
ggifunc_setorigin *setorigin;
ggifunc_setdisplayframe *setdisplayframe;
ggifunc_setreadframe *setreadframe;
ggifunc_setwriteframe *setwriteframe;
void *dummy_fb[6]; /* Place holders */
/*------- Section: Misc graphics (4/10 slots) -------------*/
ggifunc_fillscreen *fillscreen;
ggifunc_putc *putc;
ggifunc_puts *puts;
ggifunc_getcharsize *getcharsize;
void *dummy_misc[6]; /* Place holders */
/*------- Section: Pixel graphics (5/10 slots) -------------*/
ggifunc_drawpixel *drawpixel;
ggifunc_putpixel *putpixel;
ggifunc_getpixel *getpixel;
ggifunc_drawpixel_nc *drawpixel_nc;
ggifunc_putpixel_nc *putpixel_nc;
void *dummy_pixel[5]; /* Place holders */
/*------- Section: Simple Line graphics (9/15 slots) -------------*/
ggifunc_drawline *drawline;
ggifunc_drawhline *drawhline;
ggifunc_puthline *puthline;
ggifunc_gethline *gethline;
ggifunc_drawvline *drawvline;
ggifunc_putvline *putvline;
ggifunc_getvline *getvline;
ggifunc_drawhline_nc *drawhline_nc;
ggifunc_drawvline_nc *drawvline_nc;
void *dummy_line[6]; /* Place holders */
/*------- Section: Box blitting (5/10 slots) -------------*/
ggifunc_drawbox *drawbox;
ggifunc_putbox *putbox;
ggifunc_getbox *getbox;
ggifunc_copybox *copybox;
ggifunc_crossblit *crossblit;
void *dummy_blit[5]; /* Place holders */
};
/* GC operation
* Increment the version number every time you change/add a function.
*/
#define GGI_VERSION_VISUAL_OPGC GGI_VERSION_MK(1)
#define GGI_OPGC_NUMFUNCS 5
struct ggi_visual_opgc {
struct ggi_op_head head;
/*------- Section: Misc (1/5 slots) -------------*/
/* Report gc changes */
ggifunc_gcchanged *gcchanged;
void *dummy_gc[4]; /* Place holders */
};
/* Don't know if that is a good place ... but making it a file of its own
* seems like overkill. Andy.
*/
typedef enum {
GGI_DB_STD_WEIRD=0,
GGI_DB_STD_1a8lbl=0x01000000, /* Mono, low bit left */
GGI_DB_STD_1a8hbl, /* Mono, high bit left */
GGI_DB_STD_2a8lpl=0x02000000, /* 2 bit, low pair left */
GGI_DB_STD_2a8hpl, /* 2 bit, high pair left */
GGI_DB_STD_4a8lnl=0x04000000, /* 4 bit, low nibble left */
GGI_DB_STD_4a8hnl, /* 4 bit, high nibble left */
GGI_DB_STD_8a8i8=0x08000000, /* 8 bit indexed */
GGI_DB_STD_8a8r3g3b2, /* 8 bit RGB 3/3/2 */
GGI_DB_STD_15a16p1r5g5b5=0x10000000, /* 15 bit RGB 5/5/5 native
endian */
GGI_DB_STD_15a16p1r5g5b5rev, /* 15 bit RGB 5/5/5 reverse
endian */
GGI_DB_STD_15a16p1b5g5r5, /* 15 bit BGR 5/5/5 native
endian */
GGI_DB_STD_15a16p1b5g5r5rev, /* 15 bit BGR 5/5/5 reverse
endian */
GGI_DB_STD_16a16r5g6b5=0x11000000, /* 16 bit RGB 5/6/5 native
endian */
GGI_DB_STD_16a16r5g6b5rev, /* 16 bit RGB 5/6/5 reverse
endian */
GGI_DB_STD_16a16b5g6r5, /* 16 bit BGR 5/6/5 native
endian */
GGI_DB_STD_16a16b5g6r5rev, /* 16 bit BGR 5/6/5 reverse
endian */
GGI_DB_STD_24a24r8g8b8=0x18000000, /* 24 bit RGB */
GGI_DB_STD_24a24b8g8r8, /* 24 bit BGR */
GGI_DB_STD_24a32p8r8g8b8=0x20000000, /* 32 bit <PAD>RGB */
GGI_DB_STD_24a32b8g8r8p8, /* 32 bit BGR<PAD> */
GGI_DB_STD_24a32r8g8b8p8, /* 32 bit RGB<PAD> */
GGI_DB_STD_24a32p8b8g8r8, /* 32 bit <PAD>BGR */
GGI_DB_STD_last /* Just to have a special entry to avoid the common
,-at-end warning after changes :-) */
} ggi_db_stdformat;
#endif /* _GGI_INTERNAL_STRUCTS_H */
|