1 /* Public Domain Curses */
5 RCSID("$Id: pdcsetsc.c,v 1.44 2008/07/14 04:24:51 wmcbrine Exp $")
7 /*man-start**************************************************************
12 int PDC_set_blink(bool blinkon);
13 void PDC_set_title(const char *title);
16 PDC_set_blink() toggles whether the A_BLINK attribute sets an
17 actual blink mode (TRUE), or sets the background color to high
18 intensity (FALSE). The default is platform-dependent (FALSE in
19 most cases). It returns OK if it could set the state to match
20 the given parameter, ERR otherwise. Current platforms also
21 adjust the value of COLORS according to this function -- 16 for
22 FALSE, and 8 for TRUE.
24 PDC_set_title() sets the title of the window in which the curses
25 program is running. This function may not do anything on some
26 platforms. (Currently it only works in Win32 and X11.)
28 Portability X/Open BSD SYS V
32 **man-end****************************************************************/
34 int PDC_curs_set(int visibility
)
37 VIOCURSORINFO pvioCursorInfo
;
39 int ret_vis
, hidden
= 0, start
= 0, end
= 0;
41 PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility
));
43 ret_vis
= SP
->visibility
;
44 SP
->visibility
= visibility
;
48 case 0: /* invisible */
58 case 2: /* highly visible */
59 start
= 2; /* almost full-height block */
63 default: /* normal visibility */
64 start
= (SP
->orig_cursor
>> 8) & 0xff;
65 end
= SP
->orig_cursor
& 0xff;
74 pvioCursorInfo
.yStart
= (USHORT
)start
;
75 pvioCursorInfo
.cEnd
= (USHORT
)end
;
76 pvioCursorInfo
.cx
= (USHORT
)1;
77 pvioCursorInfo
.attr
= hidden
;
78 VioSetCurType((PVIOCURSORINFO
)&pvioCursorInfo
, 0);
83 void PDC_set_title(const char *title
)
85 PDC_LOG(("PDC_set_title() - called:<%s>\n", title
));
88 int PDC_set_blink(bool blinkon
)
91 USHORT statebuf
[3], result
;
93 statebuf
[0] = 6; /* length */
94 statebuf
[1] = 2; /* blink/intensity */
95 statebuf
[2] = !blinkon
;
97 result
= VioSetState(&statebuf
, 0);
98 VioGetState(&statebuf
, 0); /* needed? */
100 if (pdc_color_started
)
101 COLORS
= statebuf
[2] ? 16 : 8;
103 return (result
== 0) ? OK
: ERR
;
105 if (pdc_color_started
)
108 return blinkon
? ERR
: OK
;