Subversion Repositories shark

Rev

Rev 80 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
54 pj 1
/* VGAlib version 1.2 - (c) 1993 Tommy Frandsen                    */
2
/*                                                                 */
3
/* This library is free software; you can redistribute it and/or   */
4
/* modify it without any restrictions. This library is distributed */
5
/* in the hope that it will be useful, but without any warranty.   */
6
 
7
/* Extended for svgalib by Harm Hanemaayer and Hartmut Schirmer */
8
 
9
#ifndef VGA_H
10
#define VGA_H
11
 
12
#include <sys/types.h>
13
#include <sys/time.h>
110 giacomo 14
#include <drivers/glib.h>
54 pj 15
#include <kernel/log.h>
16
 
80 pj 17
#include "ll/sys/cdefs.h"
54 pj 18
 
80 pj 19
__BEGIN_DECLS
54 pj 20
#define rgb15(r, g, b) ((((WORD)(r & 0xF8)>>3) << 10) | (((WORD)(g & 0xF8)>>3) << 5) | ((WORD)(b & 0xF8)>>3))
21
#define rgb16(r, g, b) ((((WORD)(r & 0xF8)>>3) << 11) | (((WORD)(g & 0xFC)>>2) << 5) | ((WORD)(b & 0xF8)>>3))
22
#define rgb24(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
23
#define rgb32(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
24
#define rgba(r, g, b) (((DWORD)(b & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(r & 0xFF))
25
 
26
#define SVGALIB_VER 0x010900
27
 
28
#define TEXT         0          /* Compatible with VGAlib v1.2 */
29
#define G320x200x16  1
30
#define G640x200x16  2
31
#define G640x350x16  3
32
#define G640x480x16  4
33
#define G320x200x256 5
34
#define G320x240x256 6
35
#define G320x400x256 7
36
#define G360x480x256 8
37
#define G640x480x2   9
38
 
39
#define G640x480x256 10
40
#define G800x600x256 11
41
#define G1024x768x256 12
42
 
43
#define G1280x1024x256 13       /* Additional modes. */
44
 
45
#define G320x200x32K 14
46
#define G320x200x64K 15
47
#define G320x200x16M 16
48
#define G640x480x32K 17
49
#define G640x480x64K 18
50
#define G640x480x16M 19
51
#define G800x600x32K 20
52
#define G800x600x64K 21
53
#define G800x600x16M 22
54
#define G1024x768x32K 23
55
#define G1024x768x64K 24
56
#define G1024x768x16M 25
57
#define G1280x1024x32K 26
58
#define G1280x1024x64K 27
59
#define G1280x1024x16M 28
60
 
61
#define G800x600x16 29
62
#define G1024x768x16 30
63
#define G1280x1024x16 31
64
 
65
#define G720x348x2 32           /* Hercules emulation mode */
66
 
67
#define G320x200x16M32 33       /* 32-bit per pixel modes. */
68
#define G640x480x16M32 34
69
#define G800x600x16M32 35
70
#define G1024x768x16M32 36
71
#define G1280x1024x16M32 37
72
 
73
/* additional resolutions */
74
#define G1152x864x16 38
75
#define G1152x864x256 39
76
#define G1152x864x32K 40
77
#define G1152x864x64K 41
78
#define G1152x864x16M 42
79
#define G1152x864x16M32 43
80
 
81
#define G1600x1200x16 44
82
#define G1600x1200x256 45
83
#define G1600x1200x32K 46
84
#define G1600x1200x64K 47
85
#define G1600x1200x16M 48
86
#define G1600x1200x16M32 49
87
 
88
#define G320x240x256V 50
89
#define G320x240x32K 51
90
#define G320x240x64K 52
91
#define G320x240x16M 53
92
#define G320x240x16M32 54
93
 
94
#define G400x300x256 55
95
#define G400x300x32K 56
96
#define G400x300x64K 57
97
#define G400x300x16M 58
98
#define G400x300x16M32 59
99
 
100
#define G512x384x256 60
101
#define G512x384x32K 61
102
#define G512x384x64K 62
103
#define G512x384x16M 63
104
#define G512x384x16M32 64
105
 
106
#define G960x720x256 65
107
#define G960x720x32K 66
108
#define G960x720x64K 67
109
#define G960x720x16M 68
110
#define G960x720x16M32 69
111
 
112
#define G1920x1440x256 70
113
#define G1920x1440x32K 71
114
#define G1920x1440x64K 72
115
#define G1920x1440x16M 73
116
#define G1920x1440x16M32 74
117
 
