#include "pdcos2.h"
int PDC_curs_set(int visibility)
{
#ifndef EMXVIDEO
VIOCURSORINFO pvioCursorInfo;
#endif
int ret_vis, hidden = 0, start = 0, end = 0;
PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility));
ret_vis = SP->visibility;
SP->visibility = visibility;
switch(visibility)
{
case 0:
#ifdef EMXVIDEO
start = end = 0;
#else
start = pdc_font / 4;
end = pdc_font;
hidden = -1;
#endif
break;
case 2:
start = 2;
end = pdc_font - 1;
break;
default:
start = (SP->orig_cursor >> 8) & 0xff;
end = SP->orig_cursor & 0xff;
}
#ifdef EMXVIDEO
if (!visibility)
v_hidecursor();
else
v_ctype(start, end);
#else
pvioCursorInfo.yStart = (USHORT)start;
pvioCursorInfo.cEnd = (USHORT)end;
pvioCursorInfo.cx = (USHORT)1;
pvioCursorInfo.attr = hidden;
VioSetCurType((PVIOCURSORINFO)&pvioCursorInfo, 0);
#endif
return ret_vis;
}
void PDC_set_title(const char *title)
{
PDC_LOG(("PDC_set_title() - called:<%s>\n", title));
}
int PDC_set_blink(bool blinkon)
{
#ifndef EMXVIDEO
USHORT statebuf[3], result;
statebuf[0] = 6;
statebuf[1] = 2;
statebuf[2] = !blinkon;
result = VioSetState(&statebuf, 0);
VioGetState(&statebuf, 0);
if (pdc_color_started)
COLORS = statebuf[2] ? 16 : 8;
return (result == 0) ? OK : ERR;
#else
if (pdc_color_started)
COLORS = 16;
return blinkon ? ERR : OK;
#endif
}