| 1 | /* Public Domain Curses */ |
| 2 | |
| 3 | #include "pdcsdl.h" |
| 4 | |
| 5 | RCSID("$Id: pdcsetsc.c,v 1.7 2008/07/14 04:24:52 wmcbrine Exp $") |
| 6 | |
| 7 | /*man-start************************************************************** |
| 8 | |
| 9 | Name: pdcsetsc |
| 10 | |
| 11 | Synopsis: |
| 12 | int PDC_set_blink(bool blinkon); |
| 13 | void PDC_set_title(const char *title); |
| 14 | |
| 15 | Description: |
| 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. |
| 23 | |
| 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.) |
| 27 | |
| 28 | Portability X/Open BSD SYS V |
| 29 | PDC_set_blink - - - |
| 30 | PDC_set_title - - - |
| 31 | |
| 32 | **man-end****************************************************************/ |
| 33 | |
| 34 | int PDC_curs_set(int visibility) |
| 35 | { |
| 36 | int ret_vis; |
| 37 | |
| 38 | PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility)); |
| 39 | |
| 40 | ret_vis = SP->visibility; |
| 41 | |
| 42 | SP->visibility = visibility; |
| 43 | |
| 44 | PDC_gotoyx(SP->cursrow, SP->curscol); |
| 45 | |
| 46 | return ret_vis; |
| 47 | } |
| 48 | |
| 49 | void PDC_set_title(const char *title) |
| 50 | { |
| 51 | PDC_LOG(("PDC_set_title() - called:<%s>\n", title)); |
| 52 | |
| 53 | SDL_WM_SetCaption(title, title); |
| 54 | } |
| 55 | |
| 56 | int PDC_set_blink(bool blinkon) |
| 57 | { |
| 58 | if (pdc_color_started) |
| 59 | COLORS = 16; |
| 60 | |
| 61 | return blinkon ? ERR : OK; |
| 62 | } |