118
/* The following modes have been introduced by SciTech Display Doctor */
119
 
120
#define G320x400x256V 75
121
#define G320x400x32K 76
122
#define G320x400x64K 77
123
#define G320x400x16M 78
124
#define G320x400x16M32 79
125
 
126
#define G640x400x256 80
127
#define G640x400x32K 81
128
#define G640x400x64K 82
129
#define G640x400x16M 83
130
#define G640x400x16M32 84
131
 
132
#define G320x480x256 85
133
#define G320x480x32K 86
134
#define G320x480x64K 87
135
#define G320x480x16M 88
136
#define G320x480x16M32 89
137
 
138
#define G720x540x256 90
139
#define G720x540x32K 91
140
#define G720x540x64K 92
141
#define G720x540x16M 93
142
#define G720x540x16M32 94
143
 
144
#define G848x480x256 95
145
#define G848x480x32K 96
146
#define G848x480x64K 97
147
#define G848x480x16M 98
148
#define G848x480x16M32 99
149
 
150
#define G1072x600x256 100
151
#define G1072x600x32K 101
152
#define G1072x600x64K 102
153
#define G1072x600x16M 103
154
#define G1072x600x16M32 104
155
 
156
#define G1280x720x256 105
157
#define G1280x720x32K 106
158
#define G1280x720x64K 107
159
#define G1280x720x16M 108
160
#define G1280x720x16M32 109
161
 
162
#define G1360x768x256 110
163
#define G1360x768x32K 111
164
#define G1360x768x64K 112
165
#define G1360x768x16M 113
166
#define G1360x768x16M32 114
167
 
168
#define G1800x1012x256 115
169
#define G1800x1012x32K 116
170
#define G1800x1012x64K 117
171
#define G1800x1012x16M 118
172
#define G1800x1012x16M32 119
173
 
174
#define G1920x1080x256 120
175
#define G1920x1080x32K 121
176
#define G1920x1080x64K 122
177
#define G1920x1080x16M 123
178
#define G1920x1080x16M32 124
179
 
180
#define G2048x1152x256 125
181
#define G2048x1152x32K 126
182
#define G2048x1152x64K 127
183
#define G2048x1152x16M 128
184
#define G2048x1152x16M32 129
185
 
186
#define G2048x1536x256 130
187
#define G2048x1536x32K 131
188
#define G2048x1536x64K 132
189
#define G2048x1536x16M 133
190
#define G2048x1536x16M32 134
191
 
192
#define G512x480x256 135
193
#define G512x480x32K 136
194
#define G512x480x64K 137
195
#define G512x480x16M 138
196
#define G512x480x16M32 139
197
 
198
#define G400x600x256 140
199
#define G400x600x32K 141
200
#define G400x600x64K 142
201
#define G400x600x16M 143
202
#define G400x600x16M32 144
203
 
204
#define G400x300x256X 145
205
 
206
#define G320x200x256V 146
207
 
208
#define __GLASTMODE G320x200x256V
209
#define GLASTMODE vga_lastmodenumber()
210
 
211
#define IS_IN_STANDARD_VGA_DRIVER(mode) ( \
212
        ((mode) < G640x480x256) || ((mode) == G720x348x2) || \
213
        ( ((mode) >= G400x300x256X) && ((mode) <= G400x300x256X) ) )
214
 
215
    extern int vga_version;
216
    extern int __svgalib_chipset;
217
 
218
    extern int vga_setmode(int mode, int set_chipset);
219
    extern int vga_hasmode(int mode);
220
    extern int vga_setflipchar(int c);
221
 
222
    extern int vga_clear(void);
223
    extern int vga_flip(void);
224
 
225
    extern int vga_getxdim(void);
226
    extern int vga_getydim(void);
227
    extern int vga_getcolors(void);
228
 
229
    extern int vga_setpalette(int index, int red, int green, int blue);
230
    extern int vga_getpalette(int index, int *red, int *green, int *blue);
231
    extern int vga_setpalvec(int start, int num, int *pal);
232
    extern int vga_getpalvec(int start, int num, int *pal);
233
 
234
    extern int vga_screenoff(void);
235
    extern int vga_screenon(void);
236
 
237
    extern int vga_setcolor(int color);
238
    extern int vga_drawpixel(int x, int y);
239
    extern int vga_drawline(int x1, int y1, int x2, int y2);
