summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2010-04-28 21:13:43 +0200
committerAndreas Baumann <abaumann@yahoo.com>2010-04-28 21:13:43 +0200
commite00b3dd652979f5a7700d0a124832ac913fa9ed4 (patch)
tree1b09f5fcd830695b6c4e5d38c6dc5556855ac05f
downloadtvisiontest-e00b3dd652979f5a7700d0a124832ac913fa9ed4.tar.gz
tvisiontest-e00b3dd652979f5a7700d0a124832ac913fa9ed4.tar.bz2
checked in initial version
-rw-r--r--GNUmakefile8
-rw-r--r--makefiles/README4
-rw-r--r--makefiles/gmake/clean.mk41
-rw-r--r--makefiles/gmake/compiler.mk347
-rw-r--r--makefiles/gmake/depend.mk76
-rw-r--r--makefiles/gmake/dist.mk40
-rwxr-xr-xmakefiles/gmake/guess_env224
-rw-r--r--makefiles/gmake/help.mk15
-rw-r--r--makefiles/gmake/i18n.mk103
-rw-r--r--makefiles/gmake/install.mk64
-rw-r--r--makefiles/gmake/libs.mk53
-rw-r--r--makefiles/gmake/platform.mk189
-rw-r--r--makefiles/gmake/platform.mk.vars16
-rw-r--r--makefiles/gmake/sub.mk28
-rw-r--r--makefiles/gmake/top.mk74
-rw-r--r--makefiles/nmake/clean.mk48
-rw-r--r--makefiles/nmake/compiler.mk92
-rw-r--r--makefiles/nmake/config.mk44
-rw-r--r--makefiles/nmake/depend.mk67
-rw-r--r--makefiles/nmake/help.mk9
-rw-r--r--makefiles/nmake/platform.mk28
-rw-r--r--makefiles/nmake/sub.mk27
-rw-r--r--makefiles/nmake/top.mk39
-rw-r--r--src/GNUmakefile68
-rw-r--r--tvision/INSTALL.txt22
-rw-r--r--tvision/Makefile.bcc36
-rw-r--r--tvision/Makefile.in56
-rw-r--r--tvision/Makefile.nmk16
-rw-r--r--tvision/Makefile.wat25
-rw-r--r--tvision/THANKS53
-rw-r--r--tvision/TODO10
-rw-r--r--tvision/borland.txt50
-rw-r--r--tvision/change.log3852
-rw-r--r--tvision/change1.log1621
-rw-r--r--tvision/classes/alcon/alcon.cc1632
-rw-r--r--tvision/classes/alcon/alcondis.cc119
-rw-r--r--tvision/classes/alcon/alconkey.cc79
-rw-r--r--tvision/classes/alcon/alconmouse.cc47
-rw-r--r--tvision/classes/alcon/alconscr.cc509
-rw-r--r--tvision/classes/calcdisp.cc291
-rw-r--r--tvision/classes/calculat.cc68
-rw-r--r--tvision/classes/codepage.cc2769
-rw-r--r--tvision/classes/configfile.cc953
-rw-r--r--tvision/classes/dos/dosdis.cc805
-rw-r--r--tvision/classes/dos/doskey.cc543
-rw-r--r--tvision/classes/dos/dosmouse.cc521
-rw-r--r--tvision/classes/dos/dosscr.cc1004
-rw-r--r--tvision/classes/dos/rhscreen.cc253
-rw-r--r--tvision/classes/dos/screen.cc51
-rw-r--r--tvision/classes/dos/sescreen.cc1548
-rw-r--r--tvision/classes/dos/vesa.cc589
-rw-r--r--tvision/classes/dos/vga.cc449
-rw-r--r--tvision/classes/dos/vgaregs.c225
-rw-r--r--tvision/classes/dos/vgaregs.h320
-rw-r--r--tvision/classes/dos/vgastate.c207
-rw-r--r--tvision/classes/dos/vgastate.h19
-rw-r--r--tvision/classes/fontcoll.cc574
-rw-r--r--tvision/classes/fpbase.cc143
-rw-r--r--tvision/classes/fpstream.cc83
-rw-r--r--tvision/classes/help.cc262
-rw-r--r--tvision/classes/helpbase.cc651
-rw-r--r--tvision/classes/ifpstrea.cc55
-rw-r--r--tvision/classes/iopstrea.cc34
-rw-r--r--tvision/classes/ipstream.cc283
-rw-r--r--tvision/classes/linux/linuxdis.cc382
-rw-r--r--tvision/classes/linux/linuxkey.cc937
-rw-r--r--tvision/classes/linux/linuxmouse.cc142
-rw-r--r--tvision/classes/linux/linuxscr.cc1958
-rw-r--r--tvision/classes/ofpstrea.cc55
-rw-r--r--tvision/classes/opstream.cc237
-rw-r--r--tvision/classes/osclipboard.cc34
-rw-r--r--tvision/classes/pstream.cc132
-rw-r--r--tvision/classes/qnx4/qnx4dis.cc230
-rw-r--r--tvision/classes/qnx4/qnx4key.cc288
-rw-r--r--tvision/classes/qnx4/qnx4mouse.cc254
-rw-r--r--tvision/classes/qnx4/qnx4scr.cc723
-rw-r--r--tvision/classes/qnxrtp/qnxdis.cc171
-rw-r--r--tvision/classes/qnxrtp/qnxkey.cc477
-rw-r--r--tvision/classes/qnxrtp/qnxmouse.cc241
-rw-r--r--tvision/classes/qnxrtp/qnxscr.cc577
-rw-r--r--tvision/classes/tapplica.cc178
-rw-r--r--tvision/classes/tbackgro.cc76
-rw-r--r--tvision/classes/tbutton.cc378
-rw-r--r--tvision/classes/tchdirdi.cc216
-rw-r--r--tvision/classes/tcheckbo.cc59
-rw-r--r--tvision/classes/tclrdisp.cc102
-rw-r--r--tvision/classes/tcluster.cc408
-rw-r--r--tvision/classes/tcollect.cc44
-rw-r--r--tvision/classes/tcolordi.cc184
-rw-r--r--tvision/classes/tcolorgr.cc224
-rw-r--r--tvision/classes/tcolorit.cc118
-rw-r--r--tvision/classes/tcolorse.cc187
-rw-r--r--tvision/classes/tcommand.cc267
-rw-r--r--tvision/classes/tdesktop.cc281
-rw-r--r--tvision/classes/tdialog.cc108
-rw-r--r--tvision/classes/tdircoll.cc40
-rw-r--r--tvision/classes/tdirlist.cc537
-rw-r--r--tvision/classes/tdisplay.cc493
-rw-r--r--tvision/classes/tdrawbuf.cc257
-rw-r--r--tvision/classes/teditor.cc1348
-rw-r--r--tvision/classes/teditorf.cc106
-rw-r--r--tvision/classes/teditwin.cc126
-rw-r--r--tvision/classes/tevent.cc223
-rw-r--r--tvision/classes/tfilecol.cc120
-rw-r--r--tvision/classes/tfiledia.cc326
-rw-r--r--tvision/classes/tfileedi.cc370
-rw-r--r--tvision/classes/tfileinf.cc133
-rw-r--r--tvision/classes/tfileinp.cc83
-rw-r--r--tvision/classes/tfilelis.cc623
-rw-r--r--tvision/classes/tfilterv.cc85
-rw-r--r--tvision/classes/tframe.cc386
-rw-r--r--tvision/classes/tgkey.cc366
-rw-r--r--tvision/classes/tgroup.cc743
-rw-r--r--tvision/classes/thistory.cc143
-rw-r--r--tvision/classes/thistvie.cc89
-rw-r--r--tvision/classes/thistwin.cc56
-rw-r--r--tvision/classes/thwmouse.cc162
-rw-r--r--tvision/classes/tindicat.cc107
-rw-r--r--tvision/classes/tinputli.cc563
-rw-r--r--tvision/classes/tlabel.cc179
-rw-r--r--tvision/classes/tlistbox.cc139
-rw-r--r--tvision/classes/tlistvie.cc530
-rw-r--r--tvision/classes/tlookupv.cc110
-rw-r--r--tvision/classes/tmemo.cc105
-rw-r--r--tvision/classes/tmenubar.cc190
-rw-r--r--tvision/classes/tmenubox.cc164
-rw-r--r--tvision/classes/tmenuvie.cc650
-rw-r--r--tvision/classes/tmonosel.cc91
-rw-r--r--tvision/classes/tmouse.cc27
-rw-r--r--tvision/classes/tnscolle.cc235
-rw-r--r--tvision/classes/tnssorte.cc114
-rw-r--r--tvision/classes/tobject.cc23
-rw-r--r--tvision/classes/tpalette.cc51
-rw-r--r--tvision/classes/tparamte.cc96
-rw-r--r--tvision/classes/tpoint.cc42
-rw-r--r--tvision/classes/tprogini.cc53
-rw-r--r--tvision/classes/tprogram.cc409
-rw-r--r--tvision/classes/tpwobj.cc20
-rw-r--r--tvision/classes/tpwreado.cc41
-rw-r--r--tvision/classes/tpwritte.cc62
-rw-r--r--tvision/classes/tpxvalid.cc500
-rw-r--r--tvision/classes/tradiobu.cc98
-rw-r--r--tvision/classes/trangeva.cc142
-rw-r--r--tvision/classes/trescoll.cc60
-rw-r--r--tvision/classes/tresfile.cc194
-rw-r--r--tvision/classes/tscreen.cc454
-rw-r--r--tvision/classes/tscrollb.cc360
-rw-r--r--tvision/classes/tscrolle.cc215
-rw-r--r--tvision/classes/tsortedc.cc40
-rw-r--r--tvision/classes/tsortedl.cc188
-rw-r--r--tvision/classes/tstatict.cc159
-rw-r--r--tvision/classes/tstatusd.cc43
-rw-r--r--tvision/classes/tstatusl.cc371
-rw-r--r--tvision/classes/tstrinde.cc21
-rw-r--r--tvision/classes/tstringc.cc65
-rw-r--r--tvision/classes/tstringl.cc86
-rw-r--r--tvision/classes/tstrlist.cc76
-rw-r--r--tvision/classes/tstrmcla.cc26
-rw-r--r--tvision/classes/tstrmtyp.cc62
-rw-r--r--tvision/classes/tsubmenu.cc50
-rw-r--r--tvision/classes/ttermina.cc242
-rw-r--r--tvision/classes/ttextdev.cc35
-rw-r--r--tvision/classes/tvalidat.cc77
-rw-r--r--tvision/classes/tvedit1.cc180
-rw-r--r--tvision/classes/tvedit2.cc111
-rw-r--r--tvision/classes/tvedit3.cc208
-rw-r--r--tvision/classes/tview.cc1249
-rw-r--r--tvision/classes/tvintl.cc298
-rw-r--r--tvision/classes/tvtext1.cc142
-rw-r--r--tvision/classes/tvtext2.cc1
-rw-r--r--tvision/classes/twindow.cc275
-rw-r--r--tvision/classes/unix/unixdis.cc130
-rw-r--r--tvision/classes/unix/unixkey.cc566
-rw-r--r--tvision/classes/unix/unixmouse.cc148
-rw-r--r--tvision/classes/unix/unixscr.cc1117
-rw-r--r--tvision/classes/unix/xtermdis.cc355
-rw-r--r--tvision/classes/unix/xtermkey.cc889
-rw-r--r--tvision/classes/unix/xtermmouse.cc93
-rw-r--r--tvision/classes/unix/xtermscr.cc952
-rw-r--r--tvision/classes/win32/win32clip.cc144
-rw-r--r--tvision/classes/win32/win32dis.cc226
-rw-r--r--tvision/classes/win32/win32key.cc464
-rw-r--r--tvision/classes/win32/win32mouse.cc126
-rw-r--r--tvision/classes/win32/win32scr.cc564
-rw-r--r--tvision/classes/wingr/wingrdis.cc1623
-rw-r--r--tvision/classes/wingr/wingrkey.cc517
-rw-r--r--tvision/classes/wingr/wingrmouse.cc188
-rw-r--r--tvision/classes/wingr/wingrscr.cc776
-rw-r--r--tvision/classes/winnt/winntdis.cc218
-rw-r--r--tvision/classes/winnt/winntkey.cc326
-rw-r--r--tvision/classes/winnt/winntmouse.cc78
-rw-r--r--tvision/classes/winnt/winntscr.cc577
-rw-r--r--tvision/classes/x11/x11dis.cc129
-rw-r--r--tvision/classes/x11/x11key.cc479
-rw-r--r--tvision/classes/x11/x11mouse.cc107
-rw-r--r--tvision/classes/x11/x11src.cc2710
-rw-r--r--tvision/compat/beep.c11
-rw-r--r--tvision/compat/compat.gprbin0 -> 18684 bytes
-rw-r--r--tvision/compat/compat.imk226
-rw-r--r--tvision/compat/compat.umk115
-rw-r--r--tvision/compat/drivevalid.c44
-rw-r--r--tvision/compat/expandpath.c41
-rw-r--r--tvision/compat/fexpand.c114
-rw-r--r--tvision/compat/fileattrs.c197
-rw-r--r--tvision/compat/fileexists.c13
-rw-r--r--tvision/compat/filelength.c23
-rw-r--r--tvision/compat/fixpath.c305
-rw-r--r--tvision/compat/fnmatch.c150
-rw-r--r--tvision/compat/getcurdir.c68
-rw-r--r--tvision/compat/getline.c189
-rw-r--r--tvision/compat/getopt.c754
-rw-r--r--tvision/compat/getopt1.c174
-rw-r--r--tvision/compat/getshell.c20
-rw-r--r--tvision/compat/glob.c422
-rw-r--r--tvision/compat/globfree.c20
-rw-r--r--tvision/compat/iffilelen.cc46
-rw-r--r--tvision/compat/isdir.c19
-rw-r--r--tvision/compat/isrelpath.c33
-rw-r--r--tvision/compat/iswild.c12
-rw-r--r--tvision/compat/itoa.c48
-rw-r--r--tvision/compat/mkstemp.c48
-rw-r--r--tvision/compat/nl_langinfo.c71
-rw-r--r--tvision/compat/ntdirent.c161
-rw-r--r--tvision/compat/obj/delete.me2
-rw-r--r--tvision/compat/pathvalid.c62
-rw-r--r--tvision/compat/regex.c4973
-rw-r--r--tvision/compat/releasec.c68
-rw-r--r--tvision/compat/snprintf.c892
-rw-r--r--tvision/compat/ssc_streams.cc294
-rw-r--r--tvision/compat/strlwr.c16
-rw-r--r--tvision/compat/strupr.c16
-rw-r--r--tvision/compat/ticks.c42
-rw-r--r--tvision/compat/unc.c96
-rw-r--r--tvision/compat/unc_95.c112
-rw-r--r--tvision/compat/unc_nt.c109
-rw-r--r--tvision/compat/validfilename.c51
-rw-r--r--tvision/compat/yieldpro.c75
-rw-r--r--tvision/config.pl1355
-rw-r--r--tvision/confignt.pl67
-rwxr-xr-xtvision/configset30
-rw-r--r--tvision/configset.bat14
-rwxr-xr-xtvision/configure2
-rw-r--r--tvision/configure.bat3
-rw-r--r--tvision/conflib.pl1524
-rw-r--r--tvision/copying339
-rw-r--r--tvision/copying.rh46
-rw-r--r--tvision/debian/.cvsignore5
-rw-r--r--tvision/debian/README34
-rw-r--r--tvision/debian/README.debian19
-rw-r--r--tvision/debian/buildpackage5
-rw-r--r--tvision/debian/changelog543
-rw-r--r--tvision/debian/control43
-rw-r--r--tvision/debian/control.in43
-rw-r--r--tvision/debian/copyright15
-rw-r--r--tvision/debian/diversions.ex1
-rw-r--r--tvision/debian/files_to_backup1
-rw-r--r--tvision/debian/info.ex15
-rw-r--r--tvision/debian/maintainer.notes30
-rw-r--r--tvision/debian/rhtvision.postinst6
-rw-r--r--tvision/debian/rhtvision.postrm6
-rw-r--r--tvision/debian/rules138
-rw-r--r--tvision/debian/shlibs.local.ex1
-rw-r--r--tvision/debian/watch.ex5
-rw-r--r--tvision/djgpp/compress.bat2
-rw-r--r--tvision/djgpp/compress.pl111
-rw-r--r--tvision/djgpp/distlist9
-rw-r--r--tvision/djgpp/sacadeb.bat10
-rw-r--r--tvision/djgpp/tmp/delete.me2
-rw-r--r--tvision/doc/Alcon.txt112
-rw-r--r--tvision/doc/CodePages.txt219
-rw-r--r--tvision/doc/ConfigFile.txt200
-rw-r--r--tvision/doc/DOS.txt171
-rw-r--r--tvision/doc/Eterm.txt59
-rw-r--r--tvision/doc/I18n.txt251
-rw-r--r--tvision/doc/Linux.txt274
-rw-r--r--tvision/doc/QNX.txt31
-rw-r--r--tvision/doc/Streams.txt88
-rw-r--r--tvision/doc/TVReference.html3862
-rw-r--r--tvision/doc/Win32.txt103
-rw-r--r--tvision/doc/WinGr.txt11
-rw-r--r--tvision/doc/X11.txt177
-rw-r--r--tvision/doc/XTerm.txt95
-rw-r--r--tvision/doc/html.frt272
-rw-r--r--tvision/doc/install/bcc.txt70
-rw-r--r--tvision/doc/install/cygwin.txt54
-rw-r--r--tvision/doc/install/djgpp.txt84
-rw-r--r--tvision/doc/install/linux.txt41
-rw-r--r--tvision/doc/install/mingwin.txt51
-rw-r--r--tvision/doc/install/msvc.txt105
-rw-r--r--tvision/doc/install/tools.txt137
-rw-r--r--tvision/doc/install/unix.txt113
-rw-r--r--tvision/doc/install/watcom.txt54
-rw-r--r--tvision/doc/libdocs.eprbin0 -> 1202 bytes
-rwxr-xr-xtvision/doc/troubleshooting/Linux/1/code.cc10
-rwxr-xr-xtvision/doc/troubleshooting/Linux/1/readme.txt42
-rwxr-xr-xtvision/doc/troubleshooting/Linux/1/test-utf8.txt3
-rwxr-xr-xtvision/doc/troubleshooting/Linux/1/test.txt3
-rwxr-xr-xtvision/doc/troubleshooting/Linux/1/utf8.cc11
-rwxr-xr-xtvision/doc/troubleshooting/Linux/2/readme.txt38
-rwxr-xr-xtvision/doc/troubleshooting/Linux/3/readme.txt21
-rwxr-xr-xtvision/doc/troubleshooting/Linux/4/readme.txt39
-rwxr-xr-xtvision/doc/troubleshooting/Linux/4/test.cc297
-rwxr-xr-xtvision/doc/troubleshooting/Linux/readme.txt8
-rwxr-xr-xtvision/doc/troubleshooting/readme.txt6
-rw-r--r--tvision/drivers2.cc86
-rw-r--r--tvision/dual.cc52
-rw-r--r--tvision/examples/Makefile118
-rw-r--r--tvision/examples/bhelp/.tvrc6
-rw-r--r--tvision/examples/bhelp/bhelp.cc325
-rw-r--r--tvision/examples/bhelp/bhelp.h80
-rw-r--r--tvision/examples/bhelp/rhide.env5
-rw-r--r--tvision/examples/bhelp/thelp.bmk10
-rw-r--r--tvision/examples/bhelp/thelp.cc221
-rw-r--r--tvision/examples/bhelp/thelp.gprbin0 -> 11230 bytes
-rw-r--r--tvision/examples/bhelp/thelp.mkf11
-rw-r--r--tvision/examples/bhelp/thelp.umk22
-rw-r--r--tvision/examples/clipboard/rhide.env5
-rw-r--r--tvision/examples/clipboard/test.bmk10
-rw-r--r--tvision/examples/clipboard/test.cc174
-rw-r--r--tvision/examples/clipboard/test.gprbin0 -> 10994 bytes
-rw-r--r--tvision/examples/clipboard/test.mkf11
-rw-r--r--tvision/examples/clipboard/test.umk17
-rw-r--r--tvision/examples/common.bmk12
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/README43
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/koi8-r.acm.gzbin0 -> 994 bytes
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/koi8-r.psf.gzbin0 -> 1936 bytes
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/lat1-16.psf.gzbin0 -> 1973 bytes
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/rhide.env5
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/ru1.kmap.gzbin0 -> 3489 bytes
-rwxr-xr-xtvision/examples/cyrillic/linuxkoi8/setkoi8.sh16
-rwxr-xr-xtvision/examples/cyrillic/linuxkoi8/setlat1.sh17
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/test.cc54
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/test.gprbin0 -> 10994 bytes
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/test.mkf11
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/test.umk17
-rw-r--r--tvision/examples/cyrillic/linuxkoi8/trivial.acm129
-rw-r--r--tvision/examples/cyrillic/x11koi8/rhide.env5
-rw-r--r--tvision/examples/cyrillic/x11koi8/test.cc110
-rw-r--r--tvision/examples/cyrillic/x11koi8/test.gprbin0 -> 10994 bytes
-rw-r--r--tvision/examples/cyrillic/x11koi8/test.mkf11
-rw-r--r--tvision/examples/cyrillic/x11koi8/test.umk17
-rw-r--r--tvision/examples/demo/ascii.cc306
-rw-r--r--tvision/examples/demo/ascii.h140
-rw-r--r--tvision/examples/demo/calendar.cc297
-rw-r--r--tvision/examples/demo/calendar.h102
-rw-r--r--tvision/examples/demo/demo.bmk10
-rw-r--r--tvision/examples/demo/demo.gprbin0 -> 13092 bytes
-rw-r--r--tvision/examples/demo/demo.mkf11
-rw-r--r--tvision/examples/demo/demo.umk57
-rw-r--r--tvision/examples/demo/demohelp.h40
-rw-r--r--tvision/examples/demo/demohelp.h32bin0 -> 16221 bytes
-rw-r--r--tvision/examples/demo/diffs.cc416
-rw-r--r--tvision/examples/demo/fileview.cc186
-rw-r--r--tvision/examples/demo/fileview.h88
-rw-r--r--tvision/examples/demo/gadgets.cc185
-rw-r--r--tvision/examples/demo/gadgets.h57
-rw-r--r--tvision/examples/demo/mousedlg.cc155
-rw-r--r--tvision/examples/demo/mousedlg.h44
-rw-r--r--tvision/examples/demo/puzzle.cc371
-rw-r--r--tvision/examples/demo/puzzle.h102
-rw-r--r--tvision/examples/demo/rhide.env5
-rw-r--r--tvision/examples/demo/tvcmds.h28
-rw-r--r--tvision/examples/demo/tvdemo.h71
-rw-r--r--tvision/examples/demo/tvdemo1.cc327
-rw-r--r--tvision/examples/demo/tvdemo2.cc430
-rw-r--r--tvision/examples/demo/tvdemo3.cc273
-rw-r--r--tvision/examples/desklogo/desklogo.bmk10
-rw-r--r--tvision/examples/desklogo/desklogo.cc224
-rw-r--r--tvision/examples/desklogo/desklogo.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/desklogo/desklogo.mkf11
-rw-r--r--tvision/examples/desklogo/desklogo.umk17
-rw-r--r--tvision/examples/desklogo/rhide.env5
-rw-r--r--tvision/examples/desklogo/set-logo.bmk10
-rw-r--r--tvision/examples/desklogo/set-logo.cc259
-rw-r--r--tvision/examples/desklogo/set-logo.gprbin0 -> 10987 bytes
-rw-r--r--tvision/examples/desklogo/set-logo.mkf11
-rw-r--r--tvision/examples/desklogo/set-logo.umk17
-rw-r--r--tvision/examples/desklogo/tv_logo.bmk10
-rw-r--r--tvision/examples/desklogo/tv_logo.cc258
-rw-r--r--tvision/examples/desklogo/tv_logo.gprbin0 -> 10999 bytes
-rw-r--r--tvision/examples/desklogo/tv_logo.mkf11
-rw-r--r--tvision/examples/desklogo/tv_logo.umk17
-rw-r--r--tvision/examples/dlgdsn/codebldr.cc510
-rw-r--r--tvision/examples/dlgdsn/consted.cc461
-rw-r--r--tvision/examples/dlgdsn/consted.h91
-rw-r--r--tvision/examples/dlgdsn/dsgdata.h136
-rw-r--r--tvision/examples/dlgdsn/dsgobjs.cc1504
-rw-r--r--tvision/examples/dlgdsn/dsgobjs.h369
-rw-r--r--tvision/examples/dlgdsn/fdconsts.h105
-rw-r--r--tvision/examples/dlgdsn/freedsgn.cc370
-rw-r--r--tvision/examples/dlgdsn/libtest.gprbin0 -> 13769 bytes
-rw-r--r--tvision/examples/dlgdsn/libtest.mkf11
-rw-r--r--tvision/examples/dlgdsn/libtest.umk52
-rw-r--r--tvision/examples/dlgdsn/propdlgs.cc545
-rw-r--r--tvision/examples/dlgdsn/propdlgs.h56
-rw-r--r--tvision/examples/dlgdsn/propedit.cc1220
-rw-r--r--tvision/examples/dlgdsn/propedit.h122
-rw-r--r--tvision/examples/dlgdsn/rhide.env5
-rw-r--r--tvision/examples/dlgdsn/strmoper.cc108
-rw-r--r--tvision/examples/dlgdsn/strmoper.h33
-rw-r--r--tvision/examples/dlgdsn/tappwnd.cc159
-rw-r--r--tvision/examples/dyntxt/dyntext.bmk10
-rw-r--r--tvision/examples/dyntxt/dyntext.cpp89
-rw-r--r--tvision/examples/dyntxt/dyntext.gprbin0 -> 11249 bytes
-rw-r--r--tvision/examples/dyntxt/dyntext.h59
-rw-r--r--tvision/examples/dyntxt/dyntext.mkf11
-rw-r--r--tvision/examples/dyntxt/dyntext.umk22
-rw-r--r--tvision/examples/dyntxt/readme54
-rw-r--r--tvision/examples/dyntxt/rhide.env5
-rw-r--r--tvision/examples/dyntxt/testdyn.cpp195
-rw-r--r--tvision/examples/eterm/menus.cfg93
-rw-r--r--tvision/examples/eterm/theme.cfg620
-rw-r--r--tvision/examples/fonts/font.016bin0 -> 4096 bytes
-rw-r--r--tvision/examples/fonts/genraw.cc113
-rw-r--r--tvision/examples/fonts/genraw.gprbin0 -> 11623 bytes
-rw-r--r--tvision/examples/fonts/genraw.mkf11
-rw-r--r--tvision/examples/fonts/genraw.umk17
-rw-r--r--tvision/examples/fonts/ocr.sftbin0 -> 19051 bytes
-rw-r--r--tvision/examples/fonts/rhide.env5
-rw-r--r--tvision/examples/fonts/test.cc260
-rw-r--r--tvision/examples/fonts/test.gprbin0 -> 10994 bytes
-rw-r--r--tvision/examples/fonts/test.mkf11
-rw-r--r--tvision/examples/fonts/test.umk17
-rw-r--r--tvision/examples/gen_mkf.pl26
-rw-r--r--tvision/examples/helpdemo/helpdemo.bmk10
-rw-r--r--tvision/examples/helpdemo/helpdemo.cc207
-rw-r--r--tvision/examples/helpdemo/helpdemo.gprbin0 -> 11006 bytes
-rw-r--r--tvision/examples/helpdemo/helpdemo.mkf11
-rw-r--r--tvision/examples/helpdemo/helpdemo.umk17
-rw-r--r--tvision/examples/helpdemo/rhide.env5
-rw-r--r--tvision/examples/i18n/README29
-rw-r--r--tvision/examples/i18n/es.po4
-rwxr-xr-xtvision/examples/i18n/extract.sh2
-rw-r--r--tvision/examples/i18n/intl/es/LC_MESSAGES/test.mobin0 -> 67 bytes
-rw-r--r--tvision/examples/i18n/intl/es/LC_MESSAGES/tvision.mobin0 -> 8427 bytes
-rw-r--r--tvision/examples/i18n/rhide.env5
-rw-r--r--tvision/examples/i18n/test.cc71
-rw-r--r--tvision/examples/i18n/test.gprbin0 -> 10994 bytes
-rw-r--r--tvision/examples/i18n/test.mkf11
-rw-r--r--tvision/examples/i18n/test.po4
-rw-r--r--tvision/examples/i18n/test.umk17
-rw-r--r--tvision/examples/inplis/implis.bmk10
-rw-r--r--tvision/examples/inplis/implis.gprbin0 -> 11224 bytes
-rw-r--r--tvision/examples/inplis/implis.mkf11
-rw-r--r--tvision/examples/inplis/implis.umk22
-rw-r--r--tvision/examples/inplis/inplist.cpp167
-rw-r--r--tvision/examples/inplis/inplist.h69
-rw-r--r--tvision/examples/inplis/rhide.env5
-rw-r--r--tvision/examples/inplis/test.cpp116
-rw-r--r--tvision/examples/listvi/listbox2.cpp163
-rw-r--r--tvision/examples/listvi/lst_view.bmk10
-rw-r--r--tvision/examples/listvi/lst_view.cpp175
-rw-r--r--tvision/examples/listvi/lst_view.gprbin0 -> 11244 bytes
-rw-r--r--tvision/examples/listvi/lst_view.h46
-rw-r--r--tvision/examples/listvi/lst_view.mkf11
-rw-r--r--tvision/examples/listvi/lst_view.umk22
-rw-r--r--tvision/examples/listvi/readme.txt18
-rw-r--r--tvision/examples/listvi/rhide.env5
-rw-r--r--tvision/examples/msgcls/msgcls.bmk10
-rw-r--r--tvision/examples/msgcls/msgcls.gprbin0 -> 11145 bytes
-rw-r--r--tvision/examples/msgcls/msgcls.mkf11
-rw-r--r--tvision/examples/msgcls/msgcls.umk22
-rw-r--r--tvision/examples/msgcls/readme.txt72
-rw-r--r--tvision/examples/msgcls/rhide.env5
-rw-r--r--tvision/examples/msgcls/testdyn.cpp148
-rw-r--r--tvision/examples/msgcls/tlnmsg.cpp291
-rw-r--r--tvision/examples/msgcls/tlnmsg.h113
-rw-r--r--tvision/examples/patchenv.pl123
-rw-r--r--tvision/examples/porting.txt46
-rw-r--r--tvision/examples/progba/example.cpp260
-rw-r--r--tvision/examples/progba/makerez.cpp109
-rw-r--r--tvision/examples/progba/readrez.cpp239
-rw-r--r--tvision/examples/progba/rhide.env5
-rw-r--r--tvision/examples/progba/test.bmk10
-rw-r--r--tvision/examples/progba/test.gprbin0 -> 11128 bytes
-rw-r--r--tvision/examples/progba/test.mkf11
-rw-r--r--tvision/examples/progba/test.umk22
-rw-r--r--tvision/examples/progba/tprogbar.cpp179
-rw-r--r--tvision/examples/progba/tprogbar.h93
-rw-r--r--tvision/examples/readme.txt99
-rw-r--r--tvision/examples/sdlg/dlg.h100
-rw-r--r--tvision/examples/sdlg/main.cpp66
-rw-r--r--tvision/examples/sdlg/rhide.env5
-rw-r--r--tvision/examples/sdlg/scrldlg.cpp48
-rw-r--r--tvision/examples/sdlg/scrlgrp.cpp172
-rw-r--r--tvision/examples/sdlg/test.bmk10
-rw-r--r--tvision/examples/sdlg/test.gprbin0 -> 11343 bytes
-rw-r--r--tvision/examples/sdlg/test.mkf11
-rw-r--r--tvision/examples/sdlg/test.umk27
-rw-r--r--tvision/examples/sdlg2/dlg.h102
-rw-r--r--tvision/examples/sdlg2/main.cpp67
-rw-r--r--tvision/examples/sdlg2/rhide.env5
-rw-r--r--tvision/examples/sdlg2/scrldlg.cpp48
-rw-r--r--tvision/examples/sdlg2/scrlgrp.cpp172
-rw-r--r--tvision/examples/sdlg2/test.bmk10
-rw-r--r--tvision/examples/sdlg2/test.gprbin0 -> 11344 bytes
-rw-r--r--tvision/examples/sdlg2/test.mkf11
-rw-r--r--tvision/examples/sdlg2/test.umk27
-rw-r--r--tvision/examples/tcombo/nmcmbobx.cpp23
-rw-r--r--tvision/examples/tcombo/nmcmbovw.cpp23
-rw-r--r--tvision/examples/tcombo/nmcmbown.cpp23
-rw-r--r--tvision/examples/tcombo/nmsinput.cpp23
-rw-r--r--tvision/examples/tcombo/readme.txt51
-rw-r--r--tvision/examples/tcombo/rhide.env5
-rw-r--r--tvision/examples/tcombo/scombobx.cpp28
-rw-r--r--tvision/examples/tcombo/scombovw.cpp29
-rw-r--r--tvision/examples/tcombo/scombown.cpp28
-rw-r--r--tvision/examples/tcombo/ssinputl.cpp28
-rw-r--r--tvision/examples/tcombo/tcmbovwr.cpp155
-rw-r--r--tvision/examples/tcombo/tcmbowin.cpp106
-rw-r--r--tvision/examples/tcombo/tcombo.txt189
-rw-r--r--tvision/examples/tcombo/tcombobx.cpp177
-rw-r--r--tvision/examples/tcombo/tcombobx.h207
-rw-r--r--tvision/examples/tcombo/test.bmk10
-rw-r--r--tvision/examples/tcombo/test.cpp140
-rw-r--r--tvision/examples/tcombo/test.gprbin0 -> 12830 bytes
-rw-r--r--tvision/examples/tcombo/test.mkf11
-rw-r--r--tvision/examples/tcombo/test.umk77
-rw-r--r--tvision/examples/tcombo/tsinputl.cpp158
-rw-r--r--tvision/examples/tcombo/tsinputl.h54
-rw-r--r--tvision/examples/terminal/rhide.env5
-rw-r--r--tvision/examples/terminal/terminal.cc115
-rw-r--r--tvision/examples/terminal/test.bmk10
-rw-r--r--tvision/examples/terminal/test.gprbin0 -> 11021 bytes
-rw-r--r--tvision/examples/terminal/test.mkf11
-rw-r--r--tvision/examples/terminal/test.umk17
-rw-r--r--tvision/examples/tprogb/calc.cpp215
-rw-r--r--tvision/examples/tprogb/rhide.env5
-rw-r--r--tvision/examples/tprogb/test.bmk10
-rw-r--r--tvision/examples/tprogb/test.gprbin0 -> 11211 bytes
-rw-r--r--tvision/examples/tprogb/test.mkf11
-rw-r--r--tvision/examples/tprogb/test.umk22
-rw-r--r--tvision/examples/tprogb/tprogbar.cpp186
-rw-r--r--tvision/examples/tprogb/tprogbar.h57
-rw-r--r--tvision/examples/tutorial/rhide.env5
-rw-r--r--tvision/examples/tutorial/tvguid01.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid01.cc51
-rw-r--r--tvision/examples/tutorial/tvguid01.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid01.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid01.umk17
-rw-r--r--tvision/examples/tutorial/tvguid02.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid02.cc72
-rw-r--r--tvision/examples/tutorial/tvguid02.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid02.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid02.umk17
-rw-r--r--tvision/examples/tutorial/tvguid03.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid03.cc92
-rw-r--r--tvision/examples/tutorial/tvguid03.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid03.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid03.umk17
-rw-r--r--tvision/examples/tutorial/tvguid04.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid04.cc153
-rw-r--r--tvision/examples/tutorial/tvguid04.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid04.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid04.umk17
-rw-r--r--tvision/examples/tutorial/tvguid05.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid05.cc179
-rw-r--r--tvision/examples/tutorial/tvguid05.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid05.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid05.umk17
-rw-r--r--tvision/examples/tutorial/tvguid06.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid06.cc223
-rw-r--r--tvision/examples/tutorial/tvguid06.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid06.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid06.umk17
-rw-r--r--tvision/examples/tutorial/tvguid07.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid07.cc232
-rw-r--r--tvision/examples/tutorial/tvguid07.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid07.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid07.umk17
-rw-r--r--tvision/examples/tutorial/tvguid08.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid08.cc254
-rw-r--r--tvision/examples/tutorial/tvguid08.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid08.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid08.umk17
-rw-r--r--tvision/examples/tutorial/tvguid09.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid09.cc282
-rw-r--r--tvision/examples/tutorial/tvguid09.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid09.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid09.umk17
-rw-r--r--tvision/examples/tutorial/tvguid10.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid10.cc294
-rw-r--r--tvision/examples/tutorial/tvguid10.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid10.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid10.umk17
-rw-r--r--tvision/examples/tutorial/tvguid11.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid11.cc317
-rw-r--r--tvision/examples/tutorial/tvguid11.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid11.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid11.umk17
-rw-r--r--tvision/examples/tutorial/tvguid12.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid12.cc314
-rw-r--r--tvision/examples/tutorial/tvguid12.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid12.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid12.umk17
-rw-r--r--tvision/examples/tutorial/tvguid13.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid13.cc324
-rw-r--r--tvision/examples/tutorial/tvguid13.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid13.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid13.umk17
-rw-r--r--tvision/examples/tutorial/tvguid14.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid14.cc342
-rw-r--r--tvision/examples/tutorial/tvguid14.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid14.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid14.umk17
-rw-r--r--tvision/examples/tutorial/tvguid15.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid15.cc349
-rw-r--r--tvision/examples/tutorial/tvguid15.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid15.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid15.umk17
-rw-r--r--tvision/examples/tutorial/tvguid16.bmk9
-rw-r--r--tvision/examples/tutorial/tvguid16.cc401
-rw-r--r--tvision/examples/tutorial/tvguid16.gprbin0 -> 11002 bytes
-rw-r--r--tvision/examples/tutorial/tvguid16.mkf11
-rw-r--r--tvision/examples/tutorial/tvguid16.umk17
-rw-r--r--tvision/examples/tvedit/rhide.env5
-rw-r--r--tvision/examples/tvedit/tvedit.bmk10
-rw-r--r--tvision/examples/tvedit/tvedit.cc28
-rw-r--r--tvision/examples/tvedit/tvedit.gprbin0 -> 11010 bytes
-rw-r--r--tvision/examples/tvedit/tvedit.mkf11
-rw-r--r--tvision/examples/tvedit/tvedit.umk17
-rw-r--r--tvision/examples/tvhc/demohelp.txt505
-rw-r--r--tvision/examples/tvhc/rhide.env5
-rw-r--r--tvision/examples/tvhc/tvhc.bmk10
-rw-r--r--tvision/examples/tvhc/tvhc.cc992
-rw-r--r--tvision/examples/tvhc/tvhc.gprbin0 -> 11711 bytes
-rw-r--r--tvision/examples/tvhc/tvhc.h95
-rw-r--r--tvision/examples/tvhc/tvhc.mkf11
-rw-r--r--tvision/examples/tvhc/tvhc.umk17
-rw-r--r--tvision/examples/videomode/rhide.env5
-rw-r--r--tvision/examples/videomode/test.bmk10
-rw-r--r--tvision/examples/videomode/test.cc286
-rw-r--r--tvision/examples/videomode/test.gprbin0 -> 10994 bytes
-rw-r--r--tvision/examples/videomode/test.mkf11
-rw-r--r--tvision/examples/videomode/test.umk17
-rw-r--r--tvision/examples/viewers/test.bmk10
-rw-r--r--tvision/examples/viewers/test.mkf11
-rw-r--r--tvision/examples/viewers/test.umk17
-rwxr-xr-xtvision/examples/xterm/Xterm.res299
-rw-r--r--tvision/extra/doskeys/kextend.asm202
-rw-r--r--tvision/extra/doskeys/kextend.combin0 -> 397 bytes
-rw-r--r--tvision/extra/doskeys/kextend.txt118
-rw-r--r--tvision/extra/eterm/Setedit/MAIN178
-rw-r--r--tvision/extra/eterm/Setedit/Setedit.menu28
-rw-r--r--tvision/extra/eterm/readme.txt87
-rw-r--r--tvision/extra/eterm/xterm-eterm-tv35
-rw-r--r--tvision/extra/pifexamp/setedit.pifbin0 -> 995 bytes
-rw-r--r--tvision/fileview.cc282
-rw-r--r--tvision/fromdos.pl52
-rw-r--r--tvision/fromunix.pl28
-rw-r--r--tvision/histlist.cc208
-rw-r--r--tvision/include/cl/dir.h53
-rw-r--r--tvision/include/cl/dirent.h43
-rw-r--r--tvision/include/cl/fnmatch.h22
-rw-r--r--tvision/include/cl/getopt.h112
-rw-r--r--tvision/include/cl/glob.h36
-rw-r--r--tvision/include/cl/needs.h153
-rw-r--r--tvision/include/cl/regex.h499
-rw-r--r--tvision/include/cl/strstream.h6
-rw-r--r--tvision/include/cl/unistd.h26
-rw-r--r--tvision/include/cl/utime.h20
-rw-r--r--tvision/include/cl/utsname.h1
-rw-r--r--tvision/include/compatlayer.h2605
-rw-r--r--tvision/include/tv.h822
-rw-r--r--tvision/include/tv/alcon/alcon.h309
-rw-r--r--tvision/include/tv/alcon/key.h59
-rw-r--r--tvision/include/tv/alcon/mouse.h58
-rw-r--r--tvision/include/tv/alcon/screen.h173
-rw-r--r--tvision/include/tv/app.h40
-rw-r--r--tvision/include/tv/applictn.h31
-rw-r--r--tvision/include/tv/backgrnd.h65
-rw-r--r--tvision/include/tv/button.h127
-rw-r--r--tvision/include/tv/calc.h143
-rw-r--r--tvision/include/tv/chdirdlg.h82
-rw-r--r--tvision/include/tv/checkbox.h107
-rw-r--r--tvision/include/tv/clrdisp.h65
-rw-r--r--tvision/include/tv/clrdlg.h83
-rw-r--r--tvision/include/tv/clrgroup.h41
-rw-r--r--tvision/include/tv/clrgrpli.h74
-rw-r--r--tvision/include/tv/clritem.h40
-rw-r--r--tvision/include/tv/clriteml.h70
-rw-r--r--tvision/include/tv/clrselct.h75
-rw-r--r--tvision/include/tv/cluster.h103
-rw-r--r--tvision/include/tv/cmdset.h85
-rw-r--r--tvision/include/tv/codepage.h203
-rw-r--r--tvision/include/tv/collectn.h60
-rw-r--r--tvision/include/tv/colorsel.h83
-rw-r--r--tvision/include/tv/configfile.h99
-rw-r--r--tvision/include/tv/desktop.h94
-rw-r--r--tvision/include/tv/dialog.h98
-rw-r--r--tvision/include/tv/dialogs.h109
-rw-r--r--tvision/include/tv/dircoll.h88
-rw-r--r--tvision/include/tv/direntr.h51
-rw-r--r--tvision/include/tv/dirlibo.h100
-rw-r--r--tvision/include/tv/dos/key.h53
-rw-r--r--tvision/include/tv/dos/mouse.h94
-rw-r--r--tvision/include/tv/dos/screen.h185
-rw-r--r--tvision/include/tv/drawbuf.h53
-rw-r--r--tvision/include/tv/drivers.h14
-rw-r--r--tvision/include/tv/editors.h532
-rw-r--r--tvision/include/tv/event.h226
-rw-r--r--tvision/include/tv/eventqu.h71
-rw-r--r--tvision/include/tv/filecoll.h104
-rw-r--r--tvision/include/tv/filedlg.h98
-rw-r--r--tvision/include/tv/filelist.h91
-rw-r--r--tvision/include/tv/fileview.h119
-rw-r--r--tvision/include/tv/filinfpn.h66
-rw-r--r--tvision/include/tv/filinpln.h58
-rw-r--r--tvision/include/tv/findrepl.h47
-rw-r--r--tvision/include/tv/fontcoll.h112
-rw-r--r--tvision/include/tv/fpbase.h79
-rw-r--r--tvision/include/tv/fpstream.h44
-rw-r--r--tvision/include/tv/frame.h97
-rw-r--r--tvision/include/tv/gkey.h208
-rw-r--r--tvision/include/tv/group.h126
-rw-r--r--tvision/include/tv/help.h57
-rw-r--r--tvision/include/tv/helpbase.h189
-rw-r--r--tvision/include/tv/history.h75
-rw-r--r--tvision/include/tv/histvwer.h54
-rw-r--r--tvision/include/tv/histwind.h65
-rw-r--r--tvision/include/tv/ifpstrm.h47
-rw-r--r--tvision/include/tv/indicato.h75
-rw-r--r--tvision/include/tv/inputln.h145
-rw-r--r--tvision/include/tv/intl.h131
-rw-r--r--tvision/include/tv/iopstrm.h36
-rw-r--r--tvision/include/tv/ipstream.h90
-rw-r--r--tvision/include/tv/label.h99
-rw-r--r--tvision/include/tv/linux/key.h116
-rw-r--r--tvision/include/tv/linux/log.h25
-rw-r--r--tvision/include/tv/linux/mouse.h28
-rw-r--r--tvision/include/tv/linux/screen.h236
-rw-r--r--tvision/include/tv/listbox.h94
-rw-r--r--tvision/include/tv/lstviewr.h102
-rw-r--r--tvision/include/tv/menu.h36
-rw-r--r--tvision/include/tv/menubar.h76
-rw-r--r--tvision/include/tv/menubox.h82
-rw-r--r--tvision/include/tv/menuitem.h77
-rw-r--r--tvision/include/tv/menus.h97
-rw-r--r--tvision/include/tv/menuview.h137
-rw-r--r--tvision/include/tv/mnoselct.h66
-rw-r--r--tvision/include/tv/msgbox.h83
-rw-r--r--tvision/include/tv/no_mss.h9
-rw-r--r--tvision/include/tv/nointl.h54
-rw-r--r--tvision/include/tv/nscoll.h88
-rw-r--r--tvision/include/tv/nssorcol.h47
-rw-r--r--tvision/include/tv/object.h57
-rw-r--r--tvision/include/tv/objects.h38
-rw-r--r--tvision/include/tv/ofpstrm.h45
-rw-r--r--tvision/include/tv/opstream.h88
-rw-r--r--tvision/include/tv/osclipboard.h44
-rw-r--r--tvision/include/tv/otstream.h26
-rw-r--r--tvision/include/tv/palette.h38
-rw-r--r--tvision/include/tv/parmtext.h64
-rw-r--r--tvision/include/tv/parttree.h5
-rw-r--r--tvision/include/tv/point.h58
-rw-r--r--tvision/include/tv/preadobj.h51
-rw-r--r--tvision/include/tv/program.h154
-rw-r--r--tvision/include/tv/pstream.h72
-rw-r--r--tvision/include/tv/pwritobj.h77
-rw-r--r--tvision/include/tv/qnx4/key.h29
-rw-r--r--tvision/include/tv/qnx4/mouse.h33
-rw-r--r--tvision/include/tv/qnx4/screen.h94
-rw-r--r--tvision/include/tv/qnxrtp/key.h52
-rw-r--r--tvision/include/tv/qnxrtp/mouse.h38
-rw-r--r--tvision/include/tv/qnxrtp/screen.h88
-rw-r--r--tvision/include/tv/radiobtn.h121
-rw-r--r--tvision/include/tv/rect.h122
-rw-r--r--tvision/include/tv/rescoll.h56
-rw-r--r--tvision/include/tv/resfile.h45
-rw-r--r--tvision/include/tv/resitem.h26
-rw-r--r--tvision/include/tv/resource.h56
-rw-r--r--tvision/include/tv/screen.h477
-rw-r--r--tvision/include/tv/scrlbar.h99
-rw-r--r--tvision/include/tv/scroller.h95
-rw-r--r--tvision/include/tv/searchrc.h27
-rw-r--r--tvision/include/tv/sitem.h46
-rw-r--r--tvision/include/tv/skeleton/key.h46
-rw-r--r--tvision/include/tv/skeleton/mouse.h44
-rw-r--r--tvision/include/tv/skeleton/screen.h152
-rw-r--r--tvision/include/tv/sortcoll.h59
-rw-r--r--tvision/include/tv/sortlibo.h80
-rw-r--r--tvision/include/tv/ssc_streams.h101
-rw-r--r--tvision/include/tv/statsdef.h44
-rw-r--r--tvision/include/tv/statsitm.h53
-rw-r--r--tvision/include/tv/statslin.h103
-rw-r--r--tvision/include/tv/stddlg.h105
-rw-r--r--tvision/include/tv/streambl.h47
-rw-r--r--tvision/include/tv/strilist.h69
-rw-r--r--tvision/include/tv/strinrec.h31
-rw-r--r--tvision/include/tv/strlistm.h70
-rw-r--r--tvision/include/tv/strmblcl.h54
-rw-r--r--tvision/include/tv/strmblty.h54
-rw-r--r--tvision/include/tv/strncoll.h60
-rw-r--r--tvision/include/tv/sttctext.h94
-rw-r--r--tvision/include/tv/submenu.h27
-rw-r--r--tvision/include/tv/system.h76
-rw-r--r--tvision/include/tv/terminal.h51
-rw-r--r--tvision/include/tv/textdev.h40
-rw-r--r--tvision/include/tv/textview.h32
-rw-r--r--tvision/include/tv/tkeyext.h237
-rw-r--r--tvision/include/tv/tkeys.h96
-rw-r--r--tvision/include/tv/tobjstrm.h165
-rw-r--r--tvision/include/tv/ttypes.h24
-rw-r--r--tvision/include/tv/tvconfig.h39
-rw-r--r--tvision/include/tv/tvedit.h57
-rw-r--r--tvision/include/tv/tvobjs.h32
-rw-r--r--tvision/include/tv/tvutil.h98
-rw-r--r--tvision/include/tv/unix/key.h38
-rw-r--r--tvision/include/tv/unix/mouse.h37
-rw-r--r--tvision/include/tv/unix/screen.h135
-rw-r--r--tvision/include/tv/unix/xtkey.h90
-rw-r--r--tvision/include/tv/unix/xtmouse.h32
-rw-r--r--tvision/include/tv/unix/xtscreen.h136
-rw-r--r--tvision/include/tv/validate.h333
-rw-r--r--tvision/include/tv/video.h135
-rw-r--r--tvision/include/tv/view.h212
-rw-r--r--tvision/include/tv/views.h269
-rw-r--r--tvision/include/tv/win32/key.h64
-rw-r--r--tvision/include/tv/win32/mouse.h40
-rw-r--r--tvision/include/tv/win32/screen.h98
-rw-r--r--tvision/include/tv/win32/win32clip.h40
-rw-r--r--tvision/include/tv/window.h113
-rw-r--r--tvision/include/tv/wingr/key.h69
-rw-r--r--tvision/include/tv/wingr/mouse.h51
-rw-r--r--tvision/include/tv/wingr/screen.h275
-rw-r--r--tvision/include/tv/winnt/key.h39
-rw-r--r--tvision/include/tv/winnt/mouse.h27
-rw-r--r--tvision/include/tv/winnt/screen.h120
-rw-r--r--tvision/include/tv/x11/key.h63
-rw-r--r--tvision/include/tv/x11/mouse.h27
-rw-r--r--tvision/include/tv/x11/screen.h308
-rw-r--r--tvision/include/tv/yes_mss.h8
-rw-r--r--tvision/intl/Makefile41
-rw-r--r--tvision/intl/dummy/Makefile5
-rw-r--r--tvision/intl/dummy/intldummy.c35
-rw-r--r--tvision/intl/es.po677
-rw-r--r--tvision/intl/gnumake.in41
-rw-r--r--tvision/intl/pl.po642
-rw-r--r--tvision/intl/ru.po657
-rw-r--r--tvision/intl/tvision.po632
-rw-r--r--tvision/intl/utod.pl15
-rwxr-xr-xtvision/linux/compress151
-rw-r--r--tvision/linux/inclubin.txt7
-rw-r--r--tvision/linux/includbi.txt7
-rw-r--r--tvision/linux/sacadeb10
-rw-r--r--tvision/lista874
-rw-r--r--tvision/lista.dos40
-rw-r--r--tvision/makes/blink.c72
-rw-r--r--tvision/makes/common.bmk65
-rw-r--r--tvision/makes/common.imk71
-rw-r--r--tvision/makes/common.nmk69
-rw-r--r--tvision/makes/common.wat54
-rw-r--r--tvision/makes/config.bcc36
-rw-r--r--tvision/makes/config.nmk33
-rw-r--r--tvision/makes/config.wat53
-rw-r--r--tvision/makes/extrimk.cc879
-rw-r--r--tvision/makes/genimk.cc193
-rw-r--r--tvision/makes/includer.bmk35
-rw-r--r--tvision/makes/includer.imk35
-rw-r--r--tvision/makes/librhtv.bmk63
-rw-r--r--tvision/makes/librhtv.gprbin0 -> 436379 bytes
-rw-r--r--tvision/makes/librhtv.imk7405
-rw-r--r--tvision/makes/librhtv.mkf50
-rw-r--r--tvision/makes/librhtv.umk1463
-rw-r--r--tvision/makes/maintain.mak183
-rw-r--r--tvision/makes/mlink.c76
-rw-r--r--tvision/makes/obj/delete.me2
-rw-r--r--tvision/misc.cc56
-rw-r--r--tvision/miscperl.pl40
-rw-r--r--tvision/msgbox.cc244
-rw-r--r--tvision/names/nbackgro.cc5
-rw-r--r--tvision/names/nbutton.cc5
-rw-r--r--tvision/names/ncalcdis.cc5
-rw-r--r--tvision/names/ncalcula.cc5
-rw-r--r--tvision/names/nchdirdi.cc5
-rw-r--r--tvision/names/ncheckbo.cc6
-rw-r--r--tvision/names/nclrdisp.cc5
-rw-r--r--tvision/names/ncluster.cc5
-rw-r--r--tvision/names/ncollect.cc5
-rw-r--r--tvision/names/ncolordi.cc5
-rw-r--r--tvision/names/ncolorgr.cc5
-rw-r--r--tvision/names/ncolorit.cc5
-rw-r--r--tvision/names/ncolorse.cc5
-rw-r--r--tvision/names/ndesktop.cc5
-rw-r--r--tvision/names/ndialog.cc5
-rw-r--r--tvision/names/ndircoll.cc5
-rw-r--r--tvision/names/ndirlist.cc5
-rw-r--r--tvision/names/neditor.cc4
-rw-r--r--tvision/names/neditwi.cc4
-rw-r--r--tvision/names/nfilecol.cc5
-rw-r--r--tvision/names/nfiledia.cc5
-rw-r--r--tvision/names/nfiledtr.cc4
-rw-r--r--tvision/names/nfileinf.cc5
-rw-r--r--tvision/names/nfileinp.cc5
-rw-r--r--tvision/names/nfilelis.cc5
-rw-r--r--tvision/names/nfilterv.cc5
-rw-r--r--tvision/names/nframe.cc5
-rw-r--r--tvision/names/ngroup.cc5
-rw-r--r--tvision/names/nhistory.cc5
-rw-r--r--tvision/names/nindicat.cc5
-rw-r--r--tvision/names/ninputli.cc5
-rw-r--r--tvision/names/nlabel.cc3
-rw-r--r--tvision/names/nlistbox.cc3
-rw-r--r--tvision/names/nlistvie.cc3
-rw-r--r--tvision/names/nlookupv.cc4
-rw-r--r--tvision/names/nmemo.cc4
-rw-r--r--tvision/names/nmenubar.cc3
-rw-r--r--tvision/names/nmenubox.cc3
-rw-r--r--tvision/names/nmenuvie.cc3
-rw-r--r--tvision/names/nmonosel.cc3
-rw-r--r--tvision/names/nparamte.cc3
-rw-r--r--tvision/names/npxvalid.cc3
-rw-r--r--tvision/names/nradiobu.cc4
-rw-r--r--tvision/names/nrangeva.cc3
-rw-r--r--tvision/names/nresourc.cc3
-rw-r--r--tvision/names/nscrollb.cc3
-rw-r--r--tvision/names/nscrolle.cc3
-rw-r--r--tvision/names/nsortedc.cc3
-rw-r--r--tvision/names/nsortedl.cc3
-rw-r--r--tvision/names/nstatict.cc3
-rw-r--r--tvision/names/nstatusl.cc3
-rw-r--r--tvision/names/nstringc.cc3
-rw-r--r--tvision/names/nstringl.cc3
-rw-r--r--tvision/names/nvalidat.cc3
-rw-r--r--tvision/names/nview.cc3
-rw-r--r--tvision/names/nwindow.cc3
-rw-r--r--tvision/newstr.cc24
-rw-r--r--tvision/qnxrtp/tvision.qpg152
-rw-r--r--tvision/qnxrtp/tvision.qpg.in152
-rw-r--r--tvision/readme.in456
-rw-r--r--tvision/readme.txt456
-rw-r--r--tvision/redhat/.cvsignore2
-rw-r--r--tvision/redhat/README79
-rwxr-xr-xtvision/redhat/config-rpm.sh7
-rwxr-xr-xtvision/redhat/create-dirs.sh13
-rwxr-xr-xtvision/redhat/create-rpms.sh27
-rw-r--r--tvision/redhat/librhtv.spec.in133
-rw-r--r--tvision/rhide.env33
-rw-r--r--tvision/rhtv-config.c192
-rwxr-xr-xtvision/searchstrs.sh2
-rw-r--r--tvision/snapshot.pl177
-rw-r--r--tvision/stream/sbackgro.cc14
-rw-r--r--tvision/stream/sbutton.cc14
-rw-r--r--tvision/stream/scalcdis.cc14
-rw-r--r--tvision/stream/scalcula.cc16
-rw-r--r--tvision/stream/schdirdi.cc16
-rw-r--r--tvision/stream/scheckbo.cc18
-rw-r--r--tvision/stream/sclrdisp.cc14
-rw-r--r--tvision/stream/scluster.cc15
-rw-r--r--tvision/stream/scolordi.cc22
-rw-r--r--tvision/stream/scolorgr.cc14
-rw-r--r--tvision/stream/scolorit.cc14
-rw-r--r--tvision/stream/scolorse.cc14
-rw-r--r--tvision/stream/sdesktop.cc13
-rw-r--r--tvision/stream/sdialog.cc15
-rw-r--r--tvision/stream/sdircoll.cc13
-rw-r--r--tvision/stream/sdirlist.cc13
-rw-r--r--tvision/stream/seditor.cc16
-rw-r--r--tvision/stream/seditwin.cc15
-rw-r--r--tvision/stream/sfilecol.cc13
-rw-r--r--tvision/stream/sfiledia.cc16
-rw-r--r--tvision/stream/sfileedi.cc14
-rw-r--r--tvision/stream/sfileinf.cc13
-rw-r--r--tvision/stream/sfileinp.cc14
-rw-r--r--tvision/stream/sfilelis.cc13
-rw-r--r--tvision/stream/sfilterv.cc13
-rw-r--r--tvision/stream/sframe.cc12
-rw-r--r--tvision/stream/sgroup.cc14
-rw-r--r--tvision/stream/shistory.cc15
-rw-r--r--tvision/stream/sindicat.cc14
-rw-r--r--tvision/stream/sinputli.cc14
-rw-r--r--tvision/stream/slabel.cc14
-rw-r--r--tvision/stream/slistbox.cc14
-rw-r--r--tvision/stream/slistvie.cc15
-rw-r--r--tvision/stream/slookupv.cc18
-rw-r--r--tvision/stream/smemo.cc14
-rw-r--r--tvision/stream/smenubar.cc13
-rw-r--r--tvision/stream/smenubox.cc13
-rw-r--r--tvision/stream/smenuvie.cc14
-rw-r--r--tvision/stream/smonosel.cc14
-rw-r--r--tvision/stream/sparamte.cc15
-rw-r--r--tvision/stream/spxvalid.cc13
-rw-r--r--tvision/stream/sradiobu.cc18
-rw-r--r--tvision/stream/srangeva.cc14
-rw-r--r--tvision/stream/sresourc.cc12
-rw-r--r--tvision/stream/sscrollb.cc14
-rw-r--r--tvision/stream/sscrolle.cc14
-rw-r--r--tvision/stream/sstatict.cc14
-rw-r--r--tvision/stream/sstatusl.cc14
-rw-r--r--tvision/stream/sstringc.cc13
-rw-r--r--tvision/stream/sstringl.cc13
-rw-r--r--tvision/stream/sview.cc13
-rw-r--r--tvision/stream/swindow.cc15
-rwxr-xr-xtvision/update16
-rwxr-xr-xtvision/update.bat15
-rw-r--r--tvision/version.txt1
-rw-r--r--tvision/win32/readme.txt71
-rw-r--r--tvision/winnt/Makefile169
-rw-r--r--tvision/winnt/Makefile.nmk151
-rw-r--r--tvision/winnt/bccmake.in119
-rw-r--r--tvision/winnt/include/msvc/dir.h53
-rw-r--r--tvision/winnt/include/msvc/dirent.h42
-rw-r--r--tvision/winnt/include/msvc/strstream.h6
-rw-r--r--tvision/winnt/include/tv/configtv.h23
-rw-r--r--tvision/winnt/msvcmake.in101
-rw-r--r--tvision/winnt/obj_ms/delete.me2
-rw-r--r--tvision/winnt/objs/delete.me2
-rw-r--r--tvision/winnt/readme.txt50
-rw-r--r--tvision/winnt/tvex.cc52
-rw-r--r--tvision/www-site/bvucs-n1.jpgbin0 -> 2297 bytes
-rw-r--r--tvision/www-site/contrib.html105
-rw-r--r--tvision/www-site/envelp.gifbin0 -> 1664 bytes
-rw-r--r--tvision/www-site/history.html198
-rw-r--r--tvision/www-site/index.html320
-rw-r--r--tvision/www-site/sf.css18
-rwxr-xr-xtvision/www-site/update2
1016 files changed, 151051 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..3163197
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,8 @@
+TOPDIR = .
+
+SUBDIRS = src
+
+PACKAGE_NAME = tvisiontests
+PACKAGE_VERSION = 0.0.1
+
+-include $(TOPDIR)/makefiles/gmake/top.mk
diff --git a/makefiles/README b/makefiles/README
new file mode 100644
index 0000000..d5dcaff
--- /dev/null
+++ b/makefiles/README
@@ -0,0 +1,4 @@
+Snippets and other goodies for makefiles
+
+gmake - include snippets for GNU makefiles
+nmake - include snippets for Windows NMAKE makefiles
diff --git a/makefiles/gmake/clean.mk b/makefiles/gmake/clean.mk
new file mode 100644
index 0000000..92061d4
--- /dev/null
+++ b/makefiles/gmake/clean.mk
@@ -0,0 +1,41 @@
+# cleans up directories
+#
+# requires:
+# - SUBDIRS: for recursive cleaning
+# - local_clean, local_distclean targets in local GNUmakefile
+# - all artifacts to clean:
+# - BINS, TEST_BINS, TEST_CPP_BINS, CPP_BINS
+# - OBJS, CPPOBJS, BIN_OBJS, TEST_BIN_OBJS, CPP_BIN_OBJS, TEST_CPP_BIN_OBJS
+# - CMODULES, CPPMODULES
+#
+# provides:
+# - target: clean
+# - target: distclean
+
+.PHONY: clean_recursive clean local_clean
+
+clean_recursive:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d clean || exit 1); done)
+
+clean: clean_recursive clean_po local_clean
+ -@rm -f *.bak 2>/dev/null
+ -@rm -f *~ 2>/dev/null
+ -@rm -f *.d port/*.d 2>/dev/null
+ -@rm -f $(BINS) $(CPP_BINS) $(TEST_BINS) $(TEST_CPP_BINS) 2>/dev/null
+ -@rm -f $(OBJS) $(CPP_OBJS) $(BIN_OBJS) $(TEST_BIN_OBJS) $(CPP_BIN_OBJS) $(TEST_CPP_BIN_OBJS) 2>/dev/null
+ -@rm -f exec/* 2>/dev/null
+ -@rm -f *.core 2>/dev/null
+ -@rm -f $(CMODULES) $(CPPMODULES) 2>/dev/null
+ -@rm -f $(CMODULES:.o=.d) $(CPPMODULES:.o=.d) 2>/dev/null
+ -@rm -rf $(STATIC_LIB) 2>/dev/null
+ -@rm -rf $(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH) 2>/dev/null
+ -@rm -f $(SH_OBJS) rm -f $(SHPP_OBJS) 2>/dev/null
+
+.PHONY: distclean_recursive distclean local_distclean
+
+distclean_recursive:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d distclean || exit 1); done)
+
+distclean: distclean_recursive local_distclean clean
diff --git a/makefiles/gmake/compiler.mk b/makefiles/gmake/compiler.mk
new file mode 100644
index 0000000..4629fd1
--- /dev/null
+++ b/makefiles/gmake/compiler.mk
@@ -0,0 +1,347 @@
+# sets compiler settings
+#
+# requires:
+# - INCLUDE_DIRS
+#
+# provides:
+# - BIN_OBJS: the object files we need for the binaries which we build always
+# - CPP_BIN_OBJS: same for binaries which have C++ code in them
+# - TEST_BIN_OBJS: same as BIN_OBJS but for test binaries compiled only when
+# testing
+# - TEST_CPP_BIN_OBJS: same for C++ tests
+#
+
+# start of gcc section
+
+ifeq "$(COMPILER)" "gcc"
+
+GCC_MAJOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --gcc-major-version $(CC) "$(CURDIR)" $(TOPDIR))
+GCC_MINOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --gcc-minor-version $(CC) "$(CURDIR)" $(TOPDIR))
+
+# -Wswitch-default: not good for switches with enums
+# -Wsystem-headers: bad idea, as header files are usually happily broken :-)
+# -Wtraditional: we don't want to program tradition K&R C anymore!
+# -Wunsafe-loop-optimizations: ??
+# -Wno-attributes, -Wmissing-format-attribute: ?? later
+# -Wpacked -Wpadded: ?? very questionable
+# -Wunreachable-code: doesn't work
+# -Wno-div-by-zero: we get NaN and friend over macros, so need for funny tricks :-)
+# -Wstrict-overflow=5 is relatively new, later maybe
+# -fstack-protector or -fstack-protector-all: should be used, but U
+# have currently big problems to get it around compiler gcc and -lssl
+# probing! FIXME later
+# -fstack-protector-all: does something funny to the shared objects..
+# -Wstack-protector makes no sense without SSP
+# everything implied by -Wall is not explicitly specified (gcc 4.2.3)
+# TODO: reenable -O2
+# -Waggregate-return: is for K&R code and mostly useless nowadays
+# -Wno-long-long: some boost code header require 'long long'
+
+# compilation flags and compilers
+COMMON_COMPILE_FLAGS = \
+ -g \
+ -fstrict-aliasing \
+ -pedantic -Wall -Werror \
+ -Wno-long-long \
+ -Wunused -Wno-import \
+ -Wformat -Wformat-y2k -Wformat-nonliteral -Wformat-security -Wformat-y2k \
+ -Wswitch-enum -Wunknown-pragmas -Wfloat-equal \
+ -Wundef -Wshadow -Wpointer-arith \
+ -Wcast-qual -Wcast-align \
+ -Wwrite-strings \
+ -Wmissing-noreturn \
+ -Wno-multichar -Wparentheses -Wredundant-decls \
+ -Winline \
+ -Wdisabled-optimization
+ifeq "$(GCC_MAJOR_VERSION)" "4"
+COMMON_COMPILE_FLAGS += \
+ -Wfatal-errors -Wmissing-include-dirs -Wvariadic-macros \
+ -Wvolatile-register-var \
+ -Wstrict-aliasing=2 -Wextra -Winit-self
+# -Wconversion had to meanings before gcc 4.3 (warn about ABI changes when porting
+# old K&R code without function prototypes) and warn about conversions loosing
+# precision. So we enable only -Wconversion (not -Wtraditional-conversion) for gcc
+# >= 4.3 and no -Wconversion for older gcc versions!
+# (see also http://gcc.gnu.org/wiki/NewWconversion)
+ifeq "$(GCC_MINOR_VERSION)" "3"
+COMMON_COMPILE_FLAGS += -Wconversion
+endif
+
+endif
+
+ifeq "$(GCC_MAJOR_VERSION)" "3"
+
+# gcc 3.3, testend on OpenBSD 4.2
+ifeq "$(GCC_MINOR_VERSION)" "3"
+COMMON_COMPILE_FLAGS += \
+ -W
+endif
+
+# gcc 3.4, not tested yet
+ifeq "$(GCC_MINOR_VERSION)" "4"
+COMMON_COMPILE_FLAGS += \
+ -Wstrict-aliasing=2 -Wextra -Winit-self
+endif
+
+endif
+
+STD99_COMPILE_FLAGS = \
+ -std=c99
+
+COMPILE_FLAGS = \
+ $(COMMON_COMPILE_FLAGS) \
+ $(STD99_COMPILE_FLAGS) \
+ -Wnonnull \
+ -Wbad-function-cast -Wstrict-prototypes \
+ -Wmissing-prototypes -Wmissing-declarations \
+ -Wnested-externs
+
+# gcc 4.x
+ifeq "$(GCC_MAJOR_VERSION)" "4"
+COMPILE_FLAGS += \
+ -Wc++-compat -Wdeclaration-after-statement -Wold-style-definition \
+ -funit-at-a-time
+endif
+
+ifeq "$(GCC_MAJOR_VERSION)" "3"
+
+# gcc 3.4, not tested yet
+ifeq "$(GCC_MINOR_VERSION)" "4"
+COMPILE_FLAGS += \
+ -Wdeclaration-after-statement -Wold-style-definition \
+ -funit-at-a-time
+endif
+
+# gcc 3.3, testend on OpenBSD 4.2
+ifeq "$(GCC_MINOR_VERSION)" "3"
+#COMPILE_FLAGS += \
+# -Wdeclaration-after-statement
+endif
+
+endif
+
+CCPP_COMPILE_FLAGS = \
+ $(COMMON_COMPILE_FLAGS) \
+ -std=c++98
+
+# gcc 4.x
+ifeq "$(GCC_MAJOR_VERSION)" "4"
+CCPP_COMPILE_FLAGS += \
+ -Wno-invalid-offsetof -funit-at-a-time
+endif
+
+ifeq "$(GCC_MAJOR_VERSION)" "3"
+
+# gcc 3.4, not tested yet
+ifeq "$(GCC_MINOR_VERSION)" "4"
+CCPP_COMPILE_FLAGS += \
+ -Wno-invalid-offsetof
+endif
+
+# gcc 3.3, testend on OpenBSD 4.2
+ifeq "$(GCC_MINOR_VERSION)" "3"
+#CCPP_COMPILE_FLAGS += \
+# -Wdeclaration-after-statement
+endif
+
+endif
+
+#CC = gcc
+CCPP = g++
+
+endif
+
+# end of gcc section
+
+# start of tcc section
+
+# currently we don't need this, the tcc flags are fairly consistent
+#TCC_MAJOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --tcc-major-version $(CC) "$(CURDIR)" $(TOPDIR))
+#TCC_MINOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --tcc-minor-version $(CC) "$(CURDIR)" $(TOPDIR))
+
+ifeq "$(COMPILER)" "tcc"
+COMPILE_FLAGS = \
+ -Wall -Werror
+endif
+
+# end of tcc section
+
+# start of icc section
+
+# currently we don't need this, the icc flags are fairly consistent
+#ICC_MAJOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --icc-major-version $(CC) "$(CURDIR)" $(TOPDIR))
+#ICC_MINOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --icc-minor-version $(CC) "$(CURDIR)" $(TOPDIR))
+
+# -vec-report0: turn of SSE2 vector usage messages (they are common since P-4 anyway!)
+
+ifeq "$(COMPILER)" "icc"
+COMPILE_FLAGS = \
+ -Wall -Werror -w1 -vec-report0
+endif
+
+# end of icc section
+
+# start of spro section
+
+# -xc99=all: full C99 compliance for the code (syntax and library functions)
+# -Xc: full ISO compliance, no K&R stuf
+# -mt: enable mutlithreading (-D_REENTRANT for header files, -lthread for ld)
+# -errwarn=%all: convert all warnings to errors
+# -v: do more restrictive syntax checking
+# TODO: enable -O2
+
+ifeq "$(COMPILER)" "spro"
+STD99_COMPILE_FLAGS = \
+ -xc99=all
+COMPILE_FLAGS = \
+ $(STD99_COMPILE_FLAGS) -Xc -errwarn=%all -mt -v
+endif
+
+# end of spro section
+
+# start of pcc section
+
+# currently we don't need this, the pcc flags are fairly consistent
+#PCC_MAJOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --pcc-major-version $(CC) "$(CURDIR)" $(TOPDIR))
+#PCC_MINOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --pcc-minor-version $(CC) "$(CURDIR)" $(TOPDIR))
+
+ifeq "$(COMPILER)" "pcc"
+COMPILE_FLAGS = \
+ --fatal-warnings
+endif
+
+# end of pcc section
+
+# set flags for threading support using POSIX threads. This is completly different
+# between compiler/platforms
+ifeq "$(COMPILER)" "gcc"
+ifeq "$(PLATFORM)" "LINUX"
+PTHREADS_CFLAGS = -D_REENTRANT -pthread
+PTHREADS_LDFLAGS = -pthread
+PTHREADS_LIBS =
+endif
+ifeq "$(PLATFORM)" "SUNOS"
+PTHREADS_CFLAGS = -D_REENTRANT -pthreads
+PTHREADS_LDFLAGS = -pthreads
+PTHREADS_LIBS =
+endif
+ifeq "$(PLATFORM)" "FREEBSD"
+PTHREADS_CFLAGS = -D_REENTRANT -pthread
+PTHREADS_LDFLAGS = -pthread
+PTHREADS_LIBS =
+endif
+ifeq "$(PLATFORM)" "NETBSD"
+PTHREADS_CFLAGS = -D_REENTRANT -pthread
+PTHREADS_LDFLAGS = -pthread
+PTHREADS_LIBS =
+endif
+ifeq "$(PLATFORM)" "OPENBSD"
+PTHREADS_CFLAGS = -D_REENTRANT -pthread
+PTHREADS_LDFLAGS = -pthread
+PTHREADS_LIBS =
+endif
+ifeq "$(PLATFORM)" "CYGWIN"
+PTHREADS_CFLAGS =
+PTHREADS_LDFLAGS =
+PTHREADS_LIBS =
+endif
+endif
+
+ifeq "$(COMPILER)" "tcc"
+ifeq "$(PLATFORM)" "LINUX"
+PTHREADS_CFLAGS = -D_REENTRANT
+PTHREADS_LDFLAGS =
+PTHREADS_LIBS = -lpthread
+endif
+endif
+
+ifeq "$(COMPILER)" "pcc"
+ifeq "$(PLATFORM)" "LINUX"
+PTHREADS_CFLAGS = -D_REENTRANT -pthread
+PTHREADS_LDFLAGS = -pthread
+PTHREADS_LIBS =
+endif
+endif
+
+ifeq "$(COMPILER)" "icc"
+ifeq "$(PLATFORM)" "LINUX"
+PTHREADS_CFLAGS = -D_REENTRANT -pthread
+PTHREADS_LDFLAGS = -pthread
+PTHREADS_LIBS =
+endif
+endif
+
+# set flags for position independend code (as required for shared libraries
+# on some platforms)
+ifeq "$(COMPILER)" "gcc"
+ifeq "$(PLATFORM)" "LINUX"
+SO_COMPILE_FLAGS = -fPIC
+endif
+ifeq "$(PLATFORM)" "SUNOS"
+SO_COMPILE_FLAGS = -fPIC
+endif
+ifeq "$(PLATFORM)" "FREEBSD"
+SO_COMPILE_FLAGS = -fPIC
+endif
+ifeq "$(PLATFORM)" "NETBSD"
+SO_COMPILE_FLAGS = -fPIC
+endif
+ifeq "$(PLATFORM)" "OPENBSD"
+SO_COMPILE_FLAGS = -fPIC
+endif
+ifeq "$(PLATFORM)" "CYGWIN"
+# code on Cygwin is always position independend
+SO_COMPILE_FLAGS =
+endif
+endif
+
+ifeq "$(COMPILER)" "icc"
+ifeq "$(PLATFORM)" "LINUX"
+SO_COMPILE_FLAGS = -fPIC
+endif
+endif
+
+# TODO: test this
+#ifeq "$(COMPILER)" "spro"
+#ifeq "$(PLATFORM)" "SUNOS"
+#ifeq "$(ARCH)" "sun4u"
+#SO_COMPILE_FLAGS = -xcode=pic32
+#endif
+#endif
+#endif
+
+CFLAGS = $(COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) $(INCLUDE_CFLAGS) $(PTHREADS_CFLAGS)
+CCPPFLAGS = $(CCPP_COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) $(INCLUDE_CPPFLAGS) $(PTHREADS_CFLAGS)
+
+LDFLAGS = $(INCLUDE_LDFLAGS) $(PTHREADS_LDFLAGS) $(LDFLAGS_NET) $(LDFLAGS_LT)
+LIBS = $(INCLUDE_LIBS) $(PTHREADS_LIBS) $(LIBS_NET) $(LIBS_LT)
+LINK = $(CC)
+CCPP_LINK = $(CCPP)
+
+%.o : %.c
+ $(CC) -c -o $@ $(CFLAGS) $<
+
+%.o : %.cpp
+ $(CCPP) -c -o $@ $(CCPPFLAGS) $<
+
+%$(EXE): %.o $(OBJS) $(TEST_OBJS)
+ $(CCPP_LINK) -o $@ $(LDFLAGS) $(OBJS) $(TEST_OBJS) $< $(LIBS)
+
+%.sho : %.c
+ $(CC) -c -o $@ $(SO_COMPILE_FLAGS) -DSHARED $(CFLAGS) $<
+
+#%$(SO) : %.sho $(OBJS)
+# $(LINK) -shared -o $@ $(LDFLAGS) $(LIBS) $(OBJS) $<
+
+%.sho++ : %.cpp
+ $(CCPP) -c -o $@ $(SO_COMPILE_FLAGS) -DSHARED $(CCPPFLAGS) $<
+
+#%$(SO) : %.sho++ $(OBJS) $(CPPOBJS)
+# $(CCPP_LINK) -shared -o $@ $(LDFLAGS) $(LIBS) $(OBJS) $(CPPOBJS) $<
+
+BIN_OBJS = $(BINS:$(EXE)=.o)
+TEST_BIN_OBJS = $(TEST_BINS:$(EXE)=.o)
+CPP_BIN_OBJS = $(CPP_BINS:$(EXE)=.o)
+TEST_CPP_BIN_OBJS = $(TEST_CPP_BINS:$(EXE)=.o)
+SH_OBJS = $(OBJS:.o=.sho)
+SHPP_OBJS = $(CPP_OBJS:.o=.sho++)
diff --git a/makefiles/gmake/depend.mk b/makefiles/gmake/depend.mk
new file mode 100644
index 0000000..eb832e7
--- /dev/null
+++ b/makefiles/gmake/depend.mk
@@ -0,0 +1,76 @@
+# provides generic rules for C/C++ dependeny generation using
+# 'makedepend', 'gcc -MM' or similar mechanisms
+#
+# requires:
+# - compilers CC and CCPP
+# - INCLUDEDIRS
+# - OBJS, CPP_OBJS and BIN_OBJS, CPP_BIN_OBJS
+# - TEST_BINS, TEST_BIN_OBJS, TEST_CPP_BINS, TEST_CPP_BIN_OBJS
+#
+# provides:
+# - included dependency files
+#
+# author: Andreas Baumann, abaumann at yahoo dot com
+
+ifeq "$(COMPILER)" "gcc"
+
+%.d : %.c
+ @echo Generating dependencies for $<
+ @$(CC) -DMAKE_DEPENDENCIES -MM -MT $(@:.d=.o) $(CFLAGS) $< | \
+ sed "s,\($*\.o\)[ :]*\(.*\),$@ : $$\(wildcard \2\)\&\&\&\1 : \2,g" | tr -s '&' "\n" > $@
+
+%.d : %.cpp
+ @echo Generating dependencies for $<
+ @$(CCPP) -DMAKE_DEPENDENCIES -MM -MT $(@:.d=.o) $(CCPPFLAGS) $< | \
+ sed "s,\($*\.o\)[ :]*\(.*\),$@ : $$\(wildcard \2\)\&\&\&\1 : \2,g" | tr -s '&' "\n" > $@
+
+endif
+
+ifeq "$(COMPILER)" "tcc"
+
+%.d : %.c
+ @echo Generating dependencies for $<
+ @makedepend -DMAKE_DEPENDENCIES $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) -I/usr/lib/tcc/include -f - $< > $@
+
+endif
+
+ifeq "$(COMPILER)" "icc"
+
+%.d : %.c
+ @echo Generating dependencies for $<
+ @$(CC) -DMAKE_DEPENDENCIES -MM -MT $(@:.d=.o) $(CFLAGS) $< | \
+ sed "s,\($*\.o\)[ :]*\(.*\),$@ : $$\(wildcard \2\)\&\&\&\1 : \2,g" | tr -s '&' "\n" > $@
+
+%.d : %.cpp
+ @echo Generating dependencies for $<
+ @$(CCPP) -DMAKE_DEPENDENCIES -MM -MT $(@:.d=.o) $(CCPPFLAGS) $< | \
+ sed "s,\($*\.o\)[ :]*\(.*\),$@ : $$\(wildcard \2\)\&\&\&\1 : \2,g" | tr -s '&' "\n" > $@
+
+endif
+
+ifeq "$(COMPILER)" "spro"
+
+%.d : %.c
+ @echo Generating dependencies for $<
+ @$(CC) -DMAKE_DEPENDENCIES -xM1 $(CFLAGS) $< > $@
+
+%.d : %.cpp
+ @echo Generating dependencies for $<
+ @$(CCPP) -DMAKE_DEPENDENCIES -xM1 $(CCPPFLAGS) $< > $@
+endif
+
+ifeq "$(COMPILER)" "pcc"
+
+# FIXME: platform in path of compiler include files, mmh, how to fix?
+%.d : %.c
+ @echo Generating dependencies for $<
+ @$(CC) -DMAKE_DEPENDENCIES $(CFLAGS) -M $< > $@
+
+endif
+
+-include $(OBJS:.o=.d)
+-include $(CPP_OBJS:.o=.d)
+-include $(BIN_OBJS:.o=.d)
+-include $(CPP_BIN_OBJS:.o=.d)
+-include $(TEST_BIN_OBJS:.o=.d)
+-include $(TEST_CPP_BIN_OBJS:.o=.d)
diff --git a/makefiles/gmake/dist.mk b/makefiles/gmake/dist.mk
new file mode 100644
index 0000000..85ceae7
--- /dev/null
+++ b/makefiles/gmake/dist.mk
@@ -0,0 +1,40 @@
+# creates a source tarball ready for distribution
+#
+# requires:
+# - PACKAGE_NAME
+# - PACKAGE_VERSION
+#
+# provides:
+# - target: dist
+# - target: dist-bz2, dist-gz, dist-Z
+
+.PHONY: dist dist-bz2 dist-gz dist-Z
+
+dist:
+ -@rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+ -@rm -rf /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+ mkdir /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+ cp -r * /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/.
+ -@cd /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION) ; \
+ $(MAKE) distclean ; \
+ rm -f makefiles/gmake/platform.mk.vars; \
+ find . -name .svn -exec rm -rf {} \; ; \
+ find . -name .git -exec rm -rf {} \; ; \
+ cd .. ; \
+ tar cvf $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar \
+ $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+ -@rm -rf /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+ @mv /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar .
+
+dist-bz2: dist
+ -@rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION).bz2
+ @bzip2 -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar
+
+dist-gz: dist
+ -@rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION).gz
+ @gzip $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar
+
+dist-Z: dist
+ -@rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION).Z
+ @compress -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar
+
diff --git a/makefiles/gmake/guess_env b/makefiles/gmake/guess_env
new file mode 100755
index 0000000..2e4f3de
--- /dev/null
+++ b/makefiles/gmake/guess_env
@@ -0,0 +1,224 @@
+#!/bin/sh
+
+# operating system and major, minor version, more should not be necessary
+
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`
+UNAME_RELEASE=`(uname -r) 2>/dev/null`
+UNAME_VERSION=`(uname -v) 2>/dev/null`
+UNAME_MACHINE=`(uname -m) 2>/dev/null`
+
+case "$UNAME_SYSTEM.$UNAME_RELEASE" in
+ Linux*) PLATFORM=LINUX
+ OS_MAJOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 1`
+ OS_MINOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 2`
+
+ if test -f /etc/arch-release; then
+ LINUX_DIST='arch'
+ LINUX_REV='current'
+ elif test -f /etc/debian_version; then
+ LINUX_DIST='debian'
+ LINUX_REV=`cat /etc/debian_version | cut -d . -f 1`
+ elif test -f /etc/slackware-version; then
+ LINUX_DIST='slackware'
+ LINUX_REV=`cat /etc/slackware-version | cut -d ' ' -f 2 | cut -d . -f 1`
+ elif test -f /etc/redhat-release; then
+ LINUX_DIST='redhat'
+ LINUX_REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*// | cut -f 1 -d .`
+ else
+ LINUX_DIST='unknown'
+ LINUX_REV='unknown'
+ fi
+ ;;
+
+ FreeBSD*) PLATFORM=FREEBSD
+ OS_MAJOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 1`
+ OS_MINOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 2 | cut -d - -f 1`
+ ;;
+
+ OpenBSD*) PLATFORM=OPENBSD
+ OS_MAJOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 1`
+ OS_MINOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 2 | cut -d - -f 1`
+ ;;
+
+ NetBSD*) PLATFORM=NETBSD
+ OS_MAJOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 1`
+ OS_MINOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 2 | cut -d - -f 1`
+ ;;
+
+ SunOS*) PLATFORM=SUNOS
+ OS_MAJOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 1`
+ OS_MINOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 2`
+ ;;
+
+ CYGWIN_NT*) PLATFORM=CYGWIN
+ _tmp=`echo $UNAME_SYSTEM | cut -d - -f 2`
+ OS_MAJOR_VERSION=`echo $_tmp | cut -d . -f 1`
+ OS_MINOR_VERSION=`echo $_tmp | cut -d . -f 2`
+ ;;
+
+ *)
+ PLATFORM=UNKNOWN
+ echo "Unknown platform '$UNAME_SYSTEM $UNAME_RELEASE'"
+ exit 1
+esac
+
+# the architecture
+
+case "$UNAME_MACHINE" in
+ i*86*) ARCH=x86
+ ;;
+ x86_64) ARCH=x86_64
+ ;;
+ sun4u) ARCH=sun4u
+ ;;
+
+ *) ARCH=UNKNOWN
+ echo "Unknown architecture '$UNAME_MACHINE'"
+ exit 1
+
+esac
+
+# get last line, old 'tail' syntax and POSIX syntax, both exist out there
+if test "x${PLATFORM}" = "xSUNOS"; then
+ TAIL1='tail -1'
+else
+ TAIL1='tail -n 1'
+fi
+
+# the compiler and version
+
+# what compiler do we have (we can't relly on it's name as it may be a cc link to the binary!)
+CC=$2
+(( $CC -v 2>&1 | $TAIL1 ) | grep -i GCC ) 2>/dev/null 1>/dev/null
+if test $? = 0; then
+ COMPILER='gcc'
+else
+ ( $CC -v | grep tcc ) 2>/dev/null 1>/dev/null
+ if test $? = 0; then
+ COMPILER='tcc'
+ else
+ ( $CC -V 2>&1 | grep l_cproc_p ) >/dev/null
+ if test $? = 0; then
+ COMPILER='icc'
+ else
+ ( $CC -xhelp=readme | head -n 1 | grep 'Sun Studio' ) >/dev/null
+ if test $? = 0; then
+ COMPILER='spro'
+ else
+ ( $CC -v | head -n 1 | grep 'pcc' ) >/dev/null
+ if test $? = 0; then
+ COMPILER='pcc'
+ else
+ COMPILER='unknown'
+ fi
+ fi
+ fi
+ fi
+fi
+
+# version of gcc (GNU C compiler)
+
+if test $COMPILER = "gcc"; then
+ GCC_VERSION=`gcc -dumpversion`
+ GCC_MAJOR_VERSION=`echo $GCC_VERSION | cut -d . -f 1`
+ GCC_MINOR_VERSION=`echo $GCC_VERSION | cut -d . -f 2`
+fi
+
+# version of tcc (Tiny C compiler)
+
+if test $COMPILER = "tcc"; then
+ TCC_VERSION=`tcc -v | cut -d ' ' -f 3`
+ TCC_MAJOR_VERSION=`echo $ICC_VERSION | cut -d . -f 1`
+ TCC_MINOR_VERSION=`echo $ICC_VERSION | cut -d . -f 2`
+fi
+
+# version of icc (Intel C compiler)
+
+if test $COMPILER = "icc"; then
+ ICC_VERSION=`icc -dumpversion`
+ ICC_MAJOR_VERSION=`echo $ICC_VERSION | cut -d . -f 1`
+ ICC_MINOR_VERSION=`echo $ICC_VERSION | cut -d . -f 2`
+fi
+
+# version of spro (Sun Pro compiler, Sun Studio)
+
+if test $COMPILER = "spro"; then
+ SPRO_VERSION=`$CC -xhelp=readme | head -n 1 | cut -d ' ' -f 3`
+ SPRO_MAJOR_VERSION=`echo $SPRO_VERSION | cut -d : -f 1`
+fi
+
+# version of pcc (Portable C Compiler)
+
+if test $COMPILER = "pcc"; then
+ PCC_VERSION=`$CC -v | head -n 1 | cut -d ' ' -f 2`
+ PCC_MAJOR_VERSION=`echo $PCC_VERSION | cut -d . -f 1`
+ PCC_MINOR_VERSION=`echo $PCC_VERSION | cut -d . -f 2`
+fi
+
+case "$1" in
+ --platform) echo $PLATFORM
+ ;;
+
+ --os-major-version) echo $OS_MAJOR_VERSION
+ ;;
+
+ --os-minor-version) echo $OS_MINOR_VERSION
+ ;;
+
+ --arch) echo $ARCH
+ ;;
+
+ --compiler) echo $COMPILER
+ ;;
+
+ --gcc-major-version) echo $GCC_MAJOR_VERSION
+ ;;
+
+ --gcc-minor-version) echo $GCC_MINOR_VERSION
+ ;;
+
+ --tcc-major-version) echo $TCC_MAJOR_VERSION
+ ;;
+
+ --tcc-minor-version) echo $TCC_MINOR_VERSION
+ ;;
+
+ --icc-major-version) echo $ICC_MAJOR_VERSION
+ ;;
+
+ --icc-minor-version) echo $ICC_MINOR_VERSION
+ ;;
+
+ --spro-major-version) echo $SPRO_MAJOR_VERSION
+ ;;
+
+ --pcc-major-version) echo $PCC_MAJOR_VERSION
+ ;;
+
+ --pcc-minor-version) echo $PCC_MINOR_VERSION
+ ;;
+esac
+
+MAKEFILE_DIR="$3/$4"
+
+# regenerate the cache file, otherwise building is far too slow!
+if test ! -f "${MAKEFILE_DIR}/makefiles/gmake/platform.mk.vars"; then
+ cat >"${MAKEFILE_DIR}/makefiles/gmake/platform.mk.vars" <<EOF
+ARCH=$ARCH
+PLATFORM=$PLATFORM
+OS_MAJOR_VERSION=$OS_MAJOR_VERSION
+OS_MINOR_VERSION=$OS_MINOR_VERSION
+COMPILER=$COMPILER
+GCC_MAJOR_VERSION=$GCC_MAJOR_VERSION
+GCC_MINOR_VERSION=$GCC_MINOR_VERSION
+TCC_MAJOR_VERSION=$TCC_MAJOR_VERSION
+TCC_MINOR_VERSION=$TCC_MINOR_VERSION
+ICC_MAJOR_VERSION=$ICC_MAJOR_VERSION
+ICC_MINOR_VERSION=$ICC_MINOR_VERSION
+SPRO_MAJOR_VERSION=$SPRO_MAJOR_VERSION
+PCC_MAJOR_VERSION=$PCC_MAJOR_VERSION
+PCC_MINOR_VERSION=$PCC_MINOR_VERSION
+LINUX_DIST=$LINUX_DIST
+LINUX_REV=$LINUX_REV
+EOF
+fi
diff --git a/makefiles/gmake/help.mk b/makefiles/gmake/help.mk
new file mode 100644
index 0000000..fc7e321
--- /dev/null
+++ b/makefiles/gmake/help.mk
@@ -0,0 +1,15 @@
+
+Available targets:
+
+make [all] create all artifacts
+make test create test binaries and execute tests
+make doc build the documentation
+make clean clean up build artifacts
+make distclean clean up all generated artifacts
+make install install (set 'DESTDIR' and 'prefix' at will)
+make uninstall uninstall (set 'DESTDIR' and 'prefix' at will)
+make dist[-Z|-gz|-bz2] create tarball containing all sources
+make help show this very help page
+make init-po create initial version of the gettext files
+make merge-po merge the gettext files after changes
+make check-po check sanity of gettext files
diff --git a/makefiles/gmake/i18n.mk b/makefiles/gmake/i18n.mk
new file mode 100644
index 0000000..08a29e4
--- /dev/null
+++ b/makefiles/gmake/i18n.mk
@@ -0,0 +1,103 @@
+# handle localization stuff (gettext)
+# (this follows roughly the way Postgresql handles NLS)
+#
+# requires:
+# - CATALOG_NAME: name of the catalog (name of the library or program)
+# will be installed as $(CATALOG_NAME).po in the localedir
+# - GETTEXT_LANGUAGES: list of languages supported
+# - GETTEXT_FILES: list of source files that contain message strings
+# - GETTEXT_TRIGGERS: (optional) list of functions/macros that contain
+# translatable strings
+#
+# provides:
+# - target: init-po
+# - target: merge-po
+# - taget: check-po
+# - target: install_po
+# - target: uninstall_po
+
+.PHONY: init-po update-po all_po clean_po install_po uninstall_po
+
+ifeq "$(ENABLE_NLS)" "1"
+
+PO_FILES = $(addprefix po/, $(addsuffix .po, $(GETTEXT_LANGUAGES)))
+MO_FILES = $(addprefix po/, $(addsuffix .mo, $(GETTEXT_LANGUAGES)))
+
+%.mo : %.po
+ $(MSGFMT) -c -o $@ $<
+
+po/$(CATALOG_NAME).pot: $(GETTEXT_FILES)
+ $(XGETTEXT) -n -F -d $(CATALOG_NAME) -o $@ \
+ $(addprefix -k, $(GETTEXT_TRIGGERS)) --flag=_:1:pass-c-format \
+ -d $(CATALOG_NAME) -n -F $(GETTEXT_FILES)
+
+ifneq "$(GETTEXT_FILES)" ""
+init-po: po/$(CATALOG_NAME).pot
+else
+init-po:
+endif
+
+ifneq "$(GETTEXT_FILES)" ""
+merge-po: po/$(CATALOG_NAME).pot
+ @test -z "$(GETTEXT_LANGUAGES)" || \
+ for lang in $(GETTEXT_LANGUAGES)""; do ( \
+ echo "merging po/$$lang.mo and $<.." && \
+ if $(MSGMERGE) -F -o po/$$lang.po.new po/$$lang.po $<; then \
+ cp po/$$lang.po po/$$lang.po.bak && \
+ mv po/$$lang.po.new po/$$lang.po; \
+ else \
+ echo "Please check, msgmerge for po/$$lang.po failed!"; \
+ rm -f po/$$lang.po.new; \
+ fi \
+ ) done
+else
+merge-po:
+endif
+
+check-po: $(PO_FILES)
+ @test -z "$^" || \
+ for file in $^""; do ( \
+ echo "checking gettext file $$file of catalog $(CATALOG_NAME).." && \
+ $(MSGFMT) -c -v -o /dev/null $$file || exit 1 \
+ ) done
+
+clean_po:
+ @-rm -f $(MO_FILES) 2>/dev/null
+ @-rm -f po/$(CATALOG_NAME).pot 2>/dev/null
+ @-rm -f po/*.bak 2>/dev/null
+ @-rm -f po/*~ 2>/dev/null
+
+# hooks for the standard targets handling gettext stuff
+
+all_po: $(MO_FILES)
+
+install_po:
+ @test -z "$(GETTEXT_LANGUAGES)" || \
+ for lang in $(GETTEXT_LANGUAGES)""; do ( \
+ echo "installing po/$$lang.mo to $(localedir)/$$lang/LC_MESSAGES.." && \
+ $(INSTALL) -d -m 755 $(localedir)/$$lang/LC_MESSAGES && \
+ $(INSTALL) -m 644 po/$$lang.mo $(localedir)/$$lang/LC_MESSAGES/$(CATALOG_NAME).mo || exit 1 \
+ ) done
+
+uninstall_po:
+ @test -z "$(GETTEXT_LANGUAGES)" || \
+ for lang in $(GETTEXT_LANGUAGES)""; do ( \
+ echo "uninstalling $(localedir)/$$lang/LC_MESSAGES.." && \
+ rm $(localedir)/$$lang/LC_MESSAGES/$(CATALOG_NAME).mo && \
+ rmdir $(localedir)/$$lang/LC_MESSAGES || exit 1 \
+ ) done
+
+else
+
+# No NLS supported wanted, provide dummy targets
+
+init-po:
+merge-po:
+check-po:
+
+all_po:
+clean_po:
+install_po:
+uninstall_po:
+
+endif
diff --git a/makefiles/gmake/install.mk b/makefiles/gmake/install.mk
new file mode 100644
index 0000000..ac6d49d
--- /dev/null
+++ b/makefiles/gmake/install.mk
@@ -0,0 +1,64 @@
+# install
+#
+# requires:
+# - DESTDIR: temporary or final destination dir for installation
+# - prefix: prefix for the directory root (e.g. /usr)
+#
+# provides:
+# - target: install
+# - target: uninstall
+
+# default values
+DESTDIR=
+prefix=/usr
+
+# standard directories following FHS
+execdir=$(DESTDIR)$(prefix)
+bindir=$(execdir)/bin
+sbindir=$(execdir)/sbin
+libdir=$(execdir)/lib
+sysconfdir=$(execdir)/etc
+includedir=$(execdir)/include
+datadir=$(execdir)/share
+localedir=$(datadir)/locale
+
+.PHONY: install_recursive install local_install
+
+install_recursive:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d install || exit 1); done)
+
+install: install_recursive local_install install_po
+ @test -d "$(libdir)" || mkdir -p "$(libdir)"
+ @test -z "$(STATIC_LIB)" || ( \
+ $(INSTALL) -m 644 $(STATIC_LIB) $(libdir)/$(STATIC_LIB) )
+ @test -z "$(DYNAMIC_LIB)" || ( \
+ $(INSTALL) -m 755 $(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH) \
+ $(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH) )
+ @test -z "$(DYNAMIC_LIB)" || ( \
+ rm -f "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)" && \
+ ln -s "$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH)" \
+ "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)" )
+ @test -z "$(DYNAMIC_LIB)" || ( \
+ rm -f "$(libdir)/$(DYNAMIC_LIB)" && \
+ ln -s "$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH)" \
+ "$(libdir)/$(DYNAMIC_LIB)" )
+
+.PHONY: uninstall_recursive uninstall local_uninstall
+
+uninstall_recursive:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d uninstall || exit 1); done)
+
+uninstall: uninstall_recursive local_uninstall uninstall_po
+ test -z "$(DYNAMIC_LIB)" || ( \
+ test ! -f "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH)" || \
+ rm "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH)" )
+ test -z "$(DYNAMIC_LIB)" || ( \
+ test ! -h "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)" || \
+ rm "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)" )
+ test -z "$(DYNAMIC_LIB)" || ( \
+ test ! -h "$(libdir)/$(DYNAMIC_LIB)" || \
+ rm "$(libdir)/$(DYNAMIC_LIB)" )
+ test -z "$(STATIC_LIB)" || ( \
+ test ! -f "$(libdir)/$(STATIC_LIB)" || rm "$(libdir)/$(STATIC_LIB)" )
diff --git a/makefiles/gmake/libs.mk b/makefiles/gmake/libs.mk
new file mode 100644
index 0000000..08899c3
--- /dev/null
+++ b/makefiles/gmake/libs.mk
@@ -0,0 +1,53 @@
+# provides explicit library rules
+#
+# requires:
+# - STATIC_LIB: name of the static library
+# - DYNAMIC_LIB: soname and versions of the shared library
+# - all others like OBJS, CPP_OBJS, LIBS, SH_OBJS, SHPP_OBJS, LDFLAGS
+#
+# provides:
+# - targets to build the static and dynamic version of the project's library
+#
+
+ifeq "$(PLATFORM)" "LINUX"
+SO_FLAGS = -shared -Wl,-soname,$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)
+endif
+
+ifeq "$(PLATFORM)" "SUNOS"
+ifeq "$(COMPILER)" "gcc"
+SO_FLAGS = -shared -Wl,-h,$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)
+endif
+ifeq "$(COMPILER)" "spro"
+SO_FLAGS = -G -h $(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)
+endif
+endif
+
+ifeq "$(PLATFORM)" "FREEBSD"
+SO_FLAGS = -shared -Wl,-x,-soname,$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)
+endif
+
+ifeq "$(PLATFORM)" "OPENBSD"
+SO_FLAGS = -shared -Wl,-soname,$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)
+endif
+
+ifeq "$(PLATFORM)" "NETBSD"
+SO_FLAGS = -shared -Wl,-soname,$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)
+endif
+
+ifeq "$(PLATFORM)" "CYGWIN"
+SO_FLAGS = -shared -Wl,-soname,$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)
+endif
+
+ifneq "$(STATIC_LIB)" ""
+$(STATIC_LIB) : $(OBJS) $(CPP_OBJS)
+ $(AR) cr $@ $(OBJS) $(CPP_OBJS)
+else
+$(STATIC_LIB) :
+endif
+
+ifneq "$(DYNAMIC_LIB)" ""
+$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH) : $(SH_OBJS) $(SHPP_OBJS)
+ $(CCPP_LINK) $(SO_FLAGS) -o $@ $(LDFLAGS) $(SH_OBJS) $(SHPP_OBJS) $(LIBS)
+else
+$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH) :
+endif
diff --git a/makefiles/gmake/platform.mk b/makefiles/gmake/platform.mk
new file mode 100644
index 0000000..7499a1e
--- /dev/null
+++ b/makefiles/gmake/platform.mk
@@ -0,0 +1,189 @@
+# sets e. g. to LINUX, OS_MAJOR_VERSION to 2 and OS_MINOR_VERSION to 6
+# by calling the 'guess_env' shell script, where the actual probing happens
+# Also sets PLATFORM_COMPILE_FLAGS to be included when compiling C/C++ code
+#
+# requires:
+# - TOPDIR
+#
+# provides:
+# - PLATFORM
+# - OS_MAJOR_VERSION and OS_MINOR_VERSION
+# - GCC_MAJOR_VERSION and GCC_MINOR_VERSION
+# - PLATFORM_COMPILE_FLAGS
+# - EXE
+# - SO
+# - INSTALL
+# - BOOST_LIBRARY_TAG
+#
+# author: Andreas Baumann, abaumann at yahoo dot com
+
+-include $(TOPDIR)/makefiles/gmake/platform.mk.vars
+
+PLATFORM ?= $(shell $(SHELL) $(TOPDIR)/makefiles/gmake/guess_env --platform $(CC) "$(CURDIR)" $(TOPDIR))
+OS_MAJOR_VERSION ?= $(shell $(SHELL) $(TOPDIR)/makefiles/gmake/guess_env --os-major-version $(CC) "$(CURDIR)" $(TOPDIR))
+OS_MINOR_VERSION ?= $(shell $(SHELL) $(TOPDIR)/makefiles/gmake/guess_env --os-minor-version $(CC) "$(CURDIR)" $(TOPDIR))
+COMPILER ?= $(shell $(SHELL) $(TOPDIR)/makefiles/gmake/guess_env --compiler $(CC) "$(CURDIR)" $(TOPDIR))
+ifeq "$(PLATFORM)" "LINUX"
+LINUX_DIST ?= $(shell $(SHELL) $(TOPDIR)/makefiles/gmake/guess_env --linux-dist $(CC) "$(CURDIR)" $(TOPDIR))
+LINUX_REV ?= $(shell $(SHELL) $(TOPDIR)/makefiles/gmake/guess_env --linux-rev $(CC) "$(CURDIR)" $(TOPDIR))
+endif
+
+# platform specific flags
+#########################
+
+PLATFORM_COMPILE_FLAGS = \
+ -D$(PLATFORM) \
+ -DOS_MAJOR_VERSION=$(OS_MAJOR_VERSION) \
+ -DOS_MINOR_VERSION=$(OS_MINOR_VERSION)
+
+ifeq "$(PLATFORM)" "LINUX"
+PLATFORM_COMPILE_FLAGS += \
+ -DLINUX_DIST=$(LINUX_DIST) -DLINUX_REV=$(LINUX_REV)
+endif
+
+# extensions for binaries
+ifeq "$(PLATFORM)" "CYGWIN"
+EXE = .exe
+else
+EXE =
+endif
+
+# extensions for shared libraries
+# (TOOD: HP/Unix has .shlib, Mac/X has .lib, but we can't test it currently)
+SO = .so
+
+# name if the installation program
+# (TODO: use the MIT or openradio install-sh script instead?)
+INSTALL = $(shell $(SHELL) $(TOPDIR)/makefiles/gmake/guess_env --install)
+ifeq "$(PLATFORM)" "SUNOS"
+INSTALL = /usr/ucb/install
+else
+INSTALL = install
+endif
+
+# dynamic linker
+################
+
+# the linker library for dynamically loadable modules
+# (TODO: check for all platforms, as soon we add loadable modules here from
+# old TextWolf)
+ifeq "$(PLATFORM)" "LINUX"
+LIBS_DL = -ldl
+else
+LIBS_DL =
+endif
+
+# i18n, gettext/libintl
+#######################
+
+# enable or disable internationalization code
+ENABLE_NLS = 1
+
+ifeq "$(ENABLE_NLS)" "1"
+
+# we relly only on the GNU version, other versions (e.g. Solaris) are not
+# so nice..
+
+MSGFMT=msgfmt
+MSGMERGE=msgmerge
+XGETTEXT=xgettext
+
+# the GNU internationalization support is sometimes in separate libarries
+ifeq "$(PLATFORM)" "LINUX"
+INCLUDE_FLAGS_LT =
+LDFLAGS_LT =
+LIBS_LT =
+endif
+
+ifeq "$(PLATFORM)" "SUNOS"
+INCLUDE_FLAGS_LT = -I/usr/local/include
+LDFLAGS_LT = -L/usr/local/lib
+LIBS_LT = -lintl
+endif
+
+ifeq "$(PLATFORM)" "FREEBSD"
+INCLUDE_FLAGS_LT = -I/usr/local/include
+LDFLAGS_LT = -L/usr/local/lib
+LIBS_LT = -lintl
+endif
+
+ifeq "$(PLATFORM)" "OPENBSD"
+INCLUDE_FLAGS_LT = -I/usr/local/include
+LDFLAGS_LT = -L/usr/local/lib
+LIBS_LT = -lintl -liconv
+endif
+
+ifeq "$(PLATFORM)" "CYGWIN"
+INCLUDE_FLAGS_LT =
+LDFLAGS_LT =
+LIBS_LT = -lintl
+endif
+
+ifeq "$(PLATFORM)" "NETBSD"
+INCLUDE_FLAGS_LT =
+LDFLAGS_LT =
+LIBS_LT = -lintl
+endif
+
+PLATFORM_COMPILE_FLAGS += $(INCLUDE_FLAGS_LT)
+
+endif
+
+PLATFORM_COMPILE_FLAGS += \
+ -DENABLE_NLS=$(ENABLE_NLS) -DLOCALEDIR=\"$(localedir)\"
+
+# TCP/IP, DNS
+#############
+
+ifeq "$(PLATFORM)" "LINUX"
+INCLUDE_FLAGS_NET =
+LDFLAGS_NET =
+LIBS_NET =
+endif
+
+ifeq "$(PLATFORM)" "SUNOS"
+INCLUDE_FLAGS_NET =
+LDFLAGS_NET =
+LIBS_NET = -lsocket -lnsl
+endif
+
+ifeq "$(PLATFORM)" "FREEBSD"
+INCLUDE_FLAGS_NET =
+LDFLAGS_NET =
+LIBS_NET =
+endif
+
+ifeq "$(PLATFORM)" "OPENBSD"
+INCLUDE_FLAGS_NET =
+LDFLAGS_NET =
+LIBS_NET =
+endif
+
+ifeq "$(PLATFORM)" "CYGWIN"
+INCLUDE_FLAGS_NET =
+LDFLAGS_NET =
+LIBS_NET =
+endif
+
+ifeq "$(PLATFORM)" "NETBSD"
+INCLUDE_FLAGS_NET =
+LDFLAGS_NET =
+LIBS_NET =
+endif
+
+PLATFORM_COMPILE_FLAGS += $(INCLUDE_FLAGS_NET)
+
+# XSLT processor
+################
+
+XSLTPROC = xsltproc
+
+# Boost
+#######
+
+ifeq "$(PLATFORM)" "LINUX"
+ifeq "$(LINUX_DIST)" "arch"
+BOOST_DIR = /usr
+BOOST_LIBRARY_TAG = "-mt"
+endif
+endif
diff --git a/makefiles/gmake/platform.mk.vars b/makefiles/gmake/platform.mk.vars
new file mode 100644
index 0000000..348ca3b
--- /dev/null
+++ b/makefiles/gmake/platform.mk.vars
@@ -0,0 +1,16 @@
+ARCH=x86
+PLATFORM=LINUX
+OS_MAJOR_VERSION=2
+OS_MINOR_VERSION=6
+COMPILER=gcc
+GCC_MAJOR_VERSION=4
+GCC_MINOR_VERSION=5
+TCC_MAJOR_VERSION=
+TCC_MINOR_VERSION=
+ICC_MAJOR_VERSION=
+ICC_MINOR_VERSION=
+SPRO_MAJOR_VERSION=
+PCC_MAJOR_VERSION=
+PCC_MINOR_VERSION=
+LINUX_DIST=arch
+LINUX_REV=current
diff --git a/makefiles/gmake/sub.mk b/makefiles/gmake/sub.mk
new file mode 100644
index 0000000..962c63f
--- /dev/null
+++ b/makefiles/gmake/sub.mk
@@ -0,0 +1,28 @@
+# makefile for a sub package
+#
+# requires:
+# - TOPDIR
+# - SUBDIRS
+# - INCLUDE_DIRS
+#
+# provides:
+# - target: all targets
+
+-include $(TOPDIR)/makefiles/gmake/platform.mk
+-include $(TOPDIR)/makefiles/gmake/compiler.mk
+
+.PHONY: all $(SUBDIRS) local_all
+all: $(OBJS) $(CPPOBJS) $(BIN_OBJS) $(CPP_BIN_OBJS) $(BINS) $(CPP_BINS) $(CMODULES) $(CPPMODULES) $(STATIC_LIB) $(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH) local_all all_po
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d all || exit 1); done)
+
+.PHONY: test local_test
+test: $(OBJS) $(TEST_OBJS) $(CPPOBJS) $(BIN_OBJS) $(BINS) $(CPP_BINS) $(TEST_BIN_OBJS) $(TEST_BINS) $(TEST_CPP_BINS) $(CMODULES) $(CPPMODULES) $(STATIC_LIB) local_test
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d test || exit 1); done)
+
+-include $(TOPDIR)/makefiles/gmake/depend.mk
+-include $(TOPDIR)/makefiles/gmake/clean.mk
+-include $(TOPDIR)/makefiles/gmake/install.mk
+-include $(TOPDIR)/makefiles/gmake/i18n.mk
+-include $(TOPDIR)/makefiles/gmake/libs.mk
diff --git a/makefiles/gmake/top.mk b/makefiles/gmake/top.mk
new file mode 100644
index 0000000..810bedc
--- /dev/null
+++ b/makefiles/gmake/top.mk
@@ -0,0 +1,74 @@
+# top-level makefile for a package
+#
+# requires:
+# - TOPDIR
+# - SUBDIRS
+#
+# provides:
+# - target 'all'
+# - target 'clean'
+# - target 'distclean'
+# - target 'test'
+# - target 'doc'
+# - target 'dist'
+# - target 'help'
+# - target 'install'
+# - target 'uninstall'
+
+-include makefiles/gmake/platform.mk
+
+.PHONY: all
+all:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d all || exit 1); done)
+
+.PHONY: clean
+clean:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d clean || exit 1); done)
+ @-rm $(TOPDIR)/makefiles/gmake/platform.mk.vars
+
+.PHONY: distclean
+distclean:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d distclean || exit 1); done)
+ @-rm $(TOPDIR)/makefiles/gmake/platform.mk.vars
+
+.PHONY: install
+install:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d install || exit 1); done)
+
+.PHONY: uninstall
+uninstall:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d uninstall || exit 1); done)
+
+.PHONY: test
+test: all
+ @$(MAKE) -C tests test
+
+.PHONY: doc
+doc:
+ cd docs; $(MAKE) doc
+
+.PHONY: help
+help:
+ @cat $(TOPDIR)/makefiles/gmake/help.mk
+
+.PHONY: init-po
+init-po:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d init-po || exit 1); done)
+
+.PHONY: merge-po
+merge-po:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d merge-po || exit 1); done)
+
+.PHONY: check-po
+check-po:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d check-po || exit 1); done)
+
+-include $(TOPDIR)/makefiles/gmake/dist.mk
diff --git a/makefiles/nmake/clean.mk b/makefiles/nmake/clean.mk
new file mode 100644
index 0000000..91d941b
--- /dev/null
+++ b/makefiles/nmake/clean.mk
@@ -0,0 +1,48 @@
+# cleans up directories
+#
+# requires:
+# - SUBDIRS: for recursive cleaning
+# - local_clean, local_distclean targets in local GNUmakefile
+# - all artifacts to clean:
+# - BINS, TEST_BINS, TEST_CPP_BINS, CPP_BINS
+# - OBJS, CPPOBJS, BIN_OBJS, TEST_BIN_OBJS, CPP_BIN_OBJS, TEST_CPP_BIN_OBJS
+# - CMODULES, CPPMODULES
+#
+# provides:
+# - target: clean
+# - target: distclean
+
+clean_recursive:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 clean & cd ..
+
+#clean: clean_recursive local_clean
+# -@rm -f *.d port/*.d 2>/dev/null
+# -@rm -f $(BINS) $(CPP_BINS) $(TEST_BINS) $(TEST_CPP_BINS) 2>/dev/null
+# -@rm -f $(OBJS) $(CPP_OBJS) $(BIN_OBJS) $(TEST_BIN_OBJS) $(CPP_BIN_OBJS) $(TEST_CPP_BIN_OBJS) 2>/dev/null
+# -@rm -f exec/*
+# -@rm -f *.core
+# -@rm -f $(CMODULES) $(CPPMODULES)
+# -@rm -f $(CMODULES .o=.d) $(CPPMODULES .o=.d)
+clean: clean_recursive local_clean
+ -@erase *.bak 2>NUL
+ -@erase *~ 2>NUL
+ -@erase *.d 2>NUL
+ -@erase *.exe 2>NUL
+ -@erase *.exe.manifest 2>NUL
+ -@erase *.obj 2>NUL
+ -@erase $(OBJS) 2>NUL
+ -@erase *.pdb 2>NUL
+ -@erase *.rc 2>NUL
+ -@erase *.res 2>NUL
+ -@erase MSG*.bin 2>NUL
+ -@erase *.dllobj 2>NUL
+ -@erase $(DLL_OBJS) 2>NUL
+ -@erase *.exp 2>NUL
+ -@erase *.ilk 2>NUL
+ -@erase *.idb 2>NUL
+ -@erase *.manifest 2>NUL
+
+distclean_recursive:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 distclean & cd ..
+
+distclean: distclean_recursive local_distclean clean
diff --git a/makefiles/nmake/compiler.mk b/makefiles/nmake/compiler.mk
new file mode 100644
index 0000000..2cfcb17
--- /dev/null
+++ b/makefiles/nmake/compiler.mk
@@ -0,0 +1,92 @@
+# sets compiler settings
+#
+# requires:
+# - INCLUDE_DIRS
+#
+# provides:
+# - BIN_OBJS: the object files we need for the binaries which we build always
+# - CPP_BIN_OBJS: same for binaries which have C++ code in them
+# - TEST_BIN_OBJS: same as BIN_OBJS but for test binaries compiled only when
+# testing
+# - TEST_CPP_BIN_OBJS: same for C++ tests
+#
+
+# TODO: which flags to enable?
+# /nologo: disable MS disclaimer
+# /MT: create a multi-thread binary
+# /EHsc: enable C++ exception handling
+# /Ox: optimize what you can
+# /Zi: enable debug information
+# /MTD: create multi-threaded debug binary
+# /we<n>: show warnings (level 1 to 4)
+# /Wall: enable all warnings
+
+# compilation flags and compilers (release)
+COMMON_COMPILE_FLAGS = /MD /nologo /O2 /c $(INCLUDE_DIRS)
+
+# compilation flags and compilers (debug)
+#COMMON_COMPILE_FLAGS = /MDd /ZI /nologo /c $(INCLUDE_DIRS) /RTC1
+
+COMPILE_FLAGS = $(COMMON_COMPILE_FLAGS)
+
+CCPP_COMPILE_FLAGS = $(COMMON_COMPILE_FLAGS) /EHsc
+
+CFLAGS = $(COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(DEBUGLEVELFLAGS)
+CCPPFLAGS = $(CCPP_COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(DEBUGLEVELFLAGS)
+CC = cl.exe
+CCPP = cl.exe
+MC = "$(PLATFORM_SDK_DIR)\Bin\mc.exe"
+RC = "$(PLATFORM_SDK_DIR)\Bin\rc.exe"
+
+# linking flags (release)
+LDFLAGS = /nologo $(INCLUDE_LDFLAGS)
+
+# linking flags (debug)
+#LDFLAGS = /nologo /debug $(INCLUDE_LDFLAGS)
+
+LIBS = $(INCLUDE_LIBS)
+LINK = link.exe
+CCPP_LINK = link.exe
+
+.SUFFIXES: .c .cpp .obj .exe .mc .rc .res
+
+.c.obj:
+ $(CC) $(CFLAGS) /Fo$@ $<
+
+.cpp.obj:
+ $(CCPP) $(CCPPFLAGS) /Fo$@ $<
+
+.c.dllobj:
+ $(CC) $(CFLAGS) /D "BUILD_SHARED" /Fo$@ $<
+
+.cpp.dllobj:
+ $(CCPP) $(CCPPFLAGS) /D "BUILD_SHARED" /Fo$@ $<
+
+.obj.exe:
+ $(CCPP_LINK) $(LDFLAGS) $(LIBS) /out:$@ $< $(OBJS)
+
+.mc.rc:
+ $(MC) -h $(@D) -r $(@D) $<
+
+.rc.res:
+ $(RC) $<
+
+#%$(EXE): %.o $(OBJS) $(TEST_OBJS)
+# $(LINK) -o $@ $(LDFLAGS) $(OBJS) $(TEST_OBJS) $< $(LIBS)
+
+#%.sho : %.c
+# $(CC) -c -o $@ -fPIC -DSHARED $(CFLAGS) $<
+
+#%$(SO) : %.sho $(OBJS)
+# $(LINK) -shared -o $@ $(LDFLAGS) $(LIBS) $(OBJS) $<
+
+#%.sho++ : %.cpp
+# $(CCPP) -c -o $@ -fPIC -DSHARED $(CCPPFLAGS) $<
+
+#%$(SO) : %.sho++ $(OBJS) $(CPPOBJS)
+# $(CCPP_LINK) -shared -o $@ $(LDFLAGS) $(LIBS) $(OBJS) $(CPPOBJS) $<
+
+#BIN_OBJS = $(BINS:$(EXE)=.o)
+#TEST_BIN_OBJS = $(TEST_BINS:$(EXE)=.o)
+#CPP_BIN_OBJS = $(CPP_BINS:$(EXE)=.o)
+#TEST_CPP_BIN_OBJS = $(TEST_CPP_BINS:$(EXE)=.o)
diff --git a/makefiles/nmake/config.mk b/makefiles/nmake/config.mk
new file mode 100644
index 0000000..3dcdef4
--- /dev/null
+++ b/makefiles/nmake/config.mk
@@ -0,0 +1,44 @@
+# Configuration supposed to be configured here by the user
+#
+# provides:
+# - PLATFORM_SDK_DIR
+# - BOOST_DIR
+# - OPENSSL_DIR
+
+# please customize
+
+# Windows Platform SDK
+######################
+
+# The location of the Windows Platform SDK
+# newer versions of Visual Studio integrate the header files of the SDK
+# some versions of Visual Studio miss the mc.exe binary
+
+PLATFORM_SDK_DIR = C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
+#PLATFORM_SDK_DIR = C:\Programme\Microsoft Platform SDK for Windows Server 2003 R2
+
+# Boost (http://www.boostpro.com/download)
+###########################################
+
+# version of the boost library
+
+BOOST_VERSION=1_42
+
+# base dir where boost is installed
+
+BOOST_DIR=C:\Program Files\boost\boost_$(BOOST_VERSION)
+#BOOST_DIR=C:\Programme\boost\boost_$(BOOST_VERSION)
+
+# visual studio version used for compiling
+
+BOOST_VC_VER=vc90
+#BOOST_VC_VER=vc80
+
+# TODO: probe those
+BOOST_MT=-mt
+
+# OpenSSL (http://www.slproweb.com/products/Win32OpenSSL.html)
+##############################################################
+
+OPENSSL_DIR=C:\Program Files\OpenSSL
+#OPENSSL_DIR=C:\Programme\OpenSSL
diff --git a/makefiles/nmake/depend.mk b/makefiles/nmake/depend.mk
new file mode 100644
index 0000000..bcdb5b2
--- /dev/null
+++ b/makefiles/nmake/depend.mk
@@ -0,0 +1,67 @@
+# provides generic rules for C/C++ dependeny generation using
+# 'makedepend', 'gcc -MM' or similar mechanisms
+#
+# requires:
+# - compilers CC and CCPP
+# - INCLUDEDIRS
+# - OBJS, CPP_OBJS and BIN_OBJS, CPP_BIN_OBJS
+# - TEST_BINS, TEST_BIN_OBJS, TEST_CPP_BINS, TEST_CPP_BIN_OBJS
+#
+# provides:
+# - included dependency files
+#
+# author: Andreas Baumann, abaumann at yahoo dot com
+
+ifeq "$(COMPILER)" "gcc"
+
+%.d : %.c
+ @echo Generating dependencies for $<
+ @$(CC) -DMAKE_DEPENDENCIES -MM -MT $@ $(CFLAGS) $< | \
+ sed "s,\($*\.o\)[ :]*\(.*\),$@ : $$\(wildcard \2\)\&\&\&\1 : \2,g" | tr -s '&' "\n" > $@
+
+%.d : %.cpp
+ @echo Generating dependencies for $<
+ @$(CCPP) -DMAKE_DEPENDENCIES -MM -MT $@ $(CCPPFLAGS) $< | \
+ sed "s,\($*\.o\)[ :]*\(.*\),$@ : $$\(wildcard \2\)\&\&\&\1 : \2,g" | tr -s '&' "\n" > $@
+
+endif
+
+ifeq "$(COMPILER)" "tcc"
+
+%.d : %.c
+ @echo Generating dependencies for $<
+ @makedepend -DMAKE_DEPENDENCIES $(INCLUDE_DIRS) -I/usr/lib/tcc/include -f - $< > $@
+
+endif
+
+ifeq "$(COMPILER)" "icc"
+
+%.d : %.c
+ @echo Generating dependencies for $<
+ @$(CC) -DMAKE_DEPENDENCIES -MM -MT $@ $(CFLAGS) $< | \
+ sed "s,\($*\.o\)[ :]*\(.*\),$@ : $$\(wildcard \2\)\&\&\&\1 : \2,g" | tr -s '&' "\n" > $@
+
+%.d : %.cpp
+ @echo Generating dependencies for $<
+ @$(CCPP) -DMAKE_DEPENDENCIES -MM -MT $@ $(CCPPFLAGS) $< | \
+ sed "s,\($*\.o\)[ :]*\(.*\),$@ : $$\(wildcard \2\)\&\&\&\1 : \2,g" | tr -s '&' "\n" > $@
+
+endif
+
+ifeq "$(COMPILER)" "spro"
+
+%.d : %.c
+ @echo Generating dependencies for $<
+ @$(CC) -DMAKE_DEPENDENCIES -xM1 $(INCLUDE_DIRS) $< > $@
+
+%.d : %.cpp
+ @echo Generating dependencies for $<
+ @$(CCPP) -DMAKE_DEPENDENCIES -xM1 $(INCLUDE_DIRS) $< > $@
+endif
+
+-include $(OBJS:.o=.d)
+-include $(CPP_OBJS:.o=.d)
+-include $(BIN_OBJS:.o=.d)
+-include $(CPP_BIN_OBJS:.o=.d)
+-include $(TEST_BIN_OBJS:.o=.d)
+-include $(TEST_CPP_BIN_OBJS:.o=.d)
diff --git a/makefiles/nmake/help.mk b/makefiles/nmake/help.mk
new file mode 100644
index 0000000..3e42448
--- /dev/null
+++ b/makefiles/nmake/help.mk
@@ -0,0 +1,9 @@
+
+Available targets:
+
+make [all] create all artifacts
+make test create test binaries and execute tests
+make doc build the documentation
+make clean clean up build artifacts
+make distclean clean up all generated artifacts
+make help show this very help page
diff --git a/makefiles/nmake/platform.mk b/makefiles/nmake/platform.mk
new file mode 100644
index 0000000..bdc9c2f
--- /dev/null
+++ b/makefiles/nmake/platform.mk
@@ -0,0 +1,28 @@
+# Sets Windows specific variables
+#
+# provides:
+# - BOOST_LIBRARY_TAG: how libraries are auto-tagged, for example
+# libboost_log-vc90-mt-1_42
+#
+# author: Andreas Baumann, abaumann at yahoo dot com
+
+!include $(TOPDIR)\makefiles\nmake\config.mk
+
+# TODO: maybe we have to probe certain things like the version
+# of the visual studio or the availability of certain addons
+# like Windows Unix Services, MOSS stuff or SDKs
+
+#PLATFORM = $(shell $(TOPDIR)/makefiles/gmake/guess_env --platform $(CC))
+#OS_MAJOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --os-major-version $(CC))
+#OS_MINOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --os-minor-version $(CC))
+#COMPILER = $(shell $(TOPDIR)/makefiles/gmake/guess_env --compiler $(CC))
+
+#PLATFORM_COMPILE_FLAGS = \
+# -D$(PLATFORM) \
+# -DOS_MAJOR_VERSION=$(OS_MAJOR_VERSION) \
+# -DOS_MINOR_VERSION=$(OS_MINOR_VERSION)
+
+# Boost
+#######
+
+BOOST_LIBRARY_TAG=-$(BOOST_VC_VER)$(BOOST_MT)-$(BOOST_VERSION)
diff --git a/makefiles/nmake/sub.mk b/makefiles/nmake/sub.mk
new file mode 100644
index 0000000..f300e9b
--- /dev/null
+++ b/makefiles/nmake/sub.mk
@@ -0,0 +1,27 @@
+# makefile for a sub package
+#
+# requires:
+# - TOPDIR
+# - SUBDIRS
+# - INCLUDE_DIRS
+#
+# provides:
+# - target: all targets
+
+!include $(TOPDIR)\makefiles\nmake\platform.mk
+!include $(TOPDIR)\makefiles\nmake\compiler.mk
+
+all: local_all
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 all & cd ..
+
+#.PHONY: all $(SUBDIRS) local_all
+#all: $(OBJS) $(CPPOBJS) $(BIN_OBJS) $(CPP_BIN_OBJS) $(BINS) $(CPP_BINS) $(CMODULES) $(CPPMODULES) local_all
+# @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+# (set -e; $(MAKE) -C $$d all || exit 1); done)
+
+test: $(OBJS) $(TEST_OBJS) $(CPPOBJS) $(BIN_OBJS) $(BINS) $(CPP_BINS) $(TEST_BIN_OBJS) $(TEST_BINS) $(TEST_CPP_BINS) $(CMODULES) $(CPPMODULES) local_test
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 test & cd ..
+
+#-include $(TOPDIR)/makefiles/gmake/depend.mk
+!include $(TOPDIR)\makefiles\nmake\clean.mk
+#-include $(TOPDIR)/makefiles/gmake/install.mk
diff --git a/makefiles/nmake/top.mk b/makefiles/nmake/top.mk
new file mode 100644
index 0000000..188375a
--- /dev/null
+++ b/makefiles/nmake/top.mk
@@ -0,0 +1,39 @@
+# top-level makefile for a package
+#
+# requires:
+# - TOPDIR
+# - SUBDIRS
+#
+# provides:
+# - target 'all'
+# - target 'clean'
+# - target 'distclean'
+# - target 'test'
+# - target 'doc'
+# - target 'dist'
+# - target 'help'
+
+all:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 all & cd ..
+
+clean:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 clean & cd ..
+
+distclean:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 distclean & cd ..
+
+#.PHONY: install
+#install:
+# @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+# (set -e; $(MAKE) -C $$d install || exit 1); done)
+
+test: all
+ @cd tests & $(MAKE) /nologo /f Makefile.W32 test
+
+doc:
+ @cd docs & $(MAKE) /nologo /f Makefile.W32 doc
+
+help:
+ @type makefiles\nmake\help.mk
+
+#-include $(TOPDIR)/makefiles/gmake/dist.mk
diff --git a/src/GNUmakefile b/src/GNUmakefile
new file mode 100644
index 0000000..55d0e3b
--- /dev/null
+++ b/src/GNUmakefile
@@ -0,0 +1,68 @@
+TOPDIR = ..
+
+SUBDIRS =
+
+INCLUDE_CPPFLAGS = \
+ -DBOOST_LOG_USE_NATIVE_SYSLOG
+
+INCLUDE_LDFLAGS = \
+ -L$(TOPDIR)/libs/boost/log
+
+INCLUDE_DIRS = -I. \
+ -I$(TOPDIR)/include -I$(TOPDIR)
+
+-include $(TOPDIR)/makefiles/gmake/platform.mk
+
+INCLUDE_LIBS = \
+ -lboost_thread$(BOOST_LIBRARY_TAG) -lboost_system \
+ -lboost_program_options \
+ -lboost_filesystem \
+ -lboost_log -lboost_log_setup \
+ -lssl
+
+CPP_BINS = \
+ smerpd$(EXE)
+
+STATIC_LIB = \
+
+STATIC_LIB_OBJS = \
+
+C_PORT_OBJS = \
+
+OBJS = \
+ $(C_PORT_OBJS) \
+ $(STATIC_LIB_OBJS) \
+ version.o \
+ appInstance.o \
+ commandLine.o \
+ logLevel.o \
+ logSyslogFacility.o \
+ logger.o \
+ configFile.o \
+ appConfig.o \
+ request.o \
+ reply.o \
+ server.o \
+ connection.o \
+ getPassword.o \
+ requestHandler.o \
+ posixMain.o
+
+CPP_BINS = \
+ smerpd$(EXE)
+
+-include $(TOPDIR)/makefiles/gmake/sub.mk
+
+local_all: $(CPP_BINS)
+
+$(STATIC_LIBS): $(STATIC_LIBS_OBJS)
+ ar rcs $(STATIC_LIBS) $(STATIC_LIB_OBJS)
+
+local_clean:
+ @rm -f $(STATIC_LIBS)
+
+local_distclean:
+
+local_install:
+ $(INSTALL) -d -m 755 $(bindir)
+ $(INSTALL) -m 644 $(CPP_BINS) $(bindir)
diff --git a/tvision/INSTALL.txt b/tvision/INSTALL.txt
new file mode 100644
index 0000000..2557896
--- /dev/null
+++ b/tvision/INSTALL.txt
@@ -0,0 +1,22 @@
+ Read this file to know how to install from sources.
+
+ The package have an unified methode to compile for all the available
+platforms. But even with it I give separated instructions for each target.
+
+ Here are the files that describes how to compile for each target:
+ [alphabetically sorted]
+
+Borland C++ (5.5, 5.6) doc/install/bcc.txt
+CygWin doc/install/cygwin.txt
+DJGPP (2.02, 2.03) doc/install/djgpp.txt
+Linux doc/install/linux.txt
+Microsoft Visual C (5.0, 6.0, 7.0) doc/install/msvc.txt
+MingWin doc/install/mingwin.txt
+Open Watcom (1.3) doc/install/watcom.txt
+UNIX (POSIX) systems doc/install/unix.txt
+
+ Important: If you want to contribute to this project you can help me to
+keep any of these targets working. You just need to get the CVS changes
+periodically compile and tell me if it worked or not.
+
+$Id: INSTALL.txt,v 2.3 2005/09/20 14:48:37 set Exp $
diff --git a/tvision/Makefile.bcc b/tvision/Makefile.bcc
new file mode 100644
index 0000000..04acd6a
--- /dev/null
+++ b/tvision/Makefile.bcc
@@ -0,0 +1,36 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2005 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# That's the makefile for Borland C++ compiler.
+# Also used by MSVC (nmake) and Open Watcom (wmake).
+# I used BC++ 5.5 free command line tools for testing.
+#
+
+!ifdef FOR_NMAKE
+MKF_EXT=.nmk
+MAKE=nmake
+!else ifdef FOR_OW
+MKF_EXT=.wat
+MAKE=wmake -ms
+ExLIB=.dll
+!else
+MKF_EXT=.bmk
+!endif
+
+#
+# Main targets
+#
+all: makes\librhtv$(ExLIB) $(EXTRA_TARGETS)
+
+makes\librhtv$(ExLIB):
+ -cd makes
+ $(MAKE) MKF_EXT="$(MKF_EXT)" DEBUG="$(DEBUG)" EXTRA_TARGETS="$(EXTRA_TARGETS)" -f librhtv.bmk all
+ -cd ..
+
+clean:
+ -del makes\obj\*.obj
+ -del makes\*.lib
+ -del makes\*$(ExLIB)
+
diff --git a/tvision/Makefile.in b/tvision/Makefile.in
new file mode 100644
index 0000000..1d59290
--- /dev/null
+++ b/tvision/Makefile.in
@@ -0,0 +1,56 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+ifeq ($(prefix),)
+ prefix=@prefix@
+endif
+ifeq ($(INSTALL),)
+ INSTALL=@install@
+endif
+EXE_EXT=@exe_ext@
+libdir=$(prefix)/lib
+OS=@OS@
+@maintainer_mode@
+@darwin@
+export
+
+.PHONY: @targets@ @installers@ install-headers install-config clean \
+ intl-dummy examples
+
+all: @targets@ intl-dummy
+
+@maintainance_rule@
+
+@target_rules@
+
+@intl_dummy_rule@
+
+examples:
+ $(MAKE) -C examples
+
+rhtv-config$(EXE_EXT): rhtv-config.c include/tv/configtv.h
+ @GCC@ -o rhtv-config$(EXE_EXT) -Iinclude rhtv-config.c
+
+install-headers:
+ @install_headers@
+
+@install_rules@
+
+@intl_dummy_install_rule@
+
+install-config:
+ @install_config@
+
+install: @installers@ install-headers install-intl-dummy install-config
+
+@clean@
+
+#
+# For compatibility with automake:
+# needed to 'make dist' of tiger
+#
+distdir: clean
+ @cp -pR * $(distdir)
+
diff --git a/tvision/Makefile.nmk b/tvision/Makefile.nmk
new file mode 100644
index 0000000..f8db22e
--- /dev/null
+++ b/tvision/Makefile.nmk
@@ -0,0 +1,16 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# That's the makefile for MSVC compiler.
+#
+# This file reuses the Makefile.bcc file but defining FOR_NMAKE variable to
+# select Microsoft tools.
+#
+
+FOR_NMAKE=1
+# Uncomment to generate code with debug information.
+#DEBUG=1
+!include Makefile.bcc
+
diff --git a/tvision/Makefile.wat b/tvision/Makefile.wat
new file mode 100644
index 0000000..3b94037
--- /dev/null
+++ b/tvision/Makefile.wat
@@ -0,0 +1,25 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2005 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# That's the makefile for MSVC compiler.
+#
+# This file reuses the Makefile.bcc file but defining FOR_OW variable to
+# select Open Watcom tools.
+#
+# wmake -f Makefile.wat
+#
+
+FOR_OW=1
+# Uncomment to generate code with debug information.
+DEBUG=1
+EXTRA_TARGETS=makes\librhtv.lib
+!include Makefile.bcc
+
+# Import library:
+makes\librhtv.lib: makes\librhtv$(ExLIB)
+ -cd makes
+ wlib -q -n -b librhtv.lib +librhtv.dll
+ -cd ..
+
diff --git a/tvision/THANKS b/tvision/THANKS
new file mode 100644
index 0000000..d5eefa0
--- /dev/null
+++ b/tvision/THANKS
@@ -0,0 +1,53 @@
+Excluding Robert and me (SET) the following people contributed valuable things
+to the project.
+If I omitted somebody please e-mail me! The list is sorted alphabetically.
+
+Alex Lozano: Solaris beta testing.
+
+Anatoli Soltan: BC++ and WinNT code.
+
+Andrey `Onyx' Shevtsov (miniEleph): A lot of help and testing for the FreeBSD
+port.
+
+Andris Pavenis: Many patches and help to support the last releases of gcc.
+
+Dominique (Anamorphose): RPM packages (v1.1.4) and newer Red Hat 7.2
+packages.
+
+Ivan Baldo: Debian packager and beta tester.
+
+Jose Angel Sanchez Caso (JASC): Big endian solutions, the drivers concept
+implemented in TV 2.0 and the graphical Win32 driver.
+
+Laurynas Biveinis: A lot of patches collected from the net, MSS support,
+testing and ideas.
+
+Michel Catudal: RPM packages (v1.1.3) and newer SuSE 8.0 packages.
+
+Mike Gorchak: QNX6 and QNX4 port.
+
+Roman Valyushenko: X11 bug reports and fixes, X11 busy cursor and russian
+translation of the messages.
+
+Ronald Landheer: Help with the Cygwin port.
+
+Sergio Sigala: He maintains a BSD port of TV from where I took some of the
+examples. I think Robert based his Linux code on it.
+
+Tapio Kelloniemi: Information about how to make the library cooperate with
+Braille Terminals.
+
+Vadim Beloborodov: MinGW and Win32 code.
+
+WintiX: Miscrosoft C compiler help and test.
+
+
+The following users also contributed with small patches, testing and bug
+reports:
+
+Alex Matulich, Anders Blom, Arvin Baccay, Cesar Rabak, Christoph Bauer,
+Christopher Nelson, David Nock, David A. Capello, Dean Wakerley, Dim Zegebart,
+Dimitar Jekov, Egon Eckert, Jerzy Witkowski, Joel Soete, Luis Pistoia, Matt
+Mueller, Nate Eldredge, Norberto Alfredo Bensa, Owen Rudge, Robert Varga,
+Sean Proctor, Sergey Krivulja, Tanes Sriviroolchai, Tatu Kilappa, Waldemar
+Schultz and Wojciech Warczakowski.
diff --git a/tvision/TODO b/tvision/TODO
new file mode 100644
index 0000000..1559d76
--- /dev/null
+++ b/tvision/TODO
@@ -0,0 +1,10 @@
+That's a list of things to do in the project:
+
+* Fix problems when compiling the library with -DNO_STREAM. Laurynas
+Biveinis <lauras@softhome.net> contributed some fixes. More work is needed.
+* Add some mode where graphic modes aren't restored. Restoring graphic modes
+is dangerous in machines with buggy Windows video drivers. Reference report:
+0001.txt.
+* Implement something like TVIntl, it should handle the intl initialization,
+hide the gettext stuff and provide a remapping according to the current App
+code page.
diff --git a/tvision/borland.txt b/tvision/borland.txt
new file mode 100644
index 0000000..13e4b9a
--- /dev/null
+++ b/tvision/borland.txt
@@ -0,0 +1,50 @@
+Borland TurboVision 2.0
+
+NOTE ON THE CONTENTS OF THIS ARCHIVE:
+-------------------------------------
+The three enclosed .ZIP files comprise all necessary and
+available source and documentation for TurboVision 2.0.
+
+Note that no path information is stored in these archives.
+Typically, the contents of INCLUDE.ZIP are to be placed in
+\BCx\INCLUDE\TVISION; the contents of SOURCE.ZIP are to be
+placed in \BCx\SOURCE\TVISION. Also note that the source
+includes some assembly language (*.ASM) files. Successful
+generation of the TurboVision library will require use of
+Turbo Assembler to translate these source files into object
+files. DOCS.ZIP can be placed anywhere.
+
+
+DISCLAIMER AND LIMITATION OF LIABILITY:
+---------------------------------------
+DISCLAIMER AND LIMITATION OF LIABILITY: Borland does not make or
+give any representation or warranty with respect to the
+usefulness or the efficiency of this software, it being
+understood that the degree of success with which equipment,
+software, modifications, and other materials can be applied to
+data processing is dependent upon many factors, many of which
+are not under Borland's control. ACCORDINGLY, THIS SOFTWARE IS
+PROVIDED 'AS IS' WITHOUT EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING NO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE, OR NONINFRINGEMENT. THIS SOFTWARE IS
+PROVIDED GRATUITOUSLY AND, ACCORDINGLY, BORLAND SHALL NOT BE
+LIABLE UNDER ANY THEORY FOR ANY DAMAGES SUFFERED BY YOU OR ANY
+USER OF THE SOFTWARE. BORLAND WILL NOT SUPPORT THIS SOFTWARE
+AND IS UNDER NO OBLIGATION TO ISSUE UPDATES TO THIS SOFTWARE.
+
+WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, NEITHER
+BORLAND NOR ITS SUPPLIERS SHALL BE LIABLE FOR (a) INCIDENTAL,
+CONSEQUENTIAL, SPECIAL OR INDIRECT DAMAGES OF ANY SORT, WHETHER
+ARISING IN TORT, CONTRACT OR OTHERWISE, EVEN IF BORLAND HAS BEEN
+INFORMED OF THE POSSIBILITY OF SUCH DAMAGES, OR (b) FOR ANY
+CLAIM BY ANY OTHER PARTY. SOME STATES DO NOT ALLOW THE
+EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES,
+SO THIS LIMITATION AND EXCLUSION MAY NOT APPLY TO YOU. Use,
+duplication or disclosure by the Government is subject to
+restrictions set forth in subparagraphs (a) through (d) of the
+Commercial Computer-Restricted Rights clause at FAR 52.227-19
+when applicable, or in subparagraph (c) (1) (ii) of the Rights
+in Technical Data and Computer Software clause at DFARS
+252.227-7013, and in similar clauses in the NASA AR Supplement.
+Contractor / manufacturer is Borland International, Inc.,
+100 Borland Way, Scotts Valley, CA 95066.
diff --git a/tvision/change.log b/tvision/change.log
new file mode 100644
index 0000000..d26d91b
--- /dev/null
+++ b/tvision/change.log
@@ -0,0 +1,3852 @@
+$Log: change.log,v $
+Revision 2.743 2010/01/27 13:17:40 set
+* Fixed: [DOS] EOF needs stdio.h. Closes SF # 2940568 reported by fytodent.
+.
+Revision 2.742 2010/01/27 12:44:36 set
+* Fixed: [alconscr.cc screen.h] setCharacter second argument (from Unicode
+branch)
+* Fixed: [linuxkey.cc] charCode doesn't exist in the trunk (from Unicode
+branch). Closes SF #2940576 reported by fytodent.
+* Added: [index.html] Some CVS snapshots (old).
+
+Revision 2.741 2009/11/10 18:18:35 set
+* Modified: Krzysztof's e-mail.
+
+Revision 2.740 2009/08/27 14:22:37 set
+* Fixed: [examples/fonts/test.cc] Missing Uses_limits request.
+* Added: [examples/Makefile.nmk ] MSVC makefile for the examples,
+contributed by Jure Erznoznik.
+.
+Revision 2.739 2009/08/27 13:14:18 set
+** Patches contributed by Jure Erznoznik <jure.erznoznik@gmail.com>
+* Fixed: [tfilecol.cc] for 64bit size_t (MSVC)
+* Modified: [examples/dlgdsn/*.cc] to avoid using gcc's case extensions.
+* Added: [compatlayer.h] support for MSVC 2008 boolean datatype.
+* Added: [winnt/Makefile.nmk] support new classes + added defines for 64bit
+compile + added support for MSVC 2008
+
+Revision 2.738 2009/06/26 11:35:31 set
+* Fixed: The last change in TVConfigFile::GetString() introduced a bug
+(last " not removed).
+
+Revision 2.737 2009/06/24 14:31:16 set
+* Fixed: [Linux] the keyboard driver filled charScan.charCode twice and
+didn't fill charCode members of the keyDown event.
+
+Revision 2.736 2009/06/23 18:00:10 set
+* Modified: Version in tv.h.
+
+Revision 2.735 2009/06/23 17:42:28 set
+* Modified: QNX and Debian version to 2.2.0.
+
+Revision 2.734 2009/06/23 17:15:21 set
+* Modified: Version to 2.2.0.
+
+Revision 2.733 2009/06/23 16:48:25 set
+* Added: AlCon driver, this is the conio emulation code on top of Allegro.
+From the alcon branch and contributed by Grzegorz Adam Hankiewicz.
+* Fixed: TVConfigFile::GetString() leaked memory and returned an
+unprocessed string.
+* Fixed: Memory leaks in X11 driver.
+
+Revision 2.732 2009/06/22 15:14:45 set
+* Modified: TParamText::setText to take a constant string as first argument
+(not modified).
+
+Revision 2.731 2009/03/17 13:04:09 set
+* Modified: [WWW] SF Logo according to the new policy.
+* Fixed: [WWW] Some HTML errors.
+
+Revision 2.730 2009/03/17 12:38:35 set
+* Modified: [tlistvie.cc] To avoid ambiguous if/else.
+* Modified: [Debian] Package version to 5 for Lenny.
+* Fixed: [WWW] Link to CVS source code.
+* Modified: [WWW] Script to upload htmls to SF.
+
+Revision 2.729 2009/02/27 11:32:27 set
+* Fixed: [config.pl] sys/io.h detection. The code didn't compile with gcc
+4.3.x.
+* Modified: [tbutton.cc teditor.cc tmenuvie.cc tpxvalid.cc tscrolle.cc
+tstatict.cc tview.cc] To avoid gcc warnings about ambiguous else statements
+.
+Revision 2.728 2009/02/25 16:25:37 set
+* Modified: [newstr.cc tmenuvie.cc] Use of NULL instead of 0.
+* Modified: [tfileinp.cc tfilelis.cc tgkey.cc codepage.h gkey.h menuitem.h
+screen.h tmenuvie.cc] Use of const char * for some functions/values taking
+string constants.
+* Fixed: [tpxvalid.cc] TPXPictureValidator passed a const char * to picture
+* Modified: [linuxkey.cc xtermkey.cc] Useless typedef keyword.
+* Modified: [linuxscr.cc qnx4scr.cc unixscr.cc xtermscr.cc x11src.cc]
+execvp takes a char *const and not const char *, so now we allocate copies.
+* Modified: [x11src.cc] classHint members are declared a char * and not
+const char *.
+* Fixed(?): [listbox.h] TListBoxRec should be packed for 64 bits
+architectures.
+.
+Revision 2.727 2009/01/22 14:58:09 set
+* Modified: TCalculator::keyChar to be constant. SF #2526590 patch
+submitted by Larry Ziegenbein (SF larryzie)
+
+Revision 2.726 2009/01/06 12:39:22 set
+* Added: [doc] Visual Studio 2008 compilation procedure. Contributed by
+Harry Sack <tranzedude/gmail/com>
+
+Revision 2.725 2008/08/27 03:51:33 terrible
+* Corrected bad format for changelog entry, sorry, has been a long time! :-)
+
+Revision 2.724 2008/08/27 03:48:59 terrible
+* Updated: [Debian] Version to 2.1.0-4 (small correction).
+
+Revision 2.723 2008/07/10 19:08:01 set
+* Modified: [Debian] To also support libgm-dev as a builing package.
+
+Revision 2.722 2008/07/10 19:07:31 set
+* Added: Some equivalences to the Unicode table.
+.
+Revision 2.721 2008/07/10 18:55:20 set
+* Modified: Libraries named to create the library (exclude itself).
+.
+Revision 2.720 2008/02/27 20:09:25 set
+* Fixed: [X11] The cursor became invisible if it was over a character with
+background color = foreground color.
+.
+Revision 2.719 2008/02/27 14:20:28 set
+* Modified: [X11] To fully skip request to draw areas with the same
+content. Previous code did some work even if nothing was actually drawn.
+
+Revision 2.718 2008/02/26 14:28:40 set
+* Modified: [SSC] Enabled TTextDevice and most of TTerminal stuff when
+using SSC. Only otstream isn't supported.
+
+Revision 2.717 2008/02/26 14:22:41 set
+* Modified: The rhtv-config tool to report only the installation directory
+for the --include option.
+
+Revision 2.716 2008/02/26 11:54:08 set
+* Fixed: Access violation in TStringCollectionCIntl::freeItem() when
+HAVE_INTL_SUPPORT wasn't defined. Closes SF #1891237, reported by Peter
+Remmers.
+
+Revision 2.715 2007/09/03 13:18:44 set
+* Fixed: incorrect delete in TPalette::operator=. SF #1786428. Submitted
+by Baurzhan Ismagulov - ibr.
+
+Revision 2.714 2007/07/11 12:00:44 set
+* Fixed: [TScreen] The image/pdf viewer mechanism to collect zombie
+children when the user manually closes the application helper.
+
+Revision 2.713 2007/06/19 13:36:51 set
+* Added: A new fpstream constructor. The original constructor enforces the
+binary flag (to avoid problems with binary data) but also adds the ios::out
+flag. This is bad when you open a read-only file. The new constructor
+doesn't add any flag (not even binary). From a problem seen on SETEdit and
+reported by Witek.
+
+Revision 2.712 2007/06/04 13:53:31 set
+* Fixed: [TScreen] The last patch was wrongly applied and some members
+were declared inside TDisplay class. Reported by Witek.
+
+Revision 2.711 2007/05/31 14:27:33 set
+* Added: [TScreen] a mechanism to start external image and pdf viewers.
+Currently implemented only by the X11 driver. An example is included in
+examples/viewers.
+
+Revision 2.710 2007/05/29 13:05:16 set
+* Updated: [Debian] Packaging to version 2.1.0-4.
+
+Revision 2.709 2007/05/29 11:24:37 set
+* Fixed: [config] the way --include option is processed. From a patch sent
+by Witek.
+
+Revision 2.708 2007/05/18 10:54:54 set
+* Fixed: [Config] the ncurses' define_key test. Patch from Witek (Witold
+Filipczyk)
+
+Revision 2.707 2007/05/17 18:07:23 set
+* Modified: The gpm mouse wheel support. Now it works better, tested.
+
+Revision 2.706 2007/05/16 20:19:23 set
+* Modified: The way LDFLAGS and libraries are used to link the final
+library. Now the libraries goes at the end of the line and not mixed with
+RHIDE_LDFLAGS. This is needed to use the --as-needed linker flag. I don't
+see the point using it for this library because we carefully chose which
+libraries are listed, but could help in the future. This patch is based on
+the SF patch #1642841.
+
+Revision 2.705 2007/05/16 18:32:43 set
+* Added: Support for mouse wheel in Linux console. Partially tested, needs
+a patched gpm. Patch from Witold Filipczyk witekfl/poczta/onet/pl.
+
+Revision 2.704 2007/05/16 18:16:12 set
+* Fixed: TFileInfoPane::draw() didn't protect a temporal buffer from
+overruns. Under some situations it could be overflowed.
+
+Revision 2.703 2007/05/09 12:55:57 set
+* Modified: The default time to sleep when no events are available. It was
+10 µs, good for most Linux kernels, but 2.6.21 reduces the granularity and
+really sleeps for a small ammount of time. Now we sleep for 10 ms. From a
+report and test by Ivan Baldo.
+
+Revision 2.702 2007/05/08 19:43:52 terrible
+* Updated: [Debian] Packaging to version 2.1.0-3, small things.
+
+Revision 2.701 2007/04/18 15:45:11 set
+* Fixed: [Makefile] added -f to the rm command to remove the old symblinks
+to avoid messages from rm.
+* Fixed: [tresfile.cc] the THeader structure requested packed attibute for
+the members of a union instead of the union itself. Reported by gcc 4.1.1.
+* Fixed: [tview.cc, view.h] removed unused writeView member and associated
+structures. This code wasn't used and did a wrong cast.
+* Fixed: [linuxscr.cc] removed request for the first element in the setSel
+structure.
+
+Revision 2.700 2007/01/24 16:44:25 set
+* Fixed(?): New Linux kernels seems to omit asm/io.h and we must use
+sys/io.h. SF Patch #1642839 (anonymous).
+
+Revision 2.699 2007/01/16 18:17:14 set
+* Fixed: [Win32] The Win32 and WinNT drivers failed to work when a TV a
+application was executed from the MinGW console. Now the code checks if
+it have a working console before using the Win32 and WinNT drivers.
+The idea and bug report was submitted by domatlantida (JASC). Closes
+S.F. bug report SF #1611485.
+
+Revision 2.698 2007/01/16 17:31:39 set
+* Fixed: TTerminal::prevLines wrongly checked the pos while going back
+reading out of bounds. Patch by dou9st3r (SF user). Closes bug report
+SF #1618614.
+* Fixed: [config] examples/rhide.env definde RHIDE_LDFLAGS in the same eay
+used to dynamically link the library, not really good for executables ;-)
+* Fixed: [config] the test for gcc 4.x was executed before detecting gcc.
+
+Revision 2.697 2006/12/05 15:02:55 set
+* Fixed(?): Compilation issue in the Win32 code. The WinGr driver wrongly
+declared setCharacter. Bug tracker: SF #1607447.
+
+Revision 2.696 2006/11/22 15:11:38 set
+* Modified: The configuration script to use -Wno-packed when gcc 4.x is
+detected (untested). Needed to eliminate a silly warning.
+
+Revision 2.695 2006/11/13 19:33:55 set
+* Modified: ipstream now aborts when trying to load an unknown class.
+* Added: Initialization of the rest of the buffer when hiting the end of
+file.
+
+Revision 2.694 2006/11/06 13:11:33 set
+* Added: A workaround for Ubuntu's glibc, it looks like an explicit
+inclusion of libintl.h is needed. The code is experimental and could break
+other gcc 4.x Linux distros. Reported by Donald R. Ziesig
+<Donald/Ziesig/org>.
+
+Revision 2.693 2006/08/18 14:42:42 set
+* Fixed: When adding a variable to a TVConfigFile and this variable already
+existed it could break the tree.
+
+Revision 2.692 2006/06/07 19:08:37 set
+* Fixed: printf in SSC streams code when open returned error.
+
+Revision 2.691 2006/04/18 12:20:49 set
+* Modified: The old workaround for bintextdomain prototype missmatch (dated
+december 2002) now gives troubles for gcc 4.0.3. I'm removing it to find if
+it is needed for modern gcc versions. I tried 3.3.5 without problems.
+
+Revision 2.690 2006/04/17 13:12:15 set
+* Modified: [MSVC] Disabled warning 4996 for v8.0+. It deprecates the POSIX
+names and suggests to use _name.
+
+Revision 2.689 2006/04/12 16:21:16 set
+* Fixed: [MSVC] Some warnings from MSVC 8. From info by Eddie.
+
+Revision 2.688 2006/04/11 13:24:06 set
+* Fixed: TFileCollection::writeItem writes a time_t to disk. This isn't
+safe at all. MSVC reports it as an error. As a workaround I casted it to
+an unsigned long. It will work for most platforms and won't make old files
+invalid.
+* Fixed: [MSVC] Debug options used some old flags.
+* Modified: [MSVC] stricmp and strnicmp to be _*. From a report by Eddie.
+
+Revision 2.687 2006/04/05 15:39:57 set
+* Added: [MSVC] Information about MSVC 8.0 to the compatlayer header.
+
+Revision 2.686 2006/03/21 18:56:01 set
+* Modified: [MSVC] The /GX command line option is deprecated. Using /EHsc
+instead.
+* Modified: [MSVC] v8.0 doesn't like strcpy, strncpy, sprintf, etc. Added
+option to disabling those warnings.
+* Modified: [MSVC] v8.0 seems to be unable to handle open(const char *,
+int):
+./fileview.cc(145) : error C2668: '_open' : ambiguous call to overloaded function
+ E:\MVS8\VC\INCLUDE\io.h(328): could be 'int _open(const char *,int,...)'
+ E:\MVS8\VC\INCLUDE\io.h(254): or 'int _open(const char *,int,int)'
+ while trying to match the argument list '(const char *, int)'
+
+Revision 2.685 2006/03/17 14:40:36 set
+* Fixed: [Linux] The patch to avoid gcc 4.0.3 problems generated problems
+in tvintl.cc. Now I moved the workaround from compatlayer to this source.
+This should avoid both problems.
+
+Revision 2.684 2006/03/17 13:58:55 set
+* Fixed: [Linux] Current versions of glibc (i.e. 2.3.2) doesn't provide
+the real argv/environ vector, just a copy. The methode to set the title
+corrupted the environment.
+
+Revision 2.683 2006/03/15 17:14:39 set
+* Fixed: Indentation and data type in tvedit1.cc patch from domatlantida.
+
+Revision 2.682 2006/03/15 16:46:03 set
+* Fixed: Some potential leaks in the X11 driver. Lamentably valgrind
+reports tons of them from inside X11.
+* Added: TInputLine::setHide(Boolean val) shortcut.
+
+Revision 2.681 2006/03/14 17:50:42 set
+* Fixed: Problems using current Perl interpreter shipped with MSys (MinGW).
+Based on a patch by JASC.
+
+Revision 2.680 2006/02/10 18:12:30 set
+* Added: Workaround for a gdb bug, seen on Debian Sarge.
+
+Revision 2.679 2006/02/03 15:57:50 set
+* Fixed: Last patch to WinGr prevented compilation using gcc (/* inside a
+comment).
+
+Revision 2.678 2006/01/25 22:33:06 terrible
+* Updated: [Debian] Packaging to version 2.1.0-2, cosmetic changes.
+
+Revision 2.677 2006/01/24 17:38:08 set
+* Fixed: BTV 1.x calls to setValidator in examples. Patch by Frank Taffelt
+frank.taffelt/web/de.
+
+Revision 2.676 2006/01/18 14:00:26 set
+* Added: A methode to make input lines hide their content.
+.
+Revision 2.675 2005/12/27 14:18:30 set
+* Modified: Restored the code to honor the ilValidatorBlocks flag in
+TInputLineBase::setState. I don't know why I removed it when I added BTV
+2.0 stuff.
+
+Revision 2.674 2005/12/05 20:24:10 set
+* Added: Now the list box in the file dialog uses left and right arrows to
+navigate directories. Suggested by Sergio Núñez snunez/esquemas/com.
+
+Revision 2.673 2005/11/10 19:46:26 set
+* Fixed: TParamText::~TParamText new/delete[] missmatch. SF patch #1353152
+(David cz, using valgrind).
+.
+Revision 2.672 2005/11/10 19:39:58 set
+* Modified: TInputLine::setData to support a constant as argument. Closes
+SF patch #1353157 by fytodent (David cz).
+
+Revision 2.671 2005/09/23 15:26:07 set
+* Fixed: [OpenWatcom] Some details related to the import lib generation.
+Patch from Lothar. Note: wmake is the worst make tool we support.
+
+Revision 2.670 2005/09/21 15:06:15 set
+* Modified: [OpenWatcom] compilation flags. Patch by Lothar.
+* Added: [OpenWatcom] Import lib creation.
+* Fixed: extrimk was created using the C compiler instead of the C++ one.
+
+Revision 2.669 2005/09/20 14:48:37 set
+* Added: [OpenWatcom] Which version was used.
+* Modified: [OpenWatcom] Removed test from makefile.
+
+Revision 2.668 2005/09/19 14:06:58 set
+* Fixed: [OpenWatcom] compilation rules. Patch by Lothar.
+* Added: [OpenWatcom] instructions on how to compile.
+* Modified: [MSVC] the compilation instructions. After Arnold's success
+using the free MSVC tools I think MSVC can use the unified make system as
+default.
+
+Revision 2.667 2005/09/16 19:37:02 set
+* Added: [OpenWatcom] More to the makefiles, not yet usable. From info by
+Lothar.
+
+Revision 2.666 2005/09/16 18:56:31 set
+* Fixed: [MSVC] the "all" target isn't special for nmake. After arranging
+things so the variable gets defined by the time all is used I introduced
+a side effect: all isn't the first anymore. So we must explicitly ask for
+"all" target. From information sent by Arnold.
+
+Revision 2.665 2005/09/07 18:16:27 set
+* Fixed: [MSVC] nmake doesn't analyze the whole makefile before expanding
+variables, in order to create mlink.exe we need to first define
+HELPER_TARGET. From info by Arnold.
+
+Revision 2.664 2005/09/06 20:14:30 set
+* Added: First step toward integrating Open Watcom to the unified make
+system. From info by Lothar.
+
+Revision 2.663 2005/09/06 18:17:47 set
+* Fixed: Unknown keys triggered status line shortcuts assigned to kbNoKey.
+Closes SF Bug #1278751, submited by David (fytodent).
+
+Revision 2.662 2005/08/24 13:00:22 set
+* Added: [WWW] Links to a CVS snapshot (tarball and Sarge).
+
+Revision 2.661 2005/08/22 20:04:37 set
+* Modified: [OpenWatcom] Disabled warning 555. Code by Lothar.
+* Added: [Win32 DLL/OpenWatcom] Exported TObject, THWMouse and TMouse.
+Patch by Lothar.
+
+Revision 2.660 2005/08/22 15:27:16 set
+* Added: [Compilation] intl clean to the clean target. As suggested by
+Ivan.
+* Modified: [Debian] Command line for dch, needed for Sarge.
+
+Revision 2.659 2005/08/19 05:27:14 terrible
+* Updated: [Debian] Packaging to version 2.1.0-1.
+
+Revision 2.658 2005/08/09 11:52:20 set
+* Fixed: [SSC] SIGSEGV when closing a stream that failed to open.
+* Fixed(?): [MSVC] Include path to find cl/dir.h and winnt/include/tv/con*
+
+Revision 2.657 2005/08/09 11:45:36 set
+* Fixed: Disabled gettext v0.14.4 "feature" that returns the
+"Program-Id-..." text when you pass "" to gettext. Previous versions didn't
+have this "feature".
+
+Revision 2.656 2005/08/05 17:10:01 set
+* Fixed(?): [MSVC] mlink.exe compilation. The /OUT: option must be passed
+to the linker with /link. From a report by Arnold. Untested.
+* Fixed(?): [MSVC] The unified make process didn't include dir.h. From a
+report by Arnold. Untested.
+
+Revision 2.655 2005/08/05 13:53:20 set
+* Added: Polish translation. Contributed by Eddie.
+
+Revision 2.654 2005/08/04 20:18:07 set
+* Fixed: The TCalendar class in the demo program tested for wrong mouse
+coordinates to change the month. Patch by Eddie.
+
+Revision 2.653 2005/08/04 20:04:47 set
+* Modified: [OpenWatcom] the compiler generates a warning when we use
+"delete[] (const char *)var" so now I cast all of them to (char *).
+Reported by Lothar.
+
+Revision 2.652 2005/08/04 19:29:06 set
+* Added: Some missing export directives for the DLL. Patch by Lothar.
+* Fixed: Missing TLookup* members. Patch by Lothar.
+* Updated: Spanish translation.
+
+Revision 2.651 2005/08/04 18:59:08 set
+* Updated: Spanish translation.
+
+Revision 2.650 2005/08/03 18:27:19 set
+* Fixed: Another "class TEvent" reference. Reported by Eddie.
+
+Revision 2.649 2005/08/03 13:27:40 set
+* Added: [MSVC] More information about installation.
+* Added: [MSVC] Diabled warning 4312. From a report by Eddie.
+
+Revision 2.648 2005/08/02 18:54:01 set
+* Added: TLookupValidator and TStringLookupValidator from Borland's TV 2.0.
+
+Revision 2.647 2005/08/02 15:39:09 set
+* Added: The Borland's TV 2.0 TInputLine functionality:
+ * TValidator * as last constructor argument.
+ * TValidator try/unroll code.
+ * TValidator "transfer" stuff to meassure the size.
+ * TValidators using the full input instead of the last char.
+ * Shift+Arrows to select the text (I don't like the way that's
+ implemented)
+* Added: TValidator * argument to inputBox helper.
+* Modified: Moved the hotKey function to misc, this function isn't used by
+TInputLine.
+* Added: A TPXPictureValidator example to the demo.
+* Modified: Version to 2.1.0 because the TInputLine and TValidator changes
+are an important API change.
+
+Revision 2.646 2005/08/02 14:49:24 set
+* Fixed: [MSVC] Wrong pragma usage. Pointed out by Eddie.
+
+Revision 2.645 2005/08/02 14:07:29 set
+* Modified: [MSVC] Disabled warning 4291 in histlist.cc. The compiler is
+wrong.
+* Modified: [MSVC] Added support for 64 bits pointers in uipointer and
+clarified the warning 4311 issue (also disabled). Both from info sent by
+Eddie.
+
+Revision 2.644 2005/08/01 18:16:07 set
+* Modified: [MSVC] Disabled the MSVC "pointer truncation" warning. I can't
+see any truncation because I think both are 32 bits unsigned values. I'll
+disable it until somebody can explain it. Eddie provided the pragma.
+
+Revision 2.643 2005/08/01 17:02:53 set
+* Fixed: A couple of errors in the last modifications to TFrame. The move
+and grow should work only for mouse down. If not they get activated when
+we only get the up (i.e. when changing focus).
+
+Revision 2.642 2005/08/01 16:52:00 set
+* Fixed: [MSVC] v7.1 defines read/write and in an incompatible way to our
+replacements for old versions. Reported by Eddie.
+
+Revision 2.641 2005/08/01 16:32:22 set
+* Added: More export directives. Patch from Lothar.
+
+Revision 2.640 2005/08/01 16:11:48 set
+* Modified: All casts from void * to an integer to use uipointer. The
+problem with MSVC remains, but once we solve what to use as uipointer all
+the warnings will go away at once. Reported by Eddie.
+* Fixed: [MSVC] Some forward declarations for TEvent used class when
+that's an struct. Reported by Eddie.
+* Modified: [MSVC] The FA_* definitions in compatlayer and other places to
+be coherent. I'm not sure about them but now they are coherent to what
+findfirst returns. Reported by Eddie.
+
+Revision 2.639 2005/08/01 14:55:24 set
+* Added: A small macro to help creating input lines with validators. That's
+related to S.F. FR #1248650 posted by Eddie.
+
+Revision 2.638 2005/08/01 14:20:24 set
+* Fixed: Wrong names in TPXPictureValidator members (IsValid vs isValid,
+etc.) Reported by Eddie.
+
+Revision 2.637 2005/07/29 13:35:00 set
+* Fixed: [MSVC] The __DELTA macro used for TStreamableClass casts a pointer
+to an integer type. The code used long which isn't a good choice for that.
+Reported by Eddie.
+
+Revision 2.636 2005/07/29 13:34:48 set
+* Added: [gcc] Workaround for a gcc 2.95.2 bug. It looks like inline class
+members that have an extra ; at the end of the function body can confuse
+gcc (only in particular cases). Reported by Thiago.
+
+Revision 2.635 2005/07/29 13:34:37 set
+* Added: A helper function to TView called putEvent. It fills a TEvent
+structure and calls putEvent (the original one). That's a common operation.
+
+Revision 2.634 2005/07/29 13:34:26 set
+* Added: [Cosmetic] Icon animations for the close and zoom icons of TFrame.
+Based on code sent by Eddie. It can be disabled.
+
+Revision 2.633 2005/07/29 13:34:09 set
+* Fixed: [MSVC] Ambiguous call to stdio's read. In modern C++ that's an
+overloaded function. So now TFileViewer::real_bufsize is of ssize_t type. I
+also changed some code to handle size_t return values. Reported by Eddie.
+
+Revision 2.632 2005/07/27 20:44:50 set
+* Modified: [DJGPP?] Added workaround for problems compiling without i18n
+support using gcc 2.95.2 19991024 (release). Reported by Thiago.
+
+Revision 2.631 2005/07/25 14:09:20 set
+* Fixed: [Win32] Typo in the names of the two new prototypes for
+TWin32Screen.
+
+Revision 2.630 2005/07/22 20:53:04 set
+* Modified: The TValidator API to be compatible with Borland's TV 2.0 API.
+This will break some old programs but allow compilation of newer ones.
+
+Revision 2.629 2005/07/22 18:16:25 set
+* Added: TPXPictureValidator, not tested. Closes SF FR #1235527.
+
+Revision 2.628 2005/07/22 12:53:13 set
+* Added: [WWW] CVS snapshot for Sarge (SPARC).
+
+Revision 2.627 2005/07/19 14:56:57 set
+* Fixed: [GCC] Some gcc versions only have "strstream" (not .h). Reported
+by Vik while using Fedora Core 4.
+
+Revision 2.626 2005/07/19 14:55:48 set
+* Fixed: [SSC] offset not updated after a block read.
+
+Revision 2.625 2005/07/14 18:16:28 set
+* Added: [SSC] very basic support for strstreambuf class. Needed by RHIDE.
+
+Revision 2.624 2005/07/12 13:18:24 set
+* Fixed: [Win32] The Win32 driver crashed after a window resize. Reported
+by Eddie (one_eddie/tenbit/pl).
+
+Revision 2.623 2005/07/08 20:26:49 set
+* Added: [gcc] Code to solve problems related to gcc 3.4.x and 4.0.0. The
+solution was provided by Andris, but IMHO that's a workaround for gcc bugs
+instead of a solution.
+
+Revision 2.622 2005/07/08 16:50:37 set
+* Modified: [Win32+Watcom] Changes to export classes, needed to create a
+DLL. That's a first wave of patches from Lothar, more will come ;-)
+
+Revision 2.621 2005/07/08 16:43:23 set
+* Modified: [Windows XP] Workaround for the cursor shape. Disabled by
+default because I never got confirmation. From Andris.
+* Modified: [Linux] Enclosed Linux headers with extern "C", seems to be
+needed by 2.6.11 headers (new used as a variable *8-P). From a bug report
+in Gentoo.
+.
+Revision 2.620 2005/06/29 14:13:41 set
+* Fixed: [Watcom] DIR and dirent are defined in direct.h
+.
+Revision 2.619 2005/06/21 20:33:08 set
+* Modified: Third wave of patches to add support for Open Watcom. Patches
+from Lothar. We are almost there ;-)
+.
+Revision 2.618 2005/06/17 19:54:17 set
+* Added: [Config] Options to use the C++ compiler indicated by the CXX
+environment variable.
+.
+Revision 2.617 2005/06/01 15:40:11 set
+* Added: A second wave of patches to add support for Open Watcom. All based
+on information and examples from Lothar.
+.
+Revision 2.616 2005/05/19 21:01:11 set
+* Note: Watcom effort is being done by: Lothar Behrens (lothar/behrens/
+lollisoft/de)
+* Added: [Watcom] uint64 and int64 definitions.
+* Modified: [Watcom] changed stream members from pub* to *.
+
+Revision 2.615 2005/05/18 15:43:06 set
+* Added: First step towards Open Watcom support. It just detects Watcom
+compiler and defines it almost like BC++.
+
+Revision 2.614 2005/05/18 13:45:14 set
+* Fixed: Extra ) in TInput1Line declaration. Reported by Frank Taffelt
+(frank taffelt web de).
+* Fixed: [config] Warning issued by gcc 4.0.0 in DetectPointersSize, it
+makes the configuration fail when using -Werror. Reported by Andris.
+
+Revision 2.613 2005/05/12 18:42:08 set
+* Added: gcc 4.x detection in compatlayer to use the same tricks used for
+gcc 3.4.x. Patch from Andris.
+* Fixed: Some classes with virtual members didn't have a virtual
+destructor. Reported by gcc 4.0.0. Patch from Andris.
+
+Revision 2.612 2005/04/25 13:29:21 set
+* Updated: Version in readme.txt and QNX package.
+* Added: [MSVC] Compatibility with Visual Studio .NET 2005 Express Beta
+Edition from Christian Kirches <christian/kirches/gmx/de>.
+ * Added: -D_USE_32BIT_TIME_T to flags to keep time_t as 32 bits.
+ * Added: #undef _CRT_INSECURE_OPEN before including io.h to avoid
+ warnings about _open.
+ * Added: #undef YieldProcessor to avoid collisions with a macro defined
+ in windows.h.
+
+Revision 2.611 2005/04/21 14:27:32 set
+* Added: [configuration] A check for RHIDE tools when the user enables the
+maintainer mode.
+
+Revision 2.610 2005/02/28 13:31:07 set
+* Fixed: [Linux] Removed term.h inclusion from linuxdis.cc, that's ncurses
+stuff not needed by the current implementation of the Linux driver.
+Reported by Thiago.
+
+Revision 2.609 2005/01/17 15:05:49 set
+* Fixed: Compilation problems when using MSS and gcc 3.4.1. Patch by
+Michael Vzoroff.
+
+Revision 2.608 2005/01/11 18:49:54 set
+* Fixed: [MinGW] The snprintf implementation is broken. That's obvious
+because MinGW uses M$ runtime. Now MinGW target uses the replacement.
+
+Revision 2.607 2004/12/23 21:21:59 terrible
+* [Updated] Debian packaging to version 2.0.4-1, it seems Salvador didn't
+ run the version update script, so I made changes to Debian packaging
+ manually; maybe this fixes problems Sergio was having building the package
+ but I didn't try to compile it so I cross my fingers... :).
+
+Revision 2.606 2004/12/15 20:33:08 set
+* Fixed: Missing changes to cluster.h header in last patch.
+
+Revision 2.605 2004/12/13 15:49:34 set
+* Fixed: [WWW] URL to Sigala's doc. Patch by Thiago.
+* Fixed: [config] install was searched in the path without using the "Exe
+Extension". I realized it when Thiago reported other problem about install
+detection.
+
+Revision 2.604 2004/12/10 19:39:58 set
+* Fixed: When configuring with --no-intl the TCluster class generated a
+SIGSEGV in the destructor. Reported by Julian B. Lethbridge. [Also applied
+missing patch from Unicode branch].
+
+Revision 2.603 2004/12/07 14:48:58 set
+* Added: [config] --debug option to select debug switches.
+
+Revision 2.602 2004/12/06 18:16:40 set
+* Fixed(?): XFree86 reports Ctrl+2 without any symbol (only ASCII).
+Reported by Sergio Núñez (snunez/esquemas/com).
+* Added: Detection of 64 bits pointers and macros to cast pointers into
+64 bits values. GCC 3.4.x doesn't allow to cast a pointer into an unsigned
+long long if the pointer is 32 bits wide.
+* Updated: Web page to reflect the release.
+* Modified: Version to 2.0.4
+
+--------- CVS tag r_2_0_3DOS and r_2_0_3nuDOS
+
+Revision 2.601 2004/11/29 16:23:15 set
+* Fixed: [DJGPP][Maintainer dependencies] The path to system headers to be
+excluded from dependencies must include the gcc 3.x dir.
+* Fixed: [DJGPP][RHIDE compilation] RHIDE_LDFLAGS' UNIX settings interfere
+with RHIDE on DOS.
+* Added: [DJGPP] Warning in the docs about conio gettext and intl gettext
+collision. This isn't fixed in current djgpp version even when this issue
+is know for years.
+* Fixed: [Compilation][Examples][gcc 3.x] Missing string.h in thelp.cc
+* Fixed: [Compilation][Examples][gcc 3.x] CLY_OpenModeT to ushort in tvhc.h
+* Fixed: [DOS] Missing useFixKbdBuffer in key.h.
+* Fixed: [DJGPP][Maintainer dependencies] Dependencies for examples when
+they are abolute (even after using gprexp).
+* Updated: [Win32] makefiles.
+
+--------- CVS tag r_2_0_3 and r_2_0_3nu
+
+Revision 2.600 2004/11/23 00:31:47 terrible
+* Updated: Debian packaging to version 2.0.3-3 (no changes really).
+
+Revision 2.599 2004/11/02 20:06:39 set
+* Added: [Compilation][MSVC] Option to compile with debug information.
+>From information sent by Grzegorz.
+* Fixed: [Compilation][Darwin] libtvfintl.a must be listed "as-is", not
+using -l.
+* Modified: [Configuration] ar and install detection. Now more robust.
+
+Revision 2.598 2004/10/29 16:12:37 set
+* Fixed: [DOS] The default encoding wasn't CP437. From a report by
+jessehardy/126/com, a chinese user of RHIDE using code page 936.
+
+Revision 2.597 2004/10/29 15:21:30 set
+* Fixed: [Compilation][MSVC] Typo in mlink.cc and wrong reference to
+../compat/obj in common.nmk. Both patches from Grzegorz. With this the
+unified mechanism works.
+
+Revision 2.596 2004/10/28 20:44:25 set
+* Added: [DOCs][MSVC] MSVC 7.1 as supported compiler. Mike verified it and
+this version is different than 7.0, enough to mention it.
+
+Revision 2.595 2004/10/20 13:42:56 set
+* Modified: [Compilation][MSVC] HistRec to overload delete making explicit
+this operation is invalid. I hope it avoids warnings. Reported by Grzegorz.
+* Added: [Compilation][MSVC] A lib wrapper to avoid command line
+limitations. Is untested.
+
+Revision 2.594 2004/10/19 18:16:52 set
+* Modified: [Compilation] Removed time stamp from ?mk files.
+
+Revision 2.593 2004/10/19 18:06:20 set
+* Fixed: [Compilation] Missing ../compat path in extrimk.cc tool. Reported
+by Grzegorz.
+
+Revision 2.592 2004/10/19 15:11:04 set
+* Fixed: [Linux] The console driver failed to detect the code page used by
+the screen font (SFM). I think this was introduced by the 2003/05/21 patch.
+
+Revision 2.591 2004/10/18 15:00:53 set
+* Modified: [Compilation] The dependencies now include a relative path so
+makefiles doesn't need to define a "vpath". That's because nmake doesn't
+have any equivalent.
+
+Revision 2.590 2004/10/15 23:41:53 set
+* Fixed: [Win32][gcc 3.x] gcc 3.3.3 warning in WinGr code (using char as
+array index).
+
+Revision 2.589 2004/10/15 23:38:24 set
+* Fixed: [Win32] The Win32 driver: when the application or configuration
+file requested a screen size bigger than 80x25 the code failed to register
+the new window size and hence allocated too few bytes for the screenBuffer
+generating a SIGSEGV.
+* Fixed: [MinGW] New versions (i.e. 3.1.0) defines ssize_t.
+* Fixed: [MinGW/BC++/MSVC] The regex code had a mess with the prototypes of
+some internal functions. Reported by gcc 3.x.
+* Added: [DOCs] More information about MinGW, now the code compiles with
+version 3.1.0 using MSYS 1.0.10 and SiePerl 5.6.1. Note that the gdb
+included with it is useless for the system I used (Win98SE) but the 6.0
+version is usable (with a lot of limitations :-(
+
+Revision 2.588 2004/10/14 19:31:55 set
+* Modified: [Compilation] The dependencies extractor to put the OBJFILES
+definition before its use. It should help nmake.
+* Modified: [Compilation][nmake] To avoid generating blink.exe.
+
+Revision 2.587 2004/10/13 15:53:46 set
+* Added: [MSVC] First attempt to add MSVC to the "unified" compilation
+mechanism.
+
+Revision 2.586 2004/10/12 20:28:31 set
+* Added: [Install] Support for Solaris' native install tool. That's a
+really bad implementation installer.
+
+Revision 2.585 2004/10/08 21:13:58 set
+* Fixed: [Config][Solaris] dynamic lib creation when using native ld.
+* Fixed: [Config][Solaris and Darwin] the native snprintf function
+violates POSIX, now replaced by internal one.
+
+Revision 2.584 2004/10/08 15:04:54 set
+* Added: Tru64 (OSF1) support. Thanks to HP Test Drive. The system I used
+is an HP Tru64 Unix 5.1b running on a DS20E 2@667 MHz (ev67) [2 Alpha CPUs]
+It have a very buggy port of GNU tools, but is usable.
+* Fixed: [Compilation] Some C libraries (not GNU) declares "struct timeval"
+with a "forward" declaration and you must pull sys/time.h. I saw it before
+but forgot to apply the patch.
+* Added: [DOCs] More information about the UNIX systems where I succesfuly
+compiled.
+
+Revision 2.583 2004/10/05 22:33:23 terrible
+* [Debian] Updated to 2.0.3-2 (minor changes mostly cosmetic).
+
+Revision 2.582 2004/10/05 21:43:21 set
+* Fixed(?!): [gcc 3.4.1] For some, unknown, reason the mechanism to "pull"
+stream dependencies fails for Mandrake 10.0 (gcc 3.4.1 + glibc 2.3.3 +
+binutils 2.14.90.0.7 20031029). So now I'm changing to the mechanism we
+used for BC++ when 3.4.1 is detected.
+
+Revision 2.581 2004/10/05 00:19:29 set
+* Added/Fixed: [DOS] The default keyboard code assumed the start and end of
+the BIOS circular buffer. Now it reads these values from the BIOS data
+area. Egon Eckert contributed a patch for it. But I applied it with major
+changes. The most important is that it can be reverted from the config
+files. I'm doing it to include this patch in the 2.0.3 release.
+
+Revision 2.580 2004/10/04 21:33:34 set
+* Fixed: [Comnpilation][SuSE] SuSE 9.0 defines TEMP_FAILURE_RETRY using
+errno, but errno.h isn't automatically included. So I added a workaround
+for this bug.
+
+Revision 2.579 2004/10/02 21:00:02 set
+* Fixed: [Darwin] The file libfintl.a must be generated before the dynamic
+lib. My previous try worked because I already installed it during the test.
+* Fixed: [FreeBSD] Even when miniEleph said me that I had to install
+librhtv.so and librhtv.so.2 the fact is that if I use sonames like in the
+other UNIX systems I have to also install librhtv.so.2.0.3. I understand
+that's unusual for FreeBSD and also that my versions are wrong but that's
+the only way to get a usable setup.
+
+Revision 2.578 2004/10/01 21:35:27 set
+* Added: Support for NetBSD:
+ * install moves files by default so we need to add -c.
+ * extra libs must be searched in /usr/pkg/lib.
+ * getopt_long is supported.
+* Added: Support for OpenBSD:
+ * getopt_long is supported.
+* Added: Support for Darwin:
+ * options to compile sources for dynamic libraries is -fno-common (no
+ -fPIC).
+ * options to link a dynamic lib are 100% different.
+ * static libs must be included during dynamic lib generation.
+ * dynamic libs names are different (lib.version.dylib).
+ * ranlib must be run *after* installing a static lib.
+ * strip --strip-debug => -S.
+ * ldconfig doesn't exist.
+
+Revision 2.577 2004/09/30 20:56:16 set
+* Fixed: [XTerm] The "get window title" escape sequence was reported to be
+exploitable. For this reason new versions of xterm and Eterm doesn't
+respond to this request. It made the library wait for the reply. So the
+programs didn't continue until the user pressed a key. Now I added a 300 ms
+timeout.
+
+Revision 2.576 2004/09/30 20:55:36 set
+* Added: [Config] OpenBSD as known OS. Tested with OpenBSD 3.4.
+* Fixed: [XTerm] input problems with *BSD systems. They interpret VMIN in a
+very particular way and if that's 0 the input blocks forever. Now the input
+code works for Darwin 6.8 (MacOS X 10.2), FreeBSD 4.8, NetBSD 1.6.1 and
+NetBSD 1.6.1. Some output problems remains when big chunks of the screen
+are updated.
+
+Revision 2.575 2004/09/30 17:22:48 set
+* Updated: [WWW] adding the RC1
+--------- CVS tag r_2_0_3rc1 and r_2_0_3rc1_nu
+
+Revision 2.574 2004/09/29 02:32:39 terrible
+* [Debian] Packaging up to speed with new version 2.0.3-1!!! I have
+succesfuly built packages for an old Sid and of course Woody, though I am not
+uploading them to the repository since I want to test 'em with SETEdit. I
+will try to do them tomorrow if I can escape from paid work ;-).
+
+Revision 2.573 2004/09/22 21:26:40 set
+* Fixed: [RPM] problems when the compress script didn't have execute
+attributes.
+
+Revision 2.572 2004/09/22 19:37:40 set
+* Added: [MSVC] Now UNCs are also supported (previously only BC++ code had
+it). Arnold helped to enable it using MSVC 6.0.
+.
+Revision 2.571 2004/09/21 20:55:12 set
+* Fixed: [Compilation] Problems with the examples when using
+MAINTAINER_MODE.
+.
+Revision 2.570 2004/09/20 14:47:45 set
+* Fixed: [gcc 3.x] Warning in compat/snprintf.c. Reported by Nicola Asuni.
+
+Revision 2.569 2004/09/20 14:18:34 set
+* Added: [Config] A command line option to specify a path for includes.
+This path is used for the configuration tests and for the library.
+* Added: [Config] The path for X11 headers to the path to compile the
+library. This is needed for various UNIX systems so I think the best is to
+always include it. We knew it for QNX4 but I found Darwin also needs it.
+Linux and Solaris doesn't.
+
+Revision 2.568 2004/09/17 19:13:47 set
+* Fixed: [NetBSD] libintl isn't part of libc.
+
+Revision 2.567 2004/09/17 19:02:36 set
+* Fixed: [MSVC] Missing return value in tdirlist.cc:
+ListDirectory( char *path, char *end ). Introduced by last TDirListBox
+patches in the MSVC specific section.
+
+Revision 2.566 2004/09/17 14:50:02 set
+* Fixed: [DOS][gcc] gcc 3.4.1 warnings in vgastate.c code. Reported by
+Nicola Asuni.
+
+Revision 2.565 2004/09/17 14:49:19 set
+* Fixed: [Examples] [dlgdsn] The getFileName function returned a pointer to
+a local buffer. Now it returns a newly allocated string. Reported by Nicola
+Asuni.
+
+Revision 2.564 2004/09/16 21:04:05 set
+* Added: [Config] AMD64 and NetBSD detection. Code seems to compile for
+both. It doesn't mean they are supported.
+
+Revision 2.563 2004/08/30 13:13:44 set
+* Fixed: [MSVC] MSVC 6.0 also failed to compile the WinGr driver, so we are
+just disabling it for MSVC.
+
+Revision 2.562 2004/08/26 20:23:53 set
+* Modified: [MSVC] At least MSVC 6.0 (version 12.00) have a erong
+implementation of vsnprintf. As I already had too much problems with this
+issue I switching to the compatlayer replacements. Reported by Arnold.
+
+Revision 2.561 2004/08/24 15:19:17 set
+* Added: Horizontal scroll bar to the TDirListBox.
+* Added: Visible cursor to the TDirListBox, it shows the state of the
+incremental search. It should also help for Braille terminals.
+
+Revision 2.560 2004/08/24 13:31:27 set
+* Fixed: Call to drawView() before updating the topItem member in
+TListViewer::focusItem. Patch by Egon Eckert (egon/heaven/industries/cz).
+
+Revision 2.559 2004/08/23 20:43:53 set
+* Added: Sorted directories for the non POSIX platforms in TDirListBox.
+* Modified: The TDirListBox code to be easier to maintain. I hope the
+changes doesn't break all platforms ;-)
+* Added: Incremental search in the TDirListBox.
+
+Revision 2.558 2004/08/18 20:23:16 set
+* Modified: TDirListBox to show the directories alphabetically sorted.
+
+Revision 2.557 2004/08/17 14:44:10 set
+* Fixed: [gcc] Errors in the examples when using 3.4.1. Patch by Andris.
+
+Revision 2.556 2004/08/12 19:02:09 set
+* Added: Compatibility with gcc 3.4 streams. It isn't fully compatible with
+3.1-3.3 but defines a special filebuf that can be created from a C stream.
+Andris suggested it.
+* Fixed: gcc 3.4 seems to enforce a much more strict selection of
+overloaded operators when a minimal ambiguity appears. To solve it the
+operands must be casted. In this case stream offsets can't be added to long
+values, casting the long value to a stream offset solves the problem.
+
+Revision 2.555 2004/07/29 20:39:29 set
+* Added: When you disable a TLabel the linked object gets disabled. After
+all what other thing could be expected?
+* Added: Disabled TLabels are painted in a different way. Currently using
+the "disabled button" color because we don't have much space in the pal.
+* Added: TRadioButtons have a new member setEnableMask, with it you can
+control the enabled/disabled state of upto 32 TViews without needing to
+inherit a new class.
+
+Revision 2.554 2004/07/03 00:10:39 set
+* Fixed: [X11] Some gcc versions can optimize "while (!safeToUnHook);" to
+an endless loop. Patch by Andris.
+
+Revision 2.553 2004/06/28 18:18:18 set
+* Fixed: [BC++] lack of QNX4 rule in "old mechanism" makefile.
+
+Revision 2.552 2004/06/28 17:51:19 set
+* Fixed: [BC++] warnings in regex.c because of implicit const char * to
+unsigned char * conversion (double error).
+
+Revision 2.551 2004/06/25 19:30:54 set
+* Added: [MSVC] a simple bool/true/false replacement to compatlayer.
+
+Revision 2.550 2004/06/25 14:17:32 set
+* Fixed: [MSVC] the WinGr driver can't be compiled with 4.0 because it uses
+too much features only available in newer versions.
+* Fixed: [MSVC] the lack of snprintf request in cl/needs.h.
+* Both from Arnold Wiegert reports.
+
+Revision 2.549 2004/06/24 20:47:46 set
+* Fixed: [MSVC] Cast to (char *) for alloca return value in ntdirent.c.
+* Fixed: K&R 1 prototypes in regex.c.
+* Fixed: [MSVC] Lack of ioctl in 4.0
+* Fixed: Forced stddef.h because of size_t use everywhere.
+* All the above from Arnold Wiegert, also previous patch.
+
+Revision 2.548 2004/06/23 20:11:04 set
+* Added: [MSVC] Version 4.0 seems to report version 1000 and lacks
+snprintf. I also needs new.h instead of new.
+
+Revision 2.547 2004/06/23 19:40:51 set
+* Modified: [MSVC] Use of /Tp<file> instead of /TP in makefiles. It looks
+like MSVC 4.0 only supports it. Reported by by Arnold Wiegert.
+
+Revision 2.546 2004/06/14 14:43:39 set
+- From valgrind:
+* Fixed: TVIntl::emptySt() new/delete[] missmatch
+* Fixed: TFileDialog::valid new[]/delete missmatch
+* Added: TVOSClipboard clean-up at exit.
+
+Revision 2.545 2004/06/14 14:42:42 set
+* Fixed: [X11] A race condition in the update thread code. It was possible
+that a SIGALRM arrived after destroying the TScreen class and before we
+exited killing the program with the signal. Observed using valdrind (which
+made the exit really slow ;-)
+
+Revision 2.544 2004/06/11 21:27:05 set
+- From valgrind:
+* Fixed: Leaks in TVFontCollection::CreateListOfFonts and
+TVConfigFile::FreeList.
+* Added: Clean-up to TVCodePage.
+
+Revision 2.543 2004/06/03 18:47:07 set
+* Added: [config] HP-UX detection. Contributed by Dmitry V. Zavyalov
+(dzavyalov/artezio/ru).
+
+Revision 2.542 2004/05/31 14:52:59 set
+* Fixed: The F3 shortcut of menu item "File|Open" wasn't explicit in the
+TEditorApp. Patch by David D. (ddoubrava/volny/cz)
+* Added: [MSVC] Uses_glob to the MSC section of tfilelist.cc. Looks like
+it's needed. Patch by David D. (ddoubrava/volny/cz)
+
+Revision 2.541 2004/05/28 20:53:38 set
+* Updated: Library version in the readme.txt and Debian control file.
+.
+Revision 2.540 2004/05/26 20:42:43 set
+* Fixed: [Win32] The size of clipboard returned by Win32 API isn't the size
+of the text it contains (>=real size). For this reason we must meassure the
+real size before passing it to the application. Reported and solved by
+Warren H. Holt.
+
+Revision 2.539 2004/05/24 15:45:15 set
+* Fixed: [Win32] The keypad / key for the WinNT driver. From information
+provided by: Warren H. Holt (wHolt/drs-ewns/com)
+
+Revision 2.538 2004/05/24 14:48:44 set
+* Modified: [config] Use of "g++" in favor of "gcc -lstdc++". This is
+because newer gcc 3.x compilers can't compile C++ code without doing a
+mess when we use the gcc frontend. From a report by Baurjan Ismagulov - ibr
+
+Revision 2.537 2004/05/12 14:25:15 set
+* Fixed: When using TButton callbacks the button called the CB but also
+sent the event. It is dangerous if the CB uses a dialog because the event
+will be received by this dialog. Now if the CB should generate the event
+if needed.
+* Added: A user provided data pointer to the callback. So it not only
+receives the command number but also a pointer to user defined data.
+
+Revision 2.536 2004/05/07 20:09:19 set
+* Added: A new function called CLY_memcpy to compatlayer.h. This must be
+used when we use memcpy and the blocks overlaps but we know the "normal"
+implementation will work. Platforms where the copy order isn't OK can
+define it to be memmove. A configuration option allows to do it too.
+* Fixed: Some calls to memcpy that overlaps are now to CLY_memcpy. From
+reports obtained by valgrind.
+
+Revision 2.535 2004/05/06 19:39:02 set
+* Fixed: Use of delete[] for TVBitmapFontSize * objects. Reported by
+Oswald using valgrind.
+* Fixed: TListViewer::center not initialized. Reported by Oswald using
+valgrind.
+
+Revision 2.534 2004/05/05 20:11:03 set
+Modified/Fixed/?: In "File Dialogs": Now as soon as the file list is
+selected the focused item is propagated to the other views (input line and
+info panel).
+
+Revision 2.533 2004/04/28 15:39:37 set
+* Added: Support for the way that Putty uses to report Home and End keys.
+Not tested, from a report by Andras Szabo szaboan/kesz/hu.
+
+Revision 2.532 2004/04/19 20:41:58 set
+* Added: Code needed to test with the AlCon branch.
+
+Revision 2.531 2004/04/14 15:41:12 set
+* Fixed: Oops! the patch from the Unicode branch didn't apply propperly,
+now is fixed and the code compiles.
+
+Revision 2.530 2004/04/14 15:34:01 set
+* Modified: When clicking in an object: if it doesn't receive the focus we
+no longer pass the the mouse event to this object. I think it doesn't have
+any sense. It helps to other objects to avoid losing the focus.
+* Modified: The basic "execDialog" function now sets the data before checking
+if the dialog is valid. It helps when using validators because they will
+indicate the dialog is invalid if the data is empty.
+* Added: A mechanism to set options to TInputLine class. The only option
+available is one to avoid passing the focus when the validator indicates the
+data is invalid.
+* Modified: Now dialogs become "inactive" (sfActive=False) after execution.
+In this way TView childs can know when the dialog is no longer running.
+
+Revision 2.529 2004/03/18 18:03:18 set
+* Fixed: [BC++] The version to use ISO C++ 1998 stuff seems to be >= 0x560.
+From a report by Hartmut Welpmann <hartmut.welpmann@gmx.de>
+
+Revision 2.528 2004/03/12 19:25:05 set
+* Added: [config] Some stuff to the configure and makefiles to maintain
+compatibility with packages that uses "auto tools". Patch by Aurelian
+Melinte (LinCS/tiger project).
+
+Revision 2.527 2004/03/02 19:52:41 set
+* Fixed: [Linux] Problems with big-endian terminals using /dev/vcs*
+devices. Looks like the vcs format is platform dependent.
+
+Revision 2.526 2004/01/13 14:30:28 set
+* Fixed: [BC++] Missing QNX4 directory.
+* Fixed: [BC++] It doesn't have ioctl.h.
+
+Revision 2.525 2003/12/12 05:17:50 lmike
+* Fixed some mouse issues for the QNX6.
+* Fixed tvision.qpg file, added proper library dependencies.
+
+Revision 2.524 2003/12/09 16:04:38 set
+* Added: A new argument to the optional TListBox constructor and a new
+member to TListView. They allow to create TListBox-es that centers the
+focused item when setData is used. Suggested by gradha.
+
+Revision 2.523 2003/12/04 19:44:59 set
+* Fixed: MinGW seems to lack the ioctl.h header. Compatlayer must avoid
+to try to include it.
+
+Revision 2.522 2003/12/03 20:28:08 set
+* Fixed: Moved changes to winnt/Makefile.nmk to winnt/msvcmake.in. Reported
+by gradha.
+
+Revision 2.521 2003/12/03 15:09:10 set
+* Added: Patch from Mike to cleanly compile using MSVC 7.1 (.NET 2003
+Architect).
+
+Revision 2.520 2003/12/02 14:51:14 set
+* Added: A first try to support the last MSVC compiler from information
+provided by Grzegorz, it includes:
+1) Adding /EHsc to compilation
+2) Looks like this version follows the ISO C++ 1998 standard like gcc 3.x.
+3) Default values for arguments of function pointers are no longer
+supported. This is bizarre because all gcc versions support it. May be
+that's part of ISO C++ 1998, not sure.
+
+Revision 2.519 2003/11/28 05:23:32 lmike
+* [QNX6] Added experimental mouse support in text mode.
+
+Revision 2.518 2003/11/24 16:32:51 set
+* Added: A new configuration option: AltKeysSetting. It controls the how
+alt keys are interpreted. From a talk with Frank Liu.
+
+Revision 2.517 2003/11/24 16:29:58 set
+* Modified: Synchronyzed the code for the update thread with my home CVS.
+
+Revision 2.516 2003/11/18 13:17:14 lmike
+* Removed QNX4 ifdefs from the main tv sources, all done via Uses_xxx now.
+* Added CLY version of snprintf for the QNX4.
+* Added more QNX4 related fixes, including support for the pterm/qnxterm.
+
+Revision 2.515 2003/11/17 15:58:47 set
+* Added: --without-static and --without-dynamic to the configuration.
+Suggested by Oswald.
+* Fixed: The target to install the dynamic lib didn't create the directory
+first. Reported by Oswald.
+* Added: The posibility to override the "install" command in makefiles.
+Suggested by Oswald.
+
+Revision 2.514 2003/11/10 15:15:06 set
+* Applied: Another batch of patches for QNX4. Sent by Mike.
+
+Revision 2.513 2003/11/06 19:46:21 set
+* Fixed: The Uses_signal stuff in set-logo.cc example needed the inclusion
+of the configuration file. Reported by Frank Liu.
+
+Revision 2.512 2003/11/05 16:41:49 set
+* Added: Another batch of patches from Mike to support QNX4.
+* Added: Uses_signal to compatlayer.
+
+Revision 2.511 2003/11/03 19:52:13 set
+* Added: First steps toward QNX 4 support. Contributed by Mike Gorchak and
+Frank Liu.
+
+Revision 2.510 2003/11/03 15:56:31 set
+* Modified: [X11] The default font to have " and ' of the same size.
+Suggested by Oswald.
+
+Revision 2.509 2003/11/03 15:55:17 set
+* Added: A new configuration variable "AvoidMoire". This variable is
+checked by TScrollBar and TBackground to avoid using chars that produce
+annoying moire effects. Suggeste by Oswald Buddenhagen.
+
+Revision 2.508 2003/11/03 15:53:57 set
+* Modified: The behavior of menu short-cuts look-up. The original code from
+Borland was quite bad (never searched in the current menu) so Robert
+modified it to always search in the opened menu. But this is not good when
+the key is Alt+Key, in this case now the old behavior is used.
+
+Revision 2.507 2003/10/27 13:19:10 set
+* Fixed: A bug in dlgdsn example. Patch by Frank Liu
+<liug.mama.indstate.edu>.
+
+Revision 2.506 2003/10/14 16:02:13 set
+* Added: A flag to TProgram to disable the Alt+N window selection. I need
+it so I can make this key combination configurable in SETEdit.
+
+Revision 2.505 2003/10/14 15:43:11 set
+* Added: A new member called reSort() to the sorted collections. It is
+useful when the sorting criteria and/or key values are changed on the fly.
+
+Revision 2.504 2003/10/06 17:01:42 set
+* Modified: To avoid remapping ASCII values under 32 for the input code
+page. Reported by Alex Lozano.
+
+Revision 2.503 2003/09/29 16:04:38 set
+* Added: Some code to detect KOI-8 FreeBSD terminals and avoid damaging
+some cyrillic characters. It must be tested. From a report by Nikolai
+Dershak <derja@gaz.cv.ua>
+
+Revision 2.502 2003/09/02 13:46:45 set
+* Updated: QNX configuration. Patch from Mike.
+
+Revision 2.501 2003/08/13 20:18:47 set
+* Added: Link to the BC++ and pure DOS fix release to the web page.
+
+Revision 2.500 2003/08/11 14:35:54 set
+* Updated: Russian translation. Patch by Roman Valyushenko <smhs@mail.ru>.
+
+Revision 2.499 2003/08/11 13:59:05 set
+* Modified: [Configuration] to avoid including the compilation directory in
+the headers path when --no-libs-here is specified. Pointed out by Ivan.
+
+Revision 2.498 2003/08/10 19:55:39 terrible
+* Updated: Debian packaging to 2.0.2-1 version!
+
+Revision 2.497 2003/08/06 15:30:30 set
+* Fixed: The snprintf replacement wrote to NULL pointers.
+
+Revision 2.496 2003/08/05 19:33:01 set
+* Fixed: [X11] the "mouse" event mask I used was incomplete. This generated
+problems when using the update thread because in this case the events are
+retired in random order and the mask must be strict.
+
+Revision 2.495 2003/08/05 19:32:22 set
+* Added: [X11] Another approach for the update thread using setitimer and
+SIGALRM, seems to be more reliable.
+
+Revision 2.494 2003/08/05 19:26:24 set
+* Added: [X11] a new option for this driver called UseUpdateThread. When
+enabled (and support is compiled) the driver uses a second thread to handle
+X11 expose events and make the cursor blink. In this way even when the
+application blocks the execution the window doesn't become "black" (lack
+of redraw). This is only supported for Linux and I'm using glibc's pthread
+library. I'm really sad to see how bad it works, I put a long list of
+problems I'm facing in the x11src.cc code. I hope all of this is just my
+fault because if they are pthread limitations then Linux have a really poor
+threads support. I'm looking for pthread replacements.
+
+Revision 2.493 2003/07/30 19:43:18 set
+* Fixed: [BC++] A warning about using unsigned mixed with signed in the
+demo example. Solution by ric <ric@mpcnet.com.br>.
+
+Revision 2.492 2003/07/30 14:37:36 set
+* Fixed: [WinNT driver] Asterisk key not reported. Reported by "Warren H.
+Holt" <wHolt@sierra-idt.com>
+* Fixed: Alt+ASCII carried the ASCII value.Reported by "Warren H. Holt"
+<wHolt@sierra-idt.com>
+
+Revision 2.491 2003/07/30 14:18:20 set
+* Updated the web page to list the new packages.
+
+Revision 2.490 2003/07/29 13:22:33 set
+* Fixed: fileview.cc used destroy instead of CLY_destroy. Looks like some
+patch from my home CVS was missing. I also adapted all examples to use
+CLY_destroy. Reported by abx@abx.art.pl
+
+Revision 2.489 2003/07/28 18:05:17 set
+* Fixed: The configure script to accept command line optins like:
+--cflags="..." without breaking the options. Reported by Ivan.
+* Modified: Now the i18n catalogs are named "tvisionVERSION", it makes
+easier to have more than one TV installed and remove one without altering
+the other. Suggested by Ivan.
+* Modified: The OS clipboard code to return translated messages.
+
+Revision 2.488 2003/07/28 02:53:52 terrible
+* Fixed: configset didn't wait for an ENTER because the read command
+required an argument. While I was there I did cosmetic changes.
+* Fixed: debian/README was mising in ./lista!
+* Fixed: clean the .lo files in addition to the .o ones!
+* Updated: Debian packaging to the 2.0.2-0.1 version!!!
+
+Revision 2.487 2003/07/16 14:00:57 set
+* Modified: The RPM scripts to support an environment variable to indicate
+where to create the RPMs. I needed it when using S.F. Compiler Farm and
+Red Hat 7.3 which always failed when using a directory mounted with NFS.
+
+Revision 2.486 2003/06/30 14:02:28 set
+* Added: makes/rhide.env to distro.
+* Added: gprexp to the genimk.
+
+Revision 2.485 2003/06/30 13:04:11 set
+* Added: A script to update from CVS using the options I use. A DOS batch
+file and a shell script are provided.
+
+Revision 2.484 2003/06/26 19:15:58 set
+* Added: Some clarifications about install process.
+* Added: Explanation about how to use the rhtv-config tool.
+
+Revision 2.483 2003/06/23 14:12:02 set
+* Added: now is posible to indicate the installation prefix for the
+makefile even after configuring another value.
+* Modified: configure script to no longer remove the Makefile.
+* Modified: I heavily changed the readme.txt file to reflect current status
+I also moved some driver specific text to the doc directory.
+* Fixed: the TStaticText class when using the center char \3 needed an
+extra length.
+* Added: the script to create the RPMs now ensures the other scripts are
+executables.
+* Added: detailed compilation instructions in individual files for each
+target. They are adapted versions of the ones I provide with SETEdit.
+
+Revision 2.482 2003/06/18 19:58:51 set
+* Fixed: [DOS] When pasting from Windows clipboard and it was empty the
+routine didn't set the length to 0 returning an aleatory length.
+* Fixed: Missing dgettext in international dummy.
+
+Revision 2.481 2003/06/17 12:48:16 set
+* Added: [BC++] A simple makefile to call the main makefile and clean the
+package.
+
+Revision 2.480 2003/06/17 12:45:00 set
+* Added: A script to generate the RPMs in an easy way.
+* Fixed: A misterious error in the spec file, most probably an accidental
+typo. Produced when applying patch.
+
+Revision 2.479 2003/06/17 12:30:11 set
+* Fixed: Extra lines at the end.
+
+Revision 2.478 2003/06/13 20:49:30 set
+* Added: Files and instructions to create RPMs. They are bbcat's .spec
+files with some additions and corrections. Things I'm not sure they will
+remain:
+1) Need of tar.bz2 file.
+2) Use of package-version dir.
+3) The package have a name different than Debian package.
+
+Revision 2.477 2003/06/09 18:54:50 set
+* Modified: The maintainance rules to maintain examples/*/*.umk because
+they are on CVS and not the .imk.
+
+Revision 2.476 2003/06/05 19:59:22 set
+* Fixed: When genimk fails it must delete the partially generated .imk and
+.umk to force a new generation after fixing the problems.
+
+Revision 2.475 2003/06/05 19:55:38 set
+* Fixed: Compilation problems with MSVC 7.0. Patch from Mike. Doubt:
+vsnprintf, may be the MSVC version should be lower or for all.
+
+Revision 2.474 2003/06/05 19:49:00 set
+* Modified: A couple of C++ header requests that Andris pointed out to be
+portable. I'm not sure if they are a side effect of using SSC.
+
+Revision 2.473 2003/06/05 19:44:25 set
+* Fixed: gcc 3.3 compilation problems. Patch from Andris. It solves:
+1) Order of base class constructor calls in initialization.
+2) gcc no longer supports char as index for arrays.
+
+Revision 2.472 2003/06/05 19:33:26 set
+* Modified: [Win32] Graphic driver to support environment where IDC_ARROW,
+IDC_HAND and/or IDC_SIZENWSE aren't defined.
+
+Revision 2.471 2003/06/02 18:26:44 set
+* Fixed: the configuration script generated .env files with lib paths
+pointing to the old locations for the libraries.
+
+Revision 2.470 2003/06/02 15:09:05 set
+* Added: Makefiles for BC++, they doesn't have a main makefile yet, but
+you can compile the library with it. (cd makes; make -f librhtv.bmk).
+* Added: Makefiles for BC++ to most examples. It doesn't mean they work,
+just that they compile. A lot behave strangely or crash at exit. Looking
+for volunteers to fix the problems.
+* Fixed: a lot of portability details in the examples so they can compile
+with BC++.
+
+Revision 2.469 2003/06/02 14:52:38 set
+* Added: Even more checks to imk processor.
+
+Revision 2.468 2003/06/02 14:51:19 set
+* Fixed: The compat.gpr project have relative dependencies that confused
+genimk.cc.
+
+Revision 2.467 2003/06/02 14:49:55 set
+* Added: Support for more variants of RHIDE .mak files to extrimk.cc.
+
+Revision 2.466 2003/06/02 14:47:15 set
+* Fixed: Missing maintain.mak in distribution list.
+* Fixed: Compress scripts list generation.
+* Fixed: BC++ and MSVC makefiles generation, now using .imk files.
+
+Revision 2.465 2003/06/02 14:44:58 set
+* Modified: The whole compilation mechanism. Now all is concentrated in the
+"makes" directory using the mkf, imk and umk files like I did in setedit
+project (check http://setedit.sf.net/ for more info).
+
+Revision 2.464 2003/05/30 19:38:32 set
+* Modified: Removed recode detection from configure script (no longer used)
+* Added: --real-prefix and --no-libs-here options for cases where the
+lib is installed to a temporal directory and then moved to their final
+destinations as when creating the .debs.
+* Modified: To avoid debug info by default.
+* Updated: readme.txt file.
+* Modified: Debian package stuff to include rhtv-config and use the new
+configuration switches. Also removed recode as dependency.
+
+Revision 2.463 2003/05/29 18:36:59 set
+* Added: [BC++] Definition of __inline__ as inline in compatlayer.h. This
+will avoid command line definitions.
+
+Revision 2.462 2003/05/29 18:24:24 set
+* Modified: Now the global function destroy is called CLY_destroy, new code
+should use the function with this name. For compatibility most targets
+defines CLY_destroy == destroy. Exception: BC++ 5.6 which have an STL
+function called destroy that collides.
+* Added: [BC++] Support for BC++ 5.6 strandard C++ library. It doesn't
+have filebuf::filebuf(int) (even when the manual clearly states it is
+there). But it have filebuf::open(int). It also have a really bizarre
+interpretation of the field used for file rights (0777 doesn't create a
+file and 0666 creates a hidden file???!!).
+* Added: A compatlayer define to avoid defining min/max. Looks like STL
+defines them in a way that collides with the current definitions and that
+the STL definition is ok for TV. So now targets can define
+CLY_DONT_DEFINE_MIN_MAX to 1 and avoid the collisions. It will most
+probably help Mike to compile with MSVC 7.0, was needed for BC++ 5.6.
+* Added: [BC++] Some code to the example to print the compiler version and
+to test the streams.
+
+Revision 2.461 2003/05/23 16:19:28 set
+* Added: Version to the configuration tool for easy detecttion.
+
+Revision 2.460 2003/05/23 13:18:21 set
+* Modified: To create the rhtv-config tool without .exe for UNIX systems.
+* Added: Options to know the C and C++ flags used to compile the library
+using rhtv-config.
+
+Revision 2.459 2003/05/22 19:01:25 set
+* Fixed: When configuring the BC++ and MSVC makefile from DOS makefile it
+failed if it was done under UNIX and the file had \r\n. From a report by
+Mike.
+
+Revision 2.458 2003/05/21 20:57:38 set
+* Fixed: Some pointer casts to use long as data type instead of int. This
+is needed for 64 bits targets. The demo compile and seems to be functional
+for Itanium processors.
+
+Revision 2.457 2003/05/21 17:42:44 set
+* Fixed: [Linux] The debug log mechanism to compile with gcc 3.x.
+
+Revision 2.456 2003/05/21 14:38:36 set
+* Fixed: [Linux] Moved the UTF-8 detection to be done after saving the
+screen contents.
+* Fixed: [Linux] The mpaColor to support the new "8 colors" mode. The test
+program successfully run in an UTF-8 console without /dev/vcs* access.
+
+Revision 2.455 2003/05/21 12:41:03 set
+* Fixed: TVCodePage::CreateCPFromUnicode(...) corrupted the data when
+creating the LowRemap part. It was the reason for some random fails while
+creating a custom code page for Linux console.
+* Fixed: [Linux] I failed to detect when Linux kernel informed that the
+Unicode table was bigger than 512, and the code took it as a fail. It made
+the code fail for most fonts with 512 glyphs. So it failed for most UTF-8
+consoles.
+* Added: [Linux] Now if we detect a font with 512 glyphs and we are using
+VCS* mechanism the colors are reduced to 8 and a simple algorithm avoid
+that things like "white over grey" become "grey over grey".
+* Note: After fixing those two and adding this one I successfully run the
+applications using an UTF-8 console and latarcyrheb-sun16.psfu.gz font. The
+problems when no VCS* is available remains, but the user have an option to
+get things working.
+
+Revision 2.454 2003/05/20 14:06:29 set
+* Fixed(?): When trying to enable DEBUG logs in Linux driver and using
+gcc 3.x it wasn't compilable. Not tested.
+
+Revision 2.453 2003/05/19 18:13:12 set
+* Fixed: [Linux] if the console was in UTF-8 mode:
+1) The library failed to draw some stuff during the first screen update
+(until a character that needs UTF-8 was used).
+2) The library didn't restore the UTF-8 probably causing problems to
+another applications.
+Now this is detected and if in UTF-8 the mode is reverted to single char.
+The original state is restored during Suspend and memorized again in Resume
+
+Revision 2.452 2003/05/19 14:06:39 set
+* Added: Some test programs to detect problems with Linux console handling.
+I put them in the docs directory.
+
+Revision 2.451 2003/05/19 13:50:06 set
+* Fixed: [Win32] The configure script didn't define the STDINC directories
+(in fact I don't know what exactly to put there) and hence it was
+imposible to compile rhtv-config.c.
+
+Revision 2.450 2003/05/19 13:47:58 set
+* Modified: rhtv-config to report the same for dynamic and static libs in
+systems where we don't support dynamic libs.
+
+Revision 2.449 2003/05/16 18:44:23 set
+* Fixed: Forgot to remove debug print in scripts and to put some code in
+djgpp version.
+
+Revision 2.448 2003/05/16 18:37:00 set
+* Added: Workaround for problems when using CVS RHIDE, it generates
+absolute paths for items in subprojects that doesn't have a target. I added
+a filter to make them relative.
+
+Revision 2.447 2003/05/16 14:25:45 set
+* Fixed: [Solaris] The use of size_t needs explicit inclusion of stdio
+header.
+
+Revision 2.446 2003/05/16 12:39:47 set
+* Added: A small tool called "rhtv-config.exe" that can be used to
+determine the libraries needed to link with TV (statically and
+dynamically), the path for libraries and the path for includes. I'm quite
+sure it doesn't work perfectly but I was able to compile the tvedit
+example using: gcc -o tvedit.exe `rhtv-config.exe --include` tvedit.cc
+`rhtv-config.exe --dir-libs` `rhtv-config.exe --dlibs`
+* Modified: To ever include stdc++ as library in the worst case it will be
+listed twice.
+
+Revision 2.445 2003/05/15 18:37:08 set
+* Fixed(?): msgfmt (gettext) problems:
+1) It didn't reuse ~Alt-X~ Exit and let it commented. A bug.
+2) The new version included in Red Hat 8.0 says the commented version is
+a duplicate. From my point of view another bug, it can be marked as
+information but never as an error.
+Gettext is climbing to the top of most buggy tools I use.
+
+Revision 2.444 2003/05/15 18:14:03 set
+* Modified: configset to wait for ENTER instead of sleeping 2 seconds. As
+suggested by Ivan.
+
+Revision 2.443 2003/05/14 19:11:49 set
+* Fixed: New classes and operator improperly protected against multiple
+inclusion of the same header.
+
+Revision 2.442 2003/05/14 14:07:23 set
+* Added: Three new classes that makes the use of the base classes a little
+bit easier: TInput1Line, T1Label and T1StaticText. They are versions that
+uses just 1 line and computes the length of the box. I also encapsulated
+the i18n cache stuff there. I applied the T1Label to TV code. They are
+based on TVTools ideas but implemented in a very different way. One
+important detail is that T1Label and T1StaticText are slower than doing
+things by hand but they are much easier to use.
+
+Revision 2.441 2003/05/14 13:53:37 set
+* Added: TSItem::append, TMenuItem::append, operator += (TMenuItem& ,
+TMenuItem&), operator += (TSubMenu& , TSubMenu& ), operator += ( TSubMenu&
+, TMenuItem& ), operator += ( TStatusDef& , TStatusDef& ), operator +=
+( TStatusDef& , TStatusItem& ), operator + ( TSItem& , TSItem& ) and
+operator += ( TSItem& , TSItem& ). Most of them based on TVTools code or
+inspired and reworked.
+* Added: explanation about BSD code in TV and also code from TVTools to the
+readme.
+
+Revision 2.440 2003/05/13 15:06:16 set
+* Added: void *getData() member to TInputLine. It return the data member.
+That's needed to compile coded adapted to the Unicode branch where the
+data member is protected.
+
+Revision 2.439 2003/05/12 12:49:50 set
+* Fixed: The TVIntl recode shouldn't recode values in the ASCII range. Not
+at least for the supported code pages.
+
+Revision 2.438 2003/05/12 12:46:13 set
+* Modified: tv.h to generate dependencies more similar to the Unicode
+branch.
+
+Revision 2.437 2003/05/09 13:55:59 set
+* Added: A check to determine if the configure script is newer than the
+cache. If that's the case the cache is discarded.
+
+Revision 2.436 2003/05/09 12:25:05 set
+* Fixed: I forgot to initialize intlLabel in inputBoxRect.
+* Added: A small example for inputBox to the demo example.
+* I got a copy of: Borland Turbo Vision (C++) Bug/Enhancement List created
+by Marc Stern <stern@mble.philips.be> it contains a lot of bug fixes and
+enhancements for TV. Most of them were already in current code and others
+didn't apply (compiler dependent or related to obsolete stuff). But I
+applied:
+* inputBox enhancements: size according to contents and centered buttons.
+* TDialog enhancement: support for TDialogs inside TDialogs (palette trick).
+* TGroup enhancement: more robust when faulty code selects an unselectable
+ or hidden item and the group is shutDown(). Marek Bojarski
+ <bojarski@if.uj.edu.pl> idea.
+* TGroup fix: setCurrent didn't verify if the focus really changed.
+* TWindow enhancement: if arrows aren't used by the focused TView and they
+ reach the TWindow then they behave as Shift/Tab (change focused). Seems to
+ be useful.
+* tvutils.h enhancement: defined min/max for any data type (using
+ templates). Vincent Van Den Berghe idea.
+
+Revision 2.435 2003/05/07 19:37:55 set
+* Added: [Linux] Now the Ctrl+Tab is mapped to Tab so TV applications can
+use it.
+
+Revision 2.434 2003/05/05 13:28:59 set
+* Added: A warning to configset as I did for DOS' batch.
+
+Revision 2.433 2003/05/05 13:26:35 set
+* Added: A warning to configset.bat because people thinks thats "set
+configuration" and not "configuration for SET" ;-)
+* Added: Now if shell utils aren't installed (I think djgpp is the only
+that can lack it) the configuration stops and explains the problem.
+* Fixed: [DOS] snprinf and dos/mouse code needed strings.h when using SSC.
+
+Revision 2.432 2003/04/30 18:18:49 set
+* Fixed: When doing incremental searches in sorted list boxes some times
+the cursor disapeared.
+
+Revision 2.431 2003/04/25 19:43:36 set
+* Fixed: [X11] Under some situations after a resize the cursor disapear.
+Now I added an explicit enable.
+
+Revision 2.430 2003/04/25 16:41:52 set
+* Fixed: The TSortedCollection trapped ENTER in some particular cases.
+* Fixed: X11 driver using Unicode translatio even when X11 didn't support
+it.
+
+Revision 2.429 2003/04/22 15:46:04 set
+* Fixed: SSC stuff when using gcc 3.x. Tested on Cygwin using gcc 3.2. With
+SSC the time was reduced 65%! (about 3 times faster!). Even with it the
+compilation time is the double of the time using Linux.
+
+Revision 2.428 2003/04/22 15:16:03 set
+* Added: An optional replacement for C++ streams. This is a very small and
+incomplete replacement, but is enough to compile TV and SETEdit. With this
+replacement and some changes added the library can be compiled without
+using even one standard C++ header. I tested it moving the whole C++
+include directory away. The main idea is to reduce the size for target
+using only static libs and also to reduce the compilation time. For gcc
+2.95.4 running on Linux I got a 20% reduction of compilation time.
+To enable it you can use --with-ssc configuration option, but remmember
+that's experimental.
+
+Revision 2.427 2003/04/21 18:03:14 set
+* Added: Some documentation about the new TVIntl API.
+
+Revision 2.426 2003/04/21 16:56:56 set
+* Fixed: Alt-X Exit wasn't marked for translation.
+* Added: An i18n example.
+* Fixed: Crash when using i18n and not hooking code page callback.
+* Added: Now when a translation can't be found in the current domain TV
+tries in "tvision" domain. It allows separated catalogs for the application
+and the library avoiding duplication.
+* Added: Member to initialize i18n providing a directory to search and some
+tricks used in RHIDE and SETEdit.
+
+Revision 2.425 2003/04/21 16:37:19 set
+* Fixed(?): Use of \r in i18n messages. This is a really bad limitation.
+
+Revision 2.424 2003/04/21 16:17:16 set
+* Added: Support for the new i18n API to TColorGroup and TColorItem.
+* Added: snprintf and fprintf members to TVIntl. They transparentlty
+translates and recodes the format string.
+* Modified: i18n makefile to stop generating *_iso* files.
+* Updated: spanish translations, also fixed a few russian translations, the
+obvious ones because of cformat changes ;-)
+
+Revision 2.423 2003/04/21 16:13:33 set
+* Added: Some comments about TV streams in the doc directory. They are
+really small but includes an ASCII graphic showing the hierarchy.
+* Modified: TEditorApp to use messageBox as a printf instead of using
+strstreams. Now it can be done safetly because we use snprintf.
+
+Revision 2.422 2003/04/21 16:08:02 set
+* Fixed: [Cygwin] it have snprintf, no need for replacement. It makes DJGPP
+the only one without it, I guess it will be solved in 2.04.
+
+Revision 2.421 2003/04/21 15:46:31 set
+* Fixed: The snprintf replacement (coded by Caolan McNamara
+<caolan@skynet.ie>, thanks Caolan!) didn't return the expected value.
+According to modern implementations (like GNU one) it must return the
+number of characters we should write the buffer if it have enough space and
+not the ammount we wrote. I hope my changes are ok ;-)
+
+Revision 2.420 2003/04/21 15:29:04 set
+* Added: Dummy versions of the TVIntl members for systems without gettext.
+
+Revision 2.419 2003/04/21 14:38:43 set
+* Fixed: unused variable.
+
+Revision 2.418 2003/04/16 20:10:31 set
+* Added: adapted the messageBox to the new i18n API.
+* Modified: messageBox to use snprintf instead a fixed size buffer.
+* Added: a snprinf replacement for systems without it, untested.
+
+Revision 2.417 2003/04/15 15:30:44 set
+* Modified: Files distribution list to reflect new QNX package.
+
+Revision 2.416 2003/04/15 15:17:44 set
+* Fixed: The new intl.h header only worked for C++ code but the
+configuration script tests it using C code. Now it also defines things for
+C code. Reported by Mike.
+
+Revision 2.415 2003/04/15 14:42:22 set
+* Patches from Mike:
+* Added: [QNX] pterm specific functions for more keycombination detect. Now
+running TV app under pterm have the same functionality as running under raw
+console.
+* Fixed: [QNX] russian text inputing, tested on CP866/WIn1251/KOI8-R.
+* Added: [QNX] more to QNX.txt ;) will be much more in future.
+* Updated: [QNX] package generation data.
+* Fixed: Lack of check in xgettext and recode tests and wrong link to dummy
+intl lib.
+
+Revision 2.414 2003/04/10 21:34:40 set
+* Fixed: TVCodePage::FillGenericRemap must be ready to be called even
+before the code page module is initialized.
+
+Revision 2.413 2003/04/10 21:26:43 set
+* Updated: DOS project.
+* Fixed: [DOS] use of _() return value as char *.
+
+Revision 2.412 2003/04/08 19:07:42 set
+* Added: Now added support to TButton and TWindow/TDialog.
+
+Revision 2.411 2003/04/08 15:19:43 set
+* Added: A dummy include/tv/parttree.h file to avoid dependencie problems.
+
+Revision 2.410 2003/04/08 14:05:45 set
+* Added: Support for the new i18n features to TStaticText it affects
+TLabel and TParamText(partially).
+
+Revision 2.409 2003/04/07 13:39:55 set
+* Added: Support for the new i18n features to TCluster it affects
+TCheckBoxes and TRadioButtons.
+
+Revision 2.408 2003/04/07 13:39:03 set
+* Fixed: The dialog design example to use the new API style.
+
+Revision 2.407 2003/04/07 13:36:47 set
+* Modified: Now TMenu and TStatusLine are "i18n award". It means that when
+translations are enabled these classes translates their strings on the fly
+using caches to avoid useless searchs. It also supports code page changes
+transparently because the cache is invalidated and fresh translations are
+retreived.
+* Modified: Version to 2.0.2 because that's an important change for
+applications as SETEdit and RHIDE.
+
+Revision 2.406 2003/04/07 13:32:43 set
+* Added: A new class TVIntl to handle all the gettext mess. The GNU gettext
+library is a mess and a source of problems and limitations. For this reason
+I isolated all of this in a class that will also provide clean recoding
+of catalogs.
+
+Revision 2.405 2003/04/03 20:08:26 set
+* Modified: The following patch enforces the use of the return value of
+gettext (intl library) as a const char *.
+
+Revision 2.404 2003/04/02 13:35:49 set
+* Fixed: [MinGW] The configuration script shown the error messages created
+when running non-existent programs appear in the screen generating
+confusion. Now the command are executed redirecting stderr.
+
+Revision 2.403 2003/04/02 13:34:49 set
+* Fixed: [BC++] Warning about unused parameter in tgkey.cc.
+
+Revision 2.402 2003/03/20 20:33:10 set
+* Fixed: intl lib configuration for QNX. Patch from Mike.
+
+Revision 2.401 2003/03/18 16:27:55 set
+* Fixed: Some TEditorApp messages include a file name but the
+doEditDialogDefault function used an 80 bytes buffer. Reported by Mike.
+
+Revision 2.400 2003/03/18 16:03:17 set
+* Fixed: QNX details, patch from Mike.
+
+Revision 2.399 2003/02/05 13:43:51 set
+* Modified: The default TMouse::resume behavior to restore the buttonsCount
+member. It allows calling suspend/resume when using drivers that doesn't
+implement it. This is needed for legacy applications as reported by Andris.
+
+Revision 2.398 2003/02/05 12:27:19 set
+* Fixed: [DOS] The Windows clipboard paste requested plain text instead of
+OEM text. This skipped the code page translation. Reported by Thiago.
+
+Revision 2.397 2003/02/02 01:09:33 terrible
+* Updated: Debian packaging to version 2.0.1-1 "Columbia".
+
+----------------------------- 2.0.1 Release ------------------------------
+
+Revision 2.396 2003/01/24 12:37:58 set
+* Fixed: [X11] Some times when resizing a window we get an expose event for
+the new size before the application gets the resize notification. It can
+fool the redrawing mechanism. As the application will redraw the screen
+soon there is no point in executing the expose event, so these events are
+ignored until the TApplication receives the notification. Reported by
+Andris, it wasn't easy to reproduce.
+
+Revision 2.395 2003/01/16 20:15:58 set
+* Fixed(?): Bug in the TEditor class. It looks like the condition that
+paints the empty part of the lines was wrong and didn't paint lines longer
+than half the width. Reported by Frederic BARBAISE
+<frederic.barbaise@numericable.fr>.
+
+Revision 2.394 2003/01/10 13:21:14 set
+* Fixed: Cyrillic examples had wrong key assigned to Exit (typo). Roman
+found it.
+
+Revision 2.393 2003/01/08 13:45:40 set
+* Modified: Small optimization in TMenuView::findItem to avoid searching
+for ch==0. Proposed by Roman.
+
+Revision 2.392 2003/01/08 12:49:30 set
+* Fixed: [UNIX] In some cases the headers are included even when a driver
+isn't supported just to keep the propper dependencies. Some of the UNIX
+headers uses sig_atomic_t defined in signal.h, now included. Reported by
+Roman and Dejan Lekic (dejan). It needs more testing.
+
+Revision 2.391 2003/01/07 13:16:26 set
+* Updated: Russian translation. From Roman.
+* Fixed: tvedit3.cc had two messages almost identical, now merged. Pointed
+out by Roman.
+
+--------------------------- 2.0.1 Release Candidate 2 ----------------------
+
+Revision 2.390 2002/12/27 12:42:13 set
+* Added: Workaround for problems with SuSE when including libintl.h
+(__THROW interferes with default prototypes). Reported by Grzegorz.
+
+Revision 2.389 2002/12/19 17:29:43 set
+* Updated: Russian translations. Contributed by Roman Valyushenko
+<smhs@mail.ru>
+* Updated: List of changes in 2.0.1.
+* Fixed: Wrong links in web page. Reported by Michel Catudal
+<bbcat@netonecom.net>.
+
+Revision 2.388 2002/12/17 14:23:26 set
+* Fixed: [X11] I used Xutf8LookupString without realizing that's an
+XFree86 4.0.2+ extension. Added conditionals for it (untested).
+
+--------------------------- 2.0.1 Release Candidate 1 ----------------------
+
+Revision 2.387 2002/12/16 13:30:05 set
+* Fixed: Extra .mak file in files list.
+
+Revision 2.386 2002/12/14 22:57:31 terrible
+* Updated: Debian packaging to version 2.0.1-0.2.
+
+Revision 2.385 2002/12/13 18:11:40 set
+* Added: A new example: A Borland's Help file browser. It can display TC++
+and BC++ help files. Contributed by Jan Van Buggenhout <Chipzz@ULYSSIS.Org>
+
+Revision 2.384 2002/12/12 19:02:57 set
+* Modified: [DOS] Removed the old greek keyboard hack, the generic approach
+should work for all drivers.
+
+Revision 2.383 2002/12/12 19:01:39 set
+* Added: A generalized mechanism to interpret Alt+Non-ASCII. So now in a
+greek keyboard Alt+Chi is converted to Alt+X and in a russian keyboard
+Alt+Che is also converted to Alt+X ... may be some day Alt+SA will be Alt+X
+in a japanese keyboard ;-), but that will need much more work.
+
+Revision 2.382 2002/12/11 12:41:07 set
+* Modified: I generalized the TGKey::defaultSetCodePage, it now supports
+russian and greek keyboards for various code pages. This code allows
+accessing to menues even when the user is in the "alternate mode" (i.e.
+Alt+A <-> Alt+Alpha).
+
+Revision 2.381 2002/12/10 19:47:53 set
+* Modified: THelpFile::getTopic to be virtual as suggested by Chipzz
+<chipzz@ULYSSIS.Org>.
+
+Revision 2.380 2002/12/10 18:10:43 set
+* Modified: Allocated separated internal codes for cyrillic and greek
+letters that are identical to latin ones. This wastes memory but simplifies
+some stuff.
+* Added: [X11] Russian and Greek keyboards seems to work ok (my keyboard
+now is US+Japanese+Russian+Greek ;-). You just need to select the propper
+code page.
+
+Revision 2.379 2002/12/10 14:15:46 set
+* Fixed: [X11] The new code to handle input code page (return value).
+* Fixed: [X11] I relaxed the filter too much in the last patch ;-)
+
+Revision 2.378 2002/12/09 18:21:32 set
+* Modified: [X11] The filter that avoids reporting ASCII values for
+ALT+key. It was too strict making fail the KOI8R mode, so now Alt+A and
+Alt+EF (cyrillic) are a valid shortcuts for a menu with A or EF.
+
+Revision 2.377 2002/12/09 17:49:21 set
+* Modified: [X11] To read the keyboard using Unicode. So now the driver
+uses a conversion from Unicode to the current input code page. With this
+I got an almost working "russian keyboard". The problem is in my
+oversimplification used for the fonts where cyrillic characters with the
+same shape as latin characters are expressed as latin characters ...
+
+Revision 2.376 2002/12/09 14:45:34 set
+* Added: [Linux] A configuration variable to indicate the console fails to
+implement the cursor shape escape sequences. It seems to happend with some
+frame buffers, as reported by Martijn. The variable is called
+BrokenCursorShape.
+
+Revision 2.375 2002/12/09 13:14:00 set
+* Modified: [Win32] unistd requested unconditionally, is needed for all the
+Win32 targets.
+
+Revision 2.374 2002/12/09 13:10:26 set
+* Fixed: MinGW doesn't define its version using gcc itself, so we must
+include at least _mingw.h. This is an error in MinGW.
+
+Revision 2.373 2002/12/09 13:04:55 set
+* Fixed: [DOS] The greek mode stuff. It must be moved but right now is
+better to let it work like this until I have some greek tester ;-)
+* Tested with gcc 3.2.1 OK
+
+Revision 2.372 2002/12/09 13:03:29 set
+* Fixed: [DOS] Typos in untested code. Also reverted some keyboard
+variables just to compile the code, they should go away.
+
+Revision 2.371 2002/12/06 19:49:12 set
+* Fixed: [Win32] lack of unistd due to the new use of dup2. Patch by Igor
+Gnip.
+* Fixed: The examples/Makefile to clean in sub-sub directories. Patch by
+Igor Gnip.
+
+Revision 2.370 2002/12/06 16:12:12 set
+* Fixed: [Win32] typo in WinGr driver.
+
+Revision 2.369 2002/12/04 21:18:22 terrible
+* Updated: Debian packaging to 2.0.1-0.1.
+
+Revision 2.368 2002/12/03 12:30:20 set
+* Added: A way to indicate we want to load secondary fonts at start-up.
+They must be provided by the font callback as the primary. I added code to
+X11, Linux and DOS drivers for it. The last is untested.
+* Fixed: The Linux driver failed when resquesting to just load the
+secondary font.
+
+Revision 2.367 2002/12/03 12:29:34 set
+* Added: TListView now does PageUp/Down with the mouse wheel.
+* Added: Text selected in TInputLines is copied to the selection clipboard.
+
+Revision 2.366 2002/12/03 12:28:29 set
+* Modified: The GetKbdMapping behavior. Now it must be called for each
+setting individually and can be redefined by each driver.
+
+Revision 2.365 2002/11/29 12:49:07 set
+* Modified: Moved CLY_Beep to TScreen::Beep. It allows drivers that needs
+access to low level stuff to define it properly. X11 is a clear case, you
+must have access to the display.
+
+Revision 2.364 2002/11/28 20:49:55 set
+* Fixed: [X11] The driver reported the wrong kind of flags for key
+modifiers in the event structure.
+
+Revision 2.363 2002/11/28 18:42:26 set
+* Fixed: The files list said intl/dtou.pl instead of intl/utod.pl.
+
+Revision 2.362 2002/11/28 17:53:40 set
+* Fixed: [X11] Squash! finally killed the f*cking bug. It was the mother of
+race conditions. The strange thing is how useless was efence to detect it.
+The problem was that for a small portion of time the TProgram::buffer
+pointer was out-of sync with TScreen::screenBuffer. It was between the
+realloc (note it could reuse the memory and add more randomness) and the
+momment where TProgram detected the resize. A draw to the TProgram space
+confused the buffer and tried to use it corrupting memory. Now the X11
+driver just signals the window changed and wait until TProgram asks for
+it before changing anything.
+
+Revision 2.361 2002/11/27 20:52:32 set
+* Fixed: [X11] When the window manager forces the window size during
+initialization a race appears between the path to reach the point where
+TProgram asks for the new window size and other draw routines that asks
+for the current screen width/height. This is fixed and may be needed by
+other drivers. But the driver still crash if the WM forces the size. I
+don't know why but the crash is inside X lib. Efence doesn't show any kind
+of memory corruption. Looks like a missuse of the Xlib API.
+
+Revision 2.360 2002/11/27 17:24:28 set
+* Added: Now the TScreen::System member can take 3 optional arguments. They
+are used to redirect the stdin, stdout and stderr file handles of the child
+process. This is achieved using dup2 after spawning the child. If the value
+is -1 the handles are shared as before. Tested only for Linux.
+* Added: Testing code to the Linux driver to try using a separated file
+handle for output. This approach is cleaner but lamentably something is
+wrong and I must disable the buffering losing performance (5 times slower).
+For this reason it isn't used.
+
+Revision 2.359 2002/11/27 13:14:24 set
+* Added: Now the ~ at the beggining of a file name is expanded in a similar
+way used by UNIX shells. CLY_IsRelativePath() returns 0 and _fixpath() (it
+is used by CLY_fexpand()) expands it. Win32 (unless Cygwin) is an
+exception. If the ~ is followed by anything but a dir separator or the end
+of the name it isn't expanded (~Name pass unmodified). If the HOME
+environment variable isn't defined it isn't expanded. Martijn suggested
+expanding ~.
+
+Revision 2.358 2002/11/26 12:53:29 set
+* Changed version to 2.0.1 to make a maintainance release during the next
+weeks.
+* Modified: [WWW] version and history.
+
+Revision 2.357 2002/11/26 12:52:50 set
+* Added: The new X11 cyrillic example to the readme and the makefile.
+
+Revision 2.356 2002/11/25 15:06:47 set
+* Added: The creation and installation of es.mo and ru.mo files from
+spanish and russian translations.
+
+Revision 2.355 2002/11/25 15:03:12 set
+* Added: TGKey now have a member to set the code page for the translation
+tables.
+* Added: TVCodePage calls TGKey::SetCodePage.
+* Fixed: TMenuView didn't use the TVCodePage toupper/lower system.
+* Modified: Moved KOI8r tables from Linux driver to TGKey, so they can be
+shared with X11 driver.
+* Added: An example showing how to force cyrillics for X11 applications, it
+also works for Linux console and should work for DOS.
+
+Revision 2.354 2002/11/25 14:59:02 set
+* Fixed: In systems using ACMs with unknown Unicodes the translation table
+got 0xFFFF and when using it some memory corruption could appear. Reported
+and investigated by Martijn Versteegh.
+
+Revision 2.353 2002/11/05 14:49:33 set
+* Added: [WWW] a link to Sigala's documentation and a comment about the
+documentation for the new classes.
+
+Revision 2.352 2002/11/05 13:27:36 set
+* Modified: [Win32] [WinGr driver] Console release in constructor. Patch by
+Pawel Piecuch <pawelp@piecyk.allegro.pl>.
+* Fixed: [Win32] [WinGr driver] Control characters passed with ASCII
+attached. Patch by Pawel Piecuch <pawelp@piecyk.allegro.pl>.
+
+Revision 2.351 2002/11/05 13:12:26 set
+* Fixed: The Linux driver initialization could use a NULL pointer to delete
+a requested font.
+
+Revision 2.350 2002/11/05 13:00:33 set
+* Added: Support for DBCS systems at compile level in codepage.cc code.
+More adjusts could be needed. Related to SF FR #633611 by Kirby Zhou
+(kirbyzhou).
+
+Revision 2.349 2002/10/15 19:57:41 set
+* Added: Roman to contributors lists.
+
+Revision 2.348 2002/10/15 19:53:26 set
+Added: Russian translation for the messages. Contributed by Roman
+Valyushenko.
+
+Revision 2.347 2002/10/08 20:40:23 set
+* Added: [WWW] Now the .zip file is also available from Simtel network.
+
+Revision 2.346 2002/10/07 20:02:37 set
+* Modified: Release details in the web pages.
+
+----------------------------- 2.0.0 Release ------------------------------
+
+Revision 2.345 2002/10/07 15:19:01 set
+* Fixed: [Win32] X11 library path.
+
+Revision 2.344 2002/10/04 00:57:50 terrible
+* Updated: Debian packaging to version 2.0.0-1.
+
+Revision 2.343 2002/09/30 20:08:35 set
+* Updated: The list of strings to translate and the spanish translation.
+
+Revision 2.342 2002/09/30 20:06:48 set
+* Fixed: SDG modules must use "Comments" and not "Description".
+* Added: More documentation. That's far from complete, even when the
+objetive is to document only new stuff. But is an start.
+
+Revision 2.341 2002/09/27 13:46:39 set
+* Modified: [X11] The methode used to make the cursor blink. Using sigalarm
+the sleep funtion stops working, according to GNU library docs it shouldn't
+happen, but in most libc implementations could. So now what I do is just
+check the current time. I think that's slower, but safer.
+
+Revision 2.340 2002/09/25 20:29:01 set
+* Modified: The readme file to be more clear about what is supported and
+what to read.
+* Removed: All MSVC files found in win32 directory. They are outdated and
+now replaced by the nmake files found in winnt directory.
+* Added: More clarifications to the winnt/readme.txt file. It had wrong
+information about how to proceed when using MSVC.
+
+Revision 2.339 2002/09/25 19:39:04 set
+* Fixed: [MSVC] Now gdi32.lib is also needed (for the WinGr driver).
+Reported by Sergey Krivulja <skrivulja@erec.ru>
+
+Revision 2.338 2002/09/23 16:02:03 set
+* Added: Daily snapshot to the web site.
+
+Revision 2.337 2002/09/23 15:56:37 set
+3 Patches and/ot Reports from Igor Gnip <gnipi@europeonline.com>:
+* Fixed: Removed unused variable in classes/tfilelis.cc.
+* Fixed: Changed NAME_MAX by PATH_MAX in examples/tvhc/tvhc.cc, it is
+defined for all targets.
+* Fixed: Changed the use of sleep in examples/msgcls/testdyn.cpp to use the
+CLY_YieldProcessor function.
+
+Revision 2.336 2002/09/23 14:11:35 set
+* Fixed: Disabled TButtons with default flag ignored the disable state.
+Patch from Hartmut Welpmann <hartmut.welpmann@gmx.de>, originally done by
+Marc Stern.
+
+Revision 2.335 2002/09/23 12:41:24 set
+* Added: More documentation to the codepage.cc file.
+* Added: A SETEdit project and SDG configuration to generate some
+documentation in HTML format. It is just oriented to the new stuff added
+and isn't complete.
+
+Revision 2.334 2002/09/23 12:37:24 set
+* Added: Win32 and WinGr documentation.
+* Modified: X11 docs, added the fact that X11 driver can be used for Win32.
+
+Revision 2.333 2002/09/23 12:34:24 set
+* Added: DOS driver, code pages and configuration file documentation.
+* Modified: Added most structure to all the other docs.
+* Modified: [DOS] Made PollMouse=1 and SaveVGAState=0 the defaults. I think
+this gives more chances to get things working in the first try. If the user
+wants to get better support s/he can read the docs.
+
+Revision 2.332 2002/09/23 12:32:28 set
+* Fixed: [X11] The 27 to 31 ASCII range wasn't mapped to any key, they are
+used for ^{ ^\ ^} ?? ^/.
+
+Revision 2.331 2002/09/23 12:31:54 set
+* Added: A mechanism to set the name of the configuration file from the
+user application side. It allows to have special configuration files for
+particular applications.
+
+Revision 2.330 2002/09/23 12:31:09 set
+* Added: [Linux] more details about why the 512 chars system used by Linux
+isn't the same that TV needs. From a talk with Tapio.
+
+Revision 2.329 2002/09/19 18:06:38 set
+* Fixed: static const class members looks like a logic construction and g++
+understands it, but it seems to be a non-standard thing and MSVC doesn't
+undertsand it. I changed it by the "anonymous enum" trick. From a report by
+WintiX.
+
+Revision 2.328 2002/09/18 20:01:28 set
+* Added: [Linux] driver documentation, this is a tricky driver and needs a
+lot of explanations. Isn't revised, it means it can contain all kind of
+stupid information ;-)
+
+Revision 2.327 2002/09/18 12:28:29 set
+* Fixed: [DOS] I restored the screen after releasing the memory used to
+hold the old content :-P it generated random artifacts in upper left corner
+of the screen at exit.
+* Added: [DOS] Two configuration options: SaveVGAState, it can be used to
+disable the VGA state save/restore mechanism. When disabled the support for
+restoring graphic modes is limited, but the simple text modes aren't
+affected. And another option called VGABIOSState disabling it (but not the
+other) the save/restore mechanism uses an internal routine I coded. This
+routine uses the VGA registers for it. This needs a 100% VGA compatible
+board or a Win32 driver that fully emulates a VGA board when running in
+Win32 environments.
+
+Revision 2.326 2002/09/17 13:00:29 set
+* Fixed: [MinGW] Some perl interpreter returns paths with back slashes and
+MSYS tools doesn't tolerate mixed slashes.
+
+Revision 2.325 2002/09/16 20:51:38 set
+* Added: [Cygwin] The X11 libraries seems to be linked statically and I
+don't know how to do it dynamically. It pulls various X libraries like
+Xt, SM and ICE. As a workaround I added them to the list of libraries. The
+demo compiles for Win32 using X11 driver!!
+
+Revision 2.324 2002/09/16 19:18:40 set
+* Modified: eliminated the direct use of alloca in C++ code. Now the code
+calls AllocLocalStr giving more chances to hide the implementation.
+* Modified: [MinGW] when version is >=2 I define alloca as __builtin_alloc.
+Looks like MinGW people didn't define alloca in headers, even when that's
+a builtin gcc "function". It isn't tested by I tried to strictly enclose it
+using __MINGW32_MAJOR_VERSION>=2. From a report by Igor Gnip
+<gnipi@digitalsystem.co.yu>.
+
+Revision 2.323 2002/09/16 15:55:20 set
+* Added: A new configuration option "DontMoveHiddenCursor". It disables the
+Braille Terminal helper in favor of speed.
+
+Revision 2.322 2002/09/16 15:34:18 set
+* Modified: The cursor behavior to help "Braille Terminals". Now the cursor
+is moved even when it isn't visible. This is complemented with this patch
+from Tapio.
+
+Revision 2.321 2002/09/16 14:48:53 set
+* Fixed: Our TV includes TFileViewer in the library so I also fixed the
+delta bug there.
+
+Revision 2.320 2002/09/16 14:39:40 set
+* Fixed: The file viewer of the demo program didn't initialize the delta
+member generating aleatory memory corruptions. Seen on Cygwin and MinGW.
+
+Revision 2.319 2002/09/16 14:34:39 set
+* Modified: [WinGr] priority to be the second option until the driver is
+finished.
+
+Revision 2.318 2002/09/16 14:33:35 set
+* Fixed: [CygWin/MinGW] Both of them needs libgdi32 for the new WinGr
+driver.
+
+Revision 2.317 2002/09/16 14:31:58 set
+* Removed: The .mak files named in "lista" they are added by the
+compression script.
+
+Revision 2.316 2002/09/16 14:31:19 set
+* Fixed: [X11] When resizing the font I informed to the WM about the new
+cell size but I forgot to inform about the new minimal size. At least
+Enlightenment took it in a very funny way: computed the minimal size + the
+delta multiplied by the new cell size. It generated a negotiation between
+the application and the WM to converge in a wrong size.
+* Added: [X11] Information about the base size. At least E uses it to
+inform the window size in cells. If we don't set it the size reported is
+the current size minus the minimal size (40x5 for 80x25).
+* Added: More documentation to the X11 driver doc.
+
+Revision 2.315 2002/09/16 14:30:33 set
+* Added: [XTerm] A new configuration option called "UseShellScreen". It
+could help if someday we compile an RHIDE with TV 2.0.0 and want to use it
+running on a XTerm/Eterm.
+* Added: XTerm driver documentation and corrected some Eterm details.
+
+Revision 2.314 2002/09/16 14:29:41 set
+* Added: [XTerm] Support for "application mode" keys (4 arrows, home and
+end). Also modified the Xterm.res script to use them. These keys works ok
+for bash (readline) and mc (slang?).
+* Added: [XTerm] A correct color palette to the Xterm.res script the one
+used by xterm in my system doesn't match VGA BIOS.
+
+Revision 2.313 2002/09/16 14:28:55 set
+* Added: Eterm driver information to "doc" directory.
+* Modified: The Eterm theme and moved to an independent directory. Is quite
+functional.
+* Fixed: [Eterm] The SetWindowTitle() methode is not the same as used by
+XTerm.
+* Fixed: [Eterm] GetCurrentFontName() doesn't work on Eterm, must return
+error. If I don't do it Eterm thinks I want to set a font called "?".
+
+Revision 2.312 2002/09/16 14:26:33 set
+* Added: Experimental support for X11 under Win32. I just enabled the code
+for Cygwin, isn't tested.
+
+Revision 2.311 2002/09/16 14:25:07 set
+* Modified: [UNIX] now the priority for linking the examples is: (1)
+installed libraries, (2) compiled dynamic and (3) compiled static. It
+implies the user must install the libraries if s/he had an old version
+installed. But this is the standard procedure. The advantage is smaller
+examples and at the same time you can test small changes without linking
+the examples again and again, even without installing using LD_LIBRARY_PATH
+* Removed: redundant argument of the configure script.
+* Modified: the help of the conf. script, now is easier to find what you
+want.
+* Added: a configuration option to install the dynamic libraries without
+running strip.
+* Fixed: [Linux] the driver always *must* detect the code pages to use them
+as defaults, it can't be skiped.
+
+Revision 2.310 2002/09/13 18:55:58 set
+* Modified: [X11] Now the busy indicator shape is just XC_watch by default,
+using a configuration variable you can select Roman's cursor. Suggested by
+Ivan to allow better integration with the desktop.
+
+Revision 2.309 2002/09/13 17:04:17 set
+* Fixed: X11 detection mechanism. It failed for Darwin.
+* Fixed: other small configuration detail seen on Darwin.
+
+Revision 2.308 2002/09/13 12:26:29 set
+* Modified: [DOS] The mouse handler un/hook methode. I got nasty GPFs with
+the old code. I also disabled some code in TVApplication that shouldn't
+be there. Some problems still there.
+
+Revision 2.307 2002/09/13 12:25:02 set
+* Fixed: The dummy international library used "gcc" inconditionally. Now is
+configured.
+* Added: Support for ranlib separated of ar. Darwin seems to have a POSIX
+ar that doesn't support -s, untested.
+* Added: -Wno-long-double option when Darwin is detected.
+* Added: Defaults to the AlphaTable, toLowerTable and toUpperTable tables.
+In this way they can be used before initialization when we just need ASCII
+information.
+
+Revision 2.306 2002/09/12 21:08:56 set
+* Fixed: XTerm driver needs UNIX mouse code, changed conditionals.
+
+Revision 2.305 2002/09/12 21:03:42 set
+* Fixed: XTerm driver included an uneeded ncurses header.
+
+Revision 2.304 2002/09/12 21:00:03 set
+* Modified: The UNIX driver headers to be excluded if ncurses isn't
+available.
+
+Revision 2.303 2002/09/12 20:51:22 set
+* Modified: The configuration and code to make the UNIX driver optional.
+
+Revision 2.302 2002/09/12 19:34:15 set
+* Added: Spanish translations for most of the TV messages.
+
+Revision 2.301 2002/09/12 18:10:32 set
+* Added: A correct "default code page" mechanism to DOS, Linux, QNX, UNIX,
+Win32, WinNT, X11 and XTerm. WinGr needs more things and this isn't
+currently appliable.
+
+Revision 2.300 2002/09/12 01:13:13 terrible
+* Fixed: [X11] Release X11 resources on driver destruction.
+* Updated: Debian packaging to version 2.0.0-0.5.
+
+Revision 2.299 2002/09/11 18:50:26 set
+* Added: __ppc__ as a PPC identifier
+
+Revision 2.298 2002/09/11 18:25:17 set
+* Added: Darwin to the list of known OSs, is just to test.
+* Verified compilation and functionality for:
++ Debian GNU/Linux 3.0 Alpha EV67 (Tsunami Catamaran) COMPAQ AlphaServer
+DS20E 666 MHz.
++ Debian GNU/Linux 3.0 PPC 604ev5 (MachV) CHRP IBM,7043-150.
++ Debian GNU/Linux 3.0 SPARC Ultra60 TI UltraSparc II (BlackBird) Spitfire
++ Solaris SunOS 5.8 Sun E220R.
+All using xterm+ssh started with the script found in examples/xterm.
+
+Revision 2.297 2002/09/11 16:46:24 terrible
+* Fixed: XOpenDisplay should receive NULL instead of "".
+
+Revision 2.296 2002/09/11 16:20:13 set
+* Fixed: TCommandSet handles 32 bits values but defined them as "unsigned
+long", they are 64 bits in Alpha machines.
+
+Revision 2.295 2002/09/11 15:04:59 set
+* Fixed: [Linux] TDisplayLinux::GetCursorShapeMDA undefined for non x86
+platforms.
+
+Revision 2.294 2002/09/11 12:54:54 set
+* Added: isLower, isUpper and isAlNum to TVCodePage.
+
+Revision 2.293 2002/09/10 20:36:52 set
+* Fixed: The colors dialog used TEvent´s infoByte field, but it was loaded
+from an unsigned value. This is OK for little endian, but in big endian
+machines doesn´t work. I removed all the infoByte code and replaced it by
+infoLong usage loading with long values.
+
+Revision 2.292 2002/09/10 20:14:21 set
+* Added: Support for endian differences in font files. Now the fonts can
+be generated using little or big endian machines, the loading routines
+detects it and does the needed conversions. Tested on Solaris (in fact I´m
+using the fonts with SETEdit to write it, the editor is running on an Ultra
+60 machine and the output is in mine Linux box :-)
+
+Revision 2.291 2002/09/09 13:31:35 set
+* Fixed: The wheel increment wasn't setup for scroll bars loaded from disk.
+Currently they are just setup with the default value to avoid breaking the
+compatibility with all programs.
+
+Revision 2.290 2002/09/06 18:26:15 set
+* Added: Mouse wheel support to TScroller.
+
+Revision 2.289 2002/09/06 17:56:16 set
+* Fixed: TFileList used an ole methode to determine if the shift key was
+pressed. Reported by Ivan.
+
+Revision 2.288 2002/09/06 14:22:13 set
+* Added: Workaround for broken KOI8-R systems (looks that's the most common
+case) where the SFM and ACM doesn't use Unicode, or uses Unicode mixed with
+KOI8. Also added the test data.
+
+Revision 2.287 2002/09/06 00:08:13 terrible
+* Updated: Debian packaging to version 2.0.0-0.4.
+* Note: it seems that the library is binary compatible with the 0.3 version,
+interesting!
+
+Revision 2.286 2002/09/04 20:25:23 set
+* Modified: The messageBox now temporally disables the "busy indicator".
+* Fixed: [X11] The busy indicator didn't flush the X commands.
+
+Revision 2.285 2002/09/04 15:30:22 set
+* Fixed: TInputLine must let pass kbEnter and kbTab no matters what ASCII
+they contain. Currently when the input code page doesn't match the
+application code page Enter and Tab can contain ASCII values over 32.
+* Fixed: [Linux] OS code pages are detected not only when App and Scr
+aren't forced, this is computed when any of them is missing.
+
+Revision 2.284 2002/09/04 13:11:34 set
+* Added: Insert with middle button to the TinputLine class. It works for
+any OS supporting an auxiliar clipboard. Currently that's only for X11. To
+achieve it I added a new member called insertChar and another called
+makeVisible. They reuse the keyboard char input code.
+
+Revision 2.283 2002/09/03 13:44:24 set
+* Fixed: TVConfigFile::AddString added integers, I found it when the editor
+failed to set the palette as a string ;-)
+
+Revision 2.282 2002/09/02 13:52:37 set
+* Fixed: Various code page and font details to avoid problems in case of
+fails.
+* Fixed: [X11] the default font shouldn't be replaced by the ones from the
+application and they must be freed.
+
+Revision 2.281 2002/09/02 13:51:48 set
+* Added: [DOS] BIOSKey configuration option.
+
+Revision 2.280 2002/09/02 13:50:46 set
+* Fixed: [WinGr] When I patched the code to avoid the unsigned use as
+signed in setCharacters I didn't noticed JASC was using it to force a
+redraw. So now I replaced the hiden trick using an explicit variable.
+
+Revision 2.279 2002/08/29 20:45:44 set
+* Fixed: [Win32] wingrdis needed stdlib to compile using MinGW. I noticed
+I must add gdi32 library, but is 1 AM and I'm really tired. It only
+compiles the BC++ 5.5 and MinGW executables crash.
+
+Revision 2.278 2002/08/29 20:44:42 set
+* Fixed: [Win32] various warnings and errors reported by BC++ 5.5 in the
+new driver. One of them was a real error (use of an unsigned value as
+signed). I didn't test functionallity, just compilation.
+
+Revision 2.277 2002/08/29 20:43:34 set
+* Added: The new WinGr driver to the DOS, Win32 BC++ and Win32 MSVC
+makefiles.
+* Fixed: A couple of compilation details under DOS.
+
+Revision 2.276 2002/08/29 20:40:20 set
+* Added: showBusyState member to TScreen. That's a way to show the user
+some kind of feadback when the application is busy. Currently only the
+X11 driver implements it showing a different mouse cursor. The idea and
+the X11 code was contributed by Roman Valyushenko.
+* Added: example on how to use it and also window title and code page
+examples to the progress bar example.
+
+Revision 2.275 2002/08/29 20:39:00 set
+* Added: Thanks to JASC for the new driver.
+* Added: The new files to the distribution.
+* Added: [Linux] More debug information to the code page autodetection. It
+is currently broken and I don't know if it will work, looks like Linux
+kernel doesn't offer the needed information (broken by design).
+* Modified: The cyrillic test to bypass the autodetection.
+
+Revision 2.274 2002/08/29 20:36:23 set
+* Added: JASC code to the Linux make process. Also modified the code a
+little bit to generate the propper dependencies when compiled under other
+platforms.
+
+Revision 2.273 2002/08/28 13:50:45 domatlantida
+* Added: WinGr driver. It isn't integrated to the make process yet. The
+author is JASC (domatlantida). But this check-in is being done by set using
+domatlantida user until JASC solves your CVS setup problems.
+
+Revision 2.272 2002/08/27 17:20:09 set
+* Added: [X11] An option to avoid adjusts in the window size when the WM
+doesn't follow our hints. Roman Valyushenko discovered problems using KDE
+3.1 alpha, it sends sizes that aren't fontW/fontH multiples and when we
+resize the window KDE gets confused. This option can be used to disable
+this behavior.
+
+Revision 2.271 2002/08/26 15:35:24 set
+* Modified: Moved a code page struct definition that was in the code to the
+header. It workarounds a bug in Borland's debugger reported by Pawel
+Wypustek <pawel@pako.pl>.
+
+Revision 2.270 2002/08/26 13:36:41 set
+* Added: A callback to TDisplay. Is called when the driver was detected but
+not yet initialized. I need it to set some defaults in SETEdit without
+wasting time doing it for all the possible drivers.
+* Added: A TDisplay member that return information about known DOS modes.
+* Added: [DOS] ExtProgVideoMode and VideoMode configuration variables. *Not
+tested*.
+
+Revision 2.269 2002/08/26 13:35:58 set
+* Added: atReplace to the TNSCollection class.
+* Added: "Add" facilities to the TVMainConfigFile class.
+* Added: TDisplay::getDefaultPalette() to find what's the default palette.
+
+Revision 2.268 2002/08/26 13:35:29 set
+* Added: The test code I use for Linux/Console cyrillic support.
+
+Revision 2.267 2002/08/23 14:46:34 set
+* Added: [X11] min. size hints. KDE and E 0.16.5 supports it. Patch by
+Roman Valyushenko <smhs@mail.ru>.
+* Fixed: [X11] mouse coordinates from X can be negative, we use unsigneds
+and hence they appear like huge positives. Patch from Roman Valyushenko.
+* Added: [X11] the cursor disapears when the window lose the focus. It can
+be disabled using the HideCursorWhenNoFocus configuration variable. Patch
+from Roman with some modifications for the configuration from me.
+
+Revision 2.266 2002/08/23 12:30:55 set
+* Fixed: [XTerm] an extra declaration for UserStartPallete, how this got
+there? Reported by Roman Valyushenko <smhs@mail.ru>
+
+Revision 2.265 2002/08/22 18:30:45 set
+* Modified: [Linux] The last patch to report the ASCII only if that's >=
+128. I think that's necesary to understand Alt+cyrillic.
+
+Revision 2.264 2002/08/22 18:29:44 set
+* Fixed: Write pass 1 error in configfile.cc. Detected with efence while
+using SETEdit.
+* Added: Configfile members to search strings to match the integer
+facilities.
+* Added: DOS, Linux, X11 and XTerm/Eterm drivers now supports setting a
+default palette in the tvrc file. The Eterm is really slow and flickers
+when we set the palette :-(. DOS is untested.
+* Fixed: [Linux] keys reported as Alt+key from ESC+key now doesn't have
+an associated ASCII.
+
+Revision 2.263 2002/08/21 12:50:59 set
+* Fixed: [Win32] unsigned/signed comparisson. Patch by Igor.
+
+Revision 2.262 2002/08/20 19:49:28 set
+* Fixed: [Win32] The call to _sleep is deprecated according to Igor, so I
+replaced it by CLY_YieldProcessor, it calls to Sleep (Win32 API). From a
+report by Igor Gnip <gnipi@digitalsystem.co.yu>
+
+Revision 2.261 2002/08/20 14:18:40 set
+* Added: Code page configuration to the DOS, Linux, QNX, UNIX, Win32,
+WinNT, X11 and XTerm drivers using the tvrc.
+* Added: The priority concept to the TVConfigFile class, it allows setting
+variables with more or less priority than the ones loaded from disk.
+* Modified: Now is possible to create a TVConfigFile class before TProgInit
+is called and put some default values there before the tvrc is loaded.
+
+Revision 2.260 2002/08/16 13:06:13 set
+* Fixed: DOS, WinNT and Win32 drivers, last changes were incomplete.
+
+Revision 2.259 2002/08/16 12:58:55 set
+* Modified: [MSVC] the way I define close, open, etc. replacements. The
+inline keyword only works for C++ and I must use __inline. I also moved
+the definitions after io.h to have the _* prototypes. From errors sent by
+WintiX.
+
+Revision 2.258 2002/08/14 12:55:29 set
+* Fixed: genraw example created a TVCodePage object without specifying the
+input code page. Reported by Igor Gnip <gnipi@digitalsystem.co.yu>
+
+Revision 2.257 2002/08/13 13:49:47 set
+* Fixed: I forgot to include the videomode example in the distribution list
+
+Revision 2.256 2002/08/13 13:37:48 set
+* Fixed: The TDrawBuffer patch tested in the wrong order generating more
+problems than the avoided =-P
+
+Revision 2.255 2002/08/13 13:37:06 set
+* Fixed: TVFontCollection didn't initialize fontName and fileName if the
+font wasn't loaded generating a SIGSEGV when destroying the object.
+* Fixed: A read past 1 in TDrawBuffer for TFrames. I added code to
+TDrawBuffer to check for the EOS instead of fixing TFrame. Detected with
+efence, a read past one is hardly dangerous in real life.
+* Fixed: [Linux] the driver failed to copy the Linux font when only setting
+the secondary font.
+* Fixed: [MSVC] the _read, _write, etc. macro replacements expanded for
+members called read, write and close generating problems. I replaced them
+using inline functions. I hope it solves some compilation problems reported
+by WintiX.
+
+Revision 2.254 2002/08/12 17:52:52 set
+* Fixed: Example target for helpdemo is helpdemo and not test. Patch by
+Igor Gnip <gnipi@digitalsystem.co.yu>
+
+Revision 2.253 2002/08/12 17:47:12 set
+* Fixed: [MinGW] GNU install doesn't support mixed \ and /. Patch by Igor
+Gnip <gnipi@digitalsystem.co.yu>
+* Fixed: [MinGW] some examples uses usleep and it isn't provided by MinGW.
+Added a macro to compatlayer.h. Igor Gnip <gnipi@digitalsystem.co.yu>
+
+Revision 2.252 2002/08/12 16:25:04 set
+* Added: [DOS] Support for the setCtrModeRes member. It searchs the closest
+mode available. I also tested VESA modes successfuly.
+
+Revision 2.251 2002/08/12 16:07:09 set
+* Added: X11, Linux and DOS drivers now tests if the font callback is
+installed. In this case these drivers tries to use an application font
+before start drawing. Untested.
+* Added: FontWidth and FontHeight configuration variables. Supported by
+X11 and XTerm drivers. XTerm tries to use a fixed font from a list of
+known XFree86 fixed fonts. X11 tries to get a font from the callback or
+use 8x16/10x20 internal fonts.
+
+Revision 2.250 2002/08/12 16:05:49 set
+* Added: 2 new configuration variables: ScreenWidth and ScreenHeight. I
+added support for it to the X11, XTerm, DOS, Win32 and WinNT drivers, but
+only tested the first 2.
+* Modified: Now if a variable search in a driver section fails a new search
+in the "global" TV section is done. It allows creating default values for
+all drivers.
+
+Revision 2.249 2002/08/12 16:04:31 set
+* Added: A TScreen methode to find the short name of the current driver.
+
+Revision 2.248 2002/08/12 16:03:41 set
+* Added: Input code page. It can be used to translate the codes from the
+keyboard to the application code page.
+* Modified: All drivers to set the input code page. Win32 drivers now use
+both values GetConsoleOutputCP() and GetConsoleCP().
+
+Revision 2.247 2002/08/12 16:02:27 set
+* Added: Yet another flag to TScreen: noUserScreen(). It returns True if
+the user screen doesn't exists. You can't invoke a shell in this case.
+* Added: A new command cmCallShell. It should be used for the menu option
+that invokes a shell. It is disabled if noUserScreen() is True.
+* Modified: tvedit, videomode, demo and font examples to use the new
+command.
+* Fixed: [XTerm] the resume restore the window size wrongly (width and
+height exchanged).
+* Added: [X11] The new flag. Currently that's the only driver having it.
+
+Revision 2.246 2002/08/12 16:00:19 set
+* Fixed: [Cygwin] The CLY_GetShellName() function to return the content of
+SHELL environment variable as in UNIX. Found using the "videomode" example
+while testing with Cygwin, now the "Shell" option works ok.
+
+Revision 2.245 2002/08/12 15:58:18 set
+* Fixed: [Win32] Configuration script didn't create compat/rhide.env.
+* Fixed: [Win32] Not all the screen was updated after a window resize.
+Found using the "videomode" example with a binary compiled with MinGW.
+
+Revision 2.244 2002/08/12 15:56:51 set
+* Added: An example showing how to set the screen/window size using video
+modes and resolutions.
+* Added: A new TScreen flag to know if the driver supports video mode
+change.
+* Fixed: [DOS] The extended video modes needs mode recalculate, so now the
+set font function when we specify Force also force a mode recalculate.
+
+Revision 2.243 2002/08/12 15:53:29 set
+* Fixed: The names of CP 1254 and 1257 from Win32 API.
+* Fixed: [Win32/WinNT] Use of True/False instead of TRUE/FALSE (cosmetic).
+* Added: [Win32/WinNT] Support for code pages. But not all the code pages
+are supported by TV.
+* Fixed: [Win32/WinNT] Cursor problems related to the new code.
+* Added: [Win32/WinNT] More comments about problems I found. Also added the
+list of code pages that Win32 API reference says we can find and which are
+supported by TV.
+
+Revision 2.242 2002/08/12 15:49:19 set
+* Fixed: [Win32/WinNT] The mouse didn't resume. (Missing mouse after
+returning from a shell)
+* Fixed: Useless code in fontcoll.cc, reported by BC++.
+* Modified: [Win32/WinNT] I rewrote the whole suspend/resume stuff. Now I
+use a separated screen buffer for the application. It makes the screen/
+cursor much more easy. Pro: this mechanism is really good and is a good
+thing in the Windows API. Contra: I'm facing some bizarre problems with
+Windows screen updates, most probably is partially my fault, but it exposes
+some Windows bug.
+* Added: [Win32/WinNT] Debug helpers to the TSscreen* classes. Lamentably
+the free Turbo Debugger can't even load the debug information of TV
+applications (not enough memory). Is amazing that a debugger that can debug
+Windows applications have such a huge limitation.
+* Modified: [Win32/WinNT] To check for successful initialization. According
+to Win32 API references some trivial operation can fail and must be tested.
+* Added: [Win32] Code to avoid ^Break. I copied Anatoli's code found in
+WinNT driver.
+* Added: [Win32/WinNT] Windows resize! now you can specify a 90x30 video
+mode and the window will try to resize to it (or the closest size available)
+Lamentably in Win32 you don't have control over the font used by a console
+application :-(
+* Fixed: [Win32/WinNT] The initialization of the drivers didn't indicate
+the application wasn't suspended. It produced problems when
+suspending/resuming to a shell.
+* Added: [Win32/WinNT] Example on how to change the video mode to tvex.cc.
+
+Revision 2.241 2002/08/12 15:44:08 set
+* Fixed: Extra stdio include in TProgram, used for debug.
+* Fixed: The fonts example to remove debug tests.
+
+Revision 2.240 2002/08/12 15:42:33 set
+* Added: A new member to TDisplay: setCrtModeRes. It allows setting the
+video mode specifying the resolution instead of a magic mode number.
+Also added the TScreen::setVideoModeRes counterpart.
+* Added: The default setCrtMode member now translates the DOS modes into
+a width and height and calls to setCrtModeRes. In this way X11 and XTerm
+video drivers can adjust the window size to the spected size.
+* Modified: When we detect an asynchronous mode change the TProgram class
+sets the video mode to the current one. This generates conflicts so now it
+sets the mode to 0xFFFF and it means reset the variables but don't change
+the mode.
+* Added: A member to TProgram to access the new TDisplay functionality.
+* Added: [DOS] Support for 80x50x8x8 mode as defined in Borland TV 2.0
+(mode 0x100). But isn't recommended.
+* Added: [XTerm] Support to the new TDisplay member. The window size is
+adjusted to the desired size. I also added font size adjust, it looks for
+the closest XFree86 font and selects it. XFree86 4.1.0 have 13 fixed fonts.
+Also added font size and window size suspend/resume. Eterm 0.9.2 doesn't
+implement the mechanism to find the current font so the size isn't
+restored.
+* Added: [X11] Support to the new TDisplay member. It calls the font call
+back to get a new font if the size of the font is changed in the call.
+* Added: Symbolic names to all the DOS text modes.
+* Modified: The font test program to use the symbolic names and added a
+couple of examples that sets a video mode using the number and a
+resolution.
+
+Revision 2.239 2002/08/12 15:40:18 set
+* Fixed: TVFontCollection::EnlargeOne to avoid SIGSEGVs (only detected with
+efence). I also changed the strategy to repeat the last line.
+* Modified: The sizes of the fonts in the list to offer to the user now
+uses a special collection to keep the list well sorted (first by width and
+then by height).
+* Modified: [X11] The minimum width and height of fonts reported by the
+driver. Now that's 5x7, I did it because now I have an SFT with such a
+fonts. They are too small to be usable, but could be used to "minimize"
+an application or maybe to use in a device like a palmtop, how knows?
+
+Revision 2.238 2002/08/12 15:39:02 set
+* Added: Some documentation about the SFT format in fontcoll.cc.
+
+Revision 2.237 2002/08/12 15:38:10 set
+* Added: Some preliminary support for SFT files containing just a range
+of the supported symbols.
+
+Revision 2.236 2002/08/12 15:37:11 set
+* Fixed: The font request call back naturally should use GetFont(), it
+returns a newly allocated memory block so is better to do all dynamic. It
+means DOS driver must free the requested font.
+
+Revision 2.235 2002/07/30 17:44:19 terrible
+* Updated: Debian packaging to 2.0.0-0.3.
+* Modified: my email changed from lubaldo to ibaldo.
+* Broked: everything, this is a sabotage!, SET is on vacations!!!
+
+Revision 2.234 2002/07/25 17:24:23 set
+* Fixed: [DOS] The 90x34 and 94x34 video modes uses 14 lines fonts but
+didn't set it into the BIOS DATA AREA, for this reason some BIOSes didn't
+show the cursor.
+
+Revision 2.233 2002/07/24 19:57:02 set
+* Modified: Part of the font settings API, now you can set both fonts in
+one call. Modified for X11, Linux and DOS. Tested for X11 and Linux.
+* Fixed: [X11] various bugs with the cursor that appears when: a) you
+change the font size and b) you use 2 fonts.
+* Added: A message to the font example to explain a fail to set a secondary
+font that have a size that doesn't match the primary font.
+
+Revision 2.232 2002/07/23 12:27:50 set
+* Fixed: Lack of Uses_limits in fontcol.cc.
+
+Revision 2.231 2002/07/23 12:27:14 set
+* Fixed: getopt changes were incomplete.
+
+Revision 2.230 2002/07/22 20:40:53 set
+* Added: [MSVC] some code to solve link problems.
+
+Revision 2.229 2002/07/22 19:35:06 set
+* Updated: fontcoll.cc dependencies.
+
+Revision 2.228 2002/07/22 19:34:17 set
+* Added: New methods to TListBox that allows setting a new list without
+destroying the one currently used.
+* Updated: MSVC and BC++ makefiles.
+
+Revision 2.227 2002/07/22 19:33:25 set
+* Added: Mechanisms to list the available fonts from a directory and create
+dialogs with it (collection and list box for the structure).
+* Modified: TSortedListBox::getKey to be protected and not private. No
+special reason but I think that's better.
+
+Revision 2.226 2002/07/22 19:32:26 set
+* Modified: [Linux] code 30 to be the "enter" symbol and not V/T.
+* Fixed: [Linux] ISO-1 code page to differentiate 160 from 32. This isn't
+important nor used but I think that's better.
+* Modified: Clarified the error that Linux code pages contain about the
+double frames. I confirmed that's an error.
+* Added: Support for font width to .SFT format.
+* Added: Support fot width>8 in TVFontCollection.
+* Modified: [X11] Removed the 12x24 font and put a nice 10x20 font I
+created using the 10x20.pcf included in XFree86 plus some modifications.
+This font is simple but quite nice.
+* Added: [X11] A Font10x20 configuration option to select the new font.
+* Added: [X11] Support for setfont with widths greater than 8. Is
+incomplete and untested.
+* Added: Support for width>8 to the genraw.cc example. Also added optional
+code to generate headers intead of raw fonts (used for the X11 driver ;-)
+
+Revision 2.225 2002/07/22 19:18:40 set
+* Modified: The Uses_getopt now defines CLY_* names, so you must use
+CLY_getopt, etc. It avoids all kind of coliisions. QNX is an example. Looks
+like they have a getopt function but not getopt_long and our definition
+collides. Reported by Mike.
+
+Revision 2.224 2002/07/19 20:01:14 set
+* Added: [X11] Support for fonts with width > 8 pixels. For testing
+purposes I added a 12x24 font. The code can be compiled to use it.
+
+Revision 2.223 2002/07/19 14:02:28 set
+* Updated: DOS project.
+* Fixed: Compilation of dosscr.cc, I forgot one debug macro.
+
+Revision 2.222 2002/07/17 17:14:49 set
+* Added: TVFontCollection class. It handles 8xN bitmap fonts. Also added
+an example.
+
+Revision 2.221 2002/07/17 12:27:19 set
+* Added: Options to compile the DOS+WinOldAp clipboard routines with a lot
+of verbosity. It looks like the code is failing in Win2K and I need to
+test it.
+
+Revision 2.220 2002/07/16 19:22:00 set
+* Added: Default code page concept.
+* Fixed:(?) Remapping problem when the "similar" was outside the ASCII
+range.
+* Fixed: IndexToID was wrongly implemented.
+* Added: TButtonRef, a button that just uses a reference to the "title".
+* Modified: TScrollbars, they are now less configurable but doesn't fail
+when remapping the screen.
+
+Revision 2.219 2002/07/15 15:16:40 set
+* Modified: The TVCodePage semantics. Now is more clear. I hope it doesn't
+break the code ;-).
+
+Revision 2.218 2002/07/15 15:13:38 set
+* Added: A mechanism to allow applications to provide a new font when the
+one currently in use doesn't match a new video mode.
+
+Revision 2.217 2002/07/15 15:09:47 set
+* Modified: Removed the TFont class. Now this functionallity is in TScreen.
+May be I'll add more things to make it as flexible as this class.
+* Added: [DOS] Font restore on suspend and resume. Also after a change in
+video mode.
+* Added: Shell example to the font's example, it is good for testing the
+fonts suspend/resume behavior. Also added a video mode change when
+compiling for DOS. Also good for testing.
+
+Revision 2.216 2002/07/11 19:11:35 set
+* Fixed: [MSVC] more compatlayer issues, added pclose and pipe, commented
+utime macro, etc. From SETEdit compilation errors sent by WintiX.
+
+Revision 2.215 2002/07/10 19:23:11 set
+* Added: [FreeBSD] Code to solve the "last line problem". It was suggested
+by Mike and should be tested by miniEleph.
+
+Revision 2.214 2002/07/08 15:41:08 set
+* Added: [MSVC] A lot of translations to MSVC library names. Most of the
+POSIX low level stuff (open, close, etc.) exists in MSVC but the names are
+changed to _*, may be Microsoft thinks that POSIX is polluting the ANSI
+namespace ;-). From output sent by WintiX.
+
+Revision 2.213 2002/07/05 20:28:18 set
+* Added: [MSVC] More compatlayer entries for __inline__, utime and opendir.
+
+Revision 2.212 2002/07/05 13:08:46 set
+* Fixed: GetCodePage, currently it have some complexity that may be is
+better to remove.
+* Modified: TDesktop to remap background character after a code page
+change. Not sure if that's the best.
+* Added: [DOS] partial font support. I copied the code I had in TFont and
+adapted it. More things must be adjusted, TFont removed and add some font
+restore at exit/suspend. The example works.
+
+Revision 2.211 2002/07/04 20:09:59 set
+* Modified: [BC++/MSVC] these compilers doesn't use the configuration
+mechanism instead a custom configtv.h is used. I unified it for both
+compilers.
+
+Revision 2.210 2002/07/04 19:10:04 set
+* Removed: [DOS] old reference code for code page support.
+
+Revision 2.209 2002/07/04 19:09:16 set
+* Added: [DOS] Code page detection and setting.
+* Modified: [DOS] The clipboard code to be easier to understand.
+
+Revision 2.208 2002/07/03 15:51:00 set
+* Added: Information about which Win32 compilers are supported to the web
+page.
+* Added: WintiX to the list of contributors.
+
+Revision 2.207 2002/07/03 15:40:54 set
+* Modified: [MSVC] tvex.exe to tvex targetname as suggested by WintiX.
+
+Revision 2.206 2002/07/03 15:39:44 set
+* Modified: [Win32/WinNT] to detect how many buttons have the mouse.
+Lamentably it isn't reliable at all. My mouse generate mouse events when
+the middle button is pressed, but Windows insists that's a 2 buttons mouse.
+I also strange that IE supports the wheel, the help viewer don't and the
+wheel doesn't generate mouse events ... really strange. May be Win98 SE is
+tool old to support mouse wheels properly.
+
+Revision 2.205 2002/07/03 15:38:47 set
+* Added: [DOS] PollMouse option to the tvrc to force mouse polling.
+
+Revision 2.204 2002/07/02 20:51:50 set
+* Fixed: [X11] Button 4 and 5 support. Now SETEdit supports mouse wheel ;-)
+
+Revision 2.203 2002/07/02 19:16:38 set
+* Added: [MSVC] A rule to create a demo application to the makefile. WintiX
+generated a demo application successfuly!
+
+Revision 2.202 2002/07/02 19:06:16 set
+* Fixed: [Linux] Disabled code in dual.cc, this file must be removed.
+
+Revision 2.201 2002/07/02 18:14:18 set
+* Fixed: dual.cc referenced dual_display that now is temporally inside
+TDisplay.
+
+Revision 2.200 2002/07/02 14:36:05 set
+* Fixed: [MSVC] a couple of warnings. From cl output sent by WintiX.
+
+Revision 2.199 2002/07/02 13:32:20 set
+* Added: [Linux] Font restore on suspend and set again on resume. Also
+handled console switch.
+* Added: [Linux] A configuration variable to enable the secondary font use.
+By default is disabled because Linux switchs to 8 colors.
+
+Revision 2.198 2002/07/01 19:08:31 set
+* Modified: Linux project and makefile and DOS files so DJGPP and Linux
+projects are more similar. Second step towards an unification.
+
+Revision 2.197 2002/07/01 15:58:20 set
+* Updated: [QNX] package file. From Mike.
+* Added: [QNX] small doc about the limitations. From Mike.
+
+Revision 2.196 2002/07/01 15:43:22 set
+* Updated: [MSVC] Makefile to include all the drivers directory. Problems
+reported by WintiX.
+
+Revision 2.195 2002/07/01 15:33:40 set
+* Added: A new example that shows how to use help context values and the
+status line. Ported by Mike.
+
+Revision 2.194 2002/07/01 14:26:11 set
+* Fixed: [X11] cursor artifacts intoduced in last patches.
+
+Revision 2.193 2002/07/01 13:02:47 set
+* Added: Font set/restore mechanism to TScreen.
+* Added: [X11] Full fonts support.
+* Added: [Linux] Partial fonts support, more things needs to be solved.
+* Added: A fonts test/demo example.
+* Added: GetCodePages call to memorize the current code pages in use.
+* Fixed: [X11] Initialization to allocate classHint, no fixed size, and to
+do it before indicating success.
+
+Revision 2.192 2002/07/01 12:57:39 set
+* Fixed: [X11] clipboard code.
+
+Revision 2.191 2002/07/01 12:53:39 set
+* Fixed: More error reporting details in all clipboard implementations.
+* Updated: [DJGPP+Win32] Project and makefiles.
+
+Revision 2.190 2002/07/01 12:49:03 set
+Revision 2.189 2002/06/29 20:11:05 set
+* Added: [Win32] Clipboard class.
+* Updated: [BC++] Makefile to include all the drivers.
+* Fixed: [DOS] Clipboard error reporting.
+
+Revision 2.189 2002/07/01 12:38:11 set
+* Added: [DOS] Windows clipboard routines.
+* Modified: The TVOSClipboard class to report the name of the error in case
+of fails and the size of the paste buffer.
+* Modified: All the drivers to generate dependencies when compiled for
+another platforms and protected the headers against use in other platforms.
+* Modified: [DJGPP] The project to also include UNIX drivers. That's an
+important step towards a project unification.
+
+Revision 2.188 2002/06/28 20:21:46 set
+* Fixed: [MSVC] More details, only 2 or 3 files needs adjustments to get
+the code compiled. Errors from WintiX.
+
+Revision 2.187 2002/06/28 20:06:30 set
+* Added: A new class called TVOSClipboard it gives access to the OS
+clipboard/s in a neutral way.
+* Added: [X11] code to use the XA_CLIPBOARD and XA_PRIMARY copy/paste
+mechanism through the new class. The first is clipboard 0 (recommended) and
+the second is the auxiliar mechanism that users should use with the middle
+mouse button.
+* Added: An example application that shows how to use the new class.
+
+Revision 2.186 2002/06/28 12:38:31 set
+* Added: A new capability flag to the drivers. It informs if a screen saver
+have any sense for this driver. Ivan remmembered it, a screen saver doesn't
+have any sense when we are working inside a window ;-)
+
+Revision 2.185 2002/06/27 20:52:22 set
+* Added: [X11] Explanation about WM/Desktop key conflicts to the mini doc.
+
+Revision 2.184 2002/06/27 20:36:58 set
+* Added: A doc directory and a file explaining implementation details of
+the X11 driver.
+
+Revision 2.183 2002/06/27 20:09:50 set
+* Modified: [X11] At least in my XFree86 (Debian GNU/Linux Potato) the Ctrl
++Space combination maps to a keycode 0x20 but none translated symbol. As a
+workaround I added a test for this. I also found that shift tab was mapped
+to something called ISO_left_tab but nothing was reported to the
+application. For this I modified X11 configuration files.
+* Removed gkey.gpr, it no longer works.
+
+Revision 2.182 2002/06/27 18:41:45 set
+* Fixed: [MSVC] ssize_t isn't defined by standard headers. I also unified
+the mechanism to request it because BC++ and MinGW doesn't define it as
+MSVC and each one used a different mechanism.
+* Fixed: [MSVC] The C flags to include the -I../include. Both fixes from
+the output of MSVC sent by WintiX.
+
+Revision 2.181 2002/06/27 18:24:26 set
+* Fixed: [MSVC] C code compile rule, patch from WintiX.
+
+Revision 2.180 2002/06/26 16:55:17 set
+* Updated: The Win32 headers, some how S.F. CVS got unsynchronized.
+* Fixed: getopt and getline to compile with MSVC from output errors
+provided by WintiX.
+* Updated: Makefiles. CVS users will need to reconfigure.
+
+Revision 2.179 2002/06/26 16:52:15 set
+* Fixed: [MSVC] which header is needed for access function.
+* Fixed: [MSVC] rules to compile .c files and use of rm. Reported by WintiX
+
+Revision 2.178 2002/06/26 15:17:11 set
+* Fixed: [Linux] When the VCS access wasn't available the routine that
+restores the screen content put 0x0 attributes in spaces after the text.
+They become invisible and what's worst the cursor is also invisible when
+positioned over such a character. Now the buffer is properly filled with
+the default color (7).
+
+Revision 2.177 2002/06/25 12:17:16 set
+* Fixed: The Help Compiler to compile with gcc 3.x, also fixed some bugs.
+
+Revision 2.176 2002/06/25 12:15:01 set
+* Added: [Linux] driver options to disable: keyboard patching (PatchKeys),
+VCS use (UseVCS) and MDA use (UseMDA).
+
+Revision 2.175 2002/06/24 19:39:04 set
+* Modified: [QNX] When linking the dynamic library -lncursesS should be
+used, explained by Mike.
+
+Revision 2.174 2002/06/24 19:31:00 set
+* Added: [QNX] Package description contributed by Mike.
+
+Revision 2.173 2002/06/24 15:17:42 set
+* Fixed: A typedef struct v.s. struct issue reported by gcc 3.1. Reported
+by Ortwin.Gasper@t-online.de.
+
+Revision 2.172 2002/06/24 15:10:44 set
+* Fixed: dlgdsn example to compile with gcc 3.1. Patch from Andris.
+
+Revision 2.171 2002/06/24 15:04:07 set
+* Modified: Removed linuxso/Makefile and linuxso/compat.mak, they are
+created by Perl scripts and UNIX targets should have Perl anyways.
+
+Revision 2.170 2002/06/24 15:02:54 set
+* Fixed: [BC++] details to cleanly compile with BC++ 5.5.
+
+Revision 2.169 2002/06/24 15:01:35 set
+* Modified: [DJGPP] to use /dev/env/DJDIR/etc as directory for
+configuration.
+
+Revision 2.168 2002/06/24 15:00:29 set
+* Fixed: A couple of errors in new classes exposed when compiling for
+djgpp.
+
+Revision 2.167 2002/06/24 14:59:25 set
+* Added: "Priority" variable to the configuration section of each driver.
+So now you can change the importance of each driver. The section names of
+the drivers are DOS, Linux, QNX, UNIX, Win32, WinNT, X11 and XTerm.
+
+Revision 2.166 2002/06/24 14:56:18 set
+* Added: A new class to manage a configuration file. Right now only one
+setting is accepted in this file: ShowCursorEver. See TVConfigFile in
+configfile.cc and TProgInit::config.
+
+Revision 2.165 2002/06/20 20:13:59 set
+* Fixed: CLY_GetDefaultFileAttr(CLY_mode_t *mode) for UNIX, it didn't set
+writemask making new files to look like R.O.
+
+Revision 2.164 2002/06/20 20:12:38 set
+* Added: A new flag to TScreen to indicate is the driver really supports
+setCursorShape or just can hide/show the cursor.
+
+Revision 2.163 2002/06/19 19:51:00 set
+* Fixed: [X11] The "show cursor ever" flag didn't work OK.
+
+Revision 2.162 2002/06/19 19:30:38 set
+* Fixed: Small issue about cursor positioning in TDesktop. Now is cleaner.
+
+Revision 2.161 2002/06/19 18:43:35 set
+* Modified: [WWW] The QNX port is now finished, added as available target.
+
+Revision 2.160 2002/06/19 17:10:12 set
+* Added: [Linux] support for russian keyboards when the encoding is KOI8.
+Alexey Godin gave me the information about the layout. I tested it using
+the koi8-r fonts and ru1 keyboard map in my system + a translation of the
+"File" menu and worked.
+
+Revision 2.159 2002/06/18 20:50:37 set
+* Added: TScroller and TScrollBar now cooperates with Braille Terminals.
+From suggestions by Tapio.
+
+Revision 2.158 2002/06/18 20:28:23 set
+* Added: [Linux] A comment about LANG variable. Sent by Alexey Godin.
+
+Revision 2.157 2002/06/18 16:41:24 set
+* Modified: [QNX] New batch of patches for the QNX console from Mike. This
+driver is now finished according to Mike.
+
+Revision 2.156 2002/06/18 14:51:16 set
+* Added: Code to remap characters on the fly. I rewrote the code in TView
+that sends the data to screen so it can remap characters before doing it.
+* Modified: As I was rewrinting the code in TView I changed it to avoid
+calling setCharacter which is much less efficient than setCharacters. Now
+I copy the text to a buffer and then I change the shadow attribute there.
+* Added: Euro sign support.
+* Added: Four latin 2 variants used in Linux.
+* Added: Now when you set the code page you can specify two code pages. One
+maps the font and the other the text handled by the user. This seems to be
+stupid but is needed to support Linux mechanism which works this way. If
+these code pages are different the code uses the on the fly remap.
+* Added: TVCodePage members to create a code page from an unicode array and
+to add it to the list of supported code pages.
+* Added: [Linux] Detection of the ACM. The user *must* use the correct ACM
+unless ISO 8859-1 is used or the ACM is trivial.
+
+Revision 2.155 2002/06/12 20:51:18 set
+* Added: Functions to map unicode into the internal code and more
+functionality to the code page debug stuff. With this I discovered that
+Potato not only have iso-latin1 damaged fonts but also latin2 damaged.
+
+Revision 2.154 2002/06/12 18:28:12 set
+* Modified: [Linux] GetCursorPos so if it gets a wrong escape sequence
+doesn't crash. From a report by Tapio.
+
+Revision 2.153 2002/06/12 18:01:27 set
+* Fixed: [Linux] the Resume member ever used the generic GetCursorPos
+instead of the driver selected version.
+
+Revision 2.152 2002/06/12 17:41:07 set
+* Added: Code to the TVDemo examples that shows how to use the TVCodePage
+class. It remaps the system menu label and the calendar arrows.
+
+Revision 2.151 2002/06/12 16:59:28 set
+* Fixed: The THWMouse class called GetEvent if the mouse wasn't present.
+This was the source of problems when switching consoles under Linux.
+
+Revision 2.150 2002/06/12 16:46:38 set
+* Modified: [X11] the driver now uses ISO-8859-1 fonts instead of PC437.
+
+Revision 2.149 2002/06/12 15:40:03 set
+* Added: [Linux] Code page detection to the driver. It needs console
+IOCTLs. If we can't use them the driver tries to guess using the LANG
+environment variable.
+* Added: Symbolic names for all the supported code pages.
+
+Revision 2.148 2002/06/12 12:34:12 set
+* Added: A first step towards Linux console code page detection. Curently
+the code only works for full console access and differentiates between
+lat1, lat1u and koi8-r code pages.
+
+Revision 2.147 2002/06/11 19:10:32 set
+* Fixed: [XTerm] Window title set/get details.
+
+Revision 2.146 2002/06/11 16:15:07 set
+* Fixed: [UNIX] ln error when overwriting the libtvfdummy.a link.
+
+Revision 2.145 2002/06/11 16:05:07 set
+* Fixed: [Solaris+XTerm] The termios MIN and TIME values have a default
+that isn't really good for interactive applications. Now I set to 0 both.
+With this I succesfully run the editor remotely with mouse and shift/ctrl/
+alt+key support.
+
+Revision 2.144 2002/06/11 15:09:25 set
+* Fixed: Missing \n after the tvfintl copy in generated makefile. Affected
+UNIX targets.
+
+Revision 2.143 2002/06/11 14:56:57 set
+* Fixed: [XTerm] The suspend member needed a flush, without it calling a
+shell didn't restore the shell screen.
+
+Revision 2.142 2002/06/11 14:34:29 set
+* Fixed: TEventQueue::resume() didn't indicate it was resumed if mouse
+initialization failed.
+* Fixed: [Linux] Suspend used the input before keyboard was resumed. Now
+the file handle used for input is ever in non-block mode. This isn't stdin
+so I think I can do it. From a report by Tapio.
+* Fixed: [Linux] The driver assumed that Gpm_close set gpm_fd to -1, is not
+true for GPM 1.17.8.
+* Fixed: [Linux] The mouse driver didn't set Suspend correctly.
+
+Revision 2.141 2002/06/11 12:15:07 set
+* Added: [XTerm] Alt+numbers to the Xterm example script.
+* Fixed: The screen.h doesn't have any relation with the original header
+from Borland, put it clear.
+* Fixed: [XTerm] the palette mechanism, now works and is faster.
+* Modified: [XTerm] the new XTerm uses ugly colors, forced PC BIOS colors
+because they are the colors used by Linux console, Eterm, X11 driver, DOS
+and Win32 versions.
+* Added: [XTerm] now the button shadows and color samples (reverse space)
+are closer to the original shapes.
+
+Revision 2.140 2002/06/10 20:59:42 set
+* Added: TVCodePage class. That's the first version of the codepage
+remapping routines.
+* Added: More key bindings to the Xterm.res example. They help with some
+xterm versions.
+* Modified: [XTerm] the driver to use a separated file handle for input.
+It solves interferences like in the Linux driver.
+* Added: [XTerm] Now the driver starts with ISO-8859-1 mapping so the
+frames and similar stuff aren't ugly anymore.
+* Added: A broadcast message cmUpdateCodePage to indicate a code page
+change.
+
+Revision 2.139 2002/06/10 13:24:06 set
+* Fixed: tvfintl must be used for the examples if no intl was found.
+* Fixed: We no longer need to patch vpath_src in .maks for Win32.
+* Modified: Now a copy of libtvfintl.a is put in the same directory where
+the librhtv.* is created, it helps applications like setedit that can use
+Turbo Vision even if not installed.
+* Fixed: [Win32] cursor driver issues.
+* Fixed: [WinNT] lack of stdlib include.
+* Fixed: [MinGW] it doesn't define ssize_t.
+* Modified: win32/readme.txt, I teste the library with MinGW 1.1+MSys 1.0.7
+and SiePerl, it works and I explain how to use it.
+
+Revision 2.138 2002/06/07 19:11:25 set
+* Modified: [UNIX] the configuration to test if the X11 include directory
+is really needed. It looks like gcc 3.1 gives a warning if this is manually
+specified. Is a test because I don't have gcc 3.1 for Linux. Reported by
+Andris.
+
+Revision 2.137 2002/06/07 18:13:40 set
+* Modified: [X11] Now after a draw the cursor becomes visible inmediatly.
+This is slower but increases the cursor visibility. Ivan reported problems.
+
+Revision 2.136 2002/06/07 15:46:21 set
+* Added: A first attempt to create a MSVC compatible makefile. WintiX
+<wintix@bk.ru> sent me the file and I added it to the configuration
+mechanism. In this way the list of object files is extracted from the
+RHIDE's .mak.
+
+Revision 2.135 2002/06/07 15:37:15 set
+* Fixed: [MSVC] Compatlayer getcwd request, from info by WintiX.
+
+Revision 2.134 2002/06/07 14:34:17 set
+* Fixed: xtmouse.h lack of new line at the end of file. Patch by Andris.
+* Test: Looks like some glibc 2.2.5 includes libintl.h without explicit
+request. It generates some conflicts. Here I include a possible workaround.
+Reported by Andris.
+
+Revision 2.133 2002/06/07 02:15:07 terrible
+* Updated: Debian packaging with small changes.
+
+Revision 2.132 2002/06/06 19:32:05 set
+* Fixed: The gcc 3.1 standard C++ streams doesn't define a public methode
+to open a stream from a C stream/file handle. It wasn't this way in 3.0 and
+3.1 pre-releases (which were supposed to be ISO C++ compliant). To overcome
+this problem I wrote a wrapper for std::filebuf. That's ultra compiler
+version specific and I don't know how many time will be supported. This
+idea was suggested by Andris. The modifications are small, but implied some
+work to understand how stdc++ works. BTW: stdc++ itself needs a similar
+trick for cout/cin associated with stdout/stdin ...
+
+Revision 2.131 2002/06/05 20:24:51 set
+* Fixed: The tutorial number 16 didn't initialize the data for one of the
+input line examples producing random garbage. Reported by Mike.
+
+Revision 2.130 2002/06/05 20:16:48 set
+* Added: [QNX] New patch from Mike to enhance the keyboard handling.
+* Fixed: TInputLine used an archaic ^Y hardcoded symbol instead of kbCtY.
+Patch by Mike.
+
+Revision 2.129 2002/06/05 15:28:38 set
+* Fixed: [X11] Now when the WM sends a DELETE_WINDOW message (usually
+because the user used the close button) the TV application gets a cmQuit
+event.
+
+Revision 2.128 2002/06/05 14:26:45 set
+* Added: Thanks to JASC in the X11 code, I think he deserves it.
+
+Revision 2.127 2002/06/05 14:17:50 set
+* Fixed: [X11] the driver didn't map ^a-^z, reported by Ivan.
+
+Revision 2.126 2002/06/05 14:16:40 set
+* Updated: Distribution files list to include update and THANKS.
+
+Revision 2.125 2002/06/04 19:39:41 set
+* Modified: Now the configuration determines the directories where extra
+libraries could be located and adds it to the list of directories.
+
+Revision 2.124 2002/06/04 18:34:40 set
+* Fixed: Another *.* pattern, reported by Tapio.
+
+Revision 2.123 2002/06/04 18:31:10 set
+* Fixed: [Linux] Now I use a separated file handle for the stdin. The
+explanation is in the code and is complex. Fixes random fails on cursor
+position restore at exit.
+
+Revision 2.122 2002/06/04 18:28:58 set
+* Fixed: When no window was in the desktop and a dialog was executed it
+left the cursor in the last used position. Now TDesktop detects it and
+if the cursor will remain visible is moved to the last line in the screen.
+
+Revision 2.121 2002/06/04 16:01:59 set
+* Fixed: demo file for QNX. When I moved includes to Uses_* forgot to
+include the config header. Reported by Mike.
+
+Revision 2.120 2002/06/04 15:45:22 set
+* Updated: The list of files to convert when using the UNIX tarball.
+
+Revision 2.119 2002/06/04 15:44:07 set
+* Modified: Now specialCharacters is part of the TView class and not just
+a variable. While we don't use namespaces I think we should try to avoid
+defining things outside classes if not necesary.
+
+Revision 2.118 2002/06/04 14:51:45 set
+* Added: THANKS file with the list of contributors, also updated the www
+site.
+
+Revision 2.117 2002/06/04 13:21:54 set
+* Modified: Added comments and removed dead code on the last changes.
+
+Revision 2.116 2002/06/03 20:56:23 set
+* Added: Now TDeskTop moves the cursor to the bottom of the screen when
+an object lost the focus and we are in the "Braille friendly" mode. Until
+now the changes are good according to Tapio.
+
+Revision 2.115 2002/06/03 19:42:24 set
+* Fixed: [Linux] The Resume member needed a fflush before calling a child
+process (a shell for example).
+
+Revision 2.114 2002/06/03 19:02:43 set
+* Added: Uses_chdir request to compatlayer (needed for MSVC where the name
+is _chdir).
+* Fixed: Absent Uses_getcwd action for MSVC (direct.h _getcwd).
+
+Revision 2.113 2002/06/03 16:34:03 set
+* Updated/Added: Win32 makefiles.
+
+Revision 2.112 2002/06/03 16:30:52 set
+* Fixed: Some MSVC issues from feedback sent by WintiX <wintix@bk.ru>
+
+Revision 2.111 2002/06/03 16:29:18 set
+* Fixed: TMenuBar::getItemRect, the return value was commented by Anatoli,
+but not all compilers (read MSVC) are cleaver enough to realize this code
+is never used. I re-enabled the code but it could interfere with another
+compiler. We'll see.
+
+Revision 2.110 2002/06/03 16:26:04 set
+* Fixed: The code that helps Win32 ports in the configuration script. It
+touched files of the current target, was outdated and have case sensitive
+file systems bugs.
+
+Revision 2.109 2002/06/03 15:20:34 set
+* Modified: [QNX] A new patch from Mike for the keyboard tables.
+* Added/Fixed: Some small details in the demo code. Patches from Mike, but
+applied in a different way.
+
+Revision 2.108 2002/06/03 13:44:48 set
+* Added: [Win32] The "WinNT" driver. Now this is available and I also
+adapted things so the "Win32" driver is also available. It means that both:
+the code from Anatoli and Vadim can be used for BC++, Cygwin and MinGW.
+It looks like Anatoli's code is much faster and less complex. Currently
+the WinNT driver have more priority for BC++ and less for Cygwin/MinGW.
+
+Revision 2.107 2002/06/03 13:18:38 set
+* Fixed: [DOS] Typo in cursor shape code (let it enabled all the time).
+* Fixed: [DOS] Palette must be restored each time a mode is set.
+
+Revision 2.106 2002/06/03 13:14:36 set
+* Added: Palette support to the DOS driver.
+* Modified: The low level setDisPaletteColors to return the number of
+succesfuly set colors.
+
+Revision 2.105 2002/06/03 12:55:41 set
+* Modified: The X11 palette routines to include the redraw. Tested with
+SETEdit.
+
+Revision 2.104 2002/06/03 12:54:20 set
+* Added: An option to never hide the cursor to TDisplay. The most important
+effect of this variable is how it affects high level classes. When this
+option is enabled some classes sets the cursor as visible and moves the
+hardware cursor. But the low level stuff is needed to debug it.
+* Added: Code to be "Braille friendly" to TMenuBox, TMenuBar and TButton.
+* Added: Example code to the demo program, also added code to restore the
+window title at exit.
+
+Revision 2.103 2002/06/03 12:50:09 set
+* Fixed: MinGW doesn't define ssize_t. Reported by Thiago.
+
+Revision 2.102 2002/06/03 12:49:11 set
+* Added: [Win32] According to Thiago newer versions of MinGW have their own
+uname command that reports MINGW32_<windows flavor>. Added to the
+conflib.pl.
+
+Revision 2.101 2002/05/30 18:57:15 set
+* Fixed: [FreeBSD] when calling ldconfig we must specify to merge the data
+of the directory we installed the library. Suggested by miniEleph.
+
+Revision 2.100 2002/05/30 18:29:26 set
+* Fixed: Wilcard used by TVEdit *.* -> *
+* Fixed: Shell call used in TVEdit, now is system neutral. Both pointed out
+by Tapio.
+
+Revision 2.99 2002/05/30 17:47:25 set
+* Fixed: The column where the cursor is positioned to help Braille
+Terminals. Lamentably we must add a mechanism to unhide the cursor because
+in Linux if the cursor isn't visible the position isn't actually changed.
+From information that Tapio Kelloniemi <tappi@thack.org> sent me.
+
+Revision 2.98 2002/05/30 17:42:32 set
+* Fixed: Lack of string header. Reported by Tapio Kelloniemi
+<tappi@thack.org>
+
+Revision 2.97 2002/05/30 17:26:56 set
+* Added: X11 Palette code, completly untested. The Linux driver code seems
+to work.
+
+Revision 2.96 2002/05/29 20:29:32 set
+* Added: [UNIX] XTerm and Eterm palette support, is untested!
+
+Revision 2.95 2002/05/29 17:56:02 set
+* Fixed: [UNIX] TFileEditor was trying to convert UNIX files into DOS
+format ;-) and what is worst using a temporal file with random rights. Now
+the TVEdit example works on Linux.
+
+Revision 2.94 2002/05/29 16:08:14 set
+* Modified: TMenuBox to move the cursor to the selected menuitem. That's
+an experiment to see if Braille Terminals gets benefited. Tapio Kelloniemi
+<tappi@thack.org> pointed out this.
+
+Revision 2.93 2002/05/29 15:28:20 set
+* Fixed: [FreeBSD] According to miniEleph ldconfig gets mad if we install
+librhtv.so.<full version>, now for this target I install librhtv.so.<major>
+
+Revision 2.92 2002/05/29 13:03:32 set
+* Fixed: TVHC project didn't exclude system headers.
+* Updated: [DOS] project and makefile.
+* Fixed: tvdemo3.cc included help.h directly.
+
+Revision 2.91 2002/05/28 19:28:32 set
+* Fixed: [www] The link to Sigala's port and the supported platforms.
+
+Revision 2.90 2002/05/28 18:32:49 set
+* [QNX] Applied patches from Mike:
+- Added more recognized keys.
+- Fixed some bugs in key code translation.
+- Fixed uninitialized suspend variable and esc key delay.
+
+Revision 2.89 2002/05/28 18:20:42 set
+* Added: THelpFile/THelpWindow/THelpViewer and friends to the library.
+Originally from Sigala's port and was only in the demo.
+* Added: Turbo Vision Help Compiler. Adapted by Mike. I did some changes
+to the code.
+
+Revision 2.88 2002/05/28 15:53:32 set
+* Fixed: [DOS] The config.pl file used djgpp/makefile and the file is in
+fact named djgpp/Makefile. This isn't a problem for DOS/Windows, but is
+a problem when using UNIX to copy the file. Pointed out by Mike.
+
+Revision 2.87 2002/05/28 15:46:34 set
+* Updated: The TV site and included a copy in the CVS/distribution.
+
+Revision 2.86 2002/05/28 12:48:30 set
+* Added: The first approach for the Palette handling. The user can access
+a couple of TScreen members (get/setPaletteColors) that works using a
+couple of members defined by each driver (get/setDisPaletteColors) and some
+buffers (ActualPalette, OriginalPalette and PC_BIOSPalette). Added the
+capability bits needed to know what's implemented. I implemented it in the
+Linux driver, lamentably Linux lack a mechanism to know the current colors.
+I explain more in linuxdis.cc.
+
+Revision 2.85 2002/05/27 17:46:18 set
+* Added: QNX update from Mike:
+I'm almost done the screen related stuff (only minor bugs remain), 25% done
+keyboard stuff (only functional keys and cursor keys seems to be work) and
+no mouse support at all.
+
+Revision 2.84 2002/05/27 14:05:27 set
+* Added: Mouse support to the XTerm driver and put in the list of drivers.
+Also fixed a lot of details in this driver. This new XTerm driver restores
+the screen, supports shift/ctrl/alt+special keys and interactive mouse.
+* Added: An example on how to start an old xterm (from X 3.x) to get all
+the keys.
+* Added: An example theme fro Eterm 0.9.x to get all the key combinations.
+It configures Eterm as xterm from X 4.x.
+
+Revision 2.83 2002/05/27 12:26:30 set
+* Fixed: [UNIX] The makemak.pl script created a link to a no longer
+existant linux/gkeyli.cc file. Pointed out by Mike.
+
+Revision 2.82 2002/05/24 20:13:29 set
+* Added: The first test classes for the XTerm driver. They aren't tested
+yet but I think they will work much better than the ncurses version.
+
+Revision 2.81 2002/05/20 15:56:55 set
+* Fixed: UNIX and X11 drivers didn't set uid and gid to the effective
+values after initialization. This is used for Linux console driver, but
+must be done for all.
+* Modified: [X11] no default title is used, it was "Test".
+
+Revision 2.80 2002/05/20 15:27:29 set
+* Added: QNX files to RHIDE project and hence Makefile.
+
+Revision 2.79 2002/05/20 15:23:57 set
+* Added: QNX skeleton files from Mike. I changed the code a little bit to
+generate the most important dependencies even when using Linux's RHIDE.
+
+Revision 2.78 2002/05/20 15:08:43 set
+* Modified: Now the Linux code is in a separated driver. The old code is
+now the UNIX driver.
+The new driver is only for Linux console and doesn't apply for Xterm. This
+driver doesn't need ncurses and have the following new features:
+ * If the app. is in a real console (ttyN) but doesn't have VCS access
+ the text of the screen is saved/restored using the Linux ioctls for select
+ and paste with the mouse.
+ * The colors and attributes of the console are saved/restored.
+ * get/setWindowTitle can affect what ps reports if the user helps the
+ library providing pointers to argv and environ.
+
+Revision 2.77 2002/05/17 18:54:31 set
+* Added: More configuration patches for QNX from Mike. Complements the
+special flags for dynamic libs patch and workarounds a library search
+issue of QNX 6.2 beta 3.
+
+Revision 2.76 2002/05/17 18:33:20 set
+* Modified: RHIDE project to include QNX sources from Mike.
+
+Revision 2.75 2002/05/16 21:21:12 set
+* Modified: [Linux] Added Scroll-Lock to the patch list, it freezies the
+application and some people thinks it hanged. To make it worst some idiots
+put the S-L key very close to Home just to insert a stupid key to make
+the machine sleep and hence is quite easy to press S-L instead of Home. So
+now TV remaps S-L to Home. From a report by David A. Capello
+<dacap@users.sourceforge.net>.
+
+Revision 2.74 2002/05/16 21:04:53 set
+* Fixed: [X11] The code failed to track key-up events when other
+application had the focus becoming out of sync. Now I added code to sync
+the states. Works for XFree86 and Solaris.
+
+Revision 2.73 2002/05/16 18:54:15 set
+* Added: A batch of patches from Mike for QNX.
+ * Configuration for libstdc++
+ * strings.h inclusion.
+ * Class: member(value) -> Class { member=value; for some cases reported
+ by the compiler as problematic.
+ * Fixed: exclusion of X11 driver initialization if no X detected.
+ * time.h for puzzle.h demo.
+
+Revision 2.72 2002/05/16 18:19:30 set
+* Added: QNX needs -shared to create a module for a dynamic library.
+Pointed out by Mike.
+
+Revision 2.71 2002/05/15 20:43:48 set
+* Added: The first patches to configure under QNX, they just add QNX
+detection but more will be added. Patches by Mike Gorchak <mike@malva.ua>
+
+Revision 2.69 2002/05/15 19:06:14 set
+* Fixed: Default CFLAGS for FreeBSD used -L/usr/local/include. Reported by
+miniEleph (Andrew 'Onyx' Shevtsov).
+
+Revision 2.68 2002/05/15 01:51:44 terrible
+* Modified: Updates to Debian packaging.
+* Fixed: reordered external library linking for dynamic library (I think
+thats the correct order).
+* Fixed: add -lX11 to the linking of the dynamic library if building with
+X11 support (creates needed dependency between the rhtvision library and
+X11 library, and allows compilation of rhtvision programs without needing
+to specify -lX11).
+
+Revision 2.67 2002/05/14 20:52:31 set
+* Added: [X11] get/set window title.
+
+Revision 2.66 2002/05/14 20:17:30 set
+* Modified: Now x11 headers are in the include/tv/x11 directory. Reported
+by miniEleph.
+
+Revision 2.65 2002/05/13 19:30:22 set
+* Modified: The intl/dummy/Makefile didn't define CC and GNU make used cc.
+
+Revision 2.64 2002/05/13 15:26:49 set
+* Fixed: X11 cursor, again.
+
+Revision 2.63 2002/05/13 13:25:18 set
+* Modified: [Win32] Reenabled code by Vadim that is supposed to compress
+the mouse queue. Needs more investigation.
+
+Revision 2.62 2002/05/13 13:14:30 set
+* Fixed: Win32 makefile now needs vpath for the DOS files (now separated).
+* Updated: The files distribution list.
+* Fixed: [Win32] Many typos and missing references in the Win32 code so now
+it compiles.
+* Added: [Win32] the console state and cursor position/shape is restored.
+* Fixed: [Win32] the screen content is now restored, Vadim specified a
+wrong rectangle.
+* Updated: [Win32] the readme.
+* I tested all with Cygwin and seems to quite functional.
+
+Revision 2.61 2002/05/13 13:03:35 set
+* Modified: [UNIX] Now the FHS detection is more strict, the existance of
+share/doc is not enough, share/man and shared/info must exist.
+* Fixed: [UNIX] The FHS detection looks in $prefix and not in /usr.
+
+Revision 2.60 2002/05/10 18:52:23 set
+* Fixed: [UNIX] makemak.pl assumed perl is installed in /usr/bin/perl, it
+doesn't have to be true. Now the makefile uses: "perl makemak.pl".
+
+Revision 2.59 2002/05/10 18:46:33 set
+* Fixed: [Solaris] getopt.c didn't include some needed headers.
+
+Revision 2.58 2002/05/10 17:34:44 set
+* Modified: [X11] Cursor initialization.
+* Fixed: [X11 Solaris] XmbLookupString doesn't support NULL for status.
+
+Revision 2.57 2002/05/10 15:21:13 set
+* Modified: [X11 Solaris] It looks like Solaris 7 (at least the one I have
+access) have a broken ITIMER_REAL.
+
+Revision 2.56 2002/05/10 14:17:27 set
+* Modified: [X11] to use sigaction, seems that signal behaves different in
+Solaris.
+
+Revision 2.55 2002/05/08 12:31:57 set
+* Fixed: [UNIX] The .gpr include directory was hardcoded instead of using
+TVSRC. From a report by miniEleph.
+
+Revision 2.54 2002/05/07 19:06:26 set
+* Modified: [X11] Now only the changed text is updated. In the test case
+it produced a 290% increase in speed.
+
+Revision 2.53 2002/05/07 16:54:08 set
+* Added: [FreeBSD] getopt_long request in compatlayer. Reported by
+miniEleph.
+
+Revision 2.52 2002/05/06 15:04:15 set
+* Added: X11R6 include directory to the configuration script. It looks like
+this directory isn't automagically included in FreeBSD. Also added options
+to configure it -x-include and -x-lib. Reported by miniEleph
+<nyxo@dnuc.polyn.kiae.su>.
+
+Revision 2.51 2002/05/06 13:38:59 set
+* Added: The first step for the Win32 driver. All is supposed to be there
+but I didn't even try to compile.
+
+Revision 2.50 2002/05/06 13:32:17 set
+* Modified: A lot of DOS code. Now you can get an usable demo application
+for DOS. Screen, mouse and keyboard seems to be usable.
+
+Revision 2.49 2002/05/03 16:56:22 set
+* Fixed: Invisible cursor in the Linux driver.
+
+Revision 2.48 2002/05/02 19:38:14 set
+* Fixed: Window resize for X11. I didn't notify it to TProgram and the
+window normalization was done before reallocating the screenBuffer.
+
+Revision 2.47 2002/05/02 19:37:15 set
+* Fixed: TDisplay::defaultGetWindowTitle(void) returned a static string,
+not newly allocated.
+* Fixed: TScreenX11 cursor was using one extra memory location. Detected
+with efence.
+
+Revision 2.46 2002/04/30 18:43:04 set
+* Fixed: rhide.env files are now included by .mak files and the old syntax
+to include another .env files isn't valid for make. Using "include" works
+for both.
+* Added: .mak files for the examples to the CVS.
+
+Revision 2.45 2002/04/30 18:13:10 set
+* Fixed: When running in a generic color terminal (using 8 colors) no color
+remapping was applied. As a result the colors were messed.
+* Added: Some minor support for "screen" terminal. Both from reports by
+"Tatu Kilappa" <trilkk@hotmail.com>.
+
+Revision 2.44 2002/04/29 20:17:49 set
+* Fixed: dual.cc shouldn't be in the makefiles.
+* Fixed: TEditor used getshiftstate.
+
+Revision 2.43 2002/04/29 19:19:01 set
+* Added: compat.mak to CVS so people without RHIDE can compile.
+* Fixed: linuxso/makemak.pl needs to create a link to rhide.env for RHIDE
+1.4.9 and newer.
+
+Revision 2.42 2002/04/22 18:26:55 set
+* Fixed: The file collection didn't support duplicates, but when it was
+configured to be no case sensitive in an OS that is case sensitive some
+names could look like duplicates and be omitted. Reported by David A.
+Capello <dacap@users.sourceforge.net>.
+
+Revision 2.41 2002/04/22 18:11:04 set
+* Fixed: The configuration script configured the examples for Win32 in all
+platforms.
+* Added: Some copyrights to the new base classes.
+* Added: Code to debug cursor problems.
+* Fixed: Cursor under X11. The target still buggy but is the most finished.
+
+Revision 2.40 2002/02/21 01:07:39 set
+* Fixed: Some details to allow compiling under Linux. The code now
+compiles.
+
+Revision 2.39 2002/02/20 01:31:25 set
+* Fixed: gcc 3.x problems with GetStrStream() macro. Reported and solution
+by Andris.
+
+Revision 2.38 2002/02/03 19:45:40 set
+* Modified: Moved mouse.cc code to tevent.cc. It contains mouseInt() which
+was reworked.
+* Added: a new THWMouse member called drawCounter, used when the mouse is
+drawn asynchronically by an interrupt. It can be accessed using TMouse
+members: resetDrawCounter() and getDrawCounter(). Only needed by TView to
+know if the mouse was updated while drawing to screen.
+* Modified: Draw mouse to return 1 if the draw was necesary.
+* Modified: TView to be more clean in the code that finds mouse position and
+determines asynchronic draws.
+* Modidied: Now the BIOS/direct mode for DOS driver is set using
+SetKbdMapping. Two special values determines it: dosUseBIOS and dosUseDirect.
+It allows for special actions (pointers redirection) and a portable mechanism
+(you can use code that is valid for other drivers, not useful but valid).
+* Added: Mouse and Keyboard headers for DOS are almost finished.
+
+Revision 2.37 2002/02/02 15:20:08 set
+* Modified: Now OS specific headers are in separated directories. Example:
+tv/linuxscr.h is now tv/linux/screen.h.
+
+Revision 2.36 2002/01/27 17:05:10 set
+* Merged Ivan patches for Debian 1.1.4-1 package.
+
+Revision 2.35 2002/01/03 02:14:41 set
+* Fixed: Need to create win32/rhide.env for Cygwin/MinGW targets. Needed for
+RHIDE 1.4.9.
+
+Revision 2.34 2002/01/03 01:28:38 set
+* Fixed: getline code for BC++ 5.5 target. [lack of ssize_t]
+
+Revision 2.33 2002/01/02 00:15:43 set
+* Fixed: The configuration forced tvfintl for Linux.
+* Fixed: RHIDE 1.4.9 includes rhide.env in generated makefiles so the new
+makefile used for Linux needs a link to it in linuxso directory.
+
+Revision 2.32 2002/01/02 00:53:16 set
+* Added: GNU getline replacement to compatlayer.
+
+Revision 2.31 2002/01/01 01:28:23 set
+* Added: Code to avoid collisions between the last changes in tv/intl.h and
+djgpp's conio. Note that gettext instructs users on how to change libc to
+avoid such a collision.
+
+Revision 2.30 2001/12/31 21:59:23 set
+* Modified: Now if gettext isn't detected the configuration uses the fake
+internationalization dummy. It can be disabled with --no-intl. Why? it allows
+people to install gettext *after* compiling TV, they just need to change the
+linker options and all works. Pointed out by Laurynas.
+* Added: --force-dummy option. It forces the use of tvfintl even if gettext
+is installed. That's useful when most of your TV applications won't use intl
+library. I use it for the editor that I compile using their own gettext under
+DOS, in this way I avoid using iconv.
+* Added: Documentation about it.
+*** IMPORTANT *** I don't include libintl.h anymore and assume the
+prototypes. This helps with the dummy and I doubt it will collide. If some
+day it collides the configuration could indicate how to solve it.
+
+Revision 2.29 2001/12/30 23:34:07 set
+* Fixed: A couple of new[]/delete style missmatches while debugging setedit
+with MSS 1.2.1.
+
+Revision 2.28 2001/12/30 18:35:46 set
+* Fixed: Compatlayer undefined FA_DIREC even in cases that didn't redefine
+it.
+
+Revision 2.27 2001/12/30 18:33:33 set
+* Added: Support for MSS 1.2.1 and fixed missing delete [] in demo. Patches
+by Laurynas.
+* Added: Configuration options to use MSS and documentation in the readme.
+* Fixed: Various missing delete [] in the classes.
+
+Revision 2.26 2001/12/30 16:15:10 set
+* Fixed: I wrongly changed the code used for the BC++ 5.5 target to yield
+the processor to use the MinGW version. It made applications eat 100% of
+the CPU.
+
+Revision 2.25 2001/12/18 02:34:11 set
+* Added: Fine grained protection against multiple inclutions in compatlayer
+header.
+
+Revision 2.24 2001/12/17 00:20:32 set
+* Added: A new URL to the Borland's FAQ that says TV is Public Domain. This
+is supported by all the TeamB people I contacted.
+
+Revision 2.23 2001/12/11 00:59:59 set
+* Added: TDisplayDOS is almost finished.
+* Added: Started to work on DOS mouse driver.
+
+Revision 2.22 2001/12/11 00:26:45 set
+* Added: Some adjusts to compatlayer for Cygwin target. Needed to compile the
+editor. Patch from Robert.
+
+Revision 2.21 2001/12/06 01:17:15 set
+* Fixed: Some errors in listvi example. It used constant strings for input
+lines (read only on UNIX and of limited size a disaster). Also fixed the size
+of the columns and input line to be nicer. Reported by Wojciech Warczakowski
+(Wowar) <wowar@poczta.onet.pl>.
+
+Revision 2.20 2001/11/29 23:08:41 set
+* Modified: Solaris have nl_langinfo so we don't need to use the
+replacement. I didn't check if this correction works.
+
+Revision 2.19 2001/11/28 23:41:26 set
+* Added: getopt when Solaris is detected.
+
+Revision 2.18 2001/11/25 19:07:33 set
+* Added: TEditorApp dependency (TApplication) to the tv.h.
+
+Revision 2.17 2001/11/25 18:46:44 set
+* Modified: compatlayer.h should be included just once as tv.h, but this
+isn't the case for all the applications and enforces a policy that doesn't
+have to be the same used by other projects. For this reason I removed the
+protection and any collision will be solved for the particular case instead
+of protecting the whole file. After a talk with Andris.
+
+Revision 2.16 2001/11/25 16:12:00 set
+* Added: Some support for linux-* terminals. Patch provided by "Dimitar
+Jekov" <jimmy@ncp.infonet.bg>
+
+Revision 2.15 2001/11/25 15:44:29 set
+* Fixed: Desklogo examples to work with anything different than 80x25 and a
+lack of a redraw in tv_logo. Reported by Cesar Rabak <csrabak@uol.com.br>.
+
+Revision 2.14 2001/11/25 14:59:58 set
+* Changed: classes/WinNT to winnt, it avoids some problems.
+* Compiled all the stuff to verify that I incorporated all the needed code,
+it changed makefiles and other stuff.
+* Merged Ivan patched for debian package 1.1.3-3, but they are outdated for
+this new 2.0.0 branch.
+* Added include/tv/drivers.h, it defines prototypes for all the drivers
+entry points.
+* Added classes/tgkey.cc, it replaces gkey.cc but is the abstract driver
+base containing common code for all the platforms.
+
+Revision 2.13 2001/11/25 00:41:41 set
+* Added: Definitions for middle mouse button and also buttons 4 and 5.
+
+Revision 2.12 2001/11/25 00:39:38 set
+* Changed: call to new API name in demo example (to set window title).
+
+Revision 2.11 2001/11/25 00:34:04 set
+* Modified: TView because now the functions to set the shape of the cursor
+are compatible with BTV 2.0 and not BTV 1.03. Also a change in an extended
+member. The names of extended members changed to keep API coherence and
+avoid pointer collisions.
+
+Revision 2.10 2001/11/25 00:31:40 set
+* Modified: TProgram because I changed the names of some members in TScreen
+(all extensions not found in BTV) and to avoid using the magic "dual"
+variable. That's temporally part of TDisplay but just to compile, it must
+be solved in another way not yet fully defined.
+
+Revision 2.9 2001/11/25 00:29:02 set
+* Modified: TEventQueue::resume to avoid calling magic Linux functions, now
+TGKey have a suspend/resume for it.
+
+Revision 2.8 2001/11/25 00:26:56 set
+* Modified: TColorDialog to avoid using the old getBlinkState function, now
+part of the TScreen class.
+
+Revision 2.7 2001/11/25 00:12:12 set
+* Added the headers for the Linux and X11 drivers.
+* Changed the screen.h, event.h and gkey.h headers to declare the new class
+structure.
+
+Revision 2.6 2001/11/25 00:04:03 set
+* Changed classes/tdisplay.cc, classes/tscreen.cc and classes/thwmouse.cc
+by the new class structure. This is a complete rework of the classes but
+maintaining backward compatibility.
+
+Revision 2.5 2001/11/24 23:56:50 set
+* Moved gkey.cc, classes/tdisplay.cc, classes/thwmouse.cc and
+classes/tscreen.cc to the DOS driver because they have the DOS code. They
+will be changed to follow the new class structure.
+
+Revision 2.4 2001/11/24 23:43:28 set
+* Added: A new driver for X11, it is quite functional and complete.
+
+Revision 2.3 2001/11/24 23:40:10 set
+* Merged: New code for the Linux terminals. It's currently only one driver
+(the mouse is the only exception) and should be split in three, but is
+adapted to the new class style.
+
+Revision 2.2 2001/11/24 23:21:19 set
+* Changed version to 2.0.0 because big changes are about to be merged.
+
+Revision 2.1 2001/11/24 23:18:11 set
+* Added: X library detection to the configuration.
+
+Revision 2.0 2001/11/24 23:12:33 set
+* New change.log file created.
diff --git a/tvision/change1.log b/tvision/change1.log
new file mode 100644
index 0000000..6d54b4f
--- /dev/null
+++ b/tvision/change1.log
@@ -0,0 +1,1621 @@
+This is the log file for versions of the 1.x series
+
+Tagged as tv1_1_3b2 and branched tv1_1_3b2_patches
+Revision 1.242 2001/11/06 23:31:08 set
+* Fixed: A typo in compatlayer.h, it defined sdtio instead of stdio ;-).
+Reported by "Jerzy Witkowski" <jwi@pl.ibm.com>.
+
+Revision 1.241 2001/10/31 01:00:56 set
+* Added: --no-fhs to the configuration. Patch provided by
+jimmy@ncp.infonet.bg.
+
+Revision 1.240 2001/10/25 00:32:12 set
+* Fixed: The gkey.cc program assumed that Linux is the only UNIX ;-) I
+noticed it while trying to test the keyboard routines running Solaris.
+
+Revision 1.239 2001/10/23 00:57:43 set
+* Fixed: Some compilation problems when using the last CVS snapshot of gcc
+3.1. All in the examples and related to specify std namespace as the
+default namespace. Patches provided by Andris Pavenis, just converted to
+the little macro I use to hide namespace stuff.
+
+Revision 1.238 2001/10/22 23:35:05 set
+* Added: linuxso/Makefile and linuxso/compat.mak to the distribution list.
+They are needed in some cases.
+
+Revision 1.237 2001/10/20 01:02:51 set
+* Merged Debian packaging patches from Ivan:
+ * Now compiles with -D_REENTRANT as Debian Policy mandates.
+ * Now runs ./configure before make clean (reported by Salvador).
+ * Don't eliminate the ldconfig invocation of the upstream Makefile,
+ it seems that upstream has corrected its Makefile now (done after
+ Salvador reported that it didn't work on all systems, because I was
+ overwriting the Makefile while I was reading it, specially on
+ multiprocesor systems).
+ * Added include/tv/configtv.h to files_to_backup.
+* Fixed: The configuration script modified RHIDE Makefiles in the wrong way
+when the original RHIDE variable used more than one line.
+* Modified: Ivan added more log info to the Linux mouse.
+
+Revision 1.236 2001/10/18 00:35:42 set
+* Merged patches for Debian stuff from Ivan.
+
+Revision 1.235 2001/10/18 00:10:06 set
+* Fixed: I forgot to update the linux/Makefile file from the project file.
+It prevented the code to compile for FreeBSD.
+
+Revision 1.234 2001/10/17 23:52:54 set
+* Fixed: [Linux] DECIMAL_POINT is GNU specific and not the right value to
+use like the glibc info says. The value RADIXCHAR is indicated like this:
+"The name `RADIXCHAR' is a deprecated alias still used in Unix98." so I
+used DECIMAL_POINT. But the same idiots moved DECIMAL_POINT to _GNU_SOURCE
+section because it *isn't* standard (glibc 2.2.x). So now I use RADIXCHAR.
+Now I wonder what idiot wrote "The Elegant and Fast Way X/Open's
+`nl_langinfo'." when this is poorly supported and have such a details.
+
+Revision 1.233 2001/10/17 23:28:18 set
+* Fixed: Not all of the configured values were transfered to the makefile.
+They were correctly put in the *.env files but not in the makefile. It
+included the GNU ar name.
+* Fixed: The compat layer makefile wasn't configured.
+
+Revision 1.232 2001/10/17 22:38:51 set
+* Fixed: [UNIX] Unconditional request for definekey()
+
+Revision 1.231 2001/10/17 22:35:55 set
+* Fixed: Now clean target also deletes the configure.cache.
+
+Revision 1.230 2001/10/17 22:32:57 set
+* Fixed: Now "make clean" really cleans the example objects and executables.
+* Added: A makefile for the examples, mostly to make the clean but can be
+used to generate all the examples.
+* Added: An examples target to the makefile.
+* Added: Now the configure script says if the configuration header was
+replaced or not.
+
+Revision 1.229 2001/10/17 21:52:58 set
+* Added: A #undef gettext in intl.h for DOS. I hope it solve collisions with
+conio.h that are popping again (with old gettext versions).
+
+Revision 1.228 2001/10/17 00:28:12 set
+* Modified: The Win32 port uses a case sensitive glob to match wildcards in
+directories but Win32 isn't really case sensitive (is HPFS case sensitive?).
+Owen Rudge <owen@osplus.co.uk> reported problems because *.txt and *.TXT
+doesn't match the same files. So I disabled the case sensitive comparisson.
+
+Revision 1.227 2001/10/17 00:00:29 set
+* Added: to the readme notes about some success compiling for Linux+HPPA+gcc
+3.0 reported by Joël Soete <JSO@EUROPAY.COM>. [ISO-1]
+
+Revision 1.226 2001/10/16 23:53:18 set
+* Fixed: A couple of formating errors in the ASCII table and Calendar of the
+demo example. Patch from Waldemar Schultz <schultz@mathematik.tu-muenchen.de>
+
+Revision 1.225 2001/10/13 23:53:49 set
+* Fixed: The clean target didn't ignore errors from the examples/clean
+script.
+
+Revision 1.224 2001/10/13 23:30:24 set
+* Added: International dummy library to the Makefile. Suggested by
+Laurynas.
+* Merged: Changes for the Debian stuff from Ivan.
+
+Revision 1.223 2001/10/13 22:50:05 set
+* Removed autoconf example because it doesn't work anymore. Laurynas is
+working on a new version.
+
+Revision 1.222 2001/10/13 21:40:20 set
+* Fixed: The BC++ 5.5 makefile lacked a rule to make C++ components of
+compatlayer (currently just a file). Patch by Owen Rudge <owen@osplus.co.uk>.
+.
+Revision 1.221 2001/10/12 02:54:44 set
+-----------------------------------------------------------------------------
+v1.1.3 release. Switching to stable.
+
+Revision 1.220 2001/10/10 14:56:15 set
+* Fixed: The TRangeValidator was supposed to support hexa numbers but
+didn't accept A-Fa-f. Also changed the complex and slow scanfs to
+strtol/stroul. Reported and solutions suggested by Andris.
+* Added: An example of TRangeValidator to the Tutorial number 16. I used it
+to test the changes ;-). I also added an example of the messageBoxes that
+uses printf style parameters.
+
+Revision 1.219 2001/10/08 23:36:18 set
+* Fixed: [gcc 3.x] fpstream(int fd) was creating a text mode stream and not
+binary.
+
+Revision 1.218 2001/10/07 23:30:00 set
+* Fixed: Damn! BC++ 5.5 implementation of ifstream::getline differs from gcc
+v2.x and v3.x. So now I created a compatlayer macro: IfStreamGetLine(object,
+buffer, size). For gcc it expands to object.getline(buffer,size) but for bcc
+is expanded to a function call that makes get for the line and then removes
+the EOL. Now the demo and tutorials seems to work for the three compilers.
+
+Revision 1.217 2001/10/07 22:21:16 set
+* Fixed: The demo to work with gcc 3.x streams. Andris suggested the fix
+according to the following information: C++ standard draft at
+ftp://research.att.com/dist/c++std/WP/ says about get in (27.6.1.3): If the
+function inserts no characters, it calls setstate(failbit), which may throw
+ios_base::failure (27.4.5.3). It looks like it makes get to stop reading and
+the best is to use getline. In the gcc 2.x iostream info file says: "If
+DELIM was present in the input, it remains available as if unread; to
+discard it instead, see `iostream::getline'."
+
+Revision 1.216 2001/10/07 22:05:20 set
+* Added: A nl_langinfo replacement to compatlayer library, it just
+implements part of the functionallity. BTW according to glibc people using
+localeconv is for lames ... it looks like djgpp, MinGW, CygWin, BC++, etc.
+users are lames ...
+
+Revision 1.215 2001/10/07 20:27:32 set
+* Fixed: I forgot to install the cl/*.h files!
+* Added: A mechanism to create the .deb packages without root priviledges.
+I used information from Ivan. The easiest way is running
+debina/builpackage.
+
+Revision 1.214 2001/10/07 19:44:03 set
+* Merged patches from Ivan for the Debian package, they avoid deleting
+default configuration files.
+
+Revision 1.213 2001/10/06 18:19:12 set
+* Added: Support for localized decimal point in the pocket calculator. The
+user types the '.' key but the calculator displays the right decimal point
+symbol. Without it the calculator fails to work for locales that uses
+another decimal point (like mine).
+
+Revision 1.212 2001/09/30 21:03:31 set
+* Fixed: Now the scripts generate Debian versions with -0.1 as suggested by
+Ivan.
+* Fixed: debian/control.in had extra \n at the end that were passed to
+debian/control every time.
+
+Revision 1.211 2001/09/29 02:11:10 set
+* Modified: I made the library compile with gcc 3.0.1. This new version of
+gcc implments the ISO C++ 1998 standard and hence changes a lot of things
+about the C++ streams. I got some help from Andris Pavenis and Christoph
+Bauer. Andris already compiled the library using some quick and dirty patches
+and Christoph suggested good solutions for some of the problems.
+* Fixed: New standards enforce the use of an EOL at the last line of code.
+* Fixed: New standards deprecates multi-line strings, they are very
+convenient for inline assembler. That's a really bad thing.
+* Added: A good amount of macros to compatlayer to reduce the impact of the
+new streams semantics.
+* Modified: Now fpbase::filebuf buf; is a pointer (is a private member).
+* Added: fpstream::filelength() because now is invalid to ask for the file
+descriptor of a stream.
+* Modified: The asm(register) modifier now doesn't work as with gcc<3.
+* Fixed: A huge amount of errors in the dialog editor that gcc 3 now
+detects (like bizarre casts or returning pointers to local variables).
+.
+Revision 1.210 2001/09/26 00:08:09 set
+* Modified: [DOS] Now the useBIOS variable is the default for the keyboard
+routines. According to reports of various users it looks like some new
+BIOSes are handling the keyboard buffer in a not standard way. Until we
+don't find what exactly is going on I decided to use the BIOS routines by
+default (which fixes the problems). An example of report was from
+Jcbk455@aol.com, he reported ASCII 7 inserted every 13 keystrokes. I
+consulted in the lists and nobody was against it, Robert was in favor.
+
+Revision 1.209 2001/09/25 23:18:41 set
+* Modified: [UNIX] Now if the user is the superuser (uid 0 is ok?) the
+library uses the owner mask to report R.O. status. This is not quite true,
+the root can write on it but if the volume is R.O. I think that's the best
+clue we have.
+
+Revision 1.208 2001/09/25 23:08:01 set
+* Added: [Linux] Support for /dev/vc/NN devices in the keyboard routines.
+Thanks to Andris, he have a system that uses it.
+
+Revision 1.207 2001/09/25 02:17:04 set
+* Fixed: Problems in TEditor class when handling UNIX files.
+* Fixed: A bug introduced by JASC while adapting teditorf.cc to work for
+big endian platforms. It rendered TEditor buffers as only spaces ;-)
+Reported by Owen Rudge <owen@osplus.co.uk>.
+* Fixed: Tons of warnings, some of them bugs that made impossible to
+compile the Dialog Design program.
+* Fixed: One of the desklogo examples was supposed to show the use of ^Z
+signal handling but forgot to include signal.h (generated obvious errors).
+* Fixed: Removed header dependencies from all examples, now they depend
+only on headers included with #include "". I did it because patchenv.pl
+can't handle multiple directories and I think that isn't really necesary.
+In this way I'll never let pass system dependent dependencies.
+
+Revision 1.206 2001/09/23 20:05:12 set
+* Modified: Moved all the macros to define if we need \r\n or \n from
+setedit to the compatlayer library.
+
+Revision 1.205 2001/09/23 19:08:27 set
+* Modified: [Linux][Xterm] Now if the library detects xterm puts the keypad
+in the normal mode (looks like ncurses put it in a special mode) it makes
+the keypad usable. I'm sick of these silly ncurses+terminfo stuff.
+
+Revision 1.204 2001/09/22 02:16:56 set
+* Modified: [UNIX] The behavior of file attribute functions of compat
+layer, now the IsReadOnly tries to be a little more cleaver looking for the
+file group and the groups where the user is.
+
+Revision 1.203 2001/09/21 02:30:20 set
+* Fixed: New standards seems to enforce a \n at the end of all sources. At
+least gcc 3.0 says that. I added it to all the tests in the configuration
+scripts.
+* Fixed: [DOS] GCC 3.0 doesn't compile C++ code using the C compiler. The
+configure script can detect it, but as it only happened with very old gcc
+versions the scripts were looking for gxx and currently the C++ compiler is
+inoked using gpp.
+* Added: More MSS details (from last change).
+* Added: More packed details (from last change).
+* Added: no_mss.h and yes_mss.h to the distribution list.
+* Fixed: glob.c had text after a #endif, gcc 3.0 detects it.
+* Fixed: isrelpath.c didn't end with \n, gcc 3.0 detects it.
+Note: Sergey Krivulja <skrivulja@erec.ru> reported it also for gcc 2.96.
+
+Revision 1.202 2001/09/21 01:20:43 set
+* Added: Now the library is `MSS aware'. Laurynas sent me some patches for
+it and I adapted them. MSS is a memory debugger.
+* Modified: Uniformized the use of __attribute__((packed)) [Laurynas
+patches] and added to the compatlayer.
+* Modified: Now the uint* and uchar, uint, ulong, etc. types are part of
+compatlayer. I saw a collision with types defined but GNU libc (only for C
+sources where you can't define the same type twice :-(. Currently is solved
+case by case but I think it could be solved computing what headers are
+requested. It looks like for some ancient reason sys/types.h defines it.
+This action changed all name files.
+* Modified: The Boolean type is now also part of compatlayer.
+
+Revision 1.201 2001/09/20 22:26:53 set
+* Fixed: The keyboard internal structure wasn't "endian aware". Wow! now
+the mouse, shadows and keyboard seems to work for PPC and SPARC.
+
+Revision 1.200 2001/09/20 01:11:37 set
+* Modified: Now the configuration script doesn't need pwd, if it fail uses
+cd command.
+* Added: Creation of examples/rhide.env for the Win32 target.
+* Added: Now the config.pl updates the win32 Makefile so MinGW users without
+all the needed tools have a chance to compile.
+* Modified: Now the configuration detects more details and defines
+preprocessor variables acording to it. The definitions are also less
+confusing. Now they are OS, OSf (subtype of OS), Comp (Compiler), Compf
+(subtype of compiler) and CPU. With it I removed almost all magic __*__ tests
+that are usually tricky and not so clear.
+* Added: Cygwin target, with the help of Ronald Landheer
+<ronald@landheer.com>.
+* Added: Better prefix detection for MinGW.
+* Fixed: The version.txt file messed things if ended with \n, now is ok.
+* Added: A definition to compatlayer to identify systems where drive letters
+have any sense (CLY_HaveDriveLetters).
+* Added: More use of compatlayer Uses_* mechanism.
+* Added: Uses_abort to compatlayer (MSVC have it process.h).
+* Added: More code to solve the endian problems with the shadows.
+* Added: Code to solve the endian problem with the mouse attribute.
+* Modified: win32/trans.cc, win32/console.cc and win32/gkey.cc now are just
+one file. It helps to maintain uniform the list of files.
+* Modified: the win32/readme.txt to reflect the changes.
+
+Revision 1.199 2001/09/16 20:05:39 set
+* Updated: Distribution readme and debian/changelog.
+* Fixed: debian/control had extra new line characters.
+* Fixed: Now the scripts of distribution updates debian/changelog with my
+name and stating it was a script. Sugested by Ivan.
+* Added: .exe files to the list of excluded in Linux source distribution.
+
+Revision 1.198 2001/09/16 18:09:00 set
+* Added: Code to solve the endian problem in shadows. Must be tested.
+
+Revision 1.197 2001/09/16 17:52:53 set
+* Added: Updated information about supported platforms to readme.in.
+* Added: A clean target to the makefile. It only deletes the objects and
+libraries.
+
+Revision 1.196 2001/09/16 16:52:07 set
+* Added: Architecture detection to the configure. It defines TVCPU_$(Arch).
+* Added: GNU make detection to the configure. It supports gmake as name.
+* Added: GNU ar detection to the configure. It supports gar as name.
+* Fixed: In systems different than Linux and DOS RHIDE makefiles doesn't
+include -lstdc++ (RHIDE_TYPED_LIBS_$(RHIDE_OS).cc is not defined). So now
+the configuration puts them as RHIDE_OS_LIBS. Seen on FreeBSD and Solaris.
+* Added: Support for ncurses installed as -lcurses (I saw it in Solaris).
+* Added: Now CFLAGS and CXXFLAGS can be passed to the configuration in the
+command line (must use the perl script directly, no the shell script!). It
+made the configset script usable with any UNIX shell (/bin/sh isn't bash in
+a lot of UNIX systems).
+* Fixed: When detecting if define_key is available in ncurses the version
+isn't enough. Seen on Solaris.
+* Fixed: Warning about configure.cache not exits in configset.
+* Fixed: When detecting gpm in systems lacking it the config script said
+"too old" instead of "non existent". It was a side effect.
+* Added: SunOS to the list of systems supported by the configuration. It
+doesn't mean the library is working there.
+* Modified: References to __i386__ by TVCPU_x86.
+* Fixed: When creating the dynamic library the list of libraries was listed
+twice.
+
+Revision 1.195 2001/09/16 12:44:19 set
+* Fixed: [Linux] Now <sys/ioperm.h> is included only when needed
+(i386+Linux). After fixing it the code compiled for Linux: Alpha, PPC
+(RS/6000) and SPARC (Ultra60 w/2 CPUs) and FreeBSD+x86. Some big endian
+details must be solved but the demo works for all the platforms. Some
+configuration details must also be solved.
+
+Revision 1.194 2001/09/09 22:10:48 set
+* Fixed: [BC++/Win32] Some unused variable warnings. It looks like BC++ 5.5
+needs something like if (unused) unused=0; to understand we don't want it.
+* Fixed: [BC++/Win32] Some comparisson between signed and unsigned.
+* Added: Now both compress scripts (djgpp and linux) updates the BC++ 5.5
+makefile.
+* Modified: intl.h to define HAVE_INTL_SUPPORT as 1 like in the
+configuration file or gcc will get mad.
+.
+Revision 1.193 2001/09/09 19:58:18 set
+* Modified: version to 1.1.1.
+* Added: Comments about the modification of the cursor behavior.
+
+Revision 1.192 2001/09/08 20:16:14 set
+* Added: itoa to the compatlayer. This function is fast for converting
+integers into strings and seems to be suitable for calling from an async
+point (like a signal). I used djgpp implementation.
+* Fixed: when TDesktop was locked nothing but the cursor was updated. Now
+the cursor isn't updated. I hope it doesn't break anything, I think I did
+it in a clean way. In the past while the editor was loading a big list of
+texts the desktop remained locked but you could see the cursor jumping all
+around the screen as the TCEditors were inserted/selected in the desktop.
+Now the cursor remains still until unlock calls resetCursor().
+
+Revision 1.191 2001/09/08 18:02:01 set
+* Modified: [Linux] Now the TV_system function creates a new session for
+the child process it implies two important things: 1) The child is a leader
+of a group so calling kill(-pid_child... kills all the processes in their
+group. 2) The child doesn't have controlling terminal so it can't read/
+write to the parent console. I think that's good. The output is usually
+redirected so no problem there, but I must investigate what happends if the
+process reads (just error or a signal?).
+
+Revision 1.190 2001/09/05 20:10:44 set
+* Added: [Linux] Now I also patch the ^[ key to just return [ (not ESC).
+This enables a needed key for setedit.
+* Fixed: [Linux] gkey.cc to compile with the current library.
+
+Revision 1.189 2001/09/05 18:40:29 set
+* Fixed: Some problems in the TSortedCollection incremental search. The
+backspace wasn't working (at least on Linux), the `.' didn't show the jump
+to the extension correctly, files with more than one . weren't supported,
+etc. I hope it now works better.
+
+Revision 1.188 2001/09/04 19:23:48 set
+* Fixed: [Win32+BC++] bug when only one key modifier (Shift, Control, Alt)
+was detected. Patch from Anatoli Soltan <anatoli@iname.com>
+
+Revision 1.187 2001/09/04 18:32:14 set
+* Added: inline TMenuItem& operator + ( TMenuItem& s, TMenuItem& i ).
+It makes the creation of nested menues more readable. Sugested by Dean
+Wakerley <dean@wakerley.com>.
+
+Revision 1.186 2001/09/04 18:05:42 set
+* Fixed: It was impossible to use CFLAGS options that contained
+option=value because it confused patchenv.pl failing to configure the
+makefiles. Reported by Norberto Alfredo Bensa <nbensa@hotmail.com>
+
+Revision 1.185 2001/09/04 03:46:22 set
+* Added: The TColorSelector mark wasn't available to remap to other code
+page (fixed code 8). Now is TColorSelector::mark.
+
+Revision 1.184 2001/09/03 23:11:23 set
+* Added: Options for the TFileCollection to sort .* files after the rest.
+* Added: Options for the TFileCollection that affects TFileList so some
+files aren't listed: *~, *.bkp and .*. I also reindented and cleaned some
+code in tfilelis.cc.
+
+Revision 1.183 2001/09/03 20:20:28 set
+* Added: Now any TCluster (radio buttons, check boxes, etc.) that have a
+state sfDisabled is painted with a different color. I mapped it to color
+0x3E (previously reserved) and by default is dark gray over cyan.
+
+Revision 1.182 2001/09/01 22:37:28 set
+* Added: A new parameter for TV_System: pid_t *pidChild=0 if this parameter
+is passed and the OS supports it and we implemented it (read: only for
+Linux right now ;-) system creates a child process and calls exec with the
+provided command. As a result the command starts to run in background. The
+pidChild pointer is filled with the pid of the child. Right now all is too
+POSIX and I hope I will be able to generalize it for other systems.
+
+Revision 1.181 2001/08/31 19:36:56 set
+* Modified: Now if the terminal have fixed encoding the scroll bars uses
+the original chars. That's because we can't trust in any redefined value.
+
+Revision 1.180 2001/08/31 19:34:58 set
+* Added: A function to know if the terminal have a fixed encoding and we
+shouln't offer to the user recoding options. Boolean codePageVariable()
+
+Revision 1.179 2001/08/31 01:13:44 set
+* Modified: I cleaned the writeBlock() function of tscreen.cc. It became a
+mess. I removed the C_, C__ and C___ macros and the __SAVECURSOR_OK option.
+Also removed some redundant checks and reindented the code.
+* Fixed: Now writeBlock() is Endian safe. I got reports from David Nock
+<nockdg@es.co.nz> who was working in a Linux PPC. I used code ideas from
+the version that José Angel Sánchez Caso (JASC) <jasanchez@polar.es> sent
+me but I couldn't find time to merge.
+* Added: Two functions to compat layer library to get the high and low
+nibble of 16 bits values (according to the endianess of the platform).
+* Fixed: Some times after a suspend/resume of the keyboard ttyname failed
+to return the name of the terminal (who knows why?). Now if the name was
+already known and the new calls fails the old information is used. It was
+part of an Andris patch that I applied but not enabled because I have
+doubts about a line that now I left commented.
+
+Revision 1.178 2001/08/30 20:58:23 set
+* Modified: [Linux] A lot of low level details in the TScreen class:
+* Added: An internal variable TerminalType to hold the type of terminal, it
+can be:
+VCSA_TERMINAL The Linux console with access to /dev/vcsa*.
+LINUX_TERMINAL The Linux console without access to /dev/vcsa*
+GENER_TERMINAL A generic terminal.
+* Modified: Now LINUX_TERMINAL sets the terminal to use G1 charset and sets
+the G1 charset to the screen font (user defined). It means that now TV
+applications that doesn't have access to /dev/vcsa* have access to all
+symbols anyways. I had to do some tricks to get some control characters
+printed. I used the UTF-8 mode that Linux have (unicode). So now the fonts
+loaded by the user will be used (I can see my accents correctly).
+* Fixed: The 127 and 128+27 codes are control characters and shouldn't be
+printed. It deformed the "ASCII" window.
+* Fixed: After suspend/resume the calls to endwin/doupdate messed up the
+selected charset. I think that's a bug in ncurses. It was noted when you
+suspended to a shell and resumed (frames damaged). Now the library ensures
+the right charset is selected after doupdate().
+* Modified: Now RestoreScreen() (called by suspend) clears the screen if
+the user screen can't be restored. That's good for calling a shell and is
+less confusing than just do nothing.
+* Modified: Now when using GENER_TERMINAL only the frames are remapped from
+PC437 letting some ISO Latin 1 accents alive. That's not perfect but is
+better than previous behavior. I have ideas about how to enhance it.
+
+Revision 1.177 2001/08/30 20:42:19 set
+* Added: Now the install target is separated in three parts:
+install-headers, install-static and install-dynamic. The install target
+means the three, but you can just install the dynamic library. It helped me
+a lot while testing things with the editor.
+
+Revision 1.176 2001/08/29 23:27:07 set
+* Fixed: An error in the config.pl that put libintl.a for Linux target.
+
+Revision 1.175 2001/08/29 22:49:01 set
+* Added: A function to get the name of the shell to the compat layer
+library.
+
+Revision 1.174 2001/08/28 20:57:50 set
+* Modified: Disable the sched_yield() method in yieldpro.c. I don't know if
+it's working, I guess so, but top says the applications uses 99% of the
+CPU. I guess that's because I only running this application (all the rest
+are sleepping) and hence Linux doesn't have anyone to yield the CPU and
+returns inmediatly. That's OK, but I'm sure users will complain because it
+gives the impression that we eat all the CPU.
+
+Revision 1.173 2001/08/28 16:22:48 set
+* Added: A dummy libintl.a library. This is provided for people that have
+configured the library with international support but want to create one or
+more executables without it. I created it after some mails from Laurynas
+Biveinis <lauras@softhome.net>.
+* Added: An explanation of it to the readme.txt file and also some
+explanation about the impact of libiconv.a.
+.
+Revision 1.172 2001/08/28 14:26:32 set
+* Added: Support for gettext 0.10.37 and newer that needs libiconv. I tested
+it with 0.10.39 and libiconv 1.7. The detection was enhanced and the examples
+are configured to use -liconv if needed. Thanks to Laurynas for ideas and
+some Perl patches.
+.
+Revision 1.171 2001/08/27 19:57:56 set
+* Modified: Now the yieldproc.c module uses the POSIX sched_yield function
+if available. It must be tested to see if that's good. Sugested by
+Robert Varga <nite@hq.alert.sk>.
+.
+Revision 1.170 2001/08/17 00:15:44 set
+* Modified: The debian files. Mainly to reflect the new dependencies and
+warn users about doubts in Borland's license. From Ivan Baldo.
+* Fixed: [Linux] The dynamic library didn't recompile the compat library
+with -fPIC. Report and ideas by Ivan Baldo.
+
+Revision 1.169 2001/08/16 02:51:32 set
+* Fixed: The bug mentioned in the last check in. Now when looking for the
+parent's console we stop if any parent isn't attached to a terminal. It
+works for my X because none of the X terminals I have are attached to a
+terminal, but we must see if that's enough.
+
+Revision 1.168 2001/08/16 01:55:48 set
+* Fixed: The terminal attributes saved in startcurses were not restored in
+stopcurses (but in the destructor) making assymetric the calls. Patch by
+Robert.
+* Modified: Now sys/perm.h is used and asm/io.h doesn't need to be
+protected from sys/io.h. Robert hint.
+* Added: Now if the library isn't in a virtual console the library tries
+harder to find out if this is situation is because the parent spawned the
+program in a terminal like a pts/x. If this is the case the library finds
+what terminal owns the parent and uses it. This is very nice to bypass
+programs like Midnight Commander, but have a serious drawback that I must
+fix in the next minutes: X is also bypassed ;-). Patch from Robert.
+* Fixed: ticks.h used NULL without including stdio.h. Patch from Robert.
+* Fixed: Warning about unused variable in gkeyli.cc when HAVE_KEYSYMS was
+not enabled. Patch from Robert.
+
+Revision 1.167 2001/08/15 23:58:19 set
+* Added: The .mak files to the Linux distribution.
+Released as beta.
+
+Revision 1.166 2001/08/14 15:20:47 set
+* Added: Makefiles for all the examples. They are created/updated when the
+package is created and updated by the configure script to be adapted to the
+target system. Documented.
+* Fixed: Various compilation errors in the examples.
+.
+Revision 1.165 2001/08/13 23:31:28 set
+* Added: The Dialog Editor to the distribution and mentioned in the readme.
+* Added: A .po file containing all the messages that can be internationalized
+in Turbo Vision.
+.
+Revision 1.164 2001/08/12 20:56:34 set
+* Added: A check in TCluster::draw to avoid buffer overflows. I don't know if
+it is really needed but a user asked for it and is better to double check
+this nasty details. Sent by Warlei Alves.
+* Added: A Dialog Editor created by Warlei Alves, he can't follow this
+project so now it will be part of the examples directory.
+.
+Revision 1.163 2001/08/12 19:41:05 set
+* Fixed: A problem only found in RHIDE. Programs should never call
+TScreen::resume() directly but TApplication::resume() instead. RHIDE abuses
+of some Turbo Vision internals and hence needs to call TScreen::resume(). The
+problem is that TProgam::buffer is tied to TScreen::screenBuffer and if you
+call TScreen::resume() and it reallocates TScreen::screenBuffer then
+TProgam::buffer gets unsynchronized and TProgram writes to deallocated data.
+Andris sent me a patch to make it happend only in almost impossible cases,
+but it could theoretically happend anyways. So I added a new TProgram member
+called syncScreenBuffer(). If a program abuses TV calling TScreen::resume()
+directly, then it should call TProgram::syncScreenBuffer() inmediatly.
+.
+Revision 1.162 2001/08/12 16:47:42 set
+* Merged patches from Andris addressing compile issues related to gcc v2.97
+and newer releases:
+1) Internal string functions must be declared (#include <string.h>).
+2) Is no longer valid to directly cast a pointer to a integer smaller than
+it, two casts are needed.
+3) Friend classes must be explicitly named as classes.
+.
+Revision 1.161 2001/08/05 00:27:56 set
+* Fixed: Problems with the detection of input/output functions provided by
+libc 2.1.3.
+
+Revision 1.160 2000/12/09 21:17:06 set
+* Applied changes from Anatoli to the WinNT port. They enhances the
+configuration process and fixes some problems and typos. Read-only temporals
+was fixed.
+* Reverted the if ( !key ) return False; added to TNSSortedCollection::search
+because it generated a nasty bug in the editor.
+* Updated the winnt/readme.txt to reflect the current steps.
+* Added a TODO file.
+.
+Revision 1.159 2000/09/24 14:53:46 set
+* Added: Endianess detection to the configure mechanism. It defines
+TV_BIG_ENDIAN for big endian machines.
+* Modified: Solved collisions between gettext and conio.h.
+* Added: New members to ipstream and opstream, they are intended to write
+architecture independent values to disk. This started with a patch from
+Jose Angel Sanchez Caso (JASC).
+* Added: Names for platform independent types in ttypes.h. Currently they are
+defined correctly only for x86 (gcc, MSVC and Borland).
+* Fixed: Unconditional inclusion of gpm in UNIX, this is not good.
+* Added: Big endian support in teditorf.cc by JASC.
+* Fixed: __linux__ conditionals made generic UNIX.
+* Merged some fixes to compile with -DNO_STREAM from Laurynas Biveinis
+<lauras@softhome.net>, more work is needed to complete it.
+
+Revision 1.158 2000/08/10 23:58:26 root (set)
+* Fixed: The glibc 2.1.3 outb check to be done by configure script. Hey!
+these guys have 2 errors: (1) they should provide a way to avoid collisions
+with kernel headers (they are older) and (2) They doesn't have the ".3" info,
+just 2 and 1 (MINOR), that's quite stupid.
+.
+Revision 1.157 2000/08/09 23:25:26 root (set)
+* Fixed: Now glibc 2.1.3 defines outb/inb so they get defined twice (glibc+
+kernel headers). I added a test to avoid including the kernel headers if they
+were defined. But I must check it because I don't have 2.1.3 at home.
+* Added: Now the compatibility layer saves the UID/GID when asking for the
+files attributes. Under DOS/Win32 this is avoided.
+
+Revision 1.156 2000/06/06 00:28:30 root (set)
+* Added: A warning message to the configure script if gpm can't be found under
+Linux.
+
+Revision 1.155 2000/06/06 00:12:55 root (set)
+* Fixed: [Linux] the dynamic library unconditionally requested libgpm even
+when the configure detected it wasn't installed.
+
+Revision 1.154 2000/06/04 18:40:39 set
+* Updated: The list of files and DOS files.
+.
+Revision 1.153 2000/05/23 01:43:23 set
+* Added: Now the configuration process generates the BC++ makefile. Even when
+people using BC++ won't use it I can use it to update the makefile.
+* Fixed: conflib.pl declared local variables wrongly.
+* Added: A function to conflib.pl to collect project items from a .mak.
+* Added: fileview.cc to the BC++ port.
+.
+Revision 1.152 2000/05/22 23:52:32 set
+* Modified: Now the configtv.h isn't generated if the new one is identical.
+It avoids a masive recompile after configuring.
+.
+Revision 1.151 2000/05/20 20:02:21 set
+* Modified: The generated make file to use PHONY and force a real check of
+all the dependencies even if the library is already generated.
+* Added: Now the win32/Makefile file is generated from the djgpp's file
+during the configuration process. For this I modified the djgpp/vga* files to
+produce no code if they are compiled without djgpp.
+* Added: a thanks section to the main readme.
+* Added: some details in the readme, specially about RMS doubts and what I'm
+doing about it. Also to make clear the win32 and winnt targets are there and
+both works for win32.
+* Fixed: a NO_STREAMABLE instead of NO_STREAM in tparamte.cc. Reported by
+Egon Eckert <egon@chance.cz>.
+* Merged changes from Anatoli Soltan. Now the BC++ code runs under Windows
+95 too!
+* Fixed: Some warnings emitted by gcc 2.95.2 with the examples/demo code.
+* Added: getcwd to the compatlayer library.
+
+Revision 1.150 2000/05/16 02:08:05 set
+* Added: A new constructor for TListBox and TSortedListBox that accepts two
+scroll bars. I don't know why original TV lacks it when TListViewer have it
+(base class).
+* Modified: The behavior of the TListViewer class, now when you press the
+left or right key and the viewer have and horizontal scroll bar and there is
+just one column the handleEvent calls to the scroll bar handleEvent instead
+of just return. I think that's very sensitive.
+.
+Revision 1.149 2000/05/13 16:02:39 set
+* Fixed: Yet another call to delete without []. Pointed out by Laurynas.
+.
+Revision 1.148 2000/05/12 23:13:05 root (set)
+* Fixed: Some details in the compat layer library to compile under Linux
+(first compilation issues ;-)
+
+Revision 1.147 2000/05/12 02:28:35 set
+* Incorporated the WinNT port (using BC++ 5.5) from Anatoli Soltan
+<anatoli@iname.com>.
+* Separated most OS sensitive stuff to a sub-library called "Compat Layer".
+This will break some code, specially RHIDE, so I'm changing the middle
+version. This new library allows clean support of DOS/djgpp, Linux/gcc,
+Win32/MingW32 and WinNT/BC++ without too much conditionals.
+.
+Revision 1.146 2000/04/29 17:09:42 set
+* Added: Mixer stuff.
+.
+Revision 1.145 2000/04/20 19:56:54 root (set)
+* Fixed: Some details in linux/tscreen.cc to try to compile it under other
+UNIX flavors. I disabled all the x86 specific code for other flavors (is i386
+and OS specific) and also changed some stuff that seems to be defined only
+by ncurses and not BSD's curses.
+
+Revision 1.144 2000/04/20 19:18:52 set
+* Modified: Some #ifdef __linux__ by TVOS_UNIX to test it under other
+flavors.
+.
+Revision 1.143 2000/04/13 01:07:02 set
+* Fixed: [DOS] Now when BIOS is selected the keyboard is polled really using
+BIOS. Previous code used djgpp's kbhit() and it doesn't really call BIOS.
+* Modified: Now the canScroll member of TInputLine is just protected and not
+private.
+.
+Revision 1.142 2000/04/13 00:41:17 root (set)
+* Updated: The Linux .gpr for the new headers structure (tv/...).
+* Fixed: Tab key problems when using the Eterm trick.
+* Fixed: Some warnings reported by gcc 2.7.2.3.
+
+Revision 1.141 2000/04/12 23:36:37 set
+* Added: A "non-inline" version of the functions defined in the djgpp's
+vgaregs.h file. They are needed to compile the DOS version without
+optimization. The problem was reported by Laurynas.
+.
+Revision 1.140 2000/04/12 23:13:48 set
+* Added: An example of autoconf/automake macro for the library. Contributed
+by Laurynas.
+.
+Revision 1.139 2000/02/27 18:30:20 set
+* Added: A callback to the TButton class. Now you don't need to create a new
+class just because a dialog have a non-standard button.
+.
+Revision 1.138 2000/02/27 15:06:18 set
+* Added: 32 bits versions of TRadioButtons and TCheckBoxes. They have the
+same name but just appends "32". These objects only override dataSize() to
+return 4. They are much better because: (1) You can have 32 items (not just
+16) and (2) structures doesn't need to be packed for 32 bits machines.
+.
+Revision 1.137 2000/02/05 22:22:20 set
+* Added: Now if a program executes a dialog while the desktop is locked it is
+temporally unlocked so the user can see the dialog and then is locked again.
+.
+Revision 1.136 2000/02/05 20:42:18 set
+* Added: Add and Done buttons to the FileOpenDialog, they are controlled by
+the fdDoneButton and fdAddButton options. They are suitable for selecting
+files used in a list (list of MP3s and project in my editor). Seuggested for
+RHIDE by Waldemar Schultz <schultz@ma.tum.de>.
+.
+Revision 1.135 2000/02/05 00:14:55 root (set)
+* Modified: [UNIX] gkeyli.cc now should compile in most UNIX systems that
+have ncurses. All the funcy Linux stuff is conditional.
+* Modified: [UNIX] the KEY_MOUSE ncurses value seems to be new in 1.9.9 so to
+support older versions (as 1.8.6) now their use is conditional.
+* Fixed: The dependencies in the Linux Makefile to accomodate the new
+location of the headers.
+* Added: -I/usr/local/include and -L/usr/local/lib to FreeBSD compilation
+flags. Most of these changes are towards FreeBSD support with the help of
+some tests by Alex Matulich <alex@unicorn.us.com>.
+
+Revision 1.134 2000/02/04 02:18:44 root (set)
+* Fixed: Tab is an exception to the modifications done in 1.129.
+
+Revision 1.133 2000/02/04 02:03:58 root (set)
+* Modified: The configure process now only configures the target OS.
+* Modified: TStatusItem now uses copies of the strings passed.
+
+Revision 1.132 2000/02/03 00:17:48 set
+* Added: Win32 target to the configure process. I must admit the user needs a
+very UNIXified system to run it joining Mingw32 with some goodies from Cygwin
+and Perl from djgpp but works as well as the DOS and Linux process.
+* Added: [Win32] A readme and a reference to it in the main readme.
+* Modified: [Win32] The Makefile to generate the demo.exe from it and be
+configured in a more common way. Also to name the library in the same way
+used under DOS and Linux. I think that's the Right Thing(TM) because in this
+ways programs can be ported from one platform to another without changes.
+.
+Revision 1.131 2000/02/01 01:51:36 set
+* Changed: Now tv.h is located in $prefix/include/rhtvision and the rest in
+$prefix/include/rhtvision/tv. It will avoid collisions with headers from
+other libraries. Suggested by Andris.
+.
+Revision 1.130 2000/02/01 00:15:01 set
+* Added: [Win32] A directory for the demo obj files.
+* Added: [Win32] Workaround for a "feature" in Mingw32 980701-4 localtime
+function. It returns a NULL pointer if the date is somewhat big.
+* Added: [Win32] Get/SetWindowTitle() members to TDisplay.
+* Added: Now the demo sets the window title (only supported for DOS target
+running under W95+ and Win32 currently).
+* Fixed: [Win32] Some warning in compilation.
+.
+Revision 1.129 2000/02/01 00:03:12 root (set)
+* Fixed: [Linux] An old annoying "feature" that made the code report control
+(arrows, etc.) keys as ASCII valid values. I got it reported many times but
+finally Andris triggered the fix.
+
+Revision 1.128 2000/01/29 15:27:42 set
+* NEW: Merged patches from Vadim Beloborodov <bvr@cc.pib.alex-ua.com> to
+support Win32 console.
+.
+Revision 1.127 2000/01/26 00:27:35 set
+* Added: A new couple of TScreen members to Set/Get the window title under
+Windows 9x. I hope to extend it to xterm.
+.
+-----------------------------------------------------------------------------
+v1.0.10 release.
+
+Revision 1.126 2000/01/02 16:38:59 set
+* Adjustments to realease v1.0.10.
+.
+Revision 1.125 1999/12/22 00:40:08 root (set)
+* Bug found: [Linux] When suspending a TV application in a remote terminal
+and using a font different than the default the frames gets scrambled when
+resuming the application. I can reproduce it, but I don't have a clue about
+the source of the problem. Remote terminals are complex and full of problems
+so I don't plan to spend time searching the source of the problem. Reported
+by Matt Mueller <donut@azstarnet.com>
+
+Revision 1.124 1999/12/19 19:50:08 root (set)
+* Added: Now the library also patches the Ctrl+Shift+Tab combination so the
+kernel reports it. Ivan reported it as a bug.
+
+Revision 1.123 1999/12/05 13:28:08 root (set)
+* Applied patchs from Ivan for the Debian files (sets architecture to any).
+
+Revision 1.122 1999/12/05 13:12:59 root (set)
+* Modified: Now the initialization of the TScreen is called from TProgInit.
+I must test it under DOS. The old methode failed for the examples.
+* Added: [Linux] An example on how to suspend an application with ^Z and then
+resume it.
+.
+Revision 1.121 1999/12/02 23:47:57 set
+* Fixed: A bug in the DeskLogo examples. Pointed as a problem by Arvin
+Baccay <arvinbaccay@yahoo.com>.
+.
+Revision 1.120 1999/11/20 14:52:55 set
+* Fixed: Problem with rhgdb messing terminal settings. Patch from Andris to
+enable the old code that saves/restores the terminfo stuff.
+.
+Revision 1.119 1999/11/04 01:12:09 set
+* Updated Debian files from Ivan.
+.
+Revision 1.118 1999/11/04 01:01:52 set
+* Modified: The code used to disable ^Q/^S is now more generic and also
+disables ^C, ^/ and ^Z.
+.
+Revision 1.117 1999/10/30 19:23:43 root (set)
+* Changed: Now TScreen is initialized from the TApplication constructor and
+not from a static variable that triggers the constructor. Suggested by
+Christoph Bauer <c_bauer@informatik.uni-kl.de>.
+
+Revision 1.116 1999/10/29 01:50:22 root (set)
+* Added: [Linux] call to dch to update the Debian version. Suggested by Ivan.
+
+Revision 1.115 1999/10/26 00:07:30 set
+* Added: TFileDialog is now "growable".
+* Added: [Linux] TScreen disables the Xon/Xoff flow control so ^Q/^S can be
+used in X terminals.
+.
+-----------------------------------------------------------------------------
+v1.0.9 release.
+
+Revision 1.114 1999/10/17 22:30:03 set
+* Updated for release of 1.0.9.
+
+Revision 1.113 1999/10/10 14:57:57 set
+* Added: Support for DOS greek keyboards.
+* Modified: Now all the classes that uses acelerators doesn't directly check
+the ASCII of the acelerator with the keyboard ASCII. That's because the same
+key could generate more than one ASCII. That's the case of greek keyboards
+where the keyboard generates the latin and greeks values.
+.
+Revision 1.112 1999/10/02 15:18:07 set
+* Added: some files missing in the distribution, not indispensable ones.
+* Added: [DOS] Now the configure script patches libint.h in case the user
+have a buggy one (found in gettext 0.10.32).
+.
+Revision 1.111 1999/09/28 02:25:00 set
+* Fixed: Applied patch for Debian files from Ivan.
+.
+Revision 1.110 1999/09/24 02:57:52 set
+* Fixed: I forgot to uncomment a test in the TListView class. It produced the
+wrong broadcast when the focus changed.
+
+Revision 1.109 1999/09/24 02:08:05 set
+* Fixed: Compilation problems in vgastate.h when using gcc 2.95. First
+reported by Laurynas and then by "Sriviroolchai, Tanes"
+<TS312094@exchange.Thailand.NCR.com> who included some notes from gcc's FAQ
+commenting about the problem.
+.
+Revision 1.108 1999/09/24 00:55:36 set
+* Fixed: A bug introduced by us to the TFileList class in the vertical scroll
+bar (wrong page step). I added a new member to TListViewer to fix it, is
+called setNumCols(int aNumCols) and it also updates scroll bars (not just the
+number of columns). Reported by Sean <sproctor@enter.net>.
+.
+Revision 1.107 1999/09/24 00:28:24 set
+* Added: Better handling of some situations in TScreen, patch from Robert:
+"I made now a patch for tscreen.cc to use at firts the infromation
+from terminfo to decide if we can use PAL_LOW ot PAL_HIGH
+and as next I used in mapcolor as the first choice the
+set_a_foreground and set_a_background strings and only if
+they are not defined using set_foreground and set_background.
+The reason for this is, that I analized some terminfo records and
+found, that often the set_a_... are defined but not the set_..."
+.
+Revision 1.106 1999/09/23 23:55:42 root (set)
+* Fixed: Relative symlinks for dynamic libraries [Linux]. Patch by Ivan.
+* Fixed: Pemission 644 and not 755 for libraries [Linux]. Patch by Ivan.
+* Added: Now the Linux compress updates the debian/control file.
+* Modified: The Debian scripts (by Ivan).
+
+Revision 1.105 1999/09/17 03:38:30 root (set)
+* Added: Support for the FHS in the configure script (not used for the
+library).
+* Fixed: Some details of the configure process for Linux.
+
+Revision 1.104 1999/09/16 02:26:54 set
+* Modified: Now the file open dialog have space for 2 more filenames.
+.
+Revision 1.103 1999/09/12 19:47:54 set
+* Moved a lot of code from the config.pl script to conflib.pl to share it
+with the editor.
+* Fixed: some small details in the configuration mechanism. Tested under DOS
+and works OK.
+.
+Revision 1.102 1999/09/12 00:38:24 set
+* Removed the compilation options from the .gpr files because that's
+configured by the configure mechanism now.
+* Added an option to makemak.pl to avoid displaying the installation options.
+That's to avoid confusion when the script is called from the makefile.
+
+Revision 1.101 1999/09/09 02:25:16 root (set)
+* Added: More details to the configure mechanism, including CFLAGS setting,
+a script to set my default values, corrections in the readme.txt, etc.
+
+Revision 1.100 1999/09/08 02:09:39 root (set)
+* Added: A config header (configtv.h), configuration for the makefiles and
+RHIDE projects, unified the intl.h headers and made conditional using a
+configuration variable and other configuration enhancements.
+.
+Revision 1.99 1999/09/07 01:12:26 set
+* Added: First attempt for a UNIXified configure/make/make install mechanism.
+Not using autoconf yet, just some Perl scripts.
+.
+Revision 1.98 1999/09/02 23:26:05 set
+* Fixed: I forgot some files, so I'm releasing a fixed .zip.
+.
+-----------------------------------------------------------------------------
+v1.0.8 pre-release.
+
+Revision 1.97 1999/08/29 20:20:13 set
+* Changes for release.
+
+Revision 1.96 1999/08/26 00:32:19 set
+* Applied 7 more patches from Laurynas Biveinis <lauras@softhome.net>:
+* Fixed: validation bypassed when switching windows
+* Fixed: missing stream class members in TSortedListBox
+* Fixed: memory leak in opstream::seekp
+* Fixed: potential crash in TListViewer::setRange
+* Fixed: Alt-number bypass view validation
+* Fixed: THistory::handleEvent doesn't always put '\0'
+* Fixed: TInputLine::options not read correctly
+* Also: Now is possible to pass backslashes to TDirListBox. Patch suggested
+by Laurynas too.
+
+Revision 1.95 1999/08/25 00:11:17 set
+* Fixed: One of the new broadcasts was overlying a TButton command. Now I
+moved the TButton command to the views.h file so it won't happend again. I
+don't know why the original programmers left a lot of things in the .cc files
+instead of putting them in the headers.
+.
+Revision 1.94 1999/08/22 23:26:54 set
+* Fixed: the doit UNIX script to apply the patches.
+* Modified: the number of one broadcast to be equal to the original.
+.
+Revision 1.93 1999/08/16 14:51:50 set
+* Added: As the VGA Save State BIOS call is amazingly buggy in a lot of video
+boards (Matrox in particular) I added a version of this service but made with
+low level in/out commands. Is relative complex to enable right now but will
+be easier in the future if I find it really solves the problems. Anders Blom
+<anders.blom@mbox322.swipnet.se> helped a lot testing it in your Matrox board
+and now also Nate Eldredge <nate@cartsys.com> is testing some of the
+routines.
+.
+Revision 1.92 1999/08/14 02:13:32 set
+* Applied 8 more patches from Laurynas Biveinis <lauras@softhome.net>:
+* Fixed: unnecesarry stack usage in drivers2.cc
+* Fixed: TNSCollection::error should be not static
+* Fixed: TPReadObjects::registerObject w/ and w/o assertion check.
+* Fixed: incorrect scroll arrow display in TInputLine
+* Fixed: EOF not always detected in ipstream
+* Fixed: memory usage bug in HistRect ctor
+* Fixed: TButton w/o bfDefault can became such.
+* Fixed: TDirListBox is unusable outside TChDirDialog
+* Added: I also added an oprator [] for collections. It isn't inline and can
+be used as an alternative of at() when the speed isn't so important but the
+size is the point.
+.
+Revision 1.91 1999/08/14 00:50:57 set
+* Applied 6 more patches from Laurynas Biveinis <lauras@softhome.net>:
+* Fixed: unnecesary TInputLine scrolling.
+* Fixed: if TListViewer has no scrollbar, it's never redrawed.
+* Fixed: TMenuView bug - ability to execute disabled items.
+* Fixed: TMenuView::updateMenu crash.
+* Fixed: TStringList does not properly read strings.
+* Fixed: TWindow frame lost if valid(cmClose) == False
+.
+Revision 1.90 1999/08/11 01:43:49 set
+* Applied 7 patches from Laurynas Biveinis <lauras@softhome.net>, he adapted
+a lot of patches floating around the net for the original TV to this port:
+* Fixed: TGroup re-entrancy fix
+* Fixed: memory leak in TNSCollection
+* Fixed: disabled views can be selected through labels
+* Fixed: TCheckBoxes & TRadioButtons problem with streams
+* Fixed: TChDirDialog::shutDown()
+* Fixed: TEditor sometimes fails to find words
+* Fixed: bug in TFileDialog::valid()
+
+Revision 1.89 1999/08/07 21:30:11 set
+* Added: Now TListViewer is verbose and sends a broadcast when a new item is
+focused. It can be used to update other views according to it.
+* Updated Robert Hoehne's license text.
+.
+Revision 1.88 1999/08/03 02:04:57 set
+* Added: Now TClusters (TRadioButton and TCheckBox) sends broadcasts to your
+owner each time the movedTo and press member are called. This behavior is the
+default but can be disabled setting the TCluster::extraOptions static
+variable to 0. The new broadcasts sends a pointer to the view that is sending
+the message, the owner must know what exactly is this pointer.
+.
+Revision 1.87 1999/08/02 00:44:24 set
+* Modified: Now TFileCollection sorting is configurable. By default it sorts
+like the Turbo Vision help says (directories at the end of the list, no case
+sensitive, .. is the last in the list). I did it because many people seems to
+like it, I like another layout and Robert yet another. So now everybody can
+get what s/he wants ;-)
+.
+Revision 1.86 1999/08/01 18:01:46 set
+* Added: Now TWindow::close() sends a broadcast cmClosingWindow to
+TProgram::Application.
+.
+Revision 1.85 1999/08/01 13:34:13 set
+* Added: Now is possible to setup TDeskTop so windows are tiled first
+vertically. For it I added get/setOptions members to TDeskTop, it get/sets
+a flags variable. The dsktTileVertical is the only flag available now.
+.
+Revision 1.84 1999/07/31 19:52:31 set
+* Fixed: In the TDemo example: I forgot to add the link request for the
+streaming structures of the calculator that now are in the library. Reported
+by Laurynas.
+.
+Revision 1.83 1999/07/31 19:47:52 set
+* Fixed: A couple of warnings about delete (void *) reported by gcc 2.95 in
+the examples.
+* Fixed: A call to delete without [] in dirent.h. Patch by Laurynas.
+.
+Revision 1.82 1999/07/27 22:06:03 root (set)
+* Fixed: Some calls to delete instead of delete[] and delete instead of free.
+Patches and suggestions by Laurynas Biveinis <lauras@softhome.net>.
+* Added: Now TProgram::idle() releases the CPU by default. You can avoid it
+with TProgram::doNotReleaseCPU=1;. Suggested by Laurynas.
+
+Revision 1.81 1999/07/26 23:48:33 set
+* Added: TListBoxRec is now publically available from the headers.
+* Modified: TSortedListBox::searchPos is now protected instead of private so
+childs can know something about the incremental selection.
+.
+Revision 1.80 1999/07/21 01:15:14 set
+* Added: A script to create snap-shots as diffs.
+.
+Revision 1.79 1999/07/17 22:03:37 root (set)
+* Fixed: When exiting and the screen is already suspended I avoid cleaning
+it because it is supposed to be already cleaned. Not sure is the best, I
+tested it in ttyN and ttypN and works ok for the command line options.
+
+-----------------------------------------------------------------------------
+v1.0.7 release.
+
+Revision 1.78 1999/07/13 23:10:05 set
+* Fixed: 18 const name... in the examples. Reported by Matt Mueller
+<donut@azstarnet.com>.
+* Added: example on how to release the CPU in the idle() member to the demo
+example [Linux patch by Matt, I did the djgpp part].
+.
+Revision 1.77 1999/07/12 23:36:58 root (set)
+* Added: An Eterm theme example and instructions to install it.
+
+Revision 1.76 1999/07/07 23:02:04 set
+* Added: a new couple of members to TCommandSet, they are used to enable or
+disable a range of commands. I usedit in the editor to disable all the editor
+commands when the editor loses the focus. I think that's usefull for any
+class that have a big number of commands. The editor currently have over than
+128 commands.
+.
+Revision 1.75 1999/07/03 16:55:54 set
+* Fixed: Another call to delete instead of delete[] in the TInputLine
+destructor. Patch by Laurynas Biveinis <lauras@softhome.net>.
+.
+Revision 1.74 1999/07/01 02:42:49 root (set)
+* Added: Support for the --report-as-keysyms options of Eterm 0.8.10. It
+makes the programs work very well under Eterm, example: in my editor now is
+posible to select text with shift and use strange keyboard combinations as
+Ctrl+Shift+Insert. With it the support for Eterm is just excellent, slow but
+very complet. (Note: I added this swithc to Eterm ;-) THANKs goes to mej
+that accepted the patch and commited it in the CVS tree).
+
+Revision 1.73 1999/06/30 23:29:42 set
+* Fixed: windowSizeChanged is from TDisplay, but was declared as TScreen
+member, gcc 2.96 warns about it as an ANSI C++ violation.
+.
+Revision 1.72 1999/06/27 20:40:47 root (set)
+* Added: More information in Linux TScreen module for cases where the
+library fails to open the terminal for output. It seems to happend in some
+new Linux installations.
+
+Revision 1.71 1999/06/27 20:19:47 set
+* Fixed: TFileInfoPane was using an unitialized buffer when the open dialogs
+didn't have any match.
+
+Revision 1.70 1999/06/25 01:29:06 root (set)
+* Ported: The TChdirDialog class to Linux. It was there but was a dummy. Now
+I can navigate the disk with it.
+.
+Revision 1.69 1999/06/24 22:33:53 set
+* Modified: Now the File Dialog uses an horizontal scroll bar and 2 columns
+when only SFNs are available and a vertical scroll bar and 1 column when LFNs
+are available. Ivan complained about the horizontal bar ;-)
+.
+Revision 1.68 1999/06/24 01:55:10 set
+* Added: The Calculator from the TVDemo to the library. I did a lot of
+changes to the class (it was buggy and had portability problems). Now you
+can have the calculator in any program use Uses_TCalculator, see the demo
+for an example.
+.
+Revision 1.67 1999/06/23 23:05:34 set
+* Added: Select button to the TFileDialog class (option: fdSelectButton
+command: cmFileSelect).
+* Modified/Fixed: Now the TFileList generates the cmFileDoubleClicked
+broadcast as specified in the TVision help (was a bug in 1.03 fixed in 2.0).
+.
+Revision 1.66 1999/06/23 02:31:30 set
+* Changed: The distance between the buttons in the File Dialog, it was 3 and
+now is 2 to allow more buttons (my editor adds 2 buttons).
+.
+Revision 1.65 1999/06/23 01:15:56 set
+* Modified: Now the file dialog doesn't show ".." in the root directory (DOS).
+* Fixed: Calling the file dialog with fdNoLoadDir (needed to avoid an extra
+directory read, sometimes quite slow) was using a null pointer, also fixed
+a memory leak (not releasing the current directory in readDirectory) and
+changed delete (char *)directory to delete[] directory;
+.
+Revision 1.64 1999/06/16 01:44:04 root
+* Added: Now the Linux keyboard routines disables ^Z because it is dangerous.
+Sugested by Luis Pistoia <lu5gpl@arnet.com.ar>.
+.
+Revision 1.63 1999/06/12 00:16:15 set
+* Fixed: Some calls to delete for memory allocated with new[]. Patchs from
+Laurinas, some of them overlaps with patches from Andris.
+.
+Revision 1.62 1999/06/11 23:55:14 set
+* Fixed: Some calls to delete operator passing a void *. Now falling back to
+char *. Also the new operator in HistRec class was returning 0 and the new
+drafts says it should rise an exception instead. These things are reported
+by egcs 2.95.x snapshots with two new warnings:
+warning: `void *' is not a pointer-to-object type
+operator new should throw an exception, not return NULL
+The basic patches (I changed them before applying) were sent bt Andris
+Pavenis (he ever uses a cutting edge version of the compiler).
+.
+Revision 1.61 1999/06/11 00:21:52 set
+* Included some files I forgot in the list (keyboard extender and pif
+example).
+.
+-----------------------------------------------------------------------------
+v1.0.6 release.
+
+Revision 1.59 1999/06/05 22:38:19 root (set)
+* Applied patches for Debian package v1.0.5-2. (from Ivan).
+
+Revision 1.58 1999/06/05 02:18:59 set
+* Modified: The destroy0 macro to be possible your use in cases like:
+if (...) destroy0(...); Suggested by Laurynas Biveinis <lauras@softhome.net>.
+Patch from Laurynas rejected because is not practical (generates temporals).
+.
+Revision 1.57 1999/06/05 01:35:19 set
+* Fixed: Calls to delete without using []. According to new standards:
+Here is text from a relative old draft of the standard:
+0 Accredited Standards Committee* Doc No:X3J16/96-0225
+ X3, INFORMATION PROCESSING SYSTEMS WG21/N1043
+...
+ 5.3.4 New [expr.new]
+...
+21The way the object was allocated determines how it is freed: if it is
+ allocated by ::new, then it is freed by ::delete, and if it is an
+ array, it is freed by delete[] or ::delete[] as appropriate.
+...
+ 5.3.5 Delete [expr.delete]
+...
+2 ... . In either alternative, if the value of the
+ operand of delete is the null pointer the operation has no effect. In
+ the first alternative (delete object), the value of the operand of
+ delete shall be a pointer to a non-array object created by a new-
+ expression, or a pointer to a sub-object (_intro.object_) representing
+ a base class of such an object (_class.derived_). If not, the behav-
+ ior is undefined. In the second alternative (delete array), the value
+ of the operand of delete shall be the pointer value which resulted
+ from a previous array new-expression.18) If not, the behavior is unde-
+ fined. [Note: this means that the syntax of the delete-expression
+ must match the type of the object allocated by new, not the syntax of
+ the new-expression. ] [Note: a pointer to a const type can be the
+ operand of a delete-expression; it is not necessary to cast away the
+ constness (_expr.const.cast_) of the pointer expression before it is
+ used as the operand of the delete-expression. ]
+ _________________________
+ 18) For non-zero-length arrays, this is the same as a pointer to the
+ first element of the array created by that new-expression. Zero-
+ length arrays do not have a first element.
+And the comp.lang.c++ FAQ says:
+[16.12] Can I drop the [] when deleteing array of some built-in type
+(char, int, etc)?
+No!
+Patches to add [] in some necesary places and FAQ quotation provided by
+Laurynas Biveinis <lauras@softhome.net>.
+I also applied the part that says that is not necesary to cast a const
+char * to char * when calling delete.
+.
+Revision 1.56 1999/06/05 00:40:35 set
+* Fixed: Some key bindings in TEditor class (Enter and Backspace for example).
+* Modified: Now the doEditDialog function provided in tvedit3.cc can be used
+for quick applications because I defined a new version:
+ushort doEditDialogDefault( int dialog, va_list arg )
+So you can set TEditor to your own function, handle only some cases and call
+doEditDialogDefault for the rest. I used it for the installer of the editor.
+.
+Revision 1.55 1999/05/29 00:52:23 root (set)
+* Removed some Debian files no longer needed (Ivan).
+
+Revision 1.54 1999/05/28 01:02:39 set
+* Added: Windows NT detection (using the OS environment variable) to the
+mouse class so now if NT is detected the mouse is polled and not hooked.
+Looks like NT's mouse driver emulation fails to call the RMCB and jumps to
+nowhere crashing. Now the mouse is functional in NT.
+* Added: A workaround for a bug in Windows NT 4.0 when setting the video
+modes with int 0x10. Looks like this bug isn't reproductable in all the
+machines but happends in the one I used. NT is clobbering the number of tics
+since midnight in the BIOS data area, the number that appears is big enough
+to generate a divide overflow in the next call to int 0x21 service 0x2C (get
+time), as that's an exception in the real mode code the djgpp program is
+killed or hangs.
+.
+Revision 1.53 1999/05/26 00:03:51 set
+* Fixed: a leak in TResourceFile constructor. Patch submited by Laurynas
+Biveinis <lauras@softhome.net>.
+
+Revision 1.52 1999/05/23 22:58:08 root (set)
+* Modified: Now, in Linux, left alt and right alt are different keys. I did
+it because that's the only way to paste with gpm.
+.
+Revision 1.51 1999/05/21 14:10:02 root (set)
+* Fixed: When I removed some code in TScreen I made stdout the output of the
+library, but then redirecting the stdout from the program and printing sent
+undesired escape sequences to the redirected file. For this reason I open the
+tty with other file handle. *NHP* (Never Hit Public, it means only I used a
+version with this bug).
+
+Revision 1.50 1999/05/20 22:57:25 root (set)
+* Fixed: Now Uses_TStrListMaker defines Uses_TStringList. Patch by Laurynas
+Biveinis <lauras@softhome.net>.
+
+Revision 1.49 1999/05/20 02:00:02 root (set)
+* Changed: Now TScreen shows an error message if you redirect stdout in the
+Linux version, that's nicer than the old behavior: SIGSEGVs ;-)
+* Modified: Now TScreen includes sys/io.h instead of sys/perm.h for glibc
+because looks like sys/perm.h isn't included in Alpha/Linux's glibc.
+Sugested by Dim Zegebart <zager@post.comstar.ru>.
+
+Revision 1.48 1999/05/19 23:27:55 set
+* Fixed: a bug in TStrListMaker destructor, ugh! looks like nobody used it
+;-). Patch by Laurynas Biveinis <lauras@softhome.net>.
+.
+Revision 1.47 1999/05/16 22:09:14 root (set)
+* Added: My DOS TSR to enhance the keyboard to the distribution.
+* Added: A .pif example showing how to prevent using the program in a window
+and recover some keys like Alt+Space.
+* Moved the Linux code from screen.cc to classes/linux/tscreen.cc.
+* Added: The ability to use VCSAs even if they are write only.
+* Removed the tcget/setattr calls from TScreen because that's done by ncurses.
+* Added: A variable to fine tune the video driver called
+TurboVision_screenOptions, by now only have meaning under Linux and is used
+to tell the TScreen class to not use VCSAs if they are write only (because
+then suspend/resume doesn't work properly).
+* Modified: Now Alt+key doesn't have any ASCII value associated so if you
+press Alt+8 the program won't display 8 if there is no action for Alt+8.
+* Added: Documentation in the readmes about the limitations and
+particularities of each platform. For example: what doesn't work when using
+telnet, how can you paste using gpm, etc.
+
+Revision 1.46 1999/05/15 23:51:09 root (set)
+* Good news for xterm funs:
+* Fixed: A bug in the startcurses() that made xterm report the wrong codes
+for arrow keys and other keys.
+* Fixed: A bug and a lack of some stuff during the exit that left the
+terminal in a wrong state after exit (including not restoring the screen)
+* Added: Support for mouse, isn't as good as gpm because you can't track the
+position in real time, but you can resize and move windows anyways.
+* Fixed: A bug in the bold reset code, it made a funny effect: when starting
+the desktop was with normal fonts, but with the use all were becoming bold.
+* Fixed: xterm (and others) doesn't have 16 backgrounds and the color dialog
+was trying to show 16.
+* Fixed: Now the "User screen" works when the program is in a terminal.
+* Added: A temporal workaround to support Eterm when the user have TERM=xterm
+(the default in Debian, bug mess Home and End). You need ncurses 4.2 for that.
+* Discovered: A thing that was floating in my mind: why mc interfers? simply:
+mc runs the childs in ttypN consoles, so you are in a terminal when starting
+the editor from mc.
+* Modified: Now the ESC delay is 100ms and not 1s.
+* Fixed: The DEC character mapping for the scroll bar that is full and the
+block used for the color selector. They aren't pretty but at least you can
+understand what they mean.
+* Added: Handling for SIGWINCH, so now TV applications are resized if the
+xterm window is resized.
+
+Revision 1.45 1999/05/13 03:05:03 root (set)
+* Added: Support for xterm way of reporting ALT+key (key | 0x80). Now the
+startcurses() routine sets the "XtermMode" when the TERM is xterm*. It makes
+the editor work much better under xterm, at least in my system.
+
+Revision 1.44 1999/05/12 00:46:41 set
+* Fixed: A bug in TSortedListBox when pressing delete it was dereferencing
+curString[65536] when the variable is a 256 bytes buffer producing random
+crashes. Reported by Christopher Nelson <paradox@gye.satnet.net>.
+* Fixed: The logic in backspace used by TSortedListBox was wrong, now seems
+to work as expected. I saw it while fixing the other.
+.
+Revision 1.43 1999/05/10 22:44:32 set
+*** NEW *** Thanks to the effort by Dim Zegebart <zager@post.comstar.ru>
+(who had patient to test my patches in this platform and send me the errors
+reported by gcc and trace backs from the crashes) we managed to get the first
+TV programs running in Alpha/Linux.
+* Changed: Now the TScreen::screenBuffer member is an (ushort *) instead of
+a long. I did it because the code for screen used a lot of casts and have
+some errors casting this value to (int) which works in i386 but generated a
+SIGSEGV under Alpha ;-).
+.
+Revision 1.42 1999/05/08 01:49:00 set
+* Changed: The initialization for TEventQueue::eventQueue. Looks like egcs
+2.91.66 doesn't like partially initialized structures and what is worst likes
+to crash if the non-initialized part is an anonymous union (like in TEvent).
+In Linux egcs dies, in W95 survives and you get the warning. Ivan reported it
+when he tried to make a .deb for Potato using egcs 1.1.2.
+.
+Revision 1.41 1999/05/06 03:36:24 set
+* Added: Now TMenuBar and TStatusLine uses one character around the name of
+the item in *both* sides and don't overlap with the next. That's the original
+behavior of TV. As it will reduce the number of visible items in the menu
+bar for RHIDE (specially in spanish ;-) I added code to automagically compact
+the items when they don't have enough space. The compactXXXX member reflects
+it and can be forced externally. The value is computed in the constructors
+and in the changeBounds. The changes where based in a patch that "Norberto
+Alfredo Bensa" <norberto.bensa@abaconet.com.ar> sent me to unconditionally
+have the original behavior (which is unacceptable for RHIDE). So I did it in
+a way that won't mess RHIDE and is good for users at the same time.
+.
+Revision 1.40 1999/05/02 14:00:36 set
+* Added: The desklogo example to the distribution. I already added it in the
+CVS tree (see Revision 1.26) but forgot to add it to the list of distributed
+files. Noted by "Norberto Alfredo Bensa" <norberto.bensa@abaconet.com.ar>
+.
+Revision 1.39 1999/05/02 13:51:09 set
+* Avoided the distribution of the Debian files in the DOS release because
+these files aren't 8+3 clean and will confuse users.
+.
+Revision 1.38 1999/04/28 22:57:09 set
+* Enclosed all the monochrome code that makes I/O access to the MDA registers
+and maps the video memory under Linux with #ifdef __i386__ because looks like
+it isn't good idea for Alpha machines ;-).
+.
+Revision 1.37 1999/04/27 22:34:24 set
+* Ported the TParamText class from TV 2.0. The old version seems to be from
+1.03 and wasn't portable, in fact it failed to even compile under Alpha
+Linux. I added some check to avoid a buffer overflow, something that the
+original library never did. I also adapted the getText member for our port
+that uses an extra parameter (again to avoid buffer overflows).
+.
+-----------------------------------------------------------------------------
+v1.0.5 released. Sources uploaded to DJ's server and my home page. Linux
+sources uploaded to my home page. Sources sent to www.linux.org.ar (DanX).
+
+Revision 1.36 1999/04/21 22:46:34 set
+* Fixed: The open dialog didn't allow to open files using [];,=+ That's OK
+for plain DOS, but when running in Win9x+GUI the LFN API supports it.
+
+Revision 1.35 1999/04/18 22:19:18 root
+* Applied changes to the Debian files from Ivan.
+.
+Revision 1.34 1999/04/13 00:58:11 set
+* Modified: The default VESA routines to avoid using DOS allocated memory for
+the video mode information. I did it because at least one VESA 2.0 TSR for
+S3 chipsets returns more memory than the specified by the spec and corrupts
+memory. It could be one of the problems with S3 boards.
+.
+Revision 1.33 1999/04/10 23:44:10 set
+* I was debugging my editor with YAMD to find malloc/free errors, out of
+bounds read/writes and leaks. As a result I added propper memory deallocation
+to various classes:
+* Added: delete mouse to ~TEventQueue.
+* Added: delete font to ~TDisplay.
+* Modified: TPWriteObjects to destroy your items.
+* Added: free to the screen stuff.
+* Added: destroy0 to the object.h, that's a macro to call destroy and assign
+0 to the freed pointer.
+* Added: a member function to collections called setOwnerShip. Passing false
+to it the items of the collection aren't removed by shutDown (usefull for
+collections of static strings).
+.
+Revision 1.32 1999/04/04 01:42:36 set
+* Fixed: Problems in intl.h with glibc>=2.1. Patch provided by Andris.
+* Fixed: TChDirDialog used a fixed maxlength for the directory name instead
+of using a limit from the headers. Patch provided by Andris.
+* Fixed: TTerminal::prevLine was 100% broken. I rewrote it. Reported by
+Andris.
+* Fixed?: a label at the end of the post inst files for Debian. Ivan told me
+what was needed, not sure if I did it ok.
+.
+Revision 1.31 1999/04/01 01:28:52 set
+* Fixed: Now you can set a VESA video mode using void TDisplay::setCrtMode.
+It wasn't possible before because it ever used service 0, now if the mode is
+greater than 0x100 I use VBE.
+.
+Revision 1.30 1999/03/24 23:03:38 root
+* Incorporated the 1.0.3-6 Debian package diffs.
+* Fixed: Problem with dependencies of the .so library (by Ivan).
+.
+Revision 1.29 1999/03/23 01:01:38 set
+* Added an explanation in the readme.txt about the debian directory that will
+generate warnings when uncompressed in plain DOS.
+* Modified the compress.pl scripts to only replace vX.X.X in the readme and
+not just X.X.X.
+.
+Revision 1.28 1999/03/23 00:50:35 set
+* Changed the name of the library because Sigala's port is older in the Linux
+arena and I think the right thing is to differentiate this port calling it
+librhtv.a instead of libtv.a. For this reason I changed all the references to
+the old name.
+* Changed to version 1.0.5 in the scripts.
+* Added the Debian stuff to the sources distribution. It will generate some
+warnings when using 8+3 filenames in the uncompressor but these files aren't
+needed for DOS.
+.
+Revision 1.27 1999/02/23 22:45:26 root
+* Tested the Debian distribution stuff. Works after a couple of small patches
+to the rules make script.
+.
+Revision 1.26 1999/02/23 00:06:25 set
+* Added an example of how to change the desktop appearance. Contributed by
+Joel <jso@europay.com>.
+.
+Revision 1.25 1999/02/22 23:04:30 set
+* Included the debian directory for the debianization but yet not included in
+the distribution package. Debian package by Ivan Baldo <lubaldo@adinet.com.uy>
+.
+Revision 1.24 1999/02/18 02:41:34 set
+* Compiled with djgpp v2.02 and gcc 2.8.1.
+.
+-----------------------------------------------------------------------------
+v1.0.4 released. Sources and binaries uploaded to DJ's server and my home
+page. Linux sources and binaries uploaded to my home page (including a
+dynamic version).
+
+Revision 1.23 1999/02/16 00:33:56 set
+* Added more information in readme.txt and fixed some typos.
+* Changed the version to 1.0.4 because I'll release it soon.
+
+Revision 1.22 1999/02/10 22:10:29 set
+* Fixed a bug in the new terminals code for frames (I forgot to initialize
+the array when we use the PC characters).
+.
+Revision 1.21 1999/02/07 13:56:54 set
+* Added a "Try" button to the TColorDialog. It makes a redraw of the screen
+and generates a cmUpdateColorsChanged broadcast. The broadcast should be used
+by special classes that needs to know that the colors changed, the only one
+I know about is my own editor that have a color's cache. This idea was based
+on a crazy report by "a.meyer" <hexx3000@schaltzentrale.mvnet.de> ;-).
+* Added a Uses_TColorCommands request for the cmUpdateColorsChanged located
+in colorsel.h.
+.
+Revision 1.20 1999/02/02 23:03:19 root (set)
+* Adapted the TEditor family to Linux (file I/O stuff and \r\n differences).
+
+Revision 1.19 1999/02/02 01:55:54 set
+* Added the TEditor, TFileEditor, TEditorWindow and TMemo classes. I taked
+the code from the old RHIDE BETA 4 and adapted it for the new keyboard and
+did other small changes.
+* Added TEditorApp to the library and a small example to test it.
+
+Revision 1.18 1999/02/02 00:56:55 set
+* Minor changes in the readme.txt and porting.txt to give some hints.
+.
+Revision 1.17 1999/01/31 20:12:44 set
+* Added support for S3 (buggy) BIOSes in vesa.cc. It helps to support VESA
+text modes when using S3 boards. Reported and tested by Jerzy Witkowski
+<jwi@pl.ibm.com>.
+
+Revision 1.16 1999/01/31 19:20:14 root (set)
+* Adjusted the examples for Linux (some used dos.h).
+* Cleaned the /usr/... dependencies in the example gprs.
+* Trying to start a shared repository between DOS and Linux.
+.
+Revision 1.10 1999/01/22 01:21:19 root (set)
+Passed the changes from DOS to Linux.
+
+Revision 1.14 1999/01/22 01:05:37 set
+* Fixed the UNIX terminals code to use the ACS_xxxx macros for the frames
+instead of falling back to just ASCII. It makes the program look *much*
+better when using xterm, gnome-terminal, eterm, etc.
+
+Revision 1.13 1999/01/22 00:34:11 set
+* Added clarification in the readme.txt about: license, RHIDE version needed
+no-rtti stuff.
+* Made the n() macro in tvutil.h visible only when Uses_n is defined.
+(Problems reported by Jerzy Witkowski <jwi@pl.ibm.com>).
+* Fixed the examples to avoid warnings about NULL redefined.
+.
+Revision 1.12 1999/01/19 22:54:22 set
+* Fixed the gkey.gpr to be usable by anyone ;-). I added an rhide.env file to
+give just another example on how to use it with TVision.
+.
+Revision 1.11 1999/01/19 22:33:36 set
+* Released the 1.0.3 version and uploaded to DJ's server.
+.
+Revision 1.9 1999/01/18 22:55:18 root (set)
+* Copied the changes from DOS.
+* Added the versions of libraries I use for Linux in the change.log.
+
+Revision 1.10 1999/01/18 22:41:54 set
+* Fixed the djgpp makefile switchs.
+* Added code to the compress perl script to regenerate the makefile if the
+it's older than the project.
+
+Revision 1.9 1999/01/13 23:26:57 set
+* Added "delete.me" files to ensure the empty directories are packaged.
+* Silly boy, silly boy, I don't how but some silly options were included in
+the DOS libtv.gpr (-funsigned-char and a -W that makes problems with gcc
+2.7.x).
+* Moved the #include of the standard headers to include these headers before
+the C++ headers. If I don't do it default djgpp installations barf about
+redefined NULL (no Linux libc5 nor glibc).
+* Added instructions to workaround a bug in the gettext distribution for
+djgpp.
+.
+Revision 1.8 1999/01/13 00:55:43 set
+Passed the changes to DOS.
+.
+Revision 1.7 1999/01/13 00:35:35 root (set)
+Added a linuxso directory to create the dynamically linked version of the
+library.
+
+Revision 1.7 1999/01/10 16:25:41 set
+Fixed the demohelp.h32 name (to be lowercase).
+
+Revision 1.6 1999/01/10 16:04:05 root (set)
+Added demo to the Linux distribution.
+.
+Revision 1.6 1999/01/10 00:47:21 set
+Added the Borland's TVision demo. I taked it from the Sigala's port.
+
+Revision 1.5 1999/01/09 20:13:10 set
+Incorporated nine examples that implements various widgets. They are very
+small applications so the user can see how a simple TVision application can
+be setup.
+.
+Revision 1.4 1999/01/09 17:29:09 set
+Changed compress.bat for a Perl script that generates the manifest and
+version djgpp files and compress the files in the djgpp fashion. Asked by DJ.
+.
+Revision 1.3 1999/01/09 17:24:58 set
+Modifications from Linux version.
+.
+Revision 1.4 1999/01/09 16:14:41 root (set)
+Changed linux/compress by a Perl script that updates readme.txt (version),
+generates the tarred files with the right version name and creates the .lsm.
+(linux/compress)
+
+Revision 1.3 1999/01/09 14:40:24 root (set)
+Changed the Linux compress script to be much more efficient. Added a couple
+of files to indicate files to include/exclude in the Linux distribution.
+Changed the name of the Linux distribution to 'rhtvision' to avoid collisions
+with the already existing tvision package by Sergio Sigala.
+
+gkey.cc
+Modified to support a command line switch that enables the new keyboard
+mapping the old is the default because is the most common (Debian 2.0 and
+Red Hat 5.1).
+
+gkeyli.cc
+Added TGKey::SetKbdMapping to support the new keyboard mapping found in the
+kbd package shipped with Red Hat 5.2. Using
+TGKey::SetKbdMapping(KBD_REDHAT52_STYLE) the new mapping is enabled. It
+supports F1-F12, Shift+F1-F12 and Ctrl+F1-F12. Not only a special keyboad map
+is needed but a special linux terminfo description is needed too.
+If the program runs in console that's not needed but you'll get only F1-F10.
+
+Revision 1.2 1998/12/30 01:01:12 set
+Removed the redundant translation of the Linux IOCTL shift flags to BIOS
+format.
+Moved 90% of the conditional code to the Linux module.
+Fixed the Linux code to report left and right alt.
+Added entries to patch the right alt + function key, not only left alt.
+Added Shit+PgUp, Shift+PgDn, Ctrl+Backspace and Ctrl+Space to the list of
+patched keys.
+
+Release 1.0.1
+
+* Some changes in the readmes and gpr files.
+* Patches from Robert.
+
+date: 1998/12/14 23:36:35; author: set;
+Converted all the calls to ctype functions to macros. These macros avoids
+passing negative values.
+Added right dependencies in gpr and makefiles.
+
+Revision 1.1 1998/12/22 23:57:46 set
+Renamed readme.src to readme.txt.
+Added a small change.log, not yet definitive.
+
+Release 1.0.0
+
+* Arranged the first release
+
+date: 1998/12/14 22:03:08; author: set;
+Imported the pre-release 1.0.0. These are the files I sent to Robert for
+revision.
+
diff --git a/tvision/classes/alcon/alcon.cc b/tvision/classes/alcon/alcon.cc
new file mode 100644
index 0000000..df3754b
--- /dev/null
+++ b/tvision/classes/alcon/alcon.cc
@@ -0,0 +1,1632 @@
+/*
+ Copyright (c) 2001-2009 by Salvador E. Tropea (SET) <set@ieee.org>
+ Copyright (c) 2003-2004 by Grzegorz Adam Hankiewicz
+
+ This code is covered by the GPL license. A copy of the license should
+ be provided in the same package.
+
+ Modified by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>
+ to be used as a Turbo Vision driver.
+
+ conio.h emulation library on top of Allegro
+*/
+
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_string
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TGKey
+#include <tv.h>
+#include <tv/gkey.h>
+#include <tv/alcon/alcon.h>
+
+#ifdef HAVE_ALLEGRO
+
+#include <allegro/internal/aintern.h>
+
+// Forward declarations.
+static void AlCon_LoadCustomFont(const char *filename, uchar *fdata, unsigned fw, unsigned fh);
+static void AlCon_AllocateMemoryBuffer(void);
+
+// Globals internal to AlCon.
+static FONT *Alcon_CurrentFont=NULL;
+
+static FONT Alcon_PrimaryFont;
+static FONT_GLYPH *Alcon_ASCIIDataP[256];
+static FONT_MONO_DATA Alcon_ASCIIMonoFontP =
+{
+ 0x0, 0x100, /* begin, end characters */
+ Alcon_ASCIIDataP, /* the data set */
+ 0 /* next */
+};
+
+static FONT Alcon_SecondaryFont;
+static FONT_GLYPH *Alcon_ASCIIDataS[256];
+static FONT_MONO_DATA Alcon_ASCIIMonoFontS =
+{
+ 0x0, 0x100, /* begin, end characters */
+ Alcon_ASCIIDataS, /* the data set */
+ 0 /* next */
+};
+
+static FONT Alcon_CursorFont;
+static FONT_GLYPH *Alcon_CursorData[2];
+static FONT_MONO_DATA Alcon_CursorMonoFont =
+{
+ 0x0, 0x2, /* begin, end characters */
+ Alcon_CursorData, /* the data set */
+ 0 /* next */
+};
+
+static
+AlCon_Color BIOSPalette[16]={
+{ 0x00, 0x00, 0x00, 0 },
+{ 0x00, 0x00, 0xA8, 0 },
+{ 0x00, 0xA8, 0x00, 0 },
+{ 0x00, 0xA8, 0xA8, 0 },
+{ 0xA8, 0x00, 0x00, 0 },
+{ 0xA8, 0x00, 0xA8, 0 },
+{ 0xA8, 0x54, 0x00, 0 },
+{ 0xA8, 0xA8, 0xA8, 0 },
+{ 0x54, 0x54, 0x54, 0 },
+{ 0x54, 0x54, 0xFC, 0 },
+{ 0x54, 0xFC, 0x54, 0 },
+{ 0x54, 0xFC, 0xFC, 0 },
+{ 0xFC, 0x54, 0x54, 0 },
+{ 0xFC, 0x54, 0xFC, 0 },
+{ 0xFC, 0xFC, 0x54, 0 },
+{ 0xFC, 0xFC, 0xFC, 0 }};
+AlCon_Color AlCon_CurPalette[16];
+
+static int cursorX, cursorY;
+static int cursorPX, cursorPY;
+
+/*
+ The variables AlCon_ScreenWidth, AlCon_ScreenHeight,
+ AlCon_FontWidth and AlCon_FontHeight are read only. They are
+ modified ONLY when the font is changed. The first two tell the
+ number of text characters that fit into the physical screen. The
+ last two tell the number of screen pixels a text cell has in
+ Allegro. The font size is initialised by default to a 8x16 font so
+ the AlCon_Init function can set a reasonable default screen size.
+*/
+static int AlCon_ScreenWidth, AlCon_ScreenHeight;
+static int AlCon_FontWidth=8, AlCon_FontHeight=16;
+
+static int colors[16];
+static int fg,bg;
+static char cursorEnabled=1, cursorInScreen=0;
+static char AlCon_UseSecFont=0;
+static unsigned char *chars, *attrs;
+static unsigned char curAttr;
+static char AlCon_CursorShapeFrom, AlCon_CursorShapeTo;
+//static int al_text_mode;
+static int al_mouse_buttons = 0;
+static int al_mouse_wheel;
+
+/* Extra flags reserved for silly cursor effects */
+int AlCon_CursorBits = 0;
+char AlCon_ForcedKeyboard[4] = "";
+
+void AlCon_EnableSecFont()
+{
+ AlCon_UseSecFont=1;
+}
+
+void AlCon_DisableSecFont()
+{
+ AlCon_UseSecFont=0;
+}
+
+/*****************************************************************************
+
+ Functions to hide/unhide the mouse and text cursors.
+ I use the scare_mouse() stuff and also implemented the same concept for the
+text cursor.
+
+*****************************************************************************/
+
+
+void AlCon_UnDrawCursor(int *aFgCol);
+
+#define maxCurMode 32
+char CursorMode[maxCurMode];
+int CursorModeIndex=0;
+
+static
+void PushCursorMode()
+{
+ if (CursorModeIndex<maxCurMode)
+ CursorMode[CursorModeIndex++]=cursorEnabled;
+}
+
+static
+void PullCursorMode()
+{
+ if (CursorModeIndex)
+ cursorEnabled=CursorMode[--CursorModeIndex];
+}
+
+void AlCon_ScareCursor()
+{
+ PushCursorMode();
+ if (!cursorEnabled)
+ return;
+ cursorEnabled=0;
+ if (cursorInScreen)
+ {
+ int color;
+ scare_mouse(); /* Could be necesary. i.e. gotoxy */
+ AlCon_UnDrawCursor(&color);
+ unscare_mouse();
+ cursorInScreen=0;
+ }
+}
+
+void AlCon_UnScareCursor()
+{
+ PullCursorMode();
+}
+
+void AlCon_DisableAsync()
+{
+ scare_mouse();
+ AlCon_ScareCursor();
+}
+
+void AlCon_EnableAsync()
+{
+ AlCon_UnScareCursor();
+ unscare_mouse();
+}
+
+/*****************************************************************************
+
+ Cursor positioning routines.
+ They take care of the text cursor.
+
+*****************************************************************************/
+
+
+void AlCon_CursorHome()
+{
+ AlCon_GotoXY(1, 1);
+}
+
+void AlCon_GotoXY(int x, int y)
+{
+ ASSERT(x > 0 && x <= AlCon_ScreenWidth);
+ ASSERT(y > 0 && y <= AlCon_ScreenHeight);
+ AlCon_ScareCursor();
+ cursorX = x; cursorY = y;
+ cursorPX = (x - 1) * AlCon_FontWidth;
+ cursorPY = (y - 1) * AlCon_FontHeight;
+ AlCon_UnScareCursor();
+}
+
+int AlCon_WhereX()
+{
+ return cursorX;
+}
+
+int AlCon_WhereY()
+{
+ return cursorY;
+}
+
+int AlCon_ScreenCols()
+{
+ return AlCon_ScreenWidth;
+}
+
+int AlCon_ScreenRows()
+{
+ return AlCon_ScreenHeight;
+}
+
+
+/*****************************************************************************
+
+ Color selection routines
+
+*****************************************************************************/
+
+void AlCon_SetColors(int aFg, int aBg)
+{
+ fg=aFg; bg=aBg;
+ curAttr=(bg<<4) | (fg & 0xF);
+}
+
+void AlCon_TextAttr(int attr)
+{
+ unsigned char aBg=attr>>4;
+ unsigned char aFg=attr & 0xF;
+ curAttr=attr;
+ fg=aFg; bg=aBg;
+}
+
+void AlCon_TextBackground(int aBg)
+{
+ AlCon_SetColors(fg,aBg);
+}
+
+void AlCon_TextColor(int aFg)
+{
+ AlCon_SetColors(aFg,bg);
+}
+
+/*****************************************************************************
+
+ Clear routines
+
+*****************************************************************************/
+
+void AlCon_Clear()
+{
+ AlCon_DisableAsync();
+ clear_to_color(screen,bg);
+ AlCon_EnableAsync();
+ memset(chars,' ', AlCon_ScreenWidth * AlCon_ScreenHeight);
+ memset(attrs,curAttr, AlCon_ScreenWidth * AlCon_ScreenHeight);
+}
+
+void AlCon_ClrScr()
+{
+ AlCon_Clear();
+ AlCon_CursorHome();
+}
+
+/*****************************************************************************
+
+ Text output routines, including newline and tab management
+
+*****************************************************************************/
+
+void AlCon_NewLine()
+{
+ if (cursorY == AlCon_ScreenHeight)
+ { // Scroll
+ int ybot,xmax;
+ unsigned offset;
+ AlCon_DisableAsync();
+ ybot = (AlCon_ScreenHeight - 1) * AlCon_FontHeight;
+ xmax = AlCon_ScreenWidth * AlCon_FontWidth;
+ blit(screen, screen, 0, AlCon_FontHeight, 0, 0, xmax, ybot);
+ rectfill(screen,0,ybot,xmax, AlCon_ScreenHeight * AlCon_FontHeight, colors[bg]);
+ AlCon_EnableAsync();
+
+ // Same for buffers
+ memcpy(chars, chars + AlCon_ScreenWidth, AlCon_ScreenWidth * (AlCon_ScreenHeight - 1));
+ memcpy(attrs, attrs + AlCon_ScreenWidth, AlCon_ScreenWidth * (AlCon_ScreenHeight - 1));
+ offset = (AlCon_ScreenHeight - 1) * AlCon_ScreenWidth;
+ memset(chars+offset,' ', AlCon_ScreenWidth);
+ memset(attrs+offset,curAttr, AlCon_ScreenWidth);
+
+ AlCon_GotoXY(1,cursorY);
+ }
+ else
+ AlCon_GotoXY(1,cursorY+1);
+}
+
+inline
+void AlCon_TextOut(const char *str, unsigned x, unsigned y, int fg, int bg)
+{
+ if (AlCon_UseSecFont && (fg & 8))
+ textout_ex(screen,&Alcon_SecondaryFont,str,x,y,colors[fg],colors[bg]);
+ else
+ textout_ex(screen,Alcon_CurrentFont,str,x,y,colors[fg],colors[bg]);
+}
+
+void AlCon_PutStr(const char *s)
+{
+ ASSERT(s);
+ ASSERT(Alcon_CurrentFont);
+
+ int l=strlen(s);
+ AlCon_DisableAsync();
+ while (cursorX + l > AlCon_ScreenWidth)
+ {
+ char b[AlCon_ScreenWidth + 1];
+ int count = AlCon_ScreenWidth - cursorX + 1;
+ unsigned offset;
+ strncpy(b,s,count);
+ b[count]=0;
+ AlCon_TextOut(b,cursorPX,cursorPY,fg,bg);
+
+ offset = (cursorX - 1) + (cursorY - 1) * AlCon_ScreenWidth;
+ memcpy(chars+offset,b,count);
+ memset(attrs+offset,curAttr,count);
+
+ AlCon_NewLine();
+ s+=count;
+ l-=count;
+ }
+ if (*s)
+ {
+ unsigned offset;
+ AlCon_TextOut(s,cursorPX,cursorPY,fg,bg);
+
+ offset = (cursorX - 1) + (cursorY - 1) * AlCon_ScreenWidth;
+ memcpy(chars+offset,s,l);
+ memset(attrs+offset,curAttr,l);
+
+ cursorX+=l;
+ cursorPX += l * AlCon_FontWidth;
+ }
+ AlCon_EnableAsync();
+}
+
+void AlCon_Puts(const char *s)
+{
+ AlCon_PutStr(s);
+ AlCon_NewLine();
+}
+
+void AlCon_Tab()
+{
+ int count=8-(cursorX & 7);
+ char b[9];
+ memset(b,' ',count);
+ b[count]=0;
+ AlCon_PutStr(b);
+}
+
+void AlCon_CPrintf(AL_CONST char *format, ...)
+{
+ char buf[4096];
+ int ret;
+ char *s,*next,aux;
+
+ va_list ap;
+ va_start(ap, format);
+ // TODO: vsnprintf
+ ret=vsprintf(buf, format, ap);
+ if (ret>4090)
+ {
+ set_gfx_mode(GFX_TEXT,0,0,0,0);
+ allegro_message("Buffer overflow in AlCon_CPrintf\n");
+ exit(100);
+ }
+ va_end(ap);
+
+ s=buf;
+ while ((next=strpbrk(s,"\n\t"))!=0 && *next)
+ {
+ aux=*next; *next=0;
+ AlCon_PutStr(s);
+ *next=aux;
+ if (aux=='\n')
+ AlCon_NewLine();
+ else if (aux=='\t')
+ AlCon_Tab();
+ s=next+1;
+ }
+ if (*s)
+ AlCon_PutStr(s);
+}
+
+#if 0
+// Avoiding to redraw characters that didn't change: 2.5 times faster
+void AlCon_PutBuf(unsigned offset, uint16 *values, int count)
+{
+ unsigned x,y;
+ x=(offset%AlCon_ScreenWidth)*AlCon_FontWidth;
+ y=(offset/AlCon_ScreenWidth)*AlCon_FontHeight;
+
+ uchar *b=(uchar *)values,newChar,newAttr;
+ uchar *sc=(uchar *)(chars+offset);
+ AlCon_DisableAsync();
+ unsigned char aux[2];
+ aux[1]=0;
+ while (count--)
+ {
+ newChar=b[charPos];
+ newAttr=b[attrPos];
+ if (newChar!=chars[offset] || newAttr!=attrs[offset])
+ {
+ aux[0]=chars[offset]=newChar;
+ attrs[offset]=newAttr;
+ int nBg,nFg;
+ nBg=b[attrPos]>>4;
+ nFg=b[attrPos] & 0xF;
+ AlCon_TextOut((char *)aux,x,y,nFg,nBg);
+ }
+ x+=AlCon_FontWidth; b+=2; offset++;
+ }
+ AlCon_EnableAsync();
+}
+#else
+// Avoiding to redraw characters that didn't change: 2.5 times faster
+// Grouping chars of the same colour: 9 to 15% faster
+void AlCon_PutBuf(unsigned offset, uint16 *values, int count)
+{
+ unsigned x,y,xf;
+ x=(offset%AlCon_ScreenWidth)*AlCon_FontWidth;
+ y=(offset/AlCon_ScreenWidth)*AlCon_FontHeight;
+
+ uchar *b=(uchar *)values,newChar,newAttr,oldAttr;
+ AlCon_DisableAsync();
+ uchar aux[count+1];
+ newChar=b[charPos];
+ newAttr=b[attrPos];
+ while (count)
+ {
+ if (newChar!=chars[offset] || newAttr!=attrs[offset])
+ {
+ uchar *ind=aux;
+ oldAttr=newAttr;
+ xf=x;
+ do
+ {
+ *(ind++)=chars[offset]=newChar;
+ attrs[offset]=newAttr;
+ xf+=AlCon_FontWidth;
+ count--;
+ if (!count)
+ break;
+ offset++;
+ b+=2;
+ newChar=b[charPos];
+ newAttr=b[attrPos];
+ }
+ while (newAttr==oldAttr && newChar!=chars[offset] && newAttr!=attrs[offset]);
+ *ind=0;
+ int nBg,nFg;
+ nBg=oldAttr>>4;
+ nFg=oldAttr & 0xF;
+ AlCon_TextOut((char *)aux,x,y,nFg,nBg);
+ x=xf;
+ }
+ else
+ {
+ x+=AlCon_FontWidth;
+ count--;
+ offset++;
+ b+=2;
+ newChar=b[charPos];
+ newAttr=b[attrPos];
+ }
+ }
+ AlCon_EnableAsync();
+}
+#endif
+
+// TODO: Optimize!!!
+void AlCon_Redraw()
+{
+ ASSERT(Alcon_CurrentFont);
+
+ int nBg,nFg;
+ unsigned offset=0;
+ unsigned mx=AlCon_ScreenWidth*AlCon_FontWidth;
+ unsigned my=AlCon_ScreenHeight*AlCon_FontHeight;
+ unsigned char aux[2];
+ aux[1]=0;
+
+ AlCon_DisableAsync();
+ for (unsigned y=0; y<my; y+=AlCon_FontHeight)
+ {
+ for (unsigned x=0; x<mx; offset++, x+=AlCon_FontWidth)
+ {
+ aux[0]=chars[offset];
+ nBg=attrs[offset]>>4;
+ nFg=attrs[offset] & 0xF;
+ AlCon_TextOut((char *)aux,x,y,nFg,nBg);
+ }
+ }
+ AlCon_EnableAsync();
+}
+
+void AlCon_GetScrChars(unsigned offset, uint16 *buffer, unsigned count)
+{
+ unsigned char *b=(unsigned char *)buffer;
+
+ offset/=2;
+ while (count--)
+ {
+ b[charPos]=chars[offset];
+ b[attrPos]=attrs[offset];
+ b+=2;
+ offset++;
+ }
+}
+
+void AlCon_PutChar(unsigned offset, uint16 value)
+{
+ ASSERT(Alcon_CurrentFont);
+ int nBg,nFg;
+ unsigned char *b=(unsigned char *)&value;
+ unsigned char aux[2];
+ unsigned x,y;
+ aux[1]=0;
+
+ offset/=2;
+ x = (offset % AlCon_ScreenWidth) * AlCon_FontWidth;
+ y = (offset / AlCon_ScreenWidth) * AlCon_FontHeight;
+ AlCon_DisableAsync();
+
+ aux[0]=chars[offset]=b[charPos];
+ attrs[offset]=b[attrPos];
+ nBg=b[attrPos]>>4;
+ nFg=b[attrPos] & 0xF;
+ AlCon_TextOut((char *)aux,x,y,nFg,nBg);
+
+ AlCon_EnableAsync();
+}
+
+/*****************************************************************************
+
+ Text cursor routines.
+
+*****************************************************************************/
+
+void AlCon_UnDrawCursor(int *aFgCol)
+{
+ ASSERT(Alcon_CurrentFont);
+ ASSERT(aFgCol);
+ unsigned offset = (cursorX - 1) + (cursorY - 1) * AlCon_ScreenWidth;
+ int bg=attrs[offset]>>4;
+ int fg=attrs[offset] & 0xF;
+ char b[2];
+ b[0]=chars[offset]; b[1]=0;
+ AlCon_TextOut(b,cursorPX,cursorPY,fg,bg);
+ *aFgCol=colors[fg];
+}
+
+void AlCon_IntCursor()
+{
+ if (cursorEnabled)
+ {
+ int aFg;
+ scare_mouse();
+ cursorInScreen=!cursorInScreen;
+ AlCon_UnDrawCursor(&aFg);
+ if (cursorInScreen)
+ {
+ if (!(AlCon_CursorBits & ALCON_CURSOR_HIDE_NORMAL))
+ textout_ex(screen, &Alcon_CursorFont, "\x1", cursorPX,cursorPY, aFg, -1);
+
+ if (AlCon_CursorBits & ALCON_CURSOR_ON_SQUARE)
+ rect(screen, cursorPX, cursorPY, cursorPX + AlCon_FontWidth - 1,
+ cursorPY + AlCon_FontHeight - 1, aFg);
+
+ if (AlCon_CursorBits & ALCON_CURSOR_ON_CROSS)
+ {
+ line(screen, cursorPX, cursorPY, cursorPX + AlCon_FontWidth - 1,
+ cursorPY + AlCon_FontHeight - 1, aFg);
+ line(screen, cursorPX, cursorPY + AlCon_FontHeight - 1,
+ cursorPX + AlCon_FontWidth - 1, cursorPY, aFg);
+ }
+ }
+ unscare_mouse();
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description: Sets the cursor shape. Pass the start and end lines
+ (inclusive) of the cursor. The lines must be in the range 0 to less than
+ font's height. Since the start and end are inclusive, you cannot set an
+ "invisible" cursor shape. Use AlCon_HideCursor() for that.
+
+***************************************************************************/
+
+void AlCon_SetCursorShape(int from, int to)
+{
+ ASSERT(from <= to);
+ ASSERT(from >= 0);
+ ASSERT(to < AlCon_FontHeight);
+
+ unsigned wb=(AlCon_FontWidth+7)/8;
+ memset(Alcon_CursorData[1]->dat, 0, wb*AlCon_FontHeight);
+ memset(Alcon_CursorData[1]->dat + wb*from, 0xFF, wb*(to - from + 1));
+ AlCon_CursorShapeFrom = from;
+ AlCon_CursorShapeTo = to;
+}
+
+void AlCon_GetCursorShape(int *from, int *to)
+{
+ ASSERT(from || to);
+ if (from)
+ *from = AlCon_CursorShapeFrom;
+ if (to)
+ *to = AlCon_CursorShapeTo;
+}
+
+void Alcon_CreateNewCursor()
+{
+ Alcon_CursorData[0] =0;
+ unsigned wb=(AlCon_FontWidth+7)/8;
+ if (Alcon_CursorData[1])
+ free(Alcon_CursorData[1]);
+ Alcon_CursorData[1] =(FONT_GLYPH *)malloc(sizeof(FONT_GLYPH)+wb*AlCon_FontHeight);
+ Alcon_CursorData[1]->w = AlCon_FontWidth;
+ Alcon_CursorData[1]->h = AlCon_FontHeight;
+ AlCon_SetCursorShape(87 * AlCon_FontHeight / 100, AlCon_FontHeight - 1);
+}
+
+void AlCon_HideCursor()
+{
+ cursorEnabled=0;
+}
+
+void AlCon_ShowCursor()
+{
+ cursorEnabled=1;
+}
+
+int AlCon_IsVisCursor()
+{
+ return cursorEnabled;
+}
+
+/*****************************************************************************
+
+ Initialization routines
+
+*****************************************************************************/
+
+/**[txh]********************************************************************
+
+ Description: Initialization of the AlCon layer. Pass the number of text
+ characters you want to have with a default 8x16 font.
+
+ Return: Zero if everything went fine, non zero otherwise.
+
+***************************************************************************/
+
+int AlCon_Init(int w, int h, int fw, int fh, uchar *fdata, AlCon_Color *pal)
+{
+ if (fw!=-1 && fh!=-1) {
+ AlCon_FontWidth=fw;
+ AlCon_FontHeight=fh;
+ }
+
+ set_uformat(U_ASCII);
+ //set_uformat(U_UTF8);
+
+ allegro_init();
+
+ /* Maybe force a specific keyboard layout? */
+ if (*AlCon_ForcedKeyboard) {
+ AlCon_ForcedKeyboard[3] = 0;
+ set_config_string("system", "keyboard", AlCon_ForcedKeyboard);
+ }
+
+ install_keyboard();
+ al_mouse_buttons = install_mouse();
+ al_mouse_wheel = mouse_z;
+ // Clamp allegro return of "no mouse" to TVision interpretation.
+ if (al_mouse_buttons < 0)
+ al_mouse_buttons = 0;
+ // And add "fake wheel buttons" if the mouse has at least two.
+ if (al_mouse_buttons > 1)
+ al_mouse_buttons = 5;
+ install_timer();
+
+ /* If we are in a graphic mode and we know the depth use it */
+ if (desktop_color_depth()) {
+ set_color_depth(desktop_color_depth());
+ } else {
+ #ifdef BPP
+ set_color_depth(BPP);
+ #else
+ set_color_depth(8);
+ #endif
+ }
+
+ if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, AlCon_FontWidth * w, AlCon_FontHeight * h,
+ AlCon_FontWidth * w, AlCon_FontHeight * h)) {
+ set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
+ allegro_message("Can't initialize graphics mode\n%s\n",allegro_error);
+ return 2;
+ }
+ // Set the size of the font and screen.
+ AlCon_ScreenWidth =w;
+ AlCon_ScreenHeight=h;
+
+ /* Load a binary font. Hack to get the font/screen properties set. */
+ ASSERT(fdata);
+ AlCon_LoadCustomFont(0,fdata,AlCon_FontWidth,AlCon_FontHeight);
+ //AlCon_LoadCustomFont("rom-PC437.016");
+
+ /* Create default cursor shape */
+ Alcon_CreateNewCursor();
+
+ /* Create the text mode palette */
+ AlCon_SetDisPaletteColors(0,16,pal ? pal : BIOSPalette);
+
+ /* Allocate "screen" buffers */
+ AlCon_AllocateMemoryBuffer();
+
+ install_int(AlCon_IntCursor, 500);
+
+ AlCon_SetColors(7, 0);
+ AlCon_ClrScr();
+ show_mouse(screen);
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description: Called when you want to change the font size. You
+ can call this first with the font size you would like, and see
+ if AlCon is able to resize the screen to that size.
+
+ Return: Zero on success. A positive number if the resolution was
+ not set, but AlCon was able to restore the previous screen size
+ using the old parameters. A negative number if the resolution was
+ not set, and trying to set it AlCon lost the previous screen,
+ leaving the whole graphic mode in a mess you can only abort
+ execution.
+
+***************************************************************************/
+
+int AlCon_Resize(unsigned sW, unsigned sH, int new_font_width,
+ int new_font_height)
+{
+ ASSERT(screen && "Did you really initialise me properly?");
+ ASSERT(new_font_width > 0);
+ ASSERT(new_font_height > 0);
+ ASSERT(AlCon_ScreenWidth > 0);
+ ASSERT(AlCon_ScreenHeight > 0);
+
+ // Save here the previous parameters...
+ const int old_w = SCREEN_W;
+ const int old_h = SCREEN_H;
+ const int old_card = gfx_driver->id;
+
+ // Hide the mouse during the change. If we don't do it the cursor gets damaged.
+ show_mouse(NULL);
+ int temp;
+ AlCon_UnDrawCursor(&temp);
+
+ // Be brave and try the new screen resolution.
+ // TODO: Get rid of explicit driver. Maybe use configuration file?
+ int ret = set_gfx_mode(GFX_AUTODETECT_WINDOWED,
+ sW * new_font_width, sH * new_font_height,
+ sW * new_font_width, sH * new_font_height);
+
+ if (ret == 0)
+ {
+ AlCon_ScreenWidth=sW;
+ AlCon_ScreenHeight=sH;
+ // Reallocate internal memory for text video.
+ AlCon_AllocateMemoryBuffer();
+ // Fix up cursor position, it may have ended up outside screen.
+ if (cursorX > AlCon_ScreenWidth || cursorY > AlCon_ScreenHeight)
+ AlCon_GotoXY(1, 1);
+
+ // Clean up the screen, just in case...
+ clear_to_color(screen, 0);
+
+ show_mouse(screen);
+ return 0;
+ }
+
+ // Oops, try to fix our mistake.
+ ret = set_gfx_mode(old_card, old_w, old_h, old_w, old_h);
+ if (ret != 0)
+ return -1; // Bail out completely.
+ show_mouse(screen);
+ return 1; // At least we kept our head safe...
+}
+
+/**[txh]********************************************************************
+
+ Description: Removes allegro from the system, freeing any internal
+ memory and resetting the graphic mode and other subsystems.
+
+***************************************************************************/
+
+void AlCon_Exit()
+{
+ ASSERT(chars);
+ ASSERT(attrs);
+
+ remove_int(AlCon_IntCursor);
+ set_gfx_mode(GFX_TEXT,0,0,0,0);
+ allegro_exit();
+ free(chars);
+ free(attrs);
+ chars = attrs = 0;
+}
+
+int AlCon_SetDisPaletteColors(int from, int number, AlCon_Color *c)
+{
+ int i;
+
+ for (i=0; i<number; i++)
+ {
+ colors[from+i]=makecol(c[i].R,c[i].G,c[i].B);
+ AlCon_CurPalette[from+i]=c[i];
+ }
+
+ return i;
+}
+
+/*****************************************************************************
+
+ Keyboard input routines
+
+*****************************************************************************/
+
+int AlCon_GetCh()
+{
+ return readkey();
+}
+
+int AlCon_KbHit()
+{
+ return keypressed();
+}
+
+const char *AlCon_KeyNames[]=
+{
+"Unknown",
+"A","B","C","D","E","F","G","H","I","J","K",
+"L","M","N","O","P","Q","R","S","T","U","V",
+"W","X","Y","Z",
+"OpenBrace","BackSlash","CloseBrace","Pause","Esc",
+"0","1","2","3","4","5","6","7","8","9",
+"BackSpace","Tab","Enter","Colon","Quote","Grave",
+"Comma","Stop","Slash","Asterisk","Space","Minus",
+"Plus","PrnScr","Equal","F1","F2","F3","F4","F5",
+"F6","F7","F8","F9","F10","F11","F12","Home",
+"Up","PgUp","Left","Right","End","Down","PgDn",
+"Insert","Delete","Caret","Admid","DobleQuote",
+"Numeral","Dolar","Percent","Amper","OpenPar",
+"ClosePar","DoubleDot","LessThan","GreaterThan",
+"Question","A_Roba","Or","UnderLine","OpenCurly",
+"CloseCurly","Tilde","Macro","WinLeft","WinRight","WinSel",
+"Mouse"
+};
+
+#define NumKeyNames (sizeof(AlCon_KeyNames)/sizeof(char *))
+
+static
+uchar keyCode[KEY_MAX]=
+{
+ kbUnkNown,kbA,kbB,kbC,kbD,kbE,kbF,kbG,kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO,kbP,
+ kbQ,kbR,kbS,kbT,kbU,kbV,kbW,kbX,kbY,kbZ,kb0,kb1,kb2,kb3,kb4,kb5,kb6,kb7,
+ kb8,kb9,kb0,kb1,kb2,kb3,kb4,kb5,kb6,kb7,kb8,kb9,kbF1,kbF2,kbF3,kbF4,kbF5,
+ kbF6,kbF7,kbF8,kbF9,kbF10,kbF11,kbF12,kbEsc,kbGrave,kbMinus,kbEqual,
+ kbBackSpace,kbTab,kbOpenBrace,kbCloseBrace,kbEnter,kbColon,kbQuote,
+ kbBackSlash,kbBackSlash,kbComma,kbStop,kbSlash,kbSpace,kbInsert,kbDelete,
+ kbHome,kbEnd,kbPgUp,kbPgDn,kbLeft,kbRight,kbUp,kbDown,kbSlash,kbAsterisk,
+ kbMinus,kbPlus,kbDelete,kbEnter,kbPrnScr,kbPause,kbUnkNown,kbUnkNown,
+ kbUnkNown,kbUnkNown,kbUnkNown,kbA_Roba,kbCaret,kbColon,kbUnkNown,kbUnkNown,
+ kbUnkNown,kbUnkNown,kbUnkNown,kbUnkNown,kbUnkNown,kbUnkNown,kbWinLeft,
+ kbWinRight,kbWinSel,kbUnkNown,kbUnkNown//,kbUnkNown
+};
+
+static
+uchar KeyCodeByASCII[96]=
+{
+ kbSpace,kbAdmid,kbDobleQuote,kbNumeral,kbDolar,kbPercent,kbAmper,kbQuote,
+ kbOpenPar,kbClosePar,kbAsterisk,kbPlus,kbComma,kbMinus,kbStop,kbSlash,
+ kb0,kb1,kb2,kb3,kb4,kb5,kb6,kb7,
+ kb8,kb9,kbDoubleDot,kbColon,kbLessThan,kbEqual,kbGreaterThan,kbQuestion,
+ kbA_Roba,kbA,kbB,kbC,kbD,kbE,kbF,kbG,
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO,
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW,
+ kbX,kbY,kbZ,kbOpenBrace,kbBackSlash,kbCloseBrace,kbCaret,kbUnderLine,
+ kbGrave,kbA,kbB,kbC,kbD,kbE,kbF,kbG,
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO,
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW,
+ kbX,kbY,kbZ,kbOpenCurly,kbOr,kbCloseCurly,kbTilde,kbBackSpace
+};
+
+int AlCon_GetKey(unsigned *aSymbol, uchar *aScan, unsigned *aFlags)
+{
+ int key=readkey();
+ int scan=key>>8;
+ int ascii=key & 0xFF;
+ int name,flags;
+
+ //AlCon_CPrintf("key: 0x%04X scan: 0x%02X ascii: 0x%02X ",key,scan,ascii);
+ if (ascii>=32 && ascii<128)
+ name=KeyCodeByASCII[ascii-32];
+ else
+ name=keyCode[scan];
+
+ flags=0;
+ if (key_shifts & KB_SHIFT_FLAG)
+ flags|=kbShiftCode;
+ if (key_shifts & KB_CTRL_FLAG)
+ flags|=kbCtrlCode;
+ if (key_shifts & KB_ALT_FLAG)
+ flags|=kbAltLCode;
+
+ *aSymbol=ascii;
+ *aFlags=flags;
+ *aScan=scan;
+
+ return name|flags;
+}
+
+void AlCon_ClearKeyBuf()
+{
+ clear_keybuf();
+}
+
+/*****************************************************************************
+
+ Mouse input routines
+
+*****************************************************************************/
+
+// Returns 0 if there is no mouse.
+int AlCon_GetMouseButtons(void)
+{
+ return al_mouse_buttons;
+}
+
+void AlCon_GetMousePos(int *x, int *y, int *buttons)
+{
+ if (al_mouse_buttons == 1)
+ return ;
+
+ poll_mouse();
+ *x = mouse_x / AlCon_FontWidth;
+ *y = mouse_y / AlCon_FontHeight;
+ *buttons = mouse_b;
+
+ // Emulate 4th and 5th buttons through wheelmouse control.
+ if (mouse_z > al_mouse_wheel)
+ *buttons |= 1 << 3;
+ if (mouse_z < al_mouse_wheel)
+ *buttons |= 1 << 4;
+ al_mouse_wheel = mouse_z;
+}
+
+uchar AlCon_ShapeFont10x20[]=
+{
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x4C,0x80,0x4C,0x80,0x7C,0x80,0x79,0x80,0x73,0x80,0x73,0x80,0x73,0x80,0x7F,0x80,0x73,0x80,0x73,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x67,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x36,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x67,0x80,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x36,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x6D,0x80,0x6D,0x80,0x6F,0x80,0x6C,0x00,0x6C,0x00,0x6D,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x7F,0x80,0x7F,0x80,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x7E,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x00,0x00,0x1F,0x80,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x7C,0x00,0x60,0x00,0x60,0x00,0x78,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x0F,0x80,0x0C,0x00,0x0C,0x00,0x0F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x3C,0x00,0x66,0x00,0x60,0x00,0x60,0x00,0x66,0x00,0x3C,0x00,0x00,0x00,0x1F,0x00,0x19,0x80,0x19,0x80,0x1F,0x00,0x1E,0x00,0x1B,0x00,0x19,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3E,0x00,0x00,0x00,0x0F,0x80,0x0C,0x00,0x0C,0x00,0x0F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,
+ 0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,
+ 0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,
+ 0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,
+ 0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,
+ 0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,
+ 0x00,0x00,0x00,0x00,0x66,0x00,0x76,0x00,0x7E,0x00,0x7E,0x00,0x6E,0x00,0x66,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x3C,0x00,0x3C,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x1F,0x80,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x38,0x00,0x0E,0x00,0x03,0x80,0x0E,0x00,0x38,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x0E,0x00,0x38,0x00,0xE0,0x00,0x38,0x00,0x0E,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x06,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x18,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x07,0x80,0x1F,0x80,0x7F,0x80,0x7F,0x80,0x1F,0x80,0x07,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x78,0x00,0x7E,0x00,0x7F,0x80,0x7F,0x80,0x7E,0x00,0x78,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x6D,0x80,0x4C,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x4C,0x80,0x6D,0x80,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0xFF,0x80,0xFF,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0xFF,0x80,0xFF,0x80,0x60,0x00,0x30,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x6D,0x80,0x4C,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x4C,0x80,0x6D,0x80,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x33,0x00,0x61,0x80,0xFF,0xC0,0xFF,0xC0,0x61,0x80,0x33,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x19,0x80,0x31,0x80,0x7F,0x80,0x7F,0x80,0x30,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x3F,0xC0,0x1B,0x00,0x1B,0x00,0x1B,0x00,0x7F,0x80,0x36,0x00,0x36,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x3F,0x00,0x6D,0x80,0x6C,0x00,0x6C,0x00,0x6C,0x00,0x3F,0x00,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x6D,0x80,0x3F,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x6F,0x00,0x3B,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x1B,0x80,0x1E,0xC0,0x36,0xC0,0x33,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x3C,0x00,0x18,0x00,0x38,0x00,0x6C,0x00,0x66,0xC0,0x63,0x80,0x63,0x00,0x77,0x80,0x3C,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x7F,0x80,0x1E,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1C,0x00,0x3C,0x00,0x6C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x0E,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x01,0x80,0x03,0x00,0x0E,0x00,0x03,0x00,0x01,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x07,0x00,0x0F,0x00,0x1B,0x00,0x33,0x00,0x63,0x00,0x63,0x00,0x7F,0x80,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x01,0x80,0x21,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x67,0x80,0x6F,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6F,0x00,0x66,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x66,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x67,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x63,0x00,0x63,0x00,0x66,0x00,0x66,0x00,0x7C,0x00,0x66,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x73,0x80,0x73,0x80,0x7F,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x71,0x80,0x71,0x80,0x79,0x80,0x79,0x80,0x6D,0x80,0x6D,0x80,0x67,0x80,0x67,0x80,0x63,0x80,0x63,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x6D,0x80,0x67,0x80,0x33,0x00,0x1F,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x30,0x00,0x1E,0x00,0x03,0x00,0x01,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x73,0x80,0x73,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x1E,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x03,0x00,0x03,0x00,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x73,0x00,0x6E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x1D,0x80,0x33,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x19,0x80,0x19,0x80,0x18,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x80,0x63,0x80,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x60,0x00,0x3F,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x3F,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x00,0x00,0x07,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x31,0x80,0x31,0x80,0x31,0x80,0x1F,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x63,0x00,0x66,0x00,0x6C,0x00,0x78,0x00,0x7C,0x00,0x66,0x00,0x63,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5B,0x00,0x7F,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x73,0x00,0x6E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0x80,0x33,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0x00,0x39,0x80,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x60,0x00,0x3F,0x00,0x01,0x80,0x01,0x80,0x61,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x19,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x7F,0x80,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x33,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x3F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x78,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x0F,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xF8,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xFF,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x04,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x13,0xC0,0x10,0x00,0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xC0,0x10,0x00,0x13,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x13,0xC0,0x10,0x00,0x13,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x08,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF2,0x00,0x02,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF3,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x02,0x00,0xF2,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF2,0x00,0x02,0x00,0xF2,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0xF3,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF3,0xC0,0x00,0x00,0xF3,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x00,0x60,0x00,0x60,0x00,0x61,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x19,0x80,0x19,0x80,0x18,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x7C,0x00,0x56,0xC0,0x73,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x3F,0x00,0x6D,0x80,0x6C,0x00,0x6C,0x00,0x6C,0x00,0x3F,0x00,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x6D,0x80,0x3F,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x3F,0x00,0x0C,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x63,0x00,0x30,0x00,0x3C,0x00,0x66,0x00,0x33,0x00,0x19,0x80,0x0F,0x00,0x03,0x00,0x31,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x5E,0x80,0x52,0x80,0x50,0x80,0x52,0x80,0x5E,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x21,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x80,0x0D,0x80,0x1B,0x00,0x36,0x00,0x6C,0x00,0xD8,0x00,0x6C,0x00,0x36,0x00,0x1B,0x00,0x0D,0x80,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x7F,0x80,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x5E,0x80,0x52,0x80,0x5E,0x80,0x54,0x80,0x56,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x06,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x77,0x00,0x7D,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x7F,0x80,0x7D,0x80,0x7D,0x80,0x7D,0x80,0x3D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x38,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x6C,0x00,0x36,0x00,0x1B,0x00,0x0D,0x80,0x06,0xC0,0x0D,0x80,0x1B,0x00,0x36,0x00,0x6C,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x60,0x00,0x20,0x80,0x21,0x00,0x72,0x00,0x04,0x00,0x09,0x00,0x13,0x00,0x25,0x00,0x4F,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x60,0x00,0x20,0x80,0x21,0x00,0x72,0x00,0x04,0x00,0x0B,0x00,0x14,0x80,0x20,0x80,0x41,0x00,0x02,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x08,0x00,0x30,0x80,0x09,0x00,0x72,0x00,0x04,0x00,0x09,0x00,0x13,0x00,0x25,0x00,0x4F,0x80,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x1E,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x1E,0x00,0x36,0x00,0x36,0x00,0x66,0x00,0x66,0x00,0x7F,0x80,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x67,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x61,0x80,0x33,0x00,0x1E,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00,
+ 0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0xF9,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x61,0x80,0x71,0x80,0x79,0x80,0x79,0x80,0x6D,0x80,0x6D,0x80,0x67,0x80,0x67,0x80,0x63,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0x1F,0x00,0x33,0x00,0x63,0x80,0x63,0x80,0x65,0x80,0x65,0x80,0x65,0x80,0x69,0x80,0x69,0x80,0x69,0x80,0x71,0x80,0x33,0x00,0x3E,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3F,0x00,0x31,0x80,0x31,0x80,0x31,0x80,0x31,0x80,0x31,0x80,0x3F,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x1B,0x00,0x31,0x80,0x31,0x80,0x33,0x00,0x76,0x00,0x36,0x00,0x33,0x00,0x31,0x80,0x31,0x80,0x31,0x80,0x33,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x00,0x4D,0x80,0x0D,0x80,0x0F,0x00,0x3C,0x00,0x6C,0x00,0x6C,0x80,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x07,0xC0,0x01,0x80,0x1D,0x80,0x33,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x7F,0x80,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x1F,0x00,0x33,0x00,0x65,0x80,0x65,0x80,0x69,0x80,0x69,0x80,0x33,0x00,0x3E,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3E,0x00,0x33,0x00,0x31,0x80,0x31,0x80,0x31,0x80,0x33,0x00,0x3E,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,
+};
+
+// Exported
+uchar AlCon_ShapeFont8x16[]=
+{
+ 0x00,0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00,0x00, // 0
+ 0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x6E,0xF8,0xD8,0xD8,0xDC,0xD8,0xD8,0xD8,0xF8,0x6E,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 
+ 0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 
+ 0x00,0x70,0x88,0x80,0x88,0x70,0x00,0x3C,0x22,0x3C,0x24,0x22,0x00,0x00,0x00,0x00, // 
+ 0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 
+ 0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, // \t
+ 0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, // \n
+ 0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, //
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // \r
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, // 
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, // 
+ 0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00,0x00,0x00, // 
+ 0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x0E,0x38,0xE0,0x38,0x0E,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0xE0,0x38,0x0E,0x38,0xE0,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x06,0x0C,0xFE,0x18,0x30,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x06,0x1E,0x7E,0xFE,0x7E,0x1E,0x06,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0xC0,0xF0,0xFC,0xFE,0xFC,0xF0,0xC0,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 0x1A
+ 0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x28,0x6C,0xFE,0x6C,0x28,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+ 0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // !
+ 0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+ 0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, // #
+ 0x00,0x10,0x10,0x7C,0xD6,0xD0,0xD0,0x7C,0x16,0x16,0xD6,0x7C,0x10,0x10,0x00,0x00, // $
+ 0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00, // %
+ 0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // &
+ 0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+ 0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00, // (
+ 0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00, // )
+ 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, // *
+ 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // +
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, // ,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // -
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // .
+ 0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0xC0,0x00,0x00,0x00,0x00,0x00, // /
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 0
+ 0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00, // 1
+ 0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00, // 2
+ 0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 3
+ 0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00, // 4
+ 0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 5
+ 0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 6
+ 0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, // 7
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 8
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00, // 9
+ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // :
+ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, // ;
+ 0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00, // <
+ 0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // =
+ 0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00, // >
+ 0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // ?
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00, // @
+ 0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // A
+ 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // B
+ 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, // C
+ 0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, // D
+ 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // E
+ 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // F
+ 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00, // G
+ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // H
+ 0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // I
+ 0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, // J
+ 0x00,0x00,0xE6,0x66,0x66,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // K
+ 0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // L
+ 0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // M
+ 0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // N
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // O
+ 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // P
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00, // Q
+ 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // R
+ 0x00,0x00,0x7C,0xC6,0xC6,0x64,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // S
+ 0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // T
+ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // U
+ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00, // V
+ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0x6C,0x00,0x00,0x00,0x00, // W
+ 0x00,0x00,0xC6,0xC6,0x6C,0x7C,0x38,0x38,0x7C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00, // X
+ 0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Y
+ 0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // Z
+ 0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00, // [
+ 0x00,0x00,0x00,0x00,0x00,0xC0,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,0x00, // \ .
+ 0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00, // ]
+ 0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00, // _
+ 0x00,0x30,0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+ 0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // a
+ 0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00, // b
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // c
+ 0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // d
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // e
+ 0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // f
+ 0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00, // g
+ 0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // h
+ 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // i
+ 0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, // j
+ 0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, // k
+ 0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // l
+ 0x00,0x00,0x00,0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xD6,0xD6,0xC6,0x00,0x00,0x00,0x00, // m
+ 0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // n
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // o
+ 0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00, // p
+ 0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00, // q
+ 0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x66,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // r
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, // s
+ 0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, // t
+ 0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // u
+ 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, // v
+ 0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00,0x00, // w
+ 0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, // x
+ 0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, // y
+ 0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, // z
+ 0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // {
+ 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // |
+ 0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, // }
+ 0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+ 0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // €
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ‚
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ƒ
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // „
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // …
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // †
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // ‡
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ˆ
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ‰
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Š
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ‹
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // Œ
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // Ž
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00, //
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ‘
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ’
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // “
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // ”
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // •
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x6F,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // –
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6F,0x60,0x6F,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // —
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ˜
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ™
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // š
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ›
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xEC,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // œ
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEC,0x0C,0xEC,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xEF,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // ž
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEF,0x00,0xEF,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // Ÿ
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xFE,0x00,0x00,0x00,0x00, //  
+ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00, // ¡
+ 0x00,0x00,0x00,0x00,0x10,0x7C,0xD6,0xD0,0xD0,0xD0,0xD6,0x7C,0x10,0x00,0x00,0x00, // ¢
+ 0x00,0x00,0x38,0x6C,0x60,0x60,0xF0,0x60,0x60,0x66,0xF6,0x6C,0x00,0x00,0x00,0x00, // £
+ 0x00,0x00,0x00,0x00,0xC6,0x7C,0x6C,0x6C,0x7C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00, // ¤
+ 0x00,0x00,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // ¥
+ 0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // ¦
+ 0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, // §
+ 0x00,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ¨
+ 0x00,0x00,0x3C,0x42,0x99,0xA5,0xA1,0xA5,0x99,0x42,0x3C,0x00,0x00,0x00,0x00,0x00, // ©
+ 0x00,0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ª
+ 0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00, // «
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, // ¬
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ­
+ 0x00,0x00,0x3C,0x42,0xB9,0xA5,0xB9,0xA5,0xA5,0x42,0x3C,0x00,0x00,0x00,0x00,0x00, // ®
+ 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ¯
+ 0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // °
+ 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x7E,0x00,0x00,0x00,0x00, // ±
+ 0x38,0x6C,0x18,0x30,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ²
+ 0x38,0x6C,0x18,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ³
+ 0x00,0x18,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ´
+ 0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xF6,0xC0,0xC0,0xC0,0x00, // µ
+ 0x00,0x00,0x7F,0xD6,0xD6,0x76,0x36,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, // ¶
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ·
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x6C,0x38,0x00, // ¸
+ 0x30,0x70,0x30,0x30,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ¹
+ 0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // º
+ 0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00, // »
+ 0x00,0x60,0xE0,0x60,0x66,0x0C,0x18,0x30,0x66,0xCE,0x1A,0x3F,0x06,0x06,0x00,0x00, // ¼
+ 0x00,0x60,0xE0,0x60,0x66,0x0C,0x18,0x30,0x6E,0xDB,0x06,0x0C,0x1F,0x00,0x00,0x00, // ½
+ 0x70,0xD8,0x30,0xD8,0x76,0x0C,0x18,0x30,0x66,0xCE,0x1A,0x3F,0x06,0x06,0x00,0x00, // ¾
+ 0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x30,0x60,0xC6,0xC6,0x7C,0x00,0x00, // ¿
+ 0x60,0x30,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // À
+ 0x0C,0x18,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Á
+ 0x10,0x38,0x6C,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Â
+ 0x76,0xDC,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Ã
+ 0x00,0x6C,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Ä
+ 0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Å
+ 0x00,0x00,0x3E,0x78,0xD8,0xD8,0xFC,0xD8,0xD8,0xD8,0xD8,0xDE,0x00,0x00,0x00,0x00, // Æ
+ 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x66,0x3C,0x00, // Ç
+ 0x60,0x30,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, // È
+ 0x0C,0x18,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, // É
+ 0x10,0x38,0x6C,0x00,0xFE,0x66,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, // Ê
+ 0x00,0x6C,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, // Ë
+ 0x60,0x30,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Ì
+ 0x06,0x0C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Í
+ 0x18,0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Î
+ 0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Ï
+ 0x00,0x00,0xF8,0x6C,0x66,0x66,0xF6,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, // Ð
+ 0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Ñ
+ 0x60,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ò
+ 0x0C,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ó
+ 0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ô
+ 0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Õ
+ 0x00,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ö
+ 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0x18,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, // ×
+ 0x00,0x00,0x7E,0xC6,0xCE,0xCE,0xDE,0xF6,0xE6,0xE6,0xC6,0xFC,0x00,0x00,0x00,0x00, // Ø
+ 0x60,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ù
+ 0x0C,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ú
+ 0x10,0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Û
+ 0x00,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ü
+ 0x06,0x0C,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Ý
+ 0x00,0x00,0xF0,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00,0x00,0x00, // Þ
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xCC,0xC6,0xC6,0xC6,0xD6,0xDC,0x80,0x00,0x00,0x00, // ß
+ 0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // à
+ 0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // á
+ 0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // â
+ 0x00,0x00,0x76,0xDC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ã
+ 0x00,0x00,0x00,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ä
+ 0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // å
+ 0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0x1B,0x7F,0xD8,0xDB,0x7E,0x00,0x00,0x00,0x00, // æ
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x18,0x6C,0x38,0x00, // ç
+ 0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // è
+ 0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // é
+ 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // ê
+ 0x00,0x00,0x00,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // ë
+ 0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // ì
+ 0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // í
+ 0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // î
+ 0x00,0x00,0x00,0x6C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // ï
+ 0x00,0x78,0x30,0x78,0x0C,0x7E,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ð
+ 0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // ñ
+ 0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ò
+ 0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ó
+ 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ô
+ 0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // õ
+ 0x00,0x00,0x00,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ö
+ 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // ÷
+ 0x00,0x00,0x00,0x00,0x00,0x7E,0xCE,0xDE,0xFE,0xF6,0xE6,0xFC,0x00,0x00,0x00,0x00, // ø
+ 0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ù
+ 0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ú
+ 0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // û
+ 0x00,0x00,0x00,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ü
+ 0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, // ý
+ 0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,0x00, // þ
+ 0x00,0x00,0x00,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00 // 255
+};
+
+void AlCon_SetFont(int which, uchar *fnt, unsigned w, unsigned h)
+{
+ unsigned sizeChanged=w!=(unsigned)AlCon_FontWidth ||
+ h!=(unsigned)AlCon_FontHeight;
+ AlCon_FontWidth =w;
+ AlCon_FontHeight=h;
+ unsigned wb=(w+7)/8;
+ unsigned sizeGlyph=wb*h;
+
+ FONT_GLYPH **p=which ? Alcon_ASCIIDataS : Alcon_ASCIIDataP;
+ // Copy font from buffer to internal structure.
+ for (int i=0; i<0x100; i++)
+ {// Free previously allocated memory.
+ if (p[i])
+ free(p[i]);
+
+ p[i]=(FONT_GLYPH *)malloc(sizeof(FONT_GLYPH)+sizeGlyph);
+ p[i]->w=AlCon_FontWidth;
+ p[i]->h=AlCon_FontHeight;
+
+ memcpy(p[i]->dat,fnt,sizeGlyph);
+ fnt+=sizeGlyph;
+ }
+ Alcon_PrimaryFont.height =
+ Alcon_SecondaryFont.height=
+ Alcon_CursorFont.height =AlCon_FontHeight;
+
+ if (sizeChanged)
+ Alcon_CreateNewCursor();
+}
+
+/**[txh]********************************************************************
+
+ Description: Loads the specified binary format font into an internal
+ structure like Allegro's font and then sets the static global font pointer
+ to that. If the font could not be loaded, the previously loaded custom
+ font will be used. If this was the first custom font call, Allegro's
+ default font will be used if everything fails. If the filename is a NULL
+ pointer, the default font will be used.
+
+***************************************************************************/
+
+static
+void AlCon_LoadCustomFont(const char *filename, uchar *fdata, unsigned fw,
+ unsigned fh)
+{
+ ASSERT(screen && "You have to call set_gfx_mode before.");
+ static bool one_custom_font_loaded = false;
+ unsigned wb=(fw+7)/8;
+
+ FILE *file = NULL;
+ if (filename)
+ file = fopen(filename, "rb");
+
+ unsigned maxRead=wb*fh*0x100;
+ uchar *font_buffer, buffer[maxRead];
+ int read_bytes=0;
+ if (!file) {
+ if (fdata) {
+ font_buffer=fdata;
+ read_bytes=maxRead;
+ } else {
+ font_buffer=AlCon_ShapeFont8x16;
+ wb=1; fw=8; fh=16;
+ read_bytes=4096;
+ }
+ } else {
+ font_buffer=buffer;
+ int read_bytes=fread(font_buffer, 1, maxRead, file);
+ fclose(file);
+ if (read_bytes < 256) {// Absurd size limit
+ allegro_message("Absurd custom font size (%d bytes)", read_bytes);
+ exit(3);
+ }
+ one_custom_font_loaded = true;
+ }
+
+ // Initialize global variables.
+ Alcon_CurrentFont=&Alcon_PrimaryFont;
+ Alcon_PrimaryFont.vtable=font->vtable;
+ Alcon_PrimaryFont.data=&Alcon_ASCIIMonoFontP;
+ Alcon_SecondaryFont.vtable=font->vtable;
+ Alcon_SecondaryFont.data=&Alcon_ASCIIMonoFontS;
+ Alcon_CursorFont.vtable=font->vtable;
+ Alcon_CursorFont.data=&Alcon_CursorMonoFont;
+
+ AlCon_SetFont(0,font_buffer,fw,read_bytes/(0x100*wb));
+}
+
+/**[txh]********************************************************************
+
+ Description: Fills in the width and height of a text cell.
+
+***************************************************************************/
+
+void AlCon_GetFontGeometry(unsigned int *w, unsigned int *h)
+{
+ ASSERT(w || h);
+ if (w)
+ *w = AlCon_FontWidth;
+ if (h)
+ *h = AlCon_FontHeight;
+}
+
+/**[txh]********************************************************************
+
+ Description: Allocates for the chars and attrs global buffers
+ enough memory as specified by the variables AlCon_ScreenWidth
+ and AlCon_ScreenHeight. If these global variables already had
+ something allocated to them (ie: you are resizing the screen),
+ that memory is freed before the new allocation takes place.
+
+***************************************************************************/
+
+static void AlCon_AllocateMemoryBuffer(void)
+{
+ if (chars) {
+ ASSERT(attrs);
+ free(chars);
+ free(attrs);
+ }
+ chars = (unsigned char *)malloc(AlCon_ScreenWidth * AlCon_ScreenHeight);
+ attrs = (unsigned char *)malloc(AlCon_ScreenWidth * AlCon_ScreenHeight);
+ ASSERT(chars && attrs);
+}
+
+#endif // HAVE_ALLEGRO
diff --git a/tvision/classes/alcon/alcondis.cc b/tvision/classes/alcon/alcondis.cc
new file mode 100644
index 0000000..132708f
--- /dev/null
+++ b/tvision/classes/alcon/alcondis.cc
@@ -0,0 +1,119 @@
+/*****************************************************************************
+
+ Copyright (c) 2003-2004 by Grzegorz Adam Hankiewicz
+ Copyright (c) 2004-2009 by Salvador E. Tropea (SET) <set@ieee.org>
+
+ TDisplayAlcon
+ AlCon driver for Turbo Vision. It uses the conio.h emulation library on top
+ of Allegro.
+
+ Contributed by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>
+
+ This is part of Turbo Vision ditribution and covered by the same license.
+
+*****************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TGKey
+#include <tv.h>
+
+#include <tv/alcon/screen.h>
+#include <tv/alcon/mouse.h>
+#include <tv/alcon/key.h>
+#define Uses_AlCon_conio
+#include <tv/alcon/alcon.h>
+
+#ifdef HAVE_ALLEGRO
+
+void TDisplayAlcon::Init()
+{
+ setCursorPos=SetCursorPos;
+ getCursorPos=GetCursorPos;
+ getCursorShape=GetCursorShape;
+ setCursorShape=SetCursorShape;
+ // DOS version has this, where? TDisplay::clearScreen=ClearScreen;
+ getRows=GetRows;
+ getCols=GetCols;
+// TDisplay::setCrtMode=SetCrtMode;
+// TDisplay::getCrtMode=GetCrtMode;
+// TDisplay::setCrtModeExt=SetCrtModeExt;
+// TDisplay::setCrtModeRes_p=SetCrtModeRes;
+// TDisplay::getWindowTitle=GetWindowTitle;
+// TDisplay::setWindowTitle=SetWindowTitle;
+// TDisplay::setDisPaletteColors=SetDisPaletteColors;
+// TDisplay::getDisPaletteColors=GetDisPaletteColors;
+// TDisplay::beep=Beep;
+}
+
+TDisplayAlcon::~TDisplayAlcon()
+{
+}
+
+void TDisplayAlcon::GetCursorPos(unsigned &x, unsigned &y)
+{
+ // AlCon returns vars in the range of 1 <= var <= inf.
+ x = AlCon_WhereX() - 1;
+ y = AlCon_WhereY() - 1;
+}
+
+void TDisplayAlcon::SetCursorPos(unsigned x, unsigned y)
+{
+ // AlCon expects a range of 1 <= var <= inf.
+ AlCon_GotoXY(x + 1, y + 1);
+}
+
+/**[txh]********************************************************************
+
+ Description: Called with percentage values from 0 to 100 inclusive.
+ If start is bigger or equal end (usually both 0), this means hide the
+ cursor.
+
+***************************************************************************/
+
+void TDisplayAlcon::SetCursorShape(unsigned start, unsigned end)
+{
+ if (start >= end && getShowCursorEver())
+ return;
+
+ if (start >= end) {
+ AlCon_HideCursor();
+ } else {
+ AlCon_ShowCursor();
+ unsigned int h;
+ AlCon_GetFontGeometry(0, &h);
+ AlCon_SetCursorShape(int(start * (h - 0.00001f) / 100),
+ int(end * (h - 0.00001f) / 100));
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description: Fills into start and end the beginning and end of the cursor
+ shape as percentage values from 0 to 1.
+
+***************************************************************************/
+
+void TDisplayAlcon::GetCursorShape(unsigned &start, unsigned &end)
+{
+ int _start, _end;
+ unsigned int h;
+ AlCon_GetCursorShape(&_start, &_end);
+ AlCon_GetFontGeometry(0, &h);
+ start = 100 * _start / h;
+ end = 100 * _end / h;
+}
+
+ushort TDisplayAlcon::GetRows()
+{
+ return AlCon_ScreenRows();
+}
+
+ushort TDisplayAlcon::GetCols()
+{
+ return AlCon_ScreenCols();
+}
+
+#endif // HAVE_ALLEGRO
diff --git a/tvision/classes/alcon/alconkey.cc b/tvision/classes/alcon/alconkey.cc
new file mode 100644
index 0000000..c434c34
--- /dev/null
+++ b/tvision/classes/alcon/alconkey.cc
@@ -0,0 +1,79 @@
+/*****************************************************************************
+
+ Copyright (c) 2003-2004 by Grzegorz Adam Hankiewicz
+ Copyright (c) 2004-2009 by Salvador E. Tropea (SET) <set@ieee.org>
+
+ TGKeyAlcon
+ AlCon driver for Turbo Vision. It uses the conio.h emulation library on top
+ of Allegro.
+
+ Contributed by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>
+
+ This is part of Turbo Vision ditribution and covered by the same license.
+
+*****************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TGKey
+#include <tv.h>
+
+#include <tv/alcon/key.h>
+#define Uses_AlCon_conio
+#include <tv/alcon/alcon.h>
+
+#ifdef HAVE_ALLEGRO
+
+/*****************************************************************************
+
+ TGKeyAlcon keyboard stuff.
+
+*****************************************************************************/
+
+unsigned TGKeyAlcon::Symbol;
+uchar TGKeyAlcon::Scan;
+unsigned TGKeyAlcon::Flags;
+
+void TGKeyAlcon::Init()
+{
+ TGKey::kbhit = KbHit;
+ TGKey::clear = Clear;
+ TGKey::gkey = GKey;
+ TGKey::fillTEvent = FillTEvent;
+// TGKey::getShiftState=GetShiftState;
+}
+
+int TGKeyAlcon::KbHit()
+{
+ return AlCon_KbHit();
+}
+
+void TGKeyAlcon::Clear()
+{
+ AlCon_ClearKeyBuf();
+}
+
+ushort TGKeyAlcon::GKey()
+{
+ return AlCon_GetKey(&Symbol, &Scan, &Flags);
+}
+
+void TGKeyAlcon::FillTEvent(TEvent &e)
+{
+ ushort Abstract=GKey();
+ e.keyDown.charScan.charCode=((Flags & kbAltLCode) && (Symbol<128)) ? 0 : Symbol;
+ e.keyDown.charScan.scanCode=Scan;
+ e.keyDown.raw_scanCode=Scan;
+ e.keyDown.keyCode=Abstract;
+ e.keyDown.shiftState=0;
+ // TODO: fill the shiftState correctly.
+ //e.keyDown.shiftState=kbFlags;
+
+ // TODO: Unicode? Yeah right.
+ //e.keyDown.charCode=Unicode; // Should I do the same as with Symbol?
+ e.what=evKeyDown;
+}
+
+#endif // HAVE_ALLEGRO
diff --git a/tvision/classes/alcon/alconmouse.cc b/tvision/classes/alcon/alconmouse.cc
new file mode 100644
index 0000000..a6e6143
--- /dev/null
+++ b/tvision/classes/alcon/alconmouse.cc
@@ -0,0 +1,47 @@
+/*****************************************************************************
+
+ Copyright (c) 2003-2004 by Grzegorz Adam Hankiewicz
+ Copyright (c) 2004-2009 by Salvador E. Tropea (SET) <set@ieee.org>
+
+ THWMouseAlcon
+ AlCon driver for Turbo Vision. It uses the conio.h emulation library on top
+ of Allegro.
+
+ Contributed by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>
+
+ This is part of Turbo Vision ditribution and covered by the same license.
+
+*****************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TGKey
+#include <tv.h>
+
+#include <tv/alcon/mouse.h>
+#define Uses_AlCon_conio
+#include <tv/alcon/alcon.h>
+
+#ifdef HAVE_ALLEGRO
+
+void THWMouseAlcon::Init()
+{
+ THWMouse::GetEvent=GetEvent;
+ buttonCount=AlCon_GetMouseButtons();
+}
+
+THWMouseAlcon::~THWMouseAlcon()
+{
+}
+
+void THWMouseAlcon::GetEvent(MouseEventType &me)
+{
+ int buttons;
+ AlCon_GetMousePos(&me.where.x, &me.where.y, &buttons);
+ me.buttons = uchar(buttons & 255);
+ me.doubleClick=False;
+}
+#endif // HAVE_ALLEGRO
diff --git a/tvision/classes/alcon/alconscr.cc b/tvision/classes/alcon/alconscr.cc
new file mode 100644
index 0000000..643bbdb
--- /dev/null
+++ b/tvision/classes/alcon/alconscr.cc
@@ -0,0 +1,509 @@
+/*****************************************************************************
+
+ Copyright (c) 2003-2004 by Grzegorz Adam Hankiewicz
+ Copyright (c) 2004-2009 by Salvador E. Tropea (SET) <set@ieee.org>
+
+ TScreenAlcon
+ AlCon driver for Turbo Vision. It uses the conio.h emulation library on top
+ of Allegro.
+
+ Contributed by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>
+
+ This is part of Turbo Vision ditribution and covered by the same license.
+
+*****************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_stdio // DEBUG
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TGKey
+#include <tv.h>
+
+#include <tv/alcon/screen.h>
+#include <tv/alcon/mouse.h>
+#include <tv/alcon/key.h>
+#define Uses_AlCon_conio
+#include <tv/alcon/alcon.h>
+
+#ifdef HAVE_ALLEGRO
+
+#define PRINTF(FORMAT, args...) printf("%s " FORMAT "\n", __PRETTY_FUNCTION__, ## args)
+
+const unsigned foWmin=5, foHmin=7, foWmax=20, foHmax=32;
+TScreenFont256 TScreenAlcon::font8x16={ 8,16,AlCon_ShapeFont8x16 };
+TScreenFont256 TScreenAlcon::font10x20={ 10,20,AlCon_ShapeFont10x20 };
+TScreenFont256 *TScreenAlcon::defaultFont=&font8x16;
+uchar TScreenAlcon::primaryFontChanged=0;
+unsigned TScreenAlcon::fontW;
+unsigned TScreenAlcon::fontWb;
+unsigned TScreenAlcon::fontH;
+unsigned TScreenAlcon::fontSz;
+
+TScreen *TV_AlconDriverCheck()
+{
+ TScreenAlcon *drv = new TScreenAlcon();
+ if (!TScreen::initialized) {
+ delete drv;
+ return 0;
+ }
+ return drv;
+}
+
+
+TScreenAlcon::TScreenAlcon()
+{
+ // TODO: That's wrong we should be shure Allegro will succeed before doing it.
+ if (dCB) dCB();
+
+ screenWidth=80; screenHeight=25;
+ fontW=8; fontH=16;
+
+ /* Code page */
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+ /* User settings have more priority than detected settings */
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : TVCodePage::ISOLatin1Linux,
+ forcedScrCP!=-1 ? forcedScrCP : TVCodePage::ISOLatin1Linux,
+ forcedInpCP!=-1 ? forcedInpCP : TVCodePage::ISOLatin1Linux);
+ SetDefaultCodePages(TVCodePage::ISOLatin1Linux,TVCodePage::ISOLatin1Linux,
+ TVCodePage::ISOLatin1Linux);
+
+ long aux;
+ if (optSearch("ScreenWidth",aux))
+ screenWidth=aux;
+ if (optSearch("ScreenHeight",aux))
+ screenHeight=aux;
+ if (optSearch("FontWidth",aux))
+ fontW=aux;
+ if (optSearch("FontHeight",aux))
+ fontH=aux;
+
+ const char *lang = optSearch("KeyboardMapping");
+ if (lang) {
+ AlCon_ForcedKeyboard[0] = lang[0];
+ if (lang[0])
+ AlCon_ForcedKeyboard[1] = lang[1];
+ }
+
+ // Set extra cursor bits through config parameters.
+ #define READ_BIT(CONFIG_NAME, BIT_NAME) \
+ { \
+ if (optSearch(CONFIG_NAME, aux)) \
+ if (aux) \
+ AlCon_CursorBits |= BIT_NAME; \
+ }
+
+ READ_BIT("CursorHideNormal", ALCON_CURSOR_HIDE_NORMAL);
+ READ_BIT("CursorOnSquare", ALCON_CURSOR_ON_SQUARE);
+ READ_BIT("CursorOnCross", ALCON_CURSOR_ON_CROSS);
+
+ #undef READ_BIT
+
+ uchar *fontData=NULL;
+ int freeFontData=1;
+ TScreenFont256 *secFont=NULL;
+ TScreenFont256 *useFont=NULL;
+
+ if (fontW==10 && fontH==20)
+ defaultFont=&font10x20;
+
+ if (!frCB || !(useFont=frCB(0,fontW,fontH)))
+ {
+ useFont=defaultFont;
+ freeFontData=0;
+ }
+
+ fontW=useFont->w;
+ fontH=useFont->h;
+ fontWb=(useFont->w+7)/8;
+ fontSz=fontWb*fontH;
+ fontData=useFont->data;
+
+ // Create screen.
+ TScreenColor *pal=parseUserPalette() ? UserStartPalette : PC_BIOSPalette;
+ int res=AlCon_Init(screenWidth,screenHeight,fontW,fontH,fontData,(AlCon_Color *)pal);
+ if (freeFontData)
+ {/* Provided by the call back */
+ DeleteArray(useFont->data);
+ delete useFont;
+ }
+ if (res)
+ return;
+
+ // Secondary font.
+ aux=0;
+ if (frCB && optSearch("LoadSecondaryFont",aux) && aux)
+ {
+ secFont=frCB(1,fontW,fontH);
+ if (secFont)
+ {
+ AlCon_SetFont(1,secFont->data,fontW,fontH);
+ DeleteArray(secFont->data);
+ delete secFont;
+ }
+ }
+
+ /*
+ Even though we initialised AlCon with a wanted screen
+ width and height, it might have had to change it in order
+ to accomodate the font which was loaded.
+ */
+ screenWidth = AlCon_ScreenCols();
+ screenHeight = AlCon_ScreenRows();
+ memcpy(ActualPalette,AlCon_CurPalette,sizeof(ActualPalette));
+ memcpy(OriginalPalette,AlCon_CurPalette,sizeof(OriginalPalette));
+
+ // Find font geometry
+ AlCon_GetFontGeometry(&fontW,&fontH);
+ fontWb=(fontW+7)/8;
+ fontSz=fontWb*fontH;
+
+ TDisplayAlcon::Init();
+
+ TScreen::Resume=Resume;
+ TScreen::Suspend=Suspend;
+ TScreen::clearScreen=clearScreen;
+ TScreen::getCharacters=getCharacters;
+ TScreen::getCharacter=getCharacter;
+ TScreen::setCharacter=setCharacter;
+ TScreen::setCharacters=setCharacters;
+ TScreen::setDisPaletteColors=SetDisPaletteColors;
+ // Fonts stuff
+ TScreen::getFontGeometry=GetFontGeometry;
+ TScreen::getFontGeometryRange=GetFontGeometryRange;
+ TScreen::setFont_p=SetFont;
+ TScreen::restoreFonts=RestoreFonts;
+ TScreen::setCrtModeRes_p=SetCrtModeRes;
+ initialized=1;
+
+ TGKeyAlcon::Init();
+ THWMouseAlcon::Init();
+
+ // Tell TScreen that there is a cursor.
+ setCrtData();
+ startupCursor = cursorLines;
+ startupMode = screenMode;
+
+ // Create memory buffer for screen. We want a buffer (even though
+ // AlCon is buffered) because otherwise TVision will use simple
+ // memcpy calls to "paint" the screen. We don't want this, because
+ // Allegro has to be told when to update the screen. So it's a
+ // buffer on top of Allegro's buffer so that Allegro get's called.
+ // Wicked. But works.
+ screenBuffer=new uint16[screenWidth*screenHeight];
+
+ flags0|=CanSetPalette | CanReadPalette | CanSetBFont | CanSetSBFont |
+ CanSetVideoSize;
+
+ suspended=0;
+}
+
+void TScreenAlcon::Resume()
+{
+ AlCon_Redraw();
+ AlCon_EnableAsync();
+}
+
+void TScreenAlcon::Suspend()
+{
+ AlCon_DisableAsync();
+}
+
+TScreenAlcon::~TScreenAlcon()
+{
+ delete[] screenBuffer;
+
+ // Deinitialize all.
+ AlCon_Exit();
+}
+
+
+void TScreenAlcon::clearScreen()
+{
+ TDisplay::clearScreen(AlCon_ScreenCols(), AlCon_ScreenCols());
+}
+
+
+ushort TScreenAlcon::getCharacter(unsigned offset)
+{
+ ushort buffer;
+ AlCon_GetScrChars(offset, &buffer, 1);
+ return buffer;
+}
+
+
+void TScreenAlcon::getCharacters(unsigned offset, ushort *buffer, unsigned count)
+{
+ AlCon_GetScrChars(offset, buffer, count);
+}
+
+
+void TScreenAlcon::setCharacter(unsigned offset, ushort value)
+{
+ AlCon_PutChar(offset, value);
+}
+
+
+void TScreenAlcon::setCharacters(unsigned offset, ushort *values, unsigned count)
+{
+ AlCon_PutBuf(offset, values, count);
+}
+
+
+int TScreenAlcon::GetFontGeometry(unsigned &w, unsigned &h)
+{
+ w=fontW;
+ h=fontH;
+ return 1;
+}
+
+int TScreenAlcon::GetFontGeometryRange(unsigned &wmin, unsigned &hmin,
+ unsigned &wmax, unsigned &hmax)
+{
+ wmin=foWmin;
+ hmin=foHmin;
+ wmax=foWmax;
+ hmax=foHmax;
+ return 1;
+}
+
+int TScreenAlcon::SetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP, int appCP)
+{
+ if (!changeP && !changeS) return 1;
+ // Check for restore fonts
+ if (changeP && !fontP && ((!changeS && !useSecondaryFont) || (changeS && !fontS)))
+ fontP=defaultFont;
+
+ // Solve the sizes
+ unsigned wP, hP, wS, hS;
+ if (changeP)
+ {
+ if (fontP)
+ {
+ wP=fontP->w;
+ hP=fontP->h;
+ }
+ else
+ {
+ wP=defaultFont->w;
+ hP=defaultFont->h;
+ }
+ }
+ else
+ {
+ wP=fontW;
+ hP=fontH;
+ }
+ if (changeS)
+ {
+ if (fontS)
+ {
+ wS=fontS->w;
+ hS=fontS->h;
+ }
+ else
+ {// Disabled
+ wS=wP;
+ hS=hP;
+ }
+ }
+ else
+ {
+ if (useSecondaryFont)
+ {
+ wS=fontW;
+ hS=fontH;
+ }
+ else
+ {// Disabled
+ wS=wP;
+ hS=hP;
+ }
+ }
+ // Size missmatch
+ if (wP!=wS || hP!=hS) return 0;
+ // This driver currently doesn't support changing the font size on the fly
+ //if (wP!=fontW || hP!=fontH) return 0;
+ // Check if the size is in the range
+ if (wP<foWmin || wP>foWmax || hP<foHmin || hP>foHmax)
+ return 0;
+
+ // Change the requested fonts
+ if (changeP)
+ {
+ if (fontP && fontP->data)
+ {
+ AlCon_SetFont(0,fontP->data,wP,hP);
+ primaryFontChanged=1;
+ }
+ else
+ {
+ AlCon_SetFont(0,defaultFont->data,wP,hP);
+ primaryFontChanged=0;
+ }
+ }
+ if (changeS)
+ {
+ if (fontS)
+ {
+ AlCon_SetFont(1,fontS->data,wP,hP);
+ useSecondaryFont=1;
+ AlCon_EnableSecFont();
+ }
+ else
+ {
+ useSecondaryFont=0;
+ AlCon_DisableSecFont();
+ }
+ }
+ // Change the code page
+ if (changeP && fontCP!=-1)
+ {
+ if (appCP==-1)
+ TVCodePage::SetScreenCodePage(fontCP);
+ else
+ TVCodePage::SetCodePage(appCP,fontCP,-1);
+ }
+ if (wP!=fontW || hP!=fontH)
+ {
+ DoResize(wP,hP);
+ }
+ AlCon_Redraw();
+
+ return 1;
+}
+
+void TScreenAlcon::RestoreFonts()
+{
+ SetFont(1,NULL,1,NULL,TVCodePage::ISOLatin1Linux,TVCodePage::ISOLatin1Linux);
+}
+
+int TScreenAlcon::SetDisPaletteColors(int from, int number, TScreenColor *colors)
+{
+ int i=AlCon_SetDisPaletteColors(from,number,(AlCon_Color *)colors);
+ AlCon_Redraw();
+ return i;
+}
+
+/**[txh]********************************************************************
+
+ Description: Called to perform a screen resize. The fonts for the new
+ screen size have already been loaded. The parameters indicate the size
+ in pixels of each text cell. Therefore, this function adjusts the cursor,
+ some internal variables, and requests Allegro to set a different size.
+
+***************************************************************************/
+
+void TScreenAlcon::DoResize(unsigned w, unsigned h)
+{
+ ASSERT(w>0);
+ ASSERT(h>0);
+
+ int ret=AlCon_Resize(screenWidth,screenHeight,w,h);
+ if (ret!=0)
+ {
+ PRINTF("Ayeeee! A monkey with three heads! %d\n", ret);
+ exit(ret);
+ }
+ if (w!=fontW || h!=fontH)
+ {
+ int cShapeFrom, cShapeTo;
+ AlCon_GetCursorShape(&cShapeFrom,&cShapeTo);
+ double start=cShapeFrom/(double)fontH;
+ double end =cShapeTo/(double)fontH;
+ fontW=w;
+ fontWb=(w+7)/8;
+ fontH=h;
+ fontSz=fontWb*h;
+
+ /* Change the cursor shape */
+ cShapeFrom=int(start*fontH+0.5);
+ cShapeTo =int(end*fontH+0.5);
+ if ((unsigned)cShapeFrom>=fontH) cShapeFrom=fontH-1;
+ if ((unsigned)cShapeTo>=fontH) cShapeTo=fontH-1;
+ AlCon_SetCursorShape(cShapeFrom,cShapeTo);
+ }
+
+ /* Compute cursor position and draw it */
+ AlCon_GotoXY(AlCon_WhereX(),AlCon_WhereY());
+}
+
+int TScreenAlcon::SetCrtModeRes(unsigned w, unsigned h, int fW, int fH)
+{
+ if (fW==-1) fW=fontW;
+ if (fH==-1) fH=fontH;
+ if (w==screenWidth && h==screenHeight &&
+ fontW==(unsigned)fW && fontH==(unsigned)fH) return 0;
+
+ unsigned nW=fontW, nH=fontH;
+ TScreenFont256 *nFont=NULL,*nsFont=NULL;
+ int releaseFont=0, releaseSFont=0, resetFont=0;
+
+ // Solve the fonts, don't change them yet.
+ if ((unsigned)fW!=fontW || (unsigned)fH!=fontH)
+ {
+ if (primaryFontChanged)
+ {// The application set a font, ask for this new one
+ if (frCB && (nFont=frCB(0,fW,fH)))
+ releaseFont=1;
+ else
+ {// No replacement available, revert to our font.
+ resetFont=1;
+ nFont=&font8x16;
+ }
+ }
+ else
+ {
+ if (fW==8 && fH==16)
+ resetFont=1, nFont=&font8x16;
+ else if (frCB && (nFont=frCB(0,fW,fH)))
+ releaseFont=1;
+ else
+ resetFont=1, nFont=&font8x16;
+ }
+ nW=nFont->w;
+ nH=nFont->h;
+ if ((nW!=fontW || nH!=fontH) && useSecondaryFont)
+ {
+ if (frCB && (nsFont=frCB(1,nW,nH)))
+ releaseSFont=1;
+ }
+ }
+
+
+ AlCon_DisableAsync();
+ if (nFont)
+ {
+ AlCon_SetFont(0,nFont->data,nW,nH);
+ if (resetFont)
+ primaryFontChanged=0;
+ if (releaseFont)
+ {
+ DeleteArray(nFont->data);
+ delete nFont;
+ }
+ }
+ if (useSecondaryFont)
+ {
+ if (nsFont)
+ AlCon_SetFont(1,nsFont->data,nW,nH);
+ }
+ // Should I check the size?
+ screenWidth=w; screenHeight=h;
+
+ delete[] screenBuffer;
+ screenBuffer=new uint16[screenWidth*screenHeight];
+ memset(screenBuffer,0,screenWidth*screenHeight*sizeof(uint16));
+ AlCon_EnableAsync();
+
+ DoResize(nW,nH);
+
+ return (nW==(unsigned)fW && nH==(unsigned)fH) ? 1 : 2;
+}
+
+#endif // HAVE_ALLEGRO
diff --git a/tvision/classes/calcdisp.cc b/tvision/classes/calcdisp.cc
new file mode 100644
index 0000000..dfb4310
--- /dev/null
+++ b/tvision/classes/calcdisp.cc
@@ -0,0 +1,291 @@
+/*------------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Calc.cpp: TCalcDisplay member functions */
+/* */
+/*------------------------------------------------------------*/
+
+/*
+ Modified by Salvador Eduardo Tropea <salvador@inti.gov.ar>
+ <set@ieee.org> <set@computer.org>
+ I ported it from TV 1.03.
+ SET: Added locale support for the decimal point.
+ */
+
+// SET: moved the standard headers before tv.h
+#define Uses_string
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_stdio // sprintf
+#define Uses_nl_langinfo
+
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TButton
+#define Uses_TKeys
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_TView
+#define Uses_TPalette // SET: added
+#define Uses_TCalcDisplay
+#include <tv.h>
+
+#define cpCalcPalette "\x13"
+
+TCalcDisplay::TCalcDisplay(TRect& r) : TView ( r )
+{
+ options |= ofSelectable;
+ eventMask = (evKeyboard | evBroadcast);
+ number = new char[DISPLAYLEN];
+ clear();
+
+}
+
+TCalcDisplay::~TCalcDisplay()
+{
+ DeleteArray(number);
+}
+
+TPalette& TCalcDisplay::getPalette() const
+{
+ static TPalette palette( cpCalcPalette, sizeof(cpCalcPalette)-1 );
+ return palette;
+}
+
+
+void TCalcDisplay::handleEvent(TEvent& event)
+{
+ // SET: Independent of the label
+ static char keys[]={'C','\x8','%','_','7','8','9','/','4','5','6',
+ '*','1','2','3','-','0','.','=','+'};
+ TView::handleEvent(event);
+
+ switch(event.what)
+ {
+ case evKeyboard:
+ calcKey(event.keyDown.charScan.charCode,event.keyDown.keyCode);
+ clearEvent(event);
+ break;
+ case evBroadcast:
+ if(event.message.command>=cmCalcButton &&
+ event.message.command<=cmCalcButton+19)
+ {
+ calcKey(keys[event.message.command-cmCalcButton],0);
+ clearEvent(event);
+ }
+ break;
+ }
+}
+
+
+void TCalcDisplay::draw()
+{
+ char color = getColor(1);
+ int i;
+ TDrawBuffer buf;
+
+ i = size.x - strlen(number) - 2;
+ buf.moveChar(0, ' ', color, size.x);
+ buf.moveChar(i, sign, color, 1);
+ buf.moveStr(i+1, number, color);
+ writeLine(0, 0, size.x, 1, buf);
+}
+
+
+void TCalcDisplay::error()
+{
+ status = csError;
+ strcpy(number, _("Error"));
+ sign = ' ';
+}
+
+
+void TCalcDisplay::clear()
+{
+ status = csFirst;
+ strcpy(number, "0");
+ sign = ' ';
+ operate = '=';
+}
+
+
+void TCalcDisplay::setDisplay(double r)
+{
+ int len;
+ char str[64];
+ //ostrstream displayStr( str, sizeof str );SET: Removed this waste
+
+ if(r < 0.0)
+ {
+ sign = '-';
+ sprintf(str,"%f",-r);
+ }
+ else
+ {
+ sprintf(str,"%f",r);
+ sign = ' ';
+ }
+
+ len = strlen(str) - 1; // Minus one so we can use as an index.
+
+ if(len > DISPLAYLEN)
+ error();
+ else
+ strcpy(number, str);
+}
+
+
+void TCalcDisplay::checkFirst()
+{
+ if( status == csFirst)
+ {
+ status = csValid;
+ strcpy(number, "0");
+ sign = ' ';
+ }
+}
+
+
+void TCalcDisplay::calcKey(unsigned char key, unsigned code)
+{
+ char stub[2] = " ";
+ double r;
+ char *decPoint=nl_langinfo(RADIXCHAR);
+
+ switch(code)
+ {
+ case kbBackSpace:
+ key=8;
+ break;
+ case kbEsc:
+ key=27;
+ break;
+ case kbEnter: // Added by Mike
+ key=13;
+ break;
+ }
+
+ key = (unsigned char)toupper(key);
+ if( status == csError && key != 'C')
+ key = ' ';
+
+ switch(key)
+ {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ checkFirst();
+ if (strlen(number) < 15)
+ { // 15 is max visible display length
+ if (!strcmp(number, "0"))
+ number[0] = '\0';
+ stub[0] = key;
+ strcat(number, stub);
+ }
+ break;
+
+ case 8:
+ case 27:
+ int len;
+
+ checkFirst();
+ if( (len = strlen(number)) == 1 )
+ strcpy(number, "0");
+ else
+ number[len-1] = '\0';
+ break;
+
+ case '_': // +-
+ sign = (sign == ' ') ? '-' : ' ';
+ break;
+
+ case '.':
+ checkFirst();
+ if(strstr(number, decPoint) == NULL)
+ strcat(number, decPoint);
+ break;
+
+ case '+': case '-': case '*': case '/':
+ case '=': case '%': case 13:
+ if(status == csValid)
+ {
+ status = csFirst;
+ r = getDisplay() * ((sign == '-') ? -1.0 : 1.0);
+ if( key == '%' )
+ {
+ if(operate == '+' || operate == '-')
+ r = (operand * r) / 100;
+ else
+ r /= 100;
+ }
+ switch( operate )
+ {
+ case '+':
+ setDisplay(operand + r);
+ break;
+
+ case '-':
+ setDisplay(operand - r);
+ break;
+
+ case '*':
+ setDisplay(operand * r);
+ break;
+
+ case '/':
+ if(r == 0)
+ error();
+ else
+ setDisplay(operand / r);
+ break;
+
+ }
+ }
+ operate = key;
+ operand = getDisplay() * ((sign == '-') ? -1.0 : 1.0);
+ break;
+
+ case 'C':
+ clear();
+ break;
+
+ }
+ drawView();
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TCalcDisplay::build()
+{
+ return new TCalcDisplay( streamableInit );
+}
+
+void TCalcDisplay::write( opstream& os )
+{
+ TView::write( os );
+ os.writeBytes(&status, sizeof(status));
+ os.writeString(number);
+ os.writeByte(sign);
+ os.writeByte(operate);
+ os.writeBytes(&operand, sizeof(operand));
+}
+
+
+void *TCalcDisplay::read( ipstream& is )
+{
+ TView::read( is );
+ number = new char[DISPLAYLEN];
+ is.readBytes(&status, sizeof(status));
+ is.readString(number, DISPLAYLEN);
+ sign = is.readByte();
+ operate = is.readByte();
+ is.readBytes(&operand, sizeof(operand));
+ return this;
+}
+#endif // NO_STREAM
+
+
+
diff --git a/tvision/classes/calculat.cc b/tvision/classes/calculat.cc
new file mode 100644
index 0000000..9204155
--- /dev/null
+++ b/tvision/classes/calculat.cc
@@ -0,0 +1,68 @@
+/*------------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Calc.cpp: TCalculator constructor */
+/* */
+/*------------------------------------------------------------*/
+
+/*
+ Modified by Salvador Eduardo Tropea <salvador@inti.gov.ar>
+ <set@ieee.org> <set@computer.org>
+ I ported it from TV 1.03.
+ */
+
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TButton
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_TView
+#define Uses_TDialog
+#define Uses_TCalculator
+#include <tv.h>
+
+// SET: Moved to the class, made ASCII
+const char *TCalculator::keyChar[20] =
+ { "C", "<-", "%", "+-",
+ "7", "8", "9", "/",
+ "4", "5", "6", "*",
+ "1", "2", "3", "-",
+ "0", ".", "=", "+"
+ };
+
+TCalculator::TCalculator() :
+ // SET: The display size must be satisfied
+ TWindowInit( &TCalculator::initFrame ),
+ TDialog( TRect(5, 3, 5+6+DISPLAYLEN, 18), __("Pocket Calculator") )
+{
+ TView *tv;
+ TRect r;
+
+ options |= ofFirstClick;
+
+ // SET: enlarged buttons
+ for(int i = 0; i <= 19; i++)
+ {
+ int x = (i%4)*6+3;
+ int y = (i/4)*2+4;
+ r = TRect( x, y, x+6, y+2 );
+
+ tv = new TButton( r, keyChar[i], cmCalcButton+i, bfNormal | bfBroadcast );
+ tv->options &= ~ofSelectable;
+ insert( tv );
+ }
+ r = TRect( 3, 2, 3+DISPLAYLEN, 3 ); // SET, that's checked in setDisplay
+ insert( new TCalcDisplay(r) );
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TCalculator::build()
+{
+ return new TCalculator( streamableInit );
+}
+#endif
+
diff --git a/tvision/classes/codepage.cc b/tvision/classes/codepage.cc
new file mode 100644
index 0000000..2b4eb37
--- /dev/null
+++ b/tvision/classes/codepage.cc
@@ -0,0 +1,2769 @@
+/**[txh]********************************************************************
+
+ Copyright 1996-2002 by Salvador Eduardo Tropea (SET)
+ This file is covered by the GPL license.
+
+ Module: Code Page
+ Include: TVCodePage
+ Comments:
+ This module provides code page remapping needed to adapt the special
+character to all the supported terminals.@p
+ It was originally designed for SETEdit and moved to Turbo Vision in 2002.@p
+ The internal encoding system maps the first 256 to CP 437.@p
+ Important: The Turbo Vision never had such a thing and this is completly
+new code that affects a lot of TV components.@p
+ The mechanism used is similar to what Linux kernel uses, why? simple:@*
+1) That's the most complex mechanism I found in all the targets so far.@*
+2) This is quite crazy but at the same time flexible.@*
+ What's similar?@*
+ We have two maps. The first map is what Linux calls SFM (Screen Font Map).
+It defines which internal codes are rendered by each font character (which
+unicodes in Linux kernel). This is basically a map that describes the font.
+This is the only map I had in the editor. The curScrCP variable holds the
+ID of this map.@p
+ The second map is what the Linux kernel calls ACM (Application Charset
+Map). This map describes how is the application data encoded, as an example:
+how is encoded the text. It doesn't have to map one to one with the font,
+and that's the complex stuff. For this reason this map is used to do an
+"on-the-fly" remap before sending the characters to the screen. If this map
+is identical to the SFM (maps 1 to 1 => what Linux calls trivial mapping)
+we don't do the remap. The OnTheFlyRemapNeeded() and OnTheFlyRemap(uchar val)
+are used for the remap. The curAppCP holds the ID of this map.@p
+ Is important to note that we don't do 8-bits -> ACM -> Unicode -> SFM ->
+8-bits Screen like the Linux kernel does. We recode the application using
+the ACM and if ACM!=SFM we use a simple table that makes: 8-bits -> 8-bits
+Screen and if it isn't needed we just send the code to the screen.@p
+ I added a new code page to this: the input code page. In Linux systems
+the input is supposed to be encoded in the ACM code page. In Windows systems
+they can be different and they are asked with different calls. It can be
+useful if you want to use an encoding different than the currently used by
+the OS. You can change the screen encoding and load an appropriate font for
+it, then you change the application code page and you can properly see
+documents encoded in the target code page. But in order to edit them you
+need to translate the codes that come from keyboard to the target code page.
+That's a good use for the input code page.
+
+***************************************************************************/
+
+#define Uses_stdio
+
+#define Uses_string
+#define Uses_stdlib //bsearch
+#define Uses_TStringCollection
+#define Uses_TVCodePage
+
+// Classes we remap chars
+#define Uses_TScreen
+#define Uses_TRadioButtons
+#define Uses_TMenuBox
+#define Uses_TFrame
+#define Uses_TIndicator
+#define Uses_THistory
+#define Uses_TColorSelector
+#define Uses_TMonoSelector
+#define Uses_TColorDialog
+#define Uses_TInputLine
+#define Uses_TStatusLine
+#define Uses_TCheckBoxes
+#define Uses_TScrollBar
+#define Uses_TButton
+#define Uses_TDirListBox
+#define Uses_TFileEditor
+#define Uses_TFileInfoPane
+#define Uses_TDeskTop
+#define Uses_TListViewer
+#define Uses_TGKey
+
+// Needed for extra remaps
+#define Uses_TProgram
+#define Uses_TBackground
+#define Uses_TEvent
+
+#include <tv.h>
+
+// List of supported code pages
+TVCodePageCol *TVCodePage::CodePages=NULL;
+// The full description of desired code page
+ushort TVCodePage::CPTable[257];
+// toUpper/Lower and isAlpha tables
+// I initialize it with some defaults in case they are needed before setting a
+// code page, in this case only the ASCII range is really usable. The tables
+// are for PC437.
+uchar TVCodePage::AlphaTable[256]=
+{
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,
+ 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
+ 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x05,0x03,0x03,0x01,0x03,0x01,0x03,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x05,0x05,
+ 0x05,0x03,0x05,0x01,0x03,0x01,0x01,0x01,0x01,0x05,0x05,0x00,0x00,0x00,0x00,0x00,
+ 0x01,0x01,0x01,0x01,0x03,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+uchar TVCodePage::toUpperTable[256]=
+{
+ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+ 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+ 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+ 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+ 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+ 0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+ 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+ 0x80,0x9A,0x90,0x83,0x8E,0x85,0x8F,0x80,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+ 0x90,0x92,0x92,0x93,0x99,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+ 0xA0,0xA1,0xA2,0xA3,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+ 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+ 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+ 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+ 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+uchar TVCodePage::toLowerTable[256]=
+{
+ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+ 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+ 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+ 0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+ 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+ 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+ 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+ 0x87,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x84,0x86,
+ 0x82,0x91,0x91,0x93,0x94,0x95,0x96,0x97,0x98,0x94,0x81,0x9B,0x9C,0x9D,0x9E,0x9F,
+ 0xA0,0xA1,0xA2,0xA3,0xA4,0xA4,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+ 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+ 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+ 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+ 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+// Some Linux codepages aren't what they claim to be just to put the frames
+// in a better place.
+uchar TVCodePage::OnTheFlyMap[256];
+char TVCodePage::NeedsOnTheFlyRemap=0;
+// This is a translation for the codes from keyboard.
+uchar TVCodePage::OnTheFlyInpMap[256];
+char TVCodePage::NeedsOnTheFlyInpRemap=0;
+// Current code pages
+// The source code is encoded in CP 437
+int TVCodePage::curAppCP=437;
+// We assume the screen is also CP 437, if it isn't true the driver will inform it.
+int TVCodePage::curScrCP=437;
+// What we get from the keyboard
+int TVCodePage::curInpCP=437;
+// Default values suggested by the current driver
+int TVCodePage::defAppCP=437;
+int TVCodePage::defScrCP=437;
+int TVCodePage::defInpCP=437;
+// User provided function to call each time we change the code page.
+// This is called before sending a broadcast.
+void (*TVCodePage::UserHook)(ushort *map)=NULL;
+// Table used to find something that can represent an absent code.
+// This is for CP 437 use
+uchar TVCodePage::Similar[]=
+{
+ ' ', '@', '@', '*', '*', '*', '*', '*', // 0- 7
+ 0x04, 'o',0xDB, 'M', 'F', 'd', 'd', '*', // 8- 15
+ 0x1A,0x1B, 'I',0xBA, 'P', 'S',0xDC,0x12, // 16- 23
+ '^', 'V', '>', '<',0xC0, '-',0x18,0x19, // 24- 31
+ ' ', '!', '"', '#', '$', '%', '&','\'', // 32- 39
+ '(', ')', '*', '+', ',', '-', '.', '/', // 40- 47
+ '0', '1', '2', '3', '4', '5', '6', '7', // 48- 55
+ '8', '9', ':', ';', '<', '=', '>', '?', // 56- 63
+ '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', // 64- 71
+ 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', // 72- 79
+ 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', // 80- 87
+ 'X', 'Y', 'Z', '[','\\', ']', '^', '_', // 88- 95
+ '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', // 96-103
+ 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', // 104-111
+ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', // 112-119
+ 'x', 'y', 'z', '{', '|', '}', '~', '^', // 120-127
+ 'C', 'u', 'e', 'a', 'a', 'a', 'a', 'c', // 128-135
+ 'e', 'e', 'e', 'i', 'i', 'i', 'A', 'A', // 136-143
+ 'E', 'a', 'A', 'o', 'o', 'o', 'u', 'u', // 144-151
+ 'y', 'O', 'U', 'c', 'L', 'Y', 'P', 'f', // 152-159
+ 'a', 'i', 'o', 'u', 'n', 'N', 'a', 'o', // 160-167
+ '?',0xDA,0xBF, '*', '*', '!', '<', '>', // 168-175
+ ' ', ' ', ' ', '|',0xB3,0xB3,0xBA,0xBF, // 176-183
+ 0xBF,0xBA,0xB3,0xBF,0xD9,0xD9,0xD9, '*', // 184-191
+ '*',0xC4,0xC4,0xB3, '-', '+',0xB3,0xBA, // 192-199
+ 0xC0,0xDA,0xCD,0xCD,0xBA,0xC4,0xBA,0xCD, // 200-207
+ 0xC4,0xCD,0xC4,0xC0,0xC0,0xDA,0xDA,0xC5, // 208-215
+ 0xC5, '*', '*', ' ', ' ', ' ', ' ', ' ', // 216-223
+ 'a', 'B', 'G', 'p', 'S', 's', 'm', 't', // 224-231
+ 'F', 'f', 'O', 'd', 'i', 'o', 'e', 'U', // 232-239
+ '=', '+', '>', '<',0xDA,0xD9, '/', '~', // 240-247
+ 'o', '.', '.', 'V', 'n', '2', '*', ' ', // 248-255
+};
+// This table is used to reduce any of our codes into a similar one when absent.
+// It covers all the known symbols not covered by Similar and if the value doesn't
+// exist in the current code page you must enter in the table again until you get
+// an ASCII value.
+ushort TVCodePage::Similar2[]=
+{
+ 'c','l','n','r','s','y','z', // 0x100-0x106 small acute
+ 'A','C','I','L','N','O','R','S','U','Y','Z', // 0x107-0x111 capital acute
+ 'U', // 0x112 double acute
+ 'A','E','I','O','U', // 0x113-0x117 capital grave
+ 'E','I', // 0x118-0x119 capital diaeresis
+ 'U','u', // 0x11A-0x11B ring above
+ 'a','o','u','A','O', // 0x11C-0x120 tilde/double acute
+ 'A','E','I','O','U', // 0x121-0x125 capital circumflex
+ 'c','n','r','s','z','C','D','E','N','R','S','T','Z', // 0x126-0x132 caron
+ 's','t','S','T', // 0x133-0x136 cedilla
+ 'a','e','A','E', // 0x137-0x13A ogonek
+ 'z','Z', // 0x13B-013C dot above
+ 'l','o','L','O','d', // 0x13D-0x141 stroke
+ 0x141, // 0x142 latin small letter eth
+ 'D', // 0x143 stroke
+ 'd','l','t','L', // 0x144-0x147 caron
+ 'a','e','A', // 0x14-0x14A breve
+ '$', // 0x14B currency sign (o four feets), I guess that's a good fall back
+ // specially thinking all people understand $ as money
+ 'P','p', // 0x14C-0x14D thorn (Icelandic) sorry I know that's arbitrary and
+ // silly. Anyone have a better choice?
+ '*', // 14E multiplication sign
+ 'R', // 14F registered sign (R)
+ 'c', // 150 copyright sign (c)
+ 'i', // 151 latin small letter dotless i
+ '|', // 152 broken bar (|)
+ '_', // 153 macron (_ but high)
+ '\'',// 154 acute accent
+ '-', // 155 soft hyphen (- long)
+ '_', // 156 double low line (_ double)
+ '3', // 157 vulgar fraction three quarters
+ ',', // 158 cedilla
+ '"', // 159 diaeresis (di‚resis, umlaut)
+ '1', // 15a superscript one
+ '3', // 15b superscript three
+ '"', // 15c double acute accent
+ ';', // 15d ogonek (cedilla inv.)
+ '<', // 15e caron (mandarin chinese third tone)
+ '(', // 15f breve
+ '.', // 160 dot above (mandarin chinese light tone)
+ 'o','O', // 0x161-0x162 double acute
+ 0x145,0x147,0x146,'e',0x144, // 0x163-0x167 caron, fall back to the other representation
+ // 0x168
+ 'A','B','G','D','Z','I','J','L','P','U','F','C','C','S','S','"','Y','"',
+ 'E','U','A', // 0x168-0x17C Cyrillic capitals group 1
+ 'b','v','g','d','z','z','i','j','k','l','m','n','p','t','u','f','c','c',
+ 's','s','\'','y','\'','e','u','a', // 0x17D-0x196 Cyrillic smalls group 1
+ 'I','i', // 0x197-0x198 ukrainian ie
+ 'Z', // 0x199 capital letter ze
+ ' ', // 0x19A free slot
+ 'N', // 0x19B number
+ // ISO-5 cyrillics:
+ 'D', // 19C capital letter dje (Serbocroatian) (¢)-5
+ 'd', // 19D small letter dje (Serbocroatian) (ò)-5
+ 'G', // 19E capital letter gje (£)-5
+ 'g', // 19F small letter gje (ó)-5
+ 'Y', // 1A0 capital letter yi (Ukrainian) (¦)-5
+ 'L', // 1A1 capital letter lje (©)-5
+ 'l', // 1A2 small letter lje (ù)-5
+ 'N', // 1A3 capital letter nje (ª)-5
+ 'n', // 1A4 small letter nje (ú)-5
+ 'T', // 1A5 capital letter tshe (Serbocroatian) («)-5
+ 't', // 1A6 small letter tshe (Serbocroatian) (û)-5
+ 'K', // 1A7 capital letter kje (¬)-5
+ 'k', // 1A8 small letter kje (ü)-5
+ 'V', // 1A9 capital letter short U (Byelorussian) (®)-5
+ 'v', // 1AA small letter short U (Byelorussian) (þ)-5
+ 'D', // 1AB capital letter dzhe (¯)-5
+ 'd', // 1AC small letter dzhe (ÿ)-5
+ // Windows CP 1251 (russian)
+ '"', // 1AD double low-9 quotation mark („)-cp1251
+ '.', // 1AE horizontal ellipsis (…)-cp1251
+ '|', // 1AF dagger (†)-cp1251
+ '|', // 1B0 double dagger (‡)-cp1251
+ '%', // 1B1 per mille sign (‰)-cp1251
+ '"', // 1B2 left double quotation mark (“)-cp1251
+ '"', // 1B3 right double quotation mark (”)-cp1251
+ 'T', // 1B4 trade mark sign (™)-cp1251
+ 0x16A, // 1B5 cyrillic capital letter ghe with upturn, default to GHE (¥)-cp1251
+ 0x17F, // 1B6 cyrillic small letter ghe with upturn, default to ghe (´)-cp1251
+ '?', // 1B7 That's a ? inside a circle, it means the character is unknown
+ 'O', // 1B8 latin capital ligature OE
+ 'o', // 1B9 latin small ligature oe
+ // Idiot ISO-1 font found in Linux, only to break standards and annoy people
+ 't', // 1BA symbol for horizontal tabulation
+ 'f', // 1BB symbol for form feed
+ 'c', // 1BC symbol for carriage return
+ 'l', // 1BD symbol for line feed
+ 'n', // 1BE symbol for newline
+ 'v', // 1BF symbol for vertical tabulation
+ '#', // 1C0 not equal to
+ 'v', // 1C1 downwards arrow with corner leftwards
+ 'Y', // 1C2 latin capital letter y with diaeresis
+ ' ', // 1C3 free
+ 0xB3,// 1C4 box drawings light up ()-1 linux
+ 0xC4,// 1C5 box drawings light right (‚)-1 linux
+ 0xB3,// 1C6 box drawings light down („)-1 linux
+ 0xC4,// 1C7 box drawings light left (ˆ)-1 linux
+ ' ', // 1C8 free
+ 0xBA,// 1C9 box drawings heavy up (‘)-1 linux
+ 0xCD,// 1CA box drawings heavy right (’)-1 linux
+ 0xBA,// 1CB box drawings heavy down (”)-1 linux
+ 0xCD,// 1CC box drawings heavy left (˜)-1 linux
+ 0x1A8,//1CD latin small letter kra
+ 'N','n', // Latin letter eng
+ // Circumflex 1D0-1DD
+ 'C','c','G','g','H','h','J','j','S','s','W','w','Y','y',
+ // Dot above 1DE-1EF
+ 'B','b','C','c','D','d','F','f','g','I','M','m','P','p','S','s','T','t',
+ // Macron 1F0-1F7
+ 'E','e','I','i','O','o','U','u',
+ // Breve 1F8-1FD
+ 'G','g','I','i','U','u',
+ // Cedilla 1FE-205
+ 'G','g','K','k','N','n','R','r',
+ // Tilde 206-209
+ 'I','i','U','u',
+ // Ogonek 20A-20F
+ 'I','i','U','u','W','w',
+ 'Y',// 210 0x1EF2 LATIN CAPITAL LETTER Y WITH GRAVE
+ 'y',// 211 0x1EF3 LATIN SMALL LETTER Y WITH GRAVE
+ 'W',// 212 0x1E82 LATIN CAPITAL LETTER W WITH ACUTE
+ 'w',// 213 0x1E83 LATIN SMALL LETTER W WITH ACUTE
+ 'W',// 214 0x1E84 LATIN CAPITAL LETTER W WITH DIAERESIS
+ 'w',// 215 0x1E85 LATIN SMALL LETTER W WITH DIAERESIS
+ 'H',// 216 0x0126 LATIN CAPITAL LETTER H WITH STROKE
+ 'h',// 217 0x0127 LATIN SMALL LETTER H WITH STROKE
+ 'T',// 218 0x0166 LATIN CAPITAL LETTER T WITH STROKE
+ 't',// 219 0x0167 LATIN SMALL LETTER T WITH STROKE
+ 'O',// 21A 0x01A0 LATIN CAPITAL LETTER O WITH HORN
+ 'o',// 21B 0x01A1 LATIN SMALL LETTER O WITH HORN
+ 'U',// 21C 0x01AF LATIN CAPITAL LETTER U WITH HORN
+ 'u',// 21D 0x01B0 LATIN SMALL LETTER U WITH HORN
+ 'E',// 21E 0x0116 LATIN CAPITAL LETTER E WITH DOT ABOVE
+ 'e',// 21F 0x0117 LATIN SMALL LETTER E WITH DOT ABOVE
+ 'L',// 220 0x013B LATIN CAPITAL LETTER L WITH CEDILLA
+ 'l',// 221 0x013C LATIN SMALL LETTER L WITH CEDILLA
+ // Greek smalls 222-22F
+ 'g','z','h','u','i','l','n','j','r','s','y','x','c','v',
+ // Greek capitals 230-233
+ 'D','J','P','C',
+ // Greek accented
+ 0x159,// 234 0x0385 GREEK DIALYTIKA TONOS => diaeresis
+ 0xE0, // 235 0x03AC GREEK SMALL LETTER ALPHA WITH TONOS => alpha
+ 0xEE, // 236 0x03AD GREEK SMALL LETTER EPSILON WITH TONOS => epsilon
+ 0x224,// 237 0x03AE GREEK SMALL LETTER ETA WITH TONOS => eta
+ 0x226,// 238 0x03AF GREEK SMALL LETTER IOTA WITH TONOS => iota
+ 'o', // 239 0x03CC GREEK SMALL LETTER OMICRON WITH TONOS => omicron
+ 0x22C,// 23A 0x03CD GREEK SMALL LETTER UPSILON WITH TONOS => upsilon
+ 0x22F,// 23B 0x03CE GREEK SMALL LETTER OMEGA WITH TONOS => omega
+ 'A', // 23C 0x0386 GREEK CAPITAL LETTER ALPHA WITH TONOS
+ 'E', // 23D 0x0388 GREEK CAPITAL LETTER EPSILON WITH TONOS
+ 'H', // 23E 0x0389 GREEK CAPITAL LETTER ETA WITH TONOS
+ 'I', // 23F 0x038A GREEK CAPITAL LETTER IOTA WITH TONOS
+ 'O', // 240 0x038C GREEK CAPITAL LETTER OMICRON WITH TONOS
+ 'Y', // 241 0x038E GREEK CAPITAL LETTER UPSILON WITH TONOS
+ 0xEA, // 242 0x038F GREEK CAPITAL LETTER OMEGA WITH TONOS => omega
+ 0x226,// 243 0x03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA => iota
+ 0x22C,// 244 0x03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA => upsilon
+ 0x238,// 245 0x0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS => iota + tonos
+ 0x23A,// 246 0x03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS => upsilon + tonos
+ 'L', // 247 <U039B> GREEK CAPITAL LETTER LAMDA
+ 'a','A', // 248/9 <U0101/0> LATIN LETTER A WITH MACRON
+ 'G', // 24A <U0120> LATIN CAPITAL LETTER G WITH DOT ABOVE
+ 'E', // 24B <U20AC> Euro Sign
+ // Cyrillics that are identical to latin letters
+ 'B','E','K','M','H','O','P','C','T','X','a','e','o','p','c','x',
+ 137,280,'s','i',139,'j',281,'J','S',
+ // Greeks that are identical to latin letters
+ 0xE1,0x185,0xE6,'o','A','B','E','Z','H','I','K','M','N','O','P','T','Y','X',
+ 0x119,0x1C2,
+};
+
+
+// We use an internal code. This is currently a 16 bits code.
+// The ammount of defined symbols: [0 ... maxSymbolDefined-1]
+const unsigned maxSymbolDefined=632+1;
+
+// Helper to sort Unicode tables or search in sorted Unicode tables
+static
+int compare(const void *v1, const void *v2)
+{
+ stIntCodePairs *p1=(stIntCodePairs *)v1;
+ stIntCodePairs *p2=(stIntCodePairs *)v2;
+ return (p1->unicode>p2->unicode)-(p1->unicode<p2->unicode);
+}
+
+// This is what usually call: TNoCaseNoOwnerStringCollection, but isn't
+// available in TV, yet
+class TVCodePageCol : public TStringCollection
+{
+public:
+ TVCodePageCol(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta) {};
+ int compare(void *s1,void *s2) { return strcasecmp((char *)s1,(char *)s2); };
+ void freeItem(void *) {};
+};
+
+/*****************************************************************************
+ Defined code pages sorted by ID:
+
+Name ID
+PC 437 ASCII ext. 437
+PC 737 Greek 737
+PC 775 DOS Baltic Rim 775
+PC 850 Latin 1 850
+PC 852 Latin 2 852
+PC 855 Russian 2 855
+PC 857 Turkish 857
+PC 860 Portuguese 860
+PC 861 Icelandic 861
+PC 863 French 863
+PC 865 Nordic 865
+PC 866 Russian 866
+PC 869 Greek 2 869
+CP 1250 Win Latin 2 1250
+CP 1251 Win Russian 1251
+CP 1252 Win Latin 1 1252
+CP 1253 Win Greek 1253
+CP 1254 Win Turkish 1254
+CP 1257 Win Baltic 1257
+Mac Cyr. CP 10007 10007
+ISO 8859-1 Latin 1 88791
+ISO 8859-2 Latin 2 88792
+ISO 8859-3 Latin 3 88593
+ISO 8859-4 Latin 4 88594
+ISO 8859-5 Russian 88595
+ISO 8859-7 Greek 88597
+ISO 8859-9 88599
+ISO Latin 1 (Linux) 885901
+ISO Latin 1u(Linux) 885911
+ISO 8859-14 885914
+ISO 8859-15 Icelan. 885915
+ISO Latin 2 (Linux) 885920
+ISO Latin 2u(Linux) 885921
+ISO Latin 2 (Sun) 885922
+ISO Latin 2+Euro (Linux) 885923
+KOI-8r (Russian) 100000
+KOI-8 with CRL/NMSU 100001
+Mac OS Ukrainian 100072
+Osnovnoj Variant Russian 885951
+Alternativnyj Variant RU 885952
+U-code Russian 885953
+Mazovia (polish) 1000000
+ISO 5427 ISO-IR-37 KOI-7 3604494
+ECMA-Cyr.ISO-IR-111 17891342
+JUS_I.B1.003-SERB ISOIR146 21364750
+JUS_I.B1.003-MAC ISO-IR-147 21430286
+Cyrillic ISO-IR-153 22216718
+
+*****************************************************************************/
+
+// PC437 doesn't need traslation, they are the first 256 chars.
+CodePage TVCodePage::stPC437=
+{ "PC 437 ASCII ext.",
+ 437,
+ { 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
+ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 },
+ "‚†„Ž‡€š‘’”™¤¥",
+ "ƒ…ˆ‰Š‹Œ“•–—˜ ¡¢£á",0,0
+};
+
+CodePage TVCodePage::stPC737=
+{ "PC 737 Greek",
+ 737,
+ { 617,618,226,560,619,620,621,233,622,623,583,624,625,561,626,562,
+ 627,228,628,629,232,630,563,234,224,613,546,235,238,547,548,549,
+ 550,614,551,615,552,553,616,227,554,229,555,231,556,237,557,558,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 559,565,566,567,579,568,569,570,580,571,572,573,574,575,576,577,
+ 578,241,342,343,631,632,246,344,248,345,250,346,347,253,254,255 },
+ "˜€™¯–›ƒœ„­”š‚ž† ˆ¥¡‰¢Š£‹¤Œ¦Ž§¨©‘«’à—ª‘®•¬“…áêâëãìåíæîéðçïäôèõ",
+ "Ÿ",0,0
+};
+
+CodePage TVCodePage::stPC775=
+{ "PC 775 DOS Baltic Rim",
+ 775,
+ { 264,129,130,584,132,511,134,256,317,497,516,517,499,273,142,143,
+ 144,145,146,501,148,510,155,270,260,153,154,318,156,320,334,331,
+ 585,498,162,316,315,262,435,338,336,335,170,171,172,319,174,175,
+ 176,177,178,179,180,313,299,314,542,185,186,187,188,522,304,191,
+ 192,193,194,195,196,197,524,502,200,201,202,203,204,205,206,306,
+ 311,294,312,543,523,297,525,503,298,217,218,219,220,221,222,223,
+ 268,225,500,267,285,288,230,258,512,513,544,545,515,496,514, 39,
+ 341,241,434,343, 20, 21,246,429,248,249,250,346,347,253,254,255
+ },
+ "‡€‹Šš‚ƒ „Ž…•†ˆ­‰íŒ¡¥‘’“â”™˜—›¢à¤£ÐµÑ¶Ò·Ó¸Ô½Õ¾ÖÆ×ÇØÏçãäåéèëêìî",
+ "áæ",0,0
+};
+
+CodePage TVCodePage::stPC850=
+{ "PC 850 Latin 1",
+ 850,
+ { 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,318,156,320,334,159,
+ 160,161,162,163,164,165,166,167,168,335,170,171,172,173,174,175,
+ 176,177,178,179,180,263,289,275,336,185,186,187,188,155,157,191,
+ 192,193,194,195,196,197,284,287,200,201,202,203,204,205,206,331,
+ 321,323,290,280,276,337,265,291,281,217,218,219,220,338,277,223,
+ 268,225,292,278,285,288,230,332,333,271,293,279,261,272,339,340,
+ 341,241,342,343, 20, 21,246,344,248,345,250,346,347,253,254,255 },
+ "‡€š‚ƒ¶„Ž…·†ˆÒ‰ÓŠÔ‹ØŒ×Þ‘’“â”™•ã–ê—ë› µ¡Ö¢à£é¤¥ÆÇÐÑäåçèìí",
+ "˜ÏÕáæ",0,0
+};
+
+CodePage TVCodePage::stPC852=
+{ "PC 852 Latin 2",
+ 852,
+ { 128,129,130,131,132,282,256,135,317,137,354,353,140,273,142,264,
+ 144,266,257,147,148,327,325,270,260,153,154,305,326,319,334,294,
+ 160,161,162,163,313,311,306,298,314,312, 0,262,299,307,174,175,
+ 176,177,178,179,180,263,289,301,309,185,186,187,188,316,315,191,
+ 192,193,194,195,196,197,330,328,200,201,202,203,204,205,206,331,
+ 321,323,300,280,324,302,265,291,358,217,218,219,220,310,283,223,
+ 268,225,292,267,258,295,304,297,269,271,259,274,261,272,308,340,
+ 341,348,349,350,351, 21,246,344,248,345,352,286,303,296,254,255 },
+ "‡€š‚ƒ¶„Ž…Þ†ˆ‰Ó‹ŠŒ×«’‘“â”™–•˜—Ÿ¬ µ¡Ö¢à£é¥¤§¦©¨­¸Ø·¾½ÇÆÐÑåÕîÝäãçæêèûëìíýü",
+ "›œÏÒÔá",0,0
+};
+
+// PC855 Russian DOS code page
+CodePage TVCodePage::stPC855=
+{ "PC 855 Russian 2",
+ 855,
+ { 413,412,415,414,604,605,408,407,606,612,607,610,608,416,609,611,
+ 418,417,420,419,422,421,424,423,426,425,428,427,405,379,401,375,
+ 598,360,381,361,397,371,384,363,599,589,396,370,383,362,174,175,
+ 176,177,178,179,180,603,597,387,365,185,186,187,188,388,366,191,
+ 192,193,194,195,196,197,389,590,200,201,202,203,204,205,206,331,
+ 390,367,391,591,392,592,600,593,393,217,218,219,220,368,406,223,
+ 380,601,594,602,595,394,596,395,369,385,364,382,588,403,377,411,
+ 341,402,376,386,409,399,373,404,378,400,374,398,372, 21,254,255 },
+ "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­µ¶·¸½¾ÆÇÐÑÒÓÔÕÖ×ØÝÞàáâãäåæçèéêëìíîñòóôõö÷øùúûü",
+ "",0,0
+};
+
+CodePage TVCodePage::stPC857=
+{ "PC 857 Turkish",
+ 857,
+ { 128,129,130,131,132,133,134,135,136,137,138,139,140,337,142,143,
+ 144,145,146,147,148,149,150,151,487,153,154,318,156,320,309,307,
+ 160,161,162,163,164,165,504,505,168,335,170,171,172,173,174,175,
+ 176,177,178,179,180,263,289,275,336,185,186,187,188,155,157,191,
+ 192,193,194,195,196,197,284,287,200,201,202,203,204,205,206,331,
+ 167,166,290,280,276,276,265,291,281,217,218,219,220,338,277,223,
+ 268,225,292,278,285,288,230,230,334,271,293,279,141,152,339,340,
+ 341,241,241,343, 20, 21,246,344,248,345,250,346,347,253,254,255 },
+ "‡€š‚ƒ¶„Ž…·†ˆÒ‰ÓŠÔ‹ØŒ×˜‘’“â”™•ã–ê—뛟ž µ¡Ö£é¤¥§¦ÆÇ¢àÞìäå",
+ "Õáæçí",0,0
+};
+
+CodePage TVCodePage::stPC860=
+{ "PC 860 Portuguese",
+ 860,
+ { 128,129,130,131,284,133,263,135,136,290,138,265,140,141,287,289,
+ 144,275,276,147,285,149,271,151,277,288,154,155,156,279,158,268,
+ 160,161,162,163,164,165,166,167,168,278,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 },
+ "‡€š‚ƒ„Ž…‘ †ˆ‰Š’¡‹“Œ˜”™•©£–—¢Ÿ¤¥",
+ "á",0,0
+};
+
+CodePage TVCodePage::stPC861=
+{ "PC 861 Icelandic",
+ 861,
+ { 128,129,130,131,132,133,134,135,136,137,138,323,322,333,142,143,
+ 144,145,146,147,148,332,150,272,261,153,154,318,156,320,158,159,
+ 160,161,162,163,263,265,268,271,168,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 },
+ "š‚„Ž†‡€Œ‹•‘’”™˜—› ¤¡¥¢¦£§",
+ "ƒ…ˆ‰Š“–àáâãåäæçèéêëíîŸ",0,0
+};
+
+CodePage TVCodePage::stPC863=
+{ "PC 863 French",
+ 863,
+ { 128,129,130,131,289,133, 20,135,136,137,138,139,140,342,275, 21,
+ 144,276,290,147,280,281,150,151,331,292,154,155,156,279,158,159,
+ 338,340,162,163,345,344,347,339,291,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 },
+ "‡€š‚ƒ„…Žˆ’‰”Š‘‹•Œ¨“™–ž—",
+ "˜¢£á",0,0
+};
+
+CodePage TVCodePage::stPC865=
+{ "PC 865 Nordic",
+ 865,
+ { 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,318,156,320,158,159,
+ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,331,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 },
+ "‡€š›‚„Ž†‘’¤¥”™",
+ "ƒ…ˆ‰Š‹Œ“•–—˜ ¡¢£¯á",0,0
+};
+
+CodePage TVCodePage::stPC869=
+{ "PC 869 Greek 2",
+ 869,
+ { 0x20,0x20,0x20,0x20,0x20,0x20,572,572,250,170,338, 96, 39,573,341,574,
+ 575,631,576,576,576,577,632,336,578,253,347,565,156,566,567,568,
+ 579,581,569,570,617,618,226,560,619,620,621,171,233,622,174,175,
+ 176,177,178,179,180,623,583,624,625,185,186,187,188,561,626,191,
+ 192,193,194,195,196,197,562,627,200,201,202,203,204,205,206,228,
+ 628,629,232,630,563,234,224,613,546,217,218,219,220,235,238,223,
+ 547,548,549,550,614,551,615,552,553,616,227,554,229,555,231,340,
+ 341,241,556,237,557, 21,558,564,248,345,559,580,582,571,254,255 },
+ "›†žŸ ‘¢’£•û–ý˜Ö¤×¥Ø¦Ý§Þ¨à©áªâ¬ã­äµå¶æ·ç¸è½é¾êÆëÇìÏíÏîÐòÑóÒôÓöÔúÕ",
+ "¡ü",0,0
+};
+
+CodePage TVCodePage::ISO8879_1=
+{ "ISO 8859-1 Latin 1",
+ 88791,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 32,173,155,156, 36,157,338, 21,345,336,166,174,170,341,335,341,
+ 248,241,253,347,340,230, 20,249,344,346,167,175,172,171,343,168,
+ 275,263,289,287,142,143,146,128,276,144,290,280,277,265,291,281,
+ 323,165,278,268,292,288,153,334,320,279,271,293,154,272,333,225,
+ 133,160,131,284,132,134,145,135,138,130,136,137,141,161,140,139,
+ 321,164,149,162,147,285,148,246,318,151,163,150,129,261,332,152 },
+ "àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "µßÿ",0,0
+};
+
+ushort TVCodePage::LowCrazyCharsRemaped[] =
+{ 439,247,440,441, 4,442,443,444,445,176,177,178,219,220,223,221,
+ 222,446,447,242,243,448, 17, 16, 24, 25, 26, 27, 18, 29,449/*447*/,227, // 449 in lat1.sfm
+ 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,123,124,125,126,450 };
+
+
+CodePage TVCodePage::ISO8859_1_Lat1=
+{ "ISO Latin 1 (Linux)",
+ 885901,
+ { 451,452,453,192,454,179,218,195,455,217,196,193,191,180,194,197,
+ 456,457,458,200,459,186,201,204,460,188,205,202,187,185,203,206,
+ 255,173,155,156, 36,157,338, 21,345,336,166,174,170,341,335,341,
+ 248,241,253,347,340,230, 20,249,344,346,167,175,172,171,343,168,
+ 275,263,289,287,142,143,146,128,276,144,290,280,277,265,291,281,
+ 323,165,278,268,292,288,153,334,320,279,271,293,154,272,333,225,
+ 133,160,131,284,132,134,145,135,138,130,136,137,141,161,140,139,
+ 321,164,149,162,147,285,148,246,318,151,163,150,129,261,332,152 },
+ "àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜÿýÝþÞ",
+ "µß",
+ 128,LowCrazyCharsRemaped
+};
+
+CodePage TVCodePage::ISO8859_1u_Lat1=
+{ "ISO Latin 1u(Linux)",
+ 885911,
+ { 275,263,289,287,142,143,146,128,276,144,290,280,277,265,291,281,
+ 323,165,278,268,292,288,153,334,320,279,271,293,154,272,333,225,
+ 32,173,155,156, 36,157,338, 21,345,336,166,174,170,341,335,341,
+ 248,241,253,347,340,230, 20,249,344,346,167,175,172,171,343,168,
+ 451,452,453,192,454,179,218,195,455,217,196,193,191,180,194,197,
+ 456,457,458,200,459,186,201,204,460,188,205,202,187,185,203,206,
+ 133,160,131,284,132,134,145,135,138,130,136,137,141,161,140,139,
+ 321,164,149,162,147,285,148,246,318,151,163,150,129,261,332,152 },
+ "à€áâ‚ãƒä„å…æ†ç‡èˆé‰êŠë‹ìŒíîŽïðñ‘ò’ó“ô”õ•ö–ø˜ù™úšû›üœÿýþž",
+ "µŸ",
+ 128,LowCrazyCharsRemaped
+};
+
+CodePage TVCodePage::ISO8879_2=
+{ "ISO 8859-2 Latin 2",
+ 88792,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 255,313,351,319,331,356,270, 21,345,304,309,305,273,341,306,316,
+ 248,311,349,317,340,325,260,350,344,297,307,326,262,348,298,315,
+ 269,263,289,330,142,266,264,128,299,144,314,280,301,265,291,300,
+ 323,267,302,268,292,354,153,334,303,282,271,274,154,272,310,225,
+ 259,160,131,328,132,257,256,135,294,130,312,137,358,161,140,324,
+ 321,258,295,162,147,353,148,246,296,283,163,286,129,261,308,352 },
+ "±¡³£µ¥¶¦¹©ºª»«¼¬¾®¿¯àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "",0,0
+};
+
+CodePage TVCodePage::ISO8859_2_Lat2=
+{ "ISO Latin 2 (Linux)",
+ 885920,
+ {451,452,453,192,454,179,218,195,455,217,196,193,191,180,194,197,
+ 456,457,458,200,459,186,201,204,460,188,205,202,187,185,203,206,
+ 255,313,351,319,331,356,270, 21,345,304,309,305,273,341,306,316,
+ 248,311,349,317,340,325,260,350,344,297,307,326,262,348,298,315,
+ 269,263,289,330,142,266,264,128,299,144,314,280,301,265,291,300,
+ 323,267,302,268,292,354,153,334,303,282,271,274,154,272,310,225,
+ 259,160,131,328,132,257,256,135,294,130,312,137,358,161,140,324,
+ 321,258,295,162,147,353,148,246,296,283,163,286,129,261,308,352 },
+ "±¡³£µ¥¶¦¹©ºª»«¼¬¾®¿¯àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "",0,0
+};
+
+CodePage TVCodePage::ISO8859_2u_Lat2=
+{ "ISO Latin 2u(Linux)",
+ 885921,
+ {269,263,289,330,142,266,264,128,299,144,314,280,301,265,291,300,
+ 323,267,302,268,292,354,153,334,303,282,271,274,154,272,310,225,
+ 255,313,351,319,331,356,270, 21,345,304,309,305,273,341,306,316,
+ 248,311,349,317,340,325,260,350,344,297,307,326,262,348,298,315,
+ 451,452,453,192,454,179,218,195,455,217,196,193,191,180,194,197,
+ 456,457,458,200,459,186,201,204,460,188,205,202,187,185,203,206,
+ 259,160,131,328,132,257,256,135,294,130,312,137,358,161,140,324,
+ 321,258,295,162,147,353,148,246,296,283,163,286,129,261,308,352 },
+ "±¡³£µ¥¶¦¹©ºª»«¼¬¾®¿¯à€áâ‚ãƒä„å…æ†ç‡èˆé‰êŠë‹ìŒíîŽïðñ‘ò’ó“ô”õ•ö–ø˜ù™úšû›üœýþž",
+ "",0,0
+};
+
+// This code page have the Euro
+CodePage TVCodePage::ISO8859_2_Sun=
+{ "ISO Latin 2 (Sun)",
+ 885922,
+ {255,313,351,319,331,356,270, 21,345,304,309,305,273,341,306,316,
+ 248,311,349,317,340,325,260,350,344,297,307,326,262,348,298,315,
+ 269,263,289,330,142,266,264,128,299,144,314,280,301,265,291,300,
+ 176,177,178,179,180,323,267,302,268,185,186,187,188,292,354,191,
+ 192,193,194,195,196,197,153,334,200,201,202,203,204,205,206,303,
+ 282,271,274,154,272,310,225,587,216,217,218,219,220,221,222,223,
+ 259,160,131,328,132,257,256,135,294,130,312,137,358,161,140,324,
+ 321,258,295,162,147,353,148,246,296,283,163,286,129,261,308,352 },
+ "‘“ƒ•…–†–‰šŠ›‹œŒžŽŸà á¡â¢ã£ä¤å¥æ¦ç§è¨é©êªë«ì¬í­î®ï¯ðµñ¶ó¸ô½õ¾öÆøÏùÐúÑûÒüÓýÔþÕ",
+ "Ö",0,0
+};
+
+CodePage TVCodePage::ISO8859_2e_Lat2=
+{ "ISO Latin 2+Euro (Linux)",
+ 885923,
+ {451,452,453,192,454,179,218,195,455,217,196,193,191,180,194,197,
+ 456,457,458,200,459,186,201,204,460,188,205,202,187,185,203,206,
+ 255,313,351,319,587,356,270, 21,345,304,309,305,273,341,306,316,
+ 248,311,349,317,340,325,260,350,344,297,307,326,262,348,298,315,
+ 269,263,289,330,142,266,264,128,299,144,314,280,301,265,291,300,
+ 323,267,302,268,292,354,153,334,303,282,271,274,154,272,310,225,
+ 259,160,131,328,132,257,256,135,294,130,312,137,358,161,140,324,
+ 321,258,295,162,147,353,148,246,296,283,163,286,129,261,308,352 },
+ "±¡³£µ¥¶¦¹©ºª»«¼¬¾®¿¯àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "",0,0
+};
+
+CodePage TVCodePage::ISO8859_3=
+{ "ISO 8859-3 Latin 3",
+ 88593,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 255,534,351,156,331,0x20,468, 21,345,487,309,504,470,341,0x20,316,
+ 248,535,253,347,340,230,469,250,344,337,307,505,471,171,0x20,315,
+ 275,263,289,0x20,142,480,464,128,276,144,290,280,277,265,291,281,
+ 0x20,165,278,268,292,586,153,334,466,279,271,293,154,508,472,225,
+ 133,160,131,0x20,132,481,465,135,138,130,136,137,141,161,140,139,
+ 0x20,164,149,162,147,486,148,246,467,151,163,150,129,509,473,352
+ },
+ "±¡¶¦¹©ºª»«¼¬¿¯àÀáÁâÂäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "ßµ",0,0
+};
+
+CodePage TVCodePage::ISO8859_4=
+{ "ISO 8859-4 Latin 4",
+ 88594,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 255,313,461,516,331,518,544, 21,345,304,496,510,536,341,306,339,
+ 248,311,349,517,340,519,545,350,344,297,497,511,537,462,298,463,
+ 585,263,289,287,142,143,146,522,299,144,314,280,542,265,291,498,
+ 323,514,500,512,292,288,153,334,320,524,271,293,154,520,502,225,
+ 584,160,131,284,132,134,145,523,294,130,312,137,543,161,140,499,
+ 321,515,501,513,147,285,148,246,318,525,163,150,129,521,503,352
+ },
+ "±¡³£µ¥¶¦¹©ºª»«¼¬¾®¿½àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "ߢ",0,0
+};
+
+// PC866 Russian DOS code page
+CodePage TVCodePage::stPC866=
+{ "PC 866 Russian",
+ 866,
+ { 360,361,588,362,363,589,364,409,365,366,590,367,591,592,593,368,
+ 594,595,596,369,370,597,371,372,373,374,375,376,377,378,379,380,
+ 598,381,382,383,384,599,385,386,387,388,389,390,391,392,600,393,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 601,602,394,395,396,603,397,398,399,400,401,402,403,404,405,406,
+ 605,604,407,408,610,608,409,410,248,249,250,251,411,331,254,255 },
+ " €¡¢‚£ƒ¤„¥…¦†§‡¨ˆ©‰ªŠ«‹¬Œ­®Ž¯àá‘â’ã“ä”å•æ–ç—è˜é™êšë›ìœíîžïŸñðóòõô÷ö",
+ "",0,0
+};
+
+// ISO 8859-5 Russian ISO layout
+CodePage TVCodePage::ISO8859_5=
+{ "ISO 8859-5 Russian",
+ 88595,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 32,605,412,414,407,612,416,610,611,417,419,421,423,341,425,427,
+ 360,361,588,362,363,589,364,409,365,366,590,367,591,592,593,368,
+ 594,595,596,369,370,597,371,372,373,374,375,376,377,378,379,380,
+ 598,381,382,383,384,599,385,386,387,388,389,390,391,392,600,393,
+ 601,602,394,395,396,603,397,398,399,400,401,402,403,404,405,406,
+ 411,604,413,415,408,606,607,608,609,418,420,422,424, 21,426,428 },
+ "ñ¡ò¢ó£ô¤õ¥ö¦÷§ø¨ù©úªû«ü¬þ®ÿ¯Ð°Ñ±Ò²Ó³Ô´ÕµÖ¶×·Ø¸Ù¹ÚºÛ»Ü¼Ý½Þ¾ß¿àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏ",
+ "",0,0
+};
+
+// KOD OBMENA INFORMATSIEY - 8bit RUSSKIY
+// ëïä ïâíåîá éîæïòíáôóéåù I think that's close to the original ;-)
+CodePage TVCodePage::KOI_8r=
+{ "KOI-8r (Russian)",
+ 100000,
+ { 196,179,218,191,192,217,195,180,194,193,197,223,220,219,221,222,
+ 176,177,178,244,254,249,251,247,243,242,255,245,248,253,250,246,
+ 205,186,213,604,214,201,184,183,187,212,211,200,190,189,188,198,
+ 199,204,181,605,182,185,209,210,203,207,208,202,216,215,206,336,
+ 405,598,381,397,384,599,396,383,603,387,388,389,390,391,392,600,
+ 393,406,601,602,394,395,385,382,403,402,386,399,404,400,398,401,
+ 379,360,361,371,363,589,370,362,597,365,366,590,367,591,592,593,
+ 368,380,594,595,596,369,364,588,377,376,409,373,378,374,372,375 },
+ "ÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖöØøÙùÚúÛûÜüÝýÞþßÿ£³",
+ "",0,0
+};
+
+// KOI8 with CRL/NMSU extensions for SerboCroat
+CodePage TVCodePage::KOI_8crl=
+{ "KOI-8 with CRL/NMSU",
+ 100001,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188, // grf
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254, // grf
+ 0x20,0x20,0x20,604,413,609,418,420,422,428,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,605,412,611,417,419,421,427,0x20,0x20,0x20,0x20,0x20,0x20,
+ 405,598,381,397,384,599,396,383,603,387,388,389,390,391,392,600,
+ 393,406,601,602,394,395,385,382,403,402,386,399,404,400,398,401,
+ 379,360,361,371,363,589,370,362,597,365,366,590,367,591,592,593,
+ 368,380,594,595,596,369,364,588,377,376,409,373,378,374,372,375 },
+ "£³¤´¥µ¦¶§·¨¸©¹ÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖö×÷ØøÙùÚúÛûÜüÝýÞþßÿ",
+ "",0,0
+};
+
+// ECMA-Cyrillic ISO-IR-111
+CodePage TVCodePage::ISO_IR_111=
+{ "ECMA-Cyr.ISO-IR-111",
+ 0x0111000E,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 255,413,415,604,408,606,607,608,609,418,420,422,424,341,426,428,
+ 411,412,414,605,407,612,610,416,611,417,419,421,423,331,425,427,
+ 405,598,381,397,384,599,396,383,603,387,388,389,390,391,392,600,
+ 393,406,601,602,394,395,385,382,403,402,386,399,404,400,398,401,
+ 379,360,361,371,363,589,370,362,597,365,366,590,367,591,592,593,
+ 368,380,594,595,596,369,364,588,377,376,409,373,378,374,372,375 },
+ "¡±¢²£³¤´¥µ¦¶§·¨¸©¹ªº«»¬¼®¾¯¿ÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖö×÷ØøÙùÚúÛûÜüÝýÞþßÿ",
+ "",0,0
+};
+
+// GOST_19768-74 ST_SEV_358-88 ISO-IR-153 /subset of ISO-8859-5/
+CodePage TVCodePage::ISO_IR_153=
+{ "Cyrillic ISO-IR-153",
+ 0x0153000E,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 255,605,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,341,0x20,0x20,
+ 360,361,588,362,363,589,364,409,365,366,590,367,591,592,593,368,
+ 594,595,596,369,370,597,371,372,373,374,375,376,377,378,379,380,
+ 598,381,382,383,384,599,385,386,387,388,389,390,391,392,600,393,
+ 601,602,394,395,396,603,397,398,399,400,401,402,403,404,405,406,
+ 0x20,604,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20 },
+ "ñ¡Ð°Ñ±Ò²Ó³Ô´ÕµÖ¶×·Ø¸Ù¹ÚºÛ»Ü¼Ý½Þ¾ß¿àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏ",
+ "",0,0
+};
+
+
+// Mac OS Cyrillic, cp10007
+CodePage TVCodePage::CP10007=
+{ "Mac Cyr. CP 10007",
+ 10007,
+ { 360,361,588,362,363,589,364,409,365,366,590,367,591,592,593,368,
+ 594,595,596,369,370,597,371,372,373,374,375,376,377,378,379,380,
+ 431,248,155,156, 21, 7, 20,610,335,336,436,412,413,448,414,415,
+ 236,241,243,242,607,230,235,611,407,408,416,608,417,418,419,420,
+ 609,612,170,251,159,247,560,174,175,430,255,421,422,423,424,606,
+ 45,341,434,435, 96, 39,246,429,425,426,427,428,411,605,604,406,
+ 598,381,382,383,384,599,385,386,387,388,389,390,391,392,600,393,
+ 601,602,394,395,396,603,397,398,399,400,401,402,403,404,405,331 },
+ "à€áâ‚ãƒä„å…æ†ç‡èˆé‰êŠë‹ìŒíîŽïðñ‘ò’ó“ô”õ•ö–÷—ø˜ù™úšû›üœýþžßŸ¬«¯®¹¸»º½¼¿¾ÌËÎÍÞÝÙØÛÚÀ·ÏÁ¶Æ",
+ "´µÄ",0,0
+};
+
+// Mac OS Ukrainian
+CodePage TVCodePage::CP100072=
+{ "Mac OS Ukrainian",
+ 100072,
+ { 360,361,588,362,363,589,364,409,365,366,590,367,591,592,593,368,
+ 594,595,596,369,370,597,371,372,373,374,375,376,377,378,379,380,
+ 431,248,437,156, 21, 7, 20,610,335,336,436,412,413,448,414,415,
+ 236,241,243,242,607,230,438,611,407,408,416,608,417,418,419,420,
+ 609,612,170,251,159,247,560,174,175,430,255,421,422,423,424,606,
+ 45,341,434,435, 96, 39,246,429,425,426,427,428,411,605,604,406,
+ 598,381,382,383,384,599,385,386,387,388,389,390,391,392,600,393,
+ 601,602,394,395,396,603,397,398,399,400,401,402,403,404,405,331 },
+ "à€áâ‚ãƒä„å…æ†ç‡èˆé‰êŠë‹ìŒíîŽïðñ‘ò’ó“ô”õ•ö–÷—ø˜ù™úšû›üœýþžßŸ¶¢¬«¯®À·¹¸»º½¼¿¾ÏÁÌËÎÍÙØÛÚÞÝ",
+ "§´µÄÆ",0,0
+};
+
+// Osnovnoj Variant Russian
+CodePage TVCodePage::OVR=
+{ "Osnovnoj Variant Russian",
+ 885951,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188, // grf
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254, // grf
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 360,361,588,362,363,589,364,409,365,366,590,367,591,592,593,368,
+ 594,595,596,369,370,597,371,372,373,374,375,376,377,378,379,380,
+ 598,381,382,383,384,599,385,386,387,388,389,390,391,392,600,393,
+ 601,602,394,395,396,603,397,398,399,400,401,402,403,404,405,406,
+ 605,604,340, 96,340, 96, 26, 27, 25, 24,246,241,411,331,0x20,0x20 },
+ "аѱҲӳԴյֶ׷ظٹںۻܼݽ޾߿àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏñð",
+ "",0,0
+};
+
+// Alternativnyj Variant Russian
+CodePage TVCodePage::AVR=
+{ "Alternativnyj Variant RU",
+ 885952,
+ { 360,361,588,362,363,589,364,409,365,366,590,367,591,592,593,368,
+ 594,595,596,369,370,597,371,372,373,374,375,376,377,378,379,380,
+ 598,381,382,383,384,599,385,386,387,388,389,390,391,392,600,393,
+ 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188, // grfs
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254, // grfs
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 601,602,394,395,396,603,397,398,399,400,401,402,403,404,405,406,
+ 605,604,340, 96,340, 96, 26, 27, 25, 24,246,241,411,331,0x20,0x20 },
+ " €¡¢‚£ƒ¤„¥…¦†§‡¨ˆ©‰ªŠ«‹¬Œ­®Ž¯àá‘â’ã“ä”å•æ–ç—è˜é™êšë›ìœíîžïŸñð",
+ "",0,0
+};
+
+// U-code Russian /subset of ISO-8859-5 and GOST_19768-74/
+CodePage TVCodePage::U_CodeR=
+{ "U-code Russian",
+ 885953,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188, // grf
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254, // grf
+ 255,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 360,361,588,362,363,589,364,409,365,366,590,367,591,592,593,368,
+ 594,595,596,369,370,597,371,372,373,374,375,376,377,378,379,380,
+ 598,381,382,383,384,599,385,386,387,388,389,390,391,392,600,393,
+ 601,602,394,395,396,603,397,398,399,400,401,402,403,404,405,406,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20 },
+ "аѱҲӳԴյֶ׷ظٹںۻܼݽ޾߿àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏ",
+ "",0,0
+};
+
+/***** 7 bits! ******/
+ushort TVCodePage::tbKOI7[]=
+{ 0, 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,331, 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,
+405,598,381,397,384,599,396,383,
+603,387,388,389,390,391,392,600,
+393,406,601,602,394,395,385,382,
+403,402,386,399,404,400,398,401,
+379,360,361,371,363,589,370,362,
+597,365,366,590,367,591,592,593,
+368,380,594,595,596,369,364,588,
+377,376,409,373,378,374,372,127
+};
+
+CodePage TVCodePage::KOI_7=
+{
+ "ISO 5427 ISO-IR-37 KOI-7",
+ 0x0037000E,
+ {
+ 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,
+ 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 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,123,124,125,126,127
+ },
+ "@`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz[{\\|]}^~á¡â¢ã£ä¤å¥æ¦ç§è¨é©êªë«ì¬í­î®ï¯ðÐñÑòÒóÓôÔõÕöÖ÷×øØùÙúÚ",
+ "_",
+ 128,TVCodePage::tbKOI7
+};
+
+ushort TVCodePage::tbISOIR147[]=
+{ 0, 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,
+364,360,361,371,363,589,370,362,
+597,365,611,590,367,591,592,593,
+368,417,594,595,596,369,588,419,
+427,612,409,373,414,423,372, 95,
+385,598,381,397,384,599,396,383,
+603,387,609,389,390,391,392,600,
+393,418,601,602,394,395,382,420,
+428,606,386,399,415,424,398,127 };
+
+CodePage TVCodePage::ISO_IR_147=
+{
+ "JUS_I.B1.003-MAC ISO-IR-147",
+ 0x0147000E,
+ {
+ 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,
+ 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 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,123,124,125,126,127
+ },
+ "`@aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ{[|\\}]~^á¡â¢ã£ä¤å¥æ¦ç§è¨é©êªë«ì¬í­î®ï¯ðÐñÑòÒóÓôÔõÕöÖ÷×øØùÙúÚ",
+ "",
+ 128,TVCodePage::tbISOIR147
+};
+
+ushort TVCodePage::tbISOIR146[]=
+{ 0, 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,
+364,360,361,371,363,589,370,362,
+597,365,611,590,367,591,592,593,
+368,417,594,595,596,369,588,419,
+427,612,409,373,412,421,372, 95,
+385,598,381,397,384,599,396,383,
+603,387,609,389,390,391,392,600,
+393,418,601,602,394,395,382,420,
+428,606,386,399,413,422,398,127 };
+
+CodePage TVCodePage::ISO_IR_146=
+{
+ "JUS_I.B1.003-SERB ISOIR146",
+ 0x0146000E,
+ {
+ 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,
+ 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 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,123,124,125,126,127
+ },
+ "`@aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ{[|\\}]~^á¡â¢ã£ä¤å¥æ¦ç§è¨é©êªë«ì¬í­î®ï¯ðÐñÑòÒóÓôÔõÕöÖ÷×øØùÙúÚ",
+ "",
+ 128,TVCodePage::tbISOIR146
+};
+
+ushort TVCodePage::Low32CharsRemaped[]=
+{ 197,196,191,192,217,179,195, 7,194,193,218,219,178,177,176,180,
+ 16, 17, 18,220,222,221,254, 23, 24, 25, 26, 27,223, 29, 30, 31};
+
+// PC1250 Windows latin 2 code page
+CodePage TVCodePage::stPC1250=
+{ "CP 1250 Win Latin 2",
+ 1250,
+ { 0x20,0x20, 44,0x20,429,430,431,432,0x20,433,304, 60,270,305,306,273,
+ 0x20, 96, 39,434,435, 7, 45,341,0x20,436,297, 62,260,326,298,262,
+ 255,350,351,319,331,313,338, 21,345,336,309,174,170,341,335,316,
+ 248,241,349,317,340,230, 20,250,344,311,307,175,327,348,325,315,
+ 269,263,289,330,142,266,264,128,299,144,314,280,301,265,291,300,
+ 323,267,302,268,292,354,153,334,303,283,271,274,154,272,310,225,
+ 259,160,131,328,132,257,256,135,294,130,312,137,358,161,140,324,
+ 321,258,295,162,147,353,148,246,296,282,163,286,129,261,308,352 },
+ "šŠœŒŸžŽ³£¹¥ºª¾¼¿¯àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "µß",
+ 32,TVCodePage::Low32CharsRemaped
+};
+
+// PC1251 Russian Windows code page
+CodePage TVCodePage::PC1251=
+{ "CP 1251 Win Russian",
+ 1251,
+ { 412,414, 44,415,429,430,431,432,0x20,433,417, 60,419,423,421,427,
+ 413, 96, 39,434,435, 7, 45,341,0x20,436,418, 62,420,424,422,428,
+ 255,425,426,611,331,437,338, 21,605,336,407,174,170,341,335,416,
+ 248,241,610,607,438,230, 20,250,604,411,408,175,609,612,606,608,
+ 360,361,588,362,363,589,364,409,365,366,590,367,591,592,593,368,
+ 594,595,596,369,370,597,371,372,373,374,375,376,377,378,379,380,
+ 598,381,382,383,384,599,385,386,387,388,389,390,391,392,600,393,
+ 601,602,394,395,396,603,397,398,399,400,401,402,403,404,405,406 },
+ "€ƒšŠœŒžŽŸ¢¡¼£´¥ºª¿¯²³¸¨¾½àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖ÷×øØùÙúÚûÛüÜýÝþÞÿß",
+ "µ",
+ 32,Low32CharsRemaped
+};
+
+// PC1252 Windows latin 1 code page
+CodePage TVCodePage::stPC1252=
+{ "CP 1252 Win Latin 1",
+ 1252,
+ { 0x20,0x20, 44,159,429,430,431,432, 94,433,304, 60,440,0x20,306,0x20,
+ 0x20, 96, 39,434,435, 7, 45,341,126,436,297, 62,441,0x20,298,450,
+ 255,173,155,156,331,157,338, 21,345,336,166,174,170,341,335,339,
+ 248,241,253,347,340,230, 20,250,344,346,167,175,172,171,343,168,
+ 275,263,289,287,142,143,146,128,276,144,290,280,277,265,291,281,
+ 323,165,278,268,292,288,153,334,320,279,271,293,154,272,333,225,
+ 133,160,131,284,132,134,145,135,138,130,136,137,141,161,140,139,
+ 322,164,149,162,147,285,148,246,318,151,163,150,129,261,332,152 },
+ "œŒšŠžŽÿŸàÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "ƒµß",
+ 32,Low32CharsRemaped
+};
+
+// PC1253 Windows greek code page
+CodePage TVCodePage::stPC1253=
+{ "CP 1253 Win Greek",
+ 1253,
+ { 0x20,0x20, 44,159,429,430,431,432,0x20,433,0x20, 60,0x20,0x20,0x20,0x20,
+ 0x20, 96, 39,434,435, 7, 45,341,0x20,436,0x20, 62,0x20,0x20,0x20,0x20,
+ 255,564,572,156,331,157,338, 21,345,336,0x20,174,170,341,335,341,
+ 248,241,253,347,340,230, 20,250,573,574,575,175,576,171,577,578,
+ 581,617,618,226,560,619,620,621,233,622,623,583,624,625,561,626,
+ 562,627,0x20,228,628,629,232,630,563,234,631,632,565,566,567,568,
+ 582,224,613,546,235,238,547,548,549,550,614,551,615,552,553,616,
+ 227,554,555,229,231,556,237,557,558,559,579,580,569,570,571,0x20 },
+ "µÌáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÓóÓôÔõÕöÖ÷×øØùÙܢݸ޹ߺü¼ý¾þ¿úÚûÛ",
+ "ƒÀà",
+ 32,Low32CharsRemaped
+};
+
+// PC1254 Windows
+CodePage TVCodePage::stPC1254=
+{ "CP 1254 Win Turkish",
+ 1254,
+ { 0x20,0x20, 44,159,429,430,431,432, 94,433,304, 60,440,0x20,0x20,0x20,
+ 0x20, 96, 39,434,435, 7, 45,341,126,436,297, 62,441,0x20,0x20,450,
+ 255,173,155,156,331,157,338, 21,345,336,166,174,170,341,335,339,
+ 248,241,253,347,340,230, 20,250,344,346,167,175,172,171,343,168,
+ 275,263,289,287,142,143,146,128,276,144,290,280,277,265,291,281,
+ 504,165,278,268,292,288,153,334,320,279,271,293,154,487,309,225,
+ 133,160,131,284,132,134,145,135,138,130,136,137,141,161,140,139,
+ 505,164,149,162,147,285,148,246,318,151,163,150,129,337,307,152 },
+ "àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞšŠœŒÿŸ",
+ "ƒµß",
+ 32,Low32CharsRemaped
+};
+
+// PC1257 Windows
+CodePage TVCodePage::stPC1257=
+{ "CP 1257 Win Baltic",
+ 1257,
+ { 0x20,0x20, 44,0x20,429,430,431,432,0x20,433,0x20, 60,0x20,345,350,344,
+ 0x20, 96, 39,434,435, 7, 45,341,0x20,436,0x20, 62,0x20,339,349,0x20,
+ 255,0x20,155,156,331,0x20,338, 21,320,336,516,174,170,341,335,146,
+ 248,241,253,347,340,230, 20,250,318,346,517,175,172,171,343,145,
+ 313,522,585,264,142,143,314,496,299,144,273,542,510,512,498,544,
+ 304,267,514,268,500,288,153,334,524,319,270,502,154,316,306,225,
+ 311,523,584,256,132,134,312,497,294,130,262,543,511,513,499,545,
+ 297,258,515,162,501,285,148,246,525,317,260,503,129,315,298,352
+ },
+ "¸¨ºª¿¯àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖ÷×øØùÙúÚûÛüÜýÝþÞ",
+ "µß",
+ 32,Low32CharsRemaped
+};
+
+CodePage TVCodePage::ISO8859_7=
+{ "ISO 8859-7 Greek",
+ 88597,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 255, 96, 39,156, 32, 32,338, 21,345,336, 32,174,170,341, 32,341,
+ 248,241,253,347,340,564,572,250,573,574,575,175,576,171,577,578,
+ 581,617,618,226,560,619,620,621,233,622,623,583,624,625,561,626,
+ 562,627, 32,228,628,629,232,630,563,234,631,632,565,566,567,568,
+ 582,224,613,546,235,238,547,548,549,550,614,551,615,552,553,616,
+ 227,554,555,229,231,556,237,557,558,559,579,580,569,570,571, 32 },
+ "ܶݸ޹ߺü¼ý¾þ¿úÚûÛáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÓóÓôÔõÕöÖ÷×øØùÙ",
+ "àÀ",0,0
+};
+
+// ISO 8859-9 (1989) Pure
+CodePage TVCodePage::ISO8859_9=
+{ "ISO 8859-9",
+ 88599,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 255,173,155,156,331,157,338, 21,345,336,166,174,170,341,335,339,
+ 248,241,253,347,340,230, 20,250,344,346,167,175,172,171,343,168,
+ 275,263,289,287,142,143,146,128,276,144,290,280,277,265,291,281,
+ 504,165,278,268,292,288,153,334,320,279,271,293,154,487,309,225,
+ 133,160,131,284,132,134,145,135,138,130,136,137,141,161,140,139,
+ 505,164,149,162,147,285,148,246,318,151,163,150,129,337,307,152 },
+ "àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "µßÿ",0,0
+};
+
+// ISO/IEC 8859-14:1998
+CodePage TVCodePage::ISO8859_14=
+{ "ISO 8859-14",
+ 885914,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 255,478,479,156,480,481,482, 21,526,336,530,483,528,341,335,450,
+ 484,485,586,486,488,489, 20,490,527,491,531,492,529,532,533,493,
+ 275,263,289,287,142,143,146,128,276,144,290,280,277,265,291,281,
+ 474,165,278,268,292,288,153,494,320,279,271,293,154,272,476,225,
+ 133,160,131,284,132,134,145,135,138,130,136,137,141,161,140,139,
+ 475,164,149,162,147,285,148,495,318,151,163,150,129,261,477,152
+ },
+ "¢¡¥¤«¦¸¨ºª¼¬±°³²µ´¹·¿»¾½àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖ÷×øØùÙúÚûÛüÜýÝþÞÿ¯",
+ "ß",0,0
+};
+
+// ISO/IEC 8859-15:1998
+CodePage TVCodePage::ISO8859_15=
+{ "ISO 8859-15 Icelan.",
+ 885915,
+ { 218,196,191,192,217,179,195,180,194,193,197,201,205,187,200,188,
+ 186,199,182,209,207,219,178,177,176,223,220,222,221,254,254,254,
+ 255,173,155,156,0x20,157,304, 21,297,336,166,174,170,341,335,339,
+ 248,241,253,347,306,230, 20,250,298,346,167,175,440,441,450,168,
+ 275,263,289,287,142,143,146,128,276,144,290,280,277,265,291,281,
+ 323,165,278,268,292,288,153,334,320,279,271,293,154,272,333,225,
+ 133,160,131,284,132,134,145,135,138,130,136,137,141,161,140,139,
+ 322,164,149,162,147,285,148,246,318,151,163,150,129,261,332,152 },
+ "àÀáÁâÂãÃäÄåÅæÆçÇèÈéÉêÊëËìÌíÍîÎïÏðÐñÑòÒóÓôÔõÕöÖøØùÙúÚûÛüÜýÝþÞ",
+ "µßÿ",0,0
+};
+
+// That's a special polish code page
+// This is PC437 changing: 134,141,143,144,145,146,149,152,156,158,160-167
+CodePage TVCodePage::stMazovia=
+{ "Mazovia (polish)",
+ 1000000,
+ { 128,129,130,131,132,133,311,135,136,137,138,139,140,256,142,313,
+ 314,312,317,147,148,264,150,151,270,153,154,155,319,157,260,159,
+ 273,316,162,268,258,267,262,315,168,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 },
+ "†•‘’œž˜¦ §¡¢£¤¥„Ž‡€š”™",
+ "‚ƒ…ˆ‰Š‹Œ“–—á",0,0
+};
+
+/**[txh]********************************************************************
+
+ Description:
+ Protected member used to create the list of known code pages stored in
+CodePages.
+
+***************************************************************************/
+
+void TVCodePage::CreateCodePagesCol()
+{
+ CodePages=new TVCodePageCol(43,3);
+
+ #define a(v) CodePages->insert(&v)
+ // Total: 47
+ // Latin (27)
+ a(stPC437);
+ a(stPC775);
+ a(stPC850);
+ a(stPC852);
+ a(stPC857);
+ a(stPC860);
+ a(stPC861);
+ a(stPC863);
+ a(stPC865);
+ a(ISO8879_1);
+ a(ISO8859_1_Lat1);
+ a(ISO8859_1u_Lat1);
+ a(ISO8879_2);
+ a(ISO8859_2_Lat2);
+ a(ISO8859_2u_Lat2);
+ a(ISO8859_2e_Lat2);
+ a(ISO8859_2_Sun);
+ a(ISO8859_3);
+ a(ISO8859_4);
+ a(ISO8859_9);
+ a(ISO8859_14);
+ a(ISO8859_15);
+ a(stPC1250);
+ a(stPC1252);
+ a(stPC1254);
+ a(stPC1257);
+ a(stMazovia);
+ // Russian (16)
+ a(stPC855);
+ a(stPC866);
+ a(ISO8859_5);
+ a(KOI_8r);
+ a(KOI_8crl);
+ a(PC1251);
+ a(ISO_IR_111);
+ a(ISO_IR_153);
+ a(CP10007);
+ a(CP100072);
+ a(OVR);
+ a(AVR);
+ a(U_CodeR);
+ a(KOI_7);
+ a(ISO_IR_147);
+ a(ISO_IR_146);
+ // Greek (4)
+ a(stPC737);
+ a(stPC869);
+ a(stPC1253);
+ a(ISO8859_7);
+ #undef a
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Initializes the code page system selecting the indicated code pages. This
+is only used iternally. @x{::SetCodePage}.
+
+***************************************************************************/
+
+TVCodePage::TVCodePage(int idApp, int idScr, int idInp)
+{
+ if (!CodePages)
+ CreateCodePagesCol();
+ FillTables(idApp);
+ CreateOnTheFlyRemap(idApp,idScr);
+ curScrCP=defScrCP=idScr;
+ CreateOnTheFlyInpRemap(idInp,idApp);
+ curInpCP=defInpCP=idInp;
+ defAppCP=idApp;
+ TGKey::SetCodePage(idInp);
+ if (idApp!=curAppCP)
+ {
+ curAppCP=idApp;
+ RemapTVStrings(GetTranslate(curAppCP));
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Protected member used to create a one to one table to convert from one
+code page to another. Used to create the input to application and application
+to screen on the fly convertion tables.
+
+***************************************************************************/
+
+void TVCodePage::CreateRemap(int idSource, int idDest, uchar *table)
+{
+ unsigned i;
+ // Table to convert a value into an internal code.
+ // That's what we need.
+ ushort *toCode=GetTranslate(idSource),*aux;
+ // Table to convert an internal value into a 0-255 value.
+ // That's what we have. If something is missing we will remap to a similar.
+ uchar *fromCode=new uchar[maxSymbolDefined];
+ memset(fromCode,0,maxSymbolDefined*sizeof(uchar));
+ CodePage *destCP=CodePageOfID(idDest);
+ aux=destCP->Font;
+ for (i=0; i<128; i++)
+ if (aux[i]<maxSymbolDefined) // extra check, just in case I forgot to update the constant
+ fromCode[aux[i]]=i+128;
+
+ i=0;
+ if (destCP->LowRemapNum)
+ {
+ unsigned to=destCP->LowRemapNum;
+ aux=destCP->LowRemap;
+ for (; i<to; i++)
+ if (aux[i]<maxSymbolDefined)
+ fromCode[aux[i]]=i;
+ }
+ for (; i<128; i++)
+ fromCode[i]=i;
+
+ // Adjust values found in source but not in dest (look for similars)
+ for (i=1; i<256; i++)
+ {
+ unsigned val=toCode[i];
+ if (fromCode[val])
+ continue;
+ while (!fromCode[val])
+ { // Find an equivalent for val
+ if (val<256)
+ val=Similar[val];
+ else
+ val=Similar2[val-256];
+ }
+ fromCode[toCode[i]]=fromCode[val];
+ }
+
+ for (i=0; i<256; i++)
+ table[i]=fromCode[toCode[i]];
+
+ DeleteArray(fromCode);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Protected member used to create the application to screen map when we have
+to translate values on the fly. @x{::CreateRemap}.
+
+***************************************************************************/
+
+void TVCodePage::CreateOnTheFlyRemap(int idApp, int idScr)
+{
+ // Create on-the-fly remap table if needed
+ if (idApp==idScr)
+ {
+ NeedsOnTheFlyRemap=0;
+ return;
+ }
+ NeedsOnTheFlyRemap=1;
+ CreateRemap(idApp,idScr,OnTheFlyMap);
+
+ /* To debug the remapping table:
+ fputs("Usando remapeo:\n",stderr);
+ for (i=0; i<256; i++)
+ {
+ fprintf(stderr,"0x%02X,",OnTheFlyMap[i]);
+ if (!((i+1)&0xF)) fputc('\n',stderr);
+ }*/
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Protected member used to create the input to application map when we have
+to translate values on the fly. @x{::CreateRemap}.
+
+***************************************************************************/
+
+void TVCodePage::CreateOnTheFlyInpRemap(int idInp, int idApp)
+{
+ if (idInp==idApp)
+ {
+ NeedsOnTheFlyInpRemap=0;
+ return;
+ }
+ NeedsOnTheFlyInpRemap=1;
+ CreateRemap(idInp,idApp,OnTheFlyInpMap);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Selects the current code page used for toupper, tolower, etc. operations
+and internal encodings, the code page used for the screen and the one used
+for input.@p
+ If any of the arguments is -1 the current value is used. If the code pages
+aren't the same the remap on the fly is enabled. The application code page
+is used to remap the application, only if it changed.
+
+***************************************************************************/
+
+void TVCodePage::SetCodePage(int idApp, int idScr, int idInp)
+{
+ //fprintf(stderr,"idApp %d idScr %d idInp %d\n",idApp,idScr,idInp);
+ if (idApp==-1)
+ idApp=curAppCP;
+ if (idScr==-1)
+ idScr=curScrCP;
+ if (idInp==-1)
+ idInp=curInpCP;
+ if (curAppCP!=idApp || curScrCP!=idScr)
+ CreateOnTheFlyRemap(idApp,idScr);
+ if (curAppCP!=idApp || curInpCP!=idInp)
+ CreateOnTheFlyInpRemap(idInp,idApp);
+ curScrCP=idScr;
+ curInpCP=idInp;
+ TGKey::SetCodePage(idInp);
+ if (curAppCP!=idApp)
+ {
+ curAppCP=idApp;
+ FillTables(curAppCP);
+ RemapTVStrings(GetTranslate(curAppCP));
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Protected member used to create the toupper, tolower and isalpha tables.
+
+***************************************************************************/
+
+void TVCodePage::FillTables(int id)
+{
+ CodePage *p=CodePageOfID(id);
+ int i;
+ // Initialize toUpperTable, toLowerTable and AlphaTable:
+ // 1) ASCII and defaults
+ memset(AlphaTable,0,sizeof(AlphaTable));
+ for (i=0; i<256; i++)
+ {
+ if (i>='a' && i<='z')
+ {
+ toUpperTable[i]=i-32;
+ AlphaTable[i]=alphaChar | lowerChar;
+ }
+ else
+ toUpperTable[i]=i;
+ if (i>='A' && i<='Z')
+ {
+ toLowerTable[i]=i+32;
+ AlphaTable[i]=alphaChar | upperChar;
+ }
+ else
+ toLowerTable[i]=i;
+ if (i>='0' && i<='9')
+ AlphaTable[i]=digitChar;
+ }
+ // 2) For this code page
+ uchar *s=(uchar *)p->UpLow;
+ if (s)
+ for (; *s; s+=2)
+ {
+ toLowerTable[*(s+1)]=*s;
+ toUpperTable[*s]=*(s+1);
+ AlphaTable[*s]=alphaChar | lowerChar;
+ AlphaTable[*(s+1)]=alphaChar | upperChar;
+ }
+ s=(uchar *)p->MoreLetters;
+ if (s)
+ for (; *s; s++)
+ AlphaTable[*s]=alphaChar;
+ /* Dump tables
+ fputs("uchar TVCodePage::AlphaTable[256]=\n{\n",stderr);
+ for (i=0; i<256; i++)
+ {
+ fprintf(stderr,"0x%02X,",AlphaTable[i]);
+ if (!((i+1)&0xF)) fputc('\n',stderr);
+ }
+ fputs("};\nuchar TVCodePage::toUpperTable[256]=\n{\n",stderr);
+ for (i=0; i<256; i++)
+ {
+ fprintf(stderr,"0x%02X,",toUpperTable[i]);
+ if (!((i+1)&0xF)) fputc('\n',stderr);
+ }
+ fputs("};\nuchar TVCodePage::toLowerTable[256]=\n{\n",stderr);
+ for (i=0; i<256; i++)
+ {
+ fprintf(stderr,"0x%02X,",toLowerTable[i]);
+ if (!((i+1)&0xF)) fputc('\n',stderr);
+ }
+ fputs("};\n",stderr); */
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Deallocates memory used by TVCodePage.
+
+***************************************************************************/
+
+TVCodePage::~TVCodePage()
+{
+ CLY_destroy(CodePages);
+ CodePages=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts a code page id into an index in the code page collection.@*
+ Important note: We should always default to 437 because:@*
+1) That's the original encoding used by TV applications.@*
+2) Some asiatic encodings, like code page 936 (simplified chinese, maybe
+also 950 [traditional chinese], 932 [japanese Shift-JIS] and 949 [korean]),
+behaves like 437 when we write to the video buffer.@*
+
+ Return: The index of the code page with this id. If error the index for
+PC 437 code page is returned.
+
+***************************************************************************/
+
+ccIndex TVCodePage::IDToIndex(int id)
+{
+ if (!CodePages) return 0;
+ ccIndex c=CodePages->getCount();
+ ccIndex i, i437=0;
+ for (i=0; i<c; i++)
+ {
+ CodePage *p=(CodePage *)(CodePages->at(i));
+ if (p->id==id)
+ return i;
+ if (p->id==PC437)
+ i437=i;
+ }
+ return i437;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts an index in the code page collection into a code page id. No
+check of range is done.
+
+ Return: The code page id for the indicated index.
+
+***************************************************************************/
+
+int TVCodePage::IndexToID(ccIndex index)
+{
+ if (!CodePages) return 0;
+ CodePage *p=(CodePage *)(CodePages->at(index));
+ return p->id;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to get a map to translate code page symbols into internal symbols for
+the indicated code page id.
+
+ Return: A pointer to a static buffer containing the translation values. Or
+NULL if not initialized. The index 256 indicates 128 if only the upper 128
+values are really different from CP 437 or 256 if all the values are
+different. In any case all the values are usable.
+
+***************************************************************************/
+
+ushort *TVCodePage::GetTranslate(int id)
+{
+ if (!CodePages)
+ CreateCodePagesCol();
+ CodePage *p=CodePageOfID(id);
+ memcpy(CPTable+128,p->Font,sizeof(short)*128);
+ CPTable[256]=128;
+ int i=0;
+ if (p->LowRemapNum)
+ {
+ CPTable[256]=0;
+ memcpy(CPTable,p->LowRemap,sizeof(short)*p->LowRemapNum);
+ i=p->LowRemapNum;
+ }
+ for (; i<128; i++)
+ CPTable[i]=i;
+
+ return CPTable;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fills a table with pairs Unicode/code in CP. The table is sorted and the
+user must provide an array with at least 256 elements to fill.
+
+***************************************************************************/
+
+void TVCodePage::GetUnicodesForCP(int id, stIntCodePairs *unicodes)
+{
+ ushort *internals=GetTranslate(id);
+ int i;
+ for (i=0; i<256; i++)
+ {
+ unicodes[i].unicode=UnicodeForInternalCode(internals[i]);
+ unicodes[i].code=i;
+ }
+ qsort(unicodes,256,sizeof(stIntCodePairs),compare);
+ /*for (i=0; i<256; i++)
+ printf("U+%04X => %d (0x%02X)\n",unicodes[i].unicode,unicodes[i].code,unicodes[i].code);*/
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to get a TStringCollection listing all the available code pages.
+Useful to make the user choose one. This is a read-only value, don't modify
+it.
+
+ Return: The internal collection casted to TStringCollection.
+
+***************************************************************************/
+
+TStringCollection *TVCodePage::GetList(void)
+{
+ return CodePages;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Remaps the desired character using the provided map. The original character
+should be in CP437 encoding. @x{::GetTranslate}.
+
+ Return: The remapped character. It can be a direct translation or the
+closest found.
+
+***************************************************************************/
+
+uchar TVCodePage::RemapChar(uchar c, ushort *map)
+{
+ if (c<map[256])
+ return c;
+ int i;
+ ushort v=c;
+ for (i=map[256]; i<256; i++)
+ if (map[i]==v)
+ return i;
+
+ while (v>126 || v<32)
+ {
+ v=Similar[v];
+ if (v>=32 && v<127)
+ return v;
+ for (i=map[256]; i<256; i++)
+ if (map[i]==v)
+ return i;
+ }
+ return v;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Remaps the @<var>{o} string using the provided map and storing it in the
+@<var>{n} string. The string should be terminated by a 0. @x{::RemapChar}.
+
+***************************************************************************/
+
+void TVCodePage::RemapString(uchar *n, uchar *o, ushort *map)
+{
+ int i;
+ for (i=0; o[i]; i++)
+ n[i]=RemapChar(o[i],map);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Remaps the @var{o} string using the provided map and storing it in the
+@var{n} string. The number of items to remap is indicated with @var{len}.
+@x{::RemapChar}.
+
+***************************************************************************/
+
+void TVCodePage::RemapNString(uchar *n, uchar *o, ushort *map, int len)
+{
+ for (; len; --len)
+ n[len-1]=RemapChar(o[len-1],map);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to remap a buffer from any of the supported code pages into another.
+The process doesn't have to be reversible.@p
+ Tabs, carriage returns, new lines and the null code aren't remapped.
+
+***************************************************************************/
+
+void TVCodePage::RemapBufferGeneric(int sourID, int destID, uchar *buffer, unsigned len,
+ unsigned ops)
+{
+ unsigned i;
+ if (!CodePages) return; // Just in case
+ // Table to convert a value into an internal code
+ ushort *toCode=GetTranslate(sourID);
+ ushort *aux;
+ if (ops & rbgDontRemapLow32)
+ {
+ for (i=0; i<32; i++)
+ toCode[i]=i;
+ }
+ else
+ {
+ // Avoid conversions that will break the text:
+ toCode[0]=0;
+ toCode['\n']='\n';
+ toCode['\r']='\r';
+ toCode['\t']='\t';
+ }
+
+ // Table to convert an internal value into a 0-255 value
+ uchar *fromCode=new uchar[maxSymbolDefined];
+ memset(fromCode,0,maxSymbolDefined*sizeof(uchar));
+
+ CodePage *destCP=CodePageOfID(destID);
+
+ aux=destCP->Font;
+ for (i=0; i<128; i++)
+ if (aux[i]<maxSymbolDefined) // extra check, just in case I forgot to update the constant
+ fromCode[aux[i]]=i+128;
+
+ i=0;
+ if (!(ops & rbgDontRemapLow32) && destCP->LowRemapNum)
+ {
+ unsigned to=destCP->LowRemapNum;
+ aux=destCP->LowRemap;
+ for (; i<to; i++)
+ if (aux[i]<maxSymbolDefined)
+ fromCode[aux[i]]=i;
+ }
+ for (; i<128; i++)
+ fromCode[i]=i;
+ // Avoid conversions that will break the text:
+ fromCode[0]=0;
+ fromCode['\n']='\n';
+ fromCode['\r']='\r';
+ fromCode['\t']='\t';
+
+ // Adjust values found in source but not in dest (look for similars)
+ for (i=1; i<256; i++)
+ {
+ unsigned val=toCode[i];
+ if (fromCode[val])
+ continue;
+ while (!fromCode[val])
+ { // Find an equivalent for val
+ if (val<256)
+ val=Similar[val];
+ else
+ val=Similar2[val-256];
+ }
+ fromCode[toCode[i]]=fromCode[val];
+ }
+
+ // Ok, now do it!
+ for (i=0; i<len; i++)
+ buffer[i]=fromCode[toCode[buffer[i]]];
+
+ delete[] fromCode;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to create a table to translate from sourID to destID. The provided
+buffer should have at least 256 characters.
+
+***************************************************************************/
+
+void TVCodePage::FillGenericRemap(int sourID, int destID, uchar *buffer,
+ unsigned ops)
+{
+ if (!CodePages)
+ CreateCodePagesCol();
+ int i;
+ for (i=0; i<256; i++)
+ buffer[i]=i;
+ RemapBufferGeneric(sourID,destID,buffer,256,ops);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Protected member used internally to remap all the TV stuff that isn't
+ASCII.
+
+***************************************************************************/
+
+void TVCodePage::RemapTVStrings(ushort *map)
+{
+ #define C(cla,name) RemapString((uchar *)cla::name,(uchar *)cla::o##name,map)
+ C(TRadioButtons,button);
+ C(TMenuBox,frameChars);
+ C(TFrame,frameChars);
+ C(TFrame,closeIcon);
+ C(TFrame,zoomIcon);
+ C(TFrame,unZoomIcon);
+ C(TFrame,dragIcon);
+ C(TFrame,animIcon);
+ C(THistory,icon);
+ C(TMonoSelector,button);
+ C(TStatusLine,hintSeparator);
+ C(TCheckBoxes,button);
+ C(TButton,shadows);
+ C(TButton,markers);
+ C(TDirListBox,pathDir);
+ C(TDirListBox,firstDir);
+ C(TDirListBox,middleDir);
+ C(TDirListBox,lastDir);
+ C(TDirListBox,graphics);
+ #undef C
+
+ #define C(cla,name) cla::name=RemapChar(cla::o##name,map)
+ C(TIndicator,dragFrame);
+ C(TIndicator,normalFrame);
+ C(TColorSelector,icon);
+ C(TColorSelector,mark);
+ C(TInputLine,rightArrow);
+ C(TInputLine,leftArrow);
+ C(TMenuBox,rightArrow);
+ C(TRadioButtons,check);
+ C(TIndicator,modifiedStar);
+ C(TListViewer,columnSeparator);
+ C(TDeskTop,defaultBkgrnd);
+ C(TView,noMoireFill);
+ #undef C
+
+ #define C(cla,name,len) RemapNString((uchar *)cla::name,(uchar *)cla::o##name,map,len)
+ C(TView,specialChars,6);
+ C(TScrollBar,vChars,5);
+ C(TScrollBar,hChars,5);
+ #undef C
+
+ if (UserHook) UserHook(map);
+
+ message(TProgram::deskTop,evBroadcast,cmUpdateCodePage,map);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the function to be called after changing the code page. This should
+remap the special strings used by the application.
+
+ Return: The previous function. If it's != NULL you should call it.
+
+***************************************************************************/
+
+TVCodePageCallBack TVCodePage::SetCallBack(TVCodePageCallBack cb)
+{
+ TVCodePageCallBack oldCB=UserHook;
+ UserHook=cb;
+ return oldCB;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Protected member used to find the code page structure for a provided id.
+
+ Return: A CodePage structure pointer.
+
+***************************************************************************/
+
+CodePage *TVCodePage::CodePageOfID(int id)
+{
+ return (CodePage *)(CodePages->at(IDToIndex(id)));
+}
+
+stIntCodePairs TVCodePage::InternalMap[]=
+{
+ { 0x0020, 32 },
+ { 0x0021, 33 },
+ { 0x0022, 34 },
+ { 0x0023, 35 },
+ { 0x0024, 36 },
+ { 0x0025, 37 },
+ { 0x0026, 38 },
+ { 0x0027, 39 },
+ { 0x0028, 40 },
+ { 0x0029, 41 },
+ { 0x002a, 42 },
+ { 0x002b, 43 },
+ { 0x002c, 44 },
+ { 0x002d, 45 },
+ { 0x002e, 46 },
+ { 0x002f, 47 },
+ { 0x0030, 48 },
+ { 0x0031, 49 },
+ { 0x0032, 50 },
+ { 0x0033, 51 },
+ { 0x0034, 52 },
+ { 0x0035, 53 },
+ { 0x0036, 54 },
+ { 0x0037, 55 },
+ { 0x0038, 56 },
+ { 0x0039, 57 },
+ { 0x003a, 58 },
+ { 0x003b, 59 },
+ { 0x003c, 60 },
+ { 0x003d, 61 },
+ { 0x003e, 62 },
+ { 0x003f, 63 },
+ { 0x0040, 64 },
+ { 0x0041, 65 },
+ { 0x0042, 66 },
+ { 0x0043, 67 },
+ { 0x0044, 68 },
+ { 0x0045, 69 },
+ { 0x0046, 70 },
+ { 0x0047, 71 },
+ { 0x0048, 72 },
+ { 0x0049, 73 },
+ { 0x004a, 74 },
+ { 0x004b, 75 },
+ { 0x004c, 76 },
+ { 0x004d, 77 },
+ { 0x004e, 78 },
+ { 0x004f, 79 },
+ { 0x0050, 80 },
+ { 0x0051, 81 },
+ { 0x0052, 82 },
+ { 0x0053, 83 },
+ { 0x0054, 84 },
+ { 0x0055, 85 },
+ { 0x0056, 86 },
+ { 0x0057, 87 },
+ { 0x0058, 88 },
+ { 0x0059, 89 },
+ { 0x005a, 90 },
+ { 0x005b, 91 },
+ { 0x005c, 92 },
+ { 0x005d, 93 },
+ { 0x005e, 94 },
+ { 0x005f, 95 },
+ { 0x0060, 96 },
+ { 0x0061, 97 },
+ { 0x0062, 98 },
+ { 0x0063, 99 },
+ { 0x0064, 100 },
+ { 0x0065, 101 },
+ { 0x0066, 102 },
+ { 0x0067, 103 },
+ { 0x0068, 104 },
+ { 0x0069, 105 },
+ { 0x006a, 106 },
+ { 0x006b, 107 },
+ { 0x006c, 108 },
+ { 0x006d, 109 },
+ { 0x006e, 110 },
+ { 0x006f, 111 },
+ { 0x0070, 112 },
+ { 0x0071, 113 },
+ { 0x0072, 114 },
+ { 0x0073, 115 },
+ { 0x0074, 116 },
+ { 0x0075, 117 },
+ { 0x0076, 118 },
+ { 0x0077, 119 },
+ { 0x0078, 120 },
+ { 0x0079, 121 },
+ { 0x007a, 122 },
+ { 0x007b, 123 },
+ { 0x007c, 124 },
+ { 0x007d, 125 },
+ { 0x007e, 126 },
+ { 0x00a0, 255 },
+ { 0x00a1, 173 },
+ { 0x00a2, 155 },
+ { 0x00a3, 156 },
+ { 0x00a4, 331 },
+ { 0x00a5, 157 },
+ { 0x00a6, 338 },
+ { 0x00a7, 21 },
+ { 0x00a8, 345 },
+ { 0x00a9, 336 },
+ { 0x00aa, 166 },
+ { 0x00ab, 174 },
+ { 0x00ac, 170 },
+ { 0x00ad, 341 },
+ { 0x00ae, 335 },
+ { 0x00af, 339 },
+ { 0x00b0, 248 },
+ { 0x00b1, 241 },
+ { 0x00b2, 253 },
+ { 0x00b3, 347 },
+ { 0x00b4, 340 },
+ { 0x00b5, 230 },
+ { 0x00b6, 20 },
+ { 0x00b7, 250 },
+ { 0x00b8, 344 },
+ { 0x00b9, 346 },
+ { 0x00ba, 167 },
+ { 0x00bb, 175 },
+ { 0x00bc, 172 },
+ { 0x00bd, 171 },
+ { 0x00be, 343 },
+ { 0x00bf, 168 },
+ { 0x00c0, 275 },
+ { 0x00c1, 263 },
+ { 0x00c2, 289 },
+ { 0x00c3, 287 },
+ { 0x00c4, 142 },
+ { 0x00c5, 143 },
+ { 0x00c6, 146 },
+ { 0x00c7, 128 },
+ { 0x00c8, 276 },
+ { 0x00c9, 144 },
+ { 0x00ca, 290 },
+ { 0x00cb, 280 },
+ { 0x00cc, 277 },
+ { 0x00cd, 265 },
+ { 0x00ce, 291 },
+ { 0x00cf, 281 },
+ { 0x00d0, 323 },
+ { 0x00d1, 165 },
+ { 0x00d2, 278 },
+ { 0x00d3, 268 },
+ { 0x00d4, 292 },
+ { 0x00d5, 288 },
+ { 0x00d6, 153 },
+ { 0x00d7, 334 },
+ { 0x00d8, 320 },
+ { 0x00d9, 279 },
+ { 0x00da, 271 },
+ { 0x00db, 293 },
+ { 0x00dc, 154 },
+ { 0x00dd, 272 },
+ { 0x00de, 333 },
+ { 0x00df, 225 },
+ { 0x00e0, 133 },
+ { 0x00e1, 160 },
+ { 0x00e2, 131 },
+ { 0x00e3, 284 },
+ { 0x00e4, 132 },
+ { 0x00e5, 134 },
+ { 0x00e6, 145 },
+ { 0x00e7, 135 },
+ { 0x00e8, 138 },
+ { 0x00e9, 130 },
+ { 0x00ea, 136 },
+ { 0x00eb, 137 },
+ { 0x00ec, 141 },
+ { 0x00ed, 161 },
+ { 0x00ee, 140 },
+ { 0x00ef, 139 },
+ { 0x00f0, 322 },
+ { 0x00f1, 164 },
+ { 0x00f2, 149 },
+ { 0x00f3, 162 },
+ { 0x00f4, 147 },
+ { 0x00f5, 285 },
+ { 0x00f6, 148 },
+ { 0x00f7, 246 },
+ { 0x00f8, 318 },
+ { 0x00f9, 151 },
+ { 0x00fa, 163 },
+ { 0x00fb, 150 },
+ { 0x00fc, 129 },
+ { 0x00fd, 261 },
+ { 0x00fe, 332 },
+ { 0x00ff, 152 },
+ { 0x0100, 585 },
+ { 0x0101, 584 },
+ { 0x0102, 330 },
+ { 0x0103, 328 },
+ { 0x0104, 313 },
+ { 0x0105, 311 },
+ { 0x0106, 264 },
+ { 0x0107, 256 },
+ { 0x0108, 464 },
+ { 0x0109, 465 },
+ { 0x010a, 480 },
+ { 0x010b, 481 },
+ { 0x010c, 299 },
+ { 0x010d, 294 },
+ { 0x010e, 300 },
+ { 0x010f, 324 },
+ { 0x010f, 359 },
+ { 0x0110, 323 },
+ { 0x0111, 321 },
+ { 0x0112, 496 },
+ { 0x0113, 497 },
+ { 0x0115, 329 },
+ { 0x0116, 542 },
+ { 0x0117, 543 },
+ { 0x0118, 314 },
+ { 0x0119, 312 },
+ { 0x011a, 301 },
+ { 0x011b, 358 },
+ { 0x011c, 466 },
+ { 0x011d, 467 },
+ { 0x011e, 504 },
+ { 0x011f, 505 },
+ { 0x0120, 586 },
+ { 0x0121, 486 },
+ { 0x0122, 510 },
+ { 0x0123, 511 },
+ { 0x0124, 468 },
+ { 0x0125, 469 },
+ { 0x0126, 534 },
+ { 0x0127, 535 },
+ { 0x0128, 518 },
+ { 0x0129, 519 },
+ { 0x012a, 498 },
+ { 0x012b, 499 },
+ { 0x012c, 506 },
+ { 0x012d, 507 },
+ { 0x012e, 522 },
+ { 0x012f, 523 },
+ { 0x0130, 487 },
+ { 0x0131, 337 },
+ { 0x0134, 470 },
+ { 0x0135, 471 },
+ { 0x0136, 512 },
+ { 0x0137, 513 },
+ { 0x0138, 461 },
+ { 0x0139, 266 },
+ { 0x013a, 257 },
+ { 0x013b, 544 },
+ { 0x013c, 545 },
+ { 0x013d, 327 },
+ { 0x013d, 356 },
+ { 0x013e, 325 },
+ { 0x013e, 355 },
+ { 0x0141, 319 },
+ { 0x0142, 317 },
+ { 0x0143, 267 },
+ { 0x0144, 258 },
+ { 0x0145, 514 },
+ { 0x0146, 515 },
+ { 0x0147, 302 },
+ { 0x0148, 295 },
+ { 0x014a, 462 },
+ { 0x014b, 463 },
+ { 0x014c, 500 },
+ { 0x014d, 501 },
+ { 0x0150, 354 },
+ { 0x0151, 353 },
+ { 0x0152, 440 },
+ { 0x0153, 441 },
+ { 0x0154, 269 },
+ { 0x0155, 259 },
+ { 0x0156, 516 },
+ { 0x0157, 517 },
+ { 0x0158, 303 },
+ { 0x0159, 296 },
+ { 0x015a, 270 },
+ { 0x015b, 260 },
+ { 0x015c, 472 },
+ { 0x015d, 473 },
+ { 0x015e, 309 },
+ { 0x015f, 307 },
+ { 0x0160, 304 },
+ { 0x0161, 297 },
+ { 0x0162, 310 },
+ { 0x0163, 308 },
+ { 0x0164, 305 },
+ { 0x0165, 326 },
+ { 0x0165, 357 },
+ { 0x0166, 536 },
+ { 0x0167, 537 },
+ { 0x0168, 520 },
+ { 0x0169, 521 },
+ { 0x016a, 502 },
+ { 0x016b, 503 },
+ { 0x016c, 508 },
+ { 0x016d, 509 },
+ { 0x016e, 282 },
+ { 0x016f, 283 },
+ { 0x0170, 274 },
+ { 0x0171, 286 },
+ { 0x0172, 524 },
+ { 0x0173, 525 },
+ { 0x0174, 474 },
+ { 0x0175, 475 },
+ { 0x0176, 476 },
+ { 0x0177, 477 },
+ { 0x0178, 450 },
+ { 0x0179, 273 },
+ { 0x017a, 262 },
+ { 0x017b, 316 },
+ { 0x017c, 315 },
+ { 0x017d, 306 },
+ { 0x017e, 298 },
+ { 0x0192, 159 },
+ { 0x01a0, 538 },
+ { 0x01a1, 539 },
+ { 0x01af, 540 },
+ { 0x01b0, 541 },
+ { 0x02c7, 350 },
+ { 0x02d8, 351 },
+ { 0x02d9, 352 },
+ { 0x02db, 349 },
+ { 0x02dd, 348 },
+ { 0x0385, 564 },
+ { 0x0386, 572 },
+ { 0x0388, 573 },
+ { 0x0389, 574 },
+ { 0x038a, 575 },
+ { 0x038c, 576 },
+ { 0x038e, 577 },
+ { 0x038f, 578 },
+ { 0x0390, 581 },
+ { 0x0391, 617 },
+ { 0x0392, 618 },
+ { 0x0393, 226 },
+ { 0x0394, 560 },
+ { 0x0395, 619 },
+ { 0x0396, 620 },
+ { 0x0397, 621 },
+ { 0x0398, 233 },
+ { 0x0399, 622 },
+ { 0x039a, 623 },
+ { 0x039b, 583 },
+ { 0x039c, 624 },
+ { 0x039d, 625 },
+ { 0x039e, 561 },
+ { 0x039f, 626 },
+ { 0x03a0, 562 },
+ { 0x03a1, 627 },
+ { 0x03a3, 228 },
+ { 0x03a4, 628 },
+ { 0x03a5, 629 },
+ { 0x03a6, 232 },
+ { 0x03a7, 630 },
+ { 0x03a8, 563 },
+ { 0x03a9, 234 },
+ { 0x03aa, 631 },
+ { 0x03ab, 632 },
+ { 0x03ac, 565 },
+ { 0x03ad, 566 },
+ { 0x03ae, 567 },
+ { 0x03af, 568 },
+ { 0x03b0, 582 },
+ { 0x03b1, 224 },
+ { 0x03b2, 613 },
+ { 0x03b3, 546 },
+ { 0x03b4, 235 },
+ { 0x03b5, 238 },
+ { 0x03b6, 547 },
+ { 0x03b7, 548 },
+ { 0x03b8, 549 },
+ { 0x03b9, 550 },
+ { 0x03ba, 614 },
+ { 0x03bb, 551 },
+ { 0x03bc, 615 },
+ { 0x03bd, 552 },
+ { 0x03be, 553 },
+ { 0x03bf, 616 },
+ { 0x03c0, 227 },
+ { 0x03c1, 554 },
+ { 0x03c2, 555 },
+ { 0x03c3, 229 },
+ { 0x03c4, 231 },
+ { 0x03c5, 556 },
+ { 0x03c6, 237 },
+ { 0x03c7, 557 },
+ { 0x03c8, 558 },
+ { 0x03c9, 559 },
+ { 0x03ca, 579 },
+ { 0x03cb, 580 },
+ { 0x03cc, 569 },
+ { 0x03cd, 570 },
+ { 0x03ce, 571 },
+ { 0x0401, 605 },
+ { 0x0402, 412 },
+ { 0x0403, 414 },
+ { 0x0404, 407 },
+ { 0x0405, 612 },
+ { 0x0406, 610 },
+ { 0x0407, 416 },
+ { 0x0408, 611 },
+ { 0x0409, 417 },
+ { 0x040a, 419 },
+ { 0x040b, 421 },
+ { 0x040c, 423 },
+ { 0x040e, 425 },
+ { 0x040f, 427 },
+ { 0x0410, 360 },
+ { 0x0411, 361 },
+ { 0x0412, 588 },
+ { 0x0413, 362 },
+ { 0x0414, 363 },
+ { 0x0415, 589 },
+ { 0x0416, 364 },
+ { 0x0417, 409 },
+ { 0x0418, 365 },
+ { 0x0419, 366 },
+ { 0x041a, 590 },
+ { 0x041b, 367 },
+ { 0x041c, 591 },
+ { 0x041d, 592 },
+ { 0x041e, 593 },
+ { 0x041f, 368 },
+ { 0x0420, 594 },
+ { 0x0421, 595 },
+ { 0x0422, 596 },
+ { 0x0423, 369 },
+ { 0x0424, 370 },
+ { 0x0425, 597 },
+ { 0x0426, 371 },
+ { 0x0427, 372 },
+ { 0x0428, 373 },
+ { 0x0429, 374 },
+ { 0x042a, 375 },
+ { 0x042b, 376 },
+ { 0x042c, 377 },
+ { 0x042d, 378 },
+ { 0x042e, 379 },
+ { 0x042f, 380 },
+ { 0x0430, 598 },
+ { 0x0431, 381 },
+ { 0x0432, 382 },
+ { 0x0433, 383 },
+ { 0x0434, 384 },
+ { 0x0435, 599 },
+ { 0x0436, 385 },
+ { 0x0437, 386 },
+ { 0x0438, 387 },
+ { 0x0439, 388 },
+ { 0x043a, 389 },
+ { 0x043b, 390 },
+ { 0x043c, 391 },
+ { 0x043d, 392 },
+ { 0x043e, 600 },
+ { 0x043f, 393 },
+ { 0x0440, 601 },
+ { 0x0441, 602 },
+ { 0x0442, 394 },
+ { 0x0443, 395 },
+ { 0x0444, 396 },
+ { 0x0445, 603 },
+ { 0x0446, 397 },
+ { 0x0447, 398 },
+ { 0x0448, 399 },
+ { 0x0449, 400 },
+ { 0x044a, 401 },
+ { 0x044b, 402 },
+ { 0x044c, 403 },
+ { 0x044d, 404 },
+ { 0x044e, 405 },
+ { 0x044f, 406 },
+ { 0x0451, 604 },
+ { 0x0452, 413 },
+ { 0x0453, 415 },
+ { 0x0454, 408 },
+ { 0x0455, 606 },
+ { 0x0456, 607 },
+ { 0x0457, 608 },
+ { 0x0458, 609 },
+ { 0x0459, 418 },
+ { 0x045a, 420 },
+ { 0x045b, 422 },
+ { 0x045c, 424 },
+ { 0x045e, 426 },
+ { 0x045f, 428 },
+ { 0x0490, 437 },
+ { 0x0491, 438 },
+ { 0x1e02, 478 },
+ { 0x1e03, 479 },
+ { 0x1e0a, 482 },
+ { 0x1e0b, 483 },
+ { 0x1e1e, 484 },
+ { 0x1e1f, 485 },
+ { 0x1e40, 488 },
+ { 0x1e41, 489 },
+ { 0x1e56, 490 },
+ { 0x1e57, 491 },
+ { 0x1e60, 492 },
+ { 0x1e61, 493 },
+ { 0x1e6a, 494 },
+ { 0x1e6b, 495 },
+ { 0x1e80, 526 },
+ { 0x1e81, 527 },
+ { 0x1e82, 530 },
+ { 0x1e83, 531 },
+ { 0x1e84, 532 },
+ { 0x1e85, 533 },
+ { 0x1ef2, 528 },
+ { 0x1ef3, 529 },
+ { 0x2017, 342 },
+ { 0x201c, 434 },
+ { 0x201d, 435 },
+ { 0x201e, 429 },
+ { 0x2020, 431 },
+ { 0x2021, 432 },
+ { 0x2022, 7 },
+ { 0x2024, 7 },
+ { 0x2026, 430 },
+ { 0x2027, 249 },
+ { 0x2030, 433 },
+ { 0x203c, 19 },
+ { 0x207f, 252 },
+ { 0x20a7, 158 },
+ { 0x20ac, 587 },
+ { 0x2116, 411 },
+ { 0x2122, 436 },
+ { 0x2190, 27 },
+ { 0x2191, 24 },
+ { 0x2192, 26 },
+ { 0x2193, 25 },
+ { 0x2194, 29 },
+ { 0x2195, 18 },
+ { 0x21a8, 23 },
+ { 0x21b5, 449 },
+ { 0x2219, 249 },
+ { 0x221a, 251 },
+ { 0x221e, 236 },
+ { 0x221f, 28 },
+ { 0x2229, 239 },
+ { 0x2248, 247 },
+ { 0x2260, 448 },
+ { 0x2261, 240 },
+ { 0x2264, 243 },
+ { 0x2265, 242 },
+ { 0x22c5, 7 },
+ { 0x2302, 127 },
+ { 0x2310, 169 },
+ { 0x2320, 244 },
+ { 0x2321, 245 },
+ { 0x2409, 442 },
+ { 0x240a, 445 },
+ { 0x240b, 447 },
+ { 0x240c, 443 },
+ { 0x240d, 444 },
+ { 0x2423, 32 }, // Should be fixed
+ { 0x2424, 446 },
+ { 0x2500, 196 },
+ { 0x2501, 205 }, // (*1)
+ { 0x2502, 179 },
+ { 0x2503, 186 }, // (*1)
+ { 0x250c, 218 },
+ { 0x250f, 201 }, // (*1)
+ { 0x2510, 191 },
+ { 0x2513, 187 }, // (*1)
+ { 0x2514, 192 },
+ { 0x2517, 200 }, // (*1)
+ { 0x2518, 217 },
+ { 0x251b, 188 }, // (*1)
+ { 0x251c, 195 },
+ { 0x2523, 204 }, // (*1)
+ { 0x2524, 180 },
+ { 0x252b, 185 }, // (*1)
+ { 0x252c, 194 },
+ { 0x2533, 203 }, // (*1)
+ { 0x2534, 193 },
+ { 0x253b, 202 }, // (*1)
+ { 0x253c, 197 },
+ { 0x254b, 206 }, // (*1)
+ { 0x2550, 205 },
+ { 0x2551, 186 },
+ { 0x2552, 213 },
+ { 0x2553, 214 },
+ { 0x2554, 201 },
+ { 0x2555, 184 },
+ { 0x2556, 183 },
+ { 0x2557, 187 },
+ { 0x2558, 212 },
+ { 0x2559, 211 },
+ { 0x255a, 200 },
+ { 0x255b, 190 },
+ { 0x255c, 189 },
+ { 0x255d, 188 },
+ { 0x255e, 198 },
+ { 0x255f, 199 },
+ { 0x2560, 204 },
+ { 0x2561, 181 },
+ { 0x2562, 182 },
+ { 0x2563, 185 },
+ { 0x2564, 209 },
+ { 0x2565, 210 },
+ { 0x2566, 203 },
+ { 0x2567, 207 },
+ { 0x2568, 208 },
+ { 0x2569, 202 },
+ { 0x256a, 216 },
+ { 0x256b, 215 },
+ { 0x256c, 206 },
+ { 0x2574, 455 },
+ { 0x2575, 452 },
+ { 0x2576, 453 },
+ { 0x2577, 454 },
+ { 0x2578, 460 },
+ { 0x2579, 457 },
+ { 0x257a, 458 },
+ { 0x257b, 459 },
+ { 0x2580, 223 },
+ { 0x2584, 220 },
+ { 0x2588, 219 },
+ { 0x258c, 221 },
+ { 0x2590, 222 },
+ { 0x2591, 176 },
+ { 0x2592, 177 },
+ { 0x2593, 178 },
+ { 0x25a0, 254 },
+ { 0x25ac, 22 },
+ { 0x25b2, 30 },
+ { 0x25b6, 16 },
+ { 0x25bc, 31 },
+ { 0x25c0, 17 },
+ { 0x25c6, 4 },
+ { 0x25cb, 9 },
+ { 0x25d8, 8 },
+ { 0x25d9, 10 },
+ { 0x25e6, 8 },
+ { 0x2609, 15 },
+ { 0x263a, 1 },
+ { 0x263b, 2 },
+ { 0x263c, 15 },
+ { 0x2640, 12 },
+ { 0x2642, 11 },
+ { 0x2660, 6 },
+ { 0x2663, 5 },
+ { 0x2665, 3 },
+ { 0x2666, 4 },
+ { 0x266a, 13 },
+ { 0x266b, 14 },
+ { 0x2764, 3 },
+ { 0xf800, 451 }, // Approximation
+ { 0xf801, 451 },
+ { 0xf803, 456 },
+ { 0xf804, 456 }, // Approximation
+ { 0xfffd, 439 }
+};
+
+// Notes:
+// (*1) Linux lat1 says this. I think this is wrong and in fact XFree86 10x20
+// font author interprets Unicode tables as me.
+// The 205 symbol is Unicode 0x2550, of course it can be used as a default
+// for 0x2501. 0x2550 is double line and 0x2501 is one line that is the
+// double in width. The same is for all the other cases.
+
+
+const int TVCodePage::providedUnicodes=sizeof(TVCodePage::InternalMap)/sizeof(stIntCodePairs);
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds which unicode is represented by the specified internal code.
+Currently that's an slow search because isn't used very much.
+
+ Return: The first unicode found.
+
+***************************************************************************/
+
+uint16 TVCodePage::UnicodeForInternalCode(uint16 value)
+{
+ int i;
+ for (i=0; i<providedUnicodes; i++)
+ if (InternalMap[i].code==value)
+ return InternalMap[i].unicode;
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds which internal code can render an Unicode value.
+
+ Return: The internal or -1 if none can do it.
+
+***************************************************************************/
+
+int TVCodePage::InternalCodeForUnicode(ushort unicode)
+{
+ if (!unicode) return 0;
+ stIntCodePairs s={unicode,0};
+ void *res=bsearch(&s,InternalMap,providedUnicodes,sizeof(stIntCodePairs),compare);
+ return res ? ((stIntCodePairs *)res)->code : -1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates a new code page from an arry containing the unicodes for each
+symbol. Use an id over than 0x7FFF8000 to avoid collisions. This is used by
+the Linux driver when the unicodes maps doesn't match with known cp.
+
+***************************************************************************/
+
+void TVCodePage::CreateCPFromUnicode(CodePage *cp, int id, const char *name,
+ ushort *unicodes)
+{
+ // Create a code page
+ strcpy(cp->Name,name);
+ cp->id=id;
+ int i;
+ for (i=128; i<256; i++)
+ {
+ int v=unicodes[i];
+ if (v==0xFFFF)
+ cp->Font[i-128]=0;
+ else
+ {
+ v=InternalCodeForUnicode(v);
+ cp->Font[i-128]=v==-1 ? 0 : v;
+ }
+ }
+ // Currently we lack an Unicode toupper/lower and isalpha mechanism
+ cp->UpLow=cp->MoreLetters=NULL;
+ cp->LowRemapNum=128;
+ cp->LowRemap=new ushort[128];
+ for (i=0; i<128; i++)
+ {
+ int v=unicodes[i];
+ if (v==0xFFFF)
+ cp->LowRemap[i]=0;
+ else
+ {
+ v=InternalCodeForUnicode(v);
+ cp->LowRemap[i]=v==-1 ? 0 : v;
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Adds a custom code page to the list. You can create a new one from an
+array containing the Unicodes for each symbol. @x{::CreateCPFromUnicode}.
+
+ Return: The index of the new code page in the collection.
+
+***************************************************************************/
+
+ccIndex TVCodePage::AddCodePage(CodePage *cp)
+{
+ if (!CodePages) // Drivers could need to add custom cps before init.
+ CreateCodePagesCol();
+ return CodePages->insert(cp);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This is a helper for the TVFontCollection class the parameters of this
+function could change in the future.@*
+ Basically it finds a replacement for a missing symbol in a font. It allows
+using incomplete font.
+
+ Return: The replacement or -1 if none known.
+
+***************************************************************************/
+
+int TVCodePage::LookSimilarInRange(int code, int last)
+{
+ while (code>last && !(code>=' ' && code<='~'))
+ {
+ if (code<256)
+ code=Similar[code];
+ else
+ code=Similar2[code-256];
+ }
+ return code>last ? -1 : code;
+}
+
diff --git a/tvision/classes/configfile.cc b/tvision/classes/configfile.cc
new file mode 100644
index 0000000..4035e63
--- /dev/null
+++ b/tvision/classes/configfile.cc
@@ -0,0 +1,953 @@
+/**[txh]********************************************************************
+
+ Copyright 2002-2009 by Salvador Eduardo Tropea (SET)
+ This file is covered by the GPL license.
+
+ Module: Config File
+ Include: TVConfigFile
+ Comments:
+ This module provides the TVConfigFile class. This class can load a
+configuration file containing sections and variables. Each section have
+a name which is indicated using brackets [Name]. As sections can be nested
+and my text editor can indent using the braces as reference (also jump to
+the start/end of a block and highlight the pair) the section's body must
+be enclosed using braces. Sections can be nested conforming an structure
+that resembles a file system. Inside a section you can define variables. A
+variable name must be composed of a-zA-Z_0-9 characters. After the name, and
+in the same line, an equal sign must be put. The value after the equal sign
+can be a number (decimal, octal or hexadecimal as in C) or a string enclosed
+using double quotes. You can use spaces around the equal sign and after the
+value but you must finish a definition in one line. Comments are started
+with a # symbol and ends at the end of the line.@p
+ The information from a configuration file is stored in memory as a tree.
+You can search in the tree some key indicating it as a you indicate a path
+and file name. Just think it as a particular file system, just use forward
+slashes.
+
+***************************************************************************/
+
+#define Uses_getline
+#define Uses_stdio
+#define Uses_ctype
+#define Uses_string
+#define Uses_stdlib
+#define Uses_TVConfigFile
+#define Uses_sys_stat
+#define Uses_AllocLocal
+#include <tv.h>
+
+// Currently I don't want to expose these things:
+// Type of nodes
+const char tBranch=0, tInteger=1, tString=2;
+
+const char *TVConfigFile::Errors[]=
+{
+ __("Can't open file"), // -1
+ __("Comment inside section name"), // -2
+ __("Unterminated section name"), // -3
+ __("Empty section name"), // -4
+ __("Syntax error"), // -5
+ __("Missing open section {"), // -6
+ __("Missing close section }"), // -7
+ __("Missing equal sign"), // -8
+ __("Missing value after equal"), // -9
+ __("Unterminated string"), // -10
+ __("Non branch in base"), // -11
+ __("Trying to overwrite a value with a section"), // -12
+ __("Trying to overwrite a section with a value") // -13
+};
+
+/**[txh]********************************************************************
+
+ Description:
+ Initializes the class and reads the contents of the specified file to a
+tree in memory.
+
+***************************************************************************/
+
+TVConfigFile::TVConfigFile()
+{
+ tree.next=NULL;
+ sLine=0;
+ line=NULL;
+ ErrorStatus=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Searchs for the indicated key in the tree. Separate nested sections using
+forward slashes.
+
+ Return: not 0 if the key was found, the return value is in @<var>{p} if
+the key is an string. Otherwise @<var>{p} is NULL and the value is in
+@<var>{n}.
+
+***************************************************************************/
+
+int TVConfigFile::Search(const char *key, char *&p, long &n)
+{
+ if (!key) return 0;
+ p=NULL;
+ char *copy=newStr(key);
+ strtok(copy,"/");
+ int ret=SearchInBranch(tree.next,copy,p,n);
+ delete[] copy;
+ return ret;
+}
+
+
+int TVConfigFile::EatSpaces()
+{
+ for (; *s && *s!='\n' && isspace(*s) && *s!='#'; s++);
+ return !*s || *s=='#';
+}
+
+int TVConfigFile::GetLine()
+{
+ ssize_t read=CLY_getline(&line,&sLine,f);
+ if (read==-1) return -1;
+ s=line;
+ ErrorLine++;
+ // Eat the EOL
+ if (read && line[read-1]=='\n')
+ {
+ line[read-1]=0;
+ return read-1;
+ }
+ return read;
+}
+
+char *TVConfigFile::newStrL(const char *start, int len)
+{
+ char *ret=new char[len+1];
+ memcpy(ret,start,len);
+ ret[len]=0;
+ return ret;
+}
+
+TVConfigFileTreeNode *TVConfigFile::NewBranch(const char *name, int len)
+{
+ TVConfigFileTreeNode *aux=new TVConfigFileTreeNode;
+ aux->type=tBranch;
+ aux->content=NULL;
+ aux->next=NULL;
+ aux->name=newStrL(name,len);
+ return aux;
+}
+
+int TVConfigFile::IsWordChar(int val)
+{
+ return isalnum(val) || val=='_';
+}
+
+char *TVConfigFile::GetString()
+{
+ char *start=++s;
+ int len;
+ for (len=1; *s && *s!='"'; len++, s++)
+ if (*s=='\\' && s[1]) s++;
+ if (*s!='"')
+ return 0;
+ s++;
+ char *ret=new char[len+1], *ori, *dest;
+ for (ori=start, dest=ret; *ori && *ori!='"'; ori++, dest++)
+ if (*ori=='\\')
+ {
+ ori++;
+ switch (*ori)
+ {
+ case 'n':
+ *dest='\n';
+ break;
+ case 'r':
+ *dest='\r';
+ break;
+ case 't':
+ *dest='\t';
+ break;
+ default:
+ *dest=*ori;
+ }
+ }
+ else
+ *dest=*ori;
+ *dest=0;
+ return ret;//newStrL(start,s-start-1);
+}
+
+long TVConfigFile::GetInteger()
+{
+ char *end;
+ long value;
+ value=strtol(s,&end,0);
+ s=end;
+ return value;
+}
+
+int TVConfigFile::ReadBranch(TVConfigFileTreeNode *&base)
+{
+ int cant=0, ret;
+ char *start, *end;
+ TVConfigFileTreeNode *aux, *last=base;
+
+ while (last && last->next) last=last->next;
+
+ // Look for the open section character
+ do
+ {
+ if (!EatSpaces())
+ {
+ if (*s!='{') return -6;
+ s++;
+ break;
+ }
+ }
+ while (GetLine()!=-1);
+
+ do
+ {
+ if (EatSpaces()) continue;
+ do
+ {
+ if (*s=='[')
+ {
+ start=++s;
+ if (*s==']') return -4;
+ for (; *s && *s!=']' && *s!='#'; s++);
+ if (*s=='#') return -2;
+ if (!*s) return -3;
+
+ aux=SearchOnlyInBranch(base,start,s-start);
+ if (aux)
+ { // We already have it
+ if (aux->type!=tBranch) return -12;
+ s++;
+ ret=ReadBranch(aux->content);
+ }
+ else
+ { // New one
+ aux=NewBranch(start,s-start);
+ aux->priority=fromFile;
+ //printf("New Branch 2: %s\n",aux->name);
+ if (base)
+ {
+ last->next=aux;
+ last=aux;
+ }
+ else
+ base=last=aux;
+ s++;
+ ret=ReadBranch(aux->content);
+ }
+ if (ret<0) return ret;
+
+ cant+=ret;
+ EatSpaces();
+ }
+ if (*s=='}')
+ {
+ s++;
+ return cant;
+ }
+ if (IsWordChar(*s))
+ {
+ start=s;
+ for (; IsWordChar(*s); s++);
+ end=s;
+ if (EatSpaces() || *s!='=') return -8;
+ s++;
+ if (EatSpaces()) return -9;
+ int lenVar=s-start-1;
+ // Be sure we can get the value
+ char *string=NULL;
+ long integer=0;
+ if (*s=='"')
+ {
+ string=GetString();
+ if (!string) return -10;
+ }
+ else if (isdigit(*s))
+ {
+ integer=GetInteger();
+ }
+ else
+ return -10;
+ // Is already there?
+ int newOne=0;
+ aux=SearchOnlyInBranch(base,start,lenVar);
+ if (aux)
+ { // We already have it
+ if (aux->type==tBranch) return -13;
+ if (aux->priority>fromFile)
+ aux=NULL;
+ else
+ if (aux->type==tString) delete[] aux->string;
+ }
+ else
+ {
+ aux=new TVConfigFileTreeNode;
+ newOne=1;
+ }
+
+ if (aux)
+ {
+ if (string)
+ {
+ aux->string=string;
+ aux->type=tString;
+ }
+ else
+ {
+ aux->integer=integer;
+ aux->type=tInteger;
+ }
+ if (newOne)
+ aux->name=newStrL(start,end-start);
+ aux->next=NULL;
+ aux->priority=fromFile;
+ /*if (aux->type==tString)
+ printf("New String: %s=\"%s\"\n",aux->name,aux->string);
+ else
+ printf("New Integer: %s=%d\n",aux->name,aux->integer);*/
+ if (newOne)
+ {
+ if (base)
+ {
+ last->next=aux;
+ last=aux;
+ }
+ else
+ base=last=aux;
+ }
+ cant++;
+ }
+ EatSpaces();
+ }
+ else
+ if (*s && *s!='[' && *s!='#')
+ return -5;
+ }
+ while (*s && *s!='#');
+ }
+ while (GetLine()!=-1);
+ return -7;
+}
+
+int TVConfigFile::ReadBase(TVConfigFileTreeNode *&base)
+{
+ int cant=0, ret;
+ char *start;
+ TVConfigFileTreeNode *aux, *last=base;
+
+ while (last && last->next) last=last->next;
+
+ while (GetLine()!=-1)
+ {
+ if (EatSpaces()) continue;
+ do
+ {
+ if (*s=='[')
+ {
+ start=++s;
+ if (*s==']') return -4;
+ for (; *s && *s!=']' && *s!='#'; s++);
+ if (*s=='#') return -2;
+ if (!*s) return -3;
+ aux=SearchOnlyInBranch(base,start,s-start);
+ if (aux)
+ { // We already have it
+ if (aux->type!=tBranch) return -11;
+ s++;
+ ret=ReadBranch(aux->content);
+ }
+ else
+ { // New one
+ aux=NewBranch(start,s-start);
+ aux->priority=fromFile;
+ //printf("New Branch 1: %s\n",aux->name);
+ if (base)
+ {
+ last->next=aux;
+ last=aux;
+ }
+ else
+ base=last=aux;
+ s++;
+ ret=ReadBranch(aux->content);
+ }
+ if (ret<0) return ret;
+ cant+=ret;
+ EatSpaces();
+ }
+ if (*s && *s!='#' && *s!='[')
+ return -5;
+ }
+ while (*s && *s!='#');
+ }
+ return cant;
+}
+
+TVConfigFileTreeNode *TVConfigFile::SearchOnlyInBranch(TVConfigFileTreeNode *b,
+ char *name, int len)
+{
+ if (!b) return NULL;
+ AllocLocalStr(key,len+1);
+ memcpy(key,name,len);
+ key[len]=0;
+ return SearchOnlyInBranch(b,key);
+}
+
+TVConfigFileTreeNode *TVConfigFile::SearchOnlyInBranch(TVConfigFileTreeNode *b,
+ char *name)
+{
+ if (!b) return NULL;
+ while (b)
+ {
+ if (strcmp(b->name,name)==0)
+ return b;
+ b=b->next;
+ }
+ return NULL;
+}
+
+int TVConfigFile::SearchInBranch(TVConfigFileTreeNode *b, char *key, char *&p, long &n)
+{
+ if (!key || !b) return 0;
+ while (b)
+ {
+ if (strcmp(b->name,key)==0)
+ {
+ switch (b->type)
+ {
+ case tBranch:
+ return SearchInBranch(b->content,strtok(NULL,"/"),p,n);
+ case tString:
+ p=b->string;
+ break;
+ case tInteger:
+ n=b->integer;
+ break;
+ }
+ return 1;
+ }
+ b=b->next;
+ }
+ return 0;
+}
+
+int TVConfigFile::Read(const char *file)
+{
+ ErrorLine=0;
+ f=fopen(file,"rt");
+ if (!f)
+ return -1;
+ int ret=ReadBase(tree.next);
+
+ // Free the line
+ free(line);
+ line=NULL;
+ sLine=0;
+
+ fclose(f);
+ return ret;
+}
+
+int TVConfigFile::Add(const char *key, TVConfigFileTreeNode *node)
+{
+ int len=strlen(key);
+ AllocLocalStr(b,len+1);
+ strcpy(b,key);
+
+ // Create/navigate the "directories"
+ TVConfigFileTreeNode *where=tree.next, **parent=&tree.next, *p;
+ char *val=strtok(b,"/");
+ while (val)
+ {
+ p=SearchOnlyInBranch(where,val);
+ if (p)
+ {
+ parent=&p->content;
+ where=p->content;
+ }
+ else
+ {
+ TVConfigFileTreeNode *aux=NewBranch(val,len);
+ aux->priority=node->priority;
+ if (where)
+ {// At the end
+ TVConfigFileTreeNode *p=where;
+ while (p->next) p=p->next;
+ p->next=aux;
+ }
+ else
+ *parent=aux;
+ parent=&aux->content;
+ where=NULL;
+ }
+ val=strtok(NULL,"/");
+ }
+ // Now put the value
+ p=SearchOnlyInBranch(where,node->name);
+ if (p)
+ {
+ if (p->type==tBranch)
+ {
+ ErrorStatus=-13;
+ return 0;
+ }
+ if (p->priority>node->priority) return 0;
+ if (p->type==tString)
+ delete[] p->string;
+ node->next=p->next;
+ memcpy(p,node,sizeof(TVConfigFileTreeNode));
+ }
+ else
+ {
+ if (where)
+ {// At the end
+ TVConfigFileTreeNode *b=where;
+ while (b->next) b=b->next;
+ b->next=node;
+ }
+ else
+ *parent=node;
+ }
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Adds a new variable to the tree. The type of the variable is integer. The
+@<var>{name} variable is added to the section indicated by @<var>{key}.
+Possible priority values are justHint (25), fromFile (50) or fromApplication
+(75). It is used to determine if a current value should be replaced by the
+new value. The name is copied.
+
+ Return: !=0 if the variable was added.
+ Example: TVConfigFile::AddInt("TV/X11","ScreenWidth",90,
+TVConfigFile::fromFile)
+
+***************************************************************************/
+
+int TVConfigFile::AddInt(const char *key, const char *name, long value, int priority)
+{
+ TVConfigFileTreeNode *node=new TVConfigFileTreeNode;
+ node->type=tInteger;
+ node->priority=priority;
+ node->integer=value;
+ node->name=newStr(name);
+ node->next=NULL;
+ if (!Add(key,node))
+ {
+ DeleteArray(node->name);
+ delete node;
+ return 0;
+ }
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Adds a new variable to the tree. The type of the variable is string. The
+@<var>{name} variable is added to the section indicated by @<var>{key}.
+Possible priority values are justHint (25), fromFile (50) or fromApplication
+(75). It is used to determine if a current value should be replaced by the
+new value. The name and the content are copied.
+
+ Return: !=0 if the variable was added.
+ Example: TVConfigFile::AddInt("TV/X11","ExtProgVideoMode","A_Program",
+TVConfigFile::fromFile)
+
+***************************************************************************/
+
+int TVConfigFile::AddString(const char *key, const char *name,
+ const char *value, int priority)
+{
+ TVConfigFileTreeNode *node=new TVConfigFileTreeNode;
+ node->type=tString;
+ node->priority=priority;
+ node->string=newStr(value);
+ node->name=newStr(name);
+ node->next=NULL;
+ if (!Add(key,node))
+ {
+ DeleteArray(node->name);
+ DeleteArray(node->string);
+ delete node;
+ return 0;
+ }
+ return 1;
+}
+
+void TVConfigFile::FreeList(TVConfigFileTreeNode *p)
+{
+ TVConfigFileTreeNode *start=p,*aux;
+ // First pass is for recursion
+ while (p)
+ {
+ if (p->type==tBranch)
+ FreeList(p->content);
+ p=p->next;
+ }
+ p=start;
+ // Second pass frees it
+ while (p)
+ {
+ aux=p->next;
+ if (p->type==tString)
+ delete[] p->string;
+ delete[] p->name;
+ delete p;
+ p=aux;
+ }
+}
+
+void TVConfigFile::FreeTree()
+{
+ FreeList(tree.next);
+}
+
+void TVConfigFile::PrintIndent(int indent, FILE *f)
+{
+ int i;
+ for (i=indent; i; --i) fputc(' ',f);
+}
+
+void TVConfigFile::PrintBranch(TVConfigFileTreeNode *base, int indent, FILE *f)
+{
+ while (base)
+ {
+ switch (base->type)
+ {
+ case tBranch:
+ PrintIndent(indent,f);
+ fprintf(f,"[%s]\n",base->name);
+ PrintIndent(indent,f);
+ fputs("{\n",f);
+ PrintBranch(base->content,indent+1,f);
+ PrintIndent(indent,f);
+ fputs("}\n",f);
+ break;
+ case tString:
+ PrintIndent(indent,f);
+ fprintf(f,"%s=\"%s\"\n",base->name,base->string);
+ break;
+ case tInteger:
+ PrintIndent(indent,f);
+ fprintf(f,"%s=%ld\n",base->name,base->integer);
+ break;
+ }
+ base=base->next;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Prints the current tree to the specified file. It's main purpose is to
+debug programs, but you can use it to generate valid configuration files
+from data found in memory.
+
+***************************************************************************/
+
+void TVConfigFile::Print(FILE *f)
+{
+ PrintBranch(tree.next,0,f);
+}
+
+// Inline members just documented here.
+/**[txh]**
+ Function: ~TVConfigFile
+ Prototype: ~TVConfigFile()
+ Description:
+ This is the destructor and just releases the tree that contains the
+variables.
+*********/
+/**[txh]**
+ Function: Load
+ Prototype: int Load(const char *file)
+ Description: Reads the specified configuration file.
+ Return: The read status, 0 means no error. The @<var>{Errors} data member
+contains descriptions for the errors.
+*********/
+
+/*****************************************************************************
+ That's a special case used to configure the library.
+*****************************************************************************/
+
+TVConfigFile *TVMainConfigFile::config=NULL;
+const char *TVMainConfigFile::userConfigFile=NULL;
+const char *configFileName="tvrc";
+#if CLY_HiddenDifferent
+const char *configFileNameH=".tvrc";
+#endif
+
+/**[txh]********************************************************************
+
+ Class: TVMainConfigFile
+ Description:
+ This is the constructor for TVMainConfigFile. This class is a special case
+of TVConfigFile used for the Turbo Vision configuration file. Note you can
+store application specific information in the configuration file using a
+section different than TV.
+
+***************************************************************************/
+
+TVMainConfigFile::TVMainConfigFile()
+{
+ config=new TVConfigFile();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Loads the configuration file. First we try using the application provided
+name, then we search in the current directory, the path indicated by the
+HOME environment variable, the path indicated by the HOMEDIR environment
+variable, /etc and /dev/env/DJDIR/etc (%DJDIR%/etc). The default name for
+the file is tvrc, if the OS uses a point in the name to make it a hidden file
+the library also tries with .tvrc.
+
+ Return: The error status. 0 is OK.
+
+***************************************************************************/
+
+int TVMainConfigFile::Load()
+{
+ // Load the configuration file
+ char *name=NULL;
+ if (userConfigFile)
+ {
+ struct stat st;
+ if (stat(userConfigFile,&st)==0 && S_ISREG(st.st_mode))
+ name=newStr(userConfigFile);
+ }
+ if (!name)
+ {
+ name=TestForFileIn(".");
+ if (!name)
+ {
+ char *home=getenv("HOME");
+ if (home)
+ name=TestForFileIn(home);
+ if (!name)
+ {
+ home=getenv("HOMEDIR");
+ if (home)
+ name=TestForFileIn(home);
+ if (!name)
+ {
+ name=TestForFileIn("/etc");
+ if (!name)
+ {// DJGPP trick
+ name=TestForFileIn("/dev/env/DJDIR/etc");
+ }
+ }
+ }
+ }
+ }
+ if (name)
+ {
+ //printf("Loading configuration from %s\n",name);
+ config->Load(name);
+ delete[] name;
+ }
+ //config->Print(stderr);
+ return config->ErrorStatus;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Destroys the global TVConfigFile that contains the configuration.
+
+***************************************************************************/
+
+TVMainConfigFile::~TVMainConfigFile()
+{
+ delete config;
+ config=NULL;
+}
+
+char *TVMainConfigFile::TestForFileIn(const char *where)
+{
+ AllocLocalStr(b,strlen(where)+strlen(configFileName)+3);
+ struct stat st;
+
+ strcpy(b,where);
+ strcat(b,"/");
+ strcat(b,configFileName);
+ if (stat(b,&st)==0 && S_ISREG(st.st_mode))
+ return newStr(b);
+
+ #if CLY_HiddenDifferent
+ strcpy(b,where);
+ strcat(b,"/");
+ strcat(b,configFileNameH);
+ if (stat(b,&st)==0 && S_ISREG(st.st_mode))
+ return newStr(b);
+ #endif
+
+ return NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Looks for the specified key in the TV section. If found the result is
+stored in @<var>{val}, but only if that's an integer.
+
+ Return: True if the key exists, even when that's an string.
+
+***************************************************************************/
+
+Boolean TVMainConfigFile::Search(const char *key, long &val)
+{
+ if (!config || !key) return False;
+ AllocLocalStr(b,strlen(key)+4);
+ strcpy(b,"TV/");
+ strcat(b,key);
+ char *v;
+ return config->Search(b,v,val) ? True : False;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Looks for the specified @var{variable} in the TV section using the
+specified @var{section} as subsection. If found the result is
+stored in @<var>{val}, but only if that's an integer.
+
+ Return: True if the key exists, even when that's an string.
+
+***************************************************************************/
+
+Boolean TVMainConfigFile::Search(const char *section, const char *variable, long &val)
+{
+ if (!config || !section || !variable) return False;
+ AllocLocalStr(b,strlen(section)+strlen(variable)+5);
+ strcpy(b,"TV/");
+ strcat(b,section);
+ strcat(b,"/");
+ strcat(b,variable);
+ char *v;
+ return config->Search(b,v,val) ? True : False;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Looks for the specified key in the TV section. If found the result is
+returned but only if that's a string.
+
+ Return: The string or NULL.
+
+***************************************************************************/
+
+char *TVMainConfigFile::Search(const char *key)
+{
+ if (!config || !key) return NULL;
+ AllocLocalStr(b,strlen(key)+4);
+ strcpy(b,"TV/");
+ strcat(b,key);
+ long n; char *v=NULL;
+ config->Search(b,v,n);
+ return v;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Looks for the specified @var{variable} in the TV section using the
+specified @var{section} as subsection. If found the result is returned but
+only if that's a string.
+
+ Return: The string or NULL.
+
+***************************************************************************/
+
+char *TVMainConfigFile::Search(const char *section, const char *variable)
+{
+ if (!config || !section || !variable) return NULL;
+ AllocLocalStr(b,strlen(section)+strlen(variable)+5);
+ strcpy(b,"TV/");
+ strcat(b,section);
+ strcat(b,"/");
+ strcat(b,variable);
+ long n; char *v=NULL;
+ config->Search(b,v,n);
+ return v;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Adds a new variable of integer type to the TV subtree in the specified
+@<var>{section} and using the specified @<var>{name}. The priority for this
+variable is TVConfigFile::fromApplication. @x{TVConfigFile::AddInt}.
+
+ Return: !=0 if added.
+
+***************************************************************************/
+
+int TVMainConfigFile::Add(const char *section, const char *name, long value)
+{
+ int lSection=section ? strlen(section)+1 : 0;
+ AllocLocalStr(b,lSection+4);
+ strcpy(b,"TV");
+ if (section)
+ {
+ b[2]='/';
+ strcpy(b+3,section);
+ }
+ return config->AddInt(b,name,value,TVConfigFile::fromApplication);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Adds a new variable of string type to the TV subtree in the specified
+@<var>{section} and using the specified @<var>{name}. The priority for this
+variable is TVConfigFile::fromApplication. The string is copied.
+@x{TVConfigFile::AddInt}.
+
+ Return: !=0 if added.
+
+***************************************************************************/
+
+int TVMainConfigFile::Add(const char *section, const char *name,
+ const char *value)
+{
+ int lSection=section ? strlen(section)+1 : 0;
+ AllocLocalStr(b,lSection+4);
+ strcpy(b,"TV");
+ if (section)
+ {
+ b[2]='/';
+ strcpy(b+3,section);
+ }
+ return config->AddString(b,name,value,TVConfigFile::fromApplication);
+}
+
+// Inline members just documented here.
+/**[txh]**
+ Function: Print
+ Prototype: void TVMainConfigFile::Print(FILE *f)
+ Class: TVMainConfigFile
+ Description:
+ Prints the current tree to the specified file. It's main purpose is to
+debug programs, but you can use it to generate valid configuration files
+from data found in memory.
+*********/
+/**[txh]**
+ Function: SetUserConfigFile
+ Prototype: void TVMainConfigFile::SetUserConfigFile(const char *name)
+ Class: TVMainConfigFile
+ Description: Specifies a name and path for the configuration file. Use it
+if your application needs special settings different than the rest of the
+TV applications.
+*********/
+
diff --git a/tvision/classes/dos/dosdis.cc b/tvision/classes/dos/dosdis.cc
new file mode 100644
index 0000000..7a38458
--- /dev/null
+++ b/tvision/classes/dos/dosdis.cc
@@ -0,0 +1,805 @@
+/**[txh]********************************************************************
+
+ DOS Display (TDisplayDOS) functions.
+
+ Copyright (c) 1996-1998 by Robert H”hne.
+ Copyright (c) 1998-2002 by Salvador E. Tropea (SET)
+ Tweaked video modes by Christian Domp <chrisd@europeonline.com>
+
+ Module: DOS Display
+ Comments:
+ This module implements the low level DOS screen access.@p
+
+ Todo:@*
+ * The palette map could be changed during suspend. Currently not
+ suported. But is a really bizarre case and is restored if VGA state saving
+ is used.
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+//#define Uses_stdio
+#define Uses_stdlib
+#define Uses_string
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TFrame
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVCompf_djgpp
+
+#include <conio.h>
+#include <dos.h>
+#include <go32.h>
+#include <dpmi.h>
+#include <pc.h>
+#include <sys/farptr.h>
+#include <errno.h>
+#include <sys/movedata.h>
+
+#define TSCREEN_DEFINE_REGISTERS
+#include <tv/dos/screen.h>
+#include <tv/dos/mouse.h>
+
+// In early versions Robert experimented with pages now it isn't used but
+// some simple future driver could do it.
+#define GetPage() 0
+
+// This could be needed for Windows XP Professional, not sure.
+// Disabled until I get positive confirmation.
+//#define XP_CURSOR_SHAPE_WORKAROUND 1
+
+// x86 registers used for BIOS calls
+__dpmi_regs TDisplayDOS::rDisplay;
+// Numbers of lines of each character (height in pixels)
+unsigned TDisplayDOS::charLines=16;
+// Flag to indicate if the video mode should ask the mouse class to draw
+// the cursor instead of letting the OS mouse driver do it.
+char TDisplayDOS::emulateMouse=0;
+char TDisplayDOS::colorsMap[17];
+
+// Video BIOS services
+#define SET_TEXT_MODE_CURSOR_SHAPE 0x01
+#define SET_CURSOR_POSITION 0x02
+#define GET_CURSOR_POSITION_AND_SIZE 0x03
+#define READ_ALL_PALETTE_REGISTERS_AND_OVERSCAN_REGISTER 0x1009
+#define SET_INDIVIDUAL_DAC_REGISTER 0x1010
+#define READ_INDIVIDUAL_DAC_REGISTER 0x1015
+#define ALTERNATE_FUNCTION_SELECT 0x12
+#define SELECT_VERTICAL_RESOLUTION 0x30
+
+const int crtIndex=0x3B4,crtData=0x3B5;
+const int mdaCursorLocationHigh=0x0E,mdaCursorLocationLow=0x0F;
+const int mdaCursorStart=0x0A,mdaCursorEnd=0x0B;
+
+static inline
+unsigned char InMDA(unsigned char i)
+{
+ outportb(crtIndex,i);
+ return inportb(crtData);
+}
+
+static inline
+void OutMDA(unsigned char i,unsigned char b)
+{
+ outportb(crtIndex,i);
+ outportb(crtData,b);
+}
+
+void TDisplayDOS::SetCursorPos(unsigned x, unsigned y)
+{
+ if (dual_display || TScreenDOS::screenMode==7)
+ {
+ unsigned loc=y*80+x;
+ OutMDA(mdaCursorLocationHigh,loc>>8);
+ OutMDA(mdaCursorLocationLow ,loc & 0xFF);
+ }
+ else
+ {
+ DH=y;
+ DL=x;
+ BH=GetPage();
+ AH=SET_CURSOR_POSITION;
+ videoInt();
+ }
+}
+
+void TDisplayDOS::GetCursorPos(unsigned &x, unsigned &y)
+{
+ if (dual_display)
+ {
+ unsigned pos=(InMDA(mdaCursorLocationHigh)<<8) |
+ InMDA(mdaCursorLocationLow);
+ y=pos/80;
+ x=pos%80;
+ }
+ else
+ {
+ AH=GET_CURSOR_POSITION_AND_SIZE;
+ BH=GetPage();
+ videoInt();
+ y=DH;
+ x=DL;
+ }
+}
+
+void TDisplayDOS::GetCursorShape(unsigned &start, unsigned &end)
+{
+ #if XP_CURSOR_SHAPE_WORKAROUND
+ static int searchedXP=0, detectedXP;
+ #endif
+
+ if (dual_display || TScreenDOS::screenMode==7)
+ {
+ start=InMDA(mdaCursorStart)*100/charLines;
+ end =InMDA(mdaCursorEnd)*100/charLines;
+ return;
+ }
+
+ #if XP_CURSOR_SHAPE_WORKAROUND
+ if (!searchedXP)
+ {
+ searchedXP=1;
+ char *OS=getenv("OS");
+ detectedXP=(OS && strcmp(OS,"Windows_NT")==0);
+ }
+ #endif
+
+ AH=GET_CURSOR_POSITION_AND_SIZE;
+ BH=GetPage();
+ videoInt();
+
+ if (CX==0x2000)
+ {
+ start=end=0;
+ return;
+ }
+
+ #if XP_CURSOR_SHAPE_WORKAROUND
+ /* Andris reported:
+ "Noticed big nuisance under WinXP Pro: videoInt at
+ start returns 0x0F0F and as result there is no normal
+ cursor in TVision applications later. This workarounds
+ the problem. AP. 26/09/2004)" */
+ if (detectedXP && CX==0x0F0F)
+ CH--;
+ #endif
+
+ start=CH*100/charLines;
+ end =CL*100/charLines;
+}
+
+void TDisplayDOS::SetCursorShape(unsigned start, unsigned end)
+{
+ if (start>=end && getShowCursorEver())
+ return;
+
+ unsigned lStart=(start*charLines+50)/100;
+ unsigned lEnd=(end*charLines+50)/100;
+
+ if (dual_display || TScreenDOS::screenMode==7)
+ {
+ if (start<=end) // cursor off
+ {// Is that really needed?
+ OutMDA(mdaCursorStart,0x01);
+ OutMDA(mdaCursorEnd,0x00);
+ }
+ else
+ {
+ OutMDA(mdaCursorStart,lStart);
+ OutMDA(mdaCursorEnd,lEnd);
+ }
+ return;
+ }
+ AH=SET_TEXT_MODE_CURSOR_SHAPE;
+ BH=GetPage();
+ if (start>=end)
+ CX=0x2000;
+ else
+ {
+ CH=lStart;
+ CL=lEnd;
+ }
+ videoInt();
+}
+
+// This isn't correctly implemented, but is OK
+void TDisplayDOS::ClearScreen(uchar , uchar)
+{
+ ScreenClear();
+}
+
+ushort TDisplayDOS::GetRows()
+{
+ return dual_display ? 25 : ScreenRows();
+}
+
+ushort TDisplayDOS::GetCols()
+{
+ return dual_display ? 80 : ScreenCols();
+}
+
+ushort TDisplayDOS::GetCrtMode()
+{
+ ushort mode=ScreenMode();
+ if (mode==smCO80)
+ {
+ // SET: I changed it because was wrong. With STM I can set 108x34 (25% more
+ // resolution, same aspect) but it reports 3
+ int res=getRows()+getCols()*100;
+
+ switch (res)
+ {
+ case 8025:
+ break;
+ case 8028:
+ mode+=0x100;
+ break;
+ case 8035:
+ mode+=0x200;
+ break;
+ case 8040:
+ mode+=0x300;
+ break;
+ case 8043:
+ mode+=0x400;
+ break;
+ case 8050:
+ mode+=0x500;
+ break;
+ case 8030:
+ mode+=0x700;
+ break;
+ case 8034:
+ mode+=0x800;
+ break;
+ case 9030:
+ mode+=0x900;
+ break;
+ case 9034:
+ mode+=0xA00;
+ break;
+ case 9430:
+ mode+=0xB00;
+ break;
+ case 9434:
+ mode+=0xC00;
+ break;
+ case 8225:
+ mode+=0xD00;
+ break;
+ default: // We can reproduce it but isn't mode 3 so if the user_mode
+ // is 3 we MUST do a mode change.
+ mode+=0xFF00;
+ }
+ }
+ return mode;
+}
+
+
+/*****************************************************************************
+ Helper routines
+*****************************************************************************/
+
+void TDisplayDOS::setVideoModeInt()
+{
+ // Windows NT workaround, looks like is something that happends in my
+ // machine but happends.
+ // I tested Windows NT 4.0 spanish, spanish+SP3 and english running in a
+ // TXProII motherboard with a M571 SYS integrated video chip using AMI
+ // BIOS and a K6 233 CPU. The fact is that NT clobbers the time after
+ // setting the video mode, the value that appears is around 512 hours and
+ // looks like that's enough to produce a "divide overflow" exception in the
+ // emulated DOS, it kills the djgpp application.
+ unsigned long v1=_farpeekl(_dos_ds,0x46C);
+
+ videoInt();
+
+ unsigned long v2=_farpeekl(_dos_ds,0x46C);
+ if (v2-v1>65536)
+ { // Come on, switching video modes can't take 1 hour ;-)))
+ _farpokel(_dos_ds,0x46C,v1+5);
+ }
+}
+
+int TDisplayDOS::getCharLines()
+{
+ AX=0x1130;
+ BL=0;
+ videoInt();
+ return CL;
+ #if 0
+ // Some parts of the code used it, but I switched to BIOS version.
+ // I guess here we can trust BIOS, we'll see.
+ outp(0x3D4,9); // CRTC 9
+ return (inp(0x3D5) & 0x1F)+1; // lines per char
+ #endif
+}
+
+/*****************************************************************************
+ VESA and user provided video modes routines
+*****************************************************************************/
+
+void TDisplayDOS::setTextMode(int mode)
+{
+ if (mode>=0x100)
+ { // It should be a VESA mode
+ AX=0x4F02;
+ BX=mode | 0x8000; // do not clear the screen
+ }
+ else
+ {
+ AX=(mode & 0xff) | 0x80; // do not clear the screen
+ }
+ setVideoModeInt();
+ charLines=getCharLines();
+}
+
+/*****************************************************************************
+ Tweaked video modes routines
+*****************************************************************************/
+
+const int numTweakedModes=7;
+const int tw80x30=0, tw80x34=1, tw90x30=2, tw90x34=3, tw94x30=4, tw94x34=5,
+ tw82x25=6; // that's a replacement for 80x25 but with 8 pixels fonts
+
+// Size of the available modes
+static ushort width[] ={80,80,90,90,94,94,82};
+static ushort height[]={30,34,30,34,30,34,25};
+
+/* How to interpret the data, 80x30 example:
+ 0x0c11, Enable writes to index 0-7
+ 0x5f00, 0x5F+5 = 100 = total horizontal chars
+ 0x4f01, 0x4F+1 = 80 = displayed horizontal chars
+ 0x5002, 0x50 = 80 = start of horizontal blank
+ 0x8203, b7: enable access to 10 and 11 b5-b6: Horiz. delay = 0
+ b0-b4 low bits of horiz blank end (2).
+ 0x5504, 0x55 = 85 = start of retrace.
+ 0x8105, b7: b5 of horiz blank end => 100010 = 34 (80+34-100=14)
+ 0x0b06, Vertical total (low 8 bits)
+ 0x3e07, b5: b9 VT, b0: b8 VT => Vertical total 1000001011=523
+ b7: b9 VRS, b2: b8 VRS => 01
+ b6: b9 VDE, b1: b8 VDE => 01
+ b3: b8 VBS => 1
+ 0x4f09, b0-4: 15+1=16 lines characters b5: b9 VBS b6: b9 LCR b7: No double scan
+ 0xea10, Vertical retrace start 0xEA => 0x1EA = 490
+ 0x8c11, Disable access to 0-7, Vertical retrace ends when low bits are 0xC
+ 0xdf12, Vertical Display End 0xDF => 0x1DF = 479 (I think is 16*30=480 -1)
+ 0x2813, 0x28 = 40 => 40*2 = 80 characters per line
+ 0xe715, Vertical Blank Start 0xE7 => 0x1E7 = 487
+ 0x0416 Vertical Blank End 4
+*/
+static unsigned short ttweaks[][16]=
+{
+ { /* 80x30 */
+ 0x0c11,0x5f00,0x4f01,0x5002,0x8203,0x5504,0x8105,0x0b06,
+ 0x3e07,0x4f09,0xea10,0x8c11,0xdf12,0x2813,0xe715,0x0416
+ },
+ { /* 80x34 */
+ 0x0c11,0x5f00,0x4f01,0x5002,0x8203,0x5504,0x8105,0x0b06,
+ 0x3e07,0x4d09,0xea10,0x8c11,0xdf12,0x2813,0xe715,0x0416
+ },
+ { /* 90x30 */
+ 0x0c11,0x6d00,0x5901,0x5a02,0x9003,0x6004,0x8b05,0x0b06,
+ 0x3e07,0x4f09,0xea10,0x8c11,0xdf12,0x2d13,0xe715,0x0416
+ },
+ { /* 90x34 */ /* Corrected for 476 lines, SET */
+ 0x0c11,0x6d00,0x5901,0x5a02,0x9003,0x6004,0x8b05,0x0b06,
+ 0x3e07,0x4d09,0xea10,0x8c11,0xdb12,0x2d13,0xe715,0x0416
+ },
+ { /* 94x30 */
+ 0x0c11,0x6c00,0x5d01,0x5e02,0x8f03,0x6204,0x8e05,0x0b06,
+ 0x3e07,0x4f09,0xea10,0x8c11,0xdf12,0x2f13,0xe715,0x0416
+ },
+ { /* 94x34 */ /* Corrected for 476 lines, SET */
+ 0x0c11,0x6c00,0x5d01,0x5e02,0x8f03,0x6204,0x8e05,0x0b06,
+ 0x3e07,0x4d09,0xea10,0x8c11,0xdb12,0x2f13,0xe715,0x0416
+ },
+ { /* 82x25 */
+ 0x0c11,0x6100,0x5101,0x5202,0x8203,0x5704,0x8105,0xb406,
+ 0x1f07,0x4f09,0x9a10,0x8c11,0x8f12,0x2913,0x9715,0x0016
+ }
+};
+
+int TDisplayDOS::setTweakedMode(int tmode)
+{
+ int i;
+ volatile int junk;
+
+ if (tmode>=numTweakedModes)
+ return -1;
+
+ AX=0x3 | 0x80; // do not clear the screen
+ setVideoModeInt();
+
+ if (height[tmode]==34)
+ {
+ TScreenDOS::SelectFont(14,True); // load 8x14 font for 34 line modes
+ charLines=14;
+ }
+ else
+ {// Tweaked uses BIOS and hence have the 8/9x16 fonts loaded so avoid a
+ // reload
+ TScreenDOS::SelectFont(16);
+ charLines=16;
+ }
+
+ // wait for vertical retrace
+ while ((inportb(0x3da) & 8)!=0);
+ while ((inportb(0x3da) & 8)==0);
+
+ disable();
+ if (tmode==tw82x25)
+ outportb(0x3c2,0x63); // 400 lines, 25 MHz
+ else
+ outportb(0x3c2,0xe7); // 480 lines, 28 MHz
+ // set sequencer clocking mode
+ outportw(0x3c4,0x101);
+ // reset data flip-flop to address mode
+ junk=inportw(0x3da);
+ outportb(0x3c0,0x30);
+ // set mode control register
+ outportb(0x3c0,0x04);
+ outportb(0x3c0,0x33);
+ // set horizontal pixel pan
+ outportb(0x3c0,0x00);
+ for(i = 0; i < 16; i++)
+ outportw(0x3d4,ttweaks[tmode][i]);
+ // update BIOS data area
+ _farsetsel(_dos_ds);
+ _farnspokew(0x44a,width[tmode]);
+ _farnspokeb(0x484,height[tmode]-1);
+ // We must indicate the correct height. Some BIOSes make the cursor
+ // invisible if we forget it.
+ _farnspokew(0x485,charLines);
+ _farnspokew(0x44c,width[tmode]*height[tmode]*2);
+ enable();
+
+ return 0;
+}
+
+/*****************************************************************************
+ Extended video modes routines (80x 28,35,40,43,50)
+*****************************************************************************/
+/*
+ The following code is based on what conio.c does, Robert used it
+ to avoid clearing the screen. I modified it a lot and added the
+ propper fonts handling.
+
+ Note we assumed the board is VGA and it will fail for EGA and MDA.
+*/
+
+// 0: 200, 1: 350, 2: 400
+const int scl200=0, scl350=1, scl400=2;
+
+/* Set screen scan lines and load appropriate font.
+ SCAN_LINES and FONT is the height.
+ SCAN_LINES is as required by Int 10h function 12h. */
+void TDisplayDOS::setExtendedMode(int mode)
+{
+ // Default mode is almost mode 0
+ int scanLines=scl400;
+ charLines=16;
+ Boolean Force=True;
+
+ switch (mode)
+ {
+ case 0: // 25 lines
+ // EGA: setScanLinesAndFont(scl350,14,1);
+ Force=False;
+ break;
+ case 1: // 28 lines VGA only
+ charLines=14;
+ break;
+ case 2: // 35 lines EGA or VGA
+ scanLines=scl350;
+ charLines=10;
+ break;
+ case 3: // 40 lines VGA only
+ charLines=10;
+ break;
+ case 4: // 43 lines EGA or VGA
+ scanLines=scl350;
+ charLines=8;
+ break;
+ case 5: // 50 lines VGA only
+ charLines=8;
+ break;
+ }
+ // Set 200/350/400 scan lines.
+ AH=ALTERNATE_FUNCTION_SELECT;
+ AL=scanLines;
+ BL=SELECT_VERTICAL_RESOLUTION;
+ videoInt();
+
+ // Scan lines setting only takes effect when video mode is set.
+ AX=0x83;
+ setVideoModeInt();
+
+ TScreenDOS::SelectFont(charLines,Force);
+}
+/****************************************************************************/
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to test if a mode that we don't know can be handled by the driver
+or not. If the mode uses an unknown memory region we just assume that's
+a graphics mode and revert to 80x25. It could be enhanced a lot specially to
+support VESA video modes when implemented in a way that the video memory
+isn't located at the usual address.
+
+***************************************************************************/
+
+void TDisplayDOS::testForSupport()
+{
+ // Write a ! at 0,0 position in the video memory
+ // That's a guess, we don't know if that's a real text mode.
+ _farpokeb(_dos_ds,ScreenPrimary,'!');
+ AX=0x200; // Set cursor position
+ BH=0; // Page 0
+ DX=0; // X=Y=0
+ videoInt();
+ AH=0x0A; // Write character only at cursor position
+ AL=' '; // A space to overwrite the !
+ BH=0; // Page 0
+ CX=1; // Just once
+ videoInt();
+ // Check if BIOS changed what we think is 0,0 coordinate
+ if (_farpeekb(_dos_ds,ScreenPrimary)!=' ')
+ {// Nope, BIOS can't do it.
+ // Here we assume this isn't a real text mode and revert to 80x25
+ setTextMode(smCO80);
+ emulateMouse=0;
+ }
+ else
+ {// As this mode could be anything strange we can't assume the mouse driver
+ // can draw the mouse. That's common for VESA modes.
+ // So we draw the cursor `by hand'.
+ emulateMouse=1;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets a video mode from the video mode number. Video modes with the low
+nibble equal 3 are used to encode extended and tweacked video modes. Note
+that VESA 800x600x256 mode is 0x103 and here it is assumed to be extended
+mode 1, that's 80x28. Also note that regular VGA 80x25 mode is the
+"extended mode 0".@*
+ Any other value is assumed to be a user provided video mode and is
+accepted only if we are sure that's really text mode and we know how to
+handle it.
+
+***************************************************************************/
+
+void TDisplayDOS::SetCrtMode(ushort mode)
+{
+ if (TMouse::present())
+ TMouse::hide();
+
+ if (mode==smFont8x8) // Looks like Borland TV 2.0 defined it
+ mode=smCO80x50;
+ // Extended and tweaked modes are numbered Mode<<8 | smCO80
+ // 0-6 are extended modes.
+ // 7-13 are tweaked modes.
+ if ((mode & 0xFF)==smCO80)
+ {
+ int hmode=mode>>8;
+ if (hmode>6 && hmode<14)
+ {
+ setTweakedMode(hmode-7);
+ emulateMouse=1;
+ }
+ else
+ {
+ setExtendedMode(hmode);
+ emulateMouse=0;
+ }
+ }
+ else
+ {
+ setTextMode(mode);
+ testForSupport();
+ TScreenDOS::SelectFont(charLines);
+ }
+
+ if (TMouse::present())
+ {
+ THWMouseDOS::setEmulation(emulateMouse);
+ TMouse::setRange(getCols()-1,getRows()-1);
+ TMouse::show();
+ }
+ if (paletteModified)
+ SetDisPaletteColors(0,16,ActualPalette);
+}
+
+
+void TDisplayDOS::SetCrtModeExt(char *command)
+{
+ // Should we hide the mouse here? [Added TV 2.0.0]
+ if (TMouse::present())
+ TMouse::hide();
+
+ system(command);
+ testForSupport();
+ charLines=getCharLines();
+ TScreenDOS::SelectFont(charLines);
+ // Don't trust in the driver [Added TV 2.0.0]
+ emulateMouse=1;
+
+ if (TMouse::present())
+ {
+ THWMouseDOS::setEmulation(emulateMouse);
+ TMouse::setRange(getCols()-1,getRows()-1);
+ TMouse::show();
+ }
+}
+
+int TDisplayDOS::SetCrtModeRes(unsigned w, unsigned h, int fW, int fH)
+{
+ if (w==TScreen::screenWidth && h==TScreen::screenHeight) return 0;
+ // DOS can't do it so we just select the closest mode available
+ unsigned pos;
+ Boolean exact=searchClosestRes(dosModesRes,w,h,TDisplayDOSModesNum,pos);
+ SetCrtMode(dosModes[pos]);
+ return exact && dosModesCell[pos].x==(unsigned)fW &&
+ dosModesCell[pos].y==(unsigned)fH ? 1 : 2;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the main window title if we are running under W95 and windowed.
+
+ Return:
+ A pointer to a newly allocated string (new[]). Or 0 if fail. by SET.
+
+***************************************************************************/
+
+const char *TDisplayDOS::GetWindowTitle(void)
+{
+ // Winoldap Get Title.
+ AX=0x168E;
+ DX=2;
+ // Size of transfer buffer
+ unsigned long tbsize=_go32_info_block.size_of_transfer_buffer;
+ CX=tbsize>0xFFFF ? 0xFFFF : tbsize; // Can tbsize be > 64Kb?
+ // Address of tb
+ DI=__tb & 0x0f; // It should be 0
+ ES=(__tb>>4) & 0xffff;
+
+ __dpmi_int(0x2F,&r);
+
+ if (AX!=1)
+ return 0;
+
+ // Scan to get the length
+ _farsetsel(_dos_ds);
+ unsigned i;
+ for (i=0; i<tbsize && _farnspeekb(i); i++);
+ // Make a copy
+ char *ret=new char[i+1];
+ dosmemget(__tb,i,ret);
+ ret[i]=0;
+ return ret;
+}
+
+const int mxTitleSize=80; // Limited by Windows, yet another silly idea
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the main window title if we are running under W95 and windowed.
+
+ Return:
+ 1 successful. by SET.
+
+***************************************************************************/
+
+int TDisplayDOS::SetWindowTitle(const char *name)
+{
+ char title[mxTitleSize];
+
+ // Winoldap Set Title.
+ AX=0x168E;
+ DX=0;
+ // Address of transfer buffer
+ DI=__tb & 0x0f; // It should be 0
+ ES=(__tb>>4) & 0xffff;
+ // Copy to tb
+ strncpy(title,name,mxTitleSize);
+ title[mxTitleSize-1]=0;
+ dosmemput(title,mxTitleSize,__tb);
+
+ __dpmi_int(0x2F,&r);
+
+ return AX;
+}
+
+void TDisplayDOS::getPaletteMap(char *map)
+{
+ AX=READ_ALL_PALETTE_REGISTERS_AND_OVERSCAN_REGISTER;
+ ES=__tb>>4;
+ DX=__tb & 0xF;
+ videoInt();
+ dosmemget(__tb,17,map);
+}
+
+void TDisplayDOS::setOnePaletteIndex(int index, TScreenColor *col)
+{
+ AX=SET_INDIVIDUAL_DAC_REGISTER;
+ BX=colorsMap[index];
+ DH=col->R>>2; CH=col->G>>2; CL=col->B>>2;
+ videoInt();
+}
+
+void TDisplayDOS::getOnePaletteIndex(int index, TScreenColor *col)
+{
+ AX=READ_INDIVIDUAL_DAC_REGISTER;
+ BL=colorsMap[index];
+ videoInt();
+ col->R=DH<<2;
+ col->G=CH<<2;
+ col->B=CL<<2;
+}
+
+int TDisplayDOS::SetDisPaletteColors(int from, int number, TScreenColor *colors)
+{
+ int ret=number;
+ while (number-- && from<16)
+ setOnePaletteIndex(from++,colors++);
+ return ret;
+}
+
+void TDisplayDOS::GetDisPaletteColors(int from, int number, TScreenColor *colors)
+{
+ while (number-- && from<16)
+ getOnePaletteIndex(from++,colors++);
+}
+
+void TDisplayDOS::Beep()
+{
+ sound(1000);
+ delay(100);
+ nosound();
+}
+
+void TDisplayDOS::Init()
+{// Currently we assume it doesn't change.
+ getPaletteMap(colorsMap);
+ // Memorize original palette
+ GetDisPaletteColors(0,16,OriginalPalette);
+ // That's the current
+ memcpy(ActualPalette,OriginalPalette,sizeof(ActualPalette));
+
+ TDisplay::setCursorPos=SetCursorPos;
+ TDisplay::getCursorPos=GetCursorPos;
+ TDisplay::getCursorShape=GetCursorShape;
+ TDisplay::setCursorShape=SetCursorShape;
+ TDisplay::clearScreen=ClearScreen;
+ TDisplay::getRows=GetRows;
+ TDisplay::getCols=GetCols;
+ TDisplay::setCrtMode=SetCrtMode;
+ TDisplay::getCrtMode=GetCrtMode;
+ TDisplay::setCrtModeExt=SetCrtModeExt;
+ TDisplay::setCrtModeRes_p=SetCrtModeRes;
+ TDisplay::getWindowTitle=GetWindowTitle;
+ TDisplay::setWindowTitle=SetWindowTitle;
+ TDisplay::setDisPaletteColors=SetDisPaletteColors;
+ TDisplay::getDisPaletteColors=GetDisPaletteColors;
+ TDisplay::beep=Beep;
+}
+
+TDisplayDOS::~TDisplayDOS() {}
+
+#else // DJGPP
+
+#include <tv/dos/screen.h>
+#include <tv/dos/mouse.h>
+
+#endif // else DJGPP
+
diff --git a/tvision/classes/dos/doskey.cc b/tvision/classes/dos/doskey.cc
new file mode 100644
index 0000000..e9cac74
--- /dev/null
+++ b/tvision/classes/dos/doskey.cc
@@ -0,0 +1,543 @@
+/**[txh]********************************************************************
+
+ Keyboard handler for DOS.
+ Copyright (c) 1998-2004 by Salvador E. Tropea (SET)
+
+ Description:
+ This module implements the low level keyboard routines for DOS.
+ The original comment about the first TGKey class I sent to Robert when was
+the maintainer of TV is located at the end of this file. It have some
+intersting information.
+
+ Configuration variables:
+ BIOSKey
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_ctype
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_FullSingleKeySymbols
+#define Uses_string
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVCompf_djgpp
+
+#include <go32.h>
+#include <sys/farptr.h>
+#include <dpmi.h>
+#include <pc.h>
+#include <bios.h>
+#define REGS __dpmi_regs
+#define INTR(nr,r) __dpmi_int(nr,&r)
+
+#define DEF_REGS __dpmi_regs r
+#define KEY_INTR() __dpmi_int(0x16,&r)
+#define AH r.h.ah
+#define AX r.x.ax
+
+#include <tv/dos/key.h>
+
+#define GET_ENHANCED_KEYSTROKE 0x0010
+#define GET_EXTENDED_SHIFT_STATES 0x0012
+// Keyboard definitions:
+#define KEYBOARD_STATUS_FLAGS_1 0x0417
+// Bitfields for keyboard status flags 1:
+// Bit(s) Description (Table M010)
+// 7 INSert active
+// 6 Caps Lock active
+// 5 Num Lock active
+// 4 Scroll Lock active
+// 3 either Alt pressed
+// 2 either Ctrl pressed
+// 1 Left Shift pressed
+// 0 Right Shift pressed
+#define KBD_POINTER_TO_NEXT_CHAR_IN_KBD_BUF 0x041A
+#define KBD_POINTER_TO_FIRST_FREE_SLOT_IN_BUF 0x041C
+// KM00400080 - KEYBOARD BUFFER START OFFSET FROM SEGMENT 40h (normally 1Eh)
+#define KEYBOARD_BUFFER_START_OFFSET 0x0480
+// KM00400082 - KEYBOARD BUFFER END+1 OFFSET FROM SEGMENT 40h (normally 3Eh)
+#define KEYBOARD_BUFFER_END_1_OFFSET 0x0482
+
+
+KeyType TGKeyDOS::rawCode;
+int TGKeyDOS::Abstract;
+char TGKeyDOS::ascii;
+char TGKeyDOS::useFixKbdBuffer;
+ushort TGKeyDOS::sFlags;
+int TGKeyDOS::useBIOS=0;
+int TGKeyDOS::translateKeyPad=1;
+void (*TGKeyDOS::GetRaw)(void)=GetRawDirect;
+
+const uchar TGKeyDOS::kbWithASCII0[256]=
+{
+ kbPause,kbEsc,kb1,kb2,kb3,kb4,kb5,0, // 00-07
+ kb7,kb8,kb9,kb0,0,kbEqual,kbBackSpace,kbTab, // 08-0F
+ kbQ,kbW,kbE,kbR,kbT,kbY,kbU,kbI, // 10-17
+ kbO,kbP,kbOpenBrace,kbCloseBrace,kbEnter,0,kbA,kbS, // 18-1F
+ kbD,kbF,kbG,kbH,kbJ,kbK,kbL,kbColon, // 20-27
+ kbQuote,kbGrave,0,kbBackSlash,kbZ,kbX,kbC,kbV, // 28-2F
+ kbB,kbN,kbM,kbComma,kbStop,kbSlash,0,kbAsterisk, // 30-37
+ 0,kbSpace,0,kbF1,kbF2,kbF3,kbF4,kbF5, // 38-3F
+ kbF6,kbF7,kbF8,kbF9,kbF10,0,0,kbHome, // 40-47
+ kbUp,kbPgUp,kbMinus,kbLeft,kb5,kbRight,kbPlus,kbEnd, // 48-4F
+ kbDown,kbPgDn,kbInsert,kbDelete,kbF1,kbF2,kbF3,kbF4, // 50-57
+ kbF5,kbF6,kbF7,kbF8,kbF9,kbF10,kbF1,kbF2, // 58-5F
+ kbF3,kbF4,kbF5,kbF6,kbF7,kbF8,kbF9,kbF10, // 60-67
+ kbF1,kbF2,kbF3,kbF4,kbF5,kbF6,kbF7,kbF8, // 68-6F
+ kbF9,kbF10,kbPrnScr,kbLeft,kbRight,kbEnd,kbPgDn,kbHome, // 70-77
+ kb1,kb2,kb3,kb4,kb5,kb6,kb7,kb8, // 78-7F
+ kb9,kb0,kbMinus,kbEqual,kbPgUp,kbF11,kbF12,kbF11, // 80-87
+ kbF12,kbF11,kbF12,kbF11,kbF12,kbUp,kbMinus,kb5, // 88-8F
+ kbPlus,kbDown,kbInsert,kbStop,kbTab,kbSlash,kbAsterisk,kbHome, // 90-97
+ kbUp,kbPgUp,0,kbLeft,0,kbRight,0,kbEnd, // 98-9F
+ kbDown,kbPgDn,kbInsert,kbDelete,kbSlash,kbTab,kbEnter,kbMacro, // A0-A7
+ // I don't know if the following will be used:
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0
+};
+
+// This table uses just some values
+const uchar TGKeyDOS::kbWithASCIIE0[256]=
+{
+ 0,0,0,0,0,0,0,0, // 00-07
+ 0,0,0,0,0,0,0,0, // 08-0F
+ 0,0,0,0,0,0,0,0, // 10-17
+ 0,0,0,0,0,0,0,0, // 18-1F
+ 0,0,0,0,0,0,0,0, // 20-27
+ 0,0,0,0,0,0,0,0, // 28-2F
+ 0,0,0,0,0,0,0,0, // 30-37
+ 0,0,0,0,0,0,0,0, // 38-3F
+ 0,0,0,0,0,0,0,kbHome, // 40-47
+ kbUp,kbPgUp,0,kbLeft,0,kbRight,0,kbEnd, // 48-4F
+ kbDown,kbPgDn,kbInsert,kbDelete,0,0,0,0, // 50-57
+ 0,0,0,0,0,0,0,0, // 58-5F
+ 0,0,0,0,0,0,0,0, // 60-67
+ 0,0,0,0,0,0,0,0, // 68-6F
+ 0,0,0,kbLeft,kbRight,kbEnd,kbPgDn,kbHome, // 70-77
+ 0,0,0,0,0,0,0,0, // 78-7F
+ 0,0,0,0,kbPgUp,0,0,0, // 80-87
+ 0,0,0,0,0,kbUp,0,0, // 88-8F
+ 0,kbDown,kbInsert,kbDelete,0,0,0,0, // 90-97
+ 0,0,0,0,0,0,0,0, // 98-9F
+ 0,0,0,0,0,0,0,0, // A0-A7
+ 0,0,0,0,0,0,0,0, // A8-AF
+ // Here are keys from the 105 keys keyboards.
+ 0,0,0,0,0,0,kbWinLeft,kbWinRight, // B0-B7
+ kbWinSel,0,0,0,0,0,0,0, // B8-BF
+ 0,0,kbWinLeft,kbWinRight,kbWinSel,0,0,0, // C0-C7
+ 0,0,0,0,0,0,kbWinLeft,kbWinRight, // C8-CF
+ kbWinSel,0,0,0,0,0,0,0, // D0-D7
+ 0,0,kbWinLeft,kbWinRight,kbWinSel,0,0,0, // D8-DF
+ 0,0,0,0,0,0,0,0, // E0-E7
+ 0,0,0,0,0,0,0,0, // E8-EF
+ 0,0,0,0,0,0,0,0, // F0-F7
+ 0,0,0,0,0,0,0,0 // F8-FF
+};
+
+unsigned TGKeyDOS::GetShiftStateBIOS(void)
+{
+ DEF_REGS;
+ AH=GET_EXTENDED_SHIFT_STATES;
+ KEY_INTR();
+ return AX;
+}
+
+unsigned TGKeyDOS::GetShiftStateDirect(void)
+{
+ _farsetsel(_dos_ds);
+ return _farnspeekw(KEYBOARD_STATUS_FLAGS_1);
+}
+
+// All the info. from BIOS in one call
+void TGKeyDOS::GetRawBIOS(void)
+{
+ DEF_REGS;
+ AH=GET_EXTENDED_SHIFT_STATES;
+ KEY_INTR();
+ sFlags=AX;
+ AH=GET_ENHANCED_KEYSTROKE;
+ KEY_INTR();
+ rawCode.full=AX;
+}
+
+void TGKeyDOS::GetRawDirect(void)
+{
+ _farsetsel(_dos_ds);
+ sFlags=_farnspeekw(KEYBOARD_STATUS_FLAGS_1);
+ ushort keybuf_nextchar=_farnspeekw(KBD_POINTER_TO_NEXT_CHAR_IN_KBD_BUF);
+ rawCode.full=_farnspeekw(0x400+keybuf_nextchar);
+ keybuf_nextchar+=2;
+ if (useFixKbdBuffer)
+ {
+ if (keybuf_nextchar>=0x3e)
+ keybuf_nextchar=0x1e;
+ }
+ else
+ {
+ if (keybuf_nextchar>=_farnspeekw(KEYBOARD_BUFFER_END_1_OFFSET)) // if past the buffer...
+ keybuf_nextchar=_farnspeekw(KEYBOARD_BUFFER_START_OFFSET); // ...wrap to it's start
+ }
+ _farnspokew(KBD_POINTER_TO_NEXT_CHAR_IN_KBD_BUF,keybuf_nextchar);
+}
+
+
+// The intelligence is here
+unsigned short TGKeyDOS::GKey(void)
+{
+ Abstract=0;
+
+ GetRaw();
+ // Compose the shift flags:
+
+ if (sFlags & 3)
+ Abstract|=kbShiftCode;
+ if (sFlags & 4)
+ Abstract|=kbCtrlCode;
+ switch (AltSet)
+ {
+ case 0: // Normal thing, left is left, right is right
+ if (sFlags & 0x200)
+ Abstract|=kbAltLCode;
+ else
+ if (sFlags & 8)
+ Abstract|=kbAltRCode;
+ break;
+ case 1: // Reverse thing
+ if (sFlags & 0x200)
+ Abstract|=kbAltRCode;
+ else
+ if (sFlags & 8)
+ Abstract|=kbAltLCode;
+ break;
+ default: // Compatibility
+ if (sFlags & 0x208)
+ Abstract|=kbAltLCode;
+ }
+
+ // Translate the rest
+ if (rawCode.b.scan==0)
+ {
+ if (rawCode.b.ascii==0)
+ { // Very singular 00/00
+ Abstract|=kbPause;
+ ascii=0;
+ }
+ else
+ { // Generated by Alt-key pad or a TSR
+ ascii=rawCode.b.ascii;
+ Abstract|=kbUnkNown;
+ }
+ }
+ else
+ if (rawCode.b.ascii==0 || rawCode.b.ascii==0xF0)
+ { // Alt keys and other strange things
+ Abstract|=kbWithASCII0[rawCode.b.scan];
+ ascii=0;//rawCode.b.scan; That's good bur annoying, so now I return 0
+ }
+ else
+ if (rawCode.b.ascii==0xE0)
+ {
+ Abstract|=kbWithASCIIE0[rawCode.b.scan];
+ ascii=0;//rawCode.b.scan;
+ }
+ else
+ { // That's the rest, they are translated by the ASCII because depends
+ // on the keyboard layout.
+ ascii=rawCode.b.ascii;
+#if 0
+ // Making that I lose:
+ // ^H == BackSpace, ^I == Tab, ^J == ^Enter, ^M == Enter, ^[ == Esc
+ if (rawCode.b.ascii<128)
+ Abstract|=kbByASCII[rawCode.b.ascii];
+#else
+ // As ^J and ^[ are very used by me I preffer that:
+ if (rawCode.b.ascii<128)
+ {
+ unsigned char val=kbByASCII[rawCode.b.ascii];
+ if (val<128)
+ {
+ // I think the following is a bug in the BIOS: Numlock OFF then
+ // key pad 6 is right, OK, but if you press shift+6 you get the
+ // ASCII of 6!!!!
+ if (translateKeyPad && rawCode.b.ascii>='0' &&
+ rawCode.b.ascii<='9' && (Abstract & kbShiftCode))
+ Abstract|=kbWithASCIIE0[rawCode.b.scan];
+ else
+ Abstract|=val;
+ }
+ else
+ {
+ val&=0x7F;
+ #define KC(a,c) case a: if (sFlags & 4) Abstract|=val; \
+ else Abstract|=c; break;
+ switch (val)
+ {
+ KC(kbH,kbBackSpace)
+ KC(kbI,kbTab)
+ KC(kbM,kbEnter)
+ // Here I assume that ESC, ENTER and pENTER doesn't change from
+ // keyboard to keyboard
+ case kbOpenBrace:
+ if (rawCode.b.scan==1)
+ Abstract|=kbEsc;
+ else
+ Abstract|=val;
+ break;
+ case kbJ:
+ if (rawCode.b.scan==0x1C || rawCode.b.scan==0xE0)
+ Abstract|=kbEnter;
+ else
+ Abstract|=val;
+ break;
+ }
+ #undef KC
+ }
+ }
+#endif
+ }
+ return rawCode.full;
+}
+
+int TGKeyDOS::KbHitBIOS(void)
+{
+ return bioskey(1);
+}
+
+int TGKeyDOS::KbHitDirect(void)
+{
+ return (_farpeekw(_dos_ds,KBD_POINTER_TO_NEXT_CHAR_IN_KBD_BUF)
+ !=_farpeekw(_dos_ds,KBD_POINTER_TO_FIRST_FREE_SLOT_IN_BUF));
+}
+
+void TGKeyDOS::ClearBIOS(void)
+{
+ while (kbhit())
+ GKey();
+ // the bios has no function for clearing the key buffer
+ // But you can loop until is empty ;-)
+}
+
+void TGKeyDOS::ClearDirect(void)
+{
+ if (useFixKbdBuffer)
+ _farpokel(_dos_ds,KBD_POINTER_TO_NEXT_CHAR_IN_KBD_BUF,0x001E001EUL);
+ else
+ {
+ _farsetsel(_dos_ds);
+ ulong keybuf_start=_farnspeekw(KEYBOARD_BUFFER_START_OFFSET);
+ _farnspokel(KBD_POINTER_TO_NEXT_CHAR_IN_KBD_BUF,(keybuf_start<<16)+keybuf_start);
+ }
+}
+
+void TGKeyDOS::FillTEvent(TEvent &e)
+{
+ GKey();
+ e.keyDown.charScan.charCode=ascii;
+ e.keyDown.charScan.scanCode=rawCode.b.scan;
+ e.keyDown.raw_scanCode=rawCode.b.scan;
+ e.keyDown.keyCode=Abstract;
+ e.keyDown.shiftState=sFlags;
+ e.what=evKeyDown;
+}
+
+void TGKeyDOS::SetKbdMapping(int version)
+{
+ if (version==dosUseBIOS)
+ {
+ useBIOS=1;
+ TGKey::kbhit=KbHitBIOS;
+ TGKey::getShiftState=GetShiftStateBIOS;
+ TGKey::clear=ClearBIOS;
+ GetRaw=GetRawBIOS;
+ return;
+ }
+ else if (version==dosUseDirect)
+ {
+ useBIOS=0;
+ TGKey::kbhit=KbHitDirect;
+ TGKey::getShiftState=GetShiftStateDirect;
+ TGKey::clear=ClearDirect;
+ GetRaw=GetRawDirect;
+ return;
+ }
+ else if (version==dosTranslateKeypad)
+ {
+ translateKeyPad=1;
+ }
+ else if (version==dosNormalKeypad)
+ {
+ translateKeyPad=0;
+ }
+ Mode=version;
+}
+
+int TGKeyDOS::GetKbdMapping(int version)
+{
+ if (version==dosUseBIOS)
+ {
+ return useBIOS;
+ }
+ else if (version==dosUseDirect)
+ {
+ return !useBIOS;
+ }
+ else if (version==dosTranslateKeypad)
+ {
+ return translateKeyPad;
+ }
+ else if (version==dosNormalKeypad)
+ {
+ return !translateKeyPad;
+ }
+ return 0;
+}
+
+void TGKeyDOS::Init()
+{
+ AltSet=2;
+ TGKey::gkey=GKey;
+ TGKey::fillTEvent=FillTEvent;
+ TGKey::SetKbdMapping=SetKbdMapping;
+ TGKey::GetKbdMapping=GetKbdMapping;
+ // Default to direct mode
+ long useBIOS=0;
+ TScreen::optSearch("BIOSKey",useBIOS);
+ SetKbdMapping(useBIOS ? dosUseBIOS : dosUseDirect);
+ // SET: Original code assumed the circular buffer starts at offset 0x1E and
+ // ends at offset 0x3D. But some utilities to grow the buffer exists.
+ // Egon Eckert <egon.heaven.industries.cz> contributed a patch to fix it.
+ // As it was incorporated between 2.0.3 RC1 and 2.0.3 I added an option to
+ // rollback without recompiling.
+ long aux=0;
+ TScreen::optSearch("FixKbdBuffer",aux);
+ useFixKbdBuffer=aux!=0;
+}
+
+//---------------- TEST
+#ifdef GKEY
+#include <stdio.h>
+
+void InterpretAbstract(void)
+{
+ int key=TGKey::Abstract & kbKeyMask;
+ printf("Abstract: kb%s",TGKey::KeyNames[key]);
+ if (TGKey::Abstract & kbShiftCode)
+ printf(" SHIFT");
+ if (TGKey::Abstract & kbCtrlCode)
+ printf(" CTRL");
+ if (TGKey::Abstract & kbAltRCode)
+ printf(" ALT-R");
+ if (TGKey::Abstract & kbAltLCode)
+ printf(" ALT-L");
+}
+
+#include <signal.h>
+#include <conio.h>
+/* ungetch() is available only on DJGPP
+static void PasarAC(int Sig)
+{
+ Sig=0;
+}*/
+#undef kbhit
+void CtrlCOff(void)
+{
+ //signal(SIGINT,PasarAC);
+ signal(SIGINT,SIG_IGN);
+}
+
+int count=0;
+
+int main(int argc, char *argv[])
+{
+ unsigned short key=0;
+ TGKey::useBIOS=0;
+ CtrlCOff();
+ // Setup the mode where the alt left/right are different
+ TGKey::SetAltSettings(0);
+ do
+ {
+ while (!TGKey::kbhit());// {count++; if ((count%1000)==0) printf(".");}
+ TEvent e;
+ TGKey::fillTEvent(e);
+ if (e.what!=evNothing)
+ {
+ key = TGKey::Abstract;
+ printf("Shiftstate: %04x RawCode: %04x ASCII: %X SCAN: %04X\r\n",
+ TGKey::sFlags,key,key & 0xff,e.keyDown.raw_scanCode);
+ InterpretAbstract();
+ printf(" ASCII: %c\r\n",TGKey::ascii);
+ }
+ } while (key!=kbEsc);
+}
+#endif
+
+#else // TVCompf_djgpp
+
+#include <tv/dos/key.h>
+
+#endif // else TVCompf_djgpp
+
+/*
+ That's a gkey function that is supposed to:
+
+1) Solve all the problems about multiple translations. That's because it
+generates a unique code for each key. The format is:
+
+bit 10 9 8 7 6-0
+Left-Alt Right-Alt Ctrl Shift Code
+
+ Additionally there are a char value to carry the ASCII.
+ I'm detecting left and right alt but perhaps isn't good. The idea of
+detecting it is that Left Alt could be used for the menu and Right Alt
+(called Alt Gr in some keyboards) can be used for macros.
+ But I think it will confuse to some people, what do you think?
+
+2) Solve the keyboard layout problems. This routines uses a methode that
+works OK with M$ keyb TSR. Keyb is relative smart and translates the Alt-X
+codes, that's needed because the Alt keys are ASCII 0 and we need the scan
+to differenciate one from the others. Keyb translates it.
+ I tried with keyb gr and worked perfect.
+ The main idea is just use ASCII for the things is possible and scans for
+the rest, keyb takes care about the thing that can't be detected using
+ASCIIs.
+
+3) Solve the problem of the numeric pad. BIOS makes the work.
+
+ The code is very fast because uses a few comparissons and look-up tables,
+we don't need long switchs. The only exception is done to avoid the loose
+of ^H,^I,^J,^M and ^[. For that I suppose some things and guess about what
+key was.
+
+Important!
+i) Some constants have crazy names, take a look I used the first
+name that came to my mind.
+ii) Some ^symbol assigments aren't well mapped by keyb so they are very
+specific cases that I think doesn't mather.
+
+ Now, from the side of the editor:
+
+ This methode generates 2048 key combinations, only a part can be really
+triggered because a lot are like !, is impossible to get other thing that
+Shift-! because you MUST press shift to get it, additionally Shift-1 doesn't
+exist because you'll get Shift-!. That is logic because not all keyboards
+have the relation Shift-1==!. So only some combinations can be used for
+commands, the rest must mean: Insert a character with the ASCII provided.
+ For the rest I think the system can be used.
+
+Note: I did a TSR to detect 19 key combinations that BIOS doesn't report,
+takes only 400 bytes of memory.
+*/
diff --git a/tvision/classes/dos/dosmouse.cc b/tvision/classes/dos/dosmouse.cc
new file mode 100644
index 0000000..79f7257
--- /dev/null
+++ b/tvision/classes/dos/dosmouse.cc
@@ -0,0 +1,521 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2001-2002 by Salvador E. Tropea
+ Based on code Copyright 1996-1998 by Robert H”hne.
+
+ Description:
+ DOS mouse drivers. Completly reworked by Salvador E. Tropea.
+ Based on concepts by Jose Angel Sanchez Caso (JASC) and code by Robert
+H”hne.
+ Important:
+ 1) The registerHandler member can only register TEventQueue::mouseInt.
+ 2) The code lock for TEventQueue::mouseInt and CLY_Ticks is fuzzy, I
+ incressed the locked area to 1 Kb but it should adjusted.
+
+ The DOS/PollMouse configuration option forces mouse polling.
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#ifdef TVCompf_djgpp
+ #include <conio.h>
+#endif
+#define Uses_string
+#define Uses_stdlib
+#define Uses_stdio
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVCompf_djgpp
+
+#include <dos.h>
+#include <dpmi.h>
+#include <sys/farptr.h>
+#include <go32.h>
+
+#include <tv/dos/mouse.h>
+
+#define REGS __dpmi_regs
+#define INTR(nr,r) __dpmi_int(nr,&r)
+#define AX r.x.ax
+#define BX r.x.bx
+#define CX r.x.cx
+#define DX r.x.dx
+#define ES r.x.es
+#define LD(x) _go32_dpmi_lock_data((void *)&x,sizeof(x))
+//#define SHOW_COUNT() ((short)(_farpeekw(mouse_buffer_selector,118)))
+
+// MS-Mouse services: [Thanks to Ralf Brown]
+#define RESET_DRIVER_AND_READ_STATUS 0x0000
+// MS-Mouse v1.0+ services
+#define SHOW_MOUSE_CURSOR 0x0001
+#define HIDE_MOUSE_CURSOR 0x0002
+#define RETURN_POSITION_AND_BUTTON_STATUS 0x0003
+#define POSITION_MOUSE_CURSOR 0x0004
+#define DEFINE_HORIZONTAL_CURSOR_RANGE 0x0007
+#define DEFINE_VERTICAL_CURSOR_RANGE 0x0008
+// MS-Mouse v3.0+ services
+#define EXCHANGE_INTERRUPT_SUBROUTINES 0x0014
+// MS-Mouse v6.0+ services
+#define RETURN_DRIVER_STORAGE_REQUIREMENTS 0x0015
+#define SAVE_DRIVER_STATE 0x0016
+#define RESTORE_DRIVER_STATE 0x0017
+#define SET_ALTERNATE_MOUSE_USER_HANDLER 0x0018
+#define RETURN_USER_ALTERNATE_INTERRUPT_VECTOR 0x0019
+
+char THWMouseDOS::useMouseHandler=1;
+char THWMouseDOS::emulateMouse=0;
+uchar THWMouseDOS::myButtonCount;
+ulong THWMouseDOS::screenBase=0xB8000;
+ushort THWMouseDOS::mouseChar;
+int THWMouseDOS::lastX=0,
+ THWMouseDOS::lastY=0;
+int THWMouseDOS::cols;
+MouseEventType
+ THWMouseDOS::intEvent;
+int THWMouseDOS::bufferSegment;
+int THWMouseDOS::bufferSelector;
+int THWMouseDOS::bufferSize;
+int THWMouseDOS::bufferAllocated=0;
+int THWMouseDOS::myBufferSegment;
+int THWMouseDOS::myBufferSelector;
+int THWMouseDOS::myBufferSize;
+int THWMouseDOS::myBufferAllocated=0;
+
+// Information for the Real Mode CallBack (RMCB)
+static _go32_dpmi_seginfo mouseIntInfo;
+// x86 registers values stored by the RMCB
+static _go32_dpmi_registers mouseIntRegs;
+
+/*****************************************************************************
+ Functions in this area are called asynchronically on interrupts using an
+ RMCB. For this reason they must be locked avoiding swap outs of their pages.
+ The functions are delimited by two empty functions that just mark the range.
+*****************************************************************************/
+
+static volatile
+void StartOfLockedFunctions()
+{
+}
+
+volatile
+void THWMouseDOS::getMouseChar()
+{
+ mouseChar=_farpeekw(_dos_ds,screenBase+(lastY*cols+lastX)*2);
+}
+
+volatile
+void THWMouseDOS::setMouseChar()
+{
+ unsigned short c=mouseChar^0x7F00;
+ _farpokew(_dos_ds,screenBase+(lastY*cols+lastX)*2,c);
+}
+
+volatile
+void THWMouseDOS::resetMouseChar()
+{
+ _farpokew(_dos_ds,screenBase+(lastY*cols+lastX)*2,mouseChar);
+}
+
+volatile
+void THWMouseDOS::showMouseChar()
+{
+ if (!visible) return;
+ getMouseChar();
+ setMouseChar();
+}
+
+int THWMouseDOS::DrawMouseEmulate(int x, int y)
+{
+ if (x!=lastX || y!=lastY)
+ {
+ if (visible)
+ {
+ drawCounter++;
+ resetMouseChar();
+ }
+ lastX=x;
+ lastY=y;
+ showMouseChar();
+ return 1;
+ }
+ return 0;
+}
+
+int THWMouseDOS::getRMCB_InfoDraw(int &buttonPress)
+{
+ int x,y;
+
+ intEvent.doubleClick=False;
+ intEvent.buttons =mouseIntRegs.h.bl;
+ x=intEvent.where.x =(mouseIntRegs.x.cx>>3) & 0xFF;
+ y=intEvent.where.y =(mouseIntRegs.x.dx>>3) & 0xFF;
+ buttonPress =mouseIntRegs.x.ax & 0x1e;
+ return drawMouse(x,y);
+}
+
+static volatile
+void EndOfLockedFunctions()
+{
+}
+
+/*****************************************************************************
+ End of locked functions
+*****************************************************************************/
+
+int THWMouseDOS::DrawMouseDummy(int x, int y)
+{
+ if (x!=lastX || y!=lastY)
+ {
+ lastX=x;
+ lastY=y;
+ return 1;
+ }
+ return 0;
+}
+
+void THWMouseDOS::setEmulation(int emulate)
+{
+ emulateMouse=emulate;
+ if (emulate)
+ {
+ THWMouse::Show=ShowEmulate;
+ THWMouse::Hide=HideEmulate;
+ THWMouse::drawMouse=DrawMouseEmulate;
+ }
+ else
+ {
+ THWMouse::Show=ShowDrv;
+ THWMouse::Hide=HideDrv;
+ THWMouse::drawMouse=DrawMouseDummy;
+ }
+}
+
+#if 1
+// SET: I think we should really test it, Robert is using a call of the v3.0+
+// to set the mouse handler and one from v6.0+ to restore, why not using the
+// same for both? My doubt is that the v6.0+ is for *alternate* handler and
+// supports upto 3 different.
+// Todo: it never checks the return value!!!
+/*void THWMouseDOS::RegisterHandler(unsigned mask, void (*func)())
+{
+ REGS r;
+ static int oldes=0;
+ static int olddx=0;
+
+ if (func==NULL)
+ { // INT 33 - MS MOUSE v6.0+ - SET ALTERNATE MOUSE USER HANDLER
+ DX=olddx;
+ ES=oldes;
+ AX=SET_ALTERNATE_MOUSE_USER_HANDLER;
+ CX=mask;
+ INTR(0x33,r);
+ return;
+ }
+ else
+ { // INT 33 - MS MOUSE v3.0+ - EXCHANGE INTERRUPT SUBROUTINES
+ DX=mouseIntInfo.rm_offset;
+ ES=mouseIntInfo.rm_segment;
+ AX=EXCHANGE_INTERRUPT_SUBROUTINES;
+ CX=mask;
+ INTR(0x33,r);
+ oldes=ES;
+ olddx=DX;
+ }
+}*/
+void THWMouseDOS::RegisterHandler(unsigned mask, void (*func)())
+{
+ REGS r;
+ static int oldes=0;
+ static int olddx=0;
+
+ if (func==NULL)
+ { // INT 33 - MS MOUSE v6.0+ - SET ALTERNATE MOUSE USER HANDLER
+ DX=olddx; ES=oldes;
+ AX=SET_ALTERNATE_MOUSE_USER_HANDLER;
+ CX=mask;
+ INTR(0x33,r);
+ return;
+ }
+ else
+ {// INT 33 - MS MOUSE v6.0+ - RETURN USER ALTERNATE INTERRUPT VECTOR
+ AX=RETURN_USER_ALTERNATE_INTERRUPT_VECTOR;
+ CX=mask;
+ INTR(0x33,r);
+ oldes=BX;
+ olddx=DX;
+ // INT 33 - MS MOUSE v6.0+ - SET ALTERNATE MOUSE USER HANDLER
+ DX=mouseIntInfo.rm_offset;
+ ES=mouseIntInfo.rm_segment;
+ AX=SET_ALTERNATE_MOUSE_USER_HANDLER;
+ CX=mask;
+ INTR(0x33,r);
+ }
+}
+
+#else
+// SET: I moved it here to keep the old routine and clean the currently used.
+// I don't know why Robert dropped it. The main drawback is that you kill
+// any old mouse handler. Looks like v1.0 didn't implement a way to get the
+// current handler, not strange since that's a Microsoft spec. So it kills
+// the mouse of the debuggy. I think it was the reason.
+void THWMouseDOS::RegisterHandler( unsigned mask, void (*func)() )
+{
+ REGS r;
+ if (func == NULL)
+ { // MS MOUSE v1.0+ - DEFINE INTERRUPT SUBROUTINE PARAMETERS
+ DX=ES=0;
+ AX=0x000C;
+ CX=mask;
+ INTR(0x33,r);
+ return;
+ }
+ else
+ { // MS MOUSE v1.0+ - DEFINE INTERRUPT SUBROUTINE PARAMETERS
+ DX=mouseIntInfo.rm_offset;
+ ES=mouseIntInfo.rm_segment;
+ AX=0x000C;
+ CX=mask;
+ INTR(0x33,r);
+ }
+}
+#endif
+
+void THWMouseDOS::biosRestoreState()
+{
+ REGS r;
+ if (bufferAllocated)
+ {
+ AX=RESTORE_DRIVER_STATE;
+ BX=bufferSize;
+ ES=bufferSegment;
+ DX=0;
+ INTR(0x33,r);
+ }
+}
+
+int THWMouseDOS::biosRestoreMyState()
+{
+ REGS r;
+ if (myBufferAllocated)
+ {
+ AX=RESTORE_DRIVER_STATE;
+ BX=myBufferSize;
+ ES=myBufferSegment;
+ DX=0;
+ INTR(0x33,r);
+ return 1;
+ }
+ return 0;
+}
+
+void THWMouseDOS::biosSaveState()
+{
+ REGS r;
+ if (!bufferAllocated)
+ {
+ AX=RETURN_DRIVER_STORAGE_REQUIREMENTS;
+ INTR(0x33,r);
+ bufferSize=BX;
+ bufferSegment=__dpmi_allocate_dos_memory((bufferSize+15)>>4,
+ &bufferSelector);
+ if (bufferSegment!=-1)
+ bufferAllocated = 1;
+ }
+ if (bufferAllocated)
+ {
+ AX=SAVE_DRIVER_STATE;
+ BX=bufferSize;
+ ES=bufferSegment;
+ DX=0;
+ INTR(0x33,r);
+ }
+}
+
+void THWMouseDOS::biosSaveMyState()
+{
+ REGS r;
+ if (!myBufferAllocated)
+ {
+ AX=RETURN_DRIVER_STORAGE_REQUIREMENTS;
+ INTR(0x33,r);
+ myBufferSize=BX;
+ myBufferSegment=__dpmi_allocate_dos_memory((myBufferSize+15)>>4,
+ &myBufferSelector);
+ if (myBufferSegment!=-1)
+ myBufferAllocated = 1;
+ }
+ if (myBufferAllocated)
+ {
+ AX=SAVE_DRIVER_STATE;
+ BX=myBufferSize;
+ ES=myBufferSegment;
+ DX=0;
+ INTR(0x33,r);
+ }
+}
+
+void THWMouseDOS::Resume()
+{
+ REGS r;
+ biosSaveState();
+ buttonCount=myButtonCount;
+ if (!biosRestoreMyState())
+ {// Default to x=y=0
+ AX=POSITION_MOUSE_CURSOR;
+ CX=0;
+ DX=0;
+ INTR(0x33,r);
+ }
+}
+
+void THWMouseDOS::Suspend()
+{
+ biosSaveMyState();
+ biosRestoreState();
+}
+
+void THWMouseDOS::DeInit()
+{
+ if (handlerInstalled==True)
+ {
+ registerHandler(0xFFFF,0);
+ _go32_dpmi_free_real_mode_callback(&mouseIntInfo);
+ }
+}
+
+THWMouseDOS::~THWMouseDOS()
+{
+}
+
+void THWMouseDOS::ShowDrv()
+{
+ REGS r;
+ visible=1;
+ AX=SHOW_MOUSE_CURSOR;
+ INTR(0x33,r);
+}
+
+void THWMouseDOS::HideDrv()
+{
+ REGS r;
+ visible=0;
+ AX=HIDE_MOUSE_CURSOR;
+ INTR(0x33,r);
+}
+
+void THWMouseDOS::ShowEmulate()
+{
+ visible=1;
+ showMouseChar();
+}
+
+void THWMouseDOS::HideEmulate()
+{
+ visible=0;
+ resetMouseChar();
+}
+
+void THWMouseDOS::SetRange(ushort rx, ushort ry)
+{
+ REGS r;
+ // Used internally to draw the mouse
+ cols=(int)rx+1;
+ // Communicate it to the driver. Needed for video modes where the driver
+ // fails to know the screen size.
+ DX=rx<<3;
+ CX=0;
+ AX=DEFINE_HORIZONTAL_CURSOR_RANGE;
+ INTR(0x33,r);
+ DX=ry<<3;
+ CX=0;
+ AX=DEFINE_VERTICAL_CURSOR_RANGE;
+ INTR(0x33,r);
+}
+
+void THWMouseDOS::GetEvent(MouseEventType &me)
+{
+ REGS r;
+ int x,y;
+
+ AX=RETURN_POSITION_AND_BUTTON_STATUS;
+ INTR(0x33,r);
+ me.buttons=BX & 0x00ff;
+ x=me.where.x=(CX >> 3) & 0xFF;
+ y=me.where.y=(DX >> 3) & 0xFF;
+ me.doubleClick=False;
+ drawMouse(x,y);
+}
+
+void THWMouseDOS::Init()
+{
+ char *OS=getenv("OS");
+ // SET: NT reacts crashing when we use the mouse handler, don't know why
+ // and personally don't care, so just disable the handler.
+ if (OS && strcmp(OS,"Windows_NT")==0)
+ useMouseHandler=0;
+
+ // Look in the user options
+ long pollMouse=1;
+ TScreen::optSearch("PollMouse",pollMouse);
+ if (pollMouse)
+ useMouseHandler=0;
+
+ REGS r;
+ AX=RESET_DRIVER_AND_READ_STATUS;
+ INTR(0x33,r);
+ if (!AX)
+ return;
+ myButtonCount=buttonCount=BX & 0x00ff;
+
+ // Ok mouse is present, set the driver functions
+ setEmulation(emulateMouse);
+ THWMouse::setRange=SetRange;
+ THWMouse::GetEvent=GetEvent;
+ THWMouse::registerHandler=RegisterHandler;
+ THWMouse::Suspend=Suspend;
+ THWMouse::Resume=Resume;
+
+ screenBase=ScreenPrimary;
+ if (handlerInstalled==False && useMouseHandler)
+ {// Lock variables
+ LD(mouseIntRegs);
+ LD(intEvent);
+ LD(mouseChar);
+ LD(lastX);
+ LD(lastY);
+ LD(visible);
+ //LD(emulateMouse);
+ LD(drawCounter);
+ LD(cols);
+ LD(screenBase);
+ LD(TEventQueue::eventCount);
+ LD(TEventQueue::curMouse);
+ LD(TEventQueue::eventQueue);
+ LD(TEventQueue::mouseIntFlag);
+ LD(TEventQueue::eventQTail);
+ _go32_dpmi_lock_data(TEventQueue::eventQueue,eventQSize*sizeof(TEvent));
+ // Lock functions
+ _go32_dpmi_lock_code((void*)StartOfLockedFunctions,
+ (int)EndOfLockedFunctions-(int)StartOfLockedFunctions);
+ _go32_dpmi_lock_code((void *)TEventQueue::mouseInt,1024);
+ _go32_dpmi_lock_code((void *)CLY_Ticks,1024);
+ // Setup the RMCB
+ mouseIntInfo.pm_offset=(int)TEventQueue::mouseInt;
+ _go32_dpmi_allocate_real_mode_callback_retf(&mouseIntInfo,&mouseIntRegs);
+ handlerInstalled=True;
+ }
+ if (handlerInstalled==True)
+ registerHandler(0xFFFF,TEventQueue::mouseInt);
+}
+
+#else // DJGPP
+
+#include <tv/dos/mouse.h>
+
+#endif // else DJGPP
+
diff --git a/tvision/classes/dos/dosscr.cc b/tvision/classes/dos/dosscr.cc
new file mode 100644
index 0000000..f8e1f4e
--- /dev/null
+++ b/tvision/classes/dos/dosscr.cc
@@ -0,0 +1,1004 @@
+/**[txh]********************************************************************
+
+ DOS Screen (TScreenDOS) functions.
+
+ Copyright (c) 1998-2002 by Salvador E. Tropea (SET)
+ Contains code Copyright (c) 1996-1998 by Robert H”hne.
+
+ Some code for handling 8x10 fonts is adapted from djgpp libc:
+ Copyright (C) 1995-1999 DJ Delorie
+
+ Description:
+ This module implements the low level DOS screen access.
+
+ Configuration variables:
+ ScreenWidth
+ ScreenHeight
+ ScreenPalette
+ AppCP
+ ScrCP
+ InpCP
+ LoadSecondaryFont
+ ExtProgVideoMode
+ VideoMode
+ VGABIOSState 0 use registers, 1 use BIOS (default)
+ SaveVGAState 0 don't try to save/restore VGA chip state,
+ 1 try to save it using the strategy indicated by
+ VGABIOSState (default)
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#ifdef TVCompf_djgpp
+ #include <conio.h>
+#endif
+
+#define Uses_string
+#define Uses_unistd
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_TVOSClipboard
+#define Uses_TVCodePage
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVCompf_djgpp
+
+#include <dos.h>
+#include <malloc.h>
+#include <go32.h>
+#include <dpmi.h>
+#include <sys/farptr.h>
+#include <sys/movedata.h>
+
+#include <pc.h>
+#include <stdio.h>
+#include <sys/mono.h>
+
+#define TSCREEN_DEFINE_REGISTERS
+#include <tv/dos/screen.h>
+#include <tv/dos/key.h>
+#include <tv/dos/mouse.h>
+
+#define GET_DOS_VERSION 0x3000
+#define GET_GLOBAL_CODE_PAGE_TABLE 0x6601
+#define CHARGEN_SET_BLOCK_SPECIFIER 0x1103
+#define CHARGEN_LOAD_USER_SPECIFIED_PATTERNS 0x1110
+#define GET_FONT_INFORMATION 0x1130
+// 0x11xx services (Sets the BIOS Rom)
+#define FONT_8x8 0x12
+#define FONT_8x14 0x11
+#define FONT_8x16 0x14
+// GET_FONT_INFORMATION values
+#define GET_FONT_8x8 0x03
+#define GET_FONT_8x14 0x02
+#define GET_FONT_8x16 0x06
+
+int TScreenDOS::wasBlink=0;
+int TScreenDOS::slowScreen=0;
+uchar TScreenDOS::primaryFontSet=0,
+ TScreenDOS::secondaryFontSet=0,
+ TScreenDOS::fontsSuspended=0;
+int TScreenDOS::origCPScr,
+ TScreenDOS::origCPApp,
+ TScreenDOS::origCPInp;
+int TScreenDOS::fontSeg=-1;
+TScreenFont256 TScreenDOS::appFonts[2]={{0,0,NULL},{0,0,NULL}};
+
+const unsigned mdaBaseAddress=0xB0000;
+
+// Extern support functions
+extern void SaveScreen();
+extern void SaveScreenReleaseMemory();
+extern void RestoreScreen();
+extern void ScreenUpdate();
+extern ushort user_mode;
+extern char useBIOS_VGA_State;
+extern char saveVGA_State;
+
+void setBlinkState();
+void setIntenseState();
+int getBlinkState();
+
+TScreen *TV_DOSDriverCheck()
+{
+ TScreenDOS *drv=new TScreenDOS();
+ if (!TScreen::initialized)
+ {
+ delete drv;
+ return 0;
+ }
+ return drv;
+}
+
+TScreenDOS::TScreenDOS()
+{
+ // Currently initialization never fails
+ initialized=1;
+ if (dCB) dCB();
+
+ TDisplayDOS::Init();
+
+ TScreen::Resume=Resume;
+ TScreen::Suspend=Suspend;
+ TScreen::setCrtData=setCrtData;
+ TScreen::clearScreen=clearScreen;
+ TScreen::getCharacter=getCharacter;
+ TScreen::getCharacters=getCharacters;
+ TScreen::setCharacter=setCharacter;
+ TScreen::setCharacters=setCharacters;
+ TScreen::System_p=System;
+ TScreen::getFontGeometry=GetFontGeometry;
+ TScreen::setFont_p=SetFont;
+ TScreen::restoreFonts=RestoreFonts;
+
+ TVDOSClipboard::Init();
+ THWMouseDOS::Init();
+ TGKeyDOS::Init();
+
+ long aux;
+ if (optSearch("VGABIOSState",aux))
+ useBIOS_VGA_State=aux;
+ if (optSearch("SaveVGAState",aux))
+ saveVGA_State=aux;
+
+ // Set the code page
+ int dosCodePage=437; // United States code page, for all versions before 3.3
+ // get DOS version number, in the form of a normal number
+ AX=GET_DOS_VERSION;
+ dosInt();
+ unsigned ver=AH | ((AL & 0xff)<<8);
+ if (ver>=0x31E)
+ {
+ AX=GET_GLOBAL_CODE_PAGE_TABLE;
+ dosInt();
+ dosCodePage=BX;
+ }
+ // Look for user settings
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+ // User settings have more priority than detected settings
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : dosCodePage,
+ forcedScrCP!=-1 ? forcedScrCP : dosCodePage,
+ forcedInpCP!=-1 ? forcedInpCP : dosCodePage);
+ SetDefaultCodePages(dosCodePage,dosCodePage,dosCodePage);
+
+ flags0=CodePageVar | CanSetPalette | CanReadPalette | CursorShapes | UseScreenSaver |
+ CanSetBFont | CanSetSBFont | CanSetVideoSize;
+ user_mode=startupMode=getCrtMode();
+ SaveScreen();
+ unsigned startScreenWidth=GetCols(), startScreenHeight=GetRows();
+
+ unsigned maxX=startScreenWidth, maxY=startScreenHeight;
+ if (optSearch("ScreenWidth",aux))
+ maxX=aux;
+ if (optSearch("ScreenHeight",aux))
+ maxY=aux;
+ if (frCB)
+ {// Give a chance to the call back.
+ primaryFontSet=1;
+ appFonts[0].h=0;
+ long aux=0;
+ if (optSearch("LoadSecondaryFont",aux) && aux)
+ {
+ secondaryFontSet=1;
+ appFonts[1].h=0;
+ }
+ }
+ char *ext=optSearch("ExtProgVideoMode");
+ if (optSearch("VideoMode",aux))
+ {// if frCB installed it will use the application font
+ setCrtMode((ushort)aux);
+ }
+ else if (ext)
+ {
+ setCrtModeExt(ext);
+ if (frCB)
+ SelectFont(charLines,False); // Try loading the application font
+ }
+ else if (maxX!=startScreenWidth || maxY!=startScreenHeight)
+ {// if frCB installed it will use the application font
+ setCrtModeRes(maxX,maxY);
+ }
+ else
+ {
+ if (frCB)
+ SelectFont(charLines,False); // Try loading the application font
+ }
+ // User requested palette
+ if (parseUserPalette())
+ setPaletteColors(0,16,UserStartPalette);
+
+ screenMode=getCrtMode();
+ setCrtData();
+ // We use the video memory as buffer, not a malloced buffer
+ screenBuffer=(uint16 *)-1;
+ suspended=0;
+}
+
+void TScreenDOS::Resume()
+{
+ if (!dual_display)
+ {
+ GetDisPaletteColors(0,16,OriginalPalette);
+ SaveScreen();
+ //if (screenMode == 0xffff)
+ // screenMode = getCrtMode();
+ if (screenMode!=user_mode)
+ setCrtMode(screenMode);
+ if (wasBlink)
+ setBlinkState();
+ else
+ setIntenseState();
+ ResumeFonts();
+ SetDisPaletteColors(0,16,ActualPalette);
+ }
+ else
+ {
+ THWMouseDOS::setEmulation(1);
+ }
+ setCrtData();
+}
+
+TScreenDOS::~TScreenDOS()
+{
+ suspend(); // First suspend
+ SaveScreenReleaseMemory(); // Now we can release the memory
+ ReleaseMemFonts();
+ THWMouseDOS::DeInit();
+}
+
+void TScreenDOS::Suspend()
+{
+ if (!dual_display)
+ {
+ wasBlink=getBlinkState();
+ SuspendFonts();
+ RestoreScreen();
+ SetDisPaletteColors(0,16,OriginalPalette);
+ }
+}
+
+void TScreenDOS::setCrtData()
+{
+ if (dual_display)
+ {
+ screenMode =7;
+ screenWidth =80;
+ screenHeight=25;
+ cursorLines =0x0b0c;
+ }
+ else
+ {
+ screenMode =getCrtMode();
+ screenWidth =getCols();
+ screenHeight=getRows();
+ hiResScreen =Boolean(screenHeight>25);
+ if (screenMode==7)
+ cursorLines=0x0b0c; // ?
+ else
+ cursorLines=getCursorType();
+ setCursorType(0);
+ }
+}
+
+void TScreenDOS::clearScreen()
+{
+ if (dual_display)
+ _mono_clear(); // djgpp's libc
+ else
+ TDisplay::clearScreen(screenWidth,screenHeight);
+}
+
+ushort TScreenDOS::getCharacter(unsigned offset)
+{
+ return _farpeekw(_dos_ds,(dual_display ? mdaBaseAddress : ScreenPrimary)+offset*2);
+}
+
+void TScreenDOS::getCharacters(unsigned offset,ushort *buf,unsigned count)
+{
+ if (slowScreen)
+ {
+ _farsetsel(_dos_ds);
+ int ofs=(dual_display ? mdaBaseAddress : ScreenPrimary)+offset*2;
+ while (count--)
+ {
+ *buf++=_farnspeekw(ofs);
+ ofs+=2;
+ }
+ }
+ else
+ {
+ movedata(_dos_ds,(dual_display ? mdaBaseAddress : ScreenPrimary)+offset*2,
+ _my_ds(),(int)buf,count*2);
+ }
+}
+
+void TScreenDOS::setCharacter(unsigned offset,ushort value)
+{
+ _farpokew(_dos_ds,(dual_display ? mdaBaseAddress : ScreenPrimary)+offset*2,value);
+}
+
+void TScreenDOS::setCharacters(unsigned offset,ushort *values,unsigned count)
+{
+ if (slowScreen)
+ {
+ _farsetsel(_dos_ds);
+ int ofs = dual_display ? mdaBaseAddress : ScreenPrimary+offset*2;
+ while (count--)
+ {
+ _farnspokew(ofs,*values++);
+ ofs += 2;
+ }
+ }
+ else
+ {
+ movedata(_my_ds(),(int)values,_dos_ds,
+ (dual_display ? mdaBaseAddress : ScreenPrimary)+offset*2,count*2);
+ }
+}
+
+int TScreenDOS::System(const char *command, pid_t *pidChild, int in,
+ int out, int err)
+{
+ // fork mechanism not available
+ if (pidChild)
+ *pidChild=0;
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+}
+
+/*****************************************************************************
+ Windows clipboard implementation using WinOldAp API.
+*****************************************************************************/
+
+#define USE_TB
+
+// Numbers for the errors
+#define WINOLDAP_NoPresent 1
+#define WINOLDAP_ClpInUse 2
+#define WINOLDAP_TooBig 3
+#define WINOLDAP_Memory 4
+#define WINOLDAP_WinErr 5
+
+#define WINOLDAP_Errors 5
+
+#define IDENTIFY_WinOldAp_VERSION 0x1700
+#define OPEN_CLIPBOARD 0x1701
+#define EMPTY_CLIPBOARD 0x1702
+#define SET_CLIPBOARD_DATA 0x1703
+#define GET_CLIPBOARD_DATA_SIZE 0x1704
+#define GET_CLIPBOARD_DATA 0x1705
+#define CLOSE_CLIPBOARD 0x1708
+
+// Strings for the errors
+const char *TVDOSClipboard::dosNameError[]=
+{
+ NULL,
+ __("Windows not present"),
+ __("Clipboard in use by other application"),
+ __("Clipboard too big for the transfer buffer"),
+ __("Not enough memory"),
+ __("Windows reports error")
+};
+
+int TVDOSClipboard::isValid=0;
+int TVDOSClipboard::Version;
+
+int TVDOSClipboard::Init(void)
+{
+ AX=IDENTIFY_WinOldAp_VERSION;
+ MultiplexInt();
+ Version=AX;
+ isValid=AX!=IDENTIFY_WinOldAp_VERSION;
+ if (!isValid)
+ TVOSClipboard::error=WINOLDAP_NoPresent;
+ else
+ {
+ TVOSClipboard::copy=copy;
+ TVOSClipboard::paste=paste;
+ TVOSClipboard::available=1; // We have 1 clipboard
+ TVOSClipboard::name="Windows";
+ TVOSClipboard::errors=WINOLDAP_Errors;
+ TVOSClipboard::nameErrors=dosNameError;
+ }
+ return isValid;
+}
+
+int TVDOSClipboard::AllocateDOSMem(unsigned long size,unsigned long *BaseAddress)
+{
+ #ifdef USE_TB
+ unsigned long tbsize=_go32_info_block.size_of_transfer_buffer;
+
+ if (size<=tbsize)
+ {
+ *BaseAddress=__tb;
+ return 1;
+ }
+ #endif
+ if (size>0x100000)
+ {
+ TVOSClipboard::error=WINOLDAP_TooBig;
+ return 0;
+ }
+ AH=0x48;
+ BX=(size>>4)+(size & 0xF ? 1 : 0);
+ MultiplexInt();
+ if (r.x.flags & 1)
+ {
+ TVOSClipboard::error=WINOLDAP_TooBig;
+ return 0;
+ }
+ *BaseAddress=AX<<4;
+ return 1;
+}
+
+void TVDOSClipboard::FreeDOSMem(unsigned long Address)
+{
+ #ifdef USE_TB
+ if (Address==__tb)
+ return;
+ #endif
+ AH=0x49;
+ ES=Address>>4;
+ TDisplayDOS::dosInt();
+}
+
+//#define DEBUG_CLIPBOARD
+#ifdef DEBUG_CLIPBOARD
+ ushort messageBox( const char *msg, ushort aOptions );
+ ushort messageBox( ushort aOptions, const char *fmt, ... );
+ #define DBGMessage(a) messageBox(a,0x402)
+ #define DBGMessage2(a,b) messageBox(0x402,a,b)
+#else
+ #define DBGMessage(a)
+ #define DBGMessage2(a,b)
+#endif
+
+int TVDOSClipboard::copy(int id, const char *buffer, unsigned len)
+{
+ if (!isValid || id!=0) return 0;
+
+ unsigned long dataoff;
+ char cleaner[32];
+ int winLen;
+ int ret=1;
+
+ AX=OPEN_CLIPBOARD;
+ MultiplexInt();
+ if (AX==0)
+ {
+ DBGMessage("Error opening the clipboard");
+ TVOSClipboard::error=WINOLDAP_ClpInUse;
+ return 0;
+ }
+ // Erase the current contents of the clipboard
+ AX=EMPTY_CLIPBOARD;
+ MultiplexInt();
+ winLen=((len+1)+0x1F) & ~0x1F;
+ memset(cleaner,0,32);
+ if (AllocateDOSMem(winLen,&dataoff))
+ {
+ dosmemput(buffer,len,dataoff);
+ dosmemput(cleaner,winLen-len,dataoff+len);
+ AX=SET_CLIPBOARD_DATA;
+ DX=7; // OEM text
+ BX=dataoff & 0x0f;
+ ES=(dataoff>>4) & 0xffff;
+ SI=winLen>>16;
+ CX=winLen & 0xffff;
+ MultiplexInt();
+ FreeDOSMem(dataoff);
+ if (AX==0)
+ {
+ DBGMessage("Error copying to clipboard");
+ TVOSClipboard::error=WINOLDAP_WinErr;
+ ret=0;
+ }
+ }
+ else
+ {
+ TVOSClipboard::error=WINOLDAP_Memory;
+ DBGMessage("Error allocating DOS memory");
+ ret=0;
+ }
+ AX=CLOSE_CLIPBOARD;
+ MultiplexInt();
+ return ret;
+}
+
+char *TVDOSClipboard::paste(int id, unsigned &len)
+{
+ if (!isValid || id!=0) return NULL;
+
+ char *p=NULL;
+ unsigned long BaseAddress;
+ unsigned long size;
+
+ AX=OPEN_CLIPBOARD;
+ MultiplexInt();
+ if (AX==0)
+ {
+ DBGMessage("Error at open clipboard");
+ TVOSClipboard::error=WINOLDAP_ClpInUse;
+ return NULL;
+ }
+ AX=GET_CLIPBOARD_DATA_SIZE;
+ DX=1;
+ MultiplexInt();
+ size=AX+(DX<<16);
+ DBGMessage2("Size of clipboard %d",size);
+ if (size)
+ {
+ if (AllocateDOSMem(size,&BaseAddress))
+ {
+ p=new char[size];
+ if (p)
+ {
+ DX=7;
+ BX=BaseAddress & 0x0f;
+ ES=(BaseAddress>>4) & 0xffff;
+ AX=GET_CLIPBOARD_DATA;
+ MultiplexInt();
+ dosmemget(BaseAddress,size,p);
+ len=strlen(p);
+ DBGMessage2("Got %d bytes in string",len);
+ }
+ else
+ TVOSClipboard::error=WINOLDAP_Memory;
+ FreeDOSMem(BaseAddress);
+ }
+ else
+ {
+ TVOSClipboard::error=WINOLDAP_Memory;
+ DBGMessage("Error allocating DOS memory");
+ }
+ }
+ else
+ {
+ p=new char[1];
+ *p=0;
+ len=0;
+ }
+ AX=CLOSE_CLIPBOARD;
+ MultiplexInt();
+ return p;
+}
+
+/*****************************************************************************
+ Fonts routines
+*****************************************************************************/
+
+int TScreenDOS::GetFontGeometry(unsigned &w, unsigned &h)
+{
+ w=8;
+ h=charLines;
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That selects what fonts are used for no/intense foreground colors.@p
+ The bits of the call are a little tweaked because it's EGA compatible:@*
+---VGA---@*
+ 0,1,4 block selected by characters with attribute bit 3 clear@*
+ 2,3,5 block selected by characters with attribute bit 3 set@*
+
+***************************************************************************/
+
+void TScreenDOS::SetDualCharacter(int b1, int b2)
+{
+ int value;
+ // No intense foreground font
+ value=b1 & 0x3;
+ if (b1 & 0x4)
+ value|=0x10;
+ // intense foreground font
+ value|=(b2 & 0x3)<<2;
+ if (b2 & 0x4)
+ value|=0x20;
+
+ AX=CHARGEN_SET_BLOCK_SPECIFIER;
+ BL=value;
+ videoInt();
+}
+
+void TScreenDOS::SetFontBIOS(int which, unsigned height, uchar *data,
+ int modeRecalculate)
+{
+ dosmemput(data,256*height,__tb);
+ ES=__tb>>4; /* pass pointer to our font in ES:BP */
+ BP=__tb & 0xF;
+ DX=0; /* 1st char: ASCII 0 */
+ CX=256; /* 256 chars */
+ BH=height; /* points per char */
+ BL=which; /* block */
+ AX=CHARGEN_LOAD_USER_SPECIFIED_PATTERNS;
+ if (!modeRecalculate)
+ AL&=0xF; /* force full mode recalculate, service 0x1100 */
+ videoInt();
+}
+
+void TScreenDOS::ReleaseMemFonts()
+{
+ if (appFonts[0].data)
+ {
+ free(appFonts[0].data);
+ appFonts[0].data=NULL;
+ }
+ if (appFonts[1].data)
+ {
+ free(appFonts[1].data);
+ appFonts[1].data=NULL;
+ }
+}
+
+int TScreenDOS::MemorizeFont(int which, TScreenFont256 *font)
+{
+ // Keep a copy of the user font
+ appFonts[which].w=font->w;
+ appFonts[which].h=font->h;
+ if (appFonts[which].data)
+ free(appFonts[which].data);
+ unsigned size=font->h*256;
+ appFonts[which].data=(uchar *)malloc(size);
+ if (!appFonts[which].data)
+ return 0;
+ memcpy(appFonts[which].data,font->data,size);
+ return 1;
+}
+
+void TScreenDOS::SuspendFonts()
+{
+ if (fontsSuspended)
+ return;
+ fontsSuspended=1;
+ if (!primaryFontSet && !secondaryFontSet)
+ return; // Nothing to do
+ DisableDualFont();
+ SelectRomFont(charLines,0,0);
+}
+
+void TScreenDOS::ResumeFonts()
+{
+ if (!fontsSuspended)
+ return;
+ fontsSuspended=0;
+ if (!primaryFontSet && !secondaryFontSet)
+ return; // Nothing to do
+ if (primaryFontSet)
+ SetFontBIOS(0,charLines,appFonts[0].data,0);
+ if (secondaryFontSet)
+ {
+ SetFontBIOS(1,charLines,appFonts[1].data,0);
+ EnableDualFont();
+ }
+}
+
+int TScreenDOS::SetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP, int appCP)
+{
+ if (!changeP && !changeS) return 1;
+ // Check for restore fonts
+ if (changeP && !fontP && ((!changeS && !secondaryFontSet) || (changeS && !fontS)))
+ {
+ DisableDualFont();
+ SelectRomFont(charLines,0,0);
+ ReleaseMemFonts();
+ secondaryFontSet=primaryFontSet=0;
+ if (fontCP!=-1)
+ {
+ if (appCP==-1)
+ TVCodePage::SetScreenCodePage(fontCP);
+ else
+ TVCodePage::SetCodePage(appCP,fontCP,-1);
+ }
+ return 1;
+ }
+ // Solve the sizes
+ unsigned wP=8,hP=charLines,
+ wS=8,hS=charLines;
+ int newP=changeP && fontP;
+ if (newP)
+ {
+ wP=fontP->w;
+ hP=fontP->h;
+ }
+ int newS=changeS && fontS;
+ if (newS)
+ {
+ wS=fontS->w;
+ hS=fontS->h;
+ }
+ if (wP!=wS || hP!=hS) return 0;
+ // Check if the size is in the range
+ if (wP!=8 || hP!=charLines)
+ return 0;
+ // Memorize the new fonts
+ if (newP && !MemorizeFont(0,fontP)) return 0;
+ if (newS && !MemorizeFont(1,fontS)) return 0;
+
+ // Change the requested fonts
+ if (changeP)
+ {
+ if (!primaryFontSet)
+ TVCodePage::GetCodePages(origCPApp,origCPScr,origCPInp);
+ if (fontP)
+ {
+ SetFontBIOS(0,charLines,fontP->data,0);
+ primaryFontSet=1;
+ }
+ else
+ {
+ SelectRomFont(charLines,0,0);
+ primaryFontSet=0;
+ }
+ }
+ if (changeS)
+ {
+ if (fontS)
+ {
+ SetFontBIOS(1,charLines,fontS->data,0);
+ EnableDualFont();
+ secondaryFontSet=1;
+ }
+ else
+ {
+ DisableDualFont();
+ secondaryFontSet=0;
+ }
+ }
+ if (changeP && fontCP!=-1)
+ {
+ if (appCP==-1)
+ TVCodePage::SetScreenCodePage(fontCP);
+ else
+ TVCodePage::SetCodePage(appCP,fontCP,-1);
+ }
+ return 1;
+}
+
+void TScreenDOS::RestoreFonts()
+{
+ if (!primaryFontSet && !secondaryFontSet)
+ return; // Protection
+ SetFont(1,NULL,1,NULL,origCPScr,origCPApp);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Selects a font of the desired size. Currently only 8x8, 8x10, 8x14 and
+8x16 are supported but I did it in this way because nobody knows about the
+future.@p
+ If noForce is != 0 then the routine doesn't set the fonts. This option
+must be used when you know that BIOS already loaded the fonts. Using it
+avoids an extra load. The derived classes takes the desition according to
+the selected font, so if the user selected a font the load is forced.@p
+ If modeRecalculate is 1 the call to set the BIOS font is made using the
+bit 4 on, that means the BIOS will recalculate some things like the number
+of rows and cols in the screen. That's avoided when an external program
+sets the mode because a recalculation can fail.@p
+
+ Return:
+ non-zero if fails, zero if all ok.
+
+***************************************************************************/
+
+int TScreenDOS::SelectRomFont(int height, int which, int modeRecalculate)
+{
+ //UseDefaultFontsNextTime=0;
+ switch (height)
+ {
+ case 8:
+ SetRomFonts(FONT_8x8,which,modeRecalculate);
+ break;
+ case 10:
+ if (Load8x10Font(which,modeRecalculate))
+ return 1;
+ break;
+ case 14:
+ SetRomFonts(FONT_8x14,which,modeRecalculate);
+ break;
+ case 16:
+ SetRomFonts(FONT_8x16,which,modeRecalculate);
+ break;
+ default:
+ return 1;
+ }
+ return 0;
+}
+
+void TScreenDOS::SetRomFonts(int sizeFont, int which, int modeRecalculate)
+{
+ if (!modeRecalculate)
+ sizeFont&=0xF;
+ BL=which;
+ AH=0x11;
+ AL=sizeFont;
+ videoInt();
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Stretch a 8x8 font to the 8x10 character box. This is required to
+use 80x40 mode on a VGA or 80x35 mode on an EGA, because the character
+box is 10 lines high, and the ROM BIOS doesn't have an appropriate font.
+So we create one from the 8x8 font by adding an extra blank line
+from each side.
+
+***************************************************************************/
+
+void TScreenDOS::MaybeCreate8x10Font(void)
+{
+ unsigned char *p;
+ unsigned long src, dest, i, j;
+
+ if (fontSeg!=-1)
+ return;
+ int buf_pm_sel;
+
+ /* Allocate buffer in conventional memory. */
+ fontSeg=__dpmi_allocate_dos_memory(160,&buf_pm_sel);
+
+ if (fontSeg==-1)
+ return;
+
+ /* Get the pointer to the 8x8 font table. */
+ p=(uchar *)malloc(2560); /* 256 chars X 8x10 pixels */
+ if (p==(uchar *)0)
+ {
+ //errno=ENOMEM;
+ __dpmi_free_dos_memory(buf_pm_sel);
+ fontSeg=-1;
+ return;
+ }
+ BH=GET_FONT_8x8;
+ AX=GET_FONT_INFORMATION;
+ videoInt();
+ src=(((unsigned)ES)<<4)+BP;
+ dest=((unsigned)fontSeg)<<4;
+
+ /* Now copy the font to our table, stretching it to 8x10. */
+ _farsetsel(_dos_ds);
+ for (i=0; i<256; i++)
+ {
+ /* Fill first extra scan line with zeroes. */
+ _farnspokeb(dest++, 0);
+
+ for (j=0; j<8; j++)
+ {
+ uchar val=_farnspeekb(src++);
+ _farnspokeb(dest++,val);
+ }
+
+ /* Fill last extra scan line with zeroes. */
+ _farnspokeb(dest++,0);
+ }
+}
+
+/* Load the 8x10 font we created into character generator RAM. */
+int TScreenDOS::Load8x10Font(int which, int modeRecalculate)
+{
+ MaybeCreate8x10Font(); /* create if needed */
+ if (fontSeg==-1)
+ return 1;
+ ES=fontSeg; /* pass pointer to our font in ES:BP */
+ BP=0;
+ DX=0; /* 1st char: ASCII 0 */
+ CX=256; /* 256 chars */
+ BH=10; /* 10 points per char */
+ BL=which; /* block */
+ AX=CHARGEN_LOAD_USER_SPECIFIED_PATTERNS;
+ if (!modeRecalculate)
+ AL&=0xF;
+ videoInt();
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used after setting a video mode to load the user font or the BIOS font.
+The force parameter indicates if we must load the BIOS font or if the font
+was already loaded.@p
+ If a font was set the application this function tries to reuse it. If the
+font doesn't match the size used by the video mode calls a call back
+requesting a new font. If the routine fails to get a propper font the BIOS
+font is restored.
+
+***************************************************************************/
+
+void TScreenDOS::SelectFont(unsigned height, Boolean Force)
+{
+ int fontWasLoaded=primaryFontSet || secondaryFontSet;
+
+ if (primaryFontSet && !fontsSuspended)
+ {
+ if (height==appFonts[0].h)
+ SetFontBIOS(0,height,appFonts[0].data,0);
+ else
+ {
+ int fontOk=0;
+ // The one provided by the application isn't suitable
+ if (frCB)
+ {// Try asking the application to provide a new one
+ TScreenFont256 *font=frCB(0,8,height);
+ if (font)
+ {
+ SetFontBIOS(0,height,font->data,0);
+ MemorizeFont(0,font);
+ fontOk=1;
+ DeleteArray(font->data);
+ delete font;
+ }
+ }
+ if (!fontOk)
+ {
+ if (Force)
+ SelectRomFont(height,0,1);
+ primaryFontSet=0;
+ }
+ }
+ }
+ else
+ {
+ if (Force)
+ SelectRomFont(height,0,1);
+ }
+
+ if (!fontsSuspended && secondaryFontSet)
+ {
+ if (height==appFonts[1].h)
+ SetFontBIOS(1,height,appFonts[1].data,0);
+ else
+ {
+ int fontOk=0;
+ // The one provided by the application isn't suitable
+ if (frCB)
+ {// Try asking the application to provide a new one
+ TScreenFont256 *font=frCB(1,8,height);
+ if (font)
+ {
+ SetFontBIOS(1,height,font->data,0);
+ MemorizeFont(1,font);
+ fontOk=1;
+ DeleteArray(font->data);
+ delete font;
+ }
+ }
+ if (!fontOk)
+ {
+ DisableDualFont();
+ secondaryFontSet=0;
+ }
+ }
+ }
+
+ if (fontWasLoaded && !(primaryFontSet || secondaryFontSet))
+ // Restore the original encoding if we forced ROM fonts
+ TVCodePage::SetCodePage(origCPApp,origCPScr,origCPInp);
+}
+
+
+#else // DJGPP
+
+#include <tv/dos/screen.h>
+#include <tv/dos/key.h>
+#include <tv/dos/mouse.h>
+
+#endif // else DJGPP
+
diff --git a/tvision/classes/dos/rhscreen.cc b/tvision/classes/dos/rhscreen.cc
new file mode 100644
index 0000000..28159a9
--- /dev/null
+++ b/tvision/classes/dos/rhscreen.cc
@@ -0,0 +1,253 @@
+/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+/* Copyright 1998-2002 Salvador E. Tropea */
+#include <tv/configtv.h>
+
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVCompf_djgpp
+#include <sys/types.h>
+#include <sys/movedata.h>
+#include <sys/farptr.h>
+#include <go32.h>
+#include <dpmi.h>
+//#include <conio.h>
+extern "C" void intensevideo(void);
+extern "C" void blinkvideo(void);
+#include <pc.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <tv/dos/screen.h>
+
+//#define DEBUG
+#define TOSTDERR
+#ifndef DEBUG
+#define dbprintf(a...)
+#else
+# ifdef TOSTDERR
+# define dbprintf(a...) fprintf(stderr,a)
+# else
+# define dbprintf(a...) printf(a)
+# endif
+#endif
+
+extern ushort user_mode;
+int blink_use_bios = 0;
+
+static unsigned int user_cursor_x;
+static unsigned int user_cursor_y;
+static void *user_screen = NULL;
+static int user_screen_size = 0;
+static int user_screen_len;
+static ushort user_cursor;
+static int user_blink = 1;
+void rh_save_vga_state();
+void rh_restore_vga_state();
+
+int getBlinkState(void)
+{
+ int retval;
+ if (TScreen::screenMode == 7) return 1;
+ if (blink_use_bios)
+ {
+ retval = _farpeekb(_dos_ds,0x465) & 0x20;
+ }
+ else
+ {
+ inportb(0x3DA);
+ outportb(0x3C0,0x30);
+ retval = inportb(0x3C1) & 0x8;
+ }
+ return retval;
+}
+
+void setBlinkState(void)
+{
+ if (TScreen::screenMode == 7) return;
+ if (getBlinkState()) return;
+ if (blink_use_bios)
+ {
+ blinkvideo();
+ }
+ else
+ {
+ char val;
+ inportb(0x3DA);
+ outportb(0x3C0,0x30);
+ val=inportb(0x3C1);
+ outportb(0x3C0,val | 0x8);
+ }
+}
+
+void setIntenseState(void)
+{
+ if (TScreen::screenMode == 7) return;
+ if (!getBlinkState()) return;
+ if (blink_use_bios)
+ {
+ intensevideo();
+ }
+ else
+ {
+ char val;
+ inportb(0x3DA);
+ outportb(0x3C0,0x30);
+ val=inportb(0x3C1);
+ outportb(0x3C0,val & 0xF7);
+ }
+}
+
+#define SCREEN_BASE (_farpeekb(_dos_ds, 0x449) == 7 ? 0xB0000 : 0xB8000)
+
+static
+void ScreenUpdate()
+{
+ movedata(_my_ds(),(int)user_screen,_dos_ds,SCREEN_BASE,user_screen_len);
+}
+
+
+static
+void ScreenRetrieve()
+{
+ movedata(_dos_ds,SCREEN_BASE,_my_ds(),(int)user_screen,user_screen_len);
+}
+
+void rh_save_vesa();
+void rh_restore_vesa();
+int rh_is_vesa_mode();
+void rh_check_for_vesa();
+void rh_save_vga();
+void rh_restore_vga();
+int rh_is_vga_mode();
+
+extern int rh_vesa_supported;
+static int vesa_checked = 0;
+
+static int vesa_mode;
+static int vga_mode;
+
+static unsigned char palette[3*256];
+int save_text_palette = 0;
+
+static
+void save_palette()
+{
+ int i;
+ outportb(0x3c7,0);
+ for (i=0;i<256;i++)
+ {
+ palette[i*3+0] = inportb(0x3c9);
+ palette[i*3+1] = inportb(0x3c9);
+ palette[i*3+2] = inportb(0x3c9);
+ }
+}
+
+static
+void restore_palette()
+{
+ int i;
+ outportb(0x3c8,0);
+ for (i=0;i<256;i++)
+ {
+ outportb(0x3c9,palette[i*3+0]);
+ outportb(0x3c9,palette[i*3+1]);
+ outportb(0x3c9,palette[i*3+2]);
+ }
+}
+
+void rh_SaveVideo(int cols,int rows)
+{
+ int screensize;
+ user_mode = 0;
+ vesa_mode = 0;
+ if (!vesa_checked)
+ {
+ rh_check_for_vesa();
+ vesa_checked = 1;
+ }
+ if (rh_vesa_supported && (vesa_mode = rh_is_vesa_mode()))
+ {
+ dbprintf("Saving VESA mode %d\n",vesa_mode);
+ rh_save_vesa();
+ }
+ else
+ if ((vga_mode = rh_is_vga_mode()))
+ {
+ dbprintf("Saving VGA mode %d\n",vga_mode);
+ rh_save_vga();
+ }
+ else
+ {
+ dbprintf("Saving text mode\n");
+ screensize = cols*rows*2;
+ TDisplay::getCursorPos(user_cursor_x,user_cursor_y);
+ user_cursor = TScreen::getCursorType();
+ user_mode = TScreen::getCrtMode();
+ user_blink = getBlinkState();
+ if (user_mode != 7)
+ {
+ rh_save_vga_state();
+ if (save_text_palette)
+ save_palette();
+ }
+ if (screensize > user_screen_size)
+ {
+ user_screen = realloc(user_screen,screensize);
+ user_screen_size = screensize;
+ }
+ user_screen_len = screensize;
+ ScreenRetrieve();
+ }
+}
+
+// SET: Added to release the memory of this module.
+void rh_SaveVideoReleaseMemory(void)
+{
+ free(user_screen);
+}
+
+
+void rh_RestoreVideo()
+{
+ if (vesa_mode)
+ {
+ rh_restore_vesa();
+ dbprintf("Restoring VESA mode\n");
+ }
+ else
+ if (vga_mode)
+ {
+ rh_restore_vga();
+ dbprintf("Restoring VGA mode\n");
+ }
+ else
+ {
+ dbprintf("Restoring text mode\n");
+ if (user_mode != 7)
+ rh_restore_vga_state();
+ /*TFont::UseDefaultFontsNextTime=1;*/
+ if (TScreen::screenMode != user_mode)
+ TDisplay::setCrtMode(user_mode);
+ /*else
+ TDisplay::RestoreDefaultFont();*/
+ if (user_blink)
+ setBlinkState();
+ else
+ setIntenseState();
+ ScreenUpdate();
+ TDisplay::setCursorType(user_cursor);
+ TDisplay::setCursorPos(user_cursor_x,user_cursor_y);
+ if (user_mode != 7 && save_text_palette)
+ restore_palette();
+ if (user_mode != 7)
+ rh_restore_vga_state();
+ }
+}
+
+#else
+
+#include <tv/dos/screen.h>
+
+#endif
diff --git a/tvision/classes/dos/screen.cc b/tvision/classes/dos/screen.cc
new file mode 100644
index 0000000..2f92ae5
--- /dev/null
+++ b/tvision/classes/dos/screen.cc
@@ -0,0 +1,51 @@
+/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+/* Copyright 1998-2002 Salvador E. Tropea */
+#include <tv/configtv.h>
+
+#define Uses_stdlib
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVCompf_djgpp
+ushort user_mode;
+
+#define MODE_SET 1 // Use the routines from SET
+#define MODE_RH 0 // Use the routines from RH
+
+int screen_saving = MODE_RH;
+
+void rh_SaveVideo(int,int);
+void rh_SaveVideoReleaseMemory(void);
+void rh_RestoreVideo();
+void set_SaveVideo(int,int);
+void set_RestoreVideo();
+
+void SaveScreen()
+{
+ if (screen_saving == MODE_SET)
+ set_SaveVideo(TDisplay::getCols(),TDisplay::getRows());
+ else
+ if (screen_saving == MODE_RH)
+ rh_SaveVideo(TDisplay::getCols(),TDisplay::getRows());
+}
+
+// SET: Added to release the memory allocated here
+void SaveScreenReleaseMemory(void)
+{
+ if (screen_saving == MODE_RH)
+ rh_SaveVideoReleaseMemory();
+}
+
+void RestoreScreen()
+{
+ if (screen_saving == MODE_SET)
+ set_RestoreVideo();
+ else
+ if (screen_saving == MODE_RH)
+ rh_RestoreVideo();
+}
+#endif
+
+
diff --git a/tvision/classes/dos/sescreen.cc b/tvision/classes/dos/sescreen.cc
new file mode 100644
index 0000000..4dd3195
--- /dev/null
+++ b/tvision/classes/dos/sescreen.cc
@@ -0,0 +1,1548 @@
+/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+/* Copyright 1999-2002 Salvador E. Tropea */
+#include <tv/configtv.h>
+
+/* This is needed, because get the correct textmode */
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVCompf_djgpp
+/* This file is for saving/restoring the screen in graphics and/or
+ text modes. Many parts and most of the very good comments came
+ from SET.
+
+ NOTE: by SET 1999-04: I think this code is broken and I check it latter
+ so I'm not fixing here the VESA stuff about using the __tb.
+*/
+/*
+ Hi Robert:
+
+----------------------------------------------------------------------------
+Chapter 1) XMode v.s. Text modes:
+
+ I'm sure that this weekend you arrive to the same conclution that me, or
+may be not:
+ Your code works OK to restore Mode 3 -> X-Mode -> Mode 3 -> X-Mode, but
+if I use a better text mode like 80x60 the code doesn't work, in fact works
+only up to 80x50 or up to 132x25.
+ I'll try to explain you my conclutions:
+
+ The VGA controler use a linear mode when is in text mode, in this linear
+mode the first char in 0xB8000 is the first char in your memory (256Kb).
+ So if you set an 80x60 mode you'll use 80x60x2 bytes of the memory that's
+9600 bytes and you are saving only 8192 bytes!!, so the result is that a part
+of the screen isn't restored.
+ May be I wasn't clear when I said that you save 8192: In planar modes you
+access to the position 0 in the video memory in plane 0 (or 1 depending on
+if we start to number from 0 or 1), the position 0 in the plane 1 is the
+position 65536 of the memory with respect to the linear mode, so saving
+32Kb you save 0-8Kb 64Kb-72Kb 128Kb-136Kb and 192Kb-200Kb (ever taking the
+linear as reference).
+ So in 132x60 (for example) you must save 0-15840 and you only save 0-8Kb.
+ I modified your code to make that, perhapes is better if you rewrite it from
+the new knowledge.
+ Now, saving Cols*Rows*2 bytes of plane 0 (I called plane 1 in the code),
+you'll save all but .... I saw that the plane 1 is wasted too!, so you must
+save the same amount for plane 1. The plane 2 have the fonts, seems that
+the BIOS uses half of the RAM (0-128Kb) for different text pages and the
+rest for fonts, at least in my board the fonts are stored in plane 2, now
+how much uses?, in my board there are fonts from 8x8 to 9x16, 9x16 means 32
+bytes per character so with 256 chars you'll use 8192. Finally plane 3
+remains untouched so we don't need to save it.
+ That's (80x25*2)*2+8192=16192 => ONLY 16Kb! (and not 64Kb = 32Kb+malloc
+overhead like the previous version) and in the worst case 39872 and that's
+just the same amount of memory wasted but saves the right thing.
+ Now the question is: Is that correct in other cards?.
+
+ I don't know if you understood my code (the one that I sent you some weeks
+ago), in my code I don't need to worry about if the mode is planar or linear,
+I just setup a planar addressing mode, why you don't make that, is easier. If
+you are worring about the flickering I can cure that.
+-----------------------------------------------------------------------------
+Chapter 2) 16 colors mode v.s. Text modes:
+
+ Well that's almost the same as an X-mode but ... you are making some thing
+very strange, I must admit that I tried for 4 hours until I get a working
+routine but is the same as X-mode.
+ From what I can see you don't have any documentation about the VGA
+registers, is that true?, I have a nice Norton Guide for it.
+ Anyways you are using the write mode 3, this mode is useful for tricks but
+not for dumping memory, in mode 3 you need 2 operations by byte in memory,
+you are making that with the ANDL, but if you use mode 0 you can do the same
+just with a simple write, of course you must be sure that all the registers
+involved will not mask your write.
+ In this file I'm using the same routine for:
+
+ 320x200x16
+ 640x200x16
+ 640x350x16
+ 640x480x16
+ 320x240x256
+ 320x400x256
+ 360x480x256
+
+-----------------------------------------------------------------------------
+Chapter 3) Mode 0x13 v.s. Text modes:
+
+ You think that this is the easier?, lamentably no.
+ This mode is not linear like text mode and is not planar as the 16 colors
+modes and mode X, so what is?, the bits 0 and 1 of the address sets the plane
+so two adjacent pixels addressed with 1 of difference are in different planes,
+that's very good for programing, the mode is very easy to handle, but isn't
+good for owr purposes. I don't have enough information but seems that the
+constroler uses 1/4 of the pixels to show the screen, so if the user sets
+the mode 0x13 and don't make any strange thing we only need to save:
+
+ max(8192,Cols*Rows*2)
+
+ 8192 is for the fonts, that's what the current program does, the problem is
+that we are saving pixels that aren't needed and don't saving pixels that
+we will touch. Until now I don't know how to address the missing pixels.
+
+ Now pass to vga2.cc where I continue.
+
+*/
+
+/*
+ Well that's the second part:
+
+ As I can't address the right memory in the 0x13 mode I placed my old
+methode again here, so now I save 16Kb for 80x25 and 39Kb (64Kb) for
+132x60.
+
+ Now I tested this file with:
+
+Card: Trident TGUI9440AGi
+Text modes:
+Mode Tx.Resol. Font Pixels
+0x50 80x30 (8x16 640x480)
+0x51 80x43 (8x11 640x473)
+0x52 80x60 (8x8 640x480)
+0x53 132x25 (8x14 1056x350)
+0x54 132x30 (8x16 1056x480)
+0x55 132x43 (8x11 1056x473)
+0x56 132x60 (8x8 1056x480)
+0x57 132x25 (9x14 1188x350)
+0x58 132x30 (9x16 1188x480)
+0x59 132x43 (9x11 1188x473)
+0x5A 132x60 (9x8 1188x480)
+0x108 80x60 (Vesa 1)
+0x109 132x25 (Vesa 1)
+0x10A 132x43 (Vesa 1)
+0x10B 132x60 (Vesa 1) <--- Must be x50 but Trident ...
+0x10C 132x60 (Vesa 1)
+
+To Graphic modes:
+ 320x200x16 (0x0D)
+ 640x200x16 (0x0E)
+ 640x350x16 (0x10)
+ 640x480x2 (0x11) Partially tested.
+ 640x480x16 (0x12)
+ 320x200x256 (0x13)
+ 320x240x256 X-Mode
+ 320x400x256 X-Mode
+ 360x480x256 X-Mode
+
+*/
+
+/*
+ Well ...
+
+Chapter 4) VESA v.s. Text modes:
+
+ Here I have some problems, the 16 color modes can be handled in the same
+way, and as we never need to handle more that 132*60*2=15840 bytes per plane
+we don't need any bank switch, so I used the same trick that in VGA to skip
+a plane. May be is wrong assumption, but all the boards that I know have
+32Kb, 64Kb and 128Kb windows.
+ The 256 color modes are harder, I can only guess here, in my board seems
+to be like a mode 0x13 but ALL the pixels are visible (not 1/4), so saving
+32Kb like you tried doesn't work for the 132*60 because this mode uses
+15840 bytes in the first bank, so if you want to save the memory in a linear
+way you must save 132*60*2*4=63360 and that can envolve a bank switch in some
+cards, so I let your bank switch code, but for this case.
+ The routines seems to be OK for text modes, the vga.cc is not the best
+for text modes so I guess that is OK to handle VESA text modes with this
+routines and make a simple routine for non-VESA text modes (just the old
+thing in TScreen).
+ Why you don't use packed structures?, that will never be taked out from
+GCC and VESA is PC specific.
+
+ I tried switching from 1024x768x256 and 1024x768x16 to 132x60 and works OK.
+
+*/
+
+/*
+
+ Here is a version with Allegro, works in my machine, I tested Vesa 1.x,
+Vesa 2.0 banked, Vesa 2.0 linear and Trident and all seems to work OK. I]
+guess because even in Vesa 2.0 linear the Vesa 1.x functions still
+working.
+
+*/
+
+/*
+
+ That's the unified version, is supposed to work with all the modes ... ;-)
+ I joined the VGA routines, the VESA routines and routines to save the text
+modes, as the BIOS don't have any routine to retrieve the fonts I'm not
+restoring the original fonts but a fresh copy from the ROM. That can produce
+problems in mode too much twisted where the fonts aren't 8x8, 8x14 or 8x16.
+ There are examples with Allegro, GRX20 and conio.
+
+I changed some things:
+
+1) In save_vesa():
+
+ if (WinBAttributes & 0x3) // exist and readable
+ {
+>>>>>>>>> The condition is wrong you can get here if Win B exists and is
+>>>>>>>>> write-only!
+ window_r = 1;
+ win_seg_r = WinBSegment;
+ // I assume here, that now winb is writable. Is that correct??
+>>>>>>>>> May be is correct but, why take the risk?
+ window_w = 0;
+ win_seg_w = WinASegment;
+ }
+ So I rewritted that.
+
+2) I don't like to use DOS memory but lamentably you'll include it in the
+debugger so we can't use the transfer buffer :-(.
+
+3) In save_vesa():
+ I added bank_increment (see in the function) because WinGranularity can
+be different to WinSize.
+
+4) In restore_vesa():
+ I putted out the call to service 2 (set mode) because restore_vesa_state
+must be enough.
+
+5) The 16 colors VESA modes are using the same core routine that the VGA
+modes now.
+
+*/
+
+#include <stdlib.h>
+#include <sys/movedata.h>
+#include <sys/farptr.h>
+#include <dpmi.h>
+#include <go32.h>
+#include <pc.h>
+
+#include <tv/video.h>
+extern int user_mode;
+
+static void *buffer = NULL;
+static int buffer_size = 0;
+static int saved_size;
+static int window_r;
+static int window_w;
+static int win_size;
+static unsigned win_seg_r;
+static unsigned win_seg_w;
+static int bank_increment;
+static int is_plane_mode = 0;
+static int TextModeXres;
+static int TextModeYres;
+
+/*****************************************************************************
+
+*************************** VESA BIOS ROUTINES ******************************
+
+*****************************************************************************/
+/*****************************************************************************
+
+ Function: int GetVesaModeInfo(int mode)
+
+ Description: Gets the information of a VESA mode.
+ 0x4F01 service of VESA 1.x
+
+ Parameters:
+ int mode: The mode to ask to BIOS.
+
+ Return:
+ 0 fail.
+ 1 OK.
+
+ Note: Uses 256 bytes of DOS memory.
+
+*****************************************************************************/
+
+static int mode_info_segment = -1;
+static int mode_info_selector;
+
+static int GetVesaModeInfo(int mode)
+{
+ __dpmi_regs r;
+ if (mode_info_segment == -1)
+ mode_info_segment = __dpmi_allocate_dos_memory(16,&mode_info_selector);
+ if (mode_info_segment == -1)
+ return 0;
+ r.x.ax = 0x4f01;
+ r.x.es = mode_info_segment;
+ r.x.di = 0;
+ r.x.cx = mode;
+ __dpmi_int(0x10,&r);
+ if (r.x.ax != 0x004f)
+ return 0;
+ return 1;
+}
+
+/*****************************************************************************
+
+ Function: void save_vesa_state()
+
+ Description: Saves all the state of the VESA system to restore the mode
+ later. 0x4F04 Service.
+
+ Note: Uses an unknown amount of DOS memory (2.5Kb aprox.)
+
+*****************************************************************************/
+
+static int vesa_state_segment = -1;
+static int vesa_state_selector;
+
+static void save_vesa_state()
+{
+ __dpmi_regs r;
+ if (vesa_state_segment == -1)
+ {
+ r.x.ax = 0x4f04;
+ r.h.dl = 0x00;
+ r.x.cx = 0x000f;
+ __dpmi_int(0x10,&r);
+ if (r.x.ax != 0x004f) return;
+ vesa_state_segment =
+ __dpmi_allocate_dos_memory(r.x.bx*4,&vesa_state_selector);
+ if (vesa_state_segment == -1) return;
+ }
+ r.x.ax = 0x4f04;
+ r.h.dl = 0x01;
+ r.x.es = vesa_state_segment;
+ r.x.bx = 0;
+ r.x.cx = 0x000f;
+ __dpmi_int(0x10,&r);
+}
+
+/*****************************************************************************
+
+ Function: void restore_vesa_state(int What)
+
+ Description: Restores part or all of the saved information about the VESA
+ state. 0x4F04 Service.
+
+ Parameters:
+ int What: What was saved, USE RESTORE_VESA_ALL EVER.
+
+*****************************************************************************/
+
+static void restore_vesa_state(int What)
+{
+ __dpmi_regs r;
+ if (vesa_state_segment == -1) return;
+ r.x.ax = 0x4f04;
+ r.h.dl = 0x02;
+ r.x.es = vesa_state_segment;
+ r.x.bx = 0;
+ r.x.cx = What;
+ __dpmi_int(0x10,&r);
+}
+
+/*****************************************************************************
+
+ Function: void check_for_vesa()
+
+ Description: Checks if VESA BIOS is present.
+ 0x4F00 Service.
+
+ Notes:
+ 1) The result is stored in vesa_supported.
+ 2) Is called by the initialization routine.
+ 3) Uses 512 bytes of DOS memory, can be liberated.
+
+*****************************************************************************/
+
+static int vesa_supported = 0;
+
+static void check_for_vesa()
+{
+ __dpmi_regs r;
+
+ r.x.ax = 0x4f03;
+ __dpmi_int(0x10,&r);
+
+ /* Not supported */
+ if (r.h.al != 0x4f) return;
+
+ vesa_supported = 1;
+}
+
+/*****************************************************************************
+
+ Function: int is_vesa_mode()
+
+ Description: Checks if the current mode is VESA, if yes retrieves the
+ information about the mode. 0x4F03 Service.
+ Return:
+ 0 not, VESA or fail.
+ 1 VESA
+
+*****************************************************************************/
+
+static int is_vesa_mode()
+{
+ __dpmi_regs r;
+
+ r.x.ax = 0x4f03;
+ __dpmi_int(0x10,&r);
+
+ /* Not supported or not successful */
+ if (r.x.ax != 0x004f) return 0;
+
+ /* Because GetVesaModeInfo forces a screen switch under W95, I check
+ the most common textmode here without calling that function */
+ if (r.x.bx == 0x0003 || r.x.bx == 7)
+ return 0;
+
+ if (!GetVesaModeInfo(r.x.bx))
+ return 0;
+
+ if (!(ModeAttributes & 1))
+ // not supported
+ return 0;
+
+ user_mode = r.x.bx;
+
+ return 1;
+}
+/************************ END of VESA BIOS ROUTINES *************************/
+
+
+
+/*****************************************************************************
+
+**************************** VGA BIOS ROUTINES ******************************
+
+*****************************************************************************/
+
+/*****************************************************************************
+
+ Function: void save_vga_state()
+
+ Description: Saves all the state of the VGA system to restore the mode
+ later. 0x1C01 Service.
+
+ Note: Uses an unknown amount of DOS memory (2.5Kb aprox.)
+
+*****************************************************************************/
+
+static int vga_state_segment = -1;
+static int vga_state_selector;
+
+static
+void save_vga_state()
+{
+ __dpmi_regs r;
+ if (vga_state_segment == -1)
+ {
+ r.x.ax = 0x1c00;
+ r.x.cx = 0x0007;
+ __dpmi_int(0x10,&r);
+ if (r.h.al != 0x1c) return;
+ vga_state_segment =
+ __dpmi_allocate_dos_memory(r.x.bx*4,&vga_state_selector);
+ if (vga_state_segment == -1) return;
+ }
+ r.x.ax = 0x1c01;
+ r.x.es = vga_state_segment;
+ r.x.bx = 0;
+ r.x.cx = 0x0007;
+ __dpmi_int(0x10,&r);
+}
+
+/*****************************************************************************
+
+ Function: void restore_vga_state(int What)
+
+ Description: Restores part or all of the saved information about the VGA
+ state. 0x1C02 Service.
+
+ Parameters:
+ int What: What was saved, USE RESTORE_VGA_ALL EVER.
+
+*****************************************************************************/
+
+static void restore_vga_state(int What)
+{
+ __dpmi_regs r;
+ if (vga_state_segment == -1) return;
+ r.x.ax = 0x1c02;
+ r.x.es = vga_state_segment;
+ r.x.bx = 0;
+ r.x.cx = What;
+ __dpmi_int(0x10,&r);
+}
+
+/*****************************************************************************
+
+ Function: int is_vga_mode()
+
+ Description: Check if the current mode is VGA and can be handled.
+ Return:
+ 0 fail
+ 1 OK
+
+ Notes:
+ Define FULLBIOS to check directly trough BIOS instead of using the
+ BIOS Data Area (I guess is just the same).
+
+ Supported modes:
+
+ 320x200x16 (0x0D)
+ 640x200x16 (0x0E)
+ 640x350x16 (0x10)
+ 640x480x2 (0x11) Partially tested.
+ 640x480x16 (0x12)
+ 320x200x256 (0x13)
+ 320x240x256 X-Mode
+ 320x400x256 X-Mode
+ 360x480x256 X-Mode
+ Other X-Modes derivated from mode 0x13.
+
+*****************************************************************************/
+
+static int is_vga_mode()
+{
+#ifdef FULLBIOS
+ __dpmi_regs r;
+
+ r.x.ax = 0x0f00;
+ __dpmi_int(0x10,&r);
+
+ user_mode = r.h.al;
+#else
+ user_mode = ScreenMode();
+#endif
+
+ if (user_mode != 0x0d &&
+ user_mode != 0x0e &&
+ user_mode != 0x10 &&
+ user_mode != 0x11 &&
+ user_mode != 0x12 &&
+ user_mode != 0x13
+ ) return 0;
+
+ if (user_mode == 0x12 ||
+ user_mode == 0x0d ||
+ user_mode == 0x0e ||
+ user_mode == 0x10
+ )
+ {
+ is_plane_mode = 1;
+ }
+ else
+ {
+ unsigned char b;
+ outportb(VGA_SEQUENCER_PORT,VGA_MEMORY_MODE_REG);
+ b = inportb(VGA_SEQUENCER_DATA);
+ is_plane_mode = b & 0x08 ? 0 : 1;
+ }
+
+ return 1;
+}
+/************************* END of VGA BIOS ROUTINES *************************/
+
+/****************************** TXT BIOS ROUTINES ***************************/
+
+/*****************************************************************************
+
+ Function: int is_txt_mode()
+
+ Description: Checks if the current mode is a text mode and can be handled.
+ Return:
+ 0 fail
+ 1 OK
+
+ Notes:
+ Define FULLBIOS to check directly trough BIOS instead of using the
+ BIOS Data Area (I guess is just the same).
+
+ Supported modes:
+
+ 40x25 Color (0,1), Fonts 8x8, 8x14 and 8x16
+ 80x25 Color (2,3), Fonts 8x8, 8x14 and 8x16
+ 80x25 B&W (7) Hercules
+ 80x43 Color
+ 80x50 Color
+ Other modes derivated from mode 3 with fonts of 8, 14 and 16 scan lines.
+
+*****************************************************************************/
+
+static int is_txt_mode()
+{
+#ifdef FULLBIOS
+ __dpmi_regs r;
+
+ r.x.ax = 0x0f00;
+ __dpmi_int(0x10,&r);
+
+ user_mode = r.h.al;
+#else
+ user_mode = TScreen::getCrtMode();
+#endif
+
+ if ((user_mode & 0xff)<4 || user_mode==7)
+ {
+ if (user_mode==7)
+ win_seg_r=0xB0000;
+ else
+ win_seg_r=0xB8000;
+ }
+ else
+ return 0;
+
+ return 1;
+}
+/*************************** End of TXT BIOS ROUTINES ***********************/
+
+/*****************************************************************************
+
+ Function: void SetAddressingMode()
+
+ Description: Puts the VGA controler in Write Mode 0, Read Mode 0 and if
+ the mode isn't planar in planar mode.
+
+ The 0 modes are the better to dump the video memory.
+
+*****************************************************************************/
+
+static void SetAddressingMode()
+{
+ if (is_plane_mode)
+ {
+ outportb(VGA_GR_CTRL_PORT,VGA_MODE_REG);
+ /* set read mode 0 (and write mode 0) */
+ outportb(VGA_GR_CTRL_DATA,inportb(VGA_GR_CTRL_DATA) & 0xF4);
+ }
+ else
+ {
+ // That's select write mode 0, read mode 0 and planar addressing
+ asm ("movw $0x604,%%ax \n\t"
+ "movw $0x3C4,%%dx \n\t"
+ "outw %%ax,%%dx \n\t"
+ "movb $0x40,%%ah \n\t"
+ "incb %%al \n\t"
+ "movw $0x3CE,%%dx \n\t"
+ "outw %%ax,%%dx \n\t"
+ "movb $5,%%ah \n\t"
+ "incb %%al \n\t"
+ "outw %%ax,%%dx" : : : "%edx", "%eax" );
+ }
+}
+
+/*****************************************************************************
+
+ Function: int SavePlanar(int OffTarget)
+
+ Description: Saves Cols*Rows*2 bytes of planes 0 and 1, and 8192 bytes
+ of the plane 3.
+ Parameters:
+ int OffTarget: Offset of the video window memory
+ Return:
+ The number of bytes used.
+
+*****************************************************************************/
+
+static int SavePlanar(int OffTarget)
+{
+ int offset = 0;
+ int i,bs;
+
+ // Ensure that the mode of addressing is OK
+ SetAddressingMode();
+
+ // Now save 3 planes, plane 4 is never touched by a normal text mode
+ for (i=0;i<3;i++)
+ {
+ /* read from plane 'i' */
+ outportw(VGA_GR_CTRL_PORT,((i << 8) | VGA_RD_PLANE_SEL_REG));
+ if (i==2)
+ bs=8192;
+ else
+ bs=TextModeXres*TextModeYres*2;
+ movedata(_dos_ds,OffTarget,_my_ds(),(int)buffer+offset,bs);
+ offset += bs;
+ }
+
+ return offset;
+}
+
+/*****************************************************************************
+
+ Function: int RestorePlanar(int OffTarget)
+
+ Description: Is the complementary to SavePlanar.
+
+*****************************************************************************/
+
+static int RestorePlanar(int OffTarget)
+{
+ int offset = 0;
+ int i;
+ int bs;
+
+ // Ensure that the mode of addressing is OK
+ SetAddressingMode();
+
+ // Let pass all bits
+ outportw(VGA_GR_CTRL_PORT,0xFF00 | VGA_BIT_MASK_REG);
+ // Just put the value, don't and,xor,etc.
+ outportw(VGA_GR_CTRL_PORT,VGA_ROT_FN_SEL_REG);
+ // Don't use reset masks
+ outportw(VGA_GR_CTRL_PORT,VGA_SET_RESET_ENB_REG);
+ outportw(VGA_GR_CTRL_PORT,VGA_SET_RESET_REG);
+
+ unsigned long *_l = (unsigned long *)buffer;
+ for (i=0;i<3;i++)
+ {
+ /* enable plane 'i' for writing */
+ outportw(VGA_SEQUENCER_PORT,(((1 << i) << 8) | VGA_WRT_PLANE_ENB_REG));
+
+ if (i==2)
+ bs=8192;
+ else
+ bs=TextModeXres*TextModeYres*2;
+
+ movedata(_my_ds(),(int)_l,_dos_ds,OffTarget,bs);
+ _l += bs/4;
+
+ offset+=bs;
+ }
+
+ return offset;
+}
+
+/*****************************************************************************
+
+ Function: void save_vesa(void)
+
+ Description:
+ Saves:
+ 1) The VESA registers.
+ 2) The BIOS data.
+ 3) The palette.
+ 4) Depending on the mode:
+ a) Text modes: (XRes*YRes*2) * 4.
+ b) 256 colors modes: XRes*YRes*2.
+ c) 16 colors modes: XRes*YRes*2 from planes 1 and 2 and 8192 from
+ plane 3.
+ where XRes and YRes are the resolution of the text mode.
+
+*****************************************************************************/
+
+static void save_vesa()
+{
+ int offset = 0;
+ int bank = 0;
+ __dpmi_regs r;
+ save_vesa_state();
+
+ // Window selection and address
+#if 0
+ // About, that hmmmm... isn't a good idea
+ if (WinBAttributes & 0x3) /* exist and readable */
+ {
+ window_r = 1;
+ win_seg_r = WinBSegment;
+ /* I assume here, that now winb is writable. Is that correct?? */
+ window_w = 0;
+ win_seg_w = WinASegment;
+ }
+ else
+ {
+ window_w = window_r = 0;
+ win_seg_r = win_seg_w = WinASegment;
+ }
+#else
+ // That's more reliable
+ if ((WinBAttributes & 0x3)==0x3)
+ { // If B exists and can be readed use B to read
+ window_r = 1;
+ win_seg_r = WinBSegment;
+ }
+ else
+ { // Else use A, one of the 2 must be readable
+ window_r = 0;
+ win_seg_r = WinASegment;
+ }
+ if ((WinAAttributes & 0x5)==0x5)
+ { // If A exists and can be writed use A to write
+ window_w = 0;
+ win_seg_w = WinASegment;
+ }
+ else
+ { // Else use B, one of the 2 must be writable
+ window_w = 0;
+ win_seg_w = WinBSegment;
+ }
+#endif
+ win_seg_r <<= 4;
+ win_seg_w <<= 4;
+
+
+ // Window size
+ win_size = WinSize * 1024;
+
+ // Normally granularity is == to win size but ....
+ // I assume that are multiples, for example,
+ // WinSize=128, WinGranularity=64
+ bank_increment = win_size / (WinGranularity*1024);
+
+ // Size to save, that's isn't a fixed value:
+ if ((ModeAttributes & 0x10) && (NumberOfPlanes > 1))
+ {
+ saved_size =
+ (TextModeXres*TextModeYres*2) // The amount of memory destroyed in plane 1
+ *2 // I don't know why but the same for plane 2
+ +8192 // The fonts in plane 3, is that the worst case?
+ // there are 9x16 fonts, so I guess that's 32 bytes per
+ // character then 32*256=8192
+ ;
+ }
+ else
+ {
+ if (ModeAttributes & 0x10)
+ saved_size = (TextModeXres*TextModeYres*2) * 4;
+ else
+ // Here I don't save the fonts used memory, what do you think?
+ saved_size = TextModeXres*TextModeYres*2;
+ }
+
+ // Just an adjust for the methode used
+ if (saved_size < win_size)
+ win_size = saved_size;
+
+ // Memory allocation
+ if (saved_size > buffer_size)
+ {
+ buffer = realloc(buffer,saved_size);
+ buffer_size = saved_size;
+ }
+
+ // Loop switching bank until we get all the memory needed
+ while (offset < saved_size)
+ {
+ if (ModeAttributes & 0x10) // test for graphic mode
+ { // Here the assumptions are:
+ // 1) A text mode doesn't need a bank change.
+ // 2) A 16 colors mode can be restored from one bank.
+
+ // Switch the right bank
+ r.x.ax = 0x4f05;
+ r.x.bx = window_r;
+ r.x.dx = bank;
+ __dpmi_int(0x10,&r);
+
+ if (NumberOfPlanes > 1)
+ { // 16 colors modes, Here I asume that all is in 1 bank
+ is_plane_mode=1;
+ offset+=SavePlanar(win_seg_r);
+ }
+ }
+ // Here is for text and 256 colors modes:
+ if (NumberOfPlanes == 1)
+ {
+ movedata(_dos_ds,win_seg_r,_my_ds(),(int)buffer+offset,win_size);
+ offset += win_size;
+ }
+ // next bank if needed ... I don't think that this will happend
+ bank+=bank_increment;
+ }
+}
+
+/*****************************************************************************
+
+ Function: restore_vesa()
+
+ Description: Is the reverse of save_vesa().
+
+*****************************************************************************/
+
+static void restore_vesa()
+{
+ int offset = 0;
+ int bank = 0;
+ __dpmi_regs r;
+
+#ifdef FORCE_SET_VIDEO_MODE
+ // Restore the mode?, why?, In my card the restore_vesa_state is enough
+ r.x.ax = 0x4f02;
+ r.x.bx = user_mode | 0x8000;
+ __dpmi_int(0x10,&r);
+#endif
+
+ restore_vesa_state(RESTORE_VESA_ALL);
+
+ while (offset < saved_size)
+ {
+ if (ModeAttributes & 0x10) // test for graphic mode
+ {
+ r.x.ax = 0x4f05;
+ r.x.bx = window_w;
+ r.x.dx = bank;
+ __dpmi_int(0x10,&r);
+
+ if (NumberOfPlanes > 1)
+ { // Here I asume that all is in 1 bank
+ is_plane_mode=1;
+ offset+=RestorePlanar(win_seg_w);
+ }
+ }
+ if (NumberOfPlanes == 1)
+ {
+ movedata(_my_ds(),(int)buffer+offset,_dos_ds,win_seg_w,win_size);
+ offset += win_size;
+ }
+ bank+=bank_increment;
+ }
+
+ /* restore again, because of the change of the registers and the bank */
+ restore_vesa_state(RESTORE_VESA_ALL);
+}
+
+static void save_vga()
+{
+ save_vga_state();
+ // Fixed for VGA graphic modes, there are a methode to know the true but ...
+ win_seg_r = 0xa0000;
+
+ // Amount to save, that's isn't a fixed value:
+ saved_size =
+ (TextModeXres*TextModeYres*2) // The amount of memory destroyed in plane 1
+ *2 // I don't know why but the same for plane 2
+ +8192 // The fonts in plane 3, is that the worst case?
+ // there are 9x16 fonts, so I guess that's 32 bytes per
+ // character then 32*256=8192
+ ;
+
+ // Allocate memory
+ if (saved_size > buffer_size)
+ {
+ buffer = realloc(buffer,saved_size);
+ buffer_size = saved_size;
+ }
+
+ // Save the planes
+ SavePlanar(win_seg_r);
+
+#if 0
+ // Don't needed if we'll enter in text mode just after that
+ /* restore the registers */
+ restore_vga_state();
+#endif
+}
+
+static void restore_vga()
+{
+#ifdef FORCE_SET_VIDEO_MODE
+ __dpmi_regs r;
+ r.x.ax = (user_mode & 0x7f) | 0x80;
+ __dpmi_int(0x10,&r);
+#endif
+ restore_vga_state(RESTORE_VGA_ALL);
+
+ // Put the data in the correct planes
+ RestorePlanar(win_seg_r);
+
+ // Restore again because we touched a lot of things
+ restore_vga_state(RESTORE_VGA_ALL);
+}
+
+
+static void save_txt()
+{
+ if (user_mode != 7)
+ save_vga_state();
+
+ // Amount to save, that's isn't a fixed value:
+ saved_size = TextModeXres*TextModeYres*2;
+
+ // Allocate memory
+ if (saved_size > buffer_size)
+ {
+ buffer = realloc(buffer,saved_size);
+ buffer_size = saved_size;
+ }
+
+ movedata(_dos_ds,win_seg_r,_my_ds(),(int)buffer,saved_size);
+}
+
+static void restore_txt()
+{
+ __dpmi_regs r;
+#ifdef FORCE_SET_VIDEO_MODE
+#if 0
+ r.x.ax = (user_mode & 0x7f) | 0x80;
+ __dpmi_int(0x10,&r);
+#else
+ TScreen::setCrtMode(user_mode);
+#endif
+#endif
+ if (user_mode != 7)
+ {
+ restore_vga_state(RESTORE_VGA_ALL);
+
+ unsigned char height;
+ _dosmemgetb(0x485,1,&height);
+
+ r.h.ah=0x11;
+ r.x.bx=0;
+ switch (height)
+ {
+ case 8:
+ r.h.al=0x02;
+ break;
+ case 14:
+ r.h.al=0x01;
+ break;
+ default:
+ r.h.al=0x04;
+ }
+ __dpmi_int(0x10,&r);
+
+ restore_vga_state(RESTORE_VGA_ALL);
+ }
+
+ movedata(_my_ds(),(int)buffer,_dos_ds,win_seg_r,saved_size);
+}
+
+
+/************************* Unified STUFF ************************************/
+
+/*****************************************************************************
+
+ Function: void InitSaveSystem(void)
+
+ Description: Initialize all the needed things, must be called before all.
+
+*****************************************************************************/
+
+static void InitSaveSystem(void)
+{
+ check_for_vesa();
+}
+
+#define VGA 0
+#define VESA 1
+#define TXTM 2
+#define NONE 255
+
+static int type_saved;
+
+/*****************************************************************************
+
+ Function: void SaveVideo(int text_x,int text_y)
+
+ Description: Saves all the information to restore the actual video state.
+ Arguments:
+ text_x: The colums, which the app will overwrite in text mode
+ text_y: The rows, which the app will overwrite in text mode
+
+*****************************************************************************/
+
+static int inited = 0;
+static void InitSaveSystem(void);
+
+void set_SaveVideo(int text_x,int text_y)
+{
+ TextModeXres = text_x;
+ TextModeYres = text_y;
+ type_saved=NONE;
+ if (!inited)
+ {
+ InitSaveSystem();
+ inited = 1;
+ }
+ if (vesa_supported)
+ if (is_vesa_mode())
+ {
+ save_vesa();
+ type_saved=VESA;
+ return;
+ }
+ if (is_vga_mode())
+ {
+ save_vga();
+ type_saved=VGA;
+ return;
+ }
+ if (is_txt_mode())
+ {
+ save_txt();
+ type_saved=TXTM;
+ }
+ // Now what can I do ...?
+}
+
+/*****************************************************************************
+
+ Function: void RestoreVideo(void)
+
+ Description: Restores the saved video state.
+
+*****************************************************************************/
+
+void set_RestoreVideo(void)
+{
+ switch (type_saved)
+ {
+ case TXTM:
+ restore_txt();
+ break;
+ case VGA:
+ restore_vga();
+ break;
+ case VESA:
+ restore_vesa();
+ break;
+ }
+}
+
+/********************** end of Unified STUFF ********************************/
+
+#ifdef TEST
+
+// Here you can choose the methode to test
+
+//#define ALLEGRO
+#define GRX20
+//#define TEXTMODES
+#define USE_TV
+
+
+#include <stdio.h>
+#include <conio.h>
+#include <pc.h>
+
+#ifdef USE_TV
+
+#define Uses_TScreen
+#if 1
+#define Uses_TEditorApp
+#include <tv.h>
+
+class IDE : public TEditorApp
+{
+public:
+ IDE() : TProgInit( &IDE::initStatusLine,
+ &IDE::initMenuBar,
+ &IDE::initDeskTop),
+ TEditorApp()
+ {}
+ void Suspend() { suspend(); }
+ void Resume() { resume(); redraw(); }
+};
+
+IDE *app;
+
+#define INIT() app = new IDE(); SUSPEND()
+#define SUSPEND() app->Suspend()
+#define RESUME() app->Resume()
+char *ExpandFileNameToThePointWhereTheProgramWasLoaded(char *x)
+{
+ return x;
+}
+
+#else
+#include <tv.h>
+
+#define INIT() SUSPEND()
+#define SUSPEND() TScreen::suspend()
+#define RESUME() TScreen::resume()
+#endif
+
+#else // USE_TV
+
+int user_mode;
+
+/*
+ This routine sets the video text mode and gets the size because I need
+ it to know how much memory is touched by the text mode.
+*/
+void SetTextMode(int mode)
+{
+ if (mode>=0x100)
+ asm("int $0x10" : : "a"(0x4F02), "b"(mode | 0x8000));
+ else
+ textmode(mode | 0x80);
+#if 0 // now defined to Screen...
+ TextModeXres=ScreenCols();
+ TextModeYres=ScreenRows();
+#endif
+}
+
+/*
+ This routine simply clears the screen and puts some thing, I'm using
+ that because I'm to lazy to reproduce your changes in libtv.a
+*/
+void Redraw()
+{
+ _farfill_l(_dos_ds,0xB8000,(TextModeXres*TextModeYres*2)/4,0x07000700);
+ printf("That's the screen that should be redrawed by TVision (%d,%d)\n",
+ TextModeXres,TextModeYres);
+}
+
+
+#define MODE 0x10C
+#define INIT() SetTextMode(MODE); Redraw()
+#define RESUME() SaveVideo(ScrennCols(),ScreenRows()); SetTextMode(MODE); Redraw()
+#define SUSPEND() RestoreVideo()
+
+#endif // USE_TV
+
+#ifdef ALLEGRO
+#include "allegro.h"
+
+/**************************** ALLEGRO STUFF *********************************/
+int xoff, yoff;
+int mode = DRAW_MODE_SOLID;
+#define NUM_PATTERNS 8
+#define TIME_SPEED 2
+BITMAP *pattern[NUM_PATTERNS];
+long tm = 0; /* counter, incremented once a second */
+int _tm = 0;
+
+void do_it(char *msg, int clip_flag, void (*func)())
+{
+ int x1, y1, x2, y2;
+
+ set_clip(screen, 0, 0, 0, 0);
+ clear(screen);
+ //message(msg);
+
+ if (clip_flag) {
+ do {
+ x1 = (rand() & 255) + 32;
+ x2 = (rand() & 255) + 32;
+ } while (abs(x1-x2) < 30);
+ do {
+ y1 = (rand() & 127) + 40;
+ y2 = (rand() & 127) + 40;
+ } while (abs(y1-y2) < 20);
+ set_clip(screen, xoff+x1, yoff+y1, xoff+x2, yoff+y2);
+ }
+
+ drawing_mode(mode, pattern[rand()%NUM_PATTERNS], 0, 0);
+
+ (*func)();
+
+ solid_mode();
+}
+
+int next()
+{
+ if (keypressed()) {
+ clear_keybuf();
+ return TRUE;
+ }
+
+ if (mouse_b) {
+ do {
+ } while (mouse_b);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void putpix_demo()
+{
+ int c = 0;
+ int x, y;
+ long ct;
+
+ tm = 0; _tm = 0;
+ ct = 0;
+
+ while (!next()) {
+
+ x = (rand() & 511) + 32;
+ y = (rand() & 255) + 40;
+ putpixel(screen, xoff+x, yoff+y, c);
+
+ if (mode >= DRAW_MODE_COPY_PATTERN)
+ drawing_mode(mode, pattern[rand()%NUM_PATTERNS], 0, 0);
+
+ if (++c >= 16)
+ c = 0;
+
+ if (ct >= 0) {
+ if (tm >= TIME_SPEED) {
+ ct = -1;
+ }
+ else
+ ct++;
+ }
+ }
+}
+
+void line_demo()
+{
+ int c = 0;
+ int x1, y1, x2, y2;
+ long ct;
+
+ tm = 0; _tm = 0;
+ ct = 0;
+
+ while (!next()) {
+
+ x1 = (rand() & 511) + 32;
+ x2 = (rand() & 511) + 32;
+ y1 = (rand() & 255) + 40;
+ y2 = (rand() & 255) + 40;
+ line(screen, xoff+x1, yoff+y1, xoff+x2, yoff+y2, c);
+
+ if (mode >= DRAW_MODE_COPY_PATTERN)
+ drawing_mode(mode, pattern[rand()%NUM_PATTERNS], 0, 0);
+
+ if (++c >= 16)
+ c = 0;
+
+ if (ct >= 0) {
+ if (tm >= TIME_SPEED) {
+ ct = -1;
+ }
+ else
+ ct++;
+ }
+ }
+}
+
+void Next()
+{
+ while (next()==FALSE);
+}
+/******************************* END of ALLEGRO STUFF **********************/
+
+int main()
+{
+ int i;
+
+ allegro_init();
+
+ INIT();
+ getch();
+
+ install_keyboard();
+ install_timer();
+ initialise_joystick();
+ install_mouse();
+ set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
+ set_pallete(desktop_pallete);
+ show_mouse(NULL);
+
+ int card,w,h;
+
+ if (!gfx_mode_select(&card, &w, &h))
+ {
+ allegro_exit();
+ printf("Aborting\n\n");
+ exit(1);
+ }
+
+ show_mouse(NULL);
+ if (set_gfx_mode( card, w, h, 0, 0))
+ {
+ allegro_exit();
+ printf("Error setting graphics mode\n%s\n\n", allegro_error);
+ exit(1);
+ }
+ set_pallete(desktop_pallete);
+ do_it("timing putpixel", FALSE, putpix_demo);
+ Next();
+ RESUME();
+ Next();
+ SUSPEND();
+ Next();
+ RESUME();
+ Next();
+ SUSPEND();
+ do_it("timing line", FALSE, line_demo);
+ Next();
+ RESUME();
+ Next();
+ SUSPEND();
+ Next();
+ RESUME();
+ Next();
+ SUSPEND();
+ Next();
+ RESUME();
+ Next();
+ SUSPEND();
+ Next();
+ textmode(3);
+ allegro_exit();
+ return 0;
+}
+#endif // ALLEGRO
+
+#ifdef GRX20
+/******************************* GRX20 STUFF *******************************/
+#include <grx20.h>
+
+int main()
+{
+ int i;
+ char Buf[4];
+ INIT();
+ getch();
+ GrSetMode(GR_width_height_color_graphics,640,480,16);
+ //GrSetMode(GR_width_height_color_graphics,320,200,256);
+ GrClearScreen(GrBlack());
+ Buf[0]=32;
+ Buf[1]=33;
+ Buf[2]=34;
+ Buf[3]=35;
+ _dosmemputb(Buf,4,0xA0000);
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ for (i=0;i<16;i++)
+ {
+ GrFilledBox(i*21,0,i*21+20,15,i);
+ }
+ GrFilledEllipse(300,200,50,50,GrAllocColor(0,0,255));
+ GrPlot(3,92,32);
+ GrPlot(3,108,32);
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ GrEllipseArc(300,200,50,50,10,10,GR_ARC_STYLE_CLOSE2,GrWhite());
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ GrClearScreen(GrBlack());
+ GrFilledEllipse(300,200,50,50,GrAllocColor(0,0,255));
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ GrEllipseArc(300,200,50,50,10,10,GR_ARC_STYLE_CLOSE2,GrWhite());
+ GrFilledEllipse(300,200,50,50,GrAllocColor(0,0,255));
+ GrFilledEllipse(300,200,50,50,GrWhite());
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ GrTextXY(0,0,"This is a sample text",GrWhite(),GrNOCOLOR);
+ //GrEllipseArc(300,80,50,50,10,10,GR_ARC_STYLE_CLOSE2,GrWhite());
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ textmode(3);
+ return 0;
+}
+#endif // GRX20
+
+#ifdef TEXTMODES
+
+#define TxtMode(var) asm("int $0x10": : "a"(var))
+
+int main()
+{
+ int i;
+ char Buf[4];
+ INIT();
+ TxtMode(3);
+ textattr(0x7A);
+ cprintf("Screen to restore, 80x25 color\n");
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ TxtMode(0);
+ textattr(0x8A);
+ cprintf("Screen to restore, 40x25 color\n");
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ TxtMode(3);
+ _set_screen_lines(50);
+ textattr(0x7B);
+ gotoxy(10,10);
+ cprintf("Screen to restore, 80x50 color\n");
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ _set_screen_lines(43);
+ textattr(0x7C);
+ gotoxy(30,30);
+ cprintf("Screen to restore, 80x43 color\n");
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ textmode(7);
+ gotoxy(30,10);
+ highvideo();
+ cprintf("Screen to restore, 80x25 b&w\n");
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ textmode(3);
+ return 0;
+}
+#endif // TEXTMODES
+
+#endif
+
+#endif // DJGPP
diff --git a/tvision/classes/dos/vesa.cc b/tvision/classes/dos/vesa.cc
new file mode 100644
index 0000000..5bcc13f
--- /dev/null
+++ b/tvision/classes/dos/vesa.cc
@@ -0,0 +1,589 @@
+/**[txh]********************************************************************
+
+ Description:
+ That's the Robert's version of the VESA video modes handling routines.@*
+ Some stuff modified by me (SET):
+
+* Support for S3 text mode way to report planes.
+* Removed the need to allocate DOS memory for the VESA structures, that's
+bad because we reduce the available memory and because at least one VESA
+2.0 TSR for S3 boards have the bad idea to return more bytes than what the
+spec says overwriting memory. I know it from the FreeBE/AF project. So now
+I changed it to use the transfer buffer and copy it to malloced memory.
+BTW: this change saved 172 bytes of code and added 20 bytes of data.
+
+***************************************************************************/
+
+/* Copyright (C) 1996-1998 Robert H”hne, this file is part of RHTVision and
+ is under the GPL license */
+#include <compatlayer.h>
+
+#ifdef TVCompf_djgpp
+/*
+ This file is used to save/restore the graphics screen when a
+ VESA mode is set.
+ I have tested it with all the modes, which are available on my
+ et4000 card. They work when the graphic mode is set by the
+ libgrx20 library. After testing with the VESA 1 modes from
+ the ALLEGRO library I saw, that they NOT work correct, but
+ I don't know why.
+
+0x0100 640 x 400 x 256
+0x0101 640 x 480 x 256
+0x0102 800 x 600 x 16
+0x0103 800 x 600 x 256
+0x0104 1024 x 768 x 16
+0x0105 1024 x 768 x 256
+0x0106 1280 x 1024 x 16
+
+The function save_vesa assumes, that is_vesa_mode called before and
+was successfull. There is no other check for validity.
+And the function restore_vesa assumes that save_vesa was called
+before.
+*/
+
+#include <stdlib.h>
+#include <sys/movedata.h>
+#include <sys/farptr.h>
+#include <dpmi.h>
+#include <go32.h>
+
+// SET: I found this value is board dependant and Robert taked a value that
+// works with most of the boards.
+int rh_vesa_size=256*1024;
+
+typedef unsigned short ushort;
+
+extern int user_mode;
+
+static void *buffer = NULL;
+static int buffer_size = 0;
+static int saved_size;
+static int window_r;
+static int window_w;
+static int win_size;
+static unsigned win_seg_r;
+static unsigned win_seg_w;
+
+// SET: I changed the stuff related to this structure, see in the header
+// comments of vesa.cc file.
+// Robert originally taked it from the vesa.h of GRX library, I changed some
+// comments to match the "VESA Super VGA Standard VS911022-14" text. And
+// changed to ushort type.
+/* This is for g++ 2.7.2 and below */
+#pragma pack(1)
+typedef struct {
+ ushort modeAttributes CLY_Packed;//mode attributes
+#define ModeAttributes infoBk.modeAttributes
+ char winAAttributes CLY_Packed;// Window A attributes
+ char winBAttributes CLY_Packed;// Window B attributes
+#define WinAAttributes infoBk.winAAttributes
+#define WinBAttributes infoBk.winBAttributes
+ ushort winGranularity CLY_Packed;// Window granularity
+#define WinGranularity infoBk.winGranularity
+ ushort winSize CLY_Packed;// Window size
+#define WinSize infoBk.winSize
+ ushort winASegment CLY_Packed;// Window A start segment
+ ushort winBSegment CLY_Packed;// Window B start segment
+#define WinASegment infoBk.winASegment
+#define WinBSegment infoBk.winBSegment
+ void (*WinFuncPtr)() CLY_Packed;// Pointer to window function
+ ushort BytesPerScanLine CLY_Packed;// Bytes per scan line
+
+// ==== extended and optional information ==== Mandatory since VESA 1.2
+
+ ushort XResolution CLY_Packed;// Horizontal resolution
+ ushort YResolution CLY_Packed;// Vertical resolution
+ char XCharSize CLY_Packed;// Character cell width
+ char YCharSize CLY_Packed;// Character cell height
+ char numberOfPlanes CLY_Packed;// Number of memory planes
+#define NumberOfPlanes infoBk.numberOfPlanes
+/*
+ char BitsPerPixel CLY_Packed;// Bits per pixel
+ char NumberOfBanks CLY_Packed;// Number of banks
+ char MemoryModel CLY_Packed;// Memory model type
+ char BankSize CLY_Packed;// Bank size in K
+ char NumImagePages CLY_Packed;// Number of image pages
+ char reserved[1] CLY_Packed;// Reserved for page function
+
+// ==== VESA 1.2 and later ====
+
+ char RedMaskSize CLY_Packed;// Size of direct color red mask in bits
+ char RedMaskPos CLY_Packed;// Bit position of LSB of red mask
+ char GreenMaskSize CLY_Packed;// Idem green
+ char GreenMaskPos CLY_Packed;
+ char BlueMaskSize CLY_Packed;// Idem blue
+ char BlueMaskPos CLY_Packed;
+ char ReservedMaskSize CLY_Packed;// Idem reserved bits
+ char ReservedMaskPos CLY_Packed;
+ char DirectScreenMode CLY_Packed;// Direct Color mode attributes
+ char reserved2[216] CLY_Packed;
+*/
+} VESAmodeInfoBlock;
+#pragma pack()
+// This block is globally accessed with the macros.
+static VESAmodeInfoBlock infoBk;
+
+
+static
+int GetVesaModeInfo(int mode)
+{
+ __dpmi_regs r;
+ r.x.ax = 0x4f01;
+ r.x.es = __tb>>4; // SET: changed to use tb.
+ r.x.di = __tb & 0xF;
+ r.x.cx = mode;
+ __dpmi_int(0x10,&r);
+ if (r.x.ax!=0x004f)
+ return 0;
+ dosmemget(__tb,sizeof(infoBk),&infoBk);
+ return 1;
+}
+
+static int vesa_state_segment = -1;
+static int vesa_state_selector;
+
+static
+void save_vesa_state()
+{
+ __dpmi_regs r;
+ if (vesa_state_segment == -1)
+ {
+ r.x.ax = 0x4f04;
+ r.h.dl = 0x00;
+ r.x.cx = 0x000f;
+ __dpmi_int(0x10,&r);
+ if (r.x.ax != 0x004f) return;
+ vesa_state_segment =
+ __dpmi_allocate_dos_memory(r.x.bx*4,&vesa_state_selector);
+ if (vesa_state_segment == -1) return;
+ }
+ r.x.ax = 0x4f04;
+ r.h.dl = 0x01;
+ r.x.es = vesa_state_segment;
+ r.x.bx = 0;
+ r.x.cx = 0x000f;
+ __dpmi_int(0x10,&r);
+}
+
+static
+void restore_vesa_state()
+{
+ __dpmi_regs r;
+ if (vesa_state_segment == -1) return;
+ r.x.ax = 0x4f04;
+ r.h.dl = 0x02;
+ r.x.es = vesa_state_segment;
+ r.x.bx = 0;
+ r.x.cx = 0x000f;
+ __dpmi_int(0x10,&r);
+}
+
+int rh_vesa_supported = 0;
+
+void rh_check_for_vesa()
+{
+ __dpmi_regs r;
+
+ r.x.ax = 0x4f03;
+ __dpmi_int(0x10,&r);
+
+ /* Not supported */
+ if (r.h.al != 0x4f) return;
+
+ rh_vesa_supported = 1;
+}
+
+int rh_is_vesa_mode()
+{
+ __dpmi_regs r;
+
+ r.x.ax = 0x4f03;
+ __dpmi_int(0x10,&r);
+
+ /* Not supported or not successful */
+ if (r.x.ax != 0x004f) return 0;
+
+ /* Because GetVesaModeInfo forces a screen switch under W95, I check
+ the most common textmode here without calling that function */
+ if (r.x.bx == 0x0003 || r.x.bx == 7)
+ return 0;
+
+ if (!GetVesaModeInfo(r.x.bx))
+ return 0;
+
+ if (!(ModeAttributes & 1))
+ // not supported
+ return 0;
+
+ user_mode = r.x.bx;
+
+ return 1;
+}
+
+/*
+ * Sequencer port and frequently used register indices
+ */
+#define VGA_SEQUENCER_PORT 0x3c4
+#define VGA_SEQUENCER_DATA 0x3c5
+
+#define VGA_WRT_PLANE_ENB_REG 2
+
+/*
+ * color plane operations
+ */
+#define VGA_FUNC_SET 0
+#define VGA_FUNC_AND 8
+#define VGA_FUNC_OR 16
+#define VGA_FUNC_XOR 24
+
+/*
+ * Graphics controller port and frequently used registers
+ */
+#define VGA_GR_CTRL_PORT 0x3ce
+#define VGA_GR_CTRL_DATA 0x3cf
+
+#define VGA_SET_RESET_REG 0
+#define VGA_SET_RESET_ENB_REG 1
+#define VGA_COLOR_COMP_REG 2
+#define VGA_ROT_FN_SEL_REG 3
+#define VGA_RD_PLANE_SEL_REG 4
+#define VGA_MODE_REG 5
+#define VGA_MISC_REG 6
+#define VGA_COLOR_DONTC_REG 7
+#define VGA_BIT_MASK_REG 8
+
+#include <pc.h>
+
+void rh_save_vesa()
+{
+ int offset = 0, off_in_page=0;
+ int seg = 0;
+ __dpmi_regs r;
+ save_vesa_state();
+
+ if (WinBAttributes & 0x3) /* exist and readable */
+ {
+ window_r = 1;
+ win_seg_r = WinBSegment;
+ /* I assume here, that now winb is writable. Is that correct?? */
+ window_w = 0;
+ win_seg_w = WinASegment;
+ }
+ else
+ {
+ window_w = window_r = 0;
+ win_seg_r = win_seg_w = WinASegment;
+ }
+ win_size = WinSize * 1024;
+
+ win_seg_r <<= 4;
+ win_seg_w <<= 4;
+
+ saved_size = rh_vesa_size;
+
+ if (saved_size < win_size)
+ win_size = saved_size;
+
+ if (saved_size > buffer_size)
+ {
+ buffer = realloc(buffer,saved_size);
+ buffer_size = saved_size;
+ }
+
+ while (offset < saved_size)
+ {
+ if (ModeAttributes & 0x10) // graphic ?
+ {
+ r.x.ax = 0x4f05;
+ r.x.bx = window_r;
+ r.x.dx = seg;
+ __dpmi_int(0x10,&r);
+
+ if (NumberOfPlanes > 1)
+ {
+ int i;
+ int bs = win_size / 4;
+
+ /* now set to read mode 0 */
+ outportw(VGA_GR_CTRL_PORT,((0x00 << 8) | VGA_MODE_REG));
+ for (i=0;i<4;i++)
+ {
+ /* read from plane 'i' */
+ outportw(VGA_GR_CTRL_PORT,((i << 8) | VGA_RD_PLANE_SEL_REG));
+
+ movedata(_dos_ds,win_seg_r+off_in_page,_my_ds(),(int)buffer+offset,bs);
+ offset += bs;
+ }
+ off_in_page+=bs;
+ if (off_in_page>=win_size)
+ {
+ off_in_page=0;
+ seg++;
+ }
+ }
+ }
+ // SET: Text modes are 1 plane but some BIOS like the S3 ones reports it
+ // as 4 planes because the fonts are located in the second pair of banks.
+ // S3 BIOSes are normally buggy so I guess that's just another bug by S3.
+ if (NumberOfPlanes==1 || !(ModeAttributes & 0x10))
+ {
+ movedata(_dos_ds,win_seg_r,_my_ds(),(int)buffer+offset,win_size);
+ offset += win_size;
+ seg++;
+ }
+ }
+// restore_vesa_state();
+}
+
+__inline__ void
+_farnsandl(unsigned long offset,
+ unsigned long value)
+{
+ __asm__ __volatile__ (".byte 0x64\n"
+ " andl %k0,(%k1)"
+ :
+ : "ri" (value), "r" (offset));
+}
+
+__inline__ void
+_farfill_l(unsigned short sel,unsigned long offset,unsigned long count,
+ unsigned long value)
+{
+ __asm__ __volatile__ (
+ "pushw %%es\n"
+ "movw %w0,%%es\n"
+ "cld\n"
+ "rep\n"
+ "stosl\n"
+ "popw %%es"
+ :
+ : "rm" (sel), "a" (value), "D" (offset), "c" (count));
+}
+
+void rh_restore_vesa()
+{
+ int offset = 0, off_in_page = 0, off;
+ int seg = 0;
+ __dpmi_regs r;
+ r.x.ax = 0x4f02;
+ r.x.bx = user_mode | 0x8000;
+ __dpmi_int(0x10,&r);
+ restore_vesa_state();
+ while (offset < saved_size)
+ {
+ if (ModeAttributes & 0x10) // graphic ??
+ {
+ r.x.ax = 0x4f05;
+ r.x.bx = window_w;
+ r.x.dx = seg;
+ __dpmi_int(0x10,&r);
+
+ r.x.ax = 0x4f05;
+ r.x.bx = window_r;
+ r.x.dx = seg;
+ __dpmi_int(0x10,&r);
+
+ if (NumberOfPlanes > 1)
+ {
+ int i,j;
+ int bs = win_size / 4;
+
+ outportw(VGA_GR_CTRL_PORT,(VGA_FUNC_SET << 8) | VGA_ROT_FN_SEL_REG);
+ /* enable all planes for writing */
+ outportw(VGA_SEQUENCER_PORT,((0x0f << 8) | VGA_WRT_PLANE_ENB_REG));
+ /* eanable all planes for set/reset */
+ outportw(VGA_GR_CTRL_PORT,((0x00 << 8) | VGA_SET_RESET_ENB_REG));
+ /* set all planes for reset */
+ outportw(VGA_GR_CTRL_PORT,((0x00 << 8) | VGA_SET_RESET_REG));
+#if 0
+ /* set write mode 3 */
+ outportw(VGA_GR_CTRL_PORT,((8+3) << 8) | VGA_MODE_REG);
+#endif
+ /* clear all */
+ _farfill_l(_dos_ds,win_seg_w+off_in_page,bs/4,0xffffffffL);
+ unsigned long *_l = (unsigned long *)(((char *)buffer)+offset);
+ for (i=0;i<4;i++)
+ {
+#if 1
+ /* enable plane 'i' for writing */
+ outportw(VGA_SEQUENCER_PORT,(((1 << i) << 8) | VGA_WRT_PLANE_ENB_REG));
+#endif
+ /* eanable plane 'i' for set/reset */
+ outportw(VGA_GR_CTRL_PORT,(((1 << i) << 8) | VGA_SET_RESET_ENB_REG));
+ /* enable plane 'i' for set */
+ outportw(VGA_GR_CTRL_PORT,(((1 << i) << 8) | VGA_SET_RESET_REG));
+#if 0
+ /* set write mode 3 */
+ outportw(VGA_GR_CTRL_PORT,((8+3) << 8) | VGA_MODE_REG);
+#endif
+ _farsetsel(_dos_ds);
+ off=win_seg_w+off_in_page;
+ for (j=0;j<bs;j+=4)
+ {
+ _farnsandl(j+off,*_l++);
+ }
+ offset+=bs;
+ }
+ off_in_page+=bs;
+ if (off_in_page>=win_size)
+ {
+ off_in_page=0;
+ seg++;
+ }
+ }
+ }
+ if (NumberOfPlanes==1 || !(ModeAttributes & 0x10))
+ {
+ movedata(_my_ds(),(int)buffer+offset,_dos_ds,win_seg_w,win_size);
+ offset += win_size;
+ seg++;
+ }
+ }
+ /* restore again, because of the change of the registers and the bank */
+ restore_vesa_state();
+}
+
+#ifdef TEST
+
+//#define USE_TV
+
+#include <grx20.h>
+#include <stdio.h>
+#include <conio.h>
+#include <pc.h>
+
+#ifdef USE_TV
+
+#define getch()
+
+#define Uses_TScreen
+#if 1
+#define Uses_TEditorApp
+#include <tv.h>
+
+class IDE : public TEditorApp
+{
+public:
+ IDE() : TProgInit( &IDE::initStatusLine,
+ &IDE::initMenuBar,
+ &IDE::initDeskTop),
+ TEditorApp()
+ {}
+ void Suspend() { suspend(); }
+ void Resume() { resume(); Redraw(); }
+};
+
+IDE *app;
+
+#define INIT() app = new IDE(); SUSPEND()
+#define SUSPEND() app->Suspend()
+#define RESUME() app->Resume()
+char *ExpandFileNameToThePointWhereTheProgramWasLoaded(char *x)
+{
+ return x;
+}
+
+#else
+#include <tv.h>
+
+#define INIT() SUSPEND()
+#define SUSPEND() TScreen::suspend()
+#define RESUME() TScreen::resume()
+#endif
+
+#else
+
+#define INIT() textmode(3)
+#define RESUME() if (!rh_is_vesa_mode()) { printf("Isn't VESA\n"); exit(1); }; rh_save_vesa(); textmode(0x3)
+#define SUSPEND() rh_restore_vesa()
+
+#endif
+int user_mode;
+
+int main(int argc, char *argv[])
+{
+ int i;
+ char *end;
+#ifdef USE_TV
+ extern int screen_saving;
+ screen_saving = 1;
+#endif
+ if (argc!=2)
+ {
+ printf("Error: you must pass to the program the amount of memory to save\n");
+ return 1;
+ }
+ rh_vesa_size=strtol(argv[1],&end,0);
+ INIT();
+ printf("We are in text mode\n");
+ getch();
+ GrSetMode(GR_width_height_color_graphics,640,480,256);
+ GrSetMode(GR_width_height_color_graphics,1024,768,256);
+ GrClearScreen(GrBlack());
+ for (i=0;i<16;i++)
+ {
+ GrFilledBox(i*21,0,i*21+20,15,i);
+ }
+ GrFilledEllipse(GrMaxX()-100,GrMaxY()-100,50,50,GrAllocColor(0,0,255));
+ getch();
+ RESUME();
+ printf("Now we are in text mode again but the graphic mode was saved\n");
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ printf("Was restored OK?\n");
+ getch();
+/* SUSPEND();
+ getch();
+ for (i=0;i<16;i++)
+ {
+ GrFilledBox(i*21,0,i*21+20,15,i);
+ }
+ GrFilledEllipse(300,200,50,50,GrAllocColor(0,0,255));
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ GrEllipseArc(300,200,50,50,10,10,GR_ARC_STYLE_CLOSE2,GrWhite());
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ GrClearScreen(GrBlack());
+ GrFilledEllipse(300,200,50,50,GrAllocColor(0,0,255));
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ GrEllipseArc(300,200,50,50,10,10,GR_ARC_STYLE_CLOSE2,GrWhite());
+ GrFilledEllipse(300,200,50,50,GrAllocColor(0,0,255));
+ GrFilledEllipse(300,200,50,50,GrWhite());
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ GrTextXY(0,0,"This is a sample text",GrWhite(),GrNOCOLOR);
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ textmode(3);*/
+ return 0;
+}
+#endif
+
+#endif // DJGPP
+
diff --git a/tvision/classes/dos/vga.cc b/tvision/classes/dos/vga.cc
new file mode 100644
index 0000000..2c3a4a6
--- /dev/null
+++ b/tvision/classes/dos/vga.cc
@@ -0,0 +1,449 @@
+/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <tv/configtv.h>
+#include "vgastate.h"
+
+#ifdef TVCompf_djgpp
+
+/*
+ This file is used to save/restore the graphics screen when a
+ VGA mode is set.
+ I have tested it with all the modes, which are available on my
+ et4000 card.
+
+ 320x200x16
+ 640x200x16
+ 640x350x16
+ 640x480x16
+ 320x200x256
+ 320x240x256
+ 320x400x256
+ 360x480x256
+
+The function save_vga assumes, that is_vga_mode called before and
+was successfull. There is no other check for validity.
+And the function restore_vga assumes that save_vga was called
+before.
+*/
+
+#include <stdlib.h>
+#include <sys/movedata.h>
+#include <sys/farptr.h>
+#include <dpmi.h>
+#include <go32.h>
+
+#define SIZE 0x8000
+
+extern int user_mode;
+
+static void *buffer = NULL;
+static int buffer_size = 0;
+static int saved_size;
+static int win_size;
+static unsigned win_seg;
+static int is_plane_mode = 0;
+static int mode_x;
+
+// For BIOS save state
+static int vga_state_segment = -1;
+static int vga_state_selector;
+// For low level save state
+static void *vgaState=0;
+
+char useBIOS_VGA_State=1;
+char saveVGA_State=0;
+
+void rh_save_vga_state()
+{
+ if (!saveVGA_State) return;
+ if (useBIOS_VGA_State)
+ {// SET: It fails for some Matrox boards.
+ __dpmi_regs r;
+ if (vga_state_segment == -1)
+ {
+ r.x.ax = 0x1c00;
+ r.x.cx = 0x0007;
+ __dpmi_int(0x10,&r);
+ if (r.h.al != 0x1c) return;
+ vga_state_segment =
+ __dpmi_allocate_dos_memory(r.x.bx*4,&vga_state_selector);
+ if (vga_state_segment == -1) return;
+ }
+ r.x.ax = 0x1c01;
+ r.x.es = vga_state_segment;
+ r.x.bx = 0;
+ r.x.cx = 0x0007;
+ __dpmi_int(0x10,&r);
+ }
+ else
+ {
+ if (!vgaState)
+ vgaState=malloc(VGAStateGetBufferSize());
+ VGAStateSave(vgaState);
+ }
+}
+
+void rh_restore_vga_state()
+{
+ if (!saveVGA_State) return;
+ if (useBIOS_VGA_State)
+ {// SET: It fails for some Matrox boards.
+ __dpmi_regs r;
+ if (vga_state_segment == -1) return;
+ r.x.ax = 0x1c02;
+ r.x.es = vga_state_segment;
+ r.x.bx = 0;
+ r.x.cx = 0x0007;
+ __dpmi_int(0x10,&r);
+ }
+ else
+ VGAStateLoad(vgaState);
+}
+
+/*
+ * Sequencer port and frequently used register indices
+ */
+#define VGA_SEQUENCER_PORT 0x3c4
+#define VGA_SEQUENCER_DATA 0x3c5
+
+#define VGA_WRT_PLANE_ENB_REG 2
+#define VGA_MEMORY_MODE_REG 4
+
+/*
+ * color plane operations
+ */
+#define VGA_FUNC_SET 0
+#define VGA_FUNC_AND 8
+#define VGA_FUNC_OR 16
+#define VGA_FUNC_XOR 24
+
+/*
+ * Graphics controller port and frequently used registers
+ */
+#define VGA_GR_CTRL_PORT 0x3ce
+#define VGA_GR_CTRL_DATA 0x3cf
+
+#define VGA_SET_RESET_REG 0
+#define VGA_SET_RESET_ENB_REG 1
+#define VGA_COLOR_COMP_REG 2
+#define VGA_ROT_FN_SEL_REG 3
+#define VGA_RD_PLANE_SEL_REG 4
+#define VGA_MODE_REG 5
+#define VGA_MISC_REG 6
+#define VGA_COLOR_DONTC_REG 7
+#define VGA_BIT_MASK_REG 8
+
+#include <pc.h>
+
+int rh_is_vga_mode()
+{
+ __dpmi_regs r;
+
+ r.x.ax = 0x0f00;
+ __dpmi_int(0x10,&r);
+
+ if (r.h.al != 0x12 &&
+ r.h.al != 0x13 &&
+ r.h.al != 0x0d &&
+ r.h.al != 0x0e &&
+ r.h.al != 0x10
+ ) return 0;
+
+ user_mode = r.h.al;
+
+ mode_x = 0;
+
+ if (user_mode == 0x12 ||
+ user_mode == 0x0d ||
+ user_mode == 0x0e ||
+ user_mode == 0x10
+ )
+ is_plane_mode = 1;
+ else
+ {
+ unsigned char b;
+ outportb(VGA_SEQUENCER_PORT,VGA_MEMORY_MODE_REG);
+ b = inportb(VGA_SEQUENCER_DATA);
+ is_plane_mode = b & 0x08 ? 0 : 1;
+ mode_x = is_plane_mode;
+ }
+
+ return 1;
+}
+
+void rh_save_vga()
+{
+ int offset = 0;
+ rh_save_vga_state();
+ win_seg = 0xa0000;
+
+ win_size = 64 * 1024;
+
+ saved_size = SIZE;
+
+ if (saved_size < win_size)
+ win_size = saved_size;
+
+ if (saved_size > buffer_size)
+ {
+ buffer = realloc(buffer,saved_size);
+ buffer_size = saved_size;
+ }
+
+ while (offset < saved_size)
+ {
+ if (is_plane_mode)
+ {
+ int i;
+ int bs = win_size / 4;
+
+ int modereg;
+ outportb(VGA_GR_CTRL_PORT,VGA_MODE_REG);
+ modereg = inportb(VGA_GR_CTRL_DATA) & 0xf0;
+ /* now set to read mode 0 */
+ outportw(VGA_GR_CTRL_PORT,(modereg << 8) | VGA_MODE_REG);
+ for (i=0;i<4;i++)
+ {
+ /* read from plane 'plane' */
+ outportw(VGA_GR_CTRL_PORT,((i << 8) | VGA_RD_PLANE_SEL_REG));
+
+ movedata(_dos_ds,win_seg,_my_ds(),(int)buffer+offset,bs);
+ offset += bs;
+ }
+
+#if 0
+ /* restore the registers */
+ rh_restore_vga_state();
+#endif
+ }
+ else
+ {
+ movedata(_dos_ds,win_seg,_my_ds(),(int)buffer+offset,win_size);
+ offset += win_size;
+ }
+ }
+}
+
+__inline__ void
+_farnsandl(unsigned long offset,
+ unsigned long value)
+{
+ __asm__ __volatile__ (".byte 0x64\n"
+ " andl %k0,(%k1)"
+ :
+ : "ri" (value), "r" (offset));
+}
+
+__inline__ void
+_farfill_l(unsigned short sel,unsigned long offset,unsigned long count,
+ unsigned long value)
+{
+ __asm__ __volatile__ (
+ "pushw %%es\n"
+ "movw %w0,%%es\n"
+ "cld\n"
+ "rep\n"
+ "stosl\n"
+ "popw %%es"
+ :
+ : "rm" (sel), "a" (value), "D" (offset), "c" (count));
+}
+
+void rh_restore_vga()
+{
+ int offset = 0;
+ __dpmi_regs r;
+ r.x.ax = (user_mode & 0x7f) | 0x80;
+ __dpmi_int(0x10,&r);
+ rh_restore_vga_state();
+
+ while (offset < saved_size)
+ {
+ if (is_plane_mode)
+ {
+ int i,j;
+ int bs = win_size / 4;
+
+ outportw(VGA_GR_CTRL_PORT,(VGA_FUNC_SET << 8) | VGA_ROT_FN_SEL_REG);
+ /* enable all planes for writing */
+ outportw(VGA_SEQUENCER_PORT,((0x0f << 8) | VGA_WRT_PLANE_ENB_REG));
+ /* eanable all planes for set/reset */
+ outportw(VGA_GR_CTRL_PORT,((0x00 << 8) | VGA_SET_RESET_ENB_REG));
+ /* set all planes for reset */
+ outportw(VGA_GR_CTRL_PORT,((0x00 << 8) | VGA_SET_RESET_REG));
+#if 0
+ /* set write mode 3 */
+ outportw(VGA_GR_CTRL_PORT,((8+3) << 8) | VGA_MODE_REG);
+#endif
+ /* clear all */
+ if (!mode_x)
+ {
+ _farfill_l(_dos_ds,win_seg,bs/4,0xffffffffL);
+ }
+ unsigned long *_l = (unsigned long *)buffer;
+ for (i=0;i<4;i++)
+ {
+#if 1
+ /* enable plane 'i' for writing */
+ outportw(VGA_SEQUENCER_PORT,(((1 << i) << 8) | VGA_WRT_PLANE_ENB_REG));
+#endif
+ if (!mode_x)
+ {
+ /* eanable plane 'i' for set/reset */
+ outportw(VGA_GR_CTRL_PORT,(((1 << i) << 8) | VGA_SET_RESET_ENB_REG));
+ /* enable plane 'i' for set */
+ outportw(VGA_GR_CTRL_PORT,(((1 << i) << 8) | VGA_SET_RESET_REG));
+ }
+#if 0
+ /* set write mode 3 */
+ outportw(VGA_GR_CTRL_PORT,((8+3) << 8) | VGA_MODE_REG);
+#endif
+ if (mode_x)
+ {
+ movedata(_my_ds(),(int)_l,_dos_ds,win_seg,bs);
+ _l += bs/4;
+ }
+ else
+ {
+ _farsetsel(_dos_ds);
+ for (j=0;j<bs;j+=4)
+ {
+ _farnsandl(win_seg+j,*_l++);
+ }
+ }
+ offset+=bs;
+ }
+ rh_restore_vga_state();
+ }
+ else
+ {
+ movedata(_my_ds(),(int)buffer+offset,_dos_ds,win_seg,win_size);
+ offset += win_size;
+ }
+ }
+}
+
+#ifdef TEST
+
+#include <grx20.h>
+#include <stdio.h>
+#include <conio.h>
+#include <pc.h>
+
+#ifdef USE_TV
+
+#define getch()
+
+#define Uses_TScreen
+#if 1
+#define Uses_TEditorApp
+#include <tv.h>
+
+class IDE : public TEditorApp
+{
+public:
+ IDE() : TProgInit( &IDE::initStatusLine,
+ &IDE::initMenuBar,
+ &IDE::initDeskTop),
+ TEditorApp()
+ {}
+ void Suspend() { suspend(); }
+ void Resume() { resume(); Redraw(); }
+};
+
+IDE *app;
+
+#define INIT() app = new IDE(); SUSPEND()
+#define SUSPEND() app->Suspend()
+#define RESUME() app->Resume()
+char *ExpandFileNameToThePointWhereTheProgramWasLoaded(char *x)
+{
+ return x;
+}
+
+#else
+#include <tv.h>
+
+#define INIT() SUSPEND()
+#define SUSPEND() TScreen::suspend()
+#define RESUME() TScreen::resume()
+#endif
+
+#else
+
+#define INIT() textmode(3)
+#define RESUME() rh_is_vga_mode(); rh_save_vga(); textmode(0x83)
+#define SUSPEND() rh_restore_vga()
+
+#endif
+
+int main()
+{
+ int i;
+#ifdef USE_TV
+ extern int screen_saving;
+ screen_saving = 1;
+#endif
+ INIT();
+ getch();
+ GrSetMode(GR_width_height_color_graphics,360,480,256);
+ GrClearScreen(GrBlack());
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ for (i=0;i<16;i++)
+ {
+ GrFilledBox(i*21,0,i*21+20,15,i);
+ }
+ GrFilledEllipse(300,200,50,50,GrAllocColor(0,0,255));
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ GrEllipseArc(300,200,50,50,10,10,GR_ARC_STYLE_CLOSE2,GrWhite());
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ GrClearScreen(GrBlack());
+ GrFilledEllipse(300,200,50,50,GrAllocColor(0,0,255));
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ GrEllipseArc(300,200,50,50,10,10,GR_ARC_STYLE_CLOSE2,GrWhite());
+ GrFilledEllipse(300,200,50,50,GrAllocColor(0,0,255));
+ GrFilledEllipse(300,200,50,50,GrWhite());
+ getch();
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ GrTextXY(0,0,"This is a sample text",GrWhite(),GrNOCOLOR);
+ RESUME();
+ getch();
+ SUSPEND();
+ getch();
+ textmode(3);
+ return 0;
+}
+#endif
+
+#endif // DJGPP
+
diff --git a/tvision/classes/dos/vgaregs.c b/tvision/classes/dos/vgaregs.c
new file mode 100644
index 0000000..ed70088
--- /dev/null
+++ b/tvision/classes/dos/vgaregs.c
@@ -0,0 +1,225 @@
+/* Copyright 2000 (c) by Salvador Eduardo Tropea
+ This code is part of the port of Turbo Vision to gcc, please see the rest
+ of the file for copying information.
+ */
+/*
+ This module provides the functions declared inline in vgaregs.h.
+ They are needed only if you compile without optimizations.
+*/
+#include <tv/configtv.h>
+
+#define NO_INLINE
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+#include "vgaregs.h"
+
+#ifdef TVCompf_djgpp
+
+#ifdef SAFE_IO
+/* C approach, safier than my assembler ;-) */
+
+uchar ReadCRT(uchar index)
+{
+ outportb(CRTControllerIndex,index);
+ return inportb(CRTControllerData);
+}
+
+uchar ReadGRA(uchar index)
+{
+ outportb(GraphicsControllerIndex,index);
+ return inportb(GraphicsControllerData);
+}
+
+uchar ReadSEQ(uchar index)
+{
+ outportb(SequencerIndex,index);
+ return inportb(SequencerData);
+}
+
+void WriteCRT(uchar index, uchar value)
+{
+ outportb(CRTControllerIndex,index);
+ outportb(CRTControllerData,value);
+}
+
+
+void WriteGRA(uchar index, uchar value)
+{
+ outportb(GraphicsControllerIndex,index);
+ outportb(GraphicsControllerData,value);
+}
+
+void WriteSEQ(uchar index, uchar value)
+{
+ outportb(SequencerIndex,index);
+ outportb(SequencerData,value);
+}
+
+void WaitVRT()
+{
+ while (inportb(InputStatusRegister1) & 8);
+ while (!(inportb(InputStatusRegister1) & 8));
+}
+
+#else
+
+uchar ReadCRT(uchar index)
+{
+ int dummy;
+ uchar a RegEAX;
+ a=index;
+ asm volatile (
+" outb %%al,%%dx \n"
+" incl %%edx \n"
+" inb %%dx,%%al \n"
+ : "=a" (a), "=d" (dummy) : "a" (a), "d" (CRTController));
+ return a;
+}
+
+
+uchar ReadGRA(uchar index)
+{
+ int dummy;
+ uchar a RegEAX;
+ a=index;
+ asm volatile (
+" outb %%al,%%dx \n"
+" incl %%edx \n"
+" inb %%dx,%%al \n"
+ : "=a" (a), "=d" (dummy) : "a" (a), "d" (GraphicsController));
+ return a;
+}
+
+uchar ReadSEQ(uchar index)
+{
+ int dummy;
+ uchar a RegEAX;
+ a=index;
+ asm volatile (
+" outb %%al,%%dx \n"
+" incl %%edx \n"
+" inb %%dx,%%al \n"
+ : "=a" (a), "=d" (dummy) : "a" (a), "d" (Sequencer));
+ return a;
+}
+
+void WriteCRT(uchar index, uchar value)
+{
+ int dummy;
+ asm volatile (
+" movb %1,%%ah \n"
+" outw %%ax,%%dx \n"
+ : "=a" (dummy) : "qi" (value), "a" (index), "d" (CRTController));
+}
+
+void WriteGRA(uchar index, uchar value)
+{
+ int dummy;
+ asm volatile (
+" movb %1,%%ah \n"
+" outw %%ax,%%dx \n"
+ : "=a" (dummy) : "qi" (value), "a" (index), "d" (GraphicsController));
+}
+
+void WriteSEQ(uchar index, uchar value)
+{
+ int dummy;
+ asm volatile (
+" movb %1,%%ah \n"
+" outw %%ax,%%dx \n"
+ : "=a" (dummy) : "qi" (value), "a" (index), "d" (Sequencer));
+}
+
+void WaitVRT()
+{
+ asm volatile(
+" 1: \n"
+" inb %%dx,%%al \n"
+" testb $8,%%al \n"
+" jne 1b \n"
+" .align 2,0x90 \n"
+" 2: \n"
+" inb %%dx,%%al \n"
+" testb $8,%%al \n"
+" je 2b \n"
+ : : "d" (InputStatusRegister1) : "%eax" );
+}
+
+#endif
+
+uchar ReadATT(int index)
+{
+ /* Ensure we will write to the index */
+ inportb(ATTdir);
+ /* Set the index and disable the screen or we will read nothing */
+ outportb(ATTindex,index);
+ return inportb(ATTdataR);
+}
+
+void ATTEndReads(void)
+{
+ /* Ensure we will write to the index */
+ inportb(ATTdir);
+ /* Enable the screen */
+ outportb(ATTindex,0x20);
+}
+
+void WriteATT(int index, int val)
+{
+ outportb(ATTindex,index);
+ outportb(ATTdataW,val);
+}
+
+uchar ReadMOR(void)
+{
+ return inportb(MORdataR);
+}
+
+void WriteMOR(int val)
+{
+ outportb(MORdataW,val);
+}
+
+uchar ReadEDAC(int index)
+{
+ outportb(EDACindex,index);
+ return inportb(EDACdata);
+}
+
+void WriteEDAC(int index, int val)
+{
+ outportb(EDACindex,index);
+ outportb(EDACdata,val);
+}
+
+void RPF_SetPalRange(unsigned char *_pal_ptr, int color, int cant)
+{
+ int dummy1,dummy2,dummy3,dummy4;
+ asm volatile(
+" outb %%al,%%dx \n"
+" incl %%edx \n"
+" cli \n"
+" rep \n"
+" outsb \n"
+" sti \n"
+: "=a" (dummy1), "=d" (dummy2), "=S" (dummy3), "=c" (dummy4)
+: "c" (cant*3), "S" (_pal_ptr), "a" (color), "d" (0x3C8)
+);
+}
+
+void RPF_GetPalRange(unsigned char *_pal_ptr, int color, int cant)
+{
+ int dummy1,dummy2,dummy3,dummy4;
+ asm volatile (
+" outb %%al,%%dx \n"
+" addl $2,%%edx \n"
+" cli \n"
+" rep \n"
+" insb \n"
+" sti \n"
+: "=a" (dummy1), "=d" (dummy2), "=D" (dummy3), "=c" (dummy4)
+: "c" (cant*3), "D" (_pal_ptr), "a" (color), "d" (0x3C7)
+);
+}
+#endif // DJGPP
+
diff --git a/tvision/classes/dos/vgaregs.h b/tvision/classes/dos/vgaregs.h
new file mode 100644
index 0000000..7cf9f15
--- /dev/null
+++ b/tvision/classes/dos/vgaregs.h
@@ -0,0 +1,320 @@
+/* Copyright 1998-2002 (c) by Salvador Eduardo Tropea
+ This code is part of the port of Turbo Vision to gcc, please see the rest
+ of the file for copying information.
+ */
+
+#if defined(TVCompf_djgpp) && !defined(VGAREGS_HEADER_INCLUDED)
+#define VGAREGS_HEADER_INCLUDED
+
+#include <pc.h>
+
+/* CRT (Cathode Rays Tube) Controller Registers
+ They control the sync signals.
+ 0x00 to 0x18 */
+// SVGALib and XFree86 uses <0x18 so they miss the line compare register,
+// don't know why.
+#define CRTbase 0
+#define CRTcant 25
+/* ATT Attribute Controller Registers
+ They control some attributes like 16 colors palette, overscan color, etc.
+ 0x00 to 0x14 */
+#define ATTbase (CRTbase+CRTcant)
+#define ATTcant 21
+/* GRA Graphics Controller Registers
+ They control the read/write mode to the video memory.
+ 0x00 to 0x08 */
+#define GRAbase (ATTbase+ATTcant)
+#define GRAcant 9
+/* SEQ Sequence Registers
+ They control how the memory is scanned.
+ 0x00 to 0x04 */
+#define SEQbase (GRAbase+GRAcant)
+#define SEQcant 5
+/* MOR Miscellaneous Output Register
+ 1 register */
+#define MORbase (SEQbase+SEQcant)
+#define MORcant 1
+
+#define VGARegsCant (MORbase+MORcant)
+
+/* (I don't take care about mono by now) */
+/* VGA Atttibute controller */
+#define ATTindex 0x3C0
+#define ATTdataW 0x3C0
+#define ATTdataR 0x3C1
+#define ATTdir 0x3DA
+/* Miscellaneous Output Register */
+#define MORdataW 0x3C2
+#define MORdataR 0x3CC
+/* VGA Sequencer Registers */
+#define Sequencer 0x3C4
+#define SequencerIndex 0x3C4
+#define SequencerData 0x3C5
+/* VGA Palette Registers */
+#define ReadDataAddress 0x3C7
+#define WriteDataAddress 0x3C8
+#define PaletteDataRegister 0x3C9
+/* VGA Graphics Controller Registers */
+#define GraphicsController 0x3CE
+#define GraphicsControllerIndex 0x3CE
+#define GraphicsControllerData 0x3CF
+/* VGA CRT Controller Register */
+#define CRTController 0x3D4
+#define CRTControllerIndex 0x3D4
+#define CRTControllerData 0x3D5
+/* VGA Input Status Register 1 */
+#define InputStatusRegister1 0x3DA
+/* Trident's DAC/Clock */
+#define EDACindex 0x83C8
+#define EDACdata 0x83C6
+
+#if __GNUC__<3
+ // GCC 3.0 doesn't support it for local variables.
+ // But takes the right way.
+ #define RegEAX asm("%eax")
+#else
+ #define RegEAX
+#endif
+
+#ifndef NO_INLINE
+//#define SAFE_IO
+
+#ifdef SAFE_IO
+/* C approach, safier than my assembler ;-) */
+
+extern inline
+uchar ReadCRT(uchar index)
+{
+ outportb(CRTControllerIndex,index);
+ return inportb(CRTControllerData);
+}
+
+extern inline
+uchar ReadGRA(uchar index)
+{
+ outportb(GraphicsControllerIndex,index);
+ return inportb(GraphicsControllerData);
+}
+
+extern inline
+uchar ReadSEQ(uchar index)
+{
+ outportb(SequencerIndex,index);
+ return inportb(SequencerData);
+}
+
+extern inline
+void WriteCRT(uchar index, uchar value)
+{
+ outportb(CRTControllerIndex,index);
+ outportb(CRTControllerData,value);
+}
+
+
+extern inline
+void WriteGRA(uchar index, uchar value)
+{
+ outportb(GraphicsControllerIndex,index);
+ outportb(GraphicsControllerData,value);
+}
+
+extern inline
+void WriteSEQ(uchar index, uchar value)
+{
+ outportb(SequencerIndex,index);
+ outportb(SequencerData,value);
+}
+
+extern inline
+void WaitVRT()
+{
+ while (inportb(InputStatusRegister1) & 8);
+ while (!(inportb(InputStatusRegister1) & 8));
+}
+
+#else
+/*
+ Assembler stuff: It is normally more compact and in some cases faster. As
+ the functions are inline I think size is important.
+ They save 524 bytes in the driver (1.89%).
+*/
+
+extern inline
+uchar ReadCRT(uchar index)
+{
+ int dummy;
+ uchar a RegEAX;
+ a=index;
+ asm volatile (
+" outb %%al,%%dx \n"
+" incl %%edx \n"
+" inb %%dx,%%al \n"
+ : "=a" (a), "=d" (dummy) : "a" (a), "d" (CRTController));
+ return a;
+}
+
+
+extern inline
+uchar ReadGRA(uchar index)
+{
+ int dummy;
+ uchar a RegEAX;
+ a=index;
+ asm volatile (
+" outb %%al,%%dx \n"
+" incl %%edx \n"
+" inb %%dx,%%al \n"
+ : "=a" (a), "=d" (dummy) : "a" (a), "d" (GraphicsController));
+ return a;
+}
+
+extern inline
+uchar ReadSEQ(uchar index)
+{
+ int dummy;
+ uchar a RegEAX;
+ a=index;
+ asm volatile (
+" outb %%al,%%dx \n"
+" incl %%edx \n"
+" inb %%dx,%%al \n"
+ : "=a" (a), "=d" (dummy) : "a" (a), "d" (Sequencer));
+ return a;
+}
+
+extern inline
+void WriteCRT(uchar index, uchar value)
+{
+ int dummy;
+ asm volatile (
+" movb %1,%%ah \n"
+" outw %%ax,%%dx \n"
+ : "=a" (dummy) : "qi" (value), "a" (index), "d" (CRTController));
+}
+
+extern inline
+void WriteGRA(uchar index, uchar value)
+{
+ int dummy;
+ asm volatile (
+" movb %1,%%ah \n"
+" outw %%ax,%%dx \n"
+ : "=a" (dummy) : "qi" (value), "a" (index), "d" (GraphicsController));
+}
+
+extern inline
+void WriteSEQ(uchar index, uchar value)
+{
+ int dummy;
+ asm volatile (
+" movb %1,%%ah \n"
+" outw %%ax,%%dx \n"
+ : "=a" (dummy) : "qi" (value), "a" (index), "d" (Sequencer));
+}
+
+
+extern inline
+void WaitVRT()
+{
+ asm volatile(
+" 1: \n"
+" inb %%dx,%%al \n"
+" testb $8,%%al \n"
+" jne 1b \n"
+" .align 2,0x90 \n"
+" 2: \n"
+" inb %%dx,%%al \n"
+" testb $8,%%al \n"
+" je 2b \n"
+ : : "d" (InputStatusRegister1) : "%eax" );
+}
+
+#endif
+
+extern inline
+uchar ReadATT(int index)
+{
+ /* Ensure we will write to the index */
+ inportb(ATTdir);
+ /* Set the index and disable the screen or we will read nothing */
+ outportb(ATTindex,index);
+ return inportb(ATTdataR);
+}
+
+extern inline
+void ATTEndReads(void)
+{
+ /* Ensure we will write to the index */
+ inportb(ATTdir);
+ /* Enable the screen */
+ outportb(ATTindex,0x20);
+}
+
+extern inline
+void WriteATT(int index, int val)
+{
+ outportb(ATTindex,index);
+ outportb(ATTdataW,val);
+}
+
+extern inline
+uchar ReadMOR(void)
+{
+ return inportb(MORdataR);
+}
+
+extern inline
+void WriteMOR(int val)
+{
+ outportb(MORdataW,val);
+}
+
+extern inline
+uchar ReadEDAC(int index)
+{
+ outportb(EDACindex,index);
+ return inportb(EDACdata);
+}
+
+extern inline
+void WriteEDAC(int index, int val)
+{
+ outportb(EDACindex,index);
+ outportb(EDACdata,val);
+}
+
+extern inline
+void RPF_SetPalRange(unsigned char *_pal_ptr, int color, int cant)
+{
+ int dummy1,dummy2,dummy3,dummy4;
+ asm volatile (
+" outb %%al,%%dx \n"
+" incl %%edx \n"
+" cli \n"
+" rep \n"
+" outsb \n"
+" sti \n"
+: "=a" (dummy1), "=d" (dummy2), "=S" (dummy3), "=c" (dummy4)
+: "c" (cant*3), "S" (_pal_ptr), "a" (color), "d" (0x3C8)
+);
+}
+
+extern inline
+void RPF_GetPalRange(unsigned char *_pal_ptr, int color, int cant)
+{
+ int dummy1,dummy2,dummy3,dummy4;
+ asm volatile (
+" outb %%al,%%dx \n"
+" addl $2,%%edx \n"
+" cli \n"
+" rep \n"
+" insb \n"
+" sti \n"
+: "=a" (dummy1), "=d" (dummy2), "=D" (dummy3), "=c" (dummy4)
+: "c" (cant*3), "D" (_pal_ptr), "a" (color), "d" (0x3C7)
+);
+}
+#endif // NO_INLINE
+
+#endif // defined(TVCompf_djgpp) && !defined(VGAREGS_HEADER_INCLUDED)
+
diff --git a/tvision/classes/dos/vgastate.c b/tvision/classes/dos/vgastate.c
new file mode 100644
index 0000000..578ab18
--- /dev/null
+++ b/tvision/classes/dos/vgastate.c
@@ -0,0 +1,207 @@
+/* Copyright 1998-1999 (c) by Salvador Eduardo Tropea
+ This code is part of the port of Turbo Vision to gcc, please see the rest
+ of the file for copying information.
+ */
+/*****************************************************************************
+
+ ROUTINES to store/retrieve the VGA registers.
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+#include "vgaregs.h"
+
+#ifdef TVCompf_djgpp
+
+#include <sys/movedata.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ This function stores ALL the VGA registers in an array.
+
+***************************************************************************/
+
+static
+int VGASaveRegs(uchar *regs)
+{
+ int i;
+ uchar MORval;
+
+ /* I'm trying to do this routine as strong and generic as possible
+ without loosing performance.
+ So I ever put the VGA chip in the color mode (ports=0x3Dx) but I
+ store the real state */
+ MORval=ReadMOR();
+ WriteMOR(MORval | 1);
+ regs[MORbase]=MORval;
+
+ for (i=0; i<CRTcant; i++)
+ regs[CRTbase+i]=ReadCRT(i);
+
+ /******* The Attribute Registers are worst that a pain in the ass I think
+ the @#*$ people from the Giant Blue tried to make it hard to
+ understand on purpose ********/
+ for (i=0; i<ATTcant; i++)
+ regs[ATTbase+i]=ReadATT(i);
+ ATTEndReads();
+
+ for (i=0; i<GRAcant; i++)
+ regs[GRAbase+i]=ReadGRA(i);
+
+ for (i=0; i<SEQcant; i++)
+ regs[SEQbase+i]=ReadSEQ(i);
+
+ WriteMOR(MORval);
+
+ return VGARegsCant;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Restores the VGA registers from an array.
+
+***************************************************************************/
+
+static
+void VGALoadRegs(const uchar *regs)
+{
+ int i;
+ uchar CRT11,MORval;
+
+ MORval=ReadMOR();
+ /* Ensure we are in the color mode or the ports could be moved to 0x3Bx */
+ WriteMOR(MORval | 1);
+ /* Wait a full retrace to avoid extra noise in screen */
+ while (inportb(0x3DA) & 8);
+ while (!(inportb(0x3DA) & 8));
+
+ /* Screen Off to avoid funny things displayed */
+ WriteSEQ(0x01,regs[SEQbase+1] | 0x20);
+
+ /* Synchronous reset ON, we must do it or we could lose video RAM contents */
+ WriteSEQ(0x00,1);
+ for (i=2; i<SEQcant; i++)
+ WriteSEQ(i,regs[SEQbase+i]);
+ /* Synchronous reset restored */
+ WriteSEQ(0x00,regs[SEQbase]);
+
+ /* Deprotect CRT registers 0-7 */
+ CRT11=regs[CRTbase+0x11];
+ WriteCRT(0x11,CRT11 & 0x7F);
+ /* write CRT registers */
+ for (i=0; i<CRTcant; i++)
+ if (i!=0x11)
+ WriteCRT(i,regs[CRTbase+i]);
+ /* Restore the protection state */
+ WriteCRT(0x11,CRT11);
+
+ for (i=0; i<GRAcant; i++)
+ WriteGRA(i,regs[GRAbase+i]);
+
+ /******* The Attribute Registers are worst that a pain in the ass I think
+ the @#*$ people from the Giant Blue tried to make it hard to
+ understand on purpose ********/
+ /* Ensure we will write to the index */
+ inportb(ATTdir);
+ for (; i<ATTcant; i++)
+ WriteATT(i,regs[ATTbase+i]);
+ ATTEndReads();
+
+ /* Restore MOR */
+ WriteMOR(regs[MORbase]);
+
+ /* Restore Screen On/Off status */
+ WriteSEQ(0x01,regs[SEQbase+1]);
+}
+
+#define BIOSDataAreaSize 96
+#define BIOSDataAreaStart 0x49
+
+static
+void SaveBIOSDTA(uchar *dta)
+{
+ dosmemget(0x400+BIOSDataAreaStart,BIOSDataAreaSize,dta);
+}
+
+static
+void LoadBIOSDTA(uchar *dta)
+{
+ dosmemput(dta,BIOSDataAreaSize,0x400+BIOSDataAreaStart);
+}
+
+#define VGAPalSize 768
+
+static
+void VGASavePal(uchar *pal)
+{
+ RPF_GetPalRange(pal,0,256);
+}
+
+static
+void VGALoadPal(uchar *pal)
+{
+ RPF_SetPalRange(pal,0,256);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the amount of memory neededed to save the state.
+
+ Return:
+ int memory needed.
+
+***************************************************************************/
+
+int VGAStateGetBufferSize(void)
+{
+ return VGARegsCant+VGAPalSize+BIOSDataAreaSize;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Stores the current video mode information in the provided buffer. The
+buffer must be large enough to hold all the information.
+
+ Return:
+ !=0 => success
+
+***************************************************************************/
+
+int VGAStateSave(void *buffer)
+{
+ uchar *s=(uchar *)buffer;
+ if (!s) return 0;
+ VGASaveRegs(s);
+ VGASavePal(s+VGARegsCant);
+ SaveBIOSDTA(s+VGARegsCant+VGAPalSize);
+ VGALoadRegs(s);
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Restores the current video mode information from the provided buffer.
+
+ Return:
+ !=0 => success
+
+***************************************************************************/
+
+int VGAStateLoad(void *buffer)
+{
+ uchar *s=(uchar *)buffer;
+ if (!s) return 0;
+ LoadBIOSDTA(s+VGARegsCant+VGAPalSize);
+ VGALoadPal(s+VGARegsCant);
+ VGALoadRegs(s);
+ return 1;
+}
+
+#endif // DJGPP
diff --git a/tvision/classes/dos/vgastate.h b/tvision/classes/dos/vgastate.h
new file mode 100644
index 0000000..cd22c3a
--- /dev/null
+++ b/tvision/classes/dos/vgastate.h
@@ -0,0 +1,19 @@
+/* Copyright 1998-2002 (c) by Salvador Eduardo Tropea
+ This code is part of the port of Turbo Vision to gcc, please see the rest
+ of the file for copying information.
+ */
+
+#if defined(TVCompf_djgpp) && !defined(VGASTATE_HEADER_INCLUDED)
+#define VGASTATE_HEADER_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+int VGAStateGetBufferSize(void);
+int VGAStateSave(void *buffer);
+int VGAStateLoad(void *buffer);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/tvision/classes/fontcoll.cc b/tvision/classes/fontcoll.cc
new file mode 100644
index 0000000..5eae2b3
--- /dev/null
+++ b/tvision/classes/fontcoll.cc
@@ -0,0 +1,574 @@
+/**[txh]********************************************************************
+
+ Copyright 1996-2002 by Salvador Eduardo Tropea (SET)
+ This file is covered by the GPL license.
+
+ Module: TVFontCollection
+ Comments:
+ This module handles collections of 8xN bitmaped fonts useful for text
+consoles. The collection is created from a fonts files. Each item is a font
+of certain height. The collection can return interpolated and extrapolated
+fonts in a range of +/- one from the available fonts. The fonts file should
+contain fonts with all the supported symbols.@p
+
+@<pre>
+ SFT Files: This is currently platform dependent! It means SFT files should
+ be generated in the same platform they are used. It will be fixed in the
+ future.
+
+ 17 bytes: SET's editor font
+ 1 byte: 26 (DOS EOF)
+ int: version (1 or 2)
+ int: number of fonts contained.
+ 2 bytes: size of name
+ the name, the length includes the EOS, but this isn't stored on
+ disk.
+
+ Here are the fonts, each one have this format:
+ version 1:
+ int: first symbol defined.
+ int: last symbol defined.
+ unsigned: height of the font.
+ The width is assumed to be 8 pixels (1 byte)
+
+ version 2, the same but adds:
+ unsigned: width of the font.
+
+ The fonts itself follows the internal code.
+@</pre>
+
+***************************************************************************/
+
+#define Uses_stdlib
+#define Uses_string
+#define Uses_dirent
+#define Uses_limits
+#define Uses_TVCodePage
+#define Uses_TVFontCollection
+#include <tv.h>
+
+//#define TEST
+
+const int SizeInDisk1=3*sizeof(int);
+const int SizeInDisk2=SizeInDisk1+sizeof(int);
+const char TVFontCollection::Signature[]="SET's editor font\x1A";
+const char TVFontCollection::SFTExtension[]=".sft";
+int TVFontCollection::invertEndian=0;
+
+struct SizeFont
+{
+ unsigned width,height;
+};
+
+static
+int isWordChar(int i)
+{
+ return i=='_' || TVCodePage::isAlpha(i);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ A specialized free to free the memory used by the font structure.
+
+***************************************************************************/
+
+void TVFontCollection::freeItem(void *item)
+{
+ TVBitmapFont *p=(TVBitmapFont *)item;
+ if (p)
+ {
+ DeleteArray(p->font);
+ DeleteArray(p->fontFull);
+ delete p;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Internally used during searchs to look for a font that matchs a specified
+size.
+
+***************************************************************************/
+
+Boolean TVFontCollection::CheckForLines(void *item, void *arg)
+{
+ TVBitmapFont *p=(TVBitmapFont *)item;
+ SizeFont *s=(SizeFont *)arg;
+ if (p && p->lines==s->height && p->width==s->width)
+ return True;
+ return False;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates a font of the specified height from another of the same height
+plus one. The destination buffer should be large enough (num*height bytes).
+Special care is taked for letters.
+
+***************************************************************************/
+
+void TVFontCollection::ReduceOne(uchar *dest, uchar *ori, int height,
+ int wBytes, int num)
+{
+ int i;
+ unsigned sizeDest=wBytes*height;
+ unsigned sizeOri=sizeDest+wBytes;
+ // height is the dest size, ori is one more
+
+ for (i=0; i<num; i++)
+ {
+ if (isWordChar(i) && ori[0])
+ { // first pixel is used
+ memcpy(dest,ori,sizeDest);
+ }
+ else
+ { // first free
+ memcpy(dest,ori+wBytes,sizeDest);
+ }
+
+ ori+=sizeOri;
+ dest+=sizeDest;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates a font of the specified height from another of the same height
+minus one. The destination buffer should be large enough (num*height bytes).
+The last line is filled with 0.
+
+***************************************************************************/
+
+void TVFontCollection::EnlargeOne(uchar *dest, uchar *ori, int height,
+ int wBytes, int num)
+{
+ int i;
+ unsigned sizeDest=wBytes*height;
+ unsigned sizeOri=sizeDest-wBytes;
+ // height is the dest size, ori is one less
+
+ for (i=0; i<num; i++)
+ {
+ memcpy(dest,ori,sizeOri);
+ //memset(dest+sizeOri,0,wBytes);
+ // Copy the last line
+ memcpy(dest+sizeOri,dest+sizeOri-wBytes,wBytes);
+
+ ori+=sizeOri;
+ dest+=sizeDest;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns a newly allocated block of memory containing a font of the
+specified height.
+
+ Return: NULL if the font isn't available.
+
+***************************************************************************/
+
+uchar *TVFontCollection::GetFont(int width, int height)
+{
+ int oneMore=0,oneLess=0;
+ SizeFont sz={width,height};
+
+ TVBitmapFont *p=(TVBitmapFont *)firstThat(CheckForLines,&sz);
+ // If we can't find a font of the right size look for 1 more and one less
+ if (!p)
+ {
+ sz.height++;
+ p=(TVBitmapFont *)firstThat(CheckForLines,&sz);
+ if (p)
+ oneMore=1;
+ else
+ {
+ sz.height-=2;
+ p=(TVBitmapFont *)firstThat(CheckForLines,&sz);
+ if (p)
+ oneLess=1;
+ }
+ }
+
+ if (!p || !p->font)
+ return NULL;
+
+ unsigned size=256*height*p->wBytes;
+ uchar *fontShape=new uchar[size];
+ if (oneMore)
+ ReduceOne(fontShape,p->font,height,p->wBytes);
+ else if (oneLess)
+ EnlargeOne(fontShape,p->font,height,p->wBytes);
+ else
+ memcpy(fontShape,p->font,size);
+
+ return fontShape;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Internally used to check if we opened a fonts file.
+
+***************************************************************************/
+
+int TVFontCollection::CheckSignature(FILE *f)
+{
+ char buf[sizeof(Signature)];
+ fread(buf,sizeof(Signature)-1,1,f);
+ buf[sizeof(Signature)-1]=0;
+ return strcmp(Signature,buf)==0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Internally used to get the font's name.
+
+***************************************************************************/
+
+char *TVFontCollection::ReadName(FILE *f)
+{
+ uint16 strLen;
+ fread(&strLen,2,1,f);
+ Swap(&strLen);
+ char *aux=new char[strLen];
+ strLen--;
+ fread(aux,strLen,1,f);
+ aux[strLen]=0;
+ return aux;
+}
+
+#define SwapMacro(a,b) t=v[a]; v[a]=v[b]; v[b]=t
+void TVFontCollection::Swap(int *value)
+{
+ if (!invertEndian) return;
+ char *v=(char *)value, t;
+ SwapMacro(0,3);
+ SwapMacro(1,2);
+}
+
+void TVFontCollection::Swap(uint16 *value)
+{
+ if (!invertEndian) return;
+ char *v=(char *)value, t;
+ SwapMacro(0,1);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Internally used to read the version and number of fonts in the file.
+
+***************************************************************************/
+
+void TVFontCollection::ReadVersionNum(FILE *f, int *version, int *numfonts)
+{
+ fread(version,4,1,f);
+ fread(numfonts,4,1,f);
+ invertEndian=*version>0x1000;
+ Swap(version);
+ Swap(numfonts);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Internally used to read the information about a font contained in an SFT
+file.
+
+ Return: Size of the data font.
+
+***************************************************************************/
+
+unsigned TVFontCollection::ReadFontInfo(FILE *f, int version, TVBitmapFont *p)
+{
+ if (version==1)
+ {
+ fread(p,SizeInDisk1,1,f);
+ p->width=8;
+ p->wBytes=1;
+ }
+ else
+ {
+ fread(p,SizeInDisk2,1,f);
+ Swap(&p->width);
+ p->wBytes=(p->width+7)/8;
+ }
+ Swap(&p->first);
+ Swap(&p->last);
+ Swap(&p->lines);
+ return (p->last-p->first+1)*p->lines*p->wBytes;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Internally used to create a font for a desired code page.
+
+***************************************************************************/
+
+void TVFontCollection::CreateFont(void *item, void *arg)
+{
+ TVBitmapFont *f=(TVBitmapFont *)item;
+ ushort *map=(ushort *)arg;
+ DeleteArray(f->font);
+ unsigned size1=f->lines*f->wBytes;
+ unsigned size=256*size1;
+ f->font=new uchar[size];
+ int i;
+ uchar *dest=f->font;
+ memset(f->font,0,size);
+ for (i=0; i<256; i++,dest+=size1)
+ {
+ int index=map[i];
+ if (index>f->last)
+ {
+ index=TVCodePage::LookSimilarInRange(index,f->last);
+ if (index==-1)
+ index=f->first;
+ }
+ index-=f->first;
+ memcpy(dest,&f->fontFull[index*size1],size1);
+ }
+
+ #if 0
+ // This code stores the generated font to disk, is used for debug
+ // purposes
+ FILE *F;
+ char b[PATH_MAX],*t;
+ t=getenv("TMP");
+ if (!t) t="/tmp";
+ sprintf(b,"%s/font.%03d",t,f->lines);
+ F=fopen(b,"wb");
+ fwrite(f->font,size,1,F);
+ fclose(F);
+ #endif
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the encoding of the fonts returned by GetFont.
+
+***************************************************************************/
+
+void TVFontCollection::SetCodePage(int id)
+{
+ ushort *map=TVCodePage::GetTranslate(id);
+ if (map)
+ forEach(CreateFont,map);
+}
+
+TVFontCollection::~TVFontCollection()
+{
+ DeleteArray(fontName);
+ DeleteArray(fileName);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates a font collection from the specified file and using the specified
+code page. You must check the error status with GetError before using the
+collection.
+
+***************************************************************************/
+
+TVFontCollection::TVFontCollection(const char *file, int cp) :
+ TNSCollection(2,2)
+{
+ error=0;
+ fontName=fileName=NULL;
+ if (!file)
+ {
+ error=1;
+ return;
+ }
+
+ FILE *f=fopen(file,"rb");
+ if (!f)
+ {
+ error=2;
+ return;
+ }
+
+ if (!CheckSignature(f))
+ {
+ fclose(f);
+ error=3;
+ return;
+ }
+
+ int version;
+ int numfonts;
+ ReadVersionNum(f,&version,&numfonts);
+
+ int i;
+ TVBitmapFont *p;
+ uchar *fData;
+ unsigned size;
+
+ fontName=ReadName(f);
+ fileName=newStr(file);
+
+ for (i=0; i<numfonts; i++)
+ {
+ p=new TVBitmapFont;
+ size=ReadFontInfo(f,version,p);
+ fData=new uchar[size];
+ fread(fData,size,1,f);
+ p->fontFull=fData;
+ p->font=0;
+ insert(p);
+ }
+ fclose(f);
+ SetCodePage(cp);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Constructs a string collection of fonts files that provides shapes inside
+the specified range. The fonts are searched in the specified directory. If
+you specify NULL as directory then the search is done in the current
+directory. Each element in the collection is a string that contains two
+ASCIIZ strings. The first is the fantasy name of the font and the second is
+the name of the file containing it. It is useful to display the name in
+a TSortedListBox and easilly locate which file contains it using strlen.@*
+ This is an static member.
+
+ Return: The collection of available fonts or NULL if none.
+
+***************************************************************************/
+
+TVBitmapFontDescCol *TVFontCollection::CreateListOfFonts(const char *dir,
+ unsigned wmin, unsigned wmax, unsigned hmin, unsigned hmax)
+{
+ char *FullName=new char[PATH_MAX];
+ TVBitmapFontDescCol *col=new TVBitmapFontDescCol();
+
+ if (!dir)
+ dir=".";
+ DIR *d=opendir(dir);
+ struct dirent *de;
+ int version;
+ int numfonts;
+ unsigned size;
+ TVBitmapFont stF;
+ TVBitmapFontSize sizeSt;
+ if (d)
+ {
+ while ((de=readdir(d))!=0)
+ {
+ if (strstr(de->d_name,SFTExtension))
+ {
+ strcpy(FullName,dir);
+ strcat(FullName,"/");
+ strcat(FullName,de->d_name);
+ FILE *f=fopen(FullName,"rb");
+ if (f)
+ {
+ if (CheckSignature(f))
+ {
+ ReadVersionNum(f,&version,&numfonts);
+ char *name=ReadName(f);
+ TVBitmapFontDesc *d=NULL;
+ int i,j,added;
+ ccIndex pos;
+ for (i=0; i<numfonts; i++)
+ {
+ size=ReadFontInfo(f,version,&stF);
+ for (added=0, j=-1; j<2; j++)
+ {
+ if (stF.width>=wmin && stF.width<=wmax &&
+ (stF.lines+j)>=hmin && (stF.lines+j)<=hmax)
+ {
+ if (!d)
+ {
+ d=new TVBitmapFontDesc;
+ d->name=name;
+ d->file=newStr(FullName);
+ d->sizes=new TVBitmapFontSizeCol();
+ }
+ sizeSt.w=stF.width; sizeSt.h=stF.lines+j;
+ if (!d->sizes->search(&sizeSt,pos))
+ {
+ TVBitmapFontSize *p=new TVBitmapFontSize;
+ p->w=stF.width;
+ p->h=stF.lines+j;
+ d->sizes->insert(p);
+ }
+ }
+ }
+ fseek(f,size,SEEK_CUR);
+ }
+ if (d)
+ col->insert(d);
+ else
+ DeleteArray(name);
+ }
+ fclose(f);
+ }
+ }
+ }
+ closedir(d);
+ }
+ delete[] FullName;
+ if (col->getCount()==0)
+ {
+ CLY_destroy(col);
+ return NULL;
+ }
+ return col;
+}
+
+void TVBitmapFontDescCol::freeItem(void *item)
+{
+ TVBitmapFontDesc *p=(TVBitmapFontDesc *)item;
+ DeleteArray((char *)p->name);
+ DeleteArray((char *)p->file);
+ CLY_destroy(p->sizes);
+ delete p;
+}
+
+void *TVBitmapFontDescCol::keyOf(void *item)
+{
+ TVBitmapFontDesc *p=(TVBitmapFontDesc *)item;
+ return (void *)p->name;
+}
+
+void TVBitmapFontDescLBox::getText(char *dest, ccIndex item, short maxChars)
+{
+ TVBitmapFontDesc *p=(TVBitmapFontDesc *)items->at(item);
+ strncpy(dest,p->name,maxChars);
+ dest[maxChars]=0;
+}
+
+int TVBitmapFontSizeCol::compare(void *key1, void *key2)
+{
+ TVBitmapFontSize *v1=(TVBitmapFontSize *)key1;
+ TVBitmapFontSize *v2=(TVBitmapFontSize *)key2;
+ if (v1->w>v2->w) return 1;
+ if (v1->w<v2->w) return -1;
+ return (v1->h>v2->h)-(v1->h<v2->h);
+}
+
+void TVBitmapFontSizeLBox::getText(char *dest, ccIndex item, short maxChars)
+{
+ TVBitmapFontSize *p=(TVBitmapFontSize *)items->at(item);
+ // Limit the value to know we won't exceed the buffer
+ unsigned w=p->w; if (w>999) w=999;
+ unsigned h=p->h; if (h>999) h=999;
+ char b[12];
+ sprintf(b,"%3d x %-3d",w,h);
+ strncpy(dest,b,maxChars);
+ dest[maxChars]=0;
+}
+
diff --git a/tvision/classes/fpbase.cc b/tvision/classes/fpbase.cc
new file mode 100644
index 0000000..5f86546
--- /dev/null
+++ b/tvision/classes/fpbase.cc
@@ -0,0 +1,143 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis and Christoph Bauer.
+
+ *
+ *
+ */
+
+#define Uses_pstream
+#define Uses_fpbase
+#define Uses_PubStreamBuf
+#include <tv.h>
+
+UsingNamespaceStd
+
+fpbase::fpbase()
+{
+ buf=new CLY_int_filebuf();
+ pstream::init(buf);
+}
+
+fpbase::fpbase(int f)
+{
+ CLY_NewFBFromFD(buf,f);
+ pstream::init(buf);
+}
+
+fpbase::fpbase( const char *name, CLY_OpenModeT omode, int prot )
+{
+ buf=new CLY_int_filebuf();
+ open(name,omode,prot);
+ pstream::init(buf);
+}
+
+fpbase::fpbase( int f, char *b, int len )
+{
+ CLY_NewFBFromFD(buf,f);
+ buf->CLY_PubSetBuf(b,len);
+ pstream::init(buf);
+}
+
+void fpbase::setbuf(char* b, int len)
+{
+ if (buf->CLY_PubSetBuf(b,len))
+ clear(CLY_IOSGoodBit);
+ else
+ setstate(CLY_IOSFailBit);
+}
+
+#ifdef CLY_HaveFBAttach
+void fpbase::attach(int f)
+{
+ if (buf->is_open())
+ setstate(CLY_IOSFailBit);
+ else if(buf->attach(f))
+ clear(CLY_IOSGoodBit);
+ else
+ clear(CLY_IOSBadBit);
+}
+#endif
+
+fpbase::~fpbase()
+{
+ delete buf;
+}
+
+void fpbase::open( const char *b, CLY_OpenModeT m, int prot )
+{
+ if (buf->is_open())
+ clear(CLY_IOSFailBit); // fail - already open
+ else if (buf->CLY_FBOpen(b,m,prot))
+ clear(CLY_IOSGoodBit); // successful open
+ else
+ clear(CLY_IOSBadBit); // open failed
+}
+
+void fpbase::close()
+{
+ if (buf->close())
+ clear(CLY_IOSGoodBit);
+ else
+ setstate(CLY_IOSFailBit);
+}
+
+CLY_filebuf *fpbase::rdbuf()
+{
+ return buf;
+}
+
+#ifdef CLY_DefineSpecialFileBuf
+// gcc 3.1 specific
+CLY_int_filebuf *CLY_int_filebuf::open(FILE *f, ios_base::openmode mode)
+{
+ CLY_int_filebuf *ret=NULL;
+ if (!this->is_open())
+ {
+ _M_file.sys_open(f,mode);
+ if (this->is_open())
+ {
+ _M_allocate_internal_buffer();
+ _M_mode=mode;
+
+ // For time being, set both (in/out) sets of pointers.
+ _M_set_indeterminate();
+ if ((mode & ios_base::ate) &&
+ this->seekoff(0,ios_base::end,mode)<0)
+ this->close();
+ ret=this;
+ }
+ }
+ return ret;
+}
+
+CLY_int_filebuf *CLY_int_filebuf::open(int h, ios_base::openmode mode)
+{
+ CLY_int_filebuf *ret=NULL;
+ if (!this->is_open())
+ {
+ _M_file.sys_open(h,mode,false);
+ if (this->is_open())
+ {
+ _M_allocate_internal_buffer();
+ _M_mode=mode;
+
+ // For time being, set both (in/out) sets of pointers.
+ _M_set_indeterminate();
+ if ((mode & ios_base::ate) &&
+ this->seekoff(0,ios_base::end,mode)<0)
+ this->close();
+ ret=this;
+ }
+ }
+ return ret;
+}
+#endif // CLY_DefineSpecialFileBuf
+
diff --git a/tvision/classes/fpstream.cc b/tvision/classes/fpstream.cc
new file mode 100644
index 0000000..6cda360
--- /dev/null
+++ b/tvision/classes/fpstream.cc
@@ -0,0 +1,83 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis and Christoph Bauer.
+Added filelength member by Salvador E. Tropea (SET)
+Added fpstream( CLY_OpenModeT omode, const char* name, int prot ) to avoid
+the CLY_IOSOut | CLY_IOSBin addition.
+
+ *
+ *
+ */
+
+#define Uses_fpbase
+#define Uses_fpstream
+#define Uses_IOS_BIN
+#define Uses_filelength
+#include <tv.h>
+
+UsingNamespaceStd
+
+fpstream::fpstream()
+{
+}
+
+fpstream::fpstream( const char* name, CLY_OpenModeT omode, int prot ) :
+ fpbase( name, omode | CLY_IOSOut | CLY_IOSBin, prot )
+{
+}
+
+fpstream::fpstream( CLY_OpenModeT omode, const char* name, int prot ) :
+ fpbase( name, omode, prot )
+{
+}
+
+fpstream::fpstream( int f ) : fpbase( f )
+{
+}
+
+fpstream::fpstream(int f, char* b, int len) : fpbase(f, b, len)
+{
+}
+
+fpstream::~fpstream()
+{
+}
+
+CLY_filebuf *fpstream::rdbuf()
+{
+ return fpbase::rdbuf();
+}
+
+void fpstream::open( const char *name, CLY_OpenModeT omode, int prot )
+{
+ fpbase::open( name, omode | CLY_IOSIn | CLY_IOSOut | CLY_IOSBin, prot );
+}
+
+
+// SET: I added this member because a lot of applications tries to get
+// the file descriptor just to find the filelength. This mechanism doesn't
+// work with the ISO C++ 1998 standard so here I hide the difference using
+// it.
+#ifdef CLY_ISOCpp98
+long fpstream::filelength()
+{
+ long basePos=tellp();
+ long ret=seekg(0, CLY_IOSEnd).tellg();
+ seekg(basePos, CLY_IOSBeg);
+ return ret;
+}
+#else
+long fpstream::filelength()
+{
+ return ::filelength(rdbuf()->fd());
+}
+#endif
+
diff --git a/tvision/classes/help.cc b/tvision/classes/help.cc
new file mode 100644
index 0000000..568b806
--- /dev/null
+++ b/tvision/classes/help.cc
@@ -0,0 +1,262 @@
+/*
+ * help.cc
+ *
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified by Salvador E. Tropea <set@ieee.org>, <set@users.sourceforge.net>
+ */
+
+// SET: moved the standard headers before tv.h
+#define Uses_limits
+#define Uses_ctype
+#define Uses_string
+#define Uses_sys_stat
+
+#define Uses_TDrawBuffer
+#define Uses_TKeys
+#define Uses_TPalette
+#define Uses_THelpWindow
+#include <tv.h>
+
+// THelpViewer
+
+THelpViewer::THelpViewer( const TRect& bounds, TScrollBar* aHScrollBar,
+ TScrollBar* aVScrollBar, THelpFile *aHelpFile, ushort context )
+ : TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ options = (options | ofSelectable);
+ growMode = gfGrowHiX | gfGrowHiY;
+ hFile = aHelpFile;
+ topic = aHelpFile->getTopic(context);
+ topic->setWidth(size.x);
+ setLimit(78, topic->numLines());
+ selected = 1;
+}
+
+THelpViewer::~THelpViewer()
+{
+ delete hFile;
+ delete topic;
+}
+
+void THelpViewer::changeBounds( const TRect& bounds )
+{
+ TScroller::changeBounds(bounds);
+ topic->setWidth(size.x);
+ setLimit(limit.x, topic->numLines());
+}
+
+void THelpViewer::draw()
+{
+ TDrawBuffer b;
+ char line[256];
+ char buffer[256];
+ char *bufPtr;
+ int i, j, l;
+ int keyCount;
+ ushort normal, keyword, selKeyword, c;
+ TPoint keyPoint;
+ uchar keyLength;
+ int keyRef;
+
+ normal = getColor(1);
+ keyword = getColor(2);
+ selKeyword = getColor(3);
+ keyCount = 0;
+ keyPoint.x = 0;
+ keyPoint.y = 0;
+ topic->setWidth(size.x);
+ if (topic->getNumCrossRefs() > 0)
+ {
+ do
+ {
+ topic->getCrossRef(keyCount, keyPoint, keyLength, keyRef);
+ ++keyCount;
+ } while ( (keyCount < topic->getNumCrossRefs()) &&
+ (keyPoint.y <= delta.y));
+ }
+ for (i = 1; i <= size.y; ++i)
+ {
+ b.moveChar(0, ' ', normal, size.x);
+ strcpy(line, topic->getLine(i + delta.y, buffer, sizeof( buffer )));
+// if (strlen(line) > delta.x) /* XXX */
+ if ((int)strlen(line) > delta.x) /* XXX */
+ {
+ bufPtr = line + delta.x;
+ strncpy(buffer, bufPtr, size.x);
+ buffer[size.x] = 0;
+ b.moveStr(0, buffer, normal);
+ }
+ else
+ b.moveStr(0, "", normal);
+ while (i + delta.y == keyPoint.y)
+ {
+ l = keyLength;
+ if (keyPoint.x < delta.x )
+ {
+ l -= (delta.x - keyPoint.x);
+ keyPoint.x = delta.x;
+ }
+ if (keyCount == selected)
+ c = selKeyword;
+ else
+ c = keyword;
+ for(j = 0; j < l; ++j)
+ b.putAttribute((keyPoint.x - delta.x + j),c);
+ if (keyCount < topic->getNumCrossRefs())
+ {
+ topic->getCrossRef(keyCount, keyPoint, keyLength, keyRef);
+ keyCount++;
+ }
+ else
+ keyPoint.y = 0;
+ }
+ writeLine(0, i-1, size.x, 1, b);
+ }
+}
+
+TPalette& THelpViewer::getPalette() const
+{
+ static TPalette palette( cHelpViewer, sizeof( cHelpViewer)-1 );
+ return palette;
+}
+
+void THelpViewer::makeSelectVisible( int selected, TPoint& keyPoint,
+ uchar& keyLength, int& keyRef )
+{
+ TPoint d;
+
+ topic->getCrossRef(selected, keyPoint, keyLength, keyRef);
+ d = delta;
+ if (keyPoint.x < d.x)
+ d.x = keyPoint.x;
+ if (keyPoint.x > d.x + size.x)
+ d.x = keyPoint.x - size.x;
+ if (keyPoint.y <= d.y)
+ d.y = keyPoint.y-1;
+ if (keyPoint.y > d.y + size.y)
+ d.y = keyPoint.y - size.y;
+ if ((d.x != delta.x) || (d.y != delta.y))
+ scrollTo(d.x, d.y);
+}
+
+void THelpViewer::switchToTopic( int keyRef )
+{
+ if (topic != 0)
+ delete topic;
+ topic = hFile->getTopic(keyRef);
+ topic->setWidth(size.x);
+ scrollTo(0, 0);
+ setLimit(limit.x, topic->numLines());
+ selected = 1;
+ drawView();
+}
+
+void THelpViewer::handleEvent( TEvent& event )
+{
+
+ TPoint keyPoint, mouse;
+ uchar keyLength;
+ int keyRef;
+ int keyCount;
+
+
+ TScroller::handleEvent(event);
+ switch (event.what)
+ {
+
+ case evKeyDown:
+ switch (event.keyDown.keyCode)
+ {
+ case kbTab:
+ ++selected;
+ if (selected > topic->getNumCrossRefs())
+ selected = 1;
+ if ( topic->getNumCrossRefs() != 0 )
+ makeSelectVisible(selected-1,keyPoint,keyLength,keyRef);
+ break;
+ case kbShiftTab:
+ --selected;
+ if (selected == 0)
+ selected = topic->getNumCrossRefs();
+ if ( topic->getNumCrossRefs() != 0 )
+ makeSelectVisible(selected-1,keyPoint,keyLength,keyRef);
+ break;
+ case kbEnter:
+ if (selected <= topic->getNumCrossRefs())
+ {
+ topic->getCrossRef(selected-1, keyPoint, keyLength, keyRef);
+ switchToTopic(keyRef);
+ }
+ break;
+ case kbEsc:
+ event.what = evCommand;
+ event.message.command = cmClose;
+ putEvent(event);
+ break;
+ default:
+ return;
+ }
+ drawView();
+ clearEvent(event);
+ break;
+
+ case evMouseDown:
+ mouse = makeLocal(event.mouse.where);
+ mouse.x += delta.x;
+ mouse.y += delta.y;
+ keyCount = 0;
+
+ do
+ {
+ ++keyCount;
+ if (keyCount > topic->getNumCrossRefs())
+ return;
+ topic->getCrossRef(keyCount-1, keyPoint, keyLength, keyRef);
+ } while (!((keyPoint.y == mouse.y+1) && (mouse.x >= keyPoint.x) &&
+ (mouse.x < keyPoint.x + keyLength)));
+ selected = keyCount;
+ drawView();
+ if (event.mouse.doubleClick)
+ switchToTopic(keyRef);
+ clearEvent(event);
+ break;
+
+ case evCommand:
+ if ((event.message.command == cmClose) && ((owner->state & sfModal) != 0))
+ {
+ endModal(cmClose);
+ clearEvent(event);
+ }
+ break;
+ }
+}
+
+// THelpWindow
+
+THelpWindow::THelpWindow( THelpFile *hFile, ushort context ):
+ TWindowInit( &THelpWindow::initFrame),
+ TWindow( TRect(0,0,50,18), helpWinTitle, wnNoNumber )
+{
+ TRect r(0, 0, 50, 18);
+ options = (options | ofCentered);
+ r.grow(-2,-1);
+ insert(new THelpViewer (r,
+ standardScrollBar(sbHorizontal | sbHandleKeyboard),
+ standardScrollBar(sbVertical | sbHandleKeyboard), hFile, context));
+}
+
+TPalette& THelpWindow::getPalette() const
+{
+ static TPalette palette( cHelpWindow, sizeof(cHelpWindow)-1 );
+ return palette;
+}
+
+const char * THelpWindow::helpWinTitle = "Help";
+const char * THelpFile::invalidContext =
+ "\n No help available in this context.";
+
diff --git a/tvision/classes/helpbase.cc b/tvision/classes/helpbase.cc
new file mode 100644
index 0000000..6f315e4
--- /dev/null
+++ b/tvision/classes/helpbase.cc
@@ -0,0 +1,651 @@
+/*
+ * helpbase.cc
+ *
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified by Salvador E. Tropea <set@ieee.org>, <set@users.sourceforge.net>
+ */
+
+// SET: moved the standard headers before tv.h. Adapted to compat layer.
+#define Uses_ctype
+#define Uses_limits
+#define Uses_string
+#define Uses_sys_stat
+#define Uses_filelength
+
+#define Uses_TStreamableClass
+#define Uses_THelpFile
+#include <tv.h>
+
+TCrossRefHandler crossRefHandler = notAssigned;
+
+// THelpTopic
+
+const char * const THelpTopic::name = "THelpTopic";
+
+void THelpTopic::write( opstream& os )
+{
+ writeParagraphs( os );
+ writeCrossRefs( os );
+
+}
+
+void *THelpTopic::read( ipstream& is )
+{
+ readParagraphs( is );
+ readCrossRefs( is );
+ width = 0;
+ lastLine = INT_MAX;
+ return this;
+}
+
+TStreamable *THelpTopic::build()
+{
+ return new THelpTopic( streamableInit );
+}
+
+
+TStreamableClass RHelpTopic( THelpTopic::name,
+ THelpTopic::build,
+ __DELTA(THelpTopic)
+ );
+
+THelpTopic::THelpTopic() : TObject()
+{
+ paragraphs = 0;
+ numRefs = 0;
+ crossRefs = 0;
+ width = 0;
+ lastOffset = 0;
+ lastLine = INT_MAX;
+ lastParagraph = 0;
+};
+
+void THelpTopic::readParagraphs( ipstream& s )
+{
+ int i;
+ ushort size;
+ TParagraph **pp;
+ int temp;
+
+ s >> i;
+ pp = &paragraphs;
+ while ( i > 0)
+ {
+ s >> size;
+ *pp = new TParagraph;
+ (*pp)->text = new char[size];
+ (*pp)->size = (ushort) size;
+ s >> temp;
+ (*pp)->wrap = Boolean(temp);
+ s.readBytes((*pp)->text, (*pp)->size);
+ pp = &((*pp)->next);
+ --i;
+ }
+ *pp = 0;
+}
+
+void THelpTopic::readCrossRefs( ipstream& s )
+{
+ int i;
+ TCrossRef *crossRefPtr;
+
+ s >> numRefs;
+ crossRefs = new TCrossRef[numRefs];
+ for (i = 0; i < numRefs; ++i)
+ {
+ crossRefPtr = (TCrossRef *)crossRefs + i;
+
+ /*
+ * SS: TCrossRef size is 9 bytes (int, int, char), but
+ * sizeof(TCrossRef) is rounded to 12.
+ */
+ s >> crossRefPtr->ref; /* int */
+ s >> crossRefPtr->offset; /* int */
+ s >> crossRefPtr->length; /* char */
+// s.readBytes(crossRefPtr, sizeof(TCrossRef));
+ }
+}
+
+void THelpTopic::disposeParagraphs()
+{
+ TParagraph *p, *t;
+
+ p = paragraphs;
+ while (p != 0)
+ {
+ t = p;
+ p = p->next;
+ delete t->text;
+ delete t;
+ }
+}
+
+
+THelpTopic::~THelpTopic()
+{
+ TCrossRef *crossRefPtr;
+
+ disposeParagraphs();
+ if (crossRefs != 0)
+ {
+ crossRefPtr = (TCrossRef *)crossRefs;
+
+ /* SS: prevent anachronistic stuff */
+
+ delete [] crossRefPtr;
+// delete [numRefs] crossRefPtr;
+ }
+}
+
+void THelpTopic::addCrossRef( TCrossRef ref )
+{
+ TCrossRef *p;
+ TCrossRef *crossRefPtr;
+
+ p = new TCrossRef[numRefs+1];
+ if (numRefs > 0)
+ {
+ crossRefPtr = crossRefs;
+ memmove(p, crossRefPtr, numRefs * sizeof(TCrossRef));
+
+ /* SS: prevent anachronistic stuff */
+
+ delete [] crossRefPtr;
+// delete [numRefs] crossRefPtr;
+ }
+ crossRefs = p;
+ crossRefPtr = crossRefs + numRefs;
+ *crossRefPtr = ref;
+ ++numRefs;
+}
+
+
+void THelpTopic::addParagraph( TParagraph *p )
+{
+ TParagraph *pp, *back;
+
+ if (paragraphs == 0)
+ paragraphs = p;
+ else
+ {
+ pp = paragraphs;
+ back = pp;
+ while (pp != 0)
+ {
+ back = pp;
+ pp = pp->next;
+ }
+ back->next = p;
+ }
+ p->next = 0;
+}
+
+void THelpTopic::getCrossRef( int i, TPoint& loc, uchar& length,
+ int& ref )
+{
+ int oldOffset, curOffset, offset, paraOffset;
+ TParagraph *p;
+ int line;
+ TCrossRef *crossRefPtr;
+
+ paraOffset = 0;
+ curOffset = 0;
+ oldOffset = 0;
+ line = 0;
+ crossRefPtr = crossRefs + i;
+ offset = crossRefPtr->offset;
+ p = paragraphs;
+ while (paraOffset + curOffset < offset)
+ {
+ char lbuf[256];
+
+ oldOffset = paraOffset + curOffset;
+ wrapText(p->text, p->size, curOffset, p->wrap, lbuf, sizeof(lbuf));
+ ++line;
+ if (curOffset >= p->size)
+ {
+ paraOffset += p->size;
+ p = p->next;
+ curOffset = 0;
+ }
+ }
+ loc.x = offset - oldOffset - 1;
+ loc.y = line;
+ length = crossRefPtr->length;
+ ref = crossRefPtr->ref;
+}
+
+char *THelpTopic::getLine( int line, char *buffer, int buflen )
+{
+ int offset, i;
+ TParagraph *p;
+
+ if (lastLine < line)
+ {
+ i = line;
+ line -= lastLine;
+ lastLine = i;
+ offset = lastOffset;
+ p = lastParagraph;
+ }
+ else
+ {
+ p = paragraphs;
+ offset = 0;
+ lastLine = line;
+ }
+ buffer[0] = 0;
+ while (p != 0)
+ {
+ while (offset < p->size)
+ {
+ char lbuf[256];
+
+ --line;
+ strncpy(buffer, wrapText(p->text, p->size, offset, p->wrap, lbuf, sizeof(lbuf)), buflen);
+ if (line == 0)
+ {
+ lastOffset = offset;
+ lastParagraph = p;
+ return buffer;
+ }
+ }
+ p = p->next;
+ offset = 0;
+ }
+ buffer[0] = 0;
+ return buffer;
+}
+
+int THelpTopic::getNumCrossRefs()
+{
+ return numRefs;
+}
+
+int THelpTopic::numLines()
+{
+ int offset, lines;
+ TParagraph *p;
+
+ offset = 0;
+ lines = 0;
+ p = paragraphs;
+ while (p != 0)
+ {
+ offset = 0;
+ while (offset < p->size)
+ {
+ char lbuf[256];
+ ++lines;
+ wrapText(p->text, p->size, offset, p->wrap, lbuf, sizeof(lbuf));
+ }
+ p = p->next;
+ }
+ return lines;
+}
+
+void THelpTopic::setCrossRef( int i, TCrossRef& ref )
+{
+ TCrossRef *crossRefPtr;
+
+ if (i < numRefs)
+ {
+ crossRefPtr = crossRefs + i;
+ *crossRefPtr = ref;
+ }
+}
+
+
+void THelpTopic::setNumCrossRefs( int i )
+{
+ TCrossRef *p, *crossRefPtr;
+
+ if (numRefs == i)
+ return;
+ p = new TCrossRef[i];
+ if (numRefs > 0)
+ {
+ crossRefPtr = crossRefs;
+ if (i > numRefs)
+ memmove(p, crossRefPtr, numRefs * sizeof(TCrossRef));
+ else
+ memmove(p, crossRefPtr, i * sizeof(TCrossRef));
+
+ /* SS: prevent anachronistic stuff */
+
+ delete [] crossRefPtr;
+// delete [numRefs] crossRefPtr;
+ }
+ crossRefs = p;
+ numRefs = i;
+}
+
+
+void THelpTopic::setWidth( int aWidth )
+{
+ width = aWidth;
+}
+
+void THelpTopic::writeParagraphs( opstream& s )
+{
+ int i;
+ TParagraph *p;
+ int temp;
+
+ p = paragraphs;
+ for (i = 0; p != 0; ++i)
+ p = p->next;
+ s << i;
+ for(p = paragraphs; p != 0; p = p->next)
+ {
+ s << p->size;
+ temp = int(p->wrap);
+ s << temp;
+ s.writeBytes(p->text, p->size);
+ }
+}
+
+
+void THelpTopic::writeCrossRefs( opstream& s )
+{
+ int i;
+ TCrossRef *crossRefPtr;
+
+ s << numRefs;
+ if (crossRefHandler == notAssigned)
+ {
+ for(i = 0; i < numRefs; ++i)
+ {
+ crossRefPtr = crossRefs + i;
+ s << crossRefPtr->ref << crossRefPtr->offset << crossRefPtr->length;
+ }
+ }
+ else
+ for (i = 0; i < numRefs; ++i)
+ {
+ crossRefPtr = crossRefs + i;
+ (*crossRefHandler)(s, crossRefPtr->ref);
+ s << crossRefPtr->offset << crossRefPtr->length;
+ }
+}
+
+Boolean isBlank( char ch )
+{
+ if (isspace((uchar)ch))
+ return True;
+ else
+ return False;
+}
+
+int scan( char *p, int offset, char c)
+{
+ char *temp1, *temp2;
+
+ temp1 = p + offset;
+ temp2 = strchr(temp1, c);
+ if (temp2 == 0)
+ return 256;
+ else
+ {
+ if ((int)(temp2 - temp1) <= 256 )
+ return (int) (temp2 - temp1) + 1;
+ else
+ return 256;
+ }
+}
+
+void textToLine( void *text, int offset, int length, char *line )
+{
+ strncpy(line, (char *)text+offset, length);
+ line[length] = 0;
+}
+
+char *THelpTopic::wrapText( char *text, int size, int& offset, Boolean wrap,
+ char *lineBuf, int lineBufLen )
+{
+ int i;
+
+ i = scan(text, offset, '\n');
+ if (i + offset > size )
+ i = size - offset;
+ if ((i >= width) && (wrap == True))
+ {
+ i = offset + width;
+ if (i > size)
+ i = size;
+ else
+ {
+ while((i > offset) && !(isBlank(text[i])))
+ --i;
+/*
+ if (i == offset)
+ i = offset + width;
+ else
+ ++i;
+*/
+ if( i == offset )
+ {
+ i = offset + width;
+ while( (i < size) && !isBlank(text[i]) )
+ ++i;
+ if( i < size )
+ ++i;
+ }
+ else
+ ++i;
+ }
+ if (i == offset)
+ i = offset + width;
+ i -= offset;
+ }
+ textToLine(text, offset, min(i,lineBufLen), lineBuf);
+ if (lineBuf[min(strlen(lineBuf) - 1, (size_t)lineBufLen)] == '\n')
+ lineBuf[min(strlen(lineBuf) - 1, (size_t)lineBufLen)] = 0;
+ offset += min(i,lineBufLen);
+ return lineBuf;
+}
+
+// THelpIndex
+
+const char * const THelpIndex::name = "THelpIndex";
+
+void THelpIndex::write( opstream& os )
+{
+ long *indexArrayPtr;
+
+ os << size;
+ for (int i = 0; i < size; ++i)
+ {
+ indexArrayPtr = index + i;
+ os << *indexArrayPtr;
+ }
+}
+
+void *THelpIndex::read( ipstream& is )
+{
+ long *indexArrayPtr;
+
+ is >> size;
+ if (size == 0)
+ index = 0;
+ else
+ {
+ index = new long[size];
+ for(int i = 0; i < size; ++i)
+ {
+ indexArrayPtr = index + i;
+ is >> *indexArrayPtr;
+ }
+ }
+ return this;
+}
+
+TStreamable *THelpIndex::build()
+{
+ return new THelpIndex( streamableInit );
+}
+
+TStreamableClass RHelpIndex( THelpIndex::name,
+ THelpIndex::build,
+ __DELTA(THelpIndex)
+ );
+
+THelpIndex::~THelpIndex()
+{
+ /* SS: prevent anachronistic stuff */
+
+ delete [] index;
+// delete [size] index;
+}
+
+
+THelpIndex::THelpIndex(void): TObject ()
+{
+ size = 0;
+ index = 0;
+}
+
+long THelpIndex::position(int i)
+{
+ long *indexArrayPtr;
+
+ if (i < size)
+ {
+ indexArrayPtr = index + i;
+ return (*indexArrayPtr);
+ }
+ else
+ return -1;
+}
+
+void THelpIndex::add( int i, long val )
+{
+ int delta = 10;
+ long *p;
+ int newSize;
+ long *indexArrayPtr;
+
+ if (i >= size)
+ {
+ newSize = (i + delta) / delta * delta;
+ p = new long[newSize];
+ if (p != 0)
+ {
+ memmove(p, index, size * sizeof(long));
+ memset(p+size, 0xFF, (newSize - size) * sizeof(long));
+ }
+ if (size > 0)
+ {
+ /* SS: prevent anachronistic stuff */
+
+ delete [] index;
+// delete [size] index;
+ }
+ index = p;
+ size = newSize;
+ }
+ indexArrayPtr = index + i;
+ *indexArrayPtr = val;
+}
+
+// THelpFile
+
+THelpFile::THelpFile( fpstream& s )
+{
+ long magic;
+ long size;
+
+ magic = 0;
+ size = s.filelength(); // SET: New syntax
+ s.seekg(0);
+ if (size > (long)sizeof(magic)) /* XXX */
+ s >> magic;
+ if (magic != magicHeader)
+ {
+ indexPos = 12;
+ s.seekg(indexPos);
+ index = new THelpIndex;
+ modified = True;
+ }
+ else
+ {
+ s.seekg(8);
+ s >> indexPos;
+ s.seekg(indexPos);
+ s >> index;
+ modified = False;
+ }
+ stream = &s;
+}
+
+THelpFile::~THelpFile(void)
+{
+ long magic, size;
+
+ if (modified == True)
+ {
+ stream->seekp(indexPos);
+ *stream << index;
+ stream->seekp(0);
+ magic = magicHeader;
+ size = stream->filelength() - 8; // SET: New syntax
+ *stream << magic;
+ *stream << size;
+ *stream << indexPos;
+ }
+ delete stream;
+ delete index;
+}
+
+THelpTopic *THelpFile::getTopic( int i )
+{
+ long pos;
+ THelpTopic *topic = 0;
+
+ pos = index->position(i);
+ if (pos > 0 )
+ {
+ stream->seekg(pos);
+ *stream >> topic;
+ return topic;
+ }
+ else return(invalidTopic());
+}
+
+THelpTopic *THelpFile::invalidTopic()
+{
+ THelpTopic *topic;
+ TParagraph *para;
+
+ topic = new THelpTopic;
+ para = new TParagraph;
+ para->text = newStr(invalidContext);
+ para->size = strlen(invalidContext);
+ para->wrap = False;
+ para->next = 0;
+ topic->addParagraph(para);
+ return topic;
+}
+
+void THelpFile::recordPositionInIndex( int i )
+{
+ index->add(i, indexPos);
+ modified = True;
+}
+
+void THelpFile::putTopic( THelpTopic *topic )
+{
+ stream->seekp(indexPos);
+ *stream << topic;
+ indexPos = stream->tellp();
+ modified = True;
+}
+
+void notAssigned( opstream& , int )
+{
+}
diff --git a/tvision/classes/ifpstrea.cc b/tvision/classes/ifpstrea.cc
new file mode 100644
index 0000000..48d8629
--- /dev/null
+++ b/tvision/classes/ifpstrea.cc
@@ -0,0 +1,55 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis.
+
+ *
+ *
+ */
+
+#define Uses_fpbase
+#define Uses_ifpstream
+#define Uses_IOS_BIN
+#include <tv.h>
+
+UsingNamespaceStd
+
+ifpstream::ifpstream()
+{
+}
+
+ifpstream::ifpstream( const char* name, CLY_OpenModeT omode, int prot ) :
+ fpbase( name, omode | CLY_IOSIn | CLY_IOSBin, prot )
+{
+}
+
+ifpstream::ifpstream( int f ) : fpbase( f )
+{
+}
+
+ifpstream::ifpstream(int f, char* b, int len) : fpbase(f, b, len)
+{
+}
+
+ifpstream::~ifpstream()
+{
+}
+
+CLY_filebuf *ifpstream::rdbuf()
+{
+ return fpbase::rdbuf();
+}
+
+void ifpstream::open( const char *name, CLY_OpenModeT omode, int prot )
+{
+ fpbase::open( name, omode | CLY_IOSIn | CLY_IOSBin, prot );
+}
+
+
diff --git a/tvision/classes/iopstrea.cc b/tvision/classes/iopstrea.cc
new file mode 100644
index 0000000..50d8932
--- /dev/null
+++ b/tvision/classes/iopstrea.cc
@@ -0,0 +1,34 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis.
+
+ *
+ *
+ */
+
+#define Uses_pstream
+#define Uses_iopstream
+#include <tv.h>
+
+UsingNamespaceStd
+
+iopstream::iopstream( CLY_streambuf * sb )
+{
+ pstream::init( sb );
+}
+
+iopstream::~iopstream()
+{
+}
+
+iopstream::iopstream()
+{
+}
+
diff --git a/tvision/classes/ipstream.cc b/tvision/classes/ipstream.cc
new file mode 100644
index 0000000..22530e6
--- /dev/null
+++ b/tvision/classes/ipstream.cc
@@ -0,0 +1,283 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Robert H”hne to be used for RHIDE.
+ *
+ * SET: Moved the standard headers here because according to DJ
+ * they can inconditionally declare symbols like NULL.
+ * Reworked code for endian stuff (readShort, readInt, readLong, read8,
+ * read16, read32 and read64)
+ *
+ * Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ * Andris Pavenis and Christoph Bauer.
+ *
+ * JASC: Endian compatible files
+ *
+ */
+#include <assert.h>
+#define Uses_string
+#define Uses_stdio // EOF
+#define Uses_TStreamable
+#define Uses_TStreamableClass
+#define Uses_TStreamableTypes
+#define Uses_pstream
+#define Uses_ipstream
+#define Uses_TPReadObjects
+#define Uses_PubStreamBuf
+#include <tv.h>
+
+ipstream::ipstream( CLY_streambuf *sb )
+{
+ objs = new TPReadObjects();
+ pstream::init( sb );
+}
+
+ipstream::~ipstream()
+{
+ objs->shouldDelete = False;
+ CLY_destroy((TObject *)objs);
+}
+
+CLY_StreamPosT ipstream::tellg()
+{
+ return bp->CLY_PubSeekOff( 0, CLY_IOSCur, CLY_IOSIn );
+}
+
+ipstream& ipstream::seekg( CLY_StreamPosT pos )
+{
+ objs->removeAll();
+ bp->CLY_PubSeekOff( pos, CLY_IOSBeg );
+ clear(); //is added by V.Bugrov for clear eof bit
+ return *this;
+}
+
+ipstream& ipstream::seekg( CLY_StreamOffT off, CLY_IOSSeekDir dir )
+{
+ objs->removeAll();
+ bp->CLY_PubSeekOff( off, dir );
+ clear(); //is added by V.Bugrov for clear eof bit
+ return *this;
+}
+
+uchar ipstream::readByte()
+{
+ // Added modified code by V. Bugrov
+ int result = bp->sbumpc();
+ if (result == EOF)
+ setstate(CLY_IOSEOFBit);
+ return (uchar)result; // This cast is safe here
+}
+
+
+/*
+ * readShort, readInt and readLong:
+ * These are platform dependent, reads the size and byte order of the native
+ * platform.
+ * Created by SET to be compatible with original code and V. Bugrov ideas.
+ */
+
+#define DefineReadDep(name,type)\
+type ipstream::read##name()\
+{\
+ type temp; size_t i;\
+ i=bp->sgetn((char *)&temp,sizeof(type));\
+ if (i<sizeof(type))\
+ setstate(CLY_IOSEOFBit);\
+ return temp;\
+}
+DefineReadDep(Short,ushort);
+DefineReadDep(Int,uint);
+DefineReadDep(Long,ulong);
+
+/*
+ * read16, read32 and read64:
+ * These are platform independent, reads a fixed size in little endian order
+ * and if the platform is big endian swaps bytes.
+ * Created by SET to be compatible with original code and JASC + V. Bugrov
+ * ideas.
+ */
+
+#ifdef TV_BIG_ENDIAN
+#define Swap(a,b) t=v[a]; v[a]=v[b]; v[b]=t
+
+static inline
+void Swap16(char *v)
+{
+ char t;
+ Swap(0,1);
+}
+
+static inline
+void Swap32(char *v)
+{
+ char t;
+ Swap(0,3);
+ Swap(1,2);
+}
+
+static inline
+void Swap64(char *v)
+{
+ char t;
+ Swap(0,7);
+ Swap(1,6);
+ Swap(2,5);
+ Swap(3,4);
+}
+#else
+static inline
+void Swap16(char *) {}
+static inline
+void Swap32(char *) {}
+static inline
+void Swap64(char *) {}
+#endif
+
+#define DefineRead(name,type)\
+type ipstream::read##name()\
+{\
+ type temp; size_t i;\
+ i=bp->sgetn((char *)&temp,sizeof(type));\
+ if (i<sizeof(type))\
+ setstate(CLY_IOSEOFBit);\
+ Swap##name((char *)&temp);\
+ return temp;\
+}
+DefineRead(16,uint16);
+DefineRead(32,uint32);
+DefineRead(64,uint64);
+
+void ipstream::readBytes( void *data, size_t sz )
+{
+ size_t i = bp->sgetn( (char *)data, sz );
+ if (i < sz)
+ {
+ setstate(CLY_IOSEOFBit);
+ // SET: Fill with 0s. Avoid using unitialized memory.
+ memset( ((char *)data) + i, 0, sz - i);
+ }
+}
+
+char *ipstream::readString()
+{
+ uchar _len = readByte();
+ if( _len == 0xFF )
+ return 0;
+ int len = _len;
+ if( len == 0xfe )
+ // SET: Read a fixed ammount of bytes in all platforms
+ len = read32();
+ char *buf = new char[len+1];
+ if( buf == 0 )
+ return 0;
+ readBytes( buf, len );
+ buf[len] = EOS;
+ return buf;
+}
+
+char *ipstream::readString( char *buf, unsigned maxLen )
+{
+ assert( buf != 0 );
+ char *tmp = readString();
+ if (tmp)
+ {
+ strncpy(buf, tmp, maxLen-1);
+ buf[maxLen-1] = 0;
+ delete [] tmp;
+ }
+ else
+ *buf = 0;
+ return buf;
+}
+
+/* Operators moved to headers by JASC */
+
+CLY_EXPORT ipstream& operator >> ( ipstream& ps, TStreamable& t )
+{
+ const TStreamableClass *pc = ps.readPrefix();
+ ps.readData( pc, &t );
+ ps.readSuffix();
+ return ps;
+}
+
+CLY_EXPORT ipstream& operator >> ( ipstream& ps, void *&t )
+{
+ char ch = ps.readByte();
+ switch( ch )
+ {
+ case pstream::ptNull:
+ t = 0;
+ break;
+ case pstream::ptIndexed:
+ {
+ P_id_type index = ps.readWord();
+ t = (void *)ps.find( index );
+ assert( t != 0 );
+ break;
+ }
+ case pstream::ptObject:
+ {
+ const TStreamableClass *pc = ps.readPrefix();
+ t = ps.readData( pc, 0 );
+ ps.readSuffix();
+ break;
+ }
+ default:
+ ps.error( pstream::peInvalidType );
+ break;
+ }
+ return ps;
+}
+
+ipstream::ipstream()
+{
+ objs = new TPReadObjects();
+}
+
+const TStreamableClass *ipstream::readPrefix()
+{
+ char ch = readByte();
+ assert( ch == '[' ); // don't combine this with the previous line!
+ // We must always do the read, even if we're
+ // not checking assertions
+
+ char name[128];
+ readString( name, sizeof name );
+ const TStreamableClass *ret = types->lookup( name );
+ assert( ret != NULL );
+ return ret;
+}
+
+void *ipstream::readData( const TStreamableClass *c, TStreamable *mem )
+{
+ if( mem == 0 )
+ mem = c->build();
+
+ registerObject( (char *)mem - c->delta ); // register the actual address
+ // of the object, not the address
+ // of the TStreamable sub-object
+ return mem->read( *this );
+}
+
+void ipstream::readSuffix()
+{
+ char ch = readByte();
+ assert( ch == ']' ); // don't combine this with the previous line!
+ // We must always do the write, even if we're
+ // not checking assertions
+
+}
+
+const void *ipstream::find( P_id_type id )
+{
+ return objs->find( id );
+}
+
+void ipstream::registerObject( const void *adr )
+{
+ objs->registerObject( adr );
+}
+
diff --git a/tvision/classes/linux/linuxdis.cc b/tvision/classes/linux/linuxdis.cc
new file mode 100644
index 0000000..daea92d
--- /dev/null
+++ b/tvision/classes/linux/linuxdis.cc
@@ -0,0 +1,382 @@
+/*****************************************************************************
+
+ Linux display routines.
+ Copyright (c) 1996-1998 by Robert Hoehne.
+ Copyright (c) 1999-2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+ Known problems:
+* Linux palette handling is quite poor, you can set the 16 colors used by your
+VT, you can set the 16 colors used in all the consoles (at the same time and
+making them the defaults) and you can get the 16 default colors. But you can't
+know the 16 colors used by the current VT. Currently I assume the console is
+using the same colors as the rest of the consoles. So I read the default
+colors and restore them.
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_signal
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_string
+#define Uses_TGKey
+#define Uses_TVCodePage
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOSf_Linux
+
+#include <termios.h>
+//#include <term.h> Not needed anymore
+#include <sys/ioctl.h>
+// GIO_CMAP ioctl
+#include <linux/kd.h>
+
+#include <tv/linux/screen.h>
+#include <tv/linux/key.h>
+#include <tv/linux/log.h>
+
+int TDisplayLinux::curX=0;
+int TDisplayLinux::curY=0;
+// Current cursor shape
+int TDisplayLinux::cursorStart=86; // 86 %
+int TDisplayLinux::cursorEnd =99; // 99 %
+// 1 when the size of the window where the program is running changed
+volatile sig_atomic_t TDisplayLinux::windowSizeChanged=0;
+int TDisplayLinux::vcsWfd=-1; // virtual console system descriptor
+int TDisplayLinux::vcsRfd=-1; // Same for reading
+int TDisplayLinux::hOut=-1; // Handle for the console output
+FILE *TDisplayLinux::fOut=NULL;
+char *TDisplayLinux::origEnvir=NULL;
+char *TDisplayLinux::newEnvir=NULL;
+int TDisplayLinux::maxLenTit=0;
+char TDisplayLinux::tioclinuxOK=0;
+char TDisplayLinux::cMap[16]={0,4,2,6,1,5,3,7,8,12,10,14,9,13,11,15};
+unsigned TDisplayLinux::oldCurX,
+ TDisplayLinux::oldCurY;
+ // These are the Linux kernel defaults: CP437 font and lat1 map
+int TDisplayLinux::installedSFM=TVCodePage::PC437;
+int TDisplayLinux::installedACM=TVCodePage::ISOLatin1Linux;
+
+// All the code is in TScreenLinux, but this is the right moment, by this
+// time TScreenLinux is suspended.
+TDisplayLinux::~TDisplayLinux()
+{
+ LOG("TDisplayLinux Destructor");
+ TScreenLinux::DeallocateResources();
+}
+
+void TDisplayLinux::Init(int mode)
+{
+ switch (mode)
+ {
+ case lnxInitVCSrw:
+ setCursorPos=SetCursorPosVCS;
+ getCursorPos=GetCursorPosVCS;
+ break;
+ case lnxInitVCSwo:
+ setCursorPos=SetCursorPosVCS;
+ getCursorPos=GetCursorPosGeneric;
+ // Set the cursor to a known position to avoid reading the postion.
+ SetCursorPos(0,0);
+ break;
+ case lnxInitSimple:
+ setCursorPos=SetCursorPos;
+ getCursorPos=GetCursorPos;
+ break;
+ case lnxInitMDA:
+ setCursorPos=SetCursorPosMDA;
+ getCursorPos=GetCursorPosGeneric;
+ break;
+ }
+ if (mode==lnxInitMDA)
+ {
+ getCursorShape=GetCursorShapeMDA;
+ setCursorShape=SetCursorShapeMDA;
+ getRows=defaultGetRows;
+ getCols=defaultGetCols;
+ getDisPaletteColors=defaultGetDisPaletteColors;
+ setDisPaletteColors=defaultSetDisPaletteColors;
+ }
+ else
+ {
+ getCursorShape=GetCursorShape;
+ setCursorShape=SetCursorShape;
+ getRows=GetRows;
+ getCols=GetCols;
+ getDisPaletteColors=tioclinuxOK ? GetDisPaletteColors : defaultGetDisPaletteColors;
+ setDisPaletteColors=SetDisPaletteColors;
+ }
+ checkForWindowSize=CheckForWindowSize;
+ getWindowTitle=GetWindowTitle;
+ setWindowTitle=SetWindowTitle;
+
+ setUpEnviron();
+}
+
+void TDisplayLinux::SetCursorPos(unsigned x, unsigned y)
+{
+ fprintf(fOut,"\E[%d;%dH",y+1,x+1);
+ curX=x; curY=y;
+}
+
+// Generic approach, just returns the last value we set
+// Used for MDA and VCS when we can't read
+void TDisplayLinux::GetCursorPosGeneric(unsigned &x, unsigned &y)
+{
+ x=curX; y=curY;
+}
+
+void TDisplayLinux::GetCursorPos(unsigned &x, unsigned &y)
+{
+ char s[40];
+
+ fputs("\E[6n",fOut);
+ *s=0;
+ fgets(s,sizeof(s)-1,TGKeyLinux::fIn); // Response is \E[y;xR
+
+ if (sscanf(s,"\E[%d;%dR",&y,&x)==2)
+ {
+ x--; y--;
+ }
+ else
+ {
+ x=curX; y=curY;
+ }
+}
+
+void TDisplayLinux::SetCursorShape(unsigned start, unsigned end)
+{
+ LOG("Setting cursor shape to " << start << "," << end);
+ if (start>=end)
+ {
+ if (!getShowCursorEver())
+ fputs("\E[?1c",fOut);
+ cursorStart=start;
+ cursorEnd=end;
+ }
+ else
+ {// Approximate with the size (1-8)
+ int size=(int)((end-start)/12.5)+1;
+ if (size>8) size=8;
+ fprintf(fOut,"\E[?%dc",size);
+ cursorStart=(int)((8-size)*12.5);
+ cursorEnd=99;
+ }
+}
+
+void TDisplayLinux::GetCursorShape(unsigned &start, unsigned &end)
+{
+ // Currently we don't know the real state.
+ start=cursorStart;
+ end =cursorEnd;
+}
+
+ushort TDisplayLinux::GetRows()
+{
+ winsize win;
+ win.ws_row=0xFFFF;
+ ioctl(hOut,TIOCGWINSZ,&win);
+ return win.ws_row!=0xFFFF ? win.ws_row : 25;
+}
+
+ushort TDisplayLinux::GetCols()
+{
+ winsize win;
+ win.ws_col=0xFFFF;
+ ioctl(hOut,TIOCGWINSZ,&win);
+ return win.ws_col!=0xFFFF ? win.ws_col : 80;
+}
+
+int TDisplayLinux::CheckForWindowSize(void)
+{
+ int ret=windowSizeChanged!=0;
+ windowSizeChanged=0;
+ return ret;
+}
+
+const char *TDisplayLinux::GetWindowTitle(void)
+{
+ if (origEnvir)
+ return newStr(origEnvir);
+ if (argv)
+ return newStr(argv[0]);
+ return 0;
+}
+
+void TDisplayLinux::setUpEnviron()
+{
+ // Note: The old glibc provided the real environment/argv vector, now that's
+ // a copy :-(
+
+ if (!argv || // The application didn't provide argv or
+ newEnvir) // we already initialized
+ return;
+
+ origEnvir=argv[0];
+ maxLenTit=strlen(argv[0]);
+}
+
+int TDisplayLinux::SetWindowTitle(const char *name)
+{
+ if (!name || !origEnvir)
+ return 0;
+ int len=strlen(name);
+ if (len>=maxLenTit)
+ {
+ strncpy(origEnvir,name,maxLenTit-1);
+ origEnvir[maxLenTit-1]=0;
+ }
+ else
+ strcpy(origEnvir,name);
+
+ return 1;
+}
+
+int TDisplayLinux::SetDisPaletteColors(int from, int number, TScreenColor *colors)
+{
+ // Assume all will be ok
+ int ret=number;
+ while (number-- && from<16)
+ {
+ fprintf(fOut,"\E]P%1.1X%2.2X%2.2X%2.2X",cMap[from++],colors->R,colors->G,colors->B);
+ colors++;
+ }
+ return ret;
+}
+
+void TDisplayLinux::GetDisPaletteColors(int from, int number, TScreenColor *colors)
+{
+ uchar vtColors[16*3];
+ // Get default VT colors map
+ int ret=ioctl(hOut,GIO_CMAP,vtColors),index;
+ if (ret==0)
+ {
+ while (number-- && from<16)
+ {
+ index=cMap[from++]*3;
+ colors->R=vtColors[index];
+ colors->G=vtColors[index+1];
+ colors->B=vtColors[index+2];
+ colors++;
+ }
+ }
+ else
+ // Shouldn't happend
+ defaultGetDisPaletteColors(from,number,colors);
+}
+
+/*****************************************************************************
+ VCS specific code
+*****************************************************************************/
+
+void TDisplayLinux::SetCursorPosVCS(unsigned x, unsigned y)
+{
+ unsigned char where[2]={x,y};
+
+ lseek(vcsWfd,2,SEEK_SET);
+ write(vcsWfd,where,sizeof(where));
+ // Cache the value to avoid the need to read it
+ curX=x; curY=y;
+}
+
+void TDisplayLinux::GetCursorPosVCS(unsigned &x, unsigned &y)
+{
+ unsigned char where[2];
+
+ lseek(vcsRfd,2,SEEK_SET);
+ read(vcsRfd,where,sizeof(where));
+ x=where[0];
+ y=where[1];
+}
+
+/*****************************************************************************
+ Code to handle a secondary monochrome display, currently not implemented
+ but can be added.
+*****************************************************************************/
+
+#ifdef h386LowLevel
+#if HAVE_OUTB_IN_SYS
+ #include <sys/io.h>
+#else
+ #include <asm/io.h>
+#endif
+
+static inline
+unsigned char I(unsigned char i)
+{
+ outb(i,0x3b4);
+ return inb(0x3b5);
+}
+
+static inline
+void O(unsigned char i,unsigned char b)
+{
+ outb(i,0x3b4);
+ outb(b,0x3b5);
+}
+
+void TDisplayLinux::SetCursorPosMDA(unsigned x, unsigned y)
+{
+ unsigned short loc = y*80+x;
+ O(0x0e,loc >> 8);
+ O(0x0f,loc & 0xff);
+}
+
+void TDisplayLinux::SetCursorShapeMDA(unsigned start, unsigned end)
+{
+ if (start>=end) // cursor off
+ {
+ O(0x0a,0x01);
+ O(0x0b,0x00);
+ }
+ else
+ {
+ start=start*16/100;
+ end=end*16/100;
+ O(0x0a,start);
+ O(0x0b,end);
+ }
+ cursorStart=start;
+ cursorEnd=end;
+}
+
+void TDisplayLinux::GetCursorShapeMDA(unsigned &start, unsigned &end)
+{
+ unsigned short ct;
+ ct=(I(0x0a)<<8) | I(0x0b);
+ if (!ct)
+ start=end=0;
+ else
+ {
+ start=86;
+ end=99;
+ }
+}
+#else
+void TDisplayLinux::SetCursorPosMDA(unsigned , unsigned ) {}
+void TDisplayLinux::SetCursorShapeMDA(unsigned start, unsigned end)
+{
+ cursorStart=start;
+ cursorEnd=end;
+}
+
+void TDisplayLinux::GetCursorShapeMDA(unsigned &start, unsigned &end)
+{
+ start=cursorStart;
+ end=cursorEnd;
+}
+#endif // h386LowLevel
+
+#else // TVOSf_Linux
+
+#include <tv/linux/screen.h>
+#include <tv/linux/key.h>
+#include <tv/linux/log.h>
+
+#endif // else TVOSf_Linux
+
diff --git a/tvision/classes/linux/linuxkey.cc b/tvision/classes/linux/linuxkey.cc
new file mode 100644
index 0000000..253f5b9
--- /dev/null
+++ b/tvision/classes/linux/linuxkey.cc
@@ -0,0 +1,937 @@
+/*****************************************************************************
+
+ Linux keyboard routines.
+ Copyright (c) 1998-2002 by Salvador E. Tropea (SET)
+ Some portions come from code:
+ Copyright (c) 1998 by Robert Hoehne.
+ Covered by the GPL license.
+
+ This driver is a relatively complex one because:
+ 1) Deals with console mode.
+ 2) Translates keyboard codes.
+ 3) Parses escape sequences.
+ 4) Patches keyboard tables and restores it on console switchs.
+
+ Todo:
+ * How do I setup things before they are hooked? SetKbdMapping needs to
+ be reworked.
+ * Should I move VT detection to a separated module?
+ * Asegurarse que atexit se llame el que restaura el teclado.
+ * El módulo de TScreenLinux tendría que llamar a InitOnce(), si esto le da
+ error no seguir. Y si el tien problemas debería llamar al Suspend() para
+ que restaure.
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_string
+#define Uses_unistd
+#define Uses_signal
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_FullSingleKeySymbols
+#define Uses_TScreen
+#define Uses_TVCodePage
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOSf_Linux
+
+#include <termios.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+// For the VT and key patch stuff
+#include <sys/kd.h>
+#include <sys/vt.h>
+
+#include <tv/linux/key.h>
+#include <tv/linux/screen.h>
+#include <tv/linux/log.h>
+
+int TGKeyLinux::hIn=-1;
+FILE *TGKeyLinux::fIn=NULL;
+int TGKeyLinux::oldInFlags;
+int TGKeyLinux::newInFlags;
+struct termios TGKeyLinux::inTermiosOrig;
+struct termios TGKeyLinux::inTermiosNew;
+const char *TGKeyLinux::error=NULL;
+int TGKeyLinux::bufferKeys[MaxLenEscapeSequence];
+int TGKeyLinux::keysInBuffer=0;
+int TGKeyLinux::nextKey=-1;
+int TGKeyLinux::lastKeyCode;
+int TGKeyLinux::lastModifiers;
+int TGKeyLinux::translatedModifiers;
+char TGKeyLinux::dontPatchKeyboard=0;
+int TGKeyLinux::ourVT=-1;
+struct vt_mode TGKeyLinux::oldVTMode;
+struct vt_mode TGKeyLinux::newVTMode;
+char TGKeyLinux::vtHooked=0;
+char TGKeyLinux::canPatchKeyboard=0;
+char TGKeyLinux::keyPatched=0;
+char TGKeyLinux::ascii;
+struct kbentry TGKeyLinux::entry;
+
+/* Linux IOCTL values found experimentally */
+const int kblNormal=0,kblShift=1,kblAltR=2,kblCtrl=4,kblAltL=8;
+
+/**[txh]********************************************************************
+
+ Description:
+ Does initialization tasks performed only once.
+
+ Return:
+ 0 if success, !=0 if an error ocurred. In the last case the error member
+points to a descriptive error.
+
+***************************************************************************/
+
+int TGKeyLinux::InitOnce()
+{
+ LOG("TGKeyLinux::InitOnce");
+ hIn=fileno(stdin);
+
+ if (!isatty(hIn))
+ {
+ error=_("that's an interactive application, don't redirect stdin");
+ return 1;
+ }
+ // We can't use stdin for all the operations, instead we must open it again
+ // using another file descriptor.
+ // Here is why: In order to get some keys, I saw it for ESC pressed alone,
+ // we must set the O_NONBLOCK attribute.
+ // We can do it, but the stdout file handle seems to be just a copy of the
+ // stdin file handle (dupped?). When you use duplicated file handles they
+ // share the "File Status Flags". It means that setting O_NONBLOCK will
+ // set O_NONBLOCK for output too. So what? well when we do that the one that
+ // doesn't block is Linux kernel, so if we send too much information to
+ // stdout, no matters if we use fflush, sometimes Linux could lose data.
+ // This effect seems to happend at exit, may be because owr process dies
+ // before Linux have a chance to process the remaining data and it closes
+ // the file handle. The fact is that using O_NONBLOCK sometimes we fail to
+ // restore the cursor position.
+ // Now a question remains: do I have to restore the mode?
+ char *ttyName=ttyname(hIn);
+ if (!ttyName)
+ {
+ error=_("failed to get the name of the current terminal used for input");
+ return 3;
+ }
+ fIn=fopen(ttyName,"r+b");
+ if (!fIn)
+ {
+ error=_("failed to open the input terminal");
+ return 4;
+ }
+ hIn=fileno(fIn);
+
+ if (tcgetattr(hIn,&inTermiosOrig))
+ {
+ error=_("can't get input terminal attributes");
+ return 2;
+ }
+
+ memcpy(&inTermiosNew,&inTermiosOrig,sizeof(inTermiosNew));
+ // Ignore breaks
+ inTermiosNew.c_iflag|= (IGNBRK | BRKINT);
+ // Disable Xon/off
+ inTermiosNew.c_iflag&= ~(IXOFF | IXON);
+ // Character oriented, no echo, no signals
+ inTermiosNew.c_lflag&= ~(ICANON | ECHO | ISIG);
+ if (tcsetattr(hIn,TCSAFLUSH,&inTermiosNew))
+ {
+ error=_("can't set input terminal attributes");
+ return 3;
+ }
+ // Don't block, needed to get some keys, even when the input is in character
+ // oriented mode. I saw it for ESC alone.
+ oldInFlags=fcntl(hIn,F_GETFL,0);
+ newInFlags=oldInFlags | O_NONBLOCK;
+ fcntl(hIn,F_SETFL,newInFlags);
+
+ // Find if we are running in a VT and if that's the case the number
+ // This name should be the same but ...
+ ttyName=ttyname(STDOUT_FILENO);
+ if (ttyName)
+ {
+ if (sscanf(ttyName,"/dev/tty%2d",&ourVT)!=1)
+ // SET: Some Slackware systems (I think that is what Andris uses)
+ // define /dev/ttyNN as symlinks to /dev/vc/NN:
+ if (sscanf(ttyName,"/dev/vc/%2d",&ourVT)!=1)
+ ourVT=-1;
+ }
+ // Get the mode of the current VT
+ if (ourVT!=-1)
+ {
+ if (ioctl(hIn,VT_GETMODE,&oldVTMode))
+ // If we fail disable it
+ ourVT=-1;
+ else
+ {// Tell the kernel to inform us about console changes
+ newVTMode=oldVTMode;
+ newVTMode.mode =VT_PROCESS;
+ newVTMode.relsig=SIGUSR1;
+ newVTMode.acqsig=SIGUSR2;
+ }
+ }
+ // Check if we can patch the keyboard
+ canPatchKeyboard=0;
+ long optPatchKeys=1; // Default is patch the keyboard
+ TScreen::optSearch("PatchKeys",optPatchKeys);
+ if (optPatchKeys && ourVT!=-1 && ioctl(hIn,KDGKBENT,&entry)==0)
+ {
+ canPatchKeyboard=1;
+ keyMapInit();
+ }
+ // Now do the hook/patching
+ doHookAndPatch();
+ // We don't need to call Resume
+ suspended=0;
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Restore the original console state.
+
+***************************************************************************/
+
+void TGKeyLinux::Suspend()
+{
+ doUnHookAndUnPatch();
+ // Now we use a new opened file handle for input.
+ // As these flags are the flags for the file handle (not the terminal itself)
+ // we don't need to restore the originals.
+ // Why don't do it anyways? because the TScreen::resume is called before and
+ // it needs to get the cursor position using escape sequences without waiting
+ // for an EOL.
+ //fcntl(hIn,F_SETFL,oldInFlags);
+ tcsetattr(hIn,TCSAFLUSH,&inTermiosOrig);
+ LOG("TGKeyLinux::Suspend");
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Memorize current console state and setup the one needed for us.
+
+***************************************************************************/
+
+void TGKeyLinux::Resume()
+{// Read current state
+ tcgetattr(hIn,&inTermiosOrig);
+ oldInFlags=fcntl(hIn,F_GETFL,0);
+ // Set our state
+ tcsetattr(hIn,TCSAFLUSH,&inTermiosNew);
+ // The following shouldn't be needed, I'll let it here unless I discover
+ // some side effect.
+ fcntl(hIn,F_SETFL,newInFlags);
+ // The user could do some action to alter the keyboard mapping tables
+ if (canPatchKeyboard)
+ keyMapInit();
+ // Patch keyboard and hook the signals
+ doHookAndPatch();
+ LOG("TGKeyLinux::Resume");
+}
+
+int TGKeyLinux::KbHit()
+{
+ if (keysInBuffer || nextKey!=-1)
+ return 1; // We have a key waiting for processing
+ nextKey=fgetc(fIn);
+ return nextKey!=-1;
+}
+
+void TGKeyLinux::Clear()
+{
+ // Discard our buffer
+ keysInBuffer=0;
+ // Discard a key waiting
+ nextKey=-1;
+ // Flush the input
+ fflush(fIn);
+}
+
+/*****************************************************************************
+
+ Here starts the keyboard parser and translator.
+ It uses a static tree/hash to parse the escape sequences, may be this should
+be configurable.
+
+*****************************************************************************/
+
+// - 9 = Tab tiene conflicto con kbI+Control lo cual es natural, por otro
+// -lado Ctrl+Tab no lo reporta en forma natural
+// - a = Enter tiene conflicto con ^J, como ^J no lo reporta naturalmente sino
+// -forzado por el keymap lo mejor es definirlo directamente.
+unsigned char TGKeyLinux::kbToName[128] =
+{
+ 0,kbA,kbB,kbC,kbD,kbE,kbF,kbG, // 00-07
+ kbH,kbTab,kbEnter,kbK,kbL,kbM,kbN,kbO, // 08-0F
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW, // 10-17
+ kbX,kbY,kbZ,kbEsc,0,kbCloseBrace,kb6,kbMinus, // 18-1F
+ kbSpace,kbAdmid,kbDobleQuote,kbNumeral,kbDolar,kbPercent,kbAmper,kbQuote,// 20-27
+ kbOpenPar,kbClosePar,kbAsterisk,kbPlus,kbComma,kbMinus,kbStop,kbSlash, // 28-2F
+ kb0,kb1,kb2,kb3,kb4,kb5,kb6,kb7, // 30-37
+ kb8,kb9,kbDoubleDot,kbColon,kbLessThan,kbEqual,kbGreaterThan,kbQuestion, // 38-3F
+ kbA_Roba,kbA,kbB,kbC,kbD,kbE,kbF,kbG, // 40-47
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO, // 48-4F
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW, // 50-57
+ kbX,kbY,kbZ,kbOpenBrace,kbBackSlash,kbCloseBrace,kbCaret,kbUnderLine, // 58-5F
+ kbGrave,kbA,kbB,kbC,kbD,kbE,kbF,kbG, // 60-67
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO, // 68-6F
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW, // 70-77
+ kbX,kbY,kbZ,kbOpenCurly,kbOr,kbCloseCurly,kbTilde,kbBackSpace // 78-7F
+};
+
+unsigned char TGKeyLinux::kbExtraFlags[128] =
+{
+ 0,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl, // 00-07
+ kblCtrl,0,0,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl, // 08-0F
+ kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl, // 10-17
+ kblCtrl,kblCtrl,kblCtrl,0,0,kblCtrl,kblCtrl,kblCtrl, // 18-1F
+ 0,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,0, // 20-27
+ kblShift,kblShift,kblShift,kblShift,0,0,0,0, // 28-2F
+ 0,0,0,0,0,0,0,0, // 30-37
+ 0,0,kblShift,0,kblShift,0,kblShift,kblShift, // 38-3F
+ kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift, // 40-47
+ kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift, // 48-4F
+ kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift, // 50-57
+ kblShift,kblShift,kblShift,0,0,0,kblShift,kblShift, // 58-5F
+ 0,0,0,0,0,0,0,0, // 60-67
+ 0,0,0,0,0,0,0,0, // 68-6F
+ 0,0,0,0,0,0,0,0, // 70-77
+ 0,0,0,kblShift,kblShift,kblShift,kblShift,0, // 78-7F
+};
+
+/************************** Escape sequences tree **************************/
+struct node
+{
+ char value;
+ unsigned char code;
+ unsigned char modifiers;
+ node *next;
+};
+
+static node F6[]={{1,0,0},{'~',kbF6,0,0}};
+static node F7[]={{1,0,0},{'~',kbF7,0,0}};
+static node F8[]={{1,0,0},{'~',kbF8,0,0}};
+static node F9[]={{1,0,0},{'~',kbF9,0,0}};
+static node F10[]={{1,0,0},{'~',kbF10,0,0}};
+static node F11[]={{1,0,0},{'~',kbF11,0,0}};
+static node F12[]={{1,0,0},{'~',kbF12,0,0}};
+static node Delete[]={{1,0,0},{'~',kbDelete,0,0}};
+static node End[]={{1,0,0},{'~',kbEnd,0,0}};
+static node PgUp[]={{1,0,0},{'~',kbPgUp,0,0}};
+static node PgDn[]={{1,0,0},{'~',kbPgDn,0,0}};
+
+static node Brace1[]=
+{
+ {4,0,0},
+ {'~',kbHome,0,0},
+ {'7',0,0,F6},
+ {'8',0,0,F7},
+ {'9',0,0,F8}
+};
+
+static node Brace2[]=
+{
+ {5,0,0},
+ {'~',kbInsert,0,0},
+ {'0',0,0,F9},
+ {'1',0,0,F10},
+ {'3',0,0,F11},
+ {'4',0,0,F12}
+};
+
+static node BraceKeys[]=
+{
+ {5,0,0},
+ {'A',kbF1,0,0},
+ {'B',kbF2,0,0},
+ {'C',kbF3,0,0},
+ {'D',kbF4,0,0},
+ {'E',kbF5,0,0},
+};
+
+static node Sequences[]=
+{
+ {13,0,0},
+ {'[',0,0,BraceKeys},
+ {'A',kbUp,0,0},
+ {'B',kbDown,0,0},
+ {'C',kbRight,0,0},
+ {'D',kbLeft,0,0},
+ {'G',kb5,0,0},
+ {'P',kbPause,0,0},
+ {'1',0,0,Brace1},
+ {'2',0,0,Brace2},
+ {'3',0,0,Delete},
+ {'4',0,0,End},
+ {'5',0,0,PgUp},
+ {'6',0,0,PgDn}
+};
+
+static node Keys[]=
+{
+ {1,0,0},
+ {'[',0,0,Sequences}
+};
+/*********************** End of escape sequences tree ***********************/
+
+/**[txh]********************************************************************
+
+ Description:
+ Parse a escape sequence.
+
+ Returns: 1 if the sequence found, 0 if not and the keys are stored in the
+buffer.
+
+***************************************************************************/
+
+int TGKeyLinux::ProcessEscape()
+{
+ int nextVal;
+
+ nextVal=fgetc(fIn);
+ if (nextVal==EOF) // Just ESC
+ return 0;
+
+ node *p=Keys;
+ int cant,i;
+ keysInBuffer=0;
+ while (nextVal!=EOF)
+ {
+ NextNode:
+ bufferKeys[keysInBuffer++]=nextVal;
+ cant=p->value;
+ for (i=1; i<=cant; i++)
+ {
+ if (p[i].value==nextVal)
+ {
+ if (p[i].next)
+ {
+ p=p[i].next;
+ nextVal=fgetc(fIn);
+ goto NextNode;
+ }
+ lastKeyCode=p[i].code;
+ lastModifiers=p[i].modifiers;
+ keysInBuffer=0;
+ return 1;
+ }
+ }
+ return 0;
+ }
+ return 0;
+}
+
+int TGKeyLinux::GetKeyFromBuffer()
+{
+ int ret=bufferKeys[--keysInBuffer];
+ if (keysInBuffer)
+ memcpy(bufferKeys,bufferKeys+1,keysInBuffer);
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets a key from the buffer, waiting value or stdin and if needed calls
+the escape sequence parser.
+
+***************************************************************************/
+
+int TGKeyLinux::GetKeyParsed()
+{
+ lastModifiers=0;
+ translatedModifiers=-1;
+ // If we have keys in the buffer take from there.
+ // They already failed the escape sequence test.
+ if (keysInBuffer)
+ return GetKeyFromBuffer();
+
+ // Use the value we have on hold or get a new one
+ int nextVal=nextKey;
+ nextKey=-1;
+ if (nextVal==-1)
+ nextVal=fgetc(fIn);
+ if (nextVal==-1)
+ return -1;
+
+ // Is that an escape sequence?
+ if (nextVal=='\e')
+ {
+ if (ProcessEscape())
+ return -2;
+ if (!keysInBuffer)
+ return '\e';
+ lastKeyCode=GetKeyFromBuffer();
+ lastModifiers=kblAltL;
+ return -3;
+ }
+
+ return nextVal;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets the next key, their modifiers and ASCII. Is a postprocessor for
+GetKeyParsed.
+
+***************************************************************************/
+
+int TGKeyLinux::GetRaw()
+{
+ int result=GetKeyParsed();
+
+ if (result==-1)
+ return 0; // No key
+ if (result==-2)
+ {
+ lastModifiers|=GetLinuxShiftState();
+ ascii=0;
+ return 1; // Key already processed
+ }
+ if (result==-3) // Forced modifier
+ {
+ result=lastKeyCode;
+ ascii=result>127 ? result : 0;
+ }
+ else
+ ascii=result;
+
+ // Translate the key
+ if (result>=128)
+ lastKeyCode=kbUnkNown;
+ else
+ {
+ lastModifiers|=kbExtraFlags[result];
+ lastKeyCode=kbToName[result];
+ }
+ lastModifiers|=GetLinuxShiftState();
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets a key from the input and converts it into the TV format.
+
+***************************************************************************/
+
+ushort TGKeyLinux::GKey()
+{
+ if (GetRaw())
+ { // Here I add the modifiers to the key code
+ if (lastModifiers & kblShift)
+ lastKeyCode|=kbShiftCode;
+ if (lastModifiers & kblCtrl)
+ lastKeyCode|=kbCtrlCode;
+ switch (AltSet)
+ {
+ case 0: // Normal thing, left is left, right is right
+ if (lastModifiers & kblAltL)
+ lastKeyCode|=kbAltLCode;
+ else
+ if (lastModifiers & kblAltR)
+ lastKeyCode|=kbAltRCode;
+ break;
+ case 1: // Reverse thing
+ if (lastModifiers & kblAltL)
+ lastKeyCode|=kbAltRCode;
+ else
+ if (lastModifiers & kblAltR)
+ lastKeyCode|=kbAltLCode;
+ break;
+ default: // Compatibility
+ if (lastModifiers & (kblAltL | kblAltR))
+ lastKeyCode|=kbAltLCode;
+ }
+ return lastKeyCode;
+ }
+ return kbUnkNown;
+}
+/*****************************************************************************
+ End of parser and translator.
+*****************************************************************************/
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the value of the modifiers, if the ioctl fails the values we know
+from the last key are used.
+
+ Return: The modifiers in Linux kernel format.
+
+***************************************************************************/
+
+unsigned TGKeyLinux::GetLinuxShiftState()
+{
+ int arg=6; /* TIOCLINUX function #6 */
+ unsigned shift=0;
+
+ if (ioctl(hIn,TIOCLINUX,&arg)!=-1)
+ shift=arg;
+ else
+ shift=lastModifiers;
+ return shift;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the value of the modifiers in TV format.
+
+***************************************************************************/
+
+unsigned TGKeyLinux::GetShiftState()
+{
+ lastModifiers=GetLinuxShiftState();
+ if (!lastModifiers) return 0;
+ if (translatedModifiers==-1)
+ {
+ translatedModifiers=0;
+ if (lastModifiers & kblShift)
+ translatedModifiers|=kbLeftShiftDown | kbRightShiftDown;
+ if (lastModifiers & kblCtrl)
+ translatedModifiers|=kbLeftCtrlDown | kbRightCtrlDown | kbCtrlDown;
+ if (lastModifiers & kblAltR)
+ translatedModifiers|=kbRightAltDown | kbAltDown;
+ if (lastModifiers & kblAltL)
+ translatedModifiers|=kbLeftAltDown | kbAltDown;
+ }
+ return translatedModifiers;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Fills the TV event structure for a key.
+
+***************************************************************************/
+
+void TGKeyLinux::FillTEvent(TEvent &e)
+{
+ GKey();
+ e.keyDown.charScan.charCode=lastModifiers & kblAltL ? 0 : ascii;
+ e.keyDown.charScan.scanCode=ascii;
+ e.keyDown.raw_scanCode=ascii;
+ e.keyDown.keyCode=lastKeyCode;
+ e.keyDown.shiftState=lastModifiers;
+ e.what=evKeyDown;
+}
+
+
+/*****************************************************************************
+
+ Here starts the code to modify Linux kernel tables in order to get better
+keyboard information.
+ Basically it makes Linux kernel map the key+modifiers to the key alone.
+That's because these keys acts in special ways when a modifier is applied and
+the application can't receive the key.
+ An example: Shift+PgUp is usually mapped to "scroll up one screen", so we
+map it to just PgUp. In this way we get the key, then we get the modifiers
+from the ioctl.
+ That's the code based in Robert's code it was readapted but the idea is
+the same.
+ The code is complicated because we must restore the map when the user
+changes to another console. So most of the code deals with the signals
+related to virtual console switching.
+
+*****************************************************************************/
+
+typedef struct
+{
+ uchar change_table;
+ uchar change_index;
+ uchar old_table;
+ uchar old_index;
+ ushort old_val;
+ ushort new_val;
+} change_entry;
+
+#define SCAN_F1 0x3b
+#define SCAN_F2 0x3c
+#define SCAN_F3 0x3d
+#define SCAN_F4 0x3e
+#define SCAN_F5 0x3f
+#define SCAN_F6 0x40
+#define SCAN_F7 0x41
+#define SCAN_F8 0x42
+#define SCAN_F9 0x43
+#define SCAN_F10 0x44
+#define SCAN_Q 0x10
+#define SCAN_S 0x1f
+#define SCAN_J 0x24
+#define SCAN_M 0x32
+#define SCAN_Z 0x2C
+#define SCAN_PGUP 104
+#define SCAN_PGDN 109
+#define SCAN_BKSP 14
+#define SCAN_SPAC 57
+#define SCAN_TAB 15
+// As ^[ is usually Esc we must be sure it doesn't happend
+#define SCAN_LFBR 26
+// The Scroll lock key is evil for an interactive application
+// As in my keyboard that's above Home and some people wrongly
+// press it instead of Home I'm translating to Home.
+#define SCAN_SCRL 70
+#define SCAN_HOME 102
+
+static
+change_entry changes[]=
+{
+ { kblAltL, SCAN_F1, kblNormal, SCAN_F1, 0, 0},
+ { kblAltR, SCAN_F1, kblNormal, SCAN_F1, 0, 0},
+ { kblCtrl, SCAN_F1, kblNormal, SCAN_F1, 0, 0},
+ { kblShift, SCAN_F1, kblNormal, SCAN_F1, 0, 0},
+ { kblAltL, SCAN_F2, kblNormal, SCAN_F2, 0, 0},
+ { kblAltR, SCAN_F2, kblNormal, SCAN_F2, 0, 0},
+ { kblCtrl, SCAN_F2, kblNormal, SCAN_F2, 0, 0},
+ { kblShift, SCAN_F2, kblNormal, SCAN_F2, 0, 0},
+ { kblAltL, SCAN_F3, kblNormal, SCAN_F3, 0, 0},
+ { kblAltR, SCAN_F3, kblNormal, SCAN_F3, 0, 0},
+ { kblCtrl, SCAN_F3, kblNormal, SCAN_F3, 0, 0},
+ { kblShift, SCAN_F3, kblNormal, SCAN_F3, 0, 0},
+ { kblAltL, SCAN_F4, kblNormal, SCAN_F4, 0, 0},
+ { kblAltR, SCAN_F4, kblNormal, SCAN_F4, 0, 0},
+ { kblCtrl, SCAN_F4, kblNormal, SCAN_F4, 0, 0},
+ { kblShift, SCAN_F4, kblNormal, SCAN_F4, 0, 0},
+ { kblAltL, SCAN_F5, kblNormal, SCAN_F5, 0, 0},
+ { kblAltR, SCAN_F5, kblNormal, SCAN_F5, 0, 0},
+ { kblCtrl, SCAN_F5, kblNormal, SCAN_F5, 0, 0},
+ { kblShift, SCAN_F5, kblNormal, SCAN_F5, 0, 0},
+ { kblAltL, SCAN_F6, kblNormal, SCAN_F6, 0, 0},
+ { kblAltR, SCAN_F6, kblNormal, SCAN_F6, 0, 0},
+ { kblCtrl, SCAN_F6, kblNormal, SCAN_F6, 0, 0},
+ { kblShift, SCAN_F6, kblNormal, SCAN_F6, 0, 0},
+ { kblAltL, SCAN_F7, kblNormal, SCAN_F7, 0, 0},
+ { kblAltR, SCAN_F7, kblNormal, SCAN_F7, 0, 0},
+ { kblCtrl, SCAN_F7, kblNormal, SCAN_F7, 0, 0},
+ { kblShift, SCAN_F7, kblNormal, SCAN_F7, 0, 0},
+ { kblAltL, SCAN_F8, kblNormal, SCAN_F8, 0, 0},
+ { kblAltR, SCAN_F8, kblNormal, SCAN_F8, 0, 0},
+ { kblCtrl, SCAN_F8, kblNormal, SCAN_F8, 0, 0},
+ { kblShift, SCAN_F8, kblNormal, SCAN_F8, 0, 0},
+ { kblAltL, SCAN_F9, kblNormal, SCAN_F9, 0, 0},
+ { kblAltR, SCAN_F9, kblNormal, SCAN_F9, 0, 0},
+ { kblCtrl, SCAN_F9, kblNormal, SCAN_F9, 0, 0},
+ { kblShift, SCAN_F9, kblNormal, SCAN_F9, 0, 0},
+ { kblAltL, SCAN_F10, kblNormal, SCAN_F10, 0, 0},
+ { kblAltR, SCAN_F10, kblNormal, SCAN_F10, 0, 0},
+ { kblCtrl, SCAN_F10, kblNormal, SCAN_F10, 0, 0},
+ { kblShift, SCAN_F10, kblNormal, SCAN_F10, 0, 0},
+ { kblCtrl, SCAN_Q, kblNormal, SCAN_Q, 0, 0},
+ { kblCtrl, SCAN_S, kblNormal, SCAN_S, 0, 0},
+ { kblCtrl, SCAN_J, kblNormal, SCAN_J, 0, 0},
+ { kblCtrl, SCAN_M, kblNormal, SCAN_M, 0, 0},
+ { kblCtrl, SCAN_Z, kblNormal, SCAN_Z, 0, 0},
+ { kblShift, SCAN_PGUP, kblNormal, SCAN_PGUP, 0, 0},
+ { kblShift, SCAN_PGDN, kblNormal, SCAN_PGDN, 0, 0},
+ { kblCtrl, SCAN_BKSP, kblNormal, SCAN_BKSP, 0, 0},
+ { kblCtrl, SCAN_SPAC, kblNormal, SCAN_SPAC, 0, 0},
+ { kblCtrl, SCAN_LFBR, kblNormal, SCAN_LFBR, 0, 0},
+ { kblNormal,SCAN_SCRL, kblNormal, SCAN_HOME, 0, 0},
+ { kblAltL, SCAN_SCRL, kblNormal, SCAN_HOME, 0, 0},
+ { kblAltR, SCAN_SCRL, kblNormal, SCAN_HOME, 0, 0},
+ { kblCtrl, SCAN_TAB, kblNormal, SCAN_TAB, 0, 0},
+ { kblCtrl | kblShift, SCAN_TAB, kblNormal, SCAN_TAB, 0, 0}
+};
+
+#define changeSize (sizeof(changes)/sizeof(change_entry))
+
+void TGKeyLinux::unPatchKeyMap()
+{
+ if (!canPatchKeyboard || !keyPatched)
+ return;
+
+ unsigned i;
+ for (i=0;i<changeSize;i++)
+ {
+ change_entry *e=&changes[i];
+ entry.kb_table=e->change_table;
+ entry.kb_index=e->change_index;
+ entry.kb_value=e->old_val;
+ ioctl(hIn,KDSKBENT,&entry);
+ }
+ keyPatched=0;
+}
+
+void TGKeyLinux::patchKeyMap()
+{
+ if (!canPatchKeyboard || keyPatched)
+ return;
+
+ unsigned i;
+ for (i=0;i<changeSize;i++)
+ {
+ change_entry *e=&changes[i];
+ entry.kb_table=e->change_table;
+ entry.kb_index=e->change_index;
+ entry.kb_value=e->new_val;
+ ioctl(hIn,KDSKBENT,&entry);
+ }
+ keyPatched=1;
+}
+
+// Get the information needed to patch/unpatch
+void TGKeyLinux::keyMapInit()
+{
+ unsigned i;
+ for (i=0; i<changeSize; i++)
+ {
+ change_entry *e=&changes[i];
+ entry.kb_table=e->change_table;
+ entry.kb_index=e->change_index;
+ ioctl(hIn,KDGKBENT,&entry);
+ e->old_val=entry.kb_value;
+ entry.kb_table=e->old_table;
+ entry.kb_index=e->old_index;
+ ioctl(hIn,KDGKBENT,&entry);
+ e->new_val=entry.kb_value;
+ }
+}
+
+void TGKeyLinux::hookVTSignals()
+{
+ if (vtHooked || dontPatchKeyboard || ourVT==-1)
+ return;
+
+ // -------- Set up signal handlers to know about console switches
+ struct sigaction sig;
+ sigemptyset(&sig.sa_mask);
+ sigaddset(&sig.sa_mask,SIGUSR1);
+ sigaddset(&sig.sa_mask,SIGUSR2);
+ sig.sa_flags=SA_RESTART;
+ sigprocmask(SIG_BLOCK,&sig.sa_mask,NULL); // No switches now, we are not
+ // initialized yet
+ sig.sa_handler=releaseVTHandler;
+ sigaction(SIGUSR1,&sig,NULL);
+ sig.sa_handler=acquireVTHandler;
+ sigaction(SIGUSR2,&sig,NULL);
+ vtHooked=1;
+
+ // -------- Tell our console to inform us about switches
+ if (ioctl(hIn,VT_SETMODE,&newVTMode))
+ {
+ error=_("ioctl VT_SETMODE failed");
+ return;
+ }
+
+ sigprocmask(SIG_UNBLOCK,&sig.sa_mask,NULL);
+}
+
+void TGKeyLinux::unHookVTSignals()
+{
+ if (!vtHooked || ourVT==-1)
+ return;
+
+ // Make both signals to behave as default
+ struct sigaction sig;
+ sigemptyset(&sig.sa_mask);
+ sigaddset(&sig.sa_mask,SIGUSR1);
+ sigaddset(&sig.sa_mask,SIGUSR2);
+ sig.sa_flags=SA_RESTART;
+ sigprocmask(SIG_BLOCK,&sig.sa_mask,NULL); // No switches now, we are not
+ // initialized yet
+ sig.sa_handler=SIG_DFL;
+ sigaction(SIGUSR1,&sig,NULL);
+ sig.sa_handler=SIG_DFL;
+ sigaction(SIGUSR2,&sig,NULL);
+
+ ioctl(hIn,VT_SETMODE,&oldVTMode);
+
+ sigprocmask(SIG_UNBLOCK,&sig.sa_mask,NULL);
+ vtHooked=0;
+}
+
+void TGKeyLinux::releaseVTHandler(int)
+{
+ unPatchKeyMap();
+ TMouse::suspend();
+ TScreenLinux::SuspendFont();
+ ioctl(hIn,VT_RELDISP,1);
+}
+
+void TGKeyLinux::acquireVTHandler(int)
+{
+ ioctl(hIn,VT_RELDISP,VT_ACKACQ);
+ ioctl(hIn,VT_WAITACTIVE,ourVT);
+ patchKeyMap();
+ TMouse::resume();
+ TScreenLinux::ResumeFont();
+}
+
+void TGKeyLinux::doHookAndPatch()
+{
+ if (!dontPatchKeyboard && canPatchKeyboard)
+ {
+ patchKeyMap();
+ hookVTSignals();
+ }
+}
+
+void TGKeyLinux::doUnHookAndUnPatch()
+{
+ unPatchKeyMap();
+ unHookVTSignals();
+}
+/*****************************************************************************
+ End of keyboard patching and VT change hooking
+*****************************************************************************/
+
+void TGKeyLinux::SetKbdMapping(int version)
+{
+ if (version==linuxDisableKeyPatch)
+ {
+ dontPatchKeyboard=1;
+ doUnHookAndUnPatch();
+ }
+ else if (version==linuxEnableKeyPatch)
+ {
+ dontPatchKeyboard=0;
+ doHookAndPatch();
+ }
+ Mode=version;
+}
+
+int TGKeyLinux::GetKbdMapping(int version)
+{
+ if (version==linuxDisableKeyPatch)
+ {
+ return dontPatchKeyboard;
+ }
+ else if (version==linuxEnableKeyPatch)
+ {
+ return !dontPatchKeyboard;
+ }
+ return 0;
+}
+
+void TGKeyLinux::Init(int map)
+{
+ TGKey::Suspend =TGKeyLinux::Suspend;
+ TGKey::Resume =TGKeyLinux::Resume;
+ TGKey::kbhit =KbHit;
+ TGKey::clear =Clear;
+ TGKey::gkey =GKey;
+ TGKey::getShiftState =GetShiftState;
+ TGKey::fillTEvent =FillTEvent;
+ TGKey::SetKbdMapping =TGKeyLinux::SetKbdMapping;
+ TGKey::GetKbdMapping =TGKeyLinux::GetKbdMapping;
+ if (map==KOI8)
+ {
+ TGKey::SetCodePage(TVCodePage::KOI8r);
+ LOG("Using KOI8 keyboard table");
+ }
+}
+#else // TVOSf_Linux
+
+#include <tv/linux/key.h>
+#include <tv/linux/log.h>
+
+#endif // else TVOSf_Linux
diff --git a/tvision/classes/linux/linuxmouse.cc b/tvision/classes/linux/linuxmouse.cc
new file mode 100644
index 0000000..8871cf1
--- /dev/null
+++ b/tvision/classes/linux/linuxmouse.cc
@@ -0,0 +1,142 @@
+/*****************************************************************************
+
+ Linux mouse routines.
+ Copyright (c) 1996-1998 by Robert Hoehne.
+ Copyright (c) 1999-2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_stdlib
+#define Uses_string
+#define Uses_stdio
+#define Uses_time
+#define Uses_signal
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOSf_Linux) && defined(HAVE_GPM)
+
+//---------------- GPM version -----------------
+
+#include <termios.h>
+#include <tv/linux/screen.h>
+#include <tv/linux/mouse.h>
+#include <tv/linux/log.h>
+
+extern "C" {
+#include <gpm.h>
+// Kernel 2.6.11 (from Gentoo) seems to need it:
+// Not yet confirmed but doesn't interfere with 2.6.0 headers.
+#include <linux/keyboard.h>
+}
+
+static
+int SetUpGPMConnection()
+{
+ Gpm_Connect conn;
+
+ conn.eventMask = ~0; /* I want all events */
+ conn.defaultMask = 0; /* no default treatment */
+ /* It doesn't report events from GPM when ALT or ALTGR are pressed.
+ I saw it in mc and my friends from BALUG, Ivan and Laszlo bugged me
+ about adding it. Was hyper-easy, no? (SET) */
+ conn.maxMod = ~((1<<KG_ALT) | (1<<KG_ALTGR));
+ conn.minMod = 0;
+ gpm_zerobased = 1; /* coordinates start from zero */
+
+ return Gpm_Open(&conn, 0);
+}
+
+void THWMouseGPM::Resume()
+{
+ if (gpm_fd!=-1)
+ {
+ buttonCount=3;
+ return;
+ }
+ if (SetUpGPMConnection()<0)
+ LOG("no gpm, running without mouse");
+ else
+ {
+ LOG("gpm server version " << Gpm_GetServerVersion(NULL));
+ buttonCount=3;
+ }
+ show();
+}
+
+void THWMouseGPM::Suspend()
+{
+ if (gpm_fd==-1)
+ return;
+ Gpm_Close();
+ gpm_fd=-1;
+ LOG("gpm connection closed");
+}
+
+inline
+int range(int test, int min, int max)
+{
+ return test < min ? min : test > max ? max : test;
+}
+
+void THWMouseGPM::GetEvent(MouseEventType &me)
+{
+ Gpm_Event mev;
+
+ me.buttons=TEventQueue::curMouse.buttons & ~(mbButton4 | mbButton5);
+ me.doubleClick=False;
+ if (!Gpm_Repeat(1) && (Gpm_GetEvent(&mev)==1))
+ {
+ int b=mev.buttons;
+ if ((b & GPM_B_LEFT) && !(mev.type & GPM_UP))
+ me.buttons|= mbLeftButton;
+ else
+ me.buttons&= ~mbLeftButton;
+ if ((b & GPM_B_RIGHT) && !(mev.type & GPM_UP))
+ me.buttons|= mbRightButton;
+ else
+ me.buttons&= ~mbRightButton;
+ if (mev.wdy<0)
+ me.buttons=mbButton5;
+ else
+ if (mev.wdy>0)
+ me.buttons=mbButton4;
+ me.where.x=range(mev.x,0,TScreen::screenWidth-1);
+ me.where.y=range(mev.y,0,TScreen::screenHeight-1);
+ DrawMouse(me.where.x,me.where.y);
+ }
+ else
+ {
+ me.where.x=TEventQueue::curMouse.where.x;
+ me.where.y=TEventQueue::curMouse.where.y;
+ }
+}
+
+void THWMouseGPM::Init()
+{
+ THWMouseUNIX::Init();
+ THWMouse::Resume=Resume;
+ THWMouse::Suspend=Suspend;
+ THWMouse::GetEvent=GetEvent;
+}
+
+THWMouseGPM::~THWMouseGPM()
+{
+}
+
+#else // defined(TVOSf_Linux) && defined(HAVE_GPM)
+
+#if defined(TVOSf_Linux)
+ #include <termios.h>
+#endif
+
+#include <tv/linux/screen.h>
+#include <tv/linux/mouse.h>
+#include <tv/linux/log.h>
+
+#endif // else defined(TVOSf_Linux) && defined(HAVE_GPM)
diff --git a/tvision/classes/linux/linuxscr.cc b/tvision/classes/linux/linuxscr.cc
new file mode 100644
index 0000000..2f2a69e
--- /dev/null
+++ b/tvision/classes/linux/linuxscr.cc
@@ -0,0 +1,1958 @@
+/*****************************************************************************
+
+ Linux screen routines.
+ Copyright (c) 1996-1998 by Robert Hoehne.
+ Copyright (c) 1999-2004 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+ Important note:
+ This driver uses the G0 charset slot selecting the user defined map ACM.
+ If you load a font and their SFM map then you must load the propper ACM if
+the font doesn't map 1 to 1 with the code page. If you don't understand it
+please read the Console Tools documentation (html docs). Where each concept
+is explained.
+ UseVCS=1
+ UseMDA=1
+ PatchKeys=1
+ UseSecondaryFont=0
+ AppCP
+ ScrCP
+ InpCP
+ LoadSecondFont
+ ScreenPalette
+ BrokenCursorShape
+
+*****************************************************************************/
+/*
+ToDo: Find a way to enable SEPARATED_HANDLE without losing performance. How?
+ I know is possible, but not how, currently I must force the stream to
+ be unbuffered and the speed is 5 times inferior. Perhaps using an internal
+ buffer.
+
+ToDo: What if the user really have 512 characters? in this case the console have
+ only 8 colors.
+
+ToDo: What if the fonts geometry changes on the fly? Or in a console switch?
+
+ToDo: Add support for the ISO codepages as used by Linux, not just the standard
++ my frames.
+
+TODO:
+TurboVision_screenOptions
+See ToDo in the mouse initialization.
+
+When using no lat1 chars we had it:
+ else if (strchr(terminal, '-')!=NULL && // Have a modifier
+ !(strstr(terminal,"-c-")!=NULL || !strcmp(terminal+strlen(terminal)-2,"-c"))) // It isn't color modifier
+ { // Not some color variation, so most probably a different charset
+ use_pc_chars = 0;
+ TerminalType=GENER_TERMINAL;
+ }
+This is not supported any more
+
+Important limitations:
+
+When using the escape sequences output (no VCS):
+* We must set the charset to G1 and select G1 as transparent. We don't know
+the original state so we just select G0 and use Graph map for G0. These are
+the deafults after a console reset, but doesn't have to be the right
+settings.
+ A similar thing happends with the option to display control characters.
+* I don't know how to restore the console content. MC uses a separated
+helper called cons.saver to do the trick.
+ In this new version of the driver I implemented something that saves
+most of the information in the screen. I used an interesting thing in
+Linux kernel, that's service 2 of TIOCLINUX, it can be used to select the
+whole screen and then you can do a paste (like with the mouse), but this is
+available only for real consoles and I don't know why when I restore such
+a screen the mouse gets temporally invisible.
+
+When using VCS:
+* The code to bypass mc and get the real console works, but the cons.saver
+task of mc sometimes writes over the application.
+
+When GPM isn't available:
+* The Linux kernel says:
+ * Code for xterm like mouse click reporting by Peter Orbaek 20-Jul-94
+ * <poe@daimi.aau.dk>
+But this doesn't work at all, if you enable mouse reporting (\E[?9h or
+\E[?1000h) you get nothing. You'll get something when somebody calls
+set_selection code using mode 16. This is far from usable.
+
+When trying to use a secondary font:
+* The Linux kernel switchs to 8 colors mode. See comments in InitOnce().
+For this reason we don't enable it by default.
+
+When using unknown code pages:
+* Looks like is common practice to load kernel maps that aren't really
+encoded in Unicode, they are easier to create but they destroy any hope
+to figure out what are representing. KOI8-R is an example, the SFM and
+ACMs are in fact representing KOI8-R values and not Unicode. I got
+information about systems mixing both: KOI8-R values + euro and others in
+Unicode. I use a workaround for it, but this means most Linux systems
+are just broken.
+*/
+#include <tv/configtv.h>
+
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TGKey
+#define Uses_TVCodePage
+#define Uses_string
+#define Uses_ctype
+#define Uses_signal
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOSf_Linux
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <termios.h>
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+#include <linux/kd.h>
+
+#include <tv/linux/screen.h>
+#include <tv/linux/key.h>
+#include <tv/linux/mouse.h>
+#include <tv/linux/log.h>
+
+#ifdef h386LowLevel
+ #if HAVE_OUTB_IN_SYS
+ #include <sys/io.h>
+ #else
+ #include <asm/io.h>
+ #endif
+#endif
+
+// What a hell is that?!
+#define force_redraw 0
+
+#define ENTER_UTF8 "\e%G"
+#define EXIT_UTF8 "\e%@"
+
+struct termios TScreenLinux::outTermiosOrig;
+struct termios TScreenLinux::outTermiosNew;
+const char *TScreenLinux::error=NULL;
+char TScreenLinux::secondaryAvailable=0;
+int TScreenLinux::mdaMemH=-1;
+ushort *TScreenLinux::mdaMem=NULL;
+int TScreenLinux::palette;
+ushort *TScreenLinux::userBuffer=NULL;
+unsigned TScreenLinux::userBufferSize;
+int TScreenLinux::oldCol=-1,
+ TScreenLinux::oldBack=-1,
+ TScreenLinux::oldFore=-1;
+CodePage TScreenLinux::unknownACM,
+ TScreenLinux::unknownSFM;
+uchar TScreenLinux::canSetFonts=0,
+ TScreenLinux::primaryFontSet=0,
+ TScreenLinux::secondaryFontSet=0;
+struct console_font_op
+ TScreenLinux::linuxFont,
+ TScreenLinux::ourFont;
+int TScreenLinux::origCPScr,
+ TScreenLinux::origCPApp,
+ TScreenLinux::origCPInp,
+ TScreenLinux::origUTF8Mode,
+ TScreenLinux::font512Detected=0,
+ TScreenLinux::reduceTo8Colors=0;
+
+// Information about known font maps
+struct stCodePageCk
+{
+ int codepage;
+ uint32 checksum;
+};
+
+// ISO 8859-2 fonts seems to have a lot of bugs:
+// * The iso02.f16.psf file is useless, it have a map but doesn't have
+// frames and wastes at least 17 glyphs.
+// * The lat2-16.psf file is ok, but lack an unicode map.
+// * The lat2u-16.psf file is usable, but doesn't help to display directly.
+// It also have a bug, code 0x91 is N with accute but the unicode is missing
+// in the map.
+
+// These are the SFM (Screen Font Map) maps
+// This map explain which unicodes can be rendered by each character in the
+// font.
+struct stCodePageCk TScreenLinux::knownFonts[]=
+{
+ { TVCodePage::ISOLatin1Linux, 0x6E30159A },
+ { TVCodePage::ISOLatin1uLinux, 0x2038159A },
+ { TVCodePage::KOI8r, 0x207E10FA },
+ { TVCodePage::ISOLatin2uLinux, 0xE50A3143 },
+ { TVCodePage::ISOLatin2Sun, 0x92522C97 },
+ { 0, 0 }
+};
+
+// These are the ACM (Application Charset Map) maps
+// This map is used to determine what an 8 bits codes from the application
+// means. Think about it: how the kernel knows if a file is encoded in
+// latin 1, 2, koi8, etc? Simple: doesn't know, you must set this table.
+// Important: ACM maps are usually strict, it means they define things as
+// the standards says. This is quite annoying because you loose direct
+// access to extra stuff defined in the controls range. Quite bad for VCS
+// access so here I map the checksum to the equivalent Linux font.
+struct stCodePageCk TScreenLinux::knownScreenMaps[]=
+{
+ { -1, 0xD53CF052 }, // Trivial map, what this mean?
+ //{ TVCodePage::ISOLatin1Linux, 0xD53CF052 }, // Trivial map, what this mean?
+ // It means the codes should pass unchanged, no remap on the fly.
+ // Hence 0xA0 is translated into unicode U+F0A0 which is then passed to the
+ // screen using the 0xA0 `glyph' of the font.
+ { TVCodePage::ISOLatin1Linux, 0xD62C0061 },
+ { TVCodePage::ISOLatin2Linux, 0x5594183F },
+ { TVCodePage::KOI8r, 0x4F463C4D },
+ { TVCodePage::ISOLatin2eLinux, 0x72341867 }, // Euro hacked
+ { 0, 0 }
+};
+
+// Information about known languages
+struct stCodePageLang
+{
+ const char *langs;
+ int codepage;
+};
+
+struct stCodePageLang TScreenLinux::langCodePages[]=
+{
+ { "ca,da,nl,et,fr,de,fi,is,it,no,pt,es,sv", TVCodePage::ISOLatin1Linux },
+ { "hr,cs,hu,pl,ro,sk,sl", TVCodePage::ISOLatin2Linux },
+ // ru_RU.KOI8-R is common, but not reliable according to Alexey Godin
+ { "ru", TVCodePage::KOI8r },
+ { NULL, 0 }
+ //{ "el", TVCodePage::ISOGreek },
+ ///{ "tr", TVCodePage::ISO9 },
+ //hebrew iw_IL.ISO-8859-8
+ //lithuanian lt_LT.ISO-8859-13
+};
+
+// Structure for TIOCLINUX service 2 set selection, very kernel
+// dependent.
+typedef struct
+{
+ char service;// __attribute__((packed));
+ ushort xs __attribute__((packed));
+ ushort ys __attribute__((packed));
+ ushort xe __attribute__((packed));
+ ushort ye __attribute__((packed));
+ ushort sel_mode __attribute__((packed));
+} setSel;
+
+static uint32 adler32(uint32 adler, const char *buf, unsigned len);
+
+TScreen *TV_LinuxDriverCheck()
+{
+ TScreenLinux *drv=new TScreenLinux();
+ if (!TScreen::initialized)
+ {
+ delete drv;
+ return 0;
+ }
+ return drv;
+}
+
+void TScreenLinux::sigWindowSizeChanged(int sig)
+{
+ // Set a flag because we don't know if we can do it right now
+ TScreenLinux::windowSizeChanged=1;
+ signal(sig,sigWindowSizeChanged);
+}
+
+void TScreenLinux::Init(int mode)
+{
+ TScreen::Resume=Resume;
+ TScreen::Suspend=Suspend;
+ TScreen::setCrtData=defaultSetCrtData;
+ TScreen::setVideoMode=SetVideoMode;
+ TScreen::setVideoModeExt=SetVideoModeExt;
+ TScreen::getCharacter=GetCharacter;
+ TScreen::setCharacter=SetCharacter;
+ TScreen::System_p=System;
+ TDisplay::checkForWindowSize=CheckForWindowSize;
+ TScreen::getFontGeometry=GetFontGeometry;
+ TScreen::setFont_p=SetFont;
+ TScreen::restoreFonts=RestoreFonts;
+
+ switch (mode)
+ {
+ case lnxInitVCSrw:
+ TScreen::setCharacters=SetCharactersVCS;
+ TScreen::getCharacters=GetCharactersVCS;
+ LOG("Using VCS r/w code");
+ break;
+ case lnxInitVCSwo:
+ TScreen::setCharacters=SetCharactersVCS;
+ TScreen::getCharacters=defaultGetCharacters;
+ LOG("Using VCS write only code");
+ break;
+ case lnxInitSimple:
+ TScreen::setCharacters=SetCharactersTerm;
+ TScreen::getCharacters=defaultGetCharacters;
+ LOG("Using escape sequences");
+ break;
+ case lnxInitMDA:
+ TScreen::setCharacters=SetCharactersMDA;
+ TScreen::getCharacters=GetCharactersMDA;
+ LOG("Using MDA code");
+ break;
+ }
+}
+
+
+const int firstTrySize=512;
+
+//#define DEBUG_CODEPAGE
+#ifdef DEBUG_CODEPAGE
+// This is the code to debug the code page detection
+// The information generated by it is very useful and hence I keep the code
+// here.
+static int compareUni(const void *v1, const void *v2)
+{
+ struct unipair *p1=(struct unipair *)v1;
+ struct unipair *p2=(struct unipair *)v2;
+ if (p1->fontpos==p2->fontpos)
+ return (p1->unicode>p2->unicode)-(p1->unicode<p2->unicode);
+ return (p1->fontpos>p2->fontpos)-(p1->fontpos<p2->fontpos);
+}
+
+int TScreenLinux::AnalyzeCodePage()
+{
+ ushort scrUniMap[E_TABSZ];
+ int i,j;
+
+ // GIO_UNIMAP: get unicode-to-font mapping from kernel
+ int success;
+ struct unimapdesc map;
+ map.entry_ct=firstTrySize;
+ map.entries=new struct unipair[firstTrySize];
+ success= ioctl(hOut,GIO_UNIMAP,&map)!=-1;
+ if (!success && map.entry_ct>firstTrySize)
+ {
+ LOG("The starting size of " << firstTrySize << " wasn't enough, we need " << map.entry_ct);
+ delete[] map.entries;
+ map.entries=new struct unipair[map.entry_ct];
+ success= ioctl(hOut,GIO_UNIMAP,&map)!=-1;
+ }
+ if (success)
+ {
+ fprintf(stderr,"The map have %d entries\n",map.entry_ct);
+ fprintf(stderr,"Raw information:\n");
+ for (i=0; i<map.entry_ct; i++)
+ fprintf(stderr,"0x%02X => 0x%04X\n",map.entries[i].fontpos,map.entries[i].unicode);
+ fprintf(stderr,"\n\nSorted information:\n");
+ // Sort the entries
+ qsort(map.entries,map.entry_ct,sizeof(struct unipair),compareUni);
+ // Print all marking the entries that provides more than a code
+ for (i=0,j=0; i<map.entry_ct; i++)
+ {
+ if (j!=map.entries[i].fontpos)
+ {
+ while (j<map.entries[i].fontpos)
+ fprintf(stderr,"0x%02X => NO UNICODE\n",j++);
+ }
+ fprintf(stderr,"0x%02X => 0x%04X",map.entries[i].fontpos,map.entries[i].unicode);
+ if (i && map.entries[i-1].fontpos==map.entries[i].fontpos)
+ fputs(" *",stderr);
+ else
+ j++;
+ fputc('\n',stderr);
+ }
+ // Create a special list containing only one unicode by symbol
+ ushort UnicodeMap[256];
+ memset(UnicodeMap,0xFF,256*sizeof(ushort));
+ for (i=0; i<map.entry_ct; i++)
+ {
+ int pos=map.entries[i].fontpos;
+ if (i && map.entries[i-1].fontpos==pos) continue;
+ if (pos>255)
+ {
+ font512Detected++;
+ continue;
+ }
+ UnicodeMap[pos]=map.entries[i].unicode;
+ }
+ // Print this map
+ fputs("-------------\nSimplified map for checksum:\n",stderr);
+ for (i=0; i<256; i++)
+ if (UnicodeMap[i]==0xFFFF)
+ fprintf(stderr,"0x%02X NO UNICODE\n",i);
+ else
+ fprintf(stderr,"0x%02X U+%04x\n",i,UnicodeMap[i]);
+ // Compute a good check sum
+ uint32 cks=adler32(0,(char *)UnicodeMap,256*sizeof(ushort));
+ fprintf(stderr,"Adler-32 checksum: 0x%08X\n",cks);
+ // Map it to internal codes
+ fputs("-------------\nInternal codes equivalent:\n",stderr);
+ for (i=0; i<256; i++)
+ {
+ int v=UnicodeMap[i];
+ if (v==0xFFFF)
+ fputs(" 0,",stderr);
+ else
+ fprintf(stderr,"%3d,",TVCodePage::InternalCodeForUnicode(v));
+ if (!((i+1) & 0xF))
+ fputc('\n',stderr);
+ }
+ fputs("-------------\nWhat's missing:\n",stderr);
+ for (i=0; i<256; i++)
+ {
+ int v=UnicodeMap[i];
+ if (v==0xFFFF)
+ continue;
+ if (TVCodePage::InternalCodeForUnicode(v)==-1)
+ fprintf(stderr,"%03d U+%04x\n",i,v);
+ }
+ fputs("-------------\n",stderr);
+ char SFMCreated=0;
+ for (i=0; knownFonts[i].codepage && knownFonts[i].checksum!=cks; i++);
+ if (knownFonts[i].codepage)
+ {
+ installedSFM=knownFonts[i].codepage;
+ fprintf(stderr,"Known code page detected %d\n",installedSFM);
+ }
+ else
+ {
+ fputs("Unknown code page, creating a custom one\n",stderr);
+ CreateSFMFromTable(UnicodeMap);
+ SFMCreated=1;
+ }
+ }
+ else
+ {
+ LOG("GIO_UNIMAP failed");
+ // Something arbitrary
+ installedSFM=TVCodePage::ISOLatin1Linux;
+ }
+
+ fputs("-------------\nGIO_UNISCRNMAP\n",stderr);
+ if (ioctl(hOut,GIO_UNISCRNMAP,scrUniMap)==-1)
+ {
+ LOG("GIO_UNISCRNMAP failed");
+ delete[] map.entries;
+ return 0;
+ }
+ int isTrivial=1;
+ for (i=0; i<E_TABSZ; i++)
+ {
+ fprintf(stderr,"%3d => U+%04x ",i,scrUniMap[i]);
+ if (i+0xF000!=scrUniMap[i] && i!=scrUniMap[i])
+ {
+ isTrivial=0;
+ fputc('*',stderr);
+ }
+ fputc('\n',stderr);
+ }
+ fprintf(stderr,"This map %s trivial\n",isTrivial ? "IS" : "**ISN'T**");
+ fputs("-------------\nInternal codes equivalent:\n",stderr);
+ for (i=0; i<256; i++)
+ {
+ int v=scrUniMap[i];
+ if (v==0xFFFF)
+ fputs(" 0,",stderr);
+ else
+ fprintf(stderr,"%3d,",TVCodePage::InternalCodeForUnicode(v));
+ if (!((i+1) & 0xF))
+ fputc('\n',stderr);
+ }
+ // Compute a good check sum
+ uint32 cksS=adler32(0,(char *)scrUniMap,E_TABSZ*sizeof(ushort));
+ fprintf(stderr,"Adler-32 checksum for screen map: 0x%08X\n",cksS);
+ for (i=0; knownScreenMaps[i].codepage && knownScreenMaps[i].checksum!=cksS; i++);
+ if (knownScreenMaps[i].codepage)
+ {
+ installedACM=knownScreenMaps[i].codepage;
+ if (installedACM==-1)
+ {
+ fprintf(stderr,"Using the same used for SFM\n");
+ installedACM=installedSFM;
+ }
+ else
+ fprintf(stderr,"Known code page detected %d\n",installedACM);
+ }
+ else
+ {
+ fputs("Unknown code page, creating a new one\n",stderr);
+ // This a workaround for broken KOI8-R systems.
+ if (installedSFM==TVCodePage::KOI8r && scrUniMap[0xC0]==0xC0)
+ {// That's bogus, try to fix it
+ ushort *map=TVCodePage::GetTranslate(TVCodePage::KOI8r);
+ fputs("-------------\nACM is bogus, workaround:\n",stderr);
+ for (i=0; i<256; i++)
+ if (scrUniMap[i]<0x100)
+ {
+ scrUniMap[i]=TVCodePage::UnicodeForInternalCode(map[i]);
+ fprintf(stderr,"%3d => U+%04x\n",i,scrUniMap[i]);
+ }
+ else
+ fprintf(stderr,"%3d => U+%04x *\n",i,scrUniMap[i]);
+ }
+ CreateACMFromTable(scrUniMap);
+ }
+
+ delete[] map.entries;
+ return 1;
+}
+#else
+int TScreenLinux::AnalyzeCodePage()
+{
+ // Get the font unicode map (SFM)
+ // GIO_UNIMAP: get unicode-to-font mapping from kernel
+ int success;
+ struct unimapdesc map;
+ map.entry_ct=firstTrySize;
+ map.entries=new struct unipair[firstTrySize];
+ success= ioctl(hOut,GIO_UNIMAP,&map)!=-1;
+ if (!success && map.entry_ct>firstTrySize)
+ {
+ LOG("The starting size of " << firstTrySize << " wasn't enough, we need " << map.entry_ct);
+ delete[] map.entries;
+ map.entries=new struct unipair[map.entry_ct];
+ success= ioctl(hOut,GIO_UNIMAP,&map)!=-1;
+ }
+ if (!success)
+ {
+ delete[] map.entries;
+ return 0;
+ }
+ // Make a simplified version
+ int i;
+ ushort UnicodeMap[256];
+ memset(UnicodeMap,0xFF,256*sizeof(ushort));
+ for (i=0; i<map.entry_ct; i++)
+ {
+ int pos=map.entries[i].fontpos;
+ if (pos>255)
+ {
+ font512Detected++;
+ continue;
+ }
+ if (map.entries[i].unicode<UnicodeMap[pos])
+ UnicodeMap[pos]=map.entries[i].unicode;
+ }
+ // Compute a good check sum of it
+ uint32 cks=adler32(0,(char *)UnicodeMap,256*sizeof(ushort));
+ char SFMCreated=0;
+ // Find if we know about this one
+ for (i=0; knownFonts[i].codepage && knownFonts[i].checksum!=cks; i++);
+ if (knownFonts[i].codepage)
+ {
+ installedSFM=knownFonts[i].codepage;
+ LOG("Known SFM detected: " << installedSFM);
+ }
+ else
+ {
+ LOG("Unknown SFM: " << cks);
+ // We don't know about it, but we have enough information to try using it
+ CreateSFMFromTable(UnicodeMap);
+ SFMCreated=1;
+ }
+ // Now look for the ACM
+ // GIO_UNISCRNMAP: get full Unicode screen mapping
+ ushort scrUniMap[E_TABSZ];
+ if (ioctl(hOut,GIO_UNISCRNMAP,scrUniMap)!=-1)
+ {
+ // Compute a good check sum
+ cks=adler32(0,(char *)scrUniMap,E_TABSZ*sizeof(ushort));
+ // Find if we know about this one
+ for (i=0; knownScreenMaps[i].codepage && knownScreenMaps[i].checksum!=cks; i++);
+ if (knownScreenMaps[i].codepage)
+ {
+ installedACM=knownScreenMaps[i].codepage;
+ if (installedACM==-1)
+ installedACM=installedSFM;
+ LOG("Known ACM detected: " << installedACM);
+ }
+ else
+ {
+ LOG("Unknown ACM: " << cks);
+ // This a workaround for broken KOI8-R systems.
+ if (installedSFM==TVCodePage::KOI8r && scrUniMap[0xC0]==0xC0)
+ {// That's bogus, try to fix it
+ ushort *map=TVCodePage::GetTranslate(TVCodePage::KOI8r);
+ for (i=0; i<256; i++)
+ if (scrUniMap[i]<0x100)
+ scrUniMap[i]=TVCodePage::UnicodeForInternalCode(map[i]);
+ }
+ CreateACMFromTable(scrUniMap);
+ }
+ }
+ delete[] map.entries;
+ return 1;
+}
+#endif
+
+void TScreenLinux::CreateSFMFromTable(ushort *table)
+{
+ TVCodePage::CreateCPFromUnicode(&unknownSFM,TVCodePage::LinuxSFM,
+ "Linux SFM",table);
+ TVCodePage::AddCodePage(&unknownSFM);
+ installedSFM=TVCodePage::LinuxSFM;
+}
+
+void TScreenLinux::CreateACMFromTable(ushort *table)
+{
+ TVCodePage::CreateCPFromUnicode(&unknownACM,TVCodePage::LinuxACM,
+ "Linux ACM",table);
+ TVCodePage::AddCodePage(&unknownACM);
+ installedACM=TVCodePage::LinuxACM;
+}
+
+int TScreenLinux::GuessCodePageFromLANG()
+{
+ char *lang=getenv("LANG");
+ if (!lang || strlen(lang)<2)
+ return 0;
+ int i,ret=0;
+ char b[3];
+ b[0]=tolower(lang[0]);
+ b[1]=tolower(lang[1]);
+ b[2]=0;
+
+ for (i=0; langCodePages[i].langs && !strstr(langCodePages[i].langs,b); i++);
+ if (langCodePages[i].langs)
+ {
+ installedSFM=langCodePages[i].codepage;
+ LOG("Code page for a known language guess: " << installedSFM);
+ ret=1;
+ }
+ else
+ {
+ LOG("Unknown language: " << b << " " << lang);
+ }
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Determines if the console is in UTF-8 or single char mode.
+
+ Return: 1 UTF-8, 0 single char, -1 error.
+
+***************************************************************************/
+
+int TScreenLinux::isInUTF8()
+{
+ unsigned y, x;
+
+ // The following test is from an idea in console-tools by
+ // Ricardas Cepas <rch@pub.osf.lt>. GPL.
+ setCursorPos(0,0);
+ // "\357\200\240" = U+F020 = `space' in Linux's straight-to-font zone
+ fputs("\357\200\240",fOut);
+ // Make sure it is printed
+ fflush(fOut);
+ getCursorPos(x,y);
+ // Get a single byte in UTF-8 and 3 bytes othewise
+ switch (x)
+ {
+ case 1: // UTF-8
+ x=1;
+ LOG("UTF-8 mode detected");
+ break;
+ case 3: // single-byte mode
+ x=0;
+ LOG("Single char mode detected");
+ break;
+ default: // error
+ LOG("Error, can't determine UTF-8 state, column: " << x);
+ return -1;
+ }
+
+ return x;
+}
+
+void TScreenLinux::AvoidUTF8Mode()
+{
+ // Determine UTF-8 mode
+ origUTF8Mode=isInUTF8();
+ if (origUTF8Mode==-1)
+ LOG("Error determining UTF-8 mode");
+ // If necesary exit from it
+ if (origUTF8Mode==1)
+ fputs(EXIT_UTF8,fOut);
+}
+
+int TScreenLinux::InitOnce()
+{
+ LOG("TScreenLinux::InitOnce");
+ hOut=fileno(stdout);
+ // SET: Original code tried to open a tty at any cost, eg: if stdout was
+ // redirected it tried to open stdin's tty for writing. I don't see the
+ // point of such an effort and in fact crashes the library, so here I just
+ // explain to the user how to run the application in the right way.
+ if (!isatty(hOut))
+ {
+ error=_("that's an interactive application, don't redirect stdout. "
+ "If you want to collect information redirect stderr like this: "
+ "program 2> file");
+ return 1;
+ }
+ #ifdef SEPARATED_HANDLE
+ /* Testing a reopen */
+ char *ttyName=ttyname(hOut);
+ if (!ttyName)
+ {
+ error=_("failed to get the name of the current terminal used for output");
+ return 3;
+ }
+ fOut=fopen(ttyName,"w+b");
+ if (!fOut)
+ {
+ error=_("failed to open the output terminal");
+ return 4;
+ }
+ int fgs=fcntl(hOut,F_GETFL,0);
+ fcntl(fileno(fOut),F_SETFL,fgs);
+
+ if (tcgetattr(hOut,&outTermiosOrig))
+ {
+ error=_("can't get output terminal information");
+ return 2;
+ }
+ hOut=fileno(fOut);
+ setvbuf(fOut,NULL,_IONBF,0);
+ #else
+ fOut=stdout;
+
+ if (tcgetattr(hOut,&outTermiosOrig))
+ {
+ error=_("can't get output terminal information");
+ return 2;
+ }
+ #endif
+
+ // Save cursor position, attributes and charset
+ fputs("\E7",fOut);
+ memcpy(&outTermiosNew,&outTermiosOrig,sizeof(outTermiosNew));
+ outTermiosNew.c_oflag|=OPOST;
+ if (tcsetattr(hOut,TCSAFLUSH,&outTermiosNew))
+ {
+ error=_("can't configure terminal mode");
+ return 3;
+ }
+
+ // Test the TIOCLINUX
+ int arg=6;
+ tioclinuxOK=(ioctl(hOut,TIOCLINUX,&arg)!=-1);
+ if (tioclinuxOK)
+ LOG("Linux Console IOCTL working");
+
+ if (tioclinuxOK)
+ {// We know the default colors, we can just hope they are the currently used
+ GetDisPaletteColors(0,16,OriginalPalette);
+ memcpy(ActualPalette,OriginalPalette,sizeof(ActualPalette));
+ }
+ else
+ {// We don't know what palette is used so we can just setup our own palette
+ // Get the PC BIOS palette
+ defaultGetDisPaletteColors(0,16,ActualPalette);
+ // Now set it
+ SetDisPaletteColors(0,16,ActualPalette);
+ }
+
+ // Look for user settings
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+ // Try to figure out which code page is loaded
+ // Note: This is always needed for the defaults
+ if (!tioclinuxOK || !AnalyzeCodePage())
+ {
+ GuessCodePageFromLANG();
+ }
+
+ #ifdef DEBUG_CODEPAGE
+ fprintf(stderr,"Using: AppCP: 0x%08lX ScrCP: 0x%08lX InpCP: 0x%08lX\n",
+ forcedAppCP!=-1 ? forcedAppCP : installedACM,
+ forcedScrCP!=-1 ? forcedScrCP : installedSFM,
+ forcedInpCP!=-1 ? forcedInpCP : installedACM);
+ fprintf(stderr,"Default: AppCP: 0x%08X ScrCP: 0x%08X InpCP: 0x%08X\n",
+ installedACM,installedSFM,installedACM);
+ #endif
+
+ // User settings have more priority than detected settings
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : installedACM,
+ forcedScrCP!=-1 ? forcedScrCP : installedSFM,
+ forcedInpCP!=-1 ? forcedInpCP : installedACM);
+ SetDefaultCodePages(installedACM,installedSFM,installedACM);
+ if (tioclinuxOK && GetLinuxFontGeometry())
+ {
+ canSetFonts=1;
+ linuxFont.data=ourFont.data=NULL;
+ linuxFont.flags=ourFont.flags=0;
+ }
+
+ // Setup the driver properties.
+ // Our code page isn't fixed.
+ // We can change the palette (but can't restore it perfectly)
+ // We can also change the cursor shape.
+ // Even when Linux have a blanker we run in full screen so screen savers
+ // could be used with some sense.
+ // We support fonts, but we can change their geometry at will.
+ flags0=CanSetPalette | CodePageVar | UseScreenSaver;
+ // Some fbcon drivers fail to implement the cursor shape stuff.
+ // Using this variable we can inform it to the application.
+ long brokenCursorShapes=0;
+ optSearch("BrokenCursorShape",brokenCursorShapes);
+ if (!brokenCursorShapes)
+ flags0|=CursorShapes;
+ if (canSetFonts)
+ {
+ flags0|=CanSetBFont;
+ // When we use the secondary font Linux reduces the colors number to 8.
+ // This is good if the 512 chars are defining a big charset, but really
+ // bad if they are defining 2 different charsets. As we use it to define
+ // 2 charsets the impact is negative. So we enable it only if the user
+ // specifically asks for it.
+ long useSecondaryFont=0;
+ TScreen::optSearch("UseSecondaryFont",useSecondaryFont);
+ if (useSecondaryFont)
+ flags0|=CanSetSBFont;
+ }
+ if (font512Detected && !useSecondaryFont)
+ {
+ reduceTo8Colors=1;
+ LOG("Applying color reduction to 8 colors");
+ }
+
+ return 0;
+}
+
+
+void TScreenLinux::DetectVCS()
+{
+ /*
+ * This approach was suggested by:
+ * Martynas Kunigelis <algikun@santaka.sc-uni.ktu.lt>
+ * Date: Mon, 20 Jan 1997 15:55:14 +0000 (EET)
+ * Robert added code to bypass parents.
+ * SET added code to use write only devices.
+ */
+ FILE *statfile;
+ char path[PATH_MAX];
+ bool found_vcsa=false;
+ int pid=getpid();
+
+ sprintf(path,"/proc/%d/stat",pid);
+ /* If it fails lets see what terminal own our parent */
+ while (!found_vcsa &&
+ (pid!=-1) &&
+ ((statfile=fopen(path,"r"))!=NULL))
+ {
+ int dev;
+ int ppid;
+
+ /* TTYs have 4 as major number */
+ /* virtual consoles have minor numbers <= 63 */
+ fscanf(statfile, "%*d %*s %*c %d %*d %*d %d", &ppid, &dev);
+
+ LOG("ppid: " << ppid << " device: " << dev << "(" << (dev & 0xff) << ")");
+ /* Be a little bit smart, we don't want to bypass X */
+ /* X terminals are attached to 0 (unknown) terminal */
+ if (dev==0) break;
+
+ if ((dev & 0xff00)==0x0400 && (dev & 0xff)<=63)
+ {
+ LOG("virtual console detected");
+ sprintf(path, "/dev/vcsa%d",dev & 0xff);
+ found_vcsa = true;
+
+ // SET: Open it with two files, one for write and the other for read.
+ // Doing it the administrator can give write access to some users,
+ // but not read, that's very secure.
+ if ((vcsWfd=open(path,O_WRONLY))<0)
+ LOG("unable to open " << path << ", running in stdout mode");
+ else
+ if ((vcsRfd=open(path,O_RDONLY))<0)
+ LOG("only write access to " << path);
+ }
+ fclose(statfile);
+ if (!found_vcsa && (pid!=ppid))
+ {
+ pid=ppid;
+ sprintf(path,"/proc/%d/stat",pid);
+ }
+ else
+ pid=-1;
+ }
+}
+//--------------- End of VCS detection code
+
+void TScreenLinux::DetectSecondaryDisplay()
+{
+ //--------------- MDA initialization code
+ #ifdef h386LowLevel
+ secondaryAvailable=!ioperm(0x3b4,7,1);
+ if (secondaryAvailable)
+ {
+ unsigned char is_mda=(inb(0x3ba) & 0x70) >> 4;
+ is_mda=(is_mda==0) || (is_mda==1) || (is_mda==5);
+ if (is_mda)
+ {
+ mdaMemH=open("/dev/mem",O_RDWR);
+ if (mdaMemH!=-1)
+ {
+ mdaMem=(unsigned short *)mmap(NULL,80*25*2,PROT_READ|PROT_WRITE,
+ MAP_SHARED,mdaMemH,0xB0000);
+ }
+ else
+ secondaryAvailable=0;
+ }
+ else
+ secondaryAvailable=0;
+ }
+ #endif
+}
+//--------------- End of MDA initialization code
+
+TScreenLinux::TScreenLinux()
+{
+ // Identify the terminal, if that's linux or console go on.
+ char *terminal=getenv("TERM");
+ if (!terminal || !(!strcmp(terminal,"console") || !strncmp(terminal,"linux",5)))
+ return;
+
+ // Initialize terminal
+ if (InitOnce())
+ {
+ fprintf(stderr,_("Error! %s"),error);
+ fprintf(stderr,"\r\n");
+ return;
+ }
+ // Initialize keyboard
+ if (TGKeyLinux::InitOnce())
+ {
+ tcsetattr(hOut,TCSAFLUSH,&outTermiosOrig);
+ fprintf(stderr,_("Error! %s"),TGKeyLinux::error);
+ fprintf(stderr,"\r\n");
+ return;
+ }
+ // Ok, if we are here this driver is usable.
+ initialized=1;
+ if (dCB) dCB();
+
+ // Determine which subdriver to use (VCS R/W, VCS W or plain terminal)
+ {
+ long useVCS=1;
+ TScreen::optSearch("UseVCS",useVCS);
+ if (useVCS)
+ DetectVCS();
+ }
+ {
+ long useMDA=1;
+ TScreen::optSearch("UseMDA",useMDA);
+ if (useMDA)
+ DetectSecondaryDisplay();
+ }
+
+ // Don't need special rights anymore
+ seteuid(getuid());
+ setegid(getgid());
+
+ // Hook the signal generated when the size of the window changes
+ signal(SIGWINCH,sigWindowSizeChanged);
+
+ // Initialize TDisplay using the detected capabilities
+ int mode=lnxInitSimple;
+ if (vcsWfd!=-1)
+ mode=vcsRfd!=-1 ? lnxInitVCSrw : lnxInitVCSwo;
+ TDisplayLinux::Init(mode);
+ Init(mode);
+
+ TGKeyLinux::Init(installedSFM==TVCodePage::KOI8r ? TGKeyLinux::KOI8 :
+ TGKeyLinux::Default);
+ #ifdef HAVE_GPM
+ THWMouseGPM::Init();
+ #endif
+ // Now we can do it
+ getCursorPos(oldCurX,oldCurY);
+
+ if (mode==lnxInitVCSrw || mode==lnxInitVCSwo)
+ {// VCS access is assumed to be color
+ palette=PAL_HIGH;
+ TScreenLinux::screenMode=TScreenLinux::smCO80;
+ }
+ else
+ {// Start assuming linux or linux-c terminal (color)
+ palette=PAL_HIGH;
+ TScreenLinux::screenMode=TScreenLinux::smCO80;
+ // Now check if the user requested monochrome
+ if (strstr(terminal,"-m-")!=NULL || !strcmp(terminal+strlen(terminal)-2,"-m")) // linux-m
+ { // Mono mode, explicitly supress colors even if they are available
+ palette = PAL_MONO;
+ TScreen::screenMode=TScreen::smMono;
+ }
+ LOG((palette == PAL_HIGH ? "Using high palette" : "Using mono palette"));
+ }
+
+ // User requested palette
+ if (palette==PAL_HIGH && parseUserPalette())
+ setPaletteColors(0,16,UserStartPalette);
+
+ cursorLines=startupCursor=getCursorType();
+ screenMode=startupMode=getCrtMode();
+ screenWidth =getCols();
+ screenHeight=getRows();
+ LOG("Screen size: " << (int)screenWidth << "," << (int)screenHeight);
+ screenBuffer=new ushort[screenWidth * screenHeight];
+ SaveScreen();
+
+ AvoidUTF8Mode();
+
+ // Use G1 charset, set G1 to the loaded video fonts, print control chars.
+ // It means the kernel will send what we write directly to screen, just
+ // like in the VCSA case.
+ // How do I know the previous settings to restore them? I taked a look
+ // at the Linux kernel and couldn't find a way to get disp_ctrl.
+ if (!canWriteVCS())
+ fputs("\e)K\xE",fOut);
+ // This is our state, save it
+ tcgetattr(hOut,&outTermiosNew);
+ suspended=0;
+ setCursorType(0);
+
+ // Give a chance to the fonts callback
+ if (canSetFonts && frCB && GetLinuxFontGeometry())
+ {
+ TScreenFont256 *font=frCB(0,linuxFont.width,linuxFont.height);
+ SetFont(1,font,0,NULL);
+ if (font)
+ DeleteArray(font->data);
+ delete font;
+
+ #if 1
+ long sec=0;
+ TScreenFont256 *font2=NULL;
+ if (optSearch("LoadSecondaryFont",sec) && sec)
+ {
+ font2=frCB(1,linuxFont.width,linuxFont.height);
+ if (font2)
+ {
+ SetFont(0,NULL,1,font2);
+ DeleteArray(font2->data);
+ delete font2;
+ }
+ }
+ #endif
+ }
+}
+
+void TScreenLinux::Suspend()
+{// Invalidate the knowledge about the current color of the terminal
+ oldCol=oldBack=oldFore=-1;
+ // Restore screen contents
+ RestoreScreen();
+ // Restore the font
+ SuspendFont();
+ // Restore the cursor shape
+ setCursorType(startupCursor);
+ // Restore cursor position, attributes and charset
+ // Here I just guess the previous state was G0 + no display control :-(
+ if (!canWriteVCS())
+ fputs("\e)0\xF",fOut);
+ // Reset the palette, lamentably we don't know the original state :-(
+ if (tioclinuxOK)
+ // Go back to default colors we memorized
+ SetDisPaletteColors(0,16,OriginalPalette);
+ else
+ // Just reset to default palette (should be equivalent)
+ fputs("\E]R",fOut);
+ // Restore UTF-8 mode
+ if (origUTF8Mode==1)
+ fputs(ENTER_UTF8,fOut);
+ // Is that a Linux bug? Sometime \E8 works, others not.
+ fputs("\E8",fOut);
+ // Restore cursor position
+ SetCursorPos(oldCurX,oldCurY);
+ // Ensure the last command is executed
+ fflush(fOut);
+ // Restore console mode
+ tcsetattr(hOut,TCSAFLUSH,&outTermiosOrig);
+ LOG("TScreenLinux Suspend");
+}
+
+TScreenLinux::~TScreenLinux()
+{
+ // At this point we are not suspended
+ LOG("TScreenLinux Destructor");
+}
+
+void TScreenLinux::DeallocateResources()
+{
+ LOG("TScreenLinux DeallocateResources");
+ // Now release allocated resources
+ if (screenBuffer)
+ {
+ DeleteArray(screenBuffer);
+ screenBuffer=NULL;
+ }
+ if (vcsWfd>=0)
+ close(vcsWfd);
+ if (vcsRfd>=0)
+ close(vcsRfd);
+ if (mdaMem)
+ {
+ munmap((char *)mdaMem,80*25*2);
+ mdaMem=NULL;
+ }
+ if (mdaMemH!=-1)
+ {
+ close(mdaMemH);
+ mdaMemH=-1;
+ }
+}
+
+void TScreenLinux::Resume()
+{
+ // Save console mode
+ tcgetattr(hOut,&outTermiosOrig);
+ // Set our console mode
+ tcsetattr(hOut,TCSAFLUSH,&outTermiosNew);
+ // Save cursor position, attributes and charset
+ fputs("\E7",fOut);
+ getCursorPos(oldCurX,oldCurY);
+ AvoidUTF8Mode();
+ // Restore our fonts
+ ResumeFont();
+ if (tioclinuxOK)
+ // We know the default colors, we can just hope they are the currently used
+ GetDisPaletteColors(0,16,OriginalPalette);
+ SetDisPaletteColors(0,16,ActualPalette);
+ // When we set the video mode the cursor is hidded
+ ushort oldCursorLines=cursorLines;
+ // Check for video size change and save some state
+ setVideoMode(screenMode);
+ SaveScreen();
+ // Set our cursor shape
+ setCursorType(oldCursorLines);
+ // Set the charset
+ if (!canWriteVCS())
+ fputs("\e)K\xE",fOut);
+ LOG("TScreenLinux Resume");
+}
+
+/*****************************************************************************
+ Save/Restore screen
+*****************************************************************************/
+
+void TScreenLinux::SaveScreen()
+{
+ if (canReadVCS())
+ {
+ userBufferSize=getCols()*getRows();
+ userBuffer=(ushort *)realloc(userBuffer,userBufferSize*sizeof(ushort));
+ getCharacters(0,userBuffer,userBufferSize);
+ }
+ else
+ {// First create an empty screen
+ // Fill the screenBuffer with spaces
+ unsigned i,size=screenWidth*screenHeight*2;
+ char *s=(char *)screenBuffer;
+ for (i=0; i<size; i+=2)
+ {
+ s[i]=' '; s[i+1]=7;
+ }
+
+ // Then we dump the screen to the screenBuffer as reference
+ unsigned width=getCols(),height=getRows();
+ userBufferSize=width*height;
+ if (tioclinuxOK)
+ {
+ LOG("Using TIOCLINUX to read the screen content");
+ setSel sel;
+ sel.service=2; // Set selection
+ sel.xs=1; sel.ys=1;
+ sel.xe=width;
+ sel.ye=height; // The whole screen
+ sel.sel_mode=0; // Character by character
+ fflush(TGKeyLinux::fIn); // Be sure we don't mix stuff
+ if (ioctl(hOut,TIOCLINUX,&sel)!=-1)
+ {// Ok, now we get the screen content, but no the colors
+ char val[2];
+ int character,w=width;
+ val[1]=0x07; // Default color
+
+ // Now paste the selection (the whole screen)
+ sel.service=3;
+ ioctl(hOut,TIOCLINUX,&sel);
+
+ // The kernel will send the text "compressed", any trailing spaces
+ // are stripped and a \n is reported.
+ ushort *s=screenBuffer;
+ ushort *end=screenBuffer+userBufferSize;
+ do
+ {
+ character=fgetc(TGKeyLinux::fIn);
+ if (character!=-1)
+ {
+ if (character==10)
+ {
+ s+=w;
+ w=width;
+ }
+ else
+ {
+ val[0]=character ? character : ' ';
+ *(s++)=*((ushort *)val);
+ w--;
+ if (!w) w=width; // Auto LF ;-)
+ }
+ }
+ }
+ while (character!=-1 && s<end);
+ }
+ }
+
+ // Finally we copy it to the user buffer
+ userBuffer=(ushort *)realloc(userBuffer,userBufferSize*sizeof(ushort));
+ memcpy(userBuffer,screenBuffer,userBufferSize*sizeof(ushort));
+ }
+}
+
+void TScreenLinux::RestoreScreen()
+{
+ if (canWriteVCS())
+ setCharacters(0,userBuffer,userBufferSize);
+ else
+ {// If we can't restore the screen just clear it
+ // Set color to gray over black
+ fputs("\E[22;37;40m",fOut);
+ // Clear the screen to it
+ //fputs("\E[2J",fOut);
+ setCharacters(0,userBuffer,userBufferSize);
+ }
+}
+
+void TScreenLinux::SaveScreenReleaseMemory(void)
+{
+ free(userBuffer);
+}
+
+
+void TScreenLinux::CheckSizeBuffer(int oldWidth, int oldHeight)
+{
+ // allocating a zeroed screenBuffer, because this function
+ // is called in most cases (in RHIDE) after a SIGWINCH
+ if (screenWidth!=oldWidth || screenHeight!=oldHeight || !screenBuffer)
+ {
+ // Realloc screen buffer only if actually needed (it doesn't exist
+ // or screen size is changed)
+ if (screenBuffer)
+ DeleteArray(screenBuffer);
+ screenBuffer=new ushort[screenWidth*screenHeight];
+ }
+ memset(screenBuffer,0,screenWidth*screenHeight*sizeof(ushort));
+}
+
+void TScreenLinux::SetVideoMode(ushort mode)
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+
+ setCrtMode(mode);
+ defaultSetCrtData();
+ CheckSizeBuffer(oldWidth,oldHeight);
+}
+
+void TScreenLinux::SetVideoModeExt(char *mode)
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+
+ setCrtModeExt(mode);
+ defaultSetCrtData();
+ CheckSizeBuffer(oldWidth,oldHeight);
+}
+
+ushort TScreenLinux::GetCharacter(unsigned dst)
+{
+ ushort src;
+ getCharacters(dst,&src,1);
+ return src;
+}
+
+void TScreenLinux::SetCharacter(unsigned offset,ushort value)
+{
+ setCharacters(offset,&value,1);
+}
+
+void TScreenLinux::GetCharactersMDA(unsigned offset, ushort *buf, unsigned count)
+{
+ memcpy(buf,mdaMem+offset,count*sizeof(ushort));
+}
+
+void TScreenLinux::GetCharactersVCS(unsigned offset, ushort *buf, unsigned count)
+{
+ lseek(vcsRfd,offset*sizeof(ushort)+4,SEEK_SET);
+ read(vcsRfd,buf,count*sizeof(ushort));
+ #if TV_BIG_ENDIAN
+ {
+ unsigned i;
+ uchar *s=(uchar *)buf,aux;
+ count*=2;
+ for (i=0; i<count; i+=2)
+ {
+ aux=s[i];
+ s[i]=s[i+1];
+ s[i+1]=aux;
+ }
+ }
+ #endif
+}
+
+/*
+ * Draws a line of text on the screen.
+ */
+void TScreenLinux::SetCharactersMDA(unsigned dst, ushort *src, unsigned len)
+{
+ memcpy(mdaMem+dst, src, len*sizeof(ushort));
+}
+
+void TScreenLinux::SetCharactersVCS(unsigned dst, ushort *src, unsigned len)
+{
+ unsigned length=len*sizeof(ushort);
+
+ if (reduceTo8Colors)
+ {
+ unsigned i;
+ uchar *s=(uchar *)src, back, fore, newfore;
+ for (i=1; i<length; i+=2)
+ {
+ back=(s[i] >> 4) & 7;
+ fore=s[i] & 15;
+ newfore=fore & 7;
+ if (back!=fore && back==newfore)
+ newfore=(newfore+1) & 7;
+ s[i]=newfore | (back<<4);
+ // The following is faster but you need a palette designed for 8
+ // colors. I personally think people using UTF-8 for consoles
+ // must be ready to lose performance.
+ //s[i]&=0xF7;
+ }
+ }
+
+ lseek(vcsWfd,dst*sizeof(ushort)+4,SEEK_SET);
+ #if TV_BIG_ENDIAN
+ {
+ unsigned i;
+ uchar *s=(uchar *)src;
+ uchar b[length*2];
+ for (i=0; i<length; i+=2)
+ {
+ b[i]=s[i+1];
+ b[i+1]=s[i];
+ }
+ write(vcsWfd,b,length);
+ }
+ #else
+ write(vcsWfd,src,length);
+ #endif
+ if (!canReadVCS())
+ // SET: cache it to avoid reads that needs special priviledges
+ memcpy(screenBuffer+dst,src,length);
+}
+
+void TScreenLinux::SetCharactersTerm(unsigned dst, ushort *src, unsigned len)
+{
+ ushort *old=screenBuffer+dst;
+ ushort *old_right=old+len-1;
+ ushort *src_right=src+len-1;
+
+ /* remove unchanged characters from left to right */
+ if (!force_redraw)
+ {
+ while (len>0 && *old==*src)
+ {
+ dst++;
+ len--;
+ old++;
+ src++;
+ }
+
+ /* remove unchanged characters from right to left */
+ while (len>0 && *old_right==*src_right)
+ {
+ len--;
+ old_right--;
+ src_right--;
+ }
+ }
+
+ /* write only middle changed characters */
+ if (len>0)
+ writeBlock(dst,len,old,src);
+}
+
+/*
+ * Writes a block of text.
+ */
+
+void TScreenLinux::writeBlock(int dst, int len, ushort *old, ushort *src)
+{
+ int col=-1;
+
+ fprintf(fOut,"\E[%d;%dH",dst/TScreenLinux::screenWidth+1,dst%TScreenLinux::screenWidth+1);
+
+ while (len-->0)
+ {
+ int code =CLY_Low16(*src);
+ int newcol=CLY_High16(*src);
+
+ *old++=*src++;
+ if (col!=newcol) /* change color ? */
+ {
+ col=newcol;
+ if (palette==PAL_MONO)
+ {
+ if (col==0x0f)
+ fputs("\E[0;1m",fOut); // Bold
+ else
+ if (col==0x70)
+ fputs("\E[0;7m",fOut); // Reverse
+ else
+ fputs("\E[0m",fOut); // Normal
+ }
+ else
+ mapColor(col);
+ }
+
+ /* SET: The following uses information I got from Linux kernel.
+ The file drivers/char/console.c have all the parsing of the
+ escape sequences. I put more information at the end of this
+ file.
+ Some characters are ever interpreted as control codes, here
+ I use a bitmap for them taked directly from the kernel.
+ The kernel code also sugest to use UTF-8 to print those
+ codes.
+ Note that Unicode 0xF000 | character means that character
+ must pass unchanged to the screen
+ */
+ #define CTRL_ALWAYS 0x0800f501 /* Cannot be overridden by disp_ctrl */
+ if (code<32 && ((CTRL_ALWAYS>>code) & 1))
+ {/* This character can't be printed, we must use unicode */
+ /* Enter UTF-8 and start constructing 0xF000 code */
+ fputs(ENTER_UTF8 "\xEF\x80",fOut);
+ /* Set the last 6 bits */
+ fputc(code | 0x80,fOut);
+ /* Escape UTF-8 */
+ fputs(EXIT_UTF8,fOut);
+ }
+ else if (code==128+27)
+ {/* A specially evil code: Meta+ESC, it can't be printed */
+ /* Just send Unicode 0xF09B to screen */
+ fputs(ENTER_UTF8 "\xEF\x82\x9B" EXIT_UTF8,fOut);
+ }
+ else
+ /* The rest pass directly unchanged */
+ fputc(code,fOut);
+ }
+ if (palette==PAL_MONO)
+ fputs("\E[0m",fOut); // Normal
+
+ fprintf(fOut,"\E[%d;%dH",curY+1,curX+1);
+}
+
+/*
+ * Converts colors from the large TV palette (16 foreground colors and
+ * 16 background colors) to ncurses small palette (8 foreground colors
+ * and 8 background colors).
+ */
+
+void TScreenLinux::mapColor(int col)
+{
+ static char map[] = {0, 4, 2, 6, 1, 5, 3, 7};
+ int back,fore;
+
+ if (col==oldCol)
+ return;
+ oldCol=col;
+ back=(col >> 4) & 7;
+ fore=col & 15;
+
+ if (reduceTo8Colors)
+ {
+ int newfore;
+ newfore=fore & 7;
+ if (back!=fore && back==newfore)
+ newfore=(newfore+1) & 7;
+ fore=newfore;
+ }
+
+ #define SB set_a_background ? set_a_background : set_background
+ #define SF set_a_foreground ? set_a_foreground : set_foreground
+
+ if (fore!=oldFore && back!=oldBack)
+ fprintf(fOut,"\E[%d;%d;%dm",fore>7 ? 1 : 22,30+map[fore & 7],40+map[back]);
+ else
+ {
+ if (fore!=oldFore)
+ fprintf(fOut,"\E[%d;%dm",fore>7 ? 1 : 22,30+map[fore & 7]);
+ else
+ fprintf(fOut,"\E[%dm",40+map[back]);
+ }
+
+ oldFore = fore;
+ oldBack = back;
+
+ #undef SB
+ #undef SF
+}
+
+// SET: Call to an external program, optionally forking
+int TScreenLinux::System(const char *command, pid_t *pidChild, int in,
+ int out, int err)
+{
+ if (!pidChild)
+ {
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+ }
+
+ pid_t cpid=fork();
+ if (cpid==0)
+ {// Ok, we are the child
+ // I'm not sure about it, but is the best I have right now.
+ // Doing it we can kill this child and all the subprocesses
+ // it creates by killing the group. It also have an interesting
+ // effect that I must evaluate: By doing it this process lose
+ // the controlling terminal and won't be able to read/write
+ // to the parents console. I think that's good.
+ if (setsid()==-1)
+ _exit(127);
+ char *argv[4];
+
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+
+ // Note: execvp takes a char * const argument, but I think it should
+ // take a const char *
+ argv[0]=newStr(getenv("SHELL"));
+ if (!argv[0])
+ argv[0]=newStr("/bin/sh");
+ argv[1]=newStr("-c");
+ argv[2]=newStr(command);
+ argv[3]=NULL;
+ execvp(argv[0],argv);
+ delete[] argv[0];
+ delete[] argv[1];
+ delete[] argv[2];
+ // We get here only if exec failed
+ _exit(127);
+ }
+ if (cpid==-1)
+ {// Fork failed do it manually
+ *pidChild=0;
+ return system(command);
+ }
+ *pidChild=cpid;
+ return 0;
+}
+
+/* The following is a modified version of Adler-32 checksum calculator:
+ * adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ The above mentioned header says:
+
+ Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+ This notice isn't removed, I clearly state the original author and that's
+ modified, so I think that's ok and compatible with GPL.
+ */
+
+const uint32 Base=65521; /* largest prime smaller than 65536 */
+const unsigned nMax=5552;
+/* nMax is the largest n such that 255n(n+1)/2 + (n+1)(Base-1) <= 2^32-1 */
+
+#define DO1(buf,i) {s1+=buf[i]; s2+=s1;}
+#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf) DO8(buf,0); DO8(buf,8);
+
+static
+uint32 adler32(uint32 adler, const char *buf, unsigned len)
+{
+ uint32 s1=adler & 0xffff;
+ uint32 s2=(adler>>16) & 0xffff;
+ int k;
+
+ if (buf==NULL)
+ return 1;
+
+ while (len>0)
+ {
+ k=len<nMax ? len : nMax;
+ len-=k;
+ while (k>=16)
+ {
+ DO16(buf);
+ buf+=16;
+ k-=16;
+ }
+ if (k)
+ do
+ {
+ s1+=*buf++;
+ s2+=s1;
+ }
+ while (--k);
+ s1%=Base;
+ s2%=Base;
+ }
+ return (s2 << 16) | s1;
+}
+
+/*****************************************************************************
+ Fonts routines
+*****************************************************************************/
+
+int TScreenLinux::GetLinuxFontGeometry()
+{
+ memset(&linuxFont,0,sizeof(linuxFont));
+ linuxFont.op=KD_FONT_OP_GET;
+ linuxFont.height=32;
+ linuxFont.width=16;
+
+ int ret=ioctl(hOut,KDFONTOP,&linuxFont);
+ /*unsigned count=linuxFont.charcount;
+ linuxFont.charcount=0;
+ ioctl(hOut,KDFONTOP,&linuxFont);
+ linuxFont.charcount=count;*/
+
+ return ret>=0;
+}
+
+int TScreenLinux::GetFontGeometry(unsigned &w, unsigned &h)
+{
+ if (!canSetFonts) return 0;
+ w=linuxFont.width;
+ h=linuxFont.height;
+ return 1;
+}
+
+void TScreenLinux::FreeFontsMemory()
+{
+ if (linuxFont.data)
+ {
+ free(linuxFont.data);
+ linuxFont.data=NULL;
+ }
+ if (ourFont.data)
+ {
+ free(ourFont.data);
+ ourFont.data=NULL;
+ }
+}
+
+int TScreenLinux::AllocateFontsMemory()
+{
+ unsigned bytes=32*((linuxFont.width+7)/8);
+ linuxFont.data=(uchar *)malloc(bytes*linuxFont.charcount);
+ ourFont.data=(uchar *)malloc(bytes*512);
+ return linuxFont.data && ourFont.data;
+}
+
+int TScreenLinux::GetLinuxFont()
+{
+ linuxFont.op=KD_FONT_OP_GET;
+ return ioctl(hOut,KDFONTOP,&linuxFont)>=0;
+}
+
+void TScreenLinux::ExpandFont(uchar *dest, TScreenFont256 *font)
+{// No matters what's the height Linux uses 32
+ int i;
+ unsigned bytes=32*((linuxFont.width+7)/8);
+ unsigned sizeOrig=font->h*((font->w+7)/8);
+ uchar *b=font->data;
+ memset(dest,0,bytes*256);
+ for (i=0; i<256; dest+=bytes, b+=sizeOrig, i++)
+ memcpy(dest,b,sizeOrig);
+}
+
+int TScreenLinux::SetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP, int appCP)
+{
+ if (!canSetFonts) return 0;
+ if (!changeP && !changeS) return 1;
+ // Check for restore fonts
+ if (changeP && !fontP && ((!changeS && !secondaryFontSet) || (changeS && !fontS)))
+ {// Restore Linux font
+ linuxFont.op=KD_FONT_OP_SET;
+ int ret=ioctl(hOut,KDFONTOP,&linuxFont)>=0;
+ // We no longer have a font loaded
+ FreeFontsMemory();
+ secondaryFontSet=primaryFontSet=0;
+ if (fontCP!=-1)
+ {
+ if (appCP==-1)
+ TVCodePage::SetScreenCodePage(fontCP);
+ else
+ TVCodePage::SetCodePage(appCP,fontCP,-1);
+ }
+ return ret;
+ }
+ // Solve the sizes
+ unsigned wP=linuxFont.width,hP=linuxFont.height,
+ wS=linuxFont.width,hS=linuxFont.height;
+ int newP=changeP && fontP;
+ if (newP)
+ {
+ wP=fontP->w;
+ hP=fontP->h;
+ }
+ int newS=changeS && fontS;
+ if (newS)
+ {
+ wS=fontS->w;
+ hS=fontS->h;
+ }
+ if (wP!=wS || hP!=hS) return 0;
+ // Check if the size is in the range
+ if (wP!=linuxFont.width || hP!=linuxFont.height)
+ return 0;
+
+ // We are about changing the font, we must be sure that Linux font is saved
+ if ((newS || newP) && !primaryFontSet && !secondaryFontSet)
+ {
+ if (!AllocateFontsMemory() || !GetLinuxFont())
+ return 0;
+ ourFont.width=linuxFont.width;
+ ourFont.height=linuxFont.height;
+ }
+
+ // Change the requested fonts
+ unsigned bytes=32*((linuxFont.width+7)/8);
+ uchar newSecondaryFontSet=secondaryFontSet,
+ newPrimaryFontSet=primaryFontSet;
+ if (changeP)
+ {
+ if (!secondaryFontSet)
+ { // P but not S
+ ourFont.charcount=256;
+ }
+ if (!primaryFontSet)
+ TVCodePage::GetCodePages(origCPApp,origCPScr,origCPInp);
+ if (fontP)
+ {
+ ExpandFont(ourFont.data,fontP);
+ newPrimaryFontSet=1;
+ }
+ else
+ {
+ // Use Linux font as primary
+ memcpy(ourFont.data,linuxFont.data,256*bytes);
+ newPrimaryFontSet=0;
+ }
+ }
+ if (changeS)
+ {
+ if (fontS)
+ {
+ ourFont.charcount=512;
+ if (!primaryFontSet)
+ memcpy(ourFont.data,linuxFont.data,256*bytes);
+ ExpandFont(ourFont.data+256*bytes,fontS);
+ newSecondaryFontSet=1;
+ }
+ else
+ {
+ if (linuxFont.charcount==512)
+ {
+ ourFont.charcount=512;
+ memcpy(ourFont.data+256*bytes,linuxFont.data+256*bytes,256*bytes);
+ }
+ else
+ ourFont.charcount=256;
+ newSecondaryFontSet=0;
+ }
+ }
+ ourFont.op=KD_FONT_OP_SET;
+ if (ioctl(hOut,KDFONTOP,&ourFont)<0) return 0;
+ primaryFontSet=newPrimaryFontSet;
+ secondaryFontSet=newSecondaryFontSet;
+
+ if (changeP && fontCP!=-1)
+ {
+ if (appCP==-1)
+ TVCodePage::SetScreenCodePage(fontCP);
+ else
+ TVCodePage::SetCodePage(appCP,fontCP,-1);
+ }
+ return 1;
+}
+
+void TScreenLinux::RestoreFonts()
+{
+ if (!primaryFontSet && !secondaryFontSet)
+ return; // Protection
+ SetFont(1,NULL,1,NULL,origCPScr,origCPApp);
+}
+
+void TScreenLinux::SuspendFont()
+{
+ if (primaryFontSet || secondaryFontSet)
+ {// Set the Linux fonts again
+ linuxFont.op=KD_FONT_OP_SET;
+ ioctl(hOut,KDFONTOP,&linuxFont);
+ // Free their memory, we will memorize them again in the resume
+ free(linuxFont.data);
+ linuxFont.data=NULL;
+ }
+}
+
+void TScreenLinux::ResumeFont()
+{
+ if (primaryFontSet || secondaryFontSet)
+ {// Get Linux fonts info
+ GetLinuxFontGeometry();
+ // Allocate memory for them
+ unsigned bytes=32*((linuxFont.width+7)/8);
+ linuxFont.data=(uchar *)malloc(bytes*linuxFont.charcount);
+ // Get them
+ GetLinuxFont();
+ // Now restore our fonts
+ ourFont.op=KD_FONT_OP_SET;
+ ioctl(hOut,KDFONTOP,&ourFont);
+ }
+}
+
+
+#else // TVOSf_Linux
+
+#include <tv/linux/screen.h>
+#include <tv/linux/key.h>
+#include <tv/linux/mouse.h>
+#include <tv/linux/log.h>
+
+#endif // else TVOSf_Linux
+/*****************************************************************************
+
+ This code was in the constructor and commented, it could help in the
+ future.
+ * ESC ] Ps ND string NP
+ * ND can be any non-digit Character (it's discarded)
+ * NP can be any non-printing Character (it's discarded)
+ * string can be any ASCII printable string (max 511 characters)
+ * Ps = 0 -> use string as a new icon name and title
+ * Ps = 1 -> use string is a new icon name only
+ * Ps = 2 -> use string is a new title only
+ * Ps = 46 -> use string as a new log file name
+ if (getenv("DISPLAY") != NULL) cout << "\033]2;TurboVision\007";
+
+SET:
+ Here is some information about the Linux console. I got it from the kernel
+sources, they says that's VT102:
+
+\e(n
+Sets the G0 character set. The terminal have 2 character sets, that's the
+commonly used. The n value can be:
+0 Graphics (DEC ISO 2022)
+B Latin 1 (ISO 8859-1)
+U IBM PC
+K User
+
+\e)n
+It sets what character set is used for G1. That's the alternative charset.
+
+\xF
+Select the G0 charset, don't display control characters. After it all printed
+values are in G0 charset.
+
+\xE
+Select the G1 charset, display control characters. After it all printed
+values are in G1 charset. Usually it selects the graphics chars.
+
+\e[10m
+Selects G0 or G1 (depending of the last selection done by \xF or \xE), don't
+display control characters, don't force the bit 7 to 1.
+
+\e[11m
+Selects IBM PC, display control characters, don't force the bit 7 to 1.
+
+\e[12m
+Selects IBM PC, display control characters, force the bit 7 to 1.
+
+Description of the available charsets for Linux:
+1) Graphics (0):
+ This is latin 1 charset with some changes in the range 32-126. This charset
+is called VT100. Here are the codes that differ from ASCII:
+ 43(+): Right arrow 109(m): simple lower left corner
+ 44(,): Left arrow 110(n): simple intersection
+ 45(-): Up arrow 111(o): first line filled
+ 46(.): Down arrow 112(p): 1/4 of height line filled
+ 48(0): Filled block 113(q): 1/2 of height line filled
+ 95(_): Non break space 114(r): 3/4 of height line filled
+ 96(`): Diamond 115(s): last line filled
+ 97(a): 50% filled. 116(t): simple vertical with right int.
+ 98(b): HT 117(u): simple vertical with left int.
+ 99(c): FF 118(v): simple horiz. with upper int.
+100(d): CR 119(w): simple horiz. with lower int.
+101(e): LF 120(x): simple vertical
+102(f): Degree 121(y): <=
+103(g): +/- 122(z): >=
+104(h): 25% filled. 123({): pi
+105(i): VT 124(|): /=
+106(j): simple lower right corner 125(}): pounds
+107(k): simple upper right corner 126(~): middle point
+108(l): simple upper left corner
+
+2) Latin 1 (B):
+ That's pure ISO 8859-1 mapping. It means 128-159 have undefined shapes.
+
+3) IBM PC (U):
+ That's PC 437 code page. Some characters are undefined if the currently
+loaded fonts doesn't have it.
+
+4) User defined (K):
+ That's just "send to screen this code". So it depends on the loaded fonts.
+
+ Note that 0-31 and 127 are considered control characters and will be printed
+only if this is enabled. Some characters aren't printed even if that's
+enabled, that's because if they are printed you can't use the terminal
+(imagine disabling ESC ;-).
+ Also: 128+27 will never be printed.
+
+ In Eterm only Graphics (VT100) and Latin 1 are supported.
+ In xterm a simple program have troubles to print anything above 127.
+
+*****************************************************************************/
diff --git a/tvision/classes/ofpstrea.cc b/tvision/classes/ofpstrea.cc
new file mode 100644
index 0000000..a50dcf6
--- /dev/null
+++ b/tvision/classes/ofpstrea.cc
@@ -0,0 +1,55 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis and Christoph Bauer.
+
+ *
+ *
+ */
+
+#define Uses_string
+#define Uses_fpbase
+#define Uses_ofpstream
+#define Uses_IOS_BIN
+#include <tv.h>
+
+UsingNamespaceStd
+
+ofpstream::ofpstream()
+{
+}
+
+ofpstream::ofpstream( const char* name, CLY_OpenModeT omode, int prot ) :
+ fpbase( name, omode | CLY_IOSOut | CLY_IOSBin, prot )
+{
+}
+
+ofpstream::ofpstream( int f ) : fpbase( f )
+{
+}
+
+ofpstream::ofpstream(int f, char* b, int len) : fpbase(f, b, len)
+{
+}
+
+ofpstream::~ofpstream()
+{
+}
+
+CLY_filebuf *ofpstream::rdbuf()
+{
+ return fpbase::rdbuf();
+}
+
+void ofpstream::open( const char *name, CLY_OpenModeT omode, int prot )
+{
+ fpbase::open( name, omode | CLY_IOSOut | CLY_IOSBin, prot );
+}
+
diff --git a/tvision/classes/opstream.cc b/tvision/classes/opstream.cc
new file mode 100644
index 0000000..3da72a0
--- /dev/null
+++ b/tvision/classes/opstream.cc
@@ -0,0 +1,237 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ *
+ * Modified by Robert H”hne to be used for RHIDE.
+ * Modified by Vadim Beloborodov to be used on WIN32 console
+ *
+ * SET: Moved the standard headers here because according to DJ
+ * they can inconditionally declare symbols like NULL.
+ * Added members for platform indepent writes. Started with a JASC
+ * modification. Added: write8, write16, write32, write64, writeShort,
+ * writeInt and writeLong.
+ *
+ * Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ * Andris Pavenis and Christoph Bauer.
+ *
+ */
+#define Uses_stdio // fprintf in writeData
+#define Uses_string
+#define Uses_PubStreamBuf
+#define Uses_TStreamable
+#define Uses_TStreamableClass
+#define Uses_TPWrittenObjects
+#define Uses_TStreamableTypes
+#define Uses_pstream
+#define Uses_opstream
+#define Uses_TPWrittenObjects
+#include <tv.h>
+
+opstream::opstream()
+{
+ objs = new TPWrittenObjects();
+}
+
+opstream::opstream( CLY_streambuf * sb )
+{
+ objs = new TPWrittenObjects();
+ pstream::init( sb );
+}
+
+opstream::~opstream()
+{
+ CLY_destroy(objs);
+}
+
+opstream& opstream::seekp( CLY_StreamPosT pos )
+{
+ objs->freeAll();
+ bp->CLY_PubSeekOff( pos, CLY_IOSBeg );
+ return *this;
+}
+
+opstream& opstream::seekp( CLY_StreamOffT pos, CLY_IOSSeekDir dir )
+{
+ objs->freeAll();
+ bp->CLY_PubSeekOff( pos, dir );
+ return *this;
+}
+
+CLY_StreamPosT opstream::tellp()
+{
+ return bp->CLY_PubSeekOff( 0, CLY_IOSCur, CLY_IOSOut );
+}
+
+opstream& opstream::flush()
+{
+ bp->CLY_PubSync();
+ return *this;
+}
+
+void opstream::writeByte( uchar ch )
+{
+ bp->sputc( ch );
+}
+
+void opstream::writeBytes( const void *data, size_t sz )
+{
+ bp->sputn( (char *)data, sz );
+}
+
+/*
+ * writeShort, writeInt and writeLong:
+ * These are platform dependent, writes the size and byte order of the native
+ * platform.
+ * Created by SET to be compatible with original code and V. Bugrov ideas.
+ */
+
+#define DefineWriteDep(name,type)\
+void opstream::write##name(type val)\
+{\
+ bp->sputn((char *)&val,sizeof(type));\
+}
+DefineWriteDep(Short,ushort);
+DefineWriteDep(Int,uint);
+DefineWriteDep(Long,ulong);
+
+/*
+ * write16, write32 and write64:
+ * These are platform independent, writes a fixed size in little endian order
+ * and if the platform is big endian swaps bytes.
+ * Created by SET to be compatible with original code and JASC + V. Bugrov
+ * ideas.
+ */
+
+#ifdef TV_BIG_ENDIAN
+#define Swap(a,b) t=v[a]; v[a]=v[b]; v[b]=t
+
+static inline
+void Swap16(char *v)
+{
+ char t;
+ Swap(0,1);
+}
+
+static inline
+void Swap32(char *v)
+{
+ char t;
+ Swap(0,3);
+ Swap(1,2);
+}
+
+static inline
+void Swap64(char *v)
+{
+ char t;
+ Swap(0,7);
+ Swap(1,6);
+ Swap(2,5);
+ Swap(3,4);
+}
+#else
+static inline
+void Swap16(char *) {}
+static inline
+void Swap32(char *) {}
+static inline
+void Swap64(char *) {}
+#endif
+
+#define DefineWrite(name,type)\
+void opstream::write##name(type val)\
+{\
+ Swap##name((char *)&val);\
+ bp->sputn((char *)&val,sizeof(type));\
+}
+DefineWrite(16,uint16);
+DefineWrite(32,uint32);
+DefineWrite(64,uint64);
+
+void opstream::writeString( const char *str )
+{
+ if( str == 0 )
+ {
+ writeByte( 0xFF );
+ return;
+ }
+ int len = strlen( str );
+ if (len > 0xfd)
+ {
+ writeByte( 0xfe );
+ write32(len);
+ }
+ else
+ {
+ writeByte( (uchar)len );
+ }
+ writeBytes( str, len );
+}
+
+/* Operators moved to headers by JASC */
+
+CLY_EXPORT opstream& operator << ( opstream& ps, TStreamable& t )
+{
+ ps.writePrefix( t );
+ ps.writeData( t );
+ ps.writeSuffix( t );
+ return ps;
+}
+
+CLY_EXPORT opstream& operator << ( opstream& ps, TStreamable *t )
+{
+ P_id_type index;
+ if( t == 0 )
+ ps.writeByte( pstream::ptNull );
+ else if( (index = ps.find( t )) != P_id_notFound )
+ {
+ ps.writeByte( pstream::ptIndexed );
+ ps.writeWord( index );
+ }
+ else
+ {
+ ps.writeByte( pstream::ptObject );
+ ps << *t;
+ }
+ return ps;
+}
+
+void opstream::writePrefix( const TStreamable& t )
+{
+ writeByte( '[' );
+ writeString( t.streamableName() );
+}
+
+
+void opstream::writeData( TStreamable& t )
+{
+ if( types->lookup( t.streamableName() ) == 0 )
+ {
+ fprintf(stderr,_("type not registered: %s\n"),t.streamableName());
+ error( peNotRegistered, t );
+ }
+ else
+ {
+ registerObject( &t );
+ t.write( *this );
+ }
+}
+
+void opstream::writeSuffix( const TStreamable& )
+{
+ writeByte( ']' );
+}
+
+P_id_type opstream::find( const void *adr )
+{
+ return objs->find( adr );
+}
+
+void opstream::registerObject( const void *adr )
+{
+ objs->registerObject( adr );
+}
+
diff --git a/tvision/classes/osclipboard.cc b/tvision/classes/osclipboard.cc
new file mode 100644
index 0000000..67aa106
--- /dev/null
+++ b/tvision/classes/osclipboard.cc
@@ -0,0 +1,34 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+ Header: TVOSClipboard
+ Module: OS Clipboard
+ Comments:
+ OS independent clipboard system class. Uses to access the OS clipboard.@*
+ It was created to abstract the X11 and Windows clipboards.
+
+***************************************************************************/
+
+#define Uses_TVOSClipboard
+#include <tv.h>
+
+const char *TVOSClipboard::name="None";
+int TVOSClipboard::available=0;
+int (*TVOSClipboard::copy)(int id, const char *buffer, unsigned len)=NULL;
+char *(*TVOSClipboard::paste)(int id, unsigned &length)=NULL;
+void (*TVOSClipboard::destroy)()=NULL;
+int TVOSClipboard::error=0;
+int TVOSClipboard::errors=0;
+const char **TVOSClipboard::nameErrors=NULL;
+
+
+const char *TVOSClipboard::getError()
+{
+ if (error>errors || !error || !nameErrors)
+ return NULL;
+ return _(nameErrors[error]);
+}
+
+
diff --git a/tvision/classes/pstream.cc b/tvision/classes/pstream.cc
new file mode 100644
index 0000000..4286d69
--- /dev/null
+++ b/tvision/classes/pstream.cc
@@ -0,0 +1,132 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis and Christoph Bauer.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <stdlib.h>
+
+#define Uses_TStreamableTypes
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_pstream
+#include <tv.h>
+
+UsingNamespaceStd
+
+pstream::pstream( CLY_streambuf *sb )
+{
+ init( sb );
+}
+
+pstream::~pstream()
+{
+}
+
+void pstream::deInitTypes(void)
+{
+ if (types)
+ delete types;
+}
+
+// The following call to new is overloaded, avoid
+// using MSS for it.
+#include <tv/no_mss.h>
+
+void pstream::initTypes()
+{
+ if (!types)
+ {
+ types=new TStreamableTypes;
+ atexit(pstream::deInitTypes);
+ }
+}
+
+#include <tv/yes_mss.h>
+
+int pstream::rdstate() const
+{
+ return state;
+}
+
+int pstream::eof() const
+{
+ return state & CLY_IOSEOFBit;
+}
+
+int pstream::fail() const
+{
+ return state & (CLY_IOSFailBit | CLY_IOSBadBit);
+}
+
+int pstream::bad() const
+{
+ return state & (CLY_IOSBadBit);
+}
+
+int pstream::good() const
+{
+ return state == 0;
+}
+
+void pstream::clear( int i )
+{
+ state = (i & 0xFF);
+}
+
+void pstream::registerType( TStreamableClass *ts )
+{
+ types->registerType( ts );
+}
+
+pstream::operator void *() const
+{
+ return fail() ? 0 : (void *)this;
+}
+
+int pstream::operator! () const
+{
+ return fail();
+}
+
+CLY_streambuf * pstream::rdbuf() const
+{
+ return bp;
+}
+
+pstream::pstream()
+{
+}
+
+void pstream::error( StreamableError )
+{
+ abort();
+}
+
+void pstream::error( StreamableError, const TStreamable& )
+{
+ abort();
+}
+
+void pstream::init( CLY_streambuf *sbp )
+{
+ state = 0;
+ bp = sbp;
+}
+
+void pstream::setstate( int b )
+{
+ state |= (b&0xFF);
+}
+
+TStreamableTypes * pstream::types;
diff --git a/tvision/classes/qnx4/qnx4dis.cc b/tvision/classes/qnx4/qnx4dis.cc
new file mode 100644
index 0000000..b3e4156
--- /dev/null
+++ b/tvision/classes/qnx4/qnx4dis.cc
@@ -0,0 +1,230 @@
+/* QNX 4 screen routines source.
+ Copyright (c) 1998-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_string
+#define Uses_ioctl
+#define Uses_signal
+
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && defined(TVOSf_QNX4)
+
+#include <termios.h>
+
+#include <tv/qnx4/screen.h>
+
+extern "C"
+{
+ #include <sys/term.h>
+ #include <sys/qnxterm.h>
+}
+
+#include <sys/dev.h>
+
+ushort TDisplayQNX4::CursorLastX=0xFFFF;
+ushort TDisplayQNX4::CursorLastY=0xFFFF;
+ushort TDisplayQNX4::CursorShapeStart=85;
+ushort TDisplayQNX4::CursorShapeEnd=100;
+ushort TDisplayQNX4::ConsoleResizing=0;
+ushort TDisplayQNX4::IgnoreConsoleResizing=0;
+char TDisplayQNX4::ConsoleMode=1;
+struct _VideoModes TDisplayQNX4::modes[NUM_MODES]=
+{
+ {smCO80x25, 80, 25}, {smCO80x28, 80, 28}, {smCO80x35, 80, 35},
+ {smCO80x40, 80, 40}, {smCO80x43, 80, 43}, {smCO80x50, 80, 50},
+ {smCO80x30, 80, 30}, {smCO80x34, 80, 34}, {smCO90x30, 90, 30},
+ {smCO90x34, 90, 34}, {smCO94x30, 94, 30}, {smCO94x34, 94, 34},
+ {smCO82x25, 82, 25}, {smCO80x60, 80, 60}, {smCO132x25, 132, 25},
+ {smCO132x43, 132, 34}, {smCO132x50, 132, 50}, {smCO132x60, 132, 60}
+};
+
+TDisplayQNX4::~TDisplayQNX4()
+{
+}
+
+void TDisplayQNX4::Init()
+{
+ TDisplay::setCursorPos=SetCursorPos;
+ TDisplay::getCursorPos=GetCursorPos;
+ TDisplay::getCursorShape=GetCursorShape;
+ TDisplay::setCursorShape=SetCursorShape;
+ TDisplay::getRows=GetRows;
+ TDisplay::getCols=GetCols;
+ TDisplay::getCrtMode=GetCrtMode;
+ TDisplay::setCrtMode=SetCrtMode;
+ TDisplay::setCrtModeRes_p=SetCrtModeRes;
+ TDisplay::setCrtModeExt=SetCrtModeExt;
+ TDisplay::checkForWindowSize=CheckForWindowSize;
+}
+
+void TDisplayQNX4::SetCursorPos(unsigned x, unsigned y)
+{
+ CursorLastX=x;
+ CursorLastY=y;
+ term_cur(y, x);
+ term_flush();
+}
+
+void TDisplayQNX4::GetCursorPos(unsigned &x, unsigned &y)
+{
+ x=CursorLastX;
+ y=CursorLastY;
+}
+
+void TDisplayQNX4::SetCursorShape(unsigned start, unsigned end)
+{
+ char* CursorShapeControlString;
+
+ if (start>=end)
+ {
+ CursorShapeControlString=cursor_invisible;
+ }
+ else
+ {
+ if (end-start>15)
+ {
+ CursorShapeControlString=cursor_visible;
+ }
+ else
+ {
+ CursorShapeControlString=cursor_normal;
+ }
+ }
+
+ __putp(CursorShapeControlString);
+ term_flush();
+
+ CursorShapeStart=start;
+ CursorShapeEnd=end;
+}
+
+void TDisplayQNX4::GetCursorShape(unsigned &start, unsigned &end)
+{
+ start=CursorShapeStart;
+ end=CursorShapeEnd;
+}
+
+ushort TDisplayQNX4::GetRows()
+{
+ struct winsize win;
+
+ ioctl(fileno(stdin), TIOCGWINSZ, &win);
+
+ return win.ws_row;
+}
+
+ushort TDisplayQNX4::GetCols()
+{
+ struct winsize win;
+
+ ioctl(fileno(stdin), TIOCGWINSZ, &win);
+
+ return win.ws_col;
+}
+
+ushort TDisplayQNX4::GetCrtMode()
+{
+ int x=GetCols();
+ int y=GetRows();
+
+ for (int i=0; i<NUM_MODES; i++)
+ {
+ if ((modes[i].x==x) && (modes[i].y==y))
+ {
+ return modes[i].videomode;
+ }
+ }
+
+ return ((x<<8) | (y & 0x000000FFUL));
+}
+
+void TDisplayQNX4::SetCrtMode(ushort mode)
+{
+ struct winsize win;
+
+ win.ws_col=char((mode>>8) & 0x000000FFUL);
+ win.ws_row=char(mode & 0x000000FFUL);
+ win.ws_xpixel=0;
+ win.ws_ypixel=0;
+
+ if (mode!=0xFFFF)
+ {
+ IgnoreConsoleResizing=1;
+ if (ioctl(fileno(stdin), TIOCSWINSZ, &win)!=-1)
+ {
+ term_relearn_size();
+ }
+ }
+}
+
+int TDisplayQNX4::SetCrtModeRes(unsigned w, unsigned h, int fW, int fH)
+{
+ struct winsize win;
+
+ win.ws_col=w;
+ win.ws_row=h;
+ win.ws_xpixel=0;
+ win.ws_ypixel=0;
+
+ IgnoreConsoleResizing=1;
+ if (ioctl(fileno(stdin), TIOCSWINSZ, &win)!=-1)
+ {
+ term_relearn_size();
+ return 1;
+ }
+
+ return 0;
+}
+
+void TDisplayQNX4::SetCrtModeExt(char* mode)
+{
+ IgnoreConsoleResizing=1;
+ system(mode);
+ term_relearn_size();
+}
+
+int TDisplayQNX4::CheckForWindowSize(void)
+{
+ int ret=0;
+
+ if (ConsoleResizing)
+ {
+ if (IgnoreConsoleResizing)
+ {
+ ret=0;
+ ConsoleResizing=0;
+ IgnoreConsoleResizing=0;
+ }
+ else
+ {
+ ret=1;
+ ConsoleResizing=0;
+ }
+ }
+
+ return ret;
+}
+
+const char* TDisplayQNX4::GetWindowTitle(void)
+{
+ return NULL;
+}
+
+int TDisplayQNX4::SetWindowTitle(const char* name)
+{
+ return 0;
+}
+
+#else
+// Here to generate the dependencies in RHIDE
+#include <tv/qnx4/screen.h>
+#endif // TVOS_UNIX && TVOSf_QNX4
diff --git a/tvision/classes/qnx4/qnx4key.cc b/tvision/classes/qnx4/qnx4key.cc
new file mode 100644
index 0000000..aa7c3fb
--- /dev/null
+++ b/tvision/classes/qnx4/qnx4key.cc
@@ -0,0 +1,288 @@
+/* QNX 4 screen routines source.
+ Copyright (c) 1998-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_unistd
+#define Uses_ctype
+#define Uses_stdlib
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_string
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && defined(TVOSf_QNX4)
+
+#include <termios.h>
+
+#include <tv/qnx4/key.h>
+#include <tv/qnx4/screen.h>
+
+extern "C"
+{
+ #include <sys/term.h>
+ #include <sys/qnxterm.h>
+ #include <sys/qioctl.h>
+ #include <conio.h>
+}
+
+struct termios TGKeyQNX4::saved_attributes;
+
+ushort TGKeyQNX4::keytranslatetable[QNX4_KEYTABLE_SIZE]=
+{
+ 0x0000, kbCtA, kbCtB, kbCtC, kbCtD, kbCtE, kbCtF, kbCtG, /* 0x000-0x007 */ // Low translation table.
+ kbCtH, kbTab, kbCtJ, kbCtK, kbCtL, kbEnter, kbCtN, kbCtO, /* 0x008-0x00F */
+ kbCtP, kbCtQ, kbCtR, kbCtS, kbCtT, kbCtU, kbCtV, kbCtW, /* 0x010-0x017 */
+ kbCtX, kbCtY, kbCtZ, kbEsc, 0x0000, kbCtOpenBrace, kbCt6, kbCtMinus, /* 0x018-0x01F */
+ kbSpace, kbAdmid, kbDobleQuote, kbNumeral, kbDolar, kbPercent, kbAmper, kbQuote, /* 0x020-0x027 */
+ kbOpenPar, kbClosePar, kbAsterisk, kbPlus, kbComma, kbMinus, kbStop, kbSlash, /* 0x028-0x02F */
+ kb0, kb1, kb2, kb3, kb4, kb5, kb6, kb7, /* 0x030-0x037 */
+ kb8, kb9, kbDoubleDot, kbColon, kbLessThan, kbEqual, kbGreaterThan, kbQuestion, /* 0x038-0x03F */
+ kbA_Roba, kbShA, kbShB, kbShC, kbShD, kbShE, kbShF, kbShG, /* 0x040-0x047 */
+ kbShH, kbShI, kbShJ, kbShK, kbShL, kbShM, kbShN, kbShO, /* 0x048-0x04F */
+ kbShP, kbShQ, kbShR, kbShS, kbShT, kbShU, kbShV, kbShW, /* 0x050-0x057 */
+ kbShX, kbShY, kbShZ, kbOpenBrace, kbBackSlash, kbCloseBrace, kbCaret, kbUnderLine, /* 0x058-0x05F */
+ kbQuote, kbA, kbB, kbC, kbD, kbE, kbF, kbG, /* 0x060-0x067 */
+ kbH, kbI, kbJ, kbK, kbL, kbM, kbN, kbO, /* 0x068-0x06F */
+ kbP, kbQ, kbR, kbS, kbT, kbU, kbV, kbW, /* 0x070-0x077 */
+ kbX, kbY, kbZ, kbOpenCurly, kbOr, kbCloseCurly, kbTilde, kbBackSpace, /* 0x077-0x07F */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x080-0x087 */ // International input characters starting here.
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x088-0x08F */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x090-0x097 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x098-0x09F */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0A0-0x0A7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0A8-0x0AF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0B0-0x0B7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0B8-0x0BF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0C0-0x0C7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0C8-0x0CF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0D0-0x0D7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0D8-0x0DF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0E0-0x0E7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0E8-0x0EF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0F0-0x0F7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0F8-0x0FF */
+ 0x0000, 0x0000, kbDown, kbUp, kbLeft, kbRight, kbHome, 0x0000, /* 0x100-0x107 */ // High translation table.
+ 0x0000, kbF1, kbF2, kbF3, kbF4, kbF5, kbF6, kbF7, /* 0x108-0x10F */
+ kbF8, kbF9, kbF10, kbF11, kbF12, kbShF1, kbShF2, kbShF3, /* 0x110-0x117 */
+ kbShF4, kbShF5, kbShF6, kbShF7, kbShF8, kbShF9, kbShF10, kbShF11, /* 0x118-0x11F */
+ kbShF12, kbCtF1, kbCtF2, kbCtF3, kbCtF4, kbCtF5, kbCtF6, kbCtF7, /* 0x120-0x127 */
+ kbCtF8, kbCtF9, kbCtF10, kbCtF11, kbCtF12, kbAlF1, kbAlF2, kbAlF3, /* 0x128-0x12F */
+ kbAlF4, kbAlF5, kbAlF6, kbAlF7, kbAlF8, kbAlF9, kbAlF10, kbAlF11, /* 0x130-0x137 */
+ kbAlF12, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x138-0x13F */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x140-0x147 */
+ kbCtDelete, kbCtInsert, kbDelete, kbInsert, kbAlInsert, kbAlA, kbAlDelete, kbAlEnd, /* 0x148-0x14F */
+ 0x0000, 0x0000, kbPgDn, kbPgUp, kbAlB, 0x0000, kbAlD, kbCtEnter, /* 0x150-0x157 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x158-0x15F */
+ 0x0000, kbShTab, 0x0000, kbMinus, kbAlC, 0x0000, 0x0000, 0x0000, /* 0x160-0x167 */ // FIXME: kbMinus is a gray minus.
+ kbEnd, kbCtEnd, kbAlF, kbAlH, kbAlM, kbAlE, kbAlI, 0x0000, /* 0x168-0x16F */
+ kbAlO, kbAlK, 0x0000, kbCtBackSpace, kbAlL, kbAlG, kbAlR, kbAlJ, /* 0x170-0x177 */
+ kbAlP, kbAlQ, kbAlN, 0x0000, 0x0000, kbAlS, kbAlT, 0x0000, /* 0x178-0x17F */
+ kbAlV, kbPlus, 0x0000, 0x0000, kbAlW, kbAlX, kbAlY, kbCtHome, /* 0x180-0x187 */ // FIXME: kbPlus - plus is gray.
+ kbShEnter, kbCtLeft, 0x0000, 0x0000, kbCtPgDn, kbAlZ, kbCtPgUp, 0x0000, /* 0x187-0x18F */ // FIXME: Code 0x18F - is Ctrl-PrintScreen and Ctrl-Asterisk.
+ 0x0000, kbAlEnter, kbCtRight, kbShBackSpace, 0x0000, kbAlMinus, kbAlBackSpace, 0x0000, /* 0x190-0x197 */ // FIXME: kbAlMinus is a Alt + gray Minus. Code 0x197 - is Alt-PrintScreen.
+ kbAlU, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x198-0x19F */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1A0-0x1A7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1A8-0x1AF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1B0-0x1B7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1B8-0x1BF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1C0-0x1C7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1C8-0x1CF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1D0-0x1D7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1D8-0x1DF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1E0-0x1E7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1E8-0x1EF */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1F0-0x1F7 */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 /* 0x1F8-0x1FF */
+};
+
+void TGKeyQNX4::Init()
+{
+ TGKey::kbhit=TGKeyQNX4::KbHit;
+ TGKey::clear=TGKeyQNX4::Clear;
+ TGKey::gkey=TGKeyQNX4::GKey;
+ TGKey::Resume=TGKeyQNX4::Resume;
+ TGKey::Suspend=TGKeyQNX4::Suspend;
+ TGKey::fillTEvent=TGKeyQNX4::FillTEvent;
+ TGKey::getShiftState=TGKeyQNX4::GetShiftState;
+}
+
+int TGKeyQNX4::KbHit()
+{
+ int key;
+ int tempkey;
+
+ key=::kbhit();
+
+ if (!key)
+ {
+ __nodelay(0, 1);
+ tempkey=term_key();
+ if (tempkey!=-1)
+ {
+ key=1;
+ if (tempkey==K_RESIZE)
+ {
+ TDisplayQNX4::ConsoleResizing=1;
+ term_relearn_size();
+ }
+ __ungetch(tempkey);
+ }
+ __nodelay(0, 0);
+ }
+
+ return key;
+}
+
+void TGKeyQNX4::Resume()
+{
+ tcgetattr(fileno(stdin), &saved_attributes);
+}
+
+void TGKeyQNX4::Suspend()
+{
+ tcsetattr(fileno(stdin), TCSANOW, &saved_attributes);
+}
+
+void TGKeyQNX4::Clear()
+{
+ tcflush(fileno(stdin), TCIFLUSH);
+}
+
+ushort TGKeyQNX4::GKey()
+{
+ return term_key();
+}
+
+void TGKeyQNX4::FillTEvent(TEvent &e)
+{
+ ushort fullcode;
+ unsigned shiftstate;
+
+ shiftstate=GetShiftState();
+ fullcode=GKey();
+
+ if (fullcode<QNX4_KEYTABLE_SIZE)
+ {
+ e.keyDown.keyCode=keytranslatetable[fullcode];
+ }
+ else
+ {
+ e.keyDown.keyCode=0x0000;
+ }
+
+ if ((fullcode>0x001F) && (fullcode<0x0100))
+ {
+ e.keyDown.charScan.charCode=fullcode;
+ }
+ else
+ {
+ e.keyDown.charScan.charCode=0;
+ }
+
+ e.keyDown.shiftState=shiftstate;
+
+ if ((e.keyDown.keyCode==kbEnter) && (shiftstate & (kbLeftCtrl | kbRightCtrl)))
+ {
+ e.keyDown.keyCode=kbCtM;
+ }
+
+ // qnxterm keyboard hack.
+ if (e.keyDown.keyCode==kbCtJ)
+ {
+ if (shiftstate & (kbLeftCtrl | kbRightCtrl))
+ {
+ e.keyDown.keyCode=kbCtJ;
+ }
+ else
+ {
+ e.keyDown.keyCode=kbEnter;
+ }
+ }
+
+ if ((e.keyDown.keyCode==kbTab) && (shiftstate & (kbLeftCtrl | kbRightCtrl)))
+ {
+ e.keyDown.keyCode=kbCtI;
+ }
+
+ if (shiftstate & (kbLeftShift | kbRightShift))
+ {
+ switch(e.keyDown.keyCode)
+ {
+ case kbLeft:
+ e.keyDown.keyCode=kbShLeft;
+ break;
+ case kbRight:
+ e.keyDown.keyCode=kbShRight;
+ break;
+ case kbUp:
+ e.keyDown.keyCode=kbShUp;
+ break;
+ case kbDown:
+ e.keyDown.keyCode=kbShDown;
+ break;
+ case kbHome:
+ e.keyDown.keyCode=kbShHome;
+ break;
+ case kbEnd:
+ e.keyDown.keyCode=kbShEnd;
+ break;
+ case kbPgDn:
+ e.keyDown.keyCode=kbShPgDn;
+ break;
+ case kbPgUp:
+ e.keyDown.keyCode=kbShPgUp;
+ break;
+ case kbInsert:
+ e.keyDown.keyCode=kbShInsert;
+ break;
+ case kbDelete:
+ e.keyDown.keyCode=kbShDelete;
+ break;
+ }
+ }
+
+ if ((shiftstate & (kbLeftShift | kbRightShift)) && (e.keyDown.keyCode==kb0))
+ {
+ e.keyDown.charScan.charCode=0;
+ e.keyDown.keyCode=kbShInsert; // on numeric keypad.
+ }
+
+ if ((shiftstate & (kbLeftShift | kbRightShift)) && (e.keyDown.keyCode==kbStop))
+ {
+ e.keyDown.charScan.charCode=0;
+ e.keyDown.keyCode=kbShDelete; // on numeric keypad.
+ }
+
+ e.what=evKeyDown;
+}
+
+unsigned TGKeyQNX4::GetShiftState()
+{
+ unsigned ModState=0x00000000UL;
+
+ char SendBuffer[0x08]={0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ char RecvBuffer[0x04]={0x00, 0x00, 0x00, 0x00};
+
+ qnx_ioctl(fileno(stdin), QCTL_DEV_CTL, SendBuffer, 0x08, RecvBuffer, 0x04);
+
+ if (RecvBuffer[0x02]&0x01) ModState|=kbLeftShift | kbRightShift;
+ if (RecvBuffer[0x02]&0x02) ModState|=kbLeftCtrl | kbRightCtrl;
+ if (RecvBuffer[0x02]&0x04) ModState|=kbLeftAlt | kbRightAlt;
+
+ return ModState;
+}
+
+#else
+
+ // Here to generate the dependencies in RHIDE
+ #include <tv/qnx4/key.h>
+
+#endif // TVOS_UNIX && TVOSf_QNX4
diff --git a/tvision/classes/qnx4/qnx4mouse.cc b/tvision/classes/qnx4/qnx4mouse.cc
new file mode 100644
index 0000000..d892af1
--- /dev/null
+++ b/tvision/classes/qnx4/qnx4mouse.cc
@@ -0,0 +1,254 @@
+/* QNX 4 screen routines source.
+ Copyright (c) 1998-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#include <tv/configtv.h>
+
+#if defined(TVOS_UNIX) && defined(TVOSf_QNX4)
+
+#define Uses_stdlib
+#define Uses_string
+#define Uses_stdio
+#define Uses_time
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TScreen
+#include <tv.h>
+
+extern "C"
+{
+ #include <sys/term.h>
+ #include <sys/qnxterm.h>
+}
+
+#include <tv/qnx4/screen.h>
+#include <tv/qnx4/mouse.h>
+
+int THWMouseQNX4::MousePositionX=0;
+int THWMouseQNX4::MousePositionY=0;
+int THWMouseQNX4::MouseButtons=0;
+ushort THWMouseQNX4::ConsoleMode=QNX_CONSOLE_RAW;
+
+THWMouseQNX4::~THWMouseQNX4()
+{
+ // this destructor is never called !
+ // instead of it ::Suspend method called.
+}
+
+void THWMouseQNX4::Init(ushort mousemode)
+{
+ ConsoleMode=mousemode;
+
+ if (ConsoleMode!=QNX_CONSOLE_RAW)
+ {
+ // a bit of black magic :)
+ printf("\x1B""/""0""t"); // clear mouse options.
+ printf("\x1B""/"">""1""h"); // enable clicking events (press).
+ printf("\x1B""/"">""6""h"); // enable clicking events. (release).
+ printf("\x1B""/"">""7""h"); // enable movement events.
+ printf("\x1B""/"">""9""l"); // intercept all stuff (X10 mouse events reporting).
+ fflush(stdout);
+ }
+
+ if (term_mouse_on()==0)
+ {
+ buttonCount=3;
+ }
+ else
+ {
+ if (ConsoleMode==QNX_CONSOLE_XQSH)
+ {
+ // under qnxterm mouse is not detected by termlib.
+ buttonCount=3;
+ }
+ else
+ {
+ buttonCount=0;
+ }
+ }
+
+ term_mouse_handler(MouseHandler);
+
+ if (ConsoleMode==QNX_CONSOLE_PTERM)
+ {
+ term_mouse_flags(TERM_MOUSE_RELEASE | TERM_MOUSE_ADJUST | TERM_MOUSE_MENU | TERM_MOUSE_SELECT,
+ TERM_MOUSE_RELEASE | TERM_MOUSE_ADJUST | TERM_MOUSE_MENU | TERM_MOUSE_SELECT);
+ };
+
+ THWMouse::Show=Show;
+ THWMouse::Hide=Hide;
+ THWMouse::Suspend=Suspend;
+ THWMouse::Resume=Resume;
+ THWMouse::GetEvent=GetEvent;
+}
+
+void THWMouseQNX4::Show()
+{
+ if (term_mouse_on()==0)
+ {
+ buttonCount=3;
+ }
+ else
+ {
+ if (ConsoleMode==QNX_CONSOLE_XQSH)
+ {
+ // under qnxterm mouse is not detected by termlib.
+ buttonCount=3;
+ }
+ else
+ {
+ buttonCount=0;
+ }
+ }
+
+ term_mouse_move(-1, -1);
+ term_flush();
+}
+
+void THWMouseQNX4::Hide()
+{
+ buttonCount=0;
+ term_mouse_hide();
+ term_flush();
+}
+
+void THWMouseQNX4::Suspend()
+{
+ buttonCount=0;
+ term_mouse_off();
+ term_flush();
+
+ if (ConsoleMode!=QNX_CONSOLE_RAW)
+ {
+ printf("\x1B""/""0""t"); // clear all mouse options.
+ printf("\x1B""/"">""1""l"); // disable clicking events (press).
+ printf("\x1B""/"">""6""l"); // disable clicking events. (release).
+ printf("\x1B""/"">""7""l"); // disable movement events.
+ printf("\x1B""/"">""9""h"); // release hook (Disable X10 mouse events reporting).
+ fflush(stdout);
+ }
+}
+
+void THWMouseQNX4::Resume()
+{
+ if (term_mouse_on()==0)
+ {
+ buttonCount=3;
+ }
+ else
+ {
+ if (ConsoleMode==QNX_CONSOLE_XQSH)
+ {
+ // under qnxterm mouse is not detected by termlib.
+ buttonCount=3;
+ }
+ else
+ {
+ buttonCount=0;
+ }
+ }
+
+ if (ConsoleMode!=QNX_CONSOLE_RAW)
+ {
+ // a bit of black magic :)
+ printf("\x1B""/""0""t"); // clear mouse options.
+ printf("\x1B""/"">""1""h"); // enable clicking events (press).
+ printf("\x1B""/"">""6""h"); // enable clicking events. (release).
+ printf("\x1B""/"">""7""h"); // enable movement events.
+ printf("\x1B""/"">""9""l"); // intercept all stuff (X10 mouse events reporting).
+ fflush(stdout);
+ }
+}
+
+int THWMouseQNX4::MouseHandler(unsigned int* key, struct mouse_event* event)
+{
+ if (term_mouse_process(key, event))
+ {
+ return 1;
+ }
+ term_mouse_move(-1, -1);
+
+ if (event==NULL)
+ {
+ // special case for the pterm.
+ MousePositionX = term_state.mouse_col;
+ MousePositionY = term_state.mouse_row;
+
+ if ((key!=NULL) && (*key!=0x00000000UL))
+ {
+ if ((*key & K_MOUSE_POS) == K_MOUSE_POS)
+ {
+ if ((*key & K_MOUSE_BSELECT) == K_MOUSE_BSELECT)
+ {
+ if ((*key & K_MOUSE_CLICK) == K_MOUSE_CLICK)
+ {
+ MouseButtons|=mbLeftButton; // left button;
+ }
+ if ((*key & K_MOUSE_RELEASE) == K_MOUSE_RELEASE)
+ {
+ MouseButtons&=~mbLeftButton; // left button;
+ }
+ }
+ if ((*key & K_MOUSE_BADJUST) == K_MOUSE_BADJUST)
+ {
+ if ((*key & K_MOUSE_CLICK) == K_MOUSE_CLICK)
+ {
+ MouseButtons|=mbMiddleButton; // middle button;
+ }
+ if ((*key & K_MOUSE_RELEASE) == K_MOUSE_RELEASE)
+ {
+ MouseButtons&=~mbMiddleButton; // middle button;
+ }
+ }
+ if ((*key & K_MOUSE_BMENU) == K_MOUSE_BMENU)
+ {
+ if ((*key & K_MOUSE_CLICK) == K_MOUSE_CLICK)
+ {
+ MouseButtons|=mbRightButton; // right button;
+ }
+ if ((*key & K_MOUSE_RELEASE) == K_MOUSE_RELEASE)
+ {
+ MouseButtons&=~mbRightButton; // right button;
+ }
+ }
+ }
+ }
+
+ return 0;
+ }
+
+ MouseButtons=0;
+ if (event->buttons&_MOUSE_LEFT)
+ {
+ MouseButtons|=mbLeftButton; // left button;
+ }
+ if (event->buttons & _MOUSE_RIGHT)
+ {
+ MouseButtons|=mbRightButton; // right button;
+ }
+ if (event->buttons & _MOUSE_MIDDLE)
+ {
+ MouseButtons|=mbMiddleButton; // middle button;
+ }
+
+ MousePositionX = term_state.mouse_col;
+ MousePositionY = term_state.mouse_row;
+
+ return 0;
+}
+
+void THWMouseQNX4::GetEvent(MouseEventType &me)
+{
+ me.buttons=MouseButtons;
+ me.doubleClick = False;
+ me.where.x = MousePositionX;
+ me.where.y = MousePositionY;
+}
+
+#else
+
+ // Here to generate the dependencies in RHIDE
+ #include <tv/qnx4/screen.h>
+ #include <tv/qnx4/mouse.h>
+
+#endif // TVOS_UNIX && TVOSf_QNX4
diff --git a/tvision/classes/qnx4/qnx4scr.cc b/tvision/classes/qnx4/qnx4scr.cc
new file mode 100644
index 0000000..05fdfda
--- /dev/null
+++ b/tvision/classes/qnx4/qnx4scr.cc
@@ -0,0 +1,723 @@
+/* QNX 4 screen routines source.
+ Copyright (c) 1998-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#include <tv/configtv.h>
+
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TGKey
+#define Uses_TVCodePage
+#define Uses_string
+#define Uses_ctype
+#define Uses_stdio
+#define Uses_unistd
+#define Uses_fcntl
+#define Uses_stdlib
+#define Uses_sys_stat
+
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && defined(TVOSf_QNX4)
+
+#include <termios.h>
+
+#include <tv/qnx4/screen.h>
+#include <tv/qnx4/mouse.h>
+#include <tv/qnx4/key.h>
+
+extern "C"
+{
+ #include <sys/dev.h>
+ #include <sys/term.h>
+ #include <sys/qnxterm.h>
+}
+
+TScreen* TV_QNX4DriverCheck()
+{
+ TScreenQNX4* drv=new TScreenQNX4();
+
+ if (!TScreen::initialized)
+ {
+ delete drv;
+
+ return 0;
+ }
+
+ return drv;
+}
+
+unsigned char TScreenQNX4::DefaultRadioButton = 0x07;
+cc_t TScreenQNX4::oldKeys[5];
+ushort TScreenQNX4::oldScreenSizeX=0;
+ushort TScreenQNX4::oldScreenSizeY=0;
+ushort TScreenQNX4::ForceModeChange=0;
+ushort* TScreenQNX4::UserScreenData=NULL;
+
+TScreenQNX4::TScreenQNX4()
+{
+ char* terminaltype;
+ int len;
+
+ terminaltype=getenv("TERM");
+ if (terminaltype==NULL)
+ {
+ return;
+ }
+ if (strlen(terminaltype)<3)
+ {
+ return;
+ }
+ if (memcmp(terminaltype, "qnx", 3)!=0)
+ {
+ return;
+ }
+
+ SpecialKeysDisable(fileno(stdin));
+
+ TDisplayQNX4::Init();
+
+ if (!InitTermLib())
+ {
+ return;
+ }
+
+ if (dCB) dCB();
+
+ // Added by SET:
+ // Look for user settings
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+
+ // User settings have more priority than detected settings
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : TVCodePage::PC437,
+ forcedScrCP!=-1 ? forcedScrCP : TVCodePage::PC437,
+ forcedInpCP!=-1 ? forcedInpCP : TVCodePage::PC437);
+ SetDefaultCodePages(TVCodePage::PC437,TVCodePage::PC437,TVCodePage::PC437);
+
+ suspended=0;
+
+ startupCursor=getCursorType();
+ screenMode=startupMode=getCrtMode();
+
+ /* save the user screen contents */
+ TScreen::screenWidth =getCols();
+ TScreen::screenHeight=getRows();
+
+ UserScreenData=new ushort[TScreen::screenWidth*TScreen::screenHeight];
+ for (int i=0; i<TScreen::screenHeight; i++)
+ {
+ term_save_image(i, 0, (char*)(UserScreenData+i*TScreen::screenWidth), TScreen::screenWidth);
+ }
+
+ flags0 = CanSetVideoSize | CursorShapes;
+
+ SetVideoMode(screenMode);
+
+ TScreen::screenWidth=GetRows();
+ TScreen::screenWidth=GetCols();
+
+ screenBuffer=new ushort[TScreen::screenWidth * TScreen::screenHeight];
+ len=TScreen::screenWidth * TScreen::screenHeight;
+ for (int i=0; i<len; i++)
+ {
+ screenBuffer[i] = 0x0720;
+ }
+
+ TScreen::Resume=Resume;
+ TScreen::Suspend=Suspend;
+ TScreen::setCrtData=SetCrtData;
+ TScreen::setVideoMode=SetVideoMode;
+ TScreen::setVideoModeRes_p=SetVideoModeRes;
+ TScreen::setVideoModeExt=SetVideoModeExt;
+ TScreen::getCharacters=getCharacters;
+ TScreen::getCharacter=getCharacter;
+ TScreen::setCharacter=setCharacter;
+ TScreen::setCharacters=setCharacters;
+ TScreen::System_p=System;
+ TScreen::fixCrtMode=FixCrtMode;
+
+ TGKeyQNX4::Init();
+ THWMouseQNX4::Init(ConsoleMode);
+
+ term_flush();
+ initialized=1;
+}
+
+TScreenQNX4::~TScreenQNX4()
+{
+ if ((initialized) && (!suspended))
+ {
+ term_color(TERM_WHITE | TERM_BLACK_BG);
+ term_clear(TERM_CLS_SCR);
+ term_flush();
+ }
+
+ if (initialized)
+ {
+ setCursorType(startupCursor);
+ }
+
+ if (screenBuffer)
+ {
+ DeleteArray(screenBuffer);
+ screenBuffer=NULL;
+ }
+
+ SpecialKeysRestore(fileno(stdin));
+
+ setVideoMode(startupMode);
+
+ if (initialized)
+ {
+ /* restore the user screen contents */
+ TScreen::screenWidth =getCols();
+ TScreen::screenHeight=getRows();
+
+ if (UserScreenData!=NULL)
+ {
+ for (int i=0; i<TScreen::screenHeight; i++)
+ {
+ term_cur(i, 0);
+ term_restore_image(i, 0, (char*)(UserScreenData+i*TScreen::screenWidth), TScreen::screenWidth);
+ }
+ DeleteArray(UserScreenData);
+ UserScreenData=NULL;
+ }
+ }
+}
+
+int TScreenQNX4::InitTermLib()
+{
+ _dev_info_entry DeviceInfo;
+
+ if (term_load()<0)
+ {
+ return 0;
+ }
+
+ term_video_on();
+ term_resize_on();
+ term_box_off();
+
+ dev_info(fileno(stdin), &DeviceInfo);
+ if (strcmp(DeviceInfo.driver_type, "console")==0)
+ {
+ ConsoleMode=QNX_CONSOLE_RAW;
+ DefaultRadioButton=0x07;
+ }
+ else
+ {
+ if (getenv("WINDOWID")==NULL)
+ {
+ ConsoleMode=QNX_CONSOLE_PTERM;
+ DefaultRadioButton=0xFE;
+ }
+ else
+ {
+ ConsoleMode=QNX_CONSOLE_XQSH;
+ DefaultRadioButton=0xFE;
+ }
+ }
+
+ dev_mode(fileno(stdin), _DEV_OPOST, _DEV_OPOST);
+}
+
+void TScreenQNX4::Resume()
+{
+ SetCrtData();
+
+ if ((oldScreenSizeX!=TScreen::screenWidth) || (oldScreenSizeY!=TScreen::screenHeight))
+ {
+ TDisplayQNX4::ConsoleResizing=1;
+ ForceModeChange=1;
+ }
+
+ for (int i=0; i<oldScreenSizeY; i++)
+ {
+ term_cur(i, 0);
+ term_restore_image(i, 0, (char*)(screenBuffer+i*oldScreenSizeX), oldScreenSizeX);
+ }
+}
+
+void TScreenQNX4::Suspend()
+{
+ setCursorType(startupCursor);
+
+ oldScreenSizeX=TScreen::screenWidth;
+ oldScreenSizeY=TScreen::screenHeight;
+
+ term_color(TERM_WHITE | TERM_BLACK_BG);
+ term_clear(TERM_CLS_SCR);
+ term_flush();
+}
+
+void TScreenQNX4::SetCrtData()
+{
+ TScreen::screenMode = getCrtMode();
+ TScreen::screenWidth = getCols();
+ TScreen::screenHeight= getRows();
+ TScreen::hiResScreen = Boolean(screenHeight > 25);
+ TScreen::cursorLines = getCursorType();
+ setCursorType(0);
+}
+
+void TScreenQNX4::SetVideoMode(ushort mode)
+{
+ int oldWidth=TScreen::screenWidth;
+ int oldHeight=TScreen::screenHeight;
+ ushort _rows=25;
+ ushort _cols=80;
+
+ SetCrtMode(FixCrtMode(mode));
+ SetCrtData();
+
+ if ((oldWidth!=TScreen::screenWidth) || (oldHeight!=TScreen::screenHeight) || (ForceModeChange))
+ {
+ if (screenBuffer)
+ {
+ DeleteArray(screenBuffer);
+ screenBuffer=NULL;
+ }
+ screenBuffer = new ushort[screenWidth*screenHeight];
+
+ memset(screenBuffer, 0, screenWidth*screenHeight*sizeof(ushort));
+
+ ForceModeChange=0;
+ }
+ else
+ {
+ // restore screen contents if mode not setted up.
+ if (screenBuffer!=NULL)
+ {
+ for (int i=0; i<oldScreenSizeY; i++)
+ {
+ term_cur(i, 0);
+ term_restore_image(i, 0, (char*)(screenBuffer+i*TScreen::screenWidth), TScreen::screenWidth);
+ }
+ }
+ }
+}
+
+int TScreenQNX4::SetVideoModeRes(unsigned w, unsigned h, int fW, int fH)
+{
+ int oldWidth=TScreen::screenWidth;
+ int oldHeight=TScreen::screenHeight;
+
+ setCrtModeRes(w, h, fW, fH);
+ SetCrtData();
+
+ if ((oldWidth!=TScreen::screenWidth) || (oldHeight!=TScreen::screenHeight) || (ForceModeChange))
+ {
+ if (screenBuffer)
+ {
+ DeleteArray(screenBuffer);
+ screenBuffer=NULL;
+ }
+ screenBuffer = new ushort[screenWidth*screenHeight];
+ memset(screenBuffer, 0, screenWidth*screenHeight*sizeof(ushort));
+ ForceModeChange=0;
+ }
+ else
+ {
+ // restore screen contents if mode not setted up.
+ for (int i=0; i<oldScreenSizeY; i++)
+ {
+ term_cur(i, 0);
+ term_restore_image(i, 0, (char*)screenBuffer+i*TScreen::screenWidth*2, TScreen::screenWidth);
+ }
+ }
+}
+
+void TScreenQNX4::SetVideoModeExt(char* mode)
+{
+ int oldWidth=TScreen::screenWidth;
+ int oldHeight=TScreen::screenHeight;
+
+ setCrtModeExt(mode);
+ SetCrtData();
+
+ if ((oldWidth!=TScreen::screenWidth) || (oldHeight!=TScreen::screenHeight) || (ForceModeChange))
+ {
+ if (screenBuffer)
+ {
+ DeleteArray(screenBuffer);
+ screenBuffer=NULL;
+ }
+ screenBuffer = new ushort[screenWidth*screenHeight];
+ memset(screenBuffer, 0, screenWidth*screenHeight*sizeof(ushort));
+ ForceModeChange=0;
+ }
+ else
+ {
+ // restore screen contents if mode not setted up.
+ for (int i=0; i<oldScreenSizeY; i++)
+ {
+ term_cur(i, 0);
+ term_restore_image(i, 0, (char*)screenBuffer+i*TScreen::screenWidth*2, TScreen::screenWidth);
+ }
+ }
+}
+
+void TScreenQNX4::getCharacters(unsigned offset, ushort* buf, unsigned count)
+{
+ memcpy(buf,screenBuffer+offset,count*sizeof(ushort));
+}
+
+ushort TScreenQNX4::getCharacter(unsigned dst)
+{
+ ushort src;
+
+ getCharacters(dst, &src, 1);
+
+ return src;
+}
+
+void TScreenQNX4::setCharacters(unsigned dst, ushort* src, unsigned len)
+{
+ ushort *old = screenBuffer + dst;
+ ushort *old_right = old + len - 1;
+ ushort *src_right = src + len - 1;
+
+ while (len > 0 && *old == *src)
+ {
+ dst++;
+ len--;
+ old++;
+ src++;
+ }
+ while (len > 0 && *old_right == *src_right)
+ {
+ len--;
+ old_right--;
+ src_right--;
+ }
+
+ if (len > 0)
+ {
+ int x = dst % TScreen::screenWidth;
+ int y = dst / TScreen::screenWidth;
+ unsigned char* oldchar = (unsigned char*) old;
+ unsigned char* srcchar = (unsigned char*) src;
+
+ if (ConsoleMode!=QNX_CONSOLE_RAW)
+ {
+ if (ConsoleMode==QNX_CONSOLE_PTERM)
+ {
+ unsigned char* oldchar = (unsigned char*) old;
+ unsigned char* srcchar = (unsigned char*) src;
+
+ for (int EachSymbol=0; EachSymbol<len; EachSymbol++)
+ {
+ *(oldchar+EachSymbol*2)=*(srcchar+EachSymbol*2); // symbol
+ *(oldchar+EachSymbol*2+1)=*(srcchar+EachSymbol*2+1); // attribute
+ if (*(oldchar+EachSymbol*2)<0x20)
+ {
+ switch (*(oldchar+EachSymbol*2))
+ {
+ case 0x00:
+ case 0x01:
+ case 0x02:
+ case 0x03:
+ case 0x04:
+ case 0x05:
+ case 0x06:
+ case 0x08:
+ case 0x09:
+ case 0x0A:
+ case 0x0B:
+ case 0x0C:
+ case 0x0D:
+ *(oldchar+EachSymbol*2)=0x20;
+ break;
+ case 0x1B: *(oldchar+EachSymbol*2)='-';
+ break;
+ case 0x07: *(oldchar+EachSymbol*2)=TScreenQNX4::DefaultRadioButton;
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ unsigned char* oldchar = (unsigned char*) old;
+ unsigned char* srcchar = (unsigned char*) src;
+
+ for (int EachSymbol=0; EachSymbol<len; EachSymbol++)
+ {
+ *(oldchar+EachSymbol*2)=*(srcchar+EachSymbol*2); // symbol
+ *(oldchar+EachSymbol*2+1)=*(srcchar+EachSymbol*2+1); // attribute
+ if (*(oldchar+EachSymbol*2)<0x20)
+ {
+ switch(*(oldchar+EachSymbol*2))
+ {
+ case 0x00:
+ case 0x01:
+ case 0x02:
+ case 0x03:
+ case 0x04:
+ case 0x05:
+ case 0x06: *(oldchar+EachSymbol*2)=0x20;
+ break;
+ case 0x07: *(oldchar+EachSymbol*2)=TScreenQNX4::DefaultRadioButton;
+ break;
+ case 0x08:
+ case 0x09:
+ case 0x0A:
+ case 0x0B:
+ case 0x0C:
+ case 0x0D:
+ case 0x0E:
+ case 0x0F: *(oldchar+EachSymbol*2)=0x20;
+ break;
+ case 0x10: *(oldchar+EachSymbol*2)='>';
+ break;
+ case 0x11: *(oldchar+EachSymbol*2)='<';
+ break;
+ case 0x12: *(oldchar+EachSymbol*2)='|';
+ break;
+ case 0x13:
+ case 0x14:
+ case 0x15:
+ case 0x16:
+ case 0x17:
+ case 0x18: *(oldchar+EachSymbol*2)='^';
+ break;
+ case 0x19: *(oldchar+EachSymbol*2)='v';
+ break;
+ case 0x1A: *(oldchar+EachSymbol*2)='<';
+ break;
+ case 0x1B: *(oldchar+EachSymbol*2)='>';
+ break;
+ case 0x1C: *(oldchar+EachSymbol*2)='_';
+ break;
+ case 0x1D: *(oldchar+EachSymbol*2)='-';
+ break;
+ case 0x1E: *(oldchar+EachSymbol*2)='^';
+ break;
+ case 0x1F: *(oldchar+EachSymbol*2)='v';
+ break;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ memcpy(oldchar, srcchar, len*2);
+ }
+
+ if (ConsoleMode!=QNX_CONSOLE_RAW) // pterm and qnxterm bug elimination
+ {
+ if (y>TScreen::screenWidth/2)
+ {
+ term_cur(0, 0);
+ }
+ else
+ {
+ term_cur(TScreen::screenHeight-1, 0);
+ }
+ term_flush();
+
+ term_cur(y, x);
+ term_flush();
+ }
+
+ term_restore_image(y, x, (char*)old, len);
+ term_flush();
+
+ if (ConsoleMode!=QNX_CONSOLE_RAW)
+ {
+ TDisplayQNX4::SetCursorPos(CursorLastX, CursorLastY);
+ }
+ }
+}
+
+void TScreenQNX4::setCharacter(unsigned offset, ushort value)
+{
+ setCharacters(offset, &value, 1);
+}
+
+int TScreenQNX4::System(const char *command, pid_t* pidChild, int in, int out, int err)
+{
+ char *argv[4];
+
+ if (!pidChild)
+ {
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+ }
+
+ pid_t cpid=fork();
+
+ if (cpid==0)
+ {
+ if (setsid()==-1)
+ {
+ _exit(127);
+ }
+
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+
+ argv[0]=newStr(getenv("SHELL"));
+ if (!argv[0])
+ argv[0]=newStr("/bin/sh");
+ argv[1]=newStr("-c");
+ argv[2]=newStr(command);
+ argv[3]=NULL;
+ execvp(argv[0],argv);
+ delete[] argv[0];
+ delete[] argv[1];
+ delete[] argv[2];
+ _exit(127);
+ }
+
+ if (cpid==-1)
+ {
+ *pidChild=0;
+
+ return system(command);
+ }
+
+ *pidChild=cpid;
+
+ return 0;
+}
+
+void TScreenQNX4::SpecialKeysDisable(int fd)
+{
+ struct termios terminal;
+
+ tcgetattr(fd, &terminal);
+ oldKeys[0]=terminal.c_cc[VSUSP];
+ oldKeys[1]=terminal.c_cc[VSTART];
+ oldKeys[2]=terminal.c_cc[VSTOP];
+ oldKeys[3]=terminal.c_cc[VQUIT];
+ oldKeys[4]=terminal.c_cc[VINTR];
+ terminal.c_cc[VSUSP] =0;
+ terminal.c_cc[VSTART]=0;
+ terminal.c_cc[VSTOP] =0;
+ terminal.c_cc[VQUIT] =0;
+ terminal.c_cc[VINTR] =0;
+ tcsetattr(fd, TCSANOW, &terminal);
+}
+
+void TScreenQNX4::SpecialKeysRestore(int fd)
+{
+ struct termios terminal;
+
+ tcgetattr(fd, &terminal);
+ terminal.c_cc[VSUSP] =oldKeys[0];
+ terminal.c_cc[VSTART]=oldKeys[1];
+ terminal.c_cc[VSTOP] =oldKeys[2];
+ terminal.c_cc[VQUIT] =oldKeys[3];
+ terminal.c_cc[VINTR] =oldKeys[4];
+ tcsetattr(fd, TCSANOW, &terminal);
+}
+
+
+ushort TScreenQNX4::FixCrtMode(ushort mode)
+{
+ ushort internalmode=0;
+ ushort _rows=25;
+ ushort _cols=80;
+
+ switch(mode)
+ {
+ case smBW80:
+ case smCO80:
+ case smMono:
+ break;
+ case smFont8x8:
+ _rows=50;
+ break;
+ case smCO80x28:
+ _rows=28;
+ break;
+ case smCO80x35:
+ _rows=35;
+ break;
+ case smCO80x40:
+ _rows=40;
+ break;
+ case smCO80x43:
+ _rows=43;
+ break;
+ case smCO80x50:
+ _rows=50;
+ break;
+ case smCO80x30:
+ _rows=30;
+ break;
+ case smCO80x34:
+ _rows=34;
+ break;
+ case smCO90x30:
+ _cols=90;
+ _rows=30;
+ break;
+ case smCO90x34:
+ _cols=90;
+ _rows=34;
+ break;
+ case smCO94x30:
+ _cols=94;
+ _rows=30;
+ break;
+ case smCO94x34:
+ _cols=94;
+ _rows=34;
+ break;
+ case smCO82x25:
+ _cols=82;
+ break;
+ case smCO80x60:
+ _rows=60;
+ break;
+ case smCO132x25:
+ _cols=132;
+ break;
+ case smCO132x43:
+ _cols=132;
+ _rows=43;
+ break;
+ case smCO132x50:
+ _cols=132;
+ _rows=50;
+ break;
+ case smCO132x60:
+ _cols=132;
+ _rows=60;
+ break;
+ default:
+ _cols=(mode & 0x0000FF00UL) >> 8;
+ _rows=(mode & 0x000000FFUL);
+ }
+
+ internalmode=_rows | (_cols << 8);
+
+ return internalmode;
+}
+
+#else
+
+ // Here to generate the dependencies in RHIDE
+ #include <tv/qnx4/screen.h>
+ #include <tv/qnx4/key.h>
+
+#endif // TVOS_UNIX && TVOSf_QNX4
diff --git a/tvision/classes/qnxrtp/qnxdis.cc b/tvision/classes/qnxrtp/qnxdis.cc
new file mode 100644
index 0000000..d805aa5
--- /dev/null
+++ b/tvision/classes/qnxrtp/qnxdis.cc
@@ -0,0 +1,171 @@
+/* QNX RtP screen routines source.
+ Copyright (c) 2002-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_string
+
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && defined(TVOSf_QNXRtP)
+
+#include <termios.h>
+#include <tv/qnxrtp/screen.h>
+
+#include <term.h>
+#include <sys/ioctl.h>
+
+int TDisplayQNXRtP::cur_x=0;
+int TDisplayQNXRtP::cur_y=0;
+
+int TDisplayQNXRtP::tty_fd=-1;
+
+int TDisplayQNXRtP::cursorStart=85;
+int TDisplayQNXRtP::cursorEnd=100;
+
+ushort TDisplayQNXRtP::mode=0;
+
+volatile sig_atomic_t TDisplayQNXRtP::windowSizeChanged=0;
+
+TDisplayQNXRtP::~TDisplayQNXRtP()
+{
+}
+
+void TDisplayQNXRtP::Init()
+{
+ TDisplay::setCursorPos=SetCursorPos;
+ TDisplay::getCursorPos=GetCursorPos;
+ TDisplay::getCursorShape=GetCursorShape;
+ TDisplay::setCursorShape=SetCursorShape;
+ TDisplay::getRows=GetRows;
+ TDisplay::getCols=GetCols;
+ TDisplay::setCrtModeExt=SetCrtModeExt;
+ TDisplay::checkForWindowSize=CheckForWindowSize;
+}
+
+void TDisplayQNXRtP::SetCursorPos(unsigned x, unsigned y)
+{
+ char out[1024], *p = out;
+
+ safeput(p, tparm(cursor_address, y, x));
+ p-=4;
+ write(tty_fd, out, p - out);
+
+ cur_x = x;
+ cur_y = y;
+}
+
+void TDisplayQNXRtP::GetCursorPos(unsigned &x, unsigned &y)
+{
+ y = cur_y;
+ x = cur_x;
+}
+
+void TDisplayQNXRtP::SetCursorShape(unsigned start, unsigned end)
+{
+ char out[1024], *p=out;
+
+ if (start>=end)
+ {
+ safeput(p, tparm(cursor_invisible));
+ write(tty_fd, out, p-out);
+ }
+ else
+ {
+ if (end-start>15)
+ {
+ // It is hack for now. cursor_visible is empty string. Why ???
+ safeput(p, tparm(cursor_normal));
+ safeput(p, tparm(cursor_visible));
+ write(tty_fd, out, p-out);
+ }
+ else
+ {
+ safeput(p, tparm(cursor_normal));
+ write(tty_fd, out, p-out);
+ }
+ }
+ cursorStart=start;
+ cursorEnd=end;
+}
+
+void TDisplayQNXRtP::GetCursorShape(unsigned &start, unsigned &end)
+{
+ start = cursorStart;
+ end = cursorEnd;
+}
+
+ushort TDisplayQNXRtP::GetRows()
+{
+ winsize win;
+
+ win.ws_row=0xFFFF;
+ ioctl(tty_fd, TIOCGWINSZ, &win);
+
+ return win.ws_row!=0xFFFF ? win.ws_row : 25;
+}
+
+ushort TDisplayQNXRtP::GetCols()
+{
+ winsize win;
+
+ win.ws_col=0xFFFF;
+ ioctl(tty_fd, TIOCGWINSZ, &win);
+
+ return win.ws_col!=0xFFFF ? win.ws_col : 80;
+}
+
+void TDisplayQNXRtP::SetCrtMode(ushort mode)
+{
+ TDisplayQNXRtP::mode=mode;
+}
+
+void TDisplayQNXRtP::SetCrtModeExt(char* mode)
+{
+ system(mode);
+}
+
+int TDisplayQNXRtP::CheckForWindowSize(void)
+{
+ int ret;
+
+ ret=windowSizeChanged!=0;
+ windowSizeChanged=0;
+
+ return ret;
+}
+
+const char* TDisplayQNXRtP::GetWindowTitle(void)
+{
+ return NULL;
+}
+
+int TDisplayQNXRtP::SetWindowTitle(const char* name)
+{
+ return 0;
+}
+
+inline void TDisplayQNXRtP::safeput(char* &p, char* cap)
+{
+ if (cap)
+ {
+ while (*cap)
+ {
+ *p++=*cap++;
+ }
+ }
+}
+
+#else
+
+ // Here to generate the dependencies in RHIDE
+ #include <tv/qnxrtp/screen.h>
+
+#endif // TVOS_UNIX && TVOSf_QNXRtP
diff --git a/tvision/classes/qnxrtp/qnxkey.cc b/tvision/classes/qnxrtp/qnxkey.cc
new file mode 100644
index 0000000..61a3f3b
--- /dev/null
+++ b/tvision/classes/qnxrtp/qnxkey.cc
@@ -0,0 +1,477 @@
+/* QNX RtP keyboard handler routines source.
+ Copyright (c) 2002-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_unistd
+#define Uses_ctype
+#define Uses_stdlib
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_string
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && defined(TVOSf_QNXRtP)
+
+/* include main photon header for pterm key modifier support. */
+/* we must include photon headers before all (GUI vs TUI conflict ;) */
+#include <Ph.h>
+
+#include <termios.h>
+
+#include <term.h>
+#include <ncurses.h>
+#include <sys/ioctl.h>
+#include <sys/dcmd_chr.h>
+
+#include <dlfcn.h>
+
+#include <tv/qnxrtp/key.h>
+
+struct dlphoton
+{
+ void* phhandle;
+ struct _Ph_ctrl* phctrl;
+ unsigned short ig;
+ PhCursorInfo_t qcurbuf;
+
+ /* photon functions */
+ struct _Ph_ctrl* (*PhAttach)(char const* name, PhChannelParms_t const* parms);
+ int (*PhDetach)(struct _Ph_ctrl* Ph);
+ int (*PhInputGroup)(PhEvent_t* event);
+ int (*PhQueryCursor)(unsigned short ig, PhCursorInfo_t* buf);
+};
+
+struct dlphoton TGKeyQNXRtP::phcon;
+bool TGKeyQNXRtP::inpterm;
+
+int openph(struct dlphoton* ph);
+int closeph(struct dlphoton* ph);
+int detectph(struct dlphoton* ph);
+unsigned long getkeymodph(struct dlphoton* ph);
+
+int openph(struct dlphoton* ph)
+{
+ ph->phctrl=NULL;
+ ph->ig=0;
+
+ ph->phhandle=dlopen("/usr/lib/libph.so", RTLD_NOW | RTLD_GLOBAL | RTLD_WORLD);
+
+ if (ph->phhandle==NULL)
+ {
+ return -1;
+ }
+
+ (void*)(ph->PhAttach)=dlsym(ph->phhandle, "PhAttach");
+ if (ph->PhAttach==NULL)
+ {
+ closeph(ph);
+ return -3;
+ }
+
+ (void*)ph->PhDetach=dlsym(ph->phhandle, "PhDetach");
+ if (ph->PhDetach==NULL)
+ {
+ closeph(ph);
+ return -4;
+ }
+
+ (void*)ph->PhInputGroup=dlsym(ph->phhandle, "PhInputGroup");
+ if (ph->PhInputGroup==NULL)
+ {
+ closeph(ph);
+ return -5;
+ }
+
+ (void*)ph->PhQueryCursor=dlsym(ph->phhandle, "PhQueryCursor");
+ if (ph->PhQueryCursor==NULL)
+ {
+ closeph(ph);
+ return -6;
+ }
+
+ return 0;
+}
+
+int closeph(struct dlphoton* ph)
+{
+ if (ph->phhandle!=NULL)
+ {
+ if (ph->phctrl!=NULL)
+ {
+ ph->PhDetach(ph->phctrl);
+ }
+ dlclose(ph->phhandle);
+ ph->phhandle=NULL;
+ }
+
+ return 0;
+}
+
+int detectph(struct dlphoton* ph)
+{
+ ph->phctrl=ph->PhAttach(NULL, NULL);
+
+ if(!ph->phctrl)
+ {
+ return -1;
+ }
+
+ ph->ig=ph->PhInputGroup(NULL);
+
+ return 0;
+}
+
+unsigned long getkeymodph(struct dlphoton* ph)
+{
+ int stat;
+
+ stat=ph->PhQueryCursor(ph->ig, &ph->qcurbuf);
+
+ if (stat==-1)
+ {
+ return 0x00000000UL;
+ }
+
+ return ph->qcurbuf.key_mods;
+}
+
+#define kbCtrl (kbLeftCtrl | kbRightCtrl)
+#define kbAlt (kbRightAlt | kbLeftAlt)
+
+struct termios TGKeyQNXRtP::saved_attributes;
+ushort TGKeyQNXRtP::sFlags;
+ushort TGKeyQNXRtP::undecoded;
+
+ushort TGKeyQNXRtP::hightranstable[0x0100]=
+{// 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F
+ 0x0000, 0x0000, kbDown, kbUp, kbLeft, kbRight, kbHome, kbCtH, // 0x0100
+ 0x0000, kbF1, kbF2, kbF3, kbF4, kbF5, kbF6, kbF7, // 0x0108
+ kbF8, kbF9, kbF10, kbF11, kbF12, kbShF1, kbShF2, kbShF3, // 0x0110
+ kbShF4, kbShF5, kbShF6, kbShF7, kbShF8, kbShF9, kbShF10, kbShF11, // 0x0118
+ kbShF12, kbCtF1, kbCtF2, kbCtF3, kbCtF4, kbCtF5, kbCtF6, kbCtF7, // 0x0120
+ kbCtF8, kbCtF9, kbCtF10, kbCtF11, kbCtF12, kbAlF1, kbAlF2, kbAlF3, // 0x0128
+ kbAlF4, kbAlF5, kbAlF6, kbAlF7, kbAlF8, kbAlF9, kbAlF10, kbAlF11, // 0x0130
+ kbAlF12, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0138
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0140
+ kbCtDelete, kbCtInsert, kbDelete, kbInsert, 0x0000, kbAlA, 0x0000, 0x0000, // 0x0148
+ kbCtUp, kbCtDown, kbPgDn, kbPgUp, kbAlB, kbCtTab, kbAlD, 0x0000, // 0x0150
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0158
+ kbShInsert, kbShTab, kbShDelete, kbMinus, kbAlC, kb5, kbCt5, 0x0000, // 0x0160 // FIXME: kbMinus - gray minus, kb5 - numeric 5, kbCt5 - numeric Ctrl-5
+ kbEnd, kbCtEnd, kbAlF, kbAlH, kbAlM, kbAlE, kbAlI, 0x0000, // 0x0168
+ kbAlO, kbAlK, 0x0000, 0x0000, kbAlL, kbAlG, kbAlR, kbAlJ, // 0x0170
+ kbAlP, kbAlQ, kbAlN, kbCtMinus, kbCtPlus, kbAlS, kbAlT, 0x0000, // 0x0178 // FIXME: kbCtMinus and kbCtPlus are gray.
+ kbAlV, kbPlus, 0x0000, 0x0000, kbAlW, kbAlX, kbAlY, kbCtHome, // 0x0180 // FIXME: kbPlus is gray.
+ 0x0000, kbCtLeft, 0x0000, 0x0000, kbCtPgDn, kbAlZ, kbCtPgUp, 0x0000, // 0x0188
+ kbShUp, kbShDown, kbCtRight, kbShLeft, kbShRight, kbShCtLeft, kbShCtRight, kbAlSpace, // 0x0190
+ kbAlU, kbCtBackSpace, kbCtEnter, kbAlEnter, kbShEnter, kbShEnd, kbShHome, kbShPgUp, // 0x0198
+ kbShPgDn, kbShBackSpace, kbCt0, kbCt1, kbCt2, kbCt3, kbCt4, kbCt5, // 0x01A0
+ kbCt6, kbCt7, kbCt8, kbCt9, kbCtSpace, kbShCtTab, kbShCtHome, kbShCtEnd, // 0x01A8
+ kbShCtPgUp, kbShCtPgDn, kbShCtInsert, kbShCt0, kbShCt1, kbShCt2, kbShCt3, kbShCt4, // 0x01B0
+ kbShCt5, kbShCt6, kbShCt7, kbShCt8, kbShCt9, 0x0000, 0x0000, 0x0000, // 0x01B8
+ kbShCtA, kbShCtB, kbShCtC, kbShCtD, kbShCtE, kbShCtF, kbShCtG, kbShCtH, // 0x01C0
+ kbShCtI, kbShCtJ, kbShCtK, kbShCtL, kbShCtM, kbShCtN, kbShCtO, kbShCtP, // 0x01C8
+ kbShCtQ, kbShCtR, kbShCtS, kbShCtT, kbShCtU, kbShCtV, kbShCtW, kbShCtX, // 0x01D0
+ kbShCtY, kbShCtZ, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01D8
+ kbAl0, kbAl1, kbAl2, kbAl3, kbAl4, kbAl5, kbAl6, kbAl7, // 0x01E0
+ kbAl8, kbAl9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, kbCtEsc, // 0x01E8
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01F0
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 // 0x01F8
+};
+
+ushort TGKeyQNXRtP::lowtranstable[0x0100]=
+{// 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F
+ 0x0000, kbCtA, kbCtB, kbCtC, kbCtD, kbCtE, kbCtF, kbCtG, // 0x0000
+ 0x0000, kbTab, kbCtJ, kbCtK, kbCtL, kbEnter, kbCtN, kbCtO, // 0x0008
+ kbCtP, kbCtQ, kbCtR, kbCtS, kbCtT, kbCtU, kbCtV, kbCtW, // 0x0010
+ kbCtX, kbCtY, kbCtZ, kbEsc, kbCtBackSpace, kbCtOpenBrace, 0x0000, 0x0000, // 0x0018
+ kbSpace, kbAdmid, kbDobleQuote, kbNumeral, kbDolar, kbPercent, kbAmper, kbQuote, // 0x0020
+ kbOpenPar, kbClosePar, kbAsterisk, kbPlus, kbComma, kbMinus, kbStop, kbSlash, // 0x0028
+ kb0, kb1, kb2, kb3, kb4, kb5, kb6, kb7, // 0x0030
+ kb8, kb9, kbDoubleDot, kbColon, kbLessThan, kbEqual, kbGreaterThan, kbQuestion, // 0x0038
+ kbA_Roba, kbShA, kbShB, kbShC, kbShD, kbShE, kbShF, kbShG, // 0x0040
+ kbShH, kbShI, kbShJ, kbShK, kbShL, kbShM, kbShN, kbShO, // 0x0048
+ kbShP, kbShQ, kbShR, kbShS, kbShT, kbShU, kbShV, kbShW, // 0x0050
+ kbShX, kbShY, kbShZ, kbOpenBrace, kbBackSlash, kbCloseBrace, kbCaret, kbUnderLine, // 0x0058
+ kbQuote, kbA, kbB, kbC, kbD, kbE, kbF, kbG, // 0x0060
+ kbH, kbI, kbJ, kbK, kbL, kbM, kbN, kbO, // 0x0068
+ kbP, kbQ, kbR, kbS, kbT, kbU, kbV, kbW, // 0x0070
+ kbX, kbY, kbZ, kbOpenCurly, kbOr, kbCloseCurly, kbTilde, kbBackSpace, // 0x0078
+ /* add russian or other keys here */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0080
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0088
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0090
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0098
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00A0
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00A8
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00B0
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00B8
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00C0
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00C8
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00D0
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00D8
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00E0
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00E8
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00F0
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 // 0x00F8
+};
+
+QNXRtPArtKeys TGKeyQNXRtP::shifttranstable[]=
+{
+ {kbLeft, kbShLeft},
+ {kbRight, kbShRight},
+ {kbUp, kbShUp},
+ {kbDown, kbShDown},
+ {kbInsert, kbShInsert},
+ {kbDelete, kbShDelete},
+ {kbHome, kbShHome},
+ {kbEnd, kbShEnd},
+ {kbPgUp, kbShPgUp},
+ {kbPgDn, kbShPgDn},
+ {kbEnter, kbShEnter},
+ {kbBackSpace, kbShBackSpace},
+ {kb0, kbShInsert}, // numeric keypad insert
+ {kbStop, kbShDelete}, // numeric keypad delete
+ {0xFFFF, 0xFFFF} // end of shift modifyier artificial keys list
+};
+
+QNXRtPArtKeys TGKeyQNXRtP::alttranstable[]=
+{
+ {kbEnter, kbAlEnter},
+ {kbSpace, kbAlSpace},
+ {0xFFFF, 0xFFFF} // end of alt modifyier artificial keys list
+};
+
+QNXRtPArtKeys TGKeyQNXRtP::ctrltranstable[]=
+{
+ {kbEnter, kbCtEnter},
+ {kbTab, kbCtI},
+ {kbBackSpace, kbCtBackSpace},
+ {0xFFFF, 0xFFFF} // end of ctrl modifyier artificial keys list
+};
+
+void TGKeyQNXRtP::Resume()
+{
+ tcgetattr(fileno(stdin), &saved_attributes);
+}
+
+void TGKeyQNXRtP::Suspend()
+{
+ tcsetattr(fileno(stdin), TCSANOW, &saved_attributes);
+}
+
+int TGKeyQNXRtP::KbHit()
+{
+ int c;
+
+ c=getch();
+
+ if (c != ERR)
+ {
+ ungetch(c);
+ }
+
+ return c != ERR;
+}
+
+void TGKeyQNXRtP::Clear()
+{
+ tcflush(fileno(stdin), TCIFLUSH);
+}
+
+ushort TGKeyQNXRtP::MakeArtKeys(QNXRtPArtKeys* array, ushort rawkey)
+{
+ int eachkey=0;
+ ushort newkey=rawkey;
+
+ do {
+
+ if ((array[eachkey].rawkey==0xFFFF) &&
+ (array[eachkey].transkey==0xFFFF))
+ {
+ break;
+ }
+
+ if (rawkey==array[eachkey].rawkey)
+ {
+ newkey=array[eachkey].transkey;
+ break;
+ }
+
+ eachkey++;
+
+ } while(1);
+
+ return newkey;
+}
+
+ushort TGKeyQNXRtP::GKey()
+{
+ ushort rawkey;
+
+ rawkey=GetRaw();
+ undecoded=rawkey;
+
+ do {
+ if (rawkey<0x0100)
+ {
+ rawkey=lowtranstable[rawkey];
+ break;
+ }
+
+ if ((rawkey>0x00FF) && (rawkey<0x01FF))
+ {
+ rawkey=hightranstable[rawkey-0x0100];
+ break;
+ }
+ } while(1);
+
+ // artificial keys.
+
+ if (sFlags==0)
+ {
+ return rawkey; // no artificial keys available.
+ }
+
+ if (sFlags==kbShift) // processing only shift key (nor Alt, nor Ctrl)
+ {
+ rawkey=MakeArtKeys(shifttranstable, rawkey);
+ }
+ if (sFlags==kbAlt) // processing only alt key (nor Shift, nor Ctrl)
+ {
+ rawkey=MakeArtKeys(alttranstable, rawkey);
+ }
+ if (sFlags==kbCtrl) // processing only ctrl key (nor Shift, nor Alt)
+ {
+ rawkey=MakeArtKeys(ctrltranstable, rawkey);
+ }
+
+ return rawkey;
+}
+
+unsigned TGKeyQNXRtP::GetShiftState()
+{
+ int shift = 0;
+ int QNXShift = 0;
+ int QNXShiftEx = 0;
+ int DieStatus;
+
+ if (!inpterm)
+ {
+ devctl(fileno(stdin), DCMD_CHR_LINESTATUS, &QNXShift, sizeof(QNXShift), &DieStatus);
+
+ QNXShiftEx=QNXShift & 0xFFFFFF00UL;
+ QNXShift&=0x7F;
+
+ if (QNXShift & _LINESTATUS_CON_ALT)
+ {
+ shift|=(kbRightAlt | kbLeftAlt);
+ }
+
+ if (QNXShift & _LINESTATUS_CON_CTRL)
+ {
+ shift|=(kbRightCtrl | kbLeftCtrl);
+ }
+
+ if (QNXShift & _LINESTATUS_CON_SHIFT)
+ {
+ shift|=(kbRightShift | kbLeftShift);
+ }
+ else
+ {
+ if (QNXShiftEx & 0x00000800UL) // grey keys shift modifyier
+ {
+ shift|=(kbRightShift | kbLeftShift);
+ }
+ }
+ }
+ else
+ {
+ QNXShift=getkeymodph(&phcon);
+
+ if (QNXShift & TVPH_KEY_ALT)
+ {
+ shift|=(kbRightAlt | kbLeftAlt);
+ }
+
+ if (QNXShift & TVPH_KEY_CTRL)
+ {
+ shift|=(kbRightCtrl | kbLeftCtrl);
+ }
+
+ if (QNXShift & TVPH_KEY_SHIFT)
+ {
+ shift|=(kbRightShift | kbLeftShift);
+ }
+ }
+
+ return shift;
+}
+
+void TGKeyQNXRtP::FillTEvent(TEvent &e)
+{
+ ushort fullcode;
+
+ fullcode=GKey();
+
+ if ((undecoded>0x001F)&&(undecoded<0x0100))
+ {
+ e.keyDown.charScan.charCode=(uchar)undecoded;
+ }
+ else
+ {
+ e.keyDown.charScan.charCode=0;
+ }
+
+ e.keyDown.keyCode=fullcode;
+ e.keyDown.shiftState=sFlags;
+ e.what=evKeyDown;
+}
+
+void TGKeyQNXRtP::Init()
+{
+ TGKey::Suspend =TGKeyQNXRtP::Suspend;
+ TGKey::Resume =TGKeyQNXRtP::Resume;
+ TGKey::kbhit =TGKeyQNXRtP::KbHit;
+ TGKey::clear =TGKeyQNXRtP::Clear;
+ TGKey::gkey =TGKeyQNXRtP::GKey;
+ TGKey::getShiftState=TGKeyQNXRtP::GetShiftState;
+ TGKey::fillTEvent =TGKeyQNXRtP::FillTEvent;
+
+ inpterm=false;
+ if (openph(&phcon)==0)
+ {
+ if (detectph(&phcon)==0)
+ {
+ inpterm=true;
+ }
+ }
+
+}
+
+ushort TGKeyQNXRtP::GetRaw()
+{
+ int code;
+
+ if ((code = getch()) == ERR)
+ {
+ sFlags=0;
+ return 0;
+ }
+
+ sFlags=GetShiftState();
+
+ return code;
+}
+
+#else
+
+ // Here to generate the dependencies in RHIDE
+ #include <tv/qnxrtp/key.h>
+
+#endif // TVOS_UNIX && TVOSf_QNXRtP
diff --git a/tvision/classes/qnxrtp/qnxmouse.cc b/tvision/classes/qnxrtp/qnxmouse.cc
new file mode 100644
index 0000000..60a55bb
--- /dev/null
+++ b/tvision/classes/qnxrtp/qnxmouse.cc
@@ -0,0 +1,241 @@
+/* QNX RtP mouse handler routines source.
+ Copyright (c) 2002-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#include <tv/configtv.h>
+
+#if defined(TVOS_UNIX) && defined(TVOSf_QNXRtP)
+
+#define Uses_stdlib
+#define Uses_string
+#define Uses_stdio
+#define Uses_time
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TScreen
+#include <tv.h>
+
+#include <fcntl.h>
+#include <termios.h>
+#include <sys/select.h>
+#include <sys/dcmd_input.h>
+
+#include <tv/qnxrtp/screen.h>
+#include <tv/qnxrtp/mouse.h>
+
+int THWMouseQNXRtP::MousePositionX=0;
+int THWMouseQNXRtP::MousePositionY=0;
+int THWMouseQNXRtP::MouseButtons;
+
+int THWMouseQNXRtP::MouseMickeyPositionX=0;
+int THWMouseQNXRtP::MouseMickeyPositionY=0;
+
+THWMouseQNXRtP::~THWMouseQNXRtP()
+{
+ // this destructor is never called !
+ // instead of it THWMouseQNXRtP::Suspend method called.
+}
+
+int THWMouseQNXRtP::mousehandle=-1;
+
+int THWMouseQNXRtP::OpenDeviMouse()
+{
+ mousehandle=open("/dev/devi/mouse0", O_RDONLY);
+ if (mousehandle==-1)
+ {
+ return 0;
+ }
+
+ MousePositionX=0;
+ MousePositionY=0;
+ MouseButtons=0;
+ MouseMickeyPositionX=0;
+ MouseMickeyPositionY=0;
+
+ return 1;
+}
+
+void THWMouseQNXRtP::CloseDeviMouse()
+{
+ if (mousehandle!=-1)
+ {
+ close(mousehandle);
+ mousehandle=-1;
+ }
+
+ MousePositionX=0;
+ MousePositionY=0;
+ MouseButtons=0;
+ MouseMickeyPositionX=0;
+ MouseMickeyPositionY=0;
+}
+
+void THWMouseQNXRtP::ProcessDeviMouse()
+{
+ fd_set mev;
+ int selectret;
+ struct timeval twait;
+ struct _mouse_packet pkt;
+ int cols=TDisplayQNXRtP::GetCols();
+ int rows=TDisplayQNXRtP::GetRows();
+ int TempMousePositionX=MousePositionX;
+ int TempMousePositionY=MousePositionY;
+
+ FD_ZERO(&mev);
+ FD_SET(mousehandle, &mev);
+
+ twait.tv_sec=0;
+ twait.tv_usec=1;
+
+ selectret=select(mousehandle + 1, &mev, NULL, NULL, &twait);
+ switch (selectret)
+ {
+ case -1:
+ case 0:
+ break;
+ default: if (FD_ISSET(mousehandle, &mev))
+ {
+ selectret=read(mousehandle, &pkt, sizeof(struct _mouse_packet));
+ if (selectret==sizeof(struct _mouse_packet))
+ {
+ MouseMickeyPositionX+=pkt.dx;
+ if (MouseMickeyPositionX<0)
+ {
+ MouseMickeyPositionX=0;
+ }
+ MouseMickeyPositionY-=pkt.dy;
+ if (MouseMickeyPositionY<0)
+ {
+ MouseMickeyPositionY=0;
+ }
+ TempMousePositionX=MouseMickeyPositionX/6;
+ TempMousePositionY=MouseMickeyPositionY/14;
+ if (TempMousePositionX>=cols)
+ {
+ TempMousePositionX=cols-1;
+ MouseMickeyPositionX=TempMousePositionX*6;
+ }
+ if (TempMousePositionY>=rows)
+ {
+ TempMousePositionY=rows-1;
+ MouseMickeyPositionY=TempMousePositionY*14;
+ }
+ if ((pkt.hdr.buttons & _POINTER_BUTTON_LEFT)==_POINTER_BUTTON_LEFT)
+ {
+ MouseButtons|=mbLeftButton;
+ }
+ else
+ {
+ MouseButtons&=~mbLeftButton;
+ }
+ if ((pkt.hdr.buttons & _POINTER_BUTTON_RIGHT)==_POINTER_BUTTON_RIGHT)
+ {
+ MouseButtons|=mbRightButton;
+ }
+ else
+ {
+ MouseButtons&=~mbRightButton;
+ }
+ if ((pkt.hdr.buttons & _POINTER_BUTTON_MIDDLE)==_POINTER_BUTTON_MIDDLE)
+ {
+ MouseButtons|=mbMiddleButton;
+ }
+ else
+ {
+ MouseButtons&=~mbMiddleButton;
+ }
+ }
+ }
+ break;
+ }
+ if ((TempMousePositionX!=MousePositionX) || (TempMousePositionY!=MousePositionY))
+ {
+ Hide();
+
+ MousePositionX=TempMousePositionX;
+ MousePositionY=TempMousePositionY;
+
+ Show();
+ }
+}
+
+void THWMouseQNXRtP::Init()
+{
+ if (OpenDeviMouse())
+ {
+ buttonCount=3;
+
+ THWMouse::Show=Show;
+ THWMouse::Hide=Hide;
+ THWMouse::Suspend=Suspend;
+ THWMouse::Resume=Resume;
+ THWMouse::GetEvent=GetEvent;
+ }
+ else
+ {
+ buttonCount=0;
+ }
+}
+
+void THWMouseQNXRtP::Show()
+{
+ if (mousehandle!=-1)
+ {
+ int cols=TDisplayQNXRtP::GetCols();
+ ushort offset=MousePositionY*cols+MousePositionX;
+ ushort mdata=TScreenQNXRtP::screenBuffer[offset];
+
+ // a la Windows 2000 style text mouse cursor.
+ mdata=(mdata & 0x00FF) | (mdata & 0x8800) | (~(mdata) & 0x7000) | (~(mdata) & 0x0700);
+ TScreenQNXRtP::writeBlock(offset, 1, &mdata, &mdata);
+ }
+}
+
+void THWMouseQNXRtP::Hide()
+{
+ if (mousehandle!=-1)
+ {
+ int cols=TDisplayQNXRtP::GetCols();
+ ushort offset=MousePositionY*cols+MousePositionX;
+
+ TScreenQNXRtP::writeBlock(offset, 1, TScreenQNXRtP::screenBuffer+offset, TScreenQNXRtP::screenBuffer+offset);
+ }
+}
+
+void THWMouseQNXRtP::Suspend()
+{
+ CloseDeviMouse();
+}
+
+void THWMouseQNXRtP::Resume()
+{
+ if (OpenDeviMouse())
+ {
+ buttonCount=3;
+ }
+ else
+ {
+ buttonCount=0;
+ }
+}
+
+void THWMouseQNXRtP::GetEvent(MouseEventType &me)
+{
+ if (mousehandle!=-1)
+ {
+ ProcessDeviMouse();
+ }
+
+ me.buttons = MouseButtons;
+ me.doubleClick = False;
+ me.where.x = MousePositionX;
+ me.where.y = MousePositionY;
+}
+
+#else
+
+ // Here to generate the dependencies in RHIDE
+ #include <tv/qnxrtp/screen.h>
+ #include <tv/qnxrtp/mouse.h>
+
+#endif // TVOS_UNIX && TVOSf_QNXRtP
diff --git a/tvision/classes/qnxrtp/qnxscr.cc b/tvision/classes/qnxrtp/qnxscr.cc
new file mode 100644
index 0000000..1be2f09
--- /dev/null
+++ b/tvision/classes/qnxrtp/qnxscr.cc
@@ -0,0 +1,577 @@
+/* QNX RtP screen routines source.
+ Copyright (c) 2002-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#include <tv/configtv.h>
+
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TGKey
+#define Uses_TVCodePage
+#define Uses_string
+#define Uses_ctype
+#define Uses_stdio
+#define Uses_unistd
+#define Uses_fcntl
+#define Uses_stdlib
+#define Uses_sys_stat
+
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && defined(TVOSf_QNXRtP)
+
+#include <termios.h>
+#include <tv/qnxrtp/screen.h>
+#include <tv/qnxrtp/mouse.h>
+#include <tv/qnxrtp/key.h>
+
+#include <term.h>
+#include <sys/ioctl.h>
+#include <ncurses.h>
+
+TScreen* TV_QNXRtPDriverCheck()
+{
+ TScreenQNXRtP* drv=new TScreenQNXRtP();
+
+ if (!TScreen::initialized)
+ {
+ delete drv;
+
+ return 0;
+ }
+
+ return drv;
+}
+
+int TScreenQNXRtP::old_col=-1;
+int TScreenQNXRtP::old_fore=-1;
+int TScreenQNXRtP::old_back=-1;
+int TScreenQNXRtP::force_redraw=0;
+cc_t TScreenQNXRtP::oldKeys[5];
+struct termios TScreenQNXRtP::old_term;
+struct termios TScreenQNXRtP::new_term;
+
+TScreenQNXRtP::TScreenQNXRtP()
+{
+ int i;
+ int len;
+
+ SpecialKeysDisable(fileno(stdin));
+
+ if (!isatty(fileno(stdout)))
+ {
+ fprintf(stderr,"\r\n");
+ fprintf(stderr,_("Error! %s"),_("that's an interactive application, don't redirect stdout. "
+ "If you want to collect information redirect stderr like this: "
+ "program 2> file"));
+ fprintf(stderr,"\r\n");
+ return;
+ }
+
+ tty_fd=fileno(stdout);
+
+ tcgetattr(fileno(stdout), &old_term);
+
+ // Don't need special rights anymore
+ seteuid(getuid());
+ setegid(getgid());
+
+ initialized=1;
+
+ if (dCB)
+ {
+ dCB();
+ }
+
+ TDisplayQNXRtP::Init();
+
+ TScreen::Resume=Resume;
+ TScreen::Suspend=Suspend;
+ TScreen::setCrtData=setCrtData;
+ TScreen::setVideoMode=setVideoMode;
+ TScreen::setVideoModeExt=setVideoModeExt;
+ TScreen::getCharacters=getCharacters;
+ TScreen::getCharacter=getCharacter;
+ TScreen::setCharacter=setCharacter;
+ TScreen::setCharacters=setCharacters;
+ TScreen::System_p=System;
+
+ TGKeyQNXRtP::Init();
+
+ THWMouseQNXRtP::Init();
+
+ // Added by SET:
+ // Look for user settings
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+ // User settings have more priority than detected settings
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : TVCodePage::PC437,
+ forcedScrCP!=-1 ? forcedScrCP : TVCodePage::PC437,
+ forcedInpCP!=-1 ? forcedInpCP : TVCodePage::PC437);
+ SetDefaultCodePages(TVCodePage::PC437,TVCodePage::PC437,TVCodePage::PC437);
+
+ suspended=0;
+
+ startupCursor=getCursorType();
+ screenMode=startupMode=getCrtMode();
+
+ screenWidth=GetCols();
+ screenHeight=GetRows();
+
+ screenBuffer=new ushort[screenWidth * screenHeight];
+
+ len=screenWidth*screenHeight;
+
+ for (i=0; i<len; i++)
+ {
+ screenBuffer[i] = 0x0720;
+ }
+
+ StartNCurses();
+ setVideoMode(screenMode);
+}
+
+TScreenQNXRtP::~TScreenQNXRtP()
+{
+ setCursorType(startupCursor);
+ stdscr->_flags &= ~_ISPAD;
+
+ TScreenQNXRtP::SendToTerminal(tparm(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, 0));
+
+ if (!suspended)
+ {
+ clear();
+ RestoreGTables();
+ refresh();
+ resetterm();
+ echo();
+ endwin();
+ }
+
+ tcsetattr(fileno(stdout), TCSANOW, &old_term);
+
+ if (!suspended)
+ {
+ RestoreScreen();
+ suspended=1;
+ }
+
+ if (screenBuffer)
+ {
+ DeleteArray(screenBuffer);
+ screenBuffer=NULL;
+ }
+
+ SpecialKeysRestore(fileno(stdin));
+}
+
+void TScreenQNXRtP::Resume()
+{
+ setVideoMode(screenMode);
+ tcsetattr(tty_fd, TCSANOW, &new_term);
+ SetGTables();
+ doupdate();
+}
+
+void TScreenQNXRtP::Suspend()
+{
+ char out[0x40], *p = out;
+
+ old_col = old_back = old_fore = -1;
+
+ setCursorType(startupCursor);
+ RestoreGTables();
+
+ mapColor(p, 0x07); // White (fg) on black (bg).
+ safeput(p, "\x0C"); // clear screen (QNX RtP specific).
+ *p=0x00;
+ printf("%s", out); // Execute.
+ fflush(stdout);
+
+ endwin();
+ tcsetattr(tty_fd, TCSANOW, &old_term);
+ RestoreScreen();
+}
+
+void TScreenQNXRtP::setCrtData()
+{
+ screenMode =getCrtMode();
+ screenWidth =getCols();
+ screenHeight=getRows();
+ hiResScreen =Boolean(screenHeight > 25);
+ cursorLines =getCursorType();
+ setCursorType(0);
+}
+
+void TScreenQNXRtP::setVideoMode(ushort mode)
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+
+ setCrtMode(mode);
+ setCrtData();
+
+ if (screenWidth!=oldWidth || screenHeight!=oldHeight || !screenBuffer)
+ {
+ if (screenBuffer)
+ {
+ DeleteArray(screenBuffer);
+ screenBuffer=NULL;
+ }
+ screenBuffer = new ushort[screenWidth*screenHeight];
+ }
+ memset(screenBuffer, 0, screenWidth*screenHeight*sizeof(ushort));
+}
+
+void TScreenQNXRtP::setVideoModeExt(char* mode)
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+
+ setCrtModeExt(mode);
+ setCrtData();
+
+ if (screenWidth!=oldWidth || screenHeight!=oldHeight || !screenBuffer)
+ {
+ if (screenBuffer)
+ {
+ DeleteArray(screenBuffer);
+ screenBuffer=NULL;
+ }
+ screenBuffer = new ushort[screenWidth*screenHeight];
+ }
+ memset(screenBuffer, 0, screenWidth*screenHeight*sizeof(ushort));
+}
+
+void TScreenQNXRtP::getCharacters(unsigned offset, ushort* buf, unsigned count)
+{
+ memcpy(buf, screenBuffer+offset, count*sizeof(ushort));
+}
+
+ushort TScreenQNXRtP::getCharacter(unsigned dst)
+{
+ ushort src;
+
+ getCharacters(dst, &src, 1);
+
+ return src;
+}
+
+void TScreenQNXRtP::setCharacters(unsigned dst, ushort* src, unsigned len)
+{
+ ushort *old = screenBuffer + dst;
+ ushort *old_right = old + len - 1;
+ ushort *src_right = src + len - 1;
+
+ if (!force_redraw)
+ {
+ while (len > 0 && *old == *src)
+ {
+ dst++;
+ len--;
+ old++;
+ src++;
+ }
+ while (len > 0 && *old_right == *src_right)
+ {
+ len--;
+ old_right--;
+ src_right--;
+ }
+ }
+
+ if (len > 0)
+ {
+ writeBlock(dst, len, old, src);
+ }
+}
+
+void TScreenQNXRtP::setCharacter(unsigned offset, ushort value)
+{
+ setCharacters(offset, &value, 1);
+}
+
+int TScreenQNXRtP::System(const char *command, pid_t* pidChild, int in,
+ int out, int err)
+{
+ char *argv[4];
+
+ if (!pidChild)
+ {
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+ }
+
+ pid_t cpid=fork();
+
+ if (cpid==0)
+ {
+ if (setsid()==-1)
+ {
+ _exit(127);
+ }
+
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+
+ argv[0]=getenv("SHELL");
+ if (!argv[0])
+ {
+ argv[0]="/bin/sh";
+ }
+ argv[1]="-c";
+ argv[2]=(char *)command;
+ argv[3]=0;
+ execvp(argv[0],argv);
+ _exit(127);
+ }
+
+ if (cpid==-1)
+ {
+ *pidChild=0;
+
+ return system(command);
+ }
+
+ *pidChild=cpid;
+
+ return 0;
+}
+
+void TScreenQNXRtP::SpecialKeysDisable(int fd)
+{
+ struct termios terminal;
+
+ tcgetattr(fd, &terminal);
+ oldKeys[0]=terminal.c_cc[VSUSP];
+ oldKeys[1]=terminal.c_cc[VSTART];
+ oldKeys[2]=terminal.c_cc[VSTOP];
+ oldKeys[3]=terminal.c_cc[VQUIT];
+ oldKeys[4]=terminal.c_cc[VINTR];
+ terminal.c_cc[VSUSP] =0;
+ terminal.c_cc[VSTART]=0;
+ terminal.c_cc[VSTOP] =0;
+ terminal.c_cc[VQUIT] =0;
+ terminal.c_cc[VINTR] =0;
+ tcsetattr(fd, TCSANOW, &terminal);
+}
+
+void TScreenQNXRtP::SpecialKeysRestore(int fd)
+{
+ struct termios terminal;
+
+ tcgetattr(fd, &terminal);
+ terminal.c_cc[VSUSP] =oldKeys[0];
+ terminal.c_cc[VSTART]=oldKeys[1];
+ terminal.c_cc[VSTOP] =oldKeys[2];
+ terminal.c_cc[VQUIT] =oldKeys[3];
+ terminal.c_cc[VINTR] =oldKeys[4];
+ tcsetattr(fd, TCSANOW, &terminal);
+}
+
+void TScreenQNXRtP::StartNCurses()
+{
+ initscr();
+ stdscr->_flags |= _ISPAD;
+ keypad(stdscr, TRUE);
+ cbreak();
+ noecho();
+ nonl();
+
+ if (has_colors())
+ {
+ start_color();
+ }
+
+ refresh();
+
+ timeout(0);
+
+ SetGTables();
+
+ TScreen::screenMode = TScreen::smCO80;
+
+ tcgetattr(tty_fd, &new_term);
+
+ signal(SIGWINCH, sigWindowSizeChanged);
+
+ ESCDELAY=1;
+}
+
+void TScreenQNXRtP::SetGTables()
+{
+ printf("\x0F"); // Select GL to G0
+ printf("\x1B""\x7E"); // Select GR to G1
+ printf("\x1B""\x28""\x42"); // Select G0 to ASCII charset.
+ printf("\x1B""\x29""\x3C"); // Select G1 to supplement charset.
+ fflush(stdout);
+}
+
+void TScreenQNXRtP::RestoreGTables()
+{
+ printf("\x0F"); // Select GL to G0
+ printf("\x1B""\x7E"); // Select GR to G1
+ printf("\x1B""\x28""\x42"); // Select G0 to ASCII charset.
+ printf("\x1B""\x29""\x30"); // Select G1 to special charset.
+ fflush(stdout);
+}
+
+void TScreenQNXRtP::sigWindowSizeChanged(int sig)
+{
+ TScreenQNXRtP::windowSizeChanged=1;
+ signal(sig, sigWindowSizeChanged);
+}
+
+void TScreenQNXRtP::SendToTerminal(const char* const value)
+{
+ if (!value)
+ {
+ return;
+ }
+
+ printf(value);
+ fflush(stdout);
+}
+
+void TScreenQNXRtP::RestoreScreen()
+{
+ char b[256];
+ char* p=b;
+
+ mapColor(p, 0x07);
+ *p=0;
+
+ SendToTerminal(b);
+
+ SendToTerminal(clear_screen);
+}
+
+void TScreenQNXRtP::mapColor(char* &p, int col)
+{
+ int back;
+ int fore;
+ static char map[] = {0, 4, 2, 6, 1, 5, 3, 7};
+
+ if (col == old_col)
+ {
+ return;
+ }
+
+ old_col = col;
+
+ back = (col >> 4) & 7;
+ fore = col & 15;
+
+ if (fore!=old_fore && back!=old_back)
+ {
+ sprintf(p, "\x1B""[%d;%d;%dm", fore > 7 ? 1 : 22, 30 + map[fore & 7], 40 + map[back]);
+ old_fore = fore;
+ old_back = back;
+ }
+ else
+ {
+ if (fore!=old_fore)
+ {
+ sprintf(p,"\x1B""[%d;%dm", fore > 7 ? 1 : 22, 30 + map[fore & 7]);
+ old_fore = fore;
+ }
+ else
+ {
+ sprintf(p,"\x1B""[%dm", 40 + map[back]);
+ old_back = back;
+ }
+ }
+ p+=strlen(p);
+}
+
+void TScreenQNXRtP::writeBlock(int dst, int len, ushort *old, ushort *src)
+{
+ char out[4096];
+ char *p = out;
+ int col = -1;
+ int PCTable=-1;
+
+ safeput(p, tparm(cursor_address, dst / TScreen::screenWidth, dst % TScreen::screenWidth));
+ p-=4;
+ safeput(p, "\x1B""[?7l");
+
+ while (len-- > 0)
+ {
+ int code = *src & 0xff;
+ int newcol = *src >> 8;
+
+ *old++ = *src++;
+ if (col == -1 || col != newcol)
+ {
+ col = newcol;
+ mapColor(p, col);
+ }
+
+ if (code<0x80)
+ {
+ if (PCTable!=0)
+ {
+ PCTable=0;
+ safeput(p, "\x1B""[11m");
+ }
+ }
+ else
+ {
+ if (PCTable!=1)
+ {
+ PCTable=1;
+ safeput(p, "\x1B""[12m");
+ }
+ }
+
+ if (code==0x1B)
+ {
+ safeput(p, "\x1B""[10m");
+ PCTable=-1;
+ *p++ = '-';
+ }
+ else
+ {
+ *p++ = code;
+ }
+
+ if (p > out+4000)
+ {
+ write(tty_fd, out, p-out);
+ p = out;
+ }
+ }
+
+ safeput(p, "\x1B""[10m");
+ PCTable=-1;
+
+ safeput(p, "\x1B""[?7h");
+ safeput(p, tparm(cursor_address, cur_y, cur_x));
+ p-=4;
+
+ do {
+ write(tty_fd, out, p-out);
+ } while(0);
+}
+
+#else
+
+ // Here to generate the dependencies in RHIDE
+ #include <tv/qnxrtp/screen.h>
+ #include <tv/qnxrtp/key.h>
+
+#endif // TVOS_UNIX && TVOSf_QNXRtP
diff --git a/tvision/classes/tapplica.cc b/tvision/classes/tapplica.cc
new file mode 100644
index 0000000..b928720
--- /dev/null
+++ b/tvision/classes/tapplica.cc
@@ -0,0 +1,178 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_stdio
+#define Uses_TEventQueue
+#define Uses_TScreen
+#define Uses_TObject
+#define Uses_TMouse
+#define Uses_TApplication
+#include <tv.h>
+
+static TEventQueue *teq = 0;
+
+#if 0 /************** Disabled ************/
+#ifdef TVCompf_djgpp
+#include <dpmi.h>
+
+#define REGS __dpmi_regs
+#define INTR(nr,r) __dpmi_int(nr,&r)
+
+#define AX r.x.ax
+#define BX r.x.bx
+#define CX r.x.cx
+#define DX r.x.dx
+#define ES r.x.es
+
+static int mouse_buffer_segment;
+static int mouse_buffer_selector;
+static int mouse_buffer_size;
+static int mouse_buffer_allocated = 0;
+
+#endif
+
+static void restore_mouse_state()
+{
+#ifdef TVCompf_djgpp
+ REGS r;
+ if (mouse_buffer_allocated)
+ {
+ AX = 0x0017;
+ BX = mouse_buffer_size;
+ ES = mouse_buffer_segment;
+ DX = 0;
+ INTR(0x33,r);
+ }
+#endif
+}
+
+static void save_mouse_state()
+{
+#ifdef TVCompf_djgpp
+ REGS r;
+ if (!mouse_buffer_allocated)
+ {
+ AX = 0x0015;
+ INTR(0x33,r);
+ mouse_buffer_size = BX;
+ mouse_buffer_segment = __dpmi_allocate_dos_memory(
+ (mouse_buffer_size+15)>>4,
+ &mouse_buffer_selector);
+ if (mouse_buffer_segment != -1)
+ mouse_buffer_allocated = 1;
+ }
+ if (mouse_buffer_allocated)
+ {
+ AX = 0x0016;
+ BX = mouse_buffer_size;
+ ES = mouse_buffer_segment;
+ DX = 0;
+ INTR(0x33,r);
+ }
+#endif
+}
+#endif /************** Disabled ************/
+
+
+/************** Disabled ************/
+#if 0
+static int my_mouse_buffer_segment;
+static int my_mouse_buffer_selector;
+static int my_mouse_buffer_size;
+static int my_mouse_buffer_allocated = 0;
+
+static void restore_my_mouse_state()
+{
+ REGS r;
+ if (my_mouse_buffer_allocated)
+ {
+ AX = 0x0017;
+ BX = my_mouse_buffer_size;
+ ES = my_mouse_buffer_segment;
+ DX = 0;
+ INTR(0x33,r);
+ }
+}
+
+static void save_my_mouse_state()
+{
+ REGS r;
+ if (!my_mouse_buffer_allocated)
+ {
+ AX = 0x0015;
+ INTR(0x33,r);
+ my_mouse_buffer_size = BX;
+ my_mouse_buffer_segment = __dpmi_allocate_dos_memory(
+ (my_mouse_buffer_size+15)>>4,
+ &my_mouse_buffer_selector);
+ if (my_mouse_buffer_segment != -1)
+ my_mouse_buffer_allocated = 1;
+ }
+ if (my_mouse_buffer_allocated)
+ {
+ AX = 0x0016;
+ BX = my_mouse_buffer_size;
+ ES = my_mouse_buffer_segment;
+ DX = 0;
+ INTR(0x33,r);
+ }
+}
+#endif /************** Disabled ************/
+
+void TApplication::resume()
+{
+ #if 0
+ save_mouse_state();
+ #endif
+ TScreen::resume();
+ TEventQueue::resume();
+ #if 0
+ restore_my_mouse_state();
+ #endif
+ resetIdleTime(); // Don't count this time
+}
+
+void TApplication::suspend()
+{
+ #if 0
+ save_my_mouse_state();
+ #endif
+ TEventQueue::suspend();
+ TScreen::suspend();
+ #if 0
+ restore_mouse_state();
+ #endif
+}
+
+void initHistory();
+void doneHistory();
+
+TApplication::TApplication() :
+ TProgInit( &TApplication::initStatusLine,
+ &TApplication::initMenuBar,
+ &TApplication::initDeskTop
+ )
+{
+ if (!teq)
+ teq = new TEventQueue();
+ initHistory();
+}
+
+TApplication::~TApplication()
+{
+ doneHistory();
+ delete teq;
+ teq = 0;
+}
+
diff --git a/tvision/classes/tbackgro.cc b/tvision/classes/tbackgro.cc
new file mode 100644
index 0000000..9d3f621
--- /dev/null
+++ b/tvision/classes/tbackgro.cc
@@ -0,0 +1,76 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TBackground
+#define Uses_TDrawBuffer
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#define Uses_TPalette
+#define Uses_TScreen
+#define Uses_TDeskTop
+#include <tv.h>
+
+#define cpBackground "\x01" // background palette
+
+TBackground::TBackground( const TRect& bounds, char aPattern ) :
+ TView(bounds),
+ pattern( aPattern )
+{
+ growMode = gfGrowHiX | gfGrowHiY;
+}
+
+void TBackground::draw()
+{
+ TDrawBuffer b;
+
+ char ch = pattern;
+ if( TScreen::avoidMoire && ch == TDeskTop::defaultBkgrnd )
+ ch = TView::noMoireFill;
+ b.moveChar( 0, ch, getColor(0x01), size.x );
+ writeLine( 0, 0, size.x, size.y, b );
+}
+
+TPalette& TBackground::getPalette() const
+{
+ static TPalette palette( cpBackground, sizeof( cpBackground )-1 );
+ return palette;
+}
+
+#if !defined( NO_STREAM )
+
+void TBackground::write( opstream& os )
+{
+ TView::write( os );
+ os << pattern;
+}
+
+void *TBackground::read( ipstream& is )
+{
+ TView::read( is );
+ is >> pattern;
+ return this;
+}
+
+TStreamable *TBackground::build()
+{
+ return new TBackground( streamableInit );
+}
+
+TBackground::TBackground( StreamableInit ) : TView( streamableInit )
+{
+}
+
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tbutton.cc b/tvision/classes/tbutton.cc
new file mode 100644
index 0000000..7b2b884
--- /dev/null
+++ b/tvision/classes/tbutton.cc
@@ -0,0 +1,378 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Added callback, code page stuff and various details by Salvador Eduardo Tropea.
+Added new class TButtonRef by Salvador Eduardo Tropea.
+Added i18n support by Salvador Eduardo Tropea.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_ctype
+#define Uses_string
+#define Uses_TButton
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+#define Uses_TRect
+#define Uses_TGroup
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#define Uses_TGKey
+#define Uses_TScreen
+#include <tv.h>
+
+/* SET: F*#$%! why these values are defined here!!!
+const ushort
+ cmGrabDefault = 61,
+ cmReleaseDefault = 62;
+
+ Moved to views.h
+*/
+
+#define cpButton "\x0A\x0B\x0C\x0D\x0E\x0E\x0E\x0F"
+
+TButton::TButton( const TRect& bounds,
+ const char *aTitle,
+ ushort aCommand,
+ ushort aFlags) :
+ TView( bounds ),
+ title( newStr( aTitle ) ),
+ intlTitle( NULL ),
+ command( aCommand ),
+ flags( aFlags ),
+ amDefault( Boolean( (aFlags & bfDefault) != 0 ) )
+{
+ options |= ofSelectable | ofFirstClick | ofPreProcess | ofPostProcess;
+ eventMask |= evBroadcast;
+ if( !commandEnabled(aCommand) )
+ state |= sfDisabled;
+ callBack=0;
+ // This class can be "Braille friendly"
+ if (TScreen::getShowCursorEver())
+ state |= sfCursorVis;
+}
+
+TButton::~TButton()
+{
+ DeleteArray((char *)title); // SET
+ TVIntl::freeSt(intlTitle);
+}
+
+
+void TButton::draw()
+{
+ drawState(False);
+}
+
+void TButton::drawTitle( TDrawBuffer &b,
+ int s,
+ int i,
+ ushort cButton,
+ Boolean down
+ )
+{
+ int l, scOff;
+ const char *theTitle = getText();
+ if( (flags & bfLeftJust) != 0 )
+ l = 1;
+ else
+ {
+ l = (s - cstrlen(theTitle) - 1)/2;
+ if( l < 1 )
+ l = 1;
+ }
+ b.moveCStr( i+l, theTitle, cButton );
+
+ if( showMarkers == True && !down )
+ {
+ if( (state & sfSelected) != 0 )
+ scOff = 0;
+ else if( amDefault )
+ scOff = 2;
+ else
+ scOff = 4;
+ b.putChar( 0, specialChars[scOff] );
+ b.putChar( s, specialChars[scOff+1] );
+ }
+ if( (state & sfActive) && (state & sfSelected) )
+ {
+ setCursor( i+l-1 , 0 );
+ resetCursor();
+ }
+}
+
+void TButton::drawState(Boolean down)
+{
+ ushort cButton, cShadow;
+ char ch = ' ';
+ int i;
+ TDrawBuffer b;
+
+ if( (state & sfDisabled) != 0 )
+ cButton = getColor(0x0404);
+ else
+ {
+ cButton = getColor(0x0501);
+ if( (state & sfActive) != 0 )
+ {
+ if( (state & sfSelected) != 0 )
+ cButton = getColor(0x0703);
+ else if( amDefault )
+ cButton = getColor(0x0602);
+ }
+ }
+ cShadow = getColor(8);
+ int s = size.x-1;
+ int T = size.y / 2 - 1;
+
+ for( int y = 0; y <= size.y-2; y++ )
+ {
+ b.moveChar( 0, ' ', cButton, size.x );
+ b.putAttribute( 0, cShadow );
+ if( down )
+ {
+ b.putAttribute( 1, cShadow );
+ i = 2;
+ }
+ else
+ {
+ b.putAttribute( s, cShadow );
+ if( showMarkers == False )
+ {
+ if( y == 0 )
+ b.putChar( s, shadows[0] );
+ else
+ b.putChar( s, shadows[1] );
+ ch = shadows[2];
+ }
+ i = 1;
+ }
+
+ if( y == T && title != 0 )
+ drawTitle( b, s, i, cButton, down );
+
+ if( showMarkers && !down )
+ {
+ b.putChar( 1, markers[0] );
+ b.putChar( s-1, markers[1] );
+ }
+ writeLine( 0, y, size.x, 1, b );
+ }
+ b.moveChar( 0, ' ', cShadow, 2 );
+ b.moveChar( 2, ch, cShadow, s-1 );
+ writeLine( 0, size.y-1, size.x, 1, b );
+}
+
+TPalette& TButton::getPalette() const
+{
+ static TPalette palette( cpButton, sizeof( cpButton )-1 );
+ return palette;
+}
+
+void TButton::handleEvent( TEvent& event )
+{
+ TPoint mouse;
+ TRect clickRect;
+ Boolean down = False;
+ char c = hotKey( getText() );
+
+ clickRect = getExtent();
+ clickRect.a.x++;
+ clickRect.b.x--;
+ clickRect.b.y--;
+
+ if( event.what == evMouseDown )
+ {
+ mouse = makeLocal( event.mouse.where );
+ if( !clickRect.contains(mouse) )
+ clearEvent( event );
+ }
+ TView::handleEvent(event);
+
+ switch( event.what )
+ {
+ case evMouseDown:
+ clickRect.b.x++;
+ do {
+ mouse = makeLocal( event.mouse.where );
+ if( down != clickRect.contains( mouse ) )
+ {
+ down = Boolean( !down );
+ drawState( down );
+ }
+ } while( mouseEvent( event, evMouseMove ) );
+ if( down )
+ {
+ press();
+ drawState( False );
+ }
+ clearEvent( event );
+ break;
+
+ case evKeyDown:
+ if( event.keyDown.keyCode == TGKey::GetAltCode(c) ||
+ ( owner->phase == phPostProcess &&
+ c != 0 &&
+ TGKey::CompareASCII(uctoupper(event.keyDown.charScan.charCode),c)
+ //uctoupper(event.keyDown.charScan.charCode) == c
+ ) ||
+ ( (state & sfFocused) != 0 &&
+ event.keyDown.charScan.charCode == ' '
+ )
+ )
+ {
+ press();
+ clearEvent( event );
+ }
+ break;
+
+ case evBroadcast:
+ switch( event.message.command )
+ {
+ case cmDefault:
+ if( amDefault && !(state & sfDisabled) )
+ {
+ press();
+ clearEvent(event);
+ }
+ break;
+
+ case cmGrabDefault:
+ case cmReleaseDefault:
+ if( (flags & bfDefault) != 0 )
+ {
+ amDefault = Boolean(event.message.command == cmReleaseDefault);
+ drawView();
+ }
+ break;
+
+ case cmCommandSetChanged:
+ if (((state & sfDisabled) && commandEnabled(command)) ||
+ (!(state & sfDisabled) && !commandEnabled(command)))
+ {
+ setState(sfDisabled,Boolean(!commandEnabled(command)));
+ drawView();
+ }
+ break;
+ }
+ break;
+ }
+}
+
+void TButton::makeDefault( Boolean enable )
+{
+ if( (flags & bfDefault) == 0 )
+ {
+ message( owner,
+ evBroadcast,
+ (enable == True) ? cmGrabDefault : cmReleaseDefault,
+ this
+ );
+ amDefault = enable;
+ drawView();
+ }
+}
+
+void TButton::setState( ushort aState, Boolean enable )
+{
+ TView::setState(aState, enable);
+ if( aState & (sfSelected | sfActive) )
+ {
+ if(!enable)
+ { // BUG FIX - EFW - Thu 10/19/95
+ state &= ~sfFocused;
+ makeDefault(False);
+ }
+ drawView();
+ }
+ if( (aState & sfFocused) != 0 )
+ makeDefault( enable );
+}
+
+void TButton::press()
+{
+ message(owner,evBroadcast,cmRecordHistory,0);
+ if (flags & bfBroadcast)
+ message(owner,evBroadcast,command,this);
+ else
+ {
+ if (callBack)
+ {// SET: That's really useful
+ int ret=callBack(command,cbData);
+ if (ret==btcbEndModal && owner)
+ owner->endModal(command);
+ }
+ else
+ {
+ TEvent e;
+ e.what=evCommand;
+ e.message.command=command;
+ e.message.infoPtr=this;
+ putEvent(e);
+ }
+ }
+}
+
+#if !defined( NO_STREAM )
+
+void TButton::write( opstream& os )
+{
+ TView::write( os );
+ os.writeString( title );
+ os << command << flags << (int)amDefault;
+}
+
+void *TButton::read( ipstream& is )
+{
+ TView::read( is );
+ title = is.readString();
+ intlTitle = NULL;
+ int temp;
+ is >> command >> flags >> temp;
+ amDefault = Boolean(temp);
+ if( TButton::commandEnabled( command ) )
+ state &= ~sfDisabled;
+ else
+ state |= sfDisabled;
+ return this;
+}
+
+TStreamable *TButton::build()
+{
+ return new TButton( streamableInit );
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ This class is just like TButton but the title of the button is a reference
+and not a copy of the one passed by the user. It allows changes from the
+application side to be reflected in the button with a simple redraw. That's
+*very* useful for remappings.
+
+***************************************************************************/
+
+TButtonRef::TButtonRef(const TRect& bounds, const char *aTitle,
+ ushort aCommand, ushort aFlags) :
+ TButton(bounds,aTitle,aCommand,aFlags)
+{
+ DeleteArray((char *)title);
+ title=aTitle;
+}
+
+TButtonRef::~TButtonRef()
+{
+ title=NULL;
+}
+
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tchdirdi.cc b/tvision/classes/tchdirdi.cc
new file mode 100644
index 0000000..2f8aff5
--- /dev/null
+++ b/tvision/classes/tchdirdi.cc
@@ -0,0 +1,216 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+Modified by Salvador E. Tropea: added i18n support. Horizontal scroll bar.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_ctype
+#define Uses_stdio
+#define Uses_string
+#define Uses_unistd
+#define Uses_chdir
+
+#define Uses_MsgBox
+#define Uses_TChDirDialog
+#define Uses_TRect
+#define Uses_TInputLine
+#define Uses_T1Label
+#define Uses_THistory
+#define Uses_TScrollBar
+#define Uses_TDirListBox
+#define Uses_TButton
+#define Uses_TEvent
+#define Uses_TDirEntry
+#define Uses_TDirCollection
+#define Uses_TChDirDialog
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TChDirDialog::TChDirDialog( ushort opts, ushort histId ) :
+ TWindowInit( &TChDirDialog::initFrame )
+ , TDialog( TRect( 16, 2, 64, 21 ), __("Change Directory") )
+{
+ options |= ofCentered;
+
+ dirInput = new TInputLine( TRect( 3, 3, 30, 4 ), FILENAME_MAX );
+ insert( dirInput );
+ insert( new T1Label( 2, 2, __("Directory ~n~ame"), dirInput ));
+ insert( new THistory( TRect( 30, 3, 33, 4 ), dirInput, histId ) );
+
+ TScrollBar *sbv = new TScrollBar( TRect( 32, 6, 33, 16 ) );
+ insert( sbv );
+ // SET: Looks like original authors never had deep directory structures ...
+ // So I added a horizontal scroll bar.
+ TScrollBar *sbh = new TScrollBar( TRect( 3, 16, 32, 17 ) );
+ sbh->setRange( 0, PATH_MAX );
+ sbh->setStep( 28, 1 );
+ insert( sbh );
+ dirList = new TDirListBox( TRect( 3, 6, 32, 16 ), sbv, sbh );
+ insert( dirList );
+ insert( new T1Label( 2, 5, __("Directory ~t~ree"), dirList ));
+
+ okButton = new TButton( TRect( 35, 6, 45, 8 ), __("~O~K"), cmOK, bfDefault );
+ insert( okButton );
+ chDirButton = new TButton( TRect( 35, 9, 45, 11 ), __("~C~hdir"), cmChangeDir, bfNormal );
+ insert( chDirButton );
+ insert( new TButton( TRect( 35, 12, 45, 14 ), __("~R~evert"), cmRevert, bfNormal ) );
+ if( (opts & cdHelpButton) != 0 )
+ insert( new TButton( TRect( 35, 15, 45, 17 ), __("Help"), cmHelp, bfNormal ) );
+ if( (opts & cdNoLoadDir) == 0 )
+ setUpDialog();
+ selectNext( False );
+}
+
+static inline
+int changeDir( const char *path )
+{
+#if 0 // DJGPP can handle chdir also over drives
+ if( path[1] == ':' )
+ setdisk( uctoupper(path[0]) - 'A' );
+#endif
+ return chdir( path );
+}
+
+uint32 TChDirDialog::dataSize()
+{
+ return 0;
+}
+
+void TChDirDialog::shutDown()
+{
+ dirList = 0;
+ dirInput = 0;
+ okButton = 0;
+ chDirButton = 0;
+ TDialog::shutDown();
+}
+
+void TChDirDialog::getData( void * )
+{
+}
+
+void TChDirDialog::handleEvent( TEvent& event )
+{
+ TDialog::handleEvent( event );
+ switch( event.what )
+ {
+ case evCommand:
+ {
+ char curDir[PATH_MAX];
+ switch( event.message.command )
+ {
+ case cmRevert:
+ CLY_GetCurDirSlash(curDir);
+ break;
+ case cmChangeDir:
+ {
+ TDirEntry *p = dirList->list()->at( dirList->focused );
+ strcpy( curDir, p->dir() );
+ #ifdef CLY_HaveDriveLetters
+ if( strcmp( curDir, _("Drives") ) == 0 )
+ // Go and get the drive names
+ break;
+ if( !driveValid( curDir[0] ) )
+ // Invalid drive, don't change
+ return;
+ #endif
+ // Ensure it have a DIRSEPARATOR at the end
+ if( curDir[strlen(curDir)-1] != DIRSEPARATOR )
+ strcat( curDir, DIRSEPARATOR_ );
+ // Go and get the directories
+ break;
+ }
+ case cmDirSelection:
+ chDirButton->makeDefault((Boolean)(event.message.infoPtr!=NULL));
+ return; // Do not use break here !
+ default:
+ return;
+ }
+ dirList->newDirectory( curDir );
+ #if CLY_HaveDriveLetters
+ // Let the last dirsep only if it is X:/
+ int len = strlen( curDir );
+ if( len > 3 && curDir[len-1] == DIRSEPARATOR )
+ curDir[len-1] = EOS;
+ #endif
+ dirInput->setDataFromStr(curDir);
+ dirInput->drawView();
+ dirList->select();
+ clearEvent( event );
+ }
+ default:
+ break;
+ }
+}
+
+void TChDirDialog::setData( void * )
+{
+}
+
+void TChDirDialog::setUpDialog()
+{
+ if( dirList != 0 )
+ {
+ char curDir[PATH_MAX];
+ CLY_GetCurDirSlash( curDir );
+ dirList->newDirectory( curDir );
+ if( dirInput != 0 )
+ {
+ #if CLY_HaveDriveLetters
+ int len = strlen( curDir );
+ if( len > 3 && curDir[len-1] == DIRSEPARATOR )
+ curDir[len-1] = EOS;
+ #endif
+ dirInput->setDataFromStr(curDir);
+ dirInput->drawView();
+ }
+ }
+}
+
+Boolean TChDirDialog::valid( ushort command )
+{
+ if ( command != cmOK )
+ return True;
+ if( changeDir( (const char *)dirInput->getData() ) != 0 )
+ {
+ messageBox( __("Invalid directory"), mfError | mfOKButton );
+ return False;
+ }
+ return True;
+}
+
+#if !defined( NO_STREAM )
+
+void TChDirDialog::write( opstream& os )
+{
+ TDialog::write( os );
+ os << dirList << dirInput << okButton << chDirButton;
+}
+
+void *TChDirDialog::read( ipstream& is )
+{
+ TDialog::read( is );
+ is >> dirList >> dirInput >> okButton >> chDirButton;
+ setUpDialog();
+ return this;
+}
+
+TStreamable *TChDirDialog::build()
+{
+ return new TChDirDialog( streamableInit );
+}
+
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tcheckbo.cc b/tvision/classes/tcheckbo.cc
new file mode 100644
index 0000000..deb3d61
--- /dev/null
+++ b/tvision/classes/tcheckbo.cc
@@ -0,0 +1,59 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Added TCheckBoxes32 and code page stuff by Salvador Eduardo Tropea.
+
+ *
+ *
+ */
+
+#define Uses_TCheckBoxes
+#include <tv.h>
+
+void TCheckBoxes::draw()
+{
+ drawBox( button, 'X' );
+}
+
+Boolean TCheckBoxes::mark(int item)
+{
+ return Boolean( (value & (1 << item)) != 0 );
+}
+
+void TCheckBoxes::press(int item)
+{
+ value = value^(1 << item);
+ TCluster::press(item);
+}
+
+uint32 TCheckBoxes32::dataSize()
+{
+ return 4;
+}
+
+#if !defined( NO_STREAM )
+
+TStreamable *TCheckBoxes::build()
+{
+ return new TCheckBoxes( streamableInit );
+}
+
+TCheckBoxes::TCheckBoxes( StreamableInit ) : TCluster( streamableInit )
+{
+}
+
+TStreamable *TCheckBoxes32::build()
+{
+ return new TCheckBoxes32( streamableInit );
+}
+
+TCheckBoxes32::TCheckBoxes32( StreamableInit ) : TCheckBoxes( streamableInit )
+{
+}
+
+#endif // NO_STREAM
diff --git a/tvision/classes/tclrdisp.cc b/tvision/classes/tclrdisp.cc
new file mode 100644
index 0000000..07107de
--- /dev/null
+++ b/tvision/classes/tclrdisp.cc
@@ -0,0 +1,102 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TColorDisplay
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TGroup
+#define Uses_TRect
+#define Uses_opstream
+#define Uses_ipstream
+#include <tv.h>
+
+TColorDisplay::TColorDisplay( const TRect& bounds, const char *aText ) :
+ TView( bounds ),
+ color( 0 ),
+ text( newStr( aText ) )
+{
+ eventMask |= evBroadcast;
+}
+
+TColorDisplay::~TColorDisplay()
+{
+ DeleteArray((char *)text);
+}
+
+void TColorDisplay::draw()
+{
+ uchar c = *color;
+ if( c == 0 )
+ c = errorAttr;
+ const int len = strlen( text );
+ TDrawBuffer b;
+ for( int i = 0; i <= size.x/len; i++ )
+ b.moveStr( i*len, text, c );
+ writeLine( 0, 0, size.x, size.y, b );
+}
+
+void TColorDisplay::handleEvent( TEvent& event )
+{
+ TView::handleEvent( event );
+ if( event.what == evBroadcast )
+ switch( event.message.command )
+ {
+ case cmColorBackgroundChanged:
+ *color = (*color & 0x0F) | ((event.message.infoLong << 4) & 0xF0);
+ drawView();
+ break;
+
+ case cmColorForegroundChanged:
+ *color = (*color & 0xF0) | (event.message.infoLong & 0x0F);
+ drawView();
+ }
+}
+
+void TColorDisplay::setColor( uchar *aColor )
+{
+ color = aColor;
+ message( owner, evBroadcast, cmColorSet, (void *)(uipointer)(*color) );
+ drawView();
+}
+
+#if !defined( NO_STREAM )
+
+void TColorDisplay::write( opstream& os )
+{
+ TView::write( os );
+ os.writeString( text );
+}
+
+void *TColorDisplay::read( ipstream& is )
+{
+ TView::read( is );
+ text = is.readString();
+ color = 0;
+ return this;
+}
+
+TStreamable *TColorDisplay::build()
+{
+ return new TColorDisplay( streamableInit );
+}
+
+TColorDisplay::TColorDisplay( StreamableInit ) : TView( streamableInit )
+{
+}
+
+#endif
+
diff --git a/tvision/classes/tcluster.cc b/tvision/classes/tcluster.cc
new file mode 100644
index 0000000..91a63c0
--- /dev/null
+++ b/tvision/classes/tcluster.cc
@@ -0,0 +1,408 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Added palette color and draw code for disabled clusters by Salvador E. Tropea
+Added TSItem::append by Salvador E. Tropea
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+//#define Uses_stdio
+#define Uses_ctype
+#define Uses_string
+#define Uses_TKeys
+#define Uses_TCluster
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+#define Uses_TPoint
+#define Uses_TSItem
+#define Uses_TStringCollection
+#define Uses_TGroup
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#define Uses_TGKey
+#include <tv.h>
+
+class TStringCollectionCIntl : public TStringCollection
+{
+public:
+ TStringCollectionCIntl( ccIndex aLimit, ccIndex aDelta ) :
+ TStringCollection(aLimit,aDelta) {}
+ virtual void freeItem( void* item );
+ stTVIntl *atI( ccIndex item ) { return (stTVIntl *)at(item); };
+};
+
+void TStringCollectionCIntl::freeItem( void* item )
+{
+ if( item )
+ {
+ stTVIntl *p = (stTVIntl *)item;
+ if( p->translation )
+ delete[] p->translation;
+ delete p;
+ }
+}
+
+
+#define cpCluster "\x10\x11\x12\x12\x1F"
+
+// SET: To report the movedTo and press as broadcasts, set it to 0 if you
+// don't like it.
+unsigned TCluster::extraOptions=ofBeVerbose;
+
+TCluster::TCluster( const TRect& bounds, TSItem *aStrings ) :
+ TView(bounds),
+ value( 0 ),
+ sel( 0 )
+{
+ options |= ofSelectable | ofFirstClick | ofPreProcess | ofPostProcess |
+ extraOptions;
+ int i = 0;
+ TSItem *p;
+ for( p = aStrings; p != 0; p = p->next )
+ i++;
+
+ strings = new TStringCollection( i, 0 );
+ intlStrings = new TStringCollectionCIntl( i, 0 );
+
+ while( aStrings != 0 )
+ {
+ p = aStrings;
+ strings->atInsert( strings->getCount(), newStr(aStrings->value) );
+ intlStrings->atInsert( intlStrings->getCount(), TVIntl::emptySt() );
+ aStrings = aStrings->next;
+ delete(p);
+ }
+
+ setCursor( 2, 0 );
+ showCursor();
+}
+
+TCluster::~TCluster()
+{
+ CLY_destroy( (TCollection *)strings );
+ CLY_destroy( (TCollection *)intlStrings );
+}
+
+const char *TCluster::getItemText( ccIndex item )
+{
+ const char *key = (const char *)strings->at( item );
+ stTVIntl *cache = intlStrings->atI( item );
+ //printf("getText(%s,...) [%d]\n",key,item);
+ return TVIntl::getText( key, cache );
+}
+
+uint32 TCluster::dataSize()
+{
+ // I have changed value from ushort to uint32, but to be compatible
+ // I set dataSize to 2.
+ // SET: I added TRadioButtons32 and TCheckBox32
+ return sizeof(ushort);
+}
+
+void TCluster::drawBox( const char *icon, char marker)
+{
+ TDrawBuffer b;
+ ushort color;
+
+ ushort cNorm = state & sfDisabled ? getColor( 0x0505 ) : getColor( 0x0301 );
+ ushort cSel = getColor( 0x0402 );
+ for( int i = 0; i <= size.y; i++ )
+ {
+ for( int j = 0; j <= (strings->getCount()-1)/size.y + 1; j++ )
+ {
+ int cur = j * size.y + i;
+ int col = column( cur );
+ if ( ( cur < strings->getCount() ) &&
+ (col+cstrlen(getItemText(cur))+5 < maxViewWidth) &&
+ (col<size.x) )
+ {
+ if( (cur == sel) && (state & sfSelected) != 0 )
+ color = cSel;
+ else
+ color = cNorm;
+ b.moveChar( col, ' ', color, size.x - col );
+ b.moveCStr( col, icon, color );
+ if( mark(cur) )
+ b.putChar( col+2, marker );
+ b.moveCStr( col+5, getItemText(cur), color );
+ if( showMarkers && (state & sfSelected) != 0 && cur == sel )
+ {
+ b.putChar( col, specialChars[0] );
+ b.putChar( column(cur+size.y)-1, specialChars[1] );
+ }
+ }
+ }
+ writeBuf( 0, i, size.x, 1, b );
+ }
+ setCursor( column(sel)+2, row(sel) );
+}
+
+void TCluster::getData(void * rec)
+{
+ memcpy(rec,&value,dataSize());
+#if 0 // Why this
+ drawView();
+#endif
+}
+
+ushort TCluster::getHelpCtx()
+{
+ if( helpCtx == hcNoContext )
+ return hcNoContext;
+ else
+ return helpCtx + sel;
+}
+
+TPalette& TCluster::getPalette() const
+{
+ static TPalette palette( cpCluster, sizeof( cpCluster )-1 );
+ return palette;
+}
+
+void TCluster::handleEvent( TEvent& event )
+{
+ TView::handleEvent(event);
+ if( event.what == evMouseDown )
+ {
+ TPoint mouse = makeLocal( event.mouse.where );
+ int i = findSel(mouse);
+ if( i != -1 )
+ sel = i;
+ drawView();
+ do {
+ mouse = makeLocal( event.mouse.where );
+ if( findSel(mouse) == sel )
+ showCursor();
+ else
+ hideCursor();
+ } while( mouseEvent(event,evMouseMove) );
+ showCursor();
+ mouse = makeLocal( event.mouse.where );
+ if( findSel(mouse) == sel )
+ {
+ press(sel);
+ drawView();
+ }
+ clearEvent(event);
+ }
+ else if( event.what == evKeyDown )
+ switch (ctrlToArrow(event.keyDown.keyCode))
+ {
+ case kbUp:
+ if( (state & sfFocused) != 0 )
+ {
+ if( --sel < 0 )
+ sel = strings->getCount()-1;
+ movedTo(sel);
+ drawView();
+ clearEvent(event);
+ }
+ break;
+
+ case kbDown:
+ if( (state & sfFocused) != 0 )
+ {
+ if( ++sel >= strings->getCount() )
+ sel = 0;
+ movedTo(sel);
+ drawView();
+ clearEvent(event);
+ }
+ break;
+ case kbRight:
+ if( (state & sfFocused) != 0 )
+ {
+ sel += size.y;
+ if( sel >= strings->getCount() )
+ {
+ sel = (sel + 1) % size.y;
+ if( sel >= strings->getCount() )
+ sel = 0;
+ }
+ movedTo(sel);
+ drawView();
+ clearEvent(event);
+ }
+ break;
+ case kbLeft:
+ if( (state & sfFocused) != 0 )
+ {
+ if( sel > 0 )
+ {
+ sel -= size.y;
+ if( sel < 0 )
+ {
+ sel = ((strings->getCount()+size.y-1) /size.y)*size.y + sel - 1;
+ if( sel >= strings->getCount() )
+ sel = strings->getCount()-1;
+ }
+ }
+ else
+ sel = strings->getCount()-1;
+ movedTo(sel);
+ drawView();
+ clearEvent(event);
+ }
+ break;
+ default:
+ for( int i = 0; i < strings->getCount(); i++ )
+ {
+ char c = hotKey( getItemText(i) );
+ if( TGKey::GetAltCode(c) == event.keyDown.keyCode ||
+ ( ( owner->phase == phPostProcess ||
+ (state & sfFocused) != 0
+ ) &&
+ c != 0 &&
+ TGKey::CompareASCII(uctoupper(event.keyDown.charScan.charCode),c)
+ )
+ )
+ {
+ select();
+ sel = i;
+ movedTo(sel);
+ press(sel);
+ drawView();
+ clearEvent(event);
+ return;
+ }
+ }
+ if( event.keyDown.charScan.charCode == ' ' &&
+ (state & sfFocused) != 0
+ )
+ {
+ press(sel);
+ drawView();
+ clearEvent(event);
+ }
+ }
+}
+
+void TCluster::setData(void * rec)
+{
+ memcpy(&value,rec,dataSize());
+ drawView();
+}
+
+void TCluster::setState( ushort aState, Boolean enable )
+{
+ TView::setState( aState, enable );
+ if( aState == sfSelected || aState == sfDisabled )
+ drawView();
+}
+
+Boolean TCluster::mark( int )
+{
+ return False;
+}
+
+void TCluster::movedTo( int /*item*/ )
+{
+ if (owner && (options & ofBeVerbose))
+ message(owner,evBroadcast,cmClusterMovedTo,this);
+}
+
+void TCluster::press( int /*item*/ )
+{
+ if (owner && (options & ofBeVerbose))
+ message(owner,evBroadcast,cmClusterPress,this);
+}
+
+int TCluster::column( int item )
+{
+ if( item < size.y )
+ return 0;
+ else
+ {
+ int width = 0;
+ int col = -6;
+ int l = 0;
+ for( int i = 0; i <= item; i++ )
+ {
+ if( i % size.y == 0 )
+ {
+ col += width + 6;
+ width = 0;
+ }
+
+ if( i < strings->getCount() )
+ l = cstrlen( getItemText(i) );
+ if( l > width )
+ width = l;
+ }
+ return col;
+ }
+}
+
+int TCluster::findSel( TPoint p )
+{
+ TRect r = getExtent();
+ if( !r.contains(p) )
+ return -1;
+ else
+ {
+ int i = 0;
+ while( p.x >= column( i + size.y ) )
+ i += size.y;
+ int s = i + p.y;
+ if( s >= strings->getCount() )
+ return -1;
+ else
+ return s;
+ }
+}
+
+int TCluster::row( int item )
+{
+ return item % size.y;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Appends the provided TMenuItem at the end of the chain.@*
+ Coded by SET. That's a mix between Dean Wakerley and TVTools ideas.
+
+***************************************************************************/
+
+void TSItem::append( TSItem *aNext )
+{
+ TSItem *item = this;
+ for ( ; item->next; item = item->next );
+ item->next = aNext;
+}
+
+#if !defined( NO_STREAM )
+void TCluster::write( opstream& os )
+{
+ TView::write( os );
+ os << value << sel << strings;
+}
+
+void *TCluster::read( ipstream& is )
+{
+ TView::read( is );
+ is >> value >> sel >> strings;
+ setCursor( 2, 0 );
+ showCursor();
+ return this;
+}
+
+TStreamable *TCluster::build()
+{
+ return new TCluster( streamableInit );
+}
+
+TCluster::TCluster( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tcollect.cc b/tvision/classes/tcollect.cc
new file mode 100644
index 0000000..65ad764
--- /dev/null
+++ b/tvision/classes/tcollect.cc
@@ -0,0 +1,44 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TCollection
+#include <tv.h>
+
+#if !defined( NO_STREAM )
+
+void TCollection::write( opstream& os )
+{
+ os << count << limit << delta;
+ for( ccIndex idx = 0; idx < count; idx++ )
+ writeItem( items[idx], os );
+}
+
+void *TCollection::read( ipstream& is )
+{
+ int limit;
+ is >> count >> limit >> delta;
+ limit = 0;
+ setLimit(limit);
+ for( ccIndex idx = 0; idx < count; idx++ )
+ items[idx] = readItem( is );
+ return this;
+}
+
+TCollection::TCollection( StreamableInit )
+{
+}
+
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tcolordi.cc b/tvision/classes/tcolordi.cc
new file mode 100644
index 0000000..6d48326
--- /dev/null
+++ b/tvision/classes/tcolordi.cc
@@ -0,0 +1,184 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea: added i18n support, enlarged the dialog,
+horizontal scroll bar in items, etc.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TColorSelector
+#define Uses_TMonoSelector
+#define Uses_TColorDisplay
+#define Uses_TColorItem
+#define Uses_TColorItemList
+#define Uses_TColorGroup
+#define Uses_TColorGroupList
+#define Uses_TColorDialog
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TGroup
+#define Uses_TScrollBar
+#define Uses_T1Label
+#define Uses_TButton
+#define Uses_TRect
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#define Uses_TScreen
+// For the "Try" button:
+#define Uses_TProgram
+#define Uses_TDeskTop
+#include <tv.h>
+
+TColorDialog::TColorDialog( TPalette *aPalette, TColorGroup *aGroups ):
+ TWindowInit( &TColorDialog::initFrame )
+ , TDialog( TRect( 0, 0, 77, 18 ), __("Colors") )
+{
+ options |= ofCentered;
+ pal = aPalette;
+
+ TScrollBar *sb = new TScrollBar( TRect( 31, 3, 32, 14 ) );
+ insert( sb );
+
+ groups = new TColorGroupList( TRect( 3, 3, 31, 14 ), sb, aGroups);
+ insert( groups );
+ insert( new T1Label( 2, 2, __("~G~roup"), groups ) );
+
+ sb = new TScrollBar( TRect( 57, 3, 58, 13 ) );
+ insert( sb );
+ TScrollBar *sbH = new TScrollBar( TRect( 34, 13, 57, 14 ) );
+ sbH->setParams(0,0,40,5,1);
+ insert( sbH );
+
+ TView *p = new TColorItemList( TRect( 34, 3, 57, 13 ), sb, aGroups->items, sbH );
+ insert( p );
+ insert( new T1Label( 33, 2, __("~I~tem"), p ) );
+
+ forSel = new TColorSelector( TRect( 61, 3, 73, 7 ),
+ TColorSelector::csForeground );
+ insert( forSel );
+ forLabel = new T1Label( 61, 2, __("~F~oreground"), forSel );
+ insert( forLabel );
+
+ int ib = TScreen::getBlinkState() ? 0 : 2;
+
+ bakSel = new TColorSelector( TRect( 61, 9, 73, 11 + ib),
+ TColorSelector::csBackground );
+ insert( bakSel );
+ bakLabel = new T1Label( 61, 8, __("~B~ackground"), bakSel );
+ insert( bakLabel );
+
+ display = new TColorDisplay( TRect( 60, 12 + ib, 74, 14 + ib),
+ _("Text ") );
+ insert( display );
+
+ monoSel = new TMonoSelector( TRect( 60, 3, 75, 7 ) );
+ monoSel->hide();
+ insert( monoSel );
+ monoLabel = new T1Label( 59, 2, __("Color"), monoSel );
+ monoLabel->hide();
+ insert( monoLabel );
+
+ if( aGroups != 0 && aGroups->items != 0 && pal)
+ display->setColor( (uchar *)&pal->data[ aGroups->items->index ] );
+
+ insert( new TButton( TRect( 31 - 10*ib, 15, 44 - 10*ib, 17 ),
+ __("~T~ry"), cmTryColors, bfNormal ) );
+ insert( new TButton( TRect( 46 - 10*ib, 15, 59 - 10*ib, 17 ),
+ __("~O~K"), cmOK, bfDefault ) );
+ insert( new TButton( TRect( 61 - 10*ib, 15, 74 - 10*ib, 17 ),
+ __("Cancel"),
+ cmCancel,
+ bfNormal ) );
+ selectNext( False );
+}
+
+TColorDialog::~TColorDialog()
+{
+}
+
+void TColorDialog::handleEvent( TEvent& event )
+{
+ TDialog::handleEvent( event );
+ if( event.what==evBroadcast && event.message.command==cmNewColorIndex )
+ display->setColor( (uchar *)&pal->data[event.message.infoLong] );
+ else
+ // SET: Added this button to test the colors without pressing OK.
+ if (event.what==evCommand && event.message.command==cmTryColors)
+ { // That's a new broadcast, I used it for the editor because the
+ // colors are cached.
+ message(TProgram::deskTop,evBroadcast,cmUpdateColorsChanged,0);
+ TProgram::application->CLY_Redraw();
+ }
+}
+
+uint32 TColorDialog::dataSize()
+{
+ return *pal->data + 1;
+}
+
+void TColorDialog::getData( void *rec )
+{
+ memcpy( rec, pal->data, *pal->data+1 );
+}
+
+void TColorDialog::setData( void *rec)
+{
+ TPalette *p = (TPalette *)rec;
+
+ memcpy( pal->data, p->data, *p->data+1 );
+ display->setColor( (uchar *)&pal->data[1] );
+ groups->focusItem( 0 );
+ if( showMarkers )
+ {
+ forLabel->hide();
+ forSel->hide();
+ bakLabel->hide();
+ bakSel->hide();
+ monoLabel->show();
+ monoSel->show();
+ }
+ groups->select();
+}
+
+#if !defined( NO_STREAM )
+void TColorDialog::write( opstream& os )
+{
+ TDialog::write( os );
+ os << display << groups << forLabel << forSel
+ << bakLabel << bakSel << monoLabel << monoSel;
+}
+
+void *TColorDialog::read( ipstream& is )
+{
+ TDialog::read( is );
+ is >> display >> groups >> forLabel >> forSel
+ >> bakLabel >> bakSel >> monoLabel >> monoSel;
+ pal = 0;
+ return this;
+}
+
+TStreamable *TColorDialog::build()
+{
+ return new TColorDialog( streamableInit );
+}
+
+TColorDialog::TColorDialog( StreamableInit ) :
+ TWindowInit( &TColorDialog::initFrame )
+ , TDialog( streamableInit )
+{
+}
+
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tcolorgr.cc b/tvision/classes/tcolorgr.cc
new file mode 100644
index 0000000..b01dd4b
--- /dev/null
+++ b/tvision/classes/tcolorgr.cc
@@ -0,0 +1,224 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea for i18n support.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TColorItem
+#define Uses_TColorGroup
+#define Uses_TColorGroupList
+#define Uses_TGroup
+#define Uses_TRect
+#define Uses_opstream
+#define Uses_ipstream
+#include <tv.h>
+
+TColorGroup::TColorGroup( const char *nm, TColorItem *itm, TColorGroup *nxt )
+{
+ items = itm;
+ next = nxt;
+ name = newStr( nm );
+ cacheName = NULL;
+}
+
+TColorGroup::~TColorGroup()
+{
+ DeleteArray((char *)name);
+ TVIntl::freeSt(cacheName);
+}
+
+TColorGroup& operator + ( TColorGroup& g, TColorItem& i )
+{
+ TColorGroup *grp = &g;
+ while( grp->next != 0 )
+ grp = grp->next;
+
+ if( grp->items == 0 )
+ grp->items = &i;
+ else
+ {
+ TColorItem *cur = grp->items;
+ while( cur->next != 0 )
+ cur = cur->next;
+ cur->next = &i;
+ }
+ return g;
+}
+
+TColorGroup& operator + ( TColorGroup& g1, TColorGroup& g2 )
+{
+ TColorGroup *cur = &g1;
+ while( cur->next != 0 )
+ cur = cur->next;
+ cur->next = &g2;
+ return g1;
+}
+
+
+TColorGroupList::TColorGroupList( const TRect& bounds,
+ TScrollBar *aScrollBar,
+ TColorGroup *aGroups
+ ) :
+ TListViewer( bounds, 1, 0, aScrollBar ),
+ groups( aGroups )
+{
+ int i = 0;
+ while( aGroups != 0 )
+ {
+ aGroups = aGroups->next;
+ i++;
+ }
+ setRange(i);
+}
+
+static void freeItems( TColorItem *curItem )
+{
+ while( curItem != 0 )
+ {
+ TColorItem *p = curItem;
+ curItem = curItem->next;
+ delete(p);
+ }
+}
+
+static void freeGroups( TColorGroup *curGroup )
+{
+ while( curGroup != 0 )
+ {
+ TColorGroup *p = curGroup;
+ freeItems( curGroup->items );
+ curGroup = curGroup->next;
+ delete(p);
+ }
+}
+
+TColorGroupList::~TColorGroupList()
+{
+ freeGroups( groups );
+}
+
+void TColorGroupList::focusItem( ccIndex item )
+{
+ TListViewer::focusItem( item );
+ TColorGroup *curGroup = groups;
+ while( item-- > 0 )
+ curGroup = curGroup->next;
+ message( owner, evBroadcast, cmNewColorItem, curGroup->items);
+}
+
+void TColorGroupList::getText( char *dest, ccIndex item, short maxChars )
+{
+ TColorGroup *curGroup = groups;
+ while( item-- > 0 )
+ curGroup = curGroup->next;
+ strncpy( dest, TVIntl::getText(curGroup->name,curGroup->cacheName), maxChars );
+ dest[maxChars] = '\0';
+}
+
+#if !defined( NO_STREAM )
+void TColorGroupList::writeItems( opstream& os, TColorItem *items )
+{
+ short count = 0;
+ TColorItem *cur;
+
+ for( cur = items; cur != 0; cur = cur->next )
+ count++;
+
+ os << count;
+
+ for( cur = items; cur != 0; cur = cur->next )
+ {
+ os.writeString( cur->name );
+ os << cur->index;
+ }
+}
+
+void TColorGroupList::writeGroups( opstream& os, TColorGroup *groups )
+{
+ short count = 0;
+ TColorGroup *cur;
+
+ for( cur = groups; cur != 0; cur = cur->next )
+ count++;
+
+ os << count;
+
+ for( cur = groups; cur != 0; cur = cur->next )
+ {
+ os.writeString( cur->name );
+ writeItems( os, cur->items );
+ }
+}
+
+void TColorGroupList::write( opstream& os )
+{
+ TListViewer::write( os );
+ writeGroups( os, groups );
+}
+
+TColorItem *TColorGroupList::readItems( ipstream& is )
+{
+ short count;
+ is >> count;
+ TColorItem *items = 0;
+ TColorItem **cur = &items;
+ while( count-- > 0 )
+ {
+ const char *nm = is.readString();
+ uchar index;
+ is >> index;
+ *cur = new TColorItem( nm, index );
+ cur = &((*cur)->next);
+ }
+ *cur = 0;
+ return items;
+}
+
+TColorGroup *TColorGroupList::readGroups( ipstream& is )
+{
+ short count;
+ is >> count;
+ TColorGroup *groups = 0;
+ TColorGroup **cur = &groups;
+ while( count-- > 0 )
+ {
+ const char *nm = is.readString();
+ TColorItem *grp = readItems( is );
+ *cur = new TColorGroup( nm, grp );
+ cur = &((*cur)->next);
+ }
+ *cur = 0;
+ return groups;
+}
+
+void *TColorGroupList::read( ipstream& is )
+{
+ TListViewer::read( is );
+ groups = readGroups( is );
+ return this;
+}
+
+TStreamable *TColorGroupList::build()
+{
+ return new TColorGroupList( streamableInit );
+}
+
+TColorGroupList::TColorGroupList( StreamableInit ) :
+ TListViewer( streamableInit )
+{
+}
+
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tcolorit.cc b/tvision/classes/tcolorit.cc
new file mode 100644
index 0000000..1545ca5
--- /dev/null
+++ b/tvision/classes/tcolorit.cc
@@ -0,0 +1,118 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea for i18n support.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TColorItem
+#define Uses_TColorItemList
+#define Uses_TEvent
+#define Uses_TGroup
+#define Uses_TRect
+#define Uses_opstream
+#define Uses_ipstream
+#include <tv.h>
+
+TColorItem::TColorItem( const char *nm, uchar idx, TColorItem *nxt )
+{
+ index = idx;
+ next = nxt;
+ name = newStr( nm );
+ cacheName = NULL;
+}
+
+TColorItem::~TColorItem()
+{
+ DeleteArray((char *)name);
+ TVIntl::freeSt(cacheName);
+}
+
+TColorItem& operator + ( TColorItem& i1, TColorItem& i2 )
+{
+ TColorItem *cur = &i1;
+ while( cur->next != 0 )
+ cur = cur->next;
+ cur->next = &i2;
+ return i1;
+}
+
+TColorItemList::TColorItemList( const TRect& bounds,
+ TScrollBar *aScrollBar,
+ TColorItem *aItems,
+ TScrollBar *aHScrollBar
+ ) :
+ TListViewer( bounds, 1, aHScrollBar, aScrollBar ),
+ items( aItems )
+{
+ eventMask |= evBroadcast;
+ int i = 0;
+ while( aItems != 0 )
+ {
+ aItems = aItems->next;
+ i++;
+ }
+ setRange( i );
+}
+
+void TColorItemList::focusItem( ccIndex item )
+{
+ TListViewer::focusItem( item );
+ TColorItem *curItem = items;
+ while( item-- > 0 )
+ curItem = curItem->next;
+ message( owner, evBroadcast, cmNewColorIndex, (void *)(uipointer)(curItem->index));
+}
+
+void TColorItemList::getText( char *dest, ccIndex item, short maxChars )
+{
+ TColorItem *curItem = items;
+ while( item-- > 0 )
+ curItem = curItem->next;
+ strncpy( dest, TVIntl::getText(curItem->name,curItem->cacheName), maxChars );
+ dest[maxChars] = '\0';
+}
+
+void TColorItemList::handleEvent( TEvent& event )
+{
+ TListViewer::handleEvent( event );
+ if( event.what == evBroadcast && event.message.command == cmNewColorItem )
+ {
+ items = (TColorItem *)event.message.infoPtr;
+ TColorItem *curItem = items;
+ int i = 0;
+ while( curItem != 0 )
+ {
+ curItem = curItem->next;
+ i++;
+ }
+ setRange( i );
+ focusItem( 0 );
+ drawView();
+ }
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TColorItemList::build()
+{
+ return new TColorItemList( streamableInit );
+}
+
+TColorItemList::TColorItemList( StreamableInit ) :
+ TListViewer( streamableInit )
+{
+}
+
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tcolorse.cc b/tvision/classes/tcolorse.cc
new file mode 100644
index 0000000..f9b9b0d
--- /dev/null
+++ b/tvision/classes/tcolorse.cc
@@ -0,0 +1,187 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TColorSelector
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TRect
+#define Uses_TView
+#define Uses_TGroup
+#define Uses_opstream
+#define Uses_ipstream
+#include <tv.h>
+
+TColorSelector::TColorSelector( const TRect& bounds, ColorSel aSelType ) :
+ TView( bounds )
+{
+ options |= ofSelectable | ofFirstClick | ofFramed;
+ eventMask |= evBroadcast;
+ selType = aSelType;
+ color = 0;
+}
+
+void TColorSelector::draw()
+{
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', 0x70, size.x );
+ for(int i = 0; i <= size.y; i++ )
+ {
+ if( i < 4 )
+ {
+ for( int j = 0; j < 4; j++ )
+ {
+ int c = i*4+j;
+ b.moveChar( j*3, icon, c, 3 );
+ if( c == color )
+ {
+ b.putChar( j*3+1, mark );
+ if( c == 0 )
+ b.putAttribute( j*3+1, 0x70 );
+ }
+ }
+ }
+ writeLine( 0, i, size.x, 1, b );
+ }
+}
+
+void TColorSelector::colorChanged()
+{
+ int msg;
+ if( selType == csForeground )
+ msg = cmColorForegroundChanged;
+ else
+ msg = cmColorBackgroundChanged;
+ message( owner, evBroadcast, msg, (void *)(uipointer)color );
+}
+
+void TColorSelector::handleEvent( TEvent& event )
+{
+ const int width = 4;
+ uchar oldColor = color;
+#if 0
+ int maxCol = (selType == csBackground) ? 7 : 15;
+#else
+ int maxCol = size.y == 2 ? 7 : 15;
+#endif
+
+ TView::handleEvent( event );
+
+ switch( event.what )
+ {
+
+ case evMouseDown:
+ do {
+ if( mouseInView( event.mouse.where ) )
+ {
+ TPoint mouse = makeLocal( event.mouse.where );
+ color = mouse.y*4 + mouse.x/3;
+ }
+ else
+ color = oldColor;
+ colorChanged();
+ drawView();
+ } while( mouseEvent( event, evMouseMove ) );
+ break;
+
+ case evKeyDown:
+
+ switch( ctrlToArrow( event.keyDown.keyCode ) )
+ {
+ case kbLeft:
+ if( color > 0 )
+ color--;
+ else
+ color = maxCol;
+ break;
+
+ case kbRight:
+ if( color < maxCol )
+ color++;
+ else
+ color = 0;
+ break;
+
+ case kbUp:
+ if( color > width-1 )
+ color -= width;
+ else if( color == 0 )
+ color = maxCol;
+ else
+ color += maxCol - width;
+ break;
+
+ case kbDown:
+ if( color < maxCol - (width-1) )
+ color += width;
+ else if( color == maxCol )
+ color = 0;
+ else
+ color -= maxCol - width;
+ break;
+
+ default:
+ return;
+ }
+ break;
+
+ case evBroadcast:
+ if( event.message.command == cmColorSet )
+ {
+ if( selType == csBackground )
+ color = event.message.infoLong >> 4;
+ else
+ color = event.message.infoLong & 0x0F;
+ drawView();
+ return ;
+ }
+ else
+ return;
+ default:
+ return ;
+ }
+ drawView();
+ colorChanged();
+ clearEvent( event );
+}
+
+#if !defined( NO_STREAM )
+void TColorSelector::write( opstream& os )
+{
+ TView::write( os );
+ os << color << (short)selType;
+}
+
+void *TColorSelector::read( ipstream& is )
+{
+ short temp;
+ TView::read( is );
+ is >> color >> temp;
+ selType = ColorSel(temp);
+ return this;
+}
+
+TStreamable *TColorSelector::build()
+{
+ return new TColorSelector( streamableInit );
+}
+
+TColorSelector::TColorSelector( StreamableInit ) : TView( streamableInit )
+{
+}
+
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tcommand.cc b/tvision/classes/tcommand.cc
new file mode 100644
index 0000000..27edc8f
--- /dev/null
+++ b/tvision/classes/tcommand.cc
@@ -0,0 +1,267 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TCommandSet
+#define Uses_string
+#include <tv.h>
+
+#include <stdlib.h>
+
+#define MAX_COMMANDS (32 * 2048) /* 65536 commands */
+#define COMMANDS_COUNT (MAX_COMMANDS / 32)
+#define COMMANDS_SIZE (COMMANDS_COUNT * 4)
+
+static
+uint32 masks[32] =
+{
+ 0x00000001,
+ 0x00000002,
+ 0x00000004,
+ 0x00000008,
+ 0x00000010,
+ 0x00000020,
+ 0x00000040,
+ 0x00000080,
+ 0x00000100,
+ 0x00000200,
+ 0x00000400,
+ 0x00000800,
+ 0x00001000,
+ 0x00002000,
+ 0x00004000,
+ 0x00008000,
+ 0x00010000,
+ 0x00020000,
+ 0x00040000,
+ 0x00080000,
+ 0x00100000,
+ 0x00200000,
+ 0x00400000,
+ 0x00800000,
+ 0x01000000,
+ 0x02000000,
+ 0x04000000,
+ 0x08000000,
+ 0x10000000,
+ 0x20000000,
+ 0x40000000,
+ 0x80000000
+};
+
+const uint32 fullMask=0xFFFFFFFF;
+
+static inline
+int loc( int cmd )
+{
+ return cmd / 32;
+}
+
+static inline
+uint32 mask( int cmd )
+{
+ return masks[ cmd & 0x1F ];
+}
+
+static inline
+uint32 rest( int cmd )
+{
+ return cmd & 0x1F;
+}
+
+TCommandSet::TCommandSet()
+{
+ cmds = (uint32 *)calloc(COMMANDS_COUNT,4);
+}
+
+void TCommandSet::enableAllCommands()
+{
+ memset(cmds,0xFF,COMMANDS_SIZE);
+}
+
+TCommandSet::~TCommandSet()
+{
+ free(cmds);
+}
+
+TCommandSet::TCommandSet( const TCommandSet& tc )
+{
+ cmds = (uint32 *)malloc(COMMANDS_SIZE);
+ memcpy(cmds,tc.cmds,COMMANDS_SIZE);
+}
+
+TCommandSet& TCommandSet::operator = (const TCommandSet& tc)
+{
+ memcpy(cmds,tc.cmds,COMMANDS_SIZE);
+ return *this;
+}
+
+Boolean TCommandSet::has( int cmd )
+{
+ return Boolean( (cmd >= MAX_COMMANDS ) ||
+ (cmds[ loc( cmd ) ] & mask( cmd )) != 0 );
+}
+
+void TCommandSet::disableCmd( int cmd )
+{
+ if (cmd < MAX_COMMANDS)
+ cmds[ loc( cmd ) ] &= ~mask( cmd );
+}
+
+void TCommandSet::enableCmd( const TCommandSet& tc )
+{
+ for( int i = 0; i < COMMANDS_COUNT; i++ )
+ cmds[i] |= tc.cmds[i];
+}
+
+void TCommandSet::disableCmd( const TCommandSet& tc )
+{
+ for( int i = 0; i < COMMANDS_COUNT; i++ )
+ cmds[i] &= ~(tc.cmds[i]);
+}
+
+void TCommandSet::enableCmd( int cmd )
+{
+ if (cmd < MAX_COMMANDS)
+ cmds[ loc( cmd ) ] |= mask( cmd );
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Enable a range of contiguous commands. As an example: my editor have more
+than 128 commands, it means just 4 longs and not 128 calls! SET.@p
+ Start is included but not end.
+
+***************************************************************************/
+
+void TCommandSet::enableCmd( int cmdStart, int cmdEnd )
+{
+ if (cmdEnd<MAX_COMMANDS && cmdEnd>cmdStart)
+ {
+ int pStart=loc(cmdStart);
+ uint32 rStart=mask(cmdStart);
+ int pEnd=loc(cmdEnd);
+ uint32 rEnd=mask(cmdEnd);
+ uint32 i;
+ int j;
+
+ // Both in the same word
+ if (pStart==pEnd)
+ {
+ for (i=rStart; i!=rEnd; i<<=1)
+ cmds[pStart]|=i;
+ return;
+ }
+ // Not all of the pStart must be set
+ if (rStart!=1)
+ {
+ for (i=rStart; i; i<<=1)
+ cmds[pStart]|=i;
+ pStart++;
+ }
+ // Set the words in the middle
+ for (j=pStart; j<pEnd; j++)
+ cmds[j]=fullMask;
+ // The bits in the last position
+ for (i=1; i<rEnd; i<<=1)
+ cmds[pEnd]|=i;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Disable a range of contiguous commands. As an example: my editor have more
+than 128 commands, it means just 4 longs and not 128 calls! SET.@p
+ Start is included but not end.
+
+***************************************************************************/
+
+void TCommandSet::disableCmd( int cmdStart, int cmdEnd )
+{
+ if (cmdEnd<MAX_COMMANDS && cmdEnd>cmdStart)
+ {
+ int pStart=loc(cmdStart);
+ uint32 rStart=mask(cmdStart);
+ int pEnd=loc(cmdEnd);
+ uint32 rEnd=mask(cmdEnd);
+ uint32 i;
+ int j;
+
+ // Both in the same word
+ if (pStart==pEnd)
+ {
+ for (i=rStart; i!=rEnd; i<<=1)
+ cmds[pStart]&=~i;
+ return;
+ }
+ // Not all of the pStart must be set
+ if (rStart!=1)
+ {
+ for (i=rStart; i; i<<=1)
+ cmds[pStart]&=~i;
+ pStart++;
+ }
+ // Set the words in the middle
+ for (j=pStart; j<pEnd; j++)
+ cmds[j]=0;
+ // The bits in the last position
+ for (i=1; i<rEnd; i<<=1)
+ cmds[pEnd]&=~i;
+ }
+}
+
+TCommandSet& TCommandSet::operator &= ( const TCommandSet& tc )
+{
+ for( int i = 0; i < COMMANDS_COUNT; i++ )
+ cmds[i] &= tc.cmds[i];
+ return *this;
+}
+
+TCommandSet& TCommandSet::operator |= ( const TCommandSet& tc )
+{
+ for( int i = 0; i < COMMANDS_COUNT; i++ )
+ cmds[i] |= tc.cmds[i];
+ return *this;
+}
+
+TCommandSet operator & ( const TCommandSet& tc1, const TCommandSet& tc2 )
+{
+ TCommandSet temp( tc1 );
+ temp &= tc2;
+ return temp;
+}
+
+TCommandSet operator | ( const TCommandSet& tc1, const TCommandSet& tc2 )
+{
+ TCommandSet temp( tc1 );
+ temp |= tc2;
+ return temp;
+}
+
+Boolean TCommandSet::isEmpty()
+{
+ for( int i = 0; i < COMMANDS_COUNT; i++ )
+ if( cmds[i] != 0 )
+ return False;
+ return True;
+}
+
+int operator == ( const TCommandSet& tc1, const TCommandSet& tc2 )
+{
+ for( int i = 0; i < COMMANDS_COUNT; i++ )
+ if( tc1.cmds[i] != tc2.cmds[i] )
+ return 0;
+ return 1;
+}
+
diff --git a/tvision/classes/tdesktop.cc b/tvision/classes/tdesktop.cc
new file mode 100644
index 0000000..38f1be4
--- /dev/null
+++ b/tvision/classes/tdesktop.cc
@@ -0,0 +1,281 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified cursor behavior while desktop locked by Salvador E. Tropea (SET)
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <stdlib.h>
+
+#define Uses_TDeskTop
+#define Uses_TRect
+#define Uses_TPoint
+#define Uses_TEvent
+#define Uses_TBackground
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TScreen
+#define Uses_TVCodePage
+#include <tv.h>
+
+TDeskInit::TDeskInit( TBackground *(*cBackground)( TRect ) ) :
+ createBackground( cBackground )
+{
+}
+
+TDeskTop::TDeskTop( const TRect& bounds ) :
+ TDeskInit( &TDeskTop::initBackground )
+ , TGroup(bounds)
+{
+ growMode = gfGrowHiX | gfGrowHiY;
+
+ TScreen::setCursorPos( bounds.a.x , bounds.b.y );
+
+ if( createBackground != 0 &&
+ (background = createBackground( getExtent() )) != 0 )
+ insert( background );
+}
+
+void TDeskTop::shutDown()
+{
+ background = 0;
+ TGroup::shutDown();
+}
+
+inline Boolean Tileable( TView *p )
+{
+ return Boolean( (p->options & ofTileable) != 0 && (p->state & sfVisible) != 0 );
+}
+
+static short cascadeNum;
+static TView *lastView;
+
+void doCount( TView* p, void * )
+{
+ if( Tileable( p ) )
+ {
+ cascadeNum++;
+ lastView = p;
+ }
+}
+
+void doCascade( TView* p, void *r )
+{
+ if( Tileable( p ) && cascadeNum >= 0 )
+ {
+ TRect NR = *(TRect *)r;
+ NR.a.x += cascadeNum;
+ NR.a.y += cascadeNum;
+ p->locate( NR );
+ cascadeNum--;
+ }
+}
+
+void TDeskTop::cascade( const TRect &r )
+{
+ TPoint min, max;
+ cascadeNum = 0;
+ forEach( doCount, 0 );
+ if( cascadeNum > 0 )
+ {
+ lastView->sizeLimits( min, max );
+ if( (min.x > r.b.x - r.a.x - cascadeNum) ||
+ (min.y > r.b.y - r.a.y - cascadeNum) )
+ tileError();
+ else
+ {
+ cascadeNum--;
+ lock();
+ forEach( doCascade, (void *)&r );
+ unlock();
+ }
+ }
+}
+
+void TDeskTop::handleEvent(TEvent& event)
+{
+ if( (event.what == evBroadcast) && (event.message.command == cmReleasedFocus) )
+ // SET: Move the cursor away, hopefully we will have a status bar.
+ // Helps Braille Terminals to know the object lost the focus.
+ TScreen::setCursorPos( origin.x , origin.y + size.y );
+ TGroup::handleEvent( event );
+ if( event.what == evBroadcast && event.message.command == cmUpdateCodePage &&
+ background )
+ background->changePattern(TVCodePage::RemapChar(
+ TDeskTop::odefaultBkgrnd,
+ (ushort *)event.message.infoPtr));
+
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmNext:
+ if (valid(cmReleasedFocus))
+ selectNext( False );
+ break;
+ case cmPrev:
+ if (valid(cmReleasedFocus))
+ current->putInFrontOf( background );
+ break;
+ default:
+ return;
+ }
+ clearEvent( event );
+ }
+}
+
+TBackground *TDeskTop::initBackground( TRect r )
+{
+ return new TBackground( r, defaultBkgrnd );
+}
+
+// SET: made static and used unsigned instead of short.
+// It calculates the square root truncating the decimals.
+static
+unsigned iSqr( unsigned i )
+{
+ unsigned res1 = 2;
+ unsigned res2 = i/res1;
+ while( abs( res1 - res2 ) > 1 )
+ {
+ res1 = (res1 + res2)/2;
+ res2 = i/res1;
+ }
+ return res1 < res2 ? res1 : res2;
+}
+
+void mostEqualDivisors(int n, int& x, int& y)
+{
+ int i;
+
+ i = iSqr( n );
+ if( n % i != 0 )
+ if( n % (i+1) == 0 )
+ i++;
+ if( i < (n/i) )
+ i = n/i;
+
+ x = n/i;
+ y = i;
+}
+
+// SET: All to ints, they are the best type for any compiler
+static int numCols, numRows, numTileable, leftOver, tileNum;
+
+void doCountTileable( TView* p, void * )
+{
+ if( Tileable( p ) )
+ numTileable++;
+}
+
+int dividerLoc( int lo, int hi, int num, int pos)
+{
+ return int(long(hi-lo)*pos/long(num)+lo);
+}
+
+TRect calcTileRect( int pos, const TRect &r )
+{
+ int x, y;
+ TRect nRect;
+
+ int d = (numCols - leftOver) * numRows;
+ if( pos < d )
+ {
+ x = pos / numRows;
+ y = pos % numRows;
+ }
+ else
+ {
+ x = (pos-d)/(numRows+1) + (numCols-leftOver);
+ y = (pos-d)%(numRows+1);
+ }
+ nRect.a.x = dividerLoc( r.a.x, r.b.x, numCols, x );
+ nRect.b.x = dividerLoc( r.a.x, r.b.x, numCols, x+1 );
+ if( pos >= d )
+ {
+ nRect.a.y = dividerLoc(r.a.y, r.b.y, numRows+1, y);
+ nRect.b.y = dividerLoc(r.a.y, r.b.y, numRows+1, y+1);
+ }
+ else
+ {
+ nRect.a.y = dividerLoc(r.a.y, r.b.y, numRows, y);
+ nRect.b.y = dividerLoc(r.a.y, r.b.y, numRows, y+1);
+ }
+ return nRect;
+}
+
+void doTile( TView* p, void *lR )
+{
+ if( Tileable( p ) )
+ {
+ TRect r = calcTileRect( tileNum, *(const TRect *)lR );
+ p->locate(r);
+ tileNum--;
+ }
+}
+
+void TDeskTop::tile( const TRect& r )
+{
+ numTileable = 0;
+ forEach( doCountTileable, 0 );
+ if( numTileable > 0 )
+ {
+ // SET: This trick makes the partitions in the reverse order
+ if( getOptions() & dsktTileVertical )
+ mostEqualDivisors( numTileable, numRows, numCols );
+ else
+ mostEqualDivisors( numTileable, numCols, numRows );
+ if( ( (r.b.x - r.a.x)/numCols == 0 ) ||
+ ( (r.b.y - r.a.y)/numRows == 0) )
+ tileError();
+ else
+ {
+ leftOver = numTileable % numCols;
+ tileNum = numTileable - 1;
+ lock();
+ forEach( doTile, (void *)&r );
+ unlock();
+ }
+ }
+}
+
+void TDeskTop::tileError()
+{
+}
+
+// SET: TViews will ask us if that's good time to draw cursor changes
+Boolean TDeskTop::canShowCursor()
+{
+ return lockFlag ? False : True;
+}
+
+// SET: If nobody will recover the focus move the cursor to the status line
+ushort TDeskTop::execView( TView *p )
+{
+ ushort ret=TGroup::execView(p);
+ if (p && !current)
+ TScreen::setCursorPos(0,TScreen::screenHeight-1);
+ return ret;
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TDeskTop::build()
+{
+ return new TDeskTop( streamableInit );
+}
+
+TDeskTop::TDeskTop( StreamableInit ) :
+ TDeskInit( NULL )
+ , TGroup( streamableInit )
+{
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tdialog.cc b/tvision/classes/tdialog.cc
new file mode 100644
index 0000000..ede375e
--- /dev/null
+++ b/tvision/classes/tdialog.cc
@@ -0,0 +1,108 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TKeys
+#define Uses_TDialog
+#define Uses_TEvent
+#define Uses_TPalette
+#define Uses_TApplication
+#include <tv.h>
+
+#define cpDialog "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F"\
+ "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F"
+
+TDialog::TDialog( const TRect& bounds, const char *aTitle ) :
+ TWindowInit( &TDialog::initFrame )
+ , TWindow( bounds, aTitle, wnNoNumber )
+{
+ growMode = 0;
+ flags = wfMove | wfClose;
+}
+
+TPalette& TDialog::getPalette() const
+{
+ static TPalette palette1( cpDialog, sizeof( cpDialog )-1 );
+ static TPalette palette2( 0, 0 );
+
+ // Avoid returning the palette if the dialog isn't inserted on the
+ // desktop or the application. Example: a dialog inside another.
+ if ( (owner == (TGroup*)TApplication::deskTop) ||
+ (owner == (TGroup*)TApplication::application)
+ ) return palette1;
+ return palette2;
+}
+
+void TDialog::handleEvent(TEvent& event)
+{
+ TWindow::handleEvent(event);
+ switch (event.what)
+ {
+ case evKeyDown:
+ switch (event.keyDown.keyCode)
+ {
+ case kbEsc:
+ event.what = evCommand;
+ event.message.command = cmCancel;
+ event.message.infoPtr = 0;
+ putEvent(event);
+ clearEvent(event);
+ break;
+ case kbEnter:
+ event.what = evBroadcast;
+ event.message.command = cmDefault;
+ event.message.infoPtr = 0;
+ putEvent(event);
+ clearEvent(event);
+ break;
+ }
+ break;
+
+ case evCommand:
+ switch( event.message.command )
+ {
+ case cmOK:
+ case cmCancel:
+ case cmYes:
+ case cmNo:
+ if( (state & sfModal) != 0 )
+ {
+ endModal(event.message.command);
+ clearEvent(event);
+ }
+ break;
+ }
+ break;
+ }
+}
+
+Boolean TDialog::valid( ushort command )
+{
+ if( command == cmCancel )
+ return True;
+ else
+ return TGroup::valid( command );
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TDialog::build()
+{
+ return new TDialog( streamableInit );
+}
+
+TDialog::TDialog( StreamableInit ) :
+ TWindowInit( 0 )
+ , TWindow( streamableInit )
+{
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tdircoll.cc b/tvision/classes/tdircoll.cc
new file mode 100644
index 0000000..4bb39fd
--- /dev/null
+++ b/tvision/classes/tdircoll.cc
@@ -0,0 +1,40 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TDirCollection
+#define Uses_TDirEntry
+#define Uses_opstream
+#define Uses_ipstream
+#include <tv.h>
+
+#if !defined( NO_STREAM )
+TStreamable *TDirCollection::build()
+{
+ return new TDirCollection( streamableInit );
+}
+
+void TDirCollection::writeItem( void *obj, opstream& os )
+{
+ TDirEntry *item = (TDirEntry *)obj;
+ os.writeString( item->text() );
+ os.writeString( item->dir() );
+}
+
+void *TDirCollection::readItem( ipstream& is )
+{
+ const char *txt = is.readString();
+ const char *dir = is.readString();
+ return new TDirEntry( txt, dir );
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tdirlist.cc b/tvision/classes/tdirlist.cc
new file mode 100644
index 0000000..178114a
--- /dev/null
+++ b/tvision/classes/tdirlist.cc
@@ -0,0 +1,537 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+Modified by Salvador E. Tropea:
+* Changed to sort directory names.
+* Added incremental directory search.
+* Added horizontal scroll bar.
+* Made cursor visible.
+* Abstracted platform dependent detail, more things must be done.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <tv/configtv.h>
+#define Uses_string
+#define Uses_sys_stat
+#define Uses_TDirListBox
+#define Uses_TEvent
+#define Uses_TDirCollection
+#define Uses_TChDirDialog
+#define Uses_TDirEntry
+#define Uses_TButton
+#define Uses_TStreamableClass
+#define Uses_TStringCollection
+#define Uses_TKeys
+#define Uses_TVCodePage
+#define Uses_TScrollBar
+#if defined(TVCompf_djgpp) || defined(TVComp_BCPP)
+ #define Uses_dir // getdisk()
+#endif
+#include <tv.h>
+
+TDirListBox::TDirListBox( const TRect& bounds, TScrollBar *aVScrollBar,
+ TScrollBar *aHScrollBar ) :
+ TListBox( bounds, 1, aHScrollBar, aVScrollBar ),
+ cur( 0 )
+{
+ *dir = EOS;
+ incPos = 0;
+ // SET: Now we use it for the incremental search
+ showCursor();
+}
+
+TDirListBox::~TDirListBox()
+{
+ CLY_destroy( list() );
+}
+
+void TDirListBox::draw()
+{
+ TListBox::draw();
+ // SET: Put the cursor over the directory name. Also add an offset
+ // if we are doing an incremental search. BTW: It should help blind
+ // people.
+ if( focused >= 0 && focused < list()->getCount() )
+ updateCursorPos();
+}
+
+void TDirListBox::getText( char *text, ccIndex item, short maxChars )
+{
+ strncpy( text, list()->at(item)->text(), maxChars );
+ text[maxChars] = '\0';
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This is a new member added to update the cursor position. Originaly this
+class had no cursor. Now is used to show the incremental search state.
+
+***************************************************************************/
+
+void TDirListBox::updateCursorPos()
+{
+ int x = list()->at( focused )->offset() + 1;
+ // Here we emulate the TSortedListBox behavior
+ if( incPos > 1 )
+ x += incPos - 1;
+ if( hScrollBar )
+ x -= hScrollBar->value;
+ if( x <= 0 )
+ hideCursor();
+ else
+ {
+ setCursor( x, focused - topItem );
+ showCursor();
+ }
+}
+
+void TDirListBox::handleEvent( TEvent& event )
+{
+ if( event.what == evMouseDown && event.mouse.doubleClick )
+ {
+ event.what = evCommand;
+ event.message.command = cmChangeDir;
+ putEvent( event );
+ clearEvent( event );
+ return;
+ }
+ else if( event.what == evKeyDown )
+ {// SET: Incremental directory search
+ if( event.keyDown.keyCode != kbEnter &&
+ ( event.keyDown.charScan.charCode != 0 ||
+ event.keyDown.keyCode == kbBack ) )
+ {
+ if( event.keyDown.keyCode == kbBack )
+ {
+ if( incPos > 0 )
+ incPos--;
+ }
+ else
+ incremental[incPos++] = event.keyDown.charScan.charCode;
+ incremental[incPos] = 0;
+ TDirCollection *dirs = list();
+ ccIndex c = dirs->getCount();
+ ccIndex newFocus = -1;
+ if( focused < c && cur < c )
+ {
+ int offset = strlen( dirs->at( cur )->dir() ) + 1;
+ if( focused > cur )
+ // From focused
+ for( int i = focused; i < c; i++ )
+ {
+ if( strncasecmp( dirs->at( i )->dir() + offset,
+ incremental, incPos ) == 0 )
+ {
+ newFocus = i;
+ break;
+ }
+ }
+ // From beginning
+ for( int i = cur + 1; newFocus < 0 && i < c; i++ )
+ {
+ if( strncasecmp( dirs->at( i )->dir() + offset,
+ incremental, incPos ) == 0 )
+ newFocus = i;
+ }
+ if( newFocus < 0 )
+ {
+ if( event.keyDown.keyCode != kbBack )
+ incPos--;
+ if( TVCodePage::isAlNum( event.keyDown.charScan.charCode ) )
+ {
+ clearEvent( event );
+ return;
+ }
+ }
+ else
+ {
+ if( newFocus != focused )
+ focusItem( newFocus );
+ else
+ updateCursorPos();
+ clearEvent( event );
+ return;
+ }
+ }
+ }
+ }
+ ccIndex oldFocused = focused;
+ TListBox::handleEvent( event );
+ // SET: Reset the incremental search if the user changed the focus
+ if( oldFocused != focused )
+ {
+ incPos = 0;
+ updateCursorPos();
+ }
+}
+
+Boolean TDirListBox::isSelected( ccIndex item )
+{
+ return Boolean( item == cur );
+}
+
+#ifndef CLY_HaveDriveLetters
+// Mostly POSIX systems where drive letter doesn't exist
+
+void TDirListBox::showDrives( TDirCollection * )
+{
+}
+
+#else
+// Mostly DOS and Win32
+
+#if defined(TVCompf_djgpp) || defined(TVComp_BCPP)
+#include <dos.h>
+#else
+#include <io.h>
+#include <direct.h> //_getdrive()
+#define getdisk() (_getdrive()-1)
+#endif
+
+void TDirListBox::showDrives( TDirCollection *dirs )
+{
+ Boolean isFirst = True;
+ char oldc[5];
+ strcpy( oldc, "0:"DIRSEPARATOR_ );
+ // SET: We actually assume firstDir, middleDir and lastDir have the same
+ // len. Otherwise the list becomes unreadable.
+ // Doing this I replaced strcpy by memcpy and avoided continues strlen
+ // computations.
+ unsigned lenStr = strlen( firstDir );
+ for( char c = 'a'; c <= 'z'; c++ )
+ {
+ if( c < 'c' || driveValid( c ) )
+ {
+ if( oldc[0] != '0' )
+ {
+ char s[ 16 ];
+ if( isFirst )
+ {
+ isFirst = False;
+ memcpy( s, firstDir, lenStr );
+ }
+ else
+ memcpy( s, middleDir, lenStr );
+ s[ lenStr ] = oldc[0];
+ s[ lenStr+1 ] = EOS;
+ dirs->insert( new TDirEntry( s, oldc, lenStr ) );
+ }
+ if( c == getdisk() + 'a' )
+ cur = dirs->getCount();
+ oldc[0] = c;
+ }
+ }
+ if( oldc[0] != '0' )
+ {
+ char s[ 16 ];
+ memcpy( s, lastDir, lenStr );
+ s[ lenStr ] = oldc[0];
+ s[ lenStr+1 ] = EOS;
+ dirs->insert( new TDirEntry( s, oldc, lenStr ) );
+ }
+ // SET: No need to scroll here
+ if( hScrollBar )
+ hScrollBar->setRange( 0, 0 );
+ // SET: Reset incremental search
+ incPos = 0;
+}
+#endif // CLY_HaveDriveLetters
+
+
+/*****************************************************************************
+ char *SkipDriveName( const char *dir )
+ This is a helper to skip the characters used by the drive letter in the
+specified dir string.
+ Added by SET to make the code maintainable.
+*****************************************************************************/
+
+#ifndef CLY_HaveDriveLetters
+// Mostly POSIX systems where drive letter doesn't exist
+
+// SET: Here we have to "skip" the drive name
+#if !defined(TVOSf_QNX4)
+static
+char *SkipDriveName( char *dir )
+{
+ return dir + 1;
+}
+#else
+// Special case "//nodenumber/"
+static
+char *SkipDriveName( char *dir )
+{
+ char *end;
+
+ if( (*dir == '/') && (dir[1] == '/') )
+ {
+ end = strchr( dir+2, DIRSEPARATOR );
+ if( !end )
+ end = dir + 1; // fallback to usual UNIX path.
+ else
+ end += 1; // split the //nodenumber/ string.
+ }
+ else
+ end = dir + 1; // usual UNIX path.
+ return end;
+}
+#endif // TVOSf_QNX4
+
+#else
+// Mostly DOS and Win32
+
+static
+char *SkipDriveName( char *dir )
+{
+ return dir + 3;
+}
+#endif // CLY_HaveDriveLetters
+
+/*****************************************************************************
+ End of char *SkipDriveName( const char *dir )
+*****************************************************************************/
+
+/*****************************************************************************
+ TStringCollection *ListDirectory( char *path, char *end )
+ This is a helper to collect the directories found in path using "end" as
+base to construct a mask.
+ Added by SET to make the code maintainable.
+*****************************************************************************/
+
+#if defined(TVOS_UNIX) || defined(TVCompf_Cygwin)
+// POSIX solution using opendir and stat
+#include <dirent.h>
+
+static
+TStringCollection *ListDirectory( char *path, char *end )
+{
+ *end = 0;
+ TStringCollection *col = new TStringCollection( 10, 10 );
+
+ DIR *d = opendir( path );
+ if( d )
+ {
+ struct dirent *ent;
+ while( (ent = readdir(d)) != 0 )
+ {
+ struct stat st;
+ strcpy( end, ent->d_name );
+ stat( path, &st );
+ if( S_ISDIR(st.st_mode) && strcmp(ent->d_name,".")!=0 &&
+ strcmp(ent->d_name,"..")!=0 )
+ col->insert( newStr( ent->d_name ) );
+ }
+ closedir( d );
+ }
+ return col;
+}
+
+#else
+#if !defined(TVCompf_djgpp) && !defined(TVComp_BCPP)
+// MSVC Win32 solution. It uses _findfirst
+
+static
+TStringCollection *ListDirectory( char *path, char *end )
+{
+ strcpy( end, "*" );
+ TStringCollection *col=new TStringCollection( 10, 10 );
+
+ _finddata_t ff;
+ long res = _findfirst( path, &ff );
+ if( res != -1 )
+ {
+ do
+ {
+ if( (ff.attrib & _A_SUBDIR) != 0 && ff.name[0] != '.' )
+ col->insert( newStr( ff.name ) );
+ }
+ while( _findnext( res, &ff )==0 );
+ _findclose( res );
+ }
+ return col;
+}
+
+#else // DJGPP and BC++
+// DJGPP and BC++ solution. It uses findfirst
+
+#if 0
+extern "C" unsigned short ffattrib(struct ffblk *);
+extern "C" char *ffname(struct ffblk *);
+#define A(s) ffattrib(&s)
+#define N(s) ffname(&s)
+#else
+#define A(s) s.ff_attrib
+#define N(s) s.ff_name
+#endif
+
+static
+TStringCollection *ListDirectory( char *path, char *end )
+{
+ strcpy( end, "*" );
+ TStringCollection *col=new TStringCollection(10,10);
+
+ ffblk ff;
+ int res = findfirst( path, &ff, FA_DIREC );
+ while( res == 0 )
+ {
+ if( (A(ff) & FA_DIREC) != 0 && N(ff)[0] != '.' )
+ col->insert( newStr( N(ff) ) );
+ res = findnext( &ff );
+ }
+ return col;
+}
+
+#undef A
+#undef N
+#endif
+#endif // DJGPP
+
+/*****************************************************************************
+ End of TStringCollection *ListDirectory( char *path, char *end )
+*****************************************************************************/
+
+void TDirListBox::showDirs( TDirCollection *dirs )
+{
+ const int indentSize = 2;
+ int indent = indentSize;
+
+ char buf[PATH_MAX*2];
+ memset( buf, ' ', sizeof( buf ) );
+ char *name = buf + PATH_MAX;
+
+ // SET: Same here, we assume all separators have the same len
+ unsigned lenSep = strlen( pathDir );
+ // The first ramification of the tree
+ char *org = name - lenSep;
+ strcpy( org, pathDir );
+
+ char *curDir = dir;
+ char *end = SkipDriveName( dir );
+ char hold = *end;
+ *end = EOS; // mark end of drive name
+ strcpy( name, curDir );
+ dirs->insert( new TDirEntry( org, name, lenSep ) );
+ *end = hold; // restore full path
+ curDir = end;
+
+ unsigned maxLen = 0;
+ while( (end = strchr( curDir, DIRSEPARATOR )) != 0 )
+ {
+ *end = EOS;
+ unsigned lname = unsigned(end-curDir);
+ memcpy( name, curDir, lname );
+ name[lname] = EOS;
+ lname += indent + lenSep;
+ if( lname > maxLen )
+ maxLen = lname;
+ dirs->insert( new TDirEntry( org - indent, dir, indent + lenSep ) );
+ *end = DIRSEPARATOR;
+ curDir = end + 1;
+ indent += indentSize;
+ }
+
+ cur = dirs->getCount() - 1;
+
+ end = strrchr( dir, DIRSEPARATOR );
+ char path[PATH_MAX];
+ strncpy( path, dir, size_t(end-dir+1) );
+ end = path + unsigned(end-dir)+1;
+
+ // SET: Insert them sorted
+ // SET: 1) collect them
+ TStringCollection *col = ListDirectory( path, end );
+
+ // SET: 2) insert sorted
+ Boolean isFirst = True;
+ int cnt = col->getCount();
+ for( int j = 0; j < cnt; j++ )
+ {
+ char *s = (char *) col->at(j);
+ unsigned ls = strlen( s );
+ if( isFirst )
+ {
+ memcpy( org, firstDir, lenSep );
+ isFirst = False;
+ }
+ else
+ memcpy( org, middleDir, lenSep );
+ memcpy( name, s, ls + 1 );
+ memcpy( end , s, ls + 1 );
+ ls += indent + lenSep;
+ if( ls > maxLen )
+ maxLen = ls;
+ dirs->insert( new TDirEntry( org - indent, path, indent + lenSep ) );
+ }
+
+ // SET: Update hz scroll bar range
+ if( hScrollBar )
+ hScrollBar->setRange( 0, maxLen - size.x + 1 );
+ // SET: Reset incremental search
+ incPos = 0;
+
+ CLY_destroy(col);
+
+ char *p = dirs->at(dirs->getCount()-1)->text();
+ char *i = strchr( p, graphics[0] );
+ if( i == 0 )
+ {
+ i = strchr( p, graphics[1] );
+ if( i != 0 )
+ *i = graphics[0];
+ }
+ else
+ {
+ *(i+1) = graphics[2];
+ *(i+2) = graphics[2];
+ }
+}
+
+void TDirListBox::newDirectory( const char *str )
+{
+ strcpy( dir, str );
+ TDirCollection *dirs = new TDirCollection( 5, 5 );
+ #ifdef CLY_HaveDriveLetters
+ #if defined(TVCompf_djgpp) || defined(TVComp_BCPP)
+ // SET: Old programs created for original TV can pass backslashes here
+ // and the code in showDirs assumes they are all forward.
+ for (int i=0; dir[i]; i++)
+ {
+ if (dir[i]=='\\')
+ dir[i]='/';
+ }
+ #endif
+ const char *drives = _("Drives");
+ dirs->insert( new TDirEntry( drives, drives ) );
+ if( strcmp( dir, drives ) == 0 )
+ showDrives( dirs );
+ else
+ #endif // CLY_HaveDriveLetters
+ showDirs( dirs );
+ newList( dirs );
+ focusItem( cur );
+}
+
+void TDirListBox::setState( ushort nState, Boolean enable )
+{
+ TListBox::setState( nState, enable );
+ if( (nState & sfFocused) != 0 )
+ message(owner, evCommand, cmDirSelection, (void *)enable);
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TDirListBox::build()
+{
+ return new TDirListBox( streamableInit );
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tdisplay.cc b/tvision/classes/tdisplay.cc
new file mode 100644
index 0000000..0bef192
--- /dev/null
+++ b/tvision/classes/tdisplay.cc
@@ -0,0 +1,493 @@
+/**[txh]********************************************************************
+
+ Copyright 2001-2002 by Salvador E. Tropea
+ This file is covered by the GPL license.
+
+ Module: Display
+ Include: TDisplay
+ Comments:
+ This is the base class for low level screen output.
+ Most members are pointers to functions defined by each platform dependent
+driver. Default members are provided.
+ This is a complete new file created from concepts that José Angel Sanchez
+Caso provide me and coded from scratch. The names of some members are the
+same used in original Turbo Vision for compatibility purposes.
+
+***************************************************************************/
+
+//#define DEBUG_CURSOR
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_TScreen
+#define Uses_TVCodePage
+#include <tv.h>
+
+// Remove me please!
+int TDisplay::dual_display=0;
+
+void (*TDisplay::clearScreen)(uchar, uchar)=TDisplay::defaultClearScreen;
+ushort (*TDisplay::getRows)() =TDisplay::defaultGetRows;
+ushort (*TDisplay::getCols)() =TDisplay::defaultGetCols;
+void (*TDisplay::setCrtMode)(ushort mode) =TDisplay::defaultSetCrtMode;
+ushort (*TDisplay::getCrtMode)() =TDisplay::defaultGetCrtMode;
+void (*TDisplay::getCursorPos)(unsigned &x, unsigned &y)
+ =TDisplay::defaultGetCursorShape;
+void (*TDisplay::setCursorPos)(unsigned x, unsigned y)
+ =TDisplay::defaultSetCursorShape;
+void (*TDisplay::setCursorShape)(unsigned start, unsigned end)
+ =TDisplay::defaultSetCursorShape;
+void (*TDisplay::getCursorShape)(unsigned &start, unsigned &end)
+ =TDisplay::defaultGetCursorShape;
+void (*TDisplay::setCrtModeExt)(char *mode)=TDisplay::defaultSetCrtModeExt;
+int (*TDisplay::checkForWindowSize)(void) =TDisplay::defaultCheckForWindowSize;
+const char *(*TDisplay::getWindowTitle)(void) =TDisplay::defaultGetWindowTitle;
+int (*TDisplay::setWindowTitle)(const char *name)
+ =TDisplay::defaultSetWindowTitle;
+int (*TDisplay::getBlinkState)() =TDisplay::defaultGetBlinkState;
+void (*TDisplay::getDisPaletteColors)(int from, int number, TScreenColor *colors)
+ =TDisplay::defaultGetDisPaletteColors;
+int (*TDisplay::setDisPaletteColors)(int from, int number, TScreenColor *colors)
+ =TDisplay::defaultSetDisPaletteColors;
+int (*TDisplay::setCrtModeRes_p)(unsigned w, unsigned h, int fW, int fH)
+ =TDisplay::defaultSetCrtModeRes;
+Boolean (*TDisplay::showBusyState)(Boolean state)
+ =TDisplay::defaultShowBusyState;
+void (*TDisplay::beep)() =TDisplay::defaultBeep;
+int TDisplay::argc =0;
+char **TDisplay::argv =NULL;
+char **TDisplay::environment =NULL;
+TScreenColor TDisplay::OriginalPalette[16];
+TScreenColor TDisplay::ActualPalette[16];
+char TDisplay::paletteModified =0;
+char TDisplay::avoidMoire =0;
+uint32 TDisplay::opts1 =0;
+TVCodePage *TDisplay::codePage =NULL;
+Boolean TDisplay::busyState =False;
+TVScreenDriverDetectCallBack TDisplay::dCB =NULL;
+TScreenResolution TDisplay::dosModesRes[TDisplayDOSModesNum]=
+{
+ { 80,25 },
+ { 80,28 },
+ { 80,30 },
+ { 80,34 },
+ { 80,35 },
+ { 80,40 },
+ { 80,43 },
+ { 80,50 },
+ { 80,60 },
+ { 82,25 },
+ { 90,30 },
+ { 90,34 },
+ { 94,30 },
+ { 94,34 },
+ { 132,25 },
+ { 132,43 },
+ { 132,50 },
+ { 132,60 }
+};
+TScreenResolution TDisplay::dosModesCell[TDisplayDOSModesNum]=
+{
+ { 9,16 },
+ { 9,14 },
+ { 9,16 },
+ { 9,14 },
+ { 9,10 },
+ { 9,10 },
+ { 9, 8 },
+ { 9, 8 },
+ { 9, 8 },
+ { 8,16 },
+ { 9,16 },
+ { 9,14 },
+ { 9,16 },
+ { 9,14 },
+ { 9,14 },
+ { 9,11 },
+ { 9,10 },
+ { 9, 8 }
+};
+int TDisplay::dosModes[TDisplayDOSModesNum]=
+{
+ smCO80x25,
+ smCO80x28,
+ smCO80x30,
+ smCO80x34,
+ smCO80x35,
+ smCO80x40,
+ smCO80x43,
+ smCO80x50,
+ smCO80x60,
+ smCO82x25,
+ smCO90x30,
+ smCO90x34,
+ smCO94x30,
+ smCO94x34,
+ smCO132x25,
+ smCO132x43,
+ smCO132x50,
+ smCO132x60
+};
+
+/*****************************************************************************
+
+ Default actions for TDisplay.
+
+*****************************************************************************/
+
+/**[txh]********************************************************************
+ Description: Number of columns of the physical screen.
+***************************************************************************/
+
+ushort TDisplay::defaultGetCols()
+{
+ return 80;
+}
+
+/**[txh]********************************************************************
+ Description: Number of rows of the physical screen.
+***************************************************************************/
+
+ushort TDisplay::defaultGetRows()
+{
+ return 25;
+}
+
+/**[txh]********************************************************************
+ Description: Erase the screen using this width and height.
+***************************************************************************/
+
+void TDisplay::defaultClearScreen( uchar, uchar )
+{
+}
+
+/**[txh]********************************************************************
+ Description: Sets the cursor shape, values in percent.
+***************************************************************************/
+
+void TDisplay::defaultSetCursorShape(unsigned /*start*/, unsigned /*end*/)
+{
+}
+
+/**[txh]********************************************************************
+ Description: Gets the cursor shape, values in percent.
+***************************************************************************/
+
+void TDisplay::defaultGetCursorShape(unsigned &start, unsigned &end)
+{
+ start=end=0;
+}
+
+/**[txh]********************************************************************
+ Description:
+ Returns information about a legacy DOS mode.
+ Return: True if the mode is known.
+***************************************************************************/
+
+Boolean TDisplay::searchDOSModeInfo(ushort mode, unsigned &w, unsigned &h,
+ int &fW, int &fH)
+{
+ int i;
+ for (i=0; i<TDisplayDOSModesNum; i++)
+ if (dosModes[i]==mode)
+ {
+ w=dosModesRes[i].x;
+ h=dosModesRes[i].y;
+ fW=dosModesCell[i].x;
+ fH=dosModesCell[i].y;
+ return True;
+ }
+ return False;
+}
+
+/**[txh]********************************************************************
+ Description: Sets the video mode.
+***************************************************************************/
+
+void TDisplay::defaultSetCrtMode(ushort mode)
+{
+ unsigned w, h;
+ int fW, fH;
+ if (searchDOSModeInfo(mode,w,h,fW,fH))
+ setCrtModeRes(w,h,fW,fH);
+ setCursorShape(86,99);
+}
+
+/**[txh]********************************************************************
+ Description: Sets the video mode using a string. It could be an external
+program or other information that doesn't fit in an ushort.
+***************************************************************************/
+
+void TDisplay::defaultSetCrtModeExt(char *command)
+{
+ setCursorShape(86,99);
+ system(command);
+}
+
+/**[txh]********************************************************************
+ Description: Selects the mode that's closest to the sepcified width and
+height. The optional font size can be specified.
+ Return: 0 no change done, 1 change done with all the requested parameters,
+2 change done but just to get closer.
+***************************************************************************/
+
+int TDisplay::defaultSetCrtModeRes(unsigned /*w*/, unsigned /*h*/, int /*fW*/,
+ int /*fH*/)
+{
+ return 0;
+}
+
+/**[txh]********************************************************************
+ Description: Returns current video mode.
+***************************************************************************/
+
+ushort TDisplay::defaultGetCrtMode()
+{
+ return smCO80;
+}
+
+/**[txh]********************************************************************
+ Description: Returns !=0 if the screen size changed externally. Usually
+when we are in a window, but isn't the only case.
+***************************************************************************/
+
+int TDisplay::defaultCheckForWindowSize(void)
+{
+ return 0;
+}
+
+/**[txh]********************************************************************
+ Description: Gets the visible title of the screen, usually the window
+title.
+***************************************************************************/
+
+const char *TDisplay::defaultGetWindowTitle(void)
+{
+ return newStr("");
+}
+
+/**[txh]********************************************************************
+ Description: Sets the visible title of the screen, usually the window
+title.
+ Return: !=0 success.
+***************************************************************************/
+
+int TDisplay::defaultSetWindowTitle(const char *)
+{
+ return 0;
+}
+
+/**[txh]********************************************************************
+ Description: Finds if the MSB of the attribute is for blinking.
+ Return: 0 no, 1 yes, 2 no but is used for other thing.
+***************************************************************************/
+
+int TDisplay::defaultGetBlinkState()
+{
+ return 2;
+}
+
+/*****************************************************************************
+ Description: Shows/hides something to indicate the application is busy.
+ Return: the previous state.
+*****************************************************************************/
+
+Boolean TDisplay::defaultShowBusyState(Boolean state)
+{
+ Boolean ret=busyState;
+ busyState=state;
+ return ret;
+}
+
+/**[txh]********************************************************************
+ Description:
+ Makes an audible indication.
+***************************************************************************/
+
+void TDisplay::defaultBeep()
+{
+ puts("\x7");
+}
+
+TDisplay::TDisplay()
+{
+}
+
+TDisplay::TDisplay(const TDisplay&)
+{
+}
+
+TDisplay::~TDisplay()
+{
+ if (codePage)
+ {
+ delete codePage;
+ codePage=NULL;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the cursor shape. I take the TV 2.0 convention: the low 8 bits is
+the start and the high 8 bits the end. Values can be between 0 and 99. To
+disable the cursor a value of 0 is used.
+
+***************************************************************************/
+
+void TDisplay::setCursorType(ushort val)
+{
+ setCursorShape(val & 0xFF,val>>8);
+ #ifdef DEBUG_CURSOR
+ fprintf(stderr,"Seteando 0x%0X => %X %X\n",val,val & 0xFF,val>>8);
+ #endif
+}
+
+ushort TDisplay::getCursorType()
+{
+ unsigned start,end;
+ getCursorShape(start,end);
+ #ifdef DEBUG_CURSOR
+ fprintf(stderr,"Obteniendo: start %X end %X => 0x%0X\n",start,end,(start | (end<<8)));
+ #endif
+ return (ushort)(start | (end<<8));
+}
+
+void TDisplay::setArgv(int aArgc, char **aArgv, char **aEnvir)
+{
+ argc=aArgc;
+ argv=aArgv;
+ environment=aEnvir;
+}
+
+Boolean TDisplay::searchClosestRes(TScreenResolution *res, unsigned x,
+ unsigned y, unsigned cant, unsigned &pos)
+{
+ unsigned i, minDif, indexMin, dif;
+ int firstXMatch=-1;
+ // Look for an exact match of width
+ for (i=0; i<cant && res[i].x<x; i++)
+ {
+ if (res[i].x==x)
+ {
+ if (firstXMatch==-1) firstXMatch=i;
+ if (res[i].y==y)
+ {// Exact match
+ pos=i;
+ return True;
+ }
+ }
+ }
+ if (firstXMatch!=-1)
+ {// Return the closest y that match x
+ i=indexMin=firstXMatch;
+ minDif=abs(res[i].y-y);
+ while (++i<cant && res[i].x==x)
+ {
+ dif=abs(res[i].y-y);
+ if (dif<minDif)
+ {
+ minDif=dif;
+ indexMin=i;
+ }
+ }
+ pos=indexMin;
+ return False;
+ }
+ // No x match, looks the one with minimum differences
+ indexMin=0;
+ minDif=abs(res[0].y-y)+abs(res[0].x-x);
+ i=1;
+ while (i<cant)
+ {
+ dif=abs(res[i].y-y)+abs(res[i].x-x);
+ if (dif<minDif)
+ {
+ minDif=dif;
+ indexMin=i;
+ }
+ i++;
+ }
+ pos=indexMin;
+ return False;
+}
+
+/*****************************************************************************
+
+ These should set/get the palette values at low level. The TScreen driver
+must indicate if they work. The dummies help to know the PC BIOS palette.
+
+*****************************************************************************/
+
+// Default PC BIOS palette
+TScreenColor TDisplay::PC_BIOSPalette[16]=
+{
+ { 0x00, 0x00, 0x00 },
+ { 0x00, 0x00, 0xA8 },
+ { 0x00, 0xA8, 0x00 },
+ { 0x00, 0xA8, 0xA8 },
+ { 0xA8, 0x00, 0x00 },
+ { 0xA8, 0x00, 0xA8 },
+ { 0xA8, 0x54, 0x00 },
+ { 0xA8, 0xA8, 0xA8 },
+ { 0x54, 0x54, 0x54 },
+ { 0x54, 0x54, 0xFC },
+ { 0x54, 0xFC, 0x54 },
+ { 0x54, 0xFC, 0xFC },
+ { 0xFC, 0x54, 0x54 },
+ { 0xFC, 0x54, 0xFC },
+ { 0xFC, 0xFC, 0x54 },
+ { 0xFC, 0xFC, 0xFC }
+};
+
+// This is the palette parsed from the tvrc file or the application
+TScreenColor TDisplay::UserStartPalette[16];
+
+void TDisplay::defaultGetDisPaletteColors(int from, int number, TScreenColor *colors)
+{
+ while (number-- && from<16)
+ *(colors++)=PC_BIOSPalette[from++];
+}
+
+int TDisplay::defaultSetDisPaletteColors(int , int number, TScreenColor *)
+{
+ return number;
+}
+
+TVScreenDriverDetectCallBack TDisplay::setDetectCallBack(TVScreenDriverDetectCallBack aCB)
+{
+ TVScreenDriverDetectCallBack ret=dCB;
+ dCB=aCB;
+ return ret;
+}
+
+void TDisplay::SetDefaultCodePages(int idScr, int idApp, int idInp)
+{
+ TVCodePage::SetDefaultCodePages(idScr,idApp,idInp);
+}
+
+/*****************************************************************************
+
+ Options routines, they are created to isolate the internal aspects.
+
+*****************************************************************************/
+
+Boolean TDisplay::setShowCursorEver(Boolean value)
+{
+ Boolean ret=getShowCursorEver();
+ if (value)
+ opts1|=ShowCursorEver;
+ else
+ opts1&= ~ShowCursorEver;
+ return ret;
+}
+
+Boolean TDisplay::setDontMoveHiddenCursor(Boolean value)
+{
+ Boolean ret=getDontMoveHiddenCursor();
+ if (value)
+ opts1|=DontMoveHiddenCursor;
+ else
+ opts1&= ~DontMoveHiddenCursor;
+ return ret;
+}
+
diff --git a/tvision/classes/tdrawbuf.cc b/tvision/classes/tdrawbuf.cc
new file mode 100644
index 0000000..482b320
--- /dev/null
+++ b/tvision/classes/tdrawbuf.cc
@@ -0,0 +1,257 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ *
+ *
+ */
+
+#define Uses_TDrawBuffer
+#include <tv.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ Copies count bytes from source to the data buffer starting at indent. The
+function uses the provided attribute, but if the attribute is 0 the attribute
+in the buffer is unmodified.@p
+ Added a check to avoid writings passing the end of the buffer.@p
+
+***************************************************************************/
+
+void TDrawBuffer::moveBuf(unsigned indent, const void *source,
+ unsigned attr, unsigned count)
+
+{
+ if (!count || (indent >= (unsigned)maxViewWidth)) return;
+ if (count+indent > (unsigned)maxViewWidth)
+ count = maxViewWidth - indent;
+
+ ushort *dest = &data[indent];
+ const uchar *s = (const uchar *)source;
+
+ if (attr)
+ {
+ while (count-- && *s)
+ {
+ ((uchar *)dest)[0] = *s++;
+ ((uchar *)dest++)[1] = (uchar)attr;
+ }
+ }
+ else
+ {
+ while (count-- && *s)
+ {
+ *(uchar *)dest++ = *s++;
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fills count bytes in the buffer starting at the indent position. If the
+attribute is 0 the original is left unchanged. If the character is 0 only
+the attribute is used.@p
+ Added a check to avoid writings passing the end of the buffer.@p
+
+***************************************************************************/
+
+void TDrawBuffer::moveChar(unsigned indent, char c, unsigned attr,
+ unsigned count )
+{
+ if (!count || (indent >= (unsigned)maxViewWidth)) return;
+ if (count+indent > (unsigned)maxViewWidth)
+ count = maxViewWidth - indent;
+
+ ushort *dest=&data[indent];
+
+ if (attr)
+ {
+ if (c)
+ {
+ while (count--)
+ {
+ ((uchar*)dest)[0] = c;
+ ((uchar*)dest++)[1] = attr;
+ }
+ }
+ else
+ {
+ dest=(ushort *)((uchar *)dest+1);
+ while (count--)
+ {
+ *(uchar *)dest++ = attr;
+ }
+ }
+ }
+ else
+ {
+ while (count--)
+ {
+ *(uchar *)dest++ = c;
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's the same as moveStr but the attrs parameter holds two attributes
+the lower 8 bits are the normal value and the upper 8 bits define the
+attribute to be used for text enclosed by ASCII 126. @x{::moveStr}.@p
+ The routine was modified to avoid writes passing the end of the buffer.
+Additionally was re-writed in assembler (I guess the Borland's original code
+was assembler, but I didn't take a look to it) because the check slow downs
+the routine so I wanted to avoid a lose in performance. SET.
+
+***************************************************************************/
+
+void TDrawBuffer::moveCStr( unsigned indent, const char *str, unsigned attrs )
+{
+#if !defined(TVCPU_x86) || !defined(TVComp_GCC)
+//$todo: implement it in asm for Win32
+ uchar bh = attrs >> 8, ah = attrs & 0xff;
+ uchar al;
+ ushort *dest = data+indent;
+ ushort *end = data+maxViewWidth;
+ while (*str && dest<end)
+ {
+ al = *str++;
+ if (al == '~')
+ {
+ al = ah;
+ ah = bh;
+ bh = al;
+ }
+ else
+ {
+ ((uchar*)dest)[0] = al;
+ ((uchar*)dest++)[1] = ah;
+ }
+ }
+#else
+ asm(" \n\
+ // EDI = &data[indent] \n\
+ // ESI = &data[maxViewWidth] \n\
+ // EDX = str \n\
+ // EAX = attrs \n\
+ \n\
+// SET: It isn't supposed to be needed if I put \n\
+// the register in the clobered list, but ... \n\
+// gcc 2.7.x have a bug when handling it and \n\
+// fails to save/restore bug when handling it and \n\
+// fails to save/restore it. \n\
+// It didn't show until I compiled with -fPIC \n\
+// to create a dynamic ELF library. In this case \n\
+// EBX is used as a base for the dynamic jmp \n\
+// table and the code misserably crash. \n\
+// I found it thanks to the disassemble window. \n\
+ pushl %%ebx \n\
+ \n\
+ // showed \n\
+ // save the attributes in EBX \n\
+ movl %%eax,%%ebx \n\
+ // take the initial attribute in AH \n\
+ movb %%al,%%ah \n\
+ // first character \n\
+ movb (%%edx),%%al \n\
+ // EOS ? \n\
+ cmpb $0,%%al \n\
+ je 2f \n\
+ .align 2,0x90 \n\
+ \n\
+3: \n\
+ // indent >= maxViewWidth ? \n\
+ cmpl %%esi,%%edi \n\
+ jae 2f \n\
+ \n\
+ incl %%edx \n\
+ // character == '~' ? \n\
+ cmpb $126,%%al \n\
+ jne 0f \n\
+ // exchange the attributes \n\
+ movb %%ah,%%al \n\
+ movb %%bh,%%ah \n\
+ movb %%al,%%bh \n\
+ jmp 1f \n\
+ .align 2,0x90 \n\
+ \n\
+0: \n\
+ movw %%ax,(%%edi) \n\
+ addl $2,%%edi \n\
+ \n\
+1: \n\
+ movb (%%edx),%%al \n\
+ cmpb $0,%%al \n\
+ jne 3b \n\
+2: \n\
+ popl %%ebx \n\
+ " : : "D"(&data[indent]), "S"(&data[maxViewWidth]), "d"(str), "a"(attrs)
+ //: "%ebx" I save EBX because 2.7.x forgets it
+ );
+#endif
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Writes a string in the buffer with the provided attribute. The routine
+copies until the EOS is found or the buffer is filled.@p
+ Modified to avoid writes passing the end of the buffer. Optimized for
+32 bits. Translated to asm just for fun, I think is a little bit faster.
+SET.
+
+***************************************************************************/
+
+void TDrawBuffer::moveStr( unsigned indent, const char *str, unsigned attr )
+{
+#if !defined(TVCPU_x86) || !defined(TVComp_GCC)
+//$todo: implement it in asm
+ ushort *dest = data+indent;
+ ushort *end = data+maxViewWidth;
+ while (*str && dest<end)
+ {
+ ((uchar*)dest)[0] = *(str++);
+ ((uchar*)dest++)[1] = attr;
+ }
+#else
+ asm(" \n\
+ // EDI = &data[indent] \n\
+ // ESI = &data[maxViewWidth] \n\
+ // EDX = str \n\
+ // EAX = attr \n\
+ // Move the attribute to the high byte \n\
+ movb %%al,%%ah \n\
+ \n\
+ // First byte in the string \n\
+ movb (%%edx),%%al \n\
+ cmpb $0,%%al \n\
+ je 2f \n\
+ .align 2,0x90 \n\
+ \n\
+3: \n\
+ // Bounds check \n\
+ cmpl %%esi,%%edi \n\
+ jae 2f \n\
+ \n\
+ // Next byte \n\
+ incl %%edx \n\
+ \n\
+ // Store it \n\
+ movw %%ax,(%%edi) \n\
+ addl $2,%%edi \n\
+ \n\
+ // Check EOS \n\
+ movb (%%edx),%%al \n\
+ cmpb $0,%%al \n\
+ jne 3b \n\
+2: \n\
+ " : : "D"(&data[indent]), "S"(&data[maxViewWidth]), "d"(str), "a"(attr)
+ );
+#endif
+}
+
+
diff --git a/tvision/classes/teditor.cc b/tvision/classes/teditor.cc
new file mode 100644
index 0000000..d5f6c53
--- /dev/null
+++ b/tvision/classes/teditor.cc
@@ -0,0 +1,1348 @@
+/* Modified by Robert Hoehne and Salvador Eduardo Tropea for the gcc port */
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*----------------------------------------------------------*/
+/*****************************************************************************
+
+ That's a very old port found in RHIDE beta 4. As Robert incorpoarted my
+editor we no longer use the editor class. Even in RHIDE beta 5 Robert used a
+modified editor. So that's old code no maintained in ages. To give you an
+idea I have an editor.cc file that is very different to it dated 06/1996.
+ As a user asked about the missing classes like TEditor I taked this old
+code and adapted it to compile with the new port (01/1999).
+
+*****************************************************************************/
+
+#define Uses_ctype
+#define Uses_TKeys
+// SET: Needed for the new keyboard symbols
+#define Uses_TKeys_Extended
+// SET: Needed to manipulate the keycodes safetly
+#define Uses_TGKey
+#define Uses_TEditor
+#define Uses_TIndicator
+#define Uses_TEvent
+#define Uses_TScrollBar
+#define Uses_TFindDialogRec
+#define Uses_TReplaceDialogRec
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#define Uses_TMacroCollection
+#include <tv.h>
+
+inline int isWordChar( int ch )
+{ // SET: changed by the uchar version
+ return ucisalnum(ch) || ch == '_';
+}
+
+/* SET: I changed the symbols here by the new keyboard definitions to make
+ it uniform, I could use the original */
+const ushort firstKeys[] =
+{
+ 39,
+ kbCtA, cmWordLeft,
+ kbCtC, cmPageDown,
+ kbCtD, cmCharRight,
+ kbCtE, cmLineUp,
+ kbCtF, cmWordRight,
+ kbCtG, cmDelChar,
+ kbCtH, cmBackSpace,
+ kbCtK, 0xFF02,
+ kbCtL, cmSearchAgain,
+ kbCtM, cmNewLine,
+ kbCtO, cmIndentMode,
+ kbCtQ, 0xFF01,
+ kbCtR, cmPageUp,
+ kbCtS, cmCharLeft,
+ kbCtT, cmDelWord,
+ kbCtU, cmUndo,
+ kbCtV, cmInsMode,
+ kbCtX, cmLineDown,
+ kbCtY, cmDelLine,
+ // SET: The hack used by the class to search a command needs to have
+ // first the codes with modifiers (like Control+Left) and then the code
+ // without the modifiers (like Left).
+ kbCtLeft, cmWordLeft,
+ kbCtRight, cmWordRight,
+ kbCtPgUp, cmTextStart,
+ kbCtPgDn, cmTextEnd,
+ kbCtInsert, cmCopy,
+ kbCtDelete, cmClear,
+ kbShInsert, cmPaste,
+ kbShDelete, cmCut,
+ kbLeft, cmCharLeft,
+ kbRight, cmCharRight,
+ kbHome, cmLineStart,
+ kbEnd, cmLineEnd,
+ kbUp, cmLineUp,
+ kbDown, cmLineDown,
+ kbPgUp, cmPageUp,
+ kbPgDn, cmPageDown,
+ kbDelete, cmDelChar,
+ kbInsert, cmInsMode,
+ kbEnter, cmNewLine,
+ kbBackSpace, cmBackSpace
+};
+
+/* SET: Here Borland used a bad trick using the ASCII for the ASCII letters
+ with the new keyboard handling that isn't true. The ASCII reported is the
+ letter, but the keycode have an arbitrary symbol and it could change from
+ OS to OS. Currently is the same under DOS and Linux */
+const ushort quickKeys[] =
+{ 8,
+ kbA, cmReplace,
+ kbC, cmTextEnd,
+ kbD, cmLineEnd,
+ kbF, cmFind,
+ kbH, cmDelStart,
+ kbR, cmTextStart,
+ kbS, cmLineStart,
+ kbY, cmDelEnd
+};
+
+const ushort blockKeys[] =
+{ 5,
+ kbB, cmStartSelect,
+ kbC, cmPaste,
+ kbH, cmHideSelect,
+ kbK, cmCopy,
+ kbY, cmCut
+};
+
+const ushort *keyMap[] = { firstKeys, quickKeys, blockKeys };
+
+ushort defEditorDialog( int, ... );
+
+#define KeyMap ((const ushort*)(keyMap))
+
+const ushort kbModMask=~kbKeyMask;
+
+
+// SET: Quick hack by Robert, should be adapted as the other. The original was
+// assembler, not much faster than it.
+// I changed the silly assumptions about the keycodes by masks based on values
+// defined in headers.
+ushort scanKeyMap( const void *keyMap, int keyCode )
+{
+ int i=0;
+ ushort bx,cx,dx,ax;
+ dx = keyCode;
+ cx = KeyMap[i++];
+ do
+ {
+ bx = KeyMap[i++];
+ ax = KeyMap[i++];
+ if ((bx & kbKeyMask) == (dx & kbKeyMask))
+ {
+ if (!(bx & kbModMask)) return ax;
+ // SET: Here I changed the methode. That's tricky so if you don't
+ // understand it don't worry. The idea is that: if I press Ctrl+Shift+
+ // Left it should match with Control+Left and not Left. And if I press
+ // Shift+Left it must match with Left (because nothing is assigned to
+ // Shift+Left.
+ //if ((bx & kbModMask) == (dx & kbModMask)) return ax;
+ if ((bx & kbModMask) & (dx & kbModMask)) return ax;
+ }
+ cx--;
+ } while (cx != 0);
+ return 0;
+}
+
+#define cpEditor "\x06\x07"
+
+TEditor::TEditor( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ TIndicator *aIndicator,
+ uint32 aBufSize ) :
+ TView( bounds ),
+ hScrollBar( aHScrollBar ),
+ vScrollBar( aVScrollBar ),
+ indicator( aIndicator ),
+ bufSize( aBufSize ),
+ canUndo( True ),
+ selecting( False ),
+ overwrite( False ),
+ autoIndent( False ) ,
+ lockCount( 0 ),
+ keyState( 0 )
+{
+ growMode = gfGrowHiX | gfGrowHiY;
+ options |= ofSelectable;
+ eventMask = evMouseDown | evKeyDown | evCommand | evBroadcast;
+ showCursor();
+ initBuffer();
+ if( buffer != 0 )
+ isValid = True;
+ else
+ {
+ editorDialog( edOutOfMemory );
+ bufSize = 0;
+ isValid = False;
+ }
+ setBufLen(0);
+}
+
+TEditor::~TEditor()
+{
+}
+
+void TEditor::shutDown()
+{
+ doneBuffer();
+ TView::shutDown();
+}
+
+void TEditor::changeBounds( const TRect& bounds )
+{
+ setBounds(bounds);
+ delta.x = max(0, min(delta.x, limit.x - size.x));
+ delta.y = max(0, min(delta.y, limit.y - size.y));
+ update(ufView);
+}
+
+/* SET: Note that Robert added a tabSize member to the class */
+int TEditor::charPos( uint32 p, uint32 target )
+{
+ int pos = 0;
+ while( p < target )
+ {
+ if( bufChar(p) == '\x9' )
+#if 0
+ pos |= 7;
+#else
+ pos += tabSize - (pos % tabSize) -1;
+#endif
+ pos++;
+ p++;
+ }
+ return pos;
+}
+
+uint32 TEditor::charPtr( uint32 p, int target )
+{
+ int pos = 0;
+ while( (pos < target) && (p < bufLen) && (bufChar(p) != '\x0D') && (bufChar(p) != '\x0A') )
+ {
+ if( bufChar(p) == '\x09' )
+#if 0
+ pos |= 7;
+#else
+ pos += tabSize - (pos % tabSize) -1;
+#endif
+ pos++;
+ p++;
+ }
+ if( pos > target )
+ p--;
+ return p;
+}
+
+Boolean TEditor::clipCopy()
+{
+ Boolean res = False;
+ if( (clipboard != 0) && (clipboard != this) )
+ {
+ res = clipboard->insertFrom(this);
+ selecting = False;
+ update(ufUpdate);
+ }
+ return res;
+}
+
+void TEditor::clipCut()
+{
+ if( clipCopy() == True )
+ deleteSelect();
+}
+
+void TEditor::clipPaste()
+{
+ if( (clipboard != 0) && (clipboard != this) )
+ insertFrom(clipboard);
+}
+
+
+void TEditor::convertEvent( TEvent& event )
+{
+ if( event.what == evKeyDown )
+ {
+ /* SET: Here we had another dirty code. The code assumed some special
+ values for (A) the modifiers and (B) the keycodes, that's really
+ bad coding style
+ if ( (shiftkeys() & 0x03) != 0 &&
+ event.keyDown.charScan.scanCode >= 0x47 &&
+ event.keyDown.charScan.scanCode <= 0x51
+ )
+ event.keyDown.charScan.charCode = 0;*/
+
+ // SET: More assumptions were here
+ ushort key = event.keyDown.keyCode;
+ if( keyState != 0 )
+ {
+ if( key>=kbCtA && key<=kbCtZ )
+ key+=kbA-kbCtA;
+ if( key>=kbShA && key<=kbShA )
+ key+=kbA-kbShA;
+ }
+ key = scanKeyMap(keyMap[keyState], key);
+ keyState = 0;
+ if( key != 0 )
+ {
+ if( (key & 0xFF00) == 0xFF00 )
+ {
+ keyState = (key & 0xFF);
+ clearEvent(event);
+ }
+ else
+ {
+ event.what = evCommand;
+ event.message.command = key;
+ }
+ }
+ }
+}
+
+Boolean TEditor::cursorVisible()
+{
+ return Boolean((curPos.y >= delta.y) && (curPos.y < delta.y + size.y));
+}
+
+void TEditor::deleteRange( uint32 startPtr,
+ uint32 endPtr,
+ Boolean delSelect
+ )
+{
+ if( hasSelection() == True && delSelect == True )
+ deleteSelect();
+ else
+ {
+ setSelect(curPtr, endPtr, True);
+ deleteSelect();
+ setSelect(startPtr, curPtr, False);
+ deleteSelect();
+ }
+}
+
+void TEditor::deleteSelect()
+{
+ insertText( 0, 0, False );
+}
+
+void TEditor::doneBuffer()
+{
+ delete buffer;
+}
+
+void TEditor::doSearchReplace()
+{
+ int i;
+ do {
+ i = cmCancel;
+ if( search(findStr, editorFlags) == False )
+ {
+ if( (editorFlags & (efReplaceAll | efDoReplace)) !=
+ (efReplaceAll | efDoReplace) )
+ editorDialog( edSearchFailed );
+ }
+ else
+ if( (editorFlags & efDoReplace) != 0 )
+ {
+ i = cmYes;
+ if( (editorFlags & efPromptOnReplace) != 0 )
+ {
+ TPoint c = makeGlobal( cursor );
+ i = editorDialog( edReplacePrompt, &c );
+ }
+ if( i == cmYes )
+ {
+ lock();
+ insertText( replaceStr, strlen(replaceStr), False);
+ trackCursor(False);
+ unlock();
+ }
+ }
+ } while( i != cmCancel && (editorFlags & efReplaceAll) != 0 );
+}
+
+void TEditor::doUpdate()
+{
+ if( updateFlags != 0 )
+ {
+ setCursor(curPos.x - delta.x, curPos.y - delta.y);
+ if( (updateFlags & ufView) != 0 )
+ drawView();
+ else
+ if( (updateFlags & ufLine) != 0 )
+ drawLines( curPos.y-delta.y, 1, lineStart(curPtr) );
+ if( hScrollBar != 0 )
+ hScrollBar->setParams(delta.x, 0, limit.x - size.x, size.x / 2, 1);
+ if( vScrollBar != 0 )
+ vScrollBar->setParams(delta.y, 0, limit.y - size.y, size.y - 1, 1);
+ if( indicator != 0 )
+ indicator->setValue(curPos, modified);
+ if( (state & sfActive) != 0 )
+ updateCommands();
+ updateFlags = 0;
+ }
+}
+
+void TEditor::draw()
+{
+ if( drawLine != delta.y )
+ {
+ drawPtr = lineMove( drawPtr, delta.y - drawLine );
+ drawLine = delta.y;
+ }
+ drawLines( 0, size.y, drawPtr );
+}
+
+void TEditor::drawLines( int y, int count, uint32 linePtr )
+{
+ ushort color = getColor(0x0201);
+ while( count-- > 0 )
+ {
+ ushort b[maxLineLength];
+ formatLine( b, linePtr, delta.x+size.x, color );
+ writeBuf(0, y, size.x, 1, &b[delta.x]);
+ linePtr = nextLine(linePtr);
+ y++;
+ }
+}
+
+void TEditor::find()
+{
+ TFindDialogRec findRec( findStr, editorFlags );
+ if( editorDialog( edFind, &findRec ) != cmCancel )
+ {
+ strcpy( findStr, findRec.find );
+ editorFlags = findRec.options & ~efDoReplace;
+ doSearchReplace();
+ }
+}
+
+uint32 TEditor::getMousePtr( TPoint m )
+{
+ TPoint mouse = makeLocal( m );
+ mouse.x = max(0, min(mouse.x, size.x - 1));
+ mouse.y = max(0, min(mouse.y, size.y - 1));
+ return charPtr(lineMove(drawPtr, mouse.y + delta.y - drawLine),
+ mouse.x + delta.x);
+}
+
+TPalette& TEditor::getPalette() const
+{
+ static TPalette palette( cpEditor, sizeof( cpEditor )-1 );
+ return palette;
+}
+
+
+void TEditor::checkScrollBar( const TEvent& event,
+ TScrollBar *p,
+ int& d
+ )
+{
+ if( (event.message.infoPtr == p) && (p->value != d) )
+ {
+ d = p->value;
+ update( ufView );
+ }
+}
+
+void TEditor::handleEvent( TEvent& event )
+{
+ TView::handleEvent( event );
+ //if (macros) macros->handleEvent(event,this);
+ convertEvent( event );
+ Boolean centerCursor = Boolean(!cursorVisible());
+ uchar selectMode = 0;
+ // SET: This way of getting the shift state is deprecated in our port, by
+ // now works.
+ if( selecting == True || (TGKey::getShiftState() & (kbRightShiftDown|kbLeftShiftDown)) != 0 )
+ selectMode = smExtend;
+
+ switch( event.what )
+ {
+
+ case evMouseDown:
+ if( event.mouse.doubleClick == True )
+ selectMode |= smDouble;
+
+ do {
+ lock();
+ if( event.what == evMouseAuto )
+ {
+ TPoint mouse = makeLocal( event.mouse.where );
+ TPoint d = delta;
+ if( mouse.x < 0 )
+ d.x--;
+ if( mouse.x >= size.x )
+ d.x++;
+ if( mouse.y < 0 )
+ d.y--;
+ if( mouse.y >= size.y )
+ d.y++;
+ scrollTo(d.x, d.y);
+ }
+ setCurPtr(getMousePtr(event.mouse.where), selectMode);
+ selectMode |= smExtend;
+ unlock();
+ } while( mouseEvent(event, evMouseMove + evMouseAuto) );
+ break;
+
+ case evKeyDown:
+ if( event.keyDown.charScan.charCode == 9 ||
+ ( event.keyDown.charScan.charCode >= 32 && event.keyDown.charScan.charCode < 255 ) )
+ {
+ lock();
+ if( overwrite == True && hasSelection() == False )
+ if( curPtr != lineEnd(curPtr) )
+ selEnd = nextChar(curPtr);
+ insertText( &event.keyDown.charScan.charCode, 1, False);
+ trackCursor(centerCursor);
+ unlock();
+ }
+ else
+ return;
+ break;
+
+ case evCommand:
+ switch( event.message.command )
+ {
+ case cmInsertText:
+ insertText(event.message.infoPtr,strlen((char *)event.message.infoPtr),False);
+ break;
+ case cmFind:
+ find();
+ break;
+ case cmReplace:
+ replace();
+ break;
+ case cmSearchAgain:
+ doSearchReplace();
+ break;
+ default:
+ lock();
+ switch( event.message.command )
+ {
+ case cmCut:
+ clipCut();
+ break;
+ case cmCopy:
+ clipCopy();
+ break;
+ case cmPaste:
+ clipPaste();
+ break;
+ case cmUndo:
+ undo();
+ break;
+ case cmClear:
+ deleteSelect();
+ break;
+ case cmCharLeft:
+ setCurPtr(prevChar(curPtr), selectMode);
+ break;
+ case cmCharRight:
+ setCurPtr(nextChar(curPtr), selectMode);
+ break;
+ case cmWordLeft:
+ setCurPtr(prevWord(curPtr), selectMode);
+ break;
+ case cmWordRight:
+ setCurPtr(nextWord(curPtr), selectMode);
+ break;
+ case cmLineStart:
+ setCurPtr(lineStart(curPtr), selectMode);
+ break;
+ case cmLineEnd:
+ setCurPtr(lineEnd(curPtr), selectMode);
+ break;
+ case cmLineUp:
+ setCurPtr(lineMove(curPtr, -1), selectMode);
+ break;
+ case cmLineDown:
+ setCurPtr(lineMove(curPtr, 1), selectMode);
+ break;
+ case cmPageUp:
+ setCurPtr(lineMove(curPtr, -(size.y-1)), selectMode);
+ break;
+ case cmPageDown:
+ setCurPtr(lineMove(curPtr, size.y-1), selectMode);
+ break;
+ case cmTextStart:
+ setCurPtr(0, selectMode);
+ break;
+ case cmTextEnd:
+ setCurPtr(bufLen, selectMode);
+ break;
+ case cmNewLine:
+ newLine();
+ break;
+ case cmBackSpace:
+ deleteRange(prevChar(curPtr), curPtr, True);
+ break;
+ case cmDelChar:
+ deleteRange(curPtr, nextChar(curPtr), True);
+ break;
+ case cmDelWord:
+ deleteRange(curPtr, nextWord(curPtr), False);
+ break;
+ case cmDelStart:
+ deleteRange(lineStart(curPtr), curPtr, False);
+ break;
+ case cmDelEnd:
+ deleteRange(curPtr, lineEnd(curPtr), False);
+ break;
+ case cmDelLine:
+ deleteRange(lineStart(curPtr), nextLine(curPtr), False);
+ break;
+ case cmInsMode:
+ toggleInsMode();
+ break;
+ case cmStartSelect:
+ startSelect();
+ break;
+ case cmHideSelect:
+ hideSelect();
+ break;
+ case cmIndentMode:
+ autoIndent = Boolean(!autoIndent);
+ break;
+ default:
+ unlock();
+ return;
+ }
+ trackCursor(centerCursor);
+ unlock();
+ break;
+ }
+
+ case evBroadcast:
+ switch( event.message.command )
+ {
+ case cmScrollBarChanged:
+ checkScrollBar( event, hScrollBar, delta.x );
+ checkScrollBar( event, vScrollBar, delta.y );
+ break;
+ default:
+ return;
+ }
+ }
+ clearEvent(event);
+}
+
+
+// TEDITOR2.CC
+
+// inline int isWordChar( int ch )
+// {
+// return isalnum(ch) || ch == '_';
+// }
+
+int countLines( void *buf, uint32 count )
+{
+ int ret=0,i=0;
+ while (count--) if (((const char *)(buf))[i++] == 0x0a) ret++;
+ return ret;
+}
+
+#define Block ((const char *)(block))
+
+uint32 scan( const void *block, uint32 size, const char *str )
+{
+ if (!size) return (UINT_MAX);
+ uint32 ret=0;
+ while (size--)
+ {
+ if (Block[ret] == str[0])
+ {
+ uint32 i=0;
+ do
+ {
+ i++;
+ if (!str[i]) return (ret);
+ if (size<i) return (UINT_MAX);
+ } while (Block[ret+i] == str[i]);
+ }
+ ret++;
+ }
+ return (UINT_MAX);
+}
+
+uint32 iScan( const void *block, uint32 size, const char *str )
+{
+ if (!size) return (UINT_MAX);
+ uint32 ret=0;
+ while (size--)
+ {
+ if (toupper(Block[ret]) == toupper(str[0]))
+ {
+ uint32 i=0;
+ do
+ {
+ i++;
+ if (!str[i]) return (ret);
+ if (size<i) return (UINT_MAX);
+ } while (toupper(Block[ret+i]) == toupper(str[i]));
+ }
+ ret++;
+ }
+ return (UINT_MAX);
+}
+
+Boolean TEditor::hasSelection()
+{
+ return Boolean(selStart != selEnd);
+}
+
+void TEditor::hideSelect()
+{
+ selecting = False;
+ setSelect(curPtr, curPtr, False);
+}
+
+void TEditor::initBuffer()
+{
+ buffer = new char[bufSize];
+}
+
+Boolean TEditor::insertBuffer( char *p,
+ uint32 offset,
+ uint32 length,
+ Boolean allowUndo,
+ Boolean selectText
+ )
+{
+ selecting = False;
+ uint32 selLen = selEnd - selStart;
+ if( selLen == 0 && length == 0 )
+ return True;
+
+ uint32 delLen = 0;
+ if( allowUndo == True )
+ {
+ if( curPtr == selStart )
+ delLen = selLen;
+ else
+ if( selLen > insCount )
+ delLen = selLen - insCount;
+ }
+
+ uint32 newSize = uint32(bufLen + delCount - selLen + delLen) + length;
+
+ if( newSize > bufLen + delCount )
+ if( setBufSize((uint32)(newSize)) == False )
+ {
+ editorDialog( edOutOfMemory );
+ return False;
+ }
+
+ uint32 selLines = countLines( &buffer[bufPtr(selStart)], selLen );
+ if( curPtr == selEnd )
+ {
+ if( allowUndo == True )
+ {
+ if( delLen > 0 )
+ memmove(
+ &buffer[curPtr + gapLen - delCount - delLen],
+ &buffer[selStart],
+ delLen
+ );
+ insCount -= selLen - delLen;
+ }
+ curPtr = selStart;
+ curPos.y -= selLines;
+ }
+ if( delta.y > curPos.y )
+ {
+ delta.y -= selLines;
+ if( delta.y < curPos.y )
+ delta.y = curPos.y;
+ }
+
+ if( length > 0 )
+ memmove(
+ &buffer[curPtr],
+ &p[offset],
+ length
+ );
+
+ uint32 lines = countLines( &buffer[curPtr], length );
+ curPtr += length;
+ curPos.y += lines;
+ drawLine = curPos.y;
+ drawPtr = lineStart(curPtr);
+ curPos.x = charPos(drawPtr, curPtr);
+ if( selectText == False )
+ selStart = curPtr;
+ selEnd = curPtr;
+ bufLen += length - selLen;
+ gapLen -= length - selLen;
+ if( allowUndo == True )
+ {
+ delCount += delLen;
+ insCount += length;
+ }
+ limit.y += lines - selLines;
+ delta.y = max(0, min(delta.y, limit.y - size.y));
+ if( isClipboard() == False )
+ modified = True;
+ setBufSize(bufLen + delCount);
+ if( selLines == 0 && lines == 0 )
+ update(ufLine);
+ else
+ update(ufView);
+ return True;
+}
+
+Boolean TEditor::insertFrom( TEditor *editor )
+{
+ return insertBuffer( editor->buffer,
+ editor->bufPtr(editor->selStart),
+ editor->selEnd - editor->selStart,
+ canUndo,
+ isClipboard()
+ );
+}
+
+Boolean TEditor::insertText( const void *text, uint32 length, Boolean selectText )
+{
+ return insertBuffer( (char *)text, 0, length, canUndo, selectText);
+}
+
+Boolean TEditor::isClipboard()
+{
+ return Boolean(clipboard == this);
+}
+
+uint32 TEditor::lineMove( uint32 p, int count )
+{
+ uint32 i = p;
+ p = lineStart(p);
+ int pos = charPos(p, i);
+ while( count != 0 )
+ {
+ i = p;
+ if( count < 0 )
+ {
+ p = prevLine(p);
+ count++;
+ }
+ else
+ {
+ p = nextLine(p);
+ count--;
+ }
+ }
+ if( p != i )
+ p = charPtr(p, pos);
+ return p;
+}
+
+void TEditor::lock()
+{
+ lockCount++;
+}
+
+void TEditor::newLine()
+{
+ uint32 p = lineStart(curPtr);
+ uint32 i = p;
+ while( i < curPtr &&
+ ( (buffer[i] == ' ') || (buffer[i] == '\x9'))
+ )
+ i++;
+ insertText(CLY_crlf,CLY_LenEOL,False);
+ if( autoIndent == True )
+ insertText( &buffer[p], i - p, False);
+}
+
+uint32 TEditor::nextLine( uint32 p )
+{
+ return nextChar(lineEnd(p));
+}
+
+uint32 TEditor::nextWord( uint32 p )
+{
+ if (isWordChar(bufChar(p)))
+ while (p < bufLen && isWordChar(bufChar(p)))
+ p = nextChar(p);
+ else if (p < bufLen)
+ p = nextChar(p);
+ while (p < bufLen && !isWordChar(bufChar(p)))
+ p = nextChar(p);
+ return p;
+}
+
+uint32 TEditor::prevLine( uint32 p )
+{
+ return lineStart(prevChar(p));
+}
+
+uint32 TEditor::prevWord( uint32 p )
+{
+ while( p > 0 && isWordChar(bufChar(prevChar(p))) == 0 )
+ p = prevChar(p);
+ while( p > 0 && isWordChar(bufChar(prevChar(p))) != 0 )
+ p = prevChar(p);
+ return p;
+}
+
+void TEditor::replace()
+{
+ TReplaceDialogRec replaceRec( findStr, replaceStr, editorFlags );
+ if( editorDialog( edReplace, &replaceRec ) != cmCancel )
+ {
+ strcpy( findStr, replaceRec.find );
+ strcpy( replaceStr, replaceRec.replace );
+ editorFlags = replaceRec.options | efDoReplace;
+ doSearchReplace();
+ }
+
+}
+
+void TEditor::scrollTo( int x, int y )
+{
+ x = max(0, min(x, limit.x - size.x));
+ y = max(0, min(y, limit.y - size.y));
+ if( x != delta.x || y != delta.y )
+ {
+ delta.x = x;
+ delta.y = y;
+ update(ufView);
+ }
+}
+
+Boolean TEditor::search( const char *findStr, ushort opts )
+{
+ uint32 pos = curPtr;
+ uint32 i;
+ do {
+ if( (opts & efCaseSensitive) != 0 )
+ i = scan( &buffer[bufPtr(pos)], bufLen - pos, findStr);
+ else
+ i = iScan( &buffer[bufPtr(pos)], bufLen - pos, findStr);
+
+ if( i != sfSearchFailed )
+ {
+ i += pos;
+ if( (opts & efWholeWordsOnly) == 0 ||
+ !(
+ ( i != 0 && isWordChar(bufChar(i - 1)) != 0 ) ||
+ ( i + strlen(findStr) != bufLen &&
+ isWordChar(bufChar(i + strlen(findStr)))
+ )
+ ))
+ {
+ lock();
+ setSelect(i, i + strlen(findStr), False);
+ trackCursor(Boolean(!cursorVisible()));
+ unlock();
+ return True;
+ }
+ else
+ pos = i + 1;
+ }
+ } while( i != sfSearchFailed );
+ return False;
+}
+
+void TEditor::setBufLen( uint32 length )
+{
+ bufLen = length;
+ gapLen = bufSize - length;
+ selStart = 0;
+ selEnd = 0;
+ curPtr = 0;
+ delta.x = 0;
+ delta.y = 0;
+ curPos = delta;
+ limit.x = maxLineLength;
+ limit.y = countLines( &buffer[gapLen], bufLen ) + 1;
+ drawLine = 0;
+ drawPtr = 0;
+ delCount = 0;
+ insCount = 0;
+ modified = False;
+ update(ufView);
+}
+
+Boolean TEditor::setBufSize( uint32 newSize )
+{
+ return Boolean(newSize <= bufSize);
+}
+
+void TEditor::setCmdState( ushort command, Boolean enable )
+{
+ TCommandSet s;
+ s += command;
+ if( enable == True && (state & sfActive) != 0 )
+ enableCommands(s);
+ else
+ disableCommands(s);
+}
+
+void TEditor::setCurPtr( uint32 p, uchar selectMode )
+{
+ uint32 anchor;
+ if( (selectMode & smExtend) == 0 )
+ anchor = p;
+ else if( curPtr == selStart )
+ anchor = selEnd;
+ else
+ anchor = selStart;
+
+ if( p < anchor )
+ {
+ if( (selectMode & smDouble) != 0 )
+ {
+ p = prevLine(nextLine(p));
+ anchor = nextLine(prevLine(anchor));
+ }
+ setSelect(p, anchor, True);
+ }
+ else
+ {
+ if( (selectMode & smDouble) != 0 )
+ {
+ p = nextLine(p);
+ anchor = prevLine(nextLine(anchor));
+ }
+ setSelect(anchor, p, False);
+ }
+}
+
+void TEditor::setSelect( uint32 newStart, uint32 newEnd, Boolean curStart )
+{
+ uint32 p;
+ if( curStart != 0 )
+ p = newStart;
+ else
+ p = newEnd;
+
+ uchar flags = ufUpdate;
+
+ if( newStart != selStart || newEnd != selEnd )
+ if( newStart != newEnd || selStart != selEnd )
+ flags = ufView;
+
+ if( p != curPtr )
+ {
+ if( p > curPtr )
+ {
+ uint32 l = p - curPtr;
+ memmove( &buffer[curPtr], &buffer[curPtr + gapLen], l);
+ curPos.y += countLines(&buffer[curPtr], l);
+ curPtr = p;
+ }
+ else
+ {
+ uint32 l = curPtr - p;
+ curPtr = p;
+ curPos.y -= countLines(&buffer[curPtr], l);
+ memmove( &buffer[curPtr + gapLen], &buffer[curPtr], l);
+ }
+ drawLine = curPos.y;
+ drawPtr = lineStart(p);
+ curPos.x = charPos(drawPtr, p);
+ delCount = 0;
+ insCount = 0;
+ setBufSize(bufLen);
+ }
+ selStart = newStart;
+ selEnd = newEnd;
+ update(flags);
+}
+
+void TEditor::setState( ushort aState, Boolean enable )
+{
+ TView::setState(aState, enable);
+ switch( aState )
+ {
+ case sfActive:
+ if( hScrollBar != 0 )
+ hScrollBar->setState(sfVisible, enable);
+ if( vScrollBar != 0 )
+ vScrollBar->setState(sfVisible, enable);
+ if( indicator != 0 )
+ indicator->setState(sfVisible, enable);
+ updateCommands();
+ break;
+
+ case sfExposed:
+ if( enable == True )
+ unlock();
+ }
+}
+
+void TEditor::startSelect()
+{
+ hideSelect();
+ selecting = True;
+}
+
+void TEditor::toggleInsMode()
+{
+ overwrite = Boolean(!overwrite);
+ setState(sfCursorIns, Boolean(!getState(sfCursorIns)));
+}
+
+void TEditor::trackCursor( Boolean center )
+{
+ if( center == True )
+ scrollTo( curPos.x - size.x + 1, curPos.y - size.y / 2);
+ else
+ scrollTo( max(curPos.x - size.x + 1, min(delta.x, curPos.x)),
+ max(curPos.y - size.y + 1, min(delta.y, curPos.y)));
+}
+
+void TEditor::undo()
+{
+ if( delCount != 0 || insCount != 0 )
+ {
+ selStart = curPtr - insCount;
+ selEnd = curPtr;
+ uint32 length = delCount;
+ delCount = 0;
+ insCount = 0;
+ insertBuffer(buffer, curPtr + gapLen - length, length, False, True);
+ }
+}
+
+void TEditor::unlock()
+{
+ if( lockCount > 0 )
+ {
+ lockCount--;
+ if( lockCount == 0 )
+ doUpdate();
+ }
+}
+
+void TEditor::update( uchar aFlags )
+{
+ updateFlags |= aFlags;
+ if( lockCount == 0 )
+ doUpdate();
+}
+
+void TEditor::updateCommands()
+{
+ setCmdState( cmUndo, Boolean( delCount != 0 || insCount != 0 ) );
+ if( isClipboard() == False )
+ {
+ setCmdState(cmCut, hasSelection());
+ setCmdState(cmCopy, hasSelection());
+ setCmdState(cmPaste,
+ Boolean(clipboard != 0 && (clipboard->hasSelection())) );
+ }
+ setCmdState(cmClear, hasSelection());
+ setCmdState(cmFind, True);
+ setCmdState(cmReplace, True);
+ setCmdState(cmSearchAgain, True);
+}
+
+Boolean TEditor::valid( ushort )
+{
+ return isValid;
+}
+
+#ifndef NO_STREAM
+
+void TEditor::write( opstream& os )
+{
+ TView::write( os );
+ os << hScrollBar << vScrollBar << indicator
+ << bufSize << (short)canUndo;
+}
+
+void *TEditor::read( ipstream& is )
+{
+ TView::read( is );
+ short temp;
+ is >> hScrollBar >> vScrollBar >> indicator
+ >> bufSize >> temp;
+ canUndo = Boolean(temp);
+ selecting = False;
+ overwrite = False;
+ autoIndent = False;
+ lockCount = 0;
+ keyState = 0;
+ initBuffer();
+ if( buffer != 0 )
+ isValid = True;
+ else
+ {
+ TEditor::editorDialog( edOutOfMemory, 0 );
+ bufSize = 0;
+ }
+ lockCount = 0;
+ lock();
+ setBufLen( 0 );
+ return this;
+}
+
+TStreamable *TEditor::build()
+{
+ return new TEditor( streamableInit );
+}
+
+TEditor::TEditor( StreamableInit ) : TView( streamableInit )
+{
+}
+
+#endif
+
+// SET: The following routines were assembler in the original TVision, Robert
+// did just a quick hack.
+// Notes: changed 0xd by '\r' and 0xa by '\n'. Seems to work with EOL=\n
+// with only one patch.
+// EDITS.CC
+
+char TEditor::bufChar( uint32 p )
+{
+ if (p>=curPtr) p+=gapLen;
+ return buffer[p];
+}
+
+uint32 TEditor::bufPtr(uint32 p)
+{
+ if (p<curPtr) return p;
+ return (p+gapLen);
+}
+
+uint32 TEditor::lineEnd(uint32 p)
+{
+#if 1
+ int32 di = p,cx,bx;
+ bx = 0;
+ cx = curPtr-di;
+ if (cx<=0) goto lab1;
+// di += bx;
+ while (cx--)
+ {
+ if (buffer[di++] == '\r') goto lab2;
+ if (buffer[di-1] == '\n') goto lab2;
+ }
+ di = curPtr;
+lab1:
+ cx = bufLen;
+ cx -= di;
+ if (!cx) return di;
+ bx += gapLen;
+ di += bx;
+ while (cx--)
+ {
+ if (buffer[di++] == '\r') goto lab2;
+ if (buffer[di-1] == '\n') goto lab2;
+ }
+ goto lab3;
+lab2:
+ di--;
+lab3:
+ di-=bx;
+ return di;
+#else
+ if (p == bufLen) return p;
+ char c=bufChar(p);
+ while (c != '\r' && c != '\n')
+ {
+ p++;
+ if (p == bufLen) return p;
+ c = bufChar(p);
+ };
+ return p;
+#endif
+}
+
+uint32 TEditor::lineStart(uint32 p)
+{
+ int32 di = p,cx,bx;
+ bx = 0;
+ cx = di;
+ cx -= curPtr;
+ if (cx<=0) goto lab1;
+ bx += gapLen;
+ di += bx;
+ di--;
+ while (cx--)
+ {
+ if (buffer[di--] == '\r') goto lab2;
+ if (buffer[di+1] == '\n') goto lab2;
+ }
+ bx -= gapLen;
+ di = curPtr;
+lab1:
+ cx = di;
+ if (!cx) goto lab4;
+ di += bx;
+ di--;
+ while (cx--)
+ {
+ if (buffer[di--] == '\r') goto lab2;
+ if (buffer[di+1] == '\n') goto lab2;
+ }
+ goto lab3;
+lab2:
+ di++;
+ di++;
+ di -= bx;
+ if ((uint32)di == curPtr) goto lab4;
+ if ((uint32)di == bufLen) goto lab4;
+ // SET: When lines end only with \n it fails
+ #ifdef CLY_UseCrLf
+ if (buffer[di+bx] != '\n') goto lab4;
+ di++;
+ #endif
+ goto lab4;
+lab3:
+ di = 0;
+lab4:
+ return di;
+}
+
+uint32 TEditor::nextChar(uint32 p)
+{
+ uint32 gl=0;
+ if (p == bufLen) return p;
+ p++;
+ if (p == bufLen) return p;
+ if (p >= curPtr) gl = gapLen;
+ #ifdef CLY_UseCrLf
+ if (buffer[gl+p] == '\n' && buffer[gl+p-1] == '\r') return (p+1);
+ #endif
+ return p;
+}
+
+uint32 TEditor::prevChar(uint32 p)
+{
+ uint32 gl=0;
+ if (!p) return p;
+ p--;
+ if (!p) return p;
+ if (p >= curPtr) gl = gapLen;
+ #ifdef CLY_UseCrLf
+ if (buffer[gl+p] == '\n' && buffer[gl+p-1] == '\r') return (p-1);
+ #endif
+ return p;
+}
+
+// SET: Static members.
+// EDITSTAT.CC
+
+ushort defEditorDialog( int, ... )
+{
+ return cmCancel;
+}
+
+TEditorDialog TEditor::editorDialog = defEditorDialog;
+ushort TEditor::editorFlags = efBackupFiles | efPromptOnReplace;
+char TEditor::findStr[maxFindStrLen] = "";
+char TEditor::replaceStr[maxReplaceStrLen] = "";
+TEditor *TEditor::clipboard = 0;
+uint32 TEditor::tabSize = 8;
diff --git a/tvision/classes/teditorf.cc b/tvision/classes/teditorf.cc
new file mode 100644
index 0000000..e4db81e
--- /dev/null
+++ b/tvision/classes/teditorf.cc
@@ -0,0 +1,106 @@
+/* Modified by Robert Hoehne and Salvador Eduardo Tropea for the gcc port */
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*----------------------------------------------------------*/
+/*****************************************************************************
+
+ These are the routines that formats the lines before writing to the buffer.
+They are a hack, the original TV had it made in assembler (edits.asm) and
+Robert did a quick hack. We still using some of this code so isn't too bad
+;-)
+
+ JASC -> Jul 2000, endian stuff
+
+*****************************************************************************/
+
+#define Uses_TEditor
+#include <tv.h>
+
+#if defined(TV_BIG_ENDIAN)
+ #define endianCol( letra, color ) ((((unsigned)letra)<<8) | ((unsigned)color))
+#else
+ #define endianCol( letra, color ) ((((unsigned)color)<<8) | ((unsigned)letra))
+#endif
+
+#define CALL if (call10(this,(ushort *)DrawBuf,color,count,offset,LinePtr,bufptr,Width) == False) return
+
+Boolean call10(const TEditor *edit, ushort *drawBuf, ushort color, int cx,
+ int &offset, unsigned &lineptr, int &bufptr, int Width)
+{
+ uchar c;
+ int count = cx - lineptr;
+ if (count<=0) return True;
+ do {
+ c = edit->buffer[lineptr++];
+ if (c == 0x0a || c == 0x0d || c == 0x09)
+ {
+ if (c == 0x09)
+ {
+ do
+ {
+ drawBuf[bufptr++] = endianCol(' ', color);
+ offset++;
+#if 1
+ } while (offset & 7);
+#else
+ } while ((offset % TEditor::tabSize) != 0);
+#endif
+ }
+ else
+ {
+ count = Width-offset;
+ if (count<=0)
+ return True;
+ while (count--)
+ drawBuf[bufptr++] = endianCol(' ', color);
+ return False;
+ }
+ }
+ else
+ {
+ drawBuf[bufptr++] = endianCol(c, color);
+ offset++;
+ }
+ if (offset >= Width)
+ {
+ return False;
+ }
+ count--;
+ } while (count);
+ return True;
+}
+
+#define normalColor (Colors & 0xff)
+#define selectColor (Colors >> 8)
+
+void TEditor::formatLine( void *DrawBuf, uint32 LinePtr, int Width,
+ ushort Colors )
+{
+ int count,offset,bufptr;
+ ushort color;
+ bufptr = 0;
+ offset = 0;
+ if (selStart > LinePtr)
+ {
+ color = normalColor;
+ count = selStart;
+ CALL;
+ }
+ color = selectColor;
+ count = curPtr;
+ CALL;
+ LinePtr += gapLen;
+ count = selEnd+gapLen;
+ CALL;
+ color = normalColor;
+ count = bufSize;
+ CALL;
+ count = Width-offset;
+ //if (count<=offset) return;
+ if (count<1) return;
+ while (count--) ((ushort *)(DrawBuf))[bufptr++] = endianCol(' ', color);
+}
+
diff --git a/tvision/classes/teditwin.cc b/tvision/classes/teditwin.cc
new file mode 100644
index 0000000..9b32d8c
--- /dev/null
+++ b/tvision/classes/teditwin.cc
@@ -0,0 +1,126 @@
+/* Modified by Robert Hoehne and Salvador Eduardo Tropea for the gcc port */
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*----------------------------------------------------------*/
+/*****************************************************************************
+
+ That's a window containing an editor.
+
+*****************************************************************************/
+
+#define Uses_TFrame
+#define Uses_TWindow
+#define Uses_TRect
+#define Uses_TIndicator
+#define Uses_TEditor
+#define Uses_TMemo
+#define Uses_TFileEditor
+#define Uses_TEditWindow
+#define Uses_TEvent
+#define Uses_TScrollBar
+#define Uses_opstream
+#define Uses_ipstream
+#include <tv.h>
+
+const TPoint minEditWinSize = {24, 6};
+
+TEditWindow::TEditWindow( const TRect& bounds,
+ const char *fileName,
+ int aNumber
+ ) :
+ TWindowInit( &TEditWindow::initFrame )
+ , TWindow( bounds, 0, aNumber )
+{
+ options |= ofTileable;
+
+ TScrollBar *hScrollBar =
+ new TScrollBar( TRect( 18, size.y - 1, size.x - 2, size.y ) );
+ hScrollBar->hide();
+ insert(hScrollBar);
+
+ TScrollBar *vScrollBar =
+ new TScrollBar( TRect( size.x - 1, 1, size.x, size.y - 1 ) );
+ vScrollBar->hide();
+ insert(vScrollBar);
+
+ TIndicator *indicator =
+ new TIndicator( TRect( 2, size.y - 1, 16, size.y ) );
+ indicator->hide();
+ insert(indicator);
+
+
+ TRect r( getExtent() );
+ r.grow(-1, -1);
+ editor = new TFileEditor( r, hScrollBar, vScrollBar, indicator, fileName );
+ insert(editor);
+}
+
+void TEditWindow::close()
+{
+ if( editor->isClipboard() == True )
+ hide();
+ else
+ TWindow::close();
+}
+
+const char *TEditWindow::getTitle( short )
+{
+ if( editor->isClipboard() == True )
+ return _(clipboardTitle);
+ else if( *(editor->fileName) == EOS )
+ return _(untitled);
+ else
+ return editor->fileName;
+}
+
+void TEditWindow::handleEvent( TEvent& event )
+{
+ TWindow::handleEvent(event);
+ if( event.what == evBroadcast && event.message.command == cmUpdateTitle )
+ {
+ if( frame != 0 )
+ frame->drawView();
+ clearEvent(event);
+ }
+}
+
+void TEditWindow::sizeLimits( TPoint& min, TPoint& max )
+{
+ TWindow::sizeLimits(min, max);
+ min = minEditWinSize;
+}
+
+#ifndef NO_STREAM
+
+void TEditWindow::write( opstream& os )
+{
+ TWindow::write( os );
+ os << editor;
+}
+
+void *TEditWindow::read( ipstream& is )
+{
+ TWindow::read( is );
+ is >> editor;
+ return this;
+}
+
+TStreamable *TEditWindow::build()
+{
+ return new TEditWindow( streamableInit );
+}
+
+TEditWindow::TEditWindow( StreamableInit ) :
+ TWindowInit( NULL )
+ , TWindow( streamableInit )
+{
+}
+
+#endif
+
+const char *TEditWindow::clipboardTitle = __("Clipboard");
+const char *TEditWindow::untitled = __("Untitled");
+
diff --git a/tvision/classes/tevent.cc b/tvision/classes/tevent.cc
new file mode 100644
index 0000000..f270517
--- /dev/null
+++ b/tvision/classes/tevent.cc
@@ -0,0 +1,223 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+//#define Uses_stdio
+#define Uses_string
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TScreen
+#define Uses_TVCodePage
+#include <tv.h>
+#include <tv/gkey.h>
+
+TMouse *TEventQueue::mouse = NULL;
+// SET: egcs gets upset if we partially initialize structures and egcs
+// 2.91.66 even crash under Linux (not in DOS, but prints "(null)").
+TEvent TEventQueue::eventQueue[eventQSize];
+TEvent *TEventQueue::eventQHead = TEventQueue::eventQueue;
+TEvent *TEventQueue::eventQTail = TEventQueue::eventQueue;
+Boolean TEventQueue::mouseIntFlag = False;
+
+ushort TEventQueue::eventCount = 0;
+
+Boolean TEventQueue::mouseEvents = False;
+Boolean TEventQueue::mouseReverse = False;
+ushort TEventQueue::doubleDelay = 8;
+ushort TEventQueue::repeatDelay = 8;
+ushort TEventQueue::autoTicks = 0;
+ushort TEventQueue::autoDelay = 0;
+
+MouseEventType TEventQueue::lastMouse;
+MouseEventType TEventQueue::curMouse;
+MouseEventType TEventQueue::downMouse;
+ushort TEventQueue::downTicks = 0;
+
+TEventQueue::TEventQueue()
+{
+ // SET: Just in case. Note: I can't debug it!
+ memset((void *)&eventQueue[0],0,sizeof(TEvent)*eventQSize);
+ resume();
+}
+
+static int TEventQueue_suspended = 1;
+
+void TEventQueue::resume()
+{
+ if (!TEventQueue_suspended) return;
+ // SET: We resumed, no matters if mouse fails or not
+ TEventQueue_suspended = 0;
+ TGKey::resume();
+ mouseEvents = False;
+ if( !mouse )
+ mouse = new TMouse();
+ if( mouse->present() == False )
+ mouse->resume();
+ if( mouse->present() == False )
+ return;
+ mouse->getEvent( curMouse );
+ lastMouse = curMouse;
+
+ mouseEvents = True;
+ mouse->setRange( TScreen::getCols()-1, TScreen::getRows()-1 );
+}
+
+void TEventQueue::suspend()
+{
+ if (TEventQueue_suspended)
+ return;
+ if (mouse->present())
+ mouse->suspend();
+ /* RH: I think here is the right place for clearing the
+ buffer */
+ TGKey::clear();
+ TGKey::suspend();
+ TEventQueue_suspended = 1;
+}
+
+TEventQueue::~TEventQueue()
+{
+ suspend();
+ // SET: Destroy the mouse object
+ if (mouse)
+ delete mouse;
+}
+
+#ifdef TVComp_BCPP
+// it works better (faster)
+#define AUTO_DELAY_VAL 0
+#else
+#define AUTO_DELAY_VAL 1
+#endif
+
+void TEventQueue::getMouseEvent( TEvent& ev )
+{
+ if( mouseEvents == True )
+ {
+
+ getMouseState( ev );
+
+ if( ev.mouse.buttons == 0 && lastMouse.buttons != 0 )
+ {
+ ev.what = evMouseUp;
+// int buttons = lastMouse.buttons;
+ lastMouse = ev.mouse;
+// ev.mouse.buttons = buttons;
+ return;
+ }
+
+ if( ev.mouse.buttons != 0 && lastMouse.buttons == 0 )
+ {
+ if( ev.mouse.buttons == downMouse.buttons &&
+ ev.mouse.where == downMouse.where &&
+ ev.what - downTicks <= doubleDelay )
+ ev.mouse.doubleClick = True;
+
+ downMouse = ev.mouse;
+ autoTicks = downTicks = ev.what;
+ autoDelay = repeatDelay;
+ ev.what = evMouseDown;
+ lastMouse = ev.mouse;
+ return;
+ }
+
+ ev.mouse.buttons = lastMouse.buttons;
+
+ if( ev.mouse.where != lastMouse.where )
+ {
+ ev.what = evMouseMove;
+ lastMouse = ev.mouse;
+ return;
+ }
+
+ if( ev.mouse.buttons != 0 && ev.what - autoTicks > autoDelay )
+ {
+ autoTicks = ev.what;
+ autoDelay = AUTO_DELAY_VAL;
+ ev.what = evMouseAuto;
+ lastMouse = ev.mouse;
+ return;
+ }
+ }
+
+ ev.what = evNothing;
+}
+
+void TEventQueue::getMouseState( TEvent & ev )
+{
+ if( eventCount == 0 )
+ {
+ TMouse::getEvent(ev.mouse);
+ ev.what = CLY_Ticks();
+ }
+ else
+ {
+ ev = *eventQHead;
+ if( ++eventQHead >= eventQueue + eventQSize )
+ eventQHead = eventQueue;
+ eventCount--;
+ }
+ if( mouseReverse != False && ev.mouse.buttons != 0 && ev.mouse.buttons != 3 )
+ ev.mouse.buttons ^= 3;
+}
+
+#ifdef TVCompf_djgpp
+#include <tv/dos/mouse.h>
+
+void TEventQueue::mouseInt()
+{
+ int buttonPress;
+
+ if (THWMouseDOS::getRMCB_InfoDraw(buttonPress))
+ mouseIntFlag=True;
+ if (buttonPress && eventCount<eventQSize)
+ {
+ eventQTail->what =CLY_Ticks();
+ eventQTail->mouse=curMouse;
+ if (++eventQTail>=eventQueue+eventQSize)
+ eventQTail=eventQueue;
+ eventCount++;
+ }
+
+ curMouse=THWMouseDOS::intEvent;
+}
+
+#else
+
+void TEventQueue::mouseInt()
+{
+}
+
+#endif
+
+
+void TEvent::getKeyEvent()
+{
+ if (TGKey::kbhit())
+ {
+ TGKey::fillTEvent(*this);
+ // SET: That's a special case, when the keyboard indicates the event
+ // is mouse up it means the keyboard forced an event in the mouse module.
+ if (what==evMouseUp)
+ getMouseEvent();
+ else
+ {
+ if (TVCodePage::OnTheFlyRemapInpNeeded() && keyDown.charScan.charCode>32)
+ keyDown.charScan.charCode=TVCodePage::OnTheFlyInpRemap(keyDown.charScan.charCode);
+ TGKey::AltInternat2ASCII(*this);
+ }
+ }
+ else
+ what=evNothing;
+}
+
+
diff --git a/tvision/classes/tfilecol.cc b/tvision/classes/tfilecol.cc
new file mode 100644
index 0000000..0aed0a5
--- /dev/null
+++ b/tvision/classes/tfilecol.cc
@@ -0,0 +1,120 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Added options to customize the file sorting by Salvador E. Tropea.
+
+ *
+ *
+ */
+#include <tv/configtv.h>
+
+#if defined(TVCompf_djgpp) || defined(TVComp_BCPP)
+ #include <dos.h>
+#endif
+#define Uses_string
+#define Uses_stdio
+#define Uses_dir
+#define Uses_TFileCollection
+#define Uses_TSearchRec
+#include <tv.h>
+
+// SET: Added to customize the sorting. These values are the values that make
+// the class behave like the Turbo Vision help describes. Note that selecting
+// fcolCaseSensitive and not using fcolAlphabetical breaks the incremental
+// search trick that looks for Shift to look-up directories.
+unsigned TFileCollection::sortOptions=fcolParentLast | fcolDirsLast |
+ fcolCaseInsensitive;
+
+inline const char *getName( void *k )
+{
+ return ((TSearchRec *)k)->name;
+}
+
+inline int attr( void *k )
+{
+ return ((TSearchRec *)k)->attr;
+}
+
+// SET: I remade it with 6 possible combinations
+int TFileCollection::compare(void *key1, void *key2)
+{
+ unsigned sort=sortOptions & fcolTypeMask;
+ unsigned caseInSens=sortOptions & fcolCaseInsensitive;
+ const char *nKey1=getName(key1),*nKey2=getName(key2);
+
+ // .* files are also special
+ if ((sortOptions & fcolDotsLast) && nKey1[0]!=nKey2[0])
+ {
+ if (nKey1[0]=='.' && strcmp(nKey1,"..")!=0) return 1;
+ if (nKey2[0]=='.' && strcmp(nKey2,"..")!=0) return -1;
+ }
+
+ if (sort==fcolAlphabetical)
+ {
+ if (caseInSens)
+ return strcasecmp(nKey1,nKey2);
+ else
+ return strcmp(nKey1,nKey2);
+ }
+
+ // If the names are equal don't swap
+ if (caseInSens)
+ {
+ if (strcasecmp(nKey1,nKey2)==0)
+ return 0;
+ }
+ else
+ {
+ if (strcmp(nKey1,nKey2)==0)
+ return 0;
+ }
+
+ // .. is special
+ if (strcmp(nKey1,"..")==0)
+ return sortOptions & fcolParentLast ? 1 : -1;
+ if (strcmp(nKey2,"..")==0)
+ return sortOptions & fcolParentLast ? -1 : 1;
+
+ // One is a directory, but not the other
+ if ((attr(key1) & FA_DIREC) && (attr(key2) & FA_DIREC)==0)
+ return sort==fcolDirsFirst ? -1 : 1;
+ if ((attr(key2) & FA_DIREC) && (attr(key1) & FA_DIREC)==0)
+ return sort==fcolDirsLast ? -1 : 1;
+
+ // Both of the same type
+ if (caseInSens)
+ return strcasecmp(nKey1,nKey2);
+ return strcmp(nKey1,nKey2);
+}
+
+
+#if !defined( NO_STREAM )
+TStreamable *TFileCollection::build()
+{
+ return new TFileCollection( streamableInit );
+}
+
+void TFileCollection::writeItem( void *obj, opstream& os )
+{
+ TSearchRec *item = (TSearchRec *)obj;
+ os << item->attr << (unsigned long)item->time << (unsigned long)item->size;
+ os.writeString( item->name );
+}
+
+void *TFileCollection::readItem( ipstream& is )
+{
+ TSearchRec *item = new TSearchRec;
+ unsigned long aux1, aux2;
+ is >> item->attr >> aux1 >> aux2;
+ is.readString( item->name, sizeof(item->name) );
+ item->time = (time_t)aux1;
+ item->size = (size_t)aux2;
+ return item;
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tfiledia.cc b/tvision/classes/tfiledia.cc
new file mode 100644
index 0000000..5fb82e5
--- /dev/null
+++ b/tvision/classes/tfiledia.cc
@@ -0,0 +1,326 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador Eduardo Tropea to add more functionality.
+Modified by Vadim Beloborodov to be used on WIN32 console
+ *
+ *
+ */
+#define Uses_string
+#define Uses_ctype
+#include <stdio.h>
+#define Uses_HaveLFNs
+#define Uses_TFileDialog
+#define Uses_MsgBox
+#define Uses_TRect
+#define Uses_TFileInputLine
+#define Uses_TButton
+#define Uses_T1Label
+#define Uses_TFileList
+#define Uses_THistory
+#define Uses_TScrollBar
+#define Uses_TEvent
+#define Uses_TFileInfoPane
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#include <tv.h>
+
+#include <errno.h>
+
+// File dialog flags
+const int
+ ffOpen = 0x0001,
+ ffSaveAs = 0x0002;
+
+const ushort
+ cmOpenDialogOpen = 100,
+ cmOpenDialogReplace = 101;
+
+TFileDialog::TFileDialog( const char *aWildCard,
+ const char *aTitle,
+ const char *inputName,
+ ushort aOptions,
+ uchar histId
+ ) :
+ TWindowInit( &TFileDialog::initFrame ),
+ TDialog( TRect( 15, 1, 64, 21 ), aTitle ),
+ directory( 0 )
+{ // SET: Enlarged the window 1 line and added 1 line to the list moving
+ // labels 1 line up
+ options |= ofCentered;
+ // SET: Allow it to grow
+ growMode = gfGrowAll;
+ flags |= wfGrow | wfZoom;
+ strcpy( wildCard, aWildCard );
+
+ fileName = new TFileInputLine( TRect( 3, 2, 31, 3 ), PATH_MAX );
+ strcpy( fileName->data, wildCard );
+ fileName->growMode=gfGrowHiX;
+ insert( fileName );
+
+ insert( new T1Label( 2, 1, inputName, fileName ) );
+ THistory *his=new THistory(TRect(31,2,34,3),fileName,histId);
+ // SET: This and more settings to make it grow nicely
+ his->growMode=gfGrowLoX | gfGrowHiX;
+ insert(his);
+
+ int longNames=CLY_HaveLFNs(); // SET
+ TScrollBar *sb = longNames ?
+ new TScrollBar( TRect( 34, 5, 35, 16 ) ) :
+ new TScrollBar( TRect( 3, 15, 34, 16 ) );
+ insert( sb );
+ insert(fileList=new TFileList(TRect(3,5,34,longNames ? 16 : 15),sb));
+ fileList->growMode=gfGrowHiX | gfGrowHiY;
+
+ insert( new T1Label( 2, 4, __("~F~iles"), fileList ) );
+
+ ushort opt = bfDefault;
+ TRect r( 35, 2, 46, 4 );
+
+ TButton *bt;
+ #define AddButton(flag,name,command)\
+ if (aOptions & flag) {\
+ bt=new TButton(r,name,command,opt); \
+ bt->growMode=gfGrowLoX | gfGrowHiX; \
+ insert(bt); opt=bfNormal; r.a.y+=2; r.b.y+=2; }
+
+ AddButton(fdOpenButton,__("~O~pen"),cmFileOpen)
+ AddButton(fdOKButton,__("~O~K"),cmFileOpen)
+ AddButton(fdAddButton,__("~A~dd"),cmFileOpen)
+ AddButton(fdSelectButton,__("~S~elect"),cmFileSelect)
+ AddButton(fdReplaceButton,__("~R~eplace"),cmFileReplace)
+ AddButton(fdClearButton,__("~C~lear"),cmFileClear)
+
+ bt=new TButton(r,aOptions & fdDoneButton ? __("Done") : __("Cancel"),
+ cmCancel,bfNormal);
+ bt->growMode=gfGrowLoX | gfGrowHiX;
+ insert(bt);
+ r.a.y += 2;
+ r.b.y += 2;
+
+ if( (aOptions & fdHelpButton) != 0 )
+ {
+ bt=new TButton(r,__("~H~elp"),cmHelp,bfNormal);
+ bt->growMode=gfGrowLoX | gfGrowHiX;
+ insert(bt);
+ r.a.y += 2;
+ r.b.y += 2;
+ }
+
+ TFileInfoPane *fip=new TFileInfoPane(TRect(1,16,48,19));
+ //fip->growMode=gfGrowHiX | gfGrowHiY;
+ fip->growMode=gfGrowHiX | gfGrowHiY | gfGrowLoY;
+ insert(fip);
+
+ selectNext( False );
+ if( (aOptions & fdNoLoadDir) == 0 )
+ readDirectory();
+ else
+ setUpCurDir(); // SET: We must setup the current directory anyways
+}
+
+// SET: Avoid a size smaller than the starting one
+void TFileDialog::sizeLimits(TPoint& min, TPoint& max)
+{
+ TDialog::sizeLimits(min,max);
+ min.x=64-15;
+ min.y=21-1;
+}
+
+TFileDialog::~TFileDialog()
+{
+ DeleteArray((char *)directory);
+}
+
+void TFileDialog::shutDown()
+{
+ fileName = 0;
+ fileList = 0;
+ TDialog::shutDown();
+}
+
+static void trim( char *dest, const char *src )
+{
+ const char *end = NULL;
+ while( *src != EOS && ucisspace( *src ) )
+ src++;
+ {
+/* when a filename contains spaces (not tested) */
+ end = src + strlen(src) - 1;
+ if (end < src) end = src;
+ else
+ {
+ while (end > src && ucisspace(*end)) end--;
+ }
+ }
+ while( *src != EOS && src <= end )
+ *dest++ = *src++;
+ *dest = EOS;
+}
+
+void TFileDialog::getFileName( char *s )
+{
+ char buf[PATH_MAX];
+
+ trim( buf, fileName->data );
+ if ( CLY_IsRelativePath( buf ) )
+ {
+ strcpy( buf, directory );
+ trim( buf + strlen(buf), fileName->data );
+ }
+ CLY_fexpand( buf );
+ strcpy( s, buf );
+}
+
+void TFileDialog::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if( event.what == evCommand )
+ switch( event.message.command )
+ {
+ case cmFileOpen:
+ case cmFileReplace:
+ case cmFileClear:
+ case cmFileSelect:
+ {
+ endModal(event.message.command);
+ clearEvent(event);
+ }
+ break;
+ default:
+ break;
+ }
+ // SET: From TV 2.0
+ else if( event.what == evBroadcast && event.message.command == cmFileDoubleClicked )
+ {
+ event.what = evCommand;
+ event.message.command = cmOK;
+ putEvent( event );
+ clearEvent( event );
+ }
+
+}
+
+void TFileDialog::readDirectory()
+{
+ fileList->readDirectory( wildCard );
+ setUpCurDir();
+}
+
+void TFileDialog::setUpCurDir()
+{
+ DeleteArray((char *)directory);
+ char curDir[PATH_MAX];
+ CLY_GetCurDirSlash(curDir);
+ directory = newStr( curDir );
+}
+
+void TFileDialog::setData( void *rec )
+{
+ TDialog::setData( rec );
+ if( *(char *)rec != EOS && CLY_IsWild( (char *)rec ) )
+ {
+ valid( cmFileInit );
+ fileName->select();
+ }
+}
+
+void TFileDialog::getData( void *rec )
+{
+ getFileName( (char *)rec );
+}
+
+Boolean TFileDialog::checkDirectory( const char *str )
+{
+ if( CLY_PathValid( str ) )
+ return True;
+ else
+ {
+ messageBox( __("Invalid drive or directory"), mfError | mfOKButton );
+ fileName->select();
+ return False;
+ }
+}
+
+Boolean TFileDialog::valid(ushort command)
+{
+ char fName[PATH_MAX];
+ char name[PATH_MAX];
+ char dir[PATH_MAX];
+
+ if (!TDialog::valid(command))
+ return False;
+
+ if ((command == cmValid) || (command == cmCancel))
+ return True;
+
+ getFileName( fName );
+ if (command != cmFileClear)
+ {
+ if(CLY_IsWild(fName))
+ {
+ CLY_ExpandPath(fName, dir, name);
+ if (checkDirectory(dir))
+ {
+ DeleteArray((char *)directory);
+ directory = newStr(dir);
+ strcpy(wildCard, name);
+ if (command != cmFileInit)
+ fileList->select();
+ fileList->readDirectory(directory, wildCard);
+ }
+ }
+ else if (CLY_IsDir(fName))
+ {
+ if (checkDirectory(fName))
+ {
+ delete (char *)directory;
+ strcat(fName, DIRSEPARATOR_);
+ directory = newStr(fName);
+ if (command != cmFileInit)
+ fileList->select();
+ fileList->readDirectory(directory, wildCard);
+ }
+ }
+ else if (CLY_ValidFileName(fName))
+ return True;
+ else
+ {
+ messageBox( __("Invalid file name."), mfError | mfOKButton );
+ return False;
+ }
+ }
+ else
+ return True;
+ return False; // To shut up GCC's warning
+}
+
+#if !defined( NO_STREAM )
+void TFileDialog::write( opstream& os )
+{
+ TDialog::write( os );
+ os.writeString( wildCard );
+ os << fileName << fileList;
+}
+
+void *TFileDialog::read( ipstream& is )
+{
+ TDialog::read( is );
+ is.readString( wildCard, sizeof(wildCard) );
+ is >> fileName >> fileList;
+ readDirectory();
+ return this;
+}
+
+TStreamable *TFileDialog::build()
+{
+ return new TFileDialog( streamableInit );
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tfileedi.cc b/tvision/classes/tfileedi.cc
new file mode 100644
index 0000000..6f57f88
--- /dev/null
+++ b/tvision/classes/tfileedi.cc
@@ -0,0 +1,370 @@
+/* Modified by Robert Hoehne and Salvador Eduardo Tropea for the gcc port */
+/* Modified by Vadim Beloborodov to be used on WIN32 console */
+/* Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ Andris Pavenis. */
+/* Modified by Salvador E. Tropea to avoid using C++ streams (just C code) */
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*----------------------------------------------------------*/
+#include <tv/configtv.h>
+
+#define Uses_filelength
+#define Uses_limits
+#define Uses_string
+#define Uses_fcntl
+#ifdef TVComp_MSC
+ #include <io.h>
+#else
+ #define Uses_unistd
+#endif
+#define Uses_stdio
+#define Uses_sys_stat
+
+#define Uses_TGroup
+#define Uses_TEditor
+#define Uses_TFileEditor
+#define Uses_TEvent
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#define Uses_IOS_BIN
+#include <tv.h>
+
+UsingNamespaceStd
+
+inline uint32 min( uint32 u1, uint32 u2 )
+{
+ return u1 < u2 ? u1 : u2;
+}
+
+TFileEditor::TFileEditor( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ TIndicator *aIndicator,
+ const char *aFileName
+ ) :
+ TEditor( bounds, aHScrollBar, aVScrollBar, aIndicator, 4096 )
+{
+ if( aFileName == 0 )
+ fileName[0] = EOS;
+ else
+ {
+ strcpy( fileName, aFileName );
+ if( isValid )
+ isValid = loadFile();
+ }
+}
+
+void TFileEditor::doneBuffer()
+{
+ DeleteArray(buffer);
+}
+
+void TFileEditor::handleEvent( TEvent& event )
+{
+ TEditor::handleEvent(event);
+ switch( event.what )
+ {
+ case evCommand:
+ switch( event.message.command )
+ {
+ case cmSave:
+ save();
+ break;
+ case cmSaveAs:
+ saveAs();
+ break;
+ default:
+ return;
+ }
+ break;
+ default:
+ return;
+ }
+ clearEvent(event);
+}
+
+void TFileEditor::initBuffer()
+{
+ buffer = new char[bufSize];
+}
+
+Boolean TFileEditor::loadFile()
+{
+ int crfound = 0;
+ char tmp[PATH_MAX];
+ FILE *f=fopen(fileName,"rb");
+ if( !f )
+ {
+ setBufLen( 0 );
+ return True;
+ }
+ else
+ {
+ #ifdef TVOS_DOS
+ int i;
+/* check for a unix text file (is a heuristic, because only 1024 chars checked */
+ {
+ char tmpbuf[1024];
+ long fsize=filelength(fileno(f));
+ if (fsize > 1024) fsize = 1024;
+ fread(tmpbuf,fsize,1,f);
+ for (i=0;i<1024;i++)
+ {
+ if (tmpbuf[i] == '\r') crfound = 1;
+ else if (tmpbuf[i] == '\n') break;
+ }
+ if (crfound)
+ {
+ fseek(f,0,SEEK_SET);
+ }
+ else
+ {
+ int readhandle,writehandle;
+ fclose(f);
+ readhandle = open(fileName,O_RDONLY|O_BINARY);
+ tmpnam(tmp);
+ writehandle = open(tmp,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT,0600);
+ while ((fsize = ::read(readhandle,tmpbuf,1024)) > 0)
+ ::write(writehandle,tmpbuf,fsize);
+ close(readhandle);
+ close(writehandle);
+ f=fopen(tmp,"rb");
+ }
+ }
+ #endif
+ long fSize=filelength(fileno(f));;
+ if( setBufSize((uint32)(fSize)) == False )
+ {
+ editorDialog( edOutOfMemory );
+ if (!crfound) remove(tmp);
+ return False;
+ }
+ else
+ {
+ if ( fSize > INT_MAX )
+ {
+ fread( &buffer[bufSize - (uint32)(fSize)], INT_MAX, 1, f );
+ fread( &buffer[bufSize - (uint32)(fSize) + INT_MAX],
+ (uint32)(fSize - INT_MAX), 1, f );
+
+ }
+ else
+ fread( &buffer[bufSize - (uint32)(fSize)], (uint32)(fSize), 1, f );
+ int error=ferror(f);
+ if( fclose(f) || error )
+ {
+ editorDialog( edReadError, fileName );
+ if (!crfound) remove(tmp);
+ return False;
+ }
+ else
+ {
+ setBufLen((uint32)(fSize));
+ if (!crfound) remove(tmp);
+ return True;
+ }
+ }
+ }
+}
+
+Boolean TFileEditor::save()
+{
+ if( *fileName == EOS )
+ return saveAs();
+ else
+ return saveFile();
+}
+
+Boolean TFileEditor::saveAs()
+{
+ Boolean res = False;
+ if( editorDialog( edSaveAs, fileName ) != cmCancel )
+ {
+ CLY_fexpand( fileName );
+ message( owner, evBroadcast, cmUpdateTitle, 0 );
+ res = saveFile();
+ if( isClipboard() == True )
+ *fileName = EOS;
+ }
+ return res;
+}
+
+static void writeBlock( FILE *f, char *buf, unsigned len )
+{
+ while( len > 0 )
+ {
+ int l = len < INT_MAX ? len : INT_MAX;
+ fwrite( buf, l, 1, f );
+ buf += l;
+ len -= l;
+ }
+}
+
+// SET: from my editor:
+static
+int edTestForFile(const char *name)
+{
+ struct stat st;
+
+ if (stat(name,&st)==0)
+ return S_ISREG(st.st_mode);
+ return 0;
+}
+
+Boolean TFileEditor::saveFile()
+{
+ // SET: That's similar to what I use in TCEdit and is partially a hack
+ // to avoid fnsplit & fnmerge in Linux (originally from Robert).
+ if ((editorFlags & efBackupFiles) &&
+ edTestForFile(fileName)) // Forget about it if that's a new file
+ {
+ char *dot,*slash;
+ int flen = strlen(fileName);
+ char backupName[PATH_MAX];
+ strcpy(backupName,fileName);
+ dot = strrchr(backupName,'.');
+ slash = strrchr(backupName,DIRSEPARATOR);
+ if (dot < slash) // directory has a dot but not the filename
+ dot = NULL;
+ if (!dot)
+ dot = backupName + flen;
+ strcpy(dot,backupExt);
+ unlink( backupName );
+ rename( fileName, backupName );
+ }
+
+ FILE *f=fopen(fileName,"wb");
+
+ if( !f )
+ {
+ editorDialog( edCreateError, fileName );
+ return False;
+ }
+ else
+ {
+ writeBlock( f, buffer, curPtr );
+ writeBlock( f, buffer+curPtr+gapLen, bufLen-curPtr );
+
+ int error=ferror(f); // SET: Is that needed? Or fclose will inform the error?
+ if( fclose(f) || error )
+ {
+ editorDialog( edWriteError, fileName );
+ return False;
+ }
+ else
+ {
+ modified = False;
+ update(ufUpdate);
+ }
+ }
+ return True;
+}
+
+Boolean TFileEditor::setBufSize( uint32 newSize )
+{
+ newSize = (newSize + 0x0FFF) & 0xFFFFF000L;
+ if( newSize != bufSize )
+ {
+ char *temp = buffer;
+ if( (buffer = new char[newSize]) == 0 )
+ {
+ delete temp;
+ return False;
+ }
+ uint32 n = bufLen - curPtr + delCount;
+ memcpy( buffer, temp, min( newSize, bufSize ) );
+ memmove( &buffer[newSize - n], &temp[bufSize - n], n );
+ delete temp;
+ bufSize = newSize;
+ gapLen = bufSize - bufLen;
+ }
+ return True;
+}
+
+void TFileEditor::shutDown()
+{
+ setCmdState(cmSave, False);
+ setCmdState(cmSaveAs, False);
+ TEditor::shutDown();
+}
+
+void TFileEditor::updateCommands()
+{
+ TEditor::updateCommands();
+ setCmdState(cmSave, True);
+ setCmdState(cmSaveAs, True);
+}
+
+Boolean TFileEditor::valid( ushort command )
+{
+ if( command == cmValid )
+ return isValid;
+ else
+ {
+ if( modified == True )
+ {
+ int d;
+ if( *fileName == EOS )
+ d = edSaveUntitled;
+ else
+ d = edSaveModify;
+
+ switch( editorDialog( d, fileName ) )
+ {
+ case cmYes:
+ return save();
+ case cmNo:
+ modified = False;
+ return True;
+ case cmCancel:
+ return False;
+ }
+ }
+ }
+ return True;
+}
+
+#ifndef NO_STREAM
+
+void TFileEditor::write( opstream& os )
+{
+ TEditor::write( os );
+ os.writeString( fileName );
+ os << selStart << selEnd << curPtr;
+}
+
+void *TFileEditor::read( ipstream& is )
+{
+ TEditor::read( is );
+ is.readString( fileName, sizeof( fileName ) );
+ if( isValid )
+ {
+ isValid = loadFile();
+ uint32 sStart, sEnd, curs;
+ is >> sStart >> sEnd >> curs;
+ if( isValid && sEnd <= bufLen )
+ {
+ setSelect( sStart, sEnd, Boolean(curs == sStart) );
+ trackCursor( True );
+ }
+ }
+ return this;
+}
+
+TStreamable *TFileEditor::build()
+{
+ return new TFileEditor( streamableInit );
+}
+
+TFileEditor::TFileEditor( StreamableInit ) : TEditor( streamableInit )
+{
+}
+
+#endif
+
+// SET: Changed to lower case because it looks much better when using LFNs
+const char *TFileEditor::backupExt = ".bak";
diff --git a/tvision/classes/tfileinf.cc b/tvision/classes/tfileinf.cc
new file mode 100644
index 0000000..ef3dd4b
--- /dev/null
+++ b/tvision/classes/tfileinf.cc
@@ -0,0 +1,133 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+#define Uses_time
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_string
+#define Uses_snprintf
+
+#define Uses_TFileInputLine
+#define Uses_TEvent
+#define Uses_TSearchRec
+#define Uses_TFileInfoPane
+#define Uses_TDrawBuffer
+#define Uses_TFileDialog
+#define Uses_TPalette
+#include <tv.h>
+
+#define cpInfoPane "\x1E"
+
+TFileInfoPane::TFileInfoPane( const TRect& bounds ) :
+ TView(bounds)
+{
+ eventMask |= evBroadcast;
+ *(file_block.name) = EOS; // SET: We must have something in case there are no matches
+}
+
+const char * const TFileInfoPane::months[] =
+ {
+ "",__("Jan"),__("Feb"),__("Mar"),__("Apr"),__("May"),__("Jun"),
+ __("Jul"),__("Aug"),__("Sep"),__("Oct"),__("Nov"),__("Dec")
+ };
+
+void TFileInfoPane::draw()
+{
+ Boolean PM;
+ TDrawBuffer b;
+ ushort color;
+#if 1
+ struct tm *time;
+#else
+ ftime *time;
+#endif
+ char path[PATH_MAX];
+
+ strcpy( path, ((TFileDialog *)owner)->directory );
+ strcat( path, ((TFileDialog *)owner)->wildCard );
+ CLY_fexpand( path );
+
+ color = getColor(0x01);
+ b.moveChar( 0, ' ', color, size.x );
+ b.moveStr( 1, path, color );
+ writeLine( 0, 0, size.x, 1, b );
+
+ b.moveChar( 0, ' ', color, size.x );
+ b.moveStr( 1, file_block.name, color );
+
+ writeLine( 0, 1, size.x, 1, b);
+ b.moveChar( 0, ' ', color, size.x );
+
+ if ( *(file_block.name) != EOS )
+ {
+ const int blen=10;
+ char buf[blen];
+ CLY_snprintf(buf,blen,"%ld",(long)file_block.size);
+ b.moveStr( 14, buf, color );
+
+ time = localtime(&file_block.time);
+ if (time)
+ {// SET: I don't know how many libc in the world behaves in this
+ // stupid way, but Mingw32 980701-4 does it for some crazy dates.
+ b.moveStr( 25, _(months[time->tm_mon+1]), color );
+ CLY_snprintf(buf,blen,"%02d",time->tm_mday);
+ b.moveStr( 29, buf, color );
+
+ b.putChar( 31, ',' );
+ CLY_snprintf(buf,blen,"%d",time->tm_year+1900);
+ b.moveStr( 32, buf, color );
+
+ PM = Boolean(time->tm_hour >= 12 );
+ time->tm_hour %= 12;
+
+ if ( time->tm_hour == 0 )
+ time->tm_hour = 12;
+ CLY_snprintf(buf,blen,"%02d",time->tm_hour);
+ b.moveStr( 38, buf, color );
+ b.putChar( 40, ':' );
+ CLY_snprintf(buf,blen,"%02d",time->tm_min);
+ b.moveStr( 41, buf, color );
+
+ if ( PM )
+ b.moveStr( 43, pmText, color );
+ else
+ b.moveStr( 43, amText, color );
+ }
+ }
+ writeLine(0, 2, size.x, 1, b );
+ b.moveChar( 0, ' ', color, size. x);
+ writeLine( 0, 3, size.x, size.y-3, b);
+}
+
+TPalette& TFileInfoPane::getPalette() const
+{
+ static TPalette palette( cpInfoPane, sizeof( cpInfoPane )-1 );
+ return palette;
+}
+
+void TFileInfoPane::handleEvent( TEvent& event )
+{
+ TView::handleEvent(event);
+ if( event.what == evBroadcast && event.message.command == cmFileFocused )
+ {
+ file_block = *((TSearchRec *)(event.message.infoPtr));
+ drawView();
+ }
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TFileInfoPane::build()
+{
+ return new TFileInfoPane( streamableInit );
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tfileinp.cc b/tvision/classes/tfileinp.cc
new file mode 100644
index 0000000..14f5420
--- /dev/null
+++ b/tvision/classes/tfileinp.cc
@@ -0,0 +1,83 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+#define Uses_string
+#define Uses_dir
+#define Uses_TFileInputLine
+#define Uses_TEvent
+#define Uses_TSearchRec
+#define Uses_TFileDialog
+#include <tv.h>
+
+#if defined(TVComp_BCPP)
+ #include <dos.h>
+#endif
+
+TFileInputLine::TFileInputLine( const TRect& bounds, short aMaxLen ) :
+ TInputLine( bounds, aMaxLen )
+{
+ eventMask = eventMask | evBroadcast;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Simple routine to join three strings without coping more than max+1 bytes.
+The data buffer must support max+1 bytes. The s2 and s3 parameters can be
+NULL.@p
+ It could be implemented with var_args, any interest?
+
+***************************************************************************/
+
+static
+void strCat(char *dest, const char *s1, const char *s2, const char *s3, int max)
+{
+ char *end=dest+max;
+
+ for (;*s1 && dest<end; s1++) *(dest++)=*s1;
+ if (s2)
+ for (;*s2 && dest<end; s2++) *(dest++)=*s2;
+ if (s3)
+ for (;*s3 && dest<end; s3++) *(dest++)=*s3;
+ *dest=0;
+}
+
+void TFileInputLine::handleEvent( TEvent& event )
+{
+ TInputLine::handleEvent(event);
+ if( event.what == evBroadcast &&
+ event.message.command == cmFileFocused &&
+ !(state & sfSelected)
+ )
+ {
+ if( (((TSearchRec *)event.message.infoPtr)->attr & FA_DIREC) != 0 )
+ strCat(data,((TSearchRec *)event.message.infoPtr)->name,
+ DIRSEPARATOR_,((TFileDialog *)owner)->wildCard,
+ maxLen);
+ else
+ strCat(data,((TSearchRec *)event.message.infoPtr)->name,0,0,maxLen);
+ drawView();
+ }
+}
+
+#if !defined( NO_STREAM )
+TFileInputLine::TFileInputLine( StreamableInit ) :
+ TInputLine( streamableInit)
+{
+}
+
+TStreamable *TFileInputLine::build()
+{
+ return new TFileInputLine( streamableInit );
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tfilelis.cc b/tvision/classes/tfilelis.cc
new file mode 100644
index 0000000..56a06e4
--- /dev/null
+++ b/tvision/classes/tfilelis.cc
@@ -0,0 +1,623 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+Modified by Salvador E. Tropea to exclude .. in parent dir and
+exlude some particular files by configuration.
+
+ *
+ *
+ */
+#include <tv/configtv.h>
+
+#define Uses_string
+#define Uses_stdio
+#ifdef TVComp_MSC
+ #include <io.h>
+ #define Uses_glob
+#else
+ #define Uses_unistd
+#endif
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_HaveLFNs
+#define Uses_dirent
+#define Uses_getcwd
+#define Uses_AllocLocal
+
+#define Uses_TGKey
+#define Uses_MsgBox
+#define Uses_TFileList
+#define Uses_TRect
+#define Uses_TSearchRec
+#define Uses_TEvent
+#define Uses_TGroup
+#define Uses_TStreamableClass
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_sys_stat
+
+#if defined(TVCompf_djgpp)
+ // DJGPP
+ #define Uses_fnmatch
+ #include <dir.h>
+#elif defined(TVComp_BCPP) || defined(TVCompf_Cygwin) || defined(TVOS_UNIX) && !defined(TVOSf_QNX4)
+ // UNIX, Win32/BC++, Win32/Cygwin
+ #define Uses_glob
+#endif
+
+#include <tv.h>
+
+#include <errno.h>
+#if defined(TVComp_BCPP)
+#include <dos.h>
+#endif
+
+TFileList::TFileList( const TRect& bounds,
+ TScrollBar *aScrollBar) :
+ TSortedListBox( bounds, 2, aScrollBar )
+{
+ if (CLY_HaveLFNs())
+ setNumCols(1);
+}
+
+TFileList::~TFileList()
+{
+ if ( list() )
+ CLY_destroy ( list() );
+}
+
+void TFileList::focusItem( ccIndex item )
+{
+ TSortedListBox::focusItem( item );
+ message( owner, evBroadcast, cmFileFocused, list()->at(item) );
+}
+
+// SET: From TV 2.0
+void TFileList::selectItem( ccIndex item )
+{
+ message( owner, evBroadcast, cmFileDoubleClicked, list()->at(item) );
+}
+
+void TFileList::getData( void * )
+{
+}
+
+void TFileList::setData( void * )
+{
+}
+
+uint32 TFileList::dataSize()
+{
+ return 0;
+}
+
+void* TFileList::getKey( const char *s )
+{
+ static TSearchRec sR;
+
+ if ((TGKey::getShiftState() & (kbLeftShiftDown | kbRightShiftDown)) ||
+ *s=='.')
+ sR.attr=FA_DIREC;
+ else
+ sR.attr=0;
+ strcpy( sR.name, s );
+ return &sR;
+}
+
+void TFileList::getText( char *dest, ccIndex item, short maxChars )
+{
+ TSearchRec *f = (TSearchRec *)(list()->at(item));
+
+ strncpy( dest, f->name, maxChars );
+ dest[maxChars] = '\0';
+ if( f->attr & FA_DIREC )
+ strcat( dest, DIRSEPARATOR_ );
+}
+
+void TFileList::handleEvent( TEvent & event )
+{
+ TSearchRec trec, *tp;
+
+ TSortedListBox::handleEvent( event );
+ if( event.what == evKeyDown )
+ {
+ if( event.keyDown.keyCode == kbLeft )
+ {
+ clearEvent( event );
+ /* Move to .. */
+ trec.attr = FA_DIREC;
+ strcpy( trec.name, ".." );
+ message( owner, evBroadcast, cmFileFocused, &trec );
+ message( owner, evBroadcast, cmFileDoubleClicked, &trec );
+ }
+ else if( event.keyDown.keyCode == kbRight )
+ {
+ clearEvent( event );
+ /* Enter dir */
+ tp = list()->at(focused);
+ if( tp->attr & FA_DIREC )
+ message( owner, evBroadcast, cmFileDoubleClicked, tp );
+ }
+ }
+}
+
+void TFileList::readDirectory( const char *dir, const char *wildCard )
+{
+ char path[PATH_MAX];
+ strcpy( path, dir );
+ strcat( path, wildCard );
+ readDirectory( path );
+}
+
+void TFileList::setState( ushort aState, Boolean enable )
+{
+ TSortedListBox::setState( aState, enable );
+ if ( aState == sfFocused && enable )
+ {
+ message( owner, evBroadcast, cmFileFocused, list()->at(focused) );
+ }
+}
+
+/******** struct DirSearchRec ********/
+#ifdef TVCompf_djgpp
+// DJGPP
+typedef struct TSearchRec DirSearchRec;
+
+struct __dj_DIR {
+ int num_read;
+ char *name;
+ int flags;
+ struct ffblk ff;
+ struct dirent de;
+};
+
+extern "C" size_t _file_time_stamp(unsigned);
+
+#else
+#if defined(TVOS_Win32) && !defined(TVComp_BCPP) && !defined(TVCompf_Cygwin)
+// MingW
+struct DirSearchRec : public TSearchRec
+{
+ void readFf_blk(_finddata_t &s)
+ {
+ attr = 0;
+ if (s.attrib & _A_ARCH)
+ attr = FA_ARCH;
+ if (s.attrib & _A_SUBDIR)
+ attr |= FA_DIREC;
+ strcpy(name, s.name);
+ size = s.size;
+ time = s.time_write;
+ }
+};
+
+#else
+// Linux, BC++/Win32 and CygWin
+struct DirSearchRec : public TSearchRec
+{
+ /* SS: changed */
+ void readFf_blk(const char *filename, struct stat &s)
+ {
+ attr = FA_ARCH;
+ if (S_ISDIR(s.st_mode)) attr |= FA_DIREC;
+ strcpy(name, filename);
+ size = s.st_size;
+ time = s.st_mtime;
+ }
+};
+#endif
+#endif
+/******** end of struct DirSearchRec ********/
+
+
+// SET: Helper routine to exclude some special files
+static
+int ExcludeSpecialName(const char *name)
+{
+ int len=strlen(name);
+ if ((TFileCollection::sortOptions & fcolHideEndTilde) && name[len-1]=='~')
+ return 1;
+ if ((TFileCollection::sortOptions & fcolHideEndBkp) && len>4 &&
+ strcasecmp(name+len-4,".bkp")==0)
+ return 1;
+ if ((TFileCollection::sortOptions & fcolHideStartDot) && name[0]=='.')
+ return 1;
+ return 0;
+}
+
+/******** void readDirectory( const char *aWildCard ) ********/
+#ifdef TVCompf_djgpp
+// DOS+DJGPP target
+// this is really faster than the glob methode
+void TFileList::readDirectory( const char *aWildCard )
+{
+ DIR *dir;
+ struct dirent *de;
+ DirSearchRec *p;
+ TFileCollection *fileList = new TFileCollection( 10, 10 );
+ AllocLocalStr(wildcard,strlen(aWildCard)+1);
+ strcpy(wildcard,aWildCard);
+ char *slash = strrchr(wildcard,DIRSEPARATOR);
+ char *path, pathAux[4];
+ // SET: Added code to remove .. in the root directory
+ int removeParent=0;
+
+ if (slash)
+ {
+ *slash = 0;
+ path = wildcard;
+ if (strlen(path) == 2 && path[1] == ':')
+ {
+ path = pathAux;
+ strcpy(path,wildcard);
+ strcat(path,"/");
+ }
+ slash++;
+ if (strlen(path) == 3 && path[1] == ':')
+ removeParent=1;
+ }
+ else
+ {
+ slash = wildcard;
+ path = ".";
+ char *cwd=getcwd(0,PATH_MAX);
+ if (cwd)
+ {
+ if (strlen(cwd)==3 && cwd[1] == ':')
+ removeParent=1;
+ free(cwd);
+ }
+ }
+ dir = opendir(path);
+ if (dir)
+ {
+ while ((de = readdir(dir)))
+ {
+ struct ffblk &ff = dir->ff;
+ char *name=de->d_name;
+ if (!(ff.ff_attrib & FA_DIREC) && fnmatch(slash,name,0)) continue;
+ if (strcmp(name,".")==0) continue;
+ if (removeParent && strcmp(name,"..")==0) continue;
+ // SET: Special exclusions:
+ if (ExcludeSpecialName(name)) continue;
+ p = new DirSearchRec;
+ strcpy(p->name,name);
+ p->attr = ff.ff_attrib;
+ p->size = ff.ff_fsize;
+ p->time = ((unsigned long)(ff.ff_fdate)) << 16 | (unsigned short)ff.ff_ftime;
+ p->time = _file_time_stamp(p->time);
+ fileList->insert(p);
+ }
+ closedir(dir);
+ }
+ newList(fileList);
+ if (list()->getCount() > 0)
+ message( owner, evBroadcast, cmFileFocused, list()->at(0) );
+ else
+ {
+ static DirSearchRec noFile;
+ message( owner, evBroadcast, cmFileFocused, &noFile );
+ }
+}
+
+#else
+#if defined(TVOS_Win32) && !defined(TVComp_BCPP) && !defined(TVCompf_Cygwin)
+// Win32+MingW
+void TFileList::readDirectory( const char *aWildCard )
+{
+ long dir;
+ _finddata_t de;
+ DirSearchRec *p;
+ TFileCollection *fileList = new TFileCollection( 10, 10 );
+ AllocLocalStr(wildcard,strlen(aWildCard)+1);
+ strcpy(wildcard,aWildCard);
+ char *slash = strrchr(wildcard,DIRSEPARATOR);
+ char *path, pathAux[4];
+ // SET: Added code to remove .. in the root directory
+ int removeParent=0;
+ char dirpath[PATH_MAX];
+
+ if (slash)
+ {
+ *slash = 0;
+ path = wildcard;
+ if (strlen(path) == 2 && path[1] == ':')
+ {
+ path = pathAux;
+ strcpy(path,wildcard);
+ strcat(path,DIRSEPARATOR_);
+ }
+ strcpy(dirpath,path);
+ strcat(dirpath,DIRSEPARATOR_"*");
+ if (strlen(path) == 3 && path[1] == ':')
+ removeParent=1;
+ *slash = DIRSEPARATOR;
+ }
+ else
+ {
+ slash = wildcard;
+ path = ".";
+ char *cwd=getcwd(0,PATH_MAX);
+ if (cwd)
+ {
+ if (strlen(cwd)==3 && cwd[1] == ':')
+ removeParent=1;
+ free(cwd);
+ }
+ strcpy(dirpath,path);
+ strcat(dirpath,DIRSEPARATOR_"*");
+ }
+ //find all directories
+ dir = _findfirst( dirpath, &de ) ;
+ if (dir!=-1)
+ {
+ do
+ {
+ if (!(de.attrib & _A_SUBDIR)) continue;
+ if (strcmp(de.name,".")==0) continue;
+ if (removeParent && strcmp(de.name,"..")==0) continue;
+ // SET: Special exclusions:
+ if (ExcludeSpecialName(de.name)) continue;
+ p = new DirSearchRec;
+ p->readFf_blk( de );
+ fileList->insert(p);
+ }
+ while (_findnext(dir,&de)==0);
+ _findclose(dir);
+ }
+
+ //find all files
+ dir = _findfirst( wildcard, &de ) ;
+ if (dir!=-1)
+ {
+ do
+ {
+ if (de.attrib & _A_SUBDIR) continue;
+ // SET: Special exclusions:
+ if (ExcludeSpecialName(de.name)) continue;
+ p = new DirSearchRec;
+ p->readFf_blk( de );
+ fileList->insert(p);
+ }
+ while (_findnext(dir,&de)==0);
+ _findclose(dir);
+ }
+
+ newList(fileList);
+ if (list()->getCount() > 0)
+ message( owner, evBroadcast, cmFileFocused, list()->at(0) );
+ else
+ {
+ static DirSearchRec noFile;
+ message( owner, evBroadcast, cmFileFocused, &noFile );
+ }
+}
+#else
+
+#if defined(TVOSf_QNX4)
+void TFileList::readDirectory( const char *aWildCard )
+{
+ DIR *dp;
+ DirSearchRec *p;
+ char dir[PATH_MAX];
+ char file[PATH_MAX];
+ char path[PATH_MAX];
+ dirent *de;
+ struct stat s;
+
+ strcpy( path, aWildCard );
+ if (!CLY_IsWild(path))
+ strcat(path, "*");
+ CLY_fexpand( path );
+ CLY_ExpandPath(path, dir, file);
+ TFileCollection *fileList = new TFileCollection( 5, 5 );
+
+ /* read regular archive files */
+
+ sprintf(path, "%s.", dir);
+ if ((dp = opendir(path)) != NULL)
+ {
+ while ((de = readdir(dp)) != NULL)
+ {
+ /* is it a regular file (not a directory) ? */
+ sprintf(path, "%s%s", dir, de->d_name);
+ if (stat(path, &s) == 0 && S_ISREG(s.st_mode))
+ {
+ if (ExcludeSpecialName(de->d_name))
+ continue;
+ if (fnmatch(file, de->d_name, 0)==0)
+ {
+ if ((p = new DirSearchRec) == NULL)
+ break;
+ p->readFf_blk(de->d_name, s);
+ fileList->insert( p );
+ }
+ }
+ }
+ closedir(dp);
+ }
+
+ /* read directories */
+
+ sprintf(path, "%s.", dir);
+ if ((dp = opendir(path)) != NULL)
+ {
+ while ((de = readdir(dp)) != NULL)
+ {
+ /* we don't want these directories */
+
+ if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0)
+ continue;
+
+ /* is it a directory ? */
+ sprintf(path, "%s%s", dir, de->d_name);
+ if (stat(path, &s) == 0 && S_ISDIR(s.st_mode))
+ {
+ if ((p = new DirSearchRec) == NULL)
+ break;
+ p->readFf_blk(de->d_name, s);
+ fileList->insert( p );
+ }
+ }
+ closedir(dp);
+ }
+
+ if( strlen( dir ) > 1 )
+ {
+ p = new DirSearchRec;
+ if( p != 0 )
+ {
+ sprintf(path, "%s..", dir);
+ if (stat(path, &s) == 0)
+ p->readFf_blk("..", s);
+ else
+ {
+ strcpy( p->name, ".." );
+ p->size = 0;
+ p->time = 0x210000uL;
+ p->attr = FA_DIREC;
+ }
+ fileList->insert( p );
+ }
+ }
+
+ newList(fileList);
+
+ if( list()->getCount() > 0 )
+ message( owner, evBroadcast, cmFileFocused, list()->at(0) );
+ else
+ {
+ static DirSearchRec noFile;
+ message( owner, evBroadcast, cmFileFocused, &noFile );
+ }
+}
+
+#else
+
+// Linux, BC++/Win32 and CygWin
+void TFileList::readDirectory( const char *aWildCard )
+{
+ /* SS: changed */
+
+ DIR *dp;
+ DirSearchRec *p;
+ char dir[PATH_MAX];
+ char file[PATH_MAX];
+ char path[PATH_MAX];
+ char *np;
+ dirent *de;
+ glob_t gl;
+ struct stat s;
+
+ strcpy( path, aWildCard );
+ if (!CLY_IsWild(path)) strcat(path, "*");
+ CLY_fexpand( path );
+ CLY_ExpandPath(path, dir, file);
+ TFileCollection *fileList = new TFileCollection( 10, 10 );
+
+ /* find all filenames that match our wildcards */
+
+ /*
+ * The use of 'glob' function was proposed by:
+ * Rainer Keuchel <r_keuchel@smaug.netwave.de>
+ * Date: 18 Jan 1997 22:52:12 +0000
+ */
+ #ifdef TVOSf_Linux
+ # define __gl_options GLOB_PERIOD
+ #else
+ # define __gl_options 0
+ #endif
+ if (glob(path, __gl_options, NULL, &gl) == 0)
+ {
+ for (int i = 0; i < (int)gl.gl_pathc; i++)
+ {
+ /* is this a regular file ? */
+ if (stat(gl.gl_pathv[i], &s) == 0 && S_ISREG(s.st_mode))
+ {
+ /* strip directory part */
+ if ((np = strrchr(gl.gl_pathv[i], '/')) != NULL)
+ np++;
+ else
+ np = gl.gl_pathv[i];
+ // SET: Special exclusions:
+ if (ExcludeSpecialName(np)) continue;
+ p = new DirSearchRec;
+ p->readFf_blk(np, s);
+ fileList->insert( p );
+ }
+ }
+ globfree(&gl);
+ }
+ /* now read all directory names */
+
+ sprintf(path, "%s.", dir);
+ if ((dp = opendir(path)) != NULL)
+ {
+ while ((de = readdir(dp)) != NULL)
+ {
+ /* we don't want these directories */
+ if (strcmp(de->d_name, ".") == 0 ||
+ strcmp(de->d_name, "..") == 0) continue;
+ /* is it a directory ? */
+ sprintf(path, "%s%s", dir, de->d_name);
+ if (stat(path, &s) == 0 && S_ISDIR(s.st_mode) &&
+ // SET: Special exclusions:
+ !ExcludeSpecialName(de->d_name))
+ {
+ p = new DirSearchRec;
+ p->readFf_blk(de->d_name, s);
+ fileList->insert( p );
+ }
+ }
+ closedir(dp);
+ }
+
+ if ( strlen( dir ) > 1 )
+ {
+ p = new DirSearchRec;
+ if (p)
+ {
+ sprintf(path, "%s..", dir);
+ if (stat(path, &s)==0)
+ p->readFf_blk("..", s);
+ else
+ {
+ strcpy( p->name, ".." );
+ p->size = 0;
+ p->time = 0x210000uL;
+ p->attr = FA_DIREC;
+ }
+ fileList->insert( p );
+ }
+ }
+ #if 0 // I think this will never hapen (new doesn't return 0)
+ if ( p == 0 )
+ messageBox( tooManyFiles, mfOKButton | mfWarning );
+ #endif
+ newList(fileList);
+ if ( list()->getCount() > 0 )
+ message( owner, evBroadcast, cmFileFocused, list()->at(0) );
+ else
+ {
+ static DirSearchRec noFile;
+ message( owner, evBroadcast, cmFileFocused, &noFile );
+ }
+}
+#endif // TVOSf_QNX4
+#endif // Linux, BC++/Win32 and CygWin
+#endif // !DOS+DJGPP
+/******** end of void readDirectory ********/
+
+#if !defined( NO_STREAM )
+TStreamable *TFileList::build()
+{
+ return new TFileList( streamableInit );
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tfilterv.cc b/tvision/classes/tfilterv.cc
new file mode 100644
index 0000000..68b746a
--- /dev/null
+++ b/tvision/classes/tfilterv.cc
@@ -0,0 +1,85 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea (to be compatible with TV 2.0)
+
+ *
+ *
+ */
+#define Uses_string
+#define Uses_limits
+#define Uses_stdio
+#define Uses_ipstream
+#define Uses_opstream
+#define Uses_TFilterValidator
+#define Uses_MsgBox
+#include <tv.h>
+
+TFilterValidator::TFilterValidator() :
+ TValidator(),
+ validChars(NULL)
+{
+}
+
+TFilterValidator::TFilterValidator(const char * chars) :
+ TValidator()
+{
+ validChars = newStr(chars);
+}
+
+TFilterValidator::~TFilterValidator()
+{
+ delete[] validChars;
+}
+
+Boolean TFilterValidator::isValid(const char *S)
+{
+ int i=0;
+ while (S[i])
+ {
+ if (!strchr(validChars,S[i])) return False;
+ i++;
+ }
+ return True;
+}
+
+Boolean TFilterValidator::isValidInput(char *S,Boolean)
+{
+ return TFilterValidator::isValid(S);
+}
+
+void TFilterValidator::error()
+{
+ messageBox(__("Invalid character in input"),mfError | mfOKButton);
+}
+
+#if !defined( NO_STREAM )
+TFilterValidator::TFilterValidator(StreamableInit) :
+ TValidator(streamableInit)
+{
+}
+
+TStreamable * TFilterValidator::build()
+{
+ return (TStreamable *) new TFilterValidator(streamableInit);
+}
+
+void TFilterValidator::write(opstream & os)
+{
+ TValidator::write(os);
+ os.writeString(validChars);
+}
+
+void * TFilterValidator::read(ipstream & is)
+{
+ TValidator::read(is);
+ validChars = is.readString();
+ return this;
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tframe.cc b/tvision/classes/tframe.cc
new file mode 100644
index 0000000..a141088
--- /dev/null
+++ b/tvision/classes/tframe.cc
@@ -0,0 +1,386 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea
+
+ *
+ *
+ */
+#define Uses_string
+#define Uses_stdlib
+#define Uses_stdio
+
+#define Uses_TFrame
+#define Uses_TDrawBuffer
+#define Uses_TWindow
+#define Uses_TRect
+#define Uses_TPoint
+#define Uses_TEvent
+#define Uses_TStreamableClass
+#define Uses_TPalette
+#include <tv.h>
+
+#define cpFrame "\x01\x01\x02\x02\x03"
+
+// SET: Used to disable icon animation
+Boolean TFrame::doAnimation = True;
+
+TFrame::TFrame( const TRect& bounds ) : TView( bounds )
+{
+ growMode = gfGrowHiX + gfGrowHiY;
+ eventMask |= evBroadcast | evMouseUp;
+}
+
+void TFrame::draw()
+{
+ ushort cFrame, cTitle;
+ short f, i, l, width;
+ TDrawBuffer b;
+
+ if( (state & sfActive) == 0 )
+ {
+ cFrame = 0x0101;
+ cTitle = 0x0002;
+ f = 0;
+ }
+ else
+ if( (state & sfDragging) != 0 )
+ {
+ cFrame = 0x0505;
+ cTitle = 0x0005;
+ f = 0;
+ }
+ else
+ {
+ cFrame = 0x0503;
+ cTitle = 0x0004;
+ f = 9;
+ }
+
+ cFrame = getColor(cFrame);
+ cTitle = getColor(cTitle);
+
+ width = size.x;
+ l = width - 10;
+
+ if( ( ((TWindow *)owner)->flags & (wfClose | wfZoom) ) != 0 )
+ l -= 6;
+ frameLine( b, 0, f, uchar(cFrame) );
+ if( ((TWindow *)owner)->number != wnNoNumber )
+ {
+ l -= 4;
+ if( ( ((TWindow *)owner)->flags & wfZoom ) != 0 )
+ i = 7;
+ else
+ i = 3;
+ int number = ((TWindow *)owner)->number;
+ if (number > 10) i++;
+ if (number > 100) i++;
+ if (number > 1000) i++;
+ char Number[10];
+ sprintf(Number,"%d",number);
+ int j=0;
+ while (Number[j])
+ {
+ b.putChar( width-i+j, Number[j]);
+ j++;
+ }
+ }
+
+ if( owner != 0 )
+ {
+ const char *title = ((TWindow *)owner)->getTitle(l);
+ if( title != 0 )
+ {
+ int ls;
+ l = max(width-10,0);
+ ls = strlen(title);
+ if (ls>l)
+ {
+ i = (width - l) >> 1;
+ b.moveBuf( i-1, " ..", cTitle, 3 );
+ b.moveBuf( i+2, &title[ls-l+2], cTitle, l );
+ b.putChar( i+l, ' ' );
+ b.putChar( i+l+1, ' ' );
+ }
+ else
+ {
+ l=ls;
+ i = (width - l) >> 1;
+ b.putChar( i-1, ' ' );
+ b.moveBuf( i, title, cTitle, l );
+ b.putChar( i+l, ' ' );
+ }
+ }
+ }
+
+ if( (state & sfActive) != 0 )
+ {
+ if( ( ((TWindow *)owner)->flags & wfClose ) != 0 )
+ b.moveCStr( 2, closeIcon, cFrame );
+ if( ( ((TWindow *)owner)->flags & wfZoom ) != 0 )
+ {
+ TPoint minSize, maxSize;
+ owner->sizeLimits( minSize, maxSize );
+ if( owner->size == maxSize )
+ b.moveCStr( width-5, unZoomIcon, cFrame );
+ else
+ b.moveCStr( width-5, zoomIcon, cFrame );
+ }
+ }
+
+ writeLine( 0, 0, size.x, 1, b );
+ for( i = 1; i <= size.y - 2; i++ )
+ {
+ frameLine( b, i, f + 3, cFrame );
+ writeLine( 0, i, size.x, 1, b );
+ }
+ frameLine( b, size.y - 1, f + 6, cFrame );
+ if( (state & sfActive) != 0 )
+ if( ( ((TWindow *)owner)->flags & wfGrow ) != 0 )
+ b.moveCStr( width-2, dragIcon, cFrame );
+ writeLine( 0, size.y - 1, size.x, 1, b );
+}
+
+TPalette& TFrame::getPalette() const
+{
+ static TPalette palette( cpFrame, sizeof( cpFrame )-1 );
+ return palette;
+}
+
+void TFrame::dragWindow( TEvent& event, uchar mode )
+{
+ TRect limits;
+ TPoint min, max;
+
+ limits = owner->owner->getExtent();
+ owner->sizeLimits( min, max );
+ owner->dragView( event, owner->dragMode | mode, limits, min, max );
+ clearEvent( event );
+}
+
+const int ciClose=0, ciZoom=1;
+
+void TFrame::drawIcon( int bNormal, const int ciType )
+{
+ ushort cFrame;
+
+ if( (state & sfActive) == 0 )
+ cFrame = 0x0101;
+ else
+ if( (state & sfDragging) != 0 )
+ cFrame = 0x0505;
+ else
+ cFrame = 0x0503;
+
+ cFrame = getColor(cFrame);
+
+ switch( ciType )
+ {
+ // Close icon
+ case ciClose:
+ {
+ TDrawBuffer drawBuf;
+ drawBuf.moveCStr( 0, bNormal ? closeIcon : animIcon, cFrame );
+ writeLine( 2, 0, 3, 1, drawBuf );
+ }
+ break;
+ // Zoom icon
+ //case ciZoom:
+ default:
+ {
+ TPoint minSize, maxSize;
+ owner->sizeLimits( minSize, maxSize );
+
+ TDrawBuffer drawBuf;
+ drawBuf.moveCStr( 0, bNormal ? ( (owner->size == maxSize) ? unZoomIcon : zoomIcon ) : animIcon, cFrame );
+ writeLine( size.x - 5, 0, 3, 1, drawBuf );
+ }
+ break;
+ }
+}
+
+// SET: Some helpers to make the code easier to understand
+#define mouseOverClose() ( mouse.y == 0 && mouse.x >= 2 && mouse.x <= 4 )
+#define mouseOverZoom() ( mouse.y == 0 && ( mouse.x >= size.x - 5 ) && \
+ ( mouse.x <= size.x - 3 ) )
+#define mouseOverGrow() ( ( mouse.x >= size.x - 2 ) && ( mouse.y >= size.y - 1 ) )
+#define ownerFlags() ( ((TWindow *)owner)->flags )
+
+
+void TFrame::handleEvent( TEvent& event )
+{
+ TView::handleEvent(event);
+ // This version incorporates Eddie changes to "animate" the close and zoom icons.
+ if( (event.what & (evMouseDown | evMouseUp)) && (state & sfActive) )
+ {
+ TPoint mouse = makeLocal( event.mouse.where );
+ if( mouse.y == 0 )
+ { // Close icon
+ if( ( ownerFlags() & wfClose ) && mouseOverClose() )
+ {
+ if( doAnimation )
+ { // Animated version, capture the focus until the button is released
+ do
+ {
+ mouse = makeLocal( event.mouse.where );
+ drawIcon( !mouseOverClose(), ciClose );
+ } while( mouseEvent( event, evMouseMove ) );
+
+ if( event.what == evMouseUp && mouseOverClose() )
+ {
+ putEvent( evCommand, cmClose, owner );
+ clearEvent( event );
+ drawIcon( 1, ciClose );
+ }
+ }
+ else
+ { // Not animated
+ if( event.what == evMouseUp )
+ putEvent( evCommand, cmClose, owner );
+ clearEvent( event );
+ }
+ }
+ else
+ { // Double click on the upper line or zoom icon
+ if ( event.mouse.doubleClick ||
+ ( ( ownerFlags() & wfZoom ) && mouseOverZoom() ) )
+ {
+ if ( event.mouse.doubleClick )
+ {
+ putEvent( evCommand, cmZoom, owner );
+ clearEvent( event );
+ }
+ else
+ {
+ if( doAnimation )
+ { // Animated version, capture the focus until the button is released
+ do
+ {
+ mouse = makeLocal( event.mouse.where );
+ drawIcon( !mouseOverZoom(), ciZoom );
+
+ } while( mouseEvent( event, evMouseMove ) );
+
+ if( ( event.what == evMouseUp ) && mouseOverZoom() )
+ {
+ putEvent( evCommand, cmZoom, owner );
+ clearEvent( event );
+ drawIcon( 1, ciZoom );
+ }
+ }
+ else
+ { // Not animated
+ if( event.what == evMouseUp )
+ putEvent( evCommand, cmZoom, owner );
+ clearEvent( event );
+ }
+ }
+ }
+ else
+ // Click on the upper line (move)
+ if( (ownerFlags() & wfMove) && (event.what & evMouseDown) )
+ dragWindow( event, dmDragMove );
+ }
+ }
+ else
+ if( (event.what & evMouseDown) && mouseOverGrow() )
+ { // Click on the grow corner
+ if( ownerFlags() & wfGrow )
+ dragWindow( event, dmDragGrow );
+ }
+ }
+}
+
+void TFrame::setState( ushort aState, Boolean enable )
+{
+ TView::setState( aState, enable );
+ if( (aState & (sfActive | sfDragging)) != 0 )
+ drawView();
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TFrame::build()
+{
+ return new TFrame( streamableInit );
+}
+
+TFrame::TFrame( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+unsigned char FrameMask[maxViewWidth];
+
+void TFrame::frameLine( TDrawBuffer& frameBuf, short y, short n, uchar color )
+{
+ ushort si,ax,cx,dx,di;
+ int i=1;
+ TView *view;
+ cx = dx = size.x;
+ cx -= 2;
+ FrameMask[0] = initFrame[n];
+ while (cx--) FrameMask[i++] = initFrame[n+1];
+ FrameMask[i] = initFrame[n+2];
+ view = owner->last;
+ dx--;
+lab1:
+ view = view->next;
+ if (view == this) goto lab10;
+ if (!(view->options & ofFramed)) goto lab1;
+ if (!(view->state & sfVisible)) goto lab1;
+ ax = y - view->origin.y;
+ if ((short)(ax)<0) goto lab3;
+ if (ax>view->size.y) goto lab1;
+ if (ax<view->size.y) ax = 5;
+ else ax = 0x0a03;
+ goto lab4;
+lab3:
+ ax++;
+ if (ax) goto lab1;
+ ax = 0x0a06;
+lab4:
+ si = view->origin.x;
+ di = si + view->size.x;
+ if (si>1) goto lab5;
+ si = 1;
+lab5:
+ if (di<dx) goto lab6;
+ di = dx;
+lab6:
+ if (si>=di) goto lab1;
+ FrameMask[si-1] |= (ax & 0x00ff);
+ ax ^= (((ax & 0xff00) >> 8) & 0x00ff);
+ FrameMask[di] |= (ax & 0x00ff);
+ if (!(ax & 0xff00)) goto lab1;
+ cx = di-si;
+ while (cx--) FrameMask[si++] |= (((ax & 0xff00) >> 8) & 0x00ff);
+ goto lab1;
+lab10:
+ dx++;
+ {
+ uchar * framechars = (uchar *)malloc(dx);
+ for (i=0;i<dx;i++)
+ framechars[i] = (uchar)frameChars[(unsigned) FrameMask[i]];
+ frameBuf.moveBuf(0,framechars,color,dx);
+ free(framechars);
+ }
+#if 0
+ ax = color << 8;
+ cx = dx;
+ si = 0;
+ i = 0;
+ while (cx--)
+ {
+ ((ushort *)(frameBuf.data))[i] = ((uchar)frameChars[FrameMask[i]]) | (ax & 0xff00);
+ i++;
+ }
+#endif
+}
+
+
diff --git a/tvision/classes/tgkey.cc b/tvision/classes/tgkey.cc
new file mode 100644
index 0000000..76c8458
--- /dev/null
+++ b/tvision/classes/tgkey.cc
@@ -0,0 +1,366 @@
+/**[txh]********************************************************************
+
+ Keyboard module, Copyright 2001-2002 by Salvador E. Tropea
+ Description:
+ This is the base class for keyboard input.
+ Most members are pointers to functions defined by each platform dependent
+driver. Default members are provided.
+ This is a complete new file created from concepts that José Angel Sanchez
+Caso provide me and coded from scratch. Original Turbo Vision didn't even
+have such a class.
+
+***************************************************************************/
+
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_TVCodePage
+#define Uses_FullSingleKeySymbols
+#define Uses_ctype
+#define Uses_string
+#define Uses_stdlib
+#include <tv.h>
+
+/*****************************************************************************
+ Data members initialization
+*****************************************************************************/
+
+char TGKey::suspended=1;
+ushort TGKey::AltSet=0; // Default: Left and right key are different ones
+int TGKey::Mode=0;
+const char *TGKey::KeyNames[]=
+{
+"Unknown",
+"A","B","C","D","E","F","G","H","I","J","K",
+"L","M","N","O","P","Q","R","S","T","U","V",
+"W","X","Y","Z",
+"OpenBrace","BackSlash","CloseBrace","Pause","Esc",
+"0","1","2","3","4","5","6","7","8","9",
+"BackSpace","Tab","Enter","Colon","Quote","Grave",
+"Comma","Stop","Slash","Asterisk","Space","Minus",
+"Plus","PrnScr","Equal","F1","F2","F3","F4","F5",
+"F6","F7","F8","F9","F10","F11","F12","Home",
+"Up","PgUp","Left","Right","End","Down","PgDn",
+"Insert","Delete","Caret","Admid","DobleQuote",
+"Numeral","Dolar","Percent","Amper","OpenPar",
+"ClosePar","DoubleDot","LessThan","GreaterThan",
+"Question","A_Roba","Or","UnderLine","OpenCurly",
+"CloseCurly","Tilde","Macro","WinLeft","WinRight","WinSel",
+"Mouse"
+};
+
+#define NumKeyNames (sizeof(TGKey::KeyNames)/sizeof(char *))
+
+/*****************************************************************************
+ Function pointer members initialization
+*****************************************************************************/
+
+int (*TGKey::kbhit)(void) =defaultKbhit;
+void (*TGKey::clear)(void) =defaultClear;
+ushort (*TGKey::gkey)() =defaultGkey;
+unsigned (*TGKey::getShiftState)() =defaultGetShiftState;
+void (*TGKey::fillTEvent)(TEvent &e) =defaultFillTEvent;
+uchar (*TGKey::NonASCII2ASCII)(uchar val) =defaultNonASCII2ASCII;
+int (*TGKey::CompareASCII)(uchar val, uchar code)=defaultCompareASCII;
+void (*TGKey::SetKbdMapping)(int version) =defaultSetKbdMapping;
+int (*TGKey::GetKbdMapping)(int version) =defaultGetKbdMapping;
+void (*TGKey::Suspend)() =defaultSuspend;
+void (*TGKey::Resume)() =defaultResume;
+int (*TGKey::SetCodePage)(int id) =defaultSetCodePage;
+int (*TGKey::AltInternat2ASCII)(TEvent &event) =defaultAltInternat2ASCII;
+
+
+/*****************************************************************************
+ Default behaviors for the members
+*****************************************************************************/
+
+int TGKey::defaultKbhit() { return 0; }
+unsigned TGKey::defaultGetShiftState() { return 0; }
+ushort TGKey::defaultGkey() { return 0; }
+void TGKey::defaultClear() {}
+void TGKey::defaultSuspend() {}
+void TGKey::defaultResume() {}
+uchar TGKey::defaultNonASCII2ASCII(uchar val) { return val; }
+int TGKey::defaultCompareASCII(uchar val, uchar code) { return val==code; }
+void TGKey::defaultSetKbdMapping(int version) { Mode=version; }
+int TGKey::defaultGetKbdMapping(int /*version*/) { return Mode; }
+void TGKey::defaultFillTEvent(TEvent &/*e*/) {};
+
+/*****************************************************************************
+ Real members
+*****************************************************************************/
+
+void TGKey::suspend()
+{
+ if (suspended) return;
+ suspended=1;
+ Suspend();
+}
+
+void TGKey::resume()
+{
+ if (!suspended) return;
+ suspended=0;
+ Resume();
+}
+
+const char *TGKey::NumberToKeyName(unsigned val)
+{
+ if (val<NumKeyNames)
+ return KeyNames[val];
+ return KeyNames[0];
+}
+
+const int CantDef=0x39;
+static const char altCodes[CantDef+1]=
+"\0ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]\0\0""0123456789\0\t\0;'`,./*\xf0-+\0=";
+
+char TGKey::GetAltChar(ushort keyCode, uchar ascii)
+{
+ // Only when ALT is present
+ if ((keyCode & kbAltLCode)==0)
+ return 0;
+ keyCode&=kbKeyMask;
+ // If the key is unknown but have an ASCII associated use it!
+ if (keyCode==kbUnkNown && ascii)
+ return NonASCII2ASCII(ascii);
+ if (keyCode>CantDef-1)
+ return 0;
+ return altCodes[keyCode];
+}
+
+ushort TGKey::GetAltCode(uchar c)
+{
+ int i;
+ c=NonASCII2ASCII(c);
+ c=uctoupper(c);
+
+ for (i=0; i<CantDef; i++)
+ if (altCodes[i]==c)
+ return i | kbAltLCode; // Report the left one
+ return 0;
+}
+
+ushort TGKey::KeyNameToNumber(char *s)
+{
+ unsigned i;
+ for (i=0; i<NumKeyNames; i++)
+ if (strcmp(KeyNames[i],s)==0)
+ return i;
+ return (ushort)-1;
+}
+
+/*****************************************************************************
+ Here are some generic translation routines for known keyboards/code pages.
+ They are shared by various drivers.
+*****************************************************************************/
+
+/* This table maps the Unicode for greek letters with the latin letter for
+ the key that generates it. Example: alpha (with any accent) is generated
+ pressing the key with the latin A letter.
+
+This note is what I wrote for the old DOS code
+ Greek keyboards: That's for code page 737. This
+keyboards have two modes. One mode makes them work just
+as an US keyboard, pressing LShift+Alt enters in the
+greek mode. In this mode a-z and A-Z generates greek
+letters. They are reported without any scan code.
+Additionally ;/: key is an accent key (q/Q holds ;/:).
+*/
+stIntCodePairs TGKey::GreekKeyboard[]=
+{
+// With tonos
+{ 0x0386,'A' },/* 0x0387 */{ 0x0388,'E' },{ 0x0389,'H' },{ 0x038A,'I' },
+ /* 0x038B */{ 0x038C,'O' },/* 0x038D */{ 0x038E,'Y' },{ 0x038F,'V' },
+// Dialytica and tonos
+{ 0x0390,'i' },
+// Capitals
+{ 0x0391,'A' },{ 0x0392,'B' },{ 0x0393,'G' },{ 0x0394,'D' },{ 0x0395,'E' },
+{ 0x0396,'Z' },{ 0x0397,'H' },{ 0x0398,'U' },{ 0x0399,'I' },{ 0x039A,'K' },
+{ 0x039B,'L' },{ 0x039C,'M' },{ 0x039D,'N' },{ 0x039E,'J' },{ 0x039F,'O' },
+{ 0x03A0,'P' },{ 0x03A1,'R' },{ 0x03A3,'S' },{ 0x03A4,'T' },{ 0x03A5,'Y' },
+{ 0x03A6,'F' },{ 0x03A7,'X' },{ 0x03A8,'C' },{ 0x03A9,'V' },
+// With dialytica
+{ 0x03AA,'I' },{ 0x03AB,'Y' },
+// With tonos
+{ 0x03AC,'a' },{ 0x03AD,'e' },{ 0x03AE,'h' },{ 0x03AF,'i' },
+// Dialytica and tonos
+{ 0x03B0,'y' },
+// Smalls
+{ 0x03B1,'a' },{ 0x03B2,'b' },{ 0x03B3,'g' },{ 0x03B4,'d' },{ 0x03B5,'e' },
+{ 0x03B6,'z' },{ 0x03B7,'h' },{ 0x03B8,'u' },{ 0x03B9,'i' },{ 0x03BA,'k' },
+{ 0x03BB,'l' },{ 0x03BC,'m' },{ 0x03BD,'n' },{ 0x03BE,'j' },{ 0x03BF,'o' },
+{ 0x03C0,'p' },{ 0x03C1,'r' },{ 0x03C3,'s' },{ 0x03C4,'t' },{ 0x03C5,'y' },
+{ 0x03C6,'f' },{ 0x03C7,'x' },{ 0x03C8,'c' },{ 0x03C9,'v' },
+// With dialytica
+{ 0x03CA,'i' },{ 0x03CB,'y' },
+// With tonos
+{ 0x03CC,'o' },{ 0x03CD,'y' },{ 0x03CE,'v' }
+};
+
+// Same for russian keyboards
+stIntCodePairs TGKey::RussianKeyboard[]=
+{
+{ 0x0410,'F' },{ 0x0411,'<' },{ 0x0412,'D' },{ 0x0413,'U' },{ 0x0414,'l' },
+{ 0x0415,'T' },{ 0x0416,':' },{ 0x0417,'P' },{ 0x0418,'B' },{ 0x0419,'Q' },
+{ 0x041a,'R' },{ 0x041b,'k' },{ 0x041c,'V' },{ 0x041d,'Y' },{ 0x041e,'J' },
+{ 0x041f,'G' },{ 0x0420,'H' },{ 0x0421,'C' },{ 0x0422,'N' },{ 0x0423,'E' },
+{ 0x0424,'A' },{ 0x0425,'{' },{ 0x0426,'W' },{ 0x0427,'X' },{ 0x0428,'I' },
+{ 0x0429,'O' },{ 0x042a,']' },{ 0x042b,'S' },{ 0x042c,'M' },{ 0x042d,'"' },
+{ 0x042e,'>' },{ 0x042f,'Z' },{ 0x0430,'f' },{ 0x0431,',' },{ 0x0432,'d' },
+{ 0x0433,'u' },{ 0x0434,'L' },{ 0x0435,'t' },{ 0x0436,';' },{ 0x0437,'p' },
+{ 0x0438,'b' },{ 0x0439,'q' },{ 0x043a,'r' },{ 0x043b,'K' },{ 0x043c,'v' },
+{ 0x043d,'y' },{ 0x043e,'j' },{ 0x043f,'g' },{ 0x0440,'h' },{ 0x0441,'c' },
+{ 0x0442,'n' },{ 0x0443,'e' },{ 0x0444,'a' },{ 0x0445,'[' },{ 0x0446,'w' },
+{ 0x0447,'x' },{ 0x0448,'i' },{ 0x0449,'o' },{ 0x044a,'}' },{ 0x044b,'s' },
+{ 0x044c,'m' },{ 0x044d,'\'' },{ 0x044e,'.' },{ 0x044f,'z' }
+};
+
+
+int TGKey::defaultSetCodePage(int id)
+{
+ switch (id)
+ {
+ case TVCodePage::PC855:
+ case TVCodePage::PC866:
+ case TVCodePage::ISORussian:
+ case TVCodePage::KOI8r:
+ case TVCodePage::KOI8_CRL_NMSU:
+ case TVCodePage::CP1251:
+ case TVCodePage::MacCyr:
+ case TVCodePage::MacOSUkrainian:
+ // Not sure about the rest of russian code pages.
+ FillKeyMapForCP(id,RussianKeyboard,sizeof(RussianKeyboard)/sizeof(stIntCodePairs));
+ NonASCII2ASCII=Generic_NonASCII2ASCII;
+ CompareASCII=Generic_CompareASCII;
+ AltInternat2ASCII=Generic_AltInternat2ASCII;
+ break;
+ case TVCodePage::PC737:
+ case TVCodePage::PC869:
+ case TVCodePage::CP1253:
+ case TVCodePage::ISOGreek:
+ FillKeyMapForCP(id,GreekKeyboard,sizeof(GreekKeyboard)/sizeof(stIntCodePairs));
+ NonASCII2ASCII=Generic_NonASCII2ASCII;
+ CompareASCII=Generic_CompareASCII;
+ AltInternat2ASCII=Generic_AltInternat2ASCII;
+ break;
+ default:
+ NonASCII2ASCII=defaultNonASCII2ASCII;
+ CompareASCII=defaultCompareASCII;
+ AltInternat2ASCII=defaultAltInternat2ASCII;
+ return 0;
+ }
+ return 1;
+}
+
+uchar TGKey::KeyMap[128];
+
+static
+int compare(const void *v1, const void *v2)
+{
+ stIntCodePairs *p1=(stIntCodePairs *)v1;
+ stIntCodePairs *p2=(stIntCodePairs *)v2;
+ return (p1->unicode>p2->unicode)-(p1->unicode<p2->unicode);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fills the KeyMap table using the provided keyboard layout.
+
+***************************************************************************/
+
+void TGKey::FillKeyMapForCP(int id, stIntCodePairs *keyboard, size_t szKb)
+{
+ stIntCodePairs cp[256];
+ TVCodePage::GetUnicodesForCP(id,cp);
+ ushort *tr=TVCodePage::GetTranslate(id);
+ int i;
+ stIntCodePairs s;
+ for (i=128; i<256; i++)
+ {
+ s.unicode=TVCodePage::UnicodeForInternalCode(tr[i]);
+ void *res=bsearch(&s,keyboard,szKb,sizeof(stIntCodePairs),compare);
+ KeyMap[i-128]=res ? ((stIntCodePairs *)res)->code : i;
+ }
+}
+
+uchar TGKey::Generic_NonASCII2ASCII(uchar ascii)
+{
+ return ascii>=0x80 ? KeyMap[ascii-0x80] : ascii;
+}
+
+int TGKey::Generic_CompareASCII(uchar val, uchar code)
+{
+ if (val >=0x80) val =KeyMap[val- 0x80];
+ if (code>=0x80) code=KeyMap[code-0x80];
+ return val==code;
+}
+
+int TGKey::defaultAltInternat2ASCII(TEvent &)
+{
+ return 0;
+}
+
+#if 0
+#define SP1 kbBackSpace
+#define SP2 kbTab
+#define SP3 kbEnter
+#define SP4 kbEnter
+#define SP5 kbEsc
+#else
+#define SP1 0x80 | kbH
+#define SP2 0x80 | kbI
+#define SP3 0x80 | kbJ
+#define SP4 0x80 | kbM
+#define SP5 0x80 | kbOpenBrace
+#endif
+
+const uchar TGKey::kbByASCII[128]=
+{
+ 0,kbA,kbB,kbC,kbD,kbE,kbF,kbG,
+ SP1,SP2,SP3,kbK,kbL,SP4,kbN,kbO,
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW,
+ kbX,kbY,kbZ,SP5,kbBackSlash,kbCloseBrace,kb6,kbMinus,
+ kbSpace,kbAdmid,kbDobleQuote,kbNumeral,kbDolar,kbPercent,kbAmper,kbQuote,
+ kbOpenPar,kbClosePar,kbAsterisk,kbPlus,kbComma,kbMinus,kbStop,kbSlash,
+ kb0,kb1,kb2,kb3,kb4,kb5,kb6,kb7,
+ kb8,kb9,kbDoubleDot,kbColon,kbLessThan,kbEqual,kbGreaterThan,kbQuestion,
+ kbA_Roba,kbA,kbB,kbC,kbD,kbE,kbF,kbG,
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO,
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW,
+ kbX,kbY,kbZ,kbOpenBrace,kbBackSlash,kbCloseBrace,kbCaret,kbUnderLine,
+ kbGrave,kbA,kbB,kbC,kbD,kbE,kbF,kbG,
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO,
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW,
+ kbX,kbY,kbZ,kbOpenCurly,kbOr,kbCloseCurly,kbTilde,kbBackSpace
+};
+
+/**[txh]********************************************************************
+
+ Description:
+ When using a "non-ASCII" keyboard the application gets Alt+Non-ASCII. This
+routine tries to figure out which key was used and changes the event to
+be Alt+ASCII. Example: A greek keyboard can generate Alt+Alfa, in this case
+the routine will convert it into Alt+A (because Alfa is in the key that A
+is located).
+
+ Return: !=0 if the event was altered.
+
+***************************************************************************/
+
+int TGKey::Generic_AltInternat2ASCII(TEvent &e)
+{
+ if (e.what==evKeyDown &&
+ e.keyDown.charScan.charCode>=0x80 &&
+ (e.keyDown.keyCode & (kbAltRCode | kbAltLCode)) &&
+ (e.keyDown.keyCode & kbKeyMask)==kbUnkNown)
+ {
+ uchar key=KeyMap[e.keyDown.charScan.charCode-0x80];
+ if (key<0x80)
+ {
+ e.keyDown.keyCode|=kbByASCII[key];
+ return 1;
+ }
+ }
+ return 0;
+}
diff --git a/tvision/classes/tgroup.cc b/tvision/classes/tgroup.cc
new file mode 100644
index 0000000..fc5b1d1
--- /dev/null
+++ b/tvision/classes/tgroup.cc
@@ -0,0 +1,743 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ *
+ * Modified by Robert H”hne to be used for RHIDE.
+
+Modified cursor behavior while desktop locked by Salvador E. Tropea (SET)
+
+ *
+ *
+ *
+ */
+
+#define Uses_TGroup
+#define Uses_TView
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TCommandSet
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TView *TheTopView = 0;
+
+TGroup::TGroup( const TRect& bounds ) :
+ TView(bounds), current( 0 ), last( 0 ), phase( phFocused ), buffer( 0 ),
+ lockFlag( 0 ), endState( 0 )
+{
+ options |= ofSelectable | ofBuffered;
+ clip = getExtent();
+ eventMask = 0xFFFF;
+}
+
+TGroup::~TGroup()
+{
+}
+
+void TGroup::shutDown()
+{
+ // Avoid problems if a hidden or unselectable TView was forced to be
+ // selected. Marek Bojarski <bojarski@if.uj.edu.pl>
+ resetCurrent();
+ TView* p = last;
+ if( p != 0 )
+ do {
+ TView* T = p->prev();
+ CLY_destroy( p );
+ p = T;
+ } while( last != 0 );
+ freeBuffer();
+ current = 0;
+ TView::shutDown();
+}
+
+void doCalcChange( TView *p, void *d )
+{
+ TRect r;
+ ((TGroup *)p)->calcBounds(r, *(TPoint*)d);
+ ((TGroup *)p)->changeBounds(r);
+}
+
+void TGroup::changeBounds( const TRect& bounds )
+{
+ TPoint d;
+
+ d.x = (bounds.b.x - bounds.a.x) - size.x;
+ d.y = (bounds.b.y - bounds.a.y) - size.y;
+ if( d.x == 0 && d.y == 0 )
+ {
+ setBounds(bounds);
+ drawView();
+ }
+ else
+ {
+ freeBuffer();
+ setBounds( bounds );
+ clip = getExtent();
+ getBuffer();
+ lock();
+ forEach( doCalcChange, &d );
+ unlock();
+ }
+}
+
+void addSubviewDataSize( TView *p, void *T )
+{
+ *((uint32 *)T) += ((TGroup *)p)->dataSize();
+}
+
+uint32 TGroup::dataSize()
+{
+ unsigned T = 0;
+ forEach( addSubviewDataSize, &T );
+ return T;
+}
+
+void TGroup::remove(TView* p)
+{
+ ushort saveState;
+ saveState = p->state;
+ p->hide();
+ removeView(p);
+ p->owner = 0;
+ p->next= 0;
+ if( (saveState & sfVisible) != 0 )
+ p->show();
+}
+
+static int force_redraw = 0;
+
+void TGroup::CLY_Redraw()
+{
+ force_redraw++;
+ redraw();
+ force_redraw--;
+}
+
+void TGroup::draw()
+{
+/* I have changed it now to force a redraw of all subviews
+ instead of redrawing from the buffer, when the flag
+ 'force_redraw' is set. This flag is set by the new member
+ function 'Redraw' which should be called, when the app wants
+ a forced redraw of all subviews.
+*/
+ if (buffer != 0)
+ {
+ if (force_redraw)
+ {
+ lockFlag++;
+ redraw();
+ lockFlag--;
+ }
+ writeBuf( 0, 0, size.x, size.y, buffer );
+ }
+ else
+ {
+ getBuffer();
+ if (buffer != 0)
+ {
+ lockFlag++;
+ redraw();
+ lockFlag--;
+ writeBuf( 0, 0, size.x, size.y, buffer );
+ }
+ else
+ {
+ clip = getClipRect();
+ redraw();
+ clip = getExtent();
+ }
+ }
+}
+
+void TGroup::drawSubViews( TView* p, TView* bottom )
+{
+ while( p != bottom )
+ {
+ p->drawView();
+ p = p->nextView();
+ }
+}
+
+void TGroup::endModal( ushort command )
+{
+ if( (state & sfModal) != 0 )
+ endState = command;
+ else
+ TView::endModal( command );
+}
+
+void TGroup::eventError( TEvent& event )
+{
+ if (owner != 0 )
+ owner->eventError( event );
+}
+
+ushort TGroup::execute()
+{
+ do {
+ endState = 0;
+ do {
+ TEvent e;
+ getEvent( e );
+ handleEvent( e );
+ if( e.what != evNothing )
+ eventError( e );
+ } while( endState == 0 );
+ } while( !valid(endState) );
+ return endState;
+}
+
+ushort TGroup::execView( TView* p )
+{
+ if( p == 0 )
+ return cmCancel;
+
+ ushort saveOptions = p->options;
+ TGroup *saveOwner = p->owner;
+ TView *saveTopView = TheTopView;
+ TView *saveCurrent= current;
+ TCommandSet saveCommands;
+ getCommands( saveCommands );
+ TheTopView = p;
+ p->options = p->options & ~ofSelectable;
+ p->setState(sfModal, True);
+ setCurrent(p, enterSelect);
+ if( saveOwner == 0 )
+ insert(p);
+
+ // Just be foolproof
+ int oldLock=lockFlag;
+ if (lockFlag)
+ {
+ lockFlag=1; unlock();
+ }
+
+ ushort retval = p->execute();
+ p->setState(sfActive, False);
+
+ // Re-lock if needed
+ lockFlag=oldLock;
+
+ if( saveOwner == 0 )
+ remove(p);
+ setCurrent(saveCurrent, leaveSelect);
+ p->setState(sfModal, False);
+ p->options = saveOptions;
+ TheTopView = saveTopView;
+ setCommands(saveCommands);
+ return retval;
+}
+
+TView *TGroup::first()
+{
+ if( last == 0 )
+ return 0;
+ else
+ return last->next;
+}
+
+TView *TGroup::firstMatch( ushort aState, ushort aOptions )
+{
+ if( last == 0 )
+ return 0;
+
+ TView* temp = last;
+ while(1)
+ {
+ if( ((temp->state & aState) == aState) &&
+ ((temp->options & aOptions) == aOptions))
+ return temp;
+
+ temp = temp->next;
+ if( temp == last )
+ return 0;
+ }
+}
+
+void TGroup::freeBuffer()
+{
+ if( (options & ofBuffered) != 0 && buffer != 0 )
+ {
+#if 0
+ TVMemMgr::freeDiscardable( buffer );
+#else
+ DeleteArray(buffer);
+#endif
+ buffer = 0;
+ }
+}
+
+void TGroup::getBuffer()
+{
+ if( (state & sfExposed) != 0 )
+ if( (options & ofBuffered) != 0 && (buffer == 0 ))
+#if 0
+ TVMemMgr::allocateDiscardable( (void *&)buffer, size.x * size.y * sizeof(ushort) );
+#else
+ buffer = new ushort[size.x * size.y];
+#endif
+}
+
+void TGroup::getData(void *rec)
+{
+ unsigned i = 0;
+ if (last != 0 )
+ {
+ TView* v = last;
+ do {
+ v->getData( ((char *)rec) + i );
+ i += v->dataSize();
+ v = v->prev();
+ } while( v != last );
+ }
+}
+
+struct handleStruct
+{
+ handleStruct( TEvent& e, TGroup& g ) : event( e ), grp( g ) {}
+ TEvent& event;
+ TGroup& grp;
+};
+
+static void doHandleEvent( TView *p, void *s )
+{
+ handleStruct *ptr = (handleStruct *)s;
+
+ if( p == 0 ||
+ ( (p->state & sfDisabled) != 0 &&
+ (ptr->event.what & (positionalEvents | focusedEvents)) != 0
+ )
+ )
+ return;
+
+ switch( ptr->grp.phase )
+ {
+ case TView::phPreProcess:
+ if( (p->options & ofPreProcess) == 0 )
+ return;
+ break;
+ case TView::phPostProcess:
+ if( (p->options & ofPostProcess) == 0 )
+ return;
+ break;
+ default:
+ break;
+ }
+ if( (ptr->event.what & p->eventMask) != 0 )
+ p->handleEvent( ptr->event );
+}
+
+static Boolean hasMouse( TView *p, void *s )
+{
+ return p->containsMouse( *(TEvent *)s );
+}
+
+void TGroup::handleEvent( TEvent& event )
+{
+ TView::handleEvent( event );
+
+ handleStruct hs( event, *this );
+
+ if( (event.what & focusedEvents) != 0 )
+ {
+ phase = phPreProcess;
+ forEach( doHandleEvent, &hs );
+
+ phase = phFocused;
+ doHandleEvent( current, &hs );
+
+ phase = phPostProcess;
+ forEach( doHandleEvent, &hs );
+ }
+ else
+ {
+ phase = phFocused;
+ if( (event.what & positionalEvents) != 0 )
+ {
+ doHandleEvent( firstThat( hasMouse, &event ), &hs );
+ }
+ else
+ forEach( doHandleEvent, &hs );
+ }
+}
+
+void TGroup::insert( TView* p )
+{
+ insertBefore( p, first() );
+}
+
+void TGroup::insertBefore( TView *p, TView *Target )
+{
+ if( p != 0 && p->owner == 0 && (Target == 0 || Target->owner == this) )
+ {
+ if( (p->options & ofCenterX) != 0 )
+ p->origin.x = (size.x - p->size.x)/2;
+ if( (p->options & ofCenterY) != 0 )
+ p->origin.y = (size.y - p->size.y)/2;
+ ushort saveState = p->state;
+ p->hide();
+ insertView( p, Target );
+ if( (saveState & sfVisible) != 0 )
+ p->show();
+ }
+}
+
+void TGroup::insertView( TView* p, TView* Target )
+{
+ p->owner = this;
+ if( Target != 0 )
+ {
+ Target = Target->prev();
+ p->next = Target->next;
+ Target->next= p;
+ }
+ else
+ {
+ if( last== 0 )
+ p->next = p;
+ else
+ {
+ p->next = last->next;
+ last->next = p;
+ }
+ last = p;
+ }
+}
+
+void TGroup::lock()
+{
+ if( buffer != 0 || lockFlag != 0 )
+ lockFlag++;
+}
+
+void TGroup::redraw()
+{
+ drawSubViews( first(), 0 );
+}
+
+void TGroup::resetCurrent()
+{
+ setCurrent( firstMatch( sfVisible, ofSelectable ), normalSelect );
+}
+
+void TGroup::resetCursor()
+{
+ if( current != 0 )
+ current->resetCursor();
+}
+
+void TGroup::selectNext( Boolean forwards )
+{
+ if( current != 0 )
+ {
+ TView* p = current;
+ do {
+ if (forwards)
+ p = p->next;
+ else
+ p = p->prev();
+ } while ( !(
+ (((p->state & (sfVisible + sfDisabled)) == sfVisible) &&
+ (p->options & ofSelectable)) || (p == current)
+ ) );
+ p->select();
+ }
+}
+
+void TGroup::selectView( TView* p, Boolean enable )
+{
+ if( p != 0 )
+ p->setState( sfSelected, enable );
+}
+
+void TGroup::focusView( TView* p, Boolean enable )
+{
+ if( (state & sfFocused) != 0 && p != 0 )
+ p->setState( sfFocused, enable );
+}
+
+
+
+void TGroup::setCurrent( TView* p, selectMode mode )
+{
+ if (current!= p)
+ {
+ lock();
+ focusView( current, False );
+ // Test if focus lost was allowed and focus has really been loose
+ if ( (mode == normalSelect) &&
+ current &&
+ (current->state & sfFocused)
+ )
+ {
+ unlock();
+ return;
+ }
+ if( mode != enterSelect )
+ if( current != 0 )
+ current->setState( sfSelected, False );
+ if( mode != leaveSelect )
+ if( p != 0 )
+ p->setState( sfSelected, True );
+ focusView( p, True );
+ current = p;
+ unlock();
+ }
+}
+
+void TGroup::setData(void *rec)
+{
+ unsigned i = 0;
+ if( last!= 0 )
+ {
+ TView* v = last;
+ do {
+ v->setData( (char *)rec + i );
+ i += v->dataSize();
+ v = v->prev();
+ } while (v != last);
+ }
+}
+
+static void doExpose( TView *p, void *enable )
+{
+ if( (p->state & sfVisible) != 0 )
+ p->setState( sfExposed, *(Boolean *)enable );
+}
+
+struct setBlock
+{
+ ushort st;
+ Boolean en;
+};
+
+static void doSetState( TView *p, void *b )
+{
+ p->setState( ((setBlock *)b)->st, ((setBlock *)b)->en );
+}
+
+void TGroup::setState( ushort aState, Boolean enable )
+{
+ setBlock sb;
+ sb.st = aState;
+ sb.en = enable;
+
+ TView::setState( aState, enable );
+
+ if( (aState & (sfActive | sfDragging)) != 0 )
+ {
+ lock();
+ forEach( doSetState, &sb );
+ unlock();
+ }
+
+ if( (aState & sfFocused) != 0 )
+ {
+ if( current != 0 )
+ current->setState( sfFocused, enable );
+ }
+
+ if( (aState & sfExposed) != 0 )
+ {
+ forEach( doExpose, &enable );
+ if( enable == False )
+ freeBuffer();
+ }
+}
+
+void TGroup::unlock()
+{
+ if( lockFlag != 0 && --lockFlag == 0 )
+ {
+ drawView();
+ // SET: Now is time to hide/show mouse according to
+ // changes while we were locked.
+ resetCursor();
+ }
+}
+
+Boolean isInvalid( TView *p, void * commandP)
+{
+ return Boolean( !p->valid( *(ushort *)commandP ) );
+}
+
+Boolean TGroup::valid( ushort command )
+{
+ return Boolean( firstThat( isInvalid, &command ) == 0 );
+}
+
+ushort TGroup::getHelpCtx()
+{
+ ushort h = hcNoContext;
+ if( current!= 0 )
+ h = current->getHelpCtx();
+ if (h == hcNoContext)
+ h = TView::getHelpCtx();
+ return h;
+}
+
+#if !defined( NO_STREAM )
+static void doPut( TView *p, void *osp )
+{
+ *(opstream *)osp << p;
+}
+
+void TGroup::write( opstream& os )
+{
+ ushort index;
+
+ TView::write( os );
+ TGroup *ownerSave = owner;
+ owner = this;
+ int count = indexOf( last );
+ os << count;
+ forEach( doPut, &os );
+ if (current == 0)
+ index = 0;
+ else
+ index = indexOf(current);
+ os << index;
+ owner = ownerSave;
+}
+
+void *TGroup::read( ipstream& is )
+{
+ ushort index;
+
+ TView::read( is );
+ clip = getExtent();
+ TGroup *ownerSave = owner;
+ owner = this;
+ last = 0;
+ phase = TView::phFocused;
+ current = 0;
+ buffer = 0;
+ lockFlag = 0;
+ endState = 0;
+ int count;
+ is >> count;
+ TView *tv;
+ for( int i = 0; i < count; i++ )
+ {
+ is >> tv;
+ if( tv != 0 )
+ insertView( tv, 0 );
+ }
+ owner = ownerSave;
+ TView *current;
+ is >> index;
+ current = at(index);
+ setCurrent( current, TView::normalSelect );
+ return this;
+}
+
+TStreamable *TGroup::build()
+{
+ return new TGroup( streamableInit );
+}
+
+TGroup::TGroup( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+// GRP.CC
+
+TView *TGroup::at( short index )
+{
+ TView *temp = last;
+ while( index-- > 0 )
+ temp = temp->next;
+ return temp;
+}
+
+TView *TGroup::firstThat( Boolean (*func)(TView *, void *), void *args )
+{
+ TView *temp = last;
+ if( temp == 0 )
+ return 0;
+
+ do {
+ temp = temp->next;
+ if( func( temp, args ) == True )
+ return temp;
+ } while( temp != last );
+ return 0;
+}
+
+void TGroup::forEach( void (*func)(TView*, void *), void *args )
+{
+ TView *term = last;
+ TView *temp = last;
+ if( temp == 0 )
+ return;
+
+ TView *next = temp->next;
+ do {
+ temp = next;
+ next = temp->next;
+ func( temp, args );
+ } while( temp != term );
+
+}
+
+short TGroup::indexOf( TView *p )
+{
+ if( last == 0 )
+ return 0;
+
+ short index = 0;
+ TView *temp = last;
+ do {
+ index++;
+ temp = temp->next;
+ } while( temp != p && temp != last );
+ if( temp != p )
+ return 0;
+ else
+ return index;
+}
+
+// TGRMV.CC
+
+void TGroup::removeView(TView *p)
+{
+ TView *akt,*view;
+ if (!last) return;
+ view = last;
+ akt = view->next;
+ while ((akt != p) && (akt != last))
+ {
+ view = akt;
+ akt = view->next;
+ }
+ if (akt == p)
+ {
+ akt = p->next;
+ view->next = akt;
+ if (last != p) return;
+ if (akt == p) view = NULL;
+ last = view;
+ return;
+ }
+ if (akt == last) return;
+}
+
+// SET: TViews will ask us if that's good time to draw cursor changes
+Boolean TGroup::canShowCursor()
+{
+ if (buffer)
+ {
+ if (owner)
+ return owner->canShowCursor();
+ return False;
+ }
+ return lockFlag ? False : True;
+}
diff --git a/tvision/classes/thistory.cc b/tvision/classes/thistory.cc
new file mode 100644
index 0000000..71fa07f
--- /dev/null
+++ b/tvision/classes/thistory.cc
@@ -0,0 +1,143 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <ctype.h>
+#define Uses_string
+
+#define Uses_THistory
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TInputLine
+#define Uses_THistoryWindow
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#include <tv.h>
+
+#define cpHistory "\x16\x17"
+
+THistory::THistory( const TRect& bounds,
+ TInputLine *aLink,
+ ushort aHistoryId) :
+ TView(bounds),
+ link( aLink ),
+ historyId( aHistoryId )
+{
+ options |= ofPostProcess;
+ eventMask |= evBroadcast;
+}
+
+void THistory::shutDown()
+{
+ link = 0;
+ TView::shutDown();
+}
+
+void THistory::draw()
+{
+ TDrawBuffer b;
+
+ b.moveCStr( 0, icon, getColor(0x0102) );
+ writeLine( 0, 0, size.x, size.y, b );
+}
+
+TPalette& THistory::getPalette() const
+{
+ static TPalette palette( cpHistory, sizeof( cpHistory )-1 );
+ return palette;
+}
+
+void THistory::handleEvent( TEvent& event )
+{
+ THistoryWindow *historyWindow;
+ TRect r, p;
+ ushort c;
+
+ TView::handleEvent( event );
+ if( event.what == evMouseDown ||
+ ( event.what == evKeyDown &&
+ ctrlToArrow( event.keyDown.keyCode ) == kbDown &&
+ (link->state & sfFocused) != 0
+ )
+ )
+ {
+ link->select();
+ historyAdd( historyId, link->data );
+ r = link->getBounds();
+ r.a.x--;
+ r.b.x++;
+ r.b.y += 7;
+ r.a.y--;
+ p = owner->getExtent();
+ r.intersect( p );
+ r.b.y--;
+ historyWindow = initHistoryWindow( r );
+ if( historyWindow != 0 )
+ {
+ c = owner->execView( historyWindow );
+ if( c == cmOK )
+ {
+ char rslt[256];
+ historyWindow->getSelection( rslt );
+ strncpy( link->data, rslt, link->maxLen );
+ link->data[link->maxLen] = EOS;
+ link->selectAll( True );
+ link->drawView();
+ }
+ CLY_destroy( historyWindow );
+ }
+ clearEvent( event );
+ }
+ else
+ if( event.what == evBroadcast )
+ if( (event.message.command == cmReleasedFocus &&
+ event.message.infoPtr == link) ||
+ event.message.command == cmRecordHistory
+ )
+ historyAdd( historyId, link->data );
+}
+
+THistoryWindow *THistory::initHistoryWindow( const TRect& bounds )
+{
+ THistoryWindow *p = new THistoryWindow( bounds, historyId );
+ p->helpCtx = link->helpCtx;
+ return p;
+}
+
+#if !defined( NO_STREAM )
+void THistory::write( opstream& os )
+{
+ TView::write( os );
+ os << link << historyId;
+}
+
+void *THistory::read( ipstream& is )
+{
+ TView::read( is );
+ is >> link >> historyId;
+ return this;
+}
+
+TStreamable *THistory::build()
+{
+ return new THistory( streamableInit );
+}
+
+THistory::THistory( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/thistvie.cc b/tvision/classes/thistvie.cc
new file mode 100644
index 0000000..8504892
--- /dev/null
+++ b/tvision/classes/thistvie.cc
@@ -0,0 +1,89 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <ctype.h>
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_THistoryViewer
+#define Uses_TScrollBar
+#define Uses_TEvent
+#define Uses_TPalette
+#include <tv.h>
+
+#define cpHistoryViewer "\x06\x06\x07\x06\x06"
+
+THistoryViewer::THistoryViewer( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ ushort aHistoryId) :
+ TListViewer(bounds, 1, aHScrollBar, aVScrollBar),
+ historyId( aHistoryId )
+{
+ setRange( historyCount( aHistoryId ) );
+ if( range > 1 )
+ focusItem( 1 );
+ hScrollBar->setRange( 0, historyWidth() - size.x + 3 );
+}
+
+TPalette& THistoryViewer::getPalette() const
+{
+ static TPalette palette( cpHistoryViewer, sizeof( cpHistoryViewer )-1 );
+ return palette;
+}
+
+void THistoryViewer::getText( char *dest, ccIndex item, short maxChars )
+{
+ const char *str = historyStr( historyId, item );
+ if( str != 0 )
+ {
+ strncpy( dest, str, maxChars );
+ dest[maxChars] = '\0';
+ }
+ else
+ *dest = EOS;
+}
+
+void THistoryViewer::handleEvent( TEvent& event )
+{
+ if( (event.what == evMouseDown && event.mouse.doubleClick) ||
+ (event.what == evKeyDown && event.keyDown.keyCode == kbEnter)
+ )
+ {
+ endModal( cmOK );
+ clearEvent( event );
+ }
+ else
+ if( (event.what == evKeyDown && event.keyDown.keyCode == kbEsc) ||
+ (event.what == evCommand && event.message.command == cmCancel)
+ )
+ {
+ endModal( cmCancel );
+ clearEvent( event );
+ }
+ else
+ TListViewer::handleEvent( event );
+}
+
+int THistoryViewer::historyWidth()
+{
+ int width = 0;
+ int count = historyCount( historyId );
+ for( int i = 0; i < count; i++ )
+ {
+ int T = strlen( historyStr( historyId, i ) );
+ width = max( width, T );
+ }
+ return width;
+}
diff --git a/tvision/classes/thistwin.cc b/tvision/classes/thistwin.cc
new file mode 100644
index 0000000..7329726
--- /dev/null
+++ b/tvision/classes/thistwin.cc
@@ -0,0 +1,56 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_THistoryWindow
+#define Uses_THistoryViewer
+#define Uses_TPalette
+#include <tv.h>
+
+THistInit::THistInit( TListViewer *(*cListViewer)( TRect, TWindow *, ushort ) ) :
+ createListViewer( cListViewer )
+{
+}
+
+#define cpHistoryWindow "\x13\x13\x15\x18\x17\x13\x14"
+
+THistoryWindow::THistoryWindow( const TRect& bounds,
+ ushort historyId ) :
+ TWindowInit( &THistoryWindow::initFrame )
+ , THistInit( &THistoryWindow::initViewer )
+ , TWindow( bounds, 0, wnNoNumber)
+{
+ flags = wfClose;
+ if( createListViewer != 0 &&
+ (viewer = createListViewer( getExtent(), this, historyId )) != 0 )
+ insert( viewer );
+}
+
+TPalette& THistoryWindow::getPalette() const
+{
+ static TPalette palette( cpHistoryWindow, sizeof( cpHistoryWindow )-1 );
+ return palette;
+}
+
+void THistoryWindow::getSelection( char *dest )
+{
+ viewer->getText( dest, viewer->focused, 255 );
+}
+
+TListViewer *THistoryWindow::initViewer( TRect r, TWindow * win, ushort historyId )
+{
+ r.grow( -1, -1 );
+ return new THistoryViewer( r,
+ win->standardScrollBar( sbHorizontal | sbHandleKeyboard ),
+ win->standardScrollBar( sbVertical | sbHandleKeyboard ),
+ historyId);
+}
diff --git a/tvision/classes/thwmouse.cc b/tvision/classes/thwmouse.cc
new file mode 100644
index 0000000..54bcd70
--- /dev/null
+++ b/tvision/classes/thwmouse.cc
@@ -0,0 +1,162 @@
+/**[txh]********************************************************************
+
+ Mouse module, Copyright 2001-2003 by Salvador E. Tropea
+ Description:
+ This is the base class for low level mouse input.
+ Most members are pointers to functions defined by each platform dependent
+driver. Default members are provided.
+ This is a complete new file created from concepts that José Angel Sanchez
+Caso provide me and coded from scratch. The names of some members are the
+same used in original Turbo Vision for compatibility purposes.
+
+***************************************************************************/
+// Definitions are located at the event.h header
+
+#define Uses_TEvent
+#define Uses_TEventQueue
+#include <tv.h>
+
+/*****************************************************************************
+ Data members initialization
+*****************************************************************************/
+
+Boolean THWMouse::handlerInstalled=False;
+Boolean THWMouse::noMouse =False;
+uchar THWMouse::buttonCount =0;
+uchar THWMouse::oldButtonCount =0;
+uchar THWMouse::btBeforeForce =0;
+char THWMouse::visible =0;
+char THWMouse::forced =0;
+volatile
+unsigned THWMouse::drawCounter =0;
+MouseEventType THWMouse::forcedME;
+
+/*****************************************************************************
+ Function pointer members initialization
+*****************************************************************************/
+
+void (*THWMouse::Show)() =defaultShow;
+void (*THWMouse::Hide)() =defaultHide;
+void (*THWMouse::setRange)(ushort, ushort) =defaultSetRange;
+void (*THWMouse::GetEvent)(MouseEventType&) =defaultGetEvent;
+void (*THWMouse::registerHandler)(unsigned, void (*)())=defaultRegisterHandler;
+void (*THWMouse::Suspend)() =defaultSuspend;
+void (*THWMouse::Resume)() =defaultResume;
+int (*THWMouse::drawMouse)(int x, int y) =defaultDrawMouse;
+
+/*****************************************************************************
+ Default behaviors for the members
+*****************************************************************************/
+
+void THWMouse::defaultShow()
+{
+ visible=1;
+}
+
+void THWMouse::defaultHide()
+{
+ visible=0;
+}
+
+void THWMouse::defaultSuspend() {}
+void THWMouse::defaultResume() { buttonCount=oldButtonCount; }
+void THWMouse::defaultSetRange(ushort /*rx*/, ushort /*ry*/) {}
+int THWMouse::defaultDrawMouse(int /*x*/, int /*y*/) { return 0; }
+
+void THWMouse::defaultRegisterHandler(unsigned, void (*)()) {}
+
+void THWMouse::defaultGetEvent(MouseEventType &me)
+{
+ me.where.x=TEventQueue::curMouse.where.x;
+ me.where.y=TEventQueue::curMouse.where.y;
+ me.buttons=TEventQueue::curMouse.buttons;
+ me.doubleClick=False;
+}
+
+/*****************************************************************************
+ Real members
+*****************************************************************************/
+
+THWMouse::THWMouse()
+{
+ resume();
+}
+
+THWMouse::~THWMouse()
+{
+ suspend();
+}
+
+void THWMouse::show()
+{
+ if (!present() || visible) return;
+ Show();
+}
+
+void THWMouse::hide()
+{
+ if (!present() || !visible) return;
+ Hide();
+}
+
+void THWMouse::suspend()
+{
+ if (!present())
+ return;
+ if (visible)
+ Hide();
+ oldButtonCount=buttonCount;
+ buttonCount=0;
+ Suspend();
+}
+
+void THWMouse::resume()
+{
+ if (present())
+ return;
+ Resume();
+ if (!visible)
+ Show();
+}
+
+void THWMouse::forceEvent(int x, int y, int buttons)
+{
+ forced=0;
+ if (TEventQueue::curMouse.where.x!=x || TEventQueue::curMouse.where.y!=y)
+ forced++;
+ if (TEventQueue::curMouse.buttons!=buttons)
+ forced++;
+ forcedME.where.x=x;
+ forcedME.where.y=y;
+ forcedME.doubleClick=False;
+ btBeforeForce=forcedME.buttons;
+ forcedME.buttons=buttons;
+}
+
+void THWMouse::getEvent(MouseEventType& me)
+{
+ if (!present())
+ {
+ me=TEventQueue::curMouse;
+ return;
+ }
+ if (forced)
+ {
+ me=forcedME;
+ if (forced==2)
+ me.buttons=btBeforeForce;
+ TEventQueue::curMouse=me;
+ drawMouse(forcedME.where.x,forcedME.where.y);
+ forced--;
+ }
+ else if (handlerInstalled)
+ {
+ me=TEventQueue::curMouse;
+ }
+ else
+ {
+ GetEvent(me);
+ TEventQueue::curMouse=me;
+ }
+}
+
diff --git a/tvision/classes/tindicat.cc b/tvision/classes/tindicat.cc
new file mode 100644
index 0000000..ce23a29
--- /dev/null
+++ b/tvision/classes/tindicat.cc
@@ -0,0 +1,107 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#if 0
+ #define Uses_strstream
+#else
+ #define Uses_stdio
+#endif
+#define Uses_string
+
+#define Uses_TIndicator
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+#define Uses_TView
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TIndicator
+#define Uses_TStreamableClass
+#define Uses_TPalette
+#include <tv.h>
+
+#define cpIndicator "\x02\x03"
+
+TIndicator::TIndicator( const TRect& bounds ) :
+ TView( bounds )
+{
+ growMode = gfGrowLoY | gfGrowHiY;
+ location.x = location.y = 1;
+}
+
+void TIndicator::draw()
+{
+ uchar color, frame;
+ TDrawBuffer b;
+ char s[15];
+
+ if( (state & sfDragging) == 0 )
+ {
+ color = getColor(1);
+ frame = dragFrame;
+ }
+ else
+ {
+ color = getColor(2);
+ frame = normalFrame;
+ }
+
+ b.moveChar( 0, frame, color, size.x );
+ if( modified )
+ b.putChar( 0, modifiedStar );
+#if 1
+ sprintf(s," %d:%d ",location.y+1,location.x+1);
+#else
+ ostrstream os( s, 15 );
+
+ os << ' ' << (location.y+1)
+ << ':' << (location.x+1) << ' ' << ends;
+#endif
+ b.moveCStr( 8-int(strchr(s, ':')-s), s, color);
+ writeBuf(0, 0, size.x, 1, b);
+}
+
+TPalette& TIndicator::getPalette() const
+{
+ static TPalette palette( cpIndicator, sizeof( cpIndicator )-1 );
+ return palette;
+}
+
+void TIndicator::setState( ushort aState, Boolean enable )
+{
+ TView::setState(aState, enable);
+ if( aState == sfDragging )
+ drawView();
+}
+
+void TIndicator::setValue( const TPoint& aLocation, Boolean aModified )
+{
+ if( (location != aLocation) || (modified != aModified) )
+ {
+ location = aLocation;
+ modified = aModified;
+ drawView();
+ }
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TIndicator::build()
+{
+ return new TIndicator( streamableInit );
+}
+
+TIndicator::TIndicator( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tinputli.cc b/tvision/classes/tinputli.cc
new file mode 100644
index 0000000..cae0a08
--- /dev/null
+++ b/tvision/classes/tinputli.cc
@@ -0,0 +1,563 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea (added insertChar, middle button paste and
+other stuff).
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+// Added insertChar member.
+#define Uses_ctype
+#define Uses_string
+#define Uses_stdlib
+#define Uses_AllocLocal
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TGKey
+#define Uses_TInputLine
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#define Uses_TValidator
+#define Uses_TPalette
+#define Uses_TVOSClipboard
+#define Uses_TGroup
+#include <tv.h>
+
+unsigned TInputLine::defaultModeOptions=0;
+
+#define cpInputLine "\x13\x13\x14\x15"
+
+TInputLine::TInputLine( const TRect& bounds, int aMaxLen, TValidator *aValid ) :
+ TView(bounds),
+ data( new char[aMaxLen] ),
+ maxLen( aMaxLen-1 ),
+ curPos( 0 ),
+ firstPos( 0 ),
+ selStart( 0 ),
+ selEnd( 0 ),
+ validator( aValid ),
+ oldData( new char[aMaxLen] )
+{
+ state |= sfCursorVis;
+ options |= ofSelectable | ofFirstClick;
+ *data = EOS;
+ modeOptions = defaultModeOptions;
+ hideContent = False;
+}
+
+void TInputLine::setValidator(TValidator * aValidator)
+{
+ CLY_destroy(validator);
+ validator = aValidator;
+}
+
+TInputLine::~TInputLine()
+{
+ delete[] data;
+ delete[] oldData;
+ CLY_destroy(validator);
+}
+
+Boolean TInputLine::canScroll( int delta )
+{
+ if( delta < 0 )
+ return Boolean( firstPos > 0 );
+ else
+ if( delta > 0 )
+ return Boolean( (int)strlen(data) - firstPos + 2 > size.x );
+ else
+ return False;
+}
+
+unsigned TInputLine::dataSize()
+{
+ unsigned dSize = 0;
+
+ if (validator)
+ dSize = validator->transfer(data, NULL, vtDataSize);
+ if (dSize == 0)
+ dSize = maxLen + 1;
+ return dSize;
+}
+
+void TInputLine::draw()
+{
+ int l, r;
+ TDrawBuffer b;
+
+ uchar color = (state & sfFocused) ? getColor( 2 ) : getColor( 1 );
+
+ b.moveChar( 0, ' ', color, size.x );
+ AllocLocalStr( buf, size.x );
+ if( hideContent )
+ {
+ int rest = strlen( data ) - firstPos;
+ if( rest > 0 )
+ b.moveChar( 1, '*', color, min( size.x - 2, rest) );
+ }
+ else
+ {
+ strncpy( buf, data+firstPos, size.x - 2 );
+ buf[size.x - 2 ] = EOS;
+ b.moveStr( 1, buf, color );
+ }
+
+ if( canScroll(1) )
+ b.moveChar( size.x-1, rightArrow, getColor(4), 1 );
+ if( canScroll(-1) )
+ b.moveChar( 0, leftArrow, getColor(4), 1 );
+ if( state & sfSelected )
+ {
+ l = selStart - firstPos;
+ r = selEnd - firstPos;
+ l = max( 0, l );
+ r = min( size.x - 2, r );
+ if (l < r)
+ b.moveChar( l+1, 0, getColor(3), r - l );
+ }
+ writeLine( 0, 0, size.x, size.y, b );
+ setCursor( curPos-firstPos+1, 0);
+}
+
+void TInputLine::getData( void *rec )
+{
+ if (!validator || !validator->transfer(data, rec, vtGetData))
+ memcpy( rec, data, dataSize() );
+}
+
+TPalette& TInputLine::getPalette() const
+{
+ static TPalette palette( cpInputLine, sizeof( cpInputLine )-1 );
+ return palette;
+}
+
+int TInputLine::mouseDelta( TEvent& event )
+{
+ TPoint mouse = makeLocal( event.mouse.where );
+
+ if( mouse.x <= 0 )
+ return -1;
+ else
+ if( mouse.x >= size.x - 1 )
+ return 1;
+ else
+ return 0;
+}
+
+int TInputLine::mousePos( TEvent& event )
+{
+ TPoint mouse = makeLocal( event.mouse.where );
+ mouse.x = max( mouse.x, 1 );
+ int pos = mouse.x + firstPos - 1;
+ pos = max( pos, 0 );
+ pos = min( (size_t)pos, strlen(data) );
+ return pos;
+}
+
+void TInputLine::deleteSelect()
+{
+ if( selStart < selEnd )
+ {
+ strcpy( data+selStart, data+selEnd );
+ curPos = selStart;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Inserts a character at the cursor position. If the text is currently
+selected it's removed. If a validator is defined it's called. This basic
+input line have a fixed size and will refuse to insert the character if
+there is not enough space, but the virtual resizeData() is called giving
+a chance to create variable size input lines.@*
+ I (SET) moved it to allow insertions from sources other than the keyboard
+emulating it's behavior.
+
+ Return: False if the validator canceled the character, otherwise True.
+
+***************************************************************************/
+
+Boolean TInputLine::insertChar(char value)
+{
+ saveState();
+ if( (state & sfCursorIns) == 0 )
+ {
+ deleteSelect();
+ }
+ int l = strlen(data);
+ if (((l == maxLen) && ((state & sfCursorIns) == 0)) ||
+ ((state & sfCursorIns) && curPos == maxLen))
+ resizeData();
+ {
+ if( (state & sfCursorIns) == 0 )
+ {
+ if (l < maxLen)
+ memmove( data + curPos + 1, data + curPos,
+ strlen(data+curPos)+1 );
+ }
+ else if (l == curPos)
+ {
+ data[curPos+1] = 0;
+ }
+ if ((((state & sfCursorIns) == 0) && (l < maxLen)) ||
+ ((state & sfCursorIns) && (curPos < maxLen)))
+ {
+ if( firstPos > curPos )
+ firstPos = curPos;
+ data[curPos++] = value;
+ }
+ }
+
+ return checkValid(False);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used internally to ensure the cursor is at a visible position, unselect
+the text and force a draw.
+
+***************************************************************************/
+
+void TInputLine::makeVisible()
+{
+ if( firstPos > curPos )
+ firstPos = curPos;
+ int i = curPos - size.x + 2;
+ if( firstPos < i )
+ firstPos = i;
+ drawView();
+}
+
+void TInputLine::saveState()
+{
+ if (validator)
+ {
+ strcpy(oldData,data);
+ oldCurPos = curPos;
+ oldFirstPos = firstPos;
+ oldSelStart = selStart;
+ oldSelEnd = selEnd;
+ }
+}
+
+void TInputLine::restoreState()
+{
+ if (validator)
+ {
+ strcpy(data, oldData);
+ curPos = oldCurPos;
+ firstPos = oldFirstPos;
+ selStart = oldSelStart;
+ selEnd = oldSelEnd;
+ }
+}
+
+Boolean TInputLine::checkValid(Boolean noAutoFill)
+{
+ int oldLen;
+ char *newData;
+
+ if (validator)
+ {
+ oldLen = (int)strlen(data);
+ // SET: I think TValidator should avoid to exceed maxLen.
+ newData = new char[maxLen+2];
+ strcpy(newData, data);
+ if (!validator->isValidInput(newData, noAutoFill))
+ {
+ restoreState();
+ delete[] newData;
+ return False;
+ }
+ else
+ {
+ if ((int)strlen(newData) > maxLen)
+ // We don't support validators that write more data than the allowed.
+ abort();
+ //newData[maxLen] = 0;
+ strcpy(data,newData);
+ // Handle the autofill feature
+ if ((curPos >= oldLen) && ((int)strlen(data) > oldLen))
+ curPos = (int)strlen(data);
+ delete[] newData;
+ return True;
+ }
+ }
+ return True;
+}
+
+
+
+#define adjustSelectBlock() \
+ if( curPos < anchor ) \
+ { \
+ selStart = curPos; \
+ selEnd = anchor; \
+ } \
+ else \
+ { \
+ selStart = anchor; \
+ selEnd = curPos; \
+ }
+
+void TInputLine::handleEvent( TEvent& event )
+{
+ ushort key;
+ Boolean extendBlock;
+ TView::handleEvent(event);
+
+ int delta, anchor=0;
+ if( (state & sfSelected) != 0 )
+ switch( event.what )
+ {
+ case evMouseDown:
+ if( event.mouse.buttons == mbMiddleButton &&
+ TVOSClipboard::isAvailable() > 1 )
+ {
+ unsigned size,i;
+ char *p=TVOSClipboard::paste(1,size);
+ if( p )
+ {
+ for (i=0; i<size; i++)
+ {
+ insertChar( p[i] );
+ selStart = selEnd = 0; // Reset the selection or we will delete the last insertion
+ }
+ DeleteArray( p );
+ makeVisible();
+ }
+ }
+ else if( canScroll(delta = mouseDelta(event)) )
+ do {
+ if( canScroll(delta) )
+ {
+ firstPos += delta;
+ drawView();
+ }
+ } while( mouseEvent( event, evMouseAuto ) );
+ else if( event.mouse.doubleClick )
+ selectAll(True);
+ else
+ {
+ anchor = mousePos(event);
+ do {
+ if( event.what == evMouseAuto &&
+ canScroll( delta = mouseDelta(event) )
+ )
+ firstPos += delta;
+ curPos = mousePos(event);
+ adjustSelectBlock()
+ drawView();
+ } while (mouseEvent(event, evMouseMove | evMouseAuto));
+ if( TVOSClipboard::isAvailable() > 1 )
+ TVOSClipboard::copy(1,data+selStart,selEnd-selStart);
+ }
+ clearEvent(event);
+ break;
+ case evKeyDown:
+ key = ctrlToArrow(event.keyDown.keyCode);
+ extendBlock = False;
+ if( key & kbShiftCode )
+ {
+ ushort keyS = key & (~kbShiftCode);
+ if( keyS == kbHome || keyS == kbLeft || keyS == kbRight || keyS == kbEnd )
+ {
+ if (curPos == selEnd)
+ anchor = selStart;
+ else
+ anchor = selEnd;
+ key = keyS;
+ extendBlock = True;
+ }
+ }
+
+ switch( key )
+ {
+ case kbLeft:
+ if( curPos > 0 )
+ curPos--;
+ break;
+ case kbRight:
+ if( curPos < (int)strlen(data) )
+ curPos++;
+ break;
+ case kbHome:
+ curPos = 0;
+ break;
+ case kbEnd:
+ curPos = strlen(data);
+ break;
+ case kbBackSpace:
+ if( curPos > 0 )
+ {
+ saveState();
+ strcpy( data+curPos-1, data+curPos );
+ curPos--;
+ if( firstPos > 0 )
+ firstPos--;
+ checkValid(True);
+ }
+ break;
+ case kbDelete:
+ saveState();
+ if( selStart == selEnd )
+ if( curPos < (int)strlen(data) )
+ {
+ selStart = curPos;
+ selEnd = curPos + 1;
+ }
+ deleteSelect();
+ checkValid(True);
+ break;
+ case kbInsert:
+ setState(sfCursorIns, Boolean(!(state & sfCursorIns)));
+ break;
+ case kbCtY:
+ *data = EOS;
+ curPos = 0;
+ break;
+ // Let them pass even if these contains a strange ASCII (SET)
+ case kbEnter:
+ case kbTab:
+ return;
+ default:
+ if( event.keyDown.charScan.charCode >= ' ' )
+ {
+ if( !insertChar( event.keyDown.charScan.charCode ) )
+ {
+ clearEvent(event);
+ break;
+ }
+ }
+ else
+ {
+ return;
+ }
+ }
+ if (extendBlock)
+ {
+ adjustSelectBlock()
+ }
+ else
+ {
+ selStart = 0;
+ selEnd = 0;
+ }
+ makeVisible();
+ clearEvent( event );
+ break;
+ }
+}
+
+void TInputLine::selectAll( Boolean enable )
+{
+ selStart = 0;
+ if( enable )
+ curPos = selEnd = strlen(data);
+ else
+ curPos = selEnd = 0;
+ firstPos = max( 0, curPos-size.x+2 );
+ if( TVOSClipboard::isAvailable() > 1 )
+ TVOSClipboard::copy(1,data+selStart,selEnd-selStart);
+ drawView();
+}
+
+void TInputLine::setData( void *rec )
+{
+ if (!validator || !validator->transfer(data,rec,vtSetData))
+ {
+ // The following is invalid is someboy calls setData("string")
+ // memcpy( data, rec, dataSize()-1 );
+ strncpy( data, (const char*)rec, dataSize()-1 );
+ data[dataSize()-1] = EOS; // strncpy doesn't make it if strlen(rec)>dataSize()-1
+ }
+ selectAll( True );
+}
+
+void TInputLine::setState( ushort aState, Boolean enable )
+{
+ if (validator && // We have a validator
+ (modeOptions & ilValidatorBlocks) && // We want to block if invalid
+ owner && (owner->state & sfActive) && // The owner is visible
+ aState==sfFocused && enable==False) // We are losing the focus
+ {
+ TValidator *v=validator;
+ validator=NULL; // Avoid nested tests
+ Boolean ret=v->validate(data); // Check if we have valid data
+ validator=v;
+ if (!ret) // If not refuse the focus change
+ return;
+ }
+ TView::setState( aState, enable );
+ if( aState == sfSelected ||
+ ( aState == sfActive && (state & sfSelected) != 0 )
+ )
+ selectAll( enable );
+}
+
+#if !defined( NO_STREAM )
+void TInputLine::write( opstream& os )
+{
+ TView::write( os );
+ os << maxLen << curPos << firstPos
+ << selStart << selEnd;
+ os.writeString( data);
+ os << validator;
+}
+
+void *TInputLine::read( ipstream& is )
+{
+ TView::read( is );
+ is >> maxLen >> curPos >> firstPos
+ >> selStart >> selEnd;
+ data = new char[maxLen + 1];
+ oldData = new char[maxLen + 1];
+ is.readString(data, maxLen+1);
+ state |= sfCursorVis;
+ is >> validator;
+ // BC++ TV 2.0 options |= ofSelectable | ofFirstClick;
+ return this;
+}
+
+TStreamable *TInputLine::build()
+{
+ return new TInputLine( streamableInit );
+}
+
+TInputLine::TInputLine( StreamableInit ) : TView( streamableInit ),
+ validator(NULL)
+{
+}
+#endif // NO_STREAM
+
+Boolean TInputLine::valid(ushort cmd)
+{
+ if (validator)
+ {
+ if (cmd == cmValid)
+ return Boolean(validator->status == vsOk);
+ else if (cmd != cmCancel)
+ if (!validator->validate(data))
+ {
+ owner->current = 0;
+ select();
+ return False;
+ }
+ }
+ return True;
+}
+
+
diff --git a/tvision/classes/tlabel.cc b/tvision/classes/tlabel.cc
new file mode 100644
index 0000000..08350be
--- /dev/null
+++ b/tvision/classes/tlabel.cc
@@ -0,0 +1,179 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea: added i18n support.
+
+ *
+ *
+ */
+
+#define Uses_TLabel
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TGroup
+#define Uses_TView
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#define Uses_TPalette
+#define Uses_TGKey
+#define Uses_ctype
+#define Uses_TScreen
+#include <tv.h>
+
+#define cpLabel "\x07\x08\x09\x09\x0D\x0D"
+
+TLabel::TLabel( const TRect& bounds, const char *aText, TView* aLink) :
+ TStaticText( bounds, aText )
+{
+ init( aLink );
+}
+
+TLabel::TLabel( const TRect& bounds, const char *aText, TView *aLink,
+ stTVIntl *aIntlText ) :
+ TStaticText( bounds, aText, aIntlText )
+{
+ init( aLink );
+}
+
+void TLabel::init( TView *aLink )
+{
+ link = aLink;
+ light = False;
+ options |= ofPreProcess | ofPostProcess;
+ eventMask |= evBroadcast;
+ // This class can be "Braille friendly"
+ if (TScreen::getShowCursorEver())
+ state |= sfCursorVis;
+}
+
+void TLabel::shutDown()
+{
+ link = 0;
+ TStaticText::shutDown();
+}
+
+// SET: Now labels propagate the disabled state.
+void TLabel::setState( ushort aState, Boolean enable )
+{
+ TView::setState( aState, enable );
+ if( aState == sfDisabled )
+ {
+ link->setState( aState, enable );
+ drawView();
+ }
+}
+
+void TLabel::draw()
+{
+ ushort color;
+ TDrawBuffer b;
+ uchar scOff;
+
+ if( state & sfDisabled )
+ {// SET: Now disabled labels shows it
+ color = getColor(0x0605);
+ scOff = 4;
+ }
+ else
+ {
+ if( light )
+ {
+ color = getColor(0x0402);
+ scOff = 0;
+ }
+ else
+ {
+ color = getColor(0x0301);
+ scOff = 4;
+ }
+ }
+
+ b.moveChar( 0, ' ', color, size.x );
+ if( text != 0 )
+ {
+ b.moveCStr( 1, getText(), color );
+ if( light )
+ {// Usually this will do nothing because the focus is in the linked
+ // object
+ setCursor( 1 , 0 );
+ resetCursor();
+ }
+ }
+ if( showMarkers )
+ b.putChar( 0, specialChars[scOff] );
+ writeLine( 0, 0, size.x, 1, b );
+}
+
+TPalette& TLabel::getPalette() const
+{
+ static TPalette palette( cpLabel, sizeof( cpLabel )-1 );
+ return palette;
+}
+
+#define validLink() (link && (link->options & ofSelectable) && \
+ !(link->state & sfDisabled))
+
+void TLabel::handleEvent( TEvent& event )
+{
+ TStaticText::handleEvent(event);
+ if( event.what == evMouseDown )
+ {
+ if( validLink() )
+ link->select();
+ clearEvent( event );
+ }
+ else if( event.what == evKeyDown )
+ {
+ char c = hotKey( getText() );
+ if( TGKey::GetAltCode(c) == event.keyDown.keyCode ||
+ ( c != 0 && owner->phase == TGroup::phPostProcess &&
+ TGKey::CompareASCII(uctoupper(event.keyDown.charScan.charCode),c) )
+ )
+ {
+ if( validLink() )
+ link->select();
+ clearEvent( event );
+ }
+ }
+ else if( event.what == evBroadcast &&
+ ( event.message.command == cmReceivedFocus ||
+ event.message.command == cmReleasedFocus )
+ )
+ {
+ light = Boolean( (link->state & sfFocused) != 0 );
+ drawView();
+ }
+}
+
+#if !defined( NO_STREAM )
+void TLabel::write( opstream& os )
+{
+ TStaticText::write( os );
+ os << link;
+}
+
+void *TLabel::read( ipstream& is )
+{
+ TStaticText::read( is );
+ is >> link;
+ light = False;
+ return this;
+}
+
+TStreamable *TLabel::build()
+{
+ return new TLabel( streamableInit );
+}
+
+TLabel::TLabel( StreamableInit ) : TStaticText( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tlistbox.cc b/tvision/classes/tlistbox.cc
new file mode 100644
index 0000000..73c4770
--- /dev/null
+++ b/tvision/classes/tlistbox.cc
@@ -0,0 +1,139 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to add functionality.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TListBox
+#define Uses_TEvent
+#define Uses_TCollection
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TListBox::TListBox( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *aScrollBar ) :
+ TListViewer(bounds, aNumCols, 0, aScrollBar),
+ items( 0 )
+{
+ setRange(0);
+ center = False;
+}
+
+// SET:
+TListBox::TListBox( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ Boolean aCenterOps) :
+ TListViewer(bounds, aNumCols, aHScrollBar, aVScrollBar),
+ items( 0 )
+{
+ setRange(0);
+ center = aCenterOps;
+}
+
+TListBox::~TListBox()
+{
+}
+
+uint32 TListBox::dataSize()
+{
+ return sizeof(TListBoxRec);
+}
+
+void TListBox::getData( void * rec )
+{
+ TListBoxRec *p = (TListBoxRec *)rec;
+ p->items = items;
+ p->selection = focused;
+}
+
+void TListBox::getText( char *dest, ccIndex item, short maxChars )
+{
+ if( items != 0 )
+ {
+ strncpy( dest, (const char *)(items->at(item)), maxChars );
+ dest[maxChars] = '\0';
+ }
+ else
+ *dest = EOS;
+}
+
+// SET: You not always want to destroy the items
+void TListBox::newList( TCollection *aList, Boolean destroyItems )
+{
+ if( destroyItems )
+ CLY_destroy( items );
+ items = aList;
+ if( aList != 0 )
+ setRange( aList->getCount() );
+ else
+ setRange(0);
+ if( range > 0 )
+ focusItem(0);
+ drawView();
+}
+
+// SET: This is for compatibility
+void TListBox::newList( TCollection *aList )
+{
+ newList( aList, True );
+}
+
+// SET: You not always want to destroy the items
+void TListBox::setData( void *rec, Boolean destroyItems )
+{
+ TListBoxRec *p = (TListBoxRec *)rec;
+ newList( p->items, destroyItems );
+ if( center )
+ focusItemCentered( p->selection );
+ else
+ focusItem( p->selection );
+ drawView();
+}
+
+// SET: This is for compatibility
+void TListBox::setData( void *rec )
+{
+ setData( rec, True );
+}
+
+#if !defined( NO_STREAM )
+void TListBox::write( opstream& os )
+{
+ TListViewer::write( os );
+ os << items;
+}
+
+void *TListBox::read( ipstream& is )
+{
+ TListViewer::read( is );
+ is >> items;
+ return this;
+}
+
+TStreamable *TListBox::build()
+{
+ return new TListBox( streamableInit );
+}
+
+TListBox::TListBox( StreamableInit ) : TListViewer( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tlistvie.cc b/tvision/classes/tlistvie.cc
new file mode 100644
index 0000000..172bf74
--- /dev/null
+++ b/tvision/classes/tlistvie.cc
@@ -0,0 +1,530 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+Modified by Salvador E. Tropea to add functionality.
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_TKeys
+#define Uses_TListViewer
+#define Uses_TScrollBar
+#define Uses_TDrawBuffer
+#define Uses_TPoint
+#define Uses_TEvent
+#define Uses_TGroup
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#define Uses_TPalette
+#include <tv.h>
+
+#define cpListViewer "\x1A\x1A\x1B\x1C\x1D"
+
+// SET: By default I make it report more messages than original TV. In this
+// case the focusItem(ccIndex item) member generates a broadcast.
+unsigned TListViewer::extraOptions=ofBeVerbose;
+
+TListViewer::TListViewer( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar) :
+ TView( bounds ),
+ topItem( 0 ),
+ focused( 0 ),
+ range( 0 ),
+ handleSpace(True)
+{
+ options |= ofFirstClick | ofSelectable | extraOptions;
+ eventMask |= evBroadcast;
+
+ hScrollBar = aHScrollBar;
+ vScrollBar = aVScrollBar;
+ center = False;
+ setNumCols(aNumCols);
+}
+
+// SET: Moved here to allow changes from sub-classes
+void TListViewer::setNumCols(int aNumCols)
+{
+ int arStep,pgStep;
+
+ numCols=aNumCols;
+ // Compute the scroll bar changes.
+ if (vScrollBar!=0)
+ {
+ if (numCols==1)
+ {
+ pgStep=size.y-1;
+ arStep=1;
+ }
+ else
+ {
+ pgStep=size.y*numCols;
+ arStep=size.y;
+ }
+ vScrollBar->setStep(pgStep,arStep);
+ }
+ if (hScrollBar)
+ hScrollBar->setStep(size.x/numCols,1);
+}
+
+void TListViewer::changeBounds( const TRect& bounds )
+{
+ TView::changeBounds( bounds );
+ if( hScrollBar != 0 )
+ hScrollBar->setStep( size.x / numCols, 1 );
+}
+
+void TListViewer::draw()
+{
+ short i, j;
+ ccIndex item;
+ ushort normalColor, selectedColor, focusedColor=0, color;
+ short colWidth, curCol, indent;
+ TDrawBuffer b;
+ uchar scOff;
+
+ if( (state&(sfSelected | sfActive)) == (sfSelected | sfActive))
+ {
+ normalColor = getColor(1);
+ focusedColor = getColor(3);
+ selectedColor = getColor(4);
+ }
+ else
+ {
+ normalColor = getColor(2);
+ selectedColor = getColor(4);
+ }
+
+ if( hScrollBar != 0 )
+ indent = hScrollBar->value;
+ else
+ indent = 0;
+
+ colWidth = size.x / numCols + 1;
+ for( i = 0; i < size.y; i++ )
+ {
+ for( j = 0; j < numCols; j++ )
+ {
+ int width;;
+ item = j * size.y + i + topItem;
+ curCol = j * colWidth;
+ if (j == numCols-1) width = size.x - curCol + 1;
+ else width = colWidth;
+ if( (state & (sfSelected | sfActive)) == (sfSelected | sfActive) &&
+ focused == item &&
+ range > 0)
+ {
+ color = focusedColor;
+ setCursor( curCol + 1, i );
+ scOff = 0;
+ }
+ else if( item < range && isSelected(item) )
+ {
+ color = selectedColor;
+ scOff = 2;
+ }
+ else
+ {
+ color = normalColor;
+ scOff = 4;
+ }
+
+ b.moveChar( curCol, ' ', color, width );
+ if( item < range )
+ {
+ // This was probably the
+ // reason for a bug, because
+ // getText assumes a buffer
+ // with a length of maxLen + 1
+ AllocLocalStr(text,width+indent+1);
+ AllocLocalStr(buf,width+1);
+ getText( text, item, width + indent );
+ int tl = strlen(text);
+ if (tl <= indent)
+ buf[0] = 0;
+ else
+ {
+ memcpy( buf, text+indent, width );
+ buf[tl-indent] = EOS;
+ }
+ b.moveStr( curCol+1, buf, color );
+ if( showMarkers )
+ {
+ b.putChar( curCol, specialChars[scOff] );
+ b.putChar( curCol+width-2, specialChars[scOff+1] );
+ }
+ }
+ else if( i == 0 && j == 0 )
+ b.moveStr( curCol+1, _("<empty>"), getColor(1) );
+
+ // It was a really nasty thing, this call used 179 instead of
+ // a configurable value like now.
+ b.moveChar( curCol+width-1, columnSeparator, getColor(5), 1 );
+ }
+ writeLine( 0, i, size.x, 1, b );
+ }
+}
+
+void TListViewer::focusItem( ccIndex item )
+{
+ focused = item;
+
+ if( item < topItem )
+ {
+ if( numCols == 1 )
+ topItem = item;
+ else
+ topItem = item - item % size.y;
+ }
+ else
+ {
+ if( item >= topItem + size.y*numCols )
+ {
+ if( numCols == 1 )
+ topItem = item - size.y + 1;
+ else
+ topItem = item - item % size.y - (size.y * (numCols-1));
+ }
+ }
+ if( vScrollBar != 0 )
+ vScrollBar->setValue( item );
+ else
+ drawView();
+ if (owner && (options & ofBeVerbose))
+ message(owner,evBroadcast,cmListItemFocused,this);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ That's a variant of focusItem that tries to center the focused item when
+the list have only one column.
+
+***************************************************************************/
+
+void TListViewer::focusItemCentered( ccIndex item )
+{
+ if( numCols != 1 )
+ {
+ focusItem( item );
+ return;
+ }
+ center = True;
+ focused = item;
+
+ if( item < topItem )
+ {
+ topItem = item - size.y/2;
+ if( topItem < 0)
+ topItem = 0;
+ }
+ else
+ {
+ if( item >= topItem + size.y*numCols )
+ {
+ topItem = item - size.y/2;
+ if( topItem + size.y >= range && range > size.y)
+ topItem = range - size.y;
+ }
+ }
+ if( vScrollBar != 0 )
+ vScrollBar->setValue( item );
+ else
+ drawView();
+ if (owner && (options & ofBeVerbose))
+ message(owner,evBroadcast,cmListItemFocused,this);
+ center = False;
+}
+
+void TListViewer::focusItemNum( ccIndex item )
+{
+ if( item < 0 )
+ item = 0;
+ else
+ if( item >= range && range > 0 )
+ item = range - 1;
+
+ if( range != 0 )
+ {
+ if( center )
+ focusItemCentered( item );
+ else
+ focusItem( item );
+ }
+}
+
+TPalette& TListViewer::getPalette() const
+{
+ static TPalette palette( cpListViewer, sizeof( cpListViewer )-1 );
+ return palette;
+}
+
+void TListViewer::getText( char *dest, ccIndex, short )
+{
+ *dest = EOS;
+}
+
+Boolean TListViewer::isSelected( ccIndex item )
+{
+ return Boolean( item == focused );
+}
+
+void TListViewer::handleEvent( TEvent& event )
+{
+ TPoint mouse;
+ ushort colWidth;
+ ccIndex oldItem, newItem;
+ ushort count;
+ int mouseAutosToSkip = 4;
+
+ TView::handleEvent(event);
+
+ if( event.what == evMouseDown )
+ {
+ // They must be before doubleClick to avoid "b4 double click"
+ if( event.mouse.buttons == mbButton4 )
+ {
+ focusItemNum(focused - size.y * numCols);
+ clearEvent( event );
+ return;
+ }
+ if( event.mouse.buttons == mbButton5 )
+ {
+ focusItemNum(focused + size.y * numCols);
+ clearEvent( event );
+ return;
+ }
+ if( event.mouse.doubleClick && range > focused )
+ {
+ selectItem( focused );
+ clearEvent( event );
+ return;
+ }
+ colWidth = size.x / numCols + 1;
+ oldItem = focused;
+ mouse = makeLocal( event.mouse.where );
+ newItem = mouse.y + (size.y * (mouse.x / colWidth)) + topItem;
+ count = 0;
+ do {
+ if( newItem != oldItem )
+ focusItemNum( newItem );
+ oldItem = newItem;
+ mouse = makeLocal( event.mouse.where );
+ if( mouseInView( event.mouse.where ) )
+ newItem = mouse.y + (size.y * (mouse.x / colWidth)) + topItem;
+ else
+ {
+ if( numCols == 1 )
+ {
+ if( event.what == evMouseAuto )
+ count++;
+ if( count == mouseAutosToSkip )
+ {
+ count = 0;
+ if( mouse.y < 0 )
+ newItem = focused - 1;
+ else
+ if( mouse.y >= size.y )
+ newItem = focused + 1;
+ }
+ }
+ else
+ {
+ if( event.what == evMouseAuto )
+ count++;
+ if( count == mouseAutosToSkip )
+ {
+ count = 0;
+ if( mouse.x < 0 )
+ newItem = focused - size.y;
+ else if( mouse.x >= size.x )
+ newItem = focused + size.y;
+ else if( mouse.y < 0 )
+ newItem = focused - focused % size.y;
+ else if( mouse.y > size.y )
+ newItem = focused - focused % size.y + size.y - 1;
+ }
+ }
+ }
+ } while( mouseEvent( event, evMouseMove | evMouseAuto ) );
+ focusItemNum( newItem );
+ if( event.mouse.doubleClick && range > focused )
+ selectItem( focused );
+ clearEvent( event );
+ }
+ else if( event.what == evKeyDown )
+ {
+ if ((handleSpace == True) &&
+ (event.keyDown.charScan.charCode == ' ') && focused < range )
+ {
+ selectItem( focused );
+ newItem = focused;
+ }
+ else
+ {
+ switch (ctrlToArrow(event.keyDown.keyCode))
+ {
+ case kbUp:
+ newItem = focused - 1;
+ break;
+ case kbDown:
+ newItem = focused + 1;
+ break;
+ case kbRight:
+ if( numCols > 1 )
+ newItem = focused + size.y;
+ else
+ { // SET: if the user put a scroll bar with one column
+ // that's what he wants
+ if (hScrollBar) hScrollBar->handleEvent(event);
+ return;
+ }
+ break;
+ case kbLeft:
+ if( numCols > 1 )
+ newItem = focused - size.y;
+ else
+ { // SET: see kbRight
+ if (hScrollBar) hScrollBar->handleEvent(event);
+ return;
+ }
+ break;
+ case kbPgDn:
+ newItem = focused + size.y * numCols;
+ break;
+ case kbPgUp:
+ newItem = focused - size.y * numCols;
+ break;
+ case kbHome:
+ newItem = topItem;
+ break;
+ case kbEnd:
+ newItem = topItem + (size.y * numCols) - 1;
+ break;
+ case kbCtrlPgDn:
+ newItem = range - 1;
+ break;
+ case kbCtrlPgUp:
+ newItem = 0;
+ break;
+ default:
+ return;
+ }
+ focusItemNum(newItem);
+ }
+ clearEvent(event);
+ }
+ else if( event.what == evBroadcast )
+ {
+ if( (options & ofSelectable) != 0 )
+ {
+ if( event.message.command == cmScrollBarClicked &&
+ ( event.message.infoPtr == hScrollBar ||
+ event.message.infoPtr == vScrollBar ) )
+ select();
+ else if( event.message.command == cmScrollBarChanged )
+ {
+ if( vScrollBar == event.message.infoPtr )
+ {
+ focusItemNum( vScrollBar->value );
+ drawView();
+ }
+ else if( hScrollBar == event.message.infoPtr )
+ drawView();
+ }
+ }
+ }
+}
+
+void TListViewer::selectItem( ccIndex )
+{
+ message( owner, evBroadcast, cmListItemSelected, this );
+}
+
+void TListViewer::setRange( ccIndex aRange )
+{
+ range = aRange;
+ if (focused >= aRange)
+ focused = (aRange - 1 >= 0) ? aRange - 1 : 0;
+ if( vScrollBar != 0 )
+ {
+ vScrollBar->setParams( focused,
+ 0,
+ aRange - 1,
+ vScrollBar->pgStep,
+ vScrollBar->arStep
+ );
+ }
+ else
+ drawView();
+}
+
+void TListViewer::setState( ushort aState, Boolean enable)
+{
+ TView::setState( aState, enable );
+ if( (aState & (sfSelected | sfActive)) != 0 )
+ {
+ if( hScrollBar != 0 )
+ {
+ if( getState(sfActive) )
+ hScrollBar->show();
+ else
+ hScrollBar->hide();
+ }
+ if( vScrollBar != 0 )
+ {
+ if( getState(sfActive) )
+ vScrollBar->show();
+ else
+ vScrollBar->hide();
+ }
+ drawView();
+ }
+}
+
+void TListViewer::shutDown()
+{
+ hScrollBar = 0;
+ vScrollBar = 0;
+ TView::shutDown();
+}
+
+#if !defined( NO_STREAM )
+void TListViewer::write( opstream& os )
+{
+ TView::write( os );
+ os << hScrollBar << vScrollBar << numCols
+ << topItem << focused << range;
+}
+
+void *TListViewer::read( ipstream& is )
+{
+ TView::read( is );
+ is >> hScrollBar >> vScrollBar >> numCols
+ >> topItem >> focused >> range;
+ return this;
+}
+
+TStreamable *TListViewer::build()
+{
+ return new TListViewer( streamableInit );
+}
+
+TListViewer::TListViewer( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tlookupv.cc b/tvision/classes/tlookupv.cc
new file mode 100644
index 0000000..96dc3e8
--- /dev/null
+++ b/tvision/classes/tlookupv.cc
@@ -0,0 +1,110 @@
+/*------------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Salvador E. Tropea. Covered by the GPL license.
+ * * Change NO_STREAM usage.
+ * * Fixed missing explicit base class initialization.
+ * * Changed 0 to NULL.
+ * * Added headers request.
+ */
+
+#define Uses_string
+#define Uses_TStringLookupValidator
+#define Uses_MsgBox
+#include <tv.h>
+
+// TLookupValidator
+
+Boolean TLookupValidator::isValid(const char* s)
+{
+ return lookup(s);
+}
+
+Boolean TLookupValidator::lookup(const char* s)
+{
+ return True;
+}
+
+#if !defined(NO_STREAM)
+TStreamable * TLookupValidator::build()
+{
+ return (TStreamable *) new TLookupValidator(streamableInit);
+}
+
+TLookupValidator::TLookupValidator( StreamableInit s ) : TValidator(s)
+{
+}
+#endif // NO_STREAM
+
+// TStringLookupValidator
+
+TStringLookupValidator::TStringLookupValidator(TStringCollection* aStrings) :
+ TLookupValidator()
+{
+ strings = aStrings;
+}
+
+TStringLookupValidator::~TStringLookupValidator()
+{
+ newStringList(NULL);
+}
+
+const char * TStringLookupValidator::errorMsg = __("Input is not in list of valid strings");
+
+void TStringLookupValidator::error()
+{
+ messageBox(mfError | mfOKButton, errorMsg);
+}
+
+static Boolean stringMatch(void* a1, void* a2)
+{
+ return Boolean(strcmp((const char*)a1, (const char*)a2) == 0);
+}
+
+
+Boolean TStringLookupValidator::lookup(const char* s)
+{
+ return Boolean(strings->firstThat(stringMatch,(void*)s) != 0);
+}
+
+// Attention!!! the collection is deleted, NOT destroyed.
+void TStringLookupValidator::newStringList(TStringCollection* aStrings)
+{
+ if (strings)
+ delete strings;
+
+ strings = aStrings;
+}
+
+#if !defined(NO_STREAM)
+void TStringLookupValidator::write( opstream& os )
+{
+ TLookupValidator::write( os );
+ os << strings;
+}
+
+void* TStringLookupValidator::read( ipstream& is )
+{
+ TLookupValidator::read(is);
+ is >> strings;
+
+ return this;
+}
+
+TStreamable * TStringLookupValidator::build()
+{
+ return (TStreamable *) new TStringLookupValidator(streamableInit);
+}
+
+TStringLookupValidator::TStringLookupValidator( StreamableInit s ) :
+ TLookupValidator(s)
+{
+}
+#endif // NO_STREAM
+
+
+
diff --git a/tvision/classes/tmemo.cc b/tvision/classes/tmemo.cc
new file mode 100644
index 0000000..00ede46
--- /dev/null
+++ b/tvision/classes/tmemo.cc
@@ -0,0 +1,105 @@
+/* Modified by Robert Hoehne and Salvador Eduardo Tropea for the gcc port */
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*----------------------------------------------------------*/
+/*****************************************************************************
+
+ Be careful, I think we never really tested this class. In fact I modified
+the size of the memo structure because the old code uses 4Gb ;-)
+
+*****************************************************************************/
+
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TEditor
+#define Uses_TMemo
+#define Uses_TEvent
+#define Uses_opstream
+#define Uses_ipstream
+#include <tv.h>
+
+#define cpMemo "\x1A\x1B"
+
+TMemo::TMemo( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ TIndicator *aIndicator,
+ uint32 aBufSize ) :
+ TEditor( bounds, aHScrollBar, aVScrollBar, aIndicator, aBufSize )
+{
+}
+
+uint32 TMemo::dataSize()
+{
+ return bufSize + sizeof( ushort );
+}
+
+void TMemo::getData( void *rec )
+{
+ TMemoData *data = (TMemoData *)rec;
+
+ data->length = bufLen;
+ memcpy(data->buffer, buffer, curPtr);
+ memcpy(&data->buffer[curPtr], buffer+(curPtr + gapLen), bufLen - curPtr);
+ memset(&data->buffer[bufLen], 0, bufSize - bufLen);
+}
+
+void TMemo::setData( void *rec )
+{
+ TMemoData *data = (TMemoData *)rec;
+
+ memcpy(&buffer[bufSize - data->length], data->buffer, data->length);
+ setBufLen(data->length);
+}
+
+TPalette& TMemo::getPalette() const
+{
+ static TPalette palette( cpMemo, sizeof( cpMemo )-1 );
+ return palette;
+}
+
+void TMemo::handleEvent( TEvent& event )
+{
+ if( event.what != evKeyDown || event.keyDown.keyCode != kbTab )
+ TEditor::handleEvent(event);
+}
+
+#ifndef NO_STREAM
+
+void TMemo::write( opstream& os )
+{
+ TEditor::write( os );
+ os << bufLen;
+ os.writeBytes( buffer, curPtr );
+ os.writeBytes( buffer + gapLen, bufLen - curPtr );
+}
+
+void *TMemo::read( ipstream& is )
+{
+ TEditor::read( is );
+ uint32 length;
+ is >> length;
+ if( isValid )
+ {
+ is.readBytes( buffer + bufSize - length, length );
+ setBufLen( length );
+ }
+ else
+ is.seekg( is.tellg() + CLY_StreamPosT(length) );
+ return this;
+}
+
+TStreamable *TMemo::build()
+{
+ return new TMemo( streamableInit );
+}
+
+TMemo::TMemo( StreamableInit ) : TEditor( streamableInit )
+{
+}
+
+#endif // #ifndef NO_STREAM
diff --git a/tvision/classes/tmenubar.cc b/tvision/classes/tmenubar.cc
new file mode 100644
index 0000000..5709a1e
--- /dev/null
+++ b/tvision/classes/tmenubar.cc
@@ -0,0 +1,190 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea. [Also added i18n support].
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TMenuBar
+#define Uses_TDrawBuffer
+#define Uses_TMenu
+#define Uses_TMenuItem
+#define Uses_TRect
+#define Uses_TSubMenu
+#define Uses_TScreen
+#include <tv.h>
+
+TMenuBar::TMenuBar( const TRect& bounds, TMenu *aMenu ) :
+ TMenuView( bounds )
+{
+ menu = aMenu;
+ growMode = gfGrowHiX;
+ options |= ofPreProcess;
+ computeLength();
+ // This class can be "Braille friendly"
+ if (TScreen::getShowCursorEver())
+ state |= sfCursorVis;
+}
+
+TMenuBar::TMenuBar( const TRect& bounds, TSubMenu& aMenu ) :
+ TMenuView( bounds )
+{
+ menu = new TMenu( aMenu );
+ growMode = gfGrowHiX;
+ options |= ofPreProcess;
+ computeLength();
+ // This class can be "Braille friendly"
+ if (TScreen::getShowCursorEver())
+ state |= sfCursorVis;
+}
+
+
+TMenuBar::~TMenuBar()
+{
+ delete(menu);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ This routine computes the length of the menu bar, if that's greater than
+the size.x the menu becomes compacted to allow more options.@*
+ Added by SET.
+
+***************************************************************************/
+
+void TMenuBar::computeLength()
+{
+ int l = 0;
+ TMenuItem *p;
+
+ if( menu != 0 )
+ {
+ p = menu->items;
+ while( p != 0 )
+ {
+ if( p->name != 0 )
+ l += cstrlen(TVIntl::getText(p->name,p->intlName)) + 2;
+ p = p->next;
+ }
+ }
+ compactMenu = l > size.x;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Calls TMenuView::changeBounds, additionally re-computes the length of the
+bar to select the no/compact mode.@*
+ Added by SET.
+
+***************************************************************************/
+
+void TMenuBar::changeBounds(const TRect& bounds)
+{
+ TMenuView::changeBounds(bounds);
+ int oldCompact=compactMenu;
+ computeLength();
+ if (compactMenu!=oldCompact)
+ draw();
+}
+
+void TMenuBar::draw()
+{
+ ushort color;
+ int x, l, inc, xSel=-1;
+ TMenuItem *p;
+ TDrawBuffer b;
+
+ ushort cNormal = getColor(0x0301);
+ ushort cSelect = getColor(0x0604);
+ ushort cNormDisabled = getColor(0x0202);
+ ushort cSelDisabled = getColor(0x0505);
+ b.moveChar( 0, ' ', cNormal, size.x );
+ inc = (compactMenu ? 1 : 2); // SET
+ if( menu != 0 )
+ {
+ x = 0;
+ p = menu->items;
+ while( p != 0 )
+ {
+ if( p->name != 0 )
+ {
+ l = cstrlen(TVIntl::getText(p->name,p->intlName));
+ if( x + l < size.x )
+ {
+ if( p->disabled )
+ if( p == current )
+ {
+ xSel = x;
+ color = cSelDisabled;
+ }
+ else
+ color = cNormDisabled;
+ else
+ if( p == current )
+ {
+ xSel = x;
+ color = cSelect;
+ }
+ else
+ color = cNormal;
+
+ b.moveChar( x, ' ', color, 1 );
+ b.moveCStr( x+1, TVIntl::getText(p->name,p->intlName), color );
+ b.moveChar( x+l+1, ' ', color, 1 );
+ }
+ x += l + inc;
+ }
+ p = p->next;
+ }
+ }
+ writeBuf( 0, 0, size.x, 1, b );
+ if( xSel != -1 )
+ {
+ setCursor( xSel , 0 );
+ resetCursor();
+ }
+}
+
+TRect TMenuBar::getItemRect( TMenuItem *item )
+{
+ int y = compactMenu ? 1 : 0; // SET
+ TRect r( y, 0, y, 1 );
+ y = compactMenu ? 1 : 2; // SET
+ TMenuItem *p = menu->items;
+ while( p )
+ {
+ r.a.x = r.b.x;
+ if( p->name != 0 )
+ r.b.x += cstrlen(TVIntl::getText(p->name,p->intlName)) + y;
+ if( p == item )
+ return r;
+ p = p->next;
+ }
+ return TRect(0, 0, 0, 0); // SAA: should not ever happen
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TMenuBar::build()
+{
+ return new TMenuBar( streamableInit );
+}
+
+TMenuBar::TMenuBar( StreamableInit ) : TMenuView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tmenubox.cc b/tvision/classes/tmenubox.cc
new file mode 100644
index 0000000..a5cb511
--- /dev/null
+++ b/tvision/classes/tmenubox.cc
@@ -0,0 +1,164 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea. [also added i18n support]
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TRect
+#define Uses_TMenu
+#define Uses_TMenuItem
+#define Uses_TMenuBox
+#define Uses_TScreen // getShowCursorEver()
+#include <tv.h>
+
+static TRect getRect( const TRect& bounds, TMenu *aMenu )
+{
+ short w = 10;
+ short h = 2;
+ if( aMenu != 0 )
+ {
+ for( TMenuItem *p = aMenu->items; p != 0; p = p->next )
+ {
+ if( p->name != 0 )
+ {
+ short l = cstrlen(TVIntl::getText(p->name,p->intlName)) + 6;
+ if( p->command == 0 )
+ l += 3;
+ else
+ if( p->param != 0 )
+ l += cstrlen(p->param) + 2;
+ w = max( l, w );
+ }
+ h++;
+ }
+ }
+
+ TRect r( bounds );
+
+ if( r.a.x + w < r.b.x )
+ r.b.x = r.a.x + w;
+ else
+ r.a.x = r.b.x - w;
+
+ if (r.a.y + h < r.b.y)
+ r.b.y = r.a.y + h;
+ else
+ r.a.y = r.b.y - h;
+ return r;
+}
+
+TMenuBox::TMenuBox( const TRect& bounds,
+ TMenu *aMenu,
+ TMenuView *aParentMenu) :
+ TMenuView( getRect( bounds, aMenu ), aMenu, aParentMenu )
+{
+ state |= sfShadow;
+ // This class can be "Braille friendly"
+ if (TScreen::getShowCursorEver())
+ state |= sfCursorVis;
+ options |= ofPreProcess;
+}
+
+static ushort cNormal, color;
+
+void TMenuBox::frameLine( TDrawBuffer& b, short n )
+{
+ b.moveBuf( 0, &frameChars[n], cNormal, 2 );
+ b.moveChar( 2, frameChars[n+2], color, size.x - 4 );
+ b.moveBuf( size.x-2, &frameChars[n+3], cNormal, 2 );
+}
+
+void TMenuBox::draw()
+{
+ TDrawBuffer b;
+
+ cNormal = getColor(0x0301);
+ ushort cSelect = getColor(0x0604);
+ ushort cNormDisabled = getColor(0x0202);
+ ushort cSelDisabled = getColor(0x0505);
+ int y=0, yCur=-1;
+ color = cNormal;
+ frameLine( b, 0 );
+ writeBuf( 0, y++, size.x, 1, b );
+ if( menu != 0 )
+ {
+ for( TMenuItem *p = menu->items; p != 0; p = p->next )
+ {
+ color = cNormal;
+ if( p->name == 0 )
+ frameLine( b, 15 );
+ else
+ {
+ if( p->disabled )
+ if( p == current )
+ {
+ color = cSelDisabled;
+ yCur = y;
+ }
+ else
+ color = cNormDisabled;
+ else if( p == current )
+ {
+ color = cSelect;
+ yCur = y;
+ }
+ frameLine( b, 10 );
+ b.moveCStr( 3, TVIntl::getText(p->name,p->intlName), color );
+ if( p->command == 0 )
+ b.putChar( size.x-4, rightArrow );
+ else if( p->param != 0 )
+ b.moveStr( size.x-3-strlen(p->param),
+ p->param,
+ color);
+ }
+ writeBuf( 0, y++, size.x, 1, b );
+ }
+ }
+ color = cNormal;
+ frameLine( b, 5 );
+ writeBuf( 0, y++, size.x, 1, b );
+ // SET: Force a cursor movement to indicate which one is selected.
+ // This helps Braille Terminals, but the cursor must be visible!
+ if( yCur != -1 )
+ {
+ setCursor( 2 , yCur );
+ resetCursor();
+ }
+}
+
+TRect TMenuBox::getItemRect( TMenuItem *item )
+{
+ short y = 1;
+ TMenuItem *p = menu->items;
+
+ while( p != item )
+ {
+ y++;
+ p = p->next;
+ }
+ return TRect( 2, y, size.x-2, y+1 );
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TMenuBox::build()
+{
+ return new TMenuBox( streamableInit );
+}
+
+TMenuBox::TMenuBox( StreamableInit ) : TMenuView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tmenuvie.cc b/tvision/classes/tmenuvie.cc
new file mode 100644
index 0000000..20af538
--- /dev/null
+++ b/tvision/classes/tmenuvie.cc
@@ -0,0 +1,650 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to support i18n.
+Added TMenuItem::append by Salvador E. Tropea.
+Modified the behavior of short-cuts when Alt is not/pressed by SET.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <assert.h>
+#define Uses_string
+
+#define Uses_stdio // just for debug
+
+#define Uses_TMenuItem
+#define Uses_TMenu
+#define Uses_TMenuView
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TGroup
+#define Uses_TMenuBox
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#define Uses_TGKey
+#define Uses_TVCodePage
+#include <tv.h>
+
+#define cpMenuView "\x02\x03\x04\x05\x06\x07"
+
+TMenuItem::TMenuItem( const char *aName,
+ ushort aCommand,
+ ushort aKeyCode,
+ ushort aHelpCtx,
+ const char *p,
+ TMenuItem *aNext
+ )
+{
+ name = newStr( aName );
+ intlName = NULL;
+ command = aCommand;
+ disabled = Boolean(!TView::commandEnabled(command));
+ keyCode = aKeyCode;
+ helpCtx = aHelpCtx;
+ if( p == NULL )
+ param = NULL;
+ else
+ param = newStr( p );
+ next = aNext;
+}
+
+TMenuItem::TMenuItem( const char *aName,
+ ushort aKeyCode,
+ TMenu *aSubMenu,
+ ushort aHelpCtx,
+ TMenuItem *aNext
+ )
+{
+ name = newStr( aName );
+ intlName = NULL;
+ command = 0;
+ disabled = Boolean(!TView::commandEnabled(command));
+ keyCode = aKeyCode;
+ helpCtx = aHelpCtx;
+ subMenu = aSubMenu;
+ next = aNext;
+}
+
+TMenuItem::~TMenuItem()
+{
+ DeleteArray((char *)name);
+ TVIntl::freeSt( intlName );
+ if( command == 0 )
+ delete(subMenu);
+ else
+ DeleteArray((char *)param);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Appends the provided TMenuItem at the end of the chain.@*
+ Coded by SET. That's a mix between Dean Wakerley and TVTools ideas.
+
+***************************************************************************/
+
+void TMenuItem::append( TMenuItem *aNext )
+{
+ TMenuItem *item = this;
+ for ( ; item->next; item = item->next );
+ item->next = aNext;
+}
+
+TMenu::~TMenu()
+{
+ while( items != 0 )
+ {
+ TMenuItem *temp = items;
+ items = items->next;
+ delete(temp);
+ }
+}
+
+void TMenuView::trackMouse( TEvent& e )
+{
+ TPoint mouse = makeLocal( e.mouse.where );
+ for( current = menu->items; current != 0; current = current->next )
+ {
+ TRect r = getItemRect( current );
+ if( r.contains(mouse) )
+ return;
+ }
+}
+
+void TMenuView::nextItem()
+{
+ if( (current = current->next) == 0 )
+ current = menu->items;
+}
+
+void TMenuView::prevItem()
+{
+ TMenuItem *p;
+
+ if( (p = current) == menu->items)
+ p = 0;
+
+ do {
+ nextItem();
+ } while( current->next != p );
+}
+
+void TMenuView::trackKey( Boolean findNext )
+{
+ if( current == 0 )
+ return;
+
+ do {
+ if( findNext )
+ nextItem();
+ else
+ prevItem();
+ } while( current->name == 0 );
+}
+
+Boolean TMenuView::mouseInOwner( TEvent& e )
+{
+ if( parentMenu == 0 || parentMenu->size.y != 1 )
+ return False;
+ else
+ {
+ TPoint mouse = parentMenu->makeLocal( e.mouse.where );
+ TRect r = parentMenu->getItemRect( parentMenu->current );
+ return r.contains( mouse );
+ }
+}
+
+Boolean TMenuView::mouseInMenus( TEvent& e )
+{
+ TMenuView *p = parentMenu;
+ while( p != 0 && !p->mouseInView(e.mouse.where) )
+ p = p->parentMenu;
+
+ return Boolean( p != 0 );
+}
+
+TMenuView *TMenuView::topMenu()
+{
+ TMenuView *p = this;
+ while( p->parentMenu != 0 )
+ p = p->parentMenu;
+ return p;
+}
+
+enum menuAction { doNothing, doSelect, doReturn };
+
+ushort TMenuView::execute()
+{
+ Boolean autoSelect = False;
+ menuAction action;
+ char ch;
+ int withAlt;
+ ushort result = 0;
+ TMenuItem *itemShown = 0;
+ TMenuItem *p;
+ TMenuView *target;
+ TRect r;
+ TEvent e;
+
+ current = menu->deflt;
+ do {
+ action = doNothing;
+ getEvent(e);
+ switch (e.what)
+ {
+ case evMouseDown:
+ if( mouseInView(e.mouse.where) || mouseInOwner(e) )
+ {
+ trackMouse(e);
+ if( size.y == 1 )
+ autoSelect = True;
+ }
+ else
+ action = doReturn;
+ break;
+ case evMouseUp:
+ trackMouse(e);
+ if( mouseInOwner(e) )
+ current = menu->deflt;
+ else if( current != 0 && current->name != 0 )
+ action = doSelect;
+ else
+ action = doReturn;
+ break;
+ case evMouseMove:
+ if( e.mouse.buttons != 0 )
+ {
+ trackMouse(e);
+ if( !(mouseInView(e.mouse.where) || mouseInOwner(e)) &&
+ mouseInMenus(e) )
+ action = doReturn;
+ }
+ break;
+ case evKeyDown:
+ switch( ctrlToArrow(e.keyDown.keyCode) )
+ {
+ case kbUp:
+ case kbDown:
+ if( size.y != 1 )
+ trackKey(Boolean(ctrlToArrow(e.keyDown.keyCode) == kbDown));
+ else if( e.keyDown.keyCode == kbDown )
+ autoSelect = True;
+ break;
+ case kbLeft:
+ case kbRight:
+ if( parentMenu == 0 )
+ trackKey(Boolean(ctrlToArrow(e.keyDown.keyCode) == kbRight));
+ else
+ action = doReturn;
+ break;
+ case kbHome:
+ case kbEnd:
+ if( size.y != 1 )
+ {
+ current = menu->items;
+ if( e.keyDown.keyCode == kbEnd )
+ trackKey(False);
+ }
+ break;
+ case kbEnter:
+ if( size.y == 1 )
+ autoSelect = True;
+ action = doSelect;
+ break;
+ case kbEsc:
+ action = doReturn;
+ if( parentMenu == 0 || parentMenu->size.y != 1 )
+ clearEvent(e);
+ break;
+ default:
+ target = this;
+ ch = TGKey::GetAltChar(e.keyDown.keyCode,
+ e.keyDown.charScan.charCode);
+ withAlt = e.keyDown.keyCode & (kbAltRCode | kbAltLCode);
+ if( ch == 0 )
+ ch = e.keyDown.charScan.charCode;
+ if( withAlt )
+ {// SET: Original behavior
+ if( ch )
+ target = topMenu();
+ p = target->findItem(ch);
+ }
+ else
+ {// SET: without alt pressed, look here.
+ // Robert did it unconditionaly, but using Alt state
+ // is better.
+ p = target->findItem(ch);
+ if( p == 0 )
+ {
+ // and now in the main menu
+ target = topMenu();
+ p = target->findItem(ch);
+ }
+ }
+ if( p == 0 )
+ {
+ p = topMenu()->hotKey(e.keyDown.keyCode);
+ if( p != 0 && commandEnabled(p->command) )
+ {
+ result = p->command;
+ action = doReturn;
+ }
+ }
+ else if( target == this )
+ {
+ if( size.y == 1 )
+ autoSelect = True;
+ action = doSelect;
+ current = p;
+ }
+ else if( parentMenu != target ||
+ parentMenu->current != p )
+ action = doReturn;
+ }
+ break;
+ case evCommand:
+ if( e.message.command == cmMenu )
+ {
+ autoSelect = False;
+ if (parentMenu != 0 )
+ action = doReturn;
+ }
+ else
+ action = doReturn;
+ break;
+ }
+
+ if( itemShown != current )
+ {
+ itemShown = current;
+ drawView();
+ }
+
+ if( (action == doSelect || (action == doNothing && autoSelect)) &&
+ current != 0 &&
+ current->name != 0 )
+ {
+ if( current->command == 0 )
+ {
+ if( (e.what & (evMouseDown | evMouseMove)) != 0 )
+ putEvent(e);
+ r = getItemRect( current );
+ r.a.x = r.a.x + origin.x;
+ r.a.y = r.b.y + origin.y;
+ r.b = owner->size;
+ if( compactMenu && size.y == 1 ) // SET
+ r.a.x--;
+ target = topMenu()->newSubView(r, current->subMenu,this);
+ result = owner->execView(target);
+ CLY_destroy( target );
+ }
+ else if( action == doSelect )
+ result = current->command;
+ }
+
+ if( result != 0 && commandEnabled(result) )
+ {
+ action = doReturn;
+ clearEvent(e);
+ }
+ else
+ result = 0;
+ } while( action != doReturn );
+
+ if( e.what != evNothing &&
+ (parentMenu != 0 || e.what == evCommand))
+ putEvent(e);
+ if( current != 0 )
+ {
+ menu->deflt = current;
+ current = 0;
+ drawView();
+ }
+ return result;
+}
+
+TMenuItem *TMenuView::findItem( char ch )
+{
+ if( !ch ) return 0;
+ ch = TVCodePage::toUpper(ch);
+ TMenuItem *p = menu->items;
+ while( p != 0 )
+ {
+ if( p->name != 0 && !p->disabled )
+ {
+ const char *loc = strchr( TVIntl::getText(p->name,p->intlName), '~' );
+ if( loc != 0 && TGKey::CompareASCII(ch,TVCodePage::toUpper(loc[1])) )
+ return p;
+ }
+ p = p->next;
+ }
+ return 0;
+}
+
+TRect TMenuView::getItemRect( TMenuItem * )
+{
+ return TRect( 0, 0, 0, 0 );
+}
+
+ushort TMenuView::getHelpCtx()
+{
+ TMenuView *c = this;
+
+ while( c != 0 &&
+ (c->current == 0 ||
+ c->current->helpCtx == hcNoContext ||
+ c->current->name == 0 )
+ )
+ c = c->parentMenu;
+
+ if( c != 0 )
+ return c->current->helpCtx;
+ else
+ return hcNoContext;
+}
+
+TPalette& TMenuView::getPalette() const
+{
+ static TPalette palette( cpMenuView, sizeof( cpMenuView )-1 );
+ return palette;
+}
+
+Boolean TMenuView::updateMenu( TMenu *menu )
+{
+ if (!menu) return False;
+ Boolean res = False;
+ for( TMenuItem *p = menu->items; p != 0; p = p->next )
+ {
+ if( p->name != 0 )
+ {
+ if( p->command == 0 )
+ {
+ if (updateMenu(p->subMenu) == True)
+ res = True;
+ }
+ else
+ {
+ Boolean commandState = commandEnabled(p->command);
+ if( p->disabled == commandState )
+ {
+ p->disabled = Boolean(!commandState);
+ res = True;
+ }
+ }
+ }
+ }
+ return res;
+}
+
+void TMenuView::do_a_select( TEvent& event )
+{
+ putEvent( event );
+ event.message.command = owner->execView(this);
+ if( event.message.command != 0 && commandEnabled(event.message.command) )
+ {
+ event.what = evCommand;
+ event.message.infoPtr = 0;
+ putEvent(event);
+ }
+ clearEvent(event);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This is the code to look-up an item from a key. Used by handleEvent.
+
+ Return: True if the item was found.
+
+***************************************************************************/
+
+Boolean TMenuView::keyToItem(TEvent &event)
+{
+ if (findItem(TGKey::GetAltChar(event.keyDown.keyCode,
+ event.keyDown.charScan.charCode)))
+ {
+ putEvent(event);
+ do_a_select(event);
+ return True;
+ }
+ return False;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This is the code to look-up a short cut from a key. Used by handleEvent.
+
+ Return: True if the item was found.
+
+***************************************************************************/
+
+Boolean TMenuView::keyToHotKey(TEvent &event)
+{
+ TMenuItem *p=hotKey(event.keyDown.keyCode);
+ if (p && commandEnabled(p->command))
+ {
+ event.what=evCommand;
+ event.message.command=p->command;
+ event.message.infoPtr=0;
+ putEvent(event);
+ clearEvent(event);
+ }
+ return p ? True : False;
+}
+
+void TMenuView::handleEvent( TEvent& event )
+{
+ if( menu != 0 )
+ switch (event.what)
+ {
+ case evMouseDown:
+ do_a_select(event);
+ break;
+ case evKeyDown:
+ if(! keyToItem(event) )
+ keyToHotKey(event);
+ break;
+ case evCommand:
+ if( event.message.command == cmMenu )
+ do_a_select(event);
+ break;
+ case evBroadcast:
+ if( event.message.command == cmCommandSetChanged )
+ {
+ if( updateMenu(menu) )
+ drawView();
+ }
+ break;
+ }
+}
+
+
+TMenuItem *TMenuView::findHotKey( TMenuItem *p, ushort keyCode )
+{
+
+ while( p != 0 )
+ {
+ if( p->name != 0 )
+ {
+ if( p->command == 0 )
+ {
+ TMenuItem *T;
+ if( (T = findHotKey( p->subMenu->items, keyCode )) != 0 )
+ return T;
+ }
+ else if( !p->disabled &&
+ p->keyCode != kbNoKey &&
+ p->keyCode == keyCode
+ )
+ return p;
+ }
+ p = p->next;
+ }
+ return 0;
+}
+
+TMenuItem *TMenuView::hotKey( ushort keyCode )
+{
+ return findHotKey( menu->items, keyCode );
+}
+
+TMenuView *TMenuView::newSubView( const TRect& bounds,
+ TMenu *aMenu,
+ TMenuView *aParentMenu
+ )
+{
+ return new TMenuBox( bounds, aMenu, aParentMenu );
+}
+
+#if !defined( NO_STREAM )
+void TMenuView::writeMenu( opstream& os, TMenu *menu )
+{
+ uchar tok = 0xFF;
+ for( TMenuItem *item = menu->items; item != 0; item = item->next )
+ {
+ os << tok;
+ os.writeString( item->name );
+ os << item->command << (short)(item->disabled)
+ << item->keyCode << item->helpCtx;
+ if( item->name != 0 )
+ {
+ if( item->command == 0 )
+ writeMenu( os, item->subMenu );
+ else
+ os.writeString( item->param );
+ }
+ }
+ tok = 0;
+ os << tok;
+}
+
+void TMenuView::write( opstream& os )
+{
+ TView::write( os );
+ writeMenu( os, menu );
+}
+
+TMenu *TMenuView::readMenu( ipstream& is )
+{
+ TMenu *menu = new TMenu;
+ TMenuItem **last = &(menu->items);
+ TMenuItem *item = 0;
+ uchar tok;
+ is >> tok;
+ while( tok != 0 )
+ {
+ assert( tok == 0xFF );
+ item = new TMenuItem( (const char *)NULL, 0, (TMenu *)NULL );
+ *last = item;
+ last = &(item->next);
+ item->name = is.readString();
+ item->intlName = NULL;
+ short temp;
+ is >> item->command >> temp
+ >> item->keyCode >> item->helpCtx;
+ item->disabled = Boolean( temp );
+ if( item->name != 0 )
+ {
+ if( item->command == 0 )
+ item->subMenu = readMenu( is );
+ else
+ item->param = is.readString();
+ }
+ is >> tok;
+ }
+ *last = 0;
+ menu->deflt = menu->items;
+ return menu;
+}
+
+void *TMenuView::read( ipstream& is )
+{
+ TView::read( is );
+ menu = readMenu( is );
+ parentMenu = 0;
+ current = 0;
+ return this;
+}
+
+TStreamable *TMenuView::build()
+{
+ return new TMenuView( streamableInit );
+}
+
+TMenuView::TMenuView( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tmonosel.cc b/tvision/classes/tmonosel.cc
new file mode 100644
index 0000000..8eb2162
--- /dev/null
+++ b/tvision/classes/tmonosel.cc
@@ -0,0 +1,91 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to compile for 64 bits architectures.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TMonoSelector
+#define Uses_TSItem
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TGroup
+#define Uses_TRect
+#define Uses_opstream
+#define Uses_ipstream
+#include <tv.h>
+
+const uchar monoColors[] = { 0x07, 0x0F, 0x01, 0x70, 0x09 };
+
+TMonoSelector::TMonoSelector( const TRect& bounds ) :
+ TCluster( bounds, new TSItem( _("Normal"),
+ new TSItem( _("Highlight"),
+ new TSItem( _("Underline"),
+ new TSItem( _("Inverse"), 0 )))))
+{
+ eventMask |= evBroadcast;
+}
+
+void TMonoSelector::draw()
+{
+ drawBox( button, 0x07 );
+}
+
+void TMonoSelector::handleEvent( TEvent& event )
+{
+ TCluster::handleEvent( event );
+ if( event.what == evBroadcast && event.message.command == cmColorSet )
+ {
+ value = event.message.infoLong;
+ drawView();
+ }
+}
+
+Boolean TMonoSelector::mark( int item )
+{
+ return Boolean(monoColors[item] == (uchar)value);
+}
+
+void TMonoSelector::newColor()
+{
+ message( owner, evBroadcast, cmColorForegroundChanged,
+ (void *)(uipointer)(value & 0x0F) );
+ message( owner, evBroadcast, cmColorBackgroundChanged,
+ (void *)(uipointer)((value >> 4) & 0x0F));
+}
+
+void TMonoSelector::press( int item )
+{
+ value = monoColors[item];
+ newColor();
+}
+
+void TMonoSelector::movedTo( int item )
+{
+ value = monoColors[item];
+ newColor();
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TMonoSelector::build()
+{
+ return new TMonoSelector( streamableInit );
+}
+
+TMonoSelector::TMonoSelector( StreamableInit ) : TCluster( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tmouse.cc b/tvision/classes/tmouse.cc
new file mode 100644
index 0000000..10db771
--- /dev/null
+++ b/tvision/classes/tmouse.cc
@@ -0,0 +1,27 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TEvent
+#include <tv.h>
+
+TMouse::TMouse()
+{
+ show();
+}
+
+TMouse::~TMouse()
+{
+ hide();
+}
+
+
diff --git a/tvision/classes/tnscolle.cc b/tvision/classes/tnscolle.cc
new file mode 100644
index 0000000..86a124a
--- /dev/null
+++ b/tvision/classes/tnscolle.cc
@@ -0,0 +1,235 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+Modified by Salvador E. Tropea (atReplace and other stuff)
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+#define Uses_abort
+#define Uses_TNSCollection
+#include <tv.h>
+
+TNSCollection::TNSCollection( ccIndex aLimit, ccIndex aDelta ) :
+ items( 0 ),
+ count( 0 ),
+ limit( 0 ),
+ delta( aDelta ),
+ shouldDelete( True )
+{
+ setLimit( aLimit );
+}
+
+TNSCollection::TNSCollection() :
+ items( 0 ),
+ count( 0 ),
+ limit( 0 ),
+ delta( 0 ),
+ shouldDelete( True )
+{
+ items = 0;
+}
+
+TNSCollection::~TNSCollection()
+{
+ delete[] items;
+}
+
+void TNSCollection::shutDown()
+{
+ if( shouldDelete )
+ freeAll();
+ else
+ count = 0;
+ setLimit(0);
+ TObject::shutDown();
+}
+
+void TNSCollection::atRemove( ccIndex index )
+{
+ if( index < 0 || index >= count )
+ error(1,0);
+
+ count--;
+ CLY_memcpy( &items[index], &items[index+1], (count-index)*sizeof(void *) );
+}
+
+void TNSCollection::atFree( ccIndex index )
+{
+ void *item = at( index ); // It could be: (*this)[index];
+ atRemove( index );
+ freeItem( item );
+}
+
+void TNSCollection::atInsert(ccIndex index, void *item)
+{
+ if( index < 0 )
+ error(1,0);
+ if( count == limit )
+ setLimit(count + delta);
+
+ memmove( &items[index+1], &items[index], (count-index)*sizeof(void *) );
+ count++;
+
+ items[index] = item;
+}
+
+void TNSCollection::atPut( ccIndex index, void *item )
+{
+ if( index >= count )
+ error(1,0);
+
+ items[index] = item;
+}
+
+// by SET
+void TNSCollection::atReplace( ccIndex index, void *item )
+{
+ freeItem( at( index ) );
+ atPut( index, item );
+}
+
+void TNSCollection::remove( void *item )
+{
+ atRemove( indexOf(item) );
+}
+
+void TNSCollection::removeAll()
+{
+ count = 0;
+}
+
+void TNSCollection::error( ccIndex /* code */, ccIndex )
+{
+#if 0
+ exit(212 - code);
+#else
+ abort();
+#endif
+}
+
+void *TNSCollection::firstThat( ccTestFunc Test, void *arg )
+{
+ for( ccIndex i = 0; i < count; i++ )
+ {
+ if( Test( items[i], arg ) == True )
+ return items[i];
+ }
+ return 0;
+}
+
+void *TNSCollection::lastThat( ccTestFunc Test, void *arg )
+{
+ for( ccIndex i = count; i > 0; i-- )
+ {
+ if( Test( items[i-1], arg ) == True )
+ return items[i-1];
+ }
+ return 0;
+}
+
+void TNSCollection::forEach( ccAppFunc action, void *arg )
+{
+ for( ccIndex i = 0; i < count; i++ )
+ action( items[i], arg );
+}
+
+// Avoid replacing free by MSS's macro
+#include <tv/no_mss.h>
+
+void TNSCollection::free( void *item )
+{
+ remove( item );
+ freeItem( item );
+}
+
+#include <tv/yes_mss.h>
+
+void TNSCollection::freeAll()
+{
+ for( ccIndex i = 0; i < count; i++ )
+ freeItem( at(i) );
+ count = 0;
+}
+
+void TNSCollection::freeItem( void *item )
+{
+ delete[] (char *)item;
+}
+
+ccIndex TNSCollection::indexOf(void *item)
+{
+ for( ccIndex i = 0; i < count; i++ )
+ if( item == items[i] )
+ return i;
+
+ error(1,0);
+ return -1;
+}
+
+ccIndex TNSCollection::insert( void *item )
+{
+ ccIndex loc = count;
+ atInsert( count, item );
+ return loc;
+}
+
+void TNSCollection::pack()
+{
+ if (count == 0) return;
+ void **curDst = items;
+ void **curSrc = items;
+ void **last = items + count;
+ while( curSrc < last )
+ {
+ if( *curSrc != 0 )
+ *curDst++ = *curSrc;
+ curSrc++;
+ }
+}
+
+void TNSCollection::setLimit(ccIndex aLimit)
+{
+ if( aLimit < count )
+ aLimit = count;
+ if( aLimit > maxCollectionSize)
+ aLimit = maxCollectionSize;
+ if( aLimit != limit )
+ {
+ void **aItems;
+ if (aLimit == 0 )
+ aItems = 0;
+ else
+ {
+ aItems = new void *[aLimit];
+ if( count != 0 && items )
+ memcpy( aItems, items, count*sizeof(void *) );
+ }
+ if (items)
+ delete[] items;
+ items = aItems;
+ limit = aLimit;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Just like at() but not inline and easier to call in some cases.
+
+***************************************************************************/
+
+void *TNSCollection::operator[](ccIndex i)
+{
+ if (i<0 || i>=count)
+ error(1,0);
+ return items[i];
+}
diff --git a/tvision/classes/tnssorte.cc b/tvision/classes/tnssorte.cc
new file mode 100644
index 0000000..6d43685
--- /dev/null
+++ b/tvision/classes/tnssorte.cc
@@ -0,0 +1,114 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TNSSortedCollection
+#include <tv.h>
+
+
+ccIndex TNSSortedCollection::indexOf(void *item)
+{
+ ccIndex i;
+
+ if( search( keyOf(item), i ) == 0 )
+ return ccNotFound;
+ else
+ {
+ if( duplicates )
+ {
+ while( i < count && item != items[i] )
+ i++;
+ }
+ if( i < count )
+ return i;
+ else
+ return ccNotFound;
+ }
+}
+
+ccIndex TNSSortedCollection::insert( void *item )
+{
+ ccIndex i;
+ if( search( keyOf(item), i ) == 0 || duplicates ) // order dependency!
+ atInsert( i, item ); // must do Search
+ // before calling
+ // AtInsert
+ return i;
+}
+
+void *TNSSortedCollection::keyOf( void *item )
+{
+ return item;
+}
+
+Boolean TNSSortedCollection::search( void *key, ccIndex& index )
+{
+ ccIndex l = 0;
+ ccIndex h = count - 1;
+ Boolean res = False;
+ // The following is good to avoid problems but have a huge draw-back:
+ // keys can't be 0. In some cases 0 *is* a valid key and in this case
+ // the search will be skipped producing nasty bugs.
+ //if ( !key ) return False;
+ while( l <= h )
+ {
+ ccIndex i = (l + h) >> 1;
+ ccIndex c = compare( keyOf( items[i] ), key );
+ if( c < 0 )
+ l = i + 1;
+ else
+ {
+ h = i - 1;
+ if( c == 0 )
+ {
+ res = True;
+ if( !duplicates )
+ l = i;
+ }
+ }
+ }
+ index = l;
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It sorts the collection again. This is useful when the value returned by
+keyOf can be changed and you need to sort the collection according to the
+new value returned by keyOf.
+ It is currently implemented using buble sort algorithm, a better solution
+is welcome.
+ Added by SET.
+
+***************************************************************************/
+
+void TNSSortedCollection::reSort()
+{
+ Boolean sorted;
+ do
+ {
+ sorted=True;
+ for (int i=1; i<count; i++)
+ {
+ if (compare(keyOf(items[i]),keyOf(items[i-1]))<0)
+ {
+ void *aux=items[i-1];
+ items[i-1]=items[i];
+ items[i]=aux;
+ sorted=False;
+ }
+ }
+ }
+ while (!sorted);
+}
+
diff --git a/tvision/classes/tobject.cc b/tvision/classes/tobject.cc
new file mode 100644
index 0000000..4808d2c
--- /dev/null
+++ b/tvision/classes/tobject.cc
@@ -0,0 +1,23 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TObject
+#include <tv.h>
+
+TObject::~TObject()
+{
+}
+
+void TObject::shutDown()
+{
+}
diff --git a/tvision/classes/tpalette.cc b/tvision/classes/tpalette.cc
new file mode 100644
index 0000000..6ee1a09
--- /dev/null
+++ b/tvision/classes/tpalette.cc
@@ -0,0 +1,51 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+ *
+ *
+ */
+
+#define Uses_string //memcpy()
+#define Uses_TPalette
+#include <tv.h>
+
+TPalette::TPalette( const char* d, ushort len ) :
+ data( new uchar[ len+1 ] )
+{
+ data[0] = len;
+ memcpy( data+1, d, len );
+}
+
+TPalette::TPalette( const TPalette& tp ) :
+ data( new uchar[ tp.data[0]+1 ] )
+{
+ memcpy( data, tp.data, tp.data[0]+1 );
+}
+
+TPalette::~TPalette()
+{
+ delete[] data;
+}
+
+TPalette& TPalette::operator = ( const TPalette& tp )
+{
+ if( data != tp.data )
+ {
+ if( data[0] != tp.data[0] )
+ {
+ delete[] data;
+ data = new uchar[ tp.data[0]+1 ];
+ data[0] = tp.data[0];
+ }
+ memcpy( data+1, tp.data+1, data[0] );
+ }
+ return *this;
+}
+
+
diff --git a/tvision/classes/tparamte.cc b/tvision/classes/tparamte.cc
new file mode 100644
index 0000000..075b1f3
--- /dev/null
+++ b/tvision/classes/tparamte.cc
@@ -0,0 +1,96 @@
+/*------------------------------------------------------------*/
+/* filename - tparamte.cc */
+/* */
+/* function(s) */
+/* TParamText member functions */
+/*------------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Salvador E. Tropea (SET) for RHTVision port.
+ *
+ * Big Warning!!!!! This code uses a 256 bytes buffer and doesn't check
+ * for overflow.
+ * I added:
+ * 1) The limit is now a constant defined in tparamTextMaxLen, so you can
+ * adjust it.
+ * 2) If SAFE_CODE is defined (default) the setText() member checks the
+ * lenght of the string. I use snprintf to limit the size.
+ *
+ * Portability note:
+ * getText( char *s, int maxLen ) and BTV uses: getText( char *s )
+ * That's because Robert modified TStaticText, I think that's good, asking
+ * to write in a string without knowing the length is a very bad idea.
+ *
+ */
+#define Uses_stdio
+#define Uses_stdarg
+#define Uses_string
+#define Uses_snprintf
+
+#define Uses_TParamText
+#include <tv.h>
+
+TParamText::TParamText( const TRect& bounds ) :
+ TStaticText(bounds, 0 ),
+ str( new char [tparamTextMaxLen] )
+{
+ str[0] = EOS;
+}
+
+TParamText::~TParamText()
+{
+ delete[] str;
+}
+
+// , int maxLen ) isn't part of TV 2.0
+void TParamText::getText( char *s, int maxLen )
+{
+ if( str == 0 )
+ *s = EOS;
+ else
+ {
+ strncpy( s, str, maxLen );
+ s[maxLen] = 0;
+ }
+}
+
+int TParamText::getTextLen()
+{
+ return (str != 0) ? strlen( str ) : 0;
+}
+
+void TParamText::setText( const char *fmt, ... )
+{
+ va_list ap;
+
+ #ifdef SAFE_CODE
+ // Slow but we can check the overflow
+ va_start( ap, fmt );
+ CLY_vsnprintf(str, (size_t)tparamTextMaxLen, fmt, ap);
+ va_end( ap );
+ str[tparamTextMaxLen-1]=0;
+ #else
+ va_start( ap, fmt );
+ vsprintf( str, fmt, ap );
+ va_end( ap );
+ #endif
+
+ drawView();
+}
+
+#if !defined(NO_STREAM)
+
+TStreamable *TParamText::build()
+{
+ return new TParamText( streamableInit );
+}
+
+TParamText::TParamText( StreamableInit ) : TStaticText( streamableInit )
+{
+}
+
+#endif
diff --git a/tvision/classes/tpoint.cc b/tvision/classes/tpoint.cc
new file mode 100644
index 0000000..7a1dd8c
--- /dev/null
+++ b/tvision/classes/tpoint.cc
@@ -0,0 +1,42 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TPoint
+#include <tv.h>
+
+TPoint operator - ( const TPoint& one, const TPoint& two )
+{
+ TPoint result;
+ result.x = one.x - two.x;
+ result.y = one.y - two.y;
+ return result;
+}
+
+TPoint operator + ( const TPoint& one, const TPoint& two )
+{
+ TPoint result;
+ result.x = one.x + two.x;
+ result.y = one.y + two.y;
+ return result;
+}
+
+int operator == ( const TPoint& one, const TPoint& two )
+{
+ return one.x == two.x && one.y == two.y;
+}
+
+int operator!= ( const TPoint& one, const TPoint& two )
+{
+ return one.x != two.x || one.y != two.y;
+}
+
diff --git a/tvision/classes/tprogini.cc b/tvision/classes/tprogini.cc
new file mode 100644
index 0000000..85f9280
--- /dev/null
+++ b/tvision/classes/tprogini.cc
@@ -0,0 +1,53 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TProgram
+#define Uses_TStatusLine
+#define Uses_TDeskTop
+#define Uses_TMenuBar
+#define Uses_TScreen
+#define Uses_TVConfigFile
+#include <tv.h>
+
+TScreen *TProgInit::tsc=NULL;
+TVMainConfigFile *TProgInit::config=NULL;
+
+TProgInit::TProgInit( TStatusLine *(*cStatusLine)( TRect ),
+ TMenuBar *(*cMenuBar)( TRect ),
+ TDeskTop *(*cDeskTop )( TRect )
+ ) :
+ createStatusLine( cStatusLine ),
+ createMenuBar( cMenuBar ),
+ createDeskTop( cDeskTop )
+{
+ // Load the configuration file
+ if (!config)
+ config=new TVMainConfigFile();
+ config->Load();
+ // Read common settings
+ long aux;
+ if (config->Search("ShowCursorEver",aux))
+ TScreen::setShowCursorEver(aux ? True : False);
+ if (config->Search("DontMoveHiddenCursor",aux))
+ TScreen::setDontMoveHiddenCursor(aux ? True : False);
+
+ tsc=new TScreen();
+}
+
+TProgInit::~TProgInit()
+{
+ delete tsc;
+ delete config;
+ tsc=NULL;
+ config=NULL;
+}
diff --git a/tvision/classes/tprogram.cc b/tvision/classes/tprogram.cc
new file mode 100644
index 0000000..6a70ab4
--- /dev/null
+++ b/tvision/classes/tprogram.cc
@@ -0,0 +1,409 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea (release CPU and other stuff)
+Modified by Salvador E. Tropea to compile for 64 bits architectures.
+Modified by Salvador E. Tropea to disable Alt+N stuff.
+
+ *
+ *
+ */
+
+#define Uses_TKeys
+#define Uses_TProgram
+#define Uses_TEvent
+#define Uses_TScreen
+#define Uses_TStatusLine
+#define Uses_TMenu
+#define Uses_TMenuItem
+#define Uses_TGroup
+#define Uses_TDeskTop
+#define Uses_TEventQueue
+#define Uses_TMenuBar
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TPalette
+#define Uses_TGKey
+#define Uses_TVOSClipboard
+#include <tv.h>
+
+#include <compatlayer.h>
+
+// Public variables
+
+TStatusLine * TProgram::statusLine = 0;
+TMenuBar * TProgram::menuBar = 0;
+TDeskTop * TProgram::deskTop = 0;
+TProgram * TProgram::application = 0;
+int TProgram::appPalette = apColor;
+TEvent TProgram::pending;
+clock_t TProgram::lastIdleClock = 0;
+clock_t TProgram::inIdleTime = 0;
+Boolean TProgram::inIdle = False;
+char TProgram::doNotReleaseCPU = 0;
+char TProgram::doNotHandleAltNumber = 0;
+
+extern TPoint shadowSize;
+
+TProgram::TProgram() :
+ TProgInit( &TProgram::initStatusLine,
+ &TProgram::initMenuBar,
+ &TProgram::initDeskTop
+ ),
+ TGroup( TRect( 0,0,TScreen::screenWidth,TScreen::screenHeight ) )
+{
+ application = this;
+ initScreen();
+ state = sfVisible | sfSelected | sfFocused | sfModal | sfExposed;
+ options = 0;
+ syncScreenBuffer();
+
+ if( TScreen::noUserScreen() )
+ disableCommand( cmCallShell );
+
+ if( createStatusLine != 0 &&
+ (statusLine = createStatusLine( getExtent() )) != 0
+ )
+ insert(statusLine);
+
+ if( createMenuBar != 0 &&
+ (menuBar = createMenuBar( getExtent() )) != 0
+ )
+ insert(menuBar);
+
+ if( createDeskTop != 0 &&
+ (deskTop = createDeskTop( getExtent() )) != 0
+ )
+ insert(deskTop);
+
+}
+
+TProgram::~TProgram()
+{
+ application = 0;
+ if (TVOSClipboard::destroy)
+ TVOSClipboard::destroy();
+}
+
+void TProgram::shutDown()
+{
+ statusLine = 0;
+ menuBar = 0;
+ deskTop = 0;
+ TGroup::shutDown();
+}
+
+inline Boolean hasMouse( TView *p, void *s )
+{
+ return Boolean( (p->state & sfVisible) != 0 &&
+ p->mouseInView( ((TEvent *)s)->mouse.where ));
+}
+
+#ifndef TVOS_UNIX
+inline
+clock_t Clock(void)
+{
+ return clock();
+}
+#else
+/*
+ In Linux clock returns time consumed by our program, so if ourprogram
+sleeps it doesn't count so the screen saver and clock aren'tupdated.
+ Instead we must use gettimeofday.
+*/
+
+#include <sys/time.h>
+
+clock_t Clock(void)
+{
+ static int firstCall=1;
+ static struct timeval ref;
+ struct timeval cur;
+ clock_t ret;
+
+ // If that's the first time take the value as reference
+ if (firstCall)
+ {
+ gettimeofday(&ref,0);
+ firstCall=0;
+ }
+ // Current time
+ gettimeofday(&cur,0);
+ // Substract the reference
+ cur.tv_sec-=ref.tv_sec;
+ if (cur.tv_usec<ref.tv_usec)
+ {
+ cur.tv_sec--;
+ cur.tv_usec=ref.tv_usec-cur.tv_usec;
+ }
+ else
+ cur.tv_usec-=ref.tv_usec;
+
+ // Convert to 1/100 s
+ ret=clock_t(cur.tv_usec/10000+cur.tv_sec*100);
+
+ return ret;
+}
+#endif
+
+void TProgram::getEvent(TEvent& event)
+{
+ if( pending.what != evNothing )
+ {
+ event = pending;
+ pending.what = evNothing;
+ inIdle=False;
+ }
+ else
+ {
+ event.getMouseEvent();
+ if( event.what == evNothing )
+ {
+ event.getKeyEvent();
+ if( event.what == evNothing )
+ {
+ if( inIdle )
+ {
+ clock_t t=Clock();
+ inIdleTime+=t-lastIdleClock;
+ lastIdleClock=t;
+ }
+ else
+ {
+ inIdleTime=0;
+ lastIdleClock=Clock();
+ inIdle=True;
+ }
+ if (TScreen::checkForWindowSize())
+ {
+ setScreenMode(0xFFFF);
+ CLY_Redraw();
+ }
+ idle();
+ }
+ else
+ inIdle=False;
+ }
+ else
+ inIdle=False;
+ }
+
+ if( statusLine != 0 )
+ {
+ if( (event.what & evKeyDown) != 0 ||
+ ( (event.what & evMouseDown) != 0 &&
+ firstThat( hasMouse, &event ) == statusLine
+ )
+ )
+ statusLine->handleEvent( event );
+ }
+}
+
+TPalette& TProgram::getPalette() const
+{
+ static TPalette color ( cpColor, sizeof( cpColor )-1 );
+ static TPalette blackwhite( cpBlackWhite, sizeof( cpBlackWhite )-1 );
+ static TPalette monochrome( cpMonochrome, sizeof( cpMonochrome )-1 );
+ static TPalette *palettes[] =
+ {
+ &color,
+ &blackwhite,
+ &monochrome
+ };
+ return *(palettes[appPalette]);
+}
+
+void TProgram::handleEvent( TEvent& event )
+{
+ if( !doNotHandleAltNumber && event.what == evKeyDown )
+ {
+ char c = TGKey::GetAltChar( event.keyDown.keyCode, event.keyDown.charScan.charCode );
+ if( c >= '1' && c <= '9' )
+ {
+ if (current->valid(cmReleasedFocus))
+ {
+ if( message( deskTop,
+ evBroadcast,
+ cmSelectWindowNum,
+ (void *)(uipointer)(c - '0')
+ ) != 0 )
+ clearEvent( event );
+ }
+ }
+ }
+
+ TGroup::handleEvent( event );
+ if( event.what == evCommand && event.message.command == cmQuit )
+ {
+ endModal( cmQuit );
+ clearEvent( event );
+ }
+}
+
+void TProgram::idle()
+{
+ if( statusLine != 0 )
+ statusLine->update();
+
+ if( commandSetChanged == True )
+ {
+ message( this, evBroadcast, cmCommandSetChanged, 0 );
+ commandSetChanged = False;
+ }
+ // SET: Release the CPU unless the user doesn't want it.
+ if( !doNotReleaseCPU )
+ {
+ CLY_ReleaseCPU(); // defined in ticks.cc
+ }
+}
+
+TDeskTop *TProgram::initDeskTop( TRect r )
+{
+ if (menuBar)
+ r.a.y += menuBar->size.y;
+ else
+ r.a.y++;
+ if (statusLine)
+ r.b.y -= statusLine->size.y;
+ else
+ r.b.y--;
+ return new TDeskTop( r );
+}
+
+TMenuBar *TProgram::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1;
+ return new TMenuBar( r, (TMenu *)0 );
+}
+
+void TProgram::initScreen()
+{
+ if( !TDisplay::dual_display && (TScreen::screenMode & 0x00FF) != TDisplay::smMono )
+ {
+ if( (TScreen::screenMode & TDisplay::smFont8x8) != 0 )
+ shadowSize.x = 1;
+ else
+ shadowSize.x = 2;
+ shadowSize.y = 1;
+ showMarkers = False;
+ if( (TScreen::screenMode & 0x00FF) == TDisplay::smBW80 )
+ appPalette = apBlackWhite;
+ else
+ appPalette = apColor;
+ }
+ else
+ {
+
+ shadowSize.x = 0;
+ shadowSize.y = 0;
+ showMarkers = True;
+ appPalette = apMonochrome;
+ }
+}
+
+TStatusLine *TProgram::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1;
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ *new TStatusItem( __("~Alt-X~ Exit"), kbAltX, cmQuit ) +
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ *new TStatusItem( 0, kbAltF3, cmClose ) +
+ *new TStatusItem( 0, kbF5, cmZoom ) +
+ *new TStatusItem( 0, kbCtrlF5, cmResize )
+ );
+}
+
+void TProgram::outOfMemory()
+{
+}
+
+void TProgram::putEvent( TEvent & event )
+{
+ pending = event;
+}
+
+void TProgram::run()
+{
+ execute();
+}
+
+void TProgram::setScreenMode( ushort mode, char *command )
+{
+ TRect r;
+
+ TMouse::hide();
+ if (!TDisplay::dual_display)
+ {
+ if (mode==0xFFFF && command)
+ TScreen::setVideoModeExt( command );
+ else
+ TScreen::setVideoMode( mode );
+ }
+ initScreen();
+ syncScreenBuffer();
+ r = TRect( 0, 0, TScreen::screenWidth, TScreen::screenHeight );
+ changeBounds( r );
+ setState(sfExposed, False);
+ redraw();
+ setState(sfExposed, True);
+ TMouse::show();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Changes the screen mode to the closest resolution available. The @var{fW}
+and @var{fH} is just a hint about the preferred font size and isn't
+mandatory. If you really want to get a specific font size your application
+should provide the font using a call back.
+
+***************************************************************************/
+
+// SET
+void TProgram::setScreenMode( unsigned w, unsigned h, int fW, int fH )
+{
+ TRect r;
+
+ TMouse::hide();
+ if (TScreen::setVideoModeRes( w, h, fW, fH ))
+ {
+ initScreen();
+ syncScreenBuffer();
+ r = TRect( 0, 0, TScreen::screenWidth, TScreen::screenHeight );
+ changeBounds( r );
+ setState(sfExposed, False);
+ redraw();
+ setState(sfExposed, True);
+ }
+ TMouse::show();
+}
+
+TView* TProgram::validView(TView* p)
+{
+ if( p == 0 )
+ return 0;
+ if( lowMemory() )
+ {
+ CLY_destroy( p );
+ outOfMemory();
+ return 0;
+ }
+ if( !p->valid( cmValid ) )
+ {
+ CLY_destroy( p );
+ return 0;
+ }
+ return p;
+}
+
+void TProgram::syncScreenBuffer()
+{
+ buffer = TScreen::screenBuffer;
+}
+
diff --git a/tvision/classes/tpwobj.cc b/tvision/classes/tpwobj.cc
new file mode 100644
index 0000000..4b21ad8
--- /dev/null
+++ b/tvision/classes/tpwobj.cc
@@ -0,0 +1,20 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TPWrittenObjects
+#include <tv.h>
+
+TPWObj::TPWObj( const void *adr, P_id_type id ) : address( adr ), ident( id )
+{
+}
+
diff --git a/tvision/classes/tpwreado.cc b/tvision/classes/tpwreado.cc
new file mode 100644
index 0000000..b71b34b
--- /dev/null
+++ b/tvision/classes/tpwreado.cc
@@ -0,0 +1,41 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TPReadObjects
+#include <tv.h>
+
+#include <assert.h>
+
+TPReadObjects::TPReadObjects() : TNSCollection( 5, 5 ), curId( 0 )
+{
+ shouldDelete = False;
+}
+
+TPReadObjects::~TPReadObjects()
+{
+}
+
+void TPReadObjects::registerObject( const void *adr )
+{
+ ccIndex loc = insert( (void *)adr );
+ assert( (unsigned)loc == curId); // to be sure that TNSCollection
+ // continues to work the way
+ // it does now...
+ curId++; // Increment moved out of assertion check...
+}
+
+const void *TPReadObjects::find( P_id_type id )
+{
+ return at( id );
+}
+
diff --git a/tvision/classes/tpwritte.cc b/tvision/classes/tpwritte.cc
new file mode 100644
index 0000000..3236382
--- /dev/null
+++ b/tvision/classes/tpwritte.cc
@@ -0,0 +1,62 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TPWrittenObjects
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TPWrittenObjects::TPWrittenObjects() : TNSSortedCollection( 5, 5 ), curId( 0 )
+{
+ // SET: Why this? it just leaks memory, anybody knows?
+ //shouldDelete = False;
+}
+
+TPWrittenObjects::~TPWrittenObjects()
+{
+}
+
+void TPWrittenObjects::registerObject( const void *adr )
+{
+ TPWObj *o = new TPWObj( adr, curId++ );
+ insert( o );
+}
+
+void TPWrittenObjects::freeItem( void *item )
+{
+ delete (TPWObj *)item;
+}
+
+P_id_type TPWrittenObjects::find( const void *d )
+{
+ ccIndex loc;
+ if( search( (void *)d, loc ) )
+ return ((TPWObj *)at( loc ))->ident;
+ else
+ return P_id_notFound;
+}
+
+void *TPWrittenObjects::keyOf( void *d )
+{
+ return (void *)((TPWObj *)d)->address;
+}
+
+int TPWrittenObjects::compare( void *o1, void *o2 )
+{
+ if( o1 == o2 )
+ return 0;
+ else if( ((char *)o1)+1 < ((char *)o2)+1 ) // force normalization
+ return -1;
+ else
+ return 1;
+}
+
diff --git a/tvision/classes/tpxvalid.cc b/tvision/classes/tpxvalid.cc
new file mode 100644
index 0000000..4cf8bea
--- /dev/null
+++ b/tvision/classes/tpxvalid.cc
@@ -0,0 +1,500 @@
+/*------------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Salvador E. Tropea. Covered by the GPL license.
+ * * Change NO_STREAM usage.
+ * * Fixed the code to avoid buffer overflows.
+ * * Modified to use TVCodePage.
+ */
+
+#define Uses_TPXPictureValidator
+#define Uses_MsgBox
+#define Uses_AllocLocal
+#define Uses_TVCodePage
+#include <tv.h>
+
+// TPXPictureValidator
+
+const char * TPXPictureValidator::errorMsg = __("Error in picture format.\n %s");
+
+TPXPictureValidator::TPXPictureValidator(const char* aPic, Boolean autoFill)
+ : TValidator()
+{
+ char s[1];
+
+ pic = newStr(aPic);
+ if ( autoFill )
+ options |= voFill;
+ s[0] = 0;
+ if (picture(s, False) != prEmpty)
+ status = vsSyntax;
+}
+
+#if !defined( NO_STREAM )
+
+TPXPictureValidator::TPXPictureValidator( StreamableInit s ) : TValidator(s)
+{
+}
+
+TStreamable * TPXPictureValidator::build()
+{
+ return (TStreamable *) new TPXPictureValidator(streamableInit);
+}
+
+void TPXPictureValidator::write( opstream& os )
+{
+ TValidator::write(os);
+ os.writeString(pic);
+}
+
+void* TPXPictureValidator::read( ipstream& is )
+{
+ TValidator::read(is);
+ pic = is.readString();
+ index = jndex = 0;
+
+ return this;
+}
+
+#endif // !defined( NO_STREAM )
+
+TPXPictureValidator::~TPXPictureValidator()
+{
+ delete pic;
+};
+
+void TPXPictureValidator::error()
+{
+ messageBox(mfError | mfOKButton, errorMsg, pic);
+}
+
+Boolean TPXPictureValidator::isValidInput(char* s, Boolean suppressFill)
+{
+ Boolean doFill = Boolean(((options&voFill)!=0) && !suppressFill);
+
+ return Boolean((pic==0) || (picture( (char*)s, doFill) != prError));
+}
+
+Boolean TPXPictureValidator::isValid(const char* s)
+{
+ // SET: Modified to allocate memory and avoid buffer overflows.
+ int l = strlen(s) + 1;
+ AllocLocalStr(str, l);
+ strcpy(str, s);
+
+ return Boolean((pic == 0) || (picture(str, False) == prComplete));
+}
+
+static inline
+Boolean isSpecial(char ch, const char* special)
+{
+ return strchr(special, ch) ? True : False;
+}
+
+static inline
+Boolean isComplete(TPicResult result)
+{
+ return Boolean((result == prComplete) || (result == prAmbiguous));
+}
+
+static inline
+Boolean isIncomplete(TPicResult result)
+{
+ return Boolean( (result == prIncomplete) || (result == prIncompNoFill) );
+}
+
+
+// TPXPictureValidator members
+
+// Consume input
+void TPXPictureValidator::consume(char ch, char* input)
+{
+ input[jndex] = ch;
+ index++;
+ jndex++;
+}
+
+// Skip a character or a picture group
+
+void TPXPictureValidator::toGroupEnd(int& i, int termCh)
+{
+ int brkLevel, brcLevel;
+
+ brkLevel = 0;
+ brcLevel = 0;
+ do {
+ if (i == termCh)
+ return;
+ else
+ switch (pic[i])
+ {
+ case '[': brkLevel++; break;
+ case ']': brkLevel--; break;
+ case '{': brcLevel++; break;
+ case '}': brcLevel--; break;
+ case ';': i++; break;
+ }
+ i++;
+ } while (! ((brkLevel == 0) && (brcLevel == 0)));
+}
+
+// Find the a comma separator
+Boolean TPXPictureValidator::skipToComma(int termCh)
+{
+ do {
+ toGroupEnd(index, termCh);
+ } while (! ( (index == termCh) || (pic[index] == ',')));
+
+ if (pic[index] == ',')
+ index++;
+ return Boolean(index < termCh);
+}
+
+// Calclate the end of a group
+int TPXPictureValidator::calcTerm(int termCh)
+{
+ int k = index;
+ toGroupEnd(k, termCh);
+ return k;
+}
+
+// The next group is repeated X times }
+TPicResult TPXPictureValidator::iteration(char* input, int inTerm)
+{
+ int itr, k, l;
+ TPicResult rslt;
+ int termCh;
+
+ itr = 0;
+ rslt = prError;
+
+ index++; // Skip '*'
+
+ // Retrieve number
+
+ while (TVCodePage::isNumber(pic[index]))
+ {
+ itr = itr * 10 + (pic[index] - '0');
+ index++;
+ }
+
+ k = index;
+ termCh = calcTerm(inTerm);
+
+ // If Itr is 0 allow any number, otherwise enforce the number
+ if (itr != 0)
+ {
+ for (l = 1; l <= itr; l++)
+ {
+ index = k;
+ rslt = process(input,termCh);
+ if ( ! isComplete(rslt))
+ {
+ // Empty means incomplete since all are required
+ if (rslt == prEmpty)
+ rslt = prIncomplete;
+
+ return rslt;
+ }
+ }
+ }
+ else
+ {
+ do {
+ index = k;
+ rslt = process(input, termCh);
+ } while (rslt == prComplete);
+
+ if ((rslt == prEmpty) || (rslt == prError))
+ {
+ index++;
+ rslt = prAmbiguous;
+ }
+ }
+ index = termCh;
+
+ return rslt;
+}
+
+// Process a picture group
+TPicResult TPXPictureValidator::group(char* input, int inTerm)
+{
+ TPicResult rslt;
+ int termCh;
+
+ termCh = calcTerm(inTerm);
+ index++;
+ rslt = process(input, termCh - 1);
+
+ if (! isIncomplete(rslt))
+ index = termCh;
+
+ return rslt;
+}
+
+
+TPicResult TPXPictureValidator::checkComplete(TPicResult rslt, int termCh)
+{
+ int j = index;
+ Boolean Status=True;
+
+ if (isIncomplete(rslt))
+ {
+ // Skip optional pieces
+ while (Status)
+ switch (pic[j])
+ {
+ case '[':
+ toGroupEnd(j, termCh);
+ break;
+ case '*':
+ if (! TVCodePage::isNumber(pic[j + 1]))
+ j++;
+ toGroupEnd(j, termCh);
+ break;
+
+ default:
+ Status = False;
+ }
+
+ if (j == termCh)
+ rslt = prAmbiguous;
+ }
+
+ return rslt;
+}
+
+
+TPicResult TPXPictureValidator::scan(char* input, int termCh)
+{
+ char ch;
+ TPicResult rslt, rScan;
+
+ rScan = prError;
+ rslt = prEmpty;
+
+ while ( (index != termCh) && (pic[index] != ','))
+ {
+ if ((size_t)jndex >= strlen(input))
+ return checkComplete(rslt, termCh);
+
+ ch = input[jndex];
+ switch (pic[index])
+ {
+ case '#':
+ if (! TVCodePage::isNumber(ch))
+ return prError;
+ else
+ consume(ch, input);
+ break;
+ case '?':
+ if (! TVCodePage::isAlpha(ch))
+ return prError;
+ else
+ consume(ch, input);
+ break;
+ case '&':
+ if (! TVCodePage::isAlpha(ch))
+ return prError;
+ else
+ consume(TVCodePage::toUpper(ch), input);
+ break;
+ case '!':
+ consume(TVCodePage::toUpper(ch), input);
+ break;
+ case '@':
+ consume(ch, input);
+ break;
+ case '*':
+
+ rslt = iteration(input,termCh);
+ if (! isComplete(rslt))
+ return rslt;
+
+ if (rslt == prError)
+ rslt = prAmbiguous;
+ break;
+
+ case '{':
+
+ rslt = group(input, termCh);
+ if (! isComplete(rslt))
+ return rslt;
+
+ break;
+ case '[':
+
+ rslt = group(input, termCh);
+ if (isIncomplete(rslt))
+ return rslt;
+ if (rslt == prError)
+ rslt = prAmbiguous;
+
+ break;
+
+ default:
+
+ if (pic[index] == ';')
+ index++;
+ if (TVCodePage::toUpper(pic[index]) != TVCodePage::toUpper(ch))
+ {
+ if (ch == ' ')
+ ch = pic[index];
+ else
+ return rScan;
+ }
+
+ consume(pic[index], input);
+ }
+
+ if (rslt == prAmbiguous)
+ rslt = prIncompNoFill;
+ else
+ rslt = prIncomplete;
+ }
+
+ if (rslt == prIncompNoFill)
+ return prAmbiguous;
+ else
+ return prComplete;
+}
+
+TPicResult TPXPictureValidator::process(char* input, int termCh)
+{
+
+ TPicResult rslt, rProcess;
+ Boolean incomp;
+ int oldI, oldJ, incompJ=0, incompI=0;
+
+ incomp = False;
+ oldI = index;
+ oldJ = jndex;
+ do {
+ rslt = scan(input, termCh);
+
+ // Only accept completes if they make it farther in the input
+ // stream from the last incomplete
+
+ if ( (rslt == prComplete) && incomp && (jndex < incompJ))
+ {
+ rslt = prIncomplete;
+ jndex = incompJ;
+ }
+
+ if ((rslt == prError) || (rslt == prIncomplete))
+ {
+ rProcess = rslt;
+
+ if (! incomp && (rslt == prIncomplete) )
+ {
+ incomp = True;
+ incompI = index;
+ incompJ = jndex;
+ }
+ index = oldI;
+ jndex = oldJ;
+ if (! skipToComma(termCh))
+ {
+ if ( incomp )
+ {
+ rProcess = prIncomplete;
+ index = incompI;
+ jndex = incompJ;
+ }
+ return rProcess;
+ }
+ oldI = index;
+ }
+ } while (!((rslt != prError) && (rslt != prIncomplete)));
+
+ if ((rslt == prComplete) && incomp)
+ return prAmbiguous;
+ else
+ return rslt;
+}
+
+Boolean TPXPictureValidator::syntaxCheck()
+{
+
+ int i, len;
+ int brkLevel, brcLevel;
+
+ if (!pic || (strlen(pic) == 0))
+ return False;
+
+ if (pic[strlen(pic)-1] == ';')
+ return False;
+
+ i = 0;
+ brkLevel = 0;
+ brcLevel = 0;
+
+ len = strlen(pic);
+ while (i < len)
+ {
+ switch (pic[i])
+ {
+ case '[': brkLevel++; break;
+ case ']': brkLevel--; break;
+ case '{': brcLevel++; break;
+ case '}': brcLevel--; break;
+ case ';': i++; break;
+ }
+ i++;
+ }
+
+ return Boolean( (brkLevel == 0) && (brcLevel == 0) );
+}
+
+TPicResult TPXPictureValidator::picture(char* input, Boolean autoFill)
+{
+ Boolean reprocess;
+ TPicResult rslt;
+
+ if (!syntaxCheck())
+ return prSyntax;
+
+ if (!input || strlen(input)==0)
+ return prEmpty;
+
+ jndex = 0;
+ index = 0;
+
+ rslt = process(input, strlen(pic));
+
+ if ((rslt != prError) && ((size_t)jndex < strlen(input)))
+ rslt = prError;
+
+ if ((rslt == prIncomplete) && autoFill)
+ {
+ reprocess = False;
+
+ while (((size_t)index < strlen(pic)) && !isSpecial(pic[index], "#?&!@*{}[]"))
+ {
+ if (pic[index] == ';')
+ index++;
+ int end = strlen(input);
+ input[end] = pic[index];
+ input[end+1] = 0;
+ index++;
+ reprocess = True;
+ }
+
+ jndex = 0;
+ index = 0;
+ if (reprocess)
+ rslt = process(input, strlen(pic));
+ }
+
+ if (rslt == prAmbiguous)
+ return prComplete;
+ else if (rslt == prIncompNoFill)
+ return prIncomplete;
+ else
+ return rslt;
+}
+
diff --git a/tvision/classes/tradiobu.cc b/tvision/classes/tradiobu.cc
new file mode 100644
index 0000000..fcc3a43
--- /dev/null
+++ b/tvision/classes/tradiobu.cc
@@ -0,0 +1,98 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Added TRadioButtons32 and code page stuff by Salvador Eduardo Tropea.
+
+ *
+ *
+ */
+
+#define Uses_TRadioButtons
+#define Uses_TStreamableClass
+#include <tv.h>
+
+void TRadioButtons::draw()
+{
+ drawBox( button, check );
+}
+
+Boolean TRadioButtons::mark( int item )
+{
+ return Boolean( (uint32)item == value );
+}
+
+void TRadioButtons::press( int item )
+{
+ value = item;
+ TCluster::press(item);
+ evaluateMasks();
+}
+
+void TRadioButtons::movedTo( int item )
+{
+ value = item;
+ TCluster::movedTo(item);
+ evaluateMasks();
+}
+
+void TRadioButtons::setData( void * rec )
+{
+ TCluster::setData(rec);
+ sel = value;
+ evaluateMasks();
+}
+
+void TRadioButtons::evaluateMasks()
+{
+ if( !enableMasks )
+ return;
+ int i;
+ unsigned mask, theMask;
+
+ theMask = enableMasks[value];
+ for( i = 0, mask = 1; i < enableCViews; mask <<= 1, i++ )
+ {
+ TView *view = enableViews[i];
+ if( theMask & mask )
+ {// Enable this view
+ if( view->state & sfDisabled )
+ view->setState( sfDisabled, False );
+ }
+ else
+ {// Disable this view
+ if( !( view->state & sfDisabled ) )
+ view->setState( sfDisabled, True );
+ }
+ }
+}
+
+uint32 TRadioButtons32::dataSize()
+{
+ return 4;
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TRadioButtons::build()
+{
+ return new TRadioButtons( streamableInit );
+}
+
+TRadioButtons::TRadioButtons( StreamableInit ) : TCluster( streamableInit )
+{
+}
+
+TStreamable *TRadioButtons32::build()
+{
+ return new TRadioButtons32( streamableInit );
+}
+
+TRadioButtons32::TRadioButtons32( StreamableInit ) : TRadioButtons( streamableInit )
+{
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/trangeva.cc b/tvision/classes/trangeva.cc
new file mode 100644
index 0000000..58c96fa
--- /dev/null
+++ b/tvision/classes/trangeva.cc
@@ -0,0 +1,142 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Heavily modified by Salvador E. Tropea (SET) to properly accept Hexadecimal
+and octal numbers. Thanks to Andris Pavenis for suggestions.
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_stdlib
+#define Uses_string
+#define Uses_limits
+#define Uses_stdio
+
+#define Uses_ipstream
+#define Uses_opstream
+#define Uses_TRangeValidator
+#define Uses_MsgBox
+#include <tv.h>
+
+// SET: Added hexadecimal letters
+#define CT_VALID_CHARS "xX0123456789ABCDEFabcdef"
+const char *ctValidChars="-+" CT_VALID_CHARS;
+const char *ctValidCharsPos=ctValidChars+1;
+const char *ctValidCharsNeg="-" CT_VALID_CHARS;
+
+TRangeValidator::TRangeValidator() :
+ TFilterValidator(ctValidChars)
+{
+ min = LONG_MIN;
+ max = LONG_MAX;
+}
+
+TRangeValidator::TRangeValidator(long aMin,long aMax) :
+ TFilterValidator(ctValidChars)
+{
+ min = aMin;
+ max = aMax;
+ if (min >= 0) strcpy(validChars,ctValidCharsPos);
+ if (min < 0 && max < 0) strcpy(validChars,ctValidCharsNeg);
+}
+
+void TRangeValidator::error()
+{
+ if (min >= 0)
+ messageBox(mfError|mfOKButton,__("Value not in the range %lu to %lu"),
+ (unsigned long)min,(unsigned long)max);
+ else
+ messageBox(mfError|mfOKButton,__("Value not in the range %li to %li"),
+ min,max);
+ // SET: Replaced %U and %D because MSVC lacks it
+}
+
+static long get_val(const char *buf)
+{ // SET: Changed to use strtol
+ char *end;
+ return strtol(buf,&end,0);
+}
+
+static unsigned long get_uval(const char *buf)
+{ // SET: Changed to use strtoul
+ char *end;
+ return strtoul(buf,&end,0);
+}
+
+
+Boolean TRangeValidator::isValid(const char *S)
+{
+ long value;
+ if (TFilterValidator::isValid(S) == False) return False;
+ if (min >= 0)
+ value = get_uval(S);
+ else
+ value = get_val(S);
+ if (min >= 0)
+ {
+ if ((unsigned long)value < (unsigned long)min ||
+ (unsigned long)value > (unsigned long)max)
+ return False;
+ }
+ else
+ {
+ if (value < min || value > max) return False;
+ }
+ return True;
+}
+
+ushort TRangeValidator::transfer(char *S,void * Buffer,
+ TVTransfer Flag)
+{
+ if (!(options & voTransfer)) return 0;
+ switch (Flag)
+ {
+ case vtGetData:
+ if (min >= 0)
+ *((unsigned long *)Buffer) = get_uval(S);
+ else
+ *((long *)Buffer) = get_val(S);
+ break;
+ case vtSetData:
+ if (min >= 0)
+ sprintf(S,"%lu",*((unsigned long *)Buffer));
+ else
+ sprintf(S,"%ld",*((long *)Buffer));
+ break;
+ default:
+ break;
+ }
+ return sizeof(long);
+}
+
+#if !defined( NO_STREAM )
+TRangeValidator::TRangeValidator(StreamableInit) :
+ TFilterValidator(streamableInit)
+{
+}
+
+TStreamable * TRangeValidator::build()
+{
+ return (TStreamable *) new TRangeValidator(streamableInit);
+}
+
+void TRangeValidator::write(opstream & os)
+{
+ TFilterValidator::write(os);
+ os << min << max;
+}
+
+void * TRangeValidator::read(ipstream & is)
+{
+ TFilterValidator::read(is);
+ is >> min >> max;
+ return this;
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/trescoll.cc b/tvision/classes/trescoll.cc
new file mode 100644
index 0000000..982e999
--- /dev/null
+++ b/tvision/classes/trescoll.cc
@@ -0,0 +1,60 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TResourceCollection
+#define Uses_TResourceItem
+#include <tv.h>
+
+TResourceCollection::TResourceCollection( ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection( aLimit, aDelta)
+{
+}
+
+void TResourceCollection::freeItem( void* item )
+{
+ delete ((TResourceItem*)item)->key;
+ delete((TResourceItem*)item);
+}
+
+void* TResourceCollection::keyOf( void* item )
+{
+ return ((TResourceItem *)item)->key;
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TResourceCollection::build()
+{
+ return new TResourceCollection( streamableInit );
+}
+
+void TResourceCollection::writeItem( void *obj, opstream& os )
+{
+
+ os << ((TResourceItem *)obj)->pos;
+ os << ((TResourceItem *)obj)->size;
+ os.writeString(((TResourceItem *)obj)->key);
+
+}
+
+void *TResourceCollection::readItem( ipstream& is )
+{
+ TResourceItem *obj;
+
+ obj = new TResourceItem;
+ is >> obj->pos;
+ is >> obj->size;
+ obj->key = is.readString();
+ return (void *)obj;
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tresfile.cc b/tvision/classes/tresfile.cc
new file mode 100644
index 0000000..300c1ed
--- /dev/null
+++ b/tvision/classes/tresfile.cc
@@ -0,0 +1,194 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis.
+
+ *
+ *
+ */
+
+#define Uses_TResourceFile
+#define Uses_TResourceItem
+#define Uses_fpstream
+#define Uses_filelength
+#define Uses_TCollection
+#define Uses_TStringCollection
+#define Uses_TResourceCollection
+#include <tv.h>
+
+UsingNamespaceStd
+
+const long rStreamMagic = 0x52504246uL; // 'FBPR'
+
+#pragma pack(1)
+
+struct Count_type
+{
+ ushort lastCount CLY_Packed;
+ ushort pageCount CLY_Packed;
+};
+
+struct Info_type
+{
+ ushort infoType CLY_Packed;
+ long infoSize CLY_Packed;
+};
+
+struct THeader
+{
+ ushort signature CLY_Packed;
+ union
+ {
+ Count_type count;
+ Info_type info;
+ } CLY_Packed;
+};
+
+#pragma pack()
+
+TResourceFile::TResourceFile( fpstream *aStream ) : TObject()
+{
+ THeader *header;
+ int found;
+ int repeat;
+ long streamSize;
+
+ stream = aStream;
+ basePos = stream->tellp();
+ streamSize = stream->filelength();
+ header = new THeader;
+ found = 0;
+ do {
+ repeat = 0;
+ if ((unsigned long)basePos <= (streamSize - sizeof(THeader)))
+ {
+ stream->seekg(basePos, CLY_IOSBeg);
+ stream->readBytes(header, sizeof(THeader));
+ if (header->signature == 0x5a4d)
+ {
+ basePos += ((header->count.pageCount * 512L) -
+ (-header->count.lastCount & 511));
+ repeat = 1;
+ }
+ else if (header->signature == 0x4246)
+ {
+ if (header->info.infoType == 0x5250)
+ found = 1;
+ else
+ {
+ basePos +=
+ header->info.infoSize + 16 - (header->info.infoSize)%16;
+ repeat = 1;
+ }
+ }
+ }
+ } while (repeat);
+
+ if (found)
+ {
+ stream->seekg(basePos + CLY_StreamPosT(sizeof(long) * 2), CLY_IOSBeg);
+ long aux;
+ *stream >> aux;
+ indexPos=aux;
+ stream->seekg(basePos + indexPos, CLY_IOSBeg);
+ *stream >> index;
+ }
+ else
+ {
+ indexPos = sizeof(long) * 3;
+ index = new TResourceCollection(0, 8);
+ }
+ delete header;
+}
+
+TResourceFile::~TResourceFile()
+{
+ flush();
+ CLY_destroy( (TCollection *)index );
+ delete(stream);
+}
+
+short TResourceFile::count()
+{
+ return index->getCount();
+}
+
+// Avoid replacing free by MSS's macro
+#include <tv/no_mss.h>
+
+void TResourceFile::remove( const char *key )
+{
+ int i;
+
+ if (index->search( (char *)key, i))
+ {
+ index->free(index->at(i));
+ modified = True;
+ }
+}
+
+#include <tv/yes_mss.h>
+
+void TResourceFile::flush()
+{
+ long lenRez;
+
+ if (modified == True)
+ {
+ stream->seekg(basePos + indexPos, CLY_IOSBeg);
+ *stream << index;
+ lenRez = stream->tellp() - basePos - CLY_StreamPosT(sizeof(long) * 2);
+ stream->seekg(basePos, CLY_IOSBeg);
+ *stream << rStreamMagic;
+ *stream << lenRez;
+ *stream << long(indexPos);
+ stream->flush();
+ modified = False;
+ }
+}
+
+void *TResourceFile::get( const char *key)
+{
+ int i;
+ void *p;
+
+ if (! index->search((char *)key, i))
+ return 0;
+ stream->seekg(basePos + CLY_StreamPosT(((TResourceItem*)(index->at(i)))->pos),
+ CLY_IOSBeg);
+ *stream >> p;
+ return p;
+}
+
+const char *TResourceFile::keyAt(short i)
+{
+ return ((TResourceItem*)(index->at(i)))->key;
+}
+
+void TResourceFile::put(TStreamable *item, const char *key)
+{
+ int i;
+ TResourceItem *p;
+
+ if (index->search( (char *)key, i))
+ p = (TResourceItem*)(index->at(i));
+ else
+ {
+ p = new TResourceItem;
+ p->key = newStr(key);
+ index->atInsert(i, p);
+ }
+ p->pos = indexPos;
+ stream->seekp(basePos + indexPos, CLY_IOSBeg);
+ *stream << item;
+ indexPos = stream->tellp() - basePos;
+ p->size = indexPos - CLY_StreamPosT(p->pos);
+ modified = True;
+}
+
diff --git a/tvision/classes/tscreen.cc b/tvision/classes/tscreen.cc
new file mode 100644
index 0000000..47c875f
--- /dev/null
+++ b/tvision/classes/tscreen.cc
@@ -0,0 +1,454 @@
+/**[txh]********************************************************************
+
+ Copyright 2001-2009 by Salvador E. Tropea
+ This file is covered by the GPL license.
+
+ Module: Screen
+ Include: TScreen
+ Comments:
+ This is the base class for medium level screen output.
+ Most members are pointers to functions defined by each platform dependent
+driver. Default members are provided.
+ This is a complete new file created from concepts that José Angel Sanchez
+Caso provide me and coded from scratch. The names of some members are the
+same used in original Turbo Vision for compatibility purposes.
+
+***************************************************************************/
+
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_string
+#define Uses_unistd
+#define Uses_AllocLocal
+#define Uses_ctype
+#define Uses_TScreen
+#define Uses_TVConfigFile
+#define Uses_TGKey
+#include <tv.h>
+#include <tv/drivers.h>
+
+static void dummy() {}
+
+/*****************************************************************************
+ Data members initialization
+*****************************************************************************/
+
+ushort TScreen::startupMode=0;
+ushort TScreen::screenMode=0;
+ushort TScreen::startupCursor=0;
+ushort TScreen::cursorLines=0;
+uchar TScreen::screenWidth=80;
+uchar TScreen::screenHeight=25;
+Boolean TScreen::hiResScreen=False;
+Boolean TScreen::checkSnow=False;
+ushort *TScreen::screenBuffer=NULL;
+char TScreen::suspended=1;
+char TScreen::initialized=0;
+char TScreen::initCalled=0;
+char TScreen::useSecondaryFont=0;
+uint32 TScreen::flags0=0;
+TScreen *TScreen::driver=NULL;
+const char
+ *TScreen::currentDriverShortName=NULL;
+TVScreenFontRequestCallBack
+ TScreen::frCB=NULL;
+long TScreen::forcedAppCP=-1,
+ TScreen::forcedScrCP=-1,
+ TScreen::forcedInpCP=-1;
+int TScreen::maxAppHelperHandlers=8;
+
+/*****************************************************************************
+ Function pointer members initialization
+*****************************************************************************/
+
+void (*TScreen::setVideoMode)(ushort mode) =TScreen::defaultSetVideoMode;
+void (*TScreen::setVideoModeExt)(char *mode) =TScreen::defaultSetVideoModeExt;
+void (*TScreen::clearScreen)() =TScreen::defaultClearScreen;
+void (*TScreen::setCrtData)() =TScreen::defaultSetCrtData;
+ushort (*TScreen::fixCrtMode)(ushort mode) =TScreen::defaultFixCrtMode;
+void (*TScreen::Suspend)() =dummy;
+void (*TScreen::Resume)() =dummy;
+ushort (*TScreen::getCharacter)(unsigned offset)=TScreen::defaultGetCharacter;
+void (*TScreen::getCharacters)(unsigned offset, ushort *buf, unsigned count)
+ =TScreen::defaultGetCharacters;
+void (*TScreen::setCharacter)(unsigned offset, ushort value)
+ =TScreen::defaultSetCharacter;
+void (*TScreen::setCharacters)(unsigned offset, ushort *values, unsigned count)
+ =TScreen::defaultSetCharacters;
+int (*TScreen::System_p)(const char *command, pid_t *pidChild, int in,
+ int out, int err)
+ =TScreen::defaultSystem;
+int (*TScreen::getFontGeometry)(unsigned &w, unsigned &h)
+ =TScreen::defaultGetFontGeometry;
+int (*TScreen::getFontGeometryRange)(unsigned &wmin, unsigned &hmin,
+ unsigned &umax, unsigned &hmax)
+ =TScreen::defaultGetFontGeometryRange;
+int (*TScreen::setFont_p)(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP, int appCP)
+ =TScreen::defaultSetFont;
+void (*TScreen::restoreFonts)() =TScreen::defaultRestoreFonts;
+int (*TScreen::setVideoModeRes_p)(unsigned w, unsigned h, int fW, int fH)
+ =TScreen::defaultSetVideoModeRes;
+TScreen::appHelperHandler (*TScreen::openHelperApp)(AppHelper kind)
+ =TScreen::defaultOpenHelperApp;
+Boolean (*TScreen::closeHelperApp)(appHelperHandler id)
+ =TScreen::defaultCloseHelperApp;
+Boolean (*TScreen::sendFileToHelper)(appHelperHandler id, const char *file, void *extra)
+ =TScreen::defaultSendFileToHelper;
+const char *(*TScreen::getHelperAppError)() =TScreen::defaultGetHelperAppError;
+
+
+/*****************************************************************************
+ Default behaviors for the members
+*****************************************************************************/
+
+void TScreen::defaultSetVideoMode(ushort mode)
+{// Set the screen mode
+ setCrtMode(fixCrtMode(mode));
+ // Cache the data about it and initialize related stuff
+ setCrtData();
+}
+
+void TScreen::defaultSetVideoModeExt(char *mode)
+{// Set the screen mode
+ setCrtModeExt(mode);
+ // Cache the data about it and initialize related stuff
+ setCrtData();
+}
+
+int TScreen::defaultSetVideoModeRes(unsigned w, unsigned h, int fW, int fH)
+{// Set the screen mode
+ int ret=setCrtModeRes(w,h,fW,fH);
+ if (ret)
+ // Cache the data about it and initialize related stuff
+ setCrtData();
+ return ret;
+}
+
+void TScreen::defaultClearScreen()
+{
+ TDisplay::clearScreen(screenWidth,screenHeight);
+}
+
+void TScreen::defaultSetCrtData()
+{
+ screenMode =getCrtMode();
+ screenWidth =getCols();
+ screenHeight=getRows();
+ hiResScreen =Boolean(screenHeight>25);
+ cursorLines =getCursorType();
+ setCursorType(0);
+}
+
+ushort TScreen::defaultFixCrtMode(ushort mode)
+{
+ return mode;
+}
+
+ushort TScreen::defaultGetCharacter(unsigned offset)
+{
+ return screenBuffer[offset];
+}
+
+void TScreen::defaultGetCharacters(unsigned offset, ushort *buf, unsigned count)
+{
+ memcpy(buf,screenBuffer+offset,count*sizeof(ushort));
+}
+
+void TScreen::defaultSetCharacter(unsigned offset, ushort value)
+{
+ screenBuffer[offset]=value;
+}
+
+void TScreen::defaultSetCharacters(unsigned offset, ushort *values, unsigned count)
+{
+ memcpy(screenBuffer+offset,values,count*2);
+}
+
+int TScreen::defaultSystem(const char *command, pid_t *pidChild, int in, int out,
+ int err)
+{
+ // fork mechanism not available
+ if (pidChild)
+ *pidChild=0;
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+}
+
+int TScreen::defaultGetFontGeometry(unsigned &, unsigned &) { return 0; }
+int TScreen::defaultGetFontGeometryRange(unsigned &, unsigned &,
+ unsigned &, unsigned &) { return 0; }
+int TScreen::defaultSetFont(int , TScreenFont256 *, int , TScreenFont256 *,
+ int, int) { return 0; }
+void TScreen::defaultRestoreFonts() {}
+
+TScreen::appHelperHandler TScreen::defaultOpenHelperApp(TScreen::AppHelper)
+{ return -1; }
+Boolean TScreen::defaultCloseHelperApp(appHelperHandler) { return False; }
+Boolean TScreen::defaultSendFileToHelper(appHelperHandler, const char *, void *)
+{ return False; }
+const char *TScreen::defaultGetHelperAppError()
+{
+ return __("This feature isn't implemented by the current driver.");
+}
+
+/*****************************************************************************
+ Real members
+*****************************************************************************/
+
+struct stDriver
+{
+ // Test function for this driver
+ drvChecker driver;
+ // The drivers with more priority are tried first
+ int priority;
+ // Configuration section name for this driver
+ const char *name;
+};
+
+#ifdef TV_Disable_WinGr_Driver
+ #define TV_WinGr_Driver_Entry
+#else
+ #define TV_WinGr_Driver_Entry { TV_WinGrDriverCheck, 80, "WinGr" },
+#endif
+
+static
+stDriver Drivers[]=
+{
+ #ifdef TVOS_DOS
+ { TV_DOSDriverCheck, 100, "DOS" },
+ #endif
+
+ #ifdef TVOS_UNIX
+ #ifdef HAVE_X11
+ { TV_XDriverCheck, 100, "X11" },
+ #endif // HAVE_X11
+ #ifdef TVOSf_Linux
+ { TV_LinuxDriverCheck, 90, "Linux" },
+ #endif
+ #ifdef TVOSf_QNXRtP
+ { TV_QNXRtPDriverCheck, 90, "QNX" },
+ #else
+ #ifdef TVOSf_QNX4
+ { TV_QNX4DriverCheck, 90, "QNX4" },
+ #endif // TVOSf_QNX4
+ { TV_XTermDriverCheck, 60, "XTerm" },
+ #ifdef HAVE_NCURSES
+ { TV_UNIXDriverCheck, 10, "UNIX" },
+ #endif
+ #endif // TVOSf_QNXRtP
+ #endif
+
+ #ifdef TVOS_Win32
+ #ifdef HAVE_X11
+ // This is experimental, but believe it or not Cygwin have X11 support
+ { TV_XDriverCheck, 100, "X11" },
+ #endif // HAVE_X11
+ #ifdef TVOSf_NT
+ { TV_WinNTDriverCheck, 90, "WinNT" },
+ TV_WinGr_Driver_Entry
+ { TV_Win32DriverCheck, 50, "Win32" },
+ #else
+ { TV_Win32DriverCheck, 90, "Win32" },
+ TV_WinGr_Driver_Entry
+ { TV_WinNTDriverCheck, 50, "WinNT" },
+ #endif
+ #endif
+
+ #ifdef HAVE_ALLEGRO
+ { TV_AlconDriverCheck, 30, "AlCon" },
+ #endif
+};
+
+const int nDrivers=sizeof(Drivers)/sizeof(stDriver);
+
+static
+int cmpDrivers(const void *v1, const void *v2)
+{
+ int p1=((stDriver *)v1)->priority;
+ int p2=((stDriver *)v2)->priority;
+ return (p1<p2)-(p1>p2);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This constructor is called when the TApplication object is created. The
+TProgramInit constructor creates a dynamic copy instance of a TScreen
+object.@*
+ Actually it calls the detection routines to determine the best driver
+available. If non is found prints and error to the stderr output and aborts
+the execution.
+
+***************************************************************************/
+
+TScreen::TScreen() :
+ TDisplay()
+{
+ // When the real drivers creates a derived class they will call this
+ // constructor so we must avoid getting in an infinite loop.
+ // I know that's tricky but it helps to maintain compatibility with the
+ // old class structure.
+ if (initCalled)
+ return;
+ initCalled=1;
+
+ // Check if the user changed priorities
+ int changed=0,i;
+ long priority;
+ for (i=0; i<nDrivers; i++)
+ if (TVMainConfigFile::Search(Drivers[i].name,"Priority",priority))
+ {
+ Drivers[i].priority=(int)priority;
+ changed++;
+ }
+ // Sort the list if needed
+ if (changed)
+ qsort(Drivers,nDrivers,sizeof(stDriver),cmpDrivers);
+ // Now call the initializations
+ for (i=0; i<nDrivers && !driver; i++)
+ {
+ currentDriverShortName=Drivers[i].name;
+ driver=Drivers[i].driver();
+ }
+ if (!driver)
+ {
+ fprintf(stderr,"Error: Unsupported hardware\n");
+ currentDriverShortName=NULL;
+ exit(1);
+ }
+ long val=0;
+ if (optSearch("AvoidMoire",val))
+ avoidMoire=val;
+ val=0;
+ if (optSearch("AltKeysSetting",val))
+ TGKey::SetAltSettings(val);
+}
+
+TScreen::~TScreen()
+{
+ if (initCalled && driver)
+ {
+ initCalled=0; // Avoid actions in farther calls
+ delete driver;
+ driver=0;
+ }
+ else
+ // When we destroy the "driver" member it will call the specific destructor
+ // and it will call this destructor again (is a child class). This time we
+ // will have initCalled=0 and this suspend will be executed.
+ // The specific destructor should set suspended=1 if this suspend should be
+ // disabled.
+ suspend();
+}
+
+void TScreen::suspend()
+{
+ if (suspended) return;
+ suspended=1;
+ Suspend();
+}
+
+void TScreen::resume()
+{
+ if (!suspended) return;
+ suspended=0;
+ Resume();
+}
+
+void TScreen::getPaletteColors(int from, int number, TScreenColor *colors)
+{
+ while (number-- && from<16)
+ *(colors++)=ActualPalette[from++];
+}
+
+void TScreen::setPaletteColors(int from, int number, TScreenColor *colors)
+{
+ int num=setDisPaletteColors(from,number,colors);
+ if (num)
+ {
+ memcpy(ActualPalette+from,colors,num*sizeof(TScreenColor));
+ paletteModified=1;
+ }
+}
+
+void TScreen::resetPalette()
+{
+ setDisPaletteColors(0,16,OriginalPalette);
+ paletteModified=0;
+}
+
+const char *sep=",;";
+
+Boolean TScreen::parseUserPalette()
+{
+ char *sPal=optSearch("ScreenPalette");
+ //printf("parseUserPalette(): %s\n",sPal ? sPal : "None");
+ if (!sPal || !*sPal) return False;
+ memcpy(UserStartPalette,PC_BIOSPalette,sizeof(UserStartPalette));
+ int l=strlen(sPal);
+ AllocLocalStr(b,l+1);
+ memcpy(b,sPal,l+1);
+
+ char *s=strtok(b,sep),*end;
+ int index=0, R, G, B;
+ Boolean ret=False;
+ while (s)
+ {
+ for (;*s && isspace(*s); s++);
+ R=*s ? strtol(s,&end,0) : UserStartPalette[index].R;
+
+ s=strtok(NULL,sep);
+ if (!s) break;
+ for (;*s && isspace(*s); s++);
+ G=*s ? strtol(s,&end,0) : UserStartPalette[index].G;
+
+ s=strtok(NULL,sep);
+ if (!s) break;
+ for (;*s && isspace(*s); s++);
+ B=*s ? strtol(s,&end,0) : UserStartPalette[index].B;
+
+ UserStartPalette[index].R=R;
+ UserStartPalette[index].G=G;
+ UserStartPalette[index].B=B;
+ //printf("%d: %d,%d,%d\n",index,R,G,B);
+ index++;
+ ret=True;
+
+ s=strtok(NULL,sep);
+ }
+ return ret;
+}
+
+Boolean TScreen::optSearch(const char *variable, long &val)
+{
+ if (TVMainConfigFile::Search(currentDriverShortName,variable,val))
+ return True;
+ // If not found in the driver specific section search in the TV section
+ return TVMainConfigFile::Search(variable,val);
+}
+
+char *TScreen::optSearch(const char *variable)
+{
+ char *val=TVMainConfigFile::Search(currentDriverShortName,variable);
+ if (val)
+ return val;
+ // If not found in the driver specific section search in the TV section
+ return TVMainConfigFile::Search(variable);
+}
+
+TVScreenFontRequestCallBack
+ TScreen::setFontRequestCallBack(TVScreenFontRequestCallBack cb)
+{
+ TVScreenFontRequestCallBack old=frCB;
+ frCB=cb;
+ return old;
+}
+
diff --git a/tvision/classes/tscrollb.cc b/tvision/classes/tscrollb.cc
new file mode 100644
index 0000000..ca48196
--- /dev/null
+++ b/tvision/classes/tscrollb.cc
@@ -0,0 +1,360 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <ctype.h>
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TScrollBar
+#define Uses_TRect
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+#define Uses_TGroup
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#define Uses_TScreen
+#include <tv.h>
+
+#define cpScrollBar "\x04\x05\x05"
+
+// Constants for the scroll bar components
+const int csbUp=0,
+ csbDown=1,
+ csbDark=2,
+ csbMark=3,
+ csbBright=4;
+
+TScrollBar::TScrollBar( const TRect& bounds ) :
+ TView( bounds ),
+ value( 0 ),
+ minVal( 0 ),
+ maxVal( 0 ),
+ pgStep( 1 ),
+ arStep( 1 )
+{
+ if( size.x == 1 )
+ {
+ growMode = gfGrowLoX | gfGrowHiX | gfGrowHiY;
+ memcpy( chars, vChars, sizeof(vChars) );
+ }
+ else
+ {
+ growMode = gfGrowLoY | gfGrowHiX | gfGrowHiY;
+ memcpy( chars, hChars, sizeof(hChars) );
+ }
+ // This class can be "Braille friendly"
+ if (TScreen::getShowCursorEver())
+ state |= sfCursorVis;
+}
+
+void TScrollBar::draw()
+{
+ drawPos(getPos());
+}
+
+void TScrollBar::drawPos( int pos )
+{
+ TDrawBuffer b;
+ char *aChars;
+
+ // SET: If we can't remap characters use the originals
+ /*if (TScreen::codePageVariable())
+ aChars=chars;
+ else*/
+ // Unless somebody really needs the old behavior I'll just use it.
+ aChars=size.x==1 ? vChars : hChars;
+
+ int s = getSize() - 1;
+ b.moveChar( 0, aChars[csbUp], getColor(2), 1 );
+ if( maxVal == minVal )
+ {
+ char unFilled=TScreen::avoidMoire ? TView::noMoireUnFill : aChars[csbDark];
+ b.moveChar( 1, unFilled, getColor(1), s-1 );
+ }
+ else
+ {
+ char filled =TScreen::avoidMoire ? TView::noMoireFill : aChars[csbBright];
+ b.moveChar( 1, filled, getColor(1), s-1 );
+ b.moveChar( pos, aChars[csbMark], getColor(3), 1 );
+ if( state & sfFocused )
+ {
+ setCursor( pos , 0 );
+ resetCursor();
+ }
+ }
+
+ b.moveChar( s, aChars[csbDown], getColor(2), 1 );
+ writeBuf( 0, 0, size.x, size.y, b );
+}
+
+TPalette& TScrollBar::getPalette() const
+{
+ static TPalette palette( cpScrollBar, sizeof( cpScrollBar )-1 );
+ return palette;
+}
+
+int32 TScrollBar::getPos()
+{
+ int32 r = maxVal - minVal;
+ if( r == 0 )
+ return 1;
+ else
+ return int32(( ((long(value - minVal) * (getSize() - 3)) + (r >> 1)) / r) + 1);
+}
+
+int TScrollBar::getSize()
+{
+ int s;
+
+ if( size.x == 1 )
+ s = size.y;
+ else
+ s = size.x;
+
+ return max( 3, s );
+}
+
+static TPoint mouse;
+static int32 p, s;
+static TRect extent;
+
+int TScrollBar::getPartCode()
+{
+ int part= - 1;
+ if( extent.contains(mouse) )
+ {
+ int mark = (size.x == 1) ? mouse.y : mouse.x;
+
+ if (mark == p)
+ part= sbIndicator;
+ else
+ {
+ if( mark < 1 )
+ part = sbLeftArrow;
+ else if( mark < p )
+ part= sbPageLeft;
+ else if( mark < s )
+ part= sbPageRight;
+ else
+ part= sbRightArrow;
+
+ if( size.x == 1 )
+ part += 4;
+ }
+ }
+ return part;
+}
+
+void TScrollBar::handleEvent( TEvent& event )
+{
+ Boolean Tracking;
+ int i=0, clickPart;
+
+ TView::handleEvent(event);
+ switch( event.what )
+ {
+ case evMouseDown:
+ message(owner, evBroadcast, cmScrollBarClicked,this); // Clicked()
+ mouse = makeLocal( event.mouse.where );
+ extent = getExtent();
+ extent.grow(1, 1);
+ p = getPos();
+ s = getSize() - 1;
+ clickPart= getPartCode();
+ if( clickPart != sbIndicator )
+ {
+ do {
+ mouse = makeLocal( event.mouse.where );
+ if( getPartCode() == clickPart )
+ setValue(value + scrollStep(clickPart) );
+ } while( mouseEvent(event, evMouseAuto) );
+ }
+ else
+ {
+ do {
+ mouse = makeLocal( event.mouse.where );
+ Tracking = extent.contains(mouse);
+ if( Tracking )
+ {
+ if( size.x == 1 )
+ i = mouse.y;
+ else
+ i = mouse.x;
+ i = max( i, 1 );
+ i = min( i, s-1 );
+ }
+ else
+ i = getPos();
+ if(i != p )
+ {
+ drawPos(i);
+ p = i;
+ }
+ } while( mouseEvent(event,evMouseMove) );
+ if( Tracking && s > 2 )
+ {
+ s -= 2;
+ setValue( int(((long(p - 1) * (maxVal - minVal) + (s >> 1)) / s) + minVal));
+ }
+ }
+ clearEvent(event);
+ break;
+ case evKeyDown:
+ if( (state & sfVisible) != 0 )
+ {
+ clickPart = sbIndicator;
+ if( size.y == 1 )
+ switch( ctrlToArrow(event.keyDown.keyCode) )
+ {
+ case kbLeft:
+ clickPart = sbLeftArrow;
+ break;
+ case kbRight:
+ clickPart = sbRightArrow;
+ break;
+ case kbCtrlLeft:
+ clickPart = sbPageLeft;
+ break;
+ case kbCtrlRight:
+ clickPart = sbPageRight;
+ break;
+ case kbHome:
+ i = minVal;
+ break;
+ case kbEnd:
+ i = maxVal;
+ break;
+ default:
+ return;
+ }
+ else
+ switch( ctrlToArrow(event.keyDown.keyCode) )
+ {
+ case kbUp:
+ clickPart = sbUpArrow;
+ break;
+ case kbDown:
+ clickPart = sbDownArrow;
+ break;
+ case kbPgUp:
+ clickPart = sbPageUp;
+ break;
+ case kbPgDn:
+ clickPart = sbPageDown;
+ break;
+ case kbCtrlPgUp:
+ i = minVal;
+ break;
+ case kbCtrlPgDn:
+ i = maxVal;
+ break;
+ default:
+ return;
+ }
+ message(owner,evBroadcast,cmScrollBarClicked,this); // Clicked
+ if( clickPart != sbIndicator )
+ i = value + scrollStep(clickPart);
+ setValue(i);
+ clearEvent(event);
+ }
+ }
+}
+
+void TScrollBar::scrollDraw()
+{
+ message(owner, evBroadcast, cmScrollBarChanged,this);
+}
+
+int TScrollBar::scrollStep( int part )
+{
+ int step;
+
+ if( !(part & 2) )
+ step = arStep;
+ else
+ step = pgStep;
+ if( !(part & 1) )
+ return -step;
+ else
+ return step;
+}
+
+void TScrollBar::setParams( int32 aValue,
+ int32 aMin,
+ int32 aMax,
+ int aPgStep,
+ int aArStep
+ )
+{
+ int32 sValue;
+
+ aMax = max( aMax, aMin );
+ aValue = max( aMin, aValue );
+ aValue = min( aMax, aValue );
+ sValue = value;
+ if( sValue != aValue || minVal != aMin || maxVal != aMax )
+ {
+ value = aValue;
+ minVal = aMin;
+ maxVal = aMax;
+ drawView();
+ if( sValue != aValue )
+ scrollDraw();
+ }
+ pgStep = aPgStep;
+ arStep = aArStep;
+}
+
+void TScrollBar::setRange( int32 aMin, int32 aMax )
+{
+ setParams( value, aMin, aMax, pgStep, arStep );
+}
+
+void TScrollBar::setStep( int aPgStep, int aArStep )
+{
+ setParams( value, minVal, maxVal, aPgStep, aArStep );
+}
+
+void TScrollBar::setValue( int32 aValue )
+{
+ setParams( aValue, minVal, maxVal, pgStep, arStep );
+}
+
+#if !defined( NO_STREAM )
+void TScrollBar::write( opstream& os )
+{
+ TView::write( os );
+ os << value << minVal << maxVal << pgStep << arStep;
+ os.writeBytes(chars, sizeof(chars));
+}
+
+void *TScrollBar::read( ipstream& is )
+{
+ TView::read( is );
+ is >> value >> minVal >> maxVal >> pgStep >> arStep;
+ is.readBytes(chars, sizeof(TScrollChars));
+ return this;
+}
+
+TStreamable *TScrollBar::build()
+{
+ return new TScrollBar( streamableInit );
+}
+
+TScrollBar::TScrollBar( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tscrolle.cc b/tvision/classes/tscrolle.cc
new file mode 100644
index 0000000..14eb837
--- /dev/null
+++ b/tvision/classes/tscrolle.cc
@@ -0,0 +1,215 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to support mouse wheels and other things.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <ctype.h>
+#define Uses_string
+
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TEvent
+#define Uses_TRect
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#define Uses_TScreen
+#include <tv.h>
+
+#define cpScroller "\x06\x07"
+
+int TScroller::defaultWheelStep=5;
+
+TScroller::TScroller( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar) :
+ TView( bounds ),
+ drawLock( 0 ),
+ drawFlag( False ),
+ hScrollBar( aHScrollBar ),
+ vScrollBar( aVScrollBar )
+{
+ delta.x = delta.y = limit.x = limit.y = 0;
+ options |= ofSelectable;
+ eventMask |= evBroadcast;
+ wheelStep = defaultWheelStep;
+ // This class can be "Braille friendly"
+ if (TScreen::getShowCursorEver())
+ state |= sfCursorVis;
+}
+
+void TScroller::shutDown()
+{
+ hScrollBar = 0;
+ vScrollBar = 0;
+ TView::shutDown();
+}
+
+void TScroller::changeBounds( const TRect& bounds )
+{
+ setBounds(bounds);
+ drawLock++;
+ setLimit(limit.x, limit.y);
+ drawLock--;
+ drawFlag = False;
+ drawView();
+}
+
+void TScroller::checkDraw()
+{
+ if( drawLock == 0 && drawFlag != False )
+ {
+ drawFlag = False;
+ drawView();
+ }
+}
+
+TPalette& TScroller::getPalette() const
+{
+ static TPalette palette( cpScroller, sizeof( cpScroller )-1 );
+ return palette;
+}
+
+void TScroller::handleEvent(TEvent& event)
+{
+ TView::handleEvent(event);
+
+ if( event.what == evBroadcast &&
+ event.message.command == cmScrollBarChanged &&
+ ( event.message.infoPtr == hScrollBar ||
+ event.message.infoPtr == vScrollBar )
+ )
+ scrollDraw();
+ else
+ if( vScrollBar && event.what == evMouseDown)
+ {
+ if( event.mouse.buttons==mbButton4 )
+ {
+ vScrollBar->setValue( vScrollBar->value - wheelStep );
+ clearEvent( event );
+ }
+ else if( event.mouse.buttons==mbButton5 )
+ {
+ vScrollBar->setValue( vScrollBar->value + wheelStep );
+ clearEvent( event );
+ }
+ }
+}
+
+void TScroller::scrollDraw()
+{
+ TPoint d;
+
+ if( hScrollBar != 0 )
+ d.x = hScrollBar->value;
+ else
+ d.x = 0;
+
+ if( vScrollBar != 0 )
+ d.y = vScrollBar->value;
+ else
+ d.y = 0;
+
+ if( d.x != delta.x || d.y != delta.y )
+ {
+ setCursor( cursor.x + delta.x - d.x, cursor.y + delta.y - d.y );
+ delta = d;
+ if( drawLock != 0 )
+ drawFlag = True;
+ else
+ drawView();
+ }
+}
+
+void TScroller::scrollTo( int32 x, int32 y )
+{
+ drawLock++;
+ if( hScrollBar != 0 )
+ hScrollBar->setValue(x);
+ if( vScrollBar != 0 )
+ vScrollBar->setValue(y);
+ drawLock--;
+ checkDraw();
+}
+
+void TScroller::setLimit( int32 x, int32 y )
+{
+ limit.x = x;
+ limit.y = y;
+ drawLock++;
+ if( hScrollBar != 0 )
+ hScrollBar->setParams( hScrollBar->value,
+ 0,
+ x - size.x,
+ size.x,
+ 1
+ );
+ if( vScrollBar != 0 )
+ vScrollBar->setParams( vScrollBar->value,
+ 0,
+ y - size.y,
+ size.y,
+ 1
+ );
+ drawLock--;
+ checkDraw();
+}
+
+void TScroller::showSBar( TScrollBar *sBar )
+{
+ if( sBar != 0 )
+ {
+ if( getState(sfActive | sfSelected) != 0 )
+ sBar->show();
+ else
+ sBar->hide();
+ }
+}
+
+void TScroller::setState( ushort aState, Boolean enable )
+{
+ TView::setState(aState, enable);
+ if( (aState & (sfActive | sfSelected)) != 0 )
+ {
+ showSBar(hScrollBar);
+ showSBar(vScrollBar);
+ }
+}
+
+#if !defined( NO_STREAM )
+void TScroller::write( opstream& os )
+{
+ TView::write( os );
+ os << hScrollBar << vScrollBar << delta << limit;
+}
+
+void *TScroller::read( ipstream& is )
+{
+ TView::read( is );
+ is >> hScrollBar >> vScrollBar >> delta >> limit;
+ drawLock = 0;
+ drawFlag = False;
+ wheelStep= defaultWheelStep;
+ return this;
+}
+
+TStreamable *TScroller::build()
+{
+ return new TScroller( streamableInit );
+}
+
+TScroller::TScroller( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tsortedc.cc b/tvision/classes/tsortedc.cc
new file mode 100644
index 0000000..a7a2f0e
--- /dev/null
+++ b/tvision/classes/tsortedc.cc
@@ -0,0 +1,40 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TSortedCollection
+#include <tv.h>
+
+#if !defined( NO_STREAM )
+void TSortedCollection::write( opstream& os )
+{
+ TCollection::write( os );
+ os << (int)duplicates;
+}
+
+void *TSortedCollection::read( ipstream& is )
+{
+ TCollection::read( is );
+ int temp;
+ is >> temp;
+ duplicates = Boolean(temp);
+ return this;
+}
+
+TSortedCollection::TSortedCollection( StreamableInit ) :
+ TCollection( streamableInit )
+{
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tsortedl.cc b/tvision/classes/tsortedl.cc
new file mode 100644
index 0000000..4c1e60c
--- /dev/null
+++ b/tvision/classes/tsortedl.cc
@@ -0,0 +1,188 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to add functionality.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_ctype
+#define Uses_limits
+#define Uses_string
+#define Uses_TKeys
+#define Uses_TEvent
+#define Uses_TSortedListBox
+#define Uses_TSortedCollection
+#include <tv.h>
+
+#if 0
+ extern unsigned short getshiftstate(void);
+ #define shiftKeys (char)(getshiftstate() & 0xff)
+#else
+ #define shiftKeys (char)(event.keyDown.shiftState & 0xFF)
+#endif
+
+TSortedListBox::TSortedListBox( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *aScrollBar) :
+ TListBox(bounds, aNumCols, aScrollBar),
+ shiftState( 0 ),
+ searchPos( USHRT_MAX )
+{
+ showCursor();
+ setCursor(1, 0);
+}
+
+// SET:
+TSortedListBox::TSortedListBox( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ Boolean aCenterOps) :
+ TListBox(bounds, aNumCols, aHScrollBar, aVScrollBar, aCenterOps),
+ shiftState( 0 ),
+ searchPos( USHRT_MAX )
+{
+ showCursor();
+ setCursor(1, 0);
+}
+
+static Boolean TVision_equal( const char *s1, const char *s2, ushort count)
+{
+ return Boolean( strncasecmp( s1, s2, count ) == 0 );
+}
+
+void TSortedListBox::handleEvent(TEvent& event)
+{
+ char curString[256], newString[256];
+ void* k;
+ int value, oldPos, oldValue;
+
+ oldValue = focused;
+ TListBox::handleEvent( event );
+ if( oldValue != focused )
+ searchPos = USHRT_MAX;
+ if (event.what == evBroadcast &&
+ event.message.command == cmListItemSelected &&
+ event.message.infoPtr == list())
+ {
+ /* When the item was selected, reset the search feature */
+ searchPos = USHRT_MAX;
+ clearEvent(event);
+ return;
+ }
+ if( event.what == evKeyDown )
+ {
+ if( event.keyDown.keyCode != kbEnter &&
+ ( event.keyDown.charScan.charCode != 0 ||
+ event.keyDown.keyCode == kbBack ) )
+ {
+ value = focused;
+ if( value < range )
+ getText( curString, value, 255 );
+ else
+ *curString = EOS;
+ oldPos = searchPos;
+ if( event.keyDown.keyCode == kbBack )
+ {
+ if( searchPos == USHRT_MAX )
+ return;
+ // SET: 1) Avoid accessing curString[USHRT_MAX], 2) Do in the right order
+ curString[searchPos--] = EOS;
+ if( searchPos == USHRT_MAX )
+ shiftState = shiftKeys;
+ }
+ else if( (event.keyDown.charScan.charCode == '.') )
+ {
+ char *loc = strchr( curString+
+ (searchPos==USHRT_MAX ? 0 : searchPos), '.' );
+ if( loc )
+ {
+ searchPos = ushort(loc - curString);
+ if (oldPos == USHRT_MAX)
+ oldPos = 0;
+ }
+ else
+ {
+ if (searchPos == USHRT_MAX)
+ {
+ searchPos++;
+ curString[searchPos] = '.';
+ curString[searchPos+1] = EOS;
+ oldPos = 0;
+ }
+ }
+ }
+ else
+ {
+ searchPos++;
+ if( searchPos == 0 )
+ {
+ shiftState = shiftKeys;
+ oldPos = 0;
+ }
+ curString[searchPos] = event.keyDown.charScan.charCode;
+ curString[searchPos+1] = EOS;
+ }
+ k = getKey(curString);
+ list()->search( k, value );
+ if( value < range )
+ {
+ getText( newString, value, 255 );
+ if( TVision_equal( curString, newString, searchPos+1 ) )
+ {
+ if( value != oldValue )
+ {
+ focusItem(value);
+ setCursor( cursor.x+searchPos, cursor.y );
+ }
+ else
+ setCursor(cursor.x+(searchPos-oldPos), cursor.y );
+ }
+ else
+ searchPos = oldPos;
+ }
+ else
+ searchPos = oldPos;
+ if( searchPos != oldPos ||
+ ucisalpha( event.keyDown.charScan.charCode )
+ )
+ clearEvent(event);
+ }
+ }
+}
+
+void* TSortedListBox::getKey( const char *s )
+{
+ return (void *)s;
+}
+
+void TSortedListBox::newList( TSortedCollection *aList )
+{
+ TListBox::newList( aList );
+ searchPos = USHRT_MAX;
+}
+
+TStreamable *TSortedListBox::build()
+{
+ return new TSortedListBox( streamableInit );
+}
+
+void *TSortedListBox::read( ipstream& is )
+{
+ TListBox::read(is);
+
+ // Must initialize these or serious memory overwrite
+ // problems can occur!
+ searchPos = (ushort)-1;
+ shiftState = 0;
+
+ return this;
+}
diff --git a/tvision/classes/tstatict.cc b/tvision/classes/tstatict.cc
new file mode 100644
index 0000000..5b78906
--- /dev/null
+++ b/tvision/classes/tstatict.cc
@@ -0,0 +1,159 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+Modified by Salvador E. Tropea: added i18n support.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <ctype.h>
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_TStaticText
+#define Uses_TDrawBuffer
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#include <tv.h>
+
+#define cpStaticText "\x06"
+
+TStaticText::TStaticText( const TRect& bounds, const char *aText ) :
+ TView( bounds ),
+ text( newStr( aText ) ),
+ intlText( NULL ),
+ noIntl( 0 )
+{
+}
+
+TStaticText::TStaticText( const TRect& bounds, const char *aText,
+ stTVIntl *aIntlText ) :
+ TView( bounds ),
+ text( newStr( aText ) ),
+ intlText( aIntlText ),
+ noIntl( 0 )
+{
+}
+
+TStaticText::~TStaticText()
+{
+ DeleteArray((char *)text);
+ TVIntl::freeSt( intlText );
+}
+
+void TStaticText::draw()
+{
+ uchar color;
+ Boolean center;
+ int i, j, l, p, y;
+ TDrawBuffer b;
+ int maxLen = size.x*size.y;
+ AllocLocalStr(s,maxLen+1);
+
+ color = getColor(1);
+ getText(s, maxLen);
+ l = strlen(s);
+ p = 0;
+ y = 0;
+ center = False;
+ while (y < size.y)
+ {
+ b.moveChar(0, ' ', color, size.x);
+ if (p < l)
+ {
+ if (s[p] == 3)
+ {
+ center = True;
+ ++p;
+ }
+ i = p;
+ do {
+ j = p;
+ while ((p < l) && (s[p] == ' '))
+ ++p;
+ while ((p < l) && (s[p] != ' ') && (s[p] != '\n'))
+ ++p;
+ } while ((p < l) && (p < i + size.x) && (s[p] != '\n'));
+ if (p > i + size.x)
+ {
+ if (j > i)
+ p = j;
+ else
+ p = i + size.x;
+ }
+ if (center == True)
+ j = (size.x - p + i) / 2 ;
+ else
+ j = 0;
+ b.moveBuf(j, &s[i], color, (p - i));
+ while ((p < l) && (s[p] == ' '))
+ p++;
+ if ((p < l) && (s[p] == '\n'))
+ {
+ center = False;
+ p++;
+ if ((p < l) && (s[p] == 10))
+ p++;
+ }
+ }
+ writeLine(0, y++, size.x, 1, b);
+ }
+}
+
+TPalette& TStaticText::getPalette() const
+{
+ static TPalette palette( cpStaticText, sizeof( cpStaticText )-1 );
+ return palette;
+}
+
+const char *TStaticText::getText()
+{
+ return noIntl ? text : TVIntl::getText( text, intlText );
+}
+
+void TStaticText::getText( char *s, int maxLen )
+{
+ if( text == 0 )
+ *s = EOS;
+ else
+ {
+ const char *iText = getText();
+ strncpy( s, iText, maxLen );
+ s[maxLen] = 0;
+ }
+}
+
+#if !defined( NO_STREAM )
+void TStaticText::write( opstream& os )
+{
+ TView::write( os );
+ os.writeString( text );
+}
+
+void *TStaticText::read( ipstream& is )
+{
+ TView::read( is );
+ text = is.readString();
+ intlText = NULL;
+ return this;
+}
+
+TStreamable *TStaticText::build()
+{
+ return new TStaticText( streamableInit );
+}
+
+TStaticText::TStaticText( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tstatusd.cc b/tvision/classes/tstatusd.cc
new file mode 100644
index 0000000..9377b6e
--- /dev/null
+++ b/tvision/classes/tstatusd.cc
@@ -0,0 +1,43 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#include <tv.h>
+
+CLY_EXPORT TStatusDef& operator + ( TStatusDef& s1, TStatusItem& s2 )
+{
+ TStatusDef *def = &s1;
+ while( def->next != 0 )
+ def = def->next;
+ if( def->items == 0 )
+ def->items = &s2;
+ else
+ {
+ TStatusItem *cur = def->items;
+ while( cur->next != 0 )
+ cur = cur->next;
+ cur->next = &s2;
+ }
+ return s1;
+}
+
+CLY_EXPORT TStatusDef& operator + ( TStatusDef& s1, TStatusDef& s2 )
+{
+ TStatusDef *cur = &s1;
+ while( cur->next != 0 )
+ cur = cur->next;
+ cur->next = &s2;
+ return s1;
+}
+
diff --git a/tvision/classes/tstatusl.cc b/tvision/classes/tstatusl.cc
new file mode 100644
index 0000000..9c542fb
--- /dev/null
+++ b/tvision/classes/tstatusl.cc
@@ -0,0 +1,371 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#define Uses_TKeys
+#include <tv.h>
+
+#define cpStatusLine "\x02\x03\x04\x05\x06\x07"
+
+TStatusLine::TStatusLine( const TRect& bounds, TStatusDef& aDefs ) :
+ TView( bounds ),
+ defs( &aDefs )
+{
+ options |= ofPreProcess;
+ eventMask |= evBroadcast;
+ growMode = gfGrowLoY | gfGrowHiX | gfGrowHiY;
+ findItems();
+ computeLength();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This routine computes the length of the status line, if that's greater than
+the size.x the status line becomes compacted to allow more options.@*
+ Added by SET.
+
+***************************************************************************/
+
+void TStatusLine::computeLength()
+{
+ int l = 0;
+ TStatusItem *p;
+
+ if( items != 0 )
+ {
+ p = items;
+ while( p != 0 )
+ {
+ if( p->text != 0 )
+ l += cstrlen(TVIntl::getText(p->text,p->intlText)) + 2;
+ p = p->next;
+ }
+ }
+ compactStatus = l > size.x;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Calls TView::changeBounds, additionally re-computes the length of the
+line to select the no/compact mode.@*
+ Added by SET.
+
+***************************************************************************/
+
+void TStatusLine::changeBounds(const TRect& bounds)
+{
+ TView::changeBounds(bounds);
+ int oldCompact=compactStatus;
+ computeLength();
+ if (compactStatus!=oldCompact)
+ draw();
+}
+
+void TStatusLine::disposeItems( TStatusItem *item )
+{
+ while( item != 0 )
+ {
+ TStatusItem *T = item;
+ item = item->next;
+ delete(T);
+ }
+}
+
+TStatusLine::~TStatusLine(void)
+{
+ while( defs != 0 )
+ {
+ TStatusDef *T = defs;
+ defs = defs->next;
+ disposeItems( T->items );
+ delete(T);
+ }
+}
+
+void TStatusLine::draw()
+{
+ drawSelect( 0 );
+}
+
+void TStatusLine::drawSelect( TStatusItem *selected )
+{
+ TDrawBuffer b;
+ ushort color;
+ char hintBuf[256];
+
+ ushort cNormal = getColor(0x0301);
+ ushort cSelect = getColor(0x0604);
+ ushort cNormDisabled = getColor(0x0202);
+ ushort cSelDisabled = getColor(0x0505);
+ b.moveChar( 0, ' ', cNormal, size.x );
+ TStatusItem *T = items;
+ int i = 0, inc = (compactStatus ? 1 : 2); // SET
+
+ while( T != 0 )
+ {
+ if( T->text != 0 )
+ {
+ int l = cstrlen( TVIntl::getText(T->text,T->intlText) );
+ if( i + l < size.x )
+ {
+ if( commandEnabled( T->command) )
+ if( T == selected )
+ color = cSelect;
+ else
+ color = cNormal;
+ else
+ if( T == selected )
+ color = cSelDisabled;
+ else
+ color = cNormDisabled;
+
+ b.moveChar( i, ' ', color, 1 );
+ b.moveCStr( i+1, TVIntl::getText(T->text,T->intlText), color );
+ b.moveChar( i+l+1, ' ', color, 1 );
+ }
+ i += l + inc;
+ }
+ T = T->next;
+ }
+ if (size.y == 1)
+ {
+ if( i < size.x - 2 )
+ {
+ strcpy( hintBuf, hint( helpCtx ) );
+ if( *hintBuf != EOS )
+ {
+ b.moveStr( i, hintSeparator, cNormal );
+ i += 2;
+ if( (int32)strlen(hintBuf) + i > size.x )
+ hintBuf[size.x-i] = EOS;
+ b.moveCStr( i, hintBuf, cNormal );
+ }
+ }
+ writeLine( 0, 0, size.x, 1, b );
+ }
+ else
+ {
+ writeLine( 0, 0, size.x, 1, b );
+ strcpy( hintBuf, hint( helpCtx ) );
+ hintBuf[size.x] = 0;
+ b.moveChar(0, ' ', cNormal, size.x);
+ b.moveCStr(0, hintBuf, cNormal);
+ writeLine( 0, 1, size.x, 1, b );
+ }
+}
+
+void TStatusLine::findItems()
+{
+ TStatusDef *p = defs;
+ while( p != 0 && ( helpCtx < p->min || helpCtx > p->max ) )
+ p = p->next;
+ items = ( p == 0 ) ? 0 : p->items;
+}
+
+TPalette& TStatusLine::getPalette() const
+{
+ static TPalette palette( cpStatusLine, sizeof( cpStatusLine )-1 );
+ return palette;
+}
+
+TStatusItem *TStatusLine::itemMouseIsIn( TPoint mouse )
+{
+ if( mouse.y != 0 )
+ return 0;
+
+ int i, inc = (compactStatus ? 1 : 2); // SET
+ TStatusItem *T;
+
+ for( i = 0, T = items; T != 0; T = T->next)
+ {
+ if( T->text != 0 )
+ {
+ int k = i + cstrlen(TVIntl::getText(T->text,T->intlText)) + inc;
+ if( mouse.x >= i && mouse. x < k )
+ return T;
+ i = k;
+ }
+ }
+ return 0;
+}
+
+void TStatusLine::handleEvent( TEvent& event )
+{
+ TView::handleEvent(event);
+
+ switch (event.what)
+ {
+ case evMouseDown:
+ {
+ TStatusItem *T = 0;
+
+ do {
+ TPoint mouse = makeLocal( event.mouse.where );
+ if( T != itemMouseIsIn(mouse) )
+ drawSelect( T = itemMouseIsIn(mouse) );
+ } while( mouseEvent( event, evMouseMove ) );
+
+ if( T != 0 && commandEnabled(T->command) )
+ {
+ event.what = evCommand;
+ event.message.command = T->command;
+ event.message.infoPtr = 0;
+ putEvent(event);
+ }
+ clearEvent(event);
+ drawView();
+ break;
+ }
+ case evKeyDown:
+ {
+ for( TStatusItem *T = items; T != 0; T = T->next )
+ {
+ if( T->keyCode != kbNoKey &&
+ event.keyDown.keyCode == T->keyCode &&
+ commandEnabled(T->command))
+ {
+ event.what = evCommand;
+ event.message.command = T->command;
+ event.message.infoPtr = 0;
+ return;
+ }
+ }
+ break;
+ }
+ case evBroadcast:
+ if( event.message.command == cmCommandSetChanged )
+ drawView();
+ break;
+ }
+}
+
+const char* TStatusLine::hint( ushort )
+{
+ return "";
+}
+
+void TStatusLine::update()
+{
+ TView *p = TopView();
+ ushort h = ( p != 0 ) ? p->getHelpCtx() : hcNoContext;
+ if( helpCtx != h )
+ {
+ helpCtx = h;
+ findItems();
+ drawView();
+ }
+}
+
+#if !defined( NO_STREAM )
+void TStatusLine::writeItems( opstream& os, TStatusItem *ts )
+{
+ int count = 0;
+ for( TStatusItem *t = ts; t != 0; t = t->next )
+ count++;
+ os << count;
+ for( ; ts != 0; ts = ts->next )
+ {
+ os.writeString( ts->text );
+ os << ts->keyCode << ts->command;
+ }
+}
+
+void TStatusLine::writeDefs( opstream& os, TStatusDef *td )
+{
+ int count = 0;
+ for( TStatusDef *t = td; t != 0; t = t->next )
+ count++;
+ os << count;
+ for( ; td != 0; td = td->next )
+ {
+ os << td->min << td->max;
+ writeItems( os, td->items );
+ }
+}
+
+void TStatusLine::write( opstream& os )
+{
+ TView::write( os );
+ writeDefs( os, defs );
+}
+
+TStatusItem *TStatusLine::readItems( ipstream& is )
+{
+ TStatusItem *cur = 0;
+ TStatusItem *first;
+ TStatusItem **last = &first;
+ int count;
+ is >> count;
+ while( count-- > 0 )
+ {
+ const char *t = is.readString();
+ ushort key, cmd;
+ is >> key >> cmd;
+ cur = new TStatusItem( t, key, cmd );
+ *last = cur;
+ last = &(cur->next);
+ }
+ *last = 0;
+ return first;
+}
+
+TStatusDef *TStatusLine::readDefs( ipstream& is )
+{
+ TStatusDef *cur = 0;
+ TStatusDef *first;
+ TStatusDef **last = &first;
+ int count;
+ is >> count;
+ while( count-- > 0 )
+ {
+ ushort min, max;
+ is >> min >> max;
+ cur = new TStatusDef( min, max, readItems( is ) );
+ *last = cur;
+ last = &(cur->next);
+ }
+ *last = 0;
+ return first;
+}
+
+void *TStatusLine::read( ipstream& is )
+{
+ TView::read( is );
+ defs = readDefs( is );
+ findItems();
+ return this;
+}
+
+TStreamable *TStatusLine::build()
+{
+ return new TStatusLine( streamableInit );
+}
+
+TStatusLine::TStatusLine( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/tstrinde.cc b/tvision/classes/tstrinde.cc
new file mode 100644
index 0000000..228da84
--- /dev/null
+++ b/tvision/classes/tstrinde.cc
@@ -0,0 +1,21 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TStrIndexRec
+#include <tv.h>
+
+TStrIndexRec::TStrIndexRec() :
+ count(0)
+{
+}
+
diff --git a/tvision/classes/tstringc.cc b/tvision/classes/tstringc.cc
new file mode 100644
index 0000000..4feb0a1
--- /dev/null
+++ b/tvision/classes/tstringc.cc
@@ -0,0 +1,65 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TStringCollection
+#define Uses_opstream
+#define Uses_ipstream
+#include <tv.h>
+
+TStringCollection::TStringCollection( ccIndex aLimit, ccIndex aDelta ) :
+ TSortedCollection(aLimit, aDelta)
+{
+}
+
+int TStringCollection::compare( void *key1, void *key2 )
+{
+ return strcmp( (char *)key1, (char *)key2 );
+}
+
+void TStringCollection::freeItem( void* item )
+{
+ delete[] (char *)item;
+}
+
+#if !defined( NO_STREAM )
+TStreamable *TStringCollection::build()
+{
+ return new TStringCollection( streamableInit );
+}
+
+void TStringCollection::writeItem( void *obj, opstream& os )
+{
+ os.writeString( (const char *)obj );
+}
+
+void *TStringCollection::readItem( ipstream& is )
+{
+ return is.readString();
+}
+#endif // NO_STREAM
+
+TStringCollection & TStringCollection::operator = (const TStringCollection & pl)
+{
+ int i;
+ duplicates = pl.duplicates;
+ freeAll();
+ for (i=0;i<pl.count;i++)
+ {
+ insert(strdup((char *)pl.items[i]));
+ }
+ return *this;
+}
+
diff --git a/tvision/classes/tstringl.cc b/tvision/classes/tstringl.cc
new file mode 100644
index 0000000..85cb51a
--- /dev/null
+++ b/tvision/classes/tstringl.cc
@@ -0,0 +1,86 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TStringList
+#define Uses_TStrIndexRec
+#define Uses_ipstream
+#include <tv.h>
+
+TStringList::~TStringList()
+{
+ int i;
+ for (i=indexSize;i>0;i--) delete (index+(i-1));
+/*
+ delete [indexSize] index;
+*/
+}
+
+
+void TStringList::get( char *dest, ushort key )
+{
+ if( indexSize == 0 )
+ {
+ *dest = EOS;
+ return;
+ }
+
+ TStrIndexRec *cur = index;
+ while ((cur->key + cur->count - 1 < key) && (cur - index < indexSize))
+ cur++;
+ if ((cur->key + cur->count - 1 < key) || (cur->key > key))
+ {
+ *dest = EOS;
+ return;
+ }
+
+ ip->seekg( basePos + cur->offset );
+ int count = key - cur->key;
+ do {
+ uchar sz = ip->readByte();
+ ip->readBytes( dest, sz );
+ dest[sz] = EOS;
+ } while( count-- > 0 );
+}
+
+#if !defined( NO_STREAM )
+void *TStringList::read( ipstream& is )
+{
+ ip = &is;
+
+ ushort strSize;
+ is >> strSize;
+
+ basePos = is.tellg();
+ is.seekg( basePos + strSize );
+ is >> indexSize;
+ index = new TStrIndexRec[indexSize];
+ is.readBytes( index, indexSize * sizeof( TStrIndexRec ) );
+ return this;
+}
+
+TStringList::TStringList( StreamableInit )
+{
+ basePos=0;
+ indexSize=0;
+ index=0;
+}
+
+TStreamable *TStringList::build()
+{
+ return new TStringList( streamableInit );
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tstrlist.cc b/tvision/classes/tstrlist.cc
new file mode 100644
index 0000000..97bdb7f
--- /dev/null
+++ b/tvision/classes/tstrlist.cc
@@ -0,0 +1,76 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TStrIndexRec
+#define Uses_TStrListMaker
+#define Uses_TStringList
+#define Uses_opstream
+#include <tv.h>
+
+TStrListMaker::TStrListMaker( ushort aStrSize, ushort aIndexSize )
+{
+ strPos=0;
+ strSize=0;
+ strings=new char[aStrSize];
+ indexPos=0;
+ indexSize=aIndexSize;
+ index=new TStrIndexRec[aIndexSize];
+}
+
+
+TStrListMaker::~TStrListMaker()
+{
+ delete strings;
+ delete[] index;
+}
+
+
+void TStrListMaker::closeCurrent()
+{
+ if( cur.count != 0 )
+ {
+ index[indexPos++] = cur;
+ cur.count = 0;
+ }
+}
+
+void TStrListMaker::put( ushort key, char *str )
+{
+ if( cur.count == MAXKEYS || key != cur.key + cur.count )
+ closeCurrent();
+ if( cur.count == 0 )
+ {
+ cur.key = key;
+ cur.offset = strPos;
+ }
+ int len = strlen( str );
+ strings[strPos] = len;
+ memmove( strings+strPos+1, str, len );
+ strPos += len+1;
+ cur.count++;
+}
+
+#if !defined( NO_STREAM )
+void TStrListMaker::write( opstream& os )
+{
+ closeCurrent();
+ os << strPos;
+ os.writeBytes( strings, strPos );
+ os << indexPos;
+ os.writeBytes( index, indexPos * sizeof( TStrIndexRec ) );
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tstrmcla.cc b/tvision/classes/tstrmcla.cc
new file mode 100644
index 0000000..f70e6ef
--- /dev/null
+++ b/tvision/classes/tstrmcla.cc
@@ -0,0 +1,26 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TStreamableClass
+#define Uses_pstream
+#include <tv.h>
+
+TStreamableClass::TStreamableClass( const char *n, BUILDER b, int d ) :
+ name( n ),
+ build( b ),
+ delta( d )
+{
+ pstream::initTypes();
+ pstream::registerType( this );
+}
+
diff --git a/tvision/classes/tstrmtyp.cc b/tvision/classes/tstrmtyp.cc
new file mode 100644
index 0000000..3ec7e38
--- /dev/null
+++ b/tvision/classes/tstrmtyp.cc
@@ -0,0 +1,62 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TStreamableClass
+#define Uses_TStreamableTypes
+#include <tv.h>
+
+TStreamableTypes::TStreamableTypes() : TNSSortedCollection( 5, 5 )
+{
+}
+
+// Avoid replacing new by MSS's macro
+#include <tv/no_mss.h>
+
+void *TStreamableTypes::operator new( size_t, void * arena )
+{
+ return arena;
+}
+
+#include <tv/yes_mss.h>
+
+TStreamableTypes::~TStreamableTypes()
+{
+}
+
+void TStreamableTypes::registerType( const TStreamableClass *d )
+{
+ insert( (void *)d );
+}
+
+const TStreamableClass *TStreamableTypes::lookup( const char *name )
+{
+ ccIndex loc;
+ if( search( (void *)name, loc ) )
+ return (TStreamableClass *)at( loc );
+ else
+ return 0;
+}
+
+void *TStreamableTypes::keyOf( void *d )
+{
+ return (void *)((TStreamableClass *)d)->name;
+}
+
+int TStreamableTypes::compare( void *d1, void *d2 )
+{
+ return strcmp( (char *)d1, (char *)d2 );
+}
+
diff --git a/tvision/classes/tsubmenu.cc b/tvision/classes/tsubmenu.cc
new file mode 100644
index 0000000..8b241fb
--- /dev/null
+++ b/tvision/classes/tsubmenu.cc
@@ -0,0 +1,50 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TMenu
+#include <tv.h>
+
+TSubMenu::TSubMenu( const char *nm, ushort key, ushort helpCtx ) :
+ TMenuItem( nm, 0, key, helpCtx )
+{
+}
+
+CLY_EXPORT TSubMenu& operator + ( TSubMenu& s, TMenuItem& i )
+{
+ TSubMenu *sub = &s;
+ while( sub->next != 0 )
+ sub = (TSubMenu *)(sub->next);
+
+ if( sub->subMenu == 0 )
+ sub->subMenu = new TMenu( i );
+ else
+ {
+ TMenuItem *cur = sub->subMenu->items;
+ while( cur->next != 0 )
+ cur = cur->next;
+ cur->next = &i;
+ }
+ return s;
+}
+
+CLY_EXPORT TSubMenu& operator + ( TSubMenu& s1, TSubMenu& s2 )
+{
+ TMenuItem *cur = &s1;
+ while( cur->next != 0 )
+ cur = cur->next;
+ cur->next = &s2;
+ return s1;
+}
+
diff --git a/tvision/classes/ttermina.cc b/tvision/classes/ttermina.cc
new file mode 100644
index 0000000..ab2f0b6
--- /dev/null
+++ b/tvision/classes/ttermina.cc
@@ -0,0 +1,242 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <tv/configtv.h>
+
+#define Uses_string
+
+#define Uses_TTextDevice
+#define Uses_TTerminal
+#define Uses_otstream
+#include <tv.h>
+
+UsingNamespaceStd
+
+TTerminal::TTerminal( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ uint32 aBufSize ) :
+ TTextDevice(bounds, aHScrollBar, aVScrollBar),
+ queFront( 0 ),
+ queBack( 0 )
+{
+ growMode = gfGrowHiX + gfGrowHiY;
+ bufSize = aBufSize;
+ buffer = new char[ bufSize ];
+ setLimit( 0, 1 );
+ setCursor( 0, 0 );
+ showCursor();
+}
+
+
+TTerminal::~TTerminal()
+{
+ delete buffer;
+}
+
+Boolean TTerminal::canInsert( uint32 amount )
+{
+ int32 T = (queFront < queBack) ?
+ ( queFront + amount ) :
+ ( int32(queFront) - bufSize + amount); // cast needed so we get
+ // signed comparison
+ return Boolean( (int32)queBack > T );
+}
+
+const int MaxLineLen=256;
+
+void TTerminal::draw()
+{
+ short i;
+ uint32 begLine, endLine;
+ char s[MaxLineLen];
+ int32 bottomLine;
+
+ bottomLine = size.y + delta.y;
+ if( limit.y > bottomLine )
+ {
+ endLine = prevLines( queFront, limit.y - bottomLine );
+ bufDec( endLine );
+ }
+ else
+ endLine = queFront;
+
+ if( limit.y > size.y )
+ i = size.y - 1;
+ else
+ {
+ for( i = limit.y; i <= size.y - 1; i++ )
+ writeChar(0, i, ' ', 1, size.x);
+ i = limit.y - 1;
+ }
+
+ for( ; i >= 0; i-- )
+ {
+ begLine = prevLines(endLine, 1);
+ if (endLine >= begLine)
+ {
+ int T = int( endLine - begLine );
+ if (T>=MaxLineLen)
+ T=MaxLineLen-1;
+ memcpy( s, &buffer[begLine], T );
+ s[T] = EOS;
+ }
+ else
+ {
+ int T=int( bufSize - begLine);
+ if (T>=MaxLineLen)
+ T=MaxLineLen-1;
+ memcpy( s, &buffer[begLine], T );
+ int T2=endLine;
+ if (T+T2>=MaxLineLen)
+ T2=MaxLineLen-T-1;
+ memcpy( s+T, buffer, T2 );
+ s[T+T2] = EOS;
+ }
+ if( delta.x >= (int32)strlen(s) )
+ *s = EOS;
+ else
+ strcpy( s, &s[delta.x] );
+
+ writeStr( 0, i, s, 1 );
+ writeChar( strlen(s), i, ' ', 1, size.x );
+ endLine = begLine;
+ bufDec( endLine );
+ }
+}
+
+uint32 TTerminal::nextLine( uint32 pos )
+{
+ if( pos != queFront )
+ {
+ while( buffer[pos] != '\n' && pos != queFront )
+ bufInc(pos);
+ if( pos != queFront )
+ bufInc( pos );
+ }
+ return pos;
+}
+
+int TTerminal::do_sputn( const char *s, int count )
+{
+ ushort screenLines = limit.y;
+ int32 i;
+ for( i = 0; i < count; i++ )
+ if( s[i] == '\n' )
+ screenLines++;
+
+ while( !canInsert( count ) )
+ {
+ queBack = nextLine( queBack );
+ screenLines--;
+ }
+
+ if( queFront + count >= bufSize )
+ {
+ i = bufSize - queFront;
+ memcpy( &buffer[queFront], s, i );
+ memcpy( buffer, &s[i], count - i );
+ queFront = count - i;
+ }
+ else
+ {
+ memcpy( &buffer[queFront], s, count );
+ queFront += count;
+ }
+
+ setLimit( limit.x, screenLines );
+ scrollTo( 0, screenLines + 1 );
+ i = prevLines( queFront, 1 );
+ if( i <= (int32)queFront )
+ i = queFront - i;
+ else
+ i = bufSize - (i - queFront);
+ setCursor( i, screenLines - delta.y - 1 );
+ drawView();
+ return count;
+}
+
+Boolean TTerminal::queEmpty()
+{
+ return Boolean( queBack == queFront );
+}
+
+// The SSC code doesn't support as much as needed for it.
+#ifndef HAVE_SSC
+otstream::otstream( TTerminal *tt )
+ #ifdef CLY_ISOCpp98
+ // SET: Andris used it. It looks like the new standard doesn't have a
+ // default constructor
+ : std::ostream (tt)
+ #endif
+{
+ ios::init( tt );
+}
+// HAVE_SSC
+#endif
+
+// SET: It was really broken, but as we never used it...
+// I rewrote it. I also used bufInc and bufDec and made it inline. (instead
+// of the old macros).
+uint32 TTerminal::prevLines(uint32 posStart, uint32 Lines)
+{
+ uint32 pos=posStart;
+
+ // If that's the start just return, we can't go back. Remmember that's a
+ // circular buffer.
+ if (!Lines || pos==queBack)
+ return pos;
+
+ // go back 1 character, is to skip the EOL
+ bufDec(pos);
+
+ if (pos<queBack)
+ { // Scan the first half of the buffer
+ do
+ {
+ if (buffer[pos]=='\n')
+ {
+ Lines--;
+ if (!Lines)
+ {
+ bufInc(pos); // Because we are over the \n
+ return pos;
+ }
+ }
+ }
+ while (pos--);
+ // Not here, go to the end
+ pos=bufSize-1;
+ }
+
+ // Scan the second half (first from the point of view of the text)
+ do
+ {
+ if (buffer[pos]=='\n')
+ {
+ Lines--;
+ if (!Lines)
+ {
+ bufInc(pos);
+ return pos;
+ }
+ }
+ }
+ while (--pos>=queBack);
+
+ return queBack;
+}
+
diff --git a/tvision/classes/ttextdev.cc b/tvision/classes/ttextdev.cc
new file mode 100644
index 0000000..1ed4c6c
--- /dev/null
+++ b/tvision/classes/ttextdev.cc
@@ -0,0 +1,35 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#include <tv/configtv.h>
+
+#define Uses_TTextDevice
+#include <tv.h>
+
+TTextDevice::TTextDevice( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar) :
+ TScroller(bounds,aHScrollBar,aVScrollBar)
+{
+}
+
+int TTextDevice::overflow( int c )
+{
+ if( c != EOF )
+ {
+ char b = c;
+ do_sputn( &b, 1 );
+ }
+ return 1;
+}
+
diff --git a/tvision/classes/tvalidat.cc b/tvision/classes/tvalidat.cc
new file mode 100644
index 0000000..670a014
--- /dev/null
+++ b/tvision/classes/tvalidat.cc
@@ -0,0 +1,77 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+#include <limits.h>
+#include <stdio.h>
+
+#define Uses_ipstream
+#define Uses_opstream
+#define Uses_TValidator
+#include <tv.h>
+
+TValidator::TValidator() : status(0), options(0)
+{
+}
+
+Boolean TValidator::isValid(const char *)
+{
+ return True;
+}
+
+Boolean TValidator::isValidInput(char *,Boolean)
+{
+ return True;
+}
+
+ushort TValidator::transfer(char *,void *,TVTransfer)
+{
+ return 0;
+}
+
+Boolean TValidator::validate(const char *S)
+{
+ if (isValid(S))
+ return True;
+ error();
+ return False;
+}
+
+// Not in TV 2.0
+void TValidator::format(char *)
+{
+}
+
+void TValidator::error()
+{
+}
+
+#if !defined( NO_STREAM )
+TValidator::TValidator(StreamableInit)
+{
+}
+
+void TValidator::write(opstream & os)
+{
+ os << status << options;
+}
+
+void * TValidator::read(ipstream & is)
+{
+ is >> status >> options;
+ // status=0 TV 2.0
+ return this;
+}
+#endif // NO_STREAM
+
diff --git a/tvision/classes/tvedit1.cc b/tvision/classes/tvedit1.cc
new file mode 100644
index 0000000..b3d1f28
--- /dev/null
+++ b/tvision/classes/tvedit1.cc
@@ -0,0 +1,180 @@
+/* Modified by Robert Hoehne and Salvador Eduardo Tropea for the gcc port */
+/* Modified by Vadim Beloborodov to be used on WIN32 console */
+/* Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ Andris Pavenis. */
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Turbo Vision TVEDIT source file */
+/*----------------------------------------------------------*/
+
+#define Uses_stdarg
+#define Uses_stdlib
+#define Uses_string //strcpy()
+
+#define Uses_TApplication
+#define Uses_TEditWindow
+#define Uses_TDeskTop
+#define Uses_TRect
+#define Uses_TEditor
+#define Uses_TFileEditor
+#define Uses_TFileDialog
+#define Uses_TChDirDialog
+#define Uses_TEditorApp
+#define Uses_TVEdMac
+#define Uses_TVEdConstant
+#define Uses_TScreen
+
+#include <tv.h>
+
+UsingNamespaceStd
+
+TEditWindow *clipWindow;
+
+TEditWindow *TEditorApp::openEditor( const char *fileName, Boolean visible )
+{
+ TRect r = deskTop->getExtent();//TRect(0,0,80,6);
+ TView *p = validView( new TEditWindow( r, fileName, wnNoNumber ) );
+ if( !visible )
+ p->hide();
+ deskTop->insert( p );
+ return (TEditWindow *)p;
+}
+
+TEditorApp::TEditorApp() :
+ TProgInit( TEditorApp::initStatusLine,
+ TEditorApp::initMenuBar,
+ TEditorApp::initDeskTop
+ ),
+ TApplication()
+{
+
+ TCommandSet ts;
+ ts.enableCmd( cmSave );
+ ts.enableCmd( cmSaveAs );
+ ts.enableCmd( cmCut );
+ ts.enableCmd( cmCopy );
+ ts.enableCmd( cmPaste );
+ ts.enableCmd( cmClear );
+ ts.enableCmd( cmUndo );
+ ts.enableCmd( cmFind );
+ ts.enableCmd( cmReplace );
+ ts.enableCmd( cmSearchAgain );
+ disableCommands( ts );
+
+ TEditor::editorDialog = doEditDialog;
+ clipWindow = openEditor( 0, False );
+ if( clipWindow != 0 )
+ {
+ TEditor::clipboard = clipWindow->editor;
+ TEditor::clipboard->canUndo = False;
+ }
+}
+
+void TEditorApp::fileOpen()
+{
+ char fileName[PATH_MAX];
+ strcpy( fileName, "*" );
+
+ if( execDialog( new TFileDialog( "*", "Open file",
+ "~N~ame", fdOpenButton, 100 ), fileName) != cmCancel )
+ openEditor( fileName, True );
+}
+
+void TEditorApp::fileNew()
+{
+ openEditor( 0, True );
+}
+
+void TEditorApp::changeDir()
+{
+ execDialog( new TChDirDialog( cdNormal, 0 ), 0 );
+}
+
+void TEditorApp::dosShell()
+{
+ if( TScreen::noUserScreen() )
+ return;
+ suspend();
+ TScreen::System(CLY_GetShellName());
+ resume();
+ redraw();
+}
+
+void TEditorApp::showClip()
+{
+ clipWindow->select();
+ clipWindow->show();
+}
+
+void TEditorApp::tile()
+{
+ deskTop->tile( deskTop->getExtent() );
+}
+
+void TEditorApp::cascade()
+{
+ deskTop->cascade( deskTop->getExtent() );
+}
+
+
+
+void TEditorApp::handleEvent( TEvent& event )
+{
+ TApplication::handleEvent( event );
+ if( event.what != evCommand )
+ return;
+ else
+ switch( event.message.command )
+ {
+ case cmOpen:
+ if( event.message.infoPtr ) // JASC 2006, drag 'n' drop support
+ openEditor( (char *)event.message.infoPtr, True );
+ else
+ fileOpen();
+ break;
+
+ case cmNew:
+ fileNew();
+ break;
+
+ case cmChangeDrct:
+ changeDir();
+ break;
+
+ case cmCallShell:
+ dosShell();
+ break;
+
+ case cmShowClip:
+ showClip();
+ break;
+
+ case cmTile:
+ tile();
+ break;
+
+ case cmCascade:
+ cascade();
+ break;
+
+ default:
+ return ;
+ }
+ clearEvent( event );
+}
+
+#ifdef TEST
+int main(int argc, char *argv[])
+{
+ TEditorApp *myApp=new TEditorApp();
+ if (myApp)
+ {
+ myApp->run();
+ delete myApp;
+ }
+ return 0;
+}
+#endif
diff --git a/tvision/classes/tvedit2.cc b/tvision/classes/tvedit2.cc
new file mode 100644
index 0000000..79cf679
--- /dev/null
+++ b/tvision/classes/tvedit2.cc
@@ -0,0 +1,111 @@
+/* Modified by Robert Hoehne and Salvador Eduardo Tropea for the gcc port */
+/* Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ Andris Pavenis. */
+/* Modified for i18n support by Salvador Eduardo Tropea. */
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Turbo Vision TVEDIT source file */
+/*----------------------------------------------------------*/
+
+#define Uses_stdlib
+#define Uses_stdarg
+
+#define Uses_TDialog
+#define Uses_TDeskTop
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TObject
+#define Uses_TInputLine
+#define Uses_T1Label
+#define Uses_THistory
+#define Uses_TRect
+#define Uses_TCheckBoxes
+#define Uses_TButton
+#define Uses_MsgBox
+#define Uses_TSItem
+#define Uses_TEditor
+#define Uses_TEditorApp
+
+#include <tv.h>
+
+ushort execDialog( TDialog *d, void *data )
+{
+ // SET: set the data before checking if the dialog is valid.
+ // If we use validators that's very important.
+ if( d && data )
+ d->setData( data );
+ TView *p = TProgram::application->validView( d );
+ if( p == 0 )
+ return cmCancel;
+ else
+ {
+ ushort result = TProgram::deskTop->execView( p );
+ if( result != cmCancel && data != 0 )
+ p->getData( data );
+ TObject::CLY_destroy( p );
+ return result;
+ }
+}
+
+TDialog *createFindDialog()
+{
+ TDialog *d = new TDialog( TRect( 0, 0, 38, 12 ), __("Find") );
+
+ d->options |= ofCentered;
+
+ TInputLine *control = new TInputLine( TRect( 3, 3, 32, 4 ), 80 );
+ d->insert( control );
+ d->insert(
+ new T1Label( 2, 2, __("~T~ext to find"), control ) );
+ d->insert(
+ new THistory( TRect( 32, 3, 35, 4 ), control, 10 ) );
+
+ d->insert( new TCheckBoxes( TRect( 3, 5, 35, 7 ),
+ new TSItem( __("~C~ase sensitive"),
+ new TSItem( __("~W~hole words only"), 0 ))));
+
+ d->insert(
+ new TButton( TRect( 14, 9, 24, 11 ), __("O~K~"), cmOK, bfDefault ) );
+ d->insert(
+ new TButton( TRect( 26, 9, 36, 11 ), __("Cancel"), cmCancel, bfNormal ) );
+
+ d->selectNext( False );
+ return d;
+}
+
+TDialog *createReplaceDialog()
+{
+ TDialog *d = new TDialog( TRect( 0, 0, 40, 16 ), __("Replace") );
+
+ d->options |= ofCentered;
+
+ TInputLine *control = new TInputLine( TRect( 3, 3, 34, 4 ), 80 );
+ d->insert( control );
+ d->insert(
+ new T1Label( 2, 2, __("~T~ext to find"), control ) );
+ d->insert( new THistory( TRect( 34, 3, 37, 4 ), control, 10 ) );
+
+ control = new TInputLine( TRect( 3, 6, 34, 7 ), 80 );
+ d->insert( control );
+ d->insert( new T1Label( 2, 5, __("~N~ew text"), control ) );
+ d->insert( new THistory( TRect( 34, 6, 37, 7 ), control, 11 ) );
+
+ d->insert( new TCheckBoxes( TRect( 3, 8, 37, 12 ),
+ new TSItem(__("~C~ase sensitive"),
+ new TSItem(__("~W~hole words only"),
+ new TSItem(__("~P~rompt on replace"),
+ new TSItem(__("~R~eplace all"), 0 ))))));
+
+ d->insert(
+ new TButton( TRect( 17, 13, 27, 15 ), __("O~K~"), cmOK, bfDefault ) );
+ d->insert( new TButton( TRect( 28, 13, 38, 15 ),
+ __("Cancel"), cmCancel, bfNormal ) );
+
+ d->selectNext( False );
+
+ return d;
+}
+
diff --git a/tvision/classes/tvedit3.cc b/tvision/classes/tvedit3.cc
new file mode 100644
index 0000000..afe1397
--- /dev/null
+++ b/tvision/classes/tvedit3.cc
@@ -0,0 +1,208 @@
+/* Modified by Robert Hoehne and Salvador Eduardo Tropea for the gcc port */
+/* Modified by Vadim Beloborodov to be used on WIN32 console */
+/* Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ Andris Pavenis. */
+/* Modified by Salvador E. Tropea to use messageBox with formating. */
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Turbo Vision TVEDIT source file */
+/*----------------------------------------------------------*/
+
+// SET: Internationalized, changed Alt- by Alt+
+
+#define Uses_TApplication
+#define Uses_TMenuBar
+#define Uses_TRect
+#define Uses_TSubMenu
+#define Uses_TKeys
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TPoint
+#define Uses_TEditor
+#define Uses_MsgBox
+#define Uses_TFileDialog
+#define Uses_TDeskTop
+#define Uses_TEditorApp
+#define Uses_TVEdConstant
+#define Uses_stdarg
+
+#include <tv.h>
+
+TMenuBar *TEditorApp::initMenuBar( TRect r )
+{
+
+ TSubMenu& sub1 = *new TSubMenu( __("~F~ile"), kbAltF ) +
+ *new TMenuItem( __("~O~pen"), cmOpen, kbF3, hcNoContext, "F3" ) +
+ *new TMenuItem( __("~N~ew"), cmNew, kbNoKey ) +
+ *new TMenuItem( __("~S~ave"), cmSave, kbF2, hcNoContext, "F2" ) +
+ *new TMenuItem( __("S~a~ve as..."), cmSaveAs, kbNoKey ) +
+ newLine() +
+ *new TMenuItem( __("~C~hange dir..."), cmChangeDrct, kbNoKey ) +
+ *new TMenuItem( __("S~h~ell"), cmCallShell, kbNoKey ) +
+ *new TMenuItem( __("E~x~it"), cmQuit, kbAltX, hcNoContext, "Alt+X" );
+
+ TSubMenu& sub2 = *new TSubMenu( __("~E~dit"), kbAltE ) +
+ *new TMenuItem( __("~U~ndo"), cmUndo, kbNoKey ) +
+ newLine() +
+ *new TMenuItem( __("Cu~t~"), cmCut, kbShiftDel, hcNoContext, "Shift+Del" ) +
+ *new TMenuItem( __("~C~opy"), cmCopy, kbCtrlIns, hcNoContext, "Ctrl+Ins" ) +
+ *new TMenuItem( __("~P~aste"), cmPaste, kbShiftIns, hcNoContext, "Shift+Ins" ) +
+ *new TMenuItem( __("~S~how clipboard"), cmShowClip, kbNoKey ) +
+ newLine() +
+ *new TMenuItem( __("~C~lear"), cmClear, kbCtrlDel, hcNoContext, "Ctrl+Del" );
+
+ TSubMenu& sub3 = *new TSubMenu( __("~S~earch"), kbAltS ) +
+ *new TMenuItem( __("~F~ind..."), cmFind, kbNoKey ) +
+ *new TMenuItem( __("~R~eplace..."), cmReplace, kbNoKey ) +
+ *new TMenuItem( __("~S~earch again"), cmSearchAgain, kbNoKey );
+
+ TSubMenu& sub4 = *new TSubMenu( __("~W~indows"), kbAltW ) +
+ *new TMenuItem( __("~S~ize/move"),cmResize, kbCtrlF5, hcNoContext, "Ctrl+F5" ) +
+ *new TMenuItem( __("~Z~oom"), cmZoom, kbF5, hcNoContext, "F5" ) +
+ *new TMenuItem( __("~T~ile"), cmTile, kbNoKey ) +
+ *new TMenuItem( __("C~a~scade"), cmCascade, kbNoKey ) +
+ *new TMenuItem( __("~N~ext"), cmNext, kbF6, hcNoContext, "F6" ) +
+ *new TMenuItem( __("~P~revious"), cmPrev, kbShiftF6, hcNoContext, "Shift+F6" ) +
+ *new TMenuItem( __("~C~lose"), cmClose, kbAltF3, hcNoContext, "Alt+F3" );
+
+ /*TSubMenu& sub5 = *new TSubMenu( __("~O~ptions"), kbAltO )
+ + *new TMenuItem( __("~M~acros"), cmMacros, kbNoKey );*/
+
+ r.b.y = r.a.y+1;
+ return new TMenuBar( r, sub1 + sub2 + sub3 + sub4
+ //+ sub5
+ );
+}
+
+TStatusLine *TEditorApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y-1;
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // SET: F10 before the others so when the library maintains the
+ // cursor visible this option is pointed and the user have a
+ // hint about what to do.
+ *new TStatusItem( __("~F10~ Menu"), kbF10, cmMenu ) +
+ *new TStatusItem( __("~F2~ Save"), kbF2, cmSave ) +
+ *new TStatusItem( __("~F3~ Open"), kbF3, cmOpen ) +
+ *new TStatusItem( __("~Alt+F3~ Close"), kbAltF3, cmClose ) +
+ *new TStatusItem( __("~F5~ Zoom"), kbF5, cmZoom ) +
+ *new TStatusItem( __("~F6~ Next"), kbF6, cmNext ) +
+ *new TStatusItem( 0, kbCtrlF5, cmResize )
+ );
+
+}
+
+void TEditorApp::outOfMemory()
+{
+ messageBox(__("Not enough memory for this operation."), mfError | mfOKButton );
+}
+
+typedef char *_charPtr;
+typedef TPoint *PPoint;
+
+/**[txh]********************************************************************
+
+ Description:
+ This function provides the default dialog actions.@p
+ SET: I modified it to be easy to overwrite some actions. See the real
+function.
+
+***************************************************************************/
+
+ushort doEditDialogDefault( int dialog, va_list arg )
+{
+ char *s;
+ switch( dialog )
+ {
+ case edOutOfMemory:
+ return messageBox( __("Not enough memory for this operation."),
+ mfError | mfOKButton );
+ case edReadError:
+ {
+ s=va_arg( arg, _charPtr );
+ va_end(arg);
+ return messageBox( mfError | mfOKButton,
+ __("Error reading file %s."), s );
+ }
+ case edWriteError:
+ {
+ s=va_arg( arg, _charPtr );
+ va_end( arg );
+ return messageBox( mfError | mfOKButton,
+ __("Error writing file %s."), s );
+ }
+ case edCreateError:
+ {
+ s=va_arg( arg, _charPtr );
+ va_end( arg );
+ return messageBox( mfError | mfOKButton,
+ __("Error creating file %s."), s );
+ }
+ case edSaveModify:
+ {
+ s=va_arg( arg, _charPtr );
+ va_end( arg );
+ return messageBox( mfInformation | mfYesNoCancel,
+ __("%s has been modified. Save?"), s );
+ }
+ case edSaveUntitled:
+ return messageBox( __("Save untitled file?"),
+ mfInformation | mfYesNoCancel );
+ case edSaveAs:
+ {
+ return execDialog( new TFileDialog( "*",
+ __("Save file as"),
+ __("~N~ame"),
+ fdOKButton,
+ 101 ), va_arg( arg, _charPtr ) );
+ }
+
+ case edFind:
+ {
+ return execDialog( createFindDialog(), va_arg( arg, _charPtr ) );
+ }
+
+ case edSearchFailed:
+ return messageBox( __("Search string not found."),
+ mfError | mfOKButton );
+ case edReplace:
+ {
+ return execDialog( createReplaceDialog(), va_arg( arg, _charPtr ) );
+ }
+
+ case edReplacePrompt:
+ {
+ // Avoid placing the dialog on the same line as the cursor
+ TRect r( 0, 1, 40, 8 );
+ r.move( (TProgram::deskTop->size.x-r.b.x)/2, 0 );
+ TPoint t = TProgram::deskTop->makeGlobal( r.b );
+ t.y++;
+ TPoint *pt = va_arg( arg, PPoint );
+ if( pt->y <= t.y )
+ r.move( 0, TProgram::deskTop->size.y - r.b.y - 2 );
+ va_end( arg );
+ return messageBoxRect( r, __("Replace this occurence?"),
+ mfYesNoCancel | mfInformation );
+ }
+ default:
+ return cmCancel;
+ }
+}
+
+ushort doEditDialog( int dialog, ... )
+{ // Just call the default
+ va_list arg;
+
+ va_start(arg, dialog);
+ ushort ret=doEditDialogDefault(dialog,arg);
+ va_end(arg);
+ return ret;
+}
+
+
diff --git a/tvision/classes/tview.cc b/tvision/classes/tview.cc
new file mode 100644
index 0000000..005ab44
--- /dev/null
+++ b/tvision/classes/tview.cc
@@ -0,0 +1,1249 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Vadim Beloborodov to be used on WIN32 console
+Modified cursor behavior while desktop locked by Salvador E. Tropea (SET)
+ Rewrote call50() to support on the fly remapping and avoid using
+ setCharacter.
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+#define Uses_stdio
+#define Uses_AllocLocal
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TView
+#define Uses_TCommandSet
+#define Uses_TPoint
+#define Uses_TGroup
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TScreen
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#define Uses_TVCodePage
+
+#include <tv.h>
+
+#include <limits.h>
+#if 0 // def TVCompf_djgpp
+#include <dos.h>
+#include <go32.h>
+#include <dpmi.h>
+#include <sys/movedata.h>
+#include <sys/farptr.h>
+#endif
+
+TPoint shadowSize = {2,1};
+uchar shadowAttr = 0x08;
+Boolean TView::showMarkers = False;
+uchar TView::errorAttr = 0xCF;
+Boolean TView::commandSetChanged = False;
+
+extern TView *TheTopView;
+
+static TCommandSet initCommands()
+{
+ TCommandSet temp;
+ temp.enableAllCommands();
+ temp.disableCmd( cmZoom );
+ temp.disableCmd( cmClose );
+ temp.disableCmd( cmResize );
+ temp.disableCmd( cmNext );
+ temp.disableCmd( cmPrev );
+ return temp;
+}
+
+TCommandSet TView::curCommandSet = initCommands();
+
+TView::TView( const TRect& bounds) :
+ next( 0 ),
+ options( 0 ), eventMask( evMouseDown | evKeyDown | evCommand ),
+ state( sfVisible ),
+ growMode( 0 ), dragMode( dmLimitLoY ), helpCtx( hcNoContext ),
+ owner( 0 )
+{
+ setBounds( bounds);
+ cursor.x = cursor.y = 0;
+}
+
+TView::~TView()
+{
+}
+
+void TView::blockCursor()
+{
+ setState(sfCursorIns, True);
+}
+
+#define grow(i) (( (growMode & gfGrowRel)) ? \
+ (i = (i * s + ((s - d) >> 1)) / (s - d)) : (i += d))
+
+inline int range( int val, int min, int max )
+{
+ if( val < min )
+ return min;
+ else if( val > max )
+ return max;
+ else
+ return val;
+}
+
+void TView::calcBounds( TRect& bounds, TPoint delta )
+{
+ bounds = getBounds();
+
+ int s = owner->size.x;
+ int d = delta.x;
+
+ if( (growMode & gfGrowLoX) != 0 )
+ grow(bounds.a.x);
+
+ if( (growMode & gfGrowHiX) != 0 )
+ grow(bounds.b.x);
+
+ s = owner->size.y;
+ d = delta.y;
+
+ if( (growMode & gfGrowLoY) != 0 )
+ grow(bounds.a.y);
+
+ if( (growMode & gfGrowHiY) != 0 )
+ grow(bounds.b.y);
+
+ TPoint minLim, maxLim;
+ sizeLimits( minLim, maxLim );
+ bounds.b.x = bounds.a.x + range( bounds.b.x-bounds.a.x, minLim.x, maxLim.x );
+ bounds.b.y = bounds.a.y + range( bounds.b.y-bounds.a.y, minLim.y, maxLim.y );
+}
+
+void TView::changeBounds( const TRect& bounds )
+{
+ setBounds(bounds);
+ drawView();
+}
+
+void TView::clearEvent( TEvent& event )
+{
+ event.what = evNothing;
+ event.message.infoPtr = this;
+}
+
+Boolean TView::commandEnabled( ushort command )
+{
+ return Boolean(/* (command > 0x3FF) || // is now handled by
+ // curCommandSet.has(command) */
+ curCommandSet.has(command));
+}
+
+uint32 TView::dataSize()
+{
+ return 0;
+}
+
+void TView::disableCommands( TCommandSet& commands )
+{
+ commandSetChanged = Boolean( commandSetChanged ||
+ !(curCommandSet & commands).isEmpty());
+ curCommandSet.disableCmd(commands);
+}
+
+void TView::disableCommand( ushort command )
+{
+ commandSetChanged = Boolean( commandSetChanged ||
+ curCommandSet.has(command) );
+ curCommandSet.disableCmd(command);
+}
+
+void TView::moveGrow( TPoint p,
+ TPoint s,
+ TRect& limits,
+ TPoint minSize,
+ TPoint maxSize,
+ uchar mode
+ )
+{
+ TRect r;
+ s.x = min(max(s.x, minSize.x), maxSize.x);
+ s.y = min(max(s.y, minSize.y), maxSize.y);
+ p.x = min(max(p.x, limits.a.x - s.x+1), limits.b.x-1);
+ p.y = min(max(p.y, limits.a.y - s.y+1), limits.b.y-1);
+
+ if( (mode & dmLimitLoX) != 0 )
+ p.x = max(p.x, limits.a.x);
+ if( (mode & dmLimitLoY) != 0 )
+ p.y = max(p.y, limits.a.y);
+ if( (mode & dmLimitHiX) != 0 )
+ p.x = min(p.x, limits.b.x-s.x);
+ if( (mode & dmLimitHiY) != 0 )
+ p.y = min(p.y, limits.b.y-s.y);
+ r = TRect(p.x, p.y, p.x + s.x, p.y + s.y);
+ locate(r);
+}
+
+// No longer needed, now passed as parameter "grow"
+//extern unsigned short getshiftstate(void);
+
+void TView::change( uchar mode, TPoint delta, TPoint& p, TPoint& s, int grow )
+{
+ if( (mode & dmDragMove) != 0 && !grow )
+ p += delta;
+ else if( (mode & dmDragGrow) != 0 && grow )
+ s += delta;
+}
+
+void TView::dragView( TEvent& event,
+ uchar mode,
+ TRect& limits,
+ TPoint minSize,
+ TPoint maxSize
+ )
+{
+ TRect saveBounds;
+
+ TPoint p, s;
+ setState( sfDragging, True );
+
+ if( event.what == evMouseDown )
+ {
+ if( (mode & dmDragMove) != 0 )
+ {
+ p = origin - event.mouse.where;
+ do {
+ event.mouse.where += p;
+ moveGrow( event.mouse.where,
+ size,
+ limits,
+ minSize,
+ maxSize,
+ mode
+ );
+ } while( mouseEvent(event,evMouseMove) );
+ }
+ else
+ {
+ p = size - event.mouse.where;
+ do {
+ event.mouse.where += p;
+ moveGrow( origin,
+ event.mouse.where,
+ limits,
+ minSize,
+ maxSize,
+ mode
+ );
+ } while( mouseEvent(event,evMouseMove) );
+ }
+ }
+ else
+ {
+ static TPoint
+ goLeft = {-1, 0},
+ goRight = { 1, 0},
+ goUp = { 0,-1},
+ goDown = { 0, 1},
+ goCtrlLeft = {-8, 0},
+ goCtrlRight = { 8, 0};
+
+ saveBounds = getBounds();
+ do {
+ p = origin;
+ s = size;
+ keyEvent(event);
+ switch (event.keyDown.keyCode)
+ {
+ case kbLeft:
+ change(mode,goLeft,p,s);
+ break;
+ case kbRight:
+ change(mode,goRight,p,s);
+ break;
+ case kbUp:
+ change(mode,goUp,p,s);
+ break;
+ case kbDown:
+ change(mode,goDown,p,s);
+ break;
+ case kbCtLeft:
+ change(mode,goCtrlLeft,p,s);
+ break;
+ case kbCtRight:
+ change(mode,goCtrlRight,p,s);
+ break;
+ // Shift info goes in the key
+ case kbShLeft:
+ change(mode,goLeft,p,s,1);
+ break;
+ case kbShRight:
+ change(mode,goRight,p,s,1);
+ break;
+ case kbShUp:
+ change(mode,goUp,p,s,1);
+ break;
+ case kbShDown:
+ change(mode,goDown,p,s,1);
+ break;
+ case kbShCtLeft:
+ change(mode,goCtrlLeft,p,s,1);
+ break;
+ case kbShCtRight:
+ change(mode,goCtrlRight,p,s,1);
+ break;
+ case kbHome:
+ p.x = limits.a.x;
+ break;
+ case kbEnd:
+ p.x = limits.b.x - s.x;
+ break;
+ case kbPgUp:
+ p.y = limits.a.y;
+ break;
+ case kbPgDn:
+ p.y = limits.b.y - s.y;
+ break;
+ }
+ moveGrow( p, s, limits, minSize, maxSize, mode );
+ } while( event.keyDown.keyCode != kbEsc &&
+ event.keyDown.keyCode != kbEnter
+ );
+ if( event.keyDown.keyCode == kbEsc )
+ locate(saveBounds);
+ }
+ setState(sfDragging, False);
+}
+
+void TView::draw()
+{
+ TDrawBuffer b;
+
+ b.moveChar( 0, ' ', getColor(1), size.x );
+ writeLine( 0, 0, size.x, size.y, b );
+}
+
+void TView::drawCursor()
+{
+ // SET: do it only if our owner gives permission
+ if( (state & sfFocused) != 0 && owner && owner->canShowCursor())
+ resetCursor();
+}
+
+void TView::drawHide( TView* lastView )
+{
+ drawCursor();
+ drawUnderView(Boolean(state & sfShadow), lastView);
+}
+
+void TView::drawShow( TView* lastView )
+{
+ drawView();
+ if( (state & sfShadow) != 0 )
+ drawUnderView( True, lastView );
+}
+
+void TView::drawUnderRect( TRect& r, TView* lastView )
+{
+ owner->clip.intersect(r);
+ owner->drawSubViews(nextView(), lastView);
+ owner->clip = owner->getExtent();
+}
+
+void TView::drawUnderView( Boolean doShadow, TView* lastView )
+{
+ TRect r = getBounds();
+ if( doShadow != False )
+ r.b += shadowSize;
+ drawUnderRect( r, lastView );
+}
+
+void TView::drawView()
+{
+ if (exposed())
+ {
+ draw();
+ drawCursor();
+ }
+}
+
+void TView::enableCommands( TCommandSet& commands )
+{
+ commandSetChanged = Boolean( commandSetChanged ||
+ ((curCommandSet&commands) != commands) );
+ curCommandSet += commands;
+}
+
+void TView::enableCommand( ushort command )
+{
+ commandSetChanged = Boolean( commandSetChanged ||
+ !curCommandSet.has( command ) );
+ curCommandSet += command;
+}
+
+void TView::endModal( ushort command )
+{
+ if( TopView() != 0 )
+ TopView()->endModal(command);
+}
+
+Boolean TView::eventAvail()
+{
+ TEvent event;
+ getEvent(event);
+ if( event.what != evNothing )
+ putEvent(event);
+ return Boolean( event.what != evNothing );
+}
+
+TRect TView::getBounds()
+{
+ return TRect( origin, origin+size );
+}
+
+ushort TView::execute()
+{
+ return cmCancel;
+}
+
+TRect TView::getClipRect()
+{
+ TRect clip = getBounds();
+ if( owner != 0 )
+ clip.intersect(owner->clip);
+ clip.move(-origin.x, -origin.y);
+ return clip;
+}
+
+ushort TView::getColor( ushort color )
+{
+ ushort colorPair = color >> 8;
+
+ if( colorPair != 0 )
+ colorPair = mapColor(colorPair) << 8;
+
+ colorPair |= mapColor( uchar(color) );
+
+ return colorPair;
+}
+
+void TView::getCommands( TCommandSet& commands )
+{
+ commands = curCommandSet;
+}
+
+void TView::getData( void * )
+{
+}
+
+void TView::getEvent( TEvent& event )
+{
+ if( owner != 0 )
+ owner->getEvent(event);
+}
+
+TRect TView::getExtent()
+{
+ return TRect( 0, 0, size.x, size.y );
+}
+
+ushort TView::getHelpCtx()
+{
+ if( (state & sfDragging) != 0 )
+ return hcDragging;
+ return helpCtx;
+}
+
+TPalette& TView::getPalette() const
+{
+ static char ch = 0;
+ static TPalette palette( &ch, 0 );
+ return palette;
+}
+
+Boolean TView::getState( ushort aState )
+{
+ return Boolean( (state & aState) == aState );
+}
+
+void TView::growTo( int x, int y )
+{
+ TRect r = TRect(origin.x, origin.y, origin.x + x, origin.y + y);
+ locate(r);
+}
+
+void TView::handleEvent(TEvent& event)
+{
+ if( event.what == evMouseDown )
+ {
+ if(!(state & (sfSelected | sfDisabled)) && (options & ofSelectable) )
+ {
+ select();
+ if( !(state & sfSelected) || // SET: If we failed to get the focus forget
+ // about this mouse click.
+ !(options & ofFirstClick) )
+ clearEvent(event);
+ }
+ }
+}
+
+void TView::hide()
+{
+ if( (state & sfVisible) != 0 )
+ setState( sfVisible, False );
+}
+
+void TView::hideCursor()
+{
+ setState( sfCursorVis, False );
+}
+
+void TView::keyEvent( TEvent& event )
+{
+ do {
+ getEvent(event);
+ } while( event.what != evKeyDown );
+}
+
+#define range(Val, Min, Max) (((Val < Min) ? Min : ((Val > Max) ? Max : Val)))
+
+void TView::locate( TRect& bounds )
+{
+ TPoint min, max;
+ sizeLimits(min, max);
+ bounds.b.x = bounds.a.x + range(bounds.b.x - bounds.a.x, min.x, max.x);
+ bounds.b.y = bounds.a.y + range(bounds.b.y - bounds.a.y, min.y, max.y);
+ TRect r = getBounds();
+ if( bounds != r )
+ {
+ changeBounds( bounds );
+ if( owner != 0 && (state & sfVisible) != 0 )
+ {
+ if( (state & sfShadow) != 0 )
+ {
+ r.Union(bounds);
+ r.b += shadowSize;
+ }
+ drawUnderRect( r, 0 );
+ }
+ }
+}
+
+void TView::makeFirst()
+{
+ putInFrontOf(owner->first());
+}
+
+TPoint TView::makeGlobal( TPoint source )
+{
+ TPoint temp = source + origin;
+ TView *cur = this;
+ while( cur->owner != 0 )
+ {
+ cur = cur->owner;
+ temp += cur->origin;
+ }
+ return temp;
+}
+
+TPoint TView::makeLocal( TPoint source )
+{
+ TPoint temp = source - origin;
+ TView* cur = this;
+ while( cur->owner != 0 )
+ {
+ cur = cur->owner;
+ temp -= cur->origin;
+ }
+ return temp;
+}
+
+Boolean TView::mouseEvent(TEvent& event, ushort mask)
+{
+ do {
+ getEvent(event);
+ } while( !(event.what & (mask | evMouseUp)) );
+
+ return Boolean(event.what != evMouseUp);
+}
+
+Boolean TView::mouseInView(TPoint mouse)
+{
+ mouse = makeLocal( mouse );
+ TRect r = getExtent();
+ return r.contains(mouse);
+}
+
+void TView::moveTo( int x, int y )
+{
+ TRect r( x, y, x+size.x, y+size.y );
+ locate(r);
+}
+
+TView *TView::nextView()
+{
+ if( this == owner->last )
+ return 0;
+ else
+ return next;
+}
+
+void TView::normalCursor()
+{
+ setState(sfCursorIns, False);
+}
+
+TView *TView::prev()
+{
+ TView* res = this;
+ while( res->next != this )
+ res = res->next;
+ return res;
+}
+
+TView *TView::prevView()
+{
+ if( this == owner->first() )
+ return 0;
+ else
+ return prev();
+}
+
+void TView::putEvent( TEvent& event )
+{
+ if( owner != 0 )
+ owner->putEvent(event);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Helper function to fill a TEvent structure and call putEvent.
+@x{::PutEvent}.
+
+***************************************************************************/
+
+void TView::putEvent( ushort what, ushort command, void *infoPtr )
+{
+ TEvent event;
+
+ event.what = what;
+ event.message.command = command;
+ event.message.infoPtr = infoPtr;
+ putEvent( event );
+}
+
+void TView::putInFrontOf( TView *Target )
+{
+ TView *p, *lastView;
+
+ if( owner != 0 && Target != this && Target != nextView() &&
+ ( Target == 0 || Target->owner == owner)
+ )
+ {
+ if( (state & sfVisible) == 0 )
+ {
+ owner->removeView(this);
+ owner->insertView(this, Target);
+ }
+ else
+ {
+ lastView = nextView();
+ p = Target;
+ while( p != 0 && p != this )
+ p = p->nextView();
+ if( p == 0 )
+ lastView = Target;
+ state &= ~sfVisible;
+ if( lastView == Target )
+ drawHide(lastView);
+ owner->removeView(this);
+ owner->insertView(this, Target);
+ state |= sfVisible;
+ if( lastView != Target )
+ drawShow(lastView);
+ if( (options & ofSelectable) != 0 )
+ owner->resetCurrent();
+ }
+ }
+}
+
+void TView::select()
+{
+ if( (options & ofTopSelect) != 0 )
+ makeFirst();
+ else if( owner != 0 )
+ owner->setCurrent( this, normalSelect );
+}
+
+void TView::setBounds( const TRect& bounds )
+{
+ origin = bounds.a;
+ size = bounds.b - bounds.a;
+}
+
+void TView::setCommands( TCommandSet& commands )
+{
+ commandSetChanged = Boolean( commandSetChanged ||
+ (curCommandSet != commands ));
+ curCommandSet = commands;
+}
+
+void TView::setCursor( int x, int y )
+{
+ cursor.x = x;
+ cursor.y = y;
+ drawCursor();
+}
+
+void TView::setData( void * )
+{
+}
+
+void TView::setState( ushort aState, Boolean enable )
+{
+ if( enable == True )
+ state |= aState;
+ else
+ state &= ~aState;
+
+ if( owner == 0 )
+ return;
+
+ switch( aState )
+ {
+ case sfVisible:
+ if( (owner->state & sfExposed) != 0 )
+ setState( sfExposed, enable );
+ if( enable == True )
+ drawShow( 0 );
+ else
+ drawHide( 0 );
+ if( (options & ofSelectable) != 0 )
+ owner->resetCurrent();
+ break;
+ case sfCursorVis:
+ case sfCursorIns:
+ drawCursor();
+ break;
+ case sfShadow:
+ drawUnderView( True, 0 );
+ break;
+ case sfFocused:
+ if (owner && owner->canShowCursor())
+ // SET: do it only if our owner gives permission
+ resetCursor();
+ message( owner,
+ evBroadcast,
+ (enable == True) ? cmReceivedFocus : cmReleasedFocus,
+ this
+ );
+ break;
+ }
+}
+
+void TView::show()
+{
+ if( (state & sfVisible) == 0 )
+ setState(sfVisible, True);
+}
+
+void TView::showCursor()
+{
+ setState( sfCursorVis, True );
+}
+
+void TView::sizeLimits( TPoint& min, TPoint& max )
+{
+ min.x = min.y = 0;
+ if( owner != 0 )
+ max = owner->size;
+ else
+ max.x = max.y = INT_MAX;
+}
+
+TView* TView::TopView()
+{
+ if( TheTopView != 0 )
+ return TheTopView;
+ else
+ {
+ TView* p = this;
+ while( p != 0 && !(p->state & sfModal) )
+ p = p->owner;
+ return p;
+ }
+}
+
+Boolean TView::valid( ushort )
+{
+ return True;
+}
+
+Boolean TView::containsMouse( TEvent& event )
+{
+ return Boolean( (state & sfVisible) != 0 &&
+ mouseInView( event.mouse.where )
+ );
+}
+
+void TView::shutDown()
+{
+ hide();
+ if( owner != 0 )
+ owner->remove( this );
+ TObject::shutDown();
+}
+
+#if !defined( NO_STREAM )
+void TView::write( opstream& os )
+{
+ ushort saveState =
+ state & ~( sfActive | sfSelected | sfFocused | sfExposed );
+
+ os << origin << size << cursor
+ << growMode << dragMode << helpCtx
+ << saveState << options << eventMask;
+}
+
+void *TView::read( ipstream& is )
+{
+ is >> origin >> size >> cursor
+ >> growMode >> dragMode >> helpCtx
+ >> state >> options >> eventMask;
+ owner = 0;
+ next = 0;
+ return this;
+}
+
+TStreamable *TView::build()
+{
+ return new TView( streamableInit );
+}
+
+TView::TView( StreamableInit )
+{
+}
+#endif // NO_STREAM
+
+uchar TView::mapColor( uchar color )
+{
+ if( color == 0 )
+ return errorAttr;
+ TView *cur = this;
+ do {
+ TPalette& p = cur->getPalette();
+ if( p[0] != 0 )
+ {
+ if( color > p[0] )
+ return errorAttr;
+ color = p[color];
+ if( color == 0 )
+ return errorAttr;
+ }
+ cur = cur->owner;
+ } while( cur != 0 );
+ return color;
+}
+
+void TView::resetCursor()
+{
+ int ax,cx,dx;
+ TView *self=this,*view;
+ if ((~state) & (sfVisible /*| sfCursorVis*/ | sfFocused)) goto lab4;
+ if (TScreen::getDontMoveHiddenCursor() && ((~state) & sfCursorVis)) goto lab4;
+ ax = cursor.y;
+ dx = cursor.x;
+lab1:
+ if ( (ax<0) || (ax>=self->size.y) ) goto lab4;
+ if ( (dx<0) || (dx>=self->size.x) ) goto lab4;
+ ax += self->origin.y;
+ dx += self->origin.x;
+ if (!self->owner) goto lab5;
+ view = self->owner->last;
+lab2:
+ view = view->next;
+ if (view == self)
+ {
+ self = view->owner;
+ goto lab1;
+ }
+ if (!(view->state & sfVisible)) goto lab2;
+ if (ax<view->origin.y) goto lab2;
+ if (ax>=view->origin.y+view->size.y) goto lab2;
+ if (dx<view->origin.x) goto lab2;
+ if (dx>=view->origin.x+view->size.x) goto lab2;
+lab4:
+ // Cursor disabled
+ TScreen::setCursorType(0);
+ return;
+
+lab5:
+ TScreen::setCursorPos(dx,ax);
+ if (state & sfCursorVis)
+ {
+ cx=TScreen::cursorLines;
+ if (state & sfCursorIns)
+ cx=100*256;
+ TScreen::setCursorType(cx);
+ }
+ else
+ TScreen::setCursorType(0);
+}
+
+#define VIEW ((TGroup *)(view))
+
+static TView *target;
+
+enum call_lab {lab_10,lab_11,lab_20};
+Boolean call(call_lab LAB,TView * &view,int &ax,int &bx,int &cx,int &si);
+
+Boolean call(call_lab LAB,TView * &view,int &ax,int &bx,int &cx,int &si)
+{
+ TView *retttarget,*rettview;
+ int rettax,rettcx,rettsi;
+ Boolean flag;
+ switch (LAB)
+ {
+ case lab_10 : goto lab10;
+ case lab_11 : goto lab11;
+ case lab_20 : goto lab20;
+ }
+ return False;
+lab10:
+ view = view->owner;
+ if (VIEW->buffer) return True;
+lab11:
+ target = view;
+ ax += view->origin.y;
+ si = view->origin.x;
+ bx += si;
+ cx += si;
+ view = view->owner;
+ if (!view) return True;
+ if (ax<VIEW->clip.a.y) return False;
+ if (ax>=VIEW->clip.b.y) return False;
+ if (bx<VIEW->clip.a.x) bx = VIEW->clip.a.x;
+ if (cx>VIEW->clip.b.x) cx = VIEW->clip.b.x;
+ if (bx>=cx) return False;
+ view = VIEW->last;
+lab20:
+ view = view->next;
+ if (view == target) goto lab10;
+ if (!(view->state & sfVisible)) goto lab20;
+ si = view->origin.y;
+ if (ax<si) goto lab20;
+ si += view->size.y;
+ if (ax>=si) goto lab20;
+ si = view->origin.x;
+ if (bx<si) goto lab22;
+ si += view->size.x;
+ if (bx>=si) goto lab20;
+ bx = si;
+ if (bx<cx) goto lab20;
+ return False;
+lab22:
+ if (cx<=si) goto lab20;
+ si += view->size.x;
+ if (cx>si) goto lab23;
+ cx = view->origin.x;
+ goto lab20;
+lab23:
+ retttarget = target;
+ rettview = view;
+ rettsi = si;
+ rettcx = cx;
+ rettax = ax;
+ cx = view->origin.x;
+ flag = call(lab_20,view,ax,bx,cx,si);
+ ax = rettax;
+ cx = rettcx;
+ bx = rettsi;
+ view = rettview;
+ target = retttarget;
+ if (!flag) goto lab20;
+ return True;
+}
+
+Boolean TView::exposed()
+{
+ int ax,bx,cx,si;
+ int rettax;
+ Boolean flag;
+ TView *view = this;
+ if (!(state & sfExposed)) return False;
+ ax = 0;
+ if (size.x<ax || size.y<ax) return False;
+lab1:
+ bx = 0;
+ cx = view->size.x;
+ rettax = ax;
+ flag = call(lab_11,view,ax,bx,cx,si);
+ ax = rettax;
+ if (flag) return True;
+ view = this;
+ ax++;
+ if (ax<view->size.y) goto lab1;
+ return False;
+}
+
+extern TPoint shadowSize;
+extern uchar shadowAttr;
+
+static int offset;
+static int y_pos,x_pos_start,x_pos_end,in_shadow;
+const void * _Buffer;
+TView *_view;
+
+void _call(int LAB);
+
+void call30(int x)
+{
+ TView *retttarget = target;
+ int rettoffset = offset;
+ TView *rettview = _view;
+ int rettdx = in_shadow;
+ int rettcx = x_pos_end;
+ int rettax = y_pos;
+ x_pos_end = x;
+ _call(20);
+ y_pos = rettax;
+ x_pos_end = rettcx;
+ in_shadow = rettdx;
+ _view = rettview;
+ offset = rettoffset;
+ target = retttarget;
+ x_pos_start = x;
+}
+
+void call50()
+{
+ int count = x_pos_end - x_pos_start;
+ int buf_offset = y_pos * _view->size.x + x_pos_start;
+ int skip_offset = x_pos_start - offset;
+ const ushort *toBlit=((const ushort *)_Buffer)+skip_offset;
+ int isScreen=((TGroup *)(_view))->buffer==TScreen::screenBuffer;
+
+ // Remap characters if needed
+ AllocLocalStr(aux,count*sizeof(ushort));
+ if (isScreen && TVCodePage::OnTheFlyRemapNeeded())
+ {
+ memcpy(aux,toBlit,count*sizeof(ushort));
+ int i;
+ if (in_shadow)
+ {// Remap and shadow
+ for (i=0; i<count; i++)
+ {
+ uchar *s=((uchar *)aux)+i*2;
+ *s=TVCodePage::OnTheFlyRemap(*s);
+ s[1]=shadowAttr;
+ }
+ }
+ else
+ {// Just remap
+ for (i=0; i<count; i++)
+ {
+ uchar *s=((uchar *)aux)+i*2;
+ *s=TVCodePage::OnTheFlyRemap(*s);
+ }
+ }
+ toBlit=(const ushort *)aux;
+ }
+ else
+ {// We don't need to remap, but ...
+ if (in_shadow)
+ {// is much more efficient to call the OS just once
+ memcpy(aux,toBlit,count*sizeof(ushort));
+ int i;
+ for (i=0; i<count; i++)
+ {
+ uchar *s=((uchar *)aux)+i*2;
+ s[1]=shadowAttr;
+ }
+ toBlit=(const ushort *)aux;
+ }
+ }
+
+ if (isScreen)
+ TScreen::setCharacters(buf_offset,(ushort *)toBlit,count);
+ else
+ memcpy(((TGroup *)(_view))->buffer+buf_offset,toBlit,count*sizeof(ushort));
+}
+
+#ifdef TVCompf_MinGW
+// SET: Not sure why Vadim wanted it
+#define HideMouse()
+#define ShowMouse()
+#else
+// DOS, Linux and Borland (SAA port)
+#define HideMouse() TMouse::hide()
+#define ShowMouse() TMouse::show()
+#endif
+
+void _call(int LAB)
+{
+ int x;
+ switch (LAB)
+ {
+ case 00 : goto lab00;
+ case 20 : goto lab20;
+ }
+ return;
+lab00:
+ offset = x_pos_start;
+ x_pos_end += x_pos_start;
+ in_shadow = 0;
+ if (y_pos < 0 || y_pos >= _view->size.y) return;
+ x_pos_start = max(x_pos_start,0);
+ x_pos_end = min(x_pos_end,_view->size.x);
+ if (x_pos_start >= x_pos_end) return;
+lab10:
+ if ( !( _view->state & sfVisible) ) return;
+ if (!_view->owner) return;
+ target = _view;
+ y_pos += _view->origin.y;
+ x = _view->origin.x;
+ x_pos_start += x;
+ x_pos_end += x;
+ offset += x;
+ if (y_pos < _view->owner->clip.a.y) return;
+ if (y_pos >= _view->owner->clip.b.y) return;
+ x_pos_start = max(x_pos_start,_view->owner->clip.a.x);
+ x_pos_end = min(x_pos_end,_view->owner->clip.b.x);
+ if (x_pos_start >= x_pos_end) return;
+ _view = _view->owner->last;
+lab20:
+ do
+ {
+ _view = _view->next;
+ if (_view == target) break;
+ if (!(_view->state & sfVisible)) continue;
+ {
+ int y = _view->origin.y;
+ if (y_pos < y) continue;
+ y += _view->size.y;
+ if (y_pos < y) goto lab23;
+ if (!(_view->state & sfShadow)) continue;
+ y += shadowSize.y;
+ if (y_pos >= y) continue;
+ }
+ x = _view->origin.x;
+ x += shadowSize.x;
+ if (x_pos_start >= x) goto lab22;
+ if (x_pos_end <= x) continue;
+ call30(x);
+ lab22:
+ x += _view->size.x;
+ goto lab26;
+ lab23:
+ x = _view->origin.x;
+ if (x_pos_start < x)
+ {
+ if (x_pos_end <= x) continue;
+ call30(x);
+ }
+ x += _view->size.x;
+ if (x_pos_start < x)
+ {
+ if (x_pos_end <= x) return;
+ x_pos_start = x;
+ }
+ if (!(_view->state & sfShadow)) continue;
+ if (y_pos < _view->origin.y+shadowSize.y) continue;
+ x += shadowSize.x;
+ lab26:
+ if (x_pos_start >= x) continue;
+ in_shadow++;
+ if (x_pos_end <= x) continue;
+ call30(x);
+ in_shadow--;
+ } while (1);
+
+ _view = _view->owner;
+ if (!((TGroup *)(_view))->buffer)
+ {
+ if (((TGroup *)(_view))->lockFlag) return;
+ goto lab10;
+ }
+ if ((((TGroup *)(_view))->buffer) != TScreen::screenBuffer)
+ {
+ call50();
+ if (((TGroup *)(_view))->lockFlag) return;
+ goto lab10;
+ }
+ if (y_pos!=TEventQueue::curMouse.where.y ||
+ x_pos_start>TEventQueue::curMouse.where.x ||
+ x_pos_end<=TEventQueue::curMouse.where.x)
+ // the mouse is not in the draw area
+ {
+ TMouse::resetDrawCounter();
+ call50();
+ if (TMouse::getDrawCounter()==0)
+ {
+ // there was no mouse event
+ if (((TGroup *)(_view))->lockFlag) return;
+ goto lab10;
+ }
+ }
+ // the mouse is in the draw area or an event has occoured during
+ // the above drawing
+ HideMouse();
+ call50();
+ ShowMouse();
+ if (((TGroup *)(_view))->lockFlag) return;
+ goto lab10;
+}
+
+#define WRITEVIEW(b,a,c,B)\
+do\
+{\
+ x_pos_start = b;\
+ y_pos = a;\
+ x_pos_end = c;\
+ _Buffer = B;\
+ _view = this;\
+ _call(00);\
+} while (0)
+
+void TView::writeBuf(short x,short y,short w,short h,const void * Buffer)
+{
+ int i=0;
+ while (h--)
+ {
+ WRITEVIEW(x,y++,w,((ushort *)(Buffer))+w*i);
+ i++;
+ }
+}
+
+void TView::writeChar( short x, short y, char c, uchar color, short count )
+{
+ ushort colo = (mapColor(color) << 8) | (uchar)c;
+ int i=0;
+ if (count<=0) return;
+ AllocLocalUShort(temp,count*sizeof(ushort));
+ for (i=0;i<count;i++) temp[i]=colo;
+ WRITEVIEW(x,y,count,temp);
+}
+
+void TView::writeLine( short x, short y, short w, short h, const void *Buffer )
+{
+ while (h--) WRITEVIEW(x,y++,w,((ushort *)(Buffer)));
+}
+
+void TView::writeStr( short x, short y, const char *str, uchar color )
+{
+ ushort count = strlen(str),i;
+ if (!count) return;
+ AllocLocalUShort(temp,count*sizeof(ushort));
+ color = mapColor(color);
+ for (i=0;i<count;i++) temp[i] = (color << 8) | (uchar)str[i];
+ WRITEVIEW(x,y,count,temp);
+}
+
diff --git a/tvision/classes/tvintl.cc b/tvision/classes/tvintl.cc
new file mode 100644
index 0000000..974ac16
--- /dev/null
+++ b/tvision/classes/tvintl.cc
@@ -0,0 +1,298 @@
+/* Internationalization support routines.
+ Copyright by Salvador E. Tropea (SET) (2003-2005)
+ Covered by the GPL license. */
+
+#define Uses_string
+#define Uses_ctype
+#define Uses_stdlib
+#define Uses_stdarg
+#define Uses_stdio
+#define Uses_snprintf
+#define Uses_limits
+#ifdef MSS
+ #define __MSS_USED__
+ #undef MSS
+#endif
+#include <compatlayer.h>
+#ifdef __MSS_USED__
+ #define MSS
+ #undef __MSS_USED__
+#endif
+#include <locale.h>
+#include <tv/ttypes.h>
+#define Uses_intl_fprintf
+#include <tv/intl.h>
+#include <tv.h>
+
+#ifdef HAVE_INTL_SUPPORT
+
+#define Uses_TVCodePage
+class TVPartitionTree556;
+#include <tv/codepage.h>
+
+// Prototypes, we know they exists
+#ifndef _LIBINTL_H
+extern "C" {
+char *textdomain(const char *domainname);
+char *bindtextdomain(const char *domainname, const char *dirname);
+char *gettext(const char *msgid);
+char *dgettext(const char *domain, const char *msgid);
+char *gettext__(const char *msgid);
+char *__gettext(const char *msgid);
+}
+#endif
+
+// Small mess to determine which function provides "gettext"
+// Must use __DJGPP__ here
+#ifndef __DJGPP__
+# if !defined(__GLIBC__) || __GLIBC__<2
+ // By default use gettext
+# define LibGetTextLow gettext
+# else
+# if (__GLIBC__==2 && __GLIBC_MINOR__>0) || __GLIBC__>2
+# define LibGetTextLow gettext
+# else
+ // exception: glibc 2.0 needs __gettext
+# define LibGetTextLow __gettext
+# endif
+# endif
+#else
+# define LibGetTextLow gettext__
+#endif
+
+char TVIntl::translate=0;
+char TVIntl::initialized=0;
+char TVIntl::needsRecode=0;
+int TVIntl::forcedCatalogEncoding=-1;
+int TVIntl::catalogEncoding=885901;
+uchar TVIntl::recodeTable[256];
+void *TVIntl::previousCPCallBack=NULL;
+char TVIntl::packageName[20];
+
+const char *TVIntl::defaultEncodingNames[]=
+{
+ "de",
+ "es",
+ "pl",
+ "ru"
+};
+int TVIntl::defaultEncodings[]=
+{
+ 885901, // de
+ 885901, // es
+ 885902, // pl
+ 100000 // ru
+};
+const int numEncs=3;
+
+
+void TVIntl::initialize()
+{
+ if (initialized) return;
+ initialized=1;
+ const char *lang=getenv("LANG");
+ if (lang)
+ {
+ translate=1;
+ int i;
+ char c0=tolower(lang[0]);
+ char c1=tolower(lang[1]);
+ for (i=0; i<numEncs; i++)
+ if (defaultEncodingNames[i][0]==c0 && defaultEncodingNames[i][1]==c1)
+ {
+ catalogEncoding=defaultEncodings[i];
+ break;
+ }
+ previousCPCallBack=(void *)TVCodePage::SetCallBack(codePageCB);
+ codePageCB(NULL);
+ CLY_snprintf(packageName,libPackageNameLen,"tvision%s",TV_VERSION);
+ }
+}
+
+void TVIntl::codePageCB(ushort *map)
+{
+ int curAppCP=TVCodePage::GetAppCodePage();
+ if (translate)
+ {
+ int cpCatalog=forcedCatalogEncoding==-1 ? catalogEncoding : forcedCatalogEncoding;
+ needsRecode=(cpCatalog!=curAppCP);
+ if (needsRecode)
+ TVCodePage::FillGenericRemap(cpCatalog,curAppCP,recodeTable);
+ }
+ if (map && previousCPCallBack)
+ ((TVCodePageCallBack)previousCPCallBack)(map);
+}
+
+const char *TVIntl::textDomain(const char *domainname)
+{
+ initialize();
+ return (const char *)textdomain(domainname);
+}
+
+const char *TVIntl::bindTextDomain(const char *domainname, const char *dirname)
+{
+ initialize();
+ return (const char *)bindtextdomain(domainname,dirname);
+}
+
+const char *TVIntl::getText(const char *msgid)
+{
+ if (!msgid || !msgid[0]) // gettext 0.14.4 feature: "" -> "Project-Id-Version...
+ return msgid;
+ const char *msgstr=LibGetTextLow(msgid);
+ if (msgid==msgstr)
+ msgstr=dgettext(packageName,msgstr);
+ return msgstr;
+}
+
+void TVIntl::recodeStr(char *str, int len)
+{
+ int i;
+ uchar *s=(uchar *)str;
+ for (i=0; i<len; i++)
+ s[i]=s[i]>127 ? recodeTable[s[i]] : s[i];
+}
+
+char *TVIntl::getTextNew(const char *msgid, Boolean onlyIntl)
+{
+ if (!msgid) return NULL;
+ const char *source;
+ if (translate)
+ source=getText(msgid);
+ else
+ source=msgid;
+ if (onlyIntl && source==msgid)
+ return NULL;
+ int len=strlen(source)+1;
+ char *ret=new char[len];
+ memcpy(ret,source,len);
+ if (needsRecode)
+ {
+ //printf("Recodificando %s a ",ret);
+ recodeStr(ret,len-1);
+ //printf("%s\n",ret);
+ }
+ return ret;
+}
+
+const char *TVIntl::getText(const char *msgid, stTVIntl *&cache)
+{
+ if (!translate || !msgid) return msgid;
+ int curCP=TVCodePage::GetAppCodePage();
+ if (!cache)
+ cache=new stTVIntl;
+ else
+ {
+ if (cache->cp==-2)
+ return msgid;
+ if (curCP==cache->cp)
+ return cache->translation ? cache->translation : msgid;
+ DeleteArray(cache->translation);
+ }
+ cache->translation=getTextNew(msgid,True);
+ cache->cp=curCP;
+ return cache->translation ? cache->translation : msgid;
+}
+
+void TVIntl::freeSt(stTVIntl *&cache)
+{
+ if (!cache) return;
+ DeleteArray(cache->translation);
+ delete cache;
+ cache=NULL;
+}
+
+stTVIntl *TVIntl::emptySt()
+{
+ stTVIntl *p=new stTVIntl[1]; // It will be inserted in a TStringColletion
+ // where delete[] is used.
+ p->translation=NULL;
+ p->cp=-1;
+ return p;
+}
+
+stTVIntl *TVIntl::dontTranslateSt()
+{
+ stTVIntl *p=new stTVIntl;
+ p->translation=NULL;
+ p->cp=-2;
+ return p;
+}
+
+int TVIntl::snprintf(char *dest, size_t sz, const char *fmt, ...)
+{
+ va_list argptr;
+ char *intlFmt=getTextNew(fmt);
+ va_start(argptr,fmt);
+ int l=CLY_vsnprintf(dest,sz,intlFmt,argptr);
+ va_end(argptr);
+ DeleteArray(intlFmt);
+ return l;
+}
+
+int TVIntl::fprintf(FILE *f, const char *fmt, ...)
+{
+ va_list argptr;
+ char *intlFmt=getTextNew(fmt);
+ va_start(argptr,fmt);
+ int l=vfprintf(f,intlFmt,argptr);
+ va_end(argptr);
+ DeleteArray(intlFmt);
+ return l;
+}
+
+#if defined(TVOS_DOS) || (defined(TVOS_Win32) && !defined(TVCompf_Cygwin))
+ #define NoHomeOrientedOS
+#endif
+
+int TVIntl::autoInit(const char *package, const char *localeDir)
+{
+ char localedir[PATH_MAX];
+ setlocale(LC_ALL, "");
+ if (!localeDir)
+ localeDir=getenv("LOCALEDIR");
+
+ if (!localeDir)
+ {
+ #ifdef NoHomeOrientedOS
+ // if LOCALEDIR doesn't exists use %DJDIR%/share/locale
+ localeDir=getenv("DJDIR");
+ if (localeDir)
+ {
+ strcpy(localedir,localeDir);
+ strcat(localedir,"/share/locale");
+ }
+ else
+ return 0;
+ #else
+ strcpy(localedir,"/usr/share/locale");
+ #endif
+ }
+ else
+ strcpy(localedir,localeDir);
+
+ bindTextDomain(package,localedir);
+ textDomain(package);
+ return 1;
+}
+
+#else
+int TVIntl::snprintf(char *dest, size_t sz, const char *fmt, ...)
+{
+ va_list argptr;
+ va_start(argptr,fmt);
+ int l=CLY_vsnprintf(dest,sz,fmt,argptr);
+ va_end(argptr);
+ return l;
+}
+
+int TVIntl::fprintf(FILE *f, const char *fmt, ...)
+{
+ va_list argptr;
+ va_start(argptr,fmt);
+ int l=vfprintf(f,fmt,argptr);
+ va_end(argptr);
+ return l;
+}
+#endif /* HAVE_INTL_SUPPORT */
+
diff --git a/tvision/classes/tvtext1.cc b/tvision/classes/tvtext1.cc
new file mode 100644
index 0000000..3955ea3
--- /dev/null
+++ b/tvision/classes/tvtext1.cc
@@ -0,0 +1,142 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TScreen
+#define Uses_TRadioButtons
+#define Uses_TMenuBox
+#define Uses_TFrame
+#define Uses_TIndicator
+#define Uses_THistory
+#define Uses_TColorSelector
+#define Uses_TMonoSelector
+#define Uses_TColorDialog
+#define Uses_TInputLine
+#define Uses_TStatusLine
+#define Uses_TCheckBoxes
+#define Uses_TScrollBar
+#define Uses_TButton
+#define Uses_TDirListBox
+#define Uses_TFileEditor
+#define Uses_TFileInfoPane
+#define Uses_TDeskTop
+#define Uses_TListViewer
+#include <tv.h>
+
+// All the strings are arrays ASCIIZ
+// All duplicated to restore the original
+
+uchar TView::specialChars[] =
+{
+ 175, 174, 26, 27, ' ', ' ', 0
+};
+uchar TView::ospecialChars[] =
+{
+ 175, 174, 26, 27, ' ', ' ', 0
+};
+
+uchar TView::noMoireUnFill=' '; // Just space
+uchar TView::noMoireFill=0xDB; // Full block
+uchar TView::onoMoireFill=0xDB; // Full block
+
+char TRadioButtons::button[] = " ( ) ";
+char TRadioButtons::obutton[] = " ( ) ";
+char TRadioButtons::check = 7; // 
+char TRadioButtons::ocheck = 7;
+
+//" ÚÄ¿ ÀÄÙ ³ ³ ÃÄ´ " 8
+char TMenuBox::frameChars[] = " \332\304\277 \300\304\331 \263 \263 \303\304\264 ";
+char TMenuBox::oframeChars[] = " \332\304\277 \300\304\331 \263 \263 \303\304\264 ";
+char TMenuBox::rightArrow = 16; // 
+char TMenuBox::orightArrow = 16; // 
+
+const char TFrame::initFrame[19] =
+ "\x06\x0A\x0C\x05\x00\x05\x03\x0A\x09\x16\x1A\x1C\x15\x00\x15\x13\x1A\x19";
+
+char TFrame::frameChars[33] =
+ " À ³Úà ÙÄÁ¿´ÂÅ È ºÉÇ ¼ÍÏ»¶Ñ "; // for UnitedStates code page
+char TFrame::oframeChars[33] =
+ " À ³Úà ÙÄÁ¿´ÂÅ È ºÉÇ ¼ÍÏ»¶Ñ "; // for UnitedStates code page
+
+// þ  
+char TFrame::closeIcon[] = "[~\xFE~]";
+char TFrame::ocloseIcon[] = "[~\xFE~]";
+char TFrame::zoomIcon[] = "[~\x18~]";
+char TFrame::ozoomIcon[] = "[~\x18~]";
+char TFrame::unZoomIcon[] = "[~\x12~]";
+char TFrame::ounZoomIcon[] = "[~\x12~]";
+// Note: Eddie proposed 0xF (WHITE SUN WITH RAYS) but this reduces to * and
+// is the same as 0xFE (BLACK SQUARE) (also reduced to *).
+char TFrame::animIcon[] = "[~+~]";
+char TFrame::oanimIcon[] = "[~+~]";
+char TFrame::dragIcon[] = "~ÄÙ~";
+char TFrame::odragIcon[] = "~ÄÙ~";
+
+char TIndicator::dragFrame = '\xCD'; // Í
+char TIndicator::odragFrame = '\xCD'; // Í
+char TIndicator::normalFrame = '\xC4'; // Ä
+char TIndicator::onormalFrame = '\xC4'; // Ä
+char TIndicator::modifiedStar = 15; // 
+char TIndicator::omodifiedStar = 15; // 
+
+char THistory::icon[] = "\xDE~\x19~\xDD"; // ÞÝ
+char THistory::oicon[] = "\xDE~\x19~\xDD"; // ÞÝ
+
+char TColorSelector::icon = '\xDB'; // Û
+char TColorSelector::oicon = '\xDB'; // Û
+char TColorSelector::mark = 8;
+char TColorSelector::omark = 8;
+
+char TMonoSelector::button[] = " ( ) ";
+char TMonoSelector::obutton[] = " ( ) ";
+
+char TInputLine::rightArrow = '\x10';
+char TInputLine::orightArrow = '\x10';
+char TInputLine::leftArrow = '\x11';
+char TInputLine::oleftArrow = '\x11';
+
+char TStatusLine::hintSeparator[] = "\xB3 "; // ³
+char TStatusLine::ohintSeparator[] = "\xB3 "; // ³
+
+char TCheckBoxes::button[] = " [ ] ";
+char TCheckBoxes::obutton[] = " [ ] ";
+
+TScrollChars TScrollBar::vChars = {30, 31, 177, 254, 178}; // ±þ²
+TScrollChars TScrollBar::ovChars = {30, 31, 177, 254, 178}; // ±þ²
+TScrollChars TScrollBar::hChars = {17, 16, 177, 254, 178}; // ±þ²
+TScrollChars TScrollBar::ohChars = {17, 16, 177, 254, 178}; // ±þ²
+
+char TButton::shadows[] = "\xDC\xDB\xDF"; // ÜÛß
+char TButton::oshadows[] = "\xDC\xDB\xDF"; // ÜÛß
+char TButton::markers[] = "[]";
+char TButton::omarkers[] = "[]";
+
+char TDirListBox::pathDir[] = "ÀÄÂ";
+char TDirListBox::opathDir[] = "ÀÄÂ";
+char TDirListBox::firstDir[] = "ÀÂÄ";
+char TDirListBox::ofirstDir[] = "ÀÂÄ";
+char TDirListBox::middleDir[] = " ÃÄ";
+char TDirListBox::omiddleDir[] = " ÃÄ";
+char TDirListBox::lastDir[] = " ÀÄ";
+char TDirListBox::olastDir[] = " ÀÄ";
+char TDirListBox::graphics[] = "ÀÃÄ";
+char TDirListBox::ographics[] = "ÀÃÄ";
+
+const char * TFileInfoPane::pmText = "p";
+const char * TFileInfoPane::amText = "a";
+
+char TDeskTop::defaultBkgrnd = '\xB0';
+char TDeskTop::odefaultBkgrnd = '\xB0';
+
+uchar TListViewer::columnSeparator = 179; // ³
+uchar TListViewer::ocolumnSeparator = 179; // ³
+
diff --git a/tvision/classes/tvtext2.cc b/tvision/classes/tvtext2.cc
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/tvision/classes/tvtext2.cc
@@ -0,0 +1 @@
+
diff --git a/tvision/classes/twindow.cc b/tvision/classes/twindow.cc
new file mode 100644
index 0000000..e824363
--- /dev/null
+++ b/tvision/classes/twindow.cc
@@ -0,0 +1,275 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified for i18n support by Salvador Eduardo Tropea.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TWindow
+#define Uses_TEvent
+#define Uses_TRect
+#define Uses_TFrame
+#define Uses_TScrollBar
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#define Uses_TProgram // SET: TProgram::application broadcast
+#include <tv.h>
+
+const TPoint minWinSize = {16, 6};
+
+TWindowInit::TWindowInit( TFrame *(*cFrame)( TRect ) ) :
+ createFrame( cFrame )
+{
+}
+
+#define cpBlueWindow "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+#define cpCyanWindow "\x10\x11\x12\x13\x14\x15\x16\x17"
+#define cpGrayWindow "\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
+
+TWindow::TWindow( const TRect& bounds,
+ const char *aTitle,
+ short aNumber
+ ) :
+ TWindowInit( &TWindow::initFrame ),
+ TGroup( bounds ),
+ flags( wfMove | wfGrow | wfClose | wfZoom ),
+ zoomRect( getBounds() ),
+ number( aNumber ),
+ palette( wpBlueWindow ),
+ title( newStr( aTitle ) ),
+ intlTitle( NULL )
+{
+ state |= sfShadow;
+ options |= ofSelectable | ofTopSelect;
+ growMode = gfGrowAll | gfGrowRel;
+ eventMask |= evMouseUp; //for TFrame
+ if( createFrame != 0 &&
+ (frame = createFrame( getExtent() )) != 0
+ )
+ insert( frame );
+}
+
+TWindow::~TWindow()
+{
+ DeleteArray((char *)title);
+ TVIntl::freeSt(intlTitle);
+}
+
+void TWindow::close()
+{
+ if( valid( cmClose ) )
+ { // SET: tell the application we are closing
+ message( TProgram::application, evBroadcast, cmClosingWindow, this );
+ frame = 0; // so we don't try to use the frame after it's been deleted
+ CLY_destroy( this );
+ }
+}
+
+void TWindow::shutDown()
+{
+ frame = 0;
+ TGroup::shutDown();
+}
+
+TPalette& TWindow::getPalette() const
+{
+ static TPalette blue( cpBlueWindow, sizeof( cpBlueWindow )-1 );
+ static TPalette cyan( cpCyanWindow, sizeof( cpCyanWindow )-1 );
+ static TPalette gray( cpGrayWindow, sizeof( cpGrayWindow )-1 );
+ static TPalette *palettes[] =
+ {
+ &blue,
+ &cyan,
+ &gray
+ };
+ return *(palettes[palette]);
+}
+
+const char *TWindow::getTitle( short )
+{
+ return TVIntl::getText(title,intlTitle);
+}
+
+void TWindow::handleEvent( TEvent& event )
+{
+ TRect limits;
+ TPoint min, max;
+
+ TGroup::handleEvent(event);
+ if( event.what== evCommand )
+ switch (event.message.command)
+ {
+ case cmResize:
+ if( (flags & (wfMove | wfGrow)) != 0 )
+ {
+ limits = owner->getExtent();
+ sizeLimits(min, max);
+ dragView( event, dragMode | (flags & (wfMove | wfGrow)),
+ limits, min, max);
+ clearEvent(event);
+ }
+ break;
+ case cmClose:
+ if( (flags & wfClose) != 0 &&
+ ( event.message.infoPtr == 0 || event.message.infoPtr == this )
+ )
+ {
+ if( (state & sfModal) == 0 )
+ close();
+ else
+ {
+ event.what = evCommand;
+ event.message.command = cmCancel;
+ putEvent( event );
+ }
+ clearEvent( event );
+ }
+ break;
+ case cmZoom:
+ if( (flags & wfZoom) != 0 &&
+ (event.message.infoPtr == 0 || event.message.infoPtr == this)
+ )
+ {
+ zoom();
+ clearEvent(event);
+ }
+ break;
+ }
+ else if( event.what == evKeyDown )
+ switch (event.keyDown.keyCode)
+ {
+ case kbTab:
+ case kbDown:
+ case kbRight:
+ selectNext(False);
+ clearEvent(event);
+ break;
+ case kbShiftTab:
+ case kbUp:
+ case kbLeft:
+ selectNext(True);
+ clearEvent(event);
+ break;
+ }
+ else if( event.what == evBroadcast &&
+ event.message.command == cmSelectWindowNum &&
+ event.message.infoInt == number &&
+ (options & ofSelectable) != 0
+ )
+ {
+ select();
+ clearEvent(event);
+ }
+}
+
+TFrame *TWindow::initFrame( TRect r )
+{
+ return new TFrame(r);
+}
+
+void TWindow::setState( ushort aState, Boolean enable )
+{
+#define C(x) if (enable == True) enableCommand(x); else disableCommand(x)
+ TGroup::setState(aState, enable);
+ if( (aState & sfSelected) != 0 )
+ {
+ setState(sfActive, enable);
+ if( frame != 0 )
+ frame->setState(sfActive,enable);
+ C(cmNext);
+ C(cmPrev);
+ if( (flags & (wfGrow | wfMove)) != 0 )
+ {
+ C(cmResize);
+ }
+ if( (flags & wfClose) != 0 )
+ {
+ C(cmClose);
+ }
+ if( (flags & wfZoom) != 0 )
+ {
+ C(cmZoom);
+ }
+ }
+#undef C
+}
+
+TScrollBar *TWindow::standardScrollBar( ushort aOptions )
+{
+ TRect r = getExtent();
+ if( (aOptions & sbVertical) != 0 )
+ r = TRect( r.b.x-1, r.a.y+1, r.b.x, r.b.y-1 );
+ else
+ r = TRect( r.a.x+2, r.b.y-1, r.b.x-2, r.b.y );
+
+ TScrollBar *s;
+ insert( s = new TScrollBar(r) );
+ if( (aOptions & sbHandleKeyboard) != 0 )
+ s->options |= ofPostProcess;
+ return s;
+}
+
+void TWindow::sizeLimits( TPoint& min, TPoint& max )
+{
+ TView::sizeLimits(min, max);
+ min = minWinSize;
+}
+
+void TWindow::zoom()
+{
+ TPoint minSize, maxSize;
+ sizeLimits( minSize, maxSize );
+ if( size != maxSize )
+ {
+ zoomRect = getBounds();
+ TRect r( 0, 0, maxSize.x, maxSize.y );
+ locate(r);
+ }
+ else
+ locate( zoomRect );
+}
+
+#if !defined( NO_STREAM )
+void TWindow::write( opstream& os )
+{
+ TGroup::write( os );
+ os << flags << zoomRect << number << palette;
+ os << frame;
+ os.writeString( title );
+}
+
+void *TWindow::read( ipstream& is )
+{
+ TGroup::read( is );
+ is >> flags >> zoomRect >> number >> palette;
+ is >> frame;
+ title = is.readString();
+ intlTitle = NULL;
+ return this;
+}
+
+TStreamable *TWindow::build()
+{
+ return new TWindow( streamableInit );
+}
+
+TWindow::TWindow( StreamableInit ) :
+ TWindowInit( NULL ),
+ TGroup( streamableInit )
+{
+}
+#endif // NO_STREAM
+
+
diff --git a/tvision/classes/unix/unixdis.cc b/tvision/classes/unix/unixdis.cc
new file mode 100644
index 0000000..deec174
--- /dev/null
+++ b/tvision/classes/unix/unixdis.cc
@@ -0,0 +1,130 @@
+/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
+/* Copyright (C) 1999-2002 Salvador Eduardo Tropea */
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_string
+#define Uses_signal
+#define Uses_ioctl
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(HAVE_NCURSES) && defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP)
+
+#include <termios.h>
+#include <term.h>
+
+#include <tv/unix/screen.h>
+
+int TDisplayUNIX::cur_x=0;
+int TDisplayUNIX::cur_y=0;
+// SET: Current cursor shape
+int TDisplayUNIX::cursorStart=85; // 85 %
+int TDisplayUNIX::cursorEnd =100; // 100 %
+
+// SET: 1 when the size of the window where the program is running changed
+volatile sig_atomic_t TDisplayUNIX::windowSizeChanged=0;
+
+int TDisplayUNIX::tty_fd=-1; // tty descriptor
+
+TDisplayUNIX::~TDisplayUNIX() {}
+
+void TDisplayUNIX::Init()
+{
+ setCursorPos=SetCursorPos;
+ getCursorPos=GetCursorPos;
+ getCursorShape=GetCursorShape;
+ setCursorShape=SetCursorShape;
+ getRows=GetRows;
+ getCols=GetCols;
+ setCrtModeExt=SetCrtModeExt;
+ checkForWindowSize=CheckForWindowSize;
+}
+
+void TDisplayUNIX::SetCursorPos(unsigned x, unsigned y)
+{
+ char out[1024], *p = out;
+
+ safeput(p, tparm(cursor_address,y, x));
+ write(tty_fd, out, p - out);
+ cur_x = x;
+ cur_y = y;
+}
+
+void TDisplayUNIX::GetCursorPos(unsigned &x, unsigned &y)
+{
+ char s[40];
+
+ // write/read are better here, because other functions might be buffered
+ write(tty_fd,"\e[6n",4); // Request cursor position from terminal
+ read(tty_fd,s,sizeof(s)); // Should never overflow...
+
+ y = atoi(s+2)-1;
+ x = atoi(strchr(s,';')+1)-1;
+}
+
+void TDisplayUNIX::SetCursorShape(unsigned start, unsigned end)
+{
+ char out[1024], *p=out;
+ if (start>=end) // hide
+ {
+ safeput(p,tparm(cursor_invisible));
+ write(tty_fd,out,p-out);
+ }
+ else
+ {
+ safeput(p,tparm(cursor_normal));
+ write(tty_fd,out,p-out);
+ }
+ cursorStart=start;
+ cursorEnd=end;
+ //fprintf(stderr,"SetCursorShape: %d,%d start>=end? %d\n",start,end,start>=end);
+}
+
+void TDisplayUNIX::GetCursorShape(unsigned &start, unsigned &end)
+{
+ // Currently we don't know the real state.
+ start=cursorStart;
+ end =cursorEnd;
+ //fprintf(stderr,"GetCursorShape: %d,%d\n",start,end);
+}
+
+ushort TDisplayUNIX::GetRows()
+{
+ if (dual_display) return 25;
+ winsize win;
+ win.ws_row=0xFFFF;
+ ioctl(tty_fd,TIOCGWINSZ,&win);
+ return win.ws_row!=0xFFFF ? win.ws_row : 25;
+}
+
+ushort TDisplayUNIX::GetCols()
+{
+ if (dual_display) return 80;
+ winsize win;
+ win.ws_col=0xFFFF;
+ ioctl(tty_fd,TIOCGWINSZ,&win);
+ return win.ws_col!=0xFFFF ? win.ws_col : 80;
+}
+
+void TDisplayUNIX::SetCrtModeExt(char *mode)
+{
+ system(mode);
+}
+
+int TDisplayUNIX::CheckForWindowSize(void)
+{
+ int ret=windowSizeChanged!=0;
+ windowSizeChanged=0;
+ return ret;
+}
+#else // TVOS_UNIX && !TVOSf_QNXRtP
+
+#include <tv/unix/screen.h>
+
+#endif // else TVOS_UNIX && !TVOSf_QNXRtP
+
diff --git a/tvision/classes/unix/unixkey.cc b/tvision/classes/unix/unixkey.cc
new file mode 100644
index 0000000..960501d
--- /dev/null
+++ b/tvision/classes/unix/unixkey.cc
@@ -0,0 +1,566 @@
+/*****************************************************************************
+
+ Todo:
+ Volar esto: int use_real_keyboard_bios=0;
+
+ This code is GPL, see copying file for more details.
+ Keyboard handler for Linux Copyright by Salvador E. Tropea (SET) (1998,1999)
+
+ That's the counterpart of the gkey.cc for DOS that I created some months ago
+it uses curses input and tries to detect the shift/control status from the
+keycode reported by curses. Additionally the routines detects ALT using the
+ESC-keycode sequence (META+key) with a patch in the low level tv_GetRaw.
+
+RH: I moved that patch to the TGKey::gkey() member
+
+ To make it better in the Linux console I'm mixing the modifiers flags from
+the ioctl call with the ones I figured out from the code.
+
+ It fixes a lot of problems that appears when running from telnet, but not
+all. Lamentably looks like telnet standard protocols can't simply report all
+the keyboard combinations. We lose some important things like Ctrl+Function
+key, Shift+(Inset,End,Home,PgUp,PgDn,Delete,Arrows,etc.) and more.
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_unistd
+#define Uses_ctype
+#define Uses_stdlib
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_FullSingleKeySymbols
+#define Uses_string
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(HAVE_NCURSES) && defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP)
+
+#include <tv/unix/key.h>
+
+// New curses (ncurses) headers
+#ifdef TVOSf_FreeBSD
+ #include <ncurses.h>
+#else
+ #include <curses.h>
+#endif
+#include <term.h>
+
+#ifdef HAVE_KEYSYMS
+ // X11R6 keysyms list
+ #include <X11/keysym.h>
+#endif
+
+//#define GKEY
+#define TOSTDERR
+#ifndef GKEY
+ #define dbprintf(a...)
+#else
+ #ifdef TOSTDERR
+ #define dbprintf(a...) fprintf(stderr,a)
+ #else
+ #define dbprintf(a...) printf(a)
+ #endif
+#endif
+
+/* Linux IOCTL values found experimentally */
+const int kblNormal=0,kblShift=1,kblAltR=2,kblCtrl=4,kblAltL=8;
+const int MouseB1Down=0x20,MouseB2Down=0x21,MouseB3Down=0x22,MouseUp=0x23;
+
+#define IN_FD fileno(stdin)
+#define META_MASK 0x8000
+#define NCursesGetCh getch
+#define NCursesUnGetCh ungetch
+// Who knows what's that?
+#undef clear
+
+int use_real_keyboard_bios=0;
+// xterm is a crappy terminal and does all in a way too different to the
+// standard.
+static int XtermMode=0;
+static int MouseButtons=0;
+
+int TGKeyUNIX::Abstract;
+char TGKeyUNIX::ascii;
+ushort TGKeyUNIX::sFlags;
+KeyType TGKeyUNIX::rawCode;
+
+// - 9 = Tab tiene conflicto con kbI+Control lo cual es natural, por otro
+// -lado Ctrl+Tab no lo reporta en forma natural
+// - a = Enter tiene conflicto con ^J, como ^J no lo reporta naturalmente sino
+// -forzado por el keymap lo mejor es definirlo directamente.
+static
+unsigned char kbToName1[128] =
+{
+ 0,kbA,kbB,kbC,kbD,kbE,kbF,kbG, // 00-07
+ kbH,kbTab,kbEnter,kbK,kbL,kbM,kbN,kbO, // 08-0F
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW, // 10-17
+ kbX,kbY,kbZ,kbEsc,0,kbCloseBrace,kb6,kbMinus, // 18-1F
+ kbSpace,kbAdmid,kbDobleQuote,kbNumeral,kbDolar,kbPercent,kbAmper,kbQuote,// 20-27
+ kbOpenPar,kbClosePar,kbAsterisk,kbPlus,kbComma,kbMinus,kbStop,kbSlash, // 28-2F
+ kb0,kb1,kb2,kb3,kb4,kb5,kb6,kb7, // 30-37
+ kb8,kb9,kbDoubleDot,kbColon,kbLessThan,kbEqual,kbGreaterThan,kbQuestion, // 38-3F
+ kbA_Roba,kbA,kbB,kbC,kbD,kbE,kbF,kbG, // 40-47
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO, // 48-4F
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW, // 50-57
+ kbX,kbY,kbZ,kbOpenBrace,kbBackSlash,kbCloseBrace,kbCaret,kbUnderLine, // 58-5F
+ kbGrave,kbA,kbB,kbC,kbD,kbE,kbF,kbG, // 60-67
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO, // 68-6F
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW, // 70-77
+ kbX,kbY,kbZ,kbOpenCurly,kbOr,kbCloseCurly,kbTilde,kbBackSpace // 78-7F
+};
+
+// 15e = kb5 (del keypad)
+static
+unsigned char kbToName2[128] =
+{
+ 0,0,kbDown,kbUp,kbLeft,kbRight,kbHome,kbBackSpace, // 00-07
+ 0,kbF1,kbF2,kbF3,kbF4,kbF5,kbF6,kbF7, // 08-0F
+ kbF8,kbF9,kbF10,kbF1,kbF2,kbF3,kbF4,kbF5, // 10-17
+ kbF6,kbF7,kbF8,kbF9,kbF10,0,0,0, // 18-1F
+ 0,0,0,0,0,0,0,0, // 20-27
+ 0,0,0,0,0,0,0,0, // 28-2F
+ 0,0,0,0,0,0,0,0, // 30-37
+ 0,0,0,0,0,kbLeft,kbDown,kbRight, // 38-3F
+ kbUp,kbEterm,kbHome,kbEnd,kbUp,kbDown,kbRight,kbLeft, // 40-47
+ 0,0,kbDelete,kbInsert,0,0,0,0, // 48-4F
+ 0,0,kbPgDn,kbPgUp,0,0,0,0, // 50-57
+ 0,0,0,0,0,0,kb5,0, // 58-5F
+ 0,0,0,0,0,0,0,0, // 60-67
+ kbEnd,0,0,0,0,0,0,0, // 68-6F
+ 0,0,0,0,0,0,0,0, // 70-77
+ 0,0,0,0,0,0,0,kbBackSpace // 78-7F
+};
+
+const unsigned kbCtrl =kbCtrlCode>>4;
+const unsigned kbAlt =kbAltLCode>>4;
+const unsigned char kbShift=kbShiftCode>>4;
+
+static
+unsigned char kbExtraFlags1[128] =
+{
+ 0,kbCtrl,kbCtrl,kbCtrl,kbCtrl,kbCtrl,kbCtrl,kbCtrl, // 00-07
+ kbCtrl,0,0,kbCtrl,kbCtrl,kbCtrl,kbCtrl,kbCtrl, // 08-0F
+ kbCtrl,kbCtrl,kbCtrl,kbCtrl,kbCtrl,kbCtrl,kbCtrl,kbCtrl, // 10-17
+ kbCtrl,kbCtrl,kbCtrl,0,0,kbCtrl,kbCtrl,kbCtrl, // 18-1F
+ 0,kbShift,kbShift,kbShift,kbShift,kbShift,kbShift,0, // 20-27
+ kbShift,kbShift,kbShift,kbShift,0,0,0,0, // 28-2F
+ 0,0,0,0,0,0,0,0, // 30-37
+ 0,0,kbShift,0,kbShift,0,kbShift,kbShift, // 38-3F
+ kbShift,kbShift,kbShift,kbShift,kbShift,kbShift,kbShift,kbShift, // 40-47
+ kbShift,kbShift,kbShift,kbShift,kbShift,kbShift,kbShift,kbShift, // 48-4F
+ kbShift,kbShift,kbShift,kbShift,kbShift,kbShift,kbShift,kbShift, // 50-57
+ kbShift,kbShift,kbShift,0,0,0,kbShift,kbShift, // 58-5F
+ 0,0,0,0,0,0,0,0, // 60-67
+ 0,0,0,0,0,0,0,0, // 68-6F
+ 0,0,0,0,0,0,0,0, // 70-77
+ 0,0,0,kbShift,kbShift,kbShift,kbShift,0, // 78-7F
+};
+
+static
+unsigned char kbExtraFlags2[128] =
+{
+ 0,0,0,0,0,0,0,0, // 00-07
+ 0,0,0,0,0,0,0,0, // 08-0F
+ 0,0,0,kbShift,kbShift,kbShift,kbShift,kbShift, // 10-17
+ kbShift,kbShift,kbShift,kbShift,kbShift,0,0,0, // 18-1F
+ 0,0,0,0,0,0,0,0, // 20-27
+ 0,0,0,0,0,0,0,0, // 28-2F
+ 0,0,0,0,0,0,0,0, // 30-37
+ 0,0,0,0,0,0,0,0, // 38-3F
+ 0,0,0,0,0,0,0,0, // 40-47
+ 0,0,0,0,0,0,0,0, // 48-4F
+ 0,0,0,0,0,0,0,0, // 50-57
+ 0,0,0,0,0,0,0,0, // 58-5F
+ 0,0,0,0,0,0,0,0, // 60-67
+ 0,0,0,0,0,0,0,0, // 68-6F
+ 0,0,0,0,0,0,0,0, // 70-77
+ 0,0,0,0,0,0,0,kbAlt // 78-7F
+};
+
+#ifdef HAVE_KEYSYMS
+// This table should be filled at compile time, or I can trust the values
+// are standard?!
+static
+unsigned char kbX11Keys[256];
+
+typedef struct
+{
+ unsigned symbol;
+ unsigned key;
+} keyEquiv;
+
+keyEquiv XEquiv[] =
+{
+ /* Cursor control & motion */
+ {XK_Home,kbHome}, {XK_Left,kbLeft}, {XK_Up,kbUp}, {XK_Right,kbRight},
+ {XK_Down,kbDown}, {XK_Page_Up,kbPgUp}, {XK_Page_Down, kbPgDn},
+ {XK_End,kbEnd}, {XK_Begin,kbHome},
+ /* Misc Functions */
+ {XK_Insert, kbInsert}, {XK_Delete, kbDelete},
+ /* TTY Functions */
+ {XK_Return, kbEnter}, {XK_BackSpace, kbBackSpace}, {XK_Tab, kbTab},
+ {XK_Escape, kbEsc},
+ /* Auxilliary Functions */
+ {XK_F1, kbF1}, {XK_F2, kbF2}, {XK_F3, kbF3}, {XK_F4, kbF4}, {XK_F5, kbF5},
+ {XK_F6, kbF6}, {XK_F7, kbF7}, {XK_F8, kbF8}, {XK_F9, kbF9}, {XK_F10, kbF10},
+ {XK_F11, kbF11}, {XK_F12, kbF12},
+ /* Keypad Functions */
+ {XK_KP_0,kb0}, {XK_KP_1,kb1}, {XK_KP_2,kb2}, {XK_KP_3,kb3}, {XK_KP_4,kb4},
+ {XK_KP_5,kb5}, {XK_KP_6,kb6}, {XK_KP_7,kb7}, {XK_KP_8,kb8}, {XK_KP_9,kb9},
+ {XK_KP_Enter, kbEnter}, {XK_KP_Home,kbHome}, {XK_KP_Left,kbLeft},
+ {XK_KP_Up, kbUp}, {XK_KP_Right,kbRight}, {XK_KP_Down, kbDown},
+ {XK_KP_Page_Up, kbPgUp}, {XK_KP_Page_Down,kbPgDn}, {XK_KP_End,kbEnd},
+ {XK_KP_Begin, kbHome}, {XK_KP_Insert, kbInsert}, {XK_KP_Delete, kbDelete},
+ {XK_KP_Equal, kbEqual}, {XK_KP_Multiply, kbAsterisk}, {XK_KP_Add, kbPlus},
+ {XK_KP_Subtract, kbMinus}, {XK_KP_Decimal, kbStop}, {XK_KP_Divide, kbSlash},
+ /* End */
+ {0,0}
+};
+#endif // HAVE_KEYSYMS
+
+void TGKeyUNIX::SetKbdMapping(int version)
+{
+ Mode=version;
+ switch (version)
+ {
+ case unixXterm: // It can be combined with others
+ #ifdef HAVE_DEFINE_KEY
+ // SET: Here is a temporal workaround for Eterm when the user uses
+ // the xterm terminfo file (normal in Debian).
+ define_key("\e[7~",KEY_F(58)); // Home
+ define_key("\e[8~",KEY_F(59)); // End
+ define_key("\eOx",KEY_F(56)); // Keypad Up
+ define_key("\eOv",KEY_F(55)); // Keypad Right
+ define_key("\eOw",KEY_F(54)); // Keypad Down
+ define_key("\eOt",KEY_F(53)); // Keypad Left
+ #endif
+ #ifdef KEY_MOUSE
+ // This exists in 1.9.9 but not in 1.8.6
+ // 0631 == KEY_MOUSE
+ kbToName2[KEY_MOUSE & 0x7F]=kbMouse;
+ kbExtraFlags2[KEY_MOUSE & 0x7F]=0;
+ #endif
+ XtermMode=1;
+ break;
+ case unixNoXterm:
+ #ifdef KEY_MOUSE
+ kbToName2[KEY_MOUSE & 0x7F]=kbF7;
+ kbExtraFlags2[KEY_MOUSE & 0x7F]=kbShift;
+ #endif
+ XtermMode=0;
+ break;
+ case unixEterm:
+ #if defined(HAVE_KEYSYMS) && defined(HAVE_DEFINE_KEY)
+ // SET: I submited a patch to Eterm maintainers for it:
+ define_key("\x1B[k",KEY_F(57)); // End
+ memset(kbX11Keys,0,sizeof(kbX11Keys));
+ {
+ int i;
+ for (i=0; XEquiv[i].symbol; i++)
+ kbX11Keys[XEquiv[i].symbol & 0xFF]=XEquiv[i].key;
+ }
+ #endif
+ #ifdef KEY_MOUSE
+ // 0631 == KEY_MOUSE
+ kbToName2[KEY_MOUSE & 0x7F]=kbMouse;
+ kbExtraFlags2[KEY_MOUSE & 0x7F]=0;
+ #endif
+ XtermMode=2;
+ break;
+ }
+}
+
+int TGKeyUNIX::GetKbdMapping(int version)
+{
+ switch (version)
+ {
+ case unixXterm:
+ return XtermMode==1;
+ case unixNoXterm:
+ return !XtermMode;
+ break;
+ case unixEterm:
+ return XtermMode==2;
+ }
+ return 0;
+}
+
+// The intelligence is here
+ushort TGKeyUNIX::GKey(void)
+{
+ Abstract=0;
+
+ GetRaw();
+ // Xterm hacks:
+ if (XtermMode)
+ {
+ #ifdef KEY_MOUSE
+ if (rawCode.full==KEY_MOUSE)
+ {
+ dbprintf("TGKey::gkey: Mouse event detected\r\n");
+ Abstract=kbMouse;
+ return rawCode.full;
+ }
+ #endif
+ #ifdef HAVE_KEYSYMS
+ if (rawCode.full==KEY_F(57))
+ {
+ dbprintf("TGKey::gkey: Special Eterm keysym detected\r\n");
+ Abstract=kbEterm;
+ return rawCode.full;;
+ }
+ #endif
+ if (rawCode.full & 0x80)
+ {
+ sFlags|=kblAltL;
+ rawCode.full &= ~0x80;
+ dbprintf("Adding left alt because the code contains 0x80 and xterm detected\r\n");
+ }
+ }
+ if (rawCode.full & META_MASK)
+ {
+ sFlags|=kblAltL;
+ rawCode.full &= ~META_MASK;
+ dbprintf("Adding left alt because the code contains META key\r\n");
+ }
+
+ //---- The following code takes advantage of the flags reported by the ioctl
+ //---- call. As this mechanism isn't available if we aren't loged in the
+ //---- console I add more information later.
+
+ // Compose the shift flags:
+ if (sFlags & kblShift)
+ Abstract|=kbShiftCode;
+ if (sFlags & kblCtrl)
+ Abstract|=kbCtrlCode;
+ switch (AltSet)
+ {
+ case 0: // Normal thing, left is left, right is right
+ if (sFlags & kblAltL)
+ Abstract|=kbAltLCode;
+ else
+ if (sFlags & kblAltR)
+ Abstract|=kbAltRCode;
+ break;
+ case 1: // Reverse thing
+ if (sFlags & kblAltL)
+ Abstract|=kbAltRCode;
+ else
+ if (sFlags & kblAltR)
+ Abstract|=kbAltLCode;
+ break;
+ default: // Compatibility
+ if (sFlags & (kblAltL | kblAltR))
+ Abstract|=kbAltLCode;
+ }
+
+ //--- Translate the rest
+ unsigned char *name,*flags;
+ // This values could be 0 or 1 because curses reports upto 512 keys
+ unsigned isASCIIif;
+ if (rawCode.b.scan)
+ {
+ name=kbToName2;
+ flags=kbExtraFlags2;
+ isASCIIif=128;
+ }
+ else
+ {
+ name=kbToName1;
+ flags=kbExtraFlags1;
+ isASCIIif=32;
+ }
+ unsigned key=rawCode.full;
+ if (key & 0x80)
+ { // Keys over 127 are interpreted as ASCII
+ ascii=key;
+ rawCode.b.scan=ascii;
+ //Abstract|=kbUnknown;
+ }
+ else
+ { // The rest are passed by the tables
+ key&=0x7F;
+ ascii=key>=isASCIIif ? key : 0;
+ if (name[key]==kbTab) ascii='\t';
+ rawCode.b.scan=ascii;
+ Abstract|=name[key] | (flags[key]<<4);
+ sFlags|=(flags[key]<<4);
+ }
+ return rawCode.full;
+}
+
+// All the info. from BIOS in one call
+void TGKeyUNIX::GetRaw(void)
+{
+ int code;
+
+ /* see if there is data available */
+ if ((code=NCursesGetCh())!=ERR)
+ {
+ if (code==27)
+ {
+ if (kbhit())
+ {
+ int code2=NCursesGetCh();
+ if (code2!=27)
+ code=code2 | META_MASK;
+ }
+ }
+ }
+ else
+ {
+ rawCode.full=0;
+ sFlags=0;
+ return;
+ }
+ rawCode.full=code;
+ //printf("0x%04X\r\n",code);
+ sFlags=GetShiftState();
+}
+
+int TGKeyUNIX::KbHit(void)
+{
+ int c=NCursesGetCh();
+ if (c!=ERR) NCursesUnGetCh(c);
+ return c!=ERR;
+}
+
+void TGKeyUNIX::Clear(void)
+{
+ tcflush(IN_FD,TCIFLUSH);
+}
+
+void TGKeyUNIX::FillTEvent(TEvent &e)
+{
+ GKey();
+ if (Abstract==kbMouse)
+ { // Mouse events are traslated to keyboard sequences:
+ int event=NCursesGetCh();
+ int x=NCursesGetCh()-0x21; // They are 0x20+ and the corner is 1,1
+ int y=NCursesGetCh()-0x21;
+ switch (event)
+ {
+ case MouseB1Down:
+ MouseButtons|=mbLeftButton;
+ break;
+ case MouseB2Down:
+ MouseButtons|=mbMiddleButton;
+ break;
+ case MouseB3Down:
+ MouseButtons|=mbRightButton;
+ break;
+ case MouseUp: // fuzzy, if both are pressed ...
+ if (MouseButtons & mbLeftButton)
+ MouseButtons&= ~mbLeftButton;
+ else
+ MouseButtons&= ~mbRightButton;
+ break;
+ }
+ THWMouse::forceEvent(x,y,MouseButtons);
+ e.what=evMouseUp; // Acts like a "key"
+ dbprintf("TGKey::fillTEvent: Reporting mouse instead of key (%d,%d:%d)\r\n",x,y,event);
+ }
+ else
+ #ifdef HAVE_KEYSYMS
+ if (Abstract==kbEterm)
+ { // X keysym reported as key sequence yuupi!
+ int key,c;
+ unsigned state=0,keysym=0;
+ c=0; // To avoid hanging
+ do
+ {
+ key=NCursesGetCh();
+ if (key!=';')
+ {
+ state<<=4;
+ state+=key>='A' ? key+10-'A' : key-'0';
+ }
+ c++;
+ }
+ while (key!=';' && c<3);
+ c=0;
+ do
+ {
+ key=NCursesGetCh();
+ if (key!='~')
+ {
+ keysym<<=4;
+ keysym+=key>='A' ? key+10-'A' : key-'0';
+ }
+ c++;
+ }
+ while (key!='~' && c<3);
+ ushort code=kbX11Keys[keysym & 0xFF];
+ dbprintf("TGKey::fillTEvent: Reporting Eterm key (%X,%X code: %X)\r\n",state,keysym,code);
+ if (code)
+ {
+ sFlags=0;
+ // How can I do it better?
+ if (state & 1)
+ sFlags|=kbShiftCode;
+ if (state & 4)
+ sFlags|=kbCtrlCode;
+ if (state & 8)
+ sFlags|=kbAltLCode;
+ Abstract=code | sFlags;
+ e.keyDown.charScan.charCode=code==kbTab ? '\t' : 0;
+ e.keyDown.charScan.scanCode=0;
+ e.keyDown.raw_scanCode=0;
+ e.keyDown.keyCode=Abstract;
+ e.keyDown.shiftState=sFlags;
+ e.what=evKeyDown;
+ }
+ else
+ e.what=evNothing;
+ }
+ else
+ #endif
+ {
+ e.keyDown.charScan.charCode=sFlags & kblAltL ? 0 : ascii;
+ e.keyDown.charScan.scanCode=rawCode.b.scan;
+ e.keyDown.raw_scanCode=rawCode.b.scan;
+ e.keyDown.keyCode=Abstract;
+ e.keyDown.shiftState=sFlags;
+ e.what=evKeyDown;
+ dbprintf("TGKey::fillTEvent: Reporting key (%X/%X)\r\n",Abstract,sFlags);
+ }
+}
+
+// I don't know if other UNIX flavors have an equivalent IOCTL
+unsigned TGKeyUNIX::GetShiftState()
+{
+ return 0;
+}
+
+static struct termios saved_attributes;
+
+void TGKeyUNIX::Resume()
+{
+ tcgetattr(STDIN_FILENO,&saved_attributes);
+}
+
+void TGKeyUNIX::Suspend()
+{
+ tcsetattr(STDIN_FILENO,TCSANOW,&saved_attributes);
+}
+
+void TGKeyUNIX::Init()
+{
+ TGKey::Suspend =TGKeyUNIX::Suspend;
+ TGKey::Resume =TGKeyUNIX::Resume;
+ TGKey::kbhit =KbHit;
+ TGKey::clear =Clear;
+ TGKey::gkey =GKey;
+ TGKey::getShiftState=GetShiftState;
+ TGKey::fillTEvent =FillTEvent;
+ TGKey::SetKbdMapping=TGKeyUNIX::SetKbdMapping;
+ TGKey::GetKbdMapping=TGKeyUNIX::GetKbdMapping;
+}
+#else // TVOS_UNIX && !TVOSf_QNXRtP
+
+#include <tv/unix/key.h>
+
+#endif // else TVOS_UNIX && !TVOSf_QNXRtP
+
diff --git a/tvision/classes/unix/unixmouse.cc b/tvision/classes/unix/unixmouse.cc
new file mode 100644
index 0000000..fafcd36
--- /dev/null
+++ b/tvision/classes/unix/unixmouse.cc
@@ -0,0 +1,148 @@
+/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
+/* Copyright (C) 1999-2002 Salvador Eduardo Tropea */
+#include <tv/configtv.h>
+
+#define Uses_stdlib
+#define Uses_string
+#define Uses_stdio
+#define Uses_time
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TScreen
+#define Uses_signal
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && !defined(TVOSf_QNXRtP)
+
+#include <termios.h>
+#include <tv/unix/screen.h>
+#include <tv/unix/mouse.h>
+
+//----------------- Common stuff ---------------
+
+//#define DEBUG
+#ifdef DEBUG
+ #ifdef TVOSf_Linux
+ extern char *program_invocation_short_name;
+ #define LOG(s) do {cerr << program_invocation_short_name << ": " << s << endl; fflush(stderr);} while(0)
+ #else
+ #define LOG(s) do {cerr << s << endl; fflush(stderr);} while(0)
+ #endif
+#else
+ #define LOG(s) do {;} while(0)
+#endif
+
+#ifdef TV_BIG_ENDIAN
+ #define MouseAttrMask 0x007F;
+#else
+ #define MouseAttrMask 0x7F00;
+#endif
+
+static int last_x=0,last_y=0;
+static ushort mouse_char;
+
+static
+void get_mouse_char()
+{
+ mouse_char=TScreen::getCharacter(last_x+last_y*TScreen::screenWidth);
+}
+
+static
+void set_mouse_char()
+{
+ ushort c=mouse_char ^ MouseAttrMask;
+ TScreen::setCharacter(last_x+last_y*TScreen::screenWidth,c);
+}
+
+static
+void reset_mouse_char()
+{
+ TScreen::setCharacter(last_x+last_y*TScreen::screenWidth,mouse_char);
+}
+
+static volatile
+void show_mouse_char()
+{
+ if (last_x>TScreen::screenWidth)
+ last_x=0;
+ if (last_y>TScreen::screenHeight)
+ last_y=0;
+ get_mouse_char();
+ set_mouse_char();
+}
+
+int THWMouseUNIX::DrawMouse(int x, int y)
+{
+ if (TScreen::suspended) return 0;
+ if (x!=last_x || y!=last_y)
+ {
+ if (visible) reset_mouse_char();
+ last_x=x;
+ last_y=y;
+ if (visible) show_mouse_char();
+ return 1;
+ }
+ return 0;
+}
+
+void THWMouseUNIX::Show()
+{
+ visible=1;
+ show_mouse_char();
+}
+
+void THWMouseUNIX::Hide()
+{
+ reset_mouse_char();
+ visible=0;
+}
+
+void THWMouseUNIX::Init()
+{
+ THWMouse::Show=Show;
+ THWMouse::Hide=Hide;
+ THWMouse::drawMouse=DrawMouse;
+}
+
+THWMouseUNIX::~THWMouseUNIX()
+{
+}
+
+#ifdef HAVE_NCURSES
+//---------------- XTerm version -----------------
+
+void THWMouseXTerm::Resume()
+{
+ buttonCount=3; // X uses at least 3 buttons
+ // Save old hilit tracking and enable mouse tracking (GPM_XTERM_ON)
+ TScreenUNIX::SendToTerminal("\x1B[?1000s\x1B[?1000h");
+ LOG("using xterm* mouse");
+ show();
+}
+
+void THWMouseXTerm::Suspend()
+{
+ // Disable mouse tracking and restore old hilittracking (GPM_XTERM_OFF)
+ TScreenUNIX::SendToTerminal("\x1B[?1000l\x1B[?1000r");
+ LOG("xterm mouse disabled");
+}
+
+void THWMouseXTerm::Init()
+{
+ THWMouseUNIX::Init();
+ THWMouse::Resume=Resume;
+ THWMouse::Suspend=Suspend;
+}
+
+THWMouseXTerm::~THWMouseXTerm()
+{
+}
+#endif // HAVE_NCURSES
+#else // TVOS_UNIX && !TVOSf_QNXRtP
+
+#include <tv/unix/screen.h>
+#include <tv/unix/mouse.h>
+
+#endif // else TVOS_UNIX && !TVOSf_QNXRtP
+
diff --git a/tvision/classes/unix/unixscr.cc b/tvision/classes/unix/unixscr.cc
new file mode 100644
index 0000000..b98416d
--- /dev/null
+++ b/tvision/classes/unix/unixscr.cc
@@ -0,0 +1,1117 @@
+/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
+/* Copyright (C) 1998-2002 Salvador Eduardo Tropea */
+/*
+TODO:
+TurboVision_screenOptions
+See ToDo in the mouse initialization.
+
+TODO:
+Alt+X not working on Woody. Solution: start Eterm with --meta-mod 1.
+
+TODO:
+Mouse reporting not disabled at exit!!!
+
+*/
+#include <tv/configtv.h>
+
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TGKey
+#define Uses_string
+#define Uses_ctype
+#define Uses_TVCodePage
+#define Uses_signal
+#define Uses_ioctl
+#define Uses_stdio
+#define Uses_stdlib
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(HAVE_NCURSES) && defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP)
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <termios.h>
+#include <sys/mman.h>
+
+// I don't know why it's needed, but it seems to be only known to me way
+// to get rhgdb built so it doesn't mess up terminal settings.
+// Strange but rhide and setedit doesn't have this problem.
+// Andris Pavenis <pavenis@lanet.lv>
+#define SAVE_TERMIOS
+#include <tv/unix/screen.h>
+#include <tv/unix/key.h>
+#include <tv/unix/mouse.h>
+#include <tv/linux/mouse.h>
+
+#ifdef TVOSf_FreeBSD
+ #include <ncurses.h>
+#else
+ #include <curses.h>
+#endif
+#include <term.h>
+
+//#define DEBUG
+#ifdef DEBUG
+ #ifdef TVOSf_Linux
+ extern char *program_invocation_short_name;
+ #define LOG(s) do {cerr << program_invocation_short_name << ": " << s << endl; fflush(stderr);} while(0)
+ #else
+ #define LOG(s) do {cerr << s << endl; fflush(stderr);} while(0)
+ #endif
+#else
+ #define LOG(s) do {;} while(0)
+#endif
+
+int TScreenUNIX::use_pc_chars=1;
+int TScreenUNIX::TerminalType;
+FILE *TScreenUNIX::tty_file=0;
+int TScreenUNIX::palette;
+int TScreenUNIX::force_redraw=0;
+cc_t TScreenUNIX::oldKeys[5];
+int TScreenUNIX::old_col=-1;
+int TScreenUNIX::old_fore=-1;
+int TScreenUNIX::old_back=-1;
+ushort *TScreenUNIX::user_buffer=0;
+int TScreenUNIX::user_buffer_size;
+unsigned TScreenUNIX::user_cursor_x;
+unsigned TScreenUNIX::user_cursor_y;
+char *TScreenUNIX::terminal=0;
+char TScreenUNIX::cursesInitialized=0;
+char TScreenUNIX::termAttrsSaved=0;
+#ifdef SAVE_TERMIOS
+struct termios TScreenUNIX::old_term;
+struct termios TScreenUNIX::new_term;
+#endif
+
+TScreen *TV_UNIXDriverCheck()
+{
+ TScreenUNIX *drv=new TScreenUNIX();
+ if (!TScreen::initialized)
+ {
+ delete drv;
+ return 0;
+ }
+ return drv;
+}
+
+/**[txh]********************************************************************
+
+Moverlo a un flag en la inicialización
+
+ Description:
+ Finds if this terminal have variable code page of that's fixed.
+
+ Return:
+ True if the terminal have a variable code page.
+
+Boolean TScreen::codePageVariable()
+{
+ return (TerminalType==GENER_TERMINAL ||
+ TerminalType==XTERM_TERMINAL) ? False : True;
+}
+***************************************************************************/
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Sends the string to the terminal. Is just a replacement for
+fputs(tty_file,...) but ensures tty_file was initialized and does a flush to
+be sure the characters are flushed to the device. (SET)
+
+***************************************************************************/
+
+void TScreenUNIX::SendToTerminal(const char *value)
+{
+ if (!tty_file || !value)
+ return;
+
+ fputs(value,tty_file);
+ fflush(tty_file);
+}
+
+/* lookup table to translate characters from pc set to standard ascii */
+
+static unsigned char pctoascii[] =
+{
+ " OOooooooooo!!!*><|!!O_|^V><--^V !\"#$%&'()*+,-./0123456789:;<=>?"
+ "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~d"
+ "cueaaaaceeeiiiaaeafooouuyOUcLYPfaiounN--?--//!<>:%%|{+++++I+'++."
+ "`++}-+++`.+++=+++++++++++'.|-||-abipeouyooooooEn=+><()-=o..Vn2X "
+};
+
+static unsigned PC2curses[256];
+
+/**[txh]********************************************************************
+
+ Description:
+ This function fixes the PC437->ASCII table. This solution is only partial
+because the UNIX terminals usually use ISO-1 and never PC437. This will be
+finally fixed when I add the codepage stuff in TVision (currently only
+available in my editor). Anyways, it makes the windows look much better in
+Xterminals, additionally that's what is supposed to do (ask curses). The
+only non-clear stuff is that I'm supposing that the frames are in one of the
+character sets (G0 or G1) and not made with some trick. That's true in Linux
+and any ISO2022 terminal (Xterminals and DEC almost sure). (SET)
+
+***************************************************************************/
+
+void TScreenUNIX::InitPCCharsMapping()
+{
+ int i;
+ // By default take the above translation
+ for (i=0; i<256; i++)
+ {
+ PC2curses[i]=pctoascii[i];
+ }
+ if (use_pc_chars==1)
+ return;
+ for (i=128; i<256; i++)
+ PC2curses[i]=i;
+ // Special characters we can't print
+ PC2curses[127]='?';
+ PC2curses[128+27]='?';
+ // Terminals where the alternate charset fails (FreeBSD)
+ if (use_pc_chars==2)
+ return;
+ // Patch the curses available values from terminfo
+ PC2curses[0xDA]=ACS_ULCORNER; // Ú
+ PC2curses[0xC9]=ACS_ULCORNER; // É We don't have doubles in curses
+ PC2curses[0xC0]=ACS_LLCORNER; // À
+ PC2curses[0xC8]=ACS_LLCORNER; // È
+ PC2curses[0xBF]=ACS_URCORNER; // ¿
+ PC2curses[0xBB]=ACS_URCORNER; // »
+ PC2curses[0xD9]=ACS_LRCORNER; // Ù
+ PC2curses[0xBC]=ACS_LRCORNER; // ¼
+
+ PC2curses[0xC3]=ACS_LTEE; // Ã
+ PC2curses[0xCC]=ACS_LTEE; // Ì
+ PC2curses[0xC6]=ACS_LTEE; // Æ
+ PC2curses[0xC7]=ACS_LTEE; // Ç
+
+ PC2curses[0xB4]=ACS_RTEE; // ´
+ PC2curses[0xB9]=ACS_RTEE; // ¹
+ PC2curses[0xB5]=ACS_RTEE; // µ
+ PC2curses[0xB6]=ACS_RTEE; // ¶
+
+ PC2curses[0xC1]=ACS_BTEE; // Á
+ PC2curses[0xCA]=ACS_BTEE; // Ê
+ PC2curses[0xCF]=ACS_BTEE; // Ï
+ PC2curses[0xD0]=ACS_BTEE; // Ð
+
+ PC2curses[0xC2]=ACS_TTEE; // Â
+ PC2curses[0xCB]=ACS_TTEE; // Ë
+ PC2curses[0xD1]=ACS_TTEE; // Ñ
+ PC2curses[0xD2]=ACS_TTEE; // Ò
+
+ PC2curses[0xC4]=ACS_HLINE; // Ä
+ PC2curses[0xCD]=ACS_HLINE; // Í
+ PC2curses[0xB3]=ACS_VLINE; // ³
+ PC2curses[0xBA]=ACS_VLINE; // º
+ PC2curses[0xC5]=ACS_PLUS;
+ PC2curses[0x04]=ACS_DIAMOND;
+ PC2curses[0xB1]=ACS_CKBOARD; // 50%
+ PC2curses[0xB2]=ACS_CKBOARD; // 80%
+ PC2curses[0xFE]=ACS_BULLET;
+ PC2curses[0x11]=ACS_LARROW;
+ PC2curses[0x10]=ACS_RARROW;
+ PC2curses[0x19]=ACS_DARROW;
+ PC2curses[0x18]=ACS_UARROW;
+ // ACS_BOARD is the best choice here but isn't available in Xterms because
+ // the DEC graphic chars have only one "gray" character (ACS_CKBOARD)
+ PC2curses[0xB0]=ACS_CKBOARD;//ACS_BOARD;
+ // The block isn't available in DEC graphics.
+ //PC2curses[0xDB]=' ';//ACS_BLOCK;
+ PC2curses[0xDB]=ACS_BLOCK;
+ PC2curses[0xDC]=' ';
+ PC2curses[0xDD]=' ';
+ PC2curses[0xDF]=' ';
+ // I added the following line even when is supposed to be the default
+ // because in some way I managed to break it in Eterm while testing so I
+ // think other users could do the same. Explicitly requesting it for G1
+ // is the best.
+ TScreenUNIX::SendToTerminal("\x1B)0"); // Choose DEC characters for G1 set (ISO2022)
+}
+
+void TScreenUNIX::sigWindowSizeChanged(int sig)
+{
+ // Set a flag because we don't know if we can do it right now
+ TScreenUNIX::windowSizeChanged=1;
+ signal(sig,sigWindowSizeChanged);
+}
+
+void TScreenUNIX::SpecialKeysDisable(int file)
+{
+ struct termios term;
+ tcgetattr(file,&term);
+ oldKeys[0]=term.c_cc[VSUSP];
+ oldKeys[1]=term.c_cc[VSTART];
+ oldKeys[2]=term.c_cc[VSTOP];
+ oldKeys[3]=term.c_cc[VQUIT];
+ oldKeys[4]=term.c_cc[VINTR];
+ term.c_cc[VSUSP] =0;
+ term.c_cc[VSTART]=0;
+ term.c_cc[VSTOP] =0;
+ term.c_cc[VQUIT] =0;
+ term.c_cc[VINTR] =0;
+ tcsetattr(file,TCSANOW,&term);
+}
+
+void TScreenUNIX::SpecialKeysRestore(int file)
+{
+ struct termios term;
+ tcgetattr(file,&term);
+ term.c_cc[VSUSP] =oldKeys[0];
+ term.c_cc[VSTART]=oldKeys[1];
+ term.c_cc[VSTOP] =oldKeys[2];
+ term.c_cc[VQUIT] =oldKeys[3];
+ term.c_cc[VINTR] =oldKeys[4];
+ tcsetattr(file,TCSANOW,&term);
+}
+
+// This routine was heavily modified, and I think it needs more work (SET)
+void TScreenUNIX::startcurses(int &terminalCodePage)
+{
+ int xterm=0;
+
+ // SET: If we are under xterm* initialize some special stuff:
+ if (strncmp(terminal,"xterm-eterm-tv",14)==0)
+ { // Special keyboard treatment
+ TGKey::SetKbdMapping(TGKey::unixEterm);
+ xterm=1;
+ }
+ else
+ if (strncmp(terminal,"xterm",5)==0 || strncmp(terminal,"Eterm",5)==0)
+ { // Special keyboard treatment
+ TGKey::SetKbdMapping(TGKey::unixXterm);
+ xterm=1;
+ }
+
+ /* Configure curses */
+ stdscr->_flags |= _ISPAD;
+ // Make curses interpret the escape sequences
+ keypad(stdscr,TRUE);
+ // SET: remove the buffering and pass the values directly to us. The man
+ // pages recomend using it for interactive applications. Looks like it
+ // doesn't affect if the delay is 0 but I call it anyways
+ cbreak();
+ noecho();
+ /* set getch() in non-blocking mode */
+ timeout(0);
+
+ /* Select the palette and characters handling according to the terminal */
+ // Unknown terminal, use monochrome
+ if (!terminal)
+ {
+ palette = PAL_MONO;
+ TScreenUNIX::screenMode = TScreenUNIX::smMono;
+ use_pc_chars = 0;
+ TerminalType=GENER_TERMINAL;
+ }
+ else if (!strcmp(terminal,"console") ||
+ !strncmp(terminal,"linux",5))
+ { // Special case where we know the values or can make a good guess
+ // Assume linux or linux-c
+ palette = PAL_HIGH;
+ TScreenUNIX::screenMode = TScreenUNIX::smCO80;
+ use_pc_chars = 1;
+ TerminalType=LINUX_TERMINAL;
+ LOG("Using high palette");
+ if (strstr(terminal,"-m-")!=NULL || !strcmp(terminal+strlen(terminal)-2,"-m")) // linux-m
+ { // Mono mode, explicitly supress colors even if they are available
+ palette = PAL_MONO;
+ TScreen::screenMode = TScreen::smMono;
+ }
+ else if (strchr(terminal, '-')!=NULL && // Have a modifier
+ !(strstr(terminal,"-c-")!=NULL || !strcmp(terminal+strlen(terminal)-2,"-c"))) // It isn't color modifier
+ { // Not some color variation, so most probably a different charset
+ use_pc_chars = 0;
+ TerminalType=GENER_TERMINAL;
+ }
+ LOG(palette == PAL_HIGH ? "Using high palette" : "Using mono palette");
+ }
+ else if (xterm && has_colors())
+ { // SET: Here we know the escape sequences and as a plus the bold
+ // attribute can be used for another 8 foreground colors
+ //palette = PAL_LOW2; Alternative code
+ palette = PAL_HIGH;
+ TScreenUNIX::screenMode = TScreenUNIX::smCO80;
+ use_pc_chars = 0;
+ TerminalType=XTERM_TERMINAL;
+ }
+ else if (has_colors())
+ { // Generic color terminal, that's more a guess than a real thing
+ palette = (max_colors>8) || !strcmp(terminal,"screen") ? PAL_HIGH : PAL_LOW;
+ TScreenUNIX::screenMode = TScreenUNIX::smCO80;
+ use_pc_chars = 0;
+ LOG("Using color palette (" << max_colors << "-8 colors)");
+ TerminalType=GENER_TERMINAL;
+ }
+ else
+ { // No colors available
+ palette = PAL_MONO;
+ TScreenUNIX::screenMode = TScreenUNIX::smMono;
+ use_pc_chars = 0;
+ TerminalType=GENER_TERMINAL;
+ }
+ // SET: Not sure about it: FreeBSD terminals doesn't have frames in the "alternate
+ // characters map" or at leat needs more setup for using them.
+ if (strncmp(terminal,"cons25",6)==0)
+ {
+ use_pc_chars=2;
+ if (terminal[6]=='r' || terminal[6]=='u')
+ terminalCodePage=TVCodePage::KOI8r;
+ }
+
+ switch (TerminalType)
+ {
+ case LINUX_TERMINAL:
+ // SET: Use G1 charset, set G1 to the loaded video fonts, print control chars.
+ // It means the kernel will send what we write directly to screen, just
+ // like in the VCSA case.
+ SendToTerminal("\e)K\xE");
+ break;
+ case XTERM_TERMINAL:
+ // SET: I still wondering why I keep using ncurses. The f*ck|ng ncurses
+ // puts the keypad in an "application"(?) mode where numbers are never
+ // reported.
+ SendToTerminal("\e>");
+ case GENER_TERMINAL:
+ // Select IBM PC chars?
+ SendToTerminal(enter_pc_charset_mode);
+ #ifdef TVOSf_FreeBSD
+ // Disable autowrapping
+ SendToTerminal("\e[?7l");
+ #endif
+ break;
+ }
+ #ifdef SAVE_TERMIOS
+ /* Save the terminal attributes so we can restore them later. */
+ /* for our screen */
+ tcgetattr (tty_fd, &new_term);
+ #endif
+
+ // SET: Generate a map to convert special chars into curses values
+ InitPCCharsMapping();
+ // SET: Hook the signal generated when the size of the window changes
+ signal(SIGWINCH,sigWindowSizeChanged);
+}
+
+/*
+ * Converts colors from the large TV palette (16 foreground colors and
+ * 16 background colors) to ncurses small palette (8 foreground colors
+ * and 8 background colors).
+ */
+
+void TScreenUNIX::mapColor(char *&p, int col)
+{
+ static char map[] = {0, 4, 2, 6, 1, 5, 3, 7};
+ int back,fore;
+ if (col == old_col)
+ return;
+ old_col = col;
+ back = (col >> 4) & 7;
+ fore = col & 15;
+#define SB set_a_background ? set_a_background : set_background
+#define SF set_a_foreground ? set_a_foreground : set_foreground
+ switch (palette)
+ {
+ // SET: That's a guess because we don't know how the colors are mapped
+ // It works for xterm*
+ case PAL_LOW:
+ fore&=7;
+ if (fore==back)
+ fore=(fore+1) & 7; /* kludge */
+ if (back!=old_back)
+ safeput(p,tparm(SB,map[back]));
+ if (fore!=old_fore)
+ safeput(p,tparm(SF,map[fore]));
+ break;
+ /* SET: That's an alternative code for PAL_HIGH
+ case PAL_LOW2:
+ if (fore!=old_fore || back!=old_back)
+ {
+ if (fore>7)
+ sprintf(p,"\x1B[%d;%d;1m",map[(fore & 7)]+30,map[back]+40);
+ else // Reset attributes and then do the rest
+ sprintf(p,"\x1B[0;%d;%dm",map[fore]+30,map[back]+40);
+ p+=strlen(p);
+ }
+ break;*/
+ // SET: The value to reset the bold is 22 and not 21
+ case PAL_HIGH:
+ if (fore!=old_fore && back!=old_back)
+ sprintf(p,"\e[%d;%d;%dm",fore>7 ? 1 : 22,
+ 30+map[fore & 7],40+map[back]);
+ else
+ {
+ if (fore!=old_fore)
+ sprintf(p,"\e[%d;%dm",fore>7 ? 1 : 22,30+map[fore & 7]);
+ else
+ sprintf(p,"\e[%dm",40+map[back]);
+ }
+ p+=strlen(p);
+ break;
+ }
+ old_fore = fore;
+ old_back = back;
+#undef SB
+#undef SF
+}
+
+
+/*
+ * Writes a block of text.
+ */
+
+void TScreenUNIX::writeBlock(int dst, int len, ushort *old, ushort *src)
+{
+ char out[4096], *p = out;
+ int col=-1;
+ int altSet=0,needAltSet;
+
+ safeput(p,tparm(cursor_address,dst/TScreenUNIX::screenWidth,
+ dst%TScreenUNIX::screenWidth));
+ while (len-->0)
+ {
+ int code =CLY_Low16(*src);
+ int newcol=CLY_High16(*src);
+
+ *old++=*src++;
+ if (col!=newcol) /* change color ? */
+ {
+ col = newcol;
+ if (palette>PAL_MONO)
+ mapColor(p, col);
+ else if (palette==PAL_MONO)
+ {
+ safeput(p, exit_attribute_mode);
+ if (col==0x0f)
+ safeput(p, enter_bold_mode);
+ else
+ if (col==0x70)
+ safeput(p, enter_reverse_mode);
+ }
+ }
+
+ switch (TerminalType)
+ {
+ case XTERM_TERMINAL:
+ case GENER_TERMINAL:
+ code=PC2curses[code];
+ needAltSet=code & A_ALTCHARSET;
+ if (needAltSet && !altSet)
+ {
+ altSet=1;
+ safeput(p,enter_alt_charset_mode);
+ }
+ else
+ if (!needAltSet && altSet)
+ {
+ altSet=0;
+ safeput(p,exit_alt_charset_mode);
+ }
+ *p++=code;
+ break;
+ case LINUX_TERMINAL:
+ /* SET: The following uses information I got from Linux kernel.
+ The file drivers/char/console.c have all the parsing of the
+ escape sequences. I put more information at the end of this
+ file.
+ Some characters are ever interpreted as control codes, here
+ I use a bitmap for them taked directly from the kernel.
+ The kernel code also sugest to use UTF-8 to print those
+ codes.
+ Note that Unicode 0xF000 | character means that character
+ must pass unchanged to the screen
+ */
+ #define CTRL_ALWAYS 0x0800f501 /* Cannot be overridden by disp_ctrl */
+ #define ENTER_UTF8 "\e%G"
+ #define EXIT_UTF8 "\e%@"
+ if (code<32 && ((CTRL_ALWAYS>>code) & 1))
+ {/* This character can't be printed, we must use unicode */
+ /* Enter UTF-8 and start constructing 0xF000 code */
+ safeput(p,ENTER_UTF8 "\xEF\x80");
+ /* Set the last 6 bits */
+ *p++=code | 0x80;
+ /* Escape UTF-8 */
+ safeput(p,EXIT_UTF8);
+ }
+ else if (code==128+27)
+ {/* A specially evil code: Meta+ESC, it can't be printed */
+ /* Just send Unicode 0xF09B to screen */
+ safeput(p,ENTER_UTF8 "\xEF\x82\x9B" EXIT_UTF8);
+ }
+ else
+ /* The rest pass directly unchanged */
+ *p++=code;
+ break;
+ }
+ if (p>out+4000)
+ {
+ write(tty_fd,out,p-out);
+ p=out;
+ }
+ }
+ if (altSet)
+ safeput(p,exit_alt_charset_mode);
+ if (palette==PAL_MONO)
+ safeput(p,exit_attribute_mode);
+ safeput(p,tparm(cursor_address,cur_y,cur_x));
+ write(tty_fd,out,p-out);
+}
+
+TScreenUNIX::TScreenUNIX()
+{
+ // ************* First check all the things that can make as fail to work
+ // Release ^Q and ^S from Xon/Xoff duties
+ SpecialKeysDisable(fileno(stdin));
+ // SET: Original code tried to open a tty at any cost, eg: if stdout was
+ // redirected it tried to open stdin's tty for writing. I don't see the
+ // point of such an effort and in fact crashes the library, so here I just
+ // explain to the user how to run the application in the right way.
+ if (!isatty(fileno(stdout)))
+ {
+ fprintf(stderr,"\r\n");
+ fprintf(stderr,_("Error! %s"),_("that's an interactive application, don't redirect stdout. "
+ "If you want to collect information redirect stderr like this: "
+ "program 2> file"));
+ fprintf(stderr,"\r\n");
+ return;
+ }
+ // SET: open it as a different file because we don't want to mix both
+ char *tty_name=ttyname(fileno(stdout));
+ if (!tty_name)
+ {
+ fprintf(stderr,"Failed to get the name of the current terminal used for output!\r\n"
+ "Please e-mail to salvador@inti.gov.ar giving details about your setup\r\n"
+ "and the output of the tty command\r\n");
+ return;
+ }
+ tty_file=fopen(tty_name,"w+b");
+ if (!tty_file)
+ {
+ fprintf(stderr,"Failed to open the %s terminal!\r\n"
+ "Please e-mail to salvador@inti.gov.ar giving details about your setup\r\n"
+ "and the output of the tty command\r\n",tty_name);
+ tty_file=fopen(tty_name,"wb");
+ if (tty_file)
+ fprintf(stderr,"Also tell me it works only for writing\r\n");
+ return;
+ }
+ tty_fd=fileno(tty_file);
+ #ifdef SAVE_TERMIOS
+ /* Save the terminal attributes so we can restore them later. */
+ /* for the user screen */
+ tcgetattr(STDOUT_FILENO,&old_term);
+ termAttrsSaved=1;
+ #endif
+
+ terminal=getenv("TERM");
+ // old buggy code: if (!newterm(terminal,stdin,tty_file))
+ // SET: according to man newterm that's the right order! It was a really
+ // hard bug, and produced all kind of wierd behavior (arrow keys failing,
+ // endwin not restoring screen, etc.
+ if (!newterm(terminal,tty_file,stdin))
+ {
+ fprintf(stderr,"Not connected to a terminal (newterm for %s)\n",terminal);
+ return;
+ }
+ cursesInitialized=1;
+ // ************* If all went ok we can use this driver
+
+ /* Don't need special rights anymore */
+ seteuid(getuid());
+ setegid(getgid());
+
+ initialized=1;
+ if (dCB) dCB();
+
+ TDisplayUNIX::Init();
+
+ TScreen::Resume=Resume;
+ TScreen::Suspend=Suspend;
+ TScreen::setCrtData=setCrtData;
+ TScreen::setVideoMode=setVideoMode;
+ TScreen::setVideoModeExt=setVideoModeExt;
+ TScreen::getCharacters=getCharacters;
+ TScreen::getCharacter=getCharacter;
+ TScreen::setCharacter=setCharacter;
+ TScreen::setCharacters=setCharacters;
+ TScreen::System_p=System;
+
+ TGKeyUNIX::Init();
+ if (terminal && (strncmp(terminal,"xterm",5)==0 || strncmp(terminal,"Eterm",5)==0))
+ THWMouseXTerm::Init();
+ #ifdef HAVE_GPM
+ else
+ THWMouseGPM::Init();
+ #endif
+
+ startupCursor=getCursorType();
+ screenMode=startupMode=getCrtMode();
+
+ /* acquire screen size */
+ screenWidth =GetCols();
+ screenHeight=GetRows();
+ #ifdef TVOSf_FreeBSD
+ // Kludge: until we find a right way to fix the "last-line" display
+ // problem, this is a solution.
+ //screenHeight--;
+ #endif
+ LOG("screen size is " << (int)screenWidth << "x" << (int)screenHeight);
+
+ screenBuffer=new ushort[screenWidth * screenHeight];
+
+ // Fill the screenBuffer with spaces
+ int i,len = screenWidth*screenHeight;
+ for (i=0;i<len;i++)
+ screenBuffer[i] = 0x0720;
+
+ int terminalCodePage=TVCodePage::ISOLatin1Linux;
+ startcurses(terminalCodePage);
+
+ // Look for user settings
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+ // User settings have more priority than detected settings
+ // That's the most common case and I don't know about any reliable way to
+ // find a better default.
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : TVCodePage::ISOLatin1Linux,
+ forcedScrCP!=-1 ? forcedScrCP : terminalCodePage,
+ forcedInpCP!=-1 ? forcedInpCP : TVCodePage::ISOLatin1Linux);
+ SetDefaultCodePages(TVCodePage::ISOLatin1Linux,TVCodePage::ISOLatin1Linux,
+ TVCodePage::ISOLatin1Linux);
+
+ setVideoMode(screenMode);
+ suspended = 0;
+
+ flags0=CodePageVar | UseScreenSaver;
+}
+
+void TScreenUNIX::Resume()
+{ // Avoid wrong actions
+ setVideoMode(screenMode);
+
+ #ifdef SAVE_TERMIOS
+ /* Restore the terminal attributes. */
+ /* for our screen */
+ tcsetattr(tty_fd, TCSANOW, &new_term);
+ #endif
+
+ // SET: To go back from a temporal ncurses stop we must use just doupdate
+ // or refresh. (see suspend).
+ doupdate();
+ /* SET: For some bizarre reason when we suspend/resume the charset is altered.
+ After it we can't display the frames. I can't understand why it happends.
+ It looks like for some reason ncurses is using the IBM PC charset but when
+ we use endwin()/doupdate() forgets to set it.
+ The following escape sequence does the job:
+ */
+ switch (TerminalType)
+ {
+ case LINUX_TERMINAL:
+ // Use G1 charset, set G1 to the loaded video fonts, print control chars
+ SendToTerminal("\e)K\xE");
+ break;
+ case XTERM_TERMINAL:
+ case GENER_TERMINAL:
+ // Select IBM PC chars
+ SendToTerminal("\e(U");
+ #ifdef TVOSf_FreeBSD
+ // Disable autowrapping
+ SendToTerminal("\e[?7l");
+ #endif
+ break;
+ }
+}
+
+TScreenUNIX::~TScreenUNIX()
+{
+ if (cursesInitialized)
+ {
+ // FIXME: When I know, how to get the cursor state
+ setCursorType(startupCursor); // make the cursor visible
+ #ifdef TVOSf_FreeBSD
+ // Enable autowrapping
+ SendToTerminal("\e[?7h");
+ #endif
+ // SET: Enhanced the cleanup
+ // 1) Undo this nasty trick or curses will fail to do the rest:
+ stdscr->_flags &= ~_ISPAD;
+ // 2) Now reset the attributes, there is no "default color", is an atribute
+ // I know the name of only some attributes: 0=normal (what we need),
+ // 1=bold, 4=underline, 5=blink, 7=inverse and I think they are 9:
+ TScreenUNIX::SendToTerminal(tparm(set_attributes,0,0,0,0,0,0,0,0,0));
+ if (!TScreenUNIX::suspended)
+ {
+ // 3) Clear the screen
+ clear();
+ refresh();
+ // 4) Set usable settings (like new line mode)
+ resetterm();
+ // 5) Enable the echo or the user won't see anything
+ echo();
+ // Now we can finally end
+ endwin();
+ }
+ cursesInitialized=0;
+ }
+ if (tty_file)
+ {
+ fclose(tty_file);
+ tty_file=0;
+ }
+
+ #ifdef SAVE_TERMIOS
+ if (termAttrsSaved)
+ {
+ termAttrsSaved=0;
+ tcsetattr(STDOUT_FILENO, TCSANOW, &old_term);
+ }
+ #endif
+
+ if (!suspended)
+ {
+ RestoreScreen();
+ suspended=1;
+ }
+
+ if (screenBuffer)
+ {
+ DeleteArray(screenBuffer);
+ screenBuffer=0;
+ }
+ SpecialKeysRestore(fileno(stdin));
+
+ LOG("terminated");
+}
+
+void TScreenUNIX::Suspend()
+{
+ old_col = old_back = old_fore = -1;
+ // FIXME: When I know, how to get the cursor state
+ setCursorType(startupCursor);
+ if (!dual_display)
+ {
+ // SET: According to "man initscr" we must do endwin() to temporally stop
+ // the ncurses engine, I tried it using tty mode (xterm) and vcs mode and
+ // seems to work.
+ endwin();
+ #ifdef SAVE_TERMIOS
+ /* Restore the terminal attributes. */
+ /* for the user screen */
+ tcsetattr (STDOUT_FILENO, TCSANOW, &old_term);
+ #endif
+
+ #ifdef TVOSf_FreeBSD
+ // Enable autowrapping
+ SendToTerminal("\e[?7h");
+ #endif
+ RestoreScreen();
+ }
+}
+
+void TScreenUNIX::setCrtData()
+{
+ screenMode =getCrtMode();
+ screenWidth =getCols();
+ screenHeight=getRows();
+ hiResScreen =Boolean(screenHeight > 25);
+ cursorLines =getCursorType();
+ setCursorType(0);
+}
+
+void TScreenUNIX::setVideoMode(ushort mode)
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+ setCrtMode(fixCrtMode(mode));
+ setCrtData();
+ // allocating a zeroed screenBuffer, because this function
+ // is called in most cases (in RHIDE) after a SIGWINCH
+ if (screenWidth!=oldWidth || screenHeight!=oldHeight || !screenBuffer)
+ {
+ // Realloc screen buffer only if actually needed (it doesn't exist
+ // or screen size is changed)
+ if (screenBuffer)
+ DeleteArray(screenBuffer);
+ screenBuffer = new ushort[screenWidth*screenHeight];
+ }
+ memset(screenBuffer,0,screenWidth*screenHeight*sizeof(ushort));
+}
+
+void TScreenUNIX::setVideoModeExt( char *mode )
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+ setCrtModeExt(mode);
+ setCrtData();
+ // allocating a zeroed screenBuffer, because this function
+ // is called in most cases (in RHIDE) after a SIGWINCH
+ if (screenWidth!=oldWidth || screenHeight!=oldHeight || !screenBuffer)
+ {
+ // Realloc screen buffer only if actually needed (it doesn't exist
+ // or screen size is changed)
+ if (screenBuffer)
+ DeleteArray(screenBuffer);
+ screenBuffer = new ushort[screenWidth*screenHeight];
+ }
+ memset(screenBuffer,0,screenWidth*screenHeight*sizeof(ushort));
+}
+
+void TScreenUNIX::getCharacters(unsigned offset, ushort *buf, unsigned count)
+{
+ memcpy(buf,screenBuffer+offset,count*sizeof(ushort));
+}
+
+ushort TScreenUNIX::getCharacter(unsigned dst)
+{
+ ushort src;
+ getCharacters(dst,&src,1);
+ return src;
+}
+
+void TScreenUNIX::setCharacter(unsigned offset,ushort value)
+{
+ setCharacters(offset,&value,1);
+}
+
+/*
+ * Draws a line of text on the screen.
+ */
+
+void TScreenUNIX::setCharacters(unsigned dst, ushort *src, unsigned len)
+{
+ ushort *old = screenBuffer + dst;
+ ushort *old_right = old + len - 1;
+ ushort *src_right = src + len - 1;
+
+ /* remove unchanged characters from left to right */
+
+ if (!force_redraw)
+ {
+ while (len > 0 && *old == *src)
+ {
+ dst++;
+ len--;
+ old++;
+ src++;
+ }
+
+ /* remove unchanged characters from right to left */
+
+ while (len > 0 && *old_right == *src_right)
+ {
+ len--;
+ old_right--;
+ src_right--;
+ }
+ }
+
+ /* write only middle changed characters */
+
+ if (len > 0) writeBlock(dst, len, old, src);
+}
+
+/*****************************************************************************
+
+ Blink stuff.
+
+*****************************************************************************/
+
+//int blink_use_bios = 1;
+//int save_text_palette = 0;
+
+/*void setIntenseState()
+{
+}
+
+void setBlinkState()
+{
+}
+
+int getBlinkState()
+{ // SET: 1 means blink enabled and hence only 8 colors (was a bug)
+ // Report it according to the mode (vcs v.s. tty)
+ return canWriteVCS() ? 1 : 0;
+}*/
+
+/*****************************************************************************
+
+ Save/Restore screen
+
+*****************************************************************************/
+
+void TScreenUNIX::RestoreScreen()
+{
+ char b[256],*p=b;
+ // Set color to gray over black
+ mapColor(p,7); *p=0;
+ SendToTerminal(b);
+ // Clear the screen to it
+ SendToTerminal(clear_screen);
+}
+
+// SET: Call to an external program, optionally forking
+int TScreenUNIX::System(const char *command, pid_t *pidChild, int in,
+ int out, int err)
+{
+ if (!pidChild)
+ {
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+ }
+
+ pid_t cpid=fork();
+ if (cpid==0)
+ {// Ok, we are the child
+ // I'm not sure about it, but is the best I have right now.
+ // Doing it we can kill this child and all the subprocesses
+ // it creates by killing the group. It also have an interesting
+ // effect that I must evaluate: By doing it this process lose
+ // the controlling terminal and won't be able to read/write
+ // to the parents console. I think that's good.
+ if (setsid()==-1)
+ _exit(127);
+ char *argv[4];
+
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+
+ argv[0]=newStr(getenv("SHELL"));
+ if (!argv[0])
+ argv[0]=newStr("/bin/sh");
+ argv[1]=newStr("-c");
+ argv[2]=newStr(command);
+ argv[3]=NULL;
+ execvp(argv[0],argv);
+ delete[] argv[0];
+ delete[] argv[1];
+ delete[] argv[2];
+ // We get here only if exec failed
+ _exit(127);
+ }
+ if (cpid==-1)
+ {// Fork failed do it manually
+ *pidChild=0;
+ return system(command);
+ }
+ *pidChild=cpid;
+ return 0;
+}
+
+#else
+
+#include <tv/unix/screen.h>
+#include <tv/unix/key.h>
+#include <tv/unix/mouse.h>
+#include <tv/linux/mouse.h>
+
+#endif // TVOS_UNIX && !TVOSf_QNXRtP
+/*****************************************************************************
+
+ This code was in the constructor and commented, it could help in the
+ future.
+ * ESC ] Ps ND string NP
+ * ND can be any non-digit Character (it's discarded)
+ * NP can be any non-printing Character (it's discarded)
+ * string can be any ASCII printable string (max 511 characters)
+ * Ps = 0 -> use string as a new icon name and title
+ * Ps = 1 -> use string is a new icon name only
+ * Ps = 2 -> use string is a new title only
+ * Ps = 46 -> use string as a new log file name
+ if (getenv("DISPLAY") != NULL) cout << "\033]2;TurboVision\007";
+
+SET:
+ Here is some information about the Linux console. I got it from the kernel
+sources, they says that's VT102:
+
+\e(n
+Sets the G0 character set. The terminal have 2 character sets, that's the
+commonly used. The n value can be:
+0 Graphics (DEC ISO 2022)
+B Latin 1 (ISO 8859-1)
+U IBM PC
+K User
+
+\e)n
+It sets what character set is used for G1. That's the alternative charset.
+
+\xF
+Select the G0 charset, don't display control characters. After it all printed
+values are in G0 charset.
+
+\xE
+Select the G1 charset, display control characters. After it all printed
+values are in G1 charset. Usually it selects the graphics chars.
+
+\e[10m
+Selects G0 or G1 (depending of the last selection done by \xF or \xE), don't
+display control characters, don't force the bit 7 to 1.
+
+\e[11m
+Selects IBM PC, display control characters, don't force the bit 7 to 1.
+
+\e[12m
+Selects IBM PC, display control characters, force the bit 7 to 1.
+
+Description of the available charsets for Linux:
+1) Graphics (0):
+ This is latin 1 charset with some changes in the range 32-126. This charset
+is called VT100. Here are the codes that differ from ASCII:
+ 43(+): Right arrow 109(m): simple lower left corner
+ 44(,): Left arrow 110(n): simple intersection
+ 45(-): Up arrow 111(o): first line filled
+ 46(.): Down arrow 112(p): 1/4 of height line filled
+ 48(0): Filled block 113(q): 1/2 of height line filled
+ 95(_): Non break space 114(r): 3/4 of height line filled
+ 96(`): Diamond 115(s): last line filled
+ 97(a): 50% filled. 116(t): simple vertical with right int.
+ 98(b): HT 117(u): simple vertical with left int.
+ 99(c): FF 118(v): simple horiz. with upper int.
+100(d): CR 119(w): simple horiz. with lower int.
+101(e): LF 120(x): simple vertical
+102(f): Degree 121(y): <=
+103(g): +/- 122(z): >=
+104(h): 25% filled. 123({): pi
+105(i): VT 124(|): /=
+106(j): simple lower right corner 125(}): pounds
+107(k): simple upper right corner 126(~): middle point
+108(l): simple upper left corner
+
+2) Latin 1 (B):
+ That's pure ISO 8859-1 mapping. It means 128-159 have undefined shapes.
+
+3) IBM PC (U):
+ That's PC 437 code page. Some characters are undefined if the currently
+loaded fonts doesn't have it.
+
+4) User defined (K):
+ That's just "send to screen this code". So it depends on the loaded fonts.
+
+ Note that 0-31 and 127 are considered control characters and will be printed
+only if this is enabled. Some characters aren't printed even if that's
+enabled, that's because if they are printed you can't use the terminal
+(imagine disabling ESC ;-).
+ Also: 128+27 will never be printed.
+
+ In Eterm only Graphics (VT100) and Latin 1 are supported.
+ In xterm a simple program have troubles to print anything above 127.
+
+*****************************************************************************/
diff --git a/tvision/classes/unix/xtermdis.cc b/tvision/classes/unix/xtermdis.cc
new file mode 100644
index 0000000..cdf7b06
--- /dev/null
+++ b/tvision/classes/unix/xtermdis.cc
@@ -0,0 +1,355 @@
+/*****************************************************************************
+
+ XTerm display routines.
+ Copyright (c) 2002,2003 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+ ToDo:
+ * GetWindowTitle can lock until a key is pressed, shouldn't do it.
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_ioctl
+#define Uses_string
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_TGKey
+#define Uses_signal
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP)
+
+#include <termios.h>
+
+#include <tv/unix/xtscreen.h>
+#include <tv/unix/xtkey.h>
+#include <tv/linux/log.h>
+
+// GNU libc pulls it but other libc implementations just have a forward
+// declaration for struct timeval.
+#include <sys/time.h>
+// That's a workaround for a bug in the glibc 2.3.2 and 2.3.3:
+// The TEMP_FAILURE_RETRY macro uses errno, but errno.h isn't included!
+#include <errno.h>
+// TEMP_FAILURE_RETRY isn't mandatory.
+#ifndef TEMP_FAILURE_RETRY
+ #define TEMP_FAILURE_RETRY(a) (a)
+#endif
+
+int TDisplayXTerm::curX=0;
+int TDisplayXTerm::curY=0;
+// Current cursor shape
+int TDisplayXTerm::cursorStart=86; // 86 %
+int TDisplayXTerm::cursorEnd =99; // 99 %
+// 1 when the size of the window where the program is running changed
+volatile sig_atomic_t TDisplayXTerm::windowSizeChanged=0;
+int TDisplayXTerm::hOut=-1; // Handle for the console output
+int TDisplayXTerm::selCharset=0;
+int TDisplayXTerm::terminalType=TDisplayXTerm::XTerm;
+void (*TDisplayXTerm::ResetPaletteColors)()=ResetPaletteColorsXT;
+char TDisplayXTerm::cMap[16]={0,4,2,6,1,5,3,7,8,12,10,14,9,13,11,15};
+unsigned TDisplayXTerm::fontW,
+ TDisplayXTerm::fontH;
+char TDisplayXTerm::fontChanged=0;
+uchar TDisplayXTerm::startScreenWidth,
+ TDisplayXTerm::startScreenHeight;
+char *TDisplayXTerm::oldFontName=NULL;
+// This is the list of fixed fonts included in XFree86 4.1.0
+TScreenResolution TDisplayXTerm::XFonts[]=
+{
+ { 5, 7 },
+ { 5, 8 },
+ { 6,10 },
+ { 6,12 },
+ { 6,13 },
+ { 7,13 },
+ { 7,14 },
+ { 8,13 },
+ { 8,16 },
+ { 9,15 },
+ { 9,18 },
+ { 10,20 },
+ { 10,24 }
+};
+
+// All the code is in TScreenLinux, but this is the right moment, by this
+// time TScreenLinux is suspended.
+TDisplayXTerm::~TDisplayXTerm()
+{
+ LOG("TDisplayXTerm Destructor");
+ TScreenXTerm::DeallocateResources();
+}
+
+void TDisplayXTerm::Init()
+{
+ setCursorPos=SetCursorPos;
+ getCursorPos=GetCursorPos;
+ getCursorShape=GetCursorShape;
+ setCursorShape=SetCursorShape;
+
+ // Check if TIOCGWINSZ works
+ winsize win;
+ win.ws_col=0xFFFF;
+ ioctl(hOut,TIOCGWINSZ,&win);
+ if ((win.ws_col!=0xFFFF)&&(win.ws_col!=0))
+ {// Ok!
+ getRows=GetRowsIOCTL;
+ getCols=GetColsIOCTL;
+ }
+ else
+ {// Nope, use Window Manipulation escape sequences
+ getRows=GetRowsSeq;
+ getCols=GetColsSeq;
+ }
+ checkForWindowSize=CheckForWindowSize;
+ getWindowTitle=GetWindowTitle;
+ setWindowTitle=SetWindowTitle;
+}
+
+void TDisplayXTerm::SetCursorPos(unsigned x, unsigned y)
+{
+ fprintf(stdout,"\E[%d;%dH",y+1,x+1);
+ curX=x; curY=y;
+}
+
+void TDisplayXTerm::GetCursorPos(unsigned &x, unsigned &y)
+{
+ fflush(TGKeyXTerm::fIn);
+ fputs("\E[6n",stdout);
+ // Is it safe?
+ int nR,nC;
+ if (fscanf(TGKeyXTerm::fIn,"\E[%d;%dR",&nR,&nC)==2)
+ {
+ curX=nC-1;
+ curY=nR-1;
+ }
+ x=curX; y=curY;
+}
+
+void TDisplayXTerm::SetCursorShape(unsigned start, unsigned end)
+{
+ LOG("Setting cursor shape to " << start << "," << end);
+ if (start>=end)
+ { // Hide cursor DECRST DECTCEM
+ if (!getShowCursorEver())
+ fputs("\E[?25l",stdout);
+ }
+ else
+ { // Show cursor DECSET DECTCEM
+ fputs("\E[?25h",stdout);
+ }
+ cursorStart=start;
+ cursorEnd=end;
+}
+
+void TDisplayXTerm::GetCursorShape(unsigned &start, unsigned &end)
+{
+ // Currently we don't know the real state.
+ start=cursorStart;
+ end =cursorEnd;
+}
+
+ushort TDisplayXTerm::GetRowsIOCTL()
+{
+ winsize win;
+ ioctl(hOut,TIOCGWINSZ,&win);
+
+ return win.ws_row;
+}
+
+ushort TDisplayXTerm::GetRowsSeq()
+{
+ fputs("\E[18t",stdout);
+ int nR,nC;
+ if (fscanf(TGKeyXTerm::fIn,"\E[8;%d;%dt",&nR,&nC)==2)
+ return nR;
+ return 25;
+}
+
+ushort TDisplayXTerm::GetColsIOCTL()
+{
+ winsize win;
+
+ ioctl(hOut,TIOCGWINSZ,&win);
+ LOG("GetColsIOCTL() " << win.ws_col);
+ return win.ws_col;
+}
+
+ushort TDisplayXTerm::GetColsSeq()
+{
+ fputs("\E[18t",stdout);
+ int nR,nC;
+ if (fscanf(TGKeyXTerm::fIn,"\E[8;%d;%dt",&nR,&nC)==2)
+ return nC;
+ return 80;
+}
+
+int TDisplayXTerm::CheckForWindowSize(void)
+{
+ int ret=windowSizeChanged!=0;
+ windowSizeChanged=0;
+ return ret;
+}
+
+const char *TDisplayXTerm::GetWindowTitle(void)
+{
+ char buffer[256]; // Put a max.
+ fputs("\E[21t",stdout);
+
+ // Nasty:
+ // Lamentably Xterm doesn't return it immediately
+ fd_set set;
+ struct timeval timeout;
+ int ret;
+
+ FD_ZERO(&set);
+ FD_SET(TGKeyXTerm::hIn,&set);
+ timeout.tv_sec=0;
+ timeout.tv_usec=300000;
+ ret=TEMP_FAILURE_RETRY(select(FD_SETSIZE,&set,NULL,NULL,&timeout));
+ // Note: As this feature was reported as potentially exploitable now most
+ // XTerms just ignores this request. So if after 300 ms we didn't get an
+ // answer we assume the XTerm won't reply and report empty title.
+ if (!ret)
+ return newStr("");
+ fgets(buffer,255,TGKeyXTerm::fIn);
+ buffer[255]=0;
+ // OSC l Name ST (\E]lName\E\\)
+ if (buffer[0]!=27 || buffer[1]!=']' || buffer[2]!='l')
+ return NULL;
+ // Convert it into something the application can use for other things, not
+ // only for restoring. Read: get rid of the EOS.
+ char *end=strstr(buffer,"\E\\");
+ if (end) *end=0;
+ return newStr(buffer+3);
+}
+
+int TDisplayXTerm::SetWindowTitle(const char *name)
+{
+ if (terminalType==Eterm)
+ fprintf(stdout,"\E]2;%s\x7",name); // BEL is the string terminator
+ else
+ fprintf(stdout,"\E]2;%s\E\\",name); // \E\\ is the string terminator
+ return 1;
+}
+
+/*
+ Important note about palette:
+ Only XTerm from X 4.x and Eterm 0.9.x supports the palette manipulation.
+ As we don't have an easy way to determine the version of the terminal we
+are using this escape sequence must be "neutral".
+ The problem is that both terminals have problems with it. For this reason
+I added a Shift In (^O=\xF) to the sequence. When the sequence is
+interpreted this SI is executed and that's why I restore the value at the
+end (if (selCharset) ...). If the sequence isn't interpreted the SI finishes
+the sequence and the rest is discarded. In this way we don't mess the
+terminal state.
+*/
+// XTerm code
+int TDisplayXTerm::SetDisPaletteColorsXT(int from, int number, TScreenColor *colors)
+{
+ // Assume all will be ok
+ int ret=number;
+ fputs("\E]4",stdout);
+ while (number-- && from<16)
+ {
+ fprintf(stdout,";%d;#%2.2X%2.2X%2.2X",cMap[from++],colors->R,colors->G,colors->B);
+ colors++;
+ }
+ fputc(7,stdout);
+ return ret;
+}
+
+void TDisplayXTerm::ResetPaletteColorsXT()
+{// Just setup a default palette
+ SetDisPaletteColorsXT(0,16,PC_BIOSPalette);
+}
+
+// Eterm code, Linux console style
+int TDisplayXTerm::SetDisPaletteColorsEt(int from, int number, TScreenColor *colors)
+{
+ // Assume all will be ok
+ int ret=number;
+ while (number-- && from<16)
+ {
+ fprintf(stdout,"\E]P%1.1X%2.2X%2.2X%2.2X\xF",cMap[from++],colors->R,colors->G,colors->B);
+ colors++;
+ }
+ if (selCharset)
+ fputc(14,stdout);
+ return ret;
+}
+
+void TDisplayXTerm::ResetPaletteColorsEt()
+{
+ fputs("\E]R",stdout);
+}
+
+// This is supported only by XTerm
+char *TDisplayXTerm::GetCurrentFontName()
+{
+ if (terminalType==Eterm) return NULL;
+ char fontNameAux[84];
+ fputs("\E]50;?\x7",stdout);
+ if (fscanf(TGKeyXTerm::fIn,"\E]50;%80[^\x7]\x7",fontNameAux)==1)
+ return newStr(fontNameAux);
+ return NULL;
+}
+
+int TDisplayXTerm::SetCrtModeXT(unsigned w, unsigned h, int fW, int fH)
+{
+ const unsigned XFontsCant=sizeof(XFonts)/sizeof(TScreenResolution);
+ int fontOK=1, setFont=0;
+ unsigned whichFont;
+ if (fW!=-1 || fH!=-1)
+ {// This is all a guess, I took the GNU/Debian Woody configuration as base.
+ // That's XFree86 4.1.0
+ if (fW==-1) fW=fontW;
+ if (fH==-1) fH=fontH;
+ if ((unsigned)fW!=fontW || (unsigned)fH!=fontH)
+ {
+ setFont=1;
+ if (!searchClosestRes(XFonts,fW,fH,XFontsCant,whichFont))
+ fontOK=0;
+ fontW=XFonts[whichFont].x;
+ fontH=XFonts[whichFont].y;
+ }
+ }
+
+ if (TScreen::screenBuffer)
+ DeleteArray(TScreen::screenBuffer);
+ TScreen::screenBuffer=new ushort[w*h];
+ fprintf(stdout,"\E[8;%d;%dt",h,w);
+
+ if (setFont)
+ {
+ if (!fontChanged)
+ {// Memorize current font
+ oldFontName=GetCurrentFontName();
+ fontChanged=oldFontName!=NULL;
+ }
+ fprintf(stdout,"\E]50;%dx%d\x7",fontW,fontH);
+ }
+ // Ensure that's done before returning. I get wrong width from the IOCTL
+ // if I don't flush and ask quickly.
+ fflush(stdout);
+ return fontOK ? 1 : 2;
+}
+
+int TDisplayXTerm::SetCrtModeEt(unsigned w, unsigned h, int fW, int fH)
+{
+ return SetCrtModeXT(w,h+1,fW,fH);
+}
+#else
+
+#include <tv/unix/xtscreen.h>
+#include <tv/unix/xtkey.h>
+#include <tv/linux/log.h>
+
+#endif // TVOS_UNIX && !TVOSf_QNXRtP
+
diff --git a/tvision/classes/unix/xtermkey.cc b/tvision/classes/unix/xtermkey.cc
new file mode 100644
index 0000000..546c11e
--- /dev/null
+++ b/tvision/classes/unix/xtermkey.cc
@@ -0,0 +1,889 @@
+/*****************************************************************************
+
+ XTerm keyboard routines.
+ Copyright (c) 2002,2003 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+ Module: XTerm Keyboard
+ Comments:
+ This driver is a relatively complex one because:@*
+ 1) Deals with console mode.@*
+ 2) Translates keyboard codes.@*
+ 3) Parses escape sequences.@*
+ @p
+
+ TODO:@*
+ * Move the code that overlaps with Linux driver to a base class. Lets say
+ TGKeyEscapeSequences.@*
+ * When the list is big (>8?) us bsearch@*
+ * Allow changing MIN and TIME termios values for slow connections.@*
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_string
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_ioctl
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_FullSingleKeySymbols
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP)
+
+#include <termios.h>
+#include <fcntl.h>
+
+#include <tv/unix/xtkey.h>
+#include <tv/linux/log.h>
+
+int TGKeyXTerm::hIn=-1;
+FILE *TGKeyXTerm::fIn=NULL;
+int TGKeyXTerm::oldInFlags;
+int TGKeyXTerm::newInFlags;
+struct termios TGKeyXTerm::inTermiosOrig;
+struct termios TGKeyXTerm::inTermiosNew;
+const char *TGKeyXTerm::error=NULL;
+int TGKeyXTerm::bufferKeys[MaxLenEscapeSequence];
+int TGKeyXTerm::keysInBuffer=0;
+int TGKeyXTerm::nextKey=-1;
+int TGKeyXTerm::lastKeyCode;
+int TGKeyXTerm::lastModifiers;
+int TGKeyXTerm::translatedModifiers;
+char TGKeyXTerm::ascii;
+node *TGKeyXTerm::Keys=NULL;
+int TGKeyXTerm::MouseButtons=0;
+
+/* Linux IOCTL values found experimentally */
+const int kblNormal=0,kblShift=1,kblAltR=2,kblCtrl=4,kblAltL=8;
+
+/**[txh]********************************************************************
+
+ Description:
+ Does initialization tasks performed only once.
+
+ Return:
+ 0 if success, !=0 if an error ocurred. In the last case the error member
+points to a descriptive error.
+
+***************************************************************************/
+
+int TGKeyXTerm::InitOnce()
+{
+ LOG("TGKeyXTerm::InitOnce");
+ hIn=fileno(stdin);
+
+ if (!isatty(hIn))
+ {
+ error=_("that's an interactive application, don't redirect stdin");
+ return 1;
+ }
+
+ char *ttyName=ttyname(hIn);
+ if (!ttyName)
+ {
+ error=_("failed to get the name of the current terminal used for input");
+ return 3;
+ }
+ fIn=fopen(ttyName,"r+b");
+ if (!fIn)
+ {
+ error=_("failed to open the input terminal");
+ return 4;
+ }
+ hIn=fileno(fIn);
+
+ if (tcgetattr(hIn,&inTermiosOrig))
+ {
+ error=_("can't get input terminal attributes");
+ return 2;
+ }
+
+ memcpy(&inTermiosNew,&inTermiosOrig,sizeof(inTermiosNew));
+ // Ignore breaks
+ inTermiosNew.c_iflag|= (IGNBRK | BRKINT);
+ // Disable Xon/off
+ inTermiosNew.c_iflag&= ~(IXOFF | IXON);
+ // Character oriented, no echo, no signals
+ inTermiosNew.c_lflag&= ~(ICANON | ECHO | ISIG);
+
+ // The following are needed for Solaris. In 2.7 MIN is 4 and TIME 0
+ // making things really annoying. In the future they could be driver
+ // variables to make the use of bandwidth smaller. A value of 4 and 1 looks
+ // usable. I verified that Solaris 9 (2.9) also uses 4/0.
+ //
+ // *BSD systems seems interpret 0/0 value in a different way and they need
+ // 1/0 in order work properly (otherwise blocks forever). I verified that
+ // 1/0 works for OpenBSD 3.4, FreeBSD 4.8 and NetBSD 1.6.1. All of them uses
+ // 1/0 as default, Linux also does it.
+ inTermiosNew.c_cc[VMIN]=1;
+ inTermiosNew.c_cc[VTIME]=0; // No timeout, just don't block
+ if (tcsetattr(hIn,TCSAFLUSH,&inTermiosNew))
+ {
+ error=_("can't set input terminal attributes");
+ return 3;
+ }
+ // Don't block
+ oldInFlags=fcntl(hIn,F_GETFL,0);
+ newInFlags=oldInFlags | O_NONBLOCK;
+ fcntl(hIn,F_SETFL,newInFlags);
+
+ // We don't need to call Resume
+ suspended=0;
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Restore the original console state.
+
+***************************************************************************/
+
+void TGKeyXTerm::Suspend()
+{
+ fcntl(hIn,F_SETFL,oldInFlags);
+ tcsetattr(hIn,TCSAFLUSH,&inTermiosOrig);
+ LOG("TGKeyXTerm::Suspend");
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Memorize current console state and setup the one needed for us.
+
+***************************************************************************/
+
+void TGKeyXTerm::Resume()
+{// Read current state
+ tcgetattr(hIn,&inTermiosOrig);
+ oldInFlags=fcntl(hIn,F_GETFL,0);
+ // Set our state
+ tcsetattr(hIn,TCSAFLUSH,&inTermiosNew);
+ fcntl(hIn,F_SETFL,newInFlags);
+ LOG("TGKeyXTerm::Resume");
+}
+
+int TGKeyXTerm::KbHit()
+{
+ if (keysInBuffer || nextKey!=-1)
+ return 1; // We have a key waiting for processing
+ nextKey=fgetc(fIn);
+ return nextKey!=-1;
+}
+
+void TGKeyXTerm::Clear()
+{
+ // Discard our buffer
+ keysInBuffer=0;
+ // Discard a key waiting
+ nextKey=-1;
+ // Flush the input
+ fflush(fIn);
+}
+
+/*****************************************************************************
+
+ Here starts the keyboard parser and translator.
+ It uses a static tree/hash to parse the escape sequences, may be this should
+be configurable.
+
+*****************************************************************************/
+
+// - 9 = Tab tiene conflicto con kbI+Control lo cual es natural, por otro
+// -lado Ctrl+Tab no lo reporta en forma natural
+// - a = Enter tiene conflicto con ^J, como ^J no lo reporta naturalmente sino
+// -forzado por el keymap lo mejor es definirlo directamente.
+unsigned char TGKeyXTerm::kbToName[128] =
+{
+ 0,kbA,kbB,kbC,kbD,kbE,kbF,kbG, // 00-07
+ kbH,kbTab,kbEnter,kbK,kbL,kbM,kbN,kbO, // 08-0F
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW, // 10-17
+ kbX,kbY,kbZ,kbEsc,0,kbCloseBrace,kb6,kbMinus, // 18-1F
+ kbSpace,kbAdmid,kbDobleQuote,kbNumeral,kbDolar,kbPercent,kbAmper,kbQuote,// 20-27
+ kbOpenPar,kbClosePar,kbAsterisk,kbPlus,kbComma,kbMinus,kbStop,kbSlash, // 28-2F
+ kb0,kb1,kb2,kb3,kb4,kb5,kb6,kb7, // 30-37
+ kb8,kb9,kbDoubleDot,kbColon,kbLessThan,kbEqual,kbGreaterThan,kbQuestion, // 38-3F
+ kbA_Roba,kbA,kbB,kbC,kbD,kbE,kbF,kbG, // 40-47
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO, // 48-4F
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW, // 50-57
+ kbX,kbY,kbZ,kbOpenBrace,kbBackSlash,kbCloseBrace,kbCaret,kbUnderLine, // 58-5F
+ kbGrave,kbA,kbB,kbC,kbD,kbE,kbF,kbG, // 60-67
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO, // 68-6F
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW, // 70-77
+ kbX,kbY,kbZ,kbOpenCurly,kbOr,kbCloseCurly,kbTilde,kbBackSpace // 78-7F
+};
+
+unsigned char TGKeyXTerm::kbExtraFlags[128] =
+{
+ 0,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl, // 00-07
+ kblCtrl,0,0,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl, // 08-0F
+ kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl,kblCtrl, // 10-17
+ kblCtrl,kblCtrl,kblCtrl,0,0,kblCtrl,kblCtrl,kblCtrl, // 18-1F
+ 0,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,0, // 20-27
+ kblShift,kblShift,kblShift,kblShift,0,0,0,0, // 28-2F
+ 0,0,0,0,0,0,0,0, // 30-37
+ 0,0,kblShift,0,kblShift,0,kblShift,kblShift, // 38-3F
+ kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift, // 40-47
+ kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift, // 48-4F
+ kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift,kblShift, // 50-57
+ kblShift,kblShift,kblShift,0,0,0,kblShift,kblShift, // 58-5F
+ 0,0,0,0,0,0,0,0, // 60-67
+ 0,0,0,0,0,0,0,0, // 68-6F
+ 0,0,0,0,0,0,0,0, // 70-77
+ 0,0,0,kblShift,kblShift,kblShift,kblShift,0, // 78-7F
+};
+
+/************************** Escape sequences tree **************************/
+struct node
+{
+ union
+ {
+ char value;
+ char keys;
+ };
+ uchar code;
+ uchar modifiers;
+ node *next;
+};
+
+// This is how Xterm usually encodes the modifiers
+static
+uchar xtMods[7]=
+{
+ kblShift, // 2
+ kblAltL, // 3
+ kblShift | kblAltL, // 4
+ kblCtrl, // 5
+ kblShift | kblCtrl, // 6
+ kblCtrl | kblAltL, // 7
+ kblShift | kblCtrl | kblAltL // 8
+};
+
+const uchar fgEterm=1, fgOnlyEterm=2;
+typedef struct
+{
+ uchar number;
+ uchar code;
+} stCsiKey;
+
+typedef struct
+{
+ uchar number;
+ uchar code;
+ uchar mods;
+} stEtKey;
+
+// CSI Number ; Modifiers ~
+const int cCsiKeys1=16;
+static
+stCsiKey csiKeys1[cCsiKeys1]=
+{
+ { 1, kbHome }, // Putty
+ { 2, kbInsert },
+ { 3, kbDelete },
+ { 4, kbEnd }, // Putty
+ { 5, kbPgUp }, // Prior
+ { 6, kbPgDn }, // Next
+ { 7, kbHome },
+ { 8, kbEnd },
+ { 15, kbF5 },
+ { 17, kbF6 },
+ { 18, kbF7 },
+ { 19, kbF8 },
+ { 20, kbF9 },
+ { 21, kbF10 },
+ { 23, kbF11 },
+ { 24, kbF12 }
+};
+
+static
+uchar csiFgKeys1[]=
+{
+ fgEterm,fgEterm,fgEterm,fgEterm,
+ fgOnlyEterm|fgEterm,fgOnlyEterm|fgEterm, // Home & End
+ 0,0,0,0,0,0,0,0
+};
+
+// CSI Modifiers Letter
+const int cCsiKeys2=9;
+static
+stCsiKey csiKeys2[cCsiKeys2]=
+{
+ { 'A', kbUp },
+ { 'B', kbDown },
+ { 'C', kbRight },
+ { 'D', kbLeft },
+ { 'E', kb5 }, // Key pad 5
+ { 'F', kbEnd },
+ { 'H', kbHome },
+ { 'K', kbBackSpace }, // SET extension ;-)
+ { 'T', kbTab } // SET extension ;-)
+};
+
+// Modifiers O Letter
+const int cCsiKeys3=4;
+static
+stCsiKey csiKeys3[cCsiKeys3]=
+{
+ { 'P', kbF1 },
+ { 'Q', kbF2 },
+ { 'R', kbF3 },
+ { 'S', kbF4 }
+};
+
+// Eterm: O Letter and Application mode
+const int cCsiKeys4=26;
+static
+stEtKey csiKeys4[cCsiKeys4]=
+{
+ { 'a', kbUp, kblCtrl },
+ { 'b', kbDown, kblCtrl },
+ { 'c', kbRight, kblCtrl },
+ { 'd', kbLeft, kblCtrl },
+ { 'A', kbUp, 0 },
+ { 'B', kbDown, 0 },
+ { 'C', kbRight, 0 },
+ { 'D', kbLeft, 0 },
+ { 'F', kbEnd, 0 },
+ { 'H', kbHome, 0 },
+ // Keypad
+ { 'M', kbEnter, 0 },
+ { 'j', kbAsterisk, 0 },
+ { 'k', kbPlus, 0 },
+ { 'm', kbMinus, 0 },
+ { 'n', kbDelete, 0 },
+ { 'o', kbSlash, 0 },
+ { 'p', kbInsert, 0 },
+ { 'q', kbEnd, 0 },
+ { 'r', kbDown, 0 },
+ { 's', kbPgDn, 0 },
+ { 't', kbLeft, 0 },
+ { 'u', kb5, 0 },
+ { 'v', kbRight, 0 },
+ { 'w', kbHome, 0 },
+ { 'x', kbUp, 0 },
+ { 'y', kbPgUp, 0 }
+};
+
+node *TGKeyXTerm::NewNode()
+{
+ node *ret=(node *)malloc(sizeof(node));
+ ret->keys=0;
+ return ret;
+}
+
+node *TGKeyXTerm::NewNode(node *p)
+{
+ node *ret=(node *)malloc(sizeof(node)*2);
+ ret->keys=1;
+ ret[1]=*p;
+ return ret;
+}
+
+node *TGKeyXTerm::SearchInList(node *p, uchar k)
+{
+ if (p->keys==0) return NULL; // No keys
+ int i,c=p->keys;
+ for (i=1; i<=c; i++)
+ if (p[i].value==k)
+ return p+i;
+ return NULL; // Not found
+}
+
+node *TGKeyXTerm::AddKey2List(node *p, uchar k, node **pa)
+{
+ int i=1,c=p->keys;
+ while (i<=c && p->value<k) i++;
+ p=(node *)realloc(p,sizeof(node)*(c+2));
+ if (pa) *pa=p;
+ if (i<=c)
+ {// In the middle
+ memmove(p+i+1,p+i,c-i+1);
+ }
+ p[i].value=k;
+ p[i].next=NULL;
+ p->keys++;
+ return p+i;
+}
+
+void TGKeyXTerm::AddKey(const uchar *key, uchar code, uchar modifiers)
+{
+ if (!Keys)
+ Keys=NewNode();
+ node *p=Keys,*pk,**pa=&Keys;
+ const uchar *s=key;
+
+ while (*s)
+ {
+ pk=SearchInList(p,*s);
+ if (!pk)
+ {// Not in the list
+ pk=AddKey2List(p,*s,pa);
+ if (*(s+1))
+ {// New ramification
+ p=NewNode();
+ pk->next=p;
+ pa=&(pk->next);
+ }
+ else
+ {// Just new key
+ pk->next=NULL;
+ pk->code=code;
+ pk->modifiers=modifiers;
+ }
+ }
+ else
+ {// Already in the list
+ if (*(s+1))
+ {// It isn't the end, what is currently there?
+ if (!pk->next)
+ {// We have a key, so we must ramify without losing it
+ pk->next=NewNode(pk);
+ }
+ pa=&(pk->next);
+ p=pk->next;
+ }
+ else
+ {
+ if (pk->next)
+ LOG("Error, this key is confusing");
+ else
+ LOG("Warning, this key was already defined [" << key << "]");
+ }
+ }
+ s++;
+ }
+}
+
+#ifdef DEBUGTREE
+static
+int maxKeys=0;
+
+static
+void Indent(int level)
+{
+ while (level--)
+ fputc(' ',stderr);
+}
+
+static
+void PrintTree(node *p, int level)
+{
+ int i,c;
+
+ c=p->keys;
+ Indent(level);
+ fprintf(stderr,"Keys: %d\n",c);
+ if (c>maxKeys)
+ maxKeys=c;
+ for (i=1; i<=c; i++)
+ {
+ Indent(level);
+ fprintf(stderr,"Key %c ",p[i].value);
+ if (p[i].next)
+ {
+ Indent(level);
+ fprintf(stderr,"Ramification\n");
+ PrintTree(p[i].next,level+1);
+ }
+ else
+ {
+ Indent(level);
+ fprintf(stderr,"KeyCode %s\n",TGKey::NumberToKeyName(p[i].code));
+ }
+ }
+ if (level==0)
+ fprintf(stderr,"Max keys: %d\n",maxKeys);
+}
+#else
+ #define PrintTree(a,b)
+#endif
+
+void TGKeyXTerm::PopulateTree()
+{
+ int i,j;
+ char b[MaxLenEscapeSequence];
+
+ for (i=0; i<cCsiKeys1; i++)
+ {
+ sprintf(b,"[%d~",csiKeys1[i].number);
+ AddKey((uchar *)b,csiKeys1[i].code,0);
+ if (!(csiFgKeys1[i] & fgOnlyEterm))
+ for (j=0; j<7; j++)
+ {
+ sprintf(b,"[%d;%d~",csiKeys1[i].number,j+2);
+ AddKey((uchar *)b,csiKeys1[i].code,xtMods[j]);
+ }
+ if (csiFgKeys1[i] & fgEterm)
+ {
+ sprintf(b,"[%d^",csiKeys1[i].number);
+ AddKey((uchar *)b,csiKeys1[i].code,kblCtrl);
+ sprintf(b,"[%d$",csiKeys1[i].number);
+ AddKey((uchar *)b,csiKeys1[i].code,kblShift);
+ sprintf(b,"[%d@",csiKeys1[i].number);
+ AddKey((uchar *)b,csiKeys1[i].code,kblShift| kblCtrl);
+ }
+ }
+ for (i=0; i<cCsiKeys2; i++)
+ {
+ sprintf(b,"[%c",csiKeys2[i].number);
+ AddKey((uchar *)b,csiKeys2[i].code,0);
+ for (j=0; j<7; j++)
+ {
+ sprintf(b,"[%d%c",j+2,csiKeys2[i].number);
+ AddKey((uchar *)b,csiKeys2[i].code,xtMods[j]);
+ }
+ }
+ for (i=0; i<cCsiKeys3; i++)
+ {
+ sprintf(b,"O%c",csiKeys3[i].number);
+ AddKey((uchar *)b,csiKeys3[i].code,0);
+ for (j=0; j<7; j++)
+ {
+ sprintf(b,"O%d%c",j+2,csiKeys3[i].number);
+ AddKey((uchar *)b,csiKeys3[i].code,xtMods[j]);
+ }
+ }
+ for (i=0; i<cCsiKeys4; i++)
+ {
+ sprintf(b,"O%c",csiKeys4[i].number);
+ AddKey((uchar *)b,csiKeys4[i].code,csiKeys4[i].mods);
+ }
+
+ // Eterm rarities:
+ // Shift+arrows
+ AddKey((uchar *)"[a",kbUp,kblShift);
+ AddKey((uchar *)"[b",kbDown,kblShift);
+ AddKey((uchar *)"[c",kbRight,kblShift);
+ AddKey((uchar *)"[d",kbLeft,kblShift);
+ // F1-F4
+ AddKey((uchar *)"[11~",kbF1,0);
+ AddKey((uchar *)"[12~",kbF2,0);
+ AddKey((uchar *)"[13~",kbF3,0);
+ AddKey((uchar *)"[14~",kbF4,0);
+ // Ctrl+Fx
+ AddKey((uchar *)"[11^",kbF1,kblCtrl);
+ AddKey((uchar *)"[12^",kbF2,kblCtrl);
+ AddKey((uchar *)"[13^",kbF3,kblCtrl);
+ AddKey((uchar *)"[14^",kbF4,kblCtrl);
+ AddKey((uchar *)"[15^",kbF5,kblCtrl);
+ AddKey((uchar *)"[17^",kbF6,kblCtrl);
+ AddKey((uchar *)"[18^",kbF7,kblCtrl);
+ AddKey((uchar *)"[19^",kbF8,kblCtrl);
+ AddKey((uchar *)"[20^",kbF9,kblCtrl);
+ AddKey((uchar *)"[21^",kbF10,kblCtrl);
+ // Shift+Fx (Shift F1 and F2 overlaps with F11 and F12)
+ AddKey((uchar *)"[25~",kbF3,kblShift);
+ AddKey((uchar *)"[26~",kbF4,kblShift);
+ AddKey((uchar *)"[28~",kbF5,kblShift);
+ AddKey((uchar *)"[29~",kbF6,kblShift);
+ AddKey((uchar *)"[31~",kbF7,kblShift);
+ AddKey((uchar *)"[32~",kbF8,kblShift);
+ AddKey((uchar *)"[33~",kbF9,kblShift);
+ AddKey((uchar *)"[34~",kbF10,kblShift);
+ AddKey((uchar *)"[23$",kbF11,kblShift);
+ AddKey((uchar *)"[24$",kbF12,kblShift);
+ // Ctrl+Shift+Fx
+ AddKey((uchar *)"[23^",kbF1,kblCtrl | kblShift);
+ AddKey((uchar *)"[24^",kbF2,kblCtrl | kblShift);
+ AddKey((uchar *)"[25^",kbF3,kblCtrl | kblShift);
+ AddKey((uchar *)"[26^",kbF4,kblCtrl | kblShift);
+ AddKey((uchar *)"[28^",kbF5,kblCtrl | kblShift);
+ AddKey((uchar *)"[29^",kbF6,kblCtrl | kblShift);
+ AddKey((uchar *)"[31^",kbF7,kblCtrl | kblShift);
+ AddKey((uchar *)"[32^",kbF8,kblCtrl | kblShift);
+ AddKey((uchar *)"[33^",kbF9,kblCtrl | kblShift);
+ AddKey((uchar *)"[34^",kbF10,kblCtrl | kblShift);
+ AddKey((uchar *)"[23@",kbF11,kblCtrl | kblShift);
+ AddKey((uchar *)"[24@",kbF12,kblCtrl | kblShift);
+
+ // The mouse reporting mechanism:
+ AddKey((uchar *)"[M",kbMouse,0);
+
+ PrintTree(Keys,0);
+}
+/*********************** End of escape sequences tree ***********************/
+
+/**[txh]********************************************************************
+
+ Description:
+ Parse a escape sequence.
+
+ Returns: 1 if the sequence found, 0 if not and the keys are stored in the
+buffer.
+
+***************************************************************************/
+
+int TGKeyXTerm::ProcessEscape()
+{
+ int nextVal, extraModifiers;
+
+ nextVal=fgetc(fIn);
+ if (nextVal==EOF) // Just ESC
+ return 0;
+ // ESC + Escape sequence => Alt/Meta + Escape sequence
+ extraModifiers=0;
+ if (nextVal=='\e')
+ {
+ extraModifiers=kblAltL;
+ nextVal=fgetc(fIn);
+ if (nextVal==EOF) // Just Alt+ESC
+ {
+ lastModifiers=kblAltL;
+ return 0;
+ }
+ }
+
+ node *p=Keys;
+ int cant,i;
+ keysInBuffer=0;
+ while (nextVal!=EOF)
+ {
+ NextNode:
+ bufferKeys[keysInBuffer++]=nextVal;
+ cant=p->value;
+ for (i=1; i<=cant; i++)
+ {
+ if (p[i].value==nextVal)
+ {
+ if (p[i].next)
+ {
+ p=p[i].next;
+ nextVal=fgetc(fIn);
+ goto NextNode;
+ }
+ lastKeyCode=p[i].code;
+ lastModifiers=p[i].modifiers | extraModifiers;
+ bufferKeys[keysInBuffer]=0;
+ keysInBuffer=0;
+ return 1;
+ }
+ }
+ return 0;
+ }
+ return 0;
+}
+
+int TGKeyXTerm::GetKeyFromBuffer()
+{
+ int ret=bufferKeys[--keysInBuffer];
+ if (keysInBuffer)
+ memcpy(bufferKeys,bufferKeys+1,keysInBuffer);
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets a key from the buffer, waiting value or fIn and if needed calls
+the escape sequence parser.
+
+***************************************************************************/
+
+int TGKeyXTerm::GetKeyParsed()
+{
+ lastModifiers=0;
+ translatedModifiers=-1;
+ // If we have keys in the buffer take from there.
+ // They already failed the escape sequence test.
+ if (keysInBuffer)
+ return GetKeyFromBuffer();
+
+ // Use the value we have on hold or get a new one
+ int nextVal=nextKey;
+ nextKey=-1;
+ if (nextVal==-1)
+ nextVal=fgetc(fIn);
+ if (nextVal==-1)
+ return -1;
+
+ // Is that an escape sequence?
+ if (nextVal=='\e')
+ {
+ if (ProcessEscape())
+ return -2;
+ if (!keysInBuffer)
+ return '\e';
+ lastKeyCode=GetKeyFromBuffer();
+ lastModifiers=kblAltL;
+ return -3;
+ }
+
+ return nextVal;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets the next key, their modifiers and ASCII. Is a postprocessor for
+GetKeyParsed.
+
+***************************************************************************/
+
+int TGKeyXTerm::GetRaw()
+{
+ int result=GetKeyParsed();
+
+ if (result==-1)
+ return 0; // No key
+ if (result==-2)
+ {
+ ascii=0;
+ return 1; // Key already processed
+ }
+ if (result==-3) // Forced modifier
+ result=lastKeyCode;
+
+ ascii=result;
+ // Translate the key
+ if (result>=128)
+ lastKeyCode=kbUnkNown;
+ else
+ {
+ lastModifiers|=kbExtraFlags[result];
+ lastKeyCode=kbToName[result];
+ }
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets a key from the input and converts it into the TV format.
+
+***************************************************************************/
+
+ushort TGKeyXTerm::GKey()
+{
+ if (GetRaw())
+ { // Here I add the modifiers to the key code
+ if (lastModifiers & kblShift)
+ lastKeyCode|=kbShiftCode;
+ if (lastModifiers & kblCtrl)
+ lastKeyCode|=kbCtrlCode;
+ switch (AltSet)
+ {
+ case 1: // Reverse thing
+ if (lastModifiers & kblAltL)
+ lastKeyCode|=kbAltRCode;
+ break;
+ default: // Compatibility
+ if (lastModifiers & kblAltL)
+ lastKeyCode|=kbAltLCode;
+ }
+ return lastKeyCode;
+ }
+ return kbUnkNown;
+}
+/*****************************************************************************
+ End of parser and translator.
+*****************************************************************************/
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the value of the modifiers in TV format.
+
+***************************************************************************/
+
+unsigned TGKeyXTerm::GetShiftState()
+{
+ if (!lastModifiers) return 0;
+ if (translatedModifiers==-1)
+ {
+ translatedModifiers=0;
+ if (lastModifiers & kblShift)
+ translatedModifiers|=kbLeftShiftDown | kbRightShiftDown;
+ if (lastModifiers & kblCtrl)
+ translatedModifiers|=kbLeftCtrlDown | kbRightCtrlDown | kbCtrlDown;
+ if (lastModifiers & kblAltL)
+ translatedModifiers|=kbLeftAltDown | kbAltDown;
+ }
+ return translatedModifiers;
+}
+
+const int MouseB1Down=0x20,MouseB2Down=0x21,MouseB3Down=0x22,MouseUp=0x23,
+ MouseB4Down=0x60,MouseB5Down=0x61;
+
+/**[txh]********************************************************************
+
+ Description:
+ Fills the TV event structure for a key.
+
+***************************************************************************/
+
+void TGKeyXTerm::FillTEvent(TEvent &e)
+{
+ GKey();
+ if ((lastKeyCode & kbKeyMask)==kbMouse)
+ { // Mouse events are traslated to keyboard sequences:
+ int event=fgetc(fIn);
+ int x=fgetc(fIn)-0x21; // They are 0x20+ and the corner is 1,1
+ int y=fgetc(fIn)-0x21;
+ // Filter the modifiers:
+ event&= ~0x1C;
+ // B4 and B5 behaves in a particular way
+ MouseButtons&= ~(MouseB4Down | MouseB5Down);
+ if (event>=0x60)
+ {// B4 and B5, they seems to report a press and never a release
+ if (event==MouseB4Down)
+ MouseButtons|=mbButton4;
+ else
+ if (event==MouseB5Down)
+ MouseButtons|=mbButton5;
+ }
+ else
+ {
+ if (event>=0x40) event-=0x20; // Translate motion values
+ switch (event)
+ {
+ case MouseB1Down:
+ MouseButtons|=mbLeftButton;
+ break;
+ case MouseB2Down:
+ MouseButtons|=mbMiddleButton;
+ break;
+ case MouseB3Down:
+ MouseButtons|=mbRightButton;
+ break;
+ case MouseUp: // fuzzy, which one?
+ MouseButtons=0;
+ break;
+ }
+ }
+ THWMouse::forceEvent(x,y,MouseButtons);
+ e.what=evMouseUp; // Acts like a "key"
+ return;
+ }
+
+ e.keyDown.charScan.charCode=lastModifiers & kblAltL ? 0 : ascii;
+ e.keyDown.charScan.scanCode=ascii;
+ e.keyDown.raw_scanCode=ascii;
+ e.keyDown.keyCode=lastKeyCode;
+ e.keyDown.shiftState=lastModifiers;
+ e.what=evKeyDown;
+}
+
+void TGKeyXTerm::Init()
+{
+ TGKey::Suspend =TGKeyXTerm::Suspend;
+ TGKey::Resume =TGKeyXTerm::Resume;
+ TGKey::kbhit =KbHit;
+ TGKey::clear =Clear;
+ TGKey::gkey =GKey;
+ TGKey::getShiftState=GetShiftState;
+ TGKey::fillTEvent =FillTEvent;
+ if (Keys==NULL)
+ PopulateTree();
+}
+
+#else // TVOS_UNIX && !TVOSf_QNXRtP
+
+#include <tv/unix/xtkey.h>
+#include <tv/linux/log.h>
+
+#endif // else TVOS_UNIX && !TVOSf_QNXRtP
diff --git a/tvision/classes/unix/xtermmouse.cc b/tvision/classes/unix/xtermmouse.cc
new file mode 100644
index 0000000..d4d2d85
--- /dev/null
+++ b/tvision/classes/unix/xtermmouse.cc
@@ -0,0 +1,93 @@
+/*****************************************************************************
+
+ XTerm mouse routines.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+ This driver is a little bit different than THWMouseXTerm because:
+ 1) Is specifically used with TScreenXTerm.
+ 2) Uses a finer reporting mechanism.
+ 3) TScreenXTerm::SendToTerminal doesn't exist.
+
+ TODO:
+ Why save/restore fails in Eterm?
+ Bug Eterm people to get 1002 ;-)
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP)
+
+#include <tv/unix/mouse.h>
+#include <tv/unix/xtmouse.h>
+#include <tv/linux/log.h>
+
+int THWMouseXTermFull::mode=modeEterm;
+
+void THWMouseXTermFull::ResumeFull()
+{
+ buttonCount=5; // X uses at least 3 buttons, but 5 can be reported
+ // Save old hilit tracking and enable mouse tracking
+ // 1002 == Use Cell Motion Mouse Tracking.
+ fprintf(stdout,"\E[?1002s\E[?1002h");
+ show();
+ LOG("XTerm mouse enabled (full)");
+}
+
+void THWMouseXTermFull::SuspendFull()
+{
+ // Disable mouse tracking and restore old hilittracking
+ fprintf(stdout,"\E[?1002l\E[?1002r");
+ LOG("XTerm mouse disabled (full)");
+}
+
+void THWMouseXTermFull::ResumeSimple()
+{
+ buttonCount=5; // X uses at least 3 buttons, but 5 can be reported
+ //fprintf(stdout,"\E[?1000s\E[?1000h");
+ fprintf(stdout,"\E[?1000h");
+ show();
+ LOG("XTerm mouse enabled (simple)");
+}
+
+void THWMouseXTermFull::SuspendSimple()
+{
+ // Disable mouse tracking and restore old hilittracking
+ //fprintf(stdout,"\E[?1000l\E[?1000r"); Is Eterm broken or is just me?
+ fprintf(stdout,"\E[?1000l");
+ LOG("XTerm mouse disabled (simple)");
+}
+
+void THWMouseXTermFull::Init(int aMode)
+{
+ THWMouseUNIX::Init();
+ mode=aMode;
+ if (mode==modeXTerm)
+ {
+ THWMouse::Resume=ResumeFull;
+ THWMouse::Suspend=SuspendFull;
+ }
+ else
+ {
+ THWMouse::Resume=ResumeSimple;
+ THWMouse::Suspend=SuspendSimple;
+ }
+}
+
+THWMouseXTermFull::~THWMouseXTermFull()
+{
+}
+#else // TVOS_UNIX && !TVOSf_QNXRtP
+
+#include <tv/unix/mouse.h>
+#include <tv/unix/xtmouse.h>
+#include <tv/linux/log.h>
+
+#endif // else TVOS_UNIX && !TVOSf_QNXRtP
diff --git a/tvision/classes/unix/xtermscr.cc b/tvision/classes/unix/xtermscr.cc
new file mode 100644
index 0000000..9a5dbac
--- /dev/null
+++ b/tvision/classes/unix/xtermscr.cc
@@ -0,0 +1,952 @@
+/*****************************************************************************
+
+ Linux screen routines.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+ Configuration variables:
+ ScreenWidth
+ ScreenHeight
+ ScreenPalette
+ FontWidth
+ FontHeight
+ AppCP
+ ScrCP
+ InpCP
+ UseShellScreen
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TGKey
+#define Uses_TVCodePage
+#define Uses_string
+#define Uses_ctype
+#define Uses_signal
+#define Uses_stdio
+#define Uses_stdlib
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP)
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <termios.h>
+
+#include <tv/unix/xtscreen.h>
+#include <tv/unix/xtkey.h>
+#include <tv/unix/mouse.h>
+#include <tv/unix/xtmouse.h>
+#include <tv/linux/log.h>
+
+struct termios TScreenXTerm::outTermiosOrig;
+struct termios TScreenXTerm::outTermiosNew;
+const char *TScreenXTerm::error=NULL;
+int TScreenXTerm::palette;
+int TScreenXTerm::oldCol=-1,
+ TScreenXTerm::oldBack=-1,
+ TScreenXTerm::oldFore=-1;
+char TScreenXTerm::useShellScreen=0;
+
+#define force_redraw 0
+
+TScreen *TV_XTermDriverCheck()
+{
+ TScreenXTerm *drv=new TScreenXTerm();
+ if (!TScreen::initialized)
+ {
+ delete drv;
+ return 0;
+ }
+ return drv;
+}
+
+void TScreenXTerm::sigWindowSizeChanged(int sig)
+{
+ // Set a flag because we don't know if we can do it right now
+ TScreenXTerm::windowSizeChanged=1;
+ signal(sig,sigWindowSizeChanged);
+}
+
+void TScreenXTerm::Init()
+{
+ TScreen::Resume=Resume;
+ TScreen::Suspend=Suspend;
+ TScreen::setCrtData=defaultSetCrtData;
+ TScreen::setVideoMode=SetVideoMode;
+ TScreen::setVideoModeExt=SetVideoModeExt;
+ TScreen::setCharacter=SetCharacter;
+ TScreen::System_p=System;
+ TScreen::setCharacters=SetCharacters;
+ TDisplay::checkForWindowSize=CheckForWindowSize;
+}
+
+
+int TScreenXTerm::InitOnce()
+{
+ LOG("TScreenXTerm::InitOnce");
+ hOut=fileno(stdout);
+ // SET: Original code tried to open a tty at any cost, eg: if stdout was
+ // redirected it tried to open stdin's tty for writing. I don't see the
+ // point of such an effort and in fact crashes the library, so here I just
+ // explain to the user how to run the application in the right way.
+ if (!isatty(hOut))
+ {
+ error=_("that's an interactive application, don't redirect stdout. "
+ "If you want to collect information redirect stderr like this: "
+ "program 2> file");
+ return 1;
+ }
+
+ if (tcgetattr(hOut,&outTermiosOrig))
+ {
+ error=_("can't get output terminal information");
+ return 2;
+ }
+
+ // Save cursor position, attributes and charset
+ fputs("\E7",stdout);
+ memcpy(&outTermiosNew,&outTermiosOrig,sizeof(outTermiosNew));
+ outTermiosNew.c_oflag|=OPOST;
+ if (tcsetattr(hOut,TCSAFLUSH,&outTermiosNew))
+ {
+ error=_("can't configure terminal mode");
+ return 3;
+ }
+
+ // Impossible to know the actual palette, just assume a default
+ memcpy(OriginalPalette,PC_BIOSPalette,sizeof(OriginalPalette));
+ memcpy(ActualPalette,PC_BIOSPalette,sizeof(ActualPalette));
+
+ // Setup the driver properties.
+ // We can change the palette (but can't restore it perfectly).
+ // I assume that's XTerm 4.x or Eterm 0.9.x, this doesn't work
+ // for older versions.
+ flags0=CanSetPalette | CanSetVideoSize;
+ return 0;
+}
+
+
+TScreenXTerm::TScreenXTerm()
+{
+ // Identify the terminal, if that's XTerm or Eterm go on.
+ char *terminal=getenv("TERM");
+ if (!terminal || !(!strncmp(terminal,"xterm",5) || !strncasecmp(terminal,"Eterm",5)))
+ return;
+
+ if (!strncasecmp(terminal,"Eterm",5))
+ terminalType=Eterm;
+
+ // Initialize terminal
+ if (InitOnce())
+ {
+ fprintf(stderr,_("Error! %s"),error);
+ fprintf(stderr,"\r\n");
+ return;
+ }
+ // Initialize keyboard
+ if (TGKeyXTerm::InitOnce())
+ {
+ tcsetattr(hOut,TCSAFLUSH,&outTermiosOrig);
+ fprintf(stderr,_("Error! %s"),TGKeyXTerm::error);
+ fprintf(stderr,"\r\n");
+ return;
+ }
+ // Ok, if we are here this driver is usable.
+ initialized=1;
+ if (dCB) dCB();
+
+ // Don't need special rights anymore
+ seteuid(getuid());
+ setegid(getgid());
+
+ // Hook the signal generated when the size of the window changes
+ signal(SIGWINCH,sigWindowSizeChanged);
+
+ TDisplayXTerm::Init();
+ Init();
+
+ TGKeyXTerm::Init();
+
+ long aux;
+ if (optSearch("UseShellScreen",aux))
+ useShellScreen=aux;
+
+ // Code page initialization
+ // Look for user settings
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+ // User settings have more priority than detected settings
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : TVCodePage::ISOLatin1Linux,
+ forcedScrCP!=-1 ? forcedScrCP : TVCodePage::ISOLatin1Linux,
+ forcedInpCP!=-1 ? forcedInpCP : TVCodePage::ISOLatin1Linux);
+ SetDefaultCodePages(TVCodePage::ISOLatin1Linux,TVCodePage::ISOLatin1Linux,
+ TVCodePage::ISOLatin1Linux);
+
+ if (terminalType==Eterm)
+ {// Only 8 colors + brightness (8*2+8*2)
+ palette=PAL_LOW;
+ THWMouseXTermFull::Init(THWMouseXTermFull::modeEterm);
+ // Eterm 0.9.x supports palette setting
+ TDisplay::setDisPaletteColors=SetDisPaletteColorsEt;
+ ResetPaletteColors=ResetPaletteColorsEt;
+ setCrtModeRes_p=SetCrtModeEt;
+ if (parseUserPalette())
+ setPaletteColors(0,16,UserStartPalette);
+ }
+ else
+ {// 16+16 colors
+ palette=PAL_HIGH;
+ THWMouseXTermFull::Init(THWMouseXTermFull::modeXTerm);
+ // XTerm from X 4.x supports palette setting
+ TDisplay::setDisPaletteColors=SetDisPaletteColorsXT;
+ ResetPaletteColors=ResetPaletteColorsXT;
+ // XTerm colors are ugly, change them.
+ if (parseUserPalette())
+ setPaletteColors(0,16,UserStartPalette);
+ else
+ SetDisPaletteColorsXT(0,16,ActualPalette);
+ setCrtModeRes_p=SetCrtModeXT;
+ }
+ // This is what GNU/Debian Woody uses by default
+ fontW=6; fontH=13;
+ TScreenXTerm::screenMode=TScreenXTerm::smCO80;
+ LOG((palette==PAL_HIGH ? "Using high palette" : "Using low palette"));
+
+ // G0=ASCII (+LAT1?) G1=Dec. SI
+ // How do I restore the original state?
+ fputs("\E(B\E)0\xF",stdout);
+
+ startupCursor=getCursorType();
+ startupMode =getCrtMode();
+ startScreenWidth =getCols();
+ startScreenHeight=getRows();
+
+ // Look for defaults
+ unsigned maxX=startScreenWidth, maxY=startScreenHeight;
+ unsigned fW=fontW, fH=fontH;
+ if (optSearch("ScreenWidth",aux))
+ maxX=aux;
+ if (optSearch("ScreenHeight",aux))
+ maxY=aux;
+ if (optSearch("FontWidth",aux))
+ fW=aux;
+ if (optSearch("FontHeight",aux))
+ fH=aux;
+ if (maxX!=startScreenWidth || maxY!=startScreenHeight)
+ setCrtModeRes(maxX,maxY,fW,fH);
+
+ cursorLines=getCursorType();
+ screenMode =getCrtMode();
+ screenWidth =getCols();
+ screenHeight=getRows();
+ LOG("Screen size: " << (int)screenWidth << "," << (int)screenHeight);
+ screenBuffer=new ushort[screenWidth * screenHeight];
+ SaveScreen();
+
+ // This is our state, save it
+ tcgetattr(hOut,&outTermiosNew);
+ suspended=0;
+ setCursorType(0);
+}
+
+void TScreenXTerm::Suspend()
+{// Invalidate the knowledge about the current color of the terminal
+ oldCol=oldBack=oldFore=-1;
+ // Restore old font
+ if (fontChanged && oldFontName)
+ fprintf(stdout,"\E]50;%s\x7",oldFontName);
+ // Restore original window size
+ signal(SIGWINCH,SIG_DFL);
+ if (startScreenWidth!=screenWidth || startScreenHeight!=screenHeight)
+ fprintf(stdout,"\E[8;%d;%dt",startScreenHeight+(terminalType==Eterm ? 1 : 0),
+ startScreenWidth);
+ // Restore screen contents
+ RestoreScreen();
+ // Restore the palette, must be before restoring the charset
+ if (paletteModified)
+ ResetPaletteColors();
+ // Restore the cursor shape
+ setCursorType(startupCursor);
+ // That's the default, we don't know the original values
+ fputs("\E(B\E)0\xF",stdout);
+ // Restore cursor position, attributes and charset
+ fputs("\E8",stdout);
+ // Ensure all is processed before leaving
+ fflush(stdout);
+ // Restore console mode, I think drain is better here, but the previous flush
+ // is needed anyways.
+ tcsetattr(hOut,TCSADRAIN,&outTermiosOrig);
+ LOG("TScreenXTerm Suspend");
+}
+
+TScreenXTerm::~TScreenXTerm()
+{
+ // At this point we are not suspended
+ LOG("TScreenXTerm Destructor");
+}
+
+void TScreenXTerm::DeallocateResources()
+{
+ LOG("TScreenXTerm DeallocateResources");
+ if (oldFontName)
+ {
+ DeleteArray(oldFontName);
+ oldFontName=NULL;
+ }
+}
+
+void TScreenXTerm::Resume()
+{
+ // Save console mode
+ tcgetattr(hOut,&outTermiosOrig);
+ // Set our console mode
+ tcsetattr(hOut,TCSAFLUSH,&outTermiosNew);
+ // That's the default
+ fputs("\E(B\E)0\xF",stdout);
+ selCharset=0;
+ // Save cursor position, attributes and charset
+ fputs("\E7",stdout);
+ SaveScreen();
+ // Setup our palette
+ if (paletteModified)
+ SetDisPaletteColorsXT(0,16,ActualPalette);
+ // Check the window size
+ startScreenWidth =getCols();
+ startScreenHeight=getRows();
+ if (startScreenWidth!=screenWidth || startScreenHeight!=screenHeight)
+ fprintf(stdout,"\E[8;%d;%dt",screenHeight+(terminalType==Eterm ? 1 : 0),
+ screenWidth);
+ // Restore our font
+ if (fontChanged)
+ {
+ DeleteArray(oldFontName);
+ oldFontName=GetCurrentFontName();
+ fprintf(stdout,"\E]50;%dx%d\x7",fontW,fontH);
+ }
+ signal(SIGWINCH,sigWindowSizeChanged);
+ // When we set the video mode the cursor is hidded
+ ushort oldCursorLines=cursorLines;
+ // Check for video size change and save some state
+ //setVideoMode(screenMode);
+ // Set our cursor shape
+ setCursorType(oldCursorLines);
+ LOG("TScreenXTerm Resume");
+}
+
+/*****************************************************************************
+ Save/Restore screen
+*****************************************************************************/
+
+void TScreenXTerm::SaveScreen()
+{
+ if (!useShellScreen)
+ // Just switch to the alternative buffer
+ printf("\E[?47h");
+}
+
+void TScreenXTerm::RestoreScreen()
+{
+ if (useShellScreen)
+ // Clear the screen
+ printf("\E[2J");
+ else
+ // Just go back to the normal buffer
+ printf("\E[?47l");
+}
+
+void TScreenXTerm::SaveScreenReleaseMemory(void)
+{
+}
+
+
+void TScreenXTerm::CheckSizeBuffer(int oldWidth, int oldHeight)
+{
+ // allocating a zeroed screenBuffer, because this function
+ // is called in most cases (in RHIDE) after a SIGWINCH
+ if (screenWidth!=oldWidth || screenHeight!=oldHeight || !screenBuffer)
+ {
+ // Realloc screen buffer only if actually needed (it doesn't exist
+ // or screen size is changed)
+ if (screenBuffer)
+ DeleteArray(screenBuffer);
+ screenBuffer=new ushort[screenWidth*screenHeight];
+ }
+ memset(screenBuffer,0,screenWidth*screenHeight*sizeof(ushort));
+}
+
+void TScreenXTerm::SetVideoMode(ushort mode)
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+
+ setCrtMode(mode);
+ defaultSetCrtData();
+ CheckSizeBuffer(oldWidth,oldHeight);
+}
+
+void TScreenXTerm::SetVideoModeExt(char *mode)
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+
+ setCrtModeExt(mode);
+ defaultSetCrtData();
+ CheckSizeBuffer(oldWidth,oldHeight);
+}
+
+void TScreenXTerm::SetCharacter(unsigned offset,ushort value)
+{
+ setCharacters(offset,&value,1);
+}
+
+void TScreenXTerm::SetCharacters(unsigned dst, ushort *src, unsigned len)
+{
+ ushort *old=screenBuffer+dst;
+ ushort *old_right=old+len-1;
+ ushort *src_right=src+len-1;
+
+ /* remove unchanged characters from left to right */
+ if (!force_redraw)
+ {
+ while (len>0 && *old==*src)
+ {
+ dst++;
+ len--;
+ old++;
+ src++;
+ }
+
+ /* remove unchanged characters from right to left */
+ while (len>0 && *old_right==*src_right)
+ {
+ len--;
+ old_right--;
+ src_right--;
+ }
+ }
+
+ /* write only middle changed characters */
+ if (len>0)
+ writeBlock(dst,len,old,src);
+}
+
+
+/*
+ The following tables creates a layout quite similar to what linux calls
+ISO lat 1 fonts. Lamentably looks like Xterm doesn't implement all the
+DEC graphics.
+ Additionally I don't know what happends if X is configured for another
+encoding, does Xterm use it for values between 160 and 254? or it ever
+uses ISO-88590-1?
+
+Which is OK? is just that Xterm have poor fonts? Is Linux extending DEC charset?
+Linux have full block (DEC 48), but Xterm no.
+Linux have all arrows, but Xterm no.
+*/
+
+const uchar TScreenXTerm::Code[256]=
+{
+ '?','=','?','?',96,98,99,100,101,97/*104?*/,97,' '/**/,' '/**/,115/**/,111/**/,' '/**/,
+ ' '/**/,104/*'n'*/,105,121,122,124,'<','>','^','v','>','<','*','*','?',123,
+ 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,123,124,125,126,'Y'/**/,
+ 113,120/**/,113/**/,109,120/**/,120,108,116,113/**/,106,113,118,107,117,119,110,
+ 114,120,113,109,120,120,108,116,113,106,113,118,107,117,119,110, // Most aprox.
+ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+};
+
+const uchar TScreenXTerm::Modifier[256]=
+{
+ 0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,0, // 0- 15
+ 0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1, // 16- 31
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 32- 47
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 48- 63
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 64- 79
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 80- 95
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 96-111
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 112-127
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 128-143
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 144-159
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 160-175
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 176-191
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 192-207
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 208-223
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 224-239
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 // 240-255
+};
+
+/*
+ * Writes a block of text.
+ */
+
+void TScreenXTerm::writeBlock(int dst, int len, ushort *old, ushort *src)
+{
+ int col=-1;
+ uchar val,mod;
+
+ fprintf(stdout,"\E[%d;%dH",dst/TScreenXTerm::screenWidth+1,dst%TScreenXTerm::screenWidth+1);
+
+ while (len-->0)
+ {
+ int code =CLY_Low16(*src);
+ int newcol=CLY_High16(*src);
+
+ *old++=*src++;
+ if (col!=newcol) /* change color ? */
+ {
+ col=newcol;
+ if (palette==PAL_MONO)
+ {
+ if (col==0x0f)
+ fputs("\E[0;1m",stdout); // Bold
+ else
+ if (col==0x70)
+ fputs("\E[0;7m",stdout); // Reverse
+ else
+ fputs("\E[0m",stdout); // Normal
+ }
+ else
+ mapColor(col);
+ }
+ // Convert the value to something in the ISO-Latin-1 range.
+ // Use the DEC graphics for some values in the control range.
+ if (code==12 || code==14)
+ {
+ fputs("\E[7m \E[27m",stdout); // Reversed space
+ }
+ else
+ {
+ val=Code[code];
+ mod=Modifier[code];
+ if (mod!=selCharset)
+ {
+ selCharset=mod;
+ fputc(15-selCharset,stdout);
+ }
+ fputc(val,stdout);
+ }
+ }
+ if (palette==PAL_MONO)
+ fputs("\E[0m",stdout); // Normal
+
+ fprintf(stdout,"\E[%d;%dH",curY+1,curX+1);
+}
+
+/*
+ * Converts colors from the large TV palette (16 foreground colors and
+ * 16 background colors) to ncurses small palette (8 foreground colors
+ * and 8 background colors).
+ */
+
+void TScreenXTerm::mapColor(int col)
+{
+ static char map[] = {0, 4, 2, 6, 1, 5, 3, 7, 0, 4, 2, 6, 1, 5, 3, 7};
+ int back,fore;
+
+ if (col==oldCol)
+ return;
+ oldCol=col;
+ back=(col >> 4) & 15;
+ fore=col & 15;
+
+ if (palette==PAL_LOW)
+ {// Just 8 colors, but use bold and blink getting 16+16
+ if (fore!=oldFore && back!=oldBack)
+ fprintf(stdout,"\E[%d;%d;%d;%dm",
+ fore>7 ? 1 : 22,30+map[fore],
+ back>7 ? 5 : 25,40+map[back]);
+ else
+ {
+ if (fore!=oldFore)
+ fprintf(stdout,"\E[%d;%dm",fore>7 ? 1 : 22,30+map[fore]);
+ else
+ fprintf(stdout,"\E[%d;%dm",back>7 ? 5 : 25,40+map[back]);
+ }
+ }
+ else
+ { // 16 fore and 16 background colors, yuuuhuuu! ;-)
+ if (fore!=oldFore && back!=oldBack)
+ fprintf(stdout,"\E[%d;%dm",map[fore]+(fore>7 ? 90 : 30),
+ map[back]+(back>7 ? 100 : 40));
+ else
+ {
+ if (fore!=oldFore)
+ fprintf(stdout,"\E[%dm",map[fore]+(fore>7 ? 90 : 30));
+ else
+ fprintf(stdout,"\E[%dm",map[back]+(back>7 ? 100 : 40));
+ }
+ }
+
+ oldFore = fore;
+ oldBack = back;
+}
+
+// SET: Call to an external program, optionally forking
+int TScreenXTerm::System(const char *command, pid_t *pidChild, int in,
+ int out, int err)
+{
+ if (!pidChild)
+ {
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+ }
+
+ pid_t cpid=fork();
+ if (cpid==0)
+ {// Ok, we are the child
+ // I'm not sure about it, but is the best I have right now.
+ // Doing it we can kill this child and all the subprocesses
+ // it creates by killing the group. It also have an interesting
+ // effect that I must evaluate: By doing it this process lose
+ // the controlling terminal and won't be able to read/write
+ // to the parents console. I think that's good.
+ if (setsid()==-1)
+ _exit(127);
+ char *argv[4];
+
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+
+ argv[0]=newStr(getenv("SHELL"));
+ if (!argv[0])
+ argv[0]=newStr("/bin/sh");
+ argv[1]=newStr("-c");
+ argv[2]=newStr(command);
+ argv[3]=NULL;
+ execvp(argv[0],argv);
+ delete[] argv[0];
+ delete[] argv[1];
+ delete[] argv[2];
+ // We get here only if exec failed
+ _exit(127);
+ }
+ if (cpid==-1)
+ {// Fork failed do it manually
+ *pidChild=0;
+ return system(command);
+ }
+ *pidChild=cpid;
+ return 0;
+}
+
+#else
+
+#include <tv/unix/xtscreen.h>
+#include <tv/unix/xtkey.h>
+#include <tv/unix/mouse.h>
+#include <tv/unix/xtmouse.h>
+#include <tv/linux/log.h>
+
+#endif // TVOS_UNIX && !TVOSf_QNXRtP
+/*****************************************************************************
+
+ESC ( C Designate G0 Character Set (ISO 2022)
+ C = 0 -> DEC Special Character and Line Drawing Set
+ C = A -> United Kingdom (UK)
+ C = B -> United States (USASCII)
+ESC ) C Designate G1 Character Set (ISO 2022)
+ C = 0 -> DEC Special Character and Line Drawing Set
+ C = A -> United Kingdom (UK)
+ C = B -> United States (USASCII)
+ESC 7 Save Cursor (DECSC)
+ESC 8 Restore Cursor (DECRC)
+ESC > Normal Keypad (DECPNM)
+SO Shift Out (Ctrl-N) -> Switch to Alternate Character Set:
+ invokes the G1 character set.
+SI Shift In (Ctrl-O) -> Switch to Standard Character Set:
+ invokes the G0 character set (the default).
+ESC [ Ps ; Ps H Cursor Position [row;column] (default = [1,1]) (CUP)
+ESC [ Ps J Erase in Display (ED)
+ Ps = 0 -> Clear Below (default)
+ Ps = 1 -> Clear Above
+ Ps = 2 -> Clear All
+ESC [ Ps n Device Status Report (DSR)
+ Ps = 5 -> Status Report ESC [ 0 n (``OK'')
+ Ps = 6 -> Report Cursor Position (CPR) [row;column] as ESC
+ [ r ; c R
+ESC [ ? Pm h DEC Private Mode Set (DECSET)
+ ******* Lo siguiente restaura la pantalla al salir!!! *******
+ Ps = 4 7 -> Use Alternate Screen Buffer (unless disabled
+ by the titeInhibit resource)
+ Ps = 1 0 0 0 -> Send Mouse X & Y on button press and
+ release. See the section Mouse Tracking.
+ Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking.
+ ****** Esto lo soporta la del X 3 y reporta el movimiento del mouse!!!! ***
+ Ps = 1 0 0 3 -> Use All Motion Mouse Tracking.
+ ****** Probar esto, ¿hará que reporte un modificador para Alt?
+ Ps = 1 0 3 5 -> Enable special modifiers for Alt and
+ NumLock keys.
+ ****** Suena interesante, el de X 3 parece que no lo tiene
+ Ps = 1 0 3 6 -> Send ESC when Meta modifies a key
+ (enables the metaSendsEscape resource).
+ ****** Este es aún mejor que el 47, pero no sirve en Eterm
+ Ps = 1 0 4 9 -> Save cursor as in DECSC and use Alter­
+ nate Screen Buffer, clearing it first (unless disabled by
+ the titeInhibit resource)
+ ****** Alguno podrían ayudar
+ Ps = 1 0 5 1 -> Set Sun function-key mode.
+ Ps = 1 0 5 2 -> Set HP function-key mode.
+ Ps = 1 0 6 0 -> Set legacy keyboard emulation (X11R6).
+ Ps = 1 0 6 1 -> Set Sun/PC keyboard emulation of VT220
+ keyboard.
+ESC [ ? Pm l DEC Private Mode Reset (DECRST)
+ Ps = 4 7 -> Use Normal Screen Buffer
+ Ps = 1 0 0 0 -> Don't Send Mouse X & Y on button press and
+ release
+ESC [ ? Pm r Restore DEC Private Mode Values. The value of Ps previously
+ saved is restored. Ps values are the same as for DECSET.
+ESC [ ? Pm s Save DEC Private Mode Values. Ps values are the same as for
+ DECSET.
+ESC ] Ps ; Pt BEL
+ Set Text Parameters
+ Ps = 0 -> Change Icon Name and Window Title to Pt
+ Ps = 1 -> Change Icon Name to Pt
+ Ps = 2 -> Change Window Title to Pt
+ Ps = 4 6 -> Change Log File to Pt (normally disabled by a
+ compile-time option)
+ Ps = 5 0 -> Set Font to Pt
+****** La Xterm que probé soporta 16 fondos y 16 p.planos. Para restaurar los colores
+al salir hay que elegir con 39;49, ojo, Eterm 0.8 soporta sólo 8+8
+CSI Pm m Character Attributes (SGR)
+ Ps = 0 -> Normal (default)
+ Ps = 1 -> Bold
+ Ps = 4 -> Underlined
+ Ps = 5 -> Blink (appears as Bold)
+ Ps = 7 -> Inverse
+ Ps = 8 -> Invisible (hidden)
+ Ps = 2 2 -> Normal (neither bold nor faint)
+ Ps = 2 4 -> Not underlined
+ Ps = 2 5 -> Steady (not blinking)
+ Ps = 2 7 -> Positive (not inverse)
+ Ps = 2 8 -> Visible (not hidden)
+ Ps = 3 0 -> Set foreground color to Black
+ Ps = 3 1 -> Set foreground color to Red
+ Ps = 3 2 -> Set foreground color to Green
+ Ps = 3 3 -> Set foreground color to Yellow
+ Ps = 3 4 -> Set foreground color to Blue
+ Ps = 3 5 -> Set foreground color to Magenta
+ Ps = 3 6 -> Set foreground color to Cyan
+ Ps = 3 7 -> Set foreground color to White
+
+ Ps = 3 9 -> Set foreground color to default (original)
+
+ Ps = 4 0 -> Set background color to Black
+ Ps = 4 1 -> Set background color to Red
+ Ps = 4 2 -> Set background color to Green
+ Ps = 4 3 -> Set background color to Yellow
+ Ps = 4 4 -> Set background color to Blue
+ Ps = 4 5 -> Set background color to Magenta
+ Ps = 4 6 -> Set background color to Cyan
+ Ps = 4 7 -> Set background color to White
+
+ Ps = 4 9 -> Set background color to default (original).
+
+ If 16-color support is compiled, the following apply.
+ Assume that xterm's resources are set so that the ISO
+ color codes are the first 8 of a set of 16. Then the
+ aixterm colors are the bright versions of the ISO colors:
+ Ps = 9 0 -> Set foreground color to Black
+ Ps = 9 1 -> Set foreground color to Red
+ Ps = 9 2 -> Set foreground color to Green
+ Ps = 9 3 -> Set foreground color to Yellow
+ Ps = 9 4 -> Set foreground color to Blue
+ Ps = 9 5 -> Set foreground color to Magenta
+ Ps = 9 6 -> Set foreground color to Cyan
+ Ps = 9 7 -> Set foreground color to White
+
+ Ps = 1 0 0 -> Set background color to Black
+ Ps = 1 0 1 -> Set background color to Red
+ Ps = 1 0 2 -> Set background color to Green
+ Ps = 1 0 3 -> Set background color to Yellow
+ Ps = 1 0 4 -> Set background color to Blue
+ Ps = 1 0 5 -> Set background color to Magenta
+ Ps = 1 0 6 -> Set background color to Cyan
+ Ps = 1 0 7 -> Set background color to White
+
+ If xterm is compiled with the 16-color support disabled,
+ it supports the following, from rxvt:
+ Ps = 1 0 0 -> Set foreground and background color to
+ default
+
+ If 88- or 256-color support is compiled, the following
+ apply.
+ Ps = 3 8 ; 5 ; Ps -> Set foreground color to the second Ps
+ Ps = 4 8 ; 5 ; Ps -> Set background color to the second Ps
+
+**** ¿Será necesario?
+CSI Ps ; Ps " p
+ Set conformance level (DECSCL) Valid values for the first
+ parameter:
+ Ps = 6 1 -> VT100
+ Ps = 6 2 -> VT200
+ Ps = 6 3 -> VT300
+ Valid values for the second parameter:
+ Ps = 0 -> 8-bit controls
+ Ps = 1 -> 7-bit controls (always set for VT100)
+ Ps = 2 -> 8-bit controls
+
+CSI Ps ; Ps ; Ps t
+ Window manipulation (from dtterm, as well as extensions).
+ Valid values for the first (and any additional parame­
+ ters) are:
+ **** Estas dos son mortales:
+ Ps = 1 -> De-iconify window.
+ Ps = 2 -> Iconify window.
+ Ps = 3 ; x ; y -> Move window to [x, y].
+ Ps = 4 ; height ; width -> Resize the xterm window to height and width in pixels.
+ Ps = 5 -> Raise the xterm window to the front of the stacking order.
+ Ps = 6 -> Lower the xterm window to the bottom of the stacking order.
+ Ps = 7 -> Refresh the xterm window.
+ **** Esta permitiría cosas muy buenas!!!
+ Ps = 8 ; height ; width -> Resize the text area to [height;width] in characters.
+ Ps = 9 ; 0 -> Restore maximized window.
+ Ps = 9 ; 1 -> Maximize window (i.e., resize to screen size).
+ Ps = 1 1 -> Report xterm window state. If the xterm
+ window is open (non-iconified), it returns CSI 1 t . If
+ the xterm window is iconified, it returns CSI 2 t .
+ Ps = 1 3 -> Report xterm window position as CSI 3 ; x; yt
+ Ps = 1 4 -> Report xterm window in pixels as CSI 4 ; height ; width t
+ ***** Esta es una alternativa para el tamaño de la ventana
+ Ps = 1 8 -> Report the size of the text area in characters as CSI 8 ; height ; width t
+ Ps = 1 9 -> Report the size of the screen in characters as CSI 9 ; height ; width t
+ Ps = 2 0 -> Report xterm window's icon label as OSC L label ST
+ ***** Esto implementa el getWindowTitle
+ Ps = 2 1 -> Report xterm window's title as OSC l title ST
+ Ps >= 2 4 -> Resize to Ps lines (DECSLPP)
+
+**** Este parece interesante, pero no lo pude hacer andar
+CSI Ps ; Pu ´ z
+ Enable Locator Reporting (DECELR)
+ Valid values for the first parameter:
+ Ps = 0 -> Locator disabled (default)
+ Ps = 1 -> Locator enabled
+ Ps = 2 -> Locator enabled for one report, then dis­
+ abled
+ The second parameter specifies the coordinate unit for
+ locator reports.
+ Valid values for the second parameter:
+ Pu = 0 or omitted -> default to character cells
+ Pu = 1 -> device physical pixels
+ Pu = 2 -> character cells
+CSI Pm ´ { Select Locator Events (DECSLE)
+ Valid values for the first (and any additional parame­
+ ters) are:
+ Ps = 0 -> only respond to explicit host requests
+ (DECRQLP)
+ (default) also cancels any filter rectangle
+ Ps = 1 -> report button down transitions
+ Ps = 2 -> do not report button down transitions
+ Ps = 3 -> report button up transitions
+ Ps = 4 -> do not report button up transitions
+CSI Ps ´ | Request Locator Position (DECRQLP)
+ Valid values for the parameter are:
+ Ps = 0 , 1 or omitted -> transmit a single DECLRP loca­
+ tor report
+
+ If Locator Reporting has been enabled by a DECELR, xterm
+ will respond with a DECLRP Locator Report. This report
+ is also generated on button up and down events if they
+ have been enabled with a DECSLE, or when the locator is
+ detected outside of a filter rectangle, if filter rectan­
+ gles have been enabled with a DECEFR.
+
+ -> CSI Pe ; Pb ; Pr ; Pc ; Pp & w
+
+ Parameters are [event;button;row;column;page].
+ Valid values for the event:
+ Pe = 0 -> locator unavailable - no other parameters
+ sent
+ Pe = 1 -> request - xterm received a DECRQLP
+ Pe = 2 -> left button down
+ Pe = 3 -> left button up
+ Pe = 4 -> middle button down
+ Pe = 5 -> middle button up
+ Pe = 6 -> right button down
+ Pe = 7 -> right button up
+ Pe = 8 -> M4 button down
+ Pe = 9 -> M4 button up
+ Pe = 1 0 -> locator outside filter rectangle
+ ``button'' parameter is a bitmask indicating which but­
+ tons are pressed:
+ Pb = 0 -> no buttons down
+ Pb & 1 -> right button down
+ Pb & 2 -> middle button down
+ Pb & 4 -> left button down
+ Pb & 8 -> M4 button down
+ ``row'' and ``column'' parameters are the coordinates of
+ the locator position in the xterm window, encoded as
+ ASCII decimal.
+ The ``page'' parameter is not used by xterm, and will be
+ omitted.
+
+
+**** Esto lo estoy usando para la paleta
+OSC Ps ; Pt BEL
+ Set Text Parameters. For colors and font, if Pt is a
+ "?", the control sequence elicits a response which con­
+ sists of the control sequence which would set the corre­
+ sponding value. The dtterm control sequences allow you
+ to determine the icon name and window title.
+ Ps = 0 -> Change Icon Name and Window Title to Pt
+ Ps = 1 -> Change Icon Name to Pt
+ Ps = 2 -> Change Window Title to Pt
+ Ps = 3 -> Set X property on top-level window. Pt
+ should be in the form "prop=value", or just "prop" to
+ delete the property
+ Ps = 4 ; c ; name -> Change Color #c to cname. Any
+ number of c name pairs may be given.
+ Ps = 1 0 -> Change color names starting with text
+ foreground to Pt (a list of one or more color names or
+ RGB specifications, separated by semicolon, up to eight,
+ as per XParseColor).
+ Ps = 1 1 -> Change colors starting with text back­
+ ground to Pt
+ Ps = 1 2 -> Change colors starting with text cursor to
+ Pt
+ Ps = 1 3 -> Change colors starting with mouse fore­
+ ground to Pt
+ Ps = 1 4 -> Change colors starting with mouse back­
+ ground to Pt
+ Ps = 1 5 -> Change colors starting with Tek foreground
+ to Pt
+ Ps = 1 6 -> Change colors starting with Tek background
+ to Pt
+ Ps = 1 7 -> Change colors starting with highlight to
+ Pt
+ Ps = 4 6 -> Change Log File to Pt (normally disabled
+ by a compile-time option)
+ Ps = 5 0 -> Set Font to Pt If Pt begins with a "#",
+ index in the font menu, relative (if the next character
+ is a plus or minus sign) or absolute. A number is
+ expected but not required after the sign (the default is
+ the current entry for relative, zero for absolute index­
+ ing).
+
+*****************************************************************************/
diff --git a/tvision/classes/win32/win32clip.cc b/tvision/classes/win32/win32clip.cc
new file mode 100644
index 0000000..0ceb52c
--- /dev/null
+++ b/tvision/classes/win32/win32clip.cc
@@ -0,0 +1,144 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Based on code contributed by Anatoli Soltan.
+
+ Description:
+ Win32 Clipboard routines.
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_string
+#define Uses_TVOSClipboard
+#include <tv.h>
+#include <tv/win32/win32clip.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOS_Win32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+// Strings for the errors
+const char *TVWin32Clipboard::win32NameError[]=
+{
+ NULL,
+ NULL
+};
+
+void TVWin32Clipboard::Init()
+{
+ TVOSClipboard::copy=copy;
+ TVOSClipboard::paste=paste;
+ TVOSClipboard::destroy=destroy;
+ TVOSClipboard::available=1; // We have 1 clipboard
+ TVOSClipboard::name="Windows";
+ // We get the error from windows, so we just change the pointer
+ TVOSClipboard::errors=1;
+ TVOSClipboard::nameErrors=win32NameError;
+}
+
+void TVWin32Clipboard::getErrorString()
+{
+ if (win32NameError[1])
+ LocalFree((LPVOID)win32NameError[1]);
+
+ LPVOID lpMsgBuf;
+
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL,GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR)&lpMsgBuf,0,NULL);
+ win32NameError[1]=(const char *)lpMsgBuf;
+ TVOSClipboard::error=1;
+}
+
+void TVWin32Clipboard::destroy()
+{
+ if (win32NameError[1])
+ LocalFree((LPVOID)win32NameError[1]);
+}
+
+char *TVWin32Clipboard::paste(int id, unsigned &len)
+{
+ if (id!=0) return NULL;
+
+ char* p=NULL;
+ HGLOBAL hMem;
+
+ if (OpenClipboard(NULL))
+ {
+ hMem=GetClipboardData(CF_TEXT);
+ if (hMem)
+ {
+ char *d=(char*)GlobalLock(hMem);
+ if (d)
+ {
+ len=GlobalSize(hMem)-1;
+ p=new char[len+1];
+ memcpy(p,d,len);
+ p[len]=0;
+ // The returned length doesn't have to be the exact length of the string.
+ // Reported by Warren H. Holt
+ len=strlen(p);
+ GlobalUnlock(hMem);
+ }
+ else
+ getErrorString();
+ }
+ else
+ getErrorString();
+ CloseClipboard();
+ }
+ else
+ getErrorString();
+
+ return p;
+}
+
+int TVWin32Clipboard::copy(int id, const char *buffer, unsigned len)
+{
+ if (id!=0) return 0;
+ if (!len || !buffer) return 1;
+
+ HGLOBAL hMem=GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,len+1);
+ if (!hMem)
+ {
+ getErrorString();
+ return 0;
+ }
+
+ char *d=(char *)GlobalLock(hMem);
+ if (!d)
+ {
+ getErrorString();
+ GlobalFree(hMem);
+ return 0;
+ }
+ memcpy(d,buffer,len);
+ d[len]=0;
+ GlobalUnlock(hMem);
+
+ if (OpenClipboard(NULL))
+ {
+ EmptyClipboard();
+ if (SetClipboardData(CF_TEXT,hMem))
+ {
+ CloseClipboard();
+ // Windows now owns the memory, we doesn't have to release it.
+ return 1;
+ }
+ getErrorString();
+ CloseClipboard();
+ }
+ else
+ getErrorString();
+ GlobalFree(hMem);
+
+ return 0;
+}
+
+#endif // TVOS_Win32
+
diff --git a/tvision/classes/win32/win32dis.cc b/tvision/classes/win32/win32dis.cc
new file mode 100644
index 0000000..f0cb2cd
--- /dev/null
+++ b/tvision/classes/win32/win32dis.cc
@@ -0,0 +1,226 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Based on code contributed by Vadim Beloborodov.
+
+ Description:
+ Win32 Display routines.
+ The original implementation was done by Vadim, I removed some code, added
+some routines and adapted it to the new architecture.
+ One important detail is that Vadim implemented it with threads. The
+thread that monitors the window size is different, that's why a lock is
+needed.
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_TDisplay
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOS_Win32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/win32/screen.h>
+
+const int mxTitleSize=256;
+
+HANDLE TDisplayWin32::hOut=INVALID_HANDLE_VALUE;
+HANDLE TDisplayWin32::hIn =INVALID_HANDLE_VALUE;
+HANDLE TDisplayWin32::hStdOut=INVALID_HANDLE_VALUE;
+CONSOLE_SCREEN_BUFFER_INFO TDisplayWin32::ConsoleInfo;
+CONSOLE_CURSOR_INFO TDisplayWin32::ConsoleCursorInfo;
+CRITICAL_SECTION TDisplayWin32::lockWindowSizeChanged;
+int TDisplayWin32::WindowSizeChanged=0;
+
+void TDisplayWin32::SetCursorPos(unsigned x, unsigned y)
+{
+ COORD pos;
+ pos.X=x;
+ pos.Y=y;
+ SetConsoleCursorPosition(hOut,pos);
+}
+
+void TDisplayWin32::GetCursorPos(unsigned &x, unsigned &y)
+{
+ GetConsoleScreenBufferInfo(hOut,&ConsoleInfo);
+ x=ConsoleInfo.dwCursorPosition.X;
+ y=ConsoleInfo.dwCursorPosition.Y;
+}
+
+// by SET
+void TDisplayWin32::GetCursorShape(unsigned &start, unsigned &end)
+{
+ GetConsoleCursorInfo(hOut,&ConsoleCursorInfo);
+ if (ConsoleCursorInfo.bVisible)
+ {// Visible
+ // Win32API returns a "percent filled" value.
+ start=100-ConsoleCursorInfo.dwSize;
+ // Ever upto the end
+ end =100;
+ return;
+ }
+ // Invisible cursor
+ start=end=0;
+}
+
+// by SET
+void TDisplayWin32::SetCursorShape(unsigned start, unsigned end)
+{
+ if (start>=end && getShowCursorEver())
+ return;
+
+ GetConsoleCursorInfo(hOut,&ConsoleCursorInfo);
+ if (start>=end)
+ ConsoleCursorInfo.bVisible=FALSE;
+ else
+ {
+ ConsoleCursorInfo.bVisible=TRUE;
+ ConsoleCursorInfo.dwSize=end-start;
+ if (ConsoleCursorInfo.dwSize>=100)
+ ConsoleCursorInfo.dwSize=99;
+ }
+ SetConsoleCursorInfo(hOut,&ConsoleCursorInfo);
+}
+
+ushort TDisplayWin32::GetRows()
+{
+#if 0
+ ushort Rows=ConsoleInfo.srWindow.Bottom-ConsoleInfo.srWindow.Top+1;
+ if (Rows>ConsoleInfo.dwMaximumWindowSize.Y)
+ Rows=ConsoleInfo.dwMaximumWindowSize.Y;
+ return Rows;
+#else
+ return ConsoleInfo.dwSize.Y;
+#endif
+}
+
+ushort TDisplayWin32::GetCols()
+{
+#if 0
+ ushort Cols=ConsoleInfo.srWindow.Right-ConsoleInfo.srWindow.Left+1;
+ if (Cols>ConsoleInfo.dwMaximumWindowSize.X)
+ Cols=ConsoleInfo.dwMaximumWindowSize.X;
+ return Cols;
+#else
+ return ConsoleInfo.dwSize.X;
+#endif
+}
+
+int TDisplayWin32::CheckForWindowSize(void)
+{
+ int SizeChanged=WindowSizeChanged;
+ EnterCriticalSection(&lockWindowSizeChanged);
+ WindowSizeChanged=0;
+ LeaveCriticalSection(&lockWindowSizeChanged);
+ if (SizeChanged)
+ GetConsoleScreenBufferInfo(hOut,&ConsoleInfo);
+
+ return SizeChanged;
+}
+
+void TDisplayWin32::SetCrtMode(ushort)
+{
+ SetCursorShape(0x58,0x64);
+}
+
+void TDisplayWin32::SetCrtModeExt(char *)
+{
+ SetCursorShape(0x58,0x64);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the main window title.
+
+ Return:
+ A pointer to a newly allocated string (new[]). Or 0 if fail. by SET.
+
+***************************************************************************/
+
+const char *TDisplayWin32::GetWindowTitle(void)
+{
+ char buf[mxTitleSize];
+ DWORD ret=GetConsoleTitle(buf,mxTitleSize);
+ if (ret)
+ {
+ char *s=new char[ret+1];
+ memcpy(s,buf,ret);
+ s[ret]=0;
+ return s;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the main window title.
+
+ Return:
+ non-zero successful. by SET.
+
+***************************************************************************/
+
+int TDisplayWin32::SetWindowTitle(const char *name)
+{
+ return SetConsoleTitle(name);
+}
+
+void TDisplayWin32::Beep()
+{
+ MessageBeep(0xFFFFFFFF);
+}
+
+TDisplayWin32::~TDisplayWin32() {}
+
+void TDisplayWin32::Init()
+{
+ setCursorPos=SetCursorPos;
+ getCursorPos=GetCursorPos;
+ getCursorShape=GetCursorShape;
+ setCursorShape=SetCursorShape;
+ getRows=GetRows;
+ getCols=GetCols;
+ checkForWindowSize=CheckForWindowSize;
+ setWindowTitle=SetWindowTitle;
+ getWindowTitle=GetWindowTitle;
+ setCrtMode=SetCrtMode;
+ setCrtModeExt=SetCrtModeExt;
+ beep=Beep;
+}
+
+/* Not implemented
+void TDisplay::setCrtMode(ushort )
+{
+ GetConsoleScreenBufferInfo(hOut, &ConsoleInfo);
+ EnterCriticalSection( &lockWindowSizeChanged );
+ LeaveCriticalSection( &lockWindowSizeChanged );
+}
+
+void TDisplay::setCrtMode(char * )
+{
+ GetConsoleScreenBufferInfo(hOut, &ConsoleInfo);
+ EnterCriticalSection( &lockWindowSizeChanged );
+ LeaveCriticalSection( &lockWindowSizeChanged );
+}
+
+ushort TDisplay::getCrtMode()
+{
+ GetConsoleScreenBufferInfo(hOut, &ConsoleInfo);
+ return smCO80;
+}
+*/
+
+#else // TVOS_Win32
+
+#include <tv/win32/screen.h>
+
+#endif // else TVOS_Win32
+
diff --git a/tvision/classes/win32/win32key.cc b/tvision/classes/win32/win32key.cc
new file mode 100644
index 0000000..f467d70
--- /dev/null
+++ b/tvision/classes/win32/win32key.cc
@@ -0,0 +1,464 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ It said:
+ Keyboard handler for Win32 by Vadim Beloborodov
+ Based on code by Salvador E. Tropea (SET) (c) (1998)
+
+ Description:
+ Win32 Keyboard routines.
+ The original implementation was done by Vadim, I removed some code, added
+some routines and adapted it to the new architecture.
+ One important detail is that Vadim implemented it with threads. So we have
+here an events handler with a queue.
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_string
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_ctype
+#define Uses_TDisplay
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOS_Win32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/win32/screen.h>
+#include <tv/win32/key.h>
+
+KeyDownEvent *TGKeyWin32::evKeyboardIn;
+KeyDownEvent *TGKeyWin32::evKeyboardOut;
+KeyDownEvent TGKeyWin32::evKeyboardQueue[eventKeyboardQSize];
+unsigned TGKeyWin32::evKeyboardLength;
+CRITICAL_SECTION TGKeyWin32::lockKeyboard;
+ushort TGKeyWin32::LastControlKeyState=0;
+
+void TGKeyWin32::Init()
+{
+ TGKey::kbhit=KbHit;
+ TGKey::getShiftState=GetShiftState;
+ TGKey::fillTEvent=FillTEvent;
+
+ InitializeCriticalSection(&lockKeyboard);
+ evKeyboardLength=0;
+ evKeyboardIn=evKeyboardOut=&evKeyboardQueue[0];
+}
+
+void TGKeyWin32::DeInit()
+{
+ DeleteCriticalSection(&lockKeyboard);
+}
+
+int TGKeyWin32::KbHit(void)
+{
+ return evKeyboardLength>0;
+}
+
+void TGKeyWin32::FillTEvent(TEvent &e)
+{
+ getConsoleKeyboardEvent(e.keyDown);
+ e.what=evKeyDown;
+}
+
+ushort TGKeyWin32::transShiftState(DWORD state)
+{
+ ushort tvstate=0;
+ if (state & (RIGHT_ALT_PRESSED |LEFT_ALT_PRESSED) ) tvstate|=kbAltShift;
+ if (state & (RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED)) tvstate|=kbCtrlShift;
+ if (state & SHIFT_PRESSED) tvstate|=kbLeftShift;
+ if (state & NUMLOCK_ON ) tvstate|=kbNumState;
+ if (state & SCROLLLOCK_ON) tvstate|=kbScrollState;
+ if (state & CAPSLOCK_ON ) tvstate|=kbCapsState;
+
+ return tvstate;
+}
+
+/*
+ Translate keyboard events to Salvador E. Tropea's key codes
+ by Vadim Beloborodov
+ Originally in trans.cc
+*/
+
+const char TGKeyWin32::KeyTo[256]=
+{
+ /* 00 */ 0,
+ /* 01 VK_LBUTTON */ 0,
+ /* 02 VK_RBUTTON */ 0,
+ /* 03 VK_CANCEL */ 0,
+ /* 04 VK_MBUTTON */ 0,
+ /* 05 unassigned */ 0,
+ /* 06 unassigned */ 0,
+ /* 07 unassigned */ 0,
+ /* 08 VK_BACK */ kbBackSpace,
+ /* 09 VK_TAB */ kbTab,
+ /* 0A unassigned */ 0,
+ /* 0B unassigned */ 0,
+ /* 0C VK_CLEAR ?? */ 0,
+ /* 0D VK_RETURN */ kbEnter,
+ /* 0E unassigned */ 0,
+ /* 0F unassigned */ 0,
+ /* 10 VK_SHIFT */ 0,
+ /* 11 VK_CONTROL */ 0,
+ /* 12 VK_MENU */ 0,
+ /* 13 VK_PAUSE */ 0,
+ /* 14 VK_CAPITAL */ 0,
+ /* 15 Kanji systems*/ 0,
+ /* 16 Kanji systems*/ 0,
+ /* 17 Kanji systems*/ 0,
+ /* 18 Kanji systems*/ 0,
+ /* 19 Kanji systems*/ 0,
+ /* 1A unassigned */ 0,
+ /* 1B VK_ESCAPE */ kbEsc,
+ /* 1C Kanji systems*/ 0,
+ /* 1D Kanji systems*/ 0,
+ /* 1E Kanji systems*/ 0,
+ /* 1F Kanji systems*/ 0,
+ /* 20 VK_SPACE */ kbSpace,
+ /* 21 VK_PRIOR */ kbPgUp,
+ /* 22 VK_NEXT */ kbPgDn,
+ /* 23 VK_END */ kbEnd,
+ /* 24 VK_HOME */ kbHome,
+ /* 25 VK_LEFT */ kbLeft,
+ /* 26 VK_UP */ kbUp,
+ /* 27 VK_RIGHT */ kbRight,
+ /* 28 VK_DOWN */ kbDown,
+ /* 29 VK_SELECT */ 0,
+ /* 2A OEM specific */ 0,
+ /* 2B VK_EXECUTE */ 0,
+ /* 2C VK_SNAPSHOT */ 0,
+ /* 2D VK_INSERT */ kbInsert,
+ /* 2E VK_DELETE */ kbDelete,
+ /* 2F VK_HELP */ 0,
+ /* 30 VK_0 '0' */ kb0,
+ /* 31 VK_1 '1' */ kb1,
+ /* 32 VK_2 '2' */ kb2,
+ /* 33 VK_3 '3' */ kb3,
+ /* 34 VK_4 '4' */ kb4,
+ /* 35 VK_5 '5' */ kb5,
+ /* 36 VK_6 '6' */ kb6,
+ /* 37 VK_7 '7' */ kb7,
+ /* 38 VK_8 '8' */ kb8,
+ /* 39 VK_9 '9' */ kb9,
+ /* 3A unassigned */ 0,
+ /* 3B unassigned */ 0,
+ /* 3C unassigned */ 0,
+ /* 3D unassigned */ 0,
+ /* 3E unassigned */ 0,
+ /* 3F unassigned */ 0,
+ /* 40 unassigned */ 0,
+ /* 41 VK_A 'A' */ kbA,
+ /* 42 VK_B 'B' */ kbB,
+ /* 43 VK_C 'C' */ kbC,
+ /* 44 VK_D 'D' */ kbD,
+ /* 45 VK_E 'E' */ kbE,
+ /* 46 VK_F 'F' */ kbF,
+ /* 47 VK_G 'G' */ kbG,
+ /* 48 VK_H 'H' */ kbH,
+ /* 49 VK_I 'I' */ kbI,
+ /* 4A VK_J 'J' */ kbJ,
+ /* 4B VK_K 'K' */ kbK,
+ /* 4C VK_L 'L' */ kbL,
+ /* 4D VK_M 'M' */ kbM,
+ /* 4E VK_N 'N' */ kbN,
+ /* 4F VK_O 'O' */ kbO,
+ /* 50 VK_P 'P' */ kbP,
+ /* 51 VK_Q 'Q' */ kbQ,
+ /* 52 VK_R 'R' */ kbR,
+ /* 53 VK_S 'S' */ kbS,
+ /* 54 VK_T 'T' */ kbT,
+ /* 55 VK_U 'U' */ kbU,
+ /* 56 VK_V 'V' */ kbV,
+ /* 57 VK_W 'W' */ kbW,
+ /* 58 VK_X 'X' */ kbX,
+ /* 59 VK_Y 'Y' */ kbY,
+ /* 5A VK_Z 'Z' */ kbZ,
+ /* 5B unassigned */ 0,
+ /* 5C unassigned */ 0,
+ /* 5D unassigned */ 0,
+ /* 5E unassigned */ 0,
+ /* 5F unassigned */ 0,
+ /* 60 VK_NUMPAD0 NumKeyPad '0' */ kb0,
+ /* 61 VK_NUMPAD1 NumKeyPad '1' */ kb1,
+ /* 62 VK_NUMPAD2 NumKeyPad '2' */ kb2,
+ /* 63 VK_NUMPAD3 NumKeyPad '3' */ kb3,
+ /* 64 VK_NUMPAD4 NumKeyPad '4' */ kb4,
+ /* 65 VK_NUMPAD5 NumKeyPad '5' */ kb5,
+ /* 66 VK_NUMPAD6 NumKeyPad '6' */ kb6,
+ /* 67 VK_NUMPAD7 NumKeyPad '7' */ kb7,
+ /* 68 VK_NUMPAD8 NumKeyPad '8' */ kb8,
+ /* 69 VK_NUMPAD9 NumKeyPad '9' */ kb9,
+ /* 6A VK_MULTIPLY */ kbAsterisk,
+ /* 6B VK_ADD */ kbPlus,
+ /* 6C VK_SEPARATOR */ kbBackSlash,
+ /* 6D VK_SUBSTRACT */ kbMinus,
+ /* 6E VK_DECIMAL */ kbGrave,
+ /* 6F VK_DIVIDE */ kbSlash,
+ /* 70 VK_F1 'F1' */ kbF1,
+ /* 71 VK_F2 'F2' */ kbF2,
+ /* 72 VK_F3 'F3' */ kbF3,
+ /* 73 VK_F4 'F4' */ kbF4,
+ /* 74 VK_F5 'F5' */ kbF5,
+ /* 75 VK_F6 'F6' */ kbF6,
+ /* 76 VK_F7 'F7' */ kbF7,
+ /* 77 VK_F8 'F8' */ kbF8,
+ /* 78 VK_F9 'F9' */ kbF9,
+ /* 79 VK_F10 'F10' */ kbF10,
+ /* 7A VK_F11 'F11' */ kbF11,
+ /* 7B VK_F12 'F12' */ kbF12,
+ /* 7C VK_F13 */ 0,
+ /* 7D VK_F14 */ 0,
+ /* 7E VK_F15 */ 0,
+ /* 7F VK_F16 */ 0,
+ /* 80 VK_F17 */ 0,
+ /* 81 VK_F18 */ 0,
+ /* 82 VK_F19 */ 0,
+ /* 83 VK_F20 */ 0,
+ /* 84 VK_F21 */ 0,
+ /* 85 VK_F22 */ 0,
+ /* 86 VK_F23 */ 0,
+ /* 87 VK_F24 */ 0,
+ /* 88 unassigned */ 0,
+ /* 89 VK_NUMLOCK */ 0,
+ /* 8A VK_SCROLL */ 0,
+ /* 8B unassigned */ 0,
+ /* 8C unassigned */ 0,
+ /* 8D unassigned */ 0,
+ /* 8E unassigned */ 0,
+ /* 8F unassigned */ 0,
+ /* 90 unassigned */ 0,
+ /* 91 unassigned */ 0,
+ /* 92 unassigned */ 0,
+ /* 93 unassigned */ 0,
+ /* 94 unassigned */ 0,
+ /* 95 unassigned */ 0,
+ /* 96 unassigned */ 0,
+ /* 97 unassigned */ 0,
+ /* 98 unassigned */ 0,
+ /* 99 unassigned */ 0,
+ /* 9A unassigned */ 0,
+ /* 9B unassigned */ 0,
+ /* 9C unassigned */ 0,
+ /* 9D unassigned */ 0,
+ /* 9E unassigned */ 0,
+ /* 9F unassigned */ 0,
+ /* A0 unassigned */ 0,
+ /* A1 unassigned */ 0,
+ /* A2 unassigned */ 0,
+ /* A3 unassigned */ 0,
+ /* A4 unassigned */ 0,
+ /* A5 unassigned */ 0,
+ /* A6 unassigned */ 0,
+ /* A7 unassigned */ 0,
+ /* A8 unassigned */ 0,
+ /* A9 unassigned */ 0,
+ /* AA unassigned */ 0,
+ /* AB unassigned */ 0,
+ /* AC unassigned */ 0,
+ /* AD unassigned */ 0,
+ /* AE unassigned */ 0,
+ /* AF unassigned */ 0,
+ /* B0 unassigned */ 0,
+ /* B1 unassigned */ 0,
+ /* B2 unassigned */ 0,
+ /* B3 unassigned */ 0,
+ /* B4 unassigned */ 0,
+ /* B5 unassigned */ 0,
+ /* B6 unassigned */ 0,
+ /* B7 unassigned */ 0,
+ /* B8 unassigned */ 0,
+ /* B9 unassigned */ 0,
+ /* BA OEM specific */ 0,
+ /* BB OEM specific */ 0,
+ /* BC OEM specific */ 0,
+ /* BD OEM specific */ 0,
+ /* BE OEM specific */ 0,
+ /* BF OEM specific */ 0,
+ /* C0 OEM specific */ 0,
+ /* C1 unassigned */ 0,
+ /* C2 unassigned */ 0,
+ /* C3 unassigned */ 0,
+ /* C4 unassigned */ 0,
+ /* C5 unassigned */ 0,
+ /* C6 unassigned */ 0,
+ /* C7 unassigned */ 0,
+ /* C8 unassigned */ 0,
+ /* C9 unassigned */ 0,
+ /* CA unassigned */ 0,
+ /* CB unassigned */ 0,
+ /* CC unassigned */ 0,
+ /* CD unassigned */ 0,
+ /* CE unassigned */ 0,
+ /* CF unassigned */ 0,
+ /* D0 unassigned */ 0,
+ /* D1 unassigned */ 0,
+ /* D2 unassigned */ 0,
+ /* D3 unassigned */ 0,
+ /* D4 unassigned */ 0,
+ /* D5 unassigned */ 0,
+ /* D6 unassigned */ 0,
+ /* D7 unassigned */ 0,
+ /* D8 unassigned */ 0,
+ /* D9 unassigned */ 0,
+ /* DA unassigned */ 0,
+ /* DB OEM specific */ 0,
+ /* DC OEM specific */ 0,
+ /* DD OEM specific */ 0,
+ /* DE OEM specific */ 0,
+ /* DF OEM specific */ 0,
+ /* E0 OEM specific */ 0,
+ /* E1 OEM specific */ 0,
+ /* E2 OEM specific */ 0,
+ /* E3 OEM specific */ 0,
+ /* E4 OEM specific */ 0,
+ /* E5 unassigned */ 0,
+ /* E6 OEM specific */ 0,
+ /* E7 unassigned */ 0,
+ /* E8 unassigned */ 0,
+ /* E9 OEM specific */ 0,
+ /* EA OEM specific */ 0,
+ /* EB OEM specific */ 0,
+ /* EC OEM specific */ 0,
+ /* ED OEM specific */ 0,
+ /* EE OEM specific */ 0,
+ /* EF OEM specific */ 0,
+ /* F0 OEM specific */ 0,
+ /* F1 OEM specific */ 0,
+ /* F2 OEM specific */ 0,
+ /* F3 OEM specific */ 0,
+ /* F4 OEM specific */ 0,
+ /* F5 OEM specific */ 0,
+ /* F6 unassigned */ 0,
+ /* F7 unassigned */ 0,
+ /* F8 unassigned */ 0,
+ /* F9 unassigned */ 0,
+ /* FA unassigned */ 0,
+ /* FB unassigned */ 0,
+ /* FC unassigned */ 0,
+ /* FD unassigned */ 0,
+ /* FE unassigned */ 0,
+ /* FF unassigned */ 0
+};
+
+int TGKeyWin32::transKeyEvent(KeyDownEvent& dst, KEY_EVENT_RECORD& src)
+{
+ if (src.wVirtualKeyCode!=VK_MENU &&
+ src.wVirtualKeyCode!=VK_CONTROL &&
+ src.wVirtualKeyCode!=VK_SHIFT)
+ {
+ dst.keyCode=KeyTo[src.wVirtualKeyCode];
+ dst.charScan.charCode=src.uChar.AsciiChar;
+ dst.charScan.scanCode=(uchar)src.wVirtualScanCode;
+ dst.raw_scanCode=(uchar)src.wVirtualScanCode;
+ dst.shiftState=transShiftState(src.dwControlKeyState);
+ if (dst.shiftState&kbAltShift) dst.keyCode|=kbAltLCode;
+ if (dst.shiftState&kbCtrlShift) dst.keyCode|=kbCtrlCode;
+ if (dst.shiftState&kbShift) dst.keyCode|=kbShiftCode;
+ return 1;
+ }
+ return 0;
+}
+
+/*
+ Win32 console events handlers
+ by Vadim Beloborodov
+ Originally in console.cc
+*/
+
+const char TGKeyWin32::testChars[]=
+"`1234567890-="
+"~!@#$%^&*()_+"
+"qwertyuiop[]"
+"QWERTYUIOP{}"
+"asdfghjkl;'\\"
+"ASDFGHJKL:\"|"
+"zxcvbnm,./"
+"ZXCVBNM<>?";
+
+unsigned TGKeyWin32::GetShiftState()
+{
+ return LastControlKeyState;
+}
+
+void TGKeyWin32::putConsoleKeyboardEvent(KeyDownEvent &key)
+{
+ EnterCriticalSection(&lockKeyboard);
+ if (evKeyboardLength<eventKeyboardQSize)
+ {
+ evKeyboardLength++;
+ *evKeyboardIn=key;
+ if (++evKeyboardIn>=&evKeyboardQueue[eventKeyboardQSize])
+ evKeyboardIn=&evKeyboardQueue[0];
+ }
+ LeaveCriticalSection(&lockKeyboard);
+}
+
+int TGKeyWin32::getConsoleKeyboardEvent(KeyDownEvent &key)
+{
+ EnterCriticalSection(&lockKeyboard);
+ int haskeyevent=evKeyboardLength>0;
+ if (haskeyevent)
+ {
+ evKeyboardLength--;
+ key=*evKeyboardOut;
+ if (++evKeyboardOut>=&evKeyboardQueue[eventKeyboardQSize])
+ evKeyboardOut=&evKeyboardQueue[0];
+ }
+ LeaveCriticalSection(&lockKeyboard);
+ return haskeyevent;
+}
+
+void TGKeyWin32::HandleKeyEvent()
+{
+ INPUT_RECORD ir;
+ DWORD dwRead;
+ PeekConsoleInput(TScreenWin32::hIn,&ir,1,&dwRead);
+ if ((dwRead==1) && (ir.EventType==KEY_EVENT))
+ {
+ if (ir.Event.KeyEvent.bKeyDown)
+ {
+ //support for non US keyboard layout on Windows95
+ if (((ir.Event.KeyEvent.dwControlKeyState & (RIGHT_ALT_PRESSED|LEFT_ALT_PRESSED|RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED))==0) &&
+ (ir.Event.KeyEvent.uChar.AsciiChar) &&
+ strchr(testChars,ir.Event.KeyEvent.uChar.AsciiChar))
+ {
+ uchar chr;
+ ReadConsole(TScreenWin32::hIn,&chr,1,&dwRead,NULL);
+ ir.Event.KeyEvent.uChar.AsciiChar=chr;
+ dwRead=0;
+ }
+ else
+ {
+ ReadConsoleInput(TScreenWin32::hIn,&ir,1,&dwRead);
+ dwRead = 0;
+ }
+ //translate event
+ KeyDownEvent key;
+ if (transKeyEvent(key,ir.Event.KeyEvent))
+ putConsoleKeyboardEvent(key);
+ }
+ ProcessControlKeyState(&ir);
+ }
+ if (dwRead==1)
+ ReadConsoleInput(TScreenWin32::hIn,&ir,1,&dwRead);
+}
+
+void TGKeyWin32::ProcessControlKeyState(INPUT_RECORD *ir)
+{
+ LastControlKeyState=transShiftState(ir->Event.KeyEvent.dwControlKeyState);
+}
+#else
+
+#include <tv/win32/screen.h>
+#include <tv/win32/key.h>
+
+#endif // TVOS_Win32
+
diff --git a/tvision/classes/win32/win32mouse.cc b/tvision/classes/win32/win32mouse.cc
new file mode 100644
index 0000000..8255430
--- /dev/null
+++ b/tvision/classes/win32/win32mouse.cc
@@ -0,0 +1,126 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Based on code contributed by Vadim Beloborodov.
+
+ Description:
+ Win32 Mouse routines.
+ The original implementation was done by Vadim, I removed some code and
+adapted it to the new architecture.
+ One important detail is that Vadim implemented it with threads. So we have
+here an events handler with a queue.
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_stdlib
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TGKey
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOS_Win32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/win32/screen.h>
+#include <tv/win32/mouse.h>
+#include <tv/win32/key.h>
+
+MouseEventType *THWMouseWin32::evMouseIn;
+MouseEventType *THWMouseWin32::evLastMouseIn=NULL;
+MouseEventType *THWMouseWin32::evMouseOut;
+MouseEventType THWMouseWin32::evMouseQueue[eventMouseQSize];
+unsigned THWMouseWin32::evMouseLength;
+CRITICAL_SECTION THWMouseWin32::lockMouse;
+
+void THWMouseWin32::Init()
+{
+ THWMouse::GetEvent=THWMouseWin32::GetEvent;
+ THWMouse::Resume=THWMouseWin32::Resume;
+ InitializeCriticalSection(&lockMouse);
+ evMouseLength=0;
+ evMouseIn=evMouseOut=&evMouseQueue[0];
+ Resume();
+}
+
+void THWMouseWin32::Resume()
+{
+ // SET: This is supposed to report if mouse is present and how many buttons
+ // have. I put a detailed comment in winnt driver.
+ buttonCount=GetSystemMetrics(SM_CMOUSEBUTTONS);
+}
+
+void THWMouseWin32::DeInit()
+{
+ DeleteCriticalSection(&lockMouse);
+}
+
+void THWMouseWin32::putConsoleMouseEvent(MouseEventType& mouse)
+{
+ EnterCriticalSection(&lockMouse);
+ if (evMouseLength<eventMouseQSize)
+ {// Compress mouse events
+ if (evLastMouseIn && evMouseLength && (evLastMouseIn->buttons==mouse.buttons))
+ *evLastMouseIn=mouse;
+ else
+ {
+ evMouseLength++;
+ *evMouseIn=mouse;
+ evLastMouseIn=evMouseIn;
+ if (++evMouseIn>=&evMouseQueue[eventMouseQSize])
+ evMouseIn=&evMouseQueue[0];
+ }
+ }
+ LeaveCriticalSection(&lockMouse);
+}
+
+void THWMouseWin32::GetEvent(MouseEventType &me)
+{
+ EnterCriticalSection(&lockMouse);
+ int hasmouseevent=evMouseLength>0;
+ if (hasmouseevent)
+ {
+ evMouseLength--;
+ me=*evMouseOut;
+ if (++evMouseOut>=&evMouseQueue[eventMouseQSize])
+ evMouseOut=&evMouseQueue[0];
+ }
+ else
+ // If no event is available use the last values so TV reports no changes
+ me=TEventQueue::curMouse;
+ LeaveCriticalSection(&lockMouse);
+}
+
+void THWMouseWin32::HandleMouseEvent()
+{
+ INPUT_RECORD ir;
+ DWORD dwRead;
+ ReadConsoleInput(TScreenWin32::hIn,&ir,1,&dwRead);
+ if ((dwRead==1) && (ir.EventType==MOUSE_EVENT))
+ {
+ MouseEventType mouse;
+ mouse.where.x=ir.Event.MouseEvent.dwMousePosition.X;
+ mouse.where.y=ir.Event.MouseEvent.dwMousePosition.Y;
+ mouse.buttons=0;
+ mouse.doubleClick=False;
+ if (ir.Event.MouseEvent.dwButtonState & FROM_LEFT_1ST_BUTTON_PRESSED)
+ mouse.buttons|=mbLeftButton;
+ if (ir.Event.MouseEvent.dwButtonState & RIGHTMOST_BUTTON_PRESSED)
+ mouse.buttons|=mbRightButton;
+ putConsoleMouseEvent(mouse);
+ TGKeyWin32::ProcessControlKeyState(&ir);
+ }
+}
+#else
+
+#include <tv/win32/screen.h>
+#include <tv/win32/mouse.h>
+#include <tv/win32/key.h>
+
+#endif // TVOS_Win32
+
diff --git a/tvision/classes/win32/win32scr.cc b/tvision/classes/win32/win32scr.cc
new file mode 100644
index 0000000..a1655d0
--- /dev/null
+++ b/tvision/classes/win32/win32scr.cc
@@ -0,0 +1,564 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Based on code contributed by Vadim Beloborodov.
+
+ Description:
+ Win32 Screen routines.
+ The original implementation was done by Vadim, I removed some code, added
+some routines and adapted it to the new architecture.
+ One important detail is that Vadim implemented it with threads. The
+thread that monitors the window size is different, that's why a lock is
+needed.
+ ToDo: Set UseScreenSaver when we are in full screen.
+
+ Configuration variables:
+ ScreenWidth
+ ScreenHeight
+ AppCP
+ ScrCP
+ InpCP
+
+ Notes:
+1) I changed all the code related to the save/restore state using a new
+screen buffer. I comment more in the "WinNT" driver. One really strange
+thing is that this driver behaves better with the cursor. Don't know why.
+I also added the resize window stuff.
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_string
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_TVCodePage
+#include <tv.h>
+#include <tv/win32/win32clip.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOS_Win32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/win32/screen.h>
+#include <tv/win32/mouse.h>
+#include <tv/win32/key.h>
+
+//#define DEBUG
+#ifdef DEBUG
+ #define DBPr1(a) fputs(a,stderr)
+ #define DBPr2(a,b) fprintf(stderr,a,b)
+ #define DBPr3(a,b,c) fprintf(stderr,a,b,c)
+#else
+ #define DBPr1(a)
+ #define DBPr2(a,b)
+ #define DBPr3(a,b,c)
+#endif
+
+CONSOLE_SCREEN_BUFFER_INFO TScreenWin32::info;
+int TScreenWin32::ExitEventThread=0;
+HANDLE TScreenWin32::EventThreadHandle=NULL;
+DWORD TScreenWin32::oldConsoleMode,
+ TScreenWin32::newConsoleMode;
+unsigned TScreenWin32::xCurStart,
+ TScreenWin32::yCurStart;
+unsigned TScreenWin32::saveScreenWidth,
+ TScreenWin32::saveScreenHeight;
+
+TScreenWin32::TScreenWin32()
+{
+ if (!InitConsole()) return;
+ flags0=CodePageVar | CursorShapes | CanSetVideoSize;
+ startupMode=getCrtMode();
+ startupCursor=getCursorType();
+ saveScreenWidth =GetCols();
+ saveScreenHeight=GetRows();
+
+ unsigned maxX=saveScreenWidth, maxY=saveScreenHeight;
+ long aux;
+ if (optSearch("ScreenWidth",aux))
+ maxX=aux;
+ if (optSearch("ScreenHeight",aux))
+ maxY=aux;
+ if (maxX!=saveScreenWidth || maxY!=saveScreenHeight)
+ {
+ setCrtModeRes(maxX,maxY);
+ // Update cached values
+ GetConsoleScreenBufferInfo(hOut,&ConsoleInfo);
+ }
+
+ cursorLines=getCursorType();
+ screenWidth =GetCols();
+ screenHeight=GetRows();
+
+ screenBuffer=new ushort[screenHeight*screenWidth];
+ ZeroMemory(screenBuffer,screenHeight*screenWidth*sizeof(ushort));
+
+ GetCursorPos(xCurStart,yCurStart);
+ suspended=0;
+ setCrtData();
+}
+
+int TScreenWin32::InitConsole()
+{
+ DWORD flags;
+ // Check if we are running in a console
+ if (!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),&flags))
+ return 0;
+ // Get handles to access Standard Input and Output
+ hIn =GetStdHandle(STD_INPUT_HANDLE);
+ hStdOut=GetStdHandle(STD_OUTPUT_HANDLE);
+ // Create a new buffer, it have their own content and cursor
+ hOut=CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
+ 0,NULL,CONSOLE_TEXTMODE_BUFFER,NULL);
+ if (hStdOut==INVALID_HANDLE_VALUE || hOut==INVALID_HANDLE_VALUE)
+ return 0; // Something went wrong
+ // Make the new one the active
+ if (!SetConsoleActiveScreenBuffer(hOut))
+ return 0;
+
+ // If we are here this driver will be used
+ initialized=1;
+ if (dCB) dCB();
+
+ // Enable mouse input
+ GetConsoleMode(hIn,&oldConsoleMode);
+ newConsoleMode=oldConsoleMode | ENABLE_MOUSE_INPUT|ENABLE_WINDOW_INPUT;
+ newConsoleMode&=~(ENABLE_LINE_INPUT|ENABLE_ECHO_INPUT|ENABLE_PROCESSED_INPUT);
+ SetConsoleMode(hIn,newConsoleMode);
+ SetConsoleCtrlHandler(ConsoleEventHandler,TRUE);
+
+ GetConsoleScreenBufferInfo(hOut,&ConsoleInfo);
+
+ InitializeCriticalSection(&lockWindowSizeChanged);
+
+ TDisplayWin32::Init();
+
+ TScreen::clearScreen=clearScreen;
+ TScreen::setCharacter=setCharacter;
+ TScreen::setCharacters=setCharacters;
+ TScreen::System_p=System;
+ TScreen::Resume=Resume;
+ TScreen::Suspend=Suspend;
+ TScreen::setCrtModeRes_p=SetCrtModeRes;
+ TScreen::setVideoModeRes_p=SetVideoModeRes;
+ TScreen::setVideoMode=SetVideoMode;
+ TScreen::setVideoModeExt=SetVideoModeExt;
+
+ TVWin32Clipboard::Init();
+ TGKeyWin32::Init();
+ THWMouseWin32::Init();
+
+ DWORD EventThreadID;
+ EventThreadHandle=CreateThread(NULL,0,HandleEvents,NULL,0,&EventThreadID);
+
+ UINT outCP=GetConsoleOutputCP();
+ UINT inCP=GetConsoleCP();
+ // Look for user settings
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+ // User settings have more priority than detected settings
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : outCP,
+ forcedScrCP!=-1 ? forcedScrCP : outCP,
+ forcedInpCP!=-1 ? forcedInpCP : inCP);
+ SetDefaultCodePages(outCP,outCP,inCP);
+
+ return 1;
+}
+
+void TScreenWin32::DoneConsole()
+{
+ INPUT_RECORD ir;
+ DWORD written;
+
+ // Stop the events thread
+ ZeroMemory(&ir,sizeof(ir));
+ ExitEventThread=1;
+ ir.EventType=KEY_EVENT;
+ WriteConsoleInput(hIn,&ir,1,&written);
+ WaitForSingleObject(EventThreadHandle,INFINITE);
+ CloseHandle(EventThreadHandle);
+
+ DeleteCriticalSection(&lockWindowSizeChanged);
+ THWMouseWin32::DeInit();
+ TGKeyWin32::DeInit();
+}
+
+DWORD WINAPI TScreenWin32::HandleEvents(void *)
+{
+ INPUT_RECORD ir;
+ DWORD dwRead;
+
+ while (!ExitEventThread)
+ {
+ WaitForSingleObject(hIn,INFINITE);
+ if (!ExitEventThread)
+ {
+ if (PeekConsoleInput(hIn,&ir,1,&dwRead) && dwRead>0)
+ {
+ switch (ir.EventType)
+ {
+ case MOUSE_EVENT:
+ THWMouseWin32::HandleMouseEvent();
+ break;
+
+ case KEY_EVENT:
+ TGKeyWin32::HandleKeyEvent();
+ break;
+
+ // Vadim wrote it, I never could make Windows resize.
+ // Not even providing a larger screen buffer.
+ case WINDOW_BUFFER_SIZE_EVENT:
+ EnterCriticalSection(&lockWindowSizeChanged);
+ WindowSizeChanged=1;
+ LeaveCriticalSection(&lockWindowSizeChanged);
+
+ default:
+ ReadConsoleInput(hIn,&ir,1,&dwRead);
+ }
+ }
+ }
+ else
+ ReadConsoleInput(hIn,&ir,1,&dwRead);
+ }
+ return 0;
+}
+
+
+void TScreenWin32::Resume()
+{
+ DBPr1("TScreenWin32::Resume\n");
+ // First switch to our handle
+ SetConsoleActiveScreenBuffer(hOut);
+ // Now we can save the current window size
+ GetConsoleScreenBufferInfo(hOut,&ConsoleInfo);
+ saveScreenWidth =ConsoleInfo.dwSize.X;
+ saveScreenHeight=ConsoleInfo.dwSize.Y;
+ // Restore our window size
+ SetCrtModeRes(screenWidth,screenHeight);
+ GetConsoleScreenBufferInfo(hOut,&ConsoleInfo);
+ setCrtData();
+ // Invalidate the cache to force a redraw
+ ZeroMemory(screenBuffer,screenHeight*screenWidth*sizeof(ushort));
+
+ GetConsoleMode(hIn,&oldConsoleMode);
+ SetConsoleMode(hIn,newConsoleMode);
+ SetConsoleCtrlHandler(ConsoleEventHandler,TRUE);
+}
+
+void TScreenWin32::Suspend()
+{
+ // Restore window size (using our handle!)
+ SetCrtModeRes(saveScreenWidth,saveScreenHeight);
+ // Switch to the original handle
+ SetConsoleActiveScreenBuffer(hStdOut);
+ SetConsoleMode(hIn,oldConsoleMode);
+ SetConsoleCtrlHandler(ConsoleEventHandler,FALSE);
+}
+
+TScreenWin32::~TScreenWin32()
+{
+ Suspend();
+ suspended=1;
+ setCursorType(startupCursor);
+ DoneConsole();
+ if (screenBuffer)
+ {
+ delete screenBuffer;
+ screenBuffer=0;
+ }
+}
+
+void TScreenWin32::clearScreen()
+{
+ COORD coord ={0,0};
+ DWORD read;
+ unsigned size=GetRows()*GetCols();
+ FillConsoleOutputAttribute(hOut,0x07,size,coord,&read);
+ FillConsoleOutputCharacterA(hOut,' ',size,coord,&read);
+}
+
+void TScreenWin32::setCharacter(unsigned offset, ushort value)
+{
+ setCharacters(offset,&value,1);
+}
+
+void TScreenWin32::setCharacters(unsigned dst, ushort *src, unsigned len)
+{
+ ushort *old=((ushort*)screenBuffer)+dst;
+ ushort *old_right=old+len-1;
+ ushort *src_right=src+len-1;
+
+ while (len>0 && *old==*src)
+ {
+ dst++;
+ len--;
+ old++;
+ src++;
+ }
+
+ /* remove unchanged characters from right to left */
+ while (len>0 && *old_right==*src_right)
+ {
+ len--;
+ old_right--;
+ src_right--;
+ }
+
+ /* write only middle changed characters */
+ if (len>0)
+ {
+ CHAR_INFO ch[maxViewWidth];
+ int i=0;
+
+ while (len-->0)
+ {
+ *old++=*src;
+ ch[i].Attributes=HIBYTE(*src);
+ ch[i].Char.AsciiChar=LOBYTE(*src);
+ i++;
+ src++;
+ }
+
+ ushort x=dst%screenWidth, y=dst/screenWidth;
+
+ SMALL_RECT to={x,y,x+i-1,y};
+ COORD bsize={i,1};
+ static COORD from={0,0};
+ WriteConsoleOutput(hOut,ch,bsize,from,&to);
+ }
+}
+
+#ifndef TVCompf_Cygwin
+int TScreenWin32::System(const char *command, pid_t *pidChild, int in,
+ int out, int err)
+{
+ // fork mechanism not implemented, indicate the child finished
+ if (pidChild)
+ *pidChild=0;
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+}
+#else
+// fork mechanism is implemented in Cygwin, so linux code should work -- OH
+
+// SET: Call to an external program, optionally forking
+int TScreenWin32::System(const char *command, pid_t *pidChild, int in,
+ int out, int err)
+{
+ if (!pidChild)
+ {
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+ }
+
+ pid_t cpid=fork();
+ if (cpid==0)
+ {// Ok, we are the child
+ // I'm not sure about it, but is the best I have right now.
+ // Doing it we can kill this child and all the subprocesses
+ // it creates by killing the group. It also have an interesting
+ // effect that I must evaluate: By doing it this process lose
+ // the controlling terminal and won't be able to read/write
+ // to the parents console. I think that's good.
+ if (setsid()==-1)
+ _exit(127);
+ char *argv[4];
+
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+
+ argv[0]=getenv("SHELL");
+ if (!argv[0])
+ argv[0]="/bin/sh";
+ argv[1]="-c";
+ argv[2]=(char *)command;
+ argv[3]=0;
+ execvp(argv[0],argv);
+ // We get here only if exec failed
+ _exit(127);
+ }
+ if (cpid==-1)
+ {// Fork failed do it manually
+ *pidChild=0;
+ return system(command);
+ }
+ *pidChild=cpid;
+ return 0;
+}
+#endif
+
+TScreen *TV_Win32DriverCheck()
+{
+ TScreenWin32 *drv=new TScreenWin32();
+ if (!TScreen::initialized)
+ {
+ delete drv;
+ return 0;
+ }
+ return drv;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Change the window size to the desired value. The font size is ignored
+because it can't be controlled by the application, the Win32 API reference
+I have says: "A screen buffer can be any size, limited only by available
+memory. The dimensions of a screen buffer's window cannot exceed the
+corresponding dimensions of either the screen buffer or the maximum window
+that can fit on the screen based on the current font size (controlled
+exclusively by the user).".@*
+ It only works if we are windowed and this will prevent from going full
+screen unless Windows knows an equivalent text mode.
+
+ Return: 0 no change, 1 full change, 2 approx. change. by SET
+
+***************************************************************************/
+
+int TScreenWin32::SetCrtModeRes(unsigned w, unsigned h, int fW, int fH)
+{
+ CONSOLE_SCREEN_BUFFER_INFO info;
+ DBPr3("TScreenWin32::SetCrtModeRes(%d,%d)\n",w,h);
+ // Find current size
+ if (!GetConsoleScreenBufferInfo(hOut,&info))
+ {
+ DBPr1("GetConsoleScreenBufferInfo failed\n");
+ return 0;
+ }
+ // Is the same used?
+ if (info.dwSize.X==(int)w && info.dwSize.Y==(int)h)
+ {
+ DBPr3("Already using %d,%d size\n",w,h);
+ return 0;
+ }
+ // Find the max. size, depends on the font and screen size.
+ COORD max=GetLargestConsoleWindowSize(hOut);
+ COORD newSize={w,h};
+ if (newSize.X>max.X) newSize.X=max.X;
+ if (newSize.Y>max.Y) newSize.Y=max.Y;
+ // The buffer must be large enough to hold both modes (current and new)
+ COORD newBufSize=newSize;
+ if (info.dwMaximumWindowSize.X>newBufSize.X)
+ newBufSize.X=info.dwMaximumWindowSize.X;
+ if (info.dwMaximumWindowSize.Y>newBufSize.Y)
+ newBufSize.Y=info.dwMaximumWindowSize.Y;
+ DBPr3("Enlarging buffer from %d,%d to",info.dwMaximumWindowSize.X,
+ info.dwMaximumWindowSize.Y);
+ DBPr3(" %d,%d\n",newBufSize.X,newBufSize.Y);
+ // Enlarge the buffer size. It fails if not windowed.
+ if (!SetConsoleScreenBufferSize(hOut,newBufSize))
+ {
+ DBPr1("SetConsoleScreenBufferSize failed!\n");
+ return 0;
+ }
+ // Resize the window.
+ SMALL_RECT r={0,0,newSize.X-1,newSize.Y-1};
+ DBPr3("Resizing window to %d,%d\n",newSize.X,newSize.Y);
+ if (!SetConsoleWindowInfo(hOut,TRUE,&r))
+ {// Revert buffer size
+ DBPr1("SetConsoleWindowInfo failed!\n");
+ newSize.X=info.dwMaximumWindowSize.X;
+ newSize.Y=info.dwMaximumWindowSize.Y;
+ SetConsoleScreenBufferSize(hOut,newSize);
+ return 0;
+ }
+ // Now we can shrink the buffer to the needed size
+ SetConsoleScreenBufferSize(hOut,newSize);
+ // Ok! we did it.
+ return fW!=-1 || fH!=-1 || newSize.X!=(int)w || newSize.Y!=(int)h ? 2 : 1;
+}
+
+void TScreenWin32::CheckSizeBuffer(int oldWidth, int oldHeight)
+{
+ // allocating a zeroed screenBuffer, because this function
+ // is called in most cases (in RHIDE) after a SIGWINCH
+ if (screenWidth!=oldWidth || screenHeight!=oldHeight || !screenBuffer)
+ {
+ // Realloc screen buffer only if actually needed (it doesn't exist
+ // or screen size is changed)
+ if (screenBuffer)
+ DeleteArray(screenBuffer);
+ screenBuffer=new ushort[screenWidth*screenHeight];
+ }
+ memset(screenBuffer,0,screenWidth*screenHeight*sizeof(ushort));
+}
+
+void TScreenWin32::SetVideoMode(ushort mode)
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+
+ defaultSetVideoMode(mode);
+ CheckSizeBuffer(oldWidth,oldHeight);
+}
+
+void TScreenWin32::SetVideoModeExt(char *mode)
+{
+ int oldWidth=screenWidth;
+ int oldHeight=screenHeight;
+
+ defaultSetVideoModeExt(mode);
+ CheckSizeBuffer(oldWidth,oldHeight);
+}
+
+int TScreenWin32::SetVideoModeRes(unsigned w, unsigned h, int fW, int fH)
+{// Set the screen mode
+ int ret=setCrtModeRes(w,h,fW,fH);
+ if (ret)
+ {// Memorize new values:
+ // Cache the values for TDisplay
+ GetConsoleScreenBufferInfo(hOut,&ConsoleInfo);
+ screenWidth =ConsoleInfo.dwSize.X;
+ screenHeight=ConsoleInfo.dwSize.Y;
+ DeleteArray(screenBuffer);
+ screenBuffer=new ushort[screenHeight*screenWidth];
+ ZeroMemory(screenBuffer,screenHeight*screenWidth*sizeof(ushort));
+ // This is something silly TV code spects: after a video mode change the
+ // cursor should go to the "default" state.
+ setCursorType(cursorLines);
+ // Cache the data about it and initialize related stuff
+ setCrtData();
+ }
+ return ret;
+}
+
+// Anatoli's idea
+BOOL WINAPI TScreenWin32::ConsoleEventHandler(DWORD dwCtrlType)
+{
+ if (dwCtrlType==CTRL_C_EVENT || dwCtrlType==CTRL_BREAK_EVENT)
+ return TRUE;
+ return FALSE;
+}
+
+#else
+
+#include <tv/win32/screen.h>
+#include <tv/win32/mouse.h>
+#include <tv/win32/key.h>
+
+#endif // TVOS_Win32
+
diff --git a/tvision/classes/wingr/wingrdis.cc b/tvision/classes/wingr/wingrdis.cc
new file mode 100644
index 0000000..b5a08c3
--- /dev/null
+++ b/tvision/classes/wingr/wingrdis.cc
@@ -0,0 +1,1623 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 José Angel Sánchez Caso (JASC)
+
+ skeletons by Salvador E. Tropea (SET)
+
+ Description:
+ Windows GUI Display routines.
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TEditor
+#define Uses_TGKey
+#define Uses_TMouse
+#define Uses_TGroup
+#define Uses_TVCodePage
+#define Uses_TProgram
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_alloca
+#include <tv.h>
+
+#if defined(TVOS_Win32) && !defined(TV_Disable_WinGr_Driver)
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <shellapi.h>
+
+
+#include <tv/wingr/screen.h>
+#include <tv/wingr/key.h>
+#include <tv/wingr/mouse.h>
+
+const int maxTitleSize= 256;
+
+char * TDisplayWinGr::className= "TVISION for windows"; /* Make the classname into a global variable */
+HINSTANCE TDisplayWinGr::TvWinInstance;
+
+char TDisplayWinGr::cShapeFr;
+char TDisplayWinGr::cShapeTo;
+
+unsigned TDisplayWinGr::xPos= UINT_MAX; /* X axis of the cursor */
+unsigned TDisplayWinGr::yPos= UINT_MAX; /* Y axis of the cursor */
+unsigned TDisplayWinGr::zPos; /* Z axis of the cursor (means size )*/
+int TDisplayWinGr::sizeChanged= 0; /* Resizinf counter */
+int TDisplayWinGr::forceRedraw= 0;
+
+TEvent TDisplayWinGr::storedEvent; /* Correctly processes message queue */
+HWND TDisplayWinGr::hwnd= NULL; /* Main window handler */
+HDC TDisplayWinGr::hdc; /* A device context used for drawing */
+COLORREF TDisplayWinGr::colorMap[ 16 ];
+
+HCURSOR TDisplayWinGr::normCursor;
+HCURSOR TDisplayWinGr::sizeCursor;
+HCURSOR TDisplayWinGr::handCursor;
+
+bitmapFontRec TDisplayWinGr::primary = { 0,0,0,0,0 };
+bitmapFontRec TDisplayWinGr::secondary= { 0,0,0,0,0 };
+
+ RECT TDisplayWinGr::wGeo= { 0, 0, 0, 0 };
+
+/*
+ * JASC, marz 2006
+ *
+ * drag 'n' drop support
+ */
+
+char TDisplayWinGr::dragDropName[ PATH_MAX ];
+int TDisplayWinGr::dragDropIdx= 0;
+void * TDisplayWinGr::dragDropHnd= NULL;
+
+
+/*
+ * At least font limits have the hardcoded fonts
+ */
+
+int TDisplayWinGr::foWmin= 8;
+int TDisplayWinGr::foHmin= 16;
+int TDisplayWinGr::foWmax= 10;
+int TDisplayWinGr::foHmax= 20;
+
+unsigned TDisplayWinGr::dmPelsWidth ;
+unsigned TDisplayWinGr::dmPelsHeight;
+
+
+
+
+uchar TDisplayWinGr::shapeFont10x20[]=
+{ 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x4C,0x80,0x4C,0x80,0x7C,0x80,0x79,0x80,0x73,0x80,0x73,0x80,0x73,0x80,0x7F,0x80,0x73,0x80,0x73,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x67,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x36,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x67,0x80,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x36,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x6D,0x80,0x6D,0x80,0x6F,0x80,0x6C,0x00,0x6C,0x00,0x6D,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x7F,0x80,0x7F,0x80,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x7E,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x00,0x00,0x1F,0x80,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x7C,0x00,0x60,0x00,0x60,0x00,0x78,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x0F,0x80,0x0C,0x00,0x0C,0x00,0x0F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x3C,0x00,0x66,0x00,0x60,0x00,0x60,0x00,0x66,0x00,0x3C,0x00,0x00,0x00,0x1F,0x00,0x19,0x80,0x19,0x80,0x1F,0x00,0x1E,0x00,0x1B,0x00,0x19,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3E,0x00,0x00,0x00,0x0F,0x80,0x0C,0x00,0x0C,0x00,0x0F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00
+, 0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80
+, 0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0
+, 0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0
+, 0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00
+, 0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0
+, 0x00,0x00,0x00,0x00,0x66,0x00,0x76,0x00,0x7E,0x00,0x7E,0x00,0x6E,0x00,0x66,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x3C,0x00,0x3C,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x1F,0x80,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x38,0x00,0x0E,0x00,0x03,0x80,0x0E,0x00,0x38,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x0E,0x00,0x38,0x00,0xE0,0x00,0x38,0x00,0x0E,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x06,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x18,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x07,0x80,0x1F,0x80,0x7F,0x80,0x7F,0x80,0x1F,0x80,0x07,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x78,0x00,0x7E,0x00,0x7F,0x80,0x7F,0x80,0x7E,0x00,0x78,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x6D,0x80,0x4C,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x4C,0x80,0x6D,0x80,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0xFF,0x80,0xFF,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0xFF,0x80,0xFF,0x80,0x60,0x00,0x30,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x6D,0x80,0x4C,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x4C,0x80,0x6D,0x80,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x33,0x00,0x61,0x80,0xFF,0xC0,0xFF,0xC0,0x61,0x80,0x33,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x19,0x80,0x31,0x80,0x7F,0x80,0x7F,0x80,0x30,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x3F,0xC0,0x1B,0x00,0x1B,0x00,0x1B,0x00,0x7F,0x80,0x36,0x00,0x36,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x3F,0x00,0x6D,0x80,0x6C,0x00,0x6C,0x00,0x6C,0x00,0x3F,0x00,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x6D,0x80,0x3F,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x6F,0x00,0x3B,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x1B,0x80,0x1E,0xC0,0x36,0xC0,0x33,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x3C,0x00,0x18,0x00,0x38,0x00,0x6C,0x00,0x66,0xC0,0x63,0x80,0x63,0x00,0x77,0x80,0x3C,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x7F,0x80,0x1E,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1C,0x00,0x3C,0x00,0x6C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x0E,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x01,0x80,0x03,0x00,0x0E,0x00,0x03,0x00,0x01,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x07,0x00,0x0F,0x00,0x1B,0x00,0x33,0x00,0x63,0x00,0x63,0x00,0x7F,0x80,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x01,0x80,0x21,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x67,0x80,0x6F,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6F,0x00,0x66,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x66,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x67,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x63,0x00,0x63,0x00,0x66,0x00,0x66,0x00,0x7C,0x00,0x66,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x73,0x80,0x73,0x80,0x7F,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x71,0x80,0x71,0x80,0x79,0x80,0x79,0x80,0x6D,0x80,0x6D,0x80,0x67,0x80,0x67,0x80,0x63,0x80,0x63,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x6D,0x80,0x67,0x80,0x33,0x00,0x1F,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x30,0x00,0x1E,0x00,0x03,0x00,0x01,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x73,0x80,0x73,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x1E,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x03,0x00,0x03,0x00,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x73,0x00,0x6E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x1D,0x80,0x33,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x19,0x80,0x19,0x80,0x18,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x80,0x63,0x80,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x60,0x00,0x3F,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x3F,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x00,0x00,0x07,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x31,0x80,0x31,0x80,0x31,0x80,0x1F,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x63,0x00,0x66,0x00,0x6C,0x00,0x78,0x00,0x7C,0x00,0x66,0x00,0x63,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5B,0x00,0x7F,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x73,0x00,0x6E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0x80,0x33,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0x00,0x39,0x80,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x60,0x00,0x3F,0x00,0x01,0x80,0x01,0x80,0x61,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x19,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x7F,0x80,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x33,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x3F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x78,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00
+, 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00
+, 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x0F,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00
+, 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xF8,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00
+, 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xFF,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x04,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x13,0xC0,0x10,0x00,0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00
+, 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xC0,0x10,0x00,0x13,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00
+, 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x13,0xC0,0x10,0x00,0x13,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x08,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF2,0x00,0x02,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF3,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x02,0x00,0xF2,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00
+, 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF2,0x00,0x02,0x00,0xF2,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0xF3,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00
+, 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF3,0xC0,0x00,0x00,0xF3,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x00,0x60,0x00,0x60,0x00,0x61,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x19,0x80,0x19,0x80,0x18,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x7C,0x00,0x56,0xC0,0x73,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x3F,0x00,0x6D,0x80,0x6C,0x00,0x6C,0x00,0x6C,0x00,0x3F,0x00,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x6D,0x80,0x3F,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x3F,0x00,0x0C,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x63,0x00,0x30,0x00,0x3C,0x00,0x66,0x00,0x33,0x00,0x19,0x80,0x0F,0x00,0x03,0x00,0x31,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x5E,0x80,0x52,0x80,0x50,0x80,0x52,0x80,0x5E,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x21,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x80,0x0D,0x80,0x1B,0x00,0x36,0x00,0x6C,0x00,0xD8,0x00,0x6C,0x00,0x36,0x00,0x1B,0x00,0x0D,0x80,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x7F,0x80,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x5E,0x80,0x52,0x80,0x5E,0x80,0x54,0x80,0x56,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x06,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x77,0x00,0x7D,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x7F,0x80,0x7D,0x80,0x7D,0x80,0x7D,0x80,0x3D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x38,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x6C,0x00,0x36,0x00,0x1B,0x00,0x0D,0x80,0x06,0xC0,0x0D,0x80,0x1B,0x00,0x36,0x00,0x6C,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x60,0x00,0x20,0x80,0x21,0x00,0x72,0x00,0x04,0x00,0x09,0x00,0x13,0x00,0x25,0x00,0x4F,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x60,0x00,0x20,0x80,0x21,0x00,0x72,0x00,0x04,0x00,0x0B,0x00,0x14,0x80,0x20,0x80,0x41,0x00,0x02,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x08,0x00,0x30,0x80,0x09,0x00,0x72,0x00,0x04,0x00,0x09,0x00,0x13,0x00,0x25,0x00,0x4F,0x80,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x1E,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x1E,0x00,0x36,0x00,0x36,0x00,0x66,0x00,0x66,0x00,0x7F,0x80,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x67,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x61,0x80,0x33,0x00,0x1E,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00
+, 0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0xF9,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x61,0x80,0x71,0x80,0x79,0x80,0x79,0x80,0x6D,0x80,0x6D,0x80,0x67,0x80,0x67,0x80,0x63,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x80,0x1F,0x00,0x33,0x00,0x63,0x80,0x63,0x80,0x65,0x80,0x65,0x80,0x65,0x80,0x69,0x80,0x69,0x80,0x69,0x80,0x71,0x80,0x33,0x00,0x3E,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3F,0x00,0x31,0x80,0x31,0x80,0x31,0x80,0x31,0x80,0x31,0x80,0x3F,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x1B,0x00,0x31,0x80,0x31,0x80,0x33,0x00,0x76,0x00,0x36,0x00,0x33,0x00,0x31,0x80,0x31,0x80,0x31,0x80,0x33,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x00,0x4D,0x80,0x0D,0x80,0x0F,0x00,0x3C,0x00,0x6C,0x00,0x6C,0x80,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x07,0xC0,0x01,0x80,0x1D,0x80,0x33,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x7F,0x80,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x1F,0x00,0x33,0x00,0x65,0x80,0x65,0x80,0x69,0x80,0x69,0x80,0x33,0x00,0x3E,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3E,0x00,0x33,0x00,0x31,0x80,0x31,0x80,0x31,0x80,0x33,0x00,0x3E,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00
+};
+
+uchar TDisplayWinGr::shapeFont8x16[]=
+{ 0x00,0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00,0x00 // 0
+, 0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x6E,0xF8,0xD8,0xD8,0xDC,0xD8,0xD8,0xD8,0xF8,0x6E,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00 // 
+, 0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00 // 
+, 0x00,0x70,0x88,0x80,0x88,0x70,0x00,0x3C,0x22,0x3C,0x24,0x22,0x00,0x00,0x00,0x00 // 
+, 0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00 // 
+, 0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44 // \t
+, 0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA // \n
+, 0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77 //
+, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF //
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF // \r
+, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // 
+, 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0 // 
+, 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F // 
+, 0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00,0x00,0x00 // 
+, 0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0x0E,0x38,0xE0,0x38,0x0E,0x00,0xFE,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0xE0,0x38,0x0E,0x38,0xE0,0x00,0xFE,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x06,0x0C,0xFE,0x18,0x30,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0x06,0x1E,0x7E,0xFE,0x7E,0x1E,0x06,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0xC0,0xF0,0xFC,0xFE,0xFC,0xF0,0xC0,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00 // 0x1A
+, 0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0x00,0x28,0x6C,0xFE,0x6C,0x28,0x00,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 //
+, 0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00 // !
+, 0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // "
+, 0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00 // #
+, 0x00,0x10,0x10,0x7C,0xD6,0xD0,0xD0,0x7C,0x16,0x16,0xD6,0x7C,0x10,0x10,0x00,0x00 // $
+, 0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00 // %
+, 0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // &
+, 0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // '
+, 0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00 // (
+, 0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00 // )
+, 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00 // *
+, 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00 // +
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00 // ,
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // -
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00 // .
+, 0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0xC0,0x00,0x00,0x00,0x00,0x00 // /
+, 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // 0
+, 0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00 // 1
+, 0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00 // 2
+, 0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00 // 3
+, 0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00 // 4
+, 0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00 // 5
+, 0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // 6
+, 0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00 // 7
+, 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // 8
+, 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00 // 9
+, 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00 // :
+, 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00 // ;
+, 0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00 // <
+, 0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // =
+, 0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00 // >
+, 0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00 // ?
+, 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00 // @
+, 0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // A
+, 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00 // B
+, 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00 // C
+, 0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00 // D
+, 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00 // E
+, 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00 // F
+, 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00 // G
+, 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // H
+, 0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // I
+, 0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00 // J
+, 0x00,0x00,0xE6,0x66,0x66,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00 // K
+, 0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00 // L
+, 0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // M
+, 0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // N
+, 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // O
+, 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00 // P
+, 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00 // Q
+, 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00 // R
+, 0x00,0x00,0x7C,0xC6,0xC6,0x64,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // S
+, 0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // T
+, 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // U
+, 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00 // V
+, 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0x6C,0x00,0x00,0x00,0x00 // W
+, 0x00,0x00,0xC6,0xC6,0x6C,0x7C,0x38,0x38,0x7C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00 // X
+, 0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // Y
+, 0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00 // Z
+, 0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00 // [
+, 0x00,0x00,0x00,0x00,0x00,0xC0,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,0x00 // \ .
+, 0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00 // ]
+, 0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ^
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00 // _
+, 0x00,0x30,0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // `
+, 0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // a
+, 0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00 // b
+, 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00 // c
+, 0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // d
+, 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00 // e
+, 0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00 // f
+, 0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00 // g
+, 0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00 // h
+, 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // i
+, 0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00 // j
+, 0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00 // k
+, 0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // l
+, 0x00,0x00,0x00,0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xD6,0xD6,0xC6,0x00,0x00,0x00,0x00 // m
+, 0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00 // n
+, 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // o
+, 0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00 // p
+, 0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00 // q
+, 0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x66,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00 // r
+, 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00 // s
+, 0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00 // t
+, 0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // u
+, 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00 // v
+, 0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00,0x00 // w
+, 0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00 // x
+, 0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00 // y
+, 0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00 // z
+, 0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00 // {
+, 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00 // |
+, 0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00 // }
+, 0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ~
+, 0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // 
+, 0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // €
+, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 //
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ‚
+, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ƒ
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18 // „
+, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18 // …
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18 // †
+, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18 // ‡
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ˆ
+, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ‰
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // Š
+, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ‹
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18 // Œ
+, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18 //
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18 // Ž
+, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18 //
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00 //
+, 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ‘
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ’
+, 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // “
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C // ”
+, 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C // •
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x6F,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C // –
+, 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6F,0x60,0x6F,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C // —
+, 0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ˜
+, 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ™
+, 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // š
+, 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ›
+, 0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xEC,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C // œ
+, 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEC,0x0C,0xEC,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C //
+, 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xEF,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C // ž
+, 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEF,0x00,0xEF,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C // Ÿ
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xFE,0x00,0x00,0x00,0x00 //  
+, 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00 // ¡
+, 0x00,0x00,0x00,0x00,0x10,0x7C,0xD6,0xD0,0xD0,0xD0,0xD6,0x7C,0x10,0x00,0x00,0x00 // ¢
+, 0x00,0x00,0x38,0x6C,0x60,0x60,0xF0,0x60,0x60,0x66,0xF6,0x6C,0x00,0x00,0x00,0x00 // £
+, 0x00,0x00,0x00,0x00,0xC6,0x7C,0x6C,0x6C,0x7C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00 // ¤
+, 0x00,0x00,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00 // ¥
+, 0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00 // ¦
+, 0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00 // §
+, 0x00,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ¨
+, 0x00,0x00,0x3C,0x42,0x99,0xA5,0xA1,0xA5,0x99,0x42,0x3C,0x00,0x00,0x00,0x00,0x00 // ©
+, 0x00,0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ª
+, 0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00 // «
+, 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00 // ¬
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ­
+, 0x00,0x00,0x3C,0x42,0xB9,0xA5,0xB9,0xA5,0xA5,0x42,0x3C,0x00,0x00,0x00,0x00,0x00 // ®
+, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ¯
+, 0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // °
+, 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x7E,0x00,0x00,0x00,0x00 // ±
+, 0x38,0x6C,0x18,0x30,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ²
+, 0x38,0x6C,0x18,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ³
+, 0x00,0x18,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ´
+, 0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xF6,0xC0,0xC0,0xC0,0x00 // µ
+, 0x00,0x00,0x7F,0xD6,0xD6,0x76,0x36,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00 // ¶
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ·
+, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x6C,0x38,0x00 // ¸
+, 0x30,0x70,0x30,0x30,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // ¹
+, 0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 // º
+, 0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00 // »
+, 0x00,0x60,0xE0,0x60,0x66,0x0C,0x18,0x30,0x66,0xCE,0x1A,0x3F,0x06,0x06,0x00,0x00 // ¼
+, 0x00,0x60,0xE0,0x60,0x66,0x0C,0x18,0x30,0x6E,0xDB,0x06,0x0C,0x1F,0x00,0x00,0x00 // ½
+, 0x70,0xD8,0x30,0xD8,0x76,0x0C,0x18,0x30,0x66,0xCE,0x1A,0x3F,0x06,0x06,0x00,0x00 // ¾
+, 0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x30,0x60,0xC6,0xC6,0x7C,0x00,0x00 // ¿
+, 0x60,0x30,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // À
+, 0x0C,0x18,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // Á
+, 0x10,0x38,0x6C,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // Â
+, 0x76,0xDC,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // Ã
+, 0x00,0x6C,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // Ä
+, 0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // Å
+, 0x00,0x00,0x3E,0x78,0xD8,0xD8,0xFC,0xD8,0xD8,0xD8,0xD8,0xDE,0x00,0x00,0x00,0x00 // Æ
+, 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x66,0x3C,0x00 // Ç
+, 0x60,0x30,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00 // È
+, 0x0C,0x18,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00 // É
+, 0x10,0x38,0x6C,0x00,0xFE,0x66,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00 // Ê
+, 0x00,0x6C,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00 // Ë
+, 0x60,0x30,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // Ì
+, 0x06,0x0C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // Í
+, 0x18,0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // Î
+, 0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // Ï
+, 0x00,0x00,0xF8,0x6C,0x66,0x66,0xF6,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00 // Ð
+, 0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00 // Ñ
+, 0x60,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // Ò
+, 0x0C,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // Ó
+, 0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // Ô
+, 0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // Õ
+, 0x00,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // Ö
+, 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0x18,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00 // ×
+, 0x00,0x00,0x7E,0xC6,0xCE,0xCE,0xDE,0xF6,0xE6,0xE6,0xC6,0xFC,0x00,0x00,0x00,0x00 // Ø
+, 0x60,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // Ù
+, 0x0C,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // Ú
+, 0x10,0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // Û
+, 0x00,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // Ü
+, 0x06,0x0C,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // Ý
+, 0x00,0x00,0xF0,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00,0x00,0x00 // Þ
+, 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xCC,0xC6,0xC6,0xC6,0xD6,0xDC,0x80,0x00,0x00,0x00 // ß
+, 0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // à
+, 0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // á
+, 0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // â
+, 0x00,0x00,0x76,0xDC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // ã
+, 0x00,0x00,0x00,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // ä
+, 0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // å
+, 0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0x1B,0x7F,0xD8,0xDB,0x7E,0x00,0x00,0x00,0x00 // æ
+, 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x18,0x6C,0x38,0x00 // ç
+, 0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00 // è
+, 0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00 // é
+, 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00 // ê
+, 0x00,0x00,0x00,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00 // ë
+, 0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // ì
+, 0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // í
+, 0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // î
+, 0x00,0x00,0x00,0x6C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00 // ï
+, 0x00,0x78,0x30,0x78,0x0C,0x7E,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // ð
+, 0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00 // ñ
+, 0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // ò
+, 0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // ó
+, 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // ô
+, 0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // õ
+, 0x00,0x00,0x00,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00 // ö
+, 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00 // ÷
+, 0x00,0x00,0x00,0x00,0x00,0x7E,0xCE,0xDE,0xFE,0xF6,0xE6,0xFC,0x00,0x00,0x00,0x00 // ø
+, 0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // ù
+, 0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // ú
+, 0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // û
+, 0x00,0x00,0x00,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00 // ü
+, 0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00 // ý
+, 0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,0x00 // þ
+, 0x00,0x00,0x00,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00 // 255
+};
+
+TScreenFont256 TDisplayWinGr::font8x16 ={ 8, 16, (uchar *)shapeFont8x16 };
+TScreenFont256 TDisplayWinGr::font10x20={ 10, 20, shapeFont10x20 };
+TScreenFont256 * TDisplayWinGr::defaultFont= &TDisplayWinGr::font8x16;
+
+
+/*
+ * JASC, ene 2006, new raster fonts
+ */
+
+int TDisplayWinGr::selectFont( bitmapFontRec & fontResource
+ , TScreenFont256 * fontData )
+{ if ( !hdc ) /* No resources now */
+ { return( -1 );
+ }
+
+ if ( !fontData )
+ { fontData= TDisplayWinGr::defaultFont;
+ }
+
+ if ( !fontResource.bitmapMemo )
+ { fontResource.bitmapMemo= CreateCompatibleDC( hdc ); /* Memory needed */
+ }
+
+ if ( fontResource.bitmapRaster )
+ { DeleteObject( fontResource.bitmapRaster ); /* Free rersources */
+ }
+
+/*
+ * Bitmaps are word aligned but fonts are byte aligned Aghh...
+ */
+
+ ushort * data= (ushort *)fontData->data;
+ ushort * dst= (ushort *) alloca( 256 * sizeof( ushort ) * fontData->h );
+
+ if ((( fontData->w - 8 ) % 16 ) == 0 ) /* 8, 24, 40 etc ... (byte aligned) */
+ { int sz= 256 * fontData->h ; /* Iterate whole chars */
+ uchar * src= fontData->data;
+ data= dst; /* Point to the new buffer */
+
+ while ( sz -- )
+ { *dst ++ = *src ++; // *src ++;
+ }
+ }
+
+/*
+ * Arrange all 256 chars in a single row
+ */
+
+ fontResource.w= fontData->w;
+ fontResource.h= fontData->h;
+
+ fontResource.bitmapRaster=
+ CreateBitmap( fontData->w
+ , fontData->h * 256 /* 256 chars */
+ , 1 , 1 /* Monochome bitmap */
+ , data ); /* font data */
+
+
+ fontResource.bitmapObject=
+ SelectObject( fontResource.bitmapMemo
+ , fontResource.bitmapRaster );
+
+/*
+ * The this hardcoded bitmap fonts have evidently a fixed codepage.
+ */
+
+ TVCodePage::SetScreenCodePage( TVCodePage::ISOLatin1Linux );
+ return( 0 );
+}
+
+
+/*
+ * JASC, feb 2006, Emulated DOS modes
+ */
+
+VideoModeData TDisplayWinGr::videoModes[]=
+{{ smBW80 , 80, 25, 8, 16 }
+,{ smCO80 , 80, 25, 8, 16 }
+,{ smCO80x25, 80, 25, 8, 16 }
+,{ smMono , 80, 25, 8, 16 }
+,{ smFont8x8, 80, 50, 8, 8 }
+
+/*
+ * Modes defined by Robert
+ * Extended
+ */
+
+,{ smCO80x28, 80,28, 8, 12 }
+,{ smCO80x35, 80,35, 8, 12 }
+,{ smCO80x40, 80,40, 8, 12 }
+,{ smCO80x43, 80,43, 8, 8 }
+,{ smCO80x50, 80,50, 8, 8 }
+
+/* Tweaked
+ */
+,{ smCO80x30, 80,30, 8, 12 }
+,{ smCO80x34, 80,34, 8, 12 }
+,{ smCO90x30, 90,30, 7, 12 }
+,{ smCO90x34, 90,34, 5, 12 }
+,{ smCO94x30, 94,30, 5, 12 }
+,{ smCO94x34, 94,34, 5, 12 }
+,{ smCO82x25, 82,25, 0, 0 } /* Created by SET to get 8x16 char cells */
+
+/* Common VESA text modes
+ */
+
+,{ smCO80x60 , 80, 60, 8, 8 }
+,{ smCO132x25, 132, 25, 5, 12 }
+,{ smCO132x43, 132, 43, 5, 12 }
+,{ smCO132x50, 132, 50, 4, 6 }
+,{ smCO132x60, 132, 60, 4, 6 }
+,{}};
+
+
+
+/*
+ * JASC, feb 2006, Load a windows font
+ */
+
+int TDisplayWinGr::SetFontCrt( bitmapFontRec & fontResource
+ , ushort w, ushort h )
+{ HGDIOBJ fontObject;
+ int loop;
+ RECT celda;
+ char letra;
+
+ if ( !hdc ) /* No resources now */
+ { return( -1 );
+ }
+
+ HFONT hFont= CreateFont( h /* Font height */
+ , w /* Font width */
+ , 0 /* Escapement */
+ , 0 /* Orientation */
+ , FW_DONTCARE /* Weigth */
+ , false /* Italic */
+ , false /* Underline */
+ , false /* Bold */
+ , OEM_CHARSET /* Charset */
+ , OUT_DEFAULT_PRECIS /* output precision */
+ , CLIP_DEFAULT_PRECIS /* clipping precision */
+ , DEFAULT_QUALITY /* output quality */
+ , DEFAULT_PITCH /* pitch and family */
+ , "Terminal" ); /* typeface name */
+
+
+ if ( !fontResource.bitmapMemo )
+ { fontResource.bitmapMemo= CreateCompatibleDC( hdc ); /* Memory needed */
+ }
+
+ if ( fontResource.bitmapRaster )
+ { DeleteObject( fontResource.bitmapRaster ); /* Free rersources */
+ }
+
+ fontResource.h= h;
+ fontResource.w= w;
+
+ fontResource.bitmapRaster=
+ CreateBitmap( fontResource.w
+ , fontResource.h * 256 /* 256 chars */
+ , 1 , 1 /* Monochome bitmap */
+ , NULL ); /* font data */
+
+ fontResource.bitmapObject=
+ SelectObject( fontResource.bitmapMemo
+ , fontResource.bitmapRaster );
+ fontObject=
+ SelectObject( fontResource.bitmapMemo
+ , hFont );
+
+
+ SetBkColor ( fontResource.bitmapMemo, 0 ); // Color de fondo
+ SetTextColor( fontResource.bitmapMemo, 1 ); // Color de fondo
+
+ for( loop= 0 /* Fill in the bitmap */
+ ; loop<256
+ ; loop ++ )
+ { letra= loop; /* poiter problems */
+
+ celda.top= fontResource.h * loop;
+ celda.bottom= fontResource.h + celda.top;
+ celda.left= 0;
+ celda.right= fontResource.w;
+
+ DrawText( fontResource.bitmapMemo /* Memory device */
+ , &letra, 1
+ , &celda
+
+ , DT_NOPREFIX
+ | DT_SINGLELINE
+ | DT_BOTTOM );
+ }
+
+ TVCodePage::SetScreenCodePage( TVCodePage::PC437 );
+
+ DeleteObject( hFont ); /* Not needed yet */
+ return( 0 );
+}
+
+
+/*
+ * JASC, feb 2006, Load a mode
+ */
+
+int TDisplayWinGr::SetFontMode( bitmapFontRec & fontResource
+ , ushort newMode )
+{ const VideoModeData * ptr;
+
+ for( ptr= videoModes
+ ; ptr->mode
+ ; ptr ++ )
+ { if ( (ushort)ptr->mode == newMode )
+ { SetFontCrt( fontResource
+ , ptr->wFont /* Font height */
+ , ptr->hFont ); /* Font width */
+ }
+ }
+ return( -1 );
+}
+
+/*
+ *
+ */
+void TDisplayWinGr::lowSetCursor( int x
+ , int y
+ , bool dir )
+{ ushort * dst;
+ char fg, bg;
+ uchar letra;
+ int to, fr;
+
+ if ( THWMouseWinGr::lastCursor == sizeCursor ) /* Resizing window */
+ { return;
+ }
+
+ if ( !TScreen::screenBuffer )
+ { return;
+ }
+
+ if ( zPos ) // Cursor not visible now
+ { dir= false;
+ }
+
+ if ((unsigned) x >= (unsigned)getCols() ) // JASC, this tests both bounds
+ { return;
+ }
+
+ if ((unsigned) y >= (unsigned)getRows() ) // JASC, this tests both bounds
+ { return;
+ }
+
+ dst = TScreen::screenBuffer // Calc new cursor position
+ + x
+ + y*TScreen::screenWidth;
+
+ if ( dir )
+ { bg= attrColor(*dst) >> 4; // Swap colors (reverse)
+ fg= attrColor(*dst) & 0xF;
+ }
+ else
+ { fg= attrColor(*dst) >> 4; // Normal
+ bg= attrColor(*dst) & 0xF;
+ }
+
+ letra= attrChar( *dst );
+
+ SetBkColor ( hdc, colorMap[(int)bg] ); // Background color
+ SetTextColor( hdc, colorMap[(int)fg] ); // Foreground color
+
+ fr= dir ? cShapeFr:0;
+ to= dir ? cShapeTo:primary.h;
+
+ BitBlt( hdc
+ , x * primary.w
+ , y * primary.h + fr
+ , primary.w
+ , to - fr - 1
+ , primary.bitmapMemo
+ , 0, letra * primary.h
+ , SRCCOPY );
+
+ }
+
+
+
+/*
+ * JASC, feb 2006
+ *
+ * Those functions assure that the screen size have suitable values
+ */
+int TDisplayWinGr::CheckWindowSize( RECT & windowArea )
+{ int w= wGeo.right ;
+ int h= wGeo.bottom;
+ int recalcFlag;
+
+/*
+ * Check a reasonable minimun size
+ */
+
+ TScreen::screenWidth = TScreen::screenWidth < 10 ? 10 : TScreen::screenWidth;
+ TScreen::screenHeight= TScreen::screenHeight< 3 ? 3 : TScreen::screenHeight;
+
+ wGeo.right= TScreen::screenWidth * primary.w; /* quantize width */
+ wGeo.bottom= TScreen::screenHeight * primary.h; /* quantize height */
+
+
+ if (( wGeo.right == w ) /* No changes, all done */
+ && ( wGeo.bottom == h ))
+ { return( 0 );
+ }
+
+
+ do
+ { windowArea= wGeo; /* Desired client size and pos */
+ AdjustWindowRectEx( &windowArea /* IN/OUT variable */
+ , TScreenWinGr::style
+ , 0 /* No windows menu */
+ , TScreenWinGr::exStyle ); /* Extended styles */
+
+
+ /*
+ * Windows don´t have the same criteria in about ofsets in giving and demanding
+ */
+ windowArea.right += wGeo.left - windowArea.left;
+ windowArea.bottom+= wGeo.top - windowArea.top;
+
+ /*
+ * Check out of boundaries (Bigger than device size)
+ */
+
+ recalcFlag= 0;
+
+ if ( windowArea.right > (ushort)dmPelsWidth ) /* Too wide */
+ { TScreen::screenWidth --; /* Reduce width */
+ wGeo.right-= primary.w;
+ recalcFlag ++; /* Request a new step */
+ }
+
+ if ( windowArea.bottom > (ushort)dmPelsHeight ) /* Too tall */
+ { TScreen::screenWidth --; /* Reduce height */
+ wGeo.bottom-= primary.h; /* quantize height */
+ recalcFlag ++; /* Request a new step */
+ }
+ }
+ while( recalcFlag );
+
+ return( 1 ); /* Must be resized */
+}
+
+/*
+ *
+ */
+
+void TDisplayWinGr::winRecalc( )
+{ RECT windowArea;
+
+ if ( CheckWindowSize( windowArea ) )
+ { MoveWindow( hwnd
+ , windowArea.left
+ , windowArea.top
+ , windowArea.right
+ , windowArea.bottom
+ , true ); /* repaintin soon */
+ }
+}
+
+
+
+
+/*
+ * JASC 2002
+ *
+ * 10/3/2006 --> Draq 'n' drop support
+ */
+int TDisplayWinGr::testEvents( UINT message
+ , WPARAM wParam
+ , LPARAM lParam )
+{ PAINTSTRUCT ps; /* Also used during window drawing */
+
+ switch( message )
+ { int w, h;
+
+ case WM_DROPFILES: // JASC, mar 2006, drag 'n' drop support
+ dragDropHnd= (void *)wParam;
+ dragDropIdx= DragQueryFile( (HDROP)dragDropHnd // DragQueryFile is very overloaded
+ , 0xFFFFFFFF
+ , NULL
+ , 0 );
+
+/*
+ * JASC 2006
+ *
+ * Enable this block to make dragging a directory opens a file dialog
+ * is not a good idea since windows file manages is better
+ *
+ * if ( dragDropIdx == 1 ) // Test posibility of a directory
+ * { DragQueryFile( (HDROP)dragDropHnd // DragQueryFile is very overloaded
+ * , 1
+ * , dragDropName
+ * , sizeof( dragDropName ));
+ *
+ * if ( GetFileAttributes( dragDropName ) & FILE_ATTRIBUTE_DIRECTORY )
+ * { dragDropIdx= -1; // Mark as directory
+ * }
+ * }
+ */
+ return( 7 );
+
+ case WM_PASTE:
+ Beep();
+ return( 1 );
+
+ case WM_QUIT:
+ storedEvent.what= evCommand;
+ storedEvent.message.command= cmQuit;
+ DestroyWindow( hwnd );
+ return( 1 );
+
+ case WM_DESTROY: /* send a WM_QUIT to the messagequeue */
+ PostQuitMessage(0);
+ exit( 0 );
+
+ case WM_MOVE: /* Catch the window position */
+ wGeo.left= LOWORD( lParam );
+ wGeo.top = HIWORD( lParam );
+ return( 0 );
+
+ case WM_SIZE:
+ sizeChanged++;
+ if ( primary.w )
+ { switch( wParam )
+ { case SIZE_MINIMIZED:
+ return(0);
+
+ case SIZE_RESTORED:
+ if ( !lParam )
+ { return( 1 );
+ }
+
+ case SIZE_MAXIMIZED:
+ w= LOWORD( lParam ); /* JASC, Integer aritmetics */
+ h= HIWORD( lParam ); /* JASC, Integer aritmetics */
+
+ w+= primary.w / 2; h+= primary.h / 2; /* quantize (nearest) */
+ w/= primary.w ; h/= primary.h ;
+
+ TScreen::screenWidth = w < 0x100 ? w : 0xFF; /* TScreen::screenWidth is a uchar !!! */
+ TScreen::screenHeight= h < 0x100 ? h : 0xFF; /* TScreen::screenHeight is a uchar !!! */
+ winRecalc();
+ break;
+ }
+ }
+ return( 4 );
+
+ case WM_PAINT: /* The window needs to be painted (redrawn). */
+ BeginPaint( hwnd, &ps );
+
+ if ( !sizeChanged ) /* if size changed, later repainting. crash repaninting now */
+ { if ( TScreen::screenBuffer )
+ { int x= ps.rcPaint.left / primary.w;
+ int y= ps.rcPaint.top / primary.h;
+ int w= ps.rcPaint.right / primary.w;
+ int h= ps.rcPaint.bottom/ primary.h;
+
+ w-= x; h -= y;
+
+ unsigned ofs= getCols()*y+x;
+ ushort *src= TScreen::screenBuffer+ofs;
+
+ forceRedraw++ ;
+
+ while (h>=0)
+ { TScreen::setCharacters( ofs
+ , src
+ , w+1 );
+ src+= getCols(); /* Next line */
+ ofs+= getCols();
+ h --; y ++; /* A line minus left */
+ }
+ }
+ }
+
+ forceRedraw= 0;
+ EndPaint( hwnd, &ps );
+ return( 5 );
+ }
+
+ return( 0 ); /* for messages that we don't deal with */
+}
+
+
+/*
+ *
+ */
+LRESULT CALLBACK WindowProcedure( HWND hwnd /* This function is called by the Windowsfunction DispatchMessage( ) */
+ , UINT message
+ , WPARAM wParam
+ , LPARAM lParam )
+{ int res;
+
+ if ( THWMouseWinGr::hwnd )
+
+ { if ( TDisplayWinGr::primary.h ) /* Cells on screen */
+ { if ( THWMouseWinGr::testEvents( message /* Try for mouse envens */
+ , wParam
+ , lParam ))
+ { return( 0 ); /* Mouse event found */
+ }
+ }
+
+
+ if ( TGKeyWinGr::testEvents( message /* Try for key envens */
+ , wParam
+ , lParam ))
+ { return( 0 ); /* Key event found */
+ }
+
+
+ if ( TDisplayWinGr::testEvents( message /* Try another interesting envents */
+ , wParam
+ , lParam ))
+ { return( 0 ); /* Interesting event found */
+ }
+ }
+
+ res= DefWindowProc( hwnd // Other events must be forwardwed
+ , message
+ , wParam
+ , lParam );
+/*
+ * JASC, from WIN32 app reference:
+ *
+ * Threads that do not contain windows should use the Sleep function
+ * with a sleep time of zero milliseconds
+ * to give up the remainder of their current time slice.
+ */
+
+
+ return( res );
+
+}
+
+/*
+ * JASC 2002
+ *
+ * Main windows queue
+ *
+ * first feeds drag 'n' drop files to the caller
+ * Processes windows messages
+ * releases CPU inan adaptative way.
+ *
+ */
+
+
+bool TDisplayWinGr::processEvent( )
+{ static int timer= 1;
+
+ MSG message; /* Here messages to the application is saved */
+
+ switch ( dragDropIdx ) // Pending drag ´n´ drop
+ { case 0: break;
+/*
+ * For dragging directories, not a good idea
+ * case -1:
+ * SetCurrentDirectory( dragDropName );
+ * storedEvent.what= evCommand;
+ * storedEvent.message.command= cmOpen; // Use this old editor command
+ * storedEvent.message.infoPtr= NULL; // Opens a file dialog
+ * dragDropIdx= 0;
+ * return( true );
+ */
+ default:
+ storedEvent.what= evCommand;
+ storedEvent.message.command= cmOpen; // Use this old editor command
+ storedEvent.message.infoPtr= dragDropName; // Point to the file name
+
+ DragQueryFile( (HDROP)dragDropHnd // Load name
+ , -- dragDropIdx
+ , dragDropName
+ , sizeof( dragDropName ));
+
+ if ( GetFileAttributes( dragDropName )
+ & ( FILE_ATTRIBUTE_DIRECTORY
+ | FILE_ATTRIBUTE_TEMPORARY
+ | FILE_ATTRIBUTE_OFFLINE ))
+ { storedEvent.what= evNothing;
+ }
+
+ if ( !dragDropIdx ) // Free resources last time
+ { DragFinish( (HDROP) dragDropHnd );
+ dragDropHnd= 0;
+ }
+ return( true );
+ }
+
+ if ( timer > 100 ) // Adaptative timer
+ { timer= 100 ;
+ }
+
+ if ( MsgWaitForMultipleObjects
+ ( 0 // Handles in the object array
+ , NULL // Handle array
+ , false // D'ont care
+ , timer ++
+ , QS_ALLINPUT ) == WAIT_OBJECT_0 ) // Wait for every message
+ { if ( GetMessage( &message
+ , NULL // Default window
+ , 0, 0 )) // All messages
+ switch( message.message ) // Catch some keys
+ { case WM_KEYUP:
+ case WM_KEYDOWN:
+ TGKeyWinGr::testEvents( message.message /* Try for key envens */
+ , message.wParam
+ , message.lParam );
+ }
+
+ if ( message.message != WM_TIMER )
+ { timer= 0; /* Reset adaptative counter */
+ }
+
+ TranslateMessage( &message ); /* Arrange key events */
+ DispatchMessage ( &message ); /* Send message to WindowProcedure */
+ return( true );
+ }
+ return( false );
+}
+
+
+/*
+ * JASC, jul 2002
+ *
+ */
+void TDisplayWinGr::SetCursorPos( unsigned x
+ , unsigned y )
+{ if (( x != (unsigned)xPos )
+ || ( y != (unsigned)yPos ))
+ { lowSetCursor( xPos // Remove old cursor
+ , yPos
+ , false );
+ }
+
+ xPos= x; yPos= y; // Update cursor position
+ lowSetCursor( x
+ , y
+ , true );
+ }
+
+/*
+ *
+ */
+void TDisplayWinGr::GetCursorPos( unsigned & x
+ , unsigned & y )
+{ x= xPos;
+ y= yPos;
+}
+
+
+/*
+ *
+ */
+ void TDisplayWinGr::GetCursorShape( unsigned & start // From SET code
+ , unsigned & end )
+{ start= cShapeFr; start*= 100; start/= primary.h; // Force integer aritmethic
+ end = cShapeTo; end *= 100; end /= primary.h;
+}
+
+
+/*
+ *
+ */
+void TDisplayWinGr::SetCursorShape( unsigned start // From SET code
+ , unsigned end )
+{ lowSetCursor( xPos // First of all, remove old cursor
+ , yPos
+ , false );
+
+ cShapeFr= ( start*primary.h ) / 100; // Force integer aritmethic
+ cShapeTo= ( end*primary.h ) / 100;
+
+ if ( start>=end && getShowCursorEver() )
+ { return;
+ }
+
+ if ((unsigned)cShapeFr > (unsigned)primary.h ) // Pretty range test ( 1 test 2 comprobations )
+ { cShapeFr= primary.h;
+ }
+
+ if ((unsigned)cShapeTo > (unsigned)primary.h ) // Pretty range test ( 1 test 2 comprobations )
+ { cShapeTo= primary.h;
+ }
+
+ if ( start >= end )
+ { zPos |= 1; /* Disable cursor */
+ }
+ else
+ { zPos &= ~1;
+ }
+
+ lowSetCursor( xPos
+ , yPos
+ , true );
+}
+
+
+/*
+ *
+ */
+ushort TDisplayWinGr::GetRows()
+{ return( TScreen::screenHeight );
+}
+
+/*
+ *
+ */
+ushort TDisplayWinGr::GetCols()
+{ return( TScreen::screenWidth );
+}
+
+
+/*
+ *
+ */
+int TDisplayWinGr::CheckForWindowSize()
+{ int ret= sizeChanged;
+
+ sizeChanged= 0;
+ return( ret );
+}
+
+/*
+ * Retrieves window manager window title
+ */
+const char * TDisplayWinGr::GetWindowTitle(void)
+{ static char buff[ maxTitleSize ];
+
+ GetWindowText( hwnd
+ , buff
+ , sizeof( buff) );
+
+ return( buff );}
+
+
+/*
+ * Window manager window title
+ */
+int TDisplayWinGr::SetWindowTitle( const char *name )
+{ SetWindowText( hwnd
+ , name );
+
+ return(0);
+}
+
+
+/*
+ * Returns hardware video mode
+ */
+ushort TDisplayWinGr::GetCrtMode()
+{ return( TScreen::screenMode );
+}
+
+
+/*
+ * JASC, feb 2006
+ *
+ * Emulates harware crt mode
+ *
+ * The CRT mode controls three ortogonaly arranged hardware properties,
+ * colors, font size, and screen resolution, but the interface only takes one.
+ * As a solution, the tree "colored" modes ( BW80, CO80 and Mono )
+ * can change the color (and put a standard font if no one), the other modes
+ * manage the font and display size in fixed steps, and the user change to
+ * other window sizes.
+ *
+ */
+void TDisplayWinGr::SetCrtMode( ushort newMode )
+{ const VideoModeData * ptr;
+
+ SetCursorShape(0x58,0x64);
+
+ if ( newMode == 0xFFFF )
+ { return;
+ }
+
+ switch ( newMode )
+ { case smBW80: /* SET fonts */
+ case smCO80:
+ case smMono:
+ if ( !TScreenWinGr::screenWidth ) /* Respect previous changes */
+ { TScreenWinGr::screenWidth= 80;
+ }
+
+ if ( !TScreenWinGr::screenHeight )
+ { TScreenWinGr::screenHeight= 25;
+ }
+
+ if ( !TScreenWinGr::screenMode )
+ { selectFont( primary, TScreenWinGr::defaultFont );
+ selectFont( secondary, TScreenWinGr::defaultFont );
+ }
+
+ TScreen::screenMode= newMode;
+ break;
+
+ default: /* Windows fonts */
+ SetFontMode( primary, newMode );
+ SetFontMode( secondary, newMode );
+
+ for( ptr= videoModes
+ ; ptr->mode
+ ; ptr ++ )
+ { if ( (ushort)ptr->mode == newMode )
+ { TScreenWinGr::screenWidth= ptr->wScreen;
+ TScreenWinGr::screenHeight= ptr->hScreen;
+ }
+ }
+ break;
+ }
+ sizeChanged++;
+}
+
+/*
+ * Try to find a suitable font
+ */
+typedef struct
+{ LONG minError; /* Keeps track of the more adjusted font */
+ LONG desiredW; /* The size we are locking for */
+ LONG desiredH;
+ ushort fontW; /* More adjusted font size */
+ ushort fontH;
+} fontData;
+
+
+int CALLBACK checkFonts( const LOGFONTA * lplf // address of logical-font data structure
+ , const TEXTMETRIC * lpntm // address of physical-font data structure
+ , long unsigned int // type of font
+ , LPARAM lpData ) // address of application-defined data
+{ fontData * data= (fontData *) lpData;
+
+ if ( lplf->lfItalic ) // No italics (bad box drawings)
+ { return( 2 );
+ }
+
+ if ( lplf->lfUnderline ) // No underlines (evident)
+ { return( 3 );
+ }
+
+ if ( lpntm->tmPitchAndFamily // Only fixed width
+ & TMPF_FIXED_PITCH )
+ { return( 4 );
+ }
+
+/*
+ * Estimate the average error as sum of sqares
+ */
+ int ew= lpntm->tmMaxCharWidth - data->desiredW; ew *= ew;
+ int eh= lpntm->tmHeight - data->desiredH; eh *= eh;
+
+ long error= ew + eh;
+
+ TDisplayWinGr::foWmin= lpntm->tmMaxCharWidth
+ < TDisplayWinGr::foWmin
+ ? lpntm->tmMaxCharWidth
+ : TDisplayWinGr::foWmin;
+
+ TDisplayWinGr::foWmax= lpntm->tmMaxCharWidth
+ > TDisplayWinGr::foWmax
+ ? lpntm->tmMaxCharWidth
+ : TDisplayWinGr::foWmax;
+
+ TDisplayWinGr::foHmin= lpntm->tmHeight
+ < TDisplayWinGr::foHmin
+ ? lpntm->tmHeight
+ : TDisplayWinGr::foHmin;
+
+ TDisplayWinGr::foHmax= lpntm->tmHeight
+ > TDisplayWinGr::foHmax
+ ? lpntm->tmHeight
+ : TDisplayWinGr::foHmax;
+
+ if ( error < data->minError )
+ { data->minError= error;
+ data->fontW = lpntm->tmMaxCharWidth;
+ data->fontH = lpntm->tmHeight;
+ }
+
+ return( 1 /* error */ ); /* rerunrning "error" stops if the font matchs */
+}
+
+
+/*
+ *
+ *
+ */
+int TDisplayWinGr::SetCrtModeRes( unsigned fW
+ , unsigned fH )
+{ fontData suitable;
+
+ suitable.minError= 0x7FFF;
+ suitable.desiredW= fW;
+ suitable.desiredH= fH;
+
+ EnumFontFamilies( hdc /* Iterate font list */
+ , "Terminal"
+ , checkFonts
+ , (LPARAM)&suitable );
+
+ if (( fW == 8 ) && ( fH == 16 ))
+ { selectFont( primary, &TDisplayWinGr::font8x16 );
+ selectFont( secondary, &TDisplayWinGr::font8x16 );
+ return( 1 );
+ }
+
+ if (( fW == 10 ) && ( fH == 20 ))
+ { selectFont( primary, &TDisplayWinGr::font10x20 );
+ selectFont( secondary, &TDisplayWinGr::font10x20 );
+ return( 1 );
+ }
+
+ SetFontCrt( primary, suitable.fontW, suitable.fontH );
+ SetFontCrt( secondary, suitable.fontW, suitable.fontH );
+
+ sizeChanged++;
+ return( 0 );
+}
+
+/*
+ *
+ *
+ */
+void TDisplayWinGr::TestAllFonts( unsigned fW
+ , unsigned fH )
+
+{ fontData suitable;
+
+ HDC hdc= CreateIC( "DISPLAY"
+ , ""
+ , NULL
+ , NULL );
+
+ suitable.minError= 0x7FFF;
+ suitable.desiredW= fW;
+ suitable.desiredH= fH;
+
+ EnumFontFamilies( hdc /* Iterate font list */
+ , "Terminal"
+ , checkFonts
+ , (LPARAM)&suitable );
+ DeleteDC( hdc ); /* Free resources */
+
+ if (( fW == 8 ) && ( fH == 16 ))
+ { primary.w= secondary.w= fW;
+ primary.h= secondary.h= fH;
+ return;
+ }
+
+ if (( fW == 10 ) && ( fH == 20 ))
+ { primary.w= secondary.w= fW;
+ primary.h= secondary.h= fH;
+ return;
+ }
+
+ primary.w= secondary.w= suitable.fontW; /* Best fitting */
+ primary.h= secondary.h= suitable.fontH;
+}
+
+
+/*
+ * Free resources
+ */
+TDisplayWinGr::~TDisplayWinGr()
+{
+}
+
+/*
+ * Tries a beep in the sound card. If not, the speaker !!!
+ */
+void TDisplayWinGr::Beep()
+{ MessageBeep(0xFFFFFFFF);
+}
+
+/*
+ * Links funnction pointers
+ */
+void TDisplayWinGr::Init()
+{ getRows= GetRows;
+ getCols= GetCols;
+ setCrtMode= SetCrtMode;
+ getCrtMode= GetCrtMode;
+ setCursorPos= SetCursorPos;
+ getCursorPos= GetCursorPos;
+ setWindowTitle= SetWindowTitle;
+ getWindowTitle= GetWindowTitle;
+ getCursorShape= GetCursorShape;
+ setCursorShape= SetCursorShape;
+ checkForWindowSize= CheckForWindowSize;
+ beep= Beep;
+
+// TProgram::doNotReleaseCPU= true; // annoys windows loop, implemented here
+
+}
+
+
+#else
+
+#include <tv/wingr/screen.h>
+#include <tv/wingr/key.h>
+#include <tv/wingr/mouse.h>
+
+#endif // TVOS_Win32
+
+
diff --git a/tvision/classes/wingr/wingrkey.cc b/tvision/classes/wingr/wingrkey.cc
new file mode 100644
index 0000000..16a9fa3
--- /dev/null
+++ b/tvision/classes/wingr/wingrkey.cc
@@ -0,0 +1,517 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Jose Angel Sanchez Caso (JASC)
+
+ Covered by the GPL license.
+
+ It said:
+
+ Console code based on code by Vadim Beloborodov
+ Squeleton based on code by Salvador E. Tropea (SET) (c) (1998)
+ windows GUI code by Jose Angel Sanchez Caso (JASC).
+
+ Description:
+ Windows Keyboard routines.
+
+***************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_ctype
+#define Uses_string
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_TVCodePage
+#include <tv.h>
+
+#if defined(TVOS_Win32) && !defined(TV_Disable_WinGr_Driver)
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/wingr/screen.h>
+#include <tv/wingr/key.h>
+#include <tv/wingr/mouse.h>
+
+/* else
+ sprintf( buff
+ , " SHIFT %u"
+ " CHARCODE %u"
+ " KEYCODE %u"
+ " SCANCODE %u "
+ , keyMask
+ , storedEvent.keyDown.charScan.charCode
+ , storedEvent.keyDown.keyCode
+ , storedEvent.keyDown.charScan.scanCode );
+
+ TScreenWinGr::writeLine( 1
+ , 7
+ , strlen(buff)
+ , buff
+ , 0xF1 );
+ {
+ sprintf( buff
+ , " CHAR keycode: %d charcode: %d scancode: %d mask %d"
+ , storedEvent.keyDown.keyCode
+ , storedEvent.keyDown.charScan.charCode
+ , storedEvent.keyDown.charScan.scanCode
+ , storedEvent.keyDown.shiftState);
+
+ TScreenWindows::writeLine( 1
+ , 3
+ , strlen(buff)
+ , buff
+ , 0xF1 ); }
+ static int rt= 0;
+ char buff[512];
+
+ */
+
+/*
+ * Translate keyboard events to Salvador E. Tropea's key codes
+ * by Vadim Beloborodov
+ * Originally in trans.cc
+ */
+
+ushort TGKeyWinGr::keyMask= 0;
+CodePage * TGKeyWinGr::remapKey= NULL; // Multilingual keyboard support
+
+
+
+/*
+ * JASC, not implemented key codes ( may be in future )
+ *
+ * VK_LBUTTON ( 1)
+ * VK_MBUTTON ( 4)
+ * VK_RBUTTON ( 2)
+ * VK_F13 (124)
+ * VK_F14 (125)
+ * VK_F15 (126)
+ * VK_F16 (127)
+ * VK_F17 (128)
+ * VK_F18 (129)
+ * VK_F19 (130)
+ * VK_F20 (131)
+ * VK_F21 (132)
+ * VK_F22 (133)
+ * VK_F23 (134)
+ * VK_F24 (135)
+ *
+ * VK_CANCEL ( 3)
+ * VK_CLEAR ( 12)
+ * VK_PAUSE ( 19)
+ * VK_SELECT ( 41)
+ * VK_EXECUTE ( 43)
+ * VK_SNAPSHOT ( 44)
+ * VK_HELP ( 47)
+ *
+ * kbWinLeft = 0x0063
+ * kbWinRight= 0x0064
+ * kbWinSel = 0x0065
+ *
+ *
+ * , { '{' , kbOpenCurly , '{', 0 } 0x005f
+ * , { '|' , kbOr , '|', 0 } 0x005d
+ * , { '}' , kbCloseCurly , '}', 0 } 0x0060
+ * , { '~' , kbTilde , '~', 0 } 0x0061
+ * , { '' , kbMacro , '', 0 }
+ * , { 'Ç' , kbBackSpace , 'Ç', 0 }
+ *, { '!' , kbAdmid , '!', 0 } 0x0050
+ *, { '"' , kbDobleQuote , '"', 0 } 0x0051
+ *, { '#' , kbNumeral , '#', 0 } 0x0052
+ * , { '$' , kbDolar , '$', 0 } 0x0053
+ * , { '%' , kbPercent , '%', 0 } 0x0054
+ * , { '&' , kbAmper , '&', 0 } 0x0055
+ * , { '\'' , kbQuote , '\'', 0} 0x002e
+ * , { '(' , kbOpenPar , '(', 0 } 0x0056
+ * , { ')' , kbClosePar , ')', 0 } 0x0057
+ * , { ':' , kbDoubleDot , ':', 0 } 0x0058
+ * , { ';' , kbColon , ';', 0 } 0x002d
+ * , { '<' , kbLessThan , '<', 0 } 0x0059
+ * , { '=' , kbEqual , '=', 0 } 0x0038
+ * , { '>' , kbGreaterThan, '>', 0 } 0x005a
+ * , { '?' , kbQuestion , '?', 0 } 0x005b
+ * , { '@' , kbA_Roba , '@', 0 } 0x005c
+
+ * , { '[' , kbOpenBrace , '[', 0 } 0x001B
+ * , { ']' , kbCloseBrace , ']', 0 } 0x001D
+ * , { '^' , kbCaret , '^', 0 } 0x004f
+ * , { '_' , kbUnderLine , '_', 0 } 0x005e */
+
+/*, { '0' , kb0 , '0', 0x45 }
+, { '1' , kb1 , '1', 0x16 }
+, { '2' , kb2 , '2', 0x1E }
+, { '3' , kb3 , '3', 0x26 }
+, { '4' , kb4 , '4', 0x25 }
+, { '5' , kb5 , '5', 0x2E }
+, { '6' , kb6 , '6', 0x36 }
+, { '7' , kb7 , '7', 0x3D }
+, { '8' , kb8 , '8', 0x3E }
+, { '9' , kb9 , '9', 0x46 }
+, { VK_NUMPAD0 , kb0 , '0', 0x70 }
+, { VK_NUMPAD1 , kb1 , '1', 0x69 }
+, { VK_NUMPAD2 , kb2 , '2', 0x72 }
+, { VK_NUMPAD3 , kb3 , '3', 0x7A }
+, { VK_NUMPAD4 , kb4 , '4', 0x6B }
+, { VK_NUMPAD5 , kb5 , '5', 0x73 }
+, { VK_NUMPAD6 , kb6 , '6', 0x74 }
+, { VK_NUMPAD7 , kb7 , '7', 0x6C }
+, { VK_NUMPAD8 , kb8 , '8', 0x75 }
+, { VK_NUMPAD9 , kb9 , '9', 0x7D }
+
+, { 'A' , kbA , 'A', 0x1C }
+, { 'B' , kbB , 'B', 0x32 }
+, { 'C' , kbC , 'C', 0x21 }
+, { 'D' , kbD , 'D', 0x23 }
+, { 'E' , kbE , 'E', 0x24 }
+, { 'F' , kbF , 'F', 0x2B }
+, { 'G' , kbG , 'G', 0x34 }
+, { 'H' , kbH , 'H', 0x33 }
+, { 'I' , kbI , 'I', 0x43 }
+, { 'J' , kbJ , 'J', 0x3B }
+, { 'K' , kbK , 'K', 0x42 }
+, { 'L' , kbL , 'L', 0x4B }
+, { 'M' , kbM , 'M', 0x3A }
+, { 'N' , kbM , 'N', 0x31 }
+, { 'O' , kbO , 'O', 0x44 }
+, { 'P' , kbP , 'P', 0x4D }
+, { 'Q' , kbQ , 'Q', 0x15 }
+, { 'R' , kbR , 'R', 0x2D }
+, { 'S' , kbS , 'S', 0x1B }
+, { 'T' , kbT , 'T', 0x2C }
+, { 'U' , kbU , 'U', 0x3C }
+, { 'V' , kbV , 'V', 0x2A }
+, { 'W' , kbW , 'W', 0x1D }
+, { 'X' , kbX , 'X', 0x22 }
+, { 'Y' , kbY , 'Y', 0x35 }
+, { 'Z' , kbZ , 'Z', 0x1A }
+{ VK_SPACE , kbSpace , ' ', 0x29 }
+//, { VK_MULTIPLY , kbAsterisk , '*', 0 }
+//, { VK_ADD , kbPlus , '+', 0 }
+//, { VK_SEPARATOR, kbBackSlash , ',', 0 }
+//, { VK_SUBTRACT , kbMinus , '-', 0 }
+//, { VK_DECIMAL , kbGrave , '.', 0 }
+//, { VK_DIVIDE , kbSlash , '/', 0 }
+//, { VK_SEPARATOR, kbBackSlash , '\\', 0}
+//, { VK_DECIMAL , kbGrave , '`', 0 }
+
+ */
+
+
+ConvKeyRec xlateTableKeys[]=
+{{ ' ' , kbSpace }
+,{ VK_UP , kbUp } /* Move up, up arrow */
+,{ VK_ESCAPE , kbEsc }
+,{ VK_TAB , kbTab }
+,{ VK_HOME , kbHome }
+,{ VK_END , kbEnd } /* EOL */
+,{ VK_LEFT , kbLeft } /* Move left, left arrow */
+,{ VK_RIGHT , kbRight } /* Move right, right arrow */
+,{ VK_UP , kbUp } /* Move down, down arrow */
+,{ VK_DOWN , kbDown } /* Move down, down arrow */
+,{ VK_PRIOR , kbPgUp }
+,{ VK_NEXT , kbPgDn }
+,{ VK_RETURN , kbEnter } /* Return, enter */
+,{ VK_PAUSE , kbPause } /* Pause, hold */
+,{ VK_DELETE , kbDelete } /* Delete, rubout */
+,{ VK_INSERT , kbInsert } /* Insert, insert here */
+,{ VK_PRINT , kbPrnScr }
+,{ VK_BACK , kbBackSpace } /* back space, back char */
+
+,{ VK_F1 , kbF1 }
+,{ VK_F2 , kbF2 }
+,{ VK_F3 , kbF3 }
+,{ VK_F4 , kbF4 }
+,{ VK_F5 , kbF5 }
+,{ VK_F6 , kbF6 }
+,{ VK_F7 , kbF7 }
+,{ VK_F8 , kbF8 }
+,{ VK_F9 , kbF9 }
+,{ VK_F10 , kbF10 }
+,{ VK_F11 , kbF11 }
+,{ VK_F12 , kbF12 }
+,{ 0 , 0 }}; /* Terminator */
+
+ConvKeyRec xlateTableChars[]=
+{{ ' ' , kbSpace }
+,{ '0' , kb0 }
+,{ '1' , kb1 }
+,{ '2' , kb2 }
+,{ '3' , kb3 }
+,{ '4' , kb4 }
+,{ '5' , kb5 }
+,{ '6' , kb6 }
+,{ '7' , kb7 }
+,{ '8' , kb8 }
+,{ '9' , kb9 }
+,{ 'A' , kbA }
+,{ 'B' , kbB }
+,{ 'C' , kbC }
+,{ 'D' , kbD }
+,{ 'E' , kbE }
+,{ 'F' , kbF }
+,{ 'G' , kbG }
+,{ 'H' , kbH }
+,{ 'I' , kbI }
+,{ 'J' , kbJ }
+,{ 'K' , kbK }
+,{ 'L' , kbL }
+,{ 'M' , kbM }
+,{ 'N' , kbM }
+,{ 'O' , kbO }
+,{ 'P' , kbP }
+,{ 'Q' , kbQ }
+,{ 'R' , kbR }
+,{ 'S' , kbS }
+,{ 'T' , kbT }
+,{ 'U' , kbU }
+,{ 'V' , kbV }
+,{ 'W' , kbW }
+,{ 'X' , kbX }
+,{ 'Y' , kbY }
+,{ 'Z' , kbZ }
+,{ 0 , 0 }}; /* Terminator */
+
+
+/*
+ * Driver entry, tells caller last know shift state
+ *
+ *
+ * those are not totally implemeted on TVISION
+ *
+ *
+ * GetKeyState( VK_CAPITAL ) & TOGGLED_KEY ? kbCapsLockToggle : 0
+ * GetKeyState( VK_INSERT ) & TOGGLED_KEY ? kbInsertToggle : 0
+ *
+ * GetKeyState( VK_SCROLL ) & PRESSED_KEY ? kbScrollLockDown : 0
+ * GetKeyState( VK_CAPITAL ) & PRESSED_KEY ? kbCapsLockDown : 0
+ * GetKeyState( VK_NUMLOCK ) & PRESSED_KEY ? kbNumLockDown : 0
+ * GetKeyState( VK_SNAPSHOT ) & PRESSED_KEY ? kbSysReqPress : 0
+ *
+ * GetKeyState( VK_SCROLL ) & TOGGLED_KEY ? kbScrollLockToggle : 0
+ *
+ * GetKeyState( VK_NUMLOCK ) & TOGGLED_KEY ? kbNumLockToggle : 0
+ */
+
+
+#define TOGGLED_KEY 0x01 /* The key is toggled */
+#define PRESSED_KEY 0x80 /* The key is pressed */
+
+unsigned TGKeyWinGr::GetShiftState()
+{ return( keyMask );
+}
+
+
+int TGKeyWinGr::setKey( const ConvKeyRec * xlate
+ , int vcode )
+{ const ConvKeyRec * ptr;
+
+ for( ptr= xlate /* Scan the special key table */
+ ; ptr->win
+ ; ptr++ )
+ { if (ptr->win == vcode )
+ { storedEvent.what= evKeyDown;
+ storedEvent.keyDown.keyCode= ptr->key | keyMask;
+ storedEvent.keyDown.charScan.charCode= 0;
+ return( vcode );
+ }
+ }
+ return(0);
+}
+
+#include <stdio.h>
+
+/*
+ *
+ */
+int TGKeyWinGr::testEvents( UINT message
+ , WPARAM wParam
+ , LPARAM lParam )
+{ storedEvent.what= evNothing;
+
+ switch( message )
+ { case WM_CHAR:
+ case WM_KEYDOWN:
+ case WM_SYSCHAR:
+ case WM_SYSKEYDOWN:
+ keyMask= /* Adapt keymask to TVISION */
+ (( GetKeyState( VK_LSHIFT ) & PRESSED_KEY ? kbShiftCode : 0 )
+ |( GetKeyState( VK_RSHIFT ) & PRESSED_KEY ? kbShiftCode : 0 )
+ |( GetKeyState( VK_SHIFT ) & PRESSED_KEY ? kbShiftCode : 0 )
+ |( GetKeyState( VK_LCONTROL) & PRESSED_KEY ? kbCtrlCode : 0 )
+ |( GetKeyState( VK_RCONTROL) & PRESSED_KEY ? kbCtrlCode : 0 )
+ |( GetKeyState( VK_CONTROL ) & PRESSED_KEY ? kbCtrlCode : 0 )
+ |( GetKeyState( VK_LMENU ) & PRESSED_KEY ? kbAltLCode : 0 )
+ |( GetKeyState( VK_RMENU ) & PRESSED_KEY ? kbAltRCode : 0 ));
+
+ if ( keyMask & kbAltRCode )
+ { keyMask&= ~kbCtrlCode;
+ }
+ storedEvent.keyDown.shiftState= keyMask;
+ storedEvent.keyDown.charScan.scanCode=
+ storedEvent.keyDown.raw_scanCode= ( lParam >> 16 ) & 0xFF;
+ }
+
+
+ switch( message )
+ { case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+
+ if ( keyMask ) /* key + alt or ctrl */
+ { if ( setKey( xlateTableChars
+ , wParam ))
+ { return( 1 );
+ }
+ }
+
+ if ( setKey( xlateTableKeys
+ , wParam ))
+ { if ( keyMask & kbAltRCode ) // Emulate alt for system keys
+ { keyMask &= ~kbAltRCode;
+ storedEvent.keyDown.keyCode&= ~kbAltRCode;
+ keyMask |= kbAltLCode;
+ storedEvent.keyDown.keyCode|= kbAltLCode;
+ }
+ else
+ { if ( keyMask & kbAltLCode ) // Windows event ?
+ { storedEvent.what= evNothing; // Give event to win
+ return( 0 );
+ }
+ }
+
+ return( 1 ); /* good event */
+ }
+ break;
+
+ case WM_SYSCHAR: /* (fixme) Block windows system keys, fix: not all of then must be blocked */
+ return( 1 );
+
+ case WM_CHAR:
+ if( wParam >= 32 )
+ { storedEvent.what= evKeyDown;
+ storedEvent.keyDown.charScan.charCode= wParam;
+ storedEvent.keyDown.keyCode= storedEvent.keyDown.shiftState;
+ }
+
+/* if ( remapKey )
+ { if ( wParam>127 )
+ { storedEvent.keyDown.charScan.charCode= remapKey->Font[ wParam - 128 ];
+ }
+ }
+ */
+ return( 2 ); /* good event */
+
+ }
+
+ return(0);
+}
+
+
+
+/*
+ *
+ */
+
+int TGKeyWinGr::KbHit(void)
+{ do
+ {
+ switch( storedEvent.what ) /* Is there a previous event? */
+ { case evCommand: /* Windows says "exit" */
+ case evKeyDown: /* Key event pending */
+ return( evKeyDown ); /* There is a key event waiting */
+
+ case evMouseUp:
+ case evMouseDown:
+ case evMouseMove:
+ return( evMouseDown );
+ } /* Not strictily necessary, but I do */
+ }
+ while ( processEvent() ); /* Swallow new events */
+
+ return(0); } /* No events on queue */
+
+
+/*
+ *
+ */
+
+void TGKeyWinGr::FillTEvent( TEvent &me )
+{ me.what= evNothing; /* The default is no message */
+
+ do
+ { switch( storedEvent.what ) /* Is there a previous event? */
+ { case evCommand: /* Windows says "exit" */
+ case evKeyDown: /* Key event pending */
+ me= storedEvent; /* Give stored event */
+ storedEvent.what= evNothing; /* Mark events exhausted */
+
+ case evMouseUp:
+ case evMouseDown:
+ case evMouseMove:
+ return; /* All done, exit function */
+ }
+ }
+ while ( processEvent() ); /* Swallow new events */
+}
+
+
+/* ------------------------------------------------------------------------- */
+ void TGKeyWinGr::init( )
+/* ------------------------------------------------------------------------- */
+{ TGKey::kbhit= KbHit;
+ TGKey::fillTEvent= FillTEvent;
+ TGKey::getShiftState= GetShiftState;
+
+/*
+ * JASC, whe need a lot of work here since codepage returned by
+ * GetOEMCP() doesnot match TV codesymbols. only ISO8879_1 tested.
+ * if your keyboard provides another mapping, choice one from
+ * available in codepage.cc, test and publish to rhide mailing list o to me
+ * (jasanchez@polar.es or tachungo@yahoo.es )
+ */
+
+ switch ( GetOEMCP() )
+ { case 737: remapKey= &stPC737; break; // Greek (formerly 437G)
+ case 775: remapKey= &stPC775; break; // Baltic
+ case 850: remapKey= &ISO8879_1; break; // MS-DOS Multilingual (Latin I) ( JASC, only this is tested )
+ case 852: remapKey= &stPC852; break; // MS-DOS Slavic (Latin II)
+ case 855: remapKey= &stPC855; break; // IBM Cyrillic (primarily Russian)
+ case 857: remapKey= &stPC857; break; // IBM Turkish
+ case 860: remapKey= &stPC860; break; // MS-DOS Portuguese
+ case 861: remapKey= &stPC861; break; // MS-DOS Icelandic
+ case 863: remapKey= &stPC863; break; // MS-DOS Canadian-French
+ case 865: remapKey= &stPC865; break; // MS-DOS Nordic
+ case 866: remapKey= &stPC866; break; // MS-DOS Russian (former USSR)
+ case 869: remapKey= &stPC869; break; // IBM Modern Greek
+
+
+/*
+ * Not supported by SET's code pagger
+ */
+ case 708: // Arabic (ASMO 708)
+ case 709: // Arabic (ASMO 449+, BCON V4)
+ case 710: // Arabic (Transparent Arabic)
+ case 720: // Arabic (Transparent ASMO)
+ case 862: // Hebrew
+ case 864: // Arabic
+ case 874: // Thai
+ case 932: // Japan
+ case 936: // Chinese (PRC, Singapore)
+ case 949: // Korean
+ case 950: // Chinese (Taiwan, Hong Kong)
+ case 1361: // Korean (Johab)
+
+ case 437: remapKey= NULL; }} // MS-DOS United States, native format
+
+
+#else
+
+#include <tv/wingr/screen.h>
+#include <tv/wingr/key.h>
+#include <tv/wingr/mouse.h>
+
+#endif // TVOS_Win32
+
diff --git a/tvision/classes/wingr/wingrmouse.cc b/tvision/classes/wingr/wingrmouse.cc
new file mode 100644
index 0000000..3cd860e
--- /dev/null
+++ b/tvision/classes/wingr/wingrmouse.cc
@@ -0,0 +1,188 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Jose Angel Sanchez Caso (JASC)
+
+ Covered by the GPL license.
+
+ Squeletons and modeling by Salvador E. Tropea (SET) (c) (1998)
+
+ THWindows mouse stuff.
+
+*****************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_TGKey
+#define Uses_TMouse
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TVCodePage
+#include <tv.h>
+
+#if defined(TVOS_Win32) && !defined(TV_Disable_WinGr_Driver)
+
+// #define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/wingr/screen.h>
+#include <tv/wingr/mouse.h>
+#include <tv/wingr/key.h>
+
+bool THWMouseWinGr::pressed= false; /* JASC, feb 2006, must be known */
+HCURSOR THWMouseWinGr::lastCursor= NULL;
+
+
+/*
+ *
+ */
+int THWMouseWinGr::setMouse( LPARAM lParam
+ , int ev )
+{ storedEvent.what= ev;
+ storedEvent.mouse.doubleClick= False;
+
+ storedEvent.mouse.where.x = (short)LOWORD( lParam ) < 0 ? 0
+ : (short)LOWORD( lParam );
+ storedEvent.mouse.where.x/= primary.w;
+
+ storedEvent.mouse.where.y = (short)HIWORD( lParam ) < 0 ? 0
+ : (short)HIWORD( lParam );
+
+ storedEvent.mouse.where.y/= primary.h;
+
+ switch( ev )
+ { case evMouseUp:
+ ReleaseCapture(); pressed= false;
+ break;
+
+ case evMouseDown: /* Store press coordinates */
+ SetCapture( hwnd ); pressed= true;
+ break;
+
+ case evMouseMove:
+ if ( pressed ) /* Mouse is down */
+ { if ( lastCursor != sizeCursor ) /* Not in the resizing area */
+ { break;
+ }
+
+ storedEvent.what= evNothing; /* Not a system event */
+ storedEvent.mouse.where.x += 1;
+ storedEvent.mouse.where.y += 1;
+
+ if ( TScreen::screenWidth == storedEvent.mouse.where.x
+ && TScreen::screenHeight == storedEvent.mouse.where.y )
+ { break; /* No resizing needed */
+ }
+
+ TScreen::screenWidth = storedEvent.mouse.where.x < 0x100 ? storedEvent.mouse.where.x : 0xFF; ;
+ TScreen::screenHeight= storedEvent.mouse.where.y < 0x100 ? storedEvent.mouse.where.y : 0xFF;;
+ winRecalc( ); /* Recalc new window size */
+ break;
+ }
+
+ if ( ! storedEvent.mouse.where.y )
+ { lastCursor= handCursor;
+ }
+ else
+ { if ( storedEvent.mouse.where.y > ( TScreen::screenHeight-2 ))
+ { lastCursor= storedEvent.mouse.where.x > ( TScreen::screenWidth-2 )
+ ? sizeCursor
+ : handCursor;
+ }
+ else
+ { lastCursor= normCursor;
+ }
+ }
+ }
+
+ SetCursor( lastCursor );
+ return(0);
+}
+
+
+/*
+ *
+ */
+int THWMouseWinGr::testEvents( UINT message
+ , WPARAM wParam
+ , LPARAM lParam )
+{ switch( message )
+ { case WM_MOUSEMOVE: setMouse( lParam, evMouseMove ); break;
+ case WM_LBUTTONUP: setMouse( lParam, evMouseUp ); break;
+ case WM_MBUTTONUP: setMouse( lParam, evMouseUp ); break;
+ case WM_RBUTTONUP: setMouse( lParam, evMouseUp ); break;
+ case WM_LBUTTONDOWN: setMouse( lParam, evMouseDown ); break;
+ case WM_MBUTTONDOWN: setMouse( lParam, evMouseDown ); break;
+ case WM_RBUTTONDOWN: setMouse( lParam, evMouseDown ); break;
+
+ case WM_MOUSEWHEEL :
+ storedEvent.what= evMouseMove; /* Emulate wheel */
+ storedEvent.mouse.where.x= (short)LOWORD( lParam ) / primary.w;
+ storedEvent.mouse.where.y= (short)HIWORD( lParam ) / primary.h;
+ storedEvent.mouse.buttons= ((short) HIWORD( wParam )) > 0 ? mbButton4 : mbButton5;
+ return( message ); /* Was a mouse event */
+
+ default: return( 0 );
+ }
+
+ storedEvent.mouse.buttons= ( wParam & MK_LBUTTON ) ? mbLeftButton : 0
+ | ( wParam & MK_MBUTTON ) ? mbMiddleButton : 0
+ | ( wParam & MK_RBUTTON ) ? mbRightButton : 0 ;
+
+ return( message ); /* Was a mouse event */
+}
+
+
+
+
+/*
+ *
+ */
+void THWMouseWinGr::GetEvent( MouseEventType & me )
+{ static int xOld= 0; /* Persistent across calls */
+ static int yOld= 0; /* Persistent across calls */
+ static int bOld= 0; /* Persistent across calls */
+
+ me.buttons= bOld;
+ me.where.x= xOld;
+ me.where.y= yOld;
+
+ do
+ {
+ switch( storedEvent.what ) /* Is there a previous event? */
+ { case evCommand: /* Windows says "exit" */
+ return;
+
+ case evMouseUp:
+ case evMouseDown:
+ case evMouseMove:
+ me= storedEvent.mouse; /* Give stored event */
+ bOld= me.buttons; /* The default is no message */
+ xOld= me.where.x;
+ yOld= me.where.y;
+ storedEvent.what= /* Mark as exhausted */
+ evNothing;
+
+
+ case evKeyDown: /* Key event pending */
+ return; }} /* All done, exit function */
+ while ( processEvent()); /* Swallow new events */
+}
+
+
+/*
+ *
+ */
+void THWMouseWinGr::init( )
+{ THWMouse::GetEvent= THWMouseWinGr::GetEvent;
+ buttonCount= 5;
+}
+
+#else
+
+#include <tv/wingr/screen.h>
+#include <tv/wingr/mouse.h>
+#include <tv/wingr/key.h>
+
+#endif // TVOS_Win32
+
diff --git a/tvision/classes/wingr/wingrscr.cc b/tvision/classes/wingr/wingrscr.cc
new file mode 100644
index 0000000..9ee860a
--- /dev/null
+++ b/tvision/classes/wingr/wingrscr.cc
@@ -0,0 +1,776 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Jose Angel Sánchez Caso (JASC)
+
+ -> altomaltes@yahoo.es
+ -> altomaltes@gmail.com
+
+ Squeletons by Salvador E. Tropea (SET)
+
+ Description:
+ Windows Screen routines.
+
+
+ Defaults loaded from resource file tvrc or .tvrc
+
+ HalfColor -> Palette brightness
+ FullColor
+
+ ScreenWidth -> Screen font and size
+ ScreenHeight
+ FontWidth
+ FontHeight
+ Font10x20
+
+ optSearch
+ optSearch
+ optSearch
+
+
+***************************************************************************/
+
+
+//#define DEBUG
+
+#include <tv/configtv.h>
+
+#define Uses_string
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_AllocLocal
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_TVCodePage
+#define Uses_alloca
+#define Uses_TVOSClipboard
+#include <tv.h>
+
+#include <tv/win32/win32clip.h>
+
+
+#if defined(TVOS_Win32) && !defined(TV_Disable_WinGr_Driver)
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/wingr/screen.h>
+#include <tv/wingr/mouse.h>
+#include <tv/wingr/key.h>
+
+/* Not always defined */
+#ifndef IDC_ARROW
+ #define IDC_ARROW MAKEINTRESOURCE(32512)
+#endif
+#ifndef IDC_HAND
+ #define IDC_HAND MAKEINTRESOURCE(32649)
+#endif
+#ifndef IDC_SIZENWSE
+ #define IDC_SIZENWSE MAKEINTRESOURCE(32642)
+#endif
+
+
+int TScreenWinGr::amountOfCells= 0; /* Allocated screen cells */
+
+DWORD TScreenWinGr::style= WS_CAPTION /* Window style */
+ | WS_SYSMENU
+ | WS_MAXIMIZEBOX
+ | WS_MINIMIZEBOX;
+
+/* Window new styles */
+
+DWORD TScreenWinGr::exStyle= WS_EX_ACCEPTFILES // Drag 'n' drop files
+// | WS_EX_CLIENTEDGE // Raised edge
+ ;
+
+long TScreenWinGr::cursorDelay= 300000;
+long TScreenWinGr::HalfColor= 0xB0;
+long TScreenWinGr::FullColor= 0xFF;
+
+
+/*
+ *
+ */
+
+int TScreenWinGr::SetFont( int changeP, TScreenFont256 *fontP
+ , int changeS, TScreenFont256 *fontS
+ , int fontCP, int appCP )
+{ if (!changeP && !changeS)
+ { return 1;
+ }
+
+ if ( !fontP )
+ { fontP= defaultFont;
+ }
+
+ if ( !fontS )
+ { fontS= defaultFont;
+ }
+ if ( changeP )
+ { selectFont( primary, fontP );
+ }
+
+ if ( changeS )
+ { selectFont( secondary, fontS );
+ }
+
+ if ( appCP==-1 )
+ { TVCodePage::SetScreenCodePage( fontCP );
+ }
+ else
+ { TVCodePage::SetCodePage( appCP
+ , fontCP
+ ,-1 );
+ }
+
+ return( 1 );
+}
+
+/*
+ *
+ */
+
+void TScreenWinGr::RestoreFonts()
+{ SetFont( 1, NULL
+ , 1, NULL
+ , TVCodePage::ISOLatin1Linux
+ , TVCodePage::ISOLatin1Linux);
+}
+
+
+/*
+ *
+ */
+
+int TScreenWinGr::GetFontGeometry(unsigned &w, unsigned &h)
+{ w= primary.w;
+ h= primary.h;
+ return 1;
+}
+
+/*
+ *
+ */
+
+int TScreenWinGr::GetFontGeometryRange( unsigned &wmin, unsigned &hmin
+ , unsigned &wmax, unsigned &hmax )
+{ wmin= foWmin;
+ hmin= foHmin;
+ wmax= foWmax;
+ hmax= foHmax;
+ return 1;
+}
+
+
+/*
+ * Time callback to blink the cursor
+ */
+VOID CALLBACK cursorProc( HWND hwnd // handle of window for timer messages
+ , UINT uMsg // WM_TIMER message
+ , UINT idEvent // timer identifier
+ , DWORD /*dwTime*/ ) // current system time
+{ if ( uMsg )
+ { TScreenWinGr::zPos ^= 0x80; /* Toggle phase (turn 180 degrees) */
+
+ if ( TScreenWinGr::xPos >= 0 )
+ { TScreenWinGr::lowSetCursor( TScreenWinGr::xPos /* Show or hide cursor */
+ , TScreenWinGr::yPos
+ , true );
+ }
+ }
+
+ SetTimer( hwnd /* Reload timer */
+ , idEvent
+ , TScreenWinGr::cursorDelay / 1000 /* from usecs to msecs */
+ , cursorProc );
+}
+
+
+/*
+ * JASC, 2002
+ *
+ * Make a windows screen
+ */
+TScreenWinGr::TScreenWinGr()
+{ WNDCLASSEX wincl; /* Datastructure for the windowclass */
+ STARTUPINFO startinfo;
+ RECT windowArea;
+
+ TvWinInstance= GetModuleHandle (NULL);
+
+#ifndef DEBUG /* Use the console to debug messages */
+ FreeConsole();
+#endif
+
+ GetStartupInfoA (&startinfo); /* Get the command line passed to the process. */
+
+/*
+ * JASC, ene 2006, now bitmap fonts
+ */
+
+
+/* Look for defaults */
+
+ optSearch("HalfColor", HalfColor ); /* Palette brightness */
+ optSearch("FullColor", FullColor );
+
+/*
+ * Screen font and size
+ */
+
+ long maxX= 80; optSearch("ScreenWidth" , maxX );
+ long maxY= 25; optSearch("ScreenHeight", maxY );
+ long fontW= 8; optSearch("FontWidth" , fontW );
+ long fontH= 16; optSearch("FontHeight" , fontH );
+
+ long aux; if ( optSearch( "Font10x20", aux ) && aux )
+ { fontW= 10, fontH= 20;
+ }
+
+/*
+ * Get and store the device size
+ *
+ */
+
+ DEVMODE ret;
+ ret.dmSize= sizeof( ret );
+ EnumDisplaySettings( NULL
+ , ENUM_CURRENT_SETTINGS
+ , &ret );
+
+ dmPelsWidth = ret.dmPelsWidth ;
+ dmPelsHeight= ret.dmPelsHeight;
+ screenWidth = maxX;
+ screenHeight= maxY;
+
+ TestAllFonts( fontW /* Try the best fit */
+ , fontH );
+ CheckWindowSize( windowArea );
+
+/*
+ * Code page, User settings have more priority than detected settings
+ */
+ optSearch("AppCP", forcedAppCP );
+ optSearch("ScrCP", forcedScrCP );
+ optSearch("InpCP", forcedInpCP );
+
+ codePage=
+ new TVCodePage( forcedAppCP != -1 ? forcedAppCP : TVCodePage::ISOLatin1Linux
+ , forcedScrCP != -1 ? forcedScrCP : TVCodePage::ISOLatin1Linux
+ , forcedInpCP != -1 ? forcedInpCP : TVCodePage::ISOLatin1Linux );
+
+ SetDefaultCodePages( TVCodePage::ISOLatin1Linux
+ , TVCodePage::ISOLatin1Linux
+ , TVCodePage::ISOLatin1Linux );
+
+ normCursor= LoadCursor( NULL, IDC_ARROW );
+ handCursor= LoadCursor( NULL, IDC_HAND );
+
+ if( handCursor==NULL ) /* Not available in 95 and NT */
+ { handCursor= LoadCursor(NULL, IDC_ARROW );
+ }
+ sizeCursor= LoadCursor(NULL, IDC_SIZENWSE );
+
+ wincl.hIcon = LoadIcon( NULL /* Use default icon and mousepointer */
+ , IDI_APPLICATION);
+
+ wincl.hIconSm= LoadIcon( NULL
+ , IDI_APPLICATION);
+
+ wincl.style = 0; /* no CS_DBLCLKS (Catch dbl-clicks) */
+ wincl.cbSize = sizeof(WNDCLASSEX);
+ wincl.hCursor = normCursor;
+ wincl.hInstance = TvWinInstance;
+ wincl.cbClsExtra = 0; /* No extra bytes after window class */
+ wincl.cbWndExtra = 0; /* structure or the window instance */
+ wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
+ wincl.lpszMenuName = NULL; /* No menu */
+ wincl.lpszClassName= className;
+ wincl.hbrBackground= NULL;
+
+/*
+ * Register the window class, if fail quit the program
+ */
+
+ if( !RegisterClassEx( &wincl ) )
+ { return;
+ }
+
+
+/*
+ * The class is registered, lets create a program
+ */
+ hwnd= CreateWindowEx
+ ( exStyle /* Possible styles */
+ , className /* Classname ("MyLittleWindow") */
+ , className /* Title Text */
+ , style /* defaultwindow */
+ , CW_USEDEFAULT /* Window dimensions */
+ , CW_USEDEFAULT
+ , windowArea.right
+ , windowArea.bottom
+ , HWND_DESKTOP /* The window is a childwindow to desktop */
+ , NULL /* No menu */
+ , TvWinInstance /* Program Instance handler */
+ , NULL ); /* No Window Creation data */
+
+ if ( ! hwnd ) /* Fails to create (font creation assigns) */
+ { return;
+ }
+
+/*
+ * Store the window geometry and client size
+ */
+
+ hdc= GetDC( hwnd );
+
+ /*
+ * Now we have an hwnd, and can create fonts
+ */
+
+ initialized++ ;
+
+ ShowWindow( hwnd /* Make the window visible on the screen */
+ , startinfo.dwFlags
+ & STARTF_USESHOWWINDOW
+ ? startinfo.wShowWindow
+ : SW_SHOWDEFAULT );
+
+ for ( int col= 0
+ ; col<16
+ ; col++ )
+ { colorMap[ col ]= RGB( (col&4) ? (col&8) ? FullColor:HalfColor:0
+ , (col&2) ? (col&8) ? FullColor:HalfColor:0
+ , (col&1) ? (col&8) ? FullColor:HalfColor:0 );
+ }
+
+ flags0= CodePageVar
+ | CursorShapes
+ | CanSetBFont
+ | CanSetSBFont
+ | NoUserScreen
+ | CanSetVideoSize
+ | CanSetFontSize
+ | CanSetPalette
+ | CanReadPalette;
+
+
+ cursorLines=
+ startupCursor=
+ getCursorType();
+
+
+ screenMode= startupMode= smCO80;
+
+
+/*
+ * Start cursor blinking handler
+ */
+
+ cursorProc( hwnd // handle of window for timer messages
+ , 0 // Don´t draw cursor
+ , 0 // timer identifier
+ , 0 ); // current system time
+
+}
+
+
+
+/*
+ * JASC, 2002
+ *
+ * Link the driver by loading the static method pointers
+ */
+void TScreenWinGr::Init()
+{ TScreen::System_p = System;
+ TScreen::Resume = Resume;
+ TScreen::Suspend = Suspend;
+ TScreen::setFont_p = SetFont;
+ TScreen::setCharacter = setCharacter;
+ TScreen::setCharacters = setCharacters;
+ TScreen::setVideoMode = setVideoMode;
+ TScreen::setVideoModeRes_p = SetVideoModeRes;
+ TScreen::getFontGeometry = GetFontGeometry;
+ TScreen::restoreFonts = RestoreFonts;
+ TScreen::setDisPaletteColors = SetDisPaletteColors;
+ TScreen::getFontGeometryRange= GetFontGeometryRange;
+
+ TVWin32Clipboard::Init(); /* Use the windows clipboard */
+ setVideoModeRes( 0xFFFF
+ , 0xFFFF
+ , -1, -1 );
+}
+
+/*
+ *
+ */
+void TScreenWinGr::Resume()
+{ SaveScreen();
+}
+
+/*
+ *
+ */
+void TScreenWinGr::Suspend()
+{ RestoreScreen();
+}
+
+/*
+ * Free screen resources
+ */
+TScreenWinGr::~TScreenWinGr()
+{ UnregisterClass( className /* Free class resources */
+ , TvWinInstance );
+ DestroyWindow ( hwnd ); /* Free the window */
+
+ if ( screenBuffer )
+ { delete screenBuffer;
+ screenBuffer= NULL;
+ }
+}
+
+/*
+
+ * JASC jul/2002, write a unique colored line
+ */
+void TScreenWinGr::writeLine( unsigned x
+ , unsigned y
+ , int w
+ , char * org
+ , uchar color )
+{ unsigned letter;
+ uchar * str= (uchar *) org;
+
+ if ( w<=0 ) // Nothing to do
+ { return;
+ }
+
+ SetBkColor ( hdc, colorMap[ color&15 ]); // Color de fondo
+ SetTextColor( hdc, colorMap[ color>>4 ]); // Color de fondo
+
+ while( w -- )
+ { letter= *str++; /* Next character */
+ BitBlt( hdc
+ , x ++ * primary.w /* Move right */
+ , y * primary.h
+ , primary.w
+ , primary.h
+
+ , useSecondaryFont && ( color & 0x8 )
+ ? secondary.bitmapMemo
+ : primary.bitmapMemo
+
+ , 0, letter * primary.h
+ , SRCCOPY );
+ }
+
+ if ( y==yPos )
+ { if ( xPos >= x)
+ { if ( xPos<= x+w )
+ { if ( xPos >= 0 )
+ { lowSetCursor( xPos
+ , yPos
+ , true );
+ }
+ }
+ }
+ }
+}
+
+
+/*
+ * JASC jul/2002
+ *
+ * Write a unique colored line to memory and screen
+ */
+void TScreenWinGr::setCharacters( unsigned offset
+ , ushort * src
+ , unsigned len )
+{ uchar letra;
+ uchar color;
+ int add ;
+ int last ;
+
+ ushort x= offset % screenWidth; // Regenerate cartesian coordinates
+ ushort y= offset / screenWidth;
+
+ ushort *old = screenBuffer + offset;
+ ushort *old_right = old + len - 1;
+ ushort *src_right = src + len - 1;
+
+ char * dst;
+
+ if ( !len )
+ { return;
+ }
+
+/*
+ * remove unchanged characters from left to right
+ */
+ if ( !forceRedraw )
+ { while (len > 0 && *old == *src)
+ { x++; offset++; old++; src++; len--;
+ }
+
+/*
+ * remove unchanged characters from right to left
+ */
+ while (len > 0 && *old_right == *src_right)
+ { old_right--; src_right--; len--;
+ }
+ }
+
+ AllocLocalStr(tmp,len); /* write only middle changed characters */
+ dst= tmp; add= 0; last= -1;
+
+ memcpy( old /* Copy to screen buffer */
+ , src
+ , len*2 );
+
+ while(len--) /* Iterate */
+ { letra= attrChar(*src); /* JASC, are macros (endian dependent) */
+ color= attrColor(*src);
+
+ if ( color != last )
+ { if (last>=0)
+ { writeLine( x
+ , y
+ , add
+ , tmp
+ , last ); /* Print last same color block */
+ dst= tmp; x+= add; add= 0; }
+ last= color; }
+ *dst= letra;
+ dst++; src++; add++; }
+
+ if (!add)
+ { return; }
+
+ writeLine( x
+ , y
+ , add
+ , tmp
+ , last ); /* Print last block */
+}
+
+
+
+/*
+ *
+ */
+void TScreenWinGr::setCharacter( unsigned offset
+ , ushort value ) // JASC dic 2006, change from uint32. New interace ?
+{ setCharacters( offset
+ , &value
+ , 1 );
+}
+
+/*
+ *
+ */
+void TScreenWinGr::SaveScreen()
+{
+}
+
+/*
+ *
+ */
+void TScreenWinGr::RestoreScreen()
+{
+}
+
+/*
+ *
+ */
+int TScreenWinGr::SetDisPaletteColors( int from
+ , int number
+ , TScreenColor *colors )
+{ int to;
+
+/*
+ * Some boundaries cheching
+ */
+ from= from < 0 ? 0 : from;
+ to = from+number;
+ to = to > 16 ? 16: to;
+ number= 0; /* Now is a counter */
+
+ while( from < to )
+ { colorMap[ from++ ]= RGB( colors[ from ].R
+ , colors[ from ].G
+ , colors[ from ].B );
+ number ++;
+ }
+
+ return( number );
+}
+
+
+
+/*
+ * JASC, 2006
+ *
+ * Change the amount of memory for cells. Avoid heap fragmentation, only
+ * realloqing if more memory requested.
+ */
+void TScreenWinGr::resizeMemoryBuffer()
+{ int newAmountOfCells= getRows()*getCols();
+
+ if ( newAmountOfCells > amountOfCells )
+ { if ( screenBuffer )
+ { free( screenBuffer );
+ }
+ amountOfCells= newAmountOfCells;
+ screenBuffer= ( ushort *) calloc( sizeof(ushort) * 10
+ , amountOfCells );
+ }
+ else
+ { memset( screenBuffer, 0, sizeof(ushort)*amountOfCells );
+ }
+}
+
+
+/*
+ * JASC, 2002
+ *
+ * Changes the video mode, both hardware ( resolution ) and software
+ * ( resources ) layers. Only realocates memory on growing, avoiding heap
+ * fragmentation.
+ */
+void TScreenWinGr::setVideoMode( ushort mode )
+{ setCrtMode( mode );
+ resizeMemoryBuffer();
+ setCrtData(); /* Do the hardware layer */
+ winRecalc();
+}
+
+int TScreenWinGr::SetVideoModeRes( unsigned w
+ , unsigned h
+ , int fW
+ , int fH )
+{ if ( w != 0xFFFF )
+ { screenWidth= w;
+ }
+
+ if ( h != 0xFFFF )
+ { screenHeight= h;
+ }
+
+ if ( fW == -1 )
+ { fW= primary.w;
+ }
+
+ if ( fH == -1 )
+ { fH= primary.h;
+ }
+
+ SetCrtModeRes( fW, fH );
+ resizeMemoryBuffer();
+ winRecalc();
+ return( 1 );
+}
+
+/* #####
+ * JASC, feb 2006 ##
+ * ##
+ * Execute an external program in a syncronous way redirecting input, ##
+ * output and error. ##
+ * ##
+ * Originally, From SET code, in a MSDOS or UNIX way. ##
+ * Now in a windows way. #####
+ */
+int TScreenWinGr::System( const char * command
+ , pid_t * pidChild
+ , int in
+ , int out
+ , int err )
+{ PROCESS_INFORMATION pi;
+ STARTUPINFO si;
+ char cmdLine[ 4096 ];
+
+ memset(&si, 0, sizeof(si));
+ memset(&pi, 0, sizeof(pi));
+ si.cb = sizeof(si);
+
+// If the caller asks for redirection replace the requested handles
+
+ if ( pidChild )
+ { si.hStdInput = GetStdHandle( STD_INPUT_HANDLE ); // Default values
+ si.hStdOutput= GetStdHandle( STD_OUTPUT_HANDLE );
+ si.hStdError = GetStdHandle( STD_ERROR_HANDLE );
+
+ if ( in != -1 )
+ { si.dwFlags|= STARTF_USESTDHANDLES; // Use new handles
+ si.hStdInput = (HANDLE)_get_osfhandle( in );
+ }
+
+ if ( out != -1 )
+ { si.dwFlags|= STARTF_USESTDHANDLES; // Use new handles
+ si.hStdOutput= (HANDLE)_get_osfhandle( out );
+ }
+
+ if ( err != -1 )
+ { si.dwFlags|= STARTF_USESTDHANDLES; // Use new handles
+ si.hStdError = (HANDLE)_get_osfhandle( err );
+ }
+ }
+
+ sprintf( cmdLine
+ , "/C %s"
+ , command );
+
+ if ( !CreateProcess( getenv( "COMSPEC" ) // Do it trough a shell (scrips, etc)
+ , cmdLine // pointer to command line string
+ , NULL // pointer to process security attributes
+ , NULL // pointer to thread security attributes
+ , true // handle inheritance flag
+ , 0 // creation flags
+ , NULL // pointer to new environment block
+ , NULL // pointer to current directory name
+ , &si
+ , &pi ))
+ { return( -1 ); // Error
+ }
+
+ if ( pidChild ) // Leave in the background
+ { return( *pidChild= (int)pi.hProcess ); // Give process identifier
+ }
+ else
+ { WaitForSingleObject // DO NOT leave in the background
+ ( pi.hProcess
+ , INFINITE );
+ return( NULL ); // Return task done
+ }
+
+
+}
+
+/* #####
+ * JASC 2002 ##
+ * ##
+ * #####
+ */
+TScreen * TV_WinGrDriverCheck()
+{ TScreenWinGr *drv=new TScreenWinGr();
+
+ if ( !TScreen::initialized )
+ { delete drv;
+ drv= NULL;
+ }
+
+ TDisplayWinGr::Init(); /* First */
+ TGKeyWinGr::init();
+ TScreenWinGr::Init();
+ THWMouseWinGr::init();
+
+ return( drv );
+}
+
+#else
+
+#include <tv/wingr/screen.h>
+#include <tv/wingr/mouse.h>
+#include <tv/wingr/key.h>
+
+#endif // TVOS_Win32
+
diff --git a/tvision/classes/winnt/winntdis.cc b/tvision/classes/winnt/winntdis.cc
new file mode 100644
index 0000000..2b47ddb
--- /dev/null
+++ b/tvision/classes/winnt/winntdis.cc
@@ -0,0 +1,218 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Based on code contributed by Anatoli Soltan.
+
+ Description:
+ Win32 Display routines.
+ The original implementation was done by Anatoli, I removed some code, added
+some routines and adapted it to the new architecture.
+
+ Notes:
+ 1) At least in W98SE the cursor can't be hided if we are windowed. I think
+that's some bug in Windows. Something interesting: when I resize the window
+and it can't go full screen anymore the colors get wrong (as observed in
+NT 4.0) looks like Windows uses another drawing technic. In this particular
+mode the cursor can be hided properly.
+ 2) The API reference I have says the cursor size can range from 1 to 100,
+but in my system 99 is the maximum.
+
+***************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TFrame
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOS_Win32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/winnt/screen.h>
+
+HANDLE TDisplayWinNT::hIn =INVALID_HANDLE_VALUE;
+HANDLE TDisplayWinNT::hOut=INVALID_HANDLE_VALUE;
+#ifdef USE_NEW_BUFFER
+HANDLE TDisplayWinNT::hStdOut=INVALID_HANDLE_VALUE;
+#endif
+unsigned TDisplayWinNT::currentCursorX,
+ TDisplayWinNT::currentCursorY,
+ TDisplayWinNT::curStart,
+ TDisplayWinNT::curEnd;
+
+void TDisplayWinNT::SetCursorPos(unsigned x, unsigned y)
+{
+ if (x!=currentCursorX || y!=currentCursorY)
+ {
+ SetCursorPosLow(x,y);
+ currentCursorX=x;
+ currentCursorY=y;
+ }
+}
+
+// by SET
+void TDisplayWinNT::SetCursorPosLow(unsigned x, unsigned y)
+{
+ COORD coord;
+ coord.X=(SHORT)x;
+ coord.Y=(SHORT)y;
+ SetConsoleCursorPosition(hOut,coord);
+}
+
+void TDisplayWinNT::GetCursorPos(unsigned &x, unsigned &y)
+{
+ x=currentCursorX;
+ y=currentCursorY;
+}
+
+// by SET
+void TDisplayWinNT::GetCursorPosLow(unsigned &x, unsigned &y)
+{
+ CONSOLE_SCREEN_BUFFER_INFO screenInf;
+ GetConsoleScreenBufferInfo(hOut,&screenInf);
+ x=screenInf.dwCursorPosition.X;
+ y=screenInf.dwCursorPosition.Y;
+}
+
+// by SET
+void TDisplayWinNT::GetCursorShapeLow(unsigned &start, unsigned &end)
+{
+ CONSOLE_CURSOR_INFO cursorInf;
+ GetConsoleCursorInfo(hOut,&cursorInf);
+ if (cursorInf.bVisible)
+ {// Visible
+ // Win32API returns a "percent filled" value.
+ start=100-cursorInf.dwSize;
+ // Ever upto the end
+ end =100;
+ }
+ else
+ // Invisible cursor
+ start=end=0;
+}
+
+void TDisplayWinNT::GetCursorShape(unsigned &start, unsigned &end)
+{
+ start=curStart;
+ end=curEnd;
+}
+
+// by SET
+void TDisplayWinNT::SetCursorShape(unsigned start, unsigned end)
+{
+ if (start>=end && getShowCursorEver())
+ return;
+
+ if (start!=curStart || end!=curEnd)
+ {
+ SetCursorShapeLow(start,end);
+ curStart=start;
+ curEnd=end;
+ }
+}
+
+// by SET
+void TDisplayWinNT::SetCursorShapeLow(unsigned start, unsigned end)
+{
+ CONSOLE_CURSOR_INFO inf;
+ inf.bVisible=start>=end ? FALSE : TRUE;
+ inf.dwSize=inf.bVisible ? end-start : 1;
+ if (inf.dwSize>99) inf.dwSize=99;
+ SetConsoleCursorInfo(hOut,&inf);
+}
+
+void TDisplayWinNT::ClearScreen(uchar screenWidth, uchar screenHeight)
+{
+ COORD coord={0,0};
+ DWORD cWritten;
+
+ FillConsoleOutputCharacter(hOut,' ',screenWidth*screenHeight,coord,&cWritten);
+ FillConsoleOutputAttribute(hOut,FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,
+ screenWidth*screenHeight,coord,&cWritten);
+}
+
+ushort TDisplayWinNT::GetRows()
+{
+ CONSOLE_SCREEN_BUFFER_INFO inf;
+ GetConsoleScreenBufferInfo(hOut,&inf);
+ return (ushort)inf.dwSize.Y;
+}
+
+ushort TDisplayWinNT::GetCols()
+{
+ CONSOLE_SCREEN_BUFFER_INFO inf;
+ GetConsoleScreenBufferInfo(hOut,&inf);
+ return (ushort)inf.dwSize.X;
+}
+
+const int mxTitleSize=256;
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the main window title.
+
+ Return:
+ A pointer to a newly allocated string (new[]). Or 0 if fail. by SET.
+
+***************************************************************************/
+
+const char *TDisplayWinNT::GetWindowTitle(void)
+{
+ char buf[mxTitleSize];
+ DWORD ret=GetConsoleTitle(buf,mxTitleSize);
+ if (ret)
+ {
+ char *s=new char[ret+1];
+ memcpy(s,buf,ret);
+ s[ret]=0;
+ return s;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the main window title.
+
+ Return:
+ non-zero successful. by SET.
+
+***************************************************************************/
+
+int TDisplayWinNT::SetWindowTitle(const char *name)
+{
+ return SetConsoleTitle(name);
+}
+
+void TDisplayWinNT::Beep()
+{
+ MessageBeep(0xFFFFFFFF);
+}
+
+TDisplayWinNT::~TDisplayWinNT() {}
+
+void TDisplayWinNT::Init()
+{
+ setCursorPos=SetCursorPos;
+ getCursorPos=GetCursorPos;
+ getCursorShape=GetCursorShape;
+ setCursorShape=SetCursorShape;
+ getRows=GetRows;
+ getCols=GetCols;
+ setWindowTitle=SetWindowTitle;
+ getWindowTitle=GetWindowTitle;
+ clearScreen=ClearScreen;
+ beep=Beep;
+}
+
+#else
+
+#include <tv/winnt/screen.h>
+
+#endif // TVOS_Win32
+
diff --git a/tvision/classes/winnt/winntkey.cc b/tvision/classes/winnt/winntkey.cc
new file mode 100644
index 0000000..75893b7
--- /dev/null
+++ b/tvision/classes/winnt/winntkey.cc
@@ -0,0 +1,326 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ It said:
+ This code is GPL, see copying file for more details.
+ Keyboard handler for Win32 Copyright by Anatoli Soltan (2000)
+ Based on the handler for Linux Copyright by Salvador E. Tropea (SET) (1998,1999)
+
+ Description:
+ WinNT Keyboard routines.
+ The original implementation was done by Anatoli, I removed some code, added
+some routines and adapted it to the new architecture.
+
+ ToDo:
+ * Must check GetShiftState, I think the return value is wrong.
+
+***************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_FullSingleKeySymbols
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOS_Win32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/winnt/screen.h>
+#include <tv/winnt/key.h>
+
+INPUT_RECORD TGKeyWinNT::inpRec;
+unsigned TGKeyWinNT::shiftState;
+ushort TGKeyWinNT::vk2kk[]=
+{
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x002a, 0x002b, 0x0000, 0x0000, 0x0000, 0x002c, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x001f, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0034, 0x0047, 0x004c, 0x004a, 0x0045, 0x0048, 0x0046, 0x0049,
+ 0x004b, 0x0000, 0x0000, 0x0000, 0x0000, 0x004d, 0x004e, 0x0000,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
+ 0x0028, 0x0029, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
+ 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
+ 0x0018, 0x0019, 0x001a, 0x0063, 0x0064, 0x0065, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0033, 0x0036, 0x0000, 0x0035, 0x0000, 0x0032,
+ 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040,
+ 0x0041, 0x0042, 0x0043, 0x0044, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x002d, 0x0038, 0x0059, 0x005e, 0x005a, 0x005b,
+ 0x0061, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0056, 0x001c, 0x0057, 0x002e, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
+};
+
+unsigned TGKeyWinNT::GetShiftState()
+{
+ return shiftState;
+}
+
+void TGKeyWinNT::Clear(void)
+{
+ FlushConsoleInputBuffer(TScreenWinNT::hIn);
+}
+
+int TGKeyWinNT::KbHit(void)
+{
+ DWORD cEvents;
+
+ while (PeekConsoleInput(TScreenWinNT::hIn,&inpRec,1,&cEvents) && cEvents==1)
+ {
+ if (inpRec.EventType!=KEY_EVENT)
+ {
+ // The following two lines are commented because if someone waits for
+ // a key press by calling kbhit in a loop and a mouse event is in the
+ // queue, the loop will never end.
+ //if (inpRec.EventType == MOUSE_EVENT)
+ // return 0;
+ ReadConsoleInput(TScreenWinNT::hIn,&inpRec,1,&cEvents);
+ continue;
+ }
+ if (!inpRec.Event.KeyEvent.bKeyDown) // skeek keyup events
+ ReadConsoleInput(TScreenWinNT::hIn,&inpRec,1,&cEvents);
+ else
+ return 1;
+ }
+ return 0;
+}
+
+void TGKeyWinNT::FillTEvent(TEvent &e)
+{
+ DWORD cEvents;
+ ReadConsoleInput(TScreenWinNT::hIn,&inpRec,1,&cEvents);
+
+ DWORD dwCtlState=inpRec.Event.KeyEvent.dwControlKeyState;
+ shiftState=0;
+ if (dwCtlState & SHIFT_PRESSED)
+ shiftState|=kbShiftCode;
+ if (dwCtlState & (LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED))
+ shiftState|=kbCtrlCode;
+ if (dwCtlState & LEFT_ALT_PRESSED)
+ shiftState|=kbAltLCode;
+ if (dwCtlState & RIGHT_ALT_PRESSED)
+ shiftState|=kbAltRCode;
+ //if (dwCtlState & SCROLLLOCK_ON)
+ // shiftState |= kbScrollState;
+ //if (dwCtlState & NUMLOCK_ON)
+ // shiftState |= kbNumState;
+ //if (dwCtlState & CAPSLOCK_ON)
+ // shiftState |= kbCapsState;
+
+ e.keyDown.charScan.scanCode=inpRec.Event.KeyEvent.wVirtualScanCode;
+ uchar Symbol=inpRec.Event.KeyEvent.uChar.AsciiChar;
+ e.keyDown.charScan.charCode=((shiftState & kbAltLCode) && (Symbol<128)) ?
+ 0 : Symbol;
+ e.keyDown.shiftState=shiftState;
+ // To debug the codes
+ //fprintf(stderr,"inpRec.Event.KeyEvent.wVirtualKeyCode=%d\n",
+ // inpRec.Event.KeyEvent.wVirtualKeyCode);
+ e.keyDown.keyCode=(inpRec.Event.KeyEvent.wVirtualKeyCode<256) ?
+ vk2kk[inpRec.Event.KeyEvent.wVirtualKeyCode] :
+ (ushort)0;
+ if (e.keyDown.keyCode==0)
+ return;
+ e.what=evKeyDown;
+ e.keyDown.keyCode|=shiftState;
+}
+
+void TGKeyWinNT::Init()
+{
+ TGKey::kbhit=KbHit;
+ TGKey::getShiftState=GetShiftState;
+ TGKey::fillTEvent=FillTEvent;
+ TGKey::clear=Clear;
+}
+#else
+
+#include <tv/winnt/screen.h>
+#include <tv/winnt/key.h>
+
+#endif // TVOS_Win32
+
+/*
+This code was used by Anatoli to check what key codes generates Win32 API.
+
+<------- start of codes.cpp
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <stdio.h>
+
+void main()
+{
+ INPUT_RECORD ir;
+ HANDLE hInp;
+ DWORD cEvents;
+
+ hInp=GetStdHandle(STD_INPUT_HANDLE);
+
+ while (1)
+ {
+ ReadConsoleInput(hInp, &ir, 1, &cEvents);
+ if (ir.EventType == KEY_EVENT)
+ {
+ printf("KeyDown = %d, VK = %d, SC = %x Char = %d\n",
+ ir.Event.KeyEvent.bKeyDown,
+ ir.Event.KeyEvent.wVirtualKeyCode,
+ ir.Event.KeyEvent.wVirtualScanCode,
+ ir.Event.KeyEvent.uChar.AsciiChar);
+ }
+ }
+}
+<------- end of codes.cpp
+
+Perl script used by Anatoli to generate the translation table
+
+@table = qw(
+kbUnknown=0x0000
+kbA=0x0001=65
+kbB=0x0002=66
+kbC=0x0003=67
+kbD=0x0004=68
+kbE=0x0005=69
+kbF=0x0006=70
+kbG=0x0007=71
+kbH=0x0008=72
+kbI=0x0009=73
+kbJ=0x000a=74
+kbK=0x000b=75
+kbL=0x000c=76
+kbM=0x000d=77
+kbN=0x000e=78
+kbO=0x000f=79
+kbP=0x0010=80
+kbQ=0x0011=81
+kbR=0x0012=82
+kbS=0x0013=83
+kbT=0x0014=84
+kbU=0x0015=85
+kbV=0x0016=86
+kbW=0x0017=87
+kbX=0x0018=88
+kbY=0x0019=89
+kbZ=0x001a=90
+
+kbOpenBrace=0x001b
+kbBackSlash=0x001c=220
+kbCloseBrace=0x001d
+kbPause=0x001e
+kbEsc=0x001f=27
+
+kb0=0x0020=48
+kb1=0x0021=49
+kb2=0x0022=50
+kb3=0x0023=51
+kb4=0x0024=52
+kb5=0x0025=53
+kb6=0x0026=54
+kb7=0x0027=55
+kb8=0x0028=56
+kb9=0x0029=57
+
+kbBackSpace=0x002a=8
+kbTab=0x002b=9
+kbEnter=0x002c=13
+
+kbColon=0x002d=186
+kbQuote=0x002e=222
+kbGrave=0x002f
+kbComma=0x0030
+
+kbStop=0x0031
+kbSlash=0x0032=111
+kbAsterisk=0x0033=106
+kbSpace=0x0034=32
+
+kbMinus=0x0035=109
+kbPlus=0x0036=107
+kbPrnScr=0x0037
+kbEqual=0x0038=187
+
+kbF1=0x0039=112
+kbF2=0x003a=113
+kbF3=0x003b=114
+kbF4=0x003c=115
+kbF5=0x003d=116
+kbF6=0x003e=117
+kbF7=0x003f=118
+kbF8=0x0040=119
+kbF9=0x0041=120
+kbF10=0x0042=121
+kbF11=0x0043=122
+kbF12=0x0044=123
+
+kbHome=0x0045=36
+kbUp=0x0046=38
+kbPgUp=0x0047=33
+kbLeft=0x0048=37
+kbRight=0x0049=39
+kbEnd=0x004a=35
+kbDown=0x004b=40
+kbPgDn=0x004c=34
+
+kbInsert=0x004d=45
+kbDelete=0x004e=46
+kbCaret=0x004f
+kbAdmid=0x0050
+
+kbDobleQuote=0x0051
+kbNumeral=0x0052
+kbDolar=0x0053
+kbPercent=0x0054
+
+kbAmper=0x0055
+kbOpenPar=0x0056=219
+kbClosePar=0x0057=221
+kbDoubleDot=0x0058
+
+kbLessThan=0x0059=188
+kbGreaterThan=0x005a=190
+kbQuestion=0x005b=191
+kbA_Roba=0x005c
+kbOr=0x005d
+kbUnderLine=0x005e=189
+kbOpenCurly=0x005f
+kbCloseCurly=0x0060
+kbTilde=0x0061=192
+kbMacro=0x0062
+kbWinLeft=0x0063=91
+kbWinRight=0x0064=92
+kbWinSel=0x0065=93
+kbMouse=0x0066
+);
+
+for $e (@table) {
+ ($kname, $kcode, $vcode) = split(/=/, $e);
+ $map[$vcode] = $kcode if $vcode ne '';
+}
+
+for ($i = 0; $i < 256; $i++) {
+ $map[$i] = '0x0000' if !defined($map[$i]);
+}
+
+for ($i = 0; $i < 256; ) {
+ for ($j = 0; $j < 8; $j++, $i++) {
+ print $map[$i], (($i == 255) ? '' : ', ');
+ }
+ print "\n";
+}
+*/
+
diff --git a/tvision/classes/winnt/winntmouse.cc b/tvision/classes/winnt/winntmouse.cc
new file mode 100644
index 0000000..878157c
--- /dev/null
+++ b/tvision/classes/winnt/winntmouse.cc
@@ -0,0 +1,78 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Based on code contributed by Anatoli Soltan.
+
+ Description:
+ WinNT Mouse routines.
+ The original implementation was done by Anatoli, I removed some code and
+adapted it to the new architecture.
+
+***************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOS_Win32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <tv/winnt/screen.h>
+#include <tv/winnt/mouse.h>
+
+INPUT_RECORD THWMouseWinNT::inpRec;
+
+void THWMouseWinNT::GetEvent(MouseEventType &me)
+{
+ DWORD cEvents;
+ INPUT_RECORD ir;
+
+ while (PeekConsoleInput(TScreenWinNT::hIn,&ir,1,&cEvents) && cEvents==1)
+ {
+ if (ir.EventType==KEY_EVENT)
+ break;
+ if (ir.EventType!=MOUSE_EVENT)
+ {
+ ReadConsoleInput(TScreenWinNT::hIn,&ir,1,&cEvents);
+ continue;
+ }
+ ReadConsoleInput(TScreenWinNT::hIn,&inpRec,1,&cEvents);
+ break;
+ }
+ me.buttons=(uchar)inpRec.Event.MouseEvent.dwButtonState;
+ me.doubleClick=False;
+ me.where.x=inpRec.Event.MouseEvent.dwMousePosition.X;
+ me.where.y=inpRec.Event.MouseEvent.dwMousePosition.Y;
+}
+
+void THWMouseWinNT::Init()
+{
+ THWMouse::GetEvent=THWMouseWinNT::GetEvent;
+ THWMouse::Resume=THWMouseWinNT::Resume;
+ Resume();
+}
+
+void THWMouseWinNT::Resume()
+{
+ // SET: According to Win32 API reference an application should check if the
+ // mouse is installed and can find how many buttons have the mouse using
+ // calls to GetSystemMetrics. Windows supports upto 3 buttons :-(
+ // Note that in my system I have a 5 buttons mouse, 3 of them generates
+ // events and this call returns 2. I don't thing Windows is doing the right
+ // thing ;-) In my system the wheel works for IE, but I don't get mouse
+ // events from the wheel.
+ buttonCount=GetSystemMetrics(SM_CMOUSEBUTTONS);
+}
+
+#else
+
+#include <tv/winnt/screen.h>
+#include <tv/winnt/mouse.h>
+
+#endif // TVOS_Win32
+
diff --git a/tvision/classes/winnt/winntscr.cc b/tvision/classes/winnt/winntscr.cc
new file mode 100644
index 0000000..e9ebf8a
--- /dev/null
+++ b/tvision/classes/winnt/winntscr.cc
@@ -0,0 +1,577 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002-2005 by Salvador E. Tropea (SET)
+ Based on code contributed by Anatoli Soltan.
+
+ Description:
+ WinNT Screen routines.
+ The original implementation was done by Anatoli, I removed some code,
+added some routines and adapted it to the new architecture.
+
+ ToDo: Set UseScreenSaver when we are in full screen.
+
+ Configuration variables:
+ ScreenWidth
+ ScreenHeight
+ AppCP
+ ScrCP
+ InpCP
+
+ Notes:
+ 1) I saw a problem in W98SE, it looks like a bug in Windows: If I
+suspend to a shell and the resume doing window size changes at exit the
+screen seems to be partially restored. But if you force windows to redraw
+it (minimize/maximize for example) things gets right. This is problem only
+affects the cursor when using USE_NEW_BUFFER.
+ 2) The USE_NEW_BUFFER mode is something I (SET) found in the Win32 API
+docs that's much cleaver than saving/restoring the screen contents. When
+defined I just create a new screen buffer and use it. To restore the screen
+you just need to set the original STDOUT handle as the active. It makes the
+code easier and exposes less Windows problems (bugs?). The only bizarre
+thing I observe is "invisible cursor", but this is just Windows forgets to
+update, as soon as the window needs a redraw the cursor gets visible again.
+ 3) Anatoli left commented:
+ hIn=CreateFile("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+ hOut=CreateFile("CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+I think they aren't useful but I left it here in case I need this example.
+
+***************************************************************************/
+#include <tv/configtv.h>
+
+#define Uses_stdlib
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TGKey
+#define Uses_TVCodePage
+#define Uses_unistd
+#include <tv.h>
+#include <tv/win32/win32clip.h>
+
+// I delay the check to generate as much dependencies as possible
+#ifdef TVOS_Win32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef YieldProcessor
+
+#include <tv/winnt/screen.h>
+#include <tv/winnt/mouse.h>
+#include <tv/winnt/key.h>
+
+//#define DEBUG
+#ifdef DEBUG
+ #define DBPr1(a) fputs(a,stderr)
+ #define DBPr2(a,b) fprintf(stderr,a,b)
+ #define DBPr3(a,b,c) fprintf(stderr,a,b,c)
+#else
+ #define DBPr1(a)
+ #define DBPr2(a,b)
+ #define DBPr3(a,b,c)
+#endif
+
+#define TV_CONSOLE_MODE (ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT)
+
+#ifndef USE_NEW_BUFFER
+ushort *TScreenWinNT::saveScreenBuf;
+unsigned TScreenWinNT::saveScreenSize;
+unsigned TScreenWinNT::saveScreenCursorStart,
+ TScreenWinNT::saveScreenCursorEnd;
+unsigned TScreenWinNT::saveScreenCursorX,
+ TScreenWinNT::saveScreenCursorY;
+#else
+ #define SaveScreenReleaseMemory()
+#endif
+DWORD TScreenWinNT::saveScreenConsoleMode;
+unsigned TScreenWinNT::saveScreenWidth,
+ TScreenWinNT::saveScreenHeight;
+
+// Buffer used to arrange the data as needed by Win32 API
+CHAR *TScreenWinNT::outBuf;
+WORD *TScreenWinNT::outBufAttr;
+CHAR_INFO *TScreenWinNT::outBufCI;
+unsigned TScreenWinNT::outBufCapacity;
+
+void TScreenWinNT::ensureOutBufCapacity(unsigned count)
+{
+ count=(count+1) & 0xFFFFFFFE;
+ if (outBufCapacity<count)
+ {
+ free(outBufCI);
+ outBufCI=(CHAR_INFO*)malloc(count*sizeof(CHAR_INFO));
+ outBuf=(CHAR*)outBufCI;
+ outBufAttr=(WORD*)(outBuf+count);
+ outBufCapacity=count;
+ }
+}
+
+int TScreenWinNT::InitOnce()
+{
+ DWORD flags;
+ // Check if we are running in a console
+ if (!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),&flags))
+ return 0;
+ // SET: On Win32 this value is symbolic, just a number that can't be a
+ // malloced pointer, the screenBuffer isn't used to access the screen.
+ screenBuffer=(ushort *)-1;
+
+ hIn=GetStdHandle(STD_INPUT_HANDLE);
+ #ifdef USE_NEW_BUFFER
+ hStdOut=GetStdHandle(STD_OUTPUT_HANDLE);
+ // Create a new buffer, it have their own content and cursor
+ hOut=CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
+ 0,NULL,CONSOLE_TEXTMODE_BUFFER,NULL);
+ if (hStdOut==INVALID_HANDLE_VALUE || hOut==INVALID_HANDLE_VALUE)
+ return 0; // Something went wrong
+ // Make the new one the active
+ if (!SetConsoleActiveScreenBuffer(hOut))
+ return 0;
+ //hCurrentOut=hOut;
+
+ // If we are here this driver will be used
+ initialized=1;
+ if (dCB) dCB();
+
+ // Console mode
+ GetConsoleMode(hIn,&saveScreenConsoleMode);
+ SetConsoleCtrlHandler(ConsoleEventHandler,TRUE);
+ SetConsoleMode(hIn,TV_CONSOLE_MODE);
+ #else
+ hOut=GetStdHandle(STD_OUTPUT_HANDLE);
+ #endif
+
+ TDisplayWinNT::Init();
+
+ setCharacter=SetCharacter;
+ setCharacters=SetCharacters;
+ getCharacter=GetCharacter;
+ getCharacters=GetCharacters;
+ TScreen::System_p=System;
+ TScreen::Resume=Resume;
+ TScreen::Suspend=Suspend;
+ setCrtModeRes_p=SetCrtModeRes;
+
+ TVWin32Clipboard::Init();
+ TGKeyWinNT::Init();
+ THWMouseWinNT::Init();
+
+ // Cache these values
+ GetCursorShapeLow(curStart,curEnd);
+ GetCursorPosLow(currentCursorX,currentCursorY);
+
+ UINT outCP=GetConsoleOutputCP();
+ UINT inCP=GetConsoleCP();
+ // Look for user settings
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+ // User settings have more priority than detected settings
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : outCP,
+ forcedScrCP!=-1 ? forcedScrCP : outCP,
+ forcedInpCP!=-1 ? forcedInpCP : inCP);
+ SetDefaultCodePages(outCP,outCP,inCP);
+
+ return 1;
+}
+
+
+TScreenWinNT::TScreenWinNT()
+{
+ if (!InitOnce()) return;
+ flags0=CodePageVar | CursorShapes | CanSetVideoSize;
+ startupMode=getCrtMode();
+ #ifdef USE_NEW_BUFFER
+ // Just remmember the current window size
+ saveScreenWidth =GetCols();
+ saveScreenHeight=GetRows();
+ #else
+ Resume();
+ #endif
+
+ unsigned maxX=saveScreenWidth, maxY=saveScreenHeight;
+ long aux;
+ if (optSearch("ScreenWidth",aux))
+ maxX=aux;
+ if (optSearch("ScreenHeight",aux))
+ maxY=aux;
+ if (maxX!=saveScreenWidth || maxY!=saveScreenHeight)
+ {
+ cursorLines=getCursorType();
+ setCrtModeRes(maxX,maxY);
+ }
+
+ screenMode=getCrtMode();
+ setCrtData();
+
+ suspended=0;
+}
+
+TScreenWinNT::~TScreenWinNT()
+{
+ suspend(); // High level suspend to avoid a double call
+ SaveScreenReleaseMemory();
+ free(outBufCI);
+ outBufCI=0;
+ outBuf=NULL;
+ outBufAttr=0;
+ outBufCapacity=0;
+}
+
+void TScreenWinNT::Resume()
+{
+ #ifdef USE_NEW_BUFFER
+ GetConsoleMode(hIn,&saveScreenConsoleMode);
+ // First switch to our handle
+ SetConsoleActiveScreenBuffer(hOut);
+ // Now we can save the current window size
+ saveScreenWidth =GetCols();
+ saveScreenHeight=GetRows();
+ //hCurrentOut=hOut; Not useful
+ // Restore our window size
+ SetCrtModeRes(screenWidth,screenHeight);
+ #else
+ // Save:
+ // Cursor shape
+ GetCursorShapeLow(saveScreenCursorStart,saveScreenCursorEnd);
+ // Cursor position
+ GetCursorPosLow(saveScreenCursorX,saveScreenCursorY);
+ // Console mode
+ GetConsoleMode(hIn,&saveScreenConsoleMode);
+ // Screen content
+ SaveScreen();
+
+ // Restore:
+ // Window size
+ SetCrtModeRes(screenWidth,screenHeight);
+ // Cursor position
+ SetCursorPosLow(currentCursorX,currentCursorY);
+ // Cursor shape
+ SetCursorShapeLow(curStart,curEnd);
+ #endif
+ // In case the size changed and we failed to restore it
+ setCrtData();
+ // Console mode
+ SetConsoleCtrlHandler(ConsoleEventHandler,TRUE);
+ SetConsoleMode(hIn,TV_CONSOLE_MODE);
+}
+
+void TScreenWinNT::Suspend()
+{
+ #ifdef USE_NEW_BUFFER
+ // Restore window size (using our handle!)
+ SetCrtModeRes(saveScreenWidth,saveScreenHeight);
+ // Switch to the original handle
+ SetConsoleActiveScreenBuffer(hStdOut);
+ #else
+ // Restore:
+ // Window size
+ SetCrtModeRes(saveScreenWidth,saveScreenHeight);
+ // If size changed the content
+ RestoreScreen();
+ // Cursor shape
+ SetCursorShape(saveScreenCursorStart,saveScreenCursorEnd);
+ // Cursor position
+ SetCursorPosLow(saveScreenCursorX,saveScreenCursorY);
+ //FlushConsoleInputBuffer(hIn);
+ #endif
+ // Console mode
+ SetConsoleCtrlHandler(ConsoleEventHandler,FALSE);
+ SetConsoleMode(hIn,saveScreenConsoleMode);
+}
+
+ushort TScreenWinNT::GetCharacter(unsigned offset)
+{
+ COORD coord;
+ coord.Y=(SHORT)((offset)/screenWidth);
+ coord.X=(SHORT)((offset)%screenWidth);
+ DWORD cRead;
+ ushort ch;
+
+ ReadConsoleOutputAttribute(hOut,&ch,1,coord,&cRead);
+ ch<<=8;
+ ReadConsoleOutputCharacter(hOut,(CHAR*)&ch,1,coord,&cRead);
+ return ch;
+}
+
+void TScreenWinNT::GetCharacters(unsigned offset, ushort *buf, unsigned count)
+{
+ ensureOutBufCapacity(count);
+ COORD coord;
+ coord.Y=(SHORT)((offset)/screenWidth);
+ coord.X=(SHORT)((offset)%screenWidth);
+ DWORD cRead;
+
+ ReadConsoleOutputAttribute(hOut,outBufAttr,count,coord,&cRead);
+ ReadConsoleOutputCharacter(hOut,outBuf,count,coord,&cRead);
+ for (count=0; count<cRead; count++, buf++)
+ *buf=(ushort)(outBufAttr[count]<<8) | (ushort)(uchar)outBuf[count];
+}
+
+void TScreenWinNT::SetCharacter(unsigned offset, ushort value)
+{
+ ensureOutBufCapacity(1);
+ COORD coord;
+ coord.Y=(SHORT)((offset)/screenWidth);
+ coord.X=(SHORT)((offset)%screenWidth);
+
+ outBufCI[0].Char.AsciiChar=(CHAR)(value & 0xFF);;
+ outBufCI[0].Attributes=(WORD)(value>>8);
+
+ COORD dwBufferSize={1,1};
+ COORD dwBufferCoord={0,0};
+ SMALL_RECT rcWriteRegion={coord.X, coord.Y, coord.X, coord.Y};
+ WriteConsoleOutput(hOut,outBufCI,dwBufferSize,dwBufferCoord,&rcWriteRegion);
+
+ //FillConsoleOutputCharacter(hOut,(CHAR)(value & 0xFF),1,coord,&cWritten);
+ //FillConsoleOutputAttribute(hOut,(WORD)(value >> 8),1,coord,&cWritten);
+}
+
+void TScreenWinNT::SetCharacters(unsigned offset, ushort *values, unsigned count)
+{
+ ensureOutBufCapacity(count);
+ COORD coord;
+ coord.Y=(SHORT)((offset)/screenWidth);
+ coord.X=(SHORT)((offset)%screenWidth);
+ unsigned i;
+
+ for (i=0; i<count; i++, values++)
+ {
+ outBufCI[i].Char.AsciiChar=(CHAR)(*values & 0xFF);
+ outBufCI[i].Attributes=(WORD)(*values>>8);
+ }
+
+ COORD dwBufferSize={count,1};
+ COORD dwBufferCoord={0, 0};
+ SMALL_RECT rcWriteRegion={coord.X, coord.Y, coord.X+count-1, coord.Y};
+ WriteConsoleOutput(hOut,outBufCI,dwBufferSize,dwBufferCoord,&rcWriteRegion);
+}
+
+#ifndef USE_NEW_BUFFER
+void TScreenWinNT::SaveScreen()
+{
+ unsigned rows=GetRows();
+ unsigned cols=GetCols();
+
+ saveScreenSize=rows*cols;
+ free(saveScreenBuf);
+ saveScreenBuf=(ushort *)malloc(saveScreenSize*sizeof(ushort));
+
+ // Temporarily set these variables to let getCharacter work properly
+ uchar screenWidthSave=screenWidth;
+ uchar screenHeightSave=screenHeight;
+ screenWidth=(uchar)cols;
+ screenHeight=(uchar)rows;
+ unsigned row, ofs;
+ for (row=0, ofs=0; row<rows; row++, ofs+=cols)
+ GetCharacters(ofs,saveScreenBuf+ofs,cols);
+ screenWidth=screenWidthSave;
+ screenHeight=screenHeightSave;
+ saveScreenWidth=(uchar)cols;
+ saveScreenHeight=(uchar)rows;
+
+ /*FILE *f=fopen("screen.dat","wb");
+ fwrite(saveScreenBuf,saveScreenSize,sizeof(ushort),f);
+ fclose(f);*/
+}
+
+void TScreenWinNT::RestoreScreen()
+{
+ // Needed to make SetCharacters work OK
+ unsigned actualW=screenWidth, actualH=screenHeight;
+ screenWidth=saveScreenWidth; screenHeight=saveScreenHeight;
+
+ unsigned rows=saveScreenHeight, row, ofs;
+ unsigned cols=saveScreenWidth;
+
+ for (row=0, ofs=0; row<rows; row++, ofs+=cols)
+ SetCharacters(ofs,saveScreenBuf+ofs,cols);
+
+ screenWidth=actualW; screenHeight=actualH;
+}
+
+void TScreenWinNT::SaveScreenReleaseMemory()
+{
+ free(saveScreenBuf);
+ saveScreenBuf=NULL;
+ saveScreenSize=0;
+}
+#endif
+
+void TScreenWinNT::YieldProcessor(int micros)
+{
+ DWORD msecs=micros<0 ? INFINITE : micros/1000;
+ WaitForSingleObject(TScreenWinNT::hIn,msecs);
+}
+
+// May be I should move all the yield processor routines to TScreen
+extern "C" void __tvWin32Yield(int micros)
+{
+ TScreenWinNT::YieldProcessor(micros);
+}
+
+BOOL WINAPI TScreenWinNT::ConsoleEventHandler(DWORD dwCtrlType)
+{
+ if (dwCtrlType==CTRL_C_EVENT || dwCtrlType==CTRL_BREAK_EVENT)
+ return TRUE;
+ return FALSE;
+}
+
+int TScreenWinNT::System(const char *command, pid_t *pidChild, int in, int out,
+ int err)
+{
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+
+ int rc=system(command);
+ SetConsoleMode(hIn, TV_CONSOLE_MODE);
+ // fork mechanism not implemented, indicate the child finished
+ if (pidChild)
+ *pidChild=0;
+ return rc;
+}
+
+TScreen *TV_WinNTDriverCheck()
+{
+ TScreenWinNT *drv=new TScreenWinNT();
+ if (!TScreen::initialized)
+ {
+ delete drv;
+ return 0;
+ }
+ return drv;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Change the window size to the desired value. The font size is ignored
+because it can't be controlled by the application, the Win32 API reference
+I have says: "A screen buffer can be any size, limited only by available
+memory. The dimensions of a screen buffer's window cannot exceed the
+corresponding dimensions of either the screen buffer or the maximum window
+that can fit on the screen based on the current font size (controlled
+exclusively by the user).".@*
+ It only works if we are windowed and this will prevent from going full
+screen unless Windows knows an equivalent text mode.
+
+ Return: 0 no change, 1 full change, 2 approx. change. by SET
+
+***************************************************************************/
+
+int TScreenWinNT::SetCrtModeRes(unsigned w, unsigned h, int fW, int fH)
+{
+ CONSOLE_SCREEN_BUFFER_INFO info;
+ // Find current size
+ if (!GetConsoleScreenBufferInfo(hCurrentOut,&info)) return 0;
+ // Is the same used?
+ if (info.dwSize.X==(int)w && info.dwSize.Y==(int)h)
+ {
+ DBPr3("Already using %d,%d size\n",w,h);
+ return 0;
+ }
+ // Find the max. size, depends on the font and screen size.
+ COORD max=GetLargestConsoleWindowSize(hCurrentOut);
+ COORD newSize={w,h};
+ if (newSize.X>max.X) newSize.X=max.X;
+ if (newSize.Y>max.Y) newSize.Y=max.Y;
+ // The buffer must be large enough to hold both modes (current and new)
+ COORD newBufSize=newSize;
+ if (info.dwMaximumWindowSize.X>newBufSize.X)
+ newBufSize.X=info.dwMaximumWindowSize.X;
+ if (info.dwMaximumWindowSize.Y>newBufSize.Y)
+ newBufSize.Y=info.dwMaximumWindowSize.Y;
+ // Enlarge the buffer size. It fails if not windowed.
+ if (!SetConsoleScreenBufferSize(hCurrentOut,newBufSize)) return 0;
+ // Resize the window.
+ SMALL_RECT r={0,0,newSize.X-1,newSize.Y-1};
+ if (!SetConsoleWindowInfo(hCurrentOut,TRUE,&r))
+ {// Revert buffer size
+ newSize.X=info.dwMaximumWindowSize.X;
+ newSize.Y=info.dwMaximumWindowSize.Y;
+ SetConsoleScreenBufferSize(hCurrentOut,newSize);
+ return 0;
+ }
+ // Now we can shrink the buffer to the needed size
+ SetConsoleScreenBufferSize(hCurrentOut,newSize);
+ // This is something silly TV code spects: after a video mode change the
+ // cursor should go to the "default" state.
+ setCursorType(cursorLines);
+ // Ok! we did it.
+ return fW!=-1 || fH!=-1 || newSize.X!=(int)w || newSize.Y!=(int)h ? 2 : 1;
+}
+
+#else
+
+#include <tv/winnt/screen.h>
+#include <tv/winnt/mouse.h>
+#include <tv/winnt/key.h>
+
+#endif // TVOSf_WIN32
+/*
+Win32 API reference names 45 code pages. Only 20 of them are supported.
+
+Code page identifiers:
+
+*037 EBCDIC
+ 437 MS-DOS United States *
+*500 EBCDIC "500V1"
+*708 Arabic (ASMO 708)
+*709 Arabic (ASMO 449+, BCON V4)
+*710 Arabic (Transparent Arabic)
+*720 Arabic (Transparent ASMO)
+ 737 Greek (formerly 437G) *
+ 775 Baltic *
+ 850 MS-DOS Multilingual (Latin I) *
+ 852 MS-DOS Slavic (Latin II) *
+ 855 IBM Cyrillic (primarily Russian*
+ 857 IBM Turkish *
+ 860 MS-DOS Portuguese
+ 861 MS-DOS Icelandic
+*862 Hebrew
+ 863 MS-DOS Canadian-French
+*864 Arabic
+ 865 MS-DOS Nordic
+ 866 MS-DOS Russian *
+ 869 IBM Modern Greek *
+*874 Thai
+*875 EBCDIC
+*932 Japan
+*936 Chinese (PRC, Singapore)
+*949 Korean
+*950 Chinese (Taiwan, Hong Kong)
+*1026 EBCDIC
+*1200 Unicode (BMP of ISO 10646)
+ 1250 Windows 3.1 Eastern European *
+ 1251 Windows 3.1 Cyrillic *
+ 1252 Windows 3.1 US (ANSI) *
+ 1253 Windows 3.1 Greek *
+ 1254 Windows 3.1 Turkish *
+*1255 Hebrew
+*1256 Arabic
+ 1257 Baltic *
+*1361 Korean (Johab)
+*10000 Macintosh Roman
+*10001 Macintosh Japanese
+*10006 Macintosh Greek I
+ 10007 Macintosh Cyrillic
+*10029 Macintosh Latin 2
+*10079 Macintosh Icelandic
+*10081 Macintosh Turkish
+-----------------
+My registry also says:
+
+20866
+28591
+28592
+28595
+28597
+
+As a Windows 9x is shipped working with only one code page I can't test what
+a hell are these code pages. They seems to be some variant of 866 and some
+kind of ISO cp, just a guess.
+*/
+
diff --git a/tvision/classes/x11/x11dis.cc b/tvision/classes/x11/x11dis.cc
new file mode 100644
index 0000000..c5e1770
--- /dev/null
+++ b/tvision/classes/x11/x11dis.cc
@@ -0,0 +1,129 @@
+/* X11 display routines.
+ Copyright (c) 2001-2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+#include <tv/configtv.h>
+
+#define Uses_string
+#define Uses_TDisplay
+#define Uses_TScreen
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && defined(HAVE_X11)
+
+// X11 defines their own values
+#undef True
+#undef False
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+#include <tv/x11/screen.h>
+
+/*****************************************************************************
+
+ TDisplayX11 display stuff, that's very easy because we control all the
+ variables involved
+
+*****************************************************************************/
+
+int TDisplayX11::cursorX;
+int TDisplayX11::cursorY;
+int TDisplayX11::cursorPX;
+int TDisplayX11::cursorPY;
+char TDisplayX11::cShapeFrom;
+char TDisplayX11::cShapeTo;
+char TDisplayX11::windowSizeChanged=0;
+int TDisplayX11::maxX;
+int TDisplayX11::maxY;
+int TDisplayX11::newX;
+int TDisplayX11::newY;
+unsigned TDisplayX11::fontW;
+unsigned TDisplayX11::fontWb;
+unsigned TDisplayX11::fontH;
+unsigned TDisplayX11::fontSz;
+
+TDisplayX11::~TDisplayX11() {}
+
+void TDisplayX11::Init()
+{
+ setCursorPos=SetCursorPos;
+ getCursorPos=GetCursorPos;
+ getCursorShape=GetCursorShape;
+ setCursorShape=SetCursorShape;
+ getRows=GetRows;
+ getCols=GetCols;
+ checkForWindowSize=CheckForWindowSize;
+}
+
+void TDisplayX11::SetCursorPos(unsigned x, unsigned y)
+{
+ TScreenX11::UnDrawCursor();
+ cursorX=x; cursorY=y;
+ cursorPX=x*fontW; cursorPY=y*fontH;
+ TScreenX11::DrawCursor();
+}
+
+void TDisplayX11::GetCursorPos(unsigned &x, unsigned &y)
+{
+ x=cursorX; y=cursorY;
+}
+
+void TDisplayX11::GetCursorShape(unsigned &start, unsigned &end)
+{
+ start=100*cShapeFrom/fontH;
+ end =100*cShapeTo/fontH;
+ //fprintf(stderr,"GetCursorShape: %d,%d\n",start,end);
+}
+
+void TDisplayX11::SetCursorShape(unsigned start, unsigned end)
+{
+ //fprintf(stderr,"SetCursorShape: %d,%d start>=end? %d\n",start,end,start>=end);
+ if (start>=end && getShowCursorEver())
+ return;
+ cShapeFrom=start*fontH/100;
+ cShapeTo =end*fontH/100;
+ if ((unsigned)cShapeFrom>fontH) cShapeFrom=fontH;
+ if ((unsigned)cShapeTo>fontH) cShapeTo =fontH;
+ if (start>=end)
+ TScreenX11::DisableCursor();
+ else
+ TScreenX11::EnableCursor();
+ //fprintf(stderr,"Seteando X11: %d a %d\n",cShapeFrom,cShapeTo);
+}
+
+ushort TDisplayX11::GetRows()
+{
+ return maxY;
+}
+
+ushort TDisplayX11::GetCols()
+{
+ return maxX;
+}
+
+int TDisplayX11::CheckForWindowSize(void)
+{
+ int ret=0;
+ SEMAPHORE_ON;
+ if (windowSizeChanged)
+ {
+ // Now we can change the values because the application is aware
+ maxX=newX;
+ maxY=newY;
+ // Reallocate the buffer cleaning it to force a deep redraw
+ delete[] TScreen::screenBuffer;
+ TScreen::screenBuffer=new ushort[maxX*maxY];
+ memset(TScreen::screenBuffer,0,maxX*maxY*sizeof(ushort));
+ windowSizeChanged=0;
+ ret=1;
+ }
+ SEMAPHORE_OFF;
+ return ret;
+}
+
+#else
+
+#include <tv/x11/screen.h>
+
+#endif // defined(TVOS_UNIX) && defined(HAVE_X11)
+
diff --git a/tvision/classes/x11/x11key.cc b/tvision/classes/x11/x11key.cc
new file mode 100644
index 0000000..8086e97
--- /dev/null
+++ b/tvision/classes/x11/x11key.cc
@@ -0,0 +1,479 @@
+/* X11 keyboard routines.
+ Copyright (c) 2001-2003 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+#include <tv/configtv.h>
+
+#define Uses_stdio // debug
+#define Uses_stdlib // bsearch
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_TGKey
+#define Uses_FullSingleKeySymbols
+#define Uses_TEvent
+#define Uses_TVCodePage
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && defined(HAVE_X11)
+
+// X11 defines their own values
+#undef True
+#undef False
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+
+#include <tv/x11/screen.h>
+#include <tv/x11/key.h>
+
+#define x11AltMask Mod1Mask // Alt for XFree86 and Solaris
+#ifdef TVOSf_Solaris
+ #define x11NumLockMask Mod3Mask // NumLock for Solaris
+#else
+ #define x11NumLockMask Mod2Mask // NumLock for XFree86
+#endif
+// What's that for Solaris? I couldn't get Scroll Lock to work on Solaris.
+#define x11ScrollLockMask Mod5Mask // ScrollLock for XFree86
+/*
+ In Solaris:
+ Mod2Mask is for Alt Graphic.
+ Mod4Mask is for the key with a diamond.
+
+ In XFree86:
+ Mod4Mask is for the Windows key.
+*/
+#if X_HAVE_UTF8_STRING
+ // XFree86 4.0.2 introduced a very nice function to retreive a key using
+ // Unicode.
+ #define XimLookupString Xutf8LookupString
+ #define UTF8_2_Symbol(a) utf8_2_u16(a)
+ #define Unicode_2_CP(a) Unicode2CP(a)
+#else
+ #define XimLookupString XmbLookupString
+ #define UTF8_2_Symbol(a) a[0]
+ #define Unicode_2_CP(a) (a)
+#endif
+
+/*****************************************************************************
+
+ TGKeyX11 keyboard stuff.
+
+*****************************************************************************/
+
+int TGKeyX11::lenKb;
+int TGKeyX11::kbWaiting=0;
+char TGKeyX11::bufferKb[MaxKbLen+1];
+KeySym TGKeyX11::Key;
+unsigned TGKeyX11::kbFlags=0;
+uchar TGKeyX11::KeyCodeByKeySym[256];
+unsigned TGKeyX11::Symbol;
+unsigned TGKeyX11::Flags;
+uchar TGKeyX11::Scan;
+uchar TGKeyX11::sendQuit=0;
+stIntCodePairs
+ *TGKeyX11::inputCP=NULL;
+
+static
+uint16 utf8_2_u16(const char *b)
+{
+ int c=*((uchar *)(b++));
+ int n,t;
+
+ if (c & 0x80)
+ {
+ n=1;
+ while (c & (0x80>>n))
+ n++;
+
+ c&=(1<<(8-n))-1;
+
+ while (--n>0)
+ {
+ t=*((unsigned char *)(b++));
+ if ((!(t&0x80)) || (t&0x40))
+ return '^';
+ c=(c<<6) | (t&0x3F);
+ }
+ }
+
+ return c;
+}
+
+int TGKeyX11::getKeyEvent(int block)
+{
+ Status status; // Currently ignored, but Solaris doesn't support NULL as argument
+ XEvent event;
+
+ /* If we already have a key use it */
+ if (kbWaiting)
+ return 1;
+
+ SEMAPHORE_ON;
+ while (1)
+ {
+ /* Get the next keyboard event */
+ if (XCheckMaskEvent(TScreenX11::disp,aKeyEvent,&event)!=True)
+ {
+ if (!IS_SECOND_THREAD_ON)
+ TScreenX11::ProcessGenericEvents();
+ if (block)
+ continue;
+ SEMAPHORE_OFF;
+ return 0;
+ }
+ /* Now check if it is a key that will be combined */
+ if (XFilterEvent(&event,0)==True)
+ continue;
+ if (event.type==KeyPress)
+ {
+ //printf("Key event 0x%04X Keysym: 0x%08X\n",event.xkey.state,XLookupKeysym(&event.xkey,3));
+ // Ask for the UTF-8 character, better for future applications
+ lenKb=XimLookupString(TScreenX11::xic,&event.xkey,bufferKb,MaxKbLen,&Key,&status);
+ bufferKb[lenKb]=0;
+ //printf("Key event %d %s 0x%04X %d\n",lenKb,bufferKb,(unsigned)Key,bufferKb[0]);
+ /* FIXME: how can I know the state before entering the application? */
+ #define ToggleBit(a) if (kbFlags & a) kbFlags&=~a; else kbFlags|=a
+ /* Look if that's a modifier */
+ switch (Key)
+ {
+ case XK_Shift_R:
+ kbFlags|=kbRightShiftDown;
+ break;
+ case XK_Shift_L:
+ kbFlags|=kbLeftShiftDown;
+ break;
+ case XK_Control_R:
+ kbFlags|=kbRightCtrlDown | kbCtrlDown;
+ break;
+ case XK_Control_L:
+ kbFlags|=kbLeftCtrlDown | kbCtrlDown;
+ break;
+ case XK_Alt_R:
+ kbFlags|=kbRightAltDown | kbAltDown;
+ break;
+ case XK_Alt_L:
+ kbFlags|=kbLeftAltDown | kbAltDown;
+ break;
+ case XK_Scroll_Lock:
+ kbFlags|=kbScrollLockDown;
+ ToggleBit(kbScrollLockToggle);
+ break;
+ case XK_Num_Lock:
+ kbFlags|=kbNumLockDown;
+ ToggleBit(kbNumLockToggle);
+ break;
+ case XK_Caps_Lock:
+ kbFlags|=kbCapsLockDown;
+ ToggleBit(kbCapsLockToggle);
+ break;
+ case XK_Insert:
+ ToggleBit(kbInsertToggle);
+ kbWaiting=1;
+ SEMAPHORE_OFF;
+ return 1; /* Report the key */
+ case XK_Sys_Req:
+ kbFlags|=kbSysReqPress;
+ kbWaiting=1;
+ SEMAPHORE_OFF;
+ return 1; /* Report the key */
+ default:
+ /* If a modifier key is released when we don't have the focus
+ we get unsynchronized, this code helps to keep in sync. */
+ /* Extract the modifiers info: */
+ if (event.xkey.state & ShiftMask)
+ {
+ if (!(kbFlags & (kbRightShiftDown | kbLeftShiftDown)))
+ kbFlags|=kbLeftShiftDown;
+ }
+ else
+ {
+ if (kbFlags & (kbRightShiftDown | kbLeftShiftDown))
+ kbFlags&=~(kbRightShiftDown | kbLeftShiftDown);
+ }
+ if (event.xkey.state & LockMask)
+ kbFlags|=kbCapsLockDown;
+ else
+ kbFlags&=~kbCapsLockDown;
+ if (event.xkey.state & ControlMask)
+ {
+ if (!(kbFlags & kbCtrlDown))
+ kbFlags|=kbCtrlDown | kbLeftCtrlDown;
+ }
+ else
+ {
+ if (kbFlags & kbCtrlDown)
+ kbFlags&=~(kbLeftCtrlDown | kbRightCtrlDown | kbCtrlDown);
+ }
+ if (event.xkey.state & x11AltMask)
+ {
+ if (!(kbFlags & kbAltDown))
+ kbFlags|=kbAltDown | kbLeftAltDown;
+ }
+ else
+ {
+ if (kbFlags & kbAltDown)
+ kbFlags&=~(kbLeftAltDown | kbRightAltDown | kbAltDown);
+ }
+ if (event.xkey.state & x11NumLockMask)
+ kbFlags|=kbNumLockDown;
+ else
+ kbFlags&=~kbNumLockDown;
+ if (event.xkey.state & x11ScrollLockMask)
+ kbFlags|=kbScrollLockDown;
+ else
+ kbFlags&=~kbScrollLockDown;
+ kbWaiting=1;
+ SEMAPHORE_OFF;
+ return 1;
+ }
+ #undef ToggleBit
+ }
+ else
+ {
+ KeySym k=XLookupKeysym(&event.xkey,0);
+ switch (k)
+ {
+ case XK_Shift_R:
+ kbFlags&=~kbRightShiftDown;
+ break;
+ case XK_Shift_L:
+ kbFlags&=~kbLeftShiftDown;
+ break;
+ case XK_Control_R:
+ kbFlags&=~kbRightCtrlDown;
+ if ((kbFlags & kbLeftCtrlDown)==0)
+ kbFlags&=~kbCtrlDown;
+ break;
+ case XK_Control_L:
+ kbFlags&=~kbLeftCtrlDown;
+ if ((kbFlags & kbRightCtrlDown)==0)
+ kbFlags&=~kbCtrlDown;
+ break;
+ case XK_Alt_R:
+ kbFlags&=~kbRightAltDown;
+ if ((kbFlags & kbLeftAltDown)==0)
+ kbFlags&=~kbAltDown;
+ break;
+ case XK_Alt_L:
+ kbFlags&=~kbLeftAltDown;
+ if ((kbFlags & kbRightAltDown)==0)
+ kbFlags&=~kbAltDown;
+ break;
+ case XK_Scroll_Lock:
+ kbFlags&=~kbScrollLockDown;
+ break;
+ case XK_Num_Lock:
+ kbFlags&=~kbNumLockDown;
+ break;
+ case XK_Caps_Lock:
+ kbFlags&=~kbCapsLockDown;
+ break;
+ }
+ }
+ }
+ SEMAPHORE_OFF;
+ return 0;
+}
+
+int TGKeyX11::KbHit()
+{
+ if (sendQuit) return 1;
+ return getKeyEvent(0);
+}
+
+keyEquiv TGKeyX11::XEquiv[]=
+{
+ /* Cursor control & motion */
+ {XK_Home,kbHome}, {XK_Left,kbLeft}, {XK_Up,kbUp}, {XK_Right,kbRight},
+ {XK_Down,kbDown}, {XK_Page_Up,kbPgUp}, {XK_Page_Down, kbPgDn},
+ {XK_End,kbEnd}, {XK_Begin,kbHome},
+ /* Misc Functions */
+ {XK_Insert, kbInsert}, {XK_Delete, kbDelete},
+ /* TTY Functions */
+ {XK_Return, kbEnter}, {XK_BackSpace, kbBackSpace}, {XK_Tab, kbTab},
+ {XK_Escape, kbEsc},
+ /* Auxilliary Functions */
+ {XK_F1, kbF1}, {XK_F2, kbF2}, {XK_F3, kbF3}, {XK_F4, kbF4}, {XK_F5, kbF5},
+ {XK_F6, kbF6}, {XK_F7, kbF7}, {XK_F8, kbF8}, {XK_F9, kbF9}, {XK_F10, kbF10},
+ {XK_F11, kbF11}, {XK_F12, kbF12},
+ /* Keypad Functions */
+ {XK_KP_0,kb0}, {XK_KP_1,kb1}, {XK_KP_2,kb2}, {XK_KP_3,kb3}, {XK_KP_4,kb4},
+ {XK_KP_5,kb5}, {XK_KP_6,kb6}, {XK_KP_7,kb7}, {XK_KP_8,kb8}, {XK_KP_9,kb9},
+ {XK_KP_Enter, kbEnter}, {XK_KP_Home,kbHome}, {XK_KP_Left,kbLeft},
+ {XK_KP_Up, kbUp}, {XK_KP_Right,kbRight}, {XK_KP_Down, kbDown},
+ {XK_KP_Page_Up, kbPgUp}, {XK_KP_Page_Down,kbPgDn}, {XK_KP_End,kbEnd},
+ {XK_KP_Begin, kbHome}, {XK_KP_Insert, kbInsert}, {XK_KP_Delete, kbDelete},
+ {XK_KP_Equal, kbEqual}, {XK_KP_Multiply, kbAsterisk}, {XK_KP_Add, kbPlus},
+ {XK_KP_Subtract, kbMinus}, {XK_KP_Decimal, kbStop}, {XK_KP_Divide, kbSlash},
+ /* End */
+ {0,0}
+};
+
+uchar TGKeyX11::KeyCodeByASCII[96]=
+{
+ kbSpace,kbAdmid,kbDobleQuote,kbNumeral,kbDolar,kbPercent,kbAmper,kbQuote,
+ kbOpenPar,kbClosePar,kbAsterisk,kbPlus,kbComma,kbMinus,kbStop,kbSlash,
+ kb0,kb1,kb2,kb3,kb4,kb5,kb6,kb7,
+ kb8,kb9,kbDoubleDot,kbColon,kbLessThan,kbEqual,kbGreaterThan,kbQuestion,
+ kbA_Roba,kbA,kbB,kbC,kbD,kbE,kbF,kbG,
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO,
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW,
+ kbX,kbY,kbZ,kbOpenBrace,kbBackSlash,kbCloseBrace,kbCaret,kbUnderLine,
+ kbGrave,kbA,kbB,kbC,kbD,kbE,kbF,kbG,
+ kbH,kbI,kbJ,kbK,kbL,kbM,kbN,kbO,
+ kbP,kbQ,kbR,kbS,kbT,kbU,kbV,kbW,
+ kbX,kbY,kbZ,kbOpenCurly,kbOr,kbCloseCurly,kbTilde,kbBackSpace
+};
+
+ushort TGKeyX11::GKey()
+{
+ unsigned name;
+
+ getKeyEvent(1);
+ kbWaiting=0;
+
+ if ((Key & 0xFF00)==0xFF00)
+ {/* Special keys by keysym */
+ Symbol=(unsigned char)bufferKb[0];
+ name=KeyCodeByKeySym[Key & 0xFF];
+ //printf("Key by keysym 0x%X name: %d Symbol %d\n",(unsigned)Key,name,Symbol);
+ }
+ else if (lenKb!=0)
+ {/* A key by their ASCII */
+ Symbol=UTF8_2_Symbol(bufferKb);
+ if (Symbol==0 && Key==' ')
+ name=kbSpace; // Why Ctrl+Space reports it? is my X?
+ else if (Symbol==0 && Key=='2')
+ name=kb2; // And this one?
+ else
+ {
+ if (Symbol>=32 && Symbol<128)
+ name=KeyCodeByASCII[Symbol-32];
+ else
+ {
+ if (Symbol>=1 && Symbol<=26) // ^A to ^Z
+ name=kbA+Symbol-1;
+ else
+ {
+ if (Symbol>26 && Symbol<32) // ^{ ^\ ^} ?? ^/
+ name=KeyCodeByASCII[Key-32];
+ else
+ {// >=128, handle them using Unicode
+ name=kbUnkNown;
+ Symbol=Unicode_2_CP(Symbol);
+ }
+ }
+ }
+ }
+ //printf("Key of lenght %d: name: %d Symbol %04X Key: 0x%04X\n",lenKb,name,Symbol,(unsigned)Key);
+ }
+ else
+ {/* A key with something else, not handled yet */
+ Symbol=0;
+ name=kbUnkNown;
+ }
+ Scan=Key & 0xFF;
+
+ /* Process the flags, just like if it came from an IBM BIOS */
+ Flags=0;
+ if (kbFlags & (kbLeftShiftDown | kbRightShiftDown))
+ Flags|=kbShiftCode;
+ if (kbFlags & kbCtrlDown)
+ Flags|=kbCtrlCode;
+ switch (AltSet)
+ {
+ case 0: // Normal thing, left is left, right is right
+ if (kbFlags & kbLeftAltDown)
+ Flags|=kbAltLCode;
+ else
+ if (kbFlags & kbAltDown)
+ Flags|=kbAltRCode;
+ break;
+ case 1: // Reverse thing
+ if (kbFlags & kbLeftAltDown)
+ Flags|=kbAltRCode;
+ else
+ if (kbFlags & kbAltDown)
+ Flags|=kbAltLCode;
+ break;
+ default: // Compatibility
+ if (kbFlags & (kbLeftAltDown | kbAltDown))
+ Flags|=kbAltLCode;
+ }
+
+ return name|Flags;
+}
+
+static
+int compare(const void *v1, const void *v2)
+{
+ stIntCodePairs *p1=(stIntCodePairs *)v1;
+ stIntCodePairs *p2=(stIntCodePairs *)v2;
+ return (p1->unicode>p2->unicode)-(p1->unicode<p2->unicode);
+}
+
+unsigned TGKeyX11::Unicode2CP(uint16 unicode)
+{
+ if (!inputCP)
+ return unicode;
+ stIntCodePairs se,*re;
+ se.unicode=unicode;
+ re=(stIntCodePairs *)bsearch(&se,inputCP,256,sizeof(stIntCodePairs),compare);
+ /*if (!re)
+ printf("No encuentro U+%04X\n",unicode);*/
+ return re ? re->code : '?';
+}
+
+unsigned TGKeyX11::GetShiftState()
+{
+ return kbFlags;
+}
+
+void TGKeyX11::FillTEvent(TEvent &e)
+{
+ if (sendQuit)
+ {
+ sendQuit=0;
+ e.what=evCommand;
+ e.message.command=cmQuit;
+ return;
+ }
+ ushort Abstract=GKey();
+ e.keyDown.charScan.charCode=((Flags & kbAltLCode) && (Symbol<128)) ? 0 : Symbol;
+ e.keyDown.charScan.scanCode=Scan;
+ e.keyDown.raw_scanCode=Scan;
+ e.keyDown.keyCode=Abstract;
+ e.keyDown.shiftState=kbFlags;
+ e.what=evKeyDown;
+}
+
+void TGKeyX11::Init()
+{
+ TGKey::kbhit =KbHit;
+ TGKey::gkey =GKey;
+ TGKey::getShiftState=GetShiftState;
+ TGKey::fillTEvent =FillTEvent;
+ TGKey::SetCodePage =SetCodePage;
+ /* Initialize keyboard tables */
+ for (int i=0; XEquiv[i].symbol; i++)
+ KeyCodeByKeySym[XEquiv[i].symbol & 0xFF]=XEquiv[i].key;
+ /* Find which encoding is used for input */
+ if (!inputCP)
+ inputCP=new stIntCodePairs[256];
+ TVCodePage::GetUnicodesForCP(TVCodePage::GetInpCodePage(),inputCP);
+}
+
+int TGKeyX11::SetCodePage(int id)
+{
+ if (!inputCP)
+ inputCP=new stIntCodePairs[256];
+ TVCodePage::GetUnicodesForCP(id,inputCP);
+ return TGKey::defaultSetCodePage(id);
+}
+#else
+
+#include <tv/x11/screen.h>
+#include <tv/x11/key.h>
+
+#endif // defined(TVOS_UNIX) && defined(HAVE_X11)
+
diff --git a/tvision/classes/x11/x11mouse.cc b/tvision/classes/x11/x11mouse.cc
new file mode 100644
index 0000000..d81abd6
--- /dev/null
+++ b/tvision/classes/x11/x11mouse.cc
@@ -0,0 +1,107 @@
+/* X11 mouse routines.
+ Copyright (c) 2001-2003 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+#include <tv/configtv.h>
+
+//#define Uses_stdio
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_TEvent
+#define Uses_TEventQueue
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && defined(HAVE_X11)
+
+// X11 defines their own values
+#undef True
+#undef False
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+#include <tv/x11/screen.h>
+#include <tv/x11/mouse.h>
+
+/*****************************************************************************
+
+ THWMouseX11 mouse stuff.
+
+*****************************************************************************/
+
+unsigned THWMouseX11::mouseButtons=0;
+unsigned THWMouseX11::mouseX=0;
+unsigned THWMouseX11::mouseY=0;
+unsigned THWMouseX11::buttonTranslate[8]=
+{
+ 0, // First button is 1
+ mbLeftButton,mbMiddleButton,mbRightButton,mbButton4,mbButton5,
+ 0,0
+};
+
+int THWMouseX11::getMouseEvent()
+{
+ XEvent event;
+
+ SEMAPHORE_ON;
+ while (1)
+ {
+ /* Get the next mouse event */
+ if (XCheckMaskEvent(TScreenX11::disp,aMouseEvent,&event)!=True)
+ {
+ if (!IS_SECOND_THREAD_ON)
+ TScreenX11::ProcessGenericEvents();
+ SEMAPHORE_OFF;
+ return 0;
+ }
+ /* Is that needed here? */
+ if (XFilterEvent(&event,0)==True)
+ continue;
+ if (event.type==ButtonPress || event.type==ButtonRelease ||
+ event.type==MotionNotify)
+ {
+ mouseX=event.xbutton.x/TScreenX11::fontW;
+ mouseY=event.xbutton.y/TScreenX11::fontH;
+ // Clamp the values, they could be negative
+ if (event.xbutton.x<0) mouseX=0;
+ if (event.xbutton.y<0) mouseY=0;
+ if (event.type==ButtonPress)
+ mouseButtons|=buttonTranslate[event.xbutton.button & 0x7];
+ else
+ if (event.type==ButtonRelease)
+ mouseButtons&=~buttonTranslate[event.xbutton.button & 0x7];
+ //printf("Button Press %d mouseButtons=%d\n",event.xbutton.button,mouseButtons);
+ //printf("Button Release %d (%d,%d) vs (%d,%d)\n",event.xbutton.button,event.xbutton.x/TScreenX11::fontW,event.xbutton.y/TScreenX11::fontH,mouseX,mouseY);
+ //printf("Motion Notify %d,%d\n",mouseX,mouseY);
+ SEMAPHORE_OFF;
+ return 1;
+ }
+ }
+ SEMAPHORE_OFF;
+ return 0;
+}
+
+void THWMouseX11::GetEvent(MouseEventType &me)
+{
+ getMouseEvent();
+ me.where.x=mouseX;
+ me.where.y=mouseY;
+ me.buttons=mouseButtons;
+ me.doubleClick=False;
+}
+
+void THWMouseX11::Init()
+{
+ THWMouse::GetEvent=GetEvent;
+ buttonCount=5;
+}
+
+THWMouseX11::~THWMouseX11()
+{
+}
+#else
+
+#include <tv/x11/screen.h>
+#include <tv/x11/mouse.h>
+
+#endif // defined(TVOS_UNIX) && defined(HAVE_X11)
+
diff --git a/tvision/classes/x11/x11src.cc b/tvision/classes/x11/x11src.cc
new file mode 100644
index 0000000..9cdc398
--- /dev/null
+++ b/tvision/classes/x11/x11src.cc
@@ -0,0 +1,2710 @@
+/* X11 screen routines.
+ Copyright (c) 2001-2007 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+ Thanks to José Ángel Sánchez Caso (JASC). He implemented a first X11
+ driver.
+ This implementation is completly different but JASC's code gave me the
+ first notions about how an X11 application works.
+
+ ToDo:
+ * The SetDisPaletteColors does a redraw, it should be avoided, at least
+ for 8 bpp modes, BTW they are untested.
+
+ Configuration variables:
+ Font10x20=0 Selects the 10x20 font instead of 8x16
+ ScreenWidth
+ ScreenHeight
+ ScreenPalette
+ FontWidth
+ FontHeight
+ LoadSecondaryFont
+ AppCP
+ ScrCP
+ InpCP
+ HideCursorWhenNoFocus
+ DontResizeToCells Don't resize the window to a cells multiple size if the WM
+ fails to follow the hints. This helps to avoid problems found
+ in KDE 3.1 alpha.
+ InternalBusyCursor When enabled we use our own mouse cursor for it
+ UseUpdateThread Uses a separated thread to update the window content.
+
+*/
+#ifndef _GNU_SOURCE
+ #define _GNU_SOURCE
+#endif
+
+#include <tv/configtv.h>
+
+// That's a nasty side effect: X defines Boolean!
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && defined(HAVE_X11)
+ #include <X11/Xmu/Atoms.h>
+#endif
+
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_string
+#define Uses_unistd // TScreenX11::System
+#define Uses_signal
+#define Uses_fcntl // open
+#define Uses_snprintf
+#define Uses_AllocLocal
+#define Uses_TDisplay
+#define Uses_TScreen
+#define Uses_TGKey // For TGKeyX11
+#define Uses_TEvent // For THWMouseX11
+#define Uses_TVCodePage
+#define Uses_TVOSClipboard
+#define Uses_TNSCollection
+#include <tv.h>
+
+// I delay the check to generate as much dependencies as possible
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && defined(HAVE_X11)
+
+// X11 defines their own values
+#undef True
+#undef False
+#define True 1
+#define False 0
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <X11/Xatom.h>
+#include <X11/cursorfont.h>
+
+#include <tv/x11/screen.h>
+#include <tv/x11/key.h>
+#include <tv/x11/mouse.h>
+
+#include <locale.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#ifdef HAVE_LINUX_PTHREAD
+ #include <pthread.h>
+#endif
+
+#ifdef TVOSf_Solaris
+ // At least in the Solaris 7 box I tested looks like ITIMER_REAL is broken
+ // and behaves like ITIMER_VIRTUAL
+ #define ITIMER_USED ITIMER_REALPROF
+ #define TIMER_ALARM SIGPROF
+#else
+ #define ITIMER_USED ITIMER_REAL
+ #define TIMER_ALARM SIGALRM
+#endif
+
+const unsigned foWmin=5, foHmin=7, foWmax=20, foHmax=32;
+const int cursorDelay=300000;
+
+/*****************************************************************************
+
+ TScreenX11 screen stuff.
+
+*****************************************************************************/
+
+Display *TScreenX11::disp;
+ulong TScreenX11::screen;
+Visual *TScreenX11::visual;
+Window TScreenX11::rootWin;
+Window TScreenX11::mainWin;
+Colormap TScreenX11::cMap;
+GC TScreenX11::gc;
+GC TScreenX11::cursorGC=NULL;
+XIC TScreenX11::xic=NULL;
+XIM TScreenX11::xim=NULL;
+Atom TScreenX11::theProtocols;
+ulong TScreenX11::colorMap[16];
+XImage *TScreenX11::ximgFont[256]; /* Our "font" is just a collection of images */
+XImage *TScreenX11::ximgSecFont[256];
+XImage *TScreenX11::cursorImage=NULL;
+int TScreenX11::fg;
+int TScreenX11::bg;
+char TScreenX11::cursorEnabled=1;
+char TScreenX11::cursorInScreen=0;
+uchar TScreenX11::curAttr;
+uchar TScreenX11::primaryFontChanged=0;
+char *TScreenX11::cursorData=NULL;
+char TScreenX11::hideCursorWhenNoFocus=1;
+char TScreenX11::dontResizeToCells=0;
+struct
+timeval TScreenX11::refCursorTime,
+ TScreenX11::curCursorTime;
+XSizeHints *TScreenX11::sizeHints=NULL;
+XClassHint *TScreenX11::classHint=NULL;
+
+TScreenX11::~TScreenX11()
+{
+ STOP_UPDATE_THREAD;
+
+ if (sizeHints)
+ XFree(sizeHints);
+ if (classHint)
+ {
+ delete[] classHint->res_name;
+ delete[] classHint->res_class;
+ classHint->res_name=NULL;
+ classHint->res_class=NULL;
+ XFree(classHint);
+ }
+
+ if (xic)
+ XDestroyIC(xic);
+ if (xim)
+ XCloseIM(xim);
+
+ DestroyXImageFont(0);
+ DestroyXImageFont(1);
+ if (cursorImage)
+ XDestroyImage(cursorImage);
+
+ if (disp)
+ {
+ if (TScreen::showBusyState==ShowBusyState)
+ {
+ XFreeCursor(disp,busyCursor);
+ XFreeCursor(disp,leftPtr);
+ }
+
+ if (cursorGC)
+ XFreeGC(disp,cursorGC);
+ XDestroyWindow(disp,mainWin);
+ XCloseDisplay(disp); //This could do all of the above for us, but anyway...
+ }
+
+ delete[] screenBuffer;
+
+}
+
+void TScreenX11::clearScreen()
+{
+ SEMAPHORE_ON;
+ XSetForeground(disp,gc,colorMap[bg]);
+ XFillRectangle(disp,mainWin,gc,0,0,maxX*fontW,maxY*fontH);
+ XSetForeground(disp,gc,colorMap[fg]);
+
+ char space[2];
+ space[charPos]=' ';
+ space[attrPos]=curAttr;
+
+ unsigned c=maxX*maxY;
+ while (c--)
+ screenBuffer[c]=*((ushort *)space);
+ SEMAPHORE_OFF;
+}
+
+inline
+void TScreenX11::drawChar(GC gc, unsigned x, unsigned y, uchar aChar, uchar aAttr)
+{
+ if (useSecondaryFont && (aAttr & 0x8))
+ XPutImage(disp,mainWin,gc,ximgSecFont[aChar],0,0,x,y,fontW,fontH);
+ else
+ XPutImage(disp,mainWin,gc,ximgFont[aChar],0,0,x,y,fontW,fontH);
+}
+
+void TScreenX11::setCharacter(unsigned offset, ushort value)
+{
+ if (screenBuffer[offset]==value)
+ return;
+ screenBuffer[offset]=value;
+
+ unsigned x,y;
+ x=(offset%maxX)*fontW;
+ y=(offset/maxX)*fontH;
+
+ uchar *theChar=(uchar *)(screenBuffer+offset);
+ uchar newChar=theChar[charPos];
+ uchar newAttr=theChar[attrPos];
+
+ SEMAPHORE_ON;
+ XSetBgFg(newAttr);
+ UnDrawCursor();
+ drawChar(gc,x,y,newChar,newAttr);
+ DrawCursor();
+ XFlush(disp);
+ SEMAPHORE_OFF;
+}
+
+void TScreenX11::setCharacters(unsigned offset, ushort *values, unsigned count)
+{
+ // Skip repeated characters at the left
+ for (; count && screenBuffer[offset]==*values; count--, offset++, values++);
+ // Skip repeated characters at the right
+ for (; count && screenBuffer[offset+count-1]==values[count-1]; count--);
+ if (!count) // All skipped
+ return;
+
+ unsigned x,y;
+ x=(offset%maxX)*fontW;
+ y=(offset/maxX)*fontH;
+
+ uchar *b=(uchar *)values,newChar,newAttr;
+ uchar *sb=(uchar *)(screenBuffer+offset);
+ unsigned oldAttr=0x100;
+
+ SEMAPHORE_ON;
+ UnDrawCursor();
+ while (count--)
+ {
+ newChar=b[charPos];
+ newAttr=b[attrPos];
+ if (newChar!=sb[charPos] || newAttr!=sb[attrPos])
+ {
+ sb[charPos]=newChar;
+ sb[attrPos]=newAttr;
+ if (newAttr!=oldAttr)
+ {
+ XSetBgFg(newAttr);
+ oldAttr=newAttr;
+ }
+ drawChar(gc,x,y,newChar,newAttr);
+ }
+ x+=fontW; b+=2; sb+=2;
+ }
+ DrawCursor();
+ XFlush(disp);
+ SEMAPHORE_OFF;
+}
+
+int TScreenX11::System(const char *command, pid_t *pidChild, int in, int out,
+ int err)
+{
+ if (!pidChild)
+ {
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+ return system(command);
+ }
+
+ pid_t cpid=fork();
+ if (cpid==0)
+ {// Ok, we are the child
+ // I'm not sure about it, but is the best I have right now.
+ // Doing it we can kill this child and all the subprocesses
+ // it creates by killing the group. It also have an interesting
+ // effect that I must evaluate: By doing it this process lose
+ // the controlling terminal and won't be able to read/write
+ // to the parents console. I think that's good.
+ if (setsid()==-1)
+ _exit(127);
+
+ // If the caller asks for redirection replace the requested handles
+ if (in!=-1)
+ dup2(in,STDIN_FILENO);
+ if (out!=-1)
+ dup2(out,STDOUT_FILENO);
+ if (err!=-1)
+ dup2(err,STDERR_FILENO);
+
+ if (NO_EXEC_IN_THREAD && IS_SECOND_THREAD_ON)
+ {// That's very Linux specific:
+ // For some (unknown) reason we can't use exec here. If we use exec then
+ // the update thread dies and the "monitoring" thread becomes a Zombie.
+ // The only safe way is to call system(), it have code to stop
+ // multithreading and then call exec. That's the only safe way.
+ //pthread_kill_other_threads_np(); <= Useless
+
+ // Note: this solution is incomplete, if the user tries to kill the
+ // child using pidChild then the update thread will misteriously die.
+ // For this reason I use a watchdog that checks if the thread worked
+ // in the last second. If not we revert to manual screen update.
+
+ system(command);
+ // Here we must exit but without deallocating resources! just exit,
+ // that's all
+ _exit(0);
+ }
+ else
+ {// This is much more efficient, but only works if pthreads are off.
+ char *argv[4];
+ argv[0]=newStr(getenv("SHELL"));
+ if (!argv[0])
+ argv[0]=newStr("/bin/sh");
+ argv[1]=newStr("-c");
+ argv[2]=newStr(command);
+ argv[3]=0;
+ execvp(argv[0],argv);
+ delete[] argv[0];
+ delete[] argv[1];
+ delete[] argv[2];
+ // We get here only if exec failed
+ _exit(127);
+ }
+ }
+ if (cpid==-1)
+ {// Fork failed do it manually
+ *pidChild=0;
+ return system(command);
+ }
+ *pidChild=cpid;
+ return 0;
+}
+
+uchar TScreenX11::shapeFont10x20[]=
+{
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x4C,0x80,0x4C,0x80,0x7C,0x80,0x79,0x80,0x73,0x80,0x73,0x80,0x73,0x80,0x7F,0x80,0x73,0x80,0x73,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x67,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x36,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x67,0x80,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x36,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x6D,0x80,0x6D,0x80,0x6F,0x80,0x6C,0x00,0x6C,0x00,0x6D,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x7F,0x80,0x7F,0x80,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x7E,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x00,0x00,0x1F,0x80,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x7C,0x00,0x60,0x00,0x60,0x00,0x78,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x0F,0x80,0x0C,0x00,0x0C,0x00,0x0F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x3C,0x00,0x66,0x00,0x60,0x00,0x60,0x00,0x66,0x00,0x3C,0x00,0x00,0x00,0x1F,0x00,0x19,0x80,0x19,0x80,0x1F,0x00,0x1E,0x00,0x1B,0x00,0x19,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3E,0x00,0x00,0x00,0x0F,0x80,0x0C,0x00,0x0C,0x00,0x0F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,0x55,0x40,0x00,0x00,0xAA,0x80,0x00,0x00,
+ 0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,0x55,0x40,0xAA,0x80,
+ 0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,0x55,0x40,0xFF,0xC0,0xAA,0x80,0xFF,0xC0,
+ 0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,
+ 0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,
+ 0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,0x07,0xC0,
+ 0x00,0x00,0x00,0x00,0x66,0x00,0x76,0x00,0x7E,0x00,0x7E,0x00,0x6E,0x00,0x66,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x3C,0x00,0x3C,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x1F,0x80,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x38,0x00,0x0E,0x00,0x03,0x80,0x0E,0x00,0x38,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x0E,0x00,0x38,0x00,0xE0,0x00,0x38,0x00,0x0E,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x06,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x18,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x07,0x80,0x1F,0x80,0x7F,0x80,0x7F,0x80,0x1F,0x80,0x07,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x78,0x00,0x7E,0x00,0x7F,0x80,0x7F,0x80,0x7E,0x00,0x78,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x6D,0x80,0x4C,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x4C,0x80,0x6D,0x80,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0xFF,0x80,0xFF,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0xFF,0x80,0xFF,0x80,0x60,0x00,0x30,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x6D,0x80,0x4C,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x4C,0x80,0x6D,0x80,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x33,0x00,0x61,0x80,0xFF,0xC0,0xFF,0xC0,0x61,0x80,0x33,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x19,0x80,0x31,0x80,0x7F,0x80,0x7F,0x80,0x30,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x3F,0xC0,0x1B,0x00,0x1B,0x00,0x1B,0x00,0x7F,0x80,0x36,0x00,0x36,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x3F,0x00,0x6D,0x80,0x6C,0x00,0x6C,0x00,0x6C,0x00,0x3F,0x00,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x6D,0x80,0x3F,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x6F,0x00,0x3B,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x1B,0x80,0x1E,0xC0,0x36,0xC0,0x33,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x3C,0x00,0x18,0x00,0x38,0x00,0x6C,0x00,0x66,0xC0,0x63,0x80,0x63,0x00,0x77,0x80,0x3C,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x7F,0x80,0x1E,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1C,0x00,0x3C,0x00,0x6C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x0E,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x01,0x80,0x03,0x00,0x0E,0x00,0x03,0x00,0x01,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x07,0x00,0x0F,0x00,0x1B,0x00,0x33,0x00,0x63,0x00,0x63,0x00,0x7F,0x80,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x01,0x80,0x21,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x67,0x80,0x6F,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6F,0x00,0x66,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x66,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x67,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x63,0x00,0x63,0x00,0x66,0x00,0x66,0x00,0x7C,0x00,0x66,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x73,0x80,0x73,0x80,0x7F,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x71,0x80,0x71,0x80,0x79,0x80,0x79,0x80,0x6D,0x80,0x6D,0x80,0x67,0x80,0x67,0x80,0x63,0x80,0x63,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x6D,0x80,0x67,0x80,0x33,0x00,0x1F,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x30,0x00,0x1E,0x00,0x03,0x00,0x01,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x73,0x80,0x73,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x1E,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x03,0x00,0x03,0x00,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x73,0x00,0x6E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x1D,0x80,0x33,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x19,0x80,0x19,0x80,0x18,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x80,0x63,0x80,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x60,0x00,0x3F,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x3F,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x00,0x00,0x07,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x31,0x80,0x31,0x80,0x31,0x80,0x1F,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x63,0x00,0x66,0x00,0x6C,0x00,0x78,0x00,0x7C,0x00,0x66,0x00,0x63,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5B,0x00,0x7F,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x73,0x00,0x6E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0x80,0x33,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0x00,0x39,0x80,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x60,0x00,0x3F,0x00,0x01,0x80,0x01,0x80,0x61,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x19,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x7F,0x80,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x33,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x3F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x78,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x80,0x6D,0x80,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x0F,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xF8,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xFF,0xC0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x04,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x13,0xC0,0x10,0x00,0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xC0,0x10,0x00,0x13,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x13,0xC0,0x10,0x00,0x13,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x08,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF2,0x00,0x02,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF3,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x02,0x00,0xF2,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF2,0x00,0x02,0x00,0xF2,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0xF3,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0xF3,0xC0,0x00,0x00,0xF3,0xC0,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x12,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x00,0x60,0x00,0x60,0x00,0x61,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x19,0x80,0x19,0x80,0x18,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x7C,0x00,0x56,0xC0,0x73,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x3F,0x00,0x6D,0x80,0x6C,0x00,0x6C,0x00,0x6C,0x00,0x3F,0x00,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x6D,0x80,0x3F,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x3F,0x00,0x0C,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x63,0x00,0x30,0x00,0x3C,0x00,0x66,0x00,0x33,0x00,0x19,0x80,0x0F,0x00,0x03,0x00,0x31,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x5E,0x80,0x52,0x80,0x50,0x80,0x52,0x80,0x5E,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x21,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x80,0x0D,0x80,0x1B,0x00,0x36,0x00,0x6C,0x00,0xD8,0x00,0x6C,0x00,0x36,0x00,0x1B,0x00,0x0D,0x80,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x7F,0x80,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x5E,0x80,0x52,0x80,0x5E,0x80,0x54,0x80,0x56,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x06,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x77,0x00,0x7D,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x7F,0x80,0x7D,0x80,0x7D,0x80,0x7D,0x80,0x3D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x0D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x38,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x6C,0x00,0x36,0x00,0x1B,0x00,0x0D,0x80,0x06,0xC0,0x0D,0x80,0x1B,0x00,0x36,0x00,0x6C,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x60,0x00,0x20,0x80,0x21,0x00,0x72,0x00,0x04,0x00,0x09,0x00,0x13,0x00,0x25,0x00,0x4F,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x60,0x00,0x20,0x80,0x21,0x00,0x72,0x00,0x04,0x00,0x0B,0x00,0x14,0x80,0x20,0x80,0x41,0x00,0x02,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x08,0x00,0x30,0x80,0x09,0x00,0x72,0x00,0x04,0x00,0x09,0x00,0x13,0x00,0x25,0x00,0x4F,0x80,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x1E,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x1E,0x00,0x36,0x00,0x36,0x00,0x66,0x00,0x66,0x00,0x7F,0x80,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x67,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x61,0x80,0x33,0x00,0x1E,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00,
+ 0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0xF9,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x61,0x80,0x71,0x80,0x79,0x80,0x79,0x80,0x6D,0x80,0x6D,0x80,0x67,0x80,0x67,0x80,0x63,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0x1F,0x00,0x33,0x00,0x63,0x80,0x63,0x80,0x65,0x80,0x65,0x80,0x65,0x80,0x69,0x80,0x69,0x80,0x69,0x80,0x71,0x80,0x33,0x00,0x3E,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3F,0x00,0x31,0x80,0x31,0x80,0x31,0x80,0x31,0x80,0x31,0x80,0x3F,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x1B,0x00,0x31,0x80,0x31,0x80,0x33,0x00,0x76,0x00,0x36,0x00,0x33,0x00,0x31,0x80,0x31,0x80,0x31,0x80,0x33,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3E,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x00,0x4D,0x80,0x0D,0x80,0x0F,0x00,0x3C,0x00,0x6C,0x00,0x6C,0x80,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x0C,0x00,0x06,0x00,0x36,0x00,0x1C,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x07,0xC0,0x01,0x80,0x1D,0x80,0x33,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x3F,0x00,0x26,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x7F,0x80,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x1F,0x00,0x33,0x00,0x65,0x80,0x65,0x80,0x69,0x80,0x69,0x80,0x33,0x00,0x3E,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3E,0x00,0x33,0x00,0x31,0x80,0x31,0x80,0x31,0x80,0x33,0x00,0x3E,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x33,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,
+};
+
+uchar TScreenX11::shapeFont8x16[]=
+{
+ 0x00,0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00,0x00, // 0
+ 0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x6E,0xF8,0xD8,0xD8,0xDC,0xD8,0xD8,0xD8,0xF8,0x6E,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 
+ 0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 
+ 0x00,0x70,0x88,0x80,0x88,0x70,0x00,0x3C,0x22,0x3C,0x24,0x22,0x00,0x00,0x00,0x00, // 
+ 0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 
+ 0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, // \t
+ 0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, // \n
+ 0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, //
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // \r
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, // 
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, // 
+ 0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00,0x00,0x00, // 
+ 0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x0E,0x38,0xE0,0x38,0x0E,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0xE0,0x38,0x0E,0x38,0xE0,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x06,0x0C,0xFE,0x18,0x30,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x06,0x1E,0x7E,0xFE,0x7E,0x1E,0x06,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0xC0,0xF0,0xFC,0xFE,0xFC,0xF0,0xC0,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 0x1A
+ 0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x28,0x6C,0xFE,0x6C,0x28,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+ 0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // !
+ 0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+ 0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, // #
+ 0x00,0x10,0x10,0x7C,0xD6,0xD0,0xD0,0x7C,0x16,0x16,0xD6,0x7C,0x10,0x10,0x00,0x00, // $
+ 0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00, // %
+ 0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // &
+ 0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+ 0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00, // (
+ 0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00, // )
+ 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, // *
+ 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // +
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, // ,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // -
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // .
+ 0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0xC0,0x00,0x00,0x00,0x00,0x00, // /
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 0
+ 0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00, // 1
+ 0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00, // 2
+ 0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 3
+ 0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00, // 4
+ 0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 5
+ 0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 6
+ 0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, // 7
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 8
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00, // 9
+ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // :
+ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, // ;
+ 0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00, // <
+ 0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // =
+ 0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00, // >
+ 0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // ?
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00, // @
+ 0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // A
+ 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // B
+ 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, // C
+ 0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, // D
+ 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // E
+ 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // F
+ 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00, // G
+ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // H
+ 0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // I
+ 0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, // J
+ 0x00,0x00,0xE6,0x66,0x66,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // K
+ 0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // L
+ 0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // M
+ 0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // N
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // O
+ 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // P
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00, // Q
+ 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // R
+ 0x00,0x00,0x7C,0xC6,0xC6,0x64,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // S
+ 0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // T
+ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // U
+ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00, // V
+ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0x6C,0x00,0x00,0x00,0x00, // W
+ 0x00,0x00,0xC6,0xC6,0x6C,0x7C,0x38,0x38,0x7C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00, // X
+ 0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Y
+ 0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // Z
+ 0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00, // [
+ 0x00,0x00,0x00,0x00,0x00,0xC0,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,0x00, // \ .
+ 0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00, // ]
+ 0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00, // _
+ 0x00,0x30,0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+ 0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // a
+ 0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00, // b
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // c
+ 0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // d
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // e
+ 0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // f
+ 0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00, // g
+ 0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // h
+ 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // i
+ 0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, // j
+ 0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, // k
+ 0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // l
+ 0x00,0x00,0x00,0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xD6,0xD6,0xC6,0x00,0x00,0x00,0x00, // m
+ 0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // n
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // o
+ 0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00, // p
+ 0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00, // q
+ 0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x66,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // r
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, // s
+ 0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, // t
+ 0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // u
+ 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, // v
+ 0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00,0x00, // w
+ 0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, // x
+ 0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, // y
+ 0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, // z
+ 0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // {
+ 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // |
+ 0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, // }
+ 0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+ 0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 
+ 0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // €
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ‚
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ƒ
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // „
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // …
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // †
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // ‡
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ˆ
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ‰
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Š
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ‹
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // Œ
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // Ž
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00, //
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ‘
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ’
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // “
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // ”
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // •
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x6F,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // –
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6F,0x60,0x6F,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // —
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ˜
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ™
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // š
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ›
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xEC,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // œ
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEC,0x0C,0xEC,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, //
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xEF,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // ž
+ 0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xEF,0x00,0xEF,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // Ÿ
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xFE,0x00,0x00,0x00,0x00, //  
+ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00, // ¡
+ 0x00,0x00,0x00,0x00,0x10,0x7C,0xD6,0xD0,0xD0,0xD0,0xD6,0x7C,0x10,0x00,0x00,0x00, // ¢
+ 0x00,0x00,0x38,0x6C,0x60,0x60,0xF0,0x60,0x60,0x66,0xF6,0x6C,0x00,0x00,0x00,0x00, // £
+ 0x00,0x00,0x00,0x00,0xC6,0x7C,0x6C,0x6C,0x7C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00, // ¤
+ 0x00,0x00,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // ¥
+ 0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // ¦
+ 0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, // §
+ 0x00,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ¨
+ 0x00,0x00,0x3C,0x42,0x99,0xA5,0xA1,0xA5,0x99,0x42,0x3C,0x00,0x00,0x00,0x00,0x00, // ©
+ 0x00,0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ª
+ 0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00, // «
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, // ¬
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ­
+ 0x00,0x00,0x3C,0x42,0xB9,0xA5,0xB9,0xA5,0xA5,0x42,0x3C,0x00,0x00,0x00,0x00,0x00, // ®
+ 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ¯
+ 0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // °
+ 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x7E,0x00,0x00,0x00,0x00, // ±
+ 0x38,0x6C,0x18,0x30,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ²
+ 0x38,0x6C,0x18,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ³
+ 0x00,0x18,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ´
+ 0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xF6,0xC0,0xC0,0xC0,0x00, // µ
+ 0x00,0x00,0x7F,0xD6,0xD6,0x76,0x36,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, // ¶
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ·
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x6C,0x38,0x00, // ¸
+ 0x30,0x70,0x30,0x30,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ¹
+ 0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // º
+ 0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00, // »
+ 0x00,0x60,0xE0,0x60,0x66,0x0C,0x18,0x30,0x66,0xCE,0x1A,0x3F,0x06,0x06,0x00,0x00, // ¼
+ 0x00,0x60,0xE0,0x60,0x66,0x0C,0x18,0x30,0x6E,0xDB,0x06,0x0C,0x1F,0x00,0x00,0x00, // ½
+ 0x70,0xD8,0x30,0xD8,0x76,0x0C,0x18,0x30,0x66,0xCE,0x1A,0x3F,0x06,0x06,0x00,0x00, // ¾
+ 0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x30,0x60,0xC6,0xC6,0x7C,0x00,0x00, // ¿
+ 0x60,0x30,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // À
+ 0x0C,0x18,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Á
+ 0x10,0x38,0x6C,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Â
+ 0x76,0xDC,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Ã
+ 0x00,0x6C,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Ä
+ 0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Å
+ 0x00,0x00,0x3E,0x78,0xD8,0xD8,0xFC,0xD8,0xD8,0xD8,0xD8,0xDE,0x00,0x00,0x00,0x00, // Æ
+ 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x66,0x3C,0x00, // Ç
+ 0x60,0x30,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, // È
+ 0x0C,0x18,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, // É
+ 0x10,0x38,0x6C,0x00,0xFE,0x66,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, // Ê
+ 0x00,0x6C,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, // Ë
+ 0x60,0x30,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Ì
+ 0x06,0x0C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Í
+ 0x18,0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Î
+ 0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Ï
+ 0x00,0x00,0xF8,0x6C,0x66,0x66,0xF6,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, // Ð
+ 0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // Ñ
+ 0x60,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ò
+ 0x0C,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ó
+ 0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ô
+ 0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Õ
+ 0x00,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ö
+ 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0x18,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, // ×
+ 0x00,0x00,0x7E,0xC6,0xCE,0xCE,0xDE,0xF6,0xE6,0xE6,0xC6,0xFC,0x00,0x00,0x00,0x00, // Ø
+ 0x60,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ù
+ 0x0C,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ú
+ 0x10,0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Û
+ 0x00,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // Ü
+ 0x06,0x0C,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Ý
+ 0x00,0x00,0xF0,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00,0x00,0x00, // Þ
+ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xCC,0xC6,0xC6,0xC6,0xD6,0xDC,0x80,0x00,0x00,0x00, // ß
+ 0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // à
+ 0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // á
+ 0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // â
+ 0x00,0x00,0x76,0xDC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ã
+ 0x00,0x00,0x00,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ä
+ 0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // å
+ 0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0x1B,0x7F,0xD8,0xDB,0x7E,0x00,0x00,0x00,0x00, // æ
+ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x18,0x6C,0x38,0x00, // ç
+ 0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // è
+ 0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // é
+ 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // ê
+ 0x00,0x00,0x00,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // ë
+ 0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // ì
+ 0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // í
+ 0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // î
+ 0x00,0x00,0x00,0x6C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // ï
+ 0x00,0x78,0x30,0x78,0x0C,0x7E,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ð
+ 0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // ñ
+ 0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ò
+ 0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ó
+ 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ô
+ 0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // õ
+ 0x00,0x00,0x00,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // ö
+ 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // ÷
+ 0x00,0x00,0x00,0x00,0x00,0x7E,0xCE,0xDE,0xFE,0xF6,0xE6,0xFC,0x00,0x00,0x00,0x00, // ø
+ 0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ù
+ 0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ú
+ 0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // û
+ 0x00,0x00,0x00,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // ü
+ 0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, // ý
+ 0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,0x00, // þ
+ 0x00,0x00,0x00,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00 // 255
+};
+
+TScreenFont256 TScreenX11::font8x16={ 8,16,shapeFont8x16 };
+TScreenFont256 TScreenX11::font10x20={ 10,20,shapeFont10x20 };
+TScreenFont256 *TScreenX11::defaultFont=&font8x16;
+
+void TScreenX11::AdjustCursorImage()
+{
+ if (cursorImage)
+ XDestroyImage(cursorImage);
+ cursorData=(char *)malloc(fontSz);
+ cursorImage=XCreateImage(disp,visual,1,XYBitmap,0,cursorData,fontW,fontH,8,0);
+ cursorImage->byte_order=cursorImage->bitmap_bit_order=MSBFirst;
+}
+
+TScreenX11::TScreenX11()
+{
+ memset(ximgFont,0,sizeof(XImage *)*256);
+ memset(ximgSecFont,0,sizeof(XImage *)*256);
+
+ /* Try to connect to the X server */
+ disp=XOpenDisplay(NULL);
+ /* If we fail just return */
+ if (!disp)
+ return;
+ /* Allocate memory for these structures. Note that is safer to do it instead
+ of using a static structure because the number of fields can change. */
+ sizeHints=XAllocSizeHints();
+ classHint=XAllocClassHint();
+ if (!sizeHints || !classHint)
+ return;
+
+ /* Don't need special rights anymore */
+ seteuid(getuid());
+ setegid(getgid());
+
+ /* Initialize driver */
+ initialized=1;
+ if (dCB) dCB();
+
+ maxX=80; maxY=25;
+ fontW=8; fontH=16;
+
+ /* Look for defaults */
+
+ /* Code page */
+ optSearch("AppCP",forcedAppCP);
+ optSearch("ScrCP",forcedScrCP);
+ optSearch("InpCP",forcedInpCP);
+ /* User settings have more priority than detected settings */
+ codePage=new TVCodePage(forcedAppCP!=-1 ? forcedAppCP : TVCodePage::ISOLatin1Linux,
+ forcedScrCP!=-1 ? forcedScrCP : TVCodePage::ISOLatin1Linux,
+ forcedInpCP!=-1 ? forcedInpCP : TVCodePage::ISOLatin1Linux);
+ SetDefaultCodePages(TVCodePage::ISOLatin1Linux,TVCodePage::ISOLatin1Linux,
+ TVCodePage::ISOLatin1Linux);
+
+ long aux;
+ if (optSearch("ScreenWidth",aux))
+ maxX=aux;
+ if (optSearch("ScreenHeight",aux))
+ maxY=aux;
+ if (optSearch("FontWidth",aux))
+ fontW=aux;
+ if (optSearch("FontHeight",aux))
+ fontH=aux;
+ if (optSearch("Font10x20",aux) && aux)
+ fontW=10, fontH=20;
+
+ if (fontW==10 || fontH==20)
+ defaultFont=&font10x20;
+ else
+ defaultFont=&font8x16;
+ TScreenFont256 *useFont;
+ int freeFontData=1;
+ if (!frCB || !(useFont=frCB(0,fontW,fontH)))
+ {
+ useFont=defaultFont;
+ freeFontData=0;
+ }
+ fontW=useFont->w;
+ fontH=useFont->h;
+ fontWb=(useFont->w+7)/8;
+ fontSz=fontWb*fontH;
+ uchar *fontData=useFont->data;
+
+ aux=0;
+ TScreenFont256 *secFont=NULL;
+ if (frCB && optSearch("LoadSecondaryFont",aux) && aux)
+ secFont=frCB(1,fontW,fontH);
+
+ /* Setting to fine tune this driver */
+ aux=1;
+ if (optSearch("HideCursorWhenNoFocus",aux))
+ hideCursorWhenNoFocus=aux;
+ if (optSearch("DontResizeToCells",aux))
+ dontResizeToCells=aux;
+
+ TDisplayX11::Init();
+
+ TScreen::clearScreen=clearScreen;
+ TScreen::getCharacters=getCharacters;
+ TScreen::getCharacter=getCharacter;
+ TScreen::setCharacter=setCharacter;
+ TScreen::setCharacters=setCharacters;
+ TScreen::System_p=System;
+ TScreen::setWindowTitle=setWindowTitle;
+ TScreen::getWindowTitle=getWindowTitle;
+ TScreen::setDisPaletteColors=SetDisPaletteColors;
+ TScreen::getFontGeometry=GetFontGeometry;
+ TScreen::getFontGeometryRange=GetFontGeometryRange;
+ TScreen::setFont_p=SetFont;
+ TScreen::restoreFonts=RestoreFonts;
+ TScreen::setCrtModeRes_p=SetCrtModeRes;
+ TDisplay::beep=Beep;
+ TScreen::openHelperApp=OpenHelperApp;
+ TScreen::closeHelperApp=CloseHelperApp;
+ TScreen::sendFileToHelper=SendFileToHelper;
+ TScreen::getHelperAppError=GetHelperAppError;
+
+ TVX11Clipboard::Init();
+ TGKeyX11::Init();
+ THWMouseX11::Init();
+
+ /* Initialize common variables */
+ cShapeFrom=fontH*875/1000;
+ cShapeTo=fontH;
+ setCrtData();
+ startupCursor=cursorLines;
+ startupMode=screenMode;
+ screenBuffer=new ushort[screenWidth*screenHeight];
+
+ /* Get screen and graphic context */
+ screen=DefaultScreen(disp);
+ gc=DefaultGC(disp,screen);
+ visual=DefaultVisual(disp,screen);
+
+ /* Create what we'll use as font */
+ CreateXImageFont(0,fontData,fontW,fontH);
+ if (freeFontData)
+ {/* Provided by the call back */
+ DeleteArray(useFont->data);
+ delete useFont;
+ }
+ if (secFont)
+ {
+ CreateXImageFont(1,secFont->data,fontW,fontH);
+ DeleteArray(secFont->data);
+ delete secFont;
+ }
+
+ /* Create the cursor image */
+ AdjustCursorImage();
+
+ /* Set the locales */
+ if (setlocale(LC_ALL,"")==NULL)
+ fprintf(stderr,"Error: setlocale()!\n");
+
+ /* Create a simple window */
+ rootWin=RootWindow(disp,screen);
+ mainWin=XCreateSimpleWindow(disp,rootWin,
+ 0,0, /* win position */
+ maxX*fontW,maxY*fontH, /* win size */
+ 0, /* frame width */
+ BlackPixel(disp,screen), /* Border color */
+ BlackPixel(disp,screen)); /* Background */
+
+ /* This is useful if we use subwindows.
+ hints.flags=InputHint;
+ hints.input=True;
+ XSetWMHints(disp,mainWin,&hints);*/
+ /* This is how we provide a title for the window.
+ If the application wants it should call setWindowTitle.
+ XTextProperty name;
+ char *s="Test";
+ XStringListToTextProperty(&s,1,&name);*/
+
+ classHint->res_name=newStr("tvapp"); /* Take resources for tvapp */
+ classHint->res_class=newStr("XTVApp"); /* X Turbo Vision Application */
+
+ /* Size hints are just hints, not all WM take care about them */
+ sizeHints->flags=PResizeInc | PMinSize | PBaseSize;
+ /* Fonts increments */
+ sizeHints->width_inc =fontW;
+ sizeHints->height_inc=fontH;
+ sizeHints->min_width =fontW*40;
+ sizeHints->min_height=fontH*20;
+ sizeHints->base_width=sizeHints->base_height=0;
+
+ XSetWMProperties(disp,mainWin,
+ NULL, /* Visible title, i.e. &name */
+ NULL, /* Icon title, i.e. &name */
+ NULL,0, /* Command line */
+ sizeHints, /* Normal size hints, resize increments */
+ NULL, /* Window manager hints, nothing (i.e. icon) */
+ classHint); /* Resource name and class of window */
+
+ /* This is needed to release the memory used for the title
+ XFree((char *)name.value);*/
+
+ /* Ask to be notified when they kill the window */
+ theProtocols=XInternAtom(disp,"WM_DELETE_WINDOW",True);
+ XSetWMProtocols(disp,mainWin,&theProtocols,1);
+
+ /* Initialize the Input Context for international support */
+ if ((xim=XOpenIM(disp,NULL,NULL,NULL))==NULL)
+ {
+ printf("Error: XOpenIM()!\n");
+ exit(0);
+ }
+ xic=XCreateIC(xim,XNInputStyle,XIMPreeditNothing | XIMStatusNothing,
+ XNClientWindow,mainWin,NULL);
+ if (xic==NULL)
+ {
+ printf("Error: XCreateIC()!\n");
+ XCloseIM(xim);
+ exit(0);
+ }
+ // This prints which locale was detected for the X Input Methode.
+ // It should have a very big impact in the way input is interpreted, but I
+ // couldn't verify it. I'm trying using japanese ;-)
+ //printf("Locale: %s\n",XLocaleOfIM(xim));
+
+ /* We will accept the Input Context default events ... */
+ unsigned long mask, fevent;
+ XGetICValues(xic,XNFilterEvents,&fevent,NULL);
+ /* plus these */
+ mask=ExposureMask | KeyPressMask | KeyReleaseMask | FocusChangeMask |
+ StructureNotifyMask | ButtonPressMask | ButtonReleaseMask |
+ ButtonMotionMask/*PointerMotionMask*/;
+ XSelectInput(disp,mainWin,mask|fevent);
+
+ /* OK, now put the window on the display */
+ XMapWindow(disp,mainWin);
+
+ /* Map the VGA Text BIOS colors */
+ cMap=DefaultColormap(disp,screen);
+ XColor query;
+ TScreenColor *pal=parseUserPalette() ? UserStartPalette : PC_BIOSPalette;
+ for (int col=0; col<16; col++)
+ {
+ query.red =pal[col].R*256;
+ query.green=pal[col].G*256;
+ query.blue =pal[col].B*256;
+ query.flags= ~0;
+ XAllocColor(disp,cMap,&query);
+ colorMap[col]=query.pixel;
+ }
+ memcpy(ActualPalette,pal,sizeof(ActualPalette));
+
+ /* A graphics context for the text cursor */
+ cursorGC=XCreateGC(disp,mainWin,0,0);
+
+ /* Create the cursor timer */
+ gettimeofday(&refCursorTime,0);
+
+ XSetBackground(disp,gc,colorMap[0]);
+ XSetForeground(disp,gc,colorMap[7]);
+ clearScreen();
+
+ // Setup the driver properties.
+ // Our code page isn't fixed.
+ // We can change the palette.
+ // A redraw is needed after setting the palette. But currently is in the color setting.
+ // We can set the fonts and even change their size.
+ flags0=CanSetPalette | CanReadPalette | CodePageVar | CursorShapes /*| PalNeedsRedraw*/ |
+ CanSetBFont | CanSetSBFont | CanSetFontSize | CanSetVideoSize |
+ NoUserScreen;
+
+ if (createCursors())
+ TScreen::showBusyState=ShowBusyState;
+
+ START_UPDATE_THREAD;
+}
+
+void TScreenX11::CreateXImageFont(int which, uchar *font, unsigned w, unsigned h)
+{
+ char *data;
+ int i,bytesLine,bytesShape;
+
+ bytesLine=(w+7)/8;
+ bytesShape=bytesLine*h;
+ XImage **f=which ? ximgSecFont : ximgFont;
+ for (i=0; i<256; font+=bytesShape, i++)
+ {/* Load the shape */
+ data=(char *)malloc(bytesShape);
+ memcpy(data,font,bytesShape);
+ /* Create a BitMap Image with this data */
+ f[i]=XCreateImage(disp,visual,1,XYBitmap,0,data,w,h,8,0);
+ /* Set the bit order, this is faster */
+ f[i]->byte_order=f[i]->bitmap_bit_order=MSBFirst;
+ }
+ if (which)
+ useSecondaryFont=1;
+}
+
+void TScreenX11::DestroyXImageFont(int which)
+{
+ int i;
+
+ if (which)
+ {
+ if (useSecondaryFont)
+ {
+ for (i=0; i<256; i++)
+ if (ximgSecFont[i])
+ XDestroyImage(ximgSecFont[i]);
+ useSecondaryFont=0;
+ }
+ }
+ else
+ for (i=0; i<256; i++)
+ if (ximgFont[i])
+ XDestroyImage(ximgFont[i]);
+}
+
+int TScreenX11::setWindowTitle(const char *aName)
+{
+ SEMAPHORE_ON;
+ XTextProperty name;
+ char *s=(char *)aName;
+ XStringListToTextProperty(&s,1,&name);
+ XSetWMName(disp,mainWin,&name);
+ XFree((char *)name.value);
+ SEMAPHORE_OFF;
+
+ return 1;
+}
+
+const char *TScreenX11::getWindowTitle(void)
+{
+ SEMAPHORE_ON;
+ XTextProperty name;
+ const char *ret=NULL;
+ if (XGetWMName(disp,mainWin,&name))
+ {
+ char *s=newStr((char *)name.value);
+ XFree((char *)name.value);
+ ret=s;
+ }
+ SEMAPHORE_OFF;
+
+ return ret;
+}
+
+int TScreenX11::SetDisPaletteColors(int from, int number, TScreenColor *colors)
+{
+ SEMAPHORE_ON;
+ XColor query;
+ int i;
+ ulong newMap[16];
+
+ for (i=0; i<number; i++)
+ {
+ query.red =colors[i].R*256;
+ query.green=colors[i].G*256;
+ query.blue =colors[i].B*256;
+ query.flags= ~0;
+ if (!XAllocColor(disp,cMap,&query))
+ break;
+ newMap[i]=query.pixel;
+ }
+ if (i>0)
+ {// If we allocated at least one color:
+ // Deallocated the old colors
+ XFreeColors(disp,cMap,colorMap+from,i,0);
+ // Copy the new ones
+ memcpy(colorMap+from,newMap,sizeof(ulong)*i);
+ // Force a redraw. This is not needed for 8 bpp.
+ // Is just a dirty hack.
+ FullRedraw();
+ }
+ SEMAPHORE_OFF;
+ return i;
+}
+
+void TScreenX11::FullRedraw()
+{
+ unsigned y,off;
+ for (y=0,off=0; y<(unsigned)maxY; y++,off+=maxX)
+ redrawBuf(0,y,maxX,off);
+}
+
+/*****************************************************************************
+ Routines to create a blinking cursor
+*****************************************************************************/
+
+void TScreenX11::UnDrawCursor()
+{
+ if (!cursorInScreen)
+ return;
+ SEMAPHORE_ON;
+ unsigned offset=cursorX+cursorY*maxX;
+ uchar *theChar=(uchar *)(screenBuffer+offset);
+ uchar newChar=theChar[charPos];
+ uchar newAttr=theChar[attrPos];
+
+ XSetBgFgC(newAttr);
+ drawChar(cursorGC,cursorX*fontW,cursorY*fontH,newChar,newAttr);
+ cursorInScreen=0;
+ SEMAPHORE_OFF;
+ return;
+}
+
+void TScreenX11::XSetBgFgC(uint16 attr)
+{
+ int bg=attr>>4;
+ int fg=attr & 0xF;
+ if (bg==fg)
+ fg=~bg & 0xF;
+ XSetBackground(disp,cursorGC,colorMap[bg]);
+ XSetForeground(disp,cursorGC,colorMap[fg]);
+}
+
+void TScreenX11::XSetBgFg(uint16 attr)
+{
+ int bg=attr>>4;
+ int fg=attr & 0xF;
+ XSetBackground(disp,gc,colorMap[bg]);
+ XSetForeground(disp,gc,colorMap[fg]);
+}
+
+void TScreenX11::DrawCursor()
+{
+ //fprintf(stderr,"DrawCursor: cursorEnabled=%d\n",cursorEnabled);
+ if (cursorEnabled)
+ {
+ SEMAPHORE_ON;
+ cursorInScreen=!cursorInScreen;
+
+ /* Create an image with the character under cursor */
+ unsigned offset=cursorX+cursorY*maxX;
+ uchar *theChar=(uchar *)(screenBuffer+offset);
+ int attr=theChar[attrPos];
+ XSetBgFgC(attr);
+ memcpy(cursorData,useSecondaryFont && (attr & 8) ?
+ ximgSecFont[theChar[charPos]]->data :
+ ximgFont[theChar[charPos]]->data,fontSz);
+
+ //fprintf(stderr,"DrawCursor: cursorInScreen=%d from/to %d/%d\n",cursorInScreen,cShapeFrom,cShapeTo);
+ /* If the cursor is on draw it over the character */
+ if (cursorInScreen)
+ memset(cursorData+cShapeFrom*fontWb,0xFF,(cShapeTo-cShapeFrom)*fontWb);
+
+ /* Now put it in the screen */
+ XPutImage(disp,mainWin,cursorGC,cursorImage,0,0,cursorPX,cursorPY,fontW,fontH);
+ XFlush(disp);
+ SEMAPHORE_OFF;
+ }
+}
+
+void TScreenX11::DisableCursor()
+{
+ cursorEnabled=0;
+ UnDrawCursor();
+}
+
+void TScreenX11::EnableCursor()
+{
+ cursorEnabled=1;
+ //DrawCursor();
+}
+
+static
+void SubstractRef(timeval &curCursorTime, timeval &refCursorTime)
+{
+ curCursorTime.tv_sec-=refCursorTime.tv_sec;
+ if (curCursorTime.tv_usec<refCursorTime.tv_usec)
+ {
+ curCursorTime.tv_sec--;
+ curCursorTime.tv_usec=curCursorTime.tv_usec-refCursorTime.tv_usec+1000000;
+ }
+ else
+ curCursorTime.tv_usec-=refCursorTime.tv_usec;
+}
+
+/*****************************************************************************
+ Events processing
+*****************************************************************************/
+
+void TScreenX11::ProcessGenericEvents()
+{
+ SEMAPHORE_ON;
+ XEvent event;
+ unsigned lastW, lastH;
+ unsigned newPW, newPH;
+
+ // Cursor blinking stuff.
+ // Current time
+ gettimeofday(&curCursorTime,0);
+ // Substract the reference
+ curCursorTime.tv_sec-=refCursorTime.tv_sec;
+ SubstractRef(curCursorTime,refCursorTime);
+
+ if (curCursorTime.tv_sec>0 || curCursorTime.tv_usec>cursorDelay)
+ {
+ DrawCursor();
+ gettimeofday(&refCursorTime,0);
+ }
+ while (1)
+ {
+ /* Check if we have generic events in the queue */
+ if (XCheckMaskEvent(disp,~(aMouseEvent|aKeyEvent),&event)!=True)
+ {
+ /* Process message that doesn't have mask */
+ if (XCheckTypedEvent(disp,ClientMessage,&event)==True)
+ {
+ if ((Atom)event.xclient.data.l[0]==theProtocols)
+ {
+ TGKeyX11::sendQuit=1;
+ }
+ }
+ else if (XCheckTypedEvent(disp,SelectionRequest,&event)==True)
+ {// Another application wants the content of our clipboard
+ XEvent respond;
+ XSelectionRequestEvent *req=&(event.xselectionrequest);
+ if (req->target==XA_STRING && TVX11Clipboard::buffer)
+ {
+ XChangeProperty(disp,req->requestor,req->property,XA_STRING,
+ 8/*bits*/,PropModeReplace,
+ (const uchar *)TVX11Clipboard::buffer,
+ TVX11Clipboard::length);
+ respond.xselection.property=req->property;
+ }
+ else // Strings only please
+ respond.xselection.property= None;
+ respond.xselection.type=SelectionNotify;
+ respond.xselection.display=req->display;
+ respond.xselection.requestor=req->requestor;
+ respond.xselection.selection=req->selection;
+ respond.xselection.target=req->target;
+ respond.xselection.time=req->time;
+ XSendEvent(disp,req->requestor,0,0,&respond);
+ XFlush(disp);
+ }
+ else if (XCheckTypedEvent(disp,SelectionNotify,&event)==True)
+ {
+ TVX11Clipboard::waiting=0;
+ TVX11Clipboard::property=event.xselection.property;
+ }
+ SEMAPHORE_OFF;
+ return;
+ }
+ /* Not sure if needed, but documentation says it helps if the event
+ should be redirected to another window */
+ if (XFilterEvent(&event,0)==True)
+ continue;
+
+ switch (event.type)
+ {
+ case Expose:
+ {
+ if (windowSizeChanged) // Ignore them until the application gets
+ break; // notified about the new size
+ /*printf("Expose: %d %d %d %d\n",event.xexpose.x,event.xexpose.y,
+ event.xexpose.width,event.xexpose.height);*/
+ int x=event.xexpose.x/fontW;
+ int y=event.xexpose.y/fontH;
+ unsigned src=y*maxX+x;
+
+ newPW=event.xexpose.x+event.xexpose.width;
+ int x2=newPW/fontW;
+ if (newPW%fontW) x2++;
+ if (x2>=maxX) x2=maxX;
+
+ newPW=event.xexpose.y+event.xexpose.height;
+ int y2=newPW/fontH;
+ if (newPW%fontH) y2++;
+ if (y2>=maxY) y2=maxY;
+
+ int w=x2-x;
+ int h=y2-y;
+
+ /*printf("x1,y1 %d,%d x2,y2 %d,%d w,h %d,%d\n",x,y,x2,y2,w,h);*/
+
+ while (h)
+ {
+ redrawBuf(x,y,w,src);
+ src+=maxX;
+ y++; h--;
+ }
+ XFlush(disp);
+ }
+ break;
+
+ case FocusIn:
+ //printf("Focus in\n");
+ if (xic)
+ XSetICFocus(xic);
+ EnableCursor();
+ break;
+
+ case FocusOut:
+ //printf("Focus out\n");
+ if (xic)
+ XUnsetICFocus(xic);
+ if (hideCursorWhenNoFocus)
+ DisableCursor();
+ break;
+
+ case ConfigureNotify:
+ /* Currently masked
+ if (event.xresizerequest.window!=mainWin)
+ break;*/
+
+ lastW=windowSizeChanged ? newX : maxX;
+ lastH=windowSizeChanged ? newY : maxY;
+ newX=event.xconfigure.width /fontW;
+ newY=event.xconfigure.height/fontH;
+
+ /* Minimal size */
+ if (newX<40) newX=40;
+ if (newY<20) newY=20;
+
+ /* If size changed indicate it */
+ if ((newX!=(int)lastW) || (newY!=(int)lastH))
+ windowSizeChanged=1;
+
+ /* KDE 3.1 alpha maximize doesn't use cell sizes and our resize
+ confuses KDE. */
+ if (dontResizeToCells)
+ break;
+
+ /* Force the window to have a size in chars */
+ newPW=fontW*newX;
+ newPH=fontH*newY;
+
+ if ((unsigned)event.xconfigure.width==newPW &&
+ (unsigned)event.xconfigure.height==newPH)
+ break;
+
+ //printf("Nuevo: %d,%d (%d,%d)\n",newX,newY,lastW,lastH);
+ XResizeWindow(disp,mainWin,newPW,newPH);
+ //printf("Nuevo 2: %d,%d\n",newX,newY);
+ break;
+ }
+ }
+ SEMAPHORE_OFF;
+}
+
+void TScreenX11::writeLine(int x, int y, int w, unsigned char *str, unsigned color)
+{
+ if (w<=0)
+ return; // Nothing to do
+
+ SEMAPHORE_ON;
+ XSetBgFg(color);
+ x*=fontW; y*=fontH;
+ UnDrawCursor();
+ XImage **f=(useSecondaryFont && (color & 8)) ? ximgSecFont : ximgFont;
+ while (w--)
+ {
+ XPutImage(disp,mainWin,gc,f[*str],0,0,x,y,fontW,fontH);
+ str++;
+ x+=fontW;
+ }
+ SEMAPHORE_OFF;
+}
+
+void TScreenX11::redrawBuf(int x, int y, unsigned w, unsigned off)
+{
+ int len = 0; /* longitud a escribir */
+ int letra = 0;
+ int color = 0;
+ int last = -1;
+ AllocLocalStr(tmp,w*sizeof(char));
+ uchar *dst = (uchar *)tmp;
+ uchar *b=(uchar *)(screenBuffer+off);
+
+ if (y>=maxY)
+ {
+ printf("Y=%d\n",y);
+ return;
+ }
+ while (w--)
+ {
+ letra=b[charPos];
+ color=b[attrPos];
+
+ if (color!=last)
+ {
+ if (last>=0)
+ {
+ writeLine(x,y,len,(uchar *)tmp,last); // Print last same color block
+ dst=(uchar *)tmp; x+=len; len=0;
+ }
+ last=color;
+ }
+ *dst++=letra; b+=2; len++;
+ }
+
+ writeLine(x,y,len,(uchar *)tmp,color); // Print last block
+}
+
+TScreen *TV_XDriverCheck()
+{
+ TScreenX11 *drv=new TScreenX11();
+ if (!TScreen::initialized)
+ {
+ delete drv;
+ return 0;
+ }
+ return drv;
+}
+
+/*****************************************************************************
+ X11 clipboard routines
+ This clipboard implementation is heavily based on the
+ X Windows Copy-Paste mini HOWTO by Stelios Xathakis, <axanth@tee.gr>
+*****************************************************************************/
+
+char *TVX11Clipboard::buffer=NULL;
+unsigned TVX11Clipboard::length=0;
+int TVX11Clipboard::waiting=0;
+Atom TVX11Clipboard::property=0;
+
+const char *TVX11Clipboard::x11NameError[]=
+{
+ NULL,
+ __("No available selection"),
+ __("Unsupported data type"),
+ __("No data"),
+ __("X11 error"),
+ __("Another application holds the clipboard")
+};
+
+void TVX11Clipboard::Init()
+{
+ TVOSClipboard::copy=copy;
+ TVOSClipboard::paste=paste;
+ TVOSClipboard::destroy=destroy;
+ TVOSClipboard::available=2; // We have 2 clipboards
+ TVOSClipboard::name="X11";
+ TVOSClipboard::errors=x11clipErrors;
+ TVOSClipboard::nameErrors=x11NameError;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Copies the content of the buffer to the X11 clipboard. The id value
+selects which clipboard we will use. As current recommendations says
+applications should use XA_CLIPBOARD that's id==0. For id==1 we use the
+XA_PRIMARY mechanism, this is the one used for "selections".@*
+ The string doesn't have to be null terminated, we ever copy len+1 bytes
+adding a 0 at the end.
+
+ Return: !=0 if ok.
+
+***************************************************************************/
+
+int TVX11Clipboard::copy(int id, const char *b, unsigned len)
+{
+ if (id>1) return 0;
+ Atom clip=id==0 ? XA_CLIPBOARD(TScreenX11::disp) : XA_PRIMARY;
+
+ // First create a copy, in X11 the clipboard is held by the application
+ if (buffer)
+ delete[] buffer;
+ length=len;
+ buffer=new char[length+1];
+ memcpy(buffer,b,len);
+ buffer[len]=0;
+ //printf("Copiando: `%s' %d\n",buffer,length);
+ SEMAPHORE_ON;
+ XSetSelectionOwner(TScreenX11::disp,clip,TScreenX11::mainWin,CurrentTime);
+ XFlush(TScreenX11::disp);
+ int ret=0;
+ if (XGetSelectionOwner(TScreenX11::disp,clip)==TScreenX11::mainWin)
+ ret=1;
+ else
+ TVOSClipboard::error=x11clipAnother;
+ SEMAPHORE_OFF;
+ // The rest is done by TScreenX11
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns a newly allocated buffer containing the contents of the indicated
+clipboard. @x{copy}.@*
+ The buffer should be deallocated with delete[]. The string is NULL
+terminated because we ensure it.@*
+ The returned length doesn't include the EOL.
+
+ Return: NULL if error, a new buffer if ok.
+
+***************************************************************************/
+
+char *TVX11Clipboard::paste(int id, unsigned &lenRet)
+{
+ if (id>1) return NULL;
+ SEMAPHORE_ON;
+ Atom clip=id==0 ? XA_CLIPBOARD(TScreenX11::disp) : XA_PRIMARY;
+
+ Window owner;
+ int format, result;
+ unsigned long len, bytes, dummy;
+ unsigned char *data;
+
+ owner=XGetSelectionOwner(TScreenX11::disp,clip);
+ if (owner==None)
+ {
+ TVOSClipboard::error=x11clipNoSelection;
+ SEMAPHORE_OFF;
+ return NULL;
+ }
+ // What a hell should I use as property here? I use XA_STRING because it was
+ // used by the example. BTW the example failed with Eterm.
+ XConvertSelection(TScreenX11::disp,clip,XA_STRING,XA_STRING,TScreenX11::mainWin,
+ CurrentTime);
+ XFlush(TScreenX11::disp);
+ SEMAPHORE_OFF;
+ waiting=1;
+ while (waiting)
+ if (!IS_SECOND_THREAD_ON)
+ TScreenX11::ProcessGenericEvents();
+
+ if (property!=XA_STRING)
+ {
+ TVOSClipboard::error=x11clipWrongType;
+ return NULL;
+ }
+ // Check the size
+ SEMAPHORE_ON;
+ Atom type;
+ XGetWindowProperty(TScreenX11::disp,TScreenX11::mainWin,XA_STRING,0,0,0,
+ AnyPropertyType,&type,&format,&len,&bytes,&data);
+ if (bytes<=0)
+ {
+ TVOSClipboard::error=x11clipNoData;
+ SEMAPHORE_OFF;
+ return NULL;
+ }
+ result=XGetWindowProperty(TScreenX11::disp,TScreenX11::mainWin,XA_STRING,
+ 0,bytes,0,AnyPropertyType,&type,&format,&len,
+ &dummy,&data);
+ if (result!=Success)
+ {
+ XFree(data);
+ TVOSClipboard::error=x11clipX11Error;
+ SEMAPHORE_OFF;
+ return NULL;
+ }
+ char *ret=new char[bytes+1];
+ memcpy(ret,data,bytes);
+ ret[bytes]=0;
+ XFree(data);
+ lenRet=bytes;
+ SEMAPHORE_OFF;
+ //printf("Recibiendo: `%s' %ld\n",ret,bytes);
+
+ return ret;
+}
+
+void TVX11Clipboard::destroy()
+{
+ if (buffer)
+ {
+ delete[] buffer;
+ buffer=0;
+ }
+}
+
+/*****************************************************************************
+ Fonts routines
+*****************************************************************************/
+
+int TScreenX11::GetFontGeometry(unsigned &w, unsigned &h)
+{
+ w=fontW;
+ h=fontH;
+ return 1;
+}
+
+int TScreenX11::GetFontGeometryRange(unsigned &wmin, unsigned &hmin,
+ unsigned &wmax, unsigned &hmax)
+{
+ wmin=foWmin;
+ hmin=foHmin;
+ wmax=foWmax;
+ hmax=foHmax;
+ return 1;
+}
+
+int TScreenX11::SetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP, int appCP)
+{
+ if (!changeP && !changeS) return 1;
+ // Check for restore fonts
+ if (changeP && !fontP && ((!changeS && !useSecondaryFont) || (changeS && !fontS)))
+ fontP=defaultFont;
+
+ // Solve the sizes
+ unsigned wP, hP, wS, hS;
+ if (changeP)
+ {
+ if (fontP)
+ {
+ wP=fontP->w;
+ hP=fontP->h;
+ }
+ else
+ {
+ wP=defaultFont->w;
+ hP=defaultFont->h;
+ }
+ }
+ else
+ {
+ wP=fontW;
+ hP=fontH;
+ }
+ if (changeS)
+ {
+ if (fontS)
+ {
+ wS=fontS->w;
+ hS=fontS->h;
+ }
+ else
+ {// Disabled
+ wS=wP;
+ hS=hP;
+ }
+ }
+ else
+ {
+ if (useSecondaryFont)
+ {
+ wS=fontW;
+ hS=fontH;
+ }
+ else
+ {// Disabled
+ wS=wP;
+ hS=hP;
+ }
+ }
+ if (wP!=wS || hP!=hS) return 0;
+ // Check if the size is in the range
+ if (wP<foWmin || wP>foWmax || hP<foHmin || hP>foHmax)
+ return 0;
+
+ // Change the requested fonts
+ SEMAPHORE_ON;
+ if (changeP)
+ {
+ DestroyXImageFont(0);
+ if (fontP && fontP->data)
+ {
+ CreateXImageFont(0,fontP->data,wP,hP);
+ primaryFontChanged=1;
+ }
+ else
+ {
+ CreateXImageFont(0,defaultFont->data,wP,hP);
+ primaryFontChanged=0;
+ }
+ }
+ if (changeS)
+ {
+ DestroyXImageFont(1);
+ if (fontS)
+ CreateXImageFont(1,fontS->data,wP,hP);
+ }
+ // Change the code page
+ if (changeP && fontCP!=-1)
+ {
+ if (appCP==-1)
+ TVCodePage::SetScreenCodePage(fontCP);
+ else
+ TVCodePage::SetCodePage(appCP,fontCP,-1);
+ }
+ // Verify if we need to resize
+ if (wP!=fontW || hP!=fontH)
+ {
+ DoResize(wP,hP);
+ }
+ else
+ {
+ FullRedraw();
+ }
+ SEMAPHORE_OFF;
+ return 1;
+}
+
+void TScreenX11::RestoreFonts()
+{
+ SetFont(1,NULL,1,NULL,TVCodePage::ISOLatin1Linux,TVCodePage::ISOLatin1Linux);
+}
+
+void TScreenX11::DoResize(unsigned w, unsigned h)
+{
+ SEMAPHORE_ON;
+ UnDrawCursor();
+ if (w!=fontW || h!=fontH)
+ {
+ unsigned start=100*cShapeFrom/fontH;
+ unsigned end =100*cShapeTo/fontH;
+ fontW=w;
+ fontWb=(w+7)/8;
+ fontH=h;
+ fontSz=fontWb*h;
+ AdjustCursorImage();
+ /* Change the cursor shape */
+ SetCursorShape(start,end);
+ /* Inform the WM about this change*/
+ sizeHints->width_inc =fontW;
+ sizeHints->height_inc=fontH;
+ sizeHints->min_width =fontW*40;
+ sizeHints->min_height=fontH*20;
+ XSetWMNormalHints(disp,mainWin,sizeHints);
+ }
+ /* Change the size */
+ XResizeWindow(disp,mainWin,maxX*fontW,maxY*fontH);
+ /* Compute cursor position and draw it */
+ SetCursorPos(cursorX,cursorY);
+ DrawCursor();
+ SEMAPHORE_OFF;
+}
+
+TScreenFont256 *TScreenX11::ChooseClosestFont(unsigned fW, unsigned fH)
+{
+ TScreenFont256 *nFont=NULL;
+
+ if (fW==8 || fH==16)
+ nFont=&font8x16;
+ else if (fW==10 || fH==20)
+ nFont=&font10x20;
+ else
+ {
+ unsigned target=fW*fH;
+ int dif1=abs(8*16-target);
+ int dif2=abs(10*20-target);
+ if (dif1<dif2)
+ nFont=&font8x16;
+ else
+ nFont=&font10x20;
+ }
+ return nFont;
+}
+
+int TScreenX11::SetCrtModeRes(unsigned w, unsigned h, int fW, int fH)
+{
+ if (fW==-1) fW=fontW;
+ if (fH==-1) fH=fontH;
+ if (w==(unsigned)maxX && h==(unsigned)maxY &&
+ fontW==(unsigned)fW && fontH==(unsigned)fH) return 0;
+
+ unsigned nW=fontW, nH=fontH;
+ TScreenFont256 *nFont=NULL,*nsFont=NULL;
+ int releaseFont=0, releaseSFont=0, resetFont=0;
+
+ // Solve the fonts, don't change them yet.
+ if ((unsigned)fW!=fontW || (unsigned)fH!=fontH)
+ {
+ if (primaryFontChanged)
+ {// The application set a font, ask for this new one
+ if (frCB && (nFont=frCB(0,fW,fH)))
+ releaseFont=1;
+ else
+ {// No replacement available, revert to our font.
+ resetFont=1;
+ nFont=ChooseClosestFont(fW,fH);
+ }
+ }
+ else
+ {
+ if (fW==8 && fH==16)
+ resetFont=1, nFont=&font8x16;
+ else if (fW==10 && fH==20)
+ resetFont=1, nFont=&font10x20;
+ else if (frCB && (nFont=frCB(0,fW,fH)))
+ releaseFont=1;
+ else
+ resetFont=1, nFont=ChooseClosestFont(fW,fH);
+ }
+ nW=nFont->w;
+ nH=nFont->h;
+ if ((nW!=fontW || nH!=fontH) && useSecondaryFont)
+ {
+ if (frCB && (nsFont=frCB(1,nW,nH)))
+ releaseSFont=1;
+ }
+ }
+
+ SEMAPHORE_ON;
+ if (nFont)
+ {
+ DestroyXImageFont(0);
+ CreateXImageFont(0,nFont->data,nW,nH);
+ if (resetFont)
+ primaryFontChanged=0;
+ if (releaseFont)
+ {
+ DeleteArray(nFont->data);
+ delete nFont;
+ }
+ }
+ if (useSecondaryFont)
+ {
+ DestroyXImageFont(1);
+ if (nsFont)
+ CreateXImageFont(1,nsFont->data,nW,nH);
+ }
+ // Should I check the size?
+ maxX=w; maxY=h;
+
+ delete[] screenBuffer;
+ screenBuffer=new ushort[maxX*maxY];
+ memset(screenBuffer,0,maxX*maxY*sizeof(ushort));
+
+ DoResize(nW,nH);
+ SEMAPHORE_OFF;
+
+ return (nW==(unsigned)fW && nH==(unsigned)fH) ? 1 : 2;
+}
+
+/* Busy indicator by Roman Valyushenko <smhs@mail.ru> */
+
+/* These are the bitmaps I created. They show a pointer with watch near.
+ Could be used to indicate some background computations. */
+
+const int busyCursorWidth=28;
+const int busyCursorHeight=20;
+
+Cursor TScreenX11::busyCursor,
+ TScreenX11::leftPtr;
+char TScreenX11::busyCursorMap[]=
+{
+ 0xff, 0xff, 0xff, 0x1f,
+ 0xfd, 0xff, 0xff, 0x1f,
+ 0xf9, 0xff, 0xff, 0x1f,
+ 0xf1, 0xff, 0xff, 0x1f,
+ 0xe1, 0x7f, 0xc0, 0x1f,
+ 0xc1, 0x7f, 0xc0, 0x1f,
+ 0x81, 0x3f, 0x80, 0x1f,
+ 0x01, 0x9f, 0x3b, 0x1f,
+ 0x01, 0xce, 0x7b, 0x1e,
+ 0xc1, 0xef, 0xfb, 0x1e,
+ 0xc9, 0xef, 0xf1, 0x18,
+ 0x9d, 0xef, 0xf1, 0x18,
+ 0x9f, 0xef, 0xfe, 0x18,
+ 0x3f, 0x6f, 0xff, 0x1e,
+ 0x3f, 0xcf, 0x7f, 0x1e,
+ 0xff, 0x9f, 0x3f, 0x1f,
+ 0xff, 0x3f, 0x80, 0x1f,
+ 0xff, 0x7f, 0xc0, 0x1f,
+ 0xff, 0x7f, 0xc0, 0x1f,
+ 0xff, 0xff, 0xff, 0x1f
+};
+char TScreenX11::busyCursorMask[]=
+{
+ 0xfc, 0xff, 0xff, 0x1f,
+ 0xf8, 0xff, 0xff, 0x1f,
+ 0xf0, 0xff, 0xff, 0x1f,
+ 0xe0, 0x3f, 0x80, 0x1f,
+ 0xc0, 0x3f, 0x80, 0x1f,
+ 0x80, 0x3f, 0x80, 0x1f,
+ 0x00, 0x1f, 0x00, 0x1f,
+ 0x00, 0x0e, 0x00, 0x1e,
+ 0x00, 0x04, 0x00, 0x1c,
+ 0x00, 0x04, 0x00, 0x10,
+ 0x80, 0x07, 0x00, 0x10,
+ 0x08, 0x07, 0x00, 0x10,
+ 0x0c, 0x07, 0x00, 0x10,
+ 0x1f, 0x06, 0x00, 0x10,
+ 0x1f, 0x06, 0x00, 0x1c,
+ 0x3f, 0x0f, 0x00, 0x1e,
+ 0xff, 0x1f, 0x00, 0x1f,
+ 0xff, 0x3f, 0x80, 0x1f,
+ 0xff, 0x3f, 0x80, 0x1f,
+ 0xff, 0x3f, 0x80, 0x1f
+};
+
+/* This is the function which creates cursors. On success it return
+ true, otherwise false */
+Boolean TScreenX11::createCursors()
+{
+ long useInternal=0;
+ optSearch("InternalBusyCursor",useInternal);
+
+ if (useInternal)
+ {
+ Pixmap busyCursorPixmap, busyCursorPixmapMask;
+
+ busyCursorPixmap=XCreatePixmapFromBitmapData(disp,mainWin,(char*)&busyCursorMap,
+ busyCursorWidth,busyCursorHeight,
+ BlackPixel(disp,screen),
+ WhitePixel(disp,screen),1);
+ if (busyCursorPixmap==None)
+ return False;
+
+ busyCursorPixmapMask=XCreatePixmapFromBitmapData(disp,mainWin,(char*)&busyCursorMask,
+ busyCursorWidth,busyCursorHeight,
+ BlackPixel(disp,screen),
+ WhitePixel(disp,screen),1);
+ int ok=0;
+ if (busyCursorPixmapMask!=None)
+ {
+ XColor busyCursorFg, busyCursorBg;
+ Status status;
+
+ status=XAllocNamedColor(disp,DefaultColormap(disp,DefaultScreen(disp)),
+ "black",&busyCursorFg,&busyCursorFg);
+ if (status)
+ {
+ status=XAllocNamedColor(disp,DefaultColormap(disp,DefaultScreen(disp)),
+ "white",&busyCursorBg,&busyCursorBg);
+ if (status)
+ {
+ busyCursor=XCreatePixmapCursor(disp,busyCursorPixmap,busyCursorPixmapMask,
+ &busyCursorFg,&busyCursorBg,1,1);
+ ok=1;
+ }
+ }
+ XFreePixmap(disp,busyCursorPixmapMask);
+ }
+ XFreePixmap(disp,busyCursorPixmap);
+
+ if (!ok)
+ return False;
+ }
+ else
+ busyCursor=XCreateFontCursor(disp,XC_watch);
+
+ leftPtr=XCreateFontCursor(disp,XC_left_ptr);
+ return True; /* Success */
+}
+
+/* This is the function to change the cursor. */
+Boolean TScreenX11::ShowBusyState(Boolean busyState)
+{
+ SEMAPHORE_ON;
+ if (busyState)
+ XDefineCursor(disp,mainWin,busyCursor);
+ else
+ XDefineCursor(disp,mainWin,leftPtr);
+ XFlush(disp); /* Show it right now */
+ SEMAPHORE_OFF;
+ return defaultShowBusyState(busyState);
+}
+
+void TScreenX11::Beep()
+{
+ SEMAPHORE_ON;
+ XBell(disp,50);
+ SEMAPHORE_OFF;
+}
+
+/*****************************************************************************
+ Application Helpers
+*****************************************************************************/
+
+const char *TScreenX11::appHelperNameError[]=
+{
+ __("No error"), // 0
+ __("Only one helper of this kind can be opened at the same time"), // 1
+ __("Please install gqview application in order to display images"), // 2
+ __("Please install xpdf application in order to display PDF files"), // 3
+ __("Invalid application helper handler"), // 4
+ __("Failed to open /dev/null"), // 5
+ __("No more handlers") // 6
+};
+int TScreenX11::appHelperError=0;
+TNSCollection *TScreenX11::appHelperHandlers=NULL;
+struct helperHandler
+{
+ TScreen::AppHelper kind;
+ pid_t pid;
+};
+static int allocatedHandlers;
+
+static
+Boolean CheckInstalled(const char *command, const char *response,
+ Boolean installed)
+{
+ if (installed)
+ return installed;
+ // Redirect stderr and stdout to a file
+ char name[14]="/tmp/tvXXXXXX";
+ int handler=mkstemp(name);
+ if (handler==-1)
+ return False;
+ unlink(name);
+ int h_errbak=dup(STDERR_FILENO);
+ int h_outbak=dup(STDOUT_FILENO);
+ dup2(handler,STDERR_FILENO);
+ dup2(handler,STDOUT_FILENO);
+ // Run the command
+ TScreen::System(command);
+ // Restore stderr and stdout
+ dup2(h_errbak,STDERR_FILENO);
+ dup2(h_outbak,STDOUT_FILENO);
+ close(h_errbak);
+ close(h_outbak);
+ // Read the result
+ lseek(handler,0,SEEK_SET);
+ char resp[80];
+ read(handler,resp,80);
+ close(handler);
+ // Is that ok?
+ return Boolean(strstr(resp,response)!=NULL);
+}
+
+TScreen::appHelperHandler TScreenX11::OpenHelperApp(TScreen::AppHelper kind)
+{
+ static Boolean gqviewInstalled=False;
+ static Boolean xpdfInstalled=False;
+
+ if (kind==FreeHandler)
+ {
+ appHelperError=4;
+ return -1;
+ }
+
+ if (kind==ImageViewer && appHelperHandlers)
+ {// Only one image viewer (gqview limitation)
+ ccIndex i, c=appHelperHandlers->getCount();
+ for (i=0; i<c; i++)
+ {
+ helperHandler *p=(helperHandler *)appHelperHandlers->at(i);
+ if (p->kind==ImageViewer)
+ {
+ appHelperError=1;
+ return -1;
+ }
+ }
+ }
+
+ // Ensure we have a collection
+ if (!appHelperHandlers)
+ {
+ appHelperHandlers=new TNSCollection(maxAppHelperHandlers,2);
+ allocatedHandlers=maxAppHelperHandlers;
+ }
+ if (!appHelperHandlers)
+ return -1;
+
+ // Do we have available handlers?
+ ccIndex hNum=-1;
+ if (appHelperHandlers->getCount()>=allocatedHandlers)
+ {
+ ccIndex i, c=appHelperHandlers->getCount();
+ for (i=0; i<c; i++)
+ {
+ helperHandler *p=(helperHandler *)appHelperHandlers->at(i);
+ if (p->kind==FreeHandler)
+ {
+ hNum=i;
+ break;
+ }
+ }
+ if (i==c)
+ {
+ appHelperError=6;
+ return -1;
+ }
+ }
+
+ // Create/Recycle the structure
+ helperHandler *h;
+
+ if (hNum==-1)
+ {// Create a struct for it
+ h=(helperHandler *)(new char[sizeof(helperHandler)]); // To match the delete[]
+ h->kind=FreeHandler;
+ // Insert it
+ hNum=appHelperHandlers->insert(h);
+ }
+ else
+ // Recycle
+ h=(helperHandler *)appHelperHandlers->at(hNum);
+
+ // Open the remote server
+ int nullH=open("/dev/null",O_WRONLY|O_BINARY|O_CREAT|O_TRUNC,S_IREAD|S_IWRITE);
+ if (nullH==-1)
+ {
+ appHelperError=5;
+ return -1;
+ }
+ switch (kind)
+ {
+ case ImageViewer:
+ gqviewInstalled=CheckInstalled("gqview -v","GQview",gqviewInstalled);
+ if (!gqviewInstalled)
+ {
+ appHelperError=2;
+ return -1;
+ }
+ break;
+ case PDFViewer:
+ xpdfInstalled=CheckInstalled("xpdf -v","xpdf version",xpdfInstalled);
+ if (!xpdfInstalled)
+ {
+ appHelperError=3;
+ return -1;
+ }
+ break;
+ case FreeHandler:
+ break;
+ }
+ close(nullH);
+ h->kind=kind;
+ h->pid=0;
+
+ return hNum;
+}
+
+Boolean TScreenX11::CloseHelperApp(appHelperHandler id)
+{
+ if (!appHelperHandlers || id<0 || id>=appHelperHandlers->getCount())
+ {
+ appHelperError=4;
+ return False;
+ }
+
+ char buf[80];
+ int nullH=open("/dev/null",O_WRONLY|O_BINARY|O_CREAT|O_TRUNC,S_IREAD|S_IWRITE);
+ if (nullH==-1)
+ {
+ appHelperError=5;
+ return -1;
+ }
+
+ helperHandler *p=(helperHandler *)appHelperHandlers->at(id);
+ int status;
+ if (p->pid && waitpid(p->pid,&status,WNOHANG)==p->pid)
+ p->pid=0;
+ switch (p->kind)
+ {
+ case ImageViewer:
+ System("gqview -r -q",&p->pid,-1,nullH,nullH);
+ break;
+ case PDFViewer:
+ CLY_snprintf(buf,80,"xpdf -remote SETEdit_%d_%d -quit",(int)getpid(),id);
+ System(buf,&p->pid,-1,nullH,nullH);
+ break;
+ case FreeHandler:
+ appHelperError=4;
+ return False;
+ }
+
+ close(nullH);
+ p->kind=FreeHandler;
+ p->pid=0;
+
+ return True;
+}
+
+Boolean TScreenX11::SendFileToHelper(appHelperHandler id, const char *file,
+ void *extra)
+{
+ if (!appHelperHandlers || id<0 || id>=appHelperHandlers->getCount())
+ {
+ appHelperError=4;
+ return False;
+ }
+
+ int len=160+strlen(file);
+ int page;
+ AllocLocalStr(buf,len);
+ int nullH=open("/dev/null",O_WRONLY|O_BINARY|O_CREAT|O_TRUNC,S_IREAD|S_IWRITE);
+ if (nullH==-1)
+ {
+ appHelperError=5;
+ return -1;
+ }
+
+ helperHandler *p=(helperHandler *)appHelperHandlers->at(id);
+ int status;
+ if (p->pid && waitpid(p->pid,&status,WNOHANG)==p->pid)
+ p->pid=0;
+ switch (p->kind)
+ {
+ case ImageViewer:
+ CLY_snprintf(buf,len,"gqview -r \"file:%s\"",file);
+ System(buf,&p->pid,-1,nullH,nullH);
+ break;
+ case PDFViewer:
+ page=0;
+ if (extra)
+ page=*((int *)extra);
+ CLY_snprintf(buf,len,"xpdf -remote SETEdit_%d_%d -raise \"%s\" %d",
+ (int)getpid(),id,file,page);
+ System(buf,&p->pid,-1,nullH,nullH);
+ break;
+ case FreeHandler:
+ appHelperError=4;
+ return False;
+ }
+
+ close(nullH);
+
+ return True;
+}
+
+const char *TScreenX11::GetHelperAppError()
+{
+ return appHelperNameError[appHelperError];
+}
+
+
+/*****************************************************************************
+
+ Update thread stuff:
+
+ Problem: In X11 (and most GUI systems) the contents of the window aren't
+ stored/cached. So when a window is not visible (exposed is the X11 term) its
+ contents aren't stored anywhere. When the window (or a portion) becomes
+ exposed X11 sends an expose event. If the application isn't collecting
+ expose events, because is blocked waiting for a child completion or
+ performing a long computation, the exposed portion of the window is filled
+ with a black rectangle (this color is selected during TScreenX11 creation).
+ This is very bad for applications like RHIDE where the debugger is blocked
+ until the debuggee is stoped. It means that you most probably won't be able
+ to see RHIDE's window content while the debuggee is running. Even when it
+ isn't critical is ugly.
+ The idea is to periodically collect the expose events even when the process
+ is blocked.
+ I (SET) implemented it using two different approaches:
+
+ 1) POSIX threads. They seems to be poorly implemented in Linux (i.e. glibc
+ 2.2.5 and 2.3.1). This solution is elegant but unstable, at least for
+ SETEdit and RHIDE running in Debian GNU/Linux Woody and Sarge.
+ 2) setitimer and SIGALRM. This is really simple and seems to be more stable.
+
+ I keep both so people can experiment with both, each approachs have its
+ advantes and disadvantages.
+
+*****************************************************************************/
+
+#if USE_ALARM_FOR_THREAD
+
+/*****************************************************************************
+
+ Update thread using the setitimer approach.
+
+ This approach uses the timer alarm (SIGALRM for Linux and SIGPROF for
+Solaris, looks like Solaris didn't implement it properly).
+ This mechanism is much more reliable than the POSIX thread mechanism, at
+least for Linux.
+ The use of a signal ensures:
+
+1) The main "thread" can't take the CPU while the signal is executing. And as
+the signal blocks itself by default it doesn't have to be reentrant.
+2) A child process doesn't inherits the timers so there is no risk to
+inherit problems.
+
+Advantages:
+1) The mutex implementation is trivial.
+2) We don't need pthread library.
+
+Disadvantages:
+1) The program can't use this alarm for itself.
+2) Implementations of the alarm mechanism should be POSIX compliant.
+
+*****************************************************************************/
+
+// Used to print a mark every 250 updates
+#define TIC 0
+// Prints some debug info when the mechanism is dis/enabled
+#define DBG_ALM_STATE 0
+
+int TVX11UpdateThread::running=0;
+int TVX11UpdateThread::initialized=0;
+const int refreshTime=10000; // 10 ms
+static sig_atomic_t mutex;
+static int updates=0;
+static volatile int safeToUnHook;
+
+void TVX11UpdateThread::UpdateThread(int signum)
+{
+ if (!running)
+ {
+ safeToUnHook=1;
+ return;
+ }
+ // Here TIMER_ALARM signal is blocked and the process can take the CPU
+ if (!mutex)
+ {// No mutex, we can do our work.
+ TScreenX11::ProcessGenericEvents();
+ }
+ if (TIC)
+ {
+ updates++;
+ if (updates>250)
+ {
+ printf("Tic (%d)\n",getpid());
+ updates=0;
+ }
+ }
+ microAlarm(refreshTime);
+}
+
+void TVX11UpdateThread::StartUpdateThread()
+{
+ long aux;
+ if (TScreen::optSearch("UseUpdateThread",aux) && aux==1)
+ {
+ if (DBG_ALM_STATE)
+ printf("Using setitimer for the update stuff (PID=%d)\n",getpid());
+ mutex=0;
+ initialized=1;
+ running=1;
+ safeToUnHook=0;
+ // Trap the alarm signal
+ struct sigaction s;
+ s.sa_handler=UpdateThread;
+ sigemptyset(&s.sa_mask);
+ #if defined(SA_RESTART)
+ s.sa_flags=SA_RESTART;
+ #else
+ s.sa_flags=0;
+ #endif // SA_RESTART
+ sigaction(TIMER_ALARM,&s,NULL);
+ // Set the alarm
+ microAlarm(refreshTime);
+ }
+}
+
+void TVX11UpdateThread::microAlarm(unsigned int usec)
+{
+ struct itimerval newV;
+ newV.it_interval.tv_usec=0;
+ newV.it_interval.tv_sec=0;
+ newV.it_value.tv_usec=(long int)usec;
+ newV.it_value.tv_sec=0;
+ setitimer(ITIMER_USED,&newV,0);
+}
+
+void TVX11UpdateThread::SemaphoreOn()
+{
+ mutex++;
+ // We will never collide with the signal because the signal is atomic from
+ // our point of view.
+}
+
+void TVX11UpdateThread::SemaphoreOff()
+{
+ --mutex;
+ if (mutex<0)
+ printf("Oh no!!! mutex<0\n");
+}
+
+int TVX11UpdateThread::CheckSecondThread()
+{
+ return (initialized && running);
+}
+
+void TVX11UpdateThread::StopUpdateThread()
+{
+ if (IS_SECOND_THREAD_ON)
+ {
+ if (DBG_ALM_STATE)
+ printf("Stopping update thread for PID=%d\n",getpid());
+ running=0;
+ while (!safeToUnHook);
+ // Un-Trap the alarm signal
+ struct sigaction s;
+ s.sa_handler=SIG_IGN;
+ sigemptyset(&s.sa_mask);
+ #if defined(SA_RESTART)
+ s.sa_flags=SA_RESTART;
+ #else
+ s.sa_flags=0;
+ #endif // SA_RESTART
+ sigaction(TIMER_ALARM,&s,NULL);
+ }
+}
+#elif HAVE_LINUX_PTHREAD
+/**************************************************************************
+
+ Update thread stuff
+
+ This code is under test and for this reason must be enabled manually
+ defining the UseUpdateThread configuration variable.
+
+ Some important details: [glibc 2.2.5 also 2.3.1]
+
+ * Linux threads are implemented using processes (clone kernel syscall).
+ I think that they will never be really POSIX compliant if this mechanism
+ is used. One major flaw is that getpid() will return a different value
+ for each thread exposing the fake implementation.
+
+ * Looks like exec can't be reliably called from a multithread program. It
+ works perfectly for small and medium examples but does all kind of nasty
+ things when called from big programs like SETEdit. Looking at the glibc
+ code you can see system() implementation knows it and checks if we have
+ "threads", in this case it first disables all async events. This is done
+ with a macro and I couldn't find any function in glibc to do the same
+ from my code.
+
+ * According to POSIX when you do a fork the new process inherits all the
+ threads and calling exec terminates all threads. In this way fork/exec
+ work ok. In Linux implementation it doesn't happend. According to glibc
+ docs:
+ `pthread_kill_other_threads_np' is a non-portable LinuxThreads
+ extension. It causes all threads in the program to terminate
+ immediately, except the calling thread which proceeds normally. It
+ is intended to be called just before a thread calls one of the
+ `exec' functions, e.g. `execve'.
+ ...
+ According to POSIX 1003.1c, a successful `exec*' in one of the
+ threads should automatically terminate all other threads in the
+ program. This behavior is not yet implemented in LinuxThreads.
+ Calling `pthread_kill_other_threads_np' before `exec*' achieves
+ much of the same behavior, except that if `exec*' ultimately
+ fails, then all other threads are already killed.
+ But as threads aren't inherited you kill nothing or the parent threads :-(
+ If you call it and then try to create a new thread it is created but
+ your process dies with "Signal Real-time 0".
+
+ * The first time you create a "thread" an auxiliar process is created.
+ Looks like this process is the one in charge to coordinate the other
+ processes that emulates threads. This should be transparent, but it
+ isn't. If you fork/create a process group/system and then you kill the
+ group then it kills your threads and the auxiliar process becomes a
+ Zombie. Calling exec from big programs looks like you have chances to
+ get a thread switch and then the exec tries to attach to the "thread"
+ process. This confusion kills the thread, lets the child sleeping and
+ the auxiliar process becomes a Zombie.
+
+ I figure out that implementing POSIX threads is a complex task and that
+ I could be doing wrong things, but is also obvious that LinuxThreads as
+ implemented by glibc 2.2.5 is a nightmare.
+
+**************************************************************************/
+
+// Linux implementation of POSIX threads
+
+// Here to avoid pulling the headers everywhere
+static pthread_t th;
+static pthread_mutex_t mutex;
+int TVX11UpdateThread::running=0;
+int TVX11UpdateThread::initialized=0;
+timeval TVX11UpdateThread::refWatchDog,
+ TVX11UpdateThread::nowWatchDog;
+int TVX11UpdateThread::watchDogVal=1;
+
+void *TVX11UpdateThread::UpdateThread(void *)
+{
+ // I tried it in the hope that could help to kill childs without affecting
+ // this thread, but isn't enough.
+ if (0)
+ {
+ sigset_t newMask;
+ sigemptyset(&newMask);
+ sigaddset(&newMask,SIGTERM);
+ pthread_sigmask(SIG_BLOCK,&newMask,NULL);
+ }
+
+ running=1;
+
+ while (running)
+ {
+ usleep(10);
+ watchDogVal=0;
+ TScreenX11::ProcessGenericEvents();
+ }
+ return NULL;
+}
+
+void TVX11UpdateThread::SemaphoreOn()
+{
+ if (initialized)
+ pthread_mutex_lock(&mutex);
+}
+
+void TVX11UpdateThread::SemaphoreOff()
+{
+ if (initialized)
+ pthread_mutex_unlock(&mutex);
+}
+
+int TVX11UpdateThread::CheckSecondThread()
+{
+ if (!initialized || !running)
+ return 0;
+
+ gettimeofday(&nowWatchDog,0);
+ timeval aux=nowWatchDog;
+ SubstractRef(nowWatchDog,refWatchDog);
+ if (nowWatchDog.tv_sec>=1)
+ {
+ if (watchDogVal)
+ {
+ printf("Oops! looks like the update thread is dead\n");
+ running=0;
+ return 0;
+ }
+ watchDogVal=1;
+ refWatchDog=aux;
+ }
+ return 1;
+}
+
+void TVX11UpdateThread::StartUpdateThread()
+{
+ long aux;
+ if (TScreen::optSearch("UseUpdateThread",aux) && aux==1)
+ {
+ // This initialization needs Unix 98 compliance.
+ // Linux is ok and the Solaris 7 manpages says that's also ok.
+ pthread_mutexattr_t mt_attr;
+ pthread_mutexattr_init(&mt_attr);
+ pthread_mutexattr_settype(&mt_attr,PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init(&mutex,&mt_attr);
+ // Now we can use the mutex
+ initialized=1;
+
+ gettimeofday(&refWatchDog,0);
+ if (pthread_create(&th,NULL,UpdateThread,NULL)==0)
+ printf("Update thread succesfuly created\n");
+ else
+ perror("Error creating update thread");
+ }
+}
+
+void TVX11UpdateThread::StopUpdateThread()
+{
+ if (IS_SECOND_THREAD_ON)
+ {
+ void *ret;
+ running=0;
+ printf("Waiting for update thread completion\n");
+ if (pthread_join(th,&ret)==0)
+ printf("Update thread finished OK\n");
+ else
+ perror("Error waiting for update thread completion");
+ }
+}
+#endif
+// End of Linux implementation of POSIX threads
+
+
+#else
+
+#include <tv/x11/screen.h>
+#include <tv/x11/key.h>
+#include <tv/x11/mouse.h>
+
+#endif // defined(TVOS_UNIX) && defined(HAVE_X11)
+
diff --git a/tvision/compat/beep.c b/tvision/compat/beep.c
new file mode 100644
index 0000000..206b18f
--- /dev/null
+++ b/tvision/compat/beep.c
@@ -0,0 +1,11 @@
+/*
+ Copyright (C) 2000 Salvador E. Tropea
+ Copyright (C) 2000 Anatoli Soltan
+ Covered by the GPL license.
+*/
+
+#ifndef BEEP_DEFINED
+void CLY_Beep(void)
+{
+}
+#endif
diff --git a/tvision/compat/compat.gpr b/tvision/compat/compat.gpr
new file mode 100644
index 0000000..d15254a
--- /dev/null
+++ b/tvision/compat/compat.gpr
Binary files differ
diff --git a/tvision/compat/compat.imk b/tvision/compat/compat.imk
new file mode 100644
index 0000000..9e9e989
--- /dev/null
+++ b/tvision/compat/compat.imk
@@ -0,0 +1,226 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+../makes/obj/beep$(ExOBJ):: ../compat/beep.c \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/drivevalid$(ExOBJ):: ../compat/drivevalid.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/expandpath$(ExOBJ):: ../compat/expandpath.c \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fexpand$(ExOBJ):: ../compat/fexpand.c \
+ cl/needs.h \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fileattrs$(ExOBJ):: ../compat/fileattrs.c \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fileexists$(ExOBJ):: ../compat/fileexists.c \
+ cl/unistd.h \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/filelength$(ExOBJ):: ../compat/filelength.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fixpath$(ExOBJ):: ../compat/fixpath.c \
+ cl/needs.h \
+ cl/unistd.h \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fnmatch$(ExOBJ):: ../compat/fnmatch.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getcurdir$(ExOBJ):: ../compat/getcurdir.c \
+ cl/needs.h \
+ cl/unistd.h \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getline$(ExOBJ):: ../compat/getline.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getopt$(ExOBJ):: ../compat/getopt.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getopt1$(ExOBJ):: ../compat/getopt1.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getshell$(ExOBJ):: ../compat/getshell.c \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/glob$(ExOBJ):: ../compat/glob.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/globfree$(ExOBJ):: ../compat/globfree.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/iffilelen$(ExOBJ):: ../compat/iffilelen.cc \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+../makes/obj/isdir$(ExOBJ):: ../compat/isdir.c \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/isrelpath$(ExOBJ):: ../compat/isrelpath.c \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/iswild$(ExOBJ):: ../compat/iswild.c \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/itoa$(ExOBJ):: ../compat/itoa.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/mkstemp$(ExOBJ):: ../compat/mkstemp.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/nl_langinfo$(ExOBJ):: ../compat/nl_langinfo.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/ntdirent$(ExOBJ):: ../compat/ntdirent.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/pathvalid$(ExOBJ):: ../compat/pathvalid.c \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/regex$(ExOBJ):: ../compat/regex.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/releasec$(ExOBJ):: ../compat/releasec.c \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/snprintf$(ExOBJ):: ../compat/snprintf.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/ssc_streams$(ExOBJ):: ../compat/ssc_streams.cc \
+ cl/unistd.h \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/ssc_streams.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+../makes/obj/strlwr$(ExOBJ):: ../compat/strlwr.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/strupr$(ExOBJ):: ../compat/strupr.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/ticks$(ExOBJ):: ../compat/ticks.c \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/unc$(ExOBJ):: ../compat/unc.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/unc_95$(ExOBJ):: ../compat/unc_95.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/unc_nt$(ExOBJ):: ../compat/unc_nt.c \
+ cl/needs.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/validfilename$(ExOBJ):: ../compat/validfilename.c \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/yieldpro$(ExOBJ):: ../compat/yieldpro.c \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
diff --git a/tvision/compat/compat.umk b/tvision/compat/compat.umk
new file mode 100644
index 0000000..2feedc3
--- /dev/null
+++ b/tvision/compat/compat.umk
@@ -0,0 +1,115 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+../makes/obj/beep$(ExOBJ):: ../compat/beep.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/drivevalid$(ExOBJ):: ../compat/drivevalid.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/expandpath$(ExOBJ):: ../compat/expandpath.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fexpand$(ExOBJ):: ../compat/fexpand.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fileattrs$(ExOBJ):: ../compat/fileattrs.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fileexists$(ExOBJ):: ../compat/fileexists.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/filelength$(ExOBJ):: ../compat/filelength.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fixpath$(ExOBJ):: ../compat/fixpath.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/fnmatch$(ExOBJ):: ../compat/fnmatch.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getcurdir$(ExOBJ):: ../compat/getcurdir.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getline$(ExOBJ):: ../compat/getline.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getopt$(ExOBJ):: ../compat/getopt.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getopt1$(ExOBJ):: ../compat/getopt1.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/getshell$(ExOBJ):: ../compat/getshell.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/glob$(ExOBJ):: ../compat/glob.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/globfree$(ExOBJ):: ../compat/globfree.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/iffilelen$(ExOBJ):: ../compat/iffilelen.cc
+ $(RHIDE_COMPILE_CC)
+
+../makes/obj/isdir$(ExOBJ):: ../compat/isdir.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/isrelpath$(ExOBJ):: ../compat/isrelpath.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/iswild$(ExOBJ):: ../compat/iswild.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/itoa$(ExOBJ):: ../compat/itoa.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/mkstemp$(ExOBJ):: ../compat/mkstemp.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/nl_langinfo$(ExOBJ):: ../compat/nl_langinfo.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/ntdirent$(ExOBJ):: ../compat/ntdirent.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/pathvalid$(ExOBJ):: ../compat/pathvalid.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/regex$(ExOBJ):: ../compat/regex.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/releasec$(ExOBJ):: ../compat/releasec.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/snprintf$(ExOBJ):: ../compat/snprintf.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/ssc_streams$(ExOBJ):: ../compat/ssc_streams.cc
+ $(RHIDE_COMPILE_CC)
+
+../makes/obj/strlwr$(ExOBJ):: ../compat/strlwr.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/strupr$(ExOBJ):: ../compat/strupr.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/ticks$(ExOBJ):: ../compat/ticks.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/unc$(ExOBJ):: ../compat/unc.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/unc_95$(ExOBJ):: ../compat/unc_95.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/unc_nt$(ExOBJ):: ../compat/unc_nt.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/validfilename$(ExOBJ):: ../compat/validfilename.c
+ $(RHIDE_COMPILE_C)
+
+../makes/obj/yieldpro$(ExOBJ):: ../compat/yieldpro.c
+ $(RHIDE_COMPILE_C)
+
diff --git a/tvision/compat/drivevalid.c b/tvision/compat/drivevalid.c
new file mode 100644
index 0000000..9d03b51
--- /dev/null
+++ b/tvision/compat/drivevalid.c
@@ -0,0 +1,44 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000 Anatoli Soltan
+ Copyright (C) 2000 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#include <cl/needs.h>
+
+#ifdef TVCompf_djgpp
+#define Uses_ctype
+#include <compatlayer.h>
+#include <dpmi.h>
+
+int CLY_DriveValid( char drive )
+{
+ __dpmi_regs r;
+ r.x.ax = 0x1C00;
+ r.x.dx = uctoupper(drive) - 'A' + 1;
+ __dpmi_int(0x21,&r);
+ if (r.h.al != 0xFF) return 1;
+ return 0;
+}
+#endif
+
+#ifdef TVOS_UNIX
+int CLY_DriveValid( char drive )
+{
+ return 0;
+}
+#endif
+
+#ifdef TVOS_Win32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#define Uses_ctype
+#include <compatlayer.h>
+
+int CLY_DriveValid( char drive )
+{
+ DWORD drives = GetLogicalDrives();
+ return 1 & (drives >> (uctoupper(drive) - 'A'));
+}
+#endif
diff --git a/tvision/compat/expandpath.c b/tvision/compat/expandpath.c
new file mode 100644
index 0000000..89a1d70
--- /dev/null
+++ b/tvision/compat/expandpath.c
@@ -0,0 +1,41 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#define Uses_string
+#include <compatlayer.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ Extracts from path the directory part and filename part. If 'dir' and/or
+'file' == NULL, it is not filled. The directory will have a trailing slash.
+
+***************************************************************************/
+
+void CLY_ExpandPath(const char *path, char *dir, char *file)
+{
+ const char *tag = strrchr(path, DIRSEPARATOR);
+
+ if (tag != NULL)
+ {
+ if (file)
+ strcpy(file, tag + 1);
+ if (dir)
+ {
+ strncpy(dir, path, tag - path + 1);
+ dir[tag - path + 1] = '\0';
+ }
+ }
+ else
+ {
+ /* there is only the file name */
+ if (file)
+ strcpy(file, path);
+ if (dir)
+ dir[0] = '\0';
+ }
+}
+
diff --git a/tvision/compat/fexpand.c b/tvision/compat/fexpand.c
new file mode 100644
index 0000000..65489ae
--- /dev/null
+++ b/tvision/compat/fexpand.c
@@ -0,0 +1,114 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000 Vadim Beloborodov
+ Copyright (C) 2000 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#include <cl/needs.h>
+
+#if defined(TVCompf_djgpp) || defined(TVComp_BCPP) || defined(TVOS_UNIX) || \
+ defined(TVCompf_Cygwin)
+#define Uses_fixpath
+#define Uses_string
+#define Uses_limits
+#include <compatlayer.h>
+
+void CLY_fexpand( char *rpath )
+{
+ char path[PATH_MAX];
+ _fixpath(rpath,path);
+ strcpy(rpath,path);
+}
+#define FEXPAND_DEFINED
+#endif
+
+
+#if defined(TVOS_Win32) && !defined(FEXPAND_DEFINED)
+// Code provided by Vadim Beloborodov
+// This should be unified with the NT version and use _fixpath.
+
+#define Uses_string
+#define Uses_limits
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_direct
+#include <compatlayer.h>
+
+static void squeeze( char *path )
+{
+ char *
+ dest = path;
+ char *
+ src = path;
+ while( *src != 0 ) {
+ if (*src == '.')
+ if (src[1] == '.') {
+ src += 2;
+ if (dest > path) {
+ dest--;
+ while ((*--dest != '\\')&&(dest > path)) // back up to the previous '\'
+ ;
+ dest++; // move to the next position
+ }
+ } else if (src[1] == '\\')
+ src++;
+ else
+ *dest++ = *src++;
+ else
+ *dest++ = *src++;
+ }
+ *dest = 0; // zero terminator
+ dest = path;
+ src = path;
+ while( *src != 0 ) {
+ if ((*src == '\\')&&(src[1] == '\\'))
+ src++;
+ else
+ *dest++ = *src++;
+ }
+ *dest = 0; // zero terminator
+}
+
+void CLY_fexpand( char *rpath )
+{
+ char path[PATH_MAX]="";
+ char drive[PATH_MAX]="";
+ char dir[PATH_MAX]="";
+ char file[PATH_MAX]="";
+ char ext[PATH_MAX]="";
+ char *p;
+
+ _splitpath( rpath, drive, dir, file, ext );
+ if( *drive == 0 ) {
+ drive[0] = _getdrive() - 1 + 'A';
+ drive[1] = ':';
+ drive[2] = '\0';
+ }
+ drive[0] = toupper(drive[0]);
+ if( (*dir == 0) || (dir[0] != '\\' && dir[0] != '/') ) {
+ char curdir[PATH_MAX];
+ int len;
+ _getdcwd( drive[0] - 'A' + 1, curdir, PATH_MAX );
+ len = strlen(curdir);
+ if (curdir[len - 1] != '\\') {
+ curdir[len] = '\\';
+ curdir[len + 1] = 0;
+ }
+ strcat( curdir, dir );
+ if( *curdir != '\\' && *curdir != '/' ) {
+ *dir = '\\';
+ strcpy( dir+1, curdir );
+ } else
+ strcpy( dir, curdir );
+ }
+
+ p = dir;
+ while( (p = strchr( p, '/' )) != 0 )
+ *p = '\\';
+ squeeze( dir );
+ _makepath( path, drive, dir, file, ext );
+ strcpy( rpath, path );
+}
+#endif
+
diff --git a/tvision/compat/fileattrs.c b/tvision/compat/fileattrs.c
new file mode 100644
index 0000000..2993a01
--- /dev/null
+++ b/tvision/compat/fileattrs.c
@@ -0,0 +1,197 @@
+/**[txh]********************************************************************
+
+ Description:
+ This module provides some functions to know the file attributes and altere
+some of them in an abstract way. Note that I wrote only the functions I need
+for SETEdit and not a full set.
+
+ Copyright (C) 2000-2001 by Salvador E. Tropea
+ Covered by the GPL license.
+
+***************************************************************************/
+
+#define Uses_CLYFileAttrs
+#define Uses_alloca
+#include <compatlayer.h>
+
+
+#ifdef TVCompf_djgpp
+/*
+ In DOS owr best choice is _chmod, it can give information as file hidden
+ or system file.
+*/
+#include <io.h>
+
+void CLY_GetFileAttributes(CLY_mode_t *mode, struct stat *statVal,
+ const char *fileName)
+{
+ *mode=_chmod(fileName,0,0);
+}
+
+int CLY_SetFileAttributes(CLY_mode_t *newmode, const char *fileName)
+{
+ return _chmod(fileName,1,*newmode)==-1 ? 0 : 1;
+}
+
+void CLY_FileAttrReadOnly(CLY_mode_t *mode)
+{
+ *mode|=1;
+}
+
+void CLY_FileAttrReadWrite(CLY_mode_t *mode)
+{
+ *mode&=0xFE;
+}
+
+int CLY_FileAttrIsRO(CLY_mode_t *mode)
+{
+ return (*mode) & 1;
+}
+
+void CLY_FileAttrModified(CLY_mode_t *mode)
+{
+ *mode|=0x20;
+}
+
+void CLY_GetDefaultFileAttr(CLY_mode_t *mode)
+{
+ *mode=0x20;
+}
+#define FILE_ATTRS_DEFINED
+#endif // TVCompf_djgpp
+
+
+
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && \
+ !defined(FILE_ATTRS_DEFINED)
+/*
+ In UNIX the best way is just use chmod which is POSIX and should be
+enough.
+*/
+#include <unistd.h>
+
+void CLY_GetFileAttributes(CLY_mode_t *mode, struct stat *statVal,
+ const char *fileName)
+{
+ int ngroups,val;
+ gid_t *groups;
+ uid_t user;
+
+ mode->mode =statVal->st_mode;
+ mode->user =statVal->st_uid;
+ mode->group=statVal->st_gid;
+
+ // Compute the write mask:
+ user=getuid();
+
+ // Is our file? (or we are the superuser)
+ if (user==0 || mode->user==user)
+ {
+ mode->writemask=S_IWUSR;
+ return;
+ }
+
+ // Are we from their group?
+ ngroups=getgroups(0,NULL);
+ groups=(gid_t *)alloca(ngroups*sizeof(gid_t));
+ val=getgroups(ngroups,groups);
+ if (val>=0)
+ {
+ int i;
+ for (i=0; i<ngroups; i++)
+ if (groups[i]==mode->group)
+ {
+ if (mode->mode & S_IWGRP)
+ mode->writemask=S_IWGRP;
+ else
+ mode->writemask=S_IWOTH;
+ return;
+ }
+ }
+
+ // Ok, the `others' apply
+ mode->writemask=S_IWOTH;
+}
+
+int CLY_SetFileAttributes(CLY_mode_t *newmode, const char *fileName)
+{
+ return !(chmod(fileName,newmode->mode) ||
+ chown(fileName,newmode->user,newmode->group));
+}
+
+void CLY_FileAttrReadOnly(CLY_mode_t *mode)
+{
+ mode->mode&= ~mode->writemask;
+}
+
+void CLY_FileAttrReadWrite(CLY_mode_t *mode)
+{
+ mode->mode|=mode->writemask;
+}
+
+int CLY_FileAttrIsRO(CLY_mode_t *mode)
+{
+ return (mode->mode & mode->writemask)==0;
+}
+
+void CLY_FileAttrModified(CLY_mode_t *mode)
+{
+}
+
+void CLY_GetDefaultFileAttr(CLY_mode_t *mode)
+{ // 644, umask will kill the denied ones if that's needed
+ mode->mode=S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR;
+ mode->user=getuid();
+ mode->group=getgid();
+ mode->writemask=S_IWUSR;
+}
+#define FILE_ATTRS_DEFINED
+#endif
+
+
+
+#if defined(TVOS_Win32) && !defined(FILE_ATTRS_DEFINED)
+/*
+ In Win32 systems there are an API call for it.
+*/
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+void CLY_GetFileAttributes(CLY_mode_t *mode, struct stat *statVal,
+ const char *fileName)
+{
+ *mode=statVal->st_mode; // Just to avoid unused warning
+ *mode=GetFileAttributes(fileName);
+}
+
+int CLY_SetFileAttributes(CLY_mode_t *newmode, const char *fileName)
+{
+ return SetFileAttributes(fileName,*newmode);
+}
+
+void CLY_FileAttrReadOnly(CLY_mode_t *mode)
+{
+ *mode|=FILE_ATTRIBUTE_READONLY;
+}
+
+void CLY_FileAttrReadWrite(CLY_mode_t *mode)
+{
+ *mode&=~FILE_ATTRIBUTE_READONLY;
+}
+
+int CLY_FileAttrIsRO(CLY_mode_t *mode)
+{
+ return (*mode & FILE_ATTRIBUTE_READONLY);
+}
+
+void CLY_FileAttrModified(CLY_mode_t *mode)
+{
+ *mode|=FILE_ATTRIBUTE_ARCHIVE;
+}
+
+void CLY_GetDefaultFileAttr(CLY_mode_t *mode)
+{
+ *mode=(CLY_mode_t)FILE_ATTRIBUTE_ARCHIVE;
+}
+#define FILE_ATTRS_DEFINED
+#endif
diff --git a/tvision/compat/fileexists.c b/tvision/compat/fileexists.c
new file mode 100644
index 0000000..d57bb05
--- /dev/null
+++ b/tvision/compat/fileexists.c
@@ -0,0 +1,13 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000-2001 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#define Uses_access
+#include <compatlayer.h>
+
+int CLY_FileExists(const char *fname)
+{
+ return (access(fname,R_OK)==0);
+}
diff --git a/tvision/compat/filelength.c b/tvision/compat/filelength.c
new file mode 100644
index 0000000..8643b95
--- /dev/null
+++ b/tvision/compat/filelength.c
@@ -0,0 +1,23 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+#include <cl/needs.h>
+
+#ifdef NEEDS_FILELENGTH
+#include <unistd.h>
+
+long CLY_filelength(int fhandle)
+{
+ long oldval;
+ long retval;
+
+ oldval=lseek(fhandle,0,SEEK_CUR);
+ if (oldval==-1L) return -1L;
+ retval=lseek(fhandle,0,SEEK_END);
+ if (retval==-1L) return -1L;
+ if (lseek(fhandle,oldval,SEEK_SET)==-1L) return -1L;
+ return retval;
+}
+#endif
diff --git a/tvision/compat/fixpath.c b/tvision/compat/fixpath.c
new file mode 100644
index 0000000..f121fc9
--- /dev/null
+++ b/tvision/compat/fixpath.c
@@ -0,0 +1,305 @@
+/**[txh]********************************************************************
+
+ Description:
+ This file contains a replacement for djgpp's _fixpath function. Currently
+I have two versions. Both are based in djgpp's code. One is for Linux
+(adapted by Robert) and the other is for NT adapted by Anatoli Soltan.
+
+***************************************************************************/
+
+#include <cl/needs.h>
+
+#if defined(TVOS_Win32) && !defined(TVCompf_Cygwin)
+/* BC++/Win32, MingW32 and MSVC */
+/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+/* Modified for Win32 by Anatoli Soltan */
+
+#include <tv/configtv.h>
+#define Uses_string
+#define Uses_getcurdir
+#ifndef TVComp_BCPP
+ #define Uses_direct
+#endif
+#ifdef TVComp_Watcom
+ #define Uses_stdio
+ #define Uses_dir
+#endif
+#include <compatlayer.h>
+
+#ifdef TVComp_BCPP
+
+#include <dir.h>
+
+static int __fp_getdisk(void)
+{
+ return getdisk();
+}
+
+#elif defined(TVComp_MSC) || defined(TVCompf_MinGW) || defined(TVComp_Watcom)
+
+static int __fp_getdisk(void)
+{
+ return _getdrive() - 1;
+}
+
+#else
+#error "No support for this compiler"
+#endif
+
+// getcurdir is provided by the compatibility layer ;-)
+static char* __fp_getcurdir(char* out, int drive)
+{
+ if (!getcurdir(drive + 1, out))
+ out += strlen(out);
+ return out;
+}
+
+#define is_slash(c) CLY_IsValidDirSep(c)
+#define is_term(c) (CLY_IsValidDirSep(c) || c=='\0')
+
+/* Takes as input an arbitrary path. Fixes up the path by:
+ 1. Removing consecutive slashes
+ 2. Removing trailing slashes
+ 3. Making the path absolute if it wasn't already
+ 4. Removing "." in the path
+ 5. Removing ".." entries in the path (and the directory above them)
+ 6. Adding a drive specification if one wasn't there
+ 7. Converting all slashes to '/'
+ */
+void
+_fixpath(const char *in, char *out)
+{
+ int drive_number = 0;
+ const char *ip = in;
+ char *op = out;
+ int unc = CLY_IsUNC(in); /* is a UNC pathname */
+
+ /* Add drive specification to output string */
+ if (((*ip >= 'a' && *ip <= 'z') ||
+ (*ip >= 'A' && *ip <= 'Z'))
+ && (*(ip + 1) == ':'))
+ {
+ if (*ip >= 'a' && *ip <= 'z')
+ {
+ drive_number = *ip - 'a';
+ *op++ = *ip++;
+ }
+ else
+ {
+ drive_number = *ip - 'A';
+ *op++ = (char)(drive_number + 'a');
+ ++ip;
+ }
+ *op++ = *ip++;
+ }
+ else if (!unc)
+ {
+ drive_number = __fp_getdisk();
+ *op++ = (char)(drive_number + 'a');
+ *op++ = ':';
+ }
+
+ /* Convert relative path to absolute */
+ if (!is_slash(*ip))
+ {
+ *op++ = '/';
+ op = __fp_getcurdir(op, drive_number);
+ }
+
+ /* Handle UNC path */
+ if (unc)
+ {
+ *op++ = *ip++;
+ }
+
+#if defined(TVOSf_QNX4)
+ /* Skip the first slashes, which are a node number part */
+ /* Full QNX4 pathname is //node/dirpath/filename */
+ if ((ip==in) && (is_slash(*ip)) && (is_slash(*(ip+1))))
+ {
+ *op=*ip;
+ ip++;
+ op++;
+ }
+#endif // TVOSf_QNX4
+
+ /* Step through the input path */
+ while (*ip)
+ {
+ /* Skip input slashes */
+ if (is_slash(*ip))
+ {
+ ip++;
+ continue;
+ }
+
+ /* Skip "." and output nothing */
+ if (*ip == '.' && is_term(*(ip + 1)))
+ {
+ ip++;
+ continue;
+ }
+
+ /* Skip ".." and remove previous output directory */
+ if (*ip == '.' && *(ip + 1) == '.' && is_term(*(ip + 2)))
+ {
+ ip += 2;
+ /* Don't back up over drive spec */
+ if (op > out + 2)
+ {
+ /* This requires "/" to follow drive spec */
+ --op;
+ while (!is_slash(*op)) --op;
+ }
+ continue;
+ }
+
+ /* Copy path component from in to out */
+ *op++ = '/';
+ while (!is_term(*ip)) *op++ = *ip++;
+ }
+
+ /* If root directory, insert trailing slash */
+ if (op == out + 2) *op++ = '/';
+
+ /* Null terminate the output */
+ *op = '\0';
+
+ /* Convert backslashes to slashes */
+ for (op = out; *op; op++)
+ if (*op == '\\') *op = '/';
+}
+/* vi: set ts=8 sw=2 : */
+#define FIXPATH_DEFINED
+#endif /* BC++/Win32, MingW32 and MSVC */
+
+
+
+
+
+
+
+#if defined(NEEDS_FIXPATH) && !defined(FIXPATH_DEFINED)
+/* DJGPP, Linux and CygWin */
+/*
+ Robert:
+ Here now the very usefull function _fixpath() from DJGPP's
+ libc 'fixpath.c'
+ I have modified it to be used on unix systems (like linux).
+*/
+
+/* Copyright (C) 2002 Salvador E. Tropea */
+/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+
+#define Uses_unistd
+#define Uses_string
+#define Uses_limits
+#define Uses_getcurdir
+#define Uses_stdlib
+#include <compatlayer.h>
+
+inline static int
+is_slash(int c)
+{
+ return c == DIRSEPARATOR;
+}
+
+inline static int
+is_term(int c)
+{
+ return c == DIRSEPARATOR || c == '\0';
+}
+
+/* Takes as input an arbitrary path. Fixes up the path by:
+ 1. Removing consecutive slashes
+ 2. Removing trailing slashes
+ 3. Making the path absolute if it wasn't already
+ 4. Removing "." in the path
+ 5. Removing ".." entries in the path (and the directory above them)
+ */
+void _fixpath(const char *in, char *out)
+{
+ const char *ip = in;
+ char *op = out;
+
+
+ /* Convert ~ to the HOME environment variable */
+ if (*ip == '~' && (is_slash(ip[1]) || !ip[1]))
+ {
+ const char *home = getenv("HOME");
+ if (home)
+ {
+ strcpy(op,home);
+ op += strlen(op);
+ ip++;
+ if (!*ip) return;
+ }
+ }
+
+ /* Convert relative path to absolute */
+ if (!is_slash(*ip))
+ {
+ getcurdir(0,op);
+ op += strlen(op);
+ }
+
+#if defined(TVOSf_QNX4)
+ /* Skip the first slashes, which are a node number part */
+ /* Full QNX4 pathname is //node/dirpath/filename */
+ if ((ip==in) && (is_slash(*ip)) && (is_slash(*(ip+1))))
+ {
+ *op=*ip;
+ ip++;
+ op++;
+ }
+#endif // TVOSf_QNX4
+
+ /* Step through the input path */
+ while (*ip)
+ {
+ /* Skip input slashes */
+ if (is_slash(*ip))
+ {
+ ip++;
+ continue;
+ }
+
+ /* Skip "." and output nothing */
+ if (*ip == '.' && is_term(*(ip + 1)))
+ {
+ ip++;
+ continue;
+ }
+
+ /* Skip ".." and remove previous output directory */
+ if (*ip == '.' && *(ip + 1) == '.' && is_term(*(ip + 2)))
+ {
+ ip += 2;
+ /* Don't back up over root '/' */
+ if (op > out )
+ /* This requires "/" to follow drive spec */
+ while (!is_slash(*--op));
+ continue;
+ }
+
+ /* Copy path component from in to out */
+ *op++ = '/';
+ while (!is_term(*ip)) *op++ = *ip++;
+ }
+
+ /* If root directory, insert trailing slash */
+ if (op == out) *op++ = '/';
+
+ /* Null terminate the output */
+ *op = '\0';
+
+}
+
+/*
+ End of modified code from DJGPP's libc 'fixpath.c'
+*/
+#endif /* DJGPP, Linux and CygWin */
+
diff --git a/tvision/compat/fnmatch.c b/tvision/compat/fnmatch.c
new file mode 100644
index 0000000..df4dcd8
--- /dev/null
+++ b/tvision/compat/fnmatch.c
@@ -0,0 +1,150 @@
+/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+/* Modified for Win32 by Anatoli Soltan */
+#include <cl/needs.h>
+
+#ifdef NEEDS_FNMATCH
+#include <string.h>
+#include <ctype.h>
+#define Uses_fnmatch
+#include <compatlayer.h>
+
+#define EOS '\0'
+
+static const char *rangematch(const char *pattern, char test, int nocase);
+
+#define isslash(c) ((c) == '\\' || (c) == '/')
+
+static const char *
+find_slash(const char *s)
+{
+ while (*s)
+ {
+ if (isslash(*s))
+ return s;
+ s++;
+ }
+ return 0;
+}
+
+static const char *
+rangematch(const char *pattern, char test, int nocase)
+{
+ char c, c2;
+ int negate, ok;
+
+ if (!!(negate = (*pattern == '!')))
+ ++pattern;
+
+ for (ok = 0; (c = *pattern++) != ']';)
+ {
+ if (c == 0)
+ return 0; /* illegal pattern */
+ if (*pattern == '-' && (c2 = pattern[1]) != 0 && c2 != ']')
+ {
+ if (c <= test && test <= c2)
+ ok = 1;
+ if (nocase && toupper(c) <= toupper(test) && toupper(test) <= toupper(c2))
+ ok = 1;
+ pattern += 2;
+ }
+ else if (c == test)
+ ok = 1;
+ else if (nocase && (toupper(c) == toupper(test)))
+ ok = 1;
+ }
+ return ok == negate ? NULL : pattern;
+}
+
+int
+fnmatch(const char *pattern, const char *string, int flags)
+{
+ char c;
+ char test;
+
+ for (;;)
+ switch ((c = *pattern++))
+ {
+ case 0:
+ return *string == 0 ? 0 : FNM_NOMATCH;
+
+ case '?':
+ if ((test = *string++) == 0 ||
+ (isslash(test) && (flags & FNM_PATHNAME)))
+ return(FNM_NOMATCH);
+ break;
+
+ case '*':
+ c = *pattern;
+ /* collapse multiple stars */
+ while (c == '*')
+ c = *++pattern;
+
+ /* optimize for pattern with * at end or before / */
+ if (c == 0)
+ {
+ if (flags & FNM_PATHNAME)
+ return find_slash(string) ? FNM_NOMATCH : 0;
+ else
+ return 0;
+ }
+ else if (isslash(c) && flags & FNM_PATHNAME)
+ {
+ if ((string = find_slash(string)) == NULL)
+ return FNM_NOMATCH;
+ break;
+ }
+
+ /* general case, use recursion */
+ while ((test = *string) != 0)
+ {
+ if (fnmatch(pattern, string, flags) == 0)
+ return(0);
+ if (isslash(test) && flags & FNM_PATHNAME)
+ break;
+ ++string;
+ }
+ return FNM_NOMATCH;
+
+ case '[':
+ if ((test = *string++) == 0 ||
+ (isslash(test) && flags & FNM_PATHNAME))
+ return FNM_NOMATCH;
+ if ((pattern = rangematch(pattern, test, flags & FNM_NOCASE)) == NULL)
+ return FNM_NOMATCH;
+ break;
+
+ case '\\':
+ if (!(flags & FNM_NOESCAPE) && pattern[1] && strchr("*?[\\", pattern[1]))
+ {
+ if ((c = *pattern++) == 0)
+ {
+ c = '\\';
+ --pattern;
+ }
+ if (c != *string++)
+ return FNM_NOMATCH;
+ break;
+ }
+ /* FALLTHROUGH */
+
+ default:
+ if (isslash(c) && isslash(*string))
+ {
+ string++;
+ break;
+ }
+ if (flags & FNM_NOCASE)
+ {
+ if (toupper(c) != toupper(*string++))
+ return FNM_NOMATCH;
+ }
+ else
+ {
+ if (c != *string++)
+ return FNM_NOMATCH;
+ }
+ break;
+ }
+}
+#endif // NEEDS_FNMATCH
diff --git a/tvision/compat/getcurdir.c b/tvision/compat/getcurdir.c
new file mode 100644
index 0000000..6af56ec
--- /dev/null
+++ b/tvision/compat/getcurdir.c
@@ -0,0 +1,68 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000 Vadim Beloborodov
+ Copyright (C) 2000 Anatoli Soltan
+ Copyright (C) 2000-2005 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#include <cl/needs.h>
+
+#define Uses_limits
+#define Uses_string
+#define Uses_unistd
+#include <compatlayer.h>
+
+#ifdef NEEDS_GETCURDIR
+
+#ifdef TVCompf_djgpp
+// DOS version by Robert
+#include <dir.h>
+
+int CLY_getcurdir(int drive, char *buffer)
+{
+ if (!drive) getwd(buffer);
+ else
+ {
+ int d = getdisk();
+ setdisk(drive-1);
+ getwd(buffer);
+ setdisk(d);
+ }
+ strcpy(buffer,buffer+3);
+ return 0;
+}
+#endif // DJGPP
+
+#if defined(TVOS_Win32) && !defined(TVComp_BCPP) && !defined(TVCompf_Cygwin)
+// MSVC/MingW/OW Windows version by Vadim and Anatoli
+#include <direct.h>
+
+int CLY_getcurdir(int drive, char *buffer)
+{
+ _getdcwd(drive, buffer,PATH_MAX);
+ strcpy(buffer,buffer+3);
+ return 0;
+}
+#endif // MSVC/MingW/OW
+
+#if defined(TVOS_UNIX) || defined(TVCompf_Cygwin)
+// Linux and CygWin version
+
+int CLY_getcurdir(int drive, char *buffer)
+{
+ getcwd(buffer, PATH_MAX);
+ return 0;
+}
+#endif
+
+#endif // NEEDS_GETCURDIR
+
+void CLY_GetCurDirSlash(char *dir)
+{
+ getcwd(dir,PATH_MAX);
+ if (dir[strlen(dir)-1]!=DIRSEPARATOR)
+ strcat(dir,DIRSEPARATOR_);
+}
+
+
diff --git a/tvision/compat/getline.c b/tvision/compat/getline.c
new file mode 100644
index 0000000..f3a535d
--- /dev/null
+++ b/tvision/compat/getline.c
@@ -0,0 +1,189 @@
+/**[txh]********************************************************************
+
+ Description:
+ getline.c -- Replacement for GNU C library function getline.
+
+***************************************************************************/
+#include <cl/needs.h>
+
+#ifdef NEEDS_GETLINE
+/* getline.c -- Replacement for GNU C library function getline
+
+Copyright (C) 1993 Free Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details. */
+
+/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */
+/* Small modifications by Salvador E. Tropea <set@ieee.org> */
+
+#define NDEBUG
+
+/* Already included */
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
+/*#include "getline.h"*/
+/** Header **/
+#define GETLINE_NO_LIMIT -1
+
+#if defined(TVCompf_MinGW)
+ #if defined(_SSIZE_T_) && !defined(_NO_OLDNAMES)
+ #define MinGW_SSIZE_T 0
+ #else
+ #define MinGW_SSIZE_T 1
+ #endif
+#endif
+
+#if defined(TVComp_BCPP) || MinGW_SSIZE_T || defined(TVComp_MSC) || defined(TVComp_Watcom)
+typedef long ssize_t;
+#endif
+
+ssize_t CLY_getline(char **_lineptr, size_t *_n, FILE *_stream);
+ssize_t CLY_getline_safe(char **_lineptr, size_t *_n, FILE *_stream, int limit);
+ssize_t CLY_getstr(char **_lineptr, size_t *_n, FILE *_stream,
+ char _terminator, int _offset, int limit);
+/** End of Header **/
+
+/* Always add at least this many bytes when extending the buffer. */
+#define MIN_CHUNK 64
+
+/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR
+ + OFFSET (and null-terminate it). If LIMIT is non-negative, then
+ read no more than LIMIT chars.
+
+ *LINEPTR is a pointer returned from malloc (or NULL), pointing to
+ *N characters of space. It is realloc'd as necessary.
+
+ Return the number of characters read (not including the null
+ terminator), or -1 on error or EOF. On a -1 return, the caller
+ should check feof(), if not then errno has been set to indicate the
+ error. */
+
+ssize_t CLY_getstr(char **lineptr, size_t *n, FILE *stream, char terminator,
+ int offset, int limit)
+{
+ int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
+ char *read_pos; /* Where we're reading into *LINEPTR. */
+ ssize_t ret;
+
+ if (!lineptr || !n || !stream)
+ {
+ errno=EINVAL;
+ return -1;
+ }
+
+ if (!*lineptr)
+ {
+ *n=MIN_CHUNK;
+ *lineptr=(char *)malloc(*n);
+ if (!*lineptr)
+ {
+ errno=ENOMEM;
+ return -1;
+ }
+ }
+
+ nchars_avail=*n-offset;
+ read_pos=*lineptr+offset;
+
+ for (;;)
+ {
+ int save_errno;
+ register int c;
+
+ if (limit==0)
+ break;
+ else
+ {
+ c=getc(stream);
+ /* If limit is negative, then we shouldn't pay attention to
+ it, so decrement only if positive. */
+ if (limit>0)
+ limit--;
+ }
+ save_errno=errno;
+
+ /* We always want at least one char left in the buffer, since we
+ always (unless we get an error while reading the first char)
+ NUL-terminate the line buffer. */
+
+ assert((*lineptr+*n)==(read_pos+nchars_avail));
+ if (nchars_avail<2)
+ {
+ if (*n>MIN_CHUNK)
+ *n*=2;
+ else
+ *n+=MIN_CHUNK;
+
+ nchars_avail=*n+*lineptr-read_pos;
+ *lineptr=(char *)realloc(*lineptr,*n);
+ if (!*lineptr)
+ {
+ errno=ENOMEM;
+ return -1;
+ }
+ read_pos=*n-nchars_avail+*lineptr;
+ assert((*lineptr+*n)==(read_pos+nchars_avail));
+ }
+
+ if (ferror(stream))
+ {
+ /* Might like to return partial line, but there is no
+ place for us to store errno. And we don't want to just
+ lose errno. */
+ errno = save_errno;
+ return -1;
+ }
+
+ if (c==EOF)
+ {
+ /* Return partial line, if any. */
+ if (read_pos==*lineptr)
+ return -1;
+ else
+ break;
+ }
+
+ /* SET: Why in the hell a low level function should do it? */
+ #if 0 /*_WIN32*/
+ /* Text mode translation, CR/LF pairs into LF */
+ if (terminator=='\n' && c=='\r')
+ continue;
+ #endif
+
+ *read_pos++=c;
+ nchars_avail--;
+
+ if (c==terminator)
+ /* Return the line. */
+ break;
+ }
+
+ /* Done - NUL terminate and return the number of chars read. */
+ *read_pos='\0';
+
+ ret=read_pos-(*lineptr+offset);
+ return ret;
+}
+
+ssize_t CLY_getline(char **lineptr, size_t *n, FILE *stream)
+{
+ return CLY_getstr(lineptr,n,stream,'\n',0,GETLINE_NO_LIMIT);
+}
+
+ssize_t CLY_getline_safe(char **lineptr, size_t *n, FILE *stream, int limit)
+{
+ return CLY_getstr(lineptr,n,stream,'\n',0,limit);
+}
+#endif // NEEDS_GETLINE
+
diff --git a/tvision/compat/getopt.c b/tvision/compat/getopt.c
new file mode 100644
index 0000000..a53c8b7
--- /dev/null
+++ b/tvision/compat/getopt.c
@@ -0,0 +1,754 @@
+/* Getopt for GNU.
+ NOTE: getopt is now part of the C library, so if you don't know what
+ "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
+ before changing it!
+
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
+ Free Software Foundation, Inc.
+ Copyright (C) 2000, 01, 2002
+ Salvador E. Tropea.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
+#include <cl/needs.h>
+
+#ifdef NEEDS_GETOPT
+
+/* NOTE!!! AIX requires this to be the first thing in the file.
+ Do not put ANYTHING before it! */
+#if !defined (TVComp_GCC) && defined (_AIX)
+ #pragma alloca
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef TVComp_GCC
+ #define alloca __builtin_alloca
+#else /* not TVComp_GCC */
+ #if defined (HAVE_ALLOCA_H) || (defined(sparc) && (defined(sun) || (!defined(USG) && !defined(SVR4) && !defined(__svr4__))))
+ #include <alloca.h>
+ #else
+ #ifdef TVComp_BCPP
+ #include <malloc.h>
+ #else
+ #ifdef TVComp_MSC
+ #include <malloc.h>
+ #define alloca _alloca
+ #else
+ #ifdef TVComp_Watcom
+ void *alloca ();
+ #else
+ #ifndef _AIX
+ char *alloca ();
+ #endif
+ #endif /* TVComp_Watcom */
+ #endif /* MSVC */
+ #endif /* TURBOC */
+ #endif /* alloca.h */
+#endif /* not TVComp_GCC */
+
+#if !__STDC__ && !defined(const) && IN_GCC
+#define const
+#endif
+
+/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. */
+#ifndef _NO_PROTO
+#define _NO_PROTO
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+ #undef alloca
+ /* Don't include stdlib.h for non-GNU C libraries because some of them
+ contain conflicting prototypes for getopt. */
+ #include <stdlib.h>
+#else /* Not GNU C library. */
+ #ifndef TVComp_Watcom
+ #define __alloca alloca
+ #endif
+#endif /* GNU C library. */
+
+/* SET: more headers needed, __alloca isn't valid */
+#if defined(TVCompf_djgpp) || defined(TVOS_Win32) || defined(TVOSf_Solaris) || defined(TVOSf_QNX4)
+ #include <stdlib.h>
+#endif
+
+#if defined(TVComp_BCPP) || defined(TVComp_Watcom)
+ #include <malloc.h> /* alloca */
+#endif
+
+/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
+ long-named option. Because this is not POSIX.2 compliant, it is
+ being phased out. */
+/* #define GETOPT_COMPAT */
+
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+ but it behaves differently for the user, since it allows the user
+ to intersperse the options with the other arguments.
+
+ As `getopt' works, it permutes the elements of ARGV so that,
+ when it is done, all the options precede everything else. Thus
+ all application programs are extended to handle flexible argument order.
+
+ Setting the environment variable POSIXLY_CORRECT disables permutation.
+ Then the behavior is completely standard.
+
+ GNU application programs can use a third alternative mode in which
+ they can distinguish the relative order of options and other arguments. */
+
+#include <cl/getopt.h>
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *CLY_optarg = 0;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* XXX 1003.2 says this must be 1 before any call. */
+int CLY_optind = 0;
+
+/* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+
+static char *nextchar;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int CLY_opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+int CLY_optopt = '?';
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using `+' as the first character
+ of the list of option characters.
+
+ PERMUTE is the default. We permute the contents of ARGV as we scan,
+ so that eventually all the non-options are at the end. This allows options
+ to be given in any order, even with programs that were not written to
+ expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were written
+ to expect options and other ARGV-elements in any order and that care about
+ the ordering of the two. We describe each non-option ARGV-element
+ as if it were the argument of an option with character code 1.
+ Using `-' as the first character of the list of option characters
+ selects this mode of operation.
+
+ The special argument `--' forces an end of option-scanning regardless
+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
+ `--' can cause `getopt' to return EOF with `optind' != ARGC. */
+
+static enum
+{
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+} ordering;
+
+/* SET: I don't understand why hello.c doesn't make it */
+#if defined(__GNU_LIBRARY__) || defined(TVCompf_djgpp) || defined(TVOS_Win32) || defined(TVOSf_Solaris) || defined(TVOSf_QNX4)
+/* We want to avoid inclusion of string.h with non-GNU libraries
+ because there are many ways it can cause trouble.
+ On some systems, it contains special magic macros that don't work
+ in GCC. */
+#include <string.h>
+#define my_index strchr
+#define my_bcopy(src, dst, n) memcpy ((dst), (src), (n))
+#else
+
+/* Avoid depending on library functions or files
+ whose names are inconsistent. */
+
+char *getenv ();
+
+static char *
+my_index (str, chr)
+ const char *str;
+ int chr;
+{
+ while (*str)
+ {
+ if (*str == chr)
+ return (char *) str;
+ str++;
+ }
+ return 0;
+}
+
+static void
+my_bcopy (from, to, size)
+ const char *from;
+ char *to;
+ int size;
+{
+ int i;
+ for (i = 0; i < size; i++)
+ to[i] = from[i];
+}
+#endif /* GNU C library. */
+
+/* Handle permutation of arguments. */
+
+/* Describe the part of ARGV that contains non-options that have
+ been skipped. `first_nonopt' is the index in ARGV of the first of them;
+ `last_nonopt' is the index after the last of them. */
+
+static int first_nonopt;
+static int last_nonopt;
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ `first_nonopt' and `last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved. */
+
+static void
+exchange (char **argv)
+{
+ int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *);
+ char **temp = (char **) __alloca (nonopts_size);
+
+ /* Interchange the two blocks of data in ARGV. */
+
+ my_bcopy ((char *) &argv[first_nonopt], (char *) temp, nonopts_size);
+ my_bcopy ((char *) &argv[last_nonopt], (char *) &argv[first_nonopt],
+ (CLY_optind - last_nonopt) * sizeof (char *));
+ my_bcopy ((char *) temp,
+ (char *) &argv[first_nonopt + CLY_optind - last_nonopt],
+ nonopts_size);
+
+ /* Update records for the slots the non-options now occupy. */
+
+ first_nonopt += (CLY_optind - last_nonopt);
+ last_nonopt = CLY_optind;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If `getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If `getopt' finds another option character, it returns that character,
+ updating `optind' and `nextchar' so that the next call to `getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, `getopt' returns `EOF'.
+ Then `optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return '?' after printing an error message. If you set `opterr' to
+ zero, the error message is suppressed but we still return '?'.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in `optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in `optarg', otherwise `optarg' is set to zero.
+
+ If OPTSTRING starts with `-' or `+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with `--' instead of `-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a `=', or else the in next ARGV-element.
+ When `getopt' finds a long-named option, it returns 0 if that option's
+ `flag' field is nonzero, the value of the option's `val' field
+ if the `flag' field is zero.
+
+ The elements of ARGV aren't really const, because we permute them.
+ But we pretend they're const in the prototype to be compatible
+ with other systems.
+
+ LONGOPTS is a vector of `struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+int
+CLY_getopt_internal(int argc, char *const *argv, const char *optstring,
+ const struct CLY_option *longopts, int *longind, int long_only)
+{
+ int option_index;
+
+ CLY_optarg = 0;
+
+ /* Initialize the internal data when the first call is made.
+ Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+
+ if (CLY_optind == 0)
+ {
+ first_nonopt = last_nonopt = CLY_optind = 1;
+
+ nextchar = NULL;
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+
+ if (optstring[0] == '-')
+ {
+ ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (getenv ("POSIXLY_CORRECT") != NULL)
+ ordering = REQUIRE_ORDER;
+ else
+ ordering = PERMUTE;
+ }
+
+ if (nextchar == NULL || *nextchar == '\0')
+ {
+ if (ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (first_nonopt != last_nonopt && last_nonopt != CLY_optind)
+ exchange ((char **) argv);
+ else if (last_nonopt != CLY_optind)
+ first_nonopt = CLY_optind;
+
+ /* Now skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (CLY_optind < argc
+ && (argv[CLY_optind][0] != '-' || argv[CLY_optind][1] == '\0')
+#ifdef GETOPT_COMPAT
+ && (longopts == NULL
+ || argv[CLY_optind][0] != '+' || argv[CLY_optind][1] == '\0')
+#endif /* GETOPT_COMPAT */
+ )
+ CLY_optind++;
+ last_nonopt = CLY_optind;
+ }
+
+ /* Special ARGV-element `--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (CLY_optind != argc && !strcmp (argv[CLY_optind], "--"))
+ {
+ CLY_optind++;
+
+ if (first_nonopt != last_nonopt && last_nonopt != CLY_optind)
+ exchange ((char **) argv);
+ else if (first_nonopt == last_nonopt)
+ first_nonopt = CLY_optind;
+ last_nonopt = argc;
+
+ CLY_optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (CLY_optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (first_nonopt != last_nonopt)
+ CLY_optind = first_nonopt;
+ return EOF;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if ((argv[CLY_optind][0] != '-' || argv[CLY_optind][1] == '\0')
+#ifdef GETOPT_COMPAT
+ && (longopts == NULL
+ || argv[CLY_optind][0] != '+' || argv[CLY_optind][1] == '\0')
+#endif /* GETOPT_COMPAT */
+ )
+ {
+ if (ordering == REQUIRE_ORDER)
+ return EOF;
+ CLY_optarg = argv[CLY_optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Start decoding its characters. */
+
+ nextchar = (argv[CLY_optind] + 1
+ + (longopts != NULL && argv[CLY_optind][1] == '-'));
+ }
+
+ if (longopts != NULL
+ && ((argv[CLY_optind][0] == '-'
+ && (argv[CLY_optind][1] == '-' || long_only))
+#ifdef GETOPT_COMPAT
+ || argv[CLY_optind][0] == '+'
+#endif /* GETOPT_COMPAT */
+ ))
+ {
+ const struct CLY_option *p;
+ char *s = nextchar;
+ int exact = 0;
+ int ambig = 0;
+ const struct CLY_option *pfound = NULL;
+ /* SET: might be used no initialized? */
+ int indfound=0;
+
+ while (*s && *s != '=')
+ s++;
+
+ /* Test all options for either exact match or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name;
+ p++, option_index++)
+ if (!strncmp (p->name, nextchar, s - nextchar))
+ {
+ if ((size_t)(s - nextchar) == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second nonexact match found. */
+ ambig = 1;
+ }
+
+ if (ambig && !exact)
+ {
+ if (CLY_opterr)
+ fprintf (stderr, "%s: option `%s' is ambiguous\n",
+ argv[0], argv[CLY_optind]);
+ nextchar += strlen (nextchar);
+ CLY_optind++;
+ return '?';
+ }
+
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ CLY_optind++;
+ if (*s)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ CLY_optarg = s + 1;
+ else
+ {
+ if (CLY_opterr)
+ {
+ if (argv[CLY_optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ "%s: option `--%s' doesn't allow an argument\n",
+ argv[0], pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ "%s: option `%c%s' doesn't allow an argument\n",
+ argv[0], argv[CLY_optind - 1][0], pfound->name);
+ }
+ nextchar += strlen (nextchar);
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (CLY_optind < argc)
+ CLY_optarg = argv[CLY_optind++];
+ else
+ {
+ if (CLY_opterr)
+ fprintf (stderr, "%s: option `%s' requires an argument\n",
+ argv[0], argv[CLY_optind - 1]);
+ nextchar += strlen (nextchar);
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short
+ option, then it's an error.
+ Otherwise interpret it as a short option. */
+ if (!long_only || argv[CLY_optind][1] == '-'
+#ifdef GETOPT_COMPAT
+ || argv[CLY_optind][0] == '+'
+#endif /* GETOPT_COMPAT */
+ || my_index (optstring, *nextchar) == NULL)
+ {
+ if (CLY_opterr)
+ {
+ if (argv[CLY_optind][1] == '-')
+ /* --option */
+ fprintf (stderr, "%s: unrecognized option `--%s'\n",
+ argv[0], nextchar);
+ else
+ /* +option or -option */
+ fprintf (stderr, "%s: unrecognized option `%c%s'\n",
+ argv[0], argv[CLY_optind][0], nextchar);
+ }
+ nextchar = (char *) "";
+ CLY_optind++;
+ return '?';
+ }
+ }
+
+ /* Look at and handle the next option-character. */
+
+ {
+ char c = *nextchar++;
+ char *temp = my_index (optstring, c);
+
+ /* Increment `optind' when we start to process its last character. */
+ if (*nextchar == '\0')
+ ++CLY_optind;
+
+ if (temp == NULL || c == ':')
+ {
+ if (CLY_opterr)
+ {
+#if 0
+ if (c < 040 || c >= 0177)
+ fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
+ argv[0], c);
+ else
+ fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c);
+#else
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
+#endif
+ }
+ CLY_optopt = c;
+ return '?';
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*nextchar != '\0')
+ {
+ CLY_optarg = nextchar;
+ CLY_optind++;
+ }
+ else
+ CLY_optarg = 0;
+ nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ CLY_optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ CLY_optind++;
+ }
+ else if (CLY_optind == argc)
+ {
+ if (CLY_opterr)
+ {
+#if 0
+ fprintf (stderr, "%s: option `-%c' requires an argument\n",
+ argv[0], c);
+#else
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, "%s: option requires an argument -- %c\n",
+ argv[0], c);
+#endif
+ }
+ CLY_optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ CLY_optarg = argv[CLY_optind++];
+ nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int
+CLY_getopt(int argc, char *const *argv, const char *optstring)
+{
+ return CLY_getopt_internal (argc, argv, optstring,
+ (const struct CLY_option *) 0,
+ (int *) 0,
+ 0);
+}
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of `getopt'. */
+
+int
+main (int argc, char **argv)
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = CLY_optind ? CLY_optind : 1;
+
+ c = CLY_getopt (argc, argv, "abc:d:0123456789");
+ if (c == EOF)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", CLY_optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (CLY_optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (CLY_optind < argc)
+ printf ("%s ", argv[CLY_optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
+#endif /* NEEDS_GETOPT */
diff --git a/tvision/compat/getopt1.c b/tvision/compat/getopt1.c
new file mode 100644
index 0000000..52a20f6
--- /dev/null
+++ b/tvision/compat/getopt1.c
@@ -0,0 +1,174 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
+ Free Software Foundation, Inc.
+ Copyright (C) 2000, 01, 2002
+ Salvador E. Tropea.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <cl/needs.h>
+
+#ifdef NEEDS_GETOPT
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <cl/getopt.h>
+
+#if !__STDC__ && !defined(const) && IN_GCC
+#define const
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#if defined(__GNU_LIBRARY__) || defined(TVOS_Win32)
+#include <stdlib.h>
+#else
+char *getenv ();
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+int
+CLY_getopt_long(int argc, char *const *argv, const char *options,
+ const struct CLY_option *long_options, int *opt_index)
+{
+ return CLY_getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+ If an option that starts with '-' (not '--') doesn't match a long option,
+ but does match a short option, it is parsed as a short option
+ instead. */
+
+int
+CLY_getopt_long_only(int argc, char *const *argv, const char *options,
+ const struct CLY_option *long_options, int *opt_index)
+{
+ return CLY_getopt_internal (argc, argv, options, long_options, opt_index, 1);
+}
+
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
+
+#ifdef TEST
+
+#include <stdio.h>
+
+int
+main (int argc, char **argv)
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = CLY_optind ? CLY_optind : 1;
+ int option_index = 0;
+ static struct CLY_option long_options[] =
+ {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "abc:d:0123456789",
+ long_options, &option_index);
+ if (c == EOF)
+ break;
+
+ switch (c)
+ {
+ case 0:
+ printf ("option %s", long_options[option_index].name);
+ if (CLY_optarg)
+ printf (" with arg %s", CLY_optarg);
+ printf ("\n");
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", CLY_optarg);
+ break;
+
+ case 'd':
+ printf ("option d with value `%s'\n", CLY_optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (CLY_optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (CLY_optind < argc)
+ printf ("%s ", argv[CLY_optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
+#endif /* NEEDS_GETOPT */
+
diff --git a/tvision/compat/getshell.c b/tvision/compat/getshell.c
new file mode 100644
index 0000000..e8954be
--- /dev/null
+++ b/tvision/compat/getshell.c
@@ -0,0 +1,20 @@
+/*
+ Copyright (C) 2001,2002 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+#define Uses_stdlib
+#include <compatlayer.h>
+
+#if (defined(TVOS_DOS) || defined(TVOS_Win32)) && !defined(TVCompf_Cygwin)
+CLY_EXPORT char *CLY_GetShellName(void)
+{
+ return getenv("COMSPEC");
+}
+#endif
+
+#if defined(TVOS_UNIX) || defined(TVCompf_Cygwin)
+char *CLY_GetShellName(void)
+{
+ return getenv("SHELL");
+}
+#endif
diff --git a/tvision/compat/glob.c b/tvision/compat/glob.c
new file mode 100644
index 0000000..eea9c9c
--- /dev/null
+++ b/tvision/compat/glob.c
@@ -0,0 +1,422 @@
+/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+/* Modified for Win32 by Anatoli Soltan */
+
+#include <cl/needs.h>
+
+#ifdef NEEDS_GLOB
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <io.h>
+#include <ctype.h>
+#ifndef TVComp_MSC
+ #include <dir.h>
+#endif
+
+#define Uses_glob
+#define Uses_unistd
+#define Uses_fnmatch
+#define Uses_alloca
+#include <compatlayer.h>
+
+typedef struct Save {
+ struct Save *prev;
+ char *entry;
+} Save;
+
+static Save *save_list;
+static int save_count;
+static int flags;
+static int (*errfunc)(const char *epath, int eerno);
+static char *pathbuf;
+static int wildcard_nesting;
+static char use_lfn;
+static char preserve_case;
+static char slash;
+
+static int glob2(const char *pattern, char *epathbuf, int lower, int caseless);
+static int glob_dirs(const char *rest, char *epathbuf, int first, int lower, int caseless);
+static int add(const char *path);
+static int str_compare(const void *va, const void *vb);
+
+static int _preserve_fncase(void)
+{
+ return 1;
+}
+
+static int
+add(const char *path)
+{
+ Save *sp;
+ for (sp=save_list; sp; sp=sp->prev)
+ if (stricmp(sp->entry, path) == 0)
+ return 0;
+ sp = (Save *)malloc(sizeof(Save));
+ if (sp == 0)
+ return 1;
+ sp->entry = (char *)malloc(strlen(path)+1);
+ if (sp->entry == 0)
+ {
+ free(sp);
+ return 1;
+ }
+/* printf("add: `%s'\n", path); */
+ strcpy(sp->entry, path);
+ sp->prev = save_list;
+ save_list = sp;
+ save_count++;
+ return 0;
+}
+
+static int
+glob_dirs(const char *rest, char *epathbuf, int first, /* rest is ptr to null or ptr after slash, bp after slash */
+ int lower, int caseless)
+{
+// struct ffblk ff;
+ HANDLE hf;
+ WIN32_FIND_DATA wfd;
+ BOOL done;
+
+/* printf("glob_dirs[%d]: rest=`%s' %c epathbuf=`%s' %c pathbuf=`%s'\n",
+ wildcard_nesting, rest, *rest, epathbuf, *epathbuf, pathbuf); */
+
+ if (first)
+ {
+ if (*rest)
+ {
+ if (glob2(rest, epathbuf, lower, caseless) == GLOB_NOSPACE)
+ return GLOB_NOSPACE;
+ }
+ else
+ {
+ char sl = epathbuf[-1];
+ *epathbuf = 0;
+/* printf("end, checking `%s'\n", pathbuf); */
+ if (epathbuf == pathbuf)
+ {
+ epathbuf[0] = '.';
+ epathbuf[1] = 0;
+ }
+ else
+ epathbuf[-1] = 0;
+ if (CLY_FileExists(pathbuf))
+ if (add(pathbuf))
+ return GLOB_NOSPACE;
+ epathbuf[-1] = sl;
+ }
+ }
+
+ strcpy(epathbuf, "*.*");
+ hf = FindFirstFile(pathbuf, &wfd);
+ done = (hf == INVALID_HANDLE_VALUE);
+ while (!done)
+ {
+ if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ && (strcmp(wfd.cFileName, ".") && strcmp(wfd.cFileName, "..")))
+ {
+ char *tp;
+
+ strcpy(epathbuf, wfd.cFileName);
+ tp = epathbuf + strlen(epathbuf);
+ *tp++ = slash;
+ *tp = 0;
+
+ wildcard_nesting++;
+ if (*rest)
+ {
+ if (glob2(rest, tp, lower, caseless) == GLOB_NOSPACE)
+ return GLOB_NOSPACE;
+ }
+ else
+ {
+ if (!(flags & GLOB_MARK))
+ tp[-1] = 0;
+ if (add(pathbuf))
+ return GLOB_NOSPACE;
+ tp[-1] = slash;
+ }
+ *tp = 0;
+ if (glob_dirs(rest, tp, 0, lower, caseless) == GLOB_NOSPACE)
+ return GLOB_NOSPACE;
+ wildcard_nesting--;
+ }
+ done = !FindNextFile(hf, &wfd);
+ }
+ FindClose(hf);
+ return 0;
+}
+
+static int
+glob2(const char *pattern, char *epathbuf, /* both point *after* the slash */
+ int lower, int caseless)
+{
+ const char *pp, *pslash;
+ char *bp;
+ HANDLE hf;
+ WIN32_FIND_DATA wfd;
+ char *my_pattern;
+ int done;
+
+ if (strcmp(pattern, "...") == 0)
+ {
+ return glob_dirs(pattern+3, epathbuf, 1, lower, caseless);
+ }
+ if (strncmp(pattern, "...", 3) == 0 && (pattern[3] == '\\' || pattern[3] == '/'))
+ {
+ slash = pattern[3];
+ return glob_dirs(pattern+4, epathbuf, 1, lower, caseless);
+ }
+
+ *epathbuf = 0;
+ /* copy as many non-wildcard segments as possible */
+ pp = pattern;
+ bp = epathbuf;
+ pslash = bp-1;
+ while (1)
+ {
+ if (*pp == ':' || *pp == '\\' || *pp == '/')
+ {
+ pslash = bp;
+ if (strcmp(pp+1, "...") == 0
+ || (strncmp(pp+1, "...", 3) == 0 && (pp[4] == '/' || pp[4] == '\\')))
+ {
+ if (*pp != ':')
+ slash = *pp;
+/* printf("glob2: dots at `%s'\n", pp); */
+ *bp++ = *pp++;
+ break;
+ }
+ }
+
+ else if (*pp == '*' || *pp == '?' || *pp == '[')
+ {
+ if (pslash > pathbuf)
+ strncpy(epathbuf, pattern, pslash - pathbuf);
+ pp = pattern + (pslash - epathbuf) + 1;
+ bp = epathbuf + (pslash - epathbuf) + 1;
+ break;
+ }
+
+ else if (*pp == 0)
+ {
+ break;
+ }
+
+ /* Upper-case or mixed-case patterns force case-sensitive
+ matches in `fnmatch' for LFN filesystems. They also
+ suppress downcasing 8+3 filenames (on all filesystems). */
+ else if (!preserve_case)
+ {
+ if (*pp >= 'A' && *pp <= 'Z')
+ {
+ if (use_lfn)
+ caseless = 0;
+ lower = 0;
+ }
+ else if (*pp >= 'a' && *pp <= 'z')
+ lower = 1;
+ }
+
+ *bp++ = *pp++;
+ }
+ *bp = 0;
+
+ if (*pp == 0) /* end of pattern? */
+ {
+ if (CLY_FileExists(pathbuf))
+ {
+ if (flags & GLOB_MARK)
+ {
+ HANDLE _hf;
+ WIN32_FIND_DATA _wfd;
+ _hf = FindFirstFile(pathbuf, &_wfd);
+ //findfirst(pathbuf, &_ff, FA_RDONLY|FA_SYSTEM|FA_DIREC|FA_ARCH);
+ if (_hf != INVALID_HANDLE_VALUE && _wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ {
+ char *_pathbuf = pathbuf + strlen(pathbuf);
+ *_pathbuf++ = '/';
+ *_pathbuf = 0;
+ }
+ FindClose(_hf);
+ }
+ if (add(pathbuf))
+ return GLOB_NOSPACE;
+ }
+ return 0;
+ }
+/* printf("glob2: initial segment is `%s'\n", pathbuf); */
+ if (wildcard_nesting)
+ {
+ char s = bp[-1];
+ bp[-1] = 0;
+ if (!CLY_FileExists(pathbuf))
+ return 0;
+ bp[-1] = s;
+ }
+
+ for (pslash = pp; *pslash && *pslash != '\\' && *pslash != '/'; pslash++)
+ if (!preserve_case)
+ {
+ if (*pslash >= 'A' && *pslash <= 'Z')
+ {
+ if (use_lfn)
+ caseless = 0;
+ lower = 0;
+ }
+ else if (*pslash >= 'a' && *pslash <= 'z')
+ lower = 1;
+ }
+
+ if (*pslash)
+ slash = *pslash;
+ my_pattern = (char *)alloca(pslash - pp + 1);
+ if (my_pattern == 0)
+ return GLOB_NOSPACE;
+ strncpy(my_pattern, pp, pslash - pp);
+ my_pattern[pslash-pp] = 0;
+
+/* printf("glob2: `%s' `%s'\n", pathbuf, my_pattern); */
+
+ if (strcmp(my_pattern, "...") == 0)
+ {
+ if (glob_dirs(*pslash ? pslash+1 : pslash, bp, 1, lower, caseless) == GLOB_NOSPACE)
+ return GLOB_NOSPACE;
+ return 0;
+ }
+
+ strcpy(bp, "*.*");
+
+ hf = FindFirstFile(pathbuf, &wfd);
+ done = (hf == INVALID_HANDLE_VALUE);
+ //done = findfirst(pathbuf, &ff, FA_RDONLY|FA_SYSTEM|FA_DIREC|FA_ARCH);
+ while (!done)
+ {
+ if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0
+ || (strcmp(wfd.cFileName, ".") && strcmp(wfd.cFileName, "..")))
+ {
+ if (fnmatch(my_pattern, wfd.cFileName,
+ FNM_NOESCAPE|FNM_PATHNAME|(caseless ? FNM_NOCASE : 0)) == 0)
+ {
+ strcpy(bp, wfd.cFileName);
+ if (*pslash)
+ {
+ char *tp = bp + strlen(bp);
+ *tp++ = *pslash;
+ *tp = 0;
+/* printf("nest: `%s' `%s'\n", pslash+1, pathbuf); */
+ wildcard_nesting++;
+ if (glob2(pslash+1, tp, lower, caseless) == GLOB_NOSPACE)
+ return GLOB_NOSPACE;
+ wildcard_nesting--;
+ }
+ else
+ {
+/* printf("ffmatch: `%s' matching `%s', add `%s'\n",
+ wfd.cFileName, my_pattern, pathbuf); */
+ if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && (flags & GLOB_MARK))
+ {
+ bp[strlen(bp)+1] = 0;
+ bp[strlen(bp)] = slash;
+ }
+ if (add(pathbuf))
+ return GLOB_NOSPACE;
+ }
+ }
+ }
+ done = !FindNextFile(hf, &wfd);
+ }
+
+ return 0;
+}
+
+static int
+str_compare(const void *va, const void *vb)
+{
+ return strcmp(*(const char * const *)va, *(const char * const *)vb);
+}
+
+int
+glob(const char *_pattern, int _flags, int (*_errfunc)(const char *_epath, int _eerrno), glob_t *_pglob)
+{
+ char path_buffer[2000];
+ int l_ofs, l_ptr;
+
+ pathbuf = path_buffer+1;
+ flags = _flags;
+ errfunc = _errfunc;
+ wildcard_nesting = 0;
+ save_count = 0;
+ save_list = 0;
+ preserve_case = (char)_preserve_fncase();
+ slash = '/';
+
+ if (!(_flags & GLOB_APPEND))
+ {
+ _pglob->gl_pathc = 0;
+ _pglob->gl_pathv = NULL;
+ if (!(flags & GLOB_DOOFFS))
+ _pglob->gl_offs = 0;
+ }
+ if (glob2(_pattern, pathbuf, preserve_case ? 0 : 1, /*preserve_case ? 0 :*/ 1) == GLOB_NOSPACE)
+ {
+ return GLOB_NOSPACE;
+ }
+
+ if (save_count == 0)
+ {
+ if (flags & GLOB_NOCHECK)
+ {
+ if (add(_pattern))
+ return GLOB_NOSPACE;
+ }
+ else
+ return GLOB_NOMATCH;
+ }
+
+ if (flags & GLOB_DOOFFS)
+ l_ofs = _pglob->gl_offs;
+ else
+ l_ofs = 0;
+
+ if (flags & GLOB_APPEND)
+ {
+ _pglob->gl_pathv = (char **)realloc(_pglob->gl_pathv, (l_ofs + _pglob->gl_pathc + save_count + 1) * sizeof(char *));
+ if (_pglob->gl_pathv == 0)
+ return GLOB_NOSPACE;
+ l_ptr = l_ofs + _pglob->gl_pathc;
+ }
+ else
+ {
+ _pglob->gl_pathv = (char* *)malloc((l_ofs + save_count + 1) * sizeof(char *));
+ if (_pglob->gl_pathv == 0)
+ return GLOB_NOSPACE;
+ l_ptr = l_ofs;
+ if (l_ofs)
+ memset(_pglob->gl_pathv, 0, l_ofs * sizeof(char *));
+ }
+
+ l_ptr += save_count;
+ _pglob->gl_pathv[l_ptr] = 0;
+ while (save_list)
+ {
+ Save *s = save_list;
+ l_ptr --;
+ _pglob->gl_pathv[l_ptr] = save_list->entry;
+ save_list = save_list->prev;
+ free(s);
+ }
+ if (!(flags & GLOB_NOSORT))
+ qsort(_pglob->gl_pathv + l_ptr, save_count, sizeof(char *), str_compare);
+
+ _pglob->gl_pathc = l_ptr + save_count;
+
+ return 0;
+}
+#endif // NEEDS_GLOB
+
diff --git a/tvision/compat/globfree.c b/tvision/compat/globfree.c
new file mode 100644
index 0000000..ee034e1
--- /dev/null
+++ b/tvision/compat/globfree.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#include <cl/needs.h>
+
+#ifdef NEEDS_GLOB
+#define Uses_stdlib
+#define Uses_glob
+#define Uses_free
+#include <compatlayer.h>
+
+void globfree(glob_t *_pglob)
+{
+ size_t i;
+ if (!_pglob->gl_pathv)
+ return;
+ for (i=0; i<_pglob->gl_pathc; i++)
+ if (_pglob->gl_pathv[i])
+ free(_pglob->gl_pathv[i]);
+ free(_pglob->gl_pathv);
+}
+#endif // NEEDS_GLOB
diff --git a/tvision/compat/iffilelen.cc b/tvision/compat/iffilelen.cc
new file mode 100644
index 0000000..7976774
--- /dev/null
+++ b/tvision/compat/iffilelen.cc
@@ -0,0 +1,46 @@
+/*
+ Copyright (c) 2001 by Salvador E. Tropea
+ Covered by the GPL license.
+ Note: I included CLY_IfStreamGetLine here. I know it could be confusing but
+ adding a new file isn't good.
+*/
+#include <tv/configtv.h>
+#ifndef HAVE_SSC
+
+#define Uses_filelength
+#define Uses_fstream
+#include <compatlayer.h>
+
+#include <cl/needs.h>
+
+UsingNamespaceStd
+
+#if CLY_ISOCpp98
+long CLY_ifsFileLength(ifstream &f)
+{
+ std::streampos pos=f.tellg();
+ long ret=f.seekg(0,CLY_IOSEnd).tellg();
+ f.seekg(pos,CLY_IOSBeg);
+ return ret;
+}
+#else
+CLY_EXPORT long CLY_ifsFileLength(ifstream &f)
+{
+ return filelength(f.rdbuf()->fd());
+}
+#endif
+
+#ifdef NEEDS_IFSTREAMGETLINE
+CLY_EXPORT int CLY_IfStreamGetLine(ifstream &is, char *buffer, unsigned len)
+{
+ if (is.get(buffer,len))
+ {
+ char c;
+ is.get(c); // grab trailing newline
+ return 1;
+ }
+ return 0;
+}
+#endif // NEEDS_IFSTREAMGETLINE
+
+#endif
diff --git a/tvision/compat/isdir.c b/tvision/compat/isdir.c
new file mode 100644
index 0000000..8eae6a5
--- /dev/null
+++ b/tvision/compat/isdir.c
@@ -0,0 +1,19 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#define Uses_sys_stat
+#include <compatlayer.h>
+
+int CLY_IsDir(const char *str)
+{
+ struct stat s;
+
+ if (CLY_IsUNCShare(str))
+ return 1;
+ if (stat(str,&s)==0 && S_ISDIR(s.st_mode))
+ return 1;
+ return 0;
+}
diff --git a/tvision/compat/isrelpath.c b/tvision/compat/isrelpath.c
new file mode 100644
index 0000000..79fa4e9
--- /dev/null
+++ b/tvision/compat/isrelpath.c
@@ -0,0 +1,33 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000-2002 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#define Uses_ctype
+#define Uses_stdlib
+#include <compatlayer.h>
+
+#if defined(TVOS_DOS) || defined(TVOS_Win32)
+ #define StartsWithDrive(path) (ucisalpha(path[0]) && path[1]==':')
+#else
+ #define StartsWithDrive(path) (0)
+#endif
+
+#if defined(TVOS_Win32) && !defined(TVCompf_Cygwin)
+ #define IsHomeSymbol(path) (0)
+#else
+inline static int
+is_slash(int c)
+{
+ return CLY_IsValidDirSep(c);
+}
+ #define IsHomeSymbol(path) (path[0]=='~' && (!path[1] || CLY_IsValidDirSep(path[1]))\
+ && getenv("HOME"))
+#endif
+
+int CLY_IsRelativePath(const char *path)
+{
+ return
+ !(path[0] && (CLY_IsValidDirSep(path[0]) || StartsWithDrive(path) || IsHomeSymbol(path)));
+}
diff --git a/tvision/compat/iswild.c b/tvision/compat/iswild.c
new file mode 100644
index 0000000..1684eab
--- /dev/null
+++ b/tvision/compat/iswild.c
@@ -0,0 +1,12 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#include <string.h>
+
+int CLY_IsWild(const char *f)
+{
+ return strpbrk(f,"?*")!=0;
+}
diff --git a/tvision/compat/itoa.c b/tvision/compat/itoa.c
new file mode 100644
index 0000000..f3737e5
--- /dev/null
+++ b/tvision/compat/itoa.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#include <cl/needs.h>
+#ifdef NEEDS_ITOA
+#include <stdlib.h>
+#include <errno.h>
+
+char *itoa(int value, char *string, int radix)
+{
+ char tmp[32+1]; // int is 32 bits, we assume it
+ char *tp = tmp;
+ int i;
+ unsigned v;
+ int sign;
+ char *sp;
+
+ if (radix > 36 || radix <= 1)
+ {
+ errno = EDOM;
+ return 0;
+ }
+
+ sign = (radix == 10 && value < 0);
+ if (sign)
+ v = -value;
+ else
+ v = (unsigned)value;
+ while (v || tp == tmp)
+ {
+ i = v % radix;
+ v = v / radix;
+ if (i < 10)
+ *tp++ = i+'0';
+ else
+ *tp++ = i + 'a' - 10;
+ }
+
+ if (string == 0)
+ string = (char *)malloc((tp-tmp)+sign+1);
+ sp = string;
+
+ if (sign)
+ *sp++ = '-';
+ while (tp > tmp)
+ *sp++ = *--tp;
+ *sp = 0;
+ return string;
+}
+#endif // NEEDS_ITOA
diff --git a/tvision/compat/mkstemp.c b/tvision/compat/mkstemp.c
new file mode 100644
index 0000000..a8340f9
--- /dev/null
+++ b/tvision/compat/mkstemp.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2000-2005 Salvador E. Tropea */
+/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#include <cl/needs.h>
+
+#ifdef NEEDS_MKSTEMP
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <io.h>
+#include <string.h>
+
+#ifdef TVComp_Watcom
+ #include <stdlib.h>
+ #define mktemp(a) _mktemp(a)
+#endif
+
+#if _MSC_VER >= 1400
+ #define mktemp(a) _mktemp(a)
+ #define open(a,b,c) _open(a,b,c)
+#endif
+
+int mkstemp (char *_template)
+{
+ char tmp_name[FILENAME_MAX];
+ int fd = -1;
+
+ /* Make sure we create a non-exisiting file, even
+ if race conditions exist with other processes. */
+ do {
+ strcpy(tmp_name, _template);
+ errno = 0;
+ } while (mktemp (tmp_name) != NULL
+ /* SAA: changed file mode from 0 to 0666 because on WinNT it creted files
+ * with read-only attribute set. Fix me if it causes problems on other
+ * platforms.
+ */
+ && (fd = open(tmp_name, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0666)) == -1
+ && errno == EEXIST);
+
+ if (fd == -1)
+ errno = ENOENT;
+ else
+ strcpy(_template, tmp_name);
+
+ return fd;
+}
+#endif
diff --git a/tvision/compat/nl_langinfo.c b/tvision/compat/nl_langinfo.c
new file mode 100644
index 0000000..234abad
--- /dev/null
+++ b/tvision/compat/nl_langinfo.c
@@ -0,0 +1,71 @@
+/*
+ Copyright (C) 2001-2005 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#include <cl/needs.h>
+
+#ifdef NEEDS_NL_LANGINFO
+
+#define Uses_CLY_nl_langinfo
+#define Uses_string
+#define Uses_stdlib
+#define Uses_stdio // OW needs it
+#include <compatlayer.h>
+#include <locale.h>
+
+char *CLY_nl_langinfo(nl_item item)
+{
+ static char *OldLocale=0;
+ static struct lconv *locales;
+ char *ret="";
+ char *NewLocale;
+
+ /* Is that really needed? */
+ /* Get the locales and retain it */
+ if (!OldLocale)
+ {
+ OldLocale=strdup(setlocale(LC_ALL,NULL));
+ locales=localeconv();
+ }
+ else
+ {
+ NewLocale=setlocale(LC_ALL,NULL);
+ if (strcmp(NewLocale,OldLocale))
+ {
+ free(OldLocale);
+ OldLocale=strdup(NewLocale);
+ locales=localeconv();
+ }
+ }
+
+ switch (item)
+ {
+ #define C(a,b) case a: ret=locales->b; break;
+ C(CURRENCY_SYMBOL,currency_symbol)
+ C(DECIMAL_POINT,decimal_point)
+ C(GROUPING,grouping)
+ C(INT_CURR_SYMBOL,int_curr_symbol)
+ C(MON_DECIMAL_POINT,mon_decimal_point)
+ C(MON_GROUPING,mon_grouping)
+ C(NEGATIVE_SIGN,negative_sign)
+ C(POSITIVE_SIGN,positive_sign)
+ C(THOUSANDS_SEP,thousands_sep)
+ #undef C
+ #define C(a,b) case a: ret=&locales->b; break;
+ C(FRAC_DIGITS ,frac_digits)
+ C(INT_FRAC_DIGITS,int_frac_digits)
+ C(N_CS_PRECEDES ,n_cs_precedes)
+ C(N_SEP_BY_SPACE ,n_sep_by_space)
+ C(P_SIGN_POSN ,p_sign_posn)
+ C(N_SIGN_POSN ,n_sign_posn)
+ C(P_CS_PRECEDES ,p_cs_precedes)
+ C(P_SEP_BY_SPACE ,p_sep_by_space)
+ #undef C
+ }
+
+ return ret;
+}
+
+#endif // NEEDS_NL_LANGINFO
+
diff --git a/tvision/compat/ntdirent.c b/tvision/compat/ntdirent.c
new file mode 100644
index 0000000..c8820a7
--- /dev/null
+++ b/tvision/compat/ntdirent.c
@@ -0,0 +1,161 @@
+/* vi: set ts=8 sw=4 : */
+/********************************************************************\
+*File : ntdirent.c
+*
+*Subject:
+* Win32 implementation of Unix directory functions
+*
+*Authors:
+* SAA Anatoli Soltan
+*
+*HISTORY:
+* Feb 18 1997 SAA implemented opendir, readdir, closedir
+* Sep 14 1999 SAA changed _alloca to alloca to make mingw32 work
+* Mar 15 2000 SAA check for alloca definition to make it work
+* on BCB
+*********************************************************************/
+#include <cl/needs.h>
+
+#ifdef NEEDS_OPENDIR
+
+#include <malloc.h>
+#include <cl/dirent.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <io.h>
+
+#ifndef TVComp_GCC
+ #ifndef alloca
+ #define alloca _alloca
+ #endif
+#else
+ #if (__MINGW32_MAJOR_VERSION>=2) && !defined(alloca)
+ #define alloca __builtin_alloca
+ #endif
+#endif
+
+#ifndef S_IFDIR
+#ifdef _S_IFDIR
+#define S_IFDIR _S_IFDIR
+#endif
+#endif
+
+struct _DIR
+{
+ long _sig; /* structure's signature */
+ long _findh; /* find handle */
+ struct dirent _dirent; /* storage for readdir */
+ struct _finddata_t _data; /* buffer for _findnext */
+ int _status; /* status of previos _findnext */
+};
+
+#define _DIR_SIGNATURE 0xDEDEEDED
+
+
+DIR* opendir(const char* name)
+{
+ size_t len;
+ char* path;
+ DIR* dir = NULL;
+ struct stat dirstat;
+
+ /* name is NULL */
+ if (!name) {
+ errno = ENOENT;
+ return NULL;
+ }
+
+ path = (char*)name;
+ while (isspace(*path)) path++;
+
+ /* name is empty string */
+ if (!*path) {
+ errno = ENOENT;
+ return NULL;
+ }
+
+ /* add "*" mask to the dir name */
+ len = strlen(name);
+ path = (char *)alloca(len + 5);
+ strcpy(path, name);
+ if (path[len-1] == '/' || path[len-1] == '\\')
+ strcpy(path + len, "*");
+ else
+ strcpy(path + len, "\\*");
+
+ /* name is not exist */
+ if (stat(name, &dirstat))
+ return NULL;
+
+ /* name is not a directory */
+ if (!(dirstat.st_mode & S_IFDIR)) {
+ errno = ENOTDIR;
+ return NULL;
+ }
+
+ /* alloc DIR structure */
+ dir = (DIR*)malloc(sizeof(DIR));
+ if (!dir) {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ /* initialize DIR structure */
+ dir->_sig = _DIR_SIGNATURE;
+ /* do first find */
+ dir->_findh = _findfirst(path, &dir->_data);
+ if (dir->_findh == -1)
+ dir->_status = 0;
+ else
+ dir->_status = 1;
+
+ return dir;
+}
+
+
+struct dirent* readdir(DIR* dir)
+{
+ int e;
+ /* bad DIR pointer */
+ if (!dir || dir->_sig != (int)_DIR_SIGNATURE) {
+ errno = EBADF;
+ return NULL;
+ }
+
+ /* previos _findfirst or _findnext failed */
+ if (!dir->_status) {
+ return NULL;
+ }
+
+ /* copy previosly found name */
+ strcpy(dir->_dirent.d_name, dir->_data.name);
+
+ /* do next find */
+ e = errno;
+ if (_findnext(dir->_findh, &dir->_data)) {
+ errno = e;
+ dir->_status = 0;
+ }
+
+ return &dir->_dirent;
+}
+
+
+int closedir(DIR* dir)
+{
+ /* bad DIR pointer */
+ if (!dir || dir->_sig != (int)_DIR_SIGNATURE) {
+ errno = EBADF;
+ return -1;
+ }
+
+ /* close find handle */
+ if (dir->_findh != -1)
+ _findclose(dir->_findh);
+ free(dir);
+
+ return 0;
+}
+#endif /* NEEDS_OPENDIR */
diff --git a/tvision/compat/obj/delete.me b/tvision/compat/obj/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/tvision/compat/obj/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/tvision/compat/pathvalid.c b/tvision/compat/pathvalid.c
new file mode 100644
index 0000000..e610d68
--- /dev/null
+++ b/tvision/compat/pathvalid.c
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000 Anatoli Soltan
+ Copyright (C) 2000 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#define Uses_string
+#define Uses_limits
+#include <compatlayer.h>
+
+// CheckOnlyDrive(dir) and CheckDriveValid(a)
+#if CLY_HaveDriveLetters
+#define CheckOnlyDrive(dir) if (!unc && strlen(dir)<=3)\
+ return CLY_DriveValid(dir[0])
+#define CheckDriveValid(a) if (!unc && !CLY_DriveValid(dir[0]))\
+ return 0;
+#define DeclareUNCVar int unc=0
+#endif
+// By default is a nop
+#ifndef CheckOnlyDrive
+#define CheckOnlyDrive(dir)
+#endif
+#ifndef CheckDriveValid
+#define CheckDriveValid(a)
+#endif
+#ifndef DeclareUNCVar
+#define DeclareUNCVar
+#endif
+
+// CheckUNC(path)
+#ifdef TVComp_BCPP
+#define CheckUNC(path) \
+ unc = CLY_IsUNC(path); \
+ if (unc && CLY_IsUNCShare(path)) \
+ return 1
+#endif
+// By default is a nop
+#ifndef CheckUNC
+#define CheckUNC(path)
+#endif
+
+int CLY_PathValid(const char *path)
+{
+ char dir[PATH_MAX];
+ char name[PATH_MAX];
+ DeclareUNCVar;
+
+ // Set UNC variable and return if that's an UNC path
+ CheckUNC(path);
+ CLY_ExpandPath(path, dir, name);
+ // return True if that's just a valid drive letter
+ CheckOnlyDrive(dir);
+ // Force it to look like a directory
+ if (*dir && dir[strlen(dir)-1]==DIRSEPARATOR)
+ strcat(dir,".");
+ else
+ strcat(dir,DIRSEPARATOR_".");
+ // return False if the drive letter is invalid
+ CheckDriveValid(dir[0]);
+ return CLY_IsDir(dir);
+}
diff --git a/tvision/compat/regex.c b/tvision/compat/regex.c
new file mode 100644
index 0000000..e1c77ed
--- /dev/null
+++ b/tvision/compat/regex.c
@@ -0,0 +1,4973 @@
+/* Extended regular expression matching and search library,
+ version 0.12.
+ (Implements POSIX draft P10003.2/D11.2, except for
+ internationalization features.)
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <cl/needs.h>
+
+#ifdef NEEDS_REGEX
+/* AIX requires this to be the first thing in the file. */
+#if defined (_AIX) && !defined (REGEX_MALLOC)
+ #pragma alloca
+#endif
+
+#if defined(TVCompf_MinGW) || defined(TVComp_BCPP) || defined(TVComp_MSC)
+#define STDC_HEADERS 1
+#endif
+
+#define _GNU_SOURCE
+
+/* We need this for `regex.h', and perhaps for the Emacs include files. */
+#include <sys/types.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+/* The `emacs' switch turns on certain matching commands
+ that make sense only in Emacs. */
+#ifdef emacs
+
+#include "lisp.h"
+#include "buffer.h"
+#include "syntax.h"
+
+/* Emacs uses `NULL' as a predicate. */
+#undef NULL
+
+#else /* not emacs */
+
+/* We used to test for `BSTRING' here, but only GCC and Emacs define
+ `BSTRING', as far as I know, and neither of them use this code. */
+#if HAVE_STRING_H || STDC_HEADERS
+#include <string.h>
+#ifndef bcmp
+#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
+#endif
+#ifndef bcopy
+#define bcopy(s, d, n) memcpy ((d), (s), (n))
+#endif
+#ifndef bzero
+#define bzero(s, n) memset ((s), 0, (n))
+#endif
+#else
+#include <strings.h>
+#endif
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#else
+char *malloc ();
+char *realloc ();
+#endif
+
+#ifdef TVComp_BCPP
+#pragma option push -w-dpu -w-pro -w-csu
+#include <malloc.h>
+#endif
+
+static void init_syntax_once ();
+
+/* Define the syntax stuff for \<, \>, etc. */
+
+/* This must be nonzero for the wordchar and notwordchar pattern
+ commands in re_match_2. */
+#ifndef Sword
+#define Sword 1
+#endif
+
+#ifdef SYNTAX_TABLE
+
+extern char *re_syntax_table;
+
+#else /* not SYNTAX_TABLE */
+
+/* How many characters in the character set. */
+#define CHAR_SET_SIZE 256
+
+static char re_syntax_table[CHAR_SET_SIZE];
+
+static void
+init_syntax_once ()
+{
+ register int c;
+ static int done = 0;
+
+ if (done)
+ return;
+
+ bzero (re_syntax_table, sizeof re_syntax_table);
+
+ for (c = 'a'; c <= 'z'; c++)
+ re_syntax_table[c] = Sword;
+
+ for (c = 'A'; c <= 'Z'; c++)
+ re_syntax_table[c] = Sword;
+
+ for (c = '0'; c <= '9'; c++)
+ re_syntax_table[c] = Sword;
+
+ re_syntax_table['_'] = Sword;
+
+ done = 1;
+}
+
+#endif /* not SYNTAX_TABLE */
+
+#define SYNTAX(c) re_syntax_table[c]
+
+#endif /* not emacs */
+
+/* Get the interface, including the syntax bits. */
+#include <cl/regex.h>
+
+/* isalpha etc. are used for the character classes. */
+#include <ctype.h>
+
+#ifndef isascii
+#define isascii(c) 1
+#endif
+
+#ifdef isblank
+#define ISBLANK(c) (isascii (c) && isblank (c))
+#else
+#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
+#endif
+#ifdef isgraph
+#define ISGRAPH(c) (isascii (c) && isgraph (c))
+#else
+#define ISGRAPH(c) (isascii (c) && isprint (c) && !isspace (c))
+#endif
+
+#define ISPRINT(c) (isascii (c) && isprint (c))
+#define ISDIGIT(c) (isascii (c) && isdigit (c))
+#define ISALNUM(c) (isascii (c) && isalnum (c))
+#define ISALPHA(c) (isascii (c) && isalpha (c))
+#define ISCNTRL(c) (isascii (c) && iscntrl (c))
+#define ISLOWER(c) (isascii (c) && islower (c))
+#define ISPUNCT(c) (isascii (c) && ispunct (c))
+#define ISSPACE(c) (isascii (c) && isspace (c))
+#define ISUPPER(c) (isascii (c) && isupper (c))
+#define ISXDIGIT(c) (isascii (c) && isxdigit (c))
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+/* We remove any previous definition of `SIGN_EXTEND_CHAR',
+ since ours (we hope) works properly with all combinations of
+ machines, compilers, `char' and `unsigned char' argument types.
+ (Per Bothner suggested the basic approach.) */
+#undef SIGN_EXTEND_CHAR
+#if __STDC__
+#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
+#else /* not __STDC__ */
+/* As in Harbison and Steele. */
+#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
+#endif
+
+/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
+ use `alloca' instead of `malloc'. This is because using malloc in
+ re_search* or re_match* could cause memory leaks when C-g is used in
+ Emacs; also, malloc is slower and causes storage fragmentation. On
+ the other hand, malloc is more portable, and easier to debug.
+
+ Because we sometimes use alloca, some routines have to be macros,
+ not functions -- `alloca'-allocated space disappears at the end of the
+ function it is called in. */
+
+#if (__MINGW32_MAJOR_VERSION>=2) && !defined(alloca)
+ #define alloca __builtin_alloca
+#endif
+
+#ifdef REGEX_MALLOC
+
+#define REGEX_ALLOCATE malloc
+#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
+
+#else /* not REGEX_MALLOC */
+
+/* Emacs already defines alloca, sometimes. */
+#ifndef alloca
+
+/* Make alloca work the best possible way. */
+#ifdef TVComp_GCC
+#define alloca __builtin_alloca
+#else /* not TVComp_GCC */
+#if HAVE_ALLOCA_H
+#include <alloca.h>
+#else /* not TVComp_GCC or HAVE_ALLOCA_H */
+#ifndef _AIX /* Already did AIX, up at the top. */
+ #if defined(TVComp_MSC)
+ #include <malloc.h>
+ #ifndef alloca
+ #define alloca(a) _alloca(a)
+ #endif // alloca
+ #else
+ char *alloca();
+ #endif
+#endif /* not _AIX */
+#endif /* not HAVE_ALLOCA_H */
+#endif /* not TVComp_GCC */
+
+#endif /* not alloca */
+
+#define REGEX_ALLOCATE alloca
+
+/* Assumes a `char *destination' variable. */
+#define REGEX_REALLOCATE(source, osize, nsize) \
+ (destination = (char *) alloca (nsize), \
+ bcopy (source, destination, osize), \
+ destination)
+
+#endif /* not REGEX_MALLOC */
+
+
+/* True if `size1' is non-NULL and PTR is pointing anywhere inside
+ `string1' or just past its end. This works if PTR is NULL, which is
+ a good thing. */
+#define FIRST_STRING_P(ptr) \
+ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
+
+/* (Re)Allocate N items of type T using malloc, or fail. */
+#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
+#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
+#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
+
+#define BYTEWIDTH 8 /* In bits. */
+
+#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
+
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+
+typedef char boolean;
+#define false 0
+#define true 1
+
+/* These are the command codes that appear in compiled regular
+ expressions. Some opcodes are followed by argument bytes. A
+ command code can specify any interpretation whatsoever for its
+ arguments. Zero bytes may appear in the compiled regular expression.
+
+ The value of `exactn' is needed in search.c (search_buffer) in Emacs.
+ So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of
+ `exactn' we use here must also be 1. */
+
+typedef enum
+{
+ no_op = 0,
+
+ /* Followed by one byte giving n, then by n literal bytes. */
+ exactn = 1,
+
+ /* Matches any (more or less) character. */
+ anychar,
+
+ /* Matches any one char belonging to specified set. First
+ following byte is number of bitmap bytes. Then come bytes
+ for a bitmap saying which chars are in. Bits in each byte
+ are ordered low-bit-first. A character is in the set if its
+ bit is 1. A character too large to have a bit in the map is
+ automatically not in the set. */
+ charset,
+
+ /* Same parameters as charset, but match any character that is
+ not one of those specified. */
+ charset_not,
+
+ /* Start remembering the text that is matched, for storing in a
+ register. Followed by one byte with the register number, in
+ the range 0 to one less than the pattern buffer's re_nsub
+ field. Then followed by one byte with the number of groups
+ inner to this one. (This last has to be part of the
+ start_memory only because we need it in the on_failure_jump
+ of re_match_2.) */
+ start_memory,
+
+ /* Stop remembering the text that is matched and store it in a
+ memory register. Followed by one byte with the register
+ number, in the range 0 to one less than `re_nsub' in the
+ pattern buffer, and one byte with the number of inner groups,
+ just like `start_memory'. (We need the number of inner
+ groups here because we don't have any easy way of finding the
+ corresponding start_memory when we're at a stop_memory.) */
+ stop_memory,
+
+ /* Match a duplicate of something remembered. Followed by one
+ byte containing the register number. */
+ duplicate,
+
+ /* Fail unless at beginning of line. */
+ begline,
+
+ /* Fail unless at end of line. */
+ endline,
+
+ /* Succeeds if at beginning of buffer (if emacs) or at beginning
+ of string to be matched (if not). */
+ begbuf,
+
+ /* Analogously, for end of buffer/string. */
+ endbuf,
+
+ /* Followed by two byte relative address to which to jump. */
+ jump,
+
+ /* Same as jump, but marks the end of an alternative. */
+ jump_past_alt,
+
+ /* Followed by two-byte relative address of place to resume at
+ in case of failure. */
+ on_failure_jump,
+
+ /* Like on_failure_jump, but pushes a placeholder instead of the
+ current string position when executed. */
+ on_failure_keep_string_jump,
+
+ /* Throw away latest failure point and then jump to following
+ two-byte relative address. */
+ pop_failure_jump,
+
+ /* Change to pop_failure_jump if know won't have to backtrack to
+ match; otherwise change to jump. This is used to jump
+ back to the beginning of a repeat. If what follows this jump
+ clearly won't match what the repeat does, such that we can be
+ sure that there is no use backtracking out of repetitions
+ already matched, then we change it to a pop_failure_jump.
+ Followed by two-byte address. */
+ maybe_pop_jump,
+
+ /* Jump to following two-byte address, and push a dummy failure
+ point. This failure point will be thrown away if an attempt
+ is made to use it for a failure. A `+' construct makes this
+ before the first repeat. Also used as an intermediary kind
+ of jump when compiling an alternative. */
+ dummy_failure_jump,
+
+ /* Push a dummy failure point and continue. Used at the end of
+ alternatives. */
+ push_dummy_failure,
+
+ /* Followed by two-byte relative address and two-byte number n.
+ After matching N times, jump to the address upon failure. */
+ succeed_n,
+
+ /* Followed by two-byte relative address, and two-byte number n.
+ Jump to the address N times, then fail. */
+ jump_n,
+
+ /* Set the following two-byte relative address to the
+ subsequent two-byte number. The address *includes* the two
+ bytes of number. */
+ set_number_at,
+
+ wordchar, /* Matches any word-constituent character. */
+ notwordchar, /* Matches any char that is not a word-constituent. */
+
+ wordbeg, /* Succeeds if at word beginning. */
+ wordend, /* Succeeds if at word end. */
+
+ wordbound, /* Succeeds if at a word boundary. */
+ notwordbound /* Succeeds if not at a word boundary. */
+
+#ifdef emacs
+ ,before_dot, /* Succeeds if before point. */
+ at_dot, /* Succeeds if at point. */
+ after_dot, /* Succeeds if after point. */
+
+ /* Matches any character whose syntax is specified. Followed by
+ a byte which contains a syntax code, e.g., Sword. */
+ syntaxspec,
+
+ /* Matches any character whose syntax is not that specified. */
+ notsyntaxspec
+#endif /* emacs */
+} re_opcode_t;
+
+/* Common operations on the compiled pattern. */
+
+/* Store NUMBER in two contiguous bytes starting at DESTINATION. */
+
+#define STORE_NUMBER(destination, number) \
+ do { \
+ (destination)[0] = (number) & 0377; \
+ (destination)[1] = (number) >> 8; \
+ } while (0)
+
+/* Same as STORE_NUMBER, except increment DESTINATION to
+ the byte after where the number is stored. Therefore, DESTINATION
+ must be an lvalue. */
+
+#define STORE_NUMBER_AND_INCR(destination, number) \
+ do { \
+ STORE_NUMBER (destination, number); \
+ (destination) += 2; \
+ } while (0)
+
+/* Put into DESTINATION a number stored in two contiguous bytes starting
+ at SOURCE. */
+
+#define EXTRACT_NUMBER(destination, source) \
+ do { \
+ (destination) = *(source) & 0377; \
+ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \
+ } while (0)
+
+#ifdef DEBUG
+static void
+extract_number (dest, source)
+ int *dest;
+ unsigned char *source;
+{
+ int temp = SIGN_EXTEND_CHAR (*(source + 1));
+ *dest = *source & 0377;
+ *dest += temp << 8;
+}
+
+#ifndef EXTRACT_MACROS /* To debug the macros. */
+#undef EXTRACT_NUMBER
+#define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
+#endif /* not EXTRACT_MACROS */
+
+#endif /* DEBUG */
+
+/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
+ SOURCE must be an lvalue. */
+
+#define EXTRACT_NUMBER_AND_INCR(destination, source) \
+ do { \
+ EXTRACT_NUMBER (destination, source); \
+ (source) += 2; \
+ } while (0)
+
+#ifdef DEBUG
+static void
+extract_number_and_incr (destination, source)
+ int *destination;
+ unsigned char **source;
+{
+ extract_number (destination, *source);
+ *source += 2;
+}
+
+#ifndef EXTRACT_MACROS
+#undef EXTRACT_NUMBER_AND_INCR
+#define EXTRACT_NUMBER_AND_INCR(dest, src) \
+ extract_number_and_incr (&dest, &src)
+#endif /* not EXTRACT_MACROS */
+
+#endif /* DEBUG */
+
+/* If DEBUG is defined, Regex prints many voluminous messages about what
+ it is doing (if the variable `debug' is nonzero). If linked with the
+ main program in `iregex.c', you can enter patterns and strings
+ interactively. And if linked with the main program in `main.c' and
+ the other test files, you can run the already-written tests. */
+
+#ifdef DEBUG
+
+/* We use standard I/O for debugging. */
+#include <stdio.h>
+
+/* It is useful to test things that ``must'' be true when debugging. */
+#include <assert.h>
+
+static int debug = 0;
+
+#define DEBUG_STATEMENT(e) e
+#define DEBUG_PRINT1(x) if (debug) printf (x)
+#define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
+#define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
+#define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
+#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
+ if (debug) print_partial_compiled_pattern (s, e)
+#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
+ if (debug) print_double_string (w, s1, sz1, s2, sz2)
+
+
+extern void printchar ();
+
+/* Print the fastmap in human-readable form. */
+
+void
+print_fastmap (fastmap)
+ char *fastmap;
+{
+ unsigned was_a_range = 0;
+ unsigned i = 0;
+
+ while (i < (1 << BYTEWIDTH))
+ {
+ if (fastmap[i++])
+ {
+ was_a_range = 0;
+ printchar (i - 1);
+ while (i < (1 << BYTEWIDTH) && fastmap[i])
+ {
+ was_a_range = 1;
+ i++;
+ }
+ if (was_a_range)
+ {
+ printf ("-");
+ printchar (i - 1);
+ }
+ }
+ }
+ putchar ('\n');
+}
+
+
+/* Print a compiled pattern string in human-readable form, starting at
+ the START pointer into it and ending just before the pointer END. */
+
+void
+print_partial_compiled_pattern (start, end)
+ unsigned char *start;
+ unsigned char *end;
+{
+ int mcnt, mcnt2;
+ unsigned char *p = start;
+ unsigned char *pend = end;
+
+ if (start == NULL)
+ {
+ printf ("(null)\n");
+ return;
+ }
+
+ /* Loop over pattern commands. */
+ while (p < pend)
+ {
+ switch ((re_opcode_t) *p++)
+ {
+ case no_op:
+ printf ("/no_op");
+ break;
+
+ case exactn:
+ mcnt = *p++;
+ printf ("/exactn/%d", mcnt);
+ do
+ {
+ putchar ('/');
+ printchar (*p++);
+ }
+ while (--mcnt);
+ break;
+
+ case start_memory:
+ mcnt = *p++;
+ printf ("/start_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case stop_memory:
+ mcnt = *p++;
+ printf ("/stop_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case duplicate:
+ printf ("/duplicate/%d", *p++);
+ break;
+
+ case anychar:
+ printf ("/anychar");
+ break;
+
+ case charset:
+ case charset_not:
+ {
+ register int c;
+
+ printf ("/charset%s",
+ (re_opcode_t) *(p - 1) == charset_not ? "_not" : "");
+
+ assert (p + *p < pend);
+
+ for (c = 0; c < *p; c++)
+ {
+ unsigned bit;
+ unsigned char map_byte = p[1 + c];
+
+ putchar ('/');
+
+ for (bit = 0; bit < BYTEWIDTH; bit++)
+ if (map_byte & (1 << bit))
+ printchar (c * BYTEWIDTH + bit);
+ }
+ p += 1 + *p;
+ break;
+ }
+
+ case begline:
+ printf ("/begline");
+ break;
+
+ case endline:
+ printf ("/endline");
+ break;
+
+ case on_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/on_failure_jump/0/%d", mcnt);
+ break;
+
+ case on_failure_keep_string_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/on_failure_keep_string_jump/0/%d", mcnt);
+ break;
+
+ case dummy_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/dummy_failure_jump/0/%d", mcnt);
+ break;
+
+ case push_dummy_failure:
+ printf ("/push_dummy_failure");
+ break;
+
+ case maybe_pop_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/maybe_pop_jump/0/%d", mcnt);
+ break;
+
+ case pop_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/pop_failure_jump/0/%d", mcnt);
+ break;
+
+ case jump_past_alt:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/jump_past_alt/0/%d", mcnt);
+ break;
+
+ case jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/jump/0/%d", mcnt);
+ break;
+
+ case succeed_n:
+ extract_number_and_incr (&mcnt, &p);
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
+ break;
+
+ case jump_n:
+ extract_number_and_incr (&mcnt, &p);
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2);
+ break;
+
+ case set_number_at:
+ extract_number_and_incr (&mcnt, &p);
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
+ break;
+
+ case wordbound:
+ printf ("/wordbound");
+ break;
+
+ case notwordbound:
+ printf ("/notwordbound");
+ break;
+
+ case wordbeg:
+ printf ("/wordbeg");
+ break;
+
+ case wordend:
+ printf ("/wordend");
+
+#ifdef emacs
+ case before_dot:
+ printf ("/before_dot");
+ break;
+
+ case at_dot:
+ printf ("/at_dot");
+ break;
+
+ case after_dot:
+ printf ("/after_dot");
+ break;
+
+ case syntaxspec:
+ printf ("/syntaxspec");
+ mcnt = *p++;
+ printf ("/%d", mcnt);
+ break;
+
+ case notsyntaxspec:
+ printf ("/notsyntaxspec");
+ mcnt = *p++;
+ printf ("/%d", mcnt);
+ break;
+#endif /* emacs */
+
+ case wordchar:
+ printf ("/wordchar");
+ break;
+
+ case notwordchar:
+ printf ("/notwordchar");
+ break;
+
+ case begbuf:
+ printf ("/begbuf");
+ break;
+
+ case endbuf:
+ printf ("/endbuf");
+ break;
+
+ default:
+ printf ("?%d", *(p-1));
+ }
+ }
+ printf ("/\n");
+}
+
+
+void
+print_compiled_pattern (bufp)
+ struct re_pattern_buffer *bufp;
+{
+ unsigned char *buffer = bufp->buffer;
+
+ print_partial_compiled_pattern (buffer, buffer + bufp->used);
+ printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
+
+ if (bufp->fastmap_accurate && bufp->fastmap)
+ {
+ printf ("fastmap: ");
+ print_fastmap (bufp->fastmap);
+ }
+
+ printf ("re_nsub: %d\t", bufp->re_nsub);
+ printf ("regs_alloc: %d\t", bufp->regs_allocated);
+ printf ("can_be_null: %d\t", bufp->can_be_null);
+ printf ("newline_anchor: %d\n", bufp->newline_anchor);
+ printf ("no_sub: %d\t", bufp->no_sub);
+ printf ("not_bol: %d\t", bufp->not_bol);
+ printf ("not_eol: %d\t", bufp->not_eol);
+ printf ("syntax: %d\n", bufp->syntax);
+ /* Perhaps we should print the translate table? */
+}
+
+
+void
+print_double_string (where, string1, size1, string2, size2)
+ const char *where;
+ const char *string1;
+ const char *string2;
+ int size1;
+ int size2;
+{
+ unsigned this_char;
+
+ if (where == NULL)
+ printf ("(null)");
+ else
+ {
+ if (FIRST_STRING_P (where))
+ {
+ for (this_char = where - string1; this_char < size1; this_char++)
+ printchar (string1[this_char]);
+
+ where = string2;
+ }
+
+ for (this_char = where - string2; this_char < size2; this_char++)
+ printchar (string2[this_char]);
+ }
+}
+
+#else /* not DEBUG */
+
+#undef assert
+#define assert(e)
+
+#define DEBUG_STATEMENT(e)
+#define DEBUG_PRINT1(x)
+#define DEBUG_PRINT2(x1, x2)
+#define DEBUG_PRINT3(x1, x2, x3)
+#define DEBUG_PRINT4(x1, x2, x3, x4)
+#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
+#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
+
+#endif /* not DEBUG */
+
+/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
+ also be assigned to arbitrarily: each pattern buffer stores its own
+ syntax, so it can be changed between regex compilations. */
+reg_syntax_t re_syntax_options = RE_SYNTAX_EMACS;
+
+
+/* Specify the precise syntax of regexps for compilation. This provides
+ for compatibility for various utilities which historically have
+ different, incompatible syntaxes.
+
+ The argument SYNTAX is a bit mask comprised of the various bits
+ defined in regex.h. We return the old syntax. */
+
+reg_syntax_t
+re_set_syntax ( reg_syntax_t syntax )
+{
+ reg_syntax_t ret = re_syntax_options;
+
+ re_syntax_options = syntax;
+ return ret;
+}
+
+/* This table gives an error message for each of the error codes listed
+ in regex.h. Obviously the order here has to be same as there. */
+
+static const char *re_error_msg[] =
+ { NULL, /* REG_NOERROR */
+ "No match", /* REG_NOMATCH */
+ "Invalid regular expression", /* REG_BADPAT */
+ "Invalid collation character", /* REG_ECOLLATE */
+ "Invalid character class name", /* REG_ECTYPE */
+ "Trailing backslash", /* REG_EESCAPE */
+ "Invalid back reference", /* REG_ESUBREG */
+ "Unmatched [ or [^", /* REG_EBRACK */
+ "Unmatched ( or \\(", /* REG_EPAREN */
+ "Unmatched \\{", /* REG_EBRACE */
+ "Invalid content of \\{\\}", /* REG_BADBR */
+ "Invalid range end", /* REG_ERANGE */
+ "Memory exhausted", /* REG_ESPACE */
+ "Invalid preceding regular expression", /* REG_BADRPT */
+ "Premature end of regular expression", /* REG_EEND */
+ "Regular expression too big", /* REG_ESIZE */
+ "Unmatched ) or \\)", /* REG_ERPAREN */
+ };
+
+/* Subroutine declarations and macros for regex_compile. */
+
+//static void store_op1 ();
+static void
+store_op1 ( re_opcode_t op, unsigned char *loc, int arg );
+
+//static void store_op2 ();
+static void
+store_op2 ( re_opcode_t op, unsigned char *loc, int arg1, int arg2 );
+
+//static void insert_op1 ();
+static void
+insert_op1 ( re_opcode_t op, unsigned char *loc, int arg,
+ unsigned char *end );
+
+//static void insert_op2 ();
+static void
+insert_op2 ( re_opcode_t op, unsigned char *loc, int arg1, int arg2,
+ unsigned char *end );
+
+//static boolean at_begline_loc_p ();
+static boolean
+at_begline_loc_p ( const char *pattern, const char *p,
+ reg_syntax_t syntax );
+
+//static boolean at_endline_loc_p ();
+static boolean
+at_endline_loc_p (const char *p, const char *pend, int syntax );
+
+//static reg_errcode_t compile_range ();
+static reg_errcode_t
+compile_range ( const char **p_ptr, const char *pend,
+ char *translate, reg_syntax_t syntax, unsigned char *b );
+
+
+/* Fetch the next character in the uncompiled pattern---translating it
+ if necessary. Also cast from a signed character in the constant
+ string passed to us by the user to an unsigned char that we can use
+ as an array index (in, e.g., `translate'). */
+#define PATFETCH(c) \
+ do {if (p == pend) return REG_EEND; \
+ c = (unsigned char) *p++; \
+ if (translate) c = translate[c]; \
+ } while (0)
+
+/* Fetch the next character in the uncompiled pattern, with no
+ translation. */
+#define PATFETCH_RAW(c) \
+ do {if (p == pend) return REG_EEND; \
+ c = (unsigned char) *p++; \
+ } while (0)
+
+/* Go backwards one character in the pattern. */
+#define PATUNFETCH p--
+
+
+/* If `translate' is non-null, return translate[D], else just D. We
+ cast the subscript to translate because some data is declared as
+ `char *', to avoid warnings when a string constant is passed. But
+ when we use a character as a subscript we must make it unsigned. */
+#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d))
+
+
+/* Macros for outputting the compiled pattern into `buffer'. */
+
+/* If the buffer isn't allocated when it comes in, use this. */
+#define INIT_BUF_SIZE 32
+
+/* Make sure we have at least N more bytes of space in buffer. */
+#define GET_BUFFER_SPACE(n) \
+ while (b - bufp->buffer + (n) > bufp->allocated) \
+ EXTEND_BUFFER ()
+
+/* Make sure we have one more byte of buffer space and then add C to it. */
+#define BUF_PUSH(c) \
+ do { \
+ GET_BUFFER_SPACE (1); \
+ *b++ = (unsigned char) (c); \
+ } while (0)
+
+
+/* Ensure we have two more bytes of buffer space and then append C1 and C2. */
+#define BUF_PUSH_2(c1, c2) \
+ do { \
+ GET_BUFFER_SPACE (2); \
+ *b++ = (unsigned char) (c1); \
+ *b++ = (unsigned char) (c2); \
+ } while (0)
+
+
+/* As with BUF_PUSH_2, except for three bytes. */
+#define BUF_PUSH_3(c1, c2, c3) \
+ do { \
+ GET_BUFFER_SPACE (3); \
+ *b++ = (unsigned char) (c1); \
+ *b++ = (unsigned char) (c2); \
+ *b++ = (unsigned char) (c3); \
+ } while (0)
+
+
+/* Store a jump with opcode OP at LOC to location TO. We store a
+ relative address offset by the three bytes the jump itself occupies. */
+#define STORE_JUMP(op, loc, to) \
+ store_op1 (op, loc, (to) - (loc) - 3)
+
+/* Likewise, for a two-argument jump. */
+#define STORE_JUMP2(op, loc, to, arg) \
+ store_op2 (op, loc, (to) - (loc) - 3, arg)
+
+/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */
+#define INSERT_JUMP(op, loc, to) \
+ insert_op1 (op, loc, (to) - (loc) - 3, b)
+
+/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */
+#define INSERT_JUMP2(op, loc, to, arg) \
+ insert_op2 (op, loc, (to) - (loc) - 3, arg, b)
+
+
+/* This is not an arbitrary limit: the arguments which represent offsets
+ into the pattern are two bytes long. So if 2^16 bytes turns out to
+ be too small, many things would have to change. */
+#define MAX_BUF_SIZE (1L << 16)
+
+
+/* Extend the buffer by twice its current size via realloc and
+ reset the pointers that pointed into the old block to point to the
+ correct places in the new one. If extending the buffer results in it
+ being larger than MAX_BUF_SIZE, then flag memory exhausted. */
+#define EXTEND_BUFFER() \
+ do { \
+ unsigned char *old_buffer = bufp->buffer; \
+ if (bufp->allocated == MAX_BUF_SIZE) \
+ return REG_ESIZE; \
+ bufp->allocated <<= 1; \
+ if (bufp->allocated > MAX_BUF_SIZE) \
+ bufp->allocated = MAX_BUF_SIZE; \
+ bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\
+ if (bufp->buffer == NULL) \
+ return REG_ESPACE; \
+ /* If the buffer moved, move all the pointers into it. */ \
+ if (old_buffer != bufp->buffer) \
+ { \
+ b = (b - old_buffer) + bufp->buffer; \
+ begalt = (begalt - old_buffer) + bufp->buffer; \
+ if (fixup_alt_jump) \
+ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
+ if (laststart) \
+ laststart = (laststart - old_buffer) + bufp->buffer; \
+ if (pending_exact) \
+ pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
+ } \
+ } while (0)
+
+
+/* Since we have one byte reserved for the register number argument to
+ {start,stop}_memory, the maximum number of groups we can report
+ things about is what fits in that byte. */
+#define MAX_REGNUM 255
+
+/* But patterns can have more than `MAX_REGNUM' registers. We just
+ ignore the excess. */
+typedef unsigned regnum_t;
+
+
+/* Macros for the compile stack. */
+
+/* Since offsets can go either forwards or backwards, this type needs to
+ be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */
+typedef int pattern_offset_t;
+
+typedef struct
+{
+ pattern_offset_t begalt_offset;
+ pattern_offset_t fixup_alt_jump;
+ pattern_offset_t inner_group_offset;
+ pattern_offset_t laststart_offset;
+ regnum_t regnum;
+} compile_stack_elt_t;
+
+
+typedef struct
+{
+ compile_stack_elt_t *stack;
+ unsigned size;
+ unsigned avail; /* Offset of next open position. */
+} compile_stack_type;
+
+//static boolean group_in_compile_stack ();
+static boolean
+group_in_compile_stack ( compile_stack_type compile_stack, regnum_t regnum );
+
+#define INIT_COMPILE_STACK_SIZE 32
+
+#define COMPILE_STACK_EMPTY (compile_stack.avail == 0)
+#define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size)
+
+/* The next available element. */
+#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
+
+
+/* Set the bit for character C in a list. */
+#define SET_LIST_BIT(c) \
+ (b[((unsigned char) (c)) / BYTEWIDTH] \
+ |= 1 << (((unsigned char) c) % BYTEWIDTH))
+
+
+/* Get the next unsigned number in the uncompiled pattern. */
+#define GET_UNSIGNED_NUMBER(num) \
+ { if (p != pend) \
+ { \
+ PATFETCH (c); \
+ while (ISDIGIT (c)) \
+ { \
+ if (num < 0) \
+ num = 0; \
+ num = num * 10 + c - '0'; \
+ if (p == pend) \
+ break; \
+ PATFETCH (c); \
+ } \
+ } \
+ }
+
+#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
+
+#define IS_CHAR_CLASS(string) \
+ (STREQ (string, "alpha") || STREQ (string, "upper") \
+ || STREQ (string, "lower") || STREQ (string, "digit") \
+ || STREQ (string, "alnum") || STREQ (string, "xdigit") \
+ || STREQ (string, "space") || STREQ (string, "print") \
+ || STREQ (string, "punct") || STREQ (string, "graph") \
+ || STREQ (string, "cntrl") || STREQ (string, "blank"))
+
+/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
+ Returns one of error codes defined in `regex.h', or zero for success.
+
+ Assumes the `allocated' (and perhaps `buffer') and `translate'
+ fields are set in BUFP on entry.
+
+ If it succeeds, results are put in BUFP (if it returns an error, the
+ contents of BUFP are undefined):
+ `buffer' is the compiled pattern;
+ `syntax' is set to SYNTAX;
+ `used' is set to the length of the compiled pattern;
+ `fastmap_accurate' is zero;
+ `re_nsub' is the number of subexpressions in PATTERN;
+ `not_bol' and `not_eol' are zero;
+
+ The `fastmap' and `newline_anchor' fields are neither
+ examined nor set. */
+
+static reg_errcode_t
+regex_compile ( const char *pattern,
+ int size,
+ reg_syntax_t syntax,
+ struct re_pattern_buffer *bufp )
+{
+ /* We fetch characters from PATTERN here. Even though PATTERN is
+ `char *' (i.e., signed), we declare these variables as unsigned, so
+ they can be reliably used as array indices. */
+ register unsigned char c, c1;
+
+ /* A random tempory spot in PATTERN. */
+ const char *p1;
+
+ /* Points to the end of the buffer, where we should append. */
+ register unsigned char *b;
+
+ /* Keeps track of unclosed groups. */
+ compile_stack_type compile_stack;
+
+ /* Points to the current (ending) position in the pattern. */
+ const char *p = pattern;
+ const char *pend = pattern + size;
+
+ /* How to translate the characters in the pattern. */
+ char *translate = bufp->translate;
+
+ /* Address of the count-byte of the most recently inserted `exactn'
+ command. This makes it possible to tell if a new exact-match
+ character can be added to that command or if the character requires
+ a new `exactn' command. */
+ unsigned char *pending_exact = 0;
+
+ /* Address of start of the most recently finished expression.
+ This tells, e.g., postfix * where to find the start of its
+ operand. Reset at the beginning of groups and alternatives. */
+ unsigned char *laststart = 0;
+
+ /* Address of beginning of regexp, or inside of last group. */
+ unsigned char *begalt;
+
+ /* Place in the uncompiled pattern (i.e., the {) to
+ which to go back if the interval is invalid. */
+ const char *beg_interval;
+
+ /* Address of the place where a forward jump should go to the end of
+ the containing expression. Each alternative of an `or' -- except the
+ last -- ends with a forward jump of this sort. */
+ unsigned char *fixup_alt_jump = 0;
+
+ /* Counts open-groups as they are encountered. Remembered for the
+ matching close-group on the compile stack, so the same register
+ number is put in the stop_memory as the start_memory. */
+ regnum_t regnum = 0;
+
+#ifdef DEBUG
+ DEBUG_PRINT1 ("\nCompiling pattern: ");
+ if (debug)
+ {
+ unsigned debug_count;
+
+ for (debug_count = 0; debug_count < size; debug_count++)
+ printchar (pattern[debug_count]);
+ putchar ('\n');
+ }
+#endif /* DEBUG */
+
+ /* Initialize the compile stack. */
+ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
+ if (compile_stack.stack == NULL)
+ return REG_ESPACE;
+
+ compile_stack.size = INIT_COMPILE_STACK_SIZE;
+ compile_stack.avail = 0;
+
+ /* Initialize the pattern buffer. */
+ bufp->syntax = syntax;
+ bufp->fastmap_accurate = 0;
+ bufp->not_bol = bufp->not_eol = 0;
+
+ /* Set `used' to zero, so that if we return an error, the pattern
+ printer (for debugging) will think there's no pattern. We reset it
+ at the end. */
+ bufp->used = 0;
+
+ /* Always count groups, whether or not bufp->no_sub is set. */
+ bufp->re_nsub = 0;
+
+#if !defined (emacs) && !defined (SYNTAX_TABLE)
+ /* Initialize the syntax table. */
+ init_syntax_once ();
+#endif
+
+ if (bufp->allocated == 0)
+ {
+ if (bufp->buffer)
+ { /* If zero allocated, but buffer is non-null, try to realloc
+ enough space. This loses if buffer's address is bogus, but
+ that is the user's responsibility. */
+ RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
+ }
+ else
+ { /* Caller did not allocate a buffer. Do it for them. */
+ bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
+ }
+ if (!bufp->buffer) return REG_ESPACE;
+
+ bufp->allocated = INIT_BUF_SIZE;
+ }
+
+ begalt = b = bufp->buffer;
+
+ /* Loop through the uncompiled pattern until we're at the end. */
+ while (p != pend)
+ {
+ PATFETCH (c);
+
+ switch (c)
+ {
+ case '^':
+ {
+ if ( /* If at start of pattern, it's an operator. */
+ p == pattern + 1
+ /* If context independent, it's an operator. */
+ || syntax & RE_CONTEXT_INDEP_ANCHORS
+ /* Otherwise, depends on what's come before. */
+ || at_begline_loc_p (pattern, p, syntax))
+ BUF_PUSH (begline);
+ else
+ goto normal_char;
+ }
+ break;
+
+
+ case '$':
+ {
+ if ( /* If at end of pattern, it's an operator. */
+ p == pend
+ /* If context independent, it's an operator. */
+ || syntax & RE_CONTEXT_INDEP_ANCHORS
+ /* Otherwise, depends on what's next. */
+ || at_endline_loc_p (p, pend, syntax))
+ BUF_PUSH (endline);
+ else
+ goto normal_char;
+ }
+ break;
+
+
+ case '+':
+ case '?':
+ if ((syntax & RE_BK_PLUS_QM)
+ || (syntax & RE_LIMITED_OPS))
+ goto normal_char;
+ handle_plus:
+ case '*':
+ /* If there is no previous pattern... */
+ if (!laststart)
+ {
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ return REG_BADRPT;
+ else if (!(syntax & RE_CONTEXT_INDEP_OPS))
+ goto normal_char;
+ }
+
+ {
+ /* Are we optimizing this jump? */
+ boolean keep_string_p = false;
+
+ /* 1 means zero (many) matches is allowed. */
+ char zero_times_ok = 0, many_times_ok = 0;
+
+ /* If there is a sequence of repetition chars, collapse it
+ down to just one (the right one). We can't combine
+ interval operators with these because of, e.g., `a{2}*',
+ which should only match an even number of `a's. */
+
+ for (;;)
+ {
+ zero_times_ok |= c != '+';
+ many_times_ok |= c != '?';
+
+ if (p == pend)
+ break;
+
+ PATFETCH (c);
+
+ if (c == '*'
+ || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
+ ;
+
+ else if (syntax & RE_BK_PLUS_QM && c == '\\')
+ {
+ if (p == pend) return REG_EESCAPE;
+
+ PATFETCH (c1);
+ if (!(c1 == '+' || c1 == '?'))
+ {
+ PATUNFETCH;
+ PATUNFETCH;
+ break;
+ }
+
+ c = c1;
+ }
+ else
+ {
+ PATUNFETCH;
+ break;
+ }
+
+ /* If we get here, we found another repeat character. */
+ }
+
+ /* Star, etc. applied to an empty pattern is equivalent
+ to an empty pattern. */
+ if (!laststart)
+ break;
+
+ /* Now we know whether or not zero matches is allowed
+ and also whether or not two or more matches is allowed. */
+ if (many_times_ok)
+ { /* More than one repetition is allowed, so put in at the
+ end a backward relative jump from `b' to before the next
+ jump we're going to put in below (which jumps from
+ laststart to after this jump).
+
+ But if we are at the `*' in the exact sequence `.*\n',
+ insert an unconditional jump backwards to the .,
+ instead of the beginning of the loop. This way we only
+ push a failure point once, instead of every time
+ through the loop. */
+ assert (p - 1 > pattern);
+
+ /* Allocate the space for the jump. */
+ GET_BUFFER_SPACE (3);
+
+ /* We know we are not at the first character of the pattern,
+ because laststart was nonzero. And we've already
+ incremented `p', by the way, to be the character after
+ the `*'. Do we have to do something analogous here
+ for null bytes, because of RE_DOT_NOT_NULL? */
+ if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
+ && zero_times_ok
+ && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
+ && !(syntax & RE_DOT_NEWLINE))
+ { /* We have .*\n. */
+ STORE_JUMP (jump, b, laststart);
+ keep_string_p = true;
+ }
+ else
+ /* Anything else. */
+ STORE_JUMP (maybe_pop_jump, b, laststart - 3);
+
+ /* We've added more stuff to the buffer. */
+ b += 3;
+ }
+
+ /* On failure, jump from laststart to b + 3, which will be the
+ end of the buffer after this jump is inserted. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump
+ : on_failure_jump,
+ laststart, b + 3);
+ pending_exact = 0;
+ b += 3;
+
+ if (!zero_times_ok)
+ {
+ /* At least one repetition is required, so insert a
+ `dummy_failure_jump' before the initial
+ `on_failure_jump' instruction of the loop. This
+ effects a skip over that instruction the first time
+ we hit that loop. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6);
+ b += 3;
+ }
+ }
+ break;
+
+
+ case '.':
+ laststart = b;
+ BUF_PUSH (anychar);
+ break;
+
+
+ case '[':
+ {
+ boolean had_char_class = false;
+
+ if (p == pend) return REG_EBRACK;
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ /* We test `*p == '^' twice, instead of using an if
+ statement, so we only need one BUF_PUSH. */
+ BUF_PUSH (*p == '^' ? charset_not : charset);
+ if (*p == '^')
+ p++;
+
+ /* Remember the first position in the bracket expression. */
+ p1 = p;
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* charset_not matches newline according to a syntax bit. */
+ if ((re_opcode_t) b[-2] == charset_not
+ && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
+ SET_LIST_BIT ('\n');
+
+ /* Read in characters and ranges, setting map bits. */
+ for (;;)
+ {
+ if (p == pend) return REG_EBRACK;
+
+ PATFETCH (c);
+
+ /* \ might escape characters inside [...] and [^...]. */
+ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
+ {
+ if (p == pend) return REG_EESCAPE;
+
+ PATFETCH (c1);
+ SET_LIST_BIT (c1);
+ continue;
+ }
+
+ /* Could be the end of the bracket expression. If it's
+ not (i.e., when the bracket expression is `[]' so
+ far), the ']' character bit gets set way below. */
+ if (c == ']' && p != p1 + 1)
+ break;
+
+ /* Look ahead to see if it's a range when the last thing
+ was a character class. */
+ if (had_char_class && c == '-' && *p != ']')
+ return REG_ERANGE;
+
+ /* Look ahead to see if it's a range when the last thing
+ was a character: if this is a hyphen not at the
+ beginning or the end of a list, then it's the range
+ operator. */
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')
+ && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
+ && *p != ']')
+ {
+ reg_errcode_t ret
+ = compile_range (&p, pend, translate, syntax, b);
+ if (ret != REG_NOERROR) return ret;
+ }
+
+ else if (p[0] == '-' && p[1] != ']')
+ { /* This handles ranges made up of characters only. */
+ reg_errcode_t ret;
+
+ /* Move past the `-'. */
+ PATFETCH (c1);
+
+ ret = compile_range (&p, pend, translate, syntax, b);
+ if (ret != REG_NOERROR) return ret;
+ }
+
+ /* See if we're at the beginning of a possible character
+ class. */
+
+ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
+ { /* Leave room for the null. */
+ char str[CHAR_CLASS_MAX_LENGTH + 1];
+
+ PATFETCH (c);
+ c1 = 0;
+
+ /* If pattern is `[[:'. */
+ if (p == pend) return REG_EBRACK;
+
+ for (;;)
+ {
+ PATFETCH (c);
+ if (c == ':' || c == ']' || p == pend
+ || c1 == CHAR_CLASS_MAX_LENGTH)
+ break;
+ str[c1++] = c;
+ }
+ str[c1] = '\0';
+
+ /* If isn't a word bracketed by `[:' and:`]':
+ undo the ending character, the letters, and leave
+ the leading `:' and `[' (but set bits for them). */
+ if (c == ':' && *p == ']')
+ {
+ int ch;
+ boolean is_alnum = STREQ (str, "alnum");
+ boolean is_alpha = STREQ (str, "alpha");
+ boolean is_blank = STREQ (str, "blank");
+ boolean is_cntrl = STREQ (str, "cntrl");
+ boolean is_digit = STREQ (str, "digit");
+ boolean is_graph = STREQ (str, "graph");
+ boolean is_lower = STREQ (str, "lower");
+ boolean is_print = STREQ (str, "print");
+ boolean is_punct = STREQ (str, "punct");
+ boolean is_space = STREQ (str, "space");
+ boolean is_upper = STREQ (str, "upper");
+ boolean is_xdigit = STREQ (str, "xdigit");
+
+ if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
+
+ /* Throw away the ] at the end of the character
+ class. */
+ PATFETCH (c);
+
+ if (p == pend) return REG_EBRACK;
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ {
+ if ( (is_alnum && ISALNUM (ch))
+ || (is_alpha && ISALPHA (ch))
+ || (is_blank && ISBLANK (ch))
+ || (is_cntrl && ISCNTRL (ch))
+ || (is_digit && ISDIGIT (ch))
+ || (is_graph && ISGRAPH (ch))
+ || (is_lower && ISLOWER (ch))
+ || (is_print && ISPRINT (ch))
+ || (is_punct && ISPUNCT (ch))
+ || (is_space && ISSPACE (ch))
+ || (is_upper && ISUPPER (ch))
+ || (is_xdigit && ISXDIGIT (ch)))
+ SET_LIST_BIT (ch);
+ }
+ had_char_class = true;
+ }
+ else
+ {
+ c1++;
+ while (c1--)
+ PATUNFETCH;
+ SET_LIST_BIT ('[');
+ SET_LIST_BIT (':');
+ had_char_class = false;
+ }
+ }
+ else
+ {
+ had_char_class = false;
+ SET_LIST_BIT (c);
+ }
+ }
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ goto handle_open;
+ else
+ goto normal_char;
+
+
+ case ')':
+ if (syntax & RE_NO_BK_PARENS)
+ goto handle_close;
+ else
+ goto normal_char;
+
+
+ case '\n':
+ if (syntax & RE_NEWLINE_ALT)
+ goto handle_alt;
+ else
+ goto normal_char;
+
+
+ case '|':
+ if (syntax & RE_NO_BK_VBAR)
+ goto handle_alt;
+ else
+ goto normal_char;
+
+
+ case '{':
+ if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
+ goto handle_interval;
+ else
+ goto normal_char;
+
+
+ case '\\':
+ if (p == pend) return REG_EESCAPE;
+
+ /* Do not translate the character after the \, so that we can
+ distinguish, e.g., \B from \b, even if we normally would
+ translate, e.g., B to b. */
+ PATFETCH_RAW (c);
+
+ switch (c)
+ {
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ goto normal_backslash;
+
+ handle_open:
+ bufp->re_nsub++;
+ regnum++;
+
+ if (COMPILE_STACK_FULL)
+ {
+ RETALLOC (compile_stack.stack, compile_stack.size << 1,
+ compile_stack_elt_t);
+ if (compile_stack.stack == NULL) return REG_ESPACE;
+
+ compile_stack.size <<= 1;
+ }
+
+ /* These are the values to restore when we hit end of this
+ group. They are all relative offsets, so that if the
+ whole pattern moves because of realloc, they will still
+ be valid. */
+ COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
+ COMPILE_STACK_TOP.fixup_alt_jump
+ = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
+ COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
+ COMPILE_STACK_TOP.regnum = regnum;
+
+ /* We will eventually replace the 0 with the number of
+ groups inner to this one. But do not push a
+ start_memory for groups beyond the last one we can
+ represent in the compiled pattern. */
+ if (regnum <= MAX_REGNUM)
+ {
+ COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
+ BUF_PUSH_3 (start_memory, regnum, 0);
+ }
+
+ compile_stack.avail++;
+
+ fixup_alt_jump = 0;
+ laststart = 0;
+ begalt = b;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
+ break;
+
+
+ case ')':
+ if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
+
+ if (COMPILE_STACK_EMPTY)
+ {
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_backslash;
+ else
+ return REG_ERPAREN;
+ }
+
+ handle_close:
+ if (fixup_alt_jump)
+ { /* Push a dummy failure point at the end of the
+ alternative for a possible future
+ `pop_failure_jump' to pop. See comments at
+ `push_dummy_failure' in `re_match_2'. */
+ BUF_PUSH (push_dummy_failure);
+
+ /* We allocated space for this jump when we assigned
+ to `fixup_alt_jump', in the `handle_alt' case below. */
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
+ }
+
+ /* See similar code for backslashed left paren above. */
+ if (COMPILE_STACK_EMPTY)
+ {
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_char;
+ else
+ return REG_ERPAREN;
+ }
+
+ /* Since we just checked for an empty stack above, this
+ ``can't happen''. */
+ assert (compile_stack.avail != 0);
+ {
+ /* We don't just want to restore into `regnum', because
+ later groups should continue to be numbered higher,
+ as in `(ab)c(de)' -- the second group is #2. */
+ regnum_t this_group_regnum;
+
+ compile_stack.avail--;
+ begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
+ fixup_alt_jump
+ = COMPILE_STACK_TOP.fixup_alt_jump
+ ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+ : 0;
+ laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
+ this_group_regnum = COMPILE_STACK_TOP.regnum;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
+
+ /* We're at the end of the group, so now we know how many
+ groups were inside this one. */
+ if (this_group_regnum <= MAX_REGNUM)
+ {
+ unsigned char *inner_group_loc
+ = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
+
+ *inner_group_loc = regnum - this_group_regnum;
+ BUF_PUSH_3 (stop_memory, this_group_regnum,
+ regnum - this_group_regnum);
+ }
+ }
+ break;
+
+
+ case '|': /* `\|'. */
+ if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
+ goto normal_backslash;
+ handle_alt:
+ if (syntax & RE_LIMITED_OPS)
+ goto normal_char;
+
+ /* Insert before the previous alternative a jump which
+ jumps to this alternative if the former fails. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (on_failure_jump, begalt, b + 6);
+ pending_exact = 0;
+ b += 3;
+
+ /* The alternative before this one has a jump after it
+ which gets executed if it gets matched. Adjust that
+ jump so it will jump to this alternative's analogous
+ jump (put in below, which in turn will jump to the next
+ (if any) alternative's such jump, etc.). The last such
+ jump jumps to the correct final destination. A picture:
+ _____ _____
+ | | | |
+ | v | v
+ a | b | c
+
+ If we are at `b', then fixup_alt_jump right now points to a
+ three-byte space after `a'. We'll put in the jump, set
+ fixup_alt_jump to right after `b', and leave behind three
+ bytes which we'll fill in when we get to after `c'. */
+
+ if (fixup_alt_jump)
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
+
+ /* Mark and leave space for a jump after this alternative,
+ to be filled in later either by next alternative or
+ when know we're at the end of a series of alternatives. */
+ fixup_alt_jump = b;
+ GET_BUFFER_SPACE (3);
+ b += 3;
+
+ laststart = 0;
+ begalt = b;
+ break;
+
+
+ case '{':
+ /* If \{ is a literal. */
+ if (!(syntax & RE_INTERVALS)
+ /* If we're at `\{' and it's not the open-interval
+ operator. */
+ || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ || (p - 2 == pattern && p == pend))
+ goto normal_backslash;
+
+ handle_interval:
+ {
+ /* If got here, then the syntax allows intervals. */
+
+ /* At least (most) this many matches must be made. */
+ int lower_bound = -1, upper_bound = -1;
+
+ beg_interval = p - 1;
+
+ if (p == pend)
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ return REG_EBRACE;
+ }
+
+ GET_UNSIGNED_NUMBER (lower_bound);
+
+ if (c == ',')
+ {
+ GET_UNSIGNED_NUMBER (upper_bound);
+ if (upper_bound < 0) upper_bound = RE_DUP_MAX;
+ }
+ else
+ /* Interval such as `{1}' => match exactly once. */
+ upper_bound = lower_bound;
+
+ if (lower_bound < 0 || upper_bound > RE_DUP_MAX
+ || lower_bound > upper_bound)
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ return REG_BADBR;
+ }
+
+ if (!(syntax & RE_NO_BK_BRACES))
+ {
+ if (c != '\\') return REG_EBRACE;
+
+ PATFETCH (c);
+ }
+
+ if (c != '}')
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ return REG_BADBR;
+ }
+
+ /* We just parsed a valid interval. */
+
+ /* If it's invalid to have no preceding re. */
+ if (!laststart)
+ {
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ return REG_BADRPT;
+ else if (syntax & RE_CONTEXT_INDEP_OPS)
+ laststart = b;
+ else
+ goto unfetch_interval;
+ }
+
+ /* If the upper bound is zero, don't want to succeed at
+ all; jump from `laststart' to `b + 3', which will be
+ the end of the buffer after we insert the jump. */
+ if (upper_bound == 0)
+ {
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (jump, laststart, b + 3);
+ b += 3;
+ }
+
+ /* Otherwise, we have a nontrivial interval. When
+ we're all done, the pattern will look like:
+ set_number_at <jump count> <upper bound>
+ set_number_at <succeed_n count> <lower bound>
+ succeed_n <after jump addr> <succed_n count>
+ <body of loop>
+ jump_n <succeed_n addr> <jump count>
+ (The upper bound and `jump_n' are omitted if
+ `upper_bound' is 1, though.) */
+ else
+ { /* If the upper bound is > 1, we need to insert
+ more at the end of the loop. */
+ unsigned nbytes = 10 + (upper_bound > 1) * 10;
+
+ GET_BUFFER_SPACE (nbytes);
+
+ /* Initialize lower bound of the `succeed_n', even
+ though it will be set during matching by its
+ attendant `set_number_at' (inserted next),
+ because `re_compile_fastmap' needs to know.
+ Jump to the `jump_n' we might insert below. */
+ INSERT_JUMP2 (succeed_n, laststart,
+ b + 5 + (upper_bound > 1) * 5,
+ lower_bound);
+ b += 5;
+
+ /* Code to initialize the lower bound. Insert
+ before the `succeed_n'. The `5' is the last two
+ bytes of this `set_number_at', plus 3 bytes of
+ the following `succeed_n'. */
+ insert_op2 (set_number_at, laststart, 5, lower_bound, b);
+ b += 5;
+
+ if (upper_bound > 1)
+ { /* More than one repetition is allowed, so
+ append a backward jump to the `succeed_n'
+ that starts this interval.
+
+ When we've reached this during matching,
+ we'll have matched the interval once, so
+ jump back only `upper_bound - 1' times. */
+ STORE_JUMP2 (jump_n, b, laststart + 5,
+ upper_bound - 1);
+ b += 5;
+
+ /* The location we want to set is the second
+ parameter of the `jump_n'; that is `b-2' as
+ an absolute address. `laststart' will be
+ the `set_number_at' we're about to insert;
+ `laststart+3' the number to set, the source
+ for the relative address. But we are
+ inserting into the middle of the pattern --
+ so everything is getting moved up by 5.
+ Conclusion: (b - 2) - (laststart + 3) + 5,
+ i.e., b - laststart.
+
+ We insert this at the beginning of the loop
+ so that if we fail during matching, we'll
+ reinitialize the bounds. */
+ insert_op2 (set_number_at, laststart, b - laststart,
+ upper_bound - 1, b);
+ b += 5;
+ }
+ }
+ pending_exact = 0;
+ beg_interval = NULL;
+ }
+ break;
+
+ unfetch_interval:
+ /* If an invalid interval, match the characters as literals. */
+ assert (beg_interval);
+ p = beg_interval;
+ beg_interval = NULL;
+
+ /* normal_char and normal_backslash need `c'. */
+ PATFETCH (c);
+
+ if (!(syntax & RE_NO_BK_BRACES))
+ {
+ if (p > pattern && p[-1] == '\\')
+ goto normal_backslash;
+ }
+ goto normal_char;
+
+#ifdef emacs
+ /* There is no way to specify the before_dot and after_dot
+ operators. rms says this is ok. --karl */
+ case '=':
+ BUF_PUSH (at_dot);
+ break;
+
+ case 's':
+ laststart = b;
+ PATFETCH (c);
+ BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
+ break;
+
+ case 'S':
+ laststart = b;
+ PATFETCH (c);
+ BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]);
+ break;
+#endif /* emacs */
+
+
+ case 'w':
+ laststart = b;
+ BUF_PUSH (wordchar);
+ break;
+
+
+ case 'W':
+ laststart = b;
+ BUF_PUSH (notwordchar);
+ break;
+
+
+ case '<':
+ BUF_PUSH (wordbeg);
+ break;
+
+ case '>':
+ BUF_PUSH (wordend);
+ break;
+
+ case 'b':
+ BUF_PUSH (wordbound);
+ break;
+
+ case 'B':
+ BUF_PUSH (notwordbound);
+ break;
+
+ case '`':
+ BUF_PUSH (begbuf);
+ break;
+
+ case '\'':
+ BUF_PUSH (endbuf);
+ break;
+
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ if (syntax & RE_NO_BK_REFS)
+ goto normal_char;
+
+ c1 = c - '0';
+
+ if (c1 > regnum)
+ return REG_ESUBREG;
+
+ /* Can't back reference to a subexpression if inside of it. */
+ if (group_in_compile_stack (compile_stack, c1))
+ goto normal_char;
+
+ laststart = b;
+ BUF_PUSH_2 (duplicate, c1);
+ break;
+
+
+ case '+':
+ case '?':
+ if (syntax & RE_BK_PLUS_QM)
+ goto handle_plus;
+ else
+ goto normal_backslash;
+
+ default:
+ normal_backslash:
+ /* You might think it would be useful for \ to mean
+ not to translate; but if we don't translate it
+ it will never match anything. */
+ c = TRANSLATE (c);
+ goto normal_char;
+ }
+ break;
+
+
+ default:
+ /* Expects the character in `c'. */
+ normal_char:
+ /* If no exactn currently being built. */
+ if (!pending_exact
+
+ /* If last exactn not at current position. */
+ || pending_exact + *pending_exact + 1 != b
+
+ /* We have only one byte following the exactn for the count. */
+ || *pending_exact == (1 << BYTEWIDTH) - 1
+
+ /* If followed by a repetition operator. */
+ || *p == '*' || *p == '^'
+ || ((syntax & RE_BK_PLUS_QM)
+ ? *p == '\\' && (p[1] == '+' || p[1] == '?')
+ : (*p == '+' || *p == '?'))
+ || ((syntax & RE_INTERVALS)
+ && ((syntax & RE_NO_BK_BRACES)
+ ? *p == '{'
+ : (p[0] == '\\' && p[1] == '{'))))
+ {
+ /* Start building a new exactn. */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 0);
+ pending_exact = b - 1;
+ }
+
+ BUF_PUSH (c);
+ (*pending_exact)++;
+ break;
+ } /* switch (c) */
+ } /* while p != pend */
+
+
+ /* Through the pattern now. */
+
+ if (fixup_alt_jump)
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
+
+ if (!COMPILE_STACK_EMPTY)
+ return REG_EPAREN;
+
+ free (compile_stack.stack);
+
+ /* We have succeeded; set the length of the buffer. */
+ bufp->used = b - bufp->buffer;
+
+#ifdef DEBUG
+ if (debug)
+ {
+ DEBUG_PRINT1 ("\nCompiled pattern: ");
+ print_compiled_pattern (bufp);
+ }
+#endif /* DEBUG */
+
+ return REG_NOERROR;
+} /* regex_compile */
+
+/* Subroutines for `regex_compile'. */
+
+/* Store OP at LOC followed by two-byte integer parameter ARG. */
+
+static void
+store_op1 ( re_opcode_t op, unsigned char *loc, int arg )
+{
+ *loc = (unsigned char) op;
+ STORE_NUMBER (loc + 1, arg);
+}
+
+
+/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */
+
+static void
+store_op2 ( re_opcode_t op, unsigned char *loc, int arg1, int arg2 )
+{
+ *loc = (unsigned char) op;
+ STORE_NUMBER (loc + 1, arg1);
+ STORE_NUMBER (loc + 3, arg2);
+}
+
+
+/* Copy the bytes from LOC to END to open up three bytes of space at LOC
+ for OP followed by two-byte integer parameter ARG. */
+
+static void
+insert_op1 ( re_opcode_t op, unsigned char *loc, int arg,
+ unsigned char *end )
+{
+ register unsigned char *pfrom = end;
+ register unsigned char *pto = end + 3;
+
+ while (pfrom != loc)
+ *--pto = *--pfrom;
+
+ store_op1 (op, loc, arg);
+}
+
+
+/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */
+
+static void
+insert_op2 ( re_opcode_t op, unsigned char *loc, int arg1, int arg2,
+ unsigned char *end )
+{
+ register unsigned char *pfrom = end;
+ register unsigned char *pto = end + 5;
+
+ while (pfrom != loc)
+ *--pto = *--pfrom;
+
+ store_op2 (op, loc, arg1, arg2);
+}
+
+
+/* P points to just after a ^ in PATTERN. Return true if that ^ comes
+ after an alternative or a begin-subexpression. We assume there is at
+ least one character before the ^. */
+
+static boolean
+at_begline_loc_p ( const char *pattern, const char *p,
+ reg_syntax_t syntax )
+{
+ const char *prev = p - 2;
+ boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
+
+ return
+ /* After a subexpression? */
+ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
+ /* After an alternative? */
+ || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
+}
+
+
+/* The dual of at_begline_loc_p. This one is for $. We assume there is
+ at least one character after the $, i.e., `P < PEND'. */
+
+static boolean
+at_endline_loc_p (const char *p, const char *pend,
+ int syntax )
+{
+ const char *next = p;
+ boolean next_backslash = *next == '\\';
+ const char *next_next = p + 1 < pend ? p + 1 : NULL;
+
+ return
+ /* Before a subexpression? */
+ (syntax & RE_NO_BK_PARENS ? *next == ')'
+ : next_backslash && next_next && *next_next == ')')
+ /* Before an alternative? */
+ || (syntax & RE_NO_BK_VBAR ? *next == '|'
+ : next_backslash && next_next && *next_next == '|');
+}
+
+
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
+ false if it's not. */
+
+static boolean
+group_in_compile_stack ( compile_stack_type compile_stack, regnum_t regnum )
+{
+ int this_element;
+
+ for (this_element = compile_stack.avail - 1;
+ this_element >= 0;
+ this_element--)
+ if (compile_stack.stack[this_element].regnum == regnum)
+ return true;
+
+ return false;
+}
+
+
+/* Read the ending character of a range (in a bracket expression) from the
+ uncompiled pattern *P_PTR (which ends at PEND). We assume the
+ starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
+ Then we set the translation of all bits between the starting and
+ ending characters (inclusive) in the compiled pattern B.
+
+ Return an error code.
+
+ We use these short variable names so we can use the same macros as
+ `regex_compile' itself. */
+
+static reg_errcode_t
+compile_range ( const char **p_ptr, const char *pend,
+ char *translate, reg_syntax_t syntax, unsigned char *b )
+{
+ unsigned this_char;
+
+ const char *p = *p_ptr;
+ int range_start, range_end;
+
+ if (p == pend)
+ return REG_ERANGE;
+
+ /* Even though the pattern is a signed `char *', we need to fetch
+ with unsigned char *'s; if the high bit of the pattern character
+ is set, the range endpoints will be negative if we fetch using a
+ signed char *.
+
+ We also want to fetch the endpoints without translating them; the
+ appropriate translation is done in the bit-setting loop below. */
+ range_start = ((unsigned char *) p)[-2];
+ range_end = ((unsigned char *) p)[0];
+
+ /* Have to increment the pointer into the pattern string, so the
+ caller isn't still at the ending character. */
+ (*p_ptr)++;
+
+ /* If the start is after the end, the range is empty. */
+ if (range_start > range_end)
+ return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
+
+ /* Here we see why `this_char' has to be larger than an `unsigned
+ char' -- the range is inclusive, so if `range_end' == 0xff
+ (assuming 8-bit characters), we would otherwise go into an infinite
+ loop, since all characters <= 0xff. */
+ for (this_char = range_start; this_char <= range_end; this_char++)
+ {
+ SET_LIST_BIT (TRANSLATE (this_char));
+ }
+
+ return REG_NOERROR;
+}
+
+/* Failure stack declarations and macros; both re_compile_fastmap and
+ re_match_2 use a failure stack. These have to be macros because of
+ REGEX_ALLOCATE. */
+
+
+/* Number of failure points for which to initially allocate space
+ when matching. If this number is exceeded, we allocate more
+ space, so it is not a hard limit. */
+#ifndef INIT_FAILURE_ALLOC
+#define INIT_FAILURE_ALLOC 5
+#endif
+
+/* Roughly the maximum number of failure points on the stack. Would be
+ exactly that if always used MAX_FAILURE_SPACE each time we failed.
+ This is a variable only so users of regex can assign to it; we never
+ change it ourselves. */
+int re_max_failures = 2000;
+
+typedef const unsigned char *fail_stack_elt_t;
+
+typedef struct
+{
+ fail_stack_elt_t *stack;
+ unsigned size;
+ unsigned avail; /* Offset of next open position. */
+} fail_stack_type;
+
+#define FAIL_STACK_EMPTY() (fail_stack.avail == 0)
+#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
+#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
+#define FAIL_STACK_TOP() (fail_stack.stack[fail_stack.avail])
+
+
+/* Initialize `fail_stack'. Do `return -2' if the alloc fails. */
+
+#define INIT_FAIL_STACK() \
+ do { \
+ fail_stack.stack = (fail_stack_elt_t *) \
+ REGEX_ALLOCATE (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
+ \
+ if (fail_stack.stack == NULL) \
+ return -2; \
+ \
+ fail_stack.size = INIT_FAILURE_ALLOC; \
+ fail_stack.avail = 0; \
+ } while (0)
+
+
+/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
+
+ Return 1 if succeeds, and 0 if either ran out of memory
+ allocating space for it or it was already too large.
+
+ REGEX_REALLOCATE requires `destination' be declared. */
+
+#define DOUBLE_FAIL_STACK(fail_stack) \
+ ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \
+ ? 0 \
+ : ((fail_stack).stack = (fail_stack_elt_t *) \
+ REGEX_REALLOCATE ((fail_stack).stack, \
+ (fail_stack).size * sizeof (fail_stack_elt_t), \
+ ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
+ \
+ (fail_stack).stack == NULL \
+ ? 0 \
+ : ((fail_stack).size <<= 1, \
+ 1)))
+
+
+/* Push PATTERN_OP on FAIL_STACK.
+
+ Return 1 if was able to do so and 0 if ran out of memory allocating
+ space to do so. */
+#define PUSH_PATTERN_OP(pattern_op, fail_stack) \
+ ((FAIL_STACK_FULL () \
+ && !DOUBLE_FAIL_STACK (fail_stack)) \
+ ? 0 \
+ : ((fail_stack).stack[(fail_stack).avail++] = pattern_op, \
+ 1))
+
+/* This pushes an item onto the failure stack. Must be a four-byte
+ value. Assumes the variable `fail_stack'. Probably should only
+ be called from within `PUSH_FAILURE_POINT'. */
+#define PUSH_FAILURE_ITEM(item) \
+ fail_stack.stack[fail_stack.avail++] = (fail_stack_elt_t) item
+
+/* The complement operation. Assumes `fail_stack' is nonempty. */
+#define POP_FAILURE_ITEM() fail_stack.stack[--fail_stack.avail]
+
+/* Used to omit pushing failure point id's when we're not debugging. */
+#ifdef DEBUG
+#define DEBUG_PUSH PUSH_FAILURE_ITEM
+#define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_ITEM ()
+#else
+#define DEBUG_PUSH(item)
+#define DEBUG_POP(item_addr)
+#endif
+
+
+/* Push the information about the state we will need
+ if we ever fail back to it.
+
+ Requires variables fail_stack, regstart, regend, reg_info, and
+ num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
+ declared.
+
+ Does `return FAILURE_CODE' if runs out of memory. */
+
+#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
+ do { \
+ char *destination; \
+ /* Must be int, so when we don't save any registers, the arithmetic \
+ of 0 + -1 isn't done as unsigned. */ \
+ int this_reg; \
+ \
+ DEBUG_STATEMENT (failure_id++); \
+ DEBUG_STATEMENT (nfailure_points_pushed++); \
+ DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \
+ DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\
+ DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\
+ \
+ DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \
+ DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
+ \
+ /* Ensure we have enough space allocated for what we will push. */ \
+ while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \
+ { \
+ if (!DOUBLE_FAIL_STACK (fail_stack)) \
+ return failure_code; \
+ \
+ DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \
+ (fail_stack).size); \
+ DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\
+ } \
+ \
+ /* Push the info, starting with the registers. */ \
+ DEBUG_PRINT1 ("\n"); \
+ \
+ for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
+ this_reg++) \
+ { \
+ DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \
+ DEBUG_STATEMENT (num_regs_pushed++); \
+ \
+ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
+ PUSH_FAILURE_ITEM (regstart[this_reg]); \
+ \
+ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
+ PUSH_FAILURE_ITEM (regend[this_reg]); \
+ \
+ DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \
+ DEBUG_PRINT2 (" match_null=%d", \
+ REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" matched_something=%d", \
+ MATCHED_SOMETHING (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" ever_matched=%d", \
+ EVER_MATCHED_SOMETHING (reg_info[this_reg])); \
+ DEBUG_PRINT1 ("\n"); \
+ PUSH_FAILURE_ITEM (reg_info[this_reg].word); \
+ } \
+ \
+ DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\
+ PUSH_FAILURE_ITEM (lowest_active_reg); \
+ \
+ DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\
+ PUSH_FAILURE_ITEM (highest_active_reg); \
+ \
+ DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
+ PUSH_FAILURE_ITEM (pattern_place); \
+ \
+ DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \
+ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \
+ size2); \
+ DEBUG_PRINT1 ("'\n"); \
+ PUSH_FAILURE_ITEM (string_place); \
+ \
+ DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \
+ DEBUG_PUSH (failure_id); \
+ } while (0)
+
+/* This is the number of items that are pushed and popped on the stack
+ for each register. */
+#define NUM_REG_ITEMS 3
+
+/* Individual items aside from the registers. */
+#ifdef DEBUG
+#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
+#else
+#define NUM_NONREG_ITEMS 4
+#endif
+
+/* We push at most this many items on the stack. */
+#define MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
+
+/* We actually push this many items. */
+#define NUM_FAILURE_ITEMS \
+ ((highest_active_reg - lowest_active_reg + 1) * NUM_REG_ITEMS \
+ + NUM_NONREG_ITEMS)
+
+/* How many items can still be added to the stack without overflowing it. */
+#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail)
+
+
+/* Pops what PUSH_FAIL_STACK pushes.
+
+ We restore into the parameters, all of which should be lvalues:
+ STR -- the saved data position.
+ PAT -- the saved pattern position.
+ LOW_REG, HIGH_REG -- the highest and lowest active registers.
+ REGSTART, REGEND -- arrays of string positions.
+ REG_INFO -- array of information about each subexpression.
+
+ Also assumes the variables `fail_stack' and (if debugging), `bufp',
+ `pend', `string1', `size1', `string2', and `size2'. */
+
+#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
+{ \
+ DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
+ int this_reg; \
+ const unsigned char *string_temp; \
+ \
+ assert (!FAIL_STACK_EMPTY ()); \
+ \
+ /* Remove failure points and point to how many regs pushed. */ \
+ DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \
+ DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \
+ DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \
+ \
+ assert (fail_stack.avail >= NUM_NONREG_ITEMS); \
+ \
+ DEBUG_POP (&failure_id); \
+ DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \
+ \
+ /* If the saved string location is NULL, it came from an \
+ on_failure_keep_string_jump opcode, and we want to throw away the \
+ saved NULL, thus retaining our current position in the string. */ \
+ string_temp = POP_FAILURE_ITEM (); \
+ if (string_temp != NULL) \
+ str = (const char *) string_temp; \
+ \
+ DEBUG_PRINT2 (" Popping string 0x%x: `", str); \
+ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \
+ DEBUG_PRINT1 ("'\n"); \
+ \
+ pat = (unsigned char *) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" Popping pattern 0x%x: ", pat); \
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
+ \
+ /* Restore register info. */ \
+ high_reg = (unsigned) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
+ \
+ low_reg = (unsigned) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
+ \
+ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
+ { \
+ DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \
+ \
+ reg_info[this_reg].word = POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \
+ \
+ regend[this_reg] = (const char *) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
+ \
+ regstart[this_reg] = (const char *) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
+ } \
+ \
+ DEBUG_STATEMENT (nfailure_points_popped++); \
+} /* POP_FAILURE_POINT */
+
+/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
+ BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible
+ characters can start a string that matches the pattern. This fastmap
+ is used by re_search to skip quickly over impossible starting points.
+
+ The caller must supply the address of a (1 << BYTEWIDTH)-byte data
+ area as BUFP->fastmap.
+
+ We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
+ the pattern buffer.
+
+ Returns 0 if we succeed, -2 if an internal error. */
+
+int
+re_compile_fastmap ( struct re_pattern_buffer *bufp )
+{
+ int j, k;
+ fail_stack_type fail_stack;
+#ifndef REGEX_MALLOC
+ char *destination;
+#endif
+ /* We don't push any register information onto the failure stack. */
+ unsigned num_regs = 0;
+
+ register char *fastmap = bufp->fastmap;
+ unsigned char *pattern = bufp->buffer;
+ unsigned long size = bufp->used;
+ const unsigned char *p = pattern;
+ register unsigned char *pend = pattern + size;
+
+ /* Assume that each path through the pattern can be null until
+ proven otherwise. We set this false at the bottom of switch
+ statement, to which we get only if a particular path doesn't
+ match the empty string. */
+ boolean path_can_be_null = true;
+
+ /* We aren't doing a `succeed_n' to begin with. */
+ boolean succeed_n_p = false;
+
+ assert (fastmap != NULL && p != NULL);
+
+ INIT_FAIL_STACK ();
+ bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
+ bufp->fastmap_accurate = 1; /* It will be when we're done. */
+ bufp->can_be_null = 0;
+
+ while (p != pend || !FAIL_STACK_EMPTY ())
+ {
+ if (p == pend)
+ {
+ bufp->can_be_null |= path_can_be_null;
+
+ /* Reset for next path. */
+ path_can_be_null = true;
+
+ p = fail_stack.stack[--fail_stack.avail];
+ }
+
+ /* We should never be about to go beyond the end of the pattern. */
+ assert (p < pend);
+
+#ifdef SWITCH_ENUM_BUG
+ switch ((int) ((re_opcode_t) *p++))
+#else
+ switch ((re_opcode_t) *p++)
+#endif
+ {
+
+ /* I guess the idea here is to simply not bother with a fastmap
+ if a backreference is used, since it's too hard to figure out
+ the fastmap for the corresponding group. Setting
+ `can_be_null' stops `re_search_2' from using the fastmap, so
+ that is all we do. */
+ case duplicate:
+ bufp->can_be_null = 1;
+ return 0;
+
+
+ /* Following are the cases which match a character. These end
+ with `break'. */
+
+ case exactn:
+ fastmap[p[1]] = 1;
+ break;
+
+
+ case charset:
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
+ fastmap[j] = 1;
+ break;
+
+
+ case charset_not:
+ /* Chars beyond end of map must be allowed. */
+ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
+ fastmap[j] = 1;
+
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
+ fastmap[j] = 1;
+ break;
+
+
+ case wordchar:
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) == Sword)
+ fastmap[j] = 1;
+ break;
+
+
+ case notwordchar:
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) != Sword)
+ fastmap[j] = 1;
+ break;
+
+
+ case anychar:
+ /* `.' matches anything ... */
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ fastmap[j] = 1;
+
+ /* ... except perhaps newline. */
+ if (!(bufp->syntax & RE_DOT_NEWLINE))
+ fastmap['\n'] = 0;
+
+ /* Return if we have already set `can_be_null'; if we have,
+ then the fastmap is irrelevant. Something's wrong here. */
+ else if (bufp->can_be_null)
+ return 0;
+
+ /* Otherwise, have to check alternative paths. */
+ break;
+
+
+#ifdef emacs
+ case syntaxspec:
+ k = *p++;
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) == (enum syntaxcode) k)
+ fastmap[j] = 1;
+ break;
+
+
+ case notsyntaxspec:
+ k = *p++;
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) != (enum syntaxcode) k)
+ fastmap[j] = 1;
+ break;
+
+
+ /* All cases after this match the empty string. These end with
+ `continue'. */
+
+
+ case before_dot:
+ case at_dot:
+ case after_dot:
+ continue;
+#endif /* not emacs */
+
+
+ case no_op:
+ case begline:
+ case endline:
+ case begbuf:
+ case endbuf:
+ case wordbound:
+ case notwordbound:
+ case wordbeg:
+ case wordend:
+ case push_dummy_failure:
+ continue;
+
+
+ case jump_n:
+ case pop_failure_jump:
+ case maybe_pop_jump:
+ case jump:
+ case jump_past_alt:
+ case dummy_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (j, p);
+ p += j;
+ if (j > 0)
+ continue;
+
+ /* Jump backward implies we just went through the body of a
+ loop and matched nothing. Opcode jumped to should be
+ `on_failure_jump' or `succeed_n'. Just treat it like an
+ ordinary jump. For a * loop, it has pushed its failure
+ point already; if so, discard that as redundant. */
+ if ((re_opcode_t) *p != on_failure_jump
+ && (re_opcode_t) *p != succeed_n)
+ continue;
+
+ p++;
+ EXTRACT_NUMBER_AND_INCR (j, p);
+ p += j;
+
+ /* If what's on the stack is where we are now, pop it. */
+ if (!FAIL_STACK_EMPTY ()
+ && fail_stack.stack[fail_stack.avail - 1] == p)
+ fail_stack.avail--;
+
+ continue;
+
+
+ case on_failure_jump:
+ case on_failure_keep_string_jump:
+ handle_on_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (j, p);
+
+ /* For some patterns, e.g., `(a?)?', `p+j' here points to the
+ end of the pattern. We don't want to push such a point,
+ since when we restore it above, entering the switch will
+ increment `p' past the end of the pattern. We don't need
+ to push such a point since we obviously won't find any more
+ fastmap entries beyond `pend'. Such a pattern can match
+ the null string, though. */
+ if (p + j < pend)
+ {
+ if (!PUSH_PATTERN_OP (p + j, fail_stack))
+ return -2;
+ }
+ else
+ bufp->can_be_null = 1;
+
+ if (succeed_n_p)
+ {
+ EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */
+ succeed_n_p = false;
+ }
+
+ continue;
+
+
+ case succeed_n:
+ /* Get to the number of times to succeed. */
+ p += 2;
+
+ /* Increment p past the n for when k != 0. */
+ EXTRACT_NUMBER_AND_INCR (k, p);
+ if (k == 0)
+ {
+ p -= 4;
+ succeed_n_p = true; /* Spaghetti code alert. */
+ goto handle_on_failure_jump;
+ }
+ continue;
+
+
+ case set_number_at:
+ p += 4;
+ continue;
+
+
+ case start_memory:
+ case stop_memory:
+ p += 2;
+ continue;
+
+
+ default:
+ abort (); /* We have listed all the cases. */
+ } /* switch *p++ */
+
+ /* Getting here means we have found the possible starting
+ characters for one path of the pattern -- and that the empty
+ string does not match. We need not follow this path further.
+ Instead, look at the next alternative (remembered on the
+ stack), or quit if no more. The test at the top of the loop
+ does these things. */
+ path_can_be_null = false;
+ p = pend;
+ } /* while p */
+
+ /* Set `can_be_null' for the last path (also the first path, if the
+ pattern is empty). */
+ bufp->can_be_null |= path_can_be_null;
+ return 0;
+} /* re_compile_fastmap */
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
+ this memory for recording register information. STARTS and ENDS
+ must be allocated using the malloc library routine, and must each
+ be at least NUM_REGS * sizeof (regoff_t) bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+
+void
+re_set_registers ( struct re_pattern_buffer *bufp,
+ struct re_registers *regs, unsigned num_regs,
+ regoff_t *starts, regoff_t *ends )
+{
+ if (num_regs)
+ {
+ bufp->regs_allocated = REGS_REALLOCATE;
+ regs->num_regs = num_regs;
+ regs->start = starts;
+ regs->end = ends;
+ }
+ else
+ {
+ bufp->regs_allocated = REGS_UNALLOCATED;
+ regs->num_regs = 0;
+ regs->start = regs->end = (regoff_t *) 0;
+ }
+}
+
+/* Searching routines. */
+
+/* Like re_search_2, below, but only one string is specified, and
+ doesn't let you say where to stop matching. */
+
+int
+re_search ( struct re_pattern_buffer *bufp, const char *string,
+ int size, int startpos, int range, struct re_registers *regs )
+{
+ return re_search_2 (bufp, NULL, string, 0, size, startpos, range,
+ regs, size);
+}
+
+
+/* Using the compiled pattern in BUFP->buffer, first tries to match the
+ virtual concatenation of STRING1 and STRING2, starting first at index
+ STARTPOS, then at STARTPOS + 1, and so on.
+
+ STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
+
+ RANGE is how far to scan while trying to match. RANGE = 0 means try
+ only at STARTPOS; in general, the last start tried is STARTPOS +
+ RANGE.
+
+ In REGS, return the indices of the virtual concatenation of STRING1
+ and STRING2 that matched the entire BUFP->buffer and its contained
+ subexpressions.
+
+ Do not consider matching one past the index STOP in the virtual
+ concatenation of STRING1 and STRING2.
+
+ We return either the position in the strings at which the match was
+ found, -1 if no match, or -2 if error (such as failure
+ stack overflow). */
+
+int
+re_search_2 ( struct re_pattern_buffer *bufp,
+ const char *string1, const char *string2, int size1, int size2,
+ int startpos, int range, struct re_registers *regs, int stop )
+{
+ int val;
+ register char *fastmap = bufp->fastmap;
+ register char *translate = bufp->translate;
+ int total_size = size1 + size2;
+ int endpos = startpos + range;
+
+ /* Check for out-of-range STARTPOS. */
+ if (startpos < 0 || startpos > total_size)
+ return -1;
+
+ /* Fix up RANGE if it might eventually take us outside
+ the virtual concatenation of STRING1 and STRING2. */
+ if (endpos < -1)
+ range = -1 - startpos;
+ else if (endpos > total_size)
+ range = total_size - startpos;
+
+ /* If the search isn't to be a backwards one, don't waste time in a
+ search for a pattern that must be anchored. */
+ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
+ {
+ if (startpos > 0)
+ return -1;
+ else
+ range = 1;
+ }
+
+ /* Update the fastmap now if not correct already. */
+ if (fastmap && !bufp->fastmap_accurate)
+ if (re_compile_fastmap (bufp) == -2)
+ return -2;
+
+ /* Loop through the string, looking for a place to start matching. */
+ for (;;)
+ {
+ /* If a fastmap is supplied, skip quickly over characters that
+ cannot be the start of a match. If the pattern can match the
+ null string, however, we don't need to skip characters; we want
+ the first null string. */
+ if (fastmap && startpos < total_size && !bufp->can_be_null)
+ {
+ if (range > 0) /* Searching forwards. */
+ {
+ register const char *d;
+ register int lim = 0;
+ int irange = range;
+
+ if (startpos < size1 && startpos + range >= size1)
+ lim = range - (size1 - startpos);
+
+ d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
+
+ /* Written out as an if-else to avoid testing `translate'
+ inside the loop. */
+ if (translate)
+ while (range > lim
+ && !fastmap[(unsigned char)
+ translate[(unsigned char) *d++]])
+ range--;
+ else
+ while (range > lim && !fastmap[(unsigned char) *d++])
+ range--;
+
+ startpos += irange - range;
+ }
+ else /* Searching backwards. */
+ {
+ register char c = (size1 == 0 || startpos >= size1
+ ? string2[startpos - size1]
+ : string1[startpos]);
+
+ if (!fastmap[(unsigned char) TRANSLATE (c)])
+ goto advance;
+ }
+ }
+
+ /* If can't match the null string, and that's all we have left, fail. */
+ if (range >= 0 && startpos == total_size && fastmap
+ && !bufp->can_be_null)
+ return -1;
+
+ val = re_match_2 (bufp, string1, string2, size1, size2,
+ startpos, regs, stop);
+ if (val >= 0)
+ return startpos;
+
+ if (val == -2)
+ return -2;
+
+ advance:
+ if (!range)
+ break;
+ else if (range > 0)
+ {
+ range--;
+ startpos++;
+ }
+ else
+ {
+ range++;
+ startpos--;
+ }
+ }
+ return -1;
+} /* re_search_2 */
+
+/* Declarations and macros for re_match_2. */
+
+//static int bcmp_translate ();
+static int
+bcmp_translate ( const char *s1, const char *s2,
+ register int len, char *translate );
+
+//static boolean alt_match_null_string_p (),
+
+// common_op_match_null_string_p ();
+// group_match_null_string_p ();
+
+
+/* Structure for per-register (a.k.a. per-group) information.
+ This must not be longer than one word, because we push this value
+ onto the failure stack. Other register information, such as the
+ starting and ending positions (which are addresses), and the list of
+ inner groups (which is a bits list) are maintained in separate
+ variables.
+
+ We are making a (strictly speaking) nonportable assumption here: that
+ the compiler will pack our bit fields into something that fits into
+ the type of `word', i.e., is something that fits into one item on the
+ failure stack. */
+typedef union
+{
+ fail_stack_elt_t word;
+ struct
+ {
+ /* This field is one if this group can match the empty string,
+ zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */
+#define MATCH_NULL_UNSET_VALUE 3
+ unsigned match_null_string_p : 2;
+ unsigned is_active : 1;
+ unsigned matched_something : 1;
+ unsigned ever_matched_something : 1;
+ } bits;
+} register_info_type;
+
+static boolean
+alt_match_null_string_p ( unsigned char *p, unsigned char *end,
+ register_info_type *reg_info );
+
+static boolean
+group_match_null_string_p ( unsigned char **p, unsigned char *end,
+ register_info_type *reg_info );
+static boolean
+common_op_match_null_string_p ( unsigned char **p, unsigned char *end,
+ register_info_type *reg_info );
+
+
+#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p)
+#define IS_ACTIVE(R) ((R).bits.is_active)
+#define MATCHED_SOMETHING(R) ((R).bits.matched_something)
+#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something)
+
+
+/* Call this when have matched a real character; it sets `matched' flags
+ for the subexpressions which we are currently inside. Also records
+ that those subexprs have matched. */
+#define SET_REGS_MATCHED() \
+ do \
+ { \
+ unsigned r; \
+ for (r = lowest_active_reg; r <= highest_active_reg; r++) \
+ { \
+ MATCHED_SOMETHING (reg_info[r]) \
+ = EVER_MATCHED_SOMETHING (reg_info[r]) \
+ = 1; \
+ } \
+ } \
+ while (0)
+
+
+/* This converts PTR, a pointer into one of the search strings `string1'
+ and `string2' into an offset from the beginning of that string. */
+#define POINTER_TO_OFFSET(ptr) \
+ (FIRST_STRING_P (ptr) ? (ptr) - string1 : (ptr) - string2 + size1)
+
+/* Registers are set to a sentinel when they haven't yet matched. */
+#define REG_UNSET_VALUE ((char *) -1)
+#define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
+
+
+/* Macros for dealing with the split strings in re_match_2. */
+
+#define MATCHING_IN_FIRST_STRING (dend == end_match_1)
+
+/* Call before fetching a character with *d. This switches over to
+ string2 if necessary. */
+#define PREFETCH() \
+ while (d == dend) \
+ { \
+ /* End of string2 => fail. */ \
+ if (dend == end_match_2) \
+ goto fail; \
+ /* End of string1 => advance to string2. */ \
+ d = string2; \
+ dend = end_match_2; \
+ }
+
+
+/* Test if at very beginning or at very end of the virtual concatenation
+ of `string1' and `string2'. If only one string, it's `string2'. */
+#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
+#define AT_STRINGS_END(d) ((d) == end2)
+
+
+/* Test if D points to a character which is word-constituent. We have
+ two special cases to check for: if past the end of string1, look at
+ the first character in string2; and if before the beginning of
+ string2, look at the last character in string1. */
+#define WORDCHAR_P(d) \
+ (SYNTAX ((d) == end1 ? *string2 \
+ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
+ == Sword)
+
+/* Test if the character before D and the one at D differ with respect
+ to being word-constituent. */
+#define AT_WORD_BOUNDARY(d) \
+ (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \
+ || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
+
+
+/* Free everything we malloc. */
+#ifdef REGEX_MALLOC
+#define FREE_VAR(var) if (var) free (var); var = NULL
+#define FREE_VARIABLES() \
+ do { \
+ FREE_VAR (fail_stack.stack); \
+ FREE_VAR (regstart); \
+ FREE_VAR (regend); \
+ FREE_VAR (old_regstart); \
+ FREE_VAR (old_regend); \
+ FREE_VAR (best_regstart); \
+ FREE_VAR (best_regend); \
+ FREE_VAR (reg_info); \
+ FREE_VAR (reg_dummy); \
+ FREE_VAR (reg_info_dummy); \
+ } while (0)
+#else /* not REGEX_MALLOC */
+/* Some MIPS systems (at least) want this to free alloca'd storage. */
+#define FREE_VARIABLES() alloca (0)
+#endif /* not REGEX_MALLOC */
+
+
+/* These values must meet several constraints. They must not be valid
+ register values; since we have a limit of 255 registers (because
+ we use only one byte in the pattern for the register number), we can
+ use numbers larger than 255. They must differ by 1, because of
+ NUM_FAILURE_ITEMS above. And the value for the lowest register must
+ be larger than the value for the highest register, so we do not try
+ to actually save any registers when none are active. */
+#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH)
+#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1)
+
+/* Matching routines. */
+
+#ifndef emacs /* Emacs never uses this. */
+/* re_match is like re_match_2 except it takes only a single string. */
+
+int
+re_match (struct re_pattern_buffer *bufp, const char *string, int size, int
+ pos, struct re_registers *regs)
+{
+ return re_match_2 (bufp, NULL, string, 0, size, pos, regs, size);
+}
+#endif /* not emacs */
+
+
+/* re_match_2 matches the compiled pattern in BUFP against the
+ the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
+ and SIZE2, respectively). We start matching at POS, and stop
+ matching at STOP.
+
+ If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
+ store offsets for the substring each group matched in REGS. See the
+ documentation for exactly how many groups we fill.
+
+ We return -1 if no match, -2 if an internal error (such as the
+ failure stack overflowing). Otherwise, we return the length of the
+ matched substring. */
+
+int
+re_match_2 ( struct re_pattern_buffer *bufp, const char *string1,
+ const char *string2, int size1, int size2, int pos,
+ struct re_registers *regs, int stop )
+{
+ /* General temporaries. */
+ int mcnt;
+ unsigned char *p1;
+
+ /* Just past the end of the corresponding string. */
+ const char *end1, *end2;
+
+ /* Pointers into string1 and string2, just past the last characters in
+ each to consider matching. */
+ const char *end_match_1, *end_match_2;
+
+ /* Where we are in the data, and the end of the current string. */
+ const char *d, *dend;
+
+ /* Where we are in the pattern, and the end of the pattern. */
+ unsigned char *p = bufp->buffer;
+ register unsigned char *pend = p + bufp->used;
+
+ /* We use this to map every character in the string. */
+ char *translate = bufp->translate;
+
+ /* Failure point stack. Each place that can handle a failure further
+ down the line pushes a failure point on this stack. It consists of
+ restart, regend, and reg_info for all registers corresponding to
+ the subexpressions we're currently inside, plus the number of such
+ registers, and, finally, two char *'s. The first char * is where
+ to resume scanning the pattern; the second one is where to resume
+ scanning the strings. If the latter is zero, the failure point is
+ a ``dummy''; if a failure happens and the failure point is a dummy,
+ it gets discarded and the next next one is tried. */
+ fail_stack_type fail_stack;
+#ifdef DEBUG
+ static unsigned failure_id = 0;
+ unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
+#endif
+
+ /* We fill all the registers internally, independent of what we
+ return, for use in backreferences. The number here includes
+ an element for register zero. */
+ unsigned num_regs = bufp->re_nsub + 1;
+
+ /* The currently active registers. */
+ unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+
+ /* Information on the contents of registers. These are pointers into
+ the input strings; they record just what was matched (on this
+ attempt) by a subexpression part of the pattern, that is, the
+ regnum-th regstart pointer points to where in the pattern we began
+ matching and the regnum-th regend points to right after where we
+ stopped matching the regnum-th subexpression. (The zeroth register
+ keeps track of what the whole pattern matches.) */
+ const char **regstart=0, **regend=0;
+
+ /* If a group that's operated upon by a repetition operator fails to
+ match anything, then the register for its start will need to be
+ restored because it will have been set to wherever in the string we
+ are when we last see its open-group operator. Similarly for a
+ register's end. */
+ const char **old_regstart=0, **old_regend=0;
+
+ /* The is_active field of reg_info helps us keep track of which (possibly
+ nested) subexpressions we are currently in. The matched_something
+ field of reg_info[reg_num] helps us tell whether or not we have
+ matched any of the pattern so far this time through the reg_num-th
+ subexpression. These two fields get reset each time through any
+ loop their register is in. */
+ register_info_type *reg_info=0;
+
+ /* The following record the register info as found in the above
+ variables when we find a match better than any we've seen before.
+ This happens as we backtrack through the failure points, which in
+ turn happens only if we have not yet matched the entire string. */
+ unsigned best_regs_set = false;
+ const char **best_regstart=0, **best_regend=0;
+
+ /* Logically, this is `best_regend[0]'. But we don't want to have to
+ allocate space for that if we're not allocating space for anything
+ else (see below). Also, we never need info about register 0 for
+ any of the other register vectors, and it seems rather a kludge to
+ treat `best_regend' differently than the rest. So we keep track of
+ the end of the best match so far in a separate variable. We
+ initialize this to NULL so that when we backtrack the first time
+ and need to test it, it's not garbage. */
+ const char *match_end = NULL;
+
+ /* Used when we pop values we don't care about. */
+ const char **reg_dummy=0;
+ register_info_type *reg_info_dummy=0;
+
+#ifdef DEBUG
+ /* Counts the total number of registers pushed. */
+ unsigned num_regs_pushed = 0;
+#endif
+
+ DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
+
+ INIT_FAIL_STACK ();
+
+ /* Do not bother to initialize all the register variables if there are
+ no groups in the pattern, as it takes a fair amount of time. If
+ there are groups, we include space for register 0 (the whole
+ pattern), even though we never use it, since it simplifies the
+ array indexing. We should fix this. */
+ if (bufp->re_nsub)
+ {
+ regstart = REGEX_TALLOC (num_regs, const char *);
+ regend = REGEX_TALLOC (num_regs, const char *);
+ old_regstart = REGEX_TALLOC (num_regs, const char *);
+ old_regend = REGEX_TALLOC (num_regs, const char *);
+ best_regstart = REGEX_TALLOC (num_regs, const char *);
+ best_regend = REGEX_TALLOC (num_regs, const char *);
+ reg_info = REGEX_TALLOC (num_regs, register_info_type);
+ reg_dummy = REGEX_TALLOC (num_regs, const char *);
+ reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
+
+ if (!(regstart && regend && old_regstart && old_regend && reg_info
+ && best_regstart && best_regend && reg_dummy && reg_info_dummy))
+ {
+ FREE_VARIABLES ();
+ return -2;
+ }
+ }
+#ifdef REGEX_MALLOC
+ else
+ {
+ /* We must initialize all our variables to NULL, so that
+ `FREE_VARIABLES' doesn't try to free them. */
+ regstart = regend = old_regstart = old_regend = best_regstart
+ = best_regend = reg_dummy = NULL;
+ reg_info = reg_info_dummy = (register_info_type *) NULL;
+ }
+#endif /* REGEX_MALLOC */
+
+ /* The starting position is bogus. */
+ if (pos < 0 || pos > size1 + size2)
+ {
+ FREE_VARIABLES ();
+ return -1;
+ }
+
+ /* Initialize subexpression text positions to -1 to mark ones that no
+ start_memory/stop_memory has been seen for. Also initialize the
+ register information struct. */
+ for (mcnt = 1; mcnt < num_regs; mcnt++)
+ {
+ regstart[mcnt] = regend[mcnt]
+ = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
+
+ REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
+ IS_ACTIVE (reg_info[mcnt]) = 0;
+ MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+ EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+ }
+
+ /* We move `string1' into `string2' if the latter's empty -- but not if
+ `string1' is null. */
+ if (size2 == 0 && string1 != NULL)
+ {
+ string2 = string1;
+ size2 = size1;
+ string1 = 0;
+ size1 = 0;
+ }
+ end1 = string1 + size1;
+ end2 = string2 + size2;
+
+ /* Compute where to stop matching, within the two strings. */
+ if (stop <= size1)
+ {
+ end_match_1 = string1 + stop;
+ end_match_2 = string2;
+ }
+ else
+ {
+ end_match_1 = end1;
+ end_match_2 = string2 + stop - size1;
+ }
+
+ /* `p' scans through the pattern as `d' scans through the data.
+ `dend' is the end of the input string that `d' points within. `d'
+ is advanced into the following input string whenever necessary, but
+ this happens before fetching; therefore, at the beginning of the
+ loop, `d' can be pointing at the end of a string, but it cannot
+ equal `string2'. */
+ if (size1 > 0 && pos <= size1)
+ {
+ d = string1 + pos;
+ dend = end_match_1;
+ }
+ else
+ {
+ d = string2 + pos - size1;
+ dend = end_match_2;
+ }
+
+ DEBUG_PRINT1 ("The compiled pattern is: ");
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
+ DEBUG_PRINT1 ("The string to match is: `");
+ DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
+ DEBUG_PRINT1 ("'\n");
+
+ /* This loops over pattern commands. It exits by returning from the
+ function if the match is complete, or it drops through if the match
+ fails at this starting point in the input data. */
+ for (;;)
+ {
+ DEBUG_PRINT2 ("\n0x%x: ", p);
+
+ if (p == pend)
+ { /* End of pattern means we might have succeeded. */
+ DEBUG_PRINT1 ("end of pattern ... ");
+
+ /* If we haven't matched the entire string, and we want the
+ longest match, try backtracking. */
+ if (d != end_match_2)
+ {
+ DEBUG_PRINT1 ("backtracking.\n");
+
+ if (!FAIL_STACK_EMPTY ())
+ { /* More failure points to try. */
+ boolean same_str_p = (FIRST_STRING_P (match_end)
+ == MATCHING_IN_FIRST_STRING);
+
+ /* If exceeds best match so far, save it. */
+ if (!best_regs_set
+ || (same_str_p && d > match_end)
+ || (!same_str_p && !MATCHING_IN_FIRST_STRING))
+ {
+ best_regs_set = true;
+ match_end = d;
+
+ DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
+
+ for (mcnt = 1; mcnt < num_regs; mcnt++)
+ {
+ best_regstart[mcnt] = regstart[mcnt];
+ best_regend[mcnt] = regend[mcnt];
+ }
+ }
+ goto fail;
+ }
+
+ /* If no failure points, don't restore garbage. */
+ else if (best_regs_set)
+ {
+ restore_best_regs:
+ /* Restore best match. It may happen that `dend ==
+ end_match_1' while the restored d is in string2.
+ For example, the pattern `x.*y.*z' against the
+ strings `x-' and `y-z-', if the two strings are
+ not consecutive in memory. */
+ DEBUG_PRINT1 ("Restoring best registers.\n");
+
+ d = match_end;
+ dend = ((d >= string1 && d <= end1)
+ ? end_match_1 : end_match_2);
+
+ for (mcnt = 1; mcnt < num_regs; mcnt++)
+ {
+ regstart[mcnt] = best_regstart[mcnt];
+ regend[mcnt] = best_regend[mcnt];
+ }
+ }
+ } /* d != end_match_2 */
+
+ DEBUG_PRINT1 ("Accepting match.\n");
+
+ /* If caller wants register contents data back, do it. */
+ if (regs && !bufp->no_sub)
+ {
+ /* Have the register data arrays been allocated? */
+ if (bufp->regs_allocated == REGS_UNALLOCATED)
+ { /* No. So allocate them with malloc. We need one
+ extra element beyond `num_regs' for the `-1' marker
+ GNU code uses. */
+ regs->num_regs = MAX (RE_NREGS, num_regs + 1);
+ regs->start = TALLOC (regs->num_regs, regoff_t);
+ regs->end = TALLOC (regs->num_regs, regoff_t);
+ if (regs->start == NULL || regs->end == NULL)
+ return -2;
+ bufp->regs_allocated = REGS_REALLOCATE;
+ }
+ else if (bufp->regs_allocated == REGS_REALLOCATE)
+ { /* Yes. If we need more elements than were already
+ allocated, reallocate them. If we need fewer, just
+ leave it alone. */
+ if (regs->num_regs < num_regs + 1)
+ {
+ regs->num_regs = num_regs + 1;
+ RETALLOC (regs->start, regs->num_regs, regoff_t);
+ RETALLOC (regs->end, regs->num_regs, regoff_t);
+ if (regs->start == NULL || regs->end == NULL)
+ return -2;
+ }
+ }
+ else
+ assert (bufp->regs_allocated == REGS_FIXED);
+
+ /* Convert the pointer data in `regstart' and `regend' to
+ indices. Register zero has to be set differently,
+ since we haven't kept track of any info for it. */
+ if (regs->num_regs > 0)
+ {
+ regs->start[0] = pos;
+ regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
+ : d - string2 + size1);
+ }
+
+ /* Go through the first `min (num_regs, regs->num_regs)'
+ registers, since that is all we initialized. */
+ for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
+ {
+ if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
+ regs->start[mcnt] = regs->end[mcnt] = -1;
+ else
+ {
+ regs->start[mcnt] = POINTER_TO_OFFSET (regstart[mcnt]);
+ regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]);
+ }
+ }
+
+ /* If the regs structure we return has more elements than
+ were in the pattern, set the extra elements to -1. If
+ we (re)allocated the registers, this is the case,
+ because we always allocate enough to have at least one
+ -1 at the end. */
+ for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++)
+ regs->start[mcnt] = regs->end[mcnt] = -1;
+ } /* regs && !bufp->no_sub */
+
+ FREE_VARIABLES ();
+ DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
+ nfailure_points_pushed, nfailure_points_popped,
+ nfailure_points_pushed - nfailure_points_popped);
+ DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
+
+ mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+ ? string1
+ : string2 - size1);
+
+ DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
+
+ return mcnt;
+ }
+
+ /* Otherwise match next pattern command. */
+#ifdef SWITCH_ENUM_BUG
+ switch ((int) ((re_opcode_t) *p++))
+#else
+ switch ((re_opcode_t) *p++)
+#endif
+ {
+ /* Ignore these. Used to ignore the n of succeed_n's which
+ currently have n == 0. */
+ case no_op:
+ DEBUG_PRINT1 ("EXECUTING no_op.\n");
+ break;
+
+
+ /* Match the next n pattern characters exactly. The following
+ byte in the pattern defines n, and the n bytes after that
+ are the characters to match. */
+ case exactn:
+ mcnt = *p++;
+ DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
+
+ /* This is written out as an if-else so we don't waste time
+ testing `translate' inside the loop. */
+ if (translate)
+ {
+ do
+ {
+ PREFETCH ();
+ if (translate[(unsigned char) *d++] != (char) *p++)
+ goto fail;
+ }
+ while (--mcnt);
+ }
+ else
+ {
+ do
+ {
+ PREFETCH ();
+ if (*d++ != (char) *p++) goto fail;
+ }
+ while (--mcnt);
+ }
+ SET_REGS_MATCHED ();
+ break;
+
+
+ /* Match any character except possibly a newline or a null. */
+ case anychar:
+ DEBUG_PRINT1 ("EXECUTING anychar.\n");
+
+ PREFETCH ();
+
+ if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
+ || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
+ goto fail;
+
+ SET_REGS_MATCHED ();
+ DEBUG_PRINT2 (" Matched `%d'.\n", *d);
+ d++;
+ break;
+
+
+ case charset:
+ case charset_not:
+ {
+ register unsigned char c;
+ boolean not = (re_opcode_t) *(p - 1) == charset_not;
+
+ DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : "");
+
+ PREFETCH ();
+ c = TRANSLATE (*d); /* The character to match. */
+
+ /* Cast to `unsigned' instead of `unsigned char' in case the
+ bit list is a full 32 bytes long. */
+ if (c < (unsigned) (*p * BYTEWIDTH)
+ && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+ not = !not;
+
+ p += 1 + *p;
+
+ if (!not) goto fail;
+
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+ }
+
+
+ /* The beginning of a group is represented by start_memory.
+ The arguments are the register number in the next byte, and the
+ number of groups inner to this one in the next. The text
+ matched within the group is recorded (in the internal
+ registers data structure) under the register number. */
+ case start_memory:
+ DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]);
+
+ /* Find out if this group can match the empty string. */
+ p1 = p; /* To send to group_match_null_string_p. */
+
+ if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
+ REG_MATCH_NULL_STRING_P (reg_info[*p])
+ = group_match_null_string_p (&p1, pend, reg_info);
+
+ /* Save the position in the string where we were the last time
+ we were at this open-group operator in case the group is
+ operated upon by a repetition operator, e.g., with `(a*)*b'
+ against `ab'; then we want to ignore where we are now in
+ the string in case this attempt to match fails. */
+ old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
+ ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
+ : regstart[*p];
+ DEBUG_PRINT2 (" old_regstart: %d\n",
+ POINTER_TO_OFFSET (old_regstart[*p]));
+
+ regstart[*p] = d;
+ DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p]));
+
+ IS_ACTIVE (reg_info[*p]) = 1;
+ MATCHED_SOMETHING (reg_info[*p]) = 0;
+
+ /* This is the new highest active register. */
+ highest_active_reg = *p;
+
+ /* If nothing was active before, this is the new lowest active
+ register. */
+ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+ lowest_active_reg = *p;
+
+ /* Move past the register number and inner group count. */
+ p += 2;
+ break;
+
+
+ /* The stop_memory opcode represents the end of a group. Its
+ arguments are the same as start_memory's: the register
+ number, and the number of inner groups. */
+ case stop_memory:
+ DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
+
+ /* We need to save the string position the last time we were at
+ this close-group operator in case the group is operated
+ upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
+ against `aba'; then we want to ignore where we are now in
+ the string in case this attempt to match fails. */
+ old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
+ ? REG_UNSET (regend[*p]) ? d : regend[*p]
+ : regend[*p];
+ DEBUG_PRINT2 (" old_regend: %d\n",
+ POINTER_TO_OFFSET (old_regend[*p]));
+
+ regend[*p] = d;
+ DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p]));
+
+ /* This register isn't active anymore. */
+ IS_ACTIVE (reg_info[*p]) = 0;
+
+ /* If this was the only register active, nothing is active
+ anymore. */
+ if (lowest_active_reg == highest_active_reg)
+ {
+ lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+ }
+ else
+ { /* We must scan for the new highest active register, since
+ it isn't necessarily one less than now: consider
+ (a(b)c(d(e)f)g). When group 3 ends, after the f), the
+ new highest active register is 1. */
+ unsigned char r = *p - 1;
+ while (r > 0 && !IS_ACTIVE (reg_info[r]))
+ r--;
+
+ /* If we end up at register zero, that means that we saved
+ the registers as the result of an `on_failure_jump', not
+ a `start_memory', and we jumped to past the innermost
+ `stop_memory'. For example, in ((.)*) we save
+ registers 1 and 2 as a result of the *, but when we pop
+ back to the second ), we are at the stop_memory 1.
+ Thus, nothing is active. */
+ if (r == 0)
+ {
+ lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+ }
+ else
+ highest_active_reg = r;
+ }
+
+ /* If just failed to match something this time around with a
+ group that's operated on by a repetition operator, try to
+ force exit from the ``loop'', and restore the register
+ information for this group that we had before trying this
+ last match. */
+ if ((!MATCHED_SOMETHING (reg_info[*p])
+ || (re_opcode_t) p[-3] == start_memory)
+ && (p + 2) < pend)
+ {
+ boolean is_a_jump_n = false;
+
+ p1 = p + 2;
+ mcnt = 0;
+ switch ((re_opcode_t) *p1++)
+ {
+ case jump_n:
+ is_a_jump_n = true;
+ case pop_failure_jump:
+ case maybe_pop_jump:
+ case jump:
+ case dummy_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if (is_a_jump_n)
+ p1 += 2;
+ break;
+
+ default:
+ /* do nothing */ ;
+ }
+ p1 += mcnt;
+
+ /* If the next operation is a jump backwards in the pattern
+ to an on_failure_jump right before the start_memory
+ corresponding to this stop_memory, exit from the loop
+ by forcing a failure after pushing on the stack the
+ on_failure_jump's jump in the pattern, and d. */
+ if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
+ && (re_opcode_t) p1[3] == start_memory && p1[4] == *p)
+ {
+ /* If this group ever matched anything, then restore
+ what its registers were before trying this last
+ failed match, e.g., with `(a*)*b' against `ab' for
+ regstart[1], and, e.g., with `((a*)*(b*)*)*'
+ against `aba' for regend[3].
+
+ Also restore the registers for inner groups for,
+ e.g., `((a*)(b*))*' against `aba' (register 3 would
+ otherwise get trashed). */
+
+ if (EVER_MATCHED_SOMETHING (reg_info[*p]))
+ {
+ unsigned r;
+
+ EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
+
+ /* Restore this and inner groups' (if any) registers. */
+ for (r = *p; r < *p + *(p + 1); r++)
+ {
+ regstart[r] = old_regstart[r];
+
+ /* xx why this test? */
+ if ((int) old_regend[r] >= (int) regstart[r])
+ regend[r] = old_regend[r];
+ }
+ }
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
+
+ goto fail;
+ }
+ }
+
+ /* Move past the register number and the inner group count. */
+ p += 2;
+ break;
+
+
+ /* \<digit> has been turned into a `duplicate' command which is
+ followed by the numeric value of <digit> as the register number. */
+ case duplicate:
+ {
+ register const char *d2, *dend2;
+ int regno = *p++; /* Get which register to match against. */
+ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
+
+ /* Can't back reference a group which we've never matched. */
+ if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
+ goto fail;
+
+ /* Where in input to try to start matching. */
+ d2 = regstart[regno];
+
+ /* Where to stop matching; if both the place to start and
+ the place to stop matching are in the same string, then
+ set to the place to stop, otherwise, for now have to use
+ the end of the first string. */
+
+ dend2 = ((FIRST_STRING_P (regstart[regno])
+ == FIRST_STRING_P (regend[regno]))
+ ? regend[regno] : end_match_1);
+ for (;;)
+ {
+ /* If necessary, advance to next segment in register
+ contents. */
+ while (d2 == dend2)
+ {
+ if (dend2 == end_match_2) break;
+ if (dend2 == regend[regno]) break;
+
+ /* End of string1 => advance to string2. */
+ d2 = string2;
+ dend2 = regend[regno];
+ }
+ /* At end of register contents => success */
+ if (d2 == dend2) break;
+
+ /* If necessary, advance to next segment in data. */
+ PREFETCH ();
+
+ /* How many characters left in this segment to match. */
+ mcnt = dend - d;
+
+ /* Want how many consecutive characters we can match in
+ one shot, so, if necessary, adjust the count. */
+ if (mcnt > dend2 - d2)
+ mcnt = dend2 - d2;
+
+ /* Compare that many; failure if mismatch, else move
+ past them. */
+ if (translate
+ ? bcmp_translate (d, d2, mcnt, translate)
+ : bcmp (d, d2, mcnt))
+ goto fail;
+ d += mcnt, d2 += mcnt;
+ }
+ }
+ break;
+
+
+ /* begline matches the empty string at the beginning of the string
+ (unless `not_bol' is set in `bufp'), and, if
+ `newline_anchor' is set, after newlines. */
+ case begline:
+ DEBUG_PRINT1 ("EXECUTING begline.\n");
+
+ if (AT_STRINGS_BEG (d))
+ {
+ if (!bufp->not_bol) break;
+ }
+ else if (d[-1] == '\n' && bufp->newline_anchor)
+ {
+ break;
+ }
+ /* In all other cases, we fail. */
+ goto fail;
+
+
+ /* endline is the dual of begline. */
+ case endline:
+ DEBUG_PRINT1 ("EXECUTING endline.\n");
+
+ if (AT_STRINGS_END (d))
+ {
+ if (!bufp->not_eol) break;
+ }
+
+ /* We have to ``prefetch'' the next character. */
+ else if ((d == end1 ? *string2 : *d) == '\n'
+ && bufp->newline_anchor)
+ {
+ break;
+ }
+ goto fail;
+
+
+ /* Match at the very beginning of the data. */
+ case begbuf:
+ DEBUG_PRINT1 ("EXECUTING begbuf.\n");
+ if (AT_STRINGS_BEG (d))
+ break;
+ goto fail;
+
+
+ /* Match at the very end of the data. */
+ case endbuf:
+ DEBUG_PRINT1 ("EXECUTING endbuf.\n");
+ if (AT_STRINGS_END (d))
+ break;
+ goto fail;
+
+
+ /* on_failure_keep_string_jump is used to optimize `.*\n'. It
+ pushes NULL as the value for the string on the stack. Then
+ `pop_failure_point' will keep the current value for the
+ string, instead of restoring it. To see why, consider
+ matching `foo\nbar' against `.*\n'. The .* matches the foo;
+ then the . fails against the \n. But the next thing we want
+ to do is match the \n against the \n; if we restored the
+ string value, we would be back at the foo.
+
+ Because this is used only in specific cases, we don't need to
+ check all the things that `on_failure_jump' does, to make
+ sure the right things get saved on the stack. Hence we don't
+ share its code. The only reason to push anything on the
+ stack at all is that otherwise we would have to change
+ `anychar's code to do something besides goto fail in this
+ case; that seems worse than this. */
+ case on_failure_keep_string_jump:
+ DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
+
+ PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
+ break;
+
+
+ /* Uses of on_failure_jump:
+
+ Each alternative starts with an on_failure_jump that points
+ to the beginning of the next alternative. Each alternative
+ except the last ends with a jump that in effect jumps past
+ the rest of the alternatives. (They really jump to the
+ ending jump of the following alternative, because tensioning
+ these jumps is a hassle.)
+
+ Repeats start with an on_failure_jump that points past both
+ the repetition text and either the following jump or
+ pop_failure_jump back to this on_failure_jump. */
+ case on_failure_jump:
+ on_failure:
+ DEBUG_PRINT1 ("EXECUTING on_failure_jump");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt);
+
+ /* If this on_failure_jump comes right before a group (i.e.,
+ the original * applied to a group), save the information
+ for that group and all inner ones, so that if we fail back
+ to this point, the group's information will be correct.
+ For example, in \(a*\)*\1, we need the preceding group,
+ and in \(\(a*\)b*\)\2, we need the inner group. */
+
+ /* We can't use `p' to check ahead because we push
+ a failure point to `p + mcnt' after we do this. */
+ p1 = p;
+
+ /* We need to skip no_op's before we look for the
+ start_memory in case this on_failure_jump is happening as
+ the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
+ against aba. */
+ while (p1 < pend && (re_opcode_t) *p1 == no_op)
+ p1++;
+
+ if (p1 < pend && (re_opcode_t) *p1 == start_memory)
+ {
+ /* We have a new highest active register now. This will
+ get reset at the start_memory we are about to get to,
+ but we will have saved all the registers relevant to
+ this repetition op, as described above. */
+ highest_active_reg = *(p1 + 1) + *(p1 + 2);
+ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+ lowest_active_reg = *(p1 + 1);
+ }
+
+ DEBUG_PRINT1 (":\n");
+ PUSH_FAILURE_POINT (p + mcnt, d, -2);
+ break;
+
+
+ /* A smart repeat ends with `maybe_pop_jump'.
+ We change it to either `pop_failure_jump' or `jump'. */
+ case maybe_pop_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt);
+ {
+ register unsigned char *p2 = p;
+
+ /* Compare the beginning of the repeat with what in the
+ pattern follows its end. If we can establish that there
+ is nothing that they would both match, i.e., that we
+ would have to backtrack because of (as in, e.g., `a*a')
+ then we can change to pop_failure_jump, because we'll
+ never have to backtrack.
+
+ This is not true in the case of alternatives: in
+ `(a|ab)*' we do need to backtrack to the `ab' alternative
+ (e.g., if the string was `ab'). But instead of trying to
+ detect that here, the alternative has put on a dummy
+ failure point which is what we will end up popping. */
+
+ /* Skip over open/close-group commands. */
+ while (p2 + 2 < pend
+ && ((re_opcode_t) *p2 == stop_memory
+ || (re_opcode_t) *p2 == start_memory))
+ p2 += 3; /* Skip over args, too. */
+
+ /* If we're at the end of the pattern, we can change. */
+ if (p2 == pend)
+ {
+ /* Consider what happens when matching ":\(.*\)"
+ against ":/". I don't really understand this code
+ yet. */
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1
+ (" End of pattern: change to `pop_failure_jump'.\n");
+ }
+
+ else if ((re_opcode_t) *p2 == exactn
+ || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
+ {
+ register unsigned char c
+ = *p2 == (unsigned char) endline ? '\n' : p2[2];
+ p1 = p + mcnt;
+
+ /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
+ to the `maybe_finalize_jump' of this case. Examine what
+ follows. */
+ if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
+ c, p1[5]);
+ }
+
+ else if ((re_opcode_t) p1[3] == charset
+ || (re_opcode_t) p1[3] == charset_not)
+ {
+ int not = (re_opcode_t) p1[3] == charset_not;
+
+ if (c < (unsigned char) (p1[4] * BYTEWIDTH)
+ && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+ not = !not;
+
+ /* `not' is equal to 1 if c would match, which means
+ that we can't change to pop_failure_jump. */
+ if (!not)
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
+ }
+ }
+ }
+ }
+ p -= 2; /* Point at relative address again. */
+ if ((re_opcode_t) p[-1] != pop_failure_jump)
+ {
+ p[-1] = (unsigned char) jump;
+ DEBUG_PRINT1 (" Match => jump.\n");
+ goto unconditional_jump;
+ }
+ /* Note fall through. */
+
+
+ /* The end of a simple repeat has a pop_failure_jump back to
+ its matching on_failure_jump, where the latter will push a
+ failure point. The pop_failure_jump takes off failure
+ points put on by this pop_failure_jump's matching
+ on_failure_jump; we got through the pattern to here from the
+ matching on_failure_jump, so didn't fail. */
+ case pop_failure_jump:
+ {
+ /* We need to pass separate storage for the lowest and
+ highest registers, even though we don't care about the
+ actual values. Otherwise, we will restore only one
+ register from the stack, since lowest will == highest in
+ `pop_failure_point'. */
+ unsigned dummy_low_reg, dummy_high_reg;
+ unsigned char *pdummy;
+ const char *sdummy;
+
+ DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
+ POP_FAILURE_POINT (sdummy, pdummy,
+ dummy_low_reg, dummy_high_reg,
+ reg_dummy, reg_dummy, reg_info_dummy);
+ }
+ /* Note fall through. */
+
+
+ /* Unconditionally jump (without popping any failure points). */
+ case jump:
+ unconditional_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */
+ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
+ p += mcnt; /* Do the jump. */
+ DEBUG_PRINT2 ("(to 0x%x).\n", p);
+ break;
+
+
+ /* We need this opcode so we can detect where alternatives end
+ in `group_match_null_string_p' et al. */
+ case jump_past_alt:
+ DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n");
+ goto unconditional_jump;
+
+
+ /* Normally, the on_failure_jump pushes a failure point, which
+ then gets popped at pop_failure_jump. We will end up at
+ pop_failure_jump, also, and with a pattern of, say, `a+', we
+ are skipping over the on_failure_jump, so we have to push
+ something meaningless for pop_failure_jump to pop. */
+ case dummy_failure_jump:
+ DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
+ /* It doesn't matter what we push for the string here. What
+ the code at `fail' tests is the value for the pattern. */
+ PUSH_FAILURE_POINT (0, 0, -2);
+ goto unconditional_jump;
+
+
+ /* At the end of an alternative, we need to push a dummy failure
+ point in case we are followed by a `pop_failure_jump', because
+ we don't want the failure point for the alternative to be
+ popped. For example, matching `(a|ab)*' against `aab'
+ requires that we match the `ab' alternative. */
+ case push_dummy_failure:
+ DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
+ /* See comments just above at `dummy_failure_jump' about the
+ two zeroes. */
+ PUSH_FAILURE_POINT (0, 0, -2);
+ break;
+
+ /* Have to succeed matching what follows at least n times.
+ After that, handle like `on_failure_jump'. */
+ case succeed_n:
+ EXTRACT_NUMBER (mcnt, p + 2);
+ DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
+
+ assert (mcnt >= 0);
+ /* Originally, this is how many times we HAVE to succeed. */
+ if (mcnt > 0)
+ {
+ mcnt--;
+ p += 2;
+ STORE_NUMBER_AND_INCR (p, mcnt);
+ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p, mcnt);
+ }
+ else if (mcnt == 0)
+ {
+ DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2);
+ p[2] = (unsigned char) no_op;
+ p[3] = (unsigned char) no_op;
+ goto on_failure;
+ }
+ break;
+
+ case jump_n:
+ EXTRACT_NUMBER (mcnt, p + 2);
+ DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
+
+ /* Originally, this is how many times we CAN jump. */
+ if (mcnt)
+ {
+ mcnt--;
+ STORE_NUMBER (p + 2, mcnt);
+ goto unconditional_jump;
+ }
+ /* If don't have to jump any more, skip over the rest of command. */
+ else
+ p += 4;
+ break;
+
+ case set_number_at:
+ {
+ DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ p1 = p + mcnt;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt);
+ STORE_NUMBER (p1, mcnt);
+ break;
+ }
+
+ case wordbound:
+ DEBUG_PRINT1 ("EXECUTING wordbound.\n");
+ if (AT_WORD_BOUNDARY (d))
+ break;
+ goto fail;
+
+ case notwordbound:
+ DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
+ if (AT_WORD_BOUNDARY (d))
+ goto fail;
+ break;
+
+ case wordbeg:
+ DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
+ if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
+ break;
+ goto fail;
+
+ case wordend:
+ DEBUG_PRINT1 ("EXECUTING wordend.\n");
+ if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1)
+ && (!WORDCHAR_P (d) || AT_STRINGS_END (d)))
+ break;
+ goto fail;
+
+#ifdef emacs
+#ifdef emacs19
+ case before_dot:
+ DEBUG_PRINT1 ("EXECUTING before_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) >= point)
+ goto fail;
+ break;
+
+ case at_dot:
+ DEBUG_PRINT1 ("EXECUTING at_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) != point)
+ goto fail;
+ break;
+
+ case after_dot:
+ DEBUG_PRINT1 ("EXECUTING after_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) <= point)
+ goto fail;
+ break;
+#else /* not emacs19 */
+ case at_dot:
+ DEBUG_PRINT1 ("EXECUTING at_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) + 1 != point)
+ goto fail;
+ break;
+#endif /* not emacs19 */
+
+ case syntaxspec:
+ DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt);
+ mcnt = *p++;
+ goto matchsyntax;
+
+ case wordchar:
+ DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n");
+ mcnt = (int) Sword;
+ matchsyntax:
+ PREFETCH ();
+ if (SYNTAX (*d++) != (enum syntaxcode) mcnt)
+ goto fail;
+ SET_REGS_MATCHED ();
+ break;
+
+ case notsyntaxspec:
+ DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt);
+ mcnt = *p++;
+ goto matchnotsyntax;
+
+ case notwordchar:
+ DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n");
+ mcnt = (int) Sword;
+ matchnotsyntax:
+ PREFETCH ();
+ if (SYNTAX (*d++) == (enum syntaxcode) mcnt)
+ goto fail;
+ SET_REGS_MATCHED ();
+ break;
+
+#else /* not emacs */
+ case wordchar:
+ DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n");
+ PREFETCH ();
+ if (!WORDCHAR_P (d))
+ goto fail;
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+
+ case notwordchar:
+ DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
+ PREFETCH ();
+ if (WORDCHAR_P (d))
+ goto fail;
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+#endif /* not emacs */
+
+ default:
+ abort ();
+ }
+ continue; /* Successfully executed one pattern command; keep going. */
+
+
+ /* We goto here if a matching operation fails. */
+ fail:
+ if (!FAIL_STACK_EMPTY ())
+ { /* A restart point is known. Restore to that state. */
+ DEBUG_PRINT1 ("\nFAIL:\n");
+ POP_FAILURE_POINT (d, p,
+ lowest_active_reg, highest_active_reg,
+ regstart, regend, reg_info);
+
+ /* If this failure point is a dummy, try the next one. */
+ if (!p)
+ goto fail;
+
+ /* If we failed to the end of the pattern, don't examine *p. */
+ assert (p <= pend);
+ if (p < pend)
+ {
+ boolean is_a_jump_n = false;
+
+ /* If failed to a backwards jump that's part of a repetition
+ loop, need to pop this failure point and use the next one. */
+ switch ((re_opcode_t) *p)
+ {
+ case jump_n:
+ is_a_jump_n = true;
+ case maybe_pop_jump:
+ case pop_failure_jump:
+ case jump:
+ p1 = p + 1;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+
+ if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
+ || (!is_a_jump_n
+ && (re_opcode_t) *p1 == on_failure_jump))
+ goto fail;
+ break;
+ default:
+ /* do nothing */ ;
+ }
+ }
+
+ if (d >= string1 && d <= end1)
+ dend = end_match_1;
+ }
+ else
+ break; /* Matching at this starting point really fails. */
+ } /* for (;;) */
+
+ if (best_regs_set)
+ goto restore_best_regs;
+
+ FREE_VARIABLES ();
+
+ return -1; /* Failure to match. */
+} /* re_match_2 */
+
+/* Subroutine definitions for re_match_2. */
+
+
+/* We are passed P pointing to a register number after a start_memory.
+
+ Return true if the pattern up to the corresponding stop_memory can
+ match the empty string, and false otherwise.
+
+ If we find the matching stop_memory, sets P to point to one past its number.
+ Otherwise, sets P to an undefined byte less than or equal to END.
+
+ We don't handle duplicates properly (yet). */
+
+static boolean
+group_match_null_string_p ( unsigned char **p, unsigned char *end,
+ register_info_type *reg_info )
+{
+ int mcnt;
+ /* Point to after the args to the start_memory. */
+ unsigned char *p1 = *p + 2;
+
+ while (p1 < end)
+ {
+ /* Skip over opcodes that can match nothing, and return true or
+ false, as appropriate, when we get to one that can't, or to the
+ matching stop_memory. */
+
+ switch ((re_opcode_t) *p1)
+ {
+ /* Could be either a loop or a series of alternatives. */
+ case on_failure_jump:
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+
+ /* If the next operation is not a jump backwards in the
+ pattern. */
+
+ if (mcnt >= 0)
+ {
+ /* Go through the on_failure_jumps of the alternatives,
+ seeing if any of the alternatives cannot match nothing.
+ The last alternative starts with only a jump,
+ whereas the rest start with on_failure_jump and end
+ with a jump, e.g., here is the pattern for `a|b|c':
+
+ /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
+ /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
+ /exactn/1/c
+
+ So, we have to first go through the first (n-1)
+ alternatives and then deal with the last one separately. */
+
+
+ /* Deal with the first (n-1) alternatives, which start
+ with an on_failure_jump (see above) that jumps to right
+ past a jump_past_alt. */
+
+ while ((re_opcode_t) p1[mcnt-3] == jump_past_alt)
+ {
+ /* `mcnt' holds how many bytes long the alternative
+ is, including the ending `jump_past_alt' and
+ its number. */
+
+ if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
+ reg_info))
+ return false;
+
+ /* Move to right after this alternative, including the
+ jump_past_alt. */
+ p1 += mcnt;
+
+ /* Break if it's the beginning of an n-th alternative
+ that doesn't begin with an on_failure_jump. */
+ if ((re_opcode_t) *p1 != on_failure_jump)
+ break;
+
+ /* Still have to check that it's not an n-th
+ alternative that starts with an on_failure_jump. */
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if ((re_opcode_t) p1[mcnt-3] != jump_past_alt)
+ {
+ /* Get to the beginning of the n-th alternative. */
+ p1 -= 3;
+ break;
+ }
+ }
+
+ /* Deal with the last alternative: go back and get number
+ of the `jump_past_alt' just before it. `mcnt' contains
+ the length of the alternative. */
+ EXTRACT_NUMBER (mcnt, p1 - 2);
+
+ if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info))
+ return false;
+
+ p1 += mcnt; /* Get past the n-th alternative. */
+ } /* if mcnt > 0 */
+ break;
+
+
+ case stop_memory:
+ assert (p1[1] == **p);
+ *p = p1 + 2;
+ return true;
+
+
+ default:
+ if (!common_op_match_null_string_p (&p1, end, reg_info))
+ return false;
+ }
+ } /* while p1 < end */
+
+ return false;
+} /* group_match_null_string_p */
+
+
+/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
+ It expects P to be the first byte of a single alternative and END one
+ byte past the last. The alternative can contain groups. */
+
+static boolean
+alt_match_null_string_p ( unsigned char *p, unsigned char *end,
+ register_info_type *reg_info )
+{
+ int mcnt;
+ unsigned char *p1 = p;
+
+ while (p1 < end)
+ {
+ /* Skip over opcodes that can match nothing, and break when we get
+ to one that can't. */
+
+ switch ((re_opcode_t) *p1)
+ {
+ /* It's a loop. */
+ case on_failure_jump:
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+ break;
+
+ default:
+ if (!common_op_match_null_string_p (&p1, end, reg_info))
+ return false;
+ }
+ } /* while p1 < end */
+
+ return true;
+} /* alt_match_null_string_p */
+
+
+/* Deals with the ops common to group_match_null_string_p and
+ alt_match_null_string_p.
+
+ Sets P to one after the op and its arguments, if any. */
+
+static boolean
+common_op_match_null_string_p ( unsigned char **p, unsigned char *end,
+ register_info_type *reg_info )
+{
+ int mcnt;
+ boolean ret;
+ int reg_no;
+ unsigned char *p1 = *p;
+
+ switch ((re_opcode_t) *p1++)
+ {
+ case no_op:
+ case begline:
+ case endline:
+ case begbuf:
+ case endbuf:
+ case wordbeg:
+ case wordend:
+ case wordbound:
+ case notwordbound:
+#ifdef emacs
+ case before_dot:
+ case at_dot:
+ case after_dot:
+#endif
+ break;
+
+ case start_memory:
+ reg_no = *p1;
+ assert (reg_no > 0 && reg_no <= MAX_REGNUM);
+ ret = group_match_null_string_p (&p1, end, reg_info);
+
+ /* Have to set this here in case we're checking a group which
+ contains a group and a back reference to it. */
+
+ if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
+ REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret;
+
+ if (!ret)
+ return false;
+ break;
+
+ /* If this is an optimized succeed_n for zero times, make the jump. */
+ case jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if (mcnt >= 0)
+ p1 += mcnt;
+ else
+ return false;
+ break;
+
+ case succeed_n:
+ /* Get to the number of times to succeed. */
+ p1 += 2;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+
+ if (mcnt == 0)
+ {
+ p1 -= 4;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+ }
+ else
+ return false;
+ break;
+
+ case duplicate:
+ if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
+ return false;
+ break;
+
+ case set_number_at:
+ p1 += 4;
+
+ default:
+ /* All other opcodes mean we cannot match the empty string. */
+ return false;
+ }
+
+ *p = p1;
+ return true;
+} /* common_op_match_null_string_p */
+
+
+/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
+ bytes; nonzero otherwise. */
+
+static int
+bcmp_translate ( const char *s1, const char *s2, register int len,
+ char *translate )
+{
+ register unsigned char *p1 = (unsigned char *)s1,
+ *p2 = (unsigned char *)s2;
+ while (len)
+ {
+ if (translate[*p1++] != translate[*p2++]) return 1;
+ len--;
+ }
+ return 0;
+}
+
+/* Entry points for GNU code. */
+
+/* re_compile_pattern is the GNU regular expression compiler: it
+ compiles PATTERN (of length SIZE) and puts the result in BUFP.
+ Returns 0 if the pattern was valid, otherwise an error string.
+
+ Assumes the `allocated' (and perhaps `buffer') and `translate' fields
+ are set in BUFP on entry.
+
+ We call regex_compile to do the actual compilation. */
+
+const char *
+re_compile_pattern ( const char *pattern, int length,
+ struct re_pattern_buffer *bufp )
+{
+ reg_errcode_t ret;
+
+ /* GNU code is written to assume at least RE_NREGS registers will be set
+ (and at least one extra will be -1). */
+ bufp->regs_allocated = REGS_UNALLOCATED;
+
+ /* And GNU code determines whether or not to get register information
+ by passing null for the REGS argument to re_match, etc., not by
+ setting no_sub. */
+ bufp->no_sub = 0;
+
+ /* Match anchors at newline. */
+ bufp->newline_anchor = 1;
+
+ ret = regex_compile (pattern, length, re_syntax_options, bufp);
+
+ return re_error_msg[(int) ret];
+}
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them if this is an Emacs or POSIX compilation. */
+
+#if !defined (emacs) && !defined (_POSIX_SOURCE)
+
+/* BSD has one and only one pattern buffer. */
+static struct re_pattern_buffer re_comp_buf;
+
+char *
+re_comp ( const char *s )
+{
+ reg_errcode_t ret;
+
+ if (!s)
+ {
+ if (!re_comp_buf.buffer)
+ return "No previous regular expression";
+ return 0;
+ }
+
+ if (!re_comp_buf.buffer)
+ {
+ re_comp_buf.buffer = (unsigned char *) malloc (200);
+ if (re_comp_buf.buffer == NULL)
+ return "Memory exhausted";
+ re_comp_buf.allocated = 200;
+
+ re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
+ if (re_comp_buf.fastmap == NULL)
+ return "Memory exhausted";
+ }
+
+ /* Since `re_exec' always passes NULL for the `regs' argument, we
+ don't need to initialize the pattern buffer fields which affect it. */
+
+ /* Match anchors at newlines. */
+ re_comp_buf.newline_anchor = 1;
+
+ ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
+
+ /* Yes, we're discarding `const' here. */
+ return (char *) re_error_msg[(int) ret];
+}
+
+
+int
+re_exec ( const char *s )
+{
+ const int len = strlen (s);
+ return
+ 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
+}
+#endif /* not emacs and not _POSIX_SOURCE */
+
+/* POSIX.2 functions. Don't define these for Emacs. */
+
+#ifndef emacs
+
+/* regcomp takes a regular expression as a string and compiles it.
+
+ PREG is a regex_t *. We do not expect any fields to be initialized,
+ since POSIX says we shouldn't. Thus, we set
+
+ `buffer' to the compiled pattern;
+ `used' to the length of the compiled pattern;
+ `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
+ REG_EXTENDED bit in CFLAGS is set; otherwise, to
+ RE_SYNTAX_POSIX_BASIC;
+ `newline_anchor' to REG_NEWLINE being set in CFLAGS;
+ `fastmap' and `fastmap_accurate' to zero;
+ `re_nsub' to the number of subexpressions in PATTERN.
+
+ PATTERN is the address of the pattern string.
+
+ CFLAGS is a series of bits which affect compilation.
+
+ If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
+ use POSIX basic syntax.
+
+ If REG_NEWLINE is set, then . and [^...] don't match newline.
+ Also, regexec will try a match beginning after every newline.
+
+ If REG_ICASE is set, then we considers upper- and lowercase
+ versions of letters to be equivalent when matching.
+
+ If REG_NOSUB is set, then when PREG is passed to regexec, that
+ routine will report only success or failure, and nothing about the
+ registers.
+
+ It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
+ the return codes and their meanings.) */
+
+int
+regcomp ( regex_t *preg, const char *pattern, int cflags )
+{
+ reg_errcode_t ret;
+ unsigned syntax
+ = (cflags & REG_EXTENDED) ?
+ RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
+
+ /* regex_compile will allocate the space for the compiled pattern. */
+ preg->buffer = 0;
+ preg->allocated = 0;
+
+ /* Don't bother to use a fastmap when searching. This simplifies the
+ REG_NEWLINE case: if we used a fastmap, we'd have to put all the
+ characters after newlines into the fastmap. This way, we just try
+ every character. */
+ preg->fastmap = 0;
+
+ if (cflags & REG_ICASE)
+ {
+ unsigned i;
+
+ preg->translate = (char *) malloc (CHAR_SET_SIZE);
+ if (preg->translate == NULL)
+ return (int) REG_ESPACE;
+
+ /* Map uppercase characters to corresponding lowercase ones. */
+ for (i = 0; i < CHAR_SET_SIZE; i++)
+ preg->translate[i] = ISUPPER (i) ? tolower (i) : i;
+ }
+ else
+ preg->translate = NULL;
+
+ /* If REG_NEWLINE is set, newlines are treated differently. */
+ if (cflags & REG_NEWLINE)
+ { /* REG_NEWLINE implies neither . nor [^...] match newline. */
+ syntax &= ~RE_DOT_NEWLINE;
+ syntax |= RE_HAT_LISTS_NOT_NEWLINE;
+ /* It also changes the matching behavior. */
+ preg->newline_anchor = 1;
+ }
+ else
+ preg->newline_anchor = 0;
+
+ preg->no_sub = !!(cflags & REG_NOSUB);
+
+ /* POSIX says a null character in the pattern terminates it, so we
+ can use strlen here in compiling the pattern. */
+ ret = regex_compile (pattern, strlen (pattern), syntax, preg);
+
+ /* POSIX doesn't distinguish between an unmatched open-group and an
+ unmatched close-group: both are REG_EPAREN. */
+ if (ret == REG_ERPAREN) ret = REG_EPAREN;
+
+ return (int) ret;
+}
+
+
+/* regexec searches for a given pattern, specified by PREG, in the
+ string STRING.
+
+ If NMATCH is zero or REG_NOSUB was set in the cflags argument to
+ `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
+ least NMATCH elements, and we set them to the offsets of the
+ corresponding matched substrings.
+
+ EFLAGS specifies `execution flags' which affect matching: if
+ REG_NOTBOL is set, then ^ does not match at the beginning of the
+ string; if REG_NOTEOL is set, then $ does not match at the end.
+
+ We return 0 if we find a match and REG_NOMATCH if not. */
+
+int
+regexec ( const regex_t *preg, const char *string, size_t nmatch,
+ regmatch_t pmatch[], int eflags )
+{
+ int ret;
+ struct re_registers regs;
+ regex_t private_preg;
+ int len = strlen (string);
+ boolean want_reg_info = !preg->no_sub && nmatch > 0;
+
+ private_preg = *preg;
+
+ private_preg.not_bol = !!(eflags & REG_NOTBOL);
+ private_preg.not_eol = !!(eflags & REG_NOTEOL);
+
+ /* The user has told us exactly how many registers to return
+ information about, via `nmatch'. We have to pass that on to the
+ matching routines. */
+ private_preg.regs_allocated = REGS_FIXED;
+
+ if (want_reg_info)
+ {
+ regs.num_regs = nmatch;
+ regs.start = TALLOC (nmatch, regoff_t);
+ regs.end = TALLOC (nmatch, regoff_t);
+ if (regs.start == NULL || regs.end == NULL)
+ return (int) REG_NOMATCH;
+ }
+
+ /* Perform the searching operation. */
+ ret = re_search (&private_preg, string, len,
+ /* start: */ 0, /* range: */ len,
+ want_reg_info ? &regs : (struct re_registers *) 0);
+
+ /* Copy the register information to the POSIX structure. */
+ if (want_reg_info)
+ {
+ if (ret >= 0)
+ {
+ unsigned r;
+
+ for (r = 0; r < nmatch; r++)
+ {
+ pmatch[r].rm_so = regs.start[r];
+ pmatch[r].rm_eo = regs.end[r];
+ }
+ }
+
+ /* If we needed the temporary register info, free the space now. */
+ free (regs.start);
+ free (regs.end);
+ }
+
+ /* We want zero return to mean success, unlike `re_search'. */
+ return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
+}
+
+
+/* Returns a message corresponding to an error code, ERRCODE, returned
+ from either regcomp or regexec. We don't use PREG here. */
+
+size_t
+regerror ( int errcode, const regex_t *preg, char *errbuf,
+ size_t errbuf_size )
+{
+ const char *msg;
+ size_t msg_size;
+
+ if (preg) preg=0; // Avoid not used warnings
+ if (errcode < 0
+ || errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
+ /* Only error codes returned by the rest of the code should be passed
+ to this routine. If we are given anything else, or if other regex
+ code generates an invalid error code, then the program has a bug.
+ Dump core so we can fix it. */
+ abort ();
+
+ msg = re_error_msg[errcode];
+
+ /* POSIX doesn't require that we do anything in this case, but why
+ not be nice. */
+ if (! msg)
+ msg = "Success";
+
+ msg_size = strlen (msg) + 1; /* Includes the null. */
+
+ if (errbuf_size != 0)
+ {
+ if (msg_size > errbuf_size)
+ {
+ strncpy (errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size - 1] = 0;
+ }
+ else
+ strcpy (errbuf, msg);
+ }
+
+ return msg_size;
+}
+
+
+/* Free dynamically allocated space used by PREG. */
+
+void
+regfree ( regex_t *preg )
+{
+ if (preg->buffer != NULL)
+ free (preg->buffer);
+ preg->buffer = NULL;
+
+ preg->allocated = 0;
+ preg->used = 0;
+
+ if (preg->fastmap != NULL)
+ free (preg->fastmap);
+ preg->fastmap = NULL;
+ preg->fastmap_accurate = 0;
+
+ if (preg->translate != NULL)
+ free (preg->translate);
+ preg->translate = NULL;
+}
+
+#endif /* not emacs */
+
+#ifdef TVComp_BCPP
+#pragma option pop
+#endif
+
+#endif // NEEDS_REGEX
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/tvision/compat/releasec.c b/tvision/compat/releasec.c
new file mode 100644
index 0000000..cf526be
--- /dev/null
+++ b/tvision/compat/releasec.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 1996-1998 Robert H”hne */
+/* Modified by Salvador E. Tropea, Vadim Bolodorov and Anatoli Soltan */
+#include <tv/configtv.h>
+
+#ifdef TVCompf_djgpp
+#include <dpmi.h>
+
+void CLY_ReleaseCPU()
+{
+ __dpmi_yield(); // Release the time slice
+}
+#endif // DJGPP
+
+
+#ifdef TVOS_Win32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+// I don't know if the following difference could be unified:
+#ifdef TVOSf_NT
+// SET: Anatoli's port for NT releases the CPU until the console received
+// some message.
+extern void __tvWin32Yield(int micros);
+
+void CLY_ReleaseCPU()
+{
+ __tvWin32Yield(-1);
+}
+#else
+// By Vadim Beloborodov to be used on WIN32 console
+// SET: Vadim's port just waits 0.1 seconds. I think that's because he uses
+// another thread for input.
+void CLY_ReleaseCPU()
+{
+ Sleep(100);
+}
+#endif
+
+#endif // Win32
+
+
+#if defined(TVOSf_QNX4)
+ #include <time.h>
+
+ static void usleep(unsigned long sleeptime)
+ {
+ struct timespec wait;
+
+ wait.tv_nsec=sleeptime;
+ wait.tv_sec=0;
+
+ do {
+ if (nanosleep(&wait, &wait)==0)
+ {
+ break;
+ }
+ } while(1);
+ }
+#endif
+
+#ifdef TVOS_UNIX
+#include <unistd.h>
+
+void CLY_ReleaseCPU()
+{
+ usleep(1000); // Linux, release 1 ms
+}
+#endif
diff --git a/tvision/compat/snprintf.c b/tvision/compat/snprintf.c
new file mode 100644
index 0000000..fc61538
--- /dev/null
+++ b/tvision/compat/snprintf.c
@@ -0,0 +1,892 @@
+/*
+ Unix snprintf implementation.
+ Version 1.1
+ Code by Caolán McNamara <caolan@skynet.ie>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Revision History:
+
+ 1.1:
+ * added changes from Miles Bader
+ * corrected a bug with %f
+ * added support for %#g
+ * added more comments :-)
+ 1.0:
+ * supporting must ANSI syntaxic_sugars
+ 0.0:
+ * suppot %s %c %d
+
+ THANKS(for the patches and ideas):
+ Miles Bader
+ Cyrille Rustom
+ Jacek Slabocewiz
+ Mike Parker(mouse)
+ ------------------------------------
+
+ Modified by Salvador E. Tropea (c) 2003.
+ Don't blame Caolán for the bugs introduced by me ;-)
+ I removed all the pre-ANSI previsions because they make the code unreadable
+and I don't plan to support such an old compilers.
+ I modified (or at least tried to ;-) the code to return not the used length
+but the length needed to put all. This is the standard behavior and not what
+Caolán implemented. In fact this code gets useless without it because I use
+a first call without a buffer to determine the length of the buffer in most
+cases.
+
+*/
+
+#include <cl/needs.h>
+
+#ifdef NEEDS_SNPRINTF
+
+#include <stdarg.h>
+#include <stdlib.h> /* for atoi() */
+#include <ctype.h>
+#include <string.h> /* strlen() and others */
+
+/*
+ * For the FLOATING POINT FORMAT :
+ * the challenge was finding a way to
+ * manipulate the Real numbers without having
+ * to resort to mathematical function(it
+ * would require to link with -lm) and not
+ * going down to the bit pattern(not portable)
+ *
+ * so a number, a real is:
+
+ real = integral + fraction
+
+ integral = ... + a(2)*10^2 + a(1)*10^1 + a(0)*10^0
+ fraction = b(1)*10^-1 + b(2)*10^-2 + ...
+
+ where:
+ 0 <= a(i) => 9
+ 0 <= b(i) => 9
+
+ from then it was simple math
+ */
+
+/*
+ * size of the buffer for the integral part
+ * and the fraction part
+ */
+#define MAX_INT 99 + 1 /* 1 for the null */
+#define MAX_FRACT 29 + 1
+
+/*
+ * numtoa() uses PRIVATE buffers to store the results,
+ * So this function is not reentrant
+ */
+#define itoa(n) numtoa(n, 10, 0, (char **)0)
+#define otoa(n) numtoa(n, 8, 0, (char **)0)
+#define htoa(n) numtoa(n, 16, 0, (char **)0)
+#define dtoa(n, p, f) numtoa(n, 10, p, f)
+
+#define SWAP_INT(a,b) {int t; t = (a); (a) = (b); (b) = t;}
+
+/* this struct holds everything we need */
+struct DATA {
+ int length;
+ char *holder;
+ int counter;
+ const char *pf;
+/* FLAGS */
+ int width, precision;
+ int justify; char pad;
+ int square, space, star_w, star_p, a_long ;
+};
+
+#define PRIVATE static
+#define PUBLIC
+/* signature of the functions */
+/* the floating point stuff */
+ PRIVATE double pow_10(int);
+ PRIVATE int log_10(double);
+ PRIVATE double integral(double, double *);
+ PRIVATE char * numtoa(double, int, int, char **);
+
+/* for the format */
+ PRIVATE void conv_flag(char *, struct DATA *);
+ PRIVATE void floating(struct DATA *, double);
+ PRIVATE void exponent(struct DATA *, double);
+ PRIVATE void decimal(struct DATA *, double);
+ PRIVATE void octal(struct DATA *, double);
+ PRIVATE void hexa(struct DATA *, double);
+ PRIVATE void strings(struct DATA *, char *);
+
+/* those are defines specific to snprintf to hopefully
+ * make the code clearer :-)
+ */
+#define RIGHT 1
+#define LEFT 0
+#define NOT_FOUND -1
+#define FOUND 1
+#define MAX_FIELD 15
+
+/* the conversion flags */
+#define isflag(c) ((c) == '#' || (c) == ' ' || \
+ (c) == '*' || (c) == '+' || \
+ (c) == '-' || (c) == '.' || \
+ isdigit(c))
+
+/* round off to the precision */
+#define ROUND(d, p) \
+ (d < 0.) ? \
+ d - pow_10(-(p)->precision) * 0.5 : \
+ d + pow_10(-(p)->precision) * 0.5
+
+/* set default precision */
+#define DEF_PREC(p) \
+ if ((p)->precision == NOT_FOUND) \
+ (p)->precision = 6
+
+/* put a char */
+#define PUT_CHAR(c, p) \
+ { \
+ if ((p)->counter < (p)->length) \
+ *(p)->holder++ = (c); \
+ (p)->counter++; /* SET: Moved outside if */ \
+ }
+
+/* SET: put a char, no increment */
+#define PUT_EOS(p) \
+ { \
+ if ((p)->counter <= (p)->length) \
+ *(p)->holder = 0; \
+ }
+
+#define PUT_PLUS(d, p) \
+ if ((d) > 0. && (p)->justify == RIGHT) \
+ PUT_CHAR('+', p)
+
+#define PUT_SPACE(d, p) \
+ if ((p)->space == FOUND && (d) > 0.) \
+ PUT_CHAR(' ', p)
+
+/* pad right */
+#define PAD_RIGHT(p) \
+ if ((p)->width > 0 && (p)->justify != LEFT) \
+ for (; (p)->width > 0; (p)->width--) \
+ PUT_CHAR((p)->pad, p)
+
+/* pad left */
+#define PAD_LEFT(p) \
+ if ((p)->width > 0 && (p)->justify == LEFT) \
+ for (; (p)->width > 0; (p)->width--) \
+ PUT_CHAR((p)->pad, p)
+
+/* if width and prec. in the args */
+#define STAR_ARGS(p) \
+ if ((p)->star_w == FOUND) \
+ (p)->width = va_arg(args, int); \
+ if ((p)->star_p == FOUND) \
+ (p)->precision = va_arg(args, int)
+
+/*
+ * Find the nth power of 10
+ */
+PRIVATE double
+pow_10(int n)
+{
+ int i;
+ double P;
+
+ if (n < 0)
+ for (i = 1, P = 1., n = -n ; i <= n ; i++) {P *= .1;}
+ else
+ for (i = 1, P = 1. ; i <= n ; i++) {P *= 10.0;}
+ return P;
+}
+
+/*
+ * Find the integral part of the log in base 10
+ * Note: this not a real log10()
+ I just need and approximation(integerpart) of x in:
+ 10^x ~= r
+ * log_10(200) = 2;
+ * log_10(250) = 2;
+ */
+PRIVATE int
+log_10(double r)
+{
+ int i = 0;
+ double result = 1.;
+
+ if (r < 0.)
+ r = -r;
+
+ if (r < 1.) {
+ while (result >= r) {result *= .1; i++;}
+ return (-i);
+ } else {
+ while (result <= r) {result *= 10.; i++;}
+ return (i - 1);
+ }
+}
+
+/*
+ * This function return the fraction part of a double
+ * and set in ip the integral part.
+ * In many ways it resemble the modf() found on most Un*x
+ */
+PRIVATE double
+integral(double real, double * ip)
+{
+ int j;
+ double i, s, p;
+ double real_integral = 0.;
+
+/* take care of the obvious */
+/* equal to zero ? */
+ if (real == 0.) {
+ *ip = 0.;
+ return (0.);
+ }
+
+/* negative number ? */
+ if (real < 0.)
+ real = -real;
+
+/* a fraction ? */
+ if ( real < 1.) {
+ *ip = 0.;
+ return real;
+ }
+/* the real work :-) */
+ for (j = log_10(real); j >= 0; j--) {
+ p = pow_10(j);
+ s = (real - real_integral)/p;
+ i = 0.;
+ while (i + 1. <= s) {i++;}
+ real_integral += i*p;
+ }
+ *ip = real_integral;
+ return (real - real_integral);
+}
+
+#define PRECISION 1.e-6
+/*
+ * return an ascii representation of the integral part of the number
+ * and set fract to be an ascii representation of the fraction part
+ * the container for the fraction and the integral part or staticly
+ * declare with fix size
+ */
+PRIVATE char *
+numtoa(double number, int base, int precision, char ** fract)
+{
+ register int i, j;
+ double ip, fp; /* integer and fraction part */
+ double fraction;
+ int digits = MAX_INT - 1;
+ static char integral_part[MAX_INT];
+ static char fraction_part[MAX_FRACT];
+ double sign;
+ int ch;
+
+/* taking care of the obvious case: 0.0 */
+ if (number == 0.) {
+ integral_part[0] = '0';
+ integral_part[1] = '\0';
+ fraction_part[0] = '0';
+ fraction_part[1] = '\0';
+ return integral_part;
+ }
+
+/* for negative numbers */
+ if ((sign = number) < 0.) {
+ number = -number;
+ digits--; /* sign consume one digit */
+ }
+
+ fraction = integral(number, &ip);
+ number = ip;
+/* do the integral part */
+ if ( ip == 0.) {
+ integral_part[0] = '0';
+ i = 1;
+ } else {
+ for ( i = 0; i < digits && number != 0.; ++i) {
+ number /= base;
+ fp = integral(number, &ip);
+ ch = (int)((fp + PRECISION)*base); /* force to round */
+ integral_part[i] = (ch <= 9) ? ch + '0' : ch + 'a' - 10;
+ if (! isxdigit(integral_part[i])) /* bail out overflow !! */
+ break;
+ number = ip;
+ }
+ }
+
+/* Oh No !! out of bound, ho well fill it up ! */
+ if (number != 0.)
+ for (i = 0; i < digits; ++i)
+ integral_part[i] = '9';
+
+/* put the sign ? */
+ if (sign < 0.)
+ integral_part[i++] = '-';
+
+ integral_part[i] = '\0';
+
+/* reverse every thing */
+ for ( i--, j = 0; j < i; j++, i--)
+ SWAP_INT(integral_part[i], integral_part[j]);
+
+/* the fractionnal part */
+ for (i=0, fp=fraction; precision > 0 && i < MAX_FRACT ; i++, precision-- ) {
+ fraction_part[i] = (int)((fp + PRECISION)*10. + '0');
+ if (! isdigit(fraction_part[i])) /* underflow ? */
+ break;
+ fp = (fp*10.0) - (double)(long)((fp + PRECISION)*10.);
+ }
+ fraction_part[i] = '\0';
+
+ if (fract != (char **)0)
+ *fract = fraction_part;
+
+ return integral_part;
+
+}
+
+/* for %d and friends, it puts in holder
+ * the representation with the right padding
+ */
+PRIVATE void
+decimal(struct DATA *p, double d)
+{
+ char *tmp;
+
+ tmp = itoa(d);
+ p->width -= strlen(tmp);
+ PAD_RIGHT(p);
+ PUT_PLUS(d, p);
+ PUT_SPACE(d, p);
+ while (*tmp) { /* the integral */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* for %o octal representation */
+PRIVATE void
+octal(struct DATA *p, double d)
+{
+ char *tmp;
+
+ tmp = otoa(d);
+ p->width -= strlen(tmp);
+ PAD_RIGHT(p);
+ if (p->square == FOUND) /* had prefix '0' for octal */
+ PUT_CHAR('0', p);
+ while (*tmp) { /* octal */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* for %x %X hexadecimal representation */
+PRIVATE void
+hexa(struct DATA *p, double d)
+{
+ char *tmp;
+
+ tmp = htoa(d);
+ p->width -= strlen(tmp);
+ PAD_RIGHT(p);
+ if (p->square == FOUND) { /* prefix '0x' for hexa */
+ PUT_CHAR('0', p); PUT_CHAR(*p->pf, p);
+ }
+ while (*tmp) { /* hexa */
+ PUT_CHAR((*p->pf == 'X' ? toupper(*tmp) : *tmp), p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* %s strings */
+PRIVATE void
+strings(struct DATA *p, char *tmp)
+{
+ int i;
+
+ i = strlen(tmp);
+ if (p->precision != NOT_FOUND) /* the smallest number */
+ i = (i < p->precision ? i : p->precision);
+ p->width -= i;
+ PAD_RIGHT(p);
+ while (i-- > 0) { /* put the sting */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* %f or %g floating point representation */
+PRIVATE void
+floating(struct DATA *p, double d)
+{
+ char *tmp, *tmp2;
+ int i;
+
+ DEF_PREC(p);
+ d = ROUND(d, p);
+ tmp = dtoa(d, p->precision, &tmp2);
+ /* calculate the padding. 1 for the dot */
+ p->width = p->width -
+ ((d > 0. && p->justify == RIGHT) ? 1:0) -
+ ((p->space == FOUND) ? 1:0) -
+ strlen(tmp) - p->precision - 1;
+ PAD_RIGHT(p);
+ PUT_PLUS(d, p);
+ PUT_SPACE(d, p);
+ while (*tmp) { /* the integral */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ if (p->precision != 0 || p->square == FOUND)
+ PUT_CHAR('.', p); /* put the '.' */
+ if (*p->pf == 'g' || *p->pf == 'G') /* smash the trailing zeros */
+ for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--)
+ tmp2[i] = '\0';
+ for (; *tmp2; tmp2++)
+ PUT_CHAR(*tmp2, p); /* the fraction */
+
+ PAD_LEFT(p);
+}
+
+/* %e %E %g exponent representation */
+PRIVATE void
+exponent(struct DATA *p, double d)
+{
+ char *tmp, *tmp2;
+ int j, i;
+
+ DEF_PREC(p);
+ j = log_10(d);
+ d = d / pow_10(j); /* get the Mantissa */
+ d = ROUND(d, p);
+ tmp = dtoa(d, p->precision, &tmp2);
+ /* 1 for unit, 1 for the '.', 1 for 'e|E',
+ * 1 for '+|-', 3 for 'exp' */
+ /* calculate how much padding need */
+ p->width = p->width -
+ ((d > 0. && p->justify == RIGHT) ? 1:0) -
+ ((p->space == FOUND) ? 1:0) - p->precision - 7;
+ PAD_RIGHT(p);
+ PUT_PLUS(d, p);
+ PUT_SPACE(d, p);
+ while (*tmp) {/* the integral */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ if (p->precision != 0 || p->square == FOUND)
+ PUT_CHAR('.', p); /* the '.' */
+ if (*p->pf == 'g' || *p->pf == 'G') /* smash the trailing zeros */
+ for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--)
+ tmp2[i] = '\0';
+ for (; *tmp2; tmp2++)
+ PUT_CHAR(*tmp2, p); /* the fraction */
+
+ if (*p->pf == 'g' || *p->pf == 'e') { /* the exponent put the 'e|E' */
+ PUT_CHAR('e', p);
+ } else
+ PUT_CHAR('E', p);
+ if (j > 0) { /* the sign of the exp */
+ PUT_CHAR('+', p);
+ } else {
+ PUT_CHAR('-', p);
+ j = -j;
+ }
+ tmp = itoa((double)j);
+ if (j < 9) { /* need to pad the exponent with 0 '000' */
+ PUT_CHAR('0', p); PUT_CHAR('0', p);
+ } else if (j < 99)
+ PUT_CHAR('0', p);
+ while (*tmp) { /* the exponent */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* initialize the conversion specifiers */
+PRIVATE void
+conv_flag(char * s, struct DATA * p)
+{
+ char number[MAX_FIELD/2];
+ int i;
+
+ p->precision = p->width = NOT_FOUND;
+ p->star_w = p->star_p = NOT_FOUND;
+ p->square = p->space = NOT_FOUND;
+ p->a_long = p->justify = NOT_FOUND;
+ p->pad = ' ';
+
+ for(;s && *s ;s++) {
+ switch(*s) {
+ case ' ': p->space = FOUND; break;
+ case '#': p->square = FOUND; break;
+ case '*': if (p->width == NOT_FOUND)
+ p->width = p->star_w = FOUND;
+ else
+ p->precision = p->star_p = FOUND;
+ break;
+ case '+': p->justify = RIGHT; break;
+ case '-': p->justify = LEFT; break;
+ case '.': if (p->width == NOT_FOUND)
+ p->width = 0;
+ break;
+ case '0': p->pad = '0'; break;
+ case '1': case '2': case '3':
+ case '4': case '5': case '6':
+ case '7': case '8': case '9': /* gob all the digits */
+ for (i = 0; isdigit(*s); i++, s++)
+ if (i < MAX_FIELD/2 - 1)
+ number[i] = *s;
+ number[i] = '\0';
+ if (p->width == NOT_FOUND)
+ p->width = atoi(number);
+ else
+ p->precision = atoi(number);
+ s--; /* went to far go back */
+ break;
+ }
+ }
+}
+
+PUBLIC int
+CLY_vsnprintf(char *string, size_t length, const char * format, va_list args)
+{
+ struct DATA data;
+ char conv_field[MAX_FIELD];
+ double d; /* temporary holder */
+ int state;
+ int i;
+
+ data.length = length - 1; /* leave room for '\0' */
+ data.holder = string;
+ data.pf = format;
+ data.counter = 0;
+
+
+/* sanity check, the string must be > 1
+ SET: Wrong! we must compute the length!
+ if (length < 1)
+ return -1; */
+
+
+ for (; *data.pf /*SET: && (data.counter < data.length)*/; data.pf++) {
+ if ( *data.pf == '%' ) { /* we got a magic % cookie */
+ conv_flag((char *)0, &data); /* initialise format flags */
+ for (state = 1; *data.pf && state;) {
+ switch (*(++data.pf)) {
+ case '\0': /* a NULL here ? ? bail out */
+ PUT_EOS(&data);
+ return data.counter;
+ break;
+ case 'f': /* float, double */
+ STAR_ARGS(&data);
+ d = va_arg(args, double);
+ floating(&data, d);
+ state = 0;
+ break;
+ case 'g':
+ case 'G':
+ STAR_ARGS(&data);
+ DEF_PREC(&data);
+ d = va_arg(args, double);
+ i = log_10(d);
+ /*
+ * for '%g|%G' ANSI: use f if exponent
+ * is in the range or [-4,p] exclusively
+ * else use %e|%E
+ */
+ if (-4 < i && i < data.precision)
+ floating(&data, d);
+ else
+ exponent(&data, d);
+ state = 0;
+ break;
+ case 'e':
+ case 'E': /* Exponent double */
+ STAR_ARGS(&data);
+ d = va_arg(args, double);
+ exponent(&data, d);
+ state = 0;
+ break;
+ case 'u':
+ case 'd': /* decimal */
+ STAR_ARGS(&data);
+ if (data.a_long == FOUND)
+ d = va_arg(args, long);
+ else
+ d = va_arg(args, int);
+ decimal(&data, d);
+ state = 0;
+ break;
+ case 'o': /* octal */
+ STAR_ARGS(&data);
+ if (data.a_long == FOUND)
+ d = va_arg(args, long);
+ else
+ d = va_arg(args, int);
+ octal(&data, d);
+ state = 0;
+ break;
+ case 'x':
+ case 'X': /* hexadecimal */
+ STAR_ARGS(&data);
+ if (data.a_long == FOUND)
+ d = va_arg(args, long);
+ else
+ d = va_arg(args, int);
+ hexa(&data, d);
+ state = 0;
+ break;
+ case 'c': /* character */
+ d = va_arg(args, int);
+ PUT_CHAR((char)d, &data);
+ state = 0;
+ break;
+ case 's': /* string */
+ STAR_ARGS(&data);
+ strings(&data, va_arg(args, char *));
+ state = 0;
+ break;
+ case 'n':
+ *(va_arg(args, int *)) = data.counter; /* what's the count ? */
+ state = 0;
+ break;
+ case 'l':
+ data.a_long = FOUND;
+ break;
+ case 'h':
+ break;
+ case '%': /* nothing just % */
+ PUT_CHAR('%', &data);
+ state = 0;
+ break;
+ case '#': case ' ': case '+': case '*':
+ case '-': case '.': case '0': case '1':
+ case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ /* initialize width and precision */
+ for (i = 0; isflag(*data.pf); i++, data.pf++)
+ if (i < MAX_FIELD - 1)
+ conv_field[i] = *data.pf;
+ conv_field[i] = '\0';
+ conv_flag(conv_field, &data);
+ data.pf--; /* went to far go back */
+ break;
+ default:
+ /* is this an error ? maybe bail out */
+ state = 0;
+ break;
+ } /* end switch */
+ } /* end of for state */
+ } else { /* not % */
+ PUT_CHAR(*data.pf, &data); /* add the char the string */
+ }
+ }
+
+ PUT_EOS(&data); /* the end ye ! */
+
+ return data.counter;
+}
+
+#ifndef HAVE_SNPRINTF
+
+PUBLIC int
+CLY_snprintf(char *string, size_t length, const char * format, ...)
+{
+ int rval;
+ va_list args;
+
+ va_start(args, format);
+
+ rval = CLY_vsnprintf (string, length, format, args);
+
+ va_end(args);
+
+ return rval;
+}
+
+#endif /* HAVE_SNPRINTF */
+
+
+#ifdef DRIVER
+
+#include <stdio.h>
+
+/* set of small tests for snprintf() */
+int main()
+{
+ char holder[100];
+ int i;
+
+/*
+ printf("Suite of test for snprintf:\n");
+ printf("a_format\n");
+ printf("printf() format\n");
+ printf("snprintf() format\n\n");
+*/
+/* Checking the field widths */
+
+ printf("/%%d/, 336\n");
+ CLY_snprintf(holder, sizeof holder, "/%d/\n", 336);
+ printf("/%d/\n", 336);
+ printf("%s\n", holder);
+
+ printf("/%%2d/, 336\n");
+ CLY_snprintf(holder, sizeof holder, "/%2d/\n", 336);
+ printf("/%2d/\n", 336);
+ printf("%s\n", holder);
+
+ printf("/%%10d/, 336\n");
+ CLY_snprintf(holder, sizeof holder, "/%10d/\n", 336);
+ printf("/%10d/\n", 336);
+ printf("%s\n", holder);
+
+ printf("/%%-10d/, 336\n");
+ CLY_snprintf(holder, sizeof holder, "/%-10d/\n", 336);
+ printf("/%-10d/\n", 336);
+ printf("%s\n", holder);
+
+
+/* floating points */
+
+ printf("/%%f/, 1234.56\n");
+ CLY_snprintf(holder, sizeof holder, "/%f/\n", 1234.56);
+ printf("/%f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%e/, 1234.56\n");
+ CLY_snprintf(holder, sizeof holder, "/%e/\n", 1234.56);
+ printf("/%e/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%4.2f/, 1234.56\n");
+ CLY_snprintf(holder, sizeof holder, "/%4.2f/\n", 1234.56);
+ printf("/%4.2f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%3.1f/, 1234.56\n");
+ CLY_snprintf(holder, sizeof holder, "/%3.1f/\n", 1234.56);
+ printf("/%3.1f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%10.3f/, 1234.56\n");
+ CLY_snprintf(holder, sizeof holder, "/%10.3f/\n", 1234.56);
+ printf("/%10.3f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%10.3e/, 1234.56\n");
+ CLY_snprintf(holder, sizeof holder, "/%10.3e/\n", 1234.56);
+ printf("/%10.3e/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%+4.2f/, 1234.56\n");
+ CLY_snprintf(holder, sizeof holder, "/%+4.2f/\n", 1234.56);
+ printf("/%+4.2f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%010.2f/, 1234.56\n");
+ CLY_snprintf(holder, sizeof holder, "/%010.2f/\n", 1234.56);
+ printf("/%010.2f/\n", 1234.56);
+ printf("%s\n", holder);
+
+#define BLURB "Outstanding acting !"
+/* strings precisions */
+
+ printf("/%%2s/, \"%s\"\n", BLURB);
+ CLY_snprintf(holder, sizeof holder, "/%2s/\n", BLURB);
+ printf("/%2s/\n", BLURB);
+ printf("%s\n", holder);
+
+ printf("/%%22s/ %s\n", BLURB);
+ CLY_snprintf(holder, sizeof holder, "/%22s/\n", BLURB);
+ printf("/%22s/\n", BLURB);
+ printf("%s\n", holder);
+
+ printf("/%%22.5s/ %s\n", BLURB);
+ CLY_snprintf(holder, sizeof holder, "/%22.5s/\n", BLURB);
+ printf("/%22.5s/\n", BLURB);
+ printf("%s\n", holder);
+
+ printf("/%%-22.5s/ %s\n", BLURB);
+ CLY_snprintf(holder, sizeof holder, "/%-22.5s/\n", BLURB);
+ printf("/%-22.5s/\n", BLURB);
+ printf("%s\n", holder);
+
+/* see some flags */
+
+ printf("%%x %%X %%#x, 31, 31, 31\n");
+ CLY_snprintf(holder, sizeof holder, "%x %X %#x\n", 31, 31, 31);
+ printf("%x %X %#x\n", 31, 31, 31);
+ printf("%s\n", holder);
+
+ printf("**%%d**%% d**%% d**, 42, 42, -42\n");
+ CLY_snprintf(holder, sizeof holder, "**%d**% d**% d**\n", 42, 42, -42);
+ printf("**%d**% d**% d**\n", 42, 42, -42);
+ printf("%s\n", holder);
+
+/* other flags */
+
+ printf("/%%g/, 31.4\n");
+ CLY_snprintf(holder, sizeof holder, "/%g/\n", 31.4);
+ printf("/%g/\n", 31.4);
+ printf("%s\n", holder);
+
+ printf("/%%.6g/, 31.4\n");
+ CLY_snprintf(holder, sizeof holder, "/%.6g/\n", 31.4);
+ printf("/%.6g/\n", 31.4);
+ printf("%s\n", holder);
+
+ printf("/%%.1G/, 31.4\n");
+ CLY_snprintf(holder, sizeof holder, "/%.1G/\n", 31.4);
+ printf("/%.1G/\n", 31.4);
+ printf("%s\n", holder);
+
+ printf("abc%%n\n");
+ printf("abc%n", &i); printf("%d\n", i);
+ CLY_snprintf(holder, sizeof holder, "abc%n", &i);
+ printf("%s", holder); printf("%d\n\n", i);
+
+ printf("%%*.*s --> 10.10\n");
+ CLY_snprintf(holder, sizeof holder, "%*.*s\n", 10, 10, BLURB);
+ printf("%*.*s\n", 10, 10, BLURB);
+ printf("%s\n", holder);
+
+ printf("%%%%%%%%\n");
+ CLY_snprintf(holder, sizeof holder, "%%%%\n");
+ printf("%%%%\n");
+ printf("%s\n", holder);
+
+#define BIG "Hello this is a too big string for the buffer"
+ printf("A buffer to small of 10, trying to put this:\n");
+ printf("<%%>, %s\n", BIG);
+ i = CLY_snprintf(holder, 10, "%s\n", BIG);
+ printf("<%s>\n", BIG);
+ printf("<%s>\n", holder);
+ printf("Value returned is %d\n",i);
+
+ return 0;
+}
+#endif
+
+#endif /* NEEDS_SNPRINTF */
+
diff --git a/tvision/compat/ssc_streams.cc b/tvision/compat/ssc_streams.cc
new file mode 100644
index 0000000..3de30a0
--- /dev/null
+++ b/tvision/compat/ssc_streams.cc
@@ -0,0 +1,294 @@
+#include <tv/configtv.h>
+
+#ifdef HAVE_SSC
+
+#define Uses_SSC_Streams
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_fcntl
+#define Uses_string
+#include <compatlayer.h>
+
+// Ultra dummies:
+SSC_StreamOffT SSC_streambuf::seekoff(SSC_StreamOffT , SSC_IOSSeekDir,
+ SSC_OpenModeT)
+{
+ return SSC_StreamOffT(0);
+}
+
+void SSC_streambuf::sync() {}
+
+void SSC_streambuf::sputc(char ) {}
+
+void SSC_streambuf::sputn(char *, size_t ) {}
+
+int SSC_streambuf::sbumpc() { return EOF; }
+
+size_t SSC_streambuf::sgetn(char *, size_t )
+{
+ return size_t(0);
+}
+
+SSC_filebuf::SSC_filebuf()
+{
+ opened=0;
+ fde=NULL;
+ mode=0;
+}
+
+SSC_filebuf::SSC_filebuf(int fh, SSC_OpenModeT aMode)
+{
+ mode=aMode;
+ opened=1;
+ attach(fh);
+}
+
+SSC_filebuf *SSC_filebuf::open(const char *name, SSC_OpenModeT aMode, int prot)
+{
+ //printf("Open %s\n",name);
+ mode=aMode;
+ int flags=0;
+ // Note: glibc docs lies, O_RDWR!=(O_RDONLY|O_WRONLY)
+ if (mode & SSC_ios::in)
+ {
+ if (mode & SSC_ios::out)
+ flags|=O_RDWR | O_CREAT;
+ else
+ flags|=O_RDONLY;
+ }
+ else
+ {
+ if (mode & SSC_ios::out)
+ flags|=O_WRONLY | O_CREAT;
+ }
+ if (mode & SSC_ios::trunc) flags|=O_TRUNC;
+ if (mode & SSC_ios::app) flags|=O_APPEND;
+ int fh=::open(name,flags,prot);
+ if (fh==-1)
+ {
+ //printf("Error en open\n");
+ return NULL;
+ }
+ if (mode & SSC_ios::ate)
+ lseek(fh,0,SEEK_END);
+ attach(fh);
+ return this;
+}
+
+SSC_filebuf *SSC_filebuf::attach(int fh)
+{
+ char sMode[4];
+ int index=0;
+
+ if (!mode) mode=SSC_ios::in|SSC_ios::out|SSC_ios::binary;
+
+ if (mode & SSC_ios::in)
+ sMode[index++]='r';
+ else if (mode & SSC_ios::out)
+ sMode[index++]='w';
+
+ sMode[index++]=mode & SSC_ios::binary ? 'b' : 't';
+
+ if ((mode & SSC_ios::in) && (mode & SSC_ios::out))
+ sMode[index++]='+';
+
+ sMode[index]=0;
+ fde=fdopen(fh,sMode);
+ if (fde)
+ opened=1;
+ else
+ perror("fdopen");
+ //printf("Attach %d %s %d\n",fh,sMode,opened);
+
+ return this;
+}
+
+SSC_filebuf *SSC_filebuf::close()
+{
+ if (!opened)
+ return 0;
+ opened=0;
+ if (fclose(fde)==0)
+ return this;
+ return 0;
+}
+
+SSC_streambuf *SSC_filebuf::setbuf(char *buffer, size_t len)
+{
+ if (!opened) return NULL;
+ if (setvbuf(fde,buffer,_IOFBF,len)==0)
+ return (SSC_streambuf *)1; // :-))
+ return NULL;
+}
+
+SSC_StreamOffT SSC_filebuf::seekoff(SSC_StreamOffT pos, SSC_IOSSeekDir dir,
+ SSC_OpenModeT)
+{
+ if (!opened) return SSC_StreamOffT(0);
+ fseek(fde,pos,dir);
+ return (SSC_StreamOffT)ftell(fde);
+}
+
+void SSC_filebuf::sync()
+{
+ if (opened)
+ fflush(fde);
+}
+
+void SSC_filebuf::sputc(char c)
+{
+ if (opened)
+ fputc(c,fde);
+}
+
+void SSC_filebuf::sputn(char *data, size_t cant)
+{
+ if (opened)
+ fwrite(data,cant,1,fde);
+}
+
+int SSC_filebuf::sbumpc()
+{
+ if (opened)
+ return fgetc(fde);
+ return EOF;
+}
+
+size_t SSC_filebuf::sgetn(char *data, size_t cant)
+{
+ if (opened)
+ return fread(data,1,cant,fde);
+ return size_t(0);
+}
+
+SSC_strstreambuf::SSC_strstreambuf()
+{
+ buffer=NULL;
+ tlen=length=offset=0;
+}
+
+SSC_strstreambuf::SSC_strstreambuf(void *buf, int len)
+{
+ buffer=buf;
+ tlen=length=len;
+ offset=0;
+}
+
+SSC_StreamOffT SSC_strstreambuf::seekoff(SSC_StreamOffT pos, SSC_IOSSeekDir dir,
+ SSC_OpenModeT)
+{
+ switch (dir)
+ {
+ case SSC_ios::beg:
+ if (pos>=0 && pos<=length)
+ offset=pos;
+ break;
+ case SSC_ios::cur:
+ if (pos>0)
+ {
+ if (length-offset>=pos)
+ offset+=pos;
+ }
+ else
+ {
+ if (offset>=pos)
+ offset+=pos;
+ }
+ break;
+ case SSC_ios::end:
+ if (pos<=0 && pos<=length)
+ offset=length+pos;
+ break;
+ }
+ return offset;
+}
+
+void SSC_strstreambuf::sputc(char c)
+{
+ MakeRoomFor(1);
+ char *s=(char *)buffer;
+ s[offset++]=c;
+}
+
+void SSC_strstreambuf::sputn(char *data, size_t cant)
+{
+ MakeRoomFor(cant);
+ memcpy(((char *)buffer)+offset,data,cant);
+ offset+=cant;
+}
+
+int SSC_strstreambuf::sbumpc()
+{
+ if (offset<length)
+ {
+ char *s=(char *)buffer;
+ return s[offset++];
+ }
+ return EOF;
+}
+
+size_t SSC_strstreambuf::sgetn(char *data, size_t cant)
+{
+ if (!buffer || !length)
+ return 0;
+ size_t avail=length-offset;
+ if (cant>avail)
+ cant=avail;
+ memcpy(data,((char *)buffer)+offset,cant);
+ offset+=cant;
+ return cant;
+}
+
+SSC_strstreambuf::~SSC_strstreambuf()
+{
+ free(buffer);
+}
+
+void SSC_strstreambuf::MakeRoomFor(size_t bytes)
+{
+ size_t avail=length-offset;
+ if (avail>=bytes)
+ return;
+ size_t tavail=tlen-offset;
+ if (tavail>=bytes)
+ {
+ length=offset+bytes;
+ return;
+ }
+ tlen=bytes+offset+4096;
+ buffer=realloc(buffer,tlen);
+ if (!buffer)
+ abort();
+ length=offset+bytes;
+}
+
+#ifdef TEST
+// g++ -DTEST -o /tmp/test -I../include ssc_streams.cc
+
+int main(int argc, char *argv[])
+{
+ CLY_filebuf pp;
+ pp.open("test.txt",CLY_IOSIn | CLY_IOSOut | CLY_IOSBin,0644);
+ pp.sputn("Hola\n",5);
+ pp.pubseekoff(0,CLY_IOSBeg);
+ char buf[6+5];
+ pp.sgetn(buf,5);
+ buf[5]=0;
+ printf("%s\n",buf);
+
+ printf("----- strbase test\n");
+ CLY_strstreambuf pp2;
+ pp2.sputn("Hola\n",5);
+ pp2.sputn("Chau\n",5);
+ pp2.pubseekoff(0,CLY_IOSBeg);
+ pp2.sgetn(buf,5+5);
+ buf[5+5]=0;
+ printf("%s",buf);
+
+ return 0;
+}
+#endif
+
+#endif
+
diff --git a/tvision/compat/strlwr.c b/tvision/compat/strlwr.c
new file mode 100644
index 0000000..73996ad
--- /dev/null
+++ b/tvision/compat/strlwr.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#include <cl/needs.h>
+#ifdef NEEDS_STRLWR
+#include <ctype.h>
+
+char *strlwr(char *_s)
+{
+ char *rv = _s;
+ while (*_s)
+ {
+ *_s = tolower((unsigned char)*_s);
+ _s++;
+ }
+ return rv;
+}
+#endif
diff --git a/tvision/compat/strupr.c b/tvision/compat/strupr.c
new file mode 100644
index 0000000..a36538c
--- /dev/null
+++ b/tvision/compat/strupr.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#include <cl/needs.h>
+#ifdef NEEDS_STRUPR
+#include <ctype.h>
+
+char *strupr(char *_s)
+{
+ char *rv = _s;
+ while (*_s)
+ {
+ *_s = toupper((unsigned char)*_s);
+ _s++;
+ }
+ return rv;
+}
+#endif
diff --git a/tvision/compat/ticks.c b/tvision/compat/ticks.c
new file mode 100644
index 0000000..1861406
--- /dev/null
+++ b/tvision/compat/ticks.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1996-1998 Robert H”hne */
+/* Modified by Salvador E. Tropea, Vadim Bolodorov and Anatoli Soltan */
+#include <tv/configtv.h>
+
+#ifdef TVCompf_djgpp
+#include <sys/farptr.h>
+#include <go32.h>
+
+unsigned short CLY_Ticks(void)
+{
+ return _farpeekw(_dos_ds,0x46c);
+}
+#endif // DJGPP
+
+
+
+#ifdef TVOS_Win32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h> //for GetTickCount
+
+unsigned short CLY_Ticks(void)
+{
+ // X ms * 1s/1000ms * 18.2 ticks/s = X/55 ticks, roughly.
+ return GetTickCount() / 55;
+}
+#endif // Win32
+
+
+
+#ifdef TVOS_UNIX
+#include <sys/time.h>
+#include <stdio.h> /* for NULL */
+
+unsigned short CLY_Ticks(void)
+{
+ struct timeval val;
+ gettimeofday(&val,(struct timezone *)NULL);
+ return (val.tv_sec*18 + (val.tv_usec*18)/1000000);
+// return clock();
+}
+#endif
+
diff --git a/tvision/compat/unc.c b/tvision/compat/unc.c
new file mode 100644
index 0000000..ade318f
--- /dev/null
+++ b/tvision/compat/unc.c
@@ -0,0 +1,96 @@
+/*
+ Copyright (c) 2000 by Anatoli Soltan.
+ Covered by the GPL license.
+*/
+#include <cl/needs.h>
+
+#ifdef NEEDS_UNC
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <malloc.h>
+
+#if (__MINGW32_MAJOR_VERSION>=2) && !defined(alloca)
+ #define alloca __builtin_alloca
+#endif
+
+int CLY_isUNC_helper_NT(const char* server, const char* share);
+int CLY_isUNC_helper_95(const char* server, const char* share);
+
+#define is_slash(c) (c == '/' || c == '\\')
+#define is_term(c) (c == '/' || c == '\\' || c == '\0')
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns 1 if passed path looks like an UNC name. That is it starts with
+//server.
+
+ Return: 1 if UNC
+
+***************************************************************************/
+
+int CLY_IsUNC(const char* path)
+{
+ if (!is_slash(path[0]) || !is_slash(path[1]) || is_term(path[2]))
+ return 0;
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns 1 if passed path refers to a network share. That is the path
+matches //server/share[/[.]] mask and the share really exists.
+
+ Return: 1 if that's an existing share.
+
+***************************************************************************/
+
+int CLY_IsUNCShare(const char* path)
+{
+ static int nt = -1;
+ char* path2 = (char*)alloca(strlen(path) + 1);
+ char* p;
+ const char *server, *share;
+
+ strcpy(path2, path);
+
+ if (!CLY_IsUNC(path2))
+ return 0;
+ server = path2 + 2;
+ p = strchr(server, '/');
+ if (!p)
+ p = strchr(server, '\\');
+ if (!p)
+ return 0;
+ if (p[1] == '\0')
+ return 0;
+ *p = '\0';
+
+ share = p + 1;
+ p = strchr(share, '/');
+ if (!p)
+ p = strchr(share, '\\');
+ if (!p || p[1] == '\0' || (p[1] == '.' && p[2] == '\0'))
+ {
+ int ret;
+ if (p) *p = '\0';
+ if (nt == -1 || nt == 1)
+ {
+ ret = CLY_isUNC_helper_NT(server, share);
+ nt = !(ret == -1);
+ }
+ if (nt == 0)
+ {
+ ret = CLY_isUNC_helper_95(server, share);
+ if (ret == -1) nt = -1, ret = 0;
+ }
+ return ret;
+ }
+
+ return 0;
+}
+#endif // NEEDS_UNC
+
+/* vi: set ts=8 sw=2 : */
+
diff --git a/tvision/compat/unc_95.c b/tvision/compat/unc_95.c
new file mode 100644
index 0000000..f8041a1
--- /dev/null
+++ b/tvision/compat/unc_95.c
@@ -0,0 +1,112 @@
+/*
+ Copyright (c) 2000 by Anatoli Soltan.
+ Covered by the GPL license.
+*/
+#include <cl/needs.h>
+
+#ifdef NEEDS_UNC
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <svrapi.h>
+#include <malloc.h>
+#include <string.h>
+
+#if (__MINGW32_MAJOR_VERSION>=2) && !defined(alloca)
+ #define alloca __builtin_alloca
+#endif
+
+#if _MSC_VER >= 1400
+ #undef strupr
+ #define strupr(a) _strupr(a)
+#endif
+
+static HMODULE hLib;
+static API_RET_TYPE
+(APIENTRY *pNetShareGetInfo) (
+ const char FAR * pszServer,
+ const char FAR * pszNetName,
+ short sLevel,
+ char FAR * pbBuffer,
+ unsigned short cbBuffer,
+ unsigned short FAR * pcbTotalAvail
+ );
+
+/**[txh]********************************************************************
+
+ Description:
+ Internal helper to validate an UNC for Win9x/Me.
+
+ Return: 1 if that's an existing share.
+
+***************************************************************************/
+
+int CLY_isUNC_helper_95(const char* server, const char* share)
+{
+ struct share_info_1* pshi1;
+ struct share_info_50* pshi50;
+ NET_API_STATUS status;
+ short level;
+ unsigned short cbTotalAvail;
+ int ret;
+ char *userver, *ushare;
+
+ /*
+ * Win95 wants server name to be prefixed by two slashes and share
+ * name to be uppercased.
+ */
+ userver = alloca(strlen(server) + 3);
+ ushare = alloca(strlen(share) + 1);
+ userver[0] = '/';
+ userver[1] = '/';
+ strcpy(userver + 2, server);
+ strcpy(ushare, share);
+ strupr(ushare);
+
+ if (!hLib)
+ {
+ hLib = LoadLibrary(TEXT("SVRAPI.DLL"));
+ if (!hLib)
+ {
+ ret = -1;
+ goto clean;
+ }
+ }
+ if (!pNetShareGetInfo)
+ {
+ pNetShareGetInfo = (void*)GetProcAddress(hLib, "NetShareGetInfo");
+ if (!pNetShareGetInfo)
+ {
+ ret = -1;
+ goto clean;
+ }
+ }
+
+ level = 50;
+ status = (*pNetShareGetInfo)(userver, ushare, level, NULL, 0, &cbTotalAvail);
+ if (status == ERROR_INVALID_LEVEL)
+ {
+ level = 1;
+ status = (*pNetShareGetInfo)(userver, ushare, level, NULL, 0, &cbTotalAvail);
+ }
+ if (status != NERR_BufTooSmall)
+ return 0;
+
+ pshi1 = (struct share_info_1 *)malloc(cbTotalAvail);
+ pshi50 = (struct share_info_50 *)pshi1;
+ status = (*pNetShareGetInfo)(userver, ushare, level, (char*)pshi1, cbTotalAvail, &cbTotalAvail);
+ ret = (status == 0) &&
+ ((level == 1 ? pshi1->shi1_type : pshi50->shi50_type) == STYPE_DISKTREE);
+ free(pshi1);
+ return ret;
+
+clean:
+ if (hLib)
+ {
+ FreeLibrary(hLib);
+ hLib = NULL;
+ pNetShareGetInfo = NULL;
+ }
+ return ret;
+}
+#endif // NEEDS_UNC
+
diff --git a/tvision/compat/unc_nt.c b/tvision/compat/unc_nt.c
new file mode 100644
index 0000000..c3842af
--- /dev/null
+++ b/tvision/compat/unc_nt.c
@@ -0,0 +1,109 @@
+/*
+ Copyright (c) 2000 by Anatoli Soltan.
+ Covered by the GPL license.
+*/
+#include <cl/needs.h>
+
+#ifdef NEEDS_UNC
+#define WIN32_LEAN_AND_MEAN
+/* UNICODE must be defined because all Net APIs on WinNT are UNICODE */
+#define UNICODE
+#include <windows.h>
+#include <lmcons.h>
+#include <lmshare.h>
+#include <lmapibuf.h>
+#include <malloc.h>
+
+#if (__MINGW32_MAJOR_VERSION>=2) && !defined(alloca)
+ #define alloca __builtin_alloca
+#endif
+
+static HMODULE hLib;
+static NET_API_STATUS
+(NET_API_FUNCTION *pNetShareGetInfo) (
+ IN LPTSTR servername,
+ IN LPTSTR netname,
+ IN DWORD level,
+ OUT LPBYTE *bufptr
+ );
+static NET_API_STATUS
+(NET_API_FUNCTION *pNetApiBufferFree) (
+ IN LPVOID Buffer
+ );
+
+/**[txh]********************************************************************
+
+ Description:
+ Internal helper to validate an UNC for Win NT (2k, XP, etc.).
+
+ Return: 1 if that's an existing share.
+
+***************************************************************************/
+
+int CLY_isUNC_helper_NT(const char* server, const char* share)
+{
+ SHARE_INFO_1* pshi;
+ NET_API_STATUS status;
+ int serverlen, sharelen;
+ WCHAR *wserver, *wshare;
+ int ret;
+
+ if (!hLib)
+ {
+ hLib = LoadLibraryA("NETAPI32.DLL");
+ if (!hLib)
+ {
+ ret = -1;
+ goto clean;
+ }
+ }
+ if (!pNetShareGetInfo)
+ {
+ pNetShareGetInfo = (void*)GetProcAddress(hLib, "NetShareGetInfo");
+ if (!pNetShareGetInfo)
+ {
+ ret = -1;
+ goto clean;
+ }
+ }
+ if (!pNetApiBufferFree)
+ {
+ pNetApiBufferFree = (void*)GetProcAddress(hLib, "NetApiBufferFree");
+ if (!pNetApiBufferFree)
+ {
+ ret = -1;
+ goto clean;
+ }
+ }
+
+ serverlen = strlen(server);
+ sharelen = strlen(share);
+ wserver = (WCHAR*)alloca((serverlen + 1) * sizeof(WCHAR));
+ wshare = (WCHAR*)alloca((sharelen + 1) * sizeof(WCHAR));
+
+ MultiByteToWideChar(CP_ACP, 0, server, serverlen, wserver, serverlen);
+ MultiByteToWideChar(CP_ACP, 0, share, sharelen, wshare, sharelen);
+ wserver[serverlen] = 0;
+ wshare[sharelen] = 0;
+
+ status = (*pNetShareGetInfo)(wserver, wshare, 1, (LPBYTE*)&pshi);
+ if (status == ERROR_CALL_NOT_IMPLEMENTED)
+ {
+ ret = -1;
+ goto clean;
+ }
+ ret = (status == 0) && (pshi->shi1_type == STYPE_DISKTREE);
+ (*pNetApiBufferFree)(pshi);
+ return ret;
+
+clean:
+ if (hLib)
+ {
+ FreeLibrary(hLib);
+ hLib = NULL;
+ pNetShareGetInfo = NULL;
+ pNetApiBufferFree = NULL;
+ }
+ return ret;
+}
+#endif
diff --git a/tvision/compat/validfilename.c b/tvision/compat/validfilename.c
new file mode 100644
index 0000000..7704c97
--- /dev/null
+++ b/tvision/compat/validfilename.c
@@ -0,0 +1,51 @@
+/*
+ Copyright (C) 1996-1998 Robert H”hne
+ Copyright (C) 2000 Vadim Beloborodov
+ Copyright (C) 2000 Anatoli Soltan
+ Copyright (C) 2000 Salvador E. Tropea
+ Covered by the GPL license.
+*/
+
+#define Uses_string
+#include <compatlayer.h>
+
+#ifdef TVCompf_djgpp
+#include <fcntl.h>
+static const char * const IllegalChars1 = ";,=+<>|\"[]/";
+static const char * const IllegalChars2 = "<>|/\"";
+
+inline static
+const char *GetInvalidChars(const char *fileName)
+{
+ // SET: Added a check for LFNs, in LFN drives ;,[]=+ are valid
+ if (_use_lfn(fileName))
+ return IllegalChars2;
+ return IllegalChars1;
+}
+#else
+static const char * const IllegalChars = "<>|/\"";
+
+static
+const char *GetInvalidChars(const char *unused)
+{
+ if (unused) unused=0;
+ return IllegalChars;
+}
+#endif
+
+int CLY_ValidFileName(const char *fileName)
+{
+ static const char * illegalChars;
+ const char *slash=strrchr(fileName,DIRSEPARATOR);
+
+ illegalChars=GetInvalidChars(fileName);
+ if (!slash)
+ {
+ if (strpbrk(fileName,illegalChars) != 0)
+ return 0;
+ return 1;
+ }
+ if (strpbrk(slash+1,illegalChars) != 0)
+ return 0;
+ return CLY_PathValid(fileName);
+}
diff --git a/tvision/compat/yieldpro.c b/tvision/compat/yieldpro.c
new file mode 100644
index 0000000..91c2bb0
--- /dev/null
+++ b/tvision/compat/yieldpro.c
@@ -0,0 +1,75 @@
+#include <tv/configtv.h>
+
+#ifdef TVCompf_djgpp
+#include <dpmi.h>
+#include <unistd.h>
+
+void CLY_YieldProcessor(int micros)
+{
+ __dpmi_yield();
+ if (micros>0)
+ usleep(micros);
+}
+#endif
+
+#if defined(TVOSf_QNX4)
+ #include <time.h>
+
+ static void usleep(unsigned long sleeptime)
+ {
+ struct timespec wait;
+
+ wait.tv_sec=0;
+ wait.tv_nsec=sleeptime;
+
+ do {
+ if (nanosleep(&wait, &wait)==0)
+ {
+ break;
+ }
+ } while(1);
+ }
+#endif // TVOSf_QNX4
+
+#ifdef TVOS_UNIX
+#include <unistd.h>
+ // See if this system have the POSIX function
+ #if 0 //def _POSIX_PRIORITY_SCHEDULING
+ #include <sched.h>
+
+ void CLY_YieldProcessor(int micros)
+ {
+ sched_yield();
+ if (micros>0)
+ usleep(micros);
+ }
+ #else
+ // No POSIX, just sleep
+ void CLY_YieldProcessor(int micros)
+ {
+ if (micros<0)
+ micros=10000; // 10 ms
+ usleep(micros);
+ }
+ #endif
+#endif
+
+#ifdef TVComp_BCPP //TVOSf_NT
+void CLY_YieldProcessor(int micros)
+{
+ extern void __tvWin32Yield(int micros);
+ if (micros<0)
+ micros=27472; // 1000000 / (18.2 * 2)
+ __tvWin32Yield(micros);
+}
+#endif
+
+#if defined(TVOS_Win32) && !defined(TVComp_BCPP) //!defined(TVOSf_NT)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+void CLY_YieldProcessor(int micros)
+{
+ Sleep(micros/1000);
+}
+#endif
diff --git a/tvision/config.pl b/tvision/config.pl
new file mode 100644
index 0000000..c3a7444
--- /dev/null
+++ b/tvision/config.pl
@@ -0,0 +1,1355 @@
+#!/usr/bin/perl
+# Copyright (C) 1999-2009 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# To specify the compilation flags define the CFLAGS environment variable.
+#
+
+require "miscperl.pl";
+require "conflib.pl";
+
+# If the script is newer discard the cache.
+#GetCache() unless (-M 'config.pl' < -M 'configure.cache');
+GetVersion('');
+
+# I never tested with an older version, you can try reducing it.
+$GPMVersionNeeded='1.10';
+# I never tested with an older version, you can try reducing it.
+#$NCursesVersionNeeded='1.9.9';
+# That's a test to see if that works:
+$NCursesVersionNeeded='1.8.6';
+$DJGPPVersionNeeded='2.0.2';
+$AllegroVersionNeeded='4';
+unlink $ErrorLog;
+$UseDummyIntl=0;
+
+SeeCommandLine();
+
+if ($JustSpec)
+ {
+ UpdateSpec();
+ exit 0;
+ }
+
+print "Configuring Turbo Vision v$Version library\n\n";
+# Determine the OS
+$OS=DetectOS();
+# Test for a working gcc
+$GCC=CheckGCC();
+# Determine C flags
+$CFLAGS=FindCFLAGS();
+# Determine C++ flags
+$CXXFLAGS=FindCXXFLAGS();
+# Extra lib directories
+$LDExtraDirs=FindLDExtraDirs();
+# Check if gcc can compile C++
+$GXX=CheckGXX();
+# Which architecture are we using?
+DetectCPU();
+# 32 or 64 bits pointers?
+DetectPointersSize();
+# Some platforms aren't easy to detect until we can compile.
+DetectOS2();
+# The prefix can be better determined if we know all the rest
+# about the environment
+LookForPrefix();
+# Only gnu make have the command line and commands we use.
+LookForGNUMake();
+# Same for ar, it could be `gar'
+$GAR=LookForGNUar();
+# Similar for install tool.
+LookForGNUinstall();
+# Look for xgettext
+LookForGettextTools();
+# Is the right djgpp?
+if ($OS eq 'DOS')
+ {
+ LookForDJGPP($DJGPPVersionNeeded);
+ }
+
+if ($OS eq 'UNIX')
+ {
+ LookForGPM($GPMVersionNeeded);
+ LookForNCurses($NCursesVersionNeeded);
+ LookForKeysyms();
+ LookForXlib();
+ # Used for X11 driver. Linux implementation of POSIX threads is very bad
+ # and needs a lot of workarounds. Some of them could be just bugs in the
+ # glibc I use but the fact is that the needed tricks make it very Linux
+ # dependent.
+ LookForPThread() if $OSf eq 'Linux';
+ LookForOutB();
+ }
+if ($Compf eq 'Cygwin')
+ {# Cygwin incorporates a XFree86 port
+ LookForXlib();
+ }
+LookForIntlSupport();
+LookForAllegro($AllegroVersionNeeded);
+LookForEndianess();
+LookForMaintainerTools() if $conf{'MAINTAINER_MODE'} eq 'yes';
+
+print "\n";
+GenerateMakefile();
+#
+# For the examples
+#
+$here=RunRedirect('pwd',$ErrorLog);
+chop($here);
+if (!$here && ($OS ne 'UNIX'))
+ {# command.com, cmd.exe, etc. have it.
+ $here=`cd`;
+ chop($here);
+ }
+if ($Compf eq 'MinGW')
+ {
+ $here=~s/\\/\//g;
+ }
+$realPrefix=@conf{'real-prefix'};
+$realPrefix=@conf{'prefix'} unless $realPrefix;
+# Path for the includes, used for examples
+$MakeDefsRHIDE[1]='TVSRC=../../include ';
+$MakeDefsRHIDE[1].=$here.'/include ' unless $conf{'libs-here'} eq 'no';
+$MakeDefsRHIDE[1].=$realPrefix.'/include/rhtvision';
+$MakeDefsRHIDE[1].=' '.$conf{'X11IncludePath'} if (@conf{'HAVE_X11'} eq 'yes');
+# Path reported by rhtv-config --include
+$MakeDefsRHIDE[11]='INCLUDE='.$realPrefix.'/include/rhtvision';
+$MakeDefsRHIDE[11].=' '.$conf{'X11IncludePath'} if (@conf{'HAVE_X11'} eq 'yes');
+# Extra path for the includes, used for the library
+$MakeDefsRHIDE[9]='EXTRA_INCLUDE_DIRS='.$conf{'EXTRA_INCLUDE_DIRS'};
+$MakeDefsRHIDE[7]='RHIDE_LIBS=';
+# Libraries needed
+$MakeDefsRHIDE[2]='RHIDE_OS_LIBS=';
+# RHIDE doesn't know about anything different than DJGPP and Linux so -lstdc++ must
+# be added for things like FreeBSD or SunOS. But not for QNX.
+$MakeDefsRHIDE[2].=substr($stdcxx,2); # unless (($OS eq 'DOS') || ($OSf eq 'Linux') || ($OSf eq 'QNXRtP'));
+# Linux, Solaris and FreeBSD have gettext in its C library.
+$OSUSesIntl=!(($OSf eq 'Linux') || ($OSf eq 'Solaris') || ($OSf eq 'FreeBSD'));
+if ($OSUSesIntl)
+ {
+ if ((@conf{'intl-force-dummy'} ne 'yes') && (@conf{'intl'} eq 'yes'))
+ {
+ $MakeDefsRHIDE[2].=' intl';
+ }
+ else
+ {# Use the dummy unless the user requested not to use it
+ if ((@conf{'intl-force-dummy'} eq 'yes') || (@conf{'no-intl'} ne 'yes'))
+ {
+ $MakeDefsRHIDE[2].=' tvfintl';
+ $UseDummyIntl=1;
+ }
+ }
+ }
+$MakeDefsRHIDE[2].=' iconv' if (@conf{'iconv'} eq 'yes') && !$UseDummyIntl;
+$MakeDefsRHIDE[2].=' '.$conf{'NameCurses'} if ($conf{'ncurses'} ne 'no') && ($OS eq 'UNIX');
+$MakeDefsRHIDE[2].=' m' if ($OS eq 'UNIX');
+$MakeDefsRHIDE[2].=' gpm' if @conf{'HAVE_GPM'} eq 'yes';
+$MakeDefsRHIDE[2].=' '.$conf{'X11Lib'} if ($conf{'HAVE_X11'} eq 'yes');
+$MakeDefsRHIDE[2].=' mss' if @conf{'mss'} eq 'yes';
+$MakeDefsRHIDE[2].=' intl' if ((($OSf eq 'FreeBSD') || ($OSf eq 'QNXRtP')) && ($conf{'intl'} eq 'yes'));
+$MakeDefsRHIDE[2].=' pthread' if $conf{'HAVE_LINUX_PTHREAD'} eq 'yes';
+$MakeDefsRHIDE[2].=' termlib unix' if ($OSf eq 'QNX4');
+if ($conf{'HAVE_ALLEGRO'} eq 'yes')
+ {
+ $aux=`allegro-config --libs`;
+ $a1=$aux;
+ $aux=~s/\-L(\S+)//g;
+ $AllegroLibs=$aux;
+ $aux=~s/\-l//g;
+ $MakeDefsRHIDE[2].=" $aux";
+ $aux=$a1;
+ $aux=~s/\-l(\S+)//g;
+ $aux=~s/\-L//g;
+ $AllegroPath=$aux;
+ }
+if ($OS eq 'UNIX')
+ {
+ $MakeDefsRHIDE[0]='RHIDE_STDINC=/usr/include /usr/local/include /usr/include/g++ /usr/local/include/g++ /usr/lib/gcc-lib /usr/local/lib/gcc-lib';
+ if (@conf{'HAVE_X11'} eq 'yes')
+ {
+ $aux=$conf{'X11IncludePath'} ? ' '.$conf{'X11IncludePath'} : ' /usr/X11R6/include';
+ $MakeDefsRHIDE[0].=$aux;
+ $MakeDefsRHIDE[9].=$aux;
+ }
+ $MakeDefsRHIDE[3]='TVOBJ='.$LDExtraDirs.' ';
+ # QNX 6.2 beta 3 workaround
+ $MakeDefsRHIDE[3].='/lib ' if ($OSf eq 'QNXRtP');
+ # Link with installed libraries
+ $MakeDefsRHIDE[3].=$realPrefix.'/lib ';
+ $MakeDefsRHIDE[3].='../../makes ';
+ $MakeDefsRHIDE[3].=$here.'/makes ' unless $conf{'libs-here'} eq 'no';
+ $MakeDefsRHIDE[3].='../../intl/dummy ' if $UseDummyIntl;
+ $MakeDefsRHIDE[3].=$conf{'X11LibPath'}.' ' if ($conf{'HAVE_X11'} eq 'yes');
+ $MakeDefsRHIDE[3].=$AllegroPath.' ' if $conf{'HAVE_ALLEGRO'} eq 'yes';
+ }
+elsif ($OS eq 'DOS')
+ {
+ $MakeDefsRHIDE[0]='RHIDE_STDINC=$(DJDIR)/include $(DJDIR)/lang/cxx $(DJDIR)/lib/gcc-lib';
+ # DJGPP's gcc includes djgpp.ver from the same directory where specs
+ $a=`redir -eo $GCC -v`;
+ if ($a=~/(\w:)(.*)\/specs/i)
+ {
+ $here=RunRedirect('pwd',$ErrorLog);
+ chop($here);
+ chdir("$1$2");
+ $a=RunRedirect('pwd',$ErrorLog);
+ chop($a);
+ chdir($here);
+ $MakeDefsRHIDE[0].=" $a"
+ }
+ $MakeDefsRHIDE[3]='TVOBJ=../../makes ';
+ $MakeDefsRHIDE[3].=$here.'/makes ' unless $conf{'libs-here'} eq 'no';
+ $MakeDefsRHIDE[3].=$realPrefix.'/lib '.$LDExtraDirs;
+ $MakeDefsRHIDE[3].=' ../../intl/dummy' if $UseDummyIntl;
+ $MakeDefsRHIDE[3].=$AllegroPath.' ' if $conf{'HAVE_ALLEGRO'} eq 'yes';
+ }
+elsif ($OS eq 'Win32')
+ {
+ $MakeDefsRHIDE[0]='RHIDE_STDINC=';
+ $MakeDefsRHIDE[2].=' gdi32'; # Needed for WinGr driver
+ $MakeDefsRHIDE[3]='TVOBJ=../../makes ';
+ $MakeDefsRHIDE[3].=$here.'/makes ' unless $conf{'libs-here'} eq 'no';
+ $MakeDefsRHIDE[3].=$realPrefix.'/lib '.$LDExtraDirs;
+ $MakeDefsRHIDE[3].=' ../../intl/dummy' if $UseDummyIntl;
+ $MakeDefsRHIDE[3].=' '.$conf{'X11LibPath'} if ($conf{'HAVE_X11'} eq 'yes');
+ $MakeDefsRHIDE[3].=$AllegroPath.' ' if $conf{'HAVE_ALLEGRO'} eq 'yes';
+ }
+$MakeDefsRHIDE[4]='STDCPP_LIB='.$stdcxx;
+# C options for dynamic lib
+if ($OSf ne 'Darwin')
+ {
+ $MakeDefsRHIDE[5]='SHARED_CODE_OPTION=-fPIC';
+ $MakeDefsRHIDE[5].=' -shared' if ($OSf eq 'QNXRtP');
+ }
+else
+ {# PPC code is always position independent
+ # However, the linker doesn't allow "common" symbols in shared libraries.
+ $MakeDefsRHIDE[5]='SHARED_CODE_OPTION=-fno-common';
+ }
+# Flags to link as a dynamic lib
+$ldflags1='RHIDE_LDFLAGS=';
+$ldflags2=$ldflags1;
+if ($OS eq 'UNIX')
+ {
+ if ($OSf ne 'Darwin')
+ {
+ $soname='-soname';
+ if ($OSf eq 'Solaris')
+ {
+ system("$GCC -v 2> test.ld");
+ $test=cat('test.ld');
+ unlink 'test.ld';
+ # Why?! I think gcc should translate it when using the native ld.
+ $soname='-h' if $test=~'ccs/bin/ld';
+ }
+ $ldflags1.='-L/lib' if ($OSf eq 'QNXRtP');
+ $ldflags1.=' -shared -Wl,'.$soname.',librhtv.so.'.$Version;
+ }
+ else
+ {# Darwin semantic for dynamic libs is quite different
+ $ldflags1.='-dynamiclib -install_name '.$realPrefix.'/lib/librhtv.'.$Version.'.dylib';
+ $ldflags1.=' -compatibility_version '.$Version.' -current_version '.$Version;
+ }
+ $libs=$conf{'X11Lib'};
+ $libs=~s/(\S+)/-l$1/g;
+ $aux='';
+ $aux.=" -L".$conf{'X11LibPath'}." $libs" if @conf{'HAVE_X11'} eq 'yes';
+ $aux.=' -lgpm' if @conf{'HAVE_GPM'} eq 'yes';
+ $aux.=(($OSf eq 'QNXRtP') ? ' -lncursesS' : ' -lncurses') unless $conf{'ncurses'} eq 'no';
+ $aux.=" $stdcxx -lm -lc";
+ $aux.=' -lpthread' if $conf{'HAVE_LINUX_PTHREAD'} eq 'yes';
+ $aux.=' '.$AllegroLibs if ($conf{'HAVE_ALLEGRO'} eq 'yes');
+ $aux.=' libtvfintl.a' if ($OSf eq 'Darwin') && $UseDummyIntl;
+ $MakeDefsRHIDE[7].=$aux;
+ }
+
+$MakeDefsRHIDE[8]="LIB_VER=$Version";
+$MakeDefsRHIDE[10]="LIB_VER_MAJOR=$VersionMajor";
+
+ModifyMakefiles('intl/dummy/Makefile');
+$MakeDefsRHIDE[6]=$ldflags1;
+CreateRHIDEenvs('makes/rhide.env','compat/rhide.env');
+$MakeDefsRHIDE[6]=$ldflags2;
+CreateRHIDEenvs('examples/rhide.env');
+
+# Repeated later for other targets
+CreateConfigH();
+
+# Help BC++ target
+system("perl confignt.pl");
+
+#
+# Adjust .mak files
+#
+print "Makefiles for examples.\n";
+chdir('examples');
+`perl patchenv.pl`;
+chdir('..');
+
+print "Makefiles for translations.\n";
+ReplaceText('intl/gnumake.in','intl/Makefile');
+UpdateSpec();
+
+print "\nSuccesful configuration!\n\n";
+
+GiveAdvice();
+CreateCache();
+unlink $ErrorLog;
+unlink 'test.exe';
+
+sub UpdateSpec()
+{
+ $ReplaceTags{'version'}=$Version;
+ ReplaceText('redhat/librhtv.spec.in',"redhat/librhtv-$Version.spec");
+ ReplaceText('qnxrtp/tvision.qpg.in',"qnxrtp/tvision.qpg");
+}
+
+sub SeeCommandLine
+{
+ my $i;
+
+ foreach $i (@ARGV)
+ {
+ if ($i eq '--help')
+ {
+ ShowHelp();
+ die "\n";
+ }
+ elsif ($i=~'--prefix=(.*)')
+ {
+ $conf{'prefix'}=$1;
+ }
+ elsif ($i=~'--real-prefix=(.*)')
+ {
+ $conf{'real-prefix'}=$1;
+ }
+ elsif ($i eq '--no-intl')
+ {
+ $conf{'no-intl'}='yes';
+ }
+ elsif ($i eq '--force-dummy')
+ {
+ $conf{'intl-force-dummy'}='yes';
+ }
+ elsif ($i=~'--cflags=(.*)')
+ {
+ @conf{'CFLAGS'}=$1;
+ }
+ elsif ($i=~'--cxxflags=(.*)')
+ {
+ @conf{'CXXFLAGS'}=$1;
+ }
+ elsif ($i eq '--fhs')
+ {
+ $conf{'fhs'}='yes';
+ }
+ elsif ($i eq '--no-fhs')
+ {
+ $conf{'fhs'}='no';
+ }
+ elsif ($i=~'--X11lib=(.*)')
+ {
+ $conf{'X11Lib'}=$1;
+ }
+ elsif ($i eq '--with-mss')
+ {
+ $conf{'mss'}='yes';
+ }
+ elsif ($i eq '--without-mss')
+ {
+ $conf{'mss'}='no';
+ }
+ elsif ($i=~'--x-include=(.*)')
+ {
+ $conf{'X11IncludePath'}=$1;
+ }
+ elsif ($i=~'--x-lib=(.*)')
+ {
+ $conf{'X11LibPath'}=$1;
+ }
+ elsif ($i eq '--with-debug')
+ {
+ $conf{'debugInfo'}='yes';
+ }
+ elsif ($i eq '--without-debug')
+ {
+ $conf{'debugInfo'}='no';
+ }
+ elsif ($i eq '--with-ssc')
+ {
+ $conf{'HAVE_SSC'}='yes';
+ }
+ elsif ($i eq '--without-ssc')
+ {
+ $conf{'HAVE_SSC'}='no';
+ }
+ elsif ($i eq '--no-libs-here')
+ {
+ $conf{'libs-here'}='no';
+ }
+ elsif ($i eq '--enable-maintainer-mode')
+ {
+ $conf{'MAINTAINER_MODE'}='yes';
+ }
+ elsif ($i eq '--just-spec')
+ {
+ $JustSpec=1;
+ }
+ elsif ($i eq '--with-pthread')
+ {
+ $conf{'try-pthread'}='yes';
+ }
+ elsif ($i eq '--without-pthread')
+ {
+ $conf{'try-pthread'}='no';
+ }
+ elsif ($i eq '--without-static')
+ {
+ $conf{'no-static'}='yes';
+ }
+ elsif ($i eq '--without-dynamic')
+ {
+ $conf{'no-dynamic'}='yes';
+ }
+ elsif ($i eq '--unsafe-memcpy')
+ {
+ $conf{'HAVE_UNSAFE_MEMCPY'}='yes';
+ }
+ elsif ($i eq '--safe-memcpy')
+ {
+ $conf{'HAVE_UNSAFE_MEMCPY'}='no';
+ }
+ elsif ($i=~'--include=(.*)')
+ {
+ $conf{'EXTRA_INCLUDE_DIRS'}.=" $1";
+ }
+ elsif ($i eq '--debug')
+ {
+ $conf{'CFLAGS'}=
+ $conf{'CXXFLAGS'}='-O2 -Wall -Werror -gstabs+3';
+ }
+ # For compatibility with autoconf:
+ # LinCS/tiger - ignore some autoconf generated params
+ elsif (($i=~'--cache-file=(.*)') || ($i=~'--srcdir=(.*)') || ($i=~'--enable-ltdl-convenience'))
+ {
+ }
+ else
+ {
+ ShowHelp();
+ die "Unknown option: $i\n";
+ }
+ }
+}
+
+sub ShowHelp
+{
+ print "Available options:\n\n";
+ print "Flags:\n";
+ print "--cflags=val : normal C flags [default is env. CFLAGS].\n";
+ print "--cxxflags=val : normal C++ flags [default is env. CXXFLAGS].\n";
+ print "--debug : selects C/C++ switches for debugging\n";
+
+ print "\nPaths and library names:\n";
+ print "--x-include=path: X11 include path [/usr/X11R6/lib].\n";
+ print "--x-lib=path : X11 library path [/usr/X11R6/include].\n";
+ print "--X11lib=val : Name of X11 libraries [default is X11 Xmu].\n";
+ print "--include=path : Add this path for includes. Repeat for each dir.\n";
+ print "--no-libs-here : Don't use the sources path for libs.\n";
+
+ print "\nIntallation:\n";
+ print "--prefix=path : defines the base directory for installation.\n";
+ print "--fhs : force the FHS layout under UNIX.\n";
+ print "--no-fhs : force to not use the FHS layout under UNIX.\n";
+ print "--with-debug : install dynamic library without running strip.\n";
+ print "--without-debug : run strip to reduce the size [default]\n";
+ print "--real-prefix=pa: real prefix, for Debian package\n";
+
+ print "\nLibraries:\n";
+ print "--force-dummy : use the dummy intl library even when gettext is detected.\n";
+ print "--no-intl : don't use international support.\n";
+ print "--without-static : don't create the static library.\n";
+ print "--without-dynamic: don't create the dynamic library.\n";
+ print "--with-mss : compiles with MSS memory debugger.\n";
+ print "--without-mss : compiles without MSS [default].\n";
+ print "--with-ssc : compiles using Simple Streams Compatibility.\n";
+ print "--without-ssc : compiles without SSC [default].\n";
+ print "--with-pthread : uses pthread for X11 driver.\n";
+ print "--without-pthread: avoids pthread for X11 driver [default].\n";
+
+ print "\nOthers:\n";
+ print "--enable-maintainer-mode:\n";
+ print " : enables header dependencies and other stuff needed\n";
+ print " for developement, not just use the editor.\n";
+ print "--just-spec : update RPMs spec file and exit.\n";
+ print "--unsafe-memcpy : disable the use of memcpy when memory overlaps\n";
+ print "--help : displays this text.\n";
+}
+
+sub GiveAdvice
+{
+ if ((@conf{'intl'} eq 'no') && (@conf{'no-intl'} ne 'yes'))
+ {
+ print "\n";
+ print "* The international support was disabled because gettext library could not\n";
+ print " be detected.\n";
+ if ($OSf eq 'Linux')
+ {
+ print " Starting with glibc 2.0 this is included in libc, perhaps your system\n";
+ print " just lacks the propper header file.\n";
+ }
+ elsif ($OS eq 'DOS')
+ {
+ print " Install the gtxtNNNb.zip package from the v2gnu directory of djgpp's\n";
+ print " distribution. Read the readme file for more information.\n";
+ }
+ elsif ($Compf eq 'MinGW')
+ {
+ print " That's normal for MinGW.\n";
+ }
+ elsif ($Compf eq 'Cygwin')
+ {
+ print " Install gettext library.\n";
+ }
+ }
+ if ($UseDummyIntl)
+ {
+ print " [[[[[[[*******************>>>>> IMPORTANT!!! <<<<<*******************]]]]]]]\n";
+ print " You must link with libtvfintl.a or you'll get undefined symbols. To avoid\n";
+ print " using this library reconfigure using --no-intl. Read about it in the readme.\n";
+ print " [[[[[[[*******************>>>>> IMPORTANT!!! <<<<<*******************]]]]]]]\n";
+ }
+ if ((@conf{'HAVE_GPM'} eq 'no') && ($OSf eq 'Linux'))
+ {
+ print "\n";
+ print "* No mouse support for console! please install the libgpm package needed\n";
+ print " for development. (i.e. libgpmg1-dev_1.13-5.deb).\n";
+ }
+ if (@conf{'GNU_Make'} ne 'make')
+ {
+ print "\n";
+ print "* Please use $conf{'GNU_Make'} instead of make command.\n";
+ }
+ if ((@conf{'HAVE_X11'} eq 'no') && ($OS eq 'UNIX'))
+ {
+ print "\n";
+ print "* No X11 support detected. If X11 is installed make sure you have the\n";
+ print " development package installed (i.e. xlibs-dev). Also check the options\n";
+ print " to specify the paths for X11 libs and headers\n";
+ }
+}
+
+sub LookForEndianess
+{
+
+ my $test;
+
+ print 'Checking endianess: ';
+
+ if (@conf{'TV_BIG_ENDIAN'} eq 'yes')
+ {
+ print "big endian (cached)\n";
+ return;
+ }
+ if (@conf{'TV_BIG_ENDIAN'} eq 'no')
+ {
+ print "little endian (cached)\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+int main(void)
+{
+ int a=1;
+ char *s=(char *)&a;
+ printf("%s\n",s[0]==1 ? "little" : "big");
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'');
+ $test=~s/\W//g;
+ $conf{'TV_BIG_ENDIAN'}=($test eq "big") ? 'yes' : 'no';
+ print "$test endian\n";
+}
+
+sub LookForIntlSupport
+{
+ my $vNeed=$_[0];
+ my ($test,$a,$djdir,$intllib,$intltest,$libdir);
+
+ print 'Checking for international support: ';
+ if (@conf{'intl-force-dummy'} eq 'yes')
+ {
+ print "using dummy by user request.\n";
+ $conf{'intl'}='yes';
+ $conf{'iconv'}='no';
+ return;
+ }
+ if (@conf{'no-intl'} eq 'yes')
+ {
+ print "disabled by user request.\n";
+ $conf{'intl'}='no';
+ $conf{'iconv'}='no';
+ #`cp include/tv/nointl.h include/tv/intl.h`;
+ return;
+ }
+ if (@conf{'intl'} eq 'yes')
+ {
+ print "yes (cached)\n";
+ return;
+ }
+ if (@conf{'intl'} eq 'no')
+ {
+ print "no (cached)\n";
+ return;
+ }
+ if ($OS eq 'DOS')
+ { # gettext 0.10.32 port have a bug in the headers, correct it
+ $djdir=@ENV{'DJDIR'};
+ $a=cat("$djdir/include/libintl.h");
+ if (length($a) && $a=~/\@INCLUDE_LOCALE_H@/)
+ {
+ $a=~s/\@INCLUDE_LOCALE_H\@//;
+ replace("$djdir/include/libintl.h",$a);
+ }
+ }
+ $intltest='
+#include <stdio.h>
+#define FORCE_INTL_SUPPORT
+#include <tv/intl.h>
+int main(void)
+{
+ printf("%s\n",_("OK"));
+ return 0;
+}
+';
+ $intllib=(($OS eq 'DOS') || ($OS eq 'Win32') || ($OSf eq 'FreeBSD') || ($OSf eq 'QNXRtP')) ? '-lintl' : '';
+ $libdir=$LDExtraDirs;
+ $libdir=~s/(\S+)/-L$1/g;
+ $test=RunGCCTest($GCC,'c',$intltest,'-Iinclude/ '.$libdir.' '.$intllib);
+ $test=~s/\W//g;
+ if ($test ne "OK")
+ {
+ print "no, additional check required.\n";
+ print "Checking for extra libs for international support: ";
+ $test=RunGCCTest($GCC,'c',$intltest,'-Iinclude/ '.$intllib.' -liconv');
+ $test=~s/\W//g;
+ if ($test ne "OK")
+ {
+ print "none found\n";
+ print "International support absent or non-working\n";
+ $conf{'intl'}='no';
+ $conf{'iconv'}='no';
+ }
+ else
+ {
+ print "-liconv, OK\n";
+ $conf{'intl'}='yes';
+ $conf{'iconv'}='yes';
+ }
+ }
+ else
+ {
+ print "yes OK\n";
+ $conf{'intl'}='yes';
+ $conf{'iconv'}='no';
+ }
+}
+
+sub LookForKeysyms
+{
+ my $test;
+
+ print 'Looking for X keysyms definitions: ';
+ if (@conf{'HAVE_KEYSYMS'})
+ {
+ print "@conf{'HAVE_KEYSYMS'} (cached)\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+#include <X11/keysym.h>
+int main(void)
+{
+ if (XK_Return!=0)
+ printf("OK\n");
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'');
+ $test=~s/\W//g;
+ if ($test eq "OK")
+ {
+ $conf{'HAVE_KEYSYMS'}='yes';
+ print " yes OK\n";
+ }
+ else
+ {
+ $conf{'HAVE_KEYSYMS'}='no';
+ print " no, disabling enhanced support for Eterm 0.8.10+\n";
+ }
+}
+
+sub LookForXlib()
+{
+ my ($test,$o,$libs,$testPr,$libs);
+
+ print 'Looking for X11 libs: ';
+ if (@conf{'HAVE_X11'})
+ {
+ print "@conf{'HAVE_X11'} (cached)\n";
+ return;
+ }
+ $testPr='
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+Display *Test()
+{ return XOpenDisplay(""); }
+int main(void)
+{
+ printf("OK, %d.%d\n",X_PROTOCOL,X_PROTOCOL_REVISION);
+ return 0;
+}
+';
+ $conf{'X11LibPath'}='/usr/X11R6/lib' unless $conf{'X11LibPath'};
+ # Looks like Cygwin does all static!
+ $libs=($Compf eq 'Cygwin') ? 'Xmu Xt SM ICE X11' : 'X11 Xmu';
+ # QNX4 does all static!
+ $libs='Xmu Xt SM ICE X11 socket' if ($OSf eq 'QNX4');
+ $conf{'X11Lib'}=$libs unless $conf{'X11Lib'};
+ $libs=$conf{'X11Lib'};
+ $libs=~s/(\S+)/-l$1/g;
+ $o='';
+ $o.='-I'.$conf{'X11IncludePath'} if $conf{'X11IncludePath'};
+ $o.=" -L$conf{'X11LibPath'} $libs";
+ $test=RunGCCTest($GCC,'c',$testPr,$o);
+ if ($test=~/OK, (\d+)\.(\d+)/)
+ {
+ $conf{'HAVE_X11'}='yes';
+ print "yes OK (X$1 rev $2)\n";
+ }
+ else
+ {
+ if (!$conf{'X11IncludePath'})
+ {
+ $conf{'X11IncludePath'}='/usr/X11R6/include';
+ $o.=" -I$conf{'X11IncludePath'} -L$conf{'X11LibPath'} $libs";
+ $test=RunGCCTest($GCC,'c',$testPr,$o);
+ if ($test=~/OK, (\d+)\.(\d+)/)
+ {
+ $conf{'HAVE_X11'}='yes';
+ print "yes OK (X$1 rev $2)\n";
+ return;
+ }
+ }
+ $conf{'HAVE_X11'}='no';
+ print "no, disabling X11 version\n";
+ }
+}
+
+#
+# GlibC 2.1.3 defines it by itself, lamentably doesn't have any protection
+# mechanism to avoid collisions with the kernel headers, too bad.
+#
+sub LookForOutB
+{
+ my $test;
+
+ print 'Looking for outb definition in sys/io.h: ';
+ if (@conf{'HAVE_OUTB_IN_SYS'})
+ {
+ print "@conf{'HAVE_OUTB_IN_SYS'} (cached)\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+#include <sys/io.h>
+#ifdef __i386__
+void Test(void) { outb(10,0x300); }
+#endif
+int main(void)
+{
+ printf("OK\n");
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'');
+ $test=~s/\W//g;
+ $conf{'HAVE_OUTB_IN_SYS'}=($test eq "OK") ? 'yes' : 'no';
+ print "@conf{'HAVE_OUTB_IN_SYS'}\n";
+ #print ">$test<\n";
+}
+
+sub LookForGPM
+{
+ my $vNeed=$_[0],$test;
+
+ print 'Looking for gpm library: ';
+ if (@conf{'gpm'})
+ {
+ print "@conf{'gpm'} (cached) OK\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+#include <gpm.h>
+int main(void)
+{
+ int version;
+ printf("%s",Gpm_GetLibVersion(&version));
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'-lgpm');
+ if (!length($test))
+ {
+ #print "\nError: gpm library not found, please install gpm $vNeed or newer\n";
+ #print "Look in $ErrorLog for potential compile errors of the test\n";
+ #CreateCache();
+ #die "Missing library\n";
+ $conf{'HAVE_GPM'}='no';
+ print " no, disabling mouse support\n";
+ return;
+ }
+ if (!CompareVersion($test,$vNeed))
+ {
+ #print "$test, too old\n";
+ #print "Please upgrade your gpm library to version $vNeed or newer.\n";
+ #print "You can try with $test forcing the configure scripts.\n";
+ #CreateCache();
+ #die "Old library\n";
+ $conf{'HAVE_GPM'}='no';
+ print " too old, disabling mouse support\n";
+ return;
+ }
+ $conf{'gpm'}=$test;
+ $conf{'HAVE_GPM'}='yes';
+ print "$test OK\n";
+}
+
+sub LookForAllegro
+{
+ my $vNeed=$_[0],$test;
+
+ print 'Looking for allegro library: ';
+ if (@conf{'HAVE_ALLEGRO'})
+ {
+ print "@conf{'HAVE_ALLEGRO'} (cached)\n";
+ return;
+ }
+ $test=`allegro-config --version`;
+ chomp $test;
+ if (!length($test))
+ {
+ $conf{'HAVE_ALLEGRO'}='no';
+ print " no, disabling AlCon\n";
+ return;
+ }
+ if (!CompareVersion($test,$vNeed))
+ {
+ $conf{'HAVE_ALLEGRO'}='no';
+ print " too old, disabling AlCon\n";
+ return;
+ }
+ $conf{'HAVE_ALLEGRO'}='yes';
+ print "$test OK\n";
+}
+
+sub LookForNCurses
+{
+ my ($vNeed)=@_;
+ my ($result,$test);
+
+ print 'Looking for ncurses library: ';
+ if (@conf{'ncurses'})
+ {
+ print "@conf{'ncurses'} (cached) OK\n";
+ return;
+ }
+ # Assume it is -lncurses
+ if ($OSf ne 'QNXRtP')
+ {
+ $conf{'NameCurses'}='ncurses'
+ }
+ else
+ {
+ $conf{'NameCurses'}='ncursesS'
+ }
+ $test='
+#include <stdio.h>
+#if defined(__QNX__) && !defined(__QNXNTO__)
+ #include <curses.h>
+#else
+ #include <ncurses.h>
+#endif
+void dummy() {initscr();}
+int main(void)
+{
+ printf(NCURSES_VERSION);
+ return 0;
+}
+';
+ $result=RunGCCTest($GCC,'c',$test,'-lncurses') if ($OSf ne 'QNX4');
+ $result=RunGCCTest($GCC,'c',$test,'-lncurses -lunix') if ($OSf eq 'QNX4');
+ if (!length($result))
+ {# Try again with -lcurses, In Solaris ncurses is installed this way
+ $result=RunGCCTest($GCC,'c',$test,'-lcurses');
+ if (!length($result))
+ {
+ print "no, disabling UNIX driver\n";
+ $conf{'ncurses'}='no';
+ return;
+ }
+ $conf{'NameCurses'}='curses';
+ }
+ if (!CompareVersion($result,$vNeed))
+ {
+ print "$result, too old, disabling UNIX driver\n";
+ $conf{'ncurses'}='no';
+ return;
+ }
+ print "$result OK\n";
+ @conf{'ncurses'}=$result;
+
+ print 'Checking if ncurses have define_key: ';
+ $test='
+#include <stdio.h>
+#include <ncurses.h>
+void dummy(void) { define_key("\x1B[8~",KEY_F(59)); /* End */ }
+int main(void)
+{
+ printf("Ok\n");
+ return 0;
+}
+';
+ $result=RunGCCTest($GCC,'c',$test,'-l'.$conf{'NameCurses'});
+ $result=~s/\W//g;
+ if ($result eq 'Ok')
+ {
+ print "yes\n";
+ $conf{'HAVE_DEFINE_KEY'}=1;
+ }
+ else
+ {
+ print "no\n";
+ $conf{'HAVE_DEFINE_KEY'}=0;
+ }
+}
+
+sub LookForGettextTools
+{
+ my $test;
+
+ print 'Looking for xgettext: ';
+ if (@conf{'xgettext'})
+ {
+ print @conf{'xgettext'}." (cached)\n";
+ return;
+ }
+ #$test=`xgettext --version`;
+ $test=RunRedirect('xgettext --version',$ErrorLog);
+ if ($test=~/(\d+\.\d+(\.\d+)?)/)
+ {
+ print "$1\n";
+ $conf{'xgettext'}=$1;
+ }
+ else
+ {
+ print "no\n";
+ $conf{'xgettext'}='no';
+ }
+}
+
+sub LookForRecode
+{
+ my $test;
+
+ print 'Looking for recode: ';
+ if (@conf{'recode'})
+ {
+ print @conf{'recode'}." (cached)\n";
+ return;
+ }
+ #$test=`recode --version`;
+ $test=RunRedirect('recode --version',$ErrorLog);
+ if ($test=~/(\d+\.\d+(\.\d+)?)/)
+ {
+ print "$1\n";
+ $conf{'recode'}=$1;
+ if (CompareVersion($test,'3.5'))
+ {
+ $conf{'recode_sep'}='..';
+ }
+ else
+ {
+ $conf{'recode_sep'}=':';
+ }
+ }
+ else
+ {
+ print "no\n";
+ $conf{'recode'}='no';
+ }
+}
+
+sub LookForPThread
+{
+ my $test;
+
+ if ($conf{'try-pthread'} ne 'yes')
+ {
+ $conf{'HAVE_LINUX_PTHREAD'}='no';
+ return;
+ }
+
+ print 'Looking for pthread (LinuxThreads) library: ';
+ if (@conf{'HAVE_LINUX_PTHREAD'})
+ {
+ print "@conf{'HAVE_LINUX_PTHREAD'} (cached)\n";
+ return;
+ }
+ $test='
+// We need it for recursive mutex
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <pthread.h>
+
+static pthread_t th;
+static pthread_mutex_t mutex;
+
+void *Test(void *unused)
+{// The OK will be printed only if the thread worked
+ printf("OK\n");
+ return NULL;
+}
+
+int main(int argc, char *argv[])
+{// Test the attribute for recursive mutex.
+ pthread_mutexattr_t mt_attr;
+ pthread_mutexattr_init(&mt_attr);
+ pthread_mutexattr_settype(&mt_attr,PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init(&mutex,&mt_attr);
+ // Create a thread
+ pthread_create(&th,NULL,Test,NULL);
+ // Wait until it finishes
+ pthread_join(th,NULL);
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'-lpthread');
+ if (!length($test))
+ {
+ $conf{'HAVE_LINUX_PTHREAD'}='no';
+ print " no, disabling X11 update thread option\n";
+ return;
+ }
+ $conf{'HAVE_LINUX_PTHREAD'}='yes';
+ print "OK\n";
+}
+
+sub DetectPointersSize()
+{
+ my $test;
+
+ print 'Looking for pointer size: ';
+ if ($conf{'HAVE_64BITS_POINTERS'})
+ {
+ print ($conf{'HAVE_64BITS_POINTERS'} eq 'yes' ? '64' : '32')."bits (cached)\n";
+ return;
+ }
+
+ $test='
+#include <stdio.h>
+
+int main(void)
+{
+ printf("%d\n",(int) sizeof(void *));
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'');
+ $test=~s/\W//g;
+ if ($test eq '8')
+ {
+ $conf{'HAVE_64BITS_POINTERS'}='yes';
+ print " 64 bits\n";
+ }
+ elsif ($test eq '4')
+ {
+ $conf{'HAVE_64BITS_POINTERS'}='no';
+ print " 32 bits\n";
+ }
+ else
+ {
+ CreateCache();
+ die "Unknown pointer size!!\n";
+ }
+}
+
+sub GenerateMakefile
+{
+ my ($text,$rep,$makeDir,$ver,$internac,$maintain);
+ my ($dosta,$dodyn,$nameSO,$nameSOM,$nameSOV,$stripDebug);
+
+ print "Generating Makefile\n";
+ $text=cat('Makefile.in');
+ if (!$text)
+ {
+ CreateCache();
+ die "Can't find Makefile.in!!\n";
+ }
+ $internac=@conf{'xgettext'} ne 'no';
+ $maintain=@conf{'MAINTAINER_MODE'} eq 'yes';
+
+ $dosta=@conf{'no-static'} ne 'yes';
+ $dodyn=($OS eq 'UNIX') && ($OSf ne 'QNX4') && (@conf{'no-dynamic'} ne 'yes');
+ if (!$dosta && !$dodyn)
+ {
+ CreateCache();
+ die "No static nor dynamic library created!!\n";
+ }
+
+ $rep ='';
+ $rep.=' maintainance' if $maintain;
+ $rep.=' static-lib' if $dosta;
+ $rep.=' rhtv-config$(EXE_EXT)';
+ $rep.=' dynamic-lib' if $dodyn;
+ $rep.=' internac' if ($internac);
+ $text=~s/\@targets\@/$rep/g;
+ $text=~s/\@OS\@/$OS/g;
+ $text=~s/\@prefix\@/@conf{'prefix'}/g;
+ $text=~s/\@exe_ext\@/$ExeExt/g;
+ $text=~s/\@maintainer_mode\@/MAINTAINER_MODE=1/g if $maintain;
+ $text=~s/\@maintainer_mode\@//g unless $maintain;
+ $text=~s/\@install\@/@conf{'GNU_INSTALL'}/;
+ $text=~s/\@darwin\@/DARWIN=1/g if $OSf eq 'Darwin';
+ $text=~s/\@darwin\@//g if $OSf ne 'Darwin';
+
+ $makeDir='makes';
+
+ # Write target maintainance rule:
+ $rep='';
+ $rep="maintainance:\n\t\$(MAKE) -C $makeDir -f maintain.mak" if $maintain;
+ $text=~s/\@maintainance_rule\@/$rep/g;
+
+ # Write target rules:
+ $rep='';
+ if ($dosta)
+ {
+ $rep.="static-lib:\n\t\$(MAKE) -C $makeDir -f librhtv.mkf";
+ $rep.="\n\tranlib $makeDir/librhtv.a" if $conf{'UseRanLib'};
+ $rep.="\n";
+ }
+ if ($dodyn)
+ {
+ $rep.="\ndynamic-lib: intl-dummy\n\t\$(MAKE) DYNAMIC_LIB=1 -C $makeDir -f librhtv.mkf\n";
+
+ if ($OSf ne 'Darwin')
+ {
+ $nameSO='librhtv.so';
+ $nameSOM="librhtv.so.$VersionMajor";
+ $nameSOV="librhtv.so.$Version";
+ }
+ else
+ {# Darwin uses a different name
+ $nameSO='librhtv.dylib';
+ $nameSOM="librhtv.$VersionMajor.dylib";
+ $nameSOV="librhtv.$Version.dylib";
+ }
+ # Note: -sf should work for Solaris 9 but at least in the machines at S.F.
+ # it doesn't. So we just delete the file and do the link.
+ $rep.="\t-cd $makeDir; rm -f $nameSO; ln -s $nameSOV $nameSO\n";
+ $rep.="\t-cd $makeDir; rm -f $nameSOM; ln -s $nameSOV $nameSOM\n";
+ }
+ if ($internac)
+ {
+ $rep.="\ninternac:\n";
+ $rep.="\t\$(MAKE) -C intl\n";
+ }
+ $text=~s/\@target_rules\@/$rep/g;
+ $rep="intl-dummy:\n\t\$(MAKE) -C intl/dummy\n";
+ $rep.="\tcp intl/dummy/libtvfintl.a $makeDir\n";
+ $rep.="\tranlib $makeDir/libtvfintl.a\n" if $conf{'UseRanLib'};
+ $text=~s/\@intl_dummy_rule\@/$rep/g;
+
+ $text=~s/\@GCC\@/$GCC/g;
+
+ # Write install stuff
+ # What versions of the library we will install
+ $rep='';
+ $rep.='install-static ' if $dosta;
+ $rep.='install-dynamic ' if $dodyn;
+ $rep.='install-internac ' if $internac;
+ $text=~s/\@installers\@/$rep/g;
+
+ # Headers
+
+ $rep= GenInstallDir('0755','$(prefix)/include/rhtvision');
+ $rep.="\trm -f \$(prefix)/include/rhtvision/*.h\n";
+ $rep.="\t".GenInstallFiles('0644','include/*.h','$(prefix)/include/rhtvision');
+ $rep.="\t".GenInstallDir('0755','$(prefix)/include/rhtvision/tv');
+ $rep.="\t".GenInstallFiles('0644','include/tv/*.h','$(prefix)/include/rhtvision/tv');
+ if ($OS eq 'DOS')
+ {
+ $rep.="\t".GenInstallDir('0755','$(prefix)/include/rhtvision/tv/dos');
+ $rep.="\t".GenInstallFiles('0644','include/tv/dos/*.h','$(prefix)/include/rhtvision/tv/dos');
+ }
+ if ($OS eq 'UNIX')
+ {
+ $rep.="\t".GenInstallDir('0755','$(prefix)/include/rhtvision/tv/linux');
+ $rep.="\t".GenInstallFiles('0644','include/tv/linux/*.h','$(prefix)/include/rhtvision/tv/linux');
+ }
+ if ($OSf eq 'QNXRtP')
+ {
+ $rep.="\t".GenInstallDir('0755','$(prefix)/include/rhtvision/tv/qnxrtp');
+ $rep.="\t".GenInstallFiles('0644','include/tv/qnxrtp/*.h','$(prefix)/include/rhtvision/tv/qnxrtp');
+ }
+ if ($OS eq 'Win32')
+ {
+ $rep.="\t".GenInstallDir('0755','$(prefix)/include/rhtvision/tv/win32');
+ $rep.="\t".GenInstallFiles('0644','include/tv/win32/*.h','$(prefix)/include/rhtvision/tv/win32');
+ }
+ if (@conf{'HAVE_X11'} eq 'yes')
+ {
+ $rep.="\t".GenInstallDir('0755','$(prefix)/include/rhtvision/tv/x11');
+ $rep.="\t".GenInstallFiles('0644','include/tv/x11/*.h','$(prefix)/include/rhtvision/tv/x11');
+ }
+ $rep.="\t".GenInstallDir('0755','$(prefix)/include/rhtvision/cl');
+ $rep.="\t".GenInstallFiles('0644','include/cl/*.h','$(prefix)/include/rhtvision/cl');
+ $text=~s/\@install_headers\@/$rep/g;
+
+ # Dummy replacement for i8n library
+ $rep ="install-intl-dummy: intl-dummy\n";
+ $rep.="\t".GenInstallDir('0755','$(libdir)');
+ $rep.="\t".GenInstallFiles('0644','intl/dummy/libtvfintl.a','$(libdir)');
+ # In Darwin the linker checks the time stamp of the ranlib pass and the one of
+ # the file. It complains if we use ranlib and then copy the file.
+ $rep.="\tranlib \$(libdir)/libtvfintl.a\n" if $conf{'UseRanLib'};
+ $text=~s/\@intl_dummy_install_rule\@/$rep/g;
+
+ # Static library
+ $rep='';
+ if ($dosta)
+ {
+ $rep.="install-static: static-lib\n";
+ $rep.="\t".GenInstallDir('0755','$(libdir)');
+ $rep.="\t".GenInstallFiles('0644',"$makeDir/librhtv.a",'$(libdir)');
+ }
+
+ if ($dodyn)
+ {# Dynamic library
+ $ver=($OSf eq 'FreeBSD') ? $nameSOM : $nameSOV;
+ $rep.="\ninstall-dynamic: dynamic-lib\n";
+ $rep.="\t".GenInstallDir('0755','$(libdir)');
+ $rep.="\trm -f \$(libdir)/$nameSO\n";
+ $rep.="\trm -f \$(libdir)/$nameSOM\n";
+ $rep.="\trm -f \$(libdir)/$nameSOV\n";
+ $rep.="\tcd \$(libdir); ln -s $ver $nameSO\n";
+ $rep.="\tcd \$(libdir); ln -s $ver $nameSOV\n" if $OSf eq 'FreeBSD';
+ $rep.="\t".GenInstallFiles('0644',"$makeDir/$ver",'$(libdir)');
+ $stripDebug=($OSf eq 'Darwin') ? '-S' : '--strip-debug';
+ $rep.="\tstrip $stripDebug \$(libdir)/$ver\n" unless $conf{'debugInfo'} eq 'yes';
+ # FreeBSD: merge data from libdir.
+ # Darwin: doesn't have ldconfig.
+ if ($OSf ne 'Darwin')
+ {
+ $rep.=($OSf eq 'FreeBSD') ? "\t-ldconfig -m \$(libdir)\n" : "\t-ldconfig\n";
+ }
+ }
+ if ($internac)
+ {
+ $rep.="\ninstall-internac:\n\t\$(MAKE) -C intl install\n";
+ }
+ $text=~s/\@install_rules\@/$rep/g;
+
+ # rhtv-config installation
+ $rep= GenInstallDir('0755','$(prefix)/bin');
+ $rep.="\t".GenInstallFiles('0755','rhtv-config$(EXE_EXT)','$(prefix)/bin');
+ $text=~s/\@install_config\@/$rep/g;
+
+ $rep= "clean:\n";
+ $rep.="\trm -f $makeDir/librhtv.so*\n";
+ $rep.="\trm -f $makeDir/obj/*.o\n";
+ $rep.="\trm -f $makeDir/obj/*.lo\n";
+ $rep.="\trm -f $makeDir/librhtv.a\n";
+ $rep.="\trm -f compat/obj/*.o\n";
+ $rep.="\trm -f compat/obj/*.lo\n";
+ $rep.="\trm -f intl/dummy/*.o\n";
+ $rep.="\trm -f intl/dummy/*.lo\n";
+ $rep.="\trm -f intl/dummy/*.a\n";
+ $rep.="\t-\$(MAKE) -C examples clean\n";
+ $rep.="\t-\$(MAKE) -C intl clean\n";
+ $rep.="\trm -f configure.cache\n";
+ $rep.="\trm -f rhtv-config\$(EXE_EXT)\n";
+ $text=~s/\@clean\@/$rep/g;
+
+ replace('Makefile',$text);
+}
+
+sub CreateConfigH
+{
+ my $text="/* Generated automatically by the configure script */";
+ my $old;
+
+ print 'Generating configuration header: ';
+
+ $conf{'HAVE_NCURSES'}=($conf{'ncurses'} ne 'no') && ($OS eq 'UNIX') ? 'yes' : 'no';
+ $text.=ConfigIncDefYes('HAVE_NCURSES','ncurses library');
+ $text.=ConfigIncDef('HAVE_DEFINE_KEY','ncurses 4.2 or better have define_key (In Linux)');
+ $text.=ConfigIncDefYes('HAVE_KEYSYMS','The X11 keysyms are there');
+ $text.=ConfigIncDefYes('HAVE_X11','X11 library and headers');
+ $text.=ConfigIncDefYes('HAVE_ALLEGRO','Allegro library');
+ # Disable i8n only if the user requested, otherwise use gettext or the dummy
+ $conf{'HAVE_INTL_SUPPORT'}=@conf{'no-intl'} eq 'yes' ? 'no' : 'yes';
+ $text.=ConfigIncDefYes('HAVE_INTL_SUPPORT','International support with gettext');
+ $text.=ConfigIncDefYes('HAVE_GPM','GPM mouse support');
+ $text.=ConfigIncDefYes('HAVE_OUTB_IN_SYS','out/in functions defined by glibc');
+ $text.=ConfigIncDefYes('HAVE_SSC','Use stream replacements');
+ $text.=ConfigIncDefYes('TV_BIG_ENDIAN','Byte order for this machine');
+ $text.=ConfigIncDefYes('HAVE_LINUX_PTHREAD','Linux implementation of POSIX threads');
+ $text.=ConfigIncDefYes('HAVE_UNSAFE_MEMCPY','Memcpy doesn\'t support overlaps');
+ $text.=ConfigIncDefYes('HAVE_64BITS_POINTERS','64 bits pointers');
+ $text.="\n\n";
+ $text.="#define TVOS_$OS\n";
+ $text.="#define TVOSf_$OSf\n";
+ $text.="#define TVCPU_$CPU\n";
+ $text.="#define TVComp_$Comp\n";
+ $text.="#define TVCompf_$Compf\n";
+ $text.="\n#define MSS\n#include <mss.h>\n" if @conf{'mss'} eq 'yes';
+ $text.="\n";
+ foreach $line (@MakeDefsRHIDE)
+ {
+ if ($line=~/([\w_]*)(\s*)=(\s*)(.*)/)
+ {
+ $text.="#define TVCONFIG_$1 \"$4\"\n";
+ }
+ }
+ $text.="#define TVCONFIG_CFLAGS \"$CFLAGS\"\n";
+ $text.="#define TVCONFIG_CXXFLAGS \"$CXXFLAGS\"\n";
+ $text.="#define TVCONFIG_REF_DIR \"$here\"\n\n";
+
+ $old=cat('include/tv/configtv.h');
+ if ($text eq $old)
+ {
+ print "no changes\n";
+ }
+ else
+ {
+ print "created new header\n";
+ replace('include/tv/configtv.h',$text);
+ }
+}
+
+sub LookForMaintainerTools
+{
+ my $file;
+
+ $file=LookForFileInPath('gpr2mak*');
+ if (!length($file))
+ {
+ die "\nRHIDE tools aren't installed. They are needed only for maintainer mode.\n".
+ "Install RHIDE or disable the maintaner mode.\n\n";
+ }
+}
+
diff --git a/tvision/confignt.pl b/tvision/confignt.pl
new file mode 100644
index 0000000..e185f49
--- /dev/null
+++ b/tvision/confignt.pl
@@ -0,0 +1,67 @@
+#!/usr/bin/perl
+# Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+
+require "miscperl.pl";
+require "conflib.pl";
+
+SeeCommandLine();
+
+# 1) Get the list of files used by djgpp version
+$col=14;
+$a=ExtractItemsImk('makes/librhtv.imk',$col);
+$a.=' '.ExtractItemsImk('compat/compat.imk',$col);
+# 2) Remove djgpp specific things
+$a=~s/vga.o//;
+$a=~s/vgaregs.o//;
+$a=~s/vgastate.o//;
+$a=~s/vesa.o//;
+# 3) Add BC++ specific
+#$a.=' gkeyw32.cc';
+$b=$a;
+$a=~s/(\w+)\.(\w+)/\+$1\.obj/g;
+$a=~s/\t//g;
+# 3b) MSVC specific
+$b=~s/(\w+)\.(\w+)/\$\(OBJDIR\)\/$1\.o/g;
+# 4) Generate makefile from the template
+$ReplaceTags{'TV_OBJS_BCC'}=$a;
+$ReplaceTags{'TV_OBJS_MSVC'}=$b;
+
+$ReplaceTags{'DYNRTL'} = $conf{'dynrtl'} ? "DYNRTL = 1" : "";
+
+ReplaceText('winnt/bccmake.in','winnt/Makefile');
+ReplaceText('winnt/msvcmake.in','winnt/Makefile.nmk');
+
+sub SeeCommandLine
+{
+ my $i;
+
+ foreach $i (@ARGV)
+ {
+ if ($i eq '--help')
+ {
+ ShowHelp();
+ die "\n";
+ }
+ elsif ($i eq '--with-dynrtl')
+ {
+ $conf{'dynrtl'} = 1;
+ }
+ else
+ {
+ ShowHelp();
+ die "Unknown option: $i\n";
+ }
+ }
+}
+
+sub ShowHelp
+{
+ print "Available options:\n\n";
+ print "--help : displays this text.\n";
+ print "--bindir=path : defines the directory where *.exe files will be installed.\n";
+ print "--setdir=path : defines the directory where documentation andsupport files\n" .
+ " will be installed.\n";
+ print "--with-dynrtl : compile with DLL runtime.\n";
+}
diff --git a/tvision/configset b/tvision/configset
new file mode 100755
index 0000000..05ed7c3
--- /dev/null
+++ b/tvision/configset
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright (C) 1999-2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+echo
+echo This batch file configures the packages using the settings that the
+echo *maintainer* uses for it\'s own needs.
+echo These settings doesn\'t have to be the same you want.
+echo The most common defaults are obtained by just running configure.bat.
+echo If you want to reconfigure the package first delete configure.cache.
+echo
+echo Press the \'ENTER\' key to continue or hit \'CTRL+C\' to cancel.
+read idontcare
+rm -f configure.cache
+rm -f Makefile
+# gcc 2.95.4 compiles much faster (3.2x average)
+#export CC="gcc-2.95"
+#export CXX="g++-2.95"
+# gcc 3.3.5 generates faster code (+20% aprox. for K7)
+#export CC="gcc-3.3"
+#export CXX="g++-3.3"
+# Note: Using SSC gcc 3.3.5 compiles in less time (1.37x instead of 3.2x)
+# gcc 3.4.4 test
+#export CC="gcc-3.4"
+#export CXX="g++-3.4"
+perl config.pl --cflags=-O2\ -Wall\ -Werror\ -gstabs+3\ -pipe \
+ --cxxflags=-O2\ -Wall\ -Werror\ -gstabs+3\ -pipe \
+ --with-debug --enable-maintainer-mode --without-static \
+ --with-ssc "$@"
+
diff --git a/tvision/configset.bat b/tvision/configset.bat
new file mode 100644
index 0000000..b7c7734
--- /dev/null
+++ b/tvision/configset.bat
@@ -0,0 +1,14 @@
+:@Rem Copyright (C) 1999-2003 by Salvador E. Tropea (SET),
+:@Rem see copyrigh file for details
+@echo .
+@echo This batch file configures the packages using the settings that the
+@echo *maintainer* uses for your own needs.
+@echo These settings doesn't have to be the same you want.
+@echo The most common defaults are obtained by just running configure.bat.
+@echo If you want to reconfigure the package first delete configure.cache
+@echo .
+@pause
+@del configure.cache
+@set CFLAGS=-O2 -Wall -Werror -gstabs+3
+@set CXXFLAGS=-O2 -Wall -Werror -gstabs+3 -fno-exceptions -fno-rtti
+@configure.bat --enable-maintainer-mode --with-ssc --force-dummy %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/tvision/configure b/tvision/configure
new file mode 100755
index 0000000..4d4f59f
--- /dev/null
+++ b/tvision/configure
@@ -0,0 +1,2 @@
+#!/bin/sh
+perl config.pl "$@"
diff --git a/tvision/configure.bat b/tvision/configure.bat
new file mode 100644
index 0000000..e8a1b0c
--- /dev/null
+++ b/tvision/configure.bat
@@ -0,0 +1,3 @@
+@Echo off
+@rm -f Makefile
+@perl config.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/tvision/conflib.pl b/tvision/conflib.pl
new file mode 100644
index 0000000..5287293
--- /dev/null
+++ b/tvision/conflib.pl
@@ -0,0 +1,1524 @@
+#!/usr/bin/perl
+# Copyright (C) 1999-2004 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Common configuration routines.
+#
+
+$ErrorLog='errormsg.txt';
+$MakeDefsRHIDE={};
+$ExtraModifyMakefiles={};
+# DOS, UNIX, Win32
+$OS='';
+# Linux, FreeBSD, NetBSD, Solaris, QNXRtP, QNX4
+$OSf='';
+# x86, Alpha, SPARC64, SPARC, PPC, HPPA, MIPS, Itanium, Unknown
+$CPU='';
+# GCC, BCPP, MSVC
+$Comp='';
+# djgpp, MinGW, Cygwin
+$Compf='';
+# gcc's -pipe option
+$UsePipe=0;
+
+sub GetCache
+{
+ my $val;
+
+ if (open(FIL,'<configure.cache'))
+ {
+ while ($val=<FIL>)
+ {
+ if ($val=~/(.*) => (.*)\n/)
+ {
+ @conf{$1}=$2;
+ #print "$1 => $2\n";
+ }
+ else
+ {
+ #print "No toma: ($val)";
+ }
+ }
+ close(FIL);
+ }
+}
+
+
+sub CreateCache
+{
+ my ($i,$ff);
+
+ $ff=1;
+ if (open(FIL,'>configure.cache'))
+ {
+ foreach $i (%conf)
+ {
+ if ($ff)
+ {
+ print FIL ("$i => @conf{$i}\n");
+ $ff=0;
+ }
+ else
+ {
+ $ff=1;
+ }
+ }
+ close(FIL);
+ }
+}
+
+
+sub CompareVersion
+{
+ my ($actual,$needed)=@_;
+ my ($vact,$vneed);
+
+ $actual=~/(\d+)\.(\d+)(\.(\d+))?/;
+ $vact=$1*1000000+$2*1000+$4;
+ $needed=~/(\d+)\.(\d+)(\.(\d+))?/;
+ $vneed=$1*1000000+$2*1000+$4;
+ #print "$vact v.s. $vneed\n";
+ $vact>=$vneed;
+}
+
+
+sub LookForFile
+{
+ my ($file,@path)=@_;
+ my ($i,@a,$f);
+
+ foreach $i (@path)
+ {
+ #print "Testing for ".$i.'/'.$file."\n";
+ @a=glob($i.'/'.$file);
+ foreach $f (@a)
+ {
+ if (-e $f)
+ {
+ return $i;
+ }
+ }
+ }
+ '';
+}
+
+sub LookForFileInPath
+{
+ my ($file)=@_;
+ my @list;
+
+ @list=(($OS eq 'UNIX') || ($Compf eq 'Cygwin')) ? split(/:/,@ENV{'PATH'}) : split(/;/,@ENV{'PATH'});
+ return LookForFile($file,@list);
+}
+
+###[txh]####################################################################
+#
+# Prototype: RunRedirect($command,$ErrorLog)
+# Description:
+# Executes the desired command sending the stderr to $ErrorLog file
+# (appending) and returning the stdout.
+#
+# Return: The value returned from the program (from stdout).
+#
+####################################################################[txi]###
+
+sub RunRedirect
+{
+ my ($command,$ErrorLog)=@_;
+ my $ret;
+
+ if ($OS eq 'DOS')
+ {
+ $ret=`redir -ea $ErrorLog $command`;
+ }
+ elsif ($OS eq 'Win32')
+ {
+ $ret=`sh -c "$command 2>> $ErrorLog"`;
+ }
+ else
+ {
+ $ret=`$command 2>> $ErrorLog`;
+ }
+ $ret;
+}
+
+sub AddIncludes
+{
+ my (@dirs)=split(' ',$conf{'EXTRA_INCLUDE_DIRS'});
+ my ($res)='';
+ for (@dirs)
+ {
+ $res.=" -I$_";
+ }
+ return $res;
+}
+
+###[txh]####################################################################
+#
+# Prototype: RunGCCTest($gcc,$extension,$prog,$flags)
+# Description:
+# Compiles a test program with gcc and runs it callecting the output.@*
+# You must pass the name of the compiler as argument, also the extension of
+# the file (.c, .cc, etc.), the code to compile and any etra switch options
+# needed to compile.@*
+# Additionally the following global variables are used: $CFLAGS: standard
+# flags for the C compiler (used when extension=='c'), $CXXFLAGS: standard
+# flags for the C++ compiler (used when extension=='cc'), $ErrorLog: file
+# to log the actions and errors and the $OS guess.@*
+#
+# Return: The value returned from the program (from stdout).
+#
+####################################################################[txi]###
+
+sub RunGCCTest
+{
+ my ($cc,$ext,$test,$switchs)=@_;
+ my ($command,$label);
+ my ($file,$flags)=('test.'.$ext,'');
+
+ unlink 'test.exe';
+ replace($file,$test."\n");
+ $flags=$CFLAGS if ($ext eq 'c');
+ $flags=$CXXFLAGS if ($ext eq 'cc');
+ $flags.=AddIncludes();
+ $command="$cc -o test.exe $flags $file $switchs";
+ #print "Running: $command\n";
+ $label=$command.":\n";
+ `echo $label >> $ErrorLog`;
+
+ RunRedirect($command,$ErrorLog);
+ $test=RunRedirect('./test.exe',$ErrorLog);
+ #print "\n$command: $test";
+ # Does anybody know why I can't delete the exe here?
+ # In Linux it makes the variable $test to change!
+ #unlink('test.o',$file,'test.exe');
+ unlink('test.o',$file);
+ $test;
+}
+
+###[txh]####################################################################
+#
+# Prototype: LookForPrefix()
+# Description:
+# Tries to find the right installation prefix. The following mechanisms
+# are used:@*
+# 1) Look for cached prefix key.@*
+# 2) Look for prefix environment variable.@*
+# 3) Look for PREFIX environment variable.@*
+# UNIX:@*
+# 4) Find where make is installed and guess from it.@*
+# 5) If not found default to /usr@*
+# DOS:@*
+# 6) Use the DJDIR environment variable.@*
+# The result is stored in the prefix configuration key.
+# WIN32:@*
+# 7) Locate make.exe in PATH and use parent directory for prefix. If the
+# prefix string contains backslashes, convert them to slashes.
+# make.exe must reside in $prefix/bin directory
+#
+####################################################################[txi]###
+
+sub LookForPrefix
+{
+ my ($test,$prefix,@lista,$i,$found);
+
+ print 'Looking for prefix: ';
+ $prefix=@conf{'prefix'};
+ if ($prefix)
+ {
+ print "$prefix (cached/specified)\n";
+ LookIfFHS();
+ return;
+ }
+ $prefix=@ENV{'prefix'};
+ if (!$prefix)
+ {
+ $prefix=@ENV{'PREFIX'};
+ }
+ if ($prefix)
+ {
+ print "$prefix (environment)\n";
+ @conf{'prefix'}=$prefix;
+ LookIfFHS();
+ return;
+ }
+ if (($OS eq 'UNIX') || ($Compf eq 'Cygwin'))
+ {
+ if (`which make`=~/(.*)\/bin\/make/)
+ {
+ $prefix=$1;
+ }
+ else
+ {
+ $prefix='/usr';
+ }
+ }
+ elsif ($OS eq 'DOS')
+ {
+ $prefix=@ENV{'DJDIR'};
+ }
+ else
+ {
+ if ($Compf eq 'MinGW')
+ {
+ @lista=(split(/;/,@ENV{'PATH'}),split(/:/,@ENV{'PATH'}));
+ $found=0;
+ foreach $i (@lista)
+ {
+ #print "Buscando ".$i."\\make.exe\n";
+ if (!$found && (-e $i."\\make.exe") &&
+ ($i=~/(.*)[\\\/][bB][iI][nN]/))
+ {
+ $prefix=$1;
+ $prefix=~s/\\/\//g;
+ $found=1;
+ }
+ }
+ }
+ if (!$found)
+ {
+ if (!$test)
+ {
+ die "Some critical tools aren't installed please read the reame files";
+ }
+ else
+ {
+ print "Unable to determine installation prefix, please use --prefix option.\n";
+ print "You'll most probably need to quote the --prefix option (\"--prefix=path\").\n" if @ENV{'OS'} eq 'Windows_NT';
+ die;
+ }
+ }
+ }
+ @conf{'prefix'}=$prefix;
+ print "$prefix\n";
+ LookIfFHS();
+}
+
+sub LookIfFHS
+{
+ if ($OS eq 'UNIX')
+ {
+ print 'Checking if this system follows the FHS: ';
+ if ($conf{'fhs'})
+ {
+ print "$conf{'fhs'} (cached/specified)\n";
+ return;
+ }
+ # FreeBSD uses share/doc but not shared/info and shared/man
+ if ((-d $prefix.'/share/doc') && (-d $prefix.'/share/info') && (-d $prefix.'/share/man'))
+ {
+ $conf{'fhs'}='yes';
+ }
+ else
+ {
+ $conf{'fhs'}='no';
+ }
+ print "$conf{'fhs'}\n";
+ }
+}
+
+###[txh]####################################################################
+#
+# Prototype: CheckGCC()
+# Description:
+# Tries to find a working C compiler. The following tests are done:@*
+# 1) Look for cached GCC key.@*
+# 2) Look for CC environment variable.@*
+# 3) Default to gcc.@*
+# Then a small test program is compiled. If it fails the program dies.@*
+# The result is stored in the GCC configuration key.
+#
+# Return: The name of the working compiler.
+#
+####################################################################[txi]###
+
+sub CheckGCC
+{
+ my ($cc,$test);
+
+ print 'Looking for a working gcc: ';
+ $cc=@conf{'GCC'};
+ if ($cc)
+ {
+ print "$cc (cached) OK\n";
+ return $cc;
+ }
+ $cc=$ENV{'CC'};
+ if (!length($cc))
+ {
+ $cc='gcc';
+ }
+ print "$cc ";
+ $test='#include <stdio.h>
+int main(void)
+{
+ printf("OK\n");
+ return 0;
+}
+';
+ $test=RunGCCTest($cc,'c',$test,'');
+ $test=~s/\W//g;
+ if ($test ne "OK")
+ {
+ CreateCache();
+ die 'Not working gcc found';
+ }
+ print "OK\n";
+ $conf{'GCC'}=$cc;
+ $cc;
+}
+
+###[txh]####################################################################
+#
+# Prototype: CheckGCCcanXX($gcc)
+# Description:
+# Checks if the C compiler can be used to compile C++ code.
+#
+# Return: 'yes' or 'no' according to a compilation test.
+#
+####################################################################[txi]###
+
+sub CheckGCCcanXX
+{
+ my $cc=$_[0];
+ my ($ret,$test);
+
+ print "$cc can compile C++ code: ";
+ $test='
+#if __GNUC__>=3
+ #include <iostream>
+ #define STD(a) std::a
+#else
+ #include <iostream.h>
+ #define STD(a) a
+#endif
+int main(void)
+{
+ STD(cout) << "OK" << STD(endl);
+ return 0;
+}';
+ $test=RunGCCTest($cc,'cc',$test,$stdcxx);
+ $test=~s/\W//g;
+ if ($test eq "OK")
+ {
+ print "yes\n";
+ $ret=1;
+ }
+ else
+ {
+ print "no\n";
+ $ret=0;
+ }
+ $ret;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: CheckGXX()
+# Description:
+# Finds the C++ compiler. Mechanism:@*
+# 1) Cached GXX key.@*
+# 2) Compiler declared in global $GCC variable.@*
+# 3) Return value from CheckGXXReal().@*
+# The result is stored in the GXX configuration key and the $GXX global
+# variable.
+#
+# Return: The $GXX value.
+#
+####################################################################[txi]###
+
+sub CheckGXX
+{
+ if (@conf{'GXX'})
+ {
+ print "C++ compiler: @conf{'GXX'} (cached) OK\n";
+ return @conf{'GXX'};
+ }
+ # Test for a working g++
+ $GXX=CheckGXXReal();
+
+ $conf{'GXX'}=$GXX;
+}
+
+###[txh]####################################################################
+#
+# Prototype: CheckGXXReal()
+# Description:
+# Tries to find if $defaultCXX can compile C++. This global variable is
+# determined during the OS detection. If it fails the program dies.
+#
+# Return: The name of the compiler.
+#
+####################################################################[txi]###
+
+sub CheckGXXReal
+{
+ my ($test,$res,@list,$i,$cxx);
+
+ print 'Looking for the C++ compiler: ';
+ $test='
+#if __GNUC__>=3
+ #include <iostream>
+ #define STD(a) std::a
+#else
+ #include <iostream.h>
+ #define STD(a) a
+#endif
+int main(void)
+{
+ STD(cout) << "OK" << STD(endl);
+ return 0;
+}';
+ @list=split(/:/,$defaultCXX);
+ $cxx=$ENV{'CXX'};
+ if (length($cxx))
+ {
+ unshift @list,$cxx;
+ }
+ foreach $i (@list)
+ {
+ $res=RunGCCTest($i,'cc',$test,$stdcxx);
+ $res=~s/\W//g;
+ if ($res eq "OK")
+ {
+ print "$i\n";
+ return $i;
+ }
+ }
+ return $GCC if (CheckGCCcanXX($GCC));
+ CreateCache();
+ die('can not find it');
+}
+
+###[txh]####################################################################
+#
+# Prototype: LookForDJGPP($versionNeeded)
+# Description:
+# Finds if the installed djgpp version is the needed. Note that the
+# version should be provided in the following way: djgpp v2.01 => 2.0.1.
+# I did it to accomodate to the version comparisson test. Mechanism:@*
+# 1) Cached djgpp key.@*
+# 2) Compilation of a small program printing DJGPP.0.DJGPP_MINOR.@*
+# If the version is incorrect the program dies.@*
+# The result is stored in the 'djgpp' configuration key.
+#
+####################################################################[txi]###
+
+sub LookForDJGPP
+{
+ my $vNeed=$_[0];
+ my $test;
+
+ print 'Checking DJGPP version: ';
+ $test=@conf{'djgpp'};
+ if ($test)
+ {
+ print "$test (cached) OK\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+int main(void)
+{
+ printf("%d.0.%d",DJGPP,DJGPP_MINOR);
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'');
+ if (!CompareVersion($test,$vNeed))
+ {
+ print "\nWrong DJGPP version, please use $vNeed or newer\n";
+ print "Look in $ErrorLog for potential compile errors of the test\n";
+ CreateCache();
+ die "Wrong version\n";
+ }
+ print "$test OK\n";
+ $conf{'djgpp'}=$test;
+}
+
+###[txh]####################################################################
+#
+# Prototype: FindCFLAGS()
+# Description:
+# Determines the flags to be used for compilation. Mechanism:@*
+# 1) Cached CFLAGS key.@*
+# 2) Environment variable CFLAGS.@*
+# 3) -O2 -gstabs+3 (-pipe if UNIX).@*
+# The result is stored in the 'CFLAGS' configuration key.
+#
+# Return: The value determined.
+#
+####################################################################[txi]###
+
+sub FindCFLAGS
+{
+ my ($ret,$ver);
+
+ print 'C flags: ';
+ $ret=@conf{'CFLAGS'};
+ if ($ret)
+ {
+ print "$ret (cached)\n";
+ return $ret;
+ }
+ $ret=@ENV{'CFLAGS'};
+ if (!$ret)
+ {
+ $ret='-O2'; # -gstabs+3';
+ # In UNIX pipes are in memory and allows multithreading so they are
+ # usually faster. In Linux that's faster.
+ $ret.=' -pipe' if $UsePipe;
+ # Looks like that's common and some sysadmins doesn't configure gcc to
+ # look there:
+ $conf{'EXTRA_INCLUDE_DIRS'}.=' /usr/local/include' if ($OSf eq 'FreeBSD');
+ # Darwin is using a temporal size
+ $ret.=' -Wno-long-double' if ($OSf eq 'Darwin');
+ # QNX4 X11 is in /usr/X11R6
+ # This should be automatic now. (EXTRA_INCLUDE_DIRS).
+ #$ret.=' -I/usr/X11R6/include' if ($OSf eq 'QNX4');
+ $ver=RunRedirect("$GCC -dumpversion",$ErrorLog);
+ $ret.=' -Wno-packed' if $ver>=4;
+ }
+ print "$ret\n";
+ $conf{'CFLAGS'}=$ret;
+ $ret;
+}
+
+###[txh]####################################################################
+#
+# Prototype: FindLDExtraDirs()
+# Description:
+# Simple hook to get the extra dirs.
+#
+# Return:
+# Space separated list of directories.
+#
+####################################################################[txi]###
+
+sub FindLDExtraDirs()
+{
+ my $ret;
+
+ $ret=@conf{'LDExtraDirs'};
+ if ($ret)
+ {
+ return $ret;
+ }
+ $ret='';
+ $ret.='/usr/local/lib' if ($OSf eq 'FreeBSD');
+ $ret.='/usr/pkg/lib' if ($OSf eq 'NetBSD');
+ $conf{'LDExtraDirs'}=$ret;
+ $ret;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: FindCXXFLAGS()
+# Description:
+# Determines the flags to be used for C++ compilation. Mechanism:@*
+# 1) Cached CXXFLAGS key.@*
+# 2) Environment variable CXXFLAGS.@*
+# 3) Cached CFLAGS key.@*
+# 4) Environment variable CFLAGS.@*
+# 5) -O2 -gstabs+3 (-pipe if UNIX).@*
+# The result is stored in the 'CXXFLAGS' configuration key.
+#
+# Return: The value determined.
+#
+####################################################################[txi]###
+
+sub FindCXXFLAGS
+{
+ my $ret;
+
+ print 'C++ flags: ';
+ $ret=@conf{'CXXFLAGS'};
+ if ($ret)
+ {
+ print "$ret (cached)\n";
+ return $ret;
+ }
+ $ret=@ENV{'CXXFLAGS'};
+ $ret=@conf{'CFLAGS'} unless $ret;
+ $ret=@ENV{'CFLAGS'} unless $ret;
+ if (!$ret)
+ {
+ $ret='-O2'; # -gstabs+3';
+ $ret.=' -pipe' if $UsePipe;
+ $ret.=' -L/usr/local/include' if ($OSf eq 'FreeBSD');
+ $conf{'EXTRA_INCLUDE_DIRS'}.=' /usr/local/include' if ($OSf eq 'FreeBSD');
+ $ret.=' -Wno-long-double' if ($OSf eq 'Darwin');
+ # QNX4 X11 is in /usr/X11R6
+ # This should be automatic now. (EXTRA_INCLUDE_DIRS).
+ #$ret.=' -I/usr/X11R6/include' if ($OSf eq 'QNX4');
+ }
+ print "$ret\n";
+ $conf{'CXXFLAGS'}=$ret;
+ $ret;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: FindXCFLAGS()
+# Description:
+# Determines the flags to be used for special compilation. Mechanism:@*
+# 1) Cached XCFLAGS key.@*
+# 2) -O3 -fomit-frame-pointer -ffast-math (-pipe if not DOS).@*
+# The result is stored in the 'XCFLAGS' configuration key.
+#
+# Return: The value determined.
+#
+####################################################################[txi]###
+
+sub FindXCFLAGS
+{
+ my $ret;
+
+ print 'Special C flags: ';
+ $ret=@conf{'XCFLAGS'};
+ if ($ret)
+ {
+ print "$ret (cached/cmdline)\n";
+ return $ret;
+ }
+ if (!$ret)
+ {
+ $ret='-O3 -fomit-frame-pointer -ffast-math';
+ $ret.=' -pipe' if $UsePipe;
+ $ret.=' -Wno-long-double' if ($OSf eq 'Darwin');
+ }
+ print "$ret\n";
+ $conf{'XCFLAGS'}=$ret;
+ $ret;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: FindXCXXFLAGS()
+# Description:
+# Determines the flags to be used for C++ compilation. Mechanism:@*
+# 1) Cached XCXXFLAGS key.@*
+# 2) -O3 -fomit-frame-pointer -ffast-math (-pipe if not DOS).@*
+# The result is stored in the 'XCXXFLAGS' configuration key.
+#
+# Return: The value determined.
+#
+####################################################################[txi]###
+
+sub FindXCXXFLAGS
+{
+ my $ret;
+
+ print 'Special C++ flags: ';
+ $ret=@conf{'XCXXFLAGS'};
+ if ($ret)
+ {
+ print "$ret (cached/cmdline)\n";
+ return $ret;
+ }
+ if (!$ret)
+ {
+ $ret='-O3 -fomit-frame-pointer -ffast-math';
+ $ret.=' -pipe' if $UsePipe;
+ $ret.=' -Wno-long-double' if ($OSf eq 'Darwin');
+ }
+ print "$ret\n";
+ $conf{'XCXXFLAGS'}=$ret;
+ $ret;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: DetectOS()
+# Description:
+# Determines the OS using the uname command. If it returns MS-DOS then dos
+# is assumed, if Linux or linux is returned the linux is assumed. If none
+# of these is returned the program dies. The following global variables are
+# filled according to the OS:@*
+# $OS: DOS, UNIX, Win32.@*
+# $OSf: OS flavor i.e. Linux.@*
+# $Comp: Compiler i.e. GCC.@*
+# $Compf: Compiler flavor i.e. djgpp.@*
+# $stdcxx: C++ library (stdcxx or stdc++).@*
+# $defaultCXX: C++ compiler (gxx or g++).@*
+# $supportDir: Directory to look for OS specific support (djgpp or linux).@*
+#
+# Return: The determined OS.
+#
+####################################################################[txi]###
+
+sub DetectOS
+{
+ my ($os,$release,$OS);
+ $os=`uname`;
+ if (!$os)
+ {
+ print "\n";
+ print "* -------------------------------------- *\n";
+ print " Please install the `uname' command.\n";
+ print " DJGPP users: That's part of shell utils.\n";
+ print "* -------------------------------------- *\n\n";
+ die;
+ }
+ print 'Determining OS: ';
+
+ $OSpr=0;
+ # Currently the configuration is oriented for GNU systems
+ # other systems should have a special configuration header
+ # created by hand.
+ $Comp='GCC';
+ $ExeExt='';
+ if ($os=~/MS\-DOS/)
+ {
+ $OS='DOS';
+ $OSf='';
+ $Compf='djgpp';
+ $stdcxx='-lstdcxx';
+ $defaultCXX='gpp:gxx';
+ $supportDir='djgpp';
+ $ExeExt='.exe';
+ }
+ elsif ($os=~/[Ll]inux/)
+ {
+ $OS='UNIX';
+ $OSf='Linux';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/FreeBSD/)
+ {
+ $OS='UNIX';
+ $OSf='FreeBSD';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/CYGWIN/)
+ {
+ $OS='Win32';
+ $OSf='';
+ $Compf='Cygwin/MinGW';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='win32';
+ $ExeExt='.exe';
+ }
+ elsif ($os=~/MINGW/)
+ {
+ $OS='Win32';
+ $OSf='';
+ $Compf='MinGW';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='win32';
+ $ExeExt='.exe';
+ }
+ elsif ($os=~/SunOS/)
+ {
+ $OS='UNIX';
+ $OSf='Solaris';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/QNX/)
+ {
+ $release=`uname -r`;
+ if ($release =~ /^6/)
+ {
+ $OS='UNIX';
+ $OSf='QNXRtP';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='qcc -Y_gpp';
+ $supportDir='linux';
+ }
+ else
+ {
+ $OS='UNIX';
+ $OSf='QNX4';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ }
+ elsif ($os=~/HP-UX/)
+ {
+ $OS='UNIX';
+ $OSf='HP-UX';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/Darwin/)
+ {
+ $OS='UNIX';
+ $OSf='Darwin';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='c++';
+ $supportDir='linux';
+ $conf{'GCC'}='cc';
+ }
+ elsif ($os=~/NetBSD/)
+ {
+ $OS='UNIX';
+ $OSf='NetBSD';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/OpenBSD/)
+ {
+ $OS='UNIX';
+ $OSf='OpenBSD';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/OSF1/)
+ {
+ $OS='UNIX';
+ $OSf='Tru64';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ else
+ {
+ die('Unknown OS, you must do things by yourself');
+ }
+ # The gcc I found in an HP DS20E machine comes in a package called TWWfsw and
+ # doesn't support -pipe. (Dual EV67 667 MHz machine running OSF1 v5.1).
+ $UsePipe=($OS eq 'UNIX') && ($OSf ne 'Tru64');
+ print "$OS";
+ print " [$OSf]" if $OSf;
+ print " [$Compf]" if $Compf;
+ print "\n";
+ $OS;
+}
+
+sub DetectOS2
+{
+ my $test;
+ # Most MinGW users have Cygwin tools
+ if ($Compf eq 'Cygwin/MinGW')
+ {
+ print 'Detecting compiler env. better: ';
+ if ($conf{'Cygwin/MinGW'})
+ {
+ $Compf=$conf{'Cygwin/MinGW'};
+ print "$Compf (cached)\n";
+ }
+ else
+ {
+ $test='
+#include <stdio.h>
+int main(void)
+{
+ #ifdef __CYGWIN__
+ printf("Cygwin\n");
+ #else
+ printf("MinGW\n");
+ #endif
+ return 0;
+}
+';
+ $Compf=RunGCCTest($GCC,'c',$test,'');
+ chop($Compf);
+ $conf{'Cygwin/MinGW'}=$Compf;
+ print "$Compf\n";
+ }
+ }
+}
+
+###[txh]####################################################################
+#
+# Prototype: ModifyMakefiles(@list)
+# Description:
+# Patches the listed RHIDE makefiles to use the detected C compiler, C++
+# compiler and compilation flags.@*
+#
+####################################################################[txi]###
+
+sub ModifyMakefiles
+{
+ my ($a,$text,$rep,$repv,$line,$name,$value);
+
+ print 'Configuring makefiles: ';
+ foreach $a (@_)
+ {
+ print "$a ";
+ $text=cat($a);
+ if ($text)
+ {
+ $text=~s/RHIDE_GCC=(.*)\n/RHIDE_GCC=$GCC\n/g;
+ $text=~s/RHIDE_GXX=(.*)\n/RHIDE_GXX=$GXX\n/g;
+ $text=~s/RHIDE_LD=(.*)\n/RHIDE_LD=$GXX\n/g;
+ $text=~s/RHIDE_OS_CFLAGS=(.*)\n/RHIDE_OS_CFLAGS=$CFLAGS\n/g;
+ $text=~s/RHIDE_OS_CXXFLAGS=(.*)\n/RHIDE_OS_CXXFLAGS=$CXXFLAGS\n/g;
+ $text=~s/RHIDE_AR=(.*)\n/RHIDE_AR=$GAR\n/g if ($GAR);
+ $rep ='rc';
+ $rep.='s' unless $conf{'UseRanLib'};
+ $text=~s/RHIDE_ARFLAGS=(.*)\n/RHIDE_ARFLAGS=$rep\n/g;
+ foreach $rep (%ExtraModifyMakefiles)
+ {
+ $repv="$rep=@ExtraModifyMakefiles{$rep}\n";
+ $text=~s/$rep=(.*)\n/$repv/;
+ }
+ foreach $line (@MakeDefsRHIDE)
+ {
+ if ($line=~/([\w_]*)(\s*)=(\s*)(.*)/)
+ {
+ $name=$1;
+ $value=$4;
+ #print "$name=$value\n";
+ $rep="^$name"."=((.+\\\\\\n)+(.+))";
+ if ($text=~/$rep/m)
+ { # Ok multiline
+ $text=~s/$rep/$name=$value/mg;
+ }
+ else
+ { # Single line
+ $rep="^$name"."=(.*)";
+ if ($text=~/$rep/m)
+ {
+ $text=~s/$rep/$name=$value/mg;
+ }
+ }
+ }
+ }
+ replace($a,$text);
+ }
+ }
+ print "\n";
+}
+
+###[txh]####################################################################
+#
+# Prototype: ModifySimpleMakefiles(@list)
+# Description:
+# Patches the listed makefiles to use the detected C compiler, C++
+# compiler and compilation flags.@*
+#
+####################################################################[txi]###
+
+sub ModifySimpleMakefiles
+{
+ my ($a,$text,$rep);
+
+ print 'Configuring simple makefiles: ';
+ foreach $a (@_)
+ {
+ print "$a ";
+ $text=cat($a);
+ if ($text)
+ {
+ $text=~s/GCC=(.*)\n/GCC=$GCC\n/;
+ $text=~s/GXX=(.*)\n/GXX=$GXX\n/;
+ $text=~s/LD=(.*)\n/LD=$GXX\n/;
+ $text=~s/CFLAGS=(.*)\n/CFLAGS=$CFLAGS\n/;
+ $text=~s/CXXFLAGS=(.*)\n/CXXFLAGS=$CXXFLAGS\n/;
+ replace($a,$text);
+ }
+ }
+ print "\n";
+}
+
+###[txh]####################################################################
+#
+# Prototype: CreateRHIDEenvs(@list)
+# Description:
+# Generates all the needed rhide.env files to configure RHIDE with the
+# detected C compiler, C++ compiler and compilation flags.@*
+# That's needed to use RHIDE after configuring.
+# Projects that needs faster C/C++ options are indicated with a +.
+#
+####################################################################[txi]###
+
+sub CreateRHIDEenvs
+{
+ my ($a,$text,$rep,$useXtreme,$b,$old);
+
+ print 'Configuring RHIDE: ';
+ foreach $a (@_)
+ {
+ if (substr($a,0,1) eq "+")
+ {
+ $b=substr($a,1);
+ $useXtreme=1;
+ }
+ else
+ {
+ $b=$a;
+ $useXtreme=0;
+ }
+ print "$b ";
+ $text ="#
+# Automatically generated by configure script
+# If you didn't configure this package please do it or edit this file
+#
+
+";
+ $text.="RHIDE_GCC=$GCC\n";
+ $text.="RHIDE_GXX=$GXX\n";
+ $text.="RHIDE_LD=$GXX\n";
+ $text.="RHIDE_AR=$GAR\n" if ($GAR);
+ $rep ='rc';
+ $rep.='s' unless $conf{'UseRanLib'};
+ $text.="RHIDE_ARFLAGS=$rep\n";
+
+ if ($useXtreme)
+ {
+ $text.="RHIDE_OS_CFLAGS=@conf{'XCFLAGS'}\n";
+ $text.="RHIDE_OS_CXXFLAGS=@conf{'XCXXFLAGS'}\n";
+ }
+ else
+ {
+ $text.="RHIDE_OS_CFLAGS=$CFLAGS\n";
+ $text.="RHIDE_OS_CXXFLAGS=$CXXFLAGS\n";
+ }
+ foreach $rep (@MakeDefsRHIDE)
+ {
+ $text.="$rep\n";
+ }
+
+ $old=cat($b);
+ if ($text ne $old)
+ {
+ if ($text)
+ {
+ replace($b,$text);
+ }
+ else
+ {
+ unlink $b;
+ }
+ }
+ }
+ print "\n";
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: ConfigIncDef($defVar,$defComment)
+# Description:
+# That's used to generate the config.h file and generates a line with
+# /* $defComment */\n#define $defVar or not according to the existence of
+# the $defVar configure key.
+#
+# Return: The string generated.
+#
+####################################################################[txi]###
+
+sub ConfigIncDef
+{
+ my $text;
+
+ $text ="\n\n/* $_[1] */\n";
+ $text.='/*' unless (@conf{$_[0]});
+ $text.="#define $_[0] 1";
+ $text.='*/' unless (@conf{$_[0]});
+ $text;
+}
+
+###[txh]####################################################################
+#
+# Prototype: ConfigIncDefYes($defVar,$defComment)
+# Description:
+# That's similar to ConfigIncDef, but here the key must be 'yes'.
+#
+# Return: The string generated.
+#
+####################################################################[txi]###
+
+sub ConfigIncDefYes
+{
+ my $text;
+
+ $text ="\n\n/* $_[1] */\n";
+ $text.='/*' unless (@conf{$_[0]} eq 'yes');
+ $text.="#define $_[0] 1";
+ $text.='*/' unless (@conf{$_[0]} eq 'yes');
+ $text;
+}
+
+sub ParentDir
+{
+ my ($cur,$parent);
+ $cur=`pwd`;
+ chop $cur;
+ chdir('..');
+ $parent=`pwd`;
+ chop $parent;
+ chdir($cur);
+ $parent;
+}
+
+sub ReplaceText
+{
+ my ($Text,$Dest,$i,$se,$re,$ff);
+
+ $Dest=$_[1];
+ print "Processing $_[0] => $_[1]\n";
+ $Text=cat($_[0]);
+ $ff=0;
+ foreach $i (%ReplaceTags)
+ {
+ $ff=!$ff;
+ if ($ff)
+ {
+ $se='@'.$i.'@';
+ $re=$ReplaceTags{$i};
+ $Text =~ s/$se/$re/g;
+ }
+ }
+ replace($Dest,$Text);
+}
+
+###[txh]####################################################################
+#
+# Prototype: ExtractItemsImk($makefile,\$column)
+# Description:
+# Extracts the list of project items from a .imk.
+#
+# Return: The list of items.
+#
+####################################################################[txi]###
+
+sub ExtractItemsImk
+{
+ my ($makefile,$col)=($_[0],\$_[1]);
+ my ($mak,@items,$file,$result,$path);
+
+ $result='';
+ $makefile=~/((.+)\/+)/;
+ $path=$1;
+ print "Extracting from $makefile: ";
+ $mak=cat($makefile);
+ if ($mak=~ /(.*)::(((.+)\\\n)+(.+)\n)/ ||
+ $mak=~ /(.*):: ((.+)\n)/)
+ {
+ print "processing\n";
+ @items=split(/[\\\s]+/,$2);
+ foreach $file (@items)
+ {
+ if ($file=~/\$\(ExOBJ\)/)
+ {
+ $file=~/((.+)\/+)(.*)/;
+ $file=$3;
+ $file=~s/\$\(ExOBJ\)/\.o/;
+ #print "$file\n";
+ if ($$col!=0)
+ {
+ if ($$col+length($file)>76)
+ {
+ $result.="\\\n\t";
+ $$col=8;
+ }
+ else
+ {
+ $result.=' ';
+ $$col++;
+ }
+ }
+ $$col+=length($file);
+ $result.="$file";
+ }
+ }
+ }
+ else
+ {
+ print "nothing found!\n";
+ }
+ $result;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: ExtractItemsMak($makefile,\$column)
+# Description:
+# Extracts the list of project items from a .mak. Is recursive.
+#
+# Return: The list of items.
+#
+####################################################################[txi]###
+
+sub ExtractItemsMak
+{
+ my ($makefile,$col)=($_[0],\$_[1]);
+ my ($mak,@items,$file,$result,$path);
+
+ $result='';
+ $makefile=~/((.+)\/+)/;
+ $path=$1;
+ print "Extracting from $makefile\n";
+ $mak=cat($makefile);
+ if ($mak=~ /PROJECT_ITEMS=(((.+)\\\r?\n)+(.+)\r?\n)/ ||
+ $mak=~ /PROJECT_ITEMS=((.+)\r?\n)/)
+ {
+ #print "$1\n";
+ @items=split(/[\\\s]+/,$1);
+ foreach $file (@items)
+ {
+ if ($file=~/\.gpr/)
+ {
+ $file=~s/\.gpr/\.mak/;
+ $result.=ExtractItemsMak($path.$file,$$col);
+ #print "**** Back ($path)\n";
+ }
+ else
+ {
+ #print "$file\n";
+ if ($$col!=0)
+ {
+ if ($$col+length($file)>76)
+ {
+ $result.="\\\n\t";
+ $$col=8;
+ }
+ else
+ {
+ $result.=' ';
+ $$col++;
+ }
+ }
+ $$col+=length($file);
+ $result.="$file";
+ }
+ }
+ }
+ $result;
+}
+
+sub DetectCPU
+{
+ my $test;
+
+ print 'Checking Architecture: ';
+
+ if ($conf{'TV_CPU'})
+ {
+ print "$conf{'TV_CPU'} (cached)\n";
+ $CPU=$conf{'TV_CPU'};
+ return;
+ }
+ $test='
+#include <stdio.h>
+int main(void)
+{
+ #ifdef __i386__
+ printf("x86\n");
+ #elif defined(__alpha__) || defined(__alpha)
+ printf("Alpha\n");
+ #elif defined(__sparc_v9__) || defined(__sparcv9)
+ printf("SPARC64\n");
+ #elif defined(__sparc__) || defined(sparc)
+ printf("SPARC\n");
+ #elif defined(__PPC__) || defined(PPC) || defined(__ppc__)
+ printf("PPC\n");
+ #elif defined(__hppa__)
+ printf("HPPA\n");
+ #elif defined(__mips__)
+ printf("MIPS\n");
+ #elif defined(__ia64__)
+ printf("Itanium\n");
+ #elif defined(__amd64__)
+ printf("AMD64\n");
+ #else
+ printf("Unknown\n");
+ #endif
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'');
+ $test=~s/\W//g;
+ $CPU=$conf{'TV_CPU'}=$test;
+ print "$test\n";
+}
+
+sub LookForGNUMake
+{
+ my $test;
+ print 'Looking for GNU make: ';
+
+ if ($conf{'GNU_Make'})
+ {
+ print "$conf{'GNU_Make'} (cached)\n";
+ return;
+ }
+ $test=RunRedirect('make --version',$ErrorLog);
+ if ($test=~/GNU Make/)
+ {
+ $conf{'GNU_Make'}='make';
+ print "make\n";
+ return;
+ }
+ $test=RunRedirect('gmake --version',$ErrorLog);
+ if ($test=~/GNU Make/)
+ {
+ $conf{'GNU_Make'}='gmake';
+ print "gmake\n";
+ return;
+ }
+ print "Unable to find GNU Make on this system.\n";
+ print "Please install it and be sure it's in your path.\n";
+ print "Also use `make' or `gmake' name for the binary.\n";
+ die;
+}
+
+sub LookForGNUar
+{
+ my $test;
+ print 'Looking for GNU ar: ';
+
+ if ($conf{'GNU_AR'})
+ {
+ print "$conf{'GNU_AR'} (cached)\n";
+ return $conf{'GNU_AR'};
+ }
+ $conf{'UseRanLib'}=0;
+ $test=RunRedirect('ar --version',$ErrorLog);
+ if ($test=~/GNU ar/)
+ {
+ $conf{'GNU_AR'}='ar';
+ print "ar\n";
+ return 'ar';
+ }
+ $test=RunRedirect('gar --version',$ErrorLog);
+ if ($test=~/GNU ar/)
+ {
+ $conf{'GNU_AR'}='gar';
+ print "gar\n";
+ return 'gar';
+ }
+ if (!LookForFileInPath('ar'))
+ {
+ print "Unable to find GNU ar on this system.\n";
+ print "Please install it and be sure it's in your path.\n";
+ print "Also use `ar' or `gar' name for the binary.\n";
+ die;
+ }
+ # I think all ar tools are usable but ...
+ if (($OSf eq 'Darwin') || ($OSf eq 'HP-UX') || ($OSf eq 'Tru64') ||
+ ($OSf eq 'Solaris'))
+ {
+ $conf{'GNU_AR'}='ar';
+ $conf{'UseRanLib'}=1;
+ print "ar (not GNU but usable!)\n";
+ return 'ar';
+ }
+ if ($OSf eq 'QNX4')
+ {
+ $conf{'GNU_AR'}='ar';
+ $conf{'UseRanLib'}=1;
+ print "ar (WATCOM)\n";
+ return 'ar';
+ }
+ print "Unable to find GNU ar on this system.\n";
+ print "Please install it and be sure it's in your path.\n";
+ print "Also use `ar' or `gar' name for the binary.\n";
+ die;
+}
+
+sub LookForGNUinstall
+{
+ my ($test,$test2,$res,$testErr);
+
+ print 'Looking for install tool: ';
+
+ if ($conf{'GNU_INSTALL'})
+ {
+ print "$conf{'GNU_INSTALL'} (cached)\n";
+ return $conf{'GNU_INSTALL'};
+ }
+ $conf{'SOLARIS_INSTALL'}=0;
+ $test=RunRedirect('install --version',$ErrorLog);
+ if ($test=~/Free Software Foundation/)
+ {
+ $conf{'GNU_INSTALL'}='install';
+ print "install\n";
+ return 'install';
+ }
+ $test2=RunRedirect('ginstall --version',$ErrorLog);
+ if ($test2=~/Free Software Foundation/)
+ {
+ $conf{'GNU_INSTALL'}='ginstall';
+ print "ginstall\n";
+ return 'ginstall';
+ }
+ if (!LookForFileInPath('install'.$ExeExt))
+ {
+ print "Unable to find 'install' on this system.\n";
+ print "Please install it and be sure it's in your path.\n";
+ print "Also use `install' or `ginstall' name for the binary.\n";
+ die;
+ }
+ $res='install';
+ # Solaris install is bizarre.
+ if ($OSf eq 'Solaris')
+ {
+ $conf{'SOLARIS_INSTALL'}=1;
+ }
+ # NetBSD install moves by default!!
+ elsif ($OSf eq 'NetBSD')
+ {
+ $res='install -c';
+ }
+ $conf{'GNU_INSTALL'}=$res;
+ print "$res\n";
+ return $res;
+}
+
+sub GenInstallDir()
+{
+ my ($mode,$dir)=@_;
+
+ return "\$(INSTALL) -d -m $mode $dir\n";
+}
+
+sub GenInstallFiles()
+{
+ my ($mode,$files,$dir)=@_;
+ my (@f,$fl,$ret,$first);
+
+ if ($conf{'SOLARIS_INSTALL'})
+ {# Silly, crappy one ;-)
+ @f=glob($files);
+ return "\$(INSTALL) -m $mode -f $dir $files\n" if scalar(@f)==1;
+ $ret='';
+ $first=1;
+ foreach $fl (@f)
+ {
+ if ($first)
+ {
+ $first=0;
+ }
+ else
+ {
+ $ret.="\t";
+ }
+ $ret.="\$(INSTALL) -m $mode -f $dir $fl\n";
+ }
+ return $ret;
+ }
+ return "\$(INSTALL) -m $mode $files $dir\n";
+}
+
+1;
diff --git a/tvision/copying b/tvision/copying
new file mode 100644
index 0000000..a43ea21
--- /dev/null
+++ b/tvision/copying
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/tvision/copying.rh b/tvision/copying.rh
new file mode 100644
index 0000000..54d0d07
--- /dev/null
+++ b/tvision/copying.rh
@@ -0,0 +1,46 @@
+RHIDE is copyright (C) 1996-1999 by Robert H”hne. It is distributed under
+the terms of the GPL which is written in the file COPYING.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+Additional permission:
+
+ As a special additional permission, the library librhuti which is
+ in the source tree of the RHIDE sources in the librhuti/
+ subdirectory can be distributed alone freely without any
+ restrictions. It is not limited to use under the terms of the GPL
+ or LGPL. For more information see the file COPYING.RHU in that
+ subdirectory.
+
+
+Non-binding request
+===================
+
+If you distribute RHIDE together with other products it would be nice,
+if you could give me a note about it so I'll be informed. Of course
+you can send me a copy of the distribution medium but this is not
+required.
+
+
+For contacting the author send electronic mail to
+
+robert.hoehne@gmx.net
+
+or paper mail to
+
+Robert Hoehne
+Am Berg 3
+D - 09573 Dittmannsdorf
+Germany
diff --git a/tvision/debian/.cvsignore b/tvision/debian/.cvsignore
new file mode 100644
index 0000000..0e62b95
--- /dev/null
+++ b/tvision/debian/.cvsignore
@@ -0,0 +1,5 @@
+rhtvision1
+rhtvision1.substvars
+files
+tmp
+
diff --git a/tvision/debian/README b/tvision/debian/README
new file mode 100644
index 0000000..74a3e3d
--- /dev/null
+++ b/tvision/debian/README
@@ -0,0 +1,34 @@
+ This directory contains scripts and helpers used to create DEB packages.
+ The name "debian" is because Debian created the DEB format. That's the
+same reason why the directory to create the .rpm files is called "redhat"
+even when a lot of distros based on RPMs are available.
+
+ These scripts are maintained by Ivan Baldo <ibaldo@adinet.com.uy> so you
+should ask Debian specific details to Ivan with Cc to me.
+
+ Using the .deb files instead of just using "make install" you'll get a much
+better integration of the library with your system.
+
+ In order to create the .deb files you need to install:
+
+A) Some packages used to create .deb files. I don't have a complete list at
+the moment but in my system I have: debianutils, debhelper, debconf-utils,
+dpkg-dev and devscripts.
+
+B) Some development packages. They are listed in the "Build-Depends" section
+of the debian/control file. If any of them is missing the Debian scripts will
+inform it.
+
+C) The fakeroot package if you want to create the .deb files running as a
+regular user (recommended).
+
+ To create the .deb files just run:
+
+$ debian/buildpackage
+
+ The resulting DEB files should be located in ../ (../rhtvision*.deb).
+ To remove the temporal files created by Debian scripts run:
+
+$ debian/rules clean
+
+$Id: README,v 1.2 2003/06/23 14:12:03 set Exp $
diff --git a/tvision/debian/README.debian b/tvision/debian/README.debian
new file mode 100644
index 0000000..0214fa2
--- /dev/null
+++ b/tvision/debian/README.debian
@@ -0,0 +1,19 @@
+RHTVision for DEBIAN
+--------------------
+This is an UNOFFICIAL package and IS NOT PART OF THE OFFICIAL DEBIAN
+DISTRIBUTION.
+Send bug reports to me directly and NOT to the DEBIAN BUG TRACKING SYSTEM.
+The original files are available for download at Borland's site and are
+provided gratis. It still not clear if the sources can be redistributed
+freely and we didn't get any reply from Borland's legal department.
+
+There is an APT repository on http://setedit.sourceforge.net/debian/,
+ofcourse you can manually download packages for installing with dpkg if you
+are not using APT.
+If using APT, add the following line to your /etc/apt/sources.list:
+ deb http://setedit.sourceforge.net/debian woody main
+You can substitute woody with the name of your distribution, for example
+potato, sarge or sid. The use of aliases like stable, testing or unstable is
+discouraged.
+
+Ivan Baldo <ibaldo@adinet.com.uy>, Wed, 17 Feb 1999 13:05:15 -0300
diff --git a/tvision/debian/buildpackage b/tvision/debian/buildpackage
new file mode 100644
index 0000000..a4d0494
--- /dev/null
+++ b/tvision/debian/buildpackage
@@ -0,0 +1,5 @@
+#!/bin/sh
+dh_testdir || exit $?
+chmod +x debian/rules
+dpkg-buildpackage -rfakeroot
+
diff --git a/tvision/debian/changelog b/tvision/debian/changelog
new file mode 100644
index 0000000..f5fc8ef
--- /dev/null
+++ b/tvision/debian/changelog
@@ -0,0 +1,543 @@
+rhtvision (2.2.0-1) unstable; urgency=low
+
+ * Added AlCon (Alegro conio emulation) driver.
+
+ -- Salvador E. Tropea <set@ieee.org> Tue, 23 Jun 2009 14:14:45 -0300
+
+rhtvision (2.1.0-5) unstable; urgency=low
+
+ * Modified to compile with Lenny (now stable)
+
+ -- Salvador E. Tropea <set@ieee.org> Thu, 26 Feb 2009 16:15:23 -0200
+
+rhtvision (2.1.0-4) unstable; urgency=low
+
+ * Accept Salvador changes in his 2.1.0-4 but fixed to depend first in the
+ current non-transitional-dummy package of the GPM library.
+ * Also put those changes in the control file in addition to the control.in
+ one.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Wed, 27 Aug 2008 00:34:14 -0300
+
+rhtvision (2.1.0-3) unstable; urgency=low
+
+ * Added XBS-Bugs: mailto:ibaldo@adinet.com.uy fields to the control file
+ so that reportbug sends bug reports to me instead of the Debian Bug
+ Tracking System.
+ * Bumped Standards-Version to 3.7.2.2, no changes.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Tue, 08 May 2007 16:13:42 -0300
+
+rhtvision (2.1.0-2) unstable; urgency=low
+
+ * No longer delete these files because they no longer exist or are deleted
+ by the upstream now: linuxso/gkeyli.cc, linuxso/instlib,
+ linuxso/rhide.env, linux/rhide.env, linuxso/Makefile, linuxso/compat.mak,
+ intl/es_iso.mo, intl/es_iso.po, intl/es.mo, intl/ru.mo, intl/pl.mo.
+ * If you want to compile with GCC 4.0.3 comment out #undef _LIBINTL_H and
+ #define _LIBINTL_H 1 in include/compatlayer.h.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Wed, 25 Jan 2006 20:21:46 -0200
+
+rhtvision (2.1.0-1) unstable; urgency=low
+
+ * New upstream version, still unstable so we cannot guarantee that nothing
+ bad happens to your dog if you use this stuff!
+ * Updated Build-Depends: added "file" (but I am not sure it is used or
+ needed, dpkg-depcheck reported it though), instead
+ of xlibs-dev | xlib6g-dev now it has libxmu-dev | xlibs-dev | xlib6g-dev
+ and libx11-dev | xlibs-dev | xlib6g-dev, this should give backwards
+ compatibility for various old Debian versions.
+ * Changed Depends of rhtvision*-dev package: removed libc6-dev and
+ libstdc++-dev since they are build-essential and also if someone is going
+ to compile something like a hello world in C++ they should have them,
+ instead of xlibs-dev | xlib6g-dev now it has libxmu-dev | xlibs-dev |
+ xlib6g-dev and libx11-dev | xlibs-dev | xlib6g-dev.
+ * Remove on clean the generated intl/pl.mo file (doh! come on Salvador!
+ provide a complete clean target! distribution packagers shouldn't be doing
+ this stuff).
+ * Bumped Standards-Version to 3.6.2.0, we should rename this package
+ librhtv but I don't like it too much.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Thu, 18 Aug 2005 22:50:33 -0300
+
+rhtvision (2.0.4-1) unstable; urgency=low
+
+ * New upstream version, this is unstable yet, beware!
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Thu, 23 Dec 2004 19:17:59 -0200
+
+rhtvision (2.0.3-3) unstable; urgency=low
+
+ * Salvador says this is it!, this is the version that will be officially
+ released! CVS release 2.599 2004/11/02 20:06:39.
+ Greetings to all my fans!!! (do I have one?) Anyway, I dedicate this
+ release to Enyunari!!!
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sun, 21 Nov 2004 16:29:07 -0200
+
+rhtvision (2.0.3-2) unstable; urgency=low
+
+ * With a new version of lintian it complained that we should not
+ build-depend on make and gzip because the first is a build-essential
+ package and the second is an essential package.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Tue, 5 Oct 2004 20:24:34 -0200
+
+rhtvision (2.0.3-1) unstable; urgency=low
+
+ * New upstream version! CVS release 2.573 2004/09/22 21:26:40.
+ * Its been so long... I don't remember almost anything about Debian
+ packaging; I was very quiet all this time, without doing testing releases
+ and without testing developer versions. I am extremely lazy since then,
+ not only for this but for many other things of life in general, my home
+ computer isn't very well maintained neither and I am not very aware about
+ Debian as I was before. Anyway, lets try to be a bit useful and at the
+ same time thankful of this superb software.
+ * Bumped Standards-Version to 3.6.1.0 (and I hope it complies!).
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sun, 26 Sep 2004 21:12:11 -0200
+
+rhtvision (2.0.2-1) unstable; urgency=low
+
+ * Upstream released a new fixed version! CVS release 2.493 2003/07/30
+ 19:43:18 with sticky tag r2_0_2-1.
+ * Upstream fixed the show-stoper bug regarding the not versioned tvision.mo
+ files.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sun, 10 Aug 2003 15:10:43 -0300
+
+rhtvision (2.0.2-0.1) unstable; urgency=low
+
+ * New upstream version! CVS release 2.487 2003/07/16 14:00:57.
+ * Sorry for the lateness, but I am very busy now, too much work, though I
+ don't regret! I finally got a good job!!!
+ * Salvador did changes to the Debian packaging:
+ - Don't build-depend on recode (not required anymore).
+ - Added README file, it is similar to maintainer.notes.
+ - Added --no-libs-here --real-prefix=/usr to ./configure.
+ - If tar fails when doing the backup of files modified doing the build it
+ doesn't stop the package generation, because some tar failings are due to
+ files not existing or silly errors.
+ - Added usr/bin directory to the -dev package, since it will contain the
+ rhtv-config program.
+ * Added doc/I18n.txt and doc/Streams.txt to the -dev package.
+ * Now sets the flags for the compiler in the environment instead of in the
+ make invocation.
+ * Specify explicitly -g and -Wall compiling options.
+ * Supports DEB_BUILD_OPTIONS as per Policy 3.5.7.
+ * Bumped Standards-Version to 3.5.8.0 (and I hope it complies!).
+ * Removed a lot of obsolete files in files_to_backup.
+ * Remove on clean makes/rhide.env, redhat/librhtv-*.spec and
+ makes/libtvfintl.a.
+ * The debian/copyright file references the GPL license text in the
+ /usr/share/common-licenses/ directory, thanks Lintian!!!
+ * Remove final dots in the single line description of the packages, thanks
+ Lintian!!!
+ * There is a pending bug with this library which forces this to not be an
+ official final release: the .mo files are called tvision.mo, thus if the
+ user wants to install 2 different versions of the library, one will
+ overwrite the other and dpkg will complain, and if we force dpkg to
+ continue anyway, the translations will be messed up for one version of
+ the library. This is not Debian specific though.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sun, 27 Jul 2003 19:00:47 -0300
+
+rhtvision (2.0.1-1) unstable; urgency=low
+
+ * Yeah!!! New upstream stable version!!! Great! Thanks to all the friends
+ working on this library, specially to Salvador!
+ * This Debian release is dedicated to the crew of the space shuttle
+ Columbia.
+ * Build-Depends on gettext and recode to ensure correct i18n support.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sat, 1 Feb 2003 16:57:54 -0300
+
+rhtvision (2.0.1-0.2) unstable; urgency=low
+
+ * New upstream version, not yet stable. CVS dated 13 Dec 2002.
+ * Added examples/bhelp/thelp.mak to files_to_backup.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sat, 14 Dec 2002 19:22:09 -0300
+
+rhtvision (2.0.1-0.1) unstable; urgency=low
+
+ * New upstream version, near to be stable. CVS dated 3 Dec 2002.
+ * Specify absolute path in the ./configure --prefix=foo, this fixes
+ problems with wrong installation of translation files (.mo).
+ * Remove intl/es_iso.mo, intl/es_iso.po, intl/es.mo and intl/ru.mo.
+ * Backup linux/libtvfintl.a.
+ * Add locale files to the runtime library package.
+ * I am looking for a job (a paid one) for a long time but things are really
+ dificult here in Uruguay, if you have a job for me, don't hesitate to
+ contact!
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Wed, 4 Dec 2002 12:21:54 -0300
+
+rhtvision (2.0.0-1) unstable; urgency=low
+
+ * Well, this could be the first stable version if there are no major
+ problems. CVS dated 30 Sep 2002.
+ * Someone stole my bicycle!!!
+ * Added new documentation: doc/CodePages.txt, doc/ConfigFile.txt,
+ doc/Eterm.txt, doc/Linux.txt, doc/TVReference.html, doc/XTerm.txt and
+ THANKS.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Thu, 3 Oct 2002 18:26:22 -0300
+
+rhtvision (2.0.0-0.5) unstable; urgency=low
+
+ * New beta from CVS dated 11 Sep 2002.
+ * Now is on feature freeze and testing period!!!
+ * Installs doc/X11.txt document (noticed by Salvador).
+ * Added information about APT repository in README.Debian.
+ * README.Debian wasn't being installed on the shared library package, only
+ in the -dev (static library) package, I don't know why dh_installdocs
+ just installs it for the 1st. package mentioned in debian/control only,
+ instead of installing it for all packages.
+ * debian/maintainer.notes: it was very outdated, now contains accurate and
+ more useful information.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Wed, 11 Sep 2002 15:00:44 -0300
+
+rhtvision (2.0.0-0.4) unstable; urgency=low
+
+ * New alpha from CVS dated 5 Sep 2002.
+ * Removed the add-log-mailing-address Emacs directive from the changelog
+ since the policy now prohibits it (detected by lintian).
+ * Implemented safe calls to ldconfig (detected by lintian), added file
+ debian/rhtvision.postrm for that (and remembered to update debian/rules
+ and lista).
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Thu, 5 Sep 2002 17:43:19 -0300
+
+rhtvision (2.0.0-0.3) unstable; urgency=low
+
+ * New alpha from CVS dated 25 jul 2002 (hey! that's my birthday!!!).
+ * Removed debian/manpage.1.ex since it is likely that this package will
+ never need it.
+ * I changed my email from lubaldo to ibaldo, so updated that everywhere.
+ * Backup the following files: examples/clipboard/test.mak,
+ examples/fonts/genraw.mak, examples/helpdemo/helpdemo.mak,
+ win32/Makefile.
+ * Added more comments to the debian/rules file, it seems that Salvador was
+ confused one time :).
+ * Removed some CVS files and directories that where appearing on the
+ rhtvision2.0.0 package.
+ * Changed dependencies a little on debian/control, to help Potato users and
+ making the package more robust when building (suggested by Salvador), not
+ depend on specific versions of libraries or use | operators.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Mon, 29 Jul 2002 16:49:04 -0300
+
+rhtvision (2.0.0-0.2) unstable; urgency=low
+
+ * New alpha from CVS dated 5 Jun 2002.
+ * Backup examples/tvhc/tvhc.mak.
+ * Don't remove win32/rhide.env but instead backup it.
+ * Don't remove winnt/Makefile.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Thu, 6 Jun 2002 15:47:59 -0300
+
+rhtvision (2.0.0-0.1) unstable; urgency=low
+
+ * New alpha upstream release with a lot of changes and improvements,
+ most notably: native X11 suport!
+ * Small changes to debian/rules and debian/files_to_backup regarding
+ removing and backup of some files.
+ * Remove CVS directories from packages.
+ * Use dh_installexamples to install the examples of the -dev package.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 14 May 2002 21:34:46 -0300
+
+rhtvision (1.1.4-1) unstable; urgency=low
+
+ * The "Ivan hates computers after having good vacations" release.
+ Well, I was on Punta del Este, good beachs, good womans, some fun
+ at night, and no computers :). My hate for computers is temporary
+ and it happens everytime I have good vacations, so don't worry.
+ * New stable version, it fixes some memory leaks, improves
+ compilation, some other tiny things, etc.
+ * No need to remove the configure.cache file from debian/rules, it
+ is done by the upstream makefile now.
+ * Added linuxso/makemak.pl and win32/rhide.env to the files_to_backup.
+ * Remove linuxso/rhide.env symlink on clean.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 8 Jan 2002 12:08:52 -0300
+
+rhtvision (1.1.3-3) unstable; urgency=low
+
+ * Finally! RHTVision 1.1.3 is officially stable now!
+ * There was an empty and useless usr/share/man/man3 directory on the
+ package, now is gone.
+ * Added compat/compat.mak to files_to_backup.
+ * Remove generated linuxso/instlib on clean.
+ * Don't remove linuxso/makemak.pl on clean.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 11 Nov 2001 15:41:50 -0300
+
+rhtvision (1.1.3-2) unstable; urgency=low
+
+ * Now compiles with -D_REENTRANT as Debian Policy mandates.
+ * Now runs ./configure before make clean (reported by Salvador).
+ * Don't eliminate the ldconfig invocation of the upstream Makefile,
+ it seems that upstream has corrected its Makefile now (done after
+ Salvador reported that it didn't work on all systems, because I was
+ overwriting the Makefile while I was reading it, specially on
+ multiprocesor systems).
+ * Added include/tv/configtv.h to files_to_backup.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Wed, 17 Oct 2001 16:29:17 -0300
+
+rhtvision (1.1.3-1) unstable; urgency=low
+
+ * New upstream version.
+ * Upstream added a "buildpackage" script, I don't see the point of
+ it but if it is of some use to Salvador or others, I will keep it.
+ * Modified the new debian/buildpackage script to check before trying
+ to do anything that it is being run from the right directory.
+ * Simplified the backup system by using a TAR archive instead of
+ copying and moving files around. Good idea from Salvador. At the
+ same time now timestamps are preserved so CVS checkins are faster.
+ * Uncommented out the binary-indep target, just in case.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 14 Oct 2001 01:15:59 -0300
+
+rhtvision (1.1.2-1) unstable; urgency=low
+
+ * New upstream version.
+ * Upstream provides clean target!!! At last!!! Let's use it.
+ * No more *.bkpdeb files on the distribution.
+ * Upstream clean is not complete yet, so we still clean some files on
+ our own.
+ * Added to backup system: linuxso/compat.mak and win32/Makefile.
+ * We delete the line containing 'ldconfig' on the Makefile, this
+ causes a failure when compiling with fakeroot.
+ * Added clean-debian to the .PHONY list.
+ * Added Replaces: rhtvision-dev for more easy upgrades.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 7 Oct 2001 18:18:56 -0300
+
+rhtvision (1.1.1-1) unstable; urgency=low
+
+ * New upstream release!!!
+ * Salvador (upstream) made minor changes to some descriptions on the
+ control file and README.Debian for better description of the
+ distribution issues.
+ * Salvador also made small modifications to debian/rules to adapt to
+ his changes of my previous patch for the -fPIC compilation of the
+ compat library.
+ * Now before building we backup upstream files that are regenerated
+ and on clean we restore that files from the backups, so you can
+ build, rebuild, clean, reclean and original files are maintained.
+ As a plus this allows me to do a diff file for the upstream without
+ hassles.
+ * Now removes all .cvsignore files from the packages.
+ * Added xlibs-dev to Build-Depends so that the library compiles with
+ enhanced support for Eterm 0.8.10+.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Fri, 28 Sep 2001 21:26:36 -0300
+
+rhtvision (1.1.0-1) unstable; urgency=low
+
+ * New upstream version! Rejoice.
+ * Modified compat/ticks.c to include stdlib.h otherwise NULL is
+ undefined.
+ * Updated cleaning of generated files.
+ * Support for compiling the compatibility library with PIC code (thanks
+ Lintian for reporting this!).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Fri, 10 Aug 2001 16:07:50 -0300
+
+rhtvision (1.0.9-4) unstable; urgency=low
+
+ * Long time ago, this package (and other depending package) had to be
+ removed from the Debian distribution because of yet unresolved legal
+ problems with Inprise, fortunately the package had not been distributed
+ with any official Debian release.
+ * Slight changes to upstream source to make it compile on current
+ unstable distribution.
+ * Debian control file updated for new dependencies.
+ * Standards version 3.5.2.0.
+ * Do not use now deprecated dh_testversion, use a versioned build-dependency
+ on DebHelper instead.
+ * Made it clear that this is not an official package and that it is not
+ redistributable (control file, copyright, README.Debian, etc.).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 10 Jun 2001 19:05:26 -0300
+
+rhtvision (1.0.9-3) unstable; urgency=low
+
+ * Standards version 3.1.0.
+ * Added Build-Depends.
+ * Architecture set to "any" instead of "i386 alpha" as requested by
+ Roman Hodek. This library isn't tested on other architectures other
+ than i386 or alpha, so, testing is needed and reports of success or
+ failures will be apreciated.
+ See bug 50319.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Wed, 1 Dec 1999 00:38:51 -0300
+
+rhtvision (1.0.9-2) unstable; urgency=low
+
+ * Don't install manpage (symlink to undocumented(7) manpage).
+ * Remove .cvsignore file in usr/share/doc/rhtvision-dev/examples
+ directory.
+ * Don't use install-stamp (in rules file) anymore, to avoid possible
+ duplicate strings in maintainer script fragment files (see
+ debhelper changelog of version 2.0.56).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Mon, 1 Nov 1999 13:01:46 -0300
+
+rhtvision (1.0.9-1) unstable; urgency=low
+
+ * New upstream version:
+ - Better support for greek keyboards.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 26 Oct 1999 11:24:14 -0300
+
+rhtvision (1.0.8-3) unstable; urgency=low
+
+ * Previous version had wrong shlibs file.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 26 Sep 1999 17:53:59 -0300
+
+rhtvision (1.0.8-2) unstable; urgency=low
+
+ * Upstream sent newer compilation scripts (bugfixes, enhancements).
+ * Modified and bugfixed debian/maintainer.notes.
+ * Now shared library package Conflicts: rhtvision1. This is to force
+ the people who installed the previously broken library to uninstall
+ that library and its programs and upgrade everything. Sorry.
+ * Now rm -f linuxso/librhtv.so on clean.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 21 Sep 1999 12:50:24 -0300
+
+rhtvision (1.0.8-1) unstable; urgency=low
+
+ * New upstream version:
+ - Various bugfixes.
+ - Various improvements.
+ - Building system changed!
+ - Soname changes with every version (since every version is binary
+ incompatible).
+ * Now the -dev package depends on libstdc++-dev.
+ * Architecture is now i386 and alpha.
+ * Changed the name of the package from rhtvision to rhtvision1.0.8.
+ This name will change for every version of the library, since
+ every version is binary incompatible with the others.
+ * Improved and updated debian/maintainer.notes, please read it.
+ * Not include debugging version of the static library anymore.
+ If someone needs this, then tell me and I will include it again.
+ * Now requires debhelper 2.0.40 or greater (FHS related).
+ * Added DH_COMPAT=1 to debian/rules.
+ * Don't use .dirs files anymore.
+ * Don't use .files files anymore.
+ * Don't use .docs files anymore.
+ * Various changes to debian/rules file.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Wed, 8 Sep 1999 15:33:29 -0300
+
+rhtvision (1.0.7-1) unstable; urgency=low
+
+ * rhtvision1-dev now goes in the devel section instead of the libs
+ one.
+ * New upstream version:
+ - Enhancements to the menu bar.
+ - Now runs on the Alpha processors.
+ - Bugfixes.
+ - Works better under xterm.
+ - Shorter ESC delay.
+ - Enhancements to the documentation.
+ - Runs better when you have write only permission for the vcsa's.
+ - Disabled CTRL+Z because it is dangerous.
+ - Other minor enhancements.
+ * Added source dependencies to debian/maintainer.notes.
+ * Modified #!/bin/sh to #!/bin/sh -e for better error detection.
+ * Policy 3.0.0 compliant (FHS move).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Mon, 26 Jul 1999 17:19:36 -0300
+
+rhtvision (1.0.5-2) unstable; urgency=low
+
+ * I don't use dh_installexamples anymore, since it doesn't work for
+ me, instead I install the examples manually. So, there isn't
+ anymore the /usr/doc/rhtvision1-dev/examples/examples directory,
+ instead, there's only one examples directory.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 1 Jun 1999 19:02:12 -0300
+
+rhtvision (1.0.5-1) unstable; urgency=low
+
+ * New upstream version:
+ - Bugfixes.
+ - Debian diffs incorporated on upstream source.
+ - Renamed the name of the library from libtv to librhtv.
+ - Some more classes added.
+ * Standards version now is 2.5.0.0 (no changes).
+ * Instead of doing the symlinks manually, now I use dh_link.
+ * Now requires debhelpers >= 1.2.9.
+ * Mention in debian/maintainer.notes that debian/rules should be mode
+ 755.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 6 Apr 1999 22:24:13 -0300
+
+rhtvision (1.0.3-6) unstable; urgency=low
+
+ * Removed postrm for rhtvision1-dev and rhtvision1, since it is not
+ necessary.
+ * Removed postinst for rhtvision1-dev since it is not necessary.
+ * Packages checked with Lintian, there are some warnings yet...
+ * Added maintainer.notes, gives usefull information for the
+ maintainer (hey, thats me!).
+ * I forgot about doing a symlink in the rhtvision1-dev package from
+ rhtvision1.so to rhtvision1.so.1.0.3 (Lintian not complained about
+ this!).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Fri, 5 Mar 1999 16:04:23 -0300
+
+rhtvision (1.0.3-5) unstable; urgency=low
+
+ * Applied patches from upstream maintainer. Avoiding deleting some
+ files that should not be deleted, added a clean-debian rule to
+ clean Debian specific files, only headers files are copied from the
+ include directory, and corrected the copying of files in the
+ example directory (it seems that the author has some files there
+ that don't need to be copied, dh_installexamples doesn't help very
+ much...).
+ * Made the clean target to depend on clean-debian, to avoid
+ repetition of code.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Mon, 1 Mar 1999 00:29:43 -0300
+
+rhtvision (1.0.3-4) unstable; urgency=low
+
+ * I don't remembered to add -lgpm on the upstream makemak.pl file.
+ * Now the symlink is forced (-f parameter to ln).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 28 Feb 1999 23:37:46 -0300
+
+rhtvision (1.0.3-3) unstable; urgency=low
+
+ * Removed some .ex files that never will be necessary.
+ * Corrected upstream makemak.pl script to make a shared library that
+ has dependencies, also added -pipe switch to gcc (little faster).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 28 Feb 1999 22:35:57 -0300
+
+rhtvision (1.0.3-2) unstable; urgency=low
+
+ * Lots of bugfixes and now it works.
+ * First version showed to the upstream authors.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Fri, 19 Feb 1999 02:14:01 -0300
+
+rhtvision (1.0.3-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Wed, 17 Feb 1999 13:05:15 -0300
+
+Local variables:
+mode: debian-changelog
+End:
diff --git a/tvision/debian/control b/tvision/debian/control
new file mode 100644
index 0000000..3178e52
--- /dev/null
+++ b/tvision/debian/control
@@ -0,0 +1,43 @@
+Source: rhtvision
+Section: libs
+Priority: optional
+Maintainer: Ivan Baldo <ibaldo@adinet.com.uy>
+Build-Depends: perl | perl5, libncurses-dev, libgpm-dev | libgpmg1-dev, debhelper (>=2.0.40), libx11-dev | xlibs-dev | xlib6g-dev, libxmu-dev | xlibs-dev | xlib6g-dev, gettext, file
+Standards-Version: 3.7.2.2
+
+Package: rhtvision2.2.0-dev
+Architecture: any
+Section: devel
+Depends: rhtvision2.2.0, libncurses-dev, libgpm-dev | libgpmg1-dev, libx11-dev | xlibs-dev | xlib6g-dev, libxmu-dev | xlibs-dev | xlib6g-dev
+Provides: rhtvision-dev
+Conflicts: rhtvision-dev
+Replaces: rhtvision-dev
+XB-Bugs: mailto:ibaldo@adinet.com.uy
+Description: Development files for the RHTVision library - a TUI interface
+ This is the statically linked library and header files for the development
+ of applications using the RHTVision library. You need to install this package
+ only if you want to develop or compile programs using the RHTVision library.
+ .
+ THIS IS NOT AN OFFICIAL PACKAGE AND IS NOT PART OF THE DEBIAN DISTRIBUTION.
+
+Package: rhtvision2.2.0
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends}
+Conflicts: rhtvision1
+XB-Bugs: mailto:ibaldo@adinet.com.uy
+Description: The RHTVision library - TUI interface for console applications
+ This is the shared library for programs using the RHTVision library.
+ .
+ The RHTVision library gives an intuitive and user friendly TUI (Textual User
+ Interface) for programs using this library and running in a text console.
+ .
+ This library is based on the Turbo Vision library made by Borland Corporation.
+ It was interpreted by its upstream authors that the original Turbo Vision
+ library was released by Borland (now Inprise) under a Public Domain license,
+ but this seems to not be true.
+ .
+ There's a DOS and Win32 version of this library and on GNU/Linux runs on Alpha
+ and i386 processors.
+ .
+ THIS IS NOT AN OFFICIAL PACKAGE AND IS NOT PART OF THE DEBIAN DISTRIBUTION.
diff --git a/tvision/debian/control.in b/tvision/debian/control.in
new file mode 100644
index 0000000..41f9794
--- /dev/null
+++ b/tvision/debian/control.in
@@ -0,0 +1,43 @@
+Source: rhtvision
+Section: libs
+Priority: optional
+Maintainer: Ivan Baldo <ibaldo@adinet.com.uy>
+Build-Depends: perl | perl5, libncurses-dev, libgpm-dev | libgpmg1-dev, debhelper (>=2.0.40), libx11-dev | xlibs-dev | xlib6g-dev, libxmu-dev | xlibs-dev | xlib6g-dev, gettext, file
+Standards-Version: 3.7.2.2
+
+Package: rhtvision@version@-dev
+Architecture: any
+Section: devel
+Depends: rhtvision@version@, libncurses-dev, libgpm-dev | libgpmg1-dev, libx11-dev | xlibs-dev | xlib6g-dev, libxmu-dev | xlibs-dev | xlib6g-dev
+Provides: rhtvision-dev
+Conflicts: rhtvision-dev
+Replaces: rhtvision-dev
+XB-Bugs: mailto:ibaldo@adinet.com.uy
+Description: Development files for the RHTVision library - a TUI interface
+ This is the statically linked library and header files for the development
+ of applications using the RHTVision library. You need to install this package
+ only if you want to develop or compile programs using the RHTVision library.
+ .
+ THIS IS NOT AN OFFICIAL PACKAGE AND IS NOT PART OF THE DEBIAN DISTRIBUTION.
+
+Package: rhtvision@version@
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends}
+Conflicts: rhtvision1
+XB-Bugs: mailto:ibaldo@adinet.com.uy
+Description: The RHTVision library - TUI interface for console applications
+ This is the shared library for programs using the RHTVision library.
+ .
+ The RHTVision library gives an intuitive and user friendly TUI (Textual User
+ Interface) for programs using this library and running in a text console.
+ .
+ This library is based on the Turbo Vision library made by Borland Corporation.
+ It was interpreted by its upstream authors that the original Turbo Vision
+ library was released by Borland (now Inprise) under a Public Domain license,
+ but this seems to not be true.
+ .
+ There's a DOS and Win32 version of this library and on GNU/Linux runs on Alpha
+ and i386 processors.
+ .
+ THIS IS NOT AN OFFICIAL PACKAGE AND IS NOT PART OF THE DEBIAN DISTRIBUTION.
diff --git a/tvision/debian/copyright b/tvision/debian/copyright
new file mode 100644
index 0000000..5972e80
--- /dev/null
+++ b/tvision/debian/copyright
@@ -0,0 +1,15 @@
+This package was debianized by Ivan Baldo ibaldo@adinet.com.uy on
+Wed, 17 Feb 1999 13:05:15 -0300.
+
+For more information of the upstream source or if you want to obtain it,
+visit 'http://www.geocities.com/SiliconValley/Vista/6552/tvision.html'.
+
+Upstream author/maintainer: Salvador Eduardo Tropea <salvador@inti.gov.ar>.
+Upstream initial author: Robert Hoehne <robert.hoehne@gmx.net>.
+
+Copyright:
+GPL, but wide redistribution is questioned because of unresolved legal
+problems with Borland, please, contact upstream authors for more information.
+On Debian systems, the complete text of the GNU General Public License can be
+found in `/usr/share/common-licenses/GPL'.
+
diff --git a/tvision/debian/diversions.ex b/tvision/debian/diversions.ex
new file mode 100644
index 0000000..aebbbe5
--- /dev/null
+++ b/tvision/debian/diversions.ex
@@ -0,0 +1 @@
+<FILE> <Diverted to> <Packagename>
diff --git a/tvision/debian/files_to_backup b/tvision/debian/files_to_backup
new file mode 100644
index 0000000..c8383d3
--- /dev/null
+++ b/tvision/debian/files_to_backup
@@ -0,0 +1 @@
+linux/libtvfintl.a
diff --git a/tvision/debian/info.ex b/tvision/debian/info.ex
new file mode 100644
index 0000000..05a4bde
--- /dev/null
+++ b/tvision/debian/info.ex
@@ -0,0 +1,15 @@
+# This is a configuration files for installing a .info menu
+# The Description to be placed into the directory
+DESCR="Description"
+
+# The section this info file should be placed in (Regexp) followed by
+# the new section name to be created if the Regexp does not match
+# (Optional. If not given the .info will be appended to the directory)
+#SECTION_MATCH="Regexp"
+#SECTION_NAME="New Section Name"
+
+# The file referred to from the Info directory
+FILE=rhtvision.info
+
+# Optional. The files to be copied to /usr/info
+#FILES=*.info
diff --git a/tvision/debian/maintainer.notes b/tvision/debian/maintainer.notes
new file mode 100644
index 0000000..03ded78
--- /dev/null
+++ b/tvision/debian/maintainer.notes
@@ -0,0 +1,30 @@
+How to unpack and prepare the files:
+ Make sure that the debian/rules file is executable
+(chmod 755 debian/rules).
+ In the file called version.txt in the root directory where you unpacked
+the library, is the version number. If the debian/changelog file has a
+different version number in the topmost change, then add a new change by
+running dch -v 1.0.8-0.1 -p "unofficial personal package" (replacing 1.0.8 by
+the current version number. Then modify the versions in the debian/control
+file to match those of the library.
+
+How to make the .deb, .tar.gz, .dsc and .changes files:
+ cd rhtvision-directory
+ dpkg-buildpackage -rfakeroot
+
+To check the package (binary and source):
+ cd ..
+ lintian -i *.deb *.dsc
+
+To clean everything after building:
+ cd rhtvision-directory
+ fakeroot debian/rules clean
+
+Other notes:
+ - There is a clean-debian target on the debian/rules file, it only cleans
+ Debian specific files and not upstream build files. It is useful when
+ you just want for example to rebuild the package without recompiling
+ the sources (use debian/rules clean-debian).
+ - To rebuild the packages without recompiling the sources, use the binary
+ target on the debian/rules file (debian/rules binary).
+
diff --git a/tvision/debian/rhtvision.postinst b/tvision/debian/rhtvision.postinst
new file mode 100644
index 0000000..fbad76b
--- /dev/null
+++ b/tvision/debian/rhtvision.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+if [ "$1" = "configure" ]; then
+ ldconfig
+fi
+
+#DEBHELPER#
diff --git a/tvision/debian/rhtvision.postrm b/tvision/debian/rhtvision.postrm
new file mode 100644
index 0000000..7a49c1d
--- /dev/null
+++ b/tvision/debian/rhtvision.postrm
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+if [ "$1" = "remove" ]; then
+ ldconfig
+fi
+
+#DEBHELPER# \ No newline at end of file
diff --git a/tvision/debian/rules b/tvision/debian/rules
new file mode 100644
index 0000000..15849da
--- /dev/null
+++ b/tvision/debian/rules
@@ -0,0 +1,138 @@
+#!/usr/bin/make -f
+# Made with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# This version is for a hypothetical package that builds an
+# architecture-dependant package, as well as an architecture-independant
+# package.
+
+version=$(shell cat version.txt)
+package=rhtvision
+destdir=$(shell pwd)/debian/tmp/usr
+
+# Uncomment this to turn on verbose mode:
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use:
+export DH_COMPAT=1
+
+# Set CFLAGS according to the Debian Policy:
+CFLAGS = -D_REENTRANT -g -Wall
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+CXXFLAGS = $(CFLAGS)
+
+
+# Compile the beast!:
+build: build-stamp
+build-stamp: debianbackup.tar
+ dh_testdir
+# Rename debian/rhtvision.postinst file if it exists (and others):
+ifneq ($(wildcard debian/rhtvision.postinst),)
+ mv debian/rhtvision.postinst debian/rhtvision$(version).postinst
+ mv debian/rhtvision.postrm debian/rhtvision$(version).postrm
+endif
+ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure \
+ --prefix=$(destdir) --fhs --no-libs-here --real-prefix=/usr
+ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" $(MAKE)
+ touch build-stamp
+
+
+# Clean everything as if nothing happened :) :
+clean: clean-debian debianbackup.tar
+# If we don't configure there is no guarantee that we have a Makefile:
+ ./configure --prefix=$(destdir) --fhs --no-libs-here --real-prefix=/usr
+ $(MAKE) clean
+# Restore upstream provided regenerated files:
+ test -e debianbackup.tar && tar -xf debianbackup.tar
+ rm -f debianbackup.tar
+# FIXME: ask upstream about adding the next files to his clean target:
+ rm -f compat/rhide.env examples/rhide.env include/tv/configtv.h Makefile \
+ makes/rhide.env redhat/librhtv-*.spec makes/libtvfintl.a
+ rm -f build-stamp
+
+# Use the following target when you just want for example to rebuild the
+# package without recompiling the sources:
+clean-debian:
+ dh_testdir
+ dh_testroot
+# Rename rhtvision$(version).postinst file if it exists (and others):
+ifneq ($(wildcard debian/rhtvision$(version).postinst),)
+ mv debian/rhtvision$(version).postinst debian/rhtvision.postinst
+ mv debian/rhtvision$(version).postrm debian/rhtvision.postrm
+endif
+ dh_clean
+
+# Let's backup modified files to restore them later!:
+debianbackup.tar:
+ dh_testdir
+# Backup upstream provided regenerated files:
+ -tar -cf debianbackup.tar --files-from=debian/files_to_backup
+
+
+# Copy needed files to the temporary directories for the packages:
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean
+ dh_installdirs -p $(package)$(version)-dev usr/lib usr/bin \
+ usr/include/$(package) usr/share/doc \
+ usr/share/doc/$(package)$(version)-dev \
+ usr/share/doc/$(package)$(version)-dev/examples
+ dh_installdirs -p $(package)$(version) usr/lib usr/share \
+ usr/share/doc/$(package)$(version) \
+ usr/share/doc/$(package)$(version)/eterm
+ $(MAKE) install
+# We need to move files for other packages than the first one in the control file:
+ dh_movefiles -p $(package)$(version) usr/lib/librhtv.so.$(version) \
+ usr/share/locale/
+
+
+# Build the packages for a specific architecture:
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs -A borland.txt copying copying.rh readme.txt \
+ doc/CodePages.txt doc/ConfigFile.txt doc/Eterm.txt doc/Linux.txt \
+ doc/X11.txt doc/XTerm.txt THANKS
+ dh_installdocs -p $(package)$(version)-dev doc/TVReference.html \
+ doc/I18n.txt doc/Streams.txt
+ dh_installdocs -p $(package)$(version) extra/eterm/ debian/README.debian
+ mv debian/$(package)$(version)/usr/share/doc/$(package)$(version)/README.debian \
+ debian/$(package)$(version)/usr/share/doc/$(package)$(version)/README.Debian
+ dh_installexamples -p $(package)$(version)-dev examples/*
+ find $(destdir) debian/$(package)$(version) \
+ \( -name '.cvsignore' -o -name 'CVS' -prune \) -exec rm -rf '{}' \;
+# dh_installmenu
+# dh_installemacsen
+# dh_installinit
+# dh_installcron
+# dh_installmanpages
+# dh_undocumented -p $(package)$(version) rhtvision.3
+ dh_installchangelogs change.log
+ dh_strip
+ dh_compress
+ dh_fixperms
+# dh_suidregister
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_makeshlibs -m$(version)
+ dh_md5sums
+ dh_builddeb
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+#This package doesn't have architecture-independent files for the moment...
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+# Build all the packages:
+binary: binary-indep binary-arch
+
+.PHONY: build clean binary-indep binary-arch binary clean-debian
+
diff --git a/tvision/debian/shlibs.local.ex b/tvision/debian/shlibs.local.ex
new file mode 100644
index 0000000..c5cb1ba
--- /dev/null
+++ b/tvision/debian/shlibs.local.ex
@@ -0,0 +1 @@
+librhtvision 1.0.5 rhtvision (>> 1.0.5-0), rhtvision (<< 1.0.5-99)
diff --git a/tvision/debian/watch.ex b/tvision/debian/watch.ex
new file mode 100644
index 0000000..3313fc8
--- /dev/null
+++ b/tvision/debian/watch.ex
@@ -0,0 +1,5 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# Site Directory Pattern Version Script
+sunsite.unc.edu /pub/Linux/Incomingu rhtvision-*.tar.gz debian uupdate
diff --git a/tvision/djgpp/compress.bat b/tvision/djgpp/compress.bat
new file mode 100644
index 0000000..385a80f
--- /dev/null
+++ b/tvision/djgpp/compress.bat
@@ -0,0 +1,2 @@
+@Echo off
+@perl compress.pl
diff --git a/tvision/djgpp/compress.pl b/tvision/djgpp/compress.pl
new file mode 100644
index 0000000..9458b3f
--- /dev/null
+++ b/tvision/djgpp/compress.pl
@@ -0,0 +1,111 @@
+#!/usr/bin/perl
+# Copyright (C) 1999-2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Creates a distribution zip file.
+#
+require "../miscperl.pl";
+
+GetVersion('../');
+
+$r=cat('../include/tv.h');
+if ($r!~/$Version/)
+ {
+ die "Error! inconsistent version in tv.h\n";
+ }
+
+$doBinary=0;
+foreach $i (@ARGV)
+ {
+ if ($i eq '--binary')
+ {
+ $doBinary=1;
+ }
+ else
+ {
+ print "Unknown command line option: $i\n";
+ print "Usage: compres.pl [--binary]\n\n";
+ }
+ }
+
+# BC++ 5.5 Makefile
+chdir('..');
+`perl confignt.pl`;
+chdir('djgpp');
+# Patch the version number in the readme.txt
+print "Processing readme file\n";
+$r=cat('../readme.in');
+$r=~s/\@version\@/$Version/g;
+replace('../readme.txt',$r);
+
+# Generate the manifest and version files
+$nv=$Version;
+$nv=~ s/\.//g;
+$binmft="manifest/tv$nv".'b.mft';
+$binver="manifest/tv$nv".'b.ver';
+$srcmft="manifest/tv$nv".'s.mft';
+$srcver="manifest/tv$nv".'s.ver';
+
+chdir('../../..');
+
+open(FIL,'contrib/tvision/lista');
+@files=<FIL>;
+close(FIL);
+$r='';
+foreach $i (@files)
+ {
+ if (($i =~ /debian\//) || ($i =~ /redhat\//))
+ {
+ next;
+ }
+ if ((substr($i,0,1) eq '-') or (substr($i,0,1) eq '+'))
+ {
+ $i=substr($i,1);
+ }
+ $r.='contrib/tvision/'.$i;
+ }
+# Add example makefiles
+@files=glob('contrib/tvision/examples/*/*.?mk');
+$r.="\n".join("\n",@files);
+@files=glob('contrib/tvision/examples/*/*/*.?mk');
+$r.="\n".join("\n",@files);
+@files=glob('contrib/tvision/examples/*/*.mkf');
+$r.="\n".join("\n",@files);
+@files=glob('contrib/tvision/examples/*/*/*.mkf');
+$r.="\n".join("\n",@files);
+# Manifest and version
+$r.="\n$srcmft\n$srcver\n";
+# Sort the list
+@files=split(/\n/,$r);
+@files=sort(@files);
+$r=join("\n",@files);
+replace($srcmft,$r);
+
+open(FIL,'contrib/tvision/djgpp/distlist') || die "Can't open distrib list";
+@files=<FIL>;
+close(FIL);
+$r='';
+foreach $i (@files)
+ {
+ chop($i);
+ print 'contrib/'.$i."\n";
+ $r.=join("\r",glob('contrib/'.$i))."\r";
+ }
+$r.="$binmft\n$binver\n";
+replace($binmft,$r);
+replace($binver,"Turbo Vision - C++ Text User Interface library, binaries (version $Version)");
+replace($srcver,"Turbo Vision - C++ Text User Interface library, sources (version $Version)");
+
+# Generate the zip files
+$bindist="tv$nv".'b.zip';
+$srcdist="tv$nv".'s.zip';
+unlink($bindist,$srcdist);
+print "\nGenerating source distribution\n\n";
+system("zip -9 $srcdist \@$srcmft");
+if ($doBinary)
+ {
+ print "\nGenerating binary distribution\n\n";
+ system("zip -9 $bindist \@$binmft");
+ }
+
+chdir('contrib/tvision/djgpp');
diff --git a/tvision/djgpp/distlist b/tvision/djgpp/distlist
new file mode 100644
index 0000000..828bb85
--- /dev/null
+++ b/tvision/djgpp/distlist
@@ -0,0 +1,9 @@
+tvision/readme.txt
+tvision/copying*
+tvision/borland.txt
+tvision/djgpp/librhtv.a
+tvision/include/*.h
+tvision/djgpp/sacadeb.bat
+tvision/djgpp/tmp/delete.me
+tvision/djgpp/obj/delete.me
+tvision/change.log
diff --git a/tvision/djgpp/sacadeb.bat b/tvision/djgpp/sacadeb.bat
new file mode 100644
index 0000000..d9089f6
--- /dev/null
+++ b/tvision/djgpp/sacadeb.bat
@@ -0,0 +1,10 @@
+cp librhtv.a tmp
+cd tmp
+ar -x librhtv.a
+strip --strip-debug *.o
+ar -r librhtv.a *.o
+mv ../librhtv.a ../libtvdb.a
+mv librhtv.a ..
+rm *
+cd ..
+
diff --git a/tvision/djgpp/tmp/delete.me b/tvision/djgpp/tmp/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/tvision/djgpp/tmp/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/tvision/doc/Alcon.txt b/tvision/doc/Alcon.txt
new file mode 100644
index 0000000..5887a20
--- /dev/null
+++ b/tvision/doc/Alcon.txt
@@ -0,0 +1,112 @@
+Driver: Alcon
+Author: Grzegorz Adam Hankiewicz, Salvador E. Tropea
+Status: Not complete
+Revision: $Revision: 1.2 $
+
+This is the driver used for various platforms using the Allegro
+(a game programming library): http://alleg.sourceforge.net/.
+It has the potential of running under the same platforms supported
+by Allegro, but at the moment it is being tested only under Linux
+(X11 driver precisely).
+
+
+1. INTRODUCTION
+2. FEATURES
+3. CONFIGURATION VARIABLES SPECIFIC FOR THIS DRIVER
+
+
+1. INTRODUCTION
+
+ You will need a version of Allegro installed on your system. The
+ driver has the potential to work with a stable Allegro release
+ (4.0.x), but on my system I always have the latest unstable
+ branch (4.1.x), so you might need this to build the driver. In
+ the future I'll make sure it works with 4.0.x, at the moment I
+ don't really care as there are not many users (two?).
+
+ Building of the examples/demo seems to work ok. Building of
+ Setedit is at the moment not automatic. In order to have
+ this driver built by TVision, you need to explicitly pass
+ "--with-alcon" to the configure script. And verify that Allegro
+ is OK in the output.
+
+ Also, any TVision programs you build with this driver will now
+ need the END_OF_MAIN() macro at the end of your main entry point,
+ like this:
+
+ #define Uses_TProgram
+ #include <tv.h>
+
+ int main(int argc, char *argv[])
+ {
+ ...
+ }
+ END_OF_MAIN();
+
+ That's needed for Allegro's internal machinery. In order to have
+ the END_OF_MAIN declaration you have to request TProgram class,
+ but that's usually requested by all sources declaring main.
+
+
+2. FEATURES
+
+ The driver supports (or rather will some day):
+
+ * Fonts.
+ * Palette.
+ * Most keyboard combinations, as long as Allegro's driver allows.
+ * Mouse.
+ * Weird graphic cursor capabilities.
+
+
+3. CONFIGURATION VARIABLES SPECIFIC FOR THIS DRIVER
+
+ Please read the documentation about the configuration file first.
+
+ This driver has by default a very low priority. It is in
+ development, so you will need to bump the priority integer to
+ see it working. If you can't see any graphical difference between
+ X11 and Alcon, that means Alcon might not have been selected as
+ output driver. Ctrl+Alt+End (standard Allegro shutdown keyboard
+ shortcut) to see if the program finishes.
+
+ Example of configuration file ~/.tvrc:
+
+ [TV]
+ {
+ [Alcon]
+ {
+ Priority=220
+ KeyboardMapping="langcode"
+ CursorHideNormal=1
+ CursorOnSquare=10
+ CursorOnCross=15
+ }
+ }
+
+ The priority has to be an integer number. The higher it is, the
+ most likely the AlCon driver will be selected (or rather, tried
+ before others).
+
+ The KeyboardMapping is a string specifying the keyboard mapping
+ that should be used. By default Allegro looks for an allegro.cfg
+ file with the correct keyboard specification. To avoid creating
+ one, you can use this variable, which overrides whatever selection
+ is used later by Allegro. langcode is a two letter string with
+ the iso name of the language. Note that the keyboard mapping
+ datafile (keyboard.dat) has to be available somewhere on your
+ system for this to have any effect at all.
+
+ CursorHideNormal is an integer variable. If it is different than
+ zero, the normal cursor won't be drawn ever.
+
+ CursorOnSquare is an integer variable. If it is different than
+ zero, a square will be drawn bordering the cell the cursor is at.
+
+ CursorOnCross is an integer variable. If it is different than
+ zero, a cross will be drawn through the cell the cursor is at.
+
+ Note: All the integer variables related to the cursor are
+ accumulative. This means you can set many at the same time and
+ get their combined effect.
+
diff --git a/tvision/doc/CodePages.txt b/tvision/doc/CodePages.txt
new file mode 100644
index 0000000..9d5b258
--- /dev/null
+++ b/tvision/doc/CodePages.txt
@@ -0,0 +1,219 @@
+Topics: Code Pages, TVCodePage
+Author: Salvador E. Tropea
+Status: Complete
+Revision: $Revision: 1.1 $
+
+1. INTRODUCTION
+2. CODE PAGES IN TURBO VISION
+3. FROM THE POINT OF VIEW OF THE USER
+4. SUPPORTED ENCODINGS
+5. FROM THE POINT OF VIEW OF THE PROGRAMMER
+5.1 START UP AND CHANGES ON THE FLY
+5.2 OTHER USEFUL INFORMATION
+
+
+1. INTRODUCTION
+
+ Most applications, Turbo Vision applications included, uses 8 bits
+characters. It gives 256 possible combinations, but: what exactly means each
+one? it depends on the system. To avoid problems some standars exists. DOS
+uses some IBM/ANSI encodings like code page 437, 850, 866, etc., Windows uses
+another set of code pages created by Microsoft (code pages 1250, 1251, etc.)
+and most UNIX systems uses enconding described in the ISO 8859 standard.
+ In this way a document is:
+
+1) Compact, each character/letter needs one byte.
+2) Exchangeable, you can use documents from other system just knowing which
+encoding is used.
+
+ Linux users should also read the Linux driver documentation, it have a lot
+of information about the problems found on Linux systems.
+
+
+2. CODE PAGES IN TURBO VISION
+
+ TV uses code pages for four things. Three of them are really important for
+users so we will focus only these three.
+ The first is the "Application code page". This code page indicates how the
+application is encoded. An example of "application" stuff is the text you
+load in TV editor.
+ The second is the "Screen code page". This is how the screen is encoded.
+That's usually the same used for the application, but not always. An
+interesting case is Linux where the screen can have any arbitrary encoding.
+ And the third is the "Input code page". That's how is encoded the text from
+the keyboard. That's usually the same as the screen. An interesting case is
+Win32 console API, it supports a different code page for input, but I never
+saw a system configured like this.
+ Note that the application code page is how things are encoded internally,
+input code pages is the encoding of the input and screen code page is the
+encoding of the output. The center is the application. If any of the other
+two code pages doesn't match a translation table is created. So you could
+have a system where the accented characters from the keyboard are encoded in
+code page 850 (DOS), the application in 1252 (Windows) and the output in ISO
+8859-1 (POSIX). All will work ok.
+
+
+3. FROM THE POINT OF VIEW OF THE USER
+
+ Usually user doesn't have to mess with it. Applications that offer big
+flexibility, code page translations, etc. should do it using friendly
+dialogs. An example is SETEdit text editor. But even in this case the user
+have to know the concepts explained in the first sections of this doc.
+ A special case where users could need to do some configuration is when
+using Linux. A long explanation about it is found in the Linux driver
+documentation. In this documentation Linux users will find a list of
+supported code pages. Please refer to the index.
+
+
+4. SUPPORTED ENCODINGS
+
+ That's a list of supported encodings and the number used for each encoding.
+This number is what you need to use for configuration variables like AppCP.
+
+Name ID
+PC 437 ASCII ext. 437
+PC 737 Greek 737
+PC 775 DOS Baltic Rim 775
+PC 850 Latin 1 850
+PC 852 Latin 2 852
+PC 855 Russian 2 855
+PC 857 Turkish 857
+PC 860 Portuguese 860
+PC 861 Icelandic 861
+PC 863 French 863
+PC 865 Nordic 865
+PC 866 Russian 866
+PC 869 Greek 2 869
+CP 1250 Win Latin 2 1250
+CP 1251 Win Russian 1251
+CP 1252 Win Latin 1 1252
+CP 1253 Win Greek 1253
+CP 1254 Win Turkish 1254
+CP 1257 Win Baltic 1257
+Mac Cyr. CP 10007 10007
+ISO 8859-1 Latin 1 88791
+ISO 8859-2 Latin 2 88792
+ISO 8859-3 Latin 3 88593
+ISO 8859-4 Latin 4 88594
+ISO 8859-5 Russian 88595
+ISO 8859-7 Greek 88597
+ISO 8859-9 88599
+ISO Latin 1 (Linux) 885901
+ISO Latin 1u(Linux) 885911
+ISO 8859-14 885914
+ISO 8859-15 Icelan. 885915
+ISO Latin 2 (Linux) 885920
+ISO Latin 2u(Linux) 885921
+ISO Latin 2 (Sun) 885922
+ISO Latin 2+Euro (Linux) 885923
+KOI-8r (Russian) 100000
+KOI-8 with CRL/NMSU 100001
+Mac OS Ukrainian 100072
+Osnovnoj Variant Russian 885951
+Alternativnyj Variant RU 885952
+U-code Russian 885953
+Mazovia (polish) 1000000
+ISO 5427 ISO-IR-37 KOI-7 3604494
+ECMA-Cyr.ISO-IR-111 17891342
+JUS_I.B1.003-SERB ISOIR146 21364750
+JUS_I.B1.003-MAC ISO-IR-147 21430286
+Cyrillic ISO-IR-153 22216718
+
+
+5. FROM THE POINT OF VIEW OF THE PROGRAMMER
+
+ The program can force the encodings using the TVMainConfigFile::Add
+mechanism even before the application object is created. Read the
+configuration file documentation for more information.
+ The fourth encoding involved in the process is the code page used for the
+secondary font. But this encoding doesn't really affect TV.
+ You can change the encodings at any time using the TVCodePage::SetCodePage
+member. To use the TVCodePage class use the Uses_TVCodePage request. The
+source file for it is codepage.cc. Read the header for more information.
+ This class also provides members to replace some ctype.h functions. They
+are: toUpper, toLower, toLowerTable, isAlpha, isAlNum, isLower and isUpper.
+Note these members uses information from the current application code page.
+If the value is properly set this information is usually much better than the
+information you can get from C locales system. Also have in mind that a TV
+application could be using a very different application encoding, if things
+are properly configured it will be transparent, but in this case the ctype.h
+functions will fail.
+
+5.1 START UP AND CHANGES ON THE FLY
+
+ The library itself is encoded in the 437 code page. That's only for
+historic reasons (Borland code was for DOS and that's the most common case on
+DOS). The encoding used at run time is selected by the current driver. It
+can be forced from the configuration file or the application as already
+explained.
+ If the library determines the needed code page is different than 437 all
+the internal information is recoded. Applications that uses characters
+outside the ASCII range should provide a call back to be called when a recode
+is needed. You can see an example in the demo program.
+ Here is a basic explanation on how it works:
+
+1) You set a callback *before* creating the application object using
+
+ TVCodePage::SetCallBack(call_back_function)
+
+ A call back prototype could be:
+
+ void cpCallBack(ushort *map)
+
+ The SetCallBack function returns the previous call back you should save it.
+
+2) This call back will be called when an application code page is done. The
+map argument is needed to be passed to the TVCodePage members that does the
+remapping job. They are RemapChar (for a single char), RemapString (for an
+ASCIIZ string) and RemapNString (for a generic buffer).
+ After remapping all the needed stuff you should call the previous call
+back. Note it can be a NULL pointer.
+
+ When you have dynamic text that needs to be recoded, that's text in TView
+objects that are already created and for some reason doesn't use a static
+buffer to hold the special characters, you have to handle a special broadcast
+called cmUpdateCodePage in the handleEvent member. In this case the infoPtr
+event field contains a pointer to the needed map.
+
+5.2 OTHER USEFUL INFORMATION
+
+ You can also create your own code pages providing an unicode table.
+ The library currently supports encondings that covers languages using the
+latin, cyrillic and greek alphabets. If you think you can help with other
+alphabets, enhance the currently supported or add/fix code pages information
+please contact us. Note the library doesn't support a lot of important
+details needed for some languages like: bidirectional writing, vertical
+writings, glyphs composition, variable spacing, encodings that use more than
+256 characters, etc.
+ An internal 16 bits encoding is used for the code pages, you don't have to
+mess with it but routines to convert from and to Unicode are provided.
+
+ TVCodePage also provides a member to convert from any of the known code
+pages to another.
+
+ Is important to understand that the remapping done when input, application
+and output doesn't match takes some CPU, but it is currently implemented in a
+very fast way so the overhead shouldn't be even meassurable. What we
+currently do is to create one to one tables when the code pages changes.
+That's all, no searches are done during the drawing. That's quite different
+to what Linux kernel does, in this case a table converts input values to
+Unicode and then they are searched in some sort of hash to be converted into
+the screen encoding. We still using a code page internally, not Unicode nor
+our internal code, so we don't have to do such a slow thing. The tables uses
+a simple algorithm to find similar symbols when a value can't be represented
+in the target code page, this value is put in the table, so even in this case
+we don't need to search anything. You can know if the remapping is enabled
+and do it using OnTheFlyRemapNeeded(), OnTheFlyRemap(uchar val),
+OnTheFlyRemapInpNeeded and OnTheFlyInpRemap.
+
+ Another important detail is how the keyboard works, note that sometimes the
+keyboard is just a QWERTY keyboard that somehow generates the other alphabet.
+In this case a key usually means more than one symbol and users spect that
+Alt+Key is mapped to *both* things for objects like the menu. This is
+supported, by I need help and testing. Currently the support is only for DOS
+code page 737 and Linux KOI8-R.
+
+ This functionality was introduced in version 2.0.0 of our port. The Borland
+library didn't have it nor any serious equivalent. It just provided a virtual
+member to do some stuff at start up.
+
diff --git a/tvision/doc/ConfigFile.txt b/tvision/doc/ConfigFile.txt
new file mode 100644
index 0000000..46c3985
--- /dev/null
+++ b/tvision/doc/ConfigFile.txt
@@ -0,0 +1,200 @@
+Topics: Configuration file, TVConfigFile, TVMainConfigFile
+Author: Salvador E. Tropea
+Status: Complete
+Revision: $Revision: 1.4 $
+
+1. INTRODUCTION
+2. FROM THE POINT OF VIEW OF THE USER
+2.1 NAME OF THE FILE
+2.2 STRUCTURE OF THE FILE
+2.3 VARIABLES TO CONTROL TV
+2.4 VARIABLES COMMON TO ALL DRIVERS
+3. FROM THE POINT OF VIEW OF THE PROGRAMMER
+
+
+1. INTRODUCTION
+
+ The Turbo Vision library uses what we call "drivers". They aren't pure
+driver as you find in Windows or other programs, but are used for the same.
+The main difference between real drivers and what TV uses is that our drivers
+aren't separated files, intead they are inside the library.
+ These drivers helps to isolate the hardware and system dependent stuff.
+With this and with the help of the "compatlayer" library we can support a
+wide variety of systems (DOS, FreeBSD, Linux, Solaris, Win32, etc.).
+ The drivers defines how to access to the screen, keyboard, mouse and other
+OS stuff.
+ As these drivers are quite different and complex users could need to
+configure some details. These details range from very generic to really
+driver specific.
+ To avoid duplicating code in all applications and simplify the applications
+the configuration can be done using a text file.
+
+
+
+2. FROM THE POINT OF VIEW OF THE USER
+
+ Here I'll explain things that users and programmers needs to know, but not
+information that only programmers needs to know.
+
+2.1 NAME OF THE FILE
+
+ The configuration file is called "tvrc". On systems where hidden files have
+a name starting with a dot (i.e. Linux) the file can be named ".tvrc".
+Applications can use another name, but if the application specific file can't
+be loaded the tvrc file is tried.
+ The file is searched in the following places:
+1) The current directory.
+2) The directory indicated by the HOME environment variable.
+3) The directory indicated by the HOMEDIR environment variable.
+4) The /etc directory.
+5) The /dev/env/DJDIR/etc directory. This is DOS specific and used in djgpp
+environments. This is translated to %DJDIR%/etc, that's the etc directory
+inside the place you installed djgpp.
+
+2.2 STRUCTURE OF THE FILE
+
+ The file is some mix between .ini files and C code. Sections starts with
+the name of the section enclosed with brackets (i.e. [TV]). All the contents
+of a section is enclosed using braces. Sections can be nested.
+ The main section used for TV configuration is called TV. All the
+configuration information related to TV must be inside this section.
+ Each driver have a short name, please read the documentation about the
+drivers to know the names. Here is a the list of currently supported drivers:
+
+AlCon For the Allegro Conio emulator.
+DOS For DOS or compatible systems.
+Linux For GNU/Linux systems.
+QNX For QNXRtP systems.
+UNIX For FreeBSD and other generic UNIX terminals.
+Win32 For Win32 (Windows 95 and newer) systems.
+WinNT Also for Win32 systems, just a different approach.
+WinGr For Win32, but uses a graphical approach.
+X11 For X11R6 systems, like XFree86.
+XTerm For XTerm and Eterm terminal emulators.
+
+ All the settings for a driver must be inside a section named as the driver.
+ Inside the sections you can set the value of the variables that control the
+behavior of the driver or TV itself.
+ The variables must be followed by an equal sign and the value. Integer
+variables can be in decimal, hexadecimal or octal using the C notation.
+String variables must be enclosed using double quotes. Avoid using extra
+spaces others than indentation spaces.
+ Here is a small example:
+
+[TV]
+{
+ [Driver]
+ {
+ IntegerVariable=10
+ StringVariable="Hello"
+ }
+}
+
+ Note that applications could have separated sections to define variables
+specific for the application.
+
+2.3 VARIABLES TO CONTROL TV
+
+ The following variables controls the behavior of TV and should be defined
+inside the TV section.
+
+DontMoveHiddenCursor Integer Currently TV moves the cursor always, even when
+ hidden. This is a little bit slow but helps
+ Braille terminals. When using the library in
+ slow machines or through slow remote
+ connections you can set this value to anything
+ different than 0 and you'll gain a small
+ speedup.
+ShowCursorEver Integer If the value isn't 0 the text cursor is always
+ visible. This is used for development so you
+ can see where the cursor is located. Braille
+ terminals use the cursor position to read
+ information. If you want to know what a Braille
+ terminal will show you can enable it and
+ look for changes that can help Braille
+ terminals.
+AltKeysSetting Integer Controls how Alt keys are interpreted. The
+ default value is 0 and means that left and
+ right keys are different. Using 1 the keys are
+ interpreted in the reverse way: left as right
+ and viceversa. Using 2 both Alt keys are
+ reported as "Left Alt Key". This is important
+ for the menues because the shortcuts uses the
+ left Alt Key. When using 2 any of the Alt keys
+ can be used to access de menues.
+
+
+2.4 VARIABLES COMMON TO ALL DRIVERS
+
+ The following variables are common to all drivers. It doesn't mean all
+drivers will use them, sometimes the driver can't take an action to reflect
+the value. An example are the screen size variables, Linux driver can't
+change the screen size. Most of these variables can be defined in the TV
+section and drivers will use them. So them can be used as defaults for all
+drivers. The Priority variable doesn't have any sense in the TV section.
+
+AppCP Integer Indicates in which code page is encoded the
+ application.
+ExtProgVideoMode String Indicates which external program should be used to
+ set the video mode. Even when that's generic only
+ DOS benefits from it.
+FontHeight Integer Desired font height in pixels.
+FontWidth Integer Desired font width in pixels.
+InpCP Integer Indicates in which code page is encoded the
+ input data from the OS.
+Priority Integer It selects the priority of the driver. Drivers with
+ higher priority are tried first. Usually this value
+ is in the range of 0 to 100. You can use it to force
+ the use of a driver that currently have less
+ priority.
+ScrCP Integer Indicates in which code page is encoded the
+ screen.
+ScreenWidth Integer Desired screen width.
+ScreenHeight Integer Desired screen height.
+ScreenPalette String This is used to change the color palette. This
+ string should contain the red, green and blue
+ components of the sixteen colors used by TV. Values
+ must be comma separated. So you should provide 48
+ values. If some values are omitted the default VGA
+ BIOS values are used for the rest. The default
+ palette is usually what the VGA BIOS defines, but
+ not always.
+VideoMode Integer Indicates which video mode should be used for the
+ screen. This is useful for DOS, but other drivers can
+ translate the most common DOS modes into a size and
+ try using the size.
+AvoidMoire Integer Indicates the display produces annoying moire effects
+ when drawing "dotted blocks". When enabled the
+ classes tries to avoid using these chars.
+
+
+
+3. FROM THE POINT OF VIEW OF THE PROGRAMMER
+
+ The configuration file is loaded in the constructor of TProgInit. The
+configuration file is controlled by a class called TVMainConfigFile defined
+in the configfile.cc source. This is an specialization of the TVConfigFile
+class.
+ You can define your own sections in the configuration file and look for
+configuration information there.
+ To use the classes use the Uses_TVConfigFile request.
+ You can specify a name for the configuration file, it must be full
+qualified (path included). Use the TVMainConfigFile::SetUserConfigFile member
+for it. It must be called before the application constructor. If this file
+can't be found the library will look for the tvrc/.tvrc file.
+ Is also possible to define variables from the application before loading
+the configuration file. These variable have more priority than the ones from
+the file. Use the TVMainConfigFile::Add members for it. Note this class is
+static and you can use it even before TProgInit constructor. Also note you
+currently can do it only for TV section.
+ The TVMainConfigFile provides a variety of search functions you can use to
+look for settings defined in the configuration file.
+ TScreen provides some search members that looks for variables in the
+section for the current driver, if it fails they search in the TV section.
+That's how defaults for all drivers are implemented.
+ This functionality was introduced in version 2.0.0 of our port. The Borland
+library didn't have it nor any equivalent. The main objetive was to remove
+the need for command line switches in all applications and allow the user to
+set default values for all TV applications.
+
+
diff --git a/tvision/doc/DOS.txt b/tvision/doc/DOS.txt
new file mode 100644
index 0000000..1cffd28
--- /dev/null
+++ b/tvision/doc/DOS.txt
@@ -0,0 +1,171 @@
+Driver: DOS
+Author: Salvador E. Tropea, Robert Hoehne
+Status: Not complete
+Revision: $Revision: 1.2 $
+
+ This is the driver used for the djgpp compiled binaries. The driver works
+on DOS systems and any compatible variants. It can be used for any Windows
+system including 3.1 and Win32 systems (95, 98, Me, NT, 2000, XP, etc.) and
+systems like OS/2 that provides DOS emulation.
+
+1. INTRODUCTION
+2. FEATURES
+3. CONFIGURATION VARIABLES SPECIFIC FOR THIS DRIVER
+4. NOTES ABOUT WINDOWS
+
+
+1. INTRODUCTION
+
+ This driver is really complex and the only way to make it work properly is
+to have a good ammount of testers and maintainers. As the driver is currently
+maintained only by me (SET) this driver is in very bad shape.
+ The main complexity of this driver is the need to support the restore of
+the graphic video modes. This is a complex task because BIOSes have a lot of
+bugs in their save/restore state routines. I saw this bugs are becoming more
+and more frequent.
+ We verified such a bug in Matrox boards, it was fixed, but some people
+still have VGA BIOSes with this bug. Then we also saw a similar bug in nVidia
+GeForce VGA BIOS, I think it wasn't fixed by nVidia. These are just two
+examples of popular boards. As I can't have a collection of video boards and
+test the code in each one to see if it works things become quite complex.
+ My policy for TV 2.0.0 is to release the driver with the current problems,
+but disabling some advanced features. These features won't impact on regular
+programs but will most probably be a bad thing for RHIDE. RHIDE is an IDE for
+djgpp that uses TV as TUI.
+ I think the code should be splitted in at least two drivers. One really
+simple driver that doesn't support restoring graphic modes and another more
+complex driver. Then RHIDE could request the second driver when a user knows
+that graphics are needed and the code works ok for the target system. I don't
+plan to do it any time soon unless I get volunteers to help.
+
+
+2. FEATURES
+
+ The driver supports:
+
+* Video mode configuration. Various modes are known and you can provide your
+own mode or use an external program.
+* Palette. The speed for it is high.
+* Window title set/restore when running on Win32 systems.
+* Most keyboard combinations. Some are lost if you use the BIOS strategy. [1]
+* Restore command.com screen.
+* Fonts. Primary and secondary.
+* Mouse. Full support for drivers compatible with MSMouse v6.0.
+
+ Notes about the screen:
+ Any text mode fully supported by BIOS and that is compatible with
+mode 3 (VGA color) is supported, VESA modes are supported too, if you have
+problems please report it. If you use a program that sets the video mode by
+tweaking the VGA registers it will also set the BIOS data area to reflect the
+new screen size or it won't work.
+ Additionally the library supports some build in modes: 82x25, 80x28, 80x30,
+90x30, 94x30, 80x34, 90x34, 94x34, 80x35, 80x40, 80x43 and 80x50.
+ Note: if you wonder why 82x25 that's a mode where the characters have 8
+pixels of width and is very good for fonts with strange layouts like
+ISO-Latin-1 (from Linux).
+ The hercules monochrome mode should be supported but I didn't test it for
+a long time so perhaps something is broken, please report your experience
+if you try it.
+
+
+
+3. CONFIGURATION VARIABLES SPECIFIC FOR THIS DRIVER
+
+ Please read the documentation about the configuration file first.
+
+BIOSKey Integer By default the driver reads the keystrokes from the
+ BIOS buffer directly. This is faster and gives more
+ information. On some systems it fails and you'll need
+ to enable it. If you have access to such a system
+ please contact us so we can look for a better
+ solution. Use a value different than 0 to enable it.
+PollMouse Integer The mouse information can be obtained using a periodic
+ poll or asking the DOS mouse driver to call us when
+ the mouse is moved or a button is pressed. The second
+ option is faster and you can't lose information. The
+ first option is safer. Currently the driver uses a
+ poll strategy by default. You can try disabling this
+ option to get better mouse support. Note that it is
+ always disabled for Windows NT and similar systems
+ (2000, XP, etc.). Use 0 to disable it.
+SaveVGAState Integer In order to save and restore graphic modes you must
+ save a lot of information. This is achieved using a
+ standard VGA BIOS call. Some buggy BIOSes doesn't
+ implement it or implements it wrongly and returns
+ success. When it happends the result is a mess with
+ the screen, it usually goes black. Currently the
+ default value for it is 0, it means the VGA state
+ isn't saved. If you need to save it try enabling it
+ using a value different than 0.
+VGABIOSState Integer This is related to the SaveVGAState variable. When
+ enabled we use VGA BIOS for the job. If you disable it
+ the driver will do it manually. It works for the
+ boards with buggy BIOSes, but the board must be 100%
+ VGA compatible at registers level (also the Windows
+ driver if you are using Windows). This uses very low
+ level stuff.
+FixKbdBuffer Integer When enabled we assume the start of the keyboard
+ buffer is at offset 0x1E and the end at offset 0x3D.
+ When disabled (default) the size is monitored all
+ the time.
+
+
+4. NOTES ABOUT WINDOWS
+
+ I strongly recommend using the Win32 drivers for Win32 platforms specially
+if the application will run using Windows NT (note that Windows 2000 and XP
+are Windows NT 5.x). Windows NT 4.x have a bad DOS emulation and it looks
+like 5.x made it even worst.
+ Here are some notes I had in the main readme file about this topic:
+
+Windows 3.x:
+ I didn't test it for years so I don't know the current status.
+
+Windows 9x:
+ Keyboard:
+ Almost the same support as in plain DOS. The TSR works at least in
+ Windows '95. Some keys are used by the GUI so not all are available I
+ include a .pif example showing how to avoid W9x take control of Alt+Space
+ and other keys. The example is in extra/pifexamp.
+ Screen:
+ The support is similar to the one found in DOS, but I know some video
+ drivers have bugs in the VESA handling so perhaps it could make problems.
+ If you face such a problem please contact me, in the past I fixed VESA
+ problems with S3 boards thanks to the help of a user.
+ Usually isn't a good idea to run applications that change the video mode
+ inside a window, so if your program does it recommend not running in a
+ window to your users. One way to avoid it is using a .pif file, it will
+ prevent 98% of the people from "windowizing" the program. See the
+ extra/pifexamp example for it, it instructs W95 to run the program in full
+ screen and disable Alt+Enter, the example also gives up to 64Mb to the
+ application (the maximun W95 will give to a DOS task).
+ Mouse:
+ Full support.
+ Note: I think all of it applies to Windows 98, if you see any difference
+ please tell me.
+
+Windows NT:
+ This platform isn't fully supported by the DOS target. I think NT's support
+ for DOS applications is completly broken so I don't care about it. If you
+ have patches I'll receive it.
+
+
+
+-----------------------------------------------------------------------------
+Foot notes:
+
+
+[1] Note that the driver ever takes the keyboard keystrokes from BIOS, it
+can be using the BIOS interrupt or simply removing the key from the BIOS'
+buffer.
+ The last approach reports much more keys but not all, in particular:
+
+* Control + `1457890=;,./
+* Macro key (I have it in one of my keyboards)
+
+ To workaround it I created a small TSR (hacking another TSR and rewriting
+the code inside the ISR ;-). This TSR is included with the sources
+distribution in the extra/doskeys directory, you can distribute it with
+your program if you want, just don't remove my copyright.
+
+
diff --git a/tvision/doc/Eterm.txt b/tvision/doc/Eterm.txt
new file mode 100644
index 0000000..38ebb96
--- /dev/null
+++ b/tvision/doc/Eterm.txt
@@ -0,0 +1,59 @@
+Driver: Eterm (part of XTerm driver)
+Author: Salvador E. Tropea
+Status: Complete
+Revision: $Revision: 1.3 $
+
+1. INTRODUCTION
+2. FEATURES
+3. IMPORTANT DETAILS
+
+
+1. INTRODUCTION
+
+ This driver was designed for Eterm 0.9.x. Previous versions like 0.8.10 are
+no longer supported.
+ Use this driver when you have X Window but you need to use a remote machine
+and the connection isn't fast enough to use the native X11 mode.
+ The driver isn't a full driver but a special mode of XTerm driver. For this
+reason most of the information fro XTerm driver applies. Please read about
+the XTerm driver too.
+ This driver is enabled when the environment variable TERM indicates the
+terminal is called Eterm. Old Linux distros, like Debian GNU/Linux Potato,
+defined Eterm terminals as xterm, that's wrong because they aren't the same.
+
+
+2. FEATURES
+
+ The driver supports:
+
+* Window size.
+* Fonts size (no restore).
+* Palette. Eterm is relative fast for it but the screen flashes quickly.
+* Window title set/restore.
+* Most keyboard combinations when a special Eterm theme is used.
+* Restore shell screen (limited, you can't nest)
+
+
+3. IMPORTANT DETAILS
+
+ In order to get the maximum of key combinations you must install and use an
+Eterm theme specially designed for Turbo Vision applications.
+ If you have problems with the Alt key combinations please try using the
+Eterm command line option --meta-mod. Traditionally UNIX terminals have a key
+called Meta (Sun keyboards have it) and what you really need is this key, so
+you must tell Eterm to use the Alt modifier as Meta modifier.
+ The files are stored in examples/eterm. Copy this files to
+~/.Eterm/themes/tvapp or to /usr/share/Eterm/themes/tvapp if you want to
+make this theme globally available. Then start Eterm with:
+
+$ Eterm -t tvapp
+
+ Note this theme is specially configured for TV applications and isn't the
+best for other tasks. I recommend to use at leat two connections to the
+remote machine, one for general tasks and another from an Eterm with the
+tvapp theme to run TV applications.
+ For instructions on how to test this driver locally, supported
+configuration variables and other details read the XTerm driver
+documentation.
+
+
diff --git a/tvision/doc/I18n.txt b/tvision/doc/I18n.txt
new file mode 100644
index 0000000..f944fe4
--- /dev/null
+++ b/tvision/doc/I18n.txt
@@ -0,0 +1,251 @@
+Topic: Internationalization messages
+Author: Salvador E. Tropea
+Status: Not complete
+Revision: $Revision: 1.2 $
+
+ This document covers the use of TV facilities to translate messages. I call
+it "internationalization for messages" and you'll find it as i18n in many
+places of this docs and the library.
+ The library uses the gettext approach and you should reffer to GNU gettext
+implementation for more information. For GNUished systems try:
+
+$ infview gettext
+or
+$ info gettext
+
+to get information about GNU gettext or try searching "GNU gettext
+Introduction utilities" in Google.
+ From here I'll assume you know what gettext is and have some basic notions
+about how to use it. I'll explain some stuff here anyways, but only to
+refresh the concepts.
+
+Note: I used relative paths in all the references to files so you can load the
+named file just pressing Alt+Enter if you are using SETEdit.
+
+1. HOW IT WORKS
+1.1 FOR THE PROGRAMMER
+1.2 FOR THE PROGRAM
+1.3 INTERNALLY
+1.4 MORE TVINTL MEMBERS AVAILABLE
+
+1. HOW IT WORKS
+
+1.1 FOR THE PROGRAMMER
+
+ Here are the steps from the programmers point of view:
+
+1) You mark all the strings that will be translated in your code. We use
+_(...) for strings that will be translated "in-situ" (it will call gettext)
+and __(...) for strings that will be translated elsewhere (expands to
+nothing, just marks the string).
+
+2) You call xgettext (to remmember it: eXtract for GETTEXT) indicating which
+is the delimiter and which files should be scanned. It can be done from a
+makefile or manually. The ../searchstrs.sh is an example, it parses a file
+that contains the list of files distributed in TV package and extracts all
+the C++ files, the list is passed to xgettext and it generates a file called
+dummy.po. For a more automatic mechanism look in setedit package
+(http://setedit.sf.net/). I use a makefile there.
+
+ 3) The translators creates translation files from the extracted messages.
+Examples of these files are: ../intl/es.po and ../intl/ru.po. Note these
+files *must* contain a header indicating the encoding because gettext assumes
+all is UTF-8 unless other thing is indicated.
+4) You create the binary files containing the translations. They end with .mo
+and are created using msgfmt (MeSsaGes ForMaT). This file is a hash
+containing the untranslated messages as keys (msgids) associated with the
+translated messages (msdstrs). They are usually created using a Makefile like
+it: ../intl/Makefile.
+
+5) The user installs them when all binaries are installed.
+
+
+1.2 FOR THE PROGRAM
+
+ Now from the point of view of the code.
+
+1) We already marked the strings to translate. _(...) marks will be expanded
+to calls to TVIntl::getText(...) and you'll get the translated message there.
+The __(...) entries will be expanded to the string and you'll have to ensure
+the TVIntl::getText(), or equivalent member, is called.
+2) If you don't enable the translation at start-up, usually from main and
+before creating the TApplication object, it won't be enabled and the routines
+won't translate anything. So you have to put something like:
+
+ TVIntl::textDomain("mi_program");
+
+at the beggining of main. You should know what is "textdomain" from the
+gettext docs ;-). That's the name of the .mo files, that's usually the name
+of the program. I reffer to the file containing the translations as the
+"catalog" and the name without the extension as "domain". So what you pass
+here is the name of your domain and with it gettext will search in:
+
+BASE_DIR/LANGUAGE/LC_MESSAGES/domain.mo
+
+ The "language" is selected with the LANG environment variable and the
+BASE_DIR is system dependent. You can force BASE_DIR using:
+
+ TVIntl::bindTextDomain("mi_program","base_dir");
+ TVIntl::textDomain("mi_program");
+
+ Or just:
+
+ TVIntl::autoInit("mi_program","base_dir");
+
+ If for some reason you must force the language just use putenv() like in
+../examples/i18n/test.cc
+ So this line of code is the only thing needed to enable translations.
+
+
+1.3 INTERNALLY
+
+ Ok, here I'll explain some internal details.
+
+1) If the configure script doesn't detect gettext it will be enabled and a
+library providing dummies will be created to satisfy the undefined
+references. If that's your case the configure script will put a huge warning
+explaining you must link with the dummies.
+ If you want to completly disable it use the --no-intl configuration option.
+
+2) The _(string) will be expanded to TVIntl::getText(string) unless --no-intl
+was used, in the last case it will be just string.
+ This will be call the lintintl's gettext function, but if gettext can't
+find a translation in the current domain (the one for your application) the
+function will also try a search in the tvision domain. For this reason you
+don't need to include translations for the TV strings in your catalogs. This
+is a little bit slower but makes life easier.
+
+3) Currently most TV classes translates their messages. For this reason
+you'll usually just need to use __() and not _(). Some classes also accepts
+"caches" as arguments, more about them in 4.
+
+4) Even when most programs can live with it a big problem appears for TV
+applications: the code page. TV applications supports over than 40 code pages
+and they can be changed on-the-fly, they can also be changed so the
+application and screen code pages doesn't match (see doc/CodePages.txt ). To
+add more complexity the code pages doesn't really match the ones covered by
+recode and iconv library. Another detail makes things even worst: iconv is
+useless for DOS applications where dynamic libraries aren't used and it adds
+about 800 KB to each executable. For these reasons, and others, TV uses their
+own code page translation system.
+ This small detail complicates things a little bit. The problem is that we
+must recode strings returned by gettext, but they are "const char *" (even
+when the prototype doesn't make it explicit). The GNU gettext library solves
+it internally using a "centralized cache". I don't like this approach because
+it can waste space and is really bad for efficience. So I designed a
+"distributed cache" approach.
+ When you have a string that will be translated often you have to create a
+cache for it. To do it just declare a "stTVIntl *" variable and initialize it
+to NULL indicating the cache is free (failing to do it will SIGSEGV). At the
+point you have to translate it use "TVIntl::getText(msgid,cache)", it will
+return the associated msgstr. When you don't need the cache anymore just use
+TVIntl::freeSt(cache).
+ Here is where to put each thing in a TView class:
+
+class XXXX : public TView
+{
+....
+protected:
+ stTVIntl *cache;
+};
+
+// Constructor
+XXXX::XXXX() : TView(....)
+{
+ cache=NULL;
+}
+
+// Point where you need the string
+void XXXX:draw()
+{
+ const char *msgstr=TVIntl::getText(__("The string"),cache);
+ ....
+}
+
+// Destructor
+XXXX::~XXXX()
+{
+ TVIntl::freeSt(cache);
+}
+
+ Here is more about what it does: When you call getText it checks if the
+cache is already in use or not. If the cache is in use the string will be
+extracted from the cache and gettext won't be called. If the cache isn't in
+use the library will fill it using gettext. If the cache is in use but the
+last search returned that this string doesn't have translation it will return
+the untranslated message. If the i18n system is disabled it will ever return
+the de untranslated message.
+ The cache also holds which code page was used to recode the string, if this
+changes the string is discarded and a fresh one is used memorizing the new
+code page.
+ Note the chache knows nothing about the domain from where the string came
+from, so avoid changing domains on the fly, it won't work well.
+ In this way the cache lives as long as you need it and not for the live of
+all the program. Also note that a program that changes between code pages
+back and forth doesn't have to invalidate all the cached strings.
+ When you need the string for a small time or just doesn't want to cache it
+you should use:
+
+ char *msgstr=TVIntl::getTextNew(__("The string"));
+ // Use it
+ DeleteArray(msgstr); // Release it
+
+ This will return a newly allocated buffer (you can even modify it if you
+like) and this buffer will be in encoded in the "application" code page.
+ Note that if you use:
+
+ const char *msgstr=_("The string");
+
+ or
+
+ const char *msgstr=TVIntl::getText(__("The string"));
+
+ You'll get an string encoded in the catalog code page, no matters what's
+the application and screen code page. So you can't be sure it will look ok.
+
+5) More about code pages: as TV can recode, and in fact recodes if you use
+the above mentioned members, the best thing is to keep the catalogs in a
+fixed encoding for a given language. For this reason TV assumes you encoded
+the catalog using a fixed code page. Currently TV assumes it for german (de),
+russian (ru) and spanish (es):
+
+DE: ISO 8859-1
+ES: ISO 8859-1
+RU: KOI8-R
+
+ This is because I have catalogs only for those languages (german is very
+incomplete). So you have to encode the .po files using those convetions for
+all the OSs used. TV will do the rest of the work.
+ My test bed is SETEdit, in the past I had spanish catalogs encoded in CP850
+for DOS and ISO 8859-1 for Linux avoiding iconv. Now I have the catalog in
+ISO 8859-1 and it works for all systems.
+
+
+1.4 MORE TVINTL MEMBERS AVAILABLE
+
+ Here are the rest of members that TVIntl offers:
+
+void setCatalogEncoding(int cp)
+Use it to force the code page used for a catalog.
+
+void enableTranslations()
+void disableTranslations()
+You can use it to stop/start translating messages.
+
+stTVIntl *emptySt()
+Returns an empty cache, it will be filled as soon as passed to getText.
+
+stTVIntl *dontTranslateSt()
+Creates a special cache that prevents from even trying to translate the
+message when passed to getText. Use it when you have to pass a string that's
+already translated and the class accepts a cache.
+
+int snprintf(char *dest, size_t sz, const char *fmt, ...)
+Like the standard snprintf but it translates the "fmt" string. Please use it
+and also CLY_snprintf to avoid buffer overflows.
+
+int fprintf(FILE *f, const char *fmt, ...);
+Must be requested defining "Uses_intl_fprintf".
+Is just like fprintf but it translates fmt before using it.
+
+
diff --git a/tvision/doc/Linux.txt b/tvision/doc/Linux.txt
new file mode 100644
index 0000000..722d45b
--- /dev/null
+++ b/tvision/doc/Linux.txt
@@ -0,0 +1,274 @@
+Driver: Linux
+Author: Salvador E. Tropea, Robert Hoehne
+Status: Complete
+Revision: $Revision: 1.6 $
+
+ This is the driver for the Linux console. It can't be used for X or
+other UNIX terminals. This driver is used when the terminal can be
+identified as "console" or "linux*".
+
+1. INTRODUCTION
+2. THE KEYBOARD
+3. ENCODINGS AND FONTS
+4. SECONDARY FONT AND SYSTEMS WITH 512 CHARACTERS
+5. CONFIGURATION VARIABLES
+
+1. INTRODUCTION
+
+ This driver is quite complex and you could need to configure your system
+and/or Turbo Vision to get all the features or to even get it working. This
+is a bad thing, but that's how Linux is implemented.
+ Two important things affects the behavior of this driver:
+
+1) If the user have rights to write to the /dev/vcsa* devices. Usually users
+don't have access to these devices. This is because somebody logged in your
+system could write to your screen to make you do something wrong or expose
+important information. Lamentably these devices doesn't check if the owner is
+who opened the device, a simple rights test is done. When the user can write
+to this device the performance of the library is much better. I recommend
+using it unless your system is used by a lot of untrusted persons.
+2) If you are running the application in a real console or not. Note that
+sometimes you can be using the real console but through a program that starts
+their child processes in a way that they aren't really attached to the
+console. A common case is the "midnight commander" program, it runs the
+commands you type in something like /dev/pts/N. You can find it using the tty
+command. Currently Turbo Vision can bypass applications like midnight
+commander, but some stuff (like the keyboard) lose functionality.
+
+ To solve the first point I recommend creating a group for the /dev/vcsa*
+devices, something like:
+
+ $ addgroup vcs
+
+ Then add the user/s you want to give access to the device:
+
+ $ addgroup user vcs
+
+ Finally change the /dev/vcs* right and owner like this:
+
+ $ chown root.vcs /dev/vcs*
+ $ chmod 0660 /dev/vcs*
+
+ In this way you can control which users can read or write the screen using
+these devices.
+ The second point is simple: run the application without using programs like
+midnight commander.
+ When the application runs in the real console you can:
+
+1) Change the fonts.
+2) Find information about the screen and input encoding.
+3) Get good information about keyboard modifiers (shift, control, alt, etc.).
+
+
+2. THE KEYBOARD
+
+ The library uses the keyboard in "cook mode", this is much more safe than
+using "raw mode" and in this way all the keyboard configuration is honored.
+But this have a drawback: the information from the keyboard is incomplete and
+some keys are used by the kernel.
+ To solve the first issue this driver uses a Linux IOCTL that return the
+current state of keyboard modifiers (like shift). The IOCTLs only work if the
+process owns the real console. It won't work if you run the application using
+a remote connection (i.e. ssh) or something like midnight commander.
+ The second problem is more complex. Some common keys, like Shift+PgUp or
+Alt+Function_key, are used for special purposes. IMHO this is a bad idea, but
+is a fact. In order to solve this problem this driver modifies the kernel
+tables a little bit. When you switch to another console or normally exit the
+application this reverted. If it fails the solution is to reload the keyboard
+map. Use the loadkeys command for it.
+ For this reason you can't switch to another console using Alt+Fx, use
+Ctrl+Alt+Fx, as you do when running X.
+ Note that this driver *doesn't* uses ncurses nor parses the terminal
+description. It means this: if you force Delete to report a strange escape
+sequence and put this information in the terminfo database it won't work. It
+will work for other applications, but not for this driver.
+ Why not ncurses? ncurses is bulky and unpredictable, we had too much
+problems using ncurses. Currently ncurses is only used by the generic UNIX
+driver.
+ Why not reading terminfo/termcap information? this information usually have
+errors and needs a lot of code.
+
+
+3. ENCODINGS AND FONTS
+
+ Linux have a complex and flexible mechanism to support the different text
+encondings (code pages). But this is wrongly used by the console-tools
+(formerly kbd) tools and Linux distributions. This generates a lot of
+problems. Another issue is that Linux kernel is wrongly designed, you have
+services to setup things but you don't have the mechanism to know (and save)
+the current state. It gets even worst when you use escape sequences and you
+don't have access to the IOCTLs.
+ The first thing you must understand is that code pages concept doesn't
+exist for the Linux kernel. This is quite different to DOS, Windows, MacOS,
+etc. where you have fixed encodings with known names. What Linux understands
+are just translation tables. Usually people uses some tables that are quite
+common, but sometimes these tables changes or are just adjusted by a vendor.
+A complete explanation about this topic is outside the scope of this
+document, If you want to know more about this topic read the html
+documentation included with console-tools. What I'll describe here is just a
+simplification.
+
+3.1 TABLES TO TRANSLATE WHAT?
+
+ Most applications, Turbo Vision applications included, uses 8 bits
+characters. It gives 256 possible combinations, but: what exactly means each
+one? it depends on the system. To avoid problems some standars exists. DOS
+uses some IBM/ANSI encodings like code page 437, 850, 866, etc., Windows uses
+another set of code pages created by Microsoft (code pages 1250, 1251, etc.)
+and most UNIX systems uses enconding described in the ISO 8859 standard.
+ In this way a document is:
+
+1) Compact, each character/letter needs one byte.
+2) Exchangeable, you can use documents from other system just knowing which
+encoding is used.
+
+ But this scheme isn't enough to represent all possible characters of
+languages like chinese, japanese, etc. To represent these things you need an
+extended system. Unicode is a really complex mechanism to achieve it. Unicode
+implies a lot of complex things, but the most widely used thing is the
+ability to reprsent the most common languages used in the world using a
+standarized mechanism.
+ The Linux kernel currently uses Unicode (16 bits variant) for internal
+purposes. You can also enter text using the UTF-8 mechanism, that's a special
+way to encode Unicode using variable length characters.
+ What Linux does is: when a character is received by the kernel it is
+converted into Unicode (first table), it is processed and when the kernel
+needs to print it the value is converted to 1 byte (second table, this isn't
+in fact a table).
+ The first conversion is from the application encoding to Unicode and the
+second is from Unicode to the screen encoding.
+ Here you can see the first complexity: the application can be encoded in a
+way and the screen in another. For stupid reasons is quite common to use it
+in Linux systems. The reasons are all stupid and the result is a waste of
+performance and added complexity.
+ You can skip this paragraph if you don't want to know about some of the
+stupid things common to almost all Linux systems. One of the problems people
+faced in the past was that VGA video controller uses 8 pixels width fonts,
+but they are represented as 9 pixels in the screen. What's in the 9th column?
+It depends on the value to represent, usually it is filled with a blank
+column, it helps to keep the characters visually separated. But a particular
+range of values uses the same information found in the 8th column. This range
+corresponds to the graphics used for frames in the code page 437, that's
+because the boards have a 437 encoding by default. This range is used by ISO
+8859 standard and the result is that linux encodings have the frames in the
+range where the 9th column is blanked. This generates ugly frames. The real
+solution for that is to just modifiy the VGA registers to create a video mode
+where characters have 8 pixels. It also have a plus: you gain a couple of
+columns that could be used by the kernel and/or the user. But lamentably
+people uses a wrong approach. Instead of it a tweaked encoding is used. This
+is the difference between lat1 and lat1u fonts. Another lamentably fact is
+that newer packages (Debian Potato and Woody for example) have files called
+lat1* that are in fact the tweacked lat1u* files. Another stupid thing is the
+fact that most Linux distros doesn't load a font, all of them should load ISO
+8859-1 because that's what the applications uses by default. Usually distros
+just let the 437 default BIOS encoding, it only generates confusion and
+avoids the use of a bypass for the translations. The bypass is possible
+because ISO 8859-1 is a subset of Unicode (the first 256 values).
+ Ok, again in the topic: the first table is what is called ACM (Application
+Charset Map) and the second is called SFM (Screen Font Map).
+ The first is a real table, it maps one to one. A value from the application
+(8 bits) is translated into an Unicode value (16 bits in this case). The
+second isn't a real table because more than one Unicode value can be
+represented by the same drawing (similar or identical, remmember Unicode is
+much more than an encoding). Things are even more complex because a table
+with 65536 entries isn't a good idea. For this reason this map is more
+complex and the kernel doesn't use a table.
+
+3.2 WHY IS THAT A PROBLEM IF ALL LINUX APPLICATIONS WORKS OK?
+
+ The main problem appears when you want to access to the screen using the
+/dev/vcs* devices. In this case you are bypassing the kernel translation.
+ Another problem appears if you have to know more about the text you are
+handling. The C locales mechanism is useless because it only covers really
+standard code pages.
+ Most Linux applications:
+1) Uses a slow screen output, after all most of them have a crappy look.
+2) Doesn't really know much about encodings, just know how to draw the
+frames.
+
+3.3 WHAT'S THE PROBLEM?
+
+ At first sight it just looks complex, but not impossible. After all doesn't
+really matters if these tables follows an standard or not if you can analyze
+them.
+ But things are more complex. This information is only available using
+IOCTLs so you can't do it when using a remote console. Currently the library
+just does a guess using the contents of the LANG environment variable. If
+this guess is wrongly done just use the the configuration file (tvrc).
+ Another problem is that some maps wrongly done. The KOI8-R is a good
+example. Here the ACM doesn't translate the input into Unicode, instead the
+text passes without change (or a very small change in some systems, to make
+things even worst). It works because the SFM is also wrong and in fact is a
+KOI-8R->Screen conversion and not Unicode->Screen. You get a table that is
+supposed to be encoded in Unicode but it isn't.
+ The driver anlyze the code page and tries to figure out what encodings are
+used but it can fail. If it doesn't work for your system please contact me
+and we will try to find some solution.
+
+3.4 HOW TO FORCE THE ENCODINGS
+
+ If you know how your system is encoded look for the closest code page
+supported by Turbo Vision, they are defined in codepage.cc, and create a
+configuration file indicating the encoding.
+ The configuration variables used for it are: AppCP and ScrCP. The first is
+the equivalent to the ACM and the second is like the SFM.
+ To force KOI8-R you can use:
+
+[TV]
+{
+ [Linux]
+ {
+ AppCP=100000
+ ScrCP=100000
+ }
+}
+
+
+4. SECONDARY FONT AND SYSTEMS WITH 512 CHARACTERS
+
+ Linux supports loading an extended font with 512 characters instead of 256.
+This isn't currently supported by this driver because things are all 8 bits.
+I don't really know the result. If you use such a system please contact me.
+ Turbo Vision now supports loading fonts and you can use it if you are
+running in the Linux console. TV also supports loading a secondary font. This
+can be used for very special cases. To achieve it the driver uses a 512
+characters font, the first 256 for the primary font and the other 256 for the
+secondary. By default this is disabled because the kernel reduces the colors
+to 8 when you load a 512 characters font. This is quite logical when the 512
+symbols belongs to one big encoding but really annoying when they are two
+different fonts. To enable it use the UseSecondaryFont configuration
+variable.
+ Note: The PC VGA controller uses eight bits for color attributes. Four are
+used for the foreground color and the other four for the background color. It
+gives sixteen colors. But the most significant bit of each color have a
+second meaning that can be optionally enabled. The fourth bit of the
+background is used for blinking and the fourth bit of the foreground is used
+to select a second set of characters. This is why Linux reduces the colors to
+eight, but the bit still working, you can still using sixteen colors. The
+last is what TV uses. What Linux does is to redefine the colors to be the
+same and disables any attempt to reprogram the palette entries to these
+colors.
+
+
+5. CONFIGURATION VARIABLES
+
+ This driver supports the following variables:
+
+* AppCP, ScrCP and InpCP. The point 3 explains the first two. The InpCP is to
+force the encoding of the keyboard and isn't usually needed.
+* UseSecondaryFont explained in 4.
+* LoadSecondaryFont: Request a secondary font to the application (must
+provide a call back).
+* UseVCS. This is one by default and can be used to disable the use of
+/dev/vcsa* devices.
+* UseMDA. This is one by default and can be used to disable the use of the
+monochrome display.
+* PatchKeys. This is one by default and can be used to disable the keyboard
+patching explained in 2.
+* BrokenCursorShape. This is one by default and can be used to indicate we
+are using a broken console where the cursor shape can't be changed. This
+happends with some frame buffer consoles that fails to implement it.
+
+ An example of configuration file is shown in 3.4.
+ Read the ConfigFile.txt for more information about configuration files.
+
diff --git a/tvision/doc/QNX.txt b/tvision/doc/QNX.txt
new file mode 100644
index 0000000..5daf815
--- /dev/null
+++ b/tvision/doc/QNX.txt
@@ -0,0 +1,31 @@
+Driver: QNXRtP (QNX6)
+Author: Mike Gorchak
+Status: Just a few words
+Revision: $Revision: 1.5 $
+
+1. Display characters
+
+ Almost all characters are displayed, except for one character with
+code 0x1B - ESC (small left arrow) - instead of this character symbol
+'-' is displayed. Problem with 0x1B code appears in pterm and in raw
+console mode.
+
+2. Input characters
+
+ Symbols with codes from 0x80 upto 0xFF are reserved for national
+characters support, that's why these symbols are not decoded. Event
+structure in this case contains these character codes in keyDown.
+charScan.charCode and field keyDown.keyCode is zero.
+
+3. Mouse support
+
+ Mouse support in pure console mode was added. To use mouse you
+need to run devi-hirun manually (it's true for QNX with versions 6.1,
+6.2, 6.2.1). Run '/usr/photon/bin/devi-hirun -Pr [mouse options]' ,
+for example 'devi-hirun -Pr ps2 mousedev' for the generic ps2 mouses.
+[-P] will prevent to connect devi-hirun as input manager to the
+photon, [-r] will start devi-hirun in resource manager mode. Check
+the /dev/devi/ directory it must contain the mouse0 device, if it
+exists, that's mean all is ok.
+
+// Mike Gorchak.
diff --git a/tvision/doc/Streams.txt b/tvision/doc/Streams.txt
new file mode 100644
index 0000000..69cc00e
--- /dev/null
+++ b/tvision/doc/Streams.txt
@@ -0,0 +1,88 @@
+Topic: TV Streams
+Author: Salvador E. Tropea
+Status: Just random data
+Revision: $Revision: 1.3 $
+
+This is an incomplete and inaccurate collection of data about TV streams.
+Use it carefuly.
+
+Classes hierarchy:
+
+Note: Arrows are from parent to child, sorry if that's confusing.
+
+ +--------------------------- pstream ----------------------------+
+ | | |
+ v v v
+opstream ---------+ +--------- fpbase ---------+ +------------ ipstream
+ | | | | | | |
+ | v v v v v |
+ | ofpstream fpstream ifpstream |
+ | |
+ +------------------------> iopstream <---------------------------+
+
+pstream: Holds a streambuf (protected bp, readable with rdbuf()). These
+stream buffers acts like streams but storing data in a memory buffer.
+It also keeps the list of registered objects.
+
+opstream: defines all the output operations.
+
+ipstream: defines all the input operations.
+
+iopstream: it just joins the facilities from opstream and ipstream.
+
+fpbase: Holds a filebuf (private and readable with rdbuf()). It just adds to
+pstream what's needed to handle file buffers instead of stream buffers, like
+open.
+A very important detail is that a filebuf is a class derived from streambuf
+and hence all streambuf operations are valid. In fact fpbase constructors
+sets the bp value to the filebuf using init().
+
+ofpstream: just makes all the output operations available for files.
+
+ifpstream: just makes all the input operations available for files.
+
+fpstream: defines a read/write open.
+
+----------------
+
+Why all of this?
+
+This was designed to provide "persistence". The idea is to create *binary*
+files that can hold objects. For this the library keeps a list of registered
+objects, each one have a name and function to be called to read the object
+from disk.
+
+----------------
+
+What's used by each class from the standard C++ lib:
+
+pstream:
+Basically nothing, it have a streambuf pointer but never uses it.
+The code uses some some ios flags:
+ios::eofbit, ios::failbit and ios::badbit
+
+opstream: (seek, flush, put a char and put various chars)
+* CLY_PubSeekOff (seek) attributes: CLY_std(ios::beg), CLY_std(ios::cur) and
+all of type CLY_IOSSeekDir.
+* CLY_PubSync() (flush)
+* sputc (put a char)
+* sputn (put chars)
+* CLY_std(ios::out)
+
+ipstream: (seek, flush, get a char and get various chars)
+* CLY_PubSeekOff (seek) attributes: CLY_std(ios::beg), CLY_std(ios::cur) and
+all of type CLY_IOSSeekDir.
+* sbumpc (read a char)
+* sgetn (read chars)
+* CLY_std(ios::in)
+* CLY_std(ios::eofbit)
+
+fpbase: (open, close, open from file h, set buffer and attach)
+* Create a filebuf from a file handle.
+* open (CLY_OpenModeT modes)
+* CLY_PubSetBuf (set the buffer)
+* is_open
+* attach [optional]
+* close
+
+
diff --git a/tvision/doc/TVReference.html b/tvision/doc/TVReference.html
new file mode 100644
index 0000000..7c34e87
--- /dev/null
+++ b/tvision/doc/TVReference.html
@@ -0,0 +1,3862 @@
+<html>
+<head>
+<title>Turbo Vision reference</title>
+</head>
+<body>
+<H1>Turbo Vision reference</H1>
+
+This document describes the functions of Turbo Vision that didn't
+exist in the original version of the library.<br>
+Note that only a few things are documented here, I need help to populate
+this file.
+
+<p>
+
+This document applies to version 2.0.0
+of the Turbo Vision library.
+
+<p>
+
+
+<Menu>
+<li><a href="#Alphabetical List">Alphabetical list of functions</a>
+<li><a href="#Classes">List by classes</a>
+<li><a href="#Modules">List by modules</a>
+<li><a href="#Files">List by files</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Alphabetical List"></a>
+<H1>Alphabetical List</H1>
+
+<Menu>
+<li><a href="#Add (TVMainConfigFile)">Add (TVMainConfigFile)</a>
+<li><a href="#Add (TVMainConfigFile) <1>">Add (TVMainConfigFile) <1></a>
+<li><a href="#AddCodePage (TVCodePage)">AddCodePage (TVCodePage)</a>
+<li><a href="#AddInt (TVConfigFile)">AddInt (TVConfigFile)</a>
+<li><a href="#AddString (TVConfigFile)">AddString (TVConfigFile)</a>
+<li><a href="#CheckForLines (TVFontCollection)">CheckForLines (TVFontCollection)</a>
+<li><a href="#CheckSignature (TVFontCollection)">CheckSignature (TVFontCollection)</a>
+<li><a href="#CodePageOfID (TVCodePage)">CodePageOfID (TVCodePage)</a>
+<li><a href="#CreateCodePagesCol (TVCodePage)">CreateCodePagesCol (TVCodePage)</a>
+<li><a href="#CreateCPFromUnicode (TVCodePage)">CreateCPFromUnicode (TVCodePage)</a>
+<li><a href="#CreateFont (TVFontCollection)">CreateFont (TVFontCollection)</a>
+<li><a href="#CreateListOfFonts (TVFontCollection)">CreateListOfFonts (TVFontCollection)</a>
+<li><a href="#CreateOnTheFlyInpRemap (TVCodePage)">CreateOnTheFlyInpRemap (TVCodePage)</a>
+<li><a href="#CreateOnTheFlyRemap (TVCodePage)">CreateOnTheFlyRemap (TVCodePage)</a>
+<li><a href="#CreateRemap (TVCodePage)">CreateRemap (TVCodePage)</a>
+<li><a href="#defaultCheckForWindowSize (TDisplay)">defaultCheckForWindowSize (TDisplay)</a>
+<li><a href="#defaultClearScreen (TDisplay)">defaultClearScreen (TDisplay)</a>
+<li><a href="#defaultGetBlinkState (TDisplay)">defaultGetBlinkState (TDisplay)</a>
+<li><a href="#defaultGetCols (TDisplay)">defaultGetCols (TDisplay)</a>
+<li><a href="#defaultGetCrtMode (TDisplay)">defaultGetCrtMode (TDisplay)</a>
+<li><a href="#defaultGetCursorShape (TDisplay)">defaultGetCursorShape (TDisplay)</a>
+<li><a href="#defaultGetRows (TDisplay)">defaultGetRows (TDisplay)</a>
+<li><a href="#defaultGetWindowTitle (TDisplay)">defaultGetWindowTitle (TDisplay)</a>
+<li><a href="#defaultSetCrtMode (TDisplay)">defaultSetCrtMode (TDisplay)</a>
+<li><a href="#defaultSetCrtModeExt (TDisplay)">defaultSetCrtModeExt (TDisplay)</a>
+<li><a href="#defaultSetCrtModeRes (TDisplay)">defaultSetCrtModeRes (TDisplay)</a>
+<li><a href="#defaultSetCursorShape (TDisplay)">defaultSetCursorShape (TDisplay)</a>
+<li><a href="#defaultSetWindowTitle (TDisplay)">defaultSetWindowTitle (TDisplay)</a>
+<li><a href="#EnlargeOne (TVFontCollection)">EnlargeOne (TVFontCollection)</a>
+<li><a href="#FillTables (TVCodePage)">FillTables (TVCodePage)</a>
+<li><a href="#FillTEvent (TGKeyXTerm)">FillTEvent (TGKeyXTerm)</a>
+<li><a href="#freeItem (TVFontCollection)">freeItem (TVFontCollection)</a>
+<li><a href="#GetFont (TVFontCollection)">GetFont (TVFontCollection)</a>
+<li><a href="#GetKeyParsed (TGKeyXTerm)">GetKeyParsed (TGKeyXTerm)</a>
+<li><a href="#GetList (TVCodePage)">GetList (TVCodePage)</a>
+<li><a href="#GetRaw (TGKeyXTerm)">GetRaw (TGKeyXTerm)</a>
+<li><a href="#GetShiftState (TGKeyXTerm)">GetShiftState (TGKeyXTerm)</a>
+<li><a href="#GetTranslate (TVCodePage)">GetTranslate (TVCodePage)</a>
+<li><a href="#GetWindowTitle (TDisplayDOS)">GetWindowTitle (TDisplayDOS)</a>
+<li><a href="#GKey (TGKeyXTerm)">GKey (TGKeyXTerm)</a>
+<li><a href="#IDToIndex (TVCodePage)">IDToIndex (TVCodePage)</a>
+<li><a href="#IndexToID (TVCodePage)">IndexToID (TVCodePage)</a>
+<li><a href="#InitOnce (TGKeyXTerm)">InitOnce (TGKeyXTerm)</a>
+<li><a href="#InternalCodeForUnicode (TVCodePage)">InternalCodeForUnicode (TVCodePage)</a>
+<li><a href="#Load (TVConfigFile)">Load (TVConfigFile)</a>
+<li><a href="#Load (TVMainConfigFile)">Load (TVMainConfigFile)</a>
+<li><a href="#LookSimilarInRange (TVCodePage)">LookSimilarInRange (TVCodePage)</a>
+<li><a href="#moveBuf (TDrawBuffer)">moveBuf (TDrawBuffer)</a>
+<li><a href="#moveChar (TDrawBuffer)">moveChar (TDrawBuffer)</a>
+<li><a href="#moveCStr (TDrawBuffer)">moveCStr (TDrawBuffer)</a>
+<li><a href="#moveStr (TDrawBuffer)">moveStr (TDrawBuffer)</a>
+<li><a href="#Print (TVConfigFile)">Print (TVConfigFile)</a>
+<li><a href="#Print (TVMainConfigFile)">Print (TVMainConfigFile)</a>
+<li><a href="#ProcessEscape (TGKeyXTerm)">ProcessEscape (TGKeyXTerm)</a>
+<li><a href="#ReadFontInfo (TVFontCollection)">ReadFontInfo (TVFontCollection)</a>
+<li><a href="#ReadName (TVFontCollection)">ReadName (TVFontCollection)</a>
+<li><a href="#ReadVersionNum (TVFontCollection)">ReadVersionNum (TVFontCollection)</a>
+<li><a href="#ReduceOne (TVFontCollection)">ReduceOne (TVFontCollection)</a>
+<li><a href="#RemapBufferGeneric (TVCodePage)">RemapBufferGeneric (TVCodePage)</a>
+<li><a href="#RemapChar (TVCodePage)">RemapChar (TVCodePage)</a>
+<li><a href="#RemapNString (TVCodePage)">RemapNString (TVCodePage)</a>
+<li><a href="#RemapString (TVCodePage)">RemapString (TVCodePage)</a>
+<li><a href="#RemapTVStrings (TVCodePage)">RemapTVStrings (TVCodePage)</a>
+<li><a href="#Resume (TGKeyXTerm)">Resume (TGKeyXTerm)</a>
+<li><a href="#Search (TVConfigFile)">Search (TVConfigFile)</a>
+<li><a href="#Search (TVMainConfigFile)">Search (TVMainConfigFile)</a>
+<li><a href="#Search (TVMainConfigFile) <1>">Search (TVMainConfigFile) <1></a>
+<li><a href="#Search (TVMainConfigFile) <2>">Search (TVMainConfigFile) <2></a>
+<li><a href="#Search (TVMainConfigFile) <3>">Search (TVMainConfigFile) <3></a>
+<li><a href="#searchDOSModeInfo (TDisplay)">searchDOSModeInfo (TDisplay)</a>
+<li><a href="#SetCallBack (TVCodePage)">SetCallBack (TVCodePage)</a>
+<li><a href="#SetCodePage (TVCodePage)">SetCodePage (TVCodePage)</a>
+<li><a href="#SetCodePage (TVFontCollection)">SetCodePage (TVFontCollection)</a>
+<li><a href="#SetCrtMode (TDisplayDOS)">SetCrtMode (TDisplayDOS)</a>
+<li><a href="#setCursorType (TDisplay)">setCursorType (TDisplay)</a>
+<li><a href="#SetUserConfigFile (TVMainConfigFile)">SetUserConfigFile (TVMainConfigFile)</a>
+<li><a href="#SetWindowTitle (TDisplayDOS)">SetWindowTitle (TDisplayDOS)</a>
+<li><a href="#Suspend (TGKeyXTerm)">Suspend (TGKeyXTerm)</a>
+<li><a href="#testForSupport (TDisplayDOS)">testForSupport (TDisplayDOS)</a>
+<li><a href="#TScreen (TScreen)">TScreen (TScreen)</a>
+<li><a href="#TVCodePage (TVCodePage)">TVCodePage (TVCodePage)</a>
+<li><a href="#TVConfigFile (TVConfigFile)">TVConfigFile (TVConfigFile)</a>
+<li><a href="#TVFontCollection (TVFontCollection)">TVFontCollection (TVFontCollection)</a>
+<li><a href="#TVMainConfigFile (TVMainConfigFile)">TVMainConfigFile (TVMainConfigFile)</a>
+<li><a href="#UnicodeForInternalCode (TVCodePage)">UnicodeForInternalCode (TVCodePage)</a>
+<li><a href="#~TVCodePage (TVCodePage)">~TVCodePage (TVCodePage)</a>
+<li><a href="#~TVConfigFile (TVConfigFile)">~TVConfigFile (TVConfigFile)</a>
+<li><a href="#~TVMainConfigFile (TVMainConfigFile)">~TVMainConfigFile (TVMainConfigFile)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Classes"></a>
+<H1>Classes</H1>
+
+<Menu>
+<li><a href="#TDisplay (class)">TDisplay</a>
+<li><a href="#TDisplayDOS (class)">TDisplayDOS</a>
+<li><a href="#TDrawBuffer (class)">TDrawBuffer</a>
+<li><a href="#TGKeyXTerm (class)">TGKeyXTerm</a>
+<li><a href="#TScreen (class)">TScreen</a>
+<li><a href="#TVCodePage (class)">TVCodePage</a>
+<li><a href="#TVConfigFile (class)">TVConfigFile</a>
+<li><a href="#TVFontCollection (class)">TVFontCollection</a>
+<li><a href="#TVMainConfigFile (class)">TVMainConfigFile</a>
+</Menu>
+
+
+<p><hr></p>
+<a name="TDisplay (class)"></a>
+<H1>TDisplay</H1>
+
+
+
+<Menu>
+<li><a href="#defaultCheckForWindowSize (TDisplay)">defaultCheckForWindowSize (TDisplay)</a>
+<li><a href="#defaultClearScreen (TDisplay)">defaultClearScreen (TDisplay)</a>
+<li><a href="#defaultGetBlinkState (TDisplay)">defaultGetBlinkState (TDisplay)</a>
+<li><a href="#defaultGetCols (TDisplay)">defaultGetCols (TDisplay)</a>
+<li><a href="#defaultGetCrtMode (TDisplay)">defaultGetCrtMode (TDisplay)</a>
+<li><a href="#defaultGetCursorShape (TDisplay)">defaultGetCursorShape (TDisplay)</a>
+<li><a href="#defaultGetRows (TDisplay)">defaultGetRows (TDisplay)</a>
+<li><a href="#defaultGetWindowTitle (TDisplay)">defaultGetWindowTitle (TDisplay)</a>
+<li><a href="#defaultSetCrtMode (TDisplay)">defaultSetCrtMode (TDisplay)</a>
+<li><a href="#defaultSetCrtModeExt (TDisplay)">defaultSetCrtModeExt (TDisplay)</a>
+<li><a href="#defaultSetCrtModeRes (TDisplay)">defaultSetCrtModeRes (TDisplay)</a>
+<li><a href="#defaultSetCursorShape (TDisplay)">defaultSetCursorShape (TDisplay)</a>
+<li><a href="#defaultSetWindowTitle (TDisplay)">defaultSetWindowTitle (TDisplay)</a>
+<li><a href="#searchDOSModeInfo (TDisplay)">searchDOSModeInfo (TDisplay)</a>
+<li><a href="#setCursorType (TDisplay)">setCursorType (TDisplay)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="TDisplayDOS (class)"></a>
+<H1>TDisplayDOS</H1>
+
+
+
+<Menu>
+<li><a href="#GetWindowTitle (TDisplayDOS)">GetWindowTitle (TDisplayDOS)</a>
+<li><a href="#SetCrtMode (TDisplayDOS)">SetCrtMode (TDisplayDOS)</a>
+<li><a href="#SetWindowTitle (TDisplayDOS)">SetWindowTitle (TDisplayDOS)</a>
+<li><a href="#testForSupport (TDisplayDOS)">testForSupport (TDisplayDOS)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="TDrawBuffer (class)"></a>
+<H1>TDrawBuffer</H1>
+
+
+
+<Menu>
+<li><a href="#moveBuf (TDrawBuffer)">moveBuf (TDrawBuffer)</a>
+<li><a href="#moveChar (TDrawBuffer)">moveChar (TDrawBuffer)</a>
+<li><a href="#moveCStr (TDrawBuffer)">moveCStr (TDrawBuffer)</a>
+<li><a href="#moveStr (TDrawBuffer)">moveStr (TDrawBuffer)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="TGKeyXTerm (class)"></a>
+<H1>TGKeyXTerm</H1>
+
+
+
+<Menu>
+<li><a href="#FillTEvent (TGKeyXTerm)">FillTEvent (TGKeyXTerm)</a>
+<li><a href="#GetKeyParsed (TGKeyXTerm)">GetKeyParsed (TGKeyXTerm)</a>
+<li><a href="#GetRaw (TGKeyXTerm)">GetRaw (TGKeyXTerm)</a>
+<li><a href="#GetShiftState (TGKeyXTerm)">GetShiftState (TGKeyXTerm)</a>
+<li><a href="#GKey (TGKeyXTerm)">GKey (TGKeyXTerm)</a>
+<li><a href="#InitOnce (TGKeyXTerm)">InitOnce (TGKeyXTerm)</a>
+<li><a href="#ProcessEscape (TGKeyXTerm)">ProcessEscape (TGKeyXTerm)</a>
+<li><a href="#Resume (TGKeyXTerm)">Resume (TGKeyXTerm)</a>
+<li><a href="#Suspend (TGKeyXTerm)">Suspend (TGKeyXTerm)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="TScreen (class)"></a>
+<H1>TScreen</H1>
+
+
+
+<Menu>
+<li><a href="#TScreen (TScreen)">TScreen (TScreen)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="TVCodePage (class)"></a>
+<H1>TVCodePage</H1>
+
+
+
+<Menu>
+<li><a href="#AddCodePage (TVCodePage)">AddCodePage (TVCodePage)</a>
+<li><a href="#CodePageOfID (TVCodePage)">CodePageOfID (TVCodePage)</a>
+<li><a href="#CreateCodePagesCol (TVCodePage)">CreateCodePagesCol (TVCodePage)</a>
+<li><a href="#CreateCPFromUnicode (TVCodePage)">CreateCPFromUnicode (TVCodePage)</a>
+<li><a href="#CreateOnTheFlyInpRemap (TVCodePage)">CreateOnTheFlyInpRemap (TVCodePage)</a>
+<li><a href="#CreateOnTheFlyRemap (TVCodePage)">CreateOnTheFlyRemap (TVCodePage)</a>
+<li><a href="#CreateRemap (TVCodePage)">CreateRemap (TVCodePage)</a>
+<li><a href="#FillTables (TVCodePage)">FillTables (TVCodePage)</a>
+<li><a href="#GetList (TVCodePage)">GetList (TVCodePage)</a>
+<li><a href="#GetTranslate (TVCodePage)">GetTranslate (TVCodePage)</a>
+<li><a href="#IDToIndex (TVCodePage)">IDToIndex (TVCodePage)</a>
+<li><a href="#IndexToID (TVCodePage)">IndexToID (TVCodePage)</a>
+<li><a href="#InternalCodeForUnicode (TVCodePage)">InternalCodeForUnicode (TVCodePage)</a>
+<li><a href="#LookSimilarInRange (TVCodePage)">LookSimilarInRange (TVCodePage)</a>
+<li><a href="#RemapBufferGeneric (TVCodePage)">RemapBufferGeneric (TVCodePage)</a>
+<li><a href="#RemapChar (TVCodePage)">RemapChar (TVCodePage)</a>
+<li><a href="#RemapNString (TVCodePage)">RemapNString (TVCodePage)</a>
+<li><a href="#RemapString (TVCodePage)">RemapString (TVCodePage)</a>
+<li><a href="#RemapTVStrings (TVCodePage)">RemapTVStrings (TVCodePage)</a>
+<li><a href="#SetCallBack (TVCodePage)">SetCallBack (TVCodePage)</a>
+<li><a href="#SetCodePage (TVCodePage)">SetCodePage (TVCodePage)</a>
+<li><a href="#TVCodePage (TVCodePage)">TVCodePage (TVCodePage)</a>
+<li><a href="#UnicodeForInternalCode (TVCodePage)">UnicodeForInternalCode (TVCodePage)</a>
+<li><a href="#~TVCodePage (TVCodePage)">~TVCodePage (TVCodePage)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="TVConfigFile (class)"></a>
+<H1>TVConfigFile</H1>
+
+
+
+<Menu>
+<li><a href="#AddInt (TVConfigFile)">AddInt (TVConfigFile)</a>
+<li><a href="#AddString (TVConfigFile)">AddString (TVConfigFile)</a>
+<li><a href="#Load (TVConfigFile)">Load (TVConfigFile)</a>
+<li><a href="#Print (TVConfigFile)">Print (TVConfigFile)</a>
+<li><a href="#Search (TVConfigFile)">Search (TVConfigFile)</a>
+<li><a href="#TVConfigFile (TVConfigFile)">TVConfigFile (TVConfigFile)</a>
+<li><a href="#~TVConfigFile (TVConfigFile)">~TVConfigFile (TVConfigFile)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="TVFontCollection (class)"></a>
+<H1>TVFontCollection</H1>
+
+
+
+<Menu>
+<li><a href="#CheckForLines (TVFontCollection)">CheckForLines (TVFontCollection)</a>
+<li><a href="#CheckSignature (TVFontCollection)">CheckSignature (TVFontCollection)</a>
+<li><a href="#CreateFont (TVFontCollection)">CreateFont (TVFontCollection)</a>
+<li><a href="#CreateListOfFonts (TVFontCollection)">CreateListOfFonts (TVFontCollection)</a>
+<li><a href="#EnlargeOne (TVFontCollection)">EnlargeOne (TVFontCollection)</a>
+<li><a href="#freeItem (TVFontCollection)">freeItem (TVFontCollection)</a>
+<li><a href="#GetFont (TVFontCollection)">GetFont (TVFontCollection)</a>
+<li><a href="#ReadFontInfo (TVFontCollection)">ReadFontInfo (TVFontCollection)</a>
+<li><a href="#ReadName (TVFontCollection)">ReadName (TVFontCollection)</a>
+<li><a href="#ReadVersionNum (TVFontCollection)">ReadVersionNum (TVFontCollection)</a>
+<li><a href="#ReduceOne (TVFontCollection)">ReduceOne (TVFontCollection)</a>
+<li><a href="#SetCodePage (TVFontCollection)">SetCodePage (TVFontCollection)</a>
+<li><a href="#TVFontCollection (TVFontCollection)">TVFontCollection (TVFontCollection)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="TVMainConfigFile (class)"></a>
+<H1>TVMainConfigFile</H1>
+
+
+
+<Menu>
+<li><a href="#Add (TVMainConfigFile)">Add (TVMainConfigFile)</a>
+<li><a href="#Add (TVMainConfigFile) <1>">Add (TVMainConfigFile) <1></a>
+<li><a href="#Load (TVMainConfigFile)">Load (TVMainConfigFile)</a>
+<li><a href="#Print (TVMainConfigFile)">Print (TVMainConfigFile)</a>
+<li><a href="#Search (TVMainConfigFile)">Search (TVMainConfigFile)</a>
+<li><a href="#Search (TVMainConfigFile) <1>">Search (TVMainConfigFile) <1></a>
+<li><a href="#Search (TVMainConfigFile) <2>">Search (TVMainConfigFile) <2></a>
+<li><a href="#Search (TVMainConfigFile) <3>">Search (TVMainConfigFile) <3></a>
+<li><a href="#SetUserConfigFile (TVMainConfigFile)">SetUserConfigFile (TVMainConfigFile)</a>
+<li><a href="#TVMainConfigFile (TVMainConfigFile)">TVMainConfigFile (TVMainConfigFile)</a>
+<li><a href="#~TVMainConfigFile (TVMainConfigFile)">~TVMainConfigFile (TVMainConfigFile)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Modules"></a>
+<H1>Modules</H1>
+
+<Menu>
+<li><a href="#Code Page">Code Page</a>
+<li><a href="#Config File">Config File</a>
+<li><a href="#Display">Display</a>
+<li><a href="#DOS Display">DOS Display</a>
+<li><a href="#OS Clipboard">OS Clipboard</a>
+<li><a href="#Screen">Screen</a>
+<li><a href="#TVFontCollection">TVFontCollection</a>
+</Menu>
+
+
+<p><hr></p>
+<a name="Code Page"></a>
+<H1>Code Page</H1>
+
+This module provides code page remapping needed to adapt the special
+character to all the supported terminals.
+<p>
+
+ It was originally designed for SETEdit and moved to Turbo Vision in 2002.
+<p>
+
+ The internal encoding system maps the first 256 to CP 437.
+<p>
+
+ Important: The Turbo Vision never had such a thing and this is completly
+new code that affects a lot of TV components.
+<p>
+
+ The mechanism used is similar to what Linux kernel uses, why? simple:<br>
+1) That's the most complex mechanism I found in all the targets so far.<br>
+2) This is quite crazy but at the same time flexible.<br>
+ What's similar?<br>
+ We have two maps. The first map is what Linux calls SFM (Screen Font Map).
+It defines which internal codes are rendered by each font character (which
+unicodes in Linux kernel). This is basically a map that describes the font.
+This is the only map I had in the editor. The curScrCP variable holds the
+ID of this map.
+<p>
+
+ The second map is what the Linux kernel calls ACM (Application Charset
+Map). This map describes how is the application data encoded, as an example:
+how is encoded the text. It doesn't have to map one to one with the font,
+and that's the complex stuff. For this reason this map is used to do an
+"on-the-fly" remap before sending the characters to the screen. If this map
+is identical to the SFM (maps 1 to 1 =&gt; what Linux calls trivial mapping)
+we don't do the remap. The OnTheFlyRemapNeeded() and OnTheFlyRemap(uchar val)
+are used for the remap. The curAppCP holds the ID of this map.
+<p>
+
+ Is important to note that we don't do 8-bits -&gt; ACM -&gt; Unicode -&gt; SFM -&gt;
+8-bits Screen like the Linux kernel does. We recode the application using
+the ACM and if ACM!=SFM we use a simple table that makes: 8-bits -&gt; 8-bits
+Screen and if it isn't needed we just send the code to the screen.
+<p>
+
+ I added a new code page to this: the input code page. In Linux systems
+the input is supposed to be encoded in the ACM code page. In Windows systems
+they can be different and they are asked with different calls. It can be
+useful if you want to use an encoding different than the currently used by
+the OS. You can change the screen encoding and load an appropriate font for
+it, then you change the application code page and you can properly see
+documents encoded in the target code page. But in order to edit them you
+need to translate the codes that come from keyboard to the target code page.
+That's a good use for the input code page.
+
+<Menu>
+<li><a href="#AddCodePage (TVCodePage)">AddCodePage (TVCodePage)</a>
+<li><a href="#CodePageOfID (TVCodePage)">CodePageOfID (TVCodePage)</a>
+<li><a href="#CreateCodePagesCol (TVCodePage)">CreateCodePagesCol (TVCodePage)</a>
+<li><a href="#CreateCPFromUnicode (TVCodePage)">CreateCPFromUnicode (TVCodePage)</a>
+<li><a href="#CreateOnTheFlyInpRemap (TVCodePage)">CreateOnTheFlyInpRemap (TVCodePage)</a>
+<li><a href="#CreateOnTheFlyRemap (TVCodePage)">CreateOnTheFlyRemap (TVCodePage)</a>
+<li><a href="#CreateRemap (TVCodePage)">CreateRemap (TVCodePage)</a>
+<li><a href="#FillTables (TVCodePage)">FillTables (TVCodePage)</a>
+<li><a href="#GetList (TVCodePage)">GetList (TVCodePage)</a>
+<li><a href="#GetTranslate (TVCodePage)">GetTranslate (TVCodePage)</a>
+<li><a href="#IDToIndex (TVCodePage)">IDToIndex (TVCodePage)</a>
+<li><a href="#IndexToID (TVCodePage)">IndexToID (TVCodePage)</a>
+<li><a href="#InternalCodeForUnicode (TVCodePage)">InternalCodeForUnicode (TVCodePage)</a>
+<li><a href="#LookSimilarInRange (TVCodePage)">LookSimilarInRange (TVCodePage)</a>
+<li><a href="#RemapBufferGeneric (TVCodePage)">RemapBufferGeneric (TVCodePage)</a>
+<li><a href="#RemapChar (TVCodePage)">RemapChar (TVCodePage)</a>
+<li><a href="#RemapNString (TVCodePage)">RemapNString (TVCodePage)</a>
+<li><a href="#RemapString (TVCodePage)">RemapString (TVCodePage)</a>
+<li><a href="#RemapTVStrings (TVCodePage)">RemapTVStrings (TVCodePage)</a>
+<li><a href="#SetCallBack (TVCodePage)">SetCallBack (TVCodePage)</a>
+<li><a href="#SetCodePage (TVCodePage)">SetCodePage (TVCodePage)</a>
+<li><a href="#TVCodePage (TVCodePage)">TVCodePage (TVCodePage)</a>
+<li><a href="#UnicodeForInternalCode (TVCodePage)">UnicodeForInternalCode (TVCodePage)</a>
+<li><a href="#~TVCodePage (TVCodePage)">~TVCodePage (TVCodePage)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Config File"></a>
+<H1>Config File</H1>
+
+This module provides the TVConfigFile class. This class can load a
+configuration file containing sections and variables. Each section have
+a name which is indicated using brackets [Name]. As sections can be nested
+and my text editor can indent using the braces as reference (also jump to
+the start/end of a block and highlight the pair) the section's body must
+be enclosed using braces. Sections can be nested conforming an structure
+that resembles a file system. Inside a section you can define variables. A
+variable name must be composed of a-zA-Z_0-9 characters. After the name, and
+in the same line, an equal sign must be put. The value after the equal sign
+can be a number (decimal, octal or hexadecimal as in C) or a string enclosed
+using double quotes. You can use spaces around the equal sign and after the
+value but you must finish a definition in one line. Comments are started
+with a # symbol and ends at the end of the line.
+<p>
+
+ The information from a configuration file is stored in memory as a tree.
+You can search in the tree some key indicating it as a you indicate a path
+and file name. Just think it as a particular file system, just use forward
+slashes.
+
+<Menu>
+<li><a href="#Add (TVMainConfigFile)">Add (TVMainConfigFile)</a>
+<li><a href="#Add (TVMainConfigFile) <1>">Add (TVMainConfigFile) <1></a>
+<li><a href="#AddInt (TVConfigFile)">AddInt (TVConfigFile)</a>
+<li><a href="#AddString (TVConfigFile)">AddString (TVConfigFile)</a>
+<li><a href="#Load (TVConfigFile)">Load (TVConfigFile)</a>
+<li><a href="#Load (TVMainConfigFile)">Load (TVMainConfigFile)</a>
+<li><a href="#Print (TVConfigFile)">Print (TVConfigFile)</a>
+<li><a href="#Print (TVMainConfigFile)">Print (TVMainConfigFile)</a>
+<li><a href="#Search (TVConfigFile)">Search (TVConfigFile)</a>
+<li><a href="#Search (TVMainConfigFile)">Search (TVMainConfigFile)</a>
+<li><a href="#Search (TVMainConfigFile) <1>">Search (TVMainConfigFile) <1></a>
+<li><a href="#Search (TVMainConfigFile) <2>">Search (TVMainConfigFile) <2></a>
+<li><a href="#Search (TVMainConfigFile) <3>">Search (TVMainConfigFile) <3></a>
+<li><a href="#SetUserConfigFile (TVMainConfigFile)">SetUserConfigFile (TVMainConfigFile)</a>
+<li><a href="#TVConfigFile (TVConfigFile)">TVConfigFile (TVConfigFile)</a>
+<li><a href="#TVMainConfigFile (TVMainConfigFile)">TVMainConfigFile (TVMainConfigFile)</a>
+<li><a href="#~TVConfigFile (TVConfigFile)">~TVConfigFile (TVConfigFile)</a>
+<li><a href="#~TVMainConfigFile (TVMainConfigFile)">~TVMainConfigFile (TVMainConfigFile)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Display"></a>
+<H1>Display</H1>
+
+This is the base class for low level screen output.
+ Most members are pointers to functions defined by each platform dependent
+driver. Default members are provided.
+ This is a complete new file created from concepts that Jos&eacute; Angel Sanchez
+Caso provide me and coded from scratch. The names of some members are the
+same used in original Turbo Vision for compatibility purposes.
+
+<Menu>
+<li><a href="#defaultCheckForWindowSize (TDisplay)">defaultCheckForWindowSize (TDisplay)</a>
+<li><a href="#defaultClearScreen (TDisplay)">defaultClearScreen (TDisplay)</a>
+<li><a href="#defaultGetBlinkState (TDisplay)">defaultGetBlinkState (TDisplay)</a>
+<li><a href="#defaultGetCols (TDisplay)">defaultGetCols (TDisplay)</a>
+<li><a href="#defaultGetCrtMode (TDisplay)">defaultGetCrtMode (TDisplay)</a>
+<li><a href="#defaultGetCursorShape (TDisplay)">defaultGetCursorShape (TDisplay)</a>
+<li><a href="#defaultGetRows (TDisplay)">defaultGetRows (TDisplay)</a>
+<li><a href="#defaultGetWindowTitle (TDisplay)">defaultGetWindowTitle (TDisplay)</a>
+<li><a href="#defaultSetCrtMode (TDisplay)">defaultSetCrtMode (TDisplay)</a>
+<li><a href="#defaultSetCrtModeExt (TDisplay)">defaultSetCrtModeExt (TDisplay)</a>
+<li><a href="#defaultSetCrtModeRes (TDisplay)">defaultSetCrtModeRes (TDisplay)</a>
+<li><a href="#defaultSetCursorShape (TDisplay)">defaultSetCursorShape (TDisplay)</a>
+<li><a href="#defaultSetWindowTitle (TDisplay)">defaultSetWindowTitle (TDisplay)</a>
+<li><a href="#searchDOSModeInfo (TDisplay)">searchDOSModeInfo (TDisplay)</a>
+<li><a href="#setCursorType (TDisplay)">setCursorType (TDisplay)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="DOS Display"></a>
+<H1>DOS Display</H1>
+
+This module implements the low level DOS screen access.
+<p>
+
+
+ Todo:<br>
+ * The palette map could be changed during suspend. Currently not
+ suported. But is a really bizarre case and is restored if VGA state saving
+ is used.
+
+<Menu>
+<li><a href="#GetWindowTitle (TDisplayDOS)">GetWindowTitle (TDisplayDOS)</a>
+<li><a href="#SetCrtMode (TDisplayDOS)">SetCrtMode (TDisplayDOS)</a>
+<li><a href="#SetWindowTitle (TDisplayDOS)">SetWindowTitle (TDisplayDOS)</a>
+<li><a href="#testForSupport (TDisplayDOS)">testForSupport (TDisplayDOS)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="OS Clipboard"></a>
+<H1>OS Clipboard</H1>
+
+OS independent clipboard system class. Uses to access the OS clipboard.<br>
+ It was created to abstract the X11 and Windows clipboards.
+
+<Menu>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Screen"></a>
+<H1>Screen</H1>
+
+This is the base class for medium level screen output.
+ Most members are pointers to functions defined by each platform dependent
+driver. Default members are provided.
+ This is a complete new file created from concepts that Jos&eacute; Angel Sanchez
+Caso provide me and coded from scratch. The names of some members are the
+same used in original Turbo Vision for compatibility purposes.
+
+<Menu>
+<li><a href="#TScreen (TScreen)">TScreen (TScreen)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="TVFontCollection"></a>
+<H1>TVFontCollection</H1>
+
+This module handles collections of 8xN bitmaped fonts useful for text
+consoles. The collection is created from a fonts files. Each item is a font
+of certain height. The collection can return interpolated and extrapolated
+fonts in a range of +/- one from the available fonts. The fonts file should
+contain fonts with all the supported symbols.
+<p>
+
+
+<pre>
+ SFT Files: This is currently platform dependent! It means SFT files should
+ be generated in the same platform they are used. It will be fixed in the
+ future.
+
+ 17 bytes: SET's editor font
+ 1 byte: 26 (DOS EOF)
+ int: version (1 or 2)
+ int: number of fonts contained.
+ 2 bytes: size of name
+ the name, the length includes the EOS, but this isn't stored on
+ disk.
+
+ Here are the fonts, each one have this format:
+ version 1:
+ int: first symbol defined.
+ int: last symbol defined.
+ unsigned: height of the font.
+ The width is assumed to be 8 pixels (1 byte)
+
+ version 2, the same but adds:
+ unsigned: width of the font.
+
+ The fonts itself follows the internal code.
+</pre>
+
+<Menu>
+<li><a href="#CheckForLines (TVFontCollection)">CheckForLines (TVFontCollection)</a>
+<li><a href="#CheckSignature (TVFontCollection)">CheckSignature (TVFontCollection)</a>
+<li><a href="#CreateFont (TVFontCollection)">CreateFont (TVFontCollection)</a>
+<li><a href="#CreateListOfFonts (TVFontCollection)">CreateListOfFonts (TVFontCollection)</a>
+<li><a href="#EnlargeOne (TVFontCollection)">EnlargeOne (TVFontCollection)</a>
+<li><a href="#freeItem (TVFontCollection)">freeItem (TVFontCollection)</a>
+<li><a href="#GetFont (TVFontCollection)">GetFont (TVFontCollection)</a>
+<li><a href="#ReadFontInfo (TVFontCollection)">ReadFontInfo (TVFontCollection)</a>
+<li><a href="#ReadName (TVFontCollection)">ReadName (TVFontCollection)</a>
+<li><a href="#ReadVersionNum (TVFontCollection)">ReadVersionNum (TVFontCollection)</a>
+<li><a href="#ReduceOne (TVFontCollection)">ReduceOne (TVFontCollection)</a>
+<li><a href="#SetCodePage (TVFontCollection)">SetCodePage (TVFontCollection)</a>
+<li><a href="#TVFontCollection (TVFontCollection)">TVFontCollection (TVFontCollection)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Files"></a>
+<H1>Files</H1>
+
+<Menu>
+<li><a href="#codepage.cc">codepage.cc</a>
+<li><a href="#configfile.cc">configfile.cc</a>
+<li><a href="#dosdis.cc">dosdis.cc</a>
+<li><a href="#fontcoll.cc">fontcoll.cc</a>
+<li><a href="#tdisplay.cc">tdisplay.cc</a>
+<li><a href="#tdrawbuf.cc">tdrawbuf.cc</a>
+<li><a href="#tscreen.cc">tscreen.cc</a>
+<li><a href="#xtermkey.cc">xtermkey.cc</a>
+</Menu>
+
+
+<p><hr></p>
+<a name="codepage.cc"></a>
+<H1>codepage.cc</H1>
+
+
+
+<Menu>
+<li><a href="#AddCodePage (TVCodePage)">AddCodePage (TVCodePage)</a>
+<li><a href="#CodePageOfID (TVCodePage)">CodePageOfID (TVCodePage)</a>
+<li><a href="#CreateCodePagesCol (TVCodePage)">CreateCodePagesCol (TVCodePage)</a>
+<li><a href="#CreateCPFromUnicode (TVCodePage)">CreateCPFromUnicode (TVCodePage)</a>
+<li><a href="#CreateOnTheFlyInpRemap (TVCodePage)">CreateOnTheFlyInpRemap (TVCodePage)</a>
+<li><a href="#CreateOnTheFlyRemap (TVCodePage)">CreateOnTheFlyRemap (TVCodePage)</a>
+<li><a href="#CreateRemap (TVCodePage)">CreateRemap (TVCodePage)</a>
+<li><a href="#FillTables (TVCodePage)">FillTables (TVCodePage)</a>
+<li><a href="#GetList (TVCodePage)">GetList (TVCodePage)</a>
+<li><a href="#GetTranslate (TVCodePage)">GetTranslate (TVCodePage)</a>
+<li><a href="#IDToIndex (TVCodePage)">IDToIndex (TVCodePage)</a>
+<li><a href="#IndexToID (TVCodePage)">IndexToID (TVCodePage)</a>
+<li><a href="#InternalCodeForUnicode (TVCodePage)">InternalCodeForUnicode (TVCodePage)</a>
+<li><a href="#LookSimilarInRange (TVCodePage)">LookSimilarInRange (TVCodePage)</a>
+<li><a href="#RemapBufferGeneric (TVCodePage)">RemapBufferGeneric (TVCodePage)</a>
+<li><a href="#RemapChar (TVCodePage)">RemapChar (TVCodePage)</a>
+<li><a href="#RemapNString (TVCodePage)">RemapNString (TVCodePage)</a>
+<li><a href="#RemapString (TVCodePage)">RemapString (TVCodePage)</a>
+<li><a href="#RemapTVStrings (TVCodePage)">RemapTVStrings (TVCodePage)</a>
+<li><a href="#SetCallBack (TVCodePage)">SetCallBack (TVCodePage)</a>
+<li><a href="#SetCodePage (TVCodePage)">SetCodePage (TVCodePage)</a>
+<li><a href="#TVCodePage (TVCodePage)">TVCodePage (TVCodePage)</a>
+<li><a href="#UnicodeForInternalCode (TVCodePage)">UnicodeForInternalCode (TVCodePage)</a>
+<li><a href="#~TVCodePage (TVCodePage)">~TVCodePage (TVCodePage)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="configfile.cc"></a>
+<H1>configfile.cc</H1>
+
+
+
+<Menu>
+<li><a href="#Add (TVMainConfigFile)">Add (TVMainConfigFile)</a>
+<li><a href="#Add (TVMainConfigFile) <1>">Add (TVMainConfigFile) <1></a>
+<li><a href="#AddInt (TVConfigFile)">AddInt (TVConfigFile)</a>
+<li><a href="#AddString (TVConfigFile)">AddString (TVConfigFile)</a>
+<li><a href="#Load (TVConfigFile)">Load (TVConfigFile)</a>
+<li><a href="#Load (TVMainConfigFile)">Load (TVMainConfigFile)</a>
+<li><a href="#Print (TVConfigFile)">Print (TVConfigFile)</a>
+<li><a href="#Print (TVMainConfigFile)">Print (TVMainConfigFile)</a>
+<li><a href="#Search (TVConfigFile)">Search (TVConfigFile)</a>
+<li><a href="#Search (TVMainConfigFile)">Search (TVMainConfigFile)</a>
+<li><a href="#Search (TVMainConfigFile) <1>">Search (TVMainConfigFile) <1></a>
+<li><a href="#Search (TVMainConfigFile) <2>">Search (TVMainConfigFile) <2></a>
+<li><a href="#Search (TVMainConfigFile) <3>">Search (TVMainConfigFile) <3></a>
+<li><a href="#SetUserConfigFile (TVMainConfigFile)">SetUserConfigFile (TVMainConfigFile)</a>
+<li><a href="#TVConfigFile (TVConfigFile)">TVConfigFile (TVConfigFile)</a>
+<li><a href="#TVMainConfigFile (TVMainConfigFile)">TVMainConfigFile (TVMainConfigFile)</a>
+<li><a href="#~TVConfigFile (TVConfigFile)">~TVConfigFile (TVConfigFile)</a>
+<li><a href="#~TVMainConfigFile (TVMainConfigFile)">~TVMainConfigFile (TVMainConfigFile)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="dosdis.cc"></a>
+<H1>dosdis.cc</H1>
+
+
+
+<Menu>
+<li><a href="#GetWindowTitle (TDisplayDOS)">GetWindowTitle (TDisplayDOS)</a>
+<li><a href="#SetCrtMode (TDisplayDOS)">SetCrtMode (TDisplayDOS)</a>
+<li><a href="#SetWindowTitle (TDisplayDOS)">SetWindowTitle (TDisplayDOS)</a>
+<li><a href="#testForSupport (TDisplayDOS)">testForSupport (TDisplayDOS)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="fontcoll.cc"></a>
+<H1>fontcoll.cc</H1>
+
+
+
+<Menu>
+<li><a href="#CheckForLines (TVFontCollection)">CheckForLines (TVFontCollection)</a>
+<li><a href="#CheckSignature (TVFontCollection)">CheckSignature (TVFontCollection)</a>
+<li><a href="#CreateFont (TVFontCollection)">CreateFont (TVFontCollection)</a>
+<li><a href="#CreateListOfFonts (TVFontCollection)">CreateListOfFonts (TVFontCollection)</a>
+<li><a href="#EnlargeOne (TVFontCollection)">EnlargeOne (TVFontCollection)</a>
+<li><a href="#freeItem (TVFontCollection)">freeItem (TVFontCollection)</a>
+<li><a href="#GetFont (TVFontCollection)">GetFont (TVFontCollection)</a>
+<li><a href="#ReadFontInfo (TVFontCollection)">ReadFontInfo (TVFontCollection)</a>
+<li><a href="#ReadName (TVFontCollection)">ReadName (TVFontCollection)</a>
+<li><a href="#ReadVersionNum (TVFontCollection)">ReadVersionNum (TVFontCollection)</a>
+<li><a href="#ReduceOne (TVFontCollection)">ReduceOne (TVFontCollection)</a>
+<li><a href="#SetCodePage (TVFontCollection)">SetCodePage (TVFontCollection)</a>
+<li><a href="#TVFontCollection (TVFontCollection)">TVFontCollection (TVFontCollection)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="tdisplay.cc"></a>
+<H1>tdisplay.cc</H1>
+
+
+
+<Menu>
+<li><a href="#defaultCheckForWindowSize (TDisplay)">defaultCheckForWindowSize (TDisplay)</a>
+<li><a href="#defaultClearScreen (TDisplay)">defaultClearScreen (TDisplay)</a>
+<li><a href="#defaultGetBlinkState (TDisplay)">defaultGetBlinkState (TDisplay)</a>
+<li><a href="#defaultGetCols (TDisplay)">defaultGetCols (TDisplay)</a>
+<li><a href="#defaultGetCrtMode (TDisplay)">defaultGetCrtMode (TDisplay)</a>
+<li><a href="#defaultGetCursorShape (TDisplay)">defaultGetCursorShape (TDisplay)</a>
+<li><a href="#defaultGetRows (TDisplay)">defaultGetRows (TDisplay)</a>
+<li><a href="#defaultGetWindowTitle (TDisplay)">defaultGetWindowTitle (TDisplay)</a>
+<li><a href="#defaultSetCrtMode (TDisplay)">defaultSetCrtMode (TDisplay)</a>
+<li><a href="#defaultSetCrtModeExt (TDisplay)">defaultSetCrtModeExt (TDisplay)</a>
+<li><a href="#defaultSetCrtModeRes (TDisplay)">defaultSetCrtModeRes (TDisplay)</a>
+<li><a href="#defaultSetCursorShape (TDisplay)">defaultSetCursorShape (TDisplay)</a>
+<li><a href="#defaultSetWindowTitle (TDisplay)">defaultSetWindowTitle (TDisplay)</a>
+<li><a href="#searchDOSModeInfo (TDisplay)">searchDOSModeInfo (TDisplay)</a>
+<li><a href="#setCursorType (TDisplay)">setCursorType (TDisplay)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="tdrawbuf.cc"></a>
+<H1>tdrawbuf.cc</H1>
+
+
+
+<Menu>
+<li><a href="#moveBuf (TDrawBuffer)">moveBuf (TDrawBuffer)</a>
+<li><a href="#moveChar (TDrawBuffer)">moveChar (TDrawBuffer)</a>
+<li><a href="#moveCStr (TDrawBuffer)">moveCStr (TDrawBuffer)</a>
+<li><a href="#moveStr (TDrawBuffer)">moveStr (TDrawBuffer)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="tscreen.cc"></a>
+<H1>tscreen.cc</H1>
+
+
+
+<Menu>
+<li><a href="#TScreen (TScreen)">TScreen (TScreen)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="xtermkey.cc"></a>
+<H1>xtermkey.cc</H1>
+
+
+
+<Menu>
+<li><a href="#FillTEvent (TGKeyXTerm)">FillTEvent (TGKeyXTerm)</a>
+<li><a href="#GetKeyParsed (TGKeyXTerm)">GetKeyParsed (TGKeyXTerm)</a>
+<li><a href="#GetRaw (TGKeyXTerm)">GetRaw (TGKeyXTerm)</a>
+<li><a href="#GetShiftState (TGKeyXTerm)">GetShiftState (TGKeyXTerm)</a>
+<li><a href="#GKey (TGKeyXTerm)">GKey (TGKeyXTerm)</a>
+<li><a href="#InitOnce (TGKeyXTerm)">InitOnce (TGKeyXTerm)</a>
+<li><a href="#ProcessEscape (TGKeyXTerm)">ProcessEscape (TGKeyXTerm)</a>
+<li><a href="#Resume (TGKeyXTerm)">Resume (TGKeyXTerm)</a>
+<li><a href="#Suspend (TGKeyXTerm)">Suspend (TGKeyXTerm)</a>
+</Menu>
+
+
+
+
+
+<p><hr></p>
+<a name="CreateCodePagesCol (TVCodePage)"></a>
+<center><Font Size=+2>CreateCodePagesCol</Font> (codepage.cc 1265)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::CreateCodePagesCol();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Protected member used to create the list of known code pages stored in
+CodePages.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="TVCodePage (TVCodePage)"></a>
+<center><Font Size=+2>TVCodePage</Font> (codepage.cc 1332)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::TVCodePage(int idApp, int idScr, int idInp);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Initializes the code page system selecting the indicated code pages. This
+is only used iternally. <a href="#SetCodePage (TVCodePage)">SetCodePage</a>.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="CreateRemap (TVCodePage)"></a>
+<center><Font Size=+2>CreateRemap</Font> (codepage.cc 1358)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::CreateRemap(int idSource, int idDest, uchar *table);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Protected member used to create a one to one table to convert from one
+code page to another. Used to create the input to application and application
+to screen on the fly convertion tables.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="CreateOnTheFlyRemap (TVCodePage)"></a>
+<center><Font Size=+2>CreateOnTheFlyRemap</Font> (codepage.cc 1416)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::CreateOnTheFlyRemap(int idApp, int idScr);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Protected member used to create the application to screen map when we have
+to translate values on the fly. <a href="#CreateRemap (TVCodePage)">CreateRemap</a>.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="CreateOnTheFlyInpRemap (TVCodePage)"></a>
+<center><Font Size=+2>CreateOnTheFlyInpRemap</Font> (codepage.cc 1444)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::CreateOnTheFlyInpRemap(int idInp, int idApp);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Protected member used to create the input to application map when we have
+to translate values on the fly. <a href="#CreateRemap (TVCodePage)">CreateRemap</a>.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="SetCodePage (TVCodePage)"></a>
+<center><Font Size=+2>SetCodePage</Font> (codepage.cc 1467)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::SetCodePage(int idApp, int idScr, int idInp);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Selects the current code page used for toupper, tolower, etc. operations
+and internal encodings, the code page used for the screen and the one used
+for input.
+<p>
+
+ If any of the arguments is -1 the current value is used. If the code pages
+aren't the same the remap on the fly is enabled. The application code page
+is used to remap the application, only if it changed.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="FillTables (TVCodePage)"></a>
+<center><Font Size=+2>FillTables</Font> (codepage.cc 1497)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::FillTables(int id);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Protected member used to create the toupper, tolower and isalpha tables.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="~TVCodePage (TVCodePage)"></a>
+<center><Font Size=+2>~TVCodePage</Font> (codepage.cc 1566)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::~TVCodePage();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Deallocates memory used by TVCodePage.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="IDToIndex (TVCodePage)"></a>
+<center><Font Size=+2>IDToIndex</Font> (codepage.cc 1582)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::IDToIndex(int id);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Converts a code page id into an index in the code page collection.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The index of the code page with this id. If error the index for
+PC 437 code page is returned.
+<p>
+
+
+
+<p><hr></p>
+<a name="IndexToID (TVCodePage)"></a>
+<center><Font Size=+2>IndexToID</Font> (codepage.cc 1606)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::IndexToID(ccIndex index);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Converts an index in the code page collection into a code page id. No
+check of range is done.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The code page id for the indicated index.
+<p>
+
+
+
+<p><hr></p>
+<a name="GetTranslate (TVCodePage)"></a>
+<center><Font Size=+2>GetTranslate</Font> (codepage.cc 1626)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::GetTranslate(int id);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Used to get a map to translate code page symbols into internal symbols for
+the indicated code page id.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A pointer to a static buffer containing the translation values. Or
+NULL if not initialized. The index 256 indicates 128 if only the upper 128
+values are really different from CP 437 or 256 if all the values are
+different. In any case all the values are usable.
+<p>
+
+
+
+<p><hr></p>
+<a name="GetList (TVCodePage)"></a>
+<center><Font Size=+2>GetList</Font> (codepage.cc 1657)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::GetList(void);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Used to get a TStringCollection listing all the available code pages.
+Useful to make the user choose one. This is a read-only value, don't modify
+it.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The internal collection casted to TStringCollection.
+<p>
+
+
+
+<p><hr></p>
+<a name="RemapChar (TVCodePage)"></a>
+<center><Font Size=+2>RemapChar</Font> (codepage.cc 1673)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::RemapChar(uchar c, ushort *map);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Remaps the desired character using the provided map. The original character
+should be in CP437 encoding. <a href="#GetTranslate (TVCodePage)">GetTranslate</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The remapped character. It can be a direct translation or the
+closest found.
+<p>
+
+
+
+<p><hr></p>
+<a name="RemapString (TVCodePage)"></a>
+<center><Font Size=+2>RemapString</Font> (codepage.cc 1703)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::RemapString(uchar *n, uchar *o, ushort *map);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Remaps the <b>o</b> string using the provided map and storing it in the
+<b>n</b> string. The string should be terminated by a 0. <a href="#RemapChar (TVCodePage)">RemapChar</a>.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="RemapNString (TVCodePage)"></a>
+<center><Font Size=+2>RemapNString</Font> (codepage.cc 1719)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::RemapNString(uchar *n, uchar *o, ushort *map, int len);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Remaps the @var{o} string using the provided map and storing it in the
+@var{n} string. The number of items to remap is indicated with @var{len}.
+<a href="#RemapChar (TVCodePage)">RemapChar</a>.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="RemapBufferGeneric (TVCodePage)"></a>
+<center><Font Size=+2>RemapBufferGeneric</Font> (codepage.cc 1734)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::RemapBufferGeneric(int sourID, int destID, uchar *buffer, unsigned len, unsigned ops);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Used to remap a buffer from any of the supported code pages into another.
+The process doesn't have to be reversible.
+<p>
+
+ Tabs, carriage returns, new lines and the null code aren't remapped.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="RemapTVStrings (TVCodePage)"></a>
+<center><Font Size=+2>RemapTVStrings</Font> (codepage.cc 1815)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::RemapTVStrings(ushort *map);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Protected member used internally to remap all the TV stuff that isn't
+ASCII.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="SetCallBack (TVCodePage)"></a>
+<center><Font Size=+2>SetCallBack</Font> (codepage.cc 1873)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::SetCallBack(TVCodePageCallBack cb);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sets the function to be called after changing the code page. This should
+remap the special strings used by the application.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The previous function. If it's != NULL you should call it.
+<p>
+
+
+
+<p><hr></p>
+<a name="CodePageOfID (TVCodePage)"></a>
+<center><Font Size=+2>CodePageOfID</Font> (codepage.cc 1889)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::CodePageOfID(int id);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Protected member used to find the code page structure for a provided id.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A CodePage structure pointer.
+<p>
+
+
+
+<p><hr></p>
+<a name="UnicodeForInternalCode (TVCodePage)"></a>
+<center><Font Size=+2>UnicodeForInternalCode</Font> (codepage.cc 2567)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::UnicodeForInternalCode(uint16 value);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Finds which unicode is represented by the specified internal code.
+Currently that's an slow search because isn't very.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The first unicode found.
+<p>
+
+
+
+<p><hr></p>
+<a name="InternalCodeForUnicode (TVCodePage)"></a>
+<center><Font Size=+2>InternalCodeForUnicode</Font> (codepage.cc 2593)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::InternalCodeForUnicode(ushort unicode);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Finds which internal code can render an Unicode value.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The internal or -1 if none can do it.
+<p>
+
+
+
+<p><hr></p>
+<a name="CreateCPFromUnicode (TVCodePage)"></a>
+<center><Font Size=+2>CreateCPFromUnicode</Font> (codepage.cc 2610)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::CreateCPFromUnicode(CodePage *cp, int id, const char *name, ushort *unicodes);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Creates a new code page from an arry containing the unicodes for each
+symbol. Use an id over than 0x7FFF8000 to avoid collisions. This is used by
+the Linux driver when the unicodes maps doesn't match with known cp.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="AddCodePage (TVCodePage)"></a>
+<center><Font Size=+2>AddCodePage</Font> (codepage.cc 2649)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::AddCodePage(CodePage *cp);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Adds a custom code page to the list. You can create a new one from an
+array containing the Unicodes for each symbol. <a href="#CreateCPFromUnicode (TVCodePage)">CreateCPFromUnicode</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The index of the new code page in the collection.
+<p>
+
+
+
+<p><hr></p>
+<a name="LookSimilarInRange (TVCodePage)"></a>
+<center><Font Size=+2>LookSimilarInRange</Font> (codepage.cc 2668)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVCodePage
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVCodePage::LookSimilarInRange(int code, int last);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVCodePage
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+This is a helper for the TVFontCollection class the parameters of this
+function could change in the future.<br>
+ Basically it finds a replacement for a missing symbol in a font. It allows
+using incomplete font.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The replacement or -1 if none known.
+<p>
+
+
+
+<p><hr></p>
+<a name="TVConfigFile (TVConfigFile)"></a>
+<center><Font Size=+2>TVConfigFile</Font> (configfile.cc 66)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVConfigFile::TVConfigFile();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Initializes the class and reads the contents of the specified file to a
+tree in memory.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="Search (TVConfigFile)"></a>
+<center><Font Size=+2>Search</Font> (configfile.cc 86)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVConfigFile::Search(const char *key, char *&p, long &n);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Searchs for the indicated key in the tree. Separate nested sections using
+forward slashes.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+not 0 if the key was found, the return value is in <b>p</b> if
+the key is an string. Otherwise <b>p</b> is NULL and the value is in
+<b>n</b>.
+<p>
+
+
+
+<p><hr></p>
+<a name="AddInt (TVConfigFile)"></a>
+<center><Font Size=+2>AddInt</Font> (configfile.cc 530)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVConfigFile::AddInt(const char *key, const char *name, long value, int priority);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Adds a new variable to the tree. The type of the variable is integer. The
+<b>name</b> variable is added to the section indicated by <b>key</b>.
+Possible priority values are justHint (25), fromFile (50) or fromApplication
+(75). It is used to determine if a current value should be replaced by the
+new value. The name is copied.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 if the variable was added.
+<p>
+
+
+<Font Size=+1><u>Example</u></Font><p>
+
+TVConfigFile::AddInt("TV/X11","ScreenWidth",90,
+TVConfigFile::fromFile)
+<p>
+
+
+<p><hr></p>
+<a name="AddString (TVConfigFile)"></a>
+<center><Font Size=+2>AddString</Font> (configfile.cc 562)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVConfigFile::AddString(const char *key, const char *name, const char *value, int priority);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Adds a new variable to the tree. The type of the variable is string. The
+<b>name</b> variable is added to the section indicated by <b>key</b>.
+Possible priority values are justHint (25), fromFile (50) or fromApplication
+(75). It is used to determine if a current value should be replaced by the
+new value. The name and the content are copied.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 if the variable was added.
+<p>
+
+
+<Font Size=+1><u>Example</u></Font><p>
+
+TVConfigFile::AddInt("TV/X11","ExtProgVideoMode","A_Program",
+TVConfigFile::fromFile)
+<p>
+
+
+<p><hr></p>
+<a name="Print (TVConfigFile)"></a>
+<center><Font Size=+2>Print</Font> (configfile.cc 651)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVConfigFile::Print(FILE *f);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Prints the current tree to the specified file. It's main purpose is to
+debug programs, but you can use it to generate valid configuration files
+from data found in memory.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="~TVConfigFile (TVConfigFile)"></a>
+<center><Font Size=+2>~TVConfigFile</Font> (configfile.cc 665)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ ~TVConfigFile();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+This is the destructor and just releases the tree that contains the
+variables.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="Load (TVConfigFile)"></a>
+<center><Font Size=+2>Load</Font> (configfile.cc 672)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ int Load(const char *file);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Reads the specified configuration file.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The read status, 0 means no error. The <b>Errors</b> data member
+contains descriptions for the errors.
+<p>
+
+
+
+<p><hr></p>
+<a name="TVMainConfigFile (TVMainConfigFile)"></a>
+<center><Font Size=+2>TVMainConfigFile</Font> (configfile.cc 694)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVMainConfigFile::TVMainConfigFile();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+This is the constructor for TVMainConfigFile. This class is a special case
+of TVConfigFile used for the Turbo Vision configuration file. Note you can
+store application specific information in the configuration file using a
+section different than TV.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="Load (TVMainConfigFile)"></a>
+<center><Font Size=+2>Load</Font> (configfile.cc 713)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVMainConfigFile::Load();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Loads the configuration file. First we try using the application provided
+name, then we search in the current directory, the path indicated by the
+HOME environment variable, the path indicated by the HOMEDIR environment
+variable, /etc and /dev/env/DJDIR/etc (%DJDIR%/etc). The default name for
+the file is tvrc, if the OS uses a point in the name to make it a hidden file
+the library also tries with .tvrc.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The error status. 0 is OK.
+<p>
+
+
+
+<p><hr></p>
+<a name="~TVMainConfigFile (TVMainConfigFile)"></a>
+<center><Font Size=+2>~TVMainConfigFile</Font> (configfile.cc 764)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVMainConfigFile::~TVMainConfigFile();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Destroys the global TVConfigFile that contains the configuration.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="Search (TVMainConfigFile)"></a>
+<center><Font Size=+2>Search</Font> (configfile.cc 802)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVMainConfigFile::Search(const char *key, long &val);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Looks for the specified key in the TV section. If found the result is
+stored in <b>val</b>, but only if that's an integer.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+True if the key exists, even when that's an string.
+<p>
+
+
+
+<p><hr></p>
+<a name="Search (TVMainConfigFile) <1>"></a>
+<center><Font Size=+2>Search</Font> (configfile.cc 823)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVMainConfigFile::Search(const char *section, const char *variable, long &val);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Looks for the specified @var{variable} in the TV section using the
+specified @var{section} as subsection. If found the result is
+stored in <b>val</b>, but only if that's an integer.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+True if the key exists, even when that's an string.
+<p>
+
+
+
+<p><hr></p>
+<a name="Search (TVMainConfigFile) <2>"></a>
+<center><Font Size=+2>Search</Font> (configfile.cc 845)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVMainConfigFile::Search(const char *key);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Looks for the specified key in the TV section. If found the result is
+returned but only if that's a string.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The string or NULL.
+<p>
+
+
+
+<p><hr></p>
+<a name="Search (TVMainConfigFile) <3>"></a>
+<center><Font Size=+2>Search</Font> (configfile.cc 867)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVMainConfigFile::Search(const char *section, const char *variable);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Looks for the specified @var{variable} in the TV section using the
+specified @var{section} as subsection. If found the result is returned but
+only if that's a string.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The string or NULL.
+<p>
+
+
+
+<p><hr></p>
+<a name="Add (TVMainConfigFile)"></a>
+<center><Font Size=+2>Add</Font> (configfile.cc 891)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVMainConfigFile::Add(const char *section, const char *name, long value);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Adds a new variable of integer type to the TV subtree in the specified
+<b>section</b> and using the specified <b>name</b>. The priority for this
+variable is TVConfigFile::fromApplication. <a href="#AddInt (TVConfigFile)">AddInt</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 if added.
+<p>
+
+
+
+<p><hr></p>
+<a name="Add (TVMainConfigFile) <1>"></a>
+<center><Font Size=+2>Add</Font> (configfile.cc 916)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TVMainConfigFile::Add(const char *section, const char *name, const char *value);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Adds a new variable of string type to the TV subtree in the specified
+<b>section</b> and using the specified <b>name</b>. The priority for this
+variable is TVConfigFile::fromApplication. The string is copied.
+<a href="#AddInt (TVConfigFile)">AddInt</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 if added.
+<p>
+
+
+
+<p><hr></p>
+<a name="Print (TVMainConfigFile)"></a>
+<center><Font Size=+2>Print</Font> (configfile.cc 941)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ void TVMainConfigFile::Print(FILE *f);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Prints the current tree to the specified file. It's main purpose is to
+debug programs, but you can use it to generate valid configuration files
+from data found in memory.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="SetUserConfigFile (TVMainConfigFile)"></a>
+<center><Font Size=+2>SetUserConfigFile</Font> (configfile.cc 949)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TVConfigFile
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ void TVMainConfigFile::SetUserConfigFile(const char *name);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVMainConfigFile
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Specifies a name and path for the configuration file. Use it
+if your application needs special settings different than the rest of the
+TV applications.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="testForSupport (TDisplayDOS)"></a>
+<center><Font Size=+2>testForSupport</Font> (dosdis.cc 506)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TDisplayDOS::testForSupport();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplayDOS
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Used to test if a mode that we don't know can be handled by the driver
+or not. If the mode uses an unknown memory region we just assume that's
+a graphics mode and revert to 80x25. It could be enhanced a lot specially to
+support VESA video modes when implemented in a way that the video memory
+isn't located at the usual address.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="SetCrtMode (TDisplayDOS)"></a>
+<center><Font Size=+2>SetCrtMode</Font> (dosdis.cc 549)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TDisplayDOS::SetCrtMode(ushort mode);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplayDOS
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sets a video mode from the video mode number. Video modes with the low
+nibble equal 3 are used to encode extended and tweacked video modes. Note
+that VESA 800x600x256 mode is 0x103 and here it is assumed to be extended
+mode 1, that's 80x28. Also note that regular VGA 80x25 mode is the
+"extended mode 0".<br>
+ Any other value is assumed to be a user provided video mode and is
+accepted only if we are sure that's really text mode and we know how to
+handle it.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="GetWindowTitle (TDisplayDOS)"></a>
+<center><Font Size=+2>GetWindowTitle</Font> (dosdis.cc 633)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TDisplayDOS::GetWindowTitle(void);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplayDOS
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Finds the main window title if we are running under W95 and windowed.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A pointer to a newly allocated string (new[]). Or 0 if fail. by SET.
+<p>
+
+
+
+<p><hr></p>
+<a name="SetWindowTitle (TDisplayDOS)"></a>
+<center><Font Size=+2>SetWindowTitle</Font> (dosdis.cc 673)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TDisplayDOS::SetWindowTitle(const char *name);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplayDOS
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sets the main window title if we are running under W95 and windowed.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+1 successful. by SET.
+<p>
+
+
+
+<p><hr></p>
+<a name="freeItem (TVFontCollection)"></a>
+<center><Font Size=+2>freeItem</Font> (fontcoll.cc 74)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::freeItem(void *item);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+A specialized free to free the memory used by the font structure.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="CheckForLines (TVFontCollection)"></a>
+<center><Font Size=+2>CheckForLines</Font> (fontcoll.cc 93)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::CheckForLines(void *item, void *arg);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Internally used during searchs to look for a font that matchs a specified
+size.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="ReduceOne (TVFontCollection)"></a>
+<center><Font Size=+2>ReduceOne</Font> (fontcoll.cc 111)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::ReduceOne(uchar *dest, uchar *ori, int height, int wBytes, int num);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Creates a font of the specified height from another of the same height
+plus one. The destination buffer should be large enough (num*height bytes).
+Special care is taked for letters.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="EnlargeOne (TVFontCollection)"></a>
+<center><Font Size=+2>EnlargeOne</Font> (fontcoll.cc 144)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::EnlargeOne(uchar *dest, uchar *ori, int height, int wBytes, int num);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Creates a font of the specified height from another of the same height
+minus one. The destination buffer should be large enough (num*height bytes).
+The last line is filled with 0.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="GetFont (TVFontCollection)"></a>
+<center><Font Size=+2>GetFont</Font> (fontcoll.cc 174)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::GetFont(int width, int height);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+NULL if the font isn't available.
+<p>
+
+
+
+<p><hr></p>
+<a name="CheckSignature (TVFontCollection)"></a>
+<center><Font Size=+2>CheckSignature</Font> (fontcoll.cc 218)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::CheckSignature(FILE *f);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Internally used to check if we opened a fonts file.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="ReadName (TVFontCollection)"></a>
+<center><Font Size=+2>ReadName</Font> (fontcoll.cc 233)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::ReadName(FILE *f);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Internally used to get the font's name.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="ReadVersionNum (TVFontCollection)"></a>
+<center><Font Size=+2>ReadVersionNum</Font> (fontcoll.cc 268)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::ReadVersionNum(FILE *f, int *version, int *numfonts);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Internally used to read the version and number of fonts in the file.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="ReadFontInfo (TVFontCollection)"></a>
+<center><Font Size=+2>ReadFontInfo</Font> (fontcoll.cc 288)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::ReadFontInfo(FILE *f, int version, TVBitmapFont *p);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Internally used to read the information about a font contained in an SFT
+file.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+Size of the data font.
+<p>
+
+
+
+<p><hr></p>
+<a name="CreateFont (TVFontCollection)"></a>
+<center><Font Size=+2>CreateFont</Font> (fontcoll.cc 315)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::CreateFont(void *item, void *arg);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Internally used to create a font for a desired code page.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="SetCodePage (TVFontCollection)"></a>
+<center><Font Size=+2>SetCodePage</Font> (fontcoll.cc 360)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::SetCodePage(int id);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sets the encoding of the fonts returned by GetFont.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="TVFontCollection (TVFontCollection)"></a>
+<center><Font Size=+2>TVFontCollection</Font> (fontcoll.cc 382)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::TVFontCollection(const char *file, int cp);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Creates a font collection from the specified file and using the specified
+code page. You must check the error status with GetError before using the
+collection.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="CreateListOfFonts (TVFontCollection)"></a>
+<center><Font Size=+2>CreateListOfFonts</Font> (fontcoll.cc 449)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TVFontCollection::CreateListOfFonts(const char *dir, unsigned wmin, unsigned wmax, unsigned hmin, unsigned hmax);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TVFontCollection
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Constructs a string collection of fonts files that provides shapes inside
+the specified range. The fonts are searched in the specified directory. If
+you specify NULL as directory then the search is done in the current
+directory. Each element in the collection is a string that contains two
+ASCIIZ strings. The first is the fantasy name of the font and the second is
+the name of the file containing it. It is useful to display the name in
+a TSortedListBox and easilly locate which file contains it using strlen.<br>
+ This is an static member.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The collection of available fonts or NULL if none.
+<p>
+
+
+
+<p><hr></p>
+<a name="defaultGetCols (TDisplay)"></a>
+<center><Font Size=+2>defaultGetCols</Font> (tdisplay.cc 139)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultGetCols();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Number of columns of the physical screen.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="defaultGetRows (TDisplay)"></a>
+<center><Font Size=+2>defaultGetRows</Font> (tdisplay.cc 148)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultGetRows();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Number of rows of the physical screen.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="defaultClearScreen (TDisplay)"></a>
+<center><Font Size=+2>defaultClearScreen</Font> (tdisplay.cc 157)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultClearScreen(uchar, uchar);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Erase the screen using this width and height.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="defaultSetCursorShape (TDisplay)"></a>
+<center><Font Size=+2>defaultSetCursorShape</Font> (tdisplay.cc 165)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultSetCursorShape(unsigned, unsigned);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sets the cursor shape, values in percent.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="defaultGetCursorShape (TDisplay)"></a>
+<center><Font Size=+2>defaultGetCursorShape</Font> (tdisplay.cc 173)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultGetCursorShape(unsigned &start, unsigned &end);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Gets the cursor shape, values in percent.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="searchDOSModeInfo (TDisplay)"></a>
+<center><Font Size=+2>searchDOSModeInfo</Font> (tdisplay.cc 184)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::searchDOSModeInfo(ushort mode, unsigned &w, unsigned &h, int &fW, int &fH);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+True if the mode is known.
+<p>
+
+
+
+<p><hr></p>
+<a name="defaultSetCrtMode (TDisplay)"></a>
+<center><Font Size=+2>defaultSetCrtMode</Font> (tdisplay.cc 204)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultSetCrtMode(ushort mode);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sets the video mode.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="defaultSetCrtModeExt (TDisplay)"></a>
+<center><Font Size=+2>defaultSetCrtModeExt</Font> (tdisplay.cc 218)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultSetCrtModeExt(char *command);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sets the video mode using a string. It could be an external
+program or other information that doesn't fit in an ushort.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="defaultSetCrtModeRes (TDisplay)"></a>
+<center><Font Size=+2>defaultSetCrtModeRes</Font> (tdisplay.cc 231)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultSetCrtModeRes(unsigned, unsigned, int, int);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Selects the mode that's closest to the sepcified width and
+height. The optional font size can be specified.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+0 no change done, 1 change done with all the requested parameters,
+2 change done but just to get closer.
+<p>
+
+
+
+<p><hr></p>
+<a name="defaultGetCrtMode (TDisplay)"></a>
+<center><Font Size=+2>defaultGetCrtMode</Font> (tdisplay.cc 241)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultGetCrtMode();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Returns current video mode.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="defaultCheckForWindowSize (TDisplay)"></a>
+<center><Font Size=+2>defaultCheckForWindowSize</Font> (tdisplay.cc 251)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultCheckForWindowSize(void);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Returns !=0 if the screen size changed externally. Usually
+when we are in a window, but isn't the only case.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="defaultGetWindowTitle (TDisplay)"></a>
+<center><Font Size=+2>defaultGetWindowTitle</Font> (tdisplay.cc 261)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultGetWindowTitle(void);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Gets the visible title of the screen, usually the window
+title.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="defaultSetWindowTitle (TDisplay)"></a>
+<center><Font Size=+2>defaultSetWindowTitle</Font> (tdisplay.cc 272)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultSetWindowTitle(const char *);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sets the visible title of the screen, usually the window
+title.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 success.
+<p>
+
+
+
+<p><hr></p>
+<a name="defaultGetBlinkState (TDisplay)"></a>
+<center><Font Size=+2>defaultGetBlinkState</Font> (tdisplay.cc 282)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::defaultGetBlinkState();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Finds if the MSB of the attribute is for blinking.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+0 no, 1 yes, 2 no but is used for other thing.
+<p>
+
+
+
+<p><hr></p>
+<a name="setCursorType (TDisplay)"></a>
+<center><Font Size=+2>setCursorType</Font> (tdisplay.cc 326)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TDisplay
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TDisplay::setCursorType(ushort val);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDisplay
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sets the cursor shape. I take the TV 2.0 convention: the low 8 bits is
+the start and the high 8 bits the end. Values can be between 0 and 99. To
+disable the cursor a value of 0 is used.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="moveBuf (TDrawBuffer)"></a>
+<center><Font Size=+2>moveBuf</Font> (tdrawbuf.cc 22)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TDrawBuffer::moveBuf(unsigned indent, const void *source, unsigned attr, unsigned count);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDrawBuffer
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Copies count bytes from source to the data buffer starting at indent. The
+function uses the provided attribute, but if the attribute is 0 the attribute
+in the buffer is unmodified.
+<p>
+
+ Added a check to avoid writings passing the end of the buffer.
+<p>
+
+<p>
+
+
+
+
+<p><hr></p>
+<a name="moveChar (TDrawBuffer)"></a>
+<center><Font Size=+2>moveChar</Font> (tdrawbuf.cc 60)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TDrawBuffer::moveChar(unsigned indent, char c, unsigned attr, unsigned count);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDrawBuffer
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Fills count bytes in the buffer starting at the indent position. If the
+attribute is 0 the original is left unchanged. If the character is 0 only
+the attribute is used.
+<p>
+
+ Added a check to avoid writings passing the end of the buffer.
+<p>
+
+<p>
+
+
+
+
+<p><hr></p>
+<a name="moveCStr (TDrawBuffer)"></a>
+<center><Font Size=+2>moveCStr</Font> (tdrawbuf.cc 110)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TDrawBuffer::moveCStr(unsigned indent, const char *str, unsigned attrs);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDrawBuffer
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+That's the same as moveStr but the attrs parameter holds two attributes
+the lower 8 bits are the normal value and the upper 8 bits define the
+attribute to be used for text enclosed by ASCII 126. <a href="#moveStr (TDrawBuffer)">moveStr</a>.
+<p>
+
+ The routine was modified to avoid writes passing the end of the buffer.
+Additionally was re-writed in assembler (I guess the Borland's original code
+was assembler, but I didn't take a look to it) because the check slow downs
+the routine so I wanted to avoid a lose in performance. SET.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="moveStr (TDrawBuffer)"></a>
+<center><Font Size=+2>moveStr</Font> (tdrawbuf.cc 207)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TDrawBuffer::moveStr(unsigned indent, const char *str, unsigned attr);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TDrawBuffer
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Writes a string in the buffer with the provided attribute. The routine
+copies until the EOS is found or the buffer is filled.
+<p>
+
+ Modified to avoid writes passing the end of the buffer. Optimized for
+32 bits. Translated to asm just for fun, I think is a little bit faster.
+SET.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="TScreen (TScreen)"></a>
+<center><Font Size=+2>TScreen</Font> (tscreen.cc 247)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+<pre>
+ #define Uses_TScreen
+ #include &lt;tv.h&gt;
+
+</pre>
+
+
+<pre>
+ TScreen::TScreen();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TScreen
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+This constructor is called when the TApplication object is created. The
+TProgramInit constructor creates a dynamic copy instance of a TScreen
+object.<br>
+ Actually it calls the detection routines to determine the best driver
+available. If non is found prints and error to the stderr output and aborts
+the execution.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="InitOnce (TGKeyXTerm)"></a>
+<center><Font Size=+2>InitOnce</Font> (xtermkey.cc 72)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TGKeyXTerm::InitOnce();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TGKeyXTerm
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Does initialization tasks performed only once.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+0 if success, !=0 if an error ocurred. In the last case the error member
+points to a descriptive error.
+<p>
+
+
+
+<p><hr></p>
+<a name="Suspend (TGKeyXTerm)"></a>
+<center><Font Size=+2>Suspend</Font> (xtermkey.cc 138)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TGKeyXTerm::Suspend();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TGKeyXTerm
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Restore the original console state.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="Resume (TGKeyXTerm)"></a>
+<center><Font Size=+2>Resume</Font> (xtermkey.cc 152)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TGKeyXTerm::Resume();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TGKeyXTerm
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Memorize current console state and setup the one needed for us.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="ProcessEscape (TGKeyXTerm)"></a>
+<center><Font Size=+2>ProcessEscape</Font> (xtermkey.cc 611)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TGKeyXTerm::ProcessEscape();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TGKeyXTerm
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Parse a escape sequence.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+: 1 if the sequence found, 0 if not and the keys are stored in the
+buffer.
+<p>
+
+
+
+<p><hr></p>
+<a name="GetKeyParsed (TGKeyXTerm)"></a>
+<center><Font Size=+2>GetKeyParsed</Font> (xtermkey.cc 677)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TGKeyXTerm::GetKeyParsed();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TGKeyXTerm
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Gets a key from the buffer, waiting value or fIn and if needed calls
+the escape sequence parser.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="GetRaw (TGKeyXTerm)"></a>
+<center><Font Size=+2>GetRaw</Font> (xtermkey.cc 717)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TGKeyXTerm::GetRaw();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TGKeyXTerm
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Gets the next key, their modifiers and ASCII. Is a postprocessor for
+GetKeyParsed.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="GKey (TGKeyXTerm)"></a>
+<center><Font Size=+2>GKey</Font> (xtermkey.cc 750)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TGKeyXTerm::GKey();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TGKeyXTerm
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Gets a key from the input and converts it into the TV format.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="GetShiftState (TGKeyXTerm)"></a>
+<center><Font Size=+2>GetShiftState</Font> (xtermkey.cc 783)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TGKeyXTerm::GetShiftState();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TGKeyXTerm
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Finds the value of the modifiers in TV format.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="FillTEvent (TGKeyXTerm)"></a>
+<center><Font Size=+2>FillTEvent</Font> (xtermkey.cc 809)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ TGKeyXTerm::FillTEvent(TEvent &e);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+TGKeyXTerm
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Fills the TV event structure for a key.
+<p>
+
+
+
+
+
+
+</body>
+</html>
diff --git a/tvision/doc/Win32.txt b/tvision/doc/Win32.txt
new file mode 100644
index 0000000..5aef910
--- /dev/null
+++ b/tvision/doc/Win32.txt
@@ -0,0 +1,103 @@
+Driver: Win32 and WinNT
+Author: Vadim Beloborodov, Anatoli Soltan, Salvador E. Tropea
+Status: Complete
+$Revision: 1.1 $
+
+ This file documents details specific to the Win32 and WinNT drivers. Both
+drivers can be used for Win32 systems, this means the WinNT driver is also ok
+for Windows 95. When we say "Win32" we refer to the 32 bits versions of
+Windows. The first Win32 version of Windows released to the market was
+Windows 95. You can divide Win32 platforms in two big groups: The Windows 95
+and other Win32 versions that runs on top of DOS, they are Windows 95, 98 and
+Me (Millenium). And the Windows NT and others that doesn't run on top of DOS,
+they are Windows NT, 2000 and XP. These are the names upto year 2002, newer
+releases are supposed to be all in the Windows NT family.
+
+1. INTRODUCTION
+2. FEATURES
+3. IMPORTANT DETAILS
+4. CONFIGURATION VARIABLES
+
+
+1. INTRODUCTION
+
+ Currently you'll find two different drivers, they are quite similar and
+will converge in the future. Currently the differences are really small
+because I (SET) recoded both drivers and added a lot of important things. In
+the process I made them more similar.
+ The differences are:
+
+Win32: It uses a separated thread to read the input events, all the keyboard
+ and mouse events are stored in a queue. The screen update is simpler
+ but slower.
+WinNT: Uses only one execution thread, events are polled and the queue is
+ maintained by the OS. The screen is updated using a buffer to assemble
+ the text and then it's sent in one call. It seems to be faster.
+
+ Which driver have more priority depends on the compiler you used to create
+the application. If Borland compiler was used the WinNT driver will have more
+priority and if MinGW/Cygwin was used Win32 will have more priority. This is
+just because Vadim contributed the first Win32 code that compiled only with
+MinGW and Anatoli contributed the first WinNT driver that compiled only with
+Borland C++ compiler and only worked for Windows NT family. With the time
+they became more and more similar.
+ You can change which driver is used using a configuration file.
+ These are a simple drivers that uses the Win32 console API. That's the set
+of services offered by Win32 OS to use text mode. I must admit the API is
+well documented and quite clean. Lamentably is not hard to hit bugs and
+stupid limitations that you can do nothing to overcome.
+
+
+2. FEATURES
+
+ The drivers supports:
+
+* Window size. Note the size must fit in the screen, if the screen isn't big
+enough you'll get the bigger posible size. Also note this depends on some
+things you can't control: screen resolution, font size and window position.
+Only the third could be controlled. Also note it ever fails if the
+application is running in full screen and resized applications won't be able
+to go fullscreen.
+* Window title set/restore.
+* Most keyboard combinations.
+* Restore user screen. In some cases the text cursor seems to be lost after
+running the application, this seems to be a bug in Win32 API triggered by
+some missuse from my part. If you minimize the window and restore it, or just
+hide it under another window and then make it visible again the cursor
+appears. It doesn't happend in all situations and the code specifically
+restores it.
+
+
+3. IMPORTANT DETAILS
+
+ These drivers seems to be slower on Windows 9x family and faster on Windows
+NT family when compared to the DOS driver running windowed. I think that's
+because Windows NT doesn't draw all the information sent to the screen,
+instead the content is refreshed periodically. It doesn't apply to the
+Windows 9x version running fullscreen where the speed is really slow, this is
+even worst for the Win32 driver. I would like to get feedback about it.
+ When you try to resize an application that's windowed using the mouse what
+you do is change the size of the font. It only works when the font size is
+set to "Auto". If the value is fixed you can just reduce the size of the
+window and get scroll bars. At least that's how Windows 98 SE works.
+ At least on my system the window can go to full screen only when the size
+is 80x25 or 80x50. Otherwise the color palette changes and the application
+must remain windowed. I don't know why the palette changes and you can't
+control the color palette.
+
+
+4. CONFIGURATION VARIABLES
+
+ Only a few configuration variables are supported, none specific for these
+drivers. The supported variables are: ScreenWidth, ScreenHeight, AppCP, ScrCP
+and InpCP.
+ Note that ScreenWidth and ScreenHeight are limited as explained in
+"Features" and the code page shouldn't be forced because:
+
+1) The API supports a very limited set of code pages.
+2) The fonts are fixed and encoded as the OS reports.
+3) The API have mechanisms to inform the current code page. This code page is
+hard to change for Windows 95 family.
+
+ For more information about configuration files read the corresponding doc.
+
diff --git a/tvision/doc/WinGr.txt b/tvision/doc/WinGr.txt
new file mode 100644
index 0000000..f69b77e
--- /dev/null
+++ b/tvision/doc/WinGr.txt
@@ -0,0 +1,11 @@
+Driver: WinGr
+Author: Jose Angel Sanchez Caso (JASC)
+Status: Not complete, random suggestions and details
+$Revision: 1.1 $
+
+ This driver isn't finished yet.
+ That's a graphical Win32 driver. Note that graphical just means we emulate
+the text drawing it. It doesn't mean the application will use Windows GUI for
+buttons, menues, etc.
+ If you want to test this driver use a configuration file to chnage the
+priority of the driver, use something like 200.
diff --git a/tvision/doc/X11.txt b/tvision/doc/X11.txt
new file mode 100644
index 0000000..8579e09
--- /dev/null
+++ b/tvision/doc/X11.txt
@@ -0,0 +1,177 @@
+Driver: X11
+Author: Salvador E. Tropea
+Status: Not complete, random suggestions and details
+Revision: $Revision: 1.10 $
+
+ This file documents details specific to the X11 driver. By X11 I mean the X
+Window system version 11 release 6 also known as X11R6. The driver was tested
+with XFree86 and Solaris.
+ Currently this file isn't organized and just contains things I think
+somebody could need to know.
+
+* The X11 driver was tested using Debian GNU/Linux Potato and Woody and
+Solaris 2.7 (Sun Ultra 60 machine).
+
+* The driver was tested in True Color modes, I didn't have the time to check
+it in palette modes (256 colors usually) and I'm almost sure nothing works
+for monochrome mode. If you need it working for 8 bpp depths please contact
+me and we will try to see a way to solve any issue. I don't have any
+motivation to expend my time working on 8 bpp modes if nobody needs it.
+
+* The approach used is slow in favor of portability and features. A lot of
+enhancements can be done. If you know about X11 programming and have some
+time please consider helping with it.
+
+* The driver uses 8x16 and 10x20 fixed fonts, no X fonts. In the future I
+plan to code a driver supporting X11 fonts. Why? simple: because in this way
+I can change the screen encoding on the fly and I know all the needed symbols
+will be available. The library supports over than 40 encodings which needs
+over than 580 symbols in the fonts. They cover the latin variants, cyrillics
+and greek alphabets. Not all X fonts supports all the needed symbols, in fact
+True Types usually have only ASCII characters. Additionally we need fixed
+width fonts.
+ Currently the fonts provided by SETEdit project have more variety than the
+XFree86 fixed font, which in fact are included.
+
+* I use monochromatic XImage objects for the fonts and I let X to expand the
+colors. XFree86 seems to be quite ineficient doing it, while Solaris' X is
+much faster. I think we can get much more speed by expanding the colors to an
+internal bitmap and then doing the blit in one operation. But this needs
+special care about different color depths and colors organizations. I guess
+the color values returned by X can make it easy, but never tried.
+
+* The implemented clipboards are XA_CLIPBOARD and XA_PRIMARY. Only XA_STRING
+format is supported.
+
+* I don't have a default icon, if you can create one please send it to me.
+
+* Debian GNU/Linux Potato specific (maybe others too):
+The Shift+Tab combination doesn't work. The problem seems to be related to
+the following key binding found in /usr/X11R6/lib/X11/xkb/symbols/us
+
+ key <TAB> { [ Tab, ISO_Left_Tab ] };
+
+For some reason, didn't investigate it, the ISO_Left_Tab doesn't emit a
+keycode and hence Shift+Tab never reachs the code. May be I'm wrong but my
+way to fix that is by defining it like this:
+
+ key <TAB> { [ Tab ] };
+
+If you know about a better solution just let me know.
+
+* To quickly disable this driver when starting an application from a terminal
+emulator just define DISPLAY variable to nothing. Bash example:
+
+export DISPLAY=
+
+You can achive the same using a .tvrc file and giving a low priority to the
+X11 driver. Example:
+
+[TV]
+{
+ [X11]
+ {
+ Priority=1
+ }
+}
+
+The bigger the number the more important the driver. The default value is
+100, bigger than Linux, XTerm and UNIX drivers.
+
+* Window Manager/Desktop keys: In my opinion no WM/Dekstop should use simple
+key combinations for their own purposes interfering with applications.
+I don't know how to tell X11 to send the keystrokes to my application instead
+of the WM. I know an application can drag the keyboard focus but I also know
+it makes quite difficult to debug such an application. If you know about a
+way to tell X11 something like: Alt+F1 is mine, send it to me when I have the
+focus, please contact me.
+My suggestion is to configure your WM/Desktop to use more convenient
+keystrokes.
+I use Enlightenment as WM and Desktop here is what I do to avoid interference
+with TV applications:
+a) Debian GNU/Linux Potato: That's version 0.16.3 and I don't know about any
+Debian tool to configure the keyboard. So I edited
+/usr/share/enlightenment/config/keybindings.cfg changing all the Alt+Fx to
+Shift+Alt+Fx (__ALT to __ALT_SHIFT in Function keys).
+b) Debian GNU/Linux Woody: That's version 0.16.4. A very nice package called
+e16keyedit is available (I think it can be backported to Potato). It makes
+easier to redefine the keys used by E.
+
+* The ScreenWidth and ScreenHeight configuration variables are supported.
+They are very important because using them the window will be created with
+the desired size. If you change the size after initialization the window
+resize will be visible and part of the window could become outside the
+screen.
+
+* The driver is probably the most complete and flexible of all available
+drivers. All the TScreen things are supported:
+
+ * Window size.
+ * Window title.
+ * Font size, but you must provide the fonts.
+ * Secondary font.
+ * Color palette.
+ * Busy indicator.
+
+* The standard configuration options are supported:
+
+ScreenWidth Columns of the window.
+ScreenHeight Rows of the window.
+ScreenPalette Color palette, that's a string containing the 16 RGB
+ values.
+ "0,0,0,0,0,168,..."
+FontWidth Width of the font in pixels.
+FontHeight Height of the font in pixels.
+LoadSecondaryFont Request a secondary font to the application (must provide a
+ call back).
+AppCP Application encoding.
+ScrCP Screen encoding, this should be 885901.
+InpCP Input encoding.
+
+ Plus the following options:
+
+Font10x20 Selects the 10x20 font instead of 8x16.
+HideCursorWhenNoFocus By default enabled
+DontResizeToCells Don't resize the window to a cells multiple size if the WM
+ fails to follow the hints. This helps to avoid problems found
+ in KDE 3.1 alpha.
+InternalBusyCursor When enabled we use our own mouse cursor for it.
+UseUpdateThread When this option is enabled the driver updates the
+ window content even if the TV application is blocking
+ the CPU. That's very useful when the application
+ blocks and the window becomes "exposed". If this isn't
+ enabled X will fill the exposed area with black and
+ the user won't see the window content until the
+ application collects events.
+ It is available using two mechanisms selected at
+ compilation time:
+ 1) Using setitimer and signals:
+ It seems to be stable but the TV application must
+ avoid using setitimer and SIGALRM.
+ I only tested it for Linux but I'm using concepts I
+ successfuly used for Solaris in older versions of the
+ driver.
+ That's the default compilation option.
+ 2) Using POSIX threads (preemptive)
+ Only available for Linux.
+ When enabled the driver uses a separated thread to
+ collect the "expose" events and update the screen.
+ That's good because even when the application is
+ blocking (calling system, performing a long
+ calculation, etc.) the window can be exposed and the
+ contents of the screen will be updated (you don't get
+ a black window). But the problem is that Linux
+ implementation of POSIX threads is quite poor and
+ mixing threads with fork/exec doesn't work for big
+ applications. The driver implements it using
+ fork/system (system function is "thread protected")
+ but you must avoid killing your child or the update
+ thread will most probably die. The driver have a watch
+ dog timer and if the update thread dies will revert to
+ manual screen update in less than 2 seconds (>=1s &
+ <2s aprox.).
+
+* I don't know if anybody can be interested on it, but this driver compiles
+and run for Windows. You need to use Cygwin with the XFree86 port installed
+and run the applications from X. The result is quite slow, but works.
+
diff --git a/tvision/doc/XTerm.txt b/tvision/doc/XTerm.txt
new file mode 100644
index 0000000..b84a98f
--- /dev/null
+++ b/tvision/doc/XTerm.txt
@@ -0,0 +1,95 @@
+Driver: XTerm
+Author: Salvador E. Tropea
+Status: Complete
+Revision: $Revision: 1.2 $
+
+1. INTRODUCTION
+2. FEATURES
+3. IMPORTANT DETAILS
+4. CONFIGURATION VARIABLES
+
+1. INTRODUCTION
+
+ This driver was designed for the XTerm included in XFree86 v4.x. Previous
+versions like the one included in XFree86 v3.3.6 are supported but then the
+provided script must be used. I don't have access to other implementations of
+XTerm if you have contact me.
+ The Eterm is also supported by this driver, for details specific to Eterm
+please consult the documentation for the Eterm driver.
+ Use this driver when you have X Window but you need to use a remote machine
+and the connection isn't fast enough to use the native X11 mode.
+ This driver is enabled when the environment variable TERM indicates the
+terminal is called xterm. Most Linux distributions have other terminal
+emulators that also reports xterm in the TERM variable. This is a pretty bad
+idea and most of these terminal emulators are much less functional than
+xterm. Even when people have the idea that XTerm is a simple and limited
+terminal emulator I think XTerm is one of the most complete. I personally
+like the aspect of Eterm, but XTerm is far more configurable.
+
+
+2. FEATURES
+
+ The driver supports:
+
+* Window size.
+* Fonts size (set and restore).
+* Palette. XTerm is quite slow on it.
+* Window title set/restore.
+* Most keyboard combinations when using XTerm from XFree86 v4.x, for older
+versions use the provided script.
+* Restore shell screen (limited, you can't nest).
+
+
+3. IMPORTANT DETAILS
+
+ In order to get the maximum of key combinations you must start XTerm using
+a special script. This script defines some key combinations not supported by
+XTerm, makes old XTerm versions to report keys as the new one and changes the
+palette to be identical to the VGA BIOS palette (same used in Linux console
+for example).
+ Note this configuration is specially configured for TV applications and
+isn't the best for other tasks. I recommend to use at leat two connections to
+the remote machine, one for general tasks and another from an XTerm with this
+configuration to run TV applications.
+ One important thing about this script is that it defines the Alt+Key
+combinations as Meta+Key combinations, this is really important for keyboards
+without a Meta key. I personally have the left key that comes with a nasty
+symbols similar to a flag as Meta key.
+ The script is called XTerm.res and is located in the examples/xterm
+directory.
+ If you want to test this driver locally just export the DISPLAY variable
+with a null content like this (bash syntax):
+
+$ export DISPLAY=
+
+
+4. CONFIGURATION VARIABLES
+
+ For more information read the configuration documentation.
+ This driver supports the following standard configuration variables:
+
+ScreenWidth Columns of the window.
+ScreenHeight Rows of the window.
+ScreenPalette Color palette, that's a string containing the 16 RGB values.
+ "0,0,0,0,0,168,..."
+FontWidth Width of the font in pixels.
+FontHeight Height of the font in pixels.
+AppCP Application encoding.
+ScrCP Screen encoding, this should be 885901.
+InpCP Input encoding.
+
+ Plus the special option:
+
+UseShellScreen If that's different than 0 the shell screen is used for output
+ and not the secondary buffer. This option is mainly only
+ useful when the application will run as a child of other
+ application that's already using the secondary buffer. This
+ can be the case of a debugger.
+
+ Note that the font sizes are limited to a known set of sizes that
+correspond to the fonts included in XFree86:
+
+5x7, 5x8, 6x10, 6x12, 6x13, 7x13, 7x14, 8x13, 8x16, 9x15, 9x18, 10x20, 10x24
+
+ If you specify another size the closest will be used.
+
diff --git a/tvision/doc/html.frt b/tvision/doc/html.frt
new file mode 100644
index 0000000..ba962d1
--- /dev/null
+++ b/tvision/doc/html.frt
@@ -0,0 +1,272 @@
+#
+# This file sets the behavior of the txh generator
+#
+# Lines starting with # or spaces are skiped except in strings or in [Generate]
+# Be carefull with [ it delimits sections!
+#
+
+[Configuration]
+#
+# No external program is needed!
+# @.html means: Copy the temporal file to xxxxx.html
+#
+CommandLine=@.html
+Name="Direct HTML 3.X format"
+
+[Delimiters]
+# Up to 11 characters
+SectionStart=/**[txh]**
+# Up to 11 characters
+SectionEnd=*********/
+
+[Variables]
+#
+# Up to 16 definitions
+#
+# Codes for the behavior of the definitions:
+# 1 Normal, put the content if found.
+# 2 Repeat, use the last value found in the file, ~no is an exeption, ~clear stops
+# 3 If not found replace by the prototype.
+# 4 If not found replace by the class.
+# 5 If not found replace by the name of the function
+# 6 It disables the node generation for this comment. The variable is
+# stored in the first variable that have associations and is in the comment.
+#
+# Additionally there are 2 special variables:
+# 90 Name of the file
+# 91 Line number of the end of the comment
+# 92 Name of the var 0 in the format: ~0 ~~Distinguish{(~Distinguish)~} (node name)
+#
+# 0 The first variable is the main index variable
+#
+AddDefinition=Function,5
+# 1
+AddDefinition=Class,4
+# 2
+AddDefinition=Include,2
+# 3
+AddDefinition=Module,2
+# 4
+AddDefinition=Prototype,3
+# 5
+AddDefinition=Description,1
+# 6
+AddDefinition=Return,1
+# 7
+AddDefinition=Example,1
+# 8
+AddDefinition=Comments,6
+#
+# It says what variable is added to distinguish between 2 vars 0 that are equal
+#
+Distinguish=1
+
+[Associations]
+#
+# Up to 8 associations
+#
+# The associations are between the 0 variable and another variable.
+#
+# Name in main menu, node, variable, optional to add to each node
+#
+AddAssoc=List by classes,Classes,1,(class)
+AddAssoc=List by modules,Modules,3
+AddAssoc=List by files,Files,90
+
+[Replace]
+#
+# All must be delimited by ", they can be used in the GenMain section
+#
+# Title of the HTML
+Constant="Turbo Vision reference"
+
+# Description for the help
+Constant="This document describes the functions of Turbo Vision that didn't
+exist in the original version of the library.@*
+Note that only a few things are documented here, I need help to populate
+this file.
+@p
+This document applies to version 2.0.0
+of the Turbo Vision library.
+@p"
+
+[Commands]
+#
+# You can enclose these values between " to make more clear where
+# they start and end. Use \n,\r,\t and \" like in C. Use \ at the
+# end to concatenate like in C.
+#
+# @p = end of paragraph
+#
+EndOfPar="<p>"
+#
+# @* = break line
+#
+BreakLine="<br>"
+#
+# @{value} is the special cross ref.
+# ~0 Is the visible name of a reference
+# ~1 Is the real name of a reference
+#
+CrossRef="<a href=\"#~1\">~0</a>"
+#
+# What we must get from a @@ sequence
+#
+Double@="@"
+
+[DefinedCommands]
+#
+# The format is @<name>{parameters ...}
+#
+var="<b>~0</b>"
+subtitle="<Font Size=+1><u>~0</u></Font><p>"
+pre=<pre>
+/pre=</pre>
+link="<a href=\"~0\">~1</a>"
+mailto="<a href=\"mailto:~0\">~1</a>"
+
+#
+# This section says how to translate ASCIIs
+#
+[ASCIIConvert]
+á=&aacute;
+é=&eacute;
+í=&iacute;
+ó=&oacute;
+ú=&uacute;
+ñ=&ntilde;
+Ñ=&Ntilde;
+¡=&iexcl;
+¿=&iquest;
+ä=&auml;
+ë=&euml;
+ï=&iuml;
+ö=&ouml;
+ü=&uuml;
+Ü=&Uuml;
+à=&agrave;
+è=&egrave;
+ì=&igrave;
+ò=&ograve;
+ù=&ugrave;
+<=&lt;
+>=&gt;
+
+#
+# Use ~number to use one variable
+# Use ~~number{} for conditional, all the code inside {} will become
+# conditional
+# This section isn't passed for the macro expansion so here you are
+# free to use special commands for the formater.
+#
+[GenNode]
+<p><hr></p>
+<a name="~92"></a>
+<center><Font Size=+2>~0</Font> (~90 ~91)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+~~2{
+<pre>
+# This line is a comment, but the next is code
+ #define Uses_~2
+ #include &lt;tv.h&gt;
+
+</pre>
+~}
+~~4{
+<pre>
+ ~4;
+</pre>
+~}
+~~1{
+<Font Size=+1><u>Member of the class:</u></Font>
+~1
+<p>
+~}
+
+~~5{
+<Font Size=+1><u>Description</u></Font><p>
+
+~5
+<p>
+~}
+~~6{
+<Font Size=+1><u>Return Value</u></Font><p>
+
+~6
+<p>
+~}
+~~7{
+<Font Size=+1><u>Example</u></Font><p>
+
+~7
+<p>
+~}
+
+[GenMenu]
+Start="<Menu>"
+#
+# ~1 is the visible name
+# ~2 is the name of the node
+#
+Entry="<li><a href=\"#~2\">~1</a>"
+End="</Menu>"
+
+#
+# ~1 is the name of the association
+# ~2 is the menu for it
+#
+[GenAssoMain]
+<p><hr></p>
+<a name="~1"></a>
+<H1>~1</H1>
+
+~2
+#
+# ~1 is the name of the association
+# ~2 is the name without the distinguish
+# ~3 is the comment for it
+# ~4 is the menu for it
+#
+[GenAssoRest]
+<p><hr></p>
+<a name="~1"></a>
+<H1>~2</H1>
+
+~3
+
+~4
+
+#
+# ~1 Main menu
+# ~2 Name of the function list node
+# ~3 Menu for all the functions
+# ~4 All the associations code
+# ~5 All the function nodes
+# ~50+ Values from section Replace
+#
+[GenMain]
+<html>
+<head>
+<title>~50</title>
+</head>
+<body>
+<H1>~50</H1>
+
+~51
+
+~1
+
+<p><hr></p>
+<a name="~2"></a>
+<H1>~2</H1>
+
+~3
+
+~4
+
+~5
+
+</body>
+</html>
diff --git a/tvision/doc/install/bcc.txt b/tvision/doc/install/bcc.txt
new file mode 100644
index 0000000..c0378e1
--- /dev/null
+++ b/tvision/doc/install/bcc.txt
@@ -0,0 +1,70 @@
+ This file describes how to compile the package for Win32 systems using
+Borland C++ 5.5 free command line tools. Optionally you can use the BorlandC
+Builder 6 for it, that's compiler version 5.6. But I can do periodical tests
+only with the former. If you want to volunteer to periodically test the code
+with other versions please let me know.
+
+$Id: bcc.txt,v 1.3 2003/06/26 19:15:58 set Exp $
+
+1. INTRODUCTION
+2. HOW TO COMPILE
+3. INSTALLATION
+
+
+
+1. INTRODUCTION
+
+ The tools can be downloaded from internet without charge. Note: BorlandC
+Builder 6 also have a trial I used to fix some issues, but it have a limited
+time usage.
+ This target is periodically tested for compilation but not much tested for
+functionality.
+ You can compile the editor to run under Win32 platforms using various
+compilers, for this reason I explain the dis/advantages of using BC++ 5.5 for
+it.
+
+Advantages:
+
+* Unlike djgpp it generates a Win32 executable, so it integrates better with
+Windows NT incarnations (NT, 2000, XP, etc.).
+* The resulting binary doesn't need special DLLs.
+* BC++ 5.5 compiles really fast.
+* You don't need a lot of GNU tools, just the BC++ package distributed by
+Borland.
+* The environment is very well controlled. If you have BC++ 5.5 free command
+line tools it should compile without any problems.
+
+Disadvantages:
+
+* I don't use the resulting binary too much so it is more probable to find
+bugs not found in the same version compiled with other compilers.
+* BC++ 5.5 is quite inferior when compared with gcc in terms of code
+optimization.
+* This target can't run the configure script so you can't fine tune the
+process.
+* The installation isn't automated.
+
+
+
+2. HOW TO COMPILE
+
+ Currently I'm in a middle of a transition between an old mechanism and a
+new one (may 2003) so I'll give information about both mechanism.
+
+A) The new mechanism:
+
+ Run "make -f Makefile.bcc" this should create the library in the makes
+directory. The name is librhtv.lib.
+
+B) The old mechanism:
+
+ Instructions about it are contained in the WinNT directory.
+See: winnt/readme.txt
+
+
+
+3. INSTALLATION
+
+ Currently this target needs manual installation. You can also use the files
+without installing just providing the paths to the compiler.
+
diff --git a/tvision/doc/install/cygwin.txt b/tvision/doc/install/cygwin.txt
new file mode 100644
index 0000000..988ce23
--- /dev/null
+++ b/tvision/doc/install/cygwin.txt
@@ -0,0 +1,54 @@
+ This file describes how to compile the package for Win32 systems using
+GNU tools as provided by Cygnus' Cygwin package (Cygnus is currently part of
+Red Hat).
+
+$Id: cygwin.txt,v 1.3 2003/06/26 19:15:58 set Exp $
+
+1. INTRODUCTION
+2. COMPILING AND INSTALLING
+
+
+1. INTRODUCTION
+
+ Cygwin provides a POSIX environment for Win32 systems based on GNU tools.
+It makes quite easy to compile programs adapted for GNU tools. In order to
+compile this package you have to install the tools listed in
+doc/install/tools.txt
+ A short list of the needed tools is:
+ bash, binutils, fileutils, gcc, gpp, gettext, make, perl, shellutils,
+texinfo and textutils.
+ I experimented some bizarre problems while using Perl from Cygwin
+distribution so I switched to the version distributed by djgpp package. You
+can find information about djgpp in: http://www.delorie.com/djgpp/
+ I hope the problems are fixed in a newer version of Cygwin tools but
+lamentably I don't have time to test it. Volunteers will be welcome.
+ Some users reported success using the UNIX tarball instead of the .zip
+file. But I think it depends on the way you configured Cygwin.
+ You can compile the library to run under Win32 platforms using various
+compilers, for this reason I explain the dis/advantages of using Cygwin for
+it.
+
+Advantages:
+
+* Unlike djgpp it generates a Win32 executable, so it integrates better with
+Windows NT incarnations (NT, 2000, XP, etc.).
+* GCC is very good optimizing code.
+* You can use the configure script to fine tune the compilation process.
+* The installation is automated.
+
+Disadvantages:
+
+* The resulting binary needs a special DLLs provided by Cygwin.
+* The available compiler and the whole tools are really slow. GCC 3.x is too
+slow to compile C++ and the Win32 port is even worst.
+* I don't use the resulting binary too much so it is more probable to find
+bugs not found in the same version compiled with other compilers.
+
+
+2. COMPILING & INSTALLING
+
+ Once you installed all the needed tools your system will become some kind
+of GNU/Win32 system. For this reason you can just follow the instructions found
+in doc/install/unix.txt
+ I tested this process using Cygwin 1.3.3-2.
+
diff --git a/tvision/doc/install/djgpp.txt b/tvision/doc/install/djgpp.txt
new file mode 100644
index 0000000..9ed45dd
--- /dev/null
+++ b/tvision/doc/install/djgpp.txt
@@ -0,0 +1,84 @@
+ This file describes how to compile the package for DOS (djgpp) systems using
+GNU tools. You have to install a quite complete djgpp environment, you can
+download it from: http://www.delorie.com/djgpp/
+
+$Id: djgpp.txt,v 1.4 2004/11/29 16:23:17 set Exp $
+
+1. INTRODUCTION
+2. GETTEXT COLLISION
+3. COMPILING AND INSTALLING
+4. LAST DJGPP ENVIRONMENT TESTED
+
+
+1. INTRODUCTION
+
+ DJGPP provides a quite POSIX compliant environment for DOS systems. It is
+based on GNU tools. In order to compile this package you have to install the
+tools listed in doc/install/tools.txt
+ A short list of the needed tools is:
+ binutils, fileutils, gcc, gpp, gettext, make, perl, shellutils, texinfo and
+textutils.
+
+ We compiled the library using DJGPP 2.01, 2.02 and 2.03. Older versions
+won't work. The 2.01 version have some bugs that affect this package so I
+suggest a newer version.
+
+2. GETTEXT COLLISION
+
+ DJGPP versions older than 2.04 contains a collision between conio's gettext
+function and libintl's gettext function. Both are named "gettext". The
+documentation included in the gettext (libintl) package (i.e. gtxt040b.zip)
+explains how to solve this collision. You'll need to replace conio.o from
+libc.a and change conio.h.
+ Without it you'll get errors from the linker. Older versions of the linker
+didn't complain about it.
+
+3. COMPILING
+
+ Once you installed all the needed tools your system will become some kind
+of GNU/DOS system. For this reason you can just follow the instructions found
+in doc/install/unix.txt The only difference is that you'll have to invoke the
+configure.bat file instead of configure script, but as you don't have to type
+the extension it looks almost the same as in UNIX:
+
+c:\djgpp\contrib\tvision>configure
+
+4. LAST DJGPP ENVIRONMENT TESTED
+
+ The last compilation test was performed in the following system:
+
+OS: Windows 98 SE
+
+Core utils:
+djdev203 Development Kit and Runtime (June 2002 Refresh)
+gcc343b.zip : GCC 3.4.3 C compiler binaries for DJGPP
+gpp343b.zip : GCC 3.4.3 C++ compiler binaries for DJGPP
+bnu215b.zip : GNU binutils-2.15 binaries for DJGPP
+gtxt040b GNU Gettext 0.10.40 binaries for DJGPP V2
+licv192b GNU libiconv 1.9.2 for DJGPP V2
+mak3791b GNU Make 3.79.1 binaries for DJGPP V2
+fil41b GNU Fileutils 4.1 for DJGPP 2.x, release 7 (binaries)
+perl561b Perl 5.6.1b release 3 for DJGPP V2 (binaries)
+
+Other utils:
+bsh204d GNU Bash 2.04 binary for DJGPP
+bz2-102b bzip2 1.0.2 for DJGPP V2
+CVS 1.10 for DJGPP (local only) - Binary Distribution (patchlevel 3 - 05/2000)
+dif281b GNU Diffutils 2.8.1 for DJGPP V2
+djtzn203 Extra Timezone Support Files
+faq230b DJGPP FAQ List edition 2.30 for DJGPP v2.03
+find41b GNU findutils 4.1 for DJGPP V2
+gdb611b.zip - gdb-6.1.1 (binary archive for DJGPP)
+gdb611.zip - gdb-6.1.1 (source archive for DJGPP)
+grep24b GNU grep 2.4 binaries for DJGPP V2
+gzip13b GNU gzip 1.3 binaries for DJGPP V2
+lss374b GNU Less v374 binaries (DJGPP v2)
+pat254b GNU Patch 2.5.4 binaries for DJGPP v2
+rcode35b.zip GNU Recode 3.5 binaries for DJGPP V2
+Sh-utils 2.0.11 Apr 18, 2002 - Prashant TR <tr@midpec.com>
+tar112ab GNU tar 1.12a binaries for DJGPP V2
+txi47b GNU Texinfo 4.7 binaries for DJGPP V2
+txt20b GNU Textutils 2.0 binaries for DJGPP V2
+Which version 2.11 modified to work with DJGPP by David Cullen
+
+
diff --git a/tvision/doc/install/linux.txt b/tvision/doc/install/linux.txt
new file mode 100644
index 0000000..a0cfb53
--- /dev/null
+++ b/tvision/doc/install/linux.txt
@@ -0,0 +1,41 @@
+ This file describes how to compile the package for Linux systems using
+GNU tools. So you need a GNU/Linux environment, this is provided by all Linux
+distributions I know even when their name doesn't clearly denote they are
+GNU/Linux distros.
+
+$Id: linux.txt,v 1.2 2003/06/23 14:12:03 set Exp $
+
+1. INTRODUCTION
+2. MANUAL MECHANISM
+3. SYSTEMS BASED ON .DEB FILES (DEBIAN GNU/LINUX)
+4. SYSTEMS BASED ON .RPM FILES (REDHAT, SUSE, MANDRAKE)
+
+
+1. INTRODUCTION
+
+ Most Linux distributions have some package system, is much better if you
+create the packages first and then install them. This is because then you can
+uninstall the files or install the binaries in another machine that runs the
+same distribution.
+ Currently the library have scripts to generate packages for distributions
+based on .deb and .rpm packages. For other distributions you should follow
+the "manual" mechanism.
+ For a list of tools and libraries you should have in your system please read
+the doc/install/tools.txt file.
+
+2. MANUAL MECHANISM
+
+ Follow the instructions found in the doc/install/unix.txt file.
+
+3. SYSTEMS BASED ON .DEB FILES (DEBIAN GNU/LINUX)
+
+ Follow the instructions found in the debian/README file.
+
+4. SYSTEMS BASED ON .RPM FILES (REDHAT, SUSE, MANDRAKE)
+
+ Follow the instructions found in the redhat/README file.
+ Note: As the script to generate the RPM files doesn't check for errors I
+recommend trying to follow the "manual" mechanism but skip the installation
+procedure. Once you are sure all compiles perfectly for your system then try
+this procedure.
+
diff --git a/tvision/doc/install/mingwin.txt b/tvision/doc/install/mingwin.txt
new file mode 100644
index 0000000..9b133c2
--- /dev/null
+++ b/tvision/doc/install/mingwin.txt
@@ -0,0 +1,51 @@
+ This file describes how to compile the package for Win32 systems using
+GNU tools as provided by MinGW package (aka MingWin, MinGW32, etc.).
+
+$Id: mingwin.txt,v 1.4 2004/10/15 23:38:25 set Exp $
+
+1. INTRODUCTION
+2. COMPILING AND INSTALLING
+
+
+1. INTRODUCTION
+
+ MinGW needs the help of MSys and a Perl interpreter to compile this
+package. I tested it using MinGW 2.0.0/3.1.0, MSys 1.0.8/1.0.10 and the
+Siemens Perl port (SiePerl). This provides a good environment for compilation.
+You must ensure that MSys' make is used because MinGW 1.1 ships a make
+command that fails. Newer versions doesn't have this problem.
+ IMPORTANT! the resulting application can't be run from the MSys console
+(rxvt), use a DOS console or just start it as any Windows application.
+ For old versions you have to ensure that /bin/sh exists or at least create
+a symlink to bash there. If it isn't there you won't be able to run the shell
+scripts.
+ You can compile the library to run under Win32 platforms using various
+compilers, for this reason I explain the dis/advantages of using Cygwin for
+it.
+
+Advantages:
+
+* Unlike djgpp it generates a Win32 executable, so it integrates better with
+Windows NT incarnations (NT, 2000, XP, etc.).
+* GCC is very good optimizing code.
+* You can use the configure script to fine tune the compilation process.
+* The installation is automated.
+* The resulting binary doesn't need special DLLs.
+* All the needed tools are concentrated in a few packages you have to
+download.
+
+Disadvantages:
+
+* The available compiler and the whole tools are really slow. GCC 3.x is too
+slow to compile C++ and the Win32 port is even worst.
+* I don't use the resulting binary too much so it is more probable to find
+bugs not found in the same version compiled with other compilers.
+
+
+2. COMPILING AND INSTALLING
+
+ Once you installed all the needed tools your system will become some kind
+of GNU/Win32 system. For this reason you can just follow the instructions found
+in doc/install/unix.txt
+ I recommed configuring the package with --no-intl.
+
diff --git a/tvision/doc/install/msvc.txt b/tvision/doc/install/msvc.txt
new file mode 100644
index 0000000..c2d2ddd
--- /dev/null
+++ b/tvision/doc/install/msvc.txt
@@ -0,0 +1,105 @@
+ This file describes how to compile the package for Win32 systems using
+Microsoft Visual C compiler. Note that I don't have it and Microsoft doesn't
+offer reduced versions for free like Borland does. For this reason this
+target ever lags behind. I need volunteer to test this target periodically.
+ Note: Some time after writing it Microsoft released a reduced and free
+version of the compiler, but only for Windows 2000 and newer systems. I
+don't have access to such a version of Windows.
+
+$Id: msvc.txt,v 1.7 2009/01/06 12:39:22 set Exp $
+
+1. INTRODUCTION
+2. HOW TO COMPILE
+3. INSTALLING
+4. MSVC TARGET CONTRIBUTORS
+5. USING VISUAL STUDIO AND NOT NMAKE
+
+
+
+1. INTRODUCTION
+
+ This target is supported because users helped to make it possible. If you
+find any problem just do the same the other users did: help to fix them.
+ You can also create Win32 versions of this package using BorlandC Builder,
+Cygwin, Open Watcom or MinGW.
+ Versions 5.0, 6.0, 7.0 and 7.1 compiled the code.
+ Modern versions of Visual Studio doesn't seem to include nmake tool. A quick
+and incomplete, but useful, method to compile the code is in the section 5.
+
+
+2. HOW TO COMPILE
+
+ You can use the unified make system:
+
+nmake -f Makefile.nmk
+
+ If it fails you can try using the old mechanism explained in
+winnt/readme.txt
+
+
+3. INSTALLATION
+
+ Currently this target needs manual installation. You can also use the files
+without installing just providing the paths to the compiler.
+
+
+4. MSVC TARGET CONTRIBUTORS
+
+Chronologically sorted:
+
+Drivers: [Shared with other Win32 targets]
+
+WinNT: Anatoli Soltan
+Win32: Vadim Beloborodov
+WinGr: José Ángel Sánchez Caso
+
+Compilation:
+
+WintiX <wintix/bk/ru>
+ Help to get it working with MSVC 5.0.
+Sergey Krivulja <skrivulja/erec/ru>
+ Compilation issue.
+Mike Gorchak <mike/malva/ua>
+ Adaptation to MSVC 7.0 and 7.1.
+Grzegorz Adam Hankiewicz <gradha/iname/com>
+ Debug options and help with unified mechanism.
+David Doubrava (ddoubrava/volny/cz)
+ Compilation issue.
+Arnold Wiegert <awiegert/telus/net>
+ Help with the free version of MSVC (7.1).
+ Adaptation to MSVC 6.0.
+ Hints about MSVC 4.0.
+Christian Kirches <christian/kirches/gmx/de>.
+ Compilation issues related to Visual Studio .NET 2005 Express Beta.
+Eddie (K.Blacha) <one_eddie/tenbit/pl>
+ Compilation issues related to MSVC 7.1.
+Harry Sack <tranzedude/gmail/com>
+ Compilation using Visual Studio 2008 without nmake.
+
+
+5. USING VISUAL STUDIO AND NOT NMAKE
+
+1) create a new project: 'Visual C++' -> 'General' -> 'Empty Project'
+
+2) add to 'Source Files' folder in your VS Project:
+
+\tvision => *.cc
+\tvision\classes => *.cc and *.cc of all its subdirs
+\tvision\compat => *.cc and *.c
+\tvision\names => *.cc
+\tvision\stream => *.cc
+
+3) go to 'Project' -> 'Properties'. Choose 'All Configurations'. Go to
+'C/C++' -> 'General' -> 'Additional Include Directories'. Add the following
+directories there:
+
+\tvision\include and all its subdirs
+\tvision\winnt\include\msvc
+
+4) copy the file \tvision\winnt\include\tv\configtv.h to \tvision\include\tv
+
+5) now you can build the library in Debug and Release mode
+
+6) now just add your source file with your main() function to your VS project
+and compile it.
+
diff --git a/tvision/doc/install/tools.txt b/tvision/doc/install/tools.txt
new file mode 100644
index 0000000..7e4d763
--- /dev/null
+++ b/tvision/doc/install/tools.txt
@@ -0,0 +1,137 @@
+ This file gives a list of tools and libraries you used by the package. The
+list isn't complete so please report any missing stuff.
+ The list is oriented to systems using the GNU tools, not for Borland and
+Miscrosoft environments.
+ IMPORTANT! most Linux systems have the needed libraries installed but
+rarely have the headers installed. They are provided in separated packages
+intended for development (XXXX-dev).
+
+TOOLS
+=====
+
+Binutils:
+---------
+
+ They include the linker and assembler. They must be the GNU versions.
+
+Compiler:
+---------
+
+ The code was compiled with GCC 2.7.x, 2.8.x, 2.95.x, egcs 1.x, 3.x and may
+be other versions. As I can't have systems with all of them I can't be sure
+all of them can be currently used.
+ I suggest gcc 2.8.1 or newer because 2.7.2 had some bugs in the C++ library
+and its workaround could go away soon.
+ I don't recommend gcc 2.9.6 nor egcs 1.x because these compilers have too
+much bugs. Workarounds for these problems were created but as I don't have
+these compilers new code could break. I recommend using a more stable
+compiler.
+ The gcc 2.95.x compilers gave me very good results.
+ The code cleanly compiled with gcc 3.0, 3.1.x, 3.2.x and 3.3 but each
+release of gcc 3.x likes to break something in the C++ stuff so be patient
+and report any problems. One particular detail is that gcc 3.x is much more
+slower than gcc 2.95.x when compiling C++ code. This is because the standard
+C++ library now follows the ISO 1998 standard much more closely and hence
+does a heavy use of templates, it looks like gcc 3.x performance to compile
+such a code is really bad.
+ At the moment of this writing (june 2003) my recommendation is gcc 2.95.4.
+
+bzip2:
+------
+
+ Optionally (configuration option) used to create the tarball distributions.
+
+fileutils:
+----------
+
+ They are rm, cp, mv, etc. and all UNIX systems have them. DJGPP users must
+install them.
+
+gettext:
+--------
+
+ Needed for internationalization. They aren't mandatory. Note: this is one
+of those packages that likes to break its API.
+ Note: Solaris provides its own implementation but it isn't supported.
+
+gzip:
+-----
+
+ Used only to create the tarball distributions.
+
+make:
+-----
+
+ Obviously mandatory. You must install GNU make, other make tools aren't
+enough. The executable can be called gmake to avoid collisions with the
+native make tool.
+
+Perl:
+-----
+
+ The configuration script and others are Perl scripts, you'll need Perl
+5.x. I strongly recommend using it even when the tarball and zip files
+usually contains preconfigured sources that will compile out-of-the-box in
+many systems.
+
+RHIDE:
+------
+
+ RHIDE users can configure the package and the compile it using the RHIDE
+projects. But you'll need a really new RHIDE, some times even from CVS. So I
+no longer recommend using RHIDE unless you are going to debug or modify the
+code.
+ At the moment of this writing (june 2003) I use RHIDE 1.5 from CVS.
+
+shellutils:
+-----------
+
+ They are pwd, uname, etc. and all UNIX systems have them. DJGPP users must
+install them.
+
+tar:
+----
+
+ Used only to create the tarball distributions.
+ Note: not all tar implementations are usable, get GNU tar if you have
+problems with it.
+
+textutils:
+----------
+
+ They are cat, split, etc. and all UNIX systems have them. DJGPP users must
+install them.
+
+
+LIBRARIES
+=========
+
+gpm:
+----
+
+ It provides mouse functionality for the Linux console. I tested versions
+1.13, 1.14, 1.17.x and 1.19.x.
+ Note: binaries compiled with a version usually fails to work if you change
+the gpm daemon version.
+
+ncurses:
+--------
+
+ This is mandatory for UNIX systems where the X11 isn't available. But is
+recommended for all UNIX systems because it is used when the terminal isn't
+known. Versions 3.4 and newer were used. I remmember also testing with 4.2,
+5.0, 5.2 and 5.3.
+ Note: none of the listed versions compiles ok using gcc 3.3 and -Wall
+because the headers contains chars as array indexes.
+
+X libraries:
+------------
+
+ They are needed to create a UNIX application that can connect to an X
+server and provide a good text emulation. It works even better than the
+ncurses driver. That's a must for UNIX systems with X11 installed.
+ CygWin also provides X11 under Win32 systems. This is just a curiosity.
+When I tested it the performance was really poor but the test application
+was functional.
+
+
diff --git a/tvision/doc/install/unix.txt b/tvision/doc/install/unix.txt
new file mode 100644
index 0000000..5b30b00
--- /dev/null
+++ b/tvision/doc/install/unix.txt
@@ -0,0 +1,113 @@
+ This file describes how to compile the package for UNIX systems using
+GNU tools. I personaly use "Debian GNU/Linux" but the code successfuly
+compiled for Darwin, FreeBSD, NetBSD, OpenBSD, QNX, Solaris and Tru64.
+Instructions specific for Linux systems can be found in the
+doc/install/linux.txt but this instructions are also valid for Linux and
+in fact the Linux file refers to this one for the "manual" installation
+mechanism.
+
+$Id: unix.txt,v 1.3 2004/10/08 15:05:36 set Exp $
+
+1. INTRODUCTION
+2. IMPORTANT NOTE
+3. CONFIGURING
+4. COMPILING
+5. INSTALLING
+
+
+1. INTRODUCTION
+
+ FreeBSD systems seems to have all the needed GNU tools (GNU/FreeBSD ;-).
+FreeBSD details were contributed by Andrew 'Onyx' Shevtsov (miniEleph)
+<nyxo@dnuc.polyn.kiae.su>.
+ NetBSD and OpenBSD machines that I tested at Source Forge Compile Farm
+also have GNU tools available.
+ Darwin is the core of MacOS X 10.x, it have some bizarre GNU tools modified
+by Apple. So even when Darwin is an *BSD system it is a little bit
+complicated. The code included in the 2.0.3 release compiled ok.
+ QNX systems are a little bit more problematic but they also contain the
+needed tools. QNX details were contributed by Mike Gorchak <mike@malva.ua>.
+ Solaris doesn't have all the needed GNU tools so you must get them from
+internet. You should get at least make, gcc/g++ and perl, I'm not sure what
+else is needed. I have a Solaris 2.7 (Ultra 60 machine) at work with the
+needed tools installed. I also succeed using Solaris 9 at Source Forge.
+ A user reported success using HP-UX, but I couldn't verify it (HP Test
+Drive problems).
+ I also succeed to compile using Tru64 (OSF1) v5.1b. But the installed GNU
+tools (from a package identified as TWWfsw) have some major limitations.
+ If you are dealing with other UNIX box the first step will be to get the
+most common GNU tools used for development and then start trying. Contact me
+if you need help or want to contribute changes needed to compile for your
+UNIX box.
+ For a list of tools and libraries you should have in your system please read
+the doc/install/tools.txt file.
+
+2. IMPORTANT NOTE
+
+ I noticed that a lot of UNIX machines that have GNU tools installed are
+wrongly configured. Here are some details you must check:
+
+A) The PATH must include the directory where GNU tools are installed. Some
+times the tools aren't installed in the same directory. So you have to
+double check that all the tools can be started without specifying its full
+path. Example (bash):
+$ export PATH=$PATH:/usr/local/bin
+
+B) All the support libraries must be in the linker path. This can be
+configured at system level or just using the LD_LIBRARY_PATH environment
+variable. I saw too much systems where you can't even create a simple C++
+program because the libraries aren't in the linker path. Example (bash):
+$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/opt/TWWfsw/gcc33r/lib
+
+3. CONFIGURING
+
+ The first step is the configuration, this is a Perl script so you must have
+Perl in your system:
+
+$ ./configure
+
+ This script will inform you what was found in your system and what wasn't.
+If the missing component is vital the script will stop. Read the output of
+the script carefuly. Unlike the traditional configure scripts created by GNU
+autoconf this script doesn't print useless information (like if your system
+have 20 of the string functions needed), so the output is not too big.
+ If your system and/or CPU can't be detected please take a look at the
+conflib.pl file. The DetectOS function determines the OS using the output of
+uname command. The DetectCPU function determines the CPU by actually
+compiling a small program with conditionals for all the architectures I
+currently tested. If you need to add something there just contact me.
+ If the script fails install the missing component and run it again. If
+optional components are missing the script will suggest installing them.
+ Once you successfuly configured the package you can go to the next step.
+ If you want to change any of the default compilation options run:
+
+$ ./configure --help
+
+ It will inform all the available options. The --prefix=... is something you
+could want to use.
+ If you want to make changes to the code and contribute to the project I
+recommend configuring the package using the same options I use:
+
+$ ./configset
+
+ This enables some maintainance stuff that you'll need for development. The
+most important detail are header dependencies.
+
+4. COMPILING
+
+ Just use the make command. If your system must use gmake the configuration
+will inform it.
+
+5. INSTALLING
+
+ Use the install target, you'll most probably need to switch to "root" to
+run this step:
+
+# make install
+
+ You can change the destination prefix using:
+
+# make prefix=/path_you_want install
+
+ But I recommend doing it during the configuration step.
+
diff --git a/tvision/doc/install/watcom.txt b/tvision/doc/install/watcom.txt
new file mode 100644
index 0000000..43c8b59
--- /dev/null
+++ b/tvision/doc/install/watcom.txt
@@ -0,0 +1,54 @@
+ This file describes how to compile the package for Win32 systems using
+Open Watcom compiler. (http://www.openwatcom.org).
+
+$Id: watcom.txt,v 1.3 2005/09/20 14:48:37 set Exp $
+
+1. INTRODUCTION
+2. HOW TO COMPILE
+3. INSTALLING
+4. OPEN WATCOM TARGET CONTRIBUTORS
+
+
+
+1. INTRODUCTION
+
+ This target is supported because users helped to make it possible. If you
+find any problem just do the same the other users did: help to fix them.
+ You can also create Win32 versions of this package using BorlandC Builder,
+Cygwin, MSVC or MinGW.
+ Version 1.3 compiled the code for 2005/09/20 CVS snapshot.
+
+
+2. HOW TO COMPILE
+
+ You can use the unified make system:
+
+wmake -f Makefile.wat
+
+ This will generate makes/librhtv.dll
+
+
+3. INSTALLATION
+
+ Currently this target needs manual installation. You can also use the files
+without installing just providing the paths to the compiler.
+
+
+4. OPEN WATCOM TARGET CONTRIBUTORS
+
+Chronologically sorted:
+
+Drivers: [Shared with other Win32 targets]
+
+WinNT: Anatoli Soltan
+Win32: Vadim Beloborodov
+WinGr: José Ángel Sánchez Caso
+
+Compilation:
+
+Lothar Behrens <lothar/behrens/lollisoft/de>
+ Help to get it working.
+ DLL stuff.
+ Compilation rules.
+
+
diff --git a/tvision/doc/libdocs.epr b/tvision/doc/libdocs.epr
new file mode 100644
index 0000000..509340a
--- /dev/null
+++ b/tvision/doc/libdocs.epr
Binary files differ
diff --git a/tvision/doc/troubleshooting/Linux/1/code.cc b/tvision/doc/troubleshooting/Linux/1/code.cc
new file mode 100755
index 0000000..83468d8
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/1/code.cc
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+#define ENTER_UTF8 "\e%G"
+#define EXIT_UTF8 "\e%@"
+
+int main(int argc, char *argv[])
+{
+ fputs(EXIT_UTF8,stdout);
+ return 0;
+}
diff --git a/tvision/doc/troubleshooting/Linux/1/readme.txt b/tvision/doc/troubleshooting/Linux/1/readme.txt
new file mode 100755
index 0000000..ae01097
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/1/readme.txt
@@ -0,0 +1,42 @@
+Introduction:
+-------------
+
+My Debian GNU/Linux Woody starts in code page mode, as Red Hat < 8.0 also
+does. But some people told me Red Hat 8.0 starts in UTF-8 mode.
+I tried setting the UTF-8 mode and starting SETEdit the result wasn't
+really bad:
+* When using /dev/vcs*: All worked perfectly and at exit the console was
+in UTF-8.
+* When using only escape sequences: Some drawings failed at the beggining
+but it got normal quite soon. At exit the console was in code page mode.
+
+This test will determine:
+-------------------------
+
+I) Is the console in UTF-8 mode?
+II) If that's the case: Can we exit from UTF-8 mode?
+
+Steps:
+------
+
+1) Compile code.cc and utf8.cc:
+g++ -o code code.cc
+g++ -o utf8 utf8.cc
+
+2) Run "cat test.txt"
+a) If you can see the accented vowels then this console is in normal mode.
+b) If nothing is displayed then the console is in UTF-8 mode.
+
+3) Run "cat test-utf8.txt"
+This will confirm step 2:
+a) Normal console: Displays a mix between A with ~ and other chars.
+b) UTF-8 console: Displayes the accented vowels.
+
+4) If the console is in UTF-8 mode try:
+a) Run ./code
+b) Do the steps 2 and 3. It should work as points 2a and 3a
+c) Run ./utf8
+d) Do the steps 2 and 3. It should work as the for the firt try.
+
+Comment me about the results for each step.
+
diff --git a/tvision/doc/troubleshooting/Linux/1/test-utf8.txt b/tvision/doc/troubleshooting/Linux/1/test-utf8.txt
new file mode 100755
index 0000000..8967aba
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/1/test-utf8.txt
@@ -0,0 +1,3 @@
+ÃÉÃÓÚ
+áéíóú
+
diff --git a/tvision/doc/troubleshooting/Linux/1/test.txt b/tvision/doc/troubleshooting/Linux/1/test.txt
new file mode 100755
index 0000000..a30391b
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/1/test.txt
@@ -0,0 +1,3 @@
+ÁÉÍÓÚ
+áéíóú
+
diff --git a/tvision/doc/troubleshooting/Linux/1/utf8.cc b/tvision/doc/troubleshooting/Linux/1/utf8.cc
new file mode 100755
index 0000000..fd1319c
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/1/utf8.cc
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+#define ENTER_UTF8 "\e%G"
+#define EXIT_UTF8 "\e%@"
+
+int main(int argc, char *argv[])
+{
+ fputs(ENTER_UTF8,stdout);
+
+ return 0;
+}
diff --git a/tvision/doc/troubleshooting/Linux/2/readme.txt b/tvision/doc/troubleshooting/Linux/2/readme.txt
new file mode 100755
index 0000000..9b21ebc
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/2/readme.txt
@@ -0,0 +1,38 @@
+Introduction:
+-------------
+
+TV can inform a lot of things when compiled in debug mode.
+
+This test will determine:
+-------------------------
+
+Which mode of drawing is in use.
+
+Steps:
+------
+
+1) Uncomment the following line:
+
+//#define DEBUG
+
+located at the include/tv/linux/log.h header.
+
+2) Uncomment the following line:
+
+//#define DEBUG_CODEPAGE
+
+is line 298 aprox. located at classes/linux/linuxscr.cc
+
+3) Recompile TV and make sure the editor is using this version of the library.
+
+4) Start the editor using:
+
+e -r 2> log.txt
+
+5) Just exit.
+
+The log.txt will contain very important information about what was detected,
+send it to me.
+If the user doesn't have access to the /dev/vcs* devices generate another log
+file for the root.
+
diff --git a/tvision/doc/troubleshooting/Linux/3/readme.txt b/tvision/doc/troubleshooting/Linux/3/readme.txt
new file mode 100755
index 0000000..aa8d6a2
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/3/readme.txt
@@ -0,0 +1,21 @@
+Introduction:
+-------------
+
+Linux can be configured to use a custom font with an arbitrary encoding. This
+font doesn't have to follow any standard and in fact most standars doesn't
+define how to display control characters ([0-31] + [127-159]).
+
+This test will determine:
+-------------------------
+
+The font and Unicode maps.
+
+Steps:
+------
+
+1) Run:
+
+consolechars -F font.psf -M map.acm -U map.sfm
+
+2) Send me the output files: font.psf, map.acm and map.sfm
+
diff --git a/tvision/doc/troubleshooting/Linux/4/readme.txt b/tvision/doc/troubleshooting/Linux/4/readme.txt
new file mode 100755
index 0000000..434e53e
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/4/readme.txt
@@ -0,0 +1,39 @@
+Introduction:
+-------------
+
+UNIX consoles are quite complex to handle in a way that's fast and reliable
+at the same time. Buffered output can do a real mess.
+
+This test will determine:
+-------------------------
+
+If Linux is executing all the escape sequences.
+
+Steps:
+------
+
+1) Compile two versions of the test program:
+
+g++ -o t1 test.cc
+g++ -o t2 -DSEPARATED_HANDLE=1 test.cc
+
+2) Run "./t1 1 2> log_4_1.txt"
+Describe the output, the exact name of the colors is not really important,
+but the sequence is. The colors should go from the 0 to 15 for foreground
+and 15 to 0 for background 13 times.
+Also pay attention to the separation between " Hello! " messages.
+
+3) Run "./t1 20 2> /dev/null"
+Check if the output is the same as (2), try with other numbers other than
+20.
+
+4) Run "./t2 1 2> log_4_2.txt"
+Is the same output?
+
+5) Run "./t2 20 2> /dev/null"
+Is the same?
+
+6) Just in case: reset the console using "reset" ;-)
+
+7) Send me the log files and the descriptions.
+
diff --git a/tvision/doc/troubleshooting/Linux/4/test.cc b/tvision/doc/troubleshooting/Linux/4/test.cc
new file mode 100755
index 0000000..89cf923
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/4/test.cc
@@ -0,0 +1,297 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador E. Tropea
+ This code is part of our Turbo Vision port and is covered by the GPL
+license.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <termios.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+
+#ifndef SEPARATED_HANDLE
+ #define SEPARATED_HANDLE 0
+#endif
+
+struct termios inTermiosOrig;
+struct termios inTermiosNew;
+struct termios outTermiosOrig;
+struct termios outTermiosNew;
+int oldInFlags;
+int newInFlags;
+FILE *fIn;
+FILE *fOut;
+int hIn;
+int hOut;
+const char *error;
+int tioclinuxOK;
+
+int InitIn()
+{
+ fputs("TGKeyLinux::InitOnce\n",stderr);
+ hIn=fileno(stdin);
+
+ if (!isatty(hIn))
+ {
+ error="that's an interactive application, don't redirect stdin";
+ return 1;
+ }
+ // We can't use stdin for all the operations, instead we must open it again
+ // using another file descriptor.
+ // Here is why: In order to get some keys, I saw it for ESC pressed alone,
+ // we must set the O_NONBLOCK attribute.
+ // We can do it, but the stdout file handle seems to be just a copy of the
+ // stdin file handle (dupped?). When you use duplicated file handles they
+ // share the "File Status Flags". It means that setting O_NONBLOCK will
+ // set O_NONBLOCK for output too. So what? well when we do that the one that
+ // doesn't block is Linux kernel, so if we send too much information to
+ // stdout, no matters if we use fflush, sometimes Linux could lose data.
+ // This effect seems to happend at exit, may be because owr process dies
+ // before Linux have a chance to process the remaining data and it closes
+ // the file handle. The fact is that using O_NONBLOCK sometimes we fail to
+ // restore the cursor position.
+ // Now a question remains: do I have to restore the mode?
+ char *ttyName=ttyname(hIn);
+ if (!ttyName)
+ {
+ error="failed to get the name of the current terminal used for input";
+ return 3;
+ }
+ fIn=fopen(ttyName,"r+b");
+ if (!fIn)
+ {
+ error="failed to open the input terminal";
+ return 4;
+ }
+ hIn=fileno(fIn);
+
+ if (tcgetattr(hIn,&inTermiosOrig))
+ {
+ error="can't get input terminal attributes";
+ return 2;
+ }
+
+ memcpy(&inTermiosNew,&inTermiosOrig,sizeof(inTermiosNew));
+ // Ignore breaks
+ inTermiosNew.c_iflag|= (IGNBRK | BRKINT);
+ // Disable Xon/off
+ inTermiosNew.c_iflag&= ~(IXOFF | IXON);
+ // Character oriented, no echo, no signals
+ inTermiosNew.c_lflag&= ~(ICANON | ECHO | ISIG);
+ if (tcsetattr(hIn,TCSAFLUSH,&inTermiosNew))
+ {
+ error="can't set input terminal attributes";
+ return 3;
+ }
+ // Don't block, needed to get some keys, even when the input is in character
+ // oriented mode. I saw it for ESC alone.
+ oldInFlags=fcntl(hIn,F_GETFL,0);
+ newInFlags=oldInFlags | O_NONBLOCK;
+ fcntl(hIn,F_SETFL,newInFlags);
+
+ return 0;
+}
+
+int InitOut()
+{
+ fputs("TScreenLinux::InitOnce\n",stderr);
+ hOut=fileno(stdout);
+ // SET: Original code tried to open a tty at any cost, eg: if stdout was
+ // redirected it tried to open stdin's tty for writing. I don't see the
+ // point of such an effort and in fact crashes the library, so here I just
+ // explain to the user how to run the application in the right way.
+ if (!isatty(hOut))
+ {
+ error="that's an interactive application, don't redirect stdout. "
+ "If you want to collect information redirect stderr like this: "
+ "program 2> file";
+ return 1;
+ }
+ if (SEPARATED_HANDLE)
+ {
+ fputs("Using separated handle\n",stderr);
+ /* Testing a reopen */
+ char *ttyName=ttyname(hOut);
+ if (!ttyName)
+ {
+ error="failed to get the name of the current terminal used for output";
+ return 3;
+ }
+ fOut=fopen(ttyName,"w+b");
+ if (!fOut)
+ {
+ error="failed to open the output terminal";
+ return 4;
+ }
+ int fgs=fcntl(hOut,F_GETFL,0);
+ fcntl(fileno(fOut),F_SETFL,fgs);
+
+ if (tcgetattr(hOut,&outTermiosOrig))
+ {
+ error="can't get output terminal information";
+ return 2;
+ }
+ hOut=fileno(fOut);
+ setvbuf(fOut,NULL,_IONBF,0);
+ }
+ else
+ {
+ fOut=stdout;
+
+ if (tcgetattr(hOut,&outTermiosOrig))
+ {
+ error="can't get output terminal information";
+ return 2;
+ }
+ }
+
+ // Save cursor position, attributes and charset
+ fputs("\E7",fOut);
+ memcpy(&outTermiosNew,&outTermiosOrig,sizeof(outTermiosNew));
+ outTermiosNew.c_oflag|=OPOST;
+ if (tcsetattr(hOut,TCSAFLUSH,&outTermiosNew))
+ {
+ error="can't configure terminal mode";
+ return 3;
+ }
+
+ // Test the TIOCLINUX
+ int arg=6;
+ tioclinuxOK=(ioctl(hOut,TIOCLINUX,&arg)!=-1);
+ if (tioclinuxOK)
+ fputs("Linux Console IOCTL working\n",stderr);
+
+ return 0;
+}
+
+
+int Init()
+{
+ // Identify the terminal, if that's linux or console go on.
+ char *terminal=getenv("TERM");
+ if (!terminal || !(!strcmp(terminal,"console") || !strncmp(terminal,"linux",5)))
+ {
+ fputs("Not a Linux console\n",stderr);
+ return 1;
+ }
+
+ // Initialize terminal
+ if (InitOut())
+ {
+ fprintf(stderr,"Error! %s",error);
+ fprintf(stderr,"\r\n");
+ return 2;
+ }
+ // Initialize keyboard
+ if (InitIn())
+ {
+ tcsetattr(hOut,TCSAFLUSH,&outTermiosOrig);
+ fprintf(stderr,"Error! %s",error);
+ fprintf(stderr,"\r\n");
+ return 3;
+ }
+ return 0;
+}
+
+void DeInitIn()
+{
+ tcsetattr(hIn,TCSAFLUSH,&inTermiosOrig);
+}
+
+void DeInitOut()
+{
+ // Is that a Linux bug? Sometime \E8 works, others not.
+ fputs("\E8",fOut);
+ // Ensure the last command is executed
+ fflush(fOut);
+ // Restore console mode
+ tcsetattr(hOut,TCSAFLUSH,&outTermiosOrig);
+}
+
+void DeInit()
+{
+ DeInitOut();
+ DeInitIn();
+}
+
+int oldCol=-1, oldFore=-1, oldBack=-1;
+
+void mapColor(int col)
+{
+ static char map[] = {0, 4, 2, 6, 1, 5, 3, 7};
+ int back,fore;
+
+ if (col==oldCol)
+ return;
+ oldCol=col;
+ back=(col >> 4) & 7;
+ fore=col & 15;
+
+ #define SB set_a_background ? set_a_background : set_background
+ #define SF set_a_foreground ? set_a_foreground : set_foreground
+
+ if (fore!=oldFore && back!=oldBack)
+ fprintf(fOut,"\E[%d;%d;%dm",fore>7 ? 1 : 22,30+map[fore & 7],40+map[back]);
+ else
+ {
+ if (fore!=oldFore)
+ fprintf(fOut,"\E[%d;%dm",fore>7 ? 1 : 22,30+map[fore & 7]);
+ else
+ fprintf(fOut,"\E[%dm",40+map[back]);
+ }
+
+ oldFore = fore;
+ oldBack = back;
+
+ #undef SB
+ #undef SF
+}
+
+void SetCursorPos(unsigned x, unsigned y)
+{
+ fprintf(fOut,"\E[%d;%dH",y+1,x+1);
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc!=2)
+ {
+ printf("Usage: %s number\n",argv[0]);
+ return 2;
+ }
+ int repeat=atoi(argv[1]);
+ if (!repeat || repeat>100)
+ {
+ printf("The number must be between 1 and 100\n");
+ return 3;
+ }
+ if (Init())
+ return 1;
+ // Exit UTF-8 mode
+ fputs("\e%@",fOut);
+ // G1 in kernel mode and selected
+ fputs("\e)K\xE",fOut);
+ unsigned i,j,k;
+ for (k=0; k<repeat; k++)
+ {
+ SetCursorPos(0,0);
+ for (j=0; j<13; j++)
+ {
+ for (i=0; i<16; i++)
+ {
+ mapColor(i+(15-i)*16);
+ fprintf(fOut,"%c Hello! ",133);
+ }
+ }
+ }
+ // G1 in normal mode and unselected
+ fputs("\e)0\xF",fOut);
+ DeInit();
+ return 0;
+}
+
diff --git a/tvision/doc/troubleshooting/Linux/readme.txt b/tvision/doc/troubleshooting/Linux/readme.txt
new file mode 100755
index 0000000..7cd7044
--- /dev/null
+++ b/tvision/doc/troubleshooting/Linux/readme.txt
@@ -0,0 +1,8 @@
+Introduction:
+-------------
+
+The subdirectories contains four tests to determine various aspects of your
+Linux console.
+Please follow the instructions of each test.
+
+SET
diff --git a/tvision/doc/troubleshooting/readme.txt b/tvision/doc/troubleshooting/readme.txt
new file mode 100755
index 0000000..cb5d62b
--- /dev/null
+++ b/tvision/doc/troubleshooting/readme.txt
@@ -0,0 +1,6 @@
+This directory contains test programs you can use to help the developer find
+the origin of problems.
+It was created in may 2003 to have a repository for tests oriented to find
+problems found in Linux console for Red Hat 8.0.
+
+SET
diff --git a/tvision/drivers2.cc b/tvision/drivers2.cc
new file mode 100644
index 0000000..eb0a40e
--- /dev/null
+++ b/tvision/drivers2.cc
@@ -0,0 +1,86 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_TKeys
+#include <tv.h>
+
+/*------------------------------------------------------------------------*/
+/* */
+/* ctrlToArrow */
+/* */
+/* argument: */
+/* */
+/* keyCode - scan code to be mapped to keypad arrow code */
+/* */
+/* returns: */
+/* */
+/* scan code for arrow key corresponding to Wordstar key, */
+/* or original key code if no correspondence exists */
+/* */
+/*------------------------------------------------------------------------*/
+ushort ctrlToArrow(ushort keyCode)
+{
+
+static const ushort ctrlCodes[] =
+ {
+ kbCtrlS, kbCtrlD, kbCtrlE, kbCtrlX, kbCtrlA,
+ kbCtrlF, kbCtrlG, kbCtrlV, kbCtrlR, kbCtrlC, kbCtrlH
+ };
+
+static const ushort arrowCodes[] =
+ {
+ kbLeft, kbRight, kbUp, kbDown, kbHome,
+ kbEnd, kbDel, kbIns,kbPgUp, kbPgDn, kbBack
+ };
+
+ /* The keycode contains now also the shift flags, which the
+ caller don't want to see */
+ ushort _keyCode = keyCode & 0x7F;
+
+ for( unsigned i = 0; i<(sizeof(ctrlCodes)/sizeof(ushort)) ; i++ )
+ if( _keyCode==ctrlCodes[i] )
+ return arrowCodes[i];
+ /* If it was not found, return the original code */
+ return keyCode;
+}
+
+/*------------------------------------------------------------------------*/
+/* */
+/* cstrlen */
+/* */
+/* argument: */
+/* */
+/* s - pointer to 0-terminated string */
+/* */
+/* returns */
+/* */
+/* length of string, ignoring '~' characters. */
+/* */
+/* Comments: */
+/* */
+/* Used in determining the displayed length of command strings, */
+/* which use '~' to toggle between display attributes */
+/* */
+/*------------------------------------------------------------------------*/
+
+int cstrlen( const char *s )
+{
+ int len = 0;
+ while( *s != EOS )
+ {
+ if( *s++ != '~' )
+ len++;
+ }
+ return len;
+}
+
diff --git a/tvision/dual.cc b/tvision/dual.cc
new file mode 100644
index 0000000..5180a81
--- /dev/null
+++ b/tvision/dual.cc
@@ -0,0 +1,52 @@
+/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#define Uses_TScreen
+#define Uses_TEventQueue
+
+#include <tv.h>
+
+#ifdef TVCompf_djgpp
+#include <dpmi.h>
+#include <sys/farptr.h>
+#endif
+
+int dual_display_supported()
+{
+#ifdef TVCompf_djgpp
+ __dpmi_regs r;
+ r.x.ax = 0x1a00;
+ __dpmi_int(0x10,&r);
+ if (r.h.al != 0x1a) return 0;
+ if (r.h.bh == 0x01) return 1;
+#endif
+/*
+#ifdef TVOSf_Linux
+ extern unsigned short *mono_mem;
+ return (mono_mem != NULL);
+#endif
+*/
+ return 0;
+}
+
+void SetDualDisplay()
+{
+ if (TDisplay::dual_display) return;
+ if (!dual_display_supported()) return;
+ TEventQueue::suspend();
+ TScreen::suspend();
+ TDisplay::dual_display = 1;
+ TScreen::resume();
+ TEventQueue::resume();
+}
+
+
+void SetNormalDisplay()
+{
+ if (!TDisplay::dual_display) return;
+ TEventQueue::suspend();
+ TScreen::suspend();
+ TDisplay::dual_display = 0;
+ TScreen::resume();
+ TEventQueue::resume();
+}
+
diff --git a/tvision/examples/Makefile b/tvision/examples/Makefile
new file mode 100644
index 0000000..dfe095a
--- /dev/null
+++ b/tvision/examples/Makefile
@@ -0,0 +1,118 @@
+# Copyright (C) 2001-2007 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This file is mostly used to clean the examples directories, but can be
+# used to compile all of them or just one from this directory.
+#
+.PHONY: clean
+
+examples=demo/demo desklogo/desklogo desklogo/set-logo \
+ desklogo/tv_logo dlgdsn/libtest dyntxt/dyntext \
+ inplis/implis listvi/lst_view msgcls/msgcls \
+ progba/test sdlg/test sdlg2/test tcombo/test \
+ terminal/test tprogb/test tutorial/tvguid01 \
+ tutorial/tvguid02 tutorial/tvguid03 tutorial/tvguid04 \
+ tutorial/tvguid05 tutorial/tvguid06 tutorial/tvguid07 \
+ tutorial/tvguid08 tutorial/tvguid09 tutorial/tvguid10 \
+ tutorial/tvguid11 tutorial/tvguid12 tutorial/tvguid13 \
+ tutorial/tvguid14 tutorial/tvguid15 tutorial/tvguid16 \
+ tvedit/tvedit tvhc/tvhc clipboard/test fonts/test \
+ helpdemo/helpdemo fonts/genraw videomode/test \
+ cyrillic/linuxkoi8/test cyrillic/x11koi8/test \
+ bhelp/thelp i18n/test viewers/test
+
+all: $(addsuffix .exe,$(examples))
+
+bhelp/thelp.exe: bhelp/thelp.gpr
+
+clipboard/test.exe: clipboard/test.gpr
+
+cyrillic/linuxkoi8/test.exe: cyrillic/linuxkoi8/test.gpr
+
+cyrillic/x11koi8/test.exe: cyrillic/x11koi8/test.gpr
+
+demo/demo.exe: demo/demo.gpr
+
+desklogo/desklogo.exe: desklogo/desklogo.gpr
+
+desklogo/set-logo.exe: desklogo/set-logo.gpr
+
+desklogo/tv_logo.exe: desklogo/tv_logo.gpr
+
+dlgdsn/libtest.exe: dlgdsn/libtest.gpr
+
+dyntxt/dyntext.exe: dyntxt/dyntext.gpr
+
+fonts/test.exe: fonts/test.gpr
+
+fonts/genraw.exe: fonts/genraw.gpr
+
+helpdemo/helpdemo.exe: helpdemo/helpdemo.gpr
+
+i18n/test.exe: i18n/test.gpr
+
+inplis/implis.exe: inplis/implis.gpr
+
+listvi/lst_view.exe: listvi/lst_view.gpr
+
+msgcls/msgcls.exe: msgcls/msgcls.gpr
+
+progba/test.exe: progba/test.gpr
+
+sdlg/test.exe: sdlg/test.gpr
+
+sdlg2/test.exe: sdlg2/test.gpr
+
+tcombo/test.exe: tcombo/test.gpr
+
+terminal/test.exe: terminal/test.gpr
+
+tprogb/test.exe: tprogb/test.gpr
+
+tutorial/tvguid01.exe: tutorial/tvguid01.gpr
+
+tutorial/tvguid02.exe: tutorial/tvguid02.gpr
+
+tutorial/tvguid03.exe: tutorial/tvguid03.gpr
+
+tutorial/tvguid04.exe: tutorial/tvguid04.gpr
+
+tutorial/tvguid05.exe: tutorial/tvguid05.gpr
+
+tutorial/tvguid06.exe: tutorial/tvguid06.gpr
+
+tutorial/tvguid07.exe: tutorial/tvguid07.gpr
+
+tutorial/tvguid08.exe: tutorial/tvguid08.gpr
+
+tutorial/tvguid09.exe: tutorial/tvguid09.gpr
+
+tutorial/tvguid10.exe: tutorial/tvguid10.gpr
+
+tutorial/tvguid11.exe: tutorial/tvguid11.gpr
+
+tutorial/tvguid12.exe: tutorial/tvguid12.gpr
+
+tutorial/tvguid13.exe: tutorial/tvguid13.gpr
+
+tutorial/tvguid14.exe: tutorial/tvguid14.gpr
+
+tutorial/tvguid15.exe: tutorial/tvguid15.gpr
+
+tutorial/tvguid16.exe: tutorial/tvguid16.gpr
+
+tvedit/tvedit.exe: tvedit/tvedit.gpr
+
+tvhc/tvhc.exe: tvhc/tvhc.gpr
+
+videomode/test.exe: videomode/test.gpr
+
+viewers/test.exe: viewers/test.gpr
+
+%.exe: %.gpr
+ $(MAKE) -C $(dir $<) -f $(addsuffix .mkf,$(basename $(notdir $<)))
+
+clean:
+ @echo 'Cleaning examples.'
+ -@rm -f */*.o */*/*.o */*.exe */*/*.exe */*.gdt */*/*.gdt */*.bkp \
+ */*/*.bkp *.bkp */*.dst */*/*.dst
diff --git a/tvision/examples/bhelp/.tvrc b/tvision/examples/bhelp/.tvrc
new file mode 100644
index 0000000..65c7b04
--- /dev/null
+++ b/tvision/examples/bhelp/.tvrc
@@ -0,0 +1,6 @@
+[TV]
+{
+ # This is needed because Borland files are encoded in ANSI CP 437
+ AppCP=437
+ Font10x20=1
+}
diff --git a/tvision/examples/bhelp/bhelp.cc b/tvision/examples/bhelp/bhelp.cc
new file mode 100644
index 0000000..7a5b231
--- /dev/null
+++ b/tvision/examples/bhelp/bhelp.cc
@@ -0,0 +1,325 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Jan Van Buggenhout <Chipzz@ULYSSIS.Org>
+
+ Based on code:
+ Copyright (c) 1994 by Borland International
+ Modified by Sergio Sigala <ssigala@globalnet.it>
+ Modified by Salvador E. Tropea <set@ieee.org>, <set@users.sourceforge.net>
+ Copyright (c) 1999 by Andreas F. Gorup von Besanez <besanez@compuserve.de>
+
+ Covered by the GPL license.
+
+ Description:
+ This is a class derived from THelpFile to read Borland help files.
+
+***************************************************************************/
+
+#define Uses_ctype
+#define Uses_limits
+#define Uses_string
+#define Uses_stdlib
+#define Uses_sys_stat
+#define Uses_filelength
+#define Uses_TCollection
+#define Uses_TStreamableClass
+#define Uses_THelpFile
+#define Uses_fpstream
+#include <tv.h>
+#include "bhelp.h"
+
+char *read0String(fpstream & s)
+{
+ int l;
+ long p = s.tellg();
+
+ for (l = 1; s.readByte(); l++) ;
+ char *buffer = new char[l];
+
+ s.seekg(p);
+ s.readBytes(buffer, l);
+ return buffer;
+}
+
+// TBorlandHelpTopic
+
+const char *const TBorlandHelpTopic::name = "TBorlandHelpTopic";
+
+TBorlandHelpTopic::TBorlandHelpTopic(fpstream & s, char *comp)
+{
+ char type;
+ unsigned short datalength, refslength;
+
+ s >> type;
+ s >> datalength;
+ unsigned char *data = new unsigned char[datalength];
+ char *text = new char[datalength * 9];
+ char *curtext = text;
+
+ s.readBytes(data, datalength);
+
+ ushort noRefs;
+
+ s >> type;
+ s >> refslength;
+ s >> previous;
+ s >> next;
+ s >> noRefs;
+ setNumCrossRefs(0);
+ refslength -= 6;
+ ushort *refs = (ushort *)(new uchar[refslength]);
+ ushort *curref = refs;
+
+ s.readBytes(refs, refslength);
+
+ for (long k = 0; k < datalength * 2; k++)
+ {
+ unsigned char Nibble;
+
+ Nibble = (data[k / 2] >> ((k & 1) * 4)) & 0xf;
+ switch (Nibble)
+ {
+
+ case 0:
+ *curtext++ = 0;
+ break;
+
+ case 0xe: /* Rep */
+ {
+ ushort RepCount;
+
+ k++;
+ RepCount = ((data[k / 2] >> ((k & 1) * 4)) & 0xf) + 2;
+ k++;
+ Nibble = (data[k / 2] >> ((k & 1) * 4)) & 0xf;
+ if (Nibble < 0xe)
+ {
+ memset(curtext, comp[Nibble], RepCount);
+ curtext += RepCount;
+ }
+ else if (Nibble == 0xf)
+ {
+ k++;
+ Nibble = data[k / 2] >> ((k & 1) * 4);
+ k++;
+ memset(curtext,
+ Nibble | ((data[k / 2] >> ((k & 1) * 4)) << 4), RepCount);
+ curtext += RepCount;
+ }
+ break;
+ }
+
+ case 0xf: /* Raw */
+ k++;
+ Nibble = data[k / 2] >> ((k & 1) * 4);
+ k++;
+ *curtext++ = Nibble | ((data[k / 2] >> ((k & 1) * 4)) << 4);
+ break;
+
+ default:
+ *curtext++ = comp[Nibble];
+ break;
+ }
+ }
+
+ for (char *para = text; (para < curtext) && (*para != 1);
+ para += strlen(para) + 1)
+ {
+ for (char *ref = strchr(para, 2); ref; ref = strchr(ref, 2))
+ {
+ char *endref = strchr(ref + 1, 2) - 1;
+ int length = endref - ref;
+
+ TCrossRef cref;
+
+ cref.offset = ref - text + 1;
+ cref.length = length;
+ cref.ref = *curref++;
+ addCrossRef(cref);
+
+ memmove(ref, ref + 1, length);
+ memmove(endref, endref + 2, curtext - endref);
+
+ curtext -= 2;
+ }
+ TParagraph *paragraph = new TParagraph;
+
+ paragraph->text = strdup(para);
+ paragraph->size = strlen(para) + 1;
+ paragraph->wrap = False;
+ addParagraph(paragraph);
+ }
+ free(data);
+ free(text);
+ free(refs);
+}
+
+TStreamableClass RBorlandHelpTopic(TBorlandHelpTopic::name,
+ TBorlandHelpTopic::build,
+ __DELTA(TBorlandHelpTopic));
+
+// TBorlandHelpIndex
+
+const char *const TBorlandHelpIndex::name = "TBorlandHelpIndex";
+
+TBorlandHelpIndex::TBorlandHelpIndex(fpstream & s):THelpIndex()
+{
+ unsigned short length;
+ unsigned char *buffer;
+
+ s >> length;
+ buffer = new unsigned char[length];
+
+ s.readBytes(buffer, length);
+ size = *((unsigned short *) buffer);
+ index = new long[size];
+
+ buffer += 2;
+ for (int k = 0; k < size * 3; k += 3)
+ index[k/3] = ((buffer[k + 2] & 0x80) << 24) +
+ (buffer[k] + (buffer[k + 1] << 8) + ((buffer[k + 2] & 0x7f) << 16));
+}
+
+void *TBorlandHelpIndex::read(ipstream & is)
+{
+ // FIXME
+ return 0;
+}
+
+TStreamable *TBorlandHelpIndex::build()
+{
+ return new TBorlandHelpIndex(streamableInit);
+}
+
+TStreamableClass RBorlandHelpIndex(TBorlandHelpIndex::name,
+ TBorlandHelpIndex::build,
+ __DELTA(TBorlandHelpIndex));
+
+// TBorlandHelpFile
+
+TBorlandHelpFile::TBorlandHelpFile(fpstream & s):THelpFile(s)
+{
+ char *Stamp;
+ char FormatVersion;
+
+ modified=False;
+ stream->seekg(0);
+ Stamp = read0String(*stream);
+ stream->seekg(14, CLY_IOSCur);
+ *stream >> FormatVersion;
+ stream->seekg(1, CLY_IOSCur);
+
+ while (!stream->eof())
+ {
+ char type;
+ unsigned short length;
+ unsigned char *buffer=NULL;
+
+ *stream >> type;
+ if (type != 1)
+ {
+ *stream >> length;
+ buffer = (unsigned char *) malloc(length);
+ stream->readBytes(buffer, length);
+ }
+ switch (type)
+ {
+ case 0: /* FileHeader */
+ {
+ ushort *o = (ushort *) buffer;
+ options = o[0];
+ indexscreen = o[1];
+ height = buffer[6];
+ width = buffer[7];
+ margin = buffer[8];
+ break;
+ }
+
+ case 1: /* ConText */
+ index = new TBorlandHelpIndex(*stream);
+ break;
+
+ case 2: /* Text */
+ stream->seekg(-(length + 3), CLY_IOSCur);
+ return;
+
+ case 3: /* KeyWord */
+ stream->seekg(-(length + 3), CLY_IOSCur);
+ return;
+
+ case 4: /* Index */
+ {
+ char temp[41];
+ *temp = 0;
+ glossaryItems = *((ushort *) buffer);
+ glossary = new char *[glossaryItems];
+ char *g = (char *) buffer + 2;
+ for (int i = 0; i < glossaryItems; i++)
+ {
+ uchar lengthcode = *g++;
+ ushort carry = (lengthcode & 0xe0) >> 5;
+ ushort unique = lengthcode & 0x1f;
+ glossary[i] = new char[carry + unique + 3];
+ strncpy(temp + carry, g, unique);
+ temp[carry + unique] = 0;
+ g += unique;
+ strncpy(temp + carry + unique + 1, g, 2);
+ g += 2;
+ memcpy(glossary[i], temp, carry + unique + 3);
+ }
+ break;
+ }
+
+ case 5: /* Compression */
+ *compressiontable = 0;
+ memcpy(compressiontable + 1, buffer + 2, 13);
+ break;
+
+ case 6: /* IndexTags */
+ break;
+ }
+ if (type != 1)
+ free(buffer);
+ }
+}
+
+class TSearchResults : public TCollection
+{
+ public:
+ TSearchResults() : TCollection(0, 1) {};
+ virtual void *readItem( ipstream& ) { return 0; };
+ virtual void writeItem( void *, opstream& ) {};
+};
+
+TCollection *TBorlandHelpFile::search(char *s)
+{
+ char *ss = strdup(s);
+ if (!(options & 4)) strupr(ss);
+ int found = 0;
+ int length = strlen(s);
+ TCollection *coll = new TSearchResults();
+ for (int i = 0; i < glossaryItems; i++)
+ {
+ if (!strncmp(ss, glossary[i], length))
+ {
+ found = 1;
+ coll->insert(glossary[i]);
+ }
+ else if (found) break;
+ }
+ free(ss);
+ return coll;
+}
+
+THelpTopic *TBorlandHelpFile::getTopic(int i)
+{
+ long pos = index->position(i);
+
+ if (pos > 0)
+ {
+ stream->seekg(pos);
+ return new TBorlandHelpTopic(*stream, compressiontable);
+ }
+ else
+ return (invalidTopic());
+}
diff --git a/tvision/examples/bhelp/bhelp.h b/tvision/examples/bhelp/bhelp.h
new file mode 100644
index 0000000..179eb57
--- /dev/null
+++ b/tvision/examples/bhelp/bhelp.h
@@ -0,0 +1,80 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Jan Van Buggenhout <Chipzz@ULYSSIS.Org>
+
+ Based on code:
+ Copyright (c) 1994 by Borland International
+ Modified by Sergio Sigala <ssigala@globalnet.it>
+ Modified by Salvador E. Tropea <set@ieee.org>, <set@users.sourceforge.net>
+ Copyright (c) 1999 by Andreas F. Gorup von Besanez <besanez@compuserve.de>
+
+ Covered by the GPL license.
+
+ Description:
+ This is a class derived from THelpFile to read Borland help files.
+
+***************************************************************************/
+
+#if !defined(TBorlandHelpFile_Included)
+#define TBorlandHelpFile_Included
+
+class TBorlandHelpTopic: public THelpTopic
+{
+
+public:
+
+ TBorlandHelpTopic( fpstream & s, char * comp );
+ short int previous, next;
+
+protected:
+
+ virtual void *read( ipstream& ) { return 0; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build() { return 0; };
+
+};
+
+// TBorlandHelpIndex
+
+class TBorlandHelpIndex : public THelpIndex
+{
+public:
+
+ TBorlandHelpIndex( fpstream & );
+ TBorlandHelpIndex( StreamableInit ) {};
+
+protected:
+
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+// TBorlandHelpFile
+
+class TBorlandHelpFile : public THelpFile
+{
+
+public:
+
+ TBorlandHelpFile( fpstream & );
+ TCollection *search(char *sstr);
+
+ virtual THelpTopic *getTopic( int );
+ ushort options, indexscreen;
+ uchar height, width, margin;
+ ushort glossaryItems;
+ char ** glossary;
+ char compressiontable[13];
+
+};
+
+#endif // Uses_TBorlandHelpFile && !TBorlandHelpFile_Included
+
diff --git a/tvision/examples/bhelp/rhide.env b/tvision/examples/bhelp/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/bhelp/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/bhelp/thelp.bmk b/tvision/examples/bhelp/thelp.bmk
new file mode 100644
index 0000000..23348c3
--- /dev/null
+++ b/tvision/examples/bhelp/thelp.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: thelp.exe
+!include ../../makes/common.bmk
+!include thelp.umk
+
diff --git a/tvision/examples/bhelp/thelp.cc b/tvision/examples/bhelp/thelp.cc
new file mode 100644
index 0000000..87ae036
--- /dev/null
+++ b/tvision/examples/bhelp/thelp.cc
@@ -0,0 +1,221 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 1999 by Andreas F. Gorup von Besanez <besanez@compuserve.de>
+ Copyright (c) 2002 by Jan Van Buggenhout <Chipzz@ULYSSIS.Org>
+ Copyright (c) 2002-2003 by Salvador E. Tropea <set@ieee.org>
+
+ Covered by the GPL license.
+
+ Description:
+ This program reads the help files used by Turbo C++ and Borland C++
+compilers.
+
+***************************************************************************/
+
+#define Uses_stdlib
+#define Uses_stdio
+#define Uses_access
+#define Uses_string
+#define Uses_TKeys
+#define Uses_ifpstream
+#define Uses_IOS_BIN
+#define Uses_TCollection
+#define Uses_THelpWindow
+#define Uses_TApplication
+#define Uses_TDialog
+#define Uses_TButton
+#define Uses_TListBox
+#define Uses_TPalette
+#define Uses_TDeskTop
+#define Uses_getopt
+#define Uses_MsgBox
+#include <tv.h>
+#include "bhelp.h"
+
+class THelp:public TApplication
+{
+public:
+ THelp();
+ virtual TPalette& getPalette() const;
+ static TDeskTop *initDeskTop( TRect r );
+ virtual void getEvent(TEvent& event);
+ virtual void run();
+ static void ParseCommandLine(int argc, char *argv[]);
+
+ static const char *fileName;
+};
+
+const char *THelp::fileName="tchelp.tch";
+
+THelp::THelp():TProgInit(0, 0, &THelp::initDeskTop)
+{
+}
+
+#define cpAppColor \
+ "\x71\x70\x78\x74\x20\x28\x24\x17\x1F\x1A\x31\x31\x1E\x71\x1F" \
+ "\x37\x3F\x3A\x13\x13\x3E\x21\x3F\x70\x7F\x7A\x13\x13\x70\x7F\x7E" \
+ "\x70\x7F\x7A\x13\x13\x70\x70\x7F\x7E\x20\x2B\x2F\x78\x2E\x70\x30" \
+ "\x3F\x3E\x1F\x2F\x1A\x20\x72\x31\x31\x30\x2F\x3E\x31\x13\x38\x00" \
+ "\x17\x1F\x1A\x71\x71\x1E\x17\x1F\x1E\x20\x2B\x2F\x78\x2E\x10\x30" \
+ "\x3F\x3E\x70\x2F\x7A\x20\x12\x31\x31\x30\x2F\x3E\x31\x13\x38\x00" \
+ "\x37\x3F\x3A\x13\x13\x3E\x30\x3F\x3E\x20\x2B\x2F\x78\x2E\x30\x70" \
+ "\x7F\x7E\x1F\x2F\x1A\x20\x32\x31\x71\x70\x2F\x7E\x71\x13\x78\x00" \
+ "\x37\x3F\x3A\x13\x13\x30\x3E\x1E" // help colors
+
+TPalette& THelp::getPalette() const
+{
+ static TPalette helpcolor ( cpAppColor , sizeof( cpAppColor )-1 );
+ return helpcolor;
+}
+
+TDeskTop *THelp::initDeskTop( TRect r )
+{
+ return new TDeskTop( r );
+}
+
+void THelp::getEvent(TEvent &event)
+{
+ if (event.what == evKeyDown)
+ {
+ switch (event.keyDown.keyCode)
+ {
+ case kbF5:
+ event.what = evCommand;
+ event.message.infoPtr = 0;
+ event.message.command = cmZoom;
+ return;
+ case kbCtrlF5:
+ event.what = evCommand;
+ event.message.infoPtr = 0;
+ event.message.command = cmResize;
+ return;
+ }
+ }
+ TApplication::getEvent(event);
+}
+
+char *searchstring = NULL;
+int maxlength = 0;
+int which = 0;
+
+class TSearchDialog : public TDialog
+{
+ public:
+ TSearchDialog(TCollection *results) :
+ TWindowInit( &TSearchDialog::initFrame ),
+ TDialog (TRect (0, 0, maxlength + 4, results->getCount() + 6), "Select Result")
+ {
+ TRect r = getExtent();
+ r.grow(-2,-2);
+ r.b.y -= 2;
+ options |= ofCentered;
+ TListBox *resultList = new TListBox( r, 1, 0);
+ resultList->newList(results);
+ insert(resultList);
+ r.a.x--;
+ r.a.y = r.b.y + 1;
+ r.b.y += 3;
+ insert(new TButton(r, __("~V~iew"), cmOK, bfDefault));
+ setCurrent(resultList, normalSelect);
+ };
+};
+
+void setmaxlength(void *str, void *u)
+{
+ int l = strlen((char *) str);
+ if ( l > maxlength) maxlength = l;
+}
+
+ushort getContext(TCollection *results)
+{
+ char *result = (char *) results->at(which);
+ char *res = result + strlen(result) + 1;
+ return *((ushort *) res);
+}
+
+void THelp::run()
+{
+ if (access(fileName,R_OK)!=0)
+ {
+ messageBox(__("File not found"), mfOKButton | mfError);
+ endModal(cmQuit);
+ return;
+ }
+ fpstream *helpStrm = new fpstream(fileName, CLY_IOSIn);
+ TBorlandHelpFile *helpFile = new TBorlandHelpFile(*helpStrm);
+ ushort start = helpFile->indexscreen;
+ if (searchstring && *searchstring)
+ {
+ TCollection *results = helpFile->search(searchstring);
+ switch (results->getCount())
+ {
+ case 0:
+ break;
+ case 1:
+ start = getContext(results);
+ break;
+ default:
+ {
+ results->forEach(setmaxlength, 0);
+ TDialog *SD = new TSearchDialog(results);
+ if (execView(SD) == cmOK)
+ {
+ char* rec = (char *) malloc(SD->dataSize());
+ SD->getData(rec);
+ which = *((int *) (rec + 4));
+ start = getContext(results);
+ }
+ break;
+ }
+ }
+ }
+ THelpWindow *helpWindow = new THelpWindow(helpFile, start);
+ execView(validView(helpWindow));
+}
+
+static
+struct CLY_option longopts[] =
+{
+ { "file", 0, 0, 'f' },
+ { "help", 0, 0, 'h' },
+ { 0, 0, 0, 0 }
+};
+
+void THelp::ParseCommandLine(int argc, char *argv[])
+{
+ int optc;
+
+ while ((optc=CLY_getopt_long(argc,argv,"f:h",longopts,0))!=EOF)
+ {
+ switch (optc)
+ {
+ case 'f':
+ fileName=CLY_optarg;
+ break;
+ case 'h':
+ default:
+ printf("Borland's Help file viewer\n");
+ printf("Copyright (c) 1999 by Andreas F. Gorup von Besanez <besanez@compuserve.de>\n");
+ printf("Copyright (c) 2002 by Jan Van Buggenhout <Chipzz@ULYSSIS.Org>\n");
+ printf("Copyright (c) 2002-2003 by Salvador E. Tropea <set@ieee.org>\n");
+ printf("This program is covered by the GPL license.\n");
+ printf("\n\n");
+ printf("%s [--file Name] Text_to_search\n",argv[0]);
+ printf("--file Name : Name of the help file\n");
+ printf("--help : This text\n");
+ exit(1);
+ }
+ }
+}
+
+int main(int argc, char ** argv)
+{
+ THelp::ParseCommandLine(argc,argv);
+ THelp app;
+ if (argc == 2)
+ searchstring = argv[1];
+
+ app.run();
+ app.shutDown();
+ return 0;
+}
diff --git a/tvision/examples/bhelp/thelp.gpr b/tvision/examples/bhelp/thelp.gpr
new file mode 100644
index 0000000..9f26f22
--- /dev/null
+++ b/tvision/examples/bhelp/thelp.gpr
Binary files differ
diff --git a/tvision/examples/bhelp/thelp.mkf b/tvision/examples/bhelp/thelp.mkf
new file mode 100644
index 0000000..6febc10
--- /dev/null
+++ b/tvision/examples/bhelp/thelp.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include thelp$(ExIMK)
diff --git a/tvision/examples/bhelp/thelp.umk b/tvision/examples/bhelp/thelp.umk
new file mode 100644
index 0000000..5d5ac40
--- /dev/null
+++ b/tvision/examples/bhelp/thelp.umk
@@ -0,0 +1,22 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./bhelp$(ExOBJ) \
+ ./thelp$(ExOBJ)
+
+LIBRARIES=
+
+thelp$(ExEXE):: \
+ ./bhelp$(ExOBJ) \
+ ./thelp$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./bhelp$(ExOBJ):: bhelp.cc
+ $(RHIDE_COMPILE_CC)
+
+./thelp$(ExOBJ):: thelp.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/clipboard/rhide.env b/tvision/examples/clipboard/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/clipboard/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/clipboard/test.bmk b/tvision/examples/clipboard/test.bmk
new file mode 100644
index 0000000..7d27d57
--- /dev/null
+++ b/tvision/examples/clipboard/test.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: test.exe
+!include ../../makes/common.bmk
+!include test.umk
+
diff --git a/tvision/examples/clipboard/test.cc b/tvision/examples/clipboard/test.cc
new file mode 100644
index 0000000..39b9afd
--- /dev/null
+++ b/tvision/examples/clipboard/test.cc
@@ -0,0 +1,174 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea
+ This code is Public Domain and you can use it for any purpose. Note that
+when you link to another libraries, obviously needed, the code can (and
+currently will) be affected by the libraries license.
+ Currently my TV port is GPL so this code becomes GPL, but if you link
+with another Turbo Vision port or the library changes license things are
+different.
+
+ Description:
+ This examples shows how to use the OS independent clipboard class.
+
+***************************************************************************/
+
+#define Uses_stdio
+#define Uses_string
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TVOSClipboard
+#define Uses_MsgBox
+#define Uses_TKeys
+#define Uses_TScreen
+
+#include <tv.h>
+
+const int cmTestCopy=100;
+const int cmTestPaste=101;
+const int cmTestCopy2=102;
+const int cmTestPaste2=103;
+
+class TMyApp : public TApplication
+{
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine(TRect r);
+ static TMenuBar *initMenuBar(TRect r);
+ virtual void handleEvent(TEvent& event);
+ void testCopy(int clip);
+ void testPaste(int clip);
+};
+
+
+TMyApp::TMyApp() :
+ TProgInit(&TMyApp::initStatusLine,&TMyApp::initMenuBar,&TMyApp::initDeskTop)
+{
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event);
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmTestCopy:
+ testCopy(0);
+ break;
+
+ case cmTestPaste:
+ testPaste(0);
+ break;
+
+ case cmTestCopy2:
+ testCopy(1);
+ break;
+
+ case cmTestPaste2:
+ testPaste(1);
+ break;
+ }
+ clearEvent(event);
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar(TRect r)
+{
+ r.b.y=r.a.y+1;
+ return new TMenuBar(r,
+ *new TSubMenu("~D~emo",kbAltD) +
+ *new TMenuItem("Test ~c~opy",cmTestCopy,kbNoKey,hcNoContext,"" )+
+ *new TMenuItem("Test ~p~aste",cmTestPaste,kbNoKey,hcNoContext,"" )+
+ *new TMenuItem("Test ~c~opy secondary",cmTestCopy2,kbNoKey,hcNoContext,"" )+
+ *new TMenuItem("Test ~p~aste secondary",cmTestPaste2,kbNoKey,hcNoContext,"" )+
+ *new TMenuItem("E~x~it",cmQuit,kbNoKey,hcNoContext,"Alt-X")
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y=r.b.y-1;
+ return new TStatusLine(r,
+ *new TStatusDef(0,0xFFFF)+
+ *new TStatusItem(0,kbF10,cmMenu) +
+ *new TStatusItem("~Alt-X~ Exit",kbAltX,cmQuit)
+ );
+}
+
+const char *aMessage="Turbo Vision Clipboard demo message: Hi!";
+
+void TMyApp::testCopy(int clip)
+{
+ if (!TVOSClipboard::isAvailable())
+ {
+ messageBox("Sorry but none OS specific clipboard is available",mfError | mfOKButton);
+ return;
+ }
+ if (clip>=TVOSClipboard::isAvailable())
+ {
+ messageBox("Sorry but this OS doesn't have such a clipboard",mfError | mfOKButton);
+ return;
+ }
+ int res=TVOSClipboard::copy(clip,aMessage,strlen(aMessage));
+ if (!res)
+ {
+ messageBox(mfError | mfOKButton,"Error copying to clipboard: %s",
+ TVOSClipboard::getError());
+ return;
+ }
+ messageBox(mfInformation | mfOKButton,
+ "Clipboard name: %s, a message was copied successfuly",
+ TVOSClipboard::getName());
+}
+
+void TMyApp::testPaste(int clip)
+{
+ if (!TVOSClipboard::isAvailable())
+ {
+ messageBox("Sorry but none OS specific clipboard is available",mfError | mfOKButton);
+ return;
+ }
+ if (clip>=TVOSClipboard::isAvailable())
+ {
+ messageBox("Sorry but this OS doesn't have such a clipboard",mfError | mfOKButton);
+ return;
+ }
+ unsigned length;
+ char *result=TVOSClipboard::paste(clip,length);
+ if (!result)
+ {
+ messageBox(mfError | mfOKButton,"Error pasting from clipboard: %s",
+ TVOSClipboard::getError());
+ return;
+ }
+ if (length>80)
+ {
+ result[80]=0;
+ messageBox(mfInformation | mfOKButton,"First 80 characters from clipboard: %s",result);
+ }
+ else
+ messageBox(mfInformation | mfOKButton,"Content of the clipboard: %s",result);
+}
+
+int main(int argc, char *argv[], char **envir)
+{
+ TDisplay::setArgv(argc,argv,envir);
+ TMyApp myApp;
+ const char *title=TScreen::getWindowTitle();
+ TScreen::setWindowTitle("Turbo Vision Demo Program");
+ myApp.run();
+ if (title)
+ {
+ TScreen::setWindowTitle(title);
+ delete[] title;
+ }
+ return 0;
+}
diff --git a/tvision/examples/clipboard/test.gpr b/tvision/examples/clipboard/test.gpr
new file mode 100644
index 0000000..e0f3cd8
--- /dev/null
+++ b/tvision/examples/clipboard/test.gpr
Binary files differ
diff --git a/tvision/examples/clipboard/test.mkf b/tvision/examples/clipboard/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/clipboard/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/clipboard/test.umk b/tvision/examples/clipboard/test.umk
new file mode 100644
index 0000000..ce3bdf8
--- /dev/null
+++ b/tvision/examples/clipboard/test.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./test$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./test$(ExOBJ):: test.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/common.bmk b/tvision/examples/common.bmk
new file mode 100644
index 0000000..e93dfc3
--- /dev/null
+++ b/tvision/examples/common.bmk
@@ -0,0 +1,12 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+SRCDIRS=.
+INCLUDE_DIRS=-I../../winnt/include -I../../include
+RHIDE_LIBS=../../makes/librhtv.lib
+CONFIG_PATH=../../makes
+.cpp.obj:
+
+.cpp.exe:
diff --git a/tvision/examples/cyrillic/linuxkoi8/README b/tvision/examples/cyrillic/linuxkoi8/README
new file mode 100644
index 0000000..7d55d24
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/README
@@ -0,0 +1,43 @@
+This is a small test program for the KOI8-R support on Linux consoles.
+This test needs full access to the console to work properly. It means: run
+the program from the shell, don't use midnight commander nor screen, nor
+other application in the middle. Also ensure the user you use can write to
+/dev/vcsa* devices. I didn't test it using frame buffer. It won't work from
+an X console, nor in native X mode. Just pure console access, if in doubt try
+it as root.
+
+
+How to run the test?
+
+1) Compile it using "make -f test.mak" as with other examples.
+2) Load a KOI8-R font and a russian keyboard map. The setkoi8.sh script is
+what I use for it. If you use KOI8-R in your machine you probably won't need
+it at all.
+3) Run the test "./test.exe".
+4) Do the testings (screen and keyboard tests).
+5) Go back to your original encodings. I use setlat1.sh for this.
+
+What can be tested?
+
+ The first thing to test is the detection of the encoding. The background
+should look as a regular TV background and the file menu entry should show
+the russian equivalent for file. Note I know nothing about russian, a user
+provided the traslation so I trust this is the correct one ;-). According to
+the traslitaration table of my dictionary this is "fail", the pronunciation
+of the english word file.
+ The second thing to test is the keyboard. If you know how ru1 map works you
+can skeep the following explanation.
+ The ru1 key map uses the right alt key to switch between two modes:
+cyrillic and latin. The key is a toggle key. To test it just press the right
+alt, release it and then press the A key, you should get the cyrillic letter
+whose translitaration is F (looks like a greek phi). Pressing the right alt
+again you'll go back to the latin mode, needed to enter command line commands
+;-)
+ Now you should test the "File" menu. Press Alt+a and you'll get the menu.
+Then test the same but in the cyrillic mode.
+
+Note: The lat1-16.psf.gz font included here is a real latin 1 font, not the
+damaged one included in a lot of console-tools packages. Debian Potato and
+Woody have broken lat1-* fonts, they are in fact copies of lat1u-* fonts.
+
+SET
diff --git a/tvision/examples/cyrillic/linuxkoi8/koi8-r.acm.gz b/tvision/examples/cyrillic/linuxkoi8/koi8-r.acm.gz
new file mode 100644
index 0000000..96884df
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/koi8-r.acm.gz
Binary files differ
diff --git a/tvision/examples/cyrillic/linuxkoi8/koi8-r.psf.gz b/tvision/examples/cyrillic/linuxkoi8/koi8-r.psf.gz
new file mode 100644
index 0000000..be511d7
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/koi8-r.psf.gz
Binary files differ
diff --git a/tvision/examples/cyrillic/linuxkoi8/lat1-16.psf.gz b/tvision/examples/cyrillic/linuxkoi8/lat1-16.psf.gz
new file mode 100644
index 0000000..0308fcc
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/lat1-16.psf.gz
Binary files differ
diff --git a/tvision/examples/cyrillic/linuxkoi8/rhide.env b/tvision/examples/cyrillic/linuxkoi8/rhide.env
new file mode 100644
index 0000000..5c9ddae
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../../rhide.env
+
diff --git a/tvision/examples/cyrillic/linuxkoi8/ru1.kmap.gz b/tvision/examples/cyrillic/linuxkoi8/ru1.kmap.gz
new file mode 100644
index 0000000..bd0040a
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/ru1.kmap.gz
Binary files differ
diff --git a/tvision/examples/cyrillic/linuxkoi8/setkoi8.sh b/tvision/examples/cyrillic/linuxkoi8/setkoi8.sh
new file mode 100755
index 0000000..9b8683c
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/setkoi8.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# This script sets a russian configuration.
+# Is customized for my personal needs and is only an example.
+#
+# Load a KOI8-R font. It contains a fake SFM.
+#
+consolechars -f koi8-r.psf.gz
+#
+# Load a KOI8-R map. That's a fake ACM.
+#
+consolechars -m koi8-r.acm.gz
+#
+# Load a russian keyboard map.
+#
+loadkeys ru1.kmap.gz
diff --git a/tvision/examples/cyrillic/linuxkoi8/setlat1.sh b/tvision/examples/cyrillic/linuxkoi8/setlat1.sh
new file mode 100755
index 0000000..51f588a
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/setlat1.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# This script restores the configuration you use.
+# Is customized for my personal needs and is only an example.
+#
+#
+# I use ISO-8859-1 fonts:
+#
+consolechars -f lat1-16.psf.gz
+#
+# And I encode my documents in ISO-8859-1, so the map is trivial:
+#
+consolechars -m trivial.acm
+#
+# In Debian 3.0 Woody the boot time keymap is here:
+#
+loadkeys /etc/console/boottime.kmap.gz
diff --git a/tvision/examples/cyrillic/linuxkoi8/test.cc b/tvision/examples/cyrillic/linuxkoi8/test.cc
new file mode 100644
index 0000000..8f0e488
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/test.cc
@@ -0,0 +1,54 @@
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TVCodePage
+#include <tv.h>
+
+class TMyApp : public TApplication
+{
+public:
+ TMyApp();
+ static TMenuBar *initMenuBar(TRect r);
+};
+
+TMyApp::TMyApp() :
+ TProgInit(&TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y=r.a.y+1;
+ return new TMenuBar( r,
+ //*new TSubMenu("~F~ile",kbAltF)+
+ *new TSubMenu("~æ~ÁÊÌ",0)+ // KOI8 test
+ *new TMenuItem("~O~pen",200,kbF3,hcNoContext,"F3")+
+ *new TMenuItem("~N~ew", 200,kbF4,hcNoContext,"F4")+
+ newLine()+
+ *new TMenuItem("E~x~it",cmQuit,kbAltX,hcNoContext,"Alt-X")+
+ *new TSubMenu("~W~indow", kbAltW )+
+ *new TMenuItem("~N~ext",cmNext,kbF6,hcNoContext,"F6")+
+ *new TMenuItem("~Z~oom",cmZoom,kbF5,hcNoContext,"F5")
+ );
+}
+
+int main()
+{
+ TMyApp myApp;
+ // Currently autodetection is broken, so I'm forcing it until I find a solution
+ //TVCodePage::SetCodePage(TVCodePage::KOI8r);
+ myApp.redraw();
+
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/cyrillic/linuxkoi8/test.gpr b/tvision/examples/cyrillic/linuxkoi8/test.gpr
new file mode 100644
index 0000000..e0f3cd8
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/test.gpr
Binary files differ
diff --git a/tvision/examples/cyrillic/linuxkoi8/test.mkf b/tvision/examples/cyrillic/linuxkoi8/test.mkf
new file mode 100644
index 0000000..1a66a2f
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../../include
+COMMON_IMK=../../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/cyrillic/linuxkoi8/test.umk b/tvision/examples/cyrillic/linuxkoi8/test.umk
new file mode 100644
index 0000000..ce3bdf8
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/test.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./test$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./test$(ExOBJ):: test.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/cyrillic/linuxkoi8/trivial.acm b/tvision/examples/cyrillic/linuxkoi8/trivial.acm
new file mode 100644
index 0000000..95d8e63
--- /dev/null
+++ b/tvision/examples/cyrillic/linuxkoi8/trivial.acm
@@ -0,0 +1,129 @@
+# Internal value Output character
+0x80 0x80
+0x81 0x81
+0x82 0x82
+0x83 0x83
+0x84 0x84
+0x85 0x85
+0x86 0x86
+0x87 0x87
+0x88 0x88
+0x89 0x89
+0x8A 0x8A
+0x8B 0x8B
+0x8C 0x8C
+0x8D 0x8D
+0x8E 0x8E
+0x8F 0x8F
+0x90 0x90
+0x91 0x91
+0x92 0x92
+0x93 0x93
+0x94 0x94
+0x95 0x95
+0x96 0x96
+0x97 0x97
+0x98 0x98
+0x99 0x99
+0x9A 0x9A
+0x9B 0x9B
+0x9C 0x9C
+0x9D 0x9D
+0x9E 0x9E
+0x9F 0x9F
+0xA0 0xA0
+0xA1 0xA1
+0xA2 0xA2
+0xA3 0xA3
+0xA4 0xA4
+0xA5 0xA5
+0xA6 0xA6
+0xA7 0xA7
+0xA8 0xA8
+0xA9 0xA9
+0xAA 0xAA
+0xAB 0xAB
+0xAC 0xAC
+0xAD 0xAD
+0xAE 0xAE
+0xAF 0xAF
+0xB0 0xB0
+0xB1 0xB1
+0xB2 0xB2
+0xB3 0xB3
+0xB4 0xB4
+0xB5 0xB5
+0xB6 0xB6
+0xB7 0xB7
+0xB8 0xB8
+0xB9 0xB9
+0xBA 0xBA
+0xBB 0xBB
+0xBC 0xBC
+0xBD 0xBD
+0xBE 0xBE
+0xBF 0xBF
+0xC0 0xC0
+0xC1 0xC1
+0xC2 0xC2
+0xC3 0xC3
+0xC4 0xC4
+0xC5 0xC5
+0xC6 0xC6
+0xC7 0xC7
+0xC8 0xC8
+0xC9 0xC9
+0xCA 0xCA
+0xCB 0xCB
+0xCC 0xCC
+0xCD 0xCD
+0xCE 0xCE
+0xCF 0xCF
+0xD0 0xD0
+0xD1 0xD1
+0xD2 0xD2
+0xD3 0xD3
+0xD4 0xD4
+0xD5 0xD5
+0xD6 0xD6
+0xD7 0xD7
+0xD8 0xD8
+0xD9 0xD9
+0xDA 0xDA
+0xDB 0xDB
+0xDC 0xDC
+0xDD 0xDD
+0xDE 0xDE
+0xDF 0xDF
+0xE0 0xE0
+0xE1 0xE1
+0xE2 0xE2
+0xE3 0xE3
+0xE4 0xE4
+0xE5 0xE5
+0xE6 0xE6
+0xE7 0xE7
+0xE8 0xE8
+0xE9 0xE9
+0xEA 0xEA
+0xEB 0xEB
+0xEC 0xEC
+0xED 0xED
+0xEE 0xEE
+0xEF 0xEF
+0xF0 0xF0
+0xF1 0xF1
+0xF2 0xF2
+0xF3 0xF3
+0xF4 0xF4
+0xF5 0xF5
+0xF6 0xF6
+0xF7 0xF7
+0xF8 0xF8
+0xF9 0xF9
+0xFA 0xFA
+0xFB 0xFB
+0xFC 0xFC
+0xFD 0xFD
+0xFE 0xFE
+0xFF 0xFF
diff --git a/tvision/examples/cyrillic/x11koi8/rhide.env b/tvision/examples/cyrillic/x11koi8/rhide.env
new file mode 100644
index 0000000..5c9ddae
--- /dev/null
+++ b/tvision/examples/cyrillic/x11koi8/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../../rhide.env
+
diff --git a/tvision/examples/cyrillic/x11koi8/test.cc b/tvision/examples/cyrillic/x11koi8/test.cc
new file mode 100644
index 0000000..0a17119
--- /dev/null
+++ b/tvision/examples/cyrillic/x11koi8/test.cc
@@ -0,0 +1,110 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea
+ This code is Public Domain and you can use it for any purpose. Note that
+when you link to another libraries, obviously needed, the code can (and
+currently will) be affected by the libraries license.
+ Currently my TV port is GPL so this code becomes GPL, but if you link
+with another Turbo Vision port or the library changes license things are
+different.
+
+ Description:
+ This examples shows how to load and use a KOI-8r font when running on the
+X11 server.
+ Note this example also works for the Linux console and doesn't need KOI8r
+fonts loaded in your system.
+
+***************************************************************************/
+
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TVCodePage
+#define Uses_TVFontCollection
+#define Uses_TScreen
+#define Uses_TVConfigFile
+#include <tv.h>
+
+class TMyApp : public TApplication
+{
+public:
+ TMyApp();
+ static TMenuBar *initMenuBar(TRect r);
+ static TVFontCollection *fonts;
+ static TScreenFont256 *fontsCallBack(int which, unsigned w, unsigned height);
+};
+
+TVFontCollection *TMyApp::fonts=NULL;
+
+TMyApp::TMyApp() :
+ TProgInit(&TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This is the magic routine, is called each time a font is needed. We have
+to return the requested font or NULL if not available.
+
+***************************************************************************/
+
+TScreenFont256 *TMyApp::fontsCallBack(int which, unsigned width, unsigned height)
+{
+ if (!fonts) return NULL; // Check we successfully loaded the font
+ if (which) return NULL; // Just the primary
+ if (width!=8 || height!=16) return NULL; // Only 8x16
+ uchar *data=fonts->GetFont(width,height);
+ if (!data) return NULL;
+ TScreenFont256 *f=new TScreenFont256;
+ f->w=width;
+ f->h=height;
+ f->data=data;
+
+ return f;
+}
+
+TMenuBar *TMyApp::initMenuBar(TRect r)
+{
+ r.b.y=r.a.y+1;
+ return new TMenuBar( r,
+ //*new TSubMenu("~F~ile",kbAltF)+
+ *new TSubMenu("~æ~ÁÊÌ",0)+ // KOI8 test
+ *new TMenuItem("~O~pen",200,kbF3,hcNoContext,"F3")+
+ *new TMenuItem("~N~ew", 200,kbF4,hcNoContext,"F4")+
+ newLine()+
+ *new TMenuItem("E~x~it",cmQuit,kbAltX,hcNoContext,"Alt-X")+
+ *new TSubMenu("~W~indow", kbAltW )+
+ *new TMenuItem("~N~ext",cmNext,kbF6,hcNoContext,"F6")+
+ *new TMenuItem("~Z~oom",cmZoom,kbF5,hcNoContext,"F5")
+ );
+}
+
+int main()
+{
+ // Load a font we know supports cyrillics
+ TMyApp::fonts=new TVFontCollection("../../fonts/ocr.sft",TVCodePage::KOI8r);
+ // Setup our call back to provide the needed fonts
+ TScreen::setFontRequestCallBack(TMyApp::fontsCallBack);
+ // Now indicate to TV we want to use KOI8r for any driver.
+ // This can be achieved indicating settings in a configuration file or like
+ // this:
+ TProgInit::config=new TVMainConfigFile();
+ TVMainConfigFile::Add(NULL,"AppCP",TVCodePage::KOI8r);
+ TVMainConfigFile::Add(NULL,"ScrCP",TVCodePage::KOI8r);
+ TVMainConfigFile::Add(NULL,"InpCP",TVCodePage::KOI8r);
+
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/cyrillic/x11koi8/test.gpr b/tvision/examples/cyrillic/x11koi8/test.gpr
new file mode 100644
index 0000000..e0f3cd8
--- /dev/null
+++ b/tvision/examples/cyrillic/x11koi8/test.gpr
Binary files differ
diff --git a/tvision/examples/cyrillic/x11koi8/test.mkf b/tvision/examples/cyrillic/x11koi8/test.mkf
new file mode 100644
index 0000000..1a66a2f
--- /dev/null
+++ b/tvision/examples/cyrillic/x11koi8/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../../include
+COMMON_IMK=../../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/cyrillic/x11koi8/test.umk b/tvision/examples/cyrillic/x11koi8/test.umk
new file mode 100644
index 0000000..ce3bdf8
--- /dev/null
+++ b/tvision/examples/cyrillic/x11koi8/test.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./test$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./test$(ExOBJ):: test.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/demo/ascii.cc b/tvision/examples/demo/ascii.cc
new file mode 100644
index 0000000..49e1c1f
--- /dev/null
+++ b/tvision/examples/demo/ascii.cc
@@ -0,0 +1,306 @@
+/*----------------------------------------------------------*/
+/* */
+/* Ascii.cpp: Member functions of following classes: */
+/* TTable */
+/* TReport */
+/* TAsciiChart */
+/* */
+/*----------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified by Salvador E. Tropea to compile for 64 bits architectures.
+ */
+
+// SET: moved the standard headers before tv.h
+#define Uses_string
+#include <stdlib.h>
+#include <ctype.h>
+//#include <strstream.h> SET: These two are only to bloat the code.
+#include <stdio.h> // SET: printf does the job much simplier
+
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_TView
+#define Uses_TWindow
+#include <tv.h>
+__link( RView )
+__link( RWindow )
+
+#include "ascii.h"
+
+
+//
+// TTable functions
+//
+
+const char * const TTable::name = "TTable";
+
+
+void TTable::write( opstream& os )
+{
+ TView::write( os );
+}
+
+
+void *TTable::read( ipstream& is )
+{
+ TView::read( is );
+ return this;
+}
+
+
+TStreamable *TTable::build()
+{
+ return new TTable( streamableInit );
+}
+
+
+TStreamableClass RTable( TTable::name,
+ TTable::build,
+ __DELTA(TTable)
+ );
+
+
+TTable::TTable(TRect& r) :
+ TView( r )
+{
+ eventMask |= evKeyboard;
+}
+
+
+void TTable::draw()
+{
+ TDrawBuffer buf;
+ char color = getColor(6);
+
+ for(ushort y = 0; y <= size.y-1; y++)
+ {
+ buf.moveChar(0, ' ', color, (short)size.x );
+ for(ushort x = 0; x <= size.x-1; x++)
+ buf.moveChar(x, (ushort)(32*y+x), color, (ushort)1 );
+ writeLine(0, y, (short)size.x, (ushort)1, buf);
+ }
+ showCursor();
+}
+
+//
+// cmCharFocused is a offset value (basically the ascii code of the
+// current selected character) thus should be added, not or'ed, to
+// cmAsciiTableCmdBase.
+//
+
+void TTable::charFocused()
+{
+ message(owner, evBroadcast, cmAsciiTableCmdBase + cmCharFocused,
+ (void *)(long)(cursor.x + 32 * cursor.y));
+}
+
+
+void TTable::handleEvent(TEvent& event)
+{
+ TView::handleEvent(event);
+
+ if (event.what == evMouseDown)
+ {
+ do
+ {
+ if(mouseInView(event.mouse.where))
+ {
+ TPoint spot = makeLocal(event.mouse.where);
+ setCursor(spot.x, spot.y);
+ charFocused();
+ }
+ } while (mouseEvent(event, evMouseMove));
+ clearEvent(event);
+ }
+ else
+ {
+ if (event.what == evKeyboard)
+ {
+ switch (event.keyDown.keyCode)
+ {
+ case kbHome:
+ setCursor(0,0);
+ break;
+ case kbEnd:
+ setCursor(size.x-1, size.y-1);
+ break;
+ case kbUp:
+ if (cursor.y > 0)
+ setCursor(cursor.x, cursor.y-1);
+ break;
+ case kbDown:
+ if (cursor.y < size.y-1)
+ setCursor(cursor.x, cursor.y+1);
+ break;
+ case kbLeft:
+ if (cursor.x > 0)
+ setCursor(cursor.x-1, cursor.y);
+ break;
+ case kbRight:
+ if (cursor.x < size.x-1)
+ setCursor(cursor.x+1, cursor.y);
+ break;
+ default:
+ setCursor(event.keyDown.charScan.charCode % 32,
+ event.keyDown.charScan.charCode / 32);
+ break;
+ }
+ charFocused();
+ clearEvent(event);
+ }
+ }
+}
+
+
+//
+// TReport functions
+//
+
+const char * const TReport::name = "TReport";
+
+
+void TReport::write( opstream& os )
+{
+ TView::write( os );
+ os << asciiChar;
+}
+
+
+void *TReport::read( ipstream& is )
+{
+ TView::read( is );
+ is >> asciiChar;
+ return this;
+}
+
+
+TStreamable *TReport::build()
+{
+ return new TReport( streamableInit );
+}
+
+
+TStreamableClass RReport( TReport::name,
+ TReport::build,
+ __DELTA(TReport)
+ );
+
+
+TReport::TReport(TRect& r) :
+ TView(r)
+{
+ asciiChar = 0;
+}
+
+
+void TReport::draw()
+{
+ TDrawBuffer buf;
+ char color = getColor(6);
+ char str[80];
+
+ sprintf(str, "%s%c%s%3d%s%2X ", //wsz: to print 32 characters
+ " Char: ", (asciiChar==0)?(char)0x20:(char)asciiChar,
+ " Decimal: ", (int)asciiChar,
+ " Hex: ", (int)asciiChar); //wsz: :-)
+ /* SET: from Robert's port
+ statusStr
+ << " Char: " << (char ) ((asciiChar == 0) ? 0x20 : asciiChar)
+ << " Decimal: " << setw(3) << (int) asciiChar
+ << " Hex " << hex << setiosflags(ios::uppercase)
+ << setw(2) << (int) asciiChar << " " << ends;*/
+
+ buf.moveStr(0, str, color);
+ writeLine(0, 0, 32, 1, buf);
+}
+
+
+void TReport::handleEvent(TEvent& event)
+{
+ TView::handleEvent(event);
+ if (event.what == evBroadcast)
+ {
+ if (event.message.command == cmAsciiTableCmdBase + cmCharFocused)
+ {
+ asciiChar = event.message.infoLong;
+ drawView();
+ }
+ }
+}
+
+
+//
+// TAsciiChart functions
+//
+
+const char * const TAsciiChart::name = "TAsciiChart";
+
+
+void TAsciiChart::write( opstream& os )
+{
+ TWindow::write( os );
+}
+
+
+void *TAsciiChart::read( ipstream& is )
+{
+ TWindow::read( is );
+ return this;
+}
+
+
+TStreamable *TAsciiChart::build()
+{
+ return new TAsciiChart( streamableInit );
+}
+
+
+TStreamableClass RAsciiChart( TAsciiChart::name,
+ TAsciiChart::build,
+ __DELTA(TAsciiChart)
+ );
+
+
+TAsciiChart::TAsciiChart() :
+ TWindowInit( &TAsciiChart::initFrame )
+ , TWindow(TRect(0, 0, 34, 12), "ASCII Chart", wnNoNumber)
+{
+ TView *control;
+
+ flags &= ~(wfGrow | wfZoom);
+ palette = wpGrayWindow;
+
+ TRect r = getExtent();
+ r.grow(-1, -1);
+ r.a.y = r.b.y - 1;
+ control = new TReport( r );
+ control->options |= ofFramed;
+ control->eventMask |= evBroadcast;
+ insert(control);
+
+ r = getExtent();
+ r.grow(-1, -1);
+ r.b.y = r.b.y - 2;
+ control = new TTable( r );
+ control->options |= ofFramed;
+ control->options |= ofSelectable;
+ control->blockCursor();
+ insert(control);
+ control->select();
+}
+
+void TAsciiChart::handleEvent( TEvent &event ) {
+ TWindow::handleEvent( event );
+}
diff --git a/tvision/examples/demo/ascii.h b/tvision/examples/demo/ascii.h
new file mode 100644
index 0000000..eefb9b8
--- /dev/null
+++ b/tvision/examples/demo/ascii.h
@@ -0,0 +1,140 @@
+/*-------------------------------------------------------*/
+/* */
+/* Ascii.h: Header file for Ascii.cpp */
+/* */
+/*-------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+
+#if !defined( __ASCII_H )
+#define __ASCII_H
+
+const int cmAsciiTableCmdBase = 910;
+const int cmCharFocused = 0;
+
+
+class TTable : public TView
+{
+
+public:
+
+ TTable( TRect& r );
+ TTable( StreamableInit ) : TView(streamableInit) { };
+ virtual void draw();
+ virtual void handleEvent( TEvent& event );
+ void charFocused();
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+
+inline ipstream& operator >> ( ipstream& is, TTable& cl )
+ { return is >> (TStreamable&) cl; }
+inline ipstream& operator >> ( ipstream& is, TTable*& cl )
+ { return is >> (void *&) cl; }
+
+inline opstream& operator << ( opstream& os, TTable& cl )
+ { return os << (TStreamable&) cl; }
+inline opstream& operator << ( opstream& os, TTable* cl )
+ { return os << (TStreamable *) cl; }
+
+
+class TReport : public TView
+{
+
+public:
+
+ TReport( TRect& r );
+ TReport( StreamableInit ) : TView(streamableInit) { };
+ virtual void draw();
+ virtual void handleEvent( TEvent& event );
+
+private:
+
+ long asciiChar;
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+inline ipstream& operator >> ( ipstream& is, TReport& cl )
+ { return is >> (TStreamable&) cl; }
+inline ipstream& operator >> ( ipstream& is, TReport*& cl )
+ { return is >> (void *&) cl; }
+
+inline opstream& operator << ( opstream& os, TReport& cl )
+ { return os << (TStreamable&) cl; }
+inline opstream& operator << ( opstream& os, TReport* cl )
+ { return os << (TStreamable *) cl; }
+
+
+class TAsciiChart : public TWindow
+{
+
+public:
+
+ TAsciiChart();
+ TAsciiChart( StreamableInit ) : TWindowInit(&initFrame),
+ TWindow(streamableInit)
+ { };
+ virtual void handleEvent( TEvent &event );
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+inline ipstream& operator >> ( ipstream& is, TAsciiChart& cl )
+ { return is >> (TStreamable&) cl; }
+inline ipstream& operator >> ( ipstream& is, TAsciiChart*& cl )
+ { return is >> (void *&) cl; }
+
+inline opstream& operator << ( opstream& os, TAsciiChart& cl )
+ { return os << (TStreamable&) cl; }
+inline opstream& operator << ( opstream& os, TAsciiChart* cl )
+ { return os << (TStreamable *) cl; }
+
+
+#endif // __ASCII_H
diff --git a/tvision/examples/demo/calendar.cc b/tvision/examples/demo/calendar.cc
new file mode 100644
index 0000000..c10d1cb
--- /dev/null
+++ b/tvision/examples/demo/calendar.cc
@@ -0,0 +1,297 @@
+/*---------------------------------------------------------*/
+/* */
+/* Calendar.cpp: TCalenderWindow member functions. */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified by Salvador E. Tropea to show how to deal with code page
+ * dependent values.
+ */
+
+// SET: moved the standard headers before tv.h
+#define Uses_string
+#define Uses_stdlib
+#include <ctype.h>
+#include <stdio.h>
+#include <time.h>
+#define Uses_AllocLocal
+
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_TView
+#define Uses_TWindow
+#include <tv.h>
+__link( RView )
+__link( RWindow )
+
+#include "calendar.h"
+
+char TCalendarView::upArrowChar ='\036';
+char TCalendarView::oupArrowChar ='\036';
+char TCalendarView::downArrowChar ='\037';
+char TCalendarView::odownArrowChar='\037';
+
+static char *monthNames[] = {
+ "",
+ "January", "February", "March", "April", "May", "June",
+ "July", "August", "September","October", "November", "December"
+};
+
+
+static unsigned char daysInMonth[] = {
+ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+};
+
+
+//
+// TCalendarView functions
+//
+
+const char * const TCalendarView::name = "TCalendarView";
+
+
+void TCalendarView::write( opstream& os )
+{
+ TView::write( os );
+ os << days << month << year << curDay << curMonth << curYear;
+}
+
+
+void *TCalendarView::read( ipstream& is )
+{
+ TView::read( is );
+ is >> days >> month >> year >> curDay >> curMonth >> curYear;
+ return this;
+}
+
+
+TStreamable *TCalendarView::build()
+{
+ return new TCalendarView( streamableInit );
+}
+
+
+TStreamableClass RCalendarView( TCalendarView::name,
+ TCalendarView::build,
+ __DELTA(TCalendarView)
+ );
+
+
+TCalendarView::TCalendarView(TRect& r) : TView( r )
+{
+ /* SS: little change */
+
+// struct date d;
+
+ options |= ofSelectable;
+ eventMask |= evMouseAuto;
+
+ time_t now = time(NULL);
+ tm *broken = localtime(&now);
+
+ year = curYear = broken->tm_year + 1900;
+ month = curMonth = broken->tm_mon + 1;
+ curDay = broken->tm_mday;
+
+// getdate( &d );
+// year = curYear = d.da_year;
+// month = curMonth = d.da_mon;
+// curDay = d.da_day;
+
+ drawView();
+}
+
+
+int dayOfWeek(int day, int month, int year)
+{
+ int century, yr, dw;
+
+ if(month < 3)
+ {
+ month += 10;
+ --year;
+ }
+ else
+ month -= 2;
+
+ century = year / 100;
+ yr = year % 100;
+ dw = (((26 * (int)month - 2) / 10) + (int)day + yr + (yr / 4) + (century / 4) -
+ (2 * century)) % 7;
+
+ if(dw < 0)
+ dw += 7;
+
+ return((int)dw);
+}
+
+
+void TCalendarView::draw()
+{
+ AllocLocalStr(str,size.x+1);
+
+ unsigned current = 1 - dayOfWeek(1, month, year);
+ unsigned days = daysInMonth[month] + ((year % 4 == 0 && month == 2) ? 1 : 0);
+ char color, boldColor;
+ int i, j;
+ TDrawBuffer buf;
+
+ color = getColor(6);
+ boldColor = getColor(7);
+
+ buf.moveChar(0, ' ', color, size.x);
+
+ sprintf(str, "%c%12s %4d %c", upArrowChar, monthNames[month], year,
+ downArrowChar); //wsz: to see full year and down arrow
+ /*ostrstream( str, sizeof str)
+ << setw(9) << monthNames[month] << " " << setw(4) << year
+ << " " << (char) 30 << " " << (char) 31 << " " << ends;*/
+
+ buf.moveStr(0, str, color);
+ writeLine(0, 0, size.x, 1, buf);
+
+ buf.moveChar(0, ' ', color, size.x);
+ buf.moveStr(0, "Su Mo Tu We Th Fr Sa", color);
+ writeLine(0, 1, size.x, 1, buf);
+
+ for(i = 1; i <= 6; i++)
+ {
+ buf.moveChar(0, ' ', color, size.x);
+ for(j = 0; j <= 6; j++)
+ {
+ if(current < 1 || current > days)
+ buf.moveStr(j*3, " ", color);
+ else
+ {
+ sprintf(str, "%2d", (int)current);
+ /*ostrstream( str, sizeof str ) Ugh! then people say C++ is slow ...
+ << setw(2) << (int) current << ends;*/
+ if(year == curYear && month == curMonth && current == curDay)
+ buf.moveStr(j*3, str, boldColor);
+ else
+ buf.moveStr(j*3, str, color);
+ }
+ current++;
+ }
+ writeLine(0, (short)(i+1), size.x, 1, buf);
+ }
+}
+
+
+void TCalendarView::handleEvent(TEvent& event)
+{
+ TPoint point;
+
+ TView::handleEvent(event);
+ if (state && sfSelected)
+ {
+ if ( (event.what & evMouse) && (evMouseDown || evMouseAuto) )
+ {
+ point = makeLocal(event.mouse.where);
+ if (point.x == 0 && point.y == 0)
+ {
+ ++month;
+ if (month > 12)
+ {
+ ++year;
+ month = 1;
+ }
+ drawView();
+ }
+ else if (point.x == 19 && point.y == 0)
+ {
+ --month;
+ if (month < 1)
+ {
+ --year;
+ month = 12;
+ }
+ drawView();
+ }
+ }
+ else if (event.what == evKeyboard)
+ {
+ if ( (loByte(event.keyDown.keyCode) == '+') ||
+ event.keyDown.keyCode == kbDown)
+ {
+ ++month;
+ if (month > 12)
+ {
+ ++year;
+ month = 1;
+ }
+ }
+ else if ( (loByte(event.keyDown.keyCode) == '-') ||
+ event.keyDown.keyCode == kbUp)
+ {
+ --month;
+ if (month < 1)
+ {
+ --year;
+ month = 12;
+ }
+ }
+ drawView();
+ }
+ }
+}
+
+
+//
+// TCalendarWindow functions
+//
+
+const char * const TCalendarWindow::name = "TCalendarWindow";
+
+
+void TCalendarWindow::write( opstream& os )
+{
+ TWindow::write( os );
+}
+
+
+void *TCalendarWindow::read( ipstream& is )
+{
+ TWindow::read( is );
+ return this;
+}
+
+
+TStreamable *TCalendarWindow::build()
+{
+ return new TCalendarWindow( streamableInit );
+}
+
+
+TStreamableClass RCalendarWindow( TCalendarWindow::name,
+ TCalendarWindow::build,
+ __DELTA(TCalendarWindow)
+ );
+
+
+TCalendarWindow::TCalendarWindow() :
+ TWindowInit( &TCalendarWindow::initFrame )
+ , TWindow( TRect(1, 1, 23, 11), "Calendar", wnNoNumber )
+{
+ TRect r(getExtent());
+
+ flags &= ~(wfZoom | wfGrow);
+ growMode = 0;
+
+ palette = wpCyanWindow;
+
+ r.grow(-1, -1);
+ insert( new TCalendarView( r ));
+}
diff --git a/tvision/examples/demo/calendar.h b/tvision/examples/demo/calendar.h
new file mode 100644
index 0000000..e1b1a18
--- /dev/null
+++ b/tvision/examples/demo/calendar.h
@@ -0,0 +1,102 @@
+/*-------------------------------------------------------*/
+/* */
+/* Calendar.h: Header file for Calendar.cpp */
+/* */
+/*-------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+
+#if !defined( __CALENDAR_H )
+#define __CALENDAR_H
+
+class TCalendarView : public TView
+{
+
+public:
+
+ TCalendarView(TRect & r);
+ TCalendarView( StreamableInit ) : TView(streamableInit) { };
+ virtual void handleEvent(TEvent& event);
+ virtual void draw();
+
+ // The following are code page dependent, take a look at tvdemo3.cc to
+ // see how we handle it
+ static char upArrowChar;
+ static char oupArrowChar;
+ static char downArrowChar;
+ static char odownArrowChar;
+
+private:
+
+ unsigned days, month, year;
+ unsigned curDay, curMonth, curYear;
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TCalendarView& cl )
+ { return is >> (TStreamable&) cl; }
+inline ipstream& operator >> ( ipstream& is, TCalendarView*& cl )
+ { return is >> (void *&) cl; }
+
+inline opstream& operator << ( opstream& os, TCalendarView& cl )
+ { return os << (TStreamable&) cl; }
+inline opstream& operator << ( opstream& os, TCalendarView* cl )
+ { return os << (TStreamable *) cl; }
+
+
+class TCalendarWindow : public TWindow
+{
+
+public:
+
+ TCalendarWindow();
+ TCalendarWindow( StreamableInit ) :
+ TWindowInit(&TCalendarWindow::initFrame)
+ , TWindow(streamableInit) { };
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+inline ipstream& operator >> ( ipstream& is, TCalendarWindow& cl )
+ { return is >> (TStreamable&) cl; }
+inline ipstream& operator >> ( ipstream& is, TCalendarWindow*& cl )
+ { return is >> (void *&) cl; }
+
+inline opstream& operator << ( opstream& os, TCalendarWindow& cl )
+ { return os << (TStreamable&) cl; }
+inline opstream& operator << ( opstream& os, TCalendarWindow* cl )
+ { return os << (TStreamable *) cl; }
+
+
+#endif // __CALENDAR_H
diff --git a/tvision/examples/demo/demo.bmk b/tvision/examples/demo/demo.bmk
new file mode 100644
index 0000000..3f47f26
--- /dev/null
+++ b/tvision/examples/demo/demo.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: demo.exe
+!include ../../makes/common.bmk
+!include demo.umk
+
diff --git a/tvision/examples/demo/demo.gpr b/tvision/examples/demo/demo.gpr
new file mode 100644
index 0000000..2d796dd
--- /dev/null
+++ b/tvision/examples/demo/demo.gpr
Binary files differ
diff --git a/tvision/examples/demo/demo.mkf b/tvision/examples/demo/demo.mkf
new file mode 100644
index 0000000..618de72
--- /dev/null
+++ b/tvision/examples/demo/demo.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include demo$(ExIMK)
diff --git a/tvision/examples/demo/demo.umk b/tvision/examples/demo/demo.umk
new file mode 100644
index 0000000..7b91fa2
--- /dev/null
+++ b/tvision/examples/demo/demo.umk
@@ -0,0 +1,57 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./ascii$(ExOBJ) \
+ ./calendar$(ExOBJ) \
+ ./fileview$(ExOBJ) \
+ ./gadgets$(ExOBJ) \
+ ./mousedlg$(ExOBJ) \
+ ./puzzle$(ExOBJ) \
+ ./tvdemo1$(ExOBJ) \
+ ./tvdemo2$(ExOBJ) \
+ ./tvdemo3$(ExOBJ)
+
+LIBRARIES=
+
+demo$(ExEXE):: \
+ ./ascii$(ExOBJ) \
+ ./calendar$(ExOBJ) \
+ ./fileview$(ExOBJ) \
+ ./gadgets$(ExOBJ) \
+ ./mousedlg$(ExOBJ) \
+ ./puzzle$(ExOBJ) \
+ ./tvdemo1$(ExOBJ) \
+ ./tvdemo2$(ExOBJ) \
+ ./tvdemo3$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./ascii$(ExOBJ):: ascii.cc
+ $(RHIDE_COMPILE_CC)
+
+./calendar$(ExOBJ):: calendar.cc
+ $(RHIDE_COMPILE_CC)
+
+./fileview$(ExOBJ):: fileview.cc
+ $(RHIDE_COMPILE_CC)
+
+./gadgets$(ExOBJ):: gadgets.cc
+ $(RHIDE_COMPILE_CC)
+
+./mousedlg$(ExOBJ):: mousedlg.cc
+ $(RHIDE_COMPILE_CC)
+
+./puzzle$(ExOBJ):: puzzle.cc
+ $(RHIDE_COMPILE_CC)
+
+./tvdemo1$(ExOBJ):: tvdemo1.cc
+ $(RHIDE_COMPILE_CC)
+
+./tvdemo2$(ExOBJ):: tvdemo2.cc
+ $(RHIDE_COMPILE_CC)
+
+./tvdemo3$(ExOBJ):: tvdemo3.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/demo/demohelp.h b/tvision/examples/demo/demohelp.h
new file mode 100644
index 0000000..22fe18b
--- /dev/null
+++ b/tvision/examples/demo/demohelp.h
@@ -0,0 +1,40 @@
+const int
+ hcAsciiTable = 6,
+ hcCalculator = 4,
+ hcCalendar = 5,
+ hcCancelBtn = 35,
+ hcFCChDirDBox = 37,
+ hcFChangeDir = 15,
+ hcFDosShell = 16,
+ hcFExit = 17,
+ hcFOFileOpenDBox = 31,
+ hcFOFiles = 33,
+ hcFOName = 32,
+ hcFOOpenBtn = 34,
+ hcFOpen = 14,
+ hcFile = 13,
+ hcNocontext = 0,
+ hcOCColorsDBox = 39,
+ hcOColors = 28,
+ hcOMMouseDBox = 38,
+ hcOMouse = 27,
+ hcORestoreDesktop = 30,
+ hcOSaveDesktop = 29,
+ hcOpenBtn = 36,
+ hcOptions = 26,
+ hcPuzzle = 3,
+ hcSAbout = 8,
+ hcSAsciiTable = 11,
+ hcSCalculator = 12,
+ hcSCalendar = 10,
+ hcSPuzzle = 9,
+ hcSystem = 7,
+ hcViewer = 2,
+ hcWCascade = 22,
+ hcWClose = 25,
+ hcWNext = 23,
+ hcWPrevious = 24,
+ hcWSizeMove = 19,
+ hcWTile = 21,
+ hcWZoom = 20,
+ hcWindows = 18;
diff --git a/tvision/examples/demo/demohelp.h32 b/tvision/examples/demo/demohelp.h32
new file mode 100644
index 0000000..1fabc91
--- /dev/null
+++ b/tvision/examples/demo/demohelp.h32
Binary files differ
diff --git a/tvision/examples/demo/diffs.cc b/tvision/examples/demo/diffs.cc
new file mode 100644
index 0000000..e1db97d
--- /dev/null
+++ b/tvision/examples/demo/diffs.cc
@@ -0,0 +1,416 @@
+These are the differences between the original directory and this one. You
+can see what things I changed to make it work. Some of them aren't really
+needed.
+
+Only in .: Makefile.am
+Only in .: Makefile.in
+diff -u ./ascii.cc E:\DJ\CONTRIB\tvision\examples\demo\ascii.cc
+--- ./ascii.cc Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\ascii.cc Sat Jan 9 20:25:36 1999
+@@ -25,15 +25,16 @@
+ #define Uses_TStreamable
+ #define Uses_TView
+ #define Uses_TWindow
+-#include <tvision/tv.h>
++#include <tv.h>
+ __link( RView )
+ __link( RWindow )
+
+ #include <string.h>
+ #include <stdlib.h>
+ #include <ctype.h>
+-#include <strstream.h>
+-#include <iomanip.h>
++//#include <strstream.h> SET: These two are only to bloat the code.
++//#include <iomanip.h>
++#include <stdio.h> // SET: printf does the job much simplier
+
+ #include "ascii.h"
+
+@@ -208,13 +209,17 @@
+ TDrawBuffer buf;
+ char color = getColor(6);
+ char str[80];
+- ostrstream statusStr( str, sizeof str );
+
++ sprintf(str, "%s%c%s%3d%s%2X",
++ " Char: ", (asciiChar==0)?(char)0x20:(char)asciiChar,
++ " Decimal: ", (int)asciiChar,
++ " Hex ", (int)asciiChar);
++ /* SET: from Robert's port
+ statusStr
+ << " Char: " << (char ) ((asciiChar == 0) ? 0x20 : asciiChar)
+ << " Decimal: " << setw(3) << (int) asciiChar
+ << " Hex " << hex << setiosflags(ios::uppercase)
+- << setw(2) << (int) asciiChar << " " << ends;
++ << setw(2) << (int) asciiChar << " " << ends;*/
+
+ buf.moveStr(0, str, color);
+ writeLine(0, 0, 32, 1, buf);
+diff -u ./calc.cc E:\DJ\CONTRIB\tvision\examples\demo\calc.cc
+--- ./calc.cc Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\calc.cc Sat Jan 9 20:12:38 1999
+@@ -24,7 +24,8 @@
+ #define Uses_TStreamable
+ #define Uses_TView
+ #define Uses_TDialog
+-#include <tvision/tv.h>
++#define Uses_TPalette // SET: added
++#include <tv.h>
+ __link( RView )
+ __link( RDialog )
+ __link( RButton )
+diff -u ./calendar.cc E:\DJ\CONTRIB\tvision\examples\demo\calendar.cc
+--- ./calendar.cc Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\calendar.cc Sat Jan 9 20:30:12 1999
+@@ -22,15 +22,16 @@
+ #define Uses_TStreamable
+ #define Uses_TView
+ #define Uses_TWindow
+-#include <tvision/tv.h>
++#include <tv.h>
+ __link( RView )
+ __link( RWindow )
+
+ #include <string.h>
+ #include <stdlib.h>
+ #include <ctype.h>
+-#include <strstream.h>
+-#include <iomanip.h>
++//#include <strstream.h>
++//#include <iomanip.h>
++#include <stdio.h>
+ #include <time.h>
+
+ #include "calendar.h"
+@@ -133,49 +134,50 @@
+
+ void TCalendarView::draw()
+ {
+- char str[23];
+- char current = (char)(1 - dayOfWeek(1, month, year));
+- char days = (char)( daysInMonth[month] +
+- ((year % 4 == 0 && month == 2) ? 1 : 0) );
++ char str[size.x+1];
++ unsigned current = 1 - dayOfWeek(1, month, year);
++ unsigned days = daysInMonth[month] + ((year % 4 == 0 && month == 2) ? 1 : 0);
+ char color, boldColor;
+- short i, j;
++ int i, j;
+ TDrawBuffer buf;
+
+ color = getColor(6);
+ boldColor = getColor(7);
+
+- buf.moveChar(0, ' ', color, 22);
++ buf.moveChar(0, ' ', color, size.x);
+
+- ostrstream( str, sizeof str)
++ sprintf(str, "\036%15s %4d\037", monthNames[month], year);
++ /*ostrstream( str, sizeof str)
+ << setw(9) << monthNames[month] << " " << setw(4) << year
+- << " " << (char) 30 << " " << (char) 31 << " " << ends;
++ << " " << (char) 30 << " " << (char) 31 << " " << ends;*/
+
+ buf.moveStr(0, str, color);
+- writeLine(0, 0, 22, 1, buf);
++ writeLine(0, 0, size.x, 1, buf);
+
+- buf.moveChar(0, ' ', color, 22);
++ buf.moveChar(0, ' ', color, size.x);
+ buf.moveStr(0, "Su Mo Tu We Th Fr Sa", color);
+- writeLine(0, 1, 22, 1, buf);
++ writeLine(0, 1, size.x, 1, buf);
+
+ for(i = 1; i <= 6; i++)
+ {
+- buf.moveChar(0, ' ', color, 22);
++ buf.moveChar(0, ' ', color, size.x);
+ for(j = 0; j <= 6; j++)
+ {
+ if(current < 1 || current > days)
+- buf.moveStr((short)(j*3), " ", color);
++ buf.moveStr(j*3, " ", color);
+ else
+ {
+- ostrstream( str, sizeof str )
+- << setw(2) << (int) current << ends;
++ sprintf(str, "%2d", (int)current);
++ /*ostrstream( str, sizeof str ) Ugh! then people say C++ is slow ...
++ << setw(2) << (int) current << ends;*/
+ if(year == curYear && month == curMonth && current == curDay)
+- buf.moveStr((short)(j*3), str, boldColor);
++ buf.moveStr(j*3, str, boldColor);
+ else
+- buf.moveStr((short)(j*3), str, color);
++ buf.moveStr(j*3, str, color);
+ }
+ current++;
+ }
+- writeLine(0, (short)(i+1), 22, 1, buf);
++ writeLine(0, (short)(i+1), size.x, 1, buf);
+ }
+ }
+
+Only in E:\DJ\CONTRIB\tvision\examples\demo\: demo.gpr
+diff -u ./fileview.cc E:\DJ\CONTRIB\tvision\examples\demo\fileview.cc
+--- ./fileview.cc Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\fileview.cc Sat Jan 9 20:30:18 1999
+@@ -22,7 +22,7 @@
+ #define Uses_TProgram
+ #define Uses_TDeskTop
+ #define Uses_TStreamableClass
+-#include <tvision/tv.h>
++#include <tv.h>
+ __link(RScroller)
+ __link(RScrollBar)
+
+diff -u ./fileview.h E:\DJ\CONTRIB\tvision\examples\demo\fileview.h
+--- ./fileview.h Mon Jan 19 15:16:32 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\fileview.h Sat Jan 9 20:30:22 1999
+@@ -17,7 +17,7 @@
+ #define Uses_TCollection
+ #define Uses_TScroller
+ #define Uses_TWindow
+-#include <tvision/tv.h>
++#include <tv.h>
+
+ const hlChangeDir = cmChangeDir;
+
+diff -u ./gadgets.cc E:\DJ\CONTRIB\tvision\examples\demo\gadgets.cc
+--- ./gadgets.cc Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\gadgets.cc Sat Jan 9 20:30:28 1999
+@@ -22,7 +22,7 @@
+ #define Uses_TRect
+ #define Uses_TView
+ #define Uses_TDrawBuffer
+-#include <tvision/tv.h>
++#include <tv.h>
+
+ #include <string.h>
+ #include <stdlib.h>
+diff -u ./gadgets.h E:\DJ\CONTRIB\tvision\examples\demo\gadgets.h
+--- ./gadgets.h Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\gadgets.h Sat Jan 9 20:30:30 1999
+@@ -17,7 +17,7 @@
+ #define Uses_TEvent
+ #define Uses_TRect
+ #define Uses_TView
+-#include <tvision/tv.h>
++#include <tv.h>
+
+
+ class THeapView : public TView
+Only in E:\DJ\CONTRIB\tvision\examples\demo\: help.cc
+Only in E:\DJ\CONTRIB\tvision\examples\demo\: help.h
+Only in E:\DJ\CONTRIB\tvision\examples\demo\: helpbase.cc
+Only in E:\DJ\CONTRIB\tvision\examples\demo\: helpbase.h
+diff -u ./mousedlg.cc E:\DJ\CONTRIB\tvision\examples\demo\mousedlg.cc
+--- ./mousedlg.cc Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\mousedlg.cc Sat Jan 9 20:38:50 1999
+@@ -27,7 +27,8 @@
+ #define Uses_TButton
+ #define Uses_TSItem
+ #define Uses_TEventQueue
+-#include <tvision/tv.h>
++#define Uses_TPalette
++#include <tv.h>
+
+ #include <string.h>
+ #include <stdlib.h>
+@@ -65,7 +66,8 @@
+
+ if (event.what == evMouseDown)
+ {
+- if (event.mouse.eventFlags & meDoubleClick)
++ //if (event.mouse.eventFlags & meDoubleClick) SET:
++ if (event.mouse.doubleClick)
+ {
+ clicked = (short)((clicked) ? 0 : 1);
+ drawView();
+Only in .: pp
+diff -u ./puzzle.cc E:\DJ\CONTRIB\tvision\examples\demo\puzzle.cc
+--- ./puzzle.cc Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\puzzle.cc Sat Jan 9 20:39:12 1999
+@@ -22,7 +22,8 @@
+ #define Uses_TStreamable
+ #define Uses_TView
+ #define Uses_TWindow
+-#include <tvision/tv.h>
++#define Uses_TPalette
++#include <tv.h>
+ __link( RView )
+ __link( RWindow )
+
+Only in E:\DJ\CONTRIB\tvision\examples\demo\: rhide.env
+diff -u ./tvdemo.h E:\DJ\CONTRIB\tvision\examples\demo\tvdemo.h
+--- ./tvdemo.h Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\tvdemo.h Sat Jan 9 21:09:16 1999
+@@ -29,7 +29,7 @@
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent(TEvent& Event);
+ virtual void getEvent(TEvent& event);
+-// virtual TPalette& getPalette() const;
++ virtual TPalette& getPalette() const;
+ virtual void idle(); // Updates heap and clock views
+
+ private:
+diff -u ./tvdemo1.cc E:\DJ\CONTRIB\tvision\examples\demo\tvdemo1.cc
+--- ./tvdemo1.cc Tue Jul 21 10:48:00 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\tvdemo1.cc Sat Jan 9 20:40:28 1999
+@@ -28,14 +28,14 @@
+ #define Uses_TWindow
+ #define Uses_TDeskTop
+
+-#include <tvision/tv.h>
++#include <tv.h>
+
+ #include "tvdemo.h"
+ #include "gadgets.h"
+ #include "fileview.h"
+ #include "puzzle.h"
+ #include "demohelp.h"
+-#include <tvision/help.h>
++#include <help.h>
+
+ #include <stdio.h>
+ #include <string.h>
+diff -u ./tvdemo2.cc E:\DJ\CONTRIB\tvision\examples\demo\tvdemo2.cc
+--- ./tvdemo2.cc Mon Jan 19 15:16:34 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\tvdemo2.cc Sat Jan 9 21:18:56 1999
+@@ -29,7 +29,7 @@
+ #define Uses_TChDirDialog
+ #define Uses_TScreen
+
+-#include <tvision/tv.h>
++#include <tv.h>
+
+ #include "tvdemo.h"
+ #include "tvcmds.h"
+@@ -48,7 +48,7 @@
+ void TVDemo::shell()
+ {
+ /* SS: this simulates a Ctrl-Z */
+- raise(SIGTSTP); /* stop the process */
++ /*raise(SIGTSTP);*/ /* stop the process */
+ }
+
+
+@@ -130,6 +130,22 @@
+ }
+
+
++ushort executeDialog( TDialog* pD, void* data=0 )
++{
++ ushort c=cmCancel;
++
++ if (TProgram::application->validView(pD))
++ {
++ if (data)
++ pD->setData(data);
++ c = TProgram::deskTop->execView(pD);
++ if ((c != cmCancel) && (data))
++ pD->getData(data);
++ destroy(pD);
++ }
++
++ return c;
++}
+
+ //
+ // About Box function()
+@@ -338,7 +354,8 @@
+
+ TColorGroup &group5 = group1 + group2 + group3 + group4;
+
+- TColorDialog *c = new TColorDialog((TPalette*)0, &group5 );
++ TPalette *temp_pal=new TPalette(getPalette());
++ TColorDialog *c = new TColorDialog(temp_pal, &group5 );
+
+ if( validView( c ) != 0 )
+ {
+@@ -351,4 +368,5 @@
+ }
+ destroy( c );
+ }
++ delete temp_pal;
+ }
+diff -u ./tvdemo3.cc E:\DJ\CONTRIB\tvision\examples\demo\tvdemo3.cc
+--- ./tvdemo3.cc Tue Jul 21 10:48:16 1998
++++ E:\DJ\CONTRIB\tvision\examples\demo\tvdemo3.cc Sat Jan 9 21:10:08 1999
+@@ -30,7 +30,7 @@
+ #define Uses_TDialog
+ #define Uses_TEventQueue
+
+-#include <tvision/tv.h>
++#include <tv.h>
+
+ #include "tvdemo.h"
+ #include "tvcmds.h"
+@@ -39,7 +39,7 @@
+ #include "demohelp.h"
+ #include "fileview.h"
+
+-#include <tvision/help.h>
++#include <help.h>
+
+ //
+ // Mouse Control Dialog Box function
+@@ -96,12 +96,44 @@
+ //
+ // getPalette() function ( returns application's palette )
+ //
+-/*
++#define cpAppColor \
++ "\x71\x70\x78\x74\x20\x28\x24\x17\x1F\x1A\x31\x31\x1E\x71\x1F" \
++ "\x37\x3F\x3A\x13\x13\x3E\x21\x3F\x70\x7F\x7A\x13\x13\x70\x7F\x7E" \
++ "\x70\x7F\x7A\x13\x13\x70\x70\x7F\x7E\x20\x2B\x2F\x78\x2E\x70\x30" \
++ "\x3F\x3E\x1F\x2F\x1A\x20\x72\x31\x31\x30\x2F\x3E\x31\x13\x38\x00" \
++ "\x17\x1F\x1A\x71\x71\x1E\x17\x1F\x1E\x20\x2B\x2F\x78\x2E\x10\x30" \
++ "\x3F\x3E\x70\x2F\x7A\x20\x12\x31\x31\x30\x2F\x3E\x31\x13\x38\x00" \
++ "\x37\x3F\x3A\x13\x13\x3E\x30\x3F\x3E\x20\x2B\x2F\x78\x2E\x30\x70" \
++ "\x7F\x7E\x1F\x2F\x1A\x20\x32\x31\x71\x70\x2F\x7E\x71\x13\x78\x00" \
++ "\x37\x3F\x3A\x13\x13\x30\x3E\x1E" // help colors
++
++#define cpAppBlackWhite \
++ "\x70\x70\x78\x7F\x07\x07\x0F\x07\x0F\x07\x70\x70\x07\x70\x0F" \
++ "\x07\x0F\x07\x70\x70\x07\x70\x0F\x70\x7F\x7F\x70\x07\x70\x07\x0F" \
++ "\x70\x7F\x7F\x70\x07\x70\x70\x7F\x7F\x07\x0F\x0F\x78\x0F\x78\x07" \
++ "\x0F\x0F\x0F\x70\x0F\x07\x70\x70\x70\x07\x70\x0F\x07\x07\x08\x00" \
++ "\x07\x0F\x0F\x07\x70\x07\x07\x0F\x0F\x70\x78\x7F\x08\x7F\x08\x70" \
++ "\x7F\x7F\x7F\x0F\x70\x70\x07\x70\x70\x70\x07\x7F\x70\x07\x78\x00" \
++ "\x70\x7F\x7F\x70\x07\x70\x70\x7F\x7F\x07\x0F\x0F\x78\x0F\x78\x07" \
++ "\x0F\x0F\x0F\x70\x0F\x07\x70\x70\x70\x07\x70\x0F\x07\x07\x08\x00" \
++ "\x07\x0F\x07\x70\x70\x07\x0F\x70" // help colors
++
++#define cpAppMonochrome \
++ "\x70\x07\x07\x0F\x70\x70\x70\x07\x0F\x07\x70\x70\x07\x70\x00" \
++ "\x07\x0F\x07\x70\x70\x07\x70\x00\x70\x70\x70\x07\x07\x70\x07\x00" \
++ "\x70\x70\x70\x07\x07\x70\x70\x70\x0F\x07\x07\x0F\x70\x0F\x70\x07" \
++ "\x0F\x0F\x07\x70\x07\x07\x70\x07\x07\x07\x70\x0F\x07\x07\x70\x00" \
++ "\x70\x70\x70\x07\x07\x70\x70\x70\x0F\x07\x07\x0F\x70\x0F\x70\x07" \
++ "\x0F\x0F\x07\x70\x07\x07\x70\x07\x07\x07\x70\x0F\x07\x07\x01\x00" \
++ "\x70\x70\x70\x07\x07\x70\x70\x70\x0F\x07\x07\x0F\x70\x0F\x70\x07" \
++ "\x0F\x0F\x07\x70\x07\x07\x70\x07\x07\x07\x70\x0F\x07\x07\x01\x00" \
++ "\x07\x0F\x07\x70\x70\x07\x0F\x70" // help colors
++
+ TPalette& TVDemo::getPalette() const
+ {
+- static TPalette newcolor ( cpAppColor cHelpColor, sizeof( cpAppColor cHelpColor )-1 );
+- static TPalette newblackwhite( cpAppBlackWhite cHelpBlackWhite, sizeof( cpAppBlackWhite cHelpBlackWhite)-1 );
+- static TPalette newmonochrome( cpAppMonochrome cHelpMonochrome, sizeof( cpAppMonochrome cHelpMonochrome)-1 );
++ static TPalette newcolor ( cpAppColor , sizeof( cpAppColor )-1 );
++ static TPalette newblackwhite( cpAppBlackWhite , sizeof( cpAppBlackWhite )-1 );
++ static TPalette newmonochrome( cpAppMonochrome , sizeof( cpAppMonochrome )-1 );
+ static TPalette *palettes[] =
+ {
+ &newcolor,
+@@ -111,7 +143,7 @@
+ return *(palettes[appPalette]);
+
+ }
+-*/
++
+
+ //
+ // isTileable() function ( checks a view on desktop is tileable or not )
diff --git a/tvision/examples/demo/fileview.cc b/tvision/examples/demo/fileview.cc
new file mode 100644
index 0000000..e14cc27
--- /dev/null
+++ b/tvision/examples/demo/fileview.cc
@@ -0,0 +1,186 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision FileViewer Demo Support File */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified by Salvador E. Tropea <set@ieee.org>
+ */
+
+// SET: moved the standard headers before tv.h
+#define Uses_stdio
+#define Uses_string
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+#define Uses_fstream
+
+#define Uses_MsgBox
+#define Uses_TKeys
+#define Uses_TScroller
+#define Uses_TDrawBuffer
+#define Uses_TRect
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TStreamableClass
+#define Uses_TEditor // JASC, cmOpen
+#include <tv.h>
+__link(RScroller)
+__link(RScrollBar)
+
+#include "tvcmds.h"
+#include "fileview.h"
+
+UsingNamespaceStd
+
+const char * const TFileViewer::name = "TFileViewer";
+
+TFileViewer::TFileViewer( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ const char *aFileName) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ growMode = gfGrowHiX | gfGrowHiY;
+ isValid = True;
+ fileName = 0;
+ readFile( aFileName );
+ delta.x=delta.y=0;
+}
+
+TFileViewer::~TFileViewer()
+{
+ delete [] fileName;
+ CLY_destroy(fileLines);
+}
+
+void TFileViewer::draw()
+{
+ char *p;
+
+ ushort c = getColor(0x0301);
+ for( short i = 0; i < size.y; i++ )
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', c, (short)size.x );
+
+ if( delta.y + i < fileLines->getCount() )
+ {
+ char s[maxLineLength+1];
+ p = (char *)( fileLines->at(delta.y+i) );
+ if( p == 0 || (int)strlen(p) < delta.x )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, p+delta.x, size.x );
+ if( (int)strlen( p + delta.x ) > size.x )
+ s[size.x] = EOS;
+ }
+ b.moveStr( 0, s, c );
+ }
+ writeBuf( 0, i, (short)size.x, 1, b );
+ }
+}
+
+void TFileViewer::scrollDraw()
+{
+ TScroller::scrollDraw();
+ draw();
+}
+
+void TFileViewer::readFile( const char *fName )
+{
+ delete fileName;
+
+ limit.x = 0;
+ fileName = newStr( fName );
+ fileLines = new TLineCollection(5, 5);
+ ifstream fileToView( fName );
+ if( !fileToView )
+ {
+ messageBox( "Invalid drive or directory", mfError | mfOKButton );
+ isValid = False;
+ }
+ else
+ {
+ char line[maxLineLength+1];
+ // SET: Changed to use getline as suggested by Andris.
+ // New standards makes the use of get incorrect.
+ while( !lowMemory() &&
+ !fileToView.eof() &&
+ IfStreamGetLine(fileToView,line,sizeof line)
+ )
+ {
+ limit.x = max( limit.x, (int)strlen( line ) );
+ fileLines->insert( newStr( line ) );
+ }
+ isValid = True;
+ }
+ limit.y = fileLines->getCount();
+}
+
+void TFileViewer::setState( ushort aState, Boolean enable )
+{
+ TScroller::setState( aState, enable );
+ if( enable && (aState & sfExposed) )
+ setLimit( limit.x, limit.y );
+}
+
+Boolean TFileViewer::valid( ushort )
+{
+ return isValid;
+}
+
+void *TFileViewer::read(ipstream& is)
+{
+ char *fName;
+
+ TScroller::read(is);
+ fName = is.readString();
+ fileName = 0;
+ readFile(fName);
+ delete fName;
+ return this;
+}
+
+void TFileViewer::write(opstream& os)
+{
+ TScroller::write(os);
+ os.writeString(fileName);
+}
+
+TStreamable *TFileViewer::build()
+{
+ return new TFileViewer( streamableInit );
+}
+
+
+TStreamableClass RFileView( TFileViewer::name,
+ TFileViewer::build,
+ __DELTA(TFileViewer)
+ );
+
+
+
+static short winNumber = 0;
+
+TFileWindow::TFileWindow( const char *fileName ) :
+ TWindowInit( &TFileWindow::initFrame ),
+ TWindow( TProgram::deskTop->getExtent(), fileName, winNumber++ )
+{
+ options |= ofTileable;
+ TRect r( getExtent() );
+ r.grow(-1, -1);
+ insert(new TFileViewer( r,
+ standardScrollBar(sbHorizontal | sbHandleKeyboard),
+ standardScrollBar(sbVertical | sbHandleKeyboard),
+ fileName) );
+}
diff --git a/tvision/examples/demo/fileview.h b/tvision/examples/demo/fileview.h
new file mode 100644
index 0000000..9f3b80e
--- /dev/null
+++ b/tvision/examples/demo/fileview.h
@@ -0,0 +1,88 @@
+/*---------------------------------------------------------*/
+/* */
+/* Fileview.h: Header file for fileview.cpp. */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+
+#if !defined( __FILEVIEW_H )
+#define __FILEVIEW_H
+
+#define Uses_TCollection
+#define Uses_TScroller
+#define Uses_TWindow
+#include <tv.h>
+
+const int hlChangeDir = cmChangeDir;
+
+class TLineCollection : public TCollection
+{
+
+public:
+
+ TLineCollection(short lim, short delta) : TCollection(lim, delta) {}
+ virtual void freeItem(void *p) { delete[] (char *)p; }
+
+private:
+
+ virtual void *readItem( ipstream& ) { return 0; }
+ virtual void writeItem( void *, opstream& ) {}
+
+};
+
+class TFileViewer : public TScroller
+{
+
+public:
+
+ char *fileName;
+ TCollection *fileLines;
+ Boolean isValid;
+ TFileViewer( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ const char *aFileName
+ );
+ ~TFileViewer();
+ TFileViewer( StreamableInit ) : TScroller(streamableInit) { };
+ void draw();
+ void readFile( const char *fName );
+ void setState( ushort aState, Boolean enable );
+ void scrollDraw();
+ Boolean valid( ushort command );
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+class TFileWindow : public TWindow
+{
+
+public:
+
+ TFileWindow( const char *fileName );
+
+};
+
+// const int maxLineLength = 256; JASC, defined in editors.h
+
+#endif
diff --git a/tvision/examples/demo/gadgets.cc b/tvision/examples/demo/gadgets.cc
new file mode 100644
index 0000000..1af7f6f
--- /dev/null
+++ b/tvision/examples/demo/gadgets.cc
@@ -0,0 +1,185 @@
+/*-------------------------------------------------------------------*/
+/* */
+/* Turbo Vision Demo */
+/* */
+/* Gadgets.cpp: Gadgets for the Turbo Vision Demo. Includes a */
+/* heap view and a clock view which display the clock at the */
+/* right end of the menu bar and the current heap space at */
+/* the right end of the status line. */
+/* */
+/*-------------------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ * Andris Pavenis.
+ * Modified by Mike Gorchak <mike@malva.ua> to report free memory on QNX.
+ */
+#include <tv/configtv.h>
+
+// SET: moved the standard headers before tv.h
+#define Uses_string
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_time
+#define Uses_iomanip
+#if defined(TVOSf_QNXRtP) || defined(TVOSf_QNX4)
+ #define Uses_stdio
+ #define Uses_sys_stat
+#endif // TVOSf_QNXRtP
+
+#define Uses_TRect
+#define Uses_TView
+#define Uses_TDrawBuffer
+#include <tv.h>
+
+#ifdef TVOSf_QNX4
+ #include <sys/osinfo.h>
+#endif // TVOSf_QNX4
+
+#include "gadgets.h"
+
+//extern "C" unsigned long farcoreleft( void );
+
+//
+// ------------- Heap Viewer functions
+//
+
+THeapView::THeapView(TRect& r) : TView( r )
+{
+ oldMem = 0;
+ newMem = heapSize();
+
+ /* SS: now resizing under X works well */
+ growMode = gfGrowLoX | gfGrowLoY | gfGrowHiX | gfGrowHiY;
+}
+
+
+void THeapView::draw()
+{
+ TDrawBuffer buf;
+ char c = getColor(2);
+
+ buf.moveChar(0, ' ', c, (short)size.x);
+ buf.moveStr(0, heapStr, c);
+ writeLine(0, 0, (short)size.x, 1, buf);
+}
+
+
+void THeapView::update()
+{
+ if( (newMem = heapSize()) != oldMem )
+ {
+ oldMem = newMem;
+ drawView();
+ }
+}
+
+
+long THeapView::heapSize()
+{
+ #if defined(TVOSf_QNXRtP)
+ struct stat st;
+ long rval=0;
+
+ if (stat("/proc", &st)==0)
+ {
+ rval=st.st_size;
+ }
+
+ if (rval>1024UL*512UL) // one half megabyte !
+ {
+ if (rval>1024UL*1024UL*32UL) // if above 32Mb free
+ {
+ sprintf(heapStr, "%10dMb", rval/1024UL/1024UL);
+ }
+ else
+ {
+ sprintf(heapStr, "%10dKb", rval/1024UL);
+ }
+ }
+ else
+ {
+ sprintf(heapStr, "%12d", rval);
+ }
+
+ return rval;
+ #elif defined(TVOSf_QNX4)
+
+ _osinfo CurrInfo;
+ unsigned long rval;
+
+ qnx_osinfo(0, &CurrInfo);
+ rval=CurrInfo.freepmem;
+
+ if (rval>1024UL*512UL) // one half megabyte !
+ {
+ if (rval>1024UL*1024UL*32UL) // if above 32Mb free
+ {
+ sprintf(heapStr, "%10dMb", rval/1024UL/1024UL);
+ }
+ else
+ {
+ sprintf(heapStr, "%10dKb", rval/1024UL);
+ }
+ }
+ else
+ {
+ sprintf(heapStr, "%12d", rval);
+ }
+
+ return rval;
+
+ #else
+ /* SS: changed */
+ strcpy(heapStr, "Hello world!");
+ return -1;
+ #endif // TVOSf_QNXRtP
+}
+
+
+//
+// -------------- Clock Viewer functions
+//
+
+TClockView::TClockView( TRect& r ) : TView( r )
+{
+ strcpy(lastTime, " ");
+ strcpy(curTime, " ");
+
+ /* SS: now resizing under X works well */
+ growMode = gfGrowLoX | gfGrowHiX;
+}
+
+
+void TClockView::draw()
+{
+ TDrawBuffer buf;
+ char c = getColor(2);
+
+ buf.moveChar(0, ' ', c, (short)size.x);
+ buf.moveStr(0, curTime, c);
+ writeLine(0, 0, (short)size.x, 1, buf);
+}
+
+
+void TClockView::update()
+{
+ time_t t = time(0);
+ char *date = ctime(&t);
+
+ date[19] = '\0';
+ strcpy(curTime, &date[11]); /* Extract time. */
+
+ if( strcmp(lastTime, curTime) )
+ {
+ drawView();
+ strcpy(lastTime, curTime);
+ }
+}
diff --git a/tvision/examples/demo/gadgets.h b/tvision/examples/demo/gadgets.h
new file mode 100644
index 0000000..22017fd
--- /dev/null
+++ b/tvision/examples/demo/gadgets.h
@@ -0,0 +1,57 @@
+/*---------------------------------------------------------*/
+/* */
+/* Gadgets.h : Header file for gadgets.cpp */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+
+#if !defined( __GADGETS_H )
+#define __GADGETS_H
+
+#define Uses_TEvent
+#define Uses_TRect
+#define Uses_TView
+#include <tv.h>
+
+
+class THeapView : public TView
+{
+
+public:
+
+ THeapView( TRect& r );
+ virtual void update();
+ virtual void draw();
+ virtual long heapSize();
+
+private:
+
+ long oldMem, newMem;
+ char heapStr[16];
+
+};
+
+
+class TClockView : public TView
+{
+
+public:
+
+ TClockView( TRect& r );
+ virtual void draw();
+ virtual void update();
+
+private:
+
+ char lastTime[9];
+ char curTime[9];
+
+};
+
+#endif // __GADGETS_H
diff --git a/tvision/examples/demo/mousedlg.cc b/tvision/examples/demo/mousedlg.cc
new file mode 100644
index 0000000..93e1a83
--- /dev/null
+++ b/tvision/examples/demo/mousedlg.cc
@@ -0,0 +1,155 @@
+/*---------------------------------------------------------*/
+/* */
+/* Mousedlg.cpp : Member functions of following classes: */
+/* TClickTester */
+/* TMouseDialog */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ * Andris Pavenis.
+ */
+
+// SET: moved the standard headers before tv.h
+#define Uses_string
+#define Uses_stdlib
+#define Uses_ctype
+
+#define Uses_TRect
+#define Uses_TStaticText
+#define Uses_TEvent
+#define Uses_TDrawBuffer
+#define Uses_TDialog
+#define Uses_TLabel
+#define Uses_TScrollBar
+#define Uses_TCheckBoxes
+#define Uses_TButton
+#define Uses_TSItem
+#define Uses_TEventQueue
+#define Uses_TPalette
+#define Uses_iomanip
+#include <tv.h>
+
+#include "mousedlg.h"
+
+
+#define cpMousePalette "\x07\x08"
+
+
+//
+// TClickTester functions
+//
+
+TClickTester::TClickTester(TRect& r, char *aText) :
+ TStaticText(r, aText)
+{
+ clicked = 0;
+}
+
+
+TPalette& TClickTester::getPalette() const
+{
+ static TPalette palette( cpMousePalette, sizeof(cpMousePalette)-1 );
+ return palette;
+}
+
+
+void TClickTester::handleEvent(TEvent& event)
+{
+ TStaticText::handleEvent(event);
+
+ if (event.what == evMouseDown)
+ {
+ //if (event.mouse.eventFlags & meDoubleClick) SET:
+ if (event.mouse.doubleClick)
+ {
+ clicked = (short)((clicked) ? 0 : 1);
+ drawView();
+ }
+ clearEvent(event);
+ }
+}
+
+
+void TClickTester::draw()
+{
+ TDrawBuffer buf;
+ char c;
+
+ if (clicked)
+ c = getColor(2);
+ else
+ c = getColor(1);
+
+ buf.moveChar(0, ' ', c, (short)size.x);
+ buf.moveStr(0, text, c);
+ writeLine(0, 0, (short)size.x, 1, buf);
+}
+
+
+//
+// TMouseDialog functions
+//
+
+TMouseDialog::TMouseDialog() :
+ TWindowInit( &TMouseDialog::initFrame )
+ , TDialog( TRect(0, 0, 34, 12), "Mouse options" )
+{
+ TRect r(3, 4, 30, 5);
+
+ options |= ofCentered;
+
+ mouseScrollBar = new TScrollBar(r);
+ mouseScrollBar->setParams(1, 1, 20, 20, 1);
+ mouseScrollBar->options |= ofSelectable;
+ mouseScrollBar->setValue(TEventQueue::doubleDelay);
+ insert(mouseScrollBar);
+
+ r = TRect(2, 2, 21, 3);
+ insert(new TLabel(r, "~M~ouse double click", mouseScrollBar));
+
+ r = TRect(3, 3, 30, 4);
+ insert(new TClickTester(r, "Fast Medium Slow"));
+
+ r = TRect(3, 6, 30, 7);
+ insert(new TCheckBoxes(r, new TSItem("~R~everse mouse buttons", NULL)));
+ oldDelay = TEventQueue::doubleDelay;
+
+ r = TRect(9, 9, 19, 11);
+ insert(new TButton(r, "O~K~", cmOK, bfDefault));
+
+ r = TRect(21, 9, 31, 11);
+ insert(new TButton(r, "Cancel", cmCancel, bfNormal));
+
+ selectNext( (Boolean) 0);
+}
+
+
+void TMouseDialog::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ switch(event.what)
+ {
+ case evCommand:
+ if(event.message.command == cmCancel)
+ TEventQueue::doubleDelay = oldDelay;
+ break;
+
+ case evBroadcast:
+ if(event.message.command == cmScrollBarChanged)
+ {
+ TEventQueue::doubleDelay = (short)mouseScrollBar->value;
+ clearEvent(event);
+ }
+ break;
+ }
+}
+
diff --git a/tvision/examples/demo/mousedlg.h b/tvision/examples/demo/mousedlg.h
new file mode 100644
index 0000000..80139a4
--- /dev/null
+++ b/tvision/examples/demo/mousedlg.h
@@ -0,0 +1,44 @@
+/*---------------------------------------------------------*/
+/* */
+/* Mousedlg.h : Header file for mousedlg.cpp */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+
+class TClickTester : public TStaticText
+{
+
+public:
+
+ TClickTester(TRect& r, char *aText);
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent(TEvent& event);
+ virtual void draw();
+
+private:
+
+ char clicked;
+
+};
+
+
+class TMouseDialog : public TDialog
+{
+
+public:
+
+ TMouseDialog();
+ virtual void handleEvent(TEvent& event);
+
+private:
+
+ TScrollBar *mouseScrollBar;
+ short oldDelay;
+
+};
diff --git a/tvision/examples/demo/puzzle.cc b/tvision/examples/demo/puzzle.cc
new file mode 100644
index 0000000..3471c31
--- /dev/null
+++ b/tvision/examples/demo/puzzle.cc
@@ -0,0 +1,371 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision Puzzle Demo */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ * Andris Pavenis.
+ */
+
+// SET: moved the standard headers before tv.h
+#define Uses_string
+#define Uses_stdio /* SS: for sprintf(...) */
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_iomanip
+
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TPalette
+#include <tv.h>
+
+#if defined(TVComp_MSC) || defined(TVComp_BCPP)
+ #include <time.h>
+ #include <io.h>
+#else
+ #include <time.h>
+ #include <sys/time.h>
+ #include <unistd.h>
+#endif
+
+__link( RView )
+__link( RWindow )
+
+#include "puzzle.h"
+
+
+#define cpPuzzlePalette "\x06\x07"
+
+
+//
+// TPuzzleView functions & static variables
+//
+
+const char * const TPuzzleView::name = "TPuzzleView";
+
+
+void TPuzzleView::write( opstream& os )
+{
+ TView::write( os );
+ os.writeBytes(board, sizeof(board));
+ os << moves << solved;
+}
+
+
+void *TPuzzleView::read( ipstream& is )
+{
+ TView::read( is );
+ is.readBytes(board, sizeof(board));
+ is >> moves >> solved;
+ return this;
+}
+
+
+TStreamable *TPuzzleView::build()
+{
+ return new TPuzzleView( streamableInit );
+}
+
+
+TStreamableClass RPuzzleView( TPuzzleView::name,
+ TPuzzleView::build,
+ __DELTA(TPuzzleView)
+ );
+
+
+static char boardStart[16] =
+ { 'A', 'B', 'C', 'D',
+ 'E', 'F', 'G', 'H',
+ 'I', 'J', 'K', 'L',
+ 'M', 'N', 'O', ' '
+ };
+
+static char map[15] =
+ { 0, 1, 0, 1,
+ 1, 0, 1, 0,
+ 0, 1, 0, 1,
+ 1, 0, 1
+ };
+
+
+TPuzzleView::TPuzzleView(TRect& r) : TView(r)
+{
+ srand(time(NULL));
+ options |= ofSelectable;
+ memset( board, ' ', sizeof(board) );
+
+ for(int i = 0; i <= 3; i++)
+ for(int j = 0; j <= 3; j++)
+ board[i][j] = boardStart[i*4+j];
+
+ scramble();
+}
+
+
+void TPuzzleView::draw()
+{
+ char tmp[8];
+ char color[2], colorBack;
+ TDrawBuffer buf;
+
+ color[0] = color[1] = colorBack = getColor(1);
+ if (!solved)
+ color[1] = getColor(2);
+
+ /* SS: little change */
+ short i;
+ for(i = 0; i <= 3; i++)
+ //for(short i = 0; i <= 3; i++)
+ {
+ buf.moveChar(0, ' ', colorBack, 18);
+ if(i == 1)
+ buf.moveStr(13, "Move", colorBack);
+ if(i == 2)
+ {
+ sprintf(tmp, "%d", moves);
+ buf.moveStr(14, tmp, colorBack);
+ }
+ for(short j = 0; j <= 3; j++)
+ {
+ strcpy(tmp, " ");
+ tmp[1] = board[i][j];
+ if(board[i][j] == ' ')
+ buf.moveStr( (short)(j*3), tmp, color[0]);
+ else
+ buf.moveStr( (short)(j*3), tmp,
+ color[(int) map[board[i][j]-'A']]);
+ }
+ writeLine(0, i, 18, 1, buf);
+ }
+}
+
+
+TPalette& TPuzzleView::getPalette() const
+{
+ static TPalette palette( cpPuzzlePalette, sizeof(cpPuzzlePalette)-1 );
+ return palette;
+}
+
+
+void TPuzzleView::handleEvent(TEvent& event)
+{
+ TView::handleEvent(event);
+
+ if (solved && (event.what & (evKeyboard | evMouse) ) )
+ {
+ scramble();
+ clearEvent(event);
+ }
+
+ if(event.what == evMouseDown)
+ {
+ moveTile(event.mouse.where);
+ clearEvent(event);
+ winCheck();
+ }
+ else if(event.what == evKeyDown)
+ {
+ moveKey(event.keyDown.keyCode);
+ clearEvent(event);
+ winCheck();
+ }
+}
+
+void TPuzzleView::moveKey(int key)
+{
+ /* SS: little change */
+ int i;
+ for(i = 0; i <= 15; i++)
+// for(int i = 0; i <= 15; i++)
+ if(board[i/4][i%4] == ' ')
+ break;
+
+ int x = i % 4;
+ int y = i / 4;
+
+ switch(key)
+ {
+ case kbDown:
+ if (y > 0)
+ {
+ board[y][x] = board[y-1][x];
+ board[y-1][x] = ' ';
+ if(moves < 1000)
+ moves++;
+ }
+ break;
+
+ case kbUp:
+ if (y < 3)
+ {
+ board[y][x] = board[y+1][x];
+ board[y+1][x] = ' ';
+ if(moves < 1000)
+ moves++;
+ }
+ break;
+
+ case kbRight:
+ if (x > 0)
+ {
+ board[y][x] = board[y][x-1];
+ board[y][x-1] = ' ';
+ if(moves < 1000)
+ moves++;
+ }
+ break;
+
+ case kbLeft:
+ if (x < 3)
+ {
+ board[y][x] = board[y][x+1];
+ board[y][x+1] = ' ';
+ if(moves < 1000)
+ moves++;
+ }
+ break;
+ }
+ drawView();
+}
+
+void TPuzzleView::moveTile(TPoint p)
+{
+ p = makeLocal(p);
+
+ /* SS: little change */
+ int i;
+ for(i = 0; i <= 15; i++)
+// for(int i = 0; i <= 15; i++)
+ if(board[i/4][i%4] == ' ')
+ break;
+ int x = p.x / 3;
+ int y = p.y;
+
+ switch( (y*4 + x - i) )
+ {
+ case -4: // Piece moves down
+ moveKey(kbDown);
+ break;
+
+ case -1: // Piece moves right
+ moveKey(kbRight);
+ break;
+
+ case 1: // Piece moves left
+ moveKey(kbLeft);
+ break;
+
+ case 4: // Piece moves up
+ moveKey(kbUp);
+ break;
+
+ }
+ drawView();
+}
+
+void TPuzzleView::scramble()
+{
+ moves = 0;
+ solved = 0;
+ do
+ {
+ switch( (rand() >> 4) % 4)
+ {
+ case 0:
+ moveKey(kbUp);
+ break;
+
+ case 1:
+ moveKey(kbDown);
+ break;
+
+ case 2:
+ moveKey(kbRight);
+ break;
+
+ case 3:
+ moveKey(kbLeft);
+ break;
+ }
+ } while (moves++ <= 500);
+
+ moves = 0;
+ drawView();
+}
+
+
+static char *solution = "ABCDEFGHIJKLMNO ";
+
+void TPuzzleView::winCheck()
+{
+ /* SS: little change */
+ int i;
+ for(i = 0; i <= 15; i++)
+// for(int i = 0; i <= 15; i++)
+ if(board[i/4][i%4] != solution[i])
+ break;
+
+ if(i == 16)
+ solved = 1;
+ drawView();
+}
+
+
+//
+// TPuzzleWindow functions
+//
+
+const char * const TPuzzleWindow::name = "TPuzzleWindow";
+
+
+void TPuzzleWindow::write( opstream& os )
+{
+ TWindow::write( os );
+}
+
+
+void *TPuzzleWindow::read( ipstream& is )
+{
+ TWindow::read( is );
+ return this;
+}
+
+
+TStreamable *TPuzzleWindow::build()
+{
+ return new TPuzzleWindow( streamableInit );
+}
+
+
+TStreamableClass RPuzzleWindow( TPuzzleWindow::name,
+ TPuzzleWindow::build,
+ __DELTA(TPuzzleWindow)
+ );
+
+
+TPuzzleWindow::TPuzzleWindow() :
+ TWindowInit( &TPuzzleWindow::initFrame )
+ , TWindow( TRect(1, 1, 21, 7), "Puzzle", wnNoNumber)
+{
+ flags &= ~(wfZoom | wfGrow);
+ growMode = 0;
+
+ TRect r = getExtent();
+ r.grow(-1, -1);
+ insert( new TPuzzleView(r) );
+}
diff --git a/tvision/examples/demo/puzzle.h b/tvision/examples/demo/puzzle.h
new file mode 100644
index 0000000..f3db61c
--- /dev/null
+++ b/tvision/examples/demo/puzzle.h
@@ -0,0 +1,102 @@
+/*---------------------------------------------------------*/
+/* */
+/* Puzzle.h : Header file for puzzle.cpp */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+
+#if !defined( __PUZZLE_H )
+#define __PUZZLE_H
+
+class TPuzzleView : public TView
+{
+
+public:
+
+ TPuzzleView(TRect& r);
+ TPuzzleView( StreamableInit ) : TView(streamableInit) { };
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent(TEvent& event);
+ virtual void draw();
+ void moveKey(int key);
+ void moveTile(TPoint point);
+ void scramble();
+ void winCheck();
+
+private:
+
+ char board[6][6];
+ int moves;
+ char solved;
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+inline ipstream& operator >> ( ipstream& is, TPuzzleView& cl )
+ { return is >> (TStreamable&) cl; }
+inline ipstream& operator >> ( ipstream& is, TPuzzleView*& cl )
+ { return is >> (void *&) cl; }
+
+inline opstream& operator << ( opstream& os, TPuzzleView& cl )
+ { return os << (TStreamable&) cl; }
+inline opstream& operator << ( opstream& os, TPuzzleView* cl )
+ { return os << (TStreamable *) cl; }
+
+
+class TPuzzleWindow : public TWindow
+{
+
+public:
+
+ TPuzzleWindow();
+ TPuzzleWindow( StreamableInit ) :
+ TWindowInit(&TPuzzleWindow::initFrame)
+ , TWindow(streamableInit) { };
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+inline ipstream& operator >> ( ipstream& is, TPuzzleWindow& cl )
+ { return is >> (TStreamable&) cl; }
+inline ipstream& operator >> ( ipstream& is, TPuzzleWindow*& cl )
+ { return is >> (void *&) cl; }
+
+inline opstream& operator << ( opstream& os, TPuzzleWindow& cl )
+ { return os << (TStreamable&) cl; }
+inline opstream& operator << ( opstream& os, TPuzzleWindow* cl )
+ { return os << (TStreamable *) cl; }
+
+
+#endif // __PUZZLE_H
diff --git a/tvision/examples/demo/rhide.env b/tvision/examples/demo/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/demo/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/demo/tvcmds.h b/tvision/examples/demo/tvcmds.h
new file mode 100644
index 0000000..f2d5252
--- /dev/null
+++ b/tvision/examples/demo/tvcmds.h
@@ -0,0 +1,28 @@
+/*-----------------------------------------------------*/
+/* */
+/* Tvcmds.h : Constants for TVDemo events */
+/* */
+/*-----------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+
+const int cmAboutCmd = 105; // JASC, conflict with standard cmOpen
+const int cmPuzzleCmd = 101;
+const int cmCalendarCmd = 102;
+const int cmAsciiCmd = 103;
+const int cmCalcCmd = 104;
+#define cmOpenCmd cmOpen
+const int cmChDirCmd = 106;
+// SET: Use cmCallShell instead
+//const int cmDOS_Cmd = 107;
+const int cmMouseCmd = 108;
+const int cmColorCmd = 109;
+const int cmSaveCmd = 110;
+const int cmRestoreCmd = 111;
+const int cmTestInputBox= 112;
+const int cmTestPicture = 113;
diff --git a/tvision/examples/demo/tvdemo.h b/tvision/examples/demo/tvdemo.h
new file mode 100644
index 0000000..00d1608
--- /dev/null
+++ b/tvision/examples/demo/tvdemo.h
@@ -0,0 +1,71 @@
+/*---------------------------------------------------------*/
+/* */
+/* TVDemo.h : Header file for TVDemo.cpp */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+
+class TStatusLine;
+class TMenuBar;
+struct TEvent;
+class TPalette;
+class THeapView;
+class TClockView;
+class fpstream;
+
+class TVDemo : public TApplication
+{
+
+public:
+
+ TVDemo( int argc, char **argv );
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent(TEvent& Event);
+ virtual void getEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void idle(); // Updates heap and clock views
+
+private:
+
+ THeapView *heap; // Heap view
+ TClockView *clock; // Clock view
+
+ void aboutDlgBox(); // "About" box
+ void puzzle(); // Puzzle
+ void calendar(); // Calendar
+ void asciiTable(); // Ascii table
+ void calculator(); // Calculator
+ void openFile( char *fileSpec ); // File Viewer
+ void changeDir(); // Change directory
+ void shell(); // DOS shell
+ void tile(); // Tile windows
+ void cascade(); // Cascade windows
+ void mouse(); // Mouse control dialog box
+ void colors(); // Color control dialog box
+ void outOfMemory(); // For validView() function
+ void loadDesktop(fpstream& s); // Load and restore the
+ void retrieveDesktop(); // previously saved desktop
+ void storeDesktop(fpstream& s); // Store the current desktop
+ void saveDesktop(); // in a resource file
+ void testInputBox(); // SET: Just a test to show inputBox use
+ void testPictureVal(); // SET: Just a test for the picture validator
+
+ // In original demo that's a CP 437 specific code. I left it but I use
+ // it to show how to solve this using the new code page features of
+ // this port of TV.
+ static uchar systemMenuIcon[]; // Menu name for the "system menu"
+ // encoded in current code page
+ static uchar osystemMenuIcon[]; // Same encoded in CP 437, used as
+ // reference.
+public:
+ // Previous callback in the code page chain
+ static TVCodePageCallBack oldCPCallBack;
+ static void cpCallBack(ushort *map); // That's our callback
+};
diff --git a/tvision/examples/demo/tvdemo1.cc b/tvision/examples/demo/tvdemo1.cc
new file mode 100644
index 0000000..1f6ae0e
--- /dev/null
+++ b/tvision/examples/demo/tvdemo1.cc
@@ -0,0 +1,327 @@
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision TVDEMO source file */
+/* */
+/*----------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+ * Andris Pavenis.
+ * Added code page example by Salvador E. Tropea (SET)
+ */
+
+// SET: moved the standard headers before tv.h
+#include <stdio.h>
+#define Uses_string
+
+#define Uses_TVCodePage
+#define Uses_TView
+#define Uses_TRect
+#define Uses_TStatusLine
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TKeys
+#define Uses_MsgBox
+#define Uses_fpstream
+#define Uses_TEvent
+#define Uses_TDeskTop
+#define Uses_TApplication
+#define Uses_TWindow
+#define Uses_TDeskTop
+#define Uses_TScreen
+#define Uses_IOS_BIN
+#define Uses_THelpWindow
+// Needed to remap the "system" menu character
+#define Uses_TVCodePage
+#define Uses_TStreamableClass
+
+#include <tv.h>
+
+#include "tvdemo.h"
+#include "gadgets.h"
+#include "fileview.h"
+#include "puzzle.h"
+#include "demohelp.h"
+
+UsingNamespaceStd
+
+/* SS: changed */
+
+//#ifdef __DPMI32__
+#define HELP_FILENAME "demohelp.h32"
+//#else
+//#define HELP_FILENAME "DEMOHELP.H16"
+//#endif
+
+__link(RCalculator);
+__link(RCalcDisplay);
+//
+// main: create an application object. Constructor takes care of all
+// initialization. Calling run() from TProgram makes it tick and
+// the destructor will destroy the world.
+//
+// File names can be specified on the command line for automatic
+// opening.
+//
+
+int main(int argc, char **argv, char **envir)
+{
+ // The following is optional, but helps some low level drivers.
+ // Don't do it if you experiment any side effect in the arguments or you
+ // use these variables in a not so common way.
+ // Note that the Linux console driver will alter argv to be able to change
+ // what ps reports, you'll get the setWindowTitle argument.
+ TDisplay::setArgv(argc,argv,envir);
+
+ // Uncommenting the next line the cursor won't be hided.
+ // This is a test to get an application a little bit friendly for Braille
+ // Terminals.
+ //TDisplay::setShowCursorEver(True);
+
+ // We have non-ASCII symbols that depends on the code page. We must
+ // recode them to the screen code page, here is how we hook the code page
+ // change chain.
+ TVDemo::oldCPCallBack=TVCodePage::SetCallBack(TVDemo::cpCallBack);
+
+ TVDemo *demoProgram = new TVDemo(argc,argv);
+
+ // This is new in our port of TV:
+ const char *title=TScreen::getWindowTitle();
+ TScreen::setWindowTitle("Turbo Vision Demo Program");
+ demoProgram->run();
+
+ TObject::CLY_destroy( demoProgram );
+ if( title )
+ {
+ TScreen::setWindowTitle(title);
+ delete[] title;
+ }
+
+ return 0;
+}
+
+
+//
+// Constructor for the application. Command line parameters are interpreted
+// as file names and opened. Wildcards are accepted and put up a dialog
+// box with the appropriate search path.
+//
+
+TVDemo::TVDemo( int argc, char **argv ) :
+ TProgInit( &TVDemo::initStatusLine,
+ &TVDemo::initMenuBar,
+ &TVDemo::initDeskTop )
+{
+ TView *w;
+ char fileSpec[128];
+ int len;
+
+ TRect r = getExtent(); // Create the clock view.
+ r.a.x = r.b.x - 9; r.b.y = r.a.y + 1;
+ clock = new TClockView( r );
+ insert(clock);
+
+ r = getExtent(); // Create the heap view.
+ r.a.x = r.b.x - 13; r.a.y = r.b.y - 1;
+ heap = new THeapView( r );
+ insert(heap);
+
+ while (--argc > 0) // Display files specified
+ { // on command line.
+ strcpy( fileSpec, *++argv );
+ len = strlen( fileSpec );
+
+ /* SS: changed */
+
+ if( fileSpec[len-1] == '/' )
+ strcat( fileSpec, "*" );
+ if( strchr( fileSpec, '*' ) || strchr( fileSpec, '?' ) )
+ openFile( fileSpec );
+ else
+ {
+ w = validView( new TFileWindow( fileSpec ) );
+ if( w != 0 )
+ deskTop->insert(w);
+ }
+ }
+
+}
+
+
+//
+// DemoApp::getEvent()
+// Event loop to check for context help request
+//
+
+void TVDemo::getEvent(TEvent &event)
+{
+ TWindow *w;
+ THelpFile *hFile;
+ fpstream *helpStrm;
+ static Boolean helpInUse = False;
+
+ TApplication::getEvent(event);
+ switch (event.what)
+ {
+ case evCommand:
+ if ((event.message.command == cmHelp) && ( helpInUse == False))
+ {
+ helpInUse = True;
+ helpStrm = new fpstream(HELP_FILENAME, CLY_IOSIn|CLY_IOSBin);
+ hFile = new THelpFile(*helpStrm);
+ if (!helpStrm)
+ {
+ messageBox("Could not open help file", mfError | mfOKButton);
+ delete hFile;
+ }
+ else
+ {
+ w = new THelpWindow(hFile, getHelpCtx());
+ if (validView(w) != 0)
+ {
+ execView(w);
+ CLY_destroy(w);
+ }
+ clearEvent(event);
+ }
+ helpInUse = False;
+ }
+ break;
+ case evMouseDown:
+ if (event.mouse.buttons != 1)
+ event.what = evNothing;
+ break;
+ }
+
+}
+
+//
+// Create statusline.
+//
+
+TStatusLine *TVDemo::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1;
+
+ return (new TStatusLine( r,
+ *new TStatusDef( 0, 50 ) +
+ *new TStatusItem( "~F1~ Help", kbF1, cmHelp ) +
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ *new TStatusItem( 0, kbAltF3, cmClose ) +
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ *new TStatusItem( 0, kbF5, cmZoom ) +
+ *new TStatusItem( 0, kbCtrlF5, cmResize ) +
+ *new TStatusDef( 50, 0xffff ) +
+ *new TStatusItem( "Howdy", kbF1, cmHelp )
+ )
+ );
+}
+
+
+//
+// Puzzle function
+//
+
+void TVDemo::puzzle()
+{
+ TPuzzleWindow *puzz = (TPuzzleWindow *) validView(new TPuzzleWindow);
+
+ if(puzz != 0)
+ {
+ puzz->helpCtx = hcPuzzle;
+ deskTop->insert(puzz);
+ }
+}
+
+
+//
+// retrieveDesktop() function ( restores the previously stored Desktop )
+//
+
+// SET: Mike modified it to lowercase, is less annoying on POSIX systems
+static const char *TVDemoFile="tvdemo.dst";
+
+void TVDemo::retrieveDesktop()
+{
+ /* SS: changed */
+
+// struct ffblk ffblk;
+
+// if (findfirst("TVDEMO.DST", &ffblk, 0))
+ FILE *fp;
+ if ((fp = fopen(TVDemoFile, "r")) == NULL)
+ messageBox("Could not find desktop file", mfOKButton | mfError);
+ else
+ {
+ fclose(fp);
+ fpstream *f = new fpstream(TVDemoFile, CLY_IOSIn|CLY_IOSBin);
+ if( !f )
+ messageBox("Could not open desktop file", mfOKButton | mfError);
+ else
+ {
+ TVDemo::loadDesktop(*f);
+ if( !f )
+ messageBox("Error reading desktop file", mfOKButton | mfError);
+ }
+ delete f;
+ }
+}
+
+//
+// saveDesktop() function ( saves the DeskTop by calling storeDesktop function )
+//
+
+void TVDemo::saveDesktop()
+{
+ fpstream *f = new fpstream(TVDemoFile, CLY_IOSOut | CLY_IOSBin);
+
+ if( f )
+ {
+ TVDemo::storeDesktop(*f);
+ if( !f )
+ {
+ messageBox("Could not create tvdemo.dst.", mfOKButton | mfError);
+ delete f;
+ ::remove(TVDemoFile);
+ return;
+ }
+ }
+ delete f;
+}
+
+//
+// writeView() function ( writes a view object to a resource file )
+//
+
+static void writeView(TView *p, void *strm)
+{
+ fpstream *s = (fpstream *) strm;
+ if (p != TProgram::deskTop->last)
+ *s << p;
+}
+
+//
+// storeDesktop() function ( stores the Desktop in a resource file )
+//
+
+void TVDemo::storeDesktop(fpstream& s)
+{
+ deskTop->forEach(::writeView, &s);
+ s << 0;
+}
+
+//
+// Tile function
+//
+
+void TVDemo::tile()
+{
+ deskTop->tile( deskTop->getExtent() );
+}
diff --git a/tvision/examples/demo/tvdemo2.cc b/tvision/examples/demo/tvdemo2.cc
new file mode 100644
index 0000000..f1358e1
--- /dev/null
+++ b/tvision/examples/demo/tvdemo2.cc
@@ -0,0 +1,430 @@
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision TVDEMO source file */
+/* */
+/*----------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+
+// SET: moved the standard headers before tv.h
+
+#define Uses_stdlib
+#define Uses_signal
+#define Uses_TDialog
+#define Uses_TRect
+#define Uses_TStaticText
+#define Uses_TButton
+#define Uses_TEvent
+#define Uses_TWindow
+#define Uses_TColorGroup
+#define Uses_TColorItem
+#define Uses_TColorDialog
+#define Uses_TPalette
+#define Uses_TDeskTop
+#define Uses_TApplication
+#define Uses_TChDirDialog
+#define Uses_TScreen
+#define Uses_TCalculator
+// Needed to remap the "system" menu character
+#define Uses_TVCodePage
+// Needed for the inputBoxTest
+#define Uses_MsgBox
+#define Uses_TPXPictureValidator
+
+#define Uses_TEditor // JASC 2006, cmOpen
+#include <tv.h>
+
+#include "tvdemo.h"
+#include "fileview.h"
+#include "tvcmds.h"
+#include "demohelp.h"
+#include "ascii.h"
+#include "calendar.h"
+
+//
+// DOS/UNIX Shell Command.
+//
+
+void TVDemo::shell()
+{
+ /* SS: this simulates a Ctrl-Z */
+ /*raise(SIGTSTP);*/ /* stop the process */
+ suspend();
+ TScreen::System(CLY_GetShellName());
+ resume();
+ redraw();
+}
+
+void TVDemo::testInputBox()
+{
+ char buffer[20];
+ strcpy(buffer,"Initial value");
+ if (inputBox("Test for the inputBox","Enter a number",buffer,20)!=cmCancel)
+ {
+ messageBox(mfInformation | mfOKButton,"Value entered: %s",buffer);
+ }
+ else
+ {
+ messageBox("\x3""Input canceled", mfInformation | mfOKButton);
+ }
+}
+
+void TVDemo::testPictureVal()
+{
+ char buffer[20];
+ strcpy(buffer,"11-6789");
+ if (inputBox("Test for the inputBox","Enter ##-####",buffer,20,
+ // You can add a picture validator like this
+ new TPXPictureValidator("##-####",True))!=cmCancel)
+ {
+ messageBox(mfInformation | mfOKButton,"Value entered: %s",buffer);
+ }
+ else
+ {
+ messageBox("\x3""Input canceled", mfInformation | mfOKButton);
+ }
+}
+
+//
+// DemoApp::handleEvent()
+// Event loop to distribute the work.
+//
+
+void TVDemo::handleEvent(TEvent &event)
+{
+ TApplication::handleEvent(event);
+
+ if (event.what == evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmAboutCmd: // About Dialog Box
+ aboutDlgBox();
+ break;
+
+ case cmCalendarCmd: // Calendar Window
+ calendar();
+ break;
+
+ case cmAsciiCmd: // Ascii Table
+ asciiTable();
+ break;
+
+ case cmCalcCmd: // Calculator
+ calculator();
+ break;
+
+ case cmPuzzleCmd: // Puzzle
+ puzzle();
+ break;
+
+ case cmOpenCmd: // View a file
+ // SET: Even DOS port needs it.
+ if ( event.message.infoPtr ) // JASC, drag 'n' drop
+ { TView *w= validView( new TFileWindow( (char *)event.message.infoPtr ) );
+ if( w != 0 )
+ { deskTop->insert(w);
+ }
+ }
+ else
+ { openFile("*");
+ }
+ break;
+
+ case cmChDirCmd: // Change directory
+ changeDir();
+ break;
+
+ case cmCallShell: // DOS shell
+ shell();
+ break;
+
+ case cmTile: // Tile current file windows
+ tile();
+ break;
+
+ case cmCascade: // Cascade current file windows
+ cascade();
+ break;
+
+ case cmMouseCmd: // Mouse control dialog box
+ mouse();
+ break;
+
+ case cmColorCmd: // Color control dialog box
+ colors();
+ break;
+
+ case cmSaveCmd: // Save current desktop
+ saveDesktop();
+ break;
+
+ case cmRestoreCmd: // Restore saved desktop
+ retrieveDesktop();
+ break;
+
+ case cmTestInputBox:
+ testInputBox();
+ break;
+
+ case cmTestPicture:
+ testPictureVal();
+ break;
+
+ default: // Unknown command
+ return;
+
+ }
+ clearEvent (event);
+ }
+}
+
+
+ushort executeDialog( TDialog* pD, void* data=0 )
+{
+ ushort c=cmCancel;
+
+ if (TProgram::application->validView(pD))
+ {
+ if (data)
+ pD->setData(data);
+ c = TProgram::deskTop->execView(pD);
+ if ((c != cmCancel) && (data))
+ pD->getData(data);
+ CLY_destroy(pD);
+ }
+
+ return c;
+}
+
+//
+// About Box function()
+//
+
+void TVDemo::aboutDlgBox()
+{
+ TDialog *aboutBox = new TDialog(TRect(0, 0, 39, 13), "About");
+
+ aboutBox->insert(
+ new TStaticText(TRect(9, 2, 30, 9),
+ "\003Turbo Vision Demo\n\n" // These strings will be
+ "\003C++ Version\n\n" // concatenated by the compiler.
+ "\003Copyright (c) 1994\n\n" // The \003 centers the line.
+ "\003Borland International"
+ )
+ );
+
+ aboutBox->insert(
+ new TButton(TRect(14, 10, 26, 12), " OK", cmOK, bfDefault)
+ );
+
+ aboutBox->options |= ofCentered;
+
+ executeDialog(aboutBox);
+
+}
+
+
+//
+// Ascii Chart function
+//
+
+void TVDemo::asciiTable()
+{
+ TAsciiChart *chart = (TAsciiChart *) validView(new TAsciiChart);
+
+ if(chart != 0)
+ {
+ chart->helpCtx = hcAsciiTable;
+ deskTop->insert(chart);
+ }
+}
+
+
+//
+// Calendar function()
+//
+
+void TVDemo::calendar()
+{
+ TCalendarWindow *cal = (TCalendarWindow *) validView(new TCalendarWindow);
+
+ if(cal != 0)
+ {
+ cal->helpCtx = hcCalendar;
+ deskTop->insert( cal );
+ }
+}
+
+
+//
+// Calculator function
+//
+
+void TVDemo::calculator()
+{
+ TCalculator *calc = (TCalculator *) validView(new TCalculator);
+
+ if(calc != 0)
+ {
+ calc->helpCtx = hcCalculator;
+ deskTop->insert(calc);
+ }
+}
+
+//
+// Cascade function
+//
+
+void TVDemo::cascade()
+{
+ deskTop->cascade( deskTop->getExtent() );
+}
+
+
+//
+// Change Directory function
+//
+
+void TVDemo::changeDir()
+{
+ TView *d = validView( new TChDirDialog( 0, cmChangeDir ) );
+
+ if( d != 0 )
+ {
+ d->helpCtx = hcFCChDirDBox;
+ deskTop->execView( d );
+ CLY_destroy(d);
+ }
+}
+
+
+//
+// Color Control Dialog Box function
+//
+
+void TVDemo::colors()
+{
+ TColorGroup &group1 =
+ *new TColorGroup("Desktop") +
+ *new TColorItem("Color", 1)+
+
+ *new TColorGroup("Menus") +
+ *new TColorItem("Normal", 2)+
+ *new TColorItem("Disabled", 3)+
+ *new TColorItem("Shortcut", 4)+
+ *new TColorItem("Selected", 5)+
+ *new TColorItem("Selected disabled", 6)+
+ *new TColorItem("Shortcut selected", 7
+ );
+
+ TColorGroup &group2 =
+ *new TColorGroup("Dialogs/Calc") +
+ *new TColorItem("Frame/background", 33)+
+ *new TColorItem("Frame icons", 34)+
+ *new TColorItem("Scroll bar page", 35)+
+ *new TColorItem("Scroll bar icons", 36)+
+ *new TColorItem("Static text", 37)+
+
+ *new TColorItem("Label normal", 38)+
+ *new TColorItem("Label selected", 39)+
+ *new TColorItem("Label shortcut", 40
+ );
+
+ TColorItem &item_coll1 =
+ *new TColorItem("Button normal", 41)+
+ *new TColorItem("Button default", 42)+
+ *new TColorItem("Button selected", 43)+
+ *new TColorItem("Button disabled", 44)+
+ *new TColorItem("Button shortcut", 45)+
+ *new TColorItem("Button shadow", 46)+
+ *new TColorItem("Cluster normal", 47)+
+ *new TColorItem("Cluster selected", 48)+
+ *new TColorItem("Cluster shortcut", 49
+ );
+
+ TColorItem &item_coll2 =
+ *new TColorItem("Input normal", 50)+
+ *new TColorItem("Input selected", 51)+
+ *new TColorItem("Input arrow", 52)+
+
+ *new TColorItem("History button", 53)+
+ *new TColorItem("History sides", 54)+
+ *new TColorItem("History bar page", 55)+
+ *new TColorItem("History bar icons", 56)+
+
+ *new TColorItem("List normal", 57)+
+ *new TColorItem("List focused", 58)+
+ *new TColorItem("List selected", 59)+
+ *new TColorItem("List divider", 60)+
+
+ *new TColorItem("Information pane", 61
+ );
+
+ group2 = group2 + item_coll1 + item_coll2;
+
+ TColorGroup &group3 =
+ *new TColorGroup("Viewer") +
+ *new TColorItem("Frame passive", 8)+
+ *new TColorItem("Frame active", 9)+
+ *new TColorItem("Frame icons", 10)+
+ *new TColorItem("Scroll bar page", 11)+
+ *new TColorItem("Scroll bar icons", 12)+
+ *new TColorItem("Text", 13)+
+ *new TColorGroup("Puzzle")+
+ *new TColorItem("Frame passive", 8)+
+ *new TColorItem("Frame active", 9)+
+ *new TColorItem("Frame icons", 10)+
+ *new TColorItem("Scroll bar page", 11)+
+ *new TColorItem("Scroll bar icons", 12)+
+ *new TColorItem("Normal text", 13)+
+ *new TColorItem("Highlighted text", 14
+ );
+
+
+ TColorGroup &group4 =
+ *new TColorGroup("Calendar") +
+ *new TColorItem("Frame passive", 16)+
+ *new TColorItem("Frame active", 17)+
+ *new TColorItem("Frame icons", 18)+
+ *new TColorItem("Scroll bar page", 19)+
+ *new TColorItem("Scroll bar icons", 20)+
+ *new TColorItem("Normal text", 21)+
+ *new TColorItem("Current day", 22)+
+
+ *new TColorGroup("Ascii table") +
+ *new TColorItem("Frame passive", 24)+
+ *new TColorItem("Frame active", 25)+
+ *new TColorItem("Frame icons", 26)+
+ *new TColorItem("Scroll bar page", 27)+
+ *new TColorItem("Scroll bar icons", 28)+
+ *new TColorItem("Text", 29
+ );
+
+
+ TColorGroup &group5 = group1 + group2 + group3 + group4;
+
+ TPalette *temp_pal=new TPalette(getPalette());
+ TColorDialog *c = new TColorDialog(temp_pal, &group5 );
+
+ if( validView( c ) != 0 )
+ {
+ c->helpCtx = hcOCColorsDBox; // set context help constant
+ c->setData(&getPalette());
+ if( deskTop->execView( c ) != cmCancel )
+ {
+ getPalette() = *(c->pal);
+ setScreenMode(TScreen::screenMode);
+ }
+ CLY_destroy(c);
+ }
+ delete temp_pal;
+}
diff --git a/tvision/examples/demo/tvdemo3.cc b/tvision/examples/demo/tvdemo3.cc
new file mode 100644
index 0000000..e84b797
--- /dev/null
+++ b/tvision/examples/demo/tvdemo3.cc
@@ -0,0 +1,273 @@
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision TVDEMO source file */
+/* */
+/*----------------------------------------------------------*/
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ */
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Added code page example by Salvador E. Tropea (SET)
+ */
+
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TKeys
+#define Uses_fpstream
+#define Uses_TView
+#define Uses_TPalette
+#define Uses_MsgBox
+#define Uses_TFileDialog
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_TStaticText
+#define Uses_TDialog
+#define Uses_TEventQueue
+#define Uses_TEditor // JASC 2006 cmOpen
+// Needed to remap the "system" menu character
+#define Uses_TVCodePage
+
+#include <tv.h>
+
+#include "tvdemo.h"
+#include "tvcmds.h"
+#include "gadgets.h"
+#include "mousedlg.h"
+#include "demohelp.h"
+#include "fileview.h"
+#include "calendar.h"
+
+uchar TVDemo::systemMenuIcon[]="~\360~";
+uchar TVDemo::osystemMenuIcon[]="~\360~";
+TVCodePageCallBack TVDemo::oldCPCallBack=NULL;
+
+//
+// Mouse Control Dialog Box function
+//
+
+void TVDemo::mouse()
+{
+ TMouseDialog *mouseCage = (TMouseDialog *) validView( new TMouseDialog() );
+
+ if (mouseCage != 0)
+ {
+ mouseCage->helpCtx = hcOMMouseDBox;
+ mouseCage->setData(&(TEventQueue::mouseReverse));
+ if (deskTop->execView(mouseCage) != cmCancel)
+ mouseCage->getData(&(TEventQueue::mouseReverse));
+ }
+ CLY_destroy(mouseCage);
+
+}
+
+
+//
+// File Viewer function
+//
+
+void TVDemo::openFile( char *fileSpec )
+{
+ TFileDialog *d= (TFileDialog *)validView(
+ new TFileDialog(fileSpec, "Open a File", "~N~ame", fdOpenButton, 100 ));
+
+ if( d != 0 && deskTop->execView( d ) != cmCancel )
+ {
+ char fileName[PATH_MAX];
+ d->getFileName( fileName );
+ d->helpCtx = hcFOFileOpenDBox;
+ TView *w= validView( new TFileWindow( fileName ) );
+ if( w != 0 )
+ deskTop->insert(w);
+ }
+ CLY_destroy(d);
+}
+
+
+//
+// "Out of Memory" function ( called by validView() )
+//
+
+void TVDemo::outOfMemory()
+{
+ messageBox( "Not enough memory available to complete operation.",
+ mfError | mfOKButton );
+}
+
+//
+// getPalette() function ( returns application's palette )
+//
+#define cpAppColor \
+ "\x71\x70\x78\x74\x20\x28\x24\x17\x1F\x1A\x31\x31\x1E\x71\x1F" \
+ "\x37\x3F\x3A\x13\x13\x3E\x21\x3F\x70\x7F\x7A\x13\x13\x70\x7F\x7E" \
+ "\x70\x7F\x7A\x13\x13\x70\x70\x7F\x7E\x20\x2B\x2F\x78\x2E\x70\x30" \
+ "\x3F\x3E\x1F\x2F\x1A\x20\x72\x31\x31\x30\x2F\x3E\x31\x13\x38\x00" \
+ "\x17\x1F\x1A\x71\x71\x1E\x17\x1F\x1E\x20\x2B\x2F\x78\x2E\x10\x30" \
+ "\x3F\x3E\x70\x2F\x7A\x20\x12\x31\x31\x30\x2F\x3E\x31\x13\x38\x00" \
+ "\x37\x3F\x3A\x13\x13\x3E\x30\x3F\x3E\x20\x2B\x2F\x78\x2E\x30\x70" \
+ "\x7F\x7E\x1F\x2F\x1A\x20\x32\x31\x71\x70\x2F\x7E\x71\x13\x78\x00" \
+ "\x37\x3F\x3A\x13\x13\x30\x3E\x1E" // help colors
+
+#define cpAppBlackWhite \
+ "\x70\x70\x78\x7F\x07\x07\x0F\x07\x0F\x07\x70\x70\x07\x70\x0F" \
+ "\x07\x0F\x07\x70\x70\x07\x70\x0F\x70\x7F\x7F\x70\x07\x70\x07\x0F" \
+ "\x70\x7F\x7F\x70\x07\x70\x70\x7F\x7F\x07\x0F\x0F\x78\x0F\x78\x07" \
+ "\x0F\x0F\x0F\x70\x0F\x07\x70\x70\x70\x07\x70\x0F\x07\x07\x08\x00" \
+ "\x07\x0F\x0F\x07\x70\x07\x07\x0F\x0F\x70\x78\x7F\x08\x7F\x08\x70" \
+ "\x7F\x7F\x7F\x0F\x70\x70\x07\x70\x70\x70\x07\x7F\x70\x07\x78\x00" \
+ "\x70\x7F\x7F\x70\x07\x70\x70\x7F\x7F\x07\x0F\x0F\x78\x0F\x78\x07" \
+ "\x0F\x0F\x0F\x70\x0F\x07\x70\x70\x70\x07\x70\x0F\x07\x07\x08\x00" \
+ "\x07\x0F\x07\x70\x70\x07\x0F\x70" // help colors
+
+#define cpAppMonochrome \
+ "\x70\x07\x07\x0F\x70\x70\x70\x07\x0F\x07\x70\x70\x07\x70\x00" \
+ "\x07\x0F\x07\x70\x70\x07\x70\x00\x70\x70\x70\x07\x07\x70\x07\x00" \
+ "\x70\x70\x70\x07\x07\x70\x70\x70\x0F\x07\x07\x0F\x70\x0F\x70\x07" \
+ "\x0F\x0F\x07\x70\x07\x07\x70\x07\x07\x07\x70\x0F\x07\x07\x70\x00" \
+ "\x70\x70\x70\x07\x07\x70\x70\x70\x0F\x07\x07\x0F\x70\x0F\x70\x07" \
+ "\x0F\x0F\x07\x70\x07\x07\x70\x07\x07\x07\x70\x0F\x07\x07\x01\x00" \
+ "\x70\x70\x70\x07\x07\x70\x70\x70\x0F\x07\x07\x0F\x70\x0F\x70\x07" \
+ "\x0F\x0F\x07\x70\x07\x07\x70\x07\x07\x07\x70\x0F\x07\x07\x01\x00" \
+ "\x07\x0F\x07\x70\x70\x07\x0F\x70" // help colors
+
+TPalette& TVDemo::getPalette() const
+{
+ static TPalette newcolor ( cpAppColor , sizeof( cpAppColor )-1 );
+ static TPalette newblackwhite( cpAppBlackWhite , sizeof( cpAppBlackWhite )-1 );
+ static TPalette newmonochrome( cpAppMonochrome , sizeof( cpAppMonochrome )-1 );
+ static TPalette *palettes[] =
+ {
+ &newcolor,
+ &newblackwhite,
+ &newmonochrome
+ };
+ return *(palettes[appPalette]);
+
+}
+
+
+//
+// isTileable() function ( checks a view on desktop is tileable or not )
+//
+
+static Boolean isTileable(TView *p, void * )
+{
+ if( (p->options & ofTileable) != 0)
+ return True;
+ else
+ return False;
+}
+
+//
+// idle() function ( updates heap and clock views for this program. )
+//
+
+void TVDemo::idle()
+{
+ TProgram::idle();
+ clock->update();
+ heap->update();
+ if (deskTop->firstThat(isTileable, 0) != 0 )
+ {
+ enableCommand(cmTile);
+ enableCommand(cmCascade);
+ }
+ else
+ {
+ disableCommand(cmTile);
+ disableCommand(cmCascade);
+ }
+}
+
+//
+// closeView() function
+//
+
+static void closeView(TView *p, void *p1)
+{
+ message(p, evCommand, cmClose, p1);
+}
+
+//
+// loadDesktop() function
+//
+
+void TVDemo::loadDesktop(fpstream &s)
+{
+ TView *p;
+
+ if (deskTop->valid(cmClose))
+ {
+ deskTop->forEach(::closeView, 0); // Clear the desktop
+ do {
+ s >> p;
+ deskTop->insertBefore(validView(p), deskTop->last);
+ }
+ while (p != 0);
+ }
+}
+
+//
+// Menubar initialization.
+//
+
+TMenuBar *TVDemo::initMenuBar(TRect r)
+{
+ TSubMenu& sub1 =
+ *new TSubMenu( (char *)systemMenuIcon, 0, hcSystem ) +
+ *new TMenuItem( "~A~bout...", cmAboutCmd, kbNoKey, hcSAbout ) +
+ newLine() +
+ *new TMenuItem( "~P~uzzle", cmPuzzleCmd, kbNoKey, hcSPuzzle ) +
+ *new TMenuItem( "Ca~l~endar", cmCalendarCmd, kbNoKey, hcSCalendar ) +
+ *new TMenuItem( "Ascii ~T~able", cmAsciiCmd, kbNoKey, hcSAsciiTable ) +
+ *new TMenuItem( "~C~alculator", cmCalcCmd, kbNoKey, hcCalculator );
+
+ TSubMenu& sub2 =
+ *new TSubMenu( "~F~ile", 0, hcFile ) +
+ //*new TSubMenu( "~æ~ÁÊÌ", 0, hcFile ) + // KOI8 test
+ *new TMenuItem( "~O~pen...", cmOpenCmd, kbF3, hcFOpen, "F3" ) +
+ *new TMenuItem( "~C~hange Dir...", cmChDirCmd, kbNoKey, hcFChangeDir ) +
+ newLine() +
+ *new TMenuItem( "S~h~ell", cmCallShell, kbNoKey, hcFDosShell ) +
+ *new TMenuItem( "E~x~it", cmQuit, kbAltX, hcFExit, "Alt-X" );
+
+ TSubMenu& sub3 =
+ *new TSubMenu( "~W~indows", 0, hcWindows ) +
+ *new TMenuItem( "~R~esize/move", cmResize, kbCtrlF5, hcWSizeMove, "Ctrl-F5" ) +
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcWZoom, "F5" ) +
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcWNext, "F6" ) +
+ *new TMenuItem( "~C~lose", cmClose, kbAltF3, hcWClose, "Alt-F3" ) +
+ *new TMenuItem( "~T~ile", cmTile, kbNoKey, hcWTile ) +
+ *new TMenuItem( "C~a~scade", cmCascade, kbNoKey, hcWCascade );
+
+ TSubMenu& sub4 =
+ *new TSubMenu( "~O~ptions", 0, hcOptions ) +
+ *new TMenuItem( "~M~ouse...", cmMouseCmd, kbNoKey, hcOMouse ) +
+ *new TMenuItem( "~C~olors...", cmColorCmd, kbNoKey, hcOColors ) +
+ *new TMenuItem( "~S~ave desktop", cmSaveCmd, kbNoKey, hcOSaveDesktop ) +
+ *new TMenuItem( "~R~etrieve desktop", cmRestoreCmd, kbNoKey, hcORestoreDesktop ) +
+ *new TMenuItem( "~T~est inputbox", cmTestInputBox, kbNoKey, hcNoContext ) +
+ *new TMenuItem( "~T~est picture validator", cmTestPicture, kbNoKey, hcNoContext );
+
+ r.b.y = r.a.y + 1;
+ return (new TMenuBar( r, sub1 + sub2 + sub3 + sub4 ) );
+}
+
+// Called each time the code page changes. In this example we only have
+// potential code page changes at start-up.
+void TVDemo::cpCallBack(ushort *map)
+{
+ TVCodePage::RemapString(systemMenuIcon,osystemMenuIcon,map);
+ TCalendarView::upArrowChar=TVCodePage::RemapChar(TCalendarView::oupArrowChar,map);
+ TCalendarView::downArrowChar=TVCodePage::RemapChar(TCalendarView::odownArrowChar,map);
+ // If the chain was already used call it
+ if (oldCPCallBack)
+ oldCPCallBack(map);
+}
+
diff --git a/tvision/examples/desklogo/desklogo.bmk b/tvision/examples/desklogo/desklogo.bmk
new file mode 100644
index 0000000..b8f8e3d
--- /dev/null
+++ b/tvision/examples/desklogo/desklogo.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: desklogo.exe
+!include ../../makes/common.bmk
+!include desklogo.umk
+
diff --git a/tvision/examples/desklogo/desklogo.cc b/tvision/examples/desklogo/desklogo.cc
new file mode 100644
index 0000000..214fa84
--- /dev/null
+++ b/tvision/examples/desklogo/desklogo.cc
@@ -0,0 +1,224 @@
+//========================================================================
+// The following example routines have been provided by the Technical
+// Support staff at Borland International. They are provided as a
+// courtesy and not as part of a Borland product, and as such, are
+// provided without the assurance of technical support or any specific
+// guarantees.
+//========================================================================
+//
+// Ported and contributed by Joel <jso@europay.com>
+//
+//========================================================================
+
+
+#define Uses_string
+
+#define Uses_TApplication
+#define Uses_TBackground
+#define Uses_TButton
+#define Uses_TKeys
+#define Uses_TDeskTop
+#define Uses_TDialog
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TMenuItem
+#define Uses_TRect
+#define Uses_TStaticText
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TStatusLine
+
+#include <tv.h>
+
+#define PATTERN 177
+
+const int cmAbout = 100; // User selected menu item 'About'
+
+char *lines[] ={"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±²²²²²²²²²²²²²²²²²²±±±±²²±±±±±±±±±±±±±±²²±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±²²±±±±±±±±±±±±±²²±±±±±±±±±±±±²²±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±²²±±±±±±±±±±±±±±²²±±±±±±±±±±²²±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±²²±±±±±±±±±±±±±±±²²±±±±±±±±²²±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±²²±±±±±±±±±±±±±±±±²²±±±±±±²²±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±²²±±±±±±±±±±±±±±±±±²²±±±±²²±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±²²±±±±±±±±±±±±±±±±±±²²±±²²±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±²²±±±±±±±±±±±±±±±±±±±±²²±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±",
+ "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±" };
+
+
+//========================================================================
+// class definitions
+//------------------------------------------------------------------------
+class TApp : public TApplication {
+ // main application class
+
+public:
+ TApp();
+
+ static TMenuBar *initMenuBar( TRect r );
+ static TDeskTop *initDeskTop( TRect r );
+ void handleEvent( TEvent &event );
+ void AboutDialog();
+
+};
+
+//------------------------------------------------------------------------
+class TNewDeskTop : public TDeskTop
+{ // we derive a new desk top which will instantiate the background
+ // object with the character we select for the pattern
+ // also, the initBackground function is overridden to return
+ // our specialized TNewBackground
+public:
+ TNewDeskTop( const TRect& r );
+ static TBackground* initBackground( TRect r );
+};
+
+//------------------------------------------------------------------------
+class TNewBackground : public TBackground
+{
+public:
+ TNewBackground( const TRect& r, char pattern );
+ void draw();
+};
+
+//===========================================================================
+// Draw the background
+//===========================================================================
+void TNewBackground::draw()
+{
+
+ TDrawBuffer b;
+
+ for(int i= 0; i < size.y; i++)
+ {
+ for( int j= 0; j < size.x; j++)
+ {
+ if (i<23 && j<80)
+ b.moveChar( j, lines[i][j], getColor(0x01), 1 );
+ else
+ b.moveChar( j, '±', getColor(0x01), 1 );
+ }
+ writeLine( 0, i, size.x, 1, b );
+ }
+
+}
+
+
+TApp::TApp() : TProgInit( &TApplication::initStatusLine,
+ &TApp::initMenuBar, &TApp::initDeskTop )
+{
+}
+
+
+
+TMenuBar *TApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1;
+ return( new TMenuBar( r, new TMenu(
+ *new TMenuItem( "~A~bout", cmAbout, kbAltA, hcNoContext, 0 )
+ ) ) );
+}
+
+//------------------------------------------------------------------------
+// redefine desktop initialization to cause usage of newly
+// defined desktop
+//------------------------------------------------------------------------
+TDeskTop *TApp::initDeskTop( TRect r )
+{
+ // initDeskTop is passed a TRect which is the size of the
+ // application's window - in our case the whole screen
+ r.a.y++;
+ r.b.y--;
+ return ( new TNewDeskTop( r ) );
+
+}
+
+
+
+void TApp::handleEvent (TEvent &event)
+{
+ // override the handleEvent so we can call the about box
+ TApplication::handleEvent( event );
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmAbout:
+ {
+ AboutDialog();
+ clearEvent( event );
+ break;
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+// create modal About dialog box
+//------------------------------------------------------------------------
+void TApp::AboutDialog()
+{
+
+ TDialog *pd = new TDialog( TRect( 0, 0, 35, 12 ), "About" );
+ if (pd)
+ {
+ pd->options |= ofCentered;
+ pd->insert( new TStaticText( TRect( 1, 2, 34, 7 ),
+ "\003Turbo Vision Example\n\003\n"
+ "\003Modifying the desk top\n\003\n"
+ "\003Borland Technical Support"));
+ pd->insert( new TButton( TRect( 3,9,32,11 ), "~O~k",
+ cmOK, bfDefault ) );
+ deskTop->execView( pd );
+ }
+ CLY_destroy( pd );
+}
+
+//========================================================================
+// implementation of TNewDeskTop
+//------------------------------------------------------------------------
+TNewDeskTop::TNewDeskTop( const TRect& r ) :
+ TDeskInit( &initBackground ),
+ TDeskTop( r )
+{
+}
+
+//------------------------------------------------------------------------
+
+TBackground *TNewDeskTop::initBackground( TRect r )
+{
+ // initializing the TBackground object allows us
+ // to pass it a character for the desktop pattern
+ return new TNewBackground( r, PATTERN );
+}
+
+
+//========================================================================
+// implementation of TNewBackground
+//------------------------------------------------------------------------
+
+TNewBackground::TNewBackground( const TRect& r, char pattern ) :
+ TBackground( r, pattern )
+{
+}
+
+//========================================================================
+int main(void)
+{
+ TApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/desklogo/desklogo.gpr b/tvision/examples/desklogo/desklogo.gpr
new file mode 100644
index 0000000..f4866ef
--- /dev/null
+++ b/tvision/examples/desklogo/desklogo.gpr
Binary files differ
diff --git a/tvision/examples/desklogo/desklogo.mkf b/tvision/examples/desklogo/desklogo.mkf
new file mode 100644
index 0000000..ff4d410
--- /dev/null
+++ b/tvision/examples/desklogo/desklogo.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include desklogo$(ExIMK)
diff --git a/tvision/examples/desklogo/desklogo.umk b/tvision/examples/desklogo/desklogo.umk
new file mode 100644
index 0000000..df5b8c3
--- /dev/null
+++ b/tvision/examples/desklogo/desklogo.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./desklogo$(ExOBJ)
+
+LIBRARIES=
+
+desklogo$(ExEXE):: \
+ ./desklogo$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./desklogo$(ExOBJ):: desklogo.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/desklogo/rhide.env b/tvision/examples/desklogo/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/desklogo/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/desklogo/set-logo.bmk b/tvision/examples/desklogo/set-logo.bmk
new file mode 100644
index 0000000..e0cbdf7
--- /dev/null
+++ b/tvision/examples/desklogo/set-logo.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: set-logo.exe
+!include ../../makes/common.bmk
+!include set-logo.umk
+
diff --git a/tvision/examples/desklogo/set-logo.cc b/tvision/examples/desklogo/set-logo.cc
new file mode 100644
index 0000000..56bae17
--- /dev/null
+++ b/tvision/examples/desklogo/set-logo.cc
@@ -0,0 +1,259 @@
+//========================================================================
+// The following example routines have been provided by the Technical
+// Support staff at Borland International. They are provided as a
+// courtesy and not as part of a Borland product, and as such, are
+// provided without the assurance of technical support or any specific
+// guarantees.
+//========================================================================
+//
+// Ported and contributed by Joel <jso@europay.com>
+//
+// SET: 1999/12/05, Added an example to show how to stop and resume the
+// application under Linux. Based in a test from Matt Mueller
+// <donut@azstarnet.com>
+//
+//========================================================================
+
+// To avoid pulling TScreen and signal.h for anything but UNIX
+#include <tv/configtv.h>
+
+#define Uses_string
+
+#define Uses_TApplication
+#define Uses_TBackground
+#define Uses_TButton
+#define Uses_TKeys
+#define Uses_TDeskTop
+#define Uses_TDialog
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TMenuItem
+#define Uses_TRect
+#define Uses_TStaticText
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TStatusLine
+
+#ifdef TVOS_UNIX
+ #define Uses_TScreen
+ #define Uses_signal
+#endif
+
+#include <tv.h>
+
+#define PATTERN 177
+
+const int cmAbout = 100; // User selected menu item 'About'
+
+char *lines[]=
+{
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛ ",
+" ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛ ",
+" ÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ",
+" ÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ",
+" ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛÛ ",
+" ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ",
+" ÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ",
+" ÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ",
+" ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛ ",
+" ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛ ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "
+};
+
+
+//========================================================================
+// class definitions
+//------------------------------------------------------------------------
+class TApp : public TApplication {
+ // main application class
+
+public:
+ TApp();
+
+ static TMenuBar *initMenuBar( TRect r );
+ static TDeskTop *initDeskTop( TRect r );
+ void handleEvent( TEvent &event );
+ void AboutDialog();
+
+};
+
+//------------------------------------------------------------------------
+class TNewDeskTop : public TDeskTop
+{ // we derive a new desk top which will instantiate the background
+ // object with the character we select for the pattern
+ // also, the initBackground function is overridden to return
+ // our specialized TNewBackground
+public:
+ TNewDeskTop( const TRect& r );
+ static TBackground* initBackground( TRect r );
+};
+
+//------------------------------------------------------------------------
+class TNewBackground : public TBackground
+{
+public:
+ TNewBackground( const TRect& r, char pattern );
+ void draw();
+};
+
+
+
+//===========================================================================
+// Draw the background
+//===========================================================================
+void TNewBackground::draw()
+{
+
+ TDrawBuffer b;
+
+ for(int i= 0; i < size.y; i++)
+ {
+ for( int j= 0; j < size.x; j++)
+ {
+ if (i<25 && j<80)
+ b.moveChar( j, lines[i][j], getColor(0x01), 1 );
+ else
+ b.moveChar( j, ' ', getColor(0x01), 1 );
+ }
+ writeLine( 0, i, size.x, 1, b );
+ }
+
+}
+
+
+TApp::TApp() : TProgInit( &TApplication::initStatusLine,
+ &TApp::initMenuBar, &TApp::initDeskTop )
+{
+}
+
+
+
+TMenuBar *TApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1;
+ return( new TMenuBar( r, new TMenu(
+ *new TMenuItem( "~A~bout", cmAbout, kbAltA, hcNoContext, 0 )
+ ) ) );
+}
+
+//------------------------------------------------------------------------
+// redefine desktop initialization to cause usage of newly
+// defined desktop
+//------------------------------------------------------------------------
+TDeskTop *TApp::initDeskTop( TRect r )
+{
+ // initDeskTop is passed a TRect which is the size of the
+ // application's window - in our case the whole screen
+ r.a.y++;
+ r.b.y--;
+ return ( new TNewDeskTop( r ) );
+
+}
+
+#ifdef TVOS_UNIX
+void ResumeApp(int signum)
+{
+ TProgram::application->resume();
+ TProgram::deskTop->setState(sfVisible,True);
+ TProgram::deskTop->redraw();
+ TProgram::application->redraw();
+}
+#endif
+
+void TApp::handleEvent (TEvent &event)
+{
+ // override the handleEvent so we can call the about box
+ TApplication::handleEvent( event );
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmAbout:
+ {
+ AboutDialog();
+ clearEvent( event );
+ break;
+ }
+ }
+ }
+ #ifdef TVOS_UNIX
+ else
+ if( event.what == evKeyDown && event.keyDown.keyCode == kbCtrlZ )
+ {
+ suspend();
+ signal(SIGCONT,ResumeApp);
+ kill(0,SIGSTOP);
+ }
+ #endif
+}
+
+//------------------------------------------------------------------------
+// create modal About dialog box
+//------------------------------------------------------------------------
+void TApp::AboutDialog()
+{
+
+ TDialog *pd = new TDialog( TRect( 0, 0, 35, 12 ), "About" );
+ if (pd)
+ {
+ pd->options |= ofCentered;
+ pd->insert( new TStaticText( TRect( 1, 2, 34, 7 ),
+ "\003Turbo Vision Example\n\003\n"
+ "\003Modifying the desk top\n\003\n"
+ "\003Borland Technical Support"));
+ pd->insert( new TButton( TRect( 3,9,32,11 ), "~O~k",
+ cmOK, bfDefault ) );
+ deskTop->execView( pd );
+ }
+ CLY_destroy( pd );
+}
+
+//========================================================================
+// implementation of TNewDeskTop
+//------------------------------------------------------------------------
+TNewDeskTop::TNewDeskTop( const TRect& r ) :
+ TDeskInit( &initBackground ),
+ TDeskTop( r )
+{
+}
+
+//------------------------------------------------------------------------
+
+TBackground *TNewDeskTop::initBackground( TRect r )
+{
+ // initializing the TBackground object allows us
+ // to pass it a character for the desktop pattern
+ return new TNewBackground( r, PATTERN );
+}
+
+
+//========================================================================
+// implementation of TNewBackground
+//------------------------------------------------------------------------
+
+TNewBackground::TNewBackground( const TRect& r, char pattern ) :
+ TBackground( r, pattern )
+{
+}
+
+//========================================================================
+int main(void)
+{
+ TApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/desklogo/set-logo.gpr b/tvision/examples/desklogo/set-logo.gpr
new file mode 100644
index 0000000..4bb5425
--- /dev/null
+++ b/tvision/examples/desklogo/set-logo.gpr
Binary files differ
diff --git a/tvision/examples/desklogo/set-logo.mkf b/tvision/examples/desklogo/set-logo.mkf
new file mode 100644
index 0000000..2dde95e
--- /dev/null
+++ b/tvision/examples/desklogo/set-logo.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include set-logo$(ExIMK)
diff --git a/tvision/examples/desklogo/set-logo.umk b/tvision/examples/desklogo/set-logo.umk
new file mode 100644
index 0000000..c9c4ca1
--- /dev/null
+++ b/tvision/examples/desklogo/set-logo.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./set-logo$(ExOBJ)
+
+LIBRARIES=
+
+set-logo$(ExEXE):: \
+ ./set-logo$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./set-logo$(ExOBJ):: set-logo.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/desklogo/tv_logo.bmk b/tvision/examples/desklogo/tv_logo.bmk
new file mode 100644
index 0000000..9ba3d20
--- /dev/null
+++ b/tvision/examples/desklogo/tv_logo.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tv_logo.exe
+!include ../../makes/common.bmk
+!include tv_logo.umk
+
diff --git a/tvision/examples/desklogo/tv_logo.cc b/tvision/examples/desklogo/tv_logo.cc
new file mode 100644
index 0000000..5010082
--- /dev/null
+++ b/tvision/examples/desklogo/tv_logo.cc
@@ -0,0 +1,258 @@
+//========================================================================
+// The following example routines have been provided by the Technical
+// Support staff at Borland International. They are provided as a
+// courtesy and not as part of a Borland product, and as such, are
+// provided without the assurance of technical support or any specific
+// guarantees.
+//========================================================================
+//
+// Ported and contributed by Joel <jso@europay.com>
+// I (SET) did some changes to show some details and hence make it more
+// instructive.
+//
+//========================================================================
+
+#define Uses_TApplication
+#define Uses_TBackground
+#define Uses_TButton
+#define Uses_TKeys
+#define Uses_TDeskTop
+#define Uses_TDialog
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TMenuItem
+#define Uses_TRect
+#define Uses_TStaticText
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TStatusLine
+#define Uses_TPalette
+
+#define Uses_string
+#include <tv.h>
+
+#define PATTERN 177
+
+const int cmAbout = 100; // User selected menu item 'About'
+
+// Following logo is just a simple text
+const char *logo = "To the success of FSF ";
+
+//========================================================================
+// class definitions
+//------------------------------------------------------------------------
+class TvApp : public TApplication {
+ // main application class
+
+public:
+ TvApp();
+
+ static TMenuBar *initMenuBar( TRect r );
+ static TDeskTop *initDeskTop( TRect r );
+ void handleEvent( TEvent &event );
+ void AboutDialog();
+
+ virtual TPalette& getPalette() const;
+
+};
+
+//------------------------------------------------------------------------
+class TNewDeskTop : public TDeskTop
+{ // we derive a new desk top which will instantiate the background
+ // object with the character we select for the pattern
+ // also, the initBackground function is overridden to return
+ // our specialized TNewBackground
+public:
+ TNewDeskTop( const TRect& r );
+ static TBackground* initBackground( TRect r );
+};
+
+//------------------------------------------------------------------------
+class TNewBackground : public TBackground
+{
+
+public:
+ TNewBackground( const TRect& r, char pattern );
+ void draw();
+};
+
+//===========================================================================
+// Draw the background
+//===========================================================================
+void TNewBackground::draw()
+{
+// Original Design
+// TDrawBuffer b;
+//
+// for(int col= 0; col < size.y; col++)
+// {
+// for( int lin= 0; lin < size.x; lin++)
+// {
+// b.moveChar( lin, logo[(col + lin) % strlen(logo)], getColor(0x01), 1 );
+// }
+// writeLine( 0, col, size.x, 1, b );
+// }
+// End Original Design
+
+// Alternate Design
+// This design was originaly implemented in the book:
+// "TURBO VISION POUR C++" of G. Leblanc (Ed. EYROLLES)
+// which I adapted for the choice of *logo (a C string)
+// in place of *lines[] (a table of C string)
+
+ #if 0
+ TRect r = getClipRect(); // To refresh only what is necessary
+
+ // SET: note that even when valid this aproach is very slow. The original
+ // approach is better oriented, but the call to getColor() inside the loop
+ // is a big mistake. Anyways, these are 2 examples.
+ for (int col=r.a.x; col<r.b.x; col++)
+ for (int li=r.a.y; li<r.b.y; li++)
+ writeChar(col, li, logo[(col + li) % strlen(logo)], 1, 1);
+ #else
+ // SET: here is my modified version as a third example.
+ // Some important stuff:
+ // 1) getColor is called outside the loops, it means once instead of 1760
+ // times ;-). (Considering a full draw)
+ // 2) The modulus operation is slow (is a div) so is called only once per
+ // line.
+ // 3) The len of the string is called outside the loop too.
+ // 4) The video memory is accessed only once per line, not once per
+ // character.
+ // And off course only getClipRect() is redrawed.
+ TDrawBuffer b;
+ int lin,len,col,counter,width;
+ ushort color=getColor(0x01);
+ TRect r=getClipRect();
+ len=strlen(logo);
+
+ width=r.b.x-r.a.x;
+ for(lin=r.a.y; lin<r.b.y; lin++)
+ {
+ for(counter=(lin+r.a.x)%len, col=0; col<width; col++)
+ {
+ b.moveChar(col,logo[counter],color,1);
+ if (++counter==len)
+ counter=0;
+ }
+ writeLine(r.a.x,lin,width,1,b);
+ }
+ #endif
+
+// End Alternate Design
+
+}
+
+TvApp::TvApp() : TProgInit( &TvApp::initStatusLine,
+ &TvApp::initMenuBar, &TvApp::initDeskTop )
+{
+ deskTop->redraw(); //SET: This extra redraw is needed to use the new palette
+}
+
+TMenuBar *TvApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1;
+ return( new TMenuBar( r, new TMenu(
+ *new TMenuItem( "~A~bout", cmAbout, kbAltA, hcNoContext, 0 )
+ ) ) );
+}
+
+//------------------------------------------------------------------------
+// redefine desktop initialization to cause usage of newly
+// defined desktop
+//------------------------------------------------------------------------
+TDeskTop *TvApp::initDeskTop( TRect r )
+{
+ // initDeskTop is passed a TRect which is the size of the
+ // application's window - in our case the whole screen
+ r.a.y++;
+ r.b.y--;
+ return ( new TNewDeskTop( r ) );
+
+}
+
+void TvApp::handleEvent (TEvent &event)
+{
+ // override the handleEvent so we can call the about box
+ TApplication::handleEvent( event );
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmAbout:
+ {
+ AboutDialog();
+ clearEvent( event );
+ break;
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+// create modal About dialog box
+//------------------------------------------------------------------------
+void TvApp::AboutDialog()
+{
+ TDialog *pd = new TDialog( TRect( 0, 0, 35, 12 ), "About" );
+ if (pd)
+ {
+ pd->options |= ofCentered;
+ pd->insert( new TStaticText( TRect( 1, 2, 34, 7 ),
+ "\003Turbo Vision Example\n\003\n"
+ "\003Modifying the desk top\n\003\n"
+ "\003Borland Technical Support"));
+ pd->insert( new TButton( TRect( 3,9,32,11 ), "~O~k",
+ cmOK, bfDefault ) );
+ deskTop->execView( pd );
+ }
+ CLY_destroy( pd );
+}
+
+
+TPalette& TvApp::getPalette() const
+{
+ // SET: The following isn't recommendable because that's executed too often
+ static TPalette palette(TApplication::getPalette());
+ if (appPalette == apColor)
+ { // modification of application palette
+ palette[1] = 0x02; // Red on Blue for normal article
+ palette[2] = 0x14;
+ palette[5] = 0x52; // Green on Blue for preselected article
+ }
+ return palette;
+}
+
+//========================================================================
+// implementation of TNewDeskTop
+//------------------------------------------------------------------------
+TNewDeskTop::TNewDeskTop( const TRect& r ) :
+ TDeskInit( &initBackground ), TDeskTop( r )
+{
+}
+
+//------------------------------------------------------------------------
+
+TBackground *TNewDeskTop::initBackground( TRect r )
+{
+ // initializing the TBackground object allows us
+ // to pass it a character for the desktop pattern
+ return new TNewBackground( r, PATTERN );
+}
+
+//========================================================================
+// implementation of TNewBackground
+//------------------------------------------------------------------------
+
+TNewBackground::TNewBackground( const TRect& r, char pattern ) :
+ TBackground( r, pattern )
+{
+}
+
+//========================================================================
+int main(void)
+{
+ TvApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/desklogo/tv_logo.gpr b/tvision/examples/desklogo/tv_logo.gpr
new file mode 100644
index 0000000..4bae158
--- /dev/null
+++ b/tvision/examples/desklogo/tv_logo.gpr
Binary files differ
diff --git a/tvision/examples/desklogo/tv_logo.mkf b/tvision/examples/desklogo/tv_logo.mkf
new file mode 100644
index 0000000..9c65cc3
--- /dev/null
+++ b/tvision/examples/desklogo/tv_logo.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tv_logo$(ExIMK)
diff --git a/tvision/examples/desklogo/tv_logo.umk b/tvision/examples/desklogo/tv_logo.umk
new file mode 100644
index 0000000..2eb6e9a
--- /dev/null
+++ b/tvision/examples/desklogo/tv_logo.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tv_logo$(ExOBJ)
+
+LIBRARIES=
+
+tv_logo$(ExEXE):: \
+ ./tv_logo$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tv_logo$(ExOBJ):: tv_logo.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/dlgdsn/codebldr.cc b/tvision/examples/dlgdsn/codebldr.cc
new file mode 100644
index 0000000..be43cbb
--- /dev/null
+++ b/tvision/examples/dlgdsn/codebldr.cc
@@ -0,0 +1,510 @@
+/***************************************************************************
+
+ codebldr.cc - Code builder?
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Heavily modified by Salvador E. Tropea to compile without warnings.
+ Some warnings were in fact bugs.
+ For gcc 2.95.x and then 3.0.1.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <string.h>
+#include <stdio.h>
+#include "dsgobjs.h"
+#include "propedit.h"
+#include "propdlgs.h"
+#include "dsgdata.h"
+#include "consted.h"
+
+#define _commomget_(a, b, c) \
+ ushort a = ((TViewData *)aObj->attributes)->a;\
+ if (a != aObj->defaultData.a)\
+ return buildStr(ctrlName, c, aObj->defaultData.a, a, &b);\
+ else return blank\
+
+static char * blank = "";
+
+static int scrollCount = 0;
+
+typedef char * (*ccGetString)(ushort);
+
+const char * buildStr(const char * ctrlname,
+ const char * alabel,
+ ushort Default,
+ ushort value,
+ ccGetString f)
+{
+ static char buf1[255];
+ static char buf2[100];
+ strcpy(buf1, "");
+ strcpy(buf2, "");
+ if (value == Default) return blank;
+ if ((value & ~Default) != 0)
+ sprintf(buf1, " %s->%s |= (%s);\n", ctrlname, alabel, f(value &~ Default));
+ if ((Default & ~value) != 0)
+ sprintf(buf2, " %s->%s &= ~(%s);\n", ctrlname, alabel, f(Default &~ value));
+ return strcat(buf1, buf2);
+}
+
+const char * getOptions(TDsgObj * aObj, char * ctrlName)
+{
+ _commomget_(options, OptionsStr, "options");
+}
+
+const char * getEventMask(TDsgObj * aObj, char * ctrlName)
+{
+ _commomget_(eventMask, EventMaskStr, "eventMask");
+}
+
+const char * getState(TDsgObj * aObj, char * ctrlName)
+{
+ _commomget_(state, StateStr, "state");
+}
+
+const char * getFlags(TDsgObj * aObj, char * ctrlName)
+{
+ if (aObj->viewType != vtDialog) return blank;
+ ushort flags = ((TDDialogData *)aObj->attributes)->flags;
+ if (flags != aObj->defaultData.flags)
+ return buildStr(ctrlName, "flags",
+ aObj->defaultData.flags, flags, &WindowFlagStr);
+ else return blank;
+}
+
+const char * getGrowMode(TDsgObj * aObj, char * ctrlName)
+{
+ _commomget_(growMode, GrowModeStr, "growMode");
+}
+
+const char * getDragMode(TDsgObj * aObj, char * ctrlName)
+{
+ _commomget_(dragMode, DragModeStr, "dragMode");
+}
+
+const char * getHelpCtx(TDsgObj * aObj, char * ctrlName)
+{
+ ushort i = ((TViewData *)aObj->attributes)->helpCtx;
+ if (i == 0) return blank;
+ return (char *)HelpCtxsList()->getId(i);
+}
+
+const char * getValidator(TDsgObj * aObj, char * ctrlName)
+{
+ if (aObj->viewType != vtInput) return blank;
+
+ static char buf[255];
+ switch (((TDInputData *)aObj->attributes)->validatorType)
+ {
+// case 1: sprintf(strbuf, "vtUserDefined"); break;
+ case 2:
+ sprintf(buf,
+ " (TInputLine *)%s->SetValidator(\n"
+ " new TRangeValidator(%s));\n",
+ ctrlName, ((TDInputData *)aObj->attributes)->validatorData);
+ break;
+ case 3:
+ sprintf(buf,
+ " (TInputLine *)%s->SetValidator(\n"
+ " new TFilterValidator(%s));\n",
+ ctrlName, ((TDInputData *)aObj->attributes)->validatorData);
+ break;
+// case 4: sprintf(strbuf, "vtPictureValidator"); break;
+ default: return blank;
+ }
+ return buf;
+}
+
+const char * getCommand(TDsgObj * aObj)
+{
+ int i;
+
+ if (aObj->viewType==vtButton)
+ {
+ i = ((TDButtonData *)aObj->attributes)->command;
+ return (char *)CommandsList()->getId(i);
+ }
+ return 0;
+}
+
+const char * getPointerName(TDsgObj * aObj)
+{
+ return (char *)&((TViewData *)aObj->attributes)->thisName;
+}
+
+const char * getTextParam(TDsgObj * aObj)
+{
+ static char buf[16383]; // 16k must be enough
+ static char itemstr[100];
+
+ TStringCollection * strs;
+ int i, ic;
+
+ switch (aObj->viewType)
+ {
+ case vtLabel: return ((TDLabelData *)aObj->attributes)->text;
+ case vtStatic: return ((TDStaticData *)aObj->attributes)->text;
+ case vtButton: return ((TDButtonData *)aObj->attributes)->title;
+ case vtDialog: return ((TDDialogData *)aObj->attributes)->title;
+ case vtRadioButton:
+ case vtCheckBox:
+ if ( ((TDClusterData *)aObj->attributes)->items == 0 )
+ strcpy(buf, "0");
+ else
+ {
+ strcpy(buf, "");
+// strs = (TCollection *)((TDClusterData *)aObj->attributes)->items;
+ strs = (TStringCollection *)aObj->dsgGetData();
+ for (i = 0; i < strs->getCount(); i++)
+ {
+ sprintf(itemstr, " TSItem(\x22%s\x22,", (char *)strs->at(i) );
+ if (i == strs->getCount() - 1) strcat(itemstr, " 0 ");
+ else strcat(itemstr, "\n");
+ strcat(buf, itemstr);
+ if (i == strs->getCount() - 1)
+ for (ic = 0; ic <= i; ic++) strcat(buf, ")");
+ }
+ }
+ return buf;
+ default: return blank;
+ }
+}
+
+const char * getRectStr(const TRect& r)
+{
+ static char buf[40];
+ sprintf(buf, "TRect( %i, %i, %i, %i )", r.a.x, r.a.y, r.b.x, r.b.y);
+ return buf;
+}
+
+const char * getDlgRectStr(TDsgObj * aObj, TView * v)
+{
+ if (((TDDialogData *)aObj->attributes)->options & ofCentered == ofCentered)
+ return getRectStr(v->getExtent()); else
+ return getRectStr(v->getBounds());
+}
+
+const char * getDlgViews(TDsgObj * aObj)
+{
+ static char buf[32767]; // 32k must be enough
+
+ int c = ObjectLinker()->getCount();
+
+ strcpy(buf, "");
+ if (c == 0) return buf;
+ for(int i = 0; i < c; i++)
+ buildCode(((TDsgLink *)ObjectLinker()->at(i))->d, buf);
+ return buf;
+}
+
+const char * getDlgVariables(TDsgObj * aObj)
+{
+ TDsgLink * dlink;
+/* TDsgObj * d;
+ TView *f, *w;
+ TDialog *dlg; */
+ TViewData * vd;
+ static char buf[1024];
+ bool hasLinks = false, hasOptions = false, hasValidators = false;
+
+ int c = ObjectLinker()->getCount();
+
+ strcpy(buf, "");
+ if (c == 0) return buf;
+ for(int i = 0; i < c; i++)
+ {
+ dlink = (TDsgLink *)ObjectLinker()->at(i);
+ if (dlink)
+ {
+ vd = (TViewData *)dlink->d->attributes;
+ if (dlink->d->viewType == vtVScroll ||
+ dlink->d->viewType == vtHScroll) scrollCount++;
+ hasLinks = (dlink->d->viewType == vtLabel);
+ hasOptions = (
+ (vd->options != dlink->d->defaultData.options) ||
+ (vd->eventMask != dlink->d->defaultData.eventMask) ||
+ (vd->growMode != dlink->d->defaultData.growMode) ||
+ (vd->dragMode != dlink->d->defaultData.dragMode) ||
+ (vd->state != dlink->d->defaultData.state) ||
+ (vd->helpCtx != 0) );
+ /*hasValidators = (dlink->d->viewType == vtInput &&\
+ ((TDInputData *)dlink->d->attributes)->validatorType > 0);*/
+ }
+ }
+ if (scrollCount > 1) strcat(buf, " TScrollBar * sb1, * sb2;\n"); else
+ if (scrollCount == 1) strcat(buf, " TScrollBar * sb1;\n"); else
+ if (hasLinks || hasOptions) strcat(buf, " TView * control;\n");
+ if (hasLinks) strcat(buf, " TLabel * lb;\n");
+ if ((scrollCount > 0) || hasLinks || hasValidators || hasOptions)
+ strcat(buf, "\n");
+ return buf;
+}
+
+const char * buildScroll(TDsgLink * Link)
+{
+ char hs[5], vs[5];
+ static char tmp[255];
+ strcpy(tmp, blank);
+
+ if (Link == 0) return tmp;
+
+ strcpy(vs, (scrollCount > 1) ? "sb2" : "sb1");
+ strcpy(hs, "sb1");
+ if (Link->d->viewType == vtVScroll)
+ sprintf(tmp, " d->insert( %s = new TScrollBar( %s ) );\n", vs, getRectStr( Link->v->getBounds() ) );
+ else
+ sprintf(tmp, " d->insert( %s = new TScrollBar( %s ) );\n", hs, getRectStr( Link->v->getBounds() ) );
+ return tmp;
+}
+
+const char * ifScroll(TDsgObj * aObj)
+{
+ TDsgLink * l;
+ static char tmp[255];
+ strcpy(tmp, blank);
+
+ if (aObj->viewType == vtListBox)
+ {
+ l = ObjectLinker()->scrollFind(
+ ((TDListBoxData *)aObj->attributes)->scrollBar);
+ return buildScroll(l);
+ }
+ else if (aObj->viewType == vtMemo)
+ {
+ l = ObjectLinker()->scrollFind(
+ ((TDMemoData *)aObj->attributes)->hScroll);
+ strcpy(tmp, buildScroll(l));
+ l = ObjectLinker()->scrollFind(
+ ((TDMemoData *)aObj->attributes)->vScroll);
+ strcat(tmp, buildScroll(l));
+ }
+ //else return blank;
+ return blank;
+}
+
+const char * ifLabel(TDsgObj * aObj)
+{
+ static char tmp[255];
+ TDsgLink * l;
+
+ strcpy(tmp, blank);
+
+ l = ObjectLinker()->linkFind(((TViewData*)aObj->attributes)->thisName);
+ if (l)
+ {
+ sprintf(tmp,
+ " d->insert( new TLabel( %s, \x22%s\x22, control ) );\n",
+ getRectStr( l->v->getBounds() ),
+ ((TDLabelData *)l->d->attributes)->text
+ );
+ }
+ return tmp;
+}
+
+void viewCreate(TDsgObj * aObj, const char * aConstructor, char * to)
+{
+ static char buf[1023];
+ char ctrlname[30];
+
+ strcpy(buf, "");
+
+// if (aObj->viewType == vtHScroll) strcpy(ctrlname, "sb1"); else
+// if (aObj->viewType == vtVScroll) strcpy(ctrlname, (scrollCount > 1) ? "sb2" : "sb1"); else
+// if (aObj->viewType == vtLabel) strcpy(ctrlname, "lb");
+/* else*/strcpy(ctrlname, "control");
+
+ bool directInsert = false;
+
+ directInsert = ( getOptions(aObj, 0) == blank &&
+ getEventMask(aObj, 0) == blank &&
+ getState(aObj, 0) == blank &&
+ getGrowMode(aObj, 0) == blank &&
+ getDragMode(aObj, 0) == blank &&
+ getHelpCtx(aObj, 0) == blank /*&&
+ aObj->viewType != vtHScroll &&
+ aObj->viewType != vtVScroll */);
+
+/* if (!directInsert)
+ { */
+ if (ObjectLinker()->linkFind( ((TViewData *)aObj->attributes)->thisName ))
+ directInsert = false;
+ if (aObj->viewType == vtMemo &&
+ ( strlen(((TDMemoData *)aObj->attributes)->hScroll) != 0 ||
+ strlen(((TDMemoData *)aObj->attributes)->vScroll) != 0 ) )
+ directInsert = false;
+ if (aObj->viewType == vtListBox &&
+ ( strlen(((TDListBoxData *)aObj->attributes)->scrollBar) != 0 ) )
+ directInsert = false;
+/* } */
+
+ if (directInsert)
+ sprintf(buf, " d->insert( %s );\n", aConstructor);
+ else
+ {
+ sprintf(buf, "%s %s = %s;\n%s%s%s%s%s%s%s%s d->insert( %s );\n",
+ ifScroll(aObj),
+ ctrlname,
+ aConstructor,
+ getOptions(aObj, ctrlname),
+ getEventMask(aObj, ctrlname),
+ getState(aObj, ctrlname),
+ getGrowMode(aObj, ctrlname),
+ getDragMode(aObj, ctrlname),
+ getHelpCtx(aObj, ctrlname),
+ getValidator(aObj, ctrlname),
+ ifLabel(aObj),
+ ctrlname );
+ }
+ strcat(to, buf);
+}
+
+
+const char * buildCode(TDsgObj * aObj, char * buffer)
+{
+ TView * v;
+ char tmp[65535];
+ char viewConstructor[1023];
+ char hs[5], vs[5];
+ char *hi, *vi;
+ const char * var;
+
+ strcpy(hs, "NULL");
+ strcpy(vs, "NULL");
+ strcpy(tmp, "");
+ strcpy(viewConstructor, "");
+
+ if (aObj->viewType == vtLabel ||
+ aObj->viewType == vtVScroll ||
+ aObj->viewType == vtHScroll) return 0;
+
+ if (aObj->viewType == vtDialog)
+ {
+ v = DialogEditor();
+// ObjectLinker()->sortForBuild();
+ ObjectLinker()->doReOrder();
+ }
+ else
+ v = ObjectLinker()->dsgObjFind(aObj)->v;
+
+ switch(aObj->viewType)
+ {
+//- User -------------------------------------------------------------------
+ case vtOther: break;
+ sprintf(viewConstructor, "new %s( %s )",
+ ((TViewData *)aObj->attributes)->className,
+ getRectStr( v->getBounds()) );
+ viewCreate(aObj, viewConstructor, tmp);
+ break;
+/*- Label ------------------------------------------------------------------
+ case vtLabel:
+ if (((TDLabelData *)aObj->attributes)->link < 0) return buffer;
+ sprintf(viewConstructor, "new TLabel( %s, \x22%s\x22, control )",
+ getRectStr( v->getBounds() ), getTextParam(aObj) );
+ viewCreate(aObj, viewConstructor, tmp);
+ break; */
+//- InputLine --------------------------------------------------------------
+ case vtInput:
+ sprintf(viewConstructor, "new TInputLine( %s, %i )",
+ getRectStr( v->getBounds() ),
+ ((TDInputData *)aObj->attributes)->maxLen );
+ viewCreate(aObj, viewConstructor, tmp);
+ break;
+//- Memo -------------------------------------------------------------------
+ case vtMemo:
+ hi = ((TDMemoData *)aObj->attributes)->hScroll;
+ vi = ((TDMemoData *)aObj->attributes)->vScroll;
+ if (strcmp("", hi) != 0) strcpy(hs, "sb1");
+ if (strcmp("", vi) != 0)
+ strcpy(vs, (scrollCount > 1) ? "sb2" : "sb1");
+ sprintf(viewConstructor, "new TMemo( %s, %s, %s, NULL, %i )",
+ getRectStr( v->getBounds() ), // h s ind bs
+ hs, vs, ((TDMemoData *)aObj->attributes)->bufSize );
+ viewCreate(aObj, viewConstructor, tmp);
+ break;
+//- StaticText -------------------------------------------------------------
+ case vtStatic:
+ sprintf(viewConstructor, "new TStaticText( %s, \x22%s\x22 )",
+ getRectStr( v->getBounds() ), getTextParam(aObj) );
+ viewCreate(aObj, viewConstructor, tmp);
+ break;
+//- Button -----------------------------------------------------------------
+ case vtButton:
+ sprintf(viewConstructor, "new TButton( %s, \x22%s\x22, %s, %s )",
+ getRectStr( v->getBounds() ), getTextParam(aObj),
+ getCommand(aObj), ButtonFlagStr(
+ ((TDButtonData *)aObj->attributes)->flags) );
+ viewCreate(aObj, viewConstructor, tmp);
+ break;
+//- ListBoxes --------------------------------------------------------------
+ case vtListBox:
+ vi = ((TDListBoxData *)aObj->attributes)->scrollBar;
+ if (strcmp("", vi) != 0)
+ strcpy(vs, (scrollCount > 1) ? "sb2" : "sb1");
+ sprintf(viewConstructor, "new TListBox( %s, %i, %s )",
+ getRectStr( v->getBounds() ),
+ ((TDListBoxData *)aObj->attributes)->columns, vs);
+ viewCreate(aObj, viewConstructor, tmp);
+ break;
+//- RadioButtons -----------------------------------------------------------
+ case vtRadioButton:
+ sprintf(viewConstructor, "new TRadioButtons( %s, \n%s )",
+ getRectStr( v->getBounds() ), getTextParam(aObj) );
+ viewCreate(aObj, viewConstructor, tmp);
+ break;
+//- CheckBoxes -------------------------------------------------------------
+ case vtCheckBox:
+ sprintf(viewConstructor, "new TCheckBoxes( %s, \n%s )",
+ getRectStr( v->getBounds() ), getTextParam(aObj) );
+ viewCreate(aObj, viewConstructor, tmp);
+ break;
+/*- ScrollBar --------------------------------------------------------------
+ case vtVScroll:
+ sprintf(viewConstructor, "new TScrollBar( %s )", getRectStr( v->getBounds() ) );
+ viewCreate(aObj, viewConstructor, tmp);
+ break;
+ case vtHScroll:
+ sprintf(viewConstructor, "new TScrollBar( %s )", getRectStr( v->getBounds() ) );
+ viewCreate(aObj, viewConstructor, tmp);
+ break; */
+//- Dialog -----------------------------------------------------------------
+ case vtDialog:
+ var = getDlgVariables(aObj);
+ sprintf(tmp, "TDialog * build%s()\n{\n"
+ "%s TDialog * d = new TDialog( %s, \x22%s\x22 );\n\n"
+ "%s%s%s%s%s%s%s%s\n d->selectNext(True);\n return d;\n}\n\n",
+ getPointerName(aObj),
+ var, //getDlgVariables(aObj),
+ getDlgRectStr(aObj, v),
+ getTextParam(aObj),
+ getOptions(aObj, "d"),
+ getEventMask(aObj, "d"),
+ getState(aObj, "d"),
+ getGrowMode(aObj, "d"),
+ getDragMode(aObj, "d"),
+ getHelpCtx(aObj, "d"),
+ getFlags(aObj, "d"),
+ getDlgViews(aObj) );
+ scrollCount = 0;
+ break;
+ default: return buffer;
+ }
+ if (buffer)
+ {
+ strcat(buffer, tmp);
+ return buffer;
+ } else return newStr(tmp);
+}
+#undef _buildscroll_
+#undef _commomget_
diff --git a/tvision/examples/dlgdsn/consted.cc b/tvision/examples/dlgdsn/consted.cc
new file mode 100644
index 0000000..d1270fe
--- /dev/null
+++ b/tvision/examples/dlgdsn/consted.cc
@@ -0,0 +1,461 @@
+/***************************************************************************
+
+ consted.cc - Implements the constant listers and its editors
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Heavily modified by Salvador E. Tropea to compile without warnings.
+ Some warnings were in fact bugs.
+ For gcc 2.95.x and then 3.0.1.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#define DEFAULT 0
+#define BY_ID 1
+#define BY_VALUE 2
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#define Uses_TDialog
+#define Uses_TButton
+#define Uses_TRadioButtons
+#define Uses_TSItem
+#define Uses_TLabel
+#define Uses_TListBox
+#define Uses_TScrollBar
+#define Uses_TCollection
+#define Uses_TEvent
+#define Uses_TCommands
+#define Uses_TFilterValidator
+#define Uses_TInputLine
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_MsgBox
+#define Uses_TParamText
+
+#include <tv.h>
+
+#include "consted.h"
+
+const ushort
+ cmEdit = 200,
+ cmAdd = 201,
+ cmDel = 202,
+ cmCClear = 203;
+
+extern int execDialog(TDialog *, void *);
+
+static TConstCollection * CommandList;
+static TConstCollection * HelpCtxList;
+
+typedef struct TConstData
+{
+ char * Id;
+ int Value;
+ int Order;
+ bool ReadOnly;
+};
+
+TDialog * ConstInputDlg(TValidator * aValid)
+{
+ TDialog * d = new TDialog( TRect(0, 0, 50, 8), __("Values editor") );
+ TInputLine * ip_id = new TInputLine(TRect (10, 2, 48, 3), 50);
+ TInputLine * ip_vl = new TInputLine(TRect (10, 3, 17, 4), 5);
+ if (aValid) ip_vl->setValidator(aValid);
+ d->insert(new TLabel( TRect(1, 2, 10, 3), _("~I~dent:"), ip_id ) );
+ d->insert(ip_id);
+ d->insert(new TLabel( TRect(1, 3, 10, 4), _("~V~alue:"), ip_id ) );
+ d->insert(ip_vl);
+ d->insert(new TButton( TRect(28, 5, 38, 7), __("~O~k"), cmOK, bfDefault) );
+ d->insert(new TButton( TRect(38, 5, 48, 7), __("~C~ancel"), cmCancel, 0) );
+ d->options |= ofCentered;
+ d->selectNext(False);
+ return d;
+}
+
+
+void TIntConstListBox::getText(char *dest, ccIndex item, short maxChars)
+{
+ char * c = ( (TConstData *)(items->at(item)) )->Id;
+ strncpy(dest, c, maxChars);
+ dest[maxChars] = 0;
+}
+
+
+void TIntConstListBox::setData(void * data)
+{
+ TListBoxRec * p = (TListBoxRec *)data;
+ items = (TConstCollection *)p->items;
+ if (items != 0) setRange( items->getCount() );
+ else setRange( 0 );
+ if (p->selection < 0) p->selection = 0;
+ if (range > 0) focusItem(p->selection);
+ drawView();
+}
+
+void TIntConstListBox::getData(void * data)
+{
+ TListBoxRec * p = (TListBoxRec *)data;
+ TConstCollection * i = (TConstCollection *)items;
+ p->items = items;
+ p->selection = ((TConstData *)(i->at(focused)))->Value;
+}
+
+TConstCollection::TConstCollection(const char * aListName):
+ TCollection(0, 1)
+{
+ listName = newStr(aListName);
+ sortmode = -1;
+}
+
+TConstCollection::~TConstCollection()
+{
+ delete[] listName;
+}
+
+void TConstCollection::change(int index, const char * Ident, int Value)
+{
+ if (count > 0 && index < count && !((TConstData *)at(index))->ReadOnly )
+ {
+ delete[] ((TConstData *)at(index))->Id;
+ ((TConstData *)at(index))->Id = newStr(Ident);
+ ((TConstData *)at(index))->Value = Value;
+ }
+}
+
+void TConstCollection::add(const char * Ident, int Value, bool IsReadOnly)
+{
+ TConstData * item = (TConstData *)calloc(1, sizeof(TConstData));
+ item->Id = newStr(Ident);
+ item->Value = Value;
+ item->Order = count;
+ item->ReadOnly = IsReadOnly;
+ sort(DEFAULT);
+ insert(item);
+}
+
+
+static Boolean identMatch(void * item, void * ident)
+{
+ return (strcmp(((TConstData *)item)->Id, (char *)ident) == 0);
+}
+
+static Boolean valueMatch(void * item, void *value)
+{
+ return (((TConstData *)item)->Value == (int)value);
+}
+
+int TConstCollection::getIndex(char * Ident)
+{
+ void * i = firstThat(&identMatch, (void *)Ident);
+ if (i) return indexOf(i); else return -1;
+}
+
+int TConstCollection::getIndex(int Value)
+{
+ void * i = firstThat(&valueMatch, (void *)&Value);
+ if (i) return indexOf(i); else return -1;
+}
+
+char * TConstCollection::getId(int Value)
+{
+ if (getIndex(Value)!=-1) return ((TConstData*)at(getIndex(Value)))->Id;
+ else return 0;
+}
+
+int TConstCollection::getValue(char * Ident)
+{
+ if (getIndex(Ident)!=-1) return ((TConstData*)at(getIndex(Ident)))->Value;
+ else return 0;
+}
+
+void TConstCollection::freeItem(void * item)
+{
+ delete[] ((TConstData *)item)->Id;
+ ((TConstData *)item)->Id = 0;
+ free(item);
+}
+
+static int compareOrder(const void * key1, const void * key2)
+{
+ TConstData * v1 = (TConstData *)key1;
+ TConstData * v2 = (TConstData *)key2;
+ return (v1->Order > v2->Order) - (v1->Order < v2->Order);
+}
+
+static int compareId(const void * key1, const void * key2)
+{
+ TConstData * v1 = (TConstData *)key1;
+ TConstData * v2 = (TConstData *)key2;
+ return strcmp(v1->Id, v2->Id);
+}
+
+static int compareValue(const void * key1, const void * key2)
+{
+ TConstData * v1 = (TConstData *)key1;
+ TConstData * v2 = (TConstData *)key2;
+ return (v1->Value > v2->Value) - (v1->Value < v2->Value);
+}
+
+void TConstCollection::sort(int mode)
+{
+ if (mode == sortmode) return;
+ sortmode = mode;
+ switch (mode)
+ {
+ case DEFAULT : qsort(items, count, sizeof(void *), compareOrder); break;
+ case BY_ID : qsort(items, count, sizeof(void *), compareId); break;
+ case BY_VALUE: qsort(items, count, sizeof(void *), compareValue);
+ }
+}
+
+
+TConstEdit::TConstEdit():
+ TWindowInit(&TConstEdit::initFrame),
+ TDialog( TRect(0, 0, 45, 16) , __("Constants") )
+{
+ TScrollBar * sb;
+
+ options |= ofCentered;
+
+ sb = new TScrollBar(TRect(30, 2, 31, 13));
+ List = new TIntConstListBox(TRect(2, 2, 30, 13), 1, sb);
+ LVal = new TParamText( TRect(33, 12, 43, 14) );
+ LVal->options |= ofFramed;
+ EditBtn = new TButton(TRect(31, 2, 43, 4), __("~E~dit"), cmEdit, bfBroadcast );
+ AddBtn = new TButton(TRect(31, 4, 43, 6), __("~A~dd"), cmAdd, bfBroadcast );
+ ClearBtn = new TButton(TRect(31, 6, 43, 8), __("C~l~ear"), cmCClear, bfBroadcast );
+ DelBtn = new TButton(TRect(31, 8, 43, 10), __("~D~elete"), cmDel, bfBroadcast );
+ SortRB = new TRadioButtons(TRect(2, 14, 31, 15), new TSItem(__("None"),
+ new TSItem(__("Id"),
+ new TSItem(__("Value"), 0))));
+ insert(sb);
+ insert(new TLabel( TRect(1, 1, 15, 2), _("~V~alue list:"), List ) );
+ insert(LVal);
+ insert(List);
+ insert(new TLabel( TRect(1, 13, 12, 14), _("~O~rder by:"), SortRB ) );
+ insert(SortRB);
+ insert(EditBtn);
+ insert(AddBtn);
+ insert(ClearBtn);
+ insert(DelBtn);
+ LVal->setText("Value:\n%s", "<empty>");
+ cList = 0;
+ EditBtn->makeDefault(True);
+ selectNext(False);
+}
+
+
+void TConstEdit::Edit(TConstCollection * AItems)
+{
+ TListBoxRec rec;
+
+ if (!AItems) return;
+ delete[] title;
+
+ rec.items = AItems;
+ rec.selection = 0;
+
+ title = newStr(AItems->listName);
+ AItems->sort(DEFAULT);
+ List->setData(&rec);
+ List->focused = 0;
+
+ AddBtn->setState(sfDisabled, false);
+ ClearBtn->setState(sfDisabled, false);
+ DelBtn->setState(sfDisabled, false);
+ cList = AItems;
+ LVal->setText("Value:\n%s", "<empty>");
+ TProgram::deskTop->insert(this);
+}
+
+
+void TConstEdit::handleEvent(TEvent& event)
+{
+ ushort sort;
+ int tmp=0;
+ TDialog * dlg;
+
+ struct {
+ char id_value[50];
+ char value[5];
+ } datarec;
+
+ TDialog::handleEvent(event);
+
+ if (!cList) return;
+
+ if (event.what == evBroadcast)
+ switch(event.message.command)
+ {
+ case cmListItemFocused:
+ if ( cList )
+ {
+ tmp = ((TConstData *)(cList->at(List->focused)))->Value;
+ LVal->setText("Value:\n%i (%x)", tmp, tmp);
+ }
+ break;
+ case cmListItemSelected:
+ sort = cList->sortmode;
+ cList->sort(BY_VALUE);
+ if ( (cList->getCount() > 0) && (List->focused >= 0) )
+ {
+ tmp = ((TConstData *)(cList->at(List->focused)))->Value;
+ sprintf(datarec.value, "%i", tmp);
+ strcpy(datarec.id_value,
+ ((TConstData *)(cList->at(List->focused)))->Id );
+ }
+ dlg = ConstInputDlg(new TFilterValidator("0123456789-"));
+ if ( execDialog(dlg, &datarec) == cmOK )
+ cList->change( List->focused, datarec.id_value,
+ atoi(datarec.value) ); else cList->sort(sort);
+ List->drawView();
+ clearEvent(event);
+ break;
+ case cmClusterMovedTo:
+ case cmClusterPress:
+ ((TRadioButtons *)event.message.infoPtr)->getData(&sort);
+ cList->sort(sort);
+ List->drawView();
+ clearEvent(event);
+ break;
+ case cmEdit:
+ if (cList->getCount() == 0)
+ {
+ event.message.command = cmAdd;
+ putEvent(event);
+ clearEvent(event);
+ }
+ else
+ {
+ AddBtn->makeDefault(False);
+ EditBtn->makeDefault(True);
+ event.message.command = cmListItemSelected;
+ putEvent(event);
+ clearEvent(event);
+ }
+ break;
+ case cmAdd:
+ sort = cList->sortmode;
+ cList->sort(BY_VALUE);
+ memset(&datarec, 0, sizeof(datarec));
+ if ((cList->getCount() > 0) && (List->focused >= 0))
+ {
+ tmp = ( (TConstData *)(cList->at(cList->getCount()-1)) )->Value;
+ tmp++;
+ sprintf(datarec.value, "%i", tmp);
+ }
+ dlg = ConstInputDlg(new TFilterValidator("0123456789-"));
+ if ( execDialog(dlg, &datarec) == cmOK )
+ {
+ cList->add( datarec.id_value, atoi(datarec.value) );
+ List->setRange(List->range + 1);
+ EditBtn->makeDefault(False);
+ AddBtn->makeDefault(True);
+ List->focusItem( cList->getCount() - 1 );
+ }
+ else cList->sort(sort);
+ List->drawView();
+ clearEvent(event);
+ break;
+ case cmDel:
+ if ( messageBox(__("Are you sure ?"), mfYesNoCancel) == cmYes )
+ {
+ cList->atFree(List->focused);
+ clearEvent(event);
+ cList->pack();
+ List->setRange(List->range - 1);
+ List->drawView();
+ }
+ break;
+ case cmCClear:
+ if ( messageBox(__("Are you sure ?"), mfYesNoCancel) == cmYes )
+ {
+ cList->freeAll();
+ cList->pack();
+ List->setRange(0);
+ List->drawView();
+ }
+ clearEvent(event);
+ break;
+ }
+}
+
+
+TConstCollection * InitCommandLister()
+{
+ TConstCollection * rst = new TConstCollection(_("Commands"));
+ rst->add("cmValid", 0, true);
+ rst->add("cmQuit", 1, true);
+ rst->add("cmError", 2, true);
+ rst->add("cmMenu", 3, true);
+ rst->add("cmClose", 4, true);
+ rst->add("cmZoom", 5, true);
+ rst->add("cmResize", 6, true);
+ rst->add("cmNext", 7, true);
+ rst->add("cmPrev", 8, true);
+ rst->add("cmHelp", 9, true);
+ rst->add("cmOK", 10, true);
+ rst->add("cmCancel", 11, true);
+ rst->add("cmYes", 12, true);
+ rst->add("cmNo", 13, true);
+ rst->add("cmDefault", 14, true);
+ rst->add("cmCut", 20, true);
+ rst->add("cmCopy", 21, true);
+ rst->add("cmPaste", 22, true);
+ rst->add("cmUndo", 23, true);
+ rst->add("cmClear", 24, true);
+ rst->add("cmTile", 25, true);
+ rst->add("cmCascade", 26, true);
+ rst->add("cmReceivedFocus", 50, true);
+ rst->add("cmReleasedFocus", 51, true);
+ rst->add("cmCommandSetChanged", 52, true);
+ rst->add("cmScrollBarChanged", 53, true);
+ rst->add("cmScrollBarClicked", 54, true);
+ rst->add("cmSelecteWindowNum", 55, true);
+ rst->add("cmListItemSelected", 56, true);
+ rst->add("cmClosingWindow", 57, true);
+ rst->add("cmClusterMovedTo", 58, true);
+ rst->add("cmClusterPress", 59, true);
+ rst->add("cmRecordHistory", 60, true);
+ rst->add("cmListItemFocused", 61, true);
+ rst->add("cmGrabDefault", 62, true);
+ rst->add("cmReleaseDefault", 63, true);
+ return rst;
+}
+
+TConstCollection * InitHelpCtxLister()
+{
+ TConstCollection * rst = new TConstCollection(_("Help contexts"));
+ rst->add("hcNoContext", 0, true);
+ return rst;
+}
+
+TConstCollection * CommandsList()
+{
+ if (!CommandList) CommandList = InitCommandLister();
+ return CommandList;
+}
+
+TConstCollection * HelpCtxsList()
+{
+ if (!HelpCtxList) HelpCtxList = InitHelpCtxLister();
+ return HelpCtxList;
+}
+
+#undef DEFAULT
+#undef BY_ID
+#undef BY_VALUE
diff --git a/tvision/examples/dlgdsn/consted.h b/tvision/examples/dlgdsn/consted.h
new file mode 100644
index 0000000..5d79035
--- /dev/null
+++ b/tvision/examples/dlgdsn/consted.h
@@ -0,0 +1,91 @@
+/***************************************************************************
+
+ consted.h - Prototypes for constant listers and its editors
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Modified by Salvador E. Tropea to compile without warnings.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#define Uses_TDialog
+#define Uses_TStringCollection
+#define Uses_TEvent
+#define Uses_TButton
+#define Uses_TListBox
+#define Uses_TRadioButtons
+#define Uses_TParamText
+
+#include <tv.h>
+
+class ipstream;
+class opstream;
+
+
+class TConstCollection: public TCollection
+{
+public:
+ TConstCollection(const char * aListName);
+ ~TConstCollection();
+ void add(const char * Ident, int Value, bool IsReadOnly = false);
+ void change(int index, const char * Ident, int Value);
+ int getIndex(char * Ident);
+ int getIndex(int Value);
+ char * getId(int Value);
+ int getValue(char * Ident);
+ virtual void freeItem(void * item);
+ void sort(int mode);
+ char * listName;
+ int sortmode;
+ virtual void * readItem(ipstream&) {return 0;};
+ virtual void writeItem(void *, opstream&) { };
+};
+
+
+class TIntConstListBox: public TListBox
+{
+ TConstCollection * items;
+public:
+ TIntConstListBox(const TRect& bounds,
+ ushort aNumCols, TScrollBar * aScrollBar):
+ TListBox(bounds, aNumCols, aScrollBar) { };
+ virtual void getText(char *dest, ccIndex item, short maxChars);
+ virtual void setData(void * data);
+ virtual void getData(void * data);
+};
+
+class TConstEdit: public TDialog
+{
+ TConstCollection * Items;
+ TButton * EditBtn;
+ TButton * AddBtn;
+ TButton * ClearBtn;
+ TButton * DelBtn;
+ TIntConstListBox * List;
+ TRadioButtons * SortRB;
+ TConstCollection * cList;
+ TParamText * LVal;
+ int Select(TConstCollection * AItems, int32 Current);
+public:
+ TConstEdit();
+ void Edit(TConstCollection * AItems);
+// int Select(TConstCollection * AItems, int Current);
+ int Select(TConstCollection * AItems, char * Current);
+ virtual void handleEvent(TEvent& event);
+};
+
+TConstCollection * CommandsList();
+TConstCollection * HelpCtxsList();
+
+
diff --git a/tvision/examples/dlgdsn/dsgdata.h b/tvision/examples/dlgdsn/dsgdata.h
new file mode 100644
index 0000000..9736a97
--- /dev/null
+++ b/tvision/examples/dlgdsn/dsgdata.h
@@ -0,0 +1,136 @@
+/***************************************************************************
+
+ dsgdata.h - Editable structs prototypes for editable classes
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#if !defined(_DSGDATA_HPP_)
+#define _DSGDATA_HPP_
+
+#define MAX_LABEL_LENGTH 30
+#define MAX_TITLE_LENGTH 62
+
+typedef char TNameStr[MAX_LABEL_LENGTH];
+typedef char TTitleStr[MAX_TITLE_LENGTH];
+
+typedef struct TPoint;
+
+#define _viewdata_() \
+ TPoint origin; /* 8 */ \
+ TPoint size; /* 8 */ \
+ TNameStr className; /* 30 */ \
+ TNameStr thisName; /* 30 */ \
+ ushort options; /* 2 */ \
+ ushort eventMask; /* 2 */ \
+ ushort state; /* 2 */ \
+ ushort growMode; /* 2 */ \
+ ushort dragMode; /* 2 */ \
+ ushort helpCtx /* 2 */ \
+// 88 % 4 = 0
+typedef struct TDefaultData
+{
+ ushort options;
+ ushort eventMask;
+ ushort state;
+ ushort growMode;
+ ushort dragMode;
+ ushort helpCtx;
+ ushort flags;
+};
+
+typedef struct TViewData // Wrapper struct
+{
+ _viewdata_();
+};
+
+typedef struct TDsgObjData
+{
+ _viewdata_();
+ int tabOrder;
+};
+
+typedef struct TDDialogData
+{
+ _viewdata_();
+ TTitleStr title;
+ ushort flags;
+};
+
+typedef struct TDInputData
+{
+ _viewdata_();
+ int tabOrder;
+ int maxLen;
+ ushort validatorType;
+ TNameStr validatorData;
+};
+
+typedef struct TDLabelData
+{
+ _viewdata_();
+ TNameStr text;
+ TNameStr link;
+};
+
+typedef struct TDMemoData
+{
+ _viewdata_();
+ int tabOrder;
+// uint32 bufSize;
+// TNameStr Indicator;
+ TNameStr hScroll;
+ TNameStr vScroll;
+ uint32 bufSize;
+};
+
+typedef struct TDStaticData
+{
+ _viewdata_();
+ char * text;
+};
+
+typedef struct TDButtonData
+{
+ _viewdata_();
+ int tabOrder;
+ TNameStr title;
+ ushort command;
+ ushort flags;
+};
+
+typedef struct TDClusterData
+{
+ _viewdata_();
+ int tabOrder;
+ void * items;
+};
+
+typedef struct TDListBoxData
+{
+ _viewdata_();
+ int tabOrder;
+ short columns;
+ TNameStr scrollBar;
+};
+
+#define TDCheckData TDClusterData
+#define TDRadioData TDClusterData
+#define TDVScrollData TViewData
+#define TDHScrollData TViewData
+
+#undef _viewdata_
+
+#endif // _DSGDATA_HPP_
diff --git a/tvision/examples/dlgdsn/dsgobjs.cc b/tvision/examples/dlgdsn/dsgobjs.cc
new file mode 100644
index 0000000..3f74c4d
--- /dev/null
+++ b/tvision/examples/dlgdsn/dsgobjs.cc
@@ -0,0 +1,1504 @@
+/***************************************************************************
+
+ dsgobjs.cc - Implements editable classes
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Heavily modified by Salvador E. Tropea to compile without warnings.
+ Some warnings were in fact bugs.
+ For gcc 2.95.x and then 3.0.1.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#define Uses_string
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_iostream
+
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_TKeys
+#define Uses_TSItem
+#define Uses_TEventQueue
+#define Uses_MsgBox
+#define Uses_TStringCollection
+#define Uses_ofpstream
+#define Uses_ifpstream
+
+#include <tv.h>
+
+#include "dsgobjs.h"
+#include "propedit.h"
+#include "dsgdata.h"
+#include "strmoper.h"
+
+static int vtAttrSize[vtDialog + 1] = { sizeof(TDsgObjData),
+ sizeof(TDLabelData),
+ sizeof(TDInputData),
+ sizeof(TDMemoData),
+ sizeof(TDStaticData),
+ sizeof(TDButtonData),
+ sizeof(TDListBoxData),
+ sizeof(TDClusterData),
+ sizeof(TDClusterData),
+ sizeof(TViewData),
+ sizeof(TViewData),
+ sizeof(TDDialogData) };
+
+static char * TheClassName[vtDialog + 1] = { "TUser",
+ "TLabel",
+ "TInputLine",
+ "TMemo",
+ "TStaticText",
+ "TButton",
+ "TListBox",
+ "TRadioButtons",
+ "TCheckBoxes",
+ "TScrollBar",
+ "TScrollBar",
+ "TDialog" };
+
+
+#if 0 // A useful visual map of AppPalette indexed by dialog and app
+
+/* The palette of an internal view is mapped in the palette of a group view
+ which owns it.
+ if you need to make an internal view visible out of the group for what
+ it was designed then you must to redefine the getPalette() method to
+ return a TPalette that is its real palette index in the global palette. */
+
+// app "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ Attr "\x71\x70\x78\x74\x20\x28\x24\x17\x1F\x1A\x31\x31\x1E\x71\x00"
+// app "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+ Attr "\x37\x3F\x3A\x13\x13\x3E\x21\x00\x70\x7F\x7A\x13\x13\x70\x7F\x00"
+
+// Below the indices of our interest
+
+// app "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+# dlg "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
+ Attr "\x70\x7F\x7A\x13\x13\x70\x70\x7F\x7E\x20\x2B\x2F\x78\x2E\x70\x30"
+
+// app "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+# dlg "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
+ Attr "\x3F\x3E\x1F\x2F\x1A\x20\x72\x31\x31\x30\x2F\x3E\x31\x13\x00\x00"
+
+#endif
+
+// Macros *******************************************************************
+
+// Define the palette for editable objects using global index
+#define cpDragLabel "\x26\x27\x28\x28"
+#define cpDragInput "\x32\x33\x34\x35"
+#define cpDragMemo "\x39\x3a"
+#define cpDragStatic "\x25"
+#define cpDragBtn "\x29\x2a\x2b\x2c\x2d\x2d\x2d\x2e"
+#define cpDragLB "\x39\x39\x3a\x3b\x3c"
+#define cpDragCluster "\x2f\x30\x31\x31\x3e"
+#define cpDragScroll "\x23\x24\x24"
+
+// The palette to the selection state. Attr to this index (0x20) was changed
+// in the app constructor. See freedsgn.cpp.TFreeDsgnApp::TFreeDsgnApp
+#define cpSelLabel "\x20\x20\x20\x20"
+#define cpSelInput "\x20\x20\x20\x20"
+#define cpSelMemo "\x20\x20"
+#define cpSelStatic "\x20"
+#define cpSelBtn "\x20\x20\x20\x0d\x20\x20\x20\x0f"
+#define cpSelLB "\x20\x20\x20\x20\x20"
+#define cpSelCluster "\x20\x20\x20\x20\x20"
+#define cpSelScroll "\x20\x20\x20"
+
+// Answers to ImOwned(TView *). Used to decide somethings
+#define ByToolDlg 0
+#define ByDesktop 1
+#define ByEditor 2
+
+// This state flags maybe removed in future
+#define sfEditing 0x1000
+#define sfLoading 0x2000
+
+// Commom event handler code fragment for editable classes
+#define _h_(a)\
+ if (ImOwned(this) == ByToolDlg) \
+ { if (!HandleEventOnToolDlg(this, event, viewType)) \
+ a::handleEvent(event); } \
+ else if (ImOwned(this) == ByEditor) \
+ { if (!HandleEventOnEditor(this, event, viewType)) a::handleEvent(event); }
+
+// Common getpalette function code fragment for editable classes
+// SET: Palettes are supposed to be constants, so they should call members
+// like here
+#define _p_(a,b,c) \
+ static TPalette palette( a, sizeof(a) - 1); \
+ static TPalette pal_sel( b, sizeof(b) - 1); \
+ if (owner == TProgram::deskTop) return palette; \
+ else return c::getPalette();
+/* else if ((owner != TProgram::deskTop) && (getState(sfSelected))) \
+ return pal_sel; else return c::getPalette();*/
+
+// Commom changeBounds code fragment for editable classes
+#define _chgbnds_(a) a::changeBounds(bounds); \
+ setPos(origin, size); ObjEdit->CLY_Redraw(); \
+ EditDlg->modified = true;
+
+// Commom setState code fragment for all editable classes
+#define _setstate_(t) do { \
+ t::setState(aState, enable); \
+ if (aState & sfEditing && enable) \
+/*{*/ ObjectLinker()->add(this, this); /* <- was DsgObj */ \
+/* setViewData((TDsgObjData &)*attributes); } */ \
+ if (aState & (sfFocused | sfSelected) ) \
+ { if (owner != EditDlg) { drawView(); return; } \
+ if (enable) ObjEdit->setObjData(this); drawView(); } } while(0)
+
+// Commom shutDown code fragment for all editable classes
+#define _shutdown_(a) /* delete dsgObj; */ \
+/* TDsgLink * l = ObjectLinker()->viewFind(this); */ \
+/* if (l) delete l->d; */ \
+ a::shutDown()
+
+// Static *******************************************************************
+
+// This always points to Current Tool Dialog and Editor Dialog
+static TDDialog * EditDlg;
+static TDialog * ToolDlg;
+static TObjEdit * ObjEdit;
+
+// To help keyboard driven object positionment
+static TView * FloatingView;
+static bool keyPut = false;
+
+// Counters used to define Labels
+static int LabelCount = 0;
+static int InputCount = 0;
+static int MemoCount = 0;
+static int StaticCount = 0;
+static int ButtonCount = 0;
+static int ListBoxCount = 0;
+static int RadioCount = 0;
+static int CheckCount = 0;
+static int VScrollCount = 0;
+static int HScrollCount = 0;
+static int UserCount = 0;
+static int DialogCount = 0;
+static int TabOrder = 0;
+
+///extern TLinkList * ObjLink;
+
+// Holds the current mouse position on screen
+static MouseEventType * Mouse;
+
+// Flag for visibility of grid in the Dialog Editor
+static bool GridState = true;
+
+// Functions ****************************************************************
+
+// Set the visibility of Grid in the dialog editor
+void SetGrid(bool enable)
+{
+ GridState = enable;
+ EditDlg->CLY_Redraw();
+}
+
+bool GetGrid()
+{
+ return GridState;
+}
+
+// ToolDlg (Object Dialog) creation function
+TDialog * CreateTool()
+{
+ TDialog * d = new TDialog(TRect(0, 0, 55, 6), "Obj");
+ TDMemo * Memo;
+ TDListBox * LB;
+ TView * view;
+ TMemoData buf;
+
+ d->flags &= ~wfClose;
+ // d->flags |= wfGrow;
+ d->insert(new TDInputLine(TRect(2, 1, 7, 2)));
+ d->insert(view = new TDLabel(TRect(8, 1, 13, 2)));
+ view->options |= ofSelectable;
+ d->insert(view = new TDStaticText(TRect(2, 3, 7, 4)));
+ view->options |= ofSelectable;
+ d->insert(new TDButton(TRect(7, 3, 13, 5)));
+ d->insert(new TDCheckBoxes(TRect(15, 1, 20, 2), new TSItem("", 0) ));
+ d->insert(new TDRadioButtons(TRect(15, 3, 20, 4), new TSItem("", 0) ));
+ d->insert(LB = new TDListBox(TRect(22, 1, 27, 4)));
+ d->insert(view = new TVScrollBar(TRect(28, 1, 29, 4)));
+ view->options |= ofSelectable;
+ view->growMode = 0;
+ d->insert(Memo = new TDMemo(TRect(31, 1, 37, 2)));
+ buf.length = 6;
+ strcpy(buf.buffer, " Memo ");
+ Memo->setData(&buf);
+ Memo->growMode = 0;
+ d->insert(view = new THScrollBar(TRect(31, 3, 37, 4)));
+ view->options |= ofSelectable;
+ view->select();
+ view->growMode = 0;
+ d->selectNext(False);
+ return d;
+}
+
+// Called to initialize the editor. if FileName = NULL creates a blank dialog
+void InitDlgEditor(const char * FileName)
+{
+/* if (EditDlg != 0)
+ {
+ if (!EditDlg->Save()) return;
+ TProgram::deskTop->remove(EditDlg);
+ TObject::destroy(EditDlg);
+ EditDlg = 0;
+ }*/
+
+ Mouse = &TEventQueue::curMouse;
+
+ if (!ObjEdit)
+ {
+ ObjEdit = new TObjEdit(EditDlg);
+ TProgram::deskTop->insert(ObjEdit);
+ }
+ DialogCount++;
+ if (!EditDlg) EditDlg = new TDDialog();
+ else if ((EditDlg) && EditDlg->modified)
+ {
+ if (!EditDlg->Save(cmCancel)) return;
+ TProgram::CLY_destroy(EditDlg);
+ EditDlg = new TDDialog();
+ }
+ TProgram::deskTop->insert(EditDlg);
+ if (FileName != 0) EditDlg->loadFromFile(FileName);
+ if (!ToolDlg)
+ {
+ ToolDlg = CreateTool();
+ TProgram::deskTop->insert(ToolDlg);
+ }
+}
+
+
+TDDialog * DialogEditor() { return EditDlg; }
+
+TDialog * ToolDialog() { return ToolDlg; }
+
+TWindow * ObjectEditor() { return ObjEdit; }
+
+/* DefineRect ------------------------------------------------------------*/
+// returns the initial bounds rect for each type of view
+TRect DefineRect(TViewType vt, TPoint p)
+{
+ switch(vt)
+ {
+ case vtLabel: return TRect(p.x, p.y, p.x + 7, p.y + 1);
+ case vtInput: return TRect(p.x, p.y, p.x + 10, p.y + 1);
+ case vtStatic: return TRect(p.x, p.y, p.x + 12, p.y + 1);
+ case vtButton: return TRect(p.x, p.y, p.x + 12, p.y + 2);
+ case vtVScroll: return TRect(p.x, p.y, p.x + 1, p.y + 5);
+ case vtHScroll: return TRect(p.x, p.y, p.x + 10, p.y + 1);
+ default: return TRect(p.x, p.y, p.x + 10, p.y + 3);
+ }
+}
+
+/* GetSizeLimits ---------------------------------------------------------*/
+// returns the size limits for each type of view
+void GetSizeLimits(TPoint& min, TPoint& max, TViewType vt)
+{
+ max.x = max.y = INT_MAX;
+ switch(vt)
+ {
+ case vtButton: min.x = 5; min.y = 2; break;
+ case vtVScroll: min.x = 1; min.y = 3; break;
+ case vtHScroll: min.x = 3; min.y = 1; break;
+ default: min.x = 3; min.y = 1;
+ }
+}
+
+/* InitObject ------------------------------------------------------------*/
+// returns a valid tview object of type vt
+TView * InitObject(TPoint Position, TViewType vt, ushort mode)
+{
+ TView * rst;
+#define _createobj_(o,c) if (mode != 0) c++;\
+ rst = new o(DefineRect(vt, Position)); break
+#define _createcluster_(o, c) if (mode != 0) c++;\
+ rst = new o( DefineRect(vt, Position),\
+ new TSItem("FreeDsgn",\
+ new TSItem("For",\
+ new TSItem("TVision", 0 ))) ); break
+ switch(vt)
+ {
+ case vtLabel: _createobj_(TDLabel, LabelCount);
+ case vtInput: _createobj_(TDInputLine, InputCount);
+ case vtMemo: _createobj_(TDMemo, MemoCount);
+ case vtStatic: _createobj_(TDStaticText, StaticCount);
+ case vtButton: _createobj_(TDButton, ButtonCount);
+ case vtListBox: _createobj_(TDListBox, ListBoxCount);
+ case vtRadioButton: _createcluster_(TDRadioButtons, RadioCount);
+ case vtCheckBox: _createcluster_(TDCheckBoxes, CheckCount);
+ case vtVScroll: _createobj_(TVScrollBar, VScrollCount);
+ case vtHScroll: _createobj_(THScrollBar, HScrollCount);
+ default: return 0;
+ }
+ return rst;
+#undef _createobj_
+#undef _createcluster_
+}
+
+/* DragObject -----------------------------------------------------------*/
+// Drags the view from the ToolDlg to EditDlg across the desktop
+void DragObject(TView * P, TEvent& Event, TViewType vt)
+{
+ TRect Limits;
+ TPoint Min, Max, mouse;
+
+//EditDlg->select();
+ if (Event.what == evCommand) FloatingView = P;
+ TProgram::deskTop->insert(P);
+ Limits = TProgram::deskTop->getExtent();
+ mouse = TProgram::deskTop->makeLocal(Event.mouse.where);
+ if (!FloatingView) P->moveTo(mouse.x, mouse.y);
+ P->state |= sfShadow;
+ P->sizeLimits(Min, Max);
+ P->dragView(Event, dmDragMove, Limits, Min, Max);
+ message(EditDlg, evBroadcast, cmItemDropped, (void *)vt);
+ TProgram::deskTop->remove(P);
+ FloatingView = NULL;
+ delete P;
+}
+
+/* ImOwned --------------------------------------------------------------*/
+
+ushort ImOwned(TView * view)
+{
+ if (view->owner == TProgram::deskTop) return ByDesktop; else
+ if (view->owner == EditDlg) return ByEditor; else
+ if (view->owner == ToolDlg) return ByToolDlg;
+ return 0;
+}
+
+/* DsgDragView ----------------------------------------------------------*/
+// Move and resize the view v in the EditDlg
+void DsgDragView(TView * v, ushort Mode, TEvent& event)
+{
+ TRect Limits;
+ TPoint Min, Max;
+
+ Limits = v->owner->getExtent();
+ Limits.grow(-1, -1);
+ v->sizeLimits(Min, Max);
+ v->dragView(event, v->dragMode | Mode, Limits, Min, Max);
+ v->clearEvent(event);
+}
+
+/* HandleEventOnEditor --------------------------------------------------*/
+// Common event handler for editable views which are owned by EditDlg
+bool HandleEventOnEditor(TView * view, TEvent& event,
+ TViewType vt)
+{
+ TPoint mouse;
+ TDsgLink * d;
+
+ if ( (event.what == evMouseDown) &&
+ (view->mouseInView(event.mouse.where)) )
+ {
+ d = ObjectLinker()->viewFind(view);
+ if ((d) && ObjEdit->object != d->d) ObjEdit->setObjData(d->d);
+ view->select();
+ if (event.mouse.buttons == mbRightButton)
+ {
+ mouse = view->makeLocal(event.mouse.where);
+ if ((mouse.x == view->size.x - 1) &&
+ (mouse.y == view->size.y - 1))
+ DsgDragView(view, dmDragGrow, event);
+ else
+ DsgDragView(view, dmDragMove, event);
+ }
+ return false;
+ }
+ else return false;
+}
+
+/* HandleEventOnToolDlg --------------------------------------------------*/
+// Common event handler for editable views which are owned by ToolDlg
+bool HandleEventOnToolDlg(TView * view, TEvent& event, TViewType vt)
+{
+ TRect Location;
+ TView * P;
+
+ if ( (event.what == evMouseDown) ||
+ ( (event.what == evCommand) &&
+ (event.message.command == cmResizeObj) &&
+ (view->getState(sfFocused|sfSelected)) ) )
+ {
+ if (event.what == evMouseDown)
+ Location.a = view->makeGlobal(event.mouse.where);
+ else
+ {
+ keyPut = true;
+ Location.a =
+ TProgram::deskTop->makeLocal(view->owner->makeGlobal(view->origin));
+ }
+ P = InitObject(Location.a, vt, 0);
+ if (P) DragObject(P, event, vt);
+ return true;
+ }
+ if (event.what == evKeyboard)
+ {
+ switch(event.keyDown.keyCode)
+ {
+ case kbUp:
+ view->owner->selectNext(true);
+ view->clearEvent(event);
+ return true;
+ case kbDown:
+ view->owner->selectNext(false);
+ view->clearEvent(event);
+ return true;
+ case kbLeft:
+ view->owner->selectNext(true);
+ view->clearEvent(event);
+ return true;
+ case kbRight:
+ view->owner->selectNext(false);
+ view->clearEvent(event);
+ return true;
+ case kbEnter:
+ view->clearEvent(event);
+ if (!keyPut)
+ {
+ keyPut = true;
+ message(view->owner, evCommand, cmResizeObj, 0);
+ }
+ keyPut = false;
+ return false;
+ default: return false;
+ }
+ }
+ return false;
+}
+
+/* InsertLink -----------------------------------------------------------*/
+// returns true if a TDLabel was found linked to aView and insert both
+bool InsertLink(char * aName, TView * aView, TDialog * aOwner)
+{
+ TLabel * l;
+
+ TDsgLink * dl = ObjectLinker()->linkFind(aName);
+ if (dl)
+ {
+ l = (TLabel *)dl->d->createView(aView);
+ aOwner->insert(aView);
+ aOwner->insert(l);
+ return true;
+ } else return false;
+}
+
+/* FindScroll -----------------------------------------------------------*/
+// Inserts and returns a valid TScrollBar if one named as aScroll was found
+TScrollBar * FindScroll(char * aScroll, TDialog * aOwner)
+{
+ TScrollBar * sb;
+
+ TDsgLink * dl = ObjectLinker()->scrollFind(aScroll);
+ if (dl)
+ {
+ sb = (TScrollBar *)dl->d->createView(0);
+ aOwner->insert(sb);
+ return sb;
+ } else return 0;
+}
+
+/* StringsToSItems ------------------------------------------------------*/
+// Converts a TStringCollection to TSItems
+TSItem * strCollToItems(TStringCollection * strs)
+{
+ TSItem *first, * cur, * last;
+ int i;
+
+ first = cur = last = 0;
+
+ if ((strs) && (strs->getCount() > 0))
+ {
+ for (i = 0; i < strs->getCount(); i++)
+ {
+ cur = new TSItem(newStr((char *)strs->at(i)), 0);
+ if (!first) first = cur;
+ if (last) last->next = cur;
+ last = cur;
+ }
+ return first;
+ } else return 0;
+}
+
+/* LoadObject ===========================================================*/
+
+void * readDsgInfo( ipstream& s, TViewType vt )
+{
+ void * rst = malloc(vtAttrSize[vt]);
+ s.readBytes(rst, vtAttrSize[vt]);
+ return rst;
+}
+
+void readStrings( ipstream& s, TCollection * c, int limit )
+{
+ ushort i, len;
+ char ch[100];
+ c->freeAll();
+ c->setLimit(limit);
+ for (i = 0; i < limit; i++)
+ {
+ s >> len;
+ s.readBytes(&ch, len);
+ ch[len] = 0;
+ c->atInsert(i, newStr(ch));
+ }
+}
+
+TView * LoadObject( ipstream& s )
+{
+ TView * rst=0;
+ TDsgObj * obj;
+ static TViewType vt;
+ static int auxVt;
+ TStringCollection * items=0;
+ ushort Count;
+ char * Text;
+ TPoint p;
+
+ s >> auxVt;
+ vt=(TViewType)auxVt;
+ if (vt == vtNone) return 0;
+ void * attr = readDsgInfo(s, vt);
+ if (!attr) return 0;
+ p.x = 0; p.y = 0;
+ if (vt != vtDialog) rst = InitObject( p, vt, 0 );
+ rst->setState(sfEditing, True);
+ obj = ObjectLinker()->viewFind(rst)->d;
+ memcpy(obj->attributes, attr, vtAttrSize[vt]);
+ free(attr);
+ if (vt==vtStatic)
+ {
+ s >> Count;
+ if (Count > 0)
+ {
+ Text = (char *)malloc(Count);
+ s.readBytes(Text, Count);
+ delete[] ((TDStaticData *)obj->attributes)->text;
+ ((TDStaticData *)obj->attributes)->text = Text;
+ }
+ }
+ if (vt>=vtRadioButton && vt<=vtCheckBox)
+ {
+ s >> Count;
+ if (Count > 0 && Count <= 32)
+ {
+ items = (TStringCollection *)obj->dsgGetData();
+ readStrings(s, items, Count);
+ } else items->freeAll();
+ ((TDClusterData *)obj->attributes)->items = items;
+ }
+// obj->dsgUpdate();
+ return rst;
+}
+
+void SaveObject( ofpstream& s, TDsgObj * obj )
+{
+ ushort Count, i;
+ TStringCollection * items;
+ char * ch;
+
+ s << (int)obj->viewType;
+ s.writeBytes(obj->attributes, vtAttrSize[obj->viewType]);
+ switch (obj->viewType)
+ {
+ case vtStatic:
+ ch = ((TDStaticData *)obj->attributes)->text;
+ Count = strlen(ch);
+ if (Count > 0)
+ {
+ s << Count + 1;
+ if (Count > 0) s.writeBytes( ch, Count + 1 );
+ }
+ else s << Count;
+ break;
+ case vtRadioButton:
+ case vtCheckBox:
+ items = (TStringCollection *)((TDClusterData *)obj->attributes)->items;
+ Count = items->getCount();
+ s << Count;
+ if (Count > 0)
+ for ( i = 0; i < items->getCount(); i++)
+ {
+ ch = (char *)items->at(i);
+ Count = strlen(ch);
+ s << Count;
+ s.writeBytes( ch, Count );
+ }
+ default: return;
+ }
+}
+
+/* TDFrame ==============================================================*/
+
+TDFrame::TDFrame(const TRect& bounds): TFrame(bounds) { }
+
+void TDFrame::draw()
+{
+ TDrawBuffer bl, b;
+ ushort c, i;
+
+ TFrame::draw();
+
+ if (!GridState) return; // Grid mode conditioner
+
+ if ((owner->state & sfEditing) != 0)
+ {
+ for (i = 0; i <= size.x; i++)
+ {
+ c = ((i + 1) % 10 == 0) ? 0x7e : 0x78;
+ b.moveChar(i, 'ú', c, 1);
+ }
+ bl.moveChar(0, 'ú', 0x7e, size.x - 2);
+ for (i = 1; i <= size.y - 1; i++)
+ {
+ if (i % 10 == 0)
+ writeLine(1, i, size.x - 2, 1, bl);
+ else
+ writeLine(1, i, size.x - 2, 1, b);
+ }
+ for (i = 1; i <= size.y - 2; i++)
+ {
+ c = (i % 10 == 0) ? 0x7e : 0x78;
+ b.moveChar(0, (i % 10) + 48, c, 1);
+ writeLine(0, i, 1, 1, b);
+ }
+ for (i = 1; i <= size.x; i++)
+ {
+ c = (i % 10 == 0) ? 0x7e : 0x78;
+ b.moveChar(i - 1, (i % 10) + 48, c, 1);
+ }
+ writeLine(1, size.y - 1, size.x - 2, size.y, b);
+ }
+}
+
+/* TDsgObj ==============================================================*/
+
+void TDsgObj::buildName(TNameStr * name, int mode)
+{
+ char fmt[6];
+ if (viewType == vtVScroll) strcpy(fmt, "V%s%i"); else
+ if (viewType == vtHScroll) strcpy(fmt, "H%s%i"); else strcpy(fmt, "%s%i");
+ if (!mode) strcpy((char *)name, TheClassName[viewType]);
+ else sprintf((char *)name, fmt,
+ (char *)&(TheClassName[viewType][1]), nameIndex);
+}
+
+TDsgObj::TDsgObj(TViewType ViewType)
+{
+#define _allocattr_(t,c) \
+ nameIndex = c; \
+ attrSize = sizeof(t); \
+ attributes = new t; break /* calloc(1, attrSize);
+ break; */
+// setViewData((TDsgObjData &)*attributes);
+ viewType = ViewType;
+ switch (viewType)
+ {
+ case vtOther: _allocattr_(TDsgObjData, UserCount);
+ case vtLabel: _allocattr_(TDLabelData, LabelCount);
+ case vtInput: _allocattr_(TDInputData, InputCount);
+ case vtMemo: _allocattr_(TDMemoData, MemoCount);
+ case vtStatic: _allocattr_(TDStaticData, StaticCount);
+ case vtButton: _allocattr_(TDButtonData, ButtonCount);
+ case vtListBox: _allocattr_(TDListBoxData, ListBoxCount);
+ case vtRadioButton: _allocattr_(TDRadioData, RadioCount);
+ case vtCheckBox: _allocattr_(TDCheckData, CheckCount);
+ case vtVScroll: _allocattr_(TDVScrollData, VScrollCount);
+ case vtHScroll: _allocattr_(TDHScrollData, HScrollCount);
+ case vtDialog: _allocattr_(TDDialogData, DialogCount);
+ case vtNone: break;
+ }
+ dsgObj = this;
+#undef _allocattr_
+}
+
+void TDsgObj::setViewData(TDsgObjData& data)
+{
+ TView * me = Me();
+
+ buildName(&data.className, 0); // TName
+ buildName(&data.thisName, 1); // Name#
+ data.origin = me->origin;
+ data.size = me->size;
+ defaultData.options = data.options = me->options;
+ defaultData.eventMask = data.eventMask = me->eventMask;
+ defaultData.state = data.state = me->state;
+ defaultData.growMode = data.growMode = me->growMode;
+ defaultData.dragMode = data.dragMode = me->dragMode;
+ defaultData.helpCtx = data.helpCtx = me->helpCtx;
+
+ switch(viewType)
+ {
+ case vtLabel:
+ strcpy( ((TDLabelData &)data).text, (char *)(this->dsgGetData()) );
+ break;
+ case vtInput:
+ ((TDInputData &)data).maxLen = 0;
+ ((TDInputData &)data).validatorType = 0;
+ break;
+ case vtStatic:
+ ((TDStaticData &)data).text = (char *)this->dsgGetData();
+ break;
+ case vtButton:
+ strcpy( ((TDButtonData &)data).title, (char *)this->dsgGetData() );
+ ((TDButtonData &)data).command = ((TDButton *)me)->getCommand();
+ ((TDButtonData &)data).flags = ((TDButton *)me)->getFlags();
+ break;
+ case vtRadioButton:
+ ((TDRadioData &)data).items = ((TDRadioButtons *)me)->dsgGetData();
+ break;
+ case vtCheckBox:
+ ((TDCheckData &)data).items = ((TDCheckBoxes *)me)->dsgGetData();
+ break;
+ case vtDialog:
+ strcpy( ((TDDialogData &)data).title, ((TDialog *)me)->title);
+ ((TDDialogData &)data).flags = ((TDialog *)me)->flags;
+ default: return;
+ }
+}
+
+void TDsgObj::setPos(TPoint neworigin, TPoint newsize)
+{
+ ((TDsgObjData *)attributes)->origin = neworigin;
+ ((TDsgObjData *)attributes)->size = newsize;
+ ((TDDialog *)Me()->owner)->setModified(True);
+}
+
+TDsgObj::~TDsgObj()
+{
+ if (this!=EditDlg && ObjEdit->object == this) ObjEdit->setObjData(EditDlg);
+ ObjectLinker()->removeMe(this); // <- was DsgObj
+ delete (char *)attributes;
+}
+
+char * TDsgObj::getScript(ushort ScriptType)
+{
+// criar e retorna um texto script conforme o tipo
+ return 0;
+}
+
+void TDsgObj::setupView(TView * View)
+{
+ TDsgObjData *editData = (TDsgObjData *)attributes;
+ View->options = editData->options;
+ View->growMode = editData->growMode;
+ View->dragMode = editData->dragMode;
+ View->state = editData->state;
+}
+
+bool TDsgObj::tabStop()
+{
+ return ((viewType != vtLabel &&
+ viewType != vtStatic &&
+ viewType != vtVScroll &&
+ viewType != vtHScroll) ||
+ ( ((TDsgObjData *)attributes)->options & ofSelectable ) );
+}
+
+void TDsgObj::dsgUpdate()
+{
+ TView * me = Me();
+ TDsgObjData * d = (TDsgObjData *)attributes;
+ TRect r = TRect(d->origin.x, d->origin.y,
+ d->origin.x + d->size.x, d->origin.y + d->size.y);
+ if (r != me->getBounds()) me->changeBounds(r);
+ if (tabStop()) ObjectLinker()->doReOrder();
+ ((TDDialog *)me->owner)->setModified(True);
+ me->owner->CLY_Redraw();
+}
+
+/* TDDialog =============================================================*/
+
+TDDialog::TDDialog():
+ TWindowInit(TDDialog::initFrame),
+ TDialog( TRect(0, 6, 55, 23), "TVISION Dialog Editor"),
+ TDsgObj( vtDialog )
+{
+ setViewData(*((TDsgObjData *)attributes));
+ defaultData.flags = flags;
+ ObjEdit->setObjData(this);
+ flags &= ~wfClose;
+ flags |= wfGrow | wfZoom;
+// options |= ofCentered;
+ state |= sfEditing;
+ EditDlg = this;
+ setModified(False);
+}
+
+void TDDialog::shutDown()
+{
+ if (modified) Save(cmCancel);
+ if (fileName) delete[] fileName;
+ _shutdown_(TDialog);
+}
+
+void TDDialog::setModified(Boolean aState)
+{
+ modified = aState;
+}
+
+void TDDialog::handleEvent(TEvent& event)
+{
+ TView * P;
+ TPoint mouse;
+
+ if (event.what == evKeyboard)
+ {
+ switch(event.keyDown.keyCode)
+ {
+ case kbUp: selectNext(true); clearEvent(event); break;
+ case kbDown: selectNext(false); clearEvent(event); break;
+ case kbLeft: selectNext(true); clearEvent(event); break;
+ case kbRight: selectNext(false); clearEvent(event); break;
+ case kbCtrlDel:
+ if (current)
+ {
+ P = current;
+ remove(current);
+ delete P;
+ clearEvent(event);
+ }
+ break;
+ case kbEnter:
+ if (current) DsgDragView(current, dmDragMove|dmDragGrow, event);
+ clearEvent(event);
+ break;
+ default: TDialog::handleEvent(event);
+ }
+ }
+ else
+ if (event.what == evBroadcast)
+ {
+ if (event.message.command == cmItemDropped)
+ {
+ P = NULL;
+ if (FloatingView) { mouse = FloatingView->origin; mouse.y++; }
+ else mouse = Mouse->where;
+ if ( mouseInView(mouse) && !ToolDlg->mouseInView(mouse) &&
+ !ObjEdit->mouseInView(mouse) )
+ P = InitObject(makeLocal(mouse),
+ (TViewType)event.message.infoLong, sfEditing);
+ if (P) dinsert(P);
+ }
+ }
+ TDialog::handleEvent(event);
+ if (event.what == evMouseDown) ObjEdit->setObjData(this);
+}
+
+void TDDialog::draw() { TDialog::draw(); }
+
+TFrame * TDDialog::initFrame( TRect r ) { return new TDFrame(r); }
+
+void TDDialog::setState(ushort aState, Boolean enable)
+{
+ TDialog::setState(aState, enable);
+}
+
+void doCloneView(void * v, void * d)
+{
+ TDsgObj * Dsg = ((TDsgLink *)v)->d;
+ if (Dsg->viewType == vtLabel ||
+ Dsg->viewType == vtVScroll || Dsg->viewType == vtHScroll) return;
+ TView * rst = Dsg->createView((TDialog *)d);
+ if (rst) ((TDialog *)d)->insert(rst);
+}
+
+void TDDialog::dlgRun()
+{
+ TDDialogData * editData = (TDDialogData *)attributes;
+
+ TDialog * d = new TDialog( TRect( getBounds() ), editData->title );
+ ObjectLinker()->forEach(&doCloneView, (void *)d);
+ setupView(d);
+ d->flags = editData->flags;
+ hide();
+ d->selectNext(false);
+ TProgram::deskTop->execView(d);
+ changeBounds(d->getBounds());
+ TObject::CLY_destroy(d);
+ show();
+}
+
+void TDDialog::dinsert(TView * aView)
+{
+ aView->options |= ofSelectable | ofFirstClick | ofPreProcess | ofPostProcess;
+ aView->growMode = 0;
+ aView->setState(sfEditing, true);
+ TDsgLink * dl = ObjectLinker()->viewFind(aView);
+ if ((dl) && dl->d->tabStop())
+ {
+ ((TDsgObjData *)dl->d->attributes)->tabOrder = TabOrder;
+ TabOrder++;
+ }
+ insert(aView);
+ setModified(True);
+}
+
+void TDDialog::changeBounds(const TRect& bounds) {_chgbnds_(TDialog); }
+
+TView * TDDialog::Me() { return this; }
+
+void TDDialog::dsgUpdate()
+{
+ TDsgObj::dsgUpdate();
+ TDDialogData * d = (TDDialogData *)attributes;
+ delete[] title;
+ title = newStr(d->title);
+ frame->drawView();
+ setModified(True);
+}
+
+void * TDDialog::dsgGetData() { return (void *)title; }
+
+Boolean TDDialog::Save(int aCommand)
+{
+ char * f;
+ int cmd = aCommand;
+ if (modified)
+ {
+ if (cmd != cmYes)
+ cmd = messageBox(__("The current dialog was modified. Save it?"),
+ mfYesNoCancel | mfWarning);
+ if ( cmd == cmYes && (fileName == 0 || strlen(fileName) == 0) )
+ {
+ f = getFileName(_("Save dialog"), "*.fdg", 1);
+ if (f)
+ {
+ delete[] fileName;
+ fileName = f;
+ return True;
+ }
+ }
+ switch (cmd)
+ {
+ case cmYes: saveToFile(fileName); return True;
+ case cmNo: return True;
+ case cmCancel: return False;
+ }
+ } //else return True;
+ return True;
+}
+
+static void saveObject(void * v, void * d)
+{
+ TDsgLink * dsg = (TDsgLink *)v;
+#if 0
+ char buf[255];
+ if (dsg)
+ {
+ sprintf(buf, "Salvando objeto %s.",
+ ((TViewData *)dsg->d->attributes)->thisName);
+ messageBox(buf, 0);
+ SaveObject((ofpstream &)*d, dsg->d);
+ }
+#endif
+#if 1
+ if (dsg) SaveObject(*((ofpstream *)d), dsg->d);
+#endif
+}
+
+Boolean TDDialog::saveToFile(const char * FileName)
+{
+ ofpstream * S = initFile(FileName, fileName, dialogFileSig);
+ if (S != 0)
+ {
+ ofpstream& s = *S;
+ s << viewType;
+ s.writeBytes(attributes, vtAttrSize[viewType]);
+ s << (GridState ? (char)1 : (char)0);
+ s << LabelCount << InputCount << MemoCount
+ << StaticCount << ButtonCount << ListBoxCount << RadioCount
+ << CheckCount << VScrollCount << HScrollCount << UserCount;
+ ObjectLinker()->sortForBuild();
+ ObjectLinker()->forEach(&saveObject, &s);
+ s << vtNone;
+ s.close();
+ delete S;
+ return True;
+ setModified(False);
+ } else return False;
+}
+
+Boolean TDDialog::loadFromFile(const char * FileName)
+{
+ static int vtAux;
+ static TViewType vt;
+
+ if (!Save(cmYes)) return False;
+
+ if (!FileName) return False;
+
+ if (fileName)
+ {
+ if (strcmp(FileName, fileName) == 0) return True;
+ delete[] fileName;
+ }
+ fileName = newStr(FileName);
+
+ ifpstream * S = openFile(FileName, dialogFileSig);
+ TView * v;
+ TView * p = last;
+ do {
+ TView * t = p->prev();
+ if (p != frame) CLY_destroy(p);
+ p = t;
+ } while (first() != last);
+
+ if (S != 0)
+ {
+ ifpstream& s = *S;
+ s >> vtAux; vt = (TViewType)vtAux;
+ if (vt != vtDialog) { s.close(); return False; }
+ void * attr = readDsgInfo(s, vt);
+ memcpy(attributes, attr, vtAttrSize[vt]);
+ free(attr);
+ char aux;
+ s >> aux; GridState=aux ? True : False;
+ s >> LabelCount >> InputCount >> MemoCount
+ >> StaticCount >> ButtonCount >> ListBoxCount >> RadioCount
+ >> CheckCount >> VScrollCount >> HScrollCount >> UserCount;
+ dsgUpdate();
+ TabOrder = 0;
+ v = LoadObject(s);
+ while (v)
+ {
+ dinsert(v);
+ TDsgLink * dsg = ObjectLinker()->viewFind(v);
+ if (dsg) dsg->d->dsgUpdate();
+ v = LoadObject(s);
+ }
+ if (fileName) delete[] fileName;
+ fileName = strdup(FileName);
+ selectNext(True);
+ setModified(False);
+ s.close();
+ delete S;
+ } //else return False;
+ return False;
+}
+
+/* TDLabel ==============================================================*/
+
+TDLabel::TDLabel(const TRect& bounds):
+ TLabel(bounds, __("~L~abel"), EditDlg),
+ TDsgObj( vtLabel )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void TDLabel::shutDown() { _shutdown_(TLabel); }
+
+void TDLabel::handleEvent(TEvent& event) {_h_(TLabel); }
+
+TPalette& TDLabel::getPalette() const
+ {_p_(cpDragLabel, cpSelLabel, TLabel); }
+
+void TDLabel::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void TDLabel::setState(ushort aState, Boolean enable) {_setstate_(TLabel); }
+
+void TDLabel::changeBounds(const TRect& bounds) {_chgbnds_(TLabel); }
+
+TView * TDLabel::Me() { return this; }
+
+void TDLabel::dsgUpdate()
+{
+ TDLabelData * d = (TDLabelData *)attributes;
+ delete[] text;
+ text = newStr(d->text);
+// drawView();
+ TDsgObj::dsgUpdate();
+}
+
+void * TDLabel::dsgGetData() { return (void *)text; }
+
+TView * TDLabel::createView(TView * aLink)
+{
+ TDLabelData * d = (TDLabelData *)attributes;
+ TLabel * rst = new TLabel(getBounds(), (char *)d->text, aLink);
+ setupView(rst);
+ return rst;
+}
+
+/* TDInputLine ==========================================================*/
+
+TDInputLine::TDInputLine(const TRect& bounds):
+ TInputLine(bounds, 0),
+ TDsgObj( vtInput )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void TDInputLine::shutDown() { _shutdown_(TInputLine); }
+
+void TDInputLine::handleEvent(TEvent& event) {_h_(TInputLine); }
+
+TPalette& TDInputLine::getPalette() const
+ {_p_(cpDragInput, cpSelInput, TInputLine); }
+
+void TDInputLine::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void TDInputLine::setState(ushort aState, Boolean enable)
+ {_setstate_(TInputLine); }
+
+void TDInputLine::changeBounds(const TRect& bounds) {_chgbnds_(TInputLine); }
+
+TView * TDInputLine::Me() { return this; }
+
+TView * TDInputLine::createView(TView * aOwner)
+{
+ TDInputData * d = (TDInputData *)attributes;
+ TInputLine * rst = new TInputLine(getBounds(), d->maxLen);
+// if (d->validatorType != vtNone)
+// switch(d->validatorType)
+// {
+//
+// }
+ setupView(rst);
+ if (InsertLink(d->thisName, rst, (TDialog *)aOwner))
+ return 0;
+ else
+ return rst;
+}
+
+/* TDMemo ===============================================================*/
+
+TDMemo::TDMemo(const TRect& bounds):
+ TMemo(bounds, 0, 0, 0, 0),
+ TDsgObj( vtMemo )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void TDMemo::shutDown() { _shutdown_(TMemo); }
+
+void TDMemo::handleEvent(TEvent& event) {_h_(TMemo); }
+
+TPalette& TDMemo::getPalette() const {_p_(cpDragMemo, cpSelMemo, TMemo); }
+
+void TDMemo::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void TDMemo::setState(ushort aState, Boolean enable) {_setstate_(TMemo); }
+
+void TDMemo::changeBounds(const TRect& bounds) {_chgbnds_(TMemo); }
+
+TView * TDMemo::Me() { return this; }
+
+TView * TDMemo::createView(TView * aOwner)
+{
+ TDMemoData * d = (TDMemoData *)attributes;
+ TScrollBar * vsb = 0;
+ TScrollBar * hsb = 0;
+ if (d->hScroll >= 0) hsb = FindScroll(d->hScroll, (TDialog *)aOwner);
+ if (d->vScroll >= 0) vsb = FindScroll(d->vScroll, (TDialog *)aOwner);
+ TMemo * rst = new TMemo(getBounds(), hsb, vsb, 0, d->bufSize);
+ setupView(rst);
+ if (InsertLink(d->thisName, rst, (TDialog *)aOwner))
+ return 0;
+ else
+ return rst;
+}
+
+/* TDStaticText =========================================================*/
+
+TDStaticText::TDStaticText(const TRect& bounds):
+ TStaticText(bounds, "StaticText"),
+ TDsgObj( vtStatic )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void TDStaticText::shutDown() { _shutdown_(TStaticText); }
+
+void TDStaticText::handleEvent(TEvent& event) {_h_(TStaticText); }
+
+TPalette& TDStaticText::getPalette() const
+ {_p_(cpDragStatic, cpSelStatic, TStaticText); }
+
+void TDStaticText::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void TDStaticText::setState(ushort aState, Boolean enable)
+ {_setstate_(TStaticText); }
+
+void TDStaticText::changeBounds(const TRect& bounds) {_chgbnds_(TStaticText); }
+
+TView * TDStaticText::Me() { return this; }
+
+void TDStaticText::dsgUpdate()
+{
+ TDStaticData * d = (TDStaticData *)attributes;
+// delete[] text;
+// text = newStr(d->text);
+ text = d->text; // If was changed the text has been freed by the object
+ // editor and the new pointer is in attributes data
+ TDsgObj::dsgUpdate();
+// drawView();
+}
+
+void * TDStaticText::dsgGetData() { return (void *)text; }
+
+TView * TDStaticText::createView(TView * aOwner)
+{
+ TDStaticData * d = (TDStaticData *)attributes;
+ TStaticText * rst = new TStaticText(getBounds(), d->text);
+ setupView(rst);
+ return rst;
+}
+
+/* TDButton =============================================================*/
+
+TDButton::TDButton(const TRect& bounds):
+ TButton(bounds, "~O~k", 0, 0),
+ TDsgObj( vtButton )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void TDButton::shutDown() { _shutdown_(TButton); }
+
+void TDButton::handleEvent(TEvent& event) {_h_(TButton); }
+
+TPalette& TDButton::getPalette() const
+ {_p_(cpDragBtn, cpSelBtn, TButton); }
+
+void TDButton::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void TDButton::setState(ushort aState, Boolean enable) {_setstate_(TButton); }
+
+void TDButton::changeBounds(const TRect& bounds) {_chgbnds_(TButton); }
+
+TView * TDButton::Me() { return this; }
+
+void TDButton::dsgUpdate()
+{
+ TDButtonData * d = (TDButtonData *)attributes;
+ delete[] title;
+ title = newStr(d->title);
+ TDsgObj::dsgUpdate();
+// drawView();
+}
+
+void * TDButton::dsgGetData() { return (void *)title; }
+
+ushort TDButton::getCommand() { return command; }
+ushort TDButton::getFlags() { return flags; }
+
+TView * TDButton::createView(TView * aOwner)
+{
+ TDButtonData * d = (TDButtonData *)attributes;
+ TButton * rst = new TButton(getBounds(), d->title, d->command, d->flags);
+ setupView(rst);
+ return rst;
+}
+
+/* TDListBox ============================================================*/
+
+TDListBox::TDListBox(const TRect& bounds):
+ TListBox(bounds, 1, 0),
+ TDsgObj( vtListBox )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void TDListBox::shutDown() { _shutdown_(TListBox); }
+
+void TDListBox::handleEvent(TEvent& event) {_h_(TListBox); }
+
+TPalette& TDListBox::getPalette() const
+ {_p_(cpDragLB, cpSelLB, TListBox); }
+
+void TDListBox::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void TDListBox::setState(ushort aState, Boolean enable) {_setstate_(TListBox); }
+
+void TDListBox::changeBounds(const TRect& bounds) {_chgbnds_(TListBox); }
+
+TView * TDListBox::Me() { return this; }
+
+void TDListBox::dsgUpdate()
+{
+// setRange(items->getCount());
+// if (items->getCount() > 0) focusItem(0);
+// TDsgObj::dsgUpdate();
+ drawView();
+}
+
+void * TDListBox::dsgGetData() { return items; }
+
+TView * TDListBox::createView(TView * aOwner)
+{
+ TDListBoxData * d = (TDListBoxData *)attributes;
+ TScrollBar * sb = 0;
+ int cols = (d->columns > 0) ? d->columns : 1;
+ if (d->scrollBar >= 0) sb = FindScroll(d->scrollBar, (TDialog *)aOwner);
+ TListBox * rst = new TListBox(getBounds(), cols, sb);
+// rst->newList(items);
+ setupView(rst);
+ if (InsertLink(d->thisName, rst, (TDialog *)aOwner))
+ return 0;
+ else
+ return rst;
+}
+
+/* TDRadioButtons =======================================================*/
+
+TDRadioButtons::TDRadioButtons(const TRect& bounds, TSItem * aStrings):
+ TRadioButtons(bounds, aStrings),
+ TDsgObj( vtRadioButton )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void TDRadioButtons::shutDown() { _shutdown_(TRadioButtons); }
+
+void TDRadioButtons::handleEvent(TEvent& event) {_h_(TRadioButtons); }
+
+TPalette& TDRadioButtons::getPalette() const
+ {_p_(cpDragCluster, cpSelCluster, TCluster); }
+
+void TDRadioButtons::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void TDRadioButtons::setState(ushort aState, Boolean enable)
+ {_setstate_(TRadioButtons); }
+
+void TDRadioButtons::changeBounds(const TRect& bounds)
+ {_chgbnds_(TRadioButtons); }
+
+TView * TDRadioButtons::Me() { return this; }
+
+void * TDRadioButtons::dsgGetData() { return strings; }
+
+TView * TDRadioButtons::createView(TView * aOwner)
+{
+ TDRadioData * d = (TDRadioData *)attributes;
+ TRadioButtons * rst = new TRadioButtons(getBounds(), strCollToItems(strings));
+ rst->setData(&value);
+ setupView(rst);
+ if (InsertLink(d->thisName, rst, (TDialog *)aOwner))
+ return 0;
+ else
+ return rst;
+}
+
+/* TDCheckBoxes =========================================================*/
+
+TDCheckBoxes::TDCheckBoxes(const TRect& bounds, TSItem * aStrings):
+ TCheckBoxes(bounds, aStrings),
+ TDsgObj( vtCheckBox )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void TDCheckBoxes::shutDown() { _shutdown_(TCheckBoxes); }
+
+void TDCheckBoxes::handleEvent(TEvent& event) {_h_(TCheckBoxes); }
+
+TPalette& TDCheckBoxes::getPalette() const
+ {_p_(cpDragCluster, cpSelCluster, TCluster); }
+
+void TDCheckBoxes::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void TDCheckBoxes::setState(ushort aState, Boolean enable)
+ { _setstate_(TCheckBoxes); }
+
+void TDCheckBoxes::changeBounds(const TRect& bounds) {_chgbnds_(TCheckBoxes); }
+
+TView * TDCheckBoxes::Me() { return this; }
+
+//void TDCheckBoxes::dsgUpdate() { TDsgObj::dsgUpDate(); }
+
+void * TDCheckBoxes::dsgGetData() { return strings; }
+
+TView * TDCheckBoxes::createView(TView * aOwner)
+{
+ TDCheckData * d = (TDCheckData *)attributes;
+ TCheckBoxes * rst = new TCheckBoxes(getBounds(), strCollToItems(strings));
+ rst->setData(&value);
+ setupView(rst);
+ if (InsertLink(d->thisName, rst, (TDialog *)aOwner))
+ return 0;
+ else
+ return rst;
+}
+
+/* TVScrollBar ==========================================================*/
+
+TVScrollBar::TVScrollBar(const TRect& bounds):
+ TScrollBar(bounds),
+ TDsgObj( vtVScroll )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void TVScrollBar::shutDown() { _shutdown_(TScrollBar); }
+
+void TVScrollBar::handleEvent(TEvent& event) {_h_(TScrollBar); }
+
+TPalette& TVScrollBar::getPalette() const
+ {_p_(cpDragScroll, cpSelScroll, TScrollBar); }
+
+void TVScrollBar::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void TVScrollBar::setState(ushort aState, Boolean enable)
+ {_setstate_(TScrollBar); }
+
+void TVScrollBar::changeBounds(const TRect& bounds) {_chgbnds_(TScrollBar); }
+
+TView * TVScrollBar::Me() { return this; }
+
+TView * TVScrollBar::createView(TView * aOwner)
+{
+ TScrollBar * rst = new TScrollBar(getBounds());
+ setupView(rst);
+ return rst;
+}
+
+/* THScrollBar ==========================================================*/
+
+THScrollBar::THScrollBar(const TRect& bounds):
+ TScrollBar(bounds),
+ TDsgObj( vtHScroll )
+ { setViewData(*((TDsgObjData *)attributes)); }
+
+void THScrollBar::shutDown() { _shutdown_(TScrollBar); }
+
+void THScrollBar::handleEvent(TEvent& event) {_h_(TScrollBar); }
+
+TPalette& THScrollBar::getPalette() const
+ {_p_(cpDragScroll, cpSelScroll, TScrollBar); }
+
+void THScrollBar::sizeLimits(TPoint& min, TPoint& max)
+ { GetSizeLimits(min, max, viewType); }
+
+void THScrollBar::setState(ushort aState, Boolean enable)
+ {_setstate_(TScrollBar); }
+
+void THScrollBar::changeBounds(const TRect& bounds) {_chgbnds_(TScrollBar); }
+
+TView * THScrollBar::Me() { return this; }
+
+TView * THScrollBar::createView(TView * aOwner)
+{
+ TScrollBar * rst = new TScrollBar(getBounds());
+ setupView(rst);
+ return rst;
+}
+
+/* Fim ==================================================================*/
+
+#undef _h_
+#undef _p_
+#undef _chgbnds_
+#undef _setstate_
diff --git a/tvision/examples/dlgdsn/dsgobjs.h b/tvision/examples/dlgdsn/dsgobjs.h
new file mode 100644
index 0000000..396e291
--- /dev/null
+++ b/tvision/examples/dlgdsn/dsgobjs.h
@@ -0,0 +1,369 @@
+/***************************************************************************
+
+ dsgobjs.h - Editable classes prototypes
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Modified by Salvador E. Tropea to compile without warnings.
+ This header allocated a couple of structures in each file that used it.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#if !defined(_DSGOBJS_HPP_)
+#define _DSGOBJS_HPP_
+
+#include <stdlib.h>
+
+#define Uses_TDialog
+#define Uses_TFrame
+#define Uses_TPalette
+#define Uses_TInputLine
+#define Uses_TButton
+#define Uses_TCheckBoxes
+#define Uses_TRadioButtons
+#define Uses_TScrollBar
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TStaticText
+#define Uses_TListBox
+#define Uses_TProgram
+#define Uses_TMemo
+#define Uses_TLabel
+#define Uses_TSItem
+#define Uses_TCollection
+#define Uses_TMenuBar
+#define Uses_TStatusLine
+#define Uses_TDeskTop
+#define Uses_TWindow
+
+#include <tv.h>
+
+#include "fdconsts.h"
+#include "dsgdata.h"
+#include "propedit.h"
+/*
+typedef short TViewType;
+
+const TViewType
+ vtNone = -1,
+ vtOther = 0,
+ vtLabel = 1,
+ vtInput = 2,
+ vtMemo = 3,
+ vtStatic = 4,
+ vtButton = 5,
+ vtListBox = 6,
+ vtRadioButton = 7,
+ vtCheckBox = 8,
+ vtVScroll = 9,
+ vtHScroll = 10,
+ vtDialog = 11;
+*/
+enum TViewType { vtNone = -1, vtOther, vtLabel, vtInput, vtMemo, vtStatic,
+ vtButton, vtListBox, vtRadioButton, vtCheckBox, vtVScroll, vtHScroll,
+ vtDialog };
+
+
+class TEditCollection: public TCollection
+{
+public:
+ TEditCollection(): TCollection(0, 1) { };
+ virtual void * readItem(ipstream &) { return 0; };
+ virtual void writeItem(void *, opstream &) { };
+};
+
+class TAppWindow: public TWindow
+{
+ TDeskTop * deskTop;
+ TMenuBar * menuBar;
+ TStatusLine * statusLine;
+ void removeStatusLine();
+ void removeMenuBar();
+public:
+ TAppWindow();
+ ~TAppWindow();
+ TEditCollection * dsgMenuBar;
+ TEditCollection * dsgSatusLine;
+ TEditCollection * dialogs;
+ static TFrame * initFrame(TRect r);
+ virtual TPalette& getPalette() const;
+ void setMenuBar(TEditCollection * aItems);
+ void setStatusLine(TEditCollection * aItems);
+ void setMenuBar(TMenuBar * aMenuBar);
+ void setStatusLine(TStatusLine * aStatusLine);
+ virtual void handleEvent(TEvent& event);
+ virtual void changeBounds(const TRect& bounds);
+};
+
+class TDFrame: public TFrame
+{
+public:
+ TDFrame(const TRect& bounds);
+ virtual void draw();
+};
+
+class opstream;
+
+class TDsgObj
+{
+protected:
+ int attrSize;
+ int nameIndex;
+ void buildName(TNameStr * name, int mode);
+ virtual void setViewData(TDsgObjData& data);
+ virtual TView * Me() { return 0; };
+ virtual void setupView(TView * View);
+public:
+ TDsgObj(TViewType ViewType);
+ virtual ~TDsgObj();
+ char * getScript(ushort ScriptType);
+ void setPos(TPoint neworigin, TPoint newsize);
+ virtual void dsgUpdate();
+ virtual void * dsgGetData() { return 0; };
+ virtual TView * createView(TView *) { return 0; };
+ int getAttrSize() { return attrSize; };
+
+ void * attributes;
+ TViewType viewType;
+ TDefaultData defaultData;
+ TDsgObj * dsgObj;
+ bool tabStop();
+};
+
+class TDDialog: public TDialog, public TDsgObj
+{
+ char * fileName;
+protected:
+ virtual TView * Me();
+public:
+ TDDialog();
+ virtual void shutDown();
+ virtual void draw();
+ static TFrame * initFrame(TRect r);
+ virtual void handleEvent(TEvent& event);
+ virtual void setState(ushort aState, Boolean enabled);
+// void setCurrentClass(ushort aClass);
+ void dinsert(TView * aView);
+ virtual void changeBounds(const TRect& bounds);
+ void dlgRun();
+
+ virtual void dsgUpdate();
+ virtual void * dsgGetData();
+ Boolean saveToFile(const char * FileName);
+ Boolean Save(int aCommand = cmCancel);
+ Boolean loadFromFile(const char * FileName);
+ void setModified(Boolean);
+ Boolean modified;
+};
+
+//class TDsgView: public TView, public TDsgObj { };
+
+class TDLabel: public TLabel, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ TDLabel(const TRect& bounds);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+
+ virtual void dsgUpdate();
+ virtual void * dsgGetData();
+ virtual TView * createView(TView * aLink);
+};
+
+class TDInputLine: public TInputLine, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ TDInputLine(const TRect& bounds);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+
+// virtual void dsgUpdate();
+// virtual void * dsgGetData();
+ virtual TView * createView(TView * aView);
+};
+
+class TDMemo: public TMemo, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ TDMemo(const TRect& bounds);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+
+// virtual void dsgUpdate();
+// virtual void * dsgGetData();
+ virtual TView * createView(TView * aView);
+};
+
+class TDStaticText: public TStaticText, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ TDStaticText(const TRect& bounds);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+
+ virtual void dsgUpdate();
+ virtual void * dsgGetData();
+ virtual TView * createView(TView * aView);
+};
+
+
+class TDButton: public TButton, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ TDButton(const TRect& bounds);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+
+ ushort getCommand();
+ ushort getFlags();
+ virtual void dsgUpdate();
+ virtual void * dsgGetData();
+ virtual TView * createView(TView * aView);
+};
+
+class TDListBox: public TListBox, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ TDListBox(const TRect& bounds);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+
+ virtual void dsgUpdate();
+ virtual void * dsgGetData();
+ virtual TView * createView(TView * aView);
+};
+
+
+class TDRadioButtons: public TRadioButtons, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ TDRadioButtons(const TRect& bounds, TSItem * aStrings);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+
+// virtual void dsgUpdate();
+ virtual void * dsgGetData();
+ virtual TView * createView(TView * aView);
+};
+
+
+class TDCheckBoxes: public TCheckBoxes, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ TDCheckBoxes(const TRect& bounds, TSItem * aStrings);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+
+// virtual void dsgUpdate();
+ virtual void * dsgGetData();
+ virtual TView * createView(TView * aView);
+};
+
+class TVScrollBar: public TScrollBar, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ TVScrollBar(const TRect& bounds);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+ virtual TView * createView(TView * aView);
+};
+
+class THScrollBar: public TScrollBar, public TDsgObj
+{
+protected:
+ virtual TView * Me();
+public:
+ THScrollBar(const TRect& bounds);
+ virtual void shutDown();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void changeBounds(const TRect& bounds);
+ virtual TView * createView(TView * aView);
+};
+
+void InitDlgEditor(const char * FileName);
+
+void DoneDialogEditor();
+
+TDDialog * DialogEditor();
+
+TDialog * ToolDialog();
+
+TWindow * ObjectEditor();
+
+void SetGrid(bool enable);
+
+bool GetGrid();
+
+// Code builder functions
+const char * buildCode(TDsgObj * aObj, char * buffer);
+
+#endif //_DSGOBJS_HPP_
+
diff --git a/tvision/examples/dlgdsn/fdconsts.h b/tvision/examples/dlgdsn/fdconsts.h
new file mode 100644
index 0000000..dc6757c
--- /dev/null
+++ b/tvision/examples/dlgdsn/fdconsts.h
@@ -0,0 +1,105 @@
+/***************************************************************************
+
+ fdconsts.h - Commom application constants
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#if !defined(_FDCONSTS_HPP_)
+#define _FDCONSTS_HPP_
+
+//---> FreeDsg constants
+
+const unsigned short
+ cmFirst = 100,
+ cmOpenProject = cmFirst + 1,
+ cmSaveProject = cmFirst + 2,
+ cmSaveProjectAs = cmFirst + 3,
+ cmOpenObj = cmFirst + 4,
+ cmSaveObj = cmFirst + 5,
+ cmSaveObjAs = cmFirst + 6,
+
+ cmWriteObjFunc = cmFirst + 7,
+ cmWriteObjUnit = cmFirst + 8,
+
+ cmShowGrid = cmFirst + 9,
+
+ cmViewProject = cmFirst + 10,
+ cmMenuEditor = cmFirst + 11,
+ cmStatusEditor = cmFirst + 12,
+ cmHintsEditor = cmFirst + 13,
+ cmCommandEdit = cmFirst + 14,
+ cmHelpCtxEdit = cmFirst + 15,
+ cmAppOptions = cmFirst + 16,
+ cmBuildApp = cmFirst + 17,
+ cmViewAppWindow = cmFirst + 18,
+
+ cmDialogEditor = cmFirst + 19,
+ cmObjects = cmFirst + 20,
+ cmObjEditor = cmFirst + 21,
+ cmNewProject = cmFirst + 22,
+
+ cmEditEvents = cmFirst + 0xff,
+ cmItemDropped = cmEditEvents + 1,
+ cmResizeObj = cmEditEvents + 2,
+ cmValueChanged = cmEditEvents + 3,
+ cmDlgRun = cmEditEvents + 4,
+
+ hcFirst = 1000,
+ hcOpenProject = hcFirst + 1,
+ hcSaveProject = hcFirst + 2,
+ hcSavePrjAs = hcFirst + 3,
+ hcChangeDir = hcFirst + 4,
+ hcOpenObj = hcFirst + 5,
+ hcSaveObj = hcFirst + 6,
+ hcSaveObjAs = hcFirst + 7,
+ hcQuit = hcFirst + 8,
+
+ hcUndo = hcFirst + 9,
+ hcCopy = hcFirst + 10,
+ hcCut = hcFirst + 11,
+ hcPaste = hcFirst + 12,
+
+ hcWriteCode = hcFirst + 13,
+ hcWriteFunc = hcFirst + 14,
+ hcWriteUnit = hcFirst + 15,
+
+ hcHideShowGrid = hcFirst + 16,
+
+ hcViewProject = hcFirst + 17,
+ hcMenuEdit = hcFirst + 18,
+ hcStatusEdit = hcFirst + 19,
+ hcHindEdit = hcFirst + 20,
+ hcCommandEdit = hcFirst + 21,
+ hcHelpCtxEdit = hcFirst + 22,
+ hcAppOptions = hcFirst + 23,
+ hcAppBuild = hcFirst + 24,
+ hcViewAppWindow = hcFirst + 25,
+ hcNewProject = hcFirst + 26,
+
+// Status defs contexts
+ hcDefs = hcFirst + 1000,
+
+ hcCommandEditor = hcDefs + 1,
+ hcHelpCtxEditor = hcDefs + 2,
+ hcDlgTring = hcDefs + 3,
+ hcMenuEditor = hcDefs + 4,
+ hcStatusEditor = hcDefs + 5,
+ hcDlgEditor = hcDefs + 6,
+ hcObjWindow = hcDefs + 7,
+ hcObjEditor = hcDefs + 8;
+
+#endif // _FDCONSTS_HPP_
+
diff --git a/tvision/examples/dlgdsn/freedsgn.cc b/tvision/examples/dlgdsn/freedsgn.cc
new file mode 100644
index 0000000..2c2e7d5
--- /dev/null
+++ b/tvision/examples/dlgdsn/freedsgn.cc
@@ -0,0 +1,370 @@
+/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ \ /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ /
+ -----=====<<<| FREEDSGN - A Turbo Vision App Design Helper |>>>=====-----
+ -----=====<<<| Version 0.1 - copyright (c) 1999 Warlei Alves |>>>=====-----
+ / \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \
+
+ w a l v e s @ u s a . n e t
+
+ -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <locale.h>
+
+#define Uses_TApplication
+#define Uses_TProgram
+#define Uses_TDesktop
+#define Uses_TRect
+#define Uses_TView
+#define Uses_MsgBox
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TKeys
+#define Uses_TEditor
+#define Uses_TDialog
+#define Uses_TCheckBoxes
+#define Uses_TRadioButtons
+#define Uses_TSItem
+#define Uses_TFileDialog
+#define Uses_TChDirDialog
+#define Uses_ofpstream
+#define Uses_ifpstream
+
+#include <tv.h>
+
+// Inclusoes locais =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+#include "dsgobjs.h"
+#include "consted.h"
+#include "strmoper.h"
+
+class TFreeDsgnApp: public TApplication
+{
+public:
+ TFreeDsgnApp();
+ virtual void handleEvent(TEvent& event);
+ static TMenuBar * initMenuBar( TRect r );
+ static TStatusLine * initStatusLine( TRect r );
+ virtual void outOfMemory();
+// virtual void idle();
+private:
+ void viewBuffer(TMemoData& r);
+ TDialog * ToolDlg;
+ TDDialog * EditDialog;
+ TWindow * ObjEdit;
+ TWindow * srcWindow;
+ TEditor * srcBuffer;
+ TConstCollection * PrjCommands;
+ TConstCollection * PrjHelpCtxs;
+ TConstEdit * CommandEditor;
+ TConstEdit * HelpCtxEditor;
+ TWindow * HintsEditor;
+ TWindow * MenusEditor;
+ TWindow * StatusDefEditor;
+ TWindow * TextViewer;
+};
+
+TFreeDsgnApp::TFreeDsgnApp():
+ TProgInit(&TFreeDsgnApp::initStatusLine,
+ &TFreeDsgnApp::initMenuBar,
+ &TApplication::initDeskTop), TApplication()
+{
+ PrjCommands = CommandsList();
+ PrjHelpCtxs = HelpCtxsList();
+ InitDlgEditor(0);
+ EditDialog = DialogEditor();
+ ToolDlg = ToolDialog();
+ ObjEdit = ObjectEditor();
+ getPalette().data[0x3f] = 0x4f;
+ getPalette().data[0x3e] = 0x38;
+ CommandEditor = HelpCtxEditor = 0;
+ HintsEditor = MenusEditor = StatusDefEditor = srcWindow = 0;
+}
+
+void TFreeDsgnApp::viewBuffer(TMemoData& rec)
+{
+ TRect r = deskTop->getExtent();
+ srcWindow = new TWindow(r, "Dialog function", 0);
+ TScrollBar * vs = new TScrollBar(
+ TRect(r.b.x - 1, r.a.y + 1, r.b.x, r.b.y - 1) );
+ TScrollBar * hs = new TScrollBar(
+ TRect(r.a.x + 1, r.b.y - 1, r.b.x - 1, r.b.y) );
+ srcWindow->insert(vs);
+ srcWindow->insert(hs);
+ r.grow(-1, -1);
+ srcBuffer = new TEditor(r, hs, vs, 0, rec.length);
+ srcWindow->insert(srcBuffer);
+ srcBuffer->insertText(rec.buffer, rec.length, False);
+ deskTop->insert(srcWindow);
+}
+
+void TFreeDsgnApp::handleEvent(TEvent& event)
+{
+ TDialog * d;
+ TWindow * w;
+ TRect r;
+ const char * str;
+
+ if (( event.what == evCommand ) && ( event.message.command == cmQuit ))
+ {
+ if ( messageBox( __("Are you sure?"),
+ mfConfirmation | mfYesButton | mfCancelButton ) != cmYes )
+ clearEvent(event);
+ }
+
+ TApplication::handleEvent(event);
+
+ if (event.what == evBroadcast)
+ {
+ switch(event.message.command)
+ {
+ case cmClosingWindow:
+ w = (TWindow *) event.message.infoPtr;
+ if (w == CommandEditor) CommandEditor = 0;
+ if (w == HelpCtxEditor) HelpCtxEditor = 0;
+ if (w == HintsEditor) HintsEditor = 0;
+ if (w == MenusEditor) MenusEditor = 0;
+ if (w == StatusDefEditor) StatusDefEditor = 0;
+ if (w == EditDialog) EditDialog = 0;
+ if (w == ObjEdit) ObjEdit = 0;
+ if (w == ToolDlg) ToolDlg = 0;
+ if (w == srcWindow) srcWindow = 0;
+ break;
+ default:;
+ }
+ }
+ else
+ if (event.what == evCommand )
+ {
+ switch(event.message.command)
+ {
+ case cmNewProject:
+ InitDlgEditor(0);
+ break;
+ case cmShowGrid:
+ SetGrid(!GetGrid());
+ break;
+/* case cmStatic...cmVoid:
+ EditDialog->setCurrentClass(event.message.command);
+ break; */
+ case cmDialogEditor:
+ if (!EditDialog) break;
+ if (!indexOf(EditDialog)) insert(EditDialog);
+ EditDialog->select();
+ break;
+ case cmObjEditor:
+ if (!ObjEdit) break;
+ if (!indexOf(ObjEdit)) insert(ObjEdit);
+ ObjEdit->select();
+ break;
+ case cmObjects:
+ if (!ToolDlg) break;
+ if (!indexOf(ToolDlg)) insert(ToolDlg);
+ ToolDlg->select();
+ break;
+ case cmDlgRun:
+ if (EditDialog) EditDialog->dlgRun();
+ break;
+// case cmCalculator:
+// break;
+ case cmCommandEdit:
+ if (CommandEditor)
+ CommandEditor->select();
+ else
+ {
+ CommandEditor = new TConstEdit();
+ CommandEditor->Edit(PrjCommands);
+ }
+ break;
+ case cmHelpCtxEdit:
+ if (HelpCtxEditor)
+ HelpCtxEditor->select();
+ else
+ {
+ HelpCtxEditor = new TConstEdit();
+ HelpCtxEditor->Edit(PrjHelpCtxs);
+ }
+ break;
+ case cmViewAppWindow:
+ w = new TAppWindow();
+ r = w->getExtent();
+// r.b.y = r.a.y + 1;
+ ((TAppWindow *)w)->setMenuBar(initMenuBar(r));
+// r = w->getExtent();
+// r.a.y = r.b.y - 1;
+ ((TAppWindow *)w)->setStatusLine(initStatusLine(r));
+ application->execView(w);
+ TObject::CLY_destroy(w);
+ break;
+ case cmChangeDir:
+ d = (TDialog *) validView( new TChDirDialog(0, 0) );
+ if (d != 0)
+ {
+ deskTop->execView(d);
+ TObject::CLY_destroy(d);
+ }
+ break;
+ case cmOpenObj:
+ str = getFileName(_("Open a dialog"), "*.fd*", 0);
+ if (str != 0) InitDlgEditor(str);
+ delete[] str;
+ break;
+ case cmSaveObj:
+ if (EditDialog) EditDialog->Save(cmYes);
+ break;
+ case cmSaveObjAs:
+ if (EditDialog)
+ {
+ str = getFileName(_("Save dialog as"), "*.fdg", 1);
+ if (str) EditDialog->saveToFile(str);
+ delete[] str;
+ }
+ break;
+ case cmWriteObjFunc:
+ if (srcWindow != 0) break;
+ TMemoData r;
+ strcpy(r.buffer, "");
+ buildCode(EditDialog, r.buffer);
+ r.length = strlen(r.buffer);
+ viewBuffer(r);
+ break;
+ case cmSave:
+ if (srcWindow)
+ {
+ str = getFileName(_("Save dialog as"), "*.src", 1);
+ if (str)
+ {
+ ofpstream * s = new ofpstream(str);
+ s->writeBytes(srcBuffer->buffer, srcBuffer->bufLen);
+ s->close();
+ delete s;
+ delete[] str;
+ }
+ }
+ break;
+ default: return;
+ }
+ }
+ clearEvent(event);
+}
+
+TMenuBar * TFreeDsgnApp::initMenuBar( TRect r )
+{
+ TMenuItem& menuBuild = *new TSubMenu( __("~B~uild obj code..."), kbNoKey, hcNoContext) +
+ *new TMenuItem( __("As ~f~unction"), cmWriteObjFunc, kbNoKey, hcWriteFunc) +
+ *new TMenuItem( __("As f~i~le"), cmWriteObjUnit, kbNoKey, hcWriteUnit);
+
+ TSubMenu& menuOptions = *new TSubMenu( __("~O~ptions"), kbNoKey, hcNoContext) +
+ *new TMenuItem( __("~G~rid On/Off"), cmShowGrid, kbNoKey, hcNoContext);
+
+ TSubMenu& menuProject = *new TSubMenu( __("~P~roject"), kbNoKey, hcNoContext) +
+ *new TMenuItem( __("~V~iew..."), cmViewProject, kbNoKey, hcViewProject) +
+ *new TMenuItem( __("~M~enu editor..."), cmMenuEditor, kbNoKey, hcMenuEdit) +
+ *new TMenuItem( __("~S~tatus bar..."), cmStatusEditor, kbNoKey, hcStatusEdit) +
+ *new TMenuItem( __("H~i~nts..."), cmHintsEditor, kbNoKey, hcHindEdit) +
+ *new TMenuItem( __("~C~ommands..."), cmCommandEdit, kbNoKey, hcCommandEdit) +
+ *new TMenuItem( __("~H~elp contexts..."), cmHelpCtxEdit, kbNoKey, hcHelpCtxEdit) +
+ newLine() +
+ *new TMenuItem( __("~A~pp options..."), cmAppOptions, kbNoKey, hcAppOptions) +
+ *new TMenuItem( __("~G~enerate APP code..."), cmBuildApp, kbNoKey, hcAppBuild) +
+ newLine() +
+ *new TMenuItem( __("App ~W~indow"), cmViewAppWindow, kbNoKey, hcViewAppWindow);
+
+ TSubMenu& menuEdit = *new TSubMenu( __("~E~dit"), kbNoKey, hcNoContext ) +
+// *new TMenuItem( __("~U~ndelete"), cmUndo, kbAltBack, hcUndo, "Alt+BkSpc") +
+ *new TMenuItem( __("~C~opy"), cmCopy, kbShiftIns, hcCopy, "Shift+Ins") +
+ *new TMenuItem( __("C~u~t"), cmCut, kbShiftDel, hcCut, "Shift+Del") +
+ *new TMenuItem( __("~P~aste"), cmPaste, kbCtrlIns, hcPaste, "Ctrl+Ins") +
+ newLine() +
+ menuBuild;
+
+ TSubMenu& menuFile = *new TSubMenu(__("~F~ile"), kbNoKey, hcNoContext ) +
+ *new TMenuItem( __("~N~ew project..."), cmNewProject, kbNoKey, hcNewProject ) +
+ *new TMenuItem( __("~O~pen project..."), cmOpenProject, kbNoKey, hcOpenProject ) +
+ *new TMenuItem( __("~S~ave project..."), cmSaveProject, kbNoKey, hcSaveProject ) +
+ *new TMenuItem( __("Sa~v~e project as..."), cmSaveProjectAs, kbNoKey, hcSavePrjAs ) +
+ newLine() +
+ *new TMenuItem( __("O~p~en object..."), cmOpenObj, kbNoKey, hcOpenObj ) +
+ *new TMenuItem( __("Save ~o~bject..."), cmSaveObj, kbNoKey, hcSaveObj ) +
+ *new TMenuItem( __("Save object ~a~s..."), cmSaveObjAs, kbNoKey, hcSaveObjAs ) +
+ *new TMenuItem( __("Save ~s~ource..."), cmSave, kbNoKey, hcNoContext ) +
+ newLine() +
+ *new TMenuItem( __("~C~hange directory..."), cmChangeDir, kbNoKey, hcChangeDir ) +
+ *new TMenuItem( __("~Q~uit"), cmQuit, kbNoKey, hcQuit );
+
+ r.b.y = r.a.y + 1;
+ return new TMenuBar( r, menuFile +
+ menuEdit +
+ menuProject +
+ menuOptions
+ );
+}
+
+TStatusLine * TFreeDsgnApp::initStatusLine( TRect r )
+{
+#define CommomHide() *new TStatusItem(__("~F1~ Help"), kbF1, cmHelp) + \
+ *new TStatusItem(0, kbAltQ, cmQuit) + \
+ *new TStatusItem(0, kbAltF3, cmClose) + \
+ *new TStatusItem(0, kbF5, cmZoom) + \
+ *new TStatusItem(0, kbCtrlF5, cmResize) + \
+ *new TStatusItem(0, kbF6, cmNext) + \
+ *new TStatusItem(0, kbShiftF6, cmPrev)
+// r = deskTop->getExtent();
+ r.a.y = r.b.y - 1;
+ return new TStatusLine(r,
+ *new TStatusDef( 0, 0xffff ) +
+ CommomHide() +
+ *new TStatusItem(__("~F7~ Objects"), kbF7, cmObjects ) +
+ *new TStatusItem(__("~F8~ Dialog"), kbF8, cmDialogEditor ) +
+ *new TStatusItem(__("~F9~ Obj Editor"), kbF9, cmObjEditor ) +
+ *new TStatusItem(__("~^F9~ Run dialog"), kbCtrlF9, cmDlgRun ) +
+ *new TStatusDef(hcDragging, hcDragging) +
+ *new TStatusItem(__("~PgUp/PgDn/Home/End~ to limits"), 0, 0) +
+ *new TStatusItem(__("~\x18\x19\x1a\x1b~ Move"), 0, 0 ) +
+ *new TStatusItem(__("~^+[\x18\x19\x1a\x1b]~ tab move"), 0, 0 ) +
+ *new TStatusItem(__("~Shift+[\x18\x19\x1a\x1b]~ Resize"), 0, 0 ) +
+ *new TStatusItem(__("~ENTER~ put"), 0, 0 ) +
+ *new TStatusItem(__("~ESC~ cancel"), 0, 0 )
+ );
+}
+
+void TFreeDsgnApp::outOfMemory()
+{
+ messageBox( __("Not enough memory for this operation."), mfError | mfOKButton );
+}
+
+
+int main()
+{
+ const char * _LocaleDir = TVIntl::bindTextDomain("mtv", NULL);
+ if (_LocaleDir)
+ {
+ char * LocaleDir = strdup(_LocaleDir);
+ setlocale(LC_ALL, ""); // Utilizando ambiente LANG
+ TVIntl::bindTextDomain("mtv", LocaleDir); // Ajusta o caminho
+ TVIntl::textDomain("mtv"); // Confirma o arquivo mo
+ free(LocaleDir);
+ }
+ TFreeDsgnApp *app = new TFreeDsgnApp();
+ if (app)
+ {
+ app->run();
+ delete app;
+ }
+ return 0;
+}
diff --git a/tvision/examples/dlgdsn/libtest.gpr b/tvision/examples/dlgdsn/libtest.gpr
new file mode 100644
index 0000000..488bb61
--- /dev/null
+++ b/tvision/examples/dlgdsn/libtest.gpr
Binary files differ
diff --git a/tvision/examples/dlgdsn/libtest.mkf b/tvision/examples/dlgdsn/libtest.mkf
new file mode 100644
index 0000000..ca527ec
--- /dev/null
+++ b/tvision/examples/dlgdsn/libtest.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include libtest$(ExIMK)
diff --git a/tvision/examples/dlgdsn/libtest.umk b/tvision/examples/dlgdsn/libtest.umk
new file mode 100644
index 0000000..075fc5f
--- /dev/null
+++ b/tvision/examples/dlgdsn/libtest.umk
@@ -0,0 +1,52 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./codebldr$(ExOBJ) \
+ ./consted$(ExOBJ) \
+ ./dsgobjs$(ExOBJ) \
+ ./freedsgn$(ExOBJ) \
+ ./propdlgs$(ExOBJ) \
+ ./propedit$(ExOBJ) \
+ ./strmoper$(ExOBJ) \
+ ./tappwnd$(ExOBJ)
+
+LIBRARIES=
+
+freedsgn$(ExEXE):: \
+ ./codebldr$(ExOBJ) \
+ ./consted$(ExOBJ) \
+ ./dsgobjs$(ExOBJ) \
+ ./freedsgn$(ExOBJ) \
+ ./propdlgs$(ExOBJ) \
+ ./propedit$(ExOBJ) \
+ ./strmoper$(ExOBJ) \
+ ./tappwnd$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./codebldr$(ExOBJ):: codebldr.cc
+ $(RHIDE_COMPILE_CC)
+
+./consted$(ExOBJ):: consted.cc
+ $(RHIDE_COMPILE_CC)
+
+./dsgobjs$(ExOBJ):: dsgobjs.cc
+ $(RHIDE_COMPILE_CC)
+
+./freedsgn$(ExOBJ):: freedsgn.cc
+ $(RHIDE_COMPILE_CC)
+
+./propdlgs$(ExOBJ):: propdlgs.cc
+ $(RHIDE_COMPILE_CC)
+
+./propedit$(ExOBJ):: propedit.cc
+ $(RHIDE_COMPILE_CC)
+
+./strmoper$(ExOBJ):: strmoper.cc
+ $(RHIDE_COMPILE_CC)
+
+./tappwnd$(ExOBJ):: tappwnd.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/dlgdsn/propdlgs.cc b/tvision/examples/dlgdsn/propdlgs.cc
new file mode 100644
index 0000000..5d85fa5
--- /dev/null
+++ b/tvision/examples/dlgdsn/propdlgs.cc
@@ -0,0 +1,545 @@
+/***************************************************************************
+
+ propdlgs.cc - Implements the object property dialog editor
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Modified by Salvador E. Tropea to compile without warnings.
+ For gcc 2.95.x and then 3.0.1.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <string.h>
+#include <stdio.h>
+
+#define Uses_TDialog
+#define Uses_TRect
+#define Uses_TCheckBoxes
+#define Uses_TButton
+#define Uses_TView
+#define Uses_TLabel
+#define Uses_TSItem
+#define Uses_TCluster
+#define Uses_TRadioButtons
+#define Uses_TScrollBar
+#define Uses_MsgBox
+#define Uses_TStringCollection
+#define Uses_TMemo
+
+#include <tv.h>
+
+#include "consted.h"
+#include "propedit.h"
+
+// String makers
+
+static char strbuf[1024];
+
+#define _appendstr_(a) do { if (strlen(strbuf)) strcat(strbuf, " | ");\
+ strcat(strbuf, a); } while(0)
+/*
+void _appendstr_(const char * s)
+{
+ strcat(strbuf, " | ", strcat(strbuf, s));
+}
+*/
+char * OptionsStr(ushort aOptions)
+{
+ if (aOptions == 0) { strcpy(strbuf, "<none>"); return strbuf; }
+ strcpy(strbuf, "");
+ if (aOptions & ofSelectable) _appendstr_("ofSelectable");
+ if (aOptions & ofTopSelect) _appendstr_("ofTopSelect");
+ if (aOptions & ofFirstClick) _appendstr_("ofFirstClick");
+ if (aOptions & ofFramed) _appendstr_("ofFramed");
+ if (aOptions & ofPreProcess) _appendstr_("ofPreProcess");
+ if (aOptions & ofPostProcess) _appendstr_("ofPostProcess");
+ if (aOptions & ofBuffered) _appendstr_("ofBuffered");
+ if (aOptions & ofTileable) _appendstr_("ofTileable");
+ if ((aOptions & ofCentered) == ofCentered)
+ _appendstr_("ofCentered");
+ else
+ {
+ if (aOptions & ofCenterX) _appendstr_("ofCenterX");
+ if (aOptions & ofCenterY) _appendstr_("ofCenterY");
+ }
+ return strbuf;
+}
+
+char * EventMaskStr(ushort aEventMask)
+{
+ if (aEventMask == 0) { strcpy(strbuf, "evNothing"); return strbuf; }
+ strcpy(strbuf, "");
+ if ((aEventMask & evMouse) == evMouse) _appendstr_("evMouse");
+ else
+ {
+ if (aEventMask & evMouseDown) _appendstr_("evMouseDown");
+ if (aEventMask & evMouseUp) _appendstr_("evMouseUp");
+ if (aEventMask & evMouseMove) _appendstr_("evMouseMove");
+ if (aEventMask & evMouseAuto) _appendstr_("evMouseAuto");
+ }
+ if (aEventMask & evKeyboard) _appendstr_("evKeyboard");
+ if (aEventMask & evCommand) _appendstr_("evCommand");
+ if (aEventMask & evBroadcast) _appendstr_("evBroadcast");
+ return strbuf;
+}
+
+char * StateStr(ushort aState)
+{
+ if (aState == 0) { strcpy(strbuf, "<none>"); return strbuf; }
+ strcpy(strbuf, "");
+ if (aState & sfVisible) _appendstr_("sfVisible");
+ if (aState & sfShadow) _appendstr_("sfShadow");
+ if (aState & sfDisabled) _appendstr_("sfDisabled");
+ if (aState & sfModal) _appendstr_("sfModal");
+ if (aState & sfDefault) _appendstr_("sfDefault");
+ return strbuf;
+}
+
+char * GrowModeStr(ushort aGrowMode)
+{
+ if (aGrowMode == 0) { strcpy(strbuf, "<none>"); return strbuf; }
+ strcpy(strbuf, "");
+ if ((aGrowMode & gfGrowAll) == gfGrowAll) _appendstr_("gfGrowAll");
+ else
+ {
+ if (aGrowMode & gfGrowLoX) _appendstr_("gfGrowLoX");
+ if (aGrowMode & gfGrowLoY) _appendstr_("gfGrowLoY");
+ if (aGrowMode & gfGrowHiX) _appendstr_("gfGrowHiX");
+ if (aGrowMode & gfGrowHiY) _appendstr_("gfGrowHiY");
+ }
+ if (aGrowMode & gfGrowRel) _appendstr_("gfGrowRel");
+ return strbuf;
+}
+
+char * DragModeStr(ushort aDragMode)
+{
+ if (aDragMode == 0) { strcpy(strbuf, "<none>"); return strbuf; }
+ strcpy(strbuf, "");
+ if (aDragMode & dmDragMove) _appendstr_("dmDragMove");
+ if (aDragMode & dmDragGrow) _appendstr_("dmDragGrow");
+ if ((aDragMode & dmLimitAll) == dmLimitAll)
+ _appendstr_("dmLimitAll");
+ else
+ {
+ if (aDragMode & dmLimitLoX) _appendstr_("dmLimitLoX");
+ if (aDragMode & dmLimitLoY) _appendstr_("dmLimitLoY");
+ if (aDragMode & dmLimitHiX) _appendstr_("dmLimitHiX");
+ if (aDragMode & dmLimitHiY) _appendstr_("dmLimitHiY");
+ }
+ return strbuf;
+}
+
+char * HelpCtxStr(ushort aHelpCtx)
+{
+ return HelpCtxsList()->getId(aHelpCtx);
+}
+
+char * CommandStr(ushort aCommand)
+{
+ return CommandsList()->getId(aCommand);
+}
+
+char * ButtonFlagStr(ushort aButtonFlag)
+{
+ strcpy(strbuf, "bfNormal");
+ if (aButtonFlag == 0) return strbuf; else strcpy(strbuf, "");
+ if (aButtonFlag & bfDefault) _appendstr_("bfDefault");
+ if (aButtonFlag & bfLeftJust) _appendstr_("bfLeftJust");
+ if (aButtonFlag & bfBroadcast) _appendstr_("bfBroadcast");
+ return strbuf;
+}
+
+char * WindowFlagStr(ushort aWindowFlag)
+{
+ if (aWindowFlag == 0) { strcpy(strbuf, "<none>"); return strbuf; }
+ strcpy(strbuf, "");
+ if (aWindowFlag & wfMove) _appendstr_("wfMove");
+ if (aWindowFlag & wfGrow) _appendstr_("wfGrow");
+ if (aWindowFlag & wfClose) _appendstr_("wfClose");
+ if (aWindowFlag & wfZoom) _appendstr_("wfZoom");
+ return strbuf;
+}
+
+char * ValidatorStr(ushort aValidator)
+{
+ strcpy(strbuf, "");
+ switch(aValidator)
+ {
+ case 0: strcpy(strbuf, "<none>"); break;
+ case 1: strcpy(strbuf, "vtUserDefined"); break;
+ case 2: strcpy(strbuf, "vtRangeValidator"); break;
+ case 3: strcpy(strbuf, "vtFilterValidator"); break;
+ case 4: strcpy(strbuf, "vtPictureValidator"); break;
+ default: strcpy(strbuf, "<invalid>");
+ }
+ return strbuf;
+}
+
+char * ItemsStr(void * aItemPtr)
+{
+ if (aItemPtr) sprintf(strbuf, "%s (%p)", "(void *)", aItemPtr);
+ else sprintf(strbuf, "%s", "<null>");
+ return strbuf;
+}
+
+char * CharPtrStr(void * aItemPtr)
+{
+ if (aItemPtr) sprintf(strbuf, "%s (%p)", "(char *)", aItemPtr);
+ else sprintf(strbuf, "%s", "<null>");
+ return strbuf;
+}
+
+#undef _appendstr_
+
+// Properties editors
+
+TDialog * SelDialog(const char * Title, TView * c)
+{
+ int h = c->size.y;
+
+ TDialog * d = new TDialog( TRect(1, 1, 26, 6 + h), Title );
+
+ d->options |= ofCentered;
+ d->flags &= ~wfClose;
+ c->options |= ofFramed;
+ d->insert(c);
+ d->insert( new TButton( TRect(1, d->size.y - 3, 12, d->size.y - 1),
+ __("~O~k"), cmOK, bfDefault ) );
+ d->insert( new TButton( TRect(12, d->size.y - 3, 23, d->size.y - 1),
+ __("~C~ancel"), cmCancel, 0 ) );
+ d->selectNext(False);
+ return d;
+}
+
+TDialog * OptionsEditor()
+{
+ return SelDialog(_("Options"),
+ new TCheckBoxes( TRect( 1, 1, 24, 12), new TSItem("ofSelectable",
+ new TSItem("ofTopSelect",
+ new TSItem("ofFirstClick",
+ new TSItem("ofFramed",
+ new TSItem("ofPreProcess",
+ new TSItem("ofPostProcess",
+ new TSItem("ofBuffered",
+ new TSItem("ofTileable",
+ new TSItem("ofCenterX",
+ new TSItem("ofCenterY",
+ new TSItem("ofBeVerbose", 0
+ )))))))))))) );
+}
+
+TDialog * EventMaskEditor()
+{
+ return SelDialog(_("Event masks"),
+ new TCheckBoxes( TRect( 1, 1, 24, 8), new TSItem("evMouseDown",
+ new TSItem("evMouseUp",
+ new TSItem("evMouseMove",
+ new TSItem("evMouseAuto",
+ new TSItem("evKeyDown",
+ new TSItem("evCommand",
+ new TSItem("evBroadcast", 0
+ )))))))) );
+}
+
+TDialog * StateEditor()
+{
+ TCheckBoxes * t =
+ new TCheckBoxes( TRect( 1, 1, 24, 13), new TSItem("sfVisible", //0
+ new TSItem("sfCursorVis", //1
+ new TSItem("sfCursorIns", //2
+ new TSItem("sfShadow", //3
+ new TSItem("sfActive", //4
+ new TSItem("sfSelected", //5
+ new TSItem("sfFocused", //6
+ new TSItem("sfDragging", //7
+ new TSItem("sfDisabled", //8
+ new TSItem("sfModal", //9
+ new TSItem("sfDefault", //10
+ new TSItem("sfExposed", 0 //11
+ )))))))))))));
+#if 0
+ t->setButtonState(5, false);
+ t->setButtonState(6, false);
+ t->setButtonState(7, false);
+//t->setButtonState(9, false);
+ t->setButtonState(11, false);
+#endif
+ return SelDialog(_("TView States"), t);
+}
+
+TDialog * GrowModeEditor()
+{
+ return SelDialog(_("Grow modes"),
+ new TCheckBoxes( TRect( 1, 1, 24, 6), new TSItem("gfGrowLoX",
+ new TSItem("gfGrowLoY",
+ new TSItem("gfGrowHiX",
+ new TSItem("gfGrowHiY",
+ new TSItem("gfGrowRel", 0
+ )))))) );
+
+}
+
+TDialog * DragModeEditor()
+{
+ return SelDialog(_("Drag modes"),
+ new TCheckBoxes( TRect( 1, 1, 24, 7), new TSItem("dmDragMove",
+ new TSItem("dmDragGrow",
+ new TSItem("dmLimitLoX",
+ new TSItem("dmLimitLoY",
+ new TSItem("dmLimitHiX",
+ new TSItem("dmLimitHiY", 0
+ ))))))) );
+}
+
+TDialog * DlgRefList(const char * aTitle)
+{
+ TRect r;
+ TScrollBar * sb = new TScrollBar( TRect(30, 1, 31, 10) );
+ TIntConstListBox * l = new TIntConstListBox( TRect( 1, 1, 31, 10), 1, sb );
+ TDialog * d = SelDialog(aTitle, l);
+ r = d->getBounds();
+ r.b.x += 7;
+ d->changeBounds(r);
+ d->insert(sb);
+ return d;
+}
+
+TDialog * HelpCtxEditor()
+{
+ return DlgRefList(_("Help contexts"));
+}
+
+TDialog * CommandEditor()
+{
+ return DlgRefList(_("Commands"));
+}
+
+TDialog * DlgObjList(const char * aTitle)
+{
+ TRect r;
+ TScrollBar * sb = new TScrollBar( TRect(30, 1, 31, 10) );
+ TListBox * l = new TListBox( TRect( 1, 1, 31, 10), 1, sb );
+ TDialog * d = SelDialog(aTitle, l);
+ r = d->getBounds();
+ r.b.x += 7;
+ d->changeBounds(r);
+ d->insert(sb);
+ return d;
+}
+
+TDialog * LinkEditor()
+{
+ return DlgObjList(_("Avail. views"));
+}
+
+TDialog * ScrollEditor()
+{
+ return DlgObjList(_("Avail. scrolls"));
+}
+
+TDialog * ButtonFlagEditor()
+{
+ return SelDialog(_("TButton flags"),
+ new TCheckBoxes( TRect( 1, 1, 24, 4), new TSItem("bfDefault",
+ new TSItem("bfLeftJust",
+ new TSItem("bfBroadcast", 0
+ )))) );
+}
+
+TDialog * WindowFlagEditor()
+{
+ return SelDialog(_("TWindow flags"),
+ new TCheckBoxes( TRect( 1, 1, 24, 5), new TSItem("wfMove",
+ new TSItem("wfGrow",
+ new TSItem("wfClose",
+ new TSItem("wfZoom", 0
+ ))))) );
+}
+
+TDialog * ValidatorEditor()
+{
+ return SelDialog(_("TValidators"),
+ new TRadioButtons( TRect( 1, 1, 24, 6), new TSItem("<none>",
+ new TSItem("vtUserDefined",
+ new TSItem("vtRangeValidator",
+ new TSItem("vtFilterValidator",
+ new TSItem("vtPictureValidator", 0
+ )))))) );
+}
+
+class ipstream;
+class opstream;
+
+// TItemsEditor
+
+class TSafeListBox: public TListBox
+{
+public:
+ TSafeListBox(const TRect& bounds, ushort aNumCols, TScrollBar * sb):
+ TListBox(bounds, aNumCols, sb) { };
+ void getText(char *dest, ccIndex item, short maxLen)
+ {
+ if (strlen((char *)items->at(item)) > (size_t)maxLen)
+ {
+ strncpy(dest, (char *)items->at(item), maxLen);
+ dest[maxLen] = 0;
+ } else strcpy(dest, (char *)items->at(item));
+ }
+};
+
+class TItemsEditor: public TDialog
+{
+ TStringCollection * cList;
+ TSafeListBox * List;
+public:
+ TItemsEditor();
+ virtual void setData(void *);
+ virtual void getData(void *) { };
+ virtual void handleEvent(TEvent& event);
+};
+
+const ushort
+ cmEdit = 200,
+ cmAdd = 201,
+ cmDel = 202,
+ cmCClear = 203;
+
+TItemsEditor::TItemsEditor():
+ TWindowInit(&TItemsEditor::initFrame),
+ TDialog( TRect(0, 0, 45, 16) , __("Items") )
+{
+ TScrollBar * sb;
+
+ options |= ofCentered;
+
+ sb = new TScrollBar(TRect(30, 2, 31, 14));
+ List = new TSafeListBox(TRect(2, 2, 30, 14), 1, sb);
+ insert(sb);
+ insert(new TLabel( TRect(1, 1, 15, 2), _("~I~tems list:"), List ) );
+ insert(List);
+ insert( new TButton(TRect(31, 2, 43, 4), __("~O~k"), cmOK, 0 ) );
+ insert( new TButton(TRect(31, 4, 43, 6), __("~C~ancel"), cmCancel, 0 ) );
+ insert( new TButton(TRect(31, 6, 43, 8), __("~E~dit"), cmEdit, bfBroadcast ) );
+ insert( new TButton(TRect(31, 8, 43, 10), __("~A~dd"), cmAdd, bfBroadcast ) );
+ insert( new TButton(TRect(31, 10, 43, 12), __("C~l~ear"), cmCClear, bfBroadcast ) );
+ insert( new TButton(TRect(31, 12, 43, 14), __("~D~elete"), cmDel, bfBroadcast ) );
+ cList = 0;
+ selectNext(False);
+}
+
+void TItemsEditor::setData(void * data)
+{
+ TListBoxRec rec;
+
+ cList = (TStringCollection *)data;
+ rec.items = cList;
+ rec.selection = 0;
+ List->setData(&rec);
+}
+
+
+void TItemsEditor::handleEvent(TEvent& event)
+{
+ char buf[50];
+ char * c;
+ TDialog::handleEvent(event);
+
+ if (!cList) return;
+
+ if (event.what == evBroadcast)
+ switch(event.message.command)
+ {
+ case cmListItemSelected:
+ if ( (cList->getCount() > 0) && (List->focused >= 0) )
+ {
+ c = (char *)(cList->at(List->focused));
+ strcpy(buf, c);
+ List->drawView();
+ if (inputBox(_("Item Edit"), _("Item:"), buf, 50) == cmOK)
+ {
+ delete[] c;
+ cList->atPut(List->focused, newStr(buf));
+ List->drawView();
+ }
+ }
+ clearEvent(event);
+ break;
+ case cmEdit:
+ if (cList->getCount() == 0)
+ {
+ event.message.command = cmAdd;
+ putEvent(event);
+ clearEvent(event);
+ }
+ else
+ {
+ event.message.command = cmListItemSelected;
+ putEvent(event);
+ clearEvent(event);
+ }
+ break;
+ case cmAdd:
+ buf[0] = 0;
+ if (inputBox(_("Item Add"), _("Item:"), buf, 50) == cmOK)
+ {
+ cList->setLimit(cList->getCount() + 1);
+ cList->atInsert(cList->getCount(), newStr(buf));
+ List->setRange(List->range + 1);
+ List->focusItem( cList->getCount() - 1 );
+ List->drawView();
+ }
+ clearEvent(event);
+ break;
+ case cmDel:
+ if ( messageBox(__("Are you sure ?"), mfYesNoCancel) == cmYes )
+ {
+ cList->atFree(List->focused);
+ cList->pack();
+ clearEvent(event);
+ List->setRange(List->range - 1);
+ List->drawView();
+ }
+ break;
+ case cmCClear:
+ if ( messageBox(__("Are you sure ?"), mfYesNoCancel) == cmYes )
+ {
+ cList->freeAll();
+ List->setRange(0);
+ List->drawView();
+ }
+ clearEvent(event);
+ break;
+ }
+}
+
+TDialog * ItemsEditor()
+{
+ return new TItemsEditor();
+}
+
+TDialog * CharPtrEditor()
+{
+ TDialog * d = new TDialog( TRect(0, 0, 40, 20), __("Text editor") );
+ TScrollBar * VS = new TScrollBar( TRect(38, 1, 39, 15) );
+ TScrollBar * HS = new TScrollBar( TRect(1, 15, 38, 16) );
+ d->insert( new TMemo( TRect(1, 1, 39, 15), VS, HS, 0, 1024 ) );
+ d->insert(VS);
+ d->insert(HS);
+ d->insert( new TButton ( TRect(17, 17, 27, 19), __("~O~k"), cmOK, bfDefault ) );
+ d->insert( new TButton ( TRect(28, 17, 38, 19), __("~C~ancel"), cmCancel, 0 ) );
+ d->selectNext(False);
+ d->options |= ofCentered;
+ return d;
+}
+
diff --git a/tvision/examples/dlgdsn/propdlgs.h b/tvision/examples/dlgdsn/propdlgs.h
new file mode 100644
index 0000000..2f2bd2b
--- /dev/null
+++ b/tvision/examples/dlgdsn/propdlgs.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+
+ propdlgs.h - Functions prototypes for property editors
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#if !defined(_PROPDLGS_HPP_)
+#define _PROPDLGS_HPP_
+
+class TDialog;
+
+// String maker functions - convert properties to its string representation
+char * OptionsStr(ushort aOptions);
+char * EventMaskStr(ushort aEventMask);
+char * StateStr(ushort aState);
+char * GrowModeStr(ushort aGrowMode);
+char * DragModeStr(ushort aDragMode);
+char * HelpCtxStr(ushort aHelpCtx);
+char * CommandStr(ushort aCommand);
+char * ButtonFlagStr(ushort aButtonFlag);
+char * WindowFlagStr(ushort aWindowFlag);
+char * ValidatorStr(ushort aWindowFlag);
+char * ItemsStr(void * aItemPtr);
+char * CharPtrStr(void * aItemPtr);
+
+// Properties editors
+TDialog * OptionsEditor();
+TDialog * EventMaskEditor();
+TDialog * StateEditor();
+TDialog * GrowModeEditor();
+TDialog * DragModeEditor();
+TDialog * HelpCtxEditor();
+TDialog * CommandEditor();
+TDialog * ButtonFlagEditor();
+TDialog * WindowFlagEditor();
+TDialog * ValidatorEditor();
+TDialog * ItemsEditor();
+TDialog * CharPtrEditor();
+TDialog * LinkEditor();
+TDialog * ScrollEditor();
+
+#endif // _PROPDLGS_HPP_
+
diff --git a/tvision/examples/dlgdsn/propedit.cc b/tvision/examples/dlgdsn/propedit.cc
new file mode 100644
index 0000000..a95e4c5
--- /dev/null
+++ b/tvision/examples/dlgdsn/propedit.cc
@@ -0,0 +1,1220 @@
+/***************************************************************************
+
+ propedit.cc - object properties editor
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Heavily modified by Salvador E. Tropea to compile without warnings.
+ Some warnings were in fact bugs.
+ For gcc 2.95.x and then 3.0.1.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TScrollBar
+#define Uses_TKeys
+#define Uses_TDrawBuffer
+#define Uses_TDialog
+#define Uses_TEventQueue
+#define Uses_MsgBox
+#define Uses_TListBox
+#define Uses_TStringCollection
+#define Uses_TCollection
+#define Uses_TInputLine
+#define Uses_TPalette
+#define Uses_TValidator
+#define Uses_TFilterValidator
+
+#include <tv.h>
+
+#include "dsgdata.h"
+#include "propedit.h"
+#include "dsgobjs.h"
+#include "propdlgs.h"
+#include "consted.h"
+#include "fdconsts.h"
+
+enum TDataEditorType
+ {
+ etNone,
+ etStringEditor, // Short string value up to 60 bytes
+ etIntegerEditor, // Integer value
+ etOptionsEditor, // View options value
+ etEventMaskEditor, // View eventMask value
+ etStateEditor, // View initial state value ( some of them )
+ etGrowModeEditor, // View growMode value
+ etDragModeEditor, // View dragMode value
+ etHelpCtxEditor, // hc## value
+ etCommandEditor, // cm## value
+ etButtonFlagEditor, // Button flag value
+ etWindowFlagEditor, // Window flag value
+ etValidatorEditor, // TValidator type value
+ etCharPtrEditor, // Null terminated string value
+ etValidatorDataEditor, // TValidator data value (Filter | range)
+ etStrCollectionEditor, // Generic string lists
+ etLinkEditor, // Links for TDLabel
+ etScrollBarEditor, // ScrollBars
+ };
+
+// Objects that can be a link for a TDLabel
+static TStringCollection * LinkList = 0;
+// Available V and H scrollbars
+static TStringCollection * ScrollList = 0;
+
+// Global object manager list
+static TLinkList * ObjLink = 0;
+
+// Current object editor
+static TObjEdit * ObjEdit;
+
+// To resolve (sprintf "%s") when there is nothing to do
+static char * blank = "";
+
+//extern int TabOrder;
+
+/* functions ==============================================================*/
+
+// Standard execDialog without free the dialog
+int execDialog_NoFree(TDialog * dialog, void *data)
+{
+ int rst;
+
+ TView * d = TProgram::application->validView(dialog);
+ if (d)
+ {
+ if (data) d->setData(data);
+ rst = TProgram::deskTop->execView(d);
+ if ((rst!=cmCancel) && (data)) d->getData(data);
+ return rst;
+ }
+ else return cmCancel;
+}
+
+// Standard execDialog
+int execDialog(TDialog * dialog, void *data)
+{
+ int rst;
+
+ TView * d = TProgram::application->validView(dialog);
+ if (d)
+ {
+ if (data) d->setData(data);
+ rst = TProgram::deskTop->execView(d);
+ if ((rst!=cmCancel) && (data)) d->getData(data);
+ TObject::CLY_destroy( d );
+ return rst;
+ }
+ else return cmCancel;
+}
+
+/* TLinkList ============================================================*/
+
+// Sorter func by tabulation order
+static int byTabOrder(const void * key1, const void * key2)
+{
+ TDsgObj * d1 = (TDsgObj *)((TDsgLink *)key1)->d;
+ TDsgObj * d2 = (TDsgObj *)((TDsgLink *)key2)->d;
+
+ bool d1CanTab = d1->tabStop();
+ bool d2CanTab = d2->tabStop();
+
+ if (!d1CanTab && d2CanTab) return -1;
+ if (!d1CanTab && !d2CanTab) return 0;
+ if (d1CanTab && !d2CanTab) return 1;
+
+ short t1 = ((TDsgObjData *)d1->attributes)->tabOrder;
+ short t2 = ((TDsgObjData *)d2->attributes)->tabOrder;
+
+ if (d1CanTab && d2CanTab)
+ {
+ if ((t1 > t2) - (t1 < t2) == 0)
+ {
+ if (d1 == ObjEdit->object) return 1;
+ if (d2 == ObjEdit->object) return -1;
+ } else return (t1 > t2) - (t1 < t2);
+ }
+ return 0;
+}
+/*
+static int byCreationOrder(void * key1, void * key2)
+{
+ c1 = ((TDsgObj *)((TDataLink *&)*key1)->d)->creationOrder;
+ c2 = ((TDsgObj *)((TDataLink *&)*key2)->d)->creationOrder;
+ return (c1 > c2) - (c1 < c2);
+}
+*/
+// Test functions
+static Boolean matchView(void * link, void * view)
+{
+ return (((TDsgLink *)link)->v == view);
+}
+
+static Boolean matchDsgObj(void * link, void * dsgObj)
+{
+ return (((TDsgLink *)link)->d == dsgObj);
+}
+
+static Boolean matchScroll(void * link, void * aName)
+{
+ TDsgObj * d = ((TDsgLink *)link)->d;
+ return (
+ (d->viewType == vtVScroll || d->viewType == vtHScroll) &&
+ strcmp( ((TDsgObjData*)d->attributes)->thisName, (char *)aName ) == 0 );
+}
+
+static Boolean matchLabel(void * link, void * aLink)
+{
+ TDsgObj * d = ((TDsgLink *)link)->d;
+ return ( d->viewType == vtLabel &&
+ strcmp( ((TDLabelData *)d->attributes)->link, (char *)aLink ) == 0 );
+}
+
+// Find functions
+TDsgLink * TLinkList::viewFind(void * aView) // by View
+{
+ return (TDsgLink *)firstThat(&matchView, aView);
+}
+
+TDsgLink * TLinkList::dsgObjFind(void * aDsgObj) // by DsgObj
+{
+ return (TDsgLink *)firstThat(&matchDsgObj, aDsgObj);
+}
+
+TDsgLink * TLinkList::linkFind(char * aName) // Look for a label
+{
+ return (TDsgLink *)firstThat(&matchLabel, aName);
+}
+
+TDsgLink * TLinkList::scrollFind(char * aScroll) // Look for a ScrollBar
+{
+ return (TDsgLink *)firstThat(&matchScroll, aScroll);
+}
+
+// Remove the object from and notificates all others in the list
+void TLinkList::removeMe(TDsgObj * aDsgObj)
+{
+ int index;
+
+ void * link = firstThat(&matchDsgObj, aDsgObj);
+ if (link)
+ {
+ TDsgObjData * data = (TDsgObjData *)aDsgObj->attributes;
+// atFree(indexOf(link));
+ this->free(link);
+ switch(aDsgObj->viewType)
+ {
+ case vtVScroll:
+ case vtHScroll:
+ if (ScrollList->search(&data->thisName, index))
+ {
+ removeNotify(ScrollList, index);
+ ScrollList->atRemove(index);
+ }
+ break;
+ case vtStatic: break;
+ case vtLabel: break;
+ default:
+ if (LinkList->search(&data->thisName, index))
+ {
+ removeNotify(LinkList, index);
+ LinkList->atRemove(index);
+ }
+ }
+ }
+}
+
+// Inserts a pair of pointers from the (TView, TDsgObj) descendant to the list.
+// This is necessary because one TView descendant that also inherits the
+// TDsgObj code cannot be directly refered as a TDsgObj outside its context.
+void TLinkList::add(TView * aView, TDsgObj * aDsgObj)
+{
+ if (!aView || !aDsgObj) return;
+
+ if (viewFind(aView) != 0) return;
+
+ TDsgLink * link = new TDsgLink;
+ link->v = aView;
+ link->d = aDsgObj;
+ insert(link);
+
+ TDsgObjData * data = (TDsgObjData *)aDsgObj->attributes;
+ switch(aDsgObj->viewType)
+ {
+ case vtVScroll:
+ case vtHScroll: ScrollList->insert(&data->thisName); break;
+ case vtStatic: break;
+ case vtButton: break;
+ case vtLabel:
+ strcpy( ((TDLabelData *)aDsgObj->attributes)->link, blank );
+ break;
+ case vtMemo:
+ strcpy( ((TDMemoData *)aDsgObj->attributes)->hScroll, blank );
+ strcpy( ((TDMemoData *)aDsgObj->attributes)->vScroll, blank );
+ LinkList->insert(&data->thisName);
+ break;
+ case vtListBox:
+ strcpy( ((TDListBoxData *)aDsgObj->attributes)->scrollBar, blank );
+ LinkList->insert(&data->thisName);
+ break;
+ default: LinkList->insert(&data->thisName);
+ }
+}
+
+void TLinkList::freeItem(void * item)
+{
+ delete (char *)item;
+}
+
+// To reorganize the views in a correct tabulation order
+void TLinkList::doReOrder()
+{
+ short Tab = 0;
+ int i;
+ TDsgLink * dsg;
+ TDsgObjData * dsgData;
+
+ if (count == 0) return;
+
+ sort(byTabOrder);
+
+ for (i = 0; i < count; i++)
+ {
+ dsg = (TDsgLink *)at(i);
+ dsgData = (TDsgObjData *)dsg->d->attributes;
+ if (dsg->d->tabStop())
+ {
+ dsgData->tabOrder = Tab;
+ Tab++;
+ }
+ }
+ for (i = count - 1; i > 0; i--)
+ {
+ dsg = (TDsgLink *)at(i);
+ dsg->v->makeFirst();
+ }
+}
+
+// Sorting with qsort
+void TLinkList::sort(ccSortFunc Compare)
+{
+ qsort(items, count, sizeof(void *), Compare);
+}
+
+// Try to reorganize the objects in an ideal creation order
+void TLinkList::sortForBuild()
+{
+#if 0
+#define _item_move_(a) do { remove(tmp); atInsert(a, tmp); i++; } while(0)
+ int i = 0;
+ char * s1, * s2;
+ TViewData * attr = 0;
+
+ if (count <= 1) return;
+
+ doReOrder();
+ void * tmp;
+ do {
+ attr = (TViewData *)((TDsgLink *)items[i])->d->attributes;
+ if (tmp = linkFind(attr->thisName)) _item_move_( ((i + 1) < count) ? i + 1 : i );
+ i++;
+ } while (i < count);
+ i = 0;
+ do {
+ s1 = blank;
+ s2 = blank;
+ attr = (TViewData *)((TDsgLink *)items[i])->d->attributes;
+ if ((((TDsgLink *)items[i])->d)->viewType == vtListBox)
+ s1 = ((TDListBoxData *)attr)->scrollBar;
+ else if ((((TDsgLink *)items[i])->d)->viewType == vtMemo)
+ {
+ s1 = ((TDMemoData *)attr)->vScroll;
+ s2 = ((TDMemoData *)attr)->hScroll;
+ }
+ if (tmp = scrollFind(s2))
+ { _item_move_( ((i - 1) >= 0) ? i - 1: 0 ); if (s1 != blank) i--; }
+ if (tmp = scrollFind(s1))
+ { _item_move_( ((i - 1) >= 0) ? i - 1: 0 ); }
+ i++;
+ } while (i < count);
+#undef _item_move_
+#endif
+}
+
+// Called by removeMe to notify dependencies
+void TLinkList::removeNotify(TCollection * aCollection, int Index)
+{
+ int i;
+ TDsgObj * d;
+ for (i = 0; i < count; i++)
+ {
+ d = (TDsgObj *)((TDsgLink *)at(i))->d;
+ if (aCollection == LinkList && d->viewType == vtLabel)
+ {
+ if ( strcmp( ((TDLabelData *)d->attributes)->link,
+ (char *)aCollection->at(Index) ) == 0 )
+ strcpy ( ((TDLabelData *)d->attributes)->link, blank );
+ }
+ else if (aCollection == ScrollList && d->viewType == vtListBox)
+ {
+ if ( strcmp( ((TDListBoxData *)d->attributes)->scrollBar,
+ (char *)aCollection->at(Index) ) == 0 )
+ strcpy ( ((TDListBoxData *)d->attributes)->scrollBar, blank );
+ }
+ else if (aCollection == ScrollList && d->viewType == vtMemo)
+ {
+ if ( strcmp( ((TDMemoData *)d->attributes)->hScroll,
+ (char *)aCollection->at(Index) ) == 0 )
+ strcpy ( ((TDMemoData *)d->attributes)->hScroll, blank );
+ if ( strcmp( ((TDMemoData *)d->attributes)->hScroll,
+ (char *)aCollection->at(Index) ) == 0 )
+ strcpy ( ((TDMemoData *)d->attributes)->vScroll, blank );
+ }
+ }
+}
+
+// Called when an object has its "name" changed in the editor
+void TLinkList::linkChangedName(char * oldName, char * newName)
+{
+ int i;
+
+ pack();
+
+ for (i = 0; i < count; i++)
+ {
+ TDsgLink * d = (TDsgLink *)items[i];
+ TDsgObj * obj = d->d;
+ if (obj->viewType == vtListBox)
+ {
+ if (strcmp( (char *)((TDListBoxData *)obj->attributes)->scrollBar,
+ oldName ) == 0) strcpy(
+ (char *)((TDListBoxData *)obj->attributes)->scrollBar, newName);
+ }
+ else if (obj->viewType == vtMemo)
+ {
+ if (strcmp( (char *)((TDMemoData *)obj->attributes)->hScroll,
+ oldName ) == 0) strcpy(
+ (char *)((TDMemoData *)obj->attributes)->hScroll, newName);
+ if (strcmp( (char *)((TDMemoData *)obj->attributes)->vScroll,
+ oldName ) == 0) strcpy(
+ (char *)((TDMemoData *)obj->attributes)->vScroll, newName);
+ }
+ else if (obj->viewType == vtLabel)
+ {
+ if (strcmp( (char *)((TDLabelData *)obj->attributes)->link,
+ oldName ) == 0) strcpy(
+ (char *)((TDLabelData *)obj->attributes)->link, newName);
+ }
+ }
+}
+
+/* ObjectLinker -----------------------------------------------------------*/
+
+TLinkList * ObjectLinker() { return ObjLink; }
+
+/* TInplaceEdit ===========================================================*/
+// A quick editor for int values and short string values
+// Nor Nor Sel Arrows
+#define cpInplaceEdit "\x06\x06\x07\x05"
+
+
+TInPlaceEdit::TInPlaceEdit(const TRect& bounds, ushort aMaxLen,
+ TValidator * aValidator):
+ TInputLine(bounds, aMaxLen)
+ { setValidator(aValidator); }
+
+void TInPlaceEdit::handleEvent(TEvent& event)
+{
+ if (event.what == evKeyDown)
+ {
+ switch(event.keyDown.keyCode)
+ {
+ case kbEnter:
+ endState = cmOK;
+ clearEvent(event);
+ break;
+ case kbEsc:
+ endState = cmCancel;
+ clearEvent(event);
+ break;
+ case '-': if ((validator) && curPos != 0) clearEvent(event);
+ }
+ }
+ if ((event.what == evMouseDown) &&
+ (!containsMouse(event)) ) endState = cmCancel;
+ TInputLine::handleEvent(event);
+}
+
+TPalette& TInPlaceEdit::getPalette() const
+{
+ static TPalette palette( cpInplaceEdit, sizeof(cpInplaceEdit) - 1 );
+ return palette;
+}
+
+ushort TInPlaceEdit::execute()
+{
+ TEvent e;
+
+ endState = 0;
+
+ do
+ {
+ getEvent(e);
+ handleEvent(e);
+ } while (endState == 0);
+
+ return endState;
+}
+
+/* Inplace editors --------------------------------------------------------*/
+
+bool IntegerEditor(int& value, TPoint place, TGroup * host)
+{
+ bool rst = false;
+ char strval[20];
+
+ TRect r(place.x, place.y, place.x +
+ (host->size.x - place.x - 1), place.y + 1);
+
+ sprintf(strval, "%i", value);
+
+ TFilterValidator * val = new TFilterValidator("-0123456789");
+
+ TInPlaceEdit * editor = new TInPlaceEdit(r, 6, val);
+
+ editor->setData(&strval);
+ rst = ( host->execView(editor) == cmOK );
+ if (rst)
+ {
+ editor->getData(&strval);
+ value = atoi(strval);
+ }
+ TObject::CLY_destroy( editor );
+ return rst;
+}
+
+bool StringEditor(char * string, TPoint place, TGroup * host, ushort aMaxLen)
+{
+ bool rst = false;
+
+ TRect r(place.x, place.y, place.x +
+ (host->size.x - place.x - 1), place.y + 1);
+
+ TInPlaceEdit * editor = new TInPlaceEdit(r, aMaxLen, 0);
+
+ editor->setData(string);
+ rst = ( host->execView(editor) == cmOK );
+ if (rst) editor->getData(string);
+ TObject::CLY_destroy( editor );
+ return rst;
+}
+
+/* TStructMap =============================================================*/
+// Configurable data mapper used to edit values in the TDsgObj::attributes
+// field
+class TStructMap
+{
+public:
+ TStructMap(const char * Label,
+// int OffSet,
+ int DataSize,
+ TDataEditorType aEditorType,
+ bool ReadOnly = false,
+ TStructMap *Next = 0);
+ ~TStructMap();
+
+ TStructMap * prev;
+ TStructMap * next;
+ int index;
+ int offset;
+ int dataSize;
+ int editorType;
+ char * label;
+ bool readOnly;
+};
+
+TStructMap::TStructMap(const char * Label,
+ int DataSize,
+ TDataEditorType aEditorType,
+ bool ReadOnly ,
+ TStructMap *Next )
+{
+ label = newStr(Label);
+ offset = 0;
+ dataSize = DataSize;
+ editorType = aEditorType;
+ index = 0;
+ readOnly = ReadOnly;
+ prev = NULL;
+ next = Next;
+ if (next != 0)
+ {
+ next->prev = this;
+ next->offset = offset + dataSize;
+ next->index = index + 1;
+ }
+}
+
+TStructMap::~TStructMap()
+{
+ delete[] label;
+ if (next) delete(next);
+}
+
+TStructMap& operator + ( TStructMap& map1, TStructMap& map2 )
+{
+ TStructMap *map = &map1;
+ while (map->next) map = map->next;
+ map->next = &map2;
+ map2.offset = map->offset + map->dataSize;
+ map2.prev = map;
+ if (map2.dataSize > 0)
+ {
+ while ((map->dataSize == 0) && (map->prev)) map = map->prev;
+ map2.index = map->index + 1;
+ }
+ return map2;
+}
+
+/* Data mappers -----------------------------------------------------------*/
+
+// Commom TView data map initialization code fragment
+#define _separator_(a) *new TStructMap(a, 0, etNone, true, 0)
+
+#define _viewmap_() \
+ _separator_("TView data")+ \
+ *new TStructMap("Left", sizeof(int), etIntegerEditor)+\
+ *new TStructMap("Top", sizeof(int), etIntegerEditor)+\
+ *new TStructMap("Width", sizeof(int), etIntegerEditor)+\
+ *new TStructMap("Height", sizeof(int), etIntegerEditor)+\
+ *new TStructMap("ClassName", MAX_LABEL_LENGTH, etStringEditor, true)+\
+ *new TStructMap("Name", MAX_LABEL_LENGTH, etStringEditor)+\
+ *new TStructMap("Options", sizeof(ushort), etOptionsEditor)+\
+ *new TStructMap("EventMask", sizeof(ushort), etEventMaskEditor)+\
+ *new TStructMap("State", sizeof(ushort), etStateEditor)+\
+ *new TStructMap("GrowMode", sizeof(ushort), etGrowModeEditor)+\
+ *new TStructMap("DragMode", sizeof(ushort), etDragModeEditor)+\
+ *new TStructMap("HelpContext", sizeof(ushort), etHelpCtxEditor)
+
+/* TPoint origin;\
+ TPoint size;\
+ TNameStr className;\
+ TNameStr thisName;\
+ ushort options;\
+ ushort eventMask;\
+ ushort state;\
+ ushort growMode;\
+ ushort dragMode;\
+ ushort helpCtx\ */
+
+static const TStructMap * TViewMap = &(_viewmap_());
+
+static const TStructMap * TDialogMap = &(
+ _viewmap_()+
+ _separator_("TDialog data") +
+ *new TStructMap("Title", MAX_TITLE_LENGTH, etStringEditor) +
+ *new TStructMap("Flags", sizeof(ushort), etWindowFlagEditor, 0) );
+
+static const TStructMap * TLabelMap = &(
+ _viewmap_()+
+ _separator_("TLabel data")+
+ *new TStructMap("Text", MAX_LABEL_LENGTH, etStringEditor)+
+ *new TStructMap("Link", MAX_LABEL_LENGTH, etLinkEditor, 0) );
+
+static const TStructMap * TInputMap = &(
+ _viewmap_()+
+ _separator_("TInputLine data") +
+ *new TStructMap("TabOrder", sizeof(int), etIntegerEditor) +
+ *new TStructMap("MaxLen", sizeof(int), etIntegerEditor) +
+ *new TStructMap("Validator", sizeof(ushort), etValidatorEditor) +
+ *new TStructMap("ValidatorData", MAX_LABEL_LENGTH, etValidatorDataEditor, 0) );
+
+static const TStructMap * TMemoMap = &(
+ _viewmap_()+
+ _separator_("TMemo data") +
+ *new TStructMap("TabOrder", sizeof(int), etIntegerEditor) +
+ *new TStructMap("HScroll", MAX_LABEL_LENGTH, etScrollBarEditor, 0) +
+ *new TStructMap("VScroll", MAX_LABEL_LENGTH, etScrollBarEditor, 0) +
+ *new TStructMap("BufSize", sizeof(uint32), etIntegerEditor) );
+// *new TStructMap("Text", sizeof(char *), etCharPtrEditor, 0) );
+
+static const TStructMap * TStaticMap = &(
+ _viewmap_()+
+ _separator_("TStaticText data") +
+ *new TStructMap("Text", sizeof(char *), etCharPtrEditor, 0) );
+
+static const TStructMap * TButtonMap = &(
+ _viewmap_()+
+ _separator_("TButton data") +
+ *new TStructMap("TabOrder", sizeof(int), etIntegerEditor) +
+ *new TStructMap("Title", MAX_LABEL_LENGTH, etStringEditor) +
+ *new TStructMap("Command", sizeof(ushort), etCommandEditor) +
+ *new TStructMap("Flags", sizeof(ushort), etButtonFlagEditor) );
+
+static const TStructMap * TListBoxMap = &(
+ _viewmap_()+
+ _separator_("TListBox Data") +
+ *new TStructMap("TabOrder", sizeof(int), etIntegerEditor) +
+ *new TStructMap("Columns", sizeof(short), etIntegerEditor) +
+ *new TStructMap("ScrollBar", MAX_LABEL_LENGTH, etScrollBarEditor) );
+
+static const TStructMap * TClusterMap = &(
+ _viewmap_()+
+ _separator_("TCluster Data") +
+ *new TStructMap("TabOrder", sizeof(int), etIntegerEditor) +
+ *new TStructMap("Items", sizeof(void *), etStrCollectionEditor) );
+
+#undef _viewmap_
+
+/* TObjEditView ===========================================================*/
+
+TObjEditView::TObjEditView(const TRect& bounds, TScrollBar * v):
+ TView(bounds)
+{
+ sb = v;
+ separator = size.x / 2;
+ eventMask = evMouse | evKeyboard | evCommand | evBroadcast;
+ currentMap=0;
+}
+
+void TObjEditView::setMap(const TStructMap * aMap, void * Data)
+{
+ data = Data;
+ if (!data)
+ {
+ dataMap = 0;
+ currentMap = 0;
+ drawView();
+ return;
+ }
+ while (aMap->next) aMap = aMap->next;
+ sb->setRange(1, aMap->index);
+ while (aMap->prev) aMap = aMap->prev;
+ dataMap = aMap;
+ if (aMap->dataSize == 0)
+ while ((aMap->next) && (aMap->dataSize == 0)) aMap = aMap->next;
+ currentMap = aMap;
+ drawView();
+}
+
+void calcPlace(TPoint& p, short column, short line, const TStructMap * map)
+{
+ p.x = column + 1;
+ p.y = line;
+ while (map->next)
+ {
+ if (map->dataSize == 0) p.y++;
+ map = map->next;
+ if (map->index >= line) break;
+ }
+}
+
+int findStr(TCollection * col, const char * cmp)
+{
+ int i, c = col->getCount();
+ if (c == 0) return -1;
+ for (i = 0; i < c; i++)
+ if (strcmp(cmp, (char *)col->at(i)) == 0) return i;
+ return 0;
+}
+
+void TObjEditView::editItem(const TStructMap * map)
+{
+ ushort Val;
+ TListBoxRec rec;
+ void * v;
+ TMemoData m;
+ char * c;
+ int i;
+ TPoint place;
+ char oldName[30];
+
+#define _editlink_(list, editor) \
+ if (list->getCount() == 0) break; \
+ rec.items = list; \
+ rec.selection = findStr(list, (char*)ldata); \
+ if (rec.selection < 0) break; \
+ chg = (execDialog(editor(), &rec) == cmOK); \
+ if (chg) strcpy((char *)ldata, (char *)list->at(rec.selection)); \
+ break;
+
+#define _do_(editor) chg = (execDialog(editor(), ldata) == cmOK); break;
+#define _constsel_(list, editor) \
+ rec.items = list(); \
+ rec.selection = list()->getIndex((ushort)(int)ldata); \
+ chg = (execDialog(editor(), &rec) == cmOK); \
+ if (chg) memcpy(ldata, &rec.selection, sizeof(ushort)); break;
+
+
+ if (map->readOnly)
+ {
+ messageBox("Ops! Read only value.", mfOKButton);
+ return;
+ }
+
+ void * ldata = (void *)((char *)data + map->offset);
+ bool chg = false;
+
+ switch(map->editorType)
+ {
+ case etStringEditor:
+ calcPlace(place, separator, map->index, dataMap);
+ if (map->index == 6) strcpy(oldName, (char *)ldata);
+ chg = StringEditor((char *)ldata, place, owner, map->dataSize);
+ if ( (chg) && (map->index == 6 || vtCurrent == vtVScroll ||
+ vtCurrent == vtHScroll ) )
+ {
+ if (strlen((char *)ldata) == 0)
+ {
+ strcpy((char *)ldata, oldName);
+ chg = false;
+ break;
+ }
+ else if (strcmp((char *)ldata, oldName) != 0)
+ ObjLink->linkChangedName(oldName, (char *)ldata);
+ }
+ if (chg) message(owner, evMessage, cmValueChanged, 0);
+ break;
+ case etIntegerEditor:
+ calcPlace(place, separator, map->index, dataMap);
+ if (vtCurrent == vtListBox && map->index == 14)
+ i = (short)(int)ldata; else i = (int)ldata;
+ chg = IntegerEditor(i, place, owner);
+ if (vtCurrent == vtListBox && map->index == 14)
+ ldata = (void *)i; else ldata = (void *)i;
+ if (chg) message(owner, evMessage, cmValueChanged, 0);
+ break;
+ case etOptionsEditor: _do_(OptionsEditor);
+ case etEventMaskEditor:
+ memcpy(&Val, ldata, sizeof(ushort));
+ if (Val & evCommand) { Val &= ~evCommand; Val |= 0x20; }
+ if (Val & evBroadcast) { Val &= ~evBroadcast; Val |= 0x40; }
+ chg = (execDialog(EventMaskEditor(), ldata) == cmOK);
+ if (chg)
+ {
+ if (Val & 0x20) { Val &= ~0x20; Val |= evCommand; }
+ if (Val & 0x40) { Val &= ~0x40; Val |= evBroadcast; }
+ memcpy(ldata, &Val, sizeof(ushort));
+ }
+ break;
+ case etStateEditor: _do_(StateEditor);
+ case etGrowModeEditor: _do_(GrowModeEditor);
+ case etDragModeEditor: _do_(DragModeEditor);
+ case etHelpCtxEditor: _constsel_(HelpCtxsList, HelpCtxEditor);
+ case etCommandEditor: _constsel_(CommandsList, CommandEditor);
+ case etButtonFlagEditor: _do_(ButtonFlagEditor);
+ case etWindowFlagEditor: _do_(WindowFlagEditor);
+ case etValidatorEditor: _do_(ValidatorEditor);
+ case etValidatorDataEditor: break;
+ case etStrCollectionEditor:
+ chg = (execDialog(ItemsEditor(), ldata) == cmOK);
+ if (chg) message(owner, evMessage, cmValueChanged, 0);
+ break;
+ case etCharPtrEditor:
+ c = (char *)ldata;
+ strcpy(m.buffer, c);
+ c = (char *)m.buffer;
+ v = c;
+ while (c[0]) // Turning '\x3' to "\x3"
+ {
+ if (c[0] == 3/*&& (c + 3 - v) < 1024*/)
+ {
+ memmove(c + 3, c + 1, strlen(c) + 1);
+ memcpy(c, "\\x3", 3);
+ }
+ c++;
+ }
+ c = (char *)v;
+ m.length = strlen(c);
+ chg = (execDialog(CharPtrEditor(), &m) == cmOK);
+ if (chg)
+ {
+ if (m.length == 0) strcpy(c, "");
+ else // Turning simbolic chars to raw
+ {
+ delete[] c;
+ c = (char *)m.buffer;
+ while (c[0]) // eating CR chars
+ {
+ if (c[0] == '\x0d') memmove(c, c + 1, strlen(c - 1));
+ c++;
+ }
+ c = (char *)m.buffer;
+ while (c[0]) // Turning "\x3" to '\x3'
+ {
+ i = 0;
+ if (c[0]==92)
+ {
+ while (c[i] != '3') { if (c[i] == 0) break; i++; }
+ if (i <= 4)
+ {
+ c[0] = 3;
+ memmove(&c[1], &c[i+1], strlen(c) - i);
+ }
+ }
+ c++;
+ }
+ ldata=(void *)newStr(m.buffer);
+ }
+ message(owner, evMessage, cmValueChanged, 0);
+ }
+ break;
+ case etLinkEditor: _editlink_(LinkList, LinkEditor);
+ case etScrollBarEditor: _editlink_(ScrollList, ScrollEditor);
+ }
+ if (chg) drawView();
+#undef _editlink_
+#undef _do_
+}
+
+const char * TObjEditView::getValueFor(const TStructMap * map)
+{
+ static char buf[60];
+ static ushort ushrtval;
+ static int intval;
+ static void * ptrval;
+ static void * ldata;
+
+ ldata = data;
+ ldata = (void *)((char *)ldata + map->offset);
+
+ strcpy(buf, "<none>");
+
+ if (map->editorType == etIntegerEditor)
+ {
+ memcpy(&intval, ldata, map->dataSize);
+ sprintf(buf, "%i", intval);
+ }
+ else if ((map->editorType >= etOptionsEditor) &&
+ (map->editorType <= etValidatorEditor))
+ {
+ memcpy(&ushrtval, ldata, map->dataSize);
+ switch(map->editorType)
+ {
+ case etOptionsEditor: return OptionsStr(ushrtval);
+ case etEventMaskEditor: return EventMaskStr(ushrtval);
+ case etStateEditor: return StateStr(ushrtval);
+ case etGrowModeEditor: return GrowModeStr(ushrtval);
+ case etDragModeEditor: return DragModeStr(ushrtval);
+ case etHelpCtxEditor: return HelpCtxStr(ushrtval);
+ case etCommandEditor: return CommandStr(ushrtval);
+ case etButtonFlagEditor: return ButtonFlagStr(ushrtval);
+ case etWindowFlagEditor: return WindowFlagStr(ushrtval);
+ case etValidatorEditor: return ValidatorStr(ushrtval);
+ }
+ }
+ else if (map->editorType == etStrCollectionEditor ||
+ map->editorType == etCharPtrEditor)
+ {
+ memcpy(&ptrval, ldata, map->dataSize);
+ if (map->editorType == etCharPtrEditor)
+ return CharPtrStr(ptrval); else return ItemsStr(ptrval);
+ }
+ else if ( map->editorType == etStringEditor ||
+ map->editorType == etValidatorDataEditor )
+ {
+ memset(&buf, 0, 60);
+ memcpy(&buf, ldata, map->dataSize);
+ return buf;
+ }
+ else if ( map->editorType == etScrollBarEditor ||
+ map->editorType == etLinkEditor )
+ {
+ if (strlen((char *)ldata) > 0) return strcpy(buf, (char *)ldata);
+ }
+ return buf;
+}
+
+class TLDrawBuffer: public TDrawBuffer
+{
+public:
+ ushort getData(ushort i) { return data[i]; }
+};
+
+#define _lo_(a) ((uchar *)&a)[0]
+
+void TObjEditView::draw()
+{
+ TLDrawBuffer b;
+ const TStructMap * curMap;
+ const TStructMap * cur;
+ int r, l, tmp, line = 0;
+ char lstr[100], rstr[100];
+ char lfmt[10], rfmt[10];
+ ushort attr;
+
+ if (separator > size.x) separator = size.x / 2;
+ r = (size.x - separator) + separator;
+ l = separator;
+
+ curMap = currentMap;
+ if ((curMap) && size.y > 0)
+ {
+ cur = curMap;
+ while (cur->prev) cur = cur->prev;
+ do
+ {
+ if (cur->dataSize == 0)
+ {
+ tmp = (size.x - strlen(cur->label)) / 2;
+ b.moveChar(0, 0x20, 0x3e, tmp);
+ b.moveBuf(tmp, cur->label, 0x3e, strlen(cur->label));
+ b.moveChar(tmp + strlen(cur->label), 0x20, 0x3e, tmp + 1);
+ attr = b.getData(l);
+ if (_lo_(attr) == 0x20) b.moveChar(l, 0xb3, 0x31, 1);
+ writeLine(0, line, size.x, 1, b);
+ line++;
+ }
+ else
+ {
+ sprintf(lfmt, "%%-%is", l - 1);
+ sprintf(lstr, lfmt, cur->label);
+ sprintf(rfmt, "%%-%is", r);
+ char *tmp=newStr(getValueFor(cur));
+ if (tmp && strlen(tmp)>=(size_t)r)
+ tmp[r-1]=0;
+ sprintf(rstr, rfmt, tmp ? tmp : "ERROR");
+ DeleteArray(tmp);
+ if (cur == curMap)
+ attr = 0x71; else attr = 0x1f;
+ b.moveBuf(0, lstr, attr, l);
+ if (cur == curMap)
+ attr = 0x71; else attr = 0x13;
+ b.moveChar(l, 0xb3, attr, 1);
+ if (cur == curMap)
+ attr = 0x71; else attr = 0x1e;
+ b.moveBuf(l + 1, rstr, attr, r);
+ writeLine(0, line, size.x, 1, b);
+ line++;
+ }
+ if (line > size.y - 1) break;
+ cur = cur->next;
+ } while (cur);
+ b.moveChar(0, 0x20, 0x1f, size.x);
+ b.moveChar(l, 0xb3, 0x13, 1);
+ writeLine(0, line, size.x, size.y - line, b);
+ }
+ else TView::draw();
+}
+
+#undef _lo_
+
+const TStructMap * itemForLine(int line, const TStructMap * Map)
+{
+ ushort i = 1;
+
+ if (line == 0 || Map == 0) return 0;
+ while (Map->next)
+ {
+ Map = Map->next;
+ if (i++ == line) break;
+ }
+ if (Map->dataSize != 0) return Map; else return 0;
+}
+
+#define _endcase_(a) if (currentMap->dataSize == 0) \
+ while ((currentMap->a) && (currentMap->dataSize == 0))\
+ currentMap = currentMap->a; sb->setValue(currentMap->index); \
+ drawView(); clearEvent(event)
+
+void TObjEditView::handleEvent(TEvent& event)
+{
+ const TStructMap * t;
+ ushort i;
+
+ TView::handleEvent(event);
+
+ if (!currentMap) return;
+
+ TPoint Locate;
+ if (event.what == evBroadcast &&
+ event.message.command == cmScrollBarChanged &&
+ event.message.infoPtr == sb)
+ {
+ i = sb->value;
+ t = dataMap;
+ while ((t->index != i) && (t->next)) t = t->next;
+ if ((t->index == i) && (t != currentMap))
+ {
+ currentMap = t;
+ drawView();
+ }
+ }
+ else
+ if (event.what == evMouseDown)
+ {
+ Locate = makeLocal(event.mouse.where);
+ if (Locate.x == separator)
+ {
+ do
+ {
+ Locate = makeLocal(event.mouse.where);
+ if ((Locate.x >= 1) && (Locate.x <= (size.x - 2)))
+ { separator = Locate.x; drawView(); }
+ } while ( mouseEvent( event, evMouseMove ) );
+ }
+ else
+ {
+ t = itemForLine(Locate.y, dataMap);
+ if ((t) && t != currentMap)
+ {
+ sb->setValue(t->index);
+ currentMap = t;
+ drawView();
+ }
+ else if ((t == currentMap) && (event.mouse.doubleClick) &&
+ (event.mouse.buttons == mbLeftButton)) editItem(currentMap);
+ }
+ }
+ else
+ if (event.what == evKeyboard)
+ {
+ switch(event.keyDown.keyCode)
+ {
+ case kbUp:
+ if (currentMap->prev)
+ {
+ currentMap = currentMap->prev;
+ if (currentMap->dataSize == 0)
+ if (currentMap->prev) currentMap = currentMap->prev;
+ _endcase_(next);
+ }
+ break;
+ case kbDown:
+ if (currentMap->next)
+ {
+ currentMap = currentMap->next;
+ _endcase_(next);
+ }
+ break;
+ case kbPgUp:
+ while (currentMap->prev) currentMap = currentMap->prev;
+ _endcase_(next);
+ break;
+ case kbPgDn:
+ while (currentMap->next) currentMap = currentMap->next;
+ _endcase_(prev);
+ break;
+ case kbEnter:
+ clearEvent(event);
+ if (currentMap->dataSize > 0) editItem(currentMap);
+ break;
+ case kbDel:
+ if (currentMap->editorType == etScrollBarEditor ||
+ currentMap->editorType == etLinkEditor)
+ strcpy((char *)data + currentMap->offset, blank);
+ drawView();
+ clearEvent(event);
+ break;
+ }
+ }
+}
+
+#undef _endcase_
+
+/* TObjedit ===============================================================*/
+
+TObjEdit::TObjEdit(TDsgObj * Obj):
+ TWindowInit(&TObjEdit::initFrame),
+ TWindow( TRect(55, 0, 80, 23), _("Object editor"), 0 )
+{
+ flags &= ~wfClose;
+ flags |= wfGrow;
+ if (!LinkList) LinkList = new TStringCollection(0, 1);
+ else LinkList->removeAll();
+ if (!ScrollList) ScrollList = new TStringCollection(0, 1);
+ else ScrollList->removeAll();
+ LinkList->duplicates = False;
+ ScrollList->duplicates = False;
+ if (!ObjLink) ObjLink = new TLinkList();
+ else ObjLink->removeAll();
+ TScrollBar * sb = new TScrollBar( TRect(24, 1, 25, 19) );
+ insert(sb);
+ sb->growMode |= gfGrowHiY;
+ TRect r = getExtent();
+ r.grow(-1, -1);
+ r.b.y -= 3;
+ dataView = new TObjEditView( r, sb );
+ dataView->growMode |= (gfGrowHiY | gfGrowHiX);
+ dataView->options |= ofPreProcess | ofPostProcess | ofFramed;
+ ObjEdit = this;
+ insert(dataView);
+ setObjData(Obj);
+}
+
+void TObjEdit::handleEvent(TEvent& event)
+{
+ TWindow::handleEvent(event);
+ if (object == 0) return;
+ if (event.what == evMessage &&
+ event.message.command == cmValueChanged)
+ {
+ object->dsgUpdate();
+ clearEvent(event);
+ }
+}
+
+void TObjEdit::setObjData(TDsgObj * Obj)
+{
+ const TStructMap * Map = 0;
+
+ if ((!Obj) || object == Obj) return;
+
+ dataView->setMap(0, 0);
+
+ object = Obj;
+
+ switch (Obj->viewType)
+ {
+ case vtLabel: Map = TLabelMap; break;
+ case vtInput: Map = TInputMap; break;
+ case vtMemo: Map = TMemoMap; break;
+ case vtStatic: Map = TStaticMap; break;
+ case vtButton: Map = TButtonMap; break;
+ case vtListBox: Map = TListBoxMap; break;
+ case vtRadioButton: Map = TClusterMap; break;
+ case vtCheckBox: Map = TClusterMap; break;
+ case vtDialog: Map = TDialogMap; break;
+ default: Map = TViewMap;
+ }
+ if (!Map)
+ {
+ messageBox("Sem mapa!", mfOKButton);
+ dataView->setMap(0, 0);
+ return;
+ }
+
+#if 0
+ int i = 0;
+ TStructMap * m = Map;
+ char c[100];
+ m = Map;
+ while (m->prev) m = m->prev;
+ while (m) { i += m->dataSize; m = m->next; };
+ if (i != Obj->getAttrSize())
+ {
+ sprintf(c, "diferenca mapa: %i registro: %i", i, Obj->getAttrSize());
+ messageBox(c, mfOKButton);
+ }
+#endif
+ dataView->vtCurrent = Obj->viewType;
+ dataView->setMap(Map, Obj->attributes);
+}
+
+
diff --git a/tvision/examples/dlgdsn/propedit.h b/tvision/examples/dlgdsn/propedit.h
new file mode 100644
index 0000000..51722ea
--- /dev/null
+++ b/tvision/examples/dlgdsn/propedit.h
@@ -0,0 +1,122 @@
+/***************************************************************************
+
+ propedit.h - Prototype for object editor
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Modified by Salvador E. Tropea to compile without warnings.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#if !defined(_PROPEDIT_HPP_)
+#define _PROPEDIT_HPP_
+
+#define Uses_TWindow
+#define Uses_TDialog
+#define Uses_TEvent
+#define Uses_TListBox
+#define Uses_TScrollBar
+#define Uses_TStringCollection
+#define Uses_TCollection
+#define Uses_TInputLine
+#define Uses_TValidator
+#define Uses_opstream
+#define Uses_ipstream
+
+#include <tv.h>
+
+class TDsgObj;
+class TStructMap;
+
+// Sort function prototype
+typedef int (* ccSortFunc)(const void *, const void *);
+
+typedef struct TDsgLink
+{
+ TView * v;
+ TDsgObj * d;
+};
+
+// The manager for TDsgObj<->TView linked list.
+// Editable objects are descendants from TView and TDsgObj.
+// It's make easy some operations but one can't be externaly
+// referenced as other. To make that we need this class.
+class TLinkList: public TCollection
+{
+public:
+ TLinkList(): TCollection(0, 1) { };
+ TDsgLink * viewFind(void * aView); // Find the link for a TView
+ TDsgLink * dsgObjFind(void * aDsgObj); // Find the link for a TDsgObj
+ TDsgLink * scrollFind(char *); // Find the scrollbar by index
+ TDsgLink * linkFind(char *); // Returns the TDLabel linked to
+ void removeMe(TDsgObj * aDsgObj); // Remove the link for a TDsgObj
+ void add(TView * aView, TDsgObj * aDsgObj); // Add new link
+ virtual void freeItem(void * item);
+ virtual void * readItem(ipstream &) { return 0; }; // It not need be loaded or...
+ virtual void writeItem(void *, opstream &) { }; // saved
+ void sort(ccSortFunc Compare); // Tabulation
+ void doReOrder(); // methods
+ void removeNotify(TCollection * aCollection, int Index);
+ void sortForBuild();
+ void linkChangedName(char * oldName, char * newName);
+};
+
+// Ordinary number and short string editor
+// Is a TInputLine descendant to be executed in a TWindow
+class TInPlaceEdit: public TInputLine
+{
+ ushort endState;
+public:
+ TInPlaceEdit(const TRect& bounds, ushort aMaxLen,
+ TValidator * aValidator);
+ virtual ushort execute();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+};
+
+// A grid style viewer and editor for objects
+class TObjEditView: public TView
+{
+ const char * getValueFor(const TStructMap * map);
+ void editItem(const TStructMap * map);
+ int separator;
+ TScrollBar * sb;
+ const TStructMap * dataMap;
+ const TStructMap * currentMap;
+ void * data;
+public:
+ TObjEditView(const TRect& bounds, TScrollBar * v);
+ virtual void handleEvent(TEvent& event);
+ virtual void draw();
+ void setMap(const TStructMap * aMap, void * Data);
+ int vtCurrent;
+};
+
+// A TWindow to host the object editor
+class TObjEdit: public TWindow
+{
+ void editItem(TStructMap * map);
+ TObjEditView * dataView;
+public:
+ TObjEdit(TDsgObj * Obj);
+ void setObjData(TDsgObj * DsgObj);
+ virtual void handleEvent(TEvent& event);
+ TDsgObj * object;
+};
+
+int execDialog(TDialog * dialog, void *data);
+
+TLinkList * ObjectLinker();
+
+#endif // _PROPEDIT_HPP_
diff --git a/tvision/examples/dlgdsn/rhide.env b/tvision/examples/dlgdsn/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/dlgdsn/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/dlgdsn/strmoper.cc b/tvision/examples/dlgdsn/strmoper.cc
new file mode 100644
index 0000000..1cc36e2
--- /dev/null
+++ b/tvision/examples/dlgdsn/strmoper.cc
@@ -0,0 +1,108 @@
+/***************************************************************************
+
+ strmoper.cc - Stream operations
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Modified by Salvador E. Tropea to compile without warnings.
+ For gcc 2.95.x and then 3.0.1.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#define Uses_stdio
+#define Uses_string
+// didn't find std::ios (AP)
+#define Uses_iostream
+
+#define Uses_MsgBox
+#define Uses_TFileDialog
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_ofpstream
+#define Uses_ifpstream
+
+#include <tv.h>
+#include "strmoper.h"
+
+UsingNamespaceStd
+
+bool fileExists(const char * FileName)
+{
+ FILE * test;
+
+ bool rst = ((test = fopen(FileName, "r")) != 0);
+ if (rst) fclose(test);
+ return rst;
+}
+
+// SET: This function was originaly declared as const char * and returned a
+// pointer to a temporal variable in the stack. Nicola Asuni found it and
+// suggested a partial workaround. I then modified the function to return
+// a char * using newStr to allocate it. I also modified all the points
+// where this function is used (at least all that I found) to release the
+// returned value.
+char * getFileName(const char * aTitle, const char * ext, int Mode)
+{
+ TFileDialog *d = 0;
+ int cmd = cmCancel;
+
+ if (Mode == 0)
+ d = (TFileDialog *) TProgram::application->validView( new
+ TFileDialog(ext, aTitle, _("File"), fdOpenButton, 100) );
+ else
+ d = (TFileDialog *) TProgram::application->validView( new
+ TFileDialog(ext, aTitle, _("File"), fdOKButton, 100) );
+ if (d != 0) cmd = TProgram::deskTop->execView( d );
+ if ( cmd != cmCancel )
+ {
+ char fileName[PATH_MAX];
+ d->getFileName( fileName );
+ delete d;
+ return newStr( fileName );
+ }
+ else return NULL;
+}
+
+
+ifpstream * openFile(const char * FileName, char * Signature)
+{
+ if (!fileExists(FileName)) return 0;
+ ifpstream * rst = new ifpstream( FileName, ios::in|ios::binary );
+ char buf[50];
+ if (rst)
+ {
+ rst->readBytes(&buf, strlen(Signature) + 1);
+ if (strcmp(buf, Signature) != 0)
+ {
+ delete rst;
+ return 0;
+ }
+ }
+ return rst;
+}
+
+ofpstream * initFile(const char * FileName, char * current, char * Signature)
+{
+ if ( fileExists(FileName) &&
+ ( current == 0 || strcmp(FileName, current) != 0 ) )
+ {
+ if ( messageBox(__("The file already exists. Overwrite it?"),
+ mfYesNoCancel) != cmYes ) return 0;
+ }
+ ofpstream * rst = new ofpstream( FileName, ios::in|ios::binary );
+ if (rst) rst->writeBytes(Signature, strlen(Signature) + 1);
+ return rst;
+}
+
diff --git a/tvision/examples/dlgdsn/strmoper.h b/tvision/examples/dlgdsn/strmoper.h
new file mode 100644
index 0000000..e7292d4
--- /dev/null
+++ b/tvision/examples/dlgdsn/strmoper.h
@@ -0,0 +1,33 @@
+/***************************************************************************
+
+ strmoper.h - Stream operations
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Modified by Salvador E. Tropea to compile without warnings.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#define dialogFileSig "FreeDsgn Dialog File\x1a"
+#define menuFileSig "FreeDsgn Menu File\x1a"
+#define statusLineFileSig "FreeDsgn StatusLine File\x1a"
+#define constanstFileSig "FreeDsgn Constants File\x1a"
+#define helpCtxFileSig "FreeDsgn Help Contexts File\x1a"
+#define AppDataFileSig "FreeDsgn App Data File\x1a"
+#define hintsDataFileSig "FreeDsgn Hints File\x1a"
+
+ifpstream * openFile(const char * FileName, char * Signature);
+ofpstream * initFile(const char * FileName, char * current, char * Signature);
+char * getFileName(const char * aTitle, const char * ext, int Mode);
+
diff --git a/tvision/examples/dlgdsn/tappwnd.cc b/tvision/examples/dlgdsn/tappwnd.cc
new file mode 100644
index 0000000..9f42ef9
--- /dev/null
+++ b/tvision/examples/dlgdsn/tappwnd.cc
@@ -0,0 +1,159 @@
+/***************************************************************************
+
+ tappwnd.cc - Application window
+ ---------------------------------------------------------------------
+ May, 2000
+ Copyright (C) 2000 by Warlei Alves
+ walves@usa.net
+
+ Modified by Salvador E. Tropea to compile without warnings.
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "dsgobjs.h"
+
+#define cpAppWnd\
+ "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" \
+ "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" \
+ "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" \
+ "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f" \
+
+TAppWindow::TAppWindow():
+ TWindowInit(&TAppWindow::initFrame),
+ TWindow( TRect(0, 0, 60, 20), "", 0 ),
+ menuBar( 0 ),
+ statusLine( 0 )
+{
+ options |= ofCentered;
+ TRect r = getExtent();
+ r.grow(0, -1);
+ deskTop = new TDeskTop( r );
+ deskTop->growMode = gfGrowHiX | gfGrowHiY;
+ insert(deskTop);
+}
+
+TAppWindow::~TAppWindow()
+{
+ removeMenuBar();
+ removeStatusLine();
+}
+
+TFrame * TAppWindow::initFrame(TRect r)
+{
+ return 0;
+}
+
+TPalette& TAppWindow::getPalette() const
+{
+ static TPalette p( cpAppWnd, sizeof(cpAppWnd) - 1 );
+ return p;
+}
+
+void TAppWindow::changeBounds(const TRect& bounds)
+{
+ TWindow::changeBounds(bounds);
+ TRect r = getExtent();
+ r.a.y = r.b.y - 1;
+ statusLine->changeBounds(r);
+ deskTop->redraw();
+}
+
+void TAppWindow::removeStatusLine()
+{
+ if (statusLine != 0)
+ {
+ remove(statusLine);
+ delete statusLine;
+ statusLine = 0;
+ }
+}
+
+void TAppWindow::removeMenuBar()
+{
+ if (menuBar != 0)
+ {
+ remove(menuBar);
+ delete menuBar;
+ menuBar = 0;
+ }
+}
+
+void TAppWindow::setMenuBar(TEditCollection * aItems)
+{
+ removeMenuBar();
+ if (aItems == 0) return;
+}
+
+void TAppWindow::setStatusLine(TEditCollection * aItems)
+{
+ removeStatusLine();
+ if (aItems == 0) return;
+}
+
+void TAppWindow::setMenuBar(TMenuBar * aMenuBar)
+{
+ removeMenuBar();
+ if (aMenuBar == 0) return;
+ menuBar = aMenuBar;
+ menuBar->growMode = gfGrowHiX;
+ insert(menuBar);
+}
+
+void TAppWindow::setStatusLine(TStatusLine * aStatusLine)
+{
+ removeStatusLine();
+ if (aStatusLine == 0) return;
+ statusLine = aStatusLine;
+ statusLine->growMode = gfGrowRel;
+ insert(statusLine);
+}
+
+int lmessageBox(const char * msg, TGroup * aOwner)
+{
+ TDialog * d = new TDialog( TRect(0, 0, 40, 9), __("Confirm") );
+ d->insert( new TStaticText( TRect(3, 2, d->size.x - 2, d->size.y - 3), msg) );
+ d->options |= ofCentered;
+ TRect r = TRect(0, 0, 10, 2);
+ r.move((d->size.x / 2) - 11, d->size.y - 3);
+ d->insert( new TButton( r, __("~Y~es"), cmYes, 0) );
+ r.a.x += 11; r.b.x+= 11;
+ d->insert( new TButton( r, __("~C~ancel"), cmCancel, 0) );
+ d->selectNext(false);
+ int rst = aOwner->execView(d);
+ TObject::CLY_destroy( d );
+ return rst;
+}
+
+void TAppWindow::handleEvent(TEvent& event)
+{
+ TWindow * w;
+
+ TWindow::handleEvent(event);
+
+ if (event.what == evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmQuit:
+ if ( lmessageBox( __("Are you sure?"), deskTop ) == cmYes )
+ endModal(cmQuit);
+ break;
+ case cmViewAppWindow:
+ w = new TWindow( TRect( 0, 0, 30, 10), "Teste", 0 );
+ w->options |= ofCentered;
+ deskTop->insert(w);
+ break;
+ }
+ clearEvent(event);
+ }
+}
+
diff --git a/tvision/examples/dyntxt/dyntext.bmk b/tvision/examples/dyntxt/dyntext.bmk
new file mode 100644
index 0000000..a291a1a
--- /dev/null
+++ b/tvision/examples/dyntxt/dyntext.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: dyntext.exe
+!include ../../makes/common.bmk
+!include dyntext.umk
+
diff --git a/tvision/examples/dyntxt/dyntext.cpp b/tvision/examples/dyntxt/dyntext.cpp
new file mode 100644
index 0000000..56b1f20
--- /dev/null
+++ b/tvision/examples/dyntxt/dyntext.cpp
@@ -0,0 +1,89 @@
+// Copyright (c) 1992 by James H. Price, All rights reserved
+//
+// DYNTEXT.CPP
+//
+// Member functions for DynamicText class
+//
+
+#define Uses_string
+#define Uses_TView
+#define Uses_TStreamableClass
+#define Uses_TPalette
+#include <tv.h>
+
+#include "dyntext.h"
+
+#define cpDynamicText "\x06"
+
+DynamicText::DynamicText( const TRect& r, const char *aText,
+ Boolean rj ) : TView( r ), text( new char[size.x+1] ),
+ rightJustify( rj )
+{
+ strncpy( text, aText, size.x );
+ text[size.x] = EOS;
+}
+
+DynamicText::~DynamicText()
+{
+ delete text;
+}
+
+void DynamicText::draw()
+{
+ TDrawBuffer b;
+ uchar color = getColor(1);
+ int offset = ( rightJustify ) ? size.x-strlen(text) : 0;
+
+ b.moveChar( 0, ' ', color, size.x );
+ b.moveStr( offset, text, color );
+ writeBuf( 0, 0, size.x, 1, b );
+}
+
+TPalette& DynamicText::getPalette() const
+{
+ static TPalette palette( cpDynamicText, sizeof( cpDynamicText )-1 );
+ return palette;
+}
+
+void DynamicText::setText( const char *s )
+{
+ setData( (void *)s );
+ drawView();
+}
+
+void DynamicText::setData( void *rec )
+{
+ memmove( text, rec, size.x+1 );
+ text[size.x] = EOS;
+}
+
+void DynamicText::getData( void *rec )
+{
+ strcpy( (char *)rec, text );
+}
+
+unsigned DynamicText::dataSize()
+{
+ return( size.x+1 );
+}
+
+void DynamicText::write( opstream& os )
+{
+ TView::write( os );
+ os.writeString( text );
+ os << (int)rightJustify;
+}
+
+void *DynamicText::read( ipstream& is )
+{
+ int rj;
+ TView::read( is );
+ text = is.readString();
+ is >> rj;
+ rightJustify = Boolean( rj );
+ return this;
+}
+
+const char * const DynamicText::name = "DynamicText";
+TStreamableClass RDynamicText( DynamicText::name,
+ DynamicText::build, __DELTA(DynamicText) );
diff --git a/tvision/examples/dyntxt/dyntext.gpr b/tvision/examples/dyntxt/dyntext.gpr
new file mode 100644
index 0000000..1914f92
--- /dev/null
+++ b/tvision/examples/dyntxt/dyntext.gpr
Binary files differ
diff --git a/tvision/examples/dyntxt/dyntext.h b/tvision/examples/dyntxt/dyntext.h
new file mode 100644
index 0000000..c87a9be
--- /dev/null
+++ b/tvision/examples/dyntxt/dyntext.h
@@ -0,0 +1,59 @@
+// Copyright (c) 1992 by James H. Price, All rights reserved
+//
+// DYNTEXT.H
+//
+// Dynmaic text class
+//
+
+#if !defined( __DYNTEXT_H )
+#define __DYNTEXT_H
+
+#define Uses_TView
+#include <tv.h>
+
+class TStreamable;
+class TPalette;
+
+class DynamicText : public TView {
+
+public:
+
+ DynamicText( const TRect& r, const char *aText, Boolean rj=True );
+ ~DynamicText();
+
+ void draw();
+ TPalette& getPalette() const;
+ unsigned dataSize();
+ void getData( void *rec );
+ void setData( void *rec );
+ void setText( const char *s );
+
+protected:
+
+ char *text;
+ Boolean rightJustify;
+
+private:
+ virtual const char *streamableName() const { return name; }
+protected:
+ DynamicText( StreamableInit ) : TView( streamableInit ) {}
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+public:
+ static const char * const name;
+ static TStreamable *build()
+ { return new DynamicText( streamableInit ); }
+};
+
+inline ipstream& operator >> ( ipstream& is, DynamicText& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, DynamicText*& cl )
+ { return is >> (void *&)cl; }
+inline opstream& operator << ( opstream& os, DynamicText& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, DynamicText* cl )
+ { return os << (TStreamable *)cl; }
+
+
+#endif
+
diff --git a/tvision/examples/dyntxt/dyntext.mkf b/tvision/examples/dyntxt/dyntext.mkf
new file mode 100644
index 0000000..c82eba8
--- /dev/null
+++ b/tvision/examples/dyntxt/dyntext.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include dyntext$(ExIMK)
diff --git a/tvision/examples/dyntxt/dyntext.umk b/tvision/examples/dyntxt/dyntext.umk
new file mode 100644
index 0000000..25dea27
--- /dev/null
+++ b/tvision/examples/dyntxt/dyntext.umk
@@ -0,0 +1,22 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./dyntext$(ExOBJ) \
+ ./testdyn$(ExOBJ)
+
+LIBRARIES=
+
+dyntext$(ExEXE):: \
+ ./dyntext$(ExOBJ) \
+ ./testdyn$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./dyntext$(ExOBJ):: dyntext.cpp
+ $(RHIDE_COMPILE_CC)
+
+./testdyn$(ExOBJ):: testdyn.cpp
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/dyntxt/readme b/tvision/examples/dyntxt/readme
new file mode 100644
index 0000000..7596869
--- /dev/null
+++ b/tvision/examples/dyntxt/readme
@@ -0,0 +1,54 @@
+Dynamic Text Demonstration
+Copyright (C) 1992 by James H. Price, all rights reserved
+
+Introduction
+
+ This program implements a "dynamic text" class.
+
+ The demo consists of the following files:
+
+ DYNTEXT.H Header file for DynamicText
+ DYNTEXT.CPP Member functions for HintStatusLine
+ TESTDYN.CPP A simple TurboVision demo program
+ TESTDYN.PRJ Project file for the demo
+ README This file
+
+
+Operation:
+
+DynamicText is a simple descendent of TView. In my current app, I
+use it primarily to display totals under a column of input lines,
+with the totals updated on the fly as the user inputs data.
+
+A couple of notes on its use:
+
+1. It has an optional "right justify" flag. If set to True (the
+default), the text will be drawn at the right edge of the view;
+otherwise it's drawn at the left edge.
+
+2. Unlike TStaticText, it has getData() and setData functions, so if
+you use it in a TDialog (the expected case) you'll need to add a
+field for it in any structure you pass to the dialog via
+TDialog::getData() and TDialog::setData.
+
+3. It has a simple draw function: no centering, no wrapping across
+multiple lines, etc, the way TStaticText does.
+
+4. Note that the length of the text string is set by the value
+passed in the TRect parameter. If the string passed is larger than
+the TRect width, the string is truncated.
+
+Other:
+
+I'll be happy to answer questions about the program, but I don't
+intend to really 'support' it. Extending and/or maintaining the code
+is left as an exercise for the user!
+
+Any rights which Borland may have to TurboVision-based code remain in
+force. Otherwise, feel free to use this code as you see fit. I'm
+reasonably certain that it works as described, but of course, you use
+it at your own risk. If you distribute this as source code, please
+include this file.
+
+Jim Price 76264,3534
+21 Sept 92
diff --git a/tvision/examples/dyntxt/rhide.env b/tvision/examples/dyntxt/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/dyntxt/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/dyntxt/testdyn.cpp b/tvision/examples/dyntxt/testdyn.cpp
new file mode 100644
index 0000000..fa12a2b
--- /dev/null
+++ b/tvision/examples/dyntxt/testdyn.cpp
@@ -0,0 +1,195 @@
+// Copyright (C) 1992 James H. Price, All rights reserved
+//
+// TESTDYN.CPP
+//
+// Test program for dynamic text
+//
+
+#define Uses_MsgBox
+#define Uses_TEvent
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TDialog
+#define Uses_TInputLine
+#define Uses_TButton
+#include <tv.h>
+
+#include "dyntext.h"
+
+const int cmAbout = 100;
+const int cmTest = 101;
+
+
+////////////////////////////////////////////////////////////////////////
+//////////////////////// Usual TurboVision Stuff ///////////////////////
+
+class Shell : public TApplication {
+
+public:
+
+ Shell();
+ static TMenuBar *initMenuBar( TRect r );
+ static TStatusLine *initStatusLine( TRect r );
+ void handleEvent( TEvent& event );
+ void idle();
+
+private:
+
+ void About();
+ void Test();
+};
+
+Shell::Shell() : TProgInit (
+ &Shell::initStatusLine,
+ &Shell::initMenuBar,
+ &Shell::initDeskTop
+ )
+{
+}
+
+TMenuBar *Shell::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1;
+
+ TMenuItem& mI =
+ *new TMenuItem( "~T~est", cmTest, kbNoKey, hcNoContext );
+
+ return new TMenuBar( r, new TMenu( mI ) );
+}
+
+TStatusLine *Shell::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1;
+
+ TStatusLine *sL = new TStatusLine( r,
+ *new TStatusDef(0, 0xFFFF) +
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ *new TStatusItem( "~Alt-X~ Quit", kbAltX, cmQuit ) );
+
+ return sL;
+}
+
+void Shell::handleEvent( TEvent &event )
+{
+ TApplication::handleEvent(event);
+
+ if (event.what == evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmAbout:
+ About();
+ break;
+ case cmTest:
+ Test();
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void Shell::About()
+{
+ messageBox( "\003Dynamic Text Demo",
+ mfInformation | mfOKButton );
+}
+
+void Shell::idle()
+{
+ TProgram::idle();
+
+ // select menu bar if deskTop empty
+
+ if( deskTop->current == 0
+ && !menuBar->getState( sfSelected ) )
+ {
+ TEvent event;
+ event.what = evCommand;
+ event.message.command = cmMenu; // put a cmMenu event in queue
+ putEvent( event );
+ }
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+//////////////////////// Simple Test Dialog Box ////////////////////////
+
+class TestDialog : public TDialog {
+public:
+ TestDialog();
+ void handleEvent( TEvent& event );
+private:
+ TInputLine *master;
+ DynamicText *slave;
+};
+
+TestDialog::TestDialog() :
+ TWindowInit( &TestDialog::initFrame ),
+ TDialog( TRect(0,0,40,10), "Dynamic Text" )
+{
+ options |= ofCentered;
+
+ master = new TInputLine( TRect(10,2,32,3), 21 );
+ insert( master );
+
+ // This allocates a 21 byte string (20 + 1 for null). The 'False'
+ // argument indicates that it should be left-justified
+ slave = new DynamicText( TRect(11,4,31,5), "Initial text", False );
+ insert(slave);
+
+ insert( new TButton( TRect(15,6,25,8), "O~K~", cmOK, bfNormal ) );
+
+ master->select();
+}
+
+void TestDialog::handleEvent( TEvent& event )
+{
+ if( event.what == evKeyDown
+ && event.keyDown.keyCode == kbTab )
+ {
+ char buf[30];
+ master->getData( buf ); // read the input
+ slave->setText( buf ); // write it into static text
+ }
+ TDialog::handleEvent( event );
+}
+
+///////////////////////////////////////////////////////////////////////////
+///////////////////////// Test routine ////////////////////////////////////
+
+void Shell::Test()
+{
+ TestDialog *d = new TestDialog; // create dialog
+ deskTop->execView( d ); // execute it
+ CLY_destroy( d ); // destroy it
+
+ // Note: This doesn't illustrate the getData() and setData()
+ // functions, which work as usual for TVision objects. If you
+ // use TDialog::getData and setData, you *must* have space in
+ // void *rec structure for any DynamicText objects,
+}
+
+///////////////////////////////////////////////////////////////////////////
+////////////////////////////// main() function ////////////////////////////
+
+int main()
+{
+ TEvent init;
+ init.what = evCommand;
+ init.message.command = cmAbout; // make a cmAbout command event
+
+ Shell shell;
+ shell.putEvent(init); // put it in the queue to pop up
+ shell.run(); // About box when program starts
+ return 0;
+}
+
diff --git a/tvision/examples/eterm/menus.cfg b/tvision/examples/eterm/menus.cfg
new file mode 100644
index 0000000..9e5f6cd
--- /dev/null
+++ b/tvision/examples/eterm/menus.cfg
@@ -0,0 +1,93 @@
+<Eterm-0.9.1>
+begin menu
+ title Font
+ begin menuitem
+ text "5x7"
+ action string "\e]50;#0"
+ end
+ begin menuitem
+ text "6x12"
+ action string "\e]50;#1"
+ end
+ begin menuitem
+ text "7x14"
+ action string "\e]50;#2"
+ end
+ begin menuitem
+ text "8x16"
+ action string "\e]50;#3"
+ end
+ begin menuitem
+ text "10x20"
+ action string "\e]50;#4"
+ end
+ begin menuitem
+ text "12x24"
+ action string "\e]50;#5"
+ end
+end
+begin menu
+ title Eterm
+ begin menuitem
+ text "Font"
+ action submenu "Font"
+ end
+ begin menuitem
+ text "Terminal"
+ action submenu "Terminal"
+ end
+ -
+ begin menuitem
+ text "New Eterm Window"
+ action script "spawn(Eterm)"
+ end
+ begin menuitem
+ text "Version"
+ action string "\e[8n"
+ end
+ begin menuitem
+ text "Status"
+ action string "\e[9n"
+ end
+ separator
+ begin menuitem
+ text "Save User Settings..."
+ action script "save"
+ end
+ begin menuitem
+ text "Save Theme Settings..."
+ action script "save(theme)"
+ end
+ begin menuitem
+ text "Exit"
+ action script "exit"
+ end
+end
+begin menu
+ title "Eterm Operations"
+ begin menuitem
+ text "New Eterm Window"
+ action script "spawn(Eterm)"
+ end
+ begin menuitem
+ text "Version"
+ action string "\e[8n"
+ end
+ begin menuitem
+ text "Status"
+ action string "\e[9n"
+ end
+ separator
+ begin menuitem
+ text "Save User Settings..."
+ action script "save"
+ end
+ begin menuitem
+ text "Save Theme Settings..."
+ action script "save(theme)"
+ end
+ begin menuitem
+ text "Exit"
+ action script "exit"
+ end
+end
diff --git a/tvision/examples/eterm/theme.cfg b/tvision/examples/eterm/theme.cfg
new file mode 100644
index 0000000..2c8b691
--- /dev/null
+++ b/tvision/examples/eterm/theme.cfg
@@ -0,0 +1,620 @@
+<Eterm-0.9.2>
+#
+# This the sample Eterm config file adapted to be used with TV applications.
+# The resulting terminal is fine tunned to run a TV application and not for
+# general use.
+# What's changed?
+#
+# * Font sizes, most have 0.5 aspect ratio.
+# * Colors to match VGA BIOS values.
+# * Removed scroll bar, actually the only way I know to scroll in this setup
+# is using the mouse wheel. Don't know how to assign it to a key if you
+# know please tellme.
+# * A lot of key combinations defined.
+# * The menu is reduced to just a few items.
+#
+# I didn't remove all original comments so you can customize it.
+#
+# IMPORTANT!! The keys assignments are good for TV and what my system defines
+# as TERM=Eterm, it doesn't mean it will work on any system.
+# I tested it Using Debian GNU/Linux Woody.
+#
+# As always, the authors guarantee absolutely nothing and take
+# no responsibility for anything that might happen to you, your
+# computer, your dog, your sex life, or anyone or anything else
+# directly or indirectly through the use of, or inability to use,
+# this program. Use at your OWN risk.
+
+# Define the color properties
+begin color
+
+# Foreground, background, cursor, scrollbar, pointer colors
+ foreground #aaaaaa
+ background black
+ cursor #ffff00
+ cursor_text #880000
+ pointer white
+
+# video attribute can either be "normal" or "reverse"
+ video normal
+
+# Redefine the 16 basic colors, if you really feel the need
+# First word is "color", next is the number (0-15, BD, or UL),
+# then the values for red, green, and blue separated by spaces
+# Numbers are base 10 unless preceded by "0x" (base 16) or '0'
+# (base 8). Alternatively, you can use color names or #xxxxxx
+# format.
+
+# SET: The default Eterm palette doesn't match the VGA BIOS one, I think
+# Eterm is wrong.
+#
+ color 0 0 0 0
+ color 1 0xa8 0 0
+ color 2 0 0xa8 0
+ color 3 0xa8 0x54 0
+ color 4 0 0 0xa8
+ color 5 0xa8 0 0xa8
+ color 6 0 0xa8 0xa8
+ color 7 0xa8 0xa8 0xa8
+ color 8 0x54 0x54 0x54
+ color 9 0xfc 0x54 0x54
+ color 10 0x54 0xfc 0x54
+ color 11 0xfc 0xfc 0x54
+ color 12 0x54 0x54 0xfc
+ color 13 0xfc 0x54 0xfc
+ color 14 0x54 0xfc 0xfc
+ color 15 #ffffff
+ color bd #ffffff
+ color ul #ffffff
+
+end color
+
+# The X11 attributes section. Should be fairly self-explanatory,
+# but if not, consult the X man page.
+begin attributes
+
+# Geometry == widthxheight+x_offset+y_offset, offsets from top left
+# if +, bottom right if -
+# geometry 132x50+100+100
+# title %appname()
+# name %appname()
+# iconname Eterm
+
+# Set the fonts. These must be monospace fonts. The values shown are
+# the Eterm defaults. The "bold" font is the font used if color BD has
+# not been set and Eterm cannot map the foreground color to one of the
+# high-intensity colors (8-15).
+ font default 4
+ font 0 5x7
+ font 1 6x12
+ font 2 7x14
+ font 3 8x16
+# font 4 9x18 Fails on my system
+ font 4 10x20
+ font 5 12x24
+# font bold 7x14
+end attributes
+
+# The Multichar support options. Same goes for these fonts as for the normal
+# ones. The "encoding" attribute can be either "eucj" or "sjis" or "euckr"
+# or big5 or gb
+begin multichar
+ font 0 -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso10646-1
+ font 1 -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso10646-1
+ font 2 -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
+ font 3 -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1
+ font 4 -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
+ encoding iso-10646
+end multichar
+
+# Define the imageclasses.
+begin imageclasses
+
+# You must define this before setting any images that use it. This is the $PATH-style variable
+# that determines where Eterm looks for image files.
+ path "./pix/:~/.Eterm/:~/.Eterm/themes/Eterm/pix:~/.Eterm/pix/:/usr/share/Eterm/pix/"
+
+# If you want a different icon than the standard Eterm one, set this.
+# icon Eterm.xpm
+
+# This is the background animator. See the man page for the syntax.
+# anim 3 foo1 foo2 foo3
+
+# The rest of the images.
+ begin image
+ type trough
+ mode image allow image trans viewport auto
+ state normal
+ color black #666666
+ file bar_vertical_3.png
+# Here is how you specify the geometry string separately. See the man page for its syntax.
+ geom 100
+ border 2 2 2 3
+ end image
+ begin image
+ type anchor
+ mode image allow image auto
+ state normal
+ color black #666666
+ file bar_vertical_1.png
+ geom 100
+ border 2 2 2 3
+ state selected
+ file bar_vertical_2.png
+ geom 100
+ border 2 2 2 3
+ end image
+ begin image
+ type thumb
+ mode image allow image auto
+ state normal
+ color black #666666
+ file thumb_1.png
+ geom 100
+ border 3 3 3 3
+ state selected
+ file thumb_2.png
+ geom 100
+ border 3 3 3 3
+ end image
+ begin image
+ type up_arrow
+ mode image allow image auto
+ state normal
+ color black #666666
+ file button_arrow_up_1.png
+ geom 100
+ border 2 2 2 2
+ state selected
+ file button_arrow_up_2.png
+ geom 100
+ border 2 2 2 2
+ state clicked
+ file button_arrow_up_3.png
+ geom 100
+ border 2 2 2 2
+ end image
+ begin image
+ type down_arrow
+ mode image allow image auto
+ state normal
+ color black #666666
+ file button_arrow_down_1.png
+ geom 100
+ border 2 2 2 2
+ state selected
+ file button_arrow_down_2.png
+ geom 100
+ border 2 2 2 2
+ state clicked
+ file button_arrow_down_3.png
+ geom 100
+ border 2 2 2 2
+ end image
+ begin image
+ type menu
+ #mode auto allow image auto
+ mode image allow image auto
+ state normal
+ #color #AAAAAA #999999
+ color black #999999
+ file bar_horizontal_1.png
+ geom 100
+ border 2 3 2 3
+ state selected
+ file bar_horizontal_2.png
+ geom 100
+ border 2 3 2 3
+ end image
+ begin image
+ type submenu
+ #mode auto allow image auto
+ mode image allow image auto
+ state normal
+ #color #AAAAAA #999999
+ color black #999999
+ file menu1.png
+ geom 100
+ border 3 15 3 3
+ padding 3 15 3 3
+ state selected
+ file menu2.png
+ geom 100
+ border 3 15 3 3
+ padding 3 15 3 3
+ state clicked
+ file menu3.png
+ geom 100
+ border 3 15 3 3
+ padding 3 15 3 3
+ end image
+ begin image
+ type button_bar
+ #mode auto allow image auto
+ mode image allow image auto
+ state normal
+ #color #AAAAAA #999999
+ color black #999999
+ file bar_horizontal_1.png
+ geom 100
+ border 2 3 2 2
+ state disabled
+ color white #333333
+ cmod image 0xc0
+ border 2 3 2 2
+ end image
+ begin image
+ type button
+ #mode auto allow image auto
+ mode image allow image auto
+ state normal
+ #color #AAAAAA #999999
+ color black #cccccc
+ file bar_horizontal_1.png
+ geom 100
+ border 2 3 2 2
+ state selected
+ file bar_horizontal_2.png
+ geom 100
+ border 2 3 2 2
+ state clicked
+ file bar_horizontal_3.png
+ geom 100
+ border 2 3 2 2
+ end image
+end
+
+%include "menus.cfg"
+
+# This section *must* come after the menu definitions if you want
+# menu actions to work. C'est la vie. :-)
+#
+# Syntax: bind [ { <modifiers> | anymod } ] { <key> | <keysym> | <button> } to { string | echo | menu } <parameter>
+#
+begin actions
+ bind ctrl button1 to string "\e]5;\a"
+ bind ctrl button2 to string "\e[?30t"
+ bind ctrl button3 to menu Eterm
+ bind ctrl shift button3 to string "\e]6;14\a"
+ # SET: XTerm style keys, they are more descriptive than native Eterm keys:
+ # Insert
+ bind 0xff63 to echo "\e[2~"
+ bind shift 0xff63 to echo "\e[2;2~"
+ bind alt 0xff63 to echo "\e[2;3~"
+ bind shift alt 0xff63 to echo "\e[2;4~"
+ bind ctrl 0xff63 to echo "\e[2;5~"
+ bind shift ctrl 0xff63 to echo "\e[2;6~"
+ bind alt ctrl 0xff63 to echo "\e[2;7~"
+ bind shift alt ctrl 0xff63 to echo "\e[2;8~"
+ # Delete
+ #bind 0xffff to echo "\e[3~"
+ bind shift 0xffff to echo "\e[3;2~"
+ bind alt 0xffff to echo "\e[3;3~"
+ bind shift alt 0xffff to echo "\e[3;4~"
+ bind ctrl 0xffff to echo "\e[3;5~"
+ bind shift ctrl 0xffff to echo "\e[3;6~"
+ bind alt ctrl 0xffff to echo "\e[3;7~"
+ bind shift alt ctrl 0xffff to echo "\e[3;8~"
+ # Page Up
+ bind 0xff55 to echo "\e[5~"
+ bind shift 0xff55 to echo "\e[5;2~"
+ bind alt 0xff55 to echo "\e[5;3~"
+ bind shift alt 0xff55 to echo "\e[5;4~"
+ bind ctrl 0xff55 to echo "\e[5;5~"
+ bind shift ctrl 0xff55 to echo "\e[5;6~"
+ bind alt ctrl 0xff55 to echo "\e[5;7~"
+ bind shift alt ctrl 0xff55 to echo "\e[5;8~"
+ # Page Down
+ bind 0xff56 to echo "\e[6~"
+ bind shift 0xff56 to echo "\e[6;2~"
+ bind alt 0xff56 to echo "\e[6;3~"
+ bind shift alt 0xff56 to echo "\e[6;4~"
+ bind ctrl 0xff56 to echo "\e[6;5~"
+ bind shift ctrl 0xff56 to echo "\e[6;6~"
+ bind alt ctrl 0xff56 to echo "\e[6;7~"
+ bind shift alt ctrl 0xff56 to echo "\e[6;8~"
+ # F5
+ bind 0xffc2 to echo "\e[15~"
+ bind shift 0xffc2 to echo "\e[15;2~"
+ bind alt 0xffc2 to echo "\e[15;3~"
+ bind shift alt 0xffc2 to echo "\e[15;4~"
+ bind ctrl 0xffc2 to echo "\e[15;5~"
+ bind shift ctrl 0xffc2 to echo "\e[15;6~"
+ bind alt ctrl 0xffc2 to echo "\e[15;7~"
+ bind shift alt ctrl 0xffc2 to echo "\e[15;8~"
+ # F6
+ bind 0xffc3 to echo "\e[16~"
+ bind shift 0xffc3 to echo "\e[16;2~"
+ bind alt 0xffc3 to echo "\e[16;3~"
+ bind shift alt 0xffc3 to echo "\e[16;4~"
+ bind ctrl 0xffc3 to echo "\e[16;5~"
+ bind shift ctrl 0xffc3 to echo "\e[16;6~"
+ bind alt ctrl 0xffc3 to echo "\e[16;7~"
+ bind shift alt ctrl 0xffc3 to echo "\e[16;8~"
+ # F7
+ bind 0xffc4 to echo "\e[18~"
+ bind shift 0xffc4 to echo "\e[18;2~"
+ bind alt 0xffc4 to echo "\e[18;3~"
+ bind shift alt 0xffc4 to echo "\e[18;4~"
+ bind ctrl 0xffc4 to echo "\e[18;5~"
+ bind shift ctrl 0xffc4 to echo "\e[18;6~"
+ bind alt ctrl 0xffc4 to echo "\e[18;7~"
+ bind shift alt ctrl 0xffc4 to echo "\e[18;8~"
+ # F8
+ bind 0xffc5 to echo "\e[19~"
+ bind shift 0xffc5 to echo "\e[19;2~"
+ bind alt 0xffc5 to echo "\e[19;3~"
+ bind shift alt 0xffc5 to echo "\e[19;4~"
+ bind ctrl 0xffc5 to echo "\e[19;5~"
+ bind shift ctrl 0xffc5 to echo "\e[19;6~"
+ bind alt ctrl 0xffc5 to echo "\e[19;7~"
+ bind shift alt ctrl 0xffc5 to echo "\e[19;8~"
+ # F9
+ bind 0xffc6 to echo "\e[20~"
+ bind shift 0xffc6 to echo "\e[20;2~"
+ bind alt 0xffc6 to echo "\e[20;3~"
+ bind shift alt 0xffc6 to echo "\e[20;4~"
+ bind ctrl 0xffc6 to echo "\e[20;5~"
+ bind shift ctrl 0xffc6 to echo "\e[20;6~"
+ bind alt ctrl 0xffc6 to echo "\e[20;7~"
+ bind shift alt ctrl 0xffc6 to echo "\e[20;8~"
+ # F10
+ bind 0xffc7 to echo "\e[21~"
+ bind shift 0xffc7 to echo "\e[21;2~"
+ bind alt 0xffc7 to echo "\e[21;3~"
+ bind shift alt 0xffc7 to echo "\e[21;4~"
+ bind ctrl 0xffc7 to echo "\e[21;5~"
+ bind shift ctrl 0xffc7 to echo "\e[21;6~"
+ bind alt ctrl 0xffc7 to echo "\e[21;7~"
+ bind shift alt ctrl 0xffc7 to echo "\e[21;8~"
+ # F11
+ bind 0xffc8 to echo "\e[23~"
+ bind shift 0xffc8 to echo "\e[23;2~"
+ bind alt 0xffc8 to echo "\e[23;3~"
+ bind shift alt 0xffc8 to echo "\e[23;4~"
+ bind ctrl 0xffc8 to echo "\e[23;5~"
+ bind shift ctrl 0xffc8 to echo "\e[23;6~"
+ bind alt ctrl 0xffc8 to echo "\e[23;7~"
+ bind shift alt ctrl 0xffc8 to echo "\e[23;8~"
+ # F12
+ bind 0xffc9 to echo "\e[24~"
+ bind shift 0xffc9 to echo "\e[24;2~"
+ bind alt 0xffc9 to echo "\e[24;3~"
+ bind shift alt 0xffc9 to echo "\e[24;4~"
+ bind ctrl 0xffc9 to echo "\e[24;5~"
+ bind shift ctrl 0xffc9 to echo "\e[24;6~"
+ bind alt ctrl 0xffc9 to echo "\e[24;7~"
+ bind shift alt ctrl 0xffc9 to echo "\e[24;8~"
+ # Up
+ bind 0xff52 to echo "\e[A"
+ bind shift 0xff52 to echo "\e[2A"
+ bind alt 0xff52 to echo "\e[3A"
+ bind shift alt 0xff52 to echo "\e[4A"
+ bind ctrl 0xff52 to echo "\e[5A"
+ bind shift ctrl 0xff52 to echo "\e[6A"
+ bind alt ctrl 0xff52 to echo "\e[7A"
+ bind shift alt ctrl 0xff52 to echo "\e[8A"
+ # Down
+ bind 0xff54 to echo "\e[B"
+ bind shift 0xff54 to echo "\e[2B"
+ bind alt 0xff54 to echo "\e[3B"
+ bind shift alt 0xff54 to echo "\e[4B"
+ bind ctrl 0xff54 to echo "\e[5B"
+ bind shift ctrl 0xff54 to echo "\e[6B"
+ bind alt ctrl 0xff54 to echo "\e[7B"
+ bind shift alt ctrl 0xff54 to echo "\e[8B"
+ # Right
+ bind 0xff53 to echo "\e[C"
+ bind shift 0xff53 to echo "\e[2C"
+ bind alt 0xff53 to echo "\e[3C"
+ bind shift alt 0xff53 to echo "\e[4C"
+ bind ctrl 0xff53 to echo "\e[5C"
+ bind shift ctrl 0xff53 to echo "\e[6C"
+ bind alt ctrl 0xff53 to echo "\e[7C"
+ bind shift alt ctrl 0xff53 to echo "\e[8C"
+ # Left
+ bind 0xff51 to echo "\e[D"
+ bind shift 0xff51 to echo "\e[2D"
+ bind alt 0xff51 to echo "\e[3D"
+ bind shift alt 0xff51 to echo "\e[4D"
+ bind ctrl 0xff51 to echo "\e[5D"
+ bind shift ctrl 0xff51 to echo "\e[6D"
+ bind alt ctrl 0xff51 to echo "\e[7D"
+ bind shift alt ctrl 0xff51 to echo "\e[8D"
+ # End
+ #bind 0xff57 to echo "\e[F"
+ bind 0xffc1 to echo "\e[8~"
+ bind shift 0xff57 to echo "\e[2F"
+ bind alt 0xff57 to echo "\e[3F"
+ bind shift alt 0xff57 to echo "\e[4F"
+ bind ctrl 0xff57 to echo "\e[5F"
+ bind shift ctrl 0xff57 to echo "\e[6F"
+ bind alt ctrl 0xff57 to echo "\e[7F"
+ bind shift alt ctrl 0xff57 to echo "\e[8F"
+ # Home
+ bind 0xff58 to echo "\e[H"
+ bind shift 0xff58 to echo "\e[2H"
+ bind alt 0xff58 to echo "\e[3H"
+ bind shift alt 0xff58 to echo "\e[4H"
+ bind ctrl 0xff58 to echo "\e[5H"
+ bind shift ctrl 0xff58 to echo "\e[6H"
+ bind alt ctrl 0xff58 to echo "\e[7H"
+ bind shift alt ctrl 0xff58 to echo "\e[8H"
+ # BackSpace
+ bind shift 0xff08 to echo "\e[2K"
+ bind alt 0xff08 to echo "\e[3K"
+ bind shift alt 0xff08 to echo "\e[4K"
+ bind ctrl 0xff08 to echo "\e[5K"
+ bind shift ctrl 0xff08 to echo "\e[6K"
+ bind alt ctrl 0xff08 to echo "\e[7K"
+ bind shift alt ctrl 0xff08 to echo "\e[8K"
+ # Tab
+ bind shift 0xff09 to echo "\e[2T"
+ bind alt 0xff09 to echo "\e[3T"
+ bind shift alt 0xff09 to echo "\e[4T"
+ bind ctrl 0xff09 to echo "\e[5T"
+ bind shift ctrl 0xff09 to echo "\e[6T"
+ bind alt ctrl 0xff09 to echo "\e[7T"
+ bind shift alt ctrl 0xff09 to echo "\e[8T"
+ # F1
+ #bind 0xffbe to echo "\eOP"
+ bind 0xffc1 to echo "\e[11~"
+ bind shift 0xffbe to echo "\eO2P"
+ bind alt 0xffbe to echo "\eO3P"
+ bind shift alt 0xffbe to echo "\eO4P"
+ bind ctrl 0xffbe to echo "\eO5P"
+ bind shift ctrl 0xffbe to echo "\eO6P"
+ bind alt ctrl 0xffbe to echo "\eO7P"
+ bind shift alt ctrl 0xffbe to echo "\eO8P"
+ # F2
+ #bind 0xffbf to echo "\eOQ"
+ bind 0xffc1 to echo "\e[12~"
+ bind shift 0xffbf to echo "\eO2Q"
+ bind alt 0xffbf to echo "\eO3Q"
+ bind shift alt 0xffbf to echo "\eO4Q"
+ bind ctrl 0xffbf to echo "\eO5Q"
+ bind shift ctrl 0xffbf to echo "\eO6Q"
+ bind alt ctrl 0xffbf to echo "\eO7Q"
+ bind shift alt ctrl 0xffbf to echo "\eO8Q"
+ # F3
+ #bind 0xffc0 to echo "\eOR"
+ bind 0xffc1 to echo "\e[13~"
+ bind shift 0xffc0 to echo "\eO2R"
+ bind alt 0xffc0 to echo "\eO3R"
+ bind shift alt 0xffc0 to echo "\eO4R"
+ bind ctrl 0xffc0 to echo "\eO5R"
+ bind shift ctrl 0xffc0 to echo "\eO6R"
+ bind alt ctrl 0xffc0 to echo "\eO7R"
+ bind shift alt ctrl 0xffc0 to echo "\eO8R"
+ # F4
+ #bind 0xffc1 to echo "\eOS"
+ bind 0xffc1 to echo "\e[14~"
+ bind shift 0xffc1 to echo "\eO2S"
+ bind alt 0xffc1 to echo "\eO3S"
+ bind shift alt 0xffc1 to echo "\eO4S"
+ bind ctrl 0xffc1 to echo "\eO5S"
+ bind shift ctrl 0xffc1 to echo "\eO6S"
+ bind alt ctrl 0xffc1 to echo "\eO7S"
+ bind shift alt ctrl 0xffc1 to echo "\eO8S"
+end actions
+
+# This section must also come after the menus if you want any buttons
+# to launch menus. (If not, it can go anywhere.)
+begin button_bar
+
+# Specify a font. The default buttonbar font is the default terminal
+# font as defined in the attributes section above.
+ font "-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1"
+
+# Add a button. The syntax is:
+# button <text> [ icon <filename> ] action { string | echo | menu } <parameter>
+#
+ button Eterm action menu "Eterm Operations"
+ button Font action menu Font
+ rbutton icon help.png action script "spawn(Eterm -e man Eterm)"
+ rbutton icon exit.png action script "exit"
+end button_bar
+
+# The XIM support options.
+# input_method: set the name of your favorate input method program
+# preedit_type: OverTheSpot or OffTheSpot or Root
+# begin xim
+# input_method Ami
+# preedit_type OverTheSpot
+# end xim
+
+# Boolean variables. The values can be "1", "on", or "true" for TRUE, or "0",
+# "off", or "false" for FALSE.
+begin toggles
+
+# If true, Eterm will un-iconify itself when it receives a beep (ASCII 0x07)
+ map_alert on
+
+# If true, Eterm will flash rather than sending a beep.
+ visual_bell off
+
+# If true, Eterm will prepend '-' to the shell name when calling it.
+ login_shell true
+
+# If true, Eterm will display the scroll bar
+ scrollbar off
+
+# If true, Eterm will attempt to make an entry in the utmp file to record the
+# login information. Eterm *must* run privileged to do this.
+ utmp_logging on
+
+
+# If true, Eterm will select the whole line when you triple click on the
+# window, instead of from that location/word to the end of the line.
+ select_line false
+
+# If true, Eterm will handle the Meta (Alt) + keypress to set the 8th bit.
+# If false, Eterm will handle the Meta + keypress as an escape prefix. (default)
+# meta8 false
+
+# If true, Eterm will start iconified.
+ iconic false
+
+# If true, Eterm will jump to the bottom of the window when something is output
+# to the terminal.
+ home_on_output 1
+
+# If true, Eterm will jump to the bottom of the window when a key is pressed.
+ home_on_input 1
+
+# If true, Eterm will put the scrollbar on the right of the window (default is left).
+ scrollbar_right true
+
+# If true, the scrollbar will have no trough.
+ scrollbar_floating false
+
+# If true, Eterm will run with no window borders.
+ borderless false
+
+# If true, Eterm will use a double-buffered background pixmap for drawing text. This
+# makes redraws faster by reducing exposes, but it uses more memory. If you have the
+# memory to spare, it's a good idea.
+# double_buffer true
+
+end toggles
+
+begin keyboard
+
+# Use the supplied keysym to reduce/enlarge the font
+ smallfont_key LessThan
+ bigfont_key GreaterThan
+ meta_mod 1
+
+# You can also associate a given keysym (0xff00 - 0xffff) with a string
+# keysym 0xffff "\r\n\e\007\t"
+
+# Greek keyboard mode. First the word "greek", then its boolean
+# state, then its mode (either "iso" or "ibm").
+# greek off iso
+end keyboard
+
+begin misc
+
+# The command to which to pipe print requests (printscreen)
+# print_pipe "lpr"
+
+# The number of lines in the scrollback buffer. More lines, more memory needed.
+ save_lines 1024
+
+# The characters to use as word delimiters for double-click selection
+ cut_chars "\t\\\`\\\"\'&() *,;<=>?@[]{|}"
+
+# Defines the width of the border between the terminal window and the client window.
+# (Default is 5).
+ border_width 5
+
+# Defines the number of pixels to add between lines (default is 0).
+# line_space 2
+
+# Value to use for $TERM
+ term_name Eterm
+
+# Program to exec (intended for use with themes)
+# exec foo
+
+end misc
diff --git a/tvision/examples/fonts/font.016 b/tvision/examples/fonts/font.016
new file mode 100644
index 0000000..e2bbe99
--- /dev/null
+++ b/tvision/examples/fonts/font.016
Binary files differ
diff --git a/tvision/examples/fonts/genraw.cc b/tvision/examples/fonts/genraw.cc
new file mode 100644
index 0000000..728b052
--- /dev/null
+++ b/tvision/examples/fonts/genraw.cc
@@ -0,0 +1,113 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea
+ This code is Public Domain and you can use it for any purpose. Note that
+when you link to another libraries, obviously needed, the code can (and
+currently will) be affected by the libraries license.
+ Currently my TV port is GPL so this code becomes GPL, but if you link
+with another Turbo Vision port or the library changes license things are
+different.
+
+ Description:
+ This examples shows how to use sft files for bitmaped fonts.
+ It can be used as a fonts generator and supports over than 40 encodings.
+Current sft files can be used to generate more than 200 fonts (different
+sizes and encodings).
+ For more sft files look in other directories or in the setedit project.
+
+***************************************************************************/
+
+#define Uses_stdlib
+#define Uses_string
+#define Uses_TVCodePage
+#define Uses_TVFontCollection
+#include <tv.h>
+
+// This small test program creates raw fonts from the specified sft file
+// In Linux the generated fonts can be loaded using consolechars -f file
+// Note that some SFT files can contain fonts with more than 8 pixels of
+// width.
+
+void WriteRaw(uchar *data, int w, int h, const char *name)
+{
+ unsigned wSize=(w+7)/8;
+ FILE *f=fopen(name,"wb");
+ if (f)
+ {
+ printf("Writing %s\n",name);
+ fwrite(data,256*h*wSize,1,f);
+ fclose(f);
+ }
+}
+
+void WriteHeader(uchar *data, int w, int h, char *name)
+{
+ FILE *f=fopen(name,"wb");
+ int c,x,y;
+ int wSize=(w+7)/8;
+
+ if (f)
+ {
+ fprintf(f,"// Font %s size %d,%d\n",name,w,h);
+ char *dot=strchr(name,'.');
+ if (dot) *dot='_';
+ fprintf(f,"uchar *FontData_%s[]=\n{\n",name);
+ for (c=0; c<256; c++)
+ {
+ for (y=0; y<h; y++)
+ for (x=0; x<wSize; data++, x++)
+ fprintf(f,"0x%02X,",*data);
+ fprintf(f,"\n");
+ }
+ fprintf(f,"};\n");
+ fclose(f);
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ new TVCodePage(TVCodePage::ISOLatin1Linux,TVCodePage::ISOLatin1Linux,
+ TVCodePage::ISOLatin1Linux);
+
+ if (argc<2 || argc>3)
+ {
+ printf("Usage: %s sft_file [encoding]\nGenerates raw fonts\n",argv[0]);
+ return 2;
+ }
+
+ char *end;
+ int encoding=TVCodePage::ISOLatin1Linux;
+ if (argc==3)
+ encoding=strtol(argv[2],&end,0);
+
+ TVFontCollection *p=new TVFontCollection(argv[1],encoding);
+ if (p->GetError())
+ {
+ printf("Error!\n");
+ return 1;
+ }
+
+ char b[PATH_MAX];
+ int w,h;
+ uchar *data;
+
+ for (w=8; w<11; w++)
+ {
+ for (h=13; h<21; h++)
+ {
+ data=p->GetFont(w,h);
+ // Not all are available, you must check. In fact only a few are
+ // available
+ if (!data) continue;
+ sprintf(b,"raw%03d.%03d",w,h);
+ #if 0
+ WriteRaw(data,w,h,b);
+ #else
+ // Optional version to generated a C++ header
+ WriteHeader(data,w,h,b);
+ #endif
+ DeleteArray(data);
+ }
+ }
+ return 0;
+}
diff --git a/tvision/examples/fonts/genraw.gpr b/tvision/examples/fonts/genraw.gpr
new file mode 100644
index 0000000..56b87e3
--- /dev/null
+++ b/tvision/examples/fonts/genraw.gpr
Binary files differ
diff --git a/tvision/examples/fonts/genraw.mkf b/tvision/examples/fonts/genraw.mkf
new file mode 100644
index 0000000..524eb9b
--- /dev/null
+++ b/tvision/examples/fonts/genraw.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include genraw$(ExIMK)
diff --git a/tvision/examples/fonts/genraw.umk b/tvision/examples/fonts/genraw.umk
new file mode 100644
index 0000000..ffafee4
--- /dev/null
+++ b/tvision/examples/fonts/genraw.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./genraw$(ExOBJ)
+
+LIBRARIES=
+
+genraw$(ExEXE):: \
+ ./genraw$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./genraw$(ExOBJ):: genraw.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/fonts/ocr.sft b/tvision/examples/fonts/ocr.sft
new file mode 100644
index 0000000..5a8b08f
--- /dev/null
+++ b/tvision/examples/fonts/ocr.sft
Binary files differ
diff --git a/tvision/examples/fonts/rhide.env b/tvision/examples/fonts/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/fonts/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/fonts/test.cc b/tvision/examples/fonts/test.cc
new file mode 100644
index 0000000..76dd41e
--- /dev/null
+++ b/tvision/examples/fonts/test.cc
@@ -0,0 +1,260 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea
+ This code is Public Domain and you can use it for any purpose. Note that
+when you link to another libraries, obviously needed, the code can (and
+currently will) be affected by the libraries license.
+ Currently my TV port is GPL so this code becomes GPL, but if you link
+with another Turbo Vision port or the library changes license things are
+different.
+
+ Description:
+ This examples shows how to use bitmaped fonts.
+ Not all terminals supports it.
+
+***************************************************************************/
+
+#define Uses_stdio
+#define Uses_string
+#define Uses_limits
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_MsgBox
+#define Uses_TKeys
+#define Uses_TScreen
+#define Uses_TVCodePage
+
+#include <tv.h>
+
+const int cmTestFont=100;
+const int cmTestRestore=101;
+const int cmTestFontSecondary=102;
+
+class TMyApp : public TApplication
+{
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine(TRect r);
+ static TMenuBar *initMenuBar(TRect r);
+ virtual void handleEvent(TEvent& event);
+ void testFont();
+ void testRestore();
+ void testFontSecondary();
+ void shell();
+
+ uchar *fontData;
+ int quit;
+ int changed1,changed2;
+};
+
+
+TMyApp::TMyApp() :
+ TProgInit(&TMyApp::initStatusLine,&TMyApp::initMenuBar,&TMyApp::initDeskTop)
+{
+ quit=0;
+ changed1=changed2=0;
+ if (!TScreen::canSetBFont())
+ {
+ messageBox("This terminal doesn't support changing the fonts",mfError | mfOKButton);
+ quit=1;
+ }
+ else
+ {
+ unsigned w,h,wm,hm;
+ int noSize=0;
+ TScreen::getFontGeometry(w,h);
+ if (w!=8 || h!=16)
+ {
+ if (TScreen::canSetFontSize())
+ {
+ TScreen::getFontGeometryRange(w,h,wm,hm);
+ if (w>8 || wm<8 || h>16 || hm<16)
+ noSize=1;
+ }
+ else
+ noSize=1;
+ }
+ if (noSize)
+ {
+ messageBox("This terminal doesn't support the test fonts used for this demo",mfError | mfOKButton);
+ quit=1;
+ }
+ else
+ {
+ FILE *f=fopen("font.016","rb");
+ if (f)
+ {
+ fontData=new uchar[4096];
+ fread(fontData,4096,1,f);
+ fclose(f);
+ }
+ else
+ {
+ messageBox("Error reading the test font!",mfError | mfOKButton);
+ quit=1;
+ }
+ }
+ }
+}
+
+void TMyApp::handleEvent(TEvent &event)
+{
+ TApplication::handleEvent(event);
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmTestFont:
+ testFont();
+ break;
+
+ case cmTestFontSecondary:
+ testFontSecondary();
+ break;
+
+ case cmTestRestore:
+ testRestore();
+ break;
+
+ case cmCallShell:
+ shell();
+ break;
+ }
+ clearEvent(event);
+ }
+ if (quit)
+ {
+ TEvent event;
+ event.what=evCommand;
+ event.message.command=cmQuit;
+ TApplication::handleEvent(event);
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar(TRect r)
+{
+ r.b.y=r.a.y+1;
+ return new TMenuBar(r,
+ *new TSubMenu("~D~emo",kbAltD) +
+ *new TMenuItem("Test ~f~ont",cmTestFont,kbNoKey,hcNoContext,"")+
+ *new TMenuItem("Test ~f~ont as secondary",cmTestFontSecondary,kbNoKey,hcNoContext,"")+
+ *new TMenuItem("~R~estore font",cmTestRestore,kbNoKey,hcNoContext,"")+
+ newLine() +
+ *new TMenuItem("S~h~ell",cmCallShell,kbNoKey,hcNoContext)+
+ *new TMenuItem("E~x~it",cmQuit,kbNoKey,hcNoContext,"Alt-X")
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y=r.b.y-1;
+ return new TStatusLine(r,
+ *new TStatusDef(0,0xFFFF)+
+ *new TStatusItem(0,kbF10,cmMenu) +
+ *new TStatusItem("~Alt-X~ Exit",kbAltX,cmQuit)
+ );
+}
+
+void TMyApp::shell()
+{
+ suspend();
+ TScreen::System(CLY_GetShellName());
+ resume();
+ redraw();
+}
+
+void TMyApp::testFont()
+{
+ if (changed1)
+ {
+ messageBox("\03Already using it",mfInformation | mfOKButton);
+ return;
+ }
+ TScreenFont256 font;
+ font.w=8;
+ font.h=16;
+ font.data=fontData;
+ if (TScreen::setPrimaryFont(&font,TVCodePage::ISOLatin1Linux))
+ {
+ messageBox("\03Font successfuly changed",mfInformation | mfOKButton);
+ changed1=1;
+ }
+ #ifdef TVOS_DOS
+ /* Test for DOS driver mode switch when the font have the same size */
+ messageBox("\03Now I'll change the video mode, fonts should survive",mfInformation | mfOKButton);
+ setScreenMode(TDisplay::smCO90x30);
+ #endif
+}
+
+void TMyApp::testRestore()
+{
+ if (!changed1 && !changed2)
+ {
+ messageBox("\03No need to restore the font",mfInformation | mfOKButton);
+ return;
+ }
+ TScreen::restoreFonts();
+ messageBox("\03Font restored",mfInformation | mfOKButton);
+ changed1=changed2=0;
+}
+
+void TMyApp::testFontSecondary()
+{
+ if (!TScreen::canSetSBFont())
+ {
+ messageBox("\03This terminal doesn't support a secondary font",mfError | mfOKButton);
+ return;
+ }
+ if (changed2)
+ {
+ messageBox("\03Already using it",mfInformation | mfOKButton);
+ return;
+ }
+ if (changed1)
+ {
+ TScreen::restoreFonts();
+ changed1=0;
+ }
+
+ unsigned w,h;
+ TScreen::getFontGeometry(w,h);
+ if (w!=8 || h!=16)
+ messageBox("\03The default font doesn't match the size of the test font, the next operation will fail",mfInformation | mfOKButton);
+
+ TScreenFont256 font;
+ font.w=8;
+ font.h=16;
+ font.data=fontData;
+ if (TScreen::setSecondaryFont(&font))
+ {
+ messageBox("\03Restored primary font and defined secondary font. Look at the dialog title.",mfInformation | mfOKButton);
+ changed2=1;
+ }
+ else
+ messageBox("\03Error setting the secondary font.",mfError | mfOKButton);
+}
+
+int main(int argc, char *argv[], char **envir)
+{
+ TDisplay::setArgv(argc,argv,envir);
+ TMyApp myApp;
+ const char *title=TScreen::getWindowTitle();
+ TScreen::setWindowTitle("Turbo Vision font test program");
+ //myApp.setScreenMode(TDisplay::smCO90x34);
+ //myApp.setScreenMode(90,30,9,16);
+ //myApp.setScreenMode(132,60,9,16); Test for a VESA mode
+ myApp.run();
+ if (title)
+ {
+ TScreen::setWindowTitle(title);
+ delete[] title;
+ }
+ return 0;
+}
diff --git a/tvision/examples/fonts/test.gpr b/tvision/examples/fonts/test.gpr
new file mode 100644
index 0000000..e0f3cd8
--- /dev/null
+++ b/tvision/examples/fonts/test.gpr
Binary files differ
diff --git a/tvision/examples/fonts/test.mkf b/tvision/examples/fonts/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/fonts/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/fonts/test.umk b/tvision/examples/fonts/test.umk
new file mode 100644
index 0000000..ce3bdf8
--- /dev/null
+++ b/tvision/examples/fonts/test.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./test$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./test$(ExOBJ):: test.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/gen_mkf.pl b/tvision/examples/gen_mkf.pl
new file mode 100644
index 0000000..b4ea58c
--- /dev/null
+++ b/tvision/examples/gen_mkf.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+for (@ARGV)
+ {
+ $_=~/([^\/]*)\.mkf/;
+ $make=$1;
+ $c=scalar(split(/\//));
+ $d='';
+ while ($c--) { $d.='../'; }
+ print "$_ $1 $d\n";
+ open(FIL,">$_");
+ print FIL "#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=".$d."include
+COMMON_IMK=".$d."makes/common.imk
+include \$(COMMON_IMK)
+include $1\$(ExIMK)
+";
+ close(FIL);
+ }
+
diff --git a/tvision/examples/helpdemo/helpdemo.bmk b/tvision/examples/helpdemo/helpdemo.bmk
new file mode 100644
index 0000000..cf03043
--- /dev/null
+++ b/tvision/examples/helpdemo/helpdemo.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: helpdemo.exe
+!include ../../makes/common.bmk
+!include helpdemo.umk
+
diff --git a/tvision/examples/helpdemo/helpdemo.cc b/tvision/examples/helpdemo/helpdemo.cc
new file mode 100644
index 0000000..1cafe64
--- /dev/null
+++ b/tvision/examples/helpdemo/helpdemo.cc
@@ -0,0 +1,207 @@
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_TMenuItem
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TStatusLine
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TButton
+#define Uses_TStaticText
+#define Uses_TDialog
+#define Uses_MsgBox
+#include <tv.h>
+
+const unsigned short cmHelpDemoCmd = 100;
+const unsigned short cmTestA = 101;
+const unsigned short cmTestB = 102;
+const unsigned short cmTestC = 103;
+
+
+const unsigned short hcFirst = 100; // First context
+const unsigned short hcButtonOne = 100;
+const unsigned short hcButtonTwo = 101;
+const unsigned short hcButtonHelp = 102;
+const unsigned short hcHelpDemo = 103;
+const unsigned short hcExit = 104;
+const unsigned short hcDemoMenu = 105;
+const unsigned short hcLast = 104; // Last context
+
+char *helpString[] = {
+ "Button OK!",
+ "Button Cancel!",
+ "Button Help!",
+ "Help Demo Window",
+ "Exit program",
+ "Demo menu"
+};
+
+//
+// ---------------------> Classes
+//
+class THintStatusLine : public TStatusLine
+{
+
+public:
+
+ THintStatusLine(TRect r, TStatusDef& def) : TStatusLine( r, def ) { }
+ virtual const char *hint(ushort aHelpCtx)
+ {
+ if( aHelpCtx >= hcFirst && aHelpCtx <= hcLast )
+ return( helpString[aHelpCtx-100] );
+ else
+ return( "" ); // Don't return 0 here.
+ }
+};
+
+class TMyApp : public TApplication
+{
+
+public:
+
+ TMyApp() : TProgInit(&TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop ) { }
+ static TMenuBar *initMenuBar( TRect r );
+ static TStatusLine *initStatusLine( TRect r );
+ virtual void handleEvent( TEvent& event);
+};
+
+class THelpDemo : public TDialog
+{
+public:
+ THelpDemo();
+ virtual void handleEvent( TEvent& event );
+};
+
+
+//
+// Member functions of TMyApp
+//
+TMenuBar *TMyApp::initMenuBar( TRect bounds )
+{
+ bounds.b.y = bounds.a.y + 1;
+
+ TMenuBar *mainMenu = new TMenuBar (bounds, new TMenu(
+ *new TMenuItem("~D~emos", kbAltD, new TMenu(
+ *new TMenuItem("~H~elp Demo", cmHelpDemoCmd, kbAltH, hcHelpDemo) +
+ newLine() +
+ *new TMenuItem("E~x~it", cmQuit, kbAltX, hcExit, "Alt-X")
+ ), hcDemoMenu)
+ ));
+
+ return( mainMenu );
+}
+
+TStatusLine *TMyApp::initStatusLine( TRect bounds )
+{
+ bounds.a.y = bounds.b.y - 1;
+
+ THintStatusLine *statusLine = new THintStatusLine (bounds,
+ *new TStatusDef(0, hcFirst-1) +
+ *new TStatusItem("~Alt-X~ Exit", kbAltX, cmQuit) +
+ *new TStatusItem("~Alt-H~ Help Demo", kbAltH, cmHelpDemoCmd) +
+ *new TStatusDef(hcFirst, hcButtonHelp) +
+ *new TStatusItem("~Alt-F3~ Close", kbAltF3, cmClose) +
+ *new TStatusItem("~Alt-K~ OK", kbAltK, cmTestA) +
+ *new TStatusItem("~Alt-C~ Cancel", kbAltC, cmTestB) +
+ *new TStatusItem("~Alt-H~ Help", kbAltH, cmTestC) +
+ *new TStatusDef(hcButtonHelp + 1, 0xFFFF) +
+ *new TStatusItem("~Alt-X~ Exit", kbAltX, cmQuit) +
+ *new TStatusItem("~Alt-H~ Help Demo", kbAltH, cmHelpDemoCmd)
+ );
+
+ return (statusLine);
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event);
+
+ switch(event.what)
+ {
+ case evCommand: // handle COMMAND events
+ {
+ switch(event.message.command)
+ {
+ case cmHelpDemoCmd:
+ {
+ TView *helpBox = new THelpDemo;
+ if( validView(helpBox) )
+ deskTop->insert( helpBox );
+ break;
+ }
+ default:
+ return;
+ }
+ clearEvent(event); // Clear the event we handled
+ }
+ }
+}
+
+
+THelpDemo::THelpDemo() :
+ TWindowInit(&THelpDemo::initFrame),
+ TDialog(TRect(0, 0, 30, 12), "Help Demo Box")
+{
+ TView *control = new TStaticText(TRect(2, 5, 17, 7), "Example of help contexts");
+ insert(control);
+
+ TView *defControl = new TButton(TRect(18,2,28,4), "O~K~", cmTestA, bfDefault);
+ defControl->helpCtx = hcButtonOne;
+ insert(defControl);
+
+ control = new TButton(TRect(18,5,28,7), "~C~ancel", cmTestB, bfNormal);
+ control->helpCtx = hcButtonTwo;
+ insert(control);
+
+ control = new TButton(TRect(18,8,28,10), "~H~elp", cmTestC, bfNormal);
+ control->helpCtx = hcButtonHelp;
+ insert(control);
+
+ setCurrent(defControl, normalSelect);
+ options |= ofCentered;
+}
+
+
+void THelpDemo::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmTestA:
+ messageBox("OK...", mfOKButton);
+ break;
+ case cmTestB:
+ messageBox("Cancel...", mfOKButton);
+ break;
+ case cmTestC:
+ messageBox("Help...", mfOKButton);
+ break;
+ default:
+ return;
+ }
+ clearEvent( event );
+ }
+}
+
+
+//
+//--------------- MAIN ------------------
+//
+int main()
+{
+ TMyApp myApp;
+
+ myApp.run();
+
+ return( 0 );
+}
+
+
diff --git a/tvision/examples/helpdemo/helpdemo.gpr b/tvision/examples/helpdemo/helpdemo.gpr
new file mode 100644
index 0000000..d6f56f1
--- /dev/null
+++ b/tvision/examples/helpdemo/helpdemo.gpr
Binary files differ
diff --git a/tvision/examples/helpdemo/helpdemo.mkf b/tvision/examples/helpdemo/helpdemo.mkf
new file mode 100644
index 0000000..0b89376
--- /dev/null
+++ b/tvision/examples/helpdemo/helpdemo.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include helpdemo$(ExIMK)
diff --git a/tvision/examples/helpdemo/helpdemo.umk b/tvision/examples/helpdemo/helpdemo.umk
new file mode 100644
index 0000000..291f031
--- /dev/null
+++ b/tvision/examples/helpdemo/helpdemo.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./helpdemo$(ExOBJ)
+
+LIBRARIES=
+
+helpdemo$(ExEXE):: \
+ ./helpdemo$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./helpdemo$(ExOBJ):: helpdemo.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/helpdemo/rhide.env b/tvision/examples/helpdemo/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/helpdemo/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/i18n/README b/tvision/examples/i18n/README
new file mode 100644
index 0000000..f000a61
--- /dev/null
+++ b/tvision/examples/i18n/README
@@ -0,0 +1,29 @@
+ Here is an example on how to use the internationalization (i18n) mechanisms
+for messages.
+ This small program uses various strings found in TV so they are already
+available in the tvision.mo catalog (tvision domain). The code have only one
+message to found in TV: "~W~indow" (TV have the plural).
+ This string is marked as "needs translation" using __(...). This macro does
+nothing and is there just to tell xgettext we want to translate it.
+ Then we use the script "extract.sh" to call xgettext and generate
+"test.po". This file contains the strings to translate (just one in this
+example).
+ The next step is to create the "catalog sources" for each language. In this
+example we are using spanish so we create es.po. It contains the spanish
+translations.
+ Finally we compile it using "msgfmt -o test.mo es.po" and put this catalog
+in intl/es/LC_MESSAGES/test.mo. In real life it should be installed at
+system level, for UNIX systems it is usually installed in
+/usr/share/locale/es/LC_MESSAGES or /usr/local/share/locale/es/LC_MESSAGES.
+ So we have two catalogs for spanish, one for the "tvision" domain and
+another for the "test" domain. TV will search in the "test" domain first and
+if the message isn't there will search in "tvision".
+ To enable the translations you just need to call TVIntl::textDomain or
+TVIntl::autoInit. The second is used to force a directory to search for
+catalogs so we use it in this example.
+ Note the code is forcing spanish using putenv("LANG=es"); because that's
+the only translation we have. It shouldn't be like that in real life.
+ That's all, play with the example you'll see text translated to spanish in
+menues and status line.
+
+
diff --git a/tvision/examples/i18n/es.po b/tvision/examples/i18n/es.po
new file mode 100644
index 0000000..1f0e19f
--- /dev/null
+++ b/tvision/examples/i18n/es.po
@@ -0,0 +1,4 @@
+#. This definition doesn't exist in TV, only the plural
+#: test.cc:55
+msgid "~W~indow"
+msgstr "~V~entana"
diff --git a/tvision/examples/i18n/extract.sh b/tvision/examples/i18n/extract.sh
new file mode 100755
index 0000000..b57fd5f
--- /dev/null
+++ b/tvision/examples/i18n/extract.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+xgettext --default-domain=test --add-comments --keyword=_ --keyword=__ --omit-header --add-location test.cc
diff --git a/tvision/examples/i18n/intl/es/LC_MESSAGES/test.mo b/tvision/examples/i18n/intl/es/LC_MESSAGES/test.mo
new file mode 100644
index 0000000..ade151c
--- /dev/null
+++ b/tvision/examples/i18n/intl/es/LC_MESSAGES/test.mo
Binary files differ
diff --git a/tvision/examples/i18n/intl/es/LC_MESSAGES/tvision.mo b/tvision/examples/i18n/intl/es/LC_MESSAGES/tvision.mo
new file mode 100644
index 0000000..654c3be
--- /dev/null
+++ b/tvision/examples/i18n/intl/es/LC_MESSAGES/tvision.mo
Binary files differ
diff --git a/tvision/examples/i18n/rhide.env b/tvision/examples/i18n/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/i18n/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/i18n/test.cc b/tvision/examples/i18n/test.cc
new file mode 100644
index 0000000..c22a49a
--- /dev/null
+++ b/tvision/examples/i18n/test.cc
@@ -0,0 +1,71 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador E. Tropea
+ This code is Public Domain and you can use it for any purpose. Note that
+when you link to another libraries, obviously needed, the code can (and
+currently will) be affected by the libraries license.
+ Currently my TV port is GPL so this code becomes GPL, but if you link
+with another Turbo Vision port or the library changes license things are
+different.
+
+ Description:
+ This example shows how to use internationalization (i18n) for TV messages.
+
+***************************************************************************/
+
+#define Uses_stdlib
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TScreen
+#include <tv.h>
+
+class TMyApp : public TApplication
+{
+public:
+ TMyApp();
+ static TMenuBar *initMenuBar(TRect r);
+};
+
+TMyApp::TMyApp() :
+ TProgInit(&TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+TMenuBar *TMyApp::initMenuBar(TRect r)
+{
+ r.b.y=r.a.y+1;
+ return new TMenuBar( r,
+ *new TSubMenu("~F~ile",kbAltF)+
+ *new TMenuItem("~O~pen",200,kbF3,hcNoContext,"F3")+
+ *new TMenuItem("~N~ew", 200,kbF4,hcNoContext,"F4")+
+ newLine()+
+ *new TMenuItem("E~x~it",cmQuit,kbAltX,hcNoContext,"Alt-X")+
+ // This definition doesn't exist in TV, only the plural
+ *new TSubMenu(__("~W~indow"), kbAltW )+
+ *new TMenuItem("~N~ext",cmNext,kbF6,hcNoContext,"F6")+
+ *new TMenuItem("~Z~oom",cmZoom,kbF5,hcNoContext,"F5")
+ );
+}
+
+int main()
+{
+ // Here I force the use of spanish
+ putenv("LANG=es");
+ // Here we tell gettext to use the "domain" test located at the "intl" dir.
+ // In real life TVIntl::textDomain("test"); should be enough.
+ TVIntl::autoInit("test","intl");
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/i18n/test.gpr b/tvision/examples/i18n/test.gpr
new file mode 100644
index 0000000..e0f3cd8
--- /dev/null
+++ b/tvision/examples/i18n/test.gpr
Binary files differ
diff --git a/tvision/examples/i18n/test.mkf b/tvision/examples/i18n/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/i18n/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/i18n/test.po b/tvision/examples/i18n/test.po
new file mode 100644
index 0000000..470d684
--- /dev/null
+++ b/tvision/examples/i18n/test.po
@@ -0,0 +1,4 @@
+#. This definition doesn't exist in TV, only the plural
+#: test.cc:55
+msgid "~W~indow"
+msgstr ""
diff --git a/tvision/examples/i18n/test.umk b/tvision/examples/i18n/test.umk
new file mode 100644
index 0000000..ce3bdf8
--- /dev/null
+++ b/tvision/examples/i18n/test.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./test$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./test$(ExOBJ):: test.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/inplis/implis.bmk b/tvision/examples/inplis/implis.bmk
new file mode 100644
index 0000000..4e5846d
--- /dev/null
+++ b/tvision/examples/inplis/implis.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: inplis.exe
+!include ../../makes/common.bmk
+!include implis.umk
+
diff --git a/tvision/examples/inplis/implis.gpr b/tvision/examples/inplis/implis.gpr
new file mode 100644
index 0000000..ed071d6
--- /dev/null
+++ b/tvision/examples/inplis/implis.gpr
Binary files differ
diff --git a/tvision/examples/inplis/implis.mkf b/tvision/examples/inplis/implis.mkf
new file mode 100644
index 0000000..e4feb7e
--- /dev/null
+++ b/tvision/examples/inplis/implis.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include implis$(ExIMK)
diff --git a/tvision/examples/inplis/implis.umk b/tvision/examples/inplis/implis.umk
new file mode 100644
index 0000000..8fb05d7
--- /dev/null
+++ b/tvision/examples/inplis/implis.umk
@@ -0,0 +1,22 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./inplist$(ExOBJ) \
+ ./test$(ExOBJ)
+
+LIBRARIES=
+
+inplis$(ExEXE):: \
+ ./inplist$(ExOBJ) \
+ ./test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./inplist$(ExOBJ):: inplist.cpp
+ $(RHIDE_COMPILE_CC)
+
+./test$(ExOBJ):: test.cpp
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/inplis/inplist.cpp b/tvision/examples/inplis/inplist.cpp
new file mode 100644
index 0000000..2ad5cd5
--- /dev/null
+++ b/tvision/examples/inplis/inplist.cpp
@@ -0,0 +1,167 @@
+/*
+
+ Created by L. Borobia 92-11-30
+
+ File: INPLIST.CPP
+
+ A little example, how to execute an inputline in a
+ focused item from a listbox.
+
+*/
+
+#include "stdio.h"
+#include "string.h"
+#include "inplist.h"
+
+TExecInputLine::TExecInputLine(const TRect& bounds, int aMaxLen)
+ :TInputLine(bounds, aMaxLen)
+ {
+ }
+
+void TExecInputLine::set(void *rec)
+ {
+ setData(rec);
+ }
+
+void TExecInputLine::get(void *rec)
+ {
+ getData(rec);
+ }
+
+ushort TExecInputLine::execute()
+ {
+ TEvent e;
+ Boolean leavemodal = False;
+ do
+ {
+ getEvent(e);
+ if (e.what == evKeyDown)
+ {
+ switch (e.keyDown.keyCode)
+ {
+ case kbDown:
+ case kbUp:
+ case kbEsc:
+ case kbEnter:
+ case kbPgDn:
+ case kbPgUp:
+ case kbCtrlPgDn:
+ case kbCtrlPgUp:
+ leavemodal = True;
+ break;
+ default:
+ leavemodal = False;
+ break;
+ }
+ }
+ if (e.what == evMouseDown && e.mouse.buttons == mbLeftButton)
+ {
+ TPoint p = makeLocal(e.mouse.where);
+ if (mouseInView(p) == False)
+ leavemodal = True;
+ }
+ handleEvent(e);
+ } while (leavemodal == False);
+ return e.keyDown.keyCode;
+}
+
+
+TInputBox::TInputBox(const TRect& bounds, ushort aNumCols, TScrollBar *aScrollBar)
+ :TListBox(bounds,aNumCols,aScrollBar)
+
+ {
+ }
+
+void TInputBox::getText(char *dest, int item, short maxLen)
+ {
+ ListBoxItem *v;
+ char s[MAXVALUELEN+MAXLABELLEN];
+ if (list() != 0 )
+ {
+ v = (ListBoxItem *)(list()->at(item));
+ sprintf(s, "%.*s = %.*s", MAXLABELLEN,v->label, MAXVALUELEN, v->value);
+ strncpy( dest, s, maxLen );
+ dest[maxLen] = '\0';
+ }
+ else
+ *dest = EOS;
+ }
+
+ushort TInputBox::inputData( )
+ {
+ ListBoxItem *v;
+ TExecInputLine *te;
+ TRect r = getExtent();
+ ushort control=0;
+ if (list() != 0 )
+ {
+ v = (ListBoxItem *)(list()->at(focused));
+ r = TRect(strlen(v->label)+5, focused-topItem+1,r.b.x-r.a.x,focused-topItem+2);
+ te = new TExecInputLine(r,MAXVALUELEN);
+ te->set(v->value);
+ control = owner->execView((TView *)te);
+ if (control != kbEsc)
+ te->get(v->value);
+ CLY_destroy((TView *)te);
+ }
+ return control;
+ }
+
+
+void TInputBox::handleEvent(TEvent& event)
+ {
+ TEvent e = event;
+ ushort item;
+ TListBox::handleEvent(event);
+ item = focused;
+ if ( event.what == evKeyDown )
+ {
+ if (event.keyDown.charScan.charCode >= 32)
+ {
+ putEvent(event);
+ if (inputData() == kbUp)
+ item--;
+ else
+ item++;
+ drawView();
+ focusItemNum(item);
+ }
+ else
+ if ( event.keyDown.keyCode == kbRight ||
+ event.keyDown.keyCode == kbLeft ||
+ event.keyDown.keyCode == kbEnter
+ )
+ {
+ if (inputData() == kbUp)
+ item--;
+ else
+ item++;
+ drawView();
+ focusItemNum(item);
+ }
+ }
+ else
+ if (e.what == evMouseDown &&
+ e.mouse.buttons == mbLeftButton)
+ {
+ inputData();
+ drawView();
+ }
+ }
+
+
+TInputDialog::TInputDialog(const TRect& r, const char *aTitle, TCollection *aList)
+ : TWindowInit( &TInputDialog::initFrame )
+ , TDialog(r, aTitle)
+
+ {
+ options |= ofCentered;
+ TRect r1 = getExtent();
+ r1.grow(-1,-1);
+ vScrollBar = new TScrollBar(TRect(r1.b.x-1,r1.a.y,r1.b.x,r1.b.y));
+ inputBox = new TInputBox(r1,1,vScrollBar);
+ inputBox->newList(aList);
+ insert(inputBox);
+ insert(vScrollBar);
+ }
+
diff --git a/tvision/examples/inplis/inplist.h b/tvision/examples/inplis/inplist.h
new file mode 100644
index 0000000..7af7336
--- /dev/null
+++ b/tvision/examples/inplis/inplist.h
@@ -0,0 +1,69 @@
+/*
+
+ Created by L. Borobia 92-11-30
+
+ File: INPLIST.H
+
+ A little example, how to execute an inputline in a
+ focused item from a listbox.
+
+*/
+
+#define Uses_TKeys
+#define Uses_TEvent
+#define Uses_TRect
+#define Uses_TDialog
+#define Uses_TInputLine
+#define Uses_TScrollBar
+#define Uses_TListBox
+#define Uses_TCollection
+#define Uses_TDialog
+
+#include <tv.h>
+
+#define MAXLABELLEN 40
+#define MAXVALUELEN 20
+
+typedef struct
+{
+ char label[MAXLABELLEN];
+ char value[MAXVALUELEN];
+} ListBoxItem;
+
+class TLineCollection : public TCollection
+{
+ public:
+ TLineCollection(short lim, short delta) : TCollection(lim, delta) {}
+ virtual void freeItem(void *p) { delete (ListBoxItem *)p; }
+ private:
+ virtual void *readItem( ipstream& ) { return 0; }
+ virtual void writeItem( void *, opstream& ) {}
+};
+
+class TExecInputLine : TInputLine
+{
+ public:
+ TExecInputLine(const TRect&, int);
+ virtual ushort execute();
+ virtual void set(void *rec);
+ virtual void get(void *rec);
+};
+
+class TInputBox : public TListBox
+{
+ public:
+ TInputBox( const TRect&, ushort, TScrollBar *);
+ virtual void getText( char *, int, short );
+ virtual void handleEvent(TEvent& );
+ virtual ushort inputData();
+};
+
+class TInputDialog : public TDialog
+{
+ public:
+ TInputDialog(const TRect&, const char *, TCollection *);
+ private:
+ TScrollBar *vScrollBar;
+ TInputBox *inputBox;
+};
+
diff --git a/tvision/examples/inplis/rhide.env b/tvision/examples/inplis/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/inplis/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/inplis/test.cpp b/tvision/examples/inplis/test.cpp
new file mode 100644
index 0000000..c92fc53
--- /dev/null
+++ b/tvision/examples/inplis/test.cpp
@@ -0,0 +1,116 @@
+/*
+
+ Created by L. Borobia 92-11-30
+
+ File: TEST.CPP
+
+ Testprogram to show how you can use the TInputBox.
+
+*/
+
+#include <stdio.h>
+
+#define Uses_string
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+
+#include "inplist.h"
+
+const int cmInputBox = 100;
+
+class TMyApp : public TApplication
+ {
+ public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void inputBox();
+ };
+
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+ {
+ }
+
+void TMyApp::handleEvent(TEvent& event)
+ {
+ TApplication::handleEvent(event);
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmInputBox:
+ inputBox();
+ break;
+
+ default:
+ return;
+ }
+ clearEvent( event );
+ }
+ }
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+ {
+ r.b.y = r.a.y + 1;
+ return new TMenuBar( r,
+ *new TSubMenu( "~D~emo", kbAltD ) +
+ *new TMenuItem( "~T~est", cmInputBox, kbNoKey, hcNoContext, "" )+
+ *new TMenuItem( "E~x~it", cmQuit, kbNoKey, hcNoContext, "Alt-X" )
+ );
+ }
+
+TStatusLine *TMyApp::initStatusLine( TRect r )
+ {
+ r.a.y = r.b.y - 1;
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit )
+ );
+ }
+
+void TMyApp::inputBox()
+ {
+ short i = 0;
+ const int MAXINPLN = 30;
+ ListBoxItem *v;
+ char label[MAXLABELLEN];
+ TLineCollection *list;
+ //TRect r = getExtent();
+ list = new TLineCollection(MAXINPLN,0);
+ for (i = 0; i < MAXINPLN; i++)
+ {
+ v = new ListBoxItem;
+ sprintf(label,"Label No. %d",i);
+ strcpy(v->label,label);
+ strcpy(v->value,"value");
+ list->insert(v);
+ }
+ TInputDialog *pd = new TInputDialog(TRect(0,0,50,19),"Input Box", list);
+ if (validView(pd))
+ {
+ deskTop->execView( pd );
+ CLY_destroy( pd );
+ }
+ }
+
+int main()
+ {
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+ }
diff --git a/tvision/examples/listvi/listbox2.cpp b/tvision/examples/listvi/listbox2.cpp
new file mode 100644
index 0000000..80fe691
--- /dev/null
+++ b/tvision/examples/listvi/listbox2.cpp
@@ -0,0 +1,163 @@
+// ***********************************************************************
+//
+// LISTBOX1.CPP Test Program
+// TListViewer Example - Scrolling Lists
+// revised November 27,1993
+// C.Porter 70262,1047
+// Fixed: Use of constant strings for edition by Salvador E. Tropea.
+// ***********************************************************************
+#include <stdlib.h>
+
+#define Uses_TApplication
+#define Uses_TBackground
+#define Uses_TButton
+#define Uses_TInputLine
+#define Uses_TKeys
+#define Uses_TDeskTop
+#define Uses_TDialog
+#define Uses_TListBox
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TMenuItem
+#define Uses_TRect
+#define Uses_TScrollBar
+#define Uses_TStaticText
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TStatusLine
+
+#include <tv.h>
+#include <string.h>
+#include "lst_view.h"
+
+const int wCity=18, cCities=13;
+
+char *aCityList[cCities]=
+{
+ "Boston MA. ",
+ "Washington DC ",
+ "Orlando FL. ",
+ "New York City N.Y",
+ "Chicago IL ",
+ "Dallas TX.",
+ "Birmingham AL.",
+ "Memphis TN ",
+ "Denver CO",
+ "San Francisco CA.",
+ "Los Angeles CA.",
+ "Fort Worth TX",
+ "Seattle WA"
+};
+char *aNumList[cCities]={"1","2","3","4","5","6","7","8","9","10","11","12","13"};
+char **cityList;
+char **numList;
+
+// global data
+const int cmAbout = 100; // User selected menu item 'About'
+const int cmList = 101; // User selected menu item 'List'
+
+//*******************************************************
+class TApp : public TApplication {
+ public:
+
+ TApp();
+
+ // virtual functions to be locally redefined
+ static TMenuBar *initMenuBar(TRect r);
+ void handleEvent(TEvent &event);
+ void idle();
+
+ // declare new functions
+ void AboutDialog();
+ void ListDialog();
+};
+//*******************************************************
+
+TApp::TApp() : TProgInit(TApplication::initStatusLine,
+ TApp::initMenuBar,
+ TApplication::initDeskTop) {
+
+ TRect r = getExtent();
+ r.a.x = r.b.x - 13;
+ r.a.y = r.b.y - 1;
+
+}
+//*******************************************************
+
+TMenuBar *TApp::initMenuBar(TRect r) {
+
+ r.b.y = r.a.y + 1;
+ return(new TMenuBar(r, new TMenu(
+ *new TMenuItem("~A~bout", cmAbout, kbAltA, hcNoContext, 0,
+ new TMenuItem("~L~ist", cmList, kbAltL, hcNoContext, 0)))));
+}
+//*******************************************************
+
+void TApp::handleEvent(TEvent &event) {
+
+ TApplication::handleEvent(event);
+ if (event.what == evCommand) {
+ switch(event.message.command) {
+ case cmAbout: // display the about box
+ AboutDialog();
+ clearEvent(event);
+ break;
+ case cmList: // display our list box
+ ListDialog();
+ clearEvent(event);
+ break;
+ }
+ }
+}
+//*******************************************************
+/* AboutDialog - create modal About dialog box */
+
+void TApp::AboutDialog() {
+
+ TDialog *pd = new TDialog(TRect(0, 0, 35, 10), "About");
+ if (pd) {
+ pd->options |= ofCentered;
+ pd->insert(new TStaticText(TRect(1, 2, 34, 6),
+ "\003TListViewBox Example 1\n"
+ "\003A Simple TListViewer\n"
+ "\003C.Porter CIS 70262,1047\n"));
+ pd->insert(new TButton(TRect(13, 7, 22,9), "~O~k", cmOK, bfDefault));
+ deskTop->execView(pd);
+ }
+ CLY_destroy(pd);
+}
+//*******************************************************
+
+void TApp::ListDialog() {
+
+ TDialog *pd = new TListViewDialog(TRect(0, 0, 40, 15), "Scroll List",
+ cityList,numList,cCities,wCity);
+
+ if(validView(pd)) deskTop->execView(pd);
+
+ CLY_destroy(pd);
+}
+//*******************************************************
+
+void TApp::idle() {
+
+ TProgram::idle();
+
+}
+
+//************************************************************************
+int main(void) {
+ int i;
+ cityList=new char*[cCities];
+ numList=new char*[cCities];
+ for (i=0; i<cCities; i++)
+ {
+ cityList[i]=new char[wCity];
+ strcpy(cityList[i],aCityList[i]);
+ numList[i]=new char[wCity];
+ strcpy(numList[i],aNumList[i]);
+ }
+ TApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/listvi/lst_view.bmk b/tvision/examples/listvi/lst_view.bmk
new file mode 100644
index 0000000..7c86b53
--- /dev/null
+++ b/tvision/examples/listvi/lst_view.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: listvi.exe
+!include ../../makes/common.bmk
+!include lst_view.umk
+
diff --git a/tvision/examples/listvi/lst_view.cpp b/tvision/examples/listvi/lst_view.cpp
new file mode 100644
index 0000000..6880c33
--- /dev/null
+++ b/tvision/examples/listvi/lst_view.cpp
@@ -0,0 +1,175 @@
+// ***********************************************************************
+//
+// LST_VIEW.CPP
+// List Viewer(s) that display String array(s)
+// revised November 27,1993
+// C.Porter
+// Fixed: widths and positions of elements by Salvador E. Tropea
+// ***********************************************************************
+#define Uses_stdlib
+#define Uses_stdio
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_TListViewer
+#define Uses_TListBox
+#define Uses_TEvent
+#define Uses_TDialog
+#define Uses_TInputLine
+#define Uses_TScrollBar
+#define Uses_TStaticText
+#define Uses_TKeys
+#define Uses_TWindow
+#define Uses_TView
+#define Uses_MsgBox
+#include <tv.h>
+#include "lst_view.h"
+
+const int cmListKeyEnter = 59;
+//************************************************************
+TListViewBox::TListViewBox( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *hScrollBar,
+ TScrollBar *vScrollBar,
+ char *aList[],
+ int aListSize):
+ TListViewer(bounds, aNumCols, hScrollBar, vScrollBar)
+{
+ strlist = aList; // strlist is a pointer to a pointer // to keep from overflowing the stack
+ setRange(aListSize);
+ vScrollBar->maxVal = aListSize-1;
+}
+//************************************************************
+TListViewBox::~TListViewBox()
+{ }
+//************************************************************
+void TListViewBox::getText( char *dest, ccIndex item, short maxLen )
+{
+ strncpy( dest,strlist[item],maxLen ); // strlist is a pointer to a pointer
+}
+//************************************************************
+// List View Box uses evBroadCast to send message back to dialog
+// 'this' pointer is used in evBroadcast to let dialog know who sent the
+// message. This pointer is used to get text for input line and later to
+// store input line data back into List View Box object.
+
+void TListViewBox::handleEvent(TEvent& event) {
+
+ if ((event.what == evMouseDown) && (event.mouse.doubleClick))
+ { message(owner, evBroadcast, cmListItemSelected, this);
+ clearEvent(event);}
+ if ((event.what == evKeyDown) && (event.keyDown.keyCode == kbEnter ))
+ { message(owner, evBroadcast, cmListKeyEnter, this);
+ clearEvent(event);}
+
+ TListViewer::handleEvent(event);
+} // end of TMyListBox::handleEvent()
+//************************************************************
+// writes data to list
+void TListViewBox::putData(void *rec)
+{
+ strcpy(strlist[focused],((char *)rec));
+ draw();
+}
+//************************************************************
+//************************************************************
+
+TListViewDialog::TListViewDialog(const TRect &trect, char *title,
+ char *aList[],char *aList2[],int aListSize,int wList)
+ : TWindowInit(TDialog::initFrame)
+ , TDialog(trect, title) {
+ options |= ofCentered;
+ int lbwidth=(trect.b.x-trect.a.x)-3-3;
+ int lbhite =(trect.b.y-trect.a.y)-2;
+ int x1=trect.a.x+3, w1=lbwidth/2;
+ int x2=x1+w1, w2=lbwidth-w1;
+ insert (new TStaticText(TRect(x1,1,x1+w1,2)," City "));
+ insert (new TStaticText(TRect(x2,1,x2+w2,2)," Zip Code"));
+ // create a scroll bar for the list box
+ listScroller = new TScrollBar(TRect(x1+lbwidth,trect.a.y+2,
+ x1+lbwidth+1,trect.a.y+lbhite));
+
+ listBox = new TListViewBox(TRect(x1, trect.a.y+2,
+ x1+w1, trect.a.y+lbhite),1,0,listScroller,
+ aList,aListSize);
+ listBox2 = new TListViewBox(TRect(x2, trect.a.y+2,
+ x2+w2, trect.a.y+lbhite),1,0,listScroller,
+ aList2,aListSize);
+ // insert the list box with its scroller into the dialog box
+ inputLine = new TInputLine(TRect(x1,3,x1+w1,4),wList);
+ inputLineLen = wList;
+ inputLine->hide(); //hide input line
+ itemNumber = new TInputLine(TRect(x1,lbhite,x1+w1,lbhite+1),wList);
+ itemNumber->options &= (!ofSelectable); // used to hold current line number
+ insert(listBox);
+ insert(listBox2);
+ insert(listScroller);
+ insert(inputLine);
+ insert(itemNumber);
+} // end of MyDialogBox::MyDialogBox()
+//*****************************************************************
+// a single mouse click is not cleared by List View Box, Dialog uses it
+// to erase inputline if user clicks off of it .
+void TListViewDialog::handleEvent(TEvent &event) {
+ AllocLocalStr(b,inputLineLen);
+
+ switch(event.what)
+ {
+ case evMouseDown: // clears input line
+ if (inputLine->state&sfSelected) {
+ inputLine->hide();
+ }
+ break;
+ case evKeyDown:
+ switch(event.keyDown.keyCode)
+ {
+ case kbEsc: // clears input line
+ if (inputLine->state&sfSelected) {
+ inputLine->hide();
+ clearEvent(event);
+ }
+ break;
+ case kbEnter: // saves input line to list box using listBoxPtr
+ if (inputLine->state&sfSelected) {
+ listBoxPtr->putData( (void *)inputLine->getData() );
+ inputLine->hide();
+ clearEvent(event);
+ }
+ break;
+ }
+ case evBroadcast: // from List Boxes, infoPtr points to orginator
+ switch (event.message.command)
+ {
+ case cmListItemSelected: // if input line is already showing, hide it
+ if (inputLine->state&sfSelected) {
+ inputLine->hide();
+ clearEvent(event);
+ }
+ else { // show empty input line
+ int mouseLocY =((TListViewBox *)event.message.infoPtr)->cursor.y ;
+ int mouseLocX =((TListViewBox *)event.message.infoPtr)->origin.x ;
+ listBoxPtr =(TListViewBox *)event.message.infoPtr;
+ inputLine->moveTo(mouseLocX, mouseLocY+2);
+ inputLine->setDataFromStr( (void *)" " );
+ inputLine->show();
+ clearEvent(event);
+ }
+ break;
+ case cmListKeyEnter: // enter key pressed in list box, copy data to inputline
+ int mouseLocY =((TListViewBox *)event.message.infoPtr)->cursor.y ;
+ int mouseLocX =((TListViewBox *)event.message.infoPtr)->origin.x ;
+ listBoxPtr =(TListViewBox *)event.message.infoPtr;
+ inputLine->moveTo(mouseLocX, mouseLocY+2);
+ listBoxPtr->getText( b,listBoxPtr->focused,inputLineLen );
+ inputLine->setDataFromStr( b );
+ inputLine->show();
+ clearEvent(event);
+ break;
+ }
+ }
+ // Let TDialog handler do it's thing with any remaining events.
+ TDialog::handleEvent(event);
+ sprintf(b,"%d",listBox->focused);
+ itemNumber->setDataFromStr( b );
+ itemNumber->draw();
+} // end of MyDialogBox::eventHandler()
+
diff --git a/tvision/examples/listvi/lst_view.gpr b/tvision/examples/listvi/lst_view.gpr
new file mode 100644
index 0000000..17d9bec
--- /dev/null
+++ b/tvision/examples/listvi/lst_view.gpr
Binary files differ
diff --git a/tvision/examples/listvi/lst_view.h b/tvision/examples/listvi/lst_view.h
new file mode 100644
index 0000000..8bd1468
--- /dev/null
+++ b/tvision/examples/listvi/lst_view.h
@@ -0,0 +1,46 @@
+// ***********************************************************************
+//
+// LST_VIEW.H
+// used with LST_VIEW.CPP
+// List Viewer(s) that display String array(s)
+// revised November 27,1993
+// C.Porter
+// ***********************************************************************
+
+
+class TListViewBox : public TListViewer
+{
+public:
+ TListViewBox( const TRect& bounds, ushort aNumCols,
+ TScrollBar *hScrollBar,
+ TScrollBar *vScrollBar,
+ char *aList[],
+ int aListSize);
+ ~TListViewBox();
+ virtual void getText( char *dest, ccIndex item, short maxLen );
+ void handleEvent (TEvent& event);
+ virtual void putData(void *rec); //writes to focused line of list view
+ char **strlist;
+};
+
+//*********************
+// Dialog that creates 2 List Views and attaches them to scroll bar
+// this example is set up for 2 ,easily modified for more
+//
+class TListViewDialog : public TDialog {
+ public:
+ TListViewDialog(const TRect &trect, char *title,char *aList[],char *aList2[],
+ int aListSize, int wList);
+ ~TListViewDialog() { };
+ void handleEvent(TEvent &);
+
+ private:
+ TScrollBar *listScroller; // scroll bar is used by both list views
+ TListViewBox *listBox;
+ TListViewBox *listBox2;
+ TListViewBox *listBoxPtr; // temp holds active listview ptr during modifications
+ TInputLine *inputLine;
+ int inputLineLen;
+ TInputLine *itemNumber; // displays currently active line, not selectable
+};
+
diff --git a/tvision/examples/listvi/lst_view.mkf b/tvision/examples/listvi/lst_view.mkf
new file mode 100644
index 0000000..d62d570
--- /dev/null
+++ b/tvision/examples/listvi/lst_view.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include lst_view$(ExIMK)
diff --git a/tvision/examples/listvi/lst_view.umk b/tvision/examples/listvi/lst_view.umk
new file mode 100644
index 0000000..5973a3e
--- /dev/null
+++ b/tvision/examples/listvi/lst_view.umk
@@ -0,0 +1,22 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./listbox2$(ExOBJ) \
+ ./lst_view$(ExOBJ)
+
+LIBRARIES=
+
+listvi$(ExEXE):: \
+ ./listbox2$(ExOBJ) \
+ ./lst_view$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./listbox2$(ExOBJ):: listbox2.cpp
+ $(RHIDE_COMPILE_CC)
+
+./lst_view$(ExOBJ):: lst_view.cpp
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/listvi/readme.txt b/tvision/examples/listvi/readme.txt
new file mode 100644
index 0000000..e0537f5
--- /dev/null
+++ b/tvision/examples/listvi/readme.txt
@@ -0,0 +1,18 @@
+// NOVEMBER 27,1993 LIST VIEW BOX AND LIST VIEW DIALOG
+//
+// The reason for these classes was that I needed the functionaltity of ListBox
+// but, I did not want to use a collection. I also wanted a 'cleaner' user interface.
+//
+// FEATURES OF ListViewBox Class
+// 1-Muliple lists
+// 2- Can use simple character list
+// 3- Simple user interface, double click for empty line,hit return to
+// edit existing data.
+// 4- Easily modified for other types of data
+//
+// I hope this is of some small value and would appreciate suggestions or
+// examples of what other users have done with it. I offer it freely
+// as a small payment for the help and code others have provided to me .
+//
+// CRAIG PORTER CIS- 70262,1047
+//
diff --git a/tvision/examples/listvi/rhide.env b/tvision/examples/listvi/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/listvi/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/msgcls/msgcls.bmk b/tvision/examples/msgcls/msgcls.bmk
new file mode 100644
index 0000000..4e4db53
--- /dev/null
+++ b/tvision/examples/msgcls/msgcls.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: msgcls.exe
+!include ../../makes/common.bmk
+!include msgcls.umk
+
diff --git a/tvision/examples/msgcls/msgcls.gpr b/tvision/examples/msgcls/msgcls.gpr
new file mode 100644
index 0000000..d478173
--- /dev/null
+++ b/tvision/examples/msgcls/msgcls.gpr
Binary files differ
diff --git a/tvision/examples/msgcls/msgcls.mkf b/tvision/examples/msgcls/msgcls.mkf
new file mode 100644
index 0000000..b13ee06
--- /dev/null
+++ b/tvision/examples/msgcls/msgcls.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include msgcls$(ExIMK)
diff --git a/tvision/examples/msgcls/msgcls.umk b/tvision/examples/msgcls/msgcls.umk
new file mode 100644
index 0000000..df06be6
--- /dev/null
+++ b/tvision/examples/msgcls/msgcls.umk
@@ -0,0 +1,22 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./testdyn$(ExOBJ) \
+ ./tlnmsg$(ExOBJ)
+
+LIBRARIES=
+
+msgcls$(ExEXE):: \
+ ./testdyn$(ExOBJ) \
+ ./tlnmsg$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./testdyn$(ExOBJ):: testdyn.cpp
+ $(RHIDE_COMPILE_CC)
+
+./tlnmsg$(ExOBJ):: tlnmsg.cpp
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/msgcls/readme.txt b/tvision/examples/msgcls/readme.txt
new file mode 100644
index 0000000..e4797ff
--- /dev/null
+++ b/tvision/examples/msgcls/readme.txt
@@ -0,0 +1,72 @@
+
+TLNMSG.H has the prototype for the postMsg(const char *) and
+postInfo(int, const char *) functions. You don't have to use these
+functions if you don't want to, but they simplify the calling parameters
+and are easy to call from within "straight C" functions. Actually,
+we are compiling standalone versions of our software and an integrated
+version. One function call to postInfo or postMsg works in both cases
+using conditional compilation. For example:
+
+#if defined(APPLICATION)
+#include "tlnmsg.h"
+#else
+#include <stdio.h>
+void postMsg(const char * msg)
+{
+ printf("%s\n", msg);
+}
+void postInfo(int line, const char * msg)
+{
+ printf("%s\n", msg);
+}
+#endif
+
+This is an example of how to use the two classes defined in TLNMSG.CPP.
+Note that you have to explicitly call getEvent(TEvent&) to find out
+if the user pressed escape. Another method would be to make kbEsc a
+case in your main handleEvent loop. For us, that was impractical
+considering there is no handleEvent loop in our stand alone code.
+
+void handleEvent(event)
+{
+ switch( event.message.command )
+ {
+ ...
+
+ case cmTestCase:
+ TEvent anEvent;
+ Boolean userBreak = False;
+
+ postInfo(1, " Line 1");
+ postInfo(2, " Line 2");
+
+ // This should be highlighted in blue as
+ // it is the last line in the box.
+
+ postInfo(10, "\003Press escape to continue");
+
+ for (i = 0; i < 1000 && !userBreak; ++i) {
+ sprintf(msg, "\003Compiling Line: %2d", i);
+ postInfo(4, msg);
+
+ // break if the user presses escape
+
+ getEvent(anEvent);
+ userBreak = (Boolean)
+ ((anEvent.what == evKeyboard) &&
+ (anEvent.keyDown.keyCode == kbEsc));
+
+ } // endfor
+
+ postInfo(-1, "");
+ if (userBreak) postMsg("Exited on user break");
+
+ break;
+ ...
+ } // endswitch
+
+} // end handleEvent()
+
+Comments and criticisms are welcome, but questions may or may not
+be answered (call Borland, they get paid for it!) Send all
+correspondance to Rick Hagerbaumer c/o 72700,351
diff --git a/tvision/examples/msgcls/rhide.env b/tvision/examples/msgcls/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/msgcls/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/msgcls/testdyn.cpp b/tvision/examples/msgcls/testdyn.cpp
new file mode 100644
index 0000000..772a653
--- /dev/null
+++ b/tvision/examples/msgcls/testdyn.cpp
@@ -0,0 +1,148 @@
+// Copyright (C) 1992 James H. Price, All rights reserved
+//
+// TESTDYN.CPP
+//
+// Test program for dynamic text
+//
+
+#define Uses_unistd
+#define Uses_MsgBox
+#define Uses_TEvent
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TDialog
+#define Uses_TInputLine
+#define Uses_TButton
+#include <tv.h>
+#ifdef TVCompf_djgpp
+#include <dos.h>
+#endif
+const int cmAbout = 100;
+const int cmTest = 101;
+
+
+////////////////////////////////////////////////////////////////////////
+//////////////////////// Usual TurboVision Stuff ///////////////////////
+
+class Shell : public TApplication {
+
+public:
+
+ Shell();
+ static TMenuBar *initMenuBar( TRect r );
+ static TStatusLine *initStatusLine( TRect r );
+ void handleEvent( TEvent& event );
+ void idle();
+
+private:
+
+ void About();
+ void Test();
+};
+
+Shell::Shell() : TProgInit (
+ &Shell::initStatusLine,
+ &Shell::initMenuBar,
+ &Shell::initDeskTop
+ )
+{
+}
+
+TMenuBar *Shell::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1;
+
+ TMenuItem& mI =
+ *new TMenuItem( "~T~est", cmTest, kbNoKey, hcNoContext );
+
+ return new TMenuBar( r, new TMenu( mI ) );
+}
+
+TStatusLine *Shell::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1;
+
+ TStatusLine *sL = new TStatusLine( r,
+ *new TStatusDef(0, 0xFFFF) +
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ *new TStatusItem( "~Alt-X~ Quit", kbAltX, cmQuit ) );
+
+ return sL;
+}
+
+void Shell::handleEvent( TEvent &event )
+{
+ TApplication::handleEvent(event);
+
+ if (event.what == evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmAbout:
+ About();
+ break;
+ case cmTest:
+ Test();
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void Shell::About()
+{
+ messageBox( "\003Dynamic Text Demo",
+ mfInformation | mfOKButton );
+}
+
+void Shell::idle()
+{
+ TProgram::idle();
+
+ // select menu bar if deskTop empty
+
+ if( deskTop->current == 0
+ && !menuBar->getState( sfSelected ) )
+ {
+ TEvent event;
+ event.what = evCommand;
+ event.message.command = cmMenu; // put a cmMenu event in queue
+ putEvent( event );
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+///////////////////////// Test routine ////////////////////////////////////
+
+extern void postMsg(const char *);
+extern void postInfo(int, const char *);
+
+void Shell::Test()
+{
+ //postMsg("Hola");
+ postInfo(1," Chau");
+ CLY_YieldProcessor(1000000);
+ postInfo(2," Pepe");
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+////////////////////////////// main() function ////////////////////////////
+
+int main()
+{
+ Shell shell;
+ shell.run(); // About box when program starts
+ return 0;
+}
+
diff --git a/tvision/examples/msgcls/tlnmsg.cpp b/tvision/examples/msgcls/tlnmsg.cpp
new file mode 100644
index 0000000..3185d43
--- /dev/null
+++ b/tvision/examples/msgcls/tlnmsg.cpp
@@ -0,0 +1,291 @@
+/**********************************************************************
+ * File Name: TLNMSG.CPP *
+ * Date: 01/29/92 *
+ * *
+ * Description: Implements a scrollable message box to post messages *
+ * to the user. Call "postMsg(const char *)" with the text you want *
+ * inserted into the message window. If the message window doesn't *
+ * exist, it is created. The message is then posted to the end *
+ * of the list. *
+ * Implements an information box to give the user current status *
+ * (similar to Borlands "Compiling" and "Linking" information boxes. *
+ * Call "postInfo(int, const char *)" with the line number and the *
+ * information string. If the information box doesn't exist, it is *
+ * created. Pass a negative line number to close the box. The last *
+ * line is reserved for a user prompt, eg, "Press Escape to Continue" *
+ * and is displayed as Cyan on a Blue background. NOTE: This view *
+ * is NOT MODAL therefore it doesn't call getEvent! The code that is *
+ * posting messages needs to handle events such as Ctrl-Break or the *
+ * user pressing escape. *
+ * *
+ * Revisions: *
+ * *
+ **********************************************************************/
+
+#define Uses_string
+
+#include "tlnmsg.h"
+//#include "const.h" // for command constants
+
+// ********************************************************************
+
+TMsgListViewer::TMsgListViewer( const TRect& bounds, ushort aNumCols,
+ TScrollBar * aHScrollBar, TScrollBar * aVScrollBar ) :
+ TListViewer ( bounds, aNumCols, aHScrollBar, aVScrollBar )
+{
+ // expand and shrink to the right and bottom
+
+ dragMode = dmDragGrow;
+ growMode = gfGrowHiY | gfGrowHiX;
+
+ items = new TNSCollection(6, 1);
+ setRange(0);
+}
+
+void TMsgListViewer::getText( char * dest, ccIndex item, short maxLen )
+{
+ * dest = EOS;
+
+ if (items != 0) {
+ strncpy(dest, (const char *) (items -> at(item)), maxLen);
+ dest[maxLen] = 0;
+ }
+}
+
+void TMsgListViewer:: insert(const char * msg)
+{
+ items -> insert( newStr( (const char *) msg) );
+ setRange(items -> getCount());
+ drawView();
+}
+
+// map into the 1 - 5 into 9 - 13 of the owner (TMsgWindow)
+
+#define cpMsgList "\x09\x0A\x0B\x0C\x0D"
+
+TPalette& TMsgListViewer::getPalette() const
+{
+ static TPalette palette( cpMsgList, sizeof(cpMsgList) - 1);
+ return palette;
+}
+
+// ********************************************************************
+
+TlnMsgWindow::TlnMsgWindow(const TRect& bounds) :
+ TWindowInit( &TlnMsgWindow::initFrame),
+ TWindow(bounds, "Message", wnNoNumber)
+{
+ TScrollBar * vBar;
+ TScrollBar * hBar;
+
+ // Initialize the window
+ dragMode = dmLimitAll;
+
+ palette = wpCyanWindow;
+
+
+ vBar = standardScrollBar( sbVertical | sbHandleKeyboard );
+ hBar = standardScrollBar( sbHorizontal | sbHandleKeyboard );
+
+ TRect r = getExtent();
+ r.a.x = 1; r.a.y = 1; r.b.x -= 1; r.b.y -= 1;
+ msgViewer = new TMsgListViewer(r, 1, hBar, vBar);
+ insert(msgViewer);
+}
+
+TlnMsgWindow::~TlnMsgWindow()
+{
+}
+
+void TlnMsgWindow::handleEvent(TEvent& event)
+{
+ TWindow::handleEvent(event);
+
+ if (event.what == evBroadcast)
+ switch(event.message.command) {
+ case cmFindMsgBox : // return a pointer to self
+ clearEvent(event);
+ break;
+ case cmInsMsgBox : // insert a message into box
+ msgViewer -> insert((const char *) event.message.infoPtr);
+ clearEvent(event);
+ drawView();
+ break;
+ }
+}
+
+// This will map colors 9 - 13 into the ListViewer Palette
+
+#define cpMsgWindow "\x10\x11\x12\x13\x14\x15\x16\x17\x39\x3A\x3B\x3C\x3D"
+
+TPalette& TlnMsgWindow::getPalette() const
+{
+ static TPalette palette( cpMsgWindow, sizeof(cpMsgWindow) - 1);
+ return palette;
+}
+
+// ********************************************************************
+
+void postMsg(const char * msg)
+{
+ TlnMsgWindow * wPtr;
+ TRect r;
+
+ wPtr = (TlnMsgWindow *)
+ message(TProgram::deskTop, evBroadcast, cmFindMsgBox, 0);
+
+ if (wPtr == 0) {
+ // Create the message window
+ r = TProgram::deskTop -> getExtent();
+ r.a.y = r.b.y - 6;
+ TProgram::deskTop -> insert(wPtr = new TlnMsgWindow(r));
+ }
+
+ message(wPtr, evBroadcast, cmInsMsgBox, (void *) msg);
+}
+
+// ********************************************************************
+
+TStaticPrompt::TStaticPrompt(TRect& bounds, const char * text) :
+ TStaticText(bounds, text)
+{
+}
+
+// map the palette into the 9th entry of TlnInfoWindow
+#define cpStaticPrompt "\x09"
+
+TPalette& TStaticPrompt::getPalette() const
+{
+ static TPalette palette( cpStaticPrompt, sizeof(cpStaticPrompt) - 1);
+ return palette;
+}
+
+
+// ********************************************************************
+
+TlnInfoWindow::TlnInfoWindow( const TRect& bounds,
+ const char * aTitle,
+ short aNumber) :
+ TWindowInit(&TlnInfoWindow::initFrame),
+ TWindow (bounds, aTitle, aNumber)
+{
+ unsigned i;
+
+ // don't allow move, grow, close or zoom
+ flags = 0;
+
+ // center it in the group
+ options |= ofCentered;
+
+ // Buffer the screen writes to prevent flicker
+ // Buffer will be automatically deleted if low on memory
+ options |= ofBuffered;
+
+ count = 0;
+ for (i = 0; i < sizeof(items) / sizeof(TStaticText *); ++i)
+ items[i] = NULL;
+
+ // turn off the mouse event queue
+ TEventQueue::suspend();
+
+}
+
+TlnInfoWindow::~TlnInfoWindow()
+{
+ // Turn the mouse event queue back on
+ TEventQueue::resume();
+}
+
+void TlnInfoWindow::handleEvent(TEvent& event)
+{
+ // all events get cleared by this function to allow
+ // "modal" operation without stealing the processor.
+
+ int i, lastLine;
+
+ if (event.what == evBroadcast)
+
+ switch (event.message.command) {
+
+ case cmFindInfoBox :
+ clearEvent(event);
+ break;
+
+ case cmInsInfoBox :
+ InfoData * p = (InfoData *) event.message.infoPtr;
+ TRect r = getExtent();
+ lastLine = r.b.y - 2;
+ i = p -> line;
+ if (i > r.b.y - r.a.y - 1)
+ break;
+
+ // lock all screen writes till buffer updated
+
+ lock();
+ if (items[i] != NULL) {
+ remove(items[i]);
+ CLY_destroy(items[i]);
+ }
+
+
+ r.a.y = i; r.b.y = i+1;
+
+ if (i == lastLine) {
+ r.a.x += 1; r.b.x -= 1;
+ items[i] = new TStaticPrompt( r, p -> text );
+ } else {
+ r.a.x += 2; r.b.x -= 1;
+ items[i] = new TStaticText ( r, p -> text);
+ }
+
+ insert(items[i]);
+
+ // unlock screen writes and redraw the buffer
+ unlock();
+
+ clearEvent(event);
+ break;
+ } // endswitch
+
+}
+
+// add 0x14 to the end of the normal gray window palette. This
+// maps into "Scrollbar Reserved", Background = 1 (Blue), Foreground
+// = 3 (Cyan)
+// 1 2 3 4 5 6 7 8 9
+#define cpInfoWindow "\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x14"
+
+TPalette& TlnInfoWindow::getPalette() const
+{
+ static TPalette palette( cpInfoWindow, sizeof(cpInfoWindow) - 1);
+ return palette;
+}
+
+
+// ********************************************************************
+
+void postInfo(int line, const char * text)
+{
+ TlnInfoWindow * wPtr;
+ InfoData data;
+
+ wPtr = (TlnInfoWindow *)
+ message(TProgram::deskTop, evBroadcast, cmFindInfoBox, 0);
+
+ if ((line < 0) && (wPtr != 0)){
+ TProgram::deskTop -> CLY_destroy(wPtr);
+ return;
+ }
+
+ if (wPtr == 0) {
+ // Create the information window
+ TProgram::deskTop ->
+ insert(wPtr = new TlnInfoWindow( TRect(0, 0, 40, 12),
+ "Information", wnNoNumber));
+ }
+
+ data.line = line;
+ data.text = text;
+ message(wPtr, evBroadcast, cmInsInfoBox, (void *) &data);
+}
+
diff --git a/tvision/examples/msgcls/tlnmsg.h b/tvision/examples/msgcls/tlnmsg.h
new file mode 100644
index 0000000..a09a87d
--- /dev/null
+++ b/tvision/examples/msgcls/tlnmsg.h
@@ -0,0 +1,113 @@
+#if !defined __TLNMSG_H__
+#define __TLNMSG_H__
+
+#define Uses_TWindow
+#define Uses_TNSCollection
+#define Uses_TScrollBar
+#define Uses_TListViewer
+#define Uses_TPalette
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TEventQueue
+#define Uses_TStaticText
+
+#include <tv.h>
+
+//#include "const.h"
+const int cmFindMsgBox =0x1000;
+const int cmInsMsgBox =0x1001;
+const int cmFindInfoBox=0x1002;
+const int cmInsInfoBox =0x1003;
+
+
+extern void postMsg(const char *);
+extern void postInfo(int, const char *);
+
+//
+// TMsgListViewer: Very similar to listbox, except it has a TNSCollection
+// (nonstreamable) and works with two scroll bars which are attached
+// to the frame of it's owner window.
+//
+
+class TMsgListViewer : public TListViewer {
+
+ private:
+ // list of items to display
+ TNSCollection * items;
+
+ public:
+ TMsgListViewer( const TRect& bounds, ushort aNumCols,
+ TScrollBar * aHScrollBar, TScrollBar * aVScrollBar);
+
+ void getText( char * dest, ccIndex item, short maxLen );
+
+ virtual TPalette& getPalette() const;
+
+ void insert( const char * msg) ;
+
+ TNSCollection * list() { return items; } ;
+
+} ;
+
+//
+// TlnMsgWindow: Cyan window to hold the TMsgListViewer.
+//
+
+class TlnMsgWindow : public TWindow
+{
+ // private members
+ TMsgListViewer * msgViewer;
+
+ public :
+ TlnMsgWindow(const TRect& bounds);
+ ~TlnMsgWindow();
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+} ;
+
+//
+// TlnInfoWindow: displays information in a gray window like a dialog
+// box with the exception that it isn't modal. The application posts
+// information to the window and is responsible for closing the window
+// when done.
+//
+
+class TStaticPrompt : public TStaticText
+{
+ public:
+ TStaticPrompt(TRect&, const char *); // constructor
+ virtual TPalette& getPalette() const; // Text blue on cyan
+} ;
+
+class TlnInfoWindow : public TWindow
+{
+
+ //
+ // Create an array of pointers to static text items.. make
+ // this larger or smaller as required. Current setting assumes
+ // maximum box length of 25 lines. The last line is reserved for
+ // special prompts to the user, e.g. "Press Escape to Continue" or
+ // "Ctrl-Break to Quit". A control break handler is not supplied.
+ //
+
+ private:
+ int count;
+ TStaticText * items[25];
+
+ public:
+ TlnInfoWindow(const TRect&, const char*, short);
+ ~TlnInfoWindow();
+
+ // Once virtual, always virtual!!
+ virtual void handleEvent(TEvent&);
+ virtual TPalette& getPalette() const;
+};
+
+typedef struct {
+ int line;
+ const char * text;
+} InfoData;
+
+
+#endif
diff --git a/tvision/examples/patchenv.pl b/tvision/examples/patchenv.pl
new file mode 100644
index 0000000..7be46bf
--- /dev/null
+++ b/tvision/examples/patchenv.pl
@@ -0,0 +1,123 @@
+#!/usr/bin/perl
+# Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This perl script reads the rhide.env file and replaces all the
+# definitions of this file in the known .mak files. Only the needed
+# definitions are patched, it means I don't replace a definition that is 100%
+# equal to the new one. Additionally the .mak file is stored in disk only if
+# it was changed.
+# The script prints a . for each search, a + for a one line replace and a
+# * for a multiline replace.
+#
+@files=glob('*/*.gpr');
+
+# Get the current rhide.env
+open(FIL,'rhide.env') || die 'Hey! where is rhide.env?';
+@vars=<FIL>;
+close(FIL);
+
+PatchFile(1,0);
+
+sub PatchFile
+{
+ my $TVsp=$_[0],$NoWall=$_[1];
+
+ # Patch the environment variables
+ foreach $i (@files)
+ {
+ $i=~s/\.gpr/\.mak/;
+ print 'Processing '."$i: ";
+ $r=&cat($i);
+ $changes=0;
+ foreach $search (@vars)
+ {
+ if ($NoWall)
+ {
+ $search=~s/-Wall//g;
+ $search=~s/-Werror//g;
+ }
+ # Skip comments
+ next if (substr($search,0,1) eq '#');
+ # Get the name of the variable
+ if ($search =~ /([\w_]*)(\s*)=(\s*)(.*)/)
+ {
+ $name=$1;
+ $value=$4;
+ #print "$name\n$value\n";
+ print '.';
+ }
+ else
+ {
+ next; #?
+ }
+
+ if ($name eq "TVISION_INC" && $TVsp)
+ { # That's very special because affects the dependencies
+ # Search the original definition
+ $repl="^$name"."=(.+)";
+ die "Can't find original TVISION_INC!" if (!($r =~ /$repl/m));
+ if ($1 ne $value)
+ {
+ # Ok, now replace any dependency
+ $dep=$1;
+ $r =~ s/$dep\/([\w\.\/]+)/$value\/$1/mg;
+ # And the value
+ $r =~ s/$repl/$name=$value/mg;
+ print 'd';
+ }
+ }
+ else
+ {
+ $repl="^$name"."=((.+\\\\\\n)+(.+))";
+ if (($r =~ /$repl/m) && ($1 ne $value))
+ { # Ok multiline
+ #print "\nReplacing:\n>$repl<\n>$1<\n>$name=$value<\n";
+ $r =~ s/$repl/$name=$value/mg;
+ print '*';
+ $changes++;
+ }
+ else
+ { # Single line
+ $repl="^$name"."=(.*)";
+ if (($r =~ /$repl/m) && ($1 ne $value))
+ {
+ $r =~ s/$repl/$name=$value/mg;
+ print '+';
+ $changes++;
+ }
+ #print "\$1=$1\n";
+ }
+ }
+ }
+ if ($changes)
+ {
+ replace($i,$r);
+ print ' updated ';
+ }
+ print "\n";
+ }
+}
+
+sub cat
+{
+ local $/;
+ my $b;
+
+ open(FIL,$_[0]) || return 0;
+ $b=<FIL>;
+ close(FIL);
+
+ $b;
+}
+
+sub replace
+{
+ my $b=\$_[1];
+
+ open(FIL,">$_[0]") || return 0;
+ print FIL ($$b);
+ close(FIL);
+}
+
+
diff --git a/tvision/examples/porting.txt b/tvision/examples/porting.txt
new file mode 100644
index 0000000..2ee66fd
--- /dev/null
+++ b/tvision/examples/porting.txt
@@ -0,0 +1,46 @@
+Hints to port TVision programs to the RH port:
+
+1) ushort dataSize()
+This is unsigned dataSize().
+* Reported by the compiler as wrong return value (gcc 2.8.0)
+
+2) TListBox::getText(...
+The second parameter was short now is ccIndex.
+* The text doesn't show in the object because the code uses the not-overrided
+ version.
+
+3) TPalette isn't defined by default.
+So you must add a #define Uses_TPalette.
+* The compiler informs TPalette is incomplete.
+
+4) const TRect& r
+Most of the Borland code doesn't declare the TRect references as constants.
+* The compiler barfs about a non-const reference.
+
+5) event.mouse.eventFlags & meDoubleClick
+This doesn't exist, use event.mouse.doubleClick instead
+* Compiler says that eventFlags isn't a member of the structure.
+
+6) #include <tvision/tv.h>
+The files in this port are just included with #include <tv.h>
+* The compiler says the header can't be located.
+
+7) Standard headers and DJGPP v2.01
+Put all the standard (stdio, stdlib, string, unistd, time, mem, etc.) headers
+before the #include <tv.h>. Isn't supposed to be needed with djgpp v2.02.
+* Compiler complains about redefinitions of NULL.
+
+8) kbXXXX constants
+The keyboard constants are different in this port. You should ever use the
+constants and never suppose the value they contain is fixed. So if your code
+assumes a fixed value you'll need to fix it. Some code in the original TV had
+this error.
+* The program doesn't respond to some key.
+
+9) Direct manipulation of TInputLine::data member
+This is no longer valid, use getData and setDataFromStr members. This is
+because now the class keeps the length of the data member and doesn't compute
+it all the time. It also helps to the Unicode experimental code.
+* The compiler informs the data member is protected.
+
+Salvador Eduardo Tropea (salvador@inti.gov.ar)
diff --git a/tvision/examples/progba/example.cpp b/tvision/examples/progba/example.cpp
new file mode 100644
index 0000000..5e36802
--- /dev/null
+++ b/tvision/examples/progba/example.cpp
@@ -0,0 +1,260 @@
+// This is an example of a progress bar.
+//
+// Modified THERMO.ZIP in the C++ lib to work with TURBO VISION
+// and fixed a small bug.
+//
+// Author: Jay Perez. Modified by Barnaby Falls
+//
+// Added: Code page remap, busy state feedback and window title.
+// By Salvador E. Tropea (SET)
+//
+#define Uses_stdio
+#define Uses_string
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_unistd
+
+#define Uses_TBackground
+#define Uses_TListBox
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TMenuItem
+#define Uses_TScrollBar
+#define Uses_TStaticText
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TStatusLine
+#define Uses_TStringCollection
+#define Uses_MsgBox
+#define Uses_TEventQueue
+#define Uses_TApplication
+#define Uses_TRect
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TDialog
+#define Uses_TButton
+#define Uses_StaticText
+#define Uses_TSItem
+#define Uses_TLabel
+#define Uses_TInputLine
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_TScreen
+#define Uses_TVCodePage
+
+#include <tv.h>
+__link( RView )
+__link( RDialog )
+__link( RButton )
+
+#include "tprogbar.h"
+
+const int cmAboutCmd = 100; // User selected menu item 'About'
+const int cmStatusCmd = 101; // User selected menu item 'Progress Bar'
+
+static char cBackChar='²';
+static char oBackChar='²';
+
+//========================================================================
+
+class TMyApplication : public TApplication
+{
+public:
+ TMyApplication();
+ static TMenuBar *initMenuBar(TRect);
+ void handleEvent(TEvent &);
+
+ static void cpCallBack(ushort *map);
+
+private:
+ void aboutDlg();
+ void statusDlg();
+ Boolean isCancel(TDialog *pd);
+};
+
+//========================================================================
+
+TMyApplication::TMyApplication() :
+TProgInit(&TApplication::initStatusLine,&TMyApplication::initMenuBar,
+ &TApplication::initDeskTop)
+{
+}
+
+//========================================================================
+
+TMenuBar *TMyApplication::initMenuBar(TRect bounds)
+{
+ bounds.b.y = bounds.a.y + 1;
+ return(new TMenuBar(bounds,
+ new TMenu(
+ *new TMenuItem("~A~bout",cmAboutCmd,kbAltA,hcNoContext,0,
+ new TMenuItem("~P~rogress Bar",cmStatusCmd,kbAltL,hcNoContext,0)))));
+}
+
+//========================================================================
+
+void TMyApplication::handleEvent(TEvent &event)
+{
+ TApplication::handleEvent(event);
+
+ if (event.what == evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmAboutCmd:
+ {
+ aboutDlg();
+ clearEvent(event);
+ break;
+ }
+ case cmStatusCmd:
+ {
+ statusDlg();
+ clearEvent(event);
+ break;
+ }
+ }
+ }
+}
+
+//========================================================================
+
+void TMyApplication::aboutDlg()
+{
+ TDialog *pd = new TDialog(TRect(0,0,35,12),"About");
+ if (pd)
+ {
+ pd->options |= ofCentered;
+ pd->insert(new TStaticText(TRect(1,2,34,7),
+ "\003Turbo Vision Example\n\003\n"
+ "\003Using a Progress Bar\n\003\n"));
+ pd->insert(new TButton(TRect(3,9,32,11),"~O~k",cmOK,bfDefault));
+
+ if (validView(pd) != 0)
+ {
+ deskTop->execView(pd);
+
+ CLY_destroy(pd);
+ }
+ }
+}
+
+//========================================================================
+
+Boolean TMyApplication::isCancel(TDialog *pd)
+{
+ TEvent event;
+ pd->getEvent(event);
+ pd->handleEvent(event);
+ if(event.what==evCommand && event.message.command==cmCancel) {
+ Boolean ret=messageBox("Are you sure you want to Cancel",mfConfirmation|mfYesButton|mfNoButton)==cmYes ? True : False;
+ return ret;
+ }
+ else
+ return False;
+}
+
+void TMyApplication::statusDlg()
+{
+ TDialog *pd = new TDialog(TRect(0,0,60,15),"Example Progress Bar");
+ pd->flags &= ~wfClose;
+ pd->options |= ofCentered;
+ TProgressBar *pbar = new TProgressBar(TRect(2,2,pd->size.x-2,3),300,cBackChar);
+ pd->insert(pbar);
+ pd->insert(new TButton(TRect(10,pd->size.y-3,pd->size.x-10,pd->size.y-1),"~C~ancel",cmCancel,bfDefault));
+
+ Boolean oldBusyState=TScreen::showBusyState(True);
+
+ TProgram::deskTop->insert(pd); // Modeless !!!!
+
+ int i=0;
+ Boolean keepOnGoing=True;
+
+ TRect r(5,5,pd->size.x-5,pd->size.y-5);
+ TStaticText *theMessage;
+
+ // The first 3rd.
+ theMessage = new TStaticText( r,
+ "This is a MODELESS dialog box. You can drag this box around the desktop." );
+ pd->insert(theMessage);
+ for(;i<=100;i++) {
+ pbar->update(i);
+ idle();
+ if(isCancel(pd)) {
+ keepOnGoing=False;
+ break;
+ }
+ usleep(50000);
+ }
+ CLY_destroy(theMessage);
+
+ if(keepOnGoing) {
+ // The second 3rd
+ theMessage = new TStaticText( r,
+ "Notice that only the attribute is changed to show progress" );
+ pd->insert(theMessage);
+ for(;i<=200;i++) {
+ pbar->update(i);
+ idle();
+ if(isCancel(pd)) {
+ keepOnGoing=False;
+ break;
+ }
+ usleep(50000);
+ }
+ CLY_destroy(theMessage);
+ }
+
+ if(keepOnGoing) {
+ // The last 3rd
+ theMessage = new TStaticText( r,
+ "Syntax: TProgressBar(TRect &r, double total, char bar);" );
+ pd->insert(theMessage);
+ for(;i<=300;i++) {
+ pbar->update(i);
+ idle();
+ if(isCancel(pd)) {
+ keepOnGoing=False;
+ break;
+ }
+ usleep(50000);
+ }
+ CLY_destroy(theMessage); // not necessary since we destroy
+ // the TDialog also
+ }
+ CLY_destroy(pd);
+
+ TScreen::showBusyState(oldBusyState);
+}
+
+
+void TMyApplication::cpCallBack(ushort *map)
+{
+ cBackChar=TVCodePage::RemapChar(oBackChar,map);
+}
+
+//========================================================================
+
+int main(int argc, char **argv, char **envir)
+{
+ TDisplay::setArgv(argc,argv,envir);
+ TVCodePage::SetCallBack(TMyApplication::cpCallBack);
+ TMyApplication myApplication;
+
+ const char *title=TScreen::getWindowTitle();
+ TScreen::setWindowTitle("Progress bar example");
+
+ myApplication.run();
+
+ if(title) {
+ TScreen::setWindowTitle(title);
+ delete[] title;
+ }
+
+ return 0;
+}
+
diff --git a/tvision/examples/progba/makerez.cpp b/tvision/examples/progba/makerez.cpp
new file mode 100644
index 0000000..50d856f
--- /dev/null
+++ b/tvision/examples/progba/makerez.cpp
@@ -0,0 +1,109 @@
+/*---------------------------------------------------------*/
+/* */
+/* MakeRez.cpp */
+/* Creates a MyDialog (derives from TDialog) Resource */
+/* */
+/* based on Turbo Vision Hello World Demo Source File */
+/*---------------------------------------------------------*/
+#define Uses_TObject
+#define Uses_TKeys
+#define Uses_TApplication
+#define Uses_TEvent
+#define Uses_TRect
+#define Uses_TDialog
+#define Uses_TStaticText
+#define Uses_TButton
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TStreamableClass
+#define Uses_TResourceFile
+#define Uses_TResourceCollection
+#define Uses_MsgBox
+#define Uses_fpstream
+#define Uses_string
+
+#include <tv.h>
+#include "tprogbar.h"
+
+__link(RWindow);
+__link(RGroup);
+__link(RDialog);
+__link(RFrame);
+__link(RResourceCollection);
+__link(RCluster);
+__link(RButton);
+__link(RProgressBar);
+
+#include <stdlib.h>
+
+const char rezFileName[] = "MY.REZ";
+
+void makerez()
+{
+ fpstream *ofps=0;
+
+
+ cout<< "Creating "<< rezFileName << endl;
+
+ ofps = new fpstream( rezFileName, CLY_IOSOut | CLY_IOSBin );
+ if( !ofps->good() )
+ {
+ cerr<< rezFileName <<": init failed..."<<endl;
+ exit(1);
+ }
+
+ TResourceFile *myRez;
+ myRez = new TResourceFile( ofps );
+ if( !myRez )
+ {
+ cerr<< "Resource file init failed..."<<endl;
+ exit(1);
+ }
+
+ TDialog *pd = new TDialog(TRect(0,0,60,15),"Example Progress Bar");
+ pd->options |= ofCentered;
+ pd->flags &= ~wfClose;
+ TProgressBar *pbar = new TProgressBar(TRect(2,2,pd->size.x-2,3),300);
+ pd->insert(new TButton(TRect(10,pd->size.y-3,pd->size.x-10,pd->size.y-1),"~C~ancel",cmCancel,bfDefault));
+
+ if( !pbar )
+ {
+ cerr<< "Progress Bar init failed..."<<endl;
+ exit(1);
+ }
+
+ if( !pd )
+ {
+ cerr<< "Dialog Box init failed..."<<endl;
+ exit(1);
+ }
+
+ /*
+ We need a separate TProgressBar stream because you need that object
+ visible outside the dialog box in order to update it via
+ TProgressBar::update(double progress);
+ */
+ myRez->put( pbar, "theProgressBar");
+
+ // Here is the stream for the dialog box.
+ myRez->put( pd, "theDialogBox");
+
+ TObject::CLY_destroy( pd );
+ TObject::CLY_destroy( pbar );
+ TObject::CLY_destroy( myRez);
+}
+
+int main()
+{
+ makerez();
+ return 0;
+}
+
+
+
+
diff --git a/tvision/examples/progba/readrez.cpp b/tvision/examples/progba/readrez.cpp
new file mode 100644
index 0000000..cf68062
--- /dev/null
+++ b/tvision/examples/progba/readrez.cpp
@@ -0,0 +1,239 @@
+/*---------------------------------------------------------*/
+/* Reads a previously streamed TProgressBar Resource */
+/*---------------------------------------------------------*/
+#define Uses_TObject
+#define Uses_TKeys
+#define Uses_TApplication
+#define Uses_TEvent
+#define Uses_TRect
+#define Uses_TDialog
+#define Uses_TStaticText
+#define Uses_TButton
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_MsgBox
+#define Uses_TStreamableClass
+#define Uses_TResourceCollection
+#define Uses_TResourceFile
+#define Uses_string
+#define Uses_fpstream
+
+#include <tv.h>
+#include "tprogbar.h"
+__link(RWindow);
+__link(RGroup);
+__link(RDialog);
+__link(RFrame);
+__link(RResourceCollection);
+__link(RButton);
+__link(RCluster);
+__link(RProgressBar);
+
+#include <stdlib.h>
+
+const char rezFileName[] = "MY.REZ";
+
+const int cmAboutCmd = 100; // User selected menu item 'About'
+const int cmStatusCmd = 101; // User selected menu item 'Progress Bar'
+
+//========================================================================
+
+class TMyApplication : public TApplication
+{
+public:
+ TMyApplication();
+ static TMenuBar *initMenuBar(TRect);
+ void handleEvent(TEvent &);
+private:
+ void aboutDlg();
+ void statusDlg();
+ Boolean isCancel(TDialog *pd);
+};
+
+//========================================================================
+
+TMyApplication::TMyApplication() :
+TProgInit(&TApplication::initStatusLine,&TMyApplication::initMenuBar,
+ &TApplication::initDeskTop)
+{
+}
+
+//========================================================================
+
+TMenuBar *TMyApplication::initMenuBar(TRect bounds)
+{
+ bounds.b.y = bounds.a.y + 1;
+ return(new TMenuBar(bounds,
+ new TMenu(
+ *new TMenuItem("~A~bout",cmAboutCmd,kbAltA,hcNoContext,0,
+ new TMenuItem("~P~rogress Bar",cmStatusCmd,kbAltL,hcNoContext,0)))));
+}
+
+//========================================================================
+
+void TMyApplication::handleEvent(TEvent &event)
+{
+ TApplication::handleEvent(event);
+
+ if (event.what == evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmAboutCmd:
+ {
+ aboutDlg();
+ clearEvent(event);
+ break;
+ }
+ case cmStatusCmd:
+ {
+ statusDlg();
+ clearEvent(event);
+ break;
+ }
+ }
+ }
+}
+
+//========================================================================
+
+void TMyApplication::aboutDlg()
+{
+ TDialog *pd = new TDialog(TRect(0,0,35,12),"About");
+ if (pd)
+ {
+ pd->options |= ofCentered;
+ pd->insert(new TStaticText(TRect(1,2,34,7),
+ "\003Turbo Vision Example\n\003\n"
+ "\003Streaming a Progress Bar\n\003\n"));
+ pd->insert(new TButton(TRect(3,9,32,11),"~O~k",cmOK,bfDefault));
+
+ if (validView(pd) != 0)
+ {
+ deskTop->execView(pd);
+
+ CLY_destroy(pd);
+ }
+ }
+}
+
+//========================================================================
+
+Boolean TMyApplication::isCancel(TDialog *pd)
+{
+ TEvent event;
+ pd->getEvent(event);
+ pd->handleEvent(event);
+ if(event.what==evCommand && event.message.command==cmCancel)
+ return (messageBox("Are you sure you want to Cancel",mfConfirmation|mfYesButton|mfNoButton)==cmYes ? True : False);
+ else
+ return False;
+}
+
+void TMyApplication::statusDlg()
+{
+ // Read a progress bar from a stream.
+ TProgressBar *pbar;
+ TDialog *pd;
+ fpstream *ofps=0;
+ ofps = new fpstream( rezFileName, CLY_IOSIn | CLY_IOSBin );
+ if( !ofps->good() )
+ messageBox("Stream open error", mfError|mfOKButton );
+
+ TResourceFile *myRez;
+ myRez = new TResourceFile( ofps );
+
+ if( !myRez )
+ messageBox("Resource file error", mfError|mfOKButton );
+ else
+ pbar = (TProgressBar*)myRez->get("theProgressBar");
+
+ if( !pbar )// if "getting" resource failed...
+ messageBox("Get resource error", mfError|mfOKButton );
+ else {
+
+ // Create the dialog box.
+ pd = (TDialog*)myRez->get("theDialogBox");
+ pd->insert(pbar);
+ TProgram::deskTop->insert(pd); // Modeless !!!!
+
+ int i=0;
+ Boolean keepOnGoing=True;
+
+ TRect r(5,5,pd->size.x-5,pd->size.y-5);
+ TStaticText *theMessage;
+
+ // The first 3rd.
+ theMessage = new TStaticText( r,
+ "This is a MODELESS dialog box. You can drag this box around the desktop." );
+ pd->insert(theMessage);
+ for(;i<=100;i++) {
+ pbar->update(i);
+ idle();
+ if(isCancel(pd)) {
+ keepOnGoing=False;
+ break;
+ }
+ delay(50);
+ }
+ CLY_destroy(theMessage);
+
+ if(keepOnGoing) {
+ // The second 3rd
+ theMessage = new TStaticText( r,
+ "Notice that only the attribute is changed to show progress" );
+ pd->insert(theMessage);
+ for(;i<=200;i++) {
+ pbar->update(i);
+ idle();
+ if(isCancel(pd)) {
+ keepOnGoing=False;
+ break;
+ }
+ delay(50);
+ }
+ CLY_destroy(theMessage);
+ }
+
+ if(keepOnGoing) {
+ // The last 3rd
+ theMessage = new TStaticText( r,
+ "Syntax: TProgressBar(TRect &r, double total, char bar);" );
+ pd->insert(theMessage);
+ for(;i<=300;i++) {
+ pbar->update(i);
+ idle();
+ if(isCancel(pd)) {
+ keepOnGoing=False;
+ break;
+ }
+ delay(50);
+ }
+ CLY_destroy(theMessage); // not necessary since we destroy
+ // the TDialog also
+ }
+ CLY_destroy(pd);
+ }
+
+}
+
+//========================================================================
+
+int main(void)
+{
+ TMyApplication myApplication;
+ myApplication.run();
+ return 0;
+}
+
+
+
+
+
+
diff --git a/tvision/examples/progba/rhide.env b/tvision/examples/progba/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/progba/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/progba/test.bmk b/tvision/examples/progba/test.bmk
new file mode 100644
index 0000000..7d27d57
--- /dev/null
+++ b/tvision/examples/progba/test.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: test.exe
+!include ../../makes/common.bmk
+!include test.umk
+
diff --git a/tvision/examples/progba/test.gpr b/tvision/examples/progba/test.gpr
new file mode 100644
index 0000000..7ba6385
--- /dev/null
+++ b/tvision/examples/progba/test.gpr
Binary files differ
diff --git a/tvision/examples/progba/test.mkf b/tvision/examples/progba/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/progba/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/progba/test.umk b/tvision/examples/progba/test.umk
new file mode 100644
index 0000000..c671441
--- /dev/null
+++ b/tvision/examples/progba/test.umk
@@ -0,0 +1,22 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./example$(ExOBJ) \
+ ./tprogbar$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./example$(ExOBJ) \
+ ./tprogbar$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./example$(ExOBJ):: example.cpp
+ $(RHIDE_COMPILE_CC)
+
+./tprogbar$(ExOBJ):: tprogbar.cpp
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/progba/tprogbar.cpp b/tvision/examples/progba/tprogbar.cpp
new file mode 100644
index 0000000..6b9b8ef
--- /dev/null
+++ b/tvision/examples/progba/tprogbar.cpp
@@ -0,0 +1,179 @@
+/*=========================================================================
+ This TProgressBar class expands on Mr. Perez's upload TPROGB.ZIP. This
+alternative lets you include the class definition without having to
+modify it for each main process. The dialog box that contructs TProgressBar
+will be responsible for updating it. See the example in EXAMPLE.CPP. You'll
+also find instructions on how to include the source in your TV.LIB and simply
+#define Uses_TProgressBar before #include <tv.h>.
+
+By: Barnaby W. Falls
+CIS: 70662,1523
+-------------------------------------------------------------------------*/
+#include <stdio.h>
+#include <stdlib.h>
+#define Uses_string
+
+#define Uses_TProgressBar
+#define Uses_TView
+#define Uses_TRect
+#define Uses_TGroup
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+#include <tv.h>
+
+#include "tprogbar.h"
+
+__link( RView )
+
+/* Registration object */
+TStreamableClass RProgressBar( TProgressBar::name,
+ TProgressBar::build,
+ __DELTA(TProgressBar)
+ );
+
+#define cpProgressBar "\x04"
+/* ³
+ ÀÄÄ Progress Bar Attrib Pair
+ cpProgressBar maps to TProgram::appPalette's index 4 which is, by
+default, used for the ScrollBar Page. cpProgressBar represents the normal
+progress bar color. In the constructor the foreground and background
+attributes are swapped to form the highlight color. Thus the highlight will
+always be the inverse of the bar color.
+*/
+
+const char * const TProgressBar::name = "TProgressBar";
+
+TProgressBar::TProgressBar(const TRect& bounds, unsigned long aTotal, char abackChar) :
+ TView(bounds)
+{
+ backChar = abackChar;
+ total = aTotal;
+ numOffset = (size.x/2)-3;
+ bar = new char[size.x+1];
+ memset(bar,backChar,size.x);
+ bar[size.x] = '\0';
+ charValue = (double)100/(double)size.x;
+ progress =
+ curPercent =
+ curWidth = 0;
+}
+
+TProgressBar::~TProgressBar(){
+ delete bar;
+}
+
+void TProgressBar::draw() {
+ char string[4];
+ sprintf(string,"%d",curPercent);
+ string[3] = '\0';
+ if(curPercent<10) {
+ string[2] = string[0];
+ string[1] = string[0] = ' ';
+ }
+ else if(curPercent<100 && curPercent>9) {
+ string[2] = string[1];
+ string[1] = string[0];
+ string[0] = ' ';
+ }
+ TDrawBuffer nbuf;
+ uchar colorNormal, colorHiLite;
+ colorNormal = getColor(1);
+ uchar fore = colorNormal >>4; // >>4 is same as /16
+ colorHiLite = fore+((colorNormal-(fore<<4))<<4); // <<4 is same as *16
+ nbuf.moveChar(0,backChar,colorNormal,size.x);
+ nbuf.moveStr(numOffset,string,colorNormal);
+ nbuf.moveStr(numOffset+3," %",colorNormal);
+ unsigned i;
+ for(i=0;i<curWidth;i++)
+ nbuf.putAttribute(i,colorHiLite);
+ writeLine(0, 0, size.x, 1, nbuf);
+}
+
+
+TPalette& TProgressBar::getPalette() const
+{
+ static TPalette palette( cpProgressBar, sizeof( cpProgressBar )-1 );
+ return palette;
+}
+
+
+void TProgressBar::update(unsigned long aProgress) {
+ progress = aProgress;
+ calcPercent();
+ drawView();
+}
+
+void TProgressBar::calcPercent() {
+ unsigned int percent;
+ unsigned int width;
+
+ // calculate the new percentage
+ percent = (int) ( ((double)progress/(double)total) * (double)100 );
+
+ // percentage change?
+ if(percent!=curPercent) {
+ curPercent = percent; // save new percentage
+ width = (int)((double)curPercent/charValue);// calculate percentage bar width
+
+ // width change?
+ if(width!=curWidth) {
+ curWidth = width; // save new width
+ }
+ }
+}
+
+// return the maximum iteration
+unsigned long TProgressBar::getTotal() {
+ return total;
+}
+
+// return the current iteration
+unsigned long TProgressBar::getProgress() {
+ return progress;
+}
+
+// set a new maximum iteration & update display
+void TProgressBar::setTotal(unsigned long newTotal)
+{
+ unsigned long tmp = total;
+ total = newTotal;
+ memset(bar,backChar,size.x);
+ curWidth = 0; // current width of percentage bar
+ progress = 0; // current iteration
+ curPercent = 0; // current percentage
+ if(tmp) // since it starts with 0, only update if changing
+ drawView(); // update the thermometer bar display
+}
+
+// set a new current iteration & update display
+void TProgressBar::setProgress(unsigned long newProgress) {
+ progress = newProgress;
+ calcPercent();
+ drawView(); // paint the thermometer bar
+}
+
+void TProgressBar::write( opstream& os )
+{
+ TView::write( os );
+ os.writeString( bar );
+ os << backChar << total << progress << dispLen <<
+ curPercent << curWidth << numOffset << charValue;
+}
+
+void *TProgressBar::read( ipstream& is )
+{
+ TView::read( is );
+ bar = is.readString();
+ is >> backChar >> total >> progress >> dispLen >>
+ curPercent >> curWidth >> numOffset >> charValue;
+ return this;
+}
+
+TStreamable *TProgressBar::build()
+{
+ return new TProgressBar( streamableInit );
+}
+
diff --git a/tvision/examples/progba/tprogbar.h b/tvision/examples/progba/tprogbar.h
new file mode 100644
index 0000000..bf43d42
--- /dev/null
+++ b/tvision/examples/progba/tprogbar.h
@@ -0,0 +1,93 @@
+// #if defined( Uses_TProgressBar ) && !defined( __TProgressBar )
+// #define __TProgressBar
+
+/* Include the commented directives above if you want to implement this
+ in your TV.LIB. Don't forget the #endif at the end of this file! To
+ utilize "#define Uses_TProgressBar" put the follow directives in TV.H,
+ after #if defined( Uses_TButton ) would be a good place.
+
+#if defined( Uses_TProgressBar )
+#define Uses_TView
+#define __INC_DIALOGS_H
+#endif
+
+ After uncommenting the top two directives of this header file and the
+ #endif at the end of this header file copy the contents of this file to
+ the DIALOGS.H file in TVISION\INCLUDE. Put it before the last set of
+ directives or to be safe somewhere in the middle between "#define Uses_*"
+ blocks. Don't forget to make a backup of DIALOGS.H if you make mistakes.
+
+ In MAKEFILE. in \TVISION\SOURCE edit the OBJS = statement to include
+ TPROGBAR.OBJ or compile it alone and just add it to the TV.LIB via
+ TLIB (easier).
+
+ To comiple individually and use try:
+ bcc -c -P -O1 -ml -I<include dirs> -n<obj dirs> tprogbar.cpp
+ + add "-Y -Vs -B" for overlay version of TV.
+ tlib tv.lib /0 +TPROGBAR
+
+ For example:
+ bcc -c -P -O1 -kl -I\BC\INCLUDE;\BC\TVISION\INCLUDE tprogbar.cpp
+ tlib \BC\TVISION\LIB\TV.LIB /0 +tprogbar
+
+ After this you can remove TPROGBAR.CPP from your project list and it will
+be included in the link with TV.LIB.
+
+*/
+
+class TRect;
+
+class TProgressBar : public TView
+{
+public:
+ // default the background char to 178, but you can pass any char you want
+ TProgressBar(const TRect& r, unsigned long iters, char abackChar='²');
+ ~TProgressBar();
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void update(unsigned long aProgress);
+
+ inline unsigned long getTotal(); // get the maximum iteration
+ inline unsigned long getProgress(); // get the current iteration
+
+ // change the percentage ( calls the update function )
+ void setTotal(unsigned long newTotal); // set the maximum iteration
+ void setProgress(unsigned long newProgress); // set the current iteration
+
+protected:
+ char backChar; // background character
+ unsigned long total; // total iterations to complete 100 %
+ unsigned long progress; // current iteration value
+ char * bar; // thermometer bar
+ unsigned int dispLen; // length of bar
+ unsigned int curPercent; // current percentage
+ unsigned int curWidth;
+ unsigned int numOffset; // offset in the string to display the percentage
+ double charValue;
+
+private:
+ virtual const char* streamableName() const
+ {return name;}
+ void calcPercent(); // calculate new percentage
+
+protected:
+ TProgressBar( StreamableInit) : TView( streamableInit ) {};
+ virtual void write(opstream&);
+ virtual void *read(ipstream&);
+
+public:
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TProgressBar& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TProgressBar*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TProgressBar& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TProgressBar* cl )
+ { return os << (TStreamable *)cl; }
+
+//#endif // defined( Uses_TProgressBar ) && !defined( __TProgressBar )
diff --git a/tvision/examples/readme.txt b/tvision/examples/readme.txt
new file mode 100644
index 0000000..480ca31
--- /dev/null
+++ b/tvision/examples/readme.txt
@@ -0,0 +1,99 @@
+Hi!
+
+ Here you'll find some Turbo Vision examples and widgets. Perhaps I'll
+incorporate some of them in the library in the future, but only if I get
+feedback.
+ The examples were collected from the net and I think they can distributed
+freely. Some of them are public domain.
+ To compile there are two methodes:
+
+A) You can use the last release of RHIDE available. In this case you just
+need to enter in the desired directory and run rhide.
+B) Use the make tool. In this case you must enter in the desired directory
+and run "make -f file.mak" where file.mak is the name of the .mak file for
+this example.
+
+ In both cases is strongly recommended to configure the library using the
+configure script.
+ The file called rhide.env contains the configuration for your system
+generated by the configure script. If you have problems or didn't configure
+the library take a look at this file and correct the paths defined there.
+ The patchenv.pl Perl script is a small tool to take the definitions found
+in rhide.env file and propagate them to all of the .mak files. If you modify
+rhide.env and you aren't using rhide you should run it to update the .mak
+files.
+
+ All of these examples where easylly ported, read the porting.txt file to
+learn what incompatibilities I found while porting the examples.
+
+bhelp - Implements a Borland's Help file viewer. With it you can read
+ BC++ and TC++ help files.
+clipboard- This is an example on how to write code using the TVOSClipboard
+ class. It gives access to the OS clipboard in an OS independent
+ way.
+cyrillic - Tests for the cyrillic support. Currently only for KOI8-R. If you
+ are interested in more support and can help just contact me. Two
+ examples are available: one specifically for Linux console and
+ other more generic one but oriented to drivers that can change
+ the font (X11, DOS, Linux console, etc.).
+demo - That's the Borland's demo adapted by Sergio Sigala, I did some
+ changes to compile it with this port.
+desklogo - An example of how to change the desktop appearance. Contributed by
+ Joel <jso@europay.com>.
+ One of the examples also shows how to stop a TV application using
+ ^Z under Linux.
+dlgdsn - That's a dialog design/code generator by Warlei Alves. I included
+ it because it could be useful for people not using tools like
+ EasyDiag and because Warlei told me he couldn't maintain it and
+ asked me to maintain your project.
+ Note the code needs a lot of adjustments, I fixed a lot of bugs
+ by compiling using -Wall -Werror and I didn't know how to solve
+ some details.
+dyntxt - Implements a StaticText with getData/setData member to make it
+ "non-static".
+fonts - Here you can see how to set and restore the fonts.
+ I also included an example that shows how to handle sft font files
+ to generate raw font files.
+helpdemo - Shows how to use help context values and how to display context
+ sensitive help in the status line.
+i18n - Internationalization for messages. Example using spanish.
+inplis - That's interesting. It implements a class with pairs label/data
+ and allows the modification and browse of the data in a scrollabel
+ list.
+listvi - That's a buggy example, if you like the idea you could fix it. I
+ fixed tons of bugs and still buggy. The idea is similar to the one
+ in the inplis example. I included it just because I fixed some
+ stuff and perhaps somebody wants to finish it.
+msgcls - It shows the implementation of a message window.
+progba - Implements a progress bar widget. Look how the author polls the
+ buttons.
+ I also added to it TVCodePage, window title and busy state
+ examples.
+sdlg - That's a very good (and usefull) example. It implements a
+ scrollable/resizeble dialog box.
+sdlg2 - Same as sdlg but more advanced.
+tcombo - Implements a Combo Box widget. The implementation is clean and
+ complete. That's a true example ;-).
+terminal - That's more a test than an example. I did it to test the class
+ because Andris found a bug in the Robert's translation of the
+ obfuscated assembler of the Borland's version. It just test the
+ TTerminal class.
+tprogb - Another progress bar, less flexible.
+tutorial - It contains a very simple example application made in 16 steps to
+ show how each thing is added. It was part of some tutorial from
+ Borland. I taked it from the Sergio Sigala port. No modifications
+ were needed, I just changed #include <tvision/tv.h> by
+ #include <th.h> that's the common use. I added some extra
+ comments.
+tvedit - Shows how to create a simple text editor.
+tvhc - Turbo Vision Help Compiler. This is a compiler for the original
+ help format. This format is binary and I don't recommend using it.
+ You can find a better help system in InfView included in the
+ SETEdit project.
+videomode- Shows how to change the screen/window size using RHTV 1.x modes
+ and 2.x resolution style.
+xterm - Shows how to start a XTerm configured to report most key
+ combinations. I also included an Eterm 0.9.x theme with the same
+ purpose.
+
+Salvador Eduardo Tropea (salvador@inti.gov.ar)
diff --git a/tvision/examples/sdlg/dlg.h b/tvision/examples/sdlg/dlg.h
new file mode 100644
index 0000000..ff9c858
--- /dev/null
+++ b/tvision/examples/sdlg/dlg.h
@@ -0,0 +1,100 @@
+/*
+
+File: DLG.H
+Author: Patrick Reilly (TeamB) CIS: 71333,2764
+Date: 9/16/93
+Desc: Header file for ScrollGroup and ScrollDialog classes.
+
+ This file is the header file for a pair of classes that allow use of a
+scroll-able dialog box. It is designed for (but doesn't require) a TV.H-like
+master header file with the following lines:
+
+ ...
+
+ #ifdef Uses_ScrollDialog
+ #define Uses_TDialog
+ #define INC_DLG_H
+ #endif
+
+ #ifdef Uses_ScrollGroup
+ #define Uses_TGroup
+ #define INC_DLG_H
+ #endif
+
+ ...
+
+ #include <tv.h>
+
+ ...
+
+ #ifdef INC_DLG_H
+ #include "Dlg.h"
+ #endif
+
+ ...
+
+
+*/
+
+#if defined(Uses_ScrollGroup) && !defined(Def_ScrollGroup)
+#define Def_ScrollGroup
+
+class TRect;
+class TScrollBar;
+struct TEvent;
+class TBackground;
+
+class ScrollGroupInit
+{
+public:
+
+ ScrollGroupInit(TBackground* (*fn)(TRect)) : bkgdMaker(fn)
+ {}
+
+ TBackground* (*bkgdMaker)(TRect);
+};
+
+class ScrollGroup : public TGroup, public virtual ScrollGroupInit
+{
+public:
+
+ ScrollGroup(const TRect&, TScrollBar*, TScrollBar*);
+
+ virtual void changeBounds(const TRect&);
+ virtual void handleEvent(TEvent&);
+ virtual void scrollDraw();
+ virtual void scrollTo(int, int);
+ virtual void setLimit(int, int);
+ virtual void setState(ushort, Boolean);
+ virtual void focusSubView(TView*);
+
+ static TBackground* initBackground(TRect);
+
+ TScrollBar* hScrollBar;
+ TScrollBar* vScrollBar;
+ TBackground* background;
+ TPoint delta;
+ TPoint limit;
+};
+
+#endif
+
+#if defined(Uses_ScrollDialog) && !defined(Def_ScrollDialog)
+#define Def_ScrollDialog
+
+class TRect;
+struct TEvent;
+class ScrollGroup;
+
+class ScrollDialog : public TDialog
+{
+public:
+
+ ScrollDialog(const TRect&, const char*, ushort);
+
+ virtual void handleEvent(TEvent&);
+
+ ScrollGroup* scrollGroup;
+};
+
+#endif
diff --git a/tvision/examples/sdlg/main.cpp b/tvision/examples/sdlg/main.cpp
new file mode 100644
index 0000000..605b747
--- /dev/null
+++ b/tvision/examples/sdlg/main.cpp
@@ -0,0 +1,66 @@
+/*
+
+Author: Patrick Reilly
+Date: 9/16/93
+
+ This is a demo program to demonstrate using the ScrollDialog (and
+ScrollGroup) classes. Released to the public domain. Use at your own risk <g>.
+
+*/
+
+#define Uses_ScrollDialog
+ #define Uses_TDialog
+#define Uses_ScrollGroup
+ #define Uses_TGroup
+
+#define Uses_TStaticText
+#define Uses_TInputLine
+#define Uses_TApplication
+#define Uses_TDeskTop
+#include <tv.h>
+#include "dlg.h"
+
+class TApp : public TApplication
+{
+public:
+
+ TApp();
+};
+
+static char ctrlString[] = "Control 01";
+
+TApp::TApp() : TProgInit(initStatusLine, initMenuBar, initDeskTop)
+{
+ ScrollDialog* dlg = new ScrollDialog(TRect(0,0,40,10), "Test Dialog", sbVertical);
+ dlg->options |= ofCentered;
+ dlg->flags |= wfGrow;
+
+ for(int x = 0; x < 40; x++)
+ {
+ if(x%10)
+ {
+ int n = x+1;
+ ctrlString[8] = '0' + (n/10);
+ ctrlString[9] = '0' + (n%10);
+ dlg->scrollGroup->insert(new TStaticText(TRect(0,x,10,x+1), ctrlString));
+ }
+ else
+ dlg->scrollGroup->insert(new TInputLine(TRect(0,x,10,x+1), 20));
+ }
+ dlg->scrollGroup->selectNext(False);
+ dlg->scrollGroup->setLimit(0, 40);
+
+ if(validView(dlg) != 0)
+ {
+ deskTop->execView(dlg);
+ CLY_destroy(dlg);
+ }
+}
+
+int main()
+{
+ TApp app;
+ app.run();
+ app.shutDown();
+ return 0;
+}
diff --git a/tvision/examples/sdlg/rhide.env b/tvision/examples/sdlg/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/sdlg/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/sdlg/scrldlg.cpp b/tvision/examples/sdlg/scrldlg.cpp
new file mode 100644
index 0000000..57dca3a
--- /dev/null
+++ b/tvision/examples/sdlg/scrldlg.cpp
@@ -0,0 +1,48 @@
+#define Uses_ScrollDialog
+// =================================================
+#define Uses_TDialog
+// =================================================
+#define Uses_ScrollGroup
+// =================================================
+#define Uses_TGroup
+// =================================================
+
+#define Uses_TScrollBar
+#define Uses_TEvent
+#define Uses_TKeys
+// =================================================
+#include <tv.h>
+#include "dlg.h"
+// =================================================
+
+ScrollDialog::ScrollDialog(const TRect& bounds, const char* aTitle, ushort f) :
+ TWindowInit(initFrame),
+ TDialog(bounds, aTitle),
+ scrollGroup(0)
+{
+ TScrollBar* hsb = 0;
+ TScrollBar* vsb = 0;
+
+ if(f & sbHorizontal)
+ hsb = standardScrollBar(sbHorizontal|sbHandleKeyboard);
+ if(f & sbVertical)
+ vsb = standardScrollBar(sbVertical|sbHandleKeyboard);
+
+ TRect r = getExtent();
+ r.grow(-1,-1);
+ scrollGroup = new ScrollGroup(r, hsb, vsb);
+ scrollGroup->growMode = gfGrowHiX | gfGrowHiY;
+ insert(scrollGroup);
+}
+
+void ScrollDialog::handleEvent(TEvent& event)
+{
+ if(event.what == evKeyDown &&
+ (event.keyDown.keyCode == kbTab ||
+ event.keyDown.keyCode == kbShiftTab))
+ {
+ scrollGroup->selectNext(Boolean(event.keyDown.keyCode == kbShiftTab));
+ clearEvent(event);
+ }
+ TDialog::handleEvent(event);
+}
diff --git a/tvision/examples/sdlg/scrlgrp.cpp b/tvision/examples/sdlg/scrlgrp.cpp
new file mode 100644
index 0000000..af64635
--- /dev/null
+++ b/tvision/examples/sdlg/scrlgrp.cpp
@@ -0,0 +1,172 @@
+#define Uses_ScrollGroup
+// ===================================================================
+#define Uses_TGroup
+#define Uses_TPoint
+#define Uses_TRect
+// ===================================================================
+
+#define Uses_TScrollBar
+#define Uses_TBackground
+#define Uses_TEvent
+// ===================================================================
+#include <tv.h>
+#include "dlg.h"
+// ===================================================================
+
+ScrollGroup::ScrollGroup(const TRect& bounds, TScrollBar* hsb, TScrollBar* vsb) :
+ ScrollGroupInit(initBackground),
+ TGroup(bounds),
+ hScrollBar(hsb),
+ vScrollBar(vsb),
+ background(0)
+{
+ eventMask |= evBroadcast;
+ delta.x = delta.y = limit.x = limit.y = 0;
+
+ if(bkgdMaker != 0 && (background = bkgdMaker(getExtent())) != 0)
+ {
+ background->growMode = gfGrowHiX | gfGrowHiY;
+ insert(background);
+ }
+}
+
+void ScrollGroup::changeBounds(const TRect& bounds)
+{
+ lock();
+ TGroup::changeBounds(bounds);
+ setLimit(limit.x, limit.y);
+ unlock();
+ drawView();
+}
+
+static Boolean isView(TView* view, void* args)
+{
+ return Boolean(view == args);
+}
+
+void ScrollGroup::handleEvent(TEvent& event)
+{
+ TGroup::handleEvent(event);
+
+ if(event.what == evBroadcast)
+ {
+ if(event.message.command == cmScrollBarChanged &&
+ (event.message.infoPtr == hScrollBar ||
+ event.message.infoPtr == vScrollBar))
+ scrollDraw();
+ else if(event.message.command == cmReceivedFocus &&
+ firstThat(isView, event.message.infoPtr) != 0)
+ focusSubView((TView*) event.message.infoPtr);
+ }
+}
+
+struct ScrollInfo
+{
+ TPoint delta;
+ TView* ignore;
+};
+
+static void doScroll(TView* view, void* args)
+{
+ ScrollInfo* info = (ScrollInfo*) args;
+
+ if(view != info->ignore)
+ {
+ TPoint dest = view->origin + info->delta;
+ view->moveTo(dest.x, dest.y);
+ }
+}
+
+void ScrollGroup::scrollDraw()
+{
+ TPoint d;
+
+ d.x = hScrollBar ? hScrollBar->value : 0;
+ d.y = vScrollBar ? vScrollBar->value : 0;
+
+ if( d.x != delta.x || d.y != delta.y )
+ {
+ ScrollInfo info;
+
+ info.delta = delta-d;
+ info.ignore = background;
+ lock();
+ forEach(doScroll, &info);
+ delta = d;
+ unlock();
+ drawView();
+ }
+}
+
+void ScrollGroup::scrollTo(int x, int y)
+{
+ lock();
+ if( hScrollBar != 0 && x != hScrollBar->value)
+ hScrollBar->setValue(x);
+ if( vScrollBar != 0 && y != vScrollBar->value)
+ vScrollBar->setValue(y);
+ unlock();
+ scrollDraw();
+}
+
+void ScrollGroup::setLimit(int x, int y)
+{
+ limit.x = x;
+ limit.y = y;
+ lock();
+ if(hScrollBar != 0)
+ hScrollBar->setParams(hScrollBar->value, 0, x-size.x, size.x-1, 1);
+ if(vScrollBar != 0 )
+ vScrollBar->setParams(vScrollBar->value, 0, y-size.y, size.y-1, 1);
+ unlock();
+ scrollDraw();
+}
+
+void ScrollGroup::setState(ushort aState, Boolean enable)
+{
+ TGroup::setState(aState, enable);
+ if((aState & (sfActive | sfSelected)) != 0 )
+ {
+ if(hScrollBar != 0)
+ if(enable)
+ hScrollBar->show();
+ else
+ hScrollBar->hide();
+ if(vScrollBar != 0)
+ if(enable)
+ vScrollBar->show();
+ else
+ vScrollBar->hide();
+ }
+}
+
+void ScrollGroup::focusSubView(TView* view)
+{
+ TRect rview = view->getBounds();
+
+ TRect r = getExtent();
+ r.intersect(rview);
+ if(r != rview)
+ {
+ int dx, dy;
+
+ dx = delta.x;
+ if(view->origin.x < 0)
+ dx = delta.x + view->origin.x;
+ else if(view->origin.x + view->size.x > size.x)
+ dx = delta.x+view->origin.x+view->size.x-size.x;
+
+ dy = delta.y;
+ if(view->origin.y < 0)
+ dy = delta.y + view->origin.y;
+ else if(view->origin.y + view->size.y > size.y)
+ dy = delta.y+view->origin.y+view->size.y-size.y;
+
+ scrollTo(dx, dy);
+ }
+}
+
+TBackground* ScrollGroup::initBackground(TRect r)
+{
+ return new TBackground(r, ' ');
+}
diff --git a/tvision/examples/sdlg/test.bmk b/tvision/examples/sdlg/test.bmk
new file mode 100644
index 0000000..7d27d57
--- /dev/null
+++ b/tvision/examples/sdlg/test.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: test.exe
+!include ../../makes/common.bmk
+!include test.umk
+
diff --git a/tvision/examples/sdlg/test.gpr b/tvision/examples/sdlg/test.gpr
new file mode 100644
index 0000000..2e8f4a7
--- /dev/null
+++ b/tvision/examples/sdlg/test.gpr
Binary files differ
diff --git a/tvision/examples/sdlg/test.mkf b/tvision/examples/sdlg/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/sdlg/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/sdlg/test.umk b/tvision/examples/sdlg/test.umk
new file mode 100644
index 0000000..852af2e
--- /dev/null
+++ b/tvision/examples/sdlg/test.umk
@@ -0,0 +1,27 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./main$(ExOBJ) \
+ ./scrldlg$(ExOBJ) \
+ ./scrlgrp$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./main$(ExOBJ) \
+ ./scrldlg$(ExOBJ) \
+ ./scrlgrp$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./main$(ExOBJ):: main.cpp
+ $(RHIDE_COMPILE_CC)
+
+./scrldlg$(ExOBJ):: scrldlg.cpp
+ $(RHIDE_COMPILE_CC)
+
+./scrlgrp$(ExOBJ):: scrlgrp.cpp
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/sdlg2/dlg.h b/tvision/examples/sdlg2/dlg.h
new file mode 100644
index 0000000..0f228d8
--- /dev/null
+++ b/tvision/examples/sdlg2/dlg.h
@@ -0,0 +1,102 @@
+/*
+
+File: DLG.H
+Author: Patrick Reilly (TeamB) CIS: 71333,2764
+Date: 9/16/93
+Desc: Header file for ScrollGroup and ScrollDialog classes.
+
+ This file is the header file for a pair of classes that allow use of a
+scroll-able dialog box. It is designed for (but doesn't require) a TV.H-like
+master header file with the following lines:
+
+ ...
+
+ #ifdef Uses_ScrollDialog
+ #define Uses_TDialog
+ #define INC_DLG_H
+ #endif
+
+ #ifdef Uses_ScrollGroup
+ #define Uses_TGroup
+ #define INC_DLG_H
+ #endif
+
+ ...
+
+ #include <tv.h>
+
+ ...
+
+ #ifdef INC_DLG_H
+ #include "Dlg.h"
+ #endif
+
+ ...
+
+
+*/
+
+#if defined(Uses_ScrollGroup) && !defined(Def_ScrollGroup)
+#define Def_ScrollGroup
+
+class TRect;
+class TScrollBar;
+struct TEvent;
+class TBackground;
+
+class ScrollGroupInit
+{
+public:
+
+ ScrollGroupInit(TBackground* (*fn)(TRect)) : bkgdMaker(fn)
+ {}
+
+ TBackground* (*bkgdMaker)(TRect);
+};
+
+class ScrollGroup : public TGroup, public virtual ScrollGroupInit
+{
+public:
+
+ ScrollGroup(const TRect&, TScrollBar*, TScrollBar*);
+
+ virtual void changeBounds(const TRect&);
+ virtual void handleEvent(TEvent&);
+ virtual void scrollDraw();
+ virtual void scrollTo(int, int);
+ virtual void setLimit(int, int);
+ virtual void setState(ushort, Boolean);
+ virtual void focusSubView(TView*);
+
+ static TBackground* initBackground(TRect);
+
+ TScrollBar* hScrollBar;
+ TScrollBar* vScrollBar;
+ TBackground* background;
+ TPoint delta;
+ TPoint limit;
+};
+
+#endif
+
+#if defined(Uses_ScrollDialog) && !defined(Def_ScrollDialog)
+#define Def_ScrollDialog
+
+class TRect;
+struct TEvent;
+class ScrollGroup;
+const ushort sbHorBar = 0x0001;
+const ushort sbVerBar = 0x0002;
+
+class ScrollDialog : public TDialog
+{
+public:
+
+ ScrollDialog(const TRect&, const char*, ushort);
+
+ virtual void handleEvent(TEvent&);
+
+ ScrollGroup* scrollGroup;
+};
+
+#endif
diff --git a/tvision/examples/sdlg2/main.cpp b/tvision/examples/sdlg2/main.cpp
new file mode 100644
index 0000000..6bd2815
--- /dev/null
+++ b/tvision/examples/sdlg2/main.cpp
@@ -0,0 +1,67 @@
+/*
+
+Author: Patrick Reilly
+Date: 9/16/93
+
+ This is a demo program to demonstrate using the ScrollDialog (and
+ScrollGroup) classes. Released to the public domain. Use at your own risk <g>.
+
+*/
+
+#define Uses_ScrollDialog
+ #define Uses_TDialog
+#define Uses_ScrollGroup
+ #define Uses_TGroup
+
+#define Uses_TStaticText
+#define Uses_TButton
+#define Uses_TInputLine
+#define Uses_TApplication
+#define Uses_TDeskTop
+#include <tv.h>
+#include "dlg.h"
+
+class TApp : public TApplication
+{
+public:
+
+ TApp();
+};
+
+static char ctrlString[] = "Control 01";
+
+TApp::TApp() : TProgInit(initStatusLine, initMenuBar, initDeskTop)
+{
+ ScrollDialog* dlg = new ScrollDialog(TRect(0,0,40,10), "Test Dialog", sbHorBar|sbVerBar);
+ dlg->options |= ofCentered;
+ dlg->flags |= wfGrow;
+
+ for(int x = 0; x < 40; x+=2)
+ {
+ if(x%10)
+ {
+ int n = x+1;
+ ctrlString[8] = '0' + (n/10);
+ ctrlString[9] = '0' + (n%10);
+ dlg->scrollGroup->insert(new TButton(TRect(0,x,13,x+2), ctrlString,100,bfNormal));
+ }
+ else
+ dlg->scrollGroup->insert(new TInputLine(TRect(0,x,10,x+1), 20));
+ }
+ dlg->scrollGroup->selectNext(False);
+ dlg->scrollGroup->setLimit(160, 40);
+
+ if(validView(dlg) != 0)
+ {
+ deskTop->execView(dlg);
+ CLY_destroy(dlg);
+ }
+}
+
+int main()
+{
+ TApp app;
+ app.run();
+ app.shutDown();
+ return 0;
+}
diff --git a/tvision/examples/sdlg2/rhide.env b/tvision/examples/sdlg2/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/sdlg2/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/sdlg2/scrldlg.cpp b/tvision/examples/sdlg2/scrldlg.cpp
new file mode 100644
index 0000000..8bb1653
--- /dev/null
+++ b/tvision/examples/sdlg2/scrldlg.cpp
@@ -0,0 +1,48 @@
+#define Uses_ScrollDialog
+// =================================================
+#define Uses_TDialog
+// =================================================
+#define Uses_ScrollGroup
+// =================================================
+#define Uses_TGroup
+// =================================================
+
+#define Uses_TScrollBar
+#define Uses_TEvent
+#define Uses_TKeys
+// =================================================
+#include <tv.h>
+#include "dlg.h"
+// =================================================
+
+ScrollDialog::ScrollDialog(const TRect& bounds, const char* aTitle, ushort f) :
+ TWindowInit(initFrame),
+ TDialog(bounds, aTitle),
+ scrollGroup(0)
+{
+ TScrollBar* hsb = 0;
+ TScrollBar* vsb = 0;
+
+ if(f & sbHorBar)
+ hsb = standardScrollBar(sbHorizontal|sbHandleKeyboard);
+ if(f & sbVerBar)
+ vsb = standardScrollBar(sbVertical|sbHandleKeyboard);
+
+ TRect r = getExtent();
+ r.grow(-1,-1);
+ scrollGroup = new ScrollGroup(r, hsb, vsb);
+ scrollGroup->growMode = gfGrowHiX | gfGrowHiY;
+ insert(scrollGroup);
+}
+
+void ScrollDialog::handleEvent(TEvent& event)
+{
+ if(event.what == evKeyDown &&
+ (event.keyDown.keyCode == kbTab ||
+ event.keyDown.keyCode == kbShiftTab))
+ {
+ scrollGroup->selectNext(Boolean(event.keyDown.keyCode == kbShiftTab));
+ clearEvent(event);
+ }
+ TDialog::handleEvent(event);
+}
diff --git a/tvision/examples/sdlg2/scrlgrp.cpp b/tvision/examples/sdlg2/scrlgrp.cpp
new file mode 100644
index 0000000..af64635
--- /dev/null
+++ b/tvision/examples/sdlg2/scrlgrp.cpp
@@ -0,0 +1,172 @@
+#define Uses_ScrollGroup
+// ===================================================================
+#define Uses_TGroup
+#define Uses_TPoint
+#define Uses_TRect
+// ===================================================================
+
+#define Uses_TScrollBar
+#define Uses_TBackground
+#define Uses_TEvent
+// ===================================================================
+#include <tv.h>
+#include "dlg.h"
+// ===================================================================
+
+ScrollGroup::ScrollGroup(const TRect& bounds, TScrollBar* hsb, TScrollBar* vsb) :
+ ScrollGroupInit(initBackground),
+ TGroup(bounds),
+ hScrollBar(hsb),
+ vScrollBar(vsb),
+ background(0)
+{
+ eventMask |= evBroadcast;
+ delta.x = delta.y = limit.x = limit.y = 0;
+
+ if(bkgdMaker != 0 && (background = bkgdMaker(getExtent())) != 0)
+ {
+ background->growMode = gfGrowHiX | gfGrowHiY;
+ insert(background);
+ }
+}
+
+void ScrollGroup::changeBounds(const TRect& bounds)
+{
+ lock();
+ TGroup::changeBounds(bounds);
+ setLimit(limit.x, limit.y);
+ unlock();
+ drawView();
+}
+
+static Boolean isView(TView* view, void* args)
+{
+ return Boolean(view == args);
+}
+
+void ScrollGroup::handleEvent(TEvent& event)
+{
+ TGroup::handleEvent(event);
+
+ if(event.what == evBroadcast)
+ {
+ if(event.message.command == cmScrollBarChanged &&
+ (event.message.infoPtr == hScrollBar ||
+ event.message.infoPtr == vScrollBar))
+ scrollDraw();
+ else if(event.message.command == cmReceivedFocus &&
+ firstThat(isView, event.message.infoPtr) != 0)
+ focusSubView((TView*) event.message.infoPtr);
+ }
+}
+
+struct ScrollInfo
+{
+ TPoint delta;
+ TView* ignore;
+};
+
+static void doScroll(TView* view, void* args)
+{
+ ScrollInfo* info = (ScrollInfo*) args;
+
+ if(view != info->ignore)
+ {
+ TPoint dest = view->origin + info->delta;
+ view->moveTo(dest.x, dest.y);
+ }
+}
+
+void ScrollGroup::scrollDraw()
+{
+ TPoint d;
+
+ d.x = hScrollBar ? hScrollBar->value : 0;
+ d.y = vScrollBar ? vScrollBar->value : 0;
+
+ if( d.x != delta.x || d.y != delta.y )
+ {
+ ScrollInfo info;
+
+ info.delta = delta-d;
+ info.ignore = background;
+ lock();
+ forEach(doScroll, &info);
+ delta = d;
+ unlock();
+ drawView();
+ }
+}
+
+void ScrollGroup::scrollTo(int x, int y)
+{
+ lock();
+ if( hScrollBar != 0 && x != hScrollBar->value)
+ hScrollBar->setValue(x);
+ if( vScrollBar != 0 && y != vScrollBar->value)
+ vScrollBar->setValue(y);
+ unlock();
+ scrollDraw();
+}
+
+void ScrollGroup::setLimit(int x, int y)
+{
+ limit.x = x;
+ limit.y = y;
+ lock();
+ if(hScrollBar != 0)
+ hScrollBar->setParams(hScrollBar->value, 0, x-size.x, size.x-1, 1);
+ if(vScrollBar != 0 )
+ vScrollBar->setParams(vScrollBar->value, 0, y-size.y, size.y-1, 1);
+ unlock();
+ scrollDraw();
+}
+
+void ScrollGroup::setState(ushort aState, Boolean enable)
+{
+ TGroup::setState(aState, enable);
+ if((aState & (sfActive | sfSelected)) != 0 )
+ {
+ if(hScrollBar != 0)
+ if(enable)
+ hScrollBar->show();
+ else
+ hScrollBar->hide();
+ if(vScrollBar != 0)
+ if(enable)
+ vScrollBar->show();
+ else
+ vScrollBar->hide();
+ }
+}
+
+void ScrollGroup::focusSubView(TView* view)
+{
+ TRect rview = view->getBounds();
+
+ TRect r = getExtent();
+ r.intersect(rview);
+ if(r != rview)
+ {
+ int dx, dy;
+
+ dx = delta.x;
+ if(view->origin.x < 0)
+ dx = delta.x + view->origin.x;
+ else if(view->origin.x + view->size.x > size.x)
+ dx = delta.x+view->origin.x+view->size.x-size.x;
+
+ dy = delta.y;
+ if(view->origin.y < 0)
+ dy = delta.y + view->origin.y;
+ else if(view->origin.y + view->size.y > size.y)
+ dy = delta.y+view->origin.y+view->size.y-size.y;
+
+ scrollTo(dx, dy);
+ }
+}
+
+TBackground* ScrollGroup::initBackground(TRect r)
+{
+ return new TBackground(r, ' ');
+}
diff --git a/tvision/examples/sdlg2/test.bmk b/tvision/examples/sdlg2/test.bmk
new file mode 100644
index 0000000..7d27d57
--- /dev/null
+++ b/tvision/examples/sdlg2/test.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: test.exe
+!include ../../makes/common.bmk
+!include test.umk
+
diff --git a/tvision/examples/sdlg2/test.gpr b/tvision/examples/sdlg2/test.gpr
new file mode 100644
index 0000000..bfc69df
--- /dev/null
+++ b/tvision/examples/sdlg2/test.gpr
Binary files differ
diff --git a/tvision/examples/sdlg2/test.mkf b/tvision/examples/sdlg2/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/sdlg2/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/sdlg2/test.umk b/tvision/examples/sdlg2/test.umk
new file mode 100644
index 0000000..852af2e
--- /dev/null
+++ b/tvision/examples/sdlg2/test.umk
@@ -0,0 +1,27 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./main$(ExOBJ) \
+ ./scrldlg$(ExOBJ) \
+ ./scrlgrp$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./main$(ExOBJ) \
+ ./scrldlg$(ExOBJ) \
+ ./scrlgrp$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./main$(ExOBJ):: main.cpp
+ $(RHIDE_COMPILE_CC)
+
+./scrldlg$(ExOBJ):: scrldlg.cpp
+ $(RHIDE_COMPILE_CC)
+
+./scrlgrp$(ExOBJ):: scrlgrp.cpp
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tcombo/nmcmbobx.cpp b/tvision/examples/tcombo/nmcmbobx.cpp
new file mode 100644
index 0000000..bf56902
--- /dev/null
+++ b/tvision/examples/tcombo/nmcmbobx.cpp
@@ -0,0 +1,23 @@
+/*************************************************************************/
+/* */
+/* NMCMBOBX.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* This file contains the stream registration object for the class */
+/* TComboBox. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox classes. */
+/* */
+/*************************************************************************/
+
+
+#define Uses_TComboBox
+#include "tcombobx.h"
+
+const char * const TComboBox::name = "TComboBox";
+
diff --git a/tvision/examples/tcombo/nmcmbovw.cpp b/tvision/examples/tcombo/nmcmbovw.cpp
new file mode 100644
index 0000000..1286699
--- /dev/null
+++ b/tvision/examples/tcombo/nmcmbovw.cpp
@@ -0,0 +1,23 @@
+/*************************************************************************/
+/* */
+/* NMCMBOVW.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* This file contains the stream registration object for the class */
+/* TComboViewer. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox classes. */
+/* */
+/*************************************************************************/
+
+
+#define Uses_TComboViewer
+#include "tcombobx.h"
+
+const char * const TComboViewer::name = "TComboViewer";
+
diff --git a/tvision/examples/tcombo/nmcmbown.cpp b/tvision/examples/tcombo/nmcmbown.cpp
new file mode 100644
index 0000000..54e559e
--- /dev/null
+++ b/tvision/examples/tcombo/nmcmbown.cpp
@@ -0,0 +1,23 @@
+/*************************************************************************/
+/* */
+/* NMCMBOWN.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* This file contains the stream registration object for the class */
+/* TComboWindow. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox class. */
+/* */
+/*************************************************************************/
+
+
+#define Uses_TComboWindow
+#include "tcombobx.h"
+
+const char * const TComboWindow::name = "TComboWindow";
+
diff --git a/tvision/examples/tcombo/nmsinput.cpp b/tvision/examples/tcombo/nmsinput.cpp
new file mode 100644
index 0000000..5a7b35e
--- /dev/null
+++ b/tvision/examples/tcombo/nmsinput.cpp
@@ -0,0 +1,23 @@
+/*************************************************************************/
+/* */
+/* NMSINPUT.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* This file contains the stream registration object for the class */
+/* TStaticInputLine. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 11/16/92 VJD 0.2 Added streamability to the TStaticInputLine class */
+/* */
+/*************************************************************************/
+
+
+#define Uses_TStaticInputLine
+#include "tsinputl.h"
+
+const char * const TStaticInputLine::name = "TStaticInputLine";
+
diff --git a/tvision/examples/tcombo/readme.txt b/tvision/examples/tcombo/readme.txt
new file mode 100644
index 0000000..6c0d4d4
--- /dev/null
+++ b/tvision/examples/tcombo/readme.txt
@@ -0,0 +1,51 @@
+The included files are Turbo Vision source code files designed to
+create a Combo Box similar in functionality to the one in Microsoft
+Windows. All code in these files is considered by the author to be
+part of the public domain.
+
+The following files should be included with this file:
+ README.TXT This file.
+ TCOMBOBX.TXT TComboBox documentation in ASCII format.
+ TCOMBOBX.WP5 TComboBox documentation in WordPerfect 5.1 format.
+ TCOMBOBX.H TComboBox header file.
+ TCOMBOBX.CPP TComboBox source code.
+ SCOMBOBX.CPP Stream registration code for TComboBox.
+ NMCMBOBX.CPP Name registration code for TComboBox.
+ TCMBOVWR.CPP TComboViewer source code.
+ SCMBOVWR.CPP Stream registration code for TComboViewer.
+ NMCMBOVW.CPP Name registration code for TComboViewer.
+ TCMBOWIN.CPP TComboWindow source code.
+ SCMBOWIN.CPP Stream registration code for TComboWindow.
+ NMCMBOWN.CPP Name registration code for TComboWindow.
+ TSINPUTL.H TStaticInputLine header file.
+ TSINPUTL.CPP TStaticInputLine source code.
+ SSINPUTL.CPP Stream registration code for TStaticInputLine.
+ NMSINPUT.CPP Name registration code for TStaticInputLine.
+ TEST.CPP Example program using TComboBox and TStaticInputLine.
+
+I have added streamability to all classes. I'm not certain that TComboViewer
+or TComboWindow would ever be saved to a stream, since they are not actually
+part of the dialog box, but I added the functionality just in case.
+
+Some additional changes that have been made are:
+ 1) Added the getData, setData, and dataSize functions to TComboBox.
+ This provides the programmer with the additional ability of setting
+ the TComboBox options through a setData call to the dialog box.
+ 2) Added the missing dataSize function to TComboViewer. By not over-
+ ridding this function, a data size of 0 was returned and caused the
+ next object in the dialog box to over-write the TComboViewer record.
+ 3) Added code to highlight the currently selected item when the combo
+ box is opened. This code was provided by Robert Gloeckner.
+ 4) Added code to allow the user to use the Home and End keys in the
+ TStaticInputLine to go to the beginning and end of the list
+ respectively. This code was also provided by Robert Gloeckner.
+
+I welcome comments and suggestions, and hope that this source code proves
+to be useful.
+
+I would also like to say thanks to Robert Gloeckner (100034,3033) for his
+contributions.
+
+Vincent Dentice
+70413,1404
+
diff --git a/tvision/examples/tcombo/rhide.env b/tvision/examples/tcombo/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/tcombo/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/tcombo/scombobx.cpp b/tvision/examples/tcombo/scombobx.cpp
new file mode 100644
index 0000000..ec2f5ad
--- /dev/null
+++ b/tvision/examples/tcombo/scombobx.cpp
@@ -0,0 +1,28 @@
+/*************************************************************************/
+/* */
+/* SCOMBOBX.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* This file contains the stream registration object for the class */
+/* TComboBox. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox classes. */
+/* */
+/*************************************************************************/
+
+
+#define Uses_TComboBox
+#define Uses_TStreamableClass
+#include "tcombobx.h"
+__link( RView )
+
+
+TStreamableClass RComboBox( TComboBox::name,
+ TComboBox::build,
+ __DELTA(TComboBox)
+ );
diff --git a/tvision/examples/tcombo/scombovw.cpp b/tvision/examples/tcombo/scombovw.cpp
new file mode 100644
index 0000000..660909d
--- /dev/null
+++ b/tvision/examples/tcombo/scombovw.cpp
@@ -0,0 +1,29 @@
+/*************************************************************************/
+/* */
+/* SCOMBOVW.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* This file contains the stream registration object for the class */
+/* TComboViewer. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox classes. */
+/* */
+/*************************************************************************/
+
+
+#define Uses_TComboViewer
+#define Uses_TStreamableClass
+#include "tcombobx.h"
+
+__link( RListViewer )
+
+
+TStreamableClass RComboViewer( TComboViewer::name,
+ TComboViewer::build,
+ __DELTA(TComboViewer)
+ );
diff --git a/tvision/examples/tcombo/scombown.cpp b/tvision/examples/tcombo/scombown.cpp
new file mode 100644
index 0000000..b409f2c
--- /dev/null
+++ b/tvision/examples/tcombo/scombown.cpp
@@ -0,0 +1,28 @@
+/*************************************************************************/
+/* */
+/* SCOMBOWN.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* This file contains the stream registration object for the class */
+/* TComboWindow. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox class. */
+/* */
+/*************************************************************************/
+
+
+#define Uses_TComboWindow
+#define Uses_TStreamableClass
+#include "tcombobx.h"
+__link( RWindow )
+
+
+TStreamableClass RComboWindow( TComboWindow::name,
+ TComboWindow::build,
+ __DELTA(TComboWindow)
+ );
diff --git a/tvision/examples/tcombo/ssinputl.cpp b/tvision/examples/tcombo/ssinputl.cpp
new file mode 100644
index 0000000..7a75d90
--- /dev/null
+++ b/tvision/examples/tcombo/ssinputl.cpp
@@ -0,0 +1,28 @@
+/*************************************************************************/
+/* */
+/* SSINPUTL.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* This file contains the stream registration object for the class */
+/* TStaticInputLine. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 11/16/92 VJD 0.2 Added streamability to the TStaticInputLine class */
+/* */
+/*************************************************************************/
+
+
+#define Uses_TStaticInputLine
+#define Uses_TStreamableClass
+#include "tsinputl.h"
+__link( RInputLine )
+
+
+TStreamableClass RStaticInputLine( TStaticInputLine::name,
+ TStaticInputLine::build,
+ __DELTA(TStaticInputLine)
+ );
diff --git a/tvision/examples/tcombo/tcmbovwr.cpp b/tvision/examples/tcombo/tcmbovwr.cpp
new file mode 100644
index 0000000..73d88bf
--- /dev/null
+++ b/tvision/examples/tcombo/tcmbovwr.cpp
@@ -0,0 +1,155 @@
+/*************************************************************************/
+/* */
+/* TCMBOVWR.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* The TComboBox class is an extension to Borland International's Turbo */
+/* Vision Applications Framework for DOS. It provides a class that */
+/* acts like a Combo Box in other graphical environments like Microsoft */
+/* Windows and IBM OS/2. */
+/* */
+/* It is designed to be with a TDialog class and a TCollection Class. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 09/30/92 VJD 0.1 Initial module definition. */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox classes. */
+/* Rewrote header files to behave like original */
+/* Turbo Vision header files. */
+/* 11/17/92 VJD 0.3 Added the missing dataSize function to */
+/* TComboViewer. */
+/* */
+/*************************************************************************/
+
+#define Uses_string
+
+#define Uses_TComboViewer
+#define Uses_TKeys
+#define Uses_TStreamableClass
+#define Uses_TPalette
+#include "tcombobx.h"
+
+#define cpComboViewer "\x06\x06\x07\x06\x06"
+
+struct TComboViewerRec
+{
+ TCollection *items;
+ ushort selection;
+};
+
+
+TComboViewer::TComboViewer(const TRect& bounds, TCollection *aList, TScrollBar *ts) :
+ TListViewer(bounds, 1, 0, ts)
+{
+ list = 0;
+ newList(aList);
+}
+
+
+unsigned TComboViewer::dataSize()
+{
+ return sizeof(TComboViewerRec);
+}
+
+
+TPalette& TComboViewer::getPalette() const
+{
+ static TPalette palette(cpComboViewer, sizeof(cpComboViewer)-1);
+ return palette;
+}
+
+
+void TComboViewer::getData( void * rec )
+{
+ TComboViewerRec *p = (TComboViewerRec *)rec;
+
+ p->items = list;
+ p->selection = focused;
+}
+
+
+void TComboViewer::getText(char *dest, ccIndex item, short maxLen)
+{
+ if (list != 0 ) {
+ strncpy( dest, (const char *)(list->at(item)), maxLen );
+ dest[maxLen] = '\0';
+ }
+ else
+ *dest = EOS;
+}
+
+
+void TComboViewer::handleEvent(TEvent& event)
+{
+ if ((event.what == evMouseDown && event.mouse.doubleClick) ||
+ (event.what == evKeyDown && event.keyDown.keyCode == kbEnter))
+ {
+ endModal(cmOK);
+ clearEvent(event);
+ }
+ else if ((event.what == evKeyDown && event.keyDown.keyCode == kbEsc) ||
+ (event.what == evCommand && event.message.command == cmCancel))
+ {
+ endModal(cmCancel);
+ clearEvent(event);
+ }
+ else
+ TListViewer::handleEvent(event);
+}
+
+
+void TComboViewer::newList( TCollection *aList )
+{
+ if (list)
+ CLY_destroy(list);
+ list = aList;
+ if(aList != 0)
+ setRange(aList->getCount());
+ else
+ setRange(0);
+ if(range > 0)
+ focusItem(0);
+ drawView();
+}
+
+
+void TComboViewer::setData( void *rec )
+{
+ TComboViewerRec *p = (TComboViewerRec *)rec;
+ newList(p->items);
+ focusItem(p->selection);
+ drawView();
+}
+
+
+void TComboViewer::shutDown()
+{
+ list = 0;
+ TListViewer::shutDown();
+}
+
+
+void * TComboViewer::read( ipstream& is )
+{
+ TListViewer::read(is);
+ is >> list;
+ return this;
+}
+
+void TComboViewer::write( opstream& os )
+{
+ TListViewer::write(os);
+ os << list;
+}
+
+
+TStreamable *TComboViewer::build()
+{
+ return new TComboViewer(streamableInit);
+}
+
+
+TComboViewer::TComboViewer(StreamableInit) : TListViewer(streamableInit) { }
diff --git a/tvision/examples/tcombo/tcmbowin.cpp b/tvision/examples/tcombo/tcmbowin.cpp
new file mode 100644
index 0000000..13cc7c3
--- /dev/null
+++ b/tvision/examples/tcombo/tcmbowin.cpp
@@ -0,0 +1,106 @@
+/*************************************************************************/
+/* */
+/* TCMBOWIN.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* The TComboBox class is an extension to Borland International's Turbo */
+/* Vision Applications Framework for DOS. It provides a class that */
+/* acts like a Combo Box in other graphical environments like Microsoft */
+/* Windows and IBM OS/2. */
+/* */
+/* It is designed to be with a TDialog class and a TCollection Class. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 09/30/92 VJD 0.1 Initial module definition. */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox classes. */
+/* */
+/*************************************************************************/
+
+
+#define Uses_TComboWindow
+#define Uses_TScrollBar
+#define Uses_TStreamableClass
+#define Uses_TPalette
+#include "tcombobx.h"
+
+#define cpComboWindow "\x13\x13\x15\x04\x05\x1A\x1C"
+
+
+TComboWindow::TComboWindow(const TRect& bounds, TCollection *aList) :
+ TWindowInit(&TComboWindow::initFrame),
+ TWindow(bounds, 0, wnNoNumber)
+{
+ TRect r;
+ TScrollBar *sb;
+
+ setState(sfShadow, False);
+ flags = 0;
+
+ r = getExtent();
+ r.a.x = r.b.x - 1;
+ sb = new TScrollBar(r);
+ insert(sb);
+
+ r = getExtent();
+ r.b.x--;
+ viewer = new TComboViewer(r, aList, sb);
+ insert(viewer);
+}
+
+
+TPalette& TComboWindow::getPalette() const
+{
+ static TPalette palette (cpComboWindow, sizeof(cpComboWindow)-1);
+ return palette;
+}
+
+
+void TComboWindow::getSelection(char *dest)
+{
+ viewer->getText(dest, viewer->focused, 255);
+}
+
+
+void TComboWindow::handleEvent(TEvent& event)
+{
+ if ((event.what == evMouseDown) && !containsMouse(event)) {
+ endModal(cmCancel);
+ clearEvent(event);
+ }
+ TWindow::handleEvent(event);
+}
+
+
+void TComboWindow::setSelection(const char *data)
+{
+ viewer->focusItem(viewer->list->indexOf((void *)data));
+}
+
+
+void * TComboWindow::read( ipstream& is )
+{
+ TWindow::read(is);
+ is >> viewer;
+ return this;
+}
+
+void TComboWindow::write( opstream& os )
+{
+ TWindow::write(os);
+ os << viewer;
+}
+
+
+TStreamable *TComboWindow::build()
+{
+ return new TComboWindow(streamableInit);
+}
+
+
+TComboWindow::TComboWindow(StreamableInit) : TWindowInit(0),
+ TWindow(streamableInit)
+{}
diff --git a/tvision/examples/tcombo/tcombo.txt b/tvision/examples/tcombo/tcombo.txt
new file mode 100644
index 0000000..e045ed1
--- /dev/null
+++ b/tvision/examples/tcombo/tcombo.txt
@@ -0,0 +1,189 @@
+Introduction
+
+I have seen many requests in the Turbo Vision forum for a Combo Box class
+similar to the one available in Microsoft Windows. Here is a family of
+classes that provide the functionality of the Windows Combo Box.
+
+Combo Box Classes
+
+There are three classes that make up the Combo Box family: TComboBox,
+TComboWindow, and TComboViewer. TComboBox provides the icon in the dialog
+box that represents the whole TComboBox; by clicking on the icon or pressing
+the down arrow while the linked TInputLine is selected, the Combo Box
+selection window becomes active. The selection window is made up of a
+TComboWindow, a TComboViewer, and a TScrollBar. While active, the
+TComboWindow is the modal view; clicking outside of the window area causes
+the TComboWindow to terminate with a cmCancel command.
+
+The TComboBox is only one character wide, so it should be place directly
+after the inputline to which it will be linked. For example:
+
+ tv = new TInputLine(TRect(2,2,20,3), 25);
+ insert(tv);
+ insert(new TComboBox(TRect(20,2,21,3), tv, list));
+
+The TComboWindow automatically sizes itself to be as wide as the inputline
+and the combo box together.
+
+When used with a regular TInputLine, TComboBox acts just like a THistory
+object. However, when used with the TStaticInputLine (also in this zip
+file), TComboBox acts like a Combo Box in Windows, only allowing those items
+already in the list to be selected.
+ Class Descriptions
+
+TComboBox
+
+TComboBox implements a pick listof items for the user to choose. When used
+with a standard TInputLine, it acts very much like a THistory object. If
+used with a TStaticInputLine, only the items which are currently in the list
+can be selected.
+
+Data Members
+char *icon;
+ Points to the character that is used by the draw() function to display
+ the icon on the screen.
+
+TInputLine *link;
+ Points to the related TInputLine, or a descendant of TInputLine. Used
+ to update the TInputLine data member when an item is selected from the
+ list.
+
+TCollection *list;
+ Points to the list of items that are currently available for selection
+ by the user. This list is updated whenever the selected state of link
+ is changed.
+
+Member Functions
+TComboBox(TRect& bounds, TInputLine *aLink, TCollection *aList);
+ Constructs a new TComboBox. If the extent of bounds is greater than a
+ 1 by 1 square, the extent is changed to that size.
+
+virtual ushort dataSize();
+ Returns the size of the data read or written by getData and setData.
+ Currently returns sizeof(void *).
+
+virtual void draw();
+ Draws the character pointed to by icon in the specified color.
+
+virtual void getData(void *rec);
+ Returns a pointer to list in rec.
+
+TPalette& getPalette() const;
+ Returns the defined palette cpComboBox.
+
+virtual void handleEvent(TEvent& event);
+ Handles mouse events and a down arrow key event to open a TComboWindow.
+
+virtual void newList(TCollection *aList);
+ Sets a new list for TComboBox by first deleting the old list and then
+ setting list to aList.
+
+virtual void setData(void *rec);
+ Reads a pointer from rec and assigns it to list.
+
+
+
+void shutDown();
+ Sets link = 0 and list = 0, then calls TView::shutDown(). Deleting the
+ actual TCollection is the responsibility of the program; this provides
+ for a persistent list between calls to the same dialog box.
+ TComboViewer
+
+TComboViewer is a descendant of TListViewer; it provides the actual list
+viewing mechanism for the TComboBox.
+
+Data Members
+TCollection *list;
+ Points to the list of items that are currently available for selection
+ by the user. This list is updated whenever the selected state of link
+ is changed.
+
+Member Functions
+TComboViewer(const TRect& bounds, TCollection *aList, TScrollBar *sb);
+ Constructs a TComboViewer by setting list = aList and calling
+ TListViewer(bounds, 1, 0, sb).
+
+virtual ushort dataSize();
+ Returns the size of the data read and written by getData and setData.
+
+TPalette& getPalette() const;
+ Returns the defined palette cpComboViewer.
+
+virtual void getData(void *data);
+ Accepts data in the format of a TListBoxRec.
+
+virtual void getText(char *dest, short item, short maxLen);
+ Returns the itemth item from list in dest, not copying more than maxLen
+ characters.
+
+virtual void handleEvent(TEvent& event);
+ Checks for keyboard or mouse events that will end the modal view of
+ TComboViewer. All other events are passed on to
+ TListViewer::handleEvent.
+
+virtual void newList(TCollection *aList);
+ Accepts a new list to be displayed, and disposes of the old list.
+
+virtual void setData(void *data);
+ Returns data in the format of a TListBoxRec.
+
+void shutDown();
+ Sets list = 0, then calls TListViewer::shutDown(). Disposing of the
+ list is the responsibility of the programmer.
+ TComboWindow
+
+Data Members
+TComboViewer *viewer;
+ A pointer to the TComboViewer that is a subview of TComboWindow.
+
+Member Functions
+TComboWindow(const TRect& bounds, TCollection *aList);
+ Calls TWindow(bounds, 0, 0), the creates a TComboViewer and a TScrollBar
+ to fit within its bounds. The aList parameter is passed on to
+ TComboViewer.
+
+TPalette& getPalette() const;
+ Returns the defined palette cpComboWindow.
+
+void getSelection(char *dest);
+ Returns in dest the item selected from the list.
+
+virtual void handleEvent(TEvent&);
+ Checks for mouse events outside of the bounds of TComboWindow; all other
+ events are passed on to TWindow::handleEvent.
+
+void setSelection(char *data);
+ Sets the selected item in the list to data.
+ TStaticInputLine
+
+Data Members
+TCollection *list;
+ Points to the list of items that are currently available for selection
+ by the user. This list is updated whenever the selected state of link
+ is changed.
+
+Member Functions
+TStaticInputLine(const TRect& bounds, int maxLen, TCollection *aList);
+ Created a TStaticInputLine by setting list = aList, and calling
+ TInputLine(bounds, maxLen).
+
+virtual void getNextMatch();
+ A replacement for the call to matchFirstChar(). Currently getNextMatch
+ calls matchFirstChar(), but later versions will have an algorithm to
+ provide a circular search queue making TStaticInputLine behave more like
+ Windows.
+
+virtual void handleEvent(TEvent& event);
+ Handles most keyboard events for TStaticInputLine; keyboard events
+ handled include all printable characters, up and down arrow keys. All
+ other events are passed on to TInputLine::handleEvent.
+
+virtual void newList(TCollection *aList);
+ Accepts a new list to be displayed, and disposes of the old list.
+
+
+Boolean matchFirstChar(void *, void *);
+ matchFirstChar is not a member or a friend function of TStaticInputLine,
+ but is called by TStaticInputLine::handleEvent. This function is of
+ type ccTestFunc and is used to test if the first characters of the two
+ items passed are the same. This function is case insensitive.
diff --git a/tvision/examples/tcombo/tcombobx.cpp b/tvision/examples/tcombo/tcombobx.cpp
new file mode 100644
index 0000000..e1d5f29
--- /dev/null
+++ b/tvision/examples/tcombo/tcombobx.cpp
@@ -0,0 +1,177 @@
+/*************************************************************************/
+/* */
+/* TCOMBOBX.CPP */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* The TComboBox class is an extension to Borland International's Turbo */
+/* Vision Applications Framework for DOS. It provides a class that */
+/* acts like a Combo Box in other graphical environments like Microsoft */
+/* Windows and IBM OS/2. */
+/* */
+/* It is designed to be with a TDialog class and a TCollection Class. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 09/30/92 VJD 0.1 Initial module definition. */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox classes. */
+/* Rewrote header files to behave like original */
+/* Turbo Vision header files. */
+/* 11/17/92 VJD 0.3 Added functions dataSize, getData and setData. */
+/* 11/18/92 RG 0.3 Added code to select the correct item when the */
+/* TComboWindow comes up. These code modifications */
+/* where supplied by Robert Gloeckner (100034,3033). */
+/* */
+/*************************************************************************/
+
+#define Uses_string
+
+#define Uses_TComboBox
+#define Uses_TComboWindow
+#define Uses_TKeys
+#define Uses_TStreamableClass
+#define Uses_TPalette
+#include "tcombobx.h"
+
+#define cpComboBox "\x16"
+
+char* TComboBox::icon = "\x19";
+
+
+TComboBox::TComboBox(const TRect& bounds, TInputLine *aLink, TCollection *aList) :
+ TView(bounds)
+{
+ options |= ofPostProcess;
+ eventMask |= evBroadcast;
+ link = aLink;
+ list = aList;
+}
+
+
+void TComboBox::shutDown()
+{
+ link = 0;
+ TView::shutDown();
+}
+
+
+unsigned TComboBox::dataSize()
+{
+ return sizeof(void *);
+}
+
+
+void TComboBox::draw()
+{
+ TDrawBuffer b;
+
+ b.moveStr(0, icon, getColor(0x01));
+ writeLine(0, 0, size.x, size.y, b);
+}
+
+
+void TComboBox::getData(void *rec)
+{
+// TCollection **p = (TCollection **)rec;
+// *p = list;
+ *(TCollection **)rec = list;
+}
+
+
+TPalette& TComboBox::getPalette() const
+{
+ static TPalette palette(cpComboBox, sizeof(cpComboBox)-1);
+ return palette;
+}
+
+
+void TComboBox::handleEvent(TEvent& event)
+{
+ TComboWindow *ComboWindow;
+ TRect r, p;
+ ushort c;
+
+ TView::handleEvent(event);
+ if ((event.what == evMouseDown) ||
+ (event.what == evKeyDown && ctrlToArrow(event.keyDown.keyCode) == kbDown
+ && (link->state & sfFocused) != 0))
+ {
+ if (strlen((const char *)link->getData())) // If length of link->data > 0,
+ list->insert(newStr((const char *)link->getData())); // add new data to list
+ link->select(); // Make InputLine the active view
+ r = link->getBounds(); // Get bounds of the InputLine
+ r.b.x += 1; // Extend x bound by 1
+ r.a.y += 1; // Move bound down by 1
+ r.b.y += 7; // Extend y bound by 7
+ p = owner->getExtent(); // Get extent of the Dialog Box
+ r.intersect(p); // Get intersection of Dialog and r
+ r.b.y -= 1;
+ ComboWindow = new TComboWindow(r, list); // Create a new TComboWindow
+ if (ComboWindow != 0) {
+ if (strlen((const char *)link->getData()))
+ ComboWindow->setSelection((const char *)link->getData());
+
+ c = owner->execView(ComboWindow); // Execute TComboWindow as modal view
+
+ if (c == cmOK) { // If TComboWindow return cmOK
+ char rslt[256];
+
+ ComboWindow->getSelection(rslt); // Set the link data to the selection
+ link->setDataFromStr(rslt);
+ link->selectAll(True); // Select all in the linked view
+ link->drawView(); // Redraw the linked view
+ }
+ CLY_destroy(ComboWindow);
+ }
+ clearEvent(event);
+ }
+ else if (event.what == evBroadcast)
+ if ((event.message.command == cmReleasedFocus && event.message.infoPtr == link)
+ || (event.message.command == cmRecordHistory))
+ if (strlen((const char *)link->getData())) // If length of link->data > 0,
+ list->insert(newStr((const char *)link->getData())); // add new data to list
+}
+
+
+void TComboBox::newList(TCollection *aList)
+{
+ if (list)
+ CLY_destroy(list);
+
+ list = aList;
+}
+
+
+void TComboBox::setData(void *rec)
+{
+ TCollection *p = (TCollection *)rec;
+
+ newList(p);
+}
+
+
+void TComboBox::write(opstream& os)
+{
+ TView::write(os);
+ os << link << list;
+}
+
+
+void *TComboBox::read(ipstream& is)
+{
+ TView::read(is);
+ is >> link >> list;
+
+ return this;
+}
+
+
+TStreamable *TComboBox::build()
+{
+ return new TComboBox(streamableInit);
+}
+
+
+TComboBox::TComboBox(StreamableInit) : TView(streamableInit) { }
diff --git a/tvision/examples/tcombo/tcombobx.h b/tvision/examples/tcombo/tcombobx.h
new file mode 100644
index 0000000..c09eabd
--- /dev/null
+++ b/tvision/examples/tcombo/tcombobx.h
@@ -0,0 +1,207 @@
+/*************************************************************************/
+/* */
+/* TCOMBOBX.H */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* The TComboBox class is an extension to Borland International's Turbo */
+/* Vision Applications Framework for DOS. It provides a class that */
+/* acts like a Combo Box in other graphical environments like Microsoft */
+/* Windows and IBM OS/2. */
+/* */
+/* It is designed to be with a TDialog class and a TCollection Class. */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 09/30/92 VJD 0.1 Initial module definition. */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox classes. */
+/* Rewrote header files to behave like original */
+/* Turbo Vision header files. */
+/* 11/17/92 VJD 0.3 Added getData and setData functions to TComboBox, */
+/* and also added the missing dataSize function to */
+/* TComboViewer. */
+/* */
+/*************************************************************************/
+
+#if defined( Uses_TComboBox )
+#define Uses_TCollection
+#define Uses_TInputLine
+#define Uses_TView
+#endif
+
+#if defined( Uses_TComboWindow )
+#define Uses_TComboViewer
+#define Uses_TWindow
+#endif
+
+#if defined( Uses_TComboViewer )
+#define Uses_TCollection
+#define Uses_TEvent
+#define Uses_TListViewer
+#endif
+
+#if defined( Uses_TCollection ) && !defined( __TCollection )
+#define INCLUDE_TV_H
+#endif
+
+#if defined( Uses_TEvent ) && !defined( __TEvent)
+#define INCLUDE_TV_H
+#endif
+
+#if defined( Uses_TInputLine ) && !defined( __TInputLine )
+#define INCLUDE_TV_H
+#endif
+
+#if defined( Uses_TListViewer ) && !defined( __TListViewer )
+#define INCLUDE_TV_H
+#endif
+
+#if defined( Uses_TView ) && !defined( __TView )
+#define INCLUDE_TV_H
+#endif
+
+#if defined( Uses_TWindow ) && !defined( __TWindow )
+#define INCLUDE_TV_H
+#endif
+
+#if defined( INCLUDE_TV_H )
+#include <tv.h>
+#endif
+
+
+#if defined( Uses_TComboBox ) && !defined( __TComboBox )
+#define __TComboBox
+
+class TComboBox : public TView {
+ protected:
+ static char *icon;
+ TInputLine *link;
+ TCollection *list;
+
+ public:
+ TComboBox(const TRect&, TInputLine *, TCollection *);
+
+ virtual unsigned dataSize();
+ virtual void draw();
+ virtual void getData(void *);
+ TPalette& getPalette() const;
+ virtual void handleEvent(TEvent&);
+ virtual void newList(TCollection *);
+ virtual void setData(void *);
+ void shutDown();
+
+ private:
+ virtual const char *streamableName() const
+ { return name; }
+
+ protected:
+ TComboBox(StreamableInit);
+ virtual void write(opstream&);
+ virtual void *read(ipstream&);
+
+ public:
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TComboBox& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TComboBox*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TComboBox& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TComboBox* cl )
+ { return os << (TStreamable *)cl; }
+
+#endif
+
+
+
+#if defined( Uses_TComboViewer ) && !defined( __TComboViewer )
+#define __TComboViewer
+
+class TComboViewer : public TListViewer {
+ public:
+ TCollection *list;
+
+ TComboViewer(const TRect&, TCollection*, TScrollBar*);
+
+ virtual unsigned dataSize();
+ TPalette& getPalette() const;
+ virtual void getData(void *);
+ virtual void getText(char *, ccIndex, short);
+ virtual void handleEvent(TEvent&);
+ virtual void newList(TCollection *);
+ virtual void setData(void *);
+ void shutDown();
+
+ private:
+ virtual const char *streamableName() const
+ { return name; }
+
+ protected:
+ TComboViewer(StreamableInit);
+ virtual void write(opstream&);
+ virtual void *read(ipstream&);
+
+ public:
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TComboViewer& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TComboViewer*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TComboViewer& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TComboViewer* cl )
+ { return os << (TStreamable *)cl; }
+
+#endif
+
+
+#if defined( Uses_TComboWindow ) && !defined( __TComboWindow )
+#define __TComboWindow
+
+class TComboWindow : public TWindow {
+ protected:
+ TComboViewer *viewer;
+
+ public:
+ TComboWindow(const TRect&, TCollection*);
+
+ TPalette& getPalette() const;
+ void getSelection(char *);
+ virtual void handleEvent(TEvent&);
+ void setSelection(const char *);
+
+ private:
+ virtual const char *streamableName() const
+ { return name; }
+
+ protected:
+ TComboWindow(StreamableInit);
+ virtual void write(opstream&);
+ virtual void *read(ipstream&);
+
+ public:
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TComboWindow& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TComboWindow*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TComboWindow& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TComboWindow* cl )
+ { return os << (TStreamable *)cl; }
+
+#endif
diff --git a/tvision/examples/tcombo/test.bmk b/tvision/examples/tcombo/test.bmk
new file mode 100644
index 0000000..7d27d57
--- /dev/null
+++ b/tvision/examples/tcombo/test.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: test.exe
+!include ../../makes/common.bmk
+!include test.umk
+
diff --git a/tvision/examples/tcombo/test.cpp b/tvision/examples/tcombo/test.cpp
new file mode 100644
index 0000000..12b1b83
--- /dev/null
+++ b/tvision/examples/tcombo/test.cpp
@@ -0,0 +1,140 @@
+/*************************************************************************/
+/* */
+/* Test program file for TComboBox and TStaticInputLine classes. */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/*************************************************************************/
+
+#define Uses_ifpstream
+#define Uses_ofpstream
+#define Uses_TApplication
+#define Uses_TButton
+#define Uses_TDeskTop
+#define Uses_TDialog
+#define Uses_TEvent
+#define Uses_TInputLine
+#define Uses_TKeys
+#define Uses_TMenuBar
+#define Uses_TMenuItem
+#define Uses_TRect
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TStringCollection
+#define Uses_TSubMenu
+#include <tv.h>
+
+#define Uses_TComboBox
+#define Uses_TStaticInputLine
+#include "tcombobx.h"
+#include "tsinputl.h"
+
+const int cmNewDialog = 200; // assign new command values
+
+
+class TMyApp : public TApplication {
+ public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void newDialog();
+};
+
+//static short winNumber = 0; // initialize window number
+
+
+TMyApp::TMyApp() : TProgInit(&TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop)
+{
+}
+
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ );
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~D~ialog", cmNewDialog, kbF3, hcNoContext, "F3" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )
+ );
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event); // act like base!
+ if(event.what == evCommand) {
+ switch(event.message.command) {
+ case cmNewDialog: // but respond to additional commands
+ newDialog(); // define action for cmMyNewWin
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+void TMyApp::newDialog()
+{
+ TDialog *pd;
+ TInputLine *tv;
+ TStringCollection *list;
+ struct {
+ char line1[128];
+ TCollection *list1;
+ char line2[128];
+ TCollection *list2;
+ } data;
+
+ list = new TStringCollection(5,2);
+
+ list->insert(newStr("Test 1"));
+ list->insert(newStr("Test 2"));
+
+ TRect r(2,1,27,10);
+
+ pd = new TDialog(r, "Test Dialog");
+ if (pd) {
+ tv = new TInputLine(TRect(2,1,20,2), 128);
+ pd->insert(tv);
+ pd->insert(new TComboBox(TRect(20,1,21,2), tv, list));
+
+ tv = new TStaticInputLine(TRect(2,3,20,4), 128, list);
+ pd->insert(tv);
+ pd->insert(new TComboBox(TRect(20,3,21,4), tv, list));
+
+ pd->insert(new TButton(TRect( 1,6,11,8), "~O~K", cmOK, bfDefault));
+ pd->insert(new TButton(TRect(12,6,22,8), "Cancel", cmCancel, bfNormal));
+ }
+
+ pd->selectNext(False);
+ deskTop->execView(pd);
+
+ pd->getData(&data);
+
+ CLY_destroy(pd);
+ CLY_destroy(list);
+}
+
+int main()
+{
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/tcombo/test.gpr b/tvision/examples/tcombo/test.gpr
new file mode 100644
index 0000000..4b88fea
--- /dev/null
+++ b/tvision/examples/tcombo/test.gpr
Binary files differ
diff --git a/tvision/examples/tcombo/test.mkf b/tvision/examples/tcombo/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/tcombo/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/tcombo/test.umk b/tvision/examples/tcombo/test.umk
new file mode 100644
index 0000000..f6b1a06
--- /dev/null
+++ b/tvision/examples/tcombo/test.umk
@@ -0,0 +1,77 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./nmcmbobx$(ExOBJ) \
+ ./nmcmbovw$(ExOBJ) \
+ ./nmcmbown$(ExOBJ) \
+ ./nmsinput$(ExOBJ) \
+ ./scombobx$(ExOBJ) \
+ ./scombovw$(ExOBJ) \
+ ./scombown$(ExOBJ) \
+ ./ssinputl$(ExOBJ) \
+ ./tcmbovwr$(ExOBJ) \
+ ./tcmbowin$(ExOBJ) \
+ ./tcombobx$(ExOBJ) \
+ ./test$(ExOBJ) \
+ ./tsinputl$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./nmcmbobx$(ExOBJ) \
+ ./nmcmbovw$(ExOBJ) \
+ ./nmcmbown$(ExOBJ) \
+ ./nmsinput$(ExOBJ) \
+ ./scombobx$(ExOBJ) \
+ ./scombovw$(ExOBJ) \
+ ./scombown$(ExOBJ) \
+ ./ssinputl$(ExOBJ) \
+ ./tcmbovwr$(ExOBJ) \
+ ./tcmbowin$(ExOBJ) \
+ ./tcombobx$(ExOBJ) \
+ ./test$(ExOBJ) \
+ ./tsinputl$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./nmcmbobx$(ExOBJ):: nmcmbobx.cpp
+ $(RHIDE_COMPILE_CC)
+
+./nmcmbovw$(ExOBJ):: nmcmbovw.cpp
+ $(RHIDE_COMPILE_CC)
+
+./nmcmbown$(ExOBJ):: nmcmbown.cpp
+ $(RHIDE_COMPILE_CC)
+
+./nmsinput$(ExOBJ):: nmsinput.cpp
+ $(RHIDE_COMPILE_CC)
+
+./scombobx$(ExOBJ):: scombobx.cpp
+ $(RHIDE_COMPILE_CC)
+
+./scombovw$(ExOBJ):: scombovw.cpp
+ $(RHIDE_COMPILE_CC)
+
+./scombown$(ExOBJ):: scombown.cpp
+ $(RHIDE_COMPILE_CC)
+
+./ssinputl$(ExOBJ):: ssinputl.cpp
+ $(RHIDE_COMPILE_CC)
+
+./tcmbovwr$(ExOBJ):: tcmbovwr.cpp
+ $(RHIDE_COMPILE_CC)
+
+./tcmbowin$(ExOBJ):: tcmbowin.cpp
+ $(RHIDE_COMPILE_CC)
+
+./tcombobx$(ExOBJ):: tcombobx.cpp
+ $(RHIDE_COMPILE_CC)
+
+./test$(ExOBJ):: test.cpp
+ $(RHIDE_COMPILE_CC)
+
+./tsinputl$(ExOBJ):: tsinputl.cpp
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tcombo/tsinputl.cpp b/tvision/examples/tcombo/tsinputl.cpp
new file mode 100644
index 0000000..cf0725b
--- /dev/null
+++ b/tvision/examples/tcombo/tsinputl.cpp
@@ -0,0 +1,158 @@
+/*************************************************************************/
+/* */
+/* TSINPUTL.H */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 09/30/92 VJD 0.1 Initial module definition. */
+/* 11/16/92 VJD 0.2 Added streamability to TStaticInputLine class. */
+/* 11/17/92 VJD 0.3 Replaced matchFirstChar() function with member */
+/* function getNextMatch(). */
+/* 11/17/92 RG 0.3 Added functionality to jump to the beginning and */
+/* end of the list by using the HOME and END keys. */
+/* This code was supplied by Robert Gloeckner */
+/* (100034,3033). */
+/* */
+/*************************************************************************/
+
+#include <ctype.h>
+#define Uses_string
+
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TStaticInputLine
+#define Uses_TStreamableClass
+#include "tsinputl.h"
+
+Boolean matchFirstChar(void *, void *);
+
+
+TStaticInputLine::TStaticInputLine(const TRect& bounds, int aMaxLen, TCollection *aList) :
+ TInputLine(bounds, aMaxLen)
+{
+ list = aList;
+}
+
+
+void *TStaticInputLine::getNextMatch(char testChar)
+{
+ return (char *)list->firstThat(matchFirstChar, &testChar);
+}
+
+
+void TStaticInputLine::handleEvent(TEvent& event)
+{
+ char testChar[2];
+ char *tempData;
+ ccIndex index;
+
+ if (event.what == evKeyDown) {
+ if (isprint(event.keyDown.charScan.charCode)) {
+ testChar[0] = event.keyDown.charScan.charCode;
+ testChar[1] = '\0';
+ tempData = (char *)getNextMatch(testChar[0]);
+ if (tempData != 0) {
+ strcpy(data, tempData);
+ selectAll(True);
+ drawView();
+ }
+ clearEvent(event);
+ }
+ else
+ switch (event.keyDown.keyCode) {
+ case kbUp :
+ index = list->indexOf(data) - 1;
+ if (index < 0)
+ index = list->getCount() - 1;
+ strcpy(data, (char *)list->at(index));
+ selectAll(True);
+ drawView();
+ clearEvent(event);
+ break;
+
+ case kbDown :
+ index = list->indexOf(data) + 1;
+ if (index >= list->getCount())
+ index = 0;
+ strcpy(data, (char *)list->at(index));
+ selectAll(True);
+ drawView();
+ clearEvent(event);
+ break;
+
+ case kbHome:
+ index = 0;
+ strcpy(data, (char *)list->at(index));
+ selectAll(True);
+ drawView();
+ clearEvent(event);
+ break;
+
+ case kbEnd:
+ index = list->getCount() - 1;
+ strcpy(data, (char *)list->at(index));
+ selectAll(True);
+ drawView();
+ clearEvent(event);
+ break;
+
+ case kbLeft :
+ case kbRight :
+ case kbBack :
+ case kbIns :
+ case kbDel : clearEvent(event);
+ }
+ }
+ TInputLine::handleEvent(event);
+}
+
+
+void TStaticInputLine::newList(TCollection *aList)
+{
+ if (list)
+ CLY_destroy(list);
+ list = aList;
+ drawView();
+}
+
+
+void *TStaticInputLine::read( ipstream& is )
+{
+ TInputLine::read(is);
+ is >> list;
+ return this;
+}
+
+
+void TStaticInputLine::write( opstream& os )
+{
+ TInputLine::write(os);
+ os << list;
+}
+
+TStreamable *TStaticInputLine::build()
+{
+ return new TStaticInputLine(streamableInit);
+}
+
+
+TStaticInputLine::TStaticInputLine(StreamableInit) : TInputLine(streamableInit) { }
+
+
+
+Boolean matchFirstChar(void *string1, void *string2)
+{
+ char *temp1, *temp2;
+
+ temp1 = (char *)string1;
+ temp2 = (char *)string2;
+
+ if (toupper(temp1[0]) == toupper(temp2[0]))
+ return True;
+ else
+ return False;
+}
diff --git a/tvision/examples/tcombo/tsinputl.h b/tvision/examples/tcombo/tsinputl.h
new file mode 100644
index 0000000..0ffdbfa
--- /dev/null
+++ b/tvision/examples/tcombo/tsinputl.h
@@ -0,0 +1,54 @@
+/*************************************************************************/
+/* */
+/* TSINPUTL.H */
+/* */
+/* Copyright (c) 1992, Vincent J. Dentice */
+/* All rights reserved */
+/* */
+/* */
+/* Date Prg Ver Description */
+/* -------- --- --- ------------------------------------------------- */
+/* 09/30/92 VJD 0.1 Initial module definition. */
+/* 11/16/92 VJD 0.2 Added streamability to the TComboBox classes. */
+/* Rewrote header files to behave like original */
+/* Turbo Vision header files. */
+/* */
+/*************************************************************************/
+
+#define Uses_TCollection
+#define Uses_TInputLine
+#include <tv.h>
+
+
+#if defined( Uses_TStaticInputLine ) && !defined( __TStaticInputLine )
+#define __TStaticInputLine
+
+
+class TStaticInputLine : public TInputLine {
+ protected:
+ TCollection *list;
+
+ void *getNextMatch(char);
+
+ public:
+ TStaticInputLine(const TRect&, int, TCollection *aList);
+
+ virtual void handleEvent(TEvent& event);
+ virtual void newList(TCollection *aList);
+
+ private:
+ virtual const char *streamableName() const
+ { return name; }
+
+ protected:
+ TStaticInputLine(StreamableInit);
+ virtual void write(opstream&);
+ virtual void *read(ipstream&);
+
+ public:
+ static const char * const name;
+ static TStreamable *build();
+};
+
+
+#endif
diff --git a/tvision/examples/terminal/rhide.env b/tvision/examples/terminal/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/terminal/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/terminal/terminal.cc b/tvision/examples/terminal/terminal.cc
new file mode 100644
index 0000000..a7efc47
--- /dev/null
+++ b/tvision/examples/terminal/terminal.cc
@@ -0,0 +1,115 @@
+/**[txh]********************************************************************
+
+ Description:
+ That's a small example on how to use the TTerminal class. I wrote it
+because Andris found a bug in the Robert's port (was in the prevLine,
+Robert translated it from assembler in the wrong way).
+
+ Copyright (c) 1999 by Salvador E. Tropea
+
+ This file is provided as an example nothing else. As all files needs a
+disclaimer y choose to use the GPL license for this file. So use it under
+the terms of the GPL license.
+
+***************************************************************************/
+
+#define Uses_TApplication
+#define Uses_TEvent
+#define Uses_TDialog
+#define Uses_TScrollBar
+#define Uses_TTerminal
+#define Uses_TButton
+#define Uses_TDeskTop
+#include <tv.h>
+
+#include <tv/configtv.h>
+// The SSC code doesn't support as much as needed for it.
+#ifndef HAVE_SSC
+
+class TMyApp : public TApplication
+{
+public:
+ TMyApp();
+ virtual void handleEvent(TEvent &event);
+ void Test();
+};
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+const int cmAbout=0x1000;
+
+void TMyApp::handleEvent( TEvent &event )
+{
+ TApplication::handleEvent(event);
+
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmAbout:
+ Test();
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+class TestDialog : public TDialog
+{
+public:
+ TestDialog();
+};
+
+TestDialog::TestDialog() :
+ TWindowInit(&TestDialog::initFrame),
+ TDialog(TRect(0,0,60,18),"Dumb terminal")
+{
+ options |= ofCentered;
+
+ TScrollBar *hsb=new TScrollBar(TRect(58,1,59,13));
+ TScrollBar *vsb=new TScrollBar(TRect(1,13,58,14));
+ insert(hsb);
+ insert(vsb);
+ TTerminal *tt=new TTerminal(TRect(1,1,57,12),hsb,vsb,4096);
+ tt->do_sputn("Hello!\nThat's just a test in the buffer.\nThat's all falks.",58);
+ //tt->do_sputn("Hello!\r\nThat's just a test in the buffer.\r\nThat's all falks.",60);
+ insert(tt);
+ insert(new TButton(TRect(25,15,35,17),"O~K~",cmOK,bfNormal));
+
+ selectNext(False);
+}
+
+void TMyApp::Test()
+{
+ TestDialog *d=new TestDialog;
+ deskTop->execView(d);
+ CLY_destroy(d);
+}
+
+int main()
+{
+ TEvent init;
+ init.what=evCommand;
+ init.message.command=cmAbout;
+
+ TMyApp myApp;
+ myApp.putEvent(init);
+ myApp.run();
+ return 0;
+}
+
+#else
+
+int main()
+{
+ fprintf (stderr, "Sorry: The SSC code doesn't support as much as needed for it.\n");
+}
+
+#endif
diff --git a/tvision/examples/terminal/test.bmk b/tvision/examples/terminal/test.bmk
new file mode 100644
index 0000000..7d27d57
--- /dev/null
+++ b/tvision/examples/terminal/test.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: test.exe
+!include ../../makes/common.bmk
+!include test.umk
+
diff --git a/tvision/examples/terminal/test.gpr b/tvision/examples/terminal/test.gpr
new file mode 100644
index 0000000..4f7df22
--- /dev/null
+++ b/tvision/examples/terminal/test.gpr
Binary files differ
diff --git a/tvision/examples/terminal/test.mkf b/tvision/examples/terminal/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/terminal/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/terminal/test.umk b/tvision/examples/terminal/test.umk
new file mode 100644
index 0000000..db3bf23
--- /dev/null
+++ b/tvision/examples/terminal/test.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./terminal$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./terminal$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./terminal$(ExOBJ):: terminal.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tprogb/calc.cpp b/tvision/examples/tprogb/calc.cpp
new file mode 100644
index 0000000..be1d32d
--- /dev/null
+++ b/tvision/examples/tprogb/calc.cpp
@@ -0,0 +1,215 @@
+// This is an example of a progress bar.
+//
+// Modified THERMO.ZIP in the C++ lib to work with TURBO VISION
+// and fixed a small bug.
+//
+// Author: Jay Perez.
+#define Uses_unistd
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_ctype
+
+#define Uses_TBackground
+#define Uses_TListBox
+#define Uses_TMenu
+#define Uses_TMenuBar
+#define Uses_TMenuItem
+#define Uses_TScrollBar
+#define Uses_TStaticText
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TStatusLine
+#define Uses_TStringCollection
+#define Uses_MsgBox
+#define Uses_TEventQueue
+#define Uses_TApplication
+#define Uses_TRect
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TDialog
+#define Uses_TButton
+#define Uses_StaticText
+#define Uses_TSItem
+#define Uses_TLabel
+#define Uses_TInputLine
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_string
+
+#include <tv.h>
+__link( RView )
+__link( RDialog )
+__link( RButton )
+
+#include "tprogbar.h"
+
+const int sampleIterations = 21 ;
+
+const int cmAboutCmd = 100; // User selected menu item 'About'
+const int cmStatusCmd = 101; // User selected menu item 'Progress Bar'
+
+
+//========================================================================
+
+class myProgress : public TProgressBar
+{
+ public :
+ myProgress(const TRect& r, unsigned long iters ) :
+ TProgressBar( r , iters ){};
+ virtual void mainProcess( void );
+};
+
+myProgress *bar ;
+
+//========================================================================
+
+class TMyApplication : public TApplication
+{
+ public:
+ TMyApplication();
+ static TMenuBar *initMenuBar(TRect);
+ void handleEvent(TEvent &);
+ private:
+ void aboutDlg();
+ void statusDlg();
+};
+
+//========================================================================
+
+TMyApplication::TMyApplication() :
+TProgInit(&TApplication::initStatusLine,&TMyApplication::initMenuBar,
+ &TApplication::initDeskTop)
+{
+}
+
+//========================================================================
+
+TMenuBar *TMyApplication::initMenuBar(TRect bounds)
+{
+ bounds.b.y = bounds.a.y + 1;
+ return(new TMenuBar(bounds,
+ new TMenu(
+ *new TMenuItem("~A~bout",cmAboutCmd,kbAltA,hcNoContext,0,
+ new TMenuItem("~P~rogress Bar",cmStatusCmd,kbAltL,hcNoContext,0)))));
+}
+
+//========================================================================
+
+void TMyApplication::handleEvent(TEvent &event)
+{
+ TApplication::handleEvent(event);
+
+ if (event.what == evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmAboutCmd:
+ {
+ aboutDlg();
+ clearEvent(event);
+ break;
+ }
+ case cmStatusCmd:
+ {
+ statusDlg();
+ clearEvent(event);
+ break;
+ }
+ }
+ }
+}
+
+//========================================================================
+
+void TMyApplication::aboutDlg()
+{
+ TDialog *pd = new TDialog(TRect(0,0,35,12),"About");
+ if (pd)
+ {
+ pd->options |= ofCentered;
+ pd->insert(new TStaticText(TRect(1,2,34,7),
+ "\003Turbo Vision Example\n\003\n"
+ "\003Creating a Progress Bar\n\003\n"));
+ pd->insert(new TButton(TRect(3,9,32,11),"~O~k",cmOK,bfDefault));
+
+ if (validView(pd) != 0)
+ {
+ deskTop->execView(pd);
+
+ CLY_destroy(pd);
+ }
+ }
+}
+
+//========================================================================
+
+void TMyApplication::statusDlg()
+{
+ TView *tv;
+
+ TDialog *pd = new TDialog( TRect( 10, 3, 69, 11 ), "Please Wait" ) ;
+ if (pd) {
+
+ pd->options |= ofFirstClick;
+ pd->options |= ofCentered;
+
+ TRect r = TRect(4,4,25,6) ;
+ tv = new TButton(r, "~S~tart", cmOK, bfNormal | bfBroadcast ) ;
+ tv->options &= ~ofSelectable;
+ pd->insert( tv );
+
+ r = TRect(34,4,55,6) ;
+ tv = new TButton( r, "~C~ancel", cmCancel, bfNormal);
+ pd->insert( tv );
+
+ bar = new myProgress( TRect( 4, 2, 55, 3 ), 0 ) ;
+
+ pd->insert( ( TView * ) bar ) ;
+
+ if( TProgram::application->validView( pd ) != 0 ) { // If it's valid...
+ TProgram::deskTop->execView( pd ) ;
+ TObject::CLY_destroy( pd ) ;
+ }
+ }
+ return ;
+}
+
+//========================================================================
+
+int main(void)
+{
+ TMyApplication myApplication;
+
+ myApplication.run();
+
+ return 0;
+}
+
+//========================================================================
+
+void myProgress::mainProcess( void )
+{
+
+ // Place your processing logic here...
+
+ unsigned long cnt = 0 ;
+
+ setMaxIter( sampleIterations ) ; // set maximum number of iterations...
+ // do it here or on the constructor ...
+ // or both.
+
+ for( int x = 0; x < sampleIterations; x++ )
+ {
+ setCurIter( ++cnt ); // set the current iteration count & update
+ usleep(500000);
+ }
+
+ usleep(500000);
+ message(owner,evCommand,cmOK,this);// close dialog box
+}
+
+//========================================================================
diff --git a/tvision/examples/tprogb/rhide.env b/tvision/examples/tprogb/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/tprogb/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/tprogb/test.bmk b/tvision/examples/tprogb/test.bmk
new file mode 100644
index 0000000..7d27d57
--- /dev/null
+++ b/tvision/examples/tprogb/test.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: test.exe
+!include ../../makes/common.bmk
+!include test.umk
+
diff --git a/tvision/examples/tprogb/test.gpr b/tvision/examples/tprogb/test.gpr
new file mode 100644
index 0000000..facb8d5
--- /dev/null
+++ b/tvision/examples/tprogb/test.gpr
Binary files differ
diff --git a/tvision/examples/tprogb/test.mkf b/tvision/examples/tprogb/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/tprogb/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/tprogb/test.umk b/tvision/examples/tprogb/test.umk
new file mode 100644
index 0000000..e3cd887
--- /dev/null
+++ b/tvision/examples/tprogb/test.umk
@@ -0,0 +1,22 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./calc$(ExOBJ) \
+ ./tprogbar$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./calc$(ExOBJ) \
+ ./tprogbar$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./calc$(ExOBJ):: calc.cpp
+ $(RHIDE_COMPILE_CC)
+
+./tprogbar$(ExOBJ):: tprogbar.cpp
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tprogb/tprogbar.cpp b/tvision/examples/tprogb/tprogbar.cpp
new file mode 100644
index 0000000..4f3a9d5
--- /dev/null
+++ b/tvision/examples/tprogb/tprogbar.cpp
@@ -0,0 +1,186 @@
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_unistd
+
+#define Uses_string
+#define Uses_TStaticText
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TStatusLine
+#define Uses_TEventQueue
+#define Uses_TRect
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TDialog
+#define Uses_TButton
+#define Uses_StaticText
+#define Uses_TSItem
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+
+#include <tv.h>
+__link( RView )
+__link( RDialog )
+__link( RButton )
+
+#include "tprogbar.h"
+
+const int sampleIterations = 21 ;
+
+
+TProgressBar::TProgressBar(const TRect& r, unsigned long iters ) : TView ( r )
+{
+ options |= ofSelectable;
+ eventMask = (evKeyboard | evBroadcast);
+ maxWidth = DISPLAYLEN ;//- 1 ; // newWidth; // maximum width of thermometer bar
+ curWidth = 0; // current width of percentage bar
+ oldWidth = 0; // old width of percentage bar
+ chPercent = 100.0/maxWidth; // percent per character
+ maxIter = iters ; // maximum iteration
+ curIter = 0; // current iteration
+ oldPercent = 0; // old percentage
+ curPercent = 0; // current percentage
+ backChar = '°'; // background character
+ percChar = '²'; // foreground character
+ bar = new char[ maxWidth + 1];
+ memset( bar, backChar, maxWidth );
+ bar[ maxWidth ] = '\0';
+}
+
+TProgressBar::~TProgressBar()
+{
+ delete bar ;
+}
+
+void TProgressBar::handleEvent(TEvent& event)
+{
+ TView::handleEvent(event);
+
+ switch(event.what)
+ {
+ case evKeyboard:
+ mainProcess() ;
+ break;
+ case evBroadcast:
+ if(event.message.command == cmOK)
+ mainProcess() ;
+ break;
+ }
+ clearEvent(event);
+}
+
+void TProgressBar::draw()
+{
+ char color = getColor(1);
+ TDrawBuffer nbuf;
+
+ nbuf.moveChar(0,' ',color,size.x);
+
+ nbuf.moveStr( 0, bar, color ) ;
+
+ writeLine(0, 0, size.x, 1, nbuf);
+}
+
+void TProgressBar::mainProcess( void )
+{
+ unsigned long cnt = 0 ;
+ for( int x = 0; x < sampleIterations; x++ )
+ {
+ setCurIter( ++cnt ); // set the current iteration count & update
+ usleep(500000);
+ }
+ usleep(500000);
+ message(owner,evCommand,cmOK,this);// close dialog box
+}
+
+void TProgressBar::calcPercent ( )
+{
+ unsigned int percent;
+ unsigned int width;
+ unsigned i;
+
+ // calculate the new percentage
+ percent = (int) ( ( (double)curIter / (double)maxIter ) * (double)100 );
+
+ // percentage change?
+ if ( percent != curPercent )
+ {
+ oldPercent = curPercent; // save current percentage
+ curPercent = percent; // save new percentage
+ width = (int)(curPercent / chPercent);// calculate percentage bar width
+
+ // width change?
+ if ( width != curWidth )
+ {
+ oldWidth = curWidth; // save the current width
+ curWidth = width; // save new width
+
+ // update the bar string
+ if ( oldWidth < curWidth )
+ {
+ for ( i = oldWidth; i < curWidth; i++ )
+ {
+ bar[i] = percChar;
+ }
+ }
+ else
+ {
+ for ( i = curWidth; i < oldWidth; i++ )
+ {
+ bar[i] = backChar;
+ }
+ }
+ }
+ }
+}
+
+// terminate the thermometer bar display
+void TProgressBar::term ( )
+{
+}
+
+// return the maximum iteration
+unsigned long TProgressBar::getMaxIter ( )
+{
+ return ( maxIter );
+}
+
+// return the current iteration
+unsigned long TProgressBar::getCurIter ( )
+{
+ return ( curIter );
+}
+
+// set a new maximum iteration & update display
+void TProgressBar::setMaxIter ( unsigned long newMax )
+{
+ unsigned long tmp = maxIter;
+ maxIter = newMax;
+ memset( bar, backChar, maxWidth );
+ curWidth = 0; // current width of percentage bar
+ oldWidth = 0; // old width of percentage bar
+ curIter = 0; // current iteration
+ oldPercent = 0; // old percentage
+ curPercent = 0; // current percentage
+ if ( tmp ) // since it starts with 0, only update if changing
+ {
+ drawView(); // update the thermometer bar display
+ }
+}
+
+// set a new current iteration & update display
+void TProgressBar::setCurIter ( unsigned long newCur )
+{
+ curIter = newCur;
+
+ calcPercent();
+
+ // width change?
+ if ( curPercent != oldPercent )
+ {
+ drawView(); // paint the thermometer bar
+ }
+}
diff --git a/tvision/examples/tprogb/tprogbar.h b/tvision/examples/tprogb/tprogbar.h
new file mode 100644
index 0000000..804b87e
--- /dev/null
+++ b/tvision/examples/tprogb/tprogbar.h
@@ -0,0 +1,57 @@
+#if !defined( __TPROGBAR_H )
+#define __TPROGBAR_H
+
+#if !defined( __MATH_H )
+#include <math.h>
+#endif // __MATH_H
+
+#define DISPLAYLEN 51 // Length (width) of calculator display
+
+enum TCalcState { csFirst = 1, csValid, csError };
+
+const int cmCalcButton = 200;
+
+class TProgressBar : public TView
+{
+ protected:
+ char backChar; // background character
+ char percChar; // percentage character
+ char * bar; // thermometer bar
+ unsigned int maxWidth; // maximum width of thermometer bar
+ unsigned int oldWidth; // previous width
+ unsigned int curWidth; // current width of percentage bar
+ double chPercent; // percent per character
+ unsigned long maxIter; // maximum iteration
+ unsigned long curIter; // current iteration
+ unsigned int oldPercent; // old percentage complete
+ unsigned int curPercent; // current percentage complete
+
+ void calcPercent ( ); // calculate new percentage
+
+public:
+ TProgressBar(const TRect& r, unsigned long iters );
+ ~TProgressBar();
+ virtual void handleEvent(TEvent& event);
+ virtual void draw();
+ virtual void term ( ); // clear the thermometer bar display
+
+ inline unsigned long getMaxIter ( ); // get the maximum iteration
+ inline unsigned long getCurIter ( ); // get the current iteration
+
+ // change the percentage ( calls the update function )
+ void setMaxIter ( unsigned long newMax ); // set the maximum iteration
+ void setCurIter ( unsigned long newCur ); // set the current iteration
+private:
+ TCalcState status;
+ virtual void mainProcess( void );
+};
+
+#endif // __TPROGBAR_H
+/*
+class spreadIt : public TProgressBar
+{
+ spreadIt(TRect& r, unsigned long iters ) :
+ TProgressBar( r , iters ){};
+ virtual void mainProcess( void );
+};
+*/
diff --git a/tvision/examples/tutorial/rhide.env b/tvision/examples/tutorial/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/tutorial/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/tutorial/tvguid01.bmk b/tvision/examples/tutorial/tvguid01.bmk
new file mode 100644
index 0000000..9c4af67
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid01.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid01.exe
+!include ../../makes/common.bmk
+!include tvguid01.umk
diff --git a/tvision/examples/tutorial/tvguid01.cc b/tvision/examples/tutorial/tvguid01.cc
new file mode 100644
index 0000000..427b013
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid01.cc
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID01 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ That's the minimal TVision application.
+*/
+
+#define Uses_TApplication
+#include <tv.h>
+
+// tv.h will pull in the headers needed for TApplication and its
+// base classes. Add a #define Uses_Txxx statement (before the
+// #include <tv.h> line) for each Turbo Vision class used in
+// your program. Explicit or implied duplications are harmless:
+// for example, #define Uses_TProgram would be redundant here,
+// but harmless.
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+
+};
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+int main()
+{
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid01.gpr b/tvision/examples/tutorial/tvguid01.gpr
new file mode 100644
index 0000000..8e6dc1b
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid01.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid01.mkf b/tvision/examples/tutorial/tvguid01.mkf
new file mode 100644
index 0000000..ddd68b2
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid01.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid01$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid01.umk b/tvision/examples/tutorial/tvguid01.umk
new file mode 100644
index 0000000..92a0827
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid01.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid01$(ExOBJ)
+
+LIBRARIES=
+
+tvguid01$(ExEXE):: \
+ ./tvguid01$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid01$(ExOBJ):: tvguid01.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid02.bmk b/tvision/examples/tutorial/tvguid02.bmk
new file mode 100644
index 0000000..84d8dda
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid02.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid02.exe
+!include ../../makes/common.bmk
+!include tvguid02.umk
diff --git a/tvision/examples/tutorial/tvguid02.cc b/tvision/examples/tutorial/tvguid02.cc
new file mode 100644
index 0000000..47e0440
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid02.cc
@@ -0,0 +1,72 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID02 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#include <tv.h>
+
+// tv.h ensures that the correct *.h files are included for each
+// of the above classes and their bases.
+
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ Here you can see how a new item is added to the status bar of the
+application. See how the overloaded + operator simplifies the work. The
+0,0xFFFF is the range where the this status items are showed. It is related
+to the context sensitive help and you'll see it latter.
+*/
+
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ // new for tvguid02
+};
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+// new for tvguid02:
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // define an item
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+int main()
+{
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid02.gpr b/tvision/examples/tutorial/tvguid02.gpr
new file mode 100644
index 0000000..2eac4a9
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid02.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid02.mkf b/tvision/examples/tutorial/tvguid02.mkf
new file mode 100644
index 0000000..2f0679f
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid02.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid02$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid02.umk b/tvision/examples/tutorial/tvguid02.umk
new file mode 100644
index 0000000..d597860
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid02.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid02$(ExOBJ)
+
+LIBRARIES=
+
+tvguid02$(ExEXE):: \
+ ./tvguid02$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid02$(ExOBJ):: tvguid02.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid03.bmk b/tvision/examples/tutorial/tvguid03.bmk
new file mode 100644
index 0000000..263e845
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid03.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid03.exe
+!include ../../makes/common.bmk
+!include tvguid03.umk
diff --git a/tvision/examples/tutorial/tvguid03.cc b/tvision/examples/tutorial/tvguid03.cc
new file mode 100644
index 0000000..6d8a91c
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid03.cc
@@ -0,0 +1,92 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID03 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ Here you can see how a menu is added to the application. See how the
+overloaded + operator simplifies the work again. The hcNoContext means no
+context sensitive help.
+*/
+
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#include <tv.h>
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ // new for tvguid03
+};
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // define an item
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+// new for tvguid03:
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )
+ );
+}
+
+int main()
+{
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid03.gpr b/tvision/examples/tutorial/tvguid03.gpr
new file mode 100644
index 0000000..f4c295d
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid03.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid03.mkf b/tvision/examples/tutorial/tvguid03.mkf
new file mode 100644
index 0000000..8970593
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid03.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid03$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid03.umk b/tvision/examples/tutorial/tvguid03.umk
new file mode 100644
index 0000000..5586854
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid03.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid03$(ExOBJ)
+
+LIBRARIES=
+
+tvguid03$(ExEXE):: \
+ ./tvguid03$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid03$(ExOBJ):: tvguid03.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid04.bmk b/tvision/examples/tutorial/tvguid04.bmk
new file mode 100644
index 0000000..d62c098
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid04.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid04.exe
+!include ../../makes/common.bmk
+!include tvguid04.umk
diff --git a/tvision/examples/tutorial/tvguid04.cc b/tvision/examples/tutorial/tvguid04.cc
new file mode 100644
index 0000000..a570cf4
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid04.cc
@@ -0,0 +1,153 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID04 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ This example shows how to insert a window in the desktop in response to a
+command sent by the menu.
+*/
+
+#include <stdlib.h>
+
+#define Uses_TEvent
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TWindow
+#include <tv.h>
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void myNewWindow();
+};
+
+
+static short winNumber = 0; // initialize window number
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& r, const char *aTitle, short aNumber );
+ // declare a constructor
+
+ // static TFrame *initFrame( TRect r );
+ // override needed only if you want a nonstandard frame
+ // Here we'll inherit TWindow::initFrame unchanged
+ // so TWindowInit will take &TDemoWindow::initFrame to give
+ // a standard frame
+
+};
+
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // define an item
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )
+ );
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event); // act like base!
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin: // but respond to additional commands
+ myNewWindow(); // define action for cmMyNewWin
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+void TMyApp::myNewWindow()
+{
+ TRect r( 0, 0, 26, 7 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 53, rand() % 16 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+
+TDemoWindow::TDemoWindow( const TRect& r, const char *aTitle, short aNumber):
+ TWindowInit( &TDemoWindow::initFrame),
+ TWindow( r, aTitle, aNumber)
+{
+}
+
+int main()
+{
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid04.gpr b/tvision/examples/tutorial/tvguid04.gpr
new file mode 100644
index 0000000..aca6d8b
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid04.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid04.mkf b/tvision/examples/tutorial/tvguid04.mkf
new file mode 100644
index 0000000..2e9ffe6
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid04.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid04$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid04.umk b/tvision/examples/tutorial/tvguid04.umk
new file mode 100644
index 0000000..4fd36c3
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid04.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid04$(ExOBJ)
+
+LIBRARIES=
+
+tvguid04$(ExEXE):: \
+ ./tvguid04$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid04$(ExOBJ):: tvguid04.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid05.bmk b/tvision/examples/tutorial/tvguid05.bmk
new file mode 100644
index 0000000..efdb703
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid05.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid05.exe
+!include ../../makes/common.bmk
+!include tvguid05.umk
diff --git a/tvision/examples/tutorial/tvguid05.cc b/tvision/examples/tutorial/tvguid05.cc
new file mode 100644
index 0000000..1632353
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid05.cc
@@ -0,0 +1,179 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID05 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ Now you can see how to draw inside the window. See how the example creates
+a TView object (TInterior) to be inserted in the window. The TInterior::draw
+member is the one that draws the message you see inside the window.
+*/
+
+#include <stdlib.h> // for rand()
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#include <tv.h>
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void myNewWindow();
+};
+
+
+static short winNumber = 0; // initialize window number
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& r, const char *aTitle, short aNumber );
+
+};
+
+class TInterior : public TView
+{
+
+public:
+
+ TInterior( const TRect& bounds ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+TInterior::TInterior( const TRect& bounds ) : TView( bounds )
+{
+ growMode = gfGrowHiX | gfGrowHiY; //make size follow that of the window
+ options = options | ofFramed;
+}
+
+void TInterior::draw()
+{
+ char *hstr = "Hello World!";
+ ushort color = getColor(0x0301);
+ TView::draw();
+ TDrawBuffer b;
+ b.moveStr( 0, hstr, color );
+ writeLine( 4, 2, 12, 1, b);
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // define an item
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )
+ );
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event); // act like base!
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin: // but respond to additional commands
+ myNewWindow(); // define action for cmMyNewWin
+ // command
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+void TMyApp::myNewWindow()
+{
+ TRect r( 0, 0, 26, 7 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 53, rand() % 16 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect r = getClipRect(); // get exposed area
+ r.grow(-1, -1); // make interior fit inside window frame
+ insert( new TInterior(r) ); // add interior to window
+}
+
+
+int main()
+{
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid05.gpr b/tvision/examples/tutorial/tvguid05.gpr
new file mode 100644
index 0000000..79b3b6e
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid05.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid05.mkf b/tvision/examples/tutorial/tvguid05.mkf
new file mode 100644
index 0000000..1134ed1
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid05.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid05$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid05.umk b/tvision/examples/tutorial/tvguid05.umk
new file mode 100644
index 0000000..150e86e
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid05.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid05$(ExOBJ)
+
+LIBRARIES=
+
+tvguid05$(ExEXE):: \
+ ./tvguid05$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid05$(ExOBJ):: tvguid05.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid06.bmk b/tvision/examples/tutorial/tvguid06.bmk
new file mode 100644
index 0000000..e4078e6
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid06.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid06.exe
+!include ../../makes/common.bmk
+!include tvguid06.umk
diff --git a/tvision/examples/tutorial/tvguid06.cc b/tvision/examples/tutorial/tvguid06.cc
new file mode 100644
index 0000000..b548165
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid06.cc
@@ -0,0 +1,223 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID06 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ Now the TInterior::draw member is a little bit more complex and puts some
+text in the window, but isn't complet. You can move the window, but don't
+resize it.
+*/
+
+/****** imperfect draw method--see tvguid07 for improvement *****/
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#include <tv.h>
+
+UsingNamespaceStd
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid06.cc";
+//const char *fileToRead = "tvguid06.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+class TMyApp : public TApplication
+{
+
+public:
+
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void myNewWindow();
+
+};
+
+
+static short winNumber = 0; // initialize window number
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& r, const char *aTitle, short aNumber );
+ static const char * const name;
+
+};
+
+class TInterior : public TView
+{
+
+public:
+
+ TInterior( const TRect& bounds ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+TInterior::TInterior( const TRect& bounds ) : TView( bounds )
+{
+ growMode = gfGrowHiX | gfGrowHiY; //make size follow that of the window
+ options = options | ofFramed;
+}
+
+void TInterior::draw()
+{
+ for( int i = 0; i < size.y; i++ )
+ writeStr( 0, i, lines[i], 1 );
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )
+ );
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event); // act like base!
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin: // but respond to additional commands
+ myNewWindow(); // define action for cmMyNewWin // command
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+void TMyApp::myNewWindow()
+{
+ TRect r( 0, 0, 26, 7 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 53, rand() % 16 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+// const char * const TDemoWindow::name = "TDemoWindow";
+
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect r = getClipRect(); // get exposed area
+ r.grow(-1, -1); // make interior fit inside window frame
+ insert( new TInterior(r) ); // add interior to window
+}
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid06.gpr b/tvision/examples/tutorial/tvguid06.gpr
new file mode 100644
index 0000000..2a37b27
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid06.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid06.mkf b/tvision/examples/tutorial/tvguid06.mkf
new file mode 100644
index 0000000..c75a86c
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid06.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid06$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid06.umk b/tvision/examples/tutorial/tvguid06.umk
new file mode 100644
index 0000000..8fbc1a7
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid06.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid06$(ExOBJ)
+
+LIBRARIES=
+
+tvguid06$(ExEXE):: \
+ ./tvguid06$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid06$(ExOBJ):: tvguid06.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid07.bmk b/tvision/examples/tutorial/tvguid07.bmk
new file mode 100644
index 0000000..be01264
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid07.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid07.exe
+!include ../../makes/common.bmk
+!include tvguid07.umk
diff --git a/tvision/examples/tutorial/tvguid07.cc b/tvision/examples/tutorial/tvguid07.cc
new file mode 100644
index 0000000..4fae339
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid07.cc
@@ -0,0 +1,232 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID07 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ Now the TInterior::draw is impoved and the resize is correctly handled.
+*/
+
+// same as tvguid06 except for improved draw method
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#include <tv.h>
+
+UsingNamespaceStd
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid07.cc";
+//const char *fileToRead = "tvguid07.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void myNewWindow();
+};
+
+
+static short winNumber = 0; // initialize window number
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& r, const char *aTitle, short aNumber );
+
+};
+
+class TInterior : public TView
+{
+
+public:
+
+ TInterior( const TRect& bounds ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+TInterior::TInterior( const TRect& bounds ) : TView( bounds )
+{
+ growMode = gfGrowHiX | gfGrowHiY; //make size follow that of the window
+ options = options | ofFramed;
+}
+
+void TInterior::draw()
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ if( lines[i] )
+ {
+ char s[maxLineLength];
+ strncpy( s, lines[i], size.x );
+ s[size.x] = EOS;
+ b.moveStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )
+ );
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event); // act like base!
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin: // but respond to additional commands
+ myNewWindow(); // define action for cmMyNewWin
+ // command
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+void TMyApp::myNewWindow()
+{
+ TRect r( 0, 0, 26, 7 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 53, rand() % 16 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect r = getClipRect(); // get exposed area
+ r.grow(-1, -1); // make interior fit inside window frame
+ insert( new TInterior(r) ); // add interior to window
+}
+
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid07.gpr b/tvision/examples/tutorial/tvguid07.gpr
new file mode 100644
index 0000000..48da361
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid07.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid07.mkf b/tvision/examples/tutorial/tvguid07.mkf
new file mode 100644
index 0000000..2d500ff
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid07.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid07$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid07.umk b/tvision/examples/tutorial/tvguid07.umk
new file mode 100644
index 0000000..b189279
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid07.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid07$(ExOBJ)
+
+LIBRARIES=
+
+tvguid07$(ExEXE):: \
+ ./tvguid07$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid07$(ExOBJ):: tvguid07.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid08.bmk b/tvision/examples/tutorial/tvguid08.bmk
new file mode 100644
index 0000000..3093778
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid08.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid08.exe
+!include ../../makes/common.bmk
+!include tvguid08.umk
diff --git a/tvision/examples/tutorial/tvguid08.cc b/tvision/examples/tutorial/tvguid08.cc
new file mode 100644
index 0000000..8d1fbbe
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid08.cc
@@ -0,0 +1,254 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID08 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ See how the scroll bars affect the delta TPoint member.
+*/
+
+// same as tvguid07 except for scrolling interior
+// add TDemoWindow::makeInterior
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TScroller
+#define Uses_TScrollBar
+#include <tv.h>
+
+UsingNamespaceStd
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid08.cc";
+//const char *fileToRead = "tvguid08.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void myNewWindow();
+};
+
+
+static short winNumber = 0; // initialize window number
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& bounds, const char *aTitle, short aNumber );
+ void makeInterior();
+
+};
+
+class TInterior : public TScroller
+{
+
+public:
+
+ TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+TInterior::TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ growMode = gfGrowHiX | gfGrowHiY;
+ options = options | ofFramed;
+ setLimit( maxLineLength, maxLines );
+}
+
+void TInterior::draw() // modified for scroller
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ // for each line:
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ int j = delta.y + i; // delta is scroller offset
+ if( lines[j] )
+ {
+ char s[maxLineLength];
+ if( delta.x > (int)strlen(lines[j] ) )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, lines[j]+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+}
+
+void TDemoWindow::makeInterior()
+{
+ TScrollBar *vScrollBar =
+ standardScrollBar( sbVertical | sbHandleKeyboard );
+ TScrollBar *hScrollBar =
+ standardScrollBar( sbHorizontal | sbHandleKeyboard );
+ TRect r = getClipRect(); // get exposed view bounds
+ r.grow( -1, -1 ); // shrink to fit inside window frame
+ insert( new TInterior( r, hScrollBar, vScrollBar ));
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )
+ );
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event); // act like base!
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin: // but respond to additional commands
+ myNewWindow(); // define action for cmMyNewWin // command
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+void TMyApp::myNewWindow()
+{
+ TRect r( 0, 0, 26, 7 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 53, rand() % 16 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ makeInterior(); // creates scrollable interior and inserts into window
+}
+
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid08.gpr b/tvision/examples/tutorial/tvguid08.gpr
new file mode 100644
index 0000000..1643995
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid08.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid08.mkf b/tvision/examples/tutorial/tvguid08.mkf
new file mode 100644
index 0000000..995359a
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid08.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid08$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid08.umk b/tvision/examples/tutorial/tvguid08.umk
new file mode 100644
index 0000000..eadcf3d
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid08.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid08$(ExOBJ)
+
+LIBRARIES=
+
+tvguid08$(ExEXE):: \
+ ./tvguid08$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid08$(ExOBJ):: tvguid08.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid09.bmk b/tvision/examples/tutorial/tvguid09.bmk
new file mode 100644
index 0000000..5a0d637
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid09.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid09.exe
+!include ../../makes/common.bmk
+!include tvguid09.umk
diff --git a/tvision/examples/tutorial/tvguid09.cc b/tvision/examples/tutorial/tvguid09.cc
new file mode 100644
index 0000000..bdae97d
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid09.cc
@@ -0,0 +1,282 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID09 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+*/
+
+// same as tvguid08 except for multiple panes
+// modify TDemoWindow::makeInterior and constructor
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TFrame
+#define Uses_TScroller
+#define Uses_TScrollBar
+#include <tv.h>
+
+UsingNamespaceStd
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid09.cc";
+//const char *fileToRead = "tvguid09.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+static short winNumber = 0; // initialize window number
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void newWindow();
+};
+
+class TInterior : public TScroller
+{
+
+public:
+
+ TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& bounds, const char *aTitle, short aNumber );
+ TInterior *makeInterior( const TRect& r, Boolean left );
+
+};
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+TInterior::TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ options = options | ofFramed;
+ setLimit( maxLineLength, lineCount );
+}
+
+void TInterior::draw() // modified for scroller
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ // for each line:
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ int j = delta.y + i; // delta is scroller offset
+ if( j < lineCount && lines[j] != 0 )
+ {
+ char s[maxLineLength];
+ if( delta.x > (int)strlen(lines[j] ) )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, lines[j]+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveCStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+
+}
+
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect lbounds = getExtent();
+ TRect r( lbounds.a.x, lbounds.a.y, lbounds.b.x/2+1, lbounds.b.y );
+ TInterior *lInterior = makeInterior( r, True );
+ lInterior->growMode = gfGrowHiY;
+ insert( lInterior );
+ // creates left-side scrollable interior and inserts into window
+ r = TRect( lbounds.b.x/2, lbounds.a.y, lbounds.b.x, lbounds.b.y );
+ TInterior *rInterior = makeInterior( r, False );
+ rInterior->growMode = gfGrowHiX | gfGrowHiY;
+ insert( rInterior );
+ // likewise for right-side scroller
+}
+
+TInterior *TDemoWindow::makeInterior( const TRect& bounds, Boolean left )
+{
+ TRect r = TRect( bounds.b.x-1, bounds.a.y+1, bounds.b.x, bounds.b.y-1 );
+ TScrollBar *vScrollBar = new TScrollBar( r );
+ if( vScrollBar == 0 )
+ {
+ cout << "vScrollbar init error" << endl;
+ exit(1);
+ }
+ // production code would display error dialog box
+ vScrollBar->options |= ofPostProcess;
+ if( left )
+ vScrollBar->growMode = gfGrowHiY;
+ insert( vScrollBar );
+
+ r = TRect( bounds.a.x+2, bounds.b.y-1, bounds.b.x-2, bounds.b.y );
+ TScrollBar *hScrollBar = new TScrollBar( r );
+ if( hScrollBar == 0 )
+ {
+ cout << "hScrollbar init error" << endl;
+ exit(1);
+ }
+ hScrollBar->options |= ofPostProcess;
+ if( left )
+ hScrollBar->growMode = (gfGrowHiY | gfGrowLoY);
+ insert( hScrollBar );
+
+ r = bounds;
+ r.grow( -1, -1 );
+ return new TInterior( r, hScrollBar, vScrollBar );
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event); // act like base!
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin: // but respond to additional commands
+ newWindow(); // define action for cmMyNewWin
+ // command
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+void TMyApp::newWindow()
+{
+ TRect r( 0, 0, 45, 13 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 34, rand() % 11 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid09.gpr b/tvision/examples/tutorial/tvguid09.gpr
new file mode 100644
index 0000000..40ee2bc
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid09.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid09.mkf b/tvision/examples/tutorial/tvguid09.mkf
new file mode 100644
index 0000000..3f1f2e3
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid09.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid09$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid09.umk b/tvision/examples/tutorial/tvguid09.umk
new file mode 100644
index 0000000..3c9f8d9
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid09.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid09$(ExOBJ)
+
+LIBRARIES=
+
+tvguid09$(ExEXE):: \
+ ./tvguid09$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid09$(ExOBJ):: tvguid09.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid10.bmk b/tvision/examples/tutorial/tvguid10.bmk
new file mode 100644
index 0000000..d957578
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid10.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid10.exe
+!include ../../makes/common.bmk
+!include tvguid10.umk
diff --git a/tvision/examples/tutorial/tvguid10.cc b/tvision/examples/tutorial/tvguid10.cc
new file mode 100644
index 0000000..1cf67e6
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid10.cc
@@ -0,0 +1,294 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID10 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+*/
+
+// same as tvguid09 except for better handling of resizing
+// add TDemoWindow::sizeLimits
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TFrame
+#define Uses_TScroller
+#define Uses_TScrollBar
+#include <tv.h>
+
+UsingNamespaceStd
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid10.cc";
+//const char *fileToRead = "tvguid10.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+static short winNumber = 0; // initialize window number
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void newWindow();
+};
+
+class TInterior : public TScroller
+{
+
+public:
+
+ TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& bounds, const char *aTitle, short aNumber );
+ TInterior *makeInterior( const TRect& r, Boolean left );
+ virtual void sizeLimits( TPoint& minP, TPoint& maxP );
+ // override TWindow::sizeLimits
+
+private:
+
+ TInterior *lInterior, *rInterior;
+
+};
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+TInterior::TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ options = options | ofFramed;
+ setLimit( maxLineLength, lineCount );
+}
+
+void TInterior::draw() // modified for scroller
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ // for each line:
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ int j = delta.y + i; // delta is scroller offset
+ if( j < lineCount && lines[j] != 0 )
+ {
+ char s[maxLineLength];
+ if( delta.x > (int)strlen(lines[j] ) )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, lines[j]+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveCStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+
+}
+
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect lbounds = getExtent();
+ TRect r( lbounds.a.x, lbounds.a.y, lbounds.b.x/2+1, lbounds.b.y );
+ lInterior = makeInterior( r, True );
+ lInterior->growMode = gfGrowHiY;
+ insert( lInterior );
+ // creates left-side scrollable interior and inserts into window
+ r = TRect( lbounds.b.x/2, lbounds.a.y, lbounds.b.x, lbounds.b.y );
+ rInterior = makeInterior( r, False );
+ rInterior->growMode = gfGrowHiX | gfGrowHiY;
+ insert( rInterior );
+ // likewise for right-side scroller
+}
+
+TInterior *TDemoWindow::makeInterior( const TRect& bounds, Boolean left )
+{
+ TRect r = TRect( bounds.b.x-1, bounds.a.y+1, bounds.b.x, bounds.b.y-1 );
+ TScrollBar *vScrollBar = new TScrollBar( r );
+ if( vScrollBar == 0 )
+ {
+ cout << "vScrollbar init error" << endl;
+ exit(1);
+ }
+ // production code would display error dialog box
+ vScrollBar->options |= ofPostProcess;
+ if( left )
+ vScrollBar->growMode = gfGrowHiY;
+ insert( vScrollBar );
+
+ r = TRect( bounds.a.x+2, bounds.b.y-1, bounds.b.x-2, bounds.b.y );
+ TScrollBar *hScrollBar = new TScrollBar( r );
+ if( hScrollBar == 0 )
+ {
+ cout << "hScrollbar init error" << endl;
+ exit(1);
+ }
+ hScrollBar->options |= ofPostProcess;
+ if( left )
+ hScrollBar->growMode = (gfGrowHiY | gfGrowLoY);
+ insert( hScrollBar );
+
+ r = bounds;
+ r.grow( -1, -1 );
+ return new TInterior( r, hScrollBar, vScrollBar );
+}
+
+void TDemoWindow::sizeLimits( TPoint& minP, TPoint& maxP )
+{
+ TWindow::sizeLimits( minP, maxP );
+ minP.x = lInterior->size.x+9;
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event); // act like base!
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin: // but respond to additional commands
+ newWindow(); // define action for cmMyNewWin
+ // command
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+void TMyApp::newWindow()
+{
+ TRect r( 0, 0, 45, 13 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 34, rand() % 11 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid10.gpr b/tvision/examples/tutorial/tvguid10.gpr
new file mode 100644
index 0000000..d61fdb7
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid10.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid10.mkf b/tvision/examples/tutorial/tvguid10.mkf
new file mode 100644
index 0000000..ba239dc
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid10.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid10$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid10.umk b/tvision/examples/tutorial/tvguid10.umk
new file mode 100644
index 0000000..69a9007
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid10.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid10$(ExOBJ)
+
+LIBRARIES=
+
+tvguid10$(ExEXE):: \
+ ./tvguid10$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid10$(ExOBJ):: tvguid10.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid11.bmk b/tvision/examples/tutorial/tvguid11.bmk
new file mode 100644
index 0000000..48ccb94
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid11.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid11.exe
+!include ../../makes/common.bmk
+!include tvguid11.umk
diff --git a/tvision/examples/tutorial/tvguid11.cc b/tvision/examples/tutorial/tvguid11.cc
new file mode 100644
index 0000000..241c4bc
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid11.cc
@@ -0,0 +1,317 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID11 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+*/
+
+// same as tvguid10 except for added dialog box
+// modify TMyApp
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TDialog
+#include <tv.h>
+
+UsingNamespaceStd
+
+// note the extra #define above
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+// added for dialog menu
+const int cmNewDialog = 202;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid11.cc";
+//const char *fileToRead = "tvguid11.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+static short winNumber = 0; // initialize window number
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void newWindow();
+ void newDialog();
+ // added member
+};
+
+class TInterior : public TScroller
+{
+
+public:
+
+ TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& bounds, const char *aTitle, short aNumber );
+ TInterior *makeInterior( const TRect& r, Boolean left );
+ virtual void sizeLimits( TPoint& minP, TPoint& maxP );
+ // override TWindow::sizeLimits
+
+private:
+
+ TInterior *lInterior, *rInterior;
+
+};
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+TInterior::TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ options = options | ofFramed;
+ setLimit( maxLineLength, lineCount );
+}
+
+void TInterior::draw() // modified for scroller
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ // for each line:
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ int j = delta.y + i; // delta is scroller offset
+ if( j < lineCount && lines[j] != 0 )
+ {
+ char s[maxLineLength];
+ if( delta.x > (int)strlen(lines[j] ) )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, lines[j]+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveCStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+
+}
+
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect lbounds = getExtent();
+ TRect r( lbounds.a.x, lbounds.a.y, lbounds.b.x/2+1, lbounds.b.y );
+ lInterior = makeInterior( r, True );
+ lInterior->growMode = gfGrowHiY;
+ insert( lInterior );
+ // creates left-side scrollable interior and inserts into window
+ r = TRect( lbounds.b.x/2, lbounds.a.y, lbounds.b.x, lbounds.b.y );
+ rInterior = makeInterior( r, False );
+ rInterior->growMode = gfGrowHiX | gfGrowHiY;
+ insert( rInterior );
+ // likewise for right-side scroller
+}
+
+TInterior *TDemoWindow::makeInterior( const TRect& bounds, Boolean left )
+{
+ TRect r = TRect( bounds.b.x-1, bounds.a.y+1, bounds.b.x, bounds.b.y-1 );
+ TScrollBar *vScrollBar = new TScrollBar( r );
+ if( vScrollBar == 0 )
+ {
+ cout << "vScrollbar init error" << endl;
+ exit(1);
+ }
+ // production code would display error dialog box
+ vScrollBar->options |= ofPostProcess;
+ if( left )
+ vScrollBar->growMode = gfGrowHiY;
+ insert( vScrollBar );
+
+ r = TRect( bounds.a.x+2, bounds.b.y-1, bounds.b.x-2, bounds.b.y );
+ TScrollBar *hScrollBar = new TScrollBar( r );
+ if( hScrollBar == 0 )
+ {
+ cout << "hScrollbar init error" << endl;
+ exit(1);
+ }
+ hScrollBar->options |= ofPostProcess;
+ if( left )
+ hScrollBar->growMode = (gfGrowHiY | gfGrowLoY);
+ insert( hScrollBar );
+
+ r = bounds;
+ r.grow( -1, -1 );
+ return new TInterior( r, hScrollBar, vScrollBar );
+}
+
+void TDemoWindow::sizeLimits( TPoint& minP, TPoint& maxP )
+{
+ TWindow::sizeLimits( minP, maxP );
+ minP.x = lInterior->size.x+9;
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event);
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin:
+ newWindow();
+ break;
+ case cmNewDialog:
+ newDialog();
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )+
+ *new TMenuItem( "~D~ialog", cmNewDialog, kbF2, hcNoContext, "F2" )
+ // new dialog menu added here
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+void TMyApp::newWindow()
+{
+ TRect r( 0, 0, 45, 13 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 34, rand() % 11 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+// TMyApp needs newDialog member
+
+void TMyApp::newDialog()
+{
+ TRect r( 0, 0, 40, 13 );
+
+ /* SS: micro change here */
+
+ r.move( rand() % 39, rand() % 10 );
+ deskTop->insert( new TDialog( r, "Demo Dialog" ));
+}
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid11.gpr b/tvision/examples/tutorial/tvguid11.gpr
new file mode 100644
index 0000000..8a3920e
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid11.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid11.mkf b/tvision/examples/tutorial/tvguid11.mkf
new file mode 100644
index 0000000..c5073aa
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid11.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid11$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid11.umk b/tvision/examples/tutorial/tvguid11.umk
new file mode 100644
index 0000000..25dd6ea
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid11.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid11$(ExOBJ)
+
+LIBRARIES=
+
+tvguid11$(ExEXE):: \
+ ./tvguid11$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid11$(ExOBJ):: tvguid11.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid12.bmk b/tvision/examples/tutorial/tvguid12.bmk
new file mode 100644
index 0000000..2b4def0
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid12.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid12.exe
+!include ../../makes/common.bmk
+!include tvguid12.umk
diff --git a/tvision/examples/tutorial/tvguid12.cc b/tvision/examples/tutorial/tvguid12.cc
new file mode 100644
index 0000000..f70a979
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid12.cc
@@ -0,0 +1,314 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID12 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+*/
+
+// same as tvguid11 except for making the dialog modal
+// modify TMyApp::newDialog
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TDialog
+#include <tv.h>
+
+UsingNamespaceStd
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+// added for dialog menu
+const int cmNewDialog = 202;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid12.cc";
+//const char *fileToRead = "tvguid12.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+static short winNumber = 0; // initialize window number
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void newWindow();
+ void newDialog();
+};
+
+class TInterior : public TScroller
+{
+
+public:
+
+ TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& bounds, const char *aTitle, short aNumber );
+ TInterior *makeInterior( const TRect& r, Boolean left );
+ virtual void sizeLimits( TPoint& minP, TPoint& maxP );
+ // override TWindow::sizeLimits
+
+private:
+
+ TInterior *lInterior, *rInterior;
+
+};
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+TInterior::TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ options = options | ofFramed;
+ setLimit( maxLineLength, lineCount );
+}
+
+void TInterior::draw() // modified for scroller
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ // for each line:
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ int j = delta.y + i; // delta is scroller offset
+ if( j < lineCount && lines[j] != 0 )
+ {
+ char s[maxLineLength];
+ if( delta.x > (int)strlen(lines[j] ) )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, lines[j]+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveCStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+
+}
+
+// modified from tvguid08:
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect lbounds = getExtent();
+ TRect r( lbounds.a.x, lbounds.a.y, lbounds.b.x/2+1, lbounds.b.y );
+ lInterior = makeInterior( r, True );
+ lInterior->growMode = gfGrowHiY;
+ insert( lInterior );
+ // creates left-side scrollable interior and inserts into window
+ r = TRect( lbounds.b.x/2, lbounds.a.y, lbounds.b.x, lbounds.b.y );
+ rInterior = makeInterior( r, False );
+ rInterior->growMode = gfGrowHiX | gfGrowHiY;
+ insert( rInterior );
+ // likewise for right-side scroller
+}
+
+TInterior *TDemoWindow::makeInterior( const TRect& bounds, Boolean left )
+{
+ TRect r = TRect( bounds.b.x-1, bounds.a.y+1, bounds.b.x, bounds.b.y-1 );
+ TScrollBar *vScrollBar = new TScrollBar( r );
+ if( vScrollBar == 0 )
+ {
+ cout << "vScrollbar init error" << endl;
+ exit(1);
+ }
+ // production code would display error dialog box
+ vScrollBar->options |= ofPostProcess;
+ if( left )
+ vScrollBar->growMode = gfGrowHiY;
+ insert( vScrollBar );
+
+ r = TRect( bounds.a.x+2, bounds.b.y-1, bounds.b.x-2, bounds.b.y );
+ TScrollBar *hScrollBar = new TScrollBar( r );
+ if( hScrollBar == 0 )
+ {
+ cout << "hScrollbar init error" << endl;
+ exit(1);
+ }
+ hScrollBar->options |= ofPostProcess;
+ if( left )
+ hScrollBar->growMode = (gfGrowHiY | gfGrowLoY);
+ insert( hScrollBar );
+
+ r = bounds;
+ r.grow( -1, -1 );
+ return new TInterior( r, hScrollBar, vScrollBar );
+}
+
+void TDemoWindow::sizeLimits( TPoint& minP, TPoint& maxP )
+{
+ TWindow::sizeLimits( minP, maxP );
+ minP.x = lInterior->size.x+9;
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event);
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin:
+ newWindow();
+ break;
+ case cmNewDialog:
+ newDialog();
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )+
+ *new TMenuItem( "~D~ialog", cmNewDialog, kbF2, hcNoContext, "F2" )
+ // new dialog menu added here
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+void TMyApp::newWindow()
+{
+ TRect r( 0, 0, 45, 13 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 34, rand() % 11 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+// changed from tvguid11: now calls execView
+void TMyApp::newDialog()
+{
+ TRect r( 0, 0, 40, 13 );
+
+ /* SS: micro change here */
+
+ r.move( rand() % 39, rand() % 10 );
+ deskTop->execView( new TDialog( r, "Demo Dialog" ));
+}
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid12.gpr b/tvision/examples/tutorial/tvguid12.gpr
new file mode 100644
index 0000000..f1c89fd
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid12.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid12.mkf b/tvision/examples/tutorial/tvguid12.mkf
new file mode 100644
index 0000000..ba59d99
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid12.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid12$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid12.umk b/tvision/examples/tutorial/tvguid12.umk
new file mode 100644
index 0000000..956d1df
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid12.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid12$(ExOBJ)
+
+LIBRARIES=
+
+tvguid12$(ExEXE):: \
+ ./tvguid12$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid12$(ExOBJ):: tvguid12.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid13.bmk b/tvision/examples/tutorial/tvguid13.bmk
new file mode 100644
index 0000000..0565090
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid13.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid13.exe
+!include ../../makes/common.bmk
+!include tvguid13.umk
diff --git a/tvision/examples/tutorial/tvguid13.cc b/tvision/examples/tutorial/tvguid13.cc
new file mode 100644
index 0000000..1f62977
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid13.cc
@@ -0,0 +1,324 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID13 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ See how objects are inserted in a dialog, in this case a couple of buttons.
+*/
+
+// same as tvguid12 except for extra buttons in dialog
+// modify TMyApp::newDialog
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TDialog
+#define Uses_TButton
+#include <tv.h>
+
+UsingNamespaceStd
+
+// note the extra #define above
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+
+// added for dialog menu
+const int cmNewDialog = 202;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid13.cc";
+//const char *fileToRead = "tvguid13.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+static short winNumber = 0; // initialize window number
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void newWindow();
+ void newDialog();
+ // added member
+};
+
+class TInterior : public TScroller
+{
+
+public:
+
+ TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& bounds, const char *aTitle, short aNumber );
+ TInterior *makeInterior( const TRect& r, Boolean left );
+ virtual void sizeLimits( TPoint& minP, TPoint& maxP );
+ // override TWindow::sizeLimits
+
+private:
+
+ TInterior *lInterior, *rInterior;
+
+};
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+TInterior::TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ options = options | ofFramed;
+ setLimit( maxLineLength, lineCount );
+}
+
+void TInterior::draw() // modified for scroller
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ // for each line:
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ int j = delta.y + i; // delta is scroller offset
+ if( j < lineCount && lines[j] != 0 )
+ {
+ char s[maxLineLength];
+ if( delta.x > (int)strlen(lines[j] ) )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, lines[j]+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveCStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+
+}
+
+// modified from tvguid08:
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect lbounds = getExtent();
+ TRect r( lbounds.a.x, lbounds.a.y, lbounds.b.x/2+1, lbounds.b.y );
+ lInterior = makeInterior( r, True );
+ lInterior->growMode = gfGrowHiY;
+ insert( lInterior );
+ // creates left-side scrollable interior and inserts into window
+ r = TRect( lbounds.b.x/2, lbounds.a.y, lbounds.b.x, lbounds.b.y );
+ rInterior = makeInterior( r, False );
+ rInterior->growMode = gfGrowHiX | gfGrowHiY;
+ insert( rInterior );
+ // likewise for right-side scroller
+}
+
+TInterior *TDemoWindow::makeInterior( const TRect& bounds, Boolean left )
+{
+ TRect r = TRect( bounds.b.x-1, bounds.a.y+1, bounds.b.x, bounds.b.y-1 );
+ TScrollBar *vScrollBar = new TScrollBar( r );
+ if( vScrollBar == 0 )
+ {
+ cout << "vScrollbar init error" << endl;
+ exit(1);
+ }
+ // production code would display error dialog box
+ vScrollBar->options |= ofPostProcess;
+ if( left )
+ vScrollBar->growMode = gfGrowHiY;
+ insert( vScrollBar );
+
+ r = TRect( bounds.a.x+2, bounds.b.y-1, bounds.b.x-2, bounds.b.y );
+ TScrollBar *hScrollBar = new TScrollBar( r );
+ if( hScrollBar == 0 )
+ {
+ cout << "hScrollbar init error" << endl;
+ exit(1);
+ }
+ hScrollBar->options |= ofPostProcess;
+ if( left )
+ hScrollBar->growMode = (gfGrowHiY | gfGrowLoY);
+ insert( hScrollBar );
+
+ r = bounds;
+ r.grow( -1, -1 );
+ return new TInterior( r, hScrollBar, vScrollBar );
+}
+
+void TDemoWindow::sizeLimits( TPoint& minP, TPoint& maxP )
+{
+ TWindow::sizeLimits( minP, maxP );
+ minP.x = lInterior->size.x+9;
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event);
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin:
+ newWindow();
+ break;
+ case cmNewDialog:
+ newDialog();
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )+
+ *new TMenuItem( "~D~ialog", cmNewDialog, kbF2, hcNoContext, "F2" )
+ // new dialog menu added here
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+void TMyApp::newWindow()
+{
+ TRect r( 0, 0, 45, 13 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 34, rand() % 11 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+// changed from tvguid12: add buttons
+void TMyApp::newDialog()
+{
+ TDialog *pd = new TDialog( TRect( 20, 6, 60, 19), "Demo Dialog" );
+ if( pd )
+ {
+ pd->insert( new TButton( TRect( 15, 10, 25, 12 ), "~O~K", cmOK,
+ bfDefault ));
+ pd->insert( new TButton( TRect( 28, 10, 38, 12 ), "~C~ancel", cmCancel,
+ bfNormal ));
+ deskTop->execView( pd );
+ }
+ CLY_destroy( pd );
+}
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid13.gpr b/tvision/examples/tutorial/tvguid13.gpr
new file mode 100644
index 0000000..f7ee4f0
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid13.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid13.mkf b/tvision/examples/tutorial/tvguid13.mkf
new file mode 100644
index 0000000..eb3e26c
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid13.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid13$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid13.umk b/tvision/examples/tutorial/tvguid13.umk
new file mode 100644
index 0000000..ecd76d2
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid13.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid13$(ExOBJ)
+
+LIBRARIES=
+
+tvguid13$(ExEXE):: \
+ ./tvguid13$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid13$(ExOBJ):: tvguid13.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid14.bmk b/tvision/examples/tutorial/tvguid14.bmk
new file mode 100644
index 0000000..7631fd5
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid14.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid14.exe
+!include ../../makes/common.bmk
+!include tvguid14.umk
diff --git a/tvision/examples/tutorial/tvguid14.cc b/tvision/examples/tutorial/tvguid14.cc
new file mode 100644
index 0000000..12b1952
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid14.cc
@@ -0,0 +1,342 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID14 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+*/
+
+// same as tvguid13 except for extra checkboxes, radiobuttons, and labels
+// modify TMyApp::newDialog
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TDialog
+#define Uses_TButton
+#define Uses_TSItem
+#define Uses_TCheckBoxes
+#define Uses_TRadioButtons
+#define Uses_TLabel
+#include <tv.h>
+
+UsingNamespaceStd
+
+// note the extra #defines above
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+const int cmNewDialog = 202;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid14.cc";
+//const char *fileToRead = "tvguid14.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+static short winNumber = 0; // initialize window number
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void newWindow();
+ void newDialog();
+ // added member
+};
+
+class TInterior : public TScroller
+{
+
+public:
+
+ TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& bounds, const char *aTitle, short aNumber );
+ TInterior *makeInterior( const TRect& r, Boolean left );
+ virtual void sizeLimits( TPoint& minP, TPoint& maxP );
+ // override TWindow::sizeLimits
+
+private:
+
+ TInterior *lInterior, *rInterior;
+
+};
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+TInterior::TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ options = options | ofFramed;
+ setLimit( maxLineLength, lineCount );
+}
+
+void TInterior::draw() // modified for scroller
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ // for each line:
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ int j = delta.y + i; // delta is scroller offset
+ if( j < lineCount && lines[j] != 0 )
+ {
+ char s[maxLineLength];
+ if( delta.x > (int)strlen(lines[j] ) )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, lines[j]+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveCStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+
+}
+
+// modified from tvguid08:
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect lbounds = getExtent();
+ TRect r( lbounds.a.x, lbounds.a.y, lbounds.b.x/2+1, lbounds.b.y );
+ lInterior = makeInterior( r, True );
+ lInterior->growMode = gfGrowHiY;
+ insert( lInterior );
+ // creates left-side scrollable interior and inserts into window
+ r = TRect( lbounds.b.x/2, lbounds.a.y, lbounds.b.x, lbounds.b.y );
+ rInterior = makeInterior( r, False );
+ rInterior->growMode = gfGrowHiX | gfGrowHiY;
+ insert( rInterior );
+ // likewise for right-side scroller
+}
+
+TInterior *TDemoWindow::makeInterior( const TRect& bounds, Boolean left )
+{
+ TRect r = TRect( bounds.b.x-1, bounds.a.y+1, bounds.b.x, bounds.b.y-1 );
+ TScrollBar *vScrollBar = new TScrollBar( r );
+ if( vScrollBar == 0 )
+ {
+ cout << "vScrollbar init error" << endl;
+ exit(1);
+ }
+ // production code would display error dialog box
+ vScrollBar->options |= ofPostProcess;
+ if( left )
+ vScrollBar->growMode = gfGrowHiY;
+ insert( vScrollBar );
+
+ r = TRect( bounds.a.x+2, bounds.b.y-1, bounds.b.x-2, bounds.b.y );
+ TScrollBar *hScrollBar = new TScrollBar( r );
+ if( hScrollBar == 0 )
+ {
+ cout << "hScrollbar init error" << endl;
+ exit(1);
+ }
+ hScrollBar->options |= ofPostProcess;
+ if( left )
+ hScrollBar->growMode = (gfGrowHiY | gfGrowLoY);
+ insert( hScrollBar );
+
+ r = bounds;
+ r.grow( -1, -1 );
+ return new TInterior( r, hScrollBar, vScrollBar );
+}
+
+void TDemoWindow::sizeLimits( TPoint& minP, TPoint& maxP )
+{
+ TWindow::sizeLimits( minP, maxP );
+ minP.x = lInterior->size.x+9;
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event);
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin:
+ newWindow();
+ break;
+ case cmNewDialog:
+ newDialog();
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )+
+ *new TMenuItem( "~D~ialog", cmNewDialog, kbF2, hcNoContext, "F2" )
+ // new dialog menu added here
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+void TMyApp::newWindow()
+{
+ TRect r( 0, 0, 45, 13 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 34, rand() % 11 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+// changed from tvguid12: add buttons
+void TMyApp::newDialog()
+{
+ TDialog *pd = new TDialog( TRect( 20, 6, 60, 19), "Demo Dialog" );
+ if( pd )
+ {
+ TView *b = new TCheckBoxes( TRect( 3, 3, 18, 6),
+ new TSItem( "~H~varti",
+ new TSItem( "~T~ilset",
+ new TSItem( "~J~arlsberg", 0 )
+ )));
+ pd->insert( b );
+
+ pd->insert( new TLabel( TRect( 2, 2, 10, 3), "Cheeses", b ));
+
+ b = new TRadioButtons( TRect( 22, 3, 34, 6),
+ new TSItem( "~S~olid",
+ new TSItem( "~R~unny",
+ new TSItem( "~M~elted", 0 )
+ )));
+ pd->insert( b );
+
+ pd->insert( new TLabel( TRect( 21, 2, 33, 3), "Consistency", b ));
+
+ pd->insert( new TButton( TRect( 15, 10, 25, 12 ), "~O~K", cmOK,
+ bfDefault ));
+ pd->insert( new TButton( TRect( 28, 10, 38, 12 ), "~C~ancel", cmCancel,
+ bfNormal ));
+ deskTop->execView( pd );
+ }
+ CLY_destroy( pd );
+}
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid14.gpr b/tvision/examples/tutorial/tvguid14.gpr
new file mode 100644
index 0000000..a46ae2e
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid14.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid14.mkf b/tvision/examples/tutorial/tvguid14.mkf
new file mode 100644
index 0000000..46f0925
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid14.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid14$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid14.umk b/tvision/examples/tutorial/tvguid14.umk
new file mode 100644
index 0000000..af8cfe4
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid14.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid14$(ExOBJ)
+
+LIBRARIES=
+
+tvguid14$(ExEXE):: \
+ ./tvguid14$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid14$(ExOBJ):: tvguid14.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid15.bmk b/tvision/examples/tutorial/tvguid15.bmk
new file mode 100644
index 0000000..af47431
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid15.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid15.exe
+!include ../../makes/common.bmk
+!include tvguid15.umk
diff --git a/tvision/examples/tutorial/tvguid15.cc b/tvision/examples/tutorial/tvguid15.cc
new file mode 100644
index 0000000..6287318
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid15.cc
@@ -0,0 +1,349 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID15 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+*/
+
+// same as tvguid14 except for extra input line in dialog
+// modify TMyApp::newDialog
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TFrame
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TDialog
+#define Uses_TButton
+#define Uses_TSItem
+#define Uses_TCheckBoxes
+#define Uses_TRadioButtons
+#define Uses_TLabel
+#define Uses_TInputLine
+#include <tv.h>
+
+UsingNamespaceStd
+
+// note the extra #define above
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+const int cmNewDialog = 202;
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid15.cc";
+//const char *fileToRead = "tvguid15.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+static short winNumber = 0; // initialize window number
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void newWindow();
+ void newDialog();
+};
+
+class TInterior : public TScroller
+{
+
+public:
+
+ TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& bounds, const char *aTitle, short aNumber );
+ TInterior *makeInterior( const TRect& r, Boolean left );
+ virtual void sizeLimits( TPoint& minP, TPoint& maxP );
+ // override TWindow::sizeLimits
+
+private:
+
+ TInterior *lInterior, *rInterior;
+
+};
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+TInterior::TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ options = options | ofFramed;
+ setLimit( maxLineLength, lineCount );
+}
+
+void TInterior::draw() // modified for scroller
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ // for each line:
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ int j = delta.y + i; // delta is scroller offset
+ if( j < lineCount && lines[j] != 0 )
+ {
+ char s[maxLineLength];
+ if( delta.x > (int)strlen(lines[j] ) )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, lines[j]+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveCStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+
+}
+
+// modified from tvguid08:
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect lbounds = getExtent();
+ TRect r( lbounds.a.x, lbounds.a.y, lbounds.b.x/2+1, lbounds.b.y );
+ lInterior = makeInterior( r, True );
+ lInterior->growMode = gfGrowHiY;
+ insert( lInterior );
+ // creates left-side scrollable interior and inserts into window
+ r = TRect( lbounds.b.x/2, lbounds.a.y, lbounds.b.x, lbounds.b.y );
+ rInterior = makeInterior( r, False );
+ rInterior->growMode = gfGrowHiX | gfGrowHiY;
+ insert( rInterior );
+ // likewise for right-side scroller
+}
+
+TInterior *TDemoWindow::makeInterior( const TRect& bounds, Boolean left )
+{
+ TRect r = TRect( bounds.b.x-1, bounds.a.y+1, bounds.b.x, bounds.b.y-1 );
+ TScrollBar *vScrollBar = new TScrollBar( r );
+ if( vScrollBar == 0 )
+ {
+ cout << "vScrollbar init error" << endl;
+ exit(1);
+ }
+ // production code would display error dialog box
+ vScrollBar->options |= ofPostProcess;
+ if( left )
+ vScrollBar->growMode = gfGrowHiY;
+ insert( vScrollBar );
+
+ r = TRect( bounds.a.x+2, bounds.b.y-1, bounds.b.x-2, bounds.b.y );
+ TScrollBar *hScrollBar = new TScrollBar( r );
+ if( hScrollBar == 0 )
+ {
+ cout << "hScrollbar init error" << endl;
+ exit(1);
+ }
+ hScrollBar->options |= ofPostProcess;
+ if( left )
+ hScrollBar->growMode = (gfGrowHiY | gfGrowLoY);
+ insert( hScrollBar );
+
+ r = bounds;
+ r.grow( -1, -1 );
+ return new TInterior( r, hScrollBar, vScrollBar );
+}
+
+void TDemoWindow::sizeLimits( TPoint& minP, TPoint& maxP )
+{
+ TWindow::sizeLimits( minP, maxP );
+ minP.x = lInterior->size.x+9;
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event);
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin:
+ newWindow();
+ break;
+ case cmNewDialog:
+ newDialog();
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )+
+ *new TMenuItem( "~D~ialog", cmNewDialog, kbF2, hcNoContext, "F2" )
+ // new dialog menu added here
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+void TMyApp::newWindow()
+{
+ TRect r( 0, 0, 45, 13 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 34, rand() % 11 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+// changed from tvguid12: add buttons
+void TMyApp::newDialog()
+{
+ TDialog *pd = new TDialog( TRect( 20, 6, 60, 19), "Demo Dialog" );
+ if( pd )
+ {
+ TView *b = new TCheckBoxes( TRect( 3, 3, 18, 6),
+ new TSItem( "~H~varti",
+ new TSItem( "~T~ilset",
+ new TSItem( "~J~arlsberg", 0 )
+ )));
+ pd->insert( b );
+
+ pd->insert( new TLabel( TRect( 2, 2, 10, 3), "Cheeses", b ));
+
+ b = new TRadioButtons( TRect( 22, 3, 34, 6),
+ new TSItem( "~S~olid",
+ new TSItem( "~R~unny",
+ new TSItem( "~M~elted", 0 )
+ )));
+ pd->insert( b );
+
+ pd->insert( new TLabel( TRect( 21, 2, 33, 3), "Consistency", b ));
+
+ // add input line
+ b = new TInputLine( TRect( 3, 8, 37, 9 ), 128 );
+ pd->insert( b );
+ pd->insert( new TLabel( TRect( 2, 7, 24, 8 ),
+ "Delivery Instructions", b ));
+
+ pd->insert( new TButton( TRect( 15, 10, 25, 12 ), "~O~K", cmOK,
+ bfDefault ));
+ pd->insert( new TButton( TRect( 28, 10, 38, 12 ), "~C~ancel", cmCancel,
+ bfNormal ));
+ deskTop->execView( pd );
+ }
+ CLY_destroy( pd );
+}
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid15.gpr b/tvision/examples/tutorial/tvguid15.gpr
new file mode 100644
index 0000000..9cc7678
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid15.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid15.mkf b/tvision/examples/tutorial/tvguid15.mkf
new file mode 100644
index 0000000..3ce45ba
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid15.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid15$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid15.umk b/tvision/examples/tutorial/tvguid15.umk
new file mode 100644
index 0000000..7f5680c
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid15.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid15$(ExOBJ)
+
+LIBRARIES=
+
+tvguid15$(ExEXE):: \
+ ./tvguid15$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid15$(ExOBJ):: tvguid15.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tutorial/tvguid16.bmk b/tvision/examples/tutorial/tvguid16.bmk
new file mode 100644
index 0000000..658be8d
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid16.bmk
@@ -0,0 +1,9 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvguid16.exe
+!include ../../makes/common.bmk
+!include tvguid16.umk
diff --git a/tvision/examples/tutorial/tvguid16.cc b/tvision/examples/tutorial/tvguid16.cc
new file mode 100644
index 0000000..fd6a97f
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid16.cc
@@ -0,0 +1,401 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID16 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+/*
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ */
+/*
+ Taked from the Sergio Sigala <ssigala@globalnet.it> Turbo Vision port to
+UNIX.
+ LSM: TurboVision for UNIX
+ ftp://sunsite.unc.edu /pub/Linux/devel/lang/c++/tvision-0.6.tar.gz
+ Copying policy: BSD
+ Adapted by Salvador Eduardo Tropea (SET) <set-soft@usa.net>.
+
+ See how setData/getData transfer information to/from a structure to the
+objects inserted in the dialog.
+*/
+
+// same as tvguid15 except for saving and restoring dialog contents
+// modify TMyApp::newDialog
+
+#define Uses_stdlib // for exit(), rand()
+#define Uses_iostream
+#define Uses_fstream
+#define Uses_stdio // for puts() etc
+#define Uses_string // for strlen etc
+#define Uses_ctype
+#define Uses_IfStreamGetLine
+
+#define Uses_TEventQueue
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TFrame
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TDialog
+#define Uses_TButton
+#define Uses_TSItem
+#define Uses_TCheckBoxes
+#define Uses_TRadioButtons
+#define Uses_TLabel
+#define Uses_TInputLine
+#define Uses_TRangeValidator
+#define Uses_MsgBox
+#include <tv.h>
+
+UsingNamespaceStd
+
+const int cmMyFileOpen = 200; // assign new command values
+const int cmMyNewWin = 201;
+const int cmNewDialog = 202;
+
+struct DialogData
+{
+ ushort checkBoxData;
+ ushort radioButtonData;
+ char inputLineData[128];
+ char inputLineRangeData[34];
+};
+
+DialogData *demoDialogData;
+
+// we'll save dialog box data in above struct
+
+/* SS: micro change here */
+
+const char *fileToRead = "tvguid16.cc";
+//const char *fileToRead = "tvguid16.cpp";
+const int maxLineLength = maxViewWidth+1;
+const int maxLines = 100;
+char *lines[maxLines];
+int lineCount = 0;
+static short winNumber = 0; // initialize window number
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ ~TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ static TMenuBar *initMenuBar( TRect r );
+ virtual void handleEvent( TEvent& event);
+ void newWindow();
+ void newDialog();
+};
+
+class TInterior : public TScroller
+{
+
+public:
+
+ TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ); // constructor
+ virtual void draw(); // override TView::draw
+};
+
+class TDemoWindow : public TWindow // define a new window class
+{
+
+public:
+
+ TDemoWindow( const TRect& bounds, const char *aTitle, short aNumber );
+ TInterior *makeInterior( const TRect& r, Boolean left );
+ virtual void sizeLimits( TPoint& minP, TPoint& maxP );
+ // override TWindow::sizeLimits
+
+private:
+
+ TInterior *lInterior, *rInterior;
+
+};
+
+void readFile( const char *fileName )
+{
+ ifstream fileToView( fileName );
+ if( !fileToView )
+ {
+ cout << "Invalid file name..." << endl;
+ exit( 1 );
+ }
+ else
+ {
+ char buf[maxLineLength];
+ while( lineCount < maxLines &&
+ IfStreamGetLine(fileToView,buf,maxLineLength) )
+ {
+ lines[lineCount] = newStr( buf );
+ lineCount++;
+ }
+ }
+}
+
+void deleteFile()
+{
+ for( int i = 0; i < lineCount; i++ )
+ delete lines[i];
+}
+
+TInterior::TInterior( const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar ) :
+ TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ options = options | ofFramed;
+ setLimit( maxLineLength, lineCount );
+}
+
+void TInterior::draw() // modified for scroller
+{
+ ushort color = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ // for each line:
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', color, size.x );
+ // fill line buffer with spaces
+ int j = delta.y + i; // delta is scroller offset
+ if( j < lineCount && lines[j] != 0 )
+ {
+ char s[maxLineLength];
+ if( delta.x > (int)strlen(lines[j] ) )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, lines[j]+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveCStr( 0, s, color );
+ }
+ writeLine( 0, i, size.x, 1, b);
+ }
+
+}
+
+// modified from tvguid08:
+TDemoWindow::TDemoWindow( const TRect& bounds, const char *aTitle,
+ short aNumber) :
+ TWindowInit( &TDemoWindow::initFrame ),
+ TWindow( bounds, aTitle, aNumber)
+{
+ TRect lbounds = getExtent();
+ TRect r( lbounds.a.x, lbounds.a.y, lbounds.b.x/2+1, lbounds.b.y );
+ lInterior = makeInterior( r, True );
+ lInterior->growMode = gfGrowHiY;
+ insert( lInterior );
+ // creates left-side scrollable interior and inserts into window
+ r = TRect( lbounds.b.x/2, lbounds.a.y, lbounds.b.x, lbounds.b.y );
+ rInterior = makeInterior( r, False );
+ rInterior->growMode = gfGrowHiX | gfGrowHiY;
+ insert( rInterior );
+ // likewise for right-side scroller
+}
+
+TInterior *TDemoWindow::makeInterior( const TRect& bounds, Boolean left )
+{
+ TRect r = TRect( bounds.b.x-1, bounds.a.y+1, bounds.b.x, bounds.b.y-1 );
+ TScrollBar *vScrollBar = new TScrollBar( r );
+ if( vScrollBar == 0 )
+ {
+ cout << "vScrollbar init error" << endl;
+ exit(1);
+ }
+ // production code would display error dialog box
+ vScrollBar->options |= ofPostProcess;
+ if( left )
+ vScrollBar->growMode = gfGrowHiY;
+ insert( vScrollBar );
+
+ r = TRect( bounds.a.x+2, bounds.b.y-1, bounds.b.x-2, bounds.b.y );
+ TScrollBar *hScrollBar = new TScrollBar( r );
+ if( hScrollBar == 0 )
+ {
+ cout << "hScrollbar init error" << endl;
+ exit(1);
+ }
+ hScrollBar->options |= ofPostProcess;
+ if( left )
+ hScrollBar->growMode = (gfGrowHiY | gfGrowLoY);
+ insert( hScrollBar );
+
+ r = bounds;
+ r.grow( -1, -1 );
+ return new TInterior( r, hScrollBar, vScrollBar );
+}
+
+void TDemoWindow::sizeLimits( TPoint& minP, TPoint& maxP )
+{
+ TWindow::sizeLimits( minP, maxP );
+ minP.x = lInterior->size.x+9;
+}
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+ // new for tvguid16: set up initial dialog data
+ demoDialogData = new DialogData;
+ demoDialogData->checkBoxData = 1;
+ demoDialogData->radioButtonData = 2;
+ strcpy( demoDialogData->inputLineData, "Phone Mum!" );
+ sprintf( demoDialogData->inputLineRangeData, "%d", 16 );
+}
+
+TMyApp::~TMyApp()
+{
+
+ delete demoDialogData;
+
+}
+
+void TMyApp::handleEvent(TEvent& event)
+{
+ TApplication::handleEvent(event);
+ if( event.what == evCommand )
+ {
+ switch( event.message.command )
+ {
+ case cmMyNewWin:
+ newWindow();
+ break;
+ case cmNewDialog:
+ newDialog();
+ break;
+ default:
+ return;
+ }
+ clearEvent( event ); // clear event after handling
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar( TRect r )
+{
+ r.b.y = r.a.y + 1; // set bottom line 1 line below top line
+ return new TMenuBar( r,
+ *new TSubMenu( "~F~ile", kbAltF )+
+ *new TMenuItem( "~O~pen", cmMyFileOpen, kbF3, hcNoContext, "F3" )+
+ *new TMenuItem( "~N~ew", cmMyNewWin, kbF4, hcNoContext, "F4" )+
+ newLine()+
+ *new TMenuItem( "E~x~it", cmQuit, cmQuit, hcNoContext, "Alt-X" )+
+ *new TSubMenu( "~W~indow", kbAltW )+
+ *new TMenuItem( "~N~ext", cmNext, kbF6, hcNoContext, "F6" )+
+ *new TMenuItem( "~Z~oom", cmZoom, kbF5, hcNoContext, "F5" )+
+ *new TMenuItem( "~D~ialog", cmNewDialog, kbF2, hcNoContext, "F2" )
+ // new dialog menu added here
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( 0, kbF10, cmMenu ) +
+ // define an item
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // and another one
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+void TMyApp::newWindow()
+{
+ TRect r( 0, 0, 45, 13 ); // set initial size and position
+
+ /* SS: micro change here */
+
+ r.move( rand() % 34, rand() % 11 ); // randomly move around screen
+ TDemoWindow *window = new TDemoWindow ( r, "Demo Window", ++winNumber);
+ deskTop->insert(window); // put window into desktop and draw it
+}
+
+// changed from tvguid12: add buttons
+void TMyApp::newDialog()
+{
+ TDialog *pd = new TDialog( TRect( 20, 4, 60, 20), "Demo Dialog" );
+ if( pd )
+ {
+ TView *b = new TCheckBoxes( TRect( 3, 3, 18, 6),
+ new TSItem( "~H~varti",
+ new TSItem( "~T~ilset",
+ new TSItem( "~J~arlsberg", 0 )
+ )));
+ pd->insert( b );
+
+ pd->insert( new TLabel( TRect( 2, 2, 10, 3), "Cheeses", b ));
+
+ b = new TRadioButtons( TRect( 22, 3, 34, 6),
+ new TSItem( "~S~olid",
+ new TSItem( "~R~unny",
+ new TSItem( "~M~elted", 0 )
+ )));
+ pd->insert( b );
+
+ pd->insert( new TLabel( TRect( 21, 2, 33, 3), "Consistency", b ));
+
+ // add input line
+ b = new TInputLine( TRect( 3, 8, 37, 9 ), 128 );
+ pd->insert( b );
+ pd->insert( new TLabel( TRect( 2, 7, 24, 8 ),
+ "Delivery Instructions", b ));
+
+ // add input line with range validation
+ TInputLine *inp=new TInputLine( TRect( 3,11, 37,12 ), 32 );
+ pd->insert( inp );
+ pd->insert( new TLabel( TRect( 2,10, 26,11 ),
+ "A value from -20 to 590", inp ));
+ TValidator *vld=new TRangeValidator(-20,590);
+ inp->setValidator( vld );
+
+ pd->insert( new TButton( TRect( 15, 13, 25, 15 ), "~O~K", cmOK,
+ bfDefault ));
+ pd->insert( new TButton( TRect( 28, 13, 38, 15 ), "~C~ancel", cmCancel,
+ bfNormal ));
+
+ // we save the dialog data:
+ pd->setData( demoDialogData );
+
+ ushort control = deskTop->execView( pd );
+
+ // and read it back when the dialog box is successfully closed
+ if( control != cmCancel )
+ {
+ char *end;
+ pd->getData( demoDialogData );
+ // this is a message box with arguments like printf
+ messageBox( mfInformation|mfOKButton, "Deliver: %s value %ld",
+ demoDialogData->inputLineData,
+ strtol(demoDialogData->inputLineRangeData,&end,0) );
+ }
+ }
+ CLY_destroy( pd );
+}
+
+int main()
+{
+ readFile( fileToRead );
+ TMyApp myApp;
+ myApp.run();
+ deleteFile();
+ return 0;
+}
diff --git a/tvision/examples/tutorial/tvguid16.gpr b/tvision/examples/tutorial/tvguid16.gpr
new file mode 100644
index 0000000..786db35
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid16.gpr
Binary files differ
diff --git a/tvision/examples/tutorial/tvguid16.mkf b/tvision/examples/tutorial/tvguid16.mkf
new file mode 100644
index 0000000..2d53d9a
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid16.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvguid16$(ExIMK)
diff --git a/tvision/examples/tutorial/tvguid16.umk b/tvision/examples/tutorial/tvguid16.umk
new file mode 100644
index 0000000..f78d9ac
--- /dev/null
+++ b/tvision/examples/tutorial/tvguid16.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvguid16$(ExOBJ)
+
+LIBRARIES=
+
+tvguid16$(ExEXE):: \
+ ./tvguid16$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvguid16$(ExOBJ):: tvguid16.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tvedit/rhide.env b/tvision/examples/tvedit/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/tvedit/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/tvedit/tvedit.bmk b/tvision/examples/tvedit/tvedit.bmk
new file mode 100644
index 0000000..72b79f1
--- /dev/null
+++ b/tvision/examples/tvedit/tvedit.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvedit.exe
+!include ../../makes/common.bmk
+!include tvedit.umk
+
diff --git a/tvision/examples/tvedit/tvedit.cc b/tvision/examples/tvedit/tvedit.cc
new file mode 100644
index 0000000..fc9d8ba
--- /dev/null
+++ b/tvision/examples/tvedit/tvedit.cc
@@ -0,0 +1,28 @@
+/*****************************************************************************
+
+ Hi! here SET writing ;-)
+ That's a pretty silly example, but I include it more as a test. The real
+code for this example is inside the library and is called tvedit?.cc.
+Basically it defines a basic text editor applition. You can create your own
+text editor inheriting from TEditorApp and overriding the desired members.
+ Robert included it in the library in the past and I think is good idea
+because you can do an application based on TEditorApp in a few minutes.
+
+*****************************************************************************/
+
+#define Uses_TApplication
+#define Uses_TEditorApp
+#define Uses_TScreen
+#include <tv.h>
+
+int main()
+{
+ //TScreen::setShowCursorEver(True);
+ TEditorApp *myApp=new TEditorApp();
+ if (myApp)
+ {
+ myApp->run();
+ delete myApp;
+ }
+ return 0;
+}
diff --git a/tvision/examples/tvedit/tvedit.gpr b/tvision/examples/tvedit/tvedit.gpr
new file mode 100644
index 0000000..9925ed3
--- /dev/null
+++ b/tvision/examples/tvedit/tvedit.gpr
Binary files differ
diff --git a/tvision/examples/tvedit/tvedit.mkf b/tvision/examples/tvedit/tvedit.mkf
new file mode 100644
index 0000000..3933f48
--- /dev/null
+++ b/tvision/examples/tvedit/tvedit.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvedit$(ExIMK)
diff --git a/tvision/examples/tvedit/tvedit.umk b/tvision/examples/tvedit/tvedit.umk
new file mode 100644
index 0000000..7b1b401
--- /dev/null
+++ b/tvision/examples/tvedit/tvedit.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvedit$(ExOBJ)
+
+LIBRARIES=
+
+tvedit$(ExEXE):: \
+ ./tvedit$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvedit$(ExOBJ):: tvedit.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/tvhc/demohelp.txt b/tvision/examples/tvhc/demohelp.txt
new file mode 100644
index 0000000..d4291f7
--- /dev/null
+++ b/tvision/examples/tvhc/demohelp.txt
@@ -0,0 +1,505 @@
+.topic Nocontext=0
+ Turbo Vision demonstration Ü
+ ßßßßßßßßßßßßßßßßßßßßßßßßßßß
+Welcome to Turbo Vision. This is a demonstration program that allows
+you to view some of the capablilities of Turbo Vision. The ð menu is
+accessed by pressing Alt-Space. All the other menus are accessed by
+pressing Alt-Z, where Z is the first letter of the menu. For example,
+the "File" menu is pulled down by Alt-F.
+
+Press ESC to put this help screen away.
+
+.topic Viewer=2
+ File viewer Ü
+ ßßßßßßßßßßßß
+A file viewer views the contents of a text file. You can use the
+arrow keys to move about in the file. A file is loaded via the
+{File³Open:FOpen} menu item.
+
+ Up Move up one line
+ Down Move down one line
+ Right Move right one column
+ Left Move left one column
+ PgUp Move one page up
+ PgDn Move one page down
+ Home View right most column of the file
+ End View left most column of the file
+ Ctrl-PgUp View top of file
+ Ctrl-PgDn View bottom of file.
+
+File viewers can be resized and moved using the {Windows} menu.
+
+.topic Puzzle
+ Puzzle Ü
+ ßßßßßßß
+The puzzle window is a small game. The object is to get the characters
+to form the following pattern:
+
+ A B C D
+ E F G H
+ I J K L
+ M N O
+
+Clicking the mouse on a tile next to the empty space moves the tile
+into the space. Pressing one of the cursor keys (up, down, left, or
+right arrow) moves a tile into the empty space in the direction
+indicated by the cursor key. The move counter is updated every time
+a tile is moved.
+
+.topic Calculator
+ Calculator Ü
+ ßßßßßßßßßßß
+The calculator is a simple four-function calculator with add, subtract,
+multiply, and divide. To operate the calculator you can either use the
+keyboard or press the buttons on the calculator with the mouse. The 'C'
+key clears the calculator, the '' key will erases the last character
+typed, and the 'ñ' key toggles the value from positive to negative (the
+keyboard equivalent of 'ñ' is '_').
+
+.topic Calendar
+ Calendar Ü
+ ßßßßßßßßß
+The calendar displays the current month, highlighting todays date. The
+next and previous months can be viewed using the '+' or '-' keys
+respectivly. The mouse can also be used to change the month by pressing
+the  or  icons.
+
+.topic AsciiTable
+ ASCII Table Ü
+ ßßßßßßßßßßßß
+The ASCII table displays the entire IBM PC character set. The current
+character is marked by a blinking block cursor, and the hexadecimal and
+decimal ASCII values of the character are displayed below the chart. A
+new character is selected by pressing it on the keyboard, by clicking
+the mouse on it in the chart, or by moving the cursor using the cursor
+keys.
+
+.topic System
+ ð (System) menu Ü (Alt-Spacebar)
+ ßßßßßßßßßßßßßßßß
+The System menu appears on the far left of the menu bar and is
+represented by the ð symbol.
+
+When you pull down the ð menu, you see
+
+ {About:SAbout} {Puzzle:SPuzzle}
+ {Calendar:SCalendar} {Ascii Table:SAsciiTable}
+ {Calculator:SCalculator}
+
+.topic SAbout
+ ð³About Ü
+ ßßßßßßßß
+When you choose the About command from the ð (System) menu, a
+dialog box appears, showing copyright and version information.
+
+To close the box, press Esc, Space, or Enter, or click the OK
+button.
+
+.topic SPuzzle
+ ð³Puzzle Ü
+ ßßßßßßßßß
+The Puzzle menu item opens a small {Puzzle} game.
+
+.topic SCalendar
+ ð³Calendar Ü
+ ßßßßßßßßßßß
+The Calendar menu item opens a small {Calendar} which displays
+the current month. It also allows you to view other months.
+
+.topic SAsciiTable
+ ð³ASCII table Ü
+ ßßßßßßßßßßßßßß
+The ASCII menu items opens an {ASCII Table:AsciiTable} that
+displays the IBM PC character set.
+
+.topic SCalculator
+ ð³Calculator Ü
+ ßßßßßßßßßßßßß
+When you choose Calculator, a four-function {Calculator} is
+opened on the desktop.
+
+.topic File
+ File (Alt-F) Ü
+ ßßßßßßßßßßßßßß
+The File menu offers choices for opening files, changing
+directories, and exiting the program.
+
+ {Open:FOpen} {Change Dir:FChangeDir} {FExit}
+
+.topic FOpen
+ File³Open (F3) Ü
+ ßßßßßßßßßßßßßßßß
+The Open command displays the Open a File dialog box. In this
+dialog box you select the text file you want browse in a
+{file viewer:Viewer}.
+
+The {Open a File:FOFileOpenDBox} dialog box contains:
+
+ þ an {input box:FOName} with a history list
+ þ a {list box:FOFiles} to browse the directory
+ þ the standard {Cancel:CancelBtn} button
+ þ {Open:FOOpenBtn} action button
+ þ an information panel that describes the
+ selected file
+
+.topic FChangeDir
+ File³Change Dir...Ü
+ ßßßßßßßßßßßßßßßßßß
+File³Change Dir brings up the {Change Directory:FCChDirDBox}
+dialog box, in which you can change the current directory.
+
+.topic FDosShell
+ File³DOS Shell Ü
+ ßßßßßßßßßßßßßßß
+With the DOS Shell command, you can leave the program temporarily
+to perform a DOS command or run another program.
+
+To return to this program, type EXIT at the DOS prompt.
+
+.topic FExit
+ File³Exit Ü (Alt-X)
+ ßßßßßßßßßß
+The Exit command terminates this program.
+
+.topic Windows
+ Window Ü (Alt-W)
+ ßßßßßßß
+The Window menu contains commands to close, move and perform
+other window-management commands.
+
+Most of the windows in this program have all the standard window
+elements, including scroll bars, a close box, and zoom icons.
+
+For more about windows and their elements, refer to windows.
+
+
+ Window-management commands
+ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
+
+ {Size/Move:WSizeMove} {Zoom:WZoom}
+ {Tile:WTile} {Cascade:WCascade}
+ {Next:WNext} {Previous:WPrevious}
+ {Close:WClose}
+
+.topic WSizeMove
+ Window³Size/Move Ü (Ctrl-F5)
+ ßßßßßßßßßßßßßßßßß
+Choose this command to change the size or position of the active
+window.
+
+ ÜÜÜÜÜÜ
+ Size
+ ßßßßßß
+If you press Shift while you use the arrow keys, you can change
+the size of the active window. Once you've adjusted its size or
+position, press Enter.
+
+If a window has a Resize corner, you can drag that corner to
+resize the window.
+
+ ÜÜÜÜÜÜ
+ Move
+ ßßßßßß
+When you choose Window³Size/Move, the active window moves in
+response to the arrow keys. Once you've moved the window to where
+you want it, press Enter.
+
+You can also move a window by dragging its title bar with the
+mouse.
+
+.topic WZoom
+ Window³Zoom Ü (F5)
+ ßßßßßßßßßßßß
+Choose Zoom to resize the active window to the maximum size. If
+the window is already zoomed, you can choose this command to
+restore it to its previous size.
+
+You can also double-click anywhere on the window's title bar
+(except where an icon appears) to zoom or unzoom the window.
+
+.topic WTile
+ Window³Tile Ü
+ ßßßßßßßßßßßß
+Choose Window³Tile to tile all file viewers on the desktop.
+
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ ÉÍÍÍÍÍÍÍÍÍÍÍÍ1ÍÍ»ÚÄÄÄÄÄÄÄÄÄÄÄÄ2ÄÄ¿ ³
+ ³ º º³ ³ ³
+ ³ º º³ ³ ³
+ ³ º º³ ³ ³
+ ³ º º³ ³ ³
+ ³ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³
+ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄ3ÄÄ¿ÚÄÄÄÄÄÄÄÄÄÄÄÄ4ÄÄ¿ ³
+ ³ ³ ³³ ³ ³
+ ³ ³ ³³ ³ ³
+ ³ ³ ³³ ³ ³
+ ³ ³ ³³ ³ ³
+ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+ Tiled Windows
+
+.topic WCascade
+ Window³Cascade Ü
+ ßßßßßßßßßßßßßßß
+Choose Window³Cascade to stack all file viewers on the desktop.
+
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ1Ä¿
+ ³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ2Ä¿
+ ³³ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ3Ä¿
+ ³³³ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ4Í»
+ ³³³º º
+ ³³³º º
+ ³³³º º
+ ³³³º º
+ ³³³º º
+ ÀÀÀÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
+
+ Cascaded Windows
+
+.topic WNext
+ Window³Next Ü
+ ßßßßßßßßßßßß
+Choose Next to cycle forwards through the windows on the desktop.
+
+.topic WPrevious
+ Window³Previous Ü
+ ßßßßßßßßßßßßßßßß
+Choose Previous to cycle backwards through the windows on the desktop.
+
+.topic WClose
+ Window³Close Ü (Alt-F3)
+ ßßßßßßßßßßßßß
+Choose Close to close the active window.
+
+You can also click the Close box in the upper right corner to
+close a window.
+
+.topic Options
+ Options (Alt-O) Ü
+ ßßßßßßßßßßßßßßßßß
+The Options menu contains commands that let
+you change {color:OColors} and {mouse:OMouse} default settings.
+
+.topic OMouse
+ Options³Mouse... Ü
+ ßßßßßßßßßßßßßßßßß
+The Mouse command brings up the {Mouse Options:OMMouseDBox}
+dialog box, where you can set various options that control how your
+mouse works, including:
+
+ þ how fast a double-click is
+ þ which mouse button (right or left) is
+ active
+
+.topic OColors
+ Options³Colors... Ü
+ ßßßßßßßßßßßßßßßßßß
+The Colors item brings up the {Colors dialog:OCColorsDBox} box,
+where you can customize the colors of the display.
+
+.topic OSaveDesktop
+ Options³Save Desktop Ü
+ ßßßßßßßßßßßßßßßßßßßßß
+Saves the state of all open windows to a file call TVDEMO.DSK. This
+file can be reloaded by selecting {Options³Restore Desktop:ORestoreDesktop}.
+
+.topic ORestoreDesktop
+ Options³Restore Desktop Ü
+ ßßßßßßßßßßßßßßßßßßßßßßßß
+Restore a previously-saved state of all open windows from a file
+call TVDEMO.DSK. This file is saved via the
+{Options³Save Desktop:OSaveDesktop} menu command.
+
+.topic FOFileOpenDBox
+ Help on Open a File Dialog Box Ü
+ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
+The Open a File dialog box contains an input box, a {file list:FOFiles},
+a file information panel, the standard button {Cancel:CancelBtn},
+one other action button ({Open:FOOpenBtn}), plus a history list
+that's attached to the {Name inputbox:FOName}.
+
+.topic FOName
+ ÚÄ Name ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+The Name input box is where you enter the name of the file to
+load, or the file-name mask to use as a filter for the Files list
+box (for example, *.*).
+
+.topic FOFiles
+ Ú Files ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ ³
+ ³ FILENM01.PAS ³ FILENM09.PAS ³
+ ³ FILENM02.PAS ³ FILENM10.PAS ³
+ ³ FILENM03.PAS ³ FILENM11.PAS ³
+ ³ FILENM04.PAS ³ FILENM12.PAS ³
+ ³ FILENM05.PAS ³ .. ³
+ ³ FILENM06.PAS ³ \MOREXAMP ³
+ ³ FILENM07.PAS ³ \TOURS ³
+ ³ FILENM08.PAS ³ \ANSWERS.DIR ³
+ ³ ±±±þ±±±±±±±±±±±±±±±±±±±±±± ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+The Files list box lists the names of files in the current
+directory that match the file-name mask in the Name input box,
+plus the parent directory and all subdirectories.
+
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ C:\TP\EXAMPLES\*.PAS ³
+ ³ HELLO.PAS 52 Jul 14,1990 12:00pm ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+The File information panel shows the path name, file name, date,
+time, and size of the selected file.
+
+None of the items on this information panel are selectable.
+
+.topic FOOpenBtn
+ ÚÄÄÄÄÄÄÄÄÄÄ¿
+ ³ [ Open ] ³
+ ÀÄÄÄÄÄÄÄÄÄÄÙ
+The Open button opens a new Viewer window and places the selected
+file in that window.
+
+.topic CancelBtn
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ [ Cancel ] ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
+
+If you choose Cancel, nothing changes and no action occurs, and
+the dialog box is put away.
+
+(Esc always cancels a dialog box, even if a Cancel button does
+not appear.)
+
+.topic OpenBtn
+ ÚÄÄÄÄÄÄÄÄÄÄ¿
+ ³ [ Open ] ³
+ ÀÄÄÄÄÄÄÄÄÄÄÙ
+
+In the Open a File dialog box, if you choose the Open button
+TVDEMO opens a new {file viewer:Viewer} and places the selected
+file in that window.
+
+.topic FCChDirDBox
+ Help on the Change Directory dialog box Ü
+ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
+The Change Directory dialog box consists of an input box, a list
+box, the standard OK and Help buttons, and two other buttons
+(Chdir and Revert).
+
+ Ú Directory Name ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+The Directory Name input box is where you type in the path of the
+new directory.
+
+ Ú Directory Tree ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ Drives ³
+ ³ ÀÄÂC:\ ³
+ ³ ÀÄÂTP ³
+ ³ ÀÄÄTVISION ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+The Directory Tree list box enables you to navigate directories
+by using the selecting bar and pressing Enter.
+
+If you're using the keyboard, press Enter to make the selected
+directory be the current directory, then choose OK or press Esc
+to exit the dialog box.
+
+ ÚÄÄÄÄÄÄÄÄÄÄ¿
+ ³ [Chdir ] ³
+ ÀÄÄÄÄÄÄÄÄÄÄÙ
+The Chdir button changes the current directory once you've
+selected or typed in a directory name.
+
+ ÚÄÄÄÄÄÄÄÄÄÄ¿
+ ³ [Revert] ³
+ ÀÄÄÄÄÄÄÄÄÄÄÙ
+The Revert button goes back to the previous directory, as long as
+you haven't yet exited the dialog box.
+
+.topic OMMouseDBox
+ Help on the Mouse Options dialog box Ü
+ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
+This dialog box consists of one check box, one slider bar, and
+the standard buttons OK and Cancel.
+
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ Mouse Double Click ³
+ ³ Slow Medium Fast ³
+ ³ ±±±±±±±±±±±þ±±±±±±±±±± ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+The Mouse Double Click slider bar adjusts the double-click speed of
+your mouse.
+
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ [X] Reverse Mouse Buttons ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+Reverse Mouse Buttons makes the right mouse button take on the
+normal functions of the left--and vice versa.
+
+ See also:
+ ÍÍÍÍÍÍÍÍÍ
+ {Options³Mouse... menu command:OMouse}
+
+.topic OCColorsDBox
+ Help on the Colors dialog box Ü
+ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
+The Colors dialog box consists of two list boxes, a text display
+area, the standard OK, Cancel, and Help buttons, and one of the
+following:
+
+ þ On color and black-and-white systems, it
+ also contains two color palettes.
+ þ On monochrome systems, it contains a set
+ of radio buttons instead of the palettes.
+
+This dialog box is where you can change the colors of different
+parts of this program.
+
+ ÚÄ Group ÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ Desktop ³
+ ³ Menus þ³
+ ³ Dialogs/Calc ±³
+ ³ Puzzle ±³
+ ³ Calendar ±³
+ ³ Ascii table ±³
+ ³ ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+The Group list box contains the names of the different regions of
+the program that you can customize.
+
+ ÚÄ Item ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ Color ³
+ ³ þ³
+
+When you select a group from the Group list, the Item list box
+displays the names of the different views in that region.
+
+ Ú Foreground ¿ Ú Background ¿
+ ³ °±²°±²°±²° ³ ³ ²°±²°±²°±² ³
+ ³ ²°±²°±²°±² ³ ³ °±²°±²°±²° ³
+ ³ ±²°±²°±²°± ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
+On color and black-and-white systems, you use the Foreground and
+Background palettes to modify colors.
+
+ Ú Colors ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ (ù) Mono low ³
+ ³ ( ) Mono high ³
+ ³ ( ) Mono underscore ³
+ ³ ( ) Mono inverse ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+
+On monochrome systems, you use the Colors set of radio buttons
+systems to modify the character attributes.
+
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ Text Text Text ³
+ ³ Text Text Text ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+On all systems, the display text (above the Help button) shows
+the current color or attribute settings.
+
+Changes do not take effect on the desktop until you close the
+Colors dialog box by choosing OK.
+
diff --git a/tvision/examples/tvhc/rhide.env b/tvision/examples/tvhc/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/tvhc/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/tvhc/tvhc.bmk b/tvision/examples/tvhc/tvhc.bmk
new file mode 100644
index 0000000..b5085f9
--- /dev/null
+++ b/tvision/examples/tvhc/tvhc.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: tvhc.exe
+!include ../../makes/common.bmk
+!include tvhc.umk
+
diff --git a/tvision/examples/tvhc/tvhc.cc b/tvision/examples/tvhc/tvhc.cc
new file mode 100644
index 0000000..dceaaff
--- /dev/null
+++ b/tvision/examples/tvhc/tvhc.cc
@@ -0,0 +1,992 @@
+/*-----------------------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Turbo Vision Help Compiler Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Modified: QNX RtP port by Mike Gorchak, 2000 */
+/* Modified: 1) Headers mechanism and sign mismatch comparissons. */
+/* 2) Adapted to use compatlayer (new ISO C++ 1998 and gcc 3.x)*/
+/* by Salvador E. Tropea (SET) 2002-2003 */
+/* */
+/*-----------------------------------------------------------------------*/
+
+/*===== TVHC ============================================================*/
+/* Turbo Vision help file compiler documentation. */
+/*=======================================================================*/
+/* */
+/* Refer to DEMOHELP.TXT for an example of a help source file. */
+/* */
+/* This program takes a help script and produces a help file (.HLP) */
+/* and a help context file (.H). The format for the help file is */
+/* very simple. Each context is given a symbolic name (i.e FileOpen) */
+/* which is then put in the context file (i.e. hcFileOpen). The text */
+/* following the topic line is put into the help file. Since the */
+/* help file can be resized, some of the text will need to be wrapped */
+/* to fit into the window. If a line of text is flush left with */
+/* no preceeding white space, the line will be wrapped. All adjacent */
+/* wrappable lines are wrapped as a paragraph. If a line begins with */
+/* a space it will not be wrapped. For example, the following is a */
+/* help topic for a File|Open menu item. */
+/* */
+/* |.topic FileOpen */
+/* | File|Open */
+/* | --------- */
+/* |This menu item will bring up a dialog... */
+/* */
+/* The "File|Open" will not be wrapped with the "----" line since */
+/* they both begin with a space, but the "This menu..." line will */
+/* be wrapped. */
+/* The syntax for a ".topic" line is: */
+/* */
+/* .topic symbol[=number][, symbol[=number][...]] */
+/* */
+/* Note a topic can have multiple symbols that define it so that one */
+/* topic can be used by multiple contexts. The number is optional */
+/* and will be the value of the hcXXX context in the context file */
+/* Once a number is assigned all following topic symbols will be */
+/* assigned numbers in sequence. For example, */
+/* */
+/* .topic FileOpen=3, OpenFile, FFileOpen */
+/* */
+/* will produce the follwing help context number definitions, */
+/* */
+/* hcFileOpen = 3; */
+/* hcOpenFile = 4; */
+/* hcFFileOpen = 5; */
+/* */
+/* Cross references can be imbedded in the text of a help topic which */
+/* allows the user to quickly access related topics. The format for */
+/* a cross reference is as follows, */
+/* */
+/* {text[:alias]} */
+/* */
+/* The text in the brackets is highlighted by the help viewer. This */
+/* text can be selected by the user and will take the user to the */
+/* topic by the name of the text. Sometimes the text will not be */
+/* the same as a topic symbol. In this case you can use the optional */
+/* alias syntax. The symbol you wish to use is placed after the text */
+/* after a ':'. The following is a paragraph of text using cross */
+/* references, */
+/* */
+/* |The {file open dialog:FileOpen} allows you specify which */
+/* |file you wish to view. If it also allow you to navigate */
+/* |directories. To change to a given directory use the */
+/* |{change directory dialog:ChDir}. */
+/* */
+/* The user can tab or use the mouse to select more information about */
+/* the "file open dialog" or the "change directory dialog". The help */
+/* compiler handles forward references so a topic need not be defined */
+/* before it is referenced. If a topic is referenced but not */
+/* defined, the compiler will give a warning but will still create a */
+/* useable help file. If the undefined reference is used, a message */
+/* ("No help available...") will appear in the help window. */
+/*=======================================================================*/
+
+#define Uses_string
+#define Uses_stdio
+#define Uses_ctype
+#define Uses_limits
+#define Uses_stdlib
+#define Uses_fstream
+#define Uses_fpstream
+#define Uses_StrStream
+#define Uses_TSortedCollection
+#define Uses_THelpFile
+#include <tv.h>
+
+#include "tvhc.h"
+
+UsingNamespaceStd
+
+//======================= File Management ===============================//
+
+TProtectedStream::TProtectedStream( char *aFileName, CLY_OpenModeT aMode ) :
+ fstream( aFileName, aMode )
+{
+ strcpy(fileName, aFileName);
+ mode = aMode;
+}
+
+void error(char *text);
+
+void QNXSplitExt(char* PathName, char* Name, char* Ext)
+{
+ for (int EachS=strlen(PathName)-1; EachS>=0; EachS--)
+ {
+ if ((EachS==0)||(*(PathName+EachS)=='/'))
+ {
+ strcpy(Ext, "");
+ strcpy(Name, PathName);
+ return;
+ }
+ if (*(PathName+EachS)=='.')
+ {
+ *(PathName+EachS)=0x00;
+ strcpy(Name, PathName);
+ strcpy(Ext, PathName+EachS+1);
+ *(PathName+EachS)='.';
+ return;
+ }
+ }
+}
+
+//----- replaceExt(fileName, nExt, force) -------------------------------//
+// Replace the extension of the given file with the given extension. //
+// If an extension already exists Force indicates if it should be //
+// replaced anyway. //
+//-----------------------------------------------------------------------//
+
+void replaceExt( char *fileName, char *nExt, Boolean force, char *dest )
+{
+ char dir[PATH_MAX];
+ //char name[NAME_MAX];
+ char ext[PATH_MAX]; // NAME_MAX
+ CreateStrStream(os,buffer,PATH_MAX);
+
+ QNXSplitExt(fileName, dir, ext);
+
+ if (force || (strlen(ext) == 0))
+ {
+ os << dir << nExt << ends;
+ strcpy(dest,GetStrStream(os,buffer));
+ }
+ else
+ strcpy(dest,fileName);
+}
+
+//----- fExist(fileName) ------------------------------------------------/
+// Returns true if the file exists false otherwise. /
+//-----------------------------------------------------------------------/
+
+Boolean fExists(char *fileName)
+{
+ FILE *f;
+
+ if ((f = fopen(fileName, "r")) == NULL) return False;
+ fclose(f);
+ return True;
+}
+
+//======================== Line Management ==============================//
+//----- getLine(s) ------------------------------------------------------//
+// Returns the next line out of the stream. //
+//-----------------------------------------------------------------------//
+
+char *getLine( fstream& s)
+{
+ if (s.eof())
+ {
+ strcpy(line, "\x1A");
+ return line;
+ }
+ if (!lineInBuffer)
+ s.getline(line, MAXSTRSIZE, '\n');
+ lineInBuffer = False;
+ ++lineCount;
+ return line;
+}
+
+//----- unGetLine(s) ----------------------------------------------------//
+// Return given line into the stream. //
+//-----------------------------------------------------------------------//
+
+void unGetLine( char *s )
+{
+ strcpy(line,s);
+ lineInBuffer = True;
+ --lineCount;
+}
+
+//========================= Error routines ==============================//
+
+//----- prntMsg(text) ---------------------------------------------------//
+// Used by Error and Warning to print the message. //
+//-----------------------------------------------------------------------//
+
+void prntMsg( const char *pref, const char *text )
+{
+ if (lineCount > 0)
+ cout << pref << ": " << helpName << "("
+ << lineCount << "): " << text << "\n";
+ else
+ cout << pref << ": " << helpName << " "
+ << text << "\n";
+}
+
+//----- error(text) -----------------------------------------------------//
+// Used to indicate an error. Terminates the program //
+//-----------------------------------------------------------------------//
+
+void error( char *text )
+{
+ prntMsg("Error", text);
+ exit(1);
+}
+
+//----- warning(text) ---------------------------------------------------//
+// Used to indicate an warning. //
+//-----------------------------------------------------------------------//
+
+void warning( const char *text )
+{
+ prntMsg("Warning", text);
+}
+
+//====================== Topic Reference Management =====================//
+
+void disposeFixUps( TFixUp *&p )
+{
+ TFixUp *q;
+
+ while (p != 0)
+ {
+ q = p->next;
+ delete p;
+ p = q;
+ }
+}
+
+//----- TRefTable -------------------------------------------------------//
+// TRefTable is a collection of TReference pointers used as a symbol //
+// table. If the topic has not been seen, a forward reference is //
+// inserted and a fix-up list is started. When the topic is seen all //
+// forward references are resolved. If the topic has been seen already //
+// the value it has is used. //
+//-----------------------------------------------------------------------//
+
+TRefTable::TRefTable( ccIndex aLimit, ccIndex aDelta ) :
+ TSortedCollection( aLimit, aDelta )
+{
+}
+
+int TRefTable::compare( void *key1, void *key2 )
+{
+ int compValue;
+
+
+ compValue = strcmp( (char *)key1, (char *)key2 );
+ if (compValue > 0)
+ return 1;
+ else if (compValue < 0)
+ return (-1);
+ else
+ return(0);
+}
+
+void TRefTable::freeItem( void *item )
+{
+ TReference *ref;
+
+ ref = (TReference *) item;
+ if (ref->resolved == False)
+ disposeFixUps(ref->val.fixUpList);
+ delete ref->topic;
+ delete ref;
+}
+
+TReference *TRefTable::getReference( char *topic )
+{
+ TReference *ref;
+ int i;
+
+ if (search(topic, i))
+ ref = (TReference *) at(i);
+ else
+ {
+ ref = new TReference;
+ ref->topic = newStr(topic);
+ ref->resolved = False;
+ ref->val.fixUpList = 0;
+ insert(ref);
+ }
+ return(ref);
+}
+
+void* TRefTable::keyOf( void *item )
+{
+ return(((TReference *)item)->topic);
+}
+
+//----- initRefTable ---------------------------------------------------//
+// Make sure the reference table is initialized. //
+//----------------------------------------------------------------------//
+
+void initRefTable()
+{
+ if (refTable == 0)
+ refTable = new TRefTable(5,5);
+}
+
+//---- RecordReference -------------------------------------------------//
+// Record a reference to a topic to the given stream. This routine //
+// handles forward references. //
+//----------------------------------------------------------------------//
+
+void recordReference( char *topic, opstream& s )
+{
+ int i;
+ TReference *ref;
+ TFixUp *fixUp;
+
+ initRefTable();
+ ref = refTable->getReference(topic);
+ if (ref->resolved == True)
+ s << ref->val.value;
+ else
+ {
+ fixUp = new TFixUp;
+ fixUp->pos = s.tellp();
+ i = -1;
+ s << i;
+ fixUp->next = ref->val.fixUpList;
+ ref->val.fixUpList = fixUp;
+ }
+}
+
+void doFixUps( TFixUp *p, ushort value, fpstream& s )
+{
+ long pos;
+
+ for(pos = s.tellg(); (p != 0); p = p->next)
+ {
+ s.seekp(p->pos);
+ s << (int)value;
+ }
+ s.seekp(pos);
+}
+
+//----- resolveReference -----------------------------------------------//
+// Resolve a reference to a topic to the given stream. This function //
+// handles forward references. //
+//----------------------------------------------------------------------//
+
+void resolveReference( char *topic, ushort value, fpstream& s )
+{
+ TReference *ref;
+ char bufStr[MAXSIZE];
+
+ initRefTable();
+ ref = refTable->getReference(topic);
+ if (ref->resolved )
+ {
+ strcpy(bufStr,"Redefinition of ");
+ strcat(bufStr,ref->topic);
+ error(bufStr);
+ }
+ else
+ {
+ doFixUps(ref->val.fixUpList,value,s);
+ disposeFixUps(ref->val.fixUpList);
+ ref->resolved = True;
+ ref->val.value = value;
+ }
+}
+
+//======================= Help file parser =============================//
+
+void skipWhite( char *line, unsigned &i )
+{
+ while (i <= strlen(line) && (line[i] == ' ') || (line[i] == 8))
+ ++i;
+}
+
+int checkForValidChar( char ch )
+{
+ if (isalnum(ch) || (ch == '_'))
+ return(0);
+ return(-1);
+}
+
+
+void skipToNonWord( char *line, unsigned &i )
+{
+ while (i <= strlen(line) && (!checkForValidChar(line[i])))
+ ++i;
+}
+
+//----- getWord --------------------------------------------------------//
+// Extract the next word from the given line at offset i. //
+//----------------------------------------------------------------------//
+
+char getword[MAXSIZE];
+
+char *getWord( char *line, unsigned &i )
+{
+ unsigned j;
+ char *strptr;
+
+ skipWhite(line,i);
+ j = i;
+ if (j > strlen(line))
+ strcpy(getword,"");
+ else
+ {
+ ++i;
+ if (!checkForValidChar(line[j]))
+ skipToNonWord(line, i);
+ strptr = line + j;
+ strncpy(getword,strptr,i - j);
+ getword[i-j] = '\0';
+ }
+ return getword;
+}
+
+//---- topicDefinition -------------------------------------------------//
+// Extracts the next topic definition from the given line at i. //
+//----------------------------------------------------------------------//
+
+TTopicDefinition::TTopicDefinition( char *aTopic, ushort aValue )
+{
+ topic = newStr(aTopic);
+ value = aValue;
+ next = 0;
+}
+
+TTopicDefinition::~TTopicDefinition()
+{
+ delete topic;
+ if (next != 0)
+ delete next;
+}
+
+int is_numeric(char *str)
+{
+ unsigned i;
+
+ for(i = 0; i < strlen(str); ++i)
+ if (!isdigit(str[i]))
+ return 0;
+ return 1;
+}
+
+TTopicDefinition *topicDefinition( char *line, unsigned &i )
+{
+ unsigned j;
+ char topic[MAXSTRSIZE], w[MAXSTRSIZE], *endptr;
+ static int helpCounter = 2; //1 is hcDragging
+
+ strcpy(topic,getWord(line, i));
+ if (strlen(topic) == 0)
+ {
+ error("Expected topic definition");
+ return(0);
+ }
+ else
+ {
+ j = i;
+ strcpy(w,getWord(line, j));
+ if (strcmp(w,"=") == 0)
+ {
+ i = j;
+ strcpy(w,getWord(line, i));
+ if (!is_numeric(w))
+ error("Expected numeric");
+ else
+ helpCounter = (int) strtol(w, &endptr,10);
+ }
+ else
+ ++helpCounter;
+ return(new TTopicDefinition(topic, helpCounter));
+ }
+}
+
+//---- topicDefinitionList----------------------------------------------//
+// Extracts a list of topic definitions from the given line at i. //
+//----------------------------------------------------------------------//
+
+TTopicDefinition *topicDefinitionList( char *line, unsigned &i )
+{
+ unsigned j;
+ char w[MAXSTRSIZE];
+ TTopicDefinition *topicList, *p;
+
+ j = i;
+ topicList = 0;
+ do {
+ i = j;
+ p = topicDefinition(line, i);
+ if (p == 0 )
+ {
+ if (topicList != 0)
+ delete topicList;
+ return(0);
+ }
+ p->next = topicList;
+ topicList = p;
+ j = i;
+ strcpy(w,getWord(line, j));
+ } while ( strcmp(w,",") == 0);
+ return(topicList);
+}
+
+//---- topicHeader -----------------------------------------------------//
+// Parse a Topic header //
+//----------------------------------------------------------------------//
+
+TTopicDefinition *topicHeader( char *line )
+{
+ unsigned i;
+ char w[75];
+
+ i = 0;
+ strcpy(w, getWord(line, i));
+ if (strcmp(w, commandChar) != 0)
+ return(0);
+ strcpy(w, getWord(line, i));
+ strupr(w);
+ if (strcmp(w, "TOPIC") == 0)
+ return topicDefinitionList(line, i);
+ else
+ {
+ error("TOPIC expected");
+ return(0);
+ }
+}
+
+void addToBuffer( char *line, Boolean wrapping )
+{
+ uchar *bufptr;
+
+ bufptr = &buffer[ofs];
+ ofs += strlen(line);
+ if( ofs > bufferSize )
+ error("Text too long");
+ strcpy((char *)bufptr, line);
+ bufptr += (strlen(line));
+ if (wrapping == False)
+ *bufptr = '\n';
+ else
+ *bufptr = ' ';
+ ofs++;
+}
+
+
+void addXRef( char *xRef, int offset, uchar length, TCrossRefNode *&xRefs )
+{
+ TCrossRefNode *p, *pp, *prev;
+
+ p = new TCrossRefNode;
+ p->topic = newStr(xRef);
+ p->offset = offset;
+ p->length = length;
+ p->next = 0;
+ if (xRefs == 0)
+ xRefs = p;
+ else
+ {
+ pp = xRefs;
+ prev = pp;
+ while (pp != 0)
+ {
+ prev = pp;
+ pp = pp->next;
+ }
+ prev->next = p;
+ }
+}
+
+void replaceSpacesWithFF( char *line, int start, uchar length )
+{
+ int i;
+
+ for(i = start; i <= (start + length); ++i)
+ if (line[i] == ' ')
+ line[i] = 0xFF;
+}
+
+void strdel(char *string, int pos, int len)
+{
+ char tempstr[MAXSTRSIZE];
+ char *strptr;
+
+ strncpy(tempstr, string, pos);
+ tempstr[pos] = 0;
+ strptr = string + pos + len;
+ strcat(tempstr, strptr);
+ strcpy(string, tempstr);
+}
+
+void scanForCrossRefs( char *line, int& offset, TCrossRefNode *&xRefs )
+{
+ int i;
+ char begXRef = '{';
+ char endXRef = '}';
+ char aliasCh = ':';
+ char *begPtr, *endPtr, *aliasPtr, *tempPtr;
+ int begPos, endPos, aliasPos;
+ char xRef[75];
+
+ i = 0;
+ do {
+ if ((begPtr = strchr(line+i,begXRef)) == 0)
+ i = 0;
+ else
+ {
+ begPos = (int)(begPtr - (line+i));
+ i += begPos + 1;
+ if (line[i + 1] == begXRef)
+ {
+ strdel(line, i, 1);
+ ++i;
+ }
+ else
+ {
+ if ((endPtr = strchr(line+i,endXRef)) == 0)
+ {
+ error("Unterminated topic reference.");
+ ++i;
+ }
+ else
+ {
+ endPos = (int)(endPtr - (line + i));
+ aliasPtr = strchr(line+i, aliasCh);
+ if ((aliasPtr == 0) || (aliasPtr > endPtr))
+ {
+ tempPtr = line + i;
+ strncpy(xRef, tempPtr, endPos);
+ xRef[endPos] = 0;
+ addXRef(xRef, (offset + ofs + i), endPos, xRefs);
+ }
+ else
+ {
+ aliasPos = (int)(aliasPtr - (line + i));
+ tempPtr = line ;
+ tempPtr += aliasPos+i+1;
+ strncpy(xRef, tempPtr, (endPos - aliasPos -1));
+ xRef[endPos - aliasPos -1] = 0;
+ addXRef(xRef, (offset + ofs + i), (aliasPos), xRefs);
+ strdel(line, (i + aliasPos), (endPos - aliasPos));
+ endPtr = aliasPtr;
+ endPos = aliasPos;
+ }
+ replaceSpacesWithFF(line, i, endPos -1);
+ strdel(line, i + endPos, 1);
+ strdel(line, i-1, 1);
+ i += (endPos - 2);
+ }
+ }
+ }
+
+ } while (i != 0);
+}
+
+
+Boolean isEndParagraph( State state )
+{
+ int flag;
+ int wrapping = 1;
+ int notWrapping = 2;
+
+ flag =
+ ((line[0] == 0) ||
+ (line[0] == commandChar[0]) ||
+ (line[0] == 26) ||
+ ((line[0] == ' ') && (state == wrapping)) ||
+ ((line[0] != ' ') && (state == notWrapping)));
+ if (flag)
+ return(True);
+ else
+ return(False);
+}
+
+//---- readParagraph ----------------------------------------------------//
+// Read a paragraph of the screen. Returns the paragraph or 0 if the //
+// paragraph was not found in the given stream. Searches for cross //
+// references and updates the xRefs variable. //
+//-----------------------------------------------------------------------//
+
+TParagraph *readParagraph( fstream& textFile, int& offset, TCrossRefNode *&xRefs )
+{
+ State state;
+ Boolean flag;
+ char line[MAXSTRSIZE];
+ TParagraph *p;
+
+ ofs = 0;
+ state = undefined;
+ strcpy(line, getLine(textFile));
+ while (strlen(line) == 0)
+ {
+ flag = (state == wrapping)? True: False;
+ addToBuffer(line, flag);
+ strcpy(line, getLine(textFile));
+ }
+
+ if (isEndParagraph(state) == True)
+ {
+ unGetLine(line);
+ return(0);
+ }
+ while (isEndParagraph(state) == False)
+ {
+ if (state == undefined )
+ if (line[0] == ' ')
+ state = notWrapping;
+ else
+ state = wrapping;
+ scanForCrossRefs(line, offset, xRefs);
+ flag = (state == wrapping)? True: False;
+ addToBuffer(line, flag);
+ strcpy(line, getLine(textFile));
+ }
+ unGetLine(line);
+ p = new TParagraph;
+ p->size = ofs;
+ p->wrap = (state == wrapping)? True: False;
+ p->text = new char[ofs];
+ memmove(p->text, buffer, ofs);
+ p->next = 0;
+ offset += ofs;
+ return(p);
+}
+
+void handleCrossRefs( opstream& s, int xRefValue )
+{
+ TCrossRefNode *p;
+
+ for(p = xRefs; (xRefValue > 0) ; --xRefValue)
+ {
+ if (p != 0)
+ p = p->next;
+ }
+ if (p != 0)
+ recordReference((p->topic), s);
+}
+
+void skipBlankLines( fstream& s )
+{
+ char line[256];
+
+ line[0] = 0;
+ while (line[0] == 0)
+ strcpy(line,getLine(s));
+ unGetLine(line);
+}
+
+int xRefCount()
+{
+ int i;
+ TCrossRefNode *p;
+
+ i = 0;
+ for (p=xRefs; (p != 0); p=p->next)
+ ++i;
+ return(i);
+}
+
+void disposeXRefs( TCrossRefNode *p )
+{
+ TCrossRefNode *q;
+
+ while (p != 0)
+ {
+ q = p;
+ p = p->next;
+ delete q->topic;
+ delete q;
+ }
+}
+
+void recordTopicDefinitions( TTopicDefinition *p, THelpFile& helpFile )
+{
+ while (p != 0)
+ {
+ resolveReference(p->topic, p->value, *(helpFile.stream));
+ helpFile.recordPositionInIndex(p->value);
+ p = p->next;
+ }
+}
+
+//---- readTopic -------------------------------------------------------//
+// Read a topic from the source file and write it to the help file //
+//----------------------------------------------------------------------//
+
+void readTopic( fstream& textFile, THelpFile& helpFile )
+{
+ TParagraph *p;
+ THelpTopic *topic;
+ TTopicDefinition *topicDef;
+ int i, j, offset;
+ TCrossRef ref;
+ TCrossRefNode *refNode;
+
+ // Get screen command
+ skipBlankLines(textFile);
+ strcpy(line, getLine(textFile));
+
+ topicDef = topicHeader(line);
+
+ topic = new THelpTopic;
+
+ // read paragraphs
+ xRefs = 0;
+ offset = 0;
+ p = readParagraph(textFile, offset, xRefs);
+ while (p != 0)
+ {
+ topic->addParagraph(p);
+ p = readParagraph(textFile, offset, xRefs);
+ }
+
+ i = xRefCount();
+ topic->setNumCrossRefs(i);
+ refNode = xRefs;
+ for( j = 0; j < i; ++j)
+ {
+ ref.offset = refNode->offset;
+ ref.length = refNode->length;
+ ref.ref = j;
+ topic->setCrossRef(j, ref);
+ refNode = refNode->next;
+ }
+
+ recordTopicDefinitions(topicDef, helpFile);
+
+ crossRefHandler = handleCrossRefs;
+ helpFile.putTopic(topic);
+
+
+ if (topic != 0)
+ delete topic;
+ if (topicDef != 0)
+ delete topicDef;
+ disposeXRefs(xRefs);
+
+ skipBlankLines(textFile);
+}
+
+void doWriteSymbol(void *p, void *p1)
+{
+ int numBlanks, i;
+ CreateStrStream(os,line,MAXSTRSIZE);
+
+ TProtectedStream *symbFile = (TProtectedStream *)p1;
+ if (((TReference *)p)->resolved )
+ {
+ os << " hc" << (char *)((TReference *)p)->topic;
+ numBlanks = 20 - strlen((char *)((TReference *)p)->topic);
+ for (i = 0; i < numBlanks; ++i)
+ os << ' ';
+ os << " = " << ((TReference *)p)->val.value << ","<< ends;
+ *symbFile << GetStrStream(os,line) << "\n";
+ }
+ else
+ {
+ os << "Unresolved forward reference \""
+ << ((TReference *)p)->topic << "\"" << ends;
+ warning(GetStrStream(os,line));
+ }
+}
+
+//---- writeSymbFile ---------------------------------------------------//
+// Write the .H file containing all screen titles as constants. //
+//----------------------------------------------------------------------//
+
+void writeSymbFile( TProtectedStream *symbFile )
+{
+ char header1[] = "const int\n";
+
+ *symbFile << header1;
+ refTable->forEach(doWriteSymbol, symbFile);
+ symbFile->seekp(-3L, CLY_IOSEnd);
+ *symbFile << ";\n";
+
+}
+
+//---- processtext -----------------------------------------------------//
+// Compile the given stream, and output a help file. //
+//----------------------------------------------------------------------//
+
+void processText( TProtectedStream& textFile,
+ fpstream& helpFile,
+ TProtectedStream& symbFile )
+{
+ THelpFile *helpRez;
+
+ helpRez = new THelpFile(helpFile);
+
+ while (!textFile.eof())
+ readTopic(textFile, *helpRez);
+ writeSymbFile(&symbFile);
+ delete helpRez;
+}
+
+//---- checkOverwrite --------------------------------------------------//
+// Check whether the output file name exists. If it does, ask whether //
+// it's ok to overwrite it. //
+//----------------------------------------------------------------------//
+
+void checkOverwrite( char *fName )
+{
+ if (fExists(fName))
+ {
+ cerr << "File already exists: " << fName << ". Overwrite? (y/n) ";
+
+ char ch;
+
+ cin >> ch;
+
+ if (toupper(ch)!='Y')
+ exit(1);
+ }
+}
+
+//========================== Program Block ==========================//
+
+int main(int argc, char **argv)
+{
+ char textName[PATH_MAX];
+ char symbName[PATH_MAX];
+ fpstream* helpStrm;
+
+ char initialText[] = "Help Compiler Version 1.0 Copyright (c) 1991"
+ " Borland International.\nQNX RtP port by Mike Gorchak, 2000.\nAdapted to RHTV by SET, 2002-2003.\n";
+ char helpText[] =
+ "\n Syntax tvhc <Help text>[.txt] [<Help file>[.hlp] [<Symbol file>[.h]]\n"
+ "\n"
+ " Help text = Help file source\n"
+ " Help file = Compiled help file\n"
+ " Symbol file = An include file containing all the screen names as const's\n";
+
+ char bufStr[MAXSTRSIZE];
+
+ cout << initialText;
+
+ if (argc < 2)
+ {
+ cout << helpText;
+ exit(1);
+ }
+
+ // Calculate file names
+ replaceExt(argv[1], ".txt", True, textName);
+ if (!fExists(textName))
+ {
+ strcpy(bufStr,"File ");
+ strcat(bufStr,textName);
+ strcat(bufStr," not found.");
+ error(bufStr);
+ }
+
+ if (argc >= 3)
+ replaceExt(argv[2], ".hlp", True, helpName);
+ else
+ replaceExt(textName, ".hlp", True, helpName);
+
+ checkOverwrite( helpName );
+
+ if (argc >= 4)
+ replaceExt(argv[3], ".h", True, symbName);
+ else
+ replaceExt(helpName, ".h", True, symbName);
+
+ checkOverwrite( symbName );
+
+ TProtectedStream textStrm(textName, CLY_IOSIn);
+ TProtectedStream symbStrm(symbName, CLY_IOSOut);
+
+ helpStrm = new fpstream(helpName, CLY_IOSOut | CLY_IOSBin);
+ processText(textStrm, *helpStrm, symbStrm);
+ return 0;
+}
diff --git a/tvision/examples/tvhc/tvhc.gpr b/tvision/examples/tvhc/tvhc.gpr
new file mode 100644
index 0000000..424da2f
--- /dev/null
+++ b/tvision/examples/tvhc/tvhc.gpr
Binary files differ
diff --git a/tvision/examples/tvhc/tvhc.h b/tvision/examples/tvhc/tvhc.h
new file mode 100644
index 0000000..5cb115b
--- /dev/null
+++ b/tvision/examples/tvhc/tvhc.h
@@ -0,0 +1,95 @@
+/*-----------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Turbo Vision TVHC header file */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*-----------------------------------------------------*/
+
+#if !defined( TVHC_H )
+#define TVHC_H
+
+const int MAXSIZE = 80;
+const int MAXSTRSIZE=256;
+const char commandChar[] = ".";
+const int bufferSize = 4096;
+
+typedef enum State { undefined, wrapping, notWrapping } _State;
+
+class TProtectedStream : public CLY_std(fstream)
+{
+public:
+ TProtectedStream( char *aFileName, CLY_OpenModeT aMode );
+
+private:
+ char fileName[MAXSIZE];
+ CLY_OpenModeT mode;
+};
+
+// Topic Reference
+
+struct TFixUp
+{
+ long pos;
+ TFixUp *next;
+};
+
+union Content
+{
+ int /*ushort*/ value;
+ TFixUp *fixUpList;
+};
+
+struct TReference
+{
+ char *topic;
+ Boolean resolved;
+ Content val;
+};
+
+class TRefTable : public TSortedCollection
+{
+
+public:
+ TRefTable( ccIndex aLimit, ccIndex aDelta );
+ virtual int compare( void *key1,void *key2 );
+ virtual void freeItem( void *item );
+ TReference *getReference( char *topic );
+ virtual void *keyOf( void *item );
+
+private:
+ virtual void *readItem( ipstream& ) { return 0; };
+ virtual void writeItem( void *, opstream& ) {};
+};
+
+struct TCrossRefNode
+{
+ char *topic;
+ int offset;
+ uchar length;
+ TCrossRefNode *next;
+};
+
+class TTopicDefinition : public TObject
+{
+public:
+
+ TTopicDefinition(char *aTopic, ushort aValue);
+ ~TTopicDefinition(void);
+
+ char *topic;
+ ushort value;
+ TTopicDefinition *next;
+
+};
+
+char helpName[MAXSIZE];
+uchar buffer[bufferSize];
+int ofs;
+TRefTable *refTable = 0;
+TCrossRefNode *xRefs;
+char line[MAXSTRSIZE] = "";
+Boolean lineInBuffer = False;
+int lineCount = 0;
+
+#endif // TVHC_H
diff --git a/tvision/examples/tvhc/tvhc.mkf b/tvision/examples/tvhc/tvhc.mkf
new file mode 100644
index 0000000..a8b7088
--- /dev/null
+++ b/tvision/examples/tvhc/tvhc.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include tvhc$(ExIMK)
diff --git a/tvision/examples/tvhc/tvhc.umk b/tvision/examples/tvhc/tvhc.umk
new file mode 100644
index 0000000..016861d
--- /dev/null
+++ b/tvision/examples/tvhc/tvhc.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./tvhc$(ExOBJ)
+
+LIBRARIES=
+
+tvhc$(ExEXE):: \
+ ./tvhc$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./tvhc$(ExOBJ):: tvhc.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/videomode/rhide.env b/tvision/examples/videomode/rhide.env
new file mode 100644
index 0000000..56091d7
--- /dev/null
+++ b/tvision/examples/videomode/rhide.env
@@ -0,0 +1,5 @@
+#
+# This include file have rhide options for all the subprojects.
+#
+include ../rhide.env
+
diff --git a/tvision/examples/videomode/test.bmk b/tvision/examples/videomode/test.bmk
new file mode 100644
index 0000000..7d27d57
--- /dev/null
+++ b/tvision/examples/videomode/test.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: test.exe
+!include ../../makes/common.bmk
+!include test.umk
+
diff --git a/tvision/examples/videomode/test.cc b/tvision/examples/videomode/test.cc
new file mode 100644
index 0000000..b7b7592
--- /dev/null
+++ b/tvision/examples/videomode/test.cc
@@ -0,0 +1,286 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea
+ This code is Public Domain and you can use it for any purpose. Note that
+when you link to another libraries, obviously needed, the code can (and
+currently will) be affected by the libraries license.
+ Currently my TV port is GPL so this code becomes GPL, but if you link
+with another Turbo Vision port or the library changes license things are
+different.
+
+ Description:
+ This examples shows how to change the screen or window size.
+ Not all terminals supports it.
+
+***************************************************************************/
+
+#define Uses_stdio
+#define Uses_string
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TRect
+#define Uses_TMenuBar
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_MsgBox
+#define Uses_TKeys
+#define Uses_TScreen
+#define Uses_TVCodePage
+
+#include <tv.h>
+
+enum {
+ cmTest80x25= 100
+, cmTest80x28
+, cmTest80x50
+, cmTest90x30
+, cmTest94x34
+, cmTest132x25
+, cmTest132x50
+, cmTest80x25b
+, cmTest80x28b
+, cmTest80x50b
+, cmTest90x30b
+, cmTest94x34b
+, cmTest132x25b
+, cmTest132x50b
+, cmTestCO80 // JASC, color modes
+, cmTestBW80 // JASC, color modes
+, cmTestMono // JASC, color modes
+};
+
+class TMyApp : public TApplication
+{
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine(TRect r);
+ static TMenuBar *initMenuBar(TRect r);
+ virtual void handleEvent(TEvent& event);
+ void testMode(unsigned mode,unsigned w, unsigned h);
+ void testMode(unsigned w, unsigned h);
+ void shell();
+
+ int quit;
+};
+
+
+TMyApp::TMyApp() :
+ TProgInit(&TMyApp::initStatusLine,&TMyApp::initMenuBar,&TMyApp::initDeskTop)
+{
+ quit=0;
+ if (!TScreen::canSetVideoSize())
+ {
+ messageBox("This terminal doesn't support changing the screen size",mfError | mfOKButton);
+ quit=1;
+ }
+ else
+ messageBox("This terminal supports changing the screen/window size. It doesn't mean it will work",mfInformation | mfOKButton);
+}
+
+void TMyApp::handleEvent(TEvent &event)
+{
+ TApplication::handleEvent(event);
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ { case cmTestCO80:
+ setScreenMode( TDisplay::smCO80 );
+ break;
+
+ case cmTestBW80:
+ setScreenMode( TDisplay::smBW80 );
+ break;
+
+ case cmTestMono:
+ setScreenMode( TDisplay::smMono );
+ break;
+
+
+ case cmTest80x25:
+ testMode(TScreen::smCO80x25,80,25);
+ break;
+
+ case cmTest80x28:
+ testMode(TScreen::smCO80x28,80,28);
+ break;
+
+ case cmTest80x50:
+ testMode(TScreen::smCO80x50,80,50);
+ break;
+
+ case cmTest90x30:
+ testMode(TScreen::smCO90x30,90,30);
+ break;
+
+ case cmTest94x34:
+ testMode(TScreen::smCO94x34,94,34);
+ break;
+
+ case cmTest132x25:
+ testMode(TScreen::smCO132x25,132,25);
+ break;
+
+ case cmTest132x50:
+ testMode(TScreen::smCO132x50,132,50);
+ break;
+
+ case cmTest80x25b:
+ testMode(80,25);
+ break;
+
+ case cmTest80x28b:
+ testMode(80,28);
+ break;
+
+ case cmTest80x50b:
+ testMode(80,50);
+ break;
+
+ case cmTest90x30b:
+ testMode(90,30);
+ break;
+
+ case cmTest94x34b:
+ testMode(94,34);
+ break;
+
+ case cmTest132x25b:
+ testMode(132,25);
+ break;
+
+ case cmTest132x50b:
+ testMode(132,50);
+ break;
+
+ case cmCallShell:
+ shell();
+ break;
+ }
+ clearEvent(event);
+ }
+ if (quit)
+ {
+ TEvent event;
+ event.what=evCommand;
+ event.message.command=cmQuit;
+ TApplication::handleEvent(event);
+ }
+}
+
+TMenuBar *TMyApp::initMenuBar(TRect r)
+{
+ r.b.y=r.a.y+1;
+ return new TMenuBar
+ ( r
+ , *new TSubMenu("~S~ystem",kbAltS)
+ + *new TMenuItem("S~h~ell",cmCallShell,kbNoKey,hcNoContext)
+ + *new TMenuItem("E~x~it",cmQuit,kbNoKey,hcNoContext,"Alt-X")
+ + *new TSubMenu("~M~ode",kbAltM)
+ + *new TMenuItem("~8~0x25",cmTest80x25,kbNoKey,hcNoContext)
+ + *new TMenuItem("80x~2~8",cmTest80x28,kbNoKey,hcNoContext)
+ + *new TMenuItem("80x~5~0",cmTest80x50,kbNoKey,hcNoContext)
+ + *new TMenuItem("~9~0x30",cmTest90x30,kbNoKey,hcNoContext)
+ + *new TMenuItem("9~4~x34",cmTest94x34,kbNoKey,hcNoContext)
+ + *new TMenuItem("~1~32x25",cmTest132x25,kbNoKey,hcNoContext)
+ + *new TMenuItem("1~3~2x50",cmTest132x50,kbNoKey,hcNoContext)
+ + *new TSubMenu("~R~esolution",kbAltR)
+ + *new TMenuItem("~8~0x25",cmTest80x25b,kbNoKey,hcNoContext)
+ + *new TMenuItem("80x~2~8",cmTest80x28b,kbNoKey,hcNoContext)
+ + *new TMenuItem("80x~5~0",cmTest80x50b,kbNoKey,hcNoContext)
+ + *new TMenuItem("~9~0x30",cmTest90x30b,kbNoKey,hcNoContext)
+ + *new TMenuItem("9~4~x34",cmTest94x34b,kbNoKey,hcNoContext)
+ + *new TMenuItem("~1~32x25",cmTest132x25b,kbNoKey,hcNoContext)
+ + *new TMenuItem("1~3~2x50",cmTest132x50b,kbNoKey,hcNoContext)
+ + *new TSubMenu("~C~olor",kbAltC)
+ + *new TMenuItem("~C~olor" , cmTestCO80, kbNoKey,hcNoContext)
+ + *new TMenuItem("~B~lack & White", cmTestBW80, kbNoKey,hcNoContext)
+ + *new TMenuItem("~M~ono" , cmTestMono, kbNoKey,hcNoContext)
+ );
+}
+
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y=r.b.y-1;
+ return new TStatusLine(r,
+ *new TStatusDef(0,0xFFFF)+
+ *new TStatusItem(0,kbF10,cmMenu) +
+ *new TStatusItem("~Alt-X~ Exit",kbAltX,cmQuit)
+ );
+}
+
+void TMyApp::shell()
+{
+ suspend();
+ TScreen::System(CLY_GetShellName());
+ resume();
+ redraw();
+}
+
+void TMyApp::testMode(unsigned mode, unsigned w, unsigned h)
+{
+ unsigned aW=TScreen::getCols();
+ unsigned aH=TScreen::getRows();
+ if (aW==w && aH==h)
+ {
+ messageBox("Already using this size",mfInformation | mfOKButton);
+ return;
+ }
+ setScreenMode(mode);
+ unsigned nW=TScreen::getCols();
+ unsigned nH=TScreen::getRows();
+ if (nW==w && nH==h)
+ {
+ messageBox(mfInformation | mfOKButton,"Successfuly changed to %d x %d size",w,h);
+ return;
+ }
+ if (aW==nW && aH==nH)
+ {
+ messageBox(mfError | mfOKButton,"Failed to set %d x %d size",w,h);
+ return;
+ }
+ messageBox(mfWarning | mfOKButton,"Partial change, we got %d x %d size",nW,nH);
+}
+
+void TMyApp::testMode(unsigned w, unsigned h)
+{
+ unsigned aW=TScreen::getCols();
+ unsigned aH=TScreen::getRows();
+ if (aW==w && aH==h)
+ {
+ messageBox("Already using this size",mfInformation | mfOKButton);
+ return;
+ }
+ setScreenMode(w,h);
+ unsigned nW=TScreen::getCols();
+ unsigned nH=TScreen::getRows();
+ if (nW==w && nH==h)
+ {
+ messageBox(mfInformation | mfOKButton,"Successfuly changed to %d x %d size",w,h);
+ return;
+ }
+ if (aW==nW && aH==nH)
+ {
+ messageBox(mfError | mfOKButton,"Failed to set %d x %d size",w,h);
+ return;
+ }
+ messageBox(mfWarning | mfOKButton,"Partial change, we got %d x %d size",nW,nH);
+}
+
+int main(int argc, char *argv[], char **envir)
+{
+ TDisplay::setArgv(argc,argv,envir);
+ TMyApp myApp;
+ const char *title=TScreen::getWindowTitle();
+ TScreen::setWindowTitle("Turbo Vision screen size test program");
+ myApp.run();
+ if (title)
+ {
+ TScreen::setWindowTitle(title);
+ delete[] title;
+ }
+ return 0;
+}
+
diff --git a/tvision/examples/videomode/test.gpr b/tvision/examples/videomode/test.gpr
new file mode 100644
index 0000000..e0f3cd8
--- /dev/null
+++ b/tvision/examples/videomode/test.gpr
Binary files differ
diff --git a/tvision/examples/videomode/test.mkf b/tvision/examples/videomode/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/videomode/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/videomode/test.umk b/tvision/examples/videomode/test.umk
new file mode 100644
index 0000000..ce3bdf8
--- /dev/null
+++ b/tvision/examples/videomode/test.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./test$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./test$(ExOBJ):: test.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/viewers/test.bmk b/tvision/examples/viewers/test.bmk
new file mode 100644
index 0000000..7d27d57
--- /dev/null
+++ b/tvision/examples/viewers/test.bmk
@@ -0,0 +1,10 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+!include ../common.bmk
+all: test.exe
+!include ../../makes/common.bmk
+!include test.umk
+
diff --git a/tvision/examples/viewers/test.mkf b/tvision/examples/viewers/test.mkf
new file mode 100644
index 0000000..de53dab
--- /dev/null
+++ b/tvision/examples/viewers/test.mkf
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+vpath_src=
+vpath_obj=.
+INCLUDE_DIRS=../../include
+COMMON_IMK=../../makes/common.imk
+include $(COMMON_IMK)
+include test$(ExIMK)
diff --git a/tvision/examples/viewers/test.umk b/tvision/examples/viewers/test.umk
new file mode 100644
index 0000000..ce3bdf8
--- /dev/null
+++ b/tvision/examples/viewers/test.umk
@@ -0,0 +1,17 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ./test$(ExOBJ)
+
+LIBRARIES=
+
+test$(ExEXE):: \
+ ./test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+./test$(ExOBJ):: test.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/examples/xterm/Xterm.res b/tvision/examples/xterm/Xterm.res
new file mode 100755
index 0000000..7187db7
--- /dev/null
+++ b/tvision/examples/xterm/Xterm.res
@@ -0,0 +1,299 @@
+#!/bin/sh
+#
+# This script starts xterm mapping the keyboard like the xterm
+# shipped with XFree86 4.x does.
+# I introduced some additional tweaks to:
+# 1) Generate values for Tab key when used with modifiers CSI Flags T
+# 2) Same for back space: CSI Flags K
+# 3) The keypad 5, but is just for testing.
+# 4) The delete key ever emmits an escape sequence. Will think about
+# changing it.
+#
+# Additionally it configures Backspace and Delete to help TV.
+# I also added Alt+letter and Alt+Shift+letter because some XTerm fails
+# to generate ESC+letter.
+#
+xterm -xrm "XTerm*VT100.Translations: #override \n\
+ ~Shift ~Ctrl ~Alt <Key>Insert: string(0x1b) string(\"[2~\") \n\
+ Shift ~Ctrl ~Alt <Key>Insert: string(0x1b) string(\"[2;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>Insert: string(0x1b) string(\"[2;3~\") \n\
+ Shift ~Ctrl Alt <Key>Insert: string(0x1b) string(\"[2;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>Insert: string(0x1b) string(\"[2;5~\") \n\
+ Shift Ctrl ~Alt <Key>Insert: string(0x1b) string(\"[2;6~\") \n\
+ ~Shift Ctrl Alt <Key>Insert: string(0x1b) string(\"[2;7~\") \n\
+ Shift Ctrl Alt <Key>Insert: string(0x1b) string(\"[2;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>Delete: string(0x1b) string(\"[3~\") \n\
+ Shift ~Ctrl ~Alt <Key>Delete: string(0x1b) string(\"[3;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>Delete: string(0x1b) string(\"[3;3~\") \n\
+ Shift ~Ctrl Alt <Key>Delete: string(0x1b) string(\"[3;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>Delete: string(0x1b) string(\"[3;5~\") \n\
+ Shift Ctrl ~Alt <Key>Delete: string(0x1b) string(\"[3;6~\") \n\
+ ~Shift Ctrl Alt <Key>Delete: string(0x1b) string(\"[3;7~\") \n\
+ Shift Ctrl Alt <Key>Delete: string(0x1b) string(\"[3;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>Prior: string(0x1b) string(\"[5~\") \n\
+ Shift ~Ctrl ~Alt <Key>Prior: string(0x1b) string(\"[5;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>Prior: string(0x1b) string(\"[5;3~\") \n\
+ Shift ~Ctrl Alt <Key>Prior: string(0x1b) string(\"[5;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>Prior: string(0x1b) string(\"[5;5~\") \n\
+ Shift Ctrl ~Alt <Key>Prior: string(0x1b) string(\"[5;6~\") \n\
+ ~Shift Ctrl Alt <Key>Prior: string(0x1b) string(\"[5;7~\") \n\
+ Shift Ctrl Alt <Key>Prior: string(0x1b) string(\"[5;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>Next: string(0x1b) string(\"[6~\") \n\
+ Shift ~Ctrl ~Alt <Key>Next: string(0x1b) string(\"[6;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>Next: string(0x1b) string(\"[6;3~\") \n\
+ Shift ~Ctrl Alt <Key>Next: string(0x1b) string(\"[6;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>Next: string(0x1b) string(\"[6;5~\") \n\
+ Shift Ctrl ~Alt <Key>Next: string(0x1b) string(\"[6;6~\") \n\
+ ~Shift Ctrl Alt <Key>Next: string(0x1b) string(\"[6;7~\") \n\
+ Shift Ctrl Alt <Key>Next: string(0x1b) string(\"[6;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F5: string(0x1b) string(\"[15~\") \n\
+ Shift ~Ctrl ~Alt <Key>F5: string(0x1b) string(\"[15;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>F5: string(0x1b) string(\"[15;3~\") \n\
+ Shift ~Ctrl Alt <Key>F5: string(0x1b) string(\"[15;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>F5: string(0x1b) string(\"[15;5~\") \n\
+ Shift Ctrl ~Alt <Key>F5: string(0x1b) string(\"[15;6~\") \n\
+ ~Shift Ctrl Alt <Key>F5: string(0x1b) string(\"[15;7~\") \n\
+ Shift Ctrl Alt <Key>F5: string(0x1b) string(\"[15;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F6: string(0x1b) string(\"[16~\") \n\
+ Shift ~Ctrl ~Alt <Key>F6: string(0x1b) string(\"[16;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>F6: string(0x1b) string(\"[16;3~\") \n\
+ Shift ~Ctrl Alt <Key>F6: string(0x1b) string(\"[16;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>F6: string(0x1b) string(\"[16;5~\") \n\
+ Shift Ctrl ~Alt <Key>F6: string(0x1b) string(\"[16;6~\") \n\
+ ~Shift Ctrl Alt <Key>F6: string(0x1b) string(\"[16;7~\") \n\
+ Shift Ctrl Alt <Key>F6: string(0x1b) string(\"[16;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F7: string(0x1b) string(\"[18~\") \n\
+ Shift ~Ctrl ~Alt <Key>F7: string(0x1b) string(\"[18;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>F7: string(0x1b) string(\"[18;3~\") \n\
+ Shift ~Ctrl Alt <Key>F7: string(0x1b) string(\"[18;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>F7: string(0x1b) string(\"[18;5~\") \n\
+ Shift Ctrl ~Alt <Key>F7: string(0x1b) string(\"[18;6~\") \n\
+ ~Shift Ctrl Alt <Key>F7: string(0x1b) string(\"[18;7~\") \n\
+ Shift Ctrl Alt <Key>F7: string(0x1b) string(\"[18;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F8: string(0x1b) string(\"[19~\") \n\
+ Shift ~Ctrl ~Alt <Key>F8: string(0x1b) string(\"[19;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>F8: string(0x1b) string(\"[19;3~\") \n\
+ Shift ~Ctrl Alt <Key>F8: string(0x1b) string(\"[19;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>F8: string(0x1b) string(\"[19;5~\") \n\
+ Shift Ctrl ~Alt <Key>F8: string(0x1b) string(\"[19;6~\") \n\
+ ~Shift Ctrl Alt <Key>F8: string(0x1b) string(\"[19;7~\") \n\
+ Shift Ctrl Alt <Key>F8: string(0x1b) string(\"[19;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F9: string(0x1b) string(\"[20~\") \n\
+ Shift ~Ctrl ~Alt <Key>F9: string(0x1b) string(\"[20;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>F9: string(0x1b) string(\"[20;3~\") \n\
+ Shift ~Ctrl Alt <Key>F9: string(0x1b) string(\"[20;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>F9: string(0x1b) string(\"[20;5~\") \n\
+ Shift Ctrl ~Alt <Key>F9: string(0x1b) string(\"[20;6~\") \n\
+ ~Shift Ctrl Alt <Key>F9: string(0x1b) string(\"[20;7~\") \n\
+ Shift Ctrl Alt <Key>F9: string(0x1b) string(\"[20;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F10: string(0x1b) string(\"[21~\") \n\
+ Shift ~Ctrl ~Alt <Key>F10: string(0x1b) string(\"[21;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>F10: string(0x1b) string(\"[21;3~\") \n\
+ Shift ~Ctrl Alt <Key>F10: string(0x1b) string(\"[21;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>F10: string(0x1b) string(\"[21;5~\") \n\
+ Shift Ctrl ~Alt <Key>F10: string(0x1b) string(\"[21;6~\") \n\
+ ~Shift Ctrl Alt <Key>F10: string(0x1b) string(\"[21;7~\") \n\
+ Shift Ctrl Alt <Key>F10: string(0x1b) string(\"[21;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F11: string(0x1b) string(\"[23~\") \n\
+ Shift ~Ctrl ~Alt <Key>F11: string(0x1b) string(\"[23;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>F11: string(0x1b) string(\"[23;3~\") \n\
+ Shift ~Ctrl Alt <Key>F11: string(0x1b) string(\"[23;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>F11: string(0x1b) string(\"[23;5~\") \n\
+ Shift Ctrl ~Alt <Key>F11: string(0x1b) string(\"[23;6~\") \n\
+ ~Shift Ctrl Alt <Key>F11: string(0x1b) string(\"[23;7~\") \n\
+ Shift Ctrl Alt <Key>F11: string(0x1b) string(\"[23;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F12: string(0x1b) string(\"[24~\") \n\
+ Shift ~Ctrl ~Alt <Key>F12: string(0x1b) string(\"[24;2~\") \n\
+ ~Shift ~Ctrl Alt <Key>F12: string(0x1b) string(\"[24;3~\") \n\
+ Shift ~Ctrl Alt <Key>F12: string(0x1b) string(\"[24;4~\") \n\
+ ~Shift Ctrl ~Alt <Key>F12: string(0x1b) string(\"[24;5~\") \n\
+ Shift Ctrl ~Alt <Key>F12: string(0x1b) string(\"[24;6~\") \n\
+ ~Shift Ctrl Alt <Key>F12: string(0x1b) string(\"[24;7~\") \n\
+ Shift Ctrl Alt <Key>F12: string(0x1b) string(\"[24;8~\") \n\
+ ~Shift ~Ctrl ~Alt <Key>Up: string(0x1b) string(\"OA\") \n\
+ Shift ~Ctrl ~Alt <Key>Up: string(0x1b) string(\"[2A\") \n\
+ ~Shift ~Ctrl Alt <Key>Up: string(0x1b) string(\"[3A\") \n\
+ Shift ~Ctrl Alt <Key>Up: string(0x1b) string(\"[4A\") \n\
+ ~Shift Ctrl ~Alt <Key>Up: string(0x1b) string(\"[5A\") \n\
+ Shift Ctrl ~Alt <Key>Up: string(0x1b) string(\"[6A\") \n\
+ ~Shift Ctrl Alt <Key>Up: string(0x1b) string(\"[7A\") \n\
+ Shift Ctrl Alt <Key>Up: string(0x1b) string(\"[8A\") \n\
+ ~Shift ~Ctrl ~Alt <Key>Down: string(0x1b) string(\"OB\") \n\
+ Shift ~Ctrl ~Alt <Key>Down: string(0x1b) string(\"[2B\") \n\
+ ~Shift ~Ctrl Alt <Key>Down: string(0x1b) string(\"[3B\") \n\
+ Shift ~Ctrl Alt <Key>Down: string(0x1b) string(\"[4B\") \n\
+ ~Shift Ctrl ~Alt <Key>Down: string(0x1b) string(\"[5B\") \n\
+ Shift Ctrl ~Alt <Key>Down: string(0x1b) string(\"[6B\") \n\
+ ~Shift Ctrl Alt <Key>Down: string(0x1b) string(\"[7B\") \n\
+ Shift Ctrl Alt <Key>Down: string(0x1b) string(\"[8B\") \n\
+ ~Shift ~Ctrl ~Alt <Key>Right: string(0x1b) string(\"OC\") \n\
+ Shift ~Ctrl ~Alt <Key>Right: string(0x1b) string(\"[2C\") \n\
+ ~Shift ~Ctrl Alt <Key>Right: string(0x1b) string(\"[3C\") \n\
+ Shift ~Ctrl Alt <Key>Right: string(0x1b) string(\"[4C\") \n\
+ ~Shift Ctrl ~Alt <Key>Right: string(0x1b) string(\"[5C\") \n\
+ Shift Ctrl ~Alt <Key>Right: string(0x1b) string(\"[6C\") \n\
+ ~Shift Ctrl Alt <Key>Right: string(0x1b) string(\"[7C\") \n\
+ Shift Ctrl Alt <Key>Right: string(0x1b) string(\"[8C\") \n\
+ ~Shift ~Ctrl ~Alt <Key>Left: string(0x1b) string(\"OD\") \n\
+ Shift ~Ctrl ~Alt <Key>Left: string(0x1b) string(\"[2D\") \n\
+ ~Shift ~Ctrl Alt <Key>Left: string(0x1b) string(\"[3D\") \n\
+ Shift ~Ctrl Alt <Key>Left: string(0x1b) string(\"[4D\") \n\
+ ~Shift Ctrl ~Alt <Key>Left: string(0x1b) string(\"[5D\") \n\
+ Shift Ctrl ~Alt <Key>Left: string(0x1b) string(\"[6D\") \n\
+ ~Shift Ctrl Alt <Key>Left: string(0x1b) string(\"[7D\") \n\
+ Shift Ctrl Alt <Key>Left: string(0x1b) string(\"[8D\") \n\
+ ~@Num_Lock ~Shift ~Ctrl ~Alt <Key>KP_5: string(0x1b) string(\"[E\") \n\
+ @Num_Lock ~Shift ~Ctrl ~Alt <Key>KP_5: string(\"5\") \n\
+ ~@Num_Lock Shift ~Ctrl ~Alt <Key>KP_5: string(\"5\") \n\
+ @Num_Lock Shift ~Ctrl ~Alt <Key>KP_5: string(0x1b) string(\"[E\") \n\
+ ~Shift ~Ctrl Alt <Key>KP_5: string(0x1b) string(\"[3E\") \n\
+ Shift ~Ctrl Alt <Key>KP_5: string(0x1b) string(\"[4E\") \n\
+ ~Shift Ctrl ~Alt <Key>KP_5: string(0x1b) string(\"[5E\") \n\
+ Shift Ctrl ~Alt <Key>KP_5: string(0x1b) string(\"[6E\") \n\
+ ~Shift Ctrl Alt <Key>KP_5: string(0x1b) string(\"[7E\") \n\
+ Shift Ctrl Alt <Key>KP_5: string(0x1b) string(\"[8E\") \n\
+ ~Shift ~Ctrl ~Alt <Key>End: string(0x1b) string(\"OF\") \n\
+ Shift ~Ctrl ~Alt <Key>End: string(0x1b) string(\"[2F\") \n\
+ ~Shift ~Ctrl Alt <Key>End: string(0x1b) string(\"[3F\") \n\
+ Shift ~Ctrl Alt <Key>End: string(0x1b) string(\"[4F\") \n\
+ ~Shift Ctrl ~Alt <Key>End: string(0x1b) string(\"[5F\") \n\
+ Shift Ctrl ~Alt <Key>End: string(0x1b) string(\"[6F\") \n\
+ ~Shift Ctrl Alt <Key>End: string(0x1b) string(\"[7F\") \n\
+ Shift Ctrl Alt <Key>End: string(0x1b) string(\"[8F\") \n\
+ ~Shift ~Ctrl ~Alt <Key>Home: string(0x1b) string(\"OH\") \n\
+ Shift ~Ctrl ~Alt <Key>Home: string(0x1b) string(\"[2H\") \n\
+ ~Shift ~Ctrl Alt <Key>Home: string(0x1b) string(\"[3H\") \n\
+ Shift ~Ctrl Alt <Key>Home: string(0x1b) string(\"[4H\") \n\
+ ~Shift Ctrl ~Alt <Key>Home: string(0x1b) string(\"[5H\") \n\
+ Shift Ctrl ~Alt <Key>Home: string(0x1b) string(\"[6H\") \n\
+ ~Shift Ctrl Alt <Key>Home: string(0x1b) string(\"[7H\") \n\
+ Shift Ctrl Alt <Key>Home: string(0x1b) string(\"[8H\") \n\
+ ~Shift ~Ctrl ~Alt <Key>BackSpace: string(\"\177\")\n\
+ Shift ~Ctrl ~Alt <Key>BackSpace: string(0x1b) string(\"[2K\") \n\
+ ~Shift ~Ctrl Alt <Key>BackSpace: string(0x1b) string(\"[3K\") \n\
+ Shift ~Ctrl Alt <Key>BackSpace: string(0x1b) string(\"[4K\") \n\
+ ~Shift Ctrl ~Alt <Key>BackSpace: string(0x1b) string(\"[5K\") \n\
+ Shift Ctrl ~Alt <Key>BackSpace: string(0x1b) string(\"[6K\") \n\
+ ~Shift Ctrl Alt <Key>BackSpace: string(0x1b) string(\"[7K\") \n\
+ Shift Ctrl Alt <Key>BackSpace: string(0x1b) string(\"[8K\") \n\
+ Shift ~Ctrl ~Alt <Key>Tab: string(0x1b) string(\"[2T\") \n\
+ ~Shift ~Ctrl Alt <Key>Tab: string(0x1b) string(\"[3T\") \n\
+ Shift ~Ctrl Alt <Key>Tab: string(0x1b) string(\"[4T\") \n\
+ ~Shift Ctrl ~Alt <Key>Tab: string(0x1b) string(\"[5T\") \n\
+ Shift Ctrl ~Alt <Key>Tab: string(0x1b) string(\"[6T\") \n\
+ ~Shift Ctrl Alt <Key>Tab: string(0x1b) string(\"[7T\") \n\
+ Shift Ctrl Alt <Key>Tab: string(0x1b) string(\"[8T\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F1: string(0x1b) string(\"OP\") \n\
+ Shift ~Ctrl ~Alt <Key>F1: string(0x1b) string(\"2OP\") \n\
+ ~Shift ~Ctrl Alt <Key>F1: string(0x1b) string(\"3OP\") \n\
+ Shift ~Ctrl Alt <Key>F1: string(0x1b) string(\"4OP\") \n\
+ ~Shift Ctrl ~Alt <Key>F1: string(0x1b) string(\"5OP\") \n\
+ Shift Ctrl ~Alt <Key>F1: string(0x1b) string(\"6OP\") \n\
+ ~Shift Ctrl Alt <Key>F1: string(0x1b) string(\"7OP\") \n\
+ Shift Ctrl Alt <Key>F1: string(0x1b) string(\"8OP\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F2: string(0x1b) string(\"OQ\") \n\
+ Shift ~Ctrl ~Alt <Key>F2: string(0x1b) string(\"2OQ\") \n\
+ ~Shift ~Ctrl Alt <Key>F2: string(0x1b) string(\"3OQ\") \n\
+ Shift ~Ctrl Alt <Key>F2: string(0x1b) string(\"4OQ\") \n\
+ ~Shift Ctrl ~Alt <Key>F2: string(0x1b) string(\"5OQ\") \n\
+ Shift Ctrl ~Alt <Key>F2: string(0x1b) string(\"6OQ\") \n\
+ ~Shift Ctrl Alt <Key>F2: string(0x1b) string(\"7OQ\") \n\
+ Shift Ctrl Alt <Key>F2: string(0x1b) string(\"8OQ\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F3: string(0x1b) string(\"OR\") \n\
+ Shift ~Ctrl ~Alt <Key>F3: string(0x1b) string(\"2OR\") \n\
+ ~Shift ~Ctrl Alt <Key>F3: string(0x1b) string(\"3OR\") \n\
+ Shift ~Ctrl Alt <Key>F3: string(0x1b) string(\"4OR\") \n\
+ ~Shift Ctrl ~Alt <Key>F3: string(0x1b) string(\"5OR\") \n\
+ Shift Ctrl ~Alt <Key>F3: string(0x1b) string(\"6OR\") \n\
+ ~Shift Ctrl Alt <Key>F3: string(0x1b) string(\"7OR\") \n\
+ Shift Ctrl Alt <Key>F3: string(0x1b) string(\"8OR\") \n\
+ ~Shift ~Ctrl ~Alt <Key>F4: string(0x1b) string(\"OS\") \n\
+ Shift ~Ctrl ~Alt <Key>F4: string(0x1b) string(\"2OS\") \n\
+ ~Shift ~Ctrl Alt <Key>F4: string(0x1b) string(\"3OS\") \n\
+ Shift ~Ctrl Alt <Key>F4: string(0x1b) string(\"4OS\") \n\
+ ~Shift Ctrl ~Alt <Key>F4: string(0x1b) string(\"5OS\") \n\
+ Shift Ctrl ~Alt <Key>F4: string(0x1b) string(\"6OS\") \n\
+ ~Shift Ctrl Alt <Key>F4: string(0x1b) string(\"7OS\") \n\
+ Shift Ctrl Alt <Key>F4: string(0x1b) string(\"8OS\") \n\
+ ~Shift ~Ctrl Alt <Key>1: string(0x1b) string(\"1\") \n\
+ ~Shift ~Ctrl Alt <Key>2: string(0x1b) string(\"2\") \n\
+ ~Shift ~Ctrl Alt <Key>3: string(0x1b) string(\"3\") \n\
+ ~Shift ~Ctrl Alt <Key>4: string(0x1b) string(\"4\") \n\
+ ~Shift ~Ctrl Alt <Key>5: string(0x1b) string(\"5\") \n\
+ ~Shift ~Ctrl Alt <Key>6: string(0x1b) string(\"6\") \n\
+ ~Shift ~Ctrl Alt <Key>7: string(0x1b) string(\"7\") \n\
+ ~Shift ~Ctrl Alt <Key>8: string(0x1b) string(\"8\") \n\
+ ~Shift ~Ctrl Alt <Key>9: string(0x1b) string(\"9\") \n\
+ ~Shift ~Ctrl Alt <Key>0: string(0x1b) string(\"0\") \n\
+ ~Shift ~Ctrl Alt <Key>a: string(0x1b) string(\"a\") \n\
+ Shift ~Ctrl Alt <Key>a: string(0x1b) string(\"A\") \n\
+ ~Shift ~Ctrl Alt <Key>b: string(0x1b) string(\"b\") \n\
+ Shift ~Ctrl Alt <Key>b: string(0x1b) string(\"B\") \n\
+ ~Shift ~Ctrl Alt <Key>c: string(0x1b) string(\"c\") \n\
+ Shift ~Ctrl Alt <Key>c: string(0x1b) string(\"C\") \n\
+ ~Shift ~Ctrl Alt <Key>d: string(0x1b) string(\"d\") \n\
+ Shift ~Ctrl Alt <Key>d: string(0x1b) string(\"D\") \n\
+ ~Shift ~Ctrl Alt <Key>e: string(0x1b) string(\"e\") \n\
+ Shift ~Ctrl Alt <Key>e: string(0x1b) string(\"E\") \n\
+ ~Shift ~Ctrl Alt <Key>f: string(0x1b) string(\"f\") \n\
+ Shift ~Ctrl Alt <Key>f: string(0x1b) string(\"F\") \n\
+ ~Shift ~Ctrl Alt <Key>g: string(0x1b) string(\"g\") \n\
+ Shift ~Ctrl Alt <Key>g: string(0x1b) string(\"G\") \n\
+ ~Shift ~Ctrl Alt <Key>h: string(0x1b) string(\"h\") \n\
+ Shift ~Ctrl Alt <Key>h: string(0x1b) string(\"H\") \n\
+ ~Shift ~Ctrl Alt <Key>i: string(0x1b) string(\"i\") \n\
+ Shift ~Ctrl Alt <Key>i: string(0x1b) string(\"I\") \n\
+ ~Shift ~Ctrl Alt <Key>j: string(0x1b) string(\"j\") \n\
+ Shift ~Ctrl Alt <Key>j: string(0x1b) string(\"J\") \n\
+ ~Shift ~Ctrl Alt <Key>k: string(0x1b) string(\"k\") \n\
+ Shift ~Ctrl Alt <Key>k: string(0x1b) string(\"K\") \n\
+ ~Shift ~Ctrl Alt <Key>l: string(0x1b) string(\"l\") \n\
+ Shift ~Ctrl Alt <Key>l: string(0x1b) string(\"L\") \n\
+ ~Shift ~Ctrl Alt <Key>m: string(0x1b) string(\"m\") \n\
+ Shift ~Ctrl Alt <Key>m: string(0x1b) string(\"M\") \n\
+ ~Shift ~Ctrl Alt <Key>n: string(0x1b) string(\"n\") \n\
+ Shift ~Ctrl Alt <Key>n: string(0x1b) string(\"N\") \n\
+ ~Shift ~Ctrl Alt <Key>o: string(0x1b) string(\"o\") \n\
+ Shift ~Ctrl Alt <Key>o: string(0x1b) string(\"O\") \n\
+ ~Shift ~Ctrl Alt <Key>p: string(0x1b) string(\"p\") \n\
+ Shift ~Ctrl Alt <Key>p: string(0x1b) string(\"P\") \n\
+ ~Shift ~Ctrl Alt <Key>q: string(0x1b) string(\"q\") \n\
+ Shift ~Ctrl Alt <Key>q: string(0x1b) string(\"Q\") \n\
+ ~Shift ~Ctrl Alt <Key>r: string(0x1b) string(\"r\") \n\
+ Shift ~Ctrl Alt <Key>r: string(0x1b) string(\"R\") \n\
+ ~Shift ~Ctrl Alt <Key>s: string(0x1b) string(\"s\") \n\
+ Shift ~Ctrl Alt <Key>s: string(0x1b) string(\"S\") \n\
+ ~Shift ~Ctrl Alt <Key>t: string(0x1b) string(\"t\") \n\
+ Shift ~Ctrl Alt <Key>t: string(0x1b) string(\"T\") \n\
+ ~Shift ~Ctrl Alt <Key>u: string(0x1b) string(\"u\") \n\
+ Shift ~Ctrl Alt <Key>u: string(0x1b) string(\"U\") \n\
+ ~Shift ~Ctrl Alt <Key>v: string(0x1b) string(\"v\") \n\
+ Shift ~Ctrl Alt <Key>v: string(0x1b) string(\"V\") \n\
+ ~Shift ~Ctrl Alt <Key>w: string(0x1b) string(\"w\") \n\
+ Shift ~Ctrl Alt <Key>w: string(0x1b) string(\"W\") \n\
+ ~Shift ~Ctrl Alt <Key>x: string(0x1b) string(\"x\") \n\
+ Shift ~Ctrl Alt <Key>x: string(0x1b) string(\"X\") \n\
+ ~Shift ~Ctrl Alt <Key>y: string(0x1b) string(\"y\") \n\
+ Shift ~Ctrl Alt <Key>y: string(0x1b) string(\"Y\") \n\
+ ~Shift ~Ctrl Alt <Key>z: string(0x1b) string(\"z\") \n\
+ Shift ~Ctrl Alt <Key>z: string(0x1b) string(\"Z\") \n" \
+-xrm "*metaSendsEscape: true" \
+-xrm "*VT100*color0: black" \
+-xrm "*VT100*color1: #a80000" \
+-xrm "*VT100*color2: #00A800" \
+-xrm "*VT100*color3: #A85400" \
+-xrm "*VT100*color4: #0000A8" \
+-xrm "*VT100*color5: #A800A8" \
+-xrm "*VT100*color6: #00A8A8" \
+-xrm "*VT100*color7: #A8A8A8" \
+-xrm "*VT100*color8: #545454" \
+-xrm "*VT100*color9: #FC5454" \
+-xrm "*VT100*color10: #54FC54" \
+-xrm "*VT100*color11: #FCFC54" \
+-xrm "*VT100*color12: #5454FC" \
+-xrm "*VT100*color13: #FC54FC" \
+-xrm "*VT100*color14: #54FCFC" \
+-xrm "*VT100*color15: white"
+# Ctrl <Key>Prior: string(0x1b) string(\"[5;5~\") \n\
+# <Key>Prior: string(0x1b) string(\"[5~\") \n \
+
diff --git a/tvision/extra/doskeys/kextend.asm b/tvision/extra/doskeys/kextend.asm
new file mode 100644
index 0000000..8fabc10
--- /dev/null
+++ b/tvision/extra/doskeys/kextend.asm
@@ -0,0 +1,202 @@
+
+PAGE 59,132
+
+;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
+;ÛÛ ÛÛ
+;ÛÛ ACENT ÛÛ
+;ÛÛ ÛÛ
+;ÛÛ Created: 21-Jan-92 ÛÛ
+;ÛÛ Passes: 5 Analysis Flags on: H ÛÛ
+;ÛÛ ÛÛ
+;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
+
+.286c
+
+data_1e equ 1Ah ; (0040:001A=20h)
+data_2e equ 1Ch ; (0040:001C=20h)
+data_3e equ 80h ; (0040:0080=1Eh)
+data_4e equ 82h ; (0040:0082=3Eh)
+
+seg_a segment
+ assume cs:seg_a, ds:seg_a
+
+
+ org 100h
+
+acent proc far
+
+start:
+ jmp InstalarTSR ; (0236)
+
+; 0x4453 es la firma del TSR y la usa para testear si ya esta instalado
+
+Signature db 54h, 44h
+ db 4Ch
+ViejoVector9 dd 00000h
+Activo db 1
+
+acent endp
+
+;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
+;
+; External Entry Point
+;
+;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
+
+int_09h_entry proc far
+ sti ; Enable interrupts
+ push ax
+ push bx
+ push cx
+ push dx
+ push di
+ push si
+ push ds
+ push es
+
+ mov ax,40h
+ mov es,ax
+ mov ax,17h
+ mov di,ax
+ mov dh,es:[di]
+ mov dl,dh ; DH tiene todos los estados
+ and dl,04h ; DL solo el de Ctrl
+
+ in al,60h ; Leer el scan
+
+ test al,80h ; Si es soltar una tecla o un codigo
+ jne LlamarViejoISR ; extendido dejarlo pasar
+
+ pushf ; Si no primero llamar al BIOS
+ call cs:ViejoVector9 ; y luego analizarla
+
+ ; Si es la tecla MACRO mandarla
+ cmp al,111
+ je Traducir
+
+ ; Si no es CTRL+XX salir
+ or dl,dl
+ jz SalirNormal
+
+ ; Ver si esta en la lista de las que hay que traducir
+ mov cx,15
+ mov si,offset TablaTradu
+Proximo:
+ cmp al,cs:[si]
+ je Traducir
+ inc si
+ loop Proximo
+ jmp short SalirNormal
+
+ ; Mandar la tecla al buffer del teclado
+Traducir:
+ mov ah,5
+ mov cl,0
+ mov ch,al
+ int 16h
+
+SalirNormal:
+ cli ; Disable interrupts
+ pop es
+ pop ds
+ pop si
+ pop di
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ iret ; Interrupt return
+int_09h_entry endp
+
+LlamarViejoISR:
+ pop es
+ pop ds
+ pop si
+ pop di
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ jmp cs:ViejoVector9 ; (64BF:0106=0)
+
+TablaTradu db 29h,2,4,5,6,8,9,0Ah,0Bh,0Dh,27h,28h,33h,34h,35h
+
+InstalarTSR:
+ push ds
+ push es
+ push cs
+ mov ah,9
+ mov dx,offset CopyRight ; (64BF:0293=41h)
+ int 21h ; DOS Services ah=function 09h
+ ; display char string at ds:dx
+ pop ds
+ mov ah,35h ; '5'
+ mov al,9
+ int 21h ; DOS Services ah=function 35h
+ ; get intrpt vector al in es:bx
+ mov dx,es
+ cmp bx,offset int_09h_entry
+ jne NoEstaInst ; Jump if not equal
+ mov ax,offset Signature
+ mov di,ax
+ mov ax,es:[di]
+ cmp ax,4454h
+ je YaEstaInst ; Jump if equal
+NoEstaInst:
+ mov word ptr cs:ViejoVector9,bx ; (64BF:0106=0)
+ mov word ptr cs:ViejoVector9+2,dx ; (64BF:0108=0)
+ mov dx,offset int_09h_entry
+ mov ah,25h ; '%'
+ mov al,9
+ int 21h ; DOS Services ah=function 25h
+ ; set intrpt vector al to ds:dx
+ mov ah,9
+ mov dx,offset Instalado ; (64BF:02D6=69h)
+ int 21h ; DOS Services ah=function 09h
+ ; display char string at ds:dx
+ mov ah,9
+ mov dx,offset TextoAyuda ; (64BF:0316=0Dh)
+ int 21h ; DOS Services ah=function 09h
+ ; display char string at ds:dx
+ pop es
+ pop ds
+
+ ; Liberar el entorno
+ mov ax,es:[002Ch]
+ mov es,ax
+ mov ah,49h
+ int 21h
+
+ mov ah,31h ; '1'
+ mov dx,offset InstalarTSR
+ shr dx,4
+ inc dx
+ int 21h ; DOS Services ah=function 31h
+ ; terminate & stay resident
+YaEstaInst:
+ mov ah,9
+ mov dx,offset YaInstalado ; (64BF:02ED=65h)
+ int 21h ; DOS Services ah=function 09h
+ ; display char string at ds:dx
+ pop es
+ pop ds
+ mov ah,0
+ int 21h ; DOS Services ah=function 00h
+ ; terminate, cs=progm seg prefx
+
+CopyRight db 'KExtend 1.0 - BIOS keyboard enhancer for US '
+ db 'keyboards by SET (c) 1997',13,10,'$'
+
+Instalado db 'installed resident.',13,10, '$'
+
+YaInstalado db 'is allready in memory.',13,10
+
+TextoAyuda db 13,10
+ db ' Reports Ctrl+`1457890=;,./ and the MACRO key'
+ db 13,10, '$'
+
+seg_a ends
+
+
+
+ end start
diff --git a/tvision/extra/doskeys/kextend.com b/tvision/extra/doskeys/kextend.com
new file mode 100644
index 0000000..5f87c9c
--- /dev/null
+++ b/tvision/extra/doskeys/kextend.com
Binary files differ
diff --git a/tvision/extra/doskeys/kextend.txt b/tvision/extra/doskeys/kextend.txt
new file mode 100644
index 0000000..efea1b2
--- /dev/null
+++ b/tvision/extra/doskeys/kextend.txt
@@ -0,0 +1,118 @@
+
+
+ ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+ º KExtend 1.0 a BIOS enhancer for US keyboards º
+ ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+
+ ÉÍÍÍÄÄÍÍÍ»
+ º by SET º
+ ÈÍÍÍÄÄÍÍͼ
+
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º What a hell is KExtend? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º Is a simple TSR program that hooks the keyboard interrupt and forces the º
+³ BIOS to report some special keys. ³
+³ These keys are: ³
+³ Ctrl+ ` 1 4 5 7 8 9 0 = ; ' , . and / ³
+º and the Macro key. º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º What's the 'Macro' key? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º Is the 102th key of the 102 keys keyboards. If I'm right it was used by º
+³ Lotus 123 to trigger macros. I never saw a program that uses it (of course ³
+³ my editor uses it ;-). The main reasons for that are: ³
+³ ³
+³ 1. BIOS doesn't report it. ³
+³ 2. Old keyboards of 83,84 and 101 keys doesn't have it. ³
+º 3. New 105 and 107 keys keyboards doesn't have it. º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º So ... what can I do with it? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º Well ... almost nothing if you aren't using my editor. If you are using º
+³ RHIDE then you are making that. ³
+³ In this case you can assign functions to these keys. As default the ³
+³ editor uses Ctrl+Number to jump to the markers, that's much more easy ³
+³ than Ctrl+Q-Number. If you don't use KExtend you can't use it. ³
+³ If you don't use my editor perhaps the editor you are using can use ³
+º it too. º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º Can it damage my computer? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º I don't know ;-)). I don't take any responsability for any kind of º
+³ problem you can experiment using this program. That means you can't ³
+³ blame me for anything produced directly or indirectly by it. ³
+³ If you think in C read: #include <no garanty> ³
+º :-P these disclamer sections ... º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º Is it compatible with WinBlows 2008 hypercharged? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º I don't have a crystal ball, is it doesn't work just don't use it. º
+º It works in DOS 6.X and in my machine. º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º How much money must I pay for it? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º Well ... hmmm ... nothing, it took me less than 3 hours. But if you º
+³ really use it I'll ask to you one of the following things: ³
+³ ³
+³ 1. Send me some code from you (look below how to contact me). ³
+³ 2. Send me one of the silly things I collect: coins, out-of use money ³
+³ and train tickets, from your country. ³
+º 3. Hey! at least send me a post card of your town. º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º Why do you write so funny and with a lot of errors? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º Because I don't speak english, I'm from Argentina, here we use spanish º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º How can I install it? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º Just load it in your autoexec.bat. º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º How much memory it takes? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º Around 400 bytes, isn't it cool? º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º How do you put the text is this silly boxes? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º With a program of course. º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
+ÉÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍ»
+º How can I contact you? ³ º
+ÌÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
+º S-Mail: º
+³ Curapalige 2124, Caseros ³
+³ 3 de Febrero, Buenos Aires ³
+³ Argentina (1678) ³
+³ ³
+³ E-Mail: ³
+³ salvador@inti.edu.ar (will be @inti.gov.ar in the near future) ³
+³ set-soft@usa.net ³
+³ ³
+³ HTTP: ³
+³ http://www.geocities.com/SiliconValley/Vista/6552/ ³
+³ ³
+³ Phone: (?!) ³
+º +(541) 759 0013 º
+ÈÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍͼ
+
diff --git a/tvision/extra/eterm/Setedit/MAIN b/tvision/extra/eterm/Setedit/MAIN
new file mode 100644
index 0000000..143b925
--- /dev/null
+++ b/tvision/extra/eterm/Setedit/MAIN
@@ -0,0 +1,178 @@
+<Eterm-0.8>
+#
+# Eterm configuration file to be used with setedit
+#
+
+begin main
+
+ begin color
+
+# Foreground, background, cursor, scrollbar, pointer colors
+ foreground white
+ background black
+ cursor #ffff00
+ cursor_text #880000
+ menu_text white
+ scrollbar #3f1c00
+ unfocusedscrollbar #777777
+ pointer white
+
+# video attribute can either be "normal" or "reverse"
+ video normal
+
+# Redefine the 16 basic colors, if you really feel the need
+# First word is "color", next is the number (0-15, BD, or UL),
+# then the values for red, green, and blue separated by spaces
+# Numbers are base 10 unless preceded by "0x" (base 16) or '0'
+# (base 8). Alternatively, you can use color names or #xxxxxx
+# format.
+
+# The colors below are taken from Rasterman's .Xdefaults file. They are intended to
+# display ANSI art properly when combined with a good ANSI-art font (like vga or
+# Rasterman's nexus font).
+# color 0 0 0 0
+# color 1 0xaa 0 0
+# color 2 0 0210 0
+# color 3 0xaa 0x55 0x22
+# color 4 0 0 0xaa
+# color 5 0xaa 0 0xaa
+# color 6 0 0xaa 0xaa
+# color 7 0xaa 0xaa 0xaa
+# color 8 0x44 0x44 0x44
+# color 9 0xff 0x44 0x44
+# color 10 0x44 0xff 0x44
+# color 11 0xff 0xff 0x44
+# color 12 0x44 0x44 0xff
+# color 13 0xff 0x44 0xff
+# color 14 0x44 0xff 0xff
+# color 15 #ffffff
+# color bd #ffffff
+# color ul #ffffff
+
+ end color
+
+ begin attributes
+
+# Geometry == widthxheight+x_offset+y_offset, offsets from top left
+# if +, bottom right if -
+ geometry 94x34
+ title "Setedit - %appname()"
+ name ""
+ iconname Setedit
+
+# Set the fonts. These must be monospace fonts. The values shown are
+# the Eterm defaults. The "bold" font is the font used if color BD has
+# not been set and Eterm cannot map the foreground color to one of the
+# high-intensity colors (8-15).
+ font 0 fixed
+ font 1 6x10
+ font 2 6x13
+ font 3 8x13
+ font 4 9x15
+# font bold 7x14
+ end attributes
+
+# This section is for pixmap definitions. The only one used currently
+# is "background". The supplied numbers work just like they do for
+# Enlightenment: first is X (width), second is Y (height). -1 to
+# scale 100%, 0 to tile, any other number specifies W/H in pixels
+ begin pixmaps
+# background %random(`cat pixmaps.list 2>/dev/null`)
+# path "./pix/:~/.Eterm/:~/.Eterm/themes/Eterm/pix:~/.Eterm/pix/:/usr/share/Eterm/pix/"
+
+# Support for these is forthcoming
+# scroll_up -1 -1 ~/.Eterm/up_arrow.ppm
+# scroll_down -1 -1 ~/.Eterm/down_arrow.ppm
+# scroll_background 0 0 ~/.Eterm/scroll.ppm
+# scroll_anchor -1 -1 ~/.Eterm/anchor.ppm
+ end
+
+# The Kanji support options. Same goes for these fonts as for the normal
+# ones. The "encoding" attribute can be either "eucj" or "sjis".
+# begin kanji
+# font 0 k14
+# font 1 jiskan16
+# font 2 jiskan18
+# font 3 jiskan24
+# font 4 jiskan26
+# encoding eucj
+# end kanji
+
+# Boolean variables. The values can be "1", "on", or "true" for TRUE, or "0",
+# "off", or "false" for FALSE.
+ begin toggles
+
+# If true, Eterm will un-iconify itself when it receives a beep (ASCII 0x07)
+ map_alert on
+
+# If true, Eterm will flash rather than sending a beep.
+ visual_bell off
+
+# If true, Eterm will prepend '-' to the shell name when calling it.
+ login_shell true
+
+# If true, Eterm will display the scroll bar
+ scrollbar off
+
+# If true, Eterm will attempt to make an entry in the utmp file to record the
+# login information. Eterm *must* run privileged to do this.
+ utmp_logging on
+
+# If true, Eterm will handle the Meta (Alt) + keypress to set the 8th bit.
+# If false, Eterm will handle the Meta + keypress as an escape prefix. (default)
+# meta8 false
+
+# If true, Eterm will start iconified.
+ iconic false
+
+# If true, Eterm will jump to the bottom of the window when something is echoed
+# to the terminal, either by program output or user input.
+ home_on_echo 1
+
+# If true, Eterm will jump to the bottom of the window when you refresh the
+# screen (^L).
+ home_on_refresh 1
+
+# If true, Eterm will put the scrollbar on the right of the window (default is left).
+ scrollbar_right true
+
+# If true, the scrollbar will have no trough.
+ scrollbar_floating false
+
+# If true, Eterm will run with no window borders.
+ borderless false
+
+ end toggles
+
+ begin keyboard
+
+# Use the supplied keysym to reduce/enlarge the font
+ smallfont_key LessThan
+ bigfont_key GreaterThan
+
+# You can also associate a given keysym (0xff00 - 0xffff) with a string
+# keysym 0xffff "\r\n\e\007\t"
+ keysym 0xffea "ALT_R"
+
+# Greek keyboard mode. First the word "greek", then its boolean
+# state, then its mode (either "iso" or "ibm").
+# greek off iso
+ end keyboard
+
+ begin misc
+
+ save_lines 0
+ cut_chars "\t\\\`\\\"\'&() *,;<=>?@[]{|}"
+ border_width 5
+ menu Setedit.menu
+
+# Value to use for $TERM
+# The library will use some Eterm tricks if this terminal is detected:
+ term_name xterm-eterm-tv
+
+# Program to exec (intended for use with themes)
+ exec setedit
+# exec /usr/src/tvision/gkey.exe
+ end misc
+
+end main
diff --git a/tvision/extra/eterm/Setedit/Setedit.menu b/tvision/extra/eterm/Setedit/Setedit.menu
new file mode 100644
index 0000000..80bc74f
--- /dev/null
+++ b/tvision/extra/eterm/Setedit/Setedit.menu
@@ -0,0 +1,28 @@
+# Setedit control menu
+[menu:Eterm]
+
+/Font/*
+{Normal} ^@\e]50;#
+{Larger} ^@\e]50;#+
+{Smaller} ^@\e]50;#-
+{-}
+{Font 1} ^@\e]50;#1
+{Font 2} ^@\e]50;#2
+{Font 3} ^@\e]50;#3
+{Font 4} ^@\e]50;#4
+
+/Terminal/*
+./Toggles/*
+{Map Alert} ^@\e]6;21\a
+{Primary/Secondary Screen} ^@\e[?47t
+{Reverse Video} ^@\e[?5t
+{Visual Bell} ^@\e]6;20\a
+{Xterm Selection Behavior} ^@\e]6;22\a
+../Menubar/*
+{Toggle Visibility}{Ctrl-Button3} ^@\e[?10t
+{Refresh Menubar} ^@\e[?10h
+{Toggle Window Move by Menubar} ^@\e]6;15\a
+
+/
+[show]
+[done]
diff --git a/tvision/extra/eterm/readme.txt b/tvision/extra/eterm/readme.txt
new file mode 100644
index 0000000..c7dc410
--- /dev/null
+++ b/tvision/extra/eterm/readme.txt
@@ -0,0 +1,87 @@
+ This directory contains an example of how to exploit the new features found
+in Turbo Vision v1.0.7 (July 1999) under Eterm. The text is oriented for any
+program and as example I talk about my editor (setedit). As this file will be
+probably distributed with both (the library and the editor) don't get
+surprised if I sometimes I say "the editor" instead of "the program".
+ Eterm is a very good replacement for xterm (UNIX X11 terminal emulator).
+ You'll need Eterm v0.8.10 or a CVS snapshot that contains my patch to add
+the --report-as-keysyms option to Eterm. [Thanx to MEJ who accepted this
+crazy patch!].
+
+
+1. What I gain?
+2. What I need?
+3. How it works?
+4. Final comments
+
+
+1. What I gain?
+
+ When using Eterm and some associated things you gain a lot of information
+from the keyboard. Things like Shift+Arrows can be detected by TV (Turbo
+Vision).
+
+
+2. What I need?
+
+ You need Eterm 0.8.10 or newer, you also need to install the xterm-eterm-tv
+terminal description in your system. In Debian GNU/Linux v2.0 the process is
+this:
+
+a) Compile the file: (for more information see the tic(1m) manpages)
+# tic xterm-eterm-tv
+b) Copy the compiled terminal description file to the right directory:
+# cp /usr/share/terminfo/x/xterm-eterm-tv /etc/terminfo/x/
+
+ Finally you need to run Eterm with a "theme" for your program. The files
+contained here are a theme for the editor (setedit).
+ If you are installing this files for setedit just copy the Setedit
+directory to the directory where the Eterm themes are located, in my system
+that's: /usr/share/Eterm/themes/
+ Once this theme is installed you can invoke Eterm like this:
+
+# Eterm -t Setedit --report-as-keysyms
+
+ and it will automagically start setedit inside the window.
+ In the case you need to adapt this theme for other TV program just read the
+Eterm documentation or the comments in the theme called "Eterm" (that's the
+default and is very well commented).
+ You can then add an entry in the X wm menu or in GNOME menu or any other
+menu an entry to avoid typing such a long line.
+
+
+3. How it works?
+
+ When Eterm is started with --report-as-keysyms the special keys (all
+control keys) are passed to the program as escape sequences. X uses some
+codes called keysyms to identify the keys, these values are defined by the X
+consortium and includes all the keys known in UNIX consoles. The values are
+16 bits, the last 256 values (0xFFxx) are reserved for control keys. When
+Eterm receives one of these keys instead of translating it to a control key
+and then emit the corresponding escape sequence just informs the keysym to
+the application with the following sequence: \e[knn;xx~
+Where: \e is the ESC code (0x1B), nn are the lower 8 bits of the modifier
+keys (state of alt, shift, etc.) and xx the lower 8 bits of the keysym. Note
+that if nn and xx can be just one digit and are encoded in hexadecimal.
+ Why only the keysyms over 0xFF00? simple the keysyms under it are just
+letters, they include symbols from many alphabets (cyrilic, hebrew, japanese,
+etc.) but not control keys like arrows.
+ This mode can be also enabled/disabled sending some special escape
+sequences to Eterm, I don't remmember right now what Eterm extension number I
+used right now so look in the Eterm's manual (I taked the first available).
+ How the application knows that is running in a terminal with such a
+feature? Simple, TV looks in the term name and only if it is xterm-eterm-tv
+enables these things. The terminal name is defined in the Eterm theme and
+that's why you need to install the terminal description file.
+
+
+4. Final comments
+
+ I added it because I really wanted to see the editor working well under X.
+Even when I usually don't use the editor under X is nice to see it working as
+well.
+ I want feadback from this feature, what do you think about it? is too hard
+to setup? what are the steps in your Linux? etc.
+
+
+Enjoy, SET
diff --git a/tvision/extra/eterm/xterm-eterm-tv b/tvision/extra/eterm/xterm-eterm-tv
new file mode 100644
index 0000000..1e2a812
--- /dev/null
+++ b/tvision/extra/eterm/xterm-eterm-tv
@@ -0,0 +1,35 @@
+# Reconstructed via infocmp from file: /etc/terminfo/x/xterm-debian
+xterm-eterm-tv|Eterm description for Turbo Vision programs,
+ am, bce, km, mc5i, mir, msgr, xenl,
+ colors#8, cols#80, it#8, lines#24, pairs#64,
+ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+ bel=^G, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
+ clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M,
+ csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+ cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
+ cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+ cvvis=\E[?25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,
+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K,
+ enacs=\E(B\E)0, flash=\E[?5h\E[?5l, home=\E[H,
+ hpa=\E[%i%p1%dG, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L,
+ ind=^J, is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>,
+ ka1=\EOw, ka3=\EOu, kb2=\EOy, kbeg=\EOE, kbs=\177, kc1=\EOq,
+ kc3=\EOs, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+ kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
+ kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
+ kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+ kfnd=\E[1~, khome=\EOH, kich1=\E[2~, kmous=\E[M, knp=\E[6~,
+ kpp=\E[5~, kslt=\E[4~, mc0=\E[i, mc4=\E[4i, mc5=\E[5i,
+ op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,
+ rmam=\E[?7l, rmcup=\E[?1047l\E[?1048l, rmir=\E[4l,
+ rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m, rs1=\Ec,
+ rs2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, sc=\E7,
+ setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
+ setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
+ setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
+ sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
+ sgr0=\E[m\017, smacs=^N, smam=\E[?7h,
+ smcup=\E[?1048h\E[?1047h, smir=\E[4h, smkx=\E[?1h\E=,
+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd,
diff --git a/tvision/extra/pifexamp/setedit.pif b/tvision/extra/pifexamp/setedit.pif
new file mode 100644
index 0000000..95220f1
--- /dev/null
+++ b/tvision/extra/pifexamp/setedit.pif
Binary files differ
diff --git a/tvision/fileview.cc b/tvision/fileview.cc
new file mode 100644
index 0000000..efd413c
--- /dev/null
+++ b/tvision/fileview.cc
@@ -0,0 +1,282 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis.
+Modified by Salvador E. Tropea to compile for 64 bits architectures.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#define Uses_stdio
+#define Uses_string
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_fcntl
+#define Uses_sys_stat
+#define Uses_filelength
+#define Uses_unistd
+#define Uses_AllocLocal
+
+#define Uses_MsgBox
+#define Uses_TKeys
+#define Uses_TScroller
+#define Uses_TDrawBuffer
+#define Uses_TRect
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TStreamableClass
+#define Uses_TFileViewer
+#define Uses_TFileDialog
+#include <tv.h>
+
+#if !defined( NO_STREAM )
+
+__link(RScroller)
+__link(RScrollBar)
+
+const char * const TFileViewer::name = "TFileViewer";
+
+TStreamableClass RFileView( TFileViewer::name,
+ TFileViewer::build,
+ __DELTA(TFileViewer)
+ );
+
+void *TFileViewer::read(ipstream& is)
+{
+ char *fName;
+
+ TScroller::read(is);
+ fName = is.readString();
+ fileName = NULL;
+ readFile(fName);
+ delete fName;
+ return this;
+}
+
+void TFileViewer::write(opstream& os)
+{
+ TScroller::write(os);
+ os.writeString(fileName);
+}
+
+TStreamable *TFileViewer::build()
+{
+ return new TFileViewer( streamableInit );
+}
+
+#endif // NO_STREAM
+
+void TFileViewer::changeBounds(const TRect & bounds)
+{
+ TScroller::changeBounds(bounds);
+ setLimit(size.x + width,size.y + count);
+}
+
+TFileViewer::TFileViewer( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ const char *aFileName) :
+ TScroller( bounds, aHScrollBar, aVScrollBar ),
+ buffer(NULL), real_bufsize(0), width(0), count(0)
+{
+ growMode = gfGrowHiX | gfGrowHiY;
+ isValid = True;
+ fileName = 0;
+ helpCtx = hcFileViewer;
+ readFile( aFileName );
+ delta.x = delta.y = 0;
+}
+
+TFileViewer::~TFileViewer()
+{
+ if (buffer) free(buffer);
+ delete[] fileName;
+ fileLines->removeAll();
+ CLY_destroy(fileLines);
+}
+
+void TFileViewer::draw()
+{
+ const char *p;
+ AllocLocalStr(s,size.x+1);
+
+ ushort c = getColor(0x0301);
+ for( int i = 0; i < size.y; i++ )
+ {
+ TDrawBuffer b;
+ b.moveChar( 0, ' ', c, size.x );
+
+ if( delta.y + i < fileLines->getCount() )
+ {
+ p = operator[](delta.y+i);
+ if( p == 0 || strlen(p) < (unsigned)delta.x )
+ s[0] = EOS;
+ else
+ {
+ strncpy( s, p+delta.x, size.x );
+ s[size.x] = EOS;
+ }
+ b.moveStr( 0, s, c );
+ }
+ writeBuf( 0, i, size.x, 1, b );
+ }
+}
+
+void TFileViewer::scrollDraw()
+{
+ TScroller::scrollDraw();
+ draw();
+}
+
+void TFileViewer::readFile( const char *fName )
+{
+ if (fileName) delete[] fileName;
+
+ limit.x = 0;
+ fileName = newStr( fName );
+ int fileToView = open(fName, O_RDONLY | O_TEXT, 0);
+ if (fileToView <= 0)
+ {
+ messageBox(mfError | mfOKButton ,
+ _("Could not open '%s' for reading"),fName);
+ isValid = False;
+ }
+ else
+ {
+ size_t bufsize = filelength(fileToView) + 1;
+ buffer = (char *)malloc(bufsize);
+ real_bufsize = ::read(fileToView,buffer,bufsize);
+ char *start,*end,*bufend = buffer + real_bufsize;
+ start = buffer;
+ while (start < bufend)
+ {
+ end = start;
+ while (end < bufend && *end != '\n') end++;
+ *end = 0;
+ width = max( (size_t)width, strlen( start ) );
+ count++;
+ start = end + 1;
+ }
+ int i;
+ fileLines = new TLineCollection(count, 5);
+ fileLines->count = count;
+ for (i=0,start = buffer;i<count;i++)
+ {
+ fileLines->items[i] = (void *)(start-buffer);
+ while (*start++);
+ }
+ isValid = True;
+ }
+ count = fileLines->getCount();
+ setLimit(size.x + width, size.y + count);
+ close(fileToView);
+}
+
+void TFileViewer::saveFile(const char *fname)
+{
+ FILE *f;
+ f = fopen(fname,"wt+");
+ for (int i=0;i<count;i++)
+ fprintf(f,"%s\n",operator[](i));
+ fclose(f);
+}
+
+void TFileViewer::handleEvent(TEvent &event)
+{
+ TScroller::handleEvent(event);
+ switch (event.what)
+ {
+ case evBroadcast:
+ switch (event.message.command)
+ {
+ case cmFileViewAnswer:
+ clearEvent(event);
+ break;
+ default:
+ break;
+ }
+ break;
+ case evCommand:
+ switch (event.message.command)
+ {
+ case cmSaveFile:
+ {
+ char fname[256];
+ TFileDialog *dialog;
+ dialog = new TFileDialog("*",_("Save to file"),
+ _("~N~ame"),fdOKButton,0);
+ if (TProgram::deskTop->execView(dialog) != cmCancel)
+ {
+ dialog->getData(fname);
+ saveFile(fname);
+ }
+ CLY_destroy(dialog);
+ break;
+ }
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void TFileViewer::insertLine(const char *line)
+{
+ size_t len = strlen(line)+1;
+ buffer = (char *)realloc(buffer,real_bufsize+len);
+ memcpy(buffer+real_bufsize,line,len);
+ fileLines->insert((void*)(uipointer)real_bufsize);
+ real_bufsize += len;
+ count++;
+ len--;
+ width = width < (int)len ? (int)len : width;
+ setLimit(size.x + width, size.y + count);
+}
+
+void TFileViewer::setState( ushort aState, Boolean enable )
+{
+ TScroller::setState( aState, enable );
+ if( enable && (aState & sfExposed) )
+ setLimit( limit.x, limit.y );
+}
+
+Boolean TFileViewer::valid( ushort )
+{
+ return isValid;
+}
+
+const char * const TFileViewer::operator [](int index)
+{
+ if (index >= count) return NULL;
+ return (const char *)(buffer + (uipointer)fileLines->at(index));
+}
+
+
+
+
+static int winNumber = 0;
+
+TFileWindow::TFileWindow( const char *fileName ) :
+ TWindowInit( &TFileWindow::initFrame ),
+ TWindow( TProgram::deskTop->getExtent(), fileName, winNumber++ )
+{
+ options |= ofTileable;
+ TRect r( getExtent() );
+ r.grow(-1, -1);
+ insert(new TFileViewer( r,
+ standardScrollBar(sbHorizontal | sbHandleKeyboard),
+ standardScrollBar(sbVertical | sbHandleKeyboard),
+ fileName) );
+}
+
+
diff --git a/tvision/fromdos.pl b/tvision/fromdos.pl
new file mode 100644
index 0000000..fe26a5f
--- /dev/null
+++ b/tvision/fromdos.pl
@@ -0,0 +1,52 @@
+open(FI,"lista") || die "Can't open lista";
+
+while ($a=<FI>)
+ {
+ chop($a);
+
+ if (substr($a,0,1) eq "-")
+ {
+ $bin=1;
+ $exe=0;
+ $a=substr($a,1);
+ }
+ else
+ {
+ $bin=0;
+ if (substr($a,0,1) eq "+")
+ {
+ $exe=1;
+ $a=substr($a,1);
+ }
+ else
+ {
+ $exe=0;
+ }
+ }
+
+ if (!$bin and length($a))
+ {
+ &ToUNIX($a) || die "Failed to convert $a";
+ }
+ if ($exe)
+ {
+ system("chmod +x $a");
+ }
+ }
+
+sub ToUNIX
+{
+ local $/;
+ my $b;
+ my $a=$_[0];
+
+ print "Processing $a\n";
+ open(FIL,$a) || return 0;
+ $b=<FIL>;
+ $b =~ s/\r\n/\n/g;
+ close(FIL);
+
+ open(FIL,">$a") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
diff --git a/tvision/fromunix.pl b/tvision/fromunix.pl
new file mode 100644
index 0000000..e6d4603
--- /dev/null
+++ b/tvision/fromunix.pl
@@ -0,0 +1,28 @@
+open(FI,"lista.dos") || die "Can't open lista";
+
+while ($a=<FI>)
+ {
+ chop($a);
+
+ if (length($a))
+ {
+ &ToDOS($a) || die "Failed to convert $a";
+ }
+ }
+
+sub ToDOS
+{
+ local $/;
+ my $b;
+ my $a=$_[0];
+
+ print "Processing $a\n";
+ open(FIL,$a) || return 0;
+ $b=<FIL>;
+ $b =~ s/[!\r]\n/\r\n/g;
+ close(FIL);
+
+ open(FIL,">$a") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
diff --git a/tvision/histlist.cc b/tvision/histlist.cc
new file mode 100644
index 0000000..530e125
--- /dev/null
+++ b/tvision/histlist.cc
@@ -0,0 +1,208 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea.
+
+ *
+ *
+ */
+
+#define Uses_string
+#include <tv.h>
+
+#include <stdlib.h>
+
+// Avoid replacing new by MSS's macro
+#include <tv/no_mss.h>
+
+// SET: MSVC 7.1 is even more stupid than previous versions and we must
+// disable this misleading warning.
+#ifdef TVComp_MSC
+ #pragma warning( disable : 4291 )
+#endif
+
+class HistRec
+{
+
+public:
+
+ HistRec( uchar nId, const char *nStr );
+
+ void *operator new( size_t );
+ void *operator new( size_t, HistRec * );
+ // SET: This class can't be "deleted", is just some kind of "cast" to
+ // interpret a buffer as a list of elements, some kind of "heap helper".
+ // MSVC compiler worries about the fact that it oveloads new but
+ // doesn't overload delete. So we just make clear that delete isn't
+ // valid.
+ void operator delete( void * ) { abort(); };
+
+ uchar id;
+ uchar len;
+ char str[1];
+
+};
+
+void *HistRec::operator new( size_t, HistRec *hr )
+{
+ return hr;
+}
+
+void NEVER_RETURNS *HistRec::operator new( size_t )
+{
+ abort();
+ RETURN_WHEN_NEVER_RETURNS;
+}
+
+inline HistRec::HistRec( uchar nId, const char *nStr ) :
+ id( nId ),
+ len( strlen( nStr ) + 3 )
+{
+ strcpy( str, nStr );
+}
+
+
+inline HistRec *advance( HistRec *ptr, size_t s )
+{
+ return (HistRec *)((char *)ptr + s);
+}
+
+inline HistRec *backup( HistRec *ptr, size_t s )
+{
+ return (HistRec *)((char *)ptr - s);
+}
+
+inline HistRec *next( HistRec *ptr )
+{
+ return ::advance( ptr, ptr->len );
+}
+
+inline HistRec *prev( HistRec *ptr )
+{
+ return backup( ptr, ptr->len );
+}
+
+ushort historySize = 4000; // initial size of history block
+
+static uchar curId;
+static HistRec *curRec;
+static HistRec *historyBlock;
+static HistRec *lastRec;
+
+void advanceStringPointer()
+{
+ curRec = next( curRec );
+ while( curRec < lastRec && curRec->id != curId )
+ curRec = next( curRec );
+ if( curRec >= lastRec )
+ curRec = 0;
+}
+
+void deleteString()
+{
+ size_t len = curRec->len;
+
+ // BUG FIX - EFW - Mon 10/30/95
+ // This insures that if n = lastRec, no bytes are copied and
+ // a GPF is prevented.
+ HistRec *n = next(curRec);
+ CLY_memcpy(curRec, n, size_t((char *)lastRec - (char *)n));
+
+ lastRec = backup( lastRec, len );
+}
+
+void insertString( uchar id, const char *str )
+{
+ ushort len = strlen( str ) + 3;
+ while( len > historySize - ( (char *)lastRec - (char *)historyBlock ) )
+ {
+ ushort firstLen = historyBlock->len;
+ HistRec *dst = historyBlock;
+ HistRec *src = next( historyBlock );
+ memmove( dst, src, size_t( (char *)lastRec - (char *)src ) );
+ lastRec = backup( lastRec, firstLen );
+ }
+ new( lastRec ) HistRec( id, str );
+ lastRec = next( lastRec );
+}
+
+void startId( uchar id )
+{
+ curId = id;
+ curRec = historyBlock;
+}
+
+ushort historyCount( uchar id )
+{
+ startId( id );
+ ushort count = 0;
+ advanceStringPointer();
+ while( curRec != 0 )
+ {
+ count++;
+ advanceStringPointer();
+ }
+ return count;
+}
+
+void historyAdd( uchar id, const char *str )
+{
+ if( str[0] == EOS )
+ return;
+ startId( id );
+ advanceStringPointer();
+ while( curRec != 0 )
+ {
+ if( strcmp( str, curRec->str ) == 0 )
+ deleteString();
+ advanceStringPointer();
+ }
+ insertString( id, str );
+}
+
+const char *historyStr( uchar id, int index )
+{
+#if 0
+ startId( id );
+ for( short i = 0; i <= index; i++ )
+ advanceStringPointer();
+ if( curRec != 0 )
+ return curRec->str;
+ else
+ return 0;
+#else // To get the history in reverse order
+ int count = historyCount(id);
+ startId( id );
+ int _index = (count - index) - 1;
+ for (int i=0;i<=_index;i++)
+ advanceStringPointer();
+ if( curRec != 0 )
+ return curRec->str;
+ else
+ return 0;
+#endif
+}
+
+void clearHistory()
+{
+ new (historyBlock) HistRec( 0, "" );
+ lastRec = next( historyBlock );
+}
+
+#include <tv/yes_mss.h>
+
+void initHistory()
+{
+ historyBlock = (HistRec *) new char[historySize];
+ clearHistory();
+}
+
+void doneHistory()
+{
+ delete[] historyBlock;
+}
diff --git a/tvision/include/cl/dir.h b/tvision/include/cl/dir.h
new file mode 100644
index 0000000..6be63ed
--- /dev/null
+++ b/tvision/include/cl/dir.h
@@ -0,0 +1,53 @@
+#ifndef __DIR_H
+#define __DIR_H
+
+#include <direct.h>
+
+#ifndef MAX_PATH
+#define MAX_PATH 260
+#endif
+#ifndef MAXPATH
+#define MAXPATH MAX_PATH
+#endif
+
+#ifndef FA_NORMAL
+#define FA_NORMAL 0x00 /* Normal file, no attributes */
+#define FA_RDONLY 0x01 /* Read only attribute */
+#define FA_HIDDEN 0x02 /* Hidden file */
+#define FA_SYSTEM 0x04 /* System file */
+#define FA_LABEL 0x08 /* Volume label */
+#define FA_DIREC 0x10 /* Directory */
+#define FA_ARCH 0x00 /* Archive */
+#endif /* FA_NORMAL */
+
+#ifndef _FFBLK_DEF
+#define _FFBLK_DEF
+struct ffblk {
+ long ff_reserved;
+ long ff_fsize;
+ unsigned long ff_attrib;
+ unsigned short ff_ftime;
+ unsigned short ff_fdate;
+ char ff_name[MAXPATH];
+};
+#endif
+
+#define getdisk() (_getdrive() + 1)
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int findfirst( const char *__path,
+ struct ffblk *__ffblk,
+ int __attrib );
+int findnext( struct ffblk *__ffblk );
+int findclose( struct ffblk *__ffblk );
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* __DIR_H */
diff --git a/tvision/include/cl/dirent.h b/tvision/include/cl/dirent.h
new file mode 100644
index 0000000..0f0ec87
--- /dev/null
+++ b/tvision/include/cl/dirent.h
@@ -0,0 +1,43 @@
+/* vi: set ts=8 sw=4 : */
+/********************************************************************\
+*File : dirent.h
+*
+*Subject:
+* Substitution of Unix dirent.h for Win32
+*
+*Authors:
+* SAA Anatoli Soltan
+*
+*HISTORY:
+* Feb 18 1997 SAA
+* initial implementation; struct dirent has only
+* one field: d_name
+* Mar 15 2000 SAA added __cplusplus condition
+*********************************************************************/
+
+#ifndef __DIRENT_H
+#define __DIRENT_H
+
+#include <stdlib.h> /* _MAX_FNAME */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct dirent
+{
+ char d_name[_MAX_FNAME];
+};
+
+struct _DIR;
+typedef struct _DIR DIR;
+
+DIR* opendir(const char* name);
+struct dirent* readdir(DIR* dir);
+int closedir(DIR* dir);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __DIRENT_H */
diff --git a/tvision/include/cl/fnmatch.h b/tvision/include/cl/fnmatch.h
new file mode 100644
index 0000000..af0ee7e
--- /dev/null
+++ b/tvision/include/cl/fnmatch.h
@@ -0,0 +1,22 @@
+#ifndef __FNMATCH_H
+#define __FNMATCH_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define FNM_NOESCAPE 0x01
+#define FNM_PATHNAME 0x02
+#define FNM_PERIOD 0x04
+#define FNM_NOCASE 0x08
+
+#define FNM_NOMATCH 1
+#define FNM_ERROR 2
+
+int fnmatch(const char *_pattern, const char *_string, int _flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __FNMATCH_H */
diff --git a/tvision/include/cl/getopt.h b/tvision/include/cl/getopt.h
new file mode 100644
index 0000000..9f4f711
--- /dev/null
+++ b/tvision/include/cl/getopt.h
@@ -0,0 +1,112 @@
+/* Declarations for getopt.
+ Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 2000, 01, 2002 Salvador E. Tropea.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef HEADER_GETOPT_H
+#define HEADER_GETOPT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *CLY_optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int CLY_optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int CLY_opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int CLY_optopt;
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct CLY_option
+{
+ const char *name;
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+#define CLY_no_argument 0
+#define CLY_required_argument 1
+#define CLY_optional_argument 2
+
+extern int CLY_getopt(int argc, char *const *argv, const char *shortopts);
+extern int CLY_getopt_long(int argc, char *const *argv, const char *shortopts,
+ const struct CLY_option *longopts, int *longind);
+extern int CLY_getopt_long_only(int argc, char *const *argv,
+ const char *shortopts,
+ const struct CLY_option *longopts,
+ int *longind);
+/* Internal only. Users should not call this directly. */
+extern int CLY_getopt_internal(int argc, char *const *argv,
+ const char *shortopts,
+ const struct CLY_option *longopts,
+ int *longind,
+ int long_only);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HEADER_GETOPT_H */
diff --git a/tvision/include/cl/glob.h b/tvision/include/cl/glob.h
new file mode 100644
index 0000000..04fa9c3
--- /dev/null
+++ b/tvision/include/cl/glob.h
@@ -0,0 +1,36 @@
+#ifndef __GLOB_H
+#define __GLOB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <sys/types.h>
+
+typedef struct {
+ size_t gl_pathc;
+ char **gl_pathv;
+ size_t gl_offs;
+} glob_t;
+
+#define GLOB_APPEND 0x01
+#define GLOB_DOOFFS 0x02
+#define GLOB_ERR 0x04
+#define GLOB_MARK 0x08
+#define GLOB_NOCHECK 0x10
+#define GLOB_NOESCAPE 0x20
+#define GLOB_NOSORT 0x40
+
+#define GLOB_ABORTED 1
+#define GLOB_NOMATCH 2
+#define GLOB_NOSPACE 3
+
+int glob(const char *_pattern, int _flags, int (*_errfunc)(const char *_epath, int _eerrno), glob_t *_pglob);
+void globfree(glob_t *_pglob);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GLOB_H */
diff --git a/tvision/include/cl/needs.h b/tvision/include/cl/needs.h
new file mode 100644
index 0000000..3358123
--- /dev/null
+++ b/tvision/include/cl/needs.h
@@ -0,0 +1,153 @@
+/**[txh]********************************************************************
+
+ Description:
+ This header defines which functions must be defined for each supported
+compiler.@p
+
+ Copyright (c) 2000-2005 by Salvador E. Tropea
+ Covered by the GPL license.
+
+***************************************************************************/
+
+#include <tv/configtv.h>
+
+#ifdef TVComp_GCC
+ // GNU c is supported for various OSs:
+
+ #define NEEDS_GETCURDIR
+
+ // Win32 MinGW
+ #ifdef TVCompf_MinGW
+ #define NEEDS_FIXPATH
+ #define NEEDS_GLOB
+ #define NEEDS_FNMATCH
+ #define NEEDS_REGEX
+ #define NEEDS_GETOPT
+ #define NEEDS_MKSTEMP
+ #define NEEDS_NL_LANGINFO
+ #define NEEDS_GETLINE
+ // Internal implementation is broken. Is the same provided by MSVC.
+ #define NEEDS_SNPRINTF
+ #endif
+
+ // Win32 Cygwin
+ #ifdef TVCompf_Cygwin
+ #define NEEDS_FIXPATH
+ #define NEEDS_FILELENGTH
+ #define NEEDS_NL_LANGINFO
+ #define NEEDS_FNMATCH
+ #define NEEDS_ITOA
+ #define NEEDS_GETLINE
+ #endif
+
+ // DOS djgpp
+ #ifdef TVCompf_djgpp
+ #define NEEDS_GETOPT
+ #define NEEDS_NL_LANGINFO
+ #define NEEDS_GETLINE
+ #define NEEDS_SNPRINTF
+ #endif
+
+ // Linux
+ #ifdef TVOSf_Linux
+ // Strings
+ #define NEEDS_STRLWR
+ #define NEEDS_STRUPR
+ #define NEEDS_FIXPATH
+ #define NEEDS_FILELENGTH
+ #define NEEDS_ITOA
+ #endif
+
+ // Solaris
+ #ifdef TVOSf_Solaris
+ // Strings
+ #define NEEDS_STRLWR
+ #define NEEDS_STRUPR
+ #define NEEDS_GETOPT
+ #define NEEDS_FIXPATH
+ #define NEEDS_FILELENGTH
+ #define NEEDS_ITOA
+ #define NEEDS_NL_LANGINFO
+ #define NEEDS_GETLINE
+ #define NEEDS_SNPRINTF
+ #endif
+
+ #ifdef TVOSf_QNX4
+ #define NEEDS_SNPRINTF
+ #endif // TVOSf_QNX4
+
+ #ifdef TVOSf_Darwin
+ #define NEEDS_SNPRINTF
+ #endif
+
+ // Generic UNIX system
+ #if defined(TVOS_UNIX) && !defined(TVOSf_Linux) && !defined(TVOSf_Solaris)
+ // Strings
+ #define NEEDS_STRLWR
+ #define NEEDS_STRUPR
+ #define NEEDS_FIXPATH
+ #define NEEDS_FILELENGTH
+ #define NEEDS_ITOA
+ #define NEEDS_NL_LANGINFO
+ #define NEEDS_GETLINE
+ #if defined(TVOSf_FreeBSD) || defined(TVOSf_QNXRtP) || defined(TVOSf_QNX4) \
+ || defined(TVOSf_Darwin)
+ // Not for OpenBSD and NetBSD
+ #define NEEDS_GETOPT
+ #endif
+ #endif
+#endif
+
+
+// BC++ 5.5 for Win32 is supported
+#ifdef TVComp_BCPP
+ #define NEEDS_FIXPATH
+ #define NEEDS_GLOB
+ #define NEEDS_FNMATCH
+ #define NEEDS_UNC
+ #define NEEDS_REGEX
+ #define NEEDS_GETOPT
+ #define NEEDS_OPENDIR
+ #define NEEDS_MKSTEMP
+ #define NEEDS_NL_LANGINFO
+ #define NEEDS_IFSTREAMGETLINE
+ #define NEEDS_GETLINE
+#endif
+
+
+// MSVC will be supported if volunteers tests it or Microsoft decides to
+// give it for free ;-). After all Borland released BC++ 5.5.
+#if (defined(_MSVC) || defined(__MSC_VER)) && !defined(_MSC_VER)
+ #define _MSC_VER 100
+#endif
+
+#ifdef TVComp_MSC
+ #define NEEDS_GETCURDIR
+ #define NEEDS_FIXPATH
+ #define NEEDS_GLOB
+ #define NEEDS_FNMATCH
+ #define NEEDS_REGEX
+ #define NEEDS_GETOPT
+ #define NEEDS_MKSTEMP
+ #define NEEDS_NL_LANGINFO
+ #define NEEDS_GETLINE
+ #define NEEDS_OPENDIR
+ // Internal implementation is broken.
+ #define NEEDS_SNPRINTF
+ #define NEEDS_UNC
+#endif
+
+// Open Watcom for Win32 is supported
+#ifdef TVComp_Watcom
+ #define NEEDS_FIXPATH
+ #define NEEDS_GLOB
+ #define NEEDS_FNMATCH
+ #define NEEDS_UNC
+ #define NEEDS_GETOPT
+ #define NEEDS_OPENDIR
+ #define NEEDS_NL_LANGINFO
+ #define NEEDS_IFSTREAMGETLINE
+ #define NEEDS_GETLINE
+ #define NEEDS_GETCURDIR
+#endif
+
diff --git a/tvision/include/cl/regex.h b/tvision/include/cl/regex.h
new file mode 100644
index 0000000..7291a7a
--- /dev/null
+++ b/tvision/include/cl/regex.h
@@ -0,0 +1,499 @@
+/* Definitions for data structures and routines for the regular
+ expression library, version 0.12.
+
+ Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef __REGEXP_LIBRARY_H__
+#define __REGEXP_LIBRARY_H__
+
+/* POSIX says that <sys/types.h> must be included (by the caller) before
+ <regex.h>. */
+
+#ifdef VMS
+/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
+ should be there. */
+#include <stddef.h>
+#endif
+
+#include <stddef.h>
+
+/* The following bits are used to determine the regexp syntax we
+ recognize. The set/not-set meanings are chosen so that Emacs syntax
+ remains the value 0. The bits are given in alphabetical order, and
+ the definitions shifted by one from the previous bit; thus, when we
+ add or remove a bit, only one other definition need change. */
+typedef unsigned reg_syntax_t;
+
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
+
+/* If this bit is not set, then + and ? are operators, and \+ and \? are
+ literals.
+ If set, then \+ and \? are operators and + and ? are literals. */
+#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
+
+/* If this bit is set, then character classes are supported. They are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
+
+/* If this bit is set, then ^ and $ are always anchors (outside bracket
+ expressions, of course).
+ If this bit is not set, then it depends:
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
+
+ This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
+ POSIX draft 11.2 says that * etc. in leading positions is undefined.
+ We already implemented a previous draft which made those constructs
+ invalid, though, so we haven't changed the code back. */
+#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
+
+/* If this bit is set, then special characters are always special
+ regardless of where they are in the pattern.
+ If this bit is not set, then special characters are special only in
+ some contexts; otherwise they are ordinary. Specifically,
+ * + ? and intervals are only special when not after the beginning,
+ open-group, or alternation operator. */
+#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
+
+/* If this bit is set, then *, +, ?, and { cannot be first in an re or
+ immediately after an alternation or begin-group operator. */
+#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
+
+/* If this bit is set, then . matches newline.
+ If not set, then it doesn't. */
+#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
+
+/* If this bit is set, then . doesn't match NUL.
+ If not set, then it does. */
+#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
+
+/* If this bit is set, nonmatching lists [^...] do not match newline.
+ If not set, they do. */
+#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
+
+/* If this bit is set, either \{...\} or {...} defines an
+ interval, depending on RE_NO_BK_BRACES.
+ If not set, \{, \}, {, and } are literals. */
+#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
+/* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+#define RE_LIMITED_OPS (RE_INTERVALS << 1)
+
+/* If this bit is set, newline is an alternation operator.
+ If not set, newline is literal. */
+#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
+
+/* If this bit is set, then `{...}' defines an interval, and \{ and \}
+ are literals.
+ If not set, then `\{...\}' defines an interval. */
+#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
+
+/* If this bit is set, (...) defines a group, and \( and \) are literals.
+ If not set, \(...\) defines a group, and ( and ) are literals. */
+#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
+
+/* If this bit is set, then \<digit> matches <digit>.
+ If not set, then \<digit> is a back-reference. */
+#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
+
+/* If this bit is set, then | is an alternation operator, and \| is literal.
+ If not set, then \| is an alternation operator, and | is literal. */
+#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
+
+/* If this bit is set, then an ending range point collating higher
+ than the starting range point, as in [z-a], is invalid.
+ If not set, then when ending range point collates higher than the
+ starting range point, the range is ignored. */
+#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
+
+/* If this bit is set, then an unmatched ) is ordinary.
+ If not set, then an unmatched ) is invalid. */
+#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
+
+/* This global variable defines the particular regexp syntax to use (for
+ some interfaces). When a regexp is compiled, the syntax used is
+ stored in the pattern buffer, so changing this does not affect
+ already-compiled regexps. */
+extern reg_syntax_t re_syntax_options;
+
+/* Define combinations of the above bits for the standard possibilities.
+ (The [[[ comments delimit what gets put into the Texinfo file, so
+ don't delete them!) */
+/* [[[begin syntaxes]]] */
+#define RE_SYNTAX_EMACS 0
+
+#define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+#define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
+
+#define RE_SYNTAX_GREP \
+ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
+ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
+ | RE_NEWLINE_ALT)
+
+#define RE_SYNTAX_EGREP \
+ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
+ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
+ | RE_NO_BK_VBAR)
+
+#define RE_SYNTAX_POSIX_EGREP \
+ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+#define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+#define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+#define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
+ replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
+#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+/* [[[end syntaxes]]] */
+
+/* Maximum number of duplicates an interval can allow. Some systems
+ (erroneously) define this in other header files, but we want our
+ value, so remove any previous define. */
+#ifdef RE_DUP_MAX
+#undef RE_DUP_MAX
+#endif
+#define RE_DUP_MAX ((1 << 15) - 1)
+
+
+/* POSIX `cflags' bits (i.e., information for `regcomp'). */
+
+/* If this bit is set, then use extended regular expression syntax.
+ If not set, then use basic regular expression syntax. */
+#define REG_EXTENDED 1
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define REG_ICASE (REG_EXTENDED << 1)
+
+/* If this bit is set, then anchors do not match at newline
+ characters in the string.
+ If not set, then anchors do match at newlines. */
+#define REG_NEWLINE (REG_ICASE << 1)
+
+/* If this bit is set, then report only success or fail in regexec.
+ If not set, then returns differ between not matching and errors. */
+#define REG_NOSUB (REG_NEWLINE << 1)
+
+
+/* POSIX `eflags' bits (i.e., information for regexec). */
+
+/* If this bit is set, then the beginning-of-line operator doesn't match
+ the beginning of the string (presumably because it's not the
+ beginning of a line).
+ If not set, then the beginning-of-line operator does match the
+ beginning of the string. */
+#define REG_NOTBOL 1
+
+/* Like REG_NOTBOL, except for the end-of-line. */
+#define REG_NOTEOL (1 << 1)
+
+
+/* If any error codes are removed, changed, or added, update the
+ `re_error_msg' table in regex.c. */
+typedef enum
+{
+ REG_NOERROR = 0, /* Success. */
+ REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ REG_BADPAT, /* Invalid pattern. */
+ REG_ECOLLATE, /* Not implemented. */
+ REG_ECTYPE, /* Invalid character class name. */
+ REG_EESCAPE, /* Trailing backslash. */
+ REG_ESUBREG, /* Invalid back reference. */
+ REG_EBRACK, /* Unmatched left bracket. */
+ REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EBRACE, /* Unmatched \{. */
+ REG_BADBR, /* Invalid contents of \{\}. */
+ REG_ERANGE, /* Invalid range end. */
+ REG_ESPACE, /* Ran out of memory. */
+ REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ REG_EEND, /* Premature end. */
+ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
+ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+} reg_errcode_t;
+
+/* This data structure represents a compiled pattern. Before calling
+ the pattern compiler, the fields `buffer', `allocated', `fastmap',
+ `translate', and `no_sub' can be set. After the pattern has been
+ compiled, the `re_nsub' field is available. All other fields are
+ private to the regex routines. */
+
+struct re_pattern_buffer
+{
+/* [[[begin pattern_buffer]]] */
+ /* Space that holds the compiled pattern. It is declared as
+ `unsigned char *' because its elements are
+ sometimes used as array indexes. */
+ unsigned char *buffer;
+
+ /* Number of bytes to which `buffer' points. */
+ unsigned long allocated;
+
+ /* Number of bytes actually used in `buffer'. */
+ unsigned long used;
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t syntax;
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses
+ the fastmap, if there is one, to skip over impossible
+ starting points for matches. */
+ char *fastmap;
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation
+ is applied to a pattern when it is compiled and to a string
+ when it is matched. */
+ char *translate;
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in `re_search_2', to see
+ whether or not we should use the fastmap, so we don't set
+ this absolutely perfectly; see `re_compile_fastmap' (the
+ `duplicate' case). */
+ unsigned can_be_null : 1;
+
+ /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+ for `max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#define REGS_UNALLOCATED 0
+#define REGS_REALLOCATE 1
+#define REGS_FIXED 2
+ unsigned regs_allocated : 2;
+
+ /* Set to zero when `regex_compile' compiles a pattern; set to one
+ by `re_compile_fastmap' if it updates the fastmap. */
+ unsigned fastmap_accurate : 1;
+
+ /* If set, `re_match_2' does not return information about
+ subexpressions. */
+ unsigned no_sub : 1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the
+ beginning of the string. */
+ unsigned not_bol : 1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned not_eol : 1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned newline_anchor : 1;
+
+/* [[[end pattern_buffer]]] */
+};
+
+typedef struct re_pattern_buffer regex_t;
+
+
+/* search.c (search_buffer) in Emacs needs this one opcode value. It is
+ defined both in `regex.c' and here. */
+#define RE_EXACTN_VALUE 1
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+typedef int regoff_t;
+
+
+/* This is the structure we store register match data in. See
+ regex.texinfo for a full description of what registers match. */
+struct re_registers
+{
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+};
+
+
+/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+ `re_match_2' returns information about at least this many registers
+ the first time a `regs' structure is passed. */
+#ifndef RE_NREGS
+#define RE_NREGS 30
+#endif
+
+
+/* POSIX specification for registers. Aside from the different names than
+ `re_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+typedef struct
+{
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+} regmatch_t;
+
+/* Declarations for routines. */
+
+/* To avoid duplicating every routine declaration -- once with a
+ prototype (if we are ANSI), and once without (if we aren't) -- we
+ use the following macro to declare argument types. This
+ unfortunately clutters up the declarations a bit, but I think it's
+ worth it. */
+
+#if __STDC__ || defined(__cplusplus)
+
+#define _RE_ARGS(args) args
+
+#else /* not __STDC__ */
+
+#define _RE_ARGS(args) ()
+
+#endif /* not __STDC__ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Sets the current default syntax to SYNTAX, and return the old syntax.
+ You can also simply assign to the `re_syntax_options' variable. */
+extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
+
+/* Compile the regular expression PATTERN, with length LENGTH
+ and syntax given by the global `re_syntax_options', into the buffer
+ BUFFER. Return NULL if successful, and an error string if not. */
+extern const char *re_compile_pattern
+ _RE_ARGS ((const char *pattern, int length,
+ struct re_pattern_buffer *buffer));
+
+
+/* Compile a fastmap for the compiled pattern in BUFFER; used to
+ accelerate searches. Return 0 if successful and -2 if was an
+ internal error. */
+extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
+
+
+/* Search in the string STRING (with length LENGTH) for the pattern
+ compiled into BUFFER. Start searching at position START, for RANGE
+ characters. Return the starting position of the match, -1 for no
+ match, or -2 for an internal error. Also return register
+ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+extern int re_search
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
+ int length, int start, int range, struct re_registers *regs));
+
+
+/* Like `re_search', but search in the concatenation of STRING1 and
+ STRING2. Also, stop searching at index START + STOP. */
+extern int re_search_2
+ _RE_ARGS (( struct re_pattern_buffer *bufp,
+ const char *string1, const char *string2, int size1, int size2,
+ int startpos, int range, struct re_registers *regs, int stop ));
+
+/* Like `re_search', but return how many characters in STRING the regexp
+ in BUFFER matched, starting at position START. */
+extern int re_match
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
+ int length, int start, struct re_registers *regs));
+
+
+/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
+extern int re_match_2
+ _RE_ARGS (( struct re_pattern_buffer *bufp, const char *string1,
+ const char *string2, int size1, int size2, int pos,
+ struct re_registers *regs, int stop ));
+
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using BUFFER and REGS will use this memory
+ for recording register information. STARTS and ENDS must be
+ allocated with malloc, and must each be at least `NUM_REGS * sizeof
+ (regoff_t)' bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+extern void re_set_registers
+ _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
+ unsigned num_regs, regoff_t *starts, regoff_t *ends));
+
+/* 4.2 bsd compatibility. */
+extern char *re_comp _RE_ARGS ((const char *));
+extern int re_exec _RE_ARGS ((const char *));
+
+/* POSIX compatibility. */
+extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
+extern int regexec
+ _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
+ regmatch_t pmatch[], int eflags));
+extern size_t regerror
+ _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
+ size_t errbuf_size));
+extern void regfree _RE_ARGS ((regex_t *preg));
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* not __REGEXP_LIBRARY_H__ */
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/tvision/include/cl/strstream.h b/tvision/include/cl/strstream.h
new file mode 100644
index 0000000..694c39a
--- /dev/null
+++ b/tvision/include/cl/strstream.h
@@ -0,0 +1,6 @@
+#ifndef __STRSTREAM_H
+#define __STRSTREAM_H
+
+#include <strstrea.h>
+
+#endif /* __STRSTREAM_H */ \ No newline at end of file
diff --git a/tvision/include/cl/unistd.h b/tvision/include/cl/unistd.h
new file mode 100644
index 0000000..70603a2
--- /dev/null
+++ b/tvision/include/cl/unistd.h
@@ -0,0 +1,26 @@
+#ifndef __UNISTD_H
+#define __UNISTD_H
+
+//#define PATH_MAX MAXPATH
+
+#ifndef F_OK
+ #define F_OK 0
+#endif
+
+#ifndef R_OK
+ #define R_OK 4
+#endif
+
+#ifndef STDIN_FILENO
+ #define STDIN_FILENO 0
+#endif
+
+#ifndef STDOUT_FILENO
+ #define STDOUT_FILENO 1
+#endif
+
+#ifndef STDERR_FILENO
+ #define STDERR_FILENO 2
+#endif
+
+#endif /* __UNISTD_H */
diff --git a/tvision/include/cl/utime.h b/tvision/include/cl/utime.h
new file mode 100644
index 0000000..8b34370
--- /dev/null
+++ b/tvision/include/cl/utime.h
@@ -0,0 +1,20 @@
+#ifndef UTime_Included
+#define UTime_Included
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct utimbuf
+{
+ time_t actime;
+ time_t modtime;
+};
+
+int utime(const char *file, const struct utimbuf *time);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* UTime_Included */
diff --git a/tvision/include/cl/utsname.h b/tvision/include/cl/utsname.h
new file mode 100644
index 0000000..b65a743
--- /dev/null
+++ b/tvision/include/cl/utsname.h
@@ -0,0 +1 @@
+/* just a stub */
diff --git a/tvision/include/compatlayer.h b/tvision/include/compatlayer.h
new file mode 100644
index 0000000..8cc399f
--- /dev/null
+++ b/tvision/include/compatlayer.h
@@ -0,0 +1,2605 @@
+/**[txh]********************************************************************
+
+ Description:
+ This header works as a distribution point. It parses the Uses_*
+definitions and includes (or defines) the needed stuff.@p
+ Important guidelines:@*
+
+ Never include string.h use Use_string instead.
+ strlwr and strupr are defined.@*
+ stricmp and strnicmp are deprecated, use strcasecmp and strncasecmp
+instead.@*
+ Never use ios::bin (CLY_IOSBin).
+ Never use filebuf::openprot (CLY_FBOpenProtDef).
+ The O_TEXT and O_BINARY from fcntl needs Uses_fcntl.
+ S_IS* from sys/stat needs Uses_sys_stat.
+ Never use s/random, use s/rand which are ANSI/POSIX.
+ Streambuf members: setbuf, seekoff and sync have wrappers requested with
+Uses_PubStreamBuf.
+ Request alloca with Uses_alloca.
+ Never use movmem, use memmove instead (ANSI/POSIX).
+ Even when supported the old calls to fexpand, isDir, pathValid,
+validFileName, getCurDir, isWild, __file_exists, relativePath and driveValid
+should be replaced by a CLY_* function.
+ When possible POSIX compliant replacements are supplied for: glob, fnmatch
+and regex.
+ Added itoa for faster and safe integer to string conversion.
+
+ Copyright (c) 2000-2005 by Salvador E. Tropea
+ Covered by the GPL license.
+
+***************************************************************************/
+
+/* A global protection isn't suitable for all projects. Collisions should
+ be solved individually.
+#ifndef CLY_CompatLayerIncluded
+#define CLY_CompatLayerIncluded
+*/
+
+#include <tv/configtv.h>
+
+#ifdef Uses_fstream_simple
+ #ifdef HAVE_SSC
+ #define Uses_SSC_Streams 1
+ #else
+ #define Uses_fstream
+ #endif
+#endif
+
+#ifdef Uses_iostream_simple
+ #ifdef HAVE_SSC
+ #define Uses_SSC_Streams 1
+ #else
+ #define Uses_iostream
+ #endif
+#endif
+
+#ifdef Uses_strstream_simple
+ #ifdef HAVE_SSC
+ #define Uses_SSC_Streams 1
+ #else
+ #define Uses_strstream
+ #endif
+#endif
+
+#ifdef Uses_SSC_Streams
+ #define Uses_stdio
+#endif
+
+#ifdef __cplusplus
+ #define CLY_CFunc extern "C"
+#else
+ #define CLY_CFunc extern
+#endif
+
+#if !defined(CLY_DoNotDefineSizedTypes) && !defined(CLY_SizedTypesDefined)
+#define CLY_SizedTypesDefined 1
+/* The following types should be platform independent */
+typedef signed char int8;
+typedef short int16;
+typedef int int32;
+typedef unsigned char uint8;
+typedef unsigned short uint16;
+typedef unsigned int uint32;
+#if defined(TVComp_GCC)
+typedef unsigned long long uint64;
+typedef long long int64;
+#elif defined(TVComp_BCPP) || defined(TVComp_MSC) || defined (TVComp_Watcom)
+typedef unsigned __int64 uint64;
+typedef __int64 int64;
+#else
+ #error Can not define uint64 type: unknown compiler.
+#endif
+#endif /* CLY_DoNotDefineSizedTypes */
+
+#if defined(HAVE_64BITS_POINTERS) || (defined(TVComp_MSC) && defined(_WIN64))
+typedef uint64 uipointer;
+#else
+typedef uint32 uipointer;
+#endif
+/* Macros to cast a pointer into a 64 bits unsigned and viceversa */
+#undef CLY_PointerToUI64
+#undef CLY_UI64ToPointer
+#define CLY_UI64ToPointer(a) ((void *)(uipointer)(a))
+#define CLY_PointerToUI64(a) ((uint64)(uipointer)(a))
+
+#if defined(CLY_DefineUTypes) || defined(__cplusplus)
+/* The following are just aliases and the size is platform dependant */
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+#endif /* CLY_DefineUTypes */
+
+
+#ifdef Uses_stdio
+ #undef Include_stdio
+ #define Include_stdio 1
+#endif
+
+#ifdef Uses_stdarg
+ #undef Include_stdarg
+ #define Include_stdarg 1
+#endif
+
+#ifdef Uses_CLYFileAttrs
+ /* For mode_t */
+ #undef Uses_sys_stat
+ #define Uses_sys_stat 1
+#endif
+
+#undef FSTREAM_HEADER
+#define FSTREAM_HEADER <fstream.h>
+#undef STRSTREAM_HEADER
+#define STRSTREAM_HEADER <strstream.h>
+#undef IOMANIP_HEADER
+#define IOMANIP_HEADER <iomanip.h>
+#undef IOSTREAM_HEADER
+#define IOSTREAM_HEADER <iostream.h>
+#undef IOCTL_HEADER
+#define IOCTL_HEADER <sys/ioctl.h>
+#undef NEW_HEADER
+#define NEW_HEADER <new>
+
+#ifdef Uses_ioctl
+ #undef Include_ioctl
+ #define Include_ioctl 1
+#endif
+
+#ifdef Uses_time
+ #undef Include_time
+ #define Include_time 1
+#endif
+
+#ifdef Uses_signal
+ #undef Include_signal
+ #define Include_signal 1
+#endif
+
+/* The following are unconditionally defined for all platforms so here I avoid
+ redefinitions. */
+#undef CLY_Packed
+#undef NEVER_RETURNS
+#undef RETURN_WHEN_NEVER_RETURNS
+#undef DeleteArray
+#undef IfStreamGetLine
+#undef CLY_UseCrLf
+#undef CLY_Have_UGID
+#undef CLY_HaveDriveLetters
+#undef CLY_IsValidDirSep
+#undef PATHSEPARATOR
+#undef PATHSEPARATOR_
+#undef DIRSEPARATOR
+#undef DIRSEPARATOR_
+#undef CLY_ISOCpp98
+#undef CLY_filebuf
+#undef CLY_strstreambuf
+#undef CLY_int_filebuf
+#undef CLY_streambuf
+#undef CLY_OpenModeT
+#undef CLY_StreamPosT
+#undef CLY_StreamOffT
+#undef CLY_IOSSeekDir
+#undef CLY_FBOpenProtDef
+#undef CLY_NewFBFromFD
+#undef CLY_PubSetBuf
+#undef CLY_HaveFBAttach
+#undef CLY_FBOpen
+#undef CLY_IOSBin
+#undef CLY_IOSOut
+#undef CLY_IOSIn
+#undef CLY_IOSApp
+#undef CLY_IOSAtE
+#undef CLY_IOSBeg
+#undef CLY_IOSCur
+#undef CLY_IOSEnd
+#undef CLY_IOSBadBit
+#undef CLY_IOSEOFBit
+#undef CLY_IOSFailBit
+#undef CLY_IOSGoodBit
+#undef CLY_PubSeekOff
+#undef CLY_PubSync
+#undef CLY_std
+#undef CreateStrStream
+#undef GetStrStream
+#undef UsingNamespaceStd
+#undef CLY_HiddenDifferent
+#undef CLY_DummyTStreamRW
+#undef CLY_Have_snprintf
+#undef CLY_destroy
+#undef CLY_DONT_DEFINE_MIN_MAX
+#undef CLY_Redraw
+#undef CLY_SAFE_MEMCPY
+#undef CLY_EXPORT
+#undef CLY_BROKEN_WATCOM_SCOPE
+
+#define CLY_BROKEN_WATCOM_SCOPE protected
+
+#ifdef HAVE_UNSAFE_MEMCPY
+ #define CLY_SAFE_MEMCPY 0
+#else
+ /* All known implementations supports overlap when copying forwards */
+ /* But it isn't portable:
+
+ The `memcpy' function copies SIZE bytes from the object beginning
+ at FROM into the object beginning at TO. The behavior of this
+ function is undefined if the two arrays TO and FROM overlap; use
+ `memmove' instead if overlapping is possible.
+
+ Currently we assume that's safe, but any platform where it isn't can change it.
+ */
+ #define CLY_SAFE_MEMCPY 1
+#endif
+
+/* Most targets doesn't define destroy, but BC++ 5.6 defines
+ _stl::destroy and looks like it collides with any destroy not defined
+ inside another namespace. For this reason portable code should use
+ CLY_destroy and not destroy. To allow compiling old applications using
+ "clean" targets CLY_destroy is defined as destroy (then undefined for
+ BC++ 5.6) */
+#define CLY_destroy destroy
+
+/* Assume it as default */
+#define CLY_Have_snprintf 1
+
+/* Most C++ compilers doesn't need it, only MSVC seems to need *all* the
+ virtual members (even when not used) to link */
+#define CLY_DummyTStreamRW(cla)
+
+/* Watcom C++ used for QNX4 doesn't make any difference between Redraw
+ and redraw members. */
+#define CLY_Redraw Redraw
+
+/* The default is CLY_EXPORT expanded to nothing. */
+#define CLY_EXPORT
+
+#ifdef TVComp_GCC
+/* GNU C is supported for various OSs: */
+
+ #ifdef Uses_chdir
+ #undef Uses_unistd
+ #define Uses_unistd
+ #endif
+ #ifdef Uses_string
+ #undef Include_string
+ #define Include_string 1
+ #endif
+ #ifdef Uses_limits
+ #undef Include_limits
+ #define Include_limits 1
+ #endif
+ #ifdef Uses_fcntl
+ #undef Include_fcntl
+ #define Include_fcntl 1
+ #endif
+ #ifdef Uses_sys_stat
+ #undef Include_sys_stat
+ #define Include_sys_stat 1
+ #endif
+ #ifdef Uses_ctype
+ #undef Include_ctype
+ #define Include_ctype 1
+ #endif
+ #ifdef Uses_unistd
+ #undef Include_unistd
+ #define Include_unistd 1
+ #endif
+ #ifdef Uses_access
+ #undef Include_unistd
+ #define Include_unistd 1
+ #endif
+ #ifdef Uses_alloca
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_free
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_stdlib
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_dirent
+ #undef Include_dirent
+ #define Include_dirent 1
+ #endif
+ #ifdef Uses_abort
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_AllocLocal
+ #undef AllocLocalStr
+ #define AllocLocalStr(s,l) char s[l]
+ #undef AllocLocalUShort
+ #define AllocLocalUShort(s,l) ushort s[l]
+ #endif
+ #define NEVER_RETURNS __attribute__((noreturn))
+ #define RETURN_WHEN_NEVER_RETURNS
+ #define CLY_Packed __attribute__((packed))
+ /* SET: Anything allocated with new[] should be deleted with [].
+ Pointed out by Laurynas Biveinis. */
+ #define DeleteArray(a) delete[] a
+ #ifdef Uses_getcurdir
+ #undef getcurdir
+ #define getcurdir CLY_getcurdir
+ #endif
+ /* Not yet supported for Win9x with Ming
+ SET: I guess they can be defined for Win9x, but Anatoli's code seems to
+ be using NETAPI32.DLL functions that only exists under NT. */
+ #undef CLY_IsUNCShare
+ #define CLY_IsUNCShare(a) (0)
+ #undef CLY_IsUNC
+ #define CLY_IsUNC(a) (0)
+ #ifdef Uses_ftell
+ #undef Include_stdio
+ #define Include_stdio 1
+ #endif
+ #ifdef Uses_strstream
+ #undef Include_strstream
+ #define Include_strstream 1
+ #endif
+ /* ifstream::getline behaves strangely in BC++
+ I take the gcc implementation. */
+ #define IfStreamGetLine(istream,buffer,size) \
+ istream.getline(buffer,size)
+
+ /* ISO C++ 1998 standard changed a lot of details in the standard C++
+ library. GCC implemented it in version 3.0. BC++ implemented some
+ stuff in versions like BC++ 5.5. So that's a real mess. */
+ #if __GNUC__>=3
+ #if __GNUC__>=4 || __GNUC_MINOR__>=4
+ // gcc>=3.4. It have __gnu_cxx::stdio_filebuf class.
+ #define CLY_filebuf __gnu_cxx::stdio_filebuf<char>
+ #define CLY_int_filebuf CLY_filebuf
+ #define CLY_NewFBFromFD(buf,f) buf=new CLY_int_filebuf(fdopen(f,"rb+"),ios::in|ios::out|ios::binary)
+ #undef FSTREAM_HEADER
+ #define FSTREAM_HEADER <ext/stdio_filebuf.h>
+ #else
+ // gcc 3.1 needs a special filebuf
+ #define CLY_filebuf std::filebuf
+ #if __GNUC_MINOR__<1
+ #define CLY_int_filebuf CLY_filebuf
+ #define CLY_NewFBFromFD(buf,f) buf=new CLY_int_filebuf(fdopen(f,"rb+"),ios::in|ios::out|ios::binary)
+ #else
+ #undef CLY_DefineSpecialFileBuf
+ #define CLY_DefineSpecialFileBuf 1
+ #define CLY_NewFBFromFD(buf,f) buf=new CLY_int_filebuf(f,ios::in|ios::out|ios::binary)
+ #endif
+ #undef FSTREAM_HEADER
+ #define FSTREAM_HEADER <fstream>
+ #endif
+ #define CLY_streambuf std::streambuf
+ #define CLY_strstreambuf std::strstreambuf
+ #define CLY_ISOCpp98 1
+ #define CLY_OpenModeT std::ios::openmode
+ #define CLY_StreamPosT std::streampos
+ #define CLY_StreamOffT std::streamoff
+ #define CLY_IOSSeekDir std::ios::seekdir
+ #define CLY_FBOpenProtDef 0
+ #define CLY_PubSetBuf(a,b) pubsetbuf(a,b)
+ #define CLY_FBOpen(a,b,c) open(a,b)
+ #define CLY_IOSBin std::ios::binary
+ #define CLY_IOSOut std::ios::out
+ #define CLY_IOSIn std::ios::in
+ #define CLY_IOSApp std::ios::app
+ #define CLY_IOSAtE std::ios::ate
+ #define CLY_IOSBeg std::ios::beg
+ #define CLY_IOSCur std::ios::cur
+ #define CLY_IOSEnd std::ios::end
+ #define CLY_IOSBadBit std::ios::badbit
+ #define CLY_IOSEOFBit std::ios::eofbit
+ #define CLY_IOSFailBit std::ios::failbit
+ #define CLY_IOSGoodBit std::ios::goodbit
+ #define CLY_PubSeekOff pubseekoff
+ #define CLY_PubSync pubsync
+ #define CLY_std(a) std::a
+ #define UsingNamespaceStd using namespace std;
+ #define CreateStrStream(os,buf,size) std::string buf; std::ostringstream os(buf)
+ #define GetStrStream(os,buf) os.str().c_str()
+ #ifdef Uses_StrStream
+ #undef Include_sstream
+ #define Include_sstream 1
+ #endif
+ #undef IOMANIP_HEADER
+ #define IOMANIP_HEADER <iomanip>
+ #undef IOSTREAM_HEADER
+ #define IOSTREAM_HEADER <iostream>
+ #undef STRSTREAM_HEADER
+ #define STRSTREAM_HEADER <strstream>
+ #else
+ #define CLY_filebuf filebuf
+ #define CLY_int_filebuf filebuf
+ #define CLY_strstreambuf strstreambuf
+ #define CLY_streambuf streambuf
+ #define CLY_OpenModeT int
+ #define CLY_StreamPosT streampos
+ #define CLY_StreamOffT streamoff
+ #define CLY_IOSSeekDir ios::seek_dir
+ #define CLY_FBOpenProtDef filebuf::openprot
+ #define CLY_NewFBFromFD(buf,f) buf=new filebuf(f)
+ #define CLY_PubSetBuf(a,b) setbuf(a,b)
+ #define CLY_HaveFBAttach 1
+ #define CLY_FBOpen(a,b,c) open(a,b,c)
+ #define CLY_IOSBin ios::bin
+ #define CLY_IOSOut ios::out
+ #define CLY_IOSIn ios::in
+ #define CLY_IOSApp ios::app
+ #define CLY_IOSAtE ios::ate
+ #define CLY_IOSBeg ios::beg
+ #define CLY_IOSCur ios::cur
+ #define CLY_IOSEnd ios::end
+ #define CLY_IOSBadBit ios::badbit
+ #define CLY_IOSEOFBit ios::eofbit
+ #define CLY_IOSFailBit ios::failbit
+ #define CLY_IOSGoodBit ios::goodbit
+ #define CLY_PubSeekOff seekoff
+ #define CLY_PubSync sync
+ #define CLY_std(a) a
+ #define UsingNamespaceStd
+ #define CreateStrStream(os,buf,size) char buf[size]; \
+ ostrstream os(buf,sizeof(buf))
+ #define GetStrStream(os,buf) buf
+ #ifdef Uses_StrStream
+ #undef Include_strstream
+ #define Include_strstream 1
+ #endif
+ #endif
+
+ /* Use the internal bool type for Boolean */
+ #undef Boolean
+ #undef False
+ #undef True
+ #define Boolean bool
+ #define True true
+ #define False false
+
+ #ifdef TVCompf_MinGW
+ // MinGW uses MSVC runtime. Read more about the MSVC bug in the MSVC
+ // section.
+ #undef CLY_Have_snprintf
+ #define CLY_UseCrLf 1
+ #define CLY_HaveDriveLetters 1
+ /* I guess they are the same as MSVC: */
+ #undef FA_ARCH
+ #define FA_ARCH 0x00 /* _A_NORMAL */
+ #undef FA_DIREC
+ #define FA_DIREC 0x10 /* _A_SUBDIR */
+ #undef FA_RDONLY
+ #define FA_RDONLY 0x01 /* _A_RDONLY */
+ #ifdef Uses_filelength
+ #undef filelength
+ #define filelength _filelength
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #define PATHSEPARATOR ';'
+ #define PATHSEPARATOR_ ";"
+ /* SET: Not sure why Vadim wanted it. Perhaps to make the port more usable
+ for users accustomed to back slashes, but then the library isn't uniform
+ across platforms */
+ #define DIRSEPARATOR '\\'
+ #define DIRSEPARATOR_ "\\"
+ #define CLY_IsValidDirSep(a) (a=='/' || a=='\\')
+ #ifdef Uses_fixpath
+ CLY_CFunc void _fixpath(const char *in, char *out);
+ #endif
+ #ifdef Uses_HaveLFNs
+ #undef OS_HaveLFNs
+ #define OS_HaveLFNs 1
+ #endif
+ #ifdef Uses_glob
+ #undef Include_cl_glob
+ #define Include_cl_glob 1
+ #endif
+ #ifdef Uses_fnmatch
+ #undef Include_cl_fnmatch
+ #define Include_cl_fnmatch 1
+ #endif
+ #ifdef Uses_regex
+ #undef Include_cl_regex
+ #define Include_cl_regex 1
+ #endif
+ #ifdef Uses_getopt
+ #undef Include_cl_getopt
+ #define Include_cl_getopt 1
+ #endif
+ #ifdef Uses_io
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_utime
+ /* I can't beleive they forgot the header when the function is there! */
+ #undef Include_cl_utime
+ #define Include_cl_utime 1
+ #undef Include_time
+ #define Include_time 1
+ #endif
+ #ifdef Uses_mkstemp
+ CLY_CFunc int mkstemp(char *_template);
+ #endif
+ #ifdef Uses_getcwd
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_itoa
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_direct
+ #undef Include_direct
+ #define Include_direct 1
+ #endif
+ #ifdef Uses_dir
+ #undef Include_dir
+ #define Include_dir 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Uses_CLY_nl_langinfo
+ #define Uses_CLY_nl_langinfo 1
+ #endif
+ #undef Uses_CLY_ssize_t
+ #define Uses_CLY_ssize_t 1
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+ #ifndef usleep
+ #define usleep(microseconds) CLY_YieldProcessor(microseconds)
+ #endif
+ #ifndef __MINGW32_MAJOR_VERSION
+ // MinGW people is really ignorant about gcc.
+ // This definition should be done by gcc itself.
+ #include <_mingw.h>
+ #endif
+ #if defined(Uses_alloca) && (__MINGW32_MAJOR_VERSION>=2) && !defined(alloca)
+ // Why needed? that's a really idiot thing.
+ #define alloca __builtin_alloca
+ #endif
+ // MinGW lacks ioctl.h
+ #undef Include_ioctl
+ #endif
+
+ /* Win32/Cygwin -- OH! */
+ #ifdef TVCompf_Cygwin
+ #define CLY_HiddenDifferent 1
+ #define CLY_Have_UGID 1
+ #undef FA_ARCH
+ #undef FA_DIREC
+ #undef FA_RDONLY
+ #define FA_ARCH 0x01
+ #define FA_DIREC 0x02
+ #define FA_RDONLY 0x04
+ #ifdef Uses_filelength
+ #undef filelength
+ #define filelength CLY_filelength
+ #endif
+ #define PATHSEPARATOR ':'
+ #define PATHSEPARATOR_ ":"
+ #define DIRSEPARATOR '/'
+ #define DIRSEPARATOR_ "/"
+ #define CLY_IsValidDirSep(a) (a=='/')
+ #ifdef Uses_fixpath
+ CLY_CFunc void _fixpath(const char *in, char *out);
+ #endif
+ #ifdef Uses_HaveLFNs
+ #undef OS_HaveLFNs
+ #define OS_HaveLFNs 1
+ #endif
+ #ifdef Uses_glob
+ #undef Include_glob
+ #define Include_glob 1
+ #endif
+ #ifdef Uses_fnmatch
+ #undef Include_cl_fnmatch
+ #define Include_cl_fnmatch 1
+ #endif
+ #ifdef Uses_regex
+ #undef Include_sys_types
+ #define Include_sys_types 1
+ #undef Include_regex
+ #define Include_regex 1
+ #endif
+ #ifdef Uses_getopt
+ #undef Include_getopt
+ #define Include_getopt 1
+ #endif
+ #ifdef Uses_utime
+ #undef Include_utime
+ #define Include_utime 1
+ #endif
+ #ifdef Uses_mkstemp
+ #undef Include_stdio
+ #define Include_stdio 1
+ #endif
+ #ifdef Uses_getcwd
+ #undef Include_unistd
+ #define Include_unistd 1
+ #endif
+ #ifdef Uses_itoa
+ CLY_CFunc char *itoa(int value, char *string, int radix);
+ #endif
+ #ifdef Uses_dir
+ #undef Include_dir
+ #define Include_dir 1
+ #undef Include_direct
+ #define Include_direct 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Uses_CLY_nl_langinfo
+ #define Uses_CLY_nl_langinfo 1
+ #endif
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+ #endif
+
+ /* Under DOS djgpp defines it */
+ #ifdef TVCompf_djgpp
+ #define CLY_UseCrLf 1
+ #define CLY_HaveDriveLetters 1
+ #ifdef Uses_filelength
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #define PATHSEPARATOR ';'
+ #define PATHSEPARATOR_ ";"
+ #define DIRSEPARATOR '/'
+ #define DIRSEPARATOR_ "/"
+ #define CLY_IsValidDirSep(a) (a=='/' || a=='\\')
+ #ifdef Uses_fixpath
+ #undef Include_sys_stat
+ #define Include_sys_stat 1
+ #endif
+ #ifdef Uses_HaveLFNs
+ #undef Include_fcntl
+ #define Include_fcntl 1
+ #undef DJGPP_HaveLFNs
+ #define DJGPP_HaveLFNs 1
+ #endif
+ #ifdef Uses_glob
+ #undef Include_glob
+ #define Include_glob 1
+ #endif
+ #ifdef Uses_fnmatch
+ #undef Include_fnmatch
+ #define Include_fnmatch 1
+ #endif
+ #ifdef Uses_regex
+ #undef Include_sys_types
+ #define Include_sys_types 1
+ #undef Include_regex
+ #define Include_regex 1
+ #endif
+ #ifdef Uses_getopt
+ #undef Include_cl_getopt
+ #define Include_cl_getopt 1
+ #endif
+ #ifdef Uses_io
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_utime
+ #undef Include_utime
+ #define Include_utime 1
+ #endif
+ #ifdef Uses_mkstemp
+ #undef Include_stdio
+ #define Include_stdio 1
+ #endif
+ #ifdef Uses_getcwd
+ #undef Include_unistd
+ #define Include_unistd 1
+ #endif
+ #ifdef Uses_itoa
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_direct
+ #undef Include_direct
+ #define Include_direct 1
+ #endif
+ #ifdef Uses_dir
+ #undef Include_dir
+ #define Include_dir 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Uses_CLY_nl_langinfo
+ #define Uses_CLY_nl_langinfo 1
+ #endif
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+ #undef CLY_Have_snprintf
+ #endif
+
+ /* Common to all UNIX systems */
+ #ifdef TVOS_UNIX
+ /* Filesystem */
+ #define CLY_HiddenDifferent 1
+ #define CLY_Have_UGID 1
+ #undef FA_ARCH
+ #undef FA_DIREC
+ #undef FA_RDONLY
+ #define FA_ARCH 0x01
+ #define FA_DIREC 0x02
+ #define FA_RDONLY 0x04
+ #define PATHSEPARATOR ':'
+ #define PATHSEPARATOR_ ":"
+ #define DIRSEPARATOR '/'
+ #define DIRSEPARATOR_ "/"
+ #define CLY_IsValidDirSep(a) (a=='/')
+ #ifdef Uses_HaveLFNs
+ #undef OS_HaveLFNs
+ #define OS_HaveLFNs 1
+ #endif
+ /* Non standard */
+ #ifdef Uses_string
+ CLY_CFunc char *strlwr(char *s);
+ CLY_CFunc char *strupr(char *s);
+ #endif
+ #ifdef Uses_itoa
+ CLY_CFunc char *itoa(int value, char *string, int radix);
+ #endif
+ #ifdef Uses_filelength
+ #undef filelength
+ #define filelength CLY_filelength
+ #endif
+ #ifdef Uses_fixpath
+ CLY_CFunc void _fixpath(const char *in, char *out);
+ #endif
+ /* POSIX */
+ #ifdef Uses_glob
+ #undef Include_glob
+ #define Include_glob 1
+ #endif
+ #ifdef Uses_fnmatch
+ #undef Include_fnmatch
+ #define Include_fnmatch 1
+ #endif
+ #ifdef Uses_regex
+ #undef Include_sys_types
+ #define Include_sys_types 1
+ #undef Include_regex
+ #define Include_regex 1
+ #endif
+ #ifdef Uses_utime
+ #undef Include_utime
+ #define Include_utime 1
+ #endif
+ #ifdef Uses_mkstemp
+ #undef Include_stdio
+ #define Include_stdio 1
+ #endif
+ #ifdef Uses_getcwd
+ #undef Include_unistd
+ #define Include_unistd 1
+ #endif
+ /* Headers */
+ #ifdef Uses_direct
+ #undef Include_direct
+ #define Include_direct 1
+ #endif
+ /* dir.h isn't POSIX.
+ #ifdef Uses_dir
+ #undef Include_dir
+ #define Include_dir 1
+ #endif*/
+ #endif
+
+ /* Linux (glibc) */
+ #ifdef TVOSf_Linux
+ #ifdef Uses_nl_langinfo
+ #undef Include_langinfo
+ #define Include_langinfo 1
+ #endif
+ #ifdef Uses_getopt
+ #undef Include_getopt
+ #define Include_getopt 1
+ #endif
+ #ifdef Uses_CLYFileAttrs
+ /* Is that a bug? shouldn't be sys/stat.h enough? */
+ #undef Include_sys_types
+ #define Include_sys_types 1
+ #endif
+ #ifdef Uses_getline
+ #undef Include_stdio
+ #define Include_stdio 1
+ /* That's a GNU extension and needs it */
+ #undef _GNU_SOURCE
+ #define _GNU_SOURCE
+ #define CLY_getline getline
+ #endif
+ // Avoid including libintl.h, we have the prototypes
+ // This is a temporal workaround.
+ //#undef _LIBINTL_H
+ //#define _LIBINTL_H 1
+ // Needed to successfully compile with g++ 4.0.3
+ // Donald R. Ziesig 2006-11-02
+ #if __GNUC__ >= 4
+ #include <libintl.h>
+ #endif
+ #endif
+
+ /* Solaris using gcc but not glibc */
+ #ifdef TVOSf_Solaris
+ #ifdef Uses_getopt
+ #undef Include_cl_getopt
+ #define Include_cl_getopt 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Include_langinfo
+ #define Include_langinfo 1
+ #endif
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+ #ifdef TV_MAJOR_VERSION
+ // size_t needs a explicit include for Solaris.
+ // That's used by TV headers by default.
+ #undef Include_stdio
+ #define Include_stdio 1
+ #endif
+ // Solaris 2.7 w/gcc 2.95 doesn't need alloca.h
+ // Solaris 9 w/gcc 3.3.2 does ?!
+ #if defined(Uses_alloca) && (__GNUC__>=3)
+ #undef Include_alloca
+ #define Include_alloca 1
+ #endif
+ // At least Solaris 9 have a non POSIX snprintf.
+ // It fails to work for NULL pointers as POSIX states.
+ #undef CLY_Have_snprintf
+ #endif
+
+ #if defined(TVOSf_QNX4)
+ #if defined(Uses_alloca) && !defined(alloca)
+ #define alloca __builtin_alloca
+ #endif // alloca
+
+ #ifdef Uses_string
+ #undef Include_string
+ #define Include_string 1
+ #undef strncasecmp
+ #define strncasecmp strcasencmp
+
+ // declare strcase* functions here to avoid unix.h inclusion.
+ #include <sys/types.h>
+
+ CLY_CFunc int strcasecmp(const char* s1, const char* s2);
+ CLY_CFunc int strcasencmp(const char* s1, const char* s2, size_t n);
+
+ #endif // string
+
+ #if defined(Uses_stdlib) || defined(Uses_unistd)
+ #undef Include_process
+ #define Include_process 1
+ #endif // process
+
+ #undef CLY_Redraw
+ #define CLY_Redraw ForcedRedraw
+
+ #undef IOCTL_HEADER
+ #define IOCTL_HEADER <ioctl.h>
+
+ #undef CLY_Have_snprintf
+ #endif // TVOSf_QNX4
+
+ /* OpenBSD, tested with 3.4 */
+ #ifdef TVOSf_OpenBSD
+ #ifdef Uses_getopt
+ #undef Include_getopt
+ #define Include_getopt 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Uses_CLY_nl_langinfo
+ #define Uses_CLY_nl_langinfo 1
+ #endif
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+ #endif
+
+ /* NetBSD, tested with 1.6.1 */
+ #ifdef TVOSf_NetBSD
+ #ifdef Uses_getopt
+ #undef Include_getopt
+ #define Include_getopt 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Uses_CLY_nl_langinfo
+ #define Uses_CLY_nl_langinfo 1
+ #endif
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+ #endif
+
+ /* OSF1 (Tru64) */
+ #ifdef TVOSf_Tru64
+ #ifdef Uses_alloca
+ #undef Include_alloca
+ #define Include_alloca 1
+ #endif
+ #endif
+
+ /* Darwin (MacOS X) */
+ #ifdef TVOSf_Darwin
+ // At least MacOS X 10.2 have a non POSIX snprintf.
+ // It fails to work for NULL pointers as POSIX states.
+ #undef CLY_Have_snprintf
+ #endif
+
+ /* Generic UNIX system */
+ #if defined(TVOS_UNIX) && !defined(TVOSf_Linux) && !defined(TVOSf_Solaris) \
+ && !defined(TVOSf_OpenBSD) && !defined(TVOSf_NetBSD)
+ #ifdef Uses_getopt
+ #undef Include_cl_getopt
+ #define Include_cl_getopt 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Uses_CLY_nl_langinfo
+ #define Uses_CLY_nl_langinfo 1
+ #endif
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+ #endif
+#endif /* TVComp_GCC */
+
+
+
+/* BC++ 5.5 and 5.6 for Win32 are supported */
+#ifdef TVComp_BCPP
+ #define CLY_UseCrLf 1
+ #define CLY_HaveDriveLetters 1
+ #define CLY_Packed
+ #ifndef CLY_BooleanDefined
+ #define CLY_BooleanDefined 1
+ /* Simple Boolean type */
+ enum Boolean { False, True };
+ #endif
+ #ifdef Uses_string
+ #undef Include_string
+ #define Include_string 1
+ #undef strncasecmp
+ #define strncasecmp strnicmp
+ #undef strcasecmp
+ #define strcasecmp stricmp
+ #endif
+ #ifdef Uses_abort
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_limits
+ #undef Include_limits
+ #define Include_limits 1
+ #endif
+ #ifdef Uses_fcntl
+ #undef Include_fcntl
+ #define Include_fcntl 1
+ #endif
+ #ifdef Uses_sys_stat
+ #undef Include_sys_stat
+ #define Include_sys_stat 1
+ #endif
+ #ifdef Uses_unistd
+ #undef Include_cl_unistd
+ #define Include_cl_unistd 1
+ /* Most unistd equivalents are here: */
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_access
+ #undef Include_io
+ #define Include_io 1
+ #undef R_OK
+ #define R_OK 4
+ #undef W_OK
+ #define W_OK 2
+ #undef F_OK
+ #define F_OK 0
+ // No test for execute => just exists
+ #undef X_OK
+ #define X_OK 0
+ #endif
+ #ifdef Uses_ctype
+ #undef Include_ctype
+ #define Include_ctype 1
+ #endif
+ #ifdef Uses_filelength
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_getcurdir
+ #undef Include_dir
+ #define Include_dir 1
+ #endif
+ #ifdef Uses_AllocLocal
+ #undef AllocLocalStr
+ #define AllocLocalStr(s,l) char* s = (char*)alloca(l)
+ #undef AllocLocalUShort
+ #define AllocLocalUShort(s,l) ushort *s = (ushort*)alloca(sizeof(ushort) * (l))
+ #undef Uses_alloca
+ #define Uses_alloca 1
+ #endif
+ #ifdef Uses_alloca
+ #undef Include_malloc
+ #define Include_malloc 1
+ #endif
+ #ifdef Uses_free
+ #undef Include_malloc
+ #define Include_malloc 1
+ #endif
+ #define NEVER_RETURNS
+ #define RETURN_WHEN_NEVER_RETURNS return 0
+ #undef __attribute__
+ #define __attribute__( value )
+ #undef __inline__
+ #define __inline__ inline
+ #define DeleteArray(a) delete[] a
+ #define PATHSEPARATOR ';'
+ #define PATHSEPARATOR_ ";"
+ #define DIRSEPARATOR '/'
+ #define DIRSEPARATOR_ "/"
+ #define CLY_IsValidDirSep(a) (a=='/' || a=='\\')
+ #ifdef Uses_fixpath
+ CLY_CFunc void _fixpath(const char *in, char *out);
+ #endif
+ /* Checks for UNCs under Win9x and NT provided by Anantoli Soltan */
+ CLY_CFunc int CLY_IsUNC(const char* path);
+ CLY_CFunc int CLY_IsUNCShare(const char* path);
+ #ifdef Uses_HaveLFNs
+ #undef OS_HaveLFNs
+ #define OS_HaveLFNs 1
+ #endif
+ #ifdef Uses_glob
+ #undef Include_cl_glob
+ #define Include_cl_glob 1
+ #endif
+ #ifdef Uses_fnmatch
+ #undef Include_cl_fnmatch
+ #define Include_cl_fnmatch 1
+ #endif
+ #ifdef Uses_regex
+ #undef Include_cl_regex
+ #define Include_cl_regex 1
+ #endif
+ #ifdef Uses_getopt
+ #undef Include_cl_getopt
+ #define Include_cl_getopt 1
+ #endif
+ #ifdef Uses_io
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_dirent
+ #undef Include_cl_dirent
+ #define Include_cl_dirent 1
+ #endif
+ #ifdef Uses_ftell
+ #undef Include_io
+ #define Include_io 1
+ #undef Include_stdio
+ #define Include_stdio 1
+ #endif
+ #ifdef Uses_stdlib
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_utime
+ #undef Include_utime
+ #define Include_utime 1
+ #endif
+ #ifdef Uses_mkstemp
+ CLY_CFunc int mkstemp(char *_template);
+ #endif
+ #ifdef Uses_getcwd
+ #undef Include_dir
+ #define Include_dir 1
+ #endif
+ #ifdef Uses_itoa
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_direct
+ #undef Include_direct
+ #define Include_direct 1
+ #endif
+ #ifdef Uses_dir
+ #undef Include_dir
+ #define Include_dir 1
+ #endif
+ #ifdef Uses_strstream
+ #undef Include_strstream
+ #define Include_strstream 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Uses_CLY_nl_langinfo
+ #define Uses_CLY_nl_langinfo 1
+ #endif
+ #undef Uses_CLY_ssize_t
+ #define Uses_CLY_ssize_t 1
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+ #ifndef usleep
+ // Doesn't work, needs to be fixed.
+ #define usleep(microseconds) CLY_YieldProcessor(microseconds)
+ #endif
+ // BC++ lacks ioctl.h
+ #undef Include_ioctl
+
+ /* ifstream::getline behaves strangely in BC++
+ I take the gcc implementation, here is a replacement. */
+ #define IfStreamGetLine(istream,buffer,size) \
+ CLY_IfStreamGetLine(istream,buffer,size)
+ #ifdef Uses_IfStreamGetLine
+ #undef Uses_fstream
+ #define Uses_fstream 1
+ #undef Uses_CLY_IfStreamGetLine
+ #define Uses_CLY_IfStreamGetLine 1
+ #endif
+
+ #if __BORLANDC__>=0x560
+ // BC++ 5.6 (Builder 6)
+ #define CLY_ISOCpp98 1
+ #define CLY_DONT_DEFINE_MIN_MAX 1
+ // BC++ 5.6 supports the "open(int fd)" UNIX extension.
+ #define CLY_NewFBFromFD(buf,f) buf=new filebuf(); buf->open(f)
+ #undef CLY_destroy
+ // Note: that 0777 fails to create the file and 0666 creates a hidden file.
+ #define CLY_FBOpenProtDef 0
+ #else
+ // BC++ 5.5 and 5.5.1 (Free command line tools)
+ #define CLY_NewFBFromFD(buf,f) buf=new filebuf(f)
+ #define CLY_FBOpenProtDef 0666
+ #endif
+
+ #define CLY_int_filebuf filebuf
+ #define CLY_filebuf filebuf
+ #define CLY_strstreambuf strstreambuf
+ #define CLY_streambuf streambuf
+ #define CLY_OpenModeT int
+ #define CLY_StreamPosT streampos
+ #define CLY_StreamOffT streamoff
+ #define CLY_IOSSeekDir ios::seek_dir
+ #define CLY_PubSetBuf(a,b) pubsetbuf(a,b)
+ #define CLY_FBOpen(a,b,c) open(a,b,c)
+ #define CLY_IOSBin ios::binary
+ #define CLY_IOSOut ios::out
+ #define CLY_IOSIn ios::in
+ #define CLY_IOSApp ios::app
+ #define CLY_IOSAtE ios::ate
+ #define CLY_IOSBeg ios::beg
+ #define CLY_IOSCur ios::cur
+ #define CLY_IOSEnd ios::end
+ #define CLY_IOSBadBit ios::badbit
+ #define CLY_IOSEOFBit ios::eofbit
+ #define CLY_IOSFailBit ios::failbit
+ #define CLY_IOSGoodBit ios::goodbit
+ #define CLY_PubSeekOff pubseekoff
+ #define CLY_PubSync pubsync
+ #define CLY_std(a) a
+ #define CreateStrStream(os,buf,size) char buf[size]; \
+ ostrstream os(buf,sizeof(buf))
+ #define GetStrStream(os,buf) buf
+ #ifdef Uses_StrStream
+ #undef Include_strstream
+ #define Include_strstream 1
+ #endif
+ #define UsingNamespaceStd
+#endif /* TVComp_BCPP */
+
+
+/* Open Watcom for Win32 support */
+/* Derived from BC++ section */
+#ifdef TVComp_Watcom
+ /* Support for the library as a DLL. */
+ #undef CLY_EXPORT
+ #ifdef CLY_DLL
+ #define CLY_EXPORT __declspec(dllexport)
+ #else
+ #define CLY_EXPORT __declspec(dllimport)
+ #endif
+ /* Watcom generates the following error for validate.h:
+ include\tv\validate.h(127): Error! E346: col(33) protected base class accessed to convert cast expression
+ So we just use public there.
+ */
+ #undef CLY_BROKEN_WATCOM_SCOPE
+ #define CLY_BROKEN_WATCOM_SCOPE public
+ /* Disables useless warnings. */
+ #pragma warning 555 9
+ #define CLY_UseCrLf 1
+ #define CLY_HaveDriveLetters 1
+ #define CLY_Packed
+ #ifndef CLY_BooleanDefined
+ #define CLY_BooleanDefined 1
+ /* Simple Boolean type */
+ enum Boolean { False, True };
+ #endif
+ #ifdef Uses_string
+ #undef Include_string
+ #define Include_string 1
+ #undef strncasecmp
+ #define strncasecmp strnicmp
+ #undef strcasecmp
+ #define strcasecmp stricmp
+ #endif
+ #ifdef Uses_abort
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_limits
+ #undef Include_limits
+ #define Include_limits 1
+ #endif
+ #ifdef Uses_fcntl
+ #undef Include_fcntl
+ #define Include_fcntl 1
+ #endif
+ #ifdef Uses_sys_stat
+ #undef Include_sys_stat
+ #define Include_sys_stat 1
+ #endif
+ #ifdef Uses_unistd
+ #undef Include_cl_unistd
+ #define Include_cl_unistd 1
+ /* Most unistd equivalents are here: */
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_access
+ #undef Include_io
+ #define Include_io 1
+ #undef R_OK
+ #define R_OK 4
+ #undef W_OK
+ #define W_OK 2
+ #undef F_OK
+ #define F_OK 0
+ // No test for execute => just exists
+ #undef X_OK
+ #define X_OK 1 // Watcom defines 1 for it and F_OK as 0
+ #endif
+ #ifdef Uses_ctype
+ #undef Include_ctype
+ #define Include_ctype 1
+ #endif
+ #ifdef Uses_filelength
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_getcurdir
+ #undef getcurdir
+ #define getcurdir CLY_getcurdir
+ #endif
+ #ifdef Uses_AllocLocal
+ #undef AllocLocalStr
+ #define AllocLocalStr(s,l) char* s = (char*)alloca(l)
+ #undef AllocLocalUShort
+ #define AllocLocalUShort(s,l) ushort *s = (ushort*)alloca(sizeof(ushort) * (l))
+ #undef Uses_alloca
+ #define Uses_alloca 1
+ #endif
+ #ifdef Uses_alloca
+ #undef Include_malloc
+ #define Include_malloc 1
+ #endif
+ #ifdef Uses_free
+ #undef Include_malloc
+ #define Include_malloc 1
+ #endif
+ #define NEVER_RETURNS
+ #define RETURN_WHEN_NEVER_RETURNS return 0
+ #undef __attribute__
+ #define __attribute__( value )
+ #undef __inline__
+ #define __inline__ inline
+ #define DeleteArray(a) delete[] a
+ #define PATHSEPARATOR ';'
+ #define PATHSEPARATOR_ ";"
+ #define DIRSEPARATOR '/'
+ #define DIRSEPARATOR_ "/"
+ #define CLY_IsValidDirSep(a) (a=='/' || a=='\\')
+ #ifdef Uses_fixpath
+ CLY_CFunc void _fixpath(const char *in, char *out);
+ #endif
+ /* Checks for UNCs under Win9x and NT provided by Anantoli Soltan */
+ CLY_CFunc int CLY_IsUNC(const char* path);
+ CLY_CFunc int CLY_IsUNCShare(const char* path);
+ #ifdef Uses_HaveLFNs
+ #undef OS_HaveLFNs
+ #define OS_HaveLFNs 1
+ #endif
+ #ifdef Uses_glob
+ #undef Include_cl_glob
+ #define Include_cl_glob 1
+ #endif
+ #ifdef Uses_fnmatch
+ #undef Include_cl_fnmatch
+ #define Include_cl_fnmatch 1
+ #endif
+ #ifdef Uses_regex
+ #undef Include_cl_regex
+ #define Include_cl_regex 1
+ #endif
+ #ifdef Uses_getopt
+ #undef Include_cl_getopt
+ #define Include_cl_getopt 1
+ #endif
+ #ifdef Uses_io
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_dirent
+ //#undef Include_dirent
+ //#define Include_dirent 1
+ // Watcom defines DIR and dirent in direct.h
+ #undef Include_direct
+ #define Include_direct 1
+ #endif
+ #ifdef Uses_ftell
+ #undef Include_io
+ #define Include_io 1
+ #undef Include_stdio
+ #define Include_stdio 1
+ #endif
+ #ifdef Uses_stdlib
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_utime
+ #undef Include_utime
+ #define Include_utime 1
+ #endif
+ #ifdef Uses_mkstemp
+ CLY_CFunc int mkstemp(char *_template);
+ #endif
+ #ifdef Uses_getcwd
+ #undef Include_dir
+ #define Include_dir 1
+ #endif
+ #ifdef Uses_itoa
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_direct
+ #undef Include_direct
+ #define Include_direct 1
+ #endif
+ #ifdef Uses_dir
+ #undef Include_dir
+ #define Include_dir 1
+ #endif
+ #ifdef Uses_strstream
+ #undef Include_strstream
+ #define Include_strstream 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Uses_CLY_nl_langinfo
+ #define Uses_CLY_nl_langinfo 1
+ #endif
+ #undef Uses_CLY_ssize_t
+ #define Uses_CLY_ssize_t 1
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+ #ifndef usleep
+ // Doesn't work, needs to be fixed.
+ #define usleep(microseconds) CLY_YieldProcessor(microseconds)
+ #endif
+ // BC++ lacks ioctl.h
+ #undef Include_ioctl
+
+ /* ifstream::getline behaves strangely in BC++
+ I take the gcc implementation, here is a replacement. */
+ #define IfStreamGetLine(istream,buffer,size) \
+ CLY_IfStreamGetLine(istream,buffer,size)
+ #ifdef Uses_IfStreamGetLine
+ #undef Uses_fstream
+ #define Uses_fstream 1
+ #undef Uses_CLY_IfStreamGetLine
+ #define Uses_CLY_IfStreamGetLine 1
+ #endif
+
+ #if __BORLANDC__>=0x560
+ // BC++ 5.6 (Builder 6)
+ #define CLY_ISOCpp98 1
+ #define CLY_DONT_DEFINE_MIN_MAX 1
+ // BC++ 5.6 supports the "open(int fd)" UNIX extension.
+ #define CLY_NewFBFromFD(buf,f) buf=new filebuf(); buf->open(f)
+ #undef CLY_destroy
+ // Note: that 0777 fails to create the file and 0666 creates a hidden file.
+ #define CLY_FBOpenProtDef 0
+ #else
+ // BC++ 5.5 and 5.5.1 (Free command line tools)
+ #define CLY_NewFBFromFD(buf,f) buf=new filebuf(f)
+ #define CLY_FBOpenProtDef 0666
+ #endif
+
+ #define CLY_int_filebuf filebuf
+ #define CLY_filebuf filebuf
+ #define CLY_strstreambuf strstreambuf
+ #define CLY_streambuf streambuf
+ #define CLY_OpenModeT int
+ #define CLY_StreamPosT streampos
+ #define CLY_StreamOffT streamoff
+ #define CLY_IOSSeekDir ios::seek_dir
+ // Documentation to the diference in setbuf and pubsetbuf:
+ // http://groups-beta.google.com/group/powersoft.public.watcom_c_c++.general/browse_frm/thread/8927d7c2b04acd93/1d37ccff2009cf7e?q=watcom+pubsetbuf&rnum=1#1d37ccff2009cf7e
+ #define CLY_PubSetBuf(a,b) setbuf(a,b)
+ #define CLY_FBOpen(a,b,c) open(a,b,c)
+ #define CLY_IOSBin ios::binary
+ #define CLY_IOSOut ios::out
+ #define CLY_IOSIn ios::in
+ #define CLY_IOSApp ios::app
+ #define CLY_IOSAtE ios::ate
+ #define CLY_IOSBeg ios::beg
+ #define CLY_IOSCur ios::cur
+ #define CLY_IOSEnd ios::end
+ #define CLY_IOSBadBit ios::badbit
+ #define CLY_IOSEOFBit ios::eofbit
+ #define CLY_IOSFailBit ios::failbit
+ #define CLY_IOSGoodBit ios::goodbit
+ #define CLY_PubSeekOff seekoff
+ #define CLY_PubSync sync
+ #define CLY_std(a) a
+ #define CreateStrStream(os,buf,size) char buf[size]; \
+ ostrstream os(buf,sizeof(buf))
+ #define GetStrStream(os,buf) buf
+ #ifdef Uses_StrStream
+ #undef Include_strstream
+ #define Include_strstream 1
+ #endif
+ #define UsingNamespaceStd
+#endif /* TVComp_Watcom */
+
+
+
+/* MSVC will be supported if volunteers tests it or Microsoft decides to
+ give it for free ;-). After all Borland released BC++ 5.5. */
+#if (defined(_MSVC) || defined(__MSC_VER)) && !defined(_MSC_VER)
+ #if !defined(__MSC_VER) // let M$ compiler be version 1.00, if nothing else has been defined.
+ #define __MSC_VER 100
+ #endif
+ #define _MSC_VER __MSC_VER
+#endif
+
+/*
+ Note about MSVC and compiler versions:
+ It looks like you must add 6 to get the compiler version. I guess they created MSVC 1.0
+when compiler version 7.0 was released.
+ Compiler version MSVC version
+ 10.00 4.0
+ 11.00 5.0 (just a guess)
+ 12.00 6.0
+ 13.00 7.0
+ 13.10 7.1 (.NET 2003 Architect)
+ 14.00 8.0 (Visual C++ 2005)
+*/
+#ifdef TVComp_MSC
+ // Note: snprintf and vsnprintf seems to be available in some versions but not in others.
+ // But looks like _snprintf and _vsnprintf is available in 1000 and 1300 versions.
+ // So currently I assume the _* versions are available for all versions.
+ //
+ // Note 2: at least MSVC 1200 (6.0) have a wrong implemetation of vsnprintf, it have an
+ // assert checking that the buffer is != NULL and/or size != 0. This is wrong. According
+ // to the IEEE 1003.1 (POSIX 1003.1) standard (Issue 6 2004):
+ // ... "If /n/ is zero, nothing shall be written and /s/ may be a null pointer." ...
+ // And when the result value is explained says:
+ // "Upon successful completion, the /snprintf/() function shall return the number of bytes
+ // that would be written to /s/ had /n/ been sufficiently large excluding the terminating
+ // null byte."
+ //
+ // As I don't know which version fixed this bug I use the replacement that really works.
+ //
+ #undef CLY_Have_snprintf
+ #define CLY_UseCrLf 1
+ #define CLY_HaveDriveLetters 1
+ #define CLY_Packed
+ /*
+ I'm disabling warnings 4311/2 that generates:
+ 'type cast' : pointer truncation from 'void *' to 'uipointer'
+ 'type cast' : conversion from 'uipointer' to 'void *' of greater size
+ This is just the result of using /Wp64 and is just a potential issue.
+ We already define uipointer as a 64 bits value for Win64.
+ */
+ #if _MSC_VER >= 1310
+ #pragma warning( disable : 4311 )
+ #pragma warning( disable : 4312 )
+ #endif
+ /*
+ I'm disabling warning 4996 that generates:
+ warning C4996: '_access' was declared deprecated
+ E:\MVS8\VC\INCLUDE\io.h(193) : see declaration of '_access'
+ Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++
+ conformant name: _access. See online help for details.'
+ This is a nonsense, POSIX is an standard and changing the names of the functions makes
+ the code incompatible with POSIX compliant compilers.
+ I don't think that's a solution to make the compiler ISO C++ compliant. It could be a
+ command line option (i.e. deprecate POSIX functions).
+ */
+ #if _MSC_VER >= 1400
+ #pragma warning( disable : 4996 )
+ #endif
+ /* Avoid warnings for most C standard library */
+ #if _MSC_VER >= 1400 && !defined(_CRT_SECURE_NO_DEPRECATE)
+ #define _CRT_SECURE_NO_DEPRECATE
+ #endif
+ #if _MSC_VER <= 1000
+ // MSVC 4.0 reports version 10.0
+ // Only new.h exists
+ #undef NEW_HEADER
+ #define NEW_HEADER <new.h>
+ #undef Include_ioctl
+ // bool isn't defined
+ #if defined(__cplusplus) && !defined(CLY_BOOL_TRUE_FALSE)
+ #define CLY_BOOL_TRUE_FALSE
+ typedef int bool;
+ const int true=1, false=0;
+ #endif
+ #endif
+ #ifndef CLY_BooleanDefined
+ #define CLY_BooleanDefined 1
+ #if _MSC_VER >= 1500
+ #undef Boolean
+ #undef False
+ #undef True
+ #define Boolean bool
+ #define True true
+ #define False false
+ #else
+ /* Simple Boolean type */
+ enum Boolean { False, True };
+ #endif
+ #endif
+ #ifdef Uses_string
+ #undef Include_string
+ #define Include_string 1
+ #if _MSC_VER >= 1400
+ // ISO C++ version of the POSIX name
+ #undef strncasecmp
+ #define strncasecmp _strnicmp
+ #undef strcasecmp
+ #define strcasecmp _stricmp
+ #undef strdup
+ #define strdup(a) _strdup(a)
+ #else
+ #undef strncasecmp
+ #define strncasecmp strnicmp
+ #undef strcasecmp
+ #define strcasecmp stricmp
+ #endif
+ #endif
+ #ifdef Uses_chdir
+ #undef Include_direct
+ #define Include_direct 1
+ #undef chdir
+ #define chdir _chdir
+ #endif
+ #ifdef Uses_getcwd
+ #undef Include_direct
+ #define Include_direct 1
+ #if _MSC_VER >= 1400
+ #undef getcwd
+ #define getcwd _getcwd
+ #endif
+ #endif
+ #ifdef Uses_stdlib
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_abort
+ #undef Include_process
+ #define Include_process 1
+ #endif
+ #ifdef Uses_limits
+ #undef Include_limits
+ #define Include_limits 1
+ #endif
+ #ifdef Uses_stdio
+ #undef popen
+ #define popen _popen
+ #undef pclose
+ #define pclose _pclose
+ #undef pipe
+ #define pipe _pipe
+ #endif
+ #ifdef Uses_fcntl
+ #undef Include_fcntl
+ #define Include_fcntl 1
+ /* open and creat belongs here */
+ #undef Include_io
+ #define Include_io 1
+ #undef open
+ #define open _open
+ #undef creat
+ #define creat _creat
+ #undef CLY_DefineFileConstants
+ #define CLY_DefineFileConstants 1
+ #endif
+ #ifdef Uses_sys_stat
+ #undef Include_sys_stat
+ #define Include_sys_stat 1
+ #undef Fake_S_IS
+ #define Fake_S_IS 1
+ #undef CLY_DefineIRW
+ #define CLY_DefineIRW 1
+ #endif
+ #ifdef Uses_unistd
+ #undef Include_unistd
+ /* Doesn't exist
+ #define Include_unistd 1 */
+ /* Most unistd equivalents are here: */
+ #undef Include_io
+ #define Include_io 1
+ /* close, dup, dup2, read, write and lseek is defined here */
+ #undef CLY_Define_Inline_IO_Translations
+ #define CLY_Define_Inline_IO_Translations 1
+ /* Standard file descriptors. */
+ #ifndef STDIN_FILENO
+ #define STDIN_FILENO 0 /* Standard input. */
+ #endif
+ #ifndef STDOUT_FILENO
+ #define STDOUT_FILENO 1 /* Standard output. */
+ #endif
+ #ifndef STDERR_FILENO
+ #define STDERR_FILENO 2 /* Standard error output. */
+ #endif
+ #endif
+ #ifdef Uses_access
+ #undef Include_io
+ #define Include_io 1
+ #undef access
+ #define access(a,b) _access(a,b)
+ #undef R_OK
+ #define R_OK 4
+ #undef W_OK
+ #define W_OK 2
+ #undef F_OK
+ #define F_OK 0
+ // No test for execute => just exists
+ #undef X_OK
+ #define X_OK 0
+ #endif
+ #ifdef Uses_ctype
+ #undef Include_ctype
+ #define Include_ctype 1
+ #endif
+ #ifdef Uses_filelength
+ #undef filelength
+ #define filelength _filelength
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_AllocLocal
+ #undef AllocLocalStr
+ #define AllocLocalStr(s,l) char* s = (char*)alloca(l)
+ #undef AllocLocalUShort
+ #define AllocLocalUShort(s,l) ushort *s = (ushort*)alloca(sizeof(ushort) * (l))
+ #undef Uses_alloca
+ #define Uses_alloca 1
+ #endif
+ #ifdef Uses_alloca
+ #undef Include_malloc
+ #define Include_malloc 1
+ #endif
+ #ifdef Uses_free
+ #undef Include_malloc
+ #define Include_malloc 1
+ #endif
+ #ifdef Uses_getcurdir
+ #undef getcurdir
+ #define getcurdir CLY_getcurdir
+ #endif
+ #define NEVER_RETURNS
+ #define RETURN_WHEN_NEVER_RETURNS return 0
+ #undef __attribute__
+ #define __attribute__( value )
+ #undef __inline__
+ #define __inline__ inline
+ #pragma warning( disable : 4250 )
+ /* SET: MSVC have a non-standard delete[] support. It doesn't follow last
+ standard. And which is worst doesn't understand it.
+ Vadim Beloborodov pointed out this missfeature. */
+ #define DeleteArray(a) delete (void *)a
+ /* These values are returned by findfirst. */
+ #undef FA_ARCH
+ #define FA_ARCH 0x00 /* _A_NORMAL */
+ #undef FA_DIREC
+ #define FA_DIREC 0x10 /* _A_SUBDIR */
+ #undef FA_RDONLY
+ #define FA_RDONLY 0x01 /* _A_RDONLY */
+ #define PATHSEPARATOR ';'
+ #define PATHSEPARATOR_ ";"
+ /* SET: Not sure why Vadim wanted it. Perhaps to make the port more usable
+ for users accustomed to back slashes, but then the library isn't uniform
+ across platforms */
+ #define DIRSEPARATOR '\\'
+ #define DIRSEPARATOR_ "\\"
+ #define CLY_IsValidDirSep(a) (a=='/' || a=='\\')
+ #ifdef Uses_fixpath
+ CLY_CFunc void _fixpath(const char *in, char *out);
+ #endif
+ /* Checks for UNCs under Win9x and NT provided by Anantoli Soltan */
+ CLY_CFunc int CLY_IsUNC(const char* path);
+ CLY_CFunc int CLY_IsUNCShare(const char* path);
+ #ifdef Uses_HaveLFNs
+ #undef OS_HaveLFNs
+ #define OS_HaveLFNs 1
+ #endif
+ #ifdef Uses_glob
+ #undef Include_cl_glob
+ #define Include_cl_glob 1
+ #endif
+ #ifdef Uses_fnmatch
+ #undef Include_cl_fnmatch
+ #define Include_cl_fnmatch 1
+ #endif
+ #ifdef Uses_regex
+ #undef Include_cl_regex
+ #define Include_cl_regex 1
+ #endif
+ #ifdef Uses_getopt
+ #undef Include_cl_getopt
+ #define Include_cl_getopt 1
+ #endif
+ #ifdef Uses_io
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_dirent
+ #undef Include_cl_dirent
+ #define Include_cl_dirent 1
+ #endif
+ #ifdef Uses_ftell
+ #undef Include_stdio
+ #define Include_stdio 1
+ #endif
+ #ifdef Uses_utime
+ #undef Include_sys_utime
+ #define Include_sys_utime 1
+ /*#undef utime
+ #define utime _utime
+ #undef utimbuf
+ #define utimbuf _utimbuf*/
+ #endif
+ #ifdef Uses_mkstemp
+ CLY_CFunc int mkstemp(char *_template);
+ #endif
+ #ifdef Uses_getcwd
+ #undef Include_io
+ #define Include_io 1
+ #endif
+ #ifdef Uses_itoa
+ #undef Include_stdlib
+ #define Include_stdlib 1
+ #endif
+ #ifdef Uses_direct
+ #undef Include_direct
+ #define Include_direct 1
+ #endif
+ #ifdef Uses_dir
+ #undef Include_cl_dir
+ #define Include_cl_dir 1
+ #endif
+ #ifdef Uses_strstream
+ #undef Include_strstrea
+ #define Include_strstrea 1
+ #endif
+ #ifdef Uses_nl_langinfo
+ #undef Uses_CLY_nl_langinfo
+ #define Uses_CLY_nl_langinfo 1
+ #endif
+ #undef Uses_CLY_ssize_t
+ #define Uses_CLY_ssize_t 1
+ #ifdef Uses_getline
+ #undef Uses_CLY_getline
+ #define Uses_CLY_getline 1
+ #endif
+
+ /* ifstream::getline behaves strangely in BC++
+ I take the gcc implementation. I hope MSVC is like it. */
+ #define IfStreamGetLine(istream,buffer,size) \
+ istream.getline(buffer,size)
+
+ #undef CLY_DummyTStreamRW
+ #define CLY_DummyTStreamRW(cla) void write(opstream &os) { cla::write(os); }; \
+ void *read(ipstream &is) { return cla::read(is); };
+ // From Mike:
+ // v1300 is MSVC 7.00, not fully ISO C++ 1998
+ // v1310 is MSVC 7.10 (aka .NET 2003 Architect), ISO C++ 1998 compliant
+ #if _MSC_VER > 1300
+ // Taked from gcc 3.1 definitions
+ #define CLY_filebuf std::filebuf
+ #define CLY_strstreambuf std::strstreambuf
+ #define CLY_int_filebuf CLY_filebuf
+ #define CLY_NewFBFromFD(buf,f) buf=new CLY_int_filebuf(fdopen(f,"rb+"))
+ #define CLY_streambuf std::streambuf
+ #define CLY_ISOCpp98 1
+ #define CLY_OpenModeT std::ios::openmode
+ #define CLY_StreamPosT std::streampos
+ #define CLY_StreamOffT std::streamoff
+ #define CLY_IOSSeekDir std::ios::seekdir
+ #define CLY_FBOpenProtDef 0
+ #define CLY_PubSetBuf(a,b) pubsetbuf(a,b)
+ #define CLY_FBOpen(a,b,c) open(a,b)
+ #define CLY_IOSBin std::ios::binary
+ #define CLY_IOSOut std::ios::out
+ #define CLY_IOSIn std::ios::in
+ #define CLY_IOSApp std::ios::app
+ #define CLY_IOSAtE std::ios::ate
+ #define CLY_IOSBeg std::ios::beg
+ #define CLY_IOSCur std::ios::cur
+ #define CLY_IOSEnd std::ios::end
+ #define CLY_IOSBadBit std::ios::badbit
+ #define CLY_IOSEOFBit std::ios::eofbit
+ #define CLY_IOSFailBit std::ios::failbit
+ #define CLY_IOSGoodBit std::ios::goodbit
+ #define CLY_PubSeekOff pubseekoff
+ #define CLY_PubSync pubsync
+ #define CLY_std(a) std::a
+ #define UsingNamespaceStd using namespace std;
+ #define CreateStrStream(os,buf,size) std::string buf; std::ostringstream os(buf)
+ #define GetStrStream(os,buf) os.str().c_str()
+ #ifdef Uses_StrStream
+ #undef Include_sstream
+ #define Include_sstream 1
+ #endif
+ // I'm not sure about the version, but .NET 2003 seems to only have the headers without .h
+ #undef FSTREAM_HEADER
+ #define FSTREAM_HEADER <fstream>
+ #undef IOMANIP_HEADER
+ #define IOMANIP_HEADER <iomanip>
+ #undef IOSTREAM_HEADER
+ #define IOSTREAM_HEADER <iostream>
+ #undef STRSTREAM_HEADER
+ #define STRSTREAM_HEADER <strstream>
+ #if defined(Include_ioctl)
+ #undef Include_ioctl
+ #endif // Include_ioctl
+ #else
+ #define CLY_filebuf filebuf
+ #define CLY_int_filebuf filebuf
+ #define CLY_strstreambuf strstreambuf
+ #define CLY_streambuf streambuf
+ #define CLY_OpenModeT int
+ #define CLY_StreamPosT streampos
+ #define CLY_StreamOffT streamoff
+ #define CLY_IOSSeekDir ios::seek_dir
+ #define CLY_FBOpenProtDef filebuf::openprot
+ #define CLY_NewFBFromFD(buf,f) buf=new filebuf(f)
+ #define CLY_PubSetBuf(a,b) setbuf(a,b)
+ #define CLY_HaveFBAttach 1
+ #define CLY_FBOpen(a,b,c) open(a,b,c)
+ #define CLY_IOSBin ios::binary
+ #define CLY_IOSOut ios::out
+ #define CLY_IOSIn ios::in
+ #define CLY_IOSApp ios::app
+ #define CLY_IOSAtE ios::ate
+ #define CLY_IOSBeg ios::beg
+ #define CLY_IOSCur ios::cur
+ #define CLY_IOSEnd ios::end
+ #define CLY_IOSBadBit ios::badbit
+ #define CLY_IOSEOFBit ios::eofbit
+ #define CLY_IOSFailBit ios::failbit
+ #define CLY_IOSGoodBit ios::goodbit
+ #define CLY_PubSeekOff seekoff
+ #define CLY_PubSync sync
+ #define CLY_std(a) a
+ #define UsingNamespaceStd
+ #define CreateStrStream(os,buf,size) char buf[size]; \
+ ostrstream os(buf,sizeof(buf))
+ #define GetStrStream(os,buf) buf
+ #ifdef Uses_StrStream
+ #undef Include_strstrea
+ #define Include_strstrea 1
+ #endif
+ #endif
+#endif
+
+#ifdef Uses_IOS_BIN
+ #undef IOS_BIN
+ #define IOS_BIN CLY_IOSBin
+#endif
+
+#ifdef Uses_snprintf
+ #ifdef CLY_Have_snprintf
+ #undef Include_stdio
+ #define Include_stdio 1
+ #ifdef TVComp_MSC
+ // Note: Currently unused because the implementation is wrong. See notes in
+ // the MSVC section.
+ #define CLY_snprintf _snprintf
+ #define CLY_vsnprintf _vsnprintf
+ #else
+ #define CLY_snprintf snprintf
+ #define CLY_vsnprintf vsnprintf
+ #endif
+ #else
+ #undef Include_stdarg
+ #define Include_stdarg 1
+ #endif
+#endif
+
+// Simple Streams Compatibility hack *EXPERIMENTAL*
+#ifdef HAVE_SSC
+ #undef CLY_filebuf
+ #undef CLY_strstreambuf
+ #undef CLY_int_filebuf
+ #undef CLY_streambuf
+ #undef CLY_OpenModeT
+ #undef CLY_StreamPosT
+ #undef CLY_StreamOffT
+ #undef CLY_IOSSeekDir
+ #undef CLY_FBOpenProtDef
+ #undef CLY_NewFBFromFD
+ #undef CLY_PubSetBuf
+ #undef CLY_HaveFBAttach
+ #undef CLY_FBOpen
+ #undef CLY_IOSBin
+ #undef CLY_IOSOut
+ #undef CLY_IOSIn
+ #undef CLY_IOSApp
+ #undef CLY_IOSAtE
+ #undef CLY_IOSBeg
+ #undef CLY_IOSCur
+ #undef CLY_IOSEnd
+ #undef CLY_IOSBadBit
+ #undef CLY_IOSEOFBit
+ #undef CLY_IOSFailBit
+ #undef CLY_IOSGoodBit
+ #undef CLY_PubSeekOff
+ #undef CLY_PubSync
+ #undef CLY_DefineSpecialFileBuf
+ #undef CLY_ISOCpp98
+
+ #define CLY_filebuf SSC_filebuf
+ #define CLY_int_filebuf SSC_filebuf
+ #define CLY_strstreambuf SSC_strstreambuf
+ #define CLY_streambuf SSC_streambuf
+ #define CLY_OpenModeT SSC_ios::openmode
+ #define CLY_StreamPosT SSC_ios::seekoff
+ #define CLY_StreamOffT SSC_ios::seekoff
+ #define CLY_IOSSeekDir SSC_ios::seekdir
+ #define CLY_FBOpenProtDef 0666
+ #define CLY_NewFBFromFD(buf,f) buf=new SSC_filebuf(f,SSC_ios::in|SSC_ios::out|SSC_ios::binary)
+ #define CLY_PubSetBuf(a,b) setbuf(a,b)
+ #define CLY_HaveFBAttach 1
+ #define CLY_FBOpen(a,b,c) open(a,b,c)
+ #define CLY_IOSBin SSC_ios::binary
+ #define CLY_IOSOut SSC_ios::out
+ #define CLY_IOSIn SSC_ios::in
+ #define CLY_IOSApp SSC_ios::app
+ #define CLY_IOSAtE SSC_ios::ate
+ #define CLY_IOSBeg SSC_ios::beg
+ #define CLY_IOSCur SSC_ios::cur
+ #define CLY_IOSEnd SSC_ios::end
+ #define CLY_IOSBadBit SSC_ios::badbit
+ #define CLY_IOSEOFBit SSC_ios::eofbit
+ #define CLY_IOSFailBit SSC_ios::failbit
+ #define CLY_IOSGoodBit SSC_ios::goodbit
+ #define CLY_PubSeekOff seekoff
+ #define CLY_PubSync sync
+#endif
+
+CLY_CFunc void CLY_YieldProcessor(int micros);
+CLY_CFunc void CLY_ReleaseCPU();
+/* Return the number of ticks (on MSDOS 1 tick is 1/18 sec),
+ this is used to compute the double click */
+CLY_CFunc unsigned short CLY_Ticks(void);
+/* An utility to split directory and file components of a path:
+ Extracts from path the directory part and filename part.
+ if 'dir' and/or 'file' == NULL, it is not filled.
+ The directory will have a trailing slash. */
+CLY_CFunc void CLY_ExpandPath(const char *path, char *dir, char *file);
+/* An utility function. It makes the path an absolute one and replaces the
+ original value passed. Should use fixpath. */
+CLY_CFunc void CLY_fexpand(char *rpath);
+#undef fexpand
+#define fexpand(a) CLY_fexpand(a)
+/* Utility function to know if a drive letter is valid. */
+CLY_CFunc int CLY_DriveValid(char drive);
+#ifdef __cplusplus
+ #define driveValid(a) (CLY_DriveValid(a) ? True : False)
+#endif
+/* Utility function to know is a file is in fact a directory */
+CLY_CFunc int CLY_IsDir(const char *str);
+#ifdef __cplusplus
+ #define isDir(a) (CLY_DriveValid(a) ? True : False)
+#endif
+/* Utility function to know if a path is valid (existing directory or file) */
+CLY_CFunc int CLY_PathValid(const char *path);
+#ifdef __cplusplus
+ #define pathValid(a) (CLY_PathValid(a) ? True : False)
+#endif
+/* Utility function to know if a file name is valid to create a new file */
+CLY_CFunc int CLY_ValidFileName(const char *fileName);
+#ifdef __cplusplus
+ #define validFileName(a) (CLY_ValidFileName(a) ? True : False)
+#endif
+/* Utility function to know the current directory including a trailing
+ slash */
+CLY_CFunc void CLY_GetCurDirSlash(char *dir);
+#undef getCurDir
+#define getCurDir(a) CLY_GetCurDirSlash(a)
+/* Utility function to know if a path contains a supported wildcard */
+CLY_CFunc int CLY_IsWild(const char *f);
+#ifdef __cplusplus
+ #define isWild(a) (CLY_IsWild(a) ? True : False)
+#endif
+/* Utility function to know if a file exist and we can read from it */
+CLY_CFunc int CLY_FileExists(const char *fname);
+#ifndef TVCompf_djgpp
+ #undef __file_exists
+ #define __file_exists(a) CLY_FileExists(a)
+#endif
+/* Utility function to know if a path is relative */
+CLY_CFunc int CLY_IsRelativePath(const char *path);
+#ifdef __cplusplus
+ #define relativePath(a) (CLY_IsRelativePath(a) ? True : False)
+#endif
+/* Utility function to generated a beep */
+#define CLY_Beep() TScreen::beep()
+/* Used internally, just call filelength prior request */
+CLY_CFunc long CLY_filelength(int);
+/* Used internally, just call getcurdir prior request */
+CLY_CFunc int CLY_getcurdir(int drive, char *buffer);
+
+/* cl/unistd.h includes dir.h */
+#ifdef Include_cl_unistd
+ #undef Include_dir
+ #define Include_dir 1
+#endif
+
+#ifdef Uses_ifsFileLength
+ #undef Uses_fstream
+ #define Uses_fstream 1
+#endif
+
+#ifdef Uses_CLY_getline
+ /* Prototypes uses ssize_t and size_t */
+ #undef Include_sys_types
+ #define Include_sys_types 1
+#endif
+
+#ifdef Uses_sys_types
+ #undef Include_sys_types
+ #define Include_sys_types 1
+#endif
+
+#if defined(Include_sys_types) && !defined(Included_sys_types)
+ #define Included_sys_types 1
+ #include <sys/types.h>
+ /* Platforms where sys/types.h doesn't define ssize_t: */
+ #if defined(Uses_CLY_ssize_t) && !defined(CLY_ssize_t)
+ #define CLY_ssize_t 1
+ typedef long ssize_t;
+ #endif
+#endif
+
+#if defined(Include_string) && !defined(Included_string)
+ #define Included_string 1
+ #include <string.h>
+ #if defined(TVOSf_QNXRtP)
+ #include <strings.h> // QNX RtP requires this include for functions strcasecmp, etc.
+ #endif // TVOSf_QNXRtP
+ #ifndef CLY_memcpy
+ #if CLY_SAFE_MEMCPY
+ #define CLY_memcpy(a,b,c) memcpy(a,b,c)
+ #else
+ #define CLY_memcpy(a,b,c) memmove(a,b,c)
+ #endif
+ #endif
+#endif
+
+#if defined(Include_stdio) && !defined(Included_stdio)
+ // Looks like Watcom needs it before other headers.
+ // Is this a temporal hack? should be clarified
+ #define Included_stdio 1
+ #include <stdio.h>
+#endif
+
+#if defined(Include_limits) && !defined(Included_limits)
+ #define Included_limits 1
+ #include <limits.h>
+ #ifndef PATH_MAX /* BC++ and MSVC */
+ #define PATH_MAX 512
+ #endif
+#endif
+
+#if defined(Include_fcntl) && !defined(Included_fcntl)
+ #define Included_fcntl 1
+ #include <fcntl.h>
+ #ifndef O_TEXT /* UNIX */
+ #define O_TEXT (0)
+ #endif
+ #ifndef O_BINARY /* UNIX */
+ #define O_BINARY (0)
+ #endif
+ #ifdef CLY_DefineFileConstants
+ #if !defined(O_RDONLY) && defined(_O_RDONLY)
+ #define O_RDONLY _O_RDONLY
+ #endif
+ #if !defined(O_WRONLY) && defined(_O_WRONLY)
+ #define O_WRONLY _O_WRONLY
+ #endif
+ #if !defined(O_RDWR) && defined(_O_RDWR)
+ #define O_RDWR _O_RDWR
+ #endif
+ #if !defined(O_APPEND) && defined(_O_APPEND)
+ #define O_APPEND _O_APPEND
+ #endif
+ #if !defined(O_CREAT) && defined(_O_CREAT)
+ #define O_CREAT _O_CREAT
+ #endif
+ #if !defined(O_EXCL) && defined(_O_EXCL)
+ #define O_EXCL _O_EXCL
+ #endif
+ #if !defined(O_TRUNC) && defined(_O_TRUNC)
+ #define O_TRUNC _O_TRUNC
+ #endif
+ #endif
+#endif
+
+#if defined(Include_sys_stat) && !defined(Included_sys_stat)
+ #define Included_sys_stat 1
+ #include <sys/stat.h>
+ #ifdef Fake_S_IS
+ #undef S_ISDIR
+ #define S_ISDIR(m) ((m) & S_IFDIR)
+ #undef S_ISCHR
+ #define S_ISCHR(m) ((m) & S_IFCHR)
+ #undef S_ISBLK
+ #define S_ISBLK(m) ((m) & S_IFBLK)
+ #undef S_ISREG
+ #define S_ISREG(m) ((m) & S_IFREG)
+ #undef S_ISFIFO
+ #define S_ISFIFO(m) ((m) & S_IFIFO)
+ #endif
+ #ifdef CLY_DefineIRW
+ #ifndef S_IREAD
+ #define S_IREAD _S_IREAD
+ #endif
+ #ifndef S_IWRITE
+ #define S_IWRITE _S_IWRITE
+ #endif
+ #endif
+#endif
+
+#if defined(Include_ioctl) && !defined(Included_ioctl)
+ #define Included_ioctl 1
+ #include IOCTL_HEADER
+#endif
+
+#if defined(Include_stdlib) && !defined(Included_stdlib)
+ #define Included_stdlib 1
+ #include <stdlib.h>
+#endif
+
+#if defined(Include_alloca) && !defined(Included_alloca)
+ /* OSF1 (Tru64), some combinations of Solaris and gcc too. */
+ #define Included_alloca 1
+ #include <alloca.h>
+#endif
+
+#if defined(Include_malloc) && !defined(Included_malloc)
+ /* BC++ and MSVC defines alloca here */
+ #define Included_malloc 1
+ #include <malloc.h>
+#endif
+
+#if defined(Include_io) && !defined(Included_io)
+ #define Included_io 1
+ #undef _CRT_INSECURE_OPEN // Visual Studio .NET 2005 Express Beta Edition
+ #include <io.h>
+ #ifdef CLY_Define_Inline_IO_Translations
+ /* Needed for MSVC */
+ /* Note we must avoid macros here or we risk to collide with TV read/write
+ C++ members. */
+ #ifndef CLY_close_inline_defined
+ #define CLY_close_inline_defined 1
+ __inline int close(int FILEDES)
+ { return _close(FILEDES); }
+ #endif
+ #ifndef CLY_dup_inline_defined
+ #define CLY_dup_inline_defined 1
+ __inline int dup(int OLD)
+ { return _dup(OLD); }
+ #endif
+ #ifndef CLY_dup2_inline_defined
+ #define CLY_dup2_inline_defined 1
+ __inline int dup2(int OLD, int NEW)
+ { return _dup2(OLD,NEW); }
+ #endif
+ #if (_MSC_VER<1310) && !defined(CLY_read_inline_defined)
+ #define CLY_read_inline_defined 1
+ __inline long read(int FILEDES, void *BUFFER, unsigned long SIZE)
+ { return _read(FILEDES,BUFFER,SIZE); }
+ #endif
+ #if (_MSC_VER<1310) && !defined(CLY_write_inline_defined)
+ #define CLY_write_inline_defined 1
+ __inline long write(int FILEDES, void *BUFFER, unsigned long SIZE)
+ { return _write(FILEDES,BUFFER,SIZE); }
+ #endif
+ #ifndef CLY_lseek_inline_defined
+ #define CLY_lseek_inline_defined 1
+ __inline long lseek(int FILEDES, long OFFSET, int WHENCE)
+ { return _lseek(FILEDES,OFFSET,WHENCE); }
+ #endif
+ #endif
+#endif
+
+#if defined(Include_direct) && !defined(Included_direct)
+ #define Included_direct 1
+ #include <direct.h>
+#endif
+
+#if defined(Include_dir) && !defined(Included_dir)
+ #define Included_dir 1
+ #include <dir.h>
+#endif
+
+#if defined(Include_cl_dir) && !defined(Included_cl_dir)
+ #define Included_cl_dir 1
+ #include <cl/dir.h>
+#endif
+
+#if defined(Include_langinfo) && !defined(Included_langinfo)
+ #define Included_langinfo 1
+ #include <langinfo.h>
+ /* Workaround a bug in glibc */
+ #if !defined(RADIXCHAR) && defined(DECIMAL_POINT)
+ #define RADIXCHAR DECIMAL_POINT
+ #endif
+#endif
+
+
+#if defined(Include_ctype) && !defined(Included_ctype)
+ #define Included_ctype 1
+ #include <ctype.h>
+ /* The following macros are defined to avoid passing negative values to
+ the ctype functions in the common case: isxxxx(char).
+ They are suitable for x86 DOS and Linux, perhaps not for others */
+ #define ucisalnum(a) isalnum((unsigned char)a)
+ #define ucisalpha(a) isalpha((unsigned char)a)
+ #define ucisascii(a) isascii((unsigned char)a)
+ #define uciscntrl(a) iscntrl((unsigned char)a)
+ #define ucisdigit(a) isdigit((unsigned char)a)
+ #define ucisgraph(a) isgraph((unsigned char)a)
+ #define ucislower(a) islower((unsigned char)a)
+ #define ucisprint(a) isprint((unsigned char)a)
+ #define ucispunct(a) ispunct((unsigned char)a)
+ #define ucisspace(a) isspace((unsigned char)a)
+ #define ucisupper(a) isupper((unsigned char)a)
+ #define ucisxdigit(a) isxdigit((unsigned char)a)
+ #define uctoascii(a) toascii((unsigned char)a)
+ #define uctolower(a) tolower((unsigned char)a)
+ #define uctoupper(a) toupper((unsigned char)a)
+#endif
+
+#if defined(Include_unistd) && !defined(Included_unistd)
+ #define Included_unistd 1
+ #include <unistd.h>
+ // It just fills in the gaps
+ #include <cl/unistd.h>
+#endif
+
+#if defined(Include_process) && !defined(Included_process)
+ #define Included_process 1
+ #include <process.h>
+#endif
+
+#if defined(Include_cl_unistd) && !defined(Included_cl_unistd)
+ #define Included_cl_unistd 1
+ #include <cl/unistd.h>
+#endif
+
+#if defined(Include_glob) && !defined(Included_glob)
+ #define Included_glob 1
+ /* POSIX */
+ #include <glob.h>
+#endif
+
+#if defined(Include_cl_glob) && !defined(Included_cl_glob)
+ #define Included_cl_glob 1
+ /* Replacement */
+ #include <cl/glob.h>
+#endif
+
+#if defined(Include_fnmatch) && !defined(Included_fnmatch)
+ #define Included_fnmatch 1
+ /* POSIX */
+ #include <fnmatch.h>
+#endif
+
+#if defined(Include_cl_fnmatch) && !defined(Included_cl_fnmatch)
+ #define Included_cl_fnmatch 1
+ /* Replacement */
+ #include <cl/fnmatch.h>
+#endif
+
+#if defined(Include_regex) && !defined(Included_regex)
+ #define Included_regex 1
+ /* POSIX */
+ #include <regex.h>
+#endif
+
+#if defined(Include_cl_regex) && !defined(Included_cl_regex)
+ #define Included_cl_regex 1
+ /* Replacement */
+ #include <cl/regex.h>
+#endif
+
+#if defined(Include_getopt) && !defined(Included_getopt)
+ #define Included_getopt 1
+ #include <getopt.h>
+ // Define our aliases
+ #define CLY_optarg optarg
+ #define CLY_optind optind
+ #define CLY_opterr opterr
+ #define CLY_optopt optopt
+ #define CLY_option option
+ #define CLY_no_argument no_argument
+ #define CLY_required_argument required_argument
+ #define CLY_optional_argument optional_argument
+ #define CLY_getopt getopt
+ #define CLY_getopt_long getopt_long
+ #define CLY_getopt_long_only getopt_long_only
+#endif
+
+#if defined(Include_cl_getopt) && !defined(Included_cl_getopt)
+ #define Included_cl_getopt 1
+ // This header defines all as CLY_* to avoid conflicts
+ #include <cl/getopt.h>
+#endif
+
+#if defined(Include_dirent) && !defined(Included_dirent)
+ #define Included_dirent 1
+ #include <dirent.h>
+#endif
+
+#if defined(Include_cl_dirent) && !defined(Included_cl_dirent)
+ #define Included_cl_dirent 1
+ #include <cl/dirent.h>
+#endif
+
+#if defined(Include_time) && !defined(Included_time)
+ #define Included_time 1
+ #include <time.h>
+#endif
+
+#if defined(Include_utime) && !defined(Included_utime)
+ #define Included_utime 1
+ #include <utime.h>
+#endif
+
+#if defined(Include_stdarg) && !defined(Included_stdarg)
+ #define Included_stdarg 1
+ #include <stdarg.h>
+#endif
+
+#if defined(Include_signal) && !defined(Included_signal)
+ #define Include_signal 1
+ #include <signal.h>
+#endif
+
+#if defined(Include_sys_utime) && !defined(Included_sys_utime)
+ #define Included_sys_utime 1
+ #include <sys/utime.h>
+#endif
+
+#if defined(Include_cl_utime) && !defined(Included_cl_utime)
+ #define Included_cl_utime 1
+ #include <cl/utime.h>
+#endif
+
+#if defined(Uses_allegro) && defined(HAVE_ALLEGRO)
+ // Currently a trivial condition
+ #undef Include_allegro
+ #define Include_allegro 1
+#endif
+
+#if defined(Include_allegro)
+ #if !defined(Included_allegro)
+ #define Included_allegro 1
+ #include <allegro.h>
+ #endif
+#else
+ #undef END_OF_MAIN
+ #define END_OF_MAIN()
+#endif
+
+#if defined(Include_strstream) && !defined(Included_strstream)
+ #define Included_strstream 1
+ #include STRSTREAM_HEADER
+#endif
+
+#if defined(Include_strstrea) && !defined(Included_strstrea)
+ #define Included_strstrea 1
+ #include <strstrea.h>
+#endif
+
+#if defined(Include_sstream) && !defined(Included_sstream)
+ #define Included_sstream 1
+ #include <sstream>
+#endif
+
+#if defined(Uses_fstream) && !defined(Included_fstream)
+ #define Included_fstream 1
+ #include FSTREAM_HEADER
+#endif
+
+#if defined(Uses_iomanip) && !defined(Included_iomanip)
+ #define Included_iomanip 1
+ #include IOMANIP_HEADER
+#endif
+
+#if defined(Uses_iostream) && !defined(Included_iostream)
+ #define Included_iostream 1
+ #include IOSTREAM_HEADER
+#endif
+
+#if defined(Uses_SSC_Streams) && !defined(Included_SSC_Streams)
+ #include <tv/ssc_streams.h>
+#endif
+
+#if defined(Uses_CLYFileAttrs) && !defined(Uses_CLYFileAttrsDef)
+#define Uses_CLYFileAttrsDef
+/* Equivalent to mode_t */
+#ifdef CLY_Have_UGID
+/* In systems with User and Group ID the mode is an structure */
+typedef struct
+{
+ mode_t mode,writemask;
+ uid_t user;
+ gid_t group;
+} CLY_mode_t;
+#else
+typedef unsigned int CLY_mode_t;
+#endif
+/* Utility function to find the attributes of a file. You must call stat
+ first and pass the st_mode member of stat's struct in statVal. */
+CLY_EXPORT CLY_CFunc void CLY_GetFileAttributes(CLY_mode_t *mode, struct stat *statVal, const char *fileName);
+/* The reverse. The file must be closed! */
+CLY_EXPORT CLY_CFunc int CLY_SetFileAttributes(CLY_mode_t *newmode, const char *fileName);
+/* This function alters mode content so the attribute indicates that the
+ owner of the file can't read from it */
+CLY_EXPORT CLY_CFunc void CLY_FileAttrReadOnly(CLY_mode_t *mode);
+/* This function alters mode content so the attribute indicates that the
+ owner of the file can read from it */
+CLY_EXPORT CLY_CFunc void CLY_FileAttrReadWrite(CLY_mode_t *mode);
+/* Returns !=0 if the file is read-only */
+CLY_EXPORT CLY_CFunc int CLY_FileAttrIsRO(CLY_mode_t *mode);
+/* Sets the attribute that indicates the file was modified */
+CLY_EXPORT CLY_CFunc void CLY_FileAttrModified(CLY_mode_t *mode);
+/* It returns a mode that can be used for a newly created file */
+CLY_EXPORT CLY_CFunc void CLY_GetDefaultFileAttr(CLY_mode_t *mode);
+#endif
+
+/* Returns the name of the shell command */
+CLY_CFunc CLY_EXPORT char *CLY_GetShellName(void);
+
+/* v/snprintf functions */
+#if defined(Uses_snprintf) && !defined(CLY_Have_snprintf)
+CLY_EXPORT CLY_CFunc int CLY_vsnprintf(char *string, size_t length, const char * format, va_list args);
+CLY_EXPORT CLY_CFunc int CLY_snprintf(char *string, size_t length, const char * format, ...);
+#endif
+
+#ifdef Uses_ifsFileLength
+CLY_EXPORT long CLY_ifsFileLength(CLY_std(ifstream) &f);
+#endif
+
+#ifdef Uses_CLY_IfStreamGetLine
+CLY_EXPORT int CLY_IfStreamGetLine(CLY_std(ifstream) &is, char *buffer, unsigned len);
+#endif
+
+/* Internal definition of nl_langinfo */
+#if defined(Uses_CLY_nl_langinfo) && !defined(CLY_nl_langinfo_Defined)
+#define CLY_nl_langinfo_Defined 1
+typedef int nl_item;
+#define CURRENCY_SYMBOL 0 /*currency_symbol*/
+#define CRNCYSTR 0 /*currency_symbol*/ /*deprecated*/
+#define DECIMAL_POINT 1 /*decimal_point*/
+#define RADIXCHAR 1 /*decimal_point*/ /*deprecated*/
+#define GROUPING 2 /*grouping*/
+#define INT_CURR_SYMBOL 3 /*int_curr_symbol*/
+#define MON_DECIMAL_POINT 4 /*mon_decimal_point*/
+#define MON_GROUPING 5 /*mon_grouping*/
+#define NEGATIVE_SIGN 6 /*negative_sign*/
+#define POSITIVE_SIGN 7 /*positive_sign*/
+#define THOUSANDS_SEP 8 /*thousands_sep*/
+#define THOUSEP 8 /*thousands_sep*/ /*deprecated*/
+/*char*/
+#define FRAC_DIGITS 9 /*frac_digits*/
+#define INT_FRAC_DIGITS 10 /*int_frac_digits*/
+#define N_CS_PRECEDES 11 /*n_cs_precedes*/
+#define N_SEP_BY_SPACE 12 /*n_sep_by_space*/
+#define P_SIGN_POSN 13 /*p_sign_posn*/
+#define N_SIGN_POSN 14 /*n_sign_posn*/
+#define P_CS_PRECEDES 15 /*p_cs_precedes*/
+#define P_SEP_BY_SPACE 16 /*p_sep_by_space*/
+
+#define nl_langinfo CLY_nl_langinfo
+CLY_CFunc CLY_EXPORT char *CLY_nl_langinfo(nl_item item);
+#endif /* defined(Uses_CLY_nl_langinfo) && !defined(CLY_nl_langinfo_Defined) */
+
+#ifdef Uses_CLY_getline
+CLY_CFunc CLY_EXPORT ssize_t CLY_getstr(char **lineptr, size_t *n, FILE *stream,
+ char terminator, int offset, int limit);
+CLY_CFunc CLY_EXPORT ssize_t CLY_getline(char **lineptr, size_t *n, FILE *stream);
+CLY_CFunc CLY_EXPORT ssize_t CLY_getline_safe(char **lineptr, size_t *n,
+ FILE *stream, int limit);
+#endif
+
+#undef CLY_High16
+#undef CLY_Low16
+#ifdef TV_BIG_ENDIAN
+ /* Most RISC machines */
+ #define CLY_High16(a) ((a) & 0xFF)
+ #define CLY_Low16(a) ((a) >> 8)
+#else
+ /* Intel machines */
+ #define CLY_High16(a) ((a) >> 8)
+ #define CLY_Low16(a) ((a) & 0xFF)
+#endif
+
+#if defined(DJGPP_HaveLFNs) && !defined(CLY_HaveLFNs_Defined)
+#define CLY_HaveLFNs_Defined 1
+inline
+int CLY_HaveLFNs()
+{
+ return _use_lfn(0);
+}
+#endif
+
+#if defined(OS_HaveLFNs) && !defined(OS_HaveLFNs_Defined)
+#define OS_HaveLFNs_Defined 1
+inline
+int CLY_HaveLFNs()
+{
+ return 1;
+}
+#endif
+
+/* Is that an EOL char? */
+/* Ask for no */
+#undef CLY_IsntEOL
+#define CLY_IsntEOL(a) (a!='\r' && a!='\n')
+/* Ask for yes */
+#undef CLY_IsEOL
+#define CLY_IsEOL(a) (a=='\r' || a=='\n')
+
+#undef CLY_LenEOL
+#undef CLY_crlf
+
+/* MSS memory leak debugger */
+#ifdef MSS
+ #include <mss.h>
+#endif
+
+#undef CLY_IsTrueEOL
+#ifdef CLY_UseCrLf
+ #define CLY_LenEOL 2
+ /* This asks if the EOL is really usable for the OS */
+ #define CLY_IsTrueEOL(a) (a=='\r' || a=='\n')
+ /* String containing EOL */
+ #define CLY_crlf "\r\n"
+#else
+ #define CLY_LenEOL 1
+ #define CLY_crlf "\n"
+ #define CLY_IsTrueEOL(a) (a=='\n')
+#endif
+
+#undef CLY_CFunc
+
+/*#endif // CLY_CompatLayerIncluded */
+
diff --git a/tvision/include/tv.h b/tvision/include/tv.h
new file mode 100644
index 0000000..47485b6
--- /dev/null
+++ b/tvision/include/tv.h
@@ -0,0 +1,822 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea
+
+ *
+ *
+ */
+
+// SET: We still need to add a lot of TV 2.0 functionality
+#define _TV_VERSION 0x0103
+
+// SET: Internal release number. Used to check the version of the release
+// in programs that are very sensitive, like my editor.
+#define TV_MAJOR_VERSION 2
+#define TV_MIDDLE_VERSION 2
+#define TV_MINOR_VERSION 0
+#define TV_VERSION "2.2.0"
+
+#define Uses_EventCodes
+#define Uses_ViewCommands
+#define Uses_ipstream
+#define Uses_opstream
+#define INCLUDE_STDDLG_H
+
+// SET: Start of the TEditor classes re-incorporated in 1.0.4
+#ifdef Uses_TEditWindow
+#define Uses_TWindow
+#define Uses_TFileEditor
+#endif
+
+#ifdef Uses_TFileEditor
+#define Uses_TEditor
+#define Uses_limits
+#endif
+
+#ifdef Uses_TMemo
+#define Uses_TEditor
+#endif
+
+#ifdef Uses_TEditor
+#define Uses_TView
+#define Uses_TPalette
+#define Uses_TCommandSet
+#define INCL_EDITORS_H
+#endif
+
+#ifdef Uses_TVConfigFile
+#define INCL_CONFIGFILE_H
+#define Uses_stdio
+#endif
+
+#ifdef Uses_TVOSClipboard
+#define INCL_OSCLIPBOARD_H
+#endif
+
+#ifdef Uses_TCalculator
+#define Uses_TCalcDisplay
+#define Uses_TDialog
+#endif
+
+#ifdef Uses_TCalcDisplay
+#define Uses_TView
+#define INCL_CALC_H
+#define INCLUDE_STDLIB_H
+#endif
+
+#ifdef Uses_TEditorApp
+#define Uses_TApplication
+#define INCL_TVEDIT_H
+#endif
+// SET: End of the TEditor classes
+
+// SET: Start of the THelp* classes
+#ifdef Uses_THelpViewer
+ #define Uses_THelpWindow
+#endif
+
+#ifdef Uses_THelpWindow
+ #define Uses_THelpFile
+ #define Uses_TWindow
+ #define Uses_TScroller
+ #define Uses_TScrollBar
+ #define Uses_TEvent
+ #define INCLUDE_HELP_H
+#endif
+
+#ifdef Uses_THelpFile
+ #define Uses_TStreamable
+ #define Uses_ipstream
+ #define Uses_opstream
+ #define Uses_fpstream
+ #define Uses_TObject
+ #define Uses_TPoint
+ #define Uses_TRect
+ #define INCLUDE_HELPBASE_H
+#endif
+// SET: End of the THelp* classes
+
+#if defined( Uses_TVFontCollection )
+ #define Uses_TStringCollection
+ #define Uses_TSortedListBox
+ #define Uses_stdio
+ #define INCLUDE_FONTCOLL_H
+#endif
+
+#if defined( Uses_TGKey )
+#define INCLUDE_GKEY_H
+#define Uses_TVCodePage
+#endif
+
+#if defined( Uses_TFileViewer )
+#define Uses_TCollection
+#define Uses_TScroller
+#define Uses_TWindow
+// ssize_t
+#define Uses_sys_types
+#define INCLUDE_FILEVIEW_H
+#endif
+
+#if defined( Uses_TPXPictureValidator )
+#define Uses_TValidator
+#endif
+
+#if defined( Uses_TStringLookupValidator )
+#define Uses_TStringCollection
+#define Uses_TLookupValidator
+#endif
+
+#if defined( Uses_TLookupValidator )
+#define Uses_TValidator
+#endif
+
+#if defined( Uses_TRangeValidator )
+#define Uses_TFilterValidator
+#endif
+
+#if defined( Uses_TFilterValidator )
+#define Uses_TValidator
+#endif
+
+#if defined( Uses_TValidator )
+#define Uses_TObject
+#if !defined( NO_STREAM )
+#define Uses_TStreamable
+#endif
+#define INCLUDE_VALID_H
+#endif
+
+#if defined( Uses_TApplication )
+#define Uses_TProgram
+#define INCLUDE_APP_H
+#endif
+
+#if defined( Uses_TProgram )
+#define Uses_TEvent
+#define Uses_TGroup
+#define Uses_allegro // For END_OF_MAIN
+#define INCLUDE_APP_H
+#define INCLUDE_TIME_H
+#endif
+
+#if defined( Uses_TDeskTop )
+#define Uses_TGroup
+#define INCLUDE_APP_H
+#endif
+
+#if defined( Uses_TBackground )
+#define Uses_TView
+#define INCLUDE_APP_H
+#endif
+
+#if defined( Uses_TReplaceDialogRec )
+#define INCLUDE_FINDREPL_H
+#define Uses_string
+#endif
+
+#if defined( Uses_TFindDialogRec )
+#define INCLUDE_FINDREPL_H
+#define Uses_string
+#endif
+
+#if defined( Uses_TIndicator )
+#define Uses_TView
+#define INCLUDE_INDICATO_H
+#endif
+
+#if defined( Uses_TTerminal )
+#define Uses_TTextDevice
+#define INCLUDE_TEXTVIEW_H
+#endif
+
+#if defined( Uses_TTextDevice )
+#define Uses_TScroller
+#define Uses_iostream
+#define Uses_stdio // EOF
+#define INCLUDE_TEXTVIEW_H
+#endif
+
+#if defined( Uses_TStatusLine )
+#define Uses_TView
+#define INCLUDE_MENUS_H
+#endif
+
+#if defined( Uses_TStatusDef )
+#define INCLUDE_MENUS_H
+#endif
+
+#if defined( Uses_TStatusItem )
+#define INCLUDE_MENUS_H
+#endif
+
+#if defined( Uses_TMenuBox )
+#define Uses_TMenuView
+#define INCLUDE_MENUS_H
+#endif
+
+#if defined( Uses_TMenuBar )
+#define Uses_TMenuView
+#define INCLUDE_MENUS_H
+#endif
+
+#if defined( Uses_TMenuView )
+#define Uses_TView
+#define INCLUDE_MENUS_H
+#endif
+
+#if defined( Uses_TMenu )
+#define Uses_TMenuItem
+#define INCLUDE_MENUS_H
+#endif
+
+#if defined( Uses_TSubMenu )
+#define Uses_TMenuItem
+#define INCLUDE_MENUS_H
+#endif
+
+#if defined( Uses_TMenuItem )
+#define INCLUDE_MENUS_H
+#endif
+
+// SET: Just include the file to get the cm* definitions, it includes a
+// Broadcast for colors changed.
+#ifdef Uses_TColorCommands
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TColorDialog )
+#define Uses_TDialog
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TColorItemList )
+#define Uses_TListViewer
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TColorGroupList )
+#define Uses_TListViewer
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TColorDisplay )
+#define Uses_TView
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TMonoSelector )
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TMonoSelector )
+#define Uses_TCluster
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TColorSelector )
+#define Uses_TView
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TColorGroup )
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TColorItem )
+#define INCLUDE_COLORSEL_H
+#endif
+
+#if defined( Uses_TChDirDialog )
+#define Uses_TDialog
+#define INCLUDE_STDDLG_H
+#endif
+
+#if defined( Uses_TDirListBox )
+#define Uses_TListBox
+#define Uses_limits
+#define INCLUDE_STDDLG_H
+#endif
+
+#if defined( Uses_TDirCollection )
+#define Uses_TCollection
+#define Uses_TDirEntry
+#define INCLUDE_STDDLG_H
+#endif
+
+#if defined( Uses_TDirEntry )
+#define INCLUDE_STDDLG_H
+#endif
+
+#if defined( Uses_TFileDialog )
+#define Uses_TDialog
+#define INCLUDE_STDDLG_H
+#define Uses_limits
+#endif
+
+#if defined( Uses_TFileInfoPane )
+#define Uses_TView
+#define Uses_TSearchRec
+#define INCLUDE_STDDLG_H
+#define INCLUDE_TIME_H
+#endif
+
+#if defined( Uses_TFileList )
+#define Uses_TSortedListBox
+#define Uses_TFileCollection
+#define Uses_TSearchRec
+#define INCLUDE_STDDLG_H
+#endif
+
+#if defined( Uses_TSortedListBox )
+#define Uses_TListBox
+#define INCLUDE_STDDLG_H
+#endif
+
+#if defined( Uses_TFileCollection )
+#define Uses_TSortedCollection
+#define Uses_TSearchRec
+#define INCLUDE_STDDLG_H
+#endif
+
+#if defined( Uses_TFileInputLine )
+#define Uses_TInputLine
+#define INCLUDE_STDDLG_H
+#endif
+
+#if defined( Uses_TSearchRec )
+#define INCLUDE_STDDLG_H
+#define INCLUDE_TIME_H
+#define Uses_limits
+#endif
+
+#if defined( Uses_THistory )
+#define Uses_TView
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_THistoryWindow )
+#define Uses_TWindow
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_THistoryViewer )
+#define Uses_TListViewer
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_T1Label )
+#define Uses_TLabel
+#endif
+
+#if defined( Uses_TLabel )
+#define Uses_TStaticText
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TParamText )
+#define Uses_TStaticText
+#define INCLUDE_DIALOGS_H
+#endif
+
+#ifdef Uses_T1StaticText
+#define Uses_string
+#define Uses_TStaticText
+#endif
+
+#if defined( Uses_TStaticText )
+#define Uses_TView
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TListBox )
+#define Uses_TListViewer
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TCheckBoxes )
+#define Uses_TCluster
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TRadioButtons )
+#define Uses_TCluster
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TCluster )
+#define Uses_TView
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TSItem )
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TButton )
+#define Uses_TView
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TInput1Line )
+#define Uses_TInputLine
+#endif
+
+#if defined( Uses_TInputLine )
+#define Uses_TView
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TDialog )
+#define Uses_TWindow
+#define INCLUDE_DIALOGS_H
+#endif
+
+#if defined( Uses_TWindow )
+#define Uses_TGroup
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_TGroup )
+#define Uses_TView
+#define Uses_TRect
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_TListViewer )
+#define Uses_TView
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_TScroller )
+#define Uses_TView
+#define Uses_TPoint
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_TScrollBar )
+#define Uses_TView
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_TFrame )
+#define Uses_TView
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_TView )
+#define Uses_TObject
+#if !defined( NO_STREAM )
+#define Uses_TStreamable
+#endif
+#define Uses_TDrawBuffer
+#define Uses_TPoint
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_TPalette )
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_TCommandSet )
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_ViewCommands )
+#define INCLUDE_VIEWS_H
+#endif
+
+#if defined( Uses_TStrListMaker )
+#define Uses_TObject
+#if !defined( NO_STREAM )
+#define Uses_TStreamable
+#endif
+#define Uses_TStrIndexRec
+#define Uses_TStringList // Forced by TStringList::name!
+#define INCLUDE_RESOURCE_H
+#endif
+
+#if defined( Uses_TStringList )
+#define Uses_TObject
+#if !defined( NO_STREAM )
+#define Uses_TStreamable
+#endif
+#define INCLUDE_RESOURCE_H
+#endif
+
+#if defined( Uses_TStrIndexRec )
+#define INCLUDE_RESOURCE_H
+#endif
+
+#if defined( Uses_TResourceFile )
+#define Uses_TObject
+#define INCLUDE_RESOURCE_H
+#endif
+
+#if defined( Uses_TResourceItem )
+#define INCLUDE_RESOURCE_H
+#endif
+
+#if defined( Uses_TResourceCollection )
+#define Uses_TStringCollection
+#define INCLUDE_RESOURCE_H
+#endif
+
+#if defined( Uses_TStringCollection )
+#define Uses_TSortedCollection
+#define INCLUDE_RESOURCE_H
+#endif
+
+#if defined( Uses_MsgBox )
+#define INCLUDE_MSGBOX_H
+#endif
+
+#if defined( Uses_TScreen )
+#define INCLUDE_SYSTEM_H
+#endif
+
+#if defined( Uses_TEventQueue )
+#define Uses_TEvent
+#define INCLUDE_SYSTEM_H
+#endif
+
+#if defined( Uses_TEvent )
+#define Uses_TPoint
+#define INCLUDE_SYSTEM_H
+#endif
+
+#if defined( Uses_EventCodes )
+#define INCLUDE_SYSTEM_H
+#endif
+
+#if defined( Uses_TVCodePage )
+#define INCLUDE_CODEPAGE_H
+#define Uses_TVPartitionTree556
+#endif
+
+#if defined( Uses_TSortedCollection )
+#define Uses_TNSSortedCollection
+#define Uses_TCollection
+#define INCLUDE_OBJECTS_H
+#endif
+
+#if defined( Uses_TCollection )
+#define Uses_TNSCollection
+#if !defined( NO_STREAM )
+#define Uses_TStreamable
+#endif
+#define INCLUDE_OBJECTS_H
+#endif
+
+#if defined( Uses_TRect )
+#define Uses_TPoint
+#define INCLUDE_OBJECTS_H
+#endif
+
+#if defined( Uses_TPoint )
+#define INCLUDE_OBJECTS_H
+#endif
+
+#if defined( Uses_TDrawBuffer )
+#define INCLUDE_DRAWBUF_H
+#endif
+
+#if defined( Uses_fpstream )
+#define Uses_fpbase
+#define Uses_iopstream
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_ofpstream )
+#define Uses_fpbase
+#define Uses_iostream_simple
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_ifpstream )
+#define Uses_fpbase
+#define Uses_iostream_simple
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_fpbase )
+#define Uses_pstream
+#define Uses_fstream_simple
+#define INCLUDE_TOBJSTRM_H
+#define Uses_FILEBUF_OPENPROT
+#endif
+
+#if defined( Uses_iopstream )
+#define Uses_iostream_simple
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_opstream )
+#define Uses_pstream
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_ipstream )
+#define Uses_pstream
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_pstream )
+#define Uses_iostream_simple
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_TPReadObjects )
+#define Uses_TNSCollection
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_TPWrittenObjects )
+#define Uses_TNSSortedCollection
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_TStreamableTypes )
+#define Uses_TNSSortedCollection
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_TStreamableClass )
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_TStreamable )
+#define INCLUDE_TOBJSTRM_H
+#endif
+
+#if defined( Uses_TNSSortedCollection )
+#define Uses_TNSCollection
+#define INCLUDE_TVOBJS_H
+#endif
+
+#if defined( Uses_TNSCollection )
+#define Uses_TObject
+#define INCLUDE_TVOBJS_H
+#endif
+
+#if defined( Uses_TObject )
+#define INCLUDE_TVOBJS_H
+#endif
+
+#if defined( Uses_TKeys )
+#define INCLUDE_TKEYS_H
+#endif
+
+#if defined( Uses_TVPartitionTree556 )
+#define INCLUDE_PARTTREE_H
+#define Uses_string
+#endif
+
+#if defined( INCLUDE_STDLIB_H )
+#define Uses_stdlib
+#endif
+
+#if defined( INCLUDE_TIME_H )
+#define Uses_time
+#endif
+
+// That's the file generated by the configure script:
+//#include <tv/configtv.h> Included by compatlayer.h
+// Compatibility layer
+#include <compatlayer.h>
+// This file sets some stuff according to the compiler:
+#include <tv/tvconfig.h>
+// Basic data types used in many places:
+#include <tv/ttypes.h>
+
+#if defined( INCLUDE_TKEYS_H )
+#include <tv/tkeys.h>
+#endif
+
+#if defined( INCLUDE_PARTTREE_H )
+#include <tv/parttree.h>
+#endif
+
+#if defined( INCLUDE_CODEPAGE_H )
+#include <tv/codepage.h>
+#endif
+
+#if defined( INCLUDE_GKEY_H )
+#include <tv/gkey.h>
+#endif
+
+#include <tv/tvutil.h>
+
+#if defined( INCLUDE_TVOBJS_H )
+#include <tv/tvobjs.h>
+#endif
+
+#if defined( INCLUDE_TOBJSTRM_H )
+#include <tv/tobjstrm.h>
+#endif
+
+#if defined( INCLUDE_DRAWBUF_H )
+#include <tv/drawbuf.h>
+#endif
+
+#if defined( INCLUDE_OBJECTS_H )
+#include <tv/objects.h>
+#endif
+
+#if defined( INCLUDE_VALID_H)
+#include <tv/validate.h>
+#endif
+
+#if defined( INCLUDE_SYSTEM_H )
+#include <tv/system.h>
+#endif
+
+#if defined( INCLUDE_MSGBOX_H )
+#include <tv/msgbox.h>
+#endif
+
+#if defined( INCLUDE_RESOURCE_H )
+#include <tv/resource.h>
+#endif
+
+#if defined( INCLUDE_VIEWS_H )
+#include <tv/views.h>
+#endif
+
+#if defined( INCLUDE_DIALOGS_H )
+#include <tv/dialogs.h>
+#endif
+
+#if defined( INCLUDE_STDDLG_H )
+#include <tv/stddlg.h>
+#endif
+
+#if defined( INCLUDE_COLORSEL_H )
+#include <tv/colorsel.h>
+#endif
+
+#if defined( INCLUDE_MENUS_H )
+#include <tv/menus.h>
+#endif
+
+#if defined( INCLUDE_TEXTVIEW_H )
+#include <tv/textview.h>
+#endif
+
+#if defined( INCLUDE_INDICATO_H )
+#include <tv/indicato.h>
+#endif
+
+#if defined( INCLUDE_FINDREPL_H )
+#include <tv/findrepl.h>
+#endif
+
+#if defined( INCLUDE_APP_H )
+#include <tv/app.h>
+#endif
+
+#if defined( INCLUDE_FILEVIEW_H )
+#include <tv/fileview.h>
+#endif
+
+#ifdef INCLUDE_FONTCOLL_H
+ #include <tv/fontcoll.h>
+#endif
+
+// SET: Start of the THelp* classes incorporated in 2.0
+#ifdef INCLUDE_HELPBASE_H
+ #include <tv/helpbase.h>
+#endif
+
+#ifdef INCLUDE_HELP_H
+ #include <tv/help.h>
+#endif
+// SET: End of the THelp* classes
+
+// SET: Start of the TEditor classes re-incorporated in 1.0.4
+#ifdef INCL_EDITORS_H
+#include <tv/editors.h>
+#endif
+
+#ifdef INCL_TVEDIT_H
+#include <tv/tvedit.h>
+#endif
+// SET: End of the TEditor classes
+
+// SET: Incorporated in 1.0.7
+#ifdef INCL_CALC_H
+#include <tv/calc.h>
+#endif
+
+#ifdef INCL_OSCLIPBOARD_H
+#include <tv/osclipboard.h>
+#endif
+
+#ifdef INCL_CONFIGFILE_H
+#include <tv/configfile.h>
+#endif
diff --git a/tvision/include/tv/alcon/alcon.h b/tvision/include/tv/alcon/alcon.h
new file mode 100644
index 0000000..ac02850
--- /dev/null
+++ b/tvision/include/tv/alcon/alcon.h
@@ -0,0 +1,309 @@
+/*
+ Copyright (c) 2001-2009 by Salvador E. Tropea (SET) <set@ieee.org>
+ This code is covered by the GPL license. A copy of the license should
+be provided in the same package.
+
+ Modified by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>
+ to be used as a Turbo Vision driver.
+
+ conio.h emulation library on top of Allegro
+*/
+#ifndef AlCon_HEADER_INCLUDED
+#define AlCon_HEADER_INCLUDED
+
+#ifdef HAVE_ALLEGRO
+
+#include <allegro.h>
+
+#define AlCon_VERSION_MAJOR 0
+#define AlCon_VERSION_MIDDLE 0
+#define AlCon_VERSION_MINOR 2
+#define AlCon_VERSION "0.0.2"
+
+typedef unsigned short uint16;
+typedef unsigned char uchar;
+/* Must match TV's TScreenColor */
+struct AlCon_Color
+{
+ uchar R,G,B,Alpha;
+};
+
+/* Functions to hide/unhide the mouse and text cursors. */
+extern void AlCon_ScareCursor();
+extern void AlCon_UnScareCursor();
+extern void AlCon_DisableAsync();
+extern void AlCon_EnableAsync();
+
+/* Cursor positioning routines. */
+extern void AlCon_CursorHome();
+extern void AlCon_GotoXY(int x, int y);
+extern int AlCon_WhereX();
+extern int AlCon_WhereY();
+extern int AlCon_ScreenCols();
+extern int AlCon_ScreenRows();
+
+/* Color selection routines. */
+extern void AlCon_SetColors(int aFg, int aBg);
+extern void AlCon_TextAttr(int attr);
+extern void AlCon_TextBackground(int aBg);
+extern void AlCon_TextColor(int aFg);
+
+/* Clear routines */
+extern void AlCon_Clear();
+extern void AlCon_ClrScr();
+
+/* Text output routines, including newline and tab management */
+extern void AlCon_NewLine();
+extern void AlCon_PutStr(const char *s);
+extern void AlCon_Puts(const char *s);
+extern void AlCon_Tab();
+extern void AlCon_CPrintf(const char *format, ...);
+extern void AlCon_PutBuf(unsigned offset, uint16 *buffer, int len);
+extern void AlCon_PutChar(unsigned offset, uint16 value);
+extern void AlCon_GetScrChars(unsigned offset, uint16 *buf, unsigned count);
+
+/* Text cursor routines. */
+extern void AlCon_UnDrawCursor(int *aFgCol);
+extern void AlCon_IntCursor();
+extern void AlCon_SetCursorShape(int from, int to);
+extern void AlCon_GetCursorShape(int *from, int *to);
+extern void AlCon_HideCursor();
+extern void AlCon_ShowCursor();
+extern int AlCon_IsVisCursor();
+
+/* Initialization routines */
+extern int AlCon_Init(int w, int h, int fw=-1, int fh=-1, uchar *fdata=NULL,
+ AlCon_Color *pal=NULL);
+extern int AlCon_Resize(unsigned sW, unsigned sH, int new_font_width,
+ int new_font_height);
+extern void AlCon_Exit();
+
+/* Keyboard input routines */
+extern int AlCon_GetCh();
+extern int AlCon_KbHit();
+extern int AlCon_GetKey(unsigned *symbol, uchar *scan, unsigned *flags);
+extern void AlCon_ClearKeyBuf();
+
+/* Mouse input routines */
+extern int AlCon_GetMouseButtons(void);
+extern void AlCon_GetMousePos(int *x, int *y, int *buttons);
+
+/* Fonts */
+extern void AlCon_SetFont(int which, uchar *fnt, unsigned w, unsigned h);
+extern void AlCon_GetFontGeometry(unsigned int *w, unsigned int *h);
+extern void AlCon_EnableSecFont();
+extern void AlCon_DisableSecFont();
+/* Our default font */
+extern uchar AlCon_ShapeFont8x16[];
+extern uchar AlCon_ShapeFont10x20[];
+
+/* Externally forced keyboard mapping */
+extern char AlCon_ForcedKeyboard[4];
+
+/* Extra bits which can be set for strange cursor effects */
+extern int AlCon_CursorBits;
+#define ALCON_CURSOR_HIDE_NORMAL 0x0001
+#define ALCON_CURSOR_ON_SQUARE 0x0002
+#define ALCON_CURSOR_ON_CROSS 0x0004
+
+int AlCon_SetDisPaletteColors(int from, int number, AlCon_Color *colors);
+/* Only for readback */
+extern AlCon_Color AlCon_CurPalette[16];
+
+extern void AlCon_Redraw();
+
+#ifndef AlCon_NO_KEYDEFS
+
+#ifdef __cplusplus
+const uchar
+kbUnkNown=0,
+kbA= 1,kbB= 2,kbC= 3,kbD= 4,kbE= 5,kbF= 6,kbG= 7,kbH= 8,kbI= 9,kbJ=10,kbK=11,
+kbL=12,kbM=13,kbN=14,kbO=15,kbP=16,kbQ=17,kbR=18,kbS=19,kbT=20,kbU=21,kbV=22,
+kbW=23,kbX=24,kbY=25,kbZ=26,
+kbOpenBrace=27,kbBackSlash=28,kbCloseBrace=29,kbPause=30,kbEsc=31,
+kb0=32,kb1=33,kb2=34,kb3=35,kb4=36,kb5=37,kb6=38,kb7=39,kb8=40,kb9=41,
+kbBackSpace=42,kbTab=43,kbEnter=44,kbColon=45,kbQuote=46,kbGrave=47,
+kbComma=48,kbStop=49,kbSlash=50,kbAsterisk=51,kbSpace=52,kbMinus=53,
+kbPlus=54,kbPrnScr=55,kbEqual=56,kbF1=57,kbF2=58,kbF3=59,kbF4=60,kbF5=61,
+kbF6=62,kbF7=63,kbF8=64,kbF9=65,kbF10=66,kbF11=67,kbF12=68,kbHome=69,
+kbUp=70,kbPgUp=71,kbLeft=72,kbRight=73,kbEnd=74,kbDown=75,kbPgDn=76,
+kbInsert=77,kbDelete=78,kbCaret=79,kbAdmid=80,kbDobleQuote=81,
+kbNumeral=82,kbDolar=83,kbPercent=84,kbAmper=85,kbOpenPar=86,
+kbClosePar=87,kbDoubleDot=88,kbLessThan=89,kbGreaterThan=90,
+kbQuestion=91,kbA_Roba=92,kbOr=93,kbUnderLine=94,kbOpenCurly=95,
+kbCloseCurly=96,kbTilde=97,kbMacro=98,kbWinLeft=99,kbWinRight=100,
+kbWinSel=101,
+kbMouse=102,kbEterm=103;
+
+/* Shift constants */
+//const uint16
+// kbShiftCode=0x080,
+// kbCtrlCode =0x100,
+// kbAltRCode =0x400,
+// kbAltLCode =0x200,
+// kbKeyMask =0x07F;
+#else /* __cplusplus */
+
+#define kbUnkNown 0
+#define kbA 1
+#define kbB 2
+#define kbC 3
+#define kbD 4
+#define kbE 5
+#define kbF 6
+#define kbG 7
+#define kbH 8
+#define kbI 9
+#define kbJ 10
+#define kbK 11
+#define kbL 12
+#define kbM 13
+#define kbN 14
+#define kbO 15
+#define kbP 16
+#define kbQ 17
+#define kbR 18
+#define kbS 19
+#define kbT 20
+#define kbU 21
+#define kbV 22
+#define kbW 23
+#define kbX 24
+#define kbY 25
+#define kbZ 26
+#define kbOpenBrace 27
+#define kbBackSlash 28
+#define kbCloseBrace 29
+#define kbPause 30
+#define kbEsc 31
+#define kb0 32
+#define kb1 33
+#define kb2 34
+#define kb3 35
+#define kb4 36
+#define kb5 37
+#define kb6 38
+#define kb7 39
+#define kb8 40
+#define kb9 41
+#define kbBackSpace 42
+#define kbTab 43
+#define kbEnter 44
+#define kbColon 45
+#define kbQuote 46
+#define kbGrave 47
+#define kbComma 48
+#define kbStop 49
+#define kbSlash 50
+#define kbAsterisk 51
+#define kbSpace 52
+#define kbMinus 53
+#define kbPlus 54
+#define kbPrnScr 55
+#define kbEqual 56
+#define kbF1 57
+#define kbF2 58
+#define kbF3 59
+#define kbF4 60
+#define kbF5 61
+#define kbF6 62
+#define kbF7 63
+#define kbF8 64
+#define kbF9 65
+#define kbF10 66
+#define kbF11 67
+#define kbF12 68
+#define kbHome 69
+#define kbUp 70
+#define kbPgUp 71
+#define kbLeft 72
+#define kbRight 73
+#define kbEnd 74
+#define kbDown 75
+#define kbPgDn 76
+#define kbInsert 77
+#define kbDelete 78
+#define kbCaret 79
+#define kbAdmid 80
+#define kbDobleQuote 81
+#define kbNumeral 82
+#define kbDolar 83
+#define kbPercent 84
+#define kbAmper 85
+#define kbOpenPar 86
+#define kbClosePar 87
+#define kbDoubleDot 88
+#define kbLessThan 89
+#define kbGreaterThan 90
+#define kbQuestion 91
+#define kbA_Roba 92
+#define kbOr 93
+#define kbUnderLine 94
+#define kbOpenCurly 95
+#define kbCloseCurly 96
+#define kbTilde 97
+#define kbMacro 98
+#define kbWinLeft 99
+#define kbWinRight 100
+#define kbWinSel 101
+#define kbMouse 102
+#define kbEterm 103
+
+//#define kbShiftCode 0x080
+//#define kbCtrlCode 0x100
+//#define kbAltRCode 0x400
+//#define kbAltLCode 0x200
+//#define kbKeyMask 0x07F
+
+#endif /* __cplusplus */
+
+#endif /* !AlCon_NO_KEYDEFS */
+
+extern const char *AlCon_KeyNames[];
+
+#define charPos 0
+#define attrPos 1
+
+#ifdef Uses_AlCon_conio
+/*****************************************************************************
+
+ Conio style definitions
+
+*****************************************************************************/
+
+#define BLACK 0
+#define BLUE 1
+#define GREEN 2
+#define CYAN 3
+#define RED 4
+#define MAGENTA 5
+#define BROWN 6
+#define LIGHTGRAY 7
+#define DARKGRAY 8
+#define LIGHTBLUE 9
+#define LIGHTGREEN 10
+#define LIGHTCYAN 11
+#define LIGHTRED 12
+#define LIGHTMAGENTA 13
+#define YELLOW 14
+#define WHITE 15
+
+#define cprintf(a...) AlCon_CPrintf(a)
+#define gotoxy(a,b) AlCon_GotoXY(a,b)
+#define getch() AlCon_GetCh()
+#define kbhit() AlCon_KbHit()
+#define textattr(a) AlCon_TextAttr(a)
+#define cputs(a) AlCon_PutStr(a)
+#define blinkvideo() // Not supported
+#define intensevideo() // Ever in this mode
+#define clrsrc() AlCon_ClrScr()
+#define wherex() AlCon_WhereX()
+#define wherey() AlCon_WhereY()
+#define textbackground(a) AlCon_TextBackground(a)
+#define textcolor(a) AlCon_TextColor(a)
+#define ScreenCols() AlCon_ScreenCols()
+#define ScreenRows() AlCon_ScreenRows()
+#endif
+
+#endif // HAVE_ALLEGRO
+#endif
diff --git a/tvision/include/tv/alcon/key.h b/tvision/include/tv/alcon/key.h
new file mode 100644
index 0000000..6702f43
--- /dev/null
+++ b/tvision/include/tv/alcon/key.h
@@ -0,0 +1,59 @@
+/*****************************************************************************
+
+ Copyright (c) 2003-2004 by Grzegorz Adam Hankiewicz
+ Copyright (c) 2002-2009 by Salvador E. Tropea (SET) <set@ieee.org>
+
+ AlCon driver for Turbo Vision. It uses the conio.h emulation library on top
+ of Allegro.
+
+ Contributed by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>
+
+ This is part of Turbo Vision ditribution and covered by the same license.
+
+*****************************************************************************/
+
+#ifndef ALCONKEY_HEADER_INCLUDED
+#define ALCONKEY_HEADER_INCLUDED
+
+#ifdef HAVE_ALLEGRO
+
+// A class to encapsulate the globals, all is static!
+class TGKeyAlcon : public TGKey
+{
+public:
+ // Usually nothing goes here and the initialization code goes in Init()
+ TGKeyAlcon() {};
+
+ // Function replacements
+ // Put the keyboard in the original state
+ static void Suspend();
+ // Memorize current state and setup our state
+ static void Resume();
+ // Is a key waiting to be retreived?
+ static int KbHit();
+ // Remove all the keys waiting to be retrieved.
+ static void Clear();
+ // Get the next key. The format is the one you can see in tkeyext.h and
+ // gkey.h
+ static ushort GKey();
+ // What's the current state of modifier keys. The IBM BIOS values are used.
+ // Not all targets implement it.
+ static unsigned GetShiftState();
+ // Fill a TEvent structure with the next available key (or evNothing)
+ static void FillTEvent(TEvent &e);
+ // Set a particular mode requested by the user. The values should be allocated
+ // in the keyMode enumeration found in TGKey to avoid collisions between drivers.
+ static void SetKbdMapping(int version);
+
+ // Setup the pointers to point our members
+ static void Init();
+
+protected:
+ // Put support routines and variables here
+ static unsigned Symbol;
+ static uchar Scan;
+ static unsigned Flags;
+};
+#endif // HAVE_ALLEGRO
+#endif // ALCONKEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/alcon/mouse.h b/tvision/include/tv/alcon/mouse.h
new file mode 100644
index 0000000..9c4c0b4
--- /dev/null
+++ b/tvision/include/tv/alcon/mouse.h
@@ -0,0 +1,58 @@
+/*****************************************************************************
+
+ Copyright (c) 2003-2004 by Grzegorz Adam Hankiewicz
+ Copyright (c) 2002-2009 by Salvador E. Tropea (SET) <set@ieee.org>
+
+ AlCon driver for Turbo Vision. It uses the conio.h emulation library on top
+ of Allegro.
+
+ Contributed by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>
+
+ This is part of Turbo Vision ditribution and covered by the same license.
+
+*****************************************************************************/
+
+// For more information look in event.h
+#ifndef ALCONMOUSE_HEADER_INCLUDED
+#define ALCONMOUSE_HEADER_INCLUDED
+
+#ifdef HAVE_ALLEGRO
+
+class THWMouseAlcon : public THWMouse
+{
+public:
+ // Setup the pointers to point our members
+ static void Init();
+
+protected:
+ // Note that even contructor/destructor are protected
+ // Usually nothing goes here and the initialization code goes in Init()
+ THWMouseAlcon() {};
+ // Here you can put the code needed to restore the state of the machine
+ // before initialization. Be very careful we the order and avoid doble
+ // deinitializations.
+ virtual ~THWMouseAlcon();
+
+ // Function replacements
+ // Make the mouse cursor visible
+ static void Show();
+ // Make the mouse cursor invisible
+ static void Hide();
+ // Put the mouse in the original state
+ static void Suspend();
+ // Memorize current state and setup our state
+ static void Resume();
+ // Get a mouse event and fill the structure. If no mouse event is available
+ // fill the structure with the same data you used last time.
+ static void GetEvent(MouseEventType &me);
+
+ // The setup of the pointers to point our members is done in Init()
+ // Don't forget to setup buttonCount or the class will say the mouse isn't
+ // present.
+
+ // Put support routines and variables here
+};
+
+#endif // HAVE_ALLEGRO
+#endif // ALCONMOUSE_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/alcon/screen.h b/tvision/include/tv/alcon/screen.h
new file mode 100644
index 0000000..a3fe526
--- /dev/null
+++ b/tvision/include/tv/alcon/screen.h
@@ -0,0 +1,173 @@
+/*****************************************************************************
+
+ Copyright (c) 2003-2004 by Grzegorz Adam Hankiewicz
+ Copyright (c) 2002-2009 by Salvador E. Tropea (SET) <set@ieee.org>
+
+ AlCon driver for Turbo Vision. It uses the conio.h emulation library on top
+ of Allegro.
+
+ Contributed by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>
+
+ This is part of Turbo Vision ditribution and covered by the same license.
+
+*****************************************************************************/
+
+// Here specify if this header requires some system specific header
+#ifndef ALCONSCR_HEADER_INCLUDED
+#define ALCONSCR_HEADER_INCLUDED
+
+#ifdef HAVE_ALLEGRO
+
+// virtual to avoid problems with multiple inheritance
+class TDisplayAlcon : virtual public TDisplay
+{
+protected:
+ // Usually TDisplay contructor does nothing. All the magic is in TScreen
+ // constructor, a class derived from it.
+ TDisplayAlcon() {};
+ // We will use casts to base classes, destructors must be pointers.
+ // Usually the magic goes in ~TScreenAlcon
+ virtual ~TDisplayAlcon();
+ // This sets the pointers of TDisplay to point to this class.
+ static void Init();
+
+ // Behaviors to replace TDisplay.
+ // Note all of this is protected and is supposed to be used through TScreen
+ // You can name these members as you like. Not all have to be implemented
+ // and all have defaults.
+ // Set text cursor position
+ static void SetCursorPos(unsigned x, unsigned y);
+ // Find text cursor position
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ // What's the shape of the text cursor?
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ // Set the shape of the text cursor
+ static void SetCursorShape(unsigned start, unsigned end);
+ // How many lines have the display?
+ static ushort GetRows();
+ // How many columns?
+ static ushort GetCols();
+ // Set a video mode number, usually not implemented, but sometimes you need to
+ // set some defaults here.
+ static void SetCrtMode(ushort mode);
+ // Set a video mode using an external program
+ static void SetCrtModeExt(char *mode);
+ // Did the display changed its size since last call?
+ static int CheckForWindowSize(void);
+ // What's the title of our window?
+ static const char *GetWindowTitle(void);
+ // Set the title for our window
+ static int SetWindowTitle(const char *name);
+ // Produce an audible indication
+ static void Beep();
+
+ // Variables for this driver
+ // Here you define variables needed by your driver.
+};
+
+// With this order the destructor will be called first for TScreenAlcon,
+// TScreen, TDisplayAlcon and finally TDisplay.
+class TScreenAlcon : public TDisplayAlcon, public TScreen
+{
+public:
+ // Put the driver detection/initialization in this constructor
+ TScreenAlcon();
+ // We will use casts to base classes, destructors must be pointers
+ // Here you can put the code needed to restore the state of the machine
+ // before initialization. Be very careful we the order and avoid doble
+ // deinitializations.
+ virtual ~TScreenAlcon();
+
+ // Usually our guts are needed by the key, mouse and/or display.
+ // Here you can allow access to those classes.
+ friend class TGKeyAlcon;
+ friend class THWMouseAlcon;
+ friend class TDisplayAlcon;
+
+protected:
+ // Memorize the state of the console and set our state.
+ static void Resume();
+ // Restore the state the console had.
+ static void Suspend();
+ // This does a translation between video mode numbers passed to setVideoMode
+ // and the values passed to setCrtMode.
+ static ushort fixCrtMode(ushort mode);
+ // This sets some internal variables with the current state of the console.
+ // Take a look at the default in tscreen.cc
+// static void setCrtData();
+ // Clear the contents of the whole screen. Here just to be compatible with
+ // original TV.
+ static void clearScreen();
+ // See TDisplayAlcon::SetCrtMode, this is the function expossed to the
+ // application.
+ static void setVideoMode(ushort mode);
+ // See TDisplayAlcon::SetCrtModeExt, this is the function expossed to the
+ // application.
+ static void setVideoModeExt(char *mode);
+ // The following four functions works with the screen buffer.
+ // Internally TV uses ushort arrays to store the characters and their
+ // attributes (8 bits each one). The organization is the same used by
+ // PC VGA video cards. The format is independent of the endianess of
+ // the architecture. If you cast the "short *" array to "unsigned char *"
+ // the even positions will hold the characters and the odd positions the
+ // attributes. The upper nibble of the attribute is the background and
+ // the lower is the foreground color.
+ // The driver should assign to screenBuffer the address of a buffer
+ // containing the actual data displayed in the screen. In TV 1.x for DOS
+ // it was a pointer to the video memory, in TV 2.0 it can be a pointer to
+ // a buffer in memory or just any value, but can't remain NULL or
+ // nothing will be sent to the screen.
+ // When screenBuffer points to a buffer in memory setCharacter* should
+ // output to the screen *and* hold a copy in this buffer. In this case
+ // the default getCharacter* will do the job.
+ // Get the char/attribute pairs at offset position (x=offset%cols,
+ // y=offset/cols).
+ static void getCharacters(unsigned offset,ushort *buf,unsigned count);
+ static ushort getCharacter(unsigned dst);
+ // Sets the char/attribute pairs.
+ static void setCharacter(unsigned offset, ushort value);
+ static void setCharacters(unsigned dst, ushort *src, unsigned len);
+ // Calls an external program, if pidChild pointer is not null the routine
+ // should try to do it in background and return the process ID.
+ static int System(const char *command, pid_t *pidChild);
+ // Sets the colors palette, currently upto 16 colors are supported
+ static int SetDisPaletteColors(int from, int number, TScreenColor *colors);
+ // Finds the width and height of the font currently used
+ static int GetFontGeometry(unsigned &w, unsigned &h);
+ // To know the smallest and biggest font sizes supported
+ static int GetFontGeometryRange(unsigned &wmin, unsigned &hmin,
+ unsigned &umax, unsigned &hmax);
+ // It changes the screen fonts. Upto 2 fonts are supported and the driver
+ // must use the capabilities (see Capabilities1 enum) to indicate if the
+ // secondary font is supported.
+ static int SetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP=-1, int appCP=-1);
+ // Restore the original fonts
+ static void RestoreFonts();
+ // Sets a video mode indicating a size of the screen and font. The function
+ // must look for the closest mode and indicate if we set what the user
+ // requested or something different.
+ static int SetCrtModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+ // Show some sign to indicate we are temporally busy, it can be changing the
+ // mouse cursor.
+
+ static void DoResize(unsigned w, unsigned h);
+
+ static Boolean ShowBusyState(Boolean state);
+
+protected:
+ // Put support routines and variables here
+ // Size of the font.
+ static unsigned fontW,fontWb,fontH,fontSz;
+ // The default font.
+ static TScreenFont256 font8x16;
+ static TScreenFont256 font10x20;
+ static TScreenFont256 *defaultFont;
+ // Indicates if the current primary font is custom.
+ static uchar primaryFontChanged;
+};
+
+#endif // HAVE_ALLEGRO
+#endif // ALCONSCR_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/app.h b/tvision/include/tv/app.h
new file mode 100644
index 0000000..3db717c
--- /dev/null
+++ b/tvision/include/tv/app.h
@@ -0,0 +1,40 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TBackground )
+
+#include <tv/backgrnd.h>
+
+#endif
+
+
+#if defined( Uses_TDeskTop )
+
+#include <tv/desktop.h>
+
+#endif
+
+
+#if defined( Uses_TProgram )
+
+#include <tv/program.h>
+
+#endif
+
+#if defined( Uses_TApplication )
+
+#include <tv/applictn.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/applictn.h b/tvision/include/tv/applictn.h
new file mode 100644
index 0000000..48b141c
--- /dev/null
+++ b/tvision/include/tv/applictn.h
@@ -0,0 +1,31 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TApplication ) && !defined( __TApplication )
+#define __TApplication
+
+class CLY_EXPORT TApplication : public TProgram
+{
+
+protected:
+
+ TApplication();
+ virtual ~TApplication();
+
+ virtual void suspend();
+ virtual void resume();
+
+};
+
+#endif
+
diff --git a/tvision/include/tv/backgrnd.h b/tvision/include/tv/backgrnd.h
new file mode 100644
index 0000000..7e5ad55
--- /dev/null
+++ b/tvision/include/tv/backgrnd.h
@@ -0,0 +1,65 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TBackground ) && !defined( __TBackground )
+#define __TBackground
+
+class TRect;
+
+class TBackground : public TView
+{
+
+public:
+
+ TBackground( const TRect& bounds, char aPattern );
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ void changePattern(char newP) { pattern=newP; draw(); }
+ char getPattern(void) { return pattern; }
+
+protected:
+ char pattern;
+
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TBackground( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TBackground& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TBackground*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TBackground& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TBackground* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TBackground
+
diff --git a/tvision/include/tv/button.h b/tvision/include/tv/button.h
new file mode 100644
index 0000000..0493098
--- /dev/null
+++ b/tvision/include/tv/button.h
@@ -0,0 +1,127 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Added callback, code page stuff and various details by Salvador Eduardo Tropea.
+Added new class TButtonRef by Salvador Eduardo Tropea.
+Added i18n support by Salvador Eduardo Tropea.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* TButton object */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Default text */
+/* 3 = Selected text */
+/* 4 = Disabled text */
+/* 5 = Normal shortcut */
+/* 6 = Default shortcut */
+/* 7 = Selected shortcut */
+/* 8 = Shadow */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TButton ) && !defined( __TButton )
+#define __TButton
+
+class TRect;
+struct TEvent;
+class TDrawBuffer;
+
+// SET: callback function and return values
+typedef int (*TButtonCallBack)(unsigned command, void *data);
+const int btcbGoOn=0, btcbEndModal=1;
+
+class CLY_EXPORT TButton : public TView
+{
+
+public:
+
+ TButton( const TRect& bounds,
+ const char *aTitle,
+ ushort aCommand,
+ ushort aFlags
+ );
+ ~TButton();
+
+ virtual void draw();
+ void drawState( Boolean down );
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ void makeDefault( Boolean enable );
+ virtual void press();
+ virtual void setState( ushort aState, Boolean enable );
+ void setCallBack(TButtonCallBack cb, void *aData=NULL)
+ { callBack=cb; cbData=aData; };
+ const char *getText() { return TVIntl::getText(title,intlTitle); };
+
+ const char *title;
+ stTVIntl *intlTitle;
+ static char shadows[];
+ static char markers[];
+ static char oshadows[];
+ static char omarkers[];
+
+protected:
+
+ ushort command;
+ uchar flags;
+ Boolean amDefault;
+ TButtonCallBack callBack;
+ void *cbData; // SET: Callback data
+
+private:
+
+ void drawTitle( TDrawBuffer&, int, int, ushort, Boolean );
+ void pressButton( TEvent& );
+ TRect getActiveRect();
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TButton( StreamableInit ): TView( streamableInit ) {};
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+inline ipstream& operator >> ( ipstream& is, TButton& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TButton*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TButton& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TButton* cl )
+ { return os << (TStreamable *)cl; }
+
+// Note: you can't stream this class. Wait until I create relative code page
+// TViews for international buttons.
+class TButtonRef : public TButton
+{
+public:
+ TButtonRef( const TRect& bounds,
+ const char *aTitle,
+ ushort aCommand,
+ ushort aFlags
+ );
+ ~TButtonRef();
+};
+
+#endif // Uses_TButton
+
diff --git a/tvision/include/tv/calc.h b/tvision/include/tv/calc.h
new file mode 100644
index 0000000..49845b4
--- /dev/null
+++ b/tvision/include/tv/calc.h
@@ -0,0 +1,143 @@
+/*-------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Calc.h: Header file for Calc.cpp */
+/*-------------------------------------------------------*/
+/* Ported by SET */
+
+#if defined(Uses_TCalcDisplay) && !defined( TCalcDisplay__ )
+#define TCalcDisplay__
+
+// SET: The following should be enough to hold the output of the %f modifier
+#define DISPLAYLEN 25 // Length (width) of calculator display
+
+enum TCalcState { csFirst = 1, csValid, csError };
+
+const int cmCalcButton = 200,
+ // SET: Defined as commands
+ cmCalcClear = cmCalcButton,
+ cmCalcDelete = cmCalcButton+1,
+ cmCalcPercent = cmCalcButton+2,
+ cmCalcPlusMin = cmCalcButton+3,
+ cmCalc7 = cmCalcButton+4,
+ cmCalc8 = cmCalcButton+5,
+ cmCalc9 = cmCalcButton+6,
+ cmCalcDiv = cmCalcButton+7,
+ cmCalc4 = cmCalcButton+8,
+ cmCalc5 = cmCalcButton+9,
+ cmCalc6 = cmCalcButton+10,
+ cmCalcMul = cmCalcButton+11,
+ cmCalc1 = cmCalcButton+12,
+ cmCalc2 = cmCalcButton+13,
+ cmCalc3 = cmCalcButton+14,
+ cmCalcMinus = cmCalcButton+15,
+ cmCalc0 = cmCalcButton+16,
+ cmCalcDecimal = cmCalcButton+17,
+ cmCalcEqual = cmCalcButton+18,
+ cmCalcPlus = cmCalcButton+19;
+
+class TRect;
+class TPalette;
+struct TEvent;
+
+class CLY_EXPORT TCalcDisplay : public TView
+{
+public:
+
+ TCalcDisplay(TRect& r);
+ ~TCalcDisplay();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent(TEvent& event);
+ virtual void draw();
+
+private:
+
+ TCalcState status;
+ char *number;
+ char sign;
+ char operate; // since 'operator' is a reserved word.
+ double operand;
+
+ void calcKey(unsigned char key, unsigned code);
+ void checkFirst();
+ void setDisplay(double r);
+ void clear();
+ void error();
+ inline double getDisplay() { return( atof( number ) ); };
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ TCalcDisplay( StreamableInit ) : TView(streamableInit) { };
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TCalcDisplay& cl )
+ { return is >> (TStreamable&) cl; }
+inline ipstream& operator >> ( ipstream& is, TCalcDisplay*& cl )
+ { return is >> (void *&) cl; }
+
+inline opstream& operator << ( opstream& os, TCalcDisplay& cl )
+ { return os << (TStreamable&) cl; }
+inline opstream& operator << ( opstream& os, TCalcDisplay* cl )
+ { return os << (TStreamable *) cl; }
+#endif // NO_STREAM
+#endif // Uses_TCalcDisplay
+
+
+#if defined(Uses_TCalculator) && !defined( TCalculator__ )
+#define TCalculator__
+
+class CLY_EXPORT TCalculator : public TDialog
+{
+public:
+
+ TCalculator();
+ static const char *keyChar[20];
+
+#if !defined( NO_STREAM )
+ TCalculator( StreamableInit ) :
+ TWindowInit(&TCalculator::initFrame), TDialog(streamableInit) { };
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+//protected:
+
+// virtual void write( opstream& );
+// virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TCalculator& cl )
+ { return is >> (TStreamable&) cl; }
+inline ipstream& operator >> ( ipstream& is, TCalculator*& cl )
+ { return is >> (void *&) cl; }
+
+inline opstream& operator << ( opstream& os, TCalculator& cl )
+ { return os << (TStreamable&) cl; }
+inline opstream& operator << ( opstream& os, TCalculator* cl )
+ { return os << (TStreamable *) cl; }
+#endif // NO_STREAM
+#endif // Uses_TCalculator
diff --git a/tvision/include/tv/chdirdlg.h b/tvision/include/tv/chdirdlg.h
new file mode 100644
index 0000000..268f824
--- /dev/null
+++ b/tvision/include/tv/chdirdlg.h
@@ -0,0 +1,82 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TChDirDialog ) && !defined( __TChDirDialog )
+#define __TChDirDialog
+
+const ushort
+ cdNormal = 0x0000, // Option to use dialog immediately
+ cdNoLoadDir = 0x0001, // Option to init the dialog to store on a stream
+ cdHelpButton = 0x0002; // Put a help button in the dialog
+
+struct TEvent;
+class TInputLine;
+class TDirListBox;
+class TButton;
+
+class CLY_EXPORT TChDirDialog : public TDialog
+{
+
+public:
+
+ friend class TDirListBox;
+
+ TChDirDialog( ushort aOptions, ushort histId );
+ virtual uint32 dataSize();
+ virtual void getData( void *rec );
+ virtual void handleEvent( TEvent& );
+ virtual void setData( void *rec );
+ virtual Boolean valid( ushort );
+ virtual void shutDown();
+
+private:
+
+ void setUpDialog();
+
+ TInputLine *dirInput;
+ TDirListBox *dirList;
+ TButton *okButton;
+ TButton *chDirButton;
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+ TChDirDialog( StreamableInit ) :
+ TWindowInit( &TChDirDialog::initFrame )
+ , TDialog( streamableInit ) {}
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TChDirDialog& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TChDirDialog*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TChDirDialog& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TChDirDialog* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TChDirDialog
+
diff --git a/tvision/include/tv/checkbox.h b/tvision/include/tv/checkbox.h
new file mode 100644
index 0000000..a74d3e1
--- /dev/null
+++ b/tvision/include/tv/checkbox.h
@@ -0,0 +1,107 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Added TCheckBoxes32 and code page stuff by Salvador Eduardo Tropea.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* TCheckBoxes */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Selected text */
+/* 3 = Normal shortcut */
+/* 4 = Selected shortcut */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TCheckBoxes ) && !defined( __TCheckBoxes )
+#define __TCheckBoxes
+
+class TRect;
+class TSItem;
+
+class CLY_EXPORT TCheckBoxes : public TCluster
+{
+
+public:
+
+ TCheckBoxes( const TRect& bounds, TSItem *aStrings) :
+ TCluster( bounds, aStrings ) {};
+
+ virtual void draw();
+
+ virtual Boolean mark( int item );
+ virtual void press( int item );
+
+ static char button[];
+ static char obutton[];
+
+private:
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TCheckBoxes( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+// SET: That's a 32 bits version, the only difference is that it uses a
+// 32 bits value for set/getData
+
+class TCheckBoxes32 : public TCheckBoxes
+{
+public:
+ TCheckBoxes32(const TRect& bounds,TSItem *aStrings) :
+ TCheckBoxes(bounds,aStrings) {};
+ virtual uint32 dataSize();
+private:
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const { return name; }
+protected:
+ TCheckBoxes32(StreamableInit);
+public:
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TCheckBoxes& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TCheckBoxes*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TCheckBoxes& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TCheckBoxes* cl )
+ { return os << (TStreamable *)cl; }
+
+inline ipstream& operator >> ( ipstream& is, TCheckBoxes32& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TCheckBoxes32*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TCheckBoxes32& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TCheckBoxes32* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TCheckBoxes
+
diff --git a/tvision/include/tv/clrdisp.h b/tvision/include/tv/clrdisp.h
new file mode 100644
index 0000000..d5839ba
--- /dev/null
+++ b/tvision/include/tv/clrdisp.h
@@ -0,0 +1,65 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TColorDisplay ) && !defined( __TColorDisplay )
+#define __TColorDisplay
+
+class TRect;
+struct TEvent;
+
+class TColorDisplay : public TView
+{
+
+public:
+
+ TColorDisplay( const TRect& bounds, const char *aText );
+ virtual ~TColorDisplay();
+ virtual void draw();
+ virtual void handleEvent( TEvent& event );
+ virtual void setColor( uchar *aColor );
+
+protected:
+
+ uchar *color;
+ const char *text;
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TColorDisplay( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+inline ipstream& operator >> ( ipstream& is, TColorDisplay& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TColorDisplay*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TColorDisplay& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TColorDisplay* cl )
+ { return os << (TStreamable *)cl; }
+
+#endif // Uses_TColorDisplay
+
diff --git a/tvision/include/tv/clrdlg.h b/tvision/include/tv/clrdlg.h
new file mode 100644
index 0000000..baad567
--- /dev/null
+++ b/tvision/include/tv/clrdlg.h
@@ -0,0 +1,83 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TColorDialog ) && !defined( __TColorDialog )
+#define __TColorDialog
+
+class TColorGroup;
+struct TEvent;
+class TColorDisplay;
+class TColorGroupList;
+class TLabel;
+class TColorSelector;
+class TMonoSelector;
+class TPalette;
+
+class CLY_EXPORT TColorDialog : public TDialog
+{
+
+public:
+
+ TColorDialog( TPalette *aPalette, TColorGroup *aGroups );
+ ~TColorDialog();
+ virtual uint32 dataSize();
+ virtual void getData( void *rec );
+ virtual void handleEvent( TEvent& event );
+ virtual void setData( void *rec);
+
+ TPalette *pal;
+
+protected:
+
+ TColorDisplay *display;
+ TColorGroupList *groups;
+ TLabel *forLabel;
+ TColorSelector *forSel;
+ TLabel *bakLabel;
+ TColorSelector *bakSel;
+ TLabel *monoLabel;
+ TMonoSelector *monoSel;
+#if !defined( NO_STREAM )
+private:
+
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TColorDialog( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TColorDialog& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TColorDialog*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TColorDialog& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TColorDialog* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // TColorDialog
+
diff --git a/tvision/include/tv/clrgroup.h b/tvision/include/tv/clrgroup.h
new file mode 100644
index 0000000..de97f8e
--- /dev/null
+++ b/tvision/include/tv/clrgroup.h
@@ -0,0 +1,41 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea for i18n support.
+
+ *
+ *
+ */
+
+#if defined( Uses_TColorGroup ) && !defined( __TColorGroup )
+#define __TColorGroup
+
+class TColorItem;
+
+class CLY_EXPORT TColorGroup
+{
+
+public:
+
+ TColorGroup( const char *nm, TColorItem *itm = 0, TColorGroup *nxt = 0 );
+ virtual ~TColorGroup();
+ const char *name;
+ TColorItem *items;
+ TColorGroup *next;
+ friend TColorGroup& operator + ( TColorGroup&, TColorItem& );
+ friend TColorGroup& operator + ( TColorGroup& g1, TColorGroup& g2 );
+
+protected:
+
+ stTVIntl *cacheName;
+
+ friend class TColorGroupList;
+};
+
+#endif // Uses_TColorGroup
+
diff --git a/tvision/include/tv/clrgrpli.h b/tvision/include/tv/clrgrpli.h
new file mode 100644
index 0000000..d5f2b2b
--- /dev/null
+++ b/tvision/include/tv/clrgrpli.h
@@ -0,0 +1,74 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TColorGroupList ) && !defined( __TColorGroupList )
+#define __TColorGroupList
+
+class TRect;
+class TScrollBar;
+class TColorGroup;
+class TColorItem;
+
+class TColorGroupList : public TListViewer
+{
+
+public:
+
+ TColorGroupList( const TRect& bounds,
+ TScrollBar *aScrollBar,
+ TColorGroup *aGroups
+ );
+ virtual ~TColorGroupList();
+ virtual void focusItem( ccIndex item );
+ virtual void getText( char *dest, ccIndex item, short maxLen );
+
+protected:
+
+ TColorGroup *groups;
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+ static void writeItems( opstream&, TColorItem * );
+ static void writeGroups( opstream&, TColorGroup * );
+ static TColorItem *readItems( ipstream& );
+ static TColorGroup *readGroups( ipstream& );
+
+protected:
+
+ TColorGroupList( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TColorGroupList& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TColorGroupList*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TColorGroupList& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TColorGroupList* cl )
+ { return os << (TStreamable *)cl; }
+#endif
+
+#endif // Uses_TColorGroupList
+
diff --git a/tvision/include/tv/clritem.h b/tvision/include/tv/clritem.h
new file mode 100644
index 0000000..9764141
--- /dev/null
+++ b/tvision/include/tv/clritem.h
@@ -0,0 +1,40 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea for i18n support.
+
+ *
+ *
+ */
+
+#if defined( Uses_TColorItem ) && !defined( __TColorItem )
+#define __TColorItem
+
+class TColorGroup;
+
+class CLY_EXPORT TColorItem
+{
+
+public:
+
+ TColorItem( const char *nm, uchar idx, TColorItem *nxt = 0 );
+ virtual ~TColorItem();
+ const char *name;
+ uchar index;
+ TColorItem *next;
+ friend TColorGroup& operator + ( TColorGroup&, TColorItem& );
+ friend TColorItem& operator + ( TColorItem& i1, TColorItem& i2 );
+
+protected:
+ stTVIntl *cacheName;
+
+ friend class TColorItemList;
+};
+
+#endif // Uses_TColorItem
+
diff --git a/tvision/include/tv/clriteml.h b/tvision/include/tv/clriteml.h
new file mode 100644
index 0000000..9cbebe0
--- /dev/null
+++ b/tvision/include/tv/clriteml.h
@@ -0,0 +1,70 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea: added horizontal scrollbar.
+
+ *
+ *
+ */
+
+#if defined( Uses_TColorItemList ) && !defined( __TColorItemList )
+#define __TColorItemList
+
+class TRect;
+class TScrollBar;
+class TColorItem;
+struct TEvent;
+
+class TColorItemList : public TListViewer
+{
+
+public:
+
+ TColorItemList( const TRect& bounds,
+ TScrollBar *aScrollBar,
+ TColorItem *aItems,
+ TScrollBar *aHScrollBar=0
+ );
+ virtual void focusItem( ccIndex item );
+ virtual void getText( char *dest, ccIndex item, short maxLen );
+ virtual void handleEvent( TEvent& event );
+
+protected:
+
+ TColorItem *items;
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TColorItemList( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TColorItemList& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TColorItemList*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TColorItemList& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TColorItemList* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TColorItemList
+
diff --git a/tvision/include/tv/clrselct.h b/tvision/include/tv/clrselct.h
new file mode 100644
index 0000000..77aa3db
--- /dev/null
+++ b/tvision/include/tv/clrselct.h
@@ -0,0 +1,75 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TColorSelector ) && !defined( __TColorSelector )
+#define __TColorSelector
+
+class TRect;
+struct TEvent;
+
+class TColorSelector : public TView
+{
+
+public:
+
+ enum ColorSel { csBackground, csForeground };
+
+ TColorSelector( const TRect& Bounds, ColorSel ASelType );
+ virtual void draw();
+ virtual void handleEvent( TEvent& event );
+
+ static char icon;
+ static char oicon;
+ static char mark;
+ static char omark;
+
+protected:
+
+ uchar color;
+ ColorSel selType;
+
+private:
+
+ void colorChanged();
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TColorSelector( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TColorSelector& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TColorSelector*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TColorSelector& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TColorSelector* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TColorSelector
+
diff --git a/tvision/include/tv/cluster.h b/tvision/include/tv/cluster.h
new file mode 100644
index 0000000..39e851d
--- /dev/null
+++ b/tvision/include/tv/cluster.h
@@ -0,0 +1,103 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TCluster */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Selected text */
+/* 3 = Normal shortcut */
+/* 4 = Selected shortcut */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TCluster ) && !defined( __TCluster )
+#define __TCluster
+
+class TRect;
+class TSItem;
+struct TEvent;
+class TPoint;
+class TStringCollection;
+class TStringCollectionCIntl;
+
+class CLY_EXPORT TCluster : public TView
+{
+
+public:
+
+ TCluster( const TRect& bounds, TSItem *aStrings );
+ ~TCluster();
+
+ virtual uint32 dataSize();
+ void drawBox( const char *icon, char marker );
+ virtual void getData( void *rec );
+ ushort getHelpCtx();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual Boolean mark( int item );
+ virtual void press( int item );
+ virtual void movedTo( int item );
+ virtual void setData( void *rec );
+ virtual void setState( ushort aState, Boolean enable );
+ // SET: see tcluster.cc for more information
+ unsigned getExtraOptions() { return extraOptions; }
+ void setExtraOptions(unsigned ops) { extraOptions=ops; }
+ // SET: for i18n support
+ const char *getItemText( ccIndex item );
+
+protected:
+ static unsigned extraOptions;
+
+ uint32 value;
+ int sel;
+ // SET: i18n cache
+ TStringCollectionCIntl *intlStrings;
+ TStringCollection *strings;
+
+private:
+
+ int column( int item );
+ int findSel( TPoint p );
+ int row( int item );
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TCluster( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TCluster& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TCluster*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TCluster& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TCluster* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TCluster
+
diff --git a/tvision/include/tv/cmdset.h b/tvision/include/tv/cmdset.h
new file mode 100644
index 0000000..98a498d
--- /dev/null
+++ b/tvision/include/tv/cmdset.h
@@ -0,0 +1,85 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TCommandSet ) && !defined( __TCommandSet )
+#define __TCommandSet
+
+class TCommandSet
+{
+
+public:
+
+ TCommandSet();
+ TCommandSet( const TCommandSet& );
+ ~TCommandSet();
+
+ Boolean has( int cmd );
+
+ void disableCmd( int cmd );
+ void disableCmd( int cmdStart, int cmdEnd ); // SET: Added
+ void enableCmd( int cmd );
+ void enableCmd( int cmdStart, int cmdEnd ); // SET: Added
+ void enableAllCommands();
+ void operator += ( int cmd );
+ void operator -= ( int cmd );
+
+ void disableCmd( const TCommandSet& );
+ void enableCmd( const TCommandSet& );
+ void operator += ( const TCommandSet& );
+ void operator -= ( const TCommandSet& );
+
+ Boolean isEmpty();
+
+ TCommandSet& operator = (const TCommandSet& );
+
+ TCommandSet& operator &= ( const TCommandSet& );
+ TCommandSet& operator |= ( const TCommandSet& );
+
+ friend TCommandSet operator & ( const TCommandSet&, const TCommandSet& );
+ friend TCommandSet operator | ( const TCommandSet&, const TCommandSet& );
+
+ friend int operator == ( const TCommandSet& tc1, const TCommandSet& tc2 );
+ friend int operator != ( const TCommandSet& tc1, const TCommandSet& tc2 );
+
+private:
+ uint32 *cmds;
+
+};
+
+inline void TCommandSet::operator += ( int cmd )
+{
+ enableCmd( cmd );
+}
+
+inline void TCommandSet::operator -= ( int cmd )
+{
+ disableCmd( cmd );
+}
+
+inline void TCommandSet::operator += ( const TCommandSet& tc )
+{
+ enableCmd( tc );
+}
+
+inline void TCommandSet::operator -= ( const TCommandSet& tc )
+{
+ disableCmd( tc );
+}
+
+inline int operator != ( const TCommandSet& tc1, const TCommandSet& tc2 )
+{
+ return !operator == ( tc1, tc2 );
+}
+
+#endif // Uses_TCommandSet
+
diff --git a/tvision/include/tv/codepage.h b/tvision/include/tv/codepage.h
new file mode 100644
index 0000000..be51b1c
--- /dev/null
+++ b/tvision/include/tv/codepage.h
@@ -0,0 +1,203 @@
+/**[txh]********************************************************************
+
+ Copyright 1996-2002 by Salvador Eduardo Tropea (SET)
+ This file is covered by the GPL license.
+
+ Module: TVCodePage
+
+***************************************************************************/
+
+#if defined(Uses_TVCodePage) && !defined(TVCodePage_Included)
+#define TVCodePage_Included 1
+
+class TVCodePageCol;
+class TStringCollection;
+struct stIntCodePairs
+{
+ uint16 unicode,code;
+};
+
+// This is the internal structure used to describe a code page
+struct CodePage
+{
+ char Name[28]; // Descriptive name
+ int id; // Unique ID to identify it
+ ushort Font[128]; // High 128 symbols
+ const char *UpLow; // Lowecase/Uppercase pairs
+ const char *MoreLetters; // Other symbols that should be treat as letters but doesn't
+ // have lowecase/uppercase pair.
+ int LowRemapNum; // Most code pages are plain ASCII in the first 128 symbols
+ ushort *LowRemap; // and we don't define them. This information is used when
+ // symbols under 128 needs special treatment.
+};
+
+typedef void (*TVCodePageCallBack)(ushort *map);
+
+const unsigned rbgDontRemapLow32=1, rbgOnlySelected=2;
+
+class CLY_EXPORT TVCodePage
+{
+public:
+ TVCodePage(int idApp, int idScr, int idInp);
+ ~TVCodePage();
+ static ccIndex IDToIndex(int id);
+ static int IndexToID(ccIndex index);
+ static ushort *GetTranslate(int id);
+ static void SetCodePage(int idApp, int idScr, int idInp);
+ // Helpers to call SetCodePage
+ static void SetCodePage(int idCP) { SetCodePage(idCP,idCP,idCP); };
+ static void SetScreenCodePage(int idCP) { SetCodePage(curAppCP,idCP,curInpCP); };
+ static void SetInputCodePage(int idCP) { SetCodePage(curAppCP,curScrCP,idCP); };
+ static TStringCollection
+ *GetList(void);
+ static uchar RemapChar(uchar c, ushort *map);
+ static void RemapString(uchar *n, uchar *o, ushort *map);
+ static void RemapNString(uchar *n, uchar *o, ushort *map, int len);
+ static void RemapBufferGeneric(int sourID, int destID, uchar *buffer, unsigned len,
+ unsigned ops);
+ static void FillGenericRemap(int sourID, int destID, uchar *buffer, unsigned ops=0);
+ static char toUpper(char val)
+ { return (char)toUpperTable[(uchar)val]; }
+ static char toLower(char val)
+ { return (char)toLowerTable[(uchar)val]; }
+ static int isAlpha(char val)
+ { return AlphaTable[(uchar)val] & alphaChar; }
+ static int isNumber(char val)
+ { return AlphaTable[(uchar)val] & digitChar; }
+ static int isAlNum(char val)
+ { return AlphaTable[(uchar)val] & (alphaChar | digitChar); }
+ static int isLower(char val)
+ { return AlphaTable[(uchar)val] & lowerChar; }
+ static int isUpper(char val)
+ { return AlphaTable[(uchar)val] & upperChar; }
+ static int InternalCodeForUnicode(uint16 unicode);
+ static uint16 UnicodeForInternalCode(uint16 code);
+ static void GetUnicodesForCP(int id, stIntCodePairs *unicodes);
+ static TVCodePageCallBack SetCallBack(TVCodePageCallBack map);
+
+ static Boolean OnTheFlyRemapNeeded() { return NeedsOnTheFlyRemap ? True : False; }
+ static uchar OnTheFlyRemap(uchar val) { return OnTheFlyMap[val]; }
+ static Boolean OnTheFlyRemapInpNeeded() { return NeedsOnTheFlyInpRemap ? True : False; }
+ static uchar OnTheFlyInpRemap(uchar val) { return OnTheFlyInpMap[val]; }
+ static void CreateCPFromUnicode(CodePage *cp, int id, const char *name,
+ ushort *unicodes);
+ static ccIndex AddCodePage(CodePage *cp);
+ static void GetCodePages(int &idScr, int &idApp, int &idInp)
+ { idApp=curAppCP; idScr=curScrCP; idInp=curInpCP; }
+ static int GetAppCodePage() { return curAppCP; }
+ static int GetScrCodePage() { return curScrCP; }
+ static int GetInpCodePage() { return curInpCP; }
+ static void GetDefaultCodePages(int &idScr, int &idApp, int &idInp)
+ { idApp=defAppCP; idScr=defScrCP; idInp=defInpCP; }
+ static int LookSimilarInRange(int code, int last);
+
+ // Arbitrary names for the supported code pages
+ // Just to avoid using the magics, look in codepage.cc for more information
+ enum
+ {
+ PC437=437, PC737=737, PC775=775, PC850=850, PC852=852, PC855=855, PC857=857,
+ PC860=860, PC861=861, PC863=863, PC865=865, PC866=866, PC869=869, CP1250=1250,
+ CP1251=1251, CP1252=1252, CP1253=1253, CP1254=1254, CP1257=1257, MacCyr=10007,
+ ISOLatin1=88791, ISOLatin2=88792, ISOLatin3=88593, ISOLatin4=88594,
+ ISORussian=88595, ISOGreek=88597, ISO9=88599, ISOLatin1Linux=885901,
+ ISOLatin1uLinux=885911, ISO14=885914, ISOIceland=885915,
+ ISOLatin2uLinux=885921, ISOLatin2Linux=885920, ISOLatin2Sun=885922,
+ ISOLatin2eLinux=885923, KOI8r=100000, KOI8_CRL_NMSU=100001,
+ MacOSUkrainian=100072, OsnovnojVariantRussian=885951,
+ AlternativnyjVariantRU=885952, UcodeRussian=885953, Mazovia=1000000,
+ ISO5427=3604494, ECMACyr=17891342, ISOIR146=21364750, ISOIR147=21430286,
+ ISOIR153=22216718,
+ LinuxACM=0x7FFF0000, LinuxSFM=0x7FFF0001
+ };
+
+protected:
+ static CodePage *CodePageOfID(int id);
+ static void RemapTVStrings(ushort *map);
+ static void FillTables(int id);
+ static void CreateOnTheFlyRemap(int idApp, int idScr);
+ static void CreateOnTheFlyInpRemap(int idInp, int idApp);
+ static void CreateRemap(int idSource, int idDest, uchar *table);
+ static void CreateCodePagesCol();
+ static void ChangeDefaultCodePages(int idScr, int idApp)
+ { defAppCP=idApp; defScrCP=idScr; }
+ static void SetDefaultCodePages(int idScr, int idApp, int idInp)
+ { defAppCP=idApp; defScrCP=idScr; defInpCP=idInp; }
+
+ enum { alphaChar=1, lowerChar=2, upperChar=4, digitChar=8 };
+ static TVCodePageCol *CodePages;
+ static ushort CPTable[257];
+ static int curAppCP,curScrCP,curInpCP;
+ static int defAppCP,defScrCP,defInpCP;
+ static uchar toUpperTable[256];
+ static uchar toLowerTable[256];
+ static uchar AlphaTable[256];
+ static uchar Similar[];
+ static ushort Similar2[];
+ static char NeedsOnTheFlyRemap;
+ static uchar OnTheFlyMap[256];
+ static char NeedsOnTheFlyInpRemap;
+ static uchar OnTheFlyInpMap[256];
+ static TVCodePageCallBack UserHook;
+ static stIntCodePairs InternalMap[];
+ static const int providedUnicodes;
+ // CodePage structures
+ static CodePage stPC437;
+ static CodePage stPC775;
+ static CodePage stPC850;
+ static CodePage stPC852;
+ static CodePage stPC857;
+ static CodePage stPC860;
+ static CodePage stPC861;
+ static CodePage stPC863;
+ static CodePage stPC865;
+ static CodePage ISO8879_1;
+ static CodePage ISO8859_1_Lat1;
+ static CodePage ISO8859_1u_Lat1;
+ static CodePage ISO8879_2;
+ static CodePage ISO8859_2_Lat2;
+ static CodePage ISO8859_2u_Lat2;
+ static CodePage ISO8859_2_Sun;
+ static CodePage ISO8859_2e_Lat2;
+ static CodePage ISO8859_3;
+ static CodePage ISO8859_4;
+ static CodePage ISO8859_9;
+ static CodePage ISO8859_14;
+ static CodePage ISO8859_15;
+ static CodePage stPC1250;
+ static CodePage stPC1252;
+ static CodePage stPC1254;
+ static CodePage stPC1257;
+ static CodePage stMazovia;
+ static CodePage stPC855;
+ static CodePage stPC866;
+ static CodePage ISO8859_5;
+ static CodePage KOI_8r;
+ static CodePage KOI_8crl;
+ static CodePage PC1251;
+ static CodePage ISO_IR_111;
+ static CodePage ISO_IR_153;
+ static CodePage CP10007;
+ static CodePage CP100072;
+ static CodePage OVR;
+ static CodePage AVR;
+ static CodePage U_CodeR;
+ static CodePage KOI_7;
+ static CodePage ISO_IR_147;
+ static CodePage ISO_IR_146;
+ static CodePage stPC737;
+ static CodePage stPC869;
+ static CodePage stPC1253;
+ static CodePage ISO8859_7;
+ static ushort LowCrazyCharsRemaped[];
+ static ushort Low32CharsRemaped[];
+ static ushort tbKOI7[];
+ static ushort tbISOIR147[];
+ static ushort tbISOIR146[];
+ static uchar High32FramesSwap[];
+
+ friend class TScreen;
+ friend class TDisplay;
+};
+
+#endif
+
diff --git a/tvision/include/tv/collectn.h b/tvision/include/tv/collectn.h
new file mode 100644
index 0000000..1cb2cbe
--- /dev/null
+++ b/tvision/include/tv/collectn.h
@@ -0,0 +1,60 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TCollection ) && !defined( __TCollection )
+#define __TCollection
+
+class CLY_EXPORT TCollection : public virtual TNSCollection
+#if !defined( NO_STREAM )
+ , public TStreamable
+#endif // NO_STREAM
+{
+
+public:
+
+ TCollection( ccIndex aLimit, ccIndex aDelta )
+ { delta = aDelta; setLimit( aLimit ); }
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+ virtual void *readItem( ipstream& ) = 0;
+ virtual void writeItem( void *, opstream& ) = 0;
+
+
+protected:
+
+ TCollection( StreamableInit );
+ virtual void *read( ipstream& );
+ virtual void write( opstream& );
+
+public:
+
+ static const char * const name;
+#endif // NO_STREAM
+};
+
+inline ipstream& operator >> ( ipstream& is, TCollection& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TCollection*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TCollection& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TCollection* cl )
+ { return os << (TStreamable *)cl; }
+
+#endif // Uses_TCollection
+
diff --git a/tvision/include/tv/colorsel.h b/tvision/include/tv/colorsel.h
new file mode 100644
index 0000000..5d56af6
--- /dev/null
+++ b/tvision/include/tv/colorsel.h
@@ -0,0 +1,83 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if !defined( __COLOR_COMMAND_CODES )
+#define __COLOR_COMMAND_CODES
+
+const ushort
+ cmColorForegroundChanged = 71,
+ cmColorBackgroundChanged = 72,
+ cmColorSet = 73,
+ cmNewColorItem = 74,
+ cmNewColorIndex = 75,
+ cmTryColors = 76,
+ cmUpdateColorsChanged = 77;
+
+#endif // __COLOR_COMMAND_CODES
+
+class TColorItem;
+class TColorGroup;
+
+CLY_EXPORT TColorItem& operator + ( TColorItem& i1, TColorItem& i2 );
+CLY_EXPORT TColorGroup& operator + ( TColorGroup& g, TColorItem& i );
+CLY_EXPORT TColorGroup& operator + ( TColorGroup& g1, TColorGroup& g2 );
+
+#if defined( Uses_TColorItem )
+
+#include <tv/clritem.h>
+
+#endif
+
+#if defined( Uses_TColorGroup )
+
+#include <tv/clrgroup.h>
+
+#endif
+
+#if defined( Uses_TColorSelector )
+
+#include <tv/clrselct.h>
+
+#endif
+
+#if defined( Uses_TMonoSelector )
+
+#include <tv/mnoselct.h>
+
+#endif
+
+#if defined( Uses_TColorDisplay )
+
+#include <tv/clrdisp.h>
+
+#endif
+
+#if defined( Uses_TColorGroupList )
+
+#include <tv/clrgrpli.h>
+
+#endif
+
+#if defined( Uses_TColorItemList )
+
+#include <tv/clriteml.h>
+
+#endif
+
+#if defined( Uses_TColorDialog )
+
+#include <tv/clrdlg.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/configfile.h b/tvision/include/tv/configfile.h
new file mode 100644
index 0000000..adba7c9
--- /dev/null
+++ b/tvision/include/tv/configfile.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+
+ Copyright 2002 by Salvador Eduardo Tropea (SET)
+ This file is covered by the GPL license.
+ For more information read configfile.cc
+
+***************************************************************************/
+
+#if defined(Uses_TVConfigFile) && !defined(TVConfigFile_Included)
+#define TVConfigFile_Included
+
+// Structure for a node
+struct TVConfigFileTreeNode
+{
+ char type;
+ char priority;
+ union
+ {
+ long integer;
+ char *string;
+ TVConfigFileTreeNode *content;
+ };
+ char *name;
+ TVConfigFileTreeNode *next;
+};
+
+class CLY_EXPORT TVConfigFile
+{
+public:
+ TVConfigFile();
+ ~TVConfigFile() { FreeTree(); };
+ int Load(const char *file) { ErrorStatus=Read(file); return ErrorStatus; };
+
+ // Priorities 0 to 100
+ enum Priority { justHint=25, fromFile=50, fromApplication=75 };
+
+ int Search(const char *key, char *&p, long &n);
+ int AddInt(const char *key, const char *name, long value, int priority);
+ int AddString(const char *key, const char *name, const char *value, int priority);
+ // Just for debug purposes
+ void Print(FILE *f);
+
+ int ErrorLine;
+ int ErrorStatus;
+ static const char *Errors[];
+
+protected:
+ TVConfigFileTreeNode tree;
+ FILE *f;
+ char *s, *line;
+ size_t sLine;
+
+ void PrintBranch(TVConfigFileTreeNode *base, int indent, FILE *f);
+ void PrintIndent(int indent, FILE *f);
+ int EatSpaces();
+ int GetLine();
+ TVConfigFileTreeNode
+ *NewBranch(const char *name, int len);
+ char *GetString();
+ long GetInteger();
+ int ReadBranch(TVConfigFileTreeNode *&base);
+ int ReadBase(TVConfigFileTreeNode *&base);
+ int SearchInBranch(TVConfigFileTreeNode *b, char *key, char *&p, long &n);
+TVConfigFileTreeNode *
+ SearchOnlyInBranch(TVConfigFileTreeNode *b, char *name, int len);
+TVConfigFileTreeNode *
+ SearchOnlyInBranch(TVConfigFileTreeNode *b, char *name);
+ int Read(const char *file);
+ void FreeList(TVConfigFileTreeNode *p);
+ void FreeTree();
+ int Add(const char *key, TVConfigFileTreeNode *node);
+
+ static int IsWordChar(int val);
+ static char *newStrL(const char *start, int len);
+};
+
+// This is a special case to configure the library
+class CLY_EXPORT TVMainConfigFile
+{
+public:
+ TVMainConfigFile();
+ ~TVMainConfigFile();
+ static int Load();
+ static Boolean Search(const char *key, long &val);
+ static Boolean Search(const char *section, const char *variable, long &val);
+ static char *Search(const char *key);
+ static char *Search(const char *section, const char *variable);
+ static int Add(const char *key, const char *name, long value);
+ static int Add(const char *key, const char *name, const char *value);
+ static void Print(FILE *f) { config->Print(f); };
+ static void SetUserConfigFile(const char *name) { userConfigFile=name; };
+
+protected:
+ static TVConfigFile *config;
+ static char *TestForFileIn(const char *where);
+ static const char *userConfigFile;
+};
+#endif
+
diff --git a/tvision/include/tv/desktop.h b/tvision/include/tv/desktop.h
new file mode 100644
index 0000000..870a306
--- /dev/null
+++ b/tvision/include/tv/desktop.h
@@ -0,0 +1,94 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea, tile, options, cursor behavior, etc.
+
+ *
+ *
+ */
+
+#if defined( Uses_TDeskTop ) && !defined( __TDeskTop )
+#define __TDeskTop
+
+// SET: To set the tile partition priority
+const unsigned dsktTileVertical=1, dsktTileHorizontal=0;
+
+class TBackground;
+class TRect;
+struct TEvent;
+
+class TDeskInit
+{
+public:
+ TDeskInit( TBackground *(*cBackground)( TRect ) );
+
+protected:
+ TBackground *(*createBackground)( TRect );
+};
+
+class CLY_EXPORT TDeskTop : public TGroup, public virtual TDeskInit
+{
+
+public:
+
+ TDeskTop( const TRect& );
+
+ void cascade( const TRect& );
+ virtual void handleEvent( TEvent& );
+ static TBackground *initBackground( TRect );
+ void tile( const TRect& );
+ virtual void tileError();
+ virtual void shutDown();
+ TBackground *getBackground(void) { return background; }
+ // SET: Added to setup the tileable options
+ unsigned getOptions() { return flagsOptions; }
+ void setOptions(unsigned aFlags) { flagsOptions=aFlags; }
+ virtual Boolean canShowCursor();
+ // SET: Added to help Braille Terminals
+ virtual ushort execView( TView *p );
+
+ // SET: Made non-constant and added original
+ static char defaultBkgrnd;
+ static char odefaultBkgrnd;
+
+protected:
+
+ TBackground *background;
+ unsigned flagsOptions;
+
+private:
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDeskTop( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TDeskTop& cl )
+ { return is >> (TStreamable&)(TGroup&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDeskTop*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDeskTop& cl )
+ { return os << (TStreamable&)(TGroup&)cl; }
+inline opstream& operator << ( opstream& os, TDeskTop* cl )
+ { return os << (TStreamable *)(TGroup *)cl; }
+#endif // NO_STREAM
+
+#endif
+
diff --git a/tvision/include/tv/dialog.h b/tvision/include/tv/dialog.h
new file mode 100644
index 0000000..3c4a567
--- /dev/null
+++ b/tvision/include/tv/dialog.h
@@ -0,0 +1,98 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TDialog */
+/* */
+/* Palette layout */
+/* 1 = Frame passive */
+/* 2 = Frame active */
+/* 3 = Frame icon */
+/* 4 = ScrollBar page area */
+/* 5 = ScrollBar controls */
+/* 6 = StaticText */
+/* 7 = Label normal */
+/* 8 = Label selected */
+/* 9 = Label shortcut */
+/* 10 = Button normal */
+/* 11 = Button default */
+/* 12 = Button selected */
+/* 13 = Button disabled */
+/* 14 = Button shortcut */
+/* 15 = Button shadow */
+/* 16 = Cluster normal */
+/* 17 = Cluster selected */
+/* 18 = Cluster shortcut */
+/* 19 = InputLine normal text */
+/* 20 = InputLine selected text */
+/* 21 = InputLine arrows */
+/* 22 = History arrow */
+/* 23 = History sides */
+/* 24 = HistoryWindow scrollbar page area */
+/* 25 = HistoryWindow scrollbar controls */
+/* 26 = ListViewer normal */
+/* 27 = ListViewer focused */
+/* 28 = ListViewer selected */
+/* 29 = ListViewer divider */
+/* 30 = InfoPane */
+/* 31 = Cluster disabled */
+/* 32 = Reserved */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TDialog ) && !defined( __TDialog )
+#define __TDialog
+
+class TRect;
+struct TEvent;
+
+class CLY_EXPORT TDialog : public TWindow
+{
+
+public:
+
+ TDialog( const TRect& bounds, const char *aTitle );
+
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual Boolean valid( ushort command );
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDialog( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TDialog& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDialog*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDialog& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDialog* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TDialog
+
diff --git a/tvision/include/tv/dialogs.h b/tvision/include/tv/dialogs.h
new file mode 100644
index 0000000..858c53e
--- /dev/null
+++ b/tvision/include/tv/dialogs.h
@@ -0,0 +1,109 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if !defined( __BUTTON_TYPE )
+#define __BUTTON_TYPE
+
+const ushort
+ bfNormal = 0x00,
+ bfDefault = 0x01,
+ bfLeftJust = 0x02,
+ bfBroadcast = 0x04;
+
+#endif // __BUTTON_TYPE
+
+#if defined( Uses_TDialog )
+
+#include <tv/dialog.h>
+
+#endif
+
+#if defined( Uses_TInputLine )
+
+#include <tv/inputln.h>
+
+#endif
+
+#if defined( Uses_TButton )
+
+#include <tv/button.h>
+
+#endif
+
+#if defined( Uses_TSItem )
+
+#include <tv/sitem.h>
+
+#endif
+
+#if defined( Uses_TCluster )
+
+#include <tv/cluster.h>
+
+#endif
+
+#if defined( Uses_TRadioButtons )
+
+#include <tv/radiobtn.h>
+
+#endif
+
+#if defined( Uses_TCheckBoxes )
+
+#include <tv/checkbox.h>
+
+#endif
+
+#if defined( Uses_TListBox )
+
+#include <tv/listbox.h>
+
+#endif
+
+#if defined( Uses_TStaticText )
+
+#include <tv/sttctext.h>
+
+#endif
+
+#if defined( Uses_TParamText )
+
+#include <tv/parmtext.h>
+
+#endif
+
+#if defined( Uses_TLabel )
+
+#include <tv/label.h>
+
+#endif
+
+#if defined( Uses_THistoryViewer )
+
+#include <tv/histvwer.h>
+
+#endif
+
+#if defined( Uses_THistoryWindow )
+
+#include <tv/histwind.h>
+
+#endif
+
+#if defined( Uses_THistory )
+
+#include <tv/history.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/dircoll.h b/tvision/include/tv/dircoll.h
new file mode 100644
index 0000000..8c9a229
--- /dev/null
+++ b/tvision/include/tv/dircoll.h
@@ -0,0 +1,88 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TDirCollection ) && !defined( __TDirCollection )
+#define __TDirCollection
+// Avoid replacing free by MSS's macro
+#include <tv/no_mss.h>
+
+class TDirEntry;
+
+class TDirCollection : public TCollection
+{
+
+public:
+
+ TDirCollection( ccIndex aLimit, ccIndex aDelta) :
+ TCollection( aLimit, aDelta ) {}
+
+ TDirEntry *at( ccIndex index )
+ { return (TDirEntry *)TCollection::at( index );}
+
+ void remove( TDirEntry *item )
+ { TCollection::remove( item ); }
+ void free( TDirEntry *item )
+ { TCollection::free( item ); }
+ void atPut( ccIndex index, TDirEntry *item )
+ { TCollection::atPut( index, item ); }
+
+ TDirEntry *firstThat( ccTestFunc Test, void *arg );
+ TDirEntry *lastThat( ccTestFunc Test, void *arg );
+
+private:
+
+ virtual void freeItem( void *item )
+ { delete (TDirEntry *)item; }
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+ virtual void *readItem( ipstream& );
+ virtual void writeItem( void *, opstream& );
+
+protected:
+
+ TDirCollection( StreamableInit ) : TCollection ( streamableInit ) {}
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+#include <tv/yes_mss.h>
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TDirCollection& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDirCollection*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDirCollection& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDirCollection* cl )
+ { return os << (TStreamable *)cl; }
+#endif
+
+inline TDirEntry *TDirCollection::firstThat( ccTestFunc func, void *arg )
+{
+ return (TDirEntry *)TCollection::firstThat( ccTestFunc(func), arg );
+}
+
+inline TDirEntry *TDirCollection::lastThat( ccTestFunc func, void *arg )
+{
+ return (TDirEntry *)TCollection::lastThat( ccTestFunc(func), arg );
+}
+
+#endif // Uses_TDirCollection
+
diff --git a/tvision/include/tv/direntr.h b/tvision/include/tv/direntr.h
new file mode 100644
index 0000000..bfe28fe
--- /dev/null
+++ b/tvision/include/tv/direntr.h
@@ -0,0 +1,51 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TDirEntry ) && !defined( __TDirEntry )
+#define __TDirEntry
+
+class TDirEntry
+{
+
+public:
+
+ TDirEntry( const char *txt, const char *dir, int anOffset=0 );
+ ~TDirEntry();
+ char *dir() { return directory; }
+ char *text() { return displayText; }
+ int offset() { return nameOffset; }
+
+private:
+
+ char *displayText;
+ char *directory;
+ int nameOffset;
+
+};
+
+inline TDirEntry::TDirEntry( const char *txt, const char *dir,
+ int anOffset ) :
+ displayText( newStr( txt ) ),
+ directory( newStr( dir ) ),
+ nameOffset( anOffset )
+{
+}
+
+inline TDirEntry::~TDirEntry()
+{
+ delete[] displayText;
+ delete[] directory;
+}
+
+#endif // Uses_TDirEntry
+
diff --git a/tvision/include/tv/dirlibo.h b/tvision/include/tv/dirlibo.h
new file mode 100644
index 0000000..4c7bef2
--- /dev/null
+++ b/tvision/include/tv/dirlibo.h
@@ -0,0 +1,100 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TDirListBox ) && !defined( __TDirListBox )
+#define __TDirListBox
+
+class TRect;
+class TScrollBar;
+struct TEvent;
+class TDirCollection;
+
+#include <limits.h>
+
+class TDirListBox : public TListBox
+{
+
+public:
+
+ TDirListBox( const TRect& bounds, TScrollBar *aVScrollBar,
+ TScrollBar *aHScrollBar = NULL );
+ ~TDirListBox();
+
+ virtual void getText( char *, ccIndex, short );
+ virtual void handleEvent( TEvent& );
+ virtual Boolean isSelected( ccIndex );
+ void newDirectory( const char * );
+ virtual void setState( ushort aState, Boolean enable );
+ virtual void draw();
+ // SET: Now we use the cursor to help in incremental searches
+ void updateCursorPos();
+
+ TDirCollection *list();
+
+ static char pathDir[];
+ static char firstDir[];
+ static char middleDir[];
+ static char lastDir[];
+ static char graphics[];
+ static char opathDir[];
+ static char ofirstDir[];
+ static char omiddleDir[];
+ static char olastDir[];
+ static char ographics[];
+
+private:
+
+ void showDrives( TDirCollection * );
+ void showDirs( TDirCollection * );
+
+ char dir[PATH_MAX];
+ ushort cur;
+
+ // SET: Incremental search
+ char incremental[PATH_MAX];
+ int incPos;
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDirListBox( StreamableInit ): TListBox( streamableInit ) {}
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TDirListBox& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDirListBox*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDirListBox& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDirListBox* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+inline TDirCollection *TDirListBox::list()
+{
+ return (TDirCollection *)TListBox::list();
+}
+
+#endif // Uses_TDirListBox
+
diff --git a/tvision/include/tv/dos/key.h b/tvision/include/tv/dos/key.h
new file mode 100644
index 0000000..8ec1302
--- /dev/null
+++ b/tvision/include/tv/dos/key.h
@@ -0,0 +1,53 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea
+ Covered by the GPL license.
+
+ Description:
+ Keyboard `driver' classes for DOS.
+
+***************************************************************************/
+
+#if defined(TVCompf_djgpp) && !defined(DOSKEY_HEADER_INCLUDED)
+#define DOSKEY_HEADER_INCLUDED
+struct TEvent;
+
+// A class to encapsulate the globals, all is static!
+class TGKeyDOS : public TGKey
+{
+public:
+ TGKeyDOS() {};
+
+ // Function replacements
+ static unsigned GetShiftStateBIOS();
+ static void ClearBIOS();
+ static unsigned GetShiftStateDirect();
+ static void ClearDirect();
+ static ushort GKey();
+ static void FillTEvent(TEvent &e);
+ static void SetKbdMapping(int version);
+ static int GetKbdMapping(int version);
+
+ // Setup the pointers to point our members
+ static void Init();
+
+protected:
+ // Specific for this driver
+ static void GetRawBIOS(void);
+ static void GetRawDirect(void);
+ static void (*GetRaw)(void);
+ static int KbHitBIOS();
+ static int KbHitDirect();
+ static int InternationalToKey(uchar ascii);
+ static int Abstract;
+ static char ascii;
+ static ushort sFlags;
+ static KeyType rawCode;
+ static int useBIOS;
+ static int translateKeyPad;
+ static const uchar kbWithASCII0[256];
+ static const uchar kbWithASCIIE0[256];
+ static char useFixKbdBuffer;
+};
+#endif // DOSKEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/dos/mouse.h b/tvision/include/tv/dos/mouse.h
new file mode 100644
index 0000000..bc532a5
--- /dev/null
+++ b/tvision/include/tv/dos/mouse.h
@@ -0,0 +1,94 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2001-2002 by Salvador E. Tropea
+
+ Description:
+ That's the DOS low level mouse class.
+ It have more than one driver inside that is selected externally.
+ 1) It can use a mouse callback or poll the mouse.
+ 2) It can let the mouse driver draw the cursor or do it in the class.
+
+***************************************************************************/
+
+#if defined(TVCompf_djgpp) && !defined(DOSMOUSE_HEADER_INCLUDED)
+#define DOSMOUSE_HEADER_INCLUDED
+
+class THWMouseDOS : public THWMouse
+{
+protected:
+ THWMouseDOS() {};
+ virtual ~THWMouseDOS();
+
+ static void ShowDrv();
+ static void HideDrv();
+ static void ShowEmulate();
+ static void HideEmulate();
+ static void Suspend();
+ static void Resume();
+ static void GetEvent(MouseEventType &me);
+ static void RegisterHandler(unsigned, void (*)());
+ static void SetRange(ushort, ushort);
+ static int DrawMouseDummy(int x, int y);
+ static int DrawMouseEmulate(int x, int y);
+
+ friend class TDisplayDOS;
+ friend class TScreenDOS;
+
+ // Specific for this driver:
+ // Choose if the mouse will be emulated or the OS driver will draw it.
+ // Must be called when mouse isn't visible.
+ static void setEmulation(int emulate);
+ // Sets the start of video memory (only needed for emulated mouse)
+ static void setScreenBase(ulong base);
+ // Functions used to draw the mouse in the driver
+ static volatile void getMouseChar();
+ static volatile void setMouseChar();
+ static volatile void resetMouseChar();
+ static volatile void showMouseChar();
+ // Used to force a mouse draw by the driver when emulateMouse!=0
+ //static volatile int drawMouse(int x, int y);
+ // Low level functions to save/restore mouse state of the OS
+ static void biosRestoreState();
+ static void biosSaveState();
+ // Low level functions to save/restore "my" mouse state
+ static int biosRestoreMyState();
+ static void biosSaveMyState();
+
+ // Address of the start of video memory, use setScreenBase()
+ static ulong screenBase;
+ // Variables needded to draw the mouse pointer in the driver:
+ static ushort mouseChar; // Character under pointer
+ static int lastX,lastY; // Position of the saved mouseChar
+ static int cols; // Screen width, set by setRange
+ // Variables used to save/restore mouse state
+ static int bufferSegment;
+ static int bufferSelector;
+ static int bufferSize;
+ static int bufferAllocated;
+ static int myBufferSegment;
+ static int myBufferSelector;
+ static int myBufferSize;
+ static int myBufferAllocated;
+ // !=0 if the mouse will be drawn by the driver, use setEmulation()
+ static char emulateMouse;
+ // Number of buttons, needed to restore it in resume
+ static uchar myButtonCount;
+
+public:
+ // Needed to initialize it.
+ static void Init();
+ static void DeInit();
+ // Indicates if the initialization will install a Real Mode Callback to
+ // hook the mouse. That's enabled by default when the OS isn't Win NT.
+ // Set it to 0 before initialization to avoid hooking the mouse.
+ static char useMouseHandler;
+ // This structure hold the mouse event generated by a mouse callback.
+ static MouseEventType intEvent;
+ // Nasty hack used by TEventQueue to read the interrupt information and
+ // draw the mouse pointer
+ static int getRMCB_InfoDraw(int &buttonPress);
+};
+
+#endif // DOSMOUSE_HEADER_INCLUDED
+
+
diff --git a/tvision/include/tv/dos/screen.h b/tvision/include/tv/dos/screen.h
new file mode 100644
index 0000000..4ab6482
--- /dev/null
+++ b/tvision/include/tv/dos/screen.h
@@ -0,0 +1,185 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2001-2002 by Salvador E. Tropea
+
+ Description:
+ Display and Screen `driver' classes for DOS.
+
+***************************************************************************/
+
+#if defined(TVCompf_djgpp) && !defined(DOS_SCREEN_HEADER_INCLUDED)
+#define DOS_SCREEN_HEADER_INCLUDED
+class THWMouseDOS;
+class TVDOSClipboard;
+
+// virtual to avoid problems with multiple inheritance
+class TDisplayDOS : virtual public TDisplay
+{
+protected:
+ TDisplayDOS() {};
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TDisplayDOS();
+ // This sets the pointers of TDisplay to point to this class
+ static void Init();
+
+ // Behaviors to replace TDisplay
+ static void SetCursorPos(unsigned x, unsigned y);
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ static void SetCursorShape(unsigned start, unsigned end);
+ static void ClearScreen(uchar, uchar);
+ static ushort GetRows();
+ static ushort GetCols();
+ static void SetCrtMode(ushort mode);
+ static ushort GetCrtMode();
+ static void SetCrtModeExt(char *mode);
+ static int SetCrtModeRes(unsigned w, unsigned h, int fW, int fH);
+ // Not available static int CheckForWindowSize(void);
+ static
+ const char *GetWindowTitle(void);
+ static int SetWindowTitle(const char *name);
+ static int SetDisPaletteColors(int from, int number, TScreenColor *colors);
+ static void GetDisPaletteColors(int from, int number, TScreenColor *colors);
+ static void Beep();
+
+ // Function members for this driver
+ // Calls the BIOS 0x10 interrupt (Video service)
+ static void videoInt() { __dpmi_int(0x10,&rDisplay); };
+ // Finds the number of lines per char
+ static int getCharLines();
+ // Special videoInt to workaround a bug in NT's TXProII driver
+ static void setVideoModeInt();
+ // Selects a text mode, it detects if the mode is VESA
+ static void setTextMode();
+ // Select the number of scanlines and font to use.
+ // Used to set extended video modes, like 80x50.
+ static void setExtendedMode(int mode);
+ // Is used to test if a mode that we don't know can be handled by the driver
+ // or not. If the mode uses an unknown memory region we just assume that's
+ // a graphics mode and revert to 80x25. It could be enhanced.
+ static void testForSupport();
+ // Selects a VESA or user provided video mode.
+ static void setTextMode(int mode);
+ // Sets a tweaked video mode
+ static int setTweakedMode(int mode);
+ // Reads the palette map
+ static void getPaletteMap(char *map);
+ // Low level BIOS calls to get/set one palette index
+ static void setOnePaletteIndex(int index, TScreenColor *col);
+ static void getOnePaletteIndex(int index, TScreenColor *col);
+ static int dosInt() { return __dpmi_int(0x21,&rDisplay); };
+
+ // Data members for this driver
+ static __dpmi_regs rDisplay;
+ static unsigned charLines;
+ static char emulateMouse;
+ // The 16 available colors are a subset of the 256 colors the VGA controller
+ // handles. Additionally the border color is defined in this map.
+ // The following map indicates which palette index is associated with
+ // each palette index.
+ static char colorsMap[17];
+
+ friend class TVDOSClipboard;
+};
+
+
+// With this order the destructor will be called first for TScreenDOS,
+// TScreen, TDisplayDOS and finally TDisplay.
+class TScreenDOS : public TDisplayDOS, public TScreen
+{
+public:
+ TScreenDOS();
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TScreenDOS();
+
+ // Is that really used?
+ static int slowScreen;
+
+ friend class TDisplayDOS; // *=-P
+
+protected:
+ static void Resume();
+ static void Suspend();
+ static void setCrtData();
+ static void clearScreen();
+ static void getCharacters(unsigned offset,ushort *buf,unsigned count);
+ static ushort getCharacter(unsigned dst);
+ static void setCharacter(unsigned offset,ushort value);
+ static void setCharacters(unsigned dst,ushort *src,unsigned len);
+ static int System(const char *command, pid_t *pidChild, int in, int out,
+ int err);
+ static int GetFontGeometry(unsigned &w, unsigned &h);
+ static int SetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP=-1, int appCP=-1);
+ static void RestoreFonts();
+
+ // Fonts stuff
+ static void SetDualCharacter(int b1, int b2);
+ static void EnableDualFont() { SetDualCharacter(0,1); };
+ static void DisableDualFont() { SetDualCharacter(0,0); };
+ static void SetFontBIOS(int which, unsigned height, uchar *data, int modeRecalculate);
+ static int Load8x10Font(int which, int modeRecalculate);
+ static void MaybeCreate8x10Font(void);
+ static void SetRomFonts(int sizeFont, int which, int modeRecalculate);
+ static int SelectRomFont(int height, int which, int modeRecalculate);
+ static void ReleaseMemFonts();
+ static int MemorizeFont(int which, TScreenFont256 *font);
+ static void SuspendFonts();
+ static void ResumeFonts();
+ static void SelectFont(unsigned height, Boolean Force=False);
+ static uchar primaryFontSet,secondaryFontSet;
+ static uchar fontsSuspended;
+ static int origCPScr, origCPApp, origCPInp;
+ static int fontSeg; // segment of DOS buffer for 8x10 font
+ static TScreenFont256 appFonts[2];
+
+ // Status before suspending
+ static int wasBlink;
+};
+
+class TVDOSClipboard
+{
+public:
+ TVDOSClipboard() {};
+
+protected:
+ // Replacements for the TVOSClipboard class
+ static int copy(int id, const char *buffer, unsigned len);
+ static char *paste(int id, unsigned &length);
+
+ // Members for this class
+ static int Init();
+ static int AllocateDOSMem(unsigned long size, unsigned long *BaseAddress);
+ static void FreeDOSMem(unsigned long Address);
+ static int MultiplexInt() { return __dpmi_int(0x2F,&TDisplayDOS::rDisplay); };
+
+ static const
+ char *dosNameError[];
+ static int isValid;
+ static int Version;
+
+ friend class TScreenDOS;
+};
+
+#ifdef TSCREEN_DEFINE_REGISTERS
+#define r (TDisplayDOS::rDisplay)
+#define AL (r.h.al)
+#define BL (r.h.bl)
+#define CL (r.h.cl)
+#define DL (r.h.dl)
+#define AH (r.h.ah)
+#define BH (r.h.bh)
+#define CH (r.h.ch)
+#define DH (r.h.dh)
+#define AX (r.x.ax)
+#define BX (r.x.bx)
+#define CX (r.x.cx)
+#define DX (r.x.dx)
+#define DI (r.x.di)
+#define SI (r.x.si)
+#define BP (r.x.bp)
+#define ES (r.x.es)
+#endif // TSCREEN_DEFINE_REGISTERS
+
+#endif // DOS_SCREEN_HEADER_INCLUDED
diff --git a/tvision/include/tv/drawbuf.h b/tvision/include/tv/drawbuf.h
new file mode 100644
index 0000000..09f1094
--- /dev/null
+++ b/tvision/include/tv/drawbuf.h
@@ -0,0 +1,53 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TDrawBuffer ) && !defined( __TDrawBuffer )
+#define __TDrawBuffer
+
+class CLY_EXPORT TDrawBuffer
+{
+
+ friend class TView;
+
+public:
+
+ void moveChar( unsigned indent, char c, unsigned attr, unsigned count );
+ void moveStr( unsigned indent, const char *str, unsigned attrs );
+ void moveCStr( unsigned indent, const char *str, unsigned attrs );
+ void moveBuf( unsigned indent, const void *source,
+ unsigned attr, unsigned count );
+
+ void putAttribute( unsigned indent, unsigned attr );
+ void putChar( unsigned indent, unsigned c );
+
+protected:
+
+ ushort data[maxViewWidth];
+
+};
+
+#define loByte(w) (((uchar *)&w)[0])
+#define hiByte(w) (((uchar *)&w)[1])
+
+inline void TDrawBuffer::putAttribute( unsigned indent, unsigned attr )
+{
+ hiByte(data[indent]) = (uchar)attr;
+}
+
+inline void TDrawBuffer::putChar( unsigned indent, unsigned c )
+{
+ loByte(data[indent]) = (uchar)c;
+}
+
+#endif // Uses_TDrawBuffer
+
diff --git a/tvision/include/tv/drivers.h b/tvision/include/tv/drivers.h
new file mode 100644
index 0000000..3efefca
--- /dev/null
+++ b/tvision/include/tv/drivers.h
@@ -0,0 +1,14 @@
+typedef TScreen *(*drvChecker)();
+
+extern TScreen *TV_DOSDriverCheck();
+extern TScreen *TV_LinuxDriverCheck();
+extern TScreen *TV_QNXRtPDriverCheck();
+extern TScreen *TV_QNX4DriverCheck();
+extern TScreen *TV_UNIXDriverCheck();
+extern TScreen *TV_WinGrDriverCheck();
+extern TScreen *TV_Win32DriverCheck();
+extern TScreen *TV_WinNTDriverCheck();
+extern TScreen *TV_XDriverCheck();
+extern TScreen *TV_XTermDriverCheck();
+extern TScreen *TV_AlconDriverCheck();
+
diff --git a/tvision/include/tv/editors.h b/tvision/include/tv/editors.h
new file mode 100644
index 0000000..4cd444e
--- /dev/null
+++ b/tvision/include/tv/editors.h
@@ -0,0 +1,532 @@
+/***************************************************************/
+/* */
+/* this header-file was modified by Robert Hoehne */
+/* to use it with DJ's port of gcc */
+/* */
+/***************************************************************/
+/* ------------------------------------------------------------------------*/
+/* */
+/* EDITORS.H */
+/* */
+/* Copyright (c) Borland International 1991 */
+/* All Rights Reserved. */
+/* */
+/* defines the classes TIndicator, TEditor, TMemo, TFileEditor, */
+/* and TEditWindow */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if !defined( __EDIT_COMMAND_CODES )
+#define __EDIT_COMMAND_CODES
+
+const int
+ ufUpdate = 0x01,
+ ufLine = 0x02,
+ ufView = 0x04;
+
+const int
+ smExtend = 0x01,
+ smDouble = 0x02;
+
+const unsigned
+ sfSearchFailed = UINT_MAX;
+
+const int
+ cmSave = 80,
+ cmSaveAs = 81,
+ cmFind = 82,
+ cmReplace = 83,
+ cmSearchAgain = 84;
+
+const int
+ cmCharLeft = 500,
+ cmCharRight = 501,
+ cmWordLeft = 502,
+ cmWordRight = 503,
+ cmLineStart = 504,
+ cmLineEnd = 505,
+ cmLineUp = 506,
+ cmLineDown = 507,
+ cmPageUp = 508,
+ cmPageDown = 509,
+ cmTextStart = 510,
+ cmTextEnd = 511,
+ cmNewLine = 512,
+ cmBackSpace = 513,
+ cmDelChar = 514,
+ cmDelWord = 515,
+ cmDelStart = 516,
+ cmDelEnd = 517,
+ cmDelLine = 518,
+ cmInsMode = 519,
+ cmStartSelect = 520,
+ cmHideSelect = 521,
+ cmIndentMode = 522,
+ cmUpdateTitle = 523,
+ cmInsertText = 524;
+
+const int
+ edOutOfMemory = 0,
+ edReadError = 1,
+ edWriteError = 2,
+ edCreateError = 3,
+ edSaveModify = 4,
+ edSaveUntitled = 5,
+ edSaveAs = 6,
+ edFind = 7,
+ edSearchFailed = 8,
+ edReplace = 9,
+ edReplacePrompt = 10;
+
+const int
+ efCaseSensitive = 0x0001,
+ efWholeWordsOnly = 0x0002,
+ efPromptOnReplace = 0x0004,
+ efReplaceAll = 0x0008,
+ efDoReplace = 0x0010,
+ efBackupFiles = 0x0100;
+
+const int
+ maxLineLength = 256;
+
+// SET: Added these old constants here
+const unsigned
+ cmOpen = 100,
+ cmNew = 101,
+ cmChangeDrct = 102,
+ cmDosShell = 103,
+ cmCalculator = 104,
+ cmShowClip = 105,
+ cmMacros = 106;
+
+#endif // __EDIT_COMMAND_CODES
+
+#if defined( Uses_TIndicator ) && !defined( __TIndicator )
+#define __TIndicator
+
+class far TRect;
+
+class TIndicator : public TView
+{
+
+public:
+
+ TIndicator( const TRect& );
+
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void setState( ushort, Boolean );
+ void setValue( const TPoint&, Boolean );
+
+protected:
+
+ TPoint location;
+ Boolean modified;
+
+#ifndef NO_STREAM
+
+private:
+
+ static const char near dragFrame;
+ static const char near normalFrame;
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TIndicator( StreamableInit );
+
+public:
+
+ static const char * const near name;
+ static TStreamable *build();
+
+#endif
+};
+
+#ifndef NO_STREAM
+
+inline ipstream& operator >> ( ipstream& is, TIndicator& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TIndicator*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TIndicator& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TIndicator* cl )
+ { return os << (TStreamable *)cl; }
+
+#endif // NO_STREAM
+
+#endif // Uses_TIndicator
+
+
+#if defined( Uses_TEditor ) && !defined( __TEditor )
+#define __TEditor
+
+typedef ushort (*TEditorDialog)( int, ... );
+ushort defEditorDialog( int dialog, ... );
+
+class TRect;
+class TScrollBar;
+class TIndicator;
+struct TEvent;
+
+class TEditor : public TView
+{
+
+public:
+
+ TEditor( const TRect&, TScrollBar *, TScrollBar *, TIndicator *, uint32 );
+ virtual ~TEditor();
+
+ virtual void shutDown();
+
+ char bufChar( uint32 );
+ uint32 bufPtr( uint32 );
+ virtual void changeBounds( const TRect& );
+ virtual void convertEvent( TEvent& );
+ Boolean cursorVisible();
+ void deleteSelect();
+ virtual void doneBuffer();
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& );
+ virtual void initBuffer();
+ Boolean insertBuffer( char *, uint32, uint32, Boolean, Boolean );
+ virtual Boolean insertFrom( TEditor * );
+ Boolean insertText( const void *, uint32, Boolean );
+ void scrollTo( int, int );
+ Boolean search( const char *, ushort );
+ virtual Boolean setBufSize( uint32 );
+ void setCmdState( ushort, Boolean );
+ void setSelect( uint32, uint32, Boolean);
+ virtual void setState( ushort, Boolean );
+ void trackCursor( Boolean );
+ void undo();
+ virtual void updateCommands();
+ virtual Boolean valid( ushort );
+
+ int charPos( uint32, uint32 );
+ uint32 charPtr( uint32, int );
+ Boolean clipCopy();
+ void clipCut();
+ void clipPaste();
+ void deleteRange( uint32, uint32, Boolean );
+ void doUpdate();
+ void doSearchReplace();
+ void drawLines( int, int, uint32 );
+ virtual void formatLine(void *, uint32, int, ushort );
+ void find();
+ uint32 getMousePtr( TPoint );
+ Boolean hasSelection();
+ void hideSelect();
+ Boolean isClipboard();
+ uint32 lineEnd( uint32 );
+ uint32 lineMove( uint32, int );
+ uint32 lineStart( uint32 );
+ void lock();
+ void newLine();
+ uint32 nextChar( uint32 );
+ uint32 nextLine( uint32 );
+ uint32 nextWord( uint32 );
+ uint32 prevChar( uint32 );
+ uint32 prevLine( uint32 );
+ uint32 prevWord( uint32 );
+ void replace();
+ void setBufLen( uint32 );
+ void setCurPtr( uint32, uchar );
+ void startSelect();
+ void toggleInsMode();
+ void unlock();
+ void update( uchar );
+ void checkScrollBar( const TEvent&, TScrollBar *, int& );
+
+ TScrollBar *hScrollBar;
+ TScrollBar *vScrollBar;
+ TIndicator *indicator;
+ char *buffer;
+ uint32 bufSize;
+ uint32 bufLen;
+ uint32 gapLen;
+ uint32 selStart;
+ uint32 selEnd;
+ uint32 curPtr;
+ TPoint curPos;
+ TPoint delta;
+ TPoint limit;
+ int drawLine;
+ uint32 drawPtr;
+ uint32 delCount;
+ uint32 insCount;
+ Boolean isValid;
+ Boolean canUndo;
+ Boolean modified;
+ Boolean selecting;
+ Boolean overwrite;
+ Boolean autoIndent;
+
+ static TEditorDialog editorDialog;
+ static ushort editorFlags;
+ static char findStr[maxFindStrLen];
+ static char replaceStr[maxReplaceStrLen];
+ static TEditor * clipboard;
+ static uint32 tabSize;
+ uchar lockCount;
+ uchar updateFlags;
+ int keyState;
+
+#ifndef NO_STREAM
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TEditor( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+#endif
+};
+
+#ifndef NO_STREAM
+inline ipstream& operator >> ( ipstream& is, TEditor& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TEditor*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TEditor& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TEditor* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TEditor
+
+#if defined( Uses_TMemo ) && !defined( __TMemo )
+#define __TMemo
+
+struct TEvent;
+
+struct TMemoData
+{
+ uint32 length;
+ char buffer[65536];
+};
+
+class TMemo : public TEditor
+{
+
+public:
+
+ TMemo( const TRect&, TScrollBar *, TScrollBar *, TIndicator *, uint32 );
+ virtual void getData( void *rec );
+ virtual void setData( void *rec );
+ virtual uint32 dataSize();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& );
+
+#ifndef NO_STREAM
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TMemo( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+#endif // NO_STREAM
+};
+
+#ifndef NO_STREAM
+inline ipstream& operator >> ( ipstream& is, TMemo& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TMemo*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TMemo& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TMemo* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TMemo
+
+
+#if defined( Uses_TFileEditor ) && !defined( __TFileEditor )
+#define __TFileEditor
+
+//#include <dir.h>
+
+class TRect;
+class TScrollBar;
+class TIndicator;
+struct TEvent;
+
+class TFileEditor : public TEditor
+{
+
+public:
+
+ char fileName[PATH_MAX];
+ TFileEditor( const TRect&,
+ TScrollBar *,
+ TScrollBar *,
+ TIndicator *,
+ const char *
+ );
+ virtual void doneBuffer();
+ virtual void handleEvent( TEvent& );
+ virtual void initBuffer();
+ Boolean loadFile();
+ Boolean save();
+ Boolean saveAs();
+ Boolean saveFile();
+ virtual Boolean setBufSize( uint32 );
+ virtual void shutDown();
+ virtual void updateCommands();
+ virtual Boolean valid( ushort );
+
+private:
+
+ static const char * backupExt;
+
+#ifndef NO_STREAM
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TFileEditor( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#ifndef NO_STREAM
+inline ipstream& operator >> ( ipstream& is, TFileEditor& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TFileEditor*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TFileEditor& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TFileEditor* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TFileEditor
+
+
+#if defined( Uses_TEditWindow ) && !defined( __TEditWindow )
+#define __TEditWindow
+
+class TFileEditor;
+
+class TEditWindow : public TWindow
+{
+
+public:
+
+ TEditWindow( const TRect&, const char *, int );
+ virtual void close();
+ virtual const char *getTitle( short );
+ virtual void handleEvent( TEvent& );
+ virtual void sizeLimits( TPoint& min, TPoint& max );
+
+ TFileEditor *editor;
+
+private:
+
+ static const char * clipboardTitle;
+ static const char * untitled;
+
+#ifndef NO_STREAM
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TEditWindow( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#ifndef NO_STREAM
+inline ipstream& operator >> ( ipstream& is, TEditWindow& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TEditWindow*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TEditWindow& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TEditWindow* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TEditWindow
+
+
+#if defined( Uses_TFindDialogRec ) && !defined( __TFindDialogRec )
+#define __TFindDialogRec
+
+struct TFindDialogRec
+{
+ TFindDialogRec( const char *str, ushort flgs )
+ {
+ strcpy( find, str );
+ options = flgs;
+ }
+ char find[maxFindStrLen];
+ ushort options;
+};
+
+#endif // Uses_TFindDialogRec
+
+#if defined( Uses_TReplaceDialogRec ) && !defined( __TReplaceDialogRec )
+#define __TReplaceDialogRec
+
+struct TReplaceDialogRec
+{
+ TReplaceDialogRec( const char *str, const char *rep, ushort flgs )
+ {
+ strcpy( find, str );
+ strcpy( replace, rep );
+ options = flgs;
+ }
+ char find[maxFindStrLen];
+ char replace[maxReplaceStrLen];
+ ushort options;
+};
+
+#endif // Uses_TReplaceDialogRec
+
diff --git a/tvision/include/tv/event.h b/tvision/include/tv/event.h
new file mode 100644
index 0000000..0516ef5
--- /dev/null
+++ b/tvision/include/tv/event.h
@@ -0,0 +1,226 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Robert H”hne to be used for RHIDE.
+ * SET: Hardware abstaction with ideas from JASC.
+ *
+ */
+
+#if defined( Uses_TEvent ) && !defined( __TEvent )
+#define __TEvent
+
+struct MouseEventType
+{
+ uchar buttons;
+ Boolean doubleClick;
+ TPoint where;
+};
+
+// This class is the base hardware interface with the mouse and shouldn't
+// be used directly. You should use TMouse instead which is derived from
+// it. That's why most members are protected.
+// See thwmouse.cc
+class CLY_EXPORT THWMouse
+{
+protected:
+ THWMouse();
+ THWMouse(const THWMouse&) {};
+ virtual ~THWMouse();
+
+ static void show();
+ static void hide();
+
+ // Needed by some drivers to communicate the size of the screen.
+ static void (*setRange)(ushort, ushort);
+ static void getEvent(MouseEventType &me);
+ // This function could fail according to the hardware.
+ // In TV 2.0 it just doesn't exist when you compile for 32 bits.
+ static void (*registerHandler)(unsigned, void (*)());
+
+ static void suspend();
+ static void resume();
+
+ // Inline members:
+ // Disable mouse
+ static void inhibit();
+ // Is mouse installed?
+ static Boolean present();
+
+ // SET: To override just part of the behavior:
+ static void (*Show)();
+ static void (*Hide)();
+ static void (*Suspend)();
+ static void (*Resume)();
+ static void (*GetEvent)(MouseEventType &me);
+
+ // SET: This is optional, is only needed if the harware uses forceEvent.
+ static int (*drawMouse)(int x, int y);
+
+ // SET: Default behaviors
+ static void defaultShow();
+ static void defaultHide();
+ static void defaultSetRange(ushort, ushort);
+ static void defaultGetEvent(MouseEventType&);
+ static void defaultRegisterHandler(unsigned, void (*)());
+ static void defaultSuspend();
+ static void defaultResume();
+ static int defaultDrawMouse(int x, int y);
+
+public:
+ // SET: Used to externally force a mouse event.
+ // This is only used internally.
+ static void forceEvent(int x, int y, int buttons);
+
+protected:
+ // This indicates how many buttons have the mouse. Is also used to determine
+ // if the mouse is present, a value of 0 is mouse not available. See the
+ // present() member.
+ static uchar buttonCount;
+ // SET: Suspend sets buttonCount to 0 to disable the mouse. The default
+ // resume behavior is to restore this value.
+ static uchar oldButtonCount;
+ // SET: Just to avoid redundant calls
+ static char visible;
+ // SET: Data used to force an event externally
+ static MouseEventType forcedME;
+ static char forced;
+ static uchar btBeforeForce;
+
+ // SET: Moved to the protected section
+ static Boolean handlerInstalled;
+ static Boolean noMouse;
+ // The following counter is incremented when the mouse pointer is updated
+ // by the driver. Only useful when done asynchronically.
+ static volatile unsigned drawCounter;
+};
+
+inline Boolean THWMouse::present()
+{
+ return Boolean(buttonCount!=0);
+}
+
+inline void THWMouse::inhibit()
+{
+ noMouse=True;
+}
+
+// This class exposses the mouse interface.
+class CLY_EXPORT TMouse : public THWMouse
+{
+public:
+ TMouse();
+ ~TMouse();
+
+ static void show();
+ static void hide();
+
+ static void suspend();
+ static void resume();
+
+ static void setRange( ushort, ushort );
+
+ static void getEvent( MouseEventType& );
+ static void registerHandler( unsigned, void (*)() );
+ static Boolean present();
+
+ static void resetDrawCounter();
+ static unsigned getDrawCounter();
+};
+
+inline void TMouse::show()
+{
+ THWMouse::show();
+}
+
+inline void TMouse::hide()
+{
+ THWMouse::hide();
+}
+
+inline void TMouse::suspend()
+{
+ THWMouse::suspend();
+}
+
+inline void TMouse::resume()
+{
+ THWMouse::resume();
+}
+
+inline void TMouse::setRange(ushort rx, ushort ry)
+{
+ THWMouse::setRange(rx,ry);
+}
+
+inline void TMouse::getEvent(MouseEventType& me)
+{
+ THWMouse::getEvent(me);
+}
+
+inline void TMouse::registerHandler(unsigned mask, void (*func)())
+{
+ THWMouse::registerHandler(mask,func);
+}
+
+inline Boolean TMouse::present()
+{
+ return THWMouse::present();
+}
+
+inline void TMouse::resetDrawCounter()
+{
+ drawCounter=0;
+}
+
+inline unsigned TMouse::getDrawCounter()
+{
+ return drawCounter;
+}
+/****************************************************************************************/
+
+struct CharScanType
+{
+ uchar charCode;
+ uchar scanCode;
+};
+
+struct KeyDownEvent
+{
+ CharScanType charScan;
+ ushort keyCode;
+ ushort shiftState;
+ uchar raw_scanCode;
+};
+
+struct MessageEvent
+{
+ ushort command;
+ union
+ {
+ void *infoPtr;
+ long infoLong;
+ ushort infoWord;
+ short infoInt;
+ uchar infoByte;
+ char infoChar;
+ };
+};
+
+struct TEvent
+{
+ ushort what;
+ union
+ {
+ MouseEventType mouse;
+ KeyDownEvent keyDown;
+ MessageEvent message;
+ };
+ void getMouseEvent();
+ void getKeyEvent();
+};
+
+#endif // Uses_TEvent
+
diff --git a/tvision/include/tv/eventqu.h b/tvision/include/tv/eventqu.h
new file mode 100644
index 0000000..b25bf35
--- /dev/null
+++ b/tvision/include/tv/eventqu.h
@@ -0,0 +1,71 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TEventQueue ) && !defined( __TEventQueue )
+#define __TEventQueue
+
+class CLY_EXPORT TEventQueue
+{
+public:
+ TEventQueue();
+ ~TEventQueue();
+
+ static void getMouseEvent( TEvent& );
+ static void suspend();
+ static void resume();
+
+ friend class TView;
+ friend void genRefs();
+ friend class TProgram;
+ static ushort doubleDelay;
+ static Boolean mouseReverse;
+
+private:
+
+ static TMouse *mouse;
+ static void getMouseState( TEvent& );
+ static void mouseInt();
+
+ static void setLast( TEvent& );
+
+ static MouseEventType lastMouse;
+public:
+ static MouseEventType curMouse;
+private:
+ static MouseEventType downMouse;
+ static ushort downTicks;
+
+ static ushort * Ticks;
+ static TEvent eventQueue[ eventQSize ];
+ static TEvent * eventQHead;
+ static TEvent * eventQTail;
+ static Boolean mouseIntFlag;
+ static ushort eventCount;
+
+ static Boolean mouseEvents;
+
+ static ushort repeatDelay;
+ static ushort autoTicks;
+ static ushort autoDelay;
+
+ friend class THWMouse;
+ friend class THWMouseDOS;
+};
+
+inline void TEvent::getMouseEvent()
+{
+ TEventQueue::getMouseEvent( *this );
+}
+
+#endif // Uses_TEventQueue
+
diff --git a/tvision/include/tv/filecoll.h b/tvision/include/tv/filecoll.h
new file mode 100644
index 0000000..57ded8d
--- /dev/null
+++ b/tvision/include/tv/filecoll.h
@@ -0,0 +1,104 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TFileCollection ) && !defined( __TFileCollection )
+#define __TFileCollection
+
+class TSearchRec;
+
+const unsigned fcolAlphabetical=0, fcolDirsFirst=1, fcolDirsLast=2,
+ fcolTypeMask=0x1F;
+const unsigned fcolCaseInsensitive=0x20, fcolCaseSensitive=0, fcolCaseBit=5;
+const unsigned fcolParentLast=0x40, fcolParentFirst=0, fcolParentBit=6;
+const unsigned fcolDotsLast=0x80, fcolDotsFirst=0, fcolDotsBit=7;
+const unsigned fcolHideEndTilde=0x100; // *~
+const unsigned fcolHideEndBkp =0x200; // *.bkp
+const unsigned fcolHideStartDot=0x400; // .*
+const unsigned fcolHideBit=8, fcolHideMask=0xF00;
+
+// Avoid replacing free by MSS's macro
+#include <tv/no_mss.h>
+
+class TFileCollection: public TSortedCollection
+{
+
+public:
+
+ TFileCollection( ccIndex aLimit, ccIndex aDelta) :
+ TSortedCollection( aLimit, aDelta ) { duplicates=True; }
+
+ TSearchRec *at( ccIndex index )
+ { return (TSearchRec *)TSortedCollection::at( index ); }
+
+ void remove( TSearchRec *item )
+ { TSortedCollection::remove( item ); }
+ void free( TSearchRec *item )
+ { TSortedCollection::free( item ); }
+ void atPut( ccIndex index, TSearchRec *item )
+ { TSortedCollection::atPut( index, item ); }
+
+ TSearchRec *firstThat( ccTestFunc Test, void *arg );
+ TSearchRec *lastThat( ccTestFunc Test, void *arg );
+
+ static unsigned sortOptions;
+
+private:
+
+ virtual void freeItem( void *item )
+ { delete (TSearchRec *)item; }
+
+ virtual int compare( void *key1, void *key2 );
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+ virtual void *readItem( ipstream& );
+ virtual void writeItem( void *, opstream& );
+
+protected:
+
+ TFileCollection( StreamableInit ) : TSortedCollection ( streamableInit ) {}
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#include <tv/yes_mss.h>
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TFileCollection& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TFileCollection*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TFileCollection& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TFileCollection* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+inline TSearchRec *TFileCollection::firstThat( ccTestFunc func, void *arg )
+{
+ return (TSearchRec *)TSortedCollection::firstThat( ccTestFunc(func), arg );
+}
+
+inline TSearchRec *TFileCollection::lastThat( ccTestFunc func, void *arg )
+{
+ return (TSearchRec *)TSortedCollection::lastThat( ccTestFunc(func), arg );
+}
+
+#endif // Uses_TFileCollection
+
diff --git a/tvision/include/tv/filedlg.h b/tvision/include/tv/filedlg.h
new file mode 100644
index 0000000..9a7e882
--- /dev/null
+++ b/tvision/include/tv/filedlg.h
@@ -0,0 +1,98 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador Eduardo Tropea to add more functionality.
+
+ *
+ *
+ */
+
+#if defined( Uses_TFileDialog ) && !defined( __TFileDialog )
+#define __TFileDialog
+
+const ushort
+ fdOKButton = 0x0001, // Put an OK button in the dialog
+ fdOpenButton = 0x0002, // Put an Open button in the dialog
+ fdReplaceButton = 0x0004, // Put a Replace button in the dialog
+ fdClearButton = 0x0008, // Put a Clear button in the dialog
+ fdHelpButton = 0x0010, // Put a Help button in the dialog
+ fdSelectButton = 0x0020, // Put a Select button in the dialog
+ fdDoneButton = 0x0040, // Say Done isntead of "Cancel"
+ fdAddButton = 0x0080, // Put an Add button in the dialog
+ fdNoLoadDir = 0x0100; // Do not load the current directory
+ // contents into the dialog at Init.
+ // This means you intend to change the
+ // WildCard by using SetData or store
+ // the dialog on a stream.
+
+struct TEvent;
+class TFileInputLine;
+class TFileList;
+
+class CLY_EXPORT TFileDialog : public TDialog
+{
+
+public:
+
+ TFileDialog( const char *aWildCard, const char *aTitle,
+ const char *inputName, ushort aOptions, uchar histId );
+ ~TFileDialog();
+
+ virtual void getData( void *rec );
+ void getFileName( char *s );
+ virtual void handleEvent( TEvent& event );
+ virtual void setData( void *rec );
+ virtual Boolean valid( ushort command );
+ virtual void shutDown();
+ virtual void sizeLimits(TPoint& min, TPoint& max);
+
+ TFileInputLine *fileName;
+ TFileList *fileList;
+ char wildCard[PATH_MAX];
+ const char *directory;
+
+private:
+
+ void readDirectory();
+ Boolean checkDirectory( const char * );
+
+protected:
+ void setUpCurDir(); // SET
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TFileDialog( StreamableInit ) : TWindowInit( &TFileDialog::initFrame ),
+ TDialog ( streamableInit ) {}
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TFileDialog& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TFileDialog*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TFileDialog& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TFileDialog* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TFileDialog
+
diff --git a/tvision/include/tv/filelist.h b/tvision/include/tv/filelist.h
new file mode 100644
index 0000000..bdf95b9
--- /dev/null
+++ b/tvision/include/tv/filelist.h
@@ -0,0 +1,91 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TFileList ) && !defined( __TFileList )
+#define __TFileList
+
+class TRect;
+class TScrollBar;
+struct TEvent;
+
+class TFileList : public TSortedListBox
+{
+
+public:
+
+ TFileList( const TRect& bounds,
+ TScrollBar *aScrollBar
+ );
+ ~TFileList();
+
+ virtual void focusItem( ccIndex item );
+ virtual void getText( char *dest, ccIndex item, short maxLen );
+ virtual void selectItem( ccIndex item );
+ virtual void handleEvent( TEvent &event );
+ void newList( TFileCollection *aList );
+ void readDirectory( const char *dir, const char *wildCard );
+ void readDirectory( const char *wildCard );
+
+ virtual uint32 dataSize();
+ virtual void getData( void *rec );
+ virtual void setData( void *rec );
+ virtual void setState( ushort aState, Boolean enable );
+
+ TFileCollection *list();
+
+private:
+
+ virtual void *getKey( const char *s );
+
+// static const char * tooManyFiles;
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TFileList( StreamableInit ) : TSortedListBox ( streamableInit ) {}
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TFileList& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TFileList*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TFileList& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TFileList* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+
+inline void TFileList::newList( TFileCollection *f )
+{
+ TSortedListBox::newList( f );
+}
+
+
+inline TFileCollection *TFileList::list()
+{
+ return (TFileCollection *)TSortedListBox::list();
+}
+
+#endif // Uses_TFileList
+
diff --git a/tvision/include/tv/fileview.h b/tvision/include/tv/fileview.h
new file mode 100644
index 0000000..bd191c7
--- /dev/null
+++ b/tvision/include/tv/fileview.h
@@ -0,0 +1,119 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TFileViewer ) && !defined( __TFileViewer )
+#define __TFileViewer
+
+#include <tv.h>
+
+const ushort hlChangeDir = cmChangeDir;
+
+const ushort
+ hcFileViewer = 599,
+ cmSaveFile = 598,
+ cmFileViewAnswer = 599; // I hope this conflicts with
+ // nothing else
+
+class CLY_EXPORT TLineCollection : public TCollection
+{
+
+public:
+
+ TLineCollection(ccIndex lim, ccIndex delta) : TCollection(lim, delta) {}
+ virtual void freeItem(void *p) { delete (char *)p; }
+
+#if !defined( NO_STREAM )
+private:
+
+ virtual void *readItem( ipstream& ) { return 0; }
+ virtual void writeItem( void *, opstream& ) {}
+#endif // NO_STREAM
+ friend class TFileViewer;
+
+};
+
+class CLY_EXPORT TFileViewer : public TScroller
+{
+
+public:
+
+ char *fileName;
+ Boolean isValid;
+ TFileViewer( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ const char *aFileName
+ );
+ ~TFileViewer();
+#if !defined( NO_STREAM )
+ TFileViewer( StreamableInit ) : TScroller(streamableInit) { };
+#endif // NO_STREAM
+ void draw();
+ void readFile( const char *fName );
+ virtual void saveFile(const char *fName);
+ virtual void handleEvent(TEvent &);
+ void setState( ushort aState, Boolean enable );
+ void scrollDraw();
+ virtual void changeBounds(const TRect &);
+ Boolean valid( ushort command );
+ void insertLine(const char *line);
+ const char * const operator [] (int index);
+ int Count() { return count; }
+
+private:
+
+/* I have moved the fileLines in the private section, because
+ I'm using now a faster way for the FileViewer in which the user
+ is not allowed to insert or delete a line from the fileLines.
+ For inserting a line use the TFileViewer::insertLine.
+ For accessing the lines use TFileViewer::operator []
+*/
+ TLineCollection *fileLines;
+ char *buffer;
+ ssize_t real_bufsize;
+
+protected:
+
+ const char * const getBuffer() { return buffer; }
+ ssize_t getBufsize() { return real_bufsize; }
+
+ int width;
+ int count;
+
+#if !defined( NO_STREAM )
+private:
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+class CLY_EXPORT TFileWindow : public TWindow
+{
+
+public:
+
+ TFileWindow( const char *fileName );
+
+};
+
+#endif
+
diff --git a/tvision/include/tv/filinfpn.h b/tvision/include/tv/filinfpn.h
new file mode 100644
index 0000000..922491f
--- /dev/null
+++ b/tvision/include/tv/filinfpn.h
@@ -0,0 +1,66 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TFileInfoPane ) && !defined( __TFileInfoPane )
+#define __TFileInfoPane
+
+class TRect;
+struct TEvent;
+
+class TFileInfoPane : public TView
+{
+
+public:
+
+ TFileInfoPane( const TRect& bounds );
+
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+
+private:
+
+ TSearchRec file_block;
+
+ static const char * const months[13];
+ static const char * pmText;
+ static const char * amText;
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TFileInfoPane( StreamableInit ) : TView ( streamableInit ) {}
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TFileInfoPane& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TFileInfoPane*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TFileInfoPane& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TFileInfoPane* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TFileInfoPane
+
diff --git a/tvision/include/tv/filinpln.h b/tvision/include/tv/filinpln.h
new file mode 100644
index 0000000..de6f2cc
--- /dev/null
+++ b/tvision/include/tv/filinpln.h
@@ -0,0 +1,58 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TFileInputLine ) && !defined( __TFileInputLine )
+#define __TFileInputLine
+
+class TRect;
+struct TEvent;
+
+class TFileInputLine : public TInputLine
+{
+
+public:
+
+ TFileInputLine( const TRect& bounds, short aMaxLen );
+
+ virtual void handleEvent( TEvent& event );
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TFileInputLine( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TFileInputLine& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TFileInputLine*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TFileInputLine& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TFileInputLine* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TFileInputLine
+
diff --git a/tvision/include/tv/findrepl.h b/tvision/include/tv/findrepl.h
new file mode 100644
index 0000000..c1f6a5b
--- /dev/null
+++ b/tvision/include/tv/findrepl.h
@@ -0,0 +1,47 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TFindDialogRec ) && !defined( __TFindDialogRec )
+#define __TFindDialogRec
+
+struct TFindDialogRec
+{
+ TFindDialogRec( const char *str, ushort flgs )
+ {
+ strcpy( find, str );
+ options = flgs;
+ }
+ char find[maxFindStrLen];
+ ushort options;
+};
+
+#endif // Uses_TFindDialogRec
+
+#if defined( Uses_TReplaceDialogRec ) && !defined( __TReplaceDialogRec )
+#define __TReplaceDialogRec
+
+struct TReplaceDialogRec
+{
+ TReplaceDialogRec( const char *str, const char *rep, ushort flgs )
+ {
+ strcpy( find, str );
+ strcpy( replace, rep );
+ options = flgs;
+ }
+ char find[maxFindStrLen];
+ char replace[maxReplaceStrLen];
+ ushort options;
+};
+
+#endif // Uses_TReplaceDialogRec
+
diff --git a/tvision/include/tv/fontcoll.h b/tvision/include/tv/fontcoll.h
new file mode 100644
index 0000000..0713f8b
--- /dev/null
+++ b/tvision/include/tv/fontcoll.h
@@ -0,0 +1,112 @@
+/**[txh]********************************************************************
+
+ Copyright 1996-2002 by Salvador Eduardo Tropea (SET)
+ This file is covered by the GPL license.
+
+ Module: TVFontCollection
+
+***************************************************************************/
+
+#if defined(Uses_TVFontCollection) && !defined(TVFontCollection_Included)
+#define TVFontCollection_Included 1
+
+struct TVBitmapFont
+{
+ int first, last; // Currently is barely supported. The range includes both ends.
+ unsigned lines; // Height
+ unsigned width; // Width in pixels
+ // --- Not in disk:
+ int wBytes; // Width in bytes. To avoid computing it all the time
+ uchar *fontFull; // last-first+1 chars
+ uchar *font; // 256 according to the code page
+};
+
+struct TVBitmapFontDesc
+{
+ const char *name;
+ const char *file;
+ TStringCollection *sizes;
+};
+
+class CLY_EXPORT TVBitmapFontDescCol : public TStringCollection
+{
+public:
+ TVBitmapFontDescCol() : TStringCollection(8,4) {}
+ virtual void freeItem(void *item);
+ virtual void *keyOf(void *item);
+};
+
+class CLY_EXPORT TVBitmapFontDescLBox : public TSortedListBox
+{
+public:
+ TVBitmapFontDescLBox(const TRect& bounds, ushort aNumCols,
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar,
+ Boolean aCenterOps=False) :
+ TSortedListBox(bounds,aNumCols,aHScrollBar,aVScrollBar,aCenterOps) {}
+ virtual void getText(char *dest, ccIndex item, short maxChars);
+};
+
+struct TVBitmapFontSize
+{
+ unsigned w,h;
+};
+
+class CLY_EXPORT TVBitmapFontSizeCol : public TStringCollection
+{
+public:
+ TVBitmapFontSizeCol() : TStringCollection(3,3) {}
+ virtual int compare(void *key1, void *key2);
+ // do not use the default delete[]
+ virtual void freeItem(void *item) { delete (TVBitmapFontSize *)item; }
+};
+
+class CLY_EXPORT TVBitmapFontSizeLBox : public TSortedListBox
+{
+public:
+ TVBitmapFontSizeLBox(const TRect& bounds, ushort aNumCols,
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar,
+ Boolean aCenterOps=False) :
+ TSortedListBox(bounds,aNumCols,aHScrollBar,aVScrollBar,aCenterOps) {}
+ virtual void getText(char *dest, ccIndex item, short maxChars);
+};
+
+class CLY_EXPORT TVFontCollection : public TNSCollection
+{
+public:
+ TVFontCollection(const char *file, int cp);
+ ~TVFontCollection();
+
+ virtual void freeItem(void *item);
+ static void ReduceOne(uchar *dest, uchar *ori, int height, int wBytes, int num=256);
+ static void EnlargeOne(uchar *dest, uchar *ori, int height, int wBytes, int num=256);
+ uchar *GetFont(int width, int height);
+ void SetCodePage(int id);
+ int GetError() { return error; }
+ const char *GetFileName() { return fileName; }
+ const char *GetFontName() { return fontName; }
+ static TVBitmapFontDescCol *CreateListOfFonts(const char *dir, unsigned wmin=0,
+ unsigned wmax=256, unsigned hmin=0, unsigned hmax=256);
+ static void Size2Str(char *buffer, unsigned w, unsigned h);
+ static void Str2Size(const char *buffer, unsigned &w, unsigned &h);
+
+protected:
+ static Boolean CheckForLines(void *item, void *arg);
+ static void CreateFont(void *item, void *arg);
+ const static char Signature[];
+ const static char SFTExtension[];
+ static int CheckSignature(FILE *f);
+ static char *ReadName(FILE *f);
+ static void ReadVersionNum(FILE *f, int *version, int *numfonts);
+ static unsigned ReadFontInfo(FILE *f, int version, TVBitmapFont *p);
+ static void Swap(int *value);
+ static void Swap(unsigned *value) { Swap((int *)value); };
+ static void Swap(uint16 *value);
+ // !=0 if the file was created with the reverse endian style.
+ // Only used during load.
+ static int invertEndian;
+ int error;
+ char *fileName;
+ char *fontName;
+};
+
+#endif
diff --git a/tvision/include/tv/fpbase.h b/tvision/include/tv/fpbase.h
new file mode 100644
index 0000000..256fe4c
--- /dev/null
+++ b/tvision/include/tv/fpbase.h
@@ -0,0 +1,79 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis and Christoph Bauer.
+
+SET: I introduced an important change: now buf is a pointer to a filebuf
+and not a filebuf. This is much more convenient to make the code
+compilable with gcc 3.x without breaking compatibility.
+
+SET: Added a filebuf wrapper to get access to protected members needed
+to open associate a filebuf with a C stream/file handle. Andris proposed
+this idea. This is needed for gcc 3.1 and we don't know how long this
+trick will be used.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class fpbase */
+/* */
+/* Base class for handling streamable objects on file streams */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_fpbase ) && !defined( __fpbase )
+#define __fpbase
+
+#ifdef CLY_DefineSpecialFileBuf
+class CLY_int_filebuf: public CLY_filebuf
+{
+public:
+ CLY_int_filebuf() : CLY_filebuf() {};
+ CLY_int_filebuf(FILE *f, std::ios_base::openmode mode)
+ { open(f,mode); };
+ CLY_int_filebuf(int h, std::ios_base::openmode mode)
+ { open(h,mode); };
+
+ CLY_int_filebuf *open(FILE *f, std::ios_base::openmode);
+ CLY_int_filebuf *open(int h, std::ios_base::openmode);
+ CLY_filebuf *open(const char *file, std::ios_base::openmode mode)
+ { return CLY_filebuf::open(file,mode); };
+};
+#endif
+
+class fpbase : virtual public pstream
+{
+
+public:
+
+ fpbase();
+ fpbase( const char *, CLY_OpenModeT, int = CLY_FBOpenProtDef );
+ fpbase( int );
+ fpbase( int, char *, int );
+ ~fpbase();
+
+ void open( const char *, CLY_OpenModeT, int = CLY_FBOpenProtDef );
+ #ifdef CLY_HaveFBAttach
+ void attach( int );
+ #endif
+ void close();
+ void setbuf( char *, int );
+ CLY_filebuf * rdbuf();
+
+private:
+
+ CLY_int_filebuf *buf;
+
+};
+
+#endif // Uses_fpbase
+
diff --git a/tvision/include/tv/fpstream.h b/tvision/include/tv/fpstream.h
new file mode 100644
index 0000000..e4d4526
--- /dev/null
+++ b/tvision/include/tv/fpstream.h
@@ -0,0 +1,44 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis and Christoph Bauer.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class fpstream */
+/* */
+/* Base class for reading and writing streamable objects to */
+/* bidirectional file streams */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_fpstream ) && !defined( __fpstream )
+#define __fpstream
+
+class CLY_EXPORT fpstream : public fpbase, public iopstream
+{
+public:
+ fpstream();
+ fpstream( const char *, CLY_OpenModeT, int = CLY_FBOpenProtDef );
+ fpstream( CLY_OpenModeT, const char* , int = CLY_FBOpenProtDef );
+ fpstream( int );
+ fpstream( int, char *, int );
+ ~fpstream();
+ long filelength();
+
+ CLY_filebuf *rdbuf();
+ void open( const char *, CLY_OpenModeT, int = CLY_FBOpenProtDef );
+};
+
+#endif // Uses_fpstream
+
diff --git a/tvision/include/tv/frame.h b/tvision/include/tv/frame.h
new file mode 100644
index 0000000..3038818
--- /dev/null
+++ b/tvision/include/tv/frame.h
@@ -0,0 +1,97 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TFrame */
+/* */
+/* Palette layout */
+/* 1 = Passive frame */
+/* 2 = Passive title */
+/* 3 = Active frame */
+/* 4 = Active title */
+/* 5 = Icons */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TFrame ) && !defined( __TFrame )
+#define __TFrame
+
+class TRect;
+struct TEvent;
+class TDrawBuffer;
+
+class TFrame : public TView
+{
+
+public:
+
+ TFrame( const TRect& bounds );
+
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual void setState( ushort aState, Boolean enable );
+
+ // SET: Used to disable icon animation
+ static Boolean doAnimation;
+
+ static char frameChars[33];
+ static char closeIcon[];
+ static char zoomIcon[];
+ static char unZoomIcon[];
+ static char dragIcon[];
+ static char animIcon[];
+ static char oframeChars[33];
+ static char ocloseIcon[];
+ static char ozoomIcon[];
+ static char ounZoomIcon[];
+ static char odragIcon[];
+ static char oanimIcon[];
+
+private:
+
+ void frameLine( TDrawBuffer& frameBuf, short y, short n, uchar color );
+ void dragWindow( TEvent& event, uchar dragMode );
+ void drawIcon( int bNormal, const int ciType );
+
+ friend class TDisplay;
+ static const char initFrame[19];
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TFrame( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TFrame& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TFrame*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TFrame& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TFrame* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TFrame
+
diff --git a/tvision/include/tv/gkey.h b/tvision/include/tv/gkey.h
new file mode 100644
index 0000000..57d21ce
--- /dev/null
+++ b/tvision/include/tv/gkey.h
@@ -0,0 +1,208 @@
+/* Keyboard handler routines header.
+ Copyright by Salvador E. Tropea (SET) (1998,1999,2001)
+ Covered by the GPL license. */
+#ifndef GKEY_HEADER_INCLUDED
+#define GKEY_HEADER_INCLUDED
+// A type for the BIOS ASCII/Scan
+typedef union
+{
+ unsigned short full;
+ struct
+ {
+ #ifdef TV_BIG_ENDIAN
+ unsigned char scan;
+ unsigned char ascii;
+ #else
+ unsigned char ascii;
+ unsigned char scan;
+ #endif
+ } b;
+} KeyType;
+
+// Shift constants
+const ushort
+ kbShiftCode=0x080,
+ kbCtrlCode =0x100,
+ kbAltRCode =0x400,
+ kbAltLCode =0x200,
+ kbKeyMask =0x07F;
+
+#ifdef Uses_FullSingleKeySymbols
+// Key constants, basically they are from the US keyboard, but all of them
+// are standard ASCII and not extended.
+const ushort
+kbUnkNown=0,
+kbA= 1,kbB= 2,kbC= 3,kbD= 4,kbE= 5,kbF= 6,kbG= 7,kbH= 8,kbI= 9,kbJ=10,kbK=11,
+kbL=12,kbM=13,kbN=14,kbO=15,kbP=16,kbQ=17,kbR=18,kbS=19,kbT=20,kbU=21,kbV=22,
+kbW=23,kbX=24,kbY=25,kbZ=26,
+kbOpenBrace=27,kbBackSlash=28,kbCloseBrace=29,kbPause=30,kbEsc=31,
+kb0=32,kb1=33,kb2=34,kb3=35,kb4=36,kb5=37,kb6=38,kb7=39,kb8=40,kb9=41,
+kbBackSpace=42,kbTab=43,kbEnter=44,kbColon=45,kbQuote=46,kbGrave=47,
+kbComma=48,kbStop=49,kbSlash=50,kbAsterisk=51,kbSpace=52,kbMinus=53,
+kbPlus=54,kbPrnScr=55,kbEqual=56,kbF1=57,kbF2=58,kbF3=59,kbF4=60,kbF5=61,
+kbF6=62,kbF7=63,kbF8=64,kbF9=65,kbF10=66,kbF11=67,kbF12=68,kbHome=69,
+kbUp=70,kbPgUp=71,kbLeft=72,kbRight=73,kbEnd=74,kbDown=75,kbPgDn=76,
+kbInsert=77,kbDelete=78,kbCaret=79,kbAdmid=80,kbDobleQuote=81,
+kbNumeral=82,kbDolar=83,kbPercent=84,kbAmper=85,kbOpenPar=86,
+kbClosePar=87,kbDoubleDot=88,kbLessThan=89,kbGreaterThan=90,
+kbQuestion=91,kbA_Roba=92,kbOr=93,kbUnderLine=94,kbOpenCurly=95,
+kbCloseCurly=96,kbTilde=97,kbMacro=98,kbWinLeft=99,kbWinRight=100,
+kbWinSel=101,
+kbMouse=102,kbEterm=103
+;
+#endif
+
+/* IBM BIOS flags, not all implemented in most platforms */
+/*
+bit 15: SysReq key pressed;
+bit 14: Caps lock key currently down;
+bit 13: Num lock key currently down;
+bit 12: Scroll lock key currently down;
+bit 11: Right alt key is down;
+bit 10: Right ctrl key is down;
+bit 9: Left alt key is down;
+bit 8: Left ctrl key is down;
+bit 7: Insert toggle;
+bit 6: Caps lock toggle;
+bit 5: Num lock toggle;
+bit 4: Scroll lock toggle;
+bit 3: Either alt key is down (some machines, left only);
+bit 2: Either ctrl key is down;
+bit 1: Left shift key is down;
+bit 0: Right shift key is down
+*/
+const unsigned
+ kbSysReqPress =0x8000,
+ kbCapsLockDown =0x4000,
+ kbNumLockDown =0x2000,
+ kbScrollLockDown =0x1000,
+ kbRightAltDown =0x0800,
+ kbRightCtrlDown =0x0400,
+ kbLeftAltDown =0x0200,
+ kbLeftCtrlDown =0x0100,
+ kbInsertToggle =0x0080,
+ kbCapsLockToggle =0x0040,
+ kbNumLockToggle =0x0020,
+ kbScrollLockToggle=0x0010,
+ kbAltDown =0x0008,
+ kbCtrlDown =0x0004,
+ kbLeftShiftDown =0x0002,
+ kbRightShiftDown =0x0001;
+
+
+struct TEvent;
+
+// A class to encapsulate the globals, all is static!
+class CLY_EXPORT TGKey
+{
+public:
+ TGKey() { resume(); };
+
+ static void suspend();
+ static void resume();
+ static void (*Suspend)();
+ static void (*Resume)();
+
+ static int (*kbhit)();
+ static void (*clear)();
+ static ushort (*gkey)();
+ // This is optional. Some platforms doesn't support it and the returned value
+ // can be outdated.
+ static unsigned (*getShiftState)();
+ static void (*fillTEvent)(TEvent &e);
+
+ // Very used by: menues and hotkeys (buttons, status bar, etc).
+ // Get the ascii associated to Alt+key, example Alt+A => A
+ static char GetAltChar(unsigned short keyCode, uchar ascii);
+ // The reverse (know the alt code when we know the ASCII)
+ static ushort GetAltCode(uchar ch);
+ // Find the code for the name of a key
+ static ushort KeyNameToNumber(char *s);
+ static const
+ char *NumberToKeyName(unsigned val);
+
+ // Alt keys interpretation
+ static ushort GetAltSettings(void) { return AltSet; }
+ static void SetAltSettings(ushort altSet) { AltSet=altSet; }
+
+ // Special functions when we must deal with international stuff like a
+ // shortcut in greek or cyrilic.
+ // When a key character is over 128 and we want to know the ascii of
+ // the key that generates it.
+ static uchar (*NonASCII2ASCII)(uchar val);
+ // Compares two values according to the associated ASCII.
+ static int (*CompareASCII)(uchar val, uchar code);
+ // Finds the Alt that generated it.
+ static int (*AltInternat2ASCII)(TEvent &event);
+
+ // Routine to setup the input code page
+ static int (*SetCodePage)(int id);
+
+ enum keyMode
+ {
+ // Linux styles
+ linuxDisableKeyPatch=1,
+ linuxEnableKeyPatch=2,
+ // DOS
+ // Should be incorporated to the remapping but I need volunteers
+ //dosUS=0,
+ //dosGreek737=20, No longer used
+ dosUseBIOS=21,
+ dosUseDirect=22,
+ dosTranslateKeypad=23,
+ dosNormalKeypad=24,
+ // UNIX styles
+ unixXterm=40,
+ unixNoXterm=41,
+ unixEterm=42
+ };
+ static void (*SetKbdMapping)(int version);
+ static int (*GetKbdMapping)(int version);
+
+protected:
+ static uchar defaultNonASCII2ASCII(uchar val);
+ static int defaultCompareASCII(uchar val, uchar code);
+ static void defaultSetKbdMapping(int version);
+ static int defaultGetKbdMapping(int version);
+ static int defaultKbhit(void);
+ static void defaultClear(void);
+ static ushort defaultGkey(void);
+ static unsigned defaultGetShiftState();
+ static void defaultFillTEvent(TEvent &e);
+ static void defaultSuspend();
+ static void defaultResume();
+ static int defaultSetCodePage(int id);
+ static int defaultAltInternat2ASCII(TEvent &event);
+
+ // Greek table
+ static stIntCodePairs GreekKeyboard[];
+ // Russian table
+ static stIntCodePairs RussianKeyboard[];
+ // Generic tables
+ static uchar KeyMap[128];
+ static const uchar
+ kbByASCII[128];
+ static void FillKeyMapForCP(int id, stIntCodePairs *keyboard, size_t szKb);
+ static uchar Generic_NonASCII2ASCII(uchar ascii);
+ static int Generic_CompareASCII(uchar val, uchar code);
+ static int Generic_AltInternat2ASCII(TEvent &e);
+
+ // Needed for configuration.
+ static const char *KeyNames[];
+ // 0 => Left alt is used
+ // 1 => Right alt is used
+ // 2 => Both alts are the same
+ static ushort AltSet;
+ static char suspended;
+
+ //static KeyType rawCode;
+ // SetKbdMapping:
+ static int Mode;
+};
+
+extern unsigned short getshiftstate();
+extern unsigned short __tv_getshiftstate();
+extern unsigned short __tv_GetRaw();
+extern int __tv_kbhit();
+extern void __tv_clear();
+#endif // GKEY_HEADER_INCLUDED
diff --git a/tvision/include/tv/group.h b/tvision/include/tv/group.h
new file mode 100644
index 0000000..ac7bbde
--- /dev/null
+++ b/tvision/include/tv/group.h
@@ -0,0 +1,126 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TGroup ) && !defined( __TGroup )
+#define __TGroup
+
+class CLY_EXPORT TGroup : public TView
+{
+
+public:
+
+ friend void genRefs();
+
+ TGroup( const TRect& bounds );
+ ~TGroup();
+
+ virtual void shutDown();
+
+ ushort execView( TView *p );
+ virtual ushort execute();
+
+ void insertView( TView *p, TView *Target );
+ void remove( TView *p );
+ void removeView( TView *p );
+ void resetCurrent();
+ void setCurrent( TView *p, selectMode mode );
+ void selectNext( Boolean forwards );
+ TView *firstThat( Boolean (*func)( TView *, void * ), void *args );
+ void forEach( void (*func)( TView *, void * ), void *args );
+ void insert( TView *p );
+ void insertBefore( TView *p, TView *Target );
+ TView *current;
+ TView *at( short index );
+ TView *firstMatch( ushort aState, ushort aOptions );
+ short indexOf( TView *p );
+ Boolean matches( TView *p );
+ TView *first();
+
+ virtual void setState( ushort aState, Boolean enable );
+
+ virtual void handleEvent( TEvent& event );
+
+ void drawSubViews( TView *p, TView *bottom );
+
+ virtual void changeBounds( const TRect& bounds );
+
+ virtual uint32 dataSize();
+ virtual void getData( void *rec );
+ virtual void setData( void *rec );
+
+ virtual void draw();
+ void redraw();
+ void CLY_Redraw();
+ void lock();
+ void unlock();
+ virtual void resetCursor();
+ // SET: A view should ask your owner (a group) if that's right
+ // time to show the cursor or we are locked.
+ virtual Boolean canShowCursor();
+
+ virtual void endModal( ushort command );
+
+ virtual void eventError( TEvent& event );
+
+ virtual ushort getHelpCtx();
+
+ virtual Boolean valid( ushort command );
+
+ void freeBuffer();
+ void getBuffer();
+
+ TView *last;
+
+ TRect clip;
+ phaseType phase;
+
+ ushort *buffer;
+ uchar lockFlag;
+ ushort endState;
+
+private:
+
+ Boolean invalid( TView *p, ushort command );
+ void focusView( TView *p, Boolean enable );
+ void selectView( TView *p, Boolean enable );
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TGroup( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TGroup& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TGroup*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TGroup& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TGroup* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TGroup
+
diff --git a/tvision/include/tv/help.h b/tvision/include/tv/help.h
new file mode 100644
index 0000000..49ff354
--- /dev/null
+++ b/tvision/include/tv/help.h
@@ -0,0 +1,57 @@
+/*
+ * help.h
+ *
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified by Salvador E. Tropea <set@ieee.org>, <set@users.sourceforge.net>
+ */
+
+#if defined(Uses_THelpWindow) && !defined(THelpWindow_Included)
+#define THelpWindow_Included
+
+// THelpViewer
+
+class CLY_EXPORT THelpViewer : public TScroller
+{
+public:
+
+ THelpViewer( const TRect&, TScrollBar*, TScrollBar*, THelpFile*, ushort );
+ ~THelpViewer();
+
+ virtual void changeBounds( const TRect& );
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& );
+ void makeSelectVisible( int, TPoint&, uchar&, int& );
+ void switchToTopic( int );
+
+ THelpFile *hFile;
+ THelpTopic *topic;
+ int selected;
+};
+
+// THelpWindow
+
+class CLY_EXPORT THelpWindow : public TWindow
+{
+
+ static const char * helpWinTitle;
+
+public:
+
+ THelpWindow( THelpFile*, ushort );
+
+ virtual TPalette& getPalette() const;
+};
+
+
+extern void notAssigned( opstream& s, int value );
+
+extern TCrossRefHandler crossRefHandler;
+
+#endif // Uses_THelpWindow && !THelpWindow_Included
+
diff --git a/tvision/include/tv/helpbase.h b/tvision/include/tv/helpbase.h
new file mode 100644
index 0000000..cb898c2
--- /dev/null
+++ b/tvision/include/tv/helpbase.h
@@ -0,0 +1,189 @@
+/*
+ * helpbase.h
+ *
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Sergio Sigala <ssigala@globalnet.it>
+ * Modified by Salvador E. Tropea <set@ieee.org>, <set@users.sourceforge.net>
+ */
+
+#if defined(Uses_THelpFile) && !defined(THelpFile_Included)
+#define THelpFile_Included
+
+const long magicHeader = 0x46484246L; //"FBHF"
+
+#define cHelpViewer "\x06\x07\x08"
+#define cHelpWindow "\x80\x81\x82\x83\x84\x85\x86\x87"
+
+// TParagraph
+
+class TParagraph
+{
+
+public:
+
+ TParagraph() {}
+ TParagraph *next;
+ Boolean wrap;
+ ushort size;
+ char *text;
+
+};
+
+// TCrossRef
+
+class TCrossRef
+{
+
+public:
+
+ TCrossRef() {}
+ int ref;
+ int offset;
+ uchar length;
+
+};
+
+
+typedef void (*TCrossRefHandler) ( opstream&, int );
+
+class CLY_EXPORT THelpTopic: public TObject, public TStreamable
+{
+
+public:
+
+ THelpTopic();
+ THelpTopic( StreamableInit ) {};
+ virtual ~THelpTopic();
+
+ void addCrossRef( TCrossRef ref );
+ void addParagraph( TParagraph *p );
+ void getCrossRef( int i, TPoint& loc, uchar& length, int& ref );
+ char *getLine( int line, char *buffer, int buflen );
+ int getNumCrossRefs();
+ int numLines();
+ void setCrossRef( int i, TCrossRef& ref );
+ void setNumCrossRefs( int i );
+ void setWidth( int aWidth );
+
+ TParagraph *paragraphs;
+
+ int numRefs;
+ TCrossRef *crossRefs;
+
+private:
+
+ char *wrapText( char *text, int size, int& offset, Boolean wrap, char *lineBuf, int lineBufLen );
+ void readParagraphs( ipstream& s );
+ void readCrossRefs( ipstream& s );
+ void writeParagraphs( opstream& s );
+ void writeCrossRefs( opstream& s );
+ void disposeParagraphs();
+ const char *streamableName() const
+ { return name; }
+ int width;
+ int lastOffset;
+ int lastLine;
+ TParagraph *lastParagraph;
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+inline ipstream& operator >> ( ipstream& is, THelpTopic& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, THelpTopic*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, THelpTopic& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, THelpTopic* cl )
+ { return os << (TStreamable *)cl; }
+
+
+// THelpIndex
+
+class CLY_EXPORT THelpIndex : public TObject, public TStreamable
+{
+public:
+
+
+ THelpIndex();
+ THelpIndex( StreamableInit ) {};
+ virtual ~THelpIndex();
+
+ long position( int );
+ void add( int, long );
+
+ ushort size;
+ long *index;
+
+private:
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+};
+
+inline ipstream& operator >> ( ipstream& is, THelpIndex& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, THelpIndex*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, THelpIndex& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, THelpIndex* cl )
+ { return os << (TStreamable *)cl; }
+
+
+// THelpFile
+
+class CLY_EXPORT THelpFile : public TObject
+{
+
+ static const char * invalidContext;
+
+public:
+
+ THelpFile( fpstream& s );
+ virtual ~THelpFile();
+
+ virtual THelpTopic *getTopic( int );
+ THelpTopic *invalidTopic();
+ void recordPositionInIndex( int );
+ void putTopic( THelpTopic* );
+
+ fpstream *stream;
+ Boolean modified;
+
+ THelpIndex *index;
+ long indexPos;
+};
+
+extern void notAssigned( opstream& s, int value );
+
+extern TCrossRefHandler crossRefHandler;
+
+#endif // Uses_THelpFile && !THelpFile_Included
+
diff --git a/tvision/include/tv/history.h b/tvision/include/tv/history.h
new file mode 100644
index 0000000..475d5f2
--- /dev/null
+++ b/tvision/include/tv/history.h
@@ -0,0 +1,75 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_THistory ) && !defined( __THistory )
+#define __THistory
+
+class TRect;
+class TInputLine;
+struct TEvent;
+class THistoryWindow;
+
+class THistory : public TView
+{
+
+public:
+
+ THistory( const TRect& bounds, TInputLine *aLink, ushort aHistoryId );
+
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual THistoryWindow *initHistoryWindow( const TRect& bounds );
+ virtual void shutDown();
+
+ static char icon[];
+ static char oicon[];
+
+protected:
+
+ TInputLine *link;
+ ushort historyId;
+
+private:
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ THistory( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, THistory& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, THistory*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, THistory& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, THistory* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_THistory
+
diff --git a/tvision/include/tv/histvwer.h b/tvision/include/tv/histvwer.h
new file mode 100644
index 0000000..d0c153c
--- /dev/null
+++ b/tvision/include/tv/histvwer.h
@@ -0,0 +1,54 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class THistoryViewer */
+/* */
+/* Palette layout */
+/* 1 = Active */
+/* 2 = Inactive */
+/* 3 = Focused */
+/* 4 = Selected */
+/* 5 = Divider */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_THistoryViewer ) && !defined( __THistoryViewer )
+#define __THistoryViewer
+
+class TRect;
+class TScrollBar;
+
+class CLY_EXPORT THistoryViewer : public TListViewer
+{
+
+public:
+
+ THistoryViewer( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ ushort aHistoryId
+ );
+
+ virtual TPalette& getPalette() const;
+ virtual void getText( char *dest, ccIndex item, short maxLen );
+ virtual void handleEvent( TEvent& event );
+ int historyWidth();
+
+protected:
+
+ ushort historyId;
+
+};
+
+#endif // Uses_THistoryViewer
+
diff --git a/tvision/include/tv/histwind.h b/tvision/include/tv/histwind.h
new file mode 100644
index 0000000..95b9116
--- /dev/null
+++ b/tvision/include/tv/histwind.h
@@ -0,0 +1,65 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_THistoryWindow ) && !defined( __THistoryWindow )
+#define __THistoryWindow
+
+class TListViewer;
+class TRect;
+class TWindow;
+class TInputLine;
+
+class CLY_EXPORT THistInit
+{
+
+public:
+
+ THistInit( TListViewer *(*cListViewer)( TRect, TWindow *, ushort ) );
+
+protected:
+
+ TListViewer *(*createListViewer)( TRect, TWindow *, ushort );
+
+};
+
+/* ---------------------------------------------------------------------- */
+/* THistoryWindow */
+/* */
+/* Palette layout */
+/* 1 = Frame passive */
+/* 2 = Frame active */
+/* 3 = Frame icon */
+/* 4 = ScrollBar page area */
+/* 5 = ScrollBar controls */
+/* 6 = HistoryViewer normal text */
+/* 7 = HistoryViewer selected text */
+/* ---------------------------------------------------------------------- */
+
+class CLY_EXPORT THistoryWindow : public TWindow, public virtual THistInit
+{
+
+public:
+
+ THistoryWindow( const TRect& bounds, ushort historyId );
+
+ virtual TPalette& getPalette() const;
+ virtual void getSelection( char *dest );
+ static TListViewer *initViewer( TRect, TWindow *, ushort );
+
+protected:
+
+ TListViewer *viewer;
+};
+
+#endif // Uses_THistoryWindow
+
diff --git a/tvision/include/tv/ifpstrm.h b/tvision/include/tv/ifpstrm.h
new file mode 100644
index 0000000..e471ded
--- /dev/null
+++ b/tvision/include/tv/ifpstrm.h
@@ -0,0 +1,47 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis and Christoph Bauer.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class ifpstream */
+/* */
+/* Base class for reading streamable objects from file streams */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_ifpstream ) && !defined( __ifpstream )
+#define __ifpstream
+
+class CLY_EXPORT ifpstream : public fpbase, public ipstream
+{
+public:
+ ifpstream();
+ ifpstream( const char *,
+ CLY_OpenModeT = CLY_IOSIn,
+ int = CLY_FBOpenProtDef
+ );
+ ifpstream( int );
+ ifpstream( int, char *, int );
+ ~ifpstream();
+
+ CLY_filebuf *rdbuf();
+ void open( const char *,
+ CLY_OpenModeT = CLY_IOSIn,
+ int = CLY_FBOpenProtDef
+ );
+};
+
+#endif // Uses_ifpstream
+
diff --git a/tvision/include/tv/indicato.h b/tvision/include/tv/indicato.h
new file mode 100644
index 0000000..70b5273
--- /dev/null
+++ b/tvision/include/tv/indicato.h
@@ -0,0 +1,75 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TIndicator ) && !defined( __TIndicator )
+#define __TIndicator
+
+class TRect;
+class TPoint;
+
+class TIndicator : public TView
+{
+
+public:
+
+ TIndicator( const TRect& );
+
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void setState( ushort, Boolean );
+ void setValue( const TPoint&, Boolean );
+
+ static char dragFrame;
+ static char normalFrame;
+ static char modifiedStar;
+ static char odragFrame;
+ static char onormalFrame;
+ static char omodifiedStar;
+
+protected:
+
+ TPoint location;
+ Boolean modified;
+
+private:
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TIndicator( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TIndicator& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TIndicator*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TIndicator& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TIndicator* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TIndicator
+
+
diff --git a/tvision/include/tv/inputln.h b/tvision/include/tv/inputln.h
new file mode 100644
index 0000000..c56b67f
--- /dev/null
+++ b/tvision/include/tv/inputln.h
@@ -0,0 +1,145 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Added: TInput1Line class by SET (based on TVTools idea).
+Added: modeOptions stuff by SET.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TInputLine */
+/* */
+/* Palette layout */
+/* 1 = Passive */
+/* 2 = Active */
+/* 3 = Selected */
+/* 4 = Arrows */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TInputLine ) && !defined( TInputLine_defined )
+#define TInputLine_defined
+
+class TRect;
+struct TEvent;
+class TValidator;
+
+const unsigned ilValidatorBlocks=1; // Don't pass the focus if the validator indicates
+ // the data isn't valid. by SET.
+
+class CLY_EXPORT TInputLine : public TView
+{
+public:
+
+ TInputLine( const TRect& bounds, int aMaxLen, TValidator *aValid=NULL );
+ ~TInputLine();
+
+ virtual unsigned dataSize();
+ virtual void draw();
+ virtual void getData( void *rec );
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ void selectAll( Boolean enable );
+ virtual void setData( void *rec );
+ virtual void setState( ushort aState, Boolean enable );
+ void setValidator(TValidator *);
+ virtual Boolean valid(ushort);
+ virtual Boolean insertChar(char value); // Added by SET
+ // This is for compatibility with the Unicode branch
+ const void *getData() { return data; }; // Added by SET
+ void setDataFromStr(void *value) // Added by SET
+ { setData(value); };
+
+ char* data;
+ int maxLen;
+ int curPos, oldCurPos;
+ int firstPos, oldFirstPos;
+ int selStart, oldSelStart;
+ int selEnd, oldSelEnd;
+ Boolean hideContent;
+
+ // Functions to fine tune the behavior. by SET.
+ unsigned setModeOptions(unsigned newOps)
+ { unsigned old=modeOptions; modeOptions=newOps; return old; }
+ unsigned getModeOptions()
+ { return modeOptions; }
+ static unsigned setDefaultModeOptions(unsigned newOps)
+ { unsigned old=defaultModeOptions; defaultModeOptions=newOps; return old; }
+ static unsigned getDefaultModeOptions()
+ { return defaultModeOptions; }
+
+
+ static char rightArrow;
+ static char leftArrow;
+ static char orightArrow;
+ void setHide(Boolean val) { hideContent=val; }
+ static char oleftArrow;
+
+protected:
+ virtual void resizeData() {}
+ TValidator * validator;
+ char* oldData;
+ void deleteSelect();
+ void makeVisible(); // Added by SET
+ Boolean canScroll( int delta );
+ void saveState();
+ void restoreState();
+ Boolean checkValid(Boolean);
+
+ // To fine tune the behavior. SET.
+ static unsigned defaultModeOptions;
+ unsigned modeOptions;
+
+private:
+ int mouseDelta( TEvent& event );
+ int mousePos( TEvent& event );
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TInputLine( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TInputLine& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TInputLine*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TInputLine& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TInputLine* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TInputLine
+
+#if defined( Uses_TInput1Line ) && !defined( TInput1Line_defined )
+#define TInput1Line_defined
+// This is based on TVTools idea, but I think is better to implement it
+// in this way and not like a macro.
+class CLY_EXPORT TInput1Line : public TInputLine
+{
+public:
+ TInput1Line(int x, int y, int max, TValidator *aValid=NULL) :
+ TInputLine(TRect(x,y,x+max+2,y+1), max, aValid) {};
+};
+#endif // Uses_TInput1Line
+
diff --git a/tvision/include/tv/intl.h b/tvision/include/tv/intl.h
new file mode 100644
index 0000000..bb3e52e
--- /dev/null
+++ b/tvision/include/tv/intl.h
@@ -0,0 +1,131 @@
+/* Internationalization support routines header.
+ Copyright by Salvador E. Tropea (SET) (2003-2005)
+ Covered by the GPL license. */
+/* The dummies are in nointl.h to make this header less complex */
+
+#ifndef TVIntl_Included
+#define TVIntl_Included
+
+#ifdef FORCE_INTL_SUPPORT
+ #define HAVE_INTL_SUPPORT 1
+#else
+ #include <tv/configtv.h>
+#endif
+
+#ifndef HAVE_INTL_SUPPORT
+
+#include <tv/nointl.h>
+
+#else
+
+#ifdef __cplusplus
+struct stTVIntl
+{
+ char *translation;
+ int cp;
+};
+
+const int libPackageNameLen=20;
+
+class CLY_EXPORT TVIntl
+{
+public:
+ TVIntl() {};
+ // Set the domain or catalog of translations (usually the name of the program)
+ static const char *textDomain(const char *domainname);
+ // Indicate a directory to search for catalogs
+ static const char *bindTextDomain(const char *domainname, const char *dirname);
+ // Translate the message
+ static const char *getText(const char *msgid);
+ // What we think is a good way to initialize the domain
+ static int autoInit(const char *package, const char *localeDir=NULL);
+
+ // Special (and tricky members)
+ // Set the encoding for the catalog
+ static void setCatalogEncoding(int cp) { forcedCatalogEncoding=cp; };
+ // Dis/Enable translations
+ static void enableTranslations() { initialize(); };
+ static void disableTranslations() { translate=0; };
+ // Returns a newly allocated string and translated (if enabled)
+ static char *getTextNew(const char *msgid, Boolean onlyIntl=False);
+ static const char *getText(const char *msgid, stTVIntl *&cache);
+ static void freeSt(stTVIntl *&cache);
+ static stTVIntl *emptySt();
+ static stTVIntl *dontTranslateSt();
+ // Replacements that translates and recodes the format string
+ static int snprintf(char *dest, size_t sz, const char *fmt, ...);
+ #ifdef Uses_intl_fprintf
+ static int fprintf(FILE *f, const char *fmt, ...);
+ #endif
+
+protected:
+ // Enable translations
+ static char translate;
+ // Class already initialized
+ static char initialized;
+ // Indicates if the catalog must be recoded to match the application code page.
+ static char needsRecode;
+ // Used to change the implicit encoding
+ static int forcedCatalogEncoding;
+ // Assumed catalog encoding. This is OS independent and is an arbitrary
+ // criteria for TV. It makes easier to create portable programs.
+ static int catalogEncoding;
+ // Default encodings used for TV. Defined only for the available translations.
+ static const char *defaultEncodingNames[];
+ static int defaultEncodings[];
+ static void *previousCPCallBack;
+ static uchar recodeTable[256];
+ static char packageName[libPackageNameLen];
+
+ static void initialize();
+ static void codePageCB(ushort *map);
+ static void recodeStr(char *str, int len);
+};
+
+#ifndef _
+ #define _(msg) TVIntl::getText(msg)
+#endif
+
+#ifndef __
+ #define __(msg) (msg)
+#endif
+
+#ifndef BINDTEXTDOMAIN
+ #define BINDTEXTDOMAIN(a,b) TVIntl::bindTextDomain(a,b)
+#endif
+
+#ifndef TEXTDOMAIN
+ #define TEXTDOMAIN(a) TVIntl::textDomain(a)
+#endif
+
+#else /* __cplusplus */
+
+#ifndef _
+ #ifdef HAVE_INTL_SUPPORT
+ char *gettext(const char *msgid);
+ #define _(msg) gettext(msg)
+ #else
+ #define _(msg) (msg)
+ #endif
+#endif
+
+#ifndef __
+ #define __(msg) (msg)
+#endif
+
+#ifndef BINDTEXTDOMAIN
+ char *bindtextdomain(const char *domainname, const char *dirname);
+ #define BINDTEXTDOMAIN(a,b) bindtextdomain(a,b)
+#endif
+
+#ifndef TEXTDOMAIN
+ char *textdomain(const char *domainname);
+ #define TEXTDOMAIN(a) textdomain(a)
+#endif
+
+#endif /* __cplusplus */
+
+#endif /* HAVE_INTL_SUPPORT */
+
+#endif /* TVIntl_Included */
+
diff --git a/tvision/include/tv/iopstrm.h b/tvision/include/tv/iopstrm.h
new file mode 100644
index 0000000..9c1c7f4
--- /dev/null
+++ b/tvision/include/tv/iopstrm.h
@@ -0,0 +1,36 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class iopstream */
+/* */
+/* Base class for reading and writing streamable objects */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_iopstream ) && !defined( __iopstream )
+#define __iopstream
+
+class CLY_EXPORT iopstream : public ipstream, public opstream
+{
+public:
+ iopstream(CLY_streambuf *);
+ ~iopstream();
+
+protected:
+ iopstream();
+};
+
+#endif // Uses_iopstream
+
diff --git a/tvision/include/tv/ipstream.h b/tvision/include/tv/ipstream.h
new file mode 100644
index 0000000..d5a67f3
--- /dev/null
+++ b/tvision/include/tv/ipstream.h
@@ -0,0 +1,90 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Robert H”hne to be used for RHIDE.
+ *
+ * Modified by Jose Angel Sanchez Caso (JASC) to have machine endian and
+ * integer size compatibility.
+ *
+ * Added functions to rework the endian stuff by SET: readShort, readInt,
+ * readLong, read8, read16, read32 and read64.
+ *
+ * Modified to compile with gcc v3.x by Salvador E. Tropea (SET), with
+ * the help of Andris Pavenis and Christoph Bauer.
+ *
+ * ------------------------------------------------------------------------*
+ * *
+ * class ipstream *
+ * *
+ * Base class for reading streamable objects *
+ * *
+ * ------------------------------------------------------------------------*/
+
+#if defined( Uses_ipstream ) && !defined( __ipstream )
+#define __ipstream
+
+class TStreamableClass;
+class TPReadObjects;
+
+class CLY_EXPORT ipstream : virtual public pstream
+{
+public:
+ ipstream(CLY_streambuf *);
+ ~ipstream();
+
+ CLY_StreamPosT tellg();
+ ipstream& seekg( CLY_StreamPosT );
+ ipstream& seekg( CLY_StreamOffT, CLY_IOSSeekDir );
+
+ uchar readByte();
+ ushort readWord() { return readShort(); };
+ void readBytes( void *, size_t );
+ char * readString();
+ char * readString( char *, unsigned );
+ /* Platform dependent: */
+ ushort readShort();
+ uint readInt();
+ ulong readLong();
+ /* The following are platform independent (stores in little endian) */
+ uint8 read8() { return readByte(); };
+ uint16 read16();
+ uint32 read32();
+ uint64 read64();
+
+ #ifndef TVComp_BCPP
+ ipstream& operator >> (signed char &ch ) {ch=readByte(); return (*this);}
+ #endif
+ ipstream& operator >> (char &ch ) {ch=readByte(); return (*this);}
+ ipstream& operator >> (unsigned char &ch ) {ch=readByte(); return (*this);}
+ ipstream& operator >> (signed short &sh ) {sh=readShort(); return (*this);}
+ ipstream& operator >> (unsigned short &sh ) {sh=readShort(); return (*this);}
+ ipstream& operator >> (signed int &i ) { i=readInt(); return (*this);}
+ ipstream& operator >> (unsigned int &i ) { i=readInt(); return (*this);}
+ ipstream& operator >> (signed long &l ) { l=readLong(); return (*this);}
+ ipstream& operator >> (unsigned long &l ) { l=readLong(); return (*this);}
+ ipstream& operator >> (float &f ) { readBytes( &f, sizeof(f) ); return (*this);}
+ ipstream& operator >> (double &d ) { readBytes( &d, sizeof(d) ); return (*this);}
+
+ friend ipstream& operator >> ( ipstream&, TStreamable& );
+ friend ipstream& operator >> ( ipstream&, void *& );
+
+protected:
+ ipstream();
+
+ const TStreamableClass * readPrefix();
+ void * readData( const TStreamableClass *,
+ TStreamable * );
+ void readSuffix();
+
+ const void * find( P_id_type );
+ void registerObject( const void *adr );
+
+private:
+ TPReadObjects *objs;
+};
+
+#endif // Uses_ipstream
+
diff --git a/tvision/include/tv/label.h b/tvision/include/tv/label.h
new file mode 100644
index 0000000..b6bd1d9
--- /dev/null
+++ b/tvision/include/tv/label.h
@@ -0,0 +1,99 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea: added i18n support, T1Label inspired in
+TVTools but reworked.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TLabel */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Selected text */
+/* 3 = Normal shortcut */
+/* 4 = Selected shortcut */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TLabel ) && !defined( TLabel_defined )
+#define TLabel_defined
+
+class TRect;
+struct TEvent;
+class TView;
+
+class CLY_EXPORT TLabel : public TStaticText
+{
+
+public:
+
+ TLabel( const TRect& bounds, const char *aText, TView *aLink );
+ TLabel( const TRect& bounds, const char *aText, TView *aLink, stTVIntl *aIntlText );
+
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual void shutDown();
+
+ TView *link;
+
+ // SET: Now labels propagate the disabled state.
+ virtual void setState( ushort aState, Boolean enable );
+
+protected:
+
+ Boolean light;
+ void init( TView *aLink );
+
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TLabel( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TLabel& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TLabel*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TLabel& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TLabel* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TLabel
+
+#if defined( Uses_T1Label ) && !defined( T1Label_defined )
+#define T1Label_defined
+class T1Label : public TLabel
+{
+public:
+ T1Label(int x, int y, const char *aText, TView *aLink) :
+ TLabel(TRect(x,y,x,y),aText,aLink)
+ { growTo(cstrlen(TVIntl::getText(aText,intlText))+1,1); };
+};
+#endif // Uses_T1Label
+
diff --git a/tvision/include/tv/linux/key.h b/tvision/include/tv/linux/key.h
new file mode 100644
index 0000000..b44abc1
--- /dev/null
+++ b/tvision/include/tv/linux/key.h
@@ -0,0 +1,116 @@
+/* Linux keyboard handler routines header.
+ Copyright by Salvador E. Tropea (SET) (2001-2002)
+ Covered by the GPL license. */
+#if defined(TVOSf_Linux) && !defined(LINUXKEY_HEADER_INCLUDED)
+#define LINUXKEY_HEADER_INCLUDED
+struct TEvent;
+
+const int MaxLenEscapeSequence=16;
+
+// A class to encapsulate the globals, all is static!
+class TGKeyLinux : public TGKey
+{
+public:
+ TGKeyLinux() {};
+
+ // Function replacements
+ static void Suspend();
+ static void Resume();
+ static int KbHit();
+ static void Clear();
+ static ushort GKey();
+ static unsigned GetShiftState();
+ static void FillTEvent(TEvent &e);
+ static void SetKbdMapping(int version);
+ static int GetKbdMapping(int version);
+
+ enum { Default, KOI8 };
+
+ // Setup the pointers to point our members
+ static void Init(int map);
+
+ friend class TScreenLinux;
+ friend class TDisplayLinux;
+
+protected:
+ // Specific for this driver
+ static int InitOnce();
+ // Low level code to get a key and process it
+ static int GetRaw();
+ // A low level helper
+ static int GetKeyParsed();
+ // Get a key from the buffer
+ static int GetKeyFromBuffer();
+ // Escape sequences parser
+ static int ProcessEscape();
+ // Low level function to find the key modifiers
+ static unsigned GetLinuxShiftState();
+ // Trap the console switching signals
+ static void hookVTSignals();
+ // Stop traping the console switching signals
+ static void unHookVTSignals();
+ // Change the keyboard map
+ static void patchKeyMap();
+ // Restore keymap
+ static void unPatchKeyMap();
+ // Initializes the patching tables
+ static void keyMapInit();
+ // Signal handler called when we lose the VT
+ static void releaseVTHandler(int);
+ // Signal handler called when we get back the VT
+ static void acquireVTHandler(int);
+ // Small helpers to do both operations and check
+ static void doHookAndPatch();
+ static void doUnHookAndUnPatch();
+ // File handle for the input
+ static int hIn;
+ // Stream for the input
+ static FILE *fIn;
+ // Old mode of the input file handle
+ static int oldInFlags;
+ // New mode of the input file handle
+ static int newInFlags;
+ // Termios data of the console before starting
+ static struct termios inTermiosOrig;
+ // Our termios settings
+ static struct termios inTermiosNew;
+ // Description of the last error
+ static const char *error;
+ // Buffer to store a key escape sequence while we analize it.
+ // If a sequence failed the keys must be returned from here.
+ static int bufferKeys[MaxLenEscapeSequence];
+ // How many keys we have in the buffer
+ static int keysInBuffer;
+ // The next key to return. It avoids using things like ungetc
+ static int nextKey;
+ // Last key code we decoded
+ static int lastKeyCode;
+ // Last set of modifiers
+ static int lastModifiers;
+ // Modifiers in the TV format
+ static int translatedModifiers;
+ // ASCII of the key
+ static char ascii;
+ // Keyboard translation tables
+ static unsigned char kbToName[128];
+ static unsigned char kbExtraFlags[128];
+ // Flag to disable keyboard patching. Use SetKbdMapping(linuxDisableKeyPatch).
+ static char dontPatchKeyboard;
+ // Our Virtual Terminal number
+ static int ourVT;
+ // The mode of our VT before we started
+ static struct vt_mode oldVTMode;
+ // The mode of our VT used by TV
+ static struct vt_mode newVTMode;
+ // Indicates if we hooked thed signals and patched the keyboard
+ static char vtHooked;
+ // Indicates if the ioctl to patch the keyboard is usable
+ static char canPatchKeyboard;
+ // Indicates if we patched the keyboard
+ static char keyPatched;
+ // Generic keyboard entry structure used in various places
+ static struct kbentry entry;
+};
+
+#endif // LINUXKEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/linux/log.h b/tvision/include/tv/linux/log.h
new file mode 100644
index 0000000..3b3c3fc
--- /dev/null
+++ b/tvision/include/tv/linux/log.h
@@ -0,0 +1,25 @@
+/**[txh]********************************************************************
+
+ Debug logger helper Copyright 1996-1998 by Robert Hoehne
+ Description:
+ Used to debug Linux driver.
+ I (SET) moved it here to avoid repeating it in each module.
+ The idea is from Robert, I usually use another approach.
+
+***************************************************************************/
+
+#if defined(TVOSf_Linux) && !defined(LOGLINUXDEBUG_INCLUDED)
+#define LOGLINUXDEBUG_INCLUDED
+
+//#define DEBUG
+#ifdef DEBUG
+ extern char *program_invocation_short_name;
+ #define LOG(s) do {CLY_std(cerr) << program_invocation_short_name << ": " << s << CLY_std(endl); fflush(stderr);} while(0)
+#else
+ #define LOG(s) do {;} while(0)
+#endif
+
+#else
+ #define LOG(s) do {;} while(0)
+#endif // LOGLINUXDEBUG_INCLUDED
+
diff --git a/tvision/include/tv/linux/mouse.h b/tvision/include/tv/linux/mouse.h
new file mode 100644
index 0000000..cf5664a
--- /dev/null
+++ b/tvision/include/tv/linux/mouse.h
@@ -0,0 +1,28 @@
+/* Linux keyboard handler routines header.
+ Copyright by Salvador E. Tropea (SET) (2001-2002)
+ Covered by the GPL license. */
+
+#include <tv/unix/mouse.h>
+
+#if defined(TVOSf_Linux) && !defined(LINUXMOUSE_INCLUDED)
+#define LINUXMOUSE_INCLUDED
+
+#ifdef HAVE_GPM
+class THWMouseGPM : public THWMouseUNIX
+{
+protected:
+ THWMouseGPM() {};
+ virtual ~THWMouseGPM();
+
+ static void Suspend();
+ static void Resume();
+ static void GetEvent(MouseEventType &me);
+
+ static void Init();
+
+ friend class TScreenLinux;
+ friend class TScreenUNIX;
+};
+#endif
+
+#endif // LINUXMOUSE_INCLUDED
diff --git a/tvision/include/tv/linux/screen.h b/tvision/include/tv/linux/screen.h
new file mode 100644
index 0000000..db1a74c
--- /dev/null
+++ b/tvision/include/tv/linux/screen.h
@@ -0,0 +1,236 @@
+/* Linux keyboard handler routines header.
+ Copyright by Salvador E. Tropea (SET) (2001-2002)
+ Covered by the GPL license. */
+#if defined(TVOSf_Linux) && !defined(LINUXSCREEN_HEADER_INCLUDED)
+#define LINUXSCREEN_HEADER_INCLUDED
+
+// Modes you can pass to Init
+const int lnxInitVCSrw=0, lnxInitVCSwo=1, lnxInitSimple=2, lnxInitMDA=3;
+
+struct stCodePageCk;
+struct stCodePageLang;
+struct CodePage;
+
+// virtual to avoid problems with multiple inheritance
+class TDisplayLinux : virtual public TDisplay
+{
+protected:
+ TDisplayLinux() {};
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TDisplayLinux();
+ // This sets the pointers of TDisplay to point to this class
+ static void Init(int mode);
+
+ // Behaviors to replace TDisplay
+ // Monochrome (MDA, Hercules, etc.) members are marked with MDA
+ // /dev/vcs* members are marked with VCS
+ static void SetCursorPos(unsigned x, unsigned y);
+ static void SetCursorPosMDA(unsigned x, unsigned y);
+ static void SetCursorPosVCS(unsigned x, unsigned y);
+
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ static void GetCursorPosVCS(unsigned &x, unsigned &y);
+ static void GetCursorPosGeneric(unsigned &x, unsigned &y);
+
+ static void SetCursorShape(unsigned start, unsigned end);
+ static void SetCursorShapeMDA(unsigned start, unsigned end);
+
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ static void GetCursorShapeMDA(unsigned &start, unsigned &end);
+
+ // Not available static void clearScreen(uchar, uchar);
+
+ static ushort GetRows();
+ //static ushort GetRowsMDA(); is ushort TDisplay::defaultGetRows()
+
+ static ushort GetCols();
+ //static ushort GetColsMDA(); is ushort TDisplay::defaultGetCols()
+
+ // Not available static void SetCrtMode(ushort mode);
+ // Not available static ushort getCrtMode();
+ // Not available static void SetCrtModeExt(char *mode);
+ static int CheckForWindowSize(void);
+ static const char *GetWindowTitle(void);
+ static int SetWindowTitle(const char *name);
+
+ static int SetDisPaletteColors(int from, int number, TScreenColor *colors);
+ static void GetDisPaletteColors(int from, int number, TScreenColor *colors);
+
+ // Functions and members specific for this driver
+ // Helpers to make the code easy to read
+ inline static int canWriteVCS();
+ inline static int canReadVCS();
+ static void setUpEnviron();
+ // Current cursor position
+ static int curX, curY;
+ // Position to restore
+ static unsigned oldCurX, oldCurY;
+ // Current cursor shape
+ static int cursorStart,cursorEnd;
+ // 1 when the size of the window where the program is running changed
+ static volatile sig_atomic_t windowSizeChanged;
+ static int vcsWfd; // virtual console system descriptor
+ static int vcsRfd; // Same for reading
+ static int hOut; // Handle for the console output
+ static FILE *fOut; // Stream for the console output
+ // Original environment of the application, here we put the title
+ static char *origEnvir;
+ // New environment, a copy of the original
+ static char *newEnvir;
+ // How much space we have
+ static int maxLenTit;
+ // Can we use TIOCLINUX? Initialized but TScreen, but also used here
+ static char tioclinuxOK;
+ // Color translation table
+ static char cMap[16];
+ // The code page we detected (or just guess) is installed
+ static int installedSFM;
+ static int installedACM;
+};
+
+inline
+int TDisplayLinux::canWriteVCS()
+{
+ return vcsWfd>=0;
+}
+
+inline
+int TDisplayLinux::canReadVCS()
+{
+ return vcsRfd>=0;
+}
+
+// With this order the destructor will be called first for TScreen,
+// TScreenLinux, TScreen, TScreenLinux::suspend, TDisplayLinux and
+// finally TDisplay (twice).
+class TScreenLinux : public TDisplayLinux, public TScreen
+{
+public:
+ TScreenLinux();
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TScreenLinux();
+
+ friend class TDisplayLinux;
+ friend class TGKeyLinux; // Suspend/ResumeFont on VT switch
+
+protected:
+
+ static void Suspend();
+ static void Resume();
+ // Default: ushort fixCrtMode( ushort mode )
+ // Default: void setCrtData();
+ // Default: void clearScreen()
+ static void SetVideoMode(ushort mode);
+ static void SetVideoModeExt(char *mode);
+ static void GetCharactersMDA(unsigned offset,ushort *buf,unsigned count);
+ static void GetCharactersVCS(unsigned offset,ushort *buf,unsigned count);
+ static ushort GetCharacter(unsigned dst);
+ static void SetCharacter(unsigned offset,ushort value);
+ static void SetCharactersTerm(unsigned dst,ushort *src,unsigned len);
+ static void SetCharactersVCS(unsigned dst,ushort *src,unsigned len);
+ static void SetCharactersMDA(unsigned dst,ushort *src,unsigned len);
+ static int System(const char *command, pid_t *pidChild, int in, int out,
+ int err);
+ static int GetFontGeometry(unsigned &w, unsigned &h);
+ static int SetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP=-1, int appCP=-1);
+ static void RestoreFonts();
+
+ // Initialization code executed just once
+ static int InitOnce();
+ // Initialize member pointers
+ static void Init(int mode);
+ // Detects if we can access /dev/vcs* device. Initializes vcsWfd and vcsRfd.
+ static void DetectVCS();
+ // Detects a MDA board. Indicated in secondaryAvailable.
+ static void DetectSecondaryDisplay();
+ // Window size change signal handler
+ static void sigWindowSizeChanged(int sig);
+ // Helper function to save the current content of the screen
+ static void SaveScreen();
+ static void RestoreScreen();
+ static void SaveScreenReleaseMemory(void);
+ // Helper used to resize screenBuffer
+ static void CheckSizeBuffer(int oldWidth, int oldHeight);
+ // Helper to write the text and escape sequences
+ static void writeBlock(int dst, int len, ushort *old, ushort *src);
+ // Helper to set the color escape sequence
+ static void mapColor(int col);
+ // Closes and releases all, called from TDisplayLinux
+ static void DeallocateResources();
+ // Analyzes the console code page
+ static int AnalyzeCodePage();
+ static void CreateSFMFromTable(ushort *table);
+ static void CreateACMFromTable(ushort *table);
+ // A guess about the code page using the language
+ static int GuessCodePageFromLANG();
+ // Tries to find the geometry of loaded fonts
+ static int GetLinuxFontGeometry();
+ static void FreeFontsMemory();
+ static int AllocateFontsMemory();
+ static int GetLinuxFont();
+ static void ExpandFont(uchar *dest, TScreenFont256 *font);
+ static void SuspendFont();
+ static void ResumeFont();
+ static int isInUTF8();
+ static void AvoidUTF8Mode();
+ // Terminal state before starting
+ static struct termios outTermiosOrig;
+ // Our terminal state
+ static struct termios outTermiosNew;
+ // Last error
+ static const char *error;
+ // Is MDA accesible?
+ static char secondaryAvailable;
+ // File handle for mmaped memory of MDA board
+ static int mdaMemH;
+ // Mmaped MDA memory
+ static ushort *mdaMem;
+ // Kind of palette
+ static int palette;
+ enum
+ {
+ PAL_MONO, PAL_LOW, PAL_HIGH, PAL_LOW2
+ };
+ // Buffer containing the screen before we started
+ static ushort *userBuffer;
+ // Size of the buffer
+ static unsigned userBufferSize;
+ // Current colors, for escape sequences
+ static int oldCol, oldBack, oldFore;
+ // List of known code pages
+ static struct stCodePageCk knownFonts[];
+ static struct stCodePageCk knownScreenMaps[];
+ // List of known languages and their code pages
+ static struct stCodePageLang langCodePages[];
+ // Used when the loaded maps are unknown
+ static CodePage unknownACM, unknownSFM;
+ // Fonts stuff
+ static uchar canSetFonts,primaryFontSet,secondaryFontSet;
+ static struct console_font_op linuxFont;
+ static struct console_font_op ourFont;
+ static int origCPScr, origCPApp, origCPInp;
+ // Original UTF-8 state
+ static int origUTF8Mode;
+ // We detected the user is using a 512 symbols font
+ static int font512Detected;
+ // Related to font512Detected, it means we have to reduce colors to 8
+ static int reduceTo8Colors;
+};
+
+// SET: Enclosed all the I/O stuff in "__i386__ defined" because I don't
+// think it have much sense in non-Intel PCs. In fact looks like it gives
+// some problems when compiling for Alpha (__alpha__).
+// Also make it only for Linux until I know how to do it for FreeBSD.
+
+#if defined(TVCPU_x86)
+ // Needed for ioperm, used only by i386.
+ // I also noted that glibc 2.1.3 for Alpha, SPARC and PPC doesn't have
+ // this header
+ #include <sys/perm.h>
+ #define h386LowLevel
+#endif
+
+#endif // LINUXSCREEN_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/listbox.h b/tvision/include/tv/listbox.h
new file mode 100644
index 0000000..a01260b
--- /dev/null
+++ b/tvision/include/tv/listbox.h
@@ -0,0 +1,94 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to add functionality.
+
+ *
+ *
+ */
+
+#if defined( Uses_TListBox ) && !defined( __TListBox )
+#define __TListBox
+
+class TRect;
+class TScrollBar;
+class TCollection;
+
+#pragma pack(1)
+struct TListBoxRec
+{
+ TCollection *items CLY_Packed;
+ ccIndex selection CLY_Packed;
+};
+#pragma pack()
+
+class TListBox : public TListViewer
+{
+
+public:
+
+ TListBox( const TRect& bounds, ushort aNumCols, TScrollBar *aScrollBar );
+ TListBox( const TRect& bounds, ushort aNumCols, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar, Boolean aCenterOps = False );
+ ~TListBox();
+
+ virtual uint32 dataSize();
+ virtual void getData( void *rec );
+ virtual void getText( char *dest, ccIndex item, short maxLen );
+ virtual void newList( TCollection *aList );
+ virtual void setData( void *rec );
+ // SET: You not always want to destroy the items.
+ virtual void newList( TCollection *aList, Boolean destroyItems );
+ virtual void setData( void *rec, Boolean destroyItems );
+
+ // SET: Center the list in setData
+ Boolean center;
+
+ TCollection *list();
+
+protected:
+ TCollection *items;
+
+private:
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TListBox( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TListBox& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TListBox*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TListBox& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TListBox* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+inline TCollection *TListBox::list()
+{
+ return items;
+}
+
+#endif // Uses_TListBox
+
diff --git a/tvision/include/tv/lstviewr.h b/tvision/include/tv/lstviewr.h
new file mode 100644
index 0000000..2a47cfe
--- /dev/null
+++ b/tvision/include/tv/lstviewr.h
@@ -0,0 +1,102 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TListViewer ) && !defined( __TListViewer )
+#define __TListViewer
+
+class TRect;
+class TScrollBar;
+struct TEvent;
+
+class TListViewer : public TView
+{
+
+public:
+
+ TListViewer( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar
+ );
+
+ virtual void changeBounds( const TRect& bounds );
+ virtual void draw();
+ virtual void focusItem( ccIndex item );
+ virtual void focusItemCentered( ccIndex item );
+ virtual TPalette& getPalette() const;
+ virtual void getText( char *dest, ccIndex item, short maxLen );
+ virtual Boolean isSelected( ccIndex item );
+ virtual void handleEvent( TEvent& event );
+ virtual void selectItem( ccIndex item );
+ void setRange( ccIndex aRange );
+ virtual void setState( ushort aState, Boolean enable );
+
+ virtual void focusItemNum( ccIndex item );
+ virtual void shutDown();
+
+ TScrollBar *hScrollBar;
+ TScrollBar *vScrollBar;
+ short numCols;
+ ccIndex topItem;
+ ccIndex focused;
+ ccIndex range;
+ Boolean handleSpace;
+
+ static uchar columnSeparator;
+ static uchar ocolumnSeparator;
+
+ // SET: see tlistvie.cc for more information
+ unsigned getExtraOptions() { return extraOptions; }
+ void setExtraOptions(unsigned ops) { extraOptions=ops; }
+
+protected:
+ // SET: extra options ored by default to all objects of this class.
+ static unsigned extraOptions;
+ // SET: neede to change the scroll bars too.
+ void setNumCols(int aNumCols);
+ // SET: Used to center the focused item.
+ Boolean center;
+
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TListViewer( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TListViewer& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TListViewer*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TListViewer& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TListViewer* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TListViewer
+
diff --git a/tvision/include/tv/menu.h b/tvision/include/tv/menu.h
new file mode 100644
index 0000000..ef907fe
--- /dev/null
+++ b/tvision/include/tv/menu.h
@@ -0,0 +1,36 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TMenu ) && !defined( __TMenu )
+#define __TMenu
+
+class CLY_EXPORT TMenuItem;
+
+class CLY_EXPORT TMenu
+{
+
+public:
+ TMenu() : items(0), deflt(0) {};
+ TMenu( TMenuItem& itemList )
+ { items = &itemList; deflt = &itemList; }
+ TMenu( TMenuItem& itemList, TMenuItem& TheDefault )
+ { items = &itemList; deflt = &TheDefault; }
+ ~TMenu();
+
+ TMenuItem *items;
+ TMenuItem *deflt;
+
+};
+
+#endif // Uses_TMenu
+
diff --git a/tvision/include/tv/menubar.h b/tvision/include/tv/menubar.h
new file mode 100644
index 0000000..33eef82
--- /dev/null
+++ b/tvision/include/tv/menubar.h
@@ -0,0 +1,76 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TMenuBar */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Disabled text */
+/* 3 = Shortcut text */
+/* 4 = Normal selection */
+/* 5 = Disabled selection */
+/* 6 = Shortcut selection */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TMenuBar ) && !defined( __TMenuBar )
+#define __TMenuBar
+
+class TRect;
+class TMenu;
+
+class CLY_EXPORT TMenuBar : public TMenuView
+{
+
+public:
+
+ TMenuBar( const TRect& bounds, TMenu *aMenu );
+ TMenuBar( const TRect& bounds, TSubMenu &aMenu );
+ ~TMenuBar();
+
+ void computeLength();
+ virtual void draw();
+ virtual TRect getItemRect( TMenuItem *item );
+ virtual void changeBounds(const TRect& bounds);
+
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TMenuBar( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TMenuBar& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TMenuBar*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TMenuBar& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TMenuBar* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TMenuBar
+
diff --git a/tvision/include/tv/menubox.h b/tvision/include/tv/menubox.h
new file mode 100644
index 0000000..9156738
--- /dev/null
+++ b/tvision/include/tv/menubox.h
@@ -0,0 +1,82 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TMenuBox */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Disabled text */
+/* 3 = Shortcut text */
+/* 4 = Normal selection */
+/* 5 = Disabled selection */
+/* 6 = Shortcut selection */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TMenuBox ) && !defined( __TMenuBox )
+#define __TMenuBox
+
+class TRect;
+class TMenu;
+class TMenuView;
+class TDrawBuffer;
+
+class TMenuBox : public TMenuView
+{
+
+public:
+
+ TMenuBox( const TRect& bounds, TMenu *aMenu, TMenuView *aParentMenu);
+
+ virtual void draw();
+ virtual TRect getItemRect( TMenuItem *item );
+
+ static char frameChars[];
+ static char oframeChars[];
+ static char rightArrow;
+ static char orightArrow;
+
+private:
+
+ void frameLine( TDrawBuffer&, short n );
+ void drawLine( TDrawBuffer& );
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TMenuBox( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TMenuBox& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TMenuBox*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TMenuBox& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TMenuBox* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TMenuBox
+
diff --git a/tvision/include/tv/menuitem.h b/tvision/include/tv/menuitem.h
new file mode 100644
index 0000000..4204f22
--- /dev/null
+++ b/tvision/include/tv/menuitem.h
@@ -0,0 +1,77 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea. More operators and append. Also i18n support.
+
+ *
+ *
+ */
+
+#if defined( Uses_TMenuItem ) && !defined( __TMenuItem )
+#define __TMenuItem
+
+class TMenu;
+
+class CLY_EXPORT TMenuItem
+{
+
+public:
+
+ TMenuItem( const char *aName,
+ ushort aCommand,
+ ushort aKeyCode,
+ ushort aHelpCtx = hcNoContext,
+ const char *p = 0,
+ TMenuItem *aNext = 0
+ );
+ TMenuItem( const char *aName,
+ ushort aKeyCode,
+ TMenu *aSubMenu,
+ ushort aHelpCtx = hcNoContext,
+ TMenuItem *aNext = 0
+ );
+
+ ~TMenuItem();
+
+ void append( TMenuItem *aNext );
+
+ TMenuItem *next;
+ const char *name;
+ stTVIntl *intlName;
+ ushort command;
+ Boolean disabled;
+ ushort keyCode;
+ ushort helpCtx;
+ union
+ {
+ const char *param;
+ TMenu *subMenu;
+ };
+};
+
+// SET: Sugested by Dean Wakerley <dean@wakerley.com> looks like
+// Borland deprecated it without reasons.
+inline TMenuItem& operator + ( TMenuItem& s, TMenuItem& i )
+{
+ s.append(&i);
+ return s;
+}
+
+// SET: From TVTools
+inline void operator += ( TMenuItem& i1, TMenuItem& i2 )
+{
+ i1 = i1 + i2;
+}
+
+inline TMenuItem &newLine()
+{
+ return *new TMenuItem( 0, 0, 0, hcNoContext, 0, 0 );
+}
+
+#endif // Uses_TMenuItem
+
diff --git a/tvision/include/tv/menus.h b/tvision/include/tv/menus.h
new file mode 100644
index 0000000..4febdd7
--- /dev/null
+++ b/tvision/include/tv/menus.h
@@ -0,0 +1,97 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea: Added += operators.
+
+ *
+ *
+ */
+
+class TSubMenu;
+class TMenuItem;
+class TStatusDef;
+class TStatusItem;
+
+TSubMenu& operator + ( TSubMenu& s, TMenuItem& i );
+TSubMenu& operator + ( TSubMenu& s1, TSubMenu& s2 );
+TStatusDef& operator + ( TStatusDef& s1, TStatusItem& s2 );
+TStatusDef& operator + ( TStatusDef& s1, TStatusDef& s2 );
+
+#if defined( Uses_TMenuItem )
+ #include <tv/menuitem.h>
+#endif
+
+#if defined( Uses_TSubMenu )
+ #include <tv/submenu.h>
+#endif
+
+#if defined( Uses_TMenu )
+ #include <tv/menu.h>
+#endif
+
+#if defined( Uses_TMenuView )
+ #include <tv/menuview.h>
+#endif
+
+#if defined( Uses_TMenuBar )
+ #include <tv/menubar.h>
+#endif
+
+#if defined( Uses_TMenuBox )
+ #include <tv/menubox.h>
+#endif
+
+#if defined( Uses_TStatusItem )
+ #include <tv/statsitm.h>
+#endif
+
+#if defined( Uses_TStatusDef )
+ #include <tv/statsdef.h>
+#endif
+
+#if defined( Uses_TStatusLine )
+ #include <tv/statslin.h>
+#endif
+
+// SET: The following 4 operator are from TVTools
+// They are simple and adds more coherence.
+#if defined( Uses_TSubMenu ) && !defined( TSubMenu_operators_defined )
+#define TSubMenu_operators_defined
+inline void operator += ( TSubMenu& s1, TSubMenu& s2 )
+{
+ s1 = s1 + s2;
+}
+#endif
+
+#if defined( Uses_TSubMenu ) && defined( Uses_TMenuItem ) && \
+ !defined( TSubMenu_Item_operators_defined )
+#define TSubMenu_Item_operators_defined
+inline void operator += ( TSubMenu& i1, TMenuItem& i2 )
+{
+ i1 = i1 + i2;
+}
+#endif
+
+#if defined( Uses_TStatusDef ) && !defined( TStatusDef_operators_defined )
+#define TStatusDef_operators_defined
+inline void operator += ( TStatusDef& s1, TStatusDef& s2 )
+{
+ s1 = s1 + s2;
+}
+#endif
+
+
+#if defined( Uses_TStatusDef ) && defined( Uses_TStatusItem ) && \
+ !defined( TStatusDef_Item_operators_defined )
+#define TStatusDef_Item_operators_defined
+inline void operator += ( TStatusDef& s1, TStatusItem& s2 )
+{
+ s1 = s1 + s2;
+}
+#endif // Uses_TStatusItem
+
diff --git a/tvision/include/tv/menuview.h b/tvision/include/tv/menuview.h
new file mode 100644
index 0000000..73ba7fb
--- /dev/null
+++ b/tvision/include/tv/menuview.h
@@ -0,0 +1,137 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to enhance functionality.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TMenuView */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Disabled text */
+/* 3 = Shortcut text */
+/* 4 = Normal selection */
+/* 5 = Disabled selection */
+/* 6 = Shortcut selection */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TMenuView ) && !defined( __TMenuView )
+#define __TMenuView
+
+class TRect;
+class TMenu;
+struct TEvent;
+
+class TMenuView : public TView
+{
+
+public:
+
+ TMenuView( const TRect& bounds, TMenu *aMenu, TMenuView *aParent );
+ TMenuView( const TRect& bounds );
+
+ void setBounds( const TRect& bounds );
+ virtual ushort execute();
+ TMenuItem *findItem( char ch );
+ virtual TRect getItemRect( TMenuItem *item );
+ virtual ushort getHelpCtx();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ TMenuItem *hotKey( ushort keyCode );
+ TMenuView *newSubView( const TRect& bounds,
+ TMenu *aMenu,
+ TMenuView *aParentMenu
+ );
+ // SET: Looks like some users really likes the original behavior of
+ // having 1 space around menu items. As it reduces the number of menues
+ // we can have. I added a conditional way to control it. The code is in
+ // TMenuBar, when you create a menu bar (or chanBounds it) the Bar
+ // calculates the length of the items and if they are greater than size.x
+ // enters in the compatMenu mode. "Norberto Alfredo Bensa (Beto)"
+ // <norberto.bensa@abaconet.com.ar> sent me an uncoditional patch that I used
+ // as base. This variable is 0 by default (TMenuView constructor)
+ char compactMenu;
+
+protected:
+
+ TMenuView *parentMenu;
+ TMenu *menu;
+ TMenuItem *current;
+
+ // SET: Added to make the code easier to read and to implement some
+ // alternatives.
+ Boolean keyToItem(TEvent &event);
+ Boolean keyToHotKey(TEvent &event);
+
+private:
+
+ void nextItem();
+ void prevItem();
+ void trackKey( Boolean findNext );
+ Boolean mouseInOwner( TEvent& e );
+ Boolean mouseInMenus( TEvent& e );
+ void trackMouse( TEvent& e );
+ TMenuView *topMenu();
+ Boolean updateMenu( TMenu *menu );
+ void do_a_select( TEvent& );
+ TMenuItem *findHotKey( TMenuItem *p, ushort keyCode );
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+ static void writeMenu( opstream&, TMenu * );
+ static TMenu *readMenu( ipstream& );
+
+protected:
+
+ TMenuView( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TMenuView& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TMenuView*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TMenuView& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TMenuView* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+inline TMenuView::TMenuView( const TRect& bounds,
+ TMenu *aMenu,
+ TMenuView *aParent
+ ) :
+ TView(bounds), compactMenu ( 0 ), parentMenu( aParent ), menu( aMenu ),
+ current( 0 )
+{
+ eventMask |= evBroadcast;
+}
+
+inline TMenuView::TMenuView( const TRect& bounds ) :
+ TView(bounds), compactMenu(0), parentMenu(0), menu(0), current(0)
+{
+ eventMask |= evBroadcast;
+}
+
+#endif // Uses_TMenuView
+
diff --git a/tvision/include/tv/mnoselct.h b/tvision/include/tv/mnoselct.h
new file mode 100644
index 0000000..16b033e
--- /dev/null
+++ b/tvision/include/tv/mnoselct.h
@@ -0,0 +1,66 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TMonoSelector ) && !defined( __TMonoSelector )
+#define __TMonoSelector
+
+class TRect;
+struct TEvent;
+
+class TMonoSelector : public TCluster
+{
+
+public:
+
+ TMonoSelector( const TRect& bounds );
+ virtual void draw();
+ virtual void handleEvent( TEvent& event );
+ virtual Boolean mark( int item );
+ void newColor();
+ virtual void press( int item );
+ void movedTo( int item );
+
+ static char button[];
+ static char obutton[];
+
+private:
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TMonoSelector( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TMonoSelector& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TMonoSelector*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TMonoSelector& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TMonoSelector* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TMonoSelector
+
diff --git a/tvision/include/tv/msgbox.h b/tvision/include/tv/msgbox.h
new file mode 100644
index 0000000..70829a7
--- /dev/null
+++ b/tvision/include/tv/msgbox.h
@@ -0,0 +1,83 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea.
+
+ *
+ *
+ */
+
+#if defined( Uses_MsgBox ) && !defined( __MsgBox )
+#define __MsgBox
+
+#if !defined( __STDARG_H )
+#include <stdarg.h>
+#endif // __STDARG_H
+
+class TRect;
+class TValidator;
+
+ushort CLY_EXPORT messageBox( const char *msg, ushort aOptions );
+ushort CLY_EXPORT messageBox( ushort aOptions, const char *msg, ... )
+ __attribute__ ((format (printf, 2, 3)));
+
+ushort CLY_EXPORT messageBoxRect( const TRect &r, const char *msg, ushort aOptions );
+ushort CLY_EXPORT messageBoxRect( const TRect &r, ushort aOptions, const char *msg, ... )
+ __attribute__ ((format (printf, 3, 4)));
+
+ushort CLY_EXPORT inputBox( const char *Title, const char *aLabel, char *s, int limit,
+ TValidator *aVal=NULL);
+
+ushort CLY_EXPORT inputBoxRect( const TRect &bounds, const char *title,
+ const char *aLabel, char *s, int limit,
+ TValidator *aVal=NULL);
+
+const ushort
+
+// Message box classes
+
+ mfWarning = 0x0000, // Display a Warning box
+ mfError = 0x0001, // Dispaly a Error box
+ mfInformation = 0x0002, // Display an Information Box
+ mfConfirmation = 0x0003, // Display a Confirmation Box
+
+// Message box button flags
+
+ mfYesButton = 0x0100, // Put a Yes button into the dialog
+ mfNoButton = 0x0200, // Put a No button into the dialog
+ mfOKButton = 0x0400, // Put an OK button into the dialog
+ mfCancelButton = 0x0800, // Put a Cancel button into the dialog
+
+// Special flag: Avoid translating this message, is already translated.
+ mfDontTranslate = 0x4000,
+// Special flag: For the "Don't show it next time" field
+ mfDontShowAgain = 0x8000,
+
+ mfYesNoCancel = mfYesButton | mfNoButton | mfCancelButton,
+ // Standard Yes, No, Cancel dialog
+ mfOKCancel = mfOKButton | mfCancelButton;
+ // Standard OK, Cancel dialog
+
+class CLY_EXPORT MsgBoxText
+{
+
+public:
+
+// static const char * yesText;
+// static const char * noText;
+// static const char * okText;
+// static const char * cancelText;
+// static const char * warningText;
+// static const char * errorText;
+// static const char * informationText;
+// static const char * confirmText;
+};
+
+#endif // Uses_MsgBox
+
+
diff --git a/tvision/include/tv/no_mss.h b/tvision/include/tv/no_mss.h
new file mode 100644
index 0000000..2627204
--- /dev/null
+++ b/tvision/include/tv/no_mss.h
@@ -0,0 +1,9 @@
+/*
+ Copyright (c) 2001 by Salvador E. Tropea and Laurynas Biveinis
+ Covered by the GPL license.
+ This include disables MSS until yes_mss.h is included.
+ Needed to wrap uses of operators/functions defined as macros in MSS.
+*/
+#ifdef MSS
+#include <no_mss.h>
+#endif
diff --git a/tvision/include/tv/nointl.h b/tvision/include/tv/nointl.h
new file mode 100644
index 0000000..c624bf0
--- /dev/null
+++ b/tvision/include/tv/nointl.h
@@ -0,0 +1,54 @@
+/* Internationalization support dummies routines header.
+ Copyright by Salvador E. Tropea (SET) (2003-2005)
+ Covered by the GPL license. */
+/* Included from intl.h never directly */
+
+#ifdef __cplusplus
+struct stTVIntl
+{
+ char *translation;
+ int cp;
+};
+
+extern CLY_EXPORT char *newStr( const char * );
+
+class CLY_EXPORT TVIntl
+{
+public:
+ TVIntl() {}
+ static const char *textDomain(const char *) { return NULL; }
+ static const char *bindTextDomain(const char *, const char *) { return NULL; }
+ static int autoInit(const char *package, const char *localeDir=NULL) { return 1; }
+ static const char *getText(const char *msgid) { return msgid; }
+ static void setCatalogEncoding(int ) {}
+ static void enableTranslations() {}
+ static void disableTranslations() {}
+ static char *getTextNew(const char *msgid, Boolean onlyIntl=False)
+ { return onlyIntl ? NULL : newStr(msgid); }
+ static const char *getText(const char *msgid, stTVIntl *&)
+ { return msgid; }
+ static void freeSt(stTVIntl *&) {}
+ static stTVIntl *emptySt() { return NULL; }
+ static stTVIntl *dontTranslateSt() { return NULL; }
+ static int snprintf(char *dest, size_t sz, const char *fmt, ...);
+ #ifdef Uses_intl_fprintf
+ static int fprintf(FILE *f, const char *fmt, ...);
+ #endif
+};
+#endif /* __cplusplus */
+
+#ifndef _
+ #define _(msg) (msg)
+#endif
+
+#ifndef __
+ #define __(msg) (msg)
+#endif
+
+#ifndef BINDTEXTDOMAIN
+ #define BINDTEXTDOMAIN(a,b)
+#endif
+
+#ifndef TEXTDOMAIN
+ #define TEXTDOMAIN(a)
+#endif
diff --git a/tvision/include/tv/nscoll.h b/tvision/include/tv/nscoll.h
new file mode 100644
index 0000000..ebece1c
--- /dev/null
+++ b/tvision/include/tv/nscoll.h
@@ -0,0 +1,88 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TNSCollection ) && !defined( __TNSCollection )
+#define __TNSCollection
+// Avoid replacing free by MSS's macro
+#include <tv/no_mss.h>
+
+class CLY_EXPORT TNSCollection : public TObject
+{
+
+public:
+
+ TNSCollection( ccIndex aLimit, ccIndex aDelta );
+ ~TNSCollection();
+
+ virtual void shutDown();
+
+ void *at( ccIndex index )
+ {
+ if( index < 0 || index >= count )
+ error(1,0);
+ return items[index];
+ }
+ virtual ccIndex indexOf( void *item );
+
+ void atFree( ccIndex index );
+ void atRemove( ccIndex index );
+ void remove( void *item );
+ void removeAll();
+ void free( void *item );
+ void freeAll();
+
+ virtual void atInsert( ccIndex index, void *item );
+ void atPut( ccIndex index, void *item );
+ void atReplace( ccIndex index, void *item ); // SET: Why not? ;-)
+ virtual ccIndex insert( void *item );
+
+ virtual void error( ccIndex code, ccIndex info );
+
+ void *firstThat( ccTestFunc Test, void *arg );
+ void *lastThat( ccTestFunc Test, void *arg );
+ void forEach( ccAppFunc action, void *arg );
+
+ void pack();
+ virtual void setLimit( ccIndex aLimit );
+
+ ccIndex getCount()
+ { return count; }
+
+ // SET: I added it to create collections with static strings inserted
+ // in it. I think that's a common case and strduping each insertion is
+ // a real waste.
+ void setOwnerShip(Boolean option) { shouldDelete=option; }
+ // SET: That's quite natural. I did it slower than at() but also smaller
+ // I added it after error became virtual which makes it really bloated.
+ void *operator[](ccIndex i);
+
+protected:
+
+ TNSCollection();
+
+ void **items;
+ ccIndex count;
+ ccIndex limit;
+ ccIndex delta;
+ Boolean shouldDelete;
+
+private:
+
+ virtual void freeItem( void *item );
+
+};
+
+#include <tv/yes_mss.h>
+
+#endif // Uses_TNSCollection
+
diff --git a/tvision/include/tv/nssorcol.h b/tvision/include/tv/nssorcol.h
new file mode 100644
index 0000000..02de137
--- /dev/null
+++ b/tvision/include/tv/nssorcol.h
@@ -0,0 +1,47 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TNSSortedCollection ) && !defined( __TNSSortedCollection )
+#define __TNSSortedCollection
+
+class CLY_EXPORT TNSSortedCollection: public virtual TNSCollection
+{
+
+public:
+
+ TNSSortedCollection( ccIndex aLimit, ccIndex aDelta) :
+ TNSCollection( aLimit, aDelta ), duplicates(False)
+ { delta = aDelta; setLimit( aLimit ); }
+
+ virtual Boolean search( void *key, ccIndex& index );
+
+ virtual ccIndex indexOf( void *item );
+ virtual ccIndex insert( void *item );
+
+ Boolean duplicates;
+ virtual void *keyOf( void *item );
+
+ void reSort(); // SET: Sort it again
+
+protected:
+
+ TNSSortedCollection() : duplicates(False) {}
+
+private:
+
+ virtual int compare( void *key1, void *key2 ) = 0;
+
+};
+
+#endif // Uses_TNSSortedCollection
+
diff --git a/tvision/include/tv/object.h b/tvision/include/tv/object.h
new file mode 100644
index 0000000..0c8926b
--- /dev/null
+++ b/tvision/include/tv/object.h
@@ -0,0 +1,57 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TObject ) && !defined( __TObject )
+#define __TObject
+
+#include <stddef.h>
+
+class CLY_EXPORT TObject
+{
+
+public:
+
+ virtual ~TObject();
+
+ static void CLY_destroy( TObject * );
+ virtual void shutDown();
+
+private:
+
+};
+
+inline void TObject::CLY_destroy( TObject *o )
+{
+ if( o != 0 )
+ o->shutDown();
+ delete o;
+}
+
+inline void CLY_destroy( TObject *o )
+{
+ if (o)
+ {
+ o->shutDown();
+ delete o;
+ }
+}
+
+// SET: It also sets the pointer to 0
+#define destroy0(o) \
+{ \
+ CLY_destroy(o);\
+ o=0;\
+}
+
+#endif // Uses_TObject
+
diff --git a/tvision/include/tv/objects.h b/tvision/include/tv/objects.h
new file mode 100644
index 0000000..e9ee368
--- /dev/null
+++ b/tvision/include/tv/objects.h
@@ -0,0 +1,38 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TPoint )
+
+#include <tv/point.h>
+
+#endif
+
+#if defined( Uses_TRect )
+
+#include <tv/rect.h>
+
+#endif
+
+#if defined( Uses_TCollection )
+
+#include <tv/collectn.h>
+
+#endif
+
+#if defined( Uses_TSortedCollection )
+
+#include <tv/sortcoll.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/ofpstrm.h b/tvision/include/tv/ofpstrm.h
new file mode 100644
index 0000000..981ae35
--- /dev/null
+++ b/tvision/include/tv/ofpstrm.h
@@ -0,0 +1,45 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis and Christoph Bauer.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class ofpstream */
+/* */
+/* Base class for writing streamable objects to file streams */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_ofpstream ) && !defined( __ofpstream )
+#define __ofpstream
+
+class CLY_EXPORT ofpstream : public fpbase, public opstream
+{
+public:
+ ofpstream();
+ ofpstream(const char *,
+ CLY_OpenModeT = CLY_IOSOut,
+ int = CLY_FBOpenProtDef);
+ ofpstream(int);
+ ofpstream(int, char *, int);
+ ~ofpstream();
+
+ CLY_filebuf *rdbuf();
+ void open(const char *,
+ CLY_OpenModeT = CLY_IOSOut,
+ int = CLY_FBOpenProtDef);
+};
+
+#endif // Uses_ofpstream
+
diff --git a/tvision/include/tv/opstream.h b/tvision/include/tv/opstream.h
new file mode 100644
index 0000000..d6847ee
--- /dev/null
+++ b/tvision/include/tv/opstream.h
@@ -0,0 +1,88 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis and Christoph Bauer.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class opstream */
+/* */
+/* Base class for writing streamable objects */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_opstream ) && !defined( __opstream )
+#define __opstream
+
+class TStreamableClass;
+class TPWrittenObjects;
+
+class CLY_EXPORT opstream : virtual public pstream
+{
+public:
+ opstream( CLY_streambuf * );
+ ~opstream();
+
+ CLY_StreamPosT tellp();
+ opstream& seekp( CLY_StreamPosT );
+ opstream& seekp( CLY_StreamOffT, CLY_IOSSeekDir );
+ opstream& flush();
+
+ void writeByte( uchar );
+ void writeBytes( const void *, size_t );
+ void writeWord( ushort val ) { writeShort(val); };
+ void writeString( const char * );
+ /* Platform dependent: */
+ void writeShort(ushort val);
+ void writeInt(uint val);
+ void writeLong(ulong val);
+ /* The following are platform independent (stores in little endian) */
+ void write8(uint8 val) { writeByte(val); };
+ void write16(uint16 val);
+ void write32(uint32 val);
+ void write64(uint64 val);
+
+ opstream& operator << ( char val ) { writeByte(val); return *this; };
+ #ifndef TVComp_BCPP
+ opstream& operator << ( signed char val ) { writeByte(val); return *this; };
+ #endif
+ opstream& operator << ( unsigned char val ) { writeByte(val); return *this; };
+ opstream& operator << ( signed short val ) { writeShort(val); return *this; };
+ opstream& operator << ( unsigned short val ) { writeShort(val); return *this; };
+ opstream& operator << ( signed int val ) { writeInt(val); return *this; };
+ opstream& operator << ( unsigned int val ) { writeInt(val); return *this; };
+ opstream& operator << ( signed long val ) { writeLong(val); return *this; };
+ opstream& operator << ( unsigned long val ) { writeLong(val); return *this; };
+ opstream& operator << ( float val ) { writeBytes(&val,sizeof(val)); return *this; };
+ opstream& operator << ( double val ) { writeBytes(&val,sizeof(val)); return *this; };
+ opstream& operator << ( long double val ) { writeBytes(&val,sizeof(val)); return *this; };
+
+ friend opstream& operator << ( opstream&, TStreamable& );
+ friend opstream& operator << ( opstream&, TStreamable * );
+
+protected:
+ opstream();
+
+ void writePrefix( const TStreamable& );
+ void writeData( TStreamable& );
+ void writeSuffix( const TStreamable& );
+
+ P_id_type find( const void *adr );
+ void registerObject( const void *adr );
+
+private:
+ TPWrittenObjects *objs;
+};
+
+#endif // Uses_opstream
+
diff --git a/tvision/include/tv/osclipboard.h b/tvision/include/tv/osclipboard.h
new file mode 100644
index 0000000..1579661
--- /dev/null
+++ b/tvision/include/tv/osclipboard.h
@@ -0,0 +1,44 @@
+/**************************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+ Description:
+ OS independent clipboard system class. Uses to access the OS clipboard.
+
+***************************************************************************/
+
+class TScreen;
+class TVDOSClipboard;
+class TVWin32Clipboard;
+class TVX11Clipboard;
+
+class CLY_EXPORT TVOSClipboard
+{
+public:
+ TVOSClipboard() {};
+ ~TVOSClipboard() { if (destroy) destroy(); };
+
+ static int (*copy)(int id, const char *buffer, unsigned len);
+ static char *(*paste)(int id, unsigned &length);
+ static const
+ char *getName() { return name; };
+ static int isAvailable() { return available; };
+ static const
+ char *getError();
+ static void clearError() { error=0; };
+ static void (*destroy)();
+
+protected:
+ static const char *name;
+ static int available;
+ static int error;
+ static int errors;
+ static const char **nameErrors;
+
+ friend class TScreen;
+ friend class TVDOSClipboard;
+ friend class TVX11Clipboard;
+ friend class TVWin32Clipboard;
+};
+
diff --git a/tvision/include/tv/otstream.h b/tvision/include/tv/otstream.h
new file mode 100644
index 0000000..3a3cca7
--- /dev/null
+++ b/tvision/include/tv/otstream.h
@@ -0,0 +1,26 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis.
+
+ *
+ *
+ */
+
+#if defined( Uses_otstream ) && !defined( __otstream )
+#define __otstream
+
+class otstream : public CLY_std(ostream)
+{
+public:
+ otstream( TTerminal * );
+};
+
+#endif
+
diff --git a/tvision/include/tv/palette.h b/tvision/include/tv/palette.h
new file mode 100644
index 0000000..7f3d19a
--- /dev/null
+++ b/tvision/include/tv/palette.h
@@ -0,0 +1,38 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TPalette ) && !defined( __TPalette )
+#define __TPalette
+
+class CLY_EXPORT TPalette
+{
+
+public:
+
+ TPalette( const char *, ushort );
+ TPalette( const TPalette& );
+ ~TPalette();
+
+ TPalette& operator = ( const TPalette& );
+
+ uchar& operator[]( int index) const
+ {
+ return data[index];
+ }
+
+ uchar *data;
+
+};
+
+#endif // Uses_TPalette
+
diff --git a/tvision/include/tv/parmtext.h b/tvision/include/tv/parmtext.h
new file mode 100644
index 0000000..d32139b
--- /dev/null
+++ b/tvision/include/tv/parmtext.h
@@ -0,0 +1,64 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+ * Modified by Salvador E. Tropea (SET) for RHTVision port.
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TParamText */
+/* */
+/* Palette layout */
+/* 1 = Text */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TParamText ) && !defined( __TParamText )
+#define __TParamText
+
+class TRect;
+
+const int tparamTextMaxLen=256;
+#define SAFE_CODE 1 // Don't corrupt memory if tparamTextMaxLen is small
+
+class TParamText : public TStaticText
+{
+public:
+ TParamText( const TRect& bounds );
+ ~TParamText();
+
+ virtual void getText( char *str, int maxLen );
+ virtual void setText( const char *fmt, ... );
+ virtual int getTextLen();
+
+protected:
+ char *str;
+
+#if !defined( NO_STREAM )
+private:
+ virtual const char *streamableName() const
+ { return name; }
+protected:
+ TParamText( StreamableInit );
+public:
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TParamText& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TParamText*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TParamText& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TParamText* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TParamText
+
diff --git a/tvision/include/tv/parttree.h b/tvision/include/tv/parttree.h
new file mode 100644
index 0000000..7cddfd7
--- /dev/null
+++ b/tvision/include/tv/parttree.h
@@ -0,0 +1,5 @@
+/*
+ This file will be used by TV in future releases.
+ I added it because the r2_0_1u cvs branch uses it and some code could have
+it as dependencie.
+*/
diff --git a/tvision/include/tv/point.h b/tvision/include/tv/point.h
new file mode 100644
index 0000000..bc054b0
--- /dev/null
+++ b/tvision/include/tv/point.h
@@ -0,0 +1,58 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TPoint ) && !defined( __TPoint )
+#define __TPoint
+
+class TPoint
+{
+
+public:
+
+ TPoint& operator+=( const TPoint& adder );
+ TPoint& operator-=( const TPoint& subber );
+ friend TPoint operator - ( const TPoint& one, const TPoint& two);
+ friend TPoint operator + ( const TPoint& one, const TPoint& two);
+ friend int operator == ( const TPoint& one, const TPoint& two);
+ friend int operator != ( const TPoint& one, const TPoint& two);
+
+ int x,y;
+
+};
+
+inline TPoint& TPoint::operator += ( const TPoint& adder )
+{
+ x += adder.x;
+ y += adder.y;
+ return *this;
+}
+
+inline TPoint& TPoint::operator -= ( const TPoint& subber )
+{
+ x -= subber.x;
+ y -= subber.y;
+ return *this;
+}
+
+inline ipstream& operator >> ( ipstream& is, TPoint& p )
+ { return is >> p.x >> p.y; }
+inline ipstream& operator >> ( ipstream& is, TPoint*& p )
+ { return is >> p->x >> p->y; }
+
+inline opstream& operator << ( opstream& os, TPoint& p )
+ { return os << p.x << p.y; }
+inline opstream& operator << ( opstream& os, TPoint* p )
+ { return os << p->x << p->y; }
+
+#endif // Uses_TPoint
+
diff --git a/tvision/include/tv/preadobj.h b/tvision/include/tv/preadobj.h
new file mode 100644
index 0000000..39dc68a
--- /dev/null
+++ b/tvision/include/tv/preadobj.h
@@ -0,0 +1,51 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class TPReadObjects */
+/* */
+/* Maintains a database of all objects that have been read from the */
+/* current persistent stream. */
+/* */
+/* Used by ipstream when it reads a pointer from a stream to determine */
+/* the address of the object being referred to. */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_TPReadObjects ) && !defined( __TPReadObjects )
+#define __TPReadObjects
+
+class CLY_EXPORT TPReadObjects : public TNSCollection
+{
+
+ friend class ipstream;
+
+public:
+
+ void removeAll() { curId = 0; TNSCollection::removeAll(); }
+
+private:
+
+ TPReadObjects();
+ ~TPReadObjects();
+
+ void registerObject( const void *adr );
+ const void *find( P_id_type id );
+
+ P_id_type curId;
+
+};
+
+#endif // Uses_TPReadObjects
+
diff --git a/tvision/include/tv/program.h b/tvision/include/tv/program.h
new file mode 100644
index 0000000..7773938
--- /dev/null
+++ b/tvision/include/tv/program.h
@@ -0,0 +1,154 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea (setScreenMode and other things)
+
+ *
+ *
+ */
+
+#if defined( Uses_TProgram ) && !defined( __TProgram )
+#define __TProgram
+
+#define cpColor \
+ "\x71\x70\x78\x74\x20\x28\x24\x17\x1F\x1A\x31\x31\x1E\x71\x00" \
+ "\x37\x3F\x3A\x13\x13\x3E\x21\x00\x70\x7F\x7A\x13\x13\x70\x7F\x00" \
+ "\x70\x7F\x7A\x13\x13\x70\x70\x7F\x7E\x20\x2B\x2F\x78\x2E\x70\x30" \
+ "\x3F\x3E\x1F\x2F\x1A\x20\x72\x31\x31\x30\x2F\x3E\x31\x13\x38\x00"
+
+#define cpBlackWhite \
+ "\x70\x70\x78\x7F\x07\x07\x0F\x07\x0F\x07\x70\x70\x07\x70\x00" \
+ "\x07\x0F\x07\x70\x70\x07\x70\x00\x70\x7F\x7F\x70\x07\x70\x07\x00" \
+ "\x70\x7F\x7F\x70\x07\x70\x70\x7F\x7F\x07\x0F\x0F\x78\x0F\x78\x07" \
+ "\x0F\x0F\x0F\x70\x0F\x07\x70\x70\x70\x07\x70\x0F\x07\x07\x07\x00"
+
+#define cpMonochrome \
+ "\x70\x07\x07\x0F\x70\x70\x70\x07\x0F\x07\x70\x70\x07\x70\x00" \
+ "\x07\x0F\x07\x70\x70\x07\x70\x00\x70\x70\x70\x07\x07\x70\x07\x00" \
+ "\x70\x70\x70\x07\x07\x70\x70\x70\x0F\x07\x07\x0F\x70\x0F\x70\x07" \
+ "\x0F\x0F\x07\x70\x07\x07\x70\x07\x07\x07\x70\x0F\x07\x07\x07\x00"
+
+
+class TStatusLine;
+class TMenuBar;
+class TDeskTop;
+struct TEvent;
+class TView;
+class TScreen;
+class TVMainConfigFile;
+
+class CLY_EXPORT TProgInit
+{
+public:
+ TProgInit( TStatusLine *(*cStatusLine)( TRect ),
+ TMenuBar *(*cMenuBar)( TRect ),
+ TDeskTop *(*cDeskTop )( TRect )
+ );
+ virtual ~TProgInit();
+ static TVMainConfigFile *config;
+
+protected:
+ TStatusLine *(*createStatusLine)( TRect );
+ TMenuBar *(*createMenuBar)( TRect );
+ TDeskTop *(*createDeskTop)( TRect );
+ static TScreen *tsc;
+};
+
+/* ---------------------------------------------------------------------- */
+/* class TProgram */
+/* */
+/* Palette layout */
+/* 1 = TBackground */
+/* 2- 7 = TMenuView and TStatusLine */
+/* 8-15 = TWindow(Blue) */
+/* 16-23 = TWindow(Cyan) */
+/* 24-31 = TWindow(Gray) */
+/* 32-63 = TDialog */
+/* ---------------------------------------------------------------------- */
+
+const int
+
+// TApplication palette entries
+
+ apColor = 0,
+ apBlackWhite = 1,
+ apMonochrome = 2;
+
+
+class CLY_EXPORT TProgram : public TGroup, public virtual TProgInit
+{
+
+public:
+
+ TProgram();
+ virtual ~TProgram();
+
+ virtual void getEvent(TEvent& event);
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent(TEvent& event);
+ virtual void idle();
+ virtual void initScreen();
+ virtual void outOfMemory();
+ virtual void putEvent( TEvent& event );
+ virtual void run();
+ void setScreenMode( ushort mode, char *comm=0 );
+ void setScreenMode( unsigned w, unsigned h, int fW=-1, int fH=-1 );
+ TView *validView( TView *p );
+ virtual void shutDown();
+
+ virtual void suspend() {}
+ virtual void resume() {}
+
+ // This is a very nasty function only needed if you call
+ // TScreen::resume bypassing TProgram::resume. In this case
+ // the buffers could get unsychronized. This is done by
+ // RHIDE.
+ void syncScreenBuffer();
+ // { buffer = TScreen::screenBuffer; }
+
+ static TStatusLine *initStatusLine( TRect );
+ static TMenuBar *initMenuBar( TRect );
+ static TDeskTop *initDeskTop( TRect );
+
+ static TProgram * application;
+ static TStatusLine * statusLine;
+ static TMenuBar * menuBar;
+ static TDeskTop * deskTop;
+ static int appPalette;
+
+ // Added by SET
+ static clock_t lastIdleClock; // That's the value of clock in the moment
+ // when idle is called. Used to accumulate
+ // in the inIdleTime var
+ static clock_t inIdleTime; // That keeps track of the number of clocks
+ // elapsed since we entered in idle
+ static Boolean inIdle; // Indicates that we are in idle, a mouse or
+ // keyboard event resets it
+ // I think that sometimes we can have a long elapsed time without events
+ // so I provide a way to reset it
+ static void resetIdleTime() { inIdle=False; };
+ // SET: By default that's 0 and the idle member releases the CPU to the
+ // OS. If for some reason you really need to avoid it and want to use
+ // 100% of the CPU just assign 1 to this variable.
+ static char doNotReleaseCPU;
+ // SET: Disable Alt+number window selection. Useful if you have to do it
+ // configurable like in SETEdit.
+ static char doNotHandleAltNumber;
+
+protected:
+
+ static TEvent pending;
+
+private:
+
+// static const char * exitText;
+
+};
+
+#endif
+
diff --git a/tvision/include/tv/pstream.h b/tvision/include/tv/pstream.h
new file mode 100644
index 0000000..0cadbae
--- /dev/null
+++ b/tvision/include/tv/pstream.h
@@ -0,0 +1,72 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class pstream */
+/* */
+/* Base class for handling streamable objects. */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_pstream ) && !defined( __pstream )
+#define __pstream
+
+class TStreamableTypes;
+
+class CLY_EXPORT pstream
+{
+ friend class TStreamableTypes;
+
+public:
+ enum StreamableError { peNotRegistered, peInvalidType };
+ enum PointerTypes { ptNull, ptIndexed, ptObject };
+
+ pstream(CLY_streambuf *);
+ virtual ~pstream();
+
+ int rdstate() const;
+ int eof() const;
+ int fail() const;
+ int bad() const;
+ int good() const;
+ void clear( int = 0 );
+ operator void *() const;
+ int operator ! () const;
+
+ CLY_streambuf *rdbuf() const;
+
+ static void initTypes();
+ // SET: called atexit to kill the collection
+ static void deInitTypes();
+
+ void error( StreamableError );
+ void error( StreamableError, const TStreamable& );
+ static void registerType( TStreamableClass *ts );
+
+protected:
+ pstream();
+
+ CLY_streambuf *bp;
+ int state;
+
+ void init(CLY_streambuf *);
+ void setstate( int );
+
+ static TStreamableTypes * types;
+};
+
+#endif // Uses_pstream
+
diff --git a/tvision/include/tv/pwritobj.h b/tvision/include/tv/pwritobj.h
new file mode 100644
index 0000000..f26c5f9
--- /dev/null
+++ b/tvision/include/tv/pwritobj.h
@@ -0,0 +1,77 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class TPWrittenObjects */
+/* */
+/* Maintains a database of all objects that have been written to the */
+/* current object stream. */
+/* */
+/* Used by opstream when it writes a pointer onto a stream to determine */
+/* whether the object pointed to has already been written to the stream. */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_TPWrittenObjects ) && !defined( __TPWrittenObjects )
+#define __TPWrittenObjects
+
+class CLY_EXPORT TPWrittenObjects : public TNSSortedCollection
+{
+
+ friend class opstream;
+
+public:
+
+ void removeAll() { curId = 0; TNSSortedCollection::removeAll(); }
+
+private:
+
+ TPWrittenObjects();
+ ~TPWrittenObjects();
+
+ void registerObject( const void *adr );
+ P_id_type find( const void *adr );
+
+ void *keyOf( void * );
+ int compare( void *, void * );
+ void freeItem( void *item ); // Note: Just to use delete instead of delete[]
+
+ P_id_type curId;
+
+};
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class TPWObj */
+/* */
+/* Used internally by TPWrittenObjects. */
+/* */
+/* ------------------------------------------------------------------------*/
+
+class CLY_EXPORT TPWObj
+{
+
+ friend class TPWrittenObjects;
+
+private:
+
+ TPWObj( const void *adr, P_id_type id );
+
+ const void *address;
+ P_id_type ident;
+
+};
+
+#endif // Uses_TPWrittenObjects
+
diff --git a/tvision/include/tv/qnx4/key.h b/tvision/include/tv/qnx4/key.h
new file mode 100644
index 0000000..3a9953d
--- /dev/null
+++ b/tvision/include/tv/qnx4/key.h
@@ -0,0 +1,29 @@
+/* QNX 4 screen routines source.
+ Copyright (c) 1998-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#if defined(TVOSf_QNX4) && !defined(QNX4KEY_HEADER_INCLUDED)
+#define QNX4KEY_HEADER_INCLUDED
+
+#define QNX4_KEYTABLE_SIZE 0x200
+
+class TGKeyQNX4: public TGKey
+{
+ public:
+ TGKeyQNX4() {};
+
+ static void Suspend();
+ static void Resume();
+ static int KbHit();
+ static void Clear();
+ static ushort GKey();
+ static unsigned GetShiftState();
+ static void FillTEvent(TEvent &e);
+ static void Init();
+
+ protected:
+ static struct termios saved_attributes;
+ static ushort keytranslatetable[QNX4_KEYTABLE_SIZE];
+};
+
+#endif // QNX4KEY_HEADER_INCLUDED
diff --git a/tvision/include/tv/qnx4/mouse.h b/tvision/include/tv/qnx4/mouse.h
new file mode 100644
index 0000000..4a76414
--- /dev/null
+++ b/tvision/include/tv/qnx4/mouse.h
@@ -0,0 +1,33 @@
+/* QNX 4 screen routines source.
+ Copyright (c) 1998-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#if defined(TVOSf_QNX4) && !defined(QNX4MOUSE_HEADER_INCLUDED)
+#define QNX4MOUSE_HEADER_INCLUDED
+
+class THWMouseQNX4: public THWMouse
+{
+ public:
+ static void Init(ushort mousemode);
+
+ protected:
+ THWMouseQNX4() {};
+ virtual ~THWMouseQNX4();
+
+ static void Show();
+ static void Hide();
+ static void Suspend();
+ static void Resume();
+ static void GetEvent(MouseEventType &me);
+
+ protected:
+ static int MouseHandler(unsigned int* key, struct mouse_event* event);
+
+ protected:
+ static int MousePositionX;
+ static int MousePositionY;
+ static int MouseButtons;
+ static ushort ConsoleMode;
+};
+
+#endif // QNX4MOUSE_HEADER_INCLUDED
diff --git a/tvision/include/tv/qnx4/screen.h b/tvision/include/tv/qnx4/screen.h
new file mode 100644
index 0000000..8ba2ce0
--- /dev/null
+++ b/tvision/include/tv/qnx4/screen.h
@@ -0,0 +1,94 @@
+/* QNX 4 screen routines source.
+ Copyright (c) 1998-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#if defined(TVOSf_QNX4) && !defined(QNX4SCR_HEADER_INCLUDED)
+#define QNX4SCR_HEADER_INCLUDED
+
+#define NUM_MODES 18
+
+struct _VideoModes
+{
+ unsigned int videomode;
+ unsigned int x;
+ unsigned int y;
+};
+
+#define QNX_CONSOLE_RAW 0
+#define QNX_CONSOLE_PTERM 1
+#define QNX_CONSOLE_XQSH 2
+
+class TDisplayQNX4: virtual public TDisplay
+{
+ protected:
+ TDisplayQNX4() {};
+ virtual ~TDisplayQNX4();
+ static void Init();
+
+ static void SetCursorPos(unsigned x, unsigned y);
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ static void SetCursorShape(unsigned start, unsigned end);
+ static ushort GetRows();
+ static ushort GetCols();
+ static ushort GetCrtMode();
+ static void SetCrtMode(ushort mode);
+ static int SetCrtModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+ static void SetCrtModeExt(char* mode);
+ static int CheckForWindowSize(void);
+ static const char* GetWindowTitle(void);
+ static int SetWindowTitle(const char* name);
+
+ protected:
+ static ushort CursorLastX;
+ static ushort CursorLastY;
+ static ushort CursorShapeStart;
+ static ushort CursorShapeEnd;
+ static char ConsoleMode;
+ static ushort IgnoreConsoleResizing;
+ static struct _VideoModes modes[NUM_MODES];
+
+ public:
+ static ushort ConsoleResizing;
+};
+
+class TScreenQNX4: public TDisplayQNX4, public TScreen
+{
+ public:
+ TScreenQNX4();
+ virtual ~TScreenQNX4();
+
+ friend class TGKeyQNX4;
+ friend class THWMouseQNX4;
+ friend class TDisplayQNX4;
+
+ protected:
+ static void Resume();
+ static void Suspend();
+ static ushort FixCrtMode(ushort mode);
+ static void SetCrtData();
+ static void clearScreen();
+ static void SetVideoMode(ushort mode);
+ static int SetVideoModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+ static void SetVideoModeExt(char* mode);
+ static void getCharacters(unsigned offset,ushort* buf, unsigned count);
+ static ushort getCharacter(unsigned dst);
+ static void setCharacter(unsigned offset, ushort value);
+ static void setCharacters(unsigned dst, ushort* src, unsigned len);
+ static int System(const char* command, pid_t* pidChild, int in, int out, int err);
+
+ protected:
+ static int InitTermLib();
+ static void SpecialKeysDisable(int fd);
+ static void SpecialKeysRestore(int fd);
+
+ protected:
+ static unsigned char DefaultRadioButton;
+ static cc_t oldKeys[5];
+ static ushort oldScreenSizeX;
+ static ushort oldScreenSizeY;
+ static ushort ForceModeChange;
+ static ushort* UserScreenData;
+};
+
+#endif // QNX4SCR_HEADER_INCLUDED
diff --git a/tvision/include/tv/qnxrtp/key.h b/tvision/include/tv/qnxrtp/key.h
new file mode 100644
index 0000000..220f762
--- /dev/null
+++ b/tvision/include/tv/qnxrtp/key.h
@@ -0,0 +1,52 @@
+/* QNX RtP keyboard handler routines header.
+ Copyright (c) 2002-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#if defined(TVOSf_QNXRtP) && !defined(QNXRTPKEY_HEADER_INCLUDED)
+#define QNXRTPKEY_HEADER_INCLUDED
+
+#define TVPH_KEY_SHIFT 0x00000001UL
+#define TVPH_KEY_CTRL 0x00000002UL
+#define TVPH_KEY_ALT 0x00000004UL
+
+struct _QNXRtPArtKeys
+{
+ ushort rawkey;
+ ushort transkey;
+};
+
+typedef struct _QNXRtPArtKeys QNXRtPArtKeys;
+
+class TGKeyQNXRtP: public TGKey
+{
+ public:
+ TGKeyQNXRtP() {};
+
+ static void Suspend();
+ static void Resume();
+ static int KbHit();
+ static void Clear();
+ static ushort GKey();
+ static unsigned GetShiftState();
+ static void FillTEvent(TEvent &e);
+ static void SetKbdMapping(int version);
+ static void Init();
+
+ protected:
+ static ushort GetRaw();
+ static ushort MakeArtKeys(QNXRtPArtKeys* array, ushort rawkey);
+
+ protected:
+ static struct termios saved_attributes;
+ static ushort sFlags;
+ static ushort undecoded;
+ static ushort hightranstable[0x0100];
+ static ushort lowtranstable[0x0100];
+ static QNXRtPArtKeys shifttranstable[];
+ static QNXRtPArtKeys alttranstable[];
+ static QNXRtPArtKeys ctrltranstable[];
+ static struct dlphoton phcon;
+ static bool inpterm;
+};
+
+#endif // QNXRTPKEY_HEADER_INCLUDED
diff --git a/tvision/include/tv/qnxrtp/mouse.h b/tvision/include/tv/qnxrtp/mouse.h
new file mode 100644
index 0000000..7e54375
--- /dev/null
+++ b/tvision/include/tv/qnxrtp/mouse.h
@@ -0,0 +1,38 @@
+/* QNX RtP mouse routines header.
+ Copyright (c) 2002-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#if defined(TVOSf_QNXRtP) && !defined(QNXRTPMOUSE_HEADER_INCLUDED)
+#define QNXRTPMOUSE_HEADER_INCLUDED
+
+class THWMouseQNXRtP: public THWMouse
+{
+ public:
+ static void Init();
+
+ protected:
+ THWMouseQNXRtP() {};
+ virtual ~THWMouseQNXRtP();
+
+ static void Show();
+ static void Hide();
+ static void Suspend();
+ static void Resume();
+ static void GetEvent(MouseEventType &me);
+
+ protected:
+ static int mousehandle;
+ static int MousePositionX;
+ static int MousePositionY;
+ static int MouseButtons;
+
+ static int MouseMickeyPositionX;
+ static int MouseMickeyPositionY;
+
+ protected:
+ static int OpenDeviMouse();
+ static void CloseDeviMouse();
+ static void ProcessDeviMouse();
+};
+
+#endif // QNXRTPMOUSE_HEADER_INCLUDED
diff --git a/tvision/include/tv/qnxrtp/screen.h b/tvision/include/tv/qnxrtp/screen.h
new file mode 100644
index 0000000..3ed0af7
--- /dev/null
+++ b/tvision/include/tv/qnxrtp/screen.h
@@ -0,0 +1,88 @@
+/* QNX RtP screen routines header.
+ Copyright (c) 2002-2003 by Mike Gorchak
+ Covered by the BSD license. */
+
+#if defined(TVOSf_QNXRtP) && !defined(QNXRTPSCR_HEADER_INCLUDED)
+#define QNXRTPSCR_HEADER_INCLUDED
+
+class TDisplayQNXRtP: virtual public TDisplay
+{
+ protected:
+ TDisplayQNXRtP() {};
+ virtual ~TDisplayQNXRtP();
+ static void Init();
+
+ static void SetCursorPos(unsigned x, unsigned y);
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ static void SetCursorShape(unsigned start, unsigned end);
+ static ushort GetRows();
+ static ushort GetCols();
+ static void SetCrtMode(ushort mode);
+ static void SetCrtModeExt(char* mode);
+ static int CheckForWindowSize(void);
+ static const char* GetWindowTitle(void);
+ static int SetWindowTitle(const char* name);
+
+ protected:
+ static inline void safeput(char* &p, char* cap);
+
+ protected:
+ static int cur_x;
+ static int cur_y;
+ static int tty_fd;
+ static int cursorStart;
+ static int cursorEnd;
+
+ static ushort mode;
+
+ static volatile sig_atomic_t windowSizeChanged;
+};
+
+class TScreenQNXRtP: public TDisplayQNXRtP, public TScreen
+{
+ public:
+ TScreenQNXRtP();
+ virtual ~TScreenQNXRtP();
+
+ friend class TGKeyQNXRtP;
+ friend class THWMouseQNXRtP;
+ friend class TDisplayQNXRtP;
+
+ protected:
+ static void Resume();
+ static void Suspend();
+ static ushort fixCrtMode(ushort mode);
+ static void setCrtData();
+ static void clearScreen();
+ static void setVideoMode(ushort mode);
+ static void setVideoModeExt(char* mode);
+ static void getCharacters(unsigned offset,ushort* buf, unsigned count);
+ static ushort getCharacter(unsigned dst);
+ static void setCharacter(unsigned offset, ushort value);
+ static void setCharacters(unsigned dst, ushort* src, unsigned len);
+ static int System(const char* command, pid_t* pidChild, int in, int out, int err);
+
+ protected:
+ static void SpecialKeysDisable(int fd);
+ static void SpecialKeysRestore(int fd);
+ static void StartNCurses();
+ static void SetGTables();
+ static void RestoreGTables();
+ static void sigWindowSizeChanged(int sig);
+ static void SendToTerminal(const char* const value);
+ static void RestoreScreen();
+ static void mapColor(char* &p, int col);
+ static void writeBlock(int dst, int len, ushort* old, ushort* src);
+
+ protected:
+ static struct termios old_term;
+ static struct termios new_term;
+ static cc_t oldKeys[5];
+ static int old_col;
+ static int old_fore;
+ static int old_back;
+ static int force_redraw;
+};
+
+#endif // QNXRTPSCR_HEADER_INCLUDED
diff --git a/tvision/include/tv/radiobtn.h b/tvision/include/tv/radiobtn.h
new file mode 100644
index 0000000..457e7f4
--- /dev/null
+++ b/tvision/include/tv/radiobtn.h
@@ -0,0 +1,121 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Added TRadioButtons32 and code page stuff by Salvador Eduardo Tropea.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TRadioButtons */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Selected text */
+/* 3 = Normal shortcut */
+/* 4 = Selected shortcut */
+/* ---------------------------------------------------------------------- */
+
+
+#if defined( Uses_TRadioButtons ) && !defined( __TRadioButtons )
+#define __TRadioButtons
+
+class TRect;
+class TSItem;
+
+class TRadioButtons : public TCluster
+{
+
+public:
+
+ TRadioButtons( const TRect& bounds, TSItem *aStrings ) :
+ TCluster( bounds, aStrings ) { enableMasks=NULL; }
+
+ virtual void draw();
+ virtual Boolean mark( int item );
+ virtual void movedTo( int item );
+ virtual void press( int item );
+ virtual void setData( void *rec );
+
+ // SET: Used to enable/disable other TViews according to current state.
+ // Upto 32 can be controled.
+ void setEnableMask( uint32 *masks, TView **views, int cViews )
+ {
+ enableMasks = masks;
+ enableViews = views;
+ enableCViews = cViews;
+ }
+
+ static char button[];
+ static char obutton[];
+ static char check;
+ static char ocheck;
+
+private:
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TRadioButtons( StreamableInit );
+ uint32 *enableMasks;
+ TView **enableViews;
+ int enableCViews;
+ void evaluateMasks();
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+class TRadioButtons32 : public TRadioButtons
+{
+public:
+ TRadioButtons32(const TRect& bounds,TSItem *aStrings) :
+ TRadioButtons(bounds,aStrings) {};
+ virtual uint32 dataSize();
+private:
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const { return name; }
+protected:
+ TRadioButtons32(StreamableInit);
+public:
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TRadioButtons& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TRadioButtons*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TRadioButtons& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TRadioButtons* cl )
+ { return os << (TStreamable *)cl; }
+
+inline ipstream& operator >> ( ipstream& is, TRadioButtons32& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TRadioButtons32*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TRadioButtons32& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TRadioButtons32* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TRadioButtons
+
diff --git a/tvision/include/tv/rect.h b/tvision/include/tv/rect.h
new file mode 100644
index 0000000..7e377be
--- /dev/null
+++ b/tvision/include/tv/rect.h
@@ -0,0 +1,122 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TRect ) && !defined( __TRect )
+#define __TRect
+
+class TRect
+{
+
+public:
+
+ TRect( int ax, int ay, int bx, int by );
+ TRect( TPoint p1, TPoint p2 );
+ TRect();
+
+ void move( int aDX, int aDY );
+ void grow( int aDX, int aDY );
+ void intersect( const TRect& r );
+ void Union( const TRect& r );
+ Boolean contains( const TPoint& p ) const;
+ Boolean operator == ( const TRect& r ) const;
+ Boolean operator != ( const TRect& r ) const;
+ Boolean isEmpty();
+
+ TPoint a, b;
+
+};
+
+inline TRect::TRect( int ax, int ay, int bx, int by)
+{
+ a.x = ax;
+ a.y = ay;
+ b.x = bx;
+ b.y = by;
+}
+
+inline TRect::TRect( TPoint p1, TPoint p2 )
+{
+ a = p1;
+ b = p2;
+}
+
+inline TRect::TRect()
+{
+}
+
+inline void TRect::move( int aDX, int aDY )
+{
+ a.x += aDX;
+ a.y += aDY;
+ b.x += aDX;
+ b.y += aDY;
+}
+
+inline void TRect::grow( int aDX, int aDY )
+{
+ a.x -= aDX;
+ a.y -= aDY;
+ b.x += aDX;
+ b.y += aDY;
+}
+
+inline void TRect::intersect( const TRect& r )
+{
+ a.x = max( a.x, r.a.x );
+ a.y = max( a.y, r.a.y );
+ b.x = min( b.x, r.b.x );
+ b.y = min( b.y, r.b.y );
+}
+
+inline void TRect::Union( const TRect& r )
+{
+ a.x = min( a.x, r.a.x );
+ a.y = min( a.y, r.a.y );
+ b.x = max( b.x, r.b.x );
+ b.y = max( b.y, r.b.y );
+}
+
+inline Boolean TRect::contains( const TPoint& p ) const
+{
+ return Boolean(
+ p.x >= a.x && p.x < b.x && p.y >= a.y && p.y < b.y
+ );
+}
+
+inline Boolean TRect::operator == ( const TRect& r) const
+{
+ return Boolean( a == r.a && b == r.b );
+}
+
+inline Boolean TRect::operator != ( const TRect& r ) const
+{
+ return Boolean( !(*this == r) );
+}
+
+inline Boolean TRect::isEmpty()
+{
+ return Boolean( a.x >= b.x || a.y >= b.y );
+}
+
+inline ipstream& operator >> ( ipstream& is, TRect& r )
+ { return is >> r.a >> r.b; }
+inline ipstream& operator >> ( ipstream& is, TRect*& r )
+ { return is >> r->a >> r->b; }
+
+inline opstream& operator << ( opstream& os, TRect& r )
+ { return os << r.a << r.b; }
+inline opstream& operator << ( opstream& os, TRect* r )
+ { return os << r->a << r->b; }
+
+#endif // Uses_TRect
+
diff --git a/tvision/include/tv/rescoll.h b/tvision/include/tv/rescoll.h
new file mode 100644
index 0000000..db46f6c
--- /dev/null
+++ b/tvision/include/tv/rescoll.h
@@ -0,0 +1,56 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TResourceCollection ) && !defined( __TResourceCollection )
+#define __TResourceCollection
+
+class TResourceCollection: public TStringCollection
+{
+
+public:
+
+ TResourceCollection( ccIndex aLimit, ccIndex aDelta );
+
+ virtual void *keyOf( void *item );
+
+private:
+
+ virtual void freeItem( void *item );
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+ virtual void *readItem( ipstream& );
+ virtual void writeItem( void *, opstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+ TResourceCollection( StreamableInit) : TStringCollection( streamableInit ) {};
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TResourceCollection& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TResourceCollection*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TResourceCollection& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TResourceCollection* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TResourceCollection
+
diff --git a/tvision/include/tv/resfile.h b/tvision/include/tv/resfile.h
new file mode 100644
index 0000000..bfdf2d5
--- /dev/null
+++ b/tvision/include/tv/resfile.h
@@ -0,0 +1,45 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TResourceFile ) && !defined( __TResourceFile )
+#define __TResourceFile
+
+class TResourceCollection;
+class fpstream;
+
+class CLY_EXPORT TResourceFile: public TObject
+{
+
+public:
+
+ TResourceFile( fpstream *aStream );
+ ~TResourceFile();
+ short count();
+ void remove( const char *key );
+ void flush();
+ void *get( const char *key );
+ const char *keyAt( short i );
+ void put( TStreamable *item, const char *key );
+ fpstream *switchTo( fpstream *aStream, Boolean pack );
+
+protected:
+
+ fpstream *stream;
+ Boolean modified;
+ CLY_StreamPosT basePos;
+ CLY_StreamPosT indexPos;
+ TResourceCollection *index;
+};
+
+#endif // Uses_TResourceFile
+
diff --git a/tvision/include/tv/resitem.h b/tvision/include/tv/resitem.h
new file mode 100644
index 0000000..6a0e064
--- /dev/null
+++ b/tvision/include/tv/resitem.h
@@ -0,0 +1,26 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TResourceItem ) && !defined( __TResourceItem )
+#define __TResourceItem
+
+struct TResourceItem
+{
+
+ long pos;
+ long size;
+ char *key;
+};
+
+#endif // Uses_TResourceItem
+
diff --git a/tvision/include/tv/resource.h b/tvision/include/tv/resource.h
new file mode 100644
index 0000000..29109b8
--- /dev/null
+++ b/tvision/include/tv/resource.h
@@ -0,0 +1,56 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TStringCollection )
+
+#include <tv/strncoll.h>
+
+#endif
+
+#if defined( Uses_TResourceItem )
+
+#include <tv/resitem.h>
+
+#endif
+
+#if defined( Uses_TResourceCollection )
+
+#include <tv/rescoll.h>
+
+#endif
+
+#if defined( Uses_TResourceFile )
+
+#include <tv/resfile.h>
+
+#endif
+
+#if defined( Uses_TStrIndexRec )
+
+#include <tv/strinrec.h>
+
+#endif
+
+#if defined( Uses_TStringList )
+
+#include <tv/strilist.h>
+
+#endif
+
+#if defined( Uses_TStrListMaker )
+
+#include <tv/strlistm.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/screen.h b/tvision/include/tv/screen.h
new file mode 100644
index 0000000..7b8fdbb
--- /dev/null
+++ b/tvision/include/tv/screen.h
@@ -0,0 +1,477 @@
+/* TDisplay/TScreen header.
+ Copyright (c) 2002-2007 by Salvador E. Tropea (SET)
+ Covered by the GPL license.
+
+ This driver defines a class compatible with original Turbo Vision but
+implemented in a very different way. Most members are function pointer
+that can be changed by the hardware/OS dependent driver.
+ This idea was propposed by JASC.
+ I also included some members that Robert added to original TV.
+ A lot of new members were added, this is just compatible with Borland's
+classes, but doesn't have much in common.
+*/
+
+#if defined( Uses_TScreen ) && !defined( __TScreen )
+#define __TScreen
+
+class TVCodePage;
+
+// Components are 0-255
+struct TScreenColor
+{
+ uchar R,G,B,Alpha;
+};
+
+struct TScreenFont256
+{
+ unsigned w,h;
+ uchar *data;
+};
+
+struct TScreenResolution
+{
+ unsigned x,y;
+};
+
+// Type for the callback called when the driver needs a new font.
+typedef TScreenFont256 *(*TVScreenFontRequestCallBack)(int which, unsigned w,
+ unsigned height);
+// Type for the callback called when the driver is detected.
+// This is called when we know which driver will be used but it isn't
+// initilized yet.
+typedef void (*TVScreenDriverDetectCallBack)();
+
+const int TDisplayDOSModesNum=18;
+
+/**[txh]********************************************************************
+
+ Description:
+ SET: Here I'm writing some implementation details that could help to
+understand it.@*
+ This class is the low level stuff and is used by TScreen. The user isn't
+supposed to call it.@*
+ Example: TDisplay::getRows() is needed by TScreen to know the display
+rows, but a class (like TDesktop) should use TScreen::getRows(), it will
+return a cached data that can additionally have some translation applied to
+the value returned by TDisplay::getRows().@*
+ It should be posible to split the physical screen in 4 different screens
+handled by a special TScreen class. In this case TDisplay::getRows will
+return a different value than TScreen, lets say the double. Then calling
+TScreen::clearScreen will erase the current "screen" and not the whole
+physical screen.@*
+ JASC have the idea of making some of the members pointers that can be
+changed by the hardware layers. I implemented it but with many
+differences.@*
+
+***************************************************************************/
+
+class CLY_EXPORT TDisplay
+{
+public:
+ friend class TView;
+
+ // Members defined by original TV library v2.0
+ enum videoModes
+ {
+ smBW80 = 0x0002,
+ smCO80 = 0x0003,
+ smCO80x25 = 0x0003,
+ smMono = 0x0007,
+ smFont8x8 = 0x0100,
+ // Modes defined by Robert
+ // Extended
+ smCO80x28 = 0x0103,
+ smCO80x35 = 0x0203,
+ smCO80x40 = 0x0303,
+ smCO80x43 = 0x0403,
+ smCO80x50 = 0x0503,
+ // Tweaked
+ smCO80x30 = 0x0703,
+ smCO80x34 = 0x0803,
+ smCO90x30 = 0x0903,
+ smCO90x34 = 0x0A03,
+ smCO94x30 = 0x0B03,
+ smCO94x34 = 0x0C03,
+ smCO82x25 = 0x0D03, // Created by SET to get 8x16 char cells
+ // Common VESA text modes
+ smCO80x60 = 0x0108,
+ smCO132x25= 0x0109,
+ smCO132x43= 0x010A,
+ smCO132x50= 0x010B,
+ smCO132x60= 0x010C
+ };
+
+ static void (*clearScreen)(uchar w, uchar h);
+
+ // SET: The following two are for compatibility, see *CursorShape
+ static void setCursorType(ushort val);
+ static ushort getCursorType();
+
+ static ushort (*getRows)();
+ static ushort (*getCols)();
+
+ static void (*setCrtMode)(ushort mode);
+ static ushort (*getCrtMode)();
+
+ // Not found in original TV 2.0
+ // Robert added it to know the cursor position and restore it.
+ static void (*getCursorPos)(unsigned &x, unsigned &y); // old GetCursor
+ static void (*setCursorPos)(unsigned x, unsigned y); // ols SetCursor
+ // SET: I moved it to the class
+ // Returns 0 if the MSB of the background selects more colors.
+ static int (*getBlinkState)();
+ // SET: A new and more rasonable way to choose a video mode
+ static int (*setCrtModeRes_p)(unsigned w, unsigned h, int fW, int fH);
+ static int setCrtModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1)
+ { return setCrtModeRes_p(w,h,fW,fH); };
+ // SET: These are the real functions for *CursorType
+ static void (*setCursorShape)(unsigned start, unsigned end);
+ static void (*getCursorShape)(unsigned &start, unsigned &end);
+ // SET: This version sets the mode through an external program or other complex
+ // mode setting.
+ static void (*setCrtModeExt)(char *mode);
+ // SET: Fonts handling. I changed it for a new approach, see TScreen
+ // SET: Checks if screen size was changed by an external "force"
+ static int (*checkForWindowSize)(void);
+ // SET: For windowed cases
+ static
+ const char *(*getWindowTitle)(void);
+ static int (*setWindowTitle)(const char *name);
+ // SET: Roman Valyushenko propposed some mechanism no indicate the
+ // application is busy
+ static Boolean (*showBusyState)(Boolean state);
+ // SET: The bell/beep is something really tied to the terminal
+ static void (*beep)();
+ static void bell() { beep(); };
+ // This should be called before initialization.
+ // Isn't mandatory but helps some drivers.
+ static void setArgv(int aArgc, char **aArgv, char **aEnvir);
+ // Driver options
+ static Boolean setShowCursorEver(Boolean value);
+ static Boolean getShowCursorEver() { return opts1 & ShowCursorEver ? True : False; };
+ static Boolean setDontMoveHiddenCursor(Boolean value);
+ static Boolean getDontMoveHiddenCursor() { return opts1 & DontMoveHiddenCursor ? True : False; };
+ // Helper to look for the closest resolution from a list
+ static Boolean searchClosestRes(TScreenResolution *res, unsigned x, unsigned y,
+ unsigned cant, unsigned &pos);
+ // Returns the default palette
+ static const TScreenColor *getDefaultPalette() { return PC_BIOSPalette; }
+ // Uses to be called when driver is detected but not yet initialized
+ static TVScreenDriverDetectCallBack setDetectCallBack(TVScreenDriverDetectCallBack aCB);
+ // Searchs information about a known DOS video mode
+ static Boolean searchDOSModeInfo(ushort mode, unsigned &w, unsigned &h, int &fW, int &fH);
+
+ // Tables for the DOS video modes, used to look for similar modes by other drivers
+ static TScreenResolution dosModesRes[];
+ static TScreenResolution dosModesCell[];
+ static int dosModes[];
+
+ // This flag indicates the user wants to avoid characters that produce moire artifacts
+ static char avoidMoire;
+
+ // We must remove it
+ static int dual_display;
+
+protected:
+ // SET: Those are more complex so now they aren't inline
+ TDisplay();
+ TDisplay(const TDisplay&);
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TDisplay();
+
+ // A copy of the command line arguments, old applications doesn't
+ // provide it.
+ static int argc;
+ static char **argv;
+ // Note: MinGW defines a macro called environ in stdlib.h so no C++
+ // member can be named environ. It should be just _environ and the
+ // internal name __environ. Is a serious namespace pollution.
+ static char **environment;
+ // Special options
+ enum Options1
+ {
+ ShowCursorEver=1, // The main goal of this option is to verify the help
+ // for Braille Terminals
+ DontMoveHiddenCursor=2 // This option disables the help for Braille
+ // Terminals in favor of speed.
+ };
+ static uint32 opts1;
+
+ // Helper to access TVCodePage and set the default values
+ static void SetDefaultCodePages(int idScr, int idApp, int idInp);
+ // Hardware Palette handling routines and variables.
+ // This is low level and should be called from TScreen.
+ static void (*getDisPaletteColors)(int from, int number, TScreenColor *colors);
+ static int (*setDisPaletteColors)(int from, int number, TScreenColor *colors);
+ // The shell/user palette
+ static TScreenColor OriginalPalette[16];
+ // The palette we are using
+ static TScreenColor ActualPalette[16];
+ // The PC BIOS palette
+ static TScreenColor PC_BIOSPalette[16];
+ // To know if the palette changed (set by high level routines)
+ static char paletteModified;
+ // This is the palette parsed from the tvrc file or the application
+ static TScreenColor UserStartPalette[16];
+ // Code page initializator
+ static TVCodePage *codePage;
+ // Initialization call back
+ static TVScreenDriverDetectCallBack dCB;
+ // Are we showing signs of busy state?
+ static Boolean busyState;
+
+ // Default behaviors
+ static void defaultClearScreen(uchar, uchar);
+ static ushort defaultGetRows();
+ static ushort defaultGetCols();
+ static void defaultSetCrtMode(ushort mode);
+ static ushort defaultGetCrtMode();
+ static void defaultGetCursorPos(unsigned &x, unsigned &y);
+ static void defaultSetCursorPos(unsigned x, unsigned y);
+ static void defaultSetCursorShape(unsigned start, unsigned end);
+ static void defaultGetCursorShape(unsigned &start, unsigned &end);
+ static void defaultSetCrtModeExt(char *mode);
+ static int defaultCheckForWindowSize(void);
+ static const char *defaultGetWindowTitle(void);
+ static int defaultSetWindowTitle(const char *name);
+ static int defaultGetBlinkState();
+ static void defaultGetDisPaletteColors(int from, int number, TScreenColor *colors);
+ static int defaultSetDisPaletteColors(int from, int number, TScreenColor *colors);
+ static int defaultSetCrtModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+ static Boolean defaultShowBusyState(Boolean state);
+ static void defaultBeep();
+
+private:
+ // From original TV 2.0.
+ // As they are private I just ignore them.
+ //static void videoInt();
+ //static void updateIntlChars();
+
+ // From where they came from? TV 1.03?
+ //static ushort * equipment;
+ //static uchar * crtInfo;
+ //static uchar * crtRows;
+ //static uchar Page;
+};
+
+// virtual to avoid problems with multiple inheritance
+class CLY_EXPORT TScreen : virtual public TDisplay
+{
+public:
+ // From original TV 2.0
+ TScreen();
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TScreen();
+
+ static void (*setVideoMode)(ushort mode);
+ static void (*clearScreen)();
+
+ static ushort startupMode;
+ static ushort startupCursor;
+ static ushort screenMode;
+ static uchar screenWidth;
+ static uchar screenHeight;
+ // True if it have more than 25 lines (obsolete)
+ static Boolean hiResScreen;
+ // True if we must be careful about writing to video screen (obsolete)
+ static Boolean checkSnow;
+ // Current cursor shape
+ static ushort cursorLines;
+ // Pointer to the screen arranged as Attribut/Character array.
+ // This is optional and in some particular platform could be a NULL pointer.
+ // SET: Changed to avoid problems, in fact some casts to int failed in
+ // Alpha/Linux. We found it with Dim Zegebart.
+ static uint16 *screenBuffer;
+
+ static void (*setCrtData)();
+ static ushort (*fixCrtMode)(ushort mode);
+
+ // SET: Currently they are wrappers that ensure we don't nest calls and
+ // then calls the real members.
+ static void suspend();
+ static void resume();
+
+ // SET: Real suspend and resume
+ static void (*Suspend)();
+ static void (*Resume)();
+
+ // New functionality
+ // Needed by some mouse handlers
+ static ushort (*getCharacter)(unsigned offset);
+ // Only used internally by Win32 ports
+ static void (*getCharacters)(unsigned offset, ushort *buf, unsigned count);
+ // Used by TView and some mouse handlers, also internally
+ static void (*setCharacter)(unsigned offset, ushort value);
+ static void (*setCharacters)(unsigned offset, ushort *values, unsigned count);
+ // SET: Used to set the video mode using an external program
+ static void (*setVideoModeExt)(char *mode);
+ // SET: Set the video mode using sizes.
+ static int (*setVideoModeRes_p)(unsigned w, unsigned h, int fW, int fH);
+ static int setVideoModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1)
+ { return setVideoModeRes_p(w,h,fW,fH); };
+ // SET: executes the indicated command
+ static int (*System_p)(const char *command, pid_t *pidChild, int in,
+ int out, int err);
+ static int System(const char *command, pid_t *pidChild=0, int in=-1,
+ int out=-1, int err=-1)
+ { return System_p(command,pidChild,in,out,err); };
+ // Palette handling, they call the TDisplay members
+ static void getPaletteColors(int from, int number, TScreenColor *colors);
+ static void setPaletteColors(int from, int number, TScreenColor *colors);
+ static void resetPalette(); // Sets the original palette
+ // Font handling
+ // These funtions can fail and only drivers with CanSetFontSize should
+ // implement theme. The rest uses defaults that ever fails.
+ static int (*getFontGeometry)(unsigned &w, unsigned &h);
+ static int (*getFontGeometryRange)(unsigned &wmin, unsigned &hmin,
+ unsigned &umax, unsigned &hmax);
+ // The following are implemented only if CanSetBFont and/or CanSetSBFont
+ // are set.
+ static int setPrimaryFont(TScreenFont256 *font, int fontCP=-1, int appCP=-1)
+ { return setFont(1,font,0,NULL,fontCP,appCP); };
+ static int setSecondaryFont(TScreenFont256 *font)
+ { return setFont(0,NULL,1,font); };
+ // That's the real function to set the fonts
+ static int (*setFont_p)(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP, int appCP);
+ static int setFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP=-1, int appCP=-1)
+ { return setFont_p(changeP,fontP,changeS,fontS,fontCP,appCP); };
+ static void (*restoreFonts)();
+ static TVScreenFontRequestCallBack
+ setFontRequestCallBack(TVScreenFontRequestCallBack cb);
+ // Helpers:
+ static int disableSecondaryFont() { return setSecondaryFont(NULL); };
+ static int disablePrimaryFont() { return setPrimaryFont(NULL); };
+ static Boolean isSecondaryFontEnabled() { return useSecondaryFont ? True : False; };
+ // It looks for a configuration variable that belongs to the current driver
+ static Boolean optSearch(const char *variable, long &val);
+ static char *optSearch(const char *variable);
+ static const char
+ *getDriverShortName() { return currentDriverShortName; }
+ static void beep() { TDisplay::beep(); };
+ static void bell() { TDisplay::beep(); };
+ // SET: Application Helpers
+ enum AppHelper { FreeHandler, ImageViewer, PDFViewer };
+ typedef ccIndex appHelperHandler;
+ static appHelperHandler (*openHelperApp)(AppHelper kind);
+ static Boolean (*closeHelperApp)(appHelperHandler id);
+ static Boolean (*sendFileToHelper)(appHelperHandler id, const char *file, void *extra);
+ static const char *(*getHelperAppError)();
+ static int maxAppHelperHandlers;
+
+ // SET: flags capabilities flags
+ enum Capabilities1
+ {
+ CodePageVar=1,
+ CanSetPalette=2, // We can change colors
+ CanReadPalette=4, // We have reliable information about the original colors.
+ // If this value isn't present the user can set the palette,
+ // but the original colors want be restored at exit. We will
+ // try to let them as default for the used display.
+ PalNeedsRedraw=8, // Indicates we must redraw after changing the palette.
+ CursorShapes=16, // When the cursor shape is usable.
+ UseScreenSaver=32, // Does screen saver have any sense for this driver?
+ CanSetBFont=64, // We can set the primary bitmap font
+ CanSetSBFont=128, // We can set the secondary bitmap font
+ CanSetFontSize=256, // We can set the width and height of the font
+ CanSetVideoSize=512,// We can set the video size (window size or video mode)
+ NoUserScreen=0x400 // No user screen exists i.e. we are in a window we draw
+ };
+
+ // Used internally to avoid nested calls to suspend/resume
+ static char suspended;
+ // SET: Indicates if the screen was initialized by the TScreen constructor
+ static char initialized;
+
+ // SET: It says if we should offer the user to select the code page
+ // or the terminal have a fixed encoding and needs things as is.
+ static Boolean codePageVariable() { return flags0 & CodePageVar ? True : False; };
+ static Boolean canSetPalette() { return flags0 & CanSetPalette ? True : False; };
+ static Boolean canReadPalette() { return flags0 & CanReadPalette ? True : False; };
+ static Boolean palNeedsRedraw() { return flags0 & PalNeedsRedraw ? True : False; };
+ static Boolean cursorShapes() { return flags0 & CursorShapes ? True : False; };
+ static Boolean useScreenSaver() { return flags0 & UseScreenSaver ? True : False; };
+ static Boolean canSetBFont() { return flags0 & CanSetBFont ? True : False; };
+ static Boolean canSetSBFont() { return flags0 & CanSetSBFont ? True : False; };
+ static Boolean canSetFontSize() { return flags0 & CanSetFontSize ? True : False; };
+ static Boolean canSetVideoSize() { return flags0 & CanSetVideoSize ? True : False; };
+ static Boolean noUserScreen() { return flags0 & NoUserScreen ? True : False; };
+
+protected:
+ // SET: Capabilities flags
+ static uint32 flags0;
+ static const char *currentDriverShortName;
+ // Indicates if we must use the secondary font for the higher foreground
+ // colors.
+ static char useSecondaryFont;
+ // Font Request Call Back
+ static TVScreenFontRequestCallBack frCB;
+ // Values from the user configuration
+ static long forcedAppCP, forcedScrCP, forcedInpCP;
+
+ // Used to set the palette requested by the user/application
+ static Boolean parseUserPalette();
+
+ // SET: Default behaviors:
+ static void defaultSetVideoMode(ushort mode);
+ static void defaultSetVideoModeExt(char *mode);
+ static int defaultSetVideoModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+ static void defaultClearScreen();
+ static void defaultSetCrtData();
+ static ushort defaultFixCrtMode(ushort mode);
+ static ushort defaultGetCharacter(unsigned offset);
+ static void defaultGetCharacters(unsigned offset, ushort *buf, unsigned count);
+ static void defaultSetCharacter(unsigned offset, ushort value);
+ static void defaultSetCharacters(unsigned offset, ushort *values, unsigned count);
+ static int defaultSystem(const char *command, pid_t *pidChild, int in, int out,
+ int err);
+ static int defaultGetFontGeometry(unsigned &w, unsigned &h);
+ static int defaultGetFontGeometryRange(unsigned &wmin, unsigned &hmin,
+ unsigned &umax, unsigned &hmax);
+ static int defaultSetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP=-1, int appCP=-1);
+ static void defaultRestoreFonts();
+ static appHelperHandler defaultOpenHelperApp(AppHelper kind);
+ static Boolean defaultCloseHelperApp(appHelperHandler id);
+ static Boolean defaultSendFileToHelper(appHelperHandler id, const char *file, void *extra);
+ static const char *defaultGetHelperAppError();
+
+ // The following members are used to implement a tricky initialization
+ // process.
+ // Externally it looks like a the old mechanism, you create a TScreen object
+ // and you destroy it. Internally it detects the correct driver and creates
+ // an object of this class, when you destroy the TScreen objects it destroys
+ // the right class.
+private:
+ // SET: It indicates the class is initialized or at least trying to do it
+ // It avoids problems with inheritance and calls to base classes.
+ static char initCalled;
+ static TScreen *driver;
+};
+
+#if 0
+// SET: Added the following functionallity:
+// Linux specific stuff, enclose it in TVOSf_Linux section:
+// If you want to setup a specific value define this variable in your code
+// and assign a value. If the variable isn't in your code the linker will use
+// a definition found in the library.
+extern unsigned TurboVision_screenOptions;
+
+// This value makes the screen driver try to provide a mode that supports
+// a switch to the user screen.
+// Current example: if the TScreen class have access to the /dev/vcsaN
+// devices for writing we can't provide user screen (no way to read the
+// screen and tcsetattr or endwin() fails). Even with that it's better than
+// using escape sequences, but RHIDE will work better if can switch. So I'm
+// adding it so Robert can ask for it (or not).
+const unsigned TurboVision_screenUserScreenNeeded=1;
+
+// SET: Moved/Redefined
+// Internally used by Linux driver, don't use
+#endif
+#endif // Uses_TScreen
+
diff --git a/tvision/include/tv/scrlbar.h b/tvision/include/tv/scrlbar.h
new file mode 100644
index 0000000..f5427fd
--- /dev/null
+++ b/tvision/include/tv/scrlbar.h
@@ -0,0 +1,99 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TScrollBar */
+/* */
+/* Palette layout */
+/* 1 = Page areas */
+/* 2 = Arrows */
+/* 3 = Indicator */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TScrollBar ) && !defined( __TScrollBar )
+#define __TScrollBar
+
+class TRect;
+struct TEvent;
+
+typedef char TScrollChars[5];
+
+class CLY_EXPORT TScrollBar : public TView
+{
+
+public:
+
+ TScrollBar( const TRect& bounds );
+
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual void scrollDraw();
+ virtual int scrollStep( int part );
+ void setParams( int32 aValue, int32 aMin, int32 aMax,
+ int aPgStep, int aArStep );
+ void setRange( int32 aMin, int32 aMax );
+ void setStep( int aPgStep, int aArStep );
+ void setValue( int32 aValue );
+
+ void drawPos( int pos );
+ int32 getPos();
+ int getSize();
+
+ int32 value;
+
+ TScrollChars chars;
+ int32 minVal;
+ int32 maxVal;
+ int pgStep;
+ int arStep;
+
+ static TScrollChars vChars;
+ static TScrollChars hChars;
+ static TScrollChars ovChars;
+ static TScrollChars ohChars;
+
+private:
+
+ int getPartCode(void);
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TScrollBar( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TScrollBar& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TScrollBar*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TScrollBar& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TScrollBar* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+#endif // Uses_TScrollBar
+
diff --git a/tvision/include/tv/scroller.h b/tvision/include/tv/scroller.h
new file mode 100644
index 0000000..f081ff5
--- /dev/null
+++ b/tvision/include/tv/scroller.h
@@ -0,0 +1,95 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TScroller */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Selected text */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TScroller ) && !defined( __TScroller )
+#define __TScroller
+
+class TRect;
+class TScrollBar;
+struct TEvent;
+
+class CLY_EXPORT TScroller : public TView
+{
+
+public:
+
+ TScroller( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar
+ );
+
+ virtual void changeBounds( const TRect& bounds );
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual void scrollDraw();
+ void scrollTo( int32 x, int32 y );
+ void setLimit( int32 x, int32 y );
+ virtual void setState( ushort aState, Boolean enable );
+ void checkDraw();
+ virtual void shutDown();
+
+ // How many lines we will scroll when the mouse wheel is used.
+ static int defaultWheelStep;
+ int wheelStep;
+
+protected:
+
+ uchar drawLock;
+ Boolean drawFlag;
+ TScrollBar *hScrollBar;
+ TScrollBar *vScrollBar;
+ TPoint delta;
+ TPoint limit;
+
+private:
+
+ void showSBar( TScrollBar *sBar );
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TScroller( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TScroller& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TScroller*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TScroller& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TScroller* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TScroller
+
diff --git a/tvision/include/tv/searchrc.h b/tvision/include/tv/searchrc.h
new file mode 100644
index 0000000..2248da0
--- /dev/null
+++ b/tvision/include/tv/searchrc.h
@@ -0,0 +1,27 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TSearchRec ) && !defined( __TSearchRec )
+#define __TSearchRec
+
+struct TSearchRec
+{
+ uchar attr;
+ time_t time;
+ size_t size;
+ short ff_fille;
+ char name[PATH_MAX];
+};
+
+#endif // Uses_TSearchRec
+
diff --git a/tvision/include/tv/sitem.h b/tvision/include/tv/sitem.h
new file mode 100644
index 0000000..16f8c35
--- /dev/null
+++ b/tvision/include/tv/sitem.h
@@ -0,0 +1,46 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea: added operators and append.
+
+ *
+ *
+ */
+
+#if defined( Uses_TSItem ) && !defined( __TSItem )
+#define __TSItem
+
+class TSItem
+{
+
+public:
+
+ TSItem( const char *aValue, TSItem *aNext )
+ { value = newStr(aValue); next = aNext; }
+ ~TSItem() { DeleteArray((char *)value); }
+ void append( TSItem *aNext ); // SET: I put it in the same source as TCluster
+
+ const char *value;
+ TSItem *next;
+};
+
+// by SET
+inline TSItem& operator + ( TSItem& s, TSItem& i )
+{
+ s.append(&i);
+ return s;
+}
+
+// SET: From TVTools
+inline void operator += ( TSItem& i1, TSItem& i2 )
+{
+ i1 = i1 + i2;
+}
+
+#endif // Uses_TSItem
+
diff --git a/tvision/include/tv/skeleton/key.h b/tvision/include/tv/skeleton/key.h
new file mode 100644
index 0000000..e4f6cb3
--- /dev/null
+++ b/tvision/include/tv/skeleton/key.h
@@ -0,0 +1,46 @@
+/* Skeleton keyboard handler routines header.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+/*
+ This header is an example that could help somebody trying to write a new
+driver. The word "Skeleton" should be replaced by the target i.e. the OS.
+*/
+#ifndef SKELETONKEY_HEADER_INCLUDED
+#define SKELETONKEY_HEADER_INCLUDED
+
+// A class to encapsulate the globals, all is static!
+class TGKeySkeleton : public TGKey
+{
+public:
+ // Usually nothing goes here and the initialization code goes in Init()
+ TGKeySkeleton() {};
+
+ // Function replacements
+ // Put the keyboard in the original state
+ static void Suspend();
+ // Memorize current state and setup our state
+ static void Resume();
+ // Is a key waiting to be retreived?
+ static int KbHit();
+ // Remove all the keys waiting to be retrieved.
+ static void Clear();
+ // Get the next key. The format is the one you can see in tkeyext.h and
+ // gkey.h
+ static ushort GKey();
+ // What's the current state of modifier keys. The IBM BIOS values are used.
+ // Not all targets implement it.
+ static unsigned GetShiftState();
+ // Fill a TEvent structure with the next available key (or evNothing)
+ static void FillTEvent(TEvent &e);
+ // Set a particular mode requested by the user. The values should be allocated
+ // in the keyMode enumeration found in TGKey to avoid collisions between drivers.
+ static void SetKbdMapping(int version);
+
+ // Setup the pointers to point our members
+ static void Init();
+
+protected:
+ // Put support routines and variables here
+};
+#endif // SKELETONKEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/skeleton/mouse.h b/tvision/include/tv/skeleton/mouse.h
new file mode 100644
index 0000000..67d30bc
--- /dev/null
+++ b/tvision/include/tv/skeleton/mouse.h
@@ -0,0 +1,44 @@
+/* Skeleton mouse routines header.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+// For more information look in event.h
+#ifndef SKELETONMOUSE_HEADER_INCLUDED
+#define SKELETONMOUSE_HEADER_INCLUDED
+
+class THWMouseSkeleton : public THWMouse
+{
+public:
+ // Setup the pointers to point our members
+ static void Init();
+
+protected:
+ // Note that even contructor/destructor are protected
+ // Usually nothing goes here and the initialization code goes in Init()
+ THWMouseSkeleton() {};
+ // Here you can put the code needed to restore the state of the machine
+ // before initialization. Be very careful we the order and avoid doble
+ // deinitializations.
+ virtual ~THWMouseSkeleton();
+
+ // Function replacements
+ // Make the mouse cursor visible
+ static void Show();
+ // Make the mouse cursor invisible
+ static void Hide();
+ // Put the mouse in the original state
+ static void Suspend();
+ // Memorize current state and setup our state
+ static void Resume();
+ // Get a mouse event and fill the structure. If no mouse event is available
+ // fill the structure with the same data you used last time.
+ static void GetEvent(MouseEventType &me);
+
+ // The setup of the pointers to point our members is done in Init()
+ // Don't forget to setup buttonCount or the class will say the mouse isn't
+ // present.
+
+ // Put support routines and variables here
+};
+
+#endif // SKELETONMOUSE_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/skeleton/screen.h b/tvision/include/tv/skeleton/screen.h
new file mode 100644
index 0000000..5895a87
--- /dev/null
+++ b/tvision/include/tv/skeleton/screen.h
@@ -0,0 +1,152 @@
+/* Skeleton screen routines header.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+/*
+ This header is an example that could help somebody trying to write a new
+driver. The word "Skeleton" should be replaced by the target i.e. the OS.
+*/
+// Here specify if this header requires some system specific header
+#ifndef SKELETONSCR_HEADER_INCLUDED
+#define SKELETONSCR_HEADER_INCLUDED
+
+// virtual to avoid problems with multiple inheritance
+class TDisplaySkeleton : virtual public TDisplay
+{
+protected:
+ // Usually TDisplay contructor does nothing. All the magic is in TScreen
+ // constructor, a class derived from it.
+ TDisplaySkeleton() {};
+ // We will use casts to base classes, destructors must be pointers.
+ // Usually the magic goes in ~TScreenSkeleton
+ virtual ~TDisplaySkeleton();
+ // This sets the pointers of TDisplay to point to this class.
+ static void Init();
+
+ // Behaviors to replace TDisplay.
+ // Note all of this is protected and is supposed to be used through TScreen
+ // You can name these members as you like. Not all have to be implemented
+ // and all have defaults.
+ // Set text cursor position
+ static void SetCursorPos(unsigned x, unsigned y);
+ // Find text cursor position
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ // What's the shape of the text cursor?
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ // Set the shape of the text cursor
+ static void SetCursorShape(unsigned start, unsigned end);
+ // How many lines have the display?
+ static ushort GetRows();
+ // How many columns?
+ static ushort GetCols();
+ // Set a video mode number, usually not implemented, but sometimes you need to
+ // set some defaults here.
+ static void SetCrtMode(ushort mode);
+ // Set a video mode using an external program
+ static void SetCrtModeExt(char *mode);
+ // Did the display changed its size since last call?
+ static int CheckForWindowSize(void);
+ // What's the title of our window?
+ static const char *GetWindowTitle(void);
+ // Set the title for our window
+ static int SetWindowTitle(const char *name);
+ // Produce an audible indication
+ static void Beep();
+
+ // Variables for this driver
+ // Here you define variables needed by your driver.
+};
+
+// With this order the destructor will be called first for TScreenSkeleton,
+// TScreen, TDisplaySkeleton and finally TDisplay.
+class TScreenSkeleton : public TDisplaySkeleton, public TScreen
+{
+public:
+ // Put the driver detection/initialization in this constructor
+ TScreenSkeleton();
+ // We will use casts to base classes, destructors must be pointers
+ // Here you can put the code needed to restore the state of the machine
+ // before initialization. Be very careful we the order and avoid doble
+ // deinitializations.
+ virtual ~TScreenSkeleton();
+
+ // Usually our guts are needed by the key, mouse and/or display.
+ // Here you can allow access to those classes.
+ friend class TGKeySkeleton;
+ friend class THWMouseSkeleton;
+ friend class TDisplaySkeleton;
+
+protected:
+ // Memorize the state of the console and set our state.
+ static void Resume();
+ // Restore the state the console had.
+ static void Suspend();
+ // This does a translation between video mode numbers passed to setVideoMode
+ // and the values passed to setCrtMode.
+ static ushort fixCrtMode(ushort mode);
+ // This sets some internal variables with the current state of the console.
+ // Take a look at the default in tscreen.cc
+ static void setCrtData();
+ // Clear the contents of the whole screen. Here just to be compatible with
+ // original TV.
+ static void clearScreen();
+ // See TDisplaySkeleton::SetCrtMode, this is the function expossed to the
+ // application.
+ static void setVideoMode(ushort mode);
+ // See TDisplaySkeleton::SetCrtModeExt, this is the function expossed to the
+ // application.
+ static void setVideoModeExt(char *mode);
+ // The following four functions works with the screen buffer.
+ // Internally TV uses ushort arrays to store the characters and their
+ // attributes (8 bits each one). The organization is the same used by
+ // PC VGA video cards. The format is independent of the endianess of
+ // the architecture. If you cast the "short *" array to "unsigned char *"
+ // the even positions will hold the characters and the odd positions the
+ // attributes. The upper nibble of the attribute is the background and
+ // the lower is the foreground color.
+ // The driver should assign to screenBuffer the address of a buffer
+ // containing the actual data displayed in the screen. In TV 1.x for DOS
+ // it was a pointer to the video memory, in TV 2.0 it can be a pointer to
+ // a buffer in memory or just any value, but can't remain NULL or
+ // nothing will be sent to the screen.
+ // When screenBuffer points to a buffer in memory setCharacter* should
+ // output to the screen *and* hold a copy in this buffer. In this case
+ // the default getCharacter* will do the job.
+ // Get the char/attribute pairs at offset position (x=offset%cols,
+ // y=offset/cols).
+ static void getCharacters(unsigned offset,ushort *buf,unsigned count);
+ static ushort getCharacter(unsigned dst);
+ // Sets the char/attribute pairs.
+ static void setCharacter(unsigned offset, ushort value);
+ static void setCharacters(unsigned dst, ushort *src, unsigned len);
+ // Calls an external program, if pidChild pointer is not null the routine
+ // should try to do it in background and return the process ID.
+ static int System(const char *command, pid_t *pidChild);
+ // Sets the colors palette, currently upto 16 colors are supported
+ static int SetDisPaletteColors(int from, int number, TScreenColor *colors);
+ // Finds the width and height of the font currently used
+ static int GetFontGeometry(unsigned &w, unsigned &h);
+ // To know the smallest and biggest font sizes supported
+ static int GetFontGeometryRange(unsigned &wmin, unsigned &hmin,
+ unsigned &umax, unsigned &hmax);
+ // It changes the screen fonts. Upto 2 fonts are supported and the driver
+ // must use the capabilities (see Capabilities1 enum) to indicate if the
+ // secondary font is supported.
+ static int SetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP=-1, int appCP=-1);
+ // Restore the original fonts
+ static void RestoreFonts();
+ // Sets a video mode indicating a size of the screen and font. The function
+ // must look for the closest mode and indicate if we set what the user
+ // requested or something different.
+ static int SetCrtModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+ // Show some sign to indicate we are temporally busy, it can be changing the
+ // mouse cursor.
+ static Boolean ShowBusyState(Boolean state);
+
+protected:
+ // Put support routines and variables here
+};
+
+#endif // SKELETONSCR_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/sortcoll.h b/tvision/include/tv/sortcoll.h
new file mode 100644
index 0000000..b34176b
--- /dev/null
+++ b/tvision/include/tv/sortcoll.h
@@ -0,0 +1,59 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TSortedCollection ) && !defined( __TSortedCollection )
+#define __TSortedCollection
+
+class TSortedCollection : public TNSSortedCollection, public TCollection
+{
+
+public:
+
+ TSortedCollection( ccIndex aLimit, ccIndex aDelta) :
+ TCollection( aLimit, aDelta ) {}
+
+private:
+
+ virtual int compare( void *key1, void *key2 ) = 0;
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+ virtual void *readItem( ipstream& ) = 0;
+ virtual void writeItem( void *, opstream& ) = 0;
+
+protected:
+
+ TSortedCollection( StreamableInit );
+ virtual void *read( ipstream& );
+ virtual void write( opstream& );
+
+public:
+
+ static const char * const name;
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TSortedCollection& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TSortedCollection*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TSortedCollection& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TSortedCollection* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TSortedCollection
+
diff --git a/tvision/include/tv/sortlibo.h b/tvision/include/tv/sortlibo.h
new file mode 100644
index 0000000..affe9ee
--- /dev/null
+++ b/tvision/include/tv/sortlibo.h
@@ -0,0 +1,80 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TSortedListBox ) && !defined( __TSortedListBox )
+#define __TSortedListBox
+
+class TRect;
+class TScrollBar;
+struct TEvent;
+class TSortedCollection;
+
+class TSortedListBox: public TListBox
+{
+
+public:
+
+ TSortedListBox( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *aScrollBar
+ );
+ TSortedListBox( const TRect& bounds, ushort aNumCols,
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar,
+ Boolean aCenterOps = False);
+
+ virtual void handleEvent( TEvent& event );
+ void newList( TSortedCollection *aList );
+
+ TSortedCollection *list();
+
+protected:
+
+ uchar shiftState;
+ ushort searchPos; // SET: made protected not private
+ virtual void *getKey( const char *s );
+
+private:
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TSortedListBox( StreamableInit ) : TListBox ( streamableInit ) {}
+ virtual void *read( ipstream & is);
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+inline ipstream& operator >> ( ipstream& is, TSortedListBox& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TSortedListBox*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TSortedListBox& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TSortedListBox* cl )
+ { return os << (TStreamable *)cl; }
+
+inline TSortedCollection *TSortedListBox::list()
+{
+ return (TSortedCollection *)TListBox::list();
+}
+
+#endif // Uses_TSortedListBox
+
diff --git a/tvision/include/tv/ssc_streams.h b/tvision/include/tv/ssc_streams.h
new file mode 100644
index 0000000..a5b687f
--- /dev/null
+++ b/tvision/include/tv/ssc_streams.h
@@ -0,0 +1,101 @@
+#ifndef Included_SSC_Streams
+#define Included_SSC_Streams 1
+
+#define SSC_IOSSeekDir SSC_ios::seekdir
+#define SSC_StreamOffT SSC_ios::seekoff
+#define SSC_OpenModeT SSC_ios::openmode
+
+class SSC_ios
+{
+public:
+ typedef int seekdir;
+ typedef long seekoff;
+ typedef unsigned openmode;
+ typedef unsigned iostate;
+
+ static const seekdir beg=seekdir(0);
+ static const seekdir cur=seekdir(SEEK_CUR);
+ static const seekdir end=seekdir(SEEK_END);
+
+ static const openmode app=1;
+ static const openmode ate=2;
+ static const openmode binary=4;
+ static const openmode bin=4;
+ static const openmode in=8;
+ static const openmode out=16;
+ static const openmode trunc=32;
+
+ static const iostate badbit = iostate(4);
+ static const iostate eofbit = iostate(2);
+ static const iostate failbit = iostate(1);
+ static const iostate goodbit = iostate(0);
+};
+
+class SSC_streambuf
+{
+public:
+ virtual SSC_StreamOffT seekoff(SSC_StreamOffT pos, SSC_IOSSeekDir dir, SSC_OpenModeT mode=0);
+ SSC_StreamOffT pubseekoff(SSC_StreamOffT pos, SSC_IOSSeekDir dir, SSC_OpenModeT mode=0)
+ { return seekoff(pos,dir,mode); };
+ virtual void sync();
+ void pubsync() { sync(); };
+ virtual void sputc(char c);
+ virtual void sputn(char *data, size_t cant);
+ virtual int sbumpc();
+ virtual size_t sgetn(char *data, size_t cant);
+/*protected:
+ SSC_streambuf(int =0) {};*/
+ virtual ~SSC_streambuf () {}
+};
+
+class SSC_filebuf : public SSC_streambuf
+{
+public:
+ SSC_filebuf();
+ SSC_filebuf(int fh, SSC_OpenModeT mode);
+ virtual ~SSC_filebuf() {}
+
+ SSC_filebuf *open(const char *name, SSC_OpenModeT mode, int prot);
+ int is_open() { return opened; };
+ SSC_filebuf *close(); // 0 on error
+ SSC_filebuf *attach(int fh);
+ virtual SSC_streambuf *setbuf(char *buffer, size_t len);
+ virtual SSC_StreamOffT seekoff(SSC_StreamOffT pos, SSC_IOSSeekDir dir,
+ SSC_OpenModeT mode=0);
+ virtual void sync();
+ virtual void sputc(char c);
+ virtual void sputn(char *data, size_t cant);
+ virtual int sbumpc();
+ virtual size_t sgetn(char *data, size_t cant);
+ int fd() { return fileno(fde); };
+
+protected:
+ FILE *fde;
+ int opened;
+ SSC_OpenModeT mode;
+};
+
+/* Just for RHIDE, very elemental.
+ Important!!! it doesn't check for int overflow!!! */
+class SSC_strstreambuf : public SSC_streambuf
+{
+public:
+ SSC_strstreambuf();
+ SSC_strstreambuf(void *buf, int len);
+ virtual ~SSC_strstreambuf();
+ void *pbase() { return buffer; }
+ int pcount() { return length; }
+ virtual SSC_StreamOffT seekoff(SSC_StreamOffT pos, SSC_IOSSeekDir dir,
+ SSC_OpenModeT mode=0);
+ virtual void sputc(char c);
+ virtual void sputn(char *data, size_t cant);
+ virtual int sbumpc();
+ virtual size_t sgetn(char *data, size_t cant);
+
+protected:
+ void *buffer;
+ int length, offset, tlen;
+ void MakeRoomFor(size_t bytes);
+};
+#endif // Included_SSC_Streams
+
diff --git a/tvision/include/tv/statsdef.h b/tvision/include/tv/statsdef.h
new file mode 100644
index 0000000..8bcb618
--- /dev/null
+++ b/tvision/include/tv/statsdef.h
@@ -0,0 +1,44 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TStatusDef ) && !defined( __TStatusDef )
+#define __TStatusDef
+
+class CLY_EXPORT TStatusDef
+{
+
+public:
+
+ TStatusDef( ushort aMin,
+ ushort aMax,
+ TStatusItem *someItems = 0,
+ TStatusDef *aNext = 0
+ );
+
+ TStatusDef *next;
+ ushort min;
+ ushort max;
+ TStatusItem *items;
+};
+
+inline TStatusDef::TStatusDef( ushort aMin,
+ ushort aMax,
+ TStatusItem *someItems,
+ TStatusDef *aNext
+ ) :
+ next( aNext ), min( aMin ), max( aMax ), items( someItems )
+{
+}
+
+#endif // Uses_TStatusDef
+
diff --git a/tvision/include/tv/statsitm.h b/tvision/include/tv/statsitm.h
new file mode 100644
index 0000000..26dc645
--- /dev/null
+++ b/tvision/include/tv/statsitm.h
@@ -0,0 +1,53 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to allow dynamic status bars and i18n support.
+
+ *
+ *
+ */
+
+#if defined( Uses_TStatusItem ) && !defined( __TStatusItem )
+#define __TStatusItem
+
+class TStatusItem
+{
+
+public:
+
+ TStatusItem( const char *aText,
+ ushort key,
+ ushort cmd,
+ TStatusItem *aNext = 0
+ );
+ ~TStatusItem() { DeleteArray((char *)text); TVIntl::freeSt(intlText); };
+
+ TStatusItem *next;
+ const char *text;
+ stTVIntl *intlText;
+ ushort keyCode;
+ ushort command;
+
+};
+
+inline TStatusItem::TStatusItem( const char *aText,
+ ushort key,
+ ushort cmd,
+ TStatusItem *aNext
+ ) :
+ next( aNext ), keyCode( key ), command( cmd )
+{
+ // SET: If we don't allocate a copy is imposible to have dynamic status
+ // lines loaded from disk files or other similar stuff. Or if we does it
+ // we leak.
+ text=newStr(aText);
+ intlText=NULL;
+}
+
+#endif // Uses_TStatusItem
+
diff --git a/tvision/include/tv/statslin.h b/tvision/include/tv/statslin.h
new file mode 100644
index 0000000..5182a37
--- /dev/null
+++ b/tvision/include/tv/statslin.h
@@ -0,0 +1,103 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TStatusLine */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Disabled text */
+/* 3 = Shortcut text */
+/* 4 = Normal selection */
+/* 5 = Disabled selection */
+/* 6 = Shortcut selection */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TStatusLine ) && !defined( __TStatusLine )
+#define __TStatusLine
+
+class TRect;
+struct TEvent;
+class TPoint;
+
+class CLY_EXPORT TStatusLine : public TView
+{
+
+public:
+
+ TStatusLine( const TRect& bounds, TStatusDef& aDefs );
+ ~TStatusLine();
+
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual const char* hint( ushort aHelpCtx );
+ void update();
+ void computeLength(); // SET: see compactStatus
+ virtual void changeBounds(const TRect& bounds);
+
+ static char hintSeparator[];
+ static char ohintSeparator[];
+
+ // SET: Look the comments in TMenuView, same purpose
+ int compactStatus;
+
+protected:
+
+ TStatusItem *items;
+ TStatusDef *defs;
+
+private:
+
+ void drawSelect( TStatusItem *selected );
+ void findItems();
+ TStatusItem *itemMouseIsIn( TPoint );
+ void disposeItems( TStatusItem *item );
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+ static void writeItems( opstream&, TStatusItem * );
+ static void writeDefs( opstream&, TStatusDef * );
+ static TStatusItem *readItems( ipstream& );
+ static TStatusDef *readDefs( ipstream& );
+
+
+protected:
+
+ TStatusLine( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TStatusLine& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TStatusLine*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TStatusLine& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TStatusLine* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TStatusLine
+
diff --git a/tvision/include/tv/stddlg.h b/tvision/include/tv/stddlg.h
new file mode 100644
index 0000000..c3cd114
--- /dev/null
+++ b/tvision/include/tv/stddlg.h
@@ -0,0 +1,105 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if !defined( __FILE_CMDS )
+#define __FILE_CMDS
+
+const ushort
+
+// Commands
+
+ cmFileOpen = 1001, // Returned from TFileDialog when Open pressed
+ cmFileReplace = 1002, // Returned from TFileDialog when Replace pressed
+ cmFileClear = 1003, // Returned from TFileDialog when Clear pressed
+ cmFileInit = 1004, // Used by TFileDialog internally
+ cmChangeDir = 1005, // Used by TChDirDialog internally
+ cmRevert = 1006, // Used by TChDirDialog internally
+ cmFileSelect = 1007, // Returned from TFileDialog when Select pressed
+ cmDirSelection = 1008, // New: Used by TChDirDialog internally and
+ // TDirListBox externally
+
+// Messages
+
+ cmFileFocused = 102, // A new file was focused in the TFileList
+ cmFileDoubleClicked // A file was selected in the TFileList
+ = 103;
+
+#endif // __FILE_CMDS
+
+#if defined( Uses_TSearchRec )
+
+#include <tv/searchrc.h>
+
+#endif
+
+#if defined( Uses_TFileInputLine )
+
+#include <tv/filinpln.h>
+
+#endif
+
+#if defined( Uses_TFileCollection )
+
+#include <tv/filecoll.h>
+
+#endif
+
+#if defined( Uses_TSortedListBox )
+
+#include <tv/sortlibo.h>
+
+#endif
+
+#if defined( Uses_TFileList )
+
+#include <tv/filelist.h>
+
+#endif
+
+#if defined( Uses_TFileInfoPane )
+
+#include <tv/filinfpn.h>
+
+#endif
+
+#if defined( Uses_TFileDialog )
+
+#include <tv/filedlg.h>
+
+#endif
+
+#if defined( Uses_TDirEntry )
+
+#include <tv/direntr.h>
+
+#endif
+
+#if defined( Uses_TDirCollection )
+
+#include <tv/dircoll.h>
+
+#endif
+
+#if defined( Uses_TDirListBox )
+
+#include <tv/dirlibo.h>
+
+#endif
+
+#if defined( Uses_TChDirDialog )
+
+#include <tv/chdirdlg.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/streambl.h b/tvision/include/tv/streambl.h
new file mode 100644
index 0000000..1e5c1a7
--- /dev/null
+++ b/tvision/include/tv/streambl.h
@@ -0,0 +1,47 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class TStreamable */
+/* */
+/* This is the base class for all storable objects. It provides */
+/* three member functions, streamableName(), read(), and write(), which */
+/* must be overridden in every derived class. */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_TStreamable ) && !defined( __TStreamable )
+#define __TStreamable
+
+class CLY_EXPORT TStreamable
+{
+
+ friend class opstream;
+ friend class ipstream;
+
+private:
+
+ virtual const char *streamableName() const = 0;
+
+protected:
+
+ virtual void *read( ipstream& ) = 0;
+ virtual void write( opstream& ) = 0;
+
+public:
+ virtual ~TStreamable () {}
+};
+
+#endif // Uses_TStreamable
+
diff --git a/tvision/include/tv/strilist.h b/tvision/include/tv/strilist.h
new file mode 100644
index 0000000..0bee550
--- /dev/null
+++ b/tvision/include/tv/strilist.h
@@ -0,0 +1,69 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TStringList ) && !defined( __TStringList )
+#define __TStringList
+
+class TStrIndexRec;
+
+const int MAXKEYS = 16;
+
+class TStringList : public TObject
+#if !defined( NO_STREAM )
+ , public TStreamable
+#endif // NO_STREAM
+{
+
+public:
+
+ ~TStringList();
+
+ void get( char *dest, ushort key );
+
+private:
+
+ ipstream *ip;
+ long basePos;
+ short indexSize;
+ TStrIndexRec *index;
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TStringList( StreamableInit );
+ virtual void write( opstream& ) {}
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TStringList& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TStringList*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TStringList& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TStringList* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TStringList
+
diff --git a/tvision/include/tv/strinrec.h b/tvision/include/tv/strinrec.h
new file mode 100644
index 0000000..e115cd8
--- /dev/null
+++ b/tvision/include/tv/strinrec.h
@@ -0,0 +1,31 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TStrIndexRec ) && !defined( __TStrIndexRec )
+#define __TStrIndexRec
+
+class CLY_EXPORT TStrIndexRec
+{
+
+public:
+
+ TStrIndexRec();
+
+ ushort key;
+ ushort count;
+ ushort offset;
+
+};
+
+#endif // Uses_TStrIndexRec
+
diff --git a/tvision/include/tv/strlistm.h b/tvision/include/tv/strlistm.h
new file mode 100644
index 0000000..b7f8f21
--- /dev/null
+++ b/tvision/include/tv/strlistm.h
@@ -0,0 +1,70 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TStrListMaker ) && !defined( __TStrListMaker )
+#define __TStrListMaker
+
+class TStrListMaker : public TObject
+#if !defined( NO_STREAM )
+ , public TStreamable
+#endif // NO_STREAM
+{
+
+public:
+
+ TStrListMaker( ushort aStrSize, ushort aIndexSize );
+ ~TStrListMaker();
+
+ void put( ushort key, char *str );
+
+private:
+
+ ushort strPos;
+ ushort strSize;
+ char *strings;
+ ushort indexPos;
+ ushort indexSize;
+ TStrIndexRec *index;
+ TStrIndexRec cur;
+ void closeCurrent();
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return TStringList::name; }
+
+protected:
+
+ TStrListMaker( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& ) { return 0; }
+
+public:
+
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TStrListMaker& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TStrListMaker*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TStrListMaker& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TStrListMaker* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+
+#endif // Uses_TStrListMaker
+
diff --git a/tvision/include/tv/strmblcl.h b/tvision/include/tv/strmblcl.h
new file mode 100644
index 0000000..844e6b5
--- /dev/null
+++ b/tvision/include/tv/strmblcl.h
@@ -0,0 +1,54 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to compile for 64 bits architectures.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class TStreamableClass */
+/* */
+/* Used internally by TStreamableTypes and pstream. */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_TStreamableClass ) && !defined( __TStreamableClass )
+#define __TStreamableClass
+
+#include <limits.h>
+
+const P_id_type P_id_notFound = UINT_MAX;
+
+typedef TStreamable *(*BUILDER)();
+
+#define __DELTA( d ) ((uipointer)((TStreamable *)(d *)1)-1)
+
+class CLY_EXPORT TStreamableClass
+{
+
+ friend class TStreamableTypes;
+ friend class opstream;
+ friend class ipstream;
+
+public:
+
+ TStreamableClass( const char *n, BUILDER b, int d );
+
+private:
+
+ const char *name;
+ BUILDER build;
+ int delta;
+
+};
+
+#endif // Uses_TStreamableClass
+
diff --git a/tvision/include/tv/strmblty.h b/tvision/include/tv/strmblty.h
new file mode 100644
index 0000000..6c20758
--- /dev/null
+++ b/tvision/include/tv/strmblty.h
@@ -0,0 +1,54 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+/* ------------------------------------------------------------------------*/
+/* */
+/* class TStreamableTypes */
+/* */
+/* Maintains a database of all registered types in the application. */
+/* Used by opstream and ipstream to find the functions to read and */
+/* write objects. */
+/* */
+/* ------------------------------------------------------------------------*/
+
+#if defined( Uses_TStreamableTypes ) && !defined( __TStreamableTypes )
+#define __TStreamableTypes
+
+// Avoid replacing new by MSS's macro
+#include <tv/no_mss.h>
+
+class CLY_EXPORT TStreamableTypes : private TNSSortedCollection
+{
+
+public:
+
+ TStreamableTypes();
+ ~TStreamableTypes();
+
+ void registerType( const TStreamableClass * );
+ const TStreamableClass *lookup( const char * );
+
+ void *operator new( size_t sz ) { return ::operator new( sz ); }
+ void *operator new( size_t, void * );
+
+private:
+
+ virtual void *keyOf( void * );
+ int compare( void *, void * );
+
+};
+
+#include <tv/yes_mss.h>
+
+#endif // Uses_TStreamableTypes
+
diff --git a/tvision/include/tv/strncoll.h b/tvision/include/tv/strncoll.h
new file mode 100644
index 0000000..d9adb32
--- /dev/null
+++ b/tvision/include/tv/strncoll.h
@@ -0,0 +1,60 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TStringCollection ) && !defined( __TStringCollection )
+#define __TStringCollection
+
+class TStringCollection : public TSortedCollection
+{
+
+public:
+
+ TStringCollection( ccIndex aLimit, ccIndex aDelta );
+
+private:
+
+ virtual int compare( void *key1, void *key2 );
+ virtual void freeItem( void *item );
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+ virtual void *readItem( ipstream& );
+ virtual void writeItem( void *, opstream& );
+
+protected:
+
+ TStringCollection( StreamableInit ) : TSortedCollection ( streamableInit ) {};
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+ TStringCollection & operator = (const TStringCollection &);
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TStringCollection& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TStringCollection*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TStringCollection& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TStringCollection* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TStringCollection
+
diff --git a/tvision/include/tv/sttctext.h b/tvision/include/tv/sttctext.h
new file mode 100644
index 0000000..0ed14b8
--- /dev/null
+++ b/tvision/include/tv/sttctext.h
@@ -0,0 +1,94 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea: added i18n support, added T1StaticText.
+
+ *
+ *
+ */
+
+/* ---------------------------------------------------------------------- */
+/* class TStaticText */
+/* */
+/* Palette layout */
+/* 1 = Text */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TStaticText ) && !defined( TStaticText_defined )
+#define TStaticText_defined
+
+class TRect;
+
+class CLY_EXPORT TStaticText : public TView
+{
+
+public:
+
+ TStaticText( const TRect& bounds, const char *aText );
+ TStaticText( const TRect& bounds, const char *aText, stTVIntl *aIntlText );
+ ~TStaticText();
+
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void getText( char *buf, int maxLen );
+ const char *getText();
+
+protected:
+
+ const char *text;
+ stTVIntl *intlText;
+ char noIntl;
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TStaticText( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TStaticText& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TStaticText*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TStaticText& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TStaticText* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TStaticText
+
+#if defined( Uses_T1StaticText ) && !defined( T1StaticText_defined )
+#define T1StaticText_defined
+// This is based on TVTools idea, but I think is better to implement it
+// in this way and not like a macro.
+// I was forced to use growTo for the i18n stuff and the fact that
+// base constructors must be called first and that the order in which
+// gcc evaluated the arguments is random when optimizing.
+class T1StaticText : public TStaticText
+{
+public:
+ T1StaticText(int x, int y, const char *aText) :
+ TStaticText(TRect(x,y,x,y),aText)
+ { growTo(cstrlen(TVIntl::getText(aText,intlText))+1,1); };
+}
+#endif // Uses_T1StaticText
+
diff --git a/tvision/include/tv/submenu.h b/tvision/include/tv/submenu.h
new file mode 100644
index 0000000..031dad6
--- /dev/null
+++ b/tvision/include/tv/submenu.h
@@ -0,0 +1,27 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TSubMenu ) && !defined( __TSubMenu )
+#define __TSubMenu
+
+class CLY_EXPORT TSubMenu : public TMenuItem
+{
+
+public:
+
+ TSubMenu( const char *, ushort, ushort = hcNoContext );
+
+};
+
+#endif // Uses_TSubMenu
+
diff --git a/tvision/include/tv/system.h b/tvision/include/tv/system.h
new file mode 100644
index 0000000..42a0832
--- /dev/null
+++ b/tvision/include/tv/system.h
@@ -0,0 +1,76 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if !defined( __EVENT_CODES )
+#define __EVENT_CODES
+
+/* If this variable is set to nonzero, TV uses for the screen
+ output the monochrome monitor. All attempts to set an video
+ mode are ignored, the user screen is not saved and/or restored
+ and there is checking done, if the monochrome monitor is
+ valid. That means, you have to set this variable ONLY if you
+ know what you do.
+*/
+
+extern int dual_display;
+
+/* Event codes */
+
+const ushort evMouseDown = 0x0001;
+const ushort evMouseUp = 0x0002;
+const ushort evMouseMove = 0x0004;
+const ushort evMouseAuto = 0x0008;
+const ushort evKeyDown = 0x0010;
+const ushort evCommand = 0x0100;
+const ushort evBroadcast = 0x0200;
+
+/* Event masks */
+
+const ushort evNothing = 0x0000;
+const ushort evMouse = 0x000f;
+const ushort evKeyboard = 0x0010;
+const ushort evMessage = 0xFF00;
+
+/* Mouse button state masks */
+/* SET: Note that I redefined them to make it coherent with most UNIX systems
+ where the left button is the first, the middle one the second, etc. But safe
+ code shouldn't rely on it. */
+const ushort mbLeftButton = 0x01;
+const ushort mbMiddleButton= 0x02;
+const ushort mbRightButton = 0x04;
+const ushort mbButton4 = 0x08;
+const ushort mbButton5 = 0x10;
+
+#endif // __EVENT_CODES
+
+
+#if defined( Uses_TEvent )
+
+#include <tv/event.h>
+
+#endif
+
+#if defined( Uses_TEventQueue )
+
+#include <tv/eventqu.h>
+
+#endif
+
+#if defined( Uses_TScreen )
+
+#include <tv/screen.h>
+
+#endif
+
+
+
diff --git a/tvision/include/tv/terminal.h b/tvision/include/tv/terminal.h
new file mode 100644
index 0000000..05a6d9f
--- /dev/null
+++ b/tvision/include/tv/terminal.h
@@ -0,0 +1,51 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TTerminal ) && !defined( __TTerminal )
+#define __TTerminal
+
+class TRect;
+class TScrollBar;
+
+class CLY_EXPORT TTerminal: public TTextDevice
+{
+
+public:
+
+ TTerminal( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ uint32 aBufSize
+ );
+ virtual ~TTerminal();
+
+ virtual int do_sputn( const char *s, int count );
+
+ void bufInc(uint32& val) { if (++val>=bufSize) val=0; }
+ Boolean canInsert( uint32 amount );
+ short calcWidth();
+ virtual void draw();
+ uint32 nextLine( uint32 pos );
+ uint32 prevLines( uint32 pos, uint32 lines );
+ Boolean queEmpty();
+
+protected:
+
+ uint32 bufSize;
+ char *buffer;
+ uint32 queFront, queBack;
+ void bufDec(uint32& val) { if (val==0) val=bufSize - 1; else val--; }
+};
+
+#endif // Uses_TTerminal
+
diff --git a/tvision/include/tv/textdev.h b/tvision/include/tv/textdev.h
new file mode 100644
index 0000000..9a4e2e4
--- /dev/null
+++ b/tvision/include/tv/textdev.h
@@ -0,0 +1,40 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
+Andris Pavenis.
+
+ *
+ *
+ */
+
+#if defined( Uses_TTextDevice ) && !defined( __TTextDevice )
+#define __TTextDevice
+
+class TRect;
+class TScrollBar;
+
+class CLY_EXPORT TTextDevice : public CLY_streambuf, public TScroller
+/* I have changed the order of the baseclasses, because there is a bug in
+ the iostream library. The functions in this library call the functions
+ if of a streambuf object with a this pointer to the streambuf object,
+ and not, when the object has multiple base classes, with the this pointer
+ to the real object */
+{
+public:
+ TTextDevice( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar
+ );
+
+ virtual int do_sputn( const char *s, int count ) = 0;
+ virtual int overflow( int = EOF );
+};
+
+#endif // Uses_TTextDevice
+
diff --git a/tvision/include/tv/textview.h b/tvision/include/tv/textview.h
new file mode 100644
index 0000000..0f05501
--- /dev/null
+++ b/tvision/include/tv/textview.h
@@ -0,0 +1,32 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TTextDevice )
+
+#include <tv/textdev.h>
+
+#endif
+
+#if defined( Uses_TTerminal )
+
+#include <tv/terminal.h>
+
+#endif
+
+#if defined( Uses_otstream )
+
+#include <tv/otstream.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/tkeyext.h b/tvision/include/tv/tkeyext.h
new file mode 100644
index 0000000..9737fe9
--- /dev/null
+++ b/tvision/include/tv/tkeyext.h
@@ -0,0 +1,237 @@
+#ifndef __TKeysExt__
+#define __TKeysExt__
+const ushort
+ kbUnknown=0x0000,kbA=0x0001,kbB=0x0002,kbC=0x0003,kbD=0x0004,kbE=0x0005,
+ kbF=0x0006,kbG=0x0007,kbH=0x0008,kbI=0x0009,kbJ=0x000a,kbK=0x000b,
+ kbL=0x000c,kbM=0x000d,kbN=0x000e,kbO=0x000f,kbP=0x0010,kbQ=0x0011,
+ kbR=0x0012,kbS=0x0013,kbT=0x0014,kbU=0x0015,kbV=0x0016,kbW=0x0017,
+ kbX=0x0018,kbY=0x0019,kbZ=0x001a,kbOpenBrace=0x001b,kbBackSlash=0x001c,
+ kbCloseBrace=0x001d,kbPause=0x001e,kbEsc=0x001f,kb0=0x0020,kb1=0x0021,
+ kb2=0x0022,kb3=0x0023,kb4=0x0024,kb5=0x0025,kb6=0x0026,kb7=0x0027,
+ kb8=0x0028,kb9=0x0029,kbBackSpace=0x002a,kbTab=0x002b,kbEnter=0x002c,
+ kbColon=0x002d,kbQuote=0x002e,kbGrave=0x002f,kbComma=0x0030,
+ kbStop=0x0031,kbSlash=0x0032,kbAsterisk=0x0033,kbSpace=0x0034,
+ kbMinus=0x0035,kbPlus=0x0036,kbPrnScr=0x0037,kbEqual=0x0038,
+ kbF1=0x0039,kbF2=0x003a,kbF3=0x003b,kbF4=0x003c,kbF5=0x003d,
+ kbF6=0x003e,kbF7=0x003f,kbF8=0x0040,kbF9=0x0041,kbF10=0x0042,
+ kbF11=0x0043,kbF12=0x0044,kbHome=0x0045,kbUp=0x0046,kbPgUp=0x0047,
+ kbLeft=0x0048,kbRight=0x0049,kbEnd=0x004a,kbDown=0x004b,kbPgDn=0x004c,
+ kbInsert=0x004d,kbDelete=0x004e,kbCaret=0x004f,kbAdmid=0x0050,
+ kbDobleQuote=0x0051,kbNumeral=0x0052,kbDolar=0x0053,kbPercent=0x0054,
+ kbAmper=0x0055,kbOpenPar=0x0056,kbClosePar=0x0057,kbDoubleDot=0x0058,
+ kbLessThan=0x0059,kbGreaterThan=0x005a,kbQuestion=0x005b,
+ kbA_Roba=0x005c,kbOr=0x005d,kbUnderLine=0x005e,kbOpenCurly=0x005f,
+ kbCloseCurly=0x0060,kbTilde=0x0061,kbMacro=0x0062,kbWinLeft=0x0063,
+ kbWinRight=0x0064,kbWinSel=0x0065,kbMouse=0x0066;
+
+const ushort
+ kbShUnknown=0x0080,kbShA=0x0081,kbShB=0x0082,kbShC=0x0083,kbShD=0x0084,
+ kbShE=0x0085,kbShF=0x0086,kbShG=0x0087,kbShH=0x0088,kbShI=0x0089,
+ kbShJ=0x008a,kbShK=0x008b,kbShL=0x008c,kbShM=0x008d,kbShN=0x008e,
+ kbShO=0x008f,kbShP=0x0090,kbShQ=0x0091,kbShR=0x0092,kbShS=0x0093,
+ kbShT=0x0094,kbShU=0x0095,kbShV=0x0096,kbShW=0x0097,kbShX=0x0098,
+ kbShY=0x0099,kbShZ=0x009a,kbShOpenBrace=0x009b,kbShBackSlash=0x009c,
+ kbShCloseBrace=0x009d,kbShPause=0x009e,kbShEsc=0x009f,kbSh0=0x00a0,
+ kbSh1=0x00a1,kbSh2=0x00a2,kbSh3=0x00a3,kbSh4=0x00a4,kbSh5=0x00a5,
+ kbSh6=0x00a6,kbSh7=0x00a7,kbSh8=0x00a8,kbSh9=0x00a9,
+ kbShBackSpace=0x00aa,kbShTab=0x00ab,kbShEnter=0x00ac,
+ kbShColon=0x00ad,kbShQuote=0x00ae,kbShGrave=0x00af,kbShComma=0x00b0,
+ kbShStop=0x00b1,kbShSlash=0x00b2,kbShAsterisk=0x00b3,kbShSpace=0x00b4,
+ kbShMinus=0x00b5,kbShPlus=0x00b6,kbShPrnScr=0x00b7,kbShEqual=0x00b8,
+ kbShF1=0x00b9,kbShF2=0x00ba,kbShF3=0x00bb,kbShF4=0x00bc,kbShF5=0x00bd,
+ kbShF6=0x00be,kbShF7=0x00bf,kbShF8=0x00c0,kbShF9=0x00c1,kbShF10=0x00c2,
+ kbShF11=0x00c3,kbShF12=0x00c4,kbShHome=0x00c5,kbShUp=0x00c6,
+ kbShPgUp=0x00c7,kbShLeft=0x00c8,kbShRight=0x00c9,kbShEnd=0x00ca,
+ kbShDown=0x00cb,kbShPgDn=0x00cc,kbShInsert=0x00cd,kbShDelete=0x00ce,
+ kbShCaret=0x00cf,kbShAdmid=0x00d0,kbShDobleQuote=0x00d1,
+ kbShNumeral=0x00d2,kbShDolar=0x00d3,kbShPercent=0x00d4,
+ kbShAmper=0x00d5,kbShOpenPar=0x00d6,kbShClosePar=0x00d7,
+ kbShDoubleDot=0x00d8,kbShLessThan=0x00d9,kbShGreaterThan=0x00da,
+ kbShQuestion=0x00db,kbShA_Roba=0x00dc,kbShOr=0x00dd,
+ kbShUnderLine=0x00de,kbShOpenCurly=0x00df,kbShCloseCurly=0x00e0,
+ kbShTilde=0x00e1,kbShMacro=0x00e2,kbShWinLeft=0x00e3,
+ kbShWinRight=0x00e4,kbShWinSel=0x00e5;
+
+const ushort
+ kbCtUnknown=0x0100,kbCtA=0x0101,kbCtB=0x0102,kbCtC=0x0103,kbCtD=0x0104,
+ kbCtE=0x0105,kbCtF=0x0106,kbCtG=0x0107,kbCtH=0x0108,kbCtI=0x0109,
+ kbCtJ=0x010a,kbCtK=0x010b,kbCtL=0x010c,kbCtM=0x010d,kbCtN=0x010e,
+ kbCtO=0x010f,kbCtP=0x0110,kbCtQ=0x0111,kbCtR=0x0112,kbCtS=0x0113,
+ kbCtT=0x0114,kbCtU=0x0115,kbCtV=0x0116,kbCtW=0x0117,kbCtX=0x0118,
+ kbCtY=0x0119,kbCtZ=0x011a,kbCtOpenBrace=0x011b,kbCtBackSlash=0x011c,
+ kbCtCloseBrace=0x011d,kbCtPause=0x011e,kbCtEsc=0x011f,kbCt0=0x0120,
+ kbCt1=0x0121,kbCt2=0x0122,kbCt3=0x0123,kbCt4=0x0124,kbCt5=0x0125,
+ kbCt6=0x0126,kbCt7=0x0127,kbCt8=0x0128,kbCt9=0x0129,
+ kbCtBackSpace=0x012a,kbCtTab=0x012b,kbCtEnter=0x012c,kbCtColon=0x012d,
+ kbCtQuote=0x012e,kbCtGrave=0x012f,kbCtComma=0x0130,kbCtStop=0x0131,
+ kbCtSlash=0x0132,kbCtAsterisk=0x0133,kbCtSpace=0x0134,kbCtMinus=0x0135,
+ kbCtPlus=0x0136,kbCtPrnScr=0x0137,kbCtEqual=0x0138,kbCtF1=0x0139,
+ kbCtF2=0x013a,kbCtF3=0x013b,kbCtF4=0x013c,kbCtF5=0x013d,kbCtF6=0x013e,
+ kbCtF7=0x013f,kbCtF8=0x0140,kbCtF9=0x0141,kbCtF10=0x0142,kbCtF11=0x0143,
+ kbCtF12=0x0144,kbCtHome=0x0145,kbCtUp=0x0146,kbCtPgUp=0x0147,
+ kbCtLeft=0x0148,kbCtRight=0x0149,kbCtEnd=0x014a,kbCtDown=0x014b,
+ kbCtPgDn=0x014c,kbCtInsert=0x014d,kbCtDelete=0x014e,kbCtCaret=0x014f,
+ kbCtAdmid=0x0150,kbCtDobleQuote=0x0151,kbCtNumeral=0x0152,
+ kbCtDolar=0x0153,kbCtPercent=0x0154,kbCtAmper=0x0155,kbCtOpenPar=0x0156,
+ kbCtClosePar=0x0157,kbCtDoubleDot=0x0158,kbCtLessThan=0x0159,
+ kbCtGreaterThan=0x015a,kbCtQuestion=0x015b,kbCtA_Roba=0x015c,
+ kbCtOr=0x015d,kbCtUnderLine=0x015e,kbCtOpenCurly=0x015f,
+ kbCtCloseCurly=0x0160,kbCtTilde=0x0161,kbCtMacro=0x0162,kbCtWinLeft=0x0163,
+ kbCtWinRight=0x0164,kbCtWinSel=0x0165;
+
+const ushort
+ kbShCtUnknown=0x0180,kbShCtA=0x0181,kbShCtB=0x0182,kbShCtC=0x0183,
+ kbShCtD=0x0184,kbShCtE=0x0185,kbShCtF=0x0186,kbShCtG=0x0187,
+ kbShCtH=0x0188,kbShCtI=0x0189,kbShCtJ=0x018a,kbShCtK=0x018b,
+ kbShCtL=0x018c,kbShCtM=0x018d,kbShCtN=0x018e,kbShCtO=0x018f,
+ kbShCtP=0x0190,kbShCtQ=0x0191,kbShCtR=0x0192,kbShCtS=0x0193,
+ kbShCtT=0x0194,kbShCtU=0x0195,kbShCtV=0x0196,kbShCtW=0x0197,
+ kbShCtX=0x0198,kbShCtY=0x0199,kbShCtZ=0x019a,kbShCtOpenBrace=0x019b,
+ kbShCtBackSlash=0x019c,kbShCtCloseBrace=0x019d,kbShCtPause=0x019e,
+ kbShCtEsc=0x019f,kbShCt0=0x01a0,kbShCt1=0x01a1,kbShCt2=0x01a2,
+ kbShCt3=0x01a3,kbShCt4=0x01a4,kbShCt5=0x01a5,kbShCt6=0x01a6,
+ kbShCt7=0x01a7,kbShCt8=0x01a8,kbShCt9=0x01a9,kbShCtBackSpace=0x01aa,
+ kbShCtTab=0x01ab,kbShCtEnter=0x01ac,kbShCtColon=0x01ad,
+ kbShCtQuote=0x01ae,kbShCtGrave=0x01af,kbShCtComma=0x01b0,
+ kbShCtStop=0x01b1,kbShCtSlash=0x01b2,kbShCtAsterisk=0x01b3,
+ kbShCtSpace=0x01b4,kbShCtMinus=0x01b5,kbShCtPlus=0x01b6,
+ kbShCtPrnScr=0x01b7,kbShCtEqual=0x01b8,kbShCtF1=0x01b9,kbShCtF2=0x01ba,
+ kbShCtF3=0x01bb,kbShCtF4=0x01bc,kbShCtF5=0x01bd,kbShCtF6=0x01be,
+ kbShCtF7=0x01bf,kbShCtF8=0x01c0,kbShCtF9=0x01c1,kbShCtF10=0x01c2,
+ kbShCtF11=0x01c3,kbShCtF12=0x01c4,kbShCtHome=0x01c5,kbShCtUp=0x01c6,
+ kbShCtPgUp=0x01c7,kbShCtLeft=0x01c8,kbShCtRight=0x01c9,kbShCtEnd=0x01ca,
+ kbShCtDown=0x01cb,kbShCtPgDn=0x01cc,kbShCtInsert=0x01cd,
+ kbShCtDelete=0x01ce,kbShCtCaret=0x01cf,kbShCtAdmid=0x01d0,
+ kbShCtDobleQuote=0x01d1,kbShCtNumeral=0x01d2,kbShCtDolar=0x01d3,
+ kbShCtPercent=0x01d4,kbShCtAmper=0x01d5,kbShCtOpenPar=0x01d6,
+ kbShCtClosePar=0x01d7,kbShCtDoubleDot=0x01d8,kbShCtLessThan=0x01d9,
+ kbShCtGreaterThan=0x01da,kbShCtQuestion=0x01db,kbShCtA_Roba=0x01dc,
+ kbShCtOr=0x01dd,kbShCtUnderLine=0x01de,kbShCtOpenCurly=0x01df,
+ kbShCtCloseCurly=0x01e0,kbShCtTilde=0x01e1,kbShCtMacro=0x01e2,
+ kbShCtWinLeft=0x01e3,kbShCtWinRight=0x01e4,kbShCtWinSel=0x01e5;
+
+const ushort
+ kbAlUnknown=0x0200,kbAlA=0x0201,kbAlB=0x0202,kbAlC=0x0203,kbAlD=0x0204,
+ kbAlE=0x0205,kbAlF=0x0206,kbAlG=0x0207,kbAlH=0x0208,kbAlI=0x0209,
+ kbAlJ=0x020a,kbAlK=0x020b,kbAlL=0x020c,kbAlM=0x020d,kbAlN=0x020e,
+ kbAlO=0x020f,kbAlP=0x0210,kbAlQ=0x0211,kbAlR=0x0212,kbAlS=0x0213,
+ kbAlT=0x0214,kbAlU=0x0215,kbAlV=0x0216,kbAlW=0x0217,kbAlX=0x0218,
+ kbAlY=0x0219,kbAlZ=0x021a,kbAlOpenBrace=0x021b,kbAlBackSlash=0x021c,
+ kbAlCloseBrace=0x021d,kbAlPause=0x021e,kbAlEsc=0x021f,kbAl0=0x0220,
+ kbAl1=0x0221,kbAl2=0x0222,kbAl3=0x0223,kbAl4=0x0224,kbAl5=0x0225,
+ kbAl6=0x0226,kbAl7=0x0227,kbAl8=0x0228,kbAl9=0x0229,
+ kbAlBackSpace=0x022a,kbAlTab=0x022b,kbAlEnter=0x022c,kbAlColon=0x022d,
+ kbAlQuote=0x022e,kbAlGrave=0x022f,kbAlComma=0x0230,kbAlStop=0x0231,
+ kbAlSlash=0x0232,kbAlAsterisk=0x0233,kbAlSpace=0x0234,kbAlMinus=0x0235,
+ kbAlPlus=0x0236,kbAlPrnScr=0x0237,kbAlEqual=0x0238,kbAlF1=0x0239,
+ kbAlF2=0x023a,kbAlF3=0x023b,kbAlF4=0x023c,kbAlF5=0x023d,kbAlF6=0x023e,
+ kbAlF7=0x023f,kbAlF8=0x0240,kbAlF9=0x0241,kbAlF10=0x0242,kbAlF11=0x0243,
+ kbAlF12=0x0244,kbAlHome=0x0245,kbAlUp=0x0246,kbAlPgUp=0x0247,
+ kbAlLeft=0x0248,kbAlRight=0x0249,kbAlEnd=0x024a,kbAlDown=0x024b,
+ kbAlPgDn=0x024c,kbAlInsert=0x024d,kbAlDelete=0x024e,kbAlCaret=0x024f,
+ kbAlAdmid=0x0250,kbAlDobleQuote=0x0251,kbAlNumeral=0x0252,
+ kbAlDolar=0x0253,kbAlPercent=0x0254,kbAlAmper=0x0255,kbAlOpenPar=0x0256,
+ kbAlClosePar=0x0257,kbAlDoubleDot=0x0258,kbAlLessThan=0x0259,
+ kbAlGreaterThan=0x025a,kbAlQuestion=0x025b,kbAlA_Roba=0x025c,
+ kbAlOr=0x025d,kbAlUnderLine=0x025e,kbAlOpenCurly=0x025f,
+ kbAlCloseCurly=0x0260,kbAlTilde=0x0261,kbAlMacro=0x0262,kbAlWinLeft=0x0263,
+ kbAlWinRight=0x0264,kbAlWinSel=0x0265;
+
+const ushort
+ kbShAlUnknown=0x0280,kbShAlA=0x0281,kbShAlB=0x0282,kbShAlC=0x0283,
+ kbShAlD=0x0284,kbShAlE=0x0285,kbShAlF=0x0286,kbShAlG=0x0287,
+ kbShAlH=0x0288,kbShAlI=0x0289,kbShAlJ=0x028a,kbShAlK=0x028b,
+ kbShAlL=0x028c,kbShAlM=0x028d,kbShAlN=0x028e,kbShAlO=0x028f,
+ kbShAlP=0x0290,kbShAlQ=0x0291,kbShAlR=0x0292,kbShAlS=0x0293,
+ kbShAlT=0x0294,kbShAlU=0x0295,kbShAlV=0x0296,kbShAlW=0x0297,
+ kbShAlX=0x0298,kbShAlY=0x0299,kbShAlZ=0x029a,kbShAlOpenBrace=0x029b,
+ kbShAlBackSlash=0x029c,kbShAlCloseBrace=0x029d,kbShAlPause=0x029e,
+ kbShAlEsc=0x029f,kbShAl0=0x02a0,kbShAl1=0x02a1,kbShAl2=0x02a2,
+ kbShAl3=0x02a3,kbShAl4=0x02a4,kbShAl5=0x02a5,kbShAl6=0x02a6,
+ kbShAl7=0x02a7,kbShAl8=0x02a8,kbShAl9=0x02a9,kbShAlBackSpace=0x02aa,
+ kbShAlTab=0x02ab,kbShAlEnter=0x02ac,kbShAlColon=0x02ad,
+ kbShAlQuote=0x02ae,kbShAlGrave=0x02af,kbShAlComma=0x02b0,
+ kbShAlStop=0x02b1,kbShAlSlash=0x02b2,kbShAlAsterisk=0x02b3,
+ kbShAlSpace=0x02b4,kbShAlMinus=0x02b5,kbShAlPlus=0x02b6,
+ kbShAlPrnScr=0x02b7,kbShAlEqual=0x02b8,kbShAlF1=0x02b9,
+ kbShAlF2=0x02ba,kbShAlF3=0x02bb,kbShAlF4=0x02bc,kbShAlF5=0x02bd,
+ kbShAlF6=0x02be,kbShAlF7=0x02bf,kbShAlF8=0x02c0,kbShAlF9=0x02c1,
+ kbShAlF10=0x02c2,kbShAlF11=0x02c3,kbShAlF12=0x02c4,kbShAlHome=0x02c5,
+ kbShAlUp=0x02c6,kbShAlPgUp=0x02c7,kbShAlLeft=0x02c8,kbShAlRight=0x02c9,
+ kbShAlEnd=0x02ca,kbShAlDown=0x02cb,kbShAlPgDn=0x02cc,
+ kbShAlInsert=0x02cd,kbShAlDelete=0x02ce,kbShAlCaret=0x02cf,
+ kbShAlAdmid=0x02d0,kbShAlDobleQuote=0x02d1,kbShAlNumeral=0x02d2,
+ kbShAlDolar=0x02d3,kbShAlPercent=0x02d4,kbShAlAmper=0x02d5,
+ kbShAlOpenPar=0x02d6,kbShAlClosePar=0x02d7,kbShAlDoubleDot=0x02d8,
+ kbShAlLessThan=0x02d9,kbShAlGreaterThan=0x02da,kbShAlQuestion=0x02db,
+ kbShAlA_Roba=0x02dc,kbShAlOr=0x02dd,kbShAlUnderLine=0x02de,
+ kbShAlOpenCurly=0x02df,kbShAlCloseCurly=0x02e0,kbShAlTilde=0x02e1,
+ kbShAlMacro=0x02e2,kbShAlWinLeft=0x02e3,kbShAlWinRight=0x02e4,
+ kbShAlWinSel=0x02e5;
+
+const ushort
+ kbCtAlUnknown=0x0300,kbCtAlA=0x0301,kbCtAlB=0x0302,kbCtAlC=0x0303,
+ kbCtAlD=0x0304,kbCtAlE=0x0305,kbCtAlF=0x0306,kbCtAlG=0x0307,
+ kbCtAlH=0x0308,kbCtAlI=0x0309,kbCtAlJ=0x030a,kbCtAlK=0x030b,
+ kbCtAlL=0x030c,kbCtAlM=0x030d,kbCtAlN=0x030e,kbCtAlO=0x030f,
+ kbCtAlP=0x0310,kbCtAlQ=0x0311,kbCtAlR=0x0312,kbCtAlS=0x0313,
+ kbCtAlT=0x0314,kbCtAlU=0x0315,kbCtAlV=0x0316,kbCtAlW=0x0317,
+ kbCtAlX=0x0318,kbCtAlY=0x0319,kbCtAlZ=0x031a,kbCtAlOpenBrace=0x031b,
+ kbCtAlBackSlash=0x031c,kbCtAlCloseBrace=0x031d,kbCtAlPause=0x031e,
+ kbCtAlEsc=0x031f,kbCtAl0=0x0320,kbCtAl1=0x0321,kbCtAl2=0x0322,
+ kbCtAl3=0x0323,kbCtAl4=0x0324,kbCtAl5=0x0325,kbCtAl6=0x0326,
+ kbCtAl7=0x0327,kbCtAl8=0x0328,kbCtAl9=0x0329,kbCtAlBackSpace=0x032a,
+ kbCtAlTab=0x032b,kbCtAlEnter=0x032c,kbCtAlColon=0x032d,
+ kbCtAlQuote=0x032e,kbCtAlGrave=0x032f,kbCtAlComma=0x0330,
+ kbCtAlStop=0x0331,kbCtAlSlash=0x0332,kbCtAlAsterisk=0x0333,
+ kbCtAlSpace=0x0334,kbCtAlMinus=0x0335,kbCtAlPlus=0x0336,
+ kbCtAlPrnScr=0x0337,kbCtAlEqual=0x0338,kbCtAlF1=0x0339,
+ kbCtAlF2=0x033a,kbCtAlF3=0x033b,kbCtAlF4=0x033c,kbCtAlF5=0x033d,
+ kbCtAlF6=0x033e,kbCtAlF7=0x033f,kbCtAlF8=0x0340,kbCtAlF9=0x0341,
+ kbCtAlF10=0x0342,kbCtAlF11=0x0343,kbCtAlF12=0x0344,kbCtAlHome=0x0345,
+ kbCtAlUp=0x0346,kbCtAlPgUp=0x0347,kbCtAlLeft=0x0348,kbCtAlRight=0x0349,
+ kbCtAlEnd=0x034a,kbCtAlDown=0x034b,kbCtAlPgDn=0x034c,
+ kbCtAlInsert=0x034d,kbCtAlDelete=0x034e,kbCtAlCaret=0x034f,
+ kbCtAlAdmid=0x0350,kbCtAlDobleQuote=0x0351,kbCtAlNumeral=0x0352,
+ kbCtAlDolar=0x0353,kbCtAlPercent=0x0354,kbCtAlAmper=0x0355,
+ kbCtAlOpenPar=0x0356,kbCtAlClosePar=0x0357,kbCtAlDoubleDot=0x0358,
+ kbCtAlLessThan=0x0359,kbCtAlGreaterThan=0x035a,kbCtAlQuestion=0x035b,
+ kbCtAlA_Roba=0x035c,kbCtAlOr=0x035d,kbCtAlUnderLine=0x035e,
+ kbCtAlOpenCurly=0x035f,kbCtAlCloseCurly=0x0360,kbCtAlTilde=0x0361,
+ kbCtAlMacro=0x0362,kbCtAlWinLeft=0x0363,kbCtAlWinRight=0x0364,
+ kbCtAlWinSel=0x0365;
+
+const ushort
+ kbShCtAlUnknown=0x0380,kbShCtAlA=0x0381,kbShCtAlB=0x0382,
+ kbShCtAlC=0x0383,kbShCtAlD=0x0384,kbShCtAlE=0x0385,kbShCtAlF=0x0386,
+ kbShCtAlG=0x0387,kbShCtAlH=0x0388,kbShCtAlI=0x0389,kbShCtAlJ=0x038a,
+ kbShCtAlK=0x038b,kbShCtAlL=0x038c,kbShCtAlM=0x038d,kbShCtAlN=0x038e,
+ kbShCtAlO=0x038f,kbShCtAlP=0x0390,kbShCtAlQ=0x0391,kbShCtAlR=0x0392,
+ kbShCtAlS=0x0393,kbShCtAlT=0x0394,kbShCtAlU=0x0395,kbShCtAlV=0x0396,
+ kbShCtAlW=0x0397,kbShCtAlX=0x0398,kbShCtAlY=0x0399,kbShCtAlZ=0x039a,
+ kbShCtAlOpenBrace=0x039b,kbShCtAlBackSlash=0x039c,
+ kbShCtAlCloseBrace=0x039d,kbShCtAlPause=0x039e,kbShCtAlEsc=0x039f,
+ kbShCtAl0=0x03a0,kbShCtAl1=0x03a1,kbShCtAl2=0x03a2,kbShCtAl3=0x03a3,
+ kbShCtAl4=0x03a4,kbShCtAl5=0x03a5,kbShCtAl6=0x03a6,kbShCtAl7=0x03a7,
+ kbShCtAl8=0x03a8,kbShCtAl9=0x03a9,kbShCtAlBackSpace=0x03aa,
+ kbShCtAlTab=0x03ab,kbShCtAlEnter=0x03ac,kbShCtAlColon=0x03ad,
+ kbShCtAlQuote=0x03ae,kbShCtAlGrave=0x03af,kbShCtAlComma=0x03b0,
+ kbShCtAlStop=0x03b1,kbShCtAlSlash=0x03b2,kbShCtAlAsterisk=0x03b3,
+ kbShCtAlSpace=0x03b4,kbShCtAlMinus=0x03b5,kbShCtAlPlus=0x03b6,
+ kbShCtAlPrnScr=0x03b7,kbShCtAlEqual=0x03b8,kbShCtAlF1=0x03b9,
+ kbShCtAlF2=0x03ba,kbShCtAlF3=0x03bb,kbShCtAlF4=0x03bc,kbShCtAlF5=0x03bd,
+ kbShCtAlF6=0x03be,kbShCtAlF7=0x03bf,kbShCtAlF8=0x03c0,kbShCtAlF9=0x03c1,
+ kbShCtAlF10=0x03c2,kbShCtAlF11=0x03c3,kbShCtAlF12=0x03c4,
+ kbShCtAlHome=0x03c5,kbShCtAlUp=0x03c6,kbShCtAlPgUp=0x03c7,
+ kbShCtAlLeft=0x03c8,kbShCtAlRight=0x03c9,kbShCtAlEnd=0x03ca,
+ kbShCtAlDown=0x03cb,kbShCtAlPgDn=0x03cc,kbShCtAlInsert=0x03cd,
+ kbShCtAlDelete=0x03ce,kbShCtAlCaret=0x03cf,kbShCtAlAdmid=0x03d0,
+ kbShCtAlDobleQuote=0x03d1,kbShCtAlNumeral=0x03d2,kbShCtAlDolar=0x03d3,
+ kbShCtAlPercent=0x03d4,kbShCtAlAmper=0x03d5,kbShCtAlOpenPar=0x03d6,
+ kbShCtAlClosePar=0x03d7,kbShCtAlDoubleDot=0x03d8,
+ kbShCtAlLessThan=0x03d9,kbShCtAlGreaterThan=0x03da,
+ kbShCtAlQuestion=0x03db,kbShCtAlA_Roba=0x03dc,kbShCtAlOr=0x03dd,
+ kbShCtAlUnderLine=0x03de,kbShCtAlOpenCurly=0x03df,
+ kbShCtAlCloseCurly=0x03e0,kbShCtAlTilde=0x03e1,kbShCtAlMacro=0x03e2,
+ kbShCtAlWinLeft=0x03e3,kbShCtAlWinRight=0x03e4,kbShCtAlWinSel=0x03e5;
+#endif
diff --git a/tvision/include/tv/tkeys.h b/tvision/include/tv/tkeys.h
new file mode 100644
index 0000000..4d9eb67
--- /dev/null
+++ b/tvision/include/tv/tkeys.h
@@ -0,0 +1,96 @@
+/*
+ Abstract keys definition by SET.
+ Here I define just the keys defined in tkeys.h and not the 2048
+ combinations I detect.
+*/
+
+#if !defined( __TKEYS_H )
+#define __TKEYS_H
+
+#ifdef Uses_TKeys_Extended
+// That's a request for ALL the codes
+#include <tv/tkeyext.h>
+#else
+
+const ushort
+
+// Normal keys
+ kbSpace = 0x0034,
+
+// Control keys
+
+ kbCtrlA=0x0101,kbCtrlB=0x0102,kbCtrlC=0x0103,kbCtrlD=0x0104,
+ kbCtrlE=0x0105,kbCtrlF=0x0106,kbCtrlG=0x0107,kbCtrlH=0x0108,
+ kbCtrlI=0x0109,kbCtrlJ=0x010a,kbCtrlK=0x010b,kbCtrlL=0x010c,
+ kbCtrlM=0x010d,kbCtrlN=0x010e,kbCtrlO=0x010f,kbCtrlP=0x0110,
+ kbCtrlQ=0x0111,kbCtrlR=0x0112,kbCtrlS=0x0113,kbCtrlT=0x0114,
+ kbCtrlU=0x0115,kbCtrlV=0x0116,kbCtrlW=0x0117,kbCtrlX=0x0118,
+ kbCtrlY=0x0119,kbCtrlZ=0x011a,
+
+// Extended key codes
+
+ kbEsc = 0x001f, kbAltSpace = 0x0234, kbCtrlIns = 0x014d,
+ kbShiftIns = 0x00cd, kbCtrlDel = 0x014e, kbShiftDel = 0x00ce,
+ kbCtrlShiftIns = 0x01cd, kbCtrlShiftDel = 0x01ce,
+ kbBack = 0x002a, kbCtrlBack = 0x012a, kbShiftTab = 0x00ab,
+ kbTab = 0x002b, kbAltA=0x0201, kbAltB=0x0202,
+ kbAltC=0x0203, kbAltD=0x0204, kbAltE=0x0205,
+ kbAltF=0x0206, kbAltG=0x0207, kbAltH=0x0208,
+ kbAltI=0x0209, kbAltJ=0x020a, kbAltK=0x020b,
+ kbAltL=0x020c, kbAltM=0x020d, kbAltN=0x020e,
+ kbAltO=0x020f, kbAltP=0x0210, kbAltQ=0x0211,
+ kbAltR=0x0212, kbAltS=0x0213, kbAltT=0x0214,
+ kbAltU=0x0215, kbAltV=0x0216, kbAltW=0x0217,
+ kbAltX=0x0218, kbAltY=0x0219, kbAltZ=0x021a,
+ kbCtrlEnter=0x012c, kbEnter=0x002c, kbF1=0x0039,
+ kbF2=0x003a, kbF3=0x003b, kbF4=0x003c,
+ kbF5=0x003d, kbF6=0x003e, kbF7=0x003f,
+ kbF8=0x0040, kbF9=0x0041, kbF10=0x0042,
+ kbF11=0x0043, kbF12=0x0044,
+ kbHome=0x0045, kbUp=0x0046, kbPgUp=0x0047,
+ kbLeft=0x0048, kbRight=0x0049, kbEnd=0x004a,
+ kbDown=0x004b, kbPgDn=0x004c, kbIns=0x004d,
+ kbDel=0x004e,
+ // These are normal + & - because I think isn't good make any
+ // difference
+ kbGrayMinus = 0x0035, kbGrayPlus = 0x0036,
+ kbShiftF1=0x00b9, kbShiftF2=0x00ba, kbShiftF3=0x00bb,
+ kbShiftF4=0x00bc, kbShiftF5=0x00bd, kbShiftF6=0x00be,
+ kbShiftF7=0x00bf, kbShiftF8=0x00c0, kbShiftF9=0x00c1,
+ kbShiftF10=0x00c2, kbShiftF11=0x00c3, kbShiftF12=0x00c4,
+ kbCtrlF1=0x0139, kbCtrlF2=0x013a, kbCtrlF3=0x013b,
+ kbCtrlF4=0x013c, kbCtrlF5=0x013d, kbCtrlF6=0x013e,
+ kbCtrlF7=0x013f, kbCtrlF8=0x0140, kbCtrlF9=0x0141,
+ kbCtrlF10=0x0142, kbCtrlF11=0x0143, kbCtrlF12=0x0144,
+ kbAltF1=0x0239, kbAltF2=0x023a, kbAltF3=0x023b,
+ kbAltF4=0x023c, kbAltF5=0x023d, kbAltF6=0x023e,
+ kbAltF7=0x023f, kbAltF8=0x0240, kbAltF9=0x0241,
+ kbAltF10=0x0242, kbAltF11=0x0243, kbAltF12=0x0244,
+ kbCtrlPrtSc = 0x0137, kbCtrlLeft=0x0148, kbCtrlRight=0x0149,
+ kbCtrlEnd=0x014a, kbCtrlPgDn=0x014c, kbCtrlHome = 0x0145,
+ kbAlt1=0x0221, kbAlt2=0x0222, kbAlt3=0x0223,
+ kbAlt4=0x0224, kbAlt5=0x0225, kbAlt6=0x0226,
+ kbAlt7=0x0227, kbAlt8=0x0228, kbAlt9=0x0229,
+ kbAlt0 = 0x0220, kbAltMinus = 0x0235, kbAltEqual = 0x0238,
+ kbCtrlPgUp = 0x0147, kbNoKey = 0x0000,
+ kbAltBack=0x022a;
+#endif
+
+// Keyboard state and shift masks
+const ushort
+ kbRightShift = 0x0001,
+ kbLeftShift = 0x0002,
+ kbShift = kbLeftShift | kbRightShift,
+ kbLeftCtrl = 0x0004,
+ kbRightCtrl = 0x0004,
+ kbCtrlShift = kbLeftCtrl | kbRightCtrl,
+ kbLeftAlt = 0x0008,
+ kbRightAlt = 0x0008,
+ kbAltShift = kbLeftAlt | kbRightAlt,
+ kbScrollState = 0x0010,
+ kbNumState = 0x0020,
+ kbCapsState = 0x0040,
+ kbInsState = 0x0080;
+
+
+#endif
diff --git a/tvision/include/tv/tobjstrm.h b/tvision/include/tv/tobjstrm.h
new file mode 100644
index 0000000..291d440
--- /dev/null
+++ b/tvision/include/tv/tobjstrm.h
@@ -0,0 +1,165 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+typedef unsigned P_id_type;
+
+// SET: Here we implement a trick to pull the needed TStreamableClass-es.
+// We have two approaches:
+// 1) We create a structure with a pointer to itself and another to the
+// object to register the stream for the class.
+// 2) Same but we use a constructor in the structure.
+// The first methode was tested with gcc 2.6.3 to 3.4.1. It seems to fail
+// for gcc 3.4.1, but we know it works for most versions of gcc.
+// The second was specifically created to BC++ compiler.
+// The BC++ approach should work for any C++ compiler, but fails for gcc 3.3.5.
+// For this reason I'm keeping both and switching to the second approach
+// only for gcc>=3.4.
+// GCC 3.4.x and 4.0.0 introduces another problem: statics are optimized out.
+// Even when they have side-effects.
+// Another option for gcc (suggested by Andris):
+// #define __link( s ) __asm__(".global _"#s);
+
+#undef TV_Use_Constructor_For_fLink_def
+#undef TV_Use_Namespace_instead_of_Static
+#if defined(TVComp_BCPP)
+ #define TV_Use_Constructor_For_fLink_def 1
+ #define TV_Use_Namespace_instead_of_Static 0
+#elif __GNUC__>=3 && (__GNUC__>=4 || __GNUC_MINOR__>=4)
+ #define TV_Use_Constructor_For_fLink_def 1
+ #define TV_Use_Namespace_instead_of_Static 1
+#else
+ #define TV_Use_Constructor_For_fLink_def 0
+#endif
+
+#if !defined(TV__fLink_def)
+#define TV__fLink_def
+struct fLink
+{
+ fLink *f;
+ class TStreamableClass *t;
+ #if TV_Use_Constructor_For_fLink_def
+ fLink(fLink* af, class TStreamableClass *at) : f(af), t(at) {}
+ #endif
+};
+#endif
+
+#if TV_Use_Constructor_For_fLink_def
+ // This approach fails for gcc 3.3.5 so we can't use it for all gcc versions.
+ #if TV_Use_Namespace_instead_of_Static
+ // Ok for gcc 3.4.4 and 4.0.0
+ // Suggested by Andris Pavenis he said: Anonymous namespace is very similar to static
+ // (it's a separate for each compiled source). So we are not going to have name
+ // collisions.
+ #define __link( s ) \
+ extern TStreamableClass s; \
+ namespace { \
+ fLink force ## s \
+ ( (fLink *)&force ## s, (TStreamableClass *)&s ); \
+ }
+ #else
+ // Ok for BC++ 5.5/6
+ // Fails with gcc 3.4+ because the static code gets "optimized" That's a bug from my
+ // point of view because the static code have external side-effects (calls a constructor)
+ #define __link( s ) \
+ extern TStreamableClass s; \
+ static fLink force ## s \
+ ( (fLink *)&force ## s, (TStreamableClass *)&s );
+ #endif
+#else
+ // Ok for gcc 2.7.2, 2.8.1, 2.95.3/4, 3.3.5 and all MSVC versions we tried.
+ // Fails for gcc 3.4+ read above.
+ #define __link( s ) \
+ extern TStreamableClass s; \
+ static fLink force ## s = \
+ { (fLink *)&force ## s, (TStreamableClass *)&s };
+#endif
+
+#if defined( Uses_TStreamable )
+
+#include <tv/streambl.h>
+
+#endif
+
+#if defined( Uses_TStreamableClass )
+
+#include <tv/strmblcl.h>
+
+#endif
+
+#if defined( Uses_TStreamableTypes )
+
+#include <tv/strmblty.h>
+
+#endif
+
+#if defined( Uses_TPWrittenObjects )
+
+#include <tv/pwritobj.h>
+
+#endif
+
+#if defined( Uses_TPReadObjects )
+
+#include <tv/preadobj.h>
+
+#endif
+
+#if defined( Uses_pstream )
+
+#include <tv/pstream.h>
+
+#endif
+
+#if defined( Uses_ipstream )
+
+#include <tv/ipstream.h>
+
+#endif
+
+#if defined( Uses_opstream )
+
+#include <tv/opstream.h>
+
+#endif
+
+#if defined( Uses_iopstream )
+
+#include <tv/iopstrm.h>
+
+#endif
+
+#if defined( Uses_fpbase )
+
+#include <tv/fpbase.h>
+
+#endif
+
+#if defined( Uses_ifpstream )
+
+#include <tv/ifpstrm.h>
+
+#endif
+
+#if defined( Uses_ofpstream )
+
+#include <tv/ofpstrm.h>
+
+#endif
+
+#if defined( Uses_fpstream )
+
+#include <tv/fpstream.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/ttypes.h b/tvision/include/tv/ttypes.h
new file mode 100644
index 0000000..004fa32
--- /dev/null
+++ b/tvision/include/tv/ttypes.h
@@ -0,0 +1,24 @@
+/*
+ Copyright (c) 2000-2001 by Salvador E. Tropea.
+ This file was heavily reestructured.
+*/
+
+#if !defined( __TTYPES_H )
+#define __TTYPES_H
+
+const char EOS = '\0';
+
+enum StreamableInit { streamableInit };
+
+class ipstream;
+class opstream;
+class TStreamable;
+class TStreamableTypes;
+
+typedef int32 ccIndex;
+typedef Boolean (*ccTestFunc)( void *, void * );
+typedef void (*ccAppFunc)( void *, void * );
+
+const int ccNotFound = -1;
+
+#endif // __TTYPES_H
diff --git a/tvision/include/tv/tvconfig.h b/tvision/include/tv/tvconfig.h
new file mode 100644
index 0000000..c1439ba
--- /dev/null
+++ b/tvision/include/tv/tvconfig.h
@@ -0,0 +1,39 @@
+/*
+
+ This file isn't based in original TV file anymore.
+ It was originally based on it and modified by Robert H”hne to be used for
+RHIDE. But currently it was rethinked from the start by Salvador E. Tropea.
+ Copyright (c) 2000-2003 by Salvador E. Tropea. Covered by the GPL license.
+ Most of the OS dependent code was moved to the "Compat LaYer" library.
+
+*/
+
+#if !defined( CONFIG_H_INCLUDED )
+#define CONFIG_H_INCLUDED
+
+// The result of sizeof is a size_t which is defined here.
+// So I think is better to include it.
+#include <stddef.h>
+#include <sys/types.h>
+#include <limits.h>
+
+const int eventQSize = 16;
+const int maxCollectionSize = UINT_MAX/sizeof( void * );
+
+// May be I'll remove that sometimes
+#ifdef TVOS_DOS
+const int maxViewWidth = 132;
+#else // at least on linux in a xterm it can be more than 132
+const int maxViewWidth = 1024;
+#endif
+
+const int maxFindStrLen = 80;
+const int maxReplaceStrLen = 80;
+
+#include <tv/intl.h>
+
+#ifndef pid_t
+# define pid_t int
+#endif
+
+#endif // CONFIG_H_INCLUDED
diff --git a/tvision/include/tv/tvedit.h b/tvision/include/tv/tvedit.h
new file mode 100644
index 0000000..da0e2fd
--- /dev/null
+++ b/tvision/include/tv/tvedit.h
@@ -0,0 +1,57 @@
+/***************************************************************/
+/* */
+/* this header-file was modified by Robert Hoehne */
+/* to use it with DJ's port of gcc */
+/* */
+/***************************************************************/
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Turbo Vision TVEDIT header file */
+/*----------------------------------------------------------*/
+
+#if defined( Uses_TEditorApp ) && !defined( __TEditorApp )
+#define __TEditorApp
+
+class TMenuBar;
+class TStatusLine;
+class TEditWindow;
+class TDialog;
+
+class CLY_EXPORT TEditorApp : public TApplication
+{
+
+public:
+
+ TEditorApp();
+
+ virtual void handleEvent( TEvent& event );
+ static TMenuBar *initMenuBar( TRect );
+ static TStatusLine *initStatusLine( TRect );
+ virtual void outOfMemory();
+
+// private:
+
+ virtual TEditWindow *openEditor( const char *fileName, Boolean visible );
+
+protected:
+
+ virtual void fileOpen();
+ void fileNew();
+ void changeDir();
+ virtual void dosShell();
+ void showClip();
+ void tile();
+ void cascade();
+};
+
+extern TEditWindow *clipWindow;
+
+ushort execDialog( TDialog *d, void *data );
+TDialog *createFindDialog();
+TDialog *createReplaceDialog();
+ushort doEditDialog( int dialog, ... );
+
+#endif
diff --git a/tvision/include/tv/tvobjs.h b/tvision/include/tv/tvobjs.h
new file mode 100644
index 0000000..0c95a53
--- /dev/null
+++ b/tvision/include/tv/tvobjs.h
@@ -0,0 +1,32 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TObject )
+
+#include <tv/object.h>
+
+#endif
+
+#if defined( Uses_TNSCollection )
+
+#include <tv/nscoll.h>
+
+#endif
+
+#if defined( Uses_TNSSortedCollection )
+
+#include <tv/nssorcol.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/tvutil.h b/tvision/include/tv/tvutil.h
new file mode 100644
index 0000000..7436d43
--- /dev/null
+++ b/tvision/include/tv/tvutil.h
@@ -0,0 +1,98 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to avoid macros collisions and make easier to use.
+
+ */
+
+#if !defined( __UTIL_H )
+#define __UTIL_H
+
+// SET: Used by names, they only include this file.
+#ifdef Uses_n
+ #include <compatlayer.h>
+#endif
+
+#undef __CM
+#undef __HC
+#undef __BASE
+#define __BASE 128
+#define __CM(x,y) const unsigned short cm##x = __BASE+y;
+#define __HC(x,y) const unsigned short hc##x = __BASE+y;
+
+
+#ifndef CLY_DONT_DEFINE_MIN_MAX
+
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+
+inline int min( const int &a, const int &b )
+{
+ return (a>b) ? b : a;
+}
+
+inline int max( const int &a, const int &b )
+{
+ return (a<b) ? b : a;
+}
+
+// The following min/max works for any kind of data type
+// Published by Vincent Van Den Berghe in the Windows/DOS developer's journal April 93
+// But they don't replace the above functions for cases like:
+// max(int,unsigned int)
+//
+template <class T> inline T min( const T &a, const T &b )
+{
+ return (a>b) ? b : a;
+}
+
+template <class T> inline T max( const T &a, const T &b )
+{
+ return (a<b) ? b : a;
+}
+
+#endif
+
+char CLY_EXPORT hotKey( const char *s );
+unsigned short CLY_EXPORT ctrlToArrow( unsigned short );
+
+unsigned short CLY_EXPORT historyCount( unsigned char id );
+const char CLY_EXPORT *historyStr( unsigned char id, int index );
+void CLY_EXPORT historyAdd( unsigned char id, const char * );
+
+int cstrlen( const char * );
+
+class TView;
+void CLY_EXPORT *message( TView *receiver, unsigned short what, unsigned short command,
+ void *infoPtr );
+Boolean CLY_EXPORT lowMemory();
+
+char CLY_EXPORT *newStr( const char * );
+
+/* SET: Added a conditional for it because n is too common. I remmember I had
+ problems with it and Jerzy Witkowski <jwi@pl.ibm.com> complained about
+ conflicts between a class member in your code and this macro */
+#ifdef Uses_n
+/* The following macro is a little hack to decrease the compile time
+ for the TV lib when compiling all the n*.cc files */
+
+#define n(CLASS) \
+class CLY_EXPORT CLASS \
+{ \
+public: \
+ static const char * const name; \
+}; \
+ \
+const char * const CLASS::name = #CLASS;
+#endif
+
+#endif // __UTIL_H
diff --git a/tvision/include/tv/unix/key.h b/tvision/include/tv/unix/key.h
new file mode 100644
index 0000000..f9436cd
--- /dev/null
+++ b/tvision/include/tv/unix/key.h
@@ -0,0 +1,38 @@
+/* UNIX keyboard handler routines header.
+ Copyright by Salvador E. Tropea (SET) (2001-2002)
+ Covered by the GPL license. */
+#if defined(HAVE_NCURSES) && defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP) &&\
+ !defined(LINUXKEY_HEADER_INCLUDED)
+#define LINUXKEY_HEADER_INCLUDED
+struct TEvent;
+
+// A class to encapsulate the globals, all is static!
+class TGKeyUNIX : public TGKey
+{
+public:
+ TGKeyUNIX() {};
+
+ // Function replacements
+ static void Suspend();
+ static void Resume();
+ static int KbHit();
+ static void Clear();
+ static ushort GKey();
+ static unsigned GetShiftState();
+ static void FillTEvent(TEvent &e);
+ static void SetKbdMapping(int version);
+ static int GetKbdMapping(int version);
+
+ // Setup the pointers to point our members
+ static void Init();
+
+protected:
+ // Specific for this driver
+ static void GetRaw(void);
+ static int Abstract;
+ static char ascii;
+ static ushort sFlags;
+ static KeyType rawCode;
+};
+#endif // LINUXKEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/unix/mouse.h b/tvision/include/tv/unix/mouse.h
new file mode 100644
index 0000000..c90847c
--- /dev/null
+++ b/tvision/include/tv/unix/mouse.h
@@ -0,0 +1,37 @@
+/* UNIX mouse handler routines header.
+ Copyright by Salvador E. Tropea (SET) (2001-2002)
+ Covered by the GPL license. */
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && !defined(TVOSf_QNXRtP) &&\
+ !defined(UNIXMOUSE_INCLUDED)
+#define UNIXMOUSE_INCLUDED
+
+class THWMouseUNIX : public THWMouse
+{
+protected:
+ THWMouseUNIX() {};
+ virtual ~THWMouseUNIX();
+
+ static void Show();
+ static void Hide();
+ static int DrawMouse(int x, int y);
+
+ static void Init();
+};
+
+#ifdef HAVE_NCURSES
+class THWMouseXTerm : public THWMouseUNIX
+{
+protected:
+ THWMouseXTerm() {};
+ virtual ~THWMouseXTerm();
+
+ static void Suspend();
+ static void Resume();
+
+ static void Init();
+
+ friend class TScreenUNIX;
+};
+#endif
+
+#endif // UNIXMOUSE_INCLUDED
diff --git a/tvision/include/tv/unix/screen.h b/tvision/include/tv/unix/screen.h
new file mode 100644
index 0000000..90b994f
--- /dev/null
+++ b/tvision/include/tv/unix/screen.h
@@ -0,0 +1,135 @@
+/* UNIX screen handler routines header.
+ Copyright by Salvador E. Tropea (SET) (2001-2002)
+ Covered by the GPL license. */
+
+#if defined(HAVE_NCURSES) && defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP) && \
+ !defined(UNIXSCREEN_HEADER_INCLUDED)
+#define UNIXSCREEN_HEADER_INCLUDED
+
+// virtual to avoid problems with multiple inheritance
+class TDisplayUNIX : virtual public TDisplay
+{
+protected:
+ TDisplayUNIX() {};
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TDisplayUNIX();
+ // This sets the pointers of TDisplay to point to this class
+ static void Init();
+
+ // Behaviors to replace TDisplay
+ static void SetCursorPos(unsigned x, unsigned y);
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ static void SetCursorShape(unsigned start, unsigned end);
+ // Not available static void clearScreen(uchar, uchar);
+ static ushort GetRows();
+ static ushort GetCols();
+ // Not available static void setCrtMode(ushort mode);
+ // Not available static ushort getCrtMode();
+ static void SetCrtModeExt(char *mode);
+ static int CheckForWindowSize(void);
+ // Not available static const char *getWindowTitle(void);
+ // Not available static int setWindowTitle(const char *name);
+
+ // Functions and members specific for this driver
+ inline static void safeput(char *&p, const char *cap);
+ inline static int canWriteVCS();
+ inline static int canReadVCS();
+ inline static int canOnlyWriteVCS();
+
+ static int vcsWfd; // virtual console system descriptor
+ static int vcsRfd; // SET: Same for reading
+ static int tty_fd; // tty descriptor
+ // Current cursor position
+ static int cur_x, cur_y;
+ // SET: Current cursor shape
+ static int cursorStart,cursorEnd;
+ // SET: 1 when the size of the window where the program is running changed
+ static volatile sig_atomic_t windowSizeChanged;
+};
+
+inline
+void TDisplayUNIX::safeput(char *&p, const char *cap)
+{
+ if (cap)
+ while (*cap) *p++=*cap++;
+}
+
+// With this order the destructor will be called first for TScreenUnix,
+// TScreen, TDisplayUNIX and finally TDisplay.
+class TScreenUNIX : public TDisplayUNIX, public TScreen
+{
+public:
+ TScreenUNIX();
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TScreenUNIX();
+
+ friend class THWMouseXTerm;
+
+ // Fix me: should be protected but right now is used by the editor for the
+ // pal. that should be moved here.
+ static void SendToTerminal(const char *value);
+protected:
+ static void InitPCCharsMapping();
+ static void sigWindowSizeChanged(int sig);
+ static void SpecialKeysDisable(int file);
+ static void SpecialKeysRestore(int file);
+ static void startcurses(int &terminalCodePage);
+ static void mapColor(char *&p, int col);
+ static void writeBlock(int dst, int len, ushort *old, ushort *src);
+ static void RestoreScreen();
+
+ static void Resume();
+ static void Suspend();
+ // Default: ushort fixCrtMode( ushort mode )
+ static void setCrtData();
+ // Default: void clearScreen()
+ static void setVideoMode(ushort mode);
+ static void setVideoModeExt(char *mode);
+ static void getCharacters(unsigned offset,ushort *buf,unsigned count);
+ static ushort getCharacter(unsigned dst);
+ static void setCharacter(unsigned offset,ushort value);
+ static void setCharacters(unsigned dst,ushort *src,unsigned len);
+ static int System(const char *command, pid_t *pidChild, int in, int out,
+ int err);
+
+ enum terminalType
+ {
+ LINUX_TERMINAL=0,
+ GENER_TERMINAL=1,
+ VCSA_TERMINAL=2,
+ XTERM_TERMINAL=3
+ };
+ enum
+ {
+ PAL_MONO, PAL_LOW, PAL_HIGH, PAL_LOW2
+ };
+
+ static int use_pc_chars;
+ static int TerminalType;
+ static FILE *tty_file;
+ static int palette;
+ static int force_redraw;
+ // SET: data to restore the XON/XOFF control keys and others like ^C, ^\ and ^Z
+ // Used by SpecialKeys*
+ static cc_t oldKeys[5];
+ // Used by mapColor:
+ static int old_col,old_fore,old_back;
+ // Save/Restore screen
+ static ushort *user_buffer;
+ static int user_buffer_size;
+ static unsigned user_cursor_x,user_cursor_y;
+ static char *terminal;
+ static char cursesInitialized;
+ static char termAttrsSaved;
+ // SET: That's the job of curses endwin(), additionally it does a much more
+ // complete work so I don't see the point of duplicating work, in my system
+ // I didn't see any change after removing it, but I left the code just in
+ // case
+ #ifdef SAVE_TERMIOS
+ static struct termios old_term,new_term;
+ #endif
+};
+
+#endif
+
diff --git a/tvision/include/tv/unix/xtkey.h b/tvision/include/tv/unix/xtkey.h
new file mode 100644
index 0000000..22845fd
--- /dev/null
+++ b/tvision/include/tv/unix/xtkey.h
@@ -0,0 +1,90 @@
+/* XTerm keyboard handler routines header.
+ Copyright by Salvador E. Tropea (SET) (2002)
+ Covered by the GPL license. */
+#if defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP) && !defined(XTERMKEY_HEADER_INCLUDED)
+#define XTERMKEY_HEADER_INCLUDED
+struct TEvent;
+struct node;
+
+const int MaxLenEscapeSequence=16;
+
+// A class to encapsulate the globals, all is static!
+class TGKeyXTerm : public TGKey
+{
+public:
+ TGKeyXTerm() {};
+
+ // Function replacements
+ static void Suspend();
+ static void Resume();
+ static int KbHit();
+ static void Clear();
+ static ushort GKey();
+ static unsigned GetShiftState();
+ static void FillTEvent(TEvent &e);
+
+ // Setup the pointers to point our members
+ static void Init();
+
+ friend class TScreenXTerm;
+ friend class TDisplayXTerm;
+
+protected:
+ // Specific for this driver
+ static int InitOnce();
+ // Low level code to get a key and process it
+ static int GetRaw();
+ // A low level helper
+ static int GetKeyParsed();
+ // Get a key from the buffer
+ static int GetKeyFromBuffer();
+ // Escape sequences parser
+ static int ProcessEscape();
+ // Escape sequences tree creation helpers
+ static node *NewNode();
+ static node *NewNode(node *p);
+ static node *SearchInList(node *p, uchar k);
+ static node *AddKey2List(node *p, uchar k, node **pa);
+ static void AddKey(const uchar *key, uchar code, uchar modifiers);
+ // This fills the tree with known combinations
+ static void PopulateTree();
+ // File handle for the input
+ static int hIn;
+ // Stream for the hIn
+ static FILE *fIn;
+ // Old mode of the input file handle
+ static int oldInFlags;
+ // New mode of the input file handle
+ static int newInFlags;
+ // Termios data of the console before starting
+ static struct termios inTermiosOrig;
+ // Our termios settings
+ static struct termios inTermiosNew;
+ // Description of the last error
+ static const char *error;
+ // Buffer to store a key escape sequence while we analize it.
+ // If a sequence failed the keys must be returned from here.
+ static int bufferKeys[MaxLenEscapeSequence];
+ // How many keys we have in the buffer
+ static int keysInBuffer;
+ // The next key to return. It avoids using things like ungetc
+ static int nextKey;
+ // Last key code we decoded
+ static int lastKeyCode;
+ // Last set of modifiers
+ static int lastModifiers;
+ // Modifiers in the TV format
+ static int translatedModifiers;
+ // ASCII of the key
+ static char ascii;
+ // Keyboard translation tables
+ static unsigned char kbToName[128];
+ static unsigned char kbExtraFlags[128];
+ // Keys tree
+ static node *Keys;
+ // Mouse is reported as a escape sequence and hence handled here
+ static int MouseButtons;
+};
+
+#endif // XTERMKEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/unix/xtmouse.h b/tvision/include/tv/unix/xtmouse.h
new file mode 100644
index 0000000..56a9593
--- /dev/null
+++ b/tvision/include/tv/unix/xtmouse.h
@@ -0,0 +1,32 @@
+/* XTerm mouse handler routines header.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+#if defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP) && !defined(XTERMMOUSE_INCLUDED)
+#define XTERMMOUSE_INCLUDED
+
+class TScreenXTerm;
+
+class THWMouseXTermFull : public THWMouseUNIX
+{
+protected:
+ THWMouseXTermFull() {};
+ virtual ~THWMouseXTermFull();
+
+ static void SuspendFull();
+ static void ResumeFull();
+ static void SuspendSimple();
+ static void ResumeSimple();
+
+ static void Init(int aMode);
+
+ static int mode;
+ enum
+ {
+ modeXTerm, // Full reporting
+ modeEterm // Just button events :-(
+ };
+
+ friend class TScreenXTerm;
+};
+
+#endif // XTERMMOUSE_INCLUDED
diff --git a/tvision/include/tv/unix/xtscreen.h b/tvision/include/tv/unix/xtscreen.h
new file mode 100644
index 0000000..4492eb8
--- /dev/null
+++ b/tvision/include/tv/unix/xtscreen.h
@@ -0,0 +1,136 @@
+/* XTerm display handler routines header.
+ Copyright by Salvador E. Tropea (SET) (2002)
+ Covered by the GPL license. */
+#if defined(TVOS_UNIX) && !defined(TVOSf_QNXRtP) && !defined(XTERMSCREEN_HEADER_INCLUDED)
+#define XTERMSCREEN_HEADER_INCLUDED
+
+// virtual to avoid problems with multiple inheritance
+class TDisplayXTerm : virtual public TDisplay
+{
+protected:
+ TDisplayXTerm() {};
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TDisplayXTerm();
+ // This sets the pointers of TDisplay to point to this class
+ static void Init();
+
+ // Behaviors to replace TDisplay
+ static void SetCursorPos(unsigned x, unsigned y);
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ static void SetCursorShape(unsigned start, unsigned end);
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ // Not available static void clearScreen(uchar, uchar);
+ static ushort GetRowsIOCTL();
+ static ushort GetRowsSeq();
+ static ushort GetColsIOCTL();
+ static ushort GetColsSeq();
+ // Not available static void SetCrtMode(ushort mode);
+ // Not available static ushort getCrtMode();
+ // Not available static void SetCrtModeExt(char *mode);
+ static int SetCrtModeXT(unsigned w, unsigned h, int , int );
+ static int SetCrtModeEt(unsigned w, unsigned h, int , int );
+ static int CheckForWindowSize(void);
+ static const char *GetWindowTitle(void);
+ static int SetWindowTitle(const char *name);
+ static int SetDisPaletteColorsXT(int from, int number, TScreenColor *colors);
+ static int SetDisPaletteColorsEt(int from, int number, TScreenColor *colors);
+
+ // Functions and members specific for this driver
+ // Current cursor position
+ static int curX, curY;
+ // Current cursor shape
+ static int cursorStart,cursorEnd;
+ // 1 when the size of the window where the program is running changed
+ static volatile sig_atomic_t windowSizeChanged;
+ static int hOut; // Handle for the console output
+ // Font size, this is just a guess
+ static unsigned fontW,fontH;
+ // To distiguish between similar terminals
+ enum { XTerm, Eterm };
+ static int terminalType;
+ // How to restore the palette
+ static void ResetPaletteColorsXT();
+ static void ResetPaletteColorsEt();
+ static void (*ResetPaletteColors)();
+ // Color translation table
+ static char cMap[16];
+ // Which charset is currently selected (G0/G1)
+ static int selCharset;
+ // Available font sizes
+ static TScreenResolution XFonts[];
+ static char fontChanged;
+ static char *oldFontName;
+ static char *GetCurrentFontName();
+ // Window size at start-up
+ static uchar startScreenWidth,startScreenHeight;
+};
+
+// With this order the destructor will be called first for TScreen,
+// TScreenXTerm, TScreen, TScreenXTerm::suspend, TDisplayXTerm and
+// finally TDisplay (twice).
+class TScreenXTerm : public TDisplayXTerm, public TScreen
+{
+public:
+ TScreenXTerm();
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TScreenXTerm();
+
+ friend class TDisplayXTerm;
+
+protected:
+
+ static void Suspend();
+ static void Resume();
+ // Default: ushort fixCrtMode( ushort mode )
+ // Default: void setCrtData();
+ // Default: void clearScreen()
+ static void SetVideoMode(ushort mode);
+ static void SetVideoModeExt(char *mode);
+ // Default: static void GetCharacters(unsigned offset,ushort *buf,unsigned count);
+ // Default: static ushort GetCharacter(unsigned dst);
+ static void SetCharacter(unsigned offset,ushort value);
+ static void SetCharacters(unsigned dst,ushort *src,unsigned len);
+ static int System(const char *command, pid_t *pidChild, int in, int out,
+ int err);
+
+ // Initialization code executed just once
+ static int InitOnce();
+ // Initialize member pointers
+ static void Init();
+ // Window size change signal handler
+ static void sigWindowSizeChanged(int sig);
+ // Helper function to save the current content of the screen
+ static void SaveScreen();
+ static void RestoreScreen();
+ static void SaveScreenReleaseMemory(void);
+ // Helper used to resize screenBuffer
+ static void CheckSizeBuffer(int oldWidth, int oldHeight);
+ // Helper to write the text and escape sequences
+ static void writeBlock(int dst, int len, ushort *old, ushort *src);
+ // Helper to set the color escape sequence
+ static void mapColor(int col);
+ // Closes and releases all, called from TDisplayXTerm
+ static void DeallocateResources();
+ // Terminal state before starting
+ static struct termios outTermiosOrig;
+ // Our terminal state
+ static struct termios outTermiosNew;
+ // Last error
+ static const char *error;
+ // Kind of palette
+ static int palette;
+ enum
+ {
+ PAL_MONO, PAL_LOW, PAL_HIGH, PAL_LOW2
+ };
+ // Current colors, for escape sequences
+ static int oldCol, oldBack, oldFore;
+ // Tables to convert to ISO 2022 scheme
+ static const uchar Code[256];
+ static const uchar Modifier[256];
+ // Indicates if we must use the shell screen instead of the secondary buffer
+ static char useShellScreen;
+};
+
+#endif // XTERMSCREEN_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/validate.h b/tvision/include/tv/validate.h
new file mode 100644
index 0000000..d3229b8
--- /dev/null
+++ b/tvision/include/tv/validate.h
@@ -0,0 +1,333 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea (TPXPictureValidator)
+
+ *
+ *
+ */
+
+#if defined(Uses_TValidator) && !defined(TValidator_Included)
+#define TValidator_Included
+
+const ushort
+// TValidator Status constants
+ vsOk = 0,
+ vsSyntax = 1,
+// Validator option flags
+ voFill = 0x0001,
+ voTransfer = 0x0002,
+ voOnAppend = 0x0004,
+ voReserved = 0x00F8;
+
+typedef enum {
+ vtDataSize,
+ vtSetData,
+ vtGetData
+} TVTransfer;
+
+// TValidator object
+class CLY_EXPORT TValidator : public TObject
+#if !defined( NO_STREAM )
+ , CLY_BROKEN_WATCOM_SCOPE TStreamable
+#endif // NO_STREAM
+{
+public:
+ TValidator();
+ virtual void error();
+ virtual Boolean isValidInput(char *,Boolean);
+ virtual Boolean isValid(const char *);
+ virtual ushort transfer(char *,void *,TVTransfer);
+ virtual void format(char *source);
+ Boolean validate(const char *);
+
+ ushort status;
+ ushort options;
+
+#if !defined( NO_STREAM )
+public:
+ static const char * const name;
+
+private:
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+ TValidator( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TValidator& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TValidator*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TValidator& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TValidator* cl )
+ { return os << (TStreamable *)cl; }
+#endif
+
+#endif // defined(Uses_TValidator) && !defined(TValidator_Included)
+
+
+// TFilterValidator
+#if defined(Uses_TFilterValidator) && !defined(TFilterValidator_Included)
+#define TFilterValidator_Included
+
+class CLY_EXPORT TFilterValidator : public TValidator
+{
+public:
+ TFilterValidator();
+ TFilterValidator(const char *);
+ ~TFilterValidator();
+ virtual void error();
+ virtual Boolean isValid(const char *);
+ virtual Boolean isValidInput(char *,Boolean);
+
+protected:
+ char * validChars;
+
+#if !defined( NO_STREAM )
+public:
+ static const char * const name;
+ static TStreamable *build();
+
+private:
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+ TFilterValidator( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TFilterValidator& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TFilterValidator*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TFilterValidator& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TFilterValidator* cl )
+ { return os << (TStreamable *)cl; }
+#endif
+
+#endif // defined(Uses_TFilterValidator) && !defined(TFilterValidator_Included)
+
+
+// TRangeValidator
+#if defined(Uses_TRangeValidator) && !defined(TRangeValidator_Included)
+#define TRangeValidator_Included
+
+class CLY_EXPORT TRangeValidator : public TFilterValidator
+{
+public:
+ TRangeValidator();
+ TRangeValidator(long aMin,long aMax);
+ virtual void error();
+ virtual Boolean isValid(const char *);
+ virtual ushort transfer(char *,void *,TVTransfer);
+
+protected:
+ long min, max;
+
+#if !defined( NO_STREAM )
+public:
+ static const char * const name;
+ static TStreamable *build();
+
+protected:
+ TRangeValidator( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+private:
+ virtual const char *streamableName() const
+ { return name; }
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TRangeValidator& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TRangeValidator*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TRangeValidator& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TRangeValidator* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // defined(Uses_TRangeValidator) && !defined(TRangeValidator_Included)
+
+
+// TPXPictureValidator
+#if defined(Uses_TPXPictureValidator) && !defined(TPXPictureValidator_Included)
+#define TPXPictureValidator_Included
+
+// TPXPictureValidator result type
+
+enum TPicResult {prComplete, prIncomplete, prEmpty, prError, prSyntax,
+ prAmbiguous, prIncompNoFill};
+
+// TPXPictureValidator
+
+
+class CLY_EXPORT TPXPictureValidator : public TValidator
+{
+public:
+ TPXPictureValidator(const char* aPic, Boolean autoFill);
+ ~TPXPictureValidator();
+ virtual void error();
+ virtual Boolean isValidInput(char* s, Boolean suppressFill);
+ virtual Boolean isValid(const char* s);
+ virtual TPicResult picture(char* input, Boolean autoFill);
+
+protected:
+ char* pic;
+
+private:
+ void consume(char ch, char* input);
+ void toGroupEnd(int& i, int termCh);
+ Boolean skipToComma(int termCh);
+ int calcTerm(int);
+ TPicResult iteration(char* input, int termCh);
+ TPicResult group(char* input, int termCh);
+ TPicResult checkComplete(TPicResult rslt, int termCh);
+ TPicResult scan(char* input, int termCh);
+ TPicResult process(char* input, int termCh);
+ Boolean syntaxCheck();
+
+ int index, jndex;
+ static const char * errorMsg;
+
+#if !defined( NO_STREAM )
+public:
+ static TStreamable *build();
+ static const char * const name;
+
+protected:
+ TPXPictureValidator( StreamableInit );
+ virtual void write( opstream& os );
+ virtual void* read( ipstream& is );
+
+private:
+ virtual const char *streamableName() const {return name;};
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TPXPictureValidator& v )
+ { return is >> (TStreamable&)v; }
+inline ipstream& operator >> ( ipstream& is, TPXPictureValidator*& v )
+ { return is >> (void *&)v; }
+
+inline opstream& operator << ( opstream& os, TPXPictureValidator& v )
+ { return os << (TStreamable&)v; }
+inline opstream& operator << ( opstream& os, TPXPictureValidator* v )
+ { return os << (TStreamable *)v; }
+#endif // NO_STREAM
+
+#endif // defined(Uses_TPXPictureValidator) && !defined(TPXPictureValidator_Included)
+
+
+#if defined(Uses_TLookupValidator) && !defined(TLookupValidator_Included)
+#define TLookupValidator_Included
+
+// TLookupValidator
+
+class CLY_EXPORT TLookupValidator : public TValidator
+{
+public:
+ TLookupValidator() : TValidator() {}
+ virtual Boolean isValid(const char* s);
+ virtual Boolean lookup(const char* s);
+
+#if !defined( NO_STREAM )
+ static TStreamable *build();
+ static const char * const name;
+protected:
+ TLookupValidator( StreamableInit );
+private:
+ virtual const char *streamableName() const {return name;}
+#endif
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TLookupValidator& v )
+ { return is >> (TStreamable&)v; }
+inline ipstream& operator >> ( ipstream& is, TLookupValidator*& v )
+ { return is >> (void *&)v; }
+
+inline opstream& operator << ( opstream& os, TLookupValidator& v )
+ { return os << (TStreamable&)v; }
+inline opstream& operator << ( opstream& os, TLookupValidator* v )
+ { return os << (TStreamable *)v; }
+#endif
+
+#endif // defined(Uses_TLookupValidator) && !defined(TLookupValidator_Included)
+
+
+#if defined(Uses_TStringLookupValidator) && !defined(TStringLookupValidator_Included)
+#define TStringLookupValidator_Included
+
+// TStringLookupValidator
+
+class TStringCollection;
+
+class CLY_EXPORT TStringLookupValidator : public TLookupValidator
+{
+public:
+ TStringLookupValidator(TStringCollection* aStrings);
+ ~TStringLookupValidator();
+ virtual void error();
+ virtual Boolean lookup(const char* s);
+ void newStringList(TStringCollection* aStrings);
+
+protected:
+ TStringCollection* strings;
+ static const char * errorMsg;
+
+#if !defined( NO_STREAM )
+public:
+ static TStreamable *build();
+ static const char * const name;
+
+protected:
+ TStringLookupValidator( StreamableInit );
+ virtual void write( opstream& os );
+ virtual void* read( ipstream& is );
+
+private:
+ virtual const char *streamableName() const {return name;}
+#endif
+};
+
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TStringLookupValidator& v )
+ { return is >> (TStreamable&)v; }
+inline ipstream& operator >> ( ipstream& is, TStringLookupValidator*& v )
+ { return is >> (void *&)v; }
+
+inline opstream& operator << ( opstream& os, TStringLookupValidator& v )
+ { return os << (TStreamable&)v; }
+inline opstream& operator << ( opstream& os, TStringLookupValidator* v )
+ { return os << (TStreamable *)v; }
+#endif
+
+#endif // defined(Uses_TStringLookupValidator) && !defined(TStringLookupValidator_Included)
+
diff --git a/tvision/include/tv/video.h b/tvision/include/tv/video.h
new file mode 100644
index 0000000..54311aa
--- /dev/null
+++ b/tvision/include/tv/video.h
@@ -0,0 +1,135 @@
+/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+/****************************** VGA REGISTERS *******************************/
+/*
+ * Sequencer port and frequently used register indices
+ */
+#define VGA_SEQUENCER_PORT 0x3c4
+#define VGA_SEQUENCER_DATA 0x3c5
+
+#define VGA_WRT_PLANE_ENB_REG 2
+#define VGA_MEMORY_MODE_REG 4
+
+/*
+ * color plane operations
+ */
+#define VGA_FUNC_SET 0
+#define VGA_FUNC_AND 8
+#define VGA_FUNC_OR 16
+#define VGA_FUNC_XOR 24
+
+/*
+ * Graphics controller port and frequently used registers
+ */
+#define VGA_GR_CTRL_PORT 0x3ce
+#define VGA_GR_CTRL_DATA 0x3cf
+
+#define VGA_SET_RESET_REG 0
+#define VGA_SET_RESET_ENB_REG 1
+#define VGA_COLOR_COMP_REG 2
+#define VGA_ROT_FN_SEL_REG 3
+#define VGA_RD_PLANE_SEL_REG 4
+#define VGA_MODE_REG 5
+#define VGA_MISC_REG 6
+#define VGA_COLOR_DONTC_REG 7
+#define VGA_BIT_MASK_REG 8
+
+/*************************** VESA STRUCTURE *********************************/
+
+/*
+ * The mode information structure (without padding)
+
+ This struct is taken from libgrx (vesa.h)
+ Because I don't want to go into trouble with packing
+ this struct I reserve only one block of memory and use
+ macros for accessing the members */
+
+#define _BYTE(_index) _farpeekb(mode_info_selector,_index)
+#define _WORD(_index) _farpeekw(mode_info_selector,_index)
+
+/*
+typedef struct {
+ short ModeAttributes CLY_Packed; mode attributes
+*/
+#define ModeAttributes _WORD(0)
+/*
+ char WinAAttributes CLY_Packed; Window A attributes
+ char WinBAttributes CLY_Packed; Window B attributes
+*/
+#define WinAAttributes _BYTE(2)
+#define WinBAttributes _BYTE(3)
+/*
+ short WinGranularity CLY_Packed; window granularity
+*/
+#define WinGranularity _WORD(4)
+/*
+ short WinSize CLY_Packed; window size
+*/
+#define WinSize _WORD(6)
+/*
+ short WinASegment CLY_Packed; Window A start segment
+ short WinBSegment CLY_Packed; Window B start segment
+*/
+#define WinASegment _WORD(8)
+#define WinBSegment _WORD(10)
+/*
+ void far (*WinFuncPtr)() CLY_Packed; pointer to window function
+ short BytesPerScanLine CLY_Packed; bytes per scan line
+ ==== extended and optional information ====
+ short XResolution CLY_Packed; horizontal resolution
+ short YResolution CLY_Packed; vertical resolution
+ char XCharSize CLY_Packed; character cell width
+ char YCharSize CLY_Packed; character cell height
+ char NumberOfPlanes CLY_Packed; number of memory planes
+*/
+#define NumberOfPlanes _BYTE(0x18)
+/*
+ char BitsPerPixel CLY_Packed; bits per pixel
+ char NumberOfBanks CLY_Packed; number of banks
+ char MemoryModel CLY_Packed; memory model type
+ char BankSize CLY_Packed; bank size in K
+ char NumImagePages CLY_Packed; number of image pages
+ char reserved[1] CLY_Packed;
+ ==== VESA 1.2 and later ====
+ char RedMaskSize CLY_Packed; number of bits in red mask
+ char RedMaskPos CLY_Packed; starting bit for red mask
+ char GreenMaskSize CLY_Packed;
+ char GreenMaskPos CLY_Packed;
+ char BlueMaskSize CLY_Packed;
+ char BlueMaskPos CLY_Packed;
+ char ReservedMaskSize CLY_Packed; reserved bits in pixel
+ char ReservedMaskPos CLY_Packed;
+ char DirectScreenMode CLY_Packed;
+} VESAmodeInfoBlock;
+*/
+
+/************************** Inline Helpers **********************************/
+__inline__ void
+_farfill_l(unsigned short sel,unsigned long offset,unsigned long count,
+ unsigned long value)
+{
+ __asm__ __volatile__ (
+ "pushw %%es\n"
+ "movw %w0,%%es\n"
+ "cld\n"
+ "rep\n"
+ "stosl\n"
+ "popw %%es"
+ :
+ : "rm" (sel), "a" (value), "D" (offset), "c" (count));
+}
+
+#define RESTORE_VESA_HARD 1
+#define RESTORE_VESA_BIOS 2
+#define RESTORE_VESA_COLORS 4
+#define RESTORE_VESA_SVGA 8
+#define RESTORE_VESA_ALL 0xF
+
+#define RESTORE_VGA_HARD 1
+#define RESTORE_VGA_BIOS 2
+#define RESTORE_VGA_COLORS 4
+#define RESTORE_VGA_ALL 7
+
+
+
+
diff --git a/tvision/include/tv/view.h b/tvision/include/tv/view.h
new file mode 100644
index 0000000..27b7ed7
--- /dev/null
+++ b/tvision/include/tv/view.h
@@ -0,0 +1,212 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if defined( Uses_TView ) && !defined( __TView )
+#define __TView
+
+class TRect;
+struct TEvent;
+class TGroup;
+class TPalette;
+class TCommandSet;
+
+class CLY_EXPORT TView : public TObject
+#if !defined ( NO_STREAM )
+ , public TStreamable
+#endif // NO_STREAM
+{
+
+public:
+
+ friend void genRefs();
+
+ enum phaseType { phFocused, phPreProcess, phPostProcess };
+ enum selectMode{ normalSelect, enterSelect, leaveSelect };
+
+ TView( const TRect& bounds );
+ ~TView();
+
+ virtual void sizeLimits( TPoint& min, TPoint& max );
+ TRect getBounds();
+ TRect getExtent();
+ TRect getClipRect();
+ Boolean mouseInView( TPoint mouse );
+ Boolean containsMouse( TEvent& event );
+
+ void locate( TRect& bounds );
+ virtual void dragView( TEvent& event, uchar mode, // temporary fix
+ TRect& limits, TPoint minSize, TPoint maxSize ); // for Miller's stuff
+ virtual void calcBounds( TRect& bounds, TPoint delta );
+ virtual void changeBounds( const TRect& bounds );
+ void growTo( int x, int y );
+ void moveTo( int x, int y );
+ void setBounds( const TRect& bounds );
+
+ virtual ushort getHelpCtx();
+
+ virtual Boolean valid( ushort command );
+
+ void hide();
+ void show();
+ virtual void draw();
+ void drawView();
+ Boolean exposed();
+ void hideCursor();
+ void drawHide( TView *lastView );
+ void drawShow( TView *lastView );
+ void drawUnderRect( TRect& r, TView *lastView );
+ void drawUnderView( Boolean doShadow, TView *lastView );
+
+ virtual uint32 dataSize();
+ virtual void getData( void *rec );
+ virtual void setData( void *rec );
+
+ void blockCursor();
+ void normalCursor();
+ virtual void resetCursor();
+ void setCursor( int x, int y );
+ void showCursor();
+ void drawCursor();
+
+ void clearEvent( TEvent& event );
+ Boolean eventAvail();
+ virtual void getEvent( TEvent& event );
+ virtual void handleEvent( TEvent& event );
+ virtual void putEvent( TEvent& event );
+ // SET: helper to fill the event and call putEvent
+ void putEvent( ushort what, ushort command, void *infoPtr );
+
+ static Boolean commandEnabled( ushort command );
+ static void disableCommands( TCommandSet& commands );
+ static void enableCommands( TCommandSet& commands );
+ static void disableCommand( ushort command );
+ static void enableCommand( ushort command );
+ static void getCommands( TCommandSet& commands );
+ static void setCommands( TCommandSet& commands );
+
+ virtual void endModal( ushort command );
+ virtual ushort execute();
+
+ ushort getColor( ushort color );
+ virtual TPalette& getPalette() const;
+ uchar mapColor( uchar );
+
+ Boolean getState( ushort aState );
+ void select();
+ virtual void setState( ushort aState, Boolean enable );
+
+ void keyEvent( TEvent& event );
+ Boolean mouseEvent( TEvent& event, ushort mask );
+
+
+ TPoint makeGlobal( TPoint source );
+ TPoint makeLocal( TPoint source );
+
+ TView *nextView();
+ TView *prevView();
+ TView *prev();
+ TView *next;
+
+ void makeFirst();
+ void putInFrontOf( TView *Target );
+ TView *TopView();
+
+ void writeBuf( short x, short y, short w, short h, const void *b );
+ void writeBuf( short x, short y, short w, short h, const TDrawBuffer& b );
+ void writeChar( short x, short y, char c, uchar color, short count );
+ void writeLine( short x, short y, short w, short h, const TDrawBuffer& b );
+ void writeLine( short x, short y, short w, short h, const void *b );
+ void writeStr( short x, short y, const char *str, uchar color );
+
+ TPoint size;
+ ushort options;
+ ushort eventMask;
+ ushort state;
+ TPoint origin;
+ TPoint cursor;
+ uchar growMode;
+ uchar dragMode;
+ ushort helpCtx;
+ static Boolean commandSetChanged;
+ static TCommandSet curCommandSet;
+ TGroup *owner;
+
+ static Boolean showMarkers;
+ static uchar errorAttr;
+
+ virtual void shutDown();
+
+ // SET: These are shared by various TView members.
+ // I moved it to a class because I think is better to enclose them.
+ static uchar specialChars[];
+ static uchar ospecialChars[];
+ // SET: Replacements to avoid moire artifacts
+ static uchar noMoireUnFill;
+ static uchar noMoireFill;
+ static uchar onoMoireFill;
+
+private:
+
+ void moveGrow( TPoint p,
+ TPoint s,
+ TRect& limits,
+ TPoint minSize,
+ TPoint maxSize,
+ uchar mode
+ );
+ void change( uchar, TPoint delta, TPoint& p, TPoint& s, int grow=0 );
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TView( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+protected:
+
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+#endif // NO_STREAM
+};
+
+inline ipstream& operator >> ( ipstream& is, TView& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TView*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TView& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TView* cl )
+ { return os << (TStreamable *)cl; }
+
+inline void TView::writeBuf( short x, short y, short w, short h,
+ const TDrawBuffer& b )
+{
+ writeBuf( x, y, w, h, b.data );
+}
+
+inline void TView::writeLine( short x, short y, short w, short h,
+ const TDrawBuffer& b )
+{
+ writeLine( x, y, w, h, b.data );
+}
+
+#endif // Uses_TView
+
diff --git a/tvision/include/tv/views.h b/tvision/include/tv/views.h
new file mode 100644
index 0000000..7b4cbb5
--- /dev/null
+++ b/tvision/include/tv/views.h
@@ -0,0 +1,269 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#if !defined( __COMMAND_CODES )
+#define __COMMAND_CODES
+
+const ushort
+
+// Standard command codes
+
+ cmValid = 0,
+ cmQuit = 1,
+ cmError = 2,
+ cmMenu = 3,
+ cmClose = 4,
+ cmZoom = 5,
+ cmResize = 6,
+ cmNext = 7,
+ cmPrev = 8,
+ cmHelp = 9,
+
+// TDialog standard commands
+
+ cmOK = 10,
+ cmCancel = 11,
+ cmYes = 12,
+ cmNo = 13,
+ cmDefault = 14,
+
+// TView State masks
+
+ sfVisible = 0x001,
+ sfCursorVis = 0x002,
+ sfCursorIns = 0x004,
+ sfShadow = 0x008,
+ sfActive = 0x010,
+ sfSelected = 0x020,
+ sfFocused = 0x040,
+ sfDragging = 0x080,
+ sfDisabled = 0x100,
+ sfModal = 0x200,
+ sfDefault = 0x400,
+ sfExposed = 0x800,
+
+// TView Option masks
+
+ ofSelectable = 0x001,
+ ofTopSelect = 0x002,
+ ofFirstClick = 0x004,
+ ofFramed = 0x008,
+ ofPreProcess = 0x010,
+ ofPostProcess = 0x020,
+ ofBuffered = 0x040,
+ ofTileable = 0x080,
+ ofCenterX = 0x100,
+ ofCenterY = 0x200,
+ ofCentered = 0x300,
+ // SET: I added it, it means we want the object to send more broadcast
+ // than the original TV did. Currently I plan to do it only for a few
+ // classes and enable it by default, see TCluster as example.
+ ofBeVerbose = 0x400,
+
+// TView GrowMode masks
+
+ gfGrowLoX = 0x01,
+ gfGrowLoY = 0x02,
+ gfGrowHiX = 0x04,
+ gfGrowHiY = 0x08,
+ gfGrowAll = 0x0f,
+ gfGrowRel = 0x10,
+
+// TView DragMode masks
+
+ dmDragMove = 0x01,
+ dmDragGrow = 0x02,
+ dmLimitLoX = 0x10,
+ dmLimitLoY = 0x20,
+ dmLimitHiX = 0x40,
+ dmLimitHiY = 0x80,
+ dmLimitAll = dmLimitLoX | dmLimitLoY | dmLimitHiX | dmLimitHiY,
+
+// TView Help context codes
+
+ hcNoContext = 0,
+ hcDragging = 1,
+
+// TScrollBar part codes
+
+ sbLeftArrow = 0,
+ sbRightArrow = 1,
+ sbPageLeft = 2,
+ sbPageRight = 3,
+ sbUpArrow = 4,
+ sbDownArrow = 5,
+ sbPageUp = 6,
+ sbPageDown = 7,
+ sbIndicator = 8,
+
+// TScrollBar options for TWindow.StandardScrollBar
+
+ sbHorizontal = 0x000,
+ sbVertical = 0x001,
+ sbHandleKeyboard = 0x002,
+
+// TWindow Flags masks
+
+ wfMove = 0x01,
+ wfGrow = 0x02,
+ wfClose = 0x04,
+ wfZoom = 0x08,
+
+// TView inhibit flags
+
+ noMenuBar = 0x0001,
+ noDeskTop = 0x0002,
+ noStatusLine = 0x0004,
+ noBackground = 0x0008,
+ noFrame = 0x0010,
+ noViewer = 0x0020,
+ noHistory = 0x0040,
+
+// TWindow number constants
+
+ wnNoNumber = 0,
+
+// TWindow palette entries
+
+ wpBlueWindow = 0,
+ wpCyanWindow = 1,
+ wpGrayWindow = 2,
+
+// Application command codes
+
+ cmCut = 20,
+ cmCopy = 21,
+ cmPaste = 22,
+ cmUndo = 23,
+ cmClear = 24,
+ cmTile = 25,
+ cmCascade = 26,
+
+// Standard messages
+
+ cmReceivedFocus = 50,
+ cmReleasedFocus = 51,
+ cmCommandSetChanged = 52,
+
+// TScrollBar messages
+
+ cmScrollBarChanged = 53,
+ cmScrollBarClicked = 54,
+
+// TWindow select messages
+
+ cmSelectWindowNum = 55,
+
+// TListViewer messages
+
+ cmListItemSelected = 56,
+
+// SET: This is a broadcast that TWindow sends to TProgram::application
+// to notify the window is closing. In this way the application can keep
+// track of closed windows
+
+ cmClosingWindow = 57,
+
+// SET: Usually the owner doesn't have any information about the state of
+// your TCluster members. I added this to change the situation so you don't
+// need to create a specialized TCluster for it.
+// I think that's how an event/message system should work.
+
+ cmClusterMovedTo = 58,
+ cmClusterPress = 59,
+
+ // From TButton::press()
+ cmRecordHistory = 60,
+
+// SET: Here is a broadcast for TListViewer objects. It sends a broadcast
+// when an item is focused.
+
+ cmListItemFocused = 61,
+
+// SET: Moved here to know they exist
+
+ cmGrabDefault = 62,
+ cmReleaseDefault = 63,
+
+// SET: This is a broadcast sent each time the code page encoding changes.
+// All objects that uses non ASCII symbols should remap them.
+
+ cmUpdateCodePage = 64,
+
+// SET: The user screen it not always available. This command is disabled in
+// this case.
+
+ cmCallShell = 65,
+
+// Event masks
+
+ positionalEvents = evMouse,
+ focusedEvents = evKeyboard | evCommand;
+
+#endif // __COMMAND_CODES
+
+#if defined( Uses_TCommandSet )
+
+#include <tv/cmdset.h>
+
+#endif
+
+#if defined( Uses_TPalette )
+
+#include <tv/palette.h>
+
+#endif
+
+#if defined( Uses_TView )
+
+#include <tv/view.h>
+
+#endif
+
+#if defined( Uses_TFrame )
+
+#include <tv/frame.h>
+
+#endif
+
+#if defined( Uses_TScrollBar )
+
+#include <tv/scrlbar.h>
+
+#endif
+
+#if defined( Uses_TScroller )
+
+#include <tv/scroller.h>
+
+#endif
+
+#if defined( Uses_TListViewer )
+
+#include <tv/lstviewr.h>
+
+#endif
+
+#if defined( Uses_TGroup )
+
+#include <tv/group.h>
+
+#endif
+
+#if defined( Uses_TWindow )
+
+#include <tv/window.h>
+
+#endif
+
+
diff --git a/tvision/include/tv/win32/key.h b/tvision/include/tv/win32/key.h
new file mode 100644
index 0000000..784facc
--- /dev/null
+++ b/tvision/include/tv/win32/key.h
@@ -0,0 +1,64 @@
+/* Win32 screen routines header.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+// This headers needs windows header
+#if defined(TVOS_Win32) && !defined(WIN32KEY_HEADER_INCLUDED)
+#define WIN32KEY_HEADER_INCLUDED
+struct TEvent;
+
+const unsigned eventKeyboardQSize=16;
+
+// A class to encapsulate the globals, all is static!
+class TGKeyWin32 : public TGKey
+{
+public:
+ TGKeyWin32() {};
+
+ // Function replacements
+ //static void Suspend();
+ //static void Resume();
+ static int KbHit();
+ //static void Clear();
+ //static ushort GKey();
+ static unsigned GetShiftState();
+ static void FillTEvent(TEvent &e);
+ //static void SetKbdMapping(int version);
+
+ // Setup the pointers to point our members
+ static void Init();
+ static void DeInit();
+
+protected:
+ // For this driver
+ // Extract the shift state from the event (also used by the mouse class)
+ static void ProcessControlKeyState(INPUT_RECORD *ir);
+ // Translate Win32 shift state values to TV equivalents
+ static ushort transShiftState(DWORD state);
+ // Translate Win32 key events to TV equivalents
+ static int transKeyEvent(KeyDownEvent &dst, KEY_EVENT_RECORD& src);
+ // Add a key to the queue
+ static void putConsoleKeyboardEvent(KeyDownEvent &key);
+ // Remove a key event from the queue
+ static int getConsoleKeyboardEvent(KeyDownEvent &key);
+ // Process a Win32 key event and put it in the queue
+ static void HandleKeyEvent();
+
+ // Last value recieved for the shift modifiers
+ static ushort LastControlKeyState;
+ // Table used to Translate keyboard events
+ static const char KeyTo[256];
+ // Table for ASCII printable values
+ static const char testChars[];
+ // Queue
+ static KeyDownEvent *evKeyboardIn;
+ static KeyDownEvent *evKeyboardOut;
+ static KeyDownEvent evKeyboardQueue[eventKeyboardQSize];
+ static unsigned evKeyboardLength;
+ static CRITICAL_SECTION lockKeyboard;
+
+ friend class THWMouseWin32;
+ friend class TScreenWin32;
+};
+
+#endif // WIN32KEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/win32/mouse.h b/tvision/include/tv/win32/mouse.h
new file mode 100644
index 0000000..a9aebdb
--- /dev/null
+++ b/tvision/include/tv/win32/mouse.h
@@ -0,0 +1,40 @@
+/* Win32 screen routines header.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+// This headers needs windows header
+#if defined(TVOS_Win32) && !defined(WIN32MOUSE_HEADER_INCLUDED)
+#define WIN32MOUSE_HEADER_INCLUDED
+
+const unsigned eventMouseQSize=300;
+
+class THWMouseWin32 : public THWMouse
+{
+public:
+ static void Init();
+ static void DeInit();
+
+ friend class TScreenWin32;
+
+protected:
+ THWMouseWin32() {};
+ virtual ~THWMouseWin32();
+
+ static void GetEvent(MouseEventType &me);
+ static void Resume();
+
+ // For this driver
+ // Put a mouse event in the queue
+ static void putConsoleMouseEvent(MouseEventType &mouse);
+ // Process a mouse event from Windows
+ static void HandleMouseEvent();
+
+ static MouseEventType *evMouseIn;
+ static MouseEventType *evLastMouseIn;
+ static MouseEventType *evMouseOut;
+ static MouseEventType evMouseQueue[eventMouseQSize];
+ static unsigned evMouseLength;
+ static CRITICAL_SECTION lockMouse;
+};
+
+#endif // WIN32MOUSE_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/win32/screen.h b/tvision/include/tv/win32/screen.h
new file mode 100644
index 0000000..7563cd4
--- /dev/null
+++ b/tvision/include/tv/win32/screen.h
@@ -0,0 +1,98 @@
+/* Win32 screen routines header.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+// This headers needs windows header
+#if defined(TVOS_Win32) && !defined(WIN32SCR_HEADER_INCLUDED)
+#define WIN32SCR_HEADER_INCLUDED
+
+// virtual to avoid problems with multiple inheritance
+class TDisplayWin32 : virtual public TDisplay
+{
+protected:
+ TDisplayWin32() {};
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TDisplayWin32();
+ // This sets the pointers of TDisplay to point to this class
+ static void Init();
+
+ // Behaviors to replace TDisplay
+ static void SetCursorPos(unsigned x, unsigned y);
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ static void SetCursorShape(unsigned start, unsigned end);
+ static ushort GetRows();
+ static ushort GetCols();
+ // Not available static void setCrtMode(ushort mode);
+ // Not available static ushort getCrtMode();
+ // Not available static void SetCrtModeExt(char *mode);
+ static int CheckForWindowSize(void);
+ static const char *GetWindowTitle(void);
+ static int SetWindowTitle(const char *name);
+ static void SetCrtMode(ushort);
+ static void SetCrtModeExt(char *);
+ static void Beep();
+
+ // Variables for this driver
+ // Input/output handles
+ static HANDLE hOut,hIn;
+ static HANDLE hStdOut;
+ // Console information
+ static CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo;
+ // Cursor information
+ static CONSOLE_CURSOR_INFO ConsoleCursorInfo;
+ // Lock for the WindowSizeChanged variable
+ static CRITICAL_SECTION lockWindowSizeChanged;
+ // Used to indicate a window size change
+ static int WindowSizeChanged;
+};
+
+// With this order the destructor will be called first for TScreenWin32,
+// TScreen, TDisplayWin32 and finally TDisplay.
+class TScreenWin32 : public TDisplayWin32, public TScreen
+{
+public:
+ TScreenWin32();
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TScreenWin32();
+
+ friend class TGKeyWin32;
+ friend class THWMouseWin32;
+ friend class TDisplayWin32;
+
+protected:
+ static void Resume();
+ static void Suspend();
+ // Default: ushort fixCrtMode( ushort mode )
+ // Default: static void setCrtData();
+ static void clearScreen();
+ static void SetVideoMode(ushort mode);
+ static void SetVideoModeExt(char *mode);
+ // Default: static void getCharacters(unsigned offset,ushort *buf,unsigned count);
+ // Default: static ushort getCharacter(unsigned dst);
+ static void setCharacter(unsigned offset, ushort value);
+ static void setCharacters(unsigned dst, ushort *src, unsigned len);
+ static int System(const char *command, pid_t *pidChild, int in, int out,
+ int err);
+ static int SetCrtModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+ static int SetVideoModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+
+ // Support functions
+ static int InitConsole();
+ static void DoneConsole();
+ static DWORD WINAPI HandleEvents(void* p);
+ static BOOL WINAPI ConsoleEventHandler(DWORD dwCtrlType);
+ static void CheckSizeBuffer(int oldWidth, int oldHeight);
+
+ // Support variables
+ static CONSOLE_SCREEN_BUFFER_INFO info;
+ // Flag to stop the events thread
+ static int ExitEventThread;
+ // Handler for the events thread
+ static HANDLE EventThreadHandle;
+ static DWORD oldConsoleMode, newConsoleMode;
+ static unsigned xCurStart, yCurStart;
+ static unsigned saveScreenWidth, saveScreenHeight;
+};
+
+#endif // WIN32SCR_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/win32/win32clip.h b/tvision/include/tv/win32/win32clip.h
new file mode 100644
index 0000000..da93910
--- /dev/null
+++ b/tvision/include/tv/win32/win32clip.h
@@ -0,0 +1,40 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+
+ Description:
+ Win32 Clipboard routines.
+
+***************************************************************************/
+
+#if defined(TVOS_Win32) && !defined(WIN32CLIP_HEADER_INCLUDED)
+#define WIN32CLIP_HEADER_INCLUDED
+
+class TScreenWin32;
+class TScreenWinNT;
+
+class TVWin32Clipboard
+{
+public:
+ TVWin32Clipboard() {};
+
+protected:
+ // Replacements for the TVOSClipboard class
+ static int copy(int id, const char *buffer, unsigned len);
+ static char *paste(int id, unsigned &length);
+ static void destroy();
+
+ // Members fo this class
+ static void Init();
+ static void getErrorString();
+
+ static const
+ char *win32NameError[];
+
+ friend class TScreenWin32;
+ friend class TScreenWinNT;
+ friend class TScreenWinGr; /* JASC, feb 2006, also compatible */
+};
+
+#endif // WIN32CLIP_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/window.h b/tvision/include/tv/window.h
new file mode 100644
index 0000000..0caad3c
--- /dev/null
+++ b/tvision/include/tv/window.h
@@ -0,0 +1,113 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified for i18n support by Salvador Eduardo Tropea.
+
+ *
+ *
+ */
+
+#if defined( Uses_TWindow ) && !defined( __TWindow )
+#define __TWindow
+
+class TFrame;
+class TRect;
+class TPoint;
+struct TEvent;
+class TFrame;
+class TScrollBar;
+
+class CLY_EXPORT TWindowInit
+{
+
+public:
+
+ TWindowInit( TFrame *(*cFrame)( TRect ) );
+
+protected:
+
+ TFrame *(*createFrame)( TRect );
+
+};
+
+/* ---------------------------------------------------------------------- */
+/* class TWindow */
+/* */
+/* Palette layout */
+/* 1 = Frame passive */
+/* 2 = Frame active */
+/* 3 = Frame icon */
+/* 4 = ScrollBar page area */
+/* 5 = ScrollBar controls */
+/* 6 = Scroller normal text */
+/* 7 = Scroller selected text */
+/* 8 = Reserved */
+/* ---------------------------------------------------------------------- */
+
+class CLY_EXPORT TWindow: public TGroup, public virtual TWindowInit
+{
+
+public:
+
+ TWindow( const TRect& bounds,
+ const char *aTitle,
+ short aNumber
+ );
+ ~TWindow();
+
+ virtual void close();
+ virtual TPalette& getPalette() const;
+ virtual const char *getTitle( short maxSize );
+ virtual void handleEvent( TEvent& event );
+ static TFrame *initFrame( TRect );
+ virtual void setState( ushort aState, Boolean enable );
+ virtual void sizeLimits( TPoint& min, TPoint& max );
+ TScrollBar *standardScrollBar( ushort aOptions );
+ virtual void zoom();
+ virtual void shutDown();
+
+ uchar flags;
+ TRect zoomRect;
+ short number;
+ short palette;
+ TFrame *frame;
+ const char *title;
+ stTVIntl *intlTitle;
+#if !defined( NO_STREAM )
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TWindow( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TWindow& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TWindow*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TWindow& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TWindow* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TWindow
+
diff --git a/tvision/include/tv/wingr/key.h b/tvision/include/tv/wingr/key.h
new file mode 100644
index 0000000..4e90bfc
--- /dev/null
+++ b/tvision/include/tv/wingr/key.h
@@ -0,0 +1,69 @@
+/*
+ * Windows screen routines header.
+ *
+ * Copyright (c) 2002 by Jose Angel Sanchez Caso (JASC)
+ *
+ * Squeleton based in code by Salvador E. Tropea (SET)
+ * Covered by the GPL license.
+ */
+
+#if defined(TVOS_Win32) && !defined(TV_Disable_WinGr_Driver) \
+ && !defined(WINGRKEY_HEADER_INCLUDED)
+#define WINGRKEY_HEADER_INCLUDED
+
+typedef struct
+{ int win;
+ short key;
+} ConvKeyRec;
+
+
+struct TEvent;
+
+struct TGKeyWinGr: virtual public TDisplayWinGr // Access to display attributes
+ , virtual public TGKey // A class to encapsulate the globals, all is static!
+ , virtual public TVCodePage // Trick to access codepage mappings
+{ TGKeyWinGr(): TVCodePage(0,0,0) {}; // Only need access to protected members of TVCodePage
+
+ static void init();
+ static int testEvents( UINT message
+ , WPARAM wParam
+ , LPARAM lParam );
+
+
+// Function replacements
+// static void Suspend();
+// static void Resume();
+// static void Clear();
+// static ushort GKey();
+// static void SetKbdMapping(int version);
+
+
+ static int KbHit ();
+ static unsigned GetShiftState();
+ static void Init (); // Setup the pointers to point our members
+ static void FillTEvent ( TEvent &e );
+
+
+protected: // For this driver
+
+ friend class THWMouseWinGr;
+ friend class TScreenWinGr;
+
+private:
+
+
+// Support variables
+
+ static ushort keyMask;
+ static CodePage * remapKey; // Multilingual keyboard support
+
+// Support methods
+
+ static int setKey( const ConvKeyRec * xlate
+ , int vcode );
+
+
+};
+
+#endif // WINDOWSKEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/wingr/mouse.h b/tvision/include/tv/wingr/mouse.h
new file mode 100644
index 0000000..3706bf3
--- /dev/null
+++ b/tvision/include/tv/wingr/mouse.h
@@ -0,0 +1,51 @@
+/*
+ * Mouse window routines header.
+ *
+ * Copyright (c) 2002 by Jose Angel Sanchez Caso (JASC)
+ * Based in code by Salvador E. Tropea (SET)
+ * Covered by the GPL license.
+ */
+
+#if defined(TVOS_Win32) && !defined(TV_Disable_WinGr_Driver) \
+ && !defined(WINGRMOUSE_HEADER_INCLUDED)
+#define WINGRMOUSE_HEADER_INCLUDED
+
+struct THWMouseWinGr: virtual public TDisplayWinGr // Access to display attributes
+ , THWMouse
+{ static bool pressed;
+ static HCURSOR lastCursor;
+
+
+
+ THWMouseWinGr();
+ static void Init();
+
+ static void GetEvent( MouseEventType &me );
+
+ static int testEvents( UINT message
+ , WPARAM wParam
+ , LPARAM lParam );
+
+ static void init();
+
+
+protected:
+ virtual ~THWMouseWinGr();
+
+private:
+
+// Support variables
+
+/* static unsigned mouseX;
+static unsigned mouseY; */
+
+// Support methods
+
+static int setMouse( LPARAM lParam
+ , int ev );
+
+
+};
+
+#endif // WINDOWSMOUSE_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/wingr/screen.h b/tvision/include/tv/wingr/screen.h
new file mode 100644
index 0000000..524eef5
--- /dev/null
+++ b/tvision/include/tv/wingr/screen.h
@@ -0,0 +1,275 @@
+/*
+ * Windows GUI screen routines header.
+ *
+ * Copyright (c) 2002 by José Angel Sánchez Caso (JASC)
+ * Copyright (c) 2002 by Salvador E. Tropea (SET)
+ *
+ * From SET code fragment win 32 driver.
+ *
+ * Covered by the GPL license.
+ */
+
+#if defined(TVOS_Win32) && !defined(TV_Disable_WinGr_Driver) \
+ && !defined(WINGRSCR_HEADER_INCLUDED)
+#define WINGRSCR_HEADER_INCLUDED
+
+
+#ifdef TV_BIG_ENDIAN /* Intel machines */
+ #define attrChar(a) ((a) >> 0x08)
+ #define attrColor(a) ((a) & 0xFF)
+#else
+ #define attrChar(a) ((a) & 0xFF)
+ #define attrColor(a) ((a) >> 0x08)
+#endif
+
+#ifdef DEBUG
+ #define PRINTDEBUG( w ) \
+ { std::cout \
+ << #w << " --> " << w \
+ << " ( " << __FILE__ << " : " << __LINE__ << " )\n";\
+ std::cout.flush(); }
+#else
+ #define PRINTDEBUG( w )
+#endif
+
+typedef struct
+{ HBITMAP bitmapRaster;
+ HGDIOBJ bitmapObject;
+ HDC bitmapMemo;
+ unsigned w, h;
+} bitmapFontRec;
+
+typedef struct
+{ TDisplay::videoModes mode;
+ ushort wScreen
+ , hScreen
+ , wFont
+ , hFont;
+} VideoModeData;
+
+
+struct TDisplayWinGr : public virtual TDisplay // virtual to avoid problems with multiple inheritance
+{ static unsigned xPos; /* Cursor pos */
+ static unsigned yPos; /* Cursor pos */
+ static unsigned zPos; /* Cursor size */
+ static HDC hdc; /* Context used for drawing */
+ static RECT wGeo; /* Window position and size */
+ static char * className; /* Make the classname into a global variable */
+ static HINSTANCE TvWinInstance;
+
+/*
+ * To store display limits
+ */
+
+ static unsigned dmPelsWidth ;
+ static unsigned dmPelsHeight;
+
+/*
+ * To store font limits
+ */
+
+ static int foWmin;
+ static int foHmin;
+ static int foWmax;
+ static int foHmax;
+
+ static void Init(); /* Sets pointers of TDisplay to point to this class */
+
+ static void lowSetCursor( int x
+ , int y
+ , bool dir );
+
+ static int testEvents( UINT message
+ , WPARAM wParam
+ , LPARAM lParam );
+
+
+protected:
+
+ static bool processEvent( );
+
+ static void testCreate( HWND hw
+ , LPARAM lParam );
+
+
+ TDisplayWinGr() {};
+ virtual ~TDisplayWinGr(); // We will use casts to base classes, destructors must be pointers
+
+
+ // Behaviors to replace TDisplay
+
+ static void SetCursorPos ( unsigned x , unsigned y );
+ static void GetCursorPos ( unsigned &x , unsigned &y );
+ static void GetCursorShape( unsigned &start, unsigned &end);
+ static void SetCursorShape( unsigned start , unsigned end );
+ static ushort GetRows();
+ static ushort GetCols();
+
+ static ushort GetCrtMode();
+ static void SetCrtMode(ushort);
+ static int SetCrtModeRes( unsigned w, unsigned h );
+ static const char *GetWindowTitle(void);
+ static int SetWindowTitle(const char *name);
+ static int CheckForWindowSize( );
+ static void Beep();
+
+
+// Support functions
+
+ static void TestAllFonts( unsigned fW
+ , unsigned fH );
+
+ static int SetFontCrt( bitmapFontRec & fontResource
+ , ushort w, ushort h );
+
+ static int SetFontMode( bitmapFontRec & fr, ushort newMode );
+
+ static int selectFont( bitmapFontRec & fontResource
+ , TScreenFont256 * fontData );
+
+ static int CheckWindowSize( RECT & windowArea );
+ static void winRecalc();
+ static void SetCrtMode( const char * );
+
+// Support variables
+
+ static int sizeChanged; /* Resizing counter */
+ static int forceRedraw; /* Used to force setCharacters to unconditionally draw */
+
+ static TEvent storedEvent; /* Correctly processes message queue */
+
+public:
+ static HWND hwnd;
+
+ static COLORREF colorMap[ 16 ];
+
+ static HCURSOR normCursor;
+ static HCURSOR sizeCursor;
+ static HCURSOR handCursor;
+
+/* static RECT mSize; ( now local ) Windows resizing calculations */
+
+ static char cShapeFr;
+ static char cShapeTo;
+
+/*
+ * 28/1/2006, new bitmap fonts
+ */
+ static bitmapFontRec primary;
+ static bitmapFontRec secondary;
+
+ static uchar shapeFont8x16[];
+ static uchar shapeFont10x20[];
+
+ static TScreenFont256 font8x16;
+ static TScreenFont256 font10x20;
+ static TScreenFont256 * defaultFont;
+
+/*
+ * 28/1/2006, new bitmap fonts
+ */
+
+ static VideoModeData videoModes[];
+
+/*
+ * 10/3/2006, draw 'n' drop support
+ */
+ static char dragDropName[ PATH_MAX ];
+ static int dragDropIdx;
+ static void * dragDropHnd;
+
+
+};
+
+
+
+
+// With this order the destructor will be called first for TScreenWin32,
+// TScreen, TDisplayWin32 and finally TDisplay.
+
+struct TScreenWinGr: public virtual TDisplayWinGr
+ , public TScreen
+{ static int amountOfCells; /* Allocated screen cells */
+ static DWORD style; /* Window style */
+ static DWORD exStyle; /* Window new styles */
+ static long HalfColor;
+ static long FullColor;
+ static long cursorDelay;
+
+
+ TScreenWinGr(); /* We will use casts to base classes, destructors must be pointers */
+
+ static void Init();
+
+ virtual ~TScreenWinGr();
+
+protected:
+
+
+ // Default: ushort fixCrtMode( ushort mode )
+ // Default: static void setCrtData();
+ // Default: static void setVideoModeExt(char *mode);
+ // Default: static void getCharacters(unsigned offset,ushort *buf,unsigned count);
+ // Default: static ushort getCharacter(unsigned dst);
+
+ static int SetDisPaletteColors( int f, int n, TScreenColor * );
+ static int SetVideoModeRes( unsigned w, unsigned h, int fW, int fH );
+ static void setVideoMode(ushort mode);
+ static void Resume();
+ static void Suspend();
+ static void setCharacter( unsigned offset
+ , ushort value ); // JASC, change from uint32. New interace ?
+
+ static void setCharacters( unsigned dst
+ , ushort *src
+ , unsigned len );
+
+ static int System( const char *command
+ , pid_t *pidChild
+ , int in
+ , int out
+ , int err);
+
+ static int SetFont( int changeP, TScreenFont256 *fontP
+ , int changeS, TScreenFont256 *fontS
+ , int fontCP, int appCP );
+
+ static void RestoreFonts();
+
+ static int GetFontGeometry(unsigned &w, unsigned &h);
+ static int GetFontGeometryRange( unsigned &wmin, unsigned &hmin
+ , unsigned &wmax, unsigned &hmax );
+
+ // Support functions
+
+ static void SaveScreen();
+ static void RestoreScreen();
+ static void resizeMemoryBuffer();
+
+public:
+
+ static void writeLine( unsigned x
+ , unsigned y
+ , int w
+ , char * str
+ , uchar color );
+
+
+// Support variables
+
+protected:
+
+};
+
+/*
+ * This function is called by the Windowsfunction DispatchMessage( )
+ */
+
+LRESULT CALLBACK WindowProcedure( HWND hwnd
+ , UINT message
+ , WPARAM wParam
+ , LPARAM lParam );
+
+
+#endif // WINDOWSSCR_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/winnt/key.h b/tvision/include/tv/winnt/key.h
new file mode 100644
index 0000000..c3fcf52
--- /dev/null
+++ b/tvision/include/tv/winnt/key.h
@@ -0,0 +1,39 @@
+/* WinNT screen routines header.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+// This headers needs windows header
+#if defined(TVOS_Win32) && !defined(WINNTKEY_HEADER_INCLUDED)
+#define WINNTKEY_HEADER_INCLUDED
+struct TEvent;
+
+// A class to encapsulate the globals, all is static!
+class TGKeyWinNT : public TGKey
+{
+public:
+ TGKeyWinNT() {};
+
+ // Function replacements
+ //static void Suspend();
+ //static void Resume();
+ static int KbHit();
+ static void Clear();
+ //static ushort GKey();
+ static unsigned GetShiftState();
+ static void FillTEvent(TEvent &e);
+ //static void SetKbdMapping(int version);
+
+ // Setup the pointers to point our members
+ static void Init();
+
+protected:
+ // For this driver
+ static INPUT_RECORD inpRec;
+ static unsigned shiftState;
+ static ushort vk2kk[];
+
+ friend class THWMouseWinNT;
+ friend class TScreenWinNT;
+};
+
+#endif // WINNTKEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/winnt/mouse.h b/tvision/include/tv/winnt/mouse.h
new file mode 100644
index 0000000..58fa772
--- /dev/null
+++ b/tvision/include/tv/winnt/mouse.h
@@ -0,0 +1,27 @@
+/* WinNT screen routines header.
+ Copyright (c) 2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+// This headers needs windows header
+#if defined(TVOS_Win32) && !defined(WINNTMOUSE_HEADER_INCLUDED)
+#define WINNTMOUSE_HEADER_INCLUDED
+
+class THWMouseWinNT : public THWMouse
+{
+public:
+ static void Init();
+
+ friend class TScreenWinNT;
+
+protected:
+ THWMouseWinNT() {};
+ virtual ~THWMouseWinNT();
+
+ static void GetEvent(MouseEventType &me);
+ static void Resume();
+
+ // For this driver
+ static INPUT_RECORD inpRec;
+};
+
+#endif // WINNTMOUSE_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/winnt/screen.h b/tvision/include/tv/winnt/screen.h
new file mode 100644
index 0000000..f47a6e5
--- /dev/null
+++ b/tvision/include/tv/winnt/screen.h
@@ -0,0 +1,120 @@
+/* WinNT screen routines header.
+ Copyright (c) 2002-2005 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+// This headers needs windows header
+#if defined(TVOS_Win32) && !defined(WINNTSCR_HEADER_INCLUDED)
+#define WINNTSCR_HEADER_INCLUDED
+
+// Some windows.h headers defines a macro with this name
+#undef YieldProcessor
+
+#define USE_NEW_BUFFER
+#define hCurrentOut hOut
+
+// virtual to avoid problems with multiple inheritance
+class TDisplayWinNT : virtual public TDisplay
+{
+protected:
+ TDisplayWinNT() {};
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TDisplayWinNT();
+ // This sets the pointers of TDisplay to point to this class
+ static void Init();
+
+ // Behaviors to replace TDisplay
+ static void SetCursorPos(unsigned x, unsigned y);
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ static void SetCursorShape(unsigned start, unsigned end);
+ static ushort GetRows();
+ static ushort GetCols();
+ // Default static void SetCrtMode(ushort mode);
+ // Default static void SetCrtModeExt(char *mode);
+ // Not available static ushort getCrtMode();
+ // Not implemented static int CheckForWindowSize(void);
+ static const char
+ *GetWindowTitle(void);
+ static int SetWindowTitle(const char *name);
+ static void ClearScreen(uchar w, uchar h);
+ static void Beep();
+
+ // Low level routines, doesn't use cached values
+ static void GetCursorPosLow(unsigned &x, unsigned &y);
+ static void GetCursorShapeLow(unsigned &start, unsigned &end);
+ static void SetCursorShapeLow(unsigned start, unsigned end);
+ static void SetCursorPosLow(unsigned x, unsigned y);
+
+ // Variables for this driver
+ // Input/output handles
+ static HANDLE hOut,hIn;
+ #ifdef USE_NEW_BUFFER
+ static HANDLE hStdOut;
+ #endif
+ // Cursor position
+ static unsigned currentCursorX,currentCursorY;
+ // Cursor shape
+ static unsigned curStart, curEnd;
+};
+
+// With this order the destructor will be called first for TScreenWin32,
+// TScreen, TDisplayWinNT and finally TDisplay.
+class TScreenWinNT : public TDisplayWinNT, public TScreen
+{
+public:
+ TScreenWinNT();
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TScreenWinNT();
+
+ static void YieldProcessor(int micros);
+
+ friend class TGKeyWinNT;
+ friend class THWMouseWinNT;
+ friend class TDisplayWinNT;
+
+protected:
+ static void Resume();
+ static void Suspend();
+ // Default: ushort fixCrtMode( ushort mode )
+ // Default: static void setCrtData();
+ // Default: static void clearScreen();
+ // Default: static void setVideoMode(ushort mode);
+ // Default: static void setVideoModeExt(char *mode);
+ static void GetCharacters(unsigned offset,ushort *buf,unsigned count);
+ static ushort GetCharacter(unsigned dst);
+ static void SetCharacter(unsigned offset, ushort value);
+ static void SetCharacters(unsigned dst, ushort *src, unsigned len);
+ static int System(const char *command, pid_t *pidChild, int in, int out,
+ int err);
+ static int SetCrtModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+
+ // Support functions
+ #ifndef USE_NEW_BUFFER
+ static void SaveScreen();
+ static void SaveScreenReleaseMemory();
+ static void RestoreScreen();
+ #endif
+ //static void ScreenUpdate();
+ static BOOL WINAPI ConsoleEventHandler(DWORD dwCtrlType);
+ static void ensureOutBufCapacity(unsigned count);
+ // Initialization done at start
+ static int InitOnce();
+
+ // Support variables
+ // Old console state
+ #ifndef USE_NEW_BUFFER
+ static ushort* saveScreenBuf;
+ static unsigned saveScreenSize;
+ static unsigned saveScreenCursorStart, saveScreenCursorEnd;
+ static unsigned saveScreenCursorX, saveScreenCursorY;
+ #endif
+ static DWORD saveScreenConsoleMode;
+ static unsigned saveScreenWidth, saveScreenHeight;
+ // Buffer used to arrange the data as needed by Win32 API
+ static CHAR* outBuf;
+ static WORD* outBufAttr;
+ static CHAR_INFO* outBufCI;
+ static unsigned outBufCapacity;
+};
+
+#endif // WINNTSCR_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/x11/key.h b/tvision/include/tv/x11/key.h
new file mode 100644
index 0000000..6a88371
--- /dev/null
+++ b/tvision/include/tv/x11/key.h
@@ -0,0 +1,63 @@
+/* X11 keyboard handler routines header.
+ Copyright (c) 2001-2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && defined(HAVE_X11) && !defined(X11KEY_HEADER_INCLUDED)
+#define X11KEY_HEADER_INCLUDED
+struct TEvent;
+
+const unsigned MaxKbLen=7;
+typedef struct
+{
+ unsigned symbol;
+ unsigned key;
+} keyEquiv;
+
+// A class to encapsulate the globals, all is static!
+class TGKeyX11 : public TGKey
+{
+public:
+ TGKeyX11() {};
+
+ // Function replacements
+ //static void Suspend();
+ //static void Resume();
+ static int KbHit();
+ //static void Clear();
+ static ushort GKey();
+ static unsigned GetShiftState();
+ static void FillTEvent(TEvent &e);
+ //static void SetKbdMapping(int version);
+ static int SetCodePage(int id);
+
+ // Setup the pointers to point our members
+ static void Init();
+
+protected:
+ // Specific for this driver
+ static int getKeyEvent(int block);
+ // Search the unicode in the current input CP
+ static unsigned Unicode2CP(uint16 unicode);
+
+ static int lenKb,kbWaiting;
+ static char bufferKb[MaxKbLen+1];
+ static KeySym Key;
+ static unsigned kbFlags;
+ static uchar KeyCodeByKeySym[256];
+ static keyEquiv XEquiv[];
+ static uchar KeyCodeByASCII[96];
+
+ // Values used to fill the event
+ static unsigned Symbol;
+ static unsigned Flags;
+ static uchar Scan;
+
+ // This is used to translate the WM close to a cmQuit event
+ static uchar sendQuit;
+ // Input code page unicodes
+ static stIntCodePairs
+ *inputCP;
+
+ friend class TScreenX11;
+};
+#endif // X11KEY_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/x11/mouse.h b/tvision/include/tv/x11/mouse.h
new file mode 100644
index 0000000..1da347b
--- /dev/null
+++ b/tvision/include/tv/x11/mouse.h
@@ -0,0 +1,27 @@
+/* X11 mouse routines header.
+ Copyright (c) 2001-2002 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && defined(HAVE_X11) && !defined(X11MOUSE_HEADER_INCLUDED)
+#define X11MOUSE_HEADER_INCLUDED
+
+class THWMouseX11 : public THWMouse
+{
+public:
+ static void Init();
+
+protected:
+ THWMouseX11() {};
+ virtual ~THWMouseX11();
+
+ static void GetEvent(MouseEventType &me);
+
+ // For this driver
+ static int getMouseEvent();
+
+ static unsigned mouseButtons;
+ static unsigned mouseX,mouseY;
+ static unsigned buttonTranslate[8];
+};
+
+#endif // X11MOUSE_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/x11/screen.h b/tvision/include/tv/x11/screen.h
new file mode 100644
index 0000000..b32fb45
--- /dev/null
+++ b/tvision/include/tv/x11/screen.h
@@ -0,0 +1,308 @@
+/* X11 screen routines header.
+ Copyright (c) 2001-2007 by Salvador E. Tropea (SET)
+ Covered by the GPL license. */
+// X headers are needed to include it
+#if (defined(TVOS_UNIX) || defined(TVCompf_Cygwin)) && defined(HAVE_X11) && !defined(X11SCR_HEADER_INCLUDED)
+#define X11SCR_HEADER_INCLUDED
+
+class TVX11Clipboard;
+class TVX11UpdateThread;
+class TNSCollection;
+
+// virtual to avoid problems with multiple inheritance
+class TDisplayX11 : virtual public TDisplay
+{
+protected:
+ TDisplayX11() {};
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TDisplayX11();
+ // This sets the pointers of TDisplay to point to this class
+ static void Init();
+
+ // Behaviors to replace TDisplay
+ static void SetCursorPos(unsigned x, unsigned y);
+ static void GetCursorPos(unsigned &x, unsigned &y);
+ static void GetCursorShape(unsigned &start, unsigned &end);
+ static void SetCursorShape(unsigned start, unsigned end);
+ static ushort GetRows();
+ static ushort GetCols();
+ // Not available static void SetCrtMode(ushort mode);
+ // Not available static void SetCrtModeExt(char *mode);
+ // Not available static ushort GetCrtModeExt()
+ static int CheckForWindowSize(void);
+ // Not available static const char *getWindowTitle(void);
+ // Not available static int setWindowTitle(const char *name);
+
+ // Variables for this driver
+ // Cursor position
+ static int cursorX, cursorY;
+ // Cursor position in pixels
+ static int cursorPX, cursorPY;
+ // Size of the font
+ static unsigned fontW,fontWb,fontH,fontSz;
+ // Cursor shape in absolute values (0-fontH)
+ static char cShapeFrom,cShapeTo;
+ // Flag to indicate that the size of the window changed
+ static char windowSizeChanged;
+ // Window size in characters
+ static int maxX, maxY;
+ // Window size before last resize
+ static int newX, newY;
+};
+
+// With this order the destructor will be called first for TScreenX11,
+// TScreen, TDisplayX11 and finally TDisplay.
+class TScreenX11 : public TDisplayX11, public TScreen
+{
+public:
+ TScreenX11();
+ // We will use casts to base classes, destructors must be pointers
+ virtual ~TScreenX11();
+
+ friend class TGKeyX11;
+ friend class THWMouseX11;
+ friend class TDisplayX11;
+ friend class TVX11Clipboard;
+ friend class TVX11UpdateThread;
+
+protected:
+ // Default: void Resume();
+ // Default: void Suspend();
+ // Default: ushort fixCrtMode( ushort mode )
+ // Default: static void setCrtData();
+ static void clearScreen();
+ // Default: static void setVideoMode(ushort mode);
+ // Default: static void setVideoModeExt(char *mode);
+ // Default: static void getCharacters(unsigned offset,ushort *buf,unsigned count);
+ // Default: static ushort getCharacter(unsigned dst);
+ static void setCharacter(unsigned offset, ushort value);
+ static void setCharacters(unsigned dst, ushort *src, unsigned len);
+ static int System(const char *command, pid_t *pidChild, int in, int out, int err);
+ static int setWindowTitle(const char *aName);
+ static const char *getWindowTitle(void);
+ static int SetDisPaletteColors(int from, int number, TScreenColor *colors);
+ static int GetFontGeometry(unsigned &w, unsigned &h);
+ static int GetFontGeometryRange(unsigned &wmin, unsigned &hmin,
+ unsigned &umax, unsigned &hmax);
+ static int SetFont(int changeP, TScreenFont256 *fontP,
+ int changeS, TScreenFont256 *fontS,
+ int fontCP=-1, int appCP=-1);
+ static void RestoreFonts();
+ static int SetCrtModeRes(unsigned w, unsigned h, int fW=-1, int fH=-1);
+ static Boolean ShowBusyState(Boolean state);
+ static void Beep();
+ static appHelperHandler OpenHelperApp(AppHelper kind);
+ static Boolean CloseHelperApp(appHelperHandler id);
+ static Boolean SendFileToHelper(appHelperHandler id, const char *file, void *extra);
+ static const char *GetHelperAppError();
+
+protected:
+ // Blinking cursor emulation
+ static void UnDrawCursor();
+ static void DrawCursor();
+ static void DisableCursor();
+ static void EnableCursor();
+
+ // Events processing
+ // Events loop
+ static void ProcessGenericEvents();
+ // Internal line update
+ static void writeLine(int x, int y, int w, unsigned char *str, unsigned color);
+ // Internal rectangle update
+ static void redrawBuf(int x, int y, unsigned w, unsigned off);
+
+ // Font helpers
+ static void CreateXImageFont(int which, uchar *font, unsigned w, unsigned h);
+ static void DestroyXImageFont(int which);
+ // It creates the XImage used for the cursor.
+ static void AdjustCursorImage();
+ static TScreenFont256 *ChooseClosestFont(unsigned fW, unsigned fH);
+
+ static void FullRedraw();
+ static void DoResize(unsigned w, unsigned h);
+ inline
+ static void drawChar(GC gc, unsigned x, unsigned y, uchar aChar, uchar aAttr);
+ // Creates the mouse cursors
+ static Boolean createCursors();
+
+ // Helper to set the bacground and foreground in one step
+ static void XSetBgFg(uint16 attr);
+ static void XSetBgFgC(uint16 attr);
+
+ // Variables for this driver
+ // Foreground and background colors
+ static int fg,bg;
+ // Cursor state
+ static char cursorEnabled,cursorInScreen;
+ // Packed colors
+ static uchar curAttr;
+ // Buffer for cursor shape
+ static char *cursorData;
+ // Timers for the cursor blinking
+ static struct timeval refCursorTime, curCursorTime;
+ // X display we are connected
+ static Display *disp;
+ // Screen we are on
+ static ulong screen;
+ static Visual *visual;
+ // The parent of all the windows
+ static Window rootWin;
+ // The main window, that's the visible thing where we draw
+ static Window mainWin;
+ // Color map we have
+ static Colormap cMap;
+ // Normal graphics context
+ static GC gc;
+ // Cursor graphics context
+ static GC cursorGC;
+ // Internationalization stuff
+ static XIC xic;
+ static XIM xim;
+ // Needed to catch the windows close
+ static Atom theProtocols;
+ // Our colors mapped to X ones
+ static ulong colorMap[16];
+ // The images that makes our font
+ static XImage *ximgFont[256];
+ static XImage *ximgSecFont[256];
+ // The image for the cursor
+ static XImage *cursorImage;
+ // Hints about our size preferences
+ static XSizeHints *sizeHints;
+ // Window class and resources name
+ static XClassHint *classHint;
+ // Default fonts
+ static TScreenFont256 font8x16;
+ static TScreenFont256 font10x20;
+ static TScreenFont256 *defaultFont;
+ static uchar shapeFont10x20[];
+ static uchar shapeFont8x16[];
+ static uchar primaryFontChanged;
+ // Should we hide the cursor when we lose the focus?
+ static char hideCursorWhenNoFocus;
+ // Avoid resizing to a cells multiple if the WM doesn't follow our hints
+ static char dontResizeToCells;
+ // Busy cursor stuff
+ static Cursor busyCursor, leftPtr;
+ static char busyCursorMap[];
+ static char busyCursorMask[];
+ // Application Helpers stuff
+ static const char *appHelperNameError[];
+ static int appHelperError;
+ static TNSCollection *appHelperHandlers;
+};
+
+// A small class to encapsulate the cliboard, this is too tied to TScreen
+class TVX11Clipboard
+{
+public:
+ TVX11Clipboard() {};
+
+protected:
+ static int copy(int id, const char *buffer, unsigned len);
+ static char *paste(int id, unsigned &len);
+ static void destroy();
+
+ static void Init();
+
+ static char *buffer;
+ static unsigned length;
+ static Atom property;
+ static int waiting;
+ static const
+ char *x11NameError[];
+
+ friend class TScreenX11;
+};
+
+const int x11clipNoSelection=1,
+ x11clipWrongType=2,
+ x11clipNoData=3,
+ x11clipX11Error=4,
+ x11clipAnother=5,
+
+ x11clipErrors=5;
+
+#define aMouseEvent (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | \
+ PointerMotionMask | PointerMotionHintMask |\
+ Button1MotionMask | Button2MotionMask | Button3MotionMask |\
+ Button4MotionMask | Button5MotionMask)
+#define aKeyEvent (KeyPressMask | KeyReleaseMask)
+
+#define charPos 0
+#define attrPos 1
+
+#if !HAVE_LINUX_PTHREAD
+ #define USE_ALARM_FOR_THREAD 1
+#endif
+
+#ifdef USE_ALARM_FOR_THREAD
+// This code uses the high resolution Alarm mechanism to update the screen
+// Is under testing
+
+ #define SEMAPHORE_ON TVX11UpdateThread::SemaphoreOn()
+ #define SEMAPHORE_OFF TVX11UpdateThread::SemaphoreOff()
+ #define IS_SECOND_THREAD_ON TVX11UpdateThread::CheckSecondThread()
+ #define START_UPDATE_THREAD TVX11UpdateThread::StartUpdateThread()
+ #define STOP_UPDATE_THREAD TVX11UpdateThread::StopUpdateThread()
+ #define THREAD_AFTER_FORK TVX11UpdateThread::StopUpdateThread()
+ #define NO_EXEC_IN_THREAD 0
+
+class TVX11UpdateThread
+{
+public:
+ TVX11UpdateThread() {};
+
+ static void SemaphoreOn();
+ static void SemaphoreOff();
+ static int CheckSecondThread();
+ static void StartUpdateThread();
+ static void StopUpdateThread();
+
+protected:
+ static void UpdateThread(int signum);
+ static void microAlarm(unsigned int usec);
+ static int running;
+ static int initialized;
+};
+#elif HAVE_LINUX_PTHREAD
+// Linux implementation of POSIX threads
+ #define SEMAPHORE_ON TVX11UpdateThread::SemaphoreOn()
+ #define SEMAPHORE_OFF TVX11UpdateThread::SemaphoreOff()
+ #define IS_SECOND_THREAD_ON TVX11UpdateThread::CheckSecondThread()
+ #define START_UPDATE_THREAD TVX11UpdateThread::StartUpdateThread()
+ #define STOP_UPDATE_THREAD TVX11UpdateThread::StopUpdateThread()
+ #define THREAD_AFTER_FORK // What can I do?
+ #define NO_EXEC_IN_THREAD 1
+
+class TVX11UpdateThread
+{
+public:
+ TVX11UpdateThread() {};
+
+ static void SemaphoreOn();
+ static void SemaphoreOff();
+ static int CheckSecondThread();
+ static void StartUpdateThread();
+ static void StopUpdateThread();
+
+protected:
+ static void *UpdateThread(void *);
+ static int running;
+ static int initialized;
+ static timeval refWatchDog, nowWatchDog;
+ static int watchDogVal;
+};
+#else
+ #define SEMAPHORE_ON
+ #define SEMAPHORE_OFF
+ #define IS_SECOND_THREAD_ON 0
+ #define START_UPDATE_THREAD
+ #define STOP_UPDATE_THREAD
+ #define NO_EXEC_IN_THREAD 0
+ #define THREAD_AFTER_FORK
+#endif
+// End of Linux implementation of POSIX threads
+
+#endif // X11SCR_HEADER_INCLUDED
+
diff --git a/tvision/include/tv/yes_mss.h b/tvision/include/tv/yes_mss.h
new file mode 100644
index 0000000..fd61366
--- /dev/null
+++ b/tvision/include/tv/yes_mss.h
@@ -0,0 +1,8 @@
+/*
+ Copyright (c) 2001 by Salvador E. Tropea and Laurynas Biveinis
+ Covered by the GPL license.
+ This include re-enable MSS after no_mss.h.
+*/
+#ifdef __MSS_H_REINCLUDE
+#include <mss.h>
+#endif
diff --git a/tvision/intl/Makefile b/tvision/intl/Makefile
new file mode 100644
index 0000000..237e043
--- /dev/null
+++ b/tvision/intl/Makefile
@@ -0,0 +1,41 @@
+ES_FILE=es.mo
+
+LANGUAGES=es ru pl
+LANG_FILES=$(addsuffix .mo,$(LANGUAGES))
+
+all: $(LANG_FILES)
+
+ifeq ($(msgfmt),)
+msgfmt=msgfmt
+endif
+
+ifeq ($(xgettext),)
+xgettext=xgettext
+endif
+
+destmo=tvision$(shell cat ../version.txt).mo
+
+clean:
+ rm -f $(addsuffix .mo,$(LANGUAGES))
+
+%.mo: %.po
+ -$(msgfmt) -o $@ $<
+
+languages: $(addsuffix .mo,$(LANGUAGES))
+
+install: $(LANG_FILES)
+ install -d -m 0755 $(prefix)/share/locale/es/LC_MESSAGES
+ install -m 0644 $(ES_FILE) $(prefix)/share/locale/es/LC_MESSAGES/$(destmo)
+ install -d -m 0755 $(prefix)/share/locale/ru/LC_MESSAGES
+ install -m 0644 ru.mo $(prefix)/share/locale/ru/LC_MESSAGES/$(destmo)
+ install -d -m 0755 $(prefix)/share/locale/pl/LC_MESSAGES
+ install -m 0644 pl.mo $(prefix)/share/locale/pl/LC_MESSAGES/$(destmo)
+
+tvision.po:
+ $(xgettext) --default-domain=dummy --add-comments --keyword=_ \
+ --keyword=__ --directory=$(srcdir) --omit-header \
+ --add-location ../classes/*.cc ../classes/*/*.cc ../*.cc
+ touch dummy.po
+ cp dummy.po $@
+ rm dummy.po
+
diff --git a/tvision/intl/dummy/Makefile b/tvision/intl/dummy/Makefile
new file mode 100644
index 0000000..c32b0a8
--- /dev/null
+++ b/tvision/intl/dummy/Makefile
@@ -0,0 +1,5 @@
+RHIDE_GCC=gcc
+CC=$(RHIDE_GCC)
+
+libtvfintl.a: intldummy.o
+ ar -rv libtvfintl.a intldummy.o
diff --git a/tvision/intl/dummy/intldummy.c b/tvision/intl/dummy/intldummy.c
new file mode 100644
index 0000000..5267194
--- /dev/null
+++ b/tvision/intl/dummy/intldummy.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2001-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ This file provides dummies for the libintl.a library so you can create
+programs without international support even if your Turbo Vision library
+was configured to have it.
+
+***************************************************************************/
+
+char *textdomain(const char *domainname)
+{
+ return (char *)domainname;
+}
+
+char *bindtextdomain(const char *domainname, const char *dirname)
+{
+ return (char *)(domainname ? domainname : dirname);
+}
+
+char *gettext(const char *msgid)
+{
+ return (char *)msgid;
+}
+
+char *dgettext(const char *domain, const char *msgid)
+{
+ return (char *)msgid;
+}
+
+char *gettext__(const char *msgid)
+{
+ return (char *)msgid;
+}
diff --git a/tvision/intl/es.po b/tvision/intl/es.po
new file mode 100644
index 0000000..e554ce1
--- /dev/null
+++ b/tvision/intl/es.po
@@ -0,0 +1,677 @@
+# Este es el archivo de traducción a español.
+# Copyright (C) 2002-2005 Salvador E. Tropea.
+# Salvador E. Tropea <set@ieee.org>, 2002-2005.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: tvision 2.1.0\n"
+"PO-Revision-Date: 2005-08-04 11:11-0300\n"
+"Last-Translator: Salvador E. Tropea <set@ieee.org>\n"
+"Language-Team: Spanish <set@ieee.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../classes/calcdisp.cc:103 ../msgbox.cc:58
+msgid "Error"
+msgstr "Error"
+
+#: ../classes/calculat.cc:40
+msgid "Pocket Calculator"
+msgstr "Calculadora de Bolsillo"
+
+#: ../classes/configfile.cc:45
+msgid "Can't open file"
+msgstr "No se pudo abrir el archivo"
+
+#. -1
+#: ../classes/configfile.cc:46
+msgid "Comment inside section name"
+msgstr "Comentario dentro de una sección"
+
+#. -2
+#: ../classes/configfile.cc:47
+msgid "Unterminated section name"
+msgstr "Nombre de sección sin terminar"
+
+#. -3
+#: ../classes/configfile.cc:48
+msgid "Empty section name"
+msgstr "Nombre de sección vacio"
+
+#. -4
+#: ../classes/configfile.cc:49
+msgid "Syntax error"
+msgstr "Error de sintaxis"
+
+#. -5
+#: ../classes/configfile.cc:50
+msgid "Missing open section {"
+msgstr "Falta el { que abre la sección"
+
+#. -6
+#: ../classes/configfile.cc:51
+msgid "Missing close section }"
+msgstr "Falta el } que cierra la sección"
+
+#. -7
+#: ../classes/configfile.cc:52
+msgid "Missing equal sign"
+msgstr "Falta un igual"
+
+#. -8
+#: ../classes/configfile.cc:53
+msgid "Missing value after equal"
+msgstr "Falta un valor luego del igual"
+
+#. -9
+#: ../classes/configfile.cc:54
+msgid "Unterminated string"
+msgstr "Cadena de caracteres no terminada"
+
+#. -10
+#: ../classes/configfile.cc:55
+msgid "Non branch in base"
+msgstr "Variable en la base, sólo secciones"
+
+#. -11
+#: ../classes/configfile.cc:56
+msgid "Trying to overwrite a value with a section"
+msgstr "Intento de sobreescribir un valor con una sección"
+
+#. -12
+#: ../classes/configfile.cc:57
+msgid "Trying to overwrite a section with a value"
+msgstr "Intento de sobreescribir una sección con un valor"
+
+#: ../classes/opstream.cc:242
+#, c-format
+msgid "type not registered: %s\n"
+msgstr "tipo no registrado: %s\n"
+
+#: ../classes/tchdirdi.cc:43
+msgid "Change Directory"
+msgstr "Cambiar Directorio"
+
+#: ../classes/tchdirdi.cc:49
+msgid "Directory ~n~ame"
+msgstr "~N~ombre del directorio"
+
+#: ../classes/tchdirdi.cc:62
+msgid "Directory ~t~ree"
+msgstr "Arbol direc~t~orios"
+
+#: ../classes/tchdirdi.cc:64 ../classes/tcolordi.cc:99
+#: ../classes/tfiledia.cc:94 ../msgbox.cc:43 ../msgbox.cc:228
+msgid "~O~K"
+msgstr "~O~k"
+
+#: ../classes/tchdirdi.cc:66
+msgid "~C~hdir"
+msgstr "~C~ambiar"
+
+#: ../classes/tchdirdi.cc:68
+msgid "~R~evert"
+msgstr "~R~evertir"
+
+#: ../classes/tchdirdi.cc:70
+msgid "Help"
+msgstr "Ayuda"
+
+#: ../classes/tchdirdi.cc:122 ../classes/tdirlist.cc:512
+msgid "Drives"
+msgstr "Discos"
+
+#: ../classes/tchdirdi.cc:188
+msgid "Invalid directory"
+msgstr "Directorio inválido"
+
+#: ../classes/tcolordi.cc:46
+msgid "Colors"
+msgstr "Colores"
+
+#: ../classes/tcolordi.cc:56
+msgid "~G~roup"
+msgstr "~G~rupo"
+
+#: ../classes/tcolordi.cc:66
+msgid "~I~tem"
+msgstr "O~b~jeto"
+
+#: ../classes/tcolordi.cc:71
+msgid "~F~oreground"
+msgstr "Prim. ~p~lano"
+
+#: ../classes/tcolordi.cc:79
+msgid "~B~ackground"
+msgstr "~F~ondo"
+
+#: ../classes/tcolordi.cc:83
+msgid "Text "
+msgstr "Texto "
+
+#: ../classes/tcolordi.cc:89
+msgid "Color"
+msgstr "Color"
+
+#: ../classes/tcolordi.cc:97
+msgid "~T~ry"
+msgstr "P~r~obar"
+
+#: ../classes/tcolordi.cc:101 ../classes/tfiledia.cc:100
+#: ../classes/tvedit2.cc:73 ../classes/tvedit2.cc:105 ../msgbox.cc:44
+#: ../msgbox.cc:232
+msgid "Cancel"
+msgstr "Cancela"
+
+#: ../classes/teditwin.cc:124
+msgid "Clipboard"
+msgstr "Portapapeles"
+
+#: ../classes/teditwin.cc:125
+msgid "Untitled"
+msgstr "Sin Título"
+
+#: ../classes/tfiledia.cc:81
+msgid "~F~iles"
+msgstr "~A~rchivos"
+
+#: ../classes/tfiledia.cc:93 ../classes/tvedit3.cc:40
+msgid "~O~pen"
+msgstr "~A~brir"
+
+#: ../classes/tfiledia.cc:95
+msgid "~A~dd"
+msgstr "~A~gregar"
+
+#: ../classes/tfiledia.cc:96
+msgid "~S~elect"
+msgstr "~S~eleccionar"
+
+#: ../classes/tfiledia.cc:97
+msgid "~R~eplace"
+msgstr "~R~eemplazar"
+
+#: ../classes/tfiledia.cc:98 ../classes/tvedit3.cc:57
+msgid "~C~lear"
+msgstr "~B~orrar"
+
+#: ../classes/tfiledia.cc:100
+msgid "Done"
+msgstr "Hecho"
+
+#: ../classes/tfiledia.cc:109
+msgid "~H~elp"
+msgstr "A~y~uda"
+
+#: ../classes/tfiledia.cc:246
+msgid "Invalid drive or directory"
+msgstr "Disco o directorio inválido"
+
+#: ../classes/tfiledia.cc:296
+msgid "Invalid file name."
+msgstr "Nombre de archivo inválido"
+
+#: ../classes/tfileinf.cc:38
+msgid "Jan"
+msgstr "Ene"
+
+#: ../classes/tfileinf.cc:38
+msgid "Feb"
+msgstr "Feb"
+
+#: ../classes/tfileinf.cc:38
+msgid "Mar"
+msgstr "Mar"
+
+#: ../classes/tfileinf.cc:38
+msgid "Apr"
+msgstr "Abr"
+
+#: ../classes/tfileinf.cc:38
+msgid "May"
+msgstr "May"
+
+#: ../classes/tfileinf.cc:38
+msgid "Jun"
+msgstr "Jun"
+
+#: ../classes/tfileinf.cc:39
+msgid "Jul"
+msgstr "Jul"
+
+#: ../classes/tfileinf.cc:39
+msgid "Aug"
+msgstr "Ago"
+
+#: ../classes/tfileinf.cc:39
+msgid "Sep"
+msgstr "Sep"
+
+#: ../classes/tfileinf.cc:39
+msgid "Oct"
+msgstr "Oct"
+
+#: ../classes/tfileinf.cc:39
+msgid "Nov"
+msgstr "Nov"
+
+#: ../classes/tfileinf.cc:39
+msgid "Dec"
+msgstr "Dic"
+
+#: ../classes/tfilterv.cc:58
+msgid "Invalid character in input"
+msgstr "Ingresó un caracter inválido"
+
+#: ../classes/tlistvie.cc:169
+msgid "<empty>"
+msgstr "<vacío>"
+
+#: ../classes/tlookupv.cc:56
+msgid "Input is not in list of valid strings"
+msgstr "Este valor no está en la lista de valores válidos"
+
+#: ../classes/tmonosel.cc:32
+msgid "Normal"
+msgstr "Normal"
+
+#: ../classes/tmonosel.cc:33
+msgid "Highlight"
+msgstr "Resaltado"
+
+#: ../classes/tmonosel.cc:34
+msgid "Underline"
+msgstr "Subrayado"
+
+#: ../classes/tmonosel.cc:35
+msgid "Inverse"
+msgstr "Inverso"
+
+#: ../classes/tprogram.cc:314
+msgid "~Alt-X~ Exit"
+msgstr "~Alt-X~ Salir"
+
+#. TPXPictureValidator
+#: ../classes/tpxvalid.cc:22
+#, c-format
+msgid ""
+"Error in picture format.\n"
+" %s"
+msgstr ""
+"Error de formato, patrón:\n"
+" %s"
+
+#: ../classes/trangeva.cc:52
+#, c-format
+msgid "Value not in the range %lu to %lu"
+msgstr "Valor fuera del rango %lu a %lu"
+
+#: ../classes/trangeva.cc:55
+#, c-format
+msgid "Value not in the range %li to %li"
+msgstr "Valor fuera del rango %li a %li"
+
+#: ../classes/tvedit2.cc:55
+msgid "Find"
+msgstr "Buscar"
+
+#: ../classes/tvedit2.cc:62 ../classes/tvedit2.cc:88
+msgid "~T~ext to find"
+msgstr "Texto a ~b~uscar"
+
+#: ../classes/tvedit2.cc:67 ../classes/tvedit2.cc:97
+msgid "~C~ase sensitive"
+msgstr "Mayús~c~ulas y min."
+
+#: ../classes/tvedit2.cc:68 ../classes/tvedit2.cc:98
+msgid "~W~hole words only"
+msgstr "~P~alabras completas"
+
+#: ../classes/tvedit2.cc:71 ../classes/tvedit2.cc:103
+msgid "O~K~"
+msgstr "O~k~"
+
+#: ../classes/tvedit2.cc:81
+msgid "Replace"
+msgstr "Reemplazar"
+
+#: ../classes/tvedit2.cc:93
+msgid "~N~ew text"
+msgstr "~N~uevo texto"
+
+#: ../classes/tvedit2.cc:99
+msgid "~P~rompt on replace"
+msgstr "Pr~e~guntar"
+
+#: ../classes/tvedit2.cc:100
+msgid "~R~eplace all"
+msgstr "~R~eemplazar todo"
+
+#: ../classes/tvedit3.cc:39
+msgid "~F~ile"
+msgstr "~A~rchivo"
+
+#: ../classes/tvedit3.cc:41
+msgid "~N~ew"
+msgstr "~N~uevo"
+
+#: ../classes/tvedit3.cc:42
+msgid "~S~ave"
+msgstr "~G~uardar"
+
+#: ../classes/tvedit3.cc:43
+msgid "S~a~ve as..."
+msgstr "G~u~ardar como ..."
+
+#: ../classes/tvedit3.cc:45
+msgid "~C~hange dir..."
+msgstr "~C~ambiar directorio ..."
+
+#: ../classes/tvedit3.cc:46
+msgid "S~h~ell"
+msgstr "S~h~ell"
+
+#: ../classes/tvedit3.cc:47
+msgid "E~x~it"
+msgstr "~S~alir"
+
+#: ../classes/tvedit3.cc:49
+msgid "~E~dit"
+msgstr "~E~ditar"
+
+#: ../classes/tvedit3.cc:50
+msgid "~U~ndo"
+msgstr "~D~eshacer"
+
+#: ../classes/tvedit3.cc:52
+msgid "Cu~t~"
+msgstr "Cor~t~ar"
+
+#: ../classes/tvedit3.cc:53
+msgid "~C~opy"
+msgstr "~C~opiar"
+
+#: ../classes/tvedit3.cc:54
+msgid "~P~aste"
+msgstr "~P~egar"
+
+#: ../classes/tvedit3.cc:55
+msgid "~S~how clipboard"
+msgstr "~V~er portapapeles"
+
+#: ../classes/tvedit3.cc:59
+msgid "~S~earch"
+msgstr "~B~uscar"
+
+#: ../classes/tvedit3.cc:60
+msgid "~F~ind..."
+msgstr "~B~uscar ..."
+
+#: ../classes/tvedit3.cc:61
+msgid "~R~eplace..."
+msgstr "R~e~emplazar ..."
+
+#: ../classes/tvedit3.cc:62
+msgid "~S~earch again"
+msgstr "~R~epetir búsqueda"
+
+#: ../classes/tvedit3.cc:64
+msgid "~W~indows"
+msgstr "~V~entana"
+
+#: ../classes/tvedit3.cc:65
+msgid "~S~ize/move"
+msgstr "Tamaño/Po~s~ición"
+
+#: ../classes/tvedit3.cc:66
+msgid "~Z~oom"
+msgstr "~Z~oom"
+
+#: ../classes/tvedit3.cc:67
+msgid "~T~ile"
+msgstr "~M~osaico"
+
+#: ../classes/tvedit3.cc:68
+msgid "C~a~scade"
+msgstr "~C~ascada"
+
+#: ../classes/tvedit3.cc:69
+msgid "~N~ext"
+msgstr "P~r~óxima"
+
+#: ../classes/tvedit3.cc:70
+msgid "~P~revious"
+msgstr "~A~nterior"
+
+#: ../classes/tvedit3.cc:71
+msgid "~C~lose"
+msgstr "C~e~rrar"
+
+#. SET: F10 before the others so when the library maintains the
+#. cursor visible this option is pointed and the user have a
+#. hint about what to do.
+#: ../classes/tvedit3.cc:90
+msgid "~F10~ Menu"
+msgstr "~F10~ Menú"
+
+#: ../classes/tvedit3.cc:91
+msgid "~F2~ Save"
+msgstr "~F2~ Grabar"
+
+#: ../classes/tvedit3.cc:92
+msgid "~F3~ Open"
+msgstr "~F3~ Abrir"
+
+#: ../classes/tvedit3.cc:93
+msgid "~Alt+F3~ Close"
+msgstr "~Alt+F3~ Cerrar"
+
+#: ../classes/tvedit3.cc:94
+msgid "~F5~ Zoom"
+msgstr "~F5~ Zoom"
+
+#: ../classes/tvedit3.cc:95
+msgid "~F6~ Next"
+msgstr "~F6~ Próxima"
+
+#: ../classes/tvedit3.cc:103 ../classes/tvedit3.cc:124
+msgid "Not enough memory for this operation."
+msgstr "No hay suficiente memoria para esta operación."
+
+#: ../classes/tvedit3.cc:131
+#, c-format
+msgid "Error reading file %s."
+msgstr "Error al leer el archivo %s."
+
+#: ../classes/tvedit3.cc:138
+#, c-format
+msgid "Error writing file %s."
+msgstr "Error al escribir el archivo %s."
+
+#: ../classes/tvedit3.cc:145
+#, c-format
+msgid "Error creating file %s."
+msgstr "Error al crear el archivo %s."
+
+#: ../classes/tvedit3.cc:152
+#, c-format
+msgid "%s has been modified. Save?"
+msgstr "%s ha sido modificado. ¿Grabo?"
+
+#: ../classes/tvedit3.cc:155
+msgid "Save untitled file?"
+msgstr "¿Grabo el archivo sin título?"
+
+#: ../classes/tvedit3.cc:160
+msgid "Save file as"
+msgstr "Grabar como"
+
+#: ../classes/tvedit3.cc:161 ../fileview.cc:215
+msgid "~N~ame"
+msgstr "~N~ombre"
+
+#: ../classes/tvedit3.cc:172
+msgid "Search string not found."
+msgstr "No se pudo hallar el texto."
+
+#: ../classes/tvedit3.cc:190
+msgid "Replace this occurence?"
+msgstr "¿Reemplazo aquí?"
+
+#: ../classes/dos/dosscr.cc:387
+msgid "Windows not present"
+msgstr "No está Windows o no se puede usar"
+
+#: ../classes/dos/dosscr.cc:388
+msgid "Clipboard in use by other application"
+msgstr "El portapapeles está siendo usado por otra aplicación"
+
+#: ../classes/dos/dosscr.cc:389
+msgid "Clipboard too big for the transfer buffer"
+msgstr "El portapapeles es demasiado grande"
+
+#: ../classes/dos/dosscr.cc:390
+msgid "Not enough memory"
+msgstr "No hay suficiente"
+
+#: ../classes/dos/dosscr.cc:391
+msgid "Windows reports error"
+msgstr "Windows reportó un error"
+
+#: ../classes/linux/linuxkey.cc:96 ../classes/unix/xtermkey.cc:81
+msgid "that's an interactive application, don't redirect stdin"
+msgstr ""
+"esta es una aplicación interactiva, no redireccione la entrada estandar"
+
+#: ../classes/linux/linuxkey.cc:117 ../classes/unix/xtermkey.cc:88
+msgid "failed to get the name of the current terminal used for input"
+msgstr "fallo al obtener el nombre de la terminal usada como entrada"
+
+#: ../classes/linux/linuxkey.cc:123 ../classes/unix/xtermkey.cc:94
+msgid "failed to open the input terminal"
+msgstr "fallo al abrir la terminal de entrada"
+
+#: ../classes/linux/linuxkey.cc:130 ../classes/unix/xtermkey.cc:101
+msgid "can't get input terminal attributes"
+msgstr "no pude obtener los atributos de la terminal de entrada"
+
+#: ../classes/linux/linuxkey.cc:143 ../classes/unix/xtermkey.cc:126
+msgid "can't set input terminal attributes"
+msgstr "no pude modificar los atributos de la terminal de entrada"
+
+#: ../classes/linux/linuxkey.cc:822
+msgid "ioctl VT_SETMODE failed"
+msgstr "la ioctl VT_SETMODE falló"
+
+#: ../classes/linux/linuxscr.cc:688 ../classes/qnxrtp/qnxscr.cc:66
+#: ../classes/unix/unixscr.cc:579 ../classes/unix/xtermscr.cc:99
+msgid ""
+"that's an interactive application, don't redirect stdout. If you want to "
+"collect information redirect stderr like this: program 2> file"
+msgstr ""
+"esta es una aplicación interactiva, no redireccione la salida. Si quiere "
+"colectar información redireccione la salida de error así: programa 2> archivo"
+
+#: ../classes/linux/linuxscr.cc:698
+msgid "failed to get the name of the current terminal used for output"
+msgstr "fallo al obtener el nombre de la terminal usada como salida"
+
+#: ../classes/linux/linuxscr.cc:704
+msgid "failed to open the output terminal"
+msgstr "fallo al abrir la terminal de salida"
+
+#: ../classes/linux/linuxscr.cc:712 ../classes/linux/linuxscr.cc:722
+#: ../classes/unix/xtermscr.cc:107
+msgid "can't get output terminal information"
+msgstr "no pude obtener información de la terminal de salida"
+
+#: ../classes/linux/linuxscr.cc:733 ../classes/unix/xtermscr.cc:117
+msgid "can't configure terminal mode"
+msgstr "no pude configurar el modo de la terminal"
+
+#: ../classes/linux/linuxscr.cc:921 ../classes/linux/linuxscr.cc:929
+#: ../classes/qnxrtp/qnxscr.cc:66 ../classes/unix/unixscr.cc:579
+#: ../classes/unix/xtermscr.cc:147 ../classes/unix/xtermscr.cc:155
+#, c-format
+msgid "Error! %s"
+msgstr "¡Error! %s"
+
+#: ../classes/x11/x11src.cc:2137
+msgid "No available selection"
+msgstr "No hay nada seleccionado"
+
+#: ../classes/x11/x11src.cc:2138
+msgid "Unsupported data type"
+msgstr "Tipo de datos no soportado"
+
+#: ../classes/x11/x11src.cc:2139
+msgid "No data"
+msgstr "No hay datos"
+
+#: ../classes/x11/x11src.cc:2140
+msgid "X11 error"
+msgstr "Error de X11"
+
+#: ../classes/x11/x11src.cc:2141
+msgid "Another application holds the clipboard"
+msgstr "Otra aplicación retiene el portapapeles"
+
+# c-format
+#: ../fileview.cc:149
+#, c-format
+msgid "Could not open '%s' for reading"
+msgstr "No puede abrir '%s' para leerlo"
+
+#: ../fileview.cc:214
+msgid "Save to file"
+msgstr "Grabar"
+
+#: ../msgbox.cc:41
+msgid "~Y~es"
+msgstr "~S~i"
+
+#: ../msgbox.cc:42
+msgid "~N~o"
+msgstr "~N~o"
+
+#: ../msgbox.cc:57
+msgid "Warning"
+msgstr "Atención"
+
+#: ../msgbox.cc:59
+msgid "Information"
+msgstr "Informacíon"
+
+#: ../msgbox.cc:60
+msgid "Confirm"
+msgstr "Confirmar"
+
+#: ../msgbox.cc:94
+msgid "Don't warn you next time"
+msgstr "No avisar la próxima vez"
+
+#~ msgid ""
+#~ "\r\n"
+#~ "Error! that's an interactive application, don't redirect stdout\r\n"
+#~ "If you want to collect information redirect stderr like this:\r\n"
+#~ "\r\n"
+#~ "program 2> file\r\n"
+#~ "\r\n"
+#~ msgstr ""
+#~ "\r\n"
+#~ "¡Error! esta es una aplicación interactiva, no redireccione la salida.\r\n"
+#~ "Si quiere colectar información redireccione la salida de error así:\r\n"
+#~ "\r\n"
+#~ "programa 2> archivo\r\n"
+#~ "\r\n"
+
+#~ msgid "Not enough memory for this operation"
+#~ msgstr "No hay suficiente memoria para esta operación"
+
+#~ msgid "Type EXIT to return..."
+#~ msgstr "Tipee EXIT para volver ..."
+
+#~ msgid "~D~OS shell"
+#~ msgstr "Ir a ~D~OS"
diff --git a/tvision/intl/gnumake.in b/tvision/intl/gnumake.in
new file mode 100644
index 0000000..237e043
--- /dev/null
+++ b/tvision/intl/gnumake.in
@@ -0,0 +1,41 @@
+ES_FILE=es.mo
+
+LANGUAGES=es ru pl
+LANG_FILES=$(addsuffix .mo,$(LANGUAGES))
+
+all: $(LANG_FILES)
+
+ifeq ($(msgfmt),)
+msgfmt=msgfmt
+endif
+
+ifeq ($(xgettext),)
+xgettext=xgettext
+endif
+
+destmo=tvision$(shell cat ../version.txt).mo
+
+clean:
+ rm -f $(addsuffix .mo,$(LANGUAGES))
+
+%.mo: %.po
+ -$(msgfmt) -o $@ $<
+
+languages: $(addsuffix .mo,$(LANGUAGES))
+
+install: $(LANG_FILES)
+ install -d -m 0755 $(prefix)/share/locale/es/LC_MESSAGES
+ install -m 0644 $(ES_FILE) $(prefix)/share/locale/es/LC_MESSAGES/$(destmo)
+ install -d -m 0755 $(prefix)/share/locale/ru/LC_MESSAGES
+ install -m 0644 ru.mo $(prefix)/share/locale/ru/LC_MESSAGES/$(destmo)
+ install -d -m 0755 $(prefix)/share/locale/pl/LC_MESSAGES
+ install -m 0644 pl.mo $(prefix)/share/locale/pl/LC_MESSAGES/$(destmo)
+
+tvision.po:
+ $(xgettext) --default-domain=dummy --add-comments --keyword=_ \
+ --keyword=__ --directory=$(srcdir) --omit-header \
+ --add-location ../classes/*.cc ../classes/*/*.cc ../*.cc
+ touch dummy.po
+ cp dummy.po $@
+ rm dummy.po
+
diff --git a/tvision/intl/pl.po b/tvision/intl/pl.po
new file mode 100644
index 0000000..3f94e27
--- /dev/null
+++ b/tvision/intl/pl.po
@@ -0,0 +1,642 @@
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: tvision 2.1.0\n"
+"PO-Revision-Date: 2005-08-05 11:11-0300\n"
+"Last-Translator: Krzysztof Blacha <krzysztof.blacha@gmail.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../classes/calcdisp.cc:103 ../msgbox.cc:58
+msgid "Error"
+msgstr "B³±d"
+
+#: ../classes/calculat.cc:40
+msgid "Pocket Calculator"
+msgstr "Mini kalkulator"
+
+#: ../classes/configfile.cc:45
+msgid "Can't open file"
+msgstr "Nie mozna otworzyæ pliku"
+
+#. -1
+#: ../classes/configfile.cc:46
+msgid "Comment inside section name"
+msgstr "Komentarz wewn±trz nazwy sekcji"
+
+#. -2
+#: ../classes/configfile.cc:47
+msgid "Unterminated section name"
+msgstr "Niezakoñczona nazwa sekcji"
+
+#. -3
+#: ../classes/configfile.cc:48
+msgid "Empty section name"
+msgstr "Pusta nazwa sekcji"
+
+#. -4
+#: ../classes/configfile.cc:49
+msgid "Syntax error"
+msgstr "B³±d sk³adni"
+
+#. -5
+#: ../classes/configfile.cc:50
+msgid "Missing open section {"
+msgstr "Brak znaku rozpoczynaj±cego sekcjê {"
+
+#. -6
+#: ../classes/configfile.cc:51
+msgid "Missing close section }"
+msgstr "Brak znaku koñcz±cego sekcjê }"
+
+#. -7
+#: ../classes/configfile.cc:52
+msgid "Missing equal sign"
+msgstr "Brak znaku równo¶ci"
+
+#. -8
+#: ../classes/configfile.cc:53
+msgid "Missing value after equal"
+msgstr "Brak warto¶ci za znakiem równo¶ci"
+
+#. -9
+#: ../classes/configfile.cc:54
+msgid "Unterminated string"
+msgstr "Niezakoñczony ³añcuch"
+
+#. -10
+#: ../classes/configfile.cc:55
+msgid "Non branch in base"
+msgstr "Brak ga³êzi w podstawie"
+
+#. -11
+#: ../classes/configfile.cc:56
+msgid "Trying to overwrite a value with a section"
+msgstr "Próba nadpisania warto¶ci, sekcj±"
+
+#. -12
+#: ../classes/configfile.cc:57
+msgid "Trying to overwrite a section with a value"
+msgstr "Próba nadpisania sekcji, warto¶ci±"
+
+#: ../classes/opstream.cc:242
+#, c-format
+msgid "type not registered: %s\n"
+msgstr "nizarejestrowany typ: %s\n"
+
+#: ../classes/tchdirdi.cc:43
+msgid "Change Directory"
+msgstr "Zmieñ folder"
+
+#: ../classes/tchdirdi.cc:49
+msgid "Directory ~n~ame"
+msgstr "~N~azwa folderu"
+
+#: ../classes/tchdirdi.cc:62
+msgid "Directory ~t~ree"
+msgstr "Drzewo ka~t~alogów"
+
+#: ../classes/tchdirdi.cc:64 ../classes/tcolordi.cc:99
+#: ../classes/tfiledia.cc:94 ../msgbox.cc:43 ../msgbox.cc:228
+msgid "~O~K"
+msgstr "~O~K"
+
+#: ../classes/tchdirdi.cc:66
+msgid "~C~hdir"
+msgstr "Z~m~ieñ folder"
+
+#: ../classes/tchdirdi.cc:68
+msgid "~R~evert"
+msgstr "Odw~r~óæ"
+
+#: ../classes/tchdirdi.cc:70
+msgid "Help"
+msgstr "Pomoc"
+
+#: ../classes/tchdirdi.cc:122 ../classes/tdirlist.cc:512
+msgid "Drives"
+msgstr "Napêdy"
+
+#: ../classes/tchdirdi.cc:188
+msgid "Invalid directory"
+msgstr "Nieprawid³owy katalog"
+
+#: ../classes/tcolordi.cc:46
+msgid "Colors"
+msgstr "Kolory"
+
+#: ../classes/tcolordi.cc:56
+msgid "~G~roup"
+msgstr "~G~rupa"
+
+#: ../classes/tcolordi.cc:66
+msgid "~I~tem"
+msgstr "~E~lement"
+
+#: ../classes/tcolordi.cc:71
+msgid "~F~oreground"
+msgstr "~P~ierwszo planowy"
+
+#: ../classes/tcolordi.cc:79
+msgid "~B~ackground"
+msgstr "~T~³o"
+
+#: ../classes/tcolordi.cc:83
+msgid "Text "
+msgstr "Tekst"
+
+#: ../classes/tcolordi.cc:89
+msgid "Color"
+msgstr "Kolor"
+
+#: ../classes/tcolordi.cc:97
+msgid "~T~ry"
+msgstr "~P~róbuj"
+
+#: ../classes/tcolordi.cc:101 ../classes/tfiledia.cc:100
+#: ../classes/tvedit2.cc:73 ../classes/tvedit2.cc:105 ../msgbox.cc:44
+#: ../msgbox.cc:232
+msgid "Cancel"
+msgstr "Anuluj"
+
+#: ../classes/teditwin.cc:124
+msgid "Clipboard"
+msgstr "Schowek"
+
+#: ../classes/teditwin.cc:125
+msgid "Untitled"
+msgstr "Bez nazwy"
+
+#: ../classes/tfiledia.cc:81
+msgid "~F~iles"
+msgstr "~P~liki"
+
+#: ../classes/tfiledia.cc:93 ../classes/tvedit3.cc:40
+msgid "~O~pen"
+msgstr "~O~twórz"
+
+#: ../classes/tfiledia.cc:95
+msgid "~A~dd"
+msgstr "Dod~a~j"
+
+#: ../classes/tfiledia.cc:96
+msgid "~S~elect"
+msgstr "~W~ybierz"
+
+#: ../classes/tfiledia.cc:97
+msgid "~R~eplace"
+msgstr "~Z~ast±p"
+
+#: ../classes/tfiledia.cc:98 ../classes/tvedit3.cc:57
+msgid "~C~lear"
+msgstr "~C~zy¶æ"
+
+#: ../classes/tfiledia.cc:100
+msgid "Done"
+msgstr "Koniec"
+
+#: ../classes/tfiledia.cc:109
+msgid "~H~elp"
+msgstr "~P~omoc"
+
+#: ../classes/tfiledia.cc:246
+msgid "Invalid drive or directory"
+msgstr "Nieprawid³owy napêd lub katalog"
+
+#: ../classes/tfiledia.cc:296
+msgid "Invalid file name."
+msgstr "Nieprawid³owa nazwa pliku."
+
+#: ../classes/tfileinf.cc:38
+msgid "Jan"
+msgstr "Sty"
+
+#: ../classes/tfileinf.cc:38
+msgid "Feb"
+msgstr "Lut"
+
+#: ../classes/tfileinf.cc:38
+msgid "Mar"
+msgstr "Mar"
+
+#: ../classes/tfileinf.cc:38
+msgid "Apr"
+msgstr "Kw"
+
+#: ../classes/tfileinf.cc:38
+msgid "May"
+msgstr "Maj"
+
+#: ../classes/tfileinf.cc:38
+msgid "Jun"
+msgstr "Czw"
+
+#: ../classes/tfileinf.cc:39
+msgid "Jul"
+msgstr "Lip"
+
+#: ../classes/tfileinf.cc:39
+msgid "Aug"
+msgstr "Sie"
+
+#: ../classes/tfileinf.cc:39
+msgid "Sep"
+msgstr "Wrz"
+
+#: ../classes/tfileinf.cc:39
+msgid "Oct"
+msgstr "Paz"
+
+#: ../classes/tfileinf.cc:39
+msgid "Nov"
+msgstr "Lis"
+
+#: ../classes/tfileinf.cc:39
+msgid "Dec"
+msgstr "Gr"
+
+#: ../classes/tfilterv.cc:58
+msgid "Invalid character in input"
+msgstr "Wprowadzono nieprawid³owy znak"
+
+#: ../classes/tlistvie.cc:169
+msgid "<empty>"
+msgstr "<pusto>"
+
+#: ../classes/tmonosel.cc:32
+msgid "Normal"
+msgstr "Normalny"
+
+#: ../classes/tmonosel.cc:33
+msgid "Highlight"
+msgstr "Pod¶wietlony"
+
+#: ../classes/tmonosel.cc:34
+msgid "Underline"
+msgstr "Podkre¶lony"
+
+#: ../classes/tmonosel.cc:35
+msgid "Inverse"
+msgstr "Odwrócony"
+
+#: ../classes/tprogram.cc:314
+msgid "~Alt-X~ Exit"
+msgstr "~Alt-X~ Koniec"
+
+#. TPXPictureValidator
+#: ../classes/tpxvalid.cc:22
+#, c-format
+msgid ""
+"Error in picture format.\n"
+" %s"
+msgstr ""
+"Dane wprowadzone b³êdnie.\n"
+"Format danych: %s"
+
+#: ../classes/trangeva.cc:52
+#, c-format
+msgid "Value not in the range %lu to %lu"
+msgstr "Wprowadzone dane nie s± w zakresie, od %lu do %lu"
+
+#: ../classes/trangeva.cc:55
+#, c-format
+msgid "Value not in the range %li to %li"
+msgstr "Wprowadzone dane nie s± w zakresie, od %li do %li"
+
+#: ../classes/tvedit2.cc:55
+msgid "Find"
+msgstr "Znajd¼"
+
+#: ../classes/tvedit2.cc:62 ../classes/tvedit2.cc:88
+msgid "~T~ext to find"
+msgstr "~T~ekst do odszukania"
+
+#: ../classes/tvedit2.cc:67 ../classes/tvedit2.cc:97
+msgid "~C~ase sensitive"
+msgstr "~U~wzglêdnij wielko¶æ liter"
+
+#: ../classes/tvedit2.cc:68 ../classes/tvedit2.cc:98
+msgid "~W~hole words only"
+msgstr "Tylko ca³e s³o~w~a"
+
+#: ../classes/tvedit2.cc:71 ../classes/tvedit2.cc:103
+msgid "O~K~"
+msgstr "O~K~"
+
+#: ../classes/tvedit2.cc:81
+msgid "Replace"
+msgstr "Zast±p"
+
+#: ../classes/tvedit2.cc:93
+msgid "~N~ew text"
+msgstr "~N~owy tekst"
+
+#: ../classes/tvedit2.cc:99
+msgid "~P~rompt on replace"
+msgstr "~P~ytaj przed zast±pieniem"
+
+#: ../classes/tvedit2.cc:100
+msgid "~R~eplace all"
+msgstr "~Zvast±p wszystkie"
+
+#: ../classes/tvedit3.cc:39
+msgid "~F~ile"
+msgstr "~P~lik"
+
+#: ../classes/tvedit3.cc:41
+msgid "~N~ew"
+msgstr "~N~owy"
+
+#: ../classes/tvedit3.cc:42
+msgid "~S~ave"
+msgstr "Zapi~s~z"
+
+#: ../classes/tvedit3.cc:43
+msgid "S~a~ve as..."
+msgstr "Z~a~pisz jako..."
+
+#: ../classes/tvedit3.cc:45
+msgid "~C~hange dir..."
+msgstr "~Z~mieñ folder..."
+
+#: ../classes/tvedit3.cc:46
+msgid "S~h~ell"
+msgstr "P~o~w³oka"
+
+#: ../classes/tvedit3.cc:47
+msgid "E~x~it"
+msgstr "~K~oniec"
+
+#: ../classes/tvedit3.cc:49
+msgid "~E~dit"
+msgstr "~E~dytuj"
+
+#: ../classes/tvedit3.cc:50
+msgid "~U~ndo"
+msgstr "~C~ofnij"
+
+#: ../classes/tvedit3.cc:52
+msgid "Cu~t~"
+msgstr "~W~ytnij"
+
+#: ../classes/tvedit3.cc:53
+msgid "~C~opy"
+msgstr "~K~opiuj"
+
+#: ../classes/tvedit3.cc:54
+msgid "~P~aste"
+msgstr "Wkle~j~"
+
+#: ../classes/tvedit3.cc:55
+msgid "~S~how clipboard"
+msgstr "Pokaz ~s~chowek"
+
+#: ../classes/tvedit3.cc:59
+msgid "~S~earch"
+msgstr "Wy~s~zukiwanie"
+
+#: ../classes/tvedit3.cc:60
+msgid "~F~ind..."
+msgstr "Z~n~ajdz"
+
+#: ../classes/tvedit3.cc:61
+msgid "~R~eplace..."
+msgstr "~Z~ast±p"
+
+#: ../classes/tvedit3.cc:62
+msgid "~S~earch again"
+msgstr "~S~zukaj ponownie"
+
+#: ../classes/tvedit3.cc:64
+msgid "~W~indows"
+msgstr "~O~kna"
+
+#: ../classes/tvedit3.cc:65
+msgid "~S~ize/move"
+msgstr "Zmieñ rozmiar/prze~s~óñ"
+
+#: ../classes/tvedit3.cc:66
+msgid "~Z~oom"
+msgstr "Maksymili~z~uj"
+
+#: ../classes/tvedit3.cc:67
+msgid "~T~ile"
+msgstr "~J~eden pod drugim"
+
+#: ../classes/tvedit3.cc:68
+msgid "C~a~scade"
+msgstr "J~e~den obok drugiego"
+
+#: ../classes/tvedit3.cc:69
+msgid "~N~ext"
+msgstr "~N~astêpny"
+
+#: ../classes/tvedit3.cc:70
+msgid "~P~revious"
+msgstr "~P~oprzedni"
+
+#: ../classes/tvedit3.cc:71
+msgid "~C~lose"
+msgstr "~Z~amknij"
+
+#. SET: F10 before the others so when the library maintains the
+#. cursor visible this option is pointed and the user have a
+#. hint about what to do.
+#: ../classes/tvedit3.cc:90
+msgid "~F10~ Menu"
+msgstr "~F10~ Menu"
+
+#: ../classes/tvedit3.cc:91
+msgid "~F2~ Save"
+msgstr "~F2~ Save"
+
+#: ../classes/tvedit3.cc:92
+msgid "~F3~ Open"
+msgstr "~F3~ Otwórz"
+
+#: ../classes/tvedit3.cc:93
+msgid "~Alt+F3~ Close"
+msgstr "~Alt-F3~ Zamknij"
+
+#: ../classes/tvedit3.cc:94
+msgid "~F5~ Zoom"
+msgstr "~F5~ Maksymilizuj"
+
+#: ../classes/tvedit3.cc:95
+msgid "~F6~ Next"
+msgstr "~F6~ Nastêpny"
+
+#: ../classes/tvedit3.cc:103 ../classes/tvedit3.cc:124
+msgid "Not enough memory for this operation."
+msgstr "Za ma³o pamiêci aby wykonaæ tê operacjê."
+
+#: ../classes/tvedit3.cc:131
+#, c-format
+msgid "Error reading file %s."
+msgstr "Wyst±pi³ b³±d podczas czytania z pliku %s."
+
+#: ../classes/tvedit3.cc:138
+#, c-format
+msgid "Error writing file %s."
+msgstr "Wyst±pi³ b³±d podczas zapisywanie do pliku %s."
+
+#: ../classes/tvedit3.cc:145
+#, c-format
+msgid "Error creating file %s."
+msgstr "Wyst±pi³ b³±d podczas tworzenia pliku %s."
+
+#: ../classes/tvedit3.cc:152
+#, c-format
+msgid "%s has been modified. Save?"
+msgstr "%s zosta³ zmodyfikowany. Zapisaæ?"
+
+#: ../classes/tvedit3.cc:155
+msgid "Save untitled file?"
+msgstr "zapisaæ plik bez nazwy?"
+
+#: ../classes/tvedit3.cc:160
+msgid "Save file as"
+msgstr "Zapisz plik jako"
+
+#: ../classes/tvedit3.cc:161 ../fileview.cc:215
+msgid "~N~ame"
+msgstr "~N~azwa"
+
+#: ../classes/tvedit3.cc:172
+msgid "Search string not found."
+msgstr "Poszukiwany ³añcuch nie zosta³ odnaleziony"
+
+#: ../classes/tvedit3.cc:190
+msgid "Replace this occurence?"
+msgstr "Zamieniæ to wyst±pienie?"
+
+#: ../classes/dos/dosscr.cc:387
+msgid "Windows not present"
+msgstr "Brak okna"
+
+#: ../classes/dos/dosscr.cc:388
+msgid "Clipboard in use by other application"
+msgstr "Schowek jest w u¿yciu przez inna aplikacjê"
+
+#: ../classes/dos/dosscr.cc:389
+msgid "Clipboard too big for the transfer buffer"
+msgstr "Schowek jest zbyt du¿y dla bufora przenosz±cego"
+
+#: ../classes/dos/dosscr.cc:390
+msgid "Not enough memory"
+msgstr "Zbyt ma³o pamiêci"
+
+#: ../classes/dos/dosscr.cc:391
+msgid "Windows reports error"
+msgstr "Okno zg³asza b³±d"
+
+#: ../classes/linux/linuxkey.cc:96 ../classes/unix/xtermkey.cc:81
+msgid "that's an interactive application, don't redirect stdin"
+msgstr "to interkatywna aplikacja, nie przekierowywuj strumienia stdin"
+
+#: ../classes/linux/linuxkey.cc:117 ../classes/unix/xtermkey.cc:88
+msgid "failed to get the name of the current terminal used for input"
+msgstr "wyst±pi³ b³±d podczas pobierania nazwy aktualnego terminala u¿ywanego jako wej¶cie"
+
+#: ../classes/linux/linuxkey.cc:123 ../classes/unix/xtermkey.cc:94
+msgid "failed to open the input terminal"
+msgstr "wyst±pi³ b³±d podczas otwierania terminala wej¶ciowego"
+
+#: ../classes/linux/linuxkey.cc:130 ../classes/unix/xtermkey.cc:101
+msgid "can't get input terminal attributes"
+msgstr "nie mo¿na pobraæ atrybutów terminala wej¶ciowego"
+
+#: ../classes/linux/linuxkey.cc:143 ../classes/unix/xtermkey.cc:126
+msgid "can't set input terminal attributes"
+msgstr "nie mo¿na usrtawiæ atrybutów terminala wej¶ciowego"
+
+#: ../classes/linux/linuxkey.cc:822
+msgid "ioctl VT_SETMODE failed"
+msgstr "ioctl VT_SETMODE zakoñczone niepowodzeniem"
+
+#: ../classes/linux/linuxscr.cc:688 ../classes/qnxrtp/qnxscr.cc:66
+#: ../classes/unix/unixscr.cc:579 ../classes/unix/xtermscr.cc:99
+msgid ""
+"that's an interactive application, don't redirect stdout. If you want to "
+"collect information redirect stderr like this: program 2> file"
+msgstr ""
+"to interaktywna aplikacja, nie przekierowywuj strumienia stdout. Jesli chcesz "
+"zebraæ informacjê przekieruj strumieñ stderr w ten sposób: program 2> plik"
+
+#: ../classes/linux/linuxscr.cc:698
+msgid "failed to get the name of the current terminal used for output"
+msgstr "wystapi³ b³±d podczas pobierania nazwy aktualnego terminala u¿ywanego jako wyj¶cie"
+
+#: ../classes/linux/linuxscr.cc:704
+msgid "failed to open the output terminal"
+msgstr "wyst±pi³ b³±d podczas otwierania terminala wyj¶ciowego"
+
+#: ../classes/linux/linuxscr.cc:712 ../classes/linux/linuxscr.cc:722
+#: ../classes/unix/xtermscr.cc:107
+msgid "can't get output terminal information"
+msgstr "nie mo¿na pobraæ informacji o terminalu wyj¶ciowym"
+
+#: ../classes/linux/linuxscr.cc:733 ../classes/unix/xtermscr.cc:117
+msgid "can't configure terminal mode"
+msgstr "nie mo¿na skonfigurowaæ trybu terminala"
+
+#: ../classes/linux/linuxscr.cc:921 ../classes/linux/linuxscr.cc:929
+#: ../classes/qnxrtp/qnxscr.cc:66 ../classes/unix/unixscr.cc:579
+#: ../classes/unix/xtermscr.cc:147 ../classes/unix/xtermscr.cc:155
+#, c-format
+msgid "Error! %s"
+msgstr "B³±d! %s"
+
+#: ../classes/x11/x11src.cc:2137
+msgid "No available selection"
+msgstr "Brak wybranego elementu"
+
+#: ../classes/x11/x11src.cc:2138
+msgid "Unsupported data type"
+msgstr "Nieobs³ugiwany format danych"
+
+#: ../classes/x11/x11src.cc:2139
+msgid "No data"
+msgstr "Brak danych"
+
+#: ../classes/x11/x11src.cc:2140
+msgid "X11 error"
+msgstr "B³±d X11"
+
+#: ../classes/x11/x11src.cc:2141
+msgid "Another application holds the clipboard"
+msgstr "Schowek u¿ywany jest przez inn± aplikacjê"
+
+#: ../fileview.cc:149
+#, c-format
+msgid "Could not open '%s' for reading"
+msgstr "Nie mo¿na otworzyæ '%s' do odczytu"
+
+#: ../fileview.cc:214
+msgid "Save to file"
+msgstr "Zapisaæ do pliku"
+
+#: ../msgbox.cc:41
+msgid "~Y~es"
+msgstr "~T~ak"
+
+#: ../msgbox.cc:42
+msgid "~N~o"
+msgstr "~N~ie"
+
+#: ../msgbox.cc:57
+msgid "Warning"
+msgstr "Ostrze¿enie"
+
+#: ../msgbox.cc:59
+msgid "Information"
+msgstr "Informacja"
+
+#: ../msgbox.cc:60
+msgid "Confirm"
+msgstr "Potwierdzenie"
+
+#: ../msgbox.cc:94
+msgid "Don't warn you next time"
+msgstr "Nie ostrzegaj nastêpnym razem"
diff --git a/tvision/intl/ru.po b/tvision/intl/ru.po
new file mode 100644
index 0000000..6ed43eb
--- /dev/null
+++ b/tvision/intl/ru.po
@@ -0,0 +1,657 @@
+msgid ""
+msgstr ""
+"PO-Revision-Date: 2003-08-08 21:47+0200\n"
+"Last-Translator: Roman Valyushenko <smhs@mail.ru>\n"
+"Language-Team: Russian (ÒÕÓÓËÉÊ)\n"
+"Content-Type: text/plain; charset=KOI8-R\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 0.9.6\n"
+
+#: classes/calcdisp.cc:103 msgbox.cc:57
+msgid "Error"
+msgstr "ïÛÉÂËÁ"
+
+#. SET: The display size must be satisfied
+#: classes/calculat.cc:39
+msgid "Pocket Calculator"
+msgstr "ëÁÒÍÁÎÎÙÊ ËÁÌØËÕÌÑÔÏÒ"
+
+#: classes/configfile.cc:45
+msgid "Can't open file"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ"
+
+#. -1
+#: classes/configfile.cc:46
+msgid "Comment inside section name"
+msgstr "ëÏÍÍÅÎÔÁÒÉÊ ×ÎÕÔÒÉ ÉÍÅÎÉ ÓÅËÃÉÉ"
+
+#. -2
+#: classes/configfile.cc:47
+msgid "Unterminated section name"
+msgstr "éÍÑ ÓÅËÃÉÉ ÎÅ ÉÍÅÅÔ ÔÅÒÍÉÎÉÒÕÀÝÅÇÏ ÓÉÍ×ÏÌÁ"
+
+#. -3
+#: classes/configfile.cc:48
+msgid "Empty section name"
+msgstr "ðÕÓÔÏÅ ÉÍÑ ÓÅËÃÉÉ"
+
+#. -4
+#: classes/configfile.cc:49
+msgid "Syntax error"
+msgstr "óÉÎÔÁËÓÉÞÅÓËÁÑ ÏÛÉÂËÁ"
+
+#. -5
+#: classes/configfile.cc:50
+msgid "Missing open section {"
+msgstr "óÅËÃÉÑ ÎÅ ÉÍÅÅÔ ÏÔËÒÙ×ÁÀÝÅÊ ÓËÏÂËÉ { "
+
+#. -6
+#: classes/configfile.cc:51
+msgid "Missing close section }"
+msgstr "óÅËÃÉÑ ÎÅ ÉÍÅÅÔ ÚÁËÒÙ×ÁÀÝÅÊ ÓËÏÂËÉ } "
+
+#. -7
+#: classes/configfile.cc:52
+msgid "Missing equal sign"
+msgstr "îÅÔ ÚÎÁËÁ \"ÒÁ×ÎÏ\""
+
+#. -8
+#: classes/configfile.cc:53
+msgid "Missing value after equal"
+msgstr "îÅÔ ÚÎÁÞÅÎÉÑ ÐÏÓÌÅ ÚÎÁËÁ \"ÒÁ×ÎÏ\""
+
+#. -9
+#: classes/configfile.cc:54
+msgid "Unterminated string"
+msgstr "óÔÒÏËÁ ÎÅ ÉÍÅÅÔ ÔÅÒÍÉÎÉÒÕÀÝÅÇÏ ÓÉÍ×ÏÌÁ"
+
+#. -10
+#: classes/configfile.cc:55
+msgid "Non branch in base"
+msgstr "Non branch in base"
+
+#. -11
+#: classes/configfile.cc:56
+msgid "Trying to overwrite a value with a section"
+msgstr "ðÏÐÙÔËÁ ÐÅÒÅÚÁÐÉÓÁÔØ ÚÎÁÞÅÎÉÅ ÓÅËÃÉÅÊ "
+
+#. -12
+#: classes/configfile.cc:57
+msgid "Trying to overwrite a section with a value"
+msgstr "ðÏÐÙÔËÁ ÐÅÒÅÚÁÐÉÓÁÔØ ÓÅËÃÉÀ ÚÎÁÞÅÎÉÅÍ "
+
+#: classes/dos/dosscr.cc:387
+msgid "Windows not present"
+msgstr "M$ Windows ïó ÎÅ ÏÂÎÁÒÕÖÅÎÁ"
+
+#: classes/dos/dosscr.cc:388
+msgid "Clipboard in use by other application"
+msgstr "âÕÆÅÒ ÉÓÐÏÌØÚÕÅÔÓÑ ÄÒÕÇÉÍ ÐÒÉÌÏÖÅÎÉÅÍ"
+
+#: classes/dos/dosscr.cc:389
+msgid "Clipboard too big for the transfer buffer"
+msgstr "âÕÆÅÒ ÎÅ ÍÏÖÅÔ ÕÍÅÓÔÉÔØ ÄÁÎÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÉÎÆÏÒÍÁÃÉÉ"
+
+#: classes/dos/dosscr.cc:390
+msgid "Not enough memory"
+msgstr "îÅ È×ÁÔÁÅÔ ÐÁÍÑÔÉ "
+
+#: classes/dos/dosscr.cc:391
+msgid "Windows reports error"
+msgstr "Windows ÓÏÏÂÝÁÅÔ ÏÛÉÂËÕ"
+
+#: classes/opstream.cc:242
+#, c-format
+msgid "type not registered: %s\n"
+msgstr "ÔÉÐ ÎÅ ÚÁÒÅÇÉÓÔÒÉÒÏ×ÁÎ: %s\n"
+
+#: classes/tchdirdi.cc:42
+msgid "Change Directory"
+msgstr "óÍÅÎÉÔØ ÄÉÒÅËÔÏÒÉÀ"
+
+#: classes/tchdirdi.cc:51
+msgid "Directory ~n~ame"
+msgstr "~é~ÍÑ ÄÉÒÅËÔÏÒÉÉ"
+
+#: classes/tchdirdi.cc:60
+msgid "Directory ~t~ree"
+msgstr "~ä~ÅÒÅ×Ï ÄÉÒÅËÔÏÒÉÊ"
+
+#: classes/tchdirdi.cc:63 classes/tcolordi.cc:111 classes/tfiledia.cc:100
+#: msgbox.cc:42 msgbox.cc:219
+msgid "~O~K"
+msgstr "~O~K"
+
+#: classes/tchdirdi.cc:65
+msgid "~C~hdir"
+msgstr "~ó~ÍÅÎÉÔØ"
+
+#: classes/tchdirdi.cc:67
+msgid "~R~evert"
+msgstr "~÷~ÏÓÓÔÁÎÏ×ÉÔØ"
+
+#: classes/tchdirdi.cc:69
+msgid "Help"
+msgstr "ðÏÍÏÝØ"
+
+#: classes/tchdirdi.cc:121 classes/tdirlist.cc:392
+msgid "Drives"
+msgstr "äÉÓËÉ"
+
+#: classes/tchdirdi.cc:189
+msgid "Invalid directory"
+msgstr "îÅÄÏÐÕÓÔÉÍÁÑ ÄÉÒÅËÔÏÒÉÑ"
+
+#: classes/tcolordi.cc:45
+msgid "Colors"
+msgstr "ã×ÅÔÁ"
+
+#: classes/tcolordi.cc:58
+msgid "~G~roup"
+msgstr "~ç~ÒÕÐÐÁ"
+
+#: classes/tcolordi.cc:70
+msgid "~I~tem"
+msgstr "~ð~ÕÎËÔ"
+
+#: classes/tcolordi.cc:77
+msgid "~F~oreground"
+msgstr "ã×ÅÔ Ô~Å~ËÓÔÁ"
+
+#: classes/tcolordi.cc:87
+msgid "~B~ackground"
+msgstr "ã×ÅÔ ~Æ~ÏÎÁ"
+
+#: classes/tcolordi.cc:93
+msgid "Text "
+msgstr "ôÅËÓÔ "
+
+#: classes/tcolordi.cc:99
+msgid "Color"
+msgstr "ã×ÅÔ"
+
+#: classes/tcolordi.cc:109
+msgid "~T~ry"
+msgstr "~ô~ÅÓÔ"
+
+#: classes/tcolordi.cc:113 classes/tfiledia.cc:106 classes/tvedit2.cc:72
+#: classes/tvedit2.cc:104 msgbox.cc:43 msgbox.cc:223
+msgid "Cancel"
+msgstr "ïÔÍÅÎÁ"
+
+#: classes/teditwin.cc:124
+msgid "Clipboard"
+msgstr "âÕÆÅÒ ÏÂÍÅÎÁ"
+
+#: classes/teditwin.cc:125
+msgid "Untitled"
+msgstr "âÅÚ ÉÍÅÎÉ"
+
+#: classes/tfiledia.cc:86
+msgid "~F~iles"
+msgstr "~æ~ÁÊÌÙ"
+
+#: classes/tfiledia.cc:99 classes/tvedit3.cc:42
+msgid "~O~pen"
+msgstr "~ï~ÔËÒÙÔØ"
+
+#: classes/tfiledia.cc:101
+msgid "~A~dd"
+msgstr "äÏÂÁ×ÉÔØ"
+
+#: classes/tfiledia.cc:102
+#, fuzzy
+msgid "~S~elect"
+msgstr "~÷~ÏÓÓÔÁÎÏ×ÉÔØ"
+
+#: classes/tfiledia.cc:103
+#, fuzzy
+msgid "~R~eplace"
+msgstr "~ú~ÁÍÅÎÉÔØ"
+
+#: classes/tfiledia.cc:104 classes/tvedit3.cc:59
+msgid "~C~lear"
+msgstr "~ï~ÞÉÓÔÉÔØ"
+
+#: classes/tfiledia.cc:106
+msgid "Done"
+msgstr "óÄÅÌÁÎÏ"
+
+#: classes/tfiledia.cc:115
+msgid "~H~elp"
+msgstr "ðÏÍÏ~Ý~Ø"
+
+#: classes/tfiledia.cc:252
+msgid "Invalid drive or directory"
+msgstr "îÅÄÏÐÕÓÔÉÍÙÊ ÄÉÓË ÉÌÉ ÄÉÒÅËÔÏÒÉÑ"
+
+#: classes/tfiledia.cc:302
+msgid "Invalid file name."
+msgstr "îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ÆÁÊÌÁ."
+
+#: classes/tfileinf.cc:38
+msgid "Jan"
+msgstr "ñÎ×"
+
+#: classes/tfileinf.cc:38
+msgid "Feb"
+msgstr "æÅ×"
+
+#: classes/tfileinf.cc:38
+msgid "Mar"
+msgstr "íÁÒ"
+
+#: classes/tfileinf.cc:38
+msgid "Apr"
+msgstr "áÐÒ"
+
+#: classes/tfileinf.cc:38
+msgid "May"
+msgstr "íÁÊ"
+
+#: classes/tfileinf.cc:38
+msgid "Jun"
+msgstr "éÀÎ"
+
+#: classes/tfileinf.cc:39
+msgid "Jul"
+msgstr "éÀÌ"
+
+#: classes/tfileinf.cc:39
+msgid "Aug"
+msgstr "á×Ç"
+
+#: classes/tfileinf.cc:39
+msgid "Sep"
+msgstr "óÅÎ"
+
+#: classes/tfileinf.cc:39
+msgid "Oct"
+msgstr "ïËÔ"
+
+#: classes/tfileinf.cc:39
+msgid "Nov"
+msgstr "îÏÑ"
+
+#: classes/tfileinf.cc:39
+msgid "Dec"
+msgstr "äÅË"
+
+#: classes/tfilterv.cc:61
+msgid "Invalid character in input"
+msgstr "îÅÄÏÐÕÓÔÉÍÙÊ ÓÉÍ×ÏÌ ÐÒÉ ××ÏÄÅ"
+
+#: classes/tlistvie.cc:168
+msgid "<empty>"
+msgstr "<ÐÕÓÔÏ>"
+
+#: classes/tmonosel.cc:31
+msgid "Normal"
+msgstr "ïÂÙÞÎÙÊ"
+
+#: classes/tmonosel.cc:32
+msgid "Highlight"
+msgstr "ðÏÄÓ×ÅÔËÁ"
+
+#: classes/tmonosel.cc:33
+msgid "Underline"
+msgstr "ðÏÄÞÅÒËÎÕÔØ"
+
+#: classes/tmonosel.cc:34
+msgid "Inverse"
+msgstr "éÎ×ÅÒÓÉÑ"
+
+#: classes/trangeva.cc:51
+#, c-format
+msgid "Value not in the range %lu to %lu"
+msgstr "úÎÁÞÅÎÉÅ ÎÅ ×ÈÏÄÉÔ × ÉÎÔÅÒ×ÁÌ ÏÔ %lu ÄÏ %lu"
+
+#: classes/trangeva.cc:54
+#, c-format
+msgid "Value not in the range %li to %li"
+msgstr "úÎÁÞÅÎÉÅ ÎÅ ×ÈÏÄÉÔ × ÉÎÔÅÒ×ÁÌ ÏÔ %li ÄÏ %li"
+
+#: classes/tvedit2.cc:54
+msgid "Find"
+msgstr "îÁÊÔÉ"
+
+#: classes/tvedit2.cc:61 classes/tvedit2.cc:87
+msgid "~T~ext to find"
+msgstr "~þ~ÔÏ ÉÓËÁÔØ"
+
+#: classes/tvedit2.cc:66 classes/tvedit2.cc:96
+msgid "~C~ase sensitive"
+msgstr "õÞÉÔÙ×ÁÔØ ~Ò~ÅÇÉÓÔÒ"
+
+#: classes/tvedit2.cc:67 classes/tvedit2.cc:97
+msgid "~W~hole words only"
+msgstr "~ã~ÅÌÙÅ ÓÌÏ×Á ÔÏÌØËÏ"
+
+#: classes/tvedit2.cc:70 classes/tvedit2.cc:102
+msgid "O~K~"
+msgstr "O~K~"
+
+#: classes/tvedit2.cc:80
+msgid "Replace"
+msgstr "úÁÍÅÎÉÔØ"
+
+#: classes/tvedit2.cc:92
+msgid "~N~ew text"
+msgstr "~ú~ÁÍÅÎÉÔØ ÎÁ"
+
+#: classes/tvedit2.cc:98
+msgid "~P~rompt on replace"
+msgstr "ðÏ~Ä~Ô×ÅÒÖÄÁÔØ ÚÁÍÅÎÕ"
+
+#: classes/tvedit2.cc:99
+msgid "~R~eplace all"
+msgstr "ú~Á~ÍÅÎÉÔØ ×ÓÅ"
+
+#: classes/tvedit3.cc:41
+msgid "~F~ile"
+msgstr "~æ~ÁÊÌ"
+
+#: classes/tvedit3.cc:43
+msgid "~N~ew"
+msgstr "~î~Ï×ÙÊ"
+
+#: classes/tvedit3.cc:44
+msgid "~S~ave"
+msgstr "~ó~ÏÈÒÁÎÉÔØ"
+
+#: classes/tvedit3.cc:45
+msgid "S~a~ve as..."
+msgstr "óÏÈÒÁÎÉÔØ ~Ë~ÁË..."
+
+#: classes/tvedit3.cc:47
+msgid "~C~hange dir..."
+msgstr "ó~Í~ÅÎÉÔØ ÄÉÒÅËÔÏÒÉÀ..."
+
+#: classes/tvedit3.cc:48
+msgid "S~h~ell"
+msgstr "S~h~ell"
+
+#: classes/tvedit3.cc:49
+msgid "E~x~it"
+msgstr "÷~Ù~ÈÏÄ"
+
+#: classes/tvedit3.cc:51
+msgid "~E~dit"
+msgstr "~ð~ÒÁ×ËÁ"
+
+#: classes/tvedit3.cc:52
+msgid "~U~ndo"
+msgstr "ï~Ô~ÍÅÎÉÔØ ÄÅÊÓÔ×ÉÅ"
+
+#: classes/tvedit3.cc:54
+msgid "Cu~t~"
+msgstr "÷Ù~Ò~ÅÚÁÔØ"
+
+#: classes/tvedit3.cc:55
+msgid "~C~opy"
+msgstr "~ë~ÏÐÉÒÏ×ÁÔØ"
+
+#: classes/tvedit3.cc:56
+msgid "~P~aste"
+msgstr "~÷~ÓÔÁ×ÉÔØ"
+
+#: classes/tvedit3.cc:57
+msgid "~S~how clipboard"
+msgstr "ðÏËÁÚÁÔØ ~Â~ÕÆÅÒ"
+
+#: classes/tvedit3.cc:61
+msgid "~S~earch"
+msgstr "~ð~ÏÉÓË"
+
+#: classes/tvedit3.cc:62
+msgid "~F~ind..."
+msgstr "~î~ÁÊÔÉ"
+
+#: classes/tvedit3.cc:63
+msgid "~R~eplace..."
+msgstr "~ú~ÁÍÅÎÉÔØ"
+
+#: classes/tvedit3.cc:64
+msgid "~S~earch again"
+msgstr "îÁÊ~Ô~É ÓÎÏ×Ï"
+
+#: classes/tvedit3.cc:66
+msgid "~W~indows"
+msgstr "~ï~ËÎÁ"
+
+#: classes/tvedit3.cc:67
+msgid "~S~ize/move"
+msgstr "~é~ÚÍÅÎÉÔØ ÒÁÚÍÅÒ/ÐÏÌÏÖÅÎÉÅ"
+
+#: classes/tvedit3.cc:68
+msgid "~Z~oom"
+msgstr "~ò~ÁÓÐÁÈÎÕÔØ"
+
+#: classes/tvedit3.cc:69
+msgid "~T~ile"
+msgstr "òÁÚÍÅÓÔÉÔØ ~Ð~ÌÉÔËÏÊ"
+
+#: classes/tvedit3.cc:70
+msgid "C~a~scade"
+msgstr "òÁÚÍÅÓÔÉÔØ ~Ë~ÁÓËÁÄÏÍ"
+
+#: classes/tvedit3.cc:71
+msgid "~N~ext"
+msgstr "~ó~ÌÅÄÕÀÝÅÅ"
+
+#: classes/tvedit3.cc:72
+msgid "~P~revious"
+msgstr "~ð~ÒÅÄÙÄÕÝÅÅ"
+
+#: classes/tvedit3.cc:73
+msgid "~C~lose"
+msgstr "~ú~ÁËÒÙÔØ"
+
+#. SET: F10 before the others so when the library maintains the
+#. cursor visible this option is pointed and the user have a
+#. hint about what to do.
+#: classes/tvedit3.cc:92
+msgid "~F10~ Menu"
+msgstr "~F10~ íÅÎÀ"
+
+#: classes/tvedit3.cc:93
+msgid "~F2~ Save"
+msgstr "~F2~ óÏÈÒÁÎÉÔØ"
+
+#: classes/tvedit3.cc:94
+msgid "~F3~ Open"
+msgstr "~F3~ ïÔËÒÙÔØ"
+
+#: classes/tvedit3.cc:95
+msgid "~Alt+F3~ Close"
+msgstr "~Alt+F3~ úÁËÒÙÔØ"
+
+#: classes/tvedit3.cc:96
+msgid "~F5~ Zoom"
+msgstr "~F5~ òÁÓÐÁÈÎÕÔØ"
+
+#: classes/tvedit3.cc:97
+msgid "~F6~ Next"
+msgstr "~F6~ óÌÅÄÕÀÝÅÅ"
+
+#: classes/tvedit3.cc:105 classes/tvedit3.cc:126
+msgid "Not enough memory for this operation."
+msgstr "îÅ È×ÁÔÁÅÔ ÐÁÍÑÔÉ ÄÌÑ ×ÙÐÏÌÎÅÎÉÑ ÄÁÎÎÏÊ ÏÐÅÒÁÃÉÉ."
+
+#: classes/tvedit3.cc:133
+#, c-format
+msgid "Error reading file %s."
+msgstr "ïÛÉÂËÁ ÐÒÉ ÞÔÅÎÉÉ ÆÁÊÌÁ %s."
+
+#: classes/tvedit3.cc:140
+#, c-format
+msgid "Error writing file %s."
+msgstr "ïÛÉÂËÁ ÐÒÉ ÚÁÐÉÓÉ × ÆÁÊÌ %s."
+
+#: classes/tvedit3.cc:147
+#, c-format
+msgid "Error creating file %s."
+msgstr "ïÛÉÂËÁ ÐÒÉ ÓÏÚÄÁÎÉÉ ÆÁÊÌÁ %s."
+
+#: classes/tvedit3.cc:154
+#, c-format
+msgid "%s has been modified. Save?"
+msgstr "%s ÂÙÌ ÉÚÍÅÎÅÎ. óÏÈÒÁÎÉÔØ?"
+
+#: classes/tvedit3.cc:157
+msgid "Save untitled file?"
+msgstr "óÏÈÒÁÎÉÔØ ÆÁÊÌ \"ÂÅÚ ÉÍÅÎÉ\"?"
+
+#: classes/tvedit3.cc:162
+msgid "Save file as"
+msgstr "óÏÈÒÁÎÉÔØ ÆÁÊÌ ËÁË"
+
+#: classes/tvedit3.cc:163 fileview.cc:217
+msgid "~N~ame"
+msgstr "éÍ~Ñ~"
+
+#: classes/tvedit3.cc:174
+msgid "Search string not found."
+msgstr "óÔÒÏËÁ ÎÅ ÎÁÊÄÅÎÁ."
+
+#: classes/tvedit3.cc:192
+msgid "Replace this occurence?"
+msgstr "úÁÍÅÎÉÔØ ÎÁÊÄÅÎÎÕÀ ÓÔÒÏËÕ?"
+
+#: classes/linux/linuxkey.cc:96 classes/unix/xtermkey.cc:81
+msgid "that's an interactive application, don't redirect stdin"
+msgstr "ÜÔÏ ÉÎÔÅÒÁËÔÉ×ÎÏÅ ÐÒÉÌÏÖÅÎÉÅ, ÎÅ ÐÅÒÅÎÁÐÒÁ×ÌÑÊÔÅ ÓÔÁÎÄÁÒÔÎÙÊ ××ÏÄ (stdin)"
+
+#: classes/linux/linuxkey.cc:117 classes/unix/xtermkey.cc:88
+msgid "failed to get the name of the current terminal used for input"
+msgstr "ÎÅ ÕÄÁÌÏÓØ ÐÏÌÕÞÉÔØ ÉÍÑ ÔÅËÕÝÅÇÏ ÔÅÒÍÉÎÁÌÁ, ÉÓÐÏÌØÚÕÅÍÏÇÏ ÄÌÑ ××ÏÄÁ"
+
+#: classes/linux/linuxkey.cc:123 classes/unix/xtermkey.cc:94
+msgid "failed to open the input terminal"
+msgstr "ÎÅ ÕÄÁÌÏÓØ ÏÔËÒÙÔØ ÔÅÒÍÉÎÁÌ ××ÏÄÁ"
+
+#: classes/linux/linuxkey.cc:130 classes/unix/xtermkey.cc:101
+msgid "can't get input terminal attributes"
+msgstr "ÎÅ ÕÄÁÌÏÓØ ÐÏÌÕÞÉÔØ ÁÔÒÉÂÕÔÙ ÔÅÒÍÉÎÁÌÁ ××ÏÄÁ"
+
+#: classes/linux/linuxkey.cc:143 classes/unix/xtermkey.cc:120
+msgid "can't set input terminal attributes"
+msgstr "ÎÅ ÕÄÁÌÏÓØ ÉÚÍÅÎÉÔØ ÁÔÒÉÂÕÔÙ ÔÅÒÍÉÎÁÌÁ ××ÏÄÁ"
+
+#: classes/linux/linuxkey.cc:821
+msgid "ioctl VT_SETMODE failed"
+msgstr "ioctl VT_SETMODE ×ÙÐÏÌÎÉÔØ ÎÅ ÕÄÁÌÏÓØ"
+
+#: classes/linux/linuxscr.cc:590 classes/qnxrtp/qnxscr.cc:66
+#: classes/unix/unixscr.cc:569 classes/unix/xtermscr.cc:100
+#, fuzzy
+msgid ""
+"that's an interactive application, don't redirect stdout. If you want to "
+"collect information redirect stderr like this: program 2> file"
+msgstr ""
+"ÜÔÏ ÉÎÔÅÒÁËÔÉ×ÎÏÅ ÐÒÉÌÏÖÅÎÉÅ, ÎÅ ÐÅÒÅÎÁÐÒÁ×ÌÑÊÔÅ ÓÔÁÎÄÁÒÔÎÙÊ ×Ù×ÏÄ (stdout) "
+"åÓÌÉ ×Ù ÈÏÔÉÔÅ ÓÏÈÒÁÎÉÔØ ÉÎÆÏÒÍÁÃÉÀ, ÐÅÒÅÎÁÐÒÁ×ØÔÅ stderr ×ÏÔ ÔÁË: "
+"program 2> file"
+
+#: classes/linux/linuxscr.cc:600
+#, fuzzy
+msgid "failed to get the name of the current terminal used for output"
+msgstr "ÎÅ ÕÄÁÌÏÓØ ÐÏÌÕÞÉÔØ ÉÍÑ ÔÅËÕÝÅÇÏ ÔÅÒÍÉÎÁÌÁ, ÉÓÐÏÌØÚÕÅÍÏÇÏ ÄÌÑ ××ÏÄÁ"
+
+#: classes/linux/linuxscr.cc:606
+#, fuzzy
+msgid "failed to open the output terminal"
+msgstr "ÎÅ ÕÄÁÌÏÓØ ÏÔËÒÙÔØ ÔÅÒÍÉÎÁÌ ××ÏÄÁ"
+
+#: classes/linux/linuxscr.cc:614 classes/linux/linuxscr.cc:624
+#: classes/unix/xtermscr.cc:108
+msgid "can't get output terminal information"
+msgstr "ÎÅ ÕÄÁÌÏÓØ ÐÏÌÕÞÉÔØ ÉÎÆÏÒÍÁÃÉÀ Ï ÔÅÒÍÉÎÁÌÅ ×Ù×ÏÄÁ"
+
+#: classes/linux/linuxscr.cc:635 classes/unix/xtermscr.cc:118
+msgid "can't configure terminal mode"
+msgstr "ÎÅ ÕÄÁÅÔÓÑ ÎÁÓÔÒÏÉÔØ ÒÅÖÉÍ ÔÅÒÍÉÎÁÌÁ"
+
+#: classes/linux/linuxscr.cc:806 classes/linux/linuxscr.cc:814
+#: classes/qnxrtp/qnxscr.cc:66 classes/unix/unixscr.cc:569
+#: classes/unix/xtermscr.cc:148 classes/unix/xtermscr.cc:156
+#, c-format
+msgid "Error! %s"
+msgstr "ïÛÉÂËÁ! %s"
+
+#: classes/x11/x11src.cc:2037
+msgid "No available selection"
+msgstr "îÉÞÅÇÏ ÎÅ ×ÙÄÅÌÅÎÏ"
+
+#: classes/x11/x11src.cc:2038
+msgid "Unsupported data type"
+msgstr "äÁÎÎÙÊ ÔÉÐ ÄÁÎÎÙÈ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ"
+
+#: classes/x11/x11src.cc:2039
+msgid "No data"
+msgstr "îÅÔ ÄÁÎÎÙÈ"
+
+#: classes/x11/x11src.cc:2040
+msgid "X11 error"
+msgstr "ïÛÉÂËÁ X11"
+
+#: classes/x11/x11src.cc:2041
+msgid "Another application holds the clipboard"
+msgstr "äÒÕÇÏÅ ÐÒÉÌÏÖÅÎÉÅ ÂÌÏËÉÒÕÅÔ ÂÕÆÅÒ ÏÂÍÅÎÁ"
+
+#: fileview.cc:151
+#, c-format
+msgid "Could not open '%s' for reading"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ'%s' ÄÌÑ ÞÔÅÎÉÑ"
+
+#: fileview.cc:216
+msgid "Save to file"
+msgstr "óÏÈÒÁÎÉÔØ × ÆÁÊÌ"
+
+#: msgbox.cc:40
+msgid "~Y~es"
+msgstr "~ä~Á"
+
+#: msgbox.cc:41
+msgid "~N~o"
+msgstr "~î~ÅÔ"
+
+#: msgbox.cc:56
+msgid "Warning"
+msgstr "ðÒÅÄÕÐÒÅÖÄÅÎÉÅ"
+
+#: msgbox.cc:58
+msgid "Information"
+msgstr "éÎÆÏÒÍÁÃÉÑ"
+
+#: msgbox.cc:59
+msgid "Confirm"
+msgstr "ðÏÄÔ×ÅÒÖÄÅÎÉÅ"
+
+#: msgbox.cc:93
+msgid "Don't warn you next time"
+msgstr "îÅ ÐÒÉÄÕÐÒÅÖÄÁÔØ × ÓÌÅÄÕÀÝÉÊ ÒÁÚ"
+
+#: classes/tprogram.cc:308
+msgid "~Alt-X~ Exit"
+msgstr "~Alt-ù~ ÷ÙÈÏÄ"
+
+#~ msgid ""
+#~ "\r\n"
+#~ "Error! that's an interactive application, don't redirect stdout\r\n"
+#~ "If you want to collect information redirect stderr like this:\r\n"
+#~ "\r\n"
+#~ "program 2> file\r\n"
+#~ "\r\n"
+#~ msgstr ""
+#~ "\r\n"
+#~ "ïÛÉÂËÁ! üÔÏ ÉÎÔÅÒÁËÔÉ×ÎÏÅ ÐÒÉÌÏÖÅÎÉÅ, ÎÅ ÐÅÒÅÎÁÐÒÁ×ÌÑÊÔÅ ÓÔÁÎÄÁÒÔÎÙÊ "
+#~ "×Ù×ÏÄ (stdout).\r\n"
+#~ "åÓÌÉ ×Ù ÈÏÔÉÔÅ ÓÏÈÒÁÎÉÔØ ÉÎÆÏÒÍÁÃÉÀ, ÐÅÒÅÎÁÐÒÁ×ØÔÅ stderr ×ÏÔ ÔÁË:\r\n"
+#~ "\r\n"
+#~ "program 2> file\r\n"
+#~ "\r\n"
+
+#~ msgid "Not enough memory for this operation"
+#~ msgstr "îÅ È×ÁÔÁÅÔ ÐÁÍÑÔÉ ÄÌÑ ×ÙÐÏÌÎÅÎÉÑ ÄÁÎÎÏÊ ÏÐÅÒÁÃÉÉ"
+
diff --git a/tvision/intl/tvision.po b/tvision/intl/tvision.po
new file mode 100644
index 0000000..ea1e3b9
--- /dev/null
+++ b/tvision/intl/tvision.po
@@ -0,0 +1,632 @@
+#: ../classes/calcdisp.cc:103 ../msgbox.cc:58
+msgid "Error"
+msgstr ""
+
+#: ../classes/calculat.cc:40
+msgid "Pocket Calculator"
+msgstr ""
+
+#: ../classes/configfile.cc:45
+msgid "Can't open file"
+msgstr ""
+
+#. -1
+#: ../classes/configfile.cc:46
+msgid "Comment inside section name"
+msgstr ""
+
+#. -2
+#: ../classes/configfile.cc:47
+msgid "Unterminated section name"
+msgstr ""
+
+#. -3
+#: ../classes/configfile.cc:48
+msgid "Empty section name"
+msgstr ""
+
+#. -4
+#: ../classes/configfile.cc:49
+msgid "Syntax error"
+msgstr ""
+
+#. -5
+#: ../classes/configfile.cc:50
+msgid "Missing open section {"
+msgstr ""
+
+#. -6
+#: ../classes/configfile.cc:51
+msgid "Missing close section }"
+msgstr ""
+
+#. -7
+#: ../classes/configfile.cc:52
+msgid "Missing equal sign"
+msgstr ""
+
+#. -8
+#: ../classes/configfile.cc:53
+msgid "Missing value after equal"
+msgstr ""
+
+#. -9
+#: ../classes/configfile.cc:54
+msgid "Unterminated string"
+msgstr ""
+
+#. -10
+#: ../classes/configfile.cc:55
+msgid "Non branch in base"
+msgstr ""
+
+#. -11
+#: ../classes/configfile.cc:56
+msgid "Trying to overwrite a value with a section"
+msgstr ""
+
+#. -12
+#: ../classes/configfile.cc:57
+msgid "Trying to overwrite a section with a value"
+msgstr ""
+
+#: ../classes/opstream.cc:242
+#, c-format
+msgid "type not registered: %s\n"
+msgstr ""
+
+#: ../classes/tchdirdi.cc:43
+msgid "Change Directory"
+msgstr ""
+
+#: ../classes/tchdirdi.cc:49
+msgid "Directory ~n~ame"
+msgstr ""
+
+#: ../classes/tchdirdi.cc:62
+msgid "Directory ~t~ree"
+msgstr ""
+
+#: ../classes/tchdirdi.cc:64 ../classes/tcolordi.cc:99
+#: ../classes/tfiledia.cc:94 ../msgbox.cc:43 ../msgbox.cc:228
+msgid "~O~K"
+msgstr ""
+
+#: ../classes/tchdirdi.cc:66
+msgid "~C~hdir"
+msgstr ""
+
+#: ../classes/tchdirdi.cc:68
+msgid "~R~evert"
+msgstr ""
+
+#: ../classes/tchdirdi.cc:70
+msgid "Help"
+msgstr ""
+
+#: ../classes/tchdirdi.cc:122 ../classes/tdirlist.cc:512
+msgid "Drives"
+msgstr ""
+
+#: ../classes/tchdirdi.cc:188
+msgid "Invalid directory"
+msgstr ""
+
+#: ../classes/tcolordi.cc:46
+msgid "Colors"
+msgstr ""
+
+#: ../classes/tcolordi.cc:56
+msgid "~G~roup"
+msgstr ""
+
+#: ../classes/tcolordi.cc:66
+msgid "~I~tem"
+msgstr ""
+
+#: ../classes/tcolordi.cc:71
+msgid "~F~oreground"
+msgstr ""
+
+#: ../classes/tcolordi.cc:79
+msgid "~B~ackground"
+msgstr ""
+
+#: ../classes/tcolordi.cc:83
+msgid "Text "
+msgstr ""
+
+#: ../classes/tcolordi.cc:89
+msgid "Color"
+msgstr ""
+
+#: ../classes/tcolordi.cc:97
+msgid "~T~ry"
+msgstr ""
+
+#: ../classes/tcolordi.cc:101 ../classes/tfiledia.cc:100
+#: ../classes/tvedit2.cc:73 ../classes/tvedit2.cc:105 ../msgbox.cc:44
+#: ../msgbox.cc:232
+msgid "Cancel"
+msgstr ""
+
+#: ../classes/teditwin.cc:124
+msgid "Clipboard"
+msgstr ""
+
+#: ../classes/teditwin.cc:125
+msgid "Untitled"
+msgstr ""
+
+#: ../classes/tfiledia.cc:81
+msgid "~F~iles"
+msgstr ""
+
+#: ../classes/tfiledia.cc:93 ../classes/tvedit3.cc:40
+msgid "~O~pen"
+msgstr ""
+
+#: ../classes/tfiledia.cc:95
+msgid "~A~dd"
+msgstr ""
+
+#: ../classes/tfiledia.cc:96
+msgid "~S~elect"
+msgstr ""
+
+#: ../classes/tfiledia.cc:97
+msgid "~R~eplace"
+msgstr ""
+
+#: ../classes/tfiledia.cc:98 ../classes/tvedit3.cc:57
+msgid "~C~lear"
+msgstr ""
+
+#: ../classes/tfiledia.cc:100
+msgid "Done"
+msgstr ""
+
+#: ../classes/tfiledia.cc:109
+msgid "~H~elp"
+msgstr ""
+
+#: ../classes/tfiledia.cc:246
+msgid "Invalid drive or directory"
+msgstr ""
+
+#: ../classes/tfiledia.cc:296
+msgid "Invalid file name."
+msgstr ""
+
+#: ../classes/tfileinf.cc:38
+msgid "Jan"
+msgstr ""
+
+#: ../classes/tfileinf.cc:38
+msgid "Feb"
+msgstr ""
+
+#: ../classes/tfileinf.cc:38
+msgid "Mar"
+msgstr ""
+
+#: ../classes/tfileinf.cc:38
+msgid "Apr"
+msgstr ""
+
+#: ../classes/tfileinf.cc:38
+msgid "May"
+msgstr ""
+
+#: ../classes/tfileinf.cc:38
+msgid "Jun"
+msgstr ""
+
+#: ../classes/tfileinf.cc:39
+msgid "Jul"
+msgstr ""
+
+#: ../classes/tfileinf.cc:39
+msgid "Aug"
+msgstr ""
+
+#: ../classes/tfileinf.cc:39
+msgid "Sep"
+msgstr ""
+
+#: ../classes/tfileinf.cc:39
+msgid "Oct"
+msgstr ""
+
+#: ../classes/tfileinf.cc:39
+msgid "Nov"
+msgstr ""
+
+#: ../classes/tfileinf.cc:39
+msgid "Dec"
+msgstr ""
+
+#: ../classes/tfilterv.cc:58
+msgid "Invalid character in input"
+msgstr ""
+
+#: ../classes/tlistvie.cc:169
+msgid "<empty>"
+msgstr ""
+
+#: ../classes/tlookupv.cc:56
+msgid "Input is not in list of valid strings"
+msgstr ""
+
+#: ../classes/tmonosel.cc:32
+msgid "Normal"
+msgstr ""
+
+#: ../classes/tmonosel.cc:33
+msgid "Highlight"
+msgstr ""
+
+#: ../classes/tmonosel.cc:34
+msgid "Underline"
+msgstr ""
+
+#: ../classes/tmonosel.cc:35
+msgid "Inverse"
+msgstr ""
+
+#: ../classes/tprogram.cc:314
+msgid "~Alt-X~ Exit"
+msgstr ""
+
+#. TPXPictureValidator
+#: ../classes/tpxvalid.cc:22
+#, c-format
+msgid ""
+"Error in picture format.\n"
+" %s"
+msgstr ""
+
+#: ../classes/trangeva.cc:52
+#, c-format
+msgid "Value not in the range %lu to %lu"
+msgstr ""
+
+#: ../classes/trangeva.cc:55
+#, c-format
+msgid "Value not in the range %li to %li"
+msgstr ""
+
+#: ../classes/tvedit2.cc:55
+msgid "Find"
+msgstr ""
+
+#: ../classes/tvedit2.cc:62 ../classes/tvedit2.cc:88
+msgid "~T~ext to find"
+msgstr ""
+
+#: ../classes/tvedit2.cc:67 ../classes/tvedit2.cc:97
+msgid "~C~ase sensitive"
+msgstr ""
+
+#: ../classes/tvedit2.cc:68 ../classes/tvedit2.cc:98
+msgid "~W~hole words only"
+msgstr ""
+
+#: ../classes/tvedit2.cc:71 ../classes/tvedit2.cc:103
+msgid "O~K~"
+msgstr ""
+
+#: ../classes/tvedit2.cc:81
+msgid "Replace"
+msgstr ""
+
+#: ../classes/tvedit2.cc:93
+msgid "~N~ew text"
+msgstr ""
+
+#: ../classes/tvedit2.cc:99
+msgid "~P~rompt on replace"
+msgstr ""
+
+#: ../classes/tvedit2.cc:100
+msgid "~R~eplace all"
+msgstr ""
+
+#: ../classes/tvedit3.cc:39
+msgid "~F~ile"
+msgstr ""
+
+#: ../classes/tvedit3.cc:41
+msgid "~N~ew"
+msgstr ""
+
+#: ../classes/tvedit3.cc:42
+msgid "~S~ave"
+msgstr ""
+
+#: ../classes/tvedit3.cc:43
+msgid "S~a~ve as..."
+msgstr ""
+
+#: ../classes/tvedit3.cc:45
+msgid "~C~hange dir..."
+msgstr ""
+
+#: ../classes/tvedit3.cc:46
+msgid "S~h~ell"
+msgstr ""
+
+#: ../classes/tvedit3.cc:47
+msgid "E~x~it"
+msgstr ""
+
+#: ../classes/tvedit3.cc:49
+msgid "~E~dit"
+msgstr ""
+
+#: ../classes/tvedit3.cc:50
+msgid "~U~ndo"
+msgstr ""
+
+#: ../classes/tvedit3.cc:52
+msgid "Cu~t~"
+msgstr ""
+
+#: ../classes/tvedit3.cc:53
+msgid "~C~opy"
+msgstr ""
+
+#: ../classes/tvedit3.cc:54
+msgid "~P~aste"
+msgstr ""
+
+#: ../classes/tvedit3.cc:55
+msgid "~S~how clipboard"
+msgstr ""
+
+#: ../classes/tvedit3.cc:59
+msgid "~S~earch"
+msgstr ""
+
+#: ../classes/tvedit3.cc:60
+msgid "~F~ind..."
+msgstr ""
+
+#: ../classes/tvedit3.cc:61
+msgid "~R~eplace..."
+msgstr ""
+
+#: ../classes/tvedit3.cc:62
+msgid "~S~earch again"
+msgstr ""
+
+#: ../classes/tvedit3.cc:64
+msgid "~W~indows"
+msgstr ""
+
+#: ../classes/tvedit3.cc:65
+msgid "~S~ize/move"
+msgstr ""
+
+#: ../classes/tvedit3.cc:66
+msgid "~Z~oom"
+msgstr ""
+
+#: ../classes/tvedit3.cc:67
+msgid "~T~ile"
+msgstr ""
+
+#: ../classes/tvedit3.cc:68
+msgid "C~a~scade"
+msgstr ""
+
+#: ../classes/tvedit3.cc:69
+msgid "~N~ext"
+msgstr ""
+
+#: ../classes/tvedit3.cc:70
+msgid "~P~revious"
+msgstr ""
+
+#: ../classes/tvedit3.cc:71
+msgid "~C~lose"
+msgstr ""
+
+#. SET: F10 before the others so when the library maintains the
+#. cursor visible this option is pointed and the user have a
+#. hint about what to do.
+#: ../classes/tvedit3.cc:90
+msgid "~F10~ Menu"
+msgstr ""
+
+#: ../classes/tvedit3.cc:91
+msgid "~F2~ Save"
+msgstr ""
+
+#: ../classes/tvedit3.cc:92
+msgid "~F3~ Open"
+msgstr ""
+
+#: ../classes/tvedit3.cc:93
+msgid "~Alt+F3~ Close"
+msgstr ""
+
+#: ../classes/tvedit3.cc:94
+msgid "~F5~ Zoom"
+msgstr ""
+
+#: ../classes/tvedit3.cc:95
+msgid "~F6~ Next"
+msgstr ""
+
+#: ../classes/tvedit3.cc:103 ../classes/tvedit3.cc:124
+msgid "Not enough memory for this operation."
+msgstr ""
+
+#: ../classes/tvedit3.cc:131
+#, c-format
+msgid "Error reading file %s."
+msgstr ""
+
+#: ../classes/tvedit3.cc:138
+#, c-format
+msgid "Error writing file %s."
+msgstr ""
+
+#: ../classes/tvedit3.cc:145
+#, c-format
+msgid "Error creating file %s."
+msgstr ""
+
+#: ../classes/tvedit3.cc:152
+#, c-format
+msgid "%s has been modified. Save?"
+msgstr ""
+
+#: ../classes/tvedit3.cc:155
+msgid "Save untitled file?"
+msgstr ""
+
+#: ../classes/tvedit3.cc:160
+msgid "Save file as"
+msgstr ""
+
+#: ../classes/tvedit3.cc:161 ../fileview.cc:215
+msgid "~N~ame"
+msgstr ""
+
+#: ../classes/tvedit3.cc:172
+msgid "Search string not found."
+msgstr ""
+
+#: ../classes/tvedit3.cc:190
+msgid "Replace this occurence?"
+msgstr ""
+
+#: ../classes/dos/dosscr.cc:387
+msgid "Windows not present"
+msgstr ""
+
+#: ../classes/dos/dosscr.cc:388
+msgid "Clipboard in use by other application"
+msgstr ""
+
+#: ../classes/dos/dosscr.cc:389
+msgid "Clipboard too big for the transfer buffer"
+msgstr ""
+
+#: ../classes/dos/dosscr.cc:390
+msgid "Not enough memory"
+msgstr ""
+
+#: ../classes/dos/dosscr.cc:391
+msgid "Windows reports error"
+msgstr ""
+
+#: ../classes/linux/linuxkey.cc:96 ../classes/unix/xtermkey.cc:81
+msgid "that's an interactive application, don't redirect stdin"
+msgstr ""
+
+#: ../classes/linux/linuxkey.cc:117 ../classes/unix/xtermkey.cc:88
+msgid "failed to get the name of the current terminal used for input"
+msgstr ""
+
+#: ../classes/linux/linuxkey.cc:123 ../classes/unix/xtermkey.cc:94
+msgid "failed to open the input terminal"
+msgstr ""
+
+#: ../classes/linux/linuxkey.cc:130 ../classes/unix/xtermkey.cc:101
+msgid "can't get input terminal attributes"
+msgstr ""
+
+#: ../classes/linux/linuxkey.cc:143 ../classes/unix/xtermkey.cc:126
+msgid "can't set input terminal attributes"
+msgstr ""
+
+#: ../classes/linux/linuxkey.cc:822
+msgid "ioctl VT_SETMODE failed"
+msgstr ""
+
+#: ../classes/linux/linuxscr.cc:688 ../classes/qnxrtp/qnxscr.cc:66
+#: ../classes/unix/unixscr.cc:579 ../classes/unix/xtermscr.cc:99
+msgid ""
+"that's an interactive application, don't redirect stdout. If you want to "
+"collect information redirect stderr like this: program 2> file"
+msgstr ""
+
+#: ../classes/linux/linuxscr.cc:698
+msgid "failed to get the name of the current terminal used for output"
+msgstr ""
+
+#: ../classes/linux/linuxscr.cc:704
+msgid "failed to open the output terminal"
+msgstr ""
+
+#: ../classes/linux/linuxscr.cc:712 ../classes/linux/linuxscr.cc:722
+#: ../classes/unix/xtermscr.cc:107
+msgid "can't get output terminal information"
+msgstr ""
+
+#: ../classes/linux/linuxscr.cc:733 ../classes/unix/xtermscr.cc:117
+msgid "can't configure terminal mode"
+msgstr ""
+
+#: ../classes/linux/linuxscr.cc:921 ../classes/linux/linuxscr.cc:929
+#: ../classes/qnxrtp/qnxscr.cc:66 ../classes/unix/unixscr.cc:579
+#: ../classes/unix/xtermscr.cc:147 ../classes/unix/xtermscr.cc:155
+#, c-format
+msgid "Error! %s"
+msgstr ""
+
+#: ../classes/x11/x11src.cc:2137
+msgid "No available selection"
+msgstr ""
+
+#: ../classes/x11/x11src.cc:2138
+msgid "Unsupported data type"
+msgstr ""
+
+#: ../classes/x11/x11src.cc:2139
+msgid "No data"
+msgstr ""
+
+#: ../classes/x11/x11src.cc:2140
+msgid "X11 error"
+msgstr ""
+
+#: ../classes/x11/x11src.cc:2141
+msgid "Another application holds the clipboard"
+msgstr ""
+
+#: ../fileview.cc:149
+#, c-format
+msgid "Could not open '%s' for reading"
+msgstr ""
+
+#: ../fileview.cc:214
+msgid "Save to file"
+msgstr ""
+
+#: ../msgbox.cc:41
+msgid "~Y~es"
+msgstr ""
+
+#: ../msgbox.cc:42
+msgid "~N~o"
+msgstr ""
+
+#: ../msgbox.cc:57
+msgid "Warning"
+msgstr ""
+
+#: ../msgbox.cc:59
+msgid "Information"
+msgstr ""
+
+#: ../msgbox.cc:60
+msgid "Confirm"
+msgstr ""
+
+#: ../msgbox.cc:94
+msgid "Don't warn you next time"
+msgstr ""
diff --git a/tvision/intl/utod.pl b/tvision/intl/utod.pl
new file mode 100644
index 0000000..a72f7c3
--- /dev/null
+++ b/tvision/intl/utod.pl
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+# Copyright (C) 2001 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+
+require "../miscperl.pl";
+
+$a=cat($ARGV[0]);
+if ($a!~/\r\n/)
+ {
+ $a=~s/\n/\r\n/g;
+ $a=~s/charset\=CP850/charset\=ISO\-8859\-1/;
+ }
+replace($ARGV[1],$a);
+
diff --git a/tvision/linux/compress b/tvision/linux/compress
new file mode 100755
index 0000000..61599c2
--- /dev/null
+++ b/tvision/linux/compress
@@ -0,0 +1,151 @@
+#!/usr/bin/perl
+# Copyright (C) 1999-2005 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Creates a distribution tarball.
+#
+require "../miscperl.pl";
+
+GetVersion('../');
+
+$r=cat('../include/tv.h');
+if ($r!~/$Version/)
+ {
+ die "Error! inconsistent version in tv.h\n";
+ }
+
+# Adjust Debian version
+$r=cat('../debian/changelog');
+if ($r!~/$Version/)
+ {
+ chdir('../../debian');
+ @ENV{'DEBEMAIL'}='salvador@inti.gov.ar';
+ @ENV{'DEBFULLNAME'}='Salvador E. Tropea (SET)';
+ system("dch --check-dirname-level 0 -v$Version"."-0.1 \"New version automatically modified by version update scripts\"");
+ chdir('../makes/linux');
+ }
+
+$doBinary=0;
+$useBzip2=0;
+$useVersioInSourceDir=0;
+foreach $i (@ARGV)
+ {
+ if ($i eq '--binary')
+ {
+ $doBinary=1;
+ }
+ elsif ($i eq '--use-bzip2')
+ {
+ $useBzip2=1;
+ }
+ elsif ($i eq '--dir-version')
+ {
+ $useVersioInSourceDir=1;
+ }
+ else
+ {
+ print "Unknown command line option: $i\n";
+ print "Usage: compres.pl [--binary] [--use-bzip2] [--dir-version]\n\n";
+ }
+ }
+
+# BC++ 5.5 Makefile
+chdir('..');
+`perl confignt.pl`;
+chdir('linux');
+# Patch the version number in the readme.txt
+print "Processing readme file\n";
+$r=cat('../readme.in');
+$r=~s/\@version\@/$Version/g;
+replace('../readme.txt',$r);
+
+# Patch Debian control file
+print "Processing debian/control file\n";
+$r=cat('../debian/control.in');
+$r=~s/\@version\@/$Version/g;
+replace('../debian/control',$r);
+
+$ext=$useBzip2 ? '.bz2' : '.gz';
+$compresor=$useBzip2 ? 'bzip2 -9c' : 'gzip -9c';
+$dir='tvision' unless $useVersioInSourceDir;
+$dir='librhtv-'.$Version if $useVersioInSourceDir; # Mainly for the RPM
+
+# Generate the tar files
+$bindist="rhtvision-$Version.bin.i386.elf.static.linux.tar$ext";
+$binddist="rhtvision-$Version.bin.i386.elf.dynamic.linux.tar$ext";
+$srcdist="rhtvision-$Version.src.tar$ext";
+chdir('../..');
+unlink($srcdist,$bindist,$binddist);
+
+`mv tvision $dir` if $useVersioInSourceDir;
+
+open(FIL,$dir.'/lista');
+@files=<FIL>;
+close(FIL);
+$r='';
+foreach $i (@files)
+ {
+ chop $i;
+ if ((substr($i,0,1) eq '-') or (substr($i,0,1) eq '+'))
+ {
+ $i=substr($i,1);
+ }
+ $r.=$dir.'/'.$i.' ';
+ }
+# Add example makefiles
+@files=glob($dir.'/examples/*/*.?mk');
+$r.=' '.join(' ',@files);
+@files=glob($dir.'/examples/*/*/*.?mk');
+$r.=' '.join(' ',@files);
+@files=glob($dir.'/examples/*/*.mkf');
+$r.=' '.join(' ',@files);
+@files=glob($dir.'/examples/*/*/*.mkf');
+$r.=' '.join(' ',@files);
+# Sort the list
+@files=split(/ /,$r);
+@files=sort(@files);
+$r=join(' ',@files);
+
+print "$r\n" if $useVersioInSourceDir;
+system("tar -cvf - $r | $compresor > $srcdist");
+system("tar -cvf - --exclude=*CVS `cat $dir/linux/inclubin.txt` | $compresor > $bindist") if $doBinary;
+system("tar -cvf - --exclude=*CVS `cat $dir/linux/includbi.txt` | $compresor > $binddist") if $doBinary;
+`mv $dir tvision` if $useVersioInSourceDir;
+
+# Generate the lsm distribution file (Linux Software Map entry).
+$lsm=
+"Begin3
+Title: Turbo Vision (Robert Hoehne port)
+Version: $Version
+Entered-date: !3
+Description: Turbo Vision port to Linux. C++ Text UI. Not 100% Borland compatible.
+Keywords: c++ cui tui framework interface tv tvision
+Author: robert.hoehne\@gmx.net.de (Robert Hoehne)
+ salvador\@inti.gov.ar (Salvador E. Tropea)
+Maintained-by: salvador\@inti.gov.ar (Salvador E. Tropea)
+Primary-site: www.geocities.com /SiliconValley/Vista/6552/tvision.html
+ !1
+ !2
+ !4
+Original-site: ftp.borland.com /pub/borlandcpp/devsupport/archive/turbovision
+ 232k tv.zip
+Platforms: Linux, GNU g++, gpm, ncurses
+Copying-policy: GPL
+End";
+
+$r= int((-s $srcdist)/1024+0.5)."k $srcdist";
+$lsm =~ s/\!1/$r/g;
+$r='';
+$r= int((-s $bindist)/1024+0.5)."k $bindist" if $doBinary;
+$lsm =~ s/\!2/$r/g;
+$r= int((-s $binddist)/1024+0.5)."k $binddist" if $doBinary;
+$lsm =~ s/\!4/$r/g;
+@t=localtime(time());
+@mes=('JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC');
+$r=$t[3].$mes[$t[4]].$t[5];
+$r='0'.$r if length($r)<7;
+$lsm =~ s/\!3/$r/g;
+replace('rhtvision.lsm',$lsm);
+replace('rhtvision.txt',$lsm);
+
+
diff --git a/tvision/linux/inclubin.txt b/tvision/linux/inclubin.txt
new file mode 100644
index 0000000..30d537e
--- /dev/null
+++ b/tvision/linux/inclubin.txt
@@ -0,0 +1,7 @@
+tvision/readme.txt
+tvision/copying*
+tvision/borland.txt
+tvision/linux/librhtv.a
+tvision/linux/sacadeb
+tvision/include/*.h
+tvision/linux/tmp
diff --git a/tvision/linux/includbi.txt b/tvision/linux/includbi.txt
new file mode 100644
index 0000000..8235b22
--- /dev/null
+++ b/tvision/linux/includbi.txt
@@ -0,0 +1,7 @@
+tvision/readme.txt
+tvision/copying*
+tvision/borland.txt
+tvision/linuxso/librhtv*
+tvision/linuxso/instlib
+tvision/include/*.h
+
diff --git a/tvision/linux/sacadeb b/tvision/linux/sacadeb
new file mode 100644
index 0000000..d55a797
--- /dev/null
+++ b/tvision/linux/sacadeb
@@ -0,0 +1,10 @@
+cp librhtv.a tmp
+cd tmp
+ar -x librhtv.a
+strip --strip-debug *.o
+ar -r librhtv.a *.o
+mv ../librhtv.a ../librhtvdb.a
+mv librhtv.a ..
+rm -r *
+cd ..
+
diff --git a/tvision/lista b/tvision/lista
new file mode 100644
index 0000000..e914370
--- /dev/null
+++ b/tvision/lista
@@ -0,0 +1,874 @@
+borland.txt
+change.log
+change1.log
+classes/alcon/alcon.cc
+classes/alcon/alcondis.cc
+classes/alcon/alconkey.cc
+classes/alcon/alconmouse.cc
+classes/alcon/alconscr.cc
+classes/calcdisp.cc
+classes/calculat.cc
+classes/codepage.cc
+classes/configfile.cc
+classes/dos/dosdis.cc
+classes/dos/doskey.cc
+classes/dos/dosmouse.cc
+classes/dos/dosscr.cc
+classes/dos/rhscreen.cc
+classes/dos/screen.cc
+classes/dos/sescreen.cc
+classes/dos/vesa.cc
+classes/dos/vga.cc
+classes/dos/vgaregs.c
+classes/dos/vgaregs.h
+classes/dos/vgastate.c
+classes/dos/vgastate.h
+classes/fontcoll.cc
+classes/fpbase.cc
+classes/fpstream.cc
+classes/ifpstrea.cc
+classes/help.cc
+classes/helpbase.cc
+classes/iopstrea.cc
+classes/ipstream.cc
+classes/ofpstrea.cc
+classes/opstream.cc
+classes/osclipboard.cc
+classes/pstream.cc
+classes/tvtext1.cc
+classes/tvtext2.cc
+classes/tapplica.cc
+classes/tbackgro.cc
+classes/tbutton.cc
+classes/tchdirdi.cc
+classes/tcheckbo.cc
+classes/tclrdisp.cc
+classes/tcluster.cc
+classes/tcollect.cc
+classes/tcolordi.cc
+classes/tcolorgr.cc
+classes/tcolorit.cc
+classes/tcolorse.cc
+classes/tcommand.cc
+classes/tdesktop.cc
+classes/tdialog.cc
+classes/tdircoll.cc
+classes/tdirlist.cc
+classes/tdisplay.cc
+classes/tdrawbuf.cc
+classes/teditor.cc
+classes/teditorf.cc
+classes/teditwin.cc
+classes/tevent.cc
+classes/tfilecol.cc
+classes/tfiledia.cc
+classes/tfileedi.cc
+classes/tfileinf.cc
+classes/tfileinp.cc
+classes/tfilelis.cc
+classes/tfilterv.cc
+classes/tframe.cc
+classes/tgkey.cc
+classes/tgroup.cc
+classes/thistory.cc
+classes/thistvie.cc
+classes/thistwin.cc
+classes/thwmouse.cc
+classes/tindicat.cc
+classes/tinputli.cc
+classes/tlabel.cc
+classes/tlistbox.cc
+classes/tlistvie.cc
+classes/tlookupv.cc
+classes/tmemo.cc
+classes/tmenubar.cc
+classes/tmenubox.cc
+classes/tmenuvie.cc
+classes/tmonosel.cc
+classes/tmouse.cc
+classes/tnscolle.cc
+classes/tnssorte.cc
+classes/tobject.cc
+classes/tpalette.cc
+classes/tparamte.cc
+classes/tpoint.cc
+classes/tprogini.cc
+classes/tprogram.cc
+classes/tpxvalid.cc
+classes/tpwobj.cc
+classes/tpwreado.cc
+classes/tpwritte.cc
+classes/tradiobu.cc
+classes/trangeva.cc
+classes/trescoll.cc
+classes/tresfile.cc
+classes/tscreen.cc
+classes/tscrollb.cc
+classes/tscrolle.cc
+classes/tsortedc.cc
+classes/tsortedl.cc
+classes/tstatict.cc
+classes/tstatusd.cc
+classes/tstatusl.cc
+classes/tstrinde.cc
+classes/tstringc.cc
+classes/tstringl.cc
+classes/tstrlist.cc
+classes/tstrmcla.cc
+classes/tstrmtyp.cc
+classes/tsubmenu.cc
+classes/ttermina.cc
+classes/ttextdev.cc
+classes/tvalidat.cc
+classes/tvintl.cc
+classes/tvedit1.cc
+classes/tvedit2.cc
+classes/tvedit3.cc
+classes/tview.cc
+classes/twindow.cc
+classes/linux/linuxdis.cc
+classes/linux/linuxkey.cc
+classes/linux/linuxmouse.cc
+classes/linux/linuxscr.cc
+classes/qnx4/qnx4dis.cc
+classes/qnx4/qnx4key.cc
+classes/qnx4/qnx4mouse.cc
+classes/qnx4/qnx4scr.cc
+classes/qnxrtp/qnxdis.cc
+classes/qnxrtp/qnxkey.cc
+classes/qnxrtp/qnxmouse.cc
+classes/qnxrtp/qnxscr.cc
+classes/unix/unixdis.cc
+classes/unix/unixkey.cc
+classes/unix/unixmouse.cc
+classes/unix/unixscr.cc
+classes/unix/xtermdis.cc
+classes/unix/xtermkey.cc
+classes/unix/xtermmouse.cc
+classes/unix/xtermscr.cc
+classes/win32/win32clip.cc
+classes/win32/win32dis.cc
+classes/win32/win32key.cc
+classes/win32/win32mouse.cc
+classes/win32/win32scr.cc
+classes/wingr/wingrdis.cc
+classes/wingr/wingrkey.cc
+classes/wingr/wingrmouse.cc
+classes/wingr/wingrscr.cc
+classes/winnt/winntdis.cc
+classes/winnt/winntkey.cc
+classes/winnt/winntmouse.cc
+classes/winnt/winntscr.cc
+classes/x11/x11dis.cc
+classes/x11/x11key.cc
+classes/x11/x11mouse.cc
+classes/x11/x11src.cc
+compat/beep.c
+compat/drivevalid.c
+compat/expandpath.c
+compat/fexpand.c
+compat/fileattrs.c
+compat/filelength.c
+compat/getcurdir.c
+compat/getline.c
+compat/getopt.c
+compat/getshell.c
+compat/iffilelen.cc
+compat/isdir.c
+compat/isrelpath.c
+compat/iswild.c
+compat/itoa.c
+compat/mkstemp.c
+compat/ntdirent.c
+compat/pathvalid.c
+compat/releasec.c
+compat/snprintf.c
+compat/strlwr.c
+compat/strupr.c
+compat/unc.c
+compat/unc_95.c
+compat/unc_nt.c
+compat/validfilename.c
+compat/yieldpro.c
+compat/fileexists.c
+compat/compat.gpr
+compat/compat.umk
+compat/compat.imk
+compat/obj/delete.me
+compat/fixpath.c
+compat/fnmatch.c
+compat/getopt1.c
+compat/glob.c
+compat/globfree.c
+compat/nl_langinfo.c
+compat/regex.c
+compat/rhide.env
+compat/ssc_streams.cc
+compat/ticks.c
+config.pl
+confignt.pl
++configure.bat
++configure
++configset.bat
++configset
+conflib.pl
+copying
+copying.rh
+debian/.cvsignore
+debian/README
+debian/README.debian
++debian/buildpackage
+debian/changelog
+debian/control
+debian/control.in
+debian/copyright
+debian/diversions.ex
+debian/files_to_backup
+debian/info.ex
+debian/maintainer.notes
+debian/rhtvision.postinst
+debian/rhtvision.postrm
++debian/rules
+debian/shlibs.local.ex
+debian/watch.ex
++djgpp/sacadeb.bat
++djgpp/compress.bat
+djgpp/compress.pl
++djgpp/distlist
+djgpp/tmp/delete.me
+doc/Alcon.txt
+doc/ConfigFile.txt
+doc/CodePages.txt
+doc/DOS.txt
+doc/Eterm.txt
+doc/html.frt
+doc/I18n.txt
+doc/install/bcc.txt
+doc/install/cygwin.txt
+doc/install/djgpp.txt
+doc/install/linux.txt
+doc/install/mingwin.txt
+doc/install/msvc.txt
+doc/install/tools.txt
+doc/install/unix.txt
+doc/install/watcom.txt
+-doc/libdocs.epr
+doc/Linux.txt
+doc/QNX.txt
+doc/Streams.txt
+doc/troubleshooting/Linux/1/code.cc
+doc/troubleshooting/Linux/1/readme.txt
+doc/troubleshooting/Linux/1/test-utf8.txt
+doc/troubleshooting/Linux/1/test.txt
+doc/troubleshooting/Linux/1/utf8.cc
+doc/troubleshooting/Linux/2/readme.txt
+doc/troubleshooting/Linux/3/readme.txt
+doc/troubleshooting/Linux/4/readme.txt
+doc/troubleshooting/Linux/4/test.cc
+doc/troubleshooting/Linux/readme.txt
+doc/troubleshooting/readme.txt
+doc/TVReference.html
+doc/Win32.txt
+doc/WinGr.txt
+doc/X11.txt
+doc/XTerm.txt
+drivers2.cc
+dual.cc
+examples/Makefile
+examples/patchenv.pl
+examples/rhide.env
+examples/bhelp/.tvrc
+examples/bhelp/bhelp.cc
+examples/bhelp/bhelp.h
+examples/bhelp/rhide.env
+examples/bhelp/thelp.cc
+-examples/bhelp/thelp.gpr
+examples/clipboard/test.cc
+examples/clipboard/test.gpr
+examples/clipboard/rhide.env
+examples/common.bmk
+-examples/cyrillic/linuxkoi8/koi8-r.acm.gz
+-examples/cyrillic/linuxkoi8/koi8-r.psf.gz
+-examples/cyrillic/linuxkoi8/lat1-16.psf.gz
+examples/cyrillic/linuxkoi8/README
+examples/cyrillic/linuxkoi8/rhide.env
+-examples/cyrillic/linuxkoi8/ru1.kmap.gz
++examples/cyrillic/linuxkoi8/setkoi8.sh
++examples/cyrillic/linuxkoi8/setlat1.sh
+examples/cyrillic/linuxkoi8/test.cc
+-examples/cyrillic/linuxkoi8/test.gpr
+examples/cyrillic/linuxkoi8/trivial.acm
+examples/cyrillic/x11koi8/rhide.env
+examples/cyrillic/x11koi8/test.cc
+-examples/cyrillic/x11koi8/test.gpr
+examples/demo/ascii.cc
+examples/demo/ascii.h
+examples/demo/calendar.cc
+examples/demo/calendar.h
+-examples/demo/demo.gpr
+examples/demo/demohelp.h
+-examples/demo/demohelp.h32
+examples/demo/diffs.cc
+examples/demo/fileview.cc
+examples/demo/fileview.h
+examples/demo/gadgets.cc
+examples/demo/gadgets.h
+examples/demo/mousedlg.cc
+examples/demo/mousedlg.h
+examples/demo/puzzle.cc
+examples/demo/puzzle.h
+examples/demo/rhide.env
+examples/demo/tvcmds.h
+examples/demo/tvdemo.h
+examples/demo/tvdemo1.cc
+examples/demo/tvdemo2.cc
+examples/demo/tvdemo3.cc
+examples/dlgdsn/codebldr.cc
+examples/dlgdsn/consted.cc
+examples/dlgdsn/consted.h
+examples/dlgdsn/dsgdata.h
+examples/dlgdsn/dsgobjs.cc
+examples/dlgdsn/dsgobjs.h
+examples/dlgdsn/fdconsts.h
+examples/dlgdsn/freedsgn.cc
+-examples/dlgdsn/libtest.gpr
+examples/dlgdsn/propdlgs.cc
+examples/dlgdsn/propdlgs.h
+examples/dlgdsn/propedit.cc
+examples/dlgdsn/propedit.h
+examples/dlgdsn/rhide.env
+examples/dlgdsn/strmoper.cc
+examples/dlgdsn/strmoper.h
+examples/dlgdsn/tappwnd.cc
+examples/desklogo/desklogo.cc
+examples/desklogo/desklogo.gpr
+examples/desklogo/rhide.env
+examples/desklogo/set-logo.cc
+examples/desklogo/set-logo.gpr
+examples/desklogo/tv_logo.cc
+examples/desklogo/tv_logo.gpr
+examples/dyntxt/dyntext.cpp
+-examples/dyntxt/dyntext.gpr
+examples/dyntxt/dyntext.h
+examples/dyntxt/readme
+examples/dyntxt/rhide.env
+examples/dyntxt/testdyn.cpp
+examples/eterm/menus.cfg
+examples/eterm/theme.cfg
+-examples/fonts/font.016
+examples/fonts/genraw.cc
+-examples/fonts/genraw.gpr
+-examples/fonts/ocr.sft
+examples/fonts/rhide.env
+examples/fonts/test.cc
+-examples/fonts/test.gpr
+examples/gen_mkf.pl
+examples/helpdemo/helpdemo.cc
+-examples/helpdemo/helpdemo.gpr
+examples/helpdemo/rhide.env
+examples/i18n/README
+examples/i18n/es.po
++examples/i18n/extract.sh
+-examples/i18n/intl/es/LC_MESSAGES/tvision.mo
+-examples/i18n/intl/es/LC_MESSAGES/test.mo
+examples/i18n/rhide.env
+examples/i18n/test.cc
+-examples/i18n/test.gpr
+examples/i18n/test.po
+-examples/inplis/implis.gpr
+examples/inplis/inplist.cpp
+examples/inplis/inplist.h
+examples/inplis/rhide.env
+examples/inplis/test.cpp
+examples/listvi/listbox2.cpp
+examples/listvi/lst_view.cpp
+-examples/listvi/lst_view.gpr
+examples/listvi/lst_view.h
+examples/listvi/readme.txt
+examples/listvi/rhide.env
+-examples/msgcls/msgcls.gpr
+examples/msgcls/readme.txt
+examples/msgcls/rhide.env
+examples/msgcls/testdyn.cpp
+examples/msgcls/tlnmsg.cpp
+examples/msgcls/tlnmsg.h
+examples/porting.txt
+examples/progba/example.cpp
+examples/progba/makerez.cpp
+examples/progba/readrez.cpp
+examples/progba/rhide.env
+-examples/progba/test.gpr
+examples/progba/tprogbar.cpp
+examples/progba/tprogbar.h
+examples/readme.txt
+examples/sdlg2/dlg.h
+examples/sdlg2/main.cpp
+examples/sdlg2/rhide.env
+examples/sdlg2/scrldlg.cpp
+examples/sdlg2/scrlgrp.cpp
+-examples/sdlg2/test.gpr
+examples/sdlg/dlg.h
+examples/sdlg/main.cpp
+examples/sdlg/rhide.env
+examples/sdlg/scrldlg.cpp
+examples/sdlg/scrlgrp.cpp
+-examples/sdlg/test.gpr
+examples/tcombo/nmcmbobx.cpp
+examples/tcombo/nmcmbovw.cpp
+examples/tcombo/nmcmbown.cpp
+examples/tcombo/nmsinput.cpp
+examples/tcombo/readme.txt
+examples/tcombo/rhide.env
+examples/tcombo/scombobx.cpp
+examples/tcombo/scombovw.cpp
+examples/tcombo/scombown.cpp
+examples/tcombo/ssinputl.cpp
+examples/tcombo/tcmbovwr.cpp
+examples/tcombo/tcmbowin.cpp
+examples/tcombo/tcombobx.cpp
+examples/tcombo/tcombobx.h
+examples/tcombo/tcombo.txt
+examples/tcombo/test.cpp
+-examples/tcombo/test.gpr
+examples/tcombo/tsinputl.cpp
+examples/tcombo/tsinputl.h
+examples/terminal/rhide.env
+examples/terminal/terminal.cc
+-examples/terminal/test.gpr
+examples/tprogb/calc.cpp
+examples/tprogb/rhide.env
+-examples/tprogb/test.gpr
+examples/tprogb/tprogbar.cpp
+examples/tprogb/tprogbar.h
+examples/tutorial/rhide.env
+examples/tutorial/tvguid01.cc
+-examples/tutorial/tvguid01.gpr
+examples/tutorial/tvguid02.cc
+-examples/tutorial/tvguid02.gpr
+examples/tutorial/tvguid03.cc
+-examples/tutorial/tvguid03.gpr
+examples/tutorial/tvguid04.cc
+-examples/tutorial/tvguid04.gpr
+examples/tutorial/tvguid05.cc
+-examples/tutorial/tvguid05.gpr
+examples/tutorial/tvguid06.cc
+-examples/tutorial/tvguid06.gpr
+examples/tutorial/tvguid07.cc
+-examples/tutorial/tvguid07.gpr
+examples/tutorial/tvguid08.cc
+-examples/tutorial/tvguid08.gpr
+examples/tutorial/tvguid09.cc
+-examples/tutorial/tvguid09.gpr
+examples/tutorial/tvguid10.cc
+-examples/tutorial/tvguid10.gpr
+examples/tutorial/tvguid11.cc
+-examples/tutorial/tvguid11.gpr
+examples/tutorial/tvguid12.cc
+-examples/tutorial/tvguid12.gpr
+examples/tutorial/tvguid13.cc
+-examples/tutorial/tvguid13.gpr
+examples/tutorial/tvguid14.cc
+-examples/tutorial/tvguid14.gpr
+examples/tutorial/tvguid15.cc
+-examples/tutorial/tvguid15.gpr
+examples/tutorial/tvguid16.cc
+-examples/tutorial/tvguid16.gpr
+examples/tvedit/tvedit.cc
+examples/tvedit/tvedit.gpr
+examples/tvedit/rhide.env
+examples/tvhc/demohelp.txt
+examples/tvhc/rhide.env
+examples/tvhc/tvhc.cc
+-examples/tvhc/tvhc.gpr
+examples/tvhc/tvhc.h
+examples/videomode/test.cc
+-examples/videomode/test.gpr
+examples/videomode/rhide.env
+examples/xterm/Xterm.res
+extra/doskeys/kextend.asm
+-extra/doskeys/kextend.com
+extra/doskeys/kextend.txt
+extra/eterm/Setedit/MAIN
+extra/eterm/Setedit/Setedit.menu
+extra/eterm/readme.txt
+extra/eterm/xterm-eterm-tv
+-extra/pifexamp/setedit.pif
+fileview.cc
+histlist.cc
+include/cl/regex.h
+include/cl/fnmatch.h
+include/cl/strstream.h
+include/cl/unistd.h
+include/cl/needs.h
+include/cl/dir.h
+include/cl/dirent.h
+include/cl/getopt.h
+include/cl/glob.h
+include/cl/utime.h
+include/cl/utsname.h
+include/compatlayer.h
+include/tv/alcon/alcon.h
+include/tv/alcon/key.h
+include/tv/alcon/mouse.h
+include/tv/alcon/screen.h
+include/tv/calc.h
+include/tv/codepage.h
+include/tv/configtv.h
+include/tv/editors.h
+include/tv/tvedit.h
+include/tv/video.h
+include/tv/app.h
+include/tv/applictn.h
+include/tv/colorsel.h
+include/tv/dialogs.h
+include/tv/drivers.h
+include/tv/dos/key.h
+include/tv/dos/mouse.h
+include/tv/dos/screen.h
+include/tv/drawbuf.h
+include/tv/fileview.h
+include/tv/findrepl.h
+include/tv/gkey.h
+include/tv/help.h
+include/tv/helpbase.h
+include/tv/indicato.h
+include/tv/intl.h
+include/tv/menus.h
+include/tv/msgbox.h
+include/tv/no_mss.h
+include/tv/objects.h
+include/tv/osclipboard.h
+include/tv/parttree.h
+include/tv/resource.h
+include/tv/stddlg.h
+include/tv/system.h
+include/tv/textview.h
+include/tv/tkeyext.h
+include/tv/tkeys.h
+include/tv/tobjstrm.h
+include/tv/ttypes.h
+include/tv.h
+include/tv/tvconfig.h
+include/tv/tvobjs.h
+include/tv/tvutil.h
+include/tv/validate.h
+include/tv/views.h
+include/tv/backgrnd.h
+include/tv/button.h
+include/tv/chdirdlg.h
+include/tv/checkbox.h
+include/tv/clrdisp.h
+include/tv/clrdlg.h
+include/tv/clrgroup.h
+include/tv/clrgrpli.h
+include/tv/clritem.h
+include/tv/clriteml.h
+include/tv/clrselct.h
+include/tv/cluster.h
+include/tv/cmdset.h
+include/tv/collectn.h
+include/tv/configfile.h
+include/tv/desktop.h
+include/tv/dialog.h
+include/tv/dircoll.h
+include/tv/direntr.h
+include/tv/dirlibo.h
+include/tv/event.h
+include/tv/eventqu.h
+include/tv/filecoll.h
+include/tv/filedlg.h
+include/tv/filelist.h
+include/tv/filinfpn.h
+include/tv/filinpln.h
+include/tv/fontcoll.h
+include/tv/fpbase.h
+include/tv/fpstream.h
+include/tv/frame.h
+include/tv/group.h
+include/tv/history.h
+include/tv/histvwer.h
+include/tv/histwind.h
+include/tv/ifpstrm.h
+include/tv/inputln.h
+include/tv/iopstrm.h
+include/tv/ipstream.h
+include/tv/label.h
+include/tv/linux/key.h
+include/tv/linux/log.h
+include/tv/linux/mouse.h
+include/tv/linux/screen.h
+include/tv/listbox.h
+include/tv/lstviewr.h
+include/tv/menu.h
+include/tv/menubar.h
+include/tv/menubox.h
+include/tv/menuitem.h
+include/tv/menuview.h
+include/tv/mnoselct.h
+include/tv/nointl.h
+include/tv/nscoll.h
+include/tv/nssorcol.h
+include/tv/object.h
+include/tv/ofpstrm.h
+include/tv/opstream.h
+include/tv/otstream.h
+include/tv/palette.h
+include/tv/parmtext.h
+include/tv/point.h
+include/tv/preadobj.h
+include/tv/program.h
+include/tv/pstream.h
+include/tv/pwritobj.h
+include/tv/qnx4/key.h
+include/tv/qnx4/mouse.h
+include/tv/qnx4/screen.h
+include/tv/qnxrtp/key.h
+include/tv/qnxrtp/mouse.h
+include/tv/qnxrtp/screen.h
+include/tv/radiobtn.h
+include/tv/rect.h
+include/tv/rescoll.h
+include/tv/resfile.h
+include/tv/resitem.h
+include/tv/screen.h
+include/tv/scrlbar.h
+include/tv/scroller.h
+include/tv/searchrc.h
+include/tv/sitem.h
+include/tv/skeleton/key.h
+include/tv/skeleton/mouse.h
+include/tv/skeleton/screen.h
+include/tv/sortcoll.h
+include/tv/sortlibo.h
+include/tv/ssc_streams.h
+include/tv/statsdef.h
+include/tv/statsitm.h
+include/tv/statslin.h
+include/tv/streambl.h
+include/tv/strilist.h
+include/tv/strinrec.h
+include/tv/strlistm.h
+include/tv/strmblcl.h
+include/tv/strmblty.h
+include/tv/strncoll.h
+include/tv/sttctext.h
+include/tv/submenu.h
+include/tv/terminal.h
+include/tv/textdev.h
+include/tv/unix/key.h
+include/tv/unix/mouse.h
+include/tv/unix/screen.h
+include/tv/unix/xtkey.h
+include/tv/unix/xtmouse.h
+include/tv/unix/xtscreen.h
+include/tv/view.h
+include/tv/win32/key.h
+include/tv/win32/mouse.h
+include/tv/win32/screen.h
+include/tv/win32/win32clip.h
+include/tv/wingr/key.h
+include/tv/wingr/mouse.h
+include/tv/wingr/screen.h
+include/tv/winnt/key.h
+include/tv/winnt/mouse.h
+include/tv/winnt/screen.h
+include/tv/x11/key.h
+include/tv/x11/mouse.h
+include/tv/x11/screen.h
+include/tv/yes_mss.h
+include/tv/window.h
+INSTALL.txt
+intl/utod.pl
+intl/dummy/intldummy.c
+intl/dummy/Makefile
+intl/es.po
+intl/gnumake.in
+intl/Makefile
+intl/tvision.po
+intl/pl.po
+intl/ru.po
++linux/compress
+linux/inclubin.txt
+linux/includbi.txt
++linux/sacadeb
+Makefile.bcc
+Makefile.in
+Makefile.nmk
+Makefile.wat
+makes/blink.c
+makes/common.bmk
+makes/common.imk
+makes/common.nmk
+makes/common.wat
+makes/config.bcc
+makes/config.nmk
+makes/config.wat
+makes/extrimk.cc
+makes/genimk.cc
+makes/includer.bmk
+makes/includer.imk
+makes/librhtv.bmk
+makes/librhtv.gpr
+makes/librhtv.imk
+makes/librhtv.mkf
+makes/librhtv.umk
+makes/maintain.mak
+makes/mlink.c
+makes/rhide.env
+makes/obj/delete.me
+misc.cc
+miscperl.pl
+msgbox.cc
+names/nbackgro.cc
+names/nbutton.cc
+names/ncalcdis.cc
+names/ncalcula.cc
+names/nchdirdi.cc
+names/ncheckbo.cc
+names/nclrdisp.cc
+names/ncluster.cc
+names/ncollect.cc
+names/ncolordi.cc
+names/ncolorgr.cc
+names/ncolorit.cc
+names/ncolorse.cc
+names/ndesktop.cc
+names/ndialog.cc
+names/ndircoll.cc
+names/ndirlist.cc
+names/neditor.cc
+names/neditwi.cc
+names/nfilecol.cc
+names/nfiledia.cc
+names/nfiledtr.cc
+names/nfileinf.cc
+names/nfileinp.cc
+names/nfilelis.cc
+names/nfilterv.cc
+names/nframe.cc
+names/ngroup.cc
+names/nhistory.cc
+names/nindicat.cc
+names/ninputli.cc
+names/nlabel.cc
+names/nlistbox.cc
+names/nlistvie.cc
+names/nlookupv.cc
+names/nmemo.cc
+names/nmenubar.cc
+names/nmenubox.cc
+names/nmenuvie.cc
+names/nmonosel.cc
+names/nparamte.cc
+names/npxvalid.cc
+names/nradiobu.cc
+names/nrangeva.cc
+names/nresourc.cc
+names/nscrollb.cc
+names/nscrolle.cc
+names/nsortedc.cc
+names/nsortedl.cc
+names/nstatict.cc
+names/nstatusl.cc
+names/nstringc.cc
+names/nstringl.cc
+names/nvalidat.cc
+names/nview.cc
+names/nwindow.cc
+newstr.cc
+qnxrtp/tvision.qpg
+qnxrtp/tvision.qpg.in
+readme.in
+readme.txt
+redhat/config-rpm.sh
+redhat/create-dirs.sh
+redhat/create-rpms.sh
+redhat/.cvsignore
+redhat/librhtv.spec.in
+redhat/README
+rhtv-config.c
+searchstrs.sh
+stream/sbackgro.cc
+stream/sbutton.cc
+stream/scalcdis.cc
+stream/scalcula.cc
+stream/schdirdi.cc
+stream/scheckbo.cc
+stream/sclrdisp.cc
+stream/scluster.cc
+stream/scolordi.cc
+stream/scolorgr.cc
+stream/scolorit.cc
+stream/scolorse.cc
+stream/sdesktop.cc
+stream/sdialog.cc
+stream/sdircoll.cc
+stream/sdirlist.cc
+stream/seditor.cc
+stream/seditwin.cc
+stream/sfilecol.cc
+stream/sfiledia.cc
+stream/sfileedi.cc
+stream/sfileinf.cc
+stream/sfileinp.cc
+stream/sfilelis.cc
+stream/sfilterv.cc
+stream/sframe.cc
+stream/sgroup.cc
+stream/shistory.cc
+stream/sindicat.cc
+stream/sinputli.cc
+stream/slabel.cc
+stream/slistbox.cc
+stream/slistvie.cc
+stream/slookupv.cc
+stream/smemo.cc
+stream/smenubar.cc
+stream/smenubox.cc
+stream/smenuvie.cc
+stream/smonosel.cc
+stream/sparamte.cc
+stream/spxvalid.cc
+stream/sradiobu.cc
+stream/srangeva.cc
+stream/sresourc.cc
+stream/sscrollb.cc
+stream/sscrolle.cc
+stream/sstatict.cc
+stream/sstatusl.cc
+stream/sstringc.cc
+stream/sstringl.cc
+stream/sview.cc
+stream/swindow.cc
++update.bat
++update
+version.txt
+fromdos.pl
+fromunix.pl
+lista
+lista.dos
+Makefile
+rhide.env
+snapshot.pl
+THANKS
+TODO
+win32/readme.txt
+winnt/bccmake.in
+winnt/include/msvc/dir.h
+winnt/include/msvc/dirent.h
+winnt/include/msvc/strstream.h
+winnt/include/tv/configtv.h
+winnt/Makefile
+winnt/Makefile.nmk
+winnt/msvcmake.in
+winnt/obj_ms/delete.me
+winnt/objs/delete.me
+winnt/readme.txt
+winnt/tvex.cc
+-www-site/bvucs-n1.jpg
+www-site/contrib.html
+-www-site/envelp.gif
+www-site/history.html
+www-site/index.html
+www-site/sf.css
+www-site/update
diff --git a/tvision/lista.dos b/tvision/lista.dos
new file mode 100644
index 0000000..a4f424d
--- /dev/null
+++ b/tvision/lista.dos
@@ -0,0 +1,40 @@
+borland.txt
+copying
+copying.rh
+djgpp/sacadeb.bat
+djgpp/compress.bat
+extra/doskeys/kextend.asm
+extra/doskeys/kextend.txt
+configure.bat
+configset.bat
+update.bat
+win32/Makefile
+win32/Makefile.ms
+win32/demo.mak
+win32/demo.ms
+win32/obj/delete.me
+win32/obj_demo/delete.me
+win32/readme.txt
+winnt/bccmake.in
+winnt/include/msvc/dir.h
+winnt/include/msvc/dirent.h
+winnt/include/msvc/strstream.h
+winnt/include/tv/configtv.h
+winnt/Makefile
+winnt/objs/delete.me
+winnt/readme.txt
+winnt/tvex.cc
+classes/win32/win32dis.cc
+classes/win32/win32key.cc
+classes/win32/win32mouse.cc
+classes/win32/win32scr.cc
+classes/winnt/winntdis.cc
+classes/winnt/winntkey.cc
+classes/winnt/winntmouse.cc
+classes/winnt/winntscr.cc
+include/tv/win32/key.h
+include/tv/win32/mouse.h
+include/tv/win32/screen.h
+include/tv/winnt/key.h
+include/tv/winnt/mouse.h
+include/tv/winnt/screen.h
diff --git a/tvision/makes/blink.c b/tvision/makes/blink.c
new file mode 100644
index 0000000..ad85d96
--- /dev/null
+++ b/tvision/makes/blink.c
@@ -0,0 +1,72 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador E. Tropea.
+ Covered by the GPL license.
+ Description:
+ tlink have a really useless command line. This wrapper avoids all the
+complexities.
+ Also: I failed to create a macro that expands to something that creates
+a response file. Looks like it only works outside macros. This program
+just collects the files from the specified directories and creates the
+library with all of them.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
+
+#define MAX_FILE 256
+
+int main(int argc, char *argv[])
+{
+ FILE *f;
+ int i,ret;
+ char *s;
+ char b[MAX_FILE];
+ DIR *d;
+ struct dirent *de;
+
+ if (argc<3)
+ {
+ printf("tlink wrapper\n");
+ printf("Copyright (c) 2003 by Salvador E. Tropea. GPL.\n");
+ printf("Usage: blink lib list_obj_files\n");
+ return 1;
+ }
+ f=fopen("bcclink.lnk","wt");
+ if (!f)
+ {
+ printf("Can't create response file\n");
+ return 2;
+ }
+ for (i=2; i<argc; i++)
+ {
+ d=opendir(argv[i]);
+ if (!d)
+ {
+ printf("Can't open directory %s\n",argv[i]);
+ return 4;
+ }
+ while ((de=readdir(d))!=NULL)
+ {
+ //printf("%s\n",de->d_name);
+ s=de->d_name;
+ if (!strstr(s,".obj"))
+ continue;
+ fprintf(f,"+%s\\%s &\n",argv[i],s);
+ }
+ closedir(d);
+ }
+ fprintf(f,"+");
+ fclose(f);
+
+ unlink(argv[1]);
+ s=(char *)malloc(strlen(argv[1])+32);
+ sprintf(s,"tlib %s /E /P256 @bcclink.lnk",argv[1]);
+ ret=system(s);
+ if (!ret)
+ unlink("bcclink.lnk");
+ return ret;
+}
diff --git a/tvision/makes/common.bmk b/tvision/makes/common.bmk
new file mode 100644
index 0000000..f44d455
--- /dev/null
+++ b/tvision/makes/common.bmk
@@ -0,0 +1,65 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+# For Borland C++.
+# This file contains the definitions needed to compile and link the rules
+# found in .umk files.
+# The definitions are used by all the makefiles.
+#
+
+#
+# That configure the compilation and linking options.
+# Is equivalent to rhide.env.
+#
+!ifdef CONFIG_PATH
+# To avoid usig -I....
+!include $(CONFIG_PATH)/config.bcc
+!else
+!include config.bcc
+!endif
+
+.path.cc=$(SRCDIRS)
+.path.c=$(SRCDIRS);.
+.path.s=$(SRCDIRS)
+
+# Turn off the implicit rule to generate .obj files from .c files.
+# If we don't do it make will use both rules.
+.c.obj:
+
+HELPER_TARGET=blink.exe
+# These files changes the compilation process so they are important
+# dependencies.
+#MAKEFILE_DEPS=blink.exe Interferes with compile rule.
+MAKEFILE_DEPS=
+# Extensions used by Borland tools
+ExOBJ=.obj
+ExEXE=.exe
+ExLIB=.lib
+
+RHIDE_AR=blink
+RHIDE_ARFLAGS=
+
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(LDFLAGS) -e$(OUTFILE) $(OBJFILES) \
+ $(LIBRARIES) $(RHIDE_LIBDIRS) $(RHIDE_LIBS)
+RHIDE_COMPILE_C=$(RHIDE_GCC) -c $(CFLAGS) $(INCLUDE_DIRS) -o$(OUTFILE) \
+ $(SOURCE_NAME)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) -c $(CXXFLAGS) $(INCLUDE_DIRS) -o$(OUTFILE) \
+ $(SOURCE_NAME)
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) obj
+# This is fake, the .S files are used only for DJGPP and they are protected
+# by preprocessor constructions. For this reason they can be used as C sources
+# to generate dummy .obj files.
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_GCC) -c $(CFLAGS) $(INCLUDE_DIRS) -o$(OUTFILE) \
+ $(SOURCE_NAME)
+
+SOURCE_NAME=$**
+OUTFILE=$@
+ALL_PREREQ=$**
+
+#LIB_DIRS=$(RHIDE_OS_LIBS_PATH) -L.
+
+blink.exe:: blink.c
+ $(RHIDE_GCC) -e$(OUTFILE) $(ALL_PREREQ)
+
diff --git a/tvision/makes/common.imk b/tvision/makes/common.imk
new file mode 100644
index 0000000..3b5db95
--- /dev/null
+++ b/tvision/makes/common.imk
@@ -0,0 +1,71 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+
+#
+# Any configurable detail should come from here.
+#
+include rhide.env
+
+vpath %.c $(vpath_src)
+vpath %.s $(vpath_src)
+vpath %.cc $(vpath_src)
+vpath %.o $(vpath_obj)
+vpath %.h $(INCLUDE_DIR)
+
+# These files changes the compilation process so they are important
+# dependencies.
+ifdef MAINTAINER_MODE
+MAKEFILE_DEPS=rhide.env $(COMMON_IMK)
+ExIMK=.imk
+else
+MAKEFILE_DEPS=
+ExIMK=.umk
+endif
+
+# Extensions used by GNU tools
+ifdef DYNAMIC_LIB
+ExOBJ=.lo
+ifdef DARWIN
+ExLIB=.$(LIB_VER).dylib
+else
+ExLIB=.so.$(LIB_VER)
+endif
+#ExLIB=.so
+else
+ExOBJ=.o
+ExLIB=.a
+endif
+ExEXE=.exe
+
+RHIDE_AS=$(RHIDE_GCC)
+SOURCE_NAME=$<
+OUTFILE=$@
+ALL_PREREQ=$^
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler-with-cpp\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+LIB_DIRS=$(addprefix -L,$(TVOBJ))
+
+ifdef DYNAMIC_LIB
+C_EXTRA_FLAGS=$(SHARED_CODE_OPTION)
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) \
+ $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) \
+ $(OBJFILES) $(RHIDE_LIBS_ARCH)
+else
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE)\
+ $(ALL_PREREQ)
+endif
+
+LIBS=rhtv
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_OS_LIBS))
+# Same as RHIDE_LIBS, but without making reference to itself
+RHIDE_LIBS_ARCH=$(addprefix -l,$(RHIDE_OS_LIBS))
+RHIDE_LIBDIRS=$(LIB_DIRS)
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)
+
diff --git a/tvision/makes/common.nmk b/tvision/makes/common.nmk
new file mode 100644
index 0000000..5998c47
--- /dev/null
+++ b/tvision/makes/common.nmk
@@ -0,0 +1,69 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2005 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+# For MSVC.
+# This file contains the definitions needed to compile and link the rules
+# found in .umk files.
+# The definitions are used by all the makefiles.
+#
+
+#
+# That configure the compilation and linking options.
+# Is equivalent to rhide.env.
+#
+!ifdef CONFIG_PATH
+# To avoid using -I....
+!include $(CONFIG_PATH)/config.nmk
+!else
+!include config.nmk
+!endif
+
+# .path.cc=$(SRCDIRS)
+# .path.c=$(SRCDIRS);.
+# .path.s=$(SRCDIRS)
+
+# Turn off the implicit rule to generate .obj files from .c files.
+# If we don't do it make will use both rules.
+.c.obj:
+
+HELPER_TARGET=mlink.exe
+# These files changes the compilation process so they are important
+# dependencies.
+#MAKEFILE_DEPS=mlink.exe
+MAKEFILE_DEPS=
+# Extensions used by MSVC tools
+ExOBJ=.obj
+ExEXE=.exe
+ExLIB=.lib
+
+RHIDE_AR=mlink
+#RHIDE_AR=link
+RHIDE_ARFLAGS=
+
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(LDFLAGS) /OUT:$(OUTFILE) $(OBJFILES) \
+ $(LIBRARIES) $(RHIDE_LIBDIRS) user32.lib gdi32.lib $(RHIDE_LIBS)
+RHIDE_COMPILE_C=$(RHIDE_GCC) -c $(CFLAGS) $(INCLUDE_DIRS) -Fo$(OUTFILE) \
+ $(SOURCE_NAME)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) -c $(CXXFLAGS) $(INCLUDE_DIRS) -Fo$(OUTFILE) \
+ $(SOURCE_NAME)
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) obj
+# The command line capacity isn't enough for this:
+#RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) /OUT:$(OUTFILE) \
+# $(ALL_PREREQ)
+# This is fake, the .S files are used only for DJGPP and they are protected
+# by preprocessor constructions. For this reason they can be used as C sources
+# to generate dummy .obj files.
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_GCC) -c $(CFLAGS) /TC $(INCLUDE_DIRS) -Fo$(OUTFILE) \
+ $(SOURCE_NAME)
+
+SOURCE_NAME=$**
+OUTFILE=$@
+ALL_PREREQ=$**
+
+#LIB_DIRS=$(RHIDE_OS_LIBS_PATH) -L.
+
+mlink.exe:: mlink.c
+ $(RHIDE_GCC) $(CFLAGS) kernel32.lib $(ALL_PREREQ) /link /OUT:$(OUTFILE)
+
diff --git a/tvision/makes/common.wat b/tvision/makes/common.wat
new file mode 100644
index 0000000..c5212ff
--- /dev/null
+++ b/tvision/makes/common.wat
@@ -0,0 +1,54 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2005 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+# For Open Watcom. NOT TESTED PLEASE HELP ME TO FIX IT.
+# This file contains the definitions needed to compile and link the rules
+# found in .umk files.
+# The definitions are used by all the makefiles.
+#
+
+#
+# That configure the compilation and linking options.
+# Is equivalent to rhide.env.
+#
+!ifdef CONFIG_PATH
+# To avoid usig -I....
+!include $(CONFIG_PATH)/config.wat
+!else
+!include config.wat
+!endif
+
+# Turn off the implicit rule to generate .obj files from .c files.
+# If we don't do it make will use both rules.
+.c.obj:
+
+HELPER_TARGET=
+# These files changes the compilation process so they are important
+# dependencies.
+MAKEFILE_DEPS=
+# Extensions used by Watcom tools
+ExOBJ=.obj
+ExEXE=.exe
+ExLIB=.dll
+
+SOURCE_NAME=$[@
+OUTFILE=$^@
+ALL_PREREQ=$<
+
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(LDFLAGS) NAME $(OUTFILE) \
+ FILE { $(OBJECTS) $(LIBRARIES) $(RHIDE_LIBS) }
+RHIDE_COMPILE_C=$(RHIDE_GCC) -zq -fo=$(OUTFILE) $(CFLAGS) $(INCLUDE_DIRS) $(SOURCE_NAME)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) -zq -fo=$(OUTFILE) $(CFLAGS) $(INCLUDE_DIRS) $(SOURCE_NAME)
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) name $(OUTFILE) \
+ file { $(OBJFILES) }
+# Special postprocessing: create the import library
+RHIDE_POST_ARCHIVE=wlib -q -n -b librhtv.lib +librhtv.dll
+# This is fake, the .S files are used only for DJGPP and they are protected
+# by preprocessor constructions. For this reason they can be used as C sources
+# to generate dummy .obj files.
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_GCC) -c $(CFLAGS) /TC $(INCLUDE_DIRS) -Fo$(OUTFILE) \
+ $(SOURCE_NAME)
+
+
diff --git a/tvision/makes/config.bcc b/tvision/makes/config.bcc
new file mode 100644
index 0000000..46a9293
--- /dev/null
+++ b/tvision/makes/config.bcc
@@ -0,0 +1,36 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# This file contains the definitions that configures the compilation.
+# They include the C and C++ options and linker options.
+# I used BC++ 5.5 free command line tools for testing.
+#
+
+!ifdef DEBUG
+CDEBUGFLAGS = -v -vi -y -6 -Od
+!else
+CDEBUGFLAGS = -O2 -6 -T -DNDEBUG
+!endif
+
+!ifdef DYNRTL
+DYNRTLDFLAGS = -WR
+!endif
+
+CFLAGS = -w-aus -w-ccc -a8 $(DYNRTLDFLAGS) -WC -X -q $(CDEBUGFLAGS)
+# Note: rch == Unreachable code. BC++ 5.5 is idiot to detect code that is
+# disabled on purpose. i.e. if (0) ...
+CXXFLAGS = -P -RT- -w-hid -w-par -w-rch $(CFLAGS)
+LDFLAGS = $(DYNRTLDFLAGS) -WC
+
+RHIDE_GCC=bcc32
+RHIDE_GXX=bcc32
+RHIDE_LD=bcc32
+
+# Sets the variables for the sub-makes
+EXTRALIB_MAKE_ARGS=_SUBMAKE=1 CC="$(RHIDE_GCC)" LD="$(RHIDE_LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -f Makefile.bcc
+
+MK_EXT=.bcc
+MKF_EXT=.bmk
+
diff --git a/tvision/makes/config.nmk b/tvision/makes/config.nmk
new file mode 100644
index 0000000..73d0088
--- /dev/null
+++ b/tvision/makes/config.nmk
@@ -0,0 +1,33 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# This file contains the definitions that configures the compilation.
+# They include the C and C++ options and linker options.
+#
+
+!ifdef DEBUG
+# Options to debug
+CFLAGS = /nologo -D_WIN32 -DFOR_EDITOR /EHsc -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE /Zi
+LDFLAGS = /DEBUG
+!else
+# Options for optimization (production)
+CFLAGS = /nologo -O2 -D_WIN32 -DFOR_EDITOR /EHsc -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE
+# Note: /GX is deprecated, not sure if needed for old versions
+#CFLAGS = /nologo -O2 -D_WIN32 -DFOR_EDITOR /GX -D_USE_32BIT_TIME_T
+#CFLAGS = /nologo -O2 -D_WIN32 -DFOR_EDITOR /GR- /GX-
+LDFLAGS = /verbose
+!endif
+CXXFLAGS = /TP $(CFLAGS)
+
+RHIDE_GCC=cl
+RHIDE_GXX=cl
+RHIDE_LD=link
+
+# Sets the variables for the sub-makes
+EXTRALIB_MAKE_ARGS=_SUBMAKE=1 CC="$(RHIDE_GCC)" LD="$(RHIDE_LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -f Makefile.nmk
+
+MK_EXT=.nmk
+MKF_EXT=.nmk
+
diff --git a/tvision/makes/config.wat b/tvision/makes/config.wat
new file mode 100644
index 0000000..3be1cfd
--- /dev/null
+++ b/tvision/makes/config.wat
@@ -0,0 +1,53 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2005 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# This file contains the definitions that configures the compilation.
+# They include the C and C++ options and linker options.
+#
+
+WATCOM_CC=-DWINDOWS -DCLY_DLL -D_WIN32 -bt=nt -mf
+
+INCLUDE_DIRS=-I. -I$(WATCOM)\h -I$(WATCOM)\h\nt -I..\winnt\include -I..\winnt\include\msvc -I$(INCLUDE_DIR)
+
+WATCOM_WARN=-w3
+WATCOM_OPTIMIZE=-otexan
+WATCOM_RELAX_ALIAS=#-oa
+WATCOM_ERRCOUNT=-e25
+WATCOM_QUIET=-zq
+WATCOM_CALLING_CONV=-5r #-zz
+WATCOM_DLLTARGET=-bd
+WATCOM_LIBTARGET=
+WATCOM_THREAD_MODEL=#-bm
+WATCOM_STDDEBUG=-d2 -hd #-DDEBUG_MALLOC
+WATCOM_STACK=
+
+!ifdef DEBUG
+# Options to debug
+CFLAGS = $(WATCOM_CC) $(WATCOM_WARN) $(WATCOM_ERRCOUNT) $(WATCOM_QUIET) $(WATCOM_OPTIMIZE) \
+ $(WATCOM_RELAX_ALIAS) $(WATCOM_THREAD_MODEL) $(WATCOM_CALLING_CONV) \
+ $(WATCOM_STACK) $(WATCOM_DLLTARGET) $(WATCOM_STDDEBUG)
+!else
+# Options for optimization (production)
+CFLAGS = $(WATCOM_CC) $(WATCOM_WARN) $(WATCOM_ERRCOUNT) $(WATCOM_QUIET) $(WATCOM_OPTIMIZE) \
+ $(WATCOM_RELAX_ALIAS) $(WATCOM_THREAD_MODEL) $(WATCOM_CALLING_CONV) \
+ $(WATCOM_STACK) $(WATCOM_DLLTARGET)
+LDFLAGS =
+!endif
+#LDFLAGS = $(CFLAGS) -bt=nt -mf
+LDFLAGS = op q op symf d dwarf
+CXXFLAGS = $(CFLAGS)
+
+RHIDE_GCC=wcc386
+RHIDE_GXX=wpp386
+RHIDE_LD=wlink
+RHIDE_AR=wlink
+RHIDE_ARFLAGS=SYS nt_dll op m op maxe=25 op q op symf op caseexact d dwarf
+
+# Sets the variables for the sub-makes
+EXTRALIB_MAKE_ARGS=_SUBMAKE=1 CC="$(RHIDE_GCC)" LD="$(RHIDE_LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -f Makefile.wat
+
+MK_EXT=.wat
+MKF_EXT=.wat
+
diff --git a/tvision/makes/extrimk.cc b/tvision/makes/extrimk.cc
new file mode 100644
index 0000000..53c76b2
--- /dev/null
+++ b/tvision/makes/extrimk.cc
@@ -0,0 +1,879 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003-2004 by Salvador Eduardo Tropea.
+ Covered by the GPL license.
+ Description:
+ This program generates a .imk file containing the dependencies for a
+project.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <limits.h>
+#include <unistd.h>
+#include <time.h>
+#include <ctype.h>
+
+#define ONE_DEP_BY_LINE 1
+
+const int maxLine=1024;
+unsigned maxCol=78;
+
+struct node;
+static char *projectBase;
+static int projectBaseL;
+static int IncludeCounter=0;
+
+struct stMak
+{
+ node *base, *last;
+ char *objDir;
+ char *mainTarget;
+ char *baseDir;
+};
+
+struct node
+{
+ char *name;
+ node *deps;
+ node *ldep;
+ node *next;
+ stMak *subprj;
+};
+
+struct stIncDir
+{
+ char *var;
+ char *dir;
+ int ldir;
+};
+
+stIncDir incDirs[]=
+{
+{"INCLUDE_DIR", "../include", 0},
+{"CLASSES_DIR", "../classes", 0},
+{"EXTRA_SRC_DIR", "..", 0},
+{0,0}
+};
+
+char *srcDirs[]=
+{
+ "../classes",
+ "../classes/dos",
+ "../classes/linux",
+ "../classes/qnx4",
+ "../classes/qnxrtp",
+ "../classes/unix",
+ "../classes/win32",
+ "../classes/wingr",
+ "../classes/winnt",
+ "../classes/x11",
+ "../names",
+ "../stream",
+ "../compat",
+ "..",
+ NULL
+};
+
+static
+void AddFileName(const char *name, stMak &mk)
+{
+ //printf("`%s'\n",name);
+ if (mk.base)
+ {
+ mk.last->next=new node;
+ mk.last=mk.last->next;
+ }
+ else
+ mk.base=mk.last=new node;
+ mk.last->name=strdup(name);
+ mk.last->next=mk.last->deps=mk.last->ldep=NULL;
+ mk.last->subprj=NULL;
+}
+
+static
+int PrConvertExt(FILE *d, const char *file)
+{
+ char *s=strrchr(file,'.');
+ if (!s)
+ return fprintf(d,"%s",file);
+ int l=s-file;
+ fwrite(file,l,1,d);
+ if (strcmp(s,".o")==0)
+ l+=fprintf(d,"$(ExOBJ)");
+ else if (strcmp(s,".exe")==0)
+ l+=fprintf(d,"$(ExEXE)");
+ else if (strcmp(s,".a")==0)
+ l+=fprintf(d,"$(ExLIB)");
+ else if (strcmp(s,".env")==0)
+ l+=fprintf(d,".env");
+ else if (strcmp(s,".imk")==0)
+ l+=fprintf(d,".imk");
+ else if (strcmp(s,".h")==0)
+ l+=fprintf(d,".h");
+ else if (strcmp(s,".c")==0)
+ l+=fprintf(d,".c");
+ else if (strcmp(s,".cc")==0)
+ l+=fprintf(d,".cc");
+ else if (strcmp(s,".cpp")==0)
+ l+=fprintf(d,".cpp");
+ else
+ {
+ fprintf(stderr,"Unknown extension: '%s'\n",s);
+ exit(15);
+ }
+ return l;
+}
+
+static
+void ExtractSources(FILE *f, stMak &mk)
+{
+ char buffer[maxLine];
+ char found=0;
+ do
+ {
+ if (fgets(buffer,maxLine,f))
+ if (strncmp(buffer,"PROJECT_ITEMS",13)==0)
+ {
+ found=1;
+ break;
+ }
+ }
+ while (!feof(f));
+ if (!found)
+ {
+ fprintf(stderr,"Can't find project items\n");
+ exit(1);
+ }
+ char *s=buffer+14;
+ do
+ {
+ char *fName=strtok(s," \t\\\n");
+ while (fName)
+ {
+ if (*fName)
+ AddFileName(fName,mk);
+ fName=strtok(NULL," \t\\\n");
+ }
+ fgets(buffer,maxLine,f);
+ s=buffer;
+ }
+ while (!feof(f) && buffer[0]=='\t');
+}
+
+static
+void AddDependency(const char *name, node *p)
+{
+ node *nNode=new node;
+ nNode->next=NULL;
+ if (p->deps)
+ {
+ node *r=p->deps, *a=NULL;
+ // Force the list to be sorted, it reduces the output of diff
+ while (r && strcmp(r->name,name)<0)
+ {
+ a=r;
+ r=r->next;
+ }
+ if (!r)
+ {// @ the end
+ p->ldep->next=nNode;
+ p->ldep=nNode;
+ }
+ else if (!a) // @ the beggining
+ {
+ nNode->next=p->deps;
+ p->deps=nNode;
+ }
+ else // in the middle
+ {
+ a->next=nNode;
+ nNode->next=r;
+ }
+ }
+ else
+ p->deps=p->ldep=nNode;
+ nNode->name=strdup(name);
+ nNode->deps=nNode->ldep=NULL;
+ nNode->subprj=NULL;
+}
+
+static
+void ExtractDeps(FILE *f, node *p)
+{
+ char buffer[maxLine];
+ char bName[maxLine];
+ char found=0;
+ int depNum;
+ do
+ {
+ if (fgets(buffer,maxLine,f) &&
+ sscanf(buffer,"DEPS_%d=%s ",&depNum,bName)==2 &&
+ depNum)
+ {
+ if (strcmp(bName,p->name))
+ {
+ fprintf(stderr,"Error: unsorted deps? (%d,%s looking for %s)\n",depNum,bName,
+ p->name);
+ exit(2);
+ }
+ found=1;
+ break;
+ }
+ }
+ while (!feof(f));
+ if (!found)
+ {
+ fprintf(stderr,"Failed to find %s dependencies\n",p->name);
+ exit(3);
+ }
+ char *s=strchr(buffer,'=')+1+strlen(p->name);
+ do
+ {
+ char *fName=strtok(s," \t\\\n");
+ while (fName)
+ {
+ if (*fName)
+ AddDependency(fName,p);
+ fName=strtok(NULL," \t\\\n");
+ }
+ fgets(buffer,maxLine,f);
+ s=buffer;
+ }
+ while (!feof(f) && buffer[0]=='\t');
+}
+
+static
+int PrintDep(FILE *d, int l, const char *s)
+{
+ if (ONE_DEP_BY_LINE)
+ {
+ fputs("\\\n\t",d);
+ l=8+PrConvertExt(d,s)+1;
+ fputc(' ',d);
+ }
+ else
+ {
+ if (l+strlen(s)+2>maxCol)
+ {
+ fputs("\\\n\t",d);
+ l=8;
+ }
+ l+=PrConvertExt(d,s)+1;
+ fputc(' ',d);
+ }
+ return l;
+}
+
+static
+int PrintDepDir(FILE *d, int l, const char *s,int lenDir, const char *dir)
+{
+ if (ONE_DEP_BY_LINE)
+ {
+ fputs("\\\n\t",d);
+ l=8+fprintf(d,"%s/",dir)+PrConvertExt(d,s)+1;
+ fputc(' ',d);
+ }
+ else
+ {
+ if (l+strlen(s)+3+lenDir>maxCol)
+ {
+ fputs("\\\n\t",d);
+ l=8;
+ }
+ l+=fprintf(d,"%s/",dir)+PrConvertExt(d,s)+1;
+ fputc(' ',d);
+ }
+ return l;
+}
+
+static
+int AddFixedDeps(FILE *d, int l)
+{
+ //l=PrintDep(d,l,"rhide.env");
+ //l=PrintDep(d,l,"common.imk");
+ l=PrintDep(d,l,"$(MAKEFILE_DEPS)");
+ return l;
+}
+
+static
+char *SearchSrc(char *toStat)
+{
+ struct stat st;
+ if (stat(toStat,&st))
+ {
+ int i;
+ char buf[PATH_MAX];
+ for (i=0; srcDirs[i]; i++)
+ {
+ strcpy(buf,srcDirs[i]);
+ strcat(buf,"/");
+ strcat(buf,toStat);
+ if (stat(buf,&st)==0)
+ return strdup(buf);
+ }
+ }
+ return toStat;
+}
+
+static
+int IsAbsolute(const char *s)
+{
+ #if defined(__DJGPP__)
+ return *s=='/' || (isalpha(*s) && s[1]==':');
+ #else
+ return *s=='/';
+ #endif
+}
+
+static
+void GenerateDepFor(node *p, FILE *d, stMak &mk)
+{
+ char *baseName=strdup(p->name);
+ char *s=strrchr(baseName,'.');
+ char *ext=s+1;
+ *s=0;
+
+ // Already compiled item?
+ if (strcmp(ext,"o")==0 || strcmp(ext,"a")==0)
+ return;
+
+ int isExample=mk.baseDir && strstr(mk.baseDir,"example"), l;
+ if (isExample)
+ {
+ l=fprintf(d,"%s/%s$(ExOBJ):: %s ",mk.objDir,baseName,p->name);
+ }
+ else
+ {
+ char *relName=SearchSrc(p->name);
+ l=fprintf(d,"%s/%s$(ExOBJ):: %s ",mk.objDir,baseName,relName);
+ if (relName!=p->name)
+ free(relName);
+ }
+ node *c=p->deps;
+ int isCompat=mk.baseDir && strstr(mk.baseDir,"compat");
+ while (c)
+ {
+ s=c->name;
+ if (strstr(s,p->name)!=NULL)
+ {// RHIDE 1.5 duplicates the source as dependency
+ c=c->next;
+ continue;
+ }
+ char *toStat;
+ struct stat st;
+
+ if (mk.baseDir && !isCompat && !IsAbsolute(s))
+ {
+ toStat=new char[strlen(mk.baseDir)+strlen(s)+1];
+ strcpy(toStat,mk.baseDir);
+ strcat(toStat,s);
+ }
+ else
+ toStat=strdup(s);
+ int foundOnVPath=0;
+ if (stat(toStat,&st))
+ {
+ //fprintf(stderr,"Buscando %s\n",toStat);
+ // RHIDE 1.5 CVS filters the VPATH part, now I added it to common.imk.
+ int i;
+ char buf[PATH_MAX];
+ for (i=0; !foundOnVPath && incDirs[i].var; i++)
+ {
+ strcpy(buf,incDirs[i].dir);
+ strcat(buf,"/");
+ strcat(buf,toStat);
+ if (stat(buf,&st)==0)
+ foundOnVPath=1;
+ }
+ for (i=0; !foundOnVPath && srcDirs[i]; i++)
+ {
+ strcpy(buf,srcDirs[i]);
+ strcat(buf,"/");
+ strcat(buf,toStat);
+ if (stat(buf,&st)==0)
+ foundOnVPath=1;
+ }
+ if (!foundOnVPath)
+ {
+ fprintf(stderr,"Can't stat %s dependency\n",toStat);
+ exit(12);
+ }
+ }
+ free(toStat);
+ if (!foundOnVPath)
+ {
+ int i;
+ if (strchr(s,'/'))
+ {
+ for (i=0; incDirs[i].var; i++)
+ if (strncmp(s,incDirs[i].dir,incDirs[i].ldir)==0)
+ {
+ s=(char *)malloc(3+strlen(incDirs[i].var)+1+strlen(s+incDirs[i].ldir));
+ sprintf(s,"$(%s)%s",incDirs[i].var,c->name+incDirs[i].ldir);
+ break;
+ }
+ if (s==c->name)
+ {
+ // This is some bug in RHIDE 1.5 CVS: some paths are emitted as absolute,
+ // maybe is because the program is loading an old project.
+ if (strncmp(s,projectBase,projectBaseL)==0)
+ {
+ char *sub=s+projectBaseL;
+ char *toTest=(char *)malloc(strlen(sub)+3+1);
+ sprintf(toTest,"../%s",sub);
+ for (i=0; incDirs[i].var; i++)
+ if (strncmp(toTest,incDirs[i].dir,incDirs[i].ldir)==0)
+ {
+ s=(char *)malloc(3+strlen(incDirs[i].var)+1+strlen(toTest+incDirs[i].ldir));
+ sprintf(s,"$(%s)%s",incDirs[i].var,toTest+incDirs[i].ldir);
+ //fprintf(stderr,"%s Da: %s\n",c->name,s);
+ break;
+ }
+ free(toTest);
+ }
+ if (s==c->name)
+ {
+ fprintf(stderr,"Unknown include dir: %s\n",c->name);
+ exit(4);
+ }
+ }
+ }
+ }
+ l=PrintDep(d,l,s);
+ if (s!=c->name)
+ free(s);
+ c=c->next;
+ }
+ l=AddFixedDeps(d,l);
+ fputc('\n',d);
+ if (strcmp(ext,"c")==0)
+ fputs("\t$(RHIDE_COMPILE_C)",d);
+ else if (strcmp(ext,"cc")==0)
+ fputs("\t$(RHIDE_COMPILE_CC)",d);
+ else if (strcmp(ext,"cpp")==0)
+ fputs("\t$(RHIDE_COMPILE_CC)",d);
+ else if (strcmp(ext,"s")==0)
+ fputs("\t$(RHIDE_COMPILE_ASM_FORCE)",d);
+ else
+ {
+ fprintf(stderr,"\nUnknown extension `%s'\n",ext);
+ exit(5);
+ }
+ fputs("\n\n",d);
+ free(baseName);
+}
+
+static
+int ExtractVar(FILE *f, const char *var, char *&dest, char ret)
+{
+ char buffer[maxLine];
+ int l=strlen(var);
+ do
+ {
+ if (fgets(buffer,maxLine,f))
+ {
+ if (strncmp(buffer,var,l)==0)
+ {
+ char *s=strtok(buffer+l+1,"\n");
+ dest=s ? strdup(s) : strdup("");
+ return 1;
+ }
+ else
+ {
+ if (strncmp(buffer,"include",7)==0)
+ {
+ char *s=strtok(buffer+8,"\n");
+ FILE *inc=fopen(s,"rt");
+ if (!inc)
+ {
+ fprintf(stderr,"Can't open include %s\n",s);
+ exit(13);
+ }
+ int retVal=ExtractVar(inc,var,dest,1);
+ fclose(inc);
+ if (retVal)
+ return 1;
+ }
+ }
+ }
+ }
+ while (!feof(f));
+ if (ret)
+ return 0;
+ fprintf(stderr,"Unable to find %s var\n",var);
+ exit(7);
+}
+
+static
+void ExtractObjDir(FILE *f, stMak &mk)
+{
+ mk.objDir=".";
+ ExtractVar(f,"vpath_obj",mk.objDir,1);
+}
+
+/*static
+void ExtractTVDir(FILE *f)
+{
+ if (incDirs[0].dir)
+ return;
+ ExtractVar(f,"TVISION_INC",incDirs[0].dir,0);
+}*/
+
+static
+void ExtractTarget(FILE *f, stMak &mk)
+{
+ ExtractVar(f,"MAIN_TARGET",mk.mainTarget,0);
+}
+
+static
+int CollectTargets(FILE *d, const char *name, stMak &mk, int l);
+
+static
+int ListTargetItems(FILE *d, int l, stMak &mk)
+{
+ node *p=mk.base;
+ int lenObjDir=strlen(mk.objDir);
+ while (p)
+ {
+ if (strstr(p->name,".gpr")==NULL)
+ {
+ char *s=strdup(p->name);
+ char *ext=strrchr(s,'.');
+ if (strcmp(ext,".o")==0 || strcmp(ext,".a")==0)
+ {
+ l=PrintDep(d,l,s);
+ }
+ else
+ {
+ strcpy(ext,".o");
+ l=PrintDepDir(d,l,s,lenObjDir,mk.objDir);
+ }
+ free(s);
+ }
+ else
+ {
+ l=CollectTargets(d,p->name,*p->subprj,l);
+ }
+ p=p->next;
+ }
+ return l;
+}
+
+static
+int CollectTargets(FILE *d, const char *name, stMak &mk, int l)
+{
+ if (mk.mainTarget && *mk.mainTarget)
+ {// Simple, it have a lib
+ l=PrintDep(d,l,mk.mainTarget);
+ }
+ else
+ {// More complex
+ l=ListTargetItems(d,l,mk);
+ }
+ return l;
+}
+
+static
+void GenerateTarget(FILE *d, stMak &mk)
+{
+ if (!*mk.mainTarget)
+ return;
+ int l=PrConvertExt(d,mk.mainTarget)+3;
+ fputs(":: ",d);
+ l=ListTargetItems(d,l,mk);
+ l=AddFixedDeps(d,l);
+ char *ext=strrchr(mk.mainTarget,'.');
+ if (ext) ext++; else ext="exe";
+ fputc('\n',d);
+ if (strcmp(ext,"exe")==0)
+ fputs("\t$(RHIDE_COMPILE_LINK)",d);
+ else if (strcmp(ext,"a")==0)
+ fputs("\t$(RHIDE_COMPILE_ARCHIVE)",d);
+ else
+ {
+ fprintf(stderr,"\nUnknown extension `%s'\n",ext);
+ exit(8);
+ }
+ fputs("\n\n",d);
+}
+
+static
+void GenerateAll(FILE *f, stMak &mk)
+{
+ GenerateTarget(f,mk);
+ node *p=mk.base;
+ while (p)
+ {
+ if (p->subprj)
+ {
+ if (0)
+ GenerateAll(f,*p->subprj);
+ else
+ {
+ char *s=strdup(p->name);
+ // This is some bug in RHIDE 1.5 CVS: some paths are emitted as absolute,
+ // maybe is because the program is loading an old project.
+ if (strncmp(s,projectBase,projectBaseL)==0)
+ {
+ char *sub=s+projectBaseL;
+ char *toTest=(char *)malloc(strlen(sub)+3+1);
+ sprintf(toTest,"../%s",sub);
+ free(s);
+ s=toTest;
+ }
+ char *ext=strrchr(s,'.');
+ *ext=0;
+ fprintf(f,"INCLUDE%02d=%s$(ExIMK)\n\n",IncludeCounter++,s);
+ free(s);
+ }
+ }
+ else
+ GenerateDepFor(p,f,mk);
+ p=p->next;
+ }
+}
+
+static
+int ListTargetOItems(FILE *d, int l, stMak &mk)
+{
+ node *p=mk.base;
+ int lenObjDir=strlen(mk.objDir);
+ while (p)
+ {
+ if (strstr(p->name,".gpr")==NULL)
+ {
+ char *ext=strrchr(p->name,'.');
+ if (strcmp(ext,".a"))
+ {
+ char *s=strdup(p->name);
+ if (strcmp(ext,".o"))
+ strcpy(strrchr(s,'.'),".o");
+ l=PrintDepDir(d,l,s,lenObjDir,mk.objDir);
+ free(s);
+ }
+ }
+ else
+ {
+ if (!p->subprj->mainTarget || !*p->subprj->mainTarget)
+ l=ListTargetOItems(d,l,*p->subprj);
+ }
+ p=p->next;
+ }
+ return l;
+}
+
+static
+void CollectOTargets(FILE *d, const char *name, stMak &mk)
+{
+
+}
+
+
+static
+void GenerateObjs(FILE *f, stMak &mk)
+{
+ int l=fprintf(f,"OBJFILES=");
+ ListTargetOItems(f,l,mk);
+ fputs("\n\n",f);
+}
+
+static
+int ListTargetAItems(FILE *d, int l, stMak &mk)
+{
+ node *p=mk.base;
+ if (mk.mainTarget && *mk.mainTarget)
+ {
+ l=PrintDep(d,l,mk.mainTarget);
+ }
+ else
+ {
+ while (p)
+ {
+ if (p->subprj)
+ ListTargetAItems(d,l,*p->subprj);
+ else
+ {
+ char *ext=strrchr(p->name,'.');
+ if (strcmp(ext,".a")==0)
+ l=PrintDep(d,l,p->name);
+ }
+ p=p->next;
+ }
+ }
+ return l;
+}
+
+static
+void GenerateLibs(FILE *f, stMak &mk)
+{
+ int l=fprintf(f,"LIBRARIES=");
+ node *p=mk.base;
+ while (p)
+ {
+ if (p->subprj)
+ l=ListTargetAItems(f,l,*p->subprj);
+ else
+ {
+ char *ext=strrchr(p->name,'.');
+ if (strcmp(ext,".a")==0)
+ l=PrintDep(f,l,p->name);
+ }
+ p=p->next;
+ }
+ fputs("\n\n",f);
+}
+
+static
+void ExtractBaseDir(const char *mak, stMak &mk)
+{
+ char *s=strrchr(mak,'/');
+ if (s)
+ {
+ int l=s-mak+1;
+ mk.baseDir=new char[l+1];
+ memcpy(mk.baseDir,mak,l);
+ mk.baseDir[l]=0;
+ }
+}
+
+static
+void ProcessMakefile(const char *mak, stMak &mk, int level)
+{
+ //printf("\n\n\nParsing %s makefile\n\n\n",mak);
+ ExtractBaseDir(mak,mk);
+ FILE *f;
+ f=fopen(mak,"rt");
+ if (!f)
+ {
+ fprintf(stderr,"Can't open %s\n",mak);
+ exit(8);
+ }
+ ExtractObjDir(f,mk);
+ fseek(f,0,SEEK_SET);
+ long pos=ftell(f);
+ ExtractTarget(f,mk);
+ ExtractSources(f,mk);
+ // RHIDE 1.4.7 have a different order than 1.4.9 and 1.5
+ fseek(f,pos,SEEK_SET);
+ //ExtractTVDir(f);
+ int i;
+ if (!incDirs[0].ldir)
+ for (i=0; incDirs[i].var; i++)
+ incDirs[i].ldir=strlen(incDirs[i].dir);
+ node *p;
+ //printf("Should dig:\n");
+ p=mk.base;
+ while (p)
+ {
+ char *s=strstr(p->name,".gpr");
+ if (s)
+ {
+ //printf("%s\n",p->name);
+ p->subprj=new stMak;
+ memset(p->subprj,0,sizeof(stMak));
+ char *subMak=strdup(p->name);
+ s=strstr(subMak,".gpr");
+ strcpy(s,".mak");
+ ProcessMakefile(subMak,*p->subprj,level+1);
+ free(subMak);
+ }
+ p=p->next;
+ }
+ p=mk.base;
+ while (p)
+ {
+ char *ext=strrchr(p->name,'.');
+ if (strcmp(ext,".gpr") && strcmp(ext,".a") && strcmp(ext,".o"))
+ ExtractDeps(f,p);
+ p=p->next;
+ }
+ // Generation
+ if (level)
+ return;
+
+ char timeBuf[32];
+ time_t now;
+ time(&now);
+ struct tm *brkT=localtime(&now);
+ strftime(timeBuf,32,"%Y-%m-%d %H:%M",brkT);
+ //fprintf(stdout,"#!/usr/bin/make\n# Automatically generated from RHIDE projects, don't edit\n# %s\n#\n\n",timeBuf);
+ // Don't know why I needed the time, so I'm disabling it.
+ fprintf(stdout,"#!/usr/bin/make\n# Automatically generated from RHIDE projects, don't edit\n#\n\n");
+
+ // Write the body to a temporal
+ char bNameT[12];
+ strcpy(bNameT,"mkXXXXXX");
+ int hT=mkstemp(bNameT);
+ FILE *fT=fdopen(hT,"wt");
+ if (hT==-1 || !fT)
+ {
+ fprintf(stderr,"Unable to create temporal\n");
+ exit(31);
+ }
+ GenerateAll(fT,mk);
+ fclose(fT);
+
+ // Write the variables now
+ if (mk.mainTarget && *mk.mainTarget)
+ {
+ char *ext=strrchr(mk.mainTarget,'.');
+ if (!ext) ext=".exe";
+ if (strcmp(ext,".a")==0 || strcmp(ext,".exe")==0)
+ {
+ GenerateObjs(stdout,mk);
+ GenerateLibs(stdout,mk);
+ }
+ }
+
+ // Now copy the body
+ fT=fopen(bNameT,"rt");
+ if (!fT)
+ {
+ fprintf(stderr,"Unable to copy temporal\n");
+ exit(32);
+ }
+ char buffer[maxLine];
+ while (!feof(fT))
+ {
+ if (fgets(buffer,maxLine,fT))
+ fputs(buffer,stdout);
+ }
+ fclose(fT);
+ unlink(bNameT);
+}
+
+static
+void SetUpCurDir()
+{
+ char buf[PATH_MAX];
+ getcwd(buf,PATH_MAX);
+ char *mk=strstr(buf,"/makes");
+ if (!mk)
+ {
+ fprintf(stderr,"We aren't in make directory\n");
+ exit(30);
+ }
+ mk[1]=0;
+ projectBase=strdup(buf);
+ projectBaseL=strlen(projectBase);
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc!=2)
+ {
+ printf("Usage: %s file.mak\n",argv[0]);
+ return 1;
+ }
+ stMak mak;
+ memset(&mak,0,sizeof(mak));
+ SetUpCurDir();
+ ProcessMakefile(argv[1],mak,0);
+ //ExtractSources();
+ return 0;
+}
+
diff --git a/tvision/makes/genimk.cc b/tvision/makes/genimk.cc
new file mode 100644
index 0000000..8b465d4
--- /dev/null
+++ b/tvision/makes/genimk.cc
@@ -0,0 +1,193 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador Eduardo Tropea
+ Covered by the GPL license.
+ Description:
+ This program generates the .imk files from the .gpr files. To achieve it
+first creates the .mak files and then calls the extrimk.exe program.
+ It also generates a simplified version called .umk without extra
+dependencies, just the needed to get the executables.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <ctype.h>
+
+const int maxLine=256;
+
+static
+void ChangeExt(char *s, const char *newE)
+{
+ int l=strlen(s);
+ int lE=strlen(newE);
+ strcpy(s+(l-lE),newE);
+}
+
+// Needed to force a make of the wrong files.
+static
+void RemoveGen(int argc, char *argv[])
+{
+ int i;
+
+ for (i=2; i<argc; i++)
+ {
+ if (strstr(argv[i],".gpr"))
+ {
+ char *gpr=argv[i];
+ char *imk=strdup(gpr);
+ char *umk=strdup(gpr);
+ ChangeExt(imk,".imk");
+ ChangeExt(umk,".umk");
+ unlink(imk);
+ unlink(umk);
+ free(imk);
+ free(umk);
+ }
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc<3)
+ {
+ printf("Usage: genimk output main.gpr [other.gprs...]\n");
+ return 1;
+ }
+ const char *dest=argv[1];
+ const char *mainGpr=argv[2];
+ char *mainMak=strdup(mainGpr);
+ ChangeExt(mainMak,".mak");
+ printf("\nGenerating %s for %s (%s)\n",dest,mainGpr,mainMak);
+
+ int i;
+ unsigned lenTot=20;
+ for (i=0; i<argc; i++)
+ lenTot+=2+strlen(argv[i]);
+
+ char *b=new char[lenTot];
+ for (i=2; i<argc; i++)
+ {
+ if (strstr(argv[i],".gpr"))
+ {
+ char *gpr=argv[i];
+ char *mak=strdup(gpr);
+ ChangeExt(mak,".mak");
+
+ struct stat stGpr;
+ if (stat(gpr,&stGpr)!=0)
+ {
+ fprintf(stderr,"%s: Can't stat %s\n",argv[0],gpr);
+ return 20;
+ }
+
+ struct stat stMak;
+ if (stat(mak,&stMak)!=0 || stMak.st_mtime<stGpr.st_mtime)
+ {
+ printf("%s => %s\n",gpr,mak);
+ sprintf(b,"gprexp %s",gpr);
+ system(b);
+ sprintf(b,"gpr2mak %s",gpr);
+ system(b);
+ if (stat(mak,&stMak)!=0)
+ {
+ fprintf(stderr,"%s: Can't create .mak file for %s\n",argv[0],gpr);
+ return 21;
+ }
+ }
+
+ free(mak);
+ }
+ }
+ for (i=2; i<argc; i++)
+ {
+ if (strstr(argv[i],".gpr"))
+ {
+ char *gpr=argv[i];
+ char *mak=strdup(gpr);
+ char *imk=strdup(gpr);
+ char *umk=strdup(gpr);
+ ChangeExt(mak,".mak");
+ ChangeExt(imk,".imk");
+ ChangeExt(umk,".umk");
+
+ struct stat stImk;
+ printf("%s => %s\n",mak,imk);
+ sprintf(b,"./extrimk.exe %s > %s",mak,imk);
+ int ret=system(b);
+ if (ret)
+ {
+ RemoveGen(argc,argv);
+ return ret>256 ? ret>>8 : ret;
+ }
+ if (stat(mak,&stImk)!=0)
+ {
+ RemoveGen(argc,argv);
+ fprintf(stderr,"%s: Can't create .imk file for %s\n",argv[0],mak);
+ return 22;
+ }
+
+ printf("%s => %s\n",imk,umk);
+ FILE *ori=fopen(imk,"rt");
+ if (!ori)
+ {
+ RemoveGen(argc,argv);
+ fprintf(stderr,"%s: Can't open .imk file for %s\n",argv[0],mak);
+ return 23;
+ }
+ FILE *des=fopen(umk,"wt");
+ if (!des)
+ {
+ RemoveGen(argc,argv);
+ fprintf(stderr,"%s: Can't create .umk file for %s\n",argv[0],mak);
+ return 24;
+ }
+ char b[maxLine], *sep;
+ int skip=0;
+ while (fgets(b,maxLine,ori))
+ {
+ if ((isalpha(b[0]) || b[0]=='.') && (sep=strchr(b,':'))!=0)
+ {
+ char *ext=sep-1;
+ for (;*ext!='$' && ext>b; ext--);
+ if (*ext!='$')
+ {
+ fprintf(stderr,"%s: Parser error (ext): %s\n",argv[0],b);
+ RemoveGen(argc,argv);
+ return 25;
+ }
+ if (ext[4]=='O')
+ {// That's an object, only the first is relevant.
+ for (;*sep && *sep!='\\'; sep++);
+ if (*sep) *sep=' ';
+ skip=1;
+ fputs(b,des);
+ continue;
+ }
+ }
+ if (skip)
+ {
+ char *slash=b;
+ for (;*slash && *slash!='\\'; slash++);
+ if (!*slash)
+ skip=0;
+ }
+ else
+ fputs(b,des);
+ }
+ fclose(des);
+ fclose(ori);
+
+ free(mak);
+ free(imk);
+ free(umk);
+ }
+ }
+
+ printf("\n");
+ return 0;
+}
+
diff --git a/tvision/makes/includer.bmk b/tvision/makes/includer.bmk
new file mode 100644
index 0000000..117c2a8
--- /dev/null
+++ b/tvision/makes/includer.bmk
@@ -0,0 +1,35 @@
+#!/usr/bin/make
+# This file is to absorve the difference between GNU Make's include directive
+# and Borland's !include directive. :-(
+#
+!ifdef INCLUDE00
+!include $(INCLUDE00)
+!endif
+!ifdef INCLUDE01
+!include $(INCLUDE01)
+!endif
+!ifdef INCLUDE02
+!include $(INCLUDE02)
+!endif
+!ifdef INCLUDE03
+!include $(INCLUDE03)
+!endif
+!ifdef INCLUDE04
+!include $(INCLUDE04)
+!endif
+!ifdef INCLUDE05
+!include $(INCLUDE05)
+!endif
+!ifdef INCLUDE06
+!include $(INCLUDE06)
+!endif
+!ifdef INCLUDE07
+!include $(INCLUDE07)
+!endif
+!ifdef INCLUDE08
+!include $(INCLUDE08)
+!endif
+!ifdef INCLUDE09
+!include $(INCLUDE09)
+!endif
+
diff --git a/tvision/makes/includer.imk b/tvision/makes/includer.imk
new file mode 100644
index 0000000..ce82fac
--- /dev/null
+++ b/tvision/makes/includer.imk
@@ -0,0 +1,35 @@
+#!/usr/bin/make
+# This file is to absorve the difference between GNU Make's include directive
+# and Borland's !include directive. :-(
+#
+ifdef INCLUDE00
+include $(INCLUDE00)
+endif
+ifdef INCLUDE01
+include $(INCLUDE01)
+endif
+ifdef INCLUDE02
+include $(INCLUDE02)
+endif
+ifdef INCLUDE03
+include $(INCLUDE03)
+endif
+ifdef INCLUDE04
+include $(INCLUDE04)
+endif
+ifdef INCLUDE05
+include $(INCLUDE05)
+endif
+ifdef INCLUDE06
+include $(INCLUDE06)
+endif
+ifdef INCLUDE07
+include $(INCLUDE07)
+endif
+ifdef INCLUDE08
+include $(INCLUDE08)
+endif
+ifdef INCLUDE09
+include $(INCLUDE09)
+endif
+
diff --git a/tvision/makes/librhtv.bmk b/tvision/makes/librhtv.bmk
new file mode 100644
index 0000000..f8b74d0
--- /dev/null
+++ b/tvision/makes/librhtv.bmk
@@ -0,0 +1,63 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2005 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# This is the Borland C++ makefile for the Turbo Vision library.
+# Also used by MSVC (nmake) and Open Watcom (wmake).
+#
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+SRCD1=..;../classes;../classes/dos;../classes/linux;../classes/qnxrtp
+SRCD2=../classes/unix;../classes/win32;../classes/wingr;../classes/winnt
+SRCD3=../classes/x11;../compat;../stream;../names;../classes/qnx4
+SRCDIRS=$(SRCD1);$(SRCD2);$(SRCD3)
+#
+# Include directories
+#
+INCLUDE_DIR=..\include
+CLASSES_DIR=..\classes
+EXTRA_SRC_DIR=..
+INCLUDE_DIRS=-I..\winnt\include -I$(INCLUDE_DIR)
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+!ifndef MKF_EXT
+# BC++
+MKF_EXT=.bmk
+!else ifdef FOR_NMAKE
+# MSVC
+!else
+# Open Watcom
+!endif
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+!include common$(MKF_EXT)
+
+all: $(HELPER_TARGET) librhtv$(ExLIB) $(EXTRA_TARGETS)
+
+#
+# All the RHIDE data should come from here.
+#
+ExIMK=.umk
+!include librhtv$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+!include includer.bmk
+
+
diff --git a/tvision/makes/librhtv.gpr b/tvision/makes/librhtv.gpr
new file mode 100644
index 0000000..48a360a
--- /dev/null
+++ b/tvision/makes/librhtv.gpr
Binary files differ
diff --git a/tvision/makes/librhtv.imk b/tvision/makes/librhtv.imk
new file mode 100644
index 0000000..8fe1a70
--- /dev/null
+++ b/tvision/makes/librhtv.imk
@@ -0,0 +1,7405 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ../makes/obj/beep$(ExOBJ) \
+ ../makes/obj/drivevalid$(ExOBJ) \
+ ../makes/obj/expandpath$(ExOBJ) \
+ ../makes/obj/fexpand$(ExOBJ) \
+ ../makes/obj/fileattrs$(ExOBJ) \
+ ../makes/obj/fileexists$(ExOBJ) \
+ ../makes/obj/filelength$(ExOBJ) \
+ ../makes/obj/fixpath$(ExOBJ) \
+ ../makes/obj/fnmatch$(ExOBJ) \
+ ../makes/obj/getcurdir$(ExOBJ) \
+ ../makes/obj/getline$(ExOBJ) \
+ ../makes/obj/getopt$(ExOBJ) \
+ ../makes/obj/getopt1$(ExOBJ) \
+ ../makes/obj/getshell$(ExOBJ) \
+ ../makes/obj/glob$(ExOBJ) \
+ ../makes/obj/globfree$(ExOBJ) \
+ ../makes/obj/iffilelen$(ExOBJ) \
+ ../makes/obj/isdir$(ExOBJ) \
+ ../makes/obj/isrelpath$(ExOBJ) \
+ ../makes/obj/iswild$(ExOBJ) \
+ ../makes/obj/itoa$(ExOBJ) \
+ ../makes/obj/mkstemp$(ExOBJ) \
+ ../makes/obj/nl_langinfo$(ExOBJ) \
+ ../makes/obj/ntdirent$(ExOBJ) \
+ ../makes/obj/pathvalid$(ExOBJ) \
+ ../makes/obj/regex$(ExOBJ) \
+ ../makes/obj/releasec$(ExOBJ) \
+ ../makes/obj/snprintf$(ExOBJ) \
+ ../makes/obj/ssc_streams$(ExOBJ) \
+ ../makes/obj/strlwr$(ExOBJ) \
+ ../makes/obj/strupr$(ExOBJ) \
+ ../makes/obj/ticks$(ExOBJ) \
+ ../makes/obj/unc$(ExOBJ) \
+ ../makes/obj/unc_95$(ExOBJ) \
+ ../makes/obj/unc_nt$(ExOBJ) \
+ ../makes/obj/validfilename$(ExOBJ) \
+ ../makes/obj/yieldpro$(ExOBJ) \
+ obj/alcon$(ExOBJ) \
+ obj/alcondis$(ExOBJ) \
+ obj/alconkey$(ExOBJ) \
+ obj/alconmouse$(ExOBJ) \
+ obj/alconscr$(ExOBJ) \
+ obj/calcdisp$(ExOBJ) \
+ obj/calculat$(ExOBJ) \
+ obj/codepage$(ExOBJ) \
+ obj/configfile$(ExOBJ) \
+ obj/dosdis$(ExOBJ) \
+ obj/doskey$(ExOBJ) \
+ obj/dosmouse$(ExOBJ) \
+ obj/dosscr$(ExOBJ) \
+ obj/drivers2$(ExOBJ) \
+ obj/dual$(ExOBJ) \
+ obj/fileview$(ExOBJ) \
+ obj/fontcoll$(ExOBJ) \
+ obj/fpbase$(ExOBJ) \
+ obj/fpstream$(ExOBJ) \
+ obj/help$(ExOBJ) \
+ obj/helpbase$(ExOBJ) \
+ obj/histlist$(ExOBJ) \
+ obj/ifpstrea$(ExOBJ) \
+ obj/iopstrea$(ExOBJ) \
+ obj/ipstream$(ExOBJ) \
+ obj/linuxdis$(ExOBJ) \
+ obj/linuxkey$(ExOBJ) \
+ obj/linuxmouse$(ExOBJ) \
+ obj/linuxscr$(ExOBJ) \
+ obj/misc$(ExOBJ) \
+ obj/msgbox$(ExOBJ) \
+ obj/nbackgro$(ExOBJ) \
+ obj/nbutton$(ExOBJ) \
+ obj/ncalcdis$(ExOBJ) \
+ obj/ncalcula$(ExOBJ) \
+ obj/nchdirdi$(ExOBJ) \
+ obj/ncheckbo$(ExOBJ) \
+ obj/nclrdisp$(ExOBJ) \
+ obj/ncluster$(ExOBJ) \
+ obj/ncollect$(ExOBJ) \
+ obj/ncolordi$(ExOBJ) \
+ obj/ncolorgr$(ExOBJ) \
+ obj/ncolorit$(ExOBJ) \
+ obj/ncolorse$(ExOBJ) \
+ obj/ndesktop$(ExOBJ) \
+ obj/ndialog$(ExOBJ) \
+ obj/ndircoll$(ExOBJ) \
+ obj/ndirlist$(ExOBJ) \
+ obj/neditor$(ExOBJ) \
+ obj/neditwi$(ExOBJ) \
+ obj/newstr$(ExOBJ) \
+ obj/nfilecol$(ExOBJ) \
+ obj/nfiledia$(ExOBJ) \
+ obj/nfiledtr$(ExOBJ) \
+ obj/nfileinf$(ExOBJ) \
+ obj/nfileinp$(ExOBJ) \
+ obj/nfilelis$(ExOBJ) \
+ obj/nfilterv$(ExOBJ) \
+ obj/nframe$(ExOBJ) \
+ obj/ngroup$(ExOBJ) \
+ obj/nhistory$(ExOBJ) \
+ obj/nindicat$(ExOBJ) \
+ obj/ninputli$(ExOBJ) \
+ obj/nlabel$(ExOBJ) \
+ obj/nlistbox$(ExOBJ) \
+ obj/nlistvie$(ExOBJ) \
+ obj/nlookupv$(ExOBJ) \
+ obj/nmemo$(ExOBJ) \
+ obj/nmenubar$(ExOBJ) \
+ obj/nmenubox$(ExOBJ) \
+ obj/nmenuvie$(ExOBJ) \
+ obj/nmonosel$(ExOBJ) \
+ obj/nparamte$(ExOBJ) \
+ obj/npxvalid$(ExOBJ) \
+ obj/nradiobu$(ExOBJ) \
+ obj/nrangeva$(ExOBJ) \
+ obj/nresourc$(ExOBJ) \
+ obj/nscrollb$(ExOBJ) \
+ obj/nscrolle$(ExOBJ) \
+ obj/nsortedc$(ExOBJ) \
+ obj/nsortedl$(ExOBJ) \
+ obj/nstatict$(ExOBJ) \
+ obj/nstatusl$(ExOBJ) \
+ obj/nstringc$(ExOBJ) \
+ obj/nstringl$(ExOBJ) \
+ obj/nvalidat$(ExOBJ) \
+ obj/nview$(ExOBJ) \
+ obj/nwindow$(ExOBJ) \
+ obj/ofpstrea$(ExOBJ) \
+ obj/opstream$(ExOBJ) \
+ obj/osclipboard$(ExOBJ) \
+ obj/pstream$(ExOBJ) \
+ obj/qnx4dis$(ExOBJ) \
+ obj/qnx4key$(ExOBJ) \
+ obj/qnx4mouse$(ExOBJ) \
+ obj/qnx4scr$(ExOBJ) \
+ obj/qnxdis$(ExOBJ) \
+ obj/qnxkey$(ExOBJ) \
+ obj/qnxmouse$(ExOBJ) \
+ obj/qnxscr$(ExOBJ) \
+ obj/rhscreen$(ExOBJ) \
+ obj/sbackgro$(ExOBJ) \
+ obj/sbutton$(ExOBJ) \
+ obj/scalcdis$(ExOBJ) \
+ obj/scalcula$(ExOBJ) \
+ obj/schdirdi$(ExOBJ) \
+ obj/scheckbo$(ExOBJ) \
+ obj/sclrdisp$(ExOBJ) \
+ obj/scluster$(ExOBJ) \
+ obj/scolordi$(ExOBJ) \
+ obj/scolorgr$(ExOBJ) \
+ obj/scolorit$(ExOBJ) \
+ obj/scolorse$(ExOBJ) \
+ obj/screen$(ExOBJ) \
+ obj/sdesktop$(ExOBJ) \
+ obj/sdialog$(ExOBJ) \
+ obj/sdircoll$(ExOBJ) \
+ obj/sdirlist$(ExOBJ) \
+ obj/seditor$(ExOBJ) \
+ obj/seditwin$(ExOBJ) \
+ obj/sescreen$(ExOBJ) \
+ obj/sfilecol$(ExOBJ) \
+ obj/sfiledia$(ExOBJ) \
+ obj/sfileedi$(ExOBJ) \
+ obj/sfileinf$(ExOBJ) \
+ obj/sfileinp$(ExOBJ) \
+ obj/sfilelis$(ExOBJ) \
+ obj/sfilterv$(ExOBJ) \
+ obj/sframe$(ExOBJ) \
+ obj/sgroup$(ExOBJ) \
+ obj/shistory$(ExOBJ) \
+ obj/sindicat$(ExOBJ) \
+ obj/sinputli$(ExOBJ) \
+ obj/slabel$(ExOBJ) \
+ obj/slistbox$(ExOBJ) \
+ obj/slistvie$(ExOBJ) \
+ obj/slookupv$(ExOBJ) \
+ obj/smemo$(ExOBJ) \
+ obj/smenubar$(ExOBJ) \
+ obj/smenubox$(ExOBJ) \
+ obj/smenuvie$(ExOBJ) \
+ obj/smonosel$(ExOBJ) \
+ obj/sparamte$(ExOBJ) \
+ obj/spxvalid$(ExOBJ) \
+ obj/sradiobu$(ExOBJ) \
+ obj/srangeva$(ExOBJ) \
+ obj/sresourc$(ExOBJ) \
+ obj/sscrollb$(ExOBJ) \
+ obj/sscrolle$(ExOBJ) \
+ obj/sstatict$(ExOBJ) \
+ obj/sstatusl$(ExOBJ) \
+ obj/sstringc$(ExOBJ) \
+ obj/sstringl$(ExOBJ) \
+ obj/sview$(ExOBJ) \
+ obj/swindow$(ExOBJ) \
+ obj/tapplica$(ExOBJ) \
+ obj/tbackgro$(ExOBJ) \
+ obj/tbutton$(ExOBJ) \
+ obj/tchdirdi$(ExOBJ) \
+ obj/tcheckbo$(ExOBJ) \
+ obj/tclrdisp$(ExOBJ) \
+ obj/tcluster$(ExOBJ) \
+ obj/tcollect$(ExOBJ) \
+ obj/tcolordi$(ExOBJ) \
+ obj/tcolorgr$(ExOBJ) \
+ obj/tcolorit$(ExOBJ) \
+ obj/tcolorse$(ExOBJ) \
+ obj/tcommand$(ExOBJ) \
+ obj/tdesktop$(ExOBJ) \
+ obj/tdialog$(ExOBJ) \
+ obj/tdircoll$(ExOBJ) \
+ obj/tdirlist$(ExOBJ) \
+ obj/tdisplay$(ExOBJ) \
+ obj/tdrawbuf$(ExOBJ) \
+ obj/teditor$(ExOBJ) \
+ obj/teditorf$(ExOBJ) \
+ obj/teditwin$(ExOBJ) \
+ obj/tevent$(ExOBJ) \
+ obj/tfilecol$(ExOBJ) \
+ obj/tfiledia$(ExOBJ) \
+ obj/tfileedi$(ExOBJ) \
+ obj/tfileinf$(ExOBJ) \
+ obj/tfileinp$(ExOBJ) \
+ obj/tfilelis$(ExOBJ) \
+ obj/tfilterv$(ExOBJ) \
+ obj/tframe$(ExOBJ) \
+ obj/tgkey$(ExOBJ) \
+ obj/tgroup$(ExOBJ) \
+ obj/thistory$(ExOBJ) \
+ obj/thistvie$(ExOBJ) \
+ obj/thistwin$(ExOBJ) \
+ obj/thwmouse$(ExOBJ) \
+ obj/tindicat$(ExOBJ) \
+ obj/tinputli$(ExOBJ) \
+ obj/tlabel$(ExOBJ) \
+ obj/tlistbox$(ExOBJ) \
+ obj/tlistvie$(ExOBJ) \
+ obj/tlookupv$(ExOBJ) \
+ obj/tmemo$(ExOBJ) \
+ obj/tmenubar$(ExOBJ) \
+ obj/tmenubox$(ExOBJ) \
+ obj/tmenuvie$(ExOBJ) \
+ obj/tmonosel$(ExOBJ) \
+ obj/tmouse$(ExOBJ) \
+ obj/tnscolle$(ExOBJ) \
+ obj/tnssorte$(ExOBJ) \
+ obj/tobject$(ExOBJ) \
+ obj/tpalette$(ExOBJ) \
+ obj/tparamte$(ExOBJ) \
+ obj/tpoint$(ExOBJ) \
+ obj/tprogini$(ExOBJ) \
+ obj/tprogram$(ExOBJ) \
+ obj/tpwobj$(ExOBJ) \
+ obj/tpwreado$(ExOBJ) \
+ obj/tpwritte$(ExOBJ) \
+ obj/tpxvalid$(ExOBJ) \
+ obj/tradiobu$(ExOBJ) \
+ obj/trangeva$(ExOBJ) \
+ obj/trescoll$(ExOBJ) \
+ obj/tresfile$(ExOBJ) \
+ obj/tscreen$(ExOBJ) \
+ obj/tscrollb$(ExOBJ) \
+ obj/tscrolle$(ExOBJ) \
+ obj/tsortedc$(ExOBJ) \
+ obj/tsortedl$(ExOBJ) \
+ obj/tstatict$(ExOBJ) \
+ obj/tstatusd$(ExOBJ) \
+ obj/tstatusl$(ExOBJ) \
+ obj/tstrinde$(ExOBJ) \
+ obj/tstringc$(ExOBJ) \
+ obj/tstringl$(ExOBJ) \
+ obj/tstrlist$(ExOBJ) \
+ obj/tstrmcla$(ExOBJ) \
+ obj/tstrmtyp$(ExOBJ) \
+ obj/tsubmenu$(ExOBJ) \
+ obj/ttermina$(ExOBJ) \
+ obj/ttextdev$(ExOBJ) \
+ obj/tvalidat$(ExOBJ) \
+ obj/tvedit1$(ExOBJ) \
+ obj/tvedit2$(ExOBJ) \
+ obj/tvedit3$(ExOBJ) \
+ obj/tview$(ExOBJ) \
+ obj/tvintl$(ExOBJ) \
+ obj/tvtext1$(ExOBJ) \
+ obj/tvtext2$(ExOBJ) \
+ obj/twindow$(ExOBJ) \
+ obj/unixdis$(ExOBJ) \
+ obj/unixkey$(ExOBJ) \
+ obj/unixmouse$(ExOBJ) \
+ obj/unixscr$(ExOBJ) \
+ obj/vesa$(ExOBJ) \
+ obj/vga$(ExOBJ) \
+ obj/vgaregs$(ExOBJ) \
+ obj/vgastate$(ExOBJ) \
+ obj/win32clip$(ExOBJ) \
+ obj/win32dis$(ExOBJ) \
+ obj/win32key$(ExOBJ) \
+ obj/win32mouse$(ExOBJ) \
+ obj/win32scr$(ExOBJ) \
+ obj/wingrdis$(ExOBJ) \
+ obj/wingrkey$(ExOBJ) \
+ obj/wingrmouse$(ExOBJ) \
+ obj/wingrscr$(ExOBJ) \
+ obj/winntdis$(ExOBJ) \
+ obj/winntkey$(ExOBJ) \
+ obj/winntmouse$(ExOBJ) \
+ obj/winntscr$(ExOBJ) \
+ obj/x11dis$(ExOBJ) \
+ obj/x11key$(ExOBJ) \
+ obj/x11mouse$(ExOBJ) \
+ obj/x11src$(ExOBJ) \
+ obj/xtermdis$(ExOBJ) \
+ obj/xtermkey$(ExOBJ) \
+ obj/xtermmouse$(ExOBJ) \
+ obj/xtermscr$(ExOBJ)
+
+LIBRARIES=
+
+librhtv$(ExLIB):: \
+ ../makes/obj/beep$(ExOBJ) \
+ ../makes/obj/drivevalid$(ExOBJ) \
+ ../makes/obj/expandpath$(ExOBJ) \
+ ../makes/obj/fexpand$(ExOBJ) \
+ ../makes/obj/fileattrs$(ExOBJ) \
+ ../makes/obj/fileexists$(ExOBJ) \
+ ../makes/obj/filelength$(ExOBJ) \
+ ../makes/obj/fixpath$(ExOBJ) \
+ ../makes/obj/fnmatch$(ExOBJ) \
+ ../makes/obj/getcurdir$(ExOBJ) \
+ ../makes/obj/getline$(ExOBJ) \
+ ../makes/obj/getopt$(ExOBJ) \
+ ../makes/obj/getopt1$(ExOBJ) \
+ ../makes/obj/getshell$(ExOBJ) \
+ ../makes/obj/glob$(ExOBJ) \
+ ../makes/obj/globfree$(ExOBJ) \
+ ../makes/obj/iffilelen$(ExOBJ) \
+ ../makes/obj/isdir$(ExOBJ) \
+ ../makes/obj/isrelpath$(ExOBJ) \
+ ../makes/obj/iswild$(ExOBJ) \
+ ../makes/obj/itoa$(ExOBJ) \
+ ../makes/obj/mkstemp$(ExOBJ) \
+ ../makes/obj/nl_langinfo$(ExOBJ) \
+ ../makes/obj/ntdirent$(ExOBJ) \
+ ../makes/obj/pathvalid$(ExOBJ) \
+ ../makes/obj/regex$(ExOBJ) \
+ ../makes/obj/releasec$(ExOBJ) \
+ ../makes/obj/snprintf$(ExOBJ) \
+ ../makes/obj/ssc_streams$(ExOBJ) \
+ ../makes/obj/strlwr$(ExOBJ) \
+ ../makes/obj/strupr$(ExOBJ) \
+ ../makes/obj/ticks$(ExOBJ) \
+ ../makes/obj/unc$(ExOBJ) \
+ ../makes/obj/unc_95$(ExOBJ) \
+ ../makes/obj/unc_nt$(ExOBJ) \
+ ../makes/obj/validfilename$(ExOBJ) \
+ ../makes/obj/yieldpro$(ExOBJ) \
+ obj/alcon$(ExOBJ) \
+ obj/alcondis$(ExOBJ) \
+ obj/alconkey$(ExOBJ) \
+ obj/alconmouse$(ExOBJ) \
+ obj/alconscr$(ExOBJ) \
+ obj/calcdisp$(ExOBJ) \
+ obj/calculat$(ExOBJ) \
+ obj/codepage$(ExOBJ) \
+ obj/configfile$(ExOBJ) \
+ obj/dosdis$(ExOBJ) \
+ obj/doskey$(ExOBJ) \
+ obj/dosmouse$(ExOBJ) \
+ obj/dosscr$(ExOBJ) \
+ obj/drivers2$(ExOBJ) \
+ obj/dual$(ExOBJ) \
+ obj/fileview$(ExOBJ) \
+ obj/fontcoll$(ExOBJ) \
+ obj/fpbase$(ExOBJ) \
+ obj/fpstream$(ExOBJ) \
+ obj/help$(ExOBJ) \
+ obj/helpbase$(ExOBJ) \
+ obj/histlist$(ExOBJ) \
+ obj/ifpstrea$(ExOBJ) \
+ obj/iopstrea$(ExOBJ) \
+ obj/ipstream$(ExOBJ) \
+ obj/linuxdis$(ExOBJ) \
+ obj/linuxkey$(ExOBJ) \
+ obj/linuxmouse$(ExOBJ) \
+ obj/linuxscr$(ExOBJ) \
+ obj/misc$(ExOBJ) \
+ obj/msgbox$(ExOBJ) \
+ obj/nbackgro$(ExOBJ) \
+ obj/nbutton$(ExOBJ) \
+ obj/ncalcdis$(ExOBJ) \
+ obj/ncalcula$(ExOBJ) \
+ obj/nchdirdi$(ExOBJ) \
+ obj/ncheckbo$(ExOBJ) \
+ obj/nclrdisp$(ExOBJ) \
+ obj/ncluster$(ExOBJ) \
+ obj/ncollect$(ExOBJ) \
+ obj/ncolordi$(ExOBJ) \
+ obj/ncolorgr$(ExOBJ) \
+ obj/ncolorit$(ExOBJ) \
+ obj/ncolorse$(ExOBJ) \
+ obj/ndesktop$(ExOBJ) \
+ obj/ndialog$(ExOBJ) \
+ obj/ndircoll$(ExOBJ) \
+ obj/ndirlist$(ExOBJ) \
+ obj/neditor$(ExOBJ) \
+ obj/neditwi$(ExOBJ) \
+ obj/newstr$(ExOBJ) \
+ obj/nfilecol$(ExOBJ) \
+ obj/nfiledia$(ExOBJ) \
+ obj/nfiledtr$(ExOBJ) \
+ obj/nfileinf$(ExOBJ) \
+ obj/nfileinp$(ExOBJ) \
+ obj/nfilelis$(ExOBJ) \
+ obj/nfilterv$(ExOBJ) \
+ obj/nframe$(ExOBJ) \
+ obj/ngroup$(ExOBJ) \
+ obj/nhistory$(ExOBJ) \
+ obj/nindicat$(ExOBJ) \
+ obj/ninputli$(ExOBJ) \
+ obj/nlabel$(ExOBJ) \
+ obj/nlistbox$(ExOBJ) \
+ obj/nlistvie$(ExOBJ) \
+ obj/nlookupv$(ExOBJ) \
+ obj/nmemo$(ExOBJ) \
+ obj/nmenubar$(ExOBJ) \
+ obj/nmenubox$(ExOBJ) \
+ obj/nmenuvie$(ExOBJ) \
+ obj/nmonosel$(ExOBJ) \
+ obj/nparamte$(ExOBJ) \
+ obj/npxvalid$(ExOBJ) \
+ obj/nradiobu$(ExOBJ) \
+ obj/nrangeva$(ExOBJ) \
+ obj/nresourc$(ExOBJ) \
+ obj/nscrollb$(ExOBJ) \
+ obj/nscrolle$(ExOBJ) \
+ obj/nsortedc$(ExOBJ) \
+ obj/nsortedl$(ExOBJ) \
+ obj/nstatict$(ExOBJ) \
+ obj/nstatusl$(ExOBJ) \
+ obj/nstringc$(ExOBJ) \
+ obj/nstringl$(ExOBJ) \
+ obj/nvalidat$(ExOBJ) \
+ obj/nview$(ExOBJ) \
+ obj/nwindow$(ExOBJ) \
+ obj/ofpstrea$(ExOBJ) \
+ obj/opstream$(ExOBJ) \
+ obj/osclipboard$(ExOBJ) \
+ obj/pstream$(ExOBJ) \
+ obj/qnx4dis$(ExOBJ) \
+ obj/qnx4key$(ExOBJ) \
+ obj/qnx4mouse$(ExOBJ) \
+ obj/qnx4scr$(ExOBJ) \
+ obj/qnxdis$(ExOBJ) \
+ obj/qnxkey$(ExOBJ) \
+ obj/qnxmouse$(ExOBJ) \
+ obj/qnxscr$(ExOBJ) \
+ obj/rhscreen$(ExOBJ) \
+ obj/sbackgro$(ExOBJ) \
+ obj/sbutton$(ExOBJ) \
+ obj/scalcdis$(ExOBJ) \
+ obj/scalcula$(ExOBJ) \
+ obj/schdirdi$(ExOBJ) \
+ obj/scheckbo$(ExOBJ) \
+ obj/sclrdisp$(ExOBJ) \
+ obj/scluster$(ExOBJ) \
+ obj/scolordi$(ExOBJ) \
+ obj/scolorgr$(ExOBJ) \
+ obj/scolorit$(ExOBJ) \
+ obj/scolorse$(ExOBJ) \
+ obj/screen$(ExOBJ) \
+ obj/sdesktop$(ExOBJ) \
+ obj/sdialog$(ExOBJ) \
+ obj/sdircoll$(ExOBJ) \
+ obj/sdirlist$(ExOBJ) \
+ obj/seditor$(ExOBJ) \
+ obj/seditwin$(ExOBJ) \
+ obj/sescreen$(ExOBJ) \
+ obj/sfilecol$(ExOBJ) \
+ obj/sfiledia$(ExOBJ) \
+ obj/sfileedi$(ExOBJ) \
+ obj/sfileinf$(ExOBJ) \
+ obj/sfileinp$(ExOBJ) \
+ obj/sfilelis$(ExOBJ) \
+ obj/sfilterv$(ExOBJ) \
+ obj/sframe$(ExOBJ) \
+ obj/sgroup$(ExOBJ) \
+ obj/shistory$(ExOBJ) \
+ obj/sindicat$(ExOBJ) \
+ obj/sinputli$(ExOBJ) \
+ obj/slabel$(ExOBJ) \
+ obj/slistbox$(ExOBJ) \
+ obj/slistvie$(ExOBJ) \
+ obj/slookupv$(ExOBJ) \
+ obj/smemo$(ExOBJ) \
+ obj/smenubar$(ExOBJ) \
+ obj/smenubox$(ExOBJ) \
+ obj/smenuvie$(ExOBJ) \
+ obj/smonosel$(ExOBJ) \
+ obj/sparamte$(ExOBJ) \
+ obj/spxvalid$(ExOBJ) \
+ obj/sradiobu$(ExOBJ) \
+ obj/srangeva$(ExOBJ) \
+ obj/sresourc$(ExOBJ) \
+ obj/sscrollb$(ExOBJ) \
+ obj/sscrolle$(ExOBJ) \
+ obj/sstatict$(ExOBJ) \
+ obj/sstatusl$(ExOBJ) \
+ obj/sstringc$(ExOBJ) \
+ obj/sstringl$(ExOBJ) \
+ obj/sview$(ExOBJ) \
+ obj/swindow$(ExOBJ) \
+ obj/tapplica$(ExOBJ) \
+ obj/tbackgro$(ExOBJ) \
+ obj/tbutton$(ExOBJ) \
+ obj/tchdirdi$(ExOBJ) \
+ obj/tcheckbo$(ExOBJ) \
+ obj/tclrdisp$(ExOBJ) \
+ obj/tcluster$(ExOBJ) \
+ obj/tcollect$(ExOBJ) \
+ obj/tcolordi$(ExOBJ) \
+ obj/tcolorgr$(ExOBJ) \
+ obj/tcolorit$(ExOBJ) \
+ obj/tcolorse$(ExOBJ) \
+ obj/tcommand$(ExOBJ) \
+ obj/tdesktop$(ExOBJ) \
+ obj/tdialog$(ExOBJ) \
+ obj/tdircoll$(ExOBJ) \
+ obj/tdirlist$(ExOBJ) \
+ obj/tdisplay$(ExOBJ) \
+ obj/tdrawbuf$(ExOBJ) \
+ obj/teditor$(ExOBJ) \
+ obj/teditorf$(ExOBJ) \
+ obj/teditwin$(ExOBJ) \
+ obj/tevent$(ExOBJ) \
+ obj/tfilecol$(ExOBJ) \
+ obj/tfiledia$(ExOBJ) \
+ obj/tfileedi$(ExOBJ) \
+ obj/tfileinf$(ExOBJ) \
+ obj/tfileinp$(ExOBJ) \
+ obj/tfilelis$(ExOBJ) \
+ obj/tfilterv$(ExOBJ) \
+ obj/tframe$(ExOBJ) \
+ obj/tgkey$(ExOBJ) \
+ obj/tgroup$(ExOBJ) \
+ obj/thistory$(ExOBJ) \
+ obj/thistvie$(ExOBJ) \
+ obj/thistwin$(ExOBJ) \
+ obj/thwmouse$(ExOBJ) \
+ obj/tindicat$(ExOBJ) \
+ obj/tinputli$(ExOBJ) \
+ obj/tlabel$(ExOBJ) \
+ obj/tlistbox$(ExOBJ) \
+ obj/tlistvie$(ExOBJ) \
+ obj/tlookupv$(ExOBJ) \
+ obj/tmemo$(ExOBJ) \
+ obj/tmenubar$(ExOBJ) \
+ obj/tmenubox$(ExOBJ) \
+ obj/tmenuvie$(ExOBJ) \
+ obj/tmonosel$(ExOBJ) \
+ obj/tmouse$(ExOBJ) \
+ obj/tnscolle$(ExOBJ) \
+ obj/tnssorte$(ExOBJ) \
+ obj/tobject$(ExOBJ) \
+ obj/tpalette$(ExOBJ) \
+ obj/tparamte$(ExOBJ) \
+ obj/tpoint$(ExOBJ) \
+ obj/tprogini$(ExOBJ) \
+ obj/tprogram$(ExOBJ) \
+ obj/tpwobj$(ExOBJ) \
+ obj/tpwreado$(ExOBJ) \
+ obj/tpwritte$(ExOBJ) \
+ obj/tpxvalid$(ExOBJ) \
+ obj/tradiobu$(ExOBJ) \
+ obj/trangeva$(ExOBJ) \
+ obj/trescoll$(ExOBJ) \
+ obj/tresfile$(ExOBJ) \
+ obj/tscreen$(ExOBJ) \
+ obj/tscrollb$(ExOBJ) \
+ obj/tscrolle$(ExOBJ) \
+ obj/tsortedc$(ExOBJ) \
+ obj/tsortedl$(ExOBJ) \
+ obj/tstatict$(ExOBJ) \
+ obj/tstatusd$(ExOBJ) \
+ obj/tstatusl$(ExOBJ) \
+ obj/tstrinde$(ExOBJ) \
+ obj/tstringc$(ExOBJ) \
+ obj/tstringl$(ExOBJ) \
+ obj/tstrlist$(ExOBJ) \
+ obj/tstrmcla$(ExOBJ) \
+ obj/tstrmtyp$(ExOBJ) \
+ obj/tsubmenu$(ExOBJ) \
+ obj/ttermina$(ExOBJ) \
+ obj/ttextdev$(ExOBJ) \
+ obj/tvalidat$(ExOBJ) \
+ obj/tvedit1$(ExOBJ) \
+ obj/tvedit2$(ExOBJ) \
+ obj/tvedit3$(ExOBJ) \
+ obj/tview$(ExOBJ) \
+ obj/tvintl$(ExOBJ) \
+ obj/tvtext1$(ExOBJ) \
+ obj/tvtext2$(ExOBJ) \
+ obj/twindow$(ExOBJ) \
+ obj/unixdis$(ExOBJ) \
+ obj/unixkey$(ExOBJ) \
+ obj/unixmouse$(ExOBJ) \
+ obj/unixscr$(ExOBJ) \
+ obj/vesa$(ExOBJ) \
+ obj/vga$(ExOBJ) \
+ obj/vgaregs$(ExOBJ) \
+ obj/vgastate$(ExOBJ) \
+ obj/win32clip$(ExOBJ) \
+ obj/win32dis$(ExOBJ) \
+ obj/win32key$(ExOBJ) \
+ obj/win32mouse$(ExOBJ) \
+ obj/win32scr$(ExOBJ) \
+ obj/wingrdis$(ExOBJ) \
+ obj/wingrkey$(ExOBJ) \
+ obj/wingrmouse$(ExOBJ) \
+ obj/wingrscr$(ExOBJ) \
+ obj/winntdis$(ExOBJ) \
+ obj/winntkey$(ExOBJ) \
+ obj/winntmouse$(ExOBJ) \
+ obj/winntscr$(ExOBJ) \
+ obj/x11dis$(ExOBJ) \
+ obj/x11key$(ExOBJ) \
+ obj/x11mouse$(ExOBJ) \
+ obj/x11src$(ExOBJ) \
+ obj/xtermdis$(ExOBJ) \
+ obj/xtermkey$(ExOBJ) \
+ obj/xtermmouse$(ExOBJ) \
+ obj/xtermscr$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+INCLUDE00=../compat/compat$(ExIMK)
+
+obj/alcon$(ExOBJ):: ../classes/alcon/alcon.cc \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/alcon/alcon.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/alcondis$(ExOBJ):: ../classes/alcon/alcondis.cc \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/alcon/alcon.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/alcon/screen.h \
+ $(INCLUDE_DIR)/tv/alcon/mouse.h \
+ $(INCLUDE_DIR)/tv/alcon/key.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/alconkey$(ExOBJ):: ../classes/alcon/alconkey.cc \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/alcon/alcon.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/alcon/key.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/alconmouse$(ExOBJ):: ../classes/alcon/alconmouse.cc \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/alcon/alcon.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/alcon/mouse.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/alconscr$(ExOBJ):: ../classes/alcon/alconscr.cc \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/alcon/alcon.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/alcon/key.h \
+ $(INCLUDE_DIR)/tv/alcon/mouse.h \
+ $(INCLUDE_DIR)/tv/alcon/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/calcdisp$(ExOBJ):: ../classes/calcdisp.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/calc.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/calculat$(ExOBJ):: ../classes/calculat.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/calc.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/codepage$(ExOBJ):: ../classes/codepage.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/backgrnd.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/checkbox.h \
+ $(INCLUDE_DIR)/tv/clrdlg.h \
+ $(INCLUDE_DIR)/tv/clrselct.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/dirlibo.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/filinfpn.h \
+ $(INCLUDE_DIR)/tv/frame.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/history.h \
+ $(INCLUDE_DIR)/tv/indicato.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/menubox.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/mnoselct.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/radiobtn.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/statslin.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/configfile$(ExOBJ):: ../classes/configfile.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configfile.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dosdis$(ExOBJ):: ../classes/dos/dosdis.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dos/mouse.h \
+ $(INCLUDE_DIR)/tv/dos/screen.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/frame.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/doskey$(ExOBJ):: ../classes/dos/doskey.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dos/key.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dosmouse$(ExOBJ):: ../classes/dos/dosmouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dos/mouse.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dosscr$(ExOBJ):: ../classes/dos/dosscr.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dos/key.h \
+ $(INCLUDE_DIR)/tv/dos/mouse.h \
+ $(INCLUDE_DIR)/tv/dos/screen.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/osclipboard.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/drivers2$(ExOBJ):: ../drivers2.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dual$(ExOBJ):: ../dual.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/fileview$(ExOBJ):: ../fileview.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/filedlg.h \
+ $(INCLUDE_DIR)/tv/fileview.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/scroller.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/fontcoll$(ExOBJ):: ../classes/fontcoll.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/fontcoll.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/sortlibo.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/fpbase$(ExOBJ):: ../classes/fpbase.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/fpbase.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/fpstream$(ExOBJ):: ../classes/fpstream.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/fpbase.h \
+ $(INCLUDE_DIR)/tv/fpstream.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/iopstrm.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/help$(ExOBJ):: ../classes/help.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/fpbase.h \
+ $(INCLUDE_DIR)/tv/fpstream.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/help.h \
+ $(INCLUDE_DIR)/tv/helpbase.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/iopstrm.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/scroller.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/helpbase$(ExOBJ):: ../classes/helpbase.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/fpbase.h \
+ $(INCLUDE_DIR)/tv/fpstream.h \
+ $(INCLUDE_DIR)/tv/helpbase.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/iopstrm.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/histlist$(ExOBJ):: ../histlist.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ifpstrea$(ExOBJ):: ../classes/ifpstrea.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/fpbase.h \
+ $(INCLUDE_DIR)/tv/ifpstrm.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/iopstrea$(ExOBJ):: ../classes/iopstrea.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/iopstrm.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ipstream$(ExOBJ):: ../classes/ipstream.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/preadobj.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/strmblty.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/linuxdis$(ExOBJ):: ../classes/linux/linuxdis.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/linux/key.h \
+ $(INCLUDE_DIR)/tv/linux/log.h \
+ $(INCLUDE_DIR)/tv/linux/screen.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/linuxkey$(ExOBJ):: ../classes/linux/linuxkey.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/linux/key.h \
+ $(INCLUDE_DIR)/tv/linux/log.h \
+ $(INCLUDE_DIR)/tv/linux/screen.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/linuxmouse$(ExOBJ):: ../classes/linux/linuxmouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/linux/log.h \
+ $(INCLUDE_DIR)/tv/linux/mouse.h \
+ $(INCLUDE_DIR)/tv/linux/screen.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/mouse.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/linuxscr$(ExOBJ):: ../classes/linux/linuxscr.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/linux/key.h \
+ $(INCLUDE_DIR)/tv/linux/log.h \
+ $(INCLUDE_DIR)/tv/linux/mouse.h \
+ $(INCLUDE_DIR)/tv/linux/screen.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/mouse.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/misc$(ExOBJ):: ../misc.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/msgbox$(ExOBJ):: ../msgbox.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/checkbox.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/label.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/sitem.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nbackgro$(ExOBJ):: ../names/nbackgro.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nbutton$(ExOBJ):: ../names/nbutton.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ncalcdis$(ExOBJ):: ../names/ncalcdis.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ncalcula$(ExOBJ):: ../names/ncalcula.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nchdirdi$(ExOBJ):: ../names/nchdirdi.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ncheckbo$(ExOBJ):: ../names/ncheckbo.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nclrdisp$(ExOBJ):: ../names/nclrdisp.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ncluster$(ExOBJ):: ../names/ncluster.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ncollect$(ExOBJ):: ../names/ncollect.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ncolordi$(ExOBJ):: ../names/ncolordi.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ncolorgr$(ExOBJ):: ../names/ncolorgr.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ncolorit$(ExOBJ):: ../names/ncolorit.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ncolorse$(ExOBJ):: ../names/ncolorse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndesktop$(ExOBJ):: ../names/ndesktop.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndialog$(ExOBJ):: ../names/ndialog.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndircoll$(ExOBJ):: ../names/ndircoll.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndirlist$(ExOBJ):: ../names/ndirlist.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/neditor$(ExOBJ):: ../names/neditor.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/neditwi$(ExOBJ):: ../names/neditwi.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/newstr$(ExOBJ):: ../newstr.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nfilecol$(ExOBJ):: ../names/nfilecol.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nfiledia$(ExOBJ):: ../names/nfiledia.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nfiledtr$(ExOBJ):: ../names/nfiledtr.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nfileinf$(ExOBJ):: ../names/nfileinf.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nfileinp$(ExOBJ):: ../names/nfileinp.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nfilelis$(ExOBJ):: ../names/nfilelis.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nfilterv$(ExOBJ):: ../names/nfilterv.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nframe$(ExOBJ):: ../names/nframe.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ngroup$(ExOBJ):: ../names/ngroup.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nhistory$(ExOBJ):: ../names/nhistory.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nindicat$(ExOBJ):: ../names/nindicat.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ninputli$(ExOBJ):: ../names/ninputli.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nlabel$(ExOBJ):: ../names/nlabel.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nlistbox$(ExOBJ):: ../names/nlistbox.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nlistvie$(ExOBJ):: ../names/nlistvie.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nlookupv$(ExOBJ):: ../names/nlookupv.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nmemo$(ExOBJ):: ../names/nmemo.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nmenubar$(ExOBJ):: ../names/nmenubar.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nmenubox$(ExOBJ):: ../names/nmenubox.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nmenuvie$(ExOBJ):: ../names/nmenuvie.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nmonosel$(ExOBJ):: ../names/nmonosel.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nparamte$(ExOBJ):: ../names/nparamte.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/npxvalid$(ExOBJ):: ../names/npxvalid.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nradiobu$(ExOBJ):: ../names/nradiobu.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nrangeva$(ExOBJ):: ../names/nrangeva.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nresourc$(ExOBJ):: ../names/nresourc.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nscrollb$(ExOBJ):: ../names/nscrollb.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nscrolle$(ExOBJ):: ../names/nscrolle.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nsortedc$(ExOBJ):: ../names/nsortedc.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nsortedl$(ExOBJ):: ../names/nsortedl.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nstatict$(ExOBJ):: ../names/nstatict.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nstatusl$(ExOBJ):: ../names/nstatusl.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nstringc$(ExOBJ):: ../names/nstringc.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nstringl$(ExOBJ):: ../names/nstringl.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nvalidat$(ExOBJ):: ../names/nvalidat.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nview$(ExOBJ):: ../names/nview.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nwindow$(ExOBJ):: ../names/nwindow.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ofpstrea$(ExOBJ):: ../classes/ofpstrea.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/fpbase.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/ofpstrm.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/opstream$(ExOBJ):: ../classes/opstream.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/pwritobj.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/strmblty.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/osclipboard$(ExOBJ):: ../classes/osclipboard.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/osclipboard.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/pstream$(ExOBJ):: ../classes/pstream.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/strmblty.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/qnx4dis$(ExOBJ):: ../classes/qnx4/qnx4dis.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/qnx4/screen.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/qnx4key$(ExOBJ):: ../classes/qnx4/qnx4key.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/qnx4/key.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/qnx4mouse$(ExOBJ):: ../classes/qnx4/qnx4mouse.cc \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/qnx4/mouse.h \
+ $(INCLUDE_DIR)/tv/qnx4/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/qnx4scr$(ExOBJ):: ../classes/qnx4/qnx4scr.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/qnx4/key.h \
+ $(INCLUDE_DIR)/tv/qnx4/screen.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/qnxdis$(ExOBJ):: ../classes/qnxrtp/qnxdis.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/qnxrtp/screen.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/qnxkey$(ExOBJ):: ../classes/qnxrtp/qnxkey.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/qnxrtp/key.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/qnxmouse$(ExOBJ):: ../classes/qnxrtp/qnxmouse.cc \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/qnxrtp/mouse.h \
+ $(INCLUDE_DIR)/tv/qnxrtp/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/qnxscr$(ExOBJ):: ../classes/qnxrtp/qnxscr.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/qnxrtp/key.h \
+ $(INCLUDE_DIR)/tv/qnxrtp/screen.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/rhscreen$(ExOBJ):: ../classes/dos/rhscreen.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dos/screen.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sbackgro$(ExOBJ):: ../stream/sbackgro.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/backgrnd.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sbutton$(ExOBJ):: ../stream/sbutton.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/scalcdis$(ExOBJ):: ../stream/scalcdis.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/calc.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/scalcula$(ExOBJ):: ../stream/scalcula.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/calc.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/schdirdi$(ExOBJ):: ../stream/schdirdi.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/chdirdlg.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/scheckbo$(ExOBJ):: ../stream/scheckbo.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/checkbox.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sclrdisp$(ExOBJ):: ../stream/sclrdisp.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/clrdisp.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/scluster$(ExOBJ):: ../stream/scluster.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/scolordi$(ExOBJ):: ../stream/scolordi.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/clrdlg.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/scolorgr$(ExOBJ):: ../stream/scolorgr.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/clrgrpli.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/scolorit$(ExOBJ):: ../stream/scolorit.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/clriteml.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/scolorse$(ExOBJ):: ../stream/scolorse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/clrselct.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/screen$(ExOBJ):: ../classes/dos/screen.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdesktop$(ExOBJ):: ../stream/sdesktop.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdialog$(ExOBJ):: ../stream/sdialog.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdircoll$(ExOBJ):: ../stream/sdircoll.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dircoll.h \
+ $(INCLUDE_DIR)/tv/direntr.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdirlist$(ExOBJ):: ../stream/sdirlist.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/dirlibo.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/seditor$(ExOBJ):: ../stream/seditor.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/seditwin$(ExOBJ):: ../stream/seditwin.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sescreen$(ExOBJ):: ../classes/dos/sescreen.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sfilecol$(ExOBJ):: ../stream/sfilecol.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/filecoll.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sfiledia$(ExOBJ):: ../stream/sfiledia.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/filedlg.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sfileedi$(ExOBJ):: ../stream/sfileedi.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sfileinf$(ExOBJ):: ../stream/sfileinf.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/filinfpn.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sfileinp$(ExOBJ):: ../stream/sfileinp.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/filinpln.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sfilelis$(ExOBJ):: ../stream/sfilelis.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/filecoll.h \
+ $(INCLUDE_DIR)/tv/filelist.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/sortlibo.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sfilterv$(ExOBJ):: ../stream/sfilterv.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sframe$(ExOBJ):: ../stream/sframe.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/frame.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sgroup$(ExOBJ):: ../stream/sgroup.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/shistory$(ExOBJ):: ../stream/shistory.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/history.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sindicat$(ExOBJ):: ../stream/sindicat.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/indicato.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sinputli$(ExOBJ):: ../stream/sinputli.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/slabel$(ExOBJ):: ../stream/slabel.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/label.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/slistbox$(ExOBJ):: ../stream/slistbox.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/slistvie$(ExOBJ):: ../stream/slistvie.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/slookupv$(ExOBJ):: ../stream/slookupv.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/smemo$(ExOBJ):: ../stream/smemo.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/smenubar$(ExOBJ):: ../stream/smenubar.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menubar.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/smenubox$(ExOBJ):: ../stream/smenubox.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menubox.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/smenuvie$(ExOBJ):: ../stream/smenuvie.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/smonosel$(ExOBJ):: ../stream/smonosel.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/mnoselct.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sparamte$(ExOBJ):: ../stream/sparamte.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parmtext.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/spxvalid$(ExOBJ):: ../stream/spxvalid.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sradiobu$(ExOBJ):: ../stream/sradiobu.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/radiobtn.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/srangeva$(ExOBJ):: ../stream/srangeva.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sresourc$(ExOBJ):: ../stream/sresourc.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rescoll.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sscrollb$(ExOBJ):: ../stream/sscrollb.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sscrolle$(ExOBJ):: ../stream/sscrolle.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/scroller.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sstatict$(ExOBJ):: ../stream/sstatict.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sstatusl$(ExOBJ):: ../stream/sstatusl.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/statslin.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sstringc$(ExOBJ):: ../stream/sstringc.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sstringl$(ExOBJ):: ../stream/sstringl.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strilist.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sview$(ExOBJ):: ../stream/sview.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/swindow$(ExOBJ):: ../stream/swindow.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tapplica$(ExOBJ):: ../classes/tapplica.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/applictn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tbackgro$(ExOBJ):: ../classes/tbackgro.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/backgrnd.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tbutton$(ExOBJ):: ../classes/tbutton.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tchdirdi$(ExOBJ):: ../classes/tchdirdi.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/chdirdlg.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/dircoll.h \
+ $(INCLUDE_DIR)/tv/direntr.h \
+ $(INCLUDE_DIR)/tv/dirlibo.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/history.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/label.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tcheckbo$(ExOBJ):: ../classes/tcheckbo.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/checkbox.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tclrdisp$(ExOBJ):: ../classes/tclrdisp.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/clrdisp.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tcluster$(ExOBJ):: ../classes/tcluster.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/sitem.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tcollect$(ExOBJ):: ../classes/tcollect.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tcolordi$(ExOBJ):: ../classes/tcolordi.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/clrdisp.h \
+ $(INCLUDE_DIR)/tv/clrdlg.h \
+ $(INCLUDE_DIR)/tv/clrgroup.h \
+ $(INCLUDE_DIR)/tv/clrgrpli.h \
+ $(INCLUDE_DIR)/tv/clritem.h \
+ $(INCLUDE_DIR)/tv/clriteml.h \
+ $(INCLUDE_DIR)/tv/clrselct.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/label.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/mnoselct.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tcolorgr$(ExOBJ):: ../classes/tcolorgr.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/clrgroup.h \
+ $(INCLUDE_DIR)/tv/clrgrpli.h \
+ $(INCLUDE_DIR)/tv/clritem.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tcolorit$(ExOBJ):: ../classes/tcolorit.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/clritem.h \
+ $(INCLUDE_DIR)/tv/clriteml.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tcolorse$(ExOBJ):: ../classes/tcolorse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/clrselct.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tcommand$(ExOBJ):: ../classes/tcommand.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tdesktop$(ExOBJ):: ../classes/tdesktop.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/backgrnd.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tdialog$(ExOBJ):: ../classes/tdialog.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/applictn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tdircoll$(ExOBJ):: ../classes/tdircoll.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dircoll.h \
+ $(INCLUDE_DIR)/tv/direntr.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tdirlist$(ExOBJ):: ../classes/tdirlist.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/chdirdlg.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/dircoll.h \
+ $(INCLUDE_DIR)/tv/direntr.h \
+ $(INCLUDE_DIR)/tv/dirlibo.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tdisplay$(ExOBJ):: ../classes/tdisplay.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tdrawbuf$(ExOBJ):: ../classes/tdrawbuf.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/teditor$(ExOBJ):: ../classes/teditor.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/findrepl.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/indicato.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/teditorf$(ExOBJ):: ../classes/teditorf.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/teditwin$(ExOBJ):: ../classes/teditwin.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/frame.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/indicato.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tevent$(ExOBJ):: ../classes/tevent.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tfilecol$(ExOBJ):: ../classes/tfilecol.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/filecoll.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tfiledia$(ExOBJ):: ../classes/tfiledia.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/filecoll.h \
+ $(INCLUDE_DIR)/tv/filedlg.h \
+ $(INCLUDE_DIR)/tv/filelist.h \
+ $(INCLUDE_DIR)/tv/filinfpn.h \
+ $(INCLUDE_DIR)/tv/filinpln.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/history.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/label.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/sortlibo.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tfileedi$(ExOBJ):: ../classes/tfileedi.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tfileinf$(ExOBJ):: ../classes/tfileinf.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/filedlg.h \
+ $(INCLUDE_DIR)/tv/filinfpn.h \
+ $(INCLUDE_DIR)/tv/filinpln.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tfileinp$(ExOBJ):: ../classes/tfileinp.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/filedlg.h \
+ $(INCLUDE_DIR)/tv/filinpln.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tfilelis$(ExOBJ):: ../classes/tfilelis.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/filecoll.h \
+ $(INCLUDE_DIR)/tv/filelist.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/sortlibo.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tfilterv$(ExOBJ):: ../classes/tfilterv.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tframe$(ExOBJ):: ../classes/tframe.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/frame.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tgkey$(ExOBJ):: ../classes/tgkey.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tgroup$(ExOBJ):: ../classes/tgroup.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/thistory$(ExOBJ):: ../classes/thistory.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/history.h \
+ $(INCLUDE_DIR)/tv/histwind.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/thistvie$(ExOBJ):: ../classes/thistvie.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/histvwer.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/thistwin$(ExOBJ):: ../classes/thistwin.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/histvwer.h \
+ $(INCLUDE_DIR)/tv/histwind.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/thwmouse$(ExOBJ):: ../classes/thwmouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tindicat$(ExOBJ):: ../classes/tindicat.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/indicato.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tinputli$(ExOBJ):: ../classes/tinputli.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/osclipboard.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tlabel$(ExOBJ):: ../classes/tlabel.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/label.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tlistbox$(ExOBJ):: ../classes/tlistbox.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tlistvie$(ExOBJ):: ../classes/tlistvie.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tlookupv$(ExOBJ):: ../classes/tlookupv.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tmemo$(ExOBJ):: ../classes/tmemo.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tmenubar$(ExOBJ):: ../classes/tmenubar.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menu.h \
+ $(INCLUDE_DIR)/tv/menubar.h \
+ $(INCLUDE_DIR)/tv/menuitem.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/submenu.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tmenubox$(ExOBJ):: ../classes/tmenubox.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menu.h \
+ $(INCLUDE_DIR)/tv/menubox.h \
+ $(INCLUDE_DIR)/tv/menuitem.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tmenuvie$(ExOBJ):: ../classes/tmenuvie.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menu.h \
+ $(INCLUDE_DIR)/tv/menubox.h \
+ $(INCLUDE_DIR)/tv/menuitem.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tmonosel$(ExOBJ):: ../classes/tmonosel.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/mnoselct.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/sitem.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tmouse$(ExOBJ):: ../classes/tmouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tnscolle$(ExOBJ):: ../classes/tnscolle.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tnssorte$(ExOBJ):: ../classes/tnssorte.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tobject$(ExOBJ):: ../classes/tobject.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tpalette$(ExOBJ):: ../classes/tpalette.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tparamte$(ExOBJ):: ../classes/tparamte.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parmtext.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tpoint$(ExOBJ):: ../classes/tpoint.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogini$(ExOBJ):: ../classes/tprogini.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/configfile.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menubar.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/statslin.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogram$(ExOBJ):: ../classes/tprogram.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menu.h \
+ $(INCLUDE_DIR)/tv/menubar.h \
+ $(INCLUDE_DIR)/tv/menuitem.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/osclipboard.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/statsdef.h \
+ $(INCLUDE_DIR)/tv/statsitm.h \
+ $(INCLUDE_DIR)/tv/statslin.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tpwobj$(ExOBJ):: ../classes/tpwobj.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/pwritobj.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tpwreado$(ExOBJ):: ../classes/tpwreado.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/preadobj.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tpwritte$(ExOBJ):: ../classes/tpwritte.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/pwritobj.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tpxvalid$(ExOBJ):: ../classes/tpxvalid.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tradiobu$(ExOBJ):: ../classes/tradiobu.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/radiobtn.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/trangeva$(ExOBJ):: ../classes/trangeva.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/trescoll$(ExOBJ):: ../classes/trescoll.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rescoll.h \
+ $(INCLUDE_DIR)/tv/resitem.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tresfile$(ExOBJ):: ../classes/tresfile.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/fpbase.h \
+ $(INCLUDE_DIR)/tv/fpstream.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/iopstrm.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rescoll.h \
+ $(INCLUDE_DIR)/tv/resfile.h \
+ $(INCLUDE_DIR)/tv/resitem.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tscreen$(ExOBJ):: ../classes/tscreen.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configfile.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drivers.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tscrollb$(ExOBJ):: ../classes/tscrollb.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tscrolle$(ExOBJ):: ../classes/tscrolle.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/scroller.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsortedc$(ExOBJ):: ../classes/tsortedc.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsortedl$(ExOBJ):: ../classes/tsortedl.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/sortlibo.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstatict$(ExOBJ):: ../classes/tstatict.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstatusd$(ExOBJ):: ../classes/tstatusd.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/statsdef.h \
+ $(INCLUDE_DIR)/tv/statsitm.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstatusl$(ExOBJ):: ../classes/tstatusl.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/statsdef.h \
+ $(INCLUDE_DIR)/tv/statsitm.h \
+ $(INCLUDE_DIR)/tv/statslin.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrinde$(ExOBJ):: ../classes/tstrinde.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/strinrec.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstringc$(ExOBJ):: ../classes/tstringc.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/collectn.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/sortcoll.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strncoll.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstringl$(ExOBJ):: ../classes/tstringl.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strilist.h \
+ $(INCLUDE_DIR)/tv/strinrec.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrlist$(ExOBJ):: ../classes/tstrlist.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/resource.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/strilist.h \
+ $(INCLUDE_DIR)/tv/strinrec.h \
+ $(INCLUDE_DIR)/tv/strlistm.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrmcla$(ExOBJ):: ../classes/tstrmcla.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrmtyp$(ExOBJ):: ../classes/tstrmtyp.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/no_mss.h \
+ $(INCLUDE_DIR)/tv/nscoll.h \
+ $(INCLUDE_DIR)/tv/nssorcol.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/strmblcl.h \
+ $(INCLUDE_DIR)/tv/strmblty.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsubmenu$(ExOBJ):: ../classes/tsubmenu.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menu.h \
+ $(INCLUDE_DIR)/tv/menuitem.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/submenu.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ttermina$(ExOBJ):: ../classes/ttermina.cc \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ttextdev$(ExOBJ):: ../classes/ttextdev.cc \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tvalidat$(ExOBJ):: ../classes/tvalidat.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/validate.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tvedit1$(ExOBJ):: ../classes/tvedit1.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/applictn.h \
+ $(INCLUDE_DIR)/tv/chdirdlg.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/filedlg.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvedit.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tvedit2$(ExOBJ):: ../classes/tvedit2.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/applictn.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/checkbox.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/history.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/label.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/sitem.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvedit.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tvedit3$(ExOBJ):: ../classes/tvedit3.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/applictn.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/filedlg.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/menubar.h \
+ $(INCLUDE_DIR)/tv/menuitem.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/msgbox.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/statsdef.h \
+ $(INCLUDE_DIR)/tv/statsitm.h \
+ $(INCLUDE_DIR)/tv/statslin.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/submenu.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvedit.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tview$(ExOBJ):: ../classes/tview.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tvintl$(ExOBJ):: ../classes/tvintl.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tvtext1$(ExOBJ):: ../classes/tvtext1.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/checkbox.h \
+ $(INCLUDE_DIR)/tv/clrdlg.h \
+ $(INCLUDE_DIR)/tv/clrselct.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/cmdset.h \
+ $(INCLUDE_DIR)/tv/colorsel.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/dirlibo.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/editors.h \
+ $(INCLUDE_DIR)/tv/filinfpn.h \
+ $(INCLUDE_DIR)/tv/frame.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/history.h \
+ $(INCLUDE_DIR)/tv/indicato.h \
+ $(INCLUDE_DIR)/tv/inputln.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/listbox.h \
+ $(INCLUDE_DIR)/tv/lstviewr.h \
+ $(INCLUDE_DIR)/tv/menubox.h \
+ $(INCLUDE_DIR)/tv/menus.h \
+ $(INCLUDE_DIR)/tv/menuview.h \
+ $(INCLUDE_DIR)/tv/mnoselct.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/radiobtn.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/searchrc.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/statslin.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tvtext2$(ExOBJ):: ../classes/tvtext2.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/twindow$(ExOBJ):: ../classes/twindow.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/frame.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/palette.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/scrlbar.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/unixdis$(ExOBJ):: ../classes/unix/unixdis.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/screen.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/unixkey$(ExOBJ):: ../classes/unix/unixkey.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/key.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/unixmouse$(ExOBJ):: ../classes/unix/unixmouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/mouse.h \
+ $(INCLUDE_DIR)/tv/unix/screen.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/unixscr$(ExOBJ):: ../classes/unix/unixscr.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/linux/mouse.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/key.h \
+ $(INCLUDE_DIR)/tv/unix/mouse.h \
+ $(INCLUDE_DIR)/tv/unix/screen.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/vesa$(ExOBJ):: ../classes/dos/vesa.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/vga$(ExOBJ):: ../classes/dos/vga.cc \
+ $(CLASSES_DIR)/dos/vgastate.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/vgaregs$(ExOBJ):: ../classes/dos/vgaregs.c \
+ $(CLASSES_DIR)/dos/vgaregs.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/vgastate$(ExOBJ):: ../classes/dos/vgastate.c \
+ $(CLASSES_DIR)/dos/vgaregs.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/win32clip$(ExOBJ):: ../classes/win32/win32clip.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/osclipboard.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/win32/win32clip.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/win32dis$(ExOBJ):: ../classes/win32/win32dis.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/win32/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/win32key$(ExOBJ):: ../classes/win32/win32key.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/win32/key.h \
+ $(INCLUDE_DIR)/tv/win32/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/win32mouse$(ExOBJ):: ../classes/win32/win32mouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/win32/key.h \
+ $(INCLUDE_DIR)/tv/win32/mouse.h \
+ $(INCLUDE_DIR)/tv/win32/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/win32scr$(ExOBJ):: ../classes/win32/win32scr.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/win32/key.h \
+ $(INCLUDE_DIR)/tv/win32/mouse.h \
+ $(INCLUDE_DIR)/tv/win32/screen.h \
+ $(INCLUDE_DIR)/tv/win32/win32clip.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/wingrdis$(ExOBJ):: ../classes/wingr/wingrdis.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/app.h \
+ $(INCLUDE_DIR)/tv/button.h \
+ $(INCLUDE_DIR)/tv/checkbox.h \
+ $(INCLUDE_DIR)/tv/cluster.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/desktop.h \
+ $(INCLUDE_DIR)/tv/dialog.h \
+ $(INCLUDE_DIR)/tv/dialogs.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/group.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/label.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/program.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/radiobtn.h \
+ $(INCLUDE_DIR)/tv/rect.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/sitem.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/sttctext.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/window.h \
+ $(INCLUDE_DIR)/tv/wingr/key.h \
+ $(INCLUDE_DIR)/tv/wingr/mouse.h \
+ $(INCLUDE_DIR)/tv/wingr/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/wingrkey$(ExOBJ):: ../classes/wingr/wingrkey.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tkeyext.h \
+ $(INCLUDE_DIR)/tv/tkeys.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/wingr/key.h \
+ $(INCLUDE_DIR)/tv/wingr/mouse.h \
+ $(INCLUDE_DIR)/tv/wingr/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/wingrmouse$(ExOBJ):: ../classes/wingr/wingrmouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/wingr/key.h \
+ $(INCLUDE_DIR)/tv/wingr/mouse.h \
+ $(INCLUDE_DIR)/tv/wingr/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/wingrscr$(ExOBJ):: ../classes/wingr/wingrscr.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/wingr/key.h \
+ $(INCLUDE_DIR)/tv/wingr/mouse.h \
+ $(INCLUDE_DIR)/tv/wingr/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/winntdis$(ExOBJ):: ../classes/winnt/winntdis.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/frame.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/object.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/streambl.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvobjs.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/view.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/winnt/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/winntkey$(ExOBJ):: ../classes/winnt/winntkey.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/winnt/key.h \
+ $(INCLUDE_DIR)/tv/winnt/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/winntmouse$(ExOBJ):: ../classes/winnt/winntmouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/winnt/mouse.h \
+ $(INCLUDE_DIR)/tv/winnt/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/winntscr$(ExOBJ):: ../classes/winnt/winntscr.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/win32/win32clip.h \
+ $(INCLUDE_DIR)/tv/winnt/key.h \
+ $(INCLUDE_DIR)/tv/winnt/mouse.h \
+ $(INCLUDE_DIR)/tv/winnt/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/x11dis$(ExOBJ):: ../classes/x11/x11dis.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/x11/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/x11key$(ExOBJ):: ../classes/x11/x11key.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/x11/key.h \
+ $(INCLUDE_DIR)/tv/x11/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/x11mouse$(ExOBJ):: ../classes/x11/x11mouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/x11/mouse.h \
+ $(INCLUDE_DIR)/tv/x11/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/x11src$(ExOBJ):: ../classes/x11/x11src.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/osclipboard.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(INCLUDE_DIR)/tv/x11/key.h \
+ $(INCLUDE_DIR)/tv/x11/mouse.h \
+ $(INCLUDE_DIR)/tv/x11/screen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/xtermdis$(ExOBJ):: ../classes/unix/xtermdis.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/linux/log.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/xtkey.h \
+ $(INCLUDE_DIR)/tv/unix/xtscreen.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/xtermkey$(ExOBJ):: ../classes/unix/xtermkey.cc \
+ $(INCLUDE_DIR)/cl/unistd.h \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/linux/log.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/xtkey.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/xtermmouse$(ExOBJ):: ../classes/unix/xtermmouse.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/eventqu.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/linux/log.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/mouse.h \
+ $(INCLUDE_DIR)/tv/unix/xtmouse.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/xtermscr$(ExOBJ):: ../classes/unix/xtermscr.cc \
+ $(INCLUDE_DIR)/compatlayer.h \
+ $(INCLUDE_DIR)/tv.h \
+ $(INCLUDE_DIR)/tv/codepage.h \
+ $(INCLUDE_DIR)/tv/configtv.h \
+ $(INCLUDE_DIR)/tv/drawbuf.h \
+ $(INCLUDE_DIR)/tv/event.h \
+ $(INCLUDE_DIR)/tv/gkey.h \
+ $(INCLUDE_DIR)/tv/intl.h \
+ $(INCLUDE_DIR)/tv/ipstream.h \
+ $(INCLUDE_DIR)/tv/linux/log.h \
+ $(INCLUDE_DIR)/tv/objects.h \
+ $(INCLUDE_DIR)/tv/opstream.h \
+ $(INCLUDE_DIR)/tv/parttree.h \
+ $(INCLUDE_DIR)/tv/point.h \
+ $(INCLUDE_DIR)/tv/pstream.h \
+ $(INCLUDE_DIR)/tv/screen.h \
+ $(INCLUDE_DIR)/tv/ssc_streams.h \
+ $(INCLUDE_DIR)/tv/stddlg.h \
+ $(INCLUDE_DIR)/tv/system.h \
+ $(INCLUDE_DIR)/tv/tobjstrm.h \
+ $(INCLUDE_DIR)/tv/ttypes.h \
+ $(INCLUDE_DIR)/tv/tvconfig.h \
+ $(INCLUDE_DIR)/tv/tvutil.h \
+ $(INCLUDE_DIR)/tv/unix/mouse.h \
+ $(INCLUDE_DIR)/tv/unix/xtkey.h \
+ $(INCLUDE_DIR)/tv/unix/xtmouse.h \
+ $(INCLUDE_DIR)/tv/unix/xtscreen.h \
+ $(INCLUDE_DIR)/tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/makes/librhtv.mkf b/tvision/makes/librhtv.mkf
new file mode 100644
index 0000000..ebafbd5
--- /dev/null
+++ b/tvision/makes/librhtv.mkf
@@ -0,0 +1,50 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+vpath_src=.. ../classes ../classes/dos ../classes/linux ../classes/qnxrtp \
+ ../classes/unix ../classes/win32 ../classes/wingr ../classes/winnt \
+ ../classes/x11 ../classes/qnx4 ../compat ../stream ../names
+vpath_obj=obj
+#
+# Include directories
+#
+INCLUDE_DIR=../include
+CLASSES_DIR=../classes
+EXTRA_SRC_DIR=..
+COMMON_IMK=common.imk
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+include $(COMMON_IMK)
+
+INCLUDE_DIRS=$(INCLUDE_DIR) $(EXTRA_INCLUDE_DIRS)
+
+#
+# All the RHIDE data should come from here.
+#
+include librhtv$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+include includer.imk
+
diff --git a/tvision/makes/librhtv.umk b/tvision/makes/librhtv.umk
new file mode 100644
index 0000000..d575955
--- /dev/null
+++ b/tvision/makes/librhtv.umk
@@ -0,0 +1,1463 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ ../makes/obj/beep$(ExOBJ) \
+ ../makes/obj/drivevalid$(ExOBJ) \
+ ../makes/obj/expandpath$(ExOBJ) \
+ ../makes/obj/fexpand$(ExOBJ) \
+ ../makes/obj/fileattrs$(ExOBJ) \
+ ../makes/obj/fileexists$(ExOBJ) \
+ ../makes/obj/filelength$(ExOBJ) \
+ ../makes/obj/fixpath$(ExOBJ) \
+ ../makes/obj/fnmatch$(ExOBJ) \
+ ../makes/obj/getcurdir$(ExOBJ) \
+ ../makes/obj/getline$(ExOBJ) \
+ ../makes/obj/getopt$(ExOBJ) \
+ ../makes/obj/getopt1$(ExOBJ) \
+ ../makes/obj/getshell$(ExOBJ) \
+ ../makes/obj/glob$(ExOBJ) \
+ ../makes/obj/globfree$(ExOBJ) \
+ ../makes/obj/iffilelen$(ExOBJ) \
+ ../makes/obj/isdir$(ExOBJ) \
+ ../makes/obj/isrelpath$(ExOBJ) \
+ ../makes/obj/iswild$(ExOBJ) \
+ ../makes/obj/itoa$(ExOBJ) \
+ ../makes/obj/mkstemp$(ExOBJ) \
+ ../makes/obj/nl_langinfo$(ExOBJ) \
+ ../makes/obj/ntdirent$(ExOBJ) \
+ ../makes/obj/pathvalid$(ExOBJ) \
+ ../makes/obj/regex$(ExOBJ) \
+ ../makes/obj/releasec$(ExOBJ) \
+ ../makes/obj/snprintf$(ExOBJ) \
+ ../makes/obj/ssc_streams$(ExOBJ) \
+ ../makes/obj/strlwr$(ExOBJ) \
+ ../makes/obj/strupr$(ExOBJ) \
+ ../makes/obj/ticks$(ExOBJ) \
+ ../makes/obj/unc$(ExOBJ) \
+ ../makes/obj/unc_95$(ExOBJ) \
+ ../makes/obj/unc_nt$(ExOBJ) \
+ ../makes/obj/validfilename$(ExOBJ) \
+ ../makes/obj/yieldpro$(ExOBJ) \
+ obj/alcon$(ExOBJ) \
+ obj/alcondis$(ExOBJ) \
+ obj/alconkey$(ExOBJ) \
+ obj/alconmouse$(ExOBJ) \
+ obj/alconscr$(ExOBJ) \
+ obj/calcdisp$(ExOBJ) \
+ obj/calculat$(ExOBJ) \
+ obj/codepage$(ExOBJ) \
+ obj/configfile$(ExOBJ) \
+ obj/dosdis$(ExOBJ) \
+ obj/doskey$(ExOBJ) \
+ obj/dosmouse$(ExOBJ) \
+ obj/dosscr$(ExOBJ) \
+ obj/drivers2$(ExOBJ) \
+ obj/dual$(ExOBJ) \
+ obj/fileview$(ExOBJ) \
+ obj/fontcoll$(ExOBJ) \
+ obj/fpbase$(ExOBJ) \
+ obj/fpstream$(ExOBJ) \
+ obj/help$(ExOBJ) \
+ obj/helpbase$(ExOBJ) \
+ obj/histlist$(ExOBJ) \
+ obj/ifpstrea$(ExOBJ) \
+ obj/iopstrea$(ExOBJ) \
+ obj/ipstream$(ExOBJ) \
+ obj/linuxdis$(ExOBJ) \
+ obj/linuxkey$(ExOBJ) \
+ obj/linuxmouse$(ExOBJ) \
+ obj/linuxscr$(ExOBJ) \
+ obj/misc$(ExOBJ) \
+ obj/msgbox$(ExOBJ) \
+ obj/nbackgro$(ExOBJ) \
+ obj/nbutton$(ExOBJ) \
+ obj/ncalcdis$(ExOBJ) \
+ obj/ncalcula$(ExOBJ) \
+ obj/nchdirdi$(ExOBJ) \
+ obj/ncheckbo$(ExOBJ) \
+ obj/nclrdisp$(ExOBJ) \
+ obj/ncluster$(ExOBJ) \
+ obj/ncollect$(ExOBJ) \
+ obj/ncolordi$(ExOBJ) \
+ obj/ncolorgr$(ExOBJ) \
+ obj/ncolorit$(ExOBJ) \
+ obj/ncolorse$(ExOBJ) \
+ obj/ndesktop$(ExOBJ) \
+ obj/ndialog$(ExOBJ) \
+ obj/ndircoll$(ExOBJ) \
+ obj/ndirlist$(ExOBJ) \
+ obj/neditor$(ExOBJ) \
+ obj/neditwi$(ExOBJ) \
+ obj/newstr$(ExOBJ) \
+ obj/nfilecol$(ExOBJ) \
+ obj/nfiledia$(ExOBJ) \
+ obj/nfiledtr$(ExOBJ) \
+ obj/nfileinf$(ExOBJ) \
+ obj/nfileinp$(ExOBJ) \
+ obj/nfilelis$(ExOBJ) \
+ obj/nfilterv$(ExOBJ) \
+ obj/nframe$(ExOBJ) \
+ obj/ngroup$(ExOBJ) \
+ obj/nhistory$(ExOBJ) \
+ obj/nindicat$(ExOBJ) \
+ obj/ninputli$(ExOBJ) \
+ obj/nlabel$(ExOBJ) \
+ obj/nlistbox$(ExOBJ) \
+ obj/nlistvie$(ExOBJ) \
+ obj/nlookupv$(ExOBJ) \
+ obj/nmemo$(ExOBJ) \
+ obj/nmenubar$(ExOBJ) \
+ obj/nmenubox$(ExOBJ) \
+ obj/nmenuvie$(ExOBJ) \
+ obj/nmonosel$(ExOBJ) \
+ obj/nparamte$(ExOBJ) \
+ obj/npxvalid$(ExOBJ) \
+ obj/nradiobu$(ExOBJ) \
+ obj/nrangeva$(ExOBJ) \
+ obj/nresourc$(ExOBJ) \
+ obj/nscrollb$(ExOBJ) \
+ obj/nscrolle$(ExOBJ) \
+ obj/nsortedc$(ExOBJ) \
+ obj/nsortedl$(ExOBJ) \
+ obj/nstatict$(ExOBJ) \
+ obj/nstatusl$(ExOBJ) \
+ obj/nstringc$(ExOBJ) \
+ obj/nstringl$(ExOBJ) \
+ obj/nvalidat$(ExOBJ) \
+ obj/nview$(ExOBJ) \
+ obj/nwindow$(ExOBJ) \
+ obj/ofpstrea$(ExOBJ) \
+ obj/opstream$(ExOBJ) \
+ obj/osclipboard$(ExOBJ) \
+ obj/pstream$(ExOBJ) \
+ obj/qnx4dis$(ExOBJ) \
+ obj/qnx4key$(ExOBJ) \
+ obj/qnx4mouse$(ExOBJ) \
+ obj/qnx4scr$(ExOBJ) \
+ obj/qnxdis$(ExOBJ) \
+ obj/qnxkey$(ExOBJ) \
+ obj/qnxmouse$(ExOBJ) \
+ obj/qnxscr$(ExOBJ) \
+ obj/rhscreen$(ExOBJ) \
+ obj/sbackgro$(ExOBJ) \
+ obj/sbutton$(ExOBJ) \
+ obj/scalcdis$(ExOBJ) \
+ obj/scalcula$(ExOBJ) \
+ obj/schdirdi$(ExOBJ) \
+ obj/scheckbo$(ExOBJ) \
+ obj/sclrdisp$(ExOBJ) \
+ obj/scluster$(ExOBJ) \
+ obj/scolordi$(ExOBJ) \
+ obj/scolorgr$(ExOBJ) \
+ obj/scolorit$(ExOBJ) \
+ obj/scolorse$(ExOBJ) \
+ obj/screen$(ExOBJ) \
+ obj/sdesktop$(ExOBJ) \
+ obj/sdialog$(ExOBJ) \
+ obj/sdircoll$(ExOBJ) \
+ obj/sdirlist$(ExOBJ) \
+ obj/seditor$(ExOBJ) \
+ obj/seditwin$(ExOBJ) \
+ obj/sescreen$(ExOBJ) \
+ obj/sfilecol$(ExOBJ) \
+ obj/sfiledia$(ExOBJ) \
+ obj/sfileedi$(ExOBJ) \
+ obj/sfileinf$(ExOBJ) \
+ obj/sfileinp$(ExOBJ) \
+ obj/sfilelis$(ExOBJ) \
+ obj/sfilterv$(ExOBJ) \
+ obj/sframe$(ExOBJ) \
+ obj/sgroup$(ExOBJ) \
+ obj/shistory$(ExOBJ) \
+ obj/sindicat$(ExOBJ) \
+ obj/sinputli$(ExOBJ) \
+ obj/slabel$(ExOBJ) \
+ obj/slistbox$(ExOBJ) \
+ obj/slistvie$(ExOBJ) \
+ obj/slookupv$(ExOBJ) \
+ obj/smemo$(ExOBJ) \
+ obj/smenubar$(ExOBJ) \
+ obj/smenubox$(ExOBJ) \
+ obj/smenuvie$(ExOBJ) \
+ obj/smonosel$(ExOBJ) \
+ obj/sparamte$(ExOBJ) \
+ obj/spxvalid$(ExOBJ) \
+ obj/sradiobu$(ExOBJ) \
+ obj/srangeva$(ExOBJ) \
+ obj/sresourc$(ExOBJ) \
+ obj/sscrollb$(ExOBJ) \
+ obj/sscrolle$(ExOBJ) \
+ obj/sstatict$(ExOBJ) \
+ obj/sstatusl$(ExOBJ) \
+ obj/sstringc$(ExOBJ) \
+ obj/sstringl$(ExOBJ) \
+ obj/sview$(ExOBJ) \
+ obj/swindow$(ExOBJ) \
+ obj/tapplica$(ExOBJ) \
+ obj/tbackgro$(ExOBJ) \
+ obj/tbutton$(ExOBJ) \
+ obj/tchdirdi$(ExOBJ) \
+ obj/tcheckbo$(ExOBJ) \
+ obj/tclrdisp$(ExOBJ) \
+ obj/tcluster$(ExOBJ) \
+ obj/tcollect$(ExOBJ) \
+ obj/tcolordi$(ExOBJ) \
+ obj/tcolorgr$(ExOBJ) \
+ obj/tcolorit$(ExOBJ) \
+ obj/tcolorse$(ExOBJ) \
+ obj/tcommand$(ExOBJ) \
+ obj/tdesktop$(ExOBJ) \
+ obj/tdialog$(ExOBJ) \
+ obj/tdircoll$(ExOBJ) \
+ obj/tdirlist$(ExOBJ) \
+ obj/tdisplay$(ExOBJ) \
+ obj/tdrawbuf$(ExOBJ) \
+ obj/teditor$(ExOBJ) \
+ obj/teditorf$(ExOBJ) \
+ obj/teditwin$(ExOBJ) \
+ obj/tevent$(ExOBJ) \
+ obj/tfilecol$(ExOBJ) \
+ obj/tfiledia$(ExOBJ) \
+ obj/tfileedi$(ExOBJ) \
+ obj/tfileinf$(ExOBJ) \
+ obj/tfileinp$(ExOBJ) \
+ obj/tfilelis$(ExOBJ) \
+ obj/tfilterv$(ExOBJ) \
+ obj/tframe$(ExOBJ) \
+ obj/tgkey$(ExOBJ) \
+ obj/tgroup$(ExOBJ) \
+ obj/thistory$(ExOBJ) \
+ obj/thistvie$(ExOBJ) \
+ obj/thistwin$(ExOBJ) \
+ obj/thwmouse$(ExOBJ) \
+ obj/tindicat$(ExOBJ) \
+ obj/tinputli$(ExOBJ) \
+ obj/tlabel$(ExOBJ) \
+ obj/tlistbox$(ExOBJ) \
+ obj/tlistvie$(ExOBJ) \
+ obj/tlookupv$(ExOBJ) \
+ obj/tmemo$(ExOBJ) \
+ obj/tmenubar$(ExOBJ) \
+ obj/tmenubox$(ExOBJ) \
+ obj/tmenuvie$(ExOBJ) \
+ obj/tmonosel$(ExOBJ) \
+ obj/tmouse$(ExOBJ) \
+ obj/tnscolle$(ExOBJ) \
+ obj/tnssorte$(ExOBJ) \
+ obj/tobject$(ExOBJ) \
+ obj/tpalette$(ExOBJ) \
+ obj/tparamte$(ExOBJ) \
+ obj/tpoint$(ExOBJ) \
+ obj/tprogini$(ExOBJ) \
+ obj/tprogram$(ExOBJ) \
+ obj/tpwobj$(ExOBJ) \
+ obj/tpwreado$(ExOBJ) \
+ obj/tpwritte$(ExOBJ) \
+ obj/tpxvalid$(ExOBJ) \
+ obj/tradiobu$(ExOBJ) \
+ obj/trangeva$(ExOBJ) \
+ obj/trescoll$(ExOBJ) \
+ obj/tresfile$(ExOBJ) \
+ obj/tscreen$(ExOBJ) \
+ obj/tscrollb$(ExOBJ) \
+ obj/tscrolle$(ExOBJ) \
+ obj/tsortedc$(ExOBJ) \
+ obj/tsortedl$(ExOBJ) \
+ obj/tstatict$(ExOBJ) \
+ obj/tstatusd$(ExOBJ) \
+ obj/tstatusl$(ExOBJ) \
+ obj/tstrinde$(ExOBJ) \
+ obj/tstringc$(ExOBJ) \
+ obj/tstringl$(ExOBJ) \
+ obj/tstrlist$(ExOBJ) \
+ obj/tstrmcla$(ExOBJ) \
+ obj/tstrmtyp$(ExOBJ) \
+ obj/tsubmenu$(ExOBJ) \
+ obj/ttermina$(ExOBJ) \
+ obj/ttextdev$(ExOBJ) \
+ obj/tvalidat$(ExOBJ) \
+ obj/tvedit1$(ExOBJ) \
+ obj/tvedit2$(ExOBJ) \
+ obj/tvedit3$(ExOBJ) \
+ obj/tview$(ExOBJ) \
+ obj/tvintl$(ExOBJ) \
+ obj/tvtext1$(ExOBJ) \
+ obj/tvtext2$(ExOBJ) \
+ obj/twindow$(ExOBJ) \
+ obj/unixdis$(ExOBJ) \
+ obj/unixkey$(ExOBJ) \
+ obj/unixmouse$(ExOBJ) \
+ obj/unixscr$(ExOBJ) \
+ obj/vesa$(ExOBJ) \
+ obj/vga$(ExOBJ) \
+ obj/vgaregs$(ExOBJ) \
+ obj/vgastate$(ExOBJ) \
+ obj/win32clip$(ExOBJ) \
+ obj/win32dis$(ExOBJ) \
+ obj/win32key$(ExOBJ) \
+ obj/win32mouse$(ExOBJ) \
+ obj/win32scr$(ExOBJ) \
+ obj/wingrdis$(ExOBJ) \
+ obj/wingrkey$(ExOBJ) \
+ obj/wingrmouse$(ExOBJ) \
+ obj/wingrscr$(ExOBJ) \
+ obj/winntdis$(ExOBJ) \
+ obj/winntkey$(ExOBJ) \
+ obj/winntmouse$(ExOBJ) \
+ obj/winntscr$(ExOBJ) \
+ obj/x11dis$(ExOBJ) \
+ obj/x11key$(ExOBJ) \
+ obj/x11mouse$(ExOBJ) \
+ obj/x11src$(ExOBJ) \
+ obj/xtermdis$(ExOBJ) \
+ obj/xtermkey$(ExOBJ) \
+ obj/xtermmouse$(ExOBJ) \
+ obj/xtermscr$(ExOBJ)
+
+LIBRARIES=
+
+librhtv$(ExLIB):: \
+ ../makes/obj/beep$(ExOBJ) \
+ ../makes/obj/drivevalid$(ExOBJ) \
+ ../makes/obj/expandpath$(ExOBJ) \
+ ../makes/obj/fexpand$(ExOBJ) \
+ ../makes/obj/fileattrs$(ExOBJ) \
+ ../makes/obj/fileexists$(ExOBJ) \
+ ../makes/obj/filelength$(ExOBJ) \
+ ../makes/obj/fixpath$(ExOBJ) \
+ ../makes/obj/fnmatch$(ExOBJ) \
+ ../makes/obj/getcurdir$(ExOBJ) \
+ ../makes/obj/getline$(ExOBJ) \
+ ../makes/obj/getopt$(ExOBJ) \
+ ../makes/obj/getopt1$(ExOBJ) \
+ ../makes/obj/getshell$(ExOBJ) \
+ ../makes/obj/glob$(ExOBJ) \
+ ../makes/obj/globfree$(ExOBJ) \
+ ../makes/obj/iffilelen$(ExOBJ) \
+ ../makes/obj/isdir$(ExOBJ) \
+ ../makes/obj/isrelpath$(ExOBJ) \
+ ../makes/obj/iswild$(ExOBJ) \
+ ../makes/obj/itoa$(ExOBJ) \
+ ../makes/obj/mkstemp$(ExOBJ) \
+ ../makes/obj/nl_langinfo$(ExOBJ) \
+ ../makes/obj/ntdirent$(ExOBJ) \
+ ../makes/obj/pathvalid$(ExOBJ) \
+ ../makes/obj/regex$(ExOBJ) \
+ ../makes/obj/releasec$(ExOBJ) \
+ ../makes/obj/snprintf$(ExOBJ) \
+ ../makes/obj/ssc_streams$(ExOBJ) \
+ ../makes/obj/strlwr$(ExOBJ) \
+ ../makes/obj/strupr$(ExOBJ) \
+ ../makes/obj/ticks$(ExOBJ) \
+ ../makes/obj/unc$(ExOBJ) \
+ ../makes/obj/unc_95$(ExOBJ) \
+ ../makes/obj/unc_nt$(ExOBJ) \
+ ../makes/obj/validfilename$(ExOBJ) \
+ ../makes/obj/yieldpro$(ExOBJ) \
+ obj/alcon$(ExOBJ) \
+ obj/alcondis$(ExOBJ) \
+ obj/alconkey$(ExOBJ) \
+ obj/alconmouse$(ExOBJ) \
+ obj/alconscr$(ExOBJ) \
+ obj/calcdisp$(ExOBJ) \
+ obj/calculat$(ExOBJ) \
+ obj/codepage$(ExOBJ) \
+ obj/configfile$(ExOBJ) \
+ obj/dosdis$(ExOBJ) \
+ obj/doskey$(ExOBJ) \
+ obj/dosmouse$(ExOBJ) \
+ obj/dosscr$(ExOBJ) \
+ obj/drivers2$(ExOBJ) \
+ obj/dual$(ExOBJ) \
+ obj/fileview$(ExOBJ) \
+ obj/fontcoll$(ExOBJ) \
+ obj/fpbase$(ExOBJ) \
+ obj/fpstream$(ExOBJ) \
+ obj/help$(ExOBJ) \
+ obj/helpbase$(ExOBJ) \
+ obj/histlist$(ExOBJ) \
+ obj/ifpstrea$(ExOBJ) \
+ obj/iopstrea$(ExOBJ) \
+ obj/ipstream$(ExOBJ) \
+ obj/linuxdis$(ExOBJ) \
+ obj/linuxkey$(ExOBJ) \
+ obj/linuxmouse$(ExOBJ) \
+ obj/linuxscr$(ExOBJ) \
+ obj/misc$(ExOBJ) \
+ obj/msgbox$(ExOBJ) \
+ obj/nbackgro$(ExOBJ) \
+ obj/nbutton$(ExOBJ) \
+ obj/ncalcdis$(ExOBJ) \
+ obj/ncalcula$(ExOBJ) \
+ obj/nchdirdi$(ExOBJ) \
+ obj/ncheckbo$(ExOBJ) \
+ obj/nclrdisp$(ExOBJ) \
+ obj/ncluster$(ExOBJ) \
+ obj/ncollect$(ExOBJ) \
+ obj/ncolordi$(ExOBJ) \
+ obj/ncolorgr$(ExOBJ) \
+ obj/ncolorit$(ExOBJ) \
+ obj/ncolorse$(ExOBJ) \
+ obj/ndesktop$(ExOBJ) \
+ obj/ndialog$(ExOBJ) \
+ obj/ndircoll$(ExOBJ) \
+ obj/ndirlist$(ExOBJ) \
+ obj/neditor$(ExOBJ) \
+ obj/neditwi$(ExOBJ) \
+ obj/newstr$(ExOBJ) \
+ obj/nfilecol$(ExOBJ) \
+ obj/nfiledia$(ExOBJ) \
+ obj/nfiledtr$(ExOBJ) \
+ obj/nfileinf$(ExOBJ) \
+ obj/nfileinp$(ExOBJ) \
+ obj/nfilelis$(ExOBJ) \
+ obj/nfilterv$(ExOBJ) \
+ obj/nframe$(ExOBJ) \
+ obj/ngroup$(ExOBJ) \
+ obj/nhistory$(ExOBJ) \
+ obj/nindicat$(ExOBJ) \
+ obj/ninputli$(ExOBJ) \
+ obj/nlabel$(ExOBJ) \
+ obj/nlistbox$(ExOBJ) \
+ obj/nlistvie$(ExOBJ) \
+ obj/nlookupv$(ExOBJ) \
+ obj/nmemo$(ExOBJ) \
+ obj/nmenubar$(ExOBJ) \
+ obj/nmenubox$(ExOBJ) \
+ obj/nmenuvie$(ExOBJ) \
+ obj/nmonosel$(ExOBJ) \
+ obj/nparamte$(ExOBJ) \
+ obj/npxvalid$(ExOBJ) \
+ obj/nradiobu$(ExOBJ) \
+ obj/nrangeva$(ExOBJ) \
+ obj/nresourc$(ExOBJ) \
+ obj/nscrollb$(ExOBJ) \
+ obj/nscrolle$(ExOBJ) \
+ obj/nsortedc$(ExOBJ) \
+ obj/nsortedl$(ExOBJ) \
+ obj/nstatict$(ExOBJ) \
+ obj/nstatusl$(ExOBJ) \
+ obj/nstringc$(ExOBJ) \
+ obj/nstringl$(ExOBJ) \
+ obj/nvalidat$(ExOBJ) \
+ obj/nview$(ExOBJ) \
+ obj/nwindow$(ExOBJ) \
+ obj/ofpstrea$(ExOBJ) \
+ obj/opstream$(ExOBJ) \
+ obj/osclipboard$(ExOBJ) \
+ obj/pstream$(ExOBJ) \
+ obj/qnx4dis$(ExOBJ) \
+ obj/qnx4key$(ExOBJ) \
+ obj/qnx4mouse$(ExOBJ) \
+ obj/qnx4scr$(ExOBJ) \
+ obj/qnxdis$(ExOBJ) \
+ obj/qnxkey$(ExOBJ) \
+ obj/qnxmouse$(ExOBJ) \
+ obj/qnxscr$(ExOBJ) \
+ obj/rhscreen$(ExOBJ) \
+ obj/sbackgro$(ExOBJ) \
+ obj/sbutton$(ExOBJ) \
+ obj/scalcdis$(ExOBJ) \
+ obj/scalcula$(ExOBJ) \
+ obj/schdirdi$(ExOBJ) \
+ obj/scheckbo$(ExOBJ) \
+ obj/sclrdisp$(ExOBJ) \
+ obj/scluster$(ExOBJ) \
+ obj/scolordi$(ExOBJ) \
+ obj/scolorgr$(ExOBJ) \
+ obj/scolorit$(ExOBJ) \
+ obj/scolorse$(ExOBJ) \
+ obj/screen$(ExOBJ) \
+ obj/sdesktop$(ExOBJ) \
+ obj/sdialog$(ExOBJ) \
+ obj/sdircoll$(ExOBJ) \
+ obj/sdirlist$(ExOBJ) \
+ obj/seditor$(ExOBJ) \
+ obj/seditwin$(ExOBJ) \
+ obj/sescreen$(ExOBJ) \
+ obj/sfilecol$(ExOBJ) \
+ obj/sfiledia$(ExOBJ) \
+ obj/sfileedi$(ExOBJ) \
+ obj/sfileinf$(ExOBJ) \
+ obj/sfileinp$(ExOBJ) \
+ obj/sfilelis$(ExOBJ) \
+ obj/sfilterv$(ExOBJ) \
+ obj/sframe$(ExOBJ) \
+ obj/sgroup$(ExOBJ) \
+ obj/shistory$(ExOBJ) \
+ obj/sindicat$(ExOBJ) \
+ obj/sinputli$(ExOBJ) \
+ obj/slabel$(ExOBJ) \
+ obj/slistbox$(ExOBJ) \
+ obj/slistvie$(ExOBJ) \
+ obj/slookupv$(ExOBJ) \
+ obj/smemo$(ExOBJ) \
+ obj/smenubar$(ExOBJ) \
+ obj/smenubox$(ExOBJ) \
+ obj/smenuvie$(ExOBJ) \
+ obj/smonosel$(ExOBJ) \
+ obj/sparamte$(ExOBJ) \
+ obj/spxvalid$(ExOBJ) \
+ obj/sradiobu$(ExOBJ) \
+ obj/srangeva$(ExOBJ) \
+ obj/sresourc$(ExOBJ) \
+ obj/sscrollb$(ExOBJ) \
+ obj/sscrolle$(ExOBJ) \
+ obj/sstatict$(ExOBJ) \
+ obj/sstatusl$(ExOBJ) \
+ obj/sstringc$(ExOBJ) \
+ obj/sstringl$(ExOBJ) \
+ obj/sview$(ExOBJ) \
+ obj/swindow$(ExOBJ) \
+ obj/tapplica$(ExOBJ) \
+ obj/tbackgro$(ExOBJ) \
+ obj/tbutton$(ExOBJ) \
+ obj/tchdirdi$(ExOBJ) \
+ obj/tcheckbo$(ExOBJ) \
+ obj/tclrdisp$(ExOBJ) \
+ obj/tcluster$(ExOBJ) \
+ obj/tcollect$(ExOBJ) \
+ obj/tcolordi$(ExOBJ) \
+ obj/tcolorgr$(ExOBJ) \
+ obj/tcolorit$(ExOBJ) \
+ obj/tcolorse$(ExOBJ) \
+ obj/tcommand$(ExOBJ) \
+ obj/tdesktop$(ExOBJ) \
+ obj/tdialog$(ExOBJ) \
+ obj/tdircoll$(ExOBJ) \
+ obj/tdirlist$(ExOBJ) \
+ obj/tdisplay$(ExOBJ) \
+ obj/tdrawbuf$(ExOBJ) \
+ obj/teditor$(ExOBJ) \
+ obj/teditorf$(ExOBJ) \
+ obj/teditwin$(ExOBJ) \
+ obj/tevent$(ExOBJ) \
+ obj/tfilecol$(ExOBJ) \
+ obj/tfiledia$(ExOBJ) \
+ obj/tfileedi$(ExOBJ) \
+ obj/tfileinf$(ExOBJ) \
+ obj/tfileinp$(ExOBJ) \
+ obj/tfilelis$(ExOBJ) \
+ obj/tfilterv$(ExOBJ) \
+ obj/tframe$(ExOBJ) \
+ obj/tgkey$(ExOBJ) \
+ obj/tgroup$(ExOBJ) \
+ obj/thistory$(ExOBJ) \
+ obj/thistvie$(ExOBJ) \
+ obj/thistwin$(ExOBJ) \
+ obj/thwmouse$(ExOBJ) \
+ obj/tindicat$(ExOBJ) \
+ obj/tinputli$(ExOBJ) \
+ obj/tlabel$(ExOBJ) \
+ obj/tlistbox$(ExOBJ) \
+ obj/tlistvie$(ExOBJ) \
+ obj/tlookupv$(ExOBJ) \
+ obj/tmemo$(ExOBJ) \
+ obj/tmenubar$(ExOBJ) \
+ obj/tmenubox$(ExOBJ) \
+ obj/tmenuvie$(ExOBJ) \
+ obj/tmonosel$(ExOBJ) \
+ obj/tmouse$(ExOBJ) \
+ obj/tnscolle$(ExOBJ) \
+ obj/tnssorte$(ExOBJ) \
+ obj/tobject$(ExOBJ) \
+ obj/tpalette$(ExOBJ) \
+ obj/tparamte$(ExOBJ) \
+ obj/tpoint$(ExOBJ) \
+ obj/tprogini$(ExOBJ) \
+ obj/tprogram$(ExOBJ) \
+ obj/tpwobj$(ExOBJ) \
+ obj/tpwreado$(ExOBJ) \
+ obj/tpwritte$(ExOBJ) \
+ obj/tpxvalid$(ExOBJ) \
+ obj/tradiobu$(ExOBJ) \
+ obj/trangeva$(ExOBJ) \
+ obj/trescoll$(ExOBJ) \
+ obj/tresfile$(ExOBJ) \
+ obj/tscreen$(ExOBJ) \
+ obj/tscrollb$(ExOBJ) \
+ obj/tscrolle$(ExOBJ) \
+ obj/tsortedc$(ExOBJ) \
+ obj/tsortedl$(ExOBJ) \
+ obj/tstatict$(ExOBJ) \
+ obj/tstatusd$(ExOBJ) \
+ obj/tstatusl$(ExOBJ) \
+ obj/tstrinde$(ExOBJ) \
+ obj/tstringc$(ExOBJ) \
+ obj/tstringl$(ExOBJ) \
+ obj/tstrlist$(ExOBJ) \
+ obj/tstrmcla$(ExOBJ) \
+ obj/tstrmtyp$(ExOBJ) \
+ obj/tsubmenu$(ExOBJ) \
+ obj/ttermina$(ExOBJ) \
+ obj/ttextdev$(ExOBJ) \
+ obj/tvalidat$(ExOBJ) \
+ obj/tvedit1$(ExOBJ) \
+ obj/tvedit2$(ExOBJ) \
+ obj/tvedit3$(ExOBJ) \
+ obj/tview$(ExOBJ) \
+ obj/tvintl$(ExOBJ) \
+ obj/tvtext1$(ExOBJ) \
+ obj/tvtext2$(ExOBJ) \
+ obj/twindow$(ExOBJ) \
+ obj/unixdis$(ExOBJ) \
+ obj/unixkey$(ExOBJ) \
+ obj/unixmouse$(ExOBJ) \
+ obj/unixscr$(ExOBJ) \
+ obj/vesa$(ExOBJ) \
+ obj/vga$(ExOBJ) \
+ obj/vgaregs$(ExOBJ) \
+ obj/vgastate$(ExOBJ) \
+ obj/win32clip$(ExOBJ) \
+ obj/win32dis$(ExOBJ) \
+ obj/win32key$(ExOBJ) \
+ obj/win32mouse$(ExOBJ) \
+ obj/win32scr$(ExOBJ) \
+ obj/wingrdis$(ExOBJ) \
+ obj/wingrkey$(ExOBJ) \
+ obj/wingrmouse$(ExOBJ) \
+ obj/wingrscr$(ExOBJ) \
+ obj/winntdis$(ExOBJ) \
+ obj/winntkey$(ExOBJ) \
+ obj/winntmouse$(ExOBJ) \
+ obj/winntscr$(ExOBJ) \
+ obj/x11dis$(ExOBJ) \
+ obj/x11key$(ExOBJ) \
+ obj/x11mouse$(ExOBJ) \
+ obj/x11src$(ExOBJ) \
+ obj/xtermdis$(ExOBJ) \
+ obj/xtermkey$(ExOBJ) \
+ obj/xtermmouse$(ExOBJ) \
+ obj/xtermscr$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+INCLUDE00=../compat/compat$(ExIMK)
+
+obj/alcon$(ExOBJ):: ../classes/alcon/alcon.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/alcondis$(ExOBJ):: ../classes/alcon/alcondis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/alconkey$(ExOBJ):: ../classes/alcon/alconkey.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/alconmouse$(ExOBJ):: ../classes/alcon/alconmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/alconscr$(ExOBJ):: ../classes/alcon/alconscr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/calcdisp$(ExOBJ):: ../classes/calcdisp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/calculat$(ExOBJ):: ../classes/calculat.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/codepage$(ExOBJ):: ../classes/codepage.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/configfile$(ExOBJ):: ../classes/configfile.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dosdis$(ExOBJ):: ../classes/dos/dosdis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/doskey$(ExOBJ):: ../classes/dos/doskey.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dosmouse$(ExOBJ):: ../classes/dos/dosmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dosscr$(ExOBJ):: ../classes/dos/dosscr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/drivers2$(ExOBJ):: ../drivers2.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dual$(ExOBJ):: ../dual.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/fileview$(ExOBJ):: ../fileview.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/fontcoll$(ExOBJ):: ../classes/fontcoll.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/fpbase$(ExOBJ):: ../classes/fpbase.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/fpstream$(ExOBJ):: ../classes/fpstream.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/help$(ExOBJ):: ../classes/help.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/helpbase$(ExOBJ):: ../classes/helpbase.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/histlist$(ExOBJ):: ../histlist.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ifpstrea$(ExOBJ):: ../classes/ifpstrea.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/iopstrea$(ExOBJ):: ../classes/iopstrea.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ipstream$(ExOBJ):: ../classes/ipstream.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/linuxdis$(ExOBJ):: ../classes/linux/linuxdis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/linuxkey$(ExOBJ):: ../classes/linux/linuxkey.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/linuxmouse$(ExOBJ):: ../classes/linux/linuxmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/linuxscr$(ExOBJ):: ../classes/linux/linuxscr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/misc$(ExOBJ):: ../misc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/msgbox$(ExOBJ):: ../msgbox.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nbackgro$(ExOBJ):: ../names/nbackgro.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nbutton$(ExOBJ):: ../names/nbutton.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ncalcdis$(ExOBJ):: ../names/ncalcdis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ncalcula$(ExOBJ):: ../names/ncalcula.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nchdirdi$(ExOBJ):: ../names/nchdirdi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ncheckbo$(ExOBJ):: ../names/ncheckbo.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nclrdisp$(ExOBJ):: ../names/nclrdisp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ncluster$(ExOBJ):: ../names/ncluster.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ncollect$(ExOBJ):: ../names/ncollect.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ncolordi$(ExOBJ):: ../names/ncolordi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ncolorgr$(ExOBJ):: ../names/ncolorgr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ncolorit$(ExOBJ):: ../names/ncolorit.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ncolorse$(ExOBJ):: ../names/ncolorse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndesktop$(ExOBJ):: ../names/ndesktop.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndialog$(ExOBJ):: ../names/ndialog.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndircoll$(ExOBJ):: ../names/ndircoll.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndirlist$(ExOBJ):: ../names/ndirlist.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/neditor$(ExOBJ):: ../names/neditor.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/neditwi$(ExOBJ):: ../names/neditwi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/newstr$(ExOBJ):: ../newstr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nfilecol$(ExOBJ):: ../names/nfilecol.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nfiledia$(ExOBJ):: ../names/nfiledia.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nfiledtr$(ExOBJ):: ../names/nfiledtr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nfileinf$(ExOBJ):: ../names/nfileinf.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nfileinp$(ExOBJ):: ../names/nfileinp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nfilelis$(ExOBJ):: ../names/nfilelis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nfilterv$(ExOBJ):: ../names/nfilterv.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nframe$(ExOBJ):: ../names/nframe.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ngroup$(ExOBJ):: ../names/ngroup.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nhistory$(ExOBJ):: ../names/nhistory.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nindicat$(ExOBJ):: ../names/nindicat.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ninputli$(ExOBJ):: ../names/ninputli.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nlabel$(ExOBJ):: ../names/nlabel.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nlistbox$(ExOBJ):: ../names/nlistbox.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nlistvie$(ExOBJ):: ../names/nlistvie.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nlookupv$(ExOBJ):: ../names/nlookupv.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nmemo$(ExOBJ):: ../names/nmemo.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nmenubar$(ExOBJ):: ../names/nmenubar.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nmenubox$(ExOBJ):: ../names/nmenubox.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nmenuvie$(ExOBJ):: ../names/nmenuvie.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nmonosel$(ExOBJ):: ../names/nmonosel.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nparamte$(ExOBJ):: ../names/nparamte.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/npxvalid$(ExOBJ):: ../names/npxvalid.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nradiobu$(ExOBJ):: ../names/nradiobu.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nrangeva$(ExOBJ):: ../names/nrangeva.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nresourc$(ExOBJ):: ../names/nresourc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nscrollb$(ExOBJ):: ../names/nscrollb.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nscrolle$(ExOBJ):: ../names/nscrolle.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nsortedc$(ExOBJ):: ../names/nsortedc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nsortedl$(ExOBJ):: ../names/nsortedl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nstatict$(ExOBJ):: ../names/nstatict.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nstatusl$(ExOBJ):: ../names/nstatusl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nstringc$(ExOBJ):: ../names/nstringc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nstringl$(ExOBJ):: ../names/nstringl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nvalidat$(ExOBJ):: ../names/nvalidat.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nview$(ExOBJ):: ../names/nview.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nwindow$(ExOBJ):: ../names/nwindow.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ofpstrea$(ExOBJ):: ../classes/ofpstrea.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/opstream$(ExOBJ):: ../classes/opstream.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/osclipboard$(ExOBJ):: ../classes/osclipboard.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/pstream$(ExOBJ):: ../classes/pstream.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/qnx4dis$(ExOBJ):: ../classes/qnx4/qnx4dis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/qnx4key$(ExOBJ):: ../classes/qnx4/qnx4key.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/qnx4mouse$(ExOBJ):: ../classes/qnx4/qnx4mouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/qnx4scr$(ExOBJ):: ../classes/qnx4/qnx4scr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/qnxdis$(ExOBJ):: ../classes/qnxrtp/qnxdis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/qnxkey$(ExOBJ):: ../classes/qnxrtp/qnxkey.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/qnxmouse$(ExOBJ):: ../classes/qnxrtp/qnxmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/qnxscr$(ExOBJ):: ../classes/qnxrtp/qnxscr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/rhscreen$(ExOBJ):: ../classes/dos/rhscreen.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sbackgro$(ExOBJ):: ../stream/sbackgro.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sbutton$(ExOBJ):: ../stream/sbutton.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/scalcdis$(ExOBJ):: ../stream/scalcdis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/scalcula$(ExOBJ):: ../stream/scalcula.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/schdirdi$(ExOBJ):: ../stream/schdirdi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/scheckbo$(ExOBJ):: ../stream/scheckbo.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sclrdisp$(ExOBJ):: ../stream/sclrdisp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/scluster$(ExOBJ):: ../stream/scluster.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/scolordi$(ExOBJ):: ../stream/scolordi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/scolorgr$(ExOBJ):: ../stream/scolorgr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/scolorit$(ExOBJ):: ../stream/scolorit.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/scolorse$(ExOBJ):: ../stream/scolorse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/screen$(ExOBJ):: ../classes/dos/screen.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdesktop$(ExOBJ):: ../stream/sdesktop.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdialog$(ExOBJ):: ../stream/sdialog.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdircoll$(ExOBJ):: ../stream/sdircoll.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdirlist$(ExOBJ):: ../stream/sdirlist.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/seditor$(ExOBJ):: ../stream/seditor.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/seditwin$(ExOBJ):: ../stream/seditwin.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sescreen$(ExOBJ):: ../classes/dos/sescreen.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sfilecol$(ExOBJ):: ../stream/sfilecol.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sfiledia$(ExOBJ):: ../stream/sfiledia.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sfileedi$(ExOBJ):: ../stream/sfileedi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sfileinf$(ExOBJ):: ../stream/sfileinf.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sfileinp$(ExOBJ):: ../stream/sfileinp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sfilelis$(ExOBJ):: ../stream/sfilelis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sfilterv$(ExOBJ):: ../stream/sfilterv.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sframe$(ExOBJ):: ../stream/sframe.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sgroup$(ExOBJ):: ../stream/sgroup.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/shistory$(ExOBJ):: ../stream/shistory.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sindicat$(ExOBJ):: ../stream/sindicat.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sinputli$(ExOBJ):: ../stream/sinputli.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/slabel$(ExOBJ):: ../stream/slabel.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/slistbox$(ExOBJ):: ../stream/slistbox.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/slistvie$(ExOBJ):: ../stream/slistvie.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/slookupv$(ExOBJ):: ../stream/slookupv.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/smemo$(ExOBJ):: ../stream/smemo.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/smenubar$(ExOBJ):: ../stream/smenubar.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/smenubox$(ExOBJ):: ../stream/smenubox.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/smenuvie$(ExOBJ):: ../stream/smenuvie.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/smonosel$(ExOBJ):: ../stream/smonosel.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sparamte$(ExOBJ):: ../stream/sparamte.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/spxvalid$(ExOBJ):: ../stream/spxvalid.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sradiobu$(ExOBJ):: ../stream/sradiobu.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/srangeva$(ExOBJ):: ../stream/srangeva.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sresourc$(ExOBJ):: ../stream/sresourc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sscrollb$(ExOBJ):: ../stream/sscrollb.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sscrolle$(ExOBJ):: ../stream/sscrolle.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sstatict$(ExOBJ):: ../stream/sstatict.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sstatusl$(ExOBJ):: ../stream/sstatusl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sstringc$(ExOBJ):: ../stream/sstringc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sstringl$(ExOBJ):: ../stream/sstringl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sview$(ExOBJ):: ../stream/sview.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/swindow$(ExOBJ):: ../stream/swindow.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tapplica$(ExOBJ):: ../classes/tapplica.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tbackgro$(ExOBJ):: ../classes/tbackgro.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tbutton$(ExOBJ):: ../classes/tbutton.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tchdirdi$(ExOBJ):: ../classes/tchdirdi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tcheckbo$(ExOBJ):: ../classes/tcheckbo.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tclrdisp$(ExOBJ):: ../classes/tclrdisp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tcluster$(ExOBJ):: ../classes/tcluster.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tcollect$(ExOBJ):: ../classes/tcollect.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tcolordi$(ExOBJ):: ../classes/tcolordi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tcolorgr$(ExOBJ):: ../classes/tcolorgr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tcolorit$(ExOBJ):: ../classes/tcolorit.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tcolorse$(ExOBJ):: ../classes/tcolorse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tcommand$(ExOBJ):: ../classes/tcommand.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tdesktop$(ExOBJ):: ../classes/tdesktop.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tdialog$(ExOBJ):: ../classes/tdialog.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tdircoll$(ExOBJ):: ../classes/tdircoll.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tdirlist$(ExOBJ):: ../classes/tdirlist.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tdisplay$(ExOBJ):: ../classes/tdisplay.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tdrawbuf$(ExOBJ):: ../classes/tdrawbuf.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/teditor$(ExOBJ):: ../classes/teditor.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/teditorf$(ExOBJ):: ../classes/teditorf.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/teditwin$(ExOBJ):: ../classes/teditwin.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tevent$(ExOBJ):: ../classes/tevent.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tfilecol$(ExOBJ):: ../classes/tfilecol.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tfiledia$(ExOBJ):: ../classes/tfiledia.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tfileedi$(ExOBJ):: ../classes/tfileedi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tfileinf$(ExOBJ):: ../classes/tfileinf.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tfileinp$(ExOBJ):: ../classes/tfileinp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tfilelis$(ExOBJ):: ../classes/tfilelis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tfilterv$(ExOBJ):: ../classes/tfilterv.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tframe$(ExOBJ):: ../classes/tframe.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tgkey$(ExOBJ):: ../classes/tgkey.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tgroup$(ExOBJ):: ../classes/tgroup.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/thistory$(ExOBJ):: ../classes/thistory.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/thistvie$(ExOBJ):: ../classes/thistvie.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/thistwin$(ExOBJ):: ../classes/thistwin.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/thwmouse$(ExOBJ):: ../classes/thwmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tindicat$(ExOBJ):: ../classes/tindicat.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tinputli$(ExOBJ):: ../classes/tinputli.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tlabel$(ExOBJ):: ../classes/tlabel.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tlistbox$(ExOBJ):: ../classes/tlistbox.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tlistvie$(ExOBJ):: ../classes/tlistvie.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tlookupv$(ExOBJ):: ../classes/tlookupv.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tmemo$(ExOBJ):: ../classes/tmemo.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tmenubar$(ExOBJ):: ../classes/tmenubar.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tmenubox$(ExOBJ):: ../classes/tmenubox.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tmenuvie$(ExOBJ):: ../classes/tmenuvie.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tmonosel$(ExOBJ):: ../classes/tmonosel.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tmouse$(ExOBJ):: ../classes/tmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tnscolle$(ExOBJ):: ../classes/tnscolle.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tnssorte$(ExOBJ):: ../classes/tnssorte.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tobject$(ExOBJ):: ../classes/tobject.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tpalette$(ExOBJ):: ../classes/tpalette.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tparamte$(ExOBJ):: ../classes/tparamte.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tpoint$(ExOBJ):: ../classes/tpoint.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogini$(ExOBJ):: ../classes/tprogini.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogram$(ExOBJ):: ../classes/tprogram.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tpwobj$(ExOBJ):: ../classes/tpwobj.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tpwreado$(ExOBJ):: ../classes/tpwreado.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tpwritte$(ExOBJ):: ../classes/tpwritte.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tpxvalid$(ExOBJ):: ../classes/tpxvalid.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tradiobu$(ExOBJ):: ../classes/tradiobu.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/trangeva$(ExOBJ):: ../classes/trangeva.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/trescoll$(ExOBJ):: ../classes/trescoll.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tresfile$(ExOBJ):: ../classes/tresfile.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tscreen$(ExOBJ):: ../classes/tscreen.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tscrollb$(ExOBJ):: ../classes/tscrollb.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tscrolle$(ExOBJ):: ../classes/tscrolle.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsortedc$(ExOBJ):: ../classes/tsortedc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsortedl$(ExOBJ):: ../classes/tsortedl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstatict$(ExOBJ):: ../classes/tstatict.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstatusd$(ExOBJ):: ../classes/tstatusd.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstatusl$(ExOBJ):: ../classes/tstatusl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrinde$(ExOBJ):: ../classes/tstrinde.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstringc$(ExOBJ):: ../classes/tstringc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstringl$(ExOBJ):: ../classes/tstringl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrlist$(ExOBJ):: ../classes/tstrlist.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrmcla$(ExOBJ):: ../classes/tstrmcla.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrmtyp$(ExOBJ):: ../classes/tstrmtyp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsubmenu$(ExOBJ):: ../classes/tsubmenu.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ttermina$(ExOBJ):: ../classes/ttermina.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ttextdev$(ExOBJ):: ../classes/ttextdev.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tvalidat$(ExOBJ):: ../classes/tvalidat.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tvedit1$(ExOBJ):: ../classes/tvedit1.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tvedit2$(ExOBJ):: ../classes/tvedit2.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tvedit3$(ExOBJ):: ../classes/tvedit3.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tview$(ExOBJ):: ../classes/tview.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tvintl$(ExOBJ):: ../classes/tvintl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tvtext1$(ExOBJ):: ../classes/tvtext1.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tvtext2$(ExOBJ):: ../classes/tvtext2.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/twindow$(ExOBJ):: ../classes/twindow.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/unixdis$(ExOBJ):: ../classes/unix/unixdis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/unixkey$(ExOBJ):: ../classes/unix/unixkey.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/unixmouse$(ExOBJ):: ../classes/unix/unixmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/unixscr$(ExOBJ):: ../classes/unix/unixscr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/vesa$(ExOBJ):: ../classes/dos/vesa.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/vga$(ExOBJ):: ../classes/dos/vga.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/vgaregs$(ExOBJ):: ../classes/dos/vgaregs.c
+ $(RHIDE_COMPILE_C)
+
+obj/vgastate$(ExOBJ):: ../classes/dos/vgastate.c
+ $(RHIDE_COMPILE_C)
+
+obj/win32clip$(ExOBJ):: ../classes/win32/win32clip.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/win32dis$(ExOBJ):: ../classes/win32/win32dis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/win32key$(ExOBJ):: ../classes/win32/win32key.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/win32mouse$(ExOBJ):: ../classes/win32/win32mouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/win32scr$(ExOBJ):: ../classes/win32/win32scr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/wingrdis$(ExOBJ):: ../classes/wingr/wingrdis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/wingrkey$(ExOBJ):: ../classes/wingr/wingrkey.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/wingrmouse$(ExOBJ):: ../classes/wingr/wingrmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/wingrscr$(ExOBJ):: ../classes/wingr/wingrscr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/winntdis$(ExOBJ):: ../classes/winnt/winntdis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/winntkey$(ExOBJ):: ../classes/winnt/winntkey.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/winntmouse$(ExOBJ):: ../classes/winnt/winntmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/winntscr$(ExOBJ):: ../classes/winnt/winntscr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/x11dis$(ExOBJ):: ../classes/x11/x11dis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/x11key$(ExOBJ):: ../classes/x11/x11key.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/x11mouse$(ExOBJ):: ../classes/x11/x11mouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/x11src$(ExOBJ):: ../classes/x11/x11src.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/xtermdis$(ExOBJ):: ../classes/unix/xtermdis.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/xtermkey$(ExOBJ):: ../classes/unix/xtermkey.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/xtermmouse$(ExOBJ):: ../classes/unix/xtermmouse.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/xtermscr$(ExOBJ):: ../classes/unix/xtermscr.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/tvision/makes/maintain.mak b/tvision/makes/maintain.mak
new file mode 100644
index 0000000..edaf036
--- /dev/null
+++ b/tvision/makes/maintain.mak
@@ -0,0 +1,183 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+# This makefile maintains the .imk and .umk files synchronized with the RHIDE
+# project. Is used only when the package is configured with
+# --enable-maintainer-mode.
+#
+# TODO: include utf8 example in Unicode branch
+#
+
+include rhide.env
+
+EXDIR=../examples
+EXDEP=genimk.cc extrimk.cc
+
+all: makes
+
+# The list of "targets"
+mkfs_list=$(EXDIR)/bhelp/thelp $(EXDIR)/clipboard/test \
+ $(EXDIR)/cyrillic/linuxkoi8/test $(EXDIR)/cyrillic/x11koi8/test \
+ $(EXDIR)/demo/demo $(EXDIR)/desklogo/desklogo $(EXDIR)/desklogo/set-logo \
+ $(EXDIR)/desklogo/tv_logo $(EXDIR)/dlgdsn/libtest $(EXDIR)/dyntxt/dyntext \
+ $(EXDIR)/fonts/genraw $(EXDIR)/fonts/test $(EXDIR)/helpdemo/helpdemo \
+ $(EXDIR)/i18n/test $(EXDIR)/inplis/implis $(EXDIR)/listvi/lst_view \
+ $(EXDIR)/msgcls/msgcls $(EXDIR)/progba/test $(EXDIR)/sdlg/test \
+ $(EXDIR)/sdlg2/test $(EXDIR)/tcombo/test $(EXDIR)/terminal/test \
+ $(EXDIR)/tprogb/test $(EXDIR)/tutorial/tvguid01 $(EXDIR)/tutorial/tvguid02 \
+ $(EXDIR)/tutorial/tvguid03 $(EXDIR)/tutorial/tvguid04 \
+ $(EXDIR)/tutorial/tvguid05 $(EXDIR)/tutorial/tvguid06 \
+ $(EXDIR)/tutorial/tvguid07 $(EXDIR)/tutorial/tvguid08 \
+ $(EXDIR)/tutorial/tvguid09 $(EXDIR)/tutorial/tvguid10 \
+ $(EXDIR)/tutorial/tvguid11 $(EXDIR)/tutorial/tvguid12 \
+ $(EXDIR)/tutorial/tvguid13 $(EXDIR)/tutorial/tvguid14 \
+ $(EXDIR)/tutorial/tvguid15 $(EXDIR)/tutorial/tvguid16 \
+ $(EXDIR)/tvedit/tvedit $(EXDIR)/tvhc/tvhc $(EXDIR)/videomode/test
+imks_list=librhtv ../compat/compat
+allprjs=$(mkfs_list) $(imks_list)
+# Makefiles for them
+mkfs_files=$(addsuffix .mkf,$(mkfs_list))
+# Dependencies for them
+imks_files=$(addsuffix .imk,$(imks_list)) $(addsuffix .umk,$(mkfs_list))
+
+# Tool to extract dependencies
+extrimk.exe: extrimk.cc
+ $(RHIDE_GXX) -o $@ $< $(STDCPP_LIB)
+
+# Tool to create temporal .mak files and call extrimk
+genimk.exe: genimk.cc extrimk.exe
+ $(RHIDE_GXX) -o $@ $< $(STDCPP_LIB)
+
+librhtv.imk: librhtv.gpr ../compat/compat.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/bhelp/thelp.umk: $(EXDIR)/bhelp/thelp.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/clipboard/test.umk: $(EXDIR)/clipboard/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/cyrillic/linuxkoi8/test.umk: $(EXDIR)/cyrillic/linuxkoi8/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/cyrillic/x11koi8/test.umk: $(EXDIR)/cyrillic/x11koi8/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/demo/demo.umk: $(EXDIR)/demo/demo.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/desklogo/desklogo.umk: $(EXDIR)/desklogo/desklogo.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/desklogo/set-logo.umk: $(EXDIR)/desklogo/set-logo.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/desklogo/tv_logo.umk: $(EXDIR)/desklogo/tv_logo.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/dlgdsn/libtest.umk: $(EXDIR)/dlgdsn/libtest.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/dyntxt/dyntext.umk: $(EXDIR)/dyntxt/dyntext.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/fonts/genraw.umk: $(EXDIR)/fonts/genraw.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/fonts/test.umk: $(EXDIR)/fonts/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/helpdemo/helpdemo.umk: $(EXDIR)/helpdemo/helpdemo.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/i18n/test.umk: $(EXDIR)/i18n/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/inplis/implis.umk: $(EXDIR)/inplis/implis.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/listvi/lst_view.umk: $(EXDIR)/listvi/lst_view.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/msgcls/msgcls.umk: $(EXDIR)/msgcls/msgcls.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/progba/test.umk: $(EXDIR)/progba/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/sdlg/test.umk: $(EXDIR)/sdlg/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/sdlg2/test.umk: $(EXDIR)/sdlg2/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tcombo/test.umk: $(EXDIR)/tcombo/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/terminal/test.umk: $(EXDIR)/terminal/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tprogb/test.umk: $(EXDIR)/tprogb/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid01.umk: $(EXDIR)/tutorial/tvguid01.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid02.umk: $(EXDIR)/tutorial/tvguid02.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid03.umk: $(EXDIR)/tutorial/tvguid03.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid04.umk: $(EXDIR)/tutorial/tvguid04.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid05.umk: $(EXDIR)/tutorial/tvguid05.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid06.umk: $(EXDIR)/tutorial/tvguid06.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid07.umk: $(EXDIR)/tutorial/tvguid07.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid08.umk: $(EXDIR)/tutorial/tvguid08.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid09.umk: $(EXDIR)/tutorial/tvguid09.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid10.umk: $(EXDIR)/tutorial/tvguid10.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid11.umk: $(EXDIR)/tutorial/tvguid11.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid12.umk: $(EXDIR)/tutorial/tvguid12.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid13.umk: $(EXDIR)/tutorial/tvguid13.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid14.umk: $(EXDIR)/tutorial/tvguid14.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid15.umk: $(EXDIR)/tutorial/tvguid15.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tutorial/tvguid16.umk: $(EXDIR)/tutorial/tvguid16.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tvedit/tvedit.umk: $(EXDIR)/tvedit/tvedit.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/tvhc/tvhc.umk: $(EXDIR)/tvhc/tvhc.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+$(EXDIR)/videomode/test.umk: $(EXDIR)/videomode/test.gpr $(EXDEP)
+ @./genimk.exe $@ $^
+
+makes: extrimk.exe genimk.exe $(mkfs_files) $(imks_files)
+
diff --git a/tvision/makes/mlink.c b/tvision/makes/mlink.c
new file mode 100644
index 0000000..547a08d
--- /dev/null
+++ b/tvision/makes/mlink.c
@@ -0,0 +1,76 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+ Description:
+ MS lib have a really useless command line. This wrapper avoids all the
+complexities.
+ Also: I failed to create a macro that expands to something that creates
+a response file. Looks like it only works outside macros. This program
+just collects the files from the specified directories and creates the
+library with all of them.
+
+***************************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if _MSC_VER >= 1400
+ #define unlink(a) _unlink(a)
+#endif
+
+#define MAX_FILE 256
+
+int main(int argc, char *argv[])
+{
+ FILE *f;
+ int i,ret;
+ char *s;
+ WIN32_FIND_DATA de;
+ char dirMask[MAX_PATH+8];
+ HANDLE d;
+
+ if (argc<3)
+ {
+ printf("MS lib wrapper\n");
+ printf("Copyright (c) 2004 by Salvador E. Tropea. GPL.\n");
+ printf("Usage: mlink lib list_obj_files\n");
+ return 1;
+ }
+ f=fopen("mslink.lnk","wt");
+ if (!f)
+ {
+ printf("Can't create response file\n");
+ return 2;
+ }
+ for (i=2; i<argc; i++)
+ {
+ sprintf(dirMask,"%s\\*.obj",argv[i]);
+ d=FindFirstFile(dirMask,&de);
+ if (d==INVALID_HANDLE_VALUE)
+ {
+ printf("Can't open directory %s\n",argv[i]);
+ return 4;
+ }
+ do
+ {
+ //printf("%s\n",de.cFileName);
+ fprintf(f,"%s\\%s ",argv[i],de.cFileName);
+ }
+ while (FindNextFile(d,&de));
+ FindClose(d);
+ }
+ fprintf(f,"\n");
+ fclose(f);
+
+ unlink(argv[1]);
+ s=(char *)malloc(strlen(argv[1])+32);
+ sprintf(s,"lib /OUT:%s @mslink.lnk",argv[1]);
+ ret=system(s);
+ if (!ret)
+ unlink("mslink.lnk");
+ return ret;
+}
+
diff --git a/tvision/makes/obj/delete.me b/tvision/makes/obj/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/tvision/makes/obj/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/tvision/misc.cc b/tvision/misc.cc
new file mode 100644
index 0000000..1c901a8
--- /dev/null
+++ b/tvision/misc.cc
@@ -0,0 +1,56 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_string
+#define Uses_ctype
+#define Uses_TView
+#define Uses_TEvent
+#define Uses_TObject
+#include <tv.h>
+
+void *message( TView *receiver, ushort what, ushort command, void *infoPtr)
+{
+ if( receiver == 0 )
+ return 0;
+
+ TEvent event;
+ event.what = what;
+ event.message.command = command;
+ event.message.infoPtr = infoPtr;
+ receiver->handleEvent( event );
+ if( event.what == evNothing )
+ return event.message.infoPtr;
+ else
+ return 0;
+}
+
+Boolean lowMemory()
+{
+#if 0
+ return Boolean(TVMemMgr::safetyPoolExhausted());
+#else
+ return False;
+#endif
+}
+
+char hotKey( const char *s )
+{
+ const char *p;
+
+ if( (p = strchr( s, '~' )) != 0 )
+ return uctoupper(p[1]);
+ else
+ return 0;
+}
+
+
diff --git a/tvision/miscperl.pl b/tvision/miscperl.pl
new file mode 100644
index 0000000..3843b2c
--- /dev/null
+++ b/tvision/miscperl.pl
@@ -0,0 +1,40 @@
+# Version is stored in the root directory in a file called version.txt.
+# It contains the version in Major.Middle.Minor format followed by only one
+# line feed.
+sub GetVersion
+{
+ $Version=cat($_[0].'version.txt');
+ if (!$Version)
+ {
+ die "Missing version file! ($_[0]version.txt)\n";
+ }
+ chop $Version;
+ $Version=~/(\d+)\.(\d+)\.(\d+)/;
+ $VersionMajor =$1;
+ $VersionMiddle=$2;
+ $VersionMinor =$3;
+ $Version="$1.$2.$3";
+}
+
+sub replace
+{
+ my $b=$_[1];
+
+ open(FIL,">$_[0]") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
+
+sub cat
+{
+ local $/;
+ my $b;
+
+ open(FIL,$_[0]) || return 0;
+ $b=<FIL>;
+ close(FIL);
+
+ $b;
+}
+
+1;
diff --git a/tvision/msgbox.cc b/tvision/msgbox.cc
new file mode 100644
index 0000000..bc9eb93
--- /dev/null
+++ b/tvision/msgbox.cc
@@ -0,0 +1,244 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+Modified by Salvador E. Tropea to add mfDontShowAgain, vsnprintf usage and
+i18n. Added TValidator, etc.
+
+ *
+ *
+ */
+// SET: Moved the standard headers here because according to DJ
+// they can inconditionally declare symbols like NULL
+#include <stdarg.h>
+#define Uses_string
+#define Uses_stdio
+
+#define Uses_MsgBox
+#define Uses_TObject
+#define Uses_TDialog
+#define Uses_TStaticText
+#define Uses_TRect
+#define Uses_TButton
+#define Uses_TProgram
+#define Uses_TInputLine
+#define Uses_TDeskTop
+#define Uses_TLabel
+#define Uses_TCheckBoxes
+#define Uses_TSItem
+#define Uses_TScreen
+#define Uses_AllocLocal
+#define Uses_TValidator
+#define Uses_snprintf
+#include <tv.h>
+
+static const char *buttonName[] =
+{
+ __("~Y~es"),
+ __("~N~o"),
+ __("~O~K"),
+ __("Cancel")
+};
+
+static ushort commands[] =
+{
+ cmYes,
+ cmNo,
+ cmOK,
+ cmCancel
+};
+
+static const char *Titles[] =
+{
+ __("Warning"),
+ __("Error"),
+ __("Information"),
+ __("Confirm")
+};
+
+ushort messageBoxRect( const TRect &r, const char *msg, ushort aOptions )
+{
+ TDialog *dialog;
+ short i, x, buttonCount;
+ TView* buttonList[5];
+ ushort ccode;
+ int height=r.b.y-r.a.y;
+ TCheckBoxes *dsa=0;
+ TRect rlocal=r;
+
+ if (aOptions & mfDontShowAgain)
+ {
+ rlocal.a.y-=2;
+ rlocal.b.y++;
+ }
+
+ dialog = new TDialog( rlocal, Titles[aOptions & 0x3] );
+
+ stTVIntl *intlMessage=NULL;
+ if (aOptions & mfDontTranslate)
+ intlMessage=TVIntl::dontTranslateSt();
+ else
+ TVIntl::getText(msg,intlMessage);
+
+ dialog->insert(
+ new TStaticText(TRect(3, 2, dialog->size.x - 2, height - 3),
+ msg,intlMessage) );
+
+ if (aOptions & mfDontShowAgain)
+ {
+ dsa=new TCheckBoxes(TRect(2,height-2,dialog->size.x-2,height-1),
+ new TSItem(__("Don't warn you next time"),0));
+ dialog->insert(dsa);
+ }
+
+ for( i = 0, x = -2, buttonCount = 0; i < 4; i++ )
+ {
+ if( (aOptions & (0x0100 << i)) != 0)
+ {
+ buttonList[buttonCount] =
+ new TButton( TRect(0, 0, 10, 2), _(buttonName[i]), commands[i], bfNormal );
+ x += buttonList[buttonCount++]->size.x + 2;
+ }
+ }
+
+ x = (dialog->size.x - x) / 2;
+
+ for( i = 0; i < buttonCount; i++ )
+ {
+ dialog->insert(buttonList[i]);
+ buttonList[i]->moveTo(x, dialog->size.y - 3);
+ x += buttonList[i]->size.x + 2;
+ }
+
+ dialog->selectNext(False);
+
+ Boolean oldBusy=TScreen::showBusyState(False);
+ ccode = TProgram::deskTop->execView(dialog);
+ TScreen::showBusyState(oldBusy);
+ if (aOptions & mfDontShowAgain)
+ {
+ ushort val;
+ dsa->getData(&val);
+ if (val)
+ ccode|=0x8000; // Not so clean but cmOK,Yes,etc are low values
+ }
+
+ TObject::CLY_destroy( dialog );
+
+ return ccode;
+}
+
+ushort messageBoxRect( const TRect &r,
+ ushort aOptions,
+ const char *fmt,
+ ... )
+{
+ va_list argptr;
+
+ char *intlFmt=TVIntl::getTextNew(fmt);
+
+ va_start( argptr, fmt );
+ int l=CLY_vsnprintf(NULL, (size_t)0, intlFmt, argptr);
+ va_end( argptr );
+ AllocLocalStr(msg,l+1);
+
+ va_start( argptr, fmt );
+ CLY_vsnprintf(msg, (size_t)l+1, intlFmt, argptr);
+ va_end( argptr );
+
+ DeleteArray(intlFmt);
+ return messageBoxRect( r, msg, aOptions | mfDontTranslate );
+}
+
+static TRect makeRect()
+{
+ TRect r( 0, 0, 40, 9 );
+ r.move((TProgram::deskTop->size.x - r.b.x) / 2,
+ (TProgram::deskTop->size.y - r.b.y) / 2);
+ return r;
+}
+
+ushort messageBox( const char *msg, ushort aOptions )
+{
+ return messageBoxRect( makeRect(), msg, aOptions );
+}
+
+ushort messageBox( ushort aOptions, const char *fmt, ... )
+{
+ va_list argptr;
+
+ char *intlFmt=TVIntl::getTextNew(fmt);
+
+ va_start( argptr, fmt );
+ int l=CLY_vsnprintf(NULL, (size_t)0, intlFmt, argptr);
+ va_end( argptr );
+ AllocLocalStr(msg,l+1);
+
+ va_start( argptr, fmt );
+ CLY_vsnprintf(msg, (size_t)l+1, intlFmt, argptr);
+ va_end( argptr );
+
+ DeleteArray(intlFmt);
+ return messageBoxRect( makeRect(), msg, aOptions | mfDontTranslate );
+}
+
+ushort inputBox( const char *Title, const char *aLabel, char *s, int limit,
+ TValidator *v )
+{ // Use a size according to the label+limit and title
+ int len;
+ len = max( strlen(aLabel) + 8 + limit, strlen(Title) + 11 );
+ len = min( len, 60 );
+ len = max( len , 24 );
+ TRect r(0, 0, len, 7);
+ r.move((TProgram::deskTop->size.x - r.b.x) / 2,
+ (TProgram::deskTop->size.y - r.b.y) / 2);
+ return inputBoxRect(r, Title, aLabel, s, limit, v);
+}
+
+ushort inputBoxRect( const TRect &bounds,
+ const char *Title,
+ const char *aLabel,
+ char *s,
+ int limit,
+ TValidator *v )
+{
+ TDialog *dialog;
+ TInputLine* control;
+ TRect r;
+ ushort c;
+
+ dialog = new TDialog(bounds, Title);
+
+ unsigned x = 4 + strlen( aLabel );
+ r = TRect( x, 2, min(x + limit + 2, (unsigned int)dialog->size.x - 3), 3 );
+ control = new TInputLine( r, limit );
+ control->setValidator( v );
+ dialog->insert( control );
+
+ stTVIntl *intlLabel = NULL;
+ r = TRect(2, 2, 3 + strlen(TVIntl::getText(aLabel,intlLabel)), 3);
+ dialog->insert( new TLabel( r, aLabel, control, intlLabel ) );
+
+ r = TRect( dialog->size.x / 2 - 11, dialog->size.y - 3,
+ dialog->size.x / 2 - 1 , dialog->size.y - 1);
+ dialog->insert( new TButton(r, __("~O~K"), cmOK, bfDefault));
+
+ r.a.x += 12;
+ r.b.x += 12;
+ dialog->insert( new TButton(r, __("Cancel"), cmCancel, bfNormal));
+
+ r.a.x += 12;
+ r.b.x += 12;
+ dialog->selectNext(False);
+ dialog->setData(s);
+ c = TProgram::deskTop->execView(dialog);
+ if( c != cmCancel )
+ dialog->getData(s);
+ TObject::CLY_destroy( dialog );
+ return c;
+}
+
diff --git a/tvision/names/nbackgro.cc b/tvision/names/nbackgro.cc
new file mode 100644
index 0000000..edfaa91
--- /dev/null
+++ b/tvision/names/nbackgro.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TBackground)
+
+
diff --git a/tvision/names/nbutton.cc b/tvision/names/nbutton.cc
new file mode 100644
index 0000000..28baee0
--- /dev/null
+++ b/tvision/names/nbutton.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TButton)
+
+
diff --git a/tvision/names/ncalcdis.cc b/tvision/names/ncalcdis.cc
new file mode 100644
index 0000000..ee2152b
--- /dev/null
+++ b/tvision/names/ncalcdis.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TCalcDisplay)
+
+
diff --git a/tvision/names/ncalcula.cc b/tvision/names/ncalcula.cc
new file mode 100644
index 0000000..34f8293
--- /dev/null
+++ b/tvision/names/ncalcula.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TCalculator)
+
+
diff --git a/tvision/names/nchdirdi.cc b/tvision/names/nchdirdi.cc
new file mode 100644
index 0000000..b3e9479
--- /dev/null
+++ b/tvision/names/nchdirdi.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TChDirDialog)
+
+
diff --git a/tvision/names/ncheckbo.cc b/tvision/names/ncheckbo.cc
new file mode 100644
index 0000000..e88c908
--- /dev/null
+++ b/tvision/names/ncheckbo.cc
@@ -0,0 +1,6 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TCheckBoxes)
+n(TCheckBoxes32)
+
+
diff --git a/tvision/names/nclrdisp.cc b/tvision/names/nclrdisp.cc
new file mode 100644
index 0000000..e75c0ba
--- /dev/null
+++ b/tvision/names/nclrdisp.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TColorDisplay)
+
+
diff --git a/tvision/names/ncluster.cc b/tvision/names/ncluster.cc
new file mode 100644
index 0000000..58af44b
--- /dev/null
+++ b/tvision/names/ncluster.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TCluster)
+
+
diff --git a/tvision/names/ncollect.cc b/tvision/names/ncollect.cc
new file mode 100644
index 0000000..36287e7
--- /dev/null
+++ b/tvision/names/ncollect.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TCollection)
+
+
diff --git a/tvision/names/ncolordi.cc b/tvision/names/ncolordi.cc
new file mode 100644
index 0000000..757c22d
--- /dev/null
+++ b/tvision/names/ncolordi.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TColorDialog)
+
+
diff --git a/tvision/names/ncolorgr.cc b/tvision/names/ncolorgr.cc
new file mode 100644
index 0000000..fae7232
--- /dev/null
+++ b/tvision/names/ncolorgr.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TColorGroupList)
+
+
diff --git a/tvision/names/ncolorit.cc b/tvision/names/ncolorit.cc
new file mode 100644
index 0000000..d389dfb
--- /dev/null
+++ b/tvision/names/ncolorit.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TColorItemList)
+
+
diff --git a/tvision/names/ncolorse.cc b/tvision/names/ncolorse.cc
new file mode 100644
index 0000000..a6f7484
--- /dev/null
+++ b/tvision/names/ncolorse.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TColorSelector)
+
+
diff --git a/tvision/names/ndesktop.cc b/tvision/names/ndesktop.cc
new file mode 100644
index 0000000..b3beeb9
--- /dev/null
+++ b/tvision/names/ndesktop.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDeskTop)
+
+
diff --git a/tvision/names/ndialog.cc b/tvision/names/ndialog.cc
new file mode 100644
index 0000000..34235a6
--- /dev/null
+++ b/tvision/names/ndialog.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDialog)
+
+
diff --git a/tvision/names/ndircoll.cc b/tvision/names/ndircoll.cc
new file mode 100644
index 0000000..ae597c4
--- /dev/null
+++ b/tvision/names/ndircoll.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDirCollection)
+
+
diff --git a/tvision/names/ndirlist.cc b/tvision/names/ndirlist.cc
new file mode 100644
index 0000000..9271af0
--- /dev/null
+++ b/tvision/names/ndirlist.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDirListBox)
+
+
diff --git a/tvision/names/neditor.cc b/tvision/names/neditor.cc
new file mode 100644
index 0000000..251f42a
--- /dev/null
+++ b/tvision/names/neditor.cc
@@ -0,0 +1,4 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TEditor)
+
diff --git a/tvision/names/neditwi.cc b/tvision/names/neditwi.cc
new file mode 100644
index 0000000..55585ae
--- /dev/null
+++ b/tvision/names/neditwi.cc
@@ -0,0 +1,4 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TEditWindow)
+
diff --git a/tvision/names/nfilecol.cc b/tvision/names/nfilecol.cc
new file mode 100644
index 0000000..fdb1afb
--- /dev/null
+++ b/tvision/names/nfilecol.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TFileCollection)
+
+
diff --git a/tvision/names/nfiledia.cc b/tvision/names/nfiledia.cc
new file mode 100644
index 0000000..b0e2ba6
--- /dev/null
+++ b/tvision/names/nfiledia.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TFileDialog)
+
+
diff --git a/tvision/names/nfiledtr.cc b/tvision/names/nfiledtr.cc
new file mode 100644
index 0000000..80c1c4f
--- /dev/null
+++ b/tvision/names/nfiledtr.cc
@@ -0,0 +1,4 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TFileEditor)
+
diff --git a/tvision/names/nfileinf.cc b/tvision/names/nfileinf.cc
new file mode 100644
index 0000000..f174d54
--- /dev/null
+++ b/tvision/names/nfileinf.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TFileInfoPane)
+
+
diff --git a/tvision/names/nfileinp.cc b/tvision/names/nfileinp.cc
new file mode 100644
index 0000000..5242715
--- /dev/null
+++ b/tvision/names/nfileinp.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TFileInputLine)
+
+
diff --git a/tvision/names/nfilelis.cc b/tvision/names/nfilelis.cc
new file mode 100644
index 0000000..c642b2b
--- /dev/null
+++ b/tvision/names/nfilelis.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TFileList)
+
+
diff --git a/tvision/names/nfilterv.cc b/tvision/names/nfilterv.cc
new file mode 100644
index 0000000..1ae5306
--- /dev/null
+++ b/tvision/names/nfilterv.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TFilterValidator)
+
+
diff --git a/tvision/names/nframe.cc b/tvision/names/nframe.cc
new file mode 100644
index 0000000..9d74cdf
--- /dev/null
+++ b/tvision/names/nframe.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TFrame)
+
+
diff --git a/tvision/names/ngroup.cc b/tvision/names/ngroup.cc
new file mode 100644
index 0000000..2983a45
--- /dev/null
+++ b/tvision/names/ngroup.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TGroup)
+
+
diff --git a/tvision/names/nhistory.cc b/tvision/names/nhistory.cc
new file mode 100644
index 0000000..8f7acde
--- /dev/null
+++ b/tvision/names/nhistory.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(THistory)
+
+
diff --git a/tvision/names/nindicat.cc b/tvision/names/nindicat.cc
new file mode 100644
index 0000000..60e29cb
--- /dev/null
+++ b/tvision/names/nindicat.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TIndicator)
+
+
diff --git a/tvision/names/ninputli.cc b/tvision/names/ninputli.cc
new file mode 100644
index 0000000..b5a69ee
--- /dev/null
+++ b/tvision/names/ninputli.cc
@@ -0,0 +1,5 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TInputLine)
+
+
diff --git a/tvision/names/nlabel.cc b/tvision/names/nlabel.cc
new file mode 100644
index 0000000..12fa3b6
--- /dev/null
+++ b/tvision/names/nlabel.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TLabel)
diff --git a/tvision/names/nlistbox.cc b/tvision/names/nlistbox.cc
new file mode 100644
index 0000000..8d05d81
--- /dev/null
+++ b/tvision/names/nlistbox.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TListBox)
diff --git a/tvision/names/nlistvie.cc b/tvision/names/nlistvie.cc
new file mode 100644
index 0000000..8713f93
--- /dev/null
+++ b/tvision/names/nlistvie.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TListViewer)
diff --git a/tvision/names/nlookupv.cc b/tvision/names/nlookupv.cc
new file mode 100644
index 0000000..7effd43
--- /dev/null
+++ b/tvision/names/nlookupv.cc
@@ -0,0 +1,4 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TLookupValidator)
+n(TStringLookupValidator)
diff --git a/tvision/names/nmemo.cc b/tvision/names/nmemo.cc
new file mode 100644
index 0000000..9853a19
--- /dev/null
+++ b/tvision/names/nmemo.cc
@@ -0,0 +1,4 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TMemo)
+
diff --git a/tvision/names/nmenubar.cc b/tvision/names/nmenubar.cc
new file mode 100644
index 0000000..d35f3f5
--- /dev/null
+++ b/tvision/names/nmenubar.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TMenuBar)
diff --git a/tvision/names/nmenubox.cc b/tvision/names/nmenubox.cc
new file mode 100644
index 0000000..c22e716
--- /dev/null
+++ b/tvision/names/nmenubox.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TMenuBox)
diff --git a/tvision/names/nmenuvie.cc b/tvision/names/nmenuvie.cc
new file mode 100644
index 0000000..3061c99
--- /dev/null
+++ b/tvision/names/nmenuvie.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TMenuView)
diff --git a/tvision/names/nmonosel.cc b/tvision/names/nmonosel.cc
new file mode 100644
index 0000000..9de1f0d
--- /dev/null
+++ b/tvision/names/nmonosel.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TMonoSelector)
diff --git a/tvision/names/nparamte.cc b/tvision/names/nparamte.cc
new file mode 100644
index 0000000..38e342d
--- /dev/null
+++ b/tvision/names/nparamte.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TParamText)
diff --git a/tvision/names/npxvalid.cc b/tvision/names/npxvalid.cc
new file mode 100644
index 0000000..28bbe5f
--- /dev/null
+++ b/tvision/names/npxvalid.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TPXPictureValidator)
diff --git a/tvision/names/nradiobu.cc b/tvision/names/nradiobu.cc
new file mode 100644
index 0000000..252622a
--- /dev/null
+++ b/tvision/names/nradiobu.cc
@@ -0,0 +1,4 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TRadioButtons)
+n(TRadioButtons32)
diff --git a/tvision/names/nrangeva.cc b/tvision/names/nrangeva.cc
new file mode 100644
index 0000000..2a3ce6a
--- /dev/null
+++ b/tvision/names/nrangeva.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TRangeValidator)
diff --git a/tvision/names/nresourc.cc b/tvision/names/nresourc.cc
new file mode 100644
index 0000000..d0b309e
--- /dev/null
+++ b/tvision/names/nresourc.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TResourceCollection)
diff --git a/tvision/names/nscrollb.cc b/tvision/names/nscrollb.cc
new file mode 100644
index 0000000..7e7ed3f
--- /dev/null
+++ b/tvision/names/nscrollb.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TScrollBar)
diff --git a/tvision/names/nscrolle.cc b/tvision/names/nscrolle.cc
new file mode 100644
index 0000000..3497616
--- /dev/null
+++ b/tvision/names/nscrolle.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TScroller)
diff --git a/tvision/names/nsortedc.cc b/tvision/names/nsortedc.cc
new file mode 100644
index 0000000..c7b1c56
--- /dev/null
+++ b/tvision/names/nsortedc.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TSortedCollection)
diff --git a/tvision/names/nsortedl.cc b/tvision/names/nsortedl.cc
new file mode 100644
index 0000000..13858b8
--- /dev/null
+++ b/tvision/names/nsortedl.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TSortedListBox)
diff --git a/tvision/names/nstatict.cc b/tvision/names/nstatict.cc
new file mode 100644
index 0000000..4ce7c42
--- /dev/null
+++ b/tvision/names/nstatict.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TStaticText)
diff --git a/tvision/names/nstatusl.cc b/tvision/names/nstatusl.cc
new file mode 100644
index 0000000..5225152
--- /dev/null
+++ b/tvision/names/nstatusl.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TStatusLine)
diff --git a/tvision/names/nstringc.cc b/tvision/names/nstringc.cc
new file mode 100644
index 0000000..8f00657
--- /dev/null
+++ b/tvision/names/nstringc.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TStringCollection)
diff --git a/tvision/names/nstringl.cc b/tvision/names/nstringl.cc
new file mode 100644
index 0000000..2397e8a
--- /dev/null
+++ b/tvision/names/nstringl.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TStringList)
diff --git a/tvision/names/nvalidat.cc b/tvision/names/nvalidat.cc
new file mode 100644
index 0000000..3663dbb
--- /dev/null
+++ b/tvision/names/nvalidat.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TValidator)
diff --git a/tvision/names/nview.cc b/tvision/names/nview.cc
new file mode 100644
index 0000000..5da58a6
--- /dev/null
+++ b/tvision/names/nview.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TView)
diff --git a/tvision/names/nwindow.cc b/tvision/names/nwindow.cc
new file mode 100644
index 0000000..d8d9676
--- /dev/null
+++ b/tvision/names/nwindow.cc
@@ -0,0 +1,3 @@
+#define Uses_n
+#include <tv/tvutil.h>
+n(TWindow)
diff --git a/tvision/newstr.cc b/tvision/newstr.cc
new file mode 100644
index 0000000..33184e0
--- /dev/null
+++ b/tvision/newstr.cc
@@ -0,0 +1,24 @@
+/*
+ * Turbo Vision - Version 2.0
+ *
+ * Copyright (c) 1994 by Borland International
+ * All Rights Reserved.
+ *
+
+Modified by Robert H”hne to be used for RHIDE.
+
+ *
+ *
+ */
+
+#define Uses_string
+#include <tv.h>
+
+char *newStr( const char *s )
+{
+ if( s == NULL )
+ return NULL;
+ char *temp = new char[ strlen(s)+1 ];
+ strcpy( temp, s );
+ return temp;
+}
diff --git a/tvision/qnxrtp/tvision.qpg b/tvision/qnxrtp/tvision.qpg
new file mode 100644
index 0000000..9086b12
--- /dev/null
+++ b/tvision/qnxrtp/tvision.qpg
@@ -0,0 +1,152 @@
+<QPG:Generation>
+ <QPG:Options>
+ <QPG:User unattended="yes" verbosity="0" listfiles="yes"/>
+ <QPG:Defaults type="qnx_package"/>
+ <QPG:Source></QPG:Source>
+ <QPG:Release date="today" number="+"/>
+ <QPG:Build></QPG:Build>
+ <QPG:FileSorting strip="yes"/>
+ <QPG:Package targets="standart"/>
+ <QPG:Repository generate="yes"/>
+ <QPG:FinalDir></QPG:FinalDir>
+ <QPG:Cleanup></QPG:Cleanup>
+ </QPG:Options>
+
+ <QPG:Responsible>
+ <QPG:Company>QNX.ORG.RU Community</QPG:Company>
+ <QPG:Department></QPG:Department>
+ <QPG:Group></QPG:Group>
+ <QPG:Team>QNX.ORG.RU Team</QPG:Team>
+ <QPG:Employee>Mike Gorchak</QPG:Employee>
+ <QPG:EmailAddress>mike@malva.ua</QPG:EmailAddress>
+ </QPG:Responsible>
+
+ <QPG:Values>
+ <QPG:Files>
+ <QPG:Add file="../copying" install="LicenseUrl/" handling="repdata"/>
+ <QPG:Add permissions="0755" file="../makes/librhtv.so.2.2.0" install="/opt/lib/"/>
+ <QPG:Add filetype="symlink" file="librhtv.so" install="/opt/lib/" linkto="librhtv.so.2.2.0"/>
+ <QPG:Add filetype="symlink" file="librhtv.so.2" install="/opt/lib/" linkto="librhtv.so.2.2.0"/>
+ <QPG:Add permissions="0644" file="../makes/librhtv.a" install="/opt/lib/"/>
+ <QPG:Add permissions="0644" file="../makes/libtvfintl.a" install="/opt/lib/"/>
+ <QPG:Add permissions="0755" file="../rhtv-config" install="/opt/bin/"/>
+ <QPG:Add permissions="0644" type="tree" file="../include/" install="/opt/include/rhtvision/">
+ <QPG:Rule argument="*/CVS/*" match="exclude"/>
+ <QPG:Rule argument="*/.cvsignore" match="exclude"/>
+ </QPG:Add>
+ <QPG:Add permissions="0644" file="../THANKS" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../TODO" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../INSTALL.txt" install="/usr/doc/tvision/install.txt"/>
+ <QPG:Add permissions="0644" file="../doc/install/unix.txt" install="/usr/doc/tvision/install_unix.txt"/>
+ <QPG:Add permissions="0644" file="../doc/install/tools.txt" install="/usr/doc/tvision/install_tools.txt"/>
+ <QPG:Add permissions="0644" file="../borland.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../change.log" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../change1.log" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../copying" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../readme.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../version.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../examples/porting.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/CodePages.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/ConfigFile.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/I18n.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/QNX.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/Streams.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/TVReference.html" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../makes/common.imk" install="/opt/src/tv-examples/"/>
+ <QPG:Add permissions="0644" file="../examples/readme.txt" install="/opt/src/tv-examples/"/>
+ <QPG:Add permissions="0644" file="../examples/rhide.env" install="/opt/src/tv-examples/"/>
+ <QPG:Add permissions="0644" file="../examples/Makefile" install="/opt/src/tv-examples/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/*.cc" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/*.h" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/demohelp.h32" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/demo.gpr" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/demo.mkf" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/demo.umk" install="/opt/src/tv-examples/demo/"/>
+ </QPG:Files>
+
+ <QPG:PackageFilter>
+ <QPM:PackageManifest>
+ <QPM:PackageDescription>
+ <QPM:PackageType>Library</QPM:PackageType>
+ <QPM:PackageName>tvision</QPM:PackageName>
+ <QPM:PackageReleaseNumber>1</QPM:PackageReleaseNumber>
+ <QPM:PackageRepository>http://qnx.org.ru/repository</QPM:PackageRepository>
+ <QPM:FileVersion>2.0</QPM:FileVersion>
+ </QPM:PackageDescription>
+ <QPM:ProductDescription>
+ <QPM:ProductName>Turbo Vision</QPM:ProductName>
+ <QPM:ProductIdentifier>tvision</QPM:ProductIdentifier>
+ <QPM:ProductEmail>salvador@inti.gov.ar</QPM:ProductEmail>
+ <QPM:VendorName>public</QPM:VendorName>
+ <QPM:VendorInstallName>public</QPM:VendorInstallName>
+ <QPM:VendorURL>http://tvision.sf.net</QPM:VendorURL>
+ <QPM:VendorEmbedURL/>
+ <QPM:VendorEmail>salvador@inti.gov.ar</QPM:VendorEmail>
+ <QPM:AuthorName>Borland Inc, Salvador E. Tropea</QPM:AuthorName>
+ <QPM:AuthorURL>http://tvision.sf.net</QPM:AuthorURL>
+ <QPM:AuthorEmbedURL/>
+ <QPM:AuthorEmail>salvador@inti.gov.ar</QPM:AuthorEmail>
+ <QPM:ProductIconSmall/>
+ <QPM:ProductIconLarge/>
+ <QPM:ProductDescriptionShort>The RHTVision library - C++ based TUI interface. The RHTVision library gives an intuitive and user friendly TUI (Textual User Interface) for programs using this library and running in a text console.</QPM:ProductDescriptionShort>
+ <QPM:ProductDescriptionLong>The RHTVision library - C++ TUI interface for console applications. The RHTVision library gives an intuitive and user friendly TUI (Textual User Interface) for programs using this library and running in a text console. This library is based on the Turbo Vision library made by Borland Corporation. It was interpreted by its upstream authors that the original Turbo Vision library was released by Borland Inc. under a Public Domain license.</QPM:ProductDescriptionLong>
+ <QPM:ProductDescriptionURL>http://tvision.sf.net</QPM:ProductDescriptionURL>
+ <QPM:ProductDescriptionEmbedURL/>
+ </QPM:ProductDescription>
+ <QPM:ReleaseDescription>
+ <QPM:ReleaseVersion>2.2.0</QPM:ReleaseVersion>
+ <QPM:ReleaseUrgency>High</QPM:ReleaseUrgency>
+ <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
+ <QPM:ReleaseNoteMinor/>
+ <QPM:ReleaseNoteMajor/>
+ <QPM:ReleaseBuild>1</QPM:ReleaseBuild>
+ <QPM:CountryExclude/>
+ <QPM:ReleaseCopyright>GNU General Public License</QPM:ReleaseCopyright>
+ </QPM:ReleaseDescription>
+ <QPM:ContentDescription>
+ <QPM:ContentTopic>Software Development/Libraries and Extensions/C++ Libraries</QPM:ContentTopic>
+ <QPM:ContentKeyword>TUI, Turbo Vision, console</QPM:ContentKeyword>
+ <QPM:TargetOS>qnx6</QPM:TargetOS>
+ <QPM:HostOS>none</QPM:HostOS>
+ <QPM:DisplayEnvironment>Console</QPM:DisplayEnvironment>
+ <QPM:TargetAudience>Developer</QPM:TargetAudience>
+ <QPM:TargetAudience>User</QPM:TargetAudience>
+ </QPM:ContentDescription>
+ <QPM:LicenseUrl>repdata://LicenseUrl/copying</QPM:LicenseUrl>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="none" target="none">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="x86" target="none">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="none" target="x86">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="x86" target="x86">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ </QPG:Values>
+</QPG:Generation>
diff --git a/tvision/qnxrtp/tvision.qpg.in b/tvision/qnxrtp/tvision.qpg.in
new file mode 100644
index 0000000..7fa16aa
--- /dev/null
+++ b/tvision/qnxrtp/tvision.qpg.in
@@ -0,0 +1,152 @@
+<QPG:Generation>
+ <QPG:Options>
+ <QPG:User unattended="yes" verbosity="0" listfiles="yes"/>
+ <QPG:Defaults type="qnx_package"/>
+ <QPG:Source></QPG:Source>
+ <QPG:Release date="today" number="+"/>
+ <QPG:Build></QPG:Build>
+ <QPG:FileSorting strip="yes"/>
+ <QPG:Package targets="standart"/>
+ <QPG:Repository generate="yes"/>
+ <QPG:FinalDir></QPG:FinalDir>
+ <QPG:Cleanup></QPG:Cleanup>
+ </QPG:Options>
+
+ <QPG:Responsible>
+ <QPG:Company>QNX.ORG.RU Community</QPG:Company>
+ <QPG:Department></QPG:Department>
+ <QPG:Group></QPG:Group>
+ <QPG:Team>QNX.ORG.RU Team</QPG:Team>
+ <QPG:Employee>Mike Gorchak</QPG:Employee>
+ <QPG:EmailAddress>mike@malva.ua</QPG:EmailAddress>
+ </QPG:Responsible>
+
+ <QPG:Values>
+ <QPG:Files>
+ <QPG:Add file="../copying" install="LicenseUrl/" handling="repdata"/>
+ <QPG:Add permissions="0755" file="../makes/librhtv.so.@version@" install="/opt/lib/"/>
+ <QPG:Add filetype="symlink" file="librhtv.so" install="/opt/lib/" linkto="librhtv.so.@version@"/>
+ <QPG:Add filetype="symlink" file="librhtv.so.2" install="/opt/lib/" linkto="librhtv.so.@version@"/>
+ <QPG:Add permissions="0644" file="../makes/librhtv.a" install="/opt/lib/"/>
+ <QPG:Add permissions="0644" file="../makes/libtvfintl.a" install="/opt/lib/"/>
+ <QPG:Add permissions="0755" file="../rhtv-config" install="/opt/bin/"/>
+ <QPG:Add permissions="0644" type="tree" file="../include/" install="/opt/include/rhtvision/">
+ <QPG:Rule argument="*/CVS/*" match="exclude"/>
+ <QPG:Rule argument="*/.cvsignore" match="exclude"/>
+ </QPG:Add>
+ <QPG:Add permissions="0644" file="../THANKS" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../TODO" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../INSTALL.txt" install="/usr/doc/tvision/install.txt"/>
+ <QPG:Add permissions="0644" file="../doc/install/unix.txt" install="/usr/doc/tvision/install_unix.txt"/>
+ <QPG:Add permissions="0644" file="../doc/install/tools.txt" install="/usr/doc/tvision/install_tools.txt"/>
+ <QPG:Add permissions="0644" file="../borland.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../change.log" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../change1.log" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../copying" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../readme.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../version.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../examples/porting.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/CodePages.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/ConfigFile.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/I18n.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/QNX.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/Streams.txt" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../doc/TVReference.html" install="/usr/doc/tvision/"/>
+ <QPG:Add permissions="0644" file="../makes/common.imk" install="/opt/src/tv-examples/"/>
+ <QPG:Add permissions="0644" file="../examples/readme.txt" install="/opt/src/tv-examples/"/>
+ <QPG:Add permissions="0644" file="../examples/rhide.env" install="/opt/src/tv-examples/"/>
+ <QPG:Add permissions="0644" file="../examples/Makefile" install="/opt/src/tv-examples/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/*.cc" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/*.h" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/demohelp.h32" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/demo.gpr" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/demo.mkf" install="/opt/src/tv-examples/demo/"/>
+ <QPG:Add permissions="0644" file="../examples/demo/demo.umk" install="/opt/src/tv-examples/demo/"/>
+ </QPG:Files>
+
+ <QPG:PackageFilter>
+ <QPM:PackageManifest>
+ <QPM:PackageDescription>
+ <QPM:PackageType>Library</QPM:PackageType>
+ <QPM:PackageName>tvision</QPM:PackageName>
+ <QPM:PackageReleaseNumber>1</QPM:PackageReleaseNumber>
+ <QPM:PackageRepository>http://qnx.org.ru/repository</QPM:PackageRepository>
+ <QPM:FileVersion>2.0</QPM:FileVersion>
+ </QPM:PackageDescription>
+ <QPM:ProductDescription>
+ <QPM:ProductName>Turbo Vision</QPM:ProductName>
+ <QPM:ProductIdentifier>tvision</QPM:ProductIdentifier>
+ <QPM:ProductEmail>salvador@inti.gov.ar</QPM:ProductEmail>
+ <QPM:VendorName>public</QPM:VendorName>
+ <QPM:VendorInstallName>public</QPM:VendorInstallName>
+ <QPM:VendorURL>http://tvision.sf.net</QPM:VendorURL>
+ <QPM:VendorEmbedURL/>
+ <QPM:VendorEmail>salvador@inti.gov.ar</QPM:VendorEmail>
+ <QPM:AuthorName>Borland Inc, Salvador E. Tropea</QPM:AuthorName>
+ <QPM:AuthorURL>http://tvision.sf.net</QPM:AuthorURL>
+ <QPM:AuthorEmbedURL/>
+ <QPM:AuthorEmail>salvador@inti.gov.ar</QPM:AuthorEmail>
+ <QPM:ProductIconSmall/>
+ <QPM:ProductIconLarge/>
+ <QPM:ProductDescriptionShort>The RHTVision library - C++ based TUI interface. The RHTVision library gives an intuitive and user friendly TUI (Textual User Interface) for programs using this library and running in a text console.</QPM:ProductDescriptionShort>
+ <QPM:ProductDescriptionLong>The RHTVision library - C++ TUI interface for console applications. The RHTVision library gives an intuitive and user friendly TUI (Textual User Interface) for programs using this library and running in a text console. This library is based on the Turbo Vision library made by Borland Corporation. It was interpreted by its upstream authors that the original Turbo Vision library was released by Borland Inc. under a Public Domain license.</QPM:ProductDescriptionLong>
+ <QPM:ProductDescriptionURL>http://tvision.sf.net</QPM:ProductDescriptionURL>
+ <QPM:ProductDescriptionEmbedURL/>
+ </QPM:ProductDescription>
+ <QPM:ReleaseDescription>
+ <QPM:ReleaseVersion>@version@</QPM:ReleaseVersion>
+ <QPM:ReleaseUrgency>High</QPM:ReleaseUrgency>
+ <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
+ <QPM:ReleaseNoteMinor/>
+ <QPM:ReleaseNoteMajor/>
+ <QPM:ReleaseBuild>1</QPM:ReleaseBuild>
+ <QPM:CountryExclude/>
+ <QPM:ReleaseCopyright>GNU General Public License</QPM:ReleaseCopyright>
+ </QPM:ReleaseDescription>
+ <QPM:ContentDescription>
+ <QPM:ContentTopic>Software Development/Libraries and Extensions/C++ Libraries</QPM:ContentTopic>
+ <QPM:ContentKeyword>TUI, Turbo Vision, console</QPM:ContentKeyword>
+ <QPM:TargetOS>qnx6</QPM:TargetOS>
+ <QPM:HostOS>none</QPM:HostOS>
+ <QPM:DisplayEnvironment>Console</QPM:DisplayEnvironment>
+ <QPM:TargetAudience>Developer</QPM:TargetAudience>
+ <QPM:TargetAudience>User</QPM:TargetAudience>
+ </QPM:ContentDescription>
+ <QPM:LicenseUrl>repdata://LicenseUrl/copying</QPM:LicenseUrl>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="none" target="none">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="x86" target="none">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="none" target="x86">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="x86" target="x86">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ </QPG:Values>
+</QPG:Generation>
diff --git a/tvision/readme.in b/tvision/readme.in
new file mode 100644
index 0000000..e8ff2eb
--- /dev/null
+++ b/tvision/readme.in
@@ -0,0 +1,456 @@
+Hi!
+
+The small sections are:
+
+0. Ultra quick instructions
+1. Introduction
+2. Notes about the package
+3. Compilation and installation
+4. Using the library to compile your program
+5. Linux/UNIX dynamic libraries
+6. Libraries and tools needed
+7. Examples
+8. Dialog editor
+9. Targets supported, limitations
+10. CPU usage
+11. Notes about international support
+12. How to submit a patch
+13. Memory Debuggers
+14. Special thanks
+15. Contact information
+
+ The instructions to compile the source code can be found in the INSTALL.txt
+file. I strongly suggest reading the INSTALL.txt file and the files indicated
+by it.
+
+0. Ultra quick instructions
+----------------------------
+
+ If you can't wait even a second and you are running a UNIX like system with
+most of the GNU tools (Perl, shell utils, file utils, bash, make, etc.) you
+can just follow these steps: [These tools are installed in all Linux systems;
+they are available for most UNIX systems and also for djgpp, Cygwin and MinGW]
+
+A) Run the configure script (./configure or configure).
+
+Examples:
+ linux:/usr/src/tvision# ./configure
+ c:\djgpp\contrib\tvision>configure
+
+B) If all is OK run "make".
+C) If all is OK just run "make install". [On UNIX systems you'll need to
+change to the root user before installing]
+
+ With it you'll get the headers and library installed.
+ If the installation prefix directory is wrongly guessed call the configure
+script passing --prefix=dir as argument.
+Example:
+ linux:/usr/src/tvision# ./configure --prefix=/usr/local
+
+ Note: The configuration mechanism can be used for Cygwin or MinGW but you
+must install some GNU tools. It can't be used for Borland and Microsoft
+compilers.
+
+
+
+
+1. Introduction:
+---------------
+
+ That's the Turbo Vision distribution (TV for short) v@version@.
+ The sources are copyrighted by Borland (currently Inprise) and are freely
+available in internet from:
+
+ftp://ftp.inprise.com/pub/borlandcpp/devsupport/archive/turbovision/tv.zip
+
+ Look in the borland.txt file for more information. Additionally here is
+what Inprise says about this package:
+
+URL: http://www.inprise.com/devsupport/bcppbuilder/faq/QNA906.html
+or: http://community.borland.com/article/0,1410,17285,00.html
+------------------------------------------------------------------------------
+Question and Answer Database
+
+QNA :Turbo Vision
+Category :C/C++ Language Issues
+Platform :Windows95
+Product :C++Builder ALL
+
+Question:
+Where can I find the public domain version of Turbo Vision?
+
+Answer:
+It can be found at
+ftp.inprise.com/pub/borlandcpp/devsupport/archive/turbovision/
+
+the turbo vision libraries are in the tv.zip archve, the rest of the
+files are examples.
+
+7/2/1998 10:32:32 AM
+------------------------------------------------------------------------------
+ So according to Inprise web tv.zip is a Public Domain version.
+<Clarification>
+ I added this small text because some people have doubts about copyrights
+issues.
+</Clarification>
+
+ They were heavily patched to work with gcc, BC++ and MSVC. Some patches
+fixes bugs, others changes the behavior of things limited to 16 bits values
+and others add brand new functionality. The resulting TV isn't 100%
+compatible with the original. See the examples/porting.txt file for more
+information, I explain which differences I found while porting the examples.
+ Up to release 1.0.1 most of the patches were made by Robert Hoehne. I
+contributed with various patches and modules mainly to extend the original
+functionality. For information about what changed before it just read the
+change.log and change1.log files. You'll find more information in the "doc"
+directory.
+ The library is distributed under the GPL license, it seems to be OK because
+according to a FAQ in the Inprise web site the base library is Public
+Domain. The file "copying" contains the GPL license and the file "copying.rh"
+contains the RHIDE copyright. Some portions of the contributed code are under
+the BSD license (QNX RtP driver). I took some code from the Sigala's port of
+TV (some examples), Sigala's port is under the BSD license, but I modified
+the code and my changes are covered by the GPL license. If you want the
+code under BSD look for Sigala's port. I also added some code from TV Tools,
+this package was created by Marc Stern <stern@mble.philips.be> and he states:
+"You can freely distribute them, modify them and use them for any purpose
+(even include it into commercial products).". For the purpose of this
+distribution the code is under GPL license.
+
+ Recent news: Richard M. Stallman contacted me and put some doubts about the
+distribution of Borland's sources, he contacted somebody at Borland asking if
+TV was freesoftware and he got no as answer. I think this reply was mainly
+because RMS asked without clarifying your point. To clarify it I contacted
+the person in charge of the Linux web section of Borland and he told me that
+he is redirecting these doubts to the right people inside Borland. Until now
+I didn't get a final answer. Note it was in 2000, Borland never replied and I
+insisted during 18 months. Also note that I tried to contact Linux
+International but they never replied.
+
+
+
+
+2. Notes about the package:
+--------------------------
+
+ As you are reading it you already unpacked it but here are some notes:
+(I usually read the readmes without unpacking)
+ The distribution is done using two formats: .zip and .tar.gz. The .zip file
+contains the files in "DOS" format (\r\n as end of line) and the .tar.gz file
+contains the same files in "UNIX" format (\n as end of line). The .zip file
+also lacks a few files needed to create Debian packages because these files
+have names that can't be safetly used in environments where the file names
+are limited to 8+3 characters.
+ If you use the .tar.gz file for a system like djgpp (DOS) you can use the
+file lista.dos to know which files should be converted to DOS format. The
+script called fromunix.pl converts those files. The rest of the file doesn't
+usually need any change because gcc understands both kind of end of line
+terminators. I don't know if bcc and msvc also supports it.
+ Note that sometimes I talk about "Linux" but it usually applies to most
+POSIX systems. Also note that Cygwin is more similar to Linux than DOS.
+ Starting with 1.0.5 I include the Debian package files. As these files
+aren't 8+3 clean if you uncompress the files in plain DOS you'll get some
+warnings about files with the same name, so I removed these files from the
+DOS distribution in 1.0.6, now they are only in the Linux distribution. So
+if you want to try generating the .deb packages you *must* have the Linux
+distribution of the library.
+ The compress and compress.bat files are used to create the distribution
+packages and are included. If you need to generate the .zip file just use the
+files in the djgpp directory. If you need to generate the .tar.gz just use
+the files in the linux directory.
+ Starting with 1.1.0 Win32 platforms are also supported using MingW and BC++
+5.5 compilers.
+ In 2.0.0 we added MSVC and QNX support. The UNIX support was also enhanced
+to support FreeBSD and Solaris.
+ Starting with 2.0.2 the make process is unified and the resulting library
+is generated in the makes directory for all architectures. Currently the only
+target that isn't integrated is MSVC because Microsoft doesn't provide a free
+compiler like Borland does. I need volunteers to integrate the MSVC to the
+rest and make things easier for MSVC users. For more information read the
+INSTALL.txt file.
+
+
+
+
+3. Compilation and installation:
+-------------------------------
+
+ The compilation instructions are in the INSTALL.txt file.
+ All the .o/.obj files are stored in the makes/obj directory it helps to
+delete or compress these files if you want to save disk space and you won't
+be modifying the sources all the time.
+ The generated library/ies can be found in the makes directory.
+
+ The systems using gcc and UNIX tools can install the library/ies using:
+
+$ make install
+
+ If it fails or you are using another compiler you can install it by hand or
+use the library without installing:
+ To use the library add the include directory in your includes path and the
+directory where the library was created to your libraries path (or just move
+the library to the lib directory). I recommend using an environment variable
+pointing to the base directory where the files are located and add the rest
+to it. For example:
+TVISION=e:/dj/contrib/tvision
+Then $(TVISION)/include is the include directory and $(TVISION)/linux or
+$(TVISION)/djgpp is the library path.
+ *Note* In this way you don't need to install the library and you can make
+changes in the library without needing to reinstall all the time.
+
+
+
+
+4. Using the library to compile your program:
+--------------------------------------------
+
+ In order to compile your program you'll have to set your compiler to search
+the header files in the directory where the Turbo Vision are installed. This
+is usually achieved using the -I command option. Here is an example: suppose
+the prefix is /usr/local then the headers will be installed to
+/usr/local/include/rhtvision So you'll have to use
+-I/usr/local/include/rhtvision as command line option for the compiler.
+ All TV programs includes tv.h header and no other headers. To avoid pulling
+a huge header and a lot of definitions TV have a "request" system. Suppose
+you want to use the TView class, then you add to your source code:
+
+#define Uses_TView
+#include <tv.h>
+
+ Take a look at the examples and tutorial to see real word examples. The
+point is that you never do things like:
+
+#include <tv/view.h>
+
+ This works, but could change in the future.
+ If you want to make your application more portable include the standard C
+headers using definitions like Uses_stdio. This will save time because the
+header will be included just once (the library could need to request it from
+its own headers) and will solve some portability problems. To learn more
+about read the include/compatlayer.h file and take a look at the files
+located in the compat directory.
+ In order to link your TV application you'll have to provide the name of the
+library and the path where the library is installed.
+ To simplify the above mentioned task the library provides a small program
+called "rhtv-config". This program can be used to know the paths from a
+script or makefile. Running the program without arguments will print the
+usage information. Here is an example for a POSIX shell and the gcc
+compiler:
+
+$ gcc -o tv_logo `rhtv-config --include` tv_logo.cc `rhtv-config --dir-libs` `rhtv-config --dlibs`
+
+ It compiles one of the example found in the examples/desklogo directory.
+ For those not familiar with the above syntaxis: the reverse quotes are used
+to execute a program and replace the text with the output of the executed
+command. For the example I used for the include directory it means that:
+
+$ gcc -o tv_logo `rhtv-config --include`
+
+ Is equivalent to:
+
+$ gcc -o tv_logo -I/usr/local/include/rhtvision
+
+ Currently it works only for systems using gcc. If you are interested in
+applying this concept to other of the supported compilers consider helping me
+with some information and tests.
+ Note the tool supports a switch for dynamic linking and static linking.
+Currently static linking really means "link statically with TV and
+dynamically with the rest of libraries". This is just to allow users to
+distribute programs that doesn't need downloading TV itselft. Also note that
+when linking dynamically you only have to indicate rhtv library, that's
+because the library was linked providing its dependencies, but when you link
+statically you have to list all the dependencies, sometimes this is long. In
+my Linux system it the list of dependencies is: -lstdc++ -lncurses -lm -lgpm
+-lX11 -lXmu
+
+
+
+
+5. Linux/UNIX dynamic libraries:
+-------------------------------
+
+ The configure/make process generates it.
+ My tests shows that a small TV example (examples/dyntxt) is only 14Kb
+long when linked dynamically and without debug information. But you should
+know that dynamically linked executables are slower than static ones,
+specially when you call a lot of small and fast library functions, that's
+because the address resolution overhead.
+
+
+
+
+6. Libraries needed:
+-------------------
+
+ Consult the doc/install/tools.txt file.
+
+
+
+7. Examples:
+-----------
+
+ I included a collection of over than 13 examples I got from the net and
+ported to this TV. The examples are shipped only with the sources
+distribution. See the examples directory for more information.
+ For targets using the gcc compiler you can run:
+
+$ make examples
+
+ To compile all examples. You can also make any of the examples by changing
+to the example/example_name directory and running:
+
+$ make -f name_of_the_example.mkf
+
+ If you are using Borland tools you must use:
+
+> make -f name_of_the_example.bmk
+
+ Currently Microsoft's nmake is not supported. Please contact me if you know
+about the MSVC command line usage and want to help with it.
+
+
+
+
+
+8. Dialog Editor:
+----------------
+
+ In the examples directory you'll find a directory called dlgdsn. This
+directory contains sources for a dialog editor. It was created by Warlei
+Alves and he asked me to maintain it. Right now I'm just including it in the
+package and adapted it to compile with the last release of TV. I also made it
+work under DOS and not only Linux. If enough people gets interested I think
+we can do a good tool from it, but as I use EasyDiag (a library to easilly
+generate dialogs) I don't have much interest on fixing all the bugs in the
+dialog editor.
+
+
+
+
+
+9. Targets supported, limitations:
+---------------------------------
+
+ The library compiles and runs in FreeBSD, DOS, Linux, QNX, Solaris and
+Win32 systems. Only i386 is fully tested, but the code also works for Alpha,
+ARM, HPPA, Itanium, Power PC and SPARC; we need volunteers to deeply test
+those platforms. The demo program compiles for all the mentioned
+architectures but I think there are some endian details that must be solved,
+I fixed the ones that were visible. Joel Soete reported some success using
+Linux+HPPA+gcc 3.0. All the other were tested using remote machines found in
+the Source Forge's compiler farm and H.P. Test Drive.
+ Starting with TV 2.0.0 we use the concept of drivers. Most drivers have
+documentation in the doc directory explaining their limitations and
+configuration options.
+
+
+
+
+
+10. CPU usage:
+-------------
+
+ Since v1.0.8 the TProgram::idle() member releases the CPU to the OS. If for
+some reason you want to eat 100% of the CPU or you want to use a methode
+different than the used by this function just set TProgram::doNotReleaseCPU
+to 1 and the class won't release the CPU.
+ For Linux I just do a usleep(10), that's sleep for 10 micro s. For djgpp
+I call to the __dpmi_yield() function. Note that you could use usleep for
+both (DOS and Linux) but in this case you should sleep for more than 18.2 ms
+to let djgpp's sleep really release the CPU. I think is easier to just call
+__dpmi_yield() and explicitly release the CPU, in this way you sleep the
+minimal amount of time.
+
+
+
+
+
+11. Notes about international support:
+-------------------------------------
+
+ The configuration script detects if the internationalization support is
+available in your system.
+ For Linux that's part of the standard C library and all is provided as
+dynamic libraries so it doesn't impact the memory usage.
+ For DOS that's provided by the gettext package (gtxtXXXb.zip). Versions of
+gettext prior to 0.10.37 are relative small and I think the memory used by it
+is OK and you should try to use it. Since 0.10.37 libintl.a recodes the
+strings on the fly, for that it needs libiconv (licvXXb.zip). This library is
+a huge set of conversion tables, those tables include chinese, japanese and
+korean codes, it makes the tables really huge and the size of programs linked
+with it increases more than 800 Kb (more than 600 Kb using UPX). In this case
+you could:
+a) Just use an old version of gettext, very recommendable.
+b) Generate programs with international support only when really needed.
+ If you choose the second option you must configure the library to use
+international support. I provide a dummy international library. This library
+provides the functions that gettext provides but they do nothing.
+ Why? What is the purpose? By doing it if you don't have international
+support at configuration time but you install it latter no recompilation is
+needed. You can also configure with international support and then create
+applications without it just linking with this library. Additionally you can
+configure the library to use the dummy version even if gettext is installed
+(--force-dummy), that's a good option if you only need to create a few
+applications with international support.
+ This library is compiled and installed with the libtvfintl.a name. If you
+don't have international support or want to disable it to reduce the size of
+a particular application you must link with this library
+ If you want to disable the fake library and all the internationalization
+support use the --no-intl configuration option.
+ Note: Turbo Vision have its own recoding facilities so you don't need
+libiconv.
+
+
+
+
+12. How to submit a patch:
+-------------------------
+
+ The simplest way is running a diff between your current directory and a
+copy of the library as you downloaded it. Don't forget to specify the exact
+version of the distribution and the purpose of the patchs. Use the unified
+mode (-u), this mode is the best for humans ;-)
+
+
+
+
+13. Memory Debuggers:
+--------------------
+
+ The library supports the MSS memory debugger version 1.2.1 for DOS. The
+code have special provisions to workaround some limitations in MSS. To use it
+just configure the library using the --with-mss option. You'll need to link
+with the mss library as explained in the mss documentation and as shown in
+the examples. MSS should work for Linux but I didn't test it.
+ If you know about other memory debugger and you need to introduce some
+changes in the library contact me.
+
+
+
+
+14. Special thanks:
+------------------
+
+They goes to the people listed in THANKS file. If I omitted you please let me
+know.
+
+
+
+
+15. Contact information:
+-----------------------
+
+Salvador E. Tropea (SET)
+Curapaligue 2124
+3 de Febrero, Caseros
+(1678) Bs.As. Argentina
+
+Phone: (+5411) 4759-0013
+
+e-mail: salvador@inti.gov.ar, set@computer.org, set@ieee.org
+http: www.geocities.com/SiliconValley/Vista/6552/
+ www.geocities.com/set-soft/ (alias of the above mentioned)
+
+
+
+Enjoy, SET
diff --git a/tvision/readme.txt b/tvision/readme.txt
new file mode 100644
index 0000000..3d30c4c
--- /dev/null
+++ b/tvision/readme.txt
@@ -0,0 +1,456 @@
+Hi!
+
+The small sections are:
+
+0. Ultra quick instructions
+1. Introduction
+2. Notes about the package
+3. Compilation and installation
+4. Using the library to compile your program
+5. Linux/UNIX dynamic libraries
+6. Libraries and tools needed
+7. Examples
+8. Dialog editor
+9. Targets supported, limitations
+10. CPU usage
+11. Notes about international support
+12. How to submit a patch
+13. Memory Debuggers
+14. Special thanks
+15. Contact information
+
+ The instructions to compile the source code can be found in the INSTALL.txt
+file. I strongly suggest reading the INSTALL.txt file and the files indicated
+by it.
+
+0. Ultra quick instructions
+----------------------------
+
+ If you can't wait even a second and you are running a UNIX like system with
+most of the GNU tools (Perl, shell utils, file utils, bash, make, etc.) you
+can just follow these steps: [These tools are installed in all Linux systems;
+they are available for most UNIX systems and also for djgpp, Cygwin and MinGW]
+
+A) Run the configure script (./configure or configure).
+
+Examples:
+ linux:/usr/src/tvision# ./configure
+ c:\djgpp\contrib\tvision>configure
+
+B) If all is OK run "make".
+C) If all is OK just run "make install". [On UNIX systems you'll need to
+change to the root user before installing]
+
+ With it you'll get the headers and library installed.
+ If the installation prefix directory is wrongly guessed call the configure
+script passing --prefix=dir as argument.
+Example:
+ linux:/usr/src/tvision# ./configure --prefix=/usr/local
+
+ Note: The configuration mechanism can be used for Cygwin or MinGW but you
+must install some GNU tools. It can't be used for Borland and Microsoft
+compilers.
+
+
+
+
+1. Introduction:
+---------------
+
+ That's the Turbo Vision distribution (TV for short) v2.2.0.
+ The sources are copyrighted by Borland (currently Inprise) and are freely
+available in internet from:
+
+ftp://ftp.inprise.com/pub/borlandcpp/devsupport/archive/turbovision/tv.zip
+
+ Look in the borland.txt file for more information. Additionally here is
+what Inprise says about this package:
+
+URL: http://www.inprise.com/devsupport/bcppbuilder/faq/QNA906.html
+or: http://community.borland.com/article/0,1410,17285,00.html
+------------------------------------------------------------------------------
+Question and Answer Database
+
+QNA :Turbo Vision
+Category :C/C++ Language Issues
+Platform :Windows95
+Product :C++Builder ALL
+
+Question:
+Where can I find the public domain version of Turbo Vision?
+
+Answer:
+It can be found at
+ftp.inprise.com/pub/borlandcpp/devsupport/archive/turbovision/
+
+the turbo vision libraries are in the tv.zip archve, the rest of the
+files are examples.
+
+7/2/1998 10:32:32 AM
+------------------------------------------------------------------------------
+ So according to Inprise web tv.zip is a Public Domain version.
+<Clarification>
+ I added this small text because some people have doubts about copyrights
+issues.
+</Clarification>
+
+ They were heavily patched to work with gcc, BC++ and MSVC. Some patches
+fixes bugs, others changes the behavior of things limited to 16 bits values
+and others add brand new functionality. The resulting TV isn't 100%
+compatible with the original. See the examples/porting.txt file for more
+information, I explain which differences I found while porting the examples.
+ Up to release 1.0.1 most of the patches were made by Robert Hoehne. I
+contributed with various patches and modules mainly to extend the original
+functionality. For information about what changed before it just read the
+change.log and change1.log files. You'll find more information in the "doc"
+directory.
+ The library is distributed under the GPL license, it seems to be OK because
+according to a FAQ in the Inprise web site the base library is Public
+Domain. The file "copying" contains the GPL license and the file "copying.rh"
+contains the RHIDE copyright. Some portions of the contributed code are under
+the BSD license (QNX RtP driver). I took some code from the Sigala's port of
+TV (some examples), Sigala's port is under the BSD license, but I modified
+the code and my changes are covered by the GPL license. If you want the
+code under BSD look for Sigala's port. I also added some code from TV Tools,
+this package was created by Marc Stern <stern@mble.philips.be> and he states:
+"You can freely distribute them, modify them and use them for any purpose
+(even include it into commercial products).". For the purpose of this
+distribution the code is under GPL license.
+
+ Recent news: Richard M. Stallman contacted me and put some doubts about the
+distribution of Borland's sources, he contacted somebody at Borland asking if
+TV was freesoftware and he got no as answer. I think this reply was mainly
+because RMS asked without clarifying your point. To clarify it I contacted
+the person in charge of the Linux web section of Borland and he told me that
+he is redirecting these doubts to the right people inside Borland. Until now
+I didn't get a final answer. Note it was in 2000, Borland never replied and I
+insisted during 18 months. Also note that I tried to contact Linux
+International but they never replied.
+
+
+
+
+2. Notes about the package:
+--------------------------
+
+ As you are reading it you already unpacked it but here are some notes:
+(I usually read the readmes without unpacking)
+ The distribution is done using two formats: .zip and .tar.gz. The .zip file
+contains the files in "DOS" format (\r\n as end of line) and the .tar.gz file
+contains the same files in "UNIX" format (\n as end of line). The .zip file
+also lacks a few files needed to create Debian packages because these files
+have names that can't be safetly used in environments where the file names
+are limited to 8+3 characters.
+ If you use the .tar.gz file for a system like djgpp (DOS) you can use the
+file lista.dos to know which files should be converted to DOS format. The
+script called fromunix.pl converts those files. The rest of the file doesn't
+usually need any change because gcc understands both kind of end of line
+terminators. I don't know if bcc and msvc also supports it.
+ Note that sometimes I talk about "Linux" but it usually applies to most
+POSIX systems. Also note that Cygwin is more similar to Linux than DOS.
+ Starting with 1.0.5 I include the Debian package files. As these files
+aren't 8+3 clean if you uncompress the files in plain DOS you'll get some
+warnings about files with the same name, so I removed these files from the
+DOS distribution in 1.0.6, now they are only in the Linux distribution. So
+if you want to try generating the .deb packages you *must* have the Linux
+distribution of the library.
+ The compress and compress.bat files are used to create the distribution
+packages and are included. If you need to generate the .zip file just use the
+files in the djgpp directory. If you need to generate the .tar.gz just use
+the files in the linux directory.
+ Starting with 1.1.0 Win32 platforms are also supported using MingW and BC++
+5.5 compilers.
+ In 2.0.0 we added MSVC and QNX support. The UNIX support was also enhanced
+to support FreeBSD and Solaris.
+ Starting with 2.0.2 the make process is unified and the resulting library
+is generated in the makes directory for all architectures. Currently the only
+target that isn't integrated is MSVC because Microsoft doesn't provide a free
+compiler like Borland does. I need volunteers to integrate the MSVC to the
+rest and make things easier for MSVC users. For more information read the
+INSTALL.txt file.
+
+
+
+
+3. Compilation and installation:
+-------------------------------
+
+ The compilation instructions are in the INSTALL.txt file.
+ All the .o/.obj files are stored in the makes/obj directory it helps to
+delete or compress these files if you want to save disk space and you won't
+be modifying the sources all the time.
+ The generated library/ies can be found in the makes directory.
+
+ The systems using gcc and UNIX tools can install the library/ies using:
+
+$ make install
+
+ If it fails or you are using another compiler you can install it by hand or
+use the library without installing:
+ To use the library add the include directory in your includes path and the
+directory where the library was created to your libraries path (or just move
+the library to the lib directory). I recommend using an environment variable
+pointing to the base directory where the files are located and add the rest
+to it. For example:
+TVISION=e:/dj/contrib/tvision
+Then $(TVISION)/include is the include directory and $(TVISION)/linux or
+$(TVISION)/djgpp is the library path.
+ *Note* In this way you don't need to install the library and you can make
+changes in the library without needing to reinstall all the time.
+
+
+
+
+4. Using the library to compile your program:
+--------------------------------------------
+
+ In order to compile your program you'll have to set your compiler to search
+the header files in the directory where the Turbo Vision are installed. This
+is usually achieved using the -I command option. Here is an example: suppose
+the prefix is /usr/local then the headers will be installed to
+/usr/local/include/rhtvision So you'll have to use
+-I/usr/local/include/rhtvision as command line option for the compiler.
+ All TV programs includes tv.h header and no other headers. To avoid pulling
+a huge header and a lot of definitions TV have a "request" system. Suppose
+you want to use the TView class, then you add to your source code:
+
+#define Uses_TView
+#include <tv.h>
+
+ Take a look at the examples and tutorial to see real word examples. The
+point is that you never do things like:
+
+#include <tv/view.h>
+
+ This works, but could change in the future.
+ If you want to make your application more portable include the standard C
+headers using definitions like Uses_stdio. This will save time because the
+header will be included just once (the library could need to request it from
+its own headers) and will solve some portability problems. To learn more
+about read the include/compatlayer.h file and take a look at the files
+located in the compat directory.
+ In order to link your TV application you'll have to provide the name of the
+library and the path where the library is installed.
+ To simplify the above mentioned task the library provides a small program
+called "rhtv-config". This program can be used to know the paths from a
+script or makefile. Running the program without arguments will print the
+usage information. Here is an example for a POSIX shell and the gcc
+compiler:
+
+$ gcc -o tv_logo `rhtv-config --include` tv_logo.cc `rhtv-config --dir-libs` `rhtv-config --dlibs`
+
+ It compiles one of the example found in the examples/desklogo directory.
+ For those not familiar with the above syntaxis: the reverse quotes are used
+to execute a program and replace the text with the output of the executed
+command. For the example I used for the include directory it means that:
+
+$ gcc -o tv_logo `rhtv-config --include`
+
+ Is equivalent to:
+
+$ gcc -o tv_logo -I/usr/local/include/rhtvision
+
+ Currently it works only for systems using gcc. If you are interested in
+applying this concept to other of the supported compilers consider helping me
+with some information and tests.
+ Note the tool supports a switch for dynamic linking and static linking.
+Currently static linking really means "link statically with TV and
+dynamically with the rest of libraries". This is just to allow users to
+distribute programs that doesn't need downloading TV itselft. Also note that
+when linking dynamically you only have to indicate rhtv library, that's
+because the library was linked providing its dependencies, but when you link
+statically you have to list all the dependencies, sometimes this is long. In
+my Linux system it the list of dependencies is: -lstdc++ -lncurses -lm -lgpm
+-lX11 -lXmu
+
+
+
+
+5. Linux/UNIX dynamic libraries:
+-------------------------------
+
+ The configure/make process generates it.
+ My tests shows that a small TV example (examples/dyntxt) is only 14Kb
+long when linked dynamically and without debug information. But you should
+know that dynamically linked executables are slower than static ones,
+specially when you call a lot of small and fast library functions, that's
+because the address resolution overhead.
+
+
+
+
+6. Libraries needed:
+-------------------
+
+ Consult the doc/install/tools.txt file.
+
+
+
+7. Examples:
+-----------
+
+ I included a collection of over than 13 examples I got from the net and
+ported to this TV. The examples are shipped only with the sources
+distribution. See the examples directory for more information.
+ For targets using the gcc compiler you can run:
+
+$ make examples
+
+ To compile all examples. You can also make any of the examples by changing
+to the example/example_name directory and running:
+
+$ make -f name_of_the_example.mkf
+
+ If you are using Borland tools you must use:
+
+> make -f name_of_the_example.bmk
+
+ Currently Microsoft's nmake is not supported. Please contact me if you know
+about the MSVC command line usage and want to help with it.
+
+
+
+
+
+8. Dialog Editor:
+----------------
+
+ In the examples directory you'll find a directory called dlgdsn. This
+directory contains sources for a dialog editor. It was created by Warlei
+Alves and he asked me to maintain it. Right now I'm just including it in the
+package and adapted it to compile with the last release of TV. I also made it
+work under DOS and not only Linux. If enough people gets interested I think
+we can do a good tool from it, but as I use EasyDiag (a library to easilly
+generate dialogs) I don't have much interest on fixing all the bugs in the
+dialog editor.
+
+
+
+
+
+9. Targets supported, limitations:
+---------------------------------
+
+ The library compiles and runs in FreeBSD, DOS, Linux, QNX, Solaris and
+Win32 systems. Only i386 is fully tested, but the code also works for Alpha,
+ARM, HPPA, Itanium, Power PC and SPARC; we need volunteers to deeply test
+those platforms. The demo program compiles for all the mentioned
+architectures but I think there are some endian details that must be solved,
+I fixed the ones that were visible. Joel Soete reported some success using
+Linux+HPPA+gcc 3.0. All the other were tested using remote machines found in
+the Source Forge's compiler farm and H.P. Test Drive.
+ Starting with TV 2.0.0 we use the concept of drivers. Most drivers have
+documentation in the doc directory explaining their limitations and
+configuration options.
+
+
+
+
+
+10. CPU usage:
+-------------
+
+ Since v1.0.8 the TProgram::idle() member releases the CPU to the OS. If for
+some reason you want to eat 100% of the CPU or you want to use a methode
+different than the used by this function just set TProgram::doNotReleaseCPU
+to 1 and the class won't release the CPU.
+ For Linux I just do a usleep(10), that's sleep for 10 micro s. For djgpp
+I call to the __dpmi_yield() function. Note that you could use usleep for
+both (DOS and Linux) but in this case you should sleep for more than 18.2 ms
+to let djgpp's sleep really release the CPU. I think is easier to just call
+__dpmi_yield() and explicitly release the CPU, in this way you sleep the
+minimal amount of time.
+
+
+
+
+
+11. Notes about international support:
+-------------------------------------
+
+ The configuration script detects if the internationalization support is
+available in your system.
+ For Linux that's part of the standard C library and all is provided as
+dynamic libraries so it doesn't impact the memory usage.
+ For DOS that's provided by the gettext package (gtxtXXXb.zip). Versions of
+gettext prior to 0.10.37 are relative small and I think the memory used by it
+is OK and you should try to use it. Since 0.10.37 libintl.a recodes the
+strings on the fly, for that it needs libiconv (licvXXb.zip). This library is
+a huge set of conversion tables, those tables include chinese, japanese and
+korean codes, it makes the tables really huge and the size of programs linked
+with it increases more than 800 Kb (more than 600 Kb using UPX). In this case
+you could:
+a) Just use an old version of gettext, very recommendable.
+b) Generate programs with international support only when really needed.
+ If you choose the second option you must configure the library to use
+international support. I provide a dummy international library. This library
+provides the functions that gettext provides but they do nothing.
+ Why? What is the purpose? By doing it if you don't have international
+support at configuration time but you install it latter no recompilation is
+needed. You can also configure with international support and then create
+applications without it just linking with this library. Additionally you can
+configure the library to use the dummy version even if gettext is installed
+(--force-dummy), that's a good option if you only need to create a few
+applications with international support.
+ This library is compiled and installed with the libtvfintl.a name. If you
+don't have international support or want to disable it to reduce the size of
+a particular application you must link with this library
+ If you want to disable the fake library and all the internationalization
+support use the --no-intl configuration option.
+ Note: Turbo Vision have its own recoding facilities so you don't need
+libiconv.
+
+
+
+
+12. How to submit a patch:
+-------------------------
+
+ The simplest way is running a diff between your current directory and a
+copy of the library as you downloaded it. Don't forget to specify the exact
+version of the distribution and the purpose of the patchs. Use the unified
+mode (-u), this mode is the best for humans ;-)
+
+
+
+
+13. Memory Debuggers:
+--------------------
+
+ The library supports the MSS memory debugger version 1.2.1 for DOS. The
+code have special provisions to workaround some limitations in MSS. To use it
+just configure the library using the --with-mss option. You'll need to link
+with the mss library as explained in the mss documentation and as shown in
+the examples. MSS should work for Linux but I didn't test it.
+ If you know about other memory debugger and you need to introduce some
+changes in the library contact me.
+
+
+
+
+14. Special thanks:
+------------------
+
+They goes to the people listed in THANKS file. If I omitted you please let me
+know.
+
+
+
+
+15. Contact information:
+-----------------------
+
+Salvador E. Tropea (SET)
+Curapaligue 2124
+3 de Febrero, Caseros
+(1678) Bs.As. Argentina
+
+Phone: (+5411) 4759-0013
+
+e-mail: salvador@inti.gov.ar, set@computer.org, set@ieee.org
+http: www.geocities.com/SiliconValley/Vista/6552/
+ www.geocities.com/set-soft/ (alias of the above mentioned)
+
+
+
+Enjoy, SET
diff --git a/tvision/redhat/.cvsignore b/tvision/redhat/.cvsignore
new file mode 100644
index 0000000..6c51ab1
--- /dev/null
+++ b/tvision/redhat/.cvsignore
@@ -0,0 +1,2 @@
+*.spec
+
diff --git a/tvision/redhat/README b/tvision/redhat/README
new file mode 100644
index 0000000..357ce11
--- /dev/null
+++ b/tvision/redhat/README
@@ -0,0 +1,79 @@
+ This directory contains scripts and helpers used to create RPM packages.
+ The name "redhat" is because Red Hat created the RPM format. That's the
+same reason why the directory to create the .deb files is called "debian"
+even when a lot of small distros based on Debian are available.
+
+ The librhtv.spec.in file is a template to create the real spec file. The
+real file is created by the configuration script. If you need to do it
+manually just look for names enclosed by @, like @version@ and replace them
+by the proper values (currently only version needs it). The copy the file to
+librhtv-@version@.spec (i.e. librhtv-2.0.2.spec).
+
+ The spec file was contributed by Michel Catudal <bbcat@users.sf.net>.
+ I include this file to help people to create their own RPM files. This is
+really important because a lot of important Linux distros uses it (Red Hat,
+SuSE, Mandrake, etc.) and RPM packages generated for one of them doesn't have
+to be useful for the other.
+
+ Here is how to use the spec file:
+
+I. THE EASY WAY
+===============
+
+ This procedure is really rigid and could be incorrect for your system. In
+particular it assumes all will compile ok and nothing will fail. For this
+reason I also explain it step by step in point (II).
+
+ To create the RPM files just execute:
+
+$ redhat/create-rpms.sh
+
+ Then look for the RPMs in ~/rpm/RPMS/i386/
+ I'm looking for volunteers to make this script more flexible.
+ IMPORTANT! The script temporally changes your ~/.rpmacros file, please
+back-up it if you have valuable information there. The script creates a
+back-up and restores the original file but it could fail.
+
+II. STEP BY STEP
+================
+
+1) Choose a directory to create the files. If you are root you can use the
+default directories for your system. If not I recommend using a directory
+located in your home directory. I provide a small script that creates the
+directories for you: create-dirs.sh
+
+$ redhat/create-dirs.sh
+
+Note: In the rest of the examples I assume you used your home directory.
+
+2) Configure rpmbuild to use the created directories:
+
+$ redhat/config-rpm.sh
+
+Note: You can skip it if you are root or you alredy configured rpmbuild.
+
+3) Create a tarball containing the sources:
+
+$ cd linux; ./compress --use-bzip2 --dir-version; cd ..
+$ mv ../rhtvision-`cat version.txt`.src.tar.bz2 ~/rpm/SOURCES/librhtv-`cat version.txt`.tar.bz2
+
+Note: ~/rpm/SOURCES should be replaced if you are not using your home
+directory.
+
+4) Invoke rpmbuild to create the package:
+
+$ rpmbuild -bb redhat/librhtv-`cat version.txt`.spec
+
+Hopefuly you'll get the result in ~/rpm/RPMS/
+You just need to install them changing to `root' user.
+
+*****************************************************************************
+Note 1: The specs doesn't allow building two RPM packages at the same time if
+they use the same root directory.
+
+Note 2: If you want to use a directory different than ~/rpm you can use:
+[bash syntax]
+
+$ mkdir /tmp/example
+$ export SET_RPM_DIR=/tmp/example
+
diff --git a/tvision/redhat/config-rpm.sh b/tvision/redhat/config-rpm.sh
new file mode 100755
index 0000000..8d4ca72
--- /dev/null
+++ b/tvision/redhat/config-rpm.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+if [ "$SET_RPM_DIR" ]; then
+ SET_RPM_DIR="$SET_RPM_DIR";
+else
+ SET_RPM_DIR="$HOME";
+fi
+echo "%_topdir " $SET_RPM_DIR/rpm > ~/.rpmmacros
diff --git a/tvision/redhat/create-dirs.sh b/tvision/redhat/create-dirs.sh
new file mode 100755
index 0000000..0e24b8c
--- /dev/null
+++ b/tvision/redhat/create-dirs.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+if [ "$SET_RPM_DIR" ]; then
+ SET_RPM_DIR="$SET_RPM_DIR";
+else
+ SET_RPM_DIR="$HOME";
+fi
+mkdir $SET_RPM_DIR/rpm
+mkdir $SET_RPM_DIR/rpm/BUILD
+mkdir $SET_RPM_DIR/rpm/RPMS
+mkdir $SET_RPM_DIR/rpm/RPMS/i386
+mkdir $SET_RPM_DIR/rpm/SOURCES
+mkdir $SET_RPM_DIR/rpm/SPECS
+mkdir $SET_RPM_DIR/rpm/SRPMS \ No newline at end of file
diff --git a/tvision/redhat/create-rpms.sh b/tvision/redhat/create-rpms.sh
new file mode 100755
index 0000000..8083e46
--- /dev/null
+++ b/tvision/redhat/create-rpms.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright (C) 2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This file executes the steps needed to create the RPM files. It doesn't
+# check for errors and is really simple.
+# It temporally changes the ~/.rpmmacros file, but the file is restored
+# before exiting. If you stop the script you can recover the original file
+# using the move located at the end.
+# The file should be executed from the ../
+#
+if [ "$SET_RPM_DIR" ]; then
+ SET_RPM_DIR="$SET_RPM_DIR";
+else
+ SET_RPM_DIR="$HOME";
+fi
+./configure --just-spec
+chmod +x redhat/create-dirs.sh
+chmod +x redhat/config-rpm.sh
+redhat/create-dirs.sh
+mv ~/.rpmmacros redhat/.rpmmacros-backup~
+redhat/config-rpm.sh
+cd linux; chmod +x compress; ./compress --use-bzip2 --dir-version; cd ..
+mv ../rhtvision-`cat version.txt`.src.tar.bz2 $SET_RPM_DIR/rpm/SOURCES/librhtv-`cat version.txt`.tar.bz2
+rpmbuild -bb redhat/librhtv-`cat version.txt`.spec
+mv redhat/.rpmmacros-backup~ ~/.rpmmacros
+
diff --git a/tvision/redhat/librhtv.spec.in b/tvision/redhat/librhtv.spec.in
new file mode 100644
index 0000000..a26d1f1
--- /dev/null
+++ b/tvision/redhat/librhtv.spec.in
@@ -0,0 +1,133 @@
+%define name librhtv
+%define version @version@
+%define rel 3
+%define namefull %{name}.so.%{version}
+%define incname rhtvision
+
+Summary: An intuitive TUI interface for console applications.
+Name: %{name}
+Version: %{version}
+Release: %{rel}
+Copyright: GPL
+Packager: Michel Catudal <bbcat@users.sf.net>
+Vendor: Salvador Eduardo Tropea <set@users.sf.net>
+URL: http://tvision.sf.net/
+Group: System Environment/Libraries
+Source: %{name}-%{version}.tar.bz2
+BuildRoot: %{_tmppath}/%{name}-%{version}
+
+%description
+This is the shared library for programs using the RHTVision library.
+
+The RHTVision library gives an intuitive and user friendly TUI (Textual User
+Interface) for programs using this library and running in a console.
+
+This library is based on the Turbo Vision library made by Borland Corporation.
+That library was released by Borland under a Public Domain license. RHTVision
+is Borland's Turbo Vision library but with enhancements, some changes and a
+GPL license.
+
+If you would like to develop applications using the RHTVision library, you'll
+also need to install librhtv-devel.
+
+%package devel
+Summary: RHTVision library development.
+Group: Development/Libraries
+Requires: %{name} = %{PACKAGE_VERSION}
+
+%description devel
+Libraries and include files you can use for developing applications using
+the RHTVision library.
+
+The RHTVision library gives an intuitive and user friendly TUI (Textual User
+Interface) for programs using this library and running in a console.
+
+This library is based on the Turbo Vision library made by Borland Corporation.
+That library was released by Borland under a Public Domain license. RHTVision
+is Borland's Turbo Vision library but with enhancements, some changes and a
+GPL license.
+
+You should install the librhtv-devel package only if you would like to develop
+applications using the RHTVision library or you would like to compile programs
+that use the RHTVision library.
+
+%prep
+%setup -q
+rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_DIR/%{name}-%{version}
+rm -f $RPM_BUILD_DIR/tvision
+ln -s $RPM_BUILD_DIR/%{name}-%{version} $RPM_BUILD_DIR/tvision
+
+%setup
+./configure
+
+%build
+make
+
+%install
+
+install -d -m 0755 $RPM_BUILD_ROOT/usr/include/rhtvision
+rm -f $RPM_BUILD_ROOT/usr/include/rhtvision/*.h
+install -m 0644 include/*.h $RPM_BUILD_ROOT/usr/include/rhtvision
+install -d -m 0755 $RPM_BUILD_ROOT/usr/include/rhtvision/tv
+install -m 0644 include/tv/*.h $RPM_BUILD_ROOT/usr/include/rhtvision/tv
+install -d -m 0755 $RPM_BUILD_ROOT/usr/include/rhtvision/tv/linux
+install -m 0644 include/tv/linux/*.h $RPM_BUILD_ROOT/usr/include/rhtvision/tv/linux
+install -d -m 0755 $RPM_BUILD_ROOT/usr/include/rhtvision/tv/x11
+install -m 0644 include/tv/x11/*.h $RPM_BUILD_ROOT/usr/include/rhtvision/tv/x11
+install -d -m 0755 $RPM_BUILD_ROOT/usr/include/rhtvision/cl
+install -m 0644 include/cl/*.h $RPM_BUILD_ROOT/usr/include/rhtvision/cl
+install -d -m 0755 $RPM_BUILD_ROOT/usr/lib
+install -m 0644 makes/librhtv.a $RPM_BUILD_ROOT/usr/lib
+rm -f $RPM_BUILD_ROOT/usr/lib/librhtv.so
+rm -f $RPM_BUILD_ROOT/usr/lib/librhtv.so.2
+rm -f $RPM_BUILD_ROOT/usr/lib/librhtv.so.%{version}
+cd $RPM_BUILD_ROOT/usr/lib; ln -s librhtv.so.%{version} librhtv.so
+cd $RPM_BUILD_DIR/%{name}-%{version}
+install -m 0755 makes/librhtv.so.%{version} $RPM_BUILD_ROOT/usr/lib
+strip --strip-debug $RPM_BUILD_ROOT/usr/lib/librhtv.so.%{version}
+install -d -m 0755 $RPM_BUILD_ROOT/usr/lib
+install -m 0644 intl/dummy/libtvfintl.a $RPM_BUILD_ROOT/usr/lib/libtvfintl.a
+mkdir -p $RPM_BUILD_ROOT/usr/share/doc/packages/librhtv
+install -m 0644 doc/*.txt doc/*.html $RPM_BUILD_ROOT/usr/share/doc/packages/librhtv
+
+%clean
+#rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root)
+/usr/lib/lib*.so.*
+
+%files devel
+%defattr(-,root,root)
+%dir /usr/include/%{incname}
+%dir /usr/include/%{incname}/tv
+/usr/include/%{incname}/*.h
+/usr/include/%{incname}/tv/*.h
+/usr/include/%{incname}/tv/linux/*.h
+/usr/include/%{incname}/tv/x11/*.h
+/usr/include/%{incname}/cl/*.h
+/usr/lib/*.a
+/usr/lib/lib*.so
+/usr/share/doc/packages/librhtv/*
+
+
+%changelog -n librhtv
+* Tue Feb 18 2003 - Michel Catudal bbcat@netonecom.net
+- Add documentation
+* Sun Jan 5 2003 - Michel Catudal bbcat@netonecom.net
+- Released 2.0.1 version
+* Sat Oct 6 2002 - Michel Catudal bbcat@netonecom.net
+- Version 2 from CVS
+* Mon Nov 5 2001 - Michel Catudal bbcat@netonecom.net
+- Added copying of include files on include/cl which were missing
+* Sun Nov 4 2001 - "Ernas M. Jamil" <ernasm@samba.co.id>
+- Added copying of include files which were not done due
+ to changes that I was not aware of in the include files.
+ The same install script worked before.
+ Thanks to Ernas M. Jamil for pointing it out.
+
diff --git a/tvision/rhide.env b/tvision/rhide.env
new file mode 100644
index 0000000..fa35d8b
--- /dev/null
+++ b/tvision/rhide.env
@@ -0,0 +1,33 @@
+#
+# Common Warning and debug options, change it if you don't want debug
+# information or your compiler emmits too much warnings with -Wall.
+#
+RHIDE_OS_BOTH_Linux=-Wall -Werror -gstabs3 -O2
+RHIDE_OS_CFLAGS_Linux=$(RHIDE_OS_BOTH_Linux)
+RHIDE_OS_CXXFLAGS_Linux=$(RHIDE_OS_BOTH_Linux)
+
+RHIDE_OS_BOTH_DJGPP=-Wall -Werror -gstabs3 -O2
+RHIDE_OS_CFLAGS_DJGPP=$(RHIDE_OS_BOTH_DJGPP)
+RHIDE_OS_CXXFLAGS_DJGPP=$(RHIDE_OS_BOTH_DJGPP) -fno-exceptions -fno-rtti
+
+RHIDE_OS_CFLAGS=$(RHIDE_OS_CFLAGS_$(RHIDE_OS))
+RHIDE_OS_CXXFLAGS=$(RHIDE_OS_CXXFLAGS_$(RHIDE_OS))
+#
+# It indicates where are located the system includes so they aren't included
+# in the dependencies.
+#
+RHIDE_STDINC_Linux=$(DJDIR)/include $(DJDIR)/lang/cxx $(DJDIR)/lib/gcc-lib
+RHIDE_STDINC_DJGPP=/usr/include /usr/local/include /usr/include/g++ /usr/local/include/g++ /usr/lib/gcc-lib /usr/local/lib/gcc-lib
+RHIDE_STDINC=$(RHIDE_STDINC_$(RHIDE_OS))
+#
+# These are OS dependent libraries.
+#
+RHIDE_OS_LIBS_DJGPP=
+RHIDE_OS_LIBS_Linux=ncurses gpm m
+RHIDE_OS_LIBS=$(RHIDE_OS_LIBS_$(RHIDE_OS))
+#
+# Where is the TVision library
+#
+RHIDE_TV_LIB_DIR_DJGPP=djgpp
+RHIDE_TV_LIB_DIR_Linux=linux
+RHIDE_TV_LIB_DIR=$(RHIDE_TV_LIB_DIR_$(RHIDE_OS))
diff --git a/tvision/rhtv-config.c b/tvision/rhtv-config.c
new file mode 100644
index 0000000..ab08932
--- /dev/null
+++ b/tvision/rhtv-config.c
@@ -0,0 +1,192 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador Eduardo Tropea
+ Covered by the GPL license.
+
+ Description:
+ Small program to help configuring packages using Turbo Vision.
+
+***************************************************************************/
+
+#define Uses_getcwd
+#define Uses_stdio
+#define Uses_string
+#define Uses_limits
+#define Uses_stdlib
+#include <compatlayer.h>
+
+#define VERSION "1.0.0"
+
+#if defined(TVOS_DOS) || defined(TVOS_Win32) || defined(TVOSf_QNX4)
+ // Currently only static linking is supported for DOS and Win32.
+ #define ONLY_STATIC 1
+#else
+ #define ONLY_STATIC 0
+#endif
+
+static char *curdir=TVCONFIG_REF_DIR;
+static int lcurdir;
+
+static
+void StdInc(void)
+{
+ puts(TVCONFIG_RHIDE_STDINC);
+}
+
+/*static
+char *FixRelative(const char *s)
+{
+ if (strncmp(s,"../../",6)==0)
+ {
+ char *ret=(char *)malloc(lcurdir+strlen(s)+1-5);
+ sprintf(ret,"%s%s",curdir,s+5);
+ return ret;
+ }
+ return strdup(s);
+}*/
+
+static
+void Include(void)
+{
+ char *copy=strdup(TVCONFIG_INCLUDE);
+ char *s=strtok(copy," ");
+
+ while (s)
+ {
+ if (*s && *s!='.')
+ {
+ printf("-I%s ",s);
+ }
+ s=strtok(NULL," ");
+ }
+}
+
+static
+void SLibs(void)
+{
+ char *copy=strdup(TVCONFIG_RHIDE_OS_LIBS);
+ char *s=strtok(copy," ");
+
+ if (ONLY_STATIC)
+ printf("-lrhtv ");
+ else
+ printf("-Wl,-dn -lrhtv -Wl,-dy ");
+
+ while (s)
+ {
+ if (*s && *s!='.')
+ {
+ printf("-l%s ",s);
+ }
+ s=strtok(NULL," ");
+ }
+}
+
+static
+void DLibs(void)
+{
+ if (ONLY_STATIC)
+ SLibs();
+ else
+ {
+ char *copy=strdup(TVCONFIG_RHIDE_OS_LIBS);
+ char *s=strtok(copy," ");
+
+#if !defined(TVOSf_QNXRtP)
+ printf("-lrhtv ");
+#else
+ printf("-lrhtv -lncursesS");
+#endif /* TVOSf_QNXRtP */
+ if (strstr(TVCONFIG_RHIDE_OS_LIBS,"tvfintl"))
+ printf("-ltvfintl");
+ }
+}
+
+static
+void DirLibs(void)
+{
+ char *copy=strdup(TVCONFIG_TVOBJ);
+ char *s=strtok(copy," ");
+
+ while (s)
+ {
+ if (*s && *s!='.')
+ {
+ printf("-L%s ",s);
+ }
+ s=strtok(NULL," ");
+ }
+}
+
+static
+void Usage(void)
+{
+ fputs("Turbo Vision configuration tool v" VERSION "\n",stderr);
+ fputs("Copyright (c) 2003 by Salvador E. Tropea.\n",stderr);
+ fputs("That's free software covered by the GPL license.\n",stderr);
+ fprintf(stderr,"Usage: rhtv-config.exe OPTION\n");
+ fprintf(stderr,"Available options: [Only one can be specified]\n");
+ fprintf(stderr,"\t--stdinc\n");
+ fprintf(stderr,"\t--include\n");
+ fprintf(stderr,"\t--slibs [for linking static]\n");
+ fprintf(stderr,"\t--dlibs [for linking dynamic]\n");
+ fprintf(stderr,"\t--dir-libs\n");
+ fprintf(stderr,"\t--cflags\n");
+ fprintf(stderr,"\t--cppflags\n");
+ fprintf(stderr,"\t--version\n");
+}
+
+static
+void UnknowOp(const char *s)
+{
+ fprintf(stderr,"Unknown option: %s\n\n",s);
+ Usage();
+}
+
+static
+void SetUpCurDir(void)
+{
+ lcurdir=strlen(curdir);
+}
+
+int main(int argc, char *argv[])
+{
+ char *op;
+ if (argc!=2)
+ {
+ Usage();
+ return 1;
+ }
+ op=argv[1];
+ if (op[0]!='-' || op[1]!='-')
+ {
+ UnknowOp(op);
+ return 2;
+ }
+ SetUpCurDir();
+ op+=2;
+ if (strcmp(op,"stdinc")==0)
+ StdInc();
+ else if (strcmp(op,"include")==0)
+ Include();
+ else if (strcmp(op,"slibs")==0)
+ SLibs();
+ else if (strcmp(op,"dlibs")==0)
+ DLibs();
+ else if (strcmp(op,"dir-libs")==0)
+ DirLibs();
+ else if (strcmp(op,"cflags")==0)
+ fputs(TVCONFIG_CFLAGS,stdout);
+ else if (strcmp(op,"cppflags")==0)
+ fputs(TVCONFIG_CXXFLAGS,stdout);
+ else if (strcmp(op,"version")==0)
+ fputs("Turbo Vision configuration tool v" VERSION,stdout);
+ else
+ {
+ UnknowOp(op);
+ return 2;
+ }
+ printf("\n");
+ return 0;
+}
+
diff --git a/tvision/searchstrs.sh b/tvision/searchstrs.sh
new file mode 100755
index 0000000..3187b28
--- /dev/null
+++ b/tvision/searchstrs.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+xgettext --default-domain=dummy --add-comments --keyword=_ --keyword=__ --omit-header --add-location `perl -e 'while($a=<>){$a=~s/^[-+]//;if(!($a=~/^examples/) && $a=~/\.cc/){print"$a";}}' lista`
diff --git a/tvision/snapshot.pl b/tvision/snapshot.pl
new file mode 100644
index 0000000..1e8ec6b
--- /dev/null
+++ b/tvision/snapshot.pl
@@ -0,0 +1,177 @@
+#!/usr/bin/perl
+# Copyright (C) 1996,1997,1998,1999 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+
+# Needs: cvs, cp, tar, gzip, zip, uname, chmod, dtou (only in DOS)
+
+# Configuration:
+$a=`uname`;
+$DOS= $a=~/DOS/;
+$pkg='tv';
+
+
+if (length($ARGV[0])==0)
+ {
+ die "snapshot.pl Copyright (c) 1999 by Salvador E. Tropea
+
+ Creates a patch and new files needed to apply over a release to recreate
+the current state of the project. Some processing of the cvs output is
+needed for it.
+
+Use: snapshot.pl CVS_REVISION\n";
+ }
+
+if ($DOS)
+ {
+ $crlf="\n";
+ }
+else
+ {
+ $crlf="\r\n";
+ }
+
+# TODO enable it and do OS ok
+print "Running diff against revision: $ARGV[0]\n\n";
+system(RedirErrOut("cvs diff -u -r $ARGV[0]",'error.out','std.out'));
+
+($sec,$min,$hour,$mday,$mon,$year,$wday,$ydat,$isdst)=localtime();
+$mon++;
+$year+=1900;
+$snapdir="snap-shot-$pkg-";
+$fecha="$year";
+$fecha.='0' unless $mon>=10;
+$fecha.=$mon;
+$fecha.='0' unless $mday>=10;
+$fecha.=$mday;
+$snapdir.=$fecha;
+mkdir($snapdir,00755);
+
+# Process the diffs file to copy binary files that changed
+print "Looking for binary files that changed\n\n";
+open(FIL,'std.out');
+open(DEST,">$snapdir/main.pat");
+$used=1;
+while ($a=<FIL>)
+ {
+ if ($a =~ /RCS file: (\/[^\/]+)+\/$pkg\/([^,]+)/)
+ {
+ $curfile=$2;
+ if ($1=~/\/$pkg/) { $curfile=$pkg.'/'.$curfile; }
+ $used=0;
+ }
+ # The idiot just puts the name of the file, of course patch isn't magician
+ # and also needs to know the directory
+ if ($used==0 && $a =~ /\+\+\+ ([^\s]+)/)
+ {
+ $a =~ s/\+\+\+ ([^\s]+)/\+\+\+ $curfile/;
+ $used=1;
+ }
+ if ($a =~ /Binary files /)
+ {
+ print "$curfile is binary and changed, copying\n";
+ # Redirect the error because directories generates problems
+ system(RedirErr("cp -Pp $curfile $snapdir",'/dev/null'));
+ }
+ print DEST ($a);
+ }
+close FIL;
+close DEST;
+`rm std.out`;
+dtou("$snapdir/main.pat");
+
+# Process the new files
+print "\nCopying new files\n\n";
+open(FIL,'error.out');
+while ($a=<FIL>)
+ {
+ if ($a =~ /is not in file ([^\n]+)/)
+ {
+ print "$1 is a new file, copying\n";
+ system(RedirErr("cp -Pp $1 $snapdir",'/dev/null'));
+ dtou("$snapdir/$1");
+ }
+ }
+close FIL;
+`rm error.out`;
+
+# Generate a file to do the patch easier
+open(FIL,">$snapdir/doit.bat");
+print FIL ("patch -p0 < main.pat$crlf");
+close FIL;
+open(FIL,">$snapdir/doit");
+print FIL ("#!/bin/sh\npatch -p0 < main.pat\n");
+close FIL;
+dtou("$snapdir/doit");
+`chmod +x $snapdir/doit`;
+
+# Compress it
+print "\nCompressing the snap-shot\n";
+if ($DOS)
+ {
+ `tar -zcvf $snapdir.tar.gz $snapdir`;
+ `zip -9rm $snapdir $snapdir`;
+ }
+else
+ {
+ `tar -zcvf $snapdir.tar.gz $snapdir`;
+ `zip -9rm $snapdir $snapdir`;
+ }
+
+# Generate an HTML file with links to download the patches
+open(FIL,">snap-$pkg.html");
+print FIL ("<HTML><HEAD><TITLE>Patch for the last snap-shot of $pkg</TITLE></HEAD>\n");
+print FIL ('<BODY BGCOLOR="#A0D0FF" TEXT="#000000" LINK="#FF0000" VLINK="#000000">'."\n");
+print FIL ("<Font size=+2><b>Snap shot $fecha</b></Font><Font size=+1><p>\n");
+print FIL ("Uncompress the file in a temporal directory, a $snapdir directory will be\n");
+print FIL ("created containing all the files and directories. Copy these\n");
+print FIL ("files and directories over the old sources ($ARGV[0]) and then run the <i>doit.bat</i>\n");
+print FIL ("script (or <i>doit</i> for Linux).<br>\n");
+print FIL ("Ignore errors from patch about non-existent files with .cvsignore\n");
+print FIL ("names, they are CVS specific and not distributed.<br>\n");
+print FIL ('<p>File zipped: <a href="'.$snapdir.'.zip">'.$snapdir.'.zip</a><p>');
+print FIL ('File tar/gzipped: <a href="'.$snapdir.'.tar.gz">'.$snapdir.'.tar.gz</a><p>');
+print FIL ("Note I: Both patch files are in UNIX format, that is because djgpp and SETEdit supports both type of files. I can't say the same about Linux's patch and gcc.<p>");
+print FIL ("Note II: This file was created by the script that creates the snap-shot, sorry if something looks funny.\n");
+print FIL ("</HTML></BODY>\n");
+close FIL;
+dtou("snap-$pkg.html");
+
+
+die "Chau!\n";
+
+sub dtou
+{
+ if ($DOS)
+ { # djgpp is better than Linux, both \n and \r\n are suported
+ `dtou $_[0]`;
+ }
+}
+
+sub RedirErr
+{
+ local $ret;
+ if ($DOS)
+ {
+ $ret="redir -e $_[1] $_[0]";
+ }
+ else
+ {
+ $ret="$_[0] 2> $_[1]";
+ }
+ $ret;
+}
+
+sub RedirErrOut
+{
+ local $ret;
+ if ($DOS)
+ {
+ $ret="redir -e $_[1] -o $_[2] $_[0]";
+ }
+ else
+ {
+ $ret="$_[0] 2> $_[1] > $_[2]";
+ }
+ $ret;
+}
diff --git a/tvision/stream/sbackgro.cc b/tvision/stream/sbackgro.cc
new file mode 100644
index 0000000..3f03b93
--- /dev/null
+++ b/tvision/stream/sbackgro.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TBackground
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RBackground( TBackground::name,
+ TBackground::build,
+ __DELTA(TBackground)
+ );
+
+#endif
+
diff --git a/tvision/stream/sbutton.cc b/tvision/stream/sbutton.cc
new file mode 100644
index 0000000..87004f1
--- /dev/null
+++ b/tvision/stream/sbutton.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TButton
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RButton( TButton::name,
+ TButton::build,
+ __DELTA(TButton)
+ );
+
+#endif
+
diff --git a/tvision/stream/scalcdis.cc b/tvision/stream/scalcdis.cc
new file mode 100644
index 0000000..d95dc00
--- /dev/null
+++ b/tvision/stream/scalcdis.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TCalcDisplay
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RCalcDisplay( TCalcDisplay::name,
+ TCalcDisplay::build,
+ __DELTA(TCalcDisplay)
+ );
+
+#endif
+
diff --git a/tvision/stream/scalcula.cc b/tvision/stream/scalcula.cc
new file mode 100644
index 0000000..dc87d6f
--- /dev/null
+++ b/tvision/stream/scalcula.cc
@@ -0,0 +1,16 @@
+#ifndef NO_STREAM
+
+#define Uses_TCalculator
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+__link( RDialog )
+__link( RButton )
+
+TStreamableClass CLY_EXPORT RCalculator( TCalculator::name,
+ TCalculator::build,
+ __DELTA(TCalculator)
+ );
+
+#endif
+
diff --git a/tvision/stream/schdirdi.cc b/tvision/stream/schdirdi.cc
new file mode 100644
index 0000000..21143b3
--- /dev/null
+++ b/tvision/stream/schdirdi.cc
@@ -0,0 +1,16 @@
+#ifndef NO_STREAM
+
+#define Uses_TChDirDialog
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RDialog )
+__link( RButton )
+__link( RDirListBox )
+
+TStreamableClass CLY_EXPORT RChDirDialog( TChDirDialog::name,
+ TChDirDialog::build,
+ __DELTA(TChDirDialog)
+ );
+
+#endif
+
diff --git a/tvision/stream/scheckbo.cc b/tvision/stream/scheckbo.cc
new file mode 100644
index 0000000..d2036bb
--- /dev/null
+++ b/tvision/stream/scheckbo.cc
@@ -0,0 +1,18 @@
+#ifndef NO_STREAM
+
+#define Uses_TCheckBoxes
+#define Uses_TStreamableClass
+#include <tv.h>
+
+__link( RCluster )
+TStreamableClass CLY_EXPORT RCheckBoxes( TCheckBoxes::name,
+ TCheckBoxes::build,
+ __DELTA(TCheckBoxes)
+ );
+TStreamableClass CLY_EXPORT RCheckBoxes32( TCheckBoxes32::name,
+ TCheckBoxes32::build,
+ __DELTA(TCheckBoxes32)
+ );
+
+#endif
+
diff --git a/tvision/stream/sclrdisp.cc b/tvision/stream/sclrdisp.cc
new file mode 100644
index 0000000..667b56e
--- /dev/null
+++ b/tvision/stream/sclrdisp.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TColorDisplay
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RColorDisplay( TColorDisplay::name,
+ TColorDisplay::build,
+ __DELTA(TColorDisplay)
+ );
+
+#endif
+
diff --git a/tvision/stream/scluster.cc b/tvision/stream/scluster.cc
new file mode 100644
index 0000000..d599de6
--- /dev/null
+++ b/tvision/stream/scluster.cc
@@ -0,0 +1,15 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TCluster
+#include <tv.h>
+__link( RView )
+__link( RStringCollection )
+
+TStreamableClass CLY_EXPORT RCluster( TCluster::name,
+ TCluster::build,
+ __DELTA(TCluster)
+ );
+
+#endif
+
diff --git a/tvision/stream/scolordi.cc b/tvision/stream/scolordi.cc
new file mode 100644
index 0000000..863710c
--- /dev/null
+++ b/tvision/stream/scolordi.cc
@@ -0,0 +1,22 @@
+#ifndef NO_STREAM
+
+#define Uses_TColorDialog
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RLabel )
+__link( RButton )
+__link( RDialog )
+__link( RColorSelector )
+__link( RMonoSelector )
+__link( RColorGroupList )
+__link( RColorDisplay )
+__link( RColorItemList )
+__link( RScrollBar )
+
+TStreamableClass CLY_EXPORT RColorDialog( TColorDialog::name,
+ TColorDialog::build,
+ __DELTA(TColorDialog)
+ );
+
+#endif
+
diff --git a/tvision/stream/scolorgr.cc b/tvision/stream/scolorgr.cc
new file mode 100644
index 0000000..6067463
--- /dev/null
+++ b/tvision/stream/scolorgr.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TColorGroupList
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RListViewer )
+
+TStreamableClass CLY_EXPORT RColorGroupList( TColorGroupList::name,
+ TColorGroupList::build,
+ __DELTA(TColorGroupList)
+ );
+
+#endif
+
diff --git a/tvision/stream/scolorit.cc b/tvision/stream/scolorit.cc
new file mode 100644
index 0000000..67a6089
--- /dev/null
+++ b/tvision/stream/scolorit.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TColorItemList
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RListViewer )
+
+TStreamableClass CLY_EXPORT RColorItemList( TColorItemList::name,
+ TColorItemList::build,
+ __DELTA(TColorItemList)
+ );
+
+#endif
+
diff --git a/tvision/stream/scolorse.cc b/tvision/stream/scolorse.cc
new file mode 100644
index 0000000..1d3863e
--- /dev/null
+++ b/tvision/stream/scolorse.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TColorSelector
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RColorSelector( TColorSelector::name,
+ TColorSelector::build,
+ __DELTA(TColorSelector)
+ );
+
+#endif
+
diff --git a/tvision/stream/sdesktop.cc b/tvision/stream/sdesktop.cc
new file mode 100644
index 0000000..4a8f290
--- /dev/null
+++ b/tvision/stream/sdesktop.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TDeskTop
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RDeskTop( TDeskTop::name,
+ TDeskTop::build,
+ __DELTA(TDeskTop)
+ );
+
+#endif
+
diff --git a/tvision/stream/sdialog.cc b/tvision/stream/sdialog.cc
new file mode 100644
index 0000000..9227401
--- /dev/null
+++ b/tvision/stream/sdialog.cc
@@ -0,0 +1,15 @@
+#ifndef NO_STREAM
+
+#define Uses_TDialog
+#define Uses_TStreamableClass
+#include <tv.h>
+
+__link( RWindow )
+
+TStreamableClass CLY_EXPORT RDialog( TDialog::name,
+ TDialog::build,
+ __DELTA(TDialog)
+ );
+
+#endif
+
diff --git a/tvision/stream/sdircoll.cc b/tvision/stream/sdircoll.cc
new file mode 100644
index 0000000..b08694b
--- /dev/null
+++ b/tvision/stream/sdircoll.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TDirCollection
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RDirCollection( TDirCollection::name,
+ TDirCollection::build,
+ __DELTA(TDirCollection)
+ );
+
+#endif
+
diff --git a/tvision/stream/sdirlist.cc b/tvision/stream/sdirlist.cc
new file mode 100644
index 0000000..8a49c1f
--- /dev/null
+++ b/tvision/stream/sdirlist.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TDirListBox
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RDirListBox( TDirListBox::name,
+ TDirListBox::build,
+ __DELTA(TDirListBox)
+ );
+
+#endif
+
diff --git a/tvision/stream/seditor.cc b/tvision/stream/seditor.cc
new file mode 100644
index 0000000..54a81d4
--- /dev/null
+++ b/tvision/stream/seditor.cc
@@ -0,0 +1,16 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TEditor
+#include <tv.h>
+__link( RView )
+__link( RScrollBar )
+__link( RIndicator )
+
+TStreamableClass CLY_EXPORT REditor( TEditor::name,
+ TEditor::build,
+ __DELTA(TEditor)
+ );
+
+#endif
+
diff --git a/tvision/stream/seditwin.cc b/tvision/stream/seditwin.cc
new file mode 100644
index 0000000..8a48b13
--- /dev/null
+++ b/tvision/stream/seditwin.cc
@@ -0,0 +1,15 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TEditWindow
+#include <tv.h>
+__link( RWindow )
+__link( RFileEditor )
+
+TStreamableClass CLY_EXPORT REditWindow( TEditWindow::name,
+ TEditWindow::build,
+ __DELTA(TEditWindow)
+ );
+
+#endif
+
diff --git a/tvision/stream/sfilecol.cc b/tvision/stream/sfilecol.cc
new file mode 100644
index 0000000..15945dc
--- /dev/null
+++ b/tvision/stream/sfilecol.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TFileCollection
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RFileCollection( TFileCollection::name,
+ TFileCollection::build,
+ __DELTA(TFileCollection)
+ );
+
+#endif
+
diff --git a/tvision/stream/sfiledia.cc b/tvision/stream/sfiledia.cc
new file mode 100644
index 0000000..b6b5875
--- /dev/null
+++ b/tvision/stream/sfiledia.cc
@@ -0,0 +1,16 @@
+#ifndef NO_STREAM
+
+#define Uses_TFileDialog
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RDialog )
+__link( RFileInputLine )
+__link( RFileList )
+
+TStreamableClass CLY_EXPORT RFileDialog( TFileDialog::name,
+ TFileDialog::build,
+ __DELTA(TFileDialog)
+ );
+
+#endif
+
diff --git a/tvision/stream/sfileedi.cc b/tvision/stream/sfileedi.cc
new file mode 100644
index 0000000..0e8b8eb
--- /dev/null
+++ b/tvision/stream/sfileedi.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TFileEditor
+#include <tv.h>
+__link( REditor )
+
+TStreamableClass CLY_EXPORT RFileEditor( TFileEditor::name,
+ TFileEditor::build,
+ __DELTA(TFileEditor)
+ );
+
+#endif
+
diff --git a/tvision/stream/sfileinf.cc b/tvision/stream/sfileinf.cc
new file mode 100644
index 0000000..6d8c441
--- /dev/null
+++ b/tvision/stream/sfileinf.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TFileInfoPane
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RFileInfoPane( TFileInfoPane::name,
+ TFileInfoPane::build,
+ __DELTA(TFileInfoPane)
+ );
+
+#endif
+
diff --git a/tvision/stream/sfileinp.cc b/tvision/stream/sfileinp.cc
new file mode 100644
index 0000000..24fc160
--- /dev/null
+++ b/tvision/stream/sfileinp.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TFileInputLine
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RInputLine )
+
+TStreamableClass CLY_EXPORT RFileInputLine( TFileInputLine::name,
+ TFileInputLine::build,
+ __DELTA(TFileInputLine)
+ );
+
+#endif
+
diff --git a/tvision/stream/sfilelis.cc b/tvision/stream/sfilelis.cc
new file mode 100644
index 0000000..40365b2
--- /dev/null
+++ b/tvision/stream/sfilelis.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TFileList
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RFileList( TFileList::name,
+ TFileList::build,
+ __DELTA(TFileList)
+ );
+
+#endif
+
diff --git a/tvision/stream/sfilterv.cc b/tvision/stream/sfilterv.cc
new file mode 100644
index 0000000..cfd438d
--- /dev/null
+++ b/tvision/stream/sfilterv.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TFilterValidator
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RFilterValidator( TFilterValidator::name,
+ TFilterValidator::build,
+ __DELTA(TFilterValidator)
+ );
+
+#endif
+
diff --git a/tvision/stream/sframe.cc b/tvision/stream/sframe.cc
new file mode 100644
index 0000000..b08f2b0
--- /dev/null
+++ b/tvision/stream/sframe.cc
@@ -0,0 +1,12 @@
+#ifndef NO_STREAM
+
+#define Uses_TFrame
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RFrame( TFrame::name,
+ TFrame::build,
+ __DELTA(TFrame)
+ );
+
+#endif
diff --git a/tvision/stream/sgroup.cc b/tvision/stream/sgroup.cc
new file mode 100644
index 0000000..7d45da2
--- /dev/null
+++ b/tvision/stream/sgroup.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TGroup
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RGroup( TGroup::name,
+ TGroup::build,
+ __DELTA(TGroup)
+ );
+
+#endif
+
diff --git a/tvision/stream/shistory.cc b/tvision/stream/shistory.cc
new file mode 100644
index 0000000..5ad00f2
--- /dev/null
+++ b/tvision/stream/shistory.cc
@@ -0,0 +1,15 @@
+#ifndef NO_STREAM
+
+#define Uses_THistory
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+__link( RInputLine )
+
+TStreamableClass CLY_EXPORT RHistory( THistory::name,
+ THistory::build,
+ __DELTA(THistory)
+ );
+
+#endif
+
diff --git a/tvision/stream/sindicat.cc b/tvision/stream/sindicat.cc
new file mode 100644
index 0000000..3d7b2ff
--- /dev/null
+++ b/tvision/stream/sindicat.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TIndicator
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RIndicator( TIndicator::name,
+ TIndicator::build,
+ __DELTA(TIndicator)
+ );
+
+#endif
+
diff --git a/tvision/stream/sinputli.cc b/tvision/stream/sinputli.cc
new file mode 100644
index 0000000..c86774a
--- /dev/null
+++ b/tvision/stream/sinputli.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TInputLine
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RInputLine( TInputLine::name,
+ TInputLine::build,
+ __DELTA(TInputLine)
+ );
+
+#endif
+
diff --git a/tvision/stream/slabel.cc b/tvision/stream/slabel.cc
new file mode 100644
index 0000000..f05c225
--- /dev/null
+++ b/tvision/stream/slabel.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TLabel
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RStaticText )
+
+TStreamableClass CLY_EXPORT RLabel( TLabel::name,
+ TLabel::build,
+ __DELTA(TLabel)
+ );
+
+#endif
+
diff --git a/tvision/stream/slistbox.cc b/tvision/stream/slistbox.cc
new file mode 100644
index 0000000..249f531
--- /dev/null
+++ b/tvision/stream/slistbox.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TListBox
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RListViewer )
+
+TStreamableClass CLY_EXPORT RListBox( TListBox::name,
+ TListBox::build,
+ __DELTA(TListBox)
+ );
+
+#endif
+
diff --git a/tvision/stream/slistvie.cc b/tvision/stream/slistvie.cc
new file mode 100644
index 0000000..619c2cf
--- /dev/null
+++ b/tvision/stream/slistvie.cc
@@ -0,0 +1,15 @@
+#ifndef NO_STREAM
+
+#define Uses_TListViewer
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+__link( RScrollBar )
+
+TStreamableClass CLY_EXPORT RListViewer( TListViewer::name,
+ TListViewer::build,
+ __DELTA(TListViewer)
+ );
+
+#endif
+
diff --git a/tvision/stream/slookupv.cc b/tvision/stream/slookupv.cc
new file mode 100644
index 0000000..cc0662a
--- /dev/null
+++ b/tvision/stream/slookupv.cc
@@ -0,0 +1,18 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TStringLookupValidator
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RStringLookupValidator( TStringLookupValidator::name,
+ TStringLookupValidator::build,
+ __DELTA(TStringLookupValidator)
+ );
+
+TStreamableClass CLY_EXPORT RLookupValidator( TLookupValidator::name,
+ TLookupValidator::build,
+ __DELTA(TLookupValidator)
+ );
+
+#endif
+
diff --git a/tvision/stream/smemo.cc b/tvision/stream/smemo.cc
new file mode 100644
index 0000000..72deb15
--- /dev/null
+++ b/tvision/stream/smemo.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TMemo
+#include <tv.h>
+__link( REditor )
+
+TStreamableClass CLY_EXPORT RMemo( TMemo::name,
+ TMemo::build,
+ __DELTA(TMemo)
+ );
+
+#endif
+
diff --git a/tvision/stream/smenubar.cc b/tvision/stream/smenubar.cc
new file mode 100644
index 0000000..a6abf62
--- /dev/null
+++ b/tvision/stream/smenubar.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TMenuBar
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RMenuBar( TMenuBar::name,
+ TMenuBar::build,
+ __DELTA(TMenuBar)
+ );
+
+#endif
+
diff --git a/tvision/stream/smenubox.cc b/tvision/stream/smenubox.cc
new file mode 100644
index 0000000..fa0727e
--- /dev/null
+++ b/tvision/stream/smenubox.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TMenuBox
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RMenuBox( TMenuBox::name,
+ TMenuBox::build,
+ __DELTA(TMenuBox)
+ );
+
+#endif
+
diff --git a/tvision/stream/smenuvie.cc b/tvision/stream/smenuvie.cc
new file mode 100644
index 0000000..cd4a362
--- /dev/null
+++ b/tvision/stream/smenuvie.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TMenuView
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RMenuView( TMenuView::name,
+ TMenuView::build,
+ __DELTA(TMenuView)
+ );
+
+#endif
+
diff --git a/tvision/stream/smonosel.cc b/tvision/stream/smonosel.cc
new file mode 100644
index 0000000..0cfe669
--- /dev/null
+++ b/tvision/stream/smonosel.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TMonoSelector
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RCluster )
+
+TStreamableClass CLY_EXPORT RMonoSelector( TMonoSelector::name,
+ TMonoSelector::build,
+ __DELTA(TMonoSelector)
+ );
+
+#endif
+
diff --git a/tvision/stream/sparamte.cc b/tvision/stream/sparamte.cc
new file mode 100644
index 0000000..9ceee1f
--- /dev/null
+++ b/tvision/stream/sparamte.cc
@@ -0,0 +1,15 @@
+#ifndef NO_STREAM
+
+#define Uses_TParamText
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+__link( RStaticText )
+
+TStreamableClass CLY_EXPORT RParamText( TParamText::name,
+ TParamText::build,
+ __DELTA(TParamText)
+ );
+
+#endif
+
diff --git a/tvision/stream/spxvalid.cc b/tvision/stream/spxvalid.cc
new file mode 100644
index 0000000..a1f8cc3
--- /dev/null
+++ b/tvision/stream/spxvalid.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TPXPictureValidator
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RPXPictureValidator( TPXPictureValidator::name,
+ TPXPictureValidator::build,
+ __DELTA(TPXPictureValidator)
+ );
+
+#endif
+
diff --git a/tvision/stream/sradiobu.cc b/tvision/stream/sradiobu.cc
new file mode 100644
index 0000000..81f4249
--- /dev/null
+++ b/tvision/stream/sradiobu.cc
@@ -0,0 +1,18 @@
+#ifndef NO_STREAM
+
+#define Uses_TRadioButtons
+#define Uses_TStreamableClass
+#include <tv.h>
+
+__link( RCluster )
+TStreamableClass CLY_EXPORT RRadioButtons( TRadioButtons::name,
+ TRadioButtons::build,
+ __DELTA(TRadioButtons)
+ );
+TStreamableClass CLY_EXPORT RRadioButtons32( TRadioButtons32::name,
+ TRadioButtons32::build,
+ __DELTA(TRadioButtons32)
+ );
+
+#endif
+
diff --git a/tvision/stream/srangeva.cc b/tvision/stream/srangeva.cc
new file mode 100644
index 0000000..69e99f2
--- /dev/null
+++ b/tvision/stream/srangeva.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TStreamableClass
+#define Uses_TRangeValidator
+#include <tv.h>
+__link(RFilterValidator)
+
+TStreamableClass CLY_EXPORT RRangeValidator( TRangeValidator::name,
+ TRangeValidator::build,
+ __DELTA(TRangeValidator)
+ );
+
+#endif
+
diff --git a/tvision/stream/sresourc.cc b/tvision/stream/sresourc.cc
new file mode 100644
index 0000000..4bd502d
--- /dev/null
+++ b/tvision/stream/sresourc.cc
@@ -0,0 +1,12 @@
+#ifndef NO_STREAM
+
+#define Uses_TResourceCollection
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RResourceCollection( TResourceCollection::name,
+ TResourceCollection::build,
+ __DELTA(TResourceCollection)
+ );
+#endif
+
diff --git a/tvision/stream/sscrollb.cc b/tvision/stream/sscrollb.cc
new file mode 100644
index 0000000..6827634
--- /dev/null
+++ b/tvision/stream/sscrollb.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TScrollBar
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RScrollBar( TScrollBar::name,
+ TScrollBar::build,
+ __DELTA(TScrollBar)
+ );
+
+#endif
+
diff --git a/tvision/stream/sscrolle.cc b/tvision/stream/sscrolle.cc
new file mode 100644
index 0000000..26f8ce9
--- /dev/null
+++ b/tvision/stream/sscrolle.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TScroller
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RScroller( TScroller::name,
+ TScroller::build,
+ __DELTA(TScroller)
+ );
+
+#endif
+
diff --git a/tvision/stream/sstatict.cc b/tvision/stream/sstatict.cc
new file mode 100644
index 0000000..f222028
--- /dev/null
+++ b/tvision/stream/sstatict.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TStaticText
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RStaticText( TStaticText::name,
+ TStaticText::build,
+ __DELTA(TStaticText)
+ );
+
+#endif
+
diff --git a/tvision/stream/sstatusl.cc b/tvision/stream/sstatusl.cc
new file mode 100644
index 0000000..dfa77df
--- /dev/null
+++ b/tvision/stream/sstatusl.cc
@@ -0,0 +1,14 @@
+#ifndef NO_STREAM
+
+#define Uses_TStatusLine
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RView )
+
+TStreamableClass CLY_EXPORT RStatusLine( TStatusLine::name,
+ TStatusLine::build,
+ __DELTA(TStatusLine)
+ );
+
+#endif
+
diff --git a/tvision/stream/sstringc.cc b/tvision/stream/sstringc.cc
new file mode 100644
index 0000000..f3ec096
--- /dev/null
+++ b/tvision/stream/sstringc.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TStringCollection
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RStringCollection( TStringCollection::name,
+ TStringCollection::build,
+ __DELTA(TStringCollection)
+ );
+
+#endif
+
diff --git a/tvision/stream/sstringl.cc b/tvision/stream/sstringl.cc
new file mode 100644
index 0000000..5c92211
--- /dev/null
+++ b/tvision/stream/sstringl.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TStringList
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RStringList( TStringList::name,
+ TStringList::build,
+ __DELTA(TStringList)
+ );
+
+#endif
+
diff --git a/tvision/stream/sview.cc b/tvision/stream/sview.cc
new file mode 100644
index 0000000..4d71107
--- /dev/null
+++ b/tvision/stream/sview.cc
@@ -0,0 +1,13 @@
+#ifndef NO_STREAM
+
+#define Uses_TView
+#define Uses_TStreamableClass
+#include <tv.h>
+
+TStreamableClass CLY_EXPORT RView( TView::name,
+ TView::build,
+ __DELTA(TView)
+ );
+
+#endif
+
diff --git a/tvision/stream/swindow.cc b/tvision/stream/swindow.cc
new file mode 100644
index 0000000..74be814
--- /dev/null
+++ b/tvision/stream/swindow.cc
@@ -0,0 +1,15 @@
+#ifndef NO_STREAM
+
+#define Uses_TWindow
+#define Uses_TStreamableClass
+#include <tv.h>
+__link( RGroup )
+__link( RFrame )
+
+TStreamableClass CLY_EXPORT RWindow( TWindow::name,
+ TWindow::build,
+ __DELTA(TWindow)
+ );
+
+#endif
+
diff --git a/tvision/update b/tvision/update
new file mode 100755
index 0000000..5cfdf3b
--- /dev/null
+++ b/tvision/update
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Copyright (C) 2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This file updates the sources from CVS. I redirect the stderr to null
+# because I don't want to fill the screen with the directory names. You
+# must be careful because the errors are discarded.
+# The -d option updates new directories, without it they aren't
+# created.
+# The -P option purges empty directories, they are no longer used
+# directories that CVS keeps to allow recovering old tree structures.
+#
+echo
+echo Updating from CVS. Errors are discarded!
+echo
+cvs update -dP 2> /dev/null
diff --git a/tvision/update.bat b/tvision/update.bat
new file mode 100755
index 0000000..90ec742
--- /dev/null
+++ b/tvision/update.bat
@@ -0,0 +1,15 @@
+:@Rem Copyright (C) 2003 by Salvador E. Tropea (SET),
+:@Rem see copyrigh file for details
+:@Rem
+:@Rem This file updates the sources from CVS. I redirect the stderr to null
+:@Rem because I don't want to fill the screen with the directory names. You
+:@Rem must be careful because the errors are discarded.
+:@Rem The -d option updates new directories, without it they aren't
+:@Rem created.
+:@Rem The -P option purges empty directories, they are no longer used
+:@Rem directories that CVS keeps to allow recovering old tree structures.
+:@Rem
+@echo .
+@echo Updating from CVS. Errors are discarded!
+@echo .
+@redir -e /dev/null cvs update -dP
diff --git a/tvision/version.txt b/tvision/version.txt
new file mode 100644
index 0000000..ccbccc3
--- /dev/null
+++ b/tvision/version.txt
@@ -0,0 +1 @@
+2.2.0
diff --git a/tvision/win32/readme.txt b/tvision/win32/readme.txt
new file mode 100644
index 0000000..6dfa3b0
--- /dev/null
+++ b/tvision/win32/readme.txt
@@ -0,0 +1,71 @@
+ This file contains information about how to build the Win32 version of the
+library. I tested it under Windows 95 and NT 4 so I think it works for any of
+the Win32 family members (98, 2000, etc.).
+
+ The Win32 version port was contributed by Vadim Beloborodov.
+ After some adjustments (with the help of Ronald Landheer) we are getting it
+working for Cygwin also. In version 2.0 things changed a lot, internally, and
+I had to make a lot of changes in the code. I also added some new members
+taking a look at a Win32 API reference. I must admit the API is clean and
+simple and the 2.0 code is quite compact and simple.
+
+* What compilers are supported?
+
+ Cygwin, I used 1.3.3-2 for testing.
+
+ MinGW, I did the last test and adjustments with MinGW 1.1, MSys 1.0.7 and
+the Siemens Perl port (SiePerl). This provides a good environment for
+compilation. You must ensure that MSys' make is used because MinGW 1.1 ships
+a make command that fails. Attention!!! never run TV program from the MSys
+prompt, at least in v1.0.7 it doesn't support Win32 console applications
+(redirects stdin/stdout).
+
+ MSVC (5.0/6.0/7.0) is also supported, but I don't have access to it so I can't
+be sure if it works ok. You should have no problems or at most very simple
+ones. Also note that Vadim wrote the MSVC make file with GNU tools in mind
+(he used rm instead of just del ;-). I'll sugest you to first try compiling
+with MinGW and after it (you'll get a working makefile and GNU tools) try
+with MSVC. Take a look at the ../winnt directory for a possible solution.
+ If you are looking for a Borland C++ port take a look at the
+../winnt/readme.txt file.
+
+* Why this target have special instructions and isn't explained in the main
+ readme file?
+
+ Currently the Win32 target is under test, Vadim did a very good work and I
+think the port is very stable and functional, but some details remains to be
+solved.
+ In the past these targets needed special treatment, currently using Cygwin
+or MinGW+MSys the compilation process is the same used for DOS and UNIX.
+Basically go to ../ and run ./configure then just run make. Note you need
+perl, fileutils, a generic shell called /bin/sh (could be a link to bash) and
+make installed.
+ If you are using MSVC you can try using the Makefile.ms file, but you'll
+need GNU make and some GNU tools. You can also try using nmake and the file
+located at ../winnt, but this is under development.
+ To run the configuration process you need:
+
+* How do I compile the library without configuring?
+
+ I really encourage to try using the configuration process. But you can try
+with the already configured Makefile:
+
+ MinGW: make
+ MSVC: Use make to compile, the file makefile is called makefile.ms
+ (make -f makefile.ms)
+ This makefile is most probably outdated, if anyone is really
+ interested on it let me know.
+
+* How do I compile the demo without configuring?
+
+ MinGW: make -f demo.mak
+ MSVC: The makefile is called demo.ms (make -f demo.ms)
+ This makefile is most probably outdated, if anyone is really
+ interested on it let me know.
+
+* Some additional comments:
+
+ The library is slower than the DOS version or the Linux/VCSA version.
+That's because the Win32 console API isn't fast.
+ You can obtain some GNU utilities compiled by MSVC for Win32 from 'GNU
+utilities for Win32` project located at http://unxutils.sourceforge.net/
diff --git a/tvision/winnt/Makefile b/tvision/winnt/Makefile
new file mode 100644
index 0000000..c7cd71b
--- /dev/null
+++ b/tvision/winnt/Makefile
@@ -0,0 +1,169 @@
+# Makefile for building Turbo Vision library for Win32
+
+
+
+# Borland C++
+CC = bcc32
+LD = bcc32
+CXX = $(CC)
+INC = -I.\include -I..\include
+
+!ifdef DEBUG
+CDEBUGFLAGS = -v -vi -y -6 -Od
+!else
+CDEBUGFLAGS = -O2 -6 -T -DNDEBUG
+!endif
+
+!ifdef DYNRTL
+DYNRTLDFLAGS = -WR
+!endif
+
+# SET: I disabled the condition always true warning. BC++ should be more
+# cleaver about it, code like this: if (1) ... isn't wrong and is
+# obviously on purpose. GCC reports it for things like
+# if ((unsigned)a<0) which is always false and looks like an error ;-)
+# Note: SAA disabled Asigned a value that is never used because BC++ is very
+# annoying about assigning a default value for a variable that is
+# assigned latter.
+CFLAGS = -D_BCPP -w-aus -w-ccc -a8 $(DYNRTLDFLAGS) -WC -X -q $(CDEBUGFLAGS)
+# SET: I disabled the member x hides virtual member y because I don't
+# understand why it is reported if you know please explain me.
+CXXFLAGS = -P -RT- -w-hid $(CFLAGS)
+LDFLAGS = $(DYNRTLDFLAGS) -WC
+
+# Microsoft Visual C++
+# NOTE: does not work yet
+#CXX = cl
+#INC = -I.\include\msvc -I.\include -I..\include
+#CXXFLAGS = -c -TP -D_MSVC -MDd
+
+.SUFFIXES: .cc .c .obj
+
+TV_OBJS_ = +beep.obj +drivevalid.obj +expandpath.obj +fexpand.obj +fileattrs.obj\
++fileexists.obj +filelength.obj +fixpath.obj +fnmatch.obj +getcurdir.obj +getline.obj\
++getopt.obj +getopt1.obj +getshell.obj +glob.obj +globfree.obj +iffilelen.obj +isdir.obj\
++isrelpath.obj +iswild.obj +itoa.obj +mkstemp.obj +nl_langinfo.obj +ntdirent.obj\
++pathvalid.obj +regex.obj +releasec.obj +snprintf.obj +ssc_streams.obj +strlwr.obj\
++strupr.obj +ticks.obj +unc.obj +unc_95.obj +unc_nt.obj +validfilename.obj +yieldpro.obj\
++alcon.obj +alcondis.obj +alconkey.obj +alconmouse.obj +alconscr.obj +calcdisp.obj\
++calculat.obj +codepage.obj +configfile.obj +dosdis.obj +doskey.obj +dosmouse.obj\
++dosscr.obj +drivers2.obj +dual.obj +fileview.obj +fontcoll.obj +fpbase.obj +fpstream.obj\
++help.obj +helpbase.obj +histlist.obj +ifpstrea.obj +iopstrea.obj +ipstream.obj\
++linuxdis.obj +linuxkey.obj +linuxmouse.obj +linuxscr.obj +misc.obj +msgbox.obj\
++nbackgro.obj +nbutton.obj +ncalcdis.obj +ncalcula.obj +nchdirdi.obj +ncheckbo.obj\
++nclrdisp.obj +ncluster.obj +ncollect.obj +ncolordi.obj +ncolorgr.obj +ncolorit.obj\
++ncolorse.obj +ndesktop.obj +ndialog.obj +ndircoll.obj +ndirlist.obj +neditor.obj\
++neditwi.obj +newstr.obj +nfilecol.obj +nfiledia.obj +nfiledtr.obj +nfileinf.obj\
++nfileinp.obj +nfilelis.obj +nfilterv.obj +nframe.obj +ngroup.obj +nhistory.obj\
++nindicat.obj +ninputli.obj +nlabel.obj +nlistbox.obj +nlistvie.obj +nlookupv.obj\
++nmemo.obj +nmenubar.obj +nmenubox.obj +nmenuvie.obj +nmonosel.obj +nparamte.obj\
++npxvalid.obj +nradiobu.obj +nrangeva.obj +nresourc.obj +nscrollb.obj +nscrolle.obj\
++nsortedc.obj +nsortedl.obj +nstatict.obj +nstatusl.obj +nstringc.obj +nstringl.obj\
++nvalidat.obj +nview.obj +nwindow.obj +ofpstrea.obj +opstream.obj +osclipboard.obj\
++pstream.obj +qnx4dis.obj +qnx4key.obj +qnx4mouse.obj +qnx4scr.obj +qnxdis.obj +qnxkey.obj\
++qnxmouse.obj +qnxscr.obj +rhscreen.obj +sbackgro.obj +sbutton.obj +scalcdis.obj\
++scalcula.obj +schdirdi.obj +scheckbo.obj +sclrdisp.obj +scluster.obj +scolordi.obj\
++scolorgr.obj +scolorit.obj +scolorse.obj +screen.obj +sdesktop.obj +sdialog.obj\
++sdircoll.obj +sdirlist.obj +seditor.obj +seditwin.obj +sescreen.obj +sfilecol.obj\
++sfiledia.obj +sfileedi.obj +sfileinf.obj +sfileinp.obj +sfilelis.obj +sfilterv.obj\
++sframe.obj +sgroup.obj +shistory.obj +sindicat.obj +sinputli.obj +slabel.obj\
++slistbox.obj +slistvie.obj +slookupv.obj +smemo.obj +smenubar.obj +smenubox.obj\
++smenuvie.obj +smonosel.obj +sparamte.obj +spxvalid.obj +sradiobu.obj +srangeva.obj\
++sresourc.obj +sscrollb.obj +sscrolle.obj +sstatict.obj +sstatusl.obj +sstringc.obj\
++sstringl.obj +sview.obj +swindow.obj +tapplica.obj +tbackgro.obj +tbutton.obj\
++tchdirdi.obj +tcheckbo.obj +tclrdisp.obj +tcluster.obj +tcollect.obj +tcolordi.obj\
++tcolorgr.obj +tcolorit.obj +tcolorse.obj +tcommand.obj +tdesktop.obj +tdialog.obj\
++tdircoll.obj +tdirlist.obj +tdisplay.obj +tdrawbuf.obj +teditor.obj +teditorf.obj\
++teditwin.obj +tevent.obj +tfilecol.obj +tfiledia.obj +tfileedi.obj +tfileinf.obj\
++tfileinp.obj +tfilelis.obj +tfilterv.obj +tframe.obj +tgkey.obj +tgroup.obj +thistory.obj\
++thistvie.obj +thistwin.obj +thwmouse.obj +tindicat.obj +tinputli.obj +tlabel.obj\
++tlistbox.obj +tlistvie.obj +tlookupv.obj +tmemo.obj +tmenubar.obj +tmenubox.obj\
++tmenuvie.obj +tmonosel.obj +tmouse.obj +tnscolle.obj +tnssorte.obj +tobject.obj\
++tpalette.obj +tparamte.obj +tpoint.obj +tprogini.obj +tprogram.obj +tpwobj.obj\
++tpwreado.obj +tpwritte.obj +tpxvalid.obj +tradiobu.obj +trangeva.obj +trescoll.obj\
++tresfile.obj +tscreen.obj +tscrollb.obj +tscrolle.obj +tsortedc.obj +tsortedl.obj\
++tstatict.obj +tstatusd.obj +tstatusl.obj +tstrinde.obj +tstringc.obj +tstringl.obj\
++tstrlist.obj +tstrmcla.obj +tstrmtyp.obj +tsubmenu.obj +ttermina.obj +ttextdev.obj\
++tvalidat.obj +tvedit1.obj +tvedit2.obj +tvedit3.obj +tview.obj +tvintl.obj +tvtext1.obj\
++tvtext2.obj +twindow.obj +unixdis.obj +unixkey.obj +unixmouse.obj +unixscr.obj \
+ +win32clip.obj +win32dis.obj +win32key.obj\
++win32mouse.obj +win32scr.obj +wingrdis.obj +wingrkey.obj +wingrmouse.obj +wingrscr.obj\
++winntdis.obj +winntkey.obj +winntmouse.obj +winntscr.obj +x11dis.obj +x11key.obj\
++x11mouse.obj +x11src.obj +xtermdis.obj +xtermkey.obj +xtermmouse.obj +xtermscr.obj
+OBJS = $(TV_OBJS_:+=objs\)
+
+all: rhtv.lib tvex.exe
+
+rhtv.lib: $(OBJS)
+ del $@
+ tlib /E /P256 $@ @&&!
++$(**: = &^
++)
+!
+
+tvex.exe: objs\tvex.obj rhtv.lib
+ $(CC) $(LDFLAGS) -etvex.exe objs\tvex.obj rhtv.lib
+
+{.}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\dos}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\linux}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\qnxrtp}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\qnx4}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\unix}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\x11}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\win32}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\wingr}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\winnt}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\names}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\stream}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+
+{..\compat}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+
+{..\compat}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+# objs\tscreen.obj: ..\classes\WinNT\tscreen.cc
+# objs\tdsiplay.obj: ..\classes\WinNT\tdsiplay.cc
+# objs\tfont.obj: ..\classes\WinNT\tfont.cc
+# objs\thwmouse.obj: ..\classes\WinNT\thwmouse.cc
+
+clean:
+ -del objs\*.obj
+ -del *.obj
+ -del *.exe
+ -del *.tds
+ -del *.lib
+
diff --git a/tvision/winnt/Makefile.nmk b/tvision/winnt/Makefile.nmk
new file mode 100644
index 0000000..f65569a
--- /dev/null
+++ b/tvision/winnt/Makefile.nmk
@@ -0,0 +1,151 @@
+# Makefile for MS VC 5.0-6.0
+# Modified for use with MS NMAKE
+# Run: nmake -f Makefile.nmk all
+
+# Add here -IPATH_TO_MSVC_HEADERS (to both variables)
+# example: -ID:\MVS\VC98\Include
+CFLAGS=-O2 -I./include -I../include -D_WIN32 /GR- /GX-
+# The /EHsc options seems to be needed by .NET 2003 compiler.
+# I'm not sure if they interfere with older versions, please report about it.
+CXXFLAGS=-O2 -I./include -I../include -D_WIN32 /GR- /GX- /EHsc
+
+OBJDIR=obj_ms
+
+#clean default extension list
+.SUFFIXES:
+#append extensions to list
+.SUFFIXES: .cc .cpp .c
+
+SRC1 = ../
+SRC2 = ../compat
+SRC3 = ../names
+SRC4 = ../stream
+SRC5 = ../classes
+SRC6 = ../classes/dos
+SRC7 = ../classes/win32
+SRC8 = ../classes/winnt
+SRC9 = ../classes/linux
+SRCA = ../classes/qnxrtp
+SRCB = ../classes/unix
+SRCC = ../classes/x11
+SRCD = ../classes/wingr
+SRCE = ../classes/qnx4
+#SRC7 = ./examples/tutorial
+#SRC3 = ./
+
+CC=cl /nologo
+CXX=cl /nologo
+
+OBJS= $(OBJDIR)/beep.o $(OBJDIR)/drivevalid.o $(OBJDIR)/expandpath.o $(OBJDIR)/fexpand.o $(OBJDIR)/fileattrs.o\
+ $(OBJDIR)/fileexists.o $(OBJDIR)/filelength.o $(OBJDIR)/fixpath.o $(OBJDIR)/fnmatch.o $(OBJDIR)/getcurdir.o $(OBJDIR)/getline.o\
+ $(OBJDIR)/getopt.o $(OBJDIR)/getopt1.o $(OBJDIR)/getshell.o $(OBJDIR)/glob.o $(OBJDIR)/globfree.o $(OBJDIR)/iffilelen.o $(OBJDIR)/isdir.o\
+ $(OBJDIR)/isrelpath.o $(OBJDIR)/iswild.o $(OBJDIR)/itoa.o $(OBJDIR)/mkstemp.o $(OBJDIR)/nl_langinfo.o $(OBJDIR)/ntdirent.o\
+ $(OBJDIR)/pathvalid.o $(OBJDIR)/regex.o $(OBJDIR)/releasec.o $(OBJDIR)/snprintf.o $(OBJDIR)/ssc_streams.o $(OBJDIR)/strlwr.o\
+ $(OBJDIR)/strupr.o $(OBJDIR)/ticks.o $(OBJDIR)/unc.o $(OBJDIR)/unc_95.o $(OBJDIR)/unc_nt.o $(OBJDIR)/validfilename.o $(OBJDIR)/yieldpro.o\
+ $(OBJDIR)/alcon.o $(OBJDIR)/alcondis.o $(OBJDIR)/alconkey.o $(OBJDIR)/alconmouse.o $(OBJDIR)/alconscr.o $(OBJDIR)/calcdisp.o\
+ $(OBJDIR)/calculat.o $(OBJDIR)/codepage.o $(OBJDIR)/configfile.o $(OBJDIR)/dosdis.o $(OBJDIR)/doskey.o $(OBJDIR)/dosmouse.o\
+ $(OBJDIR)/dosscr.o $(OBJDIR)/drivers2.o $(OBJDIR)/dual.o $(OBJDIR)/fileview.o $(OBJDIR)/fontcoll.o $(OBJDIR)/fpbase.o $(OBJDIR)/fpstream.o\
+ $(OBJDIR)/help.o $(OBJDIR)/helpbase.o $(OBJDIR)/histlist.o $(OBJDIR)/ifpstrea.o $(OBJDIR)/iopstrea.o $(OBJDIR)/ipstream.o\
+ $(OBJDIR)/linuxdis.o $(OBJDIR)/linuxkey.o $(OBJDIR)/linuxmouse.o $(OBJDIR)/linuxscr.o $(OBJDIR)/misc.o $(OBJDIR)/msgbox.o\
+ $(OBJDIR)/nbackgro.o $(OBJDIR)/nbutton.o $(OBJDIR)/ncalcdis.o $(OBJDIR)/ncalcula.o $(OBJDIR)/nchdirdi.o $(OBJDIR)/ncheckbo.o\
+ $(OBJDIR)/nclrdisp.o $(OBJDIR)/ncluster.o $(OBJDIR)/ncollect.o $(OBJDIR)/ncolordi.o $(OBJDIR)/ncolorgr.o $(OBJDIR)/ncolorit.o\
+ $(OBJDIR)/ncolorse.o $(OBJDIR)/ndesktop.o $(OBJDIR)/ndialog.o $(OBJDIR)/ndircoll.o $(OBJDIR)/ndirlist.o $(OBJDIR)/neditor.o\
+ $(OBJDIR)/neditwi.o $(OBJDIR)/newstr.o $(OBJDIR)/nfilecol.o $(OBJDIR)/nfiledia.o $(OBJDIR)/nfiledtr.o $(OBJDIR)/nfileinf.o\
+ $(OBJDIR)/nfileinp.o $(OBJDIR)/nfilelis.o $(OBJDIR)/nfilterv.o $(OBJDIR)/nframe.o $(OBJDIR)/ngroup.o $(OBJDIR)/nhistory.o\
+ $(OBJDIR)/nindicat.o $(OBJDIR)/ninputli.o $(OBJDIR)/nlabel.o $(OBJDIR)/nlistbox.o $(OBJDIR)/nlistvie.o $(OBJDIR)/nlookupv.o\
+ $(OBJDIR)/nmemo.o $(OBJDIR)/nmenubar.o $(OBJDIR)/nmenubox.o $(OBJDIR)/nmenuvie.o $(OBJDIR)/nmonosel.o $(OBJDIR)/nparamte.o\
+ $(OBJDIR)/npxvalid.o $(OBJDIR)/nradiobu.o $(OBJDIR)/nrangeva.o $(OBJDIR)/nresourc.o $(OBJDIR)/nscrollb.o $(OBJDIR)/nscrolle.o\
+ $(OBJDIR)/nsortedc.o $(OBJDIR)/nsortedl.o $(OBJDIR)/nstatict.o $(OBJDIR)/nstatusl.o $(OBJDIR)/nstringc.o $(OBJDIR)/nstringl.o\
+ $(OBJDIR)/nvalidat.o $(OBJDIR)/nview.o $(OBJDIR)/nwindow.o $(OBJDIR)/ofpstrea.o $(OBJDIR)/opstream.o $(OBJDIR)/osclipboard.o\
+ $(OBJDIR)/pstream.o $(OBJDIR)/qnx4dis.o $(OBJDIR)/qnx4key.o $(OBJDIR)/qnx4mouse.o $(OBJDIR)/qnx4scr.o $(OBJDIR)/qnxdis.o $(OBJDIR)/qnxkey.o\
+ $(OBJDIR)/qnxmouse.o $(OBJDIR)/qnxscr.o $(OBJDIR)/rhscreen.o $(OBJDIR)/sbackgro.o $(OBJDIR)/sbutton.o $(OBJDIR)/scalcdis.o\
+ $(OBJDIR)/scalcula.o $(OBJDIR)/schdirdi.o $(OBJDIR)/scheckbo.o $(OBJDIR)/sclrdisp.o $(OBJDIR)/scluster.o $(OBJDIR)/scolordi.o\
+ $(OBJDIR)/scolorgr.o $(OBJDIR)/scolorit.o $(OBJDIR)/scolorse.o $(OBJDIR)/screen.o $(OBJDIR)/sdesktop.o $(OBJDIR)/sdialog.o\
+ $(OBJDIR)/sdircoll.o $(OBJDIR)/sdirlist.o $(OBJDIR)/seditor.o $(OBJDIR)/seditwin.o $(OBJDIR)/sescreen.o $(OBJDIR)/sfilecol.o\
+ $(OBJDIR)/sfiledia.o $(OBJDIR)/sfileedi.o $(OBJDIR)/sfileinf.o $(OBJDIR)/sfileinp.o $(OBJDIR)/sfilelis.o $(OBJDIR)/sfilterv.o\
+ $(OBJDIR)/sframe.o $(OBJDIR)/sgroup.o $(OBJDIR)/shistory.o $(OBJDIR)/sindicat.o $(OBJDIR)/sinputli.o $(OBJDIR)/slabel.o\
+ $(OBJDIR)/slistbox.o $(OBJDIR)/slistvie.o $(OBJDIR)/slookupv.o $(OBJDIR)/smemo.o $(OBJDIR)/smenubar.o $(OBJDIR)/smenubox.o\
+ $(OBJDIR)/smenuvie.o $(OBJDIR)/smonosel.o $(OBJDIR)/sparamte.o $(OBJDIR)/spxvalid.o $(OBJDIR)/sradiobu.o $(OBJDIR)/srangeva.o\
+ $(OBJDIR)/sresourc.o $(OBJDIR)/sscrollb.o $(OBJDIR)/sscrolle.o $(OBJDIR)/sstatict.o $(OBJDIR)/sstatusl.o $(OBJDIR)/sstringc.o\
+ $(OBJDIR)/sstringl.o $(OBJDIR)/sview.o $(OBJDIR)/swindow.o $(OBJDIR)/tapplica.o $(OBJDIR)/tbackgro.o $(OBJDIR)/tbutton.o\
+ $(OBJDIR)/tchdirdi.o $(OBJDIR)/tcheckbo.o $(OBJDIR)/tclrdisp.o $(OBJDIR)/tcluster.o $(OBJDIR)/tcollect.o $(OBJDIR)/tcolordi.o\
+ $(OBJDIR)/tcolorgr.o $(OBJDIR)/tcolorit.o $(OBJDIR)/tcolorse.o $(OBJDIR)/tcommand.o $(OBJDIR)/tdesktop.o $(OBJDIR)/tdialog.o\
+ $(OBJDIR)/tdircoll.o $(OBJDIR)/tdirlist.o $(OBJDIR)/tdisplay.o $(OBJDIR)/tdrawbuf.o $(OBJDIR)/teditor.o $(OBJDIR)/teditorf.o\
+ $(OBJDIR)/teditwin.o $(OBJDIR)/tevent.o $(OBJDIR)/tfilecol.o $(OBJDIR)/tfiledia.o $(OBJDIR)/tfileedi.o $(OBJDIR)/tfileinf.o\
+ $(OBJDIR)/tfileinp.o $(OBJDIR)/tfilelis.o $(OBJDIR)/tfilterv.o $(OBJDIR)/tframe.o $(OBJDIR)/tgkey.o $(OBJDIR)/tgroup.o $(OBJDIR)/thistory.o\
+ $(OBJDIR)/thistvie.o $(OBJDIR)/thistwin.o $(OBJDIR)/thwmouse.o $(OBJDIR)/tindicat.o $(OBJDIR)/tinputli.o $(OBJDIR)/tlabel.o\
+ $(OBJDIR)/tlistbox.o $(OBJDIR)/tlistvie.o $(OBJDIR)/tlookupv.o $(OBJDIR)/tmemo.o $(OBJDIR)/tmenubar.o $(OBJDIR)/tmenubox.o\
+ $(OBJDIR)/tmenuvie.o $(OBJDIR)/tmonosel.o $(OBJDIR)/tmouse.o $(OBJDIR)/tnscolle.o $(OBJDIR)/tnssorte.o $(OBJDIR)/tobject.o\
+ $(OBJDIR)/tpalette.o $(OBJDIR)/tparamte.o $(OBJDIR)/tpoint.o $(OBJDIR)/tprogini.o $(OBJDIR)/tprogram.o $(OBJDIR)/tpwobj.o\
+ $(OBJDIR)/tpwreado.o $(OBJDIR)/tpwritte.o $(OBJDIR)/tpxvalid.o $(OBJDIR)/tradiobu.o $(OBJDIR)/trangeva.o $(OBJDIR)/trescoll.o\
+ $(OBJDIR)/tresfile.o $(OBJDIR)/tscreen.o $(OBJDIR)/tscrollb.o $(OBJDIR)/tscrolle.o $(OBJDIR)/tsortedc.o $(OBJDIR)/tsortedl.o\
+ $(OBJDIR)/tstatict.o $(OBJDIR)/tstatusd.o $(OBJDIR)/tstatusl.o $(OBJDIR)/tstrinde.o $(OBJDIR)/tstringc.o $(OBJDIR)/tstringl.o\
+ $(OBJDIR)/tstrlist.o $(OBJDIR)/tstrmcla.o $(OBJDIR)/tstrmtyp.o $(OBJDIR)/tsubmenu.o $(OBJDIR)/ttermina.o $(OBJDIR)/ttextdev.o\
+ $(OBJDIR)/tvalidat.o $(OBJDIR)/tvedit1.o $(OBJDIR)/tvedit2.o $(OBJDIR)/tvedit3.o $(OBJDIR)/tview.o $(OBJDIR)/tvintl.o $(OBJDIR)/tvtext1.o\
+ $(OBJDIR)/tvtext2.o $(OBJDIR)/twindow.o $(OBJDIR)/unixdis.o $(OBJDIR)/unixkey.o $(OBJDIR)/unixmouse.o $(OBJDIR)/unixscr.o \
+ $(OBJDIR)/win32clip.o $(OBJDIR)/win32dis.o $(OBJDIR)/win32key.o\
+ $(OBJDIR)/win32mouse.o $(OBJDIR)/win32scr.o $(OBJDIR)/wingrdis.o $(OBJDIR)/wingrkey.o $(OBJDIR)/wingrmouse.o $(OBJDIR)/wingrscr.o\
+ $(OBJDIR)/winntdis.o $(OBJDIR)/winntkey.o $(OBJDIR)/winntmouse.o $(OBJDIR)/winntscr.o $(OBJDIR)/x11dis.o $(OBJDIR)/x11key.o\
+ $(OBJDIR)/x11mouse.o $(OBJDIR)/x11src.o $(OBJDIR)/xtermdis.o $(OBJDIR)/xtermkey.o $(OBJDIR)/xtermmouse.o $(OBJDIR)/xtermscr.o
+
+tvex: libtv.lib
+ $(CXX) $(CXXFLAGS) /Tptvex.cc -link libtv.lib user32.lib gdi32.lib
+
+{$(SRC1)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC2)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC3)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC4)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC5)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC6)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC7)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC8)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC9)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCA)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCB)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCC)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCD)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCE)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC2)}.c{$(OBJDIR)}.o:
+ $(CC) $(CFLAGS) -c $? -Fo$*.o
+
+all:: libtv.lib
+
+libtv.lib : $(OBJS)
+ -del libtv.lib
+ lib @<<
+/OUT:libtv.lib
+$(OBJS)
+<<
+
+clean:
+ del -f $(OBJS)
+ del -f $(TUTORIAL)
+
diff --git a/tvision/winnt/bccmake.in b/tvision/winnt/bccmake.in
new file mode 100644
index 0000000..5035b44
--- /dev/null
+++ b/tvision/winnt/bccmake.in
@@ -0,0 +1,119 @@
+# Makefile for building Turbo Vision library for Win32
+
+@DYNRTL@
+
+# Borland C++
+CC = bcc32
+LD = bcc32
+CXX = $(CC)
+INC = -I.\include -I..\include
+
+!ifdef DEBUG
+CDEBUGFLAGS = -v -vi -y -6 -Od
+!else
+CDEBUGFLAGS = -O2 -6 -T -DNDEBUG
+!endif
+
+!ifdef DYNRTL
+DYNRTLDFLAGS = -WR
+!endif
+
+# SET: I disabled the condition always true warning. BC++ should be more
+# cleaver about it, code like this: if (1) ... isn't wrong and is
+# obviously on purpose. GCC reports it for things like
+# if ((unsigned)a<0) which is always false and looks like an error ;-)
+# Note: SAA disabled Asigned a value that is never used because BC++ is very
+# annoying about assigning a default value for a variable that is
+# assigned latter.
+CFLAGS = -D_BCPP -w-aus -w-ccc -a8 $(DYNRTLDFLAGS) -WC -X -q $(CDEBUGFLAGS)
+# SET: I disabled the member x hides virtual member y because I don't
+# understand why it is reported if you know please explain me.
+CXXFLAGS = -P -RT- -w-hid $(CFLAGS)
+LDFLAGS = $(DYNRTLDFLAGS) -WC
+
+# Microsoft Visual C++
+# NOTE: does not work yet
+#CXX = cl
+#INC = -I.\include\msvc -I.\include -I..\include
+#CXXFLAGS = -c -TP -D_MSVC -MDd
+
+.SUFFIXES: .cc .c .obj
+
+TV_OBJS_ = @TV_OBJS_BCC@
+OBJS = $(TV_OBJS_:+=objs\)
+
+all: rhtv.lib tvex.exe
+
+rhtv.lib: $(OBJS)
+ del $@
+ tlib /E /P256 $@ @&&!
++$(**: = &^
++)
+!
+
+tvex.exe: objs\tvex.obj rhtv.lib
+ $(CC) $(LDFLAGS) -etvex.exe objs\tvex.obj rhtv.lib
+
+{.}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\dos}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\linux}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\qnxrtp}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\qnx4}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\unix}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\x11}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\win32}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\wingr}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\classes\winnt}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\names}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\stream}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+
+{..\compat}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+
+{..\compat}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+# objs\tscreen.obj: ..\classes\WinNT\tscreen.cc
+# objs\tdsiplay.obj: ..\classes\WinNT\tdsiplay.cc
+# objs\tfont.obj: ..\classes\WinNT\tfont.cc
+# objs\thwmouse.obj: ..\classes\WinNT\thwmouse.cc
+
+clean:
+ -del objs\*.obj
+ -del *.obj
+ -del *.exe
+ -del *.tds
+ -del *.lib
+
diff --git a/tvision/winnt/include/msvc/dir.h b/tvision/winnt/include/msvc/dir.h
new file mode 100644
index 0000000..6be63ed
--- /dev/null
+++ b/tvision/winnt/include/msvc/dir.h
@@ -0,0 +1,53 @@
+#ifndef __DIR_H
+#define __DIR_H
+
+#include <direct.h>
+
+#ifndef MAX_PATH
+#define MAX_PATH 260
+#endif
+#ifndef MAXPATH
+#define MAXPATH MAX_PATH
+#endif
+
+#ifndef FA_NORMAL
+#define FA_NORMAL 0x00 /* Normal file, no attributes */
+#define FA_RDONLY 0x01 /* Read only attribute */
+#define FA_HIDDEN 0x02 /* Hidden file */
+#define FA_SYSTEM 0x04 /* System file */
+#define FA_LABEL 0x08 /* Volume label */
+#define FA_DIREC 0x10 /* Directory */
+#define FA_ARCH 0x00 /* Archive */
+#endif /* FA_NORMAL */
+
+#ifndef _FFBLK_DEF
+#define _FFBLK_DEF
+struct ffblk {
+ long ff_reserved;
+ long ff_fsize;
+ unsigned long ff_attrib;
+ unsigned short ff_ftime;
+ unsigned short ff_fdate;
+ char ff_name[MAXPATH];
+};
+#endif
+
+#define getdisk() (_getdrive() + 1)
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int findfirst( const char *__path,
+ struct ffblk *__ffblk,
+ int __attrib );
+int findnext( struct ffblk *__ffblk );
+int findclose( struct ffblk *__ffblk );
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* __DIR_H */
diff --git a/tvision/winnt/include/msvc/dirent.h b/tvision/winnt/include/msvc/dirent.h
new file mode 100644
index 0000000..b5debca
--- /dev/null
+++ b/tvision/winnt/include/msvc/dirent.h
@@ -0,0 +1,42 @@
+/********************************************************************\
+*File : dirent.h
+*
+*Subject:
+* Substitution of Unix dirent.h for Win32
+*
+*Authors:
+* SAA Anatoli Soltan
+*
+*HISTORY:
+* Feb 18 1997 SAA
+* initial implementation; struct dirent has only
+* one field: d_name
+* Mar 15 2000 SAA added __cplusplus condition
+*********************************************************************/
+
+#ifndef __DIRENT_H
+#define __DIRENT_H
+
+#include <stdlib.h> /* _MAX_FNAME */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct dirent
+{
+ char d_name[_MAX_FNAME];
+};
+
+struct _DIR;
+typedef struct _DIR DIR;
+
+DIR* opendir(const char* name);
+struct dirent* readdir(DIR* dir);
+int closedir(DIR* dir);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __DIRENT_H */
diff --git a/tvision/winnt/include/msvc/strstream.h b/tvision/winnt/include/msvc/strstream.h
new file mode 100644
index 0000000..694c39a
--- /dev/null
+++ b/tvision/winnt/include/msvc/strstream.h
@@ -0,0 +1,6 @@
+#ifndef __STRSTREAM_H
+#define __STRSTREAM_H
+
+#include <strstrea.h>
+
+#endif /* __STRSTREAM_H */ \ No newline at end of file
diff --git a/tvision/winnt/include/tv/configtv.h b/tvision/winnt/include/tv/configtv.h
new file mode 100644
index 0000000..9d60de5
--- /dev/null
+++ b/tvision/winnt/include/tv/configtv.h
@@ -0,0 +1,23 @@
+/* Specially created for BC++ and MSVC */
+
+#if defined(_MSVC) || defined(__MSC_VER) || defined(_MSC_VER)
+ /* Microsoft C compiler */
+ #define TVComp_MSC
+ /* MSVC 4.0 and previous versions lacks too much functionality used by this
+ driver. So we just disable it. (v 1000) */
+ /* MSVC 6.0 also failed to compile it. So we are just disabling it until
+ somebody fixes the problems. (v 1200) */
+ #define TV_Disable_WinGr_Driver
+#elif defined(__WATCOMC__)
+ #define TVOSf_NT
+ #define TVComp_Watcom
+#else
+ /* Borland C++ compiler */
+ #define TVOSf_NT
+ #define TVComp_BCPP
+#endif
+
+#define TVOS_Win32
+#define TVCompf_
+#define TVCPU_x86
+
diff --git a/tvision/winnt/msvcmake.in b/tvision/winnt/msvcmake.in
new file mode 100644
index 0000000..35c831d
--- /dev/null
+++ b/tvision/winnt/msvcmake.in
@@ -0,0 +1,101 @@
+# Makefile for MS VC 5.0-6.0
+# Modified for use with MS NMAKE
+# Run: nmake -f Makefile.nmk all
+
+# Add here -IPATH_TO_MSVC_HEADERS (to both variables)
+# example: -ID:\MVS\VC98\Include
+CFLAGS=-O2 -I./include -I../include -D_WIN32 /GR- /GX-
+# The /EHsc options seems to be needed by .NET 2003 compiler.
+# I'm not sure if they interfere with older versions, please report about it.
+CXXFLAGS=-O2 -I./include -I../include -D_WIN32 /GR- /GX- /EHsc
+
+OBJDIR=obj_ms
+
+#clean default extension list
+.SUFFIXES:
+#append extensions to list
+.SUFFIXES: .cc .cpp .c
+
+SRC1 = ../
+SRC2 = ../compat
+SRC3 = ../names
+SRC4 = ../stream
+SRC5 = ../classes
+SRC6 = ../classes/dos
+SRC7 = ../classes/win32
+SRC8 = ../classes/winnt
+SRC9 = ../classes/linux
+SRCA = ../classes/qnxrtp
+SRCB = ../classes/unix
+SRCC = ../classes/x11
+SRCD = ../classes/wingr
+SRCE = ../classes/qnx4
+#SRC7 = ./examples/tutorial
+#SRC3 = ./
+
+CC=cl /nologo
+CXX=cl /nologo
+
+OBJS=@TV_OBJS_MSVC@
+
+tvex: libtv.lib
+ $(CXX) $(CXXFLAGS) /Tptvex.cc -link libtv.lib user32.lib gdi32.lib
+
+{$(SRC1)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC2)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC3)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC4)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC5)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC6)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC7)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC8)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC9)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCA)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCB)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCC)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCD)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRCE)}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) /Tp$? -Fo$*.o
+
+{$(SRC2)}.c{$(OBJDIR)}.o:
+ $(CC) $(CFLAGS) -c $? -Fo$*.o
+
+all:: libtv.lib
+
+libtv.lib : $(OBJS)
+ -del libtv.lib
+ lib @<<
+/OUT:libtv.lib
+$(OBJS)
+<<
+
+clean:
+ del -f $(OBJS)
+ del -f $(TUTORIAL)
+
diff --git a/tvision/winnt/obj_ms/delete.me b/tvision/winnt/obj_ms/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/tvision/winnt/obj_ms/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/tvision/winnt/objs/delete.me b/tvision/winnt/objs/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/tvision/winnt/objs/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/tvision/winnt/readme.txt b/tvision/winnt/readme.txt
new file mode 100644
index 0000000..c892df5
--- /dev/null
+++ b/tvision/winnt/readme.txt
@@ -0,0 +1,50 @@
+ This file contains information about how to build the Win32 version of the
+library. I tested it under Windows 95, 98 and NT 4 so I think it works for
+any of the Win32 family members (2000, XP, etc.).
+ I recently got positive reports using Windows 2000.
+
+ The Win32 version port was originally contributed by Anatoli Soltan, but
+currently three drivers are available. Please read more about it in the doc
+directory of the distribution.
+
+* What compilers are supported?
+
+ Borland C++ Builder 5 or the free command line tools available in the web
+(BC++ 5.5 compiler).
+ Cygwin, if you have it just follow the Linux/UNIX instructions, you just
+need to run the configure script and then run make.
+ MinGW, currently you can install the MSys package and some Perl interpreter
+(like SiePerl) and then follow the Linux/UNIX instruction. More about is can
+be found in the ../win32/readme.txt file.
+ MSVC (5.0/6.0/7.0/7.1) is also supported.
+
+* Why this target have special instructions and isn't explained in the main
+ readme file?
+
+ Because the configuration mechanism to compile the library uses tools that
+aren't common for BC++ and MSVC users.
+
+* How do I compile the library?
+
+ Borland: Run make from this directory. It uses the Makefile archive.
+ MSVC: Run nmake from this directory. It uses the Makefile.nmk archive. Note
+ that usually you must edit this file to indicate where are installed
+ the MSVC header files.
+
+* How do I compile the demo?
+
+ Is compiled by the makefile, the name is tvex.exe.
+
+* Some additional comments:
+
+ The library is slower than the DOS version or the Linux/VCSA version.
+That's because the Win32 console API isn't fast. It seems to run better under
+NT.
+
+* How can I reconfigure the makefile?
+
+ You need a Perl interpreter for it. The script confignt.pl located in the
+root directory of the distribution is used for it. Run "perl confignt.pl
+--help" to get help. Note that this is only available for the Boland
+makefile.
+
diff --git a/tvision/winnt/tvex.cc b/tvision/winnt/tvex.cc
new file mode 100644
index 0000000..32900c5
--- /dev/null
+++ b/tvision/winnt/tvex.cc
@@ -0,0 +1,52 @@
+/*****************************************************************************
+
+ Hi! here SET writing ;-)
+ That's a pretty silly example, but I include it more as a test. The real
+code for this example is inside the library and is called tvedit?.cc.
+Basically it defines a basic text editor applition. You can create your own
+text editor inheriting from TEditorApp and overriding the desired members.
+ Robert included it in the library in the past and I think is good idea
+because you can do an application based on TEditorApp in a few minutes.
+
+*****************************************************************************/
+
+#define Uses_TApplication
+#define Uses_TEditorApp
+#define Uses_fpstream
+#define Uses_stdio
+#include <tv.h>
+#include <tv/tvedit.h>
+
+int main()
+{
+ TEditorApp *myApp=new TEditorApp();
+
+#if defined (__BORLANDC__)
+ fprintf(stderr,"This test was compiled using BC++ %d.%d.%d\n",
+ (__BORLANDC__/0x100) & 0xF,
+ (__BORLANDC__/0x10) & 0xF,
+ __BORLANDC__ & 0xF);
+#elif defined (_MSC_VER)
+ fprintf(stderr,"This test was compiled using MSVC++ compiler v%d.%d\n",
+ (_MSC_VER/100) & 0xFF,
+ (_MSC_VER - ((_MSC_VER/100) & 0xFF)*100));
+#endif
+
+ if (myApp)
+ {
+ // It works if we are windowed and the screen is large enough:
+ // myApp->setScreenMode(90,30);
+ myApp->run();
+ delete myApp;
+ }
+
+ // This is a small test to check if streams are working
+ #ifdef TEST_STREAM
+ fpstream *f=new fpstream("Test.dat",CLY_IOSOut | CLY_IOSBin);
+ *f << 20;
+ f->close();
+ #endif
+
+ return 0;
+}
+
diff --git a/tvision/www-site/bvucs-n1.jpg b/tvision/www-site/bvucs-n1.jpg
new file mode 100644
index 0000000..9d33dc9
--- /dev/null
+++ b/tvision/www-site/bvucs-n1.jpg
Binary files differ
diff --git a/tvision/www-site/contrib.html b/tvision/www-site/contrib.html
new file mode 100644
index 0000000..3e79cbf
--- /dev/null
+++ b/tvision/www-site/contrib.html
@@ -0,0 +1,105 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<HTML>
+<HEAD>
+ <TITLE>Turbo Vision port to the GNU compiler - Contributors</TITLE>
+ <meta name="description" content="Turbo Vision port to the GNU compiler">
+ <meta name="keywords" content="Turbo Vision, TVision, tvision, rhtvision, turbo, vision, TUI, tui, linux, djgpp, library, download, rhide, setedit, SET">
+ <meta name="resource-type" content="document">
+ <meta name="distribution" content="global">
+ <meta name="Author" content="Salvador E. Tropea, set@users.sourceforge.net">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <link rel=stylesheet type="text/css" href="sf.css">
+</HEAD>
+<BODY>
+
+<p><div class=cent>
+<table class=cent>
+<tr>
+<td>
+ <div class=s4>Turbo Vision</div>
+ <div class=s3>port to the GNU compiler</div>
+</td>
+<td align=right>
+ <A class=invis href="http://sourceforge.net">
+ <IMG src="http://sourceforge.net/sflogo.php?group_id=49571"
+ width="88" height="31" alt="SourceForge Logo"></A>
+</td>
+</tr>
+</table>
+</div>
+
+<h2>Contributors</h2>
+
+<p>Excluding Robert and me the following people contributed valuable things to the project.
+If I omitted somebody please e-mail me! The list is sorted alphabetically.
+<p>
+<a href="mailto:alex@inti.gov.ar">Alex Lozano</a>: Solaris beta testing.
+<p>
+<a href="mailto:anatoli@iname.com">Anatoli Soltan</a>: BC++ and WinNT code.
+<p>
+<a href="mailto:nyxo@dnuc.polyn.kiae.su">Andrey `Onyx' Shevtsov</a> (miniEleph):
+A lot of help and testing for the FreeBSD port.
+<p>
+<a href="mailto:pavenis@lanet.lv">Andris Pavenis</a>: Many patches and help to support
+the last releases of gcc.
+<p>
+<a href="mailto:anamorphose@users.sourceforge.net">Dominique</a> (Anamorphose): RPM packages
+(v1.1.4) and newer Red Hat 7.2 packages.
+<p>
+<a href="mailto:ibaldo_at_adinet.com.uy">Iv&aacute;n Baldo</a>: Debian packager and beta tester.
+<p>
+<a href="mailto:jasanchez@polar.es">Jos&eacute; Angel Sanchez Caso</a> (JASC): Big endian
+solutions, the drivers concept implemented in TV 2.0 and the graphical Win32 driver.
+<p>
+<a href="mailto:lauras@softhome.net">Laurynas Biveinis</a>: A lot of patches collected from
+the net, MSS support, testing and ideas.
+<p>
+<a href="mailto:bbcat@netonecom.net">Michel Catudal</a>: RPM packages (v1.1.3) and newer
+SuSE 8.0 packages.
+<p>
+<a href="mailto:mike@malva.ua">Mike Gorchak</a>: QNX port.
+<p>
+<a href="mailto:smhs@mail.ru">Roman Valyushenko</a>: X11 bug reports and fixes, X11 busy
+cursor and russian translation of the messages.
+<p>
+<a href="mailto:ronald@landheer.com">Ronald Landheer</a>: Help with the Cygwin port.
+<p>
+<a href="mailto:ssigala@globalnet.it">Sergio Sigala</a>: He maintains a BSD port of TV
+from where I took some of the examples. I think Robert based his Linux code on it.
+<p>
+<a href="mailto:tappi@thack.org">Tapio Kelloniemi</a>: Information about how to make the
+library cooperate with Braille Terminals.
+<p>
+<a href="mailto:bvr@cc.pib.alex-ua.com">Vadim Beloborodov</a>: MinGW and Win32 code.
+<p>
+<a href="mailto:wintix@bk.ru">WintiX</a>: Miscrosoft C compiler help and test.
+<p>
+
+The following users also contributed with small patches, testing and bug reports:
+<p>
+Alex Matulich, Anders Blom, Arvin Baccay, Cesar Rabak, Christoph Bauer, Christopher Nelson,
+David Nock, David A. Capello, Dean Wakerley, Dim Zegebart, Dimitar Jekov, Egon Eckert,
+Jerzy Witkowski, Jo&euml;l Soete, Luis Pistoia, Matt Mueller, Nate Eldredge,
+Norberto Alfredo Bensa, Owen Rudge, Robert Varga, Sean Proctor, Sergey Krivulja,
+Tanes Sriviroolchai, Tatu Kilappa, Waldemar Schultz and Wojciech Warczakowski.
+<p>
+<!-- revision 2.86 -->
+
+<p><hr><p>
+<a name="mail"></a><h2>E-mail contact</h2>
+<p><img src="envelp.gif" width=14 height=15 alt=mail>You can contact me by e-mail <a href="mailto:set@users.sourceforge.net">set@users.sourceforge.net</a>
+<p>
+
+<div class=cent>
+<a href="http://validator.w3.org/check?uri=http://tvision.sourceforge.net/contrib.html;outline=1" class=invis>
+<img src="http://www.w3.org/Icons/valid-html401.gif" alt="Valid HTML 4.01!" height="31" width="88"></a>
+<a class=invis href="http://jigsaw.w3.org/css-validator/validator?uri=http://tvision.sourceforge.net/contrib.html">
+<img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height=31 width=88></a>
+<a class=invis href="http://www.anybrowser.org/campaign/">
+<img src="bvucs-n1.jpg" alt="Any browser!" height=30 width=100></a>
+</div>
+
+<p><hr><p>
+<div class=sm1>Last update: mar may 28 11:23:10 ART 2002</div>
+</BODY></HTML> \ No newline at end of file
diff --git a/tvision/www-site/envelp.gif b/tvision/www-site/envelp.gif
new file mode 100644
index 0000000..fba0301
--- /dev/null
+++ b/tvision/www-site/envelp.gif
Binary files differ
diff --git a/tvision/www-site/history.html b/tvision/www-site/history.html
new file mode 100644
index 0000000..7dc8c36
--- /dev/null
+++ b/tvision/www-site/history.html
@@ -0,0 +1,198 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<HTML>
+<HEAD>
+ <TITLE>Turbo Vision port to the GNU compiler and more - History</TITLE>
+ <meta name="description" content="Turbo Vision port to the GNU compiler and more">
+ <meta name="keywords" content="Turbo Vision, TVision, tvision, rhtvision, turbo, vision, TUI, tui, linux, djgpp, library, download, rhide, setedit, SET">
+ <meta name="resource-type" content="document">
+ <meta name="distribution" content="global">
+ <meta name="Author" content="Salvador E. Tropea, set@users.sourceforge.net">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <link rel=stylesheet type="text/css" href="sf.css">
+</HEAD>
+<BODY>
+
+<p><div class=cent>
+<table class=cent>
+<tr>
+<td>
+ <div class=s4>Turbo Vision</div>
+ <div class=s3>port to the GNU compiler and more</div>
+</td>
+<td align=right>
+ <A class=invis href="http://sourceforge.net">
+ <IMG src="http://sourceforge.net/sflogo.php?group_id=49571"
+ width="88" height="31" alt="SourceForge Logo"></A>
+</td>
+</tr>
+</table>
+</div>
+
+<h2>Release History</h2>
+
+<p><b>Important!</b> These are only the most relevant things, for a detailed
+list of fixes/additions look in the change.log file.<p>
+
+<B>Release 2.0.2</B><BR>
+Added support for Linux UTF-8 consoles (like default Red Hat 8.0 and 9.0).<br>
+Added a class to abstract i18n support.<br>
+Added support for BC++ 5.6 (Builder 6) and MSVC 7.0.<br>
+<p>
+<B>Release 2.0.1</B><BR>
+Added russian translation.<br>
+Added installation for the translations (spanish and russian).<br>
+Added X11 cyrillics example.<br>
+Added support for greek and russian keyboards to X11 driver.<br>
+Fixed bugs in Linux and WinGr drivers.<br>
+<p>
+<B>Release 2.0.0</B><BR>
+Added pseudo drivers mechanism.<BR>
+Added X11 native support.<BR>
+Added better Linux console support.<BR>
+Added bettet XTerm/Eterm support (100% new driver).<BR>
+Added better support for FreeBSD.<BR>
+Added QNX support.<BR>
+Added configuration file support.<BR>
+Added code pages support.<BR>
+Added fonts support.<BR>
+Added MSVC support.<BR>
+Added better support for new MinGW and Cygwin releases.<BR>
+<p>
+<B>Release 1.1.4</B><BR>
+Added support for RHIDE 1.4.9 and MSS 1.2.1.<BR>
+Fixed compatlayer issues when including it more than once.<BR>
+Added a mechanism to easily enable/disable international support without recompiling.<BR>
+Fixed 100% CPU usage in the BC++ 5.5 version.<BR>
+Fixed some Solaris problems.<BR>
+Fixed desklogo and listvi examples.<BR>
+<p>
+<b>Release 1.1.3</b><br>
+Added gcc 3.1 support.<br>
+Fixed TRangeValidator.<br>
+<p>
+<b>Release 1.1.2</b><br>
+Added gcc 3.0 support.<br>
+Added support for CygWin (Win32).<br>
+DOS: Keyboard using BIOS by default.<br>
+Fixed problems to compile examples.<br>
+Fixed keypad under X.<br>
+Fixed endianess details, now the demo works for Power PC and SPARC (Linux).<br>
+Fixed compile problems in FreeBSD and Linux/Alpha.<br>
+<p>
+<b>Release 1.1.1</b><br>
+Fixed cursor updated jumping when desktop locked.<br>
+Fixed TSortedCollection incremental search issues.<br>
+Added option to configure TFileCollection.<br>
+Added new color for disabled TCluster objects.<br>
+Fixed endianess problems in the TView draw member.<br>
+Added better support for Linux terminals, including ISO-8859-1 accents support.<br>
+Added a dummy internationalization library.<br>
+Fixed compiling issues in Linux.<br>
+Added a dialog editor program.<br>
+<p>
+<b>Release 1.1.0</b><br>
+Added BC++ 5.5 support (Win32).<br>
+Added MinGW support (Win32).<br>
+Added a `library' called compat layer to abstract the OS/compiler dependent things.<br>
+Fixed some details to make the library compilable with FreeBSD and other UNIXes.<br>
+Moved headers to a subdirectory (tv/*.h).<br>
+Added TButton callback.<br>
+Added 32 bits TRadioButtons and TCheckBoxes.<br>
+Added Add and Done buttons to the FileOpenDialog.<br>
+Fixed TStatusItem now uses copies of the strings passed.<br>
+<p>
+<b>Release 1.0.10</b><br>
+Disable ^Q, ^S, ^C, ^/ and ^Z when using terminals.<br>
+TFileDialog is now "growable".<br>
+Now the initialization of the TScreen is called from TProgInit.<br>
+<p>
+<b>Release 1.0.9</b><br>
+Added configure/make/make install mechanism.<br>
+Added support for DOS greek keyboards.<br>
+Fixed wrong broadcast in TListView.<br>
+Fixed compilation problems with gcc 2.95 under DOS.<br>
+Fixed bug in the TFileList vertical scroll bar.<br>
+<p>
+<b>Release 1.0.8</b><br>
+Around 28 bugfixes collected from the net by Laurynas Biveinis.<br>
+Added some new broadcasts to make more clean some process that were ugly.<br>
+Added low level (register level) save/restore VGA mode for DOS, it
+workarounds bugs in some broken BIOSes.<br>
+Added TFileCollection sorting options.<br>
+Added TDesktop now can also tile windows partitioning first vertically.<br>
+Now the library releases the CPU by default.<br>
+<p>
+<b>Release 1.0.7</b><br>
+Added Eterm 0.8.10 support (excellent keyboard under X!).<br>
+Added a couple of new members to TCommandSet to re/set ranges of commands.<br>
+Added example to avoid 100% CPU usage.<br>
+Added the calculator to the library.<br>
+Ported TChdirDialog to Linux version.<br>
+Modifications in the TFileDialog scroll bars, other small changes to this class (no double dir read, no .. in DOS' root, etc.).<br>
+Fixed warnings in examples when using egcs.<br>
+Fixed bug in TFileInfoPane.<br>
+Fixed now ^Z is disabled.<br>
+Fixed many calls to delete without [] and passing void pointers.<br>
+<p>
+<b>Release 1.0.6</b><br>
+Added much better support for xterm, including mouse and window resize.<br>
+Added mouse support for NT.<br>
+Added a function to recycle the doEditDialog.<br>
+Added some support for Alpha/Linux (experimental).<br>
+Added support for readonly /dev/vcsa devices.<br>
+Added some nice things in TMenuBar and TStatusLine (resize and 1 space around).<br>
+Ported TParamText.<br>
+Reduced the ESC delay.<br>
+Fixed bugs in TEditor and TSortedListBox.<br>
+Fixed leak in TResourceFile.<br>
+<p>
+<b>Release 1.0.5</b><br>
+Added files to generate a .deb package.<br>
+Fixed memory leaks and modified to release all the allocated memory when
+exiting. I debugged my editor with YAMD and it was needed to detect leaks in
+the editor.<br>
+Added support for VESA modes from TDisplay::setCrtMode.<br>
+Changed the name of the library to avoid potential collisions with the
+Sigala's port. No body reported problems but I'm thinking about making the
+library part of the main Debian distribution.<br>
+<p>
+<b>Release 1.0.4</b><br>
+Added TEditor, TFileEditor, TEditorWindow and TMemo classes. They were lost
+when we incorporated my TCEditor class to RHIDE.<br>
+Fixed problems with VESA modes in S3 boards.<br>
+Added support for ACS_xxxx ncurses macros. It makes the program look much
+better when using xterm.<br>
+<p>
+<b>Release 1.0.3</b><br>
+Dynamic version for Linux.<br>
+Fixed some problems in the make process.<br>
+<p>
+<b>Release 1.0.2</b><br>
+Fixes for the keyboard mappings used in Red Hat 5.2.<br>
+Added nine examples, a 16 steps tutorial and a demo program.<br>
+<p>
+<b>Release 1.0.1</b><br>
+First public standalone release.<br>
+<p>
+<b>Release 1.0.0</b><br>
+First release, not public. Only sent to Robert.<br>
+<p>
+
+<p><hr><p>
+<a name="mail"></a><h2>E-mail contact</h2>
+<p><img src="envelp.gif" width=14 height=15 alt=mail>You can contact me by e-mail <a href="mailto:set@users.sourceforge.net">set@users.sourceforge.net</a>
+<p>
+
+<div class=cent>
+<a href="http://validator.w3.org/check?uri=http://tvision.sourceforge.net/history.html;outline=1" class=invis>
+<img src="http://www.w3.org/Icons/valid-html401.gif" alt="Valid HTML 4.01!" height="31" width="88"></a>
+<a class=invis href="http://jigsaw.w3.org/css-validator/validator?uri=http://tvision.sourceforge.net/history.html">
+<img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height=31 width=88></a>
+<a class=invis href="http://www.anybrowser.org/campaign/">
+<img src="bvucs-n1.jpg" alt="Any browser!" height=30 width=100></a>
+</div>
+
+<p><hr><p>
+<div class=sm1>Last update: mar may 28 11:23:10 ART 2002</div>
+</BODY></HTML> \ No newline at end of file
diff --git a/tvision/www-site/index.html b/tvision/www-site/index.html
new file mode 100644
index 0000000..3c3ce47
--- /dev/null
+++ b/tvision/www-site/index.html
@@ -0,0 +1,320 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<HTML>
+<HEAD>
+ <TITLE>Turbo Vision port to the GNU compiler and more</TITLE>
+ <meta name="description" content="Turbo Vision port to the GNU compiler and more">
+ <meta name="keywords" content="Turbo Vision, TVision, tvision, rhtvision, turbo, vision, TUI, tui, linux, djgpp, library, download, rhide, setedit, SET">
+ <meta name="resource-type" content="document">
+ <meta name="distribution" content="global">
+ <meta name="Author" content="Salvador E. Tropea, set at host users.sourceforge.net">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <link rel=stylesheet type="text/css" href="sf.css">
+</HEAD>
+<BODY>
+
+<p><div class=cent>
+<table class=cent>
+<tr>
+<td>
+ <div class=s4>Turbo Vision</div>
+ <div class=s3>port to the GNU compiler and more</div>
+</td>
+<td align=right>
+ <a class=invis href="http://sourceforge.net/projects/tvision">
+ <img src="http://sflogo.sourceforge.net/sflogo.php?group_id=49571&amp;type=11"
+ width="120" height="30"
+ alt="Get Turbo Vision at SourceForge.net. Fast, secure and Free Open Source software downloads">
+ </a>
+</td>
+</tr>
+</table>
+</div>
+
+<p>
+<ul>
+ <li> <a href="#intro">Introduction and information</a>.
+ <ul>
+ <li> <a href="#wtv">What's Turbo Vision?</a>
+ <li> <a href="#wctv">Who created TVision?</a>
+ <li> <a href="#wpl">What platforms are supported?</a>
+ <li> <a href="#wcp">What about copyrights?</a>
+ <li> <a href="#doc">Documentation</a>
+ </ul>
+</ul>
+<ul>
+ <li> <A href="http://sourceforge.net/projects/tvision/">Project summary on Source Forge (statistics, cvs, downloads, mailing list, etc.)</A>.
+</ul>
+<ul>
+ <li> <a href="#down">Download</a>.
+ <ul>
+ <li> <a href="#ddjgpp">DJGPP, BC++ and MinGW</a>
+ <li> <a href="#dlinux">Linux, FreeBSD, Solaris, Cygwin, etc.</a>
+ <li> <a href="#snapSF">Last CVS snapshot</a>
+ </ul>
+</ul>
+<ul>
+ <li> <a href="history.html">Small release history</a>.
+ <li> <a href="contrib.html">Contributors</a>.
+ <li> <a href="#mail">E-mail contact</a>.
+</ul>
+
+<p><hr><p>
+<b>Version 2.0.3 release candidate 1 is available.</b>
+<b>Mike and Frank are working on the QNX 4 port, here is an snapshot of TV
+running on pterm (qnx terminal emulator) with TV running in it under
+Photon 1.14</b>
+<a href="tvQNX-pterm-photon.jpg">tvQNX-pterm-photon.jpg (134 KB)</a><p>
+<b>Snapshot of the r2_0_1u CVS branch using Unicode:</b>
+<a href="snapUni.jpg">snapUni.jpg (344 KB)</a><p>
+<b>Another snapshot this time including some japanese text:</b>
+<a href="snapUniJA.png">snapUniJA.png (22 KB)</a><p>
+<b>And another showing the experimental TInputLine:</b>
+<a href="snapUniInp.png">snapUniInp.png (9.1 KB)</a><p>
+
+<p><hr><p>
+<a name="intro"></a><h2>Introduction and information</h2><p>
+<a name="wtv"></a><h3>What's Turbo Vision?</h3>
+<p>Turbo Vision (TVision for short) is a TUI (Text User Interface) that
+implements the well known CUA widgets. With TVision you can create an
+<i>intuitive</i> text mode application, intuitive means it will have CUA like
+interface (check boxes, radio buttons, push buttons, input lines, pull-down
+menues, status bars, etc.). All the people acustomed to the Windows, MacOS,
+OS/2, Motif, GTK, etc. interfaces will understand the interface at first
+sight.
+<p>
+
+<a name="wctv"></a><h3>Who created TVision?</h3>
+<p>TVision was developed by Borland (now Imprise) in 1992 (v1.03) as a tool
+for your TurboC and TurboPascal compilers. Around 1997 the masive use of the
+Window GUI make the product relative obsolete for commercialization and
+Borland put the sources in your ftp site, only the C++ version was released.
+Later they even authorized to the FPC group to use the Pascal sources.<br>
+Robert H&ouml;hne ported it to the <a href="http://www.delorie.com">djgpp</a>
+toolkit to develope an IDE (Integrated Development Environment) similar to
+the Borland's BC++ 3.1 but for djgpp. DJGPP is based on the GNU compiler gcc.<br>
+I contributed some classes (the editor and help system) to the RHIDE project
+and made some modifications to the TVision sources.
+<p>
+
+<a name="wpl"></a><h3>What platforms are supported?</h3>
+<p>This port is a port of the C++ version for the DOS, FreeBSD, Linux, QNX, Solaris and
+Win32 platforms. The port isn't 100% compatible with the original version from Borland
+because we want a library better than the original and not with the limititations
+imposed by the original 16 bits version and the huge security holes that are
+unacceptable.<br>
+For Win32 you can use BC++ 5.5, Cygwin, MinGW or MSVC.<br>
+<a href="mailto:ssigala at host globalnet.it">Sergio Sigala</a> made a port to Linux and
+FreeBSD with "100% of compatibility with the old version" as goal. The v0.8
+of this port can be found in <a href="ftp://sunsite.unc.edu/pub/Linux/devel/lang/c++/tvision-0.8.tar.gz">Sunsite</a>.<br>
+<a href="tv2-QNX-tvscreen.jpg">Screenshot</a> of Turbo Vision running on QNX (+Photon). It was
+taked by Mike Gorchak who is working on the QNX port.<br>
+In the <a href="http://setedit.sourceforge.net">SETEdit</a> site you'll find screenshots of
+a Turbo Vision application running as a native X application. They are from Linux and
+Solaris.<br>
+<p>
+
+<a name="wcp"></a><h3>What about copyrights?</h3>
+<p>The original code is copyrighted by Borland but is freely available from
+the net. Try <a href="ftp://ftp.borland.com/pub/borlandcpp/devsupport/archive/turbovision/tv.zip">here</a>.<br>
+This port is distributed under the GPL license and the Sigala's port under
+a BSD like license.<br>
+According to a FAQ entry in the Borland's site (was in http://www.inprise.com/devsupport/bcppbuilder/faq/QNA906.html
+when I saw it) the code is public domain. I also asked in the Borland's
+newsgroup and the TeamB people (not official people but they are who give
+technical support in the net) said me the FAQ was right.
+<p>
+
+<a name="doc"></a><h3>Documentation</h3>
+<p>Borland never released the docs so I don't know if I can distribute the original
+documentation.<br>
+Sergio Sigala has some
+<a href="http://www.sigala.it/sergio/tvision/">documentation</a> in
+his port.<br>
+Additionally you'll find a <i>doc</i> directory in the sources containing documentation
+about most of the new classes.
+<p>
+
+
+<p><hr><p>
+<a name="down"></a><h2>Download</h2>
+
+<p>
+<a name="ddjgpp"></a><h3>DJGPP, BC++ and MinGW TVision</h3>
+
+<p><b>Important!</b> I'm not providing pre-compiled versions because that's
+usually a source of problems. Libraries compiled with one version of the
+compiler fails to link with others, etc. If you think I should provide
+binaries and have a really good reason just tell me.<p>
+
+<p>The 2.0.3 release can be downloaded from here:
+<p>Sources distribution: <a href="http://prdownloads.sourceforge.net/tvision/tv203s.zip">tv203s.zip</a> (Source Forge network)<br>
+
+<p>The 2.0.2 release can be downloaded from here:
+<p>Sources distribution: <a href="http://prdownloads.sourceforge.net/tvision/tv202s.zip">tv202s.zip</a> (Source Forge network)<br>
+<!-- or in the Simtelnet network: <a href="http://www.simtel.net/pub/djgpp/v2tk/">http://www.simtel.net/pub/djgpp/v2tk/</a> -->
+<p>BC++ and "pure DOS" (not emulated by Windows) users please try the following fix: <a href="http://prdownloads.sourceforge.net/tvision/tv202-1s.zip">tv202-1s.zip</a> (Source Forge network)<br>
+<p>
+
+<a name="dlinux"></a><h3>Linux, FreeBSD, Solaris, Cygwin, etc. TVision</h3>
+
+<p>The 2.0.3 release can be downloaded from here</p>
+<p>
+Sources distribution: 1.02 Mb <a href="http://prdownloads.sourceforge.net/tvision/rhtvision-2.0.3.src.tar.gz">rhtvision-2.0.3.src.tar.gz</a><br>
+
+<p>The 2.1.0 CVS20070425 pre-release can be downloaded from here</p>
+<p>
+Sources distribution: 1.1 Mb <a href="http://prdownloads.sourceforge.net/tvision/rhtvision-2.1.0-3.src.tar.gz">rhtvision-2.1.0-3.src.tar.gz</a><br>
+
+<p>The 2.0.2 release can be downloaded from here</p>
+<p>
+Sources distribution: 1 Mb <a href="http://prdownloads.sourceforge.net/tvision/rhtvision-2.0.2.src.tar.gz">rhtvision-2.0.2.src.tar.gz</a><br>
+
+<!-- Linux Software Map entry: <a href="rhtvision.txt">rhtvision.txt</a><br> -->
+<p>
+<b>For RPMs, DEBs and work-in-progress versions</b> visit the Source Forge summary site:
+<A href="http://sourceforge.net/projects/tvision/">
+http://sourceforge.net/projects/tvision/
+</a>
+<br>
+Here are some packages:<p>
+
+<p>Debian GNU/Linux</p>
+<ul>
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0_2.1.0-3etch_i386.deb">2.1.0 CVS20070425 for Etch 4.0 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0-dev_2.1.0-3etch_i386.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0_2.1.0-2_amd64.deb">2.1.0 CVS20070425 for Etch 4.0 (AMD64)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0-dev_2.1.0-2_amd64.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0_2.1.0-3etch_sparc.deb">2.1.0 CVS20070425 for Etch 4.0 (SPARC)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0-dev_2.1.0-3etch_sparc.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0_2.1.0-1_i386.deb">2.1.0 CVS20050823 for Sarge 3.1 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0-dev_2.1.0-1_i386.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.4_2.0.4-1_sparc.deb">2.0.4 CVS20050721 for Sarge 3.1 (SPARC)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.4-dev_2.0.4-1_sparc.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3_2.0.3-3_i386.deb">2.0.3 for Woody 3.0 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3-dev_2.0.3-3_i386.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3_2.0.3-2_alpha.deb">2.0.3 CVS20041008 for Woody 3.0 (Alpha)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3-dev_2.0.3-2_alpha.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3_2.0.2-1_powerpc.deb">2.0.3 CVS20040604 for Woody 3.0 (PowerPC)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3-dev_2.0.2-1_powerpc.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3_2.0.3-1_sparc.deb">2.0.3 CVS20040331 for Woody 3.0 (SPARC)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3-dev_2.0.3-1_sparc.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.2_2.0.2-1_i386.deb">2.0.2 for Woody 3.0 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.2-dev_2.0.2-1_i386.deb">Development</a><br>
+
+<li><a href="http://setedit.sf.net/debian/dists/woody/main/binary-i386/rhtvision2.0.1_2.0.1-1_i386.deb">2.0.1 for Woody 3.0 (i386)</a> -
+<a href="http://setedit.sf.net/debian/dists/woody/main/binary-i386/rhtvision2.0.1-dev_2.0.1-1_i386.deb">Development</a><br>
+
+<li><a href="http://setedit.sf.net/debian/dists/potato/main/binary-i386/rhtvision2.0.1_2.0.1-1_i386.deb">2.0.1 for Potato 2.2 (i386)</a> -
+<a href="http://setedit.sf.net/debian/dists/potato/main/binary-i386/rhtvision2.0.1-dev_2.0.1-1_i386.deb">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/setedit/rhtvision1.1.4_1.1.4-0.1_alpha.deb">1.1.4 for Potato 2.2 (Alpha)</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/setedit/rhtvision1.1.4_1.1.4-0.1_powerpc.deb">1.1.4 for Potato 2.2 (PowerPC)</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/setedit/rhtvision1.1.4_1.1.4-0.1_sparc.deb">1.1.4 for Potato 2.2 (SPARC)</a><br>
+</ul>
+
+<p>Fedora</p>
+<ul>
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-6.bbcat.fc3.i586.rpm">2.0.3 for Fedora Core 3 (i586)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-6.bbcat.fc3.src.rpm">Source</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.3-6.bbcat.fc3.i586.rpm">Development</a>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-1.fc2.bbcat.i686.rpm">2.0.3 CVS 20040113 Fedora Core 2 (i686)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-1.fc2.bbcat.src.rpm">Source</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.3-1.fc2.bbcat.i686.rpm">Development</a>
+</ul>
+
+<p>Red Hat</p>
+<ul>
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-3rh9.i386.rpm">2.0.3 CVS 20041006 for Red Hat 9.0 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-debuginfo-2.0.3-3rh9.i386.rpm">Debug</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.3-3rh9.i386.rpm">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-3rh8.i386.rpm">2.0.3 CVS 20041005 for Red Hat 8.0 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.3-3rh8.i386.rpm">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.1-3rh8.i386.rpm">2.0.1 for Red Hat 8.0 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.1-3rh8.i386.rpm">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.2-3rh73.i386.rpm">2.0.2 for Red Hat 7.3 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.2-3rh73.i386.rpm">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.1-3.i386.rpm">2.0.1 for Red Hat 7.3 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.1-3.i386.rpm">Development</a><br>
+</ul>
+
+<p>SuSE</p>
+<ul>
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-2.SuSE9.1.bbcat.i586.rpm">2.0.3 CVS 20040113 SuSE 9.1 (i586)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-2.SuSE9.1.bbcat.src.rpm">Source</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.3-2.SuSE9.1.bbcat.i586.rpm">Development</a>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-1.i586.rpm">2.0.3 CVS20040125 for SuSE 9.0 (i586)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-1.src.rpm">Source</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.3-1.i586.rpm">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.2-3.i686.rpm">2.0.2 for SuSE 8.2 (i686)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.2-3.src.rpm">Source</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.2-3.i686.rpm">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.1-3.i686.rpm">2.0.1 for SuSE 8.1 (i686)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.1-3.src.rpm">Source</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.1-3.i686.rpm">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.1-1.i686.rpm">2.0.1 for SuSE 8.0 (i686)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.1-1.src.rpm">Source</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.1-1.i686.rpm">Development</a><br>
+</ul>
+
+<p>Mandrake</p>
+<ul>
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-3mk10.i586.rpm">2.0.3 CVS 20041005 for Mandrake 10.0 (i586)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.3-3mk10.i586.rpm">Development</a><br>
+
+<li><a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.2-3mk91.i386.rpm">2.0.2 for Mandrake 9.1 (i386)</a> -
+<a href="http://prdownloads.sourceforge.net/tvision/librhtv-devel-2.0.2-3mk91.i386.rpm">Development</a><br>
+</ul>
+
+<p>
+<b>Previous version (1.1.4)</b>: Needed for Setedit 0.4.54 and RHIDE 1.4.9.<br>
+Linux <a href="http://prdownloads.sourceforge.net/tvision/rhtvision-1.1.4.src.tar.gz">sources</a><br>
+DOS <a href="http://prdownloads.sourceforge.net/tvision/tv114s.zip">sources</a><p>
+
+<p>
+<b>Previous version (1.0.10)</b>: Needed for Setedit 0.4.41 and RHIDE 1.4.7.<br>
+Linux <a href="http://prdownloads.sourceforge.net/tvision/rhtvision-1.0.10.src.tar.gz">sources</a><br>
+DOS <a href="http://prdownloads.sourceforge.net/tvision/tv1010s.zip">sources</a><p>
+
+<p>
+<a name="snapSF"></a><h3>Last CVS snapshot</h3>
+<p>Each night a script creates a CVS snapshot tarball. You can download this snapshot
+ from the <a href="snap.html">snap</a> page.<p>
+
+<p><hr><p>
+<a name="mail"></a><h2>E-mail contact</h2>
+<p><img src="envelp.gif" width=14 height=15 alt=mail>You can contact me by e-mail <a href="mailto:set at host users.sourceforge.net">set[at host]users.sourceforge.net</a>
+<p>
+
+<div class=cent>
+<a href="http://validator.w3.org/check?uri=http://tvision.sourceforge.net/index.html;outline=1" class=invis>
+<img src="http://www.w3.org/Icons/valid-html401.gif" alt="Valid HTML 4.01!" height="31" width="88"></a>
+<a class=invis href="http://jigsaw.w3.org/css-validator/validator?uri=http://tvision.sourceforge.net/index.html">
+<img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height=31 width=88></a>
+<a class=invis href="http://www.anybrowser.org/campaign/">
+<img src="bvucs-n1.jpg" alt="Any browser!" height=30 width=100></a>
+</div>
+
+<p><hr><p>
+<div class=sm1>Last update: Wed Sep 25 17:41:00 ART 2004</div>
+</BODY></HTML>
diff --git a/tvision/www-site/sf.css b/tvision/www-site/sf.css
new file mode 100644
index 0000000..115f0d8
--- /dev/null
+++ b/tvision/www-site/sf.css
@@ -0,0 +1,18 @@
+BODY { background: #A0D0FF; color: black; text-decoration: none }
+A:link { background: #A0D0FF; color: #FF0000; text-decoration: none }
+A:visited { background: #A0D0FF; color: #202060; text-decoration: none }
+A:active { background: #A0D0FF; color: #FF0000; text-decoration: none }
+A.invis:link { background: #A0D0FF; color: #A0D0FF; text-decoration: none }
+A.invis:visited { background: #A0D0FF; color: #A0D0FF; text-decoration: none }
+A.invis:active { background: #A0D0FF; color: #A0D0FF; text-decoration: none }
+H1.cent { text-align: center }
+H2 { font-weight: bold; font-size: large }
+H3 { font-weight: bold; font-size: medium }
+B.nuevo { text-decoration: blink; font-weight: bold }
+DIV.cent { text-align: center }
+DIV.s4 { text-align: center; font-size: xx-large; font-weight: bold }
+DIV.s3 { text-align: center; font-size: large; font-weight: bold }
+DIV.sm1 { font-size: small }
+TD.com { color: black; background: #A0A0FF}
+table.cent { margin-left: auto; margin-right: auto; }
+
diff --git a/tvision/www-site/update b/tvision/www-site/update
new file mode 100755
index 0000000..fc0ed2c
--- /dev/null
+++ b/tvision/www-site/update
@@ -0,0 +1,2 @@
+#!/bin/sh
+scp *.html set,tvision@web.sourceforge.net:htdocs