curses 1.3.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +19 -0
- data/.github/workflows/ubuntu.yml +26 -0
- data/.github/workflows/windows.yml +25 -0
- data/History.md +27 -0
- data/README.md +14 -46
- data/Rakefile +0 -86
- data/curses.gemspec +3 -4
- data/ext/curses/curses.c +194 -38
- data/ext/curses/extconf.rb +81 -22
- data/lib/curses.rb +5 -12
- data/sample/addch.rb +16 -0
- data/sample/attr_demo.rb +32 -0
- data/sample/colors.rb +26 -0
- data/sample/mouse_move.rb +75 -0
- data/vendor/PDCurses/.gitignore +47 -0
- data/vendor/PDCurses/.travis.yml +49 -0
- data/vendor/PDCurses/CMakeLists.txt +68 -0
- data/vendor/PDCurses/HISTORY.md +2036 -0
- data/vendor/PDCurses/IMPLEMNT.md +327 -0
- data/vendor/PDCurses/Makefile +27 -0
- data/vendor/PDCurses/README.md +77 -0
- data/vendor/PDCurses/acs_defs.h +265 -0
- data/vendor/PDCurses/appveyor.yml +218 -0
- data/vendor/PDCurses/cmake/README.md +71 -0
- data/vendor/PDCurses/cmake/build_dependencies.cmake +178 -0
- data/vendor/PDCurses/cmake/build_options.cmake +25 -0
- data/vendor/PDCurses/cmake/dll_version.cmake +26 -0
- data/vendor/PDCurses/cmake/gen_config_header.cmake +43 -0
- data/vendor/PDCurses/cmake/get_version.cmake +17 -0
- data/vendor/PDCurses/cmake/make_uninstall.cmake +19 -0
- data/vendor/PDCurses/cmake/project_common.cmake +121 -0
- data/vendor/PDCurses/cmake/resource.in.cmake +52 -0
- data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +83 -0
- data/vendor/PDCurses/cmake/target_arch.cmake +36 -0
- data/vendor/PDCurses/cmake/version.in.cmake +73 -0
- data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +96 -0
- data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +106 -0
- data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +105 -0
- data/vendor/PDCurses/curses.h +1846 -0
- data/vendor/PDCurses/curspriv.h +134 -0
- data/vendor/PDCurses/demos/README.md +25 -0
- data/vendor/PDCurses/demos/firework.c +144 -0
- data/vendor/PDCurses/demos/newtest.c +581 -0
- data/vendor/PDCurses/demos/ozdemo.c +447 -0
- data/vendor/PDCurses/demos/ptest.c +283 -0
- data/vendor/PDCurses/demos/rain.c +157 -0
- data/vendor/PDCurses/demos/testcurs.c +1607 -0
- data/vendor/PDCurses/demos/tui.c +1048 -0
- data/vendor/PDCurses/demos/tui.h +65 -0
- data/vendor/PDCurses/demos/tuidemo.c +233 -0
- data/vendor/PDCurses/demos/version.c +61 -0
- data/vendor/PDCurses/demos/worm.c +432 -0
- data/vendor/PDCurses/demos/xmas.c +955 -0
- data/vendor/PDCurses/dos/CMakeLists.txt +47 -0
- data/vendor/PDCurses/dos/Makefile +105 -0
- data/vendor/PDCurses/dos/Makefile.bcc +83 -0
- data/vendor/PDCurses/dos/Makefile.dmc +257 -0
- data/vendor/PDCurses/dos/Makefile.msc +113 -0
- data/vendor/PDCurses/dos/Makefile.wcc +107 -0
- data/vendor/PDCurses/dos/README.md +51 -0
- data/vendor/PDCurses/dos/bccdos.lrf +9 -0
- data/vendor/PDCurses/dos/mscdos.lrf +50 -0
- data/vendor/PDCurses/dos/pdcclip.c +132 -0
- data/vendor/PDCurses/dos/pdcdisp.c +135 -0
- data/vendor/PDCurses/dos/pdcdos.h +194 -0
- data/vendor/PDCurses/dos/pdcgetsc.c +98 -0
- data/vendor/PDCurses/dos/pdckbd.c +513 -0
- data/vendor/PDCurses/dos/pdcscrn.c +785 -0
- data/vendor/PDCurses/dos/pdcsetsc.c +101 -0
- data/vendor/PDCurses/dos/pdcutil.c +212 -0
- data/vendor/PDCurses/libobjs.mif +26 -0
- data/vendor/PDCurses/makedist.mif +20 -0
- data/vendor/PDCurses/man/Makefile +37 -0
- data/vendor/PDCurses/man/README.md +21 -0
- data/vendor/PDCurses/man/intro.md +361 -0
- data/vendor/PDCurses/man/manext.c +119 -0
- data/vendor/PDCurses/man/sdl.md +152 -0
- data/vendor/PDCurses/man/sdl2.md +58 -0
- data/vendor/PDCurses/man/x11.md +407 -0
- data/vendor/PDCurses/ncurses/CMakeLists.txt +66 -0
- data/vendor/PDCurses/ncurses/README.md +26 -0
- data/vendor/PDCurses/ncurses/makefile +29 -0
- data/vendor/PDCurses/os2/CMakeLists.txt +41 -0
- data/vendor/PDCurses/os2/Makefile +132 -0
- data/vendor/PDCurses/os2/Makefile.bcc +90 -0
- data/vendor/PDCurses/os2/Makefile.wcc +43 -0
- data/vendor/PDCurses/os2/README.md +43 -0
- data/vendor/PDCurses/os2/iccos2.lrf +50 -0
- data/vendor/PDCurses/os2/iccos2.mak +256 -0
- data/vendor/PDCurses/os2/pdcclip.c +188 -0
- data/vendor/PDCurses/os2/pdcdisp.c +93 -0
- data/vendor/PDCurses/os2/pdcgetsc.c +89 -0
- data/vendor/PDCurses/os2/pdckbd.c +521 -0
- data/vendor/PDCurses/os2/pdcos2.h +55 -0
- data/vendor/PDCurses/os2/pdcscrn.c +449 -0
- data/vendor/PDCurses/os2/pdcsetsc.c +112 -0
- data/vendor/PDCurses/os2/pdcutil.c +52 -0
- data/vendor/PDCurses/panel.h +56 -0
- data/vendor/PDCurses/pdcurses/README.md +25 -0
- data/vendor/PDCurses/pdcurses/addch.c +693 -0
- data/vendor/PDCurses/pdcurses/addchstr.c +245 -0
- data/vendor/PDCurses/pdcurses/addstr.c +240 -0
- data/vendor/PDCurses/pdcurses/attr.c +359 -0
- data/vendor/PDCurses/pdcurses/beep.c +68 -0
- data/vendor/PDCurses/pdcurses/bkgd.c +223 -0
- data/vendor/PDCurses/pdcurses/border.c +411 -0
- data/vendor/PDCurses/pdcurses/clear.c +159 -0
- data/vendor/PDCurses/pdcurses/color.c +298 -0
- data/vendor/PDCurses/pdcurses/debug.c +109 -0
- data/vendor/PDCurses/pdcurses/delch.c +96 -0
- data/vendor/PDCurses/pdcurses/deleteln.c +211 -0
- data/vendor/PDCurses/pdcurses/deprec.c +27 -0
- data/vendor/PDCurses/pdcurses/getch.c +417 -0
- data/vendor/PDCurses/pdcurses/getstr.c +474 -0
- data/vendor/PDCurses/pdcurses/getyx.c +139 -0
- data/vendor/PDCurses/pdcurses/inch.c +127 -0
- data/vendor/PDCurses/pdcurses/inchstr.c +214 -0
- data/vendor/PDCurses/pdcurses/initscr.c +367 -0
- data/vendor/PDCurses/pdcurses/inopts.c +324 -0
- data/vendor/PDCurses/pdcurses/insch.c +271 -0
- data/vendor/PDCurses/pdcurses/insstr.c +264 -0
- data/vendor/PDCurses/pdcurses/instr.c +246 -0
- data/vendor/PDCurses/pdcurses/kernel.c +259 -0
- data/vendor/PDCurses/pdcurses/keyname.c +157 -0
- data/vendor/PDCurses/pdcurses/mouse.c +438 -0
- data/vendor/PDCurses/pdcurses/move.c +57 -0
- data/vendor/PDCurses/pdcurses/outopts.c +159 -0
- data/vendor/PDCurses/pdcurses/overlay.c +214 -0
- data/vendor/PDCurses/pdcurses/pad.c +260 -0
- data/vendor/PDCurses/pdcurses/panel.c +633 -0
- data/vendor/PDCurses/pdcurses/printw.c +126 -0
- data/vendor/PDCurses/pdcurses/refresh.c +279 -0
- data/vendor/PDCurses/pdcurses/scanw.c +578 -0
- data/vendor/PDCurses/pdcurses/scr_dump.c +213 -0
- data/vendor/PDCurses/pdcurses/scroll.c +101 -0
- data/vendor/PDCurses/pdcurses/slk.c +591 -0
- data/vendor/PDCurses/pdcurses/termattr.c +182 -0
- data/vendor/PDCurses/pdcurses/terminfo.c +217 -0
- data/vendor/PDCurses/pdcurses/touch.c +163 -0
- data/vendor/PDCurses/pdcurses/util.c +312 -0
- data/vendor/PDCurses/pdcurses/window.c +569 -0
- data/vendor/PDCurses/sdl1/Makefile +129 -0
- data/vendor/PDCurses/sdl1/Makefile.mng +110 -0
- data/vendor/PDCurses/sdl1/README.md +31 -0
- data/vendor/PDCurses/sdl1/deffont.h +385 -0
- data/vendor/PDCurses/sdl1/deficon.h +23 -0
- data/vendor/PDCurses/sdl1/pdcclip.c +131 -0
- data/vendor/PDCurses/sdl1/pdcdisp.c +373 -0
- data/vendor/PDCurses/sdl1/pdcgetsc.c +30 -0
- data/vendor/PDCurses/sdl1/pdckbd.c +405 -0
- data/vendor/PDCurses/sdl1/pdcscrn.c +414 -0
- data/vendor/PDCurses/sdl1/pdcsdl.h +31 -0
- data/vendor/PDCurses/sdl1/pdcsetsc.c +64 -0
- data/vendor/PDCurses/sdl1/pdcutil.c +40 -0
- data/vendor/PDCurses/sdl1/sdltest.c +79 -0
- data/vendor/PDCurses/sdl2/CMakeLists.txt +76 -0
- data/vendor/PDCurses/sdl2/Makefile +135 -0
- data/vendor/PDCurses/sdl2/Makefile.vc +164 -0
- data/vendor/PDCurses/sdl2/README.md +34 -0
- data/vendor/PDCurses/sdl2/deffont.h +385 -0
- data/vendor/PDCurses/sdl2/deficon.h +23 -0
- data/vendor/PDCurses/sdl2/pdcclip.c +93 -0
- data/vendor/PDCurses/sdl2/pdcdisp.c +534 -0
- data/vendor/PDCurses/sdl2/pdcgetsc.c +30 -0
- data/vendor/PDCurses/sdl2/pdckbd.c +480 -0
- data/vendor/PDCurses/sdl2/pdcscrn.c +443 -0
- data/vendor/PDCurses/sdl2/pdcsdl.h +33 -0
- data/vendor/PDCurses/sdl2/pdcsetsc.c +67 -0
- data/vendor/PDCurses/sdl2/pdcutil.c +39 -0
- data/vendor/PDCurses/sdl2/sdltest.c +81 -0
- data/vendor/PDCurses/term.h +48 -0
- data/vendor/PDCurses/version.mif +7 -0
- data/vendor/PDCurses/vt/CMakeLists.txt +28 -0
- data/vendor/PDCurses/vt/Makefile +135 -0
- data/vendor/PDCurses/vt/Makefile.bcc +111 -0
- data/vendor/PDCurses/vt/Makefile.dmc +258 -0
- data/vendor/PDCurses/vt/Makefile.vc +144 -0
- data/vendor/PDCurses/vt/Makefile.wcc +107 -0
- data/vendor/PDCurses/vt/README.md +64 -0
- data/vendor/PDCurses/vt/pdcclip.c +20 -0
- data/vendor/PDCurses/vt/pdcdisp.c +284 -0
- data/vendor/PDCurses/vt/pdcgetsc.c +27 -0
- data/vendor/PDCurses/vt/pdckbd.c +394 -0
- data/vendor/PDCurses/vt/pdcscrn.c +434 -0
- data/vendor/PDCurses/vt/pdcsetsc.c +45 -0
- data/vendor/PDCurses/vt/pdcutil.c +43 -0
- data/vendor/PDCurses/vt/pdcvt.h +16 -0
- data/vendor/PDCurses/watcom.mif +68 -0
- data/vendor/PDCurses/wincon/CMakeLists.txt +27 -0
- data/vendor/PDCurses/wincon/Makefile.bcc +88 -0
- data/vendor/PDCurses/wincon/Makefile.dmc +256 -0
- data/vendor/PDCurses/wincon/Makefile.lcc +273 -0
- data/vendor/PDCurses/wincon/Makefile.mng +176 -0
- data/vendor/PDCurses/wincon/Makefile.vc +144 -0
- data/vendor/PDCurses/wincon/Makefile.wcc +51 -0
- data/vendor/PDCurses/wincon/README.md +85 -0
- data/vendor/PDCurses/wincon/pdcclip.c +174 -0
- data/vendor/PDCurses/wincon/pdcdisp.c +143 -0
- data/vendor/PDCurses/wincon/pdcgetsc.c +55 -0
- data/vendor/PDCurses/wincon/pdckbd.c +786 -0
- data/vendor/PDCurses/wincon/pdcscrn.c +717 -0
- data/vendor/PDCurses/wincon/pdcsetsc.c +91 -0
- data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
- data/vendor/PDCurses/wincon/pdcurses.rc +28 -0
- data/vendor/PDCurses/wincon/pdcutil.c +41 -0
- data/vendor/PDCurses/wincon/pdcwin.h +31 -0
- data/vendor/PDCurses/wingui/CMakeLists.txt +27 -0
- data/vendor/PDCurses/wingui/Makefile.bcc +85 -0
- data/vendor/PDCurses/wingui/Makefile.dmc +259 -0
- data/vendor/PDCurses/wingui/Makefile.lcc +273 -0
- data/vendor/PDCurses/wingui/Makefile.mng +171 -0
- data/vendor/PDCurses/wingui/Makefile.vc +144 -0
- data/vendor/PDCurses/wingui/Makefile.wcc +51 -0
- data/vendor/PDCurses/wingui/README.md +93 -0
- data/vendor/PDCurses/wingui/pdcclip.c +174 -0
- data/vendor/PDCurses/wingui/pdcdisp.c +718 -0
- data/vendor/PDCurses/wingui/pdcgetsc.c +30 -0
- data/vendor/PDCurses/wingui/pdckbd.c +143 -0
- data/vendor/PDCurses/wingui/pdcscrn.c +2797 -0
- data/vendor/PDCurses/wingui/pdcsetsc.c +89 -0
- data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
- data/vendor/PDCurses/wingui/pdcurses.rc +28 -0
- data/vendor/PDCurses/wingui/pdcutil.c +61 -0
- data/vendor/PDCurses/wingui/pdcwin.h +122 -0
- data/vendor/PDCurses/x11/Makefile.in +754 -0
- data/vendor/PDCurses/x11/PDCurses.spec +82 -0
- data/vendor/PDCurses/x11/README.md +62 -0
- data/vendor/PDCurses/x11/ScrollBox.c +319 -0
- data/vendor/PDCurses/x11/ScrollBox.h +51 -0
- data/vendor/PDCurses/x11/ScrollBoxP.h +70 -0
- data/vendor/PDCurses/x11/aclocal.m4 +994 -0
- data/vendor/PDCurses/x11/big_icon.xbm +46 -0
- data/vendor/PDCurses/x11/compose.h +201 -0
- data/vendor/PDCurses/x11/config.guess +1500 -0
- data/vendor/PDCurses/x11/config.h.in +100 -0
- data/vendor/PDCurses/x11/config.sub +1616 -0
- data/vendor/PDCurses/x11/configure +6700 -0
- data/vendor/PDCurses/x11/configure.ac +295 -0
- data/vendor/PDCurses/x11/debian/changelog +6 -0
- data/vendor/PDCurses/x11/debian/compat +1 -0
- data/vendor/PDCurses/x11/debian/control +11 -0
- data/vendor/PDCurses/x11/debian/copyright +27 -0
- data/vendor/PDCurses/x11/debian/rules +98 -0
- data/vendor/PDCurses/x11/install-sh +253 -0
- data/vendor/PDCurses/x11/little_icon.xbm +14 -0
- data/vendor/PDCurses/x11/ncurses_cfg.h +45 -0
- data/vendor/PDCurses/x11/pdcclip.c +173 -0
- data/vendor/PDCurses/x11/pdcdisp.c +85 -0
- data/vendor/PDCurses/x11/pdcgetsc.c +28 -0
- data/vendor/PDCurses/x11/pdckbd.c +104 -0
- data/vendor/PDCurses/x11/pdcscrn.c +258 -0
- data/vendor/PDCurses/x11/pdcsetsc.c +95 -0
- data/vendor/PDCurses/x11/pdcutil.c +52 -0
- data/vendor/PDCurses/x11/pdcx11.c +316 -0
- data/vendor/PDCurses/x11/pdcx11.h +191 -0
- data/vendor/PDCurses/x11/sb.c +155 -0
- data/vendor/PDCurses/x11/x11.c +3686 -0
- data/vendor/PDCurses/x11/xcurses-config.in +81 -0
- metadata +259 -25
- data/.travis.yml +0 -16
- data/appveyor.yml +0 -16
@@ -0,0 +1,89 @@
|
|
1
|
+
/* Public Domain Curses */
|
2
|
+
|
3
|
+
#include "pdcwin.h"
|
4
|
+
|
5
|
+
/*man-start**************************************************************
|
6
|
+
|
7
|
+
Name: pdcsetsc
|
8
|
+
|
9
|
+
Synopsis:
|
10
|
+
int PDC_set_blink(bool blinkon);
|
11
|
+
void PDC_set_title(const char *title);
|
12
|
+
|
13
|
+
Description:
|
14
|
+
PDC_set_blink() toggles whether the A_BLINK attribute sets an
|
15
|
+
actual blink mode (TRUE), or sets the background color to high
|
16
|
+
intensity (FALSE). The default is platform-dependent (FALSE in
|
17
|
+
most cases). It returns OK if it could set the state to match
|
18
|
+
the given parameter, ERR otherwise. Current platforms also
|
19
|
+
adjust the value of COLORS according to this function -- 16 for
|
20
|
+
FALSE, and 8 for TRUE.
|
21
|
+
|
22
|
+
PDC_set_title() sets the title of the window in which the curses
|
23
|
+
program is running. This function may not do anything on some
|
24
|
+
platforms. (Currently it only works in Win32 and X11.)
|
25
|
+
|
26
|
+
Portability X/Open BSD SYS V
|
27
|
+
PDC_set_blink - - -
|
28
|
+
PDC_set_title - - -
|
29
|
+
|
30
|
+
**man-end****************************************************************/
|
31
|
+
|
32
|
+
/* Note that the following is a line-for-line */
|
33
|
+
/* copy of the SDL version of this function. */
|
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
|
+
extern HWND PDC_hWnd;
|
52
|
+
#ifdef PDC_WIDE
|
53
|
+
wchar_t wtitle[512];
|
54
|
+
#endif
|
55
|
+
PDC_LOG(("PDC_set_title() - called:<%s>\n", title));
|
56
|
+
|
57
|
+
#ifdef PDC_WIDE
|
58
|
+
PDC_mbstowcs(wtitle, title, 511);
|
59
|
+
SetWindowTextW( PDC_hWnd, wtitle);
|
60
|
+
#else
|
61
|
+
SetWindowTextA( PDC_hWnd, title);
|
62
|
+
#endif
|
63
|
+
}
|
64
|
+
|
65
|
+
/* If PDC_really_blinking is TRUE, then text with the A_BLINK */
|
66
|
+
/* attribute will actually blink. Otherwise, such text will */
|
67
|
+
/* be shown with higher color intensity (the R, G, and B values */
|
68
|
+
/* are averaged with pure white). See pdcdisp.c for details of */
|
69
|
+
/* how this is done. */
|
70
|
+
/* Unlike on other PDCurses platforms, this doesn't require */
|
71
|
+
/* decreasing the number of colors by half. Also, the choice */
|
72
|
+
/* indicated by 'blinkon' will actually be respected, so OK is */
|
73
|
+
/* always returned (most platforms don't actually support */
|
74
|
+
/* blinking). */
|
75
|
+
/* The default behavior is to not show A_BLINK text as */
|
76
|
+
/* blinking, i.e., PDC_really_blinking = FALSE. Blinking text */
|
77
|
+
/* can be pretty annoying to some people. You should probably */
|
78
|
+
/* call PDC_set_blink( TRUE) only if there is something to which */
|
79
|
+
/* the user _must_ pay attention; say, "the nuclear reactor */
|
80
|
+
/* is about to melt down". Otherwise, the bolder, brighter */
|
81
|
+
/* text should be attention-getting enough. */
|
82
|
+
|
83
|
+
int PDC_really_blinking = FALSE;
|
84
|
+
|
85
|
+
int PDC_set_blink(bool blinkon)
|
86
|
+
{
|
87
|
+
PDC_really_blinking = blinkon;
|
88
|
+
return OK;
|
89
|
+
}
|
Binary file
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#include "winver.h"
|
2
|
+
|
3
|
+
1 VERSIONINFO
|
4
|
+
FILEVERSION 4,0,2,0
|
5
|
+
PRODUCTVERSION 4,0,2,0
|
6
|
+
FILEFLAGSMASK 0x3fL
|
7
|
+
FILEFLAGS 0x0L
|
8
|
+
FILEOS VOS_UNKNOWN
|
9
|
+
FILETYPE VFT_DLL
|
10
|
+
FILESUBTYPE 0x0L
|
11
|
+
BEGIN
|
12
|
+
BLOCK "StringFileInfo"
|
13
|
+
BEGIN
|
14
|
+
BLOCK "040904b0"
|
15
|
+
BEGIN
|
16
|
+
VALUE "Maintainer", "William McBrine\0"
|
17
|
+
VALUE "FileDescription", "Public Domain Curses\0"
|
18
|
+
VALUE "FileVersion", "4.0.2\0"
|
19
|
+
VALUE "InternalName", "PDCurses\0"
|
20
|
+
VALUE "LegalCopyright", "Public Domain\0"
|
21
|
+
VALUE "OriginalFilename", "PDCURSES.DLL\0"
|
22
|
+
VALUE "ProductName", "Public Domain Curses Library\0"
|
23
|
+
VALUE "ProductVersion", "4.0.2\0"
|
24
|
+
END
|
25
|
+
END
|
26
|
+
END
|
27
|
+
|
28
|
+
1 ICON DISCARDABLE "PDCURSES.ico"
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/* Public Domain Curses */
|
2
|
+
|
3
|
+
#include "pdcwin.h"
|
4
|
+
|
5
|
+
void PDC_beep(void)
|
6
|
+
{
|
7
|
+
PDC_LOG(("PDC_beep() - called\n"));
|
8
|
+
|
9
|
+
/* MessageBeep(MB_OK); */
|
10
|
+
MessageBeep(0XFFFFFFFF);
|
11
|
+
}
|
12
|
+
|
13
|
+
void PDC_napms(int ms) /* 'ms' = milli, _not_ microseconds! */
|
14
|
+
{
|
15
|
+
/* RR: keep GUI window responsive while PDCurses sleeps */
|
16
|
+
MSG msg;
|
17
|
+
DWORD curr_ms = GetTickCount( );
|
18
|
+
const DWORD milliseconds_sleep_limit = ms + curr_ms;
|
19
|
+
extern bool PDC_bDone;
|
20
|
+
|
21
|
+
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
|
22
|
+
|
23
|
+
/* Pump all pending messages from WIN32 to the window handler */
|
24
|
+
while( !PDC_bDone && curr_ms < milliseconds_sleep_limit )
|
25
|
+
{
|
26
|
+
const DWORD max_sleep_ms = 50; /* check msgs 20 times/second */
|
27
|
+
DWORD sleep_millisecs;
|
28
|
+
|
29
|
+
while( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
|
30
|
+
{
|
31
|
+
TranslateMessage(&msg);
|
32
|
+
DispatchMessage(&msg);
|
33
|
+
}
|
34
|
+
curr_ms = GetTickCount( );
|
35
|
+
sleep_millisecs = milliseconds_sleep_limit - curr_ms;
|
36
|
+
if( sleep_millisecs > max_sleep_ms)
|
37
|
+
sleep_millisecs = max_sleep_ms;
|
38
|
+
Sleep( sleep_millisecs);
|
39
|
+
curr_ms += sleep_millisecs;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
const char *PDC_sysname(void)
|
44
|
+
{
|
45
|
+
return "WinGUI";
|
46
|
+
}
|
47
|
+
|
48
|
+
PDC_version_info PDC_version = { PDC_PORT_WINGUI,
|
49
|
+
PDC_VER_MAJOR, PDC_VER_MINOR, PDC_VER_CHANGE,
|
50
|
+
sizeof( chtype),
|
51
|
+
#ifdef PDC_WIDE
|
52
|
+
TRUE,
|
53
|
+
#else
|
54
|
+
FALSE,
|
55
|
+
#endif
|
56
|
+
#ifdef PDC_FORCE_UTF8
|
57
|
+
TRUE,
|
58
|
+
#else
|
59
|
+
FALSE,
|
60
|
+
#endif
|
61
|
+
};
|
@@ -0,0 +1,122 @@
|
|
1
|
+
/* Public Domain Curses */
|
2
|
+
|
3
|
+
/* $Id: pdcwin.h,v 1.6 2008/07/13 06:36:32 wmcbrine Exp $ */
|
4
|
+
|
5
|
+
#ifdef PDC_WIDE
|
6
|
+
# define UNICODE
|
7
|
+
# define _UNICODE
|
8
|
+
#endif
|
9
|
+
|
10
|
+
#include <windows.h>
|
11
|
+
|
12
|
+
#if defined( GS_8BIT_INDICES) && defined( PDC_WIDE)
|
13
|
+
/* We only need the 'fallback font' for the wide-char version, */
|
14
|
+
/* and it'll only work in Win2000 or later (earlier versions */
|
15
|
+
/* lack the necessary GetFontUnicodeRanges() function.) Comment */
|
16
|
+
/* out the following line if you're dealing with a really old */
|
17
|
+
/* system, or just don't want to use a fallback font. */
|
18
|
+
#define USE_FALLBACK_FONT
|
19
|
+
#endif
|
20
|
+
|
21
|
+
/* Windows.h will #define MOUSE_MOVED to 0x1, which is what the
|
22
|
+
Windows API expects. In Curses, MOUSE_MOVED is a macro indicating
|
23
|
+
whether the mouse has moved, so we'd get a compiler warning that
|
24
|
+
we're re-defining MOUSE_MOVED. That warning may be a Good Thing in
|
25
|
+
your software, letting you know: "Be careful; in a Curses program,
|
26
|
+
MOUSE_MOVED won't have the same meaning it does in a 'real' Windows
|
27
|
+
program."
|
28
|
+
|
29
|
+
But in building WinGUI itself, we're expecting the Curses
|
30
|
+
meaning for MOUSE_MOVED, and the compiler warning would just be
|
31
|
+
a nuisance. So we'll #undefine MOUSE_MOVED before getting to the
|
32
|
+
Curses definition : */
|
33
|
+
|
34
|
+
#undef MOUSE_MOVED
|
35
|
+
#include <curspriv.h>
|
36
|
+
|
37
|
+
extern int PDC_get_buffer_rows(void);
|
38
|
+
|
39
|
+
/* The following probably ought to go into 'curses.h' at some point. */
|
40
|
+
/* Or at least, not be here; this is a temporary place for them. */
|
41
|
+
|
42
|
+
/* WinGUI has some drastically extended cursor possibilities. The
|
43
|
+
following #defines can be used with curs_set(). For all other flavors
|
44
|
+
of PDCurses, only the invisible, "normal", and "intense" cursor
|
45
|
+
states will be recognized. In Win32, caret, half-block, central
|
46
|
+
block, cross, and outlined block cursors are available.
|
47
|
+
|
48
|
+
By default, all such cursors will blink. However, in WinGUI,
|
49
|
+
the input value to curs_set() is treated as a two-byte value, with
|
50
|
+
the cursor blinking between those two states. For example,
|
51
|
+
curs_set( 0x0102) would blink between a "normal" (underline) cursor and
|
52
|
+
an "intense" (full-block) cursor. One can see that this behavior is
|
53
|
+
backward-compatible; for example, curs_set( 1) would blink between a
|
54
|
+
"normal" underline cursor and an invisible cursor. (But curs_set( 0x0101)
|
55
|
+
would result in a non-blinking underline cursor.) Note that one can use
|
56
|
+
the PDC_CURSOR macro for this, as in...
|
57
|
+
|
58
|
+
curs_set( PDC_CURSOR( PDC_CURSOR_OUTLINE, PDC_CURSOR_INTENSE)); */
|
59
|
+
|
60
|
+
#define PDC_CURSOR_INVISIBLE 0x00
|
61
|
+
#define PDC_CURSOR_NORMAL 0x01
|
62
|
+
#define PDC_CURSOR_INTENSE 0x02
|
63
|
+
#define PDC_CURSOR_OUTLINE 0x03
|
64
|
+
#define PDC_CURSOR_CARET 0x04
|
65
|
+
#define PDC_CURSOR_HALF_BLOCK 0x05
|
66
|
+
#define PDC_CURSOR_CENTRAL_BLOCK 0x06
|
67
|
+
#define PDC_CURSOR_CROSS 0x07
|
68
|
+
#define PDC_CURSOR_OUTLINE_BLOCK 0x08
|
69
|
+
|
70
|
+
#define PDC_CURSOR( A, B) ((A)<<8 | (B))
|
71
|
+
#define PDC_CURSOR_IS_BLINKING \
|
72
|
+
((SP->visibility >> 8) != (SP->visibility & 0xff))
|
73
|
+
|
74
|
+
/* With 64-bit chtypes, we're allowing 20 bits for the character
|
75
|
+
(thus Unicode values up to 0xffffff) plus one bit to indicate the
|
76
|
+
alternate character set. With 32-bit chtypes, we don't have so
|
77
|
+
many bits to play with and limit ourselves to 16-bit characters
|
78
|
+
(i.e., Unicode past 0xffff can't be shown), plus that one bit
|
79
|
+
for alternate chars. With 16-bit chtypes, there are only eight
|
80
|
+
bits available to the character. PDC_REAL_ATTR_SHIFT gives the
|
81
|
+
number of low bits devoted to storing characters. */
|
82
|
+
|
83
|
+
# if(CHTYPE_LONG >= 2) /* 64-bit chtypes */
|
84
|
+
# define PDC_REAL_ATTR_SHIFT 21
|
85
|
+
# else
|
86
|
+
#ifdef CHTYPE_LONG /* 32-bit chtypes */
|
87
|
+
# define PDC_REAL_ATTR_SHIFT 17
|
88
|
+
#else /* 16-bit chtypes */
|
89
|
+
# define PDC_REAL_ATTR_SHIFT 8
|
90
|
+
#endif
|
91
|
+
#endif
|
92
|
+
|
93
|
+
/* The PDC_set_function_key() function allows one to set a 'shut down'
|
94
|
+
key, and reassign hotkeys used for pasting from the clipboard and
|
95
|
+
enlarging and decreasing the font size, and for using the font selection
|
96
|
+
dialog. For example, calling
|
97
|
+
|
98
|
+
PDC_set_function_key( FUNCTION_KEY_SHUT_DOWN, ALT_Q);
|
99
|
+
|
100
|
+
would reset the library so that, if the user clicks on the 'close' box,
|
101
|
+
Alt-Q would be added to the key queue. This would give the app the
|
102
|
+
opportunity to shut things down (and perhaps ask "are you sure", and/or
|
103
|
+
"save changes or discard or cancel"), rather than just having the
|
104
|
+
window close (the default behavior).
|
105
|
+
|
106
|
+
Also, by default, Ctrl-V "pastes" the clipboard into the key queue,
|
107
|
+
and Ctrl-Equals brings up the font selection dialog. But one could
|
108
|
+
call, for example,
|
109
|
+
|
110
|
+
PDC_set_function_key( FUNCTION_KEY_PASTE, CTL_Z);
|
111
|
+
|
112
|
+
to reset the "paste" key to be Ctrl-Z. Or one could call
|
113
|
+
|
114
|
+
PDC_set_function_key( FUNCTION_KEY_PASTE, 0);
|
115
|
+
|
116
|
+
to shut off that function. (It would still be accessible from the menu.)
|
117
|
+
|
118
|
+
Thus far, this is a WinGUI-flavor specific function. But it could, and
|
119
|
+
in my opinion should, be made available in the SDL and XCurses flavors too.
|
120
|
+
|
121
|
+
The return value is the key previously used for that function.
|
122
|
+
*/
|