240
    extern int vga_drawscanline(int line, unsigned char *colors);
241
    extern int vga_drawscansegment(unsigned char *colors, int x, int y, int length);
242
    extern int vga_getpixel(int x, int y);      /* Added. */
243
    extern int vga_getscansegment(unsigned char *colors, int x, int y, int length);
244
 
245
    extern int vga_getch(void);
246
 
247
    extern int vga_dumpregs(void);
248
 
249
 
250
/* Extensions to VGAlib v1.2: */
251
 
252
/* blit flags */
253
#define HAVE_BITBLIT 1
254
#define HAVE_FILLBLIT 2
255
#define HAVE_IMAGEBLIT 4
256
#define HAVE_HLINELISTBLIT 8
257
#define HAVE_BLITWAIT 16
258
 
259
/* other flags */
260
#define HAVE_RWPAGE 1           /* vga_setreadpage() / vga_setwritepage() available */
261
#define IS_INTERLACED 2         /* mode is interlaced */
262
#define IS_MODEX 4              /* ModeX style 256 colors */
263
#define IS_DYNAMICMODE 8        /* Dynamic defined mode */
264
#define CAPABLE_LINEAR 16       /* Can go to linear addressing mode. */
265
#define IS_LINEAR 32            /* Linear addressing can be used. */
266
#define LINEAR_MODE 512         /* Linear mode is enabled */
267
#define EXT_INFO_AVAILABLE 64   /* Returned modeinfo contains valid extended fields */
268
#define RGB_MISORDERED 128      /* Mach32 32bpp uses 0BGR instead of BGR0. */
269
    /* As of this version 1.25 also used to signal if real RGB
270
       (red first in memory) is used instead of BGR (Mach32 DAC 4) */
271
#define HAVE_EXT_SET 256        /* vga_ext_set() available */
272
 
273
    typedef struct {
274
        int width;
275
        int height;
276
        int bytesperpixel;
277
        int colors;
278
        int linewidth;          /* scanline width in bytes */
279
        int maxlogicalwidth;    /* maximum logical scanline width */
280
        int startaddressrange;  /* changeable bits set */
281
        int maxpixels;          /* video memory / bytesperpixel */
282
        int haveblit;           /* mask of blit functions available */
283
        int flags;              /* other flags */
284
 
285
        /* Extended fields: */
286
 
287
        int chiptype;           /* Chiptype detected */
288
        int memory;             /* videomemory in KB */
289
        int linewidth_unit;     /* Use only a multiple of this as parameter for set_logicalwidth and
290
                                   set_displaystart */
291
        char *linear_aperture;  /* points to mmap secondary mem aperture of card (NULL if unavailable) */
292
        int aperture_size;      /* size of aperture in KB if size>=videomemory. 0 if unavail */
293
        void (*set_aperture_page) (int page);
294
        /* if aperture_size<videomemory select a memory page */
295
        void *extensions;       /* points to copy of eeprom for mach32 */
296
        /* depends from actual driver/chiptype.. etc. */
297
    } vga_modeinfo;
298
 
299
    typedef struct {
300
        int version;
301
        int size;
302
        int chipset;
303
        int physmem;
304
    } vga_cardinfo;
305
 
306
    extern vga_cardinfo *vga_getcardinfo(void);
307
    extern vga_modeinfo *vga_getmodeinfo(int mode);
308
    extern int vga_getdefaultmode(void);
309
    extern int vga_getcurrentmode(void);
310
    extern int vga_getcurrentchipset(void);
311
    extern char *vga_getmodename(int mode);
312
    extern int vga_getmodenumber(char *name);
313
    extern int vga_lastmodenumber(void);
314
    extern int vga_getoptmode(int x, int y, int colors, int bytesperpixel, int c);
315
 
316
    extern unsigned char *graph_mem;
317
    extern unsigned char *vga_getgraphmem(void);
318
 
319
    extern void vga_setpage(int p);
320
    extern void vga_setreadpage(int p);
321
    extern void vga_setwritepage(int p);
322
    extern void vga_setlogicalwidth(int w);
323
    extern void vga_setdisplaystart(int a);
324
    extern void vga_waitretrace(void);
325
    extern int vga_claimvideomemory(int n);
326
    extern void vga_disabledriverreport(void);
327
    extern int vga_setmodeX(void);
328
    extern int vga_init(void);  /* Used to return void in svgalib <= 1.12. */
329
    extern int vga_initf(int); 
