| 1 |
|
| 2 |
|
| 3 |
#include "pdcos2.h" |
| 4 |
|
| 5 |
RCSID("$Id: pdcsetsc.c,v 1.44 2008/07/14 04:24:51 wmcbrine Exp $") |
| 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 |
int PDC_curs_set(int visibility) |
| 35 |
{ |
| 36 |
#ifndef EMXVIDEO |
| 37 |
VIOCURSORINFO pvioCursorInfo; |
| 38 |
#endif |
| 39 |
int ret_vis, hidden = 0, start = 0, end = 0; |
| 40 |
|
| 41 |
PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility)); |
| 42 |
|
| 43 |
ret_vis = SP->visibility; |
| 44 |
SP->visibility = visibility; |
| 45 |
|
| 46 |
switch(visibility) |
| 47 |
{ |
| 48 |
case 0: |
| 49 |
#ifdef EMXVIDEO |
| 50 |
start = end = 0; |
| 51 |
#else |
| 52 |
start = pdc_font / 4; |
| 53 |
end = pdc_font; |
| 54 |
hidden = -1; |
| 55 |
#endif |
| 56 |
break; |
| 57 |
|
| 58 |
case 2: |
| 59 |
start = 2; |
| 60 |
end = pdc_font - 1; |
| 61 |
break; |
| 62 |
|
| 63 |
default: |
| 64 |
start = (SP->orig_cursor >> 8) & 0xff; |
| 65 |
end = SP->orig_cursor & 0xff; |
| 66 |
} |
| 67 |
|
| 68 |
#ifdef EMXVIDEO |
| 69 |
if (!visibility) |
| 70 |
v_hidecursor(); |
| 71 |
else |
| 72 |
v_ctype(start, end); |
| 73 |
#else |
| 74 |
pvioCursorInfo.yStart = (USHORT)start; |
| 75 |
pvioCursorInfo.cEnd = (USHORT)end; |
| 76 |
pvioCursorInfo.cx = (USHORT)1; |
| 77 |
pvioCursorInfo.attr = hidden; |
| 78 |
VioSetCurType((PVIOCURSORINFO)&pvioCursorInfo, 0); |
| 79 |
#endif |
| 80 |
return ret_vis; |
| 81 |
} |
| 82 |
|
| 83 |
void PDC_set_title(const char *title) |
| 84 |
{ |
| 85 |
PDC_LOG(("PDC_set_title() - called:<%s>\n", title)); |
| 86 |
} |
| 87 |
|
| 88 |
int PDC_set_blink(bool blinkon) |
| 89 |
{ |
| 90 |
#ifndef EMXVIDEO |
| 91 |
USHORT statebuf[3], result; |
| 92 |
|
| 93 |
statebuf[0] = 6; |
| 94 |
statebuf[1] = 2; |
| 95 |
statebuf[2] = !blinkon; |
| 96 |
|
| 97 |
result = VioSetState(&statebuf, 0); |
| 98 |
VioGetState(&statebuf, 0); |
| 99 |
|
| 100 |
if (pdc_color_started) |
| 101 |
COLORS = statebuf[2] ? 16 : 8; |
| 102 |
|
| 103 |
return (result == 0) ? OK : ERR; |
| 104 |
#else |
| 105 |
if (pdc_color_started) |
| 106 |
COLORS = 16; |
| 107 |
|
| 108 |
return blinkon ? ERR : OK; |
| 109 |
#endif |
| 110 |
} |