1
2
3
4
5
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/* Public Domain Curses */
/* $Id: pdcwin.h,v 1.6 2008/07/13 06:36:32 wmcbrine Exp $ */
/* We only need the 'fallback font' for the wide-char version, */
/* and it'll only work in Win2000 or later (earlier versions */
/* lack the necessary GetFontUnicodeRanges() function.) Comment */
/* out the following line if you're dealing with a really old */
/* system, or just don't want to use a fallback font. */
/* Windows.h will #define MOUSE_MOVED to 0x1, which is what the
Windows API expects. In Curses, MOUSE_MOVED is a macro indicating
whether the mouse has moved, so we'd get a compiler warning that
we're re-defining MOUSE_MOVED. That warning may be a Good Thing in
your software, letting you know: "Be careful; in a Curses program,
MOUSE_MOVED won't have the same meaning it does in a 'real' Windows
program."
But in building Win32a itself, we're expecting the Curses
meaning for MOUSE_MOVED, and the compiler warning would just be
a nuisance. So we'll #undefine MOUSE_MOVED before getting to the
Curses definition : */
extern int ;
/* The following probably ought to go into 'curses.h' at some point. */
/* Or at least, not be here; this is a temporary place for them. */
/* Win32a has some drastically extended cursor possibilities. The
following #defines can be used with curs_set(). For all other flavors
of PDCurses, only the invisible, "normal", and "intense" cursor
states will be recognized. In Win32, caret, half-block, central
block, cross, and outlined block cursors are available.
By default, all such cursors will blink. However, in Win32a,
the input value to curs_set() is treated as a two-byte value, with
the cursor blinking between those two states. For example,
curs_set( 0x0102) would blink between a "normal" (underline) cursor and
an "intense" (full-block) cursor. One can see that this behavior is
backward-compatible; for example, curs_set( 1) would blink between a
"normal" underline cursor and an invisible cursor. (But curs_set( 0x0101)
would result in a non-blinking underline cursor.) Note that one can use
the PDC_CURSOR macro for this, as in...
curs_set( PDC_CURSOR( PDC_CURSOR_OUTLINE, PDC_CURSOR_INTENSE)); */
/* With 64-bit chtypes, we're allowing 20 bits for the character
(thus Unicode values up to 0xffffff) plus one bit to indicate the
alternate character set. With 32-bit chtypes, we don't have so
many bits to play with and limit ourselves to 16-bit characters
(i.e., Unicode past 0xffff can't be shown), plus that one bit
for alternate chars. With 16-bit chtypes, there are only eight
bits available to the character. PDC_REAL_ATTR_SHIFT gives the
number of low bits devoted to storing characters. */
/* The PDC_set_function_key() function allows one to set a 'shut down'
key, and reassign hotkeys used for pasting from the clipboard and
enlarging and decreasing the font size, and for using the font selection
dialog. For example, calling
PDC_set_function_key( FUNCTION_KEY_SHUT_DOWN, ALT_Q);
would reset the library so that, if the user clicks on the 'close' box,
Alt-Q would be added to the key queue. This would give the app the
opportunity to shut things down (and perhaps ask "are you sure", and/or
"save changes or discard or cancel"), rather than just having the
window close (the default behavior).
Also, by default, Ctrl-V "pastes" the clipboard into the key queue,
and Ctrl-Equals brings up the font selection dialog. But one could
call, for example,
PDC_set_function_key( FUNCTION_KEY_PASTE, CTL_Z);
to reset the "paste" key to be Ctrl-Z. Or one could call
PDC_set_function_key( FUNCTION_KEY_PASTE, 0);
to shut off that function. (It would still be accessible from the menu.)
Thus far, this is a Win32a-flavor specific function. But it could, and
in my opinion should, be made available in the SDL and XCurses flavors too.
The return value is the key previously used for that function.
*/