330
    extern int vga_getmousetype(void);
331
    extern int vga_getmonitortype(void);
332
    extern void vga_setmousesupport(int s);
333
    extern void vga_lockvc(void);
334
    extern void vga_unlockvc(void);
335
    extern int vga_getkey(void);
336
    extern int vga_oktowrite(void);
337
    extern void vga_copytoplanar256(unsigned char *virtualp, int pitch,
338
                                  int voffset, int vpitch, int w, int h);
339
    extern void vga_copytoplanar16(unsigned char *virtualp, int pitch,
340
                                   int voffset, int vpitch, int w, int h);
341
    extern void vga_copytoplane(unsigned char *virtualp, int pitch,
342
                       int voffset, int vpitch, int w, int h, int plane);
343
    extern int vga_setlinearaddressing(void);
344
    extern void vga_safety_fork(void (*shutdown_routine) (void));
345
 
346
    extern int vga_simple_init(void);
347
    extern void vga_chipset_saveregs(unsigned char *);
348
    extern void vga_chipset_setregs(unsigned char *);
349
 
350
#ifdef EGA                      /* Kernel headers may define this. */
351
#undef EGA
352
#endif
353
 
354
#define UNDEFINED       0
355
#define VGA             1
356
#define ET4000          2
357
#define CIRRUS          3
358
#define TVGA8900        4
359
#define OAK             5
360
#define EGA             6
361
#define S3              7
362
#define ET3000          8
363
#define MACH32          9
364
#define GVGA6400        10
365
#define ARK             11
366
#define ATI             12
367
#define ALI             13
368
#define MACH64          14
369
#define CHIPS           15
370
#define APM             16
371
#define NV3             17
372
#define ET6000          18
373
#define VESA            19
374
#define MX              20
375
#define PARADISE        21
376
#define RAGE            22
377
#define BANSHEE         23
378
#define SIS             24
379
#define I740            25
380
#define NEOMAGIC        26
381
#define LAGUNA          27
382
#define FBDEV           28
383
#define G400            29
384
#define R128            30
385
#define SAVAGE          31
386
#define MILLENNIUM      32
387
#define I810            33
388
#define TRIDENT         34
389
#define RENDITION       35
390
#define G450C2          36
391
#define PM2             37
392
 
393
    /* Hor. sync: */
394
#define MON640_60       0       /* 31.5 KHz (standard VGA) */
395
#define MON800_56       1       /* 35.1 KHz (old SVGA) */
396
#define MON1024_43I     2       /* 35.5 KHz (low-end SVGA, 8514) */
397
#define MON800_60       3       /* 37.9 KHz (SVGA) */
398
#define MON1024_60      4       /* 48.3 KHz (SVGA non-interlaced) */
399
#define MON1024_70      5       /* 56.0 KHz (SVGA high frequency) */
400
#define MON1024_72      6
401
 
402
    extern void vga_setchipset(int c);
403
    extern void vga_setchipsetandfeatures(int c, int par1, int par2);
404
    extern void vga_gettextfont(void *font);
405
    extern void vga_puttextfont(void *font);
406
    extern void vga_settextmoderegs(void *regs);
407
    extern void vga_gettextmoderegs(void *regs);
408
 
409
    extern int vga_white(void);
410
    extern int vga_setegacolor(int c);
411
    extern int vga_setrgbcolor(int r, int g, int b);
412
 
413
    extern void vga_bitblt(int srcaddr, int destaddr, int w, int h, int pitch);
414
    extern void vga_imageblt(void *srcaddr, int destaddr, int w, int h, int pitch);
415
    extern void vga_fillblt(int destaddr, int w, int h, int pitch, int c);
416
    extern void vga_hlinelistblt(int ymin, int n, int *xmin, int *xmax, int pitch, int c);
417
    extern void vga_blitwait(void);
418
    extern int vga_ext_set(unsigned what,...);
419
    extern int vga_accel(unsigned operation,...);
420
 
421
    extern int vga_initcursor(int);
422
    extern void vga_showcursor(int);
423
    extern void vga_setcursorposition(int, int);
424
    extern void vga_selectcursor(int);
425
    extern void vga_setcursorimage(int, int, int, int, unsigned char *);
426
 
427
    inline void copy_videomem_32to16(void *src, void *dst, unsigned long int memdiv2);
74 giacomo 428
    inline void copy_videomem_16to16(void *src, void *dst, unsigned long int memdiv4);
