| 1 |
|
| 2 |
|
| 3 |
#include "pdcwin.h" |
| 4 |
|
| 5 |
RCSID("$Id: pdcsetsc.c,v 1.40 2008/07/14 04:24:52 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 |
CONSOLE_CURSOR_INFO cci; |
| 37 |
int ret_vis; |
| 38 |
|
| 39 |
PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility)); |
| 40 |
|
| 41 |
ret_vis = SP->visibility; |
| 42 |
|
| 43 |
if (GetConsoleCursorInfo(pdc_con_out, &cci) == FALSE) |
| 44 |
return ERR; |
| 45 |
|
| 46 |
switch(visibility) |
| 47 |
{ |
| 48 |
case 0: |
| 49 |
cci.bVisible = FALSE; |
| 50 |
break; |
| 51 |
case 2: |
| 52 |
cci.bVisible = TRUE; |
| 53 |
cci.dwSize = 95; |
| 54 |
break; |
| 55 |
default: |
| 56 |
cci.bVisible = TRUE; |
| 57 |
cci.dwSize = SP->orig_cursor; |
| 58 |
break; |
| 59 |
} |
| 60 |
|
| 61 |
if (SetConsoleCursorInfo(pdc_con_out, &cci) == FALSE) |
| 62 |
return ERR; |
| 63 |
|
| 64 |
SP->visibility = visibility; |
| 65 |
return ret_vis; |
| 66 |
} |
| 67 |
|
| 68 |
void PDC_set_title(const char *title) |
| 69 |
{ |
| 70 |
#ifdef PDC_WIDE |
| 71 |
wchar_t wtitle[512]; |
| 72 |
#endif |
| 73 |
PDC_LOG(("PDC_set_title() - called:<%s>\n", title)); |
| 74 |
|
| 75 |
#ifdef PDC_WIDE |
| 76 |
PDC_mbstowcs(wtitle, title, 511); |
| 77 |
SetConsoleTitleW(wtitle); |
| 78 |
#else |
| 79 |
SetConsoleTitleA(title); |
| 80 |
#endif |
| 81 |
} |
| 82 |
|
| 83 |
int PDC_set_blink(bool blinkon) |
| 84 |
{ |
| 85 |
if (pdc_color_started) |
| 86 |
COLORS = 16; |
| 87 |
|
| 88 |
return blinkon ? ERR : OK; |
| 89 |
} |