Dienstag, 1. Januar 2013

pdcurses Win32a

About

PDCurses/Win32a is a version of pdcurses that supports "real" text terminals in Windows operating systems. This means that a program written for curses, when compiled under this version, may be able to support features unsupportable by the normal terminals in Windows, including extended color support and greater international character support.

Installation/Quickstart

1. Download source archive

http://www.projectpluto.com/win32a.htm#download

2. Go into win32a subdirectory and run make with mingw32.mak

make -f mingwin32.mak WIDE=Y UTF8=Y

3. Compile a test program inside the build directory

gcc -Wall -I.. -o testcurs ../demos/testcurs.c pdcurses.a -lgdi32

4. Install headers into a "pdcurseswin" subdirectory in your home directory

mkdir "%userprofile%\include\pdcurseswin"
cp -v curses.h curspriv.h panel.h term.h "%userprofile%/include/pdcurseswin/"

5. Install library archive files into a "pdcurseswin" subdirectory in your home directory

mkdir "%userprofile%\lib\pdcurseswin"
cp -v panel.a "%userprofile%/lib/pdcurseswin/libpanel.a"
cp -v pdcurses.a "%userprofile%/lib/pdcurseswin/libpdcurses.a"

6. Create env-pdcurseswin.bat file

-- This batch file should modify CPATH to prepend the above include path,
-- it should modify LIBRARY_PATH to prepend the above library path.

7. Try to compile a test program outside the build directory

env-pdcurseswin
gcc -Wall -std=c99 -o testcolor testcolor.c -lpdcurses -lgdi32

8. Compile the same program but turn off the debugging console (like normal Windows programs)

gcc -Wall -std=c99 -mwindows -o testcolor testcolor.c -lpdcurses -lgdi32

9. Useful information for setting the window-resizing limits in Win32a:

/* These values must be set before calling initscr() */
/* This won't cause trouble with other flavors of curses (they'll just ignore it) */
ttytype[0] = 20; /* Window must have at least 20 lines in Win32a */
ttytype[1] = 55; /* Window can have a max of 55 lines in Win32a */
ttytype[2] = 70; /* Window must have at least 70 columns in Win32a */
ttytype[3] = (unsigned char)200; /* Window can have a max of 200 columns in Win32a */

10. Demonstrate proper usage of unicode output AND input.

TODO

11. Compare with SDL version of standard pdcurses.

TODO

Keine Kommentare:

Kommentar veröffentlichen