54 pj 429
 
430
    extern int vga_setcrtcregs(unsigned char *);
431
    extern int vga_getcrtcregs(unsigned char *);
432
 
433
    extern int vga_addtiming(int pixelClock,
434
                              int HDisplay,            
435
                              int HSyncStart,
436
                              int HSyncEnd,
437
                              int HTotal,
438
                              int VDisplay,
439
                              int VSyncStart,
440
                              int VSyncEnd,
441
                              int VTotal,
442
                              int flags);
443
 
444
    extern int vga_changetiming(int pixelClock,
445
                              int HDisplay,            
446
                              int HSyncStart,
447
                              int HSyncEnd,
448
                              int HTotal,
449
                              int VDisplay,
450
                              int VSyncStart,
451
                              int VSyncEnd,
452
                              int VTotal,
453
                              int flags);
454
 
455
   extern int vga_getcurrenttiming(int *pixelClock,
456
                              int *HDisplay,           
457
                              int *HSyncStart,
458
                              int *HSyncEnd,
459
                              int *HTotal,
460
                              int *VDisplay,
461
                              int *VSyncStart,
462
                              int *VSyncEnd,
463
                              int *VTotal,
464
                              int *flags);
465
 
466
   extern int vga_addmode(int xdim, int ydim, int cols,
467
                          int xbytes, int bytespp);
468
 
469
   extern int vga_guesstiming(int x, int y, int clue, int arg);
470
 
471
   extern void vga_dpms(int mode);
472
 
473
/* Valid values for what in vga_ext_set: */
474
#define VGA_EXT_AVAILABLE       0       /* supported flags */
475
#define VGA_EXT_SET             1       /* set flag(s) */
476
#define VGA_EXT_CLEAR           2       /* clear flag(s) */
477
#define VGA_EXT_RESET           3       /* set/clear flag(s) */
478
#define VGA_EXT_PAGE_OFFSET     4       /* set an offset for all subsequent vga_set*page() calls */
479
    /* Like: vga_ext_set(VGA_EXT_PAGE_OFFSET, 42);           */
480
    /* returns the previous offset value.                    */
481
#define VGA_EXT_FONT_SIZE       5       /* the (maximal) size of the font buffer */
482
 
483
/* Valid params for VGA_EXT_AVAILABLE: */
484
#define VGA_AVAIL_SET           0       /* vga_ext_set sub funcs */
485
#define VGA_AVAIL_ACCEL         1       /* vga_accel sub funcs */
486
#define VGA_AVAIL_FLAGS         2       /* known flags for VGA_EXT_SET */
487
#define VGA_AVAIL_ROP           3       /* vga_accel ROP sub funcs */
488
#define VGA_AVAIL_TRANSPARENCY  4       /* vga_accel TRANSPARENCY sub funcs */
489
#define VGA_AVAIL_ROPMODES      5       /* vga_accel ROP modes supported funcs */
490
#define VGA_AVAIL_TRANSMODES    6       /* vga_accel TRANSPARENCY modes supported */
491
 
492
/* Known flags to vga_ext_set() */
493
#define VGA_CLUT8               1       /* 8 bit DAC entries */
494
 
495
/* Acceleration interface. */
496
 
497
/* Accel operations. */
498
#define ACCEL_FILLBOX                   1       /* Simple solid fill. */
499
#define ACCEL_SCREENCOPY                2       /* Simple screen-to-screen BLT. */
500
#define ACCEL_PUTIMAGE                  3       /* Straight image transfer. */
501
#define ACCEL_DRAWLINE                  4       /* General line draw. */
502
#define ACCEL_SETFGCOLOR                5       /* Set foreground color. */
503
#define ACCEL_SETBGCOLOR                6       /* Set background color. */
504
#define ACCEL_SETTRANSPARENCY           7       /* Set transparency mode. */
505
#define ACCEL_SETRASTEROP               8       /* Set raster-operation. */
506
#define ACCEL_PUTBITMAP                 9       /* Color-expand bitmap. */
507
#define ACCEL_SCREENCOPYBITMAP          10      /* Color-expand from screen. */
508
#define ACCEL_DRAWHLINELIST             11      /* Draw horizontal spans. */
509
#define ACCEL_SETMODE                   12      /* Set blit strategy. */
510
#define ACCEL_SYNC                      13      /* Wait for blits to finish. */
511
#define ACCEL_SETOFFSET                 14      /* Set screen offset */
512
#define ACCEL_SCREENCOPYMONO            15      /* Monochrome screen-to-screen BLT. */
513
#define ACCEL_POLYLINE                  16      /* Draw multiple lines. */
514
#define ACCEL_POLYHLINE                 17      /* Draw multiple horizontal spans. */
515
#define ACCEL_POLYFILLMODE              18      /* Set polygon mode. */
516
 
517
/* Corresponding bitmask. */
518
#define ACCELFLAG_FILLBOX               0x1     /* Simple solid fill. */
519
#define ACCELFLAG_SCREENCOPY            0x2     /* Simple screen-to-screen BLT. */
520
#define ACCELFLAG_PUTIMAGE              0x4     /* Straight image transfer. */
521
#define ACCELFLAG_DRAWLINE              0x8     /* General line draw. */
522
#define ACCELFLAG_SETFGCOLOR            0x10    /* Set foreground color. */
523
#define ACCELFLAG_SETBGCOLOR            0x20    /* Set background color. */
524
#define ACCELFLAG_SETTRANSPARENCY       0x40    /* Set transparency mode. */
525
#define ACCELFLAG_SETRASTEROP           0x80    /* Set raster-operation. */
526
#define ACCELFLAG_PUTBITMAP             0x100   /* Color-expand bitmap. */
527
#define ACCELFLAG_SCREENCOPYBITMAP      0x200   /* Color-exand from screen. */
528
#define ACCELFLAG_DRAWHLINELIST         0x400   /* Draw horizontal spans. */
529
#define ACCELFLAG_SETMODE               0x800   /* Set blit strategy. */
530
#define ACCELFLAG_SYNC                  0x1000  /* Wait for blits to finish. */
531
#define ACCELFLAG_SETOFFSET             0x2000  /* Set screen offset */
532
#define ACCELFLAG_SCREENCOPYMONO        0x4000  /* Monochrome screen-to-screen BLT. */
533
#define ACCELFLAG_POLYLINE              0x8000  /* Draw multiple lines. */
534
#define ACCELFLAG_POLYHLINE             0x10000 /* Draw multiple horizontal spans. */
535
#define ACCELFLAG_POLYFILLMODE          0x20000 /* Set polygon mode. */
536
 
537
/* Mode for SetTransparency. */
538
#define DISABLE_TRANSPARENCY_COLOR      0
539
#define ENABLE_TRANSPARENCY_COLOR       1
540
#define DISABLE_BITMAP_TRANSPARENCY     2
541
#define ENABLE_BITMAP_TRANSPARENCY      3
542
 
543
/* Flags for SetMode (accelerator interface). */
544
#define BLITS_SYNC                      0
545
#define BLITS_IN_BACKGROUND             0x1
546
 
547
/* Raster ops. */
548
#define ROP_COPY                        0       /* Straight copy. */
549
#define ROP_OR                          1       /* Source OR destination. */
550
#define ROP_AND                         2       /* Source AND destination. */
551
#define ROP_XOR                         3       /* Source XOR destination. */
552
#define ROP_INVERT                      4       /* Invert destination. */
553
 
554
/* For the poly funcs */
555
#define ACCEL_START                     1
556
#define ACCEL_END                       2
557
 
558
/*
559
 * wait for keypress, mousemove, I/O, timeout. cf. select (3) for details on
560
 * all parameters execept which.
561
 * NULL is a valid argument for any of the ptrs.
562
 */
563
 
564
//    extern int vga_waitevent(int which, fd_set * in, fd_set * out, fd_set * except, //SHARK
565
//                           struct timeval *timeout);  //SHARK
566
 
567
/*
568
 * valid values for what ( | is valid to combine them )
569
 */
570
#define VGA_MOUSEEVENT  1
571
#define VGA_KEYEVENT    2
572
 
573
/*
574
 * return value >= has bits set for mouse/keyboard events detected.
575
 * mouse and raw keyboard events are already handled and their bits removed
576
 * from *in when vga_waitevent returns.
577
 * VGA_KEYEVENT relates to vga_getch NOT vga_getkey.
578
 * return values < 0 signal errors. In this case check errno.
579
 */
580
 
581
/* Background running */
582
extern void vga_runinbackground(int stat, ...);
583
#define VGA_GOTOBACK -1
584
#define VGA_COMEFROMBACK -2
585
extern int vga_runinbackground_version(void);
586
 
80 pj 587
__END_DECLS
54 pj 588
 
589
#endif                          /* VGA_H */