Bladeren bron

* will be replaced by single source ide

peter 24 jaren geleden
bovenliggende
commit
2448d36c7f
100 gewijzigde bestanden met toevoegingen van 0 en 60747 verwijderingen
  1. 0 940
      ide/Makefile
  2. 0 45
      ide/Makefile.fpc
  3. 0 840
      ide/fake/Makefile
  4. 0 6
      ide/fake/Makefile.fpc
  5. 0 21
      ide/fake/README
  6. 0 916
      ide/fake/compiler/Makefile
  7. 0 9
      ide/fake/compiler/Makefile.fpc
  8. 0 536
      ide/fake/compiler/browcol.pas
  9. 0 263
      ide/fake/compiler/comphook.pas
  10. 0 60
      ide/fake/compiler/compiler.pas
  11. 0 189
      ide/fake/compiler/globtype.pas
  12. 0 1743
      ide/fake/compiler/systems.pas
  13. 0 567
      ide/fake/compiler/tokens.pas
  14. 0 81
      ide/fake/compiler/version.pas
  15. 0 918
      ide/fake/gdb/Makefile
  16. 0 14
      ide/fake/gdb/Makefile.fpc
  17. 0 216
      ide/fake/gdb/gdbcon.pas
  18. 0 342
      ide/fake/gdb/gdbint.pas
  19. 0 1136
      ide/text/Makefile
  20. 0 172
      ide/text/Makefile.fpc
  21. 0 14
      ide/text/README
  22. 0 88
      ide/text/TODO
  23. 0 960
      ide/text/compiler/Makefile
  24. 0 34
      ide/text/compiler/Makefile.fpc
  25. 0 28
      ide/text/compiler/compunit.pas
  26. 0 29
      ide/text/cvsco.tdf
  27. 0 25
      ide/text/cvsup.tdf
  28. 0 0
      ide/text/empty.inc
  29. 0 236
      ide/text/fixes.txt
  30. 0 20
      ide/text/fp.ans
  31. 0 496
      ide/text/fp.pas
  32. 0 528
      ide/text/fpcalc.pas
  33. 0 191
      ide/text/fpcatch.pas
  34. 0 300
      ide/text/fpcodcmp.pas
  35. 0 520
      ide/text/fpcodtmp.pas
  36. 0 1464
      ide/text/fpcompil.pas
  37. 0 672
      ide/text/fpconst.pas
  38. 0 3718
      ide/text/fpdebug.pas
  39. 0 950
      ide/text/fpdesk.pas
  40. 0 757
      ide/text/fphelp.pas
  41. 0 1508
      ide/text/fpide.pas
  42. 0 773
      ide/text/fpini.pas
  43. 0 288
      ide/text/fpintf.pas
  44. 0 180
      ide/text/fpmcomp.inc
  45. 0 200
      ide/text/fpmdebug.inc
  46. 0 35
      ide/text/fpmedit.inc
  47. 0 341
      ide/text/fpmfile.inc
  48. 0 338
      ide/text/fpmhelp.inc
  49. 0 1454
      ide/text/fpmopts.inc
  50. 0 477
      ide/text/fpmrun.inc
  51. 0 216
      ide/text/fpmsrch.inc
  52. 0 448
      ide/text/fpmtools.inc
  53. 0 365
      ide/text/fpmwnd.inc
  54. 0 844
      ide/text/fpredir.pas
  55. 0 1039
      ide/text/fpstre.inc
  56. 0 1047
      ide/text/fpstrh.inc
  57. 0 69
      ide/text/fpstring.pas
  58. 0 1294
      ide/text/fpswitch.pas
  59. 0 1833
      ide/text/fpsymbol.pas
  60. 0 351
      ide/text/fptemplt.pas
  61. 0 1672
      ide/text/fptools.pas
  62. 0 764
      ide/text/fpusrscr.pas
  63. 0 626
      ide/text/fputils.pas
  64. 0 294
      ide/text/fpvars.pas
  65. 0 3991
      ide/text/fpviews.pas
  66. 0 125
      ide/text/globdir.inc
  67. 0 33
      ide/text/gplprog.pt
  68. 0 43
      ide/text/gplunit.pt
  69. 0 59
      ide/text/grep.tdf
  70. 0 2
      ide/text/maketp.bat
  71. 0 737
      ide/text/pmode.pas
  72. 0 6
      ide/text/program.pt
  73. 0 109
      ide/text/readme.ide
  74. 0 11
      ide/text/readme.txt
  75. 0 67
      ide/text/realintr.inc
  76. 0 161
      ide/text/test.pas
  77. 0 9
      ide/text/test1.pas
  78. 0 32
      ide/text/test2.pas
  79. 0 88
      ide/text/tpgrep.tdf
  80. 0 15
      ide/text/unit.pt
  81. 0 101
      ide/text/utils/grep2msg.pas
  82. 0 208
      ide/text/utils/tphc.pas
  83. 0 296
      ide/text/vesa.pas
  84. 0 1044
      ide/text/wansi.pas
  85. 0 1858
      ide/text/wcedit.pas
  86. 0 41
      ide/text/wconsts.pas
  87. 0 119
      ide/text/wconstse.inc
  88. 0 119
      ide/text/wconstsh.inc
  89. 0 7087
      ide/text/weditor.pas
  90. 0 1457
      ide/text/whelp.pas
  91. 0 1449
      ide/text/whlpview.pas
  92. 0 735
      ide/text/whtml.pas
  93. 0 773
      ide/text/whtmlhlp.pas
  94. 0 554
      ide/text/whtmlscn.pas
  95. 0 257
      ide/text/winclip.pas
  96. 0 73
      ide/text/windebug.pas
  97. 0 572
      ide/text/wini.pas
  98. 0 529
      ide/text/wnghelp.pas
  99. 0 611
      ide/text/wos2help.pas
  100. 0 876
      ide/text/wresourc.pas

+ 0 - 940
ide/Makefile

@@ -1,940 +0,0 @@
-#
-# Don't edit, this file is generated by FPCMake Version 1.1 [2001/08/02]
-#
-default: all
-override PATH:=$(subst \,/,$(PATH))
-ifeq ($(findstring ;,$(PATH)),)
-inUnix=1
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-SEARCHPATH:=$(subst ;, ,$(PATH))
-endif
-PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
-ifeq ($(PWD),)
-PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
-ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=
-endif
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=.exe
-endif
-ifndef inUnix
-ifeq ($(OS),Windows_NT)
-inWinNT=1
-else
-ifdef OS2_SHELL
-inOS2=1
-endif
-endif
-else
-ifneq ($(findstring cygwin,$(MACHTYPE)),)
-inCygWin=1
-endif
-endif
-ifdef inUnix
-BATCHEXT=.sh
-else
-ifdef inOS2
-BATCHEXT=.cmd
-else
-BATCHEXT=.bat
-endif
-endif
-ifdef inUnix
-PATHSEP=/
-else
-PATHSEP:=$(subst /,\,/)
-endif
-ifdef PWD
-BASEDIR:=$(subst \,/,$(shell $(PWD)))
-ifdef inCygWin
-ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
-BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
-BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
-BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
-endif
-endif
-else
-BASEDIR=.
-endif
-ifndef FPC
-ifdef PP
-FPC=$(PP)
-else
-ifdef inUnix
-CPU_SOURCE=$(shell uname -m)
-ifeq (m68k,$(CPU_SOURCE))
-FPC=ppc68k
-else
-FPC=ppc386
-endif
-else
-FPC=ppc386
-endif
-endif
-endif
-override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
-endif
-ifndef OS_SOURCE
-OS_SOURCE:=$(shell $(FPC) -iSO)
-endif
-ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
-endif
-ifndef CPU_SOURCE
-CPU_SOURCE:=$(shell $(FPC) -iSP)
-endif
-ifndef FPC_VERSION
-FPC_VERSION:=$(shell $(FPC) -iV)
-endif
-export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=wrong
-endif
-else
-override FPCDIR=wrong
-endif
-ifeq ($(FPCDIR),wrong)
-override FPCDIR=..
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=wrong
-endif
-endif
-endif
-ifeq ($(FPCDIR),wrong)
-ifdef inUnix
-override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
-endif
-else
-override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=c:/pp
-endif
-endif
-endif
-endif
-UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
-PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
-override PACKAGE_NAME=ide
-override PACKAGE_VERSION=1.0.5
-override DEFAULT_DIR=text
-override TARGET_DIRS+=fake text
-override INSTALL_FPCPACKAGE=y
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO=
-else
-ECHO:=$(firstword $(ECHO))
-endif
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-ifndef DATE
-DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE=
-else
-DATE:=$(firstword $(DATE))
-endif
-else
-DATE:=$(firstword $(DATE))
-endif
-endif
-export DATE
-ifndef GINSTALL
-GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL=
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-endif
-export GINSTALL
-ifndef CPPROG
-CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(CPPROG),)
-CPPROG=
-else
-CPPROG:=$(firstword $(CPPROG))
-endif
-endif
-export CPPROG
-ifndef RMPROG
-RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(RMPROG),)
-RMPROG=
-else
-RMPROG:=$(firstword $(RMPROG))
-endif
-endif
-export RMPROG
-ifndef MVPROG
-MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(MVPROG),)
-MVPROG=
-else
-MVPROG:=$(firstword $(MVPROG))
-endif
-endif
-export MVPROG
-ifndef ECHOREDIR
-ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
-endif
-ifndef COPY
-COPY:=$(CPPROG) -fp
-endif
-ifndef COPYTREE
-COPYTREE:=$(CPPROG) -rfp
-endif
-ifndef MOVE
-MOVE:=$(MVPROG) -f
-endif
-ifndef DEL
-DEL:=$(RMPROG) -f
-endif
-ifndef DELTREE
-DELTREE:=$(RMPROG) -rf
-endif
-ifndef INSTALL
-ifdef inUnix
-INSTALL:=$(GINSTALL) -c -m 644
-else
-INSTALL:=$(COPY)
-endif
-endif
-ifndef INSTALLEXE
-ifdef inUnix
-INSTALLEXE:=$(GINSTALL) -c -m 755
-else
-INSTALLEXE:=$(COPY)
-endif
-endif
-ifndef MKDIR
-MKDIR:=$(GINSTALL) -m 755 -d
-endif
-export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
-ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(PPUMOVE),)
-PPUMOVE=
-else
-PPUMOVE:=$(firstword $(PPUMOVE))
-endif
-endif
-export PPUMOVE
-ifndef FPCMAKE
-FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(FPCMAKE),)
-FPCMAKE=
-else
-FPCMAKE:=$(firstword $(FPCMAKE))
-endif
-endif
-export FPCMAKE
-ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ZIPPROG),)
-ZIPPROG=
-else
-ZIPPROG:=$(firstword $(ZIPPROG))
-endif
-endif
-export ZIPPROG
-ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(TARPROG),)
-TARPROG=
-else
-TARPROG:=$(firstword $(TARPROG))
-endif
-endif
-export TARPROG
-ifndef AS
-AS=as
-endif
-ifndef LD
-LD=ld
-endif
-ifndef RC
-RC=rc
-endif
-PPAS=ppas$(BATCHEXT)
-ifdef inUnix
-LDCONFIG=ldconfig
-else
-LDCONFIG=
-endif
-ifdef DATE
-DATESTR:=$(shell $(DATE) +%Y%m%d)
-else
-DATESTR=
-endif
-ifndef UPXPROG
-ifeq ($(OS_TARGET),go32v2)
-UPXPROG:=1
-endif
-ifeq ($(OS_TARGET),win32)
-UPXPROG:=1
-endif
-ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(UPXPROG),)
-UPXPROG=
-else
-UPXPROG:=$(firstword $(UPXPROG))
-endif
-else
-UPXPROG=
-endif
-endif
-export UPXPROG
-ZIPOPT=-9
-ZIPEXT=.zip
-ifeq ($(USETAR),bz2)
-TAROPT=vI
-TAREXT=.tar.bz2
-else
-TAROPT=vz
-TAREXT=.tar.gz
-endif
-LOADEREXT=.as
-EXEEXT=.exe
-PPLEXT=.ppl
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.so
-STATICLIBPREFIX=libp
-RSTEXT=.rst
-FPCMADE=fpcmade
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-STATICLIBPREFIX=
-FPCMADE=fpcmade.v1
-PACKAGESUFFIX=v1
-endif
-ifeq ($(OS_TARGET),go32v2)
-STATICLIBPREFIX=
-FPCMADE=fpcmade.dos
-ZIPSUFFIX=go32
-endif
-ifeq ($(OS_TARGET),linux)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.lnx
-ZIPSUFFIX=linux
-endif
-ifeq ($(OS_TARGET),freebsd)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.freebsd
-ZIPSUFFIX=freebsd
-endif
-ifeq ($(OS_TARGET),win32)
-PPUEXT=.ppw
-OEXT=.ow
-ASMEXT=.sw
-SMARTEXT=.slw
-STATICLIBEXT=.aw
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.w32
-ZIPSUFFIX=w32
-endif
-ifeq ($(OS_TARGET),os2)
-PPUEXT=.ppo
-ASMEXT=.so2
-OEXT=.oo2
-AOUTEXT=.out
-SMARTEXT=.so
-STATICLIBEXT=.ao2
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.os2
-ZIPSUFFIX=emx
-endif
-ifeq ($(OS_TARGET),amiga)
-EXEEXT=
-PPUEXT=.ppa
-ASMEXT=.asm
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.library
-FPCMADE=fpcmade.amg
-endif
-ifeq ($(OS_TARGET),atari)
-PPUEXT=.ppt
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=.ttp
-FPCMADE=fpcmade.ata
-endif
-ifdef REQUIRE_UNITSDIR
-override UNITSDIR+=$(REQUIRE_UNITSDIR)
-endif
-ifdef REQUIRE_PACKAGESDIR
-override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
-endif
-ifdef ZIPINSTALL
-ifeq ($(OS_TARGET),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-UNIXINSTALLDIR=1
-endif
-else
-ifeq ($(OS_SOURCE),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_SOURCE),freebsd)
-UNIXINSTALLDIR=1
-endif
-endif
-ifndef INSTALL_PREFIX
-ifdef UNIXINSTALLDIR
-INSTALL_PREFIX=/usr/local
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=/pp
-else
-INSTALL_BASEDIR:=/$(PACKAGE_NAME)
-endif
-endif
-endif
-export INSTALL_PREFIX
-ifndef DIST_DESTDIR
-DIST_DESTDIR:=$(BASEDIR)
-endif
-export DIST_DESTDIR
-ifndef INSTALL_BASEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
-endif
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)
-endif
-endif
-ifndef INSTALL_BINDIR
-ifdef UNIXINSTALLDIR
-INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
-else
-INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
-endif
-endif
-endif
-ifndef INSTALL_UNITDIR
-INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
-ifdef INSTALL_FPCPACKAGE
-ifdef PACKAGE_NAME
-INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
-endif
-endif
-endif
-ifndef INSTALL_LIBDIR
-ifdef UNIXINSTALLDIR
-INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
-else
-INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
-endif
-endif
-ifndef INSTALL_SOURCEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source
-endif
-endif
-endif
-ifndef INSTALL_DOCDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
-endif
-endif
-endif
-ifndef INSTALL_EXAMPLEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
-endif
-endif
-endif
-ifndef INSTALL_DATADIR
-INSTALL_DATADIR=$(INSTALL_BASEDIR)
-endif
-override FPCOPTDEF=$(CPU_TARGET)
-ifneq ($(OS_TARGET),$(OS_SOURCE))
-override FPCOPT+=-T$(OS_TARGET)
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-ifdef LINKSMART
-override FPCOPT+=-XX
-endif
-ifdef CREATESMART
-override FPCOPT+=-CX
-endif
-ifdef DEBUG
-override FPCOPT+=-gl
-override FPCOPTDEF+=DEBUG
-endif
-ifdef RELEASE
-override FPCOPT+=-Xs -OG2p3 -n
-override FPCOPTDEF+=RELEASE
-endif
-ifdef STRIP
-override FPCOPT+=-Xs
-endif
-ifdef OPTIMIZE
-override FPCOPT+=-OG2p3
-endif
-ifdef VERBOSE
-override FPCOPT+=-vwni
-endif
-ifdef COMPILER_OPTIONS
-override FPCOPT+=$(COMPILER_OPTIONS)
-endif
-ifdef COMPILER_UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
-endif
-ifdef COMPILER_LIBRARYDIR
-override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
-endif
-ifdef COMPILER_OBJECTDIR
-override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
-endif
-ifdef COMPILER_INCLUDEDIR
-override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
-endif
-ifdef COMPILER_TARGETDIR
-override FPCOPT+=-FE$(COMPILER_TARGETDIR)
-ifeq ($(COMPILER_TARGETDIR),.)
-override TARGETDIRPREFIX=
-else
-override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-endif
-ifdef COMPILER_UNITTARGETDIR
-override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
-ifeq ($(COMPILER_UNITTARGETDIR),.)
-override UNITTARGETDIRPREFIX=
-else
-override UNITTARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-else
-ifdef COMPILER_TARGETDIR
-override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
-override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
-endif
-endif
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef FPCOPTDEF
-override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
-endif
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-ifdef USEENV
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
-endif
-override COMPILER:=$(FPC) $(FPCOPT)
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-ifeq ($(OS_SOURCE),$(OS_TARGET))
-EXECPPAS:=@$(PPAS)
-endif
-endif
-ifdef TARGET_RSTS
-override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
-override CLEANRSTFILES+=$(RSTFILES)
-endif
-.PHONY: fpc_distinstall
-fpc_distinstall: install exampleinstall
-.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
-ifndef PACKDIR
-ifndef inUnix
-PACKDIR=$(BASEDIR)/../fpc-pack
-else
-PACKDIR=/tmp/fpc-pack
-endif
-endif
-ifndef ZIPNAME
-ifdef DIST_ZIPNAME
-ZIPNAME=$(DIST_ZIPNAME)
-else
-ZIPNAME=$(ZIPPREFIX)$(PACKAGE_NAME)$(ZIPSUFFIX)
-endif
-endif
-ifndef ZIPTARGET
-ifdef DIST_ZIPTARGET
-ZIPTARGET=DIST_ZIPTARGET
-else
-ZIPTARGET=install
-endif
-endif
-ifndef USEZIP
-ifdef inUnix
-USETAR=1
-endif
-endif
-ifndef inUnix
-USEZIPWRAPPER=1
-endif
-ifdef USEZIPWRAPPER
-ZIPPATHSEP=$(PATHSEP)
-ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(BATCHEXT))
-else
-ZIPPATHSEP=/
-endif
-ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
-ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
-ifdef USETAR
-ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(TAREXT)
-ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
-else
-ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(ZIPEXT)
-ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
-endif
-fpc_zipinstall:
-	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
-	$(DEL) $(ZIPDESTFILE)
-ifdef USEZIPWRAPPER
-ifneq ($(ECHOREDIR),echo)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
-else
-	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
-	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
-	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
-endif
-ifdef inUnix
-	/bin/sh $(ZIPWRAPPER)
-else
-	$(ZIPWRAPPER)
-endif
-	$(DEL) $(ZIPWRAPPER)
-else
-	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
-endif
-	$(DELTREE) $(PACKDIR)
-fpc_zipsourceinstall:
-	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=src
-fpc_zipexampleinstall:
-ifdef HASEXAMPLES
-	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=exm
-endif
-fpc_zipdistinstall:
-	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
-.PHONY: fpc_clean fpc_cleanall fpc_distclean
-ifdef EXEFILES
-override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
-endif
-ifdef CLEAN_UNITS
-override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
-endif
-ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
-override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
-override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
-endif
-fpc_clean: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-ifdef CLEAN_FILES
-	-$(DEL) $(CLEAN_FILES)
-endif
-ifdef LIB_NAME
-	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
-endif
-	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-fpc_distclean: clean
-ifdef COMPILER_UNITTARGETDIR
-TARGETDIRCLEAN=fpc_clean
-endif
-fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-ifdef AOUTEXT
-	-$(DEL) *$(AOUTEXT)
-endif
-.PHONY: fpc_info
-fpc_info:
-	@$(ECHO)
-	@$(ECHO)  == Package info ==
-	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
-	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPC.......... $(FPC)
-	@$(ECHO)  FPC Version.. $(FPC_VERSION)
-	@$(ECHO)  Source CPU... $(CPU_SOURCE)
-	@$(ECHO)  Target CPU... $(CPU_TARGET)
-	@$(ECHO)  Source OS.... $(OS_SOURCE)
-	@$(ECHO)  Target OS.... $(OS_TARGET)
-	@$(ECHO)
-	@$(ECHO)  == Directory info ==
-	@$(ECHO)
-	@$(ECHO)  Basedir......... $(BASEDIR)
-	@$(ECHO)  FPCDir.......... $(FPCDIR)
-	@$(ECHO)  UnitsDir........ $(UNITSDIR)
-	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
-	@$(ECHO)
-	@$(ECHO)  GCC library..... $(GCCLIBDIR)
-	@$(ECHO)  Other library... $(OTHERLIBDIR)
-	@$(ECHO)
-	@$(ECHO)  == Tools info ==
-	@$(ECHO)
-	@$(ECHO)  Pwd....... $(PWD)
-	@$(ECHO)  Mv........ $(MVPROG)
-	@$(ECHO)  Cp........ $(CPPROG)
-	@$(ECHO)  Rm........ $(RMPROG)
-	@$(ECHO)  GInstall.. $(GINSTALL)
-	@$(ECHO)  Echo...... $(ECHO)
-	@$(ECHO)  Date...... $(DATE)
-	@$(ECHO)  FPCMake... $(FPCMAKE)
-	@$(ECHO)  PPUMove... $(PPUMOVE)
-	@$(ECHO)  Upx....... $(UPXPROG)
-	@$(ECHO)  Zip....... $(ZIPPROG)
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  Target Loaders...... $(TARGET_LOADERS)
-	@$(ECHO)  Target Units........ $(TARGET_UNITS)
-	@$(ECHO)  Target Programs..... $(TARGET_PROGRAMS)
-	@$(ECHO)  Target Dirs......... $(TARGET_DIRS)
-	@$(ECHO)  Target Examples..... $(TARGET_EXAMPLES)
-	@$(ECHO)  Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)
-	@$(ECHO)
-	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
-	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
-	@$(ECHO)
-	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
-	@$(ECHO)  Install Files....... $(INSTALL_FILES)
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-	@$(ECHO)  DateStr.............. $(DATESTR)
-	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
-	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
-	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
-	@$(ECHO)
-	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
-	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
-	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
-	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
-	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
-	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
-	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
-	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
-	@$(ECHO)
-	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
-	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
-	@$(ECHO)
-TARGET_DIRS_FAKE=1
-TARGET_DIRS_TEXT=1
-ifdef TARGET_DIRS_FAKE
-fake_all:
-	$(MAKE) -C fake all
-fake_debug:
-	$(MAKE) -C fake debug
-fake_smart:
-	$(MAKE) -C fake smart
-fake_examples:
-	$(MAKE) -C fake examples
-fake_shared:
-	$(MAKE) -C fake shared
-fake_install:
-	$(MAKE) -C fake install
-fake_sourceinstall:
-	$(MAKE) -C fake sourceinstall
-fake_exampleinstall:
-	$(MAKE) -C fake exampleinstall
-fake_distinstall:
-	$(MAKE) -C fake distinstall
-fake_zipinstall:
-	$(MAKE) -C fake zipinstall
-fake_zipsourceinstall:
-	$(MAKE) -C fake zipsourceinstall
-fake_zipexampleinstall:
-	$(MAKE) -C fake zipexampleinstall
-fake_zipdistinstall:
-	$(MAKE) -C fake zipdistinstall
-fake_clean:
-	$(MAKE) -C fake clean
-fake_distclean:
-	$(MAKE) -C fake distclean
-fake_cleanall:
-	$(MAKE) -C fake cleanall
-fake_info:
-	$(MAKE) -C fake info
-fake:
-	$(MAKE) -C fake all
-.PHONY: fake_all fake_debug fake_smart fake_examples fake_shared fake_install fake_sourceinstall fake_exampleinstall fake_distinstall fake_zipinstall fake_zipsourceinstall fake_zipexampleinstall fake_zipdistinstall fake_clean fake_distclean fake_cleanall fake_info fake
-endif
-ifdef TARGET_DIRS_TEXT
-text_all:
-	$(MAKE) -C text all
-text_debug:
-	$(MAKE) -C text debug
-text_smart:
-	$(MAKE) -C text smart
-text_examples:
-	$(MAKE) -C text examples
-text_shared:
-	$(MAKE) -C text shared
-text_install:
-	$(MAKE) -C text install
-text_sourceinstall:
-	$(MAKE) -C text sourceinstall
-text_exampleinstall:
-	$(MAKE) -C text exampleinstall
-text_distinstall:
-	$(MAKE) -C text distinstall
-text_zipinstall:
-	$(MAKE) -C text zipinstall
-text_zipsourceinstall:
-	$(MAKE) -C text zipsourceinstall
-text_zipexampleinstall:
-	$(MAKE) -C text zipexampleinstall
-text_zipdistinstall:
-	$(MAKE) -C text zipdistinstall
-text_clean:
-	$(MAKE) -C text clean
-text_distclean:
-	$(MAKE) -C text distclean
-text_cleanall:
-	$(MAKE) -C text cleanall
-text_info:
-	$(MAKE) -C text info
-text:
-	$(MAKE) -C text all
-.PHONY: text_all text_debug text_smart text_examples text_shared text_install text_sourceinstall text_exampleinstall text_distinstall text_zipinstall text_zipsourceinstall text_zipexampleinstall text_zipdistinstall text_clean text_distclean text_cleanall text_info text
-endif
-debug: $(addsuffix _debug,$(DEFAULT_DIR))
-smart: $(addsuffix _smart,$(DEFAULT_DIR))
-examples: $(addsuffix _examples,$(DEFAULT_DIR))
-shared: $(addsuffix _shared,$(DEFAULT_DIR))
-install: $(addsuffix _install,$(DEFAULT_DIR))
-sourceinstall: $(addsuffix _sourceinstall,$(DEFAULT_DIR))
-exampleinstall: $(addsuffix _exampleinstall,$(DEFAULT_DIR))
-distinstall: fpc_distinstall
-zipinstall: fpc_zipinstall $(addsuffix _zipinstall,$(DEFAULT_DIR))
-zipsourceinstall: fpc_zipsourceinstall $(addsuffix _zipsourceinstall,$(DEFAULT_DIR))
-zipexampleinstall: fpc_zipexampleinstall $(addsuffix _zipexampleinstall,$(DEFAULT_DIR))
-zipdistinstall: fpc_zipdistinstall $(addsuffix _zipdistinstall,$(DEFAULT_DIR))
-cleanall: $(addsuffix _cleanall,$(DEFAULT_DIR))
-info: fpc_info
-.PHONY: debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info
-ifneq ($(wildcard fpcmake.loc),)
-include fpcmake.loc
-endif
-.PHONY: gdb full fullgdb clean_compiler
-all:
-	$(MAKE) -C text all
-gdb:
-	$(MAKE) -C text gdb
-full:
-	$(MAKE) -C text full
-fullgdb:
-	$(MAKE) -C text fullgdb
-clean: fpc_clean $(addsuffix _clean,$(TARGET_DIRS))
-distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
-clean_compiler:
-	$(MAKE) -C ../compiler clean

+ 0 - 45
ide/Makefile.fpc

@@ -1,45 +0,0 @@
-#
-#   Makefile.fpc for FP IDE
-#
-
-[package]
-name=ide
-version=1.0.5
-
-[target]
-dirs=fake text
-
-[install]
-fpcpackage=y
-
-[default]
-fpcdir=..
-dir=text
-
-[rules]
-.PHONY: gdb full fullgdb clean_compiler
-
-all:
-        $(MAKE) -C text all
-
-gdb:
-        $(MAKE) -C text gdb
-
-full:
-        $(MAKE) -C text full
-
-fullgdb:
-        $(MAKE) -C text fullgdb
-
-# Also clean the fake dir
-clean: fpc_clean $(addsuffix _clean,$(TARGET_DIRS))
-
-distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
-
-
-#
-# Misc
-#
-clean_compiler:
-        $(MAKE) -C ../compiler clean
-

+ 0 - 840
ide/fake/Makefile

@@ -1,840 +0,0 @@
-#
-# Don't edit, this file is generated by FPCMake Version 1.1 [2001/08/02]
-#
-default: all
-override PATH:=$(subst \,/,$(PATH))
-ifeq ($(findstring ;,$(PATH)),)
-inUnix=1
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-SEARCHPATH:=$(subst ;, ,$(PATH))
-endif
-PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
-ifeq ($(PWD),)
-PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
-ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=
-endif
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=.exe
-endif
-ifndef inUnix
-ifeq ($(OS),Windows_NT)
-inWinNT=1
-else
-ifdef OS2_SHELL
-inOS2=1
-endif
-endif
-else
-ifneq ($(findstring cygwin,$(MACHTYPE)),)
-inCygWin=1
-endif
-endif
-ifdef inUnix
-BATCHEXT=.sh
-else
-ifdef inOS2
-BATCHEXT=.cmd
-else
-BATCHEXT=.bat
-endif
-endif
-ifdef inUnix
-PATHSEP=/
-else
-PATHSEP:=$(subst /,\,/)
-endif
-ifdef PWD
-BASEDIR:=$(subst \,/,$(shell $(PWD)))
-ifdef inCygWin
-ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
-BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
-BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
-BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
-endif
-endif
-else
-BASEDIR=.
-endif
-ifndef FPC
-ifdef PP
-FPC=$(PP)
-else
-ifdef inUnix
-CPU_SOURCE=$(shell uname -m)
-ifeq (m68k,$(CPU_SOURCE))
-FPC=ppc68k
-else
-FPC=ppc386
-endif
-else
-FPC=ppc386
-endif
-endif
-endif
-override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
-endif
-ifndef OS_SOURCE
-OS_SOURCE:=$(shell $(FPC) -iSO)
-endif
-ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
-endif
-ifndef CPU_SOURCE
-CPU_SOURCE:=$(shell $(FPC) -iSP)
-endif
-ifndef FPC_VERSION
-FPC_VERSION:=$(shell $(FPC) -iV)
-endif
-export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=wrong
-endif
-else
-override FPCDIR=wrong
-endif
-ifeq ($(FPCDIR),wrong)
-ifdef inUnix
-override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
-endif
-else
-override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=c:/pp
-endif
-endif
-endif
-endif
-UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
-PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
-override TARGET_DIRS+=compiler gdb
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO=
-else
-ECHO:=$(firstword $(ECHO))
-endif
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-ifndef DATE
-DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE=
-else
-DATE:=$(firstword $(DATE))
-endif
-else
-DATE:=$(firstword $(DATE))
-endif
-endif
-export DATE
-ifndef GINSTALL
-GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL=
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-endif
-export GINSTALL
-ifndef CPPROG
-CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(CPPROG),)
-CPPROG=
-else
-CPPROG:=$(firstword $(CPPROG))
-endif
-endif
-export CPPROG
-ifndef RMPROG
-RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(RMPROG),)
-RMPROG=
-else
-RMPROG:=$(firstword $(RMPROG))
-endif
-endif
-export RMPROG
-ifndef MVPROG
-MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(MVPROG),)
-MVPROG=
-else
-MVPROG:=$(firstword $(MVPROG))
-endif
-endif
-export MVPROG
-ifndef ECHOREDIR
-ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
-endif
-ifndef COPY
-COPY:=$(CPPROG) -fp
-endif
-ifndef COPYTREE
-COPYTREE:=$(CPPROG) -rfp
-endif
-ifndef MOVE
-MOVE:=$(MVPROG) -f
-endif
-ifndef DEL
-DEL:=$(RMPROG) -f
-endif
-ifndef DELTREE
-DELTREE:=$(RMPROG) -rf
-endif
-ifndef INSTALL
-ifdef inUnix
-INSTALL:=$(GINSTALL) -c -m 644
-else
-INSTALL:=$(COPY)
-endif
-endif
-ifndef INSTALLEXE
-ifdef inUnix
-INSTALLEXE:=$(GINSTALL) -c -m 755
-else
-INSTALLEXE:=$(COPY)
-endif
-endif
-ifndef MKDIR
-MKDIR:=$(GINSTALL) -m 755 -d
-endif
-export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
-ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(PPUMOVE),)
-PPUMOVE=
-else
-PPUMOVE:=$(firstword $(PPUMOVE))
-endif
-endif
-export PPUMOVE
-ifndef FPCMAKE
-FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(FPCMAKE),)
-FPCMAKE=
-else
-FPCMAKE:=$(firstword $(FPCMAKE))
-endif
-endif
-export FPCMAKE
-ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ZIPPROG),)
-ZIPPROG=
-else
-ZIPPROG:=$(firstword $(ZIPPROG))
-endif
-endif
-export ZIPPROG
-ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(TARPROG),)
-TARPROG=
-else
-TARPROG:=$(firstword $(TARPROG))
-endif
-endif
-export TARPROG
-ifndef AS
-AS=as
-endif
-ifndef LD
-LD=ld
-endif
-ifndef RC
-RC=rc
-endif
-PPAS=ppas$(BATCHEXT)
-ifdef inUnix
-LDCONFIG=ldconfig
-else
-LDCONFIG=
-endif
-ifdef DATE
-DATESTR:=$(shell $(DATE) +%Y%m%d)
-else
-DATESTR=
-endif
-ifndef UPXPROG
-ifeq ($(OS_TARGET),go32v2)
-UPXPROG:=1
-endif
-ifeq ($(OS_TARGET),win32)
-UPXPROG:=1
-endif
-ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(UPXPROG),)
-UPXPROG=
-else
-UPXPROG:=$(firstword $(UPXPROG))
-endif
-else
-UPXPROG=
-endif
-endif
-export UPXPROG
-ZIPOPT=-9
-ZIPEXT=.zip
-ifeq ($(USETAR),bz2)
-TAROPT=vI
-TAREXT=.tar.bz2
-else
-TAROPT=vz
-TAREXT=.tar.gz
-endif
-LOADEREXT=.as
-EXEEXT=.exe
-PPLEXT=.ppl
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.so
-STATICLIBPREFIX=libp
-RSTEXT=.rst
-FPCMADE=fpcmade
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-STATICLIBPREFIX=
-FPCMADE=fpcmade.v1
-PACKAGESUFFIX=v1
-endif
-ifeq ($(OS_TARGET),go32v2)
-STATICLIBPREFIX=
-FPCMADE=fpcmade.dos
-ZIPSUFFIX=go32
-endif
-ifeq ($(OS_TARGET),linux)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.lnx
-ZIPSUFFIX=linux
-endif
-ifeq ($(OS_TARGET),freebsd)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.freebsd
-ZIPSUFFIX=freebsd
-endif
-ifeq ($(OS_TARGET),win32)
-PPUEXT=.ppw
-OEXT=.ow
-ASMEXT=.sw
-SMARTEXT=.slw
-STATICLIBEXT=.aw
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.w32
-ZIPSUFFIX=w32
-endif
-ifeq ($(OS_TARGET),os2)
-PPUEXT=.ppo
-ASMEXT=.so2
-OEXT=.oo2
-AOUTEXT=.out
-SMARTEXT=.so
-STATICLIBEXT=.ao2
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.os2
-ZIPSUFFIX=emx
-endif
-ifeq ($(OS_TARGET),amiga)
-EXEEXT=
-PPUEXT=.ppa
-ASMEXT=.asm
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.library
-FPCMADE=fpcmade.amg
-endif
-ifeq ($(OS_TARGET),atari)
-PPUEXT=.ppt
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=.ttp
-FPCMADE=fpcmade.ata
-endif
-ifdef REQUIRE_UNITSDIR
-override UNITSDIR+=$(REQUIRE_UNITSDIR)
-endif
-ifdef REQUIRE_PACKAGESDIR
-override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
-endif
-ifdef ZIPINSTALL
-ifeq ($(OS_TARGET),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-UNIXINSTALLDIR=1
-endif
-else
-ifeq ($(OS_SOURCE),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_SOURCE),freebsd)
-UNIXINSTALLDIR=1
-endif
-endif
-ifndef INSTALL_PREFIX
-ifdef UNIXINSTALLDIR
-INSTALL_PREFIX=/usr/local
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=/pp
-else
-INSTALL_BASEDIR:=/$(PACKAGE_NAME)
-endif
-endif
-endif
-export INSTALL_PREFIX
-ifndef DIST_DESTDIR
-DIST_DESTDIR:=$(BASEDIR)
-endif
-export DIST_DESTDIR
-ifndef INSTALL_BASEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
-endif
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)
-endif
-endif
-ifndef INSTALL_BINDIR
-ifdef UNIXINSTALLDIR
-INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
-else
-INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
-endif
-endif
-endif
-ifndef INSTALL_UNITDIR
-INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
-ifdef INSTALL_FPCPACKAGE
-ifdef PACKAGE_NAME
-INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
-endif
-endif
-endif
-ifndef INSTALL_LIBDIR
-ifdef UNIXINSTALLDIR
-INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
-else
-INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
-endif
-endif
-ifndef INSTALL_SOURCEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source
-endif
-endif
-endif
-ifndef INSTALL_DOCDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
-endif
-endif
-endif
-ifndef INSTALL_EXAMPLEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
-endif
-endif
-endif
-ifndef INSTALL_DATADIR
-INSTALL_DATADIR=$(INSTALL_BASEDIR)
-endif
-override FPCOPTDEF=$(CPU_TARGET)
-ifneq ($(OS_TARGET),$(OS_SOURCE))
-override FPCOPT+=-T$(OS_TARGET)
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-ifdef LINKSMART
-override FPCOPT+=-XX
-endif
-ifdef CREATESMART
-override FPCOPT+=-CX
-endif
-ifdef DEBUG
-override FPCOPT+=-gl
-override FPCOPTDEF+=DEBUG
-endif
-ifdef RELEASE
-override FPCOPT+=-Xs -OG2p3 -n
-override FPCOPTDEF+=RELEASE
-endif
-ifdef STRIP
-override FPCOPT+=-Xs
-endif
-ifdef OPTIMIZE
-override FPCOPT+=-OG2p3
-endif
-ifdef VERBOSE
-override FPCOPT+=-vwni
-endif
-ifdef COMPILER_OPTIONS
-override FPCOPT+=$(COMPILER_OPTIONS)
-endif
-ifdef COMPILER_UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
-endif
-ifdef COMPILER_LIBRARYDIR
-override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
-endif
-ifdef COMPILER_OBJECTDIR
-override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
-endif
-ifdef COMPILER_INCLUDEDIR
-override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
-endif
-ifdef COMPILER_TARGETDIR
-override FPCOPT+=-FE$(COMPILER_TARGETDIR)
-ifeq ($(COMPILER_TARGETDIR),.)
-override TARGETDIRPREFIX=
-else
-override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-endif
-ifdef COMPILER_UNITTARGETDIR
-override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
-ifeq ($(COMPILER_UNITTARGETDIR),.)
-override UNITTARGETDIRPREFIX=
-else
-override UNITTARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-else
-ifdef COMPILER_TARGETDIR
-override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
-override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
-endif
-endif
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef FPCOPTDEF
-override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
-endif
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-ifdef USEENV
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
-endif
-override COMPILER:=$(FPC) $(FPCOPT)
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-ifeq ($(OS_SOURCE),$(OS_TARGET))
-EXECPPAS:=@$(PPAS)
-endif
-endif
-ifdef TARGET_RSTS
-override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
-override CLEANRSTFILES+=$(RSTFILES)
-endif
-.PHONY: fpc_clean fpc_cleanall fpc_distclean
-ifdef EXEFILES
-override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
-endif
-ifdef CLEAN_UNITS
-override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
-endif
-ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
-override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
-override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
-endif
-fpc_clean: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-ifdef CLEAN_FILES
-	-$(DEL) $(CLEAN_FILES)
-endif
-ifdef LIB_NAME
-	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
-endif
-	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-fpc_distclean: clean
-ifdef COMPILER_UNITTARGETDIR
-TARGETDIRCLEAN=fpc_clean
-endif
-fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-ifdef AOUTEXT
-	-$(DEL) *$(AOUTEXT)
-endif
-.PHONY: fpc_info
-fpc_info:
-	@$(ECHO)
-	@$(ECHO)  == Package info ==
-	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
-	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPC.......... $(FPC)
-	@$(ECHO)  FPC Version.. $(FPC_VERSION)
-	@$(ECHO)  Source CPU... $(CPU_SOURCE)
-	@$(ECHO)  Target CPU... $(CPU_TARGET)
-	@$(ECHO)  Source OS.... $(OS_SOURCE)
-	@$(ECHO)  Target OS.... $(OS_TARGET)
-	@$(ECHO)
-	@$(ECHO)  == Directory info ==
-	@$(ECHO)
-	@$(ECHO)  Basedir......... $(BASEDIR)
-	@$(ECHO)  FPCDir.......... $(FPCDIR)
-	@$(ECHO)  UnitsDir........ $(UNITSDIR)
-	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
-	@$(ECHO)
-	@$(ECHO)  GCC library..... $(GCCLIBDIR)
-	@$(ECHO)  Other library... $(OTHERLIBDIR)
-	@$(ECHO)
-	@$(ECHO)  == Tools info ==
-	@$(ECHO)
-	@$(ECHO)  Pwd....... $(PWD)
-	@$(ECHO)  Mv........ $(MVPROG)
-	@$(ECHO)  Cp........ $(CPPROG)
-	@$(ECHO)  Rm........ $(RMPROG)
-	@$(ECHO)  GInstall.. $(GINSTALL)
-	@$(ECHO)  Echo...... $(ECHO)
-	@$(ECHO)  Date...... $(DATE)
-	@$(ECHO)  FPCMake... $(FPCMAKE)
-	@$(ECHO)  PPUMove... $(PPUMOVE)
-	@$(ECHO)  Upx....... $(UPXPROG)
-	@$(ECHO)  Zip....... $(ZIPPROG)
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  Target Loaders...... $(TARGET_LOADERS)
-	@$(ECHO)  Target Units........ $(TARGET_UNITS)
-	@$(ECHO)  Target Programs..... $(TARGET_PROGRAMS)
-	@$(ECHO)  Target Dirs......... $(TARGET_DIRS)
-	@$(ECHO)  Target Examples..... $(TARGET_EXAMPLES)
-	@$(ECHO)  Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)
-	@$(ECHO)
-	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
-	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
-	@$(ECHO)
-	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
-	@$(ECHO)  Install Files....... $(INSTALL_FILES)
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-	@$(ECHO)  DateStr.............. $(DATESTR)
-	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
-	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
-	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
-	@$(ECHO)
-	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
-	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
-	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
-	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
-	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
-	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
-	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
-	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
-	@$(ECHO)
-	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
-	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
-	@$(ECHO)
-TARGET_DIRS_COMPILER=1
-TARGET_DIRS_GDB=1
-ifdef TARGET_DIRS_COMPILER
-compiler_all:
-	$(MAKE) -C compiler all
-compiler_debug:
-	$(MAKE) -C compiler debug
-compiler_smart:
-	$(MAKE) -C compiler smart
-compiler_examples:
-	$(MAKE) -C compiler examples
-compiler_shared:
-	$(MAKE) -C compiler shared
-compiler_install:
-	$(MAKE) -C compiler install
-compiler_sourceinstall:
-	$(MAKE) -C compiler sourceinstall
-compiler_exampleinstall:
-	$(MAKE) -C compiler exampleinstall
-compiler_distinstall:
-	$(MAKE) -C compiler distinstall
-compiler_zipinstall:
-	$(MAKE) -C compiler zipinstall
-compiler_zipsourceinstall:
-	$(MAKE) -C compiler zipsourceinstall
-compiler_zipexampleinstall:
-	$(MAKE) -C compiler zipexampleinstall
-compiler_zipdistinstall:
-	$(MAKE) -C compiler zipdistinstall
-compiler_clean:
-	$(MAKE) -C compiler clean
-compiler_distclean:
-	$(MAKE) -C compiler distclean
-compiler_cleanall:
-	$(MAKE) -C compiler cleanall
-compiler_info:
-	$(MAKE) -C compiler info
-compiler:
-	$(MAKE) -C compiler all
-.PHONY: compiler_all compiler_debug compiler_smart compiler_examples compiler_shared compiler_install compiler_sourceinstall compiler_exampleinstall compiler_distinstall compiler_zipinstall compiler_zipsourceinstall compiler_zipexampleinstall compiler_zipdistinstall compiler_clean compiler_distclean compiler_cleanall compiler_info compiler
-endif
-ifdef TARGET_DIRS_GDB
-gdb_all:
-	$(MAKE) -C gdb all
-gdb_debug:
-	$(MAKE) -C gdb debug
-gdb_smart:
-	$(MAKE) -C gdb smart
-gdb_examples:
-	$(MAKE) -C gdb examples
-gdb_shared:
-	$(MAKE) -C gdb shared
-gdb_install:
-	$(MAKE) -C gdb install
-gdb_sourceinstall:
-	$(MAKE) -C gdb sourceinstall
-gdb_exampleinstall:
-	$(MAKE) -C gdb exampleinstall
-gdb_distinstall:
-	$(MAKE) -C gdb distinstall
-gdb_zipinstall:
-	$(MAKE) -C gdb zipinstall
-gdb_zipsourceinstall:
-	$(MAKE) -C gdb zipsourceinstall
-gdb_zipexampleinstall:
-	$(MAKE) -C gdb zipexampleinstall
-gdb_zipdistinstall:
-	$(MAKE) -C gdb zipdistinstall
-gdb_clean:
-	$(MAKE) -C gdb clean
-gdb_distclean:
-	$(MAKE) -C gdb distclean
-gdb_cleanall:
-	$(MAKE) -C gdb cleanall
-gdb_info:
-	$(MAKE) -C gdb info
-gdb:
-	$(MAKE) -C gdb all
-.PHONY: gdb_all gdb_debug gdb_smart gdb_examples gdb_shared gdb_install gdb_sourceinstall gdb_exampleinstall gdb_distinstall gdb_zipinstall gdb_zipsourceinstall gdb_zipexampleinstall gdb_zipdistinstall gdb_clean gdb_distclean gdb_cleanall gdb_info gdb
-endif
-all: $(addsuffix _all,$(TARGET_DIRS))
-debug: $(addsuffix _debug,$(TARGET_DIRS))
-smart: $(addsuffix _smart,$(TARGET_DIRS))
-examples: $(addsuffix _examples,$(TARGET_DIRS))
-shared: $(addsuffix _shared,$(TARGET_DIRS))
-install: $(addsuffix _install,$(TARGET_DIRS))
-sourceinstall: $(addsuffix _sourceinstall,$(TARGET_DIRS))
-exampleinstall: $(addsuffix _exampleinstall,$(TARGET_DIRS))
-distinstall: $(addsuffix _distinstall,$(TARGET_DIRS))
-zipinstall: $(addsuffix _zipinstall,$(TARGET_DIRS))
-zipsourceinstall: $(addsuffix _zipsourceinstall,$(TARGET_DIRS))
-zipexampleinstall: $(addsuffix _zipexampleinstall,$(TARGET_DIRS))
-zipdistinstall: $(addsuffix _zipdistinstall,$(TARGET_DIRS))
-clean: $(addsuffix _clean,$(TARGET_DIRS))
-distclean: $(addsuffix _distclean,$(TARGET_DIRS))
-cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
-info: fpc_info
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info
-ifneq ($(wildcard fpcmake.loc),)
-include fpcmake.loc
-endif

+ 0 - 6
ide/fake/Makefile.fpc

@@ -1,6 +0,0 @@
-#
-#   Makefile.fpc for Fake compiler/gdb
-#
-
-[target]
-dirs=compiler gdb

+ 0 - 21
ide/fake/README

@@ -1,21 +0,0 @@
-
-This directory contains fake versions which can be used for IDE development
-to leave out some parts of the IDE by replacing them with dummy functions.
-
-compiler/	contains a fake compiler
-gdb/            contains a fake gdb interface
-
-
-Fake compiler
--------------
-The only thing it does is when you compile it writes some info lines to the
-do_comment() function, which is normally called by the compiler.
-
-Currently it gives an info line that it is a fake compiler and on the second
-line the specified commandline
-
-
-Fake gdb
---------
-This contains only the unit gdbcon. Normally the gdbint unit won't be used
-directly by your program.

+ 0 - 916
ide/fake/compiler/Makefile

@@ -1,916 +0,0 @@
-#
-# Don't edit, this file is generated by FPCMake Version 1.1 [2001/08/02]
-#
-default: all
-override PATH:=$(subst \,/,$(PATH))
-ifeq ($(findstring ;,$(PATH)),)
-inUnix=1
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-SEARCHPATH:=$(subst ;, ,$(PATH))
-endif
-PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
-ifeq ($(PWD),)
-PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
-ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=
-endif
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=.exe
-endif
-ifndef inUnix
-ifeq ($(OS),Windows_NT)
-inWinNT=1
-else
-ifdef OS2_SHELL
-inOS2=1
-endif
-endif
-else
-ifneq ($(findstring cygwin,$(MACHTYPE)),)
-inCygWin=1
-endif
-endif
-ifdef inUnix
-BATCHEXT=.sh
-else
-ifdef inOS2
-BATCHEXT=.cmd
-else
-BATCHEXT=.bat
-endif
-endif
-ifdef inUnix
-PATHSEP=/
-else
-PATHSEP:=$(subst /,\,/)
-endif
-ifdef PWD
-BASEDIR:=$(subst \,/,$(shell $(PWD)))
-ifdef inCygWin
-ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
-BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
-BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
-BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
-endif
-endif
-else
-BASEDIR=.
-endif
-ifndef FPC
-ifdef PP
-FPC=$(PP)
-else
-ifdef inUnix
-CPU_SOURCE=$(shell uname -m)
-ifeq (m68k,$(CPU_SOURCE))
-FPC=ppc68k
-else
-FPC=ppc386
-endif
-else
-FPC=ppc386
-endif
-endif
-endif
-override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
-endif
-ifndef OS_SOURCE
-OS_SOURCE:=$(shell $(FPC) -iSO)
-endif
-ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
-endif
-ifndef CPU_SOURCE
-CPU_SOURCE:=$(shell $(FPC) -iSP)
-endif
-ifndef FPC_VERSION
-FPC_VERSION:=$(shell $(FPC) -iV)
-endif
-export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=wrong
-endif
-else
-override FPCDIR=wrong
-endif
-ifeq ($(FPCDIR),wrong)
-override FPCDIR=../../..
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=wrong
-endif
-endif
-endif
-ifeq ($(FPCDIR),wrong)
-ifdef inUnix
-override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
-endif
-else
-override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=c:/pp
-endif
-endif
-endif
-endif
-UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
-PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
-override TARGET_UNITS+=browcol compiler systems version comphook globtype tokens
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO=
-else
-ECHO:=$(firstword $(ECHO))
-endif
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-ifndef DATE
-DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE=
-else
-DATE:=$(firstword $(DATE))
-endif
-else
-DATE:=$(firstword $(DATE))
-endif
-endif
-export DATE
-ifndef GINSTALL
-GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL=
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-endif
-export GINSTALL
-ifndef CPPROG
-CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(CPPROG),)
-CPPROG=
-else
-CPPROG:=$(firstword $(CPPROG))
-endif
-endif
-export CPPROG
-ifndef RMPROG
-RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(RMPROG),)
-RMPROG=
-else
-RMPROG:=$(firstword $(RMPROG))
-endif
-endif
-export RMPROG
-ifndef MVPROG
-MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(MVPROG),)
-MVPROG=
-else
-MVPROG:=$(firstword $(MVPROG))
-endif
-endif
-export MVPROG
-ifndef ECHOREDIR
-ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
-endif
-ifndef COPY
-COPY:=$(CPPROG) -fp
-endif
-ifndef COPYTREE
-COPYTREE:=$(CPPROG) -rfp
-endif
-ifndef MOVE
-MOVE:=$(MVPROG) -f
-endif
-ifndef DEL
-DEL:=$(RMPROG) -f
-endif
-ifndef DELTREE
-DELTREE:=$(RMPROG) -rf
-endif
-ifndef INSTALL
-ifdef inUnix
-INSTALL:=$(GINSTALL) -c -m 644
-else
-INSTALL:=$(COPY)
-endif
-endif
-ifndef INSTALLEXE
-ifdef inUnix
-INSTALLEXE:=$(GINSTALL) -c -m 755
-else
-INSTALLEXE:=$(COPY)
-endif
-endif
-ifndef MKDIR
-MKDIR:=$(GINSTALL) -m 755 -d
-endif
-export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
-ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(PPUMOVE),)
-PPUMOVE=
-else
-PPUMOVE:=$(firstword $(PPUMOVE))
-endif
-endif
-export PPUMOVE
-ifndef FPCMAKE
-FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(FPCMAKE),)
-FPCMAKE=
-else
-FPCMAKE:=$(firstword $(FPCMAKE))
-endif
-endif
-export FPCMAKE
-ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ZIPPROG),)
-ZIPPROG=
-else
-ZIPPROG:=$(firstword $(ZIPPROG))
-endif
-endif
-export ZIPPROG
-ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(TARPROG),)
-TARPROG=
-else
-TARPROG:=$(firstword $(TARPROG))
-endif
-endif
-export TARPROG
-ifndef AS
-AS=as
-endif
-ifndef LD
-LD=ld
-endif
-ifndef RC
-RC=rc
-endif
-PPAS=ppas$(BATCHEXT)
-ifdef inUnix
-LDCONFIG=ldconfig
-else
-LDCONFIG=
-endif
-ifdef DATE
-DATESTR:=$(shell $(DATE) +%Y%m%d)
-else
-DATESTR=
-endif
-ifndef UPXPROG
-ifeq ($(OS_TARGET),go32v2)
-UPXPROG:=1
-endif
-ifeq ($(OS_TARGET),win32)
-UPXPROG:=1
-endif
-ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(UPXPROG),)
-UPXPROG=
-else
-UPXPROG:=$(firstword $(UPXPROG))
-endif
-else
-UPXPROG=
-endif
-endif
-export UPXPROG
-ZIPOPT=-9
-ZIPEXT=.zip
-ifeq ($(USETAR),bz2)
-TAROPT=vI
-TAREXT=.tar.bz2
-else
-TAROPT=vz
-TAREXT=.tar.gz
-endif
-LOADEREXT=.as
-EXEEXT=.exe
-PPLEXT=.ppl
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.so
-STATICLIBPREFIX=libp
-RSTEXT=.rst
-FPCMADE=fpcmade
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-STATICLIBPREFIX=
-FPCMADE=fpcmade.v1
-PACKAGESUFFIX=v1
-endif
-ifeq ($(OS_TARGET),go32v2)
-STATICLIBPREFIX=
-FPCMADE=fpcmade.dos
-ZIPSUFFIX=go32
-endif
-ifeq ($(OS_TARGET),linux)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.lnx
-ZIPSUFFIX=linux
-endif
-ifeq ($(OS_TARGET),freebsd)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.freebsd
-ZIPSUFFIX=freebsd
-endif
-ifeq ($(OS_TARGET),win32)
-PPUEXT=.ppw
-OEXT=.ow
-ASMEXT=.sw
-SMARTEXT=.slw
-STATICLIBEXT=.aw
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.w32
-ZIPSUFFIX=w32
-endif
-ifeq ($(OS_TARGET),os2)
-PPUEXT=.ppo
-ASMEXT=.so2
-OEXT=.oo2
-AOUTEXT=.out
-SMARTEXT=.so
-STATICLIBEXT=.ao2
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.os2
-ZIPSUFFIX=emx
-endif
-ifeq ($(OS_TARGET),amiga)
-EXEEXT=
-PPUEXT=.ppa
-ASMEXT=.asm
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.library
-FPCMADE=fpcmade.amg
-endif
-ifeq ($(OS_TARGET),atari)
-PPUEXT=.ppt
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=.ttp
-FPCMADE=fpcmade.ata
-endif
-ifdef REQUIRE_UNITSDIR
-override UNITSDIR+=$(REQUIRE_UNITSDIR)
-endif
-ifdef REQUIRE_PACKAGESDIR
-override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
-endif
-ifdef ZIPINSTALL
-ifeq ($(OS_TARGET),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-UNIXINSTALLDIR=1
-endif
-else
-ifeq ($(OS_SOURCE),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_SOURCE),freebsd)
-UNIXINSTALLDIR=1
-endif
-endif
-ifndef INSTALL_PREFIX
-ifdef UNIXINSTALLDIR
-INSTALL_PREFIX=/usr/local
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=/pp
-else
-INSTALL_BASEDIR:=/$(PACKAGE_NAME)
-endif
-endif
-endif
-export INSTALL_PREFIX
-ifndef DIST_DESTDIR
-DIST_DESTDIR:=$(BASEDIR)
-endif
-export DIST_DESTDIR
-ifndef INSTALL_BASEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
-endif
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)
-endif
-endif
-ifndef INSTALL_BINDIR
-ifdef UNIXINSTALLDIR
-INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
-else
-INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
-endif
-endif
-endif
-ifndef INSTALL_UNITDIR
-INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
-ifdef INSTALL_FPCPACKAGE
-ifdef PACKAGE_NAME
-INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
-endif
-endif
-endif
-ifndef INSTALL_LIBDIR
-ifdef UNIXINSTALLDIR
-INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
-else
-INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
-endif
-endif
-ifndef INSTALL_SOURCEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source
-endif
-endif
-endif
-ifndef INSTALL_DOCDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
-endif
-endif
-endif
-ifndef INSTALL_EXAMPLEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
-endif
-endif
-endif
-ifndef INSTALL_DATADIR
-INSTALL_DATADIR=$(INSTALL_BASEDIR)
-endif
-ifeq ($(OS_TARGET),linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),go32v2)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),win32)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),os2)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),beos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),amiga)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),atari)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifdef REQUIRE_PACKAGES_RTL
-PACKAGEDIR_RTL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))
-ifneq ($(PACKAGEDIR_RTL),)
-PACKAGEDIR_RTL:=$(firstword $(PACKAGEDIR_RTL))
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_rtl
-package_rtl:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
-UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
-else
-UNITDIR_RTL=$(PACKAGEDIR_RTL)
-endif
-else
-PACKAGEDIR_RTL=
-UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
-ifneq ($(UNITDIR_RTL),)
-UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
-else
-UNITDIR_RTL=
-endif
-endif
-ifdef UNITDIR_RTL
-override COMPILER_UNITDIR+=$(UNITDIR_RTL)
-endif
-endif
-.PHONY: package_rtl
-override FPCOPTDEF=$(CPU_TARGET)
-ifneq ($(OS_TARGET),$(OS_SOURCE))
-override FPCOPT+=-T$(OS_TARGET)
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-ifdef LINKSMART
-override FPCOPT+=-XX
-endif
-ifdef CREATESMART
-override FPCOPT+=-CX
-endif
-ifdef DEBUG
-override FPCOPT+=-gl
-override FPCOPTDEF+=DEBUG
-endif
-ifdef RELEASE
-override FPCOPT+=-Xs -OG2p3 -n
-override FPCOPTDEF+=RELEASE
-endif
-ifdef STRIP
-override FPCOPT+=-Xs
-endif
-ifdef OPTIMIZE
-override FPCOPT+=-OG2p3
-endif
-ifdef VERBOSE
-override FPCOPT+=-vwni
-endif
-ifdef COMPILER_OPTIONS
-override FPCOPT+=$(COMPILER_OPTIONS)
-endif
-ifdef COMPILER_UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
-endif
-ifdef COMPILER_LIBRARYDIR
-override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
-endif
-ifdef COMPILER_OBJECTDIR
-override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
-endif
-ifdef COMPILER_INCLUDEDIR
-override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
-endif
-ifdef COMPILER_TARGETDIR
-override FPCOPT+=-FE$(COMPILER_TARGETDIR)
-ifeq ($(COMPILER_TARGETDIR),.)
-override TARGETDIRPREFIX=
-else
-override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-endif
-ifdef COMPILER_UNITTARGETDIR
-override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
-ifeq ($(COMPILER_UNITTARGETDIR),.)
-override UNITTARGETDIRPREFIX=
-else
-override UNITTARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-else
-ifdef COMPILER_TARGETDIR
-override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
-override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
-endif
-endif
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef FPCOPTDEF
-override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
-endif
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-ifdef USEENV
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
-endif
-override COMPILER:=$(FPC) $(FPCOPT)
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-ifeq ($(OS_SOURCE),$(OS_TARGET))
-EXECPPAS:=@$(PPAS)
-endif
-endif
-.PHONY: fpc_units
-ifdef TARGET_UNITS
-override ALLTARGET+=fpc_units
-override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
-override INSTALLPPUFILES+=$(UNITPPUFILES)
-override CLEANPPUFILES+=$(UNITPPUFILES)
-endif
-fpc_units: $(UNITPPUFILES)
-ifdef TARGET_RSTS
-override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
-override CLEANRSTFILES+=$(RSTFILES)
-endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
-$(FPCMADE): $(ALLTARGET)
-	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
-fpc_smart:
-	$(MAKE) all LINKSMART=1 CREATESMART=1
-fpc_debug:
-	$(MAKE) all DEBUG=1
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
-%$(PPUEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(PPUEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
-.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
-ifdef INSTALL_UNITS
-override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
-endif
-ifdef INSTALLPPUFILES
-override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
-override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
-override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
-override INSTALL_CREATEPACKAGEFPC=1
-endif
-ifdef INSTALLEXEFILES
-override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
-endif
-fpc_install: $(INSTALLTARGET)
-ifdef INSTALLEXEFILES
-	$(MKDIR) $(INSTALL_BINDIR)
-ifdef UPXPROG
-	-$(UPXPROG) $(INSTALLEXEFILES)
-endif
-	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
-endif
-ifdef INSTALL_CREATEPACKAGEFPC
-ifdef FPCMAKE
-ifdef PACKAGE_VERSION
-ifneq ($(wildcard Makefile.fpc),)
-	$(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
-endif
-endif
-endif
-endif
-ifdef INSTALLPPUFILES
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
-ifneq ($(INSTALLPPULINKFILES),)
-	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
-endif
-ifneq ($(wildcard $(LIB_FULLNAME)),)
-	$(MKDIR) $(INSTALL_LIBDIR)
-	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
-ifdef inUnix
-	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
-endif
-endif
-endif
-ifdef INSTALL_FILES
-	$(MKDIR) $(INSTALL_DATADIR)
-	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
-endif
-fpc_sourceinstall: distclean
-	$(MKDIR) $(INSTALL_SOURCEDIR)
-	$(COPYTREE) $(BASEDIR) $(INSTALL_SOURCEDIR)
-fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
-ifdef HASEXAMPLES
-	$(MKDIR) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef EXAMPLESOURCEFILES
-	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef TARGET_EXAMPLEDIRS
-	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
-endif
-.PHONY: fpc_clean fpc_cleanall fpc_distclean
-ifdef EXEFILES
-override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
-endif
-ifdef CLEAN_UNITS
-override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
-endif
-ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
-override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
-override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
-endif
-fpc_clean: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-ifdef CLEAN_FILES
-	-$(DEL) $(CLEAN_FILES)
-endif
-ifdef LIB_NAME
-	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
-endif
-	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-fpc_distclean: clean
-ifdef COMPILER_UNITTARGETDIR
-TARGETDIRCLEAN=fpc_clean
-endif
-fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-ifdef AOUTEXT
-	-$(DEL) *$(AOUTEXT)
-endif
-.PHONY: fpc_info
-fpc_info:
-	@$(ECHO)
-	@$(ECHO)  == Package info ==
-	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
-	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPC.......... $(FPC)
-	@$(ECHO)  FPC Version.. $(FPC_VERSION)
-	@$(ECHO)  Source CPU... $(CPU_SOURCE)
-	@$(ECHO)  Target CPU... $(CPU_TARGET)
-	@$(ECHO)  Source OS.... $(OS_SOURCE)
-	@$(ECHO)  Target OS.... $(OS_TARGET)
-	@$(ECHO)
-	@$(ECHO)  == Directory info ==
-	@$(ECHO)
-	@$(ECHO)  Basedir......... $(BASEDIR)
-	@$(ECHO)  FPCDir.......... $(FPCDIR)
-	@$(ECHO)  UnitsDir........ $(UNITSDIR)
-	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
-	@$(ECHO)
-	@$(ECHO)  GCC library..... $(GCCLIBDIR)
-	@$(ECHO)  Other library... $(OTHERLIBDIR)
-	@$(ECHO)
-	@$(ECHO)  == Tools info ==
-	@$(ECHO)
-	@$(ECHO)  Pwd....... $(PWD)
-	@$(ECHO)  Mv........ $(MVPROG)
-	@$(ECHO)  Cp........ $(CPPROG)
-	@$(ECHO)  Rm........ $(RMPROG)
-	@$(ECHO)  GInstall.. $(GINSTALL)
-	@$(ECHO)  Echo...... $(ECHO)
-	@$(ECHO)  Date...... $(DATE)
-	@$(ECHO)  FPCMake... $(FPCMAKE)
-	@$(ECHO)  PPUMove... $(PPUMOVE)
-	@$(ECHO)  Upx....... $(UPXPROG)
-	@$(ECHO)  Zip....... $(ZIPPROG)
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  Target Loaders...... $(TARGET_LOADERS)
-	@$(ECHO)  Target Units........ $(TARGET_UNITS)
-	@$(ECHO)  Target Programs..... $(TARGET_PROGRAMS)
-	@$(ECHO)  Target Dirs......... $(TARGET_DIRS)
-	@$(ECHO)  Target Examples..... $(TARGET_EXAMPLES)
-	@$(ECHO)  Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)
-	@$(ECHO)
-	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
-	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
-	@$(ECHO)
-	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
-	@$(ECHO)  Install Files....... $(INSTALL_FILES)
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-	@$(ECHO)  DateStr.............. $(DATESTR)
-	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
-	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
-	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
-	@$(ECHO)
-	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
-	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
-	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
-	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
-	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
-	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
-	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
-	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
-	@$(ECHO)
-	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
-	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
-	@$(ECHO)
-all: fpc_all
-debug: fpc_debug
-smart: fpc_smart
-examples:
-shared:
-install: fpc_install
-sourceinstall: fpc_sourceinstall
-exampleinstall: fpc_exampleinstall
-distinstall:
-zipinstall:
-zipsourceinstall:
-zipexampleinstall:
-zipdistinstall:
-clean: fpc_clean
-distclean: fpc_distclean
-cleanall: fpc_cleanall
-info: fpc_info
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info
-ifneq ($(wildcard fpcmake.loc),)
-include fpcmake.loc
-endif

+ 0 - 9
ide/fake/compiler/Makefile.fpc

@@ -1,9 +0,0 @@
-#
-#   Makefile.fpc for Fake Compiler
-#
-
-[target]
-units=browcol compiler systems version comphook globtype tokens
-
-[default]
-fpcdir=../../..

+ 0 - 536
ide/fake/compiler/browcol.pas

@@ -1,536 +0,0 @@
-{
-    $Id$
-
-    Fake browcol unit
-
-}
-unit browcol;
-interface
-uses
-  objects;
-
-const
-    SymbolTypLen : integer=6;
-type
-    { possible types for symtable entries }
-    tsymtyp = (abstractsym,varsym,typesym,procsym,unitsym,programsym,
-               constsym,enumsym,typedconstsym,errorsym,syssym,
-               labelsym,absolutesym,propertysym,funcretsym,
-               macrosym);
-
-type
-    TStoreCollection = object(TStringCollection)
-      function Add(const S: string): PString;
-    end;
-
-    PModuleNameCollection = ^TModuleNameCollection;
-    TModuleNameCollection = object(TStoreCollection)
-    end;
-
-    PTypeNameCollection = ^TTypeNameCollection;
-    TTypeNameCollection = object(TStoreCollection)
-    end;
-
-    PSymbolCollection       = ^TSymbolCollection;
-    PSortedSymbolCollection = ^TSortedSymbolCollection;
-    PReferenceCollection    = ^TReferenceCollection;
-
-    PReference = ^TReference;
-    TReference = object(TObject)
-      FileName  : PString;
-      Position  : TPoint;
-      constructor Init(AFileName: PString; ALine, AColumn: Sw_integer);
-      function    GetFileName: string;
-      destructor  Done; virtual;
-    end;
-
-    PSymbolMemInfo = ^TSymbolMemInfo;
-    TSymbolMemInfo = record
-      Addr      : longint;
-      LocalAddr : longint;
-      Size      : longint;
-      PushSize  : longint;
-    end;
-
-    PSymbol = ^TSymbol;
-    TSymbol = object(TObject)
-      Name       : PString;
-      Typ        : tsymtyp;
-      Params     : PString;
-      References : PReferenceCollection;
-      Items      : PSymbolCollection;
-      DType      : PString;
-      VType      : PString;
-      ObjectID   : longint;
-      AncestorID : longint;
-      Ancestor   : PSymbol;
-      Flags      : longint;
-      MemInfo    : PSymbolMemInfo;
-      constructor Init(const AName: string; ATyp: tsymtyp; AParams: string; AMemInfo: PSymbolMemInfo);
-      procedure   SetMemInfo(const AMemInfo: TSymbolMemInfo);
-      function    GetReferenceCount: Sw_integer;
-      function    GetReference(Index: Sw_integer): PReference;
-      function    GetItemCount: Sw_integer;
-      function    GetItem(Index: Sw_integer): PSymbol;
-      function    GetName: string;
-      function    GetText: string;
-      function    GetTypeName: string;
-      destructor  Done; virtual;
-    end;
-
-    PObjectSymbolCollection = ^TObjectSymbolCollection;
-
-    PObjectSymbol = ^TObjectSymbol;
-    TObjectSymbol = object(TObject)
-      Parent     : PObjectSymbol;
-      Symbol     : PSymbol;
-      Expanded   : boolean;
-      constructor Init(AParent: PObjectSymbol; ASymbol: PSymbol);
-      constructor InitName(const AName: string);
-      function    GetName: string;
-      function    GetDescendantCount: sw_integer;
-      function    GetDescendant(Index: sw_integer): PObjectSymbol;
-      procedure   AddDescendant(P: PObjectSymbol);
-      destructor  Done; virtual;
-    private
-      Name: PString;
-      Descendants: PObjectSymbolCollection;
-    end;
-
-    TSymbolCollection = object(TSortedCollection)
-       function  At(Index: Sw_Integer): PSymbol;
-       procedure Insert(Item: Pointer); virtual;
-       function  LookUp(const S: string; var Idx: sw_integer): string; virtual;
-    end;
-
-    TSortedSymbolCollection = object(TSymbolCollection)
-      function  Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-      procedure Insert(Item: Pointer); virtual;
-      function  LookUp(const S: string; var Idx: sw_integer): string; virtual;
-    end;
-
-    PIDSortedSymbolCollection = ^TIDSortedSymbolCollection;
-    TIDSortedSymbolCollection = object(TSymbolCollection)
-      function  Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-      procedure Insert(Item: Pointer); virtual;
-      function  SearchSymbolByID(AID: longint): PSymbol;
-    end;
-
-    TObjectSymbolCollection = object(TSortedCollection)
-      function  Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-      function  LookUp(const S: string; var Idx: sw_integer): string; virtual;
-       function At(Index: Sw_Integer): PObjectSymbol;
-    end;
-
-    TReferenceCollection = object(TCollection)
-       function At(Index: Sw_Integer): PReference;
-    end;
-
-    PSourceFile = ^TSourceFile;
-    TSourceFile = object(TObject)
-      SourceFileName: PString;
-      ObjFileName: PString;
-      PPUFileName: PString;
-      constructor Init(ASourceFileName, AObjFileName, APPUFileName: string);
-      destructor  Done; virtual;
-      function    GetSourceFilename: string;
-      function    GetObjFileName: string;
-      function    GetPPUFileName: string;
-    end;
-
-    PSourceFileCollection = ^TSourceFileCollection;
-    TSourceFileCollection = object(TCollection)
-      function At(Index: sw_Integer): PSourceFile;
-    end;
-
-const
-  Modules     : PSymbolCollection = nil;
-  ModuleNames : PModuleNameCollection = nil;
-  TypeNames   : PTypeNameCollection = nil;
-  ObjectTree  : PObjectSymbol = nil;
-  SourceFiles : PSourceFileCollection = nil;
-
-function SearchObjectForSymbol(O: PSymbol): PObjectSymbol;
-
-procedure InitBrowserCol;
-procedure DoneBrowserCol;
-
-function  LoadBrowserCol(S: PStream): boolean;
-function  StoreBrowserCol(S: PStream): boolean;
-procedure RegisterSymbols;
-
-implementation
-
-
-{****************************************************************************
-                                   Helpers
-****************************************************************************}
-
-function GetStr(P: PString): string;
-begin
-  if P=nil then
-    GetStr:=''
-  else
-    GetStr:=P^;
-end;
-
-
-{****************************************************************************
-                                TStoreCollection
-****************************************************************************}
-
-function TStoreCollection.Add(const S: string): PString;
-begin
-  Add:=nil;
-end;
-
-
-{****************************************************************************
-                                TSymbolCollection
-****************************************************************************}
-
-function TSymbolCollection.At(Index: Sw_integer): PSymbol;
-begin
-  At:=nil;
-end;
-
-procedure TSymbolCollection.Insert(Item: Pointer);
-begin
-end;
-
-function TSymbolCollection.LookUp(const S: string; var Idx: sw_integer): string;
-begin
-  Idx:=-1;
-  LookUp:='';
-end;
-
-
-{****************************************************************************
-                               TReferenceCollection
-****************************************************************************}
-
-function TReferenceCollection.At(Index: Sw_integer): PReference;
-begin
-  At:=nil;
-end;
-
-
-{****************************************************************************
-                            TSortedSymbolCollection
-****************************************************************************}
-
-function TSortedSymbolCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-begin
-  Compare:=0;
-end;
-
-procedure TSortedSymbolCollection.Insert(Item: Pointer);
-begin
-end;
-
-function TSortedSymbolCollection.LookUp(const S: string; var Idx: sw_integer): string;
-begin
-  Idx:=-1;
-  LookUp:='';
-end;
-
-
-{****************************************************************************
-                           TIDSortedSymbolCollection
-****************************************************************************}
-
-function TIDSortedSymbolCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-begin
-  Compare:=0;
-end;
-
-procedure TIDSortedSymbolCollection.Insert(Item: Pointer);
-begin
-end;
-
-function TIDSortedSymbolCollection.SearchSymbolByID(AID: longint): PSymbol;
-begin
-  SearchSymbolByID:=nil;
-end;
-
-
-{****************************************************************************
-                           TObjectSymbolCollection
-****************************************************************************}
-
-function TObjectSymbolCollection.At(Index: Sw_Integer): PObjectSymbol;
-begin
-  At:=nil;
-end;
-
-function TObjectSymbolCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-begin
-  Compare:=0;
-end;
-
-function TObjectSymbolCollection.LookUp(const S: string; var Idx: sw_integer): string;
-begin
-  LookUp:='';
-end;
-
-
-{****************************************************************************
-                                TReference
-****************************************************************************}
-
-constructor TReference.Init(AFileName: PString; ALine, AColumn: Sw_integer);
-begin
-end;
-
-function TReference.GetFileName: string;
-begin
-  GetFileName:='';
-end;
-
-destructor TReference.Done;
-begin
-end;
-
-
-{****************************************************************************
-                                   TSymbol
-****************************************************************************}
-
-constructor TSymbol.Init(const AName: string; ATyp: tsymtyp; AParams: string; AMemInfo: PSymbolMemInfo);
-begin
-end;
-
-procedure TSymbol.SetMemInfo(const AMemInfo: TSymbolMemInfo);
-begin
-end;
-
-function TSymbol.GetReferenceCount: Sw_integer;
-begin
-  GetReferenceCount:=0;
-end;
-
-function TSymbol.GetReference(Index: Sw_integer): PReference;
-begin
-  GetReference:=nil;
-end;
-
-function TSymbol.GetItemCount: Sw_integer;
-begin
-  GetItemCount:=0;
-end;
-
-function TSymbol.GetItem(Index: Sw_integer): PSymbol;
-begin
-  GetItem:=nil;
-end;
-
-function TSymbol.GetName: string;
-begin
-  GetName:='';
-end;
-
-function TSymbol.GetText: string;
-begin
-  GetText:='';
-end;
-
-function TSymbol.GetTypeName: string;
-begin
-  GetTypeName:='';
-end;
-
-destructor TSymbol.Done;
-begin
-end;
-
-
-{*****************************************************************************
-                                 TObjectSymbol
-*****************************************************************************}
-
-constructor TObjectSymbol.Init(AParent: PObjectSymbol; ASymbol: PSymbol);
-begin
-end;
-
-constructor TObjectSymbol.InitName(const AName: string);
-begin
-end;
-
-function TObjectSymbol.GetName: string;
-begin
-  GetName:='';
-end;
-
-function TObjectSymbol.GetDescendantCount: sw_integer;
-begin
-  GetDescendantCount:=0;
-end;
-
-function TObjectSymbol.GetDescendant(Index: sw_integer): PObjectSymbol;
-begin
-  GetDescendant:=nil;
-end;
-
-procedure TObjectSymbol.AddDescendant(P: PObjectSymbol);
-begin
-end;
-
-destructor TObjectSymbol.Done;
-begin
-end;
-
-{****************************************************************************
-                                TSourceFile
-****************************************************************************}
-
-constructor TSourceFile.Init(ASourceFileName, AObjFileName, APPUFileName: string);
-begin
-  inherited Init;
-  SourceFileName:=NewStr(ASourceFileName);
-  ObjFileName:=NewStr(AObjFileName);
-  PPUFileName:=NewStr(APPUFileName);
-end;
-
-destructor TSourceFile.Done;
-begin
-  inherited Done;
-  if assigned(SourceFileName) then DisposeStr(SourceFileName);
-  if assigned(ObjFileName) then DisposeStr(ObjFileName);
-  if assigned(PPUFileName) then DisposeStr(PPUFileName);
-end;
-
-function TSourceFile.GetSourceFilename: string;
-begin
-  GetSourceFilename:=GetStr(SourceFileName);
-end;
-
-function TSourceFile.GetObjFileName: string;
-begin
-  GetObjFilename:=GetStr(ObjFileName);
-end;
-
-function TSourceFile.GetPPUFileName: string;
-begin
-  GetPPUFilename:=GetStr(PPUFileName);
-end;
-
-function TSourceFileCollection.At(Index: sw_Integer): PSourceFile;
-begin
-  At:=inherited At(Index);
-end;
-
-{*****************************************************************************
-                              Main Routines
-*****************************************************************************}
-
-procedure CreateBrowserCols;
-begin
-end;
-
-
-function SearchObjectForSymbol(O: PSymbol): PObjectSymbol;
-begin
-  SearchObjectForSymbol:=nil;
-end;
-
-
-{*****************************************************************************
-                                 Load/Store
-*****************************************************************************}
-
-function  LoadBrowserCol(S: PStream): boolean;
-begin
-  LoadBrowserCol:=true;
-end;
-
-function StoreBrowserCol(S: PStream): boolean;
-begin
-  StoreBrowserCol:=true;
-end;
-
-procedure RegisterSymbols;
-begin
-end;
-
-
-{*****************************************************************************
-                                 Initialize
-*****************************************************************************}
-
-var
-  oldexit : pointer;
-
-procedure browcol_exit;{$ifndef FPC}far;{$endif}
-begin
-  exitproc:=oldexit;
-  if assigned(Modules) then
-   begin
-     dispose(Modules,Done);
-     Modules:=nil;
-   end;
-  if assigned(ModuleNames) then
-   begin
-     dispose(ModuleNames,Done);
-     ModuleNames:=nil;
-   end;
-  if assigned(TypeNames) then
-   begin
-     dispose(TypeNames,Done);
-     TypeNames:=nil;
-   end;
-end;
-
-
-procedure InitBrowserCol;
-begin
-  New(Modules, Init(1,1));
-  New(ModuleNames, Init(1,1));
-  New(TypeNames, Init(1,1));
-end;
-
-
-procedure DoneBrowserCol;
-begin
-  CreateBrowserCols;
-end;
-
-
-begin
-  oldexit:=exitproc;
-  exitproc:=@browcol_exit;
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:33  michael
-  + Initial import
-
-  Revision 1.5  2000/01/27 23:42:33  peter
-    * storebrowsercol returns boolean now
-
-  Revision 1.4  1999/08/17 13:25:16  peter
-    * updates with the compiler browcol
-
-  Revision 1.3  1999/08/05 16:54:35  peter
-    * win32 fixes
-
-  Revision 1.2  1999/04/07 21:55:39  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.1  1999/01/28 19:56:12  peter
-    * moved to include compiler/gdb independent of each other
-
-  Revision 1.3  1999/01/22 10:24:16  peter
-    + gdbcon fake unit
-
-  Revision 1.2  1999/01/21 11:54:08  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.1  1999/01/12 15:00:46  peter
-    * fake unit
-
-}

+ 0 - 263
ide/fake/compiler/comphook.pas

@@ -1,263 +0,0 @@
-{
-    $Id$
-
-    Fake comphook unit
-}
-unit comphook;
-interface
-
-Const
-{ <$10000 will show file and line }
-  V_Fatal       = $0;
-  V_Error       = $1;
-  V_Normal      = $2; { doesn't show a text like Error: }
-  V_Warning     = $4;
-  V_Note        = $8;
-  V_Hint        = $10;
-  V_Macro       = $100;
-  V_Procedure   = $200;
-  V_Conditional = $400;
-  V_Info        = $10000;
-  V_Status      = $20000;
-  V_Used        = $40000;
-  V_Tried       = $80000;
-  V_Debug       = $100000;
-
-  V_ShowFile    = $ffff;
-  V_All         = $ffffffff;
-  V_Default     = V_Fatal + V_Error + V_Normal;
-
-type
-  PCompilerStatus = ^TCompilerStatus;
-  TCompilerStatus = record
-  { Current status }
-    currentmodule,
-    currentsourcepath,
-    currentsource : string;   { filename }
-    currentline,
-    currentcolumn : longint;  { current line and column }
-  { Total Status }
-    compiledlines : longint;  { the number of lines which are compiled }
-    errorcount    : longint;  { number of generated errors }
-  { Settings for the output }
-    verbosity     : longint;
-    maxerrorcount : longint;
-    skip_error,
-    use_stderr,
-    use_redir,
-    use_gccoutput : boolean;
-  { Redirection support }
-    redirfile : text;
-  end;
-var
-  status : tcompilerstatus;
-
-{ Default Functions }
-procedure def_stop;
-Function  def_status:boolean;
-Function  def_comment(Level:Longint;const s:string):boolean;
-function  def_internalerror(i:longint):boolean;
-
-{ Function redirecting for IDE support }
-type
-  tstopprocedure         = procedure;
-  tstatusfunction        = function:boolean;
-  tcommentfunction       = function(Level:Longint;const s:string):boolean;
-  tinternalerrorfunction = function(i:longint):boolean;
-const
-  do_stop          : tstopprocedure   = def_stop;
-  do_status        : tstatusfunction  = def_status;
-  do_comment       : tcommentfunction = def_comment;
-  do_internalerror : tinternalerrorfunction = def_internalerror;
-
-
-
-implementation
-
-{$ifdef USEEXCEPT}
-  uses tpexcept;
-{$endif USEEXCEPT}
-
-{****************************************************************************
-                          Helper Routines
-****************************************************************************}
-
-function gccfilename(const s : string) : string;
-var
-  i : longint;
-begin
-  for i:=1to length(s) do
-   begin
-     case s[i] of
-      '\' : gccfilename[i]:='/';
- 'A'..'Z' : gccfilename[i]:=chr(ord(s[i])+32);
-     else
-      gccfilename[i]:=s[i];
-     end;
-   end;
-  {$ifndef TP}
-    {$ifopt H+}
-      setlength(gccfilename,length(s));
-    {$else}
-      gccfilename[0]:=s[0];
-    {$endif}
-  {$else}
-    gccfilename[0]:=s[0];
-  {$endif}
-end;
-
-
-function tostr(i : longint) : string;
-var
-  hs : string;
-begin
-  str(i,hs);
-  tostr:=hs;
-end;
-
-
-{****************************************************************************
-                         Predefined default Handlers
-****************************************************************************}
-
-{ predefined handler when then compiler stops }
-procedure def_stop;
-begin
-{$ifndef USEEXCEPT}
-  Halt(1);
-{$else USEEXCEPT}
-  Halt(1);
-{$endif USEEXCEPT}
-end;
-
-
-function def_status:boolean;
-begin
-  def_status:=false; { never stop }
-{ Status info?, Called every line }
-  if ((status.verbosity and V_Status)<>0) then
-   begin
-     if (status.compiledlines=1) then
-       WriteLn(memavail shr 10,' Kb Free');
-     if (status.currentline>0) and (status.currentline mod 100=0) then
-{$ifdef FPC}
-       WriteLn(status.currentline,' ',memavail shr 10,'/',system.heapsize shr 10,' Kb Free');
-{$else}
-       WriteLn(status.currentline,' ',memavail shr 10,' Kb Free');
-{$endif}
-   end
-end;
-
-
-Function def_comment(Level:Longint;const s:string):boolean;
-const
-  { RHIDE expect gcc like error output }
-  rh_errorstr='error: ';
-  rh_warningstr='warning: ';
-  fatalstr='Fatal: ';
-  errorstr='Error: ';
-  warningstr='Warning: ';
-  notestr='Note: ';
-  hintstr='Hint: ';
-var
-  hs : string;
-begin
-  def_comment:=false; { never stop }
-  if (status.verbosity and Level)=Level then
-   begin
-     hs:='';
-     if not(status.use_gccoutput) then
-       begin
-         if (status.verbosity and Level)=V_Hint then
-           hs:=hintstr;
-         if (status.verbosity and Level)=V_Note then
-           hs:=notestr;
-         if (status.verbosity and Level)=V_Warning then
-           hs:=warningstr;
-         if (status.verbosity and Level)=V_Error then
-           hs:=errorstr;
-         if (status.verbosity and Level)=V_Fatal then
-           hs:=fatalstr;
-       end
-     else
-       begin
-         if (status.verbosity and Level)=V_Hint then
-           hs:=rh_warningstr;
-         if (status.verbosity and Level)=V_Note then
-           hs:=rh_warningstr;
-         if (status.verbosity and Level)=V_Warning then
-           hs:=rh_warningstr;
-         if (status.verbosity and Level)=V_Error then
-           hs:=rh_errorstr;
-         if (status.verbosity and Level)=V_Fatal then
-           hs:=rh_errorstr;
-       end;
-     if (Level<=V_ShowFile) and (status.currentsource<>'') and (status.currentline>0) then
-      begin
-        { Adding the column should not confuse RHIDE,
-        even if it does not yet use it PM
-        but only if it is after error or warning !! PM }
-        if status.currentcolumn>0 then
-         begin
-           if status.use_gccoutput then
-             hs:=gccfilename(status.currentsource)+':'+tostr(status.currentline)+': '+hs
-                 +tostr(status.currentcolumn)+': '
-           else
-             hs:=status.currentsource+'('+tostr(status.currentline)
-                 +','+tostr(status.currentcolumn)+') '+hs;
-         end
-        else
-         begin
-           if status.use_gccoutput then
-             hs:=gccfilename(status.currentsource)+': '+hs+tostr(status.currentline)+': '
-           else
-             hs:=status.currentsource+'('+tostr(status.currentline)+') '+hs;
-         end;
-      end;
-   { add the message to the text }
-     hs:=hs+s;
-{$ifdef FPC}
-     if status.use_stderr then
-      begin
-        writeln(stderr,hs);
-        flush(stderr);
-      end
-     else
-{$endif}
-      begin
-        if status.use_redir then
-         writeln(status.redirfile,hs)
-        else
-         writeln(hs);
-      end;
-   end;
-end;
-
-
-function def_internalerror(i : longint) : boolean;
-begin
-  do_comment(V_Fatal,'Internal error '+tostr(i));
-  def_internalerror:=true;
-end;
-
-
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:33  michael
-  + Initial import
-
-  Revision 1.1  1999/01/28 19:56:12  peter
-    * moved to include compiler/gdb independent of each other
-
-  Revision 1.2  1999/01/14 21:43:08  peter
-    + status.currentsourcepath
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.1  1998/12/10 23:54:28  peter
-    * initial version of the FV IDE
-    * initial version of a fake compiler
-
-}

+ 0 - 60
ide/fake/compiler/compiler.pas

@@ -1,60 +0,0 @@
-{
-    $Id$
-
-    Fake compiler unit
-}
-unit compiler;
-interface
-
-function Compile(const cmd:string):longint;
-
-const
-       { do we need to link }
-       IsExe : boolean = false;
-
-implementation
-uses
-  comphook;
-
-function Compile(const cmd:string):longint;
-begin
-  status.verbosity:=V_Default;
-  status.maxerrorcount:=50;
-  do_comment(V_Error,'Fake Compiler');
-  do_comment(V_Error,'Cmd = "'+cmd+'"');
-  Compile:=0;
-end;
-
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:33  michael
-  + Initial import
-
-  Revision 1.2  1999/11/18 13:38:11  pierre
-   + IsExe var added
-
-  Revision 1.1  1999/01/28 19:56:12  peter
-    * moved to include compiler/gdb independent of each other
-
-  Revision 1.3  1999/01/04 11:49:39  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.2  1998/12/28 15:44:59  peter
-    * use V_Error
-    * set status.verbosity
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.1  1998/12/10 23:54:28  peter
-    * initial version of the FV IDE
-    * initial version of a fake compiler
-
-}

+ 0 - 189
ide/fake/compiler/globtype.pas

@@ -1,189 +0,0 @@
-{
-    $Id$
-    Copyright (c) 1993-98 by Florian Klaempfl, Pierre Muller
-
-    Global types
-
-    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.
- ****************************************************************************
-}
-unit globtype;
-interface
-
-    const
-       maxidlen = 64;
-
-    type
-       { System independent float names }
-{$ifdef i386}
-       bestreal = extended;
-       ts32real = single;
-       ts64real = double;
-       ts80real = extended;
-       ts64comp = extended;
-{$endif}
-{$ifdef m68k}
-       bestreal = real;
-       ts32real = single;
-       ts64real = double;
-       ts80real = extended;
-       ts64comp = comp;
-{$endif}
-{$ifdef alpha}
-       bestreal = extended;
-       ts32real = single;
-       ts64real = double;
-       ts80real = extended;
-       ts64comp = comp;
-{$endif}
-{$ifdef powerpc}
-       bestreal = double;
-       ts32real = single;
-       ts64real = double;
-       ts80real = extended;
-       ts64comp = comp;
-{$endif powerpc}
-       pbestreal=^bestreal;
-
-       { Switches which can be changed locally }
-       tlocalswitch = (cs_localnone,
-         { codegen }
-         cs_check_overflow,cs_check_range,cs_check_io,cs_check_stack,
-         cs_omitstackframe,cs_do_assertion,cs_generate_rtti,
-         { mmx }
-         cs_mmx,cs_mmx_saturation,
-         { parser }
-         cs_typed_addresses,cs_strict_var_strings,cs_ansistrings
-       );
-       tlocalswitches = set of tlocalswitch;
-
-       { Switches which can be changed only at the beginning of a new module }
-       tmoduleswitch = (cs_modulenone,
-         { parser }
-         cs_fp_emulation,cs_extsyntax,cs_openstring,
-         { support }
-         cs_support_inline,cs_support_goto,cs_support_macro,
-         cs_support_c_operators,cs_static_keyword,
-         cs_typed_const_not_changeable,
-         { generation }
-         cs_profile,cs_debuginfo,cs_browser,cs_local_browser,cs_compilesystem,
-         cs_lineinfo,
-         { linking }
-         cs_smartlink
-       );
-       tmoduleswitches = set of tmoduleswitch;
-
-       { Switches which can be changed only for a whole program/compilation,
-         mostly set with commandline }
-       tglobalswitch = (cs_globalnone,
-         { parameter switches }
-         cs_check_unit_name,cs_constructor_name,
-         { units }
-         cs_load_objpas_unit,
-         cs_load_gpc_unit,
-         { optimizer }
-         cs_regalloc,cs_uncertainopts,cs_littlesize,cs_optimize,
-         cs_fastoptimize, cs_slowoptimize,
-         { browser }
-         cs_browser_log,
-         { debugger }
-         cs_gdb_dbx,cs_gdb_gsym,cs_gdb_heaptrc,cs_checkpointer,
-         { assembling }
-         cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
-         cs_asm_regalloc,cs_asm_tempalloc,
-         { linking }
-         cs_link_extern,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
-         cs_link_strip,cs_link_toc
-       );
-       tglobalswitches = set of tglobalswitch;
-
-       { Switches which can be changed by a mode (fpc,tp7,delphi) }
-       tmodeswitch = (m_none,m_all, { needed for keyword }
-         { generic }
-         m_fpc,m_delphi,m_tp,m_gpc,
-         { more specific }
-         m_class,               { delphi class model }
-         m_objpas,              { load objpas unit }
-         m_result,              { result in functions }
-         m_string_pchar,        { pchar 2 string conversion }
-         m_cvar_support,        { cvar variable directive }
-         m_nested_comment,      { nested comments }
-         m_tp_procvar,          { tp style procvars (no @ needed) }
-         m_repeat_forward,      { repeating forward declarations is needed }
-         m_pointer_2_procedure, { allows the assignement of pointers to
-                                  procedure variables                     }
-         m_autoderef,           { does auto dereferencing of struct. vars }
-         m_initfinal,           { initialization/finalization for units }
-         m_add_pointer          { allow pointer add/sub operations }
-       );
-       tmodeswitches = set of tmodeswitch;
-
-       { win32 sub system }
-       tapptype = (at_none,
-         at_gui,at_cui
-       );
-
-       { currently parsed block type }
-       tblock_type = (bt_none,
-         bt_general,bt_type,bt_const
-       );
-
-       { packrecords types }
-       tpackrecords = (packrecord_none,
-         packrecord_1,packrecord_2,packrecord_4,
-         packrecord_8,packrecord_16,packrecord_32,
-         packrecord_C
-       );
-
-    const
-       packrecordalignment : array[tpackrecords] of byte=(0,
-         1,2,4,8,16,32,1
-       );
-
-    type
-       stringid = string[maxidlen];
-
-       tnormalset = set of byte; { 256 elements set }
-       pnormalset = ^tnormalset;
-
-       pdouble    = ^double;
-       pbyte      = ^byte;
-       pword      = ^word;
-       plongint   = ^longint;
-
-    const
-       { link options }
-       link_none    = $0;
-       link_allways = $1;
-       link_static  = $2;
-       link_smart   = $4;
-       link_shared  = $8;
-
-
-implementation
-
-
-begin
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:33  michael
-  + Initial import
-
-  Revision 1.2  1999/09/17 09:16:12  peter
-    * updated with compiler versions
-
-}
-

+ 0 - 1743
ide/fake/compiler/systems.pas

@@ -1,1743 +0,0 @@
-{
-    $Id$
-    Copyright (C) 1995,99 by Florian Klaempfl
-
-    This unit contains information about the target systems supported
-    (these are not processor specific)
-
-    This progsam is free software; you can redistribute it and/or modify
-    iu under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 3 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.
-
- ****************************************************************************
-}
-unit systems;
-
-  interface
-
-   type
-       tendian = (endian_little,endian_big);
-
-       ttargetcpu=(no_cpu
-            ,i386,m68k,alpha,powerpc
-       );
-
-       tprocessors = (no_processor
-            ,Class386,ClassP5,ClassP6
-            ,MC68000,MC68100,MC68020
-       );
-
-       tsection=(sec_none,
-         sec_code,sec_data,sec_bss,
-         sec_idata2,sec_idata4,sec_idata5,sec_idata6,sec_idata7,sec_edata,
-         sec_stab,sec_stabstr
-       );
-
-     type
-       tasmmode= (asmmode_none
-            ,asmmode_i386_direct,asmmode_i386_att,asmmode_i386_intel
-            ,asmmode_m68k_mot,asmmode_alpha_direct,asmmode_powerpc_direct
-       );
-     const
-       {$ifdef i386}  i386asmmodecnt=3;  {$else} i386asmmodecnt=0; {$endif}
-       {$ifdef m68k}  m68kasmmodecnt=1;  {$else} m68kasmmodecnt=0; {$endif}
-       {$ifdef alpha} alphaasmmodecnt=1; {$else} alphaasmmodecnt=0; {$endif}
-       {$ifdef powerpc} powerpcasmmodecnt=1; {$else} powerpcasmmodecnt=0; {$endif}
-       asmmodecnt=i386asmmodecnt+m68kasmmodecnt+Alphaasmmodecnt+powerpcasmmodecnt+1;
-
-     type
-       ttarget = (target_none
-            ,target_i386_GO32V1,target_i386_GO32V2,target_i386_linux,
-            target_i386_OS2,target_i386_Win32
-            ,target_m68k_Amiga,target_m68k_Atari,target_m68k_Mac,
-            target_m68k_linux,target_m68k_PalmOS,target_alpha_linux,
-            target_powerpc_linux
-       );
-
-       ttargetflags = (tf_none,
-            tf_supports_stack_checking,tf_need_export,tf_needs_isconsole
-       );
-
-     const
-       {$ifdef i386} i386targetcnt=5; {$else} i386targetcnt=0; {$endif}
-       {$ifdef m68k} m68ktargetcnt=5; {$else} m68ktargetcnt=0; {$endif}
-       {$ifdef alpha} alphatargetcnt=1; {$else} alphatargetcnt=0; {$endif}
-       {$ifdef powerpc} powerpctargetcnt=1; {$else} powerpctargetcnt=0; {$endif}
-       targetcnt=i386targetcnt+m68ktargetcnt+alphatargetcnt+powerpctargetcnt+1;
-
-     type
-       tasm = (as_none
-            ,as_i386_as,as_i386_as_aout,as_i386_asw,
-            as_i386_nasmcoff,as_i386_nasmelf,as_i386_nasmobj,
-            as_i386_tasm,as_i386_masm,
-            as_i386_dbg,as_i386_coff,as_i386_pecoff
-            ,as_m68k_as,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw,
-            as_alpha_as,as_powerpc_as
-       );
-       { binary assembler writers, needed to test for -a }
-     const
-       {$ifdef i386} i386asmcnt=11; {$else} i386asmcnt=0; {$endif}
-       {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
-       {$ifdef alpha} alphaasmcnt=1; {$else} alphaasmcnt=0; {$endif}
-       {$ifdef powerpc} powerpcasmcnt=1; {$else} powerpcasmcnt=0; {$endif}
-       asmcnt=i386asmcnt+m68kasmcnt+alphaasmcnt+powerpcasmcnt+1;
-
-       binassem : set of tasm = [
-         as_i386_dbg,as_i386_coff,as_i386_pecoff
-       ];
-
-     type
-       tlink = (link_none
-            ,link_i386_ld,link_i386_ldgo32v1,
-            link_i386_ldgo32v2,link_i386_ldw,
-            link_i386_ldos2
-            ,link_m68k_ld,link_alpha_ld,link_powerpc_ld
-       );
-     const
-       {$ifdef i386} i386linkcnt=5; {$else} i386linkcnt=0; {$endif}
-       {$ifdef m68k} m68klinkcnt=1; {$else} m68klinkcnt=0; {$endif}
-       {$ifdef alpha} alphalinkcnt=1; {$else} alphalinkcnt=0; {$endif}
-       {$ifdef powerpc} powerpclinkcnt=1; {$else} powerpclinkcnt=0; {$endif}
-       linkcnt=i386linkcnt+m68klinkcnt+alphalinkcnt+powerpclinkcnt+1;
-
-     type
-       tar = (ar_none
-            ,ar_i386_ar,ar_i386_arw
-            ,ar_m68k_ar,ar_alpha_ar,ar_powerpc_ar
-       );
-     const
-       {$ifdef i386} i386arcnt=2; {$else} i386arcnt=0; {$endif}
-       {$ifdef m68k} m68karcnt=1; {$else} m68karcnt=0; {$endif}
-       {$ifdef alpha} alphaarcnt=1; {$else} alphaarcnt=0; {$endif}
-       {$ifdef powerpc} powerpcarcnt=1; {$else} powerpcarcnt=0; {$endif}
-       arcnt=i386arcnt+m68karcnt+alphaarcnt+powerpcarcnt+1;
-
-     type
-       tres = (res_none
-            ,res_i386_windres
-       );
-     const
-       {$ifdef i386} i386rescnt=1; {$else} i386rescnt=0; {$endif}
-       {$ifdef m68k} m68krescnt=0; {$else} m68krescnt=0; {$endif}
-       {$ifdef alpha} alpharescnt=0; {$else} alpharescnt=0; {$endif}
-       {$ifdef powerpc} powerpcrescnt=0; {$else} powerpcrescnt=0; {$endif}
-       rescnt=i386rescnt+m68krescnt+alpharescnt+powerpcrescnt+1;
-
-     type
-       tos = ( os_none,
-            os_i386_GO32V1,os_i386_GO32V2,os_i386_Linux,os_i386_OS2,
-            os_i386_Win32,
-            os_m68k_Amiga,os_m68k_Atari,os_m68k_Mac,os_m68k_Linux,
-            os_m68k_PalmOS,os_alpha_linux,os_powerpc_linux
-       );
-     const
-       i386oscnt=5;
-       m68koscnt=5;
-       alphaoscnt=1;
-       powerpcoscnt=1;
-       oscnt=i386oscnt+m68koscnt+alphaoscnt+powerpcoscnt+1;
-
-   type
-       tosinfo = packed record
-          id    : tos;
-          name      : string[30];
-          shortname : string[8];
-          sharedlibext : string[10];
-          staticlibext,
-          sourceext,
-          pasext,
-          exeext,
-          defext,
-          scriptext : string[4];
-          libprefix : string[3];
-          Cprefix   : string[2];
-          newline   : string[2];
-          endian    : tendian;
-          stackalignment : {longint this is a little overkill no ?? }byte;
-          size_of_pointer : byte;
-          size_of_longint : byte;
-          use_bound_instruction : boolean;
-          use_function_relative_addresses : boolean;
-       end;
-
-       tasminfo = packed record
-          id      : tasm;
-          idtxt       : string[8];
-          asmbin      : string[8];
-          asmcmd      : string[50];
-          allowdirect,
-          externals,
-          needar      : boolean;
-          labelprefix : string[2];
-          comment     : string[2];
-          secnames    : array[tsection] of string[20];
-       end;
-
-       tlinkinfo = packed record
-          id        : tlink;
-          linkbin       : string[8];
-          linkcmd       : string[127];
-          binders       : word;
-          bindbin       : array[1..2]of string[8];
-          bindcmd       : array[1..2]of string[127];
-          stripopt      : string[2];
-          stripbind     : boolean;     { Strip symbols in binder? }
-          libpathprefix : string[13];
-          libpathsuffix : string[2];
-          groupstart    : string[8];
-          groupend      : string[2];
-          inputstart    : string[8];
-          inputend      : string[2];
-          libprefix     : string[2];
-       end;
-
-       tarinfo = packed record
-          id      : tar;
-          arbin   : string[8];
-          arcmd   : string[50];
-       end;
-
-       tresinfo = packed record
-          id      : tres;
-          resbin  : string[8];
-          rescmd  : string[50];
-       end;
-
-       ttargetinfo = packed record
-          target      : ttarget;
-          flags       : set of ttargetflags;
-          cpu         : ttargetcpu;
-          short_name  : string[8];
-          unit_env    : string[12];
-          system_unit : string[8];
-          smartext,
-          unitext,
-          unitlibext,
-          asmext,
-          objext,
-          resext,
-          resobjext,
-          exeext      : string[4];
-          os          : tos;
-          link        : tlink;
-          assem       : tasm;
-          assemsrc    : tasm; { default source writing assembler }
-          ar          : tar;
-          res         : tres;
-          heapsize,
-          maxheapsize,
-          stacksize   : longint;
-       end;
-
-       tasmmodeinfo=packed record
-          id    : tasmmode;
-          idtxt : string[8];
-       end;
-
-    var
-       target_cpu  : ttargetcpu;
-       target_info : ttargetinfo;
-       target_os   : tosinfo;
-       target_asm  : tasminfo;
-       target_link : tlinkinfo;
-       target_ar   : tarinfo;
-       target_res  : tresinfo;
-       target_path : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
-       source_os   : tosinfo;
-
-    function set_target_os(t:tos):boolean;
-    function set_target_asm(t:tasm):boolean;
-    function set_target_link(t:tlink):boolean;
-    function set_target_ar(t:tar):boolean;
-    function set_target_res(t:tres):boolean;
-    function set_target_info(t:ttarget):boolean;
-
-    function set_string_target(s : string) : boolean;
-    function set_string_asm(s : string) : boolean;
-    function set_string_asmmode(s:string;var t:tasmmode):boolean;
-
-    procedure InitSystems;
-
-
-implementation
-
-    const
-
-{****************************************************************************
-                                 OS Info
-****************************************************************************}
-       os_infos : array[1..oscnt] of tosinfo = (
-          (
-            id     : os_none;
-            name         : 'No operating system';
-            shortname    : 'none'
-          ),
-          (
-            id     : os_i386_go32v1;
-            name         : 'GO32 V1 DOS extender';
-            shortname    : 'go32v1';
-            sharedlibext : '.dll';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';      { No .exe, the linker only output a.out ! }
-            defext       : '.def';
-            scriptext    : '.bat';
-            libprefix    : '';
-            Cprefix      : '_';
-            newline      : #13#10;
-            endian       : endian_little;
-            stackalignment : 2;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : true
-          ),
-          (
-            id     : os_i386_go32v2;
-            name         : 'GO32 V2 DOS extender';
-            shortname    : 'go32v2';
-            sharedlibext : '.dll';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '.exe';
-            defext       : '.def';
-            scriptext    : '.bat';
-            libprefix    : '';
-            Cprefix      : '_';
-            newline      : #13#10;
-            endian       : endian_little;
-            stackalignment : 2;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : true
-          ),
-          (
-            id     : os_i386_linux;
-            name         : 'Linux for i386';
-            shortname    : 'linux';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            libprefix    : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            endian       : endian_little;
-            stackalignment : 4;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : true
-          ),
-          (
-            id     : os_i386_os2;
-            name         : 'OS/2 via EMX';
-            shortname    : 'os2';
-            sharedlibext : '.ao2';
-            staticlibext : '.ao2';
-            sourceext    : '.pas';
-            pasext       : '.pp';
-            exeext       : '.exe';
-            defext       : '.def';
-            scriptext    : '.cmd';
-            libprefix    : '';
-            Cprefix      : '_';
-            newline      : #13#10;
-            endian       : endian_little;
-            stackalignment : 2;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : false
-          ),
-          (
-            id     : os_i386_win32;
-            name         : 'Win32 for i386';
-            shortname    : 'win32';
-            sharedlibext : '.dll';
-            staticlibext : '.aw';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '.exe';
-            defext       : '.def';
-            scriptext    : '.bat';
-            libprefix    : 'lib';
-            Cprefix      : '_';
-            newline      : #13#10;
-            endian       : endian_little;
-            stackalignment : 4;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : true
-          ),
-          (
-            id     : os_m68k_amiga;
-            name         : 'Commodore Amiga';
-            shortname    : 'amiga';
-            sharedlibext : '.library';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '';
-            scriptext    : '';
-            libprefix    : '';
-            Cprefix      : '_';
-            newline      : #10;
-            endian       : endian_big;
-            stackalignment : 2;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : false
-          ),
-          (
-            id     : os_m68k_atari;
-            name         : 'Atari ST/STE';
-            shortname    : 'atari';
-            sharedlibext : '.dll';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '.tpp';
-            defext       : '';
-            scriptext    : '';
-            libprefix    : '';
-            Cprefix      : '_';
-            newline      : #10;
-            endian       : endian_big;
-            stackalignment : 2;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : false
-          ),
-          (
-            id     : os_m68k_mac;
-            name         : 'Macintosh m68k';
-            shortname    : 'mac';
-            sharedlibext : '.dll';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '.tpp';
-            defext       : '';
-            scriptext    : '';
-            libprefix    : '';
-            Cprefix      : '_';
-            newline      : #13;
-            endian       : endian_big;
-            stackalignment : 2;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : false
-          ),
-          (
-            id     : os_m68k_linux;
-            name         : 'Linux for m68k';
-            shortname    : 'linux';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '';
-            scriptext    : '.sh';
-            libprefix    : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            endian       : endian_big;
-            stackalignment : 2;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : true
-          ),
-          (
-            id     : os_m68k_palmos;
-            name         : 'PalmOS';
-            shortname    : 'palmos';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '';
-            scriptext    : '.sh';
-            libprefix    : 'lib';
-            Cprefix      : '_';
-            newline      : #10;
-            endian       : endian_big;
-            stackalignment : 2;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : false
-          ),
-          (
-            id     : os_alpha_linux;
-            name         : 'Linux for Alpha';
-            shortname    : 'axplinux';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            libprefix    : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            endian       : endian_little;
-            stackalignment : 8;
-            size_of_pointer : 8;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : true
-          ),
-          (
-            id     : os_powerpc_linux;
-            name         : 'Linux for PowerPC';
-            shortname    : 'linuxppc';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            libprefix    : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            endian       : endian_big;
-            stackalignment : 8;
-            size_of_pointer : 4;
-            size_of_longint : 4;
-            use_bound_instruction : false;
-            use_function_relative_addresses : true
-          )
-          );
-
-
-{****************************************************************************
-                             Assembler Info
-****************************************************************************}
-
-       as_infos : array[1..asmcnt] of tasminfo = (
-          (
-            id     : as_none;
-            idtxt  : 'no'
-          )
-{$ifdef i386}
-          ,(
-            id     : as_i386_as;
-            idtxt  : 'AS';
-            asmbin : 'as';
-            asmcmd : '-o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : '.L';
-            comment : '# ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '','','','','','',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_i386_as_aout;
-            idtxt  : 'AS_AOUT';
-            asmbin : 'as';
-            asmcmd : '-o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : 'L';
-            comment : '# ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '','','','','','',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_i386_asw;
-            idtxt  : 'ASW';
-            asmbin : 'asw';
-            asmcmd : '-o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : '.L';
-            comment : '# ';
-            secnames : ('',
-              '.text','.data','.section .bss',
-              '.section .idata$2','.section .idata$4','.section .idata$5',
-                '.section .idata$6','.section .idata$7','.section .edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_i386_nasmcoff;
-            idtxt  : 'NASMCOFF';
-            asmbin : 'nasm';
-            asmcmd : '-f coff -o $OBJ $ASM';
-            allowdirect : true;
-            externals : true;
-            needar : true;
-            labelprefix : 'L';
-            comment : '; ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_i386_nasmelf;
-            idtxt  : 'NASMELF';
-            asmbin : 'nasm';
-            asmcmd : '-f elf -o $OBJ $ASM';
-            allowdirect : true;
-            externals : true;
-            needar : true;
-            labelprefix : 'L';
-            comment : '; ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_i386_nasmobj;
-            idtxt  : 'NASMOBJ';
-            asmbin : 'nasm';
-            asmcmd : '-f obj -o $OBJ $ASM';
-            allowdirect : true;
-            externals : true;
-            needar : true;
-            labelprefix : 'L';
-            comment : '; ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_i386_tasm;
-            idtxt  : 'TASM';
-            asmbin : 'tasm';
-            asmcmd : '/m2 $ASM $OBJ';
-            allowdirect : true;
-            externals : true;
-            needar : true;
-            labelprefix : '@@';
-            comment : '; ';
-            secnames : ('',
-              'CODE','DATA','BSS',
-              '','','','','','',
-              '','')
-          )
-          ,(
-            id     : as_i386_masm;
-            idtxt  : 'MASM';
-            asmbin : 'masm';
-            asmcmd : '$ASM $OBJ';
-            allowdirect : true;
-            externals : true;
-            needar : true;
-            labelprefix : '.L';
-            comment : '; ';
-            secnames : ('',
-              'CODE','DATA','BSS',
-              '','','','','','',
-              '','')
-          )
-          ,(
-            id     : as_i386_dbg;
-            idtxt  : 'DBG';
-            asmbin : '';
-            asmcmd : '';
-            allowdirect : false;
-            externals : true;
-            needar : false;
-            labelprefix : 'L';
-            comment : '';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_i386_coff;
-            idtxt  : 'COFF';
-            asmbin : '';
-            asmcmd : '';
-            allowdirect : false;
-            externals : true;
-            needar : false;
-            labelprefix : '.L';
-            comment : '';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_i386_pecoff;
-            idtxt  : 'PECOFF';
-            asmbin : '';
-            asmcmd : '';
-            allowdirect : false;
-            externals : true;
-            needar : false;
-            labelprefix : '.L';
-            comment : '';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
-              '.stab','.stabstr')
-          )
-{$endif i386}
-{$ifdef m68k}
-          ,(
-            id     : as_m68k_as;
-            idtxt  : 'AS';
-            asmbin : 'as';
-            asmcmd : '-o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : '.L';
-            comment : '# ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_m68k_gas;
-            idtxt  : 'GAS';
-            asmbin : 'as68k'; { Gas for the Amiga}
-            asmcmd : '--register-prefix-optional -o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : '.L';
-            comment : '| ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_m68k_mit;
-            idtxt  : 'MIT';
-            asmbin : '';
-            asmcmd : '-o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : '.L';
-            comment : '| ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_m68k_mot;
-            idtxt  : 'MOT';
-            asmbin : '';
-            asmcmd : '-o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : '__L';
-            comment : '| ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
-              '.stab','.stabstr')
-          )
-          ,(
-            id     : as_m68k_mpw;
-            idtxt  : 'MPW';
-            asmbin : '';
-            asmcmd : '-model far -o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : '__L';
-            comment : '| ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
-              '.stab','.stabstr')
-          )
-{$endif m68k}
-{$ifdef alpha}
-          ,(
-            id     : as_alpha_as;
-            idtxt  : 'AS';
-            asmbin : 'as';
-            asmcmd : '-o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : '.L';
-            comment : '# ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '','','','','','',
-              '.stab','.stabstr')
-          )
-{$endif}
-{$ifdef powerpc}
-          ,(
-            id     : as_powerpc_as;
-            idtxt  : 'AS';
-            asmbin : 'as';
-            asmcmd : '-o $OBJ $ASM';
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix : '.L';
-            comment : '# ';
-            secnames : ('',
-              '.text','.data','.bss',
-              '','','','','','',
-              '.stab','.stabstr')
-          )
-{$endif}
-          );
-
-
-{****************************************************************************
-                            Linker Info
-****************************************************************************}
-
-       link_infos : array[1..linkcnt] of tlinkinfo = (
-          (
-            id      : link_none
-          )
-{$ifdef i386}
-          ,(
-            id      : link_i386_ld;
-            linkbin : 'ld';
-            linkcmd : '$OPT -o $EXE $RES';
-            binders : 0;
-            bindbin : ('','');
-            bindcmd : ('','');
-            stripopt   : '-s';
-            stripbind  : false;
-            libpathprefix : 'SEARCH_DIR(';
-            libpathsuffix : ')';
-            groupstart : 'GROUP(';
-            groupend   : ')';
-            inputstart : 'INPUT(';
-            inputend   : ')';
-            libprefix  : '-l'
-          )
-          ,(
-            id      : link_i386_ldgo32v1;
-            linkbin : 'ld';
-            linkcmd : '-oformat coff-go32 $OPT -o $EXE @$RES';
-            binders : 1;
-            bindbin : ('aout2exe','');
-            bindcmd : ('$EXE','');
-            stripopt   : '-s';
-            stripbind  : false;
-            libpathprefix : '-L';
-            libpathsuffix : '';
-            groupstart : '-(';
-            groupend   : '-)';
-            inputstart : '';
-            inputend   : '';
-            libprefix  : '-l'
-          )
-          ,(
-            id      : link_i386_ldgo32v2;
-            linkbin : 'ld';
-            linkcmd : '-oformat coff-go32-exe $OPT -o $EXE @$RES';
-            binders:0;
-            bindbin : ('','');
-            bindcmd : ('','');
-            stripopt   : '-s';
-            stripbind  : false;
-            libpathprefix : '-L';
-            libpathsuffix : '';
-            groupstart : '-(';
-            groupend   : '-)';
-            inputstart : '';
-            inputend   : '';
-            libprefix  : '-l'
-          )
-          ,(
-            id      : link_i386_ldw;
-            linkbin : 'ldw';
-            linkcmd : '$OPT -o $EXE $RES';
-            binders : 0;
-            bindbin : ('dlltool','ldw');
-            bindcmd : ('--as asw.exe --dllname $EXE --output-exp exp.$$$',
-                       '$OPT -o $EXE $RES exp.$$$');
-            stripopt   : '-s';
-            stripbind  : false;
-            libpathprefix : 'SEARCH_DIR(';
-            libpathsuffix : ')';
-            groupstart : 'GROUP(';
-            groupend   : ')';
-            inputstart : 'INPUT(';
-            inputend   : ')';
-            libprefix  : '-l'
-          )
-          ,(
-            id      : link_i386_ldos2;
-            linkbin : 'ld';  { Os/2 }
-            linkcmd : '-o $EXE @$RES';
-            binders : 1;
-            bindbin : ('emxbind','');
-            bindcmd : ('-b $STRIP$PM -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB',
-                       '');
-            stripopt   : '-s';
-            stripbind  : true;
-            libpathprefix : '-L';
-            libpathsuffix : '';
-            groupstart : ''; {Linker is too primitive...}
-            groupend   : '';
-            inputstart : '';
-            inputend   : '';
-            libprefix  : '-l'
-          )
-{$endif i386}
-{$ifdef m68k}
-          ,(
-            id      : link_m68k_ld;
-            linkbin : 'ld';
-            linkcmd : '$OPT -o $EXE $RES';
-            binders:0;
-            bindbin : ('','');
-            bindcmd : ('','');
-            stripopt   : '-s';
-            stripbind  : false;
-            libpathprefix : 'SEARCH_DIR(';
-            libpathsuffix : ')';
-            groupstart : 'GROUP(';
-            groupend   : ')';
-            inputstart : 'INPUT(';
-            inputend   : ')';
-            libprefix  : '-l'
-          )
-{$endif m68k}
-{$ifdef alpha}
-          ,(
-            id      : link_alpha_ld;
-            linkbin : 'ld';
-            linkcmd : '$OPT -o $EXE $RES';
-            binders : 0;
-            bindbin : ('','');
-            bindcmd : ('','');
-            stripopt   : '-s';
-            stripbind  : false;
-            libpathprefix : 'SEARCH_DIR(';
-            libpathsuffix : ')';
-            groupstart : 'GROUP(';
-            groupend   : ')';
-            inputstart : 'INPUT(';
-            inputend   : ')';
-            libprefix  : '-l'
-          )
-{$endif}
-{$ifdef powerpc}
-          ,(
-            id      : link_powerpc_ld;
-            linkbin : 'ld';
-            linkcmd : '$OPT -o $EXE $RES';
-            binders : 0;
-            bindbin : ('','');
-            bindcmd : ('','');
-            stripopt   : '-s';
-            stripbind  : false;
-            libpathprefix : 'SEARCH_DIR(';
-            libpathsuffix : ')';
-            groupstart : 'GROUP(';
-            groupend   : ')';
-            inputstart : 'INPUT(';
-            inputend   : ')';
-            libprefix  : '-l'
-          )
-{$endif}
-          );
-
-{****************************************************************************
-                                 Ar Info
-****************************************************************************}
-       ar_infos : array[1..arcnt] of tarinfo = (
-          (
-            id    : ar_none
-          )
-{$ifdef i386}
-          ,(
-            id    : ar_i386_ar;
-            arbin : 'ar';
-            arcmd : 'rs $LIB $FILES'
-          ),
-          (
-            id    : ar_i386_arw;
-            arbin : 'arw';
-            arcmd : 'rs $LIB $FILES'
-          )
-{$endif i386}
-{$ifdef m68k}
-          ,(
-            id    : ar_m68k_ar;
-            arbin : 'ar';
-            arcmd : 'rs $LIB $FILES'
-          )
-{$endif m68k}
-{$ifdef alpha}
-          ,(
-            id    : ar_alpha_ar;
-            arbin : 'ar';
-            arcmd : 'rs $LIB $FILES'
-          )
-{$endif}
-{$ifdef powerpc}
-          ,(
-            id    : ar_powerpc_ar;
-            arbin : 'ar';
-            arcmd : 'rs $LIB $FILES'
-          )
-{$endif}
-          );
-
-
-{****************************************************************************
-                                 Res Info
-****************************************************************************}
-       res_infos : array[1..rescnt] of tresinfo = (
-          (
-            id     : res_none
-          )
-{$ifdef i386}
-          ,(
-            id     : res_i386_windres;
-            resbin : 'windres';
-            rescmd : '--include $INC -O coff -o $OBJ $RES'
-          )
-{$endif i386}
-          );
-
-
-{****************************************************************************
-                            Targets Info
-****************************************************************************}
-       target_infos : array[1..targetcnt] of ttargetinfo = (
-          (
-            target      : target_none;
-            flags       : [];
-            cpu  : no_cpu;
-            short_name  : 'notarget'
-          )
-{$ifdef i386}
-          ,(
-            target      : target_i386_GO32V1;
-            flags       : [];
-            cpu         : i386;
-            short_name  : 'GO32V1';
-            unit_env    : 'GO32V1UNITS';
-            system_unit : 'SYSTEM';
-            smartext    : '.sl';
-            unitext     : '.pp1';
-            unitlibext  : '.ppl';
-            asmext      : '.s1';
-            objext      : '.o1';
-            resext      : '.res';
-            resobjext   : '.o1r';
-            exeext      : ''; { The linker produces a.out }
-            os          : os_i386_GO32V1;
-            link        : link_i386_ldgo32v1;
-            assem       : as_i386_as;
-            assemsrc    : as_i386_as;
-            ar          : ar_i386_ar;
-            res         : res_none;
-            heapsize    : 2048*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 16384
-          ),
-          (
-            target      : target_i386_GO32V2;
-            flags       : [];
-            cpu         : i386;
-            short_name  : 'GO32V2';
-            unit_env    : 'GO32V2UNITS';
-            system_unit : 'SYSTEM';
-            smartext    : '.sl';
-            unitext     : '.ppu';
-            unitlibext  : '.ppl';
-            asmext      : '.s';
-            objext      : '.o';
-            resext      : '.res';
-            resobjext   : '.or';
-            exeext      : '.exe';
-            os          : os_i386_GO32V2;
-            link        : link_i386_ldgo32v2;
-            assem       : as_i386_coff;
-            assemsrc    : as_i386_as;
-            ar          : ar_i386_ar;
-            res         : res_none;
-            heapsize    : 2048*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 16384
-          ),
-          (
-            target      : target_i386_LINUX;
-            flags       : [];
-            cpu         : i386;
-            short_name  : 'LINUX';
-            unit_env    : 'LINUXUNITS';
-            system_unit : 'syslinux';
-            smartext    : '.sl';
-            unitext     : '.ppu';
-            unitlibext  : '.ppl';
-            asmext      : '.s';
-            objext      : '.o';
-            resext      : '.res';
-            resobjext   : '.or';
-            exeext      : '';
-            os          : os_i386_Linux;
-            link        : link_i386_ld;
-            assem       : as_i386_as;
-            assemsrc    : as_i386_as;
-            ar          : ar_i386_ar;
-            res         : res_none;
-            heapsize    : 256*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 8192
-          ),
-          (
-            target      : target_i386_OS2;
-            flags       : [tf_need_export];
-            cpu  : i386;
-            short_name  : 'OS2';
-            unit_env    : 'OS2UNITS';
-            system_unit : 'SYSOS2';
-            smartext    : '.sl';
-            unitext     : '.ppo';
-            unitlibext  : '.ppl';
-            asmext      : '.so2';
-            objext      : '.oo2';
-            resext      : '.res';
-            resobjext   : '.oor';
-            exeext      : ''; { The linker produces a.out }
-            os          : os_i386_OS2;
-            link        : link_i386_ldos2;
-            assem       : as_i386_as_aout;
-            assemsrc    : as_i386_as_aout;
-            ar          : ar_i386_ar;
-            res         : res_none;
-            heapsize    : 256*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 32768
-          ),
-          (
-            target      : target_i386_WIN32;
-            flags       : [];
-            cpu         : i386;
-            short_name  : 'WIN32';
-            unit_env    : 'WIN32UNITS';
-            system_unit : 'SYSWIN32';
-            smartext    : '.slw';
-            unitext     : '.ppw';
-            unitlibext  : '.ppl';
-            asmext      : '.sw';
-            objext      : '.ow';
-            resext      : '.rc';
-            resobjext   : '.owr';
-            exeext      : '.exe';
-            os          : os_i386_Win32;
-            link        : link_i386_ldw;
-            assem       : as_i386_pecoff;
-            assemsrc    : as_i386_asw;
-            ar          : ar_i386_arw;
-            res         : res_i386_windres;
-            heapsize    : 256*1024;
-            maxheapsize : 32*1024*1024;
-            stacksize   : 32*1024*1024
-          )
-{$endif i386}
-{$ifdef m68k}
-          ,(
-            target      : target_m68k_Amiga;
-            flags       : [];
-            cpu         : m68k;
-            short_name  : 'AMIGA';
-            unit_env    : '';
-            system_unit : 'sysamiga';
-            smartext    : '.sl';
-            unitext     : '.ppa';
-            unitlibext  : '.ppl';
-            asmext      : '.asm';
-            objext      : '.o';
-            resext      : '.res';
-            resobjext   : '.or';
-            exeext      : '';
-            os          : os_m68k_Amiga;
-            link        : link_m68k_ld;
-            assem       : as_m68k_as;
-            assemsrc    : as_m68k_as;
-            ar          : ar_m68k_ar;
-            res         : res_none;
-            heapsize    : 128*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 8192
-          ),
-          (
-            target      : target_m68k_Atari;
-            flags       : [];
-            cpu         : m68k;
-            short_name  : 'ATARI';
-            unit_env    : '';
-            system_unit : 'SYSATARI';
-            smartext    : '.sl';
-            unitext     : '.ppt';
-            unitlibext  : '.ppl';
-            asmext      : '.s';
-            objext      : '.o';
-            resext      : '.res';
-            resobjext   : '.or';
-            exeext      : '.ttp';
-            os          : os_m68k_Atari;
-            link        : link_m68k_ld;
-            assem       : as_m68k_as;
-            assemsrc    : as_m68k_as;
-            ar          : ar_m68k_ar;
-            res         : res_none;
-            heapsize    : 16*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 8192
-          ),
-          (
-            target      : target_m68k_Mac;
-            flags       : [];
-            cpu         : m68k;
-            short_name  : 'MACOS';
-            unit_env    : '';
-            system_unit : 'sysmac';
-            smartext    : '.sl';
-            unitext     : '.ppt';
-            unitlibext  : '.ppl';
-            asmext      : '.a';
-            objext      : '.o';
-            resext      : '.res';
-            resobjext   : '.or';
-            exeext      : '';
-            os          : os_m68k_Mac;
-            link        : link_m68k_ld;
-            assem       : as_m68k_mpw;
-            assemsrc    : as_m68k_mpw;
-            ar          : ar_m68k_ar;
-            res         : res_none;
-            heapsize    : 128*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 8192
-          ),
-          (
-            target      : target_m68k_linux;
-            flags       : [];
-            cpu         : m68k;
-            short_name  : 'LINUX';
-            unit_env    : 'LINUXUNITS';
-            system_unit : 'syslinux';
-            smartext    : '.sl';
-            unitext     : '.ppu';
-            unitlibext  : '.ppl';
-            asmext      : '.s';
-            objext      : '.o';
-            resext      : '.res';
-            resobjext   : '.or';
-            exeext      : '';
-            os          : os_m68k_Linux;
-            link        : link_m68k_ld;
-            assem       : as_m68k_as;
-            assemsrc    : as_m68k_as;
-            ar          : ar_m68k_ar;
-            res         : res_none;
-            heapsize    : 128*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 8192
-          ),
-          (
-            target      : target_m68k_PalmOS;
-            flags       : [];
-            cpu         : m68k;
-            short_name  : 'PALMOS';
-            unit_env    : 'PALMUNITS';
-            system_unit : 'syspalm';
-            smartext    : '.sl';
-            unitext     : '.ppu';
-            unitlibext  : '.ppl';
-            asmext      : '.s';
-            objext      : '.o';
-            resext      : '.res';
-            resobjext   : '.or';
-            exeext      : '';
-            os          : os_m68k_PalmOS;
-            link        : link_m68k_ld;
-            assem       : as_m68k_as;
-            assemsrc    : as_m68k_as;
-            ar          : ar_m68k_ar;
-            res         : res_none;
-            heapsize    : 128*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 8192
-          )
-{$endif m68k}
-{$ifdef alpha}
-          ,(
-            target      : target_alpha_LINUX;
-            flags       : [];
-            cpu         : alpha;
-            short_name  : 'LINUX';
-            unit_env    : 'LINUXUNITS';
-            system_unit : 'syslinux';
-            smartext    : '.sl';
-            unitext     : '.ppu';
-            unitlibext  : '.ppl';
-            asmext      : '.s';
-            objext      : '.o';
-            resext      : '.res';
-            resobjext   : '.or';
-            exeext      : '';
-            os          : os_alpha_Linux;
-            link        : link_alpha_ld;
-            assem       : as_alpha_as;
-            assemsrc    : as_alpha_as;
-            ar          : ar_alpha_ar;
-            res         : res_none;
-            heapsize    : 256*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 8192
-          )
-{$endif}
-{$ifdef powerpc}
-          ,(
-            target      : target_powerpc_LINUX;
-            flags       : [];
-            cpu         : alpha;
-            short_name  : 'LINUX';
-            unit_env    : 'LINUXUNITS';
-            system_unit : 'syslinux';
-            smartext    : '.sl';
-            unitext     : '.ppu';
-            unitlibext  : '.ppl';
-            asmext      : '.s';
-            objext      : '.o';
-            resext      : '.res';
-            resobjext   : '.or';
-            exeext      : '';
-            os          : os_powerpc_Linux;
-            link        : link_powerpc_ld;
-            assem       : as_powerpc_as;
-            assemsrc    : as_powerpc_as;
-            ar          : ar_powerpc_ar;
-            res         : res_none;
-            heapsize    : 256*1024;
-            maxheapsize : 32768*1024;
-            stacksize   : 8192
-          )
-{$endif}
-          );
-
-{****************************************************************************
-                             AsmModeInfo
-****************************************************************************}
-       asmmodeinfos : array[1..asmmodecnt] of tasmmodeinfo = (
-          (
-            id    : asmmode_none;
-            idtxt : 'none'
-          )
-{$ifdef i386}
-          ,(
-            id    : asmmode_i386_direct;
-            idtxt : 'DIRECT'
-          ),
-          (
-            id    : asmmode_i386_att;
-            idtxt : 'ATT'
-          ),
-          (
-            id    : asmmode_i386_intel;
-            idtxt : 'INTEL'
-          )
-{$endif i386}
-{$ifdef m68k}
-          ,(
-            id    : asmmode_m68k_mot;
-            idtxt : 'MOT'
-          )
-{$endif m68k}
-{$ifdef alpha}
-          ,(
-            id    : asmmode_alpha_direct;
-            idtxt : 'DIRECT'
-          )
-{$endif}
-{$ifdef powerpc}
-          ,(
-            id    : asmmode_powerpc_direct;
-            idtxt : 'DIRECT'
-          )
-{$endif}
-          );
-
-{****************************************************************************
-                                Helpers
-****************************************************************************}
-
-function upper(const s : string) : string;
-var
-  i  : longint;
-begin
-  for i:=1 to length(s) do
-   if s[i] in ['a'..'z'] then
-    upper[i]:=char(byte(s[i])-32)
-   else
-    upper[i]:=s[i];
-{$ifndef TP}
-  {$ifopt H+}
-    SetLength(upper,length(s));
-  {$else}
-    upper[0]:=s[0];
-  {$endif}
-{$else}
-  upper[0]:=s[0];
-{$endif}
-end;
-
-function lower(const s : string) : string;
-var
-  i : longint;
-begin
-  for i:=1 to length(s) do
-   if s[i] in ['A'..'Z'] then
-    lower[i]:=char(byte(s[i])+32)
-   else
-    lower[i]:=s[i];
-  {$ifndef TP}
-    {$ifopt H+}
-      setlength(lower,length(s));
-    {$else}
-      lower[0]:=s[0];
-    {$endif}
-  {$else}
-    lower[0]:=s[0];
-  {$endif}
-end;
-
-
-function set_target_os(t:tos):boolean;
-var
-  i : longint;
-begin
-  set_target_os:=false;
-  { target 1 is none }
-  for i:=2 to oscnt do
-   if os_infos[i].id=t then
-    begin
-      target_os:=os_infos[i];
-      set_target_os:=true;
-      exit;
-    end;
-end;
-
-
-function set_target_asm(t:tasm):boolean;
-var
-  i : longint;
-begin
-  set_target_asm:=false;
-  for i:=1 to asmcnt do
-   if as_infos[i].id=t then
-    begin
-      target_asm:=as_infos[i];
-      set_target_asm:=true;
-      exit;
-    end;
-end;
-
-
-function set_target_link(t:tlink):boolean;
-var
-  i : longint;
-begin
-  set_target_link:=false;
-  for i:=1 to linkcnt do
-   if link_infos[i].id=t then
-    begin
-      target_link:=link_infos[i];
-      set_target_link:=true;
-      exit;
-    end;
-end;
-
-
-function set_target_ar(t:tar):boolean;
-var
-  i : longint;
-begin
-  set_target_ar:=false;
-  for i:=1 to arcnt do
-   if ar_infos[i].id=t then
-    begin
-      target_ar:=ar_infos[i];
-      set_target_ar:=true;
-      exit;
-    end;
-end;
-
-
-function set_target_res(t:tres):boolean;
-var
-  i : longint;
-begin
-  set_target_res:=false;
-  for i:=1 to rescnt do
-   if res_infos[i].id=t then
-    begin
-      target_res:=res_infos[i];
-      set_target_res:=true;
-      exit;
-    end;
-end;
-
-
-function set_target_info(t:ttarget):boolean;
-var
-  i : longint;
-begin
-  set_target_info:=false;
-  for i:=1 to targetcnt do
-   if target_infos[i].target=t then
-    begin
-      target_info:=target_infos[i];
-      set_target_os(target_info.os);
-      set_target_asm(target_info.assem);
-      set_target_link(target_info.link);
-      set_target_ar(target_info.ar);
-      set_target_res(target_info.res);
-      target_path:=lower(target_info.short_name);
-      target_cpu:=target_info.cpu;
-      set_target_info:=true;
-      exit;
-    end;
-end;
-
-
-{****************************************************************************
-                             Load from string
-****************************************************************************}
-
-function set_string_target(s : string) : boolean;
-var
-  i : longint;
-begin
-  set_string_target:=false;
-  { this should be case insensitive !! PM }
-  s:=upper(s);
-  for i:=1 to targetcnt do
-   if target_infos[i].short_name=s then
-    begin
-      set_target_info(target_infos[i].target);
-      set_string_target:=true;
-      exit;
-    end;
-end;
-
-
-function set_string_asm(s : string) : boolean;
-var
-  i : longint;
-begin
-  set_string_asm:=false;
-  { this should be case insensitive !! PM }
-  s:=upper(s);
-  for i:=1 to asmcnt do
-   if as_infos[i].idtxt=s then
-    begin
-      target_asm:=as_infos[i];
-      set_string_asm:=true;
-    end;
-end;
-
-
-function set_string_asmmode(s:string;var t:tasmmode):boolean;
-var
-  i : longint;
-begin
-  set_string_asmmode:=false;
-  { this should be case insensitive !! PM }
-  s:=upper(s);
-  for i:=1 to asmmodecnt do
-   if asmmodeinfos[i].idtxt=s then
-    begin
-      t:=asmmodeinfos[i].id;
-      set_string_asmmode:=true;
-    end;
-end;
-
-
-{****************************************************************************
-                      Initialization of default target
-****************************************************************************}
-
-procedure default_os(t:ttarget);
-begin
-  set_target_info(t);
-  if source_os.name='' then
-    source_os:=target_os;
-end;
-
-
-procedure set_source_os(t:tos);
-var
-  i : longint;
-begin
-{ can't use message() here (PFV) }
-  if source_os.name<>'' then
-    Writeln('Warning: Source OS Redefined!');
-  for i:=1 to oscnt do
-   if os_infos[i].id=t then
-    begin
-      source_os:=os_infos[i];
-      exit;
-    end;
-end;
-
-
-procedure InitSystems;
-begin
-{ first get source OS }
-  source_os.name:='';
-{ please note then we use cpu86 and cpu68 here on purpose !! }
-{$ifdef cpu86}
-  {$ifdef GO32V1}
-    set_source_os(os_i386_GO32V1);
-  {$else}
-    {$ifdef GO32V2}
-      set_source_os(os_i386_GO32V2);
-    {$else}
-      {$ifdef OS2}
-        set_source_os(os_i386_OS2);
-        if (OS_Mode = osDOS) or (OS_Mode = osDPMI)
-                                            then source_os.scriptext := '.bat';
-{OS/2 via EMX can be run under DOS as well}
-      {$else}
-        {$ifdef LINUX}
-          set_source_os(os_i386_LINUX);
-        {$else}
-          {$ifdef WIN32}
-            set_source_os(os_i386_WIN32);
-          {$endif win32}
-        {$endif linux}
-      {$endif os2}
-    {$endif go32v2}
-  {$endif go32v1}
-{$endif cpu86}
-{$ifdef cpu68}
-  {$ifdef AMIGA}
-    set_source_os(os_m68k_Amiga);
-  {$else}
-    {$ifdef ATARI}
-      set_source_os(os_m68k_Atari);
-    {$else}
-      {$ifdef MACOS}
-        set_source_os(os_m68k_MAC);
-      {$else}
-        {$ifdef LINUX}
-          set_source_os(os_m68k_linux);
-        {$endif linux}
-      {$endif macos}
-    {$endif atari}
-  {$endif amiga}
-{$endif cpu68}
-
-{ Now default target !! }
-{$ifdef i386}
-  {$ifdef GO32V1}
-     default_os(target_i386_GO32V1);
-  {$else}
-    {$ifdef GO32V2}
-      default_os(target_i386_GO32V2);
-    {$else}
-      {$ifdef OS2}
-        default_os(target_i386_OS2);
-      {$else}
-        {$ifdef LINUX}
-          default_os(target_i386_LINUX);
-        {$else}
-           {$ifdef WIN32}
-             default_os(target_i386_WIN32);
-           {$else}
-             default_os(target_i386_GO32V2);
-           {$endif win32}
-        {$endif linux}
-      {$endif os2}
-    {$endif go32v2}
-  {$endif go32v1}
-{$endif i386}
-{$ifdef m68k}
-  {$ifdef AMIGA}
-    default_os(target_m68k_Amiga);
-  {$else}
-    {$ifdef ATARI}
-      default_os(target_m68k_Atari);
-    {$else}
-      {$ifdef MACOS}
-        default_os(target_m68k_Mac);
-      {$else}
-        {$ifdef LINUX}
-          default_os(target_m68k_linux);
-        {$else}
-          default_os(target_m68k_Amiga);
-        {$endif linux}
-      {$endif macos}
-    {$endif atari}
-  {$endif amiga}
-{$endif m68k}
-{$ifdef alpha}
-  default_os(target_alpha_linux);
-{$endif alpha}
-{$ifdef powerpc}
-  default_os(target_powerpc_linux);
-{$endif powerpc}
-end;
-
-
-begin
-  InitSystems;
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:33  michael
-  + Initial import
-
-  Revision 1.2  1999/09/17 09:16:13  peter
-    * updated with compiler versions
-
-}

+ 0 - 567
ide/fake/compiler/tokens.pas

@@ -1,567 +0,0 @@
-{
-    $Id$
-    Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
-
-    Tokens used by the compiler
-
-    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.
- ****************************************************************************
-}
-unit tokens;
-interface
-
-uses
-  globtype;
-
-const
-  tokenidlen=14;
-  tokheader=#8'Free Pascal Compiler -- Token data'#13#10#26;
-
-type
-  ttoken=(NOTOKEN,
-    { operators, which can also be overloaded }
-    _PLUS,
-    _MINUS,
-    _STAR,
-    _SLASH,
-    _EQUAL,
-    _GT,
-    _LT,
-    _GTE,
-    _LTE,
-    _SYMDIF,
-    _STARSTAR,
-    _OP_AS,
-    _OP_IN,
-    _OP_IS,
-    _OP_OR,
-    _OP_AND,
-    _OP_DIV,
-    _OP_MOD,
-    _OP_SHL,
-    _OP_SHR,
-    _OP_XOR,
-    _ASSIGNMENT,
-    { special chars }
-    _CARET,
-    _UNEQUAL,
-    _LECKKLAMMER,
-    _RECKKLAMMER,
-    _POINT,
-    _COMMA,
-    _LKLAMMER,
-    _RKLAMMER,
-    _COLON,
-    _SEMICOLON,
-    _KLAMMERAFFE,
-    _POINTPOINT,
-    _DOUBLEADDR,
-    _EOF,
-    _ID,
-    _NOID,
-    _REALNUMBER,
-    _INTCONST,
-    _CSTRING,
-    _CCHAR,
-    { C like operators }
-    _PLUSASN,
-    _MINUSASN,
-    _ANDASN,
-    _ORASN,
-    _STARASN,
-    _SLASHASN,
-    _MODASN,
-    _DIVASN,
-    _NOTASN,
-    _XORASN,
-    { Normal words }
-    _AS,
-    _AT,
-    _DO,
-    _IF,
-    _IN,
-    _IS,
-    _OF,
-    _ON,
-    _OR,
-    _TO,
-    _AND,
-    _ASM,
-    _DIV,
-    _END,
-    _FAR,
-    _FOR,
-    _MOD,
-    _NEW,
-    _NIL,
-    _NOT,
-    _SET,
-    _SHL,
-    _SHR,
-    _TRY,
-    _VAR,
-    _XOR,
-    _CASE,
-    _CVAR,
-    _ELSE,
-    _EXIT,
-    _FAIL,
-    _FILE,
-    _GOTO,
-    _NAME,
-    _NEAR,
-    _READ,
-    _SELF,
-    _THEN,
-    _TRUE,
-    _TYPE,
-    _UNIT,
-    _USES,
-    _WITH,
-    _ALIAS,
-    _ARRAY,
-    _BEGIN,
-    _BREAK,
-    _CDECL,
-    _CLASS,
-    _CONST,
-    _FALSE,
-    _INDEX,
-    _LABEL,
-    _RAISE,
-    _UNTIL,
-    _WHILE,
-    _WRITE,
-    _DOWNTO,
-    _EXCEPT,
-    _EXPORT,
-    _INLINE,
-    _OBJECT,
-    _PACKED,
-    _PASCAL,
-    _PUBLIC,
-    _RECORD,
-    _REPEAT,
-    _RESULT,
-    _STATIC,
-    _STORED,
-    _STRING,
-    _SYSTEM,
-    _ASMNAME,
-    _DEFAULT,
-    _DISPOSE,
-    _DYNAMIC,
-    _EXPORTS,
-    _FINALLY,
-    _FORWARD,
-    _IOCHECK,
-    _LIBRARY,
-    _MESSAGE,
-    _PRIVATE,
-    _PROGRAM,
-    _STDCALL,
-    _SYSCALL,
-    _VIRTUAL,
-    _ABSOLUTE,
-    _ABSTRACT,
-    _CONTINUE,
-    _EXTERNAL,
-    _FUNCTION,
-    _OPERATOR,
-    _OVERRIDE,
-    _POPSTACK,
-    _PROPERTY,
-    _REGISTER,
-    _RESIDENT,
-    _SAFECALL,
-    _ASSEMBLER,
-    _INHERITED,
-    _INTERFACE,
-    _INTERRUPT,
-    _NODEFAULT,
-    _OTHERWISE,
-    _PROCEDURE,
-    _PROTECTED,
-    _PUBLISHED,
-    _THREADVAR,
-    _DESTRUCTOR,
-    _INTERNPROC,
-    _OPENSTRING,
-    _CONSTRUCTOR,
-    _INTERNCONST,
-    _SHORTSTRING,
-    _FINALIZATION,
-    _SAVEREGISTERS,
-    _IMPLEMENTATION,
-    _INITIALIZATION,
-    _RESOURCESTRING
-  );
-
-  tokenrec=record
-    str     : string[tokenidlen];
-    special : boolean;
-    keyword : tmodeswitch;
-    op      : ttoken;
-    encoded : longint;
-  end;
-
-  ttokenarray=array[ttoken] of tokenrec;
-  ptokenarray=^ttokenarray;
-
-  tokenidxrec=record
-    first,last : ttoken;
-  end;
-
-  ptokenidx=^ttokenidx;
-  ttokenidx=array[2..tokenidlen,'A'..'Z'] of tokenidxrec;
-
-const
-  arraytokeninfo : ttokenarray =(
-      (str:''              ;special:true ;keyword:m_none;op:NOTOKEN),
-    { Operators which can be overloaded }
-      (str:'+'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'-'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'*'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'/'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'='             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'>'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'<'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'>='            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'<='            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'><'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'**'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'as'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'in'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'is'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'or'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'and'           ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'div'           ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'mod'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'shl'           ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'shr'           ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'xor'           ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:':='            ;special:true ;keyword:m_none;op:NOTOKEN),
-    { Special chars }
-      (str:'^'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'<>'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'['             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:']'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'.'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:','             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'('             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:')'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:':'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:';'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'@'             ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'..'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'@@'            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'end of file'   ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'identifier'    ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'non identifier';special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'const real'    ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'ordinal const' ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'const string'  ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'const char'    ;special:true ;keyword:m_none;op:NOTOKEN),
-    { C like operators }
-      (str:'+='            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'-='            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'&='            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'|='            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'*='            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:'/='            ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:''              ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:''              ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:''              ;special:true ;keyword:m_none;op:NOTOKEN),
-      (str:''              ;special:true ;keyword:m_none;op:NOTOKEN),
-    { Normal words }
-      (str:'AS'            ;special:false;keyword:m_class;op:_OP_AS),
-      (str:'AT'            ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'DO'            ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'IF'            ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'IN'            ;special:false;keyword:m_all;op:_OP_IN),
-      (str:'IS'            ;special:false;keyword:m_class;op:_OP_IS),
-      (str:'OF'            ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'ON'            ;special:false;keyword:m_class;op:NOTOKEN),
-      (str:'OR'            ;special:false;keyword:m_all;op:_OP_OR),
-      (str:'TO'            ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'AND'           ;special:false;keyword:m_all;op:_OP_AND),
-      (str:'ASM'           ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'DIV'           ;special:false;keyword:m_all;op:_OP_DIV),
-      (str:'END'           ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'FAR'           ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'FOR'           ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'MOD'           ;special:false;keyword:m_all;op:_OP_MOD),
-      (str:'NEW'           ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'NIL'           ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'NOT'           ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'SET'           ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'SHL'           ;special:false;keyword:m_all;op:_OP_SHL),
-      (str:'SHR'           ;special:false;keyword:m_all;op:_OP_SHR),
-      (str:'TRY'           ;special:false;keyword:m_class;op:NOTOKEN),
-      (str:'VAR'           ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'XOR'           ;special:false;keyword:m_all;op:_OP_XOR),
-      (str:'CASE'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'CVAR'          ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'ELSE'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'EXIT'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'FAIL'          ;special:false;keyword:m_none;op:NOTOKEN), { only set within constructors PM }
-      (str:'FILE'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'GOTO'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'NAME'          ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'NEAR'          ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'READ'          ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'SELF'          ;special:false;keyword:m_none;op:NOTOKEN), {set inside methods only PM }
-      (str:'THEN'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'TRUE'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'TYPE'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'UNIT'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'USES'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'WITH'          ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'ALIAS'         ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'ARRAY'         ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'BEGIN'         ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'BREAK'         ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'CDECL'         ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'CLASS'         ;special:false;keyword:m_class;op:NOTOKEN),
-      (str:'CONST'         ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'FALSE'         ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'INDEX'         ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'LABEL'         ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'RAISE'         ;special:false;keyword:m_class;op:NOTOKEN),
-      (str:'UNTIL'         ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'WHILE'         ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'WRITE'         ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'DOWNTO'        ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'EXCEPT'        ;special:false;keyword:m_class;op:NOTOKEN),
-      (str:'EXPORT'        ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'INLINE'        ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'OBJECT'        ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'PACKED'        ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'PASCAL'        ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'PUBLIC'        ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'RECORD'        ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'REPEAT'        ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'RESULT'        ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'STATIC'        ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'STORED'        ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'STRING'        ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'SYSTEM'        ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'ASMNAME'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'DEFAULT'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'DISPOSE'       ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'DYNAMIC'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'EXPORTS'       ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'FINALLY'       ;special:false;keyword:m_class;op:NOTOKEN),
-      (str:'FORWARD'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'IOCHECK'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'LIBRARY'       ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'MESSAGE'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'PRIVATE'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'PROGRAM'       ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'STDCALL'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'SYSCALL'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'VIRTUAL'       ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'ABSOLUTE'      ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'ABSTRACT'      ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'CONTINUE'      ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'EXTERNAL'      ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'FUNCTION'      ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'OPERATOR'      ;special:false;keyword:m_fpc;op:NOTOKEN),
-      (str:'OVERRIDE'      ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'POPSTACK'      ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'PROPERTY'      ;special:false;keyword:m_class;op:NOTOKEN),
-      (str:'REGISTER'      ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'RESIDENT'      ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'SAFECALL'      ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'ASSEMBLER'     ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'INHERITED'     ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'INTERFACE'     ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'INTERRUPT'     ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'NODEFAULT'     ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'OTHERWISE'     ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'PROCEDURE'     ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'PROTECTED'     ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'PUBLISHED'     ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'THREADVAR'     ;special:false;keyword:m_class;op:NOTOKEN),
-      (str:'DESTRUCTOR'    ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'INTERNPROC'    ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'OPENSTRING'    ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'CONSTRUCTOR'   ;special:false;keyword:m_all;op:NOTOKEN),
-      (str:'INTERNCONST'   ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'SHORTSTRING'   ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'FINALIZATION'  ;special:false;keyword:m_initfinal;op:NOTOKEN),
-      (str:'SAVEREGISTERS' ;special:false;keyword:m_none;op:NOTOKEN),
-      (str:'IMPLEMENTATION';special:false;keyword:m_all;op:NOTOKEN),
-      (str:'INITIALIZATION';special:false;keyword:m_initfinal;op:NOTOKEN),
-      (str:'RESOURCESTRING';special:false;keyword:m_class;op:NOTOKEN)
-  );
-
-var
-  tokeninfo:ptokenarray;
-  tokenidx:ptokenidx;
-
-procedure inittokens;
-procedure donetokens;
-procedure create_tokenidx;
-
-implementation
-
-{$ifdef TP}
-uses
-  dos;
-{$endif}
-
-procedure create_tokenidx;
-{ create an index with the first and last token for every possible token
-  length, so a search only will be done in that small part }
-var
-  t : ttoken;
-begin
-  fillchar(tokenidx^,sizeof(tokenidx^),0);
-  for t:=low(ttoken) to high(ttoken) do
-   begin
-     if not arraytokeninfo[t].special then
-      begin
-        if ord(tokenidx^[length(arraytokeninfo[t].str),arraytokeninfo[t].str[1]].first)=0 then
-         tokenidx^[length(arraytokeninfo[t].str),arraytokeninfo[t].str[1]].first:=t;
-        tokenidx^[length(arraytokeninfo[t].str),arraytokeninfo[t].str[1]].last:=t;
-      end;
-   end;
-end;
-
-procedure inittokens;
-{$ifdef TP}
-var
-  f:file;
-  n : namestr;
-  d : dirstr;
-  e : extstr;
-  header:string;
-  a:longint;
-{$endif TP}
-begin
-{$ifdef TP}
-    fsplit(paramstr(0),d,n,e);
-    { when debugging d=''!!!! FK }
-    if d='' then
-      assign(f,'tokens.dat')
-    else
-      assign(f,d+'tokens.dat');
-    {$I-}
-    reset(f,1);
-    {We are not sure that the msg file is loaded!}
-    if ioresult<>0 then
-        begin
-            { Very nice indeed !!! PM }
-            writeln('Fatal: File tokens.dat not found.');
-            close(f);
-            halt(3);
-        end;
-    blockread(f,header,1);
-    blockread(f,header[1],length(header));
-    blockread(f,a,sizeof(a));
-    if (ioresult<>0) or
-       (header<>tokheader) or (a<>sizeof(ttokenarray)) then
-     begin
-       writeln('Fatal: File tokens.dat corrupt.');
-       close(f);
-       halt(3);
-     end;
-    new(tokeninfo);
-    blockread(f,tokeninfo^,sizeof(ttokenarray));
-    new(tokenidx);
-    blockread(f,tokenidx^,sizeof(tokenidx^));
-    close(f);
-{$I+}
-    if (ioresult<>0) then
-     begin
-       writeln('Fatal: File tokens.dat corrupt.');
-       halt(3);
-     end;
-{$else not TP}
-  tokeninfo:=@arraytokeninfo;
-  new(tokenidx);
-  create_tokenidx;
-{$endif not TP}
-end;
-
-
-procedure donetokens;
-begin
-{$ifdef TP}
-    dispose(tokeninfo);
-{$else TP}
-    tokeninfo:=nil;
-{$endif TP}
-    dispose(tokenidx);
-end;
-
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:33  michael
-  + Initial import
-
-  Revision 1.5  2000/02/12 23:55:26  carl
-    * bugfix of reading file with TP conditional
-
-  Revision 1.20  2000/02/09 13:23:08  peter
-    * log truncated
-
-  Revision 1.19  2000/01/07 01:14:48  peter
-    * updated copyright to 2000
-
-  Revision 1.18  1999/11/15 17:53:00  pierre
-    + one field added for ttoken record for operator
-      linking the id to the corresponding operator token that
-      can now now all be overloaded
-    * overloaded operators are resetted to nil in InitSymtable
-      (bug when trying to compile a uint that overloads operators twice)
-
-  Revision 1.17  1999/09/21 20:53:23  florian
-    * fixed 1/s problem from mailing list
-
-  Revision 1.16  1999/09/17 09:17:49  peter
-    * removed uses globals
-
-  Revision 1.15  1999/09/16 13:41:37  peter
-    * better error checking
-
-  Revision 1.14  1999/09/08 16:02:04  peter
-    * tokendat compiles for tp
-    * tokens.dat supplied by default
-
-  Revision 1.13  1999/09/03 08:37:34  pierre
-    *  tokens.dat only used for TP, and also removed from
-       compiler dependencies
-
-  Revision 1.12  1999/09/02 18:47:49  daniel
-    * Could not compile with TP, some arrays moved to heap
-    * NOAG386BIN default for TP
-    * AG386* files were not compatible with TP, fixed.
-
-  Revision 1.11  1999/08/04 13:03:17  jonas
-    * all tokens now start with an underscore
-    * PowerPC compiles!!
-
-  Revision 1.10  1999/08/03 22:03:39  peter
-    * moved bitmask constants to sets
-    * some other type/const renamings
-
-  Revision 1.9  1999/07/22 09:38:01  florian
-    + resourcestring implemented
-    + start of longstring support
-
-}

+ 0 - 81
ide/fake/compiler/version.pas

@@ -1,81 +0,0 @@
-{
-    $Id$
-    Copyright (C) 1993-98 by Florian Klaempfl
-
-    Version/target constants
-
-    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.
-
- ****************************************************************************
-}
-unit version;
-interface
-
-    const
-       { word version for ppu file }
-       wordversion = (0 shl 11)+99;
-
-       { version string }
-       version_nr = '0';
-       release_nr = '99';
-       patch_nr   = '11';
-       version_string = version_nr+'.'+release_nr+'.'+patch_nr;
-
-       { date string }
-{$ifdef FPC}
-       date_string = {$I %DATE%};
-{$else}
-       date_string = 'N/A';
-{$endif}
-
-       { target cpu string }
-{$ifdef i386}
-       target_cpu_string = 'i386';
-{$endif}
-{$ifdef m68k}
-       target_cpu_string = 'm68k';
-{$endif}
-{$ifdef alpha}
-       target_cpu_string = 'alpha';
-{$endif}
-
-       { source cpu string }
-{$ifdef cpu86}
-        source_cpu_string = 'i386';
-{$endif}
-{$ifdef cpu68}
-        source_cpu_string = 'm68k';
-{$endif}
-
-
-implementation
-
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:33  michael
-  + Initial import
-
-  Revision 1.1  1999/01/28 19:56:12  peter
-    * moved to include compiler/gdb independent of each other
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.2  1998/12/18 17:17:06  peter
-    * updated with new versions from compiler
-
-}
-

+ 0 - 918
ide/fake/gdb/Makefile

@@ -1,918 +0,0 @@
-#
-# Don't edit, this file is generated by FPCMake Version 1.1 [2001/08/02]
-#
-default: all
-override PATH:=$(subst \,/,$(PATH))
-ifeq ($(findstring ;,$(PATH)),)
-inUnix=1
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-SEARCHPATH:=$(subst ;, ,$(PATH))
-endif
-PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
-ifeq ($(PWD),)
-PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
-ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=
-endif
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=.exe
-endif
-ifndef inUnix
-ifeq ($(OS),Windows_NT)
-inWinNT=1
-else
-ifdef OS2_SHELL
-inOS2=1
-endif
-endif
-else
-ifneq ($(findstring cygwin,$(MACHTYPE)),)
-inCygWin=1
-endif
-endif
-ifdef inUnix
-BATCHEXT=.sh
-else
-ifdef inOS2
-BATCHEXT=.cmd
-else
-BATCHEXT=.bat
-endif
-endif
-ifdef inUnix
-PATHSEP=/
-else
-PATHSEP:=$(subst /,\,/)
-endif
-ifdef PWD
-BASEDIR:=$(subst \,/,$(shell $(PWD)))
-ifdef inCygWin
-ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
-BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
-BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
-BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
-endif
-endif
-else
-BASEDIR=.
-endif
-ifndef FPC
-ifdef PP
-FPC=$(PP)
-else
-ifdef inUnix
-CPU_SOURCE=$(shell uname -m)
-ifeq (m68k,$(CPU_SOURCE))
-FPC=ppc68k
-else
-FPC=ppc386
-endif
-else
-FPC=ppc386
-endif
-endif
-endif
-override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
-endif
-ifndef OS_SOURCE
-OS_SOURCE:=$(shell $(FPC) -iSO)
-endif
-ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
-endif
-ifndef CPU_SOURCE
-CPU_SOURCE:=$(shell $(FPC) -iSP)
-endif
-ifndef FPC_VERSION
-FPC_VERSION:=$(shell $(FPC) -iV)
-endif
-export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=wrong
-endif
-else
-override FPCDIR=wrong
-endif
-ifeq ($(FPCDIR),wrong)
-override FPCDIR=../../..
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=wrong
-endif
-endif
-endif
-ifeq ($(FPCDIR),wrong)
-ifdef inUnix
-override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
-endif
-else
-override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=c:/pp
-endif
-endif
-endif
-endif
-UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
-PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
-override TARGET_UNITS+=gdbcon gdbint
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO=
-else
-ECHO:=$(firstword $(ECHO))
-endif
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-ifndef DATE
-DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE=
-else
-DATE:=$(firstword $(DATE))
-endif
-else
-DATE:=$(firstword $(DATE))
-endif
-endif
-export DATE
-ifndef GINSTALL
-GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL=
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-endif
-export GINSTALL
-ifndef CPPROG
-CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(CPPROG),)
-CPPROG=
-else
-CPPROG:=$(firstword $(CPPROG))
-endif
-endif
-export CPPROG
-ifndef RMPROG
-RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(RMPROG),)
-RMPROG=
-else
-RMPROG:=$(firstword $(RMPROG))
-endif
-endif
-export RMPROG
-ifndef MVPROG
-MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(MVPROG),)
-MVPROG=
-else
-MVPROG:=$(firstword $(MVPROG))
-endif
-endif
-export MVPROG
-ifndef ECHOREDIR
-ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
-endif
-ifndef COPY
-COPY:=$(CPPROG) -fp
-endif
-ifndef COPYTREE
-COPYTREE:=$(CPPROG) -rfp
-endif
-ifndef MOVE
-MOVE:=$(MVPROG) -f
-endif
-ifndef DEL
-DEL:=$(RMPROG) -f
-endif
-ifndef DELTREE
-DELTREE:=$(RMPROG) -rf
-endif
-ifndef INSTALL
-ifdef inUnix
-INSTALL:=$(GINSTALL) -c -m 644
-else
-INSTALL:=$(COPY)
-endif
-endif
-ifndef INSTALLEXE
-ifdef inUnix
-INSTALLEXE:=$(GINSTALL) -c -m 755
-else
-INSTALLEXE:=$(COPY)
-endif
-endif
-ifndef MKDIR
-MKDIR:=$(GINSTALL) -m 755 -d
-endif
-export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
-ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(PPUMOVE),)
-PPUMOVE=
-else
-PPUMOVE:=$(firstword $(PPUMOVE))
-endif
-endif
-export PPUMOVE
-ifndef FPCMAKE
-FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(FPCMAKE),)
-FPCMAKE=
-else
-FPCMAKE:=$(firstword $(FPCMAKE))
-endif
-endif
-export FPCMAKE
-ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ZIPPROG),)
-ZIPPROG=
-else
-ZIPPROG:=$(firstword $(ZIPPROG))
-endif
-endif
-export ZIPPROG
-ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(TARPROG),)
-TARPROG=
-else
-TARPROG:=$(firstword $(TARPROG))
-endif
-endif
-export TARPROG
-ifndef AS
-AS=as
-endif
-ifndef LD
-LD=ld
-endif
-ifndef RC
-RC=rc
-endif
-PPAS=ppas$(BATCHEXT)
-ifdef inUnix
-LDCONFIG=ldconfig
-else
-LDCONFIG=
-endif
-ifdef DATE
-DATESTR:=$(shell $(DATE) +%Y%m%d)
-else
-DATESTR=
-endif
-ifndef UPXPROG
-ifeq ($(OS_TARGET),go32v2)
-UPXPROG:=1
-endif
-ifeq ($(OS_TARGET),win32)
-UPXPROG:=1
-endif
-ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(UPXPROG),)
-UPXPROG=
-else
-UPXPROG:=$(firstword $(UPXPROG))
-endif
-else
-UPXPROG=
-endif
-endif
-export UPXPROG
-ZIPOPT=-9
-ZIPEXT=.zip
-ifeq ($(USETAR),bz2)
-TAROPT=vI
-TAREXT=.tar.bz2
-else
-TAROPT=vz
-TAREXT=.tar.gz
-endif
-LOADEREXT=.as
-EXEEXT=.exe
-PPLEXT=.ppl
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.so
-STATICLIBPREFIX=libp
-RSTEXT=.rst
-FPCMADE=fpcmade
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-STATICLIBPREFIX=
-FPCMADE=fpcmade.v1
-PACKAGESUFFIX=v1
-endif
-ifeq ($(OS_TARGET),go32v2)
-STATICLIBPREFIX=
-FPCMADE=fpcmade.dos
-ZIPSUFFIX=go32
-endif
-ifeq ($(OS_TARGET),linux)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.lnx
-ZIPSUFFIX=linux
-endif
-ifeq ($(OS_TARGET),freebsd)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.freebsd
-ZIPSUFFIX=freebsd
-endif
-ifeq ($(OS_TARGET),win32)
-PPUEXT=.ppw
-OEXT=.ow
-ASMEXT=.sw
-SMARTEXT=.slw
-STATICLIBEXT=.aw
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.w32
-ZIPSUFFIX=w32
-endif
-ifeq ($(OS_TARGET),os2)
-PPUEXT=.ppo
-ASMEXT=.so2
-OEXT=.oo2
-AOUTEXT=.out
-SMARTEXT=.so
-STATICLIBEXT=.ao2
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.os2
-ZIPSUFFIX=emx
-endif
-ifeq ($(OS_TARGET),amiga)
-EXEEXT=
-PPUEXT=.ppa
-ASMEXT=.asm
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.library
-FPCMADE=fpcmade.amg
-endif
-ifeq ($(OS_TARGET),atari)
-PPUEXT=.ppt
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=.ttp
-FPCMADE=fpcmade.ata
-endif
-ifdef REQUIRE_UNITSDIR
-override UNITSDIR+=$(REQUIRE_UNITSDIR)
-endif
-ifdef REQUIRE_PACKAGESDIR
-override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
-endif
-ifdef ZIPINSTALL
-ifeq ($(OS_TARGET),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-UNIXINSTALLDIR=1
-endif
-else
-ifeq ($(OS_SOURCE),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_SOURCE),freebsd)
-UNIXINSTALLDIR=1
-endif
-endif
-ifndef INSTALL_PREFIX
-ifdef UNIXINSTALLDIR
-INSTALL_PREFIX=/usr/local
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=/pp
-else
-INSTALL_BASEDIR:=/$(PACKAGE_NAME)
-endif
-endif
-endif
-export INSTALL_PREFIX
-ifndef DIST_DESTDIR
-DIST_DESTDIR:=$(BASEDIR)
-endif
-export DIST_DESTDIR
-ifndef INSTALL_BASEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
-endif
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)
-endif
-endif
-ifndef INSTALL_BINDIR
-ifdef UNIXINSTALLDIR
-INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
-else
-INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
-endif
-endif
-endif
-ifndef INSTALL_UNITDIR
-INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
-ifdef INSTALL_FPCPACKAGE
-ifdef PACKAGE_NAME
-INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
-endif
-endif
-endif
-ifndef INSTALL_LIBDIR
-ifdef UNIXINSTALLDIR
-INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
-else
-INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
-endif
-endif
-ifndef INSTALL_SOURCEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source
-endif
-endif
-endif
-ifndef INSTALL_DOCDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
-endif
-endif
-endif
-ifndef INSTALL_EXAMPLEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
-endif
-endif
-endif
-ifndef INSTALL_DATADIR
-INSTALL_DATADIR=$(INSTALL_BASEDIR)
-endif
-ifeq ($(OS_TARGET),linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),go32v2)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),win32)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),os2)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),beos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),amiga)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(OS_TARGET),atari)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifdef REQUIRE_PACKAGES_RTL
-PACKAGEDIR_RTL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))
-ifneq ($(PACKAGEDIR_RTL),)
-PACKAGEDIR_RTL:=$(firstword $(PACKAGEDIR_RTL))
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_rtl
-package_rtl:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
-UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
-else
-UNITDIR_RTL=$(PACKAGEDIR_RTL)
-endif
-else
-PACKAGEDIR_RTL=
-UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
-ifneq ($(UNITDIR_RTL),)
-UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
-else
-UNITDIR_RTL=
-endif
-endif
-ifdef UNITDIR_RTL
-override COMPILER_UNITDIR+=$(UNITDIR_RTL)
-endif
-endif
-.PHONY: package_rtl
-override FPCOPTDEF=$(CPU_TARGET)
-ifneq ($(OS_TARGET),$(OS_SOURCE))
-override FPCOPT+=-T$(OS_TARGET)
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-ifdef LINKSMART
-override FPCOPT+=-XX
-endif
-ifdef CREATESMART
-override FPCOPT+=-CX
-endif
-ifdef DEBUG
-override FPCOPT+=-gl
-override FPCOPTDEF+=DEBUG
-endif
-ifdef RELEASE
-override FPCOPT+=-Xs -OG2p3 -n
-override FPCOPTDEF+=RELEASE
-endif
-ifdef STRIP
-override FPCOPT+=-Xs
-endif
-ifdef OPTIMIZE
-override FPCOPT+=-OG2p3
-endif
-ifdef VERBOSE
-override FPCOPT+=-vwni
-endif
-ifdef COMPILER_OPTIONS
-override FPCOPT+=$(COMPILER_OPTIONS)
-endif
-ifdef COMPILER_UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
-endif
-ifdef COMPILER_LIBRARYDIR
-override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
-endif
-ifdef COMPILER_OBJECTDIR
-override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
-endif
-ifdef COMPILER_INCLUDEDIR
-override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
-endif
-ifdef COMPILER_TARGETDIR
-override FPCOPT+=-FE$(COMPILER_TARGETDIR)
-ifeq ($(COMPILER_TARGETDIR),.)
-override TARGETDIRPREFIX=
-else
-override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-endif
-ifdef COMPILER_UNITTARGETDIR
-override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
-ifeq ($(COMPILER_UNITTARGETDIR),.)
-override UNITTARGETDIRPREFIX=
-else
-override UNITTARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-else
-ifdef COMPILER_TARGETDIR
-override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
-override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
-endif
-endif
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef FPCOPTDEF
-override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
-endif
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-ifdef USEENV
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
-endif
-override COMPILER:=$(FPC) $(FPCOPT)
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-ifeq ($(OS_SOURCE),$(OS_TARGET))
-EXECPPAS:=@$(PPAS)
-endif
-endif
-.PHONY: fpc_units
-ifdef TARGET_UNITS
-override ALLTARGET+=fpc_units
-override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
-override INSTALLPPUFILES+=$(UNITPPUFILES)
-override CLEANPPUFILES+=$(UNITPPUFILES)
-endif
-fpc_units: $(UNITPPUFILES)
-ifdef TARGET_RSTS
-override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
-override CLEANRSTFILES+=$(RSTFILES)
-endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
-$(FPCMADE): $(ALLTARGET)
-	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
-fpc_smart:
-	$(MAKE) all LINKSMART=1 CREATESMART=1
-fpc_debug:
-	$(MAKE) all DEBUG=1
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
-%$(PPUEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(PPUEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
-.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
-ifdef INSTALL_UNITS
-override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
-endif
-ifdef INSTALLPPUFILES
-override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
-override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
-override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
-override INSTALL_CREATEPACKAGEFPC=1
-endif
-ifdef INSTALLEXEFILES
-override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
-endif
-fpc_install: $(INSTALLTARGET)
-ifdef INSTALLEXEFILES
-	$(MKDIR) $(INSTALL_BINDIR)
-ifdef UPXPROG
-	-$(UPXPROG) $(INSTALLEXEFILES)
-endif
-	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
-endif
-ifdef INSTALL_CREATEPACKAGEFPC
-ifdef FPCMAKE
-ifdef PACKAGE_VERSION
-ifneq ($(wildcard Makefile.fpc),)
-	$(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
-endif
-endif
-endif
-endif
-ifdef INSTALLPPUFILES
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
-ifneq ($(INSTALLPPULINKFILES),)
-	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
-endif
-ifneq ($(wildcard $(LIB_FULLNAME)),)
-	$(MKDIR) $(INSTALL_LIBDIR)
-	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
-ifdef inUnix
-	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
-endif
-endif
-endif
-ifdef INSTALL_FILES
-	$(MKDIR) $(INSTALL_DATADIR)
-	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
-endif
-fpc_sourceinstall: distclean
-	$(MKDIR) $(INSTALL_SOURCEDIR)
-	$(COPYTREE) $(BASEDIR) $(INSTALL_SOURCEDIR)
-fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
-ifdef HASEXAMPLES
-	$(MKDIR) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef EXAMPLESOURCEFILES
-	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef TARGET_EXAMPLEDIRS
-	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
-endif
-.PHONY: fpc_clean fpc_cleanall fpc_distclean
-ifdef EXEFILES
-override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
-endif
-ifdef CLEAN_UNITS
-override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
-endif
-ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
-override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
-override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
-endif
-fpc_clean: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-ifdef CLEAN_FILES
-	-$(DEL) $(CLEAN_FILES)
-endif
-ifdef LIB_NAME
-	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
-endif
-	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-fpc_distclean: clean
-ifdef COMPILER_UNITTARGETDIR
-TARGETDIRCLEAN=fpc_clean
-endif
-fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-ifdef AOUTEXT
-	-$(DEL) *$(AOUTEXT)
-endif
-.PHONY: fpc_info
-fpc_info:
-	@$(ECHO)
-	@$(ECHO)  == Package info ==
-	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
-	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPC.......... $(FPC)
-	@$(ECHO)  FPC Version.. $(FPC_VERSION)
-	@$(ECHO)  Source CPU... $(CPU_SOURCE)
-	@$(ECHO)  Target CPU... $(CPU_TARGET)
-	@$(ECHO)  Source OS.... $(OS_SOURCE)
-	@$(ECHO)  Target OS.... $(OS_TARGET)
-	@$(ECHO)
-	@$(ECHO)  == Directory info ==
-	@$(ECHO)
-	@$(ECHO)  Basedir......... $(BASEDIR)
-	@$(ECHO)  FPCDir.......... $(FPCDIR)
-	@$(ECHO)  UnitsDir........ $(UNITSDIR)
-	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
-	@$(ECHO)
-	@$(ECHO)  GCC library..... $(GCCLIBDIR)
-	@$(ECHO)  Other library... $(OTHERLIBDIR)
-	@$(ECHO)
-	@$(ECHO)  == Tools info ==
-	@$(ECHO)
-	@$(ECHO)  Pwd....... $(PWD)
-	@$(ECHO)  Mv........ $(MVPROG)
-	@$(ECHO)  Cp........ $(CPPROG)
-	@$(ECHO)  Rm........ $(RMPROG)
-	@$(ECHO)  GInstall.. $(GINSTALL)
-	@$(ECHO)  Echo...... $(ECHO)
-	@$(ECHO)  Date...... $(DATE)
-	@$(ECHO)  FPCMake... $(FPCMAKE)
-	@$(ECHO)  PPUMove... $(PPUMOVE)
-	@$(ECHO)  Upx....... $(UPXPROG)
-	@$(ECHO)  Zip....... $(ZIPPROG)
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  Target Loaders...... $(TARGET_LOADERS)
-	@$(ECHO)  Target Units........ $(TARGET_UNITS)
-	@$(ECHO)  Target Programs..... $(TARGET_PROGRAMS)
-	@$(ECHO)  Target Dirs......... $(TARGET_DIRS)
-	@$(ECHO)  Target Examples..... $(TARGET_EXAMPLES)
-	@$(ECHO)  Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)
-	@$(ECHO)
-	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
-	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
-	@$(ECHO)
-	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
-	@$(ECHO)  Install Files....... $(INSTALL_FILES)
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-	@$(ECHO)  DateStr.............. $(DATESTR)
-	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
-	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
-	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
-	@$(ECHO)
-	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
-	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
-	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
-	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
-	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
-	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
-	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
-	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
-	@$(ECHO)
-	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
-	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
-	@$(ECHO)
-all: fpc_all
-debug: fpc_debug
-smart: fpc_smart
-examples:
-shared:
-install: fpc_install
-sourceinstall: fpc_sourceinstall
-exampleinstall: fpc_exampleinstall
-distinstall:
-zipinstall:
-zipsourceinstall:
-zipexampleinstall:
-zipdistinstall:
-clean: fpc_clean
-distclean: fpc_distclean
-cleanall: fpc_cleanall
-info: fpc_info
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info
-ifneq ($(wildcard fpcmake.loc),)
-include fpcmake.loc
-endif
-gdbint$(PPUEXT): gdbint.pas
-gdbcon$(PPUEXT): gdbcon.pas gdbint$(PPUEXT)

+ 0 - 14
ide/fake/gdb/Makefile.fpc

@@ -1,14 +0,0 @@
-#
-#   Makefile.fpc for Fake GDB
-#
-
-[target]
-units=gdbcon gdbint
-
-[default]
-fpcdir=../../..
-
-[rules]
-gdbint$(PPUEXT): gdbint.pas
-
-gdbcon$(PPUEXT): gdbcon.pas gdbint$(PPUEXT)

+ 0 - 216
ide/fake/gdb/gdbcon.pas

@@ -1,216 +0,0 @@
-{
-    $Id$
-
-    Fake GDBCon unit (including base from GDBInt)
-
- **********************************************************************}
-unit GDBCon;
-interface
-uses
-  GdbInt;
-
-type
-  PGDBController=^TGDBController;
-  TGDBController=object(TGDBInterface)
-    progname   : pchar;
-    progargs   : pchar;
-    in_command,
-    init_count : longint;
-    constructor Init;
-    destructor  Done;
-    procedure CommandBegin(const s:string);virtual;
-    procedure Command(const s:string);
-    procedure CommandEnd(const s:string);virtual;
-    procedure Reset;virtual;
-    procedure StartTrace;
-    procedure Run;virtual;
-    procedure TraceStep;virtual;
-    procedure TraceNext;virtual;
-    procedure TraceStepI;virtual;
-    procedure TraceNextI;virtual;
-    procedure Continue;virtual;
-    { needed for dos because newlines are only #10 (PM) }
-    procedure WriteErrorBuf;
-    procedure WriteOutputBuf;
-    function  GetOutput : Pchar;
-    function  GetError : Pchar;
-    function  LoadFile(const fn:string):boolean;
-    procedure SetArgs(const s : string);
-    procedure ClearSymbols;
-  end;
-
-  { gdb does not allow \ in dir or filenames }
-  procedure UnixDir(var s : string);
-
-
-implementation
-
-
-procedure UnixDir(var s : string);
-var i : longint;
-begin
-  for i:=1 to length(s) do
-    if s[i]='\' then s[i]:='/';
-end;
-
-
-constructor TGDBController.Init;
-begin
-  inherited Init;
-end;
-
-
-destructor TGDBController.Done;
-begin
-  inherited Done;
-end;
-
-
-procedure TGDBController.Command(const s:string);
-begin
-end;
-
-
-procedure TGDBController.CommandBegin(const s:string);
-begin
-end;
-
-
-procedure TGDBController.CommandEnd(const s:string);
-begin
-end;
-
-
-procedure TGDBController.Reset;
-begin
-end;
-
-
-function TGDBController.LoadFile(const fn:string):boolean;
-begin
-  LoadFile:=true;
-end;
-
-procedure TGDBController.SetArgs(const s : string);
-begin
-end;
-
-
-procedure TGDBController.StartTrace;
-begin
-  Run;
-end;
-
-
-procedure TGDBController.Run;
-begin
-end;
-
-
-procedure TGDBController.TraceStep;
-begin
-end;
-
-
-procedure TGDBController.TraceNext;
-begin
-end;
-
-
-procedure TGDBController.TraceStepI;
-begin
-end;
-
-
-procedure TGDBController.TraceNextI;
-begin
-end;
-
-
-procedure TGDBController.Continue;
-begin
-end;
-
-
-procedure TGDBController.ClearSymbols;
-begin
-end;
-
-
-procedure TGDBController.WriteErrorBuf;
-begin
-end;
-
-
-procedure TGDBController.WriteOutputBuf;
-begin
-end;
-
-
-function  TGDBController.GetOutput : Pchar;
-begin
-  GetOutput:=nil;
-end;
-
-
-function  TGDBController.GetError : Pchar;
-begin
-  GetError:=nil;
-end;
-
-end.
-{
-  $Log$
-  Revision 1.2  2001-04-25 22:38:38  peter
-    * updates from fixes branch so fpcmake for Makefiles works
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.11  1999/02/19 16:54:41  peter
-    * removed step tests
-
-  Revision 1.10  1999/02/16 10:44:14  peter
-    * updated
-
-  Revision 1.9  1999/02/11 13:03:28  pierre
-      Problem with last commit
-    + added virtuals CommandBegin and CommandEnd
-    + added command_level for TGDBInterface
-
-
-  Revision 1.7  1999/02/10 09:00:43  pierre
-     * duplicate call_reset removed
-     * frames allocation and freeing corrected
-     + GetError and GetOutput pchar function added
-     + stop_breakpoint_number to know why the program stopped
-       (used for watches)
-
-  Revision 1.6  1999/02/08 17:35:07  pierre
-    + added Run made TraceStep TraceNext Continue virtual
-
-  Revision 1.5  1999/02/08 13:59:58  pierre
-    - removed second debugger_started in TGDBController
-    + StartTrace and Reset made virtual to be able to
-      change CmResetDebugger state in IDE
-
-  Revision 1.4  1999/02/08 11:39:33  pierre
-   * reflect added setArgs in gdbint
-
-  Revision 1.3  1999/02/06 00:04:55  florian
-    * faked gdb fixed
-
-  Revision 1.2  1999/02/04 17:19:22  peter
-    * linux fixes
-
-  Revision 1.1  1999/02/02 16:38:05  peter
-    * renamed for better tp7 usage
-
-  Revision 1.1  1999/01/28 19:56:12  peter
-    * moved to include compiler/gdb independent of each other
-
-  Revision 1.1  1999/01/22 10:24:17  peter
-    + gdbcon fake unit
-
-}
-

+ 0 - 342
ide/fake/gdb/gdbint.pas

@@ -1,342 +0,0 @@
-{
-    $Id$
-
-    Fake GDBInt unit
-
- **********************************************************************}
-unit GDBInt;
-interface
-
-type
-  CORE_ADDR = cardinal; { might be target dependent PM }
-  streamtype = (afile,astring);
-  C_FILE     = longint; { at least under DJGPP }
-  P_C_FILE   = ^C_FILE;
-
-  psyminfo=^tsyminfo;
-  tsyminfo=record
-    address  : longint;
-    fname    : pchar;
-    line     : longint;
-    funcname : pchar;
-  end;
-
-  tframeentry = object
-    file_name : pchar;
-    function_name : pchar;
-    args : pchar;
-    line_number : longint;
-    address : longint;
-    constructor init;
-    destructor done;
-    procedure reset;
-    procedure clear;
-  end;
-  pframeentry=^tframeentry;
-  ppframeentry=^pframeentry;
-
-  tgdbbuffer=object
-    buf   : pchar;
-    size,
-    idx   : longint;
-    constructor Init;
-    destructor  Done;
-    procedure Reset;
-    procedure Resize(nsize : longint);
-    procedure Append(p:pchar);
-  end;
-
-  PGDBInterface=^TGDBInterface;
-  TGDBInterface=object
-    gdberrorbuf,
-    gdboutputbuf  : tgdbbuffer;
-    command_level,
-    got_error,
-    reset_command,
-    call_reset,
-    Debuggee_started : boolean;
-    { frames and frame info while recording a frame }
-    frames        : ppframeentry;
-    frame_size,
-    frame_count   : longint;
-    record_frames,
-    frame_begin_seen : boolean;
-    stop_breakpoint_number,
-    current_address,
-    current_line_number,
-    signal_start,
-    signal_end,
-    error_start,
-    error_end,
-    function_start,
-    function_end,
-    args_start,
-    args_end,
-    file_start,
-    file_end,
-    line_start,
-    line_end : longint;
-    current_pc      : CORE_ADDR;
-    { breakpoint }
-    last_breakpoint_number,
-    last_breakpoint_address,
-    last_breakpoint_line : longint;
-    last_breakpoint_file : pchar;
-    invalid_breakpoint_line : boolean;
-    { Highlevel }
-    user_screen_shown,
-    switch_to_user     : boolean;
-    constructor Init;
-    destructor  Done;
-    procedure clear_frames;
-    { functions }
-    function  error:boolean;
-    function  error_num:longint;
-    function  get_current_frame : longint;
-    function  set_current_frame(level : longint) : boolean;
-    procedure DebuggerScreen;
-    procedure UserScreen;
-    { Hooks }
-    procedure DoSelectSourceline(const fn:string;line:longint);virtual;
-    procedure DoStartSession;virtual;
-    procedure DoBreakSession;virtual;
-    procedure DoEndSession(code:longint);virtual;
-    procedure DoDebuggerScreen;virtual;
-    procedure DoUserScreen;virtual;
-    function  AllowQuit : boolean;virtual;
-  end;
-
-function  GDBVersion : string;
-
-var
-  curr_gdb : pgdbinterface;
-
-const
-  use_gdb_file : boolean = false;
-var
-  gdb_file : text;
-  inferior_pid : longint;
-
-implementation
-
-uses
-  strings;
-
-
-constructor TGDBInterface.Init;
-begin
-end;
-
-
-destructor TGDBInterface.Done;
-begin
-end;
-
-
-function tgdbinterface.error:boolean;
-begin
-  error:=false;
-end;
-
-function tgdbinterface.error_num:longint;
-begin
-  error_num:=0;
-end;
-
-function TGDBInterface.get_current_frame : longint;
-begin
-  get_current_frame:=0;
-end;
-
-function TGDBInterface.set_current_frame(level : longint) : boolean;
-begin
-  set_current_frame:=true;
-end;
-
-procedure TGDBInterface.Clear_Frames;
-begin
-end;
-
-
-procedure TGDBInterface.DebuggerScreen;
-begin
-end;
-
-
-procedure TGDBInterface.UserScreen;
-begin
-end;
-
-
-procedure TGDBInterface.DoSelectSourceline(const fn:string;line:longint);
-begin
-end;
-
-
-procedure TGDBInterface.DoStartSession;
-begin
-end;
-
-
-procedure TGDBInterface.DoBreakSession;
-begin
-end;
-
-
-procedure TGDBInterface.DoEndSession(code:longint);
-begin
-end;
-
-
-procedure TGDBInterface.DoDebuggerScreen;
-begin
-end;
-
-
-procedure TGDBInterface.DoUserScreen;
-begin
-end;
-
-function  tgdbinterface.AllowQuit : boolean;
-begin
-  AllowQuit:=true;
-end;
-
-function  GDBVersion : string;
-begin
-  GDBVersion:='Fake GDB';
-end;
-
-{*****************************************************************************
-                               TFrameEntry
-*****************************************************************************}
-
-constructor tframeentry.init;
-begin
-  Reset;
-end;
-
-destructor tframeentry.done;
-begin
-  Clear;
-end;
-
-procedure tframeentry.reset;
-begin
-  file_name:=nil;
-  function_name:=nil;
-  args:=nil;
-  line_number:=0;
-  address:=0;
-end;
-
-procedure tframeentry.clear;
-begin
-  if assigned(file_name) then
-   strdispose(file_name);
-  if assigned(function_name) then
-   strdispose(function_name);
-  if assigned(args) then
-   strdispose(args);
-  reset;
-end;
-
-
-{*****************************************************************************
-                                 tgdbbuffer
-*****************************************************************************}
-
-const
-  blocksize=2048;
-
-constructor tgdbbuffer.init;
-begin
-  Buf:=nil;
-  Size:=0;
-  Resize(blocksize);
-  Reset;
-end;
-
-
-destructor tgdbbuffer.done;
-begin
-  if assigned(buf) then
-    freemem(buf,size);
-end;
-
-
-
-procedure tgdbbuffer.reset;
-begin
-  idx:=0;
-  Buf[0]:=#0;
-end;
-
-
-procedure tgdbbuffer.append(p:pchar);
-var
-  len : longint;
-begin
-  if not assigned(p) then
-   exit;
-  len:=Strlen(p);
-  if len+idx>size then
-   Resize(len+idx);
-  Move(p^,buf[idx],len);
-  inc(idx,len);
-  buf[idx]:=#0;
-end;
-
-
-procedure tgdbbuffer.resize(nsize : longint);
-var
-  np    : pchar;
-begin
-  nsize:=((nsize+blocksize-1) div blocksize)*blocksize;
-  getmem(np,nsize);
-  move(buf^,np^,size);
-  freemem(buf,size);
-  buf:=np;
-  size:=nsize;
-end;
-
-
-end.
-{
-  $Log$
-  Revision 1.2  2001-04-25 22:38:38  peter
-    * updates from fixes branch so fpcmake for Makefiles works
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.9  2000/03/07 10:39:59  pierre
-   + inferior_pid moved to interface
-
-  Revision 1.8  2000/02/13 00:01:18  carl
-    * Private variables were wrongly placed.
-
-  Revision 1.7  2000/02/07 13:19:43  pierre
-   + Set_current_frame/Get_current_frame dummies
-
-  Revision 1.6  1999/11/25 20:22:59  peter
-    * package dependencies
-
-  Revision 1.5  1999/09/10 08:44:20  peter
-    * updated
-
-  Revision 1.4  1999/08/17 13:25:17  peter
-    * updates with the compiler browcol
-
-  Revision 1.3  1999/07/13 11:25:57  peter
-    * fixed typo in gdbversion
-
-  Revision 1.2  1999/07/12 13:08:20  pierre
-    + added GDBVersion function
-    * tries to intercept quit command from GDB Window
-    + AllowQuit method
-
-  Revision 1.1  1999/02/16 10:44:15  peter
-    * updated
-
-}

+ 0 - 1136
ide/text/Makefile

@@ -1,1136 +0,0 @@
-#
-# Don't edit, this file is generated by FPCMake Version 1.1 [2001/08/02]
-#
-default: all
-override PATH:=$(subst \,/,$(PATH))
-ifeq ($(findstring ;,$(PATH)),)
-inUnix=1
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-SEARCHPATH:=$(subst ;, ,$(PATH))
-endif
-PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
-ifeq ($(PWD),)
-PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
-ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=
-endif
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=.exe
-endif
-ifndef inUnix
-ifeq ($(OS),Windows_NT)
-inWinNT=1
-else
-ifdef OS2_SHELL
-inOS2=1
-endif
-endif
-else
-ifneq ($(findstring cygwin,$(MACHTYPE)),)
-inCygWin=1
-endif
-endif
-ifdef inUnix
-BATCHEXT=.sh
-else
-ifdef inOS2
-BATCHEXT=.cmd
-else
-BATCHEXT=.bat
-endif
-endif
-ifdef inUnix
-PATHSEP=/
-else
-PATHSEP:=$(subst /,\,/)
-endif
-ifdef PWD
-BASEDIR:=$(subst \,/,$(shell $(PWD)))
-ifdef inCygWin
-ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
-BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
-BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
-BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
-endif
-endif
-else
-BASEDIR=.
-endif
-ifndef FPC
-ifdef PP
-FPC=$(PP)
-else
-ifdef inUnix
-CPU_SOURCE=$(shell uname -m)
-ifeq (m68k,$(CPU_SOURCE))
-FPC=ppc68k
-else
-FPC=ppc386
-endif
-else
-FPC=ppc386
-endif
-endif
-endif
-override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
-endif
-ifndef OS_SOURCE
-OS_SOURCE:=$(shell $(FPC) -iSO)
-endif
-ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
-endif
-ifndef CPU_SOURCE
-CPU_SOURCE:=$(shell $(FPC) -iSP)
-endif
-ifndef FPC_VERSION
-FPC_VERSION:=$(shell $(FPC) -iV)
-endif
-export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=wrong
-endif
-else
-override FPCDIR=wrong
-endif
-ifeq ($(FPCDIR),wrong)
-override FPCDIR=../..
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=wrong
-endif
-endif
-endif
-ifeq ($(FPCDIR),wrong)
-ifdef inUnix
-override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
-endif
-else
-override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=c:/pp
-endif
-endif
-endif
-endif
-UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
-PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
-ifeq ($(OS_TARGET),linux)
-ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
-override FPCOPT+=-dUNIX
-endif
-endif
-ifeq ($(OS_TARGET),freebsd)
-ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
-override FPCOPT+=-dUNIX
-endif
-endif
-COMPILERDIR=compiler
-ifndef GDBINT
-GDBINT=gdbint
-endif
-ifeq ($(GDB),1)
-ifeq ($(DEBUG),1)
-ifneq ($(strip $(wildcard $(PACKAGESDIR)/$(GDBINT)/libgdb/d$(OS_TARGET)/libgdb.a)),)
-OSGDBDIR=d$(OS_TARGET)
-else
-OSGDBDIR=$(OS_TARGET)
-endif
-else
-OSGDBDIR=$(OS_TARGET)
-endif
-GDBLIBDIR+=$(wildcard $(addsuffix /$(GDBINT)/libgdb/$(OSGDBDIR),$(PACKAGESDIR)))
-GDBOBJDIR+=$(wildcard $(addsuffix /$(GDBINT)/libgdb/$(OSGDBDIR),$(PACKAGESDIR)))
-ifeq ($(OS_TARGET),go32v2)
-ifneq ($(DJDIR),)
-GDBLIBDIR+=$(DJDIR)/lib
-endif
-endif
-ifeq ($(strip $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))),)
-override GDB=0
-GDBFOUND=0
-else
-override LIBGDB=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
-GDBFOUND=1
-endif
-endif
-ifeq ($(GDB),1)
-override LIBDIR+=$(GDBLIBDIR)
-override OBJDIR+=$(GDBOBJDIR)
-else
-override UNITDIR+=../fake/gdb
-endif
-override TARGET_DIRS+=compiler
-override TARGET_PROGRAMS+=fp
-override INSTALL_DATADIR=$(INSTALL_BASEDIR)/ide
-override INSTALL_FPCPACKAGE=y
-override COMPILER_OPTIONS+=-Sg
-override COMPILER_UNITDIR+=$(COMPILERDIR)
-override COMPILER_TARGETDIR+=.
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO=
-else
-ECHO:=$(firstword $(ECHO))
-endif
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-ifndef DATE
-DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE=
-else
-DATE:=$(firstword $(DATE))
-endif
-else
-DATE:=$(firstword $(DATE))
-endif
-endif
-export DATE
-ifndef GINSTALL
-GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL=
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-endif
-export GINSTALL
-ifndef CPPROG
-CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(CPPROG),)
-CPPROG=
-else
-CPPROG:=$(firstword $(CPPROG))
-endif
-endif
-export CPPROG
-ifndef RMPROG
-RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(RMPROG),)
-RMPROG=
-else
-RMPROG:=$(firstword $(RMPROG))
-endif
-endif
-export RMPROG
-ifndef MVPROG
-MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(MVPROG),)
-MVPROG=
-else
-MVPROG:=$(firstword $(MVPROG))
-endif
-endif
-export MVPROG
-ifndef ECHOREDIR
-ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
-endif
-ifndef COPY
-COPY:=$(CPPROG) -fp
-endif
-ifndef COPYTREE
-COPYTREE:=$(CPPROG) -rfp
-endif
-ifndef MOVE
-MOVE:=$(MVPROG) -f
-endif
-ifndef DEL
-DEL:=$(RMPROG) -f
-endif
-ifndef DELTREE
-DELTREE:=$(RMPROG) -rf
-endif
-ifndef INSTALL
-ifdef inUnix
-INSTALL:=$(GINSTALL) -c -m 644
-else
-INSTALL:=$(COPY)
-endif
-endif
-ifndef INSTALLEXE
-ifdef inUnix
-INSTALLEXE:=$(GINSTALL) -c -m 755
-else
-INSTALLEXE:=$(COPY)
-endif
-endif
-ifndef MKDIR
-MKDIR:=$(GINSTALL) -m 755 -d
-endif
-export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
-ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(PPUMOVE),)
-PPUMOVE=
-else
-PPUMOVE:=$(firstword $(PPUMOVE))
-endif
-endif
-export PPUMOVE
-ifndef FPCMAKE
-FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(FPCMAKE),)
-FPCMAKE=
-else
-FPCMAKE:=$(firstword $(FPCMAKE))
-endif
-endif
-export FPCMAKE
-ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ZIPPROG),)
-ZIPPROG=
-else
-ZIPPROG:=$(firstword $(ZIPPROG))
-endif
-endif
-export ZIPPROG
-ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(TARPROG),)
-TARPROG=
-else
-TARPROG:=$(firstword $(TARPROG))
-endif
-endif
-export TARPROG
-ifndef AS
-AS=as
-endif
-ifndef LD
-LD=ld
-endif
-ifndef RC
-RC=rc
-endif
-PPAS=ppas$(BATCHEXT)
-ifdef inUnix
-LDCONFIG=ldconfig
-else
-LDCONFIG=
-endif
-ifdef DATE
-DATESTR:=$(shell $(DATE) +%Y%m%d)
-else
-DATESTR=
-endif
-ifndef UPXPROG
-ifeq ($(OS_TARGET),go32v2)
-UPXPROG:=1
-endif
-ifeq ($(OS_TARGET),win32)
-UPXPROG:=1
-endif
-ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(UPXPROG),)
-UPXPROG=
-else
-UPXPROG:=$(firstword $(UPXPROG))
-endif
-else
-UPXPROG=
-endif
-endif
-export UPXPROG
-ZIPOPT=-9
-ZIPEXT=.zip
-ifeq ($(USETAR),bz2)
-TAROPT=vI
-TAREXT=.tar.bz2
-else
-TAROPT=vz
-TAREXT=.tar.gz
-endif
-LOADEREXT=.as
-EXEEXT=.exe
-PPLEXT=.ppl
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.so
-STATICLIBPREFIX=libp
-RSTEXT=.rst
-FPCMADE=fpcmade
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-STATICLIBPREFIX=
-FPCMADE=fpcmade.v1
-PACKAGESUFFIX=v1
-endif
-ifeq ($(OS_TARGET),go32v2)
-STATICLIBPREFIX=
-FPCMADE=fpcmade.dos
-ZIPSUFFIX=go32
-endif
-ifeq ($(OS_TARGET),linux)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.lnx
-ZIPSUFFIX=linux
-endif
-ifeq ($(OS_TARGET),freebsd)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.freebsd
-ZIPSUFFIX=freebsd
-endif
-ifeq ($(OS_TARGET),win32)
-PPUEXT=.ppw
-OEXT=.ow
-ASMEXT=.sw
-SMARTEXT=.slw
-STATICLIBEXT=.aw
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.w32
-ZIPSUFFIX=w32
-endif
-ifeq ($(OS_TARGET),os2)
-PPUEXT=.ppo
-ASMEXT=.so2
-OEXT=.oo2
-AOUTEXT=.out
-SMARTEXT=.so
-STATICLIBEXT=.ao2
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.os2
-ZIPSUFFIX=emx
-endif
-ifeq ($(OS_TARGET),amiga)
-EXEEXT=
-PPUEXT=.ppa
-ASMEXT=.asm
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.library
-FPCMADE=fpcmade.amg
-endif
-ifeq ($(OS_TARGET),atari)
-PPUEXT=.ppt
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=.ttp
-FPCMADE=fpcmade.ata
-endif
-ifdef REQUIRE_UNITSDIR
-override UNITSDIR+=$(REQUIRE_UNITSDIR)
-endif
-ifdef REQUIRE_PACKAGESDIR
-override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
-endif
-ifdef ZIPINSTALL
-ifeq ($(OS_TARGET),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-UNIXINSTALLDIR=1
-endif
-else
-ifeq ($(OS_SOURCE),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_SOURCE),freebsd)
-UNIXINSTALLDIR=1
-endif
-endif
-ifndef INSTALL_PREFIX
-ifdef UNIXINSTALLDIR
-INSTALL_PREFIX=/usr/local
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=/pp
-else
-INSTALL_BASEDIR:=/$(PACKAGE_NAME)
-endif
-endif
-endif
-export INSTALL_PREFIX
-ifndef DIST_DESTDIR
-DIST_DESTDIR:=$(BASEDIR)
-endif
-export DIST_DESTDIR
-ifndef INSTALL_BASEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
-endif
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)
-endif
-endif
-ifndef INSTALL_BINDIR
-ifdef UNIXINSTALLDIR
-INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
-else
-INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
-endif
-endif
-endif
-ifndef INSTALL_UNITDIR
-INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
-ifdef INSTALL_FPCPACKAGE
-ifdef PACKAGE_NAME
-INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
-endif
-endif
-endif
-ifndef INSTALL_LIBDIR
-ifdef UNIXINSTALLDIR
-INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
-else
-INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
-endif
-endif
-ifndef INSTALL_SOURCEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source
-endif
-endif
-endif
-ifndef INSTALL_DOCDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
-endif
-endif
-endif
-ifndef INSTALL_EXAMPLEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
-endif
-endif
-endif
-ifndef INSTALL_DATADIR
-INSTALL_DATADIR=$(INSTALL_BASEDIR)
-endif
-ifdef inUnix
-ifndef GCCLIBDIR
-GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-ifndef OTHERLIBDIR
-OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-export GCCLIBDIR OTHERLIB
-endif
-ifeq ($(OS_TARGET),linux)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-REQUIRE_PACKAGES_GDBINT=1
-endif
-ifeq ($(OS_TARGET),go32v2)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-REQUIRE_PACKAGES_GDBINT=1
-endif
-ifeq ($(OS_TARGET),win32)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-REQUIRE_PACKAGES_GDBINT=1
-endif
-ifeq ($(OS_TARGET),os2)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-REQUIRE_PACKAGES_GDBINT=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-REQUIRE_PACKAGES_GDBINT=1
-endif
-ifeq ($(OS_TARGET),beos)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-REQUIRE_PACKAGES_GDBINT=1
-endif
-ifeq ($(OS_TARGET),amiga)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-REQUIRE_PACKAGES_GDBINT=1
-endif
-ifeq ($(OS_TARGET),atari)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-REQUIRE_PACKAGES_GDBINT=1
-endif
-ifdef REQUIRE_PACKAGES_RTL
-PACKAGEDIR_RTL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))
-ifneq ($(PACKAGEDIR_RTL),)
-PACKAGEDIR_RTL:=$(firstword $(PACKAGEDIR_RTL))
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_rtl
-package_rtl:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
-UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
-else
-UNITDIR_RTL=$(PACKAGEDIR_RTL)
-endif
-else
-PACKAGEDIR_RTL=
-UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
-ifneq ($(UNITDIR_RTL),)
-UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
-else
-UNITDIR_RTL=
-endif
-endif
-ifdef UNITDIR_RTL
-override COMPILER_UNITDIR+=$(UNITDIR_RTL)
-endif
-endif
-ifdef REQUIRE_PACKAGES_FV
-PACKAGEDIR_FV:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fv/Makefile.fpc,$(PACKAGESDIR)))))
-ifneq ($(PACKAGEDIR_FV),)
-PACKAGEDIR_FV:=$(firstword $(PACKAGEDIR_FV))
-ifeq ($(wildcard $(PACKAGEDIR_FV)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_fv
-package_fv:
-	$(MAKE) -C $(PACKAGEDIR_FV) all
-endif
-ifneq ($(wildcard $(PACKAGEDIR_FV)/$(OS_TARGET)),)
-UNITDIR_FV=$(PACKAGEDIR_FV)/$(OS_TARGET)
-else
-UNITDIR_FV=$(PACKAGEDIR_FV)
-endif
-else
-PACKAGEDIR_FV=
-UNITDIR_FV:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fv/Package.fpc,$(UNITSDIR)))))
-ifneq ($(UNITDIR_FV),)
-UNITDIR_FV:=$(firstword $(UNITDIR_FV))
-else
-UNITDIR_FV=
-endif
-endif
-ifdef UNITDIR_FV
-override COMPILER_UNITDIR+=$(UNITDIR_FV)
-endif
-endif
-ifdef REQUIRE_PACKAGES_GDBINT
-PACKAGEDIR_GDBINT:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gdbint/Makefile.fpc,$(PACKAGESDIR)))))
-ifneq ($(PACKAGEDIR_GDBINT),)
-PACKAGEDIR_GDBINT:=$(firstword $(PACKAGEDIR_GDBINT))
-ifeq ($(wildcard $(PACKAGEDIR_GDBINT)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_gdbint
-package_gdbint:
-	$(MAKE) -C $(PACKAGEDIR_GDBINT) all
-endif
-ifneq ($(wildcard $(PACKAGEDIR_GDBINT)/$(OS_TARGET)),)
-UNITDIR_GDBINT=$(PACKAGEDIR_GDBINT)/$(OS_TARGET)
-else
-UNITDIR_GDBINT=$(PACKAGEDIR_GDBINT)
-endif
-else
-PACKAGEDIR_GDBINT=
-UNITDIR_GDBINT:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /gdbint/Package.fpc,$(UNITSDIR)))))
-ifneq ($(UNITDIR_GDBINT),)
-UNITDIR_GDBINT:=$(firstword $(UNITDIR_GDBINT))
-else
-UNITDIR_GDBINT=
-endif
-endif
-ifdef UNITDIR_GDBINT
-override COMPILER_UNITDIR+=$(UNITDIR_GDBINT)
-endif
-endif
-.PHONY: package_rtl package_fv package_gdbint
-override FPCOPTDEF=$(CPU_TARGET)
-ifneq ($(OS_TARGET),$(OS_SOURCE))
-override FPCOPT+=-T$(OS_TARGET)
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-ifdef LINKSMART
-override FPCOPT+=-XX
-endif
-ifdef CREATESMART
-override FPCOPT+=-CX
-endif
-ifdef DEBUG
-override FPCOPT+=-gl
-override FPCOPTDEF+=DEBUG
-endif
-ifdef RELEASE
-override FPCOPT+=-Xs -OG2p3 -n
-override FPCOPTDEF+=RELEASE
-endif
-ifdef STRIP
-override FPCOPT+=-Xs
-endif
-ifdef OPTIMIZE
-override FPCOPT+=-OG2p3
-endif
-ifdef VERBOSE
-override FPCOPT+=-vwni
-endif
-ifdef COMPILER_OPTIONS
-override FPCOPT+=$(COMPILER_OPTIONS)
-endif
-ifdef COMPILER_UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
-endif
-ifdef COMPILER_LIBRARYDIR
-override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
-endif
-ifdef COMPILER_OBJECTDIR
-override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
-endif
-ifdef COMPILER_INCLUDEDIR
-override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
-endif
-ifdef COMPILER_TARGETDIR
-override FPCOPT+=-FE$(COMPILER_TARGETDIR)
-ifeq ($(COMPILER_TARGETDIR),.)
-override TARGETDIRPREFIX=
-else
-override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-endif
-ifdef COMPILER_UNITTARGETDIR
-override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
-ifeq ($(COMPILER_UNITTARGETDIR),.)
-override UNITTARGETDIRPREFIX=
-else
-override UNITTARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-else
-ifdef COMPILER_TARGETDIR
-override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
-override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
-endif
-endif
-ifdef GCCLIBDIR
-override FPCOPT+=-Fl$(GCCLIBDIR)
-endif
-ifdef OTHERLIBDIR
-override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
-endif
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef FPCOPTDEF
-override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
-endif
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-ifdef USEENV
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
-endif
-override COMPILER:=$(FPC) $(FPCOPT)
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-ifeq ($(OS_SOURCE),$(OS_TARGET))
-EXECPPAS:=@$(PPAS)
-endif
-endif
-.PHONY: fpc_exes
-ifdef TARGET_PROGRAMS
-override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
-override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
-override ALLTARGET+=fpc_exes
-override INSTALLEXEFILES+=$(EXEFILES)
-override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
-ifeq ($(OS_TARGET),os2)
-override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
-endif
-endif
-fpc_exes: $(EXEFILES)
-ifdef TARGET_RSTS
-override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
-override CLEANRSTFILES+=$(RSTFILES)
-endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
-$(FPCMADE): $(ALLTARGET)
-	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
-fpc_smart:
-	$(MAKE) all LINKSMART=1 CREATESMART=1
-fpc_debug:
-	$(MAKE) all DEBUG=1
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
-%$(PPUEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(PPUEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
-.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
-ifdef INSTALL_UNITS
-override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
-endif
-ifdef INSTALLPPUFILES
-override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
-override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
-override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
-override INSTALL_CREATEPACKAGEFPC=1
-endif
-ifdef INSTALLEXEFILES
-override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
-endif
-fpc_install: $(INSTALLTARGET)
-ifdef INSTALLEXEFILES
-	$(MKDIR) $(INSTALL_BINDIR)
-ifdef UPXPROG
-	-$(UPXPROG) $(INSTALLEXEFILES)
-endif
-	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
-endif
-ifdef INSTALL_CREATEPACKAGEFPC
-ifdef FPCMAKE
-ifdef PACKAGE_VERSION
-ifneq ($(wildcard Makefile.fpc),)
-	$(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
-endif
-endif
-endif
-endif
-ifdef INSTALLPPUFILES
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
-ifneq ($(INSTALLPPULINKFILES),)
-	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
-endif
-ifneq ($(wildcard $(LIB_FULLNAME)),)
-	$(MKDIR) $(INSTALL_LIBDIR)
-	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
-ifdef inUnix
-	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
-endif
-endif
-endif
-ifdef INSTALL_FILES
-	$(MKDIR) $(INSTALL_DATADIR)
-	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
-endif
-fpc_sourceinstall: distclean
-	$(MKDIR) $(INSTALL_SOURCEDIR)
-	$(COPYTREE) $(BASEDIR) $(INSTALL_SOURCEDIR)
-fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
-ifdef HASEXAMPLES
-	$(MKDIR) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef EXAMPLESOURCEFILES
-	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef TARGET_EXAMPLEDIRS
-	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
-endif
-.PHONY: fpc_clean fpc_cleanall fpc_distclean
-ifdef EXEFILES
-override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
-endif
-ifdef CLEAN_UNITS
-override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
-endif
-ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
-override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
-override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
-endif
-fpc_clean: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-ifdef CLEAN_FILES
-	-$(DEL) $(CLEAN_FILES)
-endif
-ifdef LIB_NAME
-	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
-endif
-	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-fpc_distclean: clean
-ifdef COMPILER_UNITTARGETDIR
-TARGETDIRCLEAN=fpc_clean
-endif
-fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-ifdef AOUTEXT
-	-$(DEL) *$(AOUTEXT)
-endif
-.PHONY: fpc_info
-fpc_info:
-	@$(ECHO)
-	@$(ECHO)  == Package info ==
-	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
-	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPC.......... $(FPC)
-	@$(ECHO)  FPC Version.. $(FPC_VERSION)
-	@$(ECHO)  Source CPU... $(CPU_SOURCE)
-	@$(ECHO)  Target CPU... $(CPU_TARGET)
-	@$(ECHO)  Source OS.... $(OS_SOURCE)
-	@$(ECHO)  Target OS.... $(OS_TARGET)
-	@$(ECHO)
-	@$(ECHO)  == Directory info ==
-	@$(ECHO)
-	@$(ECHO)  Basedir......... $(BASEDIR)
-	@$(ECHO)  FPCDir.......... $(FPCDIR)
-	@$(ECHO)  UnitsDir........ $(UNITSDIR)
-	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
-	@$(ECHO)
-	@$(ECHO)  GCC library..... $(GCCLIBDIR)
-	@$(ECHO)  Other library... $(OTHERLIBDIR)
-	@$(ECHO)
-	@$(ECHO)  == Tools info ==
-	@$(ECHO)
-	@$(ECHO)  Pwd....... $(PWD)
-	@$(ECHO)  Mv........ $(MVPROG)
-	@$(ECHO)  Cp........ $(CPPROG)
-	@$(ECHO)  Rm........ $(RMPROG)
-	@$(ECHO)  GInstall.. $(GINSTALL)
-	@$(ECHO)  Echo...... $(ECHO)
-	@$(ECHO)  Date...... $(DATE)
-	@$(ECHO)  FPCMake... $(FPCMAKE)
-	@$(ECHO)  PPUMove... $(PPUMOVE)
-	@$(ECHO)  Upx....... $(UPXPROG)
-	@$(ECHO)  Zip....... $(ZIPPROG)
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  Target Loaders...... $(TARGET_LOADERS)
-	@$(ECHO)  Target Units........ $(TARGET_UNITS)
-	@$(ECHO)  Target Programs..... $(TARGET_PROGRAMS)
-	@$(ECHO)  Target Dirs......... $(TARGET_DIRS)
-	@$(ECHO)  Target Examples..... $(TARGET_EXAMPLES)
-	@$(ECHO)  Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)
-	@$(ECHO)
-	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
-	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
-	@$(ECHO)
-	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
-	@$(ECHO)  Install Files....... $(INSTALL_FILES)
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-	@$(ECHO)  DateStr.............. $(DATESTR)
-	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
-	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
-	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
-	@$(ECHO)
-	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
-	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
-	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
-	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
-	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
-	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
-	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
-	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
-	@$(ECHO)
-	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
-	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
-	@$(ECHO)
-TARGET_DIRS_COMPILER=1
-ifdef TARGET_DIRS_COMPILER
-compiler_all:
-	$(MAKE) -C compiler all
-compiler_debug:
-	$(MAKE) -C compiler debug
-compiler_smart:
-	$(MAKE) -C compiler smart
-compiler_examples:
-	$(MAKE) -C compiler examples
-compiler_shared:
-	$(MAKE) -C compiler shared
-compiler_install:
-	$(MAKE) -C compiler install
-compiler_sourceinstall:
-	$(MAKE) -C compiler sourceinstall
-compiler_exampleinstall:
-	$(MAKE) -C compiler exampleinstall
-compiler_distinstall:
-	$(MAKE) -C compiler distinstall
-compiler_zipinstall:
-	$(MAKE) -C compiler zipinstall
-compiler_zipsourceinstall:
-	$(MAKE) -C compiler zipsourceinstall
-compiler_zipexampleinstall:
-	$(MAKE) -C compiler zipexampleinstall
-compiler_zipdistinstall:
-	$(MAKE) -C compiler zipdistinstall
-compiler_clean:
-	$(MAKE) -C compiler clean
-compiler_distclean:
-	$(MAKE) -C compiler distclean
-compiler_cleanall:
-	$(MAKE) -C compiler cleanall
-compiler_info:
-	$(MAKE) -C compiler info
-compiler:
-	$(MAKE) -C compiler all
-.PHONY: compiler_all compiler_debug compiler_smart compiler_examples compiler_shared compiler_install compiler_sourceinstall compiler_exampleinstall compiler_distinstall compiler_zipinstall compiler_zipsourceinstall compiler_zipexampleinstall compiler_zipdistinstall compiler_clean compiler_distclean compiler_cleanall compiler_info compiler
-endif
-debug: fpc_debug
-smart: fpc_smart
-examples: $(addsuffix _examples,$(TARGET_DIRS))
-shared: $(addsuffix _shared,$(TARGET_DIRS))
-sourceinstall: fpc_sourceinstall $(addsuffix _sourceinstall,$(TARGET_DIRS))
-exampleinstall: fpc_exampleinstall $(addsuffix _exampleinstall,$(TARGET_DIRS))
-distinstall: $(addsuffix _distinstall,$(TARGET_DIRS))
-zipinstall: $(addsuffix _zipinstall,$(TARGET_DIRS))
-zipsourceinstall: $(addsuffix _zipsourceinstall,$(TARGET_DIRS))
-zipexampleinstall: $(addsuffix _zipexampleinstall,$(TARGET_DIRS))
-zipdistinstall: $(addsuffix _zipdistinstall,$(TARGET_DIRS))
-cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
-info: fpc_info
-.PHONY: debug smart examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info
-ifneq ($(wildcard fpcmake.loc),)
-include fpcmake.loc
-endif
-.PHONY: compilerunits compilerclean \
-	fake fakegdb gdb full fullgdb \
-	clean_compiler clean testgdb postgdbinfo
-clean: fpc_cleanall
-distclean: clean compilerclean
-fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
-testgdb:
-ifneq ($(GDBFOUND),0)
-	@$(ECHO) LibGDB found in $(LIBGDB)
-else
-	@$(ECHO) LibGDB not found
-	@$(ECHO) LIBGDB=$(LIBGDB)
-	@$(ECHO) GDBLIBDIR=$(GDBLIBDIR)
-	@$(ECHO) $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))
-endif
-postgdbinfo:
-ifeq ($(GDBFOUND),0)
-	@$(ECHO) LibGDB was not found, IDE has no Debugger support
-endif
-compilerunits : $(COMPILERDIR)/$(FPCMADE)
-$(COMPILERDIR)/$(FPCMADE):
-	$(MAKE) -C $(COMPILERDIR) all
-compilerclean :
-	$(MAKE) -C $(COMPILERDIR) clean
-all: compilerunits fpc_all
-gdb:
-	$(MAKE) testgdb all GDB=1 postgdbinfo
-fakegdb:
-	$(MAKE) testgdb all FAKE=1 GDB=1 postgdbinfo
-fake:
-	$(MAKE) all FAKE=1
-full: all
-fullgdb: gdb
-clean: cleanall
-ifndef UNIXINSTALLDIR
-override INSTALL_DATADIR=$(INSTALL_BINDIR)
-endif
-install: fpc_install
-	$(MKDIR) $(INSTALL_DATADIR)
-	$(MKDIR) $(INSTALL_DOCDIR)
-	$(INSTALL) fp.ans $(wildcard *.pt) $(wildcard *.tdf) $(INSTALL_DATADIR)
-	$(INSTALL) readme.ide $(INSTALL_DOCDIR)
-clean_compiler:
-	$(MAKE) -C ../../compiler clean

+ 0 - 172
ide/text/Makefile.fpc

@@ -1,172 +0,0 @@
-#
-#   Makefile.fpc for FP IDE
-#
-
-[target]
-# this will be undefined when the fake compiler is used
-dirs=compiler
-programs=fp
-rst=fpstrings
-
-[install]
-datadir=$(INSTALL_BASEDIR)/ide
-fpcpackage=y
-
-[compiler]
-options=-Sg
-targetdir=.
-unitdir=$(COMPILERDIR)
-
-[require]
-packages=fv gdbint
-
-[default]
-fpcdir=../..
-
-[prerules]
-ifeq ($(OS_TARGET),linux)
-ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
-override FPCOPT+=-dUNIX
-endif
-endif
-
-ifeq ($(OS_TARGET),freebsd)
-ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
-override FPCOPT+=-dUNIX
-endif
-endif
-
-# Compiler dir
-#ifdef FAKE
-#COMPILERDIR=../fake/compiler
-#else
-COMPILERDIR=compiler
-#endif
-
-# when including debugger include the gdbinterface
-ifndef GDBINT
-GDBINT=gdbint
-endif
-
-# Try to find GDB library
-ifeq ($(GDB),1)
-ifeq ($(DEBUG),1)
-# First test if a debug version exists in a specific dir
-ifneq ($(strip $(wildcard $(PACKAGESDIR)/$(GDBINT)/libgdb/d$(OS_TARGET)/libgdb.a)),)
-OSGDBDIR=d$(OS_TARGET)
-else
-OSGDBDIR=$(OS_TARGET)
-endif
-else
-OSGDBDIR=$(OS_TARGET)
-endif
-GDBLIBDIR+=$(wildcard $(addsuffix /$(GDBINT)/libgdb/$(OSGDBDIR),$(PACKAGESDIR)))
-GDBOBJDIR+=$(wildcard $(addsuffix /$(GDBINT)/libgdb/$(OSGDBDIR),$(PACKAGESDIR)))
-ifeq ($(OS_TARGET),go32v2)
-ifneq ($(DJDIR),)
-GDBLIBDIR+=$(DJDIR)/lib
-endif
-endif
-ifeq ($(strip $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))),)
-override GDB=0
-GDBFOUND=0
-else
-override LIBGDB=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
-GDBFOUND=1
-endif
-endif
-
-ifeq ($(GDB),1)
-# The gdbint is already included due the gdbint package dependency
-override LIBDIR+=$(GDBLIBDIR)
-override OBJDIR+=$(GDBOBJDIR)
-else
-override UNITDIR+=../fake/gdb
-endif
-
-
-[rules]
-.PHONY: compilerunits compilerclean \
-        fake fakegdb gdb full fullgdb \
-        clean_compiler clean testgdb postgdbinfo
-
-clean: fpc_cleanall
-
-distclean: clean compilerclean
-
-fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
-
-testgdb:
-ifneq ($(GDBFOUND),0)
-        @$(ECHO) LibGDB found in $(LIBGDB)
-else
-        @$(ECHO) LibGDB not found
-        @$(ECHO) LIBGDB=$(LIBGDB)
-        @$(ECHO) GDBLIBDIR=$(GDBLIBDIR)
-        @$(ECHO) $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))
-endif
-
-postgdbinfo:
-ifeq ($(GDBFOUND),0)
-        @$(ECHO) LibGDB was not found, IDE has no Debugger support
-endif
-
-#
-# Compiler
-#
-
-compilerunits : $(COMPILERDIR)/$(FPCMADE)
-$(COMPILERDIR)/$(FPCMADE):
-        $(MAKE) -C $(COMPILERDIR) all
-
-compilerclean :
-        $(MAKE) -C $(COMPILERDIR) clean
-
-#
-# Default targets
-#
-all: compilerunits fpc_all
-
-gdb:
-        $(MAKE) testgdb all GDB=1 postgdbinfo
-
-#
-# Fake targets
-#
-fakegdb:
-        $(MAKE) testgdb all FAKE=1 GDB=1 postgdbinfo
-
-fake:
-        $(MAKE) all FAKE=1
-
-#
-# Compatibility targets
-#
-full: all
-
-fullgdb: gdb
-
-# This is necessary because we don't have all units separate in the
-# units targets
-clean: cleanall
-
-#
-# Installation
-#
-
-ifndef UNIXINSTALLDIR
-override INSTALL_DATADIR=$(INSTALL_BINDIR)
-endif
-
-install: fpc_install
-        $(MKDIR) $(INSTALL_DATADIR)
-        $(MKDIR) $(INSTALL_DOCDIR)
-        $(INSTALL) fp.ans $(wildcard *.pt) $(wildcard *.tdf) $(INSTALL_DATADIR)
-        $(INSTALL) readme.ide $(INSTALL_DOCDIR)
-
-
-#
-# Misc
-#
-clean_compiler:
-        $(MAKE) -C ../../compiler clean

+ 0 - 14
ide/text/README

@@ -1,14 +0,0 @@
-
-You can have a fp.cfg file in the same directory as fp.exe. It works the
-same as ppc386.cfg
-
-If you want to create a fully working IDE you need to compile with a
-unit path to ../.. and for an IDE without compiler compile with ../fake
-
-# IDE with full compiler compile with:
-ppc386 fp -Fu../..
-
-# IDE with fake compiler compile with:
-ppc386 fp -Fu../fake
-
-

+ 0 - 88
ide/text/TODO

@@ -1,88 +0,0 @@
-Bugs/Problems:
-- The unindent doesn't work when a tab char is in front of the line. Tab
-  chars should be ignored in this case.
-- Files without extensions can't be opened using the open dialog (even
-  not with a trailing .)
-- fix function locatefile in fputils (always returns '' currently because
-  the result of locatesinglefile is simply discarded). This causes (at least
-  under Dos) an RTE 3 if you try to open several files in different directories
-
-From Marco:
------------
-
-1 When cursor is at column 1, and you press cursor left, you don't go to the end of
-        the last line.
-  This isn't the behavior of the TP IDE maybe it should be supported
-  only with an option (FK)
-
-2 When you go beyond the last
-        character on a line, you keep on moving instead of free cursor move
-3 If you press down (or up), and the new line is less full then the current, you
-   don't end up on the last written character, but somewhere in the void.
-
-Since 2 and 3 are probably a matter of taste. Maybe an option
-        "relaxed cursor movement" o.s.s.
-
-4. ctrl-K g option. (scans the windows for an active block and
-         - if only one block defined, copy block to active window
-         - If more blocks defined prompt for number of window to copy from.)
-
-5 Can the dialogs (specially the file open) get somewhat bigger in 80x50?  space
-        enough. (I now use this mode, and except for this it seems to work ok)
-
-
-and definitely the most annoying one:
-
-6 ctrl-T sometimes deletes in blocks, and even when no blocks are defined, it
-doesn't work right! (check BP. But also e.g. Qedit and Pegasus has this key.
-Joe is an exception however)
-
-Rough description:
-- When pressed on a character n alphanumerical character ('a'..'z','A'..'Z','0'..'9') it should
-delete all alphanumerical characters until next non alphanumerical character.
-- When pressed on a space or tab it should delete all space and tabs until
-   a normal character (anything but space and tab)
-- When pressed on neither spacetab nor alphanumeric (so. '!'..')',[',']',\'  linefeed, etc)
-        ctrl-t acts the same as delete.
-
-Another bad one (for wordstar fanatics like me)
-
-7 ctrl-k t  (define block on word) marks a block, but the block can't be copied.
-
-8  (related to 7?) ctrl-k c only works if the defined blocks is visible. If you press
-        page-down a few times, it doesn't work anymore. Ctrl-k v (move) works fine however.
-
-9  F7 (trace into) a unit causes emergency exit (cannot run a unit?)
-
-10 When I set the memory of a dosbox to 16 MB DPMI, and debug the
-	compiler, emergency exit (very rarely even without cleaning the
-screen)
-
-Not bugs, but things I don't like:
-
-10a  Pressing F8 on a FOR loop should exec until after the for loop, not
-jump    into the loop? I believe BP also does this, but I always hated it.
-Now the
-	only way to jump over a for loop is to use breakpoints.
-10b  Bugs 1-8 are not solved :-)
-
-Things I like:
-
-11
-
-When I press F7 to start tracing, always some sources (and the main
-exe) 
-are rebuilt, even when I didn't change anything. (test source: the
-compiler)
-
-
---- Ideas ---
-
- * Integrated source beautifier (fully configurable)
- * Add some other classes to syntax highlight
-   (eg. highlight standard Pascal types, etc.)
- * ASCII-table for inserting chars not accessible thru keyboard
- * Binary->source (const table/array) converter
- * Browse all vars in debug mode, much like TD inspect command, but then
-    browsable instead of having to type names.
-

+ 0 - 960
ide/text/compiler/Makefile

@@ -1,960 +0,0 @@
-#
-# Don't edit, this file is generated by FPCMake Version 1.1 [2001/08/02]
-#
-default: all
-override PATH:=$(subst \,/,$(PATH))
-ifeq ($(findstring ;,$(PATH)),)
-inUnix=1
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-SEARCHPATH:=$(subst ;, ,$(PATH))
-endif
-PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
-ifeq ($(PWD),)
-PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
-ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=
-endif
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=.exe
-endif
-ifndef inUnix
-ifeq ($(OS),Windows_NT)
-inWinNT=1
-else
-ifdef OS2_SHELL
-inOS2=1
-endif
-endif
-else
-ifneq ($(findstring cygwin,$(MACHTYPE)),)
-inCygWin=1
-endif
-endif
-ifdef inUnix
-BATCHEXT=.sh
-else
-ifdef inOS2
-BATCHEXT=.cmd
-else
-BATCHEXT=.bat
-endif
-endif
-ifdef inUnix
-PATHSEP=/
-else
-PATHSEP:=$(subst /,\,/)
-endif
-ifdef PWD
-BASEDIR:=$(subst \,/,$(shell $(PWD)))
-ifdef inCygWin
-ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
-BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
-BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
-BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
-endif
-endif
-else
-BASEDIR=.
-endif
-ifndef FPC
-ifdef PP
-FPC=$(PP)
-else
-ifdef inUnix
-CPU_SOURCE=$(shell uname -m)
-ifeq (m68k,$(CPU_SOURCE))
-FPC=ppc68k
-else
-FPC=ppc386
-endif
-else
-FPC=ppc386
-endif
-endif
-endif
-override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
-override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
-endif
-ifndef OS_SOURCE
-OS_SOURCE:=$(shell $(FPC) -iSO)
-endif
-ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
-endif
-ifndef CPU_SOURCE
-CPU_SOURCE:=$(shell $(FPC) -iSP)
-endif
-ifndef FPC_VERSION
-FPC_VERSION:=$(shell $(FPC) -iV)
-endif
-export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=wrong
-endif
-else
-override FPCDIR=wrong
-endif
-ifeq ($(FPCDIR),wrong)
-override FPCDIR=../../..
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=wrong
-endif
-endif
-endif
-ifeq ($(FPCDIR),wrong)
-ifdef inUnix
-override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
-ifeq ($(wildcard $(FPCDIR)/units),)
-override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
-endif
-else
-override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR:=$(FPCDIR)/..
-ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
-override FPCDIR=c:/pp
-endif
-endif
-endif
-endif
-UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
-PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
-override TARGET_UNITS+=compunit
-override INSTALL_FPCPACKAGE=y
-override COMPILER_OPTIONS+=-Ca
-override COMPILER_INCLUDEDIR+=$(FPCDIR)/compiler $(FPCDIR)/compiler/$(CPU_TARGET)
-override COMPILER_UNITDIR+=$(FPCDIR)/compiler $(FPCDIR)/compiler/$(CPU_TARGET) $(FPCDIR)/compiler/targets
-override COMPILER_TARGETDIR+=.
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO=
-else
-ECHO:=$(firstword $(ECHO))
-endif
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-ifndef DATE
-DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE=
-else
-DATE:=$(firstword $(DATE))
-endif
-else
-DATE:=$(firstword $(DATE))
-endif
-endif
-export DATE
-ifndef GINSTALL
-GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(GINSTALL),)
-GINSTALL=
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-else
-GINSTALL:=$(firstword $(GINSTALL))
-endif
-endif
-export GINSTALL
-ifndef CPPROG
-CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(CPPROG),)
-CPPROG=
-else
-CPPROG:=$(firstword $(CPPROG))
-endif
-endif
-export CPPROG
-ifndef RMPROG
-RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(RMPROG),)
-RMPROG=
-else
-RMPROG:=$(firstword $(RMPROG))
-endif
-endif
-export RMPROG
-ifndef MVPROG
-MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(MVPROG),)
-MVPROG=
-else
-MVPROG:=$(firstword $(MVPROG))
-endif
-endif
-export MVPROG
-ifndef ECHOREDIR
-ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
-endif
-ifndef COPY
-COPY:=$(CPPROG) -fp
-endif
-ifndef COPYTREE
-COPYTREE:=$(CPPROG) -rfp
-endif
-ifndef MOVE
-MOVE:=$(MVPROG) -f
-endif
-ifndef DEL
-DEL:=$(RMPROG) -f
-endif
-ifndef DELTREE
-DELTREE:=$(RMPROG) -rf
-endif
-ifndef INSTALL
-ifdef inUnix
-INSTALL:=$(GINSTALL) -c -m 644
-else
-INSTALL:=$(COPY)
-endif
-endif
-ifndef INSTALLEXE
-ifdef inUnix
-INSTALLEXE:=$(GINSTALL) -c -m 755
-else
-INSTALLEXE:=$(COPY)
-endif
-endif
-ifndef MKDIR
-MKDIR:=$(GINSTALL) -m 755 -d
-endif
-export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
-ifndef PPUMOVE
-PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(PPUMOVE),)
-PPUMOVE=
-else
-PPUMOVE:=$(firstword $(PPUMOVE))
-endif
-endif
-export PPUMOVE
-ifndef FPCMAKE
-FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(FPCMAKE),)
-FPCMAKE=
-else
-FPCMAKE:=$(firstword $(FPCMAKE))
-endif
-endif
-export FPCMAKE
-ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ZIPPROG),)
-ZIPPROG=
-else
-ZIPPROG:=$(firstword $(ZIPPROG))
-endif
-endif
-export ZIPPROG
-ifndef TARPROG
-TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(TARPROG),)
-TARPROG=
-else
-TARPROG:=$(firstword $(TARPROG))
-endif
-endif
-export TARPROG
-ifndef AS
-AS=as
-endif
-ifndef LD
-LD=ld
-endif
-ifndef RC
-RC=rc
-endif
-PPAS=ppas$(BATCHEXT)
-ifdef inUnix
-LDCONFIG=ldconfig
-else
-LDCONFIG=
-endif
-ifdef DATE
-DATESTR:=$(shell $(DATE) +%Y%m%d)
-else
-DATESTR=
-endif
-ifndef UPXPROG
-ifeq ($(OS_TARGET),go32v2)
-UPXPROG:=1
-endif
-ifeq ($(OS_TARGET),win32)
-UPXPROG:=1
-endif
-ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(UPXPROG),)
-UPXPROG=
-else
-UPXPROG:=$(firstword $(UPXPROG))
-endif
-else
-UPXPROG=
-endif
-endif
-export UPXPROG
-ZIPOPT=-9
-ZIPEXT=.zip
-ifeq ($(USETAR),bz2)
-TAROPT=vI
-TAREXT=.tar.bz2
-else
-TAROPT=vz
-TAREXT=.tar.gz
-endif
-LOADEREXT=.as
-EXEEXT=.exe
-PPLEXT=.ppl
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.so
-STATICLIBPREFIX=libp
-RSTEXT=.rst
-FPCMADE=fpcmade
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-STATICLIBPREFIX=
-FPCMADE=fpcmade.v1
-PACKAGESUFFIX=v1
-endif
-ifeq ($(OS_TARGET),go32v2)
-STATICLIBPREFIX=
-FPCMADE=fpcmade.dos
-ZIPSUFFIX=go32
-endif
-ifeq ($(OS_TARGET),linux)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.lnx
-ZIPSUFFIX=linux
-endif
-ifeq ($(OS_TARGET),freebsd)
-EXEEXT=
-HASSHAREDLIB=1
-FPCMADE=fpcmade.freebsd
-ZIPSUFFIX=freebsd
-endif
-ifeq ($(OS_TARGET),win32)
-PPUEXT=.ppw
-OEXT=.ow
-ASMEXT=.sw
-SMARTEXT=.slw
-STATICLIBEXT=.aw
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.w32
-ZIPSUFFIX=w32
-endif
-ifeq ($(OS_TARGET),os2)
-PPUEXT=.ppo
-ASMEXT=.so2
-OEXT=.oo2
-AOUTEXT=.out
-SMARTEXT=.so
-STATICLIBEXT=.ao2
-SHAREDLIBEXT=.dll
-FPCMADE=fpcmade.os2
-ZIPSUFFIX=emx
-endif
-ifeq ($(OS_TARGET),amiga)
-EXEEXT=
-PPUEXT=.ppa
-ASMEXT=.asm
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.library
-FPCMADE=fpcmade.amg
-endif
-ifeq ($(OS_TARGET),atari)
-PPUEXT=.ppt
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=.ttp
-FPCMADE=fpcmade.ata
-endif
-ifdef REQUIRE_UNITSDIR
-override UNITSDIR+=$(REQUIRE_UNITSDIR)
-endif
-ifdef REQUIRE_PACKAGESDIR
-override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
-endif
-ifdef ZIPINSTALL
-ifeq ($(OS_TARGET),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-UNIXINSTALLDIR=1
-endif
-else
-ifeq ($(OS_SOURCE),linux)
-UNIXINSTALLDIR=1
-endif
-ifeq ($(OS_SOURCE),freebsd)
-UNIXINSTALLDIR=1
-endif
-endif
-ifndef INSTALL_PREFIX
-ifdef UNIXINSTALLDIR
-INSTALL_PREFIX=/usr/local
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=/pp
-else
-INSTALL_BASEDIR:=/$(PACKAGE_NAME)
-endif
-endif
-endif
-export INSTALL_PREFIX
-ifndef DIST_DESTDIR
-DIST_DESTDIR:=$(BASEDIR)
-endif
-export DIST_DESTDIR
-ifndef INSTALL_BASEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
-endif
-else
-INSTALL_BASEDIR:=$(INSTALL_PREFIX)
-endif
-endif
-ifndef INSTALL_BINDIR
-ifdef UNIXINSTALLDIR
-INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
-else
-INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
-ifdef INSTALL_FPCPACKAGE
-INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
-endif
-endif
-endif
-ifndef INSTALL_UNITDIR
-INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
-ifdef INSTALL_FPCPACKAGE
-ifdef PACKAGE_NAME
-INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
-endif
-endif
-endif
-ifndef INSTALL_LIBDIR
-ifdef UNIXINSTALLDIR
-INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
-else
-INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
-endif
-endif
-ifndef INSTALL_SOURCEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
-else
-INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source
-endif
-endif
-endif
-ifndef INSTALL_DOCDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
-else
-INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
-endif
-endif
-endif
-ifndef INSTALL_EXAMPLEDIR
-ifdef UNIXINSTALLDIR
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
-endif
-else
-ifdef INSTALL_FPCPACKAGE
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
-else
-INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
-endif
-endif
-endif
-ifndef INSTALL_DATADIR
-INSTALL_DATADIR=$(INSTALL_BASEDIR)
-endif
-ifeq ($(OS_TARGET),linux)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-endif
-ifeq ($(OS_TARGET),go32v2)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-endif
-ifeq ($(OS_TARGET),win32)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-endif
-ifeq ($(OS_TARGET),os2)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-endif
-ifeq ($(OS_TARGET),freebsd)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-endif
-ifeq ($(OS_TARGET),beos)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-endif
-ifeq ($(OS_TARGET),amiga)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-endif
-ifeq ($(OS_TARGET),atari)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-endif
-ifdef REQUIRE_PACKAGES_RTL
-PACKAGEDIR_RTL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))
-ifneq ($(PACKAGEDIR_RTL),)
-PACKAGEDIR_RTL:=$(firstword $(PACKAGEDIR_RTL))
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_rtl
-package_rtl:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
-UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
-else
-UNITDIR_RTL=$(PACKAGEDIR_RTL)
-endif
-else
-PACKAGEDIR_RTL=
-UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
-ifneq ($(UNITDIR_RTL),)
-UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
-else
-UNITDIR_RTL=
-endif
-endif
-ifdef UNITDIR_RTL
-override COMPILER_UNITDIR+=$(UNITDIR_RTL)
-endif
-endif
-ifdef REQUIRE_PACKAGES_FV
-PACKAGEDIR_FV:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fv/Makefile.fpc,$(PACKAGESDIR)))))
-ifneq ($(PACKAGEDIR_FV),)
-PACKAGEDIR_FV:=$(firstword $(PACKAGEDIR_FV))
-ifeq ($(wildcard $(PACKAGEDIR_FV)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_fv
-package_fv:
-	$(MAKE) -C $(PACKAGEDIR_FV) all
-endif
-ifneq ($(wildcard $(PACKAGEDIR_FV)/$(OS_TARGET)),)
-UNITDIR_FV=$(PACKAGEDIR_FV)/$(OS_TARGET)
-else
-UNITDIR_FV=$(PACKAGEDIR_FV)
-endif
-else
-PACKAGEDIR_FV=
-UNITDIR_FV:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fv/Package.fpc,$(UNITSDIR)))))
-ifneq ($(UNITDIR_FV),)
-UNITDIR_FV:=$(firstword $(UNITDIR_FV))
-else
-UNITDIR_FV=
-endif
-endif
-ifdef UNITDIR_FV
-override COMPILER_UNITDIR+=$(UNITDIR_FV)
-endif
-endif
-.PHONY: package_rtl package_fv
-override FPCOPTDEF=$(CPU_TARGET)
-ifneq ($(OS_TARGET),$(OS_SOURCE))
-override FPCOPT+=-T$(OS_TARGET)
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-ifdef LINKSMART
-override FPCOPT+=-XX
-endif
-ifdef CREATESMART
-override FPCOPT+=-CX
-endif
-ifdef DEBUG
-override FPCOPT+=-gl
-override FPCOPTDEF+=DEBUG
-endif
-ifdef RELEASE
-override FPCOPT+=-Xs -OG2p3 -n
-override FPCOPTDEF+=RELEASE
-endif
-ifdef STRIP
-override FPCOPT+=-Xs
-endif
-ifdef OPTIMIZE
-override FPCOPT+=-OG2p3
-endif
-ifdef VERBOSE
-override FPCOPT+=-vwni
-endif
-ifdef COMPILER_OPTIONS
-override FPCOPT+=$(COMPILER_OPTIONS)
-endif
-ifdef COMPILER_UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
-endif
-ifdef COMPILER_LIBRARYDIR
-override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
-endif
-ifdef COMPILER_OBJECTDIR
-override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
-endif
-ifdef COMPILER_INCLUDEDIR
-override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
-endif
-ifdef COMPILER_TARGETDIR
-override FPCOPT+=-FE$(COMPILER_TARGETDIR)
-ifeq ($(COMPILER_TARGETDIR),.)
-override TARGETDIRPREFIX=
-else
-override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-endif
-ifdef COMPILER_UNITTARGETDIR
-override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
-ifeq ($(COMPILER_UNITTARGETDIR),.)
-override UNITTARGETDIRPREFIX=
-else
-override UNITTARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-else
-ifdef COMPILER_TARGETDIR
-override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
-override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
-endif
-endif
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef FPCOPTDEF
-override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
-endif
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-ifdef USEENV
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
-endif
-override COMPILER:=$(FPC) $(FPCOPT)
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-ifeq ($(OS_SOURCE),$(OS_TARGET))
-EXECPPAS:=@$(PPAS)
-endif
-endif
-.PHONY: fpc_units
-ifdef TARGET_UNITS
-override ALLTARGET+=fpc_units
-override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
-override INSTALLPPUFILES+=$(UNITPPUFILES)
-override CLEANPPUFILES+=$(UNITPPUFILES)
-endif
-fpc_units: $(UNITPPUFILES)
-ifdef TARGET_RSTS
-override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
-override CLEANRSTFILES+=$(RSTFILES)
-endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
-$(FPCMADE): $(ALLTARGET)
-	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
-fpc_smart:
-	$(MAKE) all LINKSMART=1 CREATESMART=1
-fpc_debug:
-	$(MAKE) all DEBUG=1
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
-%$(PPUEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(PPUEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
-.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
-ifdef INSTALL_UNITS
-override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
-endif
-ifdef INSTALLPPUFILES
-override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
-override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
-override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
-override INSTALL_CREATEPACKAGEFPC=1
-endif
-ifdef INSTALLEXEFILES
-override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
-endif
-fpc_install: $(INSTALLTARGET)
-ifdef INSTALLEXEFILES
-	$(MKDIR) $(INSTALL_BINDIR)
-ifdef UPXPROG
-	-$(UPXPROG) $(INSTALLEXEFILES)
-endif
-	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
-endif
-ifdef INSTALL_CREATEPACKAGEFPC
-ifdef FPCMAKE
-ifdef PACKAGE_VERSION
-ifneq ($(wildcard Makefile.fpc),)
-	$(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
-endif
-endif
-endif
-endif
-ifdef INSTALLPPUFILES
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
-ifneq ($(INSTALLPPULINKFILES),)
-	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
-endif
-ifneq ($(wildcard $(LIB_FULLNAME)),)
-	$(MKDIR) $(INSTALL_LIBDIR)
-	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
-ifdef inUnix
-	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
-endif
-endif
-endif
-ifdef INSTALL_FILES
-	$(MKDIR) $(INSTALL_DATADIR)
-	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
-endif
-fpc_sourceinstall: distclean
-	$(MKDIR) $(INSTALL_SOURCEDIR)
-	$(COPYTREE) $(BASEDIR) $(INSTALL_SOURCEDIR)
-fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
-ifdef HASEXAMPLES
-	$(MKDIR) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef EXAMPLESOURCEFILES
-	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef TARGET_EXAMPLEDIRS
-	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
-endif
-.PHONY: fpc_clean fpc_cleanall fpc_distclean
-ifdef EXEFILES
-override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
-endif
-ifdef CLEAN_UNITS
-override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
-endif
-ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
-override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
-override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
-endif
-fpc_clean: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-ifdef CLEAN_FILES
-	-$(DEL) $(CLEAN_FILES)
-endif
-ifdef LIB_NAME
-	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
-endif
-	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-fpc_distclean: clean
-ifdef COMPILER_UNITTARGETDIR
-TARGETDIRCLEAN=fpc_clean
-endif
-fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
-ifdef AOUTEXT
-	-$(DEL) *$(AOUTEXT)
-endif
-.PHONY: fpc_info
-fpc_info:
-	@$(ECHO)
-	@$(ECHO)  == Package info ==
-	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
-	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPC.......... $(FPC)
-	@$(ECHO)  FPC Version.. $(FPC_VERSION)
-	@$(ECHO)  Source CPU... $(CPU_SOURCE)
-	@$(ECHO)  Target CPU... $(CPU_TARGET)
-	@$(ECHO)  Source OS.... $(OS_SOURCE)
-	@$(ECHO)  Target OS.... $(OS_TARGET)
-	@$(ECHO)
-	@$(ECHO)  == Directory info ==
-	@$(ECHO)
-	@$(ECHO)  Basedir......... $(BASEDIR)
-	@$(ECHO)  FPCDir.......... $(FPCDIR)
-	@$(ECHO)  UnitsDir........ $(UNITSDIR)
-	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
-	@$(ECHO)
-	@$(ECHO)  GCC library..... $(GCCLIBDIR)
-	@$(ECHO)  Other library... $(OTHERLIBDIR)
-	@$(ECHO)
-	@$(ECHO)  == Tools info ==
-	@$(ECHO)
-	@$(ECHO)  Pwd....... $(PWD)
-	@$(ECHO)  Mv........ $(MVPROG)
-	@$(ECHO)  Cp........ $(CPPROG)
-	@$(ECHO)  Rm........ $(RMPROG)
-	@$(ECHO)  GInstall.. $(GINSTALL)
-	@$(ECHO)  Echo...... $(ECHO)
-	@$(ECHO)  Date...... $(DATE)
-	@$(ECHO)  FPCMake... $(FPCMAKE)
-	@$(ECHO)  PPUMove... $(PPUMOVE)
-	@$(ECHO)  Upx....... $(UPXPROG)
-	@$(ECHO)  Zip....... $(ZIPPROG)
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  Target Loaders...... $(TARGET_LOADERS)
-	@$(ECHO)  Target Units........ $(TARGET_UNITS)
-	@$(ECHO)  Target Programs..... $(TARGET_PROGRAMS)
-	@$(ECHO)  Target Dirs......... $(TARGET_DIRS)
-	@$(ECHO)  Target Examples..... $(TARGET_EXAMPLES)
-	@$(ECHO)  Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)
-	@$(ECHO)
-	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
-	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
-	@$(ECHO)
-	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
-	@$(ECHO)  Install Files....... $(INSTALL_FILES)
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-	@$(ECHO)  DateStr.............. $(DATESTR)
-	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
-	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
-	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
-	@$(ECHO)
-	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
-	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
-	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
-	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
-	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
-	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
-	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
-	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
-	@$(ECHO)
-	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
-	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
-	@$(ECHO)
-debug: fpc_debug
-smart: fpc_smart
-examples:
-shared:
-sourceinstall: fpc_sourceinstall
-exampleinstall: fpc_exampleinstall
-distinstall:
-zipinstall:
-zipsourceinstall:
-zipexampleinstall:
-zipdistinstall:
-distclean: fpc_distclean
-cleanall: fpc_cleanall
-info: fpc_info
-.PHONY: debug smart examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info
-ifneq ($(wildcard fpcmake.loc),)
-include fpcmake.loc
-endif
-override COMPILER+=-dBrowserCol -dGDB -Fu.. -Fi..
-ifeq ($(CPU_TARGET),i386)
-override COMPILER+=-dSUPPORT_MMX
-endif
-all: fpc_all
-clean: cleanall
-install:

+ 0 - 34
ide/text/compiler/Makefile.fpc

@@ -1,34 +0,0 @@
-#
-#   Makefile.fpc for Compiler units for IDE inclusion
-#
-
-[target]
-units=compunit
-
-[require]
-packages=fv
-
-[compiler]
-options=-Ca
-targetdir=.
-unitdir=$(FPCDIR)/compiler $(FPCDIR)/compiler/$(CPU_TARGET) $(FPCDIR)/compiler/targets
-includedir=$(FPCDIR)/compiler $(FPCDIR)/compiler/$(CPU_TARGET)
-
-[install]
-fpcpackage=y
-
-[default]
-fpcdir=../../..
-
-[rules]
-override COMPILER+=-dBrowserCol -dGDB -Fu.. -Fi..
-ifeq ($(CPU_TARGET),i386)
-override COMPILER+=-dSUPPORT_MMX
-endif
-
-all: fpc_all
-
-clean: cleanall
-
-# Nothing to install
-install:

+ 0 - 28
ide/text/compiler/compunit.pas

@@ -1,28 +0,0 @@
-{
-  $Id$
-
-  Build file for the compiler units. This is also a unit so
-  that there will be no linking
-}
-unit compunit;
-interface
-uses
-  compiler,
-  comphook,
-  cpuinfo,
-  browcol;
-
-implementation
-end.
-{
-  $Log$
-  Revision 1.2  2001-04-25 22:38:38  peter
-    * updates from fixes branch so fpcmake for Makefiles works
-
-  Revision 1.1.2.2  2001/03/20 00:20:44  pierre
-   * fix some memory leaks + several small enhancements
-
-  Revision 1.1.2.1  2001/01/07 22:32:33  peter
-    * build all compiler units for IDE inclusion
-
-}

+ 0 - 29
ide/text/cvsco.tdf

@@ -1,29 +0,0 @@
-[Main]
-Title="CVS Update"
-Size=(56,9)
-CommandLine="commit -m %msg% %filename%"
-Default="filename"
-
-[filename]
-Type=InputLine
-Origin=(2,3)
-Size=(52,1)
-
-[label1]
-Type=Label
-Origin=(2,2)
-Size=(52,1)
-Text="~F~ile(s) to commit"
-Link="filename"
-
-[msg]
-Type=InputLine
-Origin=(2,6)
-Size=(52,1)
-
-[label2]
-Type=Label
-Origin=(2,5)
-Size=(52,1)
-Text="~M~essage"
-Link="msg"

+ 0 - 25
ide/text/cvsup.tdf

@@ -1,25 +0,0 @@
-[Main]
-Title="CVS Update"
-Size=(56,7)
-CommandLine="%z% update %filename%"
-Default="filename"
-
-[filename]
-Type=InputLine
-Origin=(2,3)
-Size=(52,1)
-
-[label]
-Type=Label
-Origin=(2,2)
-Size=(52,1)
-Text="~F~ile(s) to update"
-Link="filename"
-
-[z]
-Type=CheckBox
-Name="~C~ompress (-z 3)"
-Origin=(2,5)
-Size=(25,1)
-Default=On
-On="-z 3"

+ 0 - 0
ide/text/empty.inc


+ 0 - 236
ide/text/fixes.txt

@@ -1,236 +0,0 @@
-Gabor's log to 18/10/2000 commits
-========================= Improvements ================================
-
- [+] HTML keyword index file stores now relative paths, thus it can be
-     moved/copied freely as long as relative paths are preserved
- [+] history lists added at several points (like run parameters, ini
-     file name, compiler conditionals, etc.)
-
-Gabor's log to 18/09/2000 commits
-========================= Already fixed ================================
-
- [*] editor flags weren't stored in desktop file
- [*] TFastBufStream contained a bug which showed up when using non-linear
-     (eg. "random") reads, and resulted in returning data from wrong file
-     position
-
-========================= Improvements ================================
-
- [+] added support for OS/2 help files (.INF) to the help system
- [+] started implementing fold support (it's not yet fully functional!!!)
-
-     Folds enable you to hide specific parts of the documents (independantly
-     of each other). When a fold is hidden only it's first line (the fold
-     header) is show - all other lines (the fold body) and all subfolds do
-     not appear on screen. Folds can be also nested.
-     This is very useful for ex. to hide the implementation part of a
-     procedure, while leaving the procedure header still visible. This greatly
-     simplyfies navigation in the source file by temporarily hiding currently
-     unused content.
-     Fold information could be (optionally) gerenated automatically by the
-     compiler, according to the control/syntax-tree of the program.
-
-     Folds can be created manually by selecting an area and the pressing
-     Ctrl-K-A. Valids are fold areas that do not cross bounds of already
-     existing folds.
-     Fold bodies can be hidden with Ctrl-Gray-, shown with Ctrl-Gray+.
-     Pressing Ctrl-Gray* toggles the visibility of a fold body.
-
-Gabor's log to 10/8/2000 commits
-========================= Already fixed ================================
-
- [*] 'Auto save editor files' option did the opposite than expected, due
-     to a typo in FPIDE.PAS
-
-========================= Improvements ================================
-
- [+] saving of source files before compilation is no longer neccessary.
-     When a modified editor file is involved in the compilation, then the
-     IDE saves it's contents to a memory stream and passes this to the
-     compiler (instead of the file on the disk)
-Gabor's log to 19/7/2000 commits
-========================= Improvements ================================
-
- [+] the .ini parser now handles string delimiters more flexible
-     (you can now include quotation-marks in an entry value if you use no
-      delimiters at all, or if you use aphostrophes as delimiters)
- [+] new .TDF view type added: MEMO.
-     Memos can have an additional property, "FileName". After closing the
-     toolparams dialog box the contents of the memo are saved in a file,
-     and the reference to the memo field in the tool command-line is
-     replaced with the name of this file. (If no filename is specified the
-     file is stored under a unique name in the temp dir.)
-
-Gabor's log to 18/7/2000 commits
-========================= Already fixed ================================
-
- [*] pressing Enter on the last line (eg. appending a line) in the editor
-     didn't scroll the editor window
- [*] the IDE switches now correctly back to the last video mode at startup
-
-
-Gabors's log to 26/6/2000 commits
-========================= Already fixed ================================
-
- [*] topics with the same name are now all shown on the Index page
-
-========================== Other improvements ============================
-
- [+] added support for "see also" entries of Norton Guide help topics
- [+] coloring of NG help is now integrated with the common color managment
-     system of FV
- [+] started implementing help support for Windows Help files
-
-Gabors's log to 22/6/2000 commits
-========================== Other improvements ============================
-
- [+] added support for reading .NG (Norton Guide) in the help system
-
-========================== Misc modifications ============================
-
- [?] the VESA unit now uses the routines of PMODE, instead of it's owns
- [?] constants (255) changed to High()s in checks for maximum string lengths
-
-Gabors's log to 16/6/2000 commits
-========================= Already fixed ================================
-
- [*] temporary files are now delete on exit
- [*] Size/Move (Ctrl+F5) didn't work correctly with some windows, which
-     defined a different meaning for Enter (for ex. message windows)
- [*] 'Open file at cursor' brings up an open dialog with a correct name
-     in it now, when it can't find the file itself
- [*] TFileDialog treated filename-list (multiple names separated with
-     semicolons) as single filenames, whereas they're more like wildchar
-     masks
- [*] TFileDialog treated paths ending with a dirsep (\) as filespecs,
-     however, they're actually dirspecs
-
-========================== Other improvements ============================
-
- [+] editor windows can now be hidden temporarily
- [+] unit info tab added to symbol browser
- [+] strings constants from generic units moved to WCONSTS.PAS
- [+] small info screen at first start
-Gabors's log to 29/5/2000 commits
-========================= Already fixed ================================
-
- [*] TOAHelpFile.Init contained a bug, which caused an invalid pointer
-     operation when the help file version was incorrect (it resulted in
-     fatal exit)
- [*] the cursor position in TSymbolScopeView was independant of the current
-     horizontal scroll offset
- [*] the value of string constant wasn't displayed correctly in the symbol
-     browser (they were typecasted to PStrings, however they are PChars now)
- [*] partial syntax highlight messed up CodeComplete
- [*] the HTML link scanner wasn't aware of bookmark links
-
-========================== Other improvements ============================
-
- [+] added support for TP5.5 format help files
- [+] added support for HTML bookmarks in the help system
- [+] fix calls into browcol turned into hooks (for future use in CodeInsight)
-Gabor's log 1/5/2000 commits
-========================= Already fixed ================================
-
- [*] a just freshly created editor window (without any chars entered) simply
-     "ate" all Save commands
-
-========================== Other improvements ============================
-
- [+] source paths are now "adjusted" to show only important path elements
-     when they don't fit in the title area of the source window
- [+] template macros implemented (you can use them in the .PT files)
-     $TIME - actual time
-     $DATE - actual date
-     $DATE('yyyy/mm/dd hh.nn.ss') - actual date formatted using specified str
-     $PROMPT('paramname') - variable parameter entered by user
- [+] the size of some windows is now dependant on the current resolution
- [+] all IDE strings contants converted to resourcestrings
- [+] /hm command-line switch for enabling/disabling heap monitor
-
-=========================== Todo ========================================
-
- [!] convert all API,FV,etc. message strings to resourcestrings
- [!] add "Find in files" command, probably using internal grep routine
- [!] implement Projects & project managment
-     - specifying project files
-     - todo list mangment
-     - generating project list file
-Gabor's log 25/4/2000 commits
-
-========================= Fixes to apply ==============================
-
-The GO32 mouse.inc (API) displays a message ("No mouse driver found!") when
-it doesn't find a mouse driver. This message should be removed.
-
-========================= Already fixed ================================
-
- [*] when saving a file with different name (or saving a new file) the
-     default extension of '.pas' wasn't applied to the name specified
- [*] THelpViewer didn't care about LockFlag, and thus flickered on complex
-     updates
- [*] sever sheets of the symbol browser were selectable thru keyboard, even
-     when they were disabled/non-visible
- [*] Ctrl--> and Ctrl-<- skipped over '[' and ']'
- [*] unsaved new windows (nonamexx.pas) aren't stored to desktop file any more
-     (on the next startup the IDE tried to open the file with no name)
- [*] clock view didn't stay in the upper left corner when the desktop has been
-     resized (for ex. at video-mode change)
- [*] the IDE didn't switch correctly between video modes
-     (especially 80x50 caused trouble)
- [*] buttons in Breakpoints window didn't move when resizing the window
- [*] tracking source didn't work correctly (for ex. in symbol browser,msgs,..)
- [*] symbol browser didn't respond to Ctrl+Enter (goto source)
- [*] symbol browser views' behaviour unified
- [*] BuildObjectTree failed to build the object tree correctly when there were
-     multiple objects defined with the same name. for ex. in object pascal mode
-     there are 2 objects called TObject (the built-in base object for classes
-     and the one in objects.pp) and thus the entire object tree of TObject
-     object was "lost"
- [*] in the linking state the text 'Please wait...' is displayed now, instead
-     of 'Press Esc to cancel' (which won't work and is incorrect)
- [+] Inheritance symbol viewer scrolls now, and acts on [Ctrl+]Left,Right keys
-
-========================== Other improvements ============================
-
- [+] at startup the IDE checks whether there's a file called FP.ANS in any
-     of the search directories, and if it founds one, then loads it as the
-     background for the desktop (the file is interpreted as an ANSI file)
-     (Peter, you can finally put your favorite FPC-logo on your desktop now ;)
- [+] 'Auto track source' option implemented (-> symbol browser)
- [+] 'Compiler messages' window is only shown when there's something to
-     display (ie. if there's no error/message, then it won't be shown)
-
-=========================== Todo ========================================
-
-Gabor's log for 18/4/2000 commits
-
-========================= Already fixed ================================
-
- [*] THTMLTopicRenderer didn't handle table tags (<TABLE>,<TR>,<TH>,<TD>)
- [*] the IDE didn't prompt the user for saving modified files at exit, when
-     there were multiple editor windows open for the same file
- [*] the IDE didn't respond to some hotkeys (for ex. Alt+F3) after a success-
-     ful compilation
-
-========================== Other improvements ============================
-
- [+] HTML index generation added. This enables users to index any collection
-     of HTML files, for ex. the HTML version of the FPC docs.
-     This way we can finally get a WinAPI help for the IDE. The user simply
-     has to download a .chm version of the WinAPI help, decompile it with the
-     M$ HTML Help Workshop, and install it as a help file...
-     (however this will only work in a DOS box under W9X, or with the win32
-     version of IDE, as these HTML files use long filenames)
- [+] TCodeEditor acts now on several additional keys, like
-     Ctrl+O+A - Open at cursor      , Ctrl+O+B - Browse at cursor      ,
-     Ctrl+O+G - Go to line number   , Ctrl+O+O - Insert options        ,
-     Ctrl+O+U - Toggle case of char , Ctrl+O+L - Select line           ,
-     Ctrl+K+S - Save file           , Ctrl+K+D - Activate menubar      ,
-     Ctrl+K+N - Block to uppercase  , Ctrl+K+O - Block to lowercase    ,
-     Ctrl+K+E - Word to lowercase   , Ctrl+K+F - Word to uppercase     ,
-     Ctrl+Q+E - Jump to top of wnd  , Ctrl+Q+T - Jump to top of wnd    ,
-     Ctrl+Q+U - Jump to bottom of wnd,Ctrl+Q+X - Jump to bottom of wnd ,
-     Ctrl+Q+[ - find delimiter-match, Ctrl+Q+] - find delimited match (backw)
-
-=========================== Todo ========================================

+ 0 - 20
ide/text/fp.ans

@@ -1,20 +0,0 @@
-ロロロロロロロロワ゚゚  ワワ゚ロロロロワ゚゚゚゚゚゚ワロロ ワ゚ワワ゚゚ワロロロロロロロロロロロロロロロロロロロロロロロロロロロ゙
-ロロロロロロワワワ゚ロロワ゚゚゚゚ワロロ゚ワ゚ワロロロロロロロロロロロロロロロロロロロロロロロロ゙
-ワロロロロ゚  ワワロワロワ゚ワロ゚ワワ゚ロロロロロロロロロロロロロロロロロロロロロロロ゙
-  ゚゚゚゚゚ワロ゚ワロロワ゚゚゚゚゚゚゚゚゚゚゚゚ワロロロロロロロロロロロ゙
-ワワワワワワワワワワワワワワワワワワワワワワワワワワ゚゚ワロロロロロロ゙
-ロ゚゚゚゚ロロロワワワワワワワワワワワワワワロロロロロロ゙  イアーワワワワロロロロ゚゚゚゚゚゚ロロロロロワワワ゚ワロロロ゙
-ロン  ワワヷ゙ロロ゚゚゚ロロロロロロロロロ゚゚゚゚゚゚゚゚ワワロロ゚゚゚゚゚゚゚゚゚゚ロ゚゚ワ゚ロロロロ゙
-゙  ンロロロ ロロンワワワワワワワワワワワワワワ ワワワロ゚゚  ーワロロロン ゙ロロ゚ワワワワ゚ロロロロロロ゙
-ン  ロロロ゙゙ロロンワワワワロ゚゚゚゚゚゚゚゚゚ロロワンロロ゚ロン  ンロロロロロロワ ワワ゚ロロロロロロロロ゙
-ン ゙ロ゚ロン゙゙ロンワ゚゚゚゙゙ロン゚ワワイロロロン  ンロロロロロロロロロロロロロロロロロロロ゙
-ン ゙ロロ゙ワヷロロワワロン゙゙ロロロワワワワヷロロワ゚゚ロロロロン  ンロロロロロロロロロロロロロロロロロロロ゙
-ン ゙ロロ゙゚゚゚ロロロ゚゚゚ンロロンロ゚゚゚゚゚゚゚゚゚゚゚゚ワロンンロ゚ロンロロロロロロロロロロロロロロロロロロロ゙
-ン ゙ロ゚ロン ゙゙ロロ゙゙゙ロロ゙ンンアロ゙ンワ  ゙ンロロロロロロ゚゙ロロロ゙
-゙  ロ゙ン゙  ゙ロロン゙ロロンワワワ゚ロワ゚゚ロロロロロワ゚ワワワワワ  ゙ロロロ゙
-ロン ンロ゚ロン  ゙ロロワヷロン゚゚ロワ  ゚゚゚゚゚゚ワワロロロ゚ン  ゚ロロロ゙
-ロ゙ ゙ロ゚ワ゚  ゙ロロロロワロロワワ  ゚゚ロワワワワワ ワワワワワワワワロロ゚゚゚゚  ワ゚ロロロロ゙
-゚゚゚ ゚゚゚゚  ゙ロロロロロンワワロ゚゚゚゚゚゚゚゚゚゚゚゚゚゚゚゚ワワワ゚ロロロロロロ゙
-GeCワロロ゚ロワ  ゚゚ ワワ゚ロ゚ワワワワワワワワワワワ゚゚ロロロロロロロロロロロ゙
-゚
-

+ 0 - 496
ide/text/fp.pas

@@ -1,496 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998-2000 by Berczi Gabor
-
-    Main program of the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-program FP;
-
-{$I globdir.inc}
-(**********************************************************************)
-(* CONDITIONAL DEFINES                                                *)
-(*  - NODEBUG    No Debugging support                                 *)
-(*  - TP         Turbo Pascal mode                                    *)
-(*  - i386       Target is an i386 IDE                                *)
-(**********************************************************************)
-
-uses
-{$ifdef IDEHeapTrc}
-  HeapTrc,
-{$endif IDEHeapTrc}
-{$ifdef go32v2}
-  dpmiexcp,
-{$endif go32v2}
-{$ifdef fpc}
-  video,
-{$endif fpc}
-  Dos,Objects,
-  BrowCol,
-  Drivers,Views,App,Dialogs,ColorSel,Menus,StdDlg,Validate,
-  {$ifdef EDITORS}Editors{$else}WEditor,WCEdit{$endif},
-  ASCIITab,Calc,
-  WUtils,WViews,WHTMLScn,
-  FPIDE,FPCalc,FPCompil,
-  FPIni,FPViews,FPConst,FPVars,FPUtils,FPHelp,FPSwitch,FPUsrScr,
-  FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPTemplt,FPCatch,FPRedir,FPDesk,
-  FPCodTmp,FPCodCmp;
-
-procedure ProcessParams(BeforeINI: boolean);
-
-  function IsSwitch(const Param: string): boolean;
-  begin
-    IsSwitch:=(Param<>'') and (Param[1]<>DirSep) { <- allow UNIX root-relative paths            }
-          and (Param[1] in ['-','/']);           { <- but still accept dos switch char, eg. '/' }
-  end;
-
-var I: Sw_integer;
-    Param: string;
-begin
-  for I:=1 to ParamCount do
-  begin
-    Param:=System.ParamStr(I);
-    if IsSwitch(Param) then
-      begin
-        Param:=copy(Param,2,255);
-        if Param<>'' then
-        if UpcaseStr(copy(Param,1,2))='HM' then
-          { HeapMonitor }
-          begin
-            if (copy(Param,3,1)='+') or (copy(Param,3,1)='') then
-              StartupOptions:=StartupOptions or soHeapMonitor
-            else
-            if (copy(Param,3,1)='-') then
-              StartupOptions:=StartupOptions and not soHeapMonitor;
-          end else
-{$ifdef go32v2}
-        if UpcaseStr(Param)='NOLFN' then
-          begin
-            LFNSupport:=false;
-          end else
-{$endif go32v2}
-        if UpcaseStr(Param)='README' then
-          begin
-            ShowReadme:=true;
-          end else
-        case Upcase(Param[1]) of
-          'C' : { custom config file (BP compatiblity) }
-           if BeforeINI then
-            begin
-              if (length(Param)>=1) and (Param[1] in['=',':']) then
-                Delete(Param,1,1); { eat separator }
-              IniFileName:=Param;
-            end;
-          'R' : { enter the directory last exited from (BP comp.) }
-            begin
-              Param:=copy(Param,2,255);
-              if (Param='') or (Param='+') then
-                StartupOptions:=StartupOptions or soReturnToLastDir
-              else
-              if (Param='-') then
-                StartupOptions:=StartupOptions and (not soReturnToLastDir);
-            end;
-          'S' :
-             if Length(Param)=1 then
-               begin
-                 UseMouse:=false;
-                 ButtonCount:=0;
-               end;
-{$ifdef fpc}
-          'F' :
-             if Length(Param)=1 then
-               NoExtendedFrame:=true;
-{$endif fpc}
-        end;
-      end
-    else
-      if not BeforeINI then
-        TryToOpenFile(nil,Param,0,0,{false}true);
-  end;
-end;
-
-Procedure MyStreamError(Var S: TStream); {$ifndef FPC}far;{$endif}
-var ErrS: string;
-begin
-  case S.Status of
-    stGetError : ErrS:='Get of unregistered object type';
-    stPutError : ErrS:='Put of unregistered object type';
-  else ErrS:='';
-  end;
-  if ErrS<>'' then
-  begin
-    {$ifdef GABOR}{$ifdef TP}asm int 3;end;{$endif}{$endif}
-    if Assigned(Application) then
-      ErrorBox('Stream error: '+#13+ErrS,nil)
-    else
-
-      writeln('Error: ',ErrS);
-  end;
-end;
-
-procedure DelTempFiles;
-begin
-  DeleteFile(FPOutFileName);
-  DeleteFile(FPErrFileName);
-  DeleteFile(GDBOutFileName);
-  DeleteFile(GDBOutPutFileName);
-  DeleteFile(GREPOutName);
-  DeleteFile(GREPErrName);
-end;
-
-procedure RegisterIDEObjects;
-begin
-  RegisterApp;
-  RegisterAsciiTab;
-  RegisterCalc;
-  RegisterCodeComplete;
-  RegisterCodeTemplates;
-  RegisterColorSel;
-  RegisterDialogs;
-{$ifdef EDITORS}
-  RegisterEditors;
-{$else}
-  RegisterWEditor;
-  RegisterWCEdit;
-{$endif}
-  RegisterFPCalc;
-  RegisterFPCompile;
-  RegisterFPTools;
-  RegisterFPViews;
-{$ifndef NODEBUG}
-  RegisterFPDebugViews;
-{$endif}
-  RegisterMenus;
-  RegisterStdDlg;
-  RegisterSymbols;
-  RegisterObjects;
-  RegisterValidate;
-  RegisterViews;
-
-  RegisterWHTMLScan;
-  RegisterWUtils;
-  RegisterWViews;
-end;
-
-var CanExit : boolean;
-
-BEGIN
-  {$ifdef DEV}HeapLimit:=4096;{$endif}
-  writeln('þ Free Pascal IDE  Version '+VersionStr);
-
-  ProcessParams(true);
-
-  StartupDir:=CompleteDir(FExpand('.'));
-  IDEDir:=CompleteDir(DirOf(system.Paramstr(0)));
-
-  RegisterIDEObjects;
-  StreamError:=@MyStreamError;
-
-  ShowReadme:=ShowReadme or (LocateFile(INIFileName)='');
-
-{$ifdef win32}
-  DosExecute(GetEnv('COMSPEC'),'/C echo This dummy call gets the mouse to become visible');
-{$endif win32}
-{$ifdef VESA}
-  InitVESAScreenModes;
-{$endif}
-  InitRedir;
-{$ifndef NODEBUG}
-  InitBreakpoints;
-  InitWatches;
-{$endif}
-  InitReservedWords;
-  InitHelpFiles;
-  InitSwitches;
-  InitINIFile;
-  InitUserScreen;
-  InitTools;
-  InitTemplates;
-  InitCodeTemplates;
-  InitCodeComplete;
-
-  IDEApp.Init;
-  CheckINIFile;
-  ReadSwitches(SwitchesPath);
-  { load all options after init because of open files }
-  ReadINIFile;
-  InitDesktopFile;
-  LoadDesktop;
-  ParseUserScreen;
-  { why are the screen contents parsed at startup? Gabor }
-
-  { Update IDE }
-  IDEApp.Update;
-  IDEApp.UpdateMode;
-  IDEApp.UpdateTarget;
-
-  ProcessParams(false);
-
-  if ShowReadme then
-  begin
-    PutCommand(Application,evCommand,cmShowReadme,nil);
-    ShowReadme:=false; { do not show next time }
-  end;
-
-  repeat
-    IDEApp.Run;
-    if (AutoSaveOptions and asEditorFiles)=0 then
-      CanExit:=IDEApp.AskSaveAll
-    else
-      CanExit:=IDEApp.SaveAll;
-  until CanExit;
-
-  IDEApp.AutoSave;
-
-  DoneDesktopFile;
-
-  DelTempFiles;
-  IDEApp.Done;
-  WriteSwitches(SwitchesPath);
-
-  DoneCodeComplete;
-  DoneCodeTemplates;
-  DoneTemplates;
-  DoneTools;
-  DoneUserScreen;
-  DoneSwitches;
-  DoneHelpFiles;
-  DoneReservedWords;
-  ClearToolMessages;
-  DoneBrowserCol;
-{$ifndef NODEBUG}
-  DoneDebugger;
-  DoneBreakpoints;
-  DoneWatches;
-{$endif}
-
-  StreamError:=nil;
-END.
-{
-  $Log$
-  Revision 1.4  2000-11-13 17:37:41  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.4  2000/11/09 08:53:35  pierre
-   + -F option to force use of only one graphic set
-
-  Revision 1.3  2000/10/01 22:44:18  pierre
-   * remove lineinfo in _USES
-
-  Revision 1.1.2.3  2000/09/27 22:32:26  pierre
-   * suppress lineinfo explicit in _uses
-
-  Revision 1.2  2000/08/22 09:41:39  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.2  2000/08/16 18:46:14  peter
-   [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
-   [*] Make, Build now possible even in Compiler Messages Window
-   [+] when started in a new dir the IDE now ask whether to create a local
-       config, or to use the one located in the IDE dir
-
-  Revision 1.1.2.1  2000/07/18 05:50:22  michael
-  + Merged Gabors fixes
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.47  2000/06/16 08:50:40  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.46  2000/05/29 10:44:56  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.45  2000/05/02 08:42:26  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.44  2000/04/25 08:42:32  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.43  2000/04/18 11:42:36  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.42  2000/03/21 23:34:10  pierre
-   adapted to wcedit addition by Gabor
-
-  Revision 1.41  2000/03/13 20:41:34  pierre
-    + option -S to disable the mouse
-    * adapted to changes in fpusrscr for DOS
-
-  Revision 1.40  2000/03/07 21:58:58  pierre
-   + uses ParseUserScreen and UpdateMode
-
-  Revision 1.39  2000/02/12 23:58:26  carl
-    + Conditional define explanaations
-
-  Revision 1.38  2000/02/07 11:54:17  pierre
-   + RegisterWUtils by Gabor
-
-  Revision 1.37  2000/01/25 00:26:35  pierre
-   + Browser info saving
-
-  Revision 1.36  2000/01/10 15:53:37  pierre
-  * WViews objects were not registered
-
-  Revision 1.35  2000/01/03 11:38:33  michael
-  Changes from Gabor
-
-  Revision 1.34  1999/12/20 14:23:16  pierre
-    * MyApp renamed IDEApp
-    * TDebugController.ResetDebuggerRows added to
-      get resetting of debugger rows
-
-  Revision 1.33  1999/12/20 09:36:49  pierre
-   * get the mouse visible on win32 fp
-
-  Revision 1.32  1999/12/10 13:02:05  pierre
-  + VideoMode save/restore
-
-  Revision 1.31  1999/09/13 11:43:59  peter
-    * fixes from gabor, idle event, html fix
-
-  Revision 1.30  1999/08/22 22:24:15  pierre
-   * avoid objpas paramstr functions
-
-  Revision 1.29  1999/08/03 20:22:25  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.28  1999/07/10 01:24:11  pierre
-   + First implementation of watches window
-
-  Revision 1.27  1999/06/29 22:43:12  peter
-    * try to add extensions to params
-
-  Revision 1.26  1999/06/28 23:31:14  pierre
-   * typo inside go32v2 cond error removed
-
-  Revision 1.25  1999/06/28 19:25:34  peter
-    * fixes from gabor
-
-  Revision 1.24  1999/06/28 12:40:56  pierre
-   + clear tool messages at exit
-
-  Revision 1.23  1999/06/25 00:48:05  pierre
-   + adds current target in menu at startup
-
-  Revision 1.22  1999/05/22 13:44:28  peter
-    * fixed couple of bugs
-
-  Revision 1.21  1999/04/07 21:55:40  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.20  1999/03/23 16:16:36  peter
-    * linux fixes
-
-  Revision 1.19  1999/03/23 15:11:26  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.18  1999/03/21 22:51:35  florian
-    + functional screen mode switching added
-
-  Revision 1.17  1999/03/16 12:38:06  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-  Revision 1.16  1999/03/12 01:13:01  peter
-    * use TryToOpen() with parameter files to overcome double opened files
-      at startup
-
-  Revision 1.15  1999/03/08 14:58:08  peter
-    + prompt with dialogs for tools
-
-  Revision 1.14  1999/03/05 17:53:00  pierre
-   + saving and opening of open files on exit
-
-  Revision 1.13  1999/03/01 15:41:48  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.12  1999/02/20 15:18:25  peter
-    + ctrl-c capture with confirm dialog
-    + ascii table in the tools menu
-    + heapviewer
-    * empty file fixed
-    * fixed callback routines in fpdebug to have far for tp7
-
-  Revision 1.11  1999/02/18 13:44:30  peter
-    * search fixed
-    + backward search
-    * help fixes
-    * browser updates
-
-  Revision 1.10  1999/02/15 09:07:10  pierre
-   * HEAPTRC conditionnal renamed IDEHEAPTRC
-
-  Revision 1.9  1999/02/10 09:55:43  pierre
-     + Memory tracing if compiled with -dHEAPTRC
-     * Many memory leaks removed
-
-  Revision 1.8  1999/02/08 09:30:59  florian
-    + some split heap stuff, in $ifdef TEMPHEAP
-
-  Revision 1.7  1999/02/05 13:51:38  peter
-    * unit name of FPSwitches -> FPSwitch which is easier to use
-    * some fixes for tp7 compiling
-
-  Revision 1.6  1999/01/21 11:54:10  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.5  1999/01/12 14:29:31  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-}

+ 0 - 528
ide/text/fpcalc.pas

@@ -1,528 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Calculator object for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$I globdir.inc}
-unit FPCalc;
-
-interface
-
-uses
-  Drivers,Objects,Commands,Views,Dialogs,App,
-  WViews,
-  FPViews;
-
-const
-      MaxDecimals = 10;
-      MaxDigits   = 30;
-
-type
-
-  TCalcState = (csFirst, csValid, csError);
-
-  PCalcButton = ^TCalcButton;
-  TCalcButton = object(TButton)
-    procedure HandleEvent(var Event: TEvent); virtual;
-  end;
-
-  PCalcDisplay = ^TCalcDisplay;
-  TCalcDisplay = object(TView)
-    Status: TCalcState;
-    Number: string[MaxDigits];
-    Sign: Char;
-    _Operator: Char;
-    Operand: extended;
-    Memory: extended;
-    DispNumber: extended;
-    constructor Init(var Bounds: TRect);
-    constructor Load(var S: TStream);
-    function  CalcKey(Key: string): boolean;
-    procedure Clear;
-    procedure Draw; virtual;
-    function  GetPalette: PPalette; virtual;
-    procedure HandleEvent(var Event: TEvent); virtual;
-    procedure Store(var S: TStream);
-  private
-    procedure GetDisplay(var R: extended);
-    procedure SetDisplay(R: extended;ShouldKeepZeroes : boolean);
-    procedure Error;
-  end;
-
-  PCalculator = ^TCalculator;
-  TCalculator = object(TCenterDialog)
-    CD : PCalcDisplay;
-    constructor Init;
-    procedure   HandleEvent(var Event: TEvent); virtual;
-    procedure   Show; {virtual;}
-    procedure   Close; virtual;
-    constructor Load(var S: TStream);
-    procedure   Store(var S: TStream);
-  end;
-
-{$ifndef NOOBJREG}
-const
-  RCalcButton: TStreamRec = (
-     ObjType: 10139;
-     VmtLink: Ofs(TypeOf(TCalcButton)^);
-     Load:    @TCalcButton.Load;
-     Store:   @TCalcButton.Store
-  );
-  RCalcDisplay: TStreamRec = (
-     ObjType: 10140;
-     VmtLink: Ofs(TypeOf(TCalcDisplay)^);
-     Load:    @TCalcDisplay.Load;
-     Store:   @TCalcDisplay.Store
-  );
-  RCalculator: TStreamRec = (
-     ObjType: 10141;
-     VmtLink: Ofs(TypeOf(TCalculator)^);
-     Load:    @TCalculator.Load;
-     Store:   @TCalculator.Store
-  );
-{$endif}
-
-procedure RegisterFPCalc;
-
-implementation
-
-uses FPString,FPUtils,FPConst,WUtils;
-
-const
-  cmCalcButton  = 100;
-  cmPressButton = 101;
-
-procedure TCalcButton.HandleEvent(var Event: TEvent);
-var
-  Call : boolean;
-  i : Sw_Word;
-begin
-  Call:=true;
-  case Event.What of
-    evKeyDown :
-     case Event.KeyCode of
-       kbEnter   : Call:=false;
-     end;
-    evBroadcast :
-     case Event.Command of
-       cmDefault     : Call:=false;
-       cmPressButton :
-         begin
-           if (PString(Event.InfoPtr)^=Title^) or
-              ((PString(Event.InfoPtr)^='^') and (Title^='x^y')) then
-              begin
-                Select;
-                DrawState(true);
-                i:=GetDosTicks+2;
-                repeat
-                until GetDosTicks>i;
-                DrawState(false);
-                ClearEvent(Event);
-              end;
-         end;
-     end;
-  end;
-  if Call then
-  inherited HandleEvent(Event);
-end;
-
-constructor TCalcDisplay.Init(var Bounds: TRect);
-begin
-  inherited Init(Bounds);
-  Options := Options or ofSelectable;
-  EventMask := evKeyDown + evBroadcast;
-  Clear;
-  HelpCtx:={hcCalculatorLine}0;
-end;
-
-constructor TCalcDisplay.Load(var S: TStream);
-begin
-  inherited Load(S);
-  S.Read(Status, SizeOf(Status) + SizeOf(Number) + SizeOf(Sign) +
-    SizeOf(_Operator) + SizeOf(Operand));
-end;
-
-procedure TCalcDisplay.GetDisplay(var R: extended);
-begin
-{  Val(Sign + Number, R, E);}
-  R:=DispNumber;
-end;
-
-procedure TCalcDisplay.SetDisplay(R: extended;ShouldKeepZeroes : boolean);
-var
-  S: string[MaxDigits];
-  i,KeepZeroes : byte;
-begin
-  DispNumber:=R;
-  KeepZeroes:=0;
-  if ShouldKeepZeroes and (pos('.',Number)>0) then
-    for i:=length(Number) downto pos('.',Number)+1 do
-      if Number[i]='0' then
-        inc(KeepZeroes)
-      else
-        break;
-
-  Str(R: 0: MaxDecimals, S);
-  if Pos('.',S)<>0 then
-     while (length(S)>1) and (S[length(S)]='0') do Dec(S[0]);
-  if KeepZeroes>0 then
-    for i:=1 to KeepZeroes do
-      S:=S+'0';
-  if S[1] <> '-' then Sign := ' ' else
-  begin
-    Delete(S, 1, 1);
-    Sign := '-';
-  end;
-  if Length(S) > MaxDigits + 1 + MaxDecimals then Error
-  else
-  begin
-    if S[Length(S)] = '.' then Dec(S[0]);
-    Number := S;
-  end;
-end;
-
-procedure TCalcDisplay.Error;
-begin
-  Status := csError;
-  Number := 'Error';
-  Sign := ' ';
-  DrawView;
-end;
-
-function TCalcDisplay.CalcKey(Key: string): boolean;
-var
-  R,D: extended;
-procedure CheckFirst;
-begin
-  if Status = csFirst then
-  begin
-    Status := csValid;
-    SetDisplay(0,false);
-  end;
-end;
-begin
-  CalcKey:=true;
-  Key := UpCaseStr(Key);
-  if (Status = csError) and (Key <> 'C') then Key := ' ';
-  if Key='X^Y' then Key:='^';
-  if length(Key)>1 then
-     begin
-{        if Status = csFirst then}
-        begin
-{          Status := csValid;}
-          GetDisplay(R);
-          if Key='1/X' then begin if R=0 then Error else SetDisplay(1/R,false) end else
-          if Key='SQR' then begin if R<0 then Error else SetDisplay(sqrt(R),false) end else
-          if Key='LOG' then begin if R<=0 then Error else SetDisplay(ln(R),false) end else
-          if Key='X^2' then SetDisplay(R*R,false) else
-          if Key='M+' then Memory:=Memory+R else
-          if Key='M-' then Memory:=Memory-R else
-          if Key='M'#26 then SetDisplay(Memory,false) else
-          if Key='M'#27 then Memory:=R else
-          if Key='M'#29 then begin D:=Memory; Memory:=R; SetDisplay(D,false); end;
-        end;
-     end
-  else
-  case Key[1] of
-    '0'..'9':
-    if Length(Number)<MaxDigits then
-      begin
-        CheckFirst;
-        if Number = '0' then Number := '';
-        Number := Number + Key;
-        SetDisplay(StrToExtended(Number),true);
-      end;
-    '.':
-      begin
-        CheckFirst;
-        if Pos('.', Number) = 0 then Number := Number + '.';
-      end;
-    #8, #27:
-      begin
-        CheckFirst;
-        if Length(Number) = 1 then Number := '0' else Dec(Number[0]);
-        SetDisplay(StrToExtended(Number),true); { !!! }
-      end;
-    '_', #241:
-      if Sign = ' ' then Sign := '-' else Sign := ' ';
-    '+', '-', '*', '/', '=', '%', #13, '^':
-      begin
-        if Status = csValid then
-        begin
-          Status := csFirst;
-          GetDisplay(R);
-          if Key = '%' then
-            case _Operator of
-              '+', '-': R := Operand * R / 100;
-              '*', '/': R := R / 100;
-            end;
-          case _Operator of
-            '^': SetDisplay(Power(Operand,R),false);
-            '+': SetDisplay(Operand + R,false);
-            '-': SetDisplay(Operand - R,false);
-            '*': SetDisplay(Operand * R,false);
-            '/': if R = 0 then Error else SetDisplay(Operand / R,false);
-          end;
-        end;
-        _Operator := Key[1];
-        GetDisplay(Operand);
-      end;
-    'C':
-      Clear;
-    else CalcKey:=false;
-  end;
-  DrawView;
-end;
-
-procedure TCalcDisplay.Clear;
-begin
-  Status := csFirst;
-  Number := '0';
-  Sign := ' ';
-  _Operator := '=';
-end;
-
-procedure TCalcDisplay.Draw;
-var
-  Color: Byte;
-  I: Integer;
-  B: TDrawBuffer;
-begin
-  Color := GetColor(1);
-  I := Size.X - Length(Number) - 2;
-  MoveChar(B, ' ', Color, Size.X);
-  MoveChar(B[I], Sign, Color, 1);
-  MoveStr(B[I + 1], Number, Color);
-  WriteBuf(0, 0, Size.X, 1, B);
-end;
-
-function TCalcDisplay.GetPalette: PPalette;
-const
-  P: string[1] = #19;
-begin
-  GetPalette := @P;
-end;
-
-procedure TCalcDisplay.HandleEvent(var Event: TEvent);
-var S: string[3];
-begin
-  inherited HandleEvent(Event);
-  case Event.What of
-    evKeyDown:
-      if Owner<>nil then
-      if (Owner^.State and sfSelected)<>0 then
-      begin
-        S:=Event.CharCode;
-        Message(Owner,evBroadcast,cmPressButton,@S);
-        if CalcKey(Event.CharCode) then
-        ClearEvent(Event);
-      end;
-    evBroadcast:
-      if Event.Command = cmCalcButton then
-      begin
-        CalcKey(PButton(Event.InfoPtr)^.Title^);
-        ClearEvent(Event);
-      end;
-  end;
-end;
-
-procedure TCalcDisplay.Store(var S: TStream);
-begin
-  TView.Store(S);
-  S.Write(Status, SizeOf(Status) + SizeOf(Number) + SizeOf(Sign) +
-    SizeOf(_Operator) + SizeOf(Operand));
-end;
-
-{ TCalculator }
-
-constructor TCalculator.Init;
-const
-  Keys: array[0..29] of string[3] =
-   ('M+',  'x^y','C'  ,#27  ,'%'  ,#241 ,
-    'M-',  'x^2','7'  ,'8'  ,'9'  ,'/'  ,
-    'M'#26,'1/x','4'  ,'5'  ,'6'  ,'*'  ,
-    'M'#27,'sqr','1'  ,'2'  ,'3'  ,'-'  ,
-    'M'#29,'log','0'  ,'.'  ,'='  ,'+'  );
-var
-  I: Integer;
-  P: PView;
-  R: TRect;
-begin
-  R.Assign(5, 3, 43, 18);
-  inherited Init(R, dialog_Calculator);
-  Options := Options or ofFirstClick or ofTopSelect;
-  HelpCtx:=hcCalcWindow;
-
-  for I := 0 to 29 do
-  begin
-    R.A.X := (I mod 6) * 5 + 2;
-    R.A.Y := (I div 6) * 2 + 4;
-    R.B.X := R.A.X + 5;
-    R.B.Y := R.A.Y + 2;
-    if (I mod 6)=0 then Inc(R.B.X,1) else
-    if (I mod 6)=1 then begin R.Move(1,0); Inc(R.B.X,2) end else
-    R.Move(3,0);
-    P := New(PCalcButton, Init(R, Keys[I], cmCalcButton,
-      bfNormal + bfBroadcast+bfGrabFocus));
-    P^.Options := P^.Options {and not ofSelectable};
-    Insert(P);
-  end;
-  R.Assign(3, 2, 35, 3);
-  New(CD, Init(R));
-  CD^.Options:=CD^.Options or ofSelectable;
-  Insert(CD);
-end;
-
-procedure TCalculator.HandleEvent(var Event: TEvent);
-var R: extended;
-{    Re: real;}
-begin
-  if (State and sfSelected)<>0 then
-  case Event.What of
-    evCommand :
-     case Event.Command of
-       cmCalculatorPaste :
-         Message(@Self,evKeyDown,kbCtrlEnter,nil);
-     end;
-    evKeyDown :
-     case Event.KeyCode of
-       kbEnter :
-         begin
-           Event.KeyCode:=0;
-           Event.CharCode:='=';
-         end;
-       kbCtrlEnter :
-         begin
-           ClearEvent(Event);
-           CD^.GetDisplay(R); {Re:=R;}
-           Close;
-           CalcClipboard:=R;
-           Message(Application,evBroadcast,cmCalculatorPaste,nil);
-         end;
-       kbEsc :
-         begin
-           CD^.GetDisplay(R);
-           if R<>0 then begin
-                          CD^.SetDisplay(0,false);
-                          CD^.DrawView;
-                        end
-                   else Close;
-           ClearEvent(Event);
-         end;
-     end;
-  end;
-  { lets CD try to handle this }
-  if Event.What=evKeyDown then
-     Message(CD,Event.What,Event.KeyCode,Event.InfoPtr);
-  inherited HandleEvent(Event);
-end;
-
-procedure TCalculator.Show;
-begin
-{  if GetState(sfVisible)=false then CD^.Clear;}
-  inherited Show;
-end;
-
-procedure TCalculator.Close;
-begin
-  Hide;
-end;
-
-constructor TCalculator.Load(var S: TStream);
-begin
-  inherited Load(S);
-  GetSubViewPtr(S,CD);
-end;
-
-procedure TCalculator.Store(var S: TStream);
-begin
-  inherited Store(S);
-  PutSubViewPtr(S,CD);
-end;
-
-
-procedure RegisterFPCalc;
-begin
-{$ifndef NOOBJREG}
-  RegisterType(RCalcButton);
-  RegisterType(RCalcDisplay);
-  RegisterType(RCalculator);
-{$endif}
-end;
-
-end.
-{
-  $Log$
-  Revision 1.2  2000-11-13 17:37:41  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.1  2000/11/13 16:59:08  pierre
-   * some function in double removed from fputils unit
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.10  2000/05/02 08:42:26  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.9  2000/04/18 11:42:36  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.8  2000/03/21 23:34:10  pierre
-   adapted to wcedit addition by Gabor
-
-  Revision 1.7  1999/09/13 16:24:42  peter
-    + clock
-    * backspace unident like tp7
-
-  Revision 1.6  1999/09/07 09:20:52  pierre
-    * traling zero after . could not be inserted
-    * load/store was missing => CD not set on loading.
-    * log function was not implemented : ln is used,
-      should it rather be decimal logarithm ?
-
-  Revision 1.5  1999/06/28 19:25:35  peter
-    * fixes from gabor
-
-  Revision 1.4  1999/04/07 21:55:41  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.3  1999/03/01 15:41:49  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.2  1998/12/22 10:39:39  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 191
ide/text/fpcatch.pas

@@ -1,191 +0,0 @@
-{
-    $Id$
-    Copyright (c) 1997-98 by Michael Van Canneyt
-
-    Unit to catch segmentation faults and Ctrl-C and exit gracefully
-    under linux and go32v2
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-Unit fpcatch;
-interface
-
-{$i globdir.inc}
-
-{$ifdef Unix}
-uses
-  linux;
-{$endif}
-{$ifdef go32v2}
-uses
-  dpmiexcp;
-{$endif}
-{$ifdef win32}
-uses
-  signals;
-{$endif}
-
-{$ifdef HasSignal}
-Var
-  NewSignal,OldSigSegm,OldSigILL,
-  OldSigInt,OldSigFPE : SignalHandler;
-{$endif}
-
-Const
-  CtrlCPressed : Boolean = false;
-
-Implementation
-
-uses
-{$ifdef FPC}
-  keyboard,
-  drivers,
-{$endif FPC}
-  app,commands,msgbox,
-  FPString,FPCompil,FPIDE;
-
-
-{$ifdef HasSignal}
-{$ifdef Unix}
-Procedure CatchSignal(Sig : Integer);cdecl;
-{$else}
-Function CatchSignal(Sig : longint):longint;
-{$endif}
-var MustQuit: boolean;
-begin
-  case Sig of
-   SIGSEGV : begin
-               if StopJmpValid then
-                 LongJmp(StopJmp,SIGSEGV);
-               if Assigned(Application) then IDEApp.Done;
-               Writeln('Internal SIGSEGV Error caught');
-{$ifndef DEBUG}
-               Halt;
-{$else DEBUG}
-               RunError(216);
-{$endif DEBUG}
-             end;
-    SIGFPE : begin
-                if StopJmpValid then
-                  LongJmp(StopJmp,SIGFPE);
-               if Assigned(Application) then IDEApp.Done;
-               Writeln('Internal SIGFPE Error caught');
-{$ifndef DEBUG}
-               Halt;
-{$else DEBUG}
-               RunError(207);
-{$endif DEBUG}
-             end;
-    SIGILL : begin
-                if StopJmpValid then
-                  LongJmp(StopJmp,SIGILL);
-               if Assigned(Application) then IDEApp.Done;
-               Writeln('Internal SIGILL Error caught');
-{$ifndef DEBUG}
-               Halt;
-{$else DEBUG}
-               RunError(216);
-{$endif DEBUG}
-             end;
-    SIGINT : begin
-               if StopJmpValid then
-                 LongJmp(StopJmp,SIGINT);
-               IF NOT CtrlCPressed and Assigned(Application) then
-                 begin
-                   MustQuit:=false;
-{$ifdef FPC}
-                   CtrlCPressed:=true;
-                   Keyboard.PutKeyEvent((kbCtrl shl 16) or kbCtrlC);
-{$endif FPC}
-                 end
-               else
-                 begin
-                   if Assigned(Application) then
-                     MustQuit:=MessageBox(#3+msg_QuitConfirm,nil,mferror+mfyesbutton+mfnobutton)=cmYes
-                   else
-                     MustQuit:=true;
-                 end;
-               if MustQuit then
-                begin
-                  if Assigned(Application) then IDEApp.Done;
-{$ifndef DEBUG}
-                  Halt;
-{$else DEBUG}
-                  RunError(216);
-{$endif DEBUG}
-                end;
-             end;
-  end;
-{$ifndef Unix}
-  CatchSignal:=0;
-{$endif}
-end;
-{$endif def HasSignal}
-
-
-begin
-{$ifdef HasSignal}
-{$ifndef TP}
-  NewSignal:=SignalHandler(@CatchSignal);
-{$else TP}
-  NewSignal:=SignalHandler(CatchSignal);
-{$endif TP}
-  OldSigSegm:=Signal (SIGSEGV,NewSignal);
-  OldSigInt:=Signal (SIGINT,NewSignal);
-  OldSigFPE:=Signal (SIGFPE,NewSignal);
-  OldSigILL:=Signal (SIGILL,NewSignal);
-{$endif}
-end.
-
-{
-  $Log$
-  Revision 1.3  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.2  2000/11/14 09:23:55  marco
-   * Second batch
-
-  Revision 1.2  2000/10/31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/10/31 07:52:55  pierre
-   * recover gracefully if compiler generates a signal
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.6  2000/06/22 09:07:11  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.5  2000/05/02 08:42:26  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.4  2000/03/07 21:09:20  pierre
-    * Use globdir.inc HasSignal conditional
-    + Uses PutKeyEvent for CtrlC
-
-  Revision 1.3  1999/12/20 14:23:16  pierre
-    * MyApp renamed IDEApp
-    * TDebugController.ResetDebuggerRows added to
-      get resetting of debugger rows
-
-  Revision 1.2  1999/04/07 21:55:42  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.1  1999/02/20 15:18:28  peter
-    + ctrl-c capture with confirm dialog
-    + ascii table in the tools menu
-    + heapviewer
-    * empty file fixed
-    * fixed callback routines in fpdebug to have far for tp7
-
-}

+ 0 - 300
ide/text/fpcodcmp.pas

@@ -1,300 +0,0 @@
-unit FPCodCmp; { CodeComplete }
-
-interface
-
-uses Objects,Drivers,
-     WUtils,WViews;
-
-type
-     PCodeCompleteWordList = ^TCodeCompleteWordList;
-     TCodeCompleteWordList = object(TTextCollection)
-     end;
-
-    PCodeCompleteDialog = ^TCodeCompleteDialog;
-    TCodeCompleteDialog = object(TCenterDialog)
-      constructor Init;
-      function    Execute: Word; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-    private
-      CodeCompleteLB : PAdvancedListBox;
-      procedure Add;
-      procedure Edit;
-      procedure Delete;
-    end;
-
-function FPCompleteCodeWord(const WordS: string; var Text: string): boolean;
-
-procedure InitCodeComplete;
-function  LoadCodeComplete(var S: TStream): boolean;
-function  StoreCodeComplete(var S: TStream): boolean;
-procedure DoneCodeComplete;
-
-const CodeCompleteWords : PCodeCompleteWordList = nil;
-
-procedure RegisterCodeComplete;
-
-implementation
-
-uses Commands,Views,Dialogs,MsgBox,
-     WEditor,
-     FPConst,FPString,FPViews;
-
-{$ifndef NOOBJREG}
-const
-  RCodeCompleteWordList: TStreamRec = (
-     ObjType: 14401;
-     VmtLink: Ofs(TypeOf(TCodeCompleteWordList)^);
-     Load:    @TCodeCompleteWordList.Load;
-     Store:   @TCodeCompleteWordList.Store
-  );
-{$endif}
-
-function FPCompleteCodeWord(const WordS: string; var Text: string): boolean;
-var OK: boolean;
-    Index: sw_integer;
-begin
-  OK:=Assigned(CodeCompleteWords);
-  if OK then
-  begin
-    Text:=CodeCompleteWords^.Lookup(WordS,Index);
-    OK:=(Index<>-1) and (length(Text)<>length(WordS));
-  end;
-  if OK=false then Text:='';
-  FPCompleteCodeWord:=OK;
-end;
-
-procedure InitCodeComplete;
-var I:integer;
-    S: string;
-begin
-  if Assigned(CodeCompleteWords) then Exit;
-
-  New(CodeCompleteWords, Init(10,10));
-  for I:=0 to GetReservedWordCount-1 do
-    begin
-      S:=LowCaseStr(GetReservedWord(I));
-      if length(S)>=CodeCompleteMinLen then
-        CodeCompleteWords^.Insert(NewStr(S));
-    end;
-  {
-    there should be also a user front-end for customizing CodeComplete !
-     any volunteers to implement? ;) - Gabor
-  }
-end;
-
-function LoadCodeComplete(var S: TStream): boolean;
-var C: PCodeCompleteWordList;
-    OK: boolean;
-begin
-  New(C, Load(S));
-  OK:=Assigned(C) and (S.Status=stOk);
-  if OK then
-    begin
-      if Assigned(CodeCompleteWords) then Dispose(CodeCompleteWords, Done);
-      CodeCompleteWords:=C;
-    end
-  else
-    if Assigned(C) then
-      Dispose(C, Done);
-  LoadCodeComplete:=OK;
-end;
-
-function StoreCodeComplete(var S: TStream): boolean;
-var OK: boolean;
-begin
-  OK:=Assigned(CodeCompleteWords);
-  if OK then
-  begin
-    CodeCompleteWords^.Store(S);
-    OK:=OK and (S.Status=stOK);
-  end;
-  StoreCodeComplete:=OK;
-end;
-
-procedure DoneCodeComplete;
-begin
-  if Assigned(CodeCompleteWords) then Dispose(CodeCompleteWords, Done);
-  CodeCompleteWords:=nil;
-end;
-
-constructor TCodeCompleteDialog.Init;
-var R,R2,R3: TRect;
-    SB: PScrollBar;
-begin
-  R.Assign(0,0,46,16);
-  inherited Init(R,dialog_codecomplete);
-
-  GetExtent(R); R.Grow(-3,-2); Inc(R.A.Y); R3.Copy(R); Dec(R.B.X,12);
-  R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
-  New(SB, Init(R2)); Insert(SB);
-  New(CodeCompleteLB, Init(R,1,SB));
-  Insert(CodeCompleteLB);
-  R2.Copy(R); R2.Move(0,-1); R2.B.Y:=R2.A.Y+1; Dec(R2.A.X);
-  Insert(New(PLabel, Init(R2, label_codecomplete_keywords, CodeCompleteLB)));
-
-  R.Copy(R3); R.A.X:=R.B.X-10; R.B.Y:=R.A.Y+2;
-  Insert(New(PButton, Init(R, button_OK, cmOK, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Edit, cmEditItem, bfDefault)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_New, cmAddItem, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Delete, cmDeleteItem, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Cancel, cmCancel, bfNormal)));
-  SelectNext(false);
-end;
-
-procedure TCodeCompleteDialog.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-begin
-  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbIns  :
-            Message(@Self,evCommand,cmAddItem,nil);
-          kbDel  :
-            Message(@Self,evCommand,cmDeleteItem,nil);
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmListItemSelected :
-          if Event.InfoPtr=pointer(CodeCompleteLB) then
-            Message(@Self,evCommand,cmEditItem,nil);
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmAddItem    : Add;
-          cmDeleteItem : Delete;
-          cmEditItem   : Edit;
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TCodeCompleteDialog.Execute: Word;
-var R: word;
-    C: PCodeCompleteWordList;
-    I: integer;
-begin
-  New(C, Init(10,20));
-  if Assigned(CodeCompleteWords) then
-  for I:=0 to CodeCompleteWords^.Count-1 do
-    C^.Insert(NewStr(GetStr(CodeCompleteWords^.At(I))));
-  CodeCompleteLB^.NewList(C);
-  R:=inherited Execute;
-  if R=cmOK then
-    begin
-      if Assigned(CodeCompleteWords) then Dispose(CodeCompleteWords, Done);
-      CodeCompleteWords:=C;
-    end
-  else
-    Dispose(C, Done);
-  Execute:=R;
-end;
-
-procedure TCodeCompleteDialog.Add;
-var IC: boolean;
-    S: string;
-    P: PString;
-    Cmd: word;
-    CanExit: boolean;
-    I: sw_integer;
-begin
-  IC:=CodeCompleteLB^.Range=0;
-  if IC=false then
-    S:=GetStr(CodeCompleteLB^.List^.At(CodeCompleteLB^.Focused))
-  else
-    S:='';
-
-  repeat
-    Cmd:=InputBox(dialog_codecomplete_add,label_codecomplete_add_keyword,S,255);
-    CanExit:=Cmd<>cmOK;
-    if CanExit=false then
-      begin
-        CanExit:=PCodeCompleteWordList(CodeCompleteLB^.List)^.Search(@S,I)=false;
-        if CanExit=false then
-        begin
-          ClearFormatParams; AddFormatParamStr(S);
-          ErrorBox(msg_codecomplete_alreadyinlist,@FormatParams);
-        end;
-      end;
-  until CanExit;
-
-  if Cmd=cmOK then
-    begin
-      P:=NewStr(S);
-      with CodeCompleteLB^ do
-      begin
-        List^.Insert(P);
-        SetRange(List^.Count);
-        SetFocusedItem(P);
-      end;
-      ReDraw;
-    end;
-end;
-
-procedure TCodeCompleteDialog.Edit;
-var S: string;
-    I,T: sw_integer;
-    Cmd: word;
-    CanExit: boolean;
-    P: PString;
-begin
-  if CodeCompleteLB^.Range=0 then Exit;
-  I:=CodeCompleteLB^.Focused;
-  S:=GetStr(CodeCompleteLB^.List^.At(I));
-  repeat
-    Cmd:=InputBox(dialog_codecomplete_edit,label_codecomplete_edit_keyword,S,255);
-    CanExit:=Cmd<>cmOK;
-    if CanExit=false then
-      begin
-        CanExit:=PCodeCompleteWordList(CodeCompleteLB^.List)^.Search(@S,T)=false;
-        CanExit:=CanExit or (T=I);
-        if CanExit=false then
-        begin
-          ClearFormatParams; AddFormatParamStr(S);
-          ErrorBox(msg_codecomplete_alreadyinlist,@FormatParams);
-        end;
-      end;
-  until CanExit;
-
-  if Cmd=cmOK then
-    begin
-      P:=NewStr(S);
-      with CodeCompleteLB^ do
-      begin
-        List^.AtFree(I);
-        List^.Insert(P);
-        SetFocusedItem(P);
-      end;
-      ReDraw;
-    end;
-end;
-
-procedure TCodeCompleteDialog.Delete;
-begin
-  if CodeCompleteLB^.Range=0 then Exit;
-  CodeCompleteLB^.List^.AtFree(CodeCompleteLB^.Focused);
-  CodeCompleteLB^.SetRange(CodeCompleteLB^.List^.Count);
-  ReDraw;
-end;
-
-procedure RegisterCodeComplete;
-begin
-{$ifndef NOOBJREG}
-  RegisterType(RCodeCompleteWordList);
-{$endif}
-end;
-
-END.

+ 0 - 520
ide/text/fpcodtmp.pas

@@ -1,520 +0,0 @@
-unit FPCodTmp; { Code Templates }
-
-interface
-
-uses Objects,Drivers,Dialogs,
-     WUtils,WViews,WEditor,
-     FPViews;
-
-type
-    PCodeTemplate = ^TCodeTemplate;
-    TCodeTemplate = object(TObject)
-      constructor Init(const AShortCut: string; AText: PUnsortedStringCollection);
-      function    GetShortCut: string;
-      procedure   GetText(AList: PUnsortedStringCollection);
-      procedure   SetShortCut(const AShortCut: string);
-      procedure   SetText(AList: PUnsortedStringCollection);
-      procedure   GetParams(var AShortCut: string; Lines: PUnsortedStringCollection);
-      procedure   SetParams(const AShortCut: string; Lines: PUnsortedStringCollection);
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      destructor  Done; virtual;
-    private
-      ShortCut: PString;
-      Text: PUnsortedStringCollection;
-    end;
-
-    PCodeTemplateCollection = ^TCodeTemplateCollection;
-    TCodeTemplateCollection = object(TSortedCollection)
-      function Compare(Key1, Key2: Pointer): sw_Integer; virtual;
-      function SearchByShortCut(const ShortCut: string): PCodeTemplate; virtual;
-    end;
-
-    PCodeTemplateListBox = ^TCodeTemplateListBox;
-    TCodeTemplateListBox = object(TAdvancedListBox)
-      function GetText(Item,MaxLen: Sw_Integer): String; virtual;
-    end;
-
-    PCodeTemplateDialog = ^TCodeTemplateDialog;
-    TCodeTemplateDialog = object(TCenterDialog)
-      constructor Init(const ATitle: string; ATemplate: PCodeTemplate);
-      function    Execute: Word; virtual;
-    private
-      Template   : PCodeTemplate;
-      ShortcutIL : PInputLine;
-      CodeMemo   : PFPCodeMemo;
-    end;
-
-    PCodeTemplatesDialog = ^TCodeTemplatesDialog;
-    TCodeTemplatesDialog = object(TCenterDialog)
-      constructor Init;
-      function    Execute: Word; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-    private
-      CodeTemplatesLB : PCodeTemplateListBox;
-      TemplateViewer  : PFPCodeMemo;
-      procedure Add;
-      procedure Edit;
-      procedure Delete;
-      procedure Update;
-    end;
-
-const CodeTemplates : PCodeTemplateCollection = nil;
-
-function FPTranslateCodeTemplate(const Shortcut: string; ALines: PUnsortedStringCollection): boolean;
-
-procedure InitCodeTemplates;
-function  LoadCodeTemplates(var S: TStream): boolean;
-function  StoreCodeTemplates(var S: TStream): boolean;
-procedure DoneCodeTemplates;
-
-procedure RegisterCodeTemplates;
-
-implementation
-
-uses Commands,Views,App,
-     FPConst,FPString;
-
-{$ifndef NOOBJREG}
-const
-  RCodeTemplate: TStreamRec = (
-     ObjType: 14501;
-     VmtLink: Ofs(TypeOf(TCodeTemplate)^);
-     Load:    @TCodeTemplate.Load;
-     Store:   @TCodeTemplate.Store
-  );
-  RCodeTemplateCollection: TStreamRec = (
-     ObjType: 14502;
-     VmtLink: Ofs(TypeOf(TCodeTemplateCollection)^);
-     Load:    @TCodeTemplateCollection.Load;
-     Store:   @TCodeTemplateCollection.Store
-  );
-{$endif}
-
-constructor TCodeTemplate.Init(const AShortCut: string; AText: PUnsortedStringCollection);
-procedure CopyIt(P: PString); {$ifndef FPC}far;{$endif}
-begin
-  Text^.Insert(NewStr(GetStr(P)));
-end;
-begin
-  inherited Init;
-  ShortCut:=NewStr(AShortCut);
-  SetText(AText);
-end;
-
-function TCodeTemplate.GetShortCut: string;
-begin
-  GetShortCut:=GetStr(ShortCut);
-end;
-
-procedure TCodeTemplate.GetText(AList: PUnsortedStringCollection);
-procedure CopyIt(P: PString); {$ifndef FPC}far;{$endif}
-begin
-  AList^.Insert(NewStr(GetStr(P)));
-end;
-begin
-  if Assigned(AList) and Assigned(Text) then
-    Text^.ForEach(@CopyIt);
-end;
-
-procedure TCodeTemplate.SetShortCut(const AShortCut: string);
-begin
-  if Assigned(ShortCut) then DisposeStr(ShortCut);
-  ShortCut:=NewStr(AShortCut);
-end;
-
-procedure TCodeTemplate.SetText(AList: PUnsortedStringCollection);
-begin
-  if Assigned(Text) then Dispose(Text, Done);
-  New(Text, CreateFrom(AList));
-end;
-
-procedure TCodeTemplate.GetParams(var AShortCut: string; Lines: PUnsortedStringCollection);
-begin
-  AShortCut:=GetShortCut;
-  GetText(Lines);
-end;
-
-procedure TCodeTemplate.SetParams(const AShortCut: string; Lines: PUnsortedStringCollection);
-begin
-  SetShortCut(AShortCut);
-  SetText(Lines);
-end;
-
-constructor TCodeTemplate.Load(var S: TStream);
-begin
-  ShortCut:=S.ReadStr;
-  New(Text, Load(S));
-end;
-
-procedure TCodeTemplate.Store(var S: TStream);
-begin
-  S.WriteStr(ShortCut);
-  Text^.Store(S);
-end;
-
-destructor TCodeTemplate.Done;
-begin
-  if Assigned(ShortCut) then DisposeStr(ShortCut); ShortCut:=nil;
-  if Assigned(Text) then Dispose(Text, Done); Text:=nil;
-  inherited Done;
-end;
-
-function TCodeTemplateCollection.Compare(Key1, Key2: Pointer): sw_Integer;
-var K1: PCodeTemplate absolute Key1;
-    K2: PCodeTemplate absolute Key2;
-    R: Sw_integer;
-    S1,S2: string;
-begin
-  S1:=UpCaseStr(K1^.GetShortCut);
-  S2:=UpCaseStr(K2^.GetShortCut);
-  if S1<S2 then R:=-1 else
-  if S1>S2 then R:=1 else
-  R:=0;
-  Compare:=R;
-end;
-
-function TCodeTemplateCollection.SearchByShortCut(const ShortCut: string): PCodeTemplate;
-var T: TCodeTemplate;
-    Index: sw_integer;
-    P: PCodeTemplate;
-begin
-  T.Init(ShortCut,nil);
-  if Search(@T,Index)=false then P:=nil else
-    P:=At(Index);
-  T.Done;
-  SearchByShortCut:=P;
-end;
-
-function FPTranslateCodeTemplate(const Shortcut: string; ALines: PUnsortedStringCollection): boolean;
-var OK: boolean;
-    P: PCodeTemplate;
-begin
-  OK:=Assigned(CodeTemplates);
-  if OK then
-  begin
-    P:=CodeTemplates^.SearchByShortCut(ShortCut);
-    OK:=Assigned(P);
-    if OK then
-      P^.GetText(ALines);
-  end;
-  FPTranslateCodeTemplate:=OK;
-end;
-
-procedure InitCodeTemplates;
-begin
-  if Assigned(CodeTemplates) then Exit;
-
-  New(CodeTemplates, Init(10,10));
-end;
-
-function LoadCodeTemplates(var S: TStream): boolean;
-var C: PCodeTemplateCollection;
-    OK: boolean;
-begin
-  New(C, Load(S));
-  OK:=Assigned(C) and (S.Status=stOk);
-  if OK then
-    begin
-      if Assigned(CodeTemplates) then Dispose(CodeTemplates, Done);
-      CodeTemplates:=C;
-    end
-  else
-    if Assigned(C) then
-      Dispose(C, Done);
-  LoadCodeTemplates:=OK;
-end;
-
-function StoreCodeTemplates(var S: TStream): boolean;
-var OK: boolean;
-begin
-  OK:=Assigned(CodeTemplates);
-  if OK then
-  begin
-    CodeTemplates^.Store(S);
-    OK:=OK and (S.Status=stOK);
-  end;
-  StoreCodeTemplates:=OK;
-end;
-
-procedure DoneCodeTemplates;
-begin
-  if Assigned(CodeTemplates) then Dispose(CodeTemplates, Done);
-  CodeTemplates:=nil;
-end;
-
-function TCodeTemplateListBox.GetText(Item,MaxLen: Sw_Integer): String;
-var P: PCodeTemplate;
-begin
-  P:=List^.At(Item);
-  GetText:=P^.GetShortCut;
-end;
-
-constructor TCodeTemplateDialog.Init(const ATitle: string; ATemplate: PCodeTemplate);
-var R,R2,R3: TRect;
-begin
-  R.Assign(0,0,52,15);
-  inherited Init(R,ATitle);
-  Template:=ATemplate;
-
-  GetExtent(R); R.Grow(-3,-2); R3.Copy(R);
-  Inc(R.A.Y); R.B.Y:=R.A.Y+1; R.B.X:=R.A.X+46;
-  New(ShortCutIL, Init(R, 128)); Insert(ShortcutIL);
-  R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, label_codetemplate_shortcut, ShortcutIL)));
-  R.Move(0,3); R.B.Y:=R.A.Y+8;
-  New(CodeMemo, Init(R, nil,nil,nil{,4096 does not compile !! })); Insert(CodeMemo);
-  R2.Copy(R); R2.Move(-1,-1); R2.B.Y:=R2.A.Y+1; Insert(New(PLabel, Init(R2, label_codetemplate_content, CodeMemo)));
-
-  InsertButtons(@Self);
-
-  ShortcutIL^.Select;
-end;
-
-function TCodeTemplateDialog.Execute: Word;
-var R: word;
-    S: string;
-    L: PUnsortedStringCollection;
-begin
-  New(L, Init(10,10));
-  S:=Template^.GetShortCut;
-  Template^.GetText(L);
-  ShortcutIL^.SetData(S);
-  CodeMemo^.SetContent(L);
-  R:=inherited Execute;
-  if R=cmOK then
-  begin
-    L^.FreeAll;
-    ShortcutIL^.GetData(S);
-    CodeMemo^.GetContent(L);
-    Template^.SetShortcut(S);
-    Template^.SetText(L);
-  end;
-  Execute:=R;
-end;
-
-constructor TCodeTemplatesDialog.Init;
-var R,R2,R3: TRect;
-    SB: PScrollBar;
-begin
-  R.Assign(0,0,46,20);
-  inherited Init(R,'CodeTemplates');
-
-  GetExtent(R); R.Grow(-3,-2); Inc(R.A.Y); R.B.Y:=R.A.Y+10;
-  R3.Copy(R); Dec(R.B.X,12);
-  R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
-  New(SB, Init(R2)); Insert(SB);
-  New(CodeTemplatesLB, Init(R,1,SB));
-  Insert(CodeTemplatesLB);
-  R2.Copy(R); R2.Move(0,-1); R2.B.Y:=R2.A.Y+1; Dec(R2.A.X);
-  Insert(New(PLabel, Init(R2, label_codetemplate_templates, CodeTemplatesLB)));
-
-  GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y,12);
-  R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
-  New(SB, Init(R2)); Insert(SB);
-  New(TemplateViewer, Init(R,nil,SB,nil{,4096 does not compile }));
-  with TemplateViewer^ do
-  begin
-    ReadOnly:=true;
-    AlwaysShowScrollBars:=true;
-  end;
-  Insert(TemplateViewer);
-
-  R.Copy(R3); R.A.X:=R.B.X-10; R.B.Y:=R.A.Y+2;
-  Insert(New(PButton, Init(R, button_OK, cmOK, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Edit, cmEditItem, bfDefault)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_New, cmAddItem, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Delete, cmDeleteItem, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Cancel, cmCancel, bfNormal)));
-  SelectNext(false);
-end;
-
-procedure TCodeTemplatesDialog.Update;
-var C: PUnsortedStringCollection;
-begin
-  if CodeTemplatesLB^.Range=0 then C:=nil else
-    C:=PCodeTemplate(CodeTemplatesLB^.GetFocusedItem)^.Text;
-  TemplateViewer^.SetContent(C);
-  ReDraw;
-end;
-
-procedure TCodeTemplatesDialog.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-begin
-  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbIns  :
-            Message(@Self,evCommand,cmAddItem,nil);
-          kbDel  :
-            Message(@Self,evCommand,cmDeleteItem,nil);
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmListItemSelected :
-          if Event.InfoPtr=pointer(CodeTemplatesLB) then
-            Message(@Self,evCommand,cmEditItem,nil);
-        cmListFocusChanged :
-          if Event.InfoPtr=pointer(CodeTemplatesLB) then
-            Message(@Self,evBroadcast,cmUpdate,nil);
-        cmUpdate :
-          Update;
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmAddItem    : Add;
-          cmDeleteItem : Delete;
-          cmEditItem   : Edit;
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TCodeTemplatesDialog.Execute: Word;
-var R: word;
-    P: PCodeTemplate;
-    C: PCodeTemplateCollection;
-    L: PUnsortedStringCollection;
-    I: integer;
-begin
-  New(C, Init(10,20));
-  if Assigned(CodeTemplates) then
-  for I:=0 to CodeTemplates^.Count-1 do
-    begin
-      P:=CodeTemplates^.At(I);
-      New(L, Init(10,50));
-      P^.GetText(L);
-      C^.Insert(New(PCodeTemplate, Init(P^.GetShortCut,L)));
-      Dispose(L, Done);
-    end;
-  CodeTemplatesLB^.NewList(C);
-  Update;
-  R:=inherited Execute;
-  if R=cmOK then
-    begin
-      if Assigned(CodeTemplates) then Dispose(CodeTemplates, Done);
-      CodeTemplates:=C;
-    end
-  else
-    Dispose(C, Done);
-  Execute:=R;
-end;
-
-procedure TCodeTemplatesDialog.Add;
-var P,P2: PCodeTemplate;
-    IC: boolean;
-    S: string;
-    L: PUnsortedStringCollection;
-    Cmd: word;
-    CanExit: boolean;
-begin
-  New(L, Init(10,10));
-  IC:=CodeTemplatesLB^.Range=0;
-  if IC=false then
-    begin
-      P:=CodeTemplatesLB^.List^.At(CodeTemplatesLB^.Focused);
-      P^.GetParams(S,L);
-    end
-  else
-    begin
-      S:='';
-    end;
-  New(P, Init(S,L));
-  repeat
-    Cmd:=Application^.ExecuteDialog(New(PCodeTemplateDialog, Init(dialog_newtemplate,P)), nil);
-    CanExit:=(Cmd<>cmOK);
-    if CanExit=false then
-      begin
-        P2:=PCodeTemplateCollection(CodeTemplatesLB^.List)^.SearchByShortCut(P^.GetShortCut);
-        CanExit:=(Assigned(P2)=false);
-        if CanExit=false then
-        begin
-          ClearFormatParams; AddFormatParamStr(P^.GetShortCut);
-          ErrorBox(msg_codetemplate_alreadyinlist,@FormatParams);
-        end;
-      end;
-  until CanExit;
-  if Cmd=cmOK then
-    begin
-      CodeTemplatesLB^.List^.Insert(P);
-      CodeTemplatesLB^.SetRange(CodeTemplatesLB^.List^.Count);
-      CodeTemplatesLB^.SetFocusedItem(P);
-      Update;
-    end
-  else
-    Dispose(P, Done);
-  Dispose(L, Done);
-end;
-
-procedure TCodeTemplatesDialog.Edit;
-var P,O,P2: PCodeTemplate;
-    I: sw_integer;
-    S: string;
-    L: PUnsortedStringCollection;
-    Cmd: word;
-    CanExit: boolean;
-begin
-  if CodeTemplatesLB^.Range=0 then Exit;
-  New(L, Init(10,10));
-  I:=CodeTemplatesLB^.Focused;
-  O:=CodeTemplatesLB^.List^.At(I);
-  O^.GetParams(S,L);
-  P:=New(PCodeTemplate, Init(S, L));
-  repeat
-    Cmd:=Application^.ExecuteDialog(New(PCodeTemplateDialog, Init(dialog_modifytemplate,P)), nil);
-    CanExit:=(Cmd<>cmOK);
-    if CanExit=false then
-      begin
-        P2:=PCodeTemplateCollection(CodeTemplatesLB^.List)^.SearchByShortCut(P^.GetShortCut);
-        CanExit:=(Assigned(P2)=false) or (CodeTemplatesLB^.List^.IndexOf(P2)=I);
-        if CanExit=false then
-        begin
-          ClearFormatParams; AddFormatParamStr(P^.GetShortCut);
-          ErrorBox(msg_codetemplate_alreadyinlist,@FormatParams);
-        end;
-      end;
-  until CanExit;
-  if Cmd=cmOK then
-    begin
-      with CodeTemplatesLB^ do
-      begin
-        List^.AtFree(I); O:=nil;
-        List^.Insert(P);
-        SetFocusedItem(P);
-      end;
-      Update;
-    end;
-  Dispose(L, Done);
-end;
-
-procedure TCodeTemplatesDialog.Delete;
-begin
-  if CodeTemplatesLB^.Range=0 then Exit;
-  CodeTemplatesLB^.List^.AtFree(CodeTemplatesLB^.Focused);
-  CodeTemplatesLB^.SetRange(CodeTemplatesLB^.List^.Count);
-  Update;
-end;
-
-
-procedure RegisterCodeTemplates;
-begin
-{$ifndef NOOBJREG}
-  RegisterType(RCodeTemplate);
-  RegisterType(RCodeTemplateCollection);
-{$endif}
-end;
-
-END.

+ 0 - 1464
ide/text/fpcompil.pas

@@ -1,1464 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Compiler call routines for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$i globdir.inc}
-unit FPCompil;
-
-interface
-
-{ don't redir under linux, because all stdout (also from the ide!) will
-  then be redired (PFV) }
-{ this should work now correctly because
-  RedirDisableAll and RedirEnableAll function are added in fpredir (PM) }
-
-{ $define VERBOSETXT}
-
-uses
-  Objects,
-  finput,
-  Drivers,Views,Dialogs,
-  WViews,WCEdit,
-  FPSymbol,
-  FPViews;
-
-type
-  TCompileMode = (cBuild,cMake,cCompile,cRun);
-
-type
-    PCompilerMessage = ^TCompilerMessage;
-    TCompilerMessage = object(TMessageItem)
-      function GetText(MaxLen: Sw_Integer): String; virtual;
-    end;
-
-    PCompilerMessageListBox = ^TCompilerMessageListBox;
-    TCompilerMessageListBox = object(TMessageListBox)
-      function  GetPalette: PPalette; virtual;
-      procedure SelectFirstError;
-    end;
-
-    PCompilerMessageWindow = ^TCompilerMessageWindow;
-    TCompilerMessageWindow = object(TFPWindow)
-      constructor Init;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      function    GetPalette: PPalette; virtual;
-      procedure   Close;virtual;
-      destructor  Done; virtual;
-      procedure   SizeLimits(var Min, Max: TPoint); virtual;
-      procedure   AddMessage(AClass: longint;const Msg, Module: string; Line, Column: longint);
-      procedure   ClearMessages;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   SetState(AState: Word; Enable: Boolean); virtual;
-      procedure   UpdateCommands; virtual;
-    private
-      {CompileShowed : boolean;}
-      {Mode   : TCompileMode;}
-      MsgLB  : PCompilerMessageListBox;
-      {CurrST,
-      InfoST : PColorStaticText;}
-    end;
-
-    PCompilerStatusDialog = ^TCompilerStatusDialog;
-    TCompilerStatusDialog = object(TCenterDialog)
-      ST    : PAdvancedStaticText;
-      KeyST : PColorStaticText;
-      constructor Init;
-      procedure   Update;
-    end;
-
-    PFPInputFile = ^TFPInputFile;
-    TFPInputFile = object(tinputfile)
-      constructor Init(AEditor: PFileEditor);
-    {$ifdef FPC}protected{$else}public{$endif}
-      function fileopen(const filename: string): boolean; virtual;
-      function fileseek(pos: longint): boolean; virtual;
-      function fileread(var databuf; maxsize: longint): longint; virtual;
-      function fileeof: boolean; virtual;
-      function fileclose: boolean; virtual;
-    private
-      Editor: PFileEditor;
-      S: PStream;
-    end;
-
-const
-    CompilerMessageWindow : PCompilerMessageWindow  = nil;
-    CompilerStatusDialog  : PCompilerStatusDialog = nil;
-    CompileStamp          : longint = 0;
-
-procedure DoCompile(Mode: TCompileMode);
-function  NeedRecompile(verbose : boolean): boolean;
-procedure ParseUserScreen;
-
-procedure RegisterFPCompile;
-
-{$ifndef GABOR}
-var
-  StopJmp : Jmp_Buf;
-const
-  StopJmpValid : boolean = false;
-{$endif}
-
-implementation
-
-uses
-{$ifdef Unix}
-  Linux,
-{$endif}
-{$ifdef go32v2}
-  dpmiexcp,
-{$endif}
-{$ifdef win32}
-  signals,
-{$endif}
-  Dos,Video,
-  App,Commands,tokens,
-  Globals, CompHook, Compiler, systems, browcol,
-  WUtils,WEditor,
-  FPString,FPRedir,FPDesk,FPUsrScr,FPHelp,
-  FPConst,FPVars,FPUtils,FPIntf,FPSwitch;
-
-{$ifndef NOOBJREG}
-const
-  RCompilerMessageListBox: TStreamRec = (
-     ObjType: 1211;
-     VmtLink: Ofs(TypeOf(TCompilerMessageListBox)^);
-     Load:    @TCompilerMessageListBox.Load;
-     Store:   @TCompilerMessageListBox.Store
-  );
-  RCompilerMessageWindow: TStreamRec = (
-     ObjType: 1212;
-     VmtLink: Ofs(TypeOf(TCompilerMessageWindow)^);
-     Load:    @TCompilerMessageWindow.Load;
-     Store:   @TCompilerMessageWindow.Store
-  );
-{$endif}
-
-
-procedure ParseUserScreen;
-var
-  y : longint;
-  Text,Attr : String;
-  DisplayCompilerWindow : boolean;
-  cc: integer;
-
-    procedure SearchBackTrace;
-      var AText,ModuleName,st : String;
-          row : longint;
-      begin
-        if pos('  0x',Text)=1 then
-          begin
-            AText:=Text;
-            Delete(Text,1,10);
-            While pos(' ',Text)=1 do
-              Delete(Text,1,1);
-            if pos('of ',Text)>0 then
-              begin
-                ModuleName:=Copy(Text,pos('of ',Text)+3,255);
-                While ModuleName[Length(ModuleName)]=' ' do
-                  Delete(ModuleName,Length(ModuleName),1);
-              end
-            else
-              ModuleName:='';
-            if pos('line ',Text)>0 then
-              begin
-                Text:=Copy(Text,Pos('line ',Text)+5,255);
-                st:=Copy(Text,1,Pos(' ',Text)-1);
-                Val(st,row,cc);
-              end
-            else
-              row:=0;
-            CompilerMessageWindow^.AddMessage(V_Fatal,AText
-                  ,ModuleName,row,1);
-            DisplayCompilerWindow:=true;
-          end;
-      end;
-
-    procedure InsertInMessages(Const TypeStr : String;_Type : longint;EnableDisplay : boolean);
-      var p,p2,col,row : longint;
-          St,ModuleName : string;
-
-      begin
-        p:=pos(TypeStr,Text);
-        p2:=Pos('(',Text);
-        if (p>0)  and (p2>0) and (p2<p) then
-          begin
-            ModuleName:=Copy(Text,1,p2-1);
-            st:=Copy(Text,p2+1,255);
-            Val(Copy(st,1,pos(',',st)-1),row,cc);
-            st:=Copy(st,Pos(',',st)+1,255);
-            Val(Copy(st,1,pos(')',st)-1),col,cc);
-            CompilerMessageWindow^.AddMessage(_type,Copy(Text,pos(':',Text)+1,255)
-              ,ModuleName,row,col);
-            If EnableDisplay then
-              DisplayCompilerWindow:=true;
-          end;
-      end;
-
-begin
-  if not assigned(UserScreen) then
-    exit;
-  DisplayCompilerWindow:=false;
-  PushStatus('Parsing User Screen');
-  for Y:=0 to UserScreen^.GetHeight do
-    begin
-      UserScreen^.GetLine(Y,Text,Attr);
-      SearchBackTrace;
-      InsertInMessages(' Fatal:',v_Fatal,true);
-      InsertInMessages(' Error:',v_Error,true);
-      InsertInMessages(' Warning:',v_Warning,false);
-      InsertInMessages(' Note:',v_Note,false);
-      InsertInMessages(' Info:',v_Info,false);
-      InsertInMessages(' Hint:',v_Hint,false);
-    end;
-  if DisplayCompilerWindow then
-    begin
-      if not CompilerMessageWindow^.GetState(sfVisible) then
-        CompilerMessageWindow^.Show;
-      CompilerMessageWindow^.MakeFirst;
-      CompilerMessageWindow^.MsgLB^.SelectFirstError;
-    end;
-  PopStatus;
-end;
-
-{*****************************************************************************
-                               TCompilerMessage
-*****************************************************************************}
-
-function TCompilerMessage.GetText(MaxLen: Sw_Integer): String;
-var
-  ClassS: string[20];
-  S: string;
-begin
-  if TClass=
-    V_Fatal       then ClassS:=msg_class_Fatal   else if TClass =
-    V_Error       then ClassS:=msg_class_Error   else if TClass =
-    V_Normal      then ClassS:=msg_class_Normal  else if TClass =
-    V_Warning     then ClassS:=msg_class_Warning else if TClass =
-    V_Note        then ClassS:=msg_class_Note    else if TClass =
-    V_Hint        then ClassS:=msg_class_Hint
-{$ifdef VERBOSETXT}
-    else if TClass =
-    V_Macro       then ClassS:=msg_class_macro   else if TClass =
-    V_Procedure   then ClassS:=msg_class_procedure else if TClass =
-    V_Conditional then ClassS:=msg_class_conditional else if TClass =
-    V_Info        then ClassS:=msg_class_info    else if TClass =
-    V_Status      then ClassS:=msg_class_status  else if TClass =
-    V_Used        then ClassS:=msg_class_used    else if TClass =
-    V_Tried       then ClassS:=msg_class_tried   else if TClass =
-    V_Debug       then ClassS:=msg_class_debug
-  else
-   ClassS:='???';
-{$else}
-  else
-   ClassS:='';
-{$endif}
-  if ClassS<>'' then
-   ClassS:=RExpand(ClassS,0)+': ';
-  if assigned(Module) and
-     (TClass<=V_ShowFile)
-     {and (status.currentsource<>'') and (status.currentline>0)} then
-    begin
-      if Row>0 then
-       begin
-         if Col>0 then
-          S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+','+IntToStr(Col)+') '+ClassS
-         else
-          S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+ClassS;
-       end
-      else
-       S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+ClassS
-    end
-  else
-    S:=ClassS;
-  if assigned(Text) then
-    S:=S+Text^;
-  if length(S)>MaxLen then
-    S:=copy(S,1,MaxLen-2)+'..';
-  GetText:=S;
-end;
-
-
-{*****************************************************************************
-                             TCompilerMessageListBox
-*****************************************************************************}
-
-function TCompilerMessageListBox.GetPalette: PPalette;
-const
-  P: string[length(CBrowserListBox)] = CBrowserListBox;
-begin
-  GetPalette:=@P;
-end;
-
-procedure TCompilerMessageListBox.SelectFirstError;
-  function IsError(P : PCompilerMessage) : boolean;
-    begin
-      IsError:=(P^.TClass and (V_Fatal or V_Error))<>0;
-    end;
-  var
-    P : PCompilerMessage;
-begin
-  P:=List^.FirstThat(@IsError);
-  If Assigned(P) then
-    Begin
-      FocusItem(List^.IndexOf(P));
-      DrawView;
-    End;
-end;
-
-
-{*****************************************************************************
-                                TCompilerMessageWindow
-*****************************************************************************}
-
-constructor TCompilerMessageWindow.Init;
-var R: TRect;
-    HSB,VSB: PScrollBar;
-begin
-  Desktop^.GetExtent(R);
-  R.A.Y:=R.B.Y-7;
-  inherited Init(R,dialog_compilermessages,{SearchFreeWindowNo}wnNoNumber);
-  HelpCtx:=hcMessagesWindow;
-
-  AutoNumber:=true;
-
-  HSB:=StandardScrollBar(sbHorizontal+sbHandleKeyboard);
-  HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
-  Insert(HSB);
-  VSB:=StandardScrollBar(sbVertical+sbHandleKeyboard);
-  VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
-  Insert(VSB);
-
-  GetExtent(R);
-  R.Grow(-1,-1);
-  New(MsgLB, Init(R, HSB, VSB));
-
-  MsgLB^.GrowMode:=gfGrowHiX+gfGrowHiY;
-  Insert(MsgLB);
-  CompilerMessageWindow:=@self;
-end;
-
-
-procedure TCompilerMessageWindow.AddMessage(AClass: longint;const Msg, Module: string; Line, Column: longint);
-begin
-  if AClass>=V_Info then
-    Line:=0;
-  MsgLB^.AddItem(New(PCompilerMessage,Init(AClass, Msg, MsgLB^.AddModuleName(Module), Line, Column)));
-end;
-
-
-procedure TCompilerMessageWindow.ClearMessages;
-begin
-  MsgLB^.Clear;
-  ReDraw;
-end;
-
-
-{procedure TCompilerMessageWindow.Updateinfo;
-begin
-  if CompileShowed then
-   begin
-     InfoST^.SetText(
-       RExpand(' Main file : '#1#$7f+Copy(SmartPath(MainFile),1,39),40)+#2+
-         'Total lines  : '#1#$7e+IntToStr(Status.CompiledLines)+#2#13+
-       RExpand(' Target    : '#1#$7f+KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)),40)+#2+
-         'Total errors : '#1#$7e+IntToStr(Status.ErrorCount)
-     );
-     if status.currentline>0 then
-      CurrST^.SetText(' Status: '#1#$7e+status.currentsource+'('+IntToStr(status.currentline)+')'#2)
-     else
-      CurrST^.SetText(' Status: '#1#$7e+status.currentsource+#2);
-   end;
-  ReDraw;
-end;}
-
-
-procedure TCompilerMessageWindow.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-        cmListFocusChanged :
-          if Event.InfoPtr=MsgLB then
-            Message(Application,evBroadcast,cmClearLineHighlights,@Self);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-
-procedure TCompilerMessageWindow.SizeLimits(var Min, Max: TPoint);
-begin
-  inherited SizeLimits(Min,Max);
-  Min.X:=20;
-  Min.Y:=4;
-end;
-
-
-procedure TCompilerMessageWindow.Close;
-begin
-  Hide;
-end;
-
-
-function TCompilerMessageWindow.GetPalette: PPalette;
-const
-  S : string[length(CBrowserWindow)] = CBrowserWindow;
-begin
-  GetPalette:=@S;
-end;
-
-
-constructor TCompilerMessageWindow.Load(var S: TStream);
-begin
-  inherited Load(S);
-  GetSubViewPtr(S,MsgLB);
-end;
-
-
-procedure TCompilerMessageWindow.Store(var S: TStream);
-begin
-  if MsgLB^.List=nil then
-    MsgLB^.NewList(New(PCollection, Init(100,100)));
-  inherited Store(S);
-  PutSubViewPtr(S,MsgLB);
-end;
-
-procedure TCompilerMessageWindow.UpdateCommands;
-var Active: boolean;
-begin
-  Active:=GetState(sfActive);
-  SetCmdState(CompileCmds,Active);
-  Message(Application,evBroadcast,cmCommandSetChanged,nil);
-end;
-
-procedure TCompilerMessageWindow.SetState(AState: Word; Enable: Boolean);
-var OldState: word;
-begin
-  OldState:=State;
-  inherited SetState(AState,Enable);
-  if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
-    UpdateCommands;
-end;
-
-destructor TCompilerMessageWindow.Done;
-begin
-  CompilerMessageWindow:=nil;
-  inherited Done;
-end;
-
-
-{****************************************************************************
-                          CompilerStatusDialog
-****************************************************************************}
-
-constructor TCompilerStatusDialog.Init;
-var R: TRect;
-begin
-  R.Assign(0,0,50,11);
-  ClearFormatParams; AddFormatParamStr(KillTilde(SwitchesModeName[SwitchesMode]));
-  inherited Init(R, FormatStrF(dialog_compilingwithmode, FormatParams));
-  GetExtent(R); R.B.Y:=11;
-  R.Grow(-3,-2);
-  New(ST, Init(R, ''));
-  Insert(ST);
-  GetExtent(R); R.B.Y:=11;
-  R.Grow(-1,-1); R.A.Y:=R.B.Y-1;
-  New(KeyST, Init(R, '', Blue*16+White+longint($80+Blue*16+White)*256,true));
-  Insert(KeyST);
-end;
-
-
-procedure TCompilerStatusDialog.Update;
-var
-  StatusS,KeyS: string;
-begin
-{$ifdef TEMPHEAP}
-  switch_to_base_heap;
-{$endif TEMPHEAP}
-  case CompilationPhase of
-    cpCompiling :
-      begin
-        ClearFormatParams; AddFormatParamStr(SmartPath(Status.CurrentSource));
-        StatusS:=FormatStrF(msg_compilingfile,FormatParams);
-        KeyS:=msg_hint_pressesctocancel;
-      end;
-    cpLinking   :
-      begin
-        ClearFormatParams; AddFormatParamStr(ExeFile);
-        StatusS:=FormatStrF(msg_linkingfile,FormatParams);
-        KeyS:=msg_hint_pleasewait;
-      end;
-    cpDone      :
-      begin
-        StatusS:=msg_compiledone;
-        KeyS:=msg_hint_compilesuccessfulpressenter;
-      end;
-    cpFailed    :
-      begin
-        StatusS:=msg_failedtocompile;
-        KeyS:=msg_hint_compilefailed;
-      end;
-    cpAborted    :
-      begin
-        StatusS:=msg_compilationaborted;
-        KeyS:=msg_hint_compileaborted;
-      end;
-  end;
-  ClearFormatParams;
-  AddFormatParamStr(SmartPath(MainFile));
-  AddFormatParamStr(StatusS);
-  AddFormatParamStr(KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)));
-  AddFormatParamInt(Status.CurrentLine);
-  AddFormatParamInt(MemAvail div 1024);
-  AddFormatParamInt(Status.CompiledLines);
-  AddFormatParamInt(Status.ErrorCount);
-  ST^.SetText(
-   FormatStrF(
-    'Main file: %s'#13+
-    '%s'+#13#13+
-    'Target: %12s    '+     'Line number: %7d'+#13+
-    'Free memory: %6dK    '+'Total lines: %7d'+#13+
-    'Total errors: %5d',
-   FormatParams)
-  );
-  KeyST^.SetText(^C+KeyS);
-{$ifdef TEMPHEAP}
-  switch_to_temp_heap;
-{$endif TEMPHEAP}
-end;
-
-
-{****************************************************************************
-                               Compiler Hooks
-****************************************************************************}
-
-function CompilerStatus: boolean; {$ifndef FPC}far;{$endif}
-  var
-     event : tevent;
-begin
-  GetKeyEvent(Event);
-  if (Event.What=evKeyDown) and (Event.KeyCode=kbEsc) then
-    begin
-       CompilationPhase:=cpAborted;
-       { update info messages }
-       if assigned(CompilerStatusDialog) then
-        begin
-{$ifdef redircompiler}
-          RedirDisableAll;
-{$endif}
-          CompilerStatusDialog^.Update;
-{$ifdef redircompiler}
-          RedirEnableAll;
-{$endif}
-        end;
-       CompilerStatus:=true;
-       exit;
-    end;
-{ only display line info every 100 lines, ofcourse all other messages
-  will be displayed directly }
-  if (status.currentline mod 100=0) then
-   begin
-     { update info messages }
-{$ifdef redircompiler}
-          RedirDisableAll;
-{$endif}
-     if assigned(CompilerStatusDialog) then
-      CompilerStatusDialog^.Update;
-{$ifdef redircompiler}
-          RedirEnableAll;
-{$endif}
-     { update memory usage }
-     { HeapView^.Update; }
-   end;
-  CompilerStatus:=false;
-end;
-
-procedure CompilerStop; {$ifndef FPC}far;{$endif}
-begin
-{$ifndef GABOR}
-  if StopJmpValid then
-    Longjmp(StopJmp,1)
-  else
-    Halt(1);
-{$endif}
-end;
-
-Function  CompilerGetNamedFileTime(const filename : string) : Longint; {$ifndef FPC}far;{$endif}
-var t: longint;
-    W: PSourceWindow;
-begin
-  W:=EditorWindowFile(FExpand(filename));
-  if Assigned(W) and (W^.Editor^.GetModified) then
-    t:=Now
-  else
-    t:=def_getnamedfiletime(filename);
-  CompilerGetNamedFileTime:=t;
-end;
-
-function CompilerOpenInputFile(const filename: string): pinputfile; {$ifndef FPC}far;{$endif}
-var f: pinputfile;
-    W: PSourceWindow;
-begin
-  W:=EditorWindowFile(FExpand(filename));
-  if Assigned(W) and (W^.Editor^.GetModified) then
-    f:=new(PFPInputFile, Init(W^.Editor))
-  else
-    f:={$ifndef GABOR}def_openinputfile(filename){$else}nil{$endif};
-  if assigned(W) then
-    W^.Editor^.CompileStamp:=CompileStamp;
-  CompilerOpenInputFile:=f;
-end;
-
-function CompilerComment(Level:Longint; const s:string):boolean; {$ifndef FPC}far;{$endif}
-begin
-{$ifdef TEMPHEAP}
-  switch_to_base_heap;
-{$endif TEMPHEAP}
-  CompilerComment:=false;
-{$ifndef DEV}
-  if (status.verbosity and Level)=Level then
-{$endif}
-   begin
-{$ifdef redircompiler}
-     RedirDisableAll;
-{$endif}
-
-     if not CompilerMessageWindow^.GetState(sfVisible) then
-       CompilerMessageWindow^.Show;
-     if Desktop^.First<>PView(CompilerMessageWindow) then
-       CompilerMessageWindow^.MakeFirst;
-     CompilerMessageWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,
-       status.currentline,status.currentcolumn);
-     { update info messages }
-     if assigned(CompilerStatusDialog) then
-      CompilerStatusDialog^.Update;
-{$ifdef DEBUG}
- {$ifndef NODEBUG}
-     def_gdb_stop(level);
- {$endif}
-{$endif DEBUG}
-{$ifdef redircompiler}
-      RedirEnableAll;
-{$endif}
-     { update memory usage }
-     { HeapView^.Update; }
-   end;
-{$ifdef TEMPHEAP}
-  switch_to_temp_heap;
-{$endif TEMPHEAP}
-end;
-
-
-{****************************************************************************
-                                 DoCompile
-****************************************************************************}
-
-{ This function must return '' if
-  "Options|Directories|Exe and PPU directory" is empty }
-function GetExePath: string;
-var Path: string;
-    I: Sw_integer;
-begin
-  Path:='';
-  if DirectorySwitches<>nil then
-    with DirectorySwitches^ do
-    for I:=0 to ItemCount-1 do
-      begin
-        if ItemParam(I)='-FE' then
-          begin
-            Path:=GetStringItem(I);
-            Break;
-          end;
-      end;
-  if Path<>'' then
-    GetExePath:=CompleteDir(FExpand(Path))
-  else
-    GetExePath:='';
-end;
-
-function GetMainFile: string;
-var FileName: string;
-    P : PSourceWindow;
-begin
-  P:=Message(Desktop,evBroadcast,cmSearchWindow,nil);
-  if (PrimaryFileMain='') and (P=nil) then
-    FileName:='' { nothing to compile }
-  else
-    begin
-      if PrimaryFileMain<>'' then
-        FileName:=PrimaryFileMain
-      else
-        begin
-(*          if P^.Editor^.GetModified and (not P^.Editor^.Save) then
-            FileName:='*' { file not saved }
-          else*) { no longer needed - Gabor }
-            FileName:=P^.Editor^.FileName;
-        end;
-    end;
-  FileName:=FixFileName(FExpand(FileName));
-  GetMainFile:=FileName;
-end;
-
-procedure DoCompile(Mode: TCompileMode);
-
-  function IsExitEvent(E: TEvent): boolean;
-  begin
-    IsExitEvent:=(E.What=evKeyDown) and
-                 ((E.KeyCode=kbEnter) or (E.KeyCode=kbEsc)) or
-                 ((E.What=evCommand) and (E.command=cmClose));
-  end;
-
-var
-  s,FileName: string;
-  ErrFile : Text;
-  JmpRet,Error,LinkErrorCount : longint;
-  E : TEvent;
-  DummyView: PView;
-const
-  PpasFile = 'ppas';
-
-begin
-{ Get FileName }
-  FileName:=GetMainFile;
-  if FileName='' then
-    begin
-      ErrorBox(msg_nothingtocompile,nil);
-      Exit;
-    end else
-  if FileName='*' then
-    begin
-      ErrorBox(msg_cantcompileunsavedfile,nil);
-      Exit;
-    end;
-  PushStatus('Beginning compilation...');
-{ Show Compiler Messages Window }
-{  if not CompilerMessageWindow^.GetState(sfVisible) then
-   CompilerMessageWindow^.Show;
-  CompilerMessageWindow^.MakeFirst;}
-  CompilerMessageWindow^.ClearMessages;
-  { Tell why we compile }
-  NeedRecompile(true);
-
-  MainFile:=FileName;
-  SetStatus('Writing switches to file...');
-  WriteSwitches(SwitchesPath);
-  { leaving open browsers leads to crashes !! (PM) }
-  SetStatus('Preparing symbol info...');
-  CloseAllBrowsers;
-  if ((DesktopFileFlags and dfSymbolInformation)<>0) then
-    WriteSymbolsFile(BrowserName);
-{  MainFile:=FixFileName(FExpand(FileName));}
-  SetStatus('Preparing to compile...'+NameOf(MainFile));
-  If GetEXEPath<>'' then
-    EXEFile:=FixFileName(GetEXEPath+NameOf(MainFile)+ExeExt)
-  else
-    EXEFile:=DirOf(MainFile)+NameOf(MainFile)+ExeExt;
-{ Reset }
-  CtrlBreakHit:=false;
-{ Create Compiler Status Dialog }
-  CompilationPhase:=cpCompiling;
-  New(CompilerStatusDialog, Init);
-  CompilerStatusDialog^.SetState(sfModal,true);
-  Application^.Insert(CompilerStatusDialog);
-  CompilerStatusDialog^.Update;
-{ hook compiler output }
-{$ifdef TP}
-  do_status:=CompilerStatus;
-  do_stop:=CompilerStop;
-  do_comment:=CompilerComment;
-  {$ifndef GABOR}do_openinputfile:=CompilerOpenInputFile;{$endif}
-  do_getnamedfiletime:=CompilerGetNamedFileTime;
-{$else not TP}
-  do_status:=@CompilerStatus;
-  do_stop:=@CompilerStop;
-  do_comment:=@CompilerComment;
-  do_openinputfile:=@CompilerOpenInputFile;
-  do_getnamedfiletime:=@CompilerGetNamedFileTime;
-{$endif TP}
-  do_initsymbolinfo:=InitBrowserCol;
-  do_donesymbolinfo:=DoneBrowserCol;
-  do_extractsymbolinfo:=CreateBrowserCol;
-{ Compile ! }
-{$ifdef redircompiler}
-  ChangeRedirOut(FPOutFileName,false);
-  ChangeRedirError(FPErrFileName,false);
-{$endif}
-{$ifdef TEMPHEAP}
-  split_heap;
-  switch_to_temp_heap;
-{$endif TEMPHEAP}
-  { insert "" around name so that spaces are allowed }
-  { only supported in compiler after 2000/01/14 PM   }
-  if pos(' ',FileName)>0 then
-    FileName:='"'+FileName+'"';
-  if mode=cBuild then
-    FileName:='-B '+FileName;
-  { tokens are created and distroed by compiler.compile !! PM }
-  DoneTokens;
-  { it doesn't matter if ppas does not exist
-    DeleteFile will just retrun the errorcode }
-  DeleteFile(GetExePath+PpasFile+source_os.scriptext);
-  SetStatus('Compiling...');
-{$ifndef GABOR}
-  StopJmpValid:=true;
-  JmpRet:=SetJmp(StopJmp);
-  if JmpRet=0 then
-    begin
-      inc(CompileStamp);
-      FpIntF.Compile(FileName,SwitchesPath);
-      SetStatus('Finished compiling...');
-    end
-  else
-    begin
-      Inc(status.errorCount);
-{$ifdef HasSignal}
-      Case JmpRet of
-        SIGINT : s := 'Interrupted by Ctrl-C';
-        SIGILL : s := 'Illegal instruction';
-        SIGSEGV : s := 'Signal Segmentation violation';
-        SIGFPE : s:='Floating point signal';
-        else
-          s:='Undetermined signal '+inttostr(JmpRet);
-      end;
-      CompilerMessageWindow^.AddMessage(V_error,s+' during compilation','',0,0);
-{$endif HasSignal}
-      CompilerMessageWindow^.AddMessage(V_error,'Long jumped out of compilation...','',0,0);
-      SetStatus('Long jumped out of compilation...');
-    end;
-  StopJmpValid:=false;
-{$endif}
-  { tokens are created and distroed by compiler.compile !! PM }
-  InitTokens;
-  if LinkAfter and
-     ExistsFile(GetExePath+PpasFile+source_os.scriptext) and
-     (CompilationPhase<>cpAborted) and
-     (status.errorCount=0) then
-    begin
-       CompilationPhase:=cpLinking;
-       CompilerStatusDialog^.Update;
-       SetStatus('Assembling and/or linking...');
-{$ifndef redircompiler}
-       { At least here we want to catch output
-        of batch file PM }
-       ChangeRedirOut(FPOutFileName,false);
-       ChangeRedirError(FPErrFileName,false);
-{$endif}
-{$ifdef Unix}
-       Shell(GetExePath+PpasFile+source_os.scriptext);
-       Error:=LinuxError;
-{$else}
-       DosExecute(GetEnv('COMSPEC'),'/C '+GetExePath+PpasFile+source_os.scriptext);
-       Error:=DosError;
-{$endif}
-       SetStatus('Finished linking...');
-{$ifndef redircompiler}
-       RestoreRedirOut;
-       RestoreRedirError;
-{$endif}
-       if Error<>0 then
-         Inc(status.errorCount);
-       if IsExe and not ExistsFile(EXEFile) then
-         begin
-           Inc(status.errorCount);
-           ClearFormatParams; AddFormatParamStr(ExeFile);
-           CompilerMessageWindow^.AddMessage(V_error,FormatStrF(msg_couldnotcreatefile,FormatParams),'',0,0);
-         {$I-}
-           Assign(ErrFile,FPErrFileName);
-           Reset(ErrFile);
-           if EatIO<>0 then
-             ErrorBox(FormatStrStr(msg_cantopenfile,FPErrFileName),nil)
-           else
-           begin
-             LinkErrorCount:=0;
-             While not eof(ErrFile) and (LinkErrorCount<25) do
-               begin
-                 readln(ErrFile,s);
-                 CompilerMessageWindow^.AddMessage(V_error,s,'',0,0);
-                 inc(LinkErrorCount);
-               end;
-             if not eof(ErrFile) then
-             begin
-               ClearFormatParams; AddFormatParamStr(FPErrFileName);
-               CompilerMessageWindow^.AddMessage(V_error,
-                 FormatStrF(msg_therearemoreerrorsinfile,FormatParams),'',0,0);
-             end;
-
-             Close(ErrFile);
-           end;
-           EatIO;
-         {$I+}
-         end;
-    end;
-{$ifdef TEMPHEAP}
-  switch_to_base_heap;
-{$endif TEMPHEAP}
-{$ifdef redircompiler}
-  RestoreRedirOut;
-  RestoreRedirError;
-{$endif}
-  PopStatus;
-{ Set end status }
-  if CompilationPhase<>cpAborted then
-    if (status.errorCount=0) then
-      CompilationPhase:=cpDone
-    else
-      CompilationPhase:=cpFailed;
-{ Show end status }
-  CompilerStatusDialog^.Update;
-  CompilerStatusDialog^.SetState(sfModal,false);
-  if ((CompilationPhase in[cpAborted,cpDone,cpFailed]) or (ShowStatusOnError)) and (Mode<>cRun) then
-   repeat
-     CompilerStatusDialog^.GetEvent(E);
-     if IsExitEvent(E)=false then
-      CompilerStatusDialog^.HandleEvent(E);
-   until IsExitEvent(E);
-  Application^.Delete(CompilerStatusDialog);
-  Dispose(CompilerStatusDialog, Done);
-  CompilerStatusDialog:=nil;
-{ end compilation returns true if the messagewindow should be removed }
-  if CompilationPhase=cpDone then
-   begin
-     CompilerMessageWindow^.Hide;
-     { This is the last compiled main file }
-     PrevMainFile:=MainFile;
-     MainHasDebugInfo:=DebugInfoSwitches^.GetCurrSelParam<>'-';
-   end;
-{ Update the app }
-  Message(Application,evCommand,cmUpdate,nil);
-{$ifdef TEMPHEAP}
-  releasetempheap;
-  unsplit_heap;
-{$endif TEMPHEAP}
-  DummyView:=Desktop^.First;
-  while (DummyView<>nil) and (DummyView^.GetState(sfVisible)=false) do
-  begin
-    DummyView:=DummyView^.NextView;
-  end;
-  with DummyView^ do
-   if GetState(sfVisible) then
-    begin
-      SetState(sfSelected,false);
-      SetState(sfSelected,true);
-    end;
-  if Assigned(CompilerMessageWindow) then
-    with CompilerMessageWindow^ do
-      begin
-        if GetState(sfVisible) then
-          begin
-            SetState(sfSelected,false);
-            SetState(sfSelected,true);
-          end;
-        if (status.errorCount>0) then
-          MsgLB^.SelectFirstError;
-      end;
-  { ^^^ we need this trick to reactivate the desktop }
-  EditorModified:=false;
-  { Try to read Browser info in again if compilation failure !! }
-  if Not Assigned(Modules) and (CompilationPhase<>cpDone) and
-     ((DesktopFileFlags and dfSymbolInformation)<>0) then
-    ReadSymbolsFile(BrowserName);
-end;
-
-function NeedRecompile(verbose : boolean): boolean;
-var Need: boolean;
-    I: sw_integer;
-    SF: PSourceFile;
-    SourceTime,PPUTime,ObjTime: longint;
-    W: PSourceWindow;
-begin
-  if Assigned(SourceFiles)=false then
-     Need:={(EditorModified=true)}true
-  else
-    begin
-      Need:=(PrevMainFile<>GetMainFile) and (PrevMainFile<>'');
-      if Need then
-        begin
-          if verbose then
-          begin
-            ClearFormatParams; AddFormatParamStr(GetMainFile);
-            CompilerMessageWindow^.AddMessage(V_info,
-              FormatStrF(msg_firstcompilationof,FormatParams),
-              '',0,0);
-          end;
-        end
-      else
-        for I:=0 to SourceFiles^.Count-1 do
-          begin
-            SF:=SourceFiles^.At(I);
-            SourceTime:=GetFileTime(SF^.GetSourceFileName);
-            PPUTime:=GetFileTime(SF^.GetPPUFileName);
-            ObjTime:=GetFileTime(SF^.GetObjFileName);
-{            writeln('S: ',SF^.GetSourceFileName,' - ',SourceTime);
-            writeln('P: ',SF^.GetPPUFileName,' - ',PPUTime);
-            writeln('O: ',SF^.GetObjFileName,' - ',ObjTime);
-            writeln('------');}
-            { some units don't generate object files }
-            W:=EditorWindowFile(SF^.GetSourceFileName);
-            if (SourceTime<>-1) then
-              if ((SourceTime>PPUTime) or
-                 ((SourceTime>ObjTime) and
-                 (ObjTime<>-1))) or
-                 (assigned(W) and (W^.Editor^.CompileStamp<0)) then
-                begin
-                  Need:=true;
-                  if verbose then
-                  begin
-                    ClearFormatParams; AddFormatParamStr(SF^.GetSourceFileName);
-                    CompilerMessageWindow^.AddMessage(V_info,
-                      FormatStrF(msg_recompilingbecauseof,FormatParams),
-                      SF^.GetSourceFileName,1,1);
-                  end;
-                  Break;
-                end;
-          end;
-{      writeln('Need?', Need); system.readln;}
-    end;
-
-  NeedRecompile:=Need;
-end;
-
-constructor TFPInputFile.Init(AEditor: PFileEditor);
-begin
-  if not Assigned(AEditor) then Fail;
-  if inherited Init(AEditor^.FileName)=false then
-    Fail;
-  Editor:=AEditor;
-end;
-
-function TFPInputFile.fileopen(const filename: string): boolean;
-var OK: boolean;
-begin
-  S:=New(PMemoryStream, Init(0,0));
-  OK:=Assigned(S) and (S^.Status=stOK);
-  if OK then OK:=Editor^.SaveToStream(S);
-  if OK then
-    S^.Seek(0)
-  else
-    begin
-      if Assigned(S) then Dispose(S, Done);
-      S:=nil;
-    end;
-  fileopen:=OK;
-end;
-
-function TFPInputFile.fileseek(pos: longint): boolean;
-var OK: boolean;
-begin
-  OK:=assigned(S);
-  if OK then
-  begin
-    S^.Reset;
-    S^.Seek(pos);
-    OK:=(S^.Status=stOK);
-  end;
-  fileseek:=OK;
-end;
-
-function TFPInputFile.fileread(var databuf; maxsize: longint): longint;
-var
-    size: longint;
-begin
-  if not assigned(S) then size:=0 else
-  begin
-    size:=min(maxsize,(S^.GetSize-S^.GetPos));
-    S^.Read(databuf,size);
-    if S^.Status<>stOK then size:=0;
-  end;
-  fileread:=size;
-end;
-
-function TFPInputFile.fileeof: boolean;
-var EOF: boolean;
-begin
-  EOF:=not assigned(S);
-  if not EOF then
-    EOF:=(S^.Status<>stOK) or (S^.GetPos=S^.GetSize);
-  fileeof:=EOF;
-end;
-
-function TFPInputFile.fileclose: boolean;
-var OK: boolean;
-begin
-  OK:=assigned(S);
-  if OK then
-  begin
-    S^.Reset;
-    Dispose(S, Done);
-    OK:=true;
-  end;
-  fileclose:=OK;
-end;
-
-procedure RegisterFPCompile;
-begin
-{$ifndef NOOBJREG}
-  RegisterType(RCompilerMessageListBox);
-  RegisterType(RCompilerMessageWindow);
-{$endif}
-end;
-
-
-end.
-{
-  $Log$
-  Revision 1.7  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.11  2000/11/14 17:40:02  pierre
-   * fix the linking problem in another directory
-
-  Revision 1.1.2.10  2000/11/14 09:23:55  marco
-   * Second batch
-
-  Revision 1.6  2000/11/13 17:37:41  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.9  2000/11/06 16:55:48  pierre
-   * fix failure to recompile when file changed
-
-  Revision 1.5  2000/10/31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.8  2000/10/31 07:51:58  pierre
-   * recover gracefully if compiler generates a signal
-
-  Revision 1.1.2.7  2000/10/18 21:53:26  pierre
-   * several Gabor fixes
-
-  Revision 1.1.2.6  2000/10/09 16:28:24  pierre
-   * several linux enhancements
-
-  Revision 1.4  2000/10/04 15:01:11  pierre
-   * fix IsExe problem
-
-  Revision 1.1.2.5  2000/10/03 16:15:57  pierre
-   * Use LongJmp in CompilerStop
-
-  Revision 1.3  2000/09/01 21:33:25  peter
-    * files to finput
-
-  Revision 1.2  2000/08/22 09:41:39  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.4  2000/08/16 18:46:14  peter
-   [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
-   [*] Make, Build now possible even in Compiler Messages Window
-   [+] when started in a new dir the IDE now ask whether to create a local
-       config, or to use the one located in the IDE dir
-
-  Revision 1.1.2.3  2000/08/15 03:40:53  peter
-   [*] no more fatal exits when the IDE can't find the error file (containing
-       the redirected assembler/linker output) after compilation
-   [*] hidden windows are now added always at the end of the Window List
-   [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
-   [*] selection was incorrectly adjusted when typing in overwrite mode
-   [*] the line wasn't expanded when it's end was reached in overw. mode
-   [*] the IDE now tries to locate source files also in the user specified
-       unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
-   [*] 'Open at cursor' is now aware of the extension (if specified)
-
-  Revision 1.1.2.2  2000/08/10 07:10:37  michael
-  * 'Auto save editor files' option did the opposite than expected, due
-    to a typo in FPIDE.PAS
-  + saving of source files before compilation is no longer neccessary.
-    When a modified editor file is involved in the compilation, then the
-    IDE saves it's contents to a memory stream and passes this to the
-    compiler (instead of the file on the disk)
-
-  Revision 1.1.2.1  2000/07/18 05:50:22  michael
-  + Merged Gabors fixes
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.60  2000/06/22 09:07:11  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.59  2000/06/16 08:50:40  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.58  2000/05/29 10:44:56  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.57  2000/05/02 08:42:27  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.56  2000/04/25 08:42:32  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.55  2000/04/18 11:42:36  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.54  2000/03/23 22:23:21  pierre
-   + Use PushStatus in ParseUserScreen
-
-  Revision 1.53  2000/03/21 23:33:18  pierre
-   adapted to wcedit addition by Gabor
-
-  Revision 1.52  2000/03/08 16:48:07  pierre
-   + Read BackTrace from UseScreen
-
-  Revision 1.51  2000/03/07 21:54:26  pierre
-   + ParseUserScreen
-
-  Revision 1.50  2000/02/06 23:41:42  pierre
-   +  TCompilerMessageListBox.SelectFirstError
-
-  Revision 1.49  2000/01/25 00:26:35  pierre
-   + Browser info saving
-
-  Revision 1.48  2000/01/14 15:38:28  pierre
-    + support for long filenames with spaces for compilation
-    * avoid too long linker error output
-
-  Revision 1.47  2000/01/03 11:38:33  michael
-  Changes from Gabor
-
-  Revision 1.46  1999/12/01 17:08:19  pierre
-   * GetFileTime moved to wutils unit
-
-  Revision 1.45  1999/11/22 15:58:40  pierre
-   * fix for web bug 633
-
-  Revision 1.44  1999/11/21 01:44:34  pierre
-   + Use def_gdb_stop for easy GDB debugging
-
-  Revision 1.43  1999/11/18 13:49:56  pierre
-   + use IsExe var to know if we need to call ppas
-
-  Revision 1.42  1999/11/10 17:20:41  pierre
-   * Use fpredir.dosexecute
-
-  Revision 1.41  1999/10/25 16:34:19  pierre
-    * some units have no object files
-      led to wrong NeedRecompile result
-
-  Revision 1.40  1999/09/20 15:36:38  pierre
-   * adapted to new tokens unit
-
-  Revision 1.39  1999/09/16 14:34:57  pierre
-    + TBreakpoint and TWatch registering
-    + WatchesCollection and BreakpointsCollection stored in desk file
-    * Syntax highlighting was broken
-
-  Revision 1.38  1999/09/13 16:24:43  peter
-    + clock
-    * backspace unident like tp7
-
-  Revision 1.37  1999/09/09 14:19:16  pierre
-   * status should not be present in TCompilerMessage.GetText
-
-  Revision 1.36  1999/09/07 11:32:13  pierre
-    * fix for Linux ./ prepended to ppas.sh
-    * Build add '-B' option
-    * if linkAfter is set, get errors from linker
-      by redirecting files
-
-  Revision 1.35  1999/08/22 22:27:30  pierre
-   * not ppas call on compile failure
-
-  Revision 1.34  1999/08/16 18:25:13  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.33  1999/08/03 20:22:26  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.32  1999/07/12 13:14:13  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.31  1999/06/28 19:32:17  peter
-    * fixes from gabor
-
-  Revision 1.30  1999/06/28 15:59:04  pierre
-   * View Linking stage if external linking
-
-  Revision 1.29  1999/06/28 12:39:14  pierre
-   + close all browsers before compiling
-
-  Revision 1.28  1999/06/21 23:42:16  pierre
-   + LinkAfter and Esc to abort support added
-
-  Revision 1.27  1999/05/22 13:44:29  peter
-    * fixed couple of bugs
-
-  Revision 1.26  1999/05/02 14:29:35  peter
-    * fixed typo disableredir -> redirdisable
-
-  Revision 1.25  1999/04/29 22:58:09  pierre
-   + disabling of redirction in compiler dialogs
-
-  Revision 1.24  1999/04/29 09:36:11  peter
-    * fixed hotkeys with Compiler switches
-    * fixed compiler status dialog
-    * Run shows again the output
-
-  Revision 1.23  1999/04/07 21:55:43  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.22  1999/04/01 10:27:07  pierre
-   + file(line) in start of message added
-
-  Revision 1.21  1999/04/01 10:15:17  pierre
-    * CurrSt,InfoSt and LineSt were not disposed correctly in done
-    * TComiplerMessage destructor first calls SetCompileShow(false)
-      to get proper cleaning up
-
-  Revision 1.20  1999/03/23 16:16:38  peter
-    * linux fixes
-
-  Revision 1.19  1999/03/19 16:04:27  peter
-    * new compiler dialog
-
-  Revision 1.18  1999/03/16 12:38:07  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-  Revision 1.17  1999/03/12 01:13:56  peter
-    * flag if trytoopen should look for other extensions
-    + browser tab in the tools-compiler
-
-  Revision 1.16  1999/03/07 23:00:47  pierre
-   * Fix for path of executable
-
-  Revision 1.15  1999/03/01 15:41:50  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.14  1999/02/22 12:46:56  peter
-    * small fixes for linux and grep
-
-  Revision 1.13  1999/02/22 11:51:33  peter
-    * browser updates from gabor
-
-  Revision 1.12  1999/02/22 11:29:36  pierre
-    + added col info in MessageItem
-    + grep uses HighLightExts and should work for linux
-
-  Revision 1.11  1999/02/08 09:31:00  florian
-    + some split heap stuff, in $ifdef TEMPHEAP
-
-  Revision 1.10  1999/02/05 13:51:39  peter
-    * unit name of FPSwitches -> FPSwitch which is easier to use
-    * some fixes for tp7 compiling
-
-  Revision 1.9  1999/02/05 13:06:28  pierre
-   * allow cmClose for Compilation Dialog box
-
-  Revision 1.8  1999/02/04 13:32:01  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.7  1999/01/21 11:54:11  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.6  1999/01/15 16:12:43  peter
-    * fixed crash after compile
-
-  Revision 1.5  1999/01/14 21:42:19  peter
-    * source tracking from Gabor
-
-  Revision 1.4  1999/01/12 14:29:32  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.3  1999/01/04 11:49:42  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.2  1998/12/28 15:47:42  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.3  1998/12/22 10:39:40  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 672
ide/text/fpconst.pas

@@ -1,672 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Constants used by the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit FPConst;
-
-interface
-
-uses Views,App,Commands,
-     WViews,WEditor;
-
-const
-     VersionStr           = '0.9.1';
-
-     MaxRecentFileCount   = 5;
-     MaxToolCount         = 16;
-
-     ReservedWordMaxLen   = 16;
-
-     CompilerStatusUpdateDelay = 0.8; { in secs }
-
-     ININame              = 'fp.ini';
-     DirInfoName          = 'fp.dir';
-     SwitchesName         = 'fp.cfg';
-     DesktopName          = 'fp.dsk';
-     BrowserName          = 'fp.brw';
-     BackgroundName       = 'fp.ans';
-     ReadmeName           = 'readme.ide';
-
-     ToolCaptureName      = '__tool__.out'; { all '$' signs replaces with '_'s }
-     FilterCaptureName    = '_filter_.out';
-     FPOutFileName        = 'fp___.out';
-     FPErrFileName        = 'fp___.err';
-     GDBOutFileName       = 'gdb___.out';
-     GDBOutPutFileName    = 'gdb___.txt';
-     GDBPrompt            = 'gdb>';
-     DesktopTempName      = 'fp___.dsk';
-     GrepOutName          = 'grep$$.out';
-     GrepErrName          = 'grep$$.err';
-
-     HTMLIndexExt         = '.htx';
-     HTMLExt              = '.htm';
-     TemplateExt          = '.pt';
-     NGExt                = '.ng';
-     INFExt               = '.inf';
-     WinHelpExt           = '.hlp';
-     HelpFileExts         = '*.tph;*.htm*;*'+HTMLIndexExt+';*'+NGExt+';*'+WinHelpExt+';*'+INFExt;
-
-     EnterSign            = #17#196#217;
-
-     { Main menu submenu indexes }
-     menuFile             = 0;
-     menuTools            = 6;
-
-     { MouseAction constants }
-     acNone               = 0;
-     acTopicSearch        = 1;
-     acGotoCursor         = 2;
-     acBreakpoint         = 3;
-     acEvaluate           = 4;
-     acAddWatch           = 5;
-     acBrowseSymbol       = 6;
-     acFirstAction        = acTopicSearch;
-     acLastAction         = acBrowseSymbol;
-
-     { Startup Option constants }
-     soReturnToLastDir    = $00000001;
-     soHeapMonitor        = $00000002;
-
-     { Desktop Flag constants - what to include in the desktop file }
-     dfHistoryLists       = $00000001;
-     dfClipboardContent   = $00000002;
-     dfWatches            = $00000004;
-     dfBreakpoints        = $00000008;
-     dfOpenWindows        = $00000010;
-     dfSymbolInformation  = $00000020;
-     dfCodeCompleteWords  = $00000040;
-     dfCodeTemplates      = $00000080;
-
-     { Auto Save flag constants }
-     asEditorFiles        = $00000001; { Editor files }
-     asEnvironment        = $00000002; { .INI file }
-     asDesktop            = $00000004; { .DSK file }
-
-     { Misc. Options flag constants }
-     moAutoTrackSource    = $00000001;
-     moCloseOnGotoSource  = $00000002;
-     moChangeDirOnOpen    = $00000004;
-
-     { Desktop Location constants }
-     dlCurrentDir         = $00;
-     dlConfigFileDir      = $01;
-
-     { History ids }
-     hidRunParameters     = 200;
-     hidOpenSourceFile    = 201;
-     hidPrimaryFile       = 202;
-     hidOpenIniFile       = 203;
-     hidSaveIniFile       = hidOpenIniFile;
-     hidOpenHelpFile      = 204;
-     hidConditionalDefines= 205;
-     hidCompilerArgs      = 206;
-
-     { Command constants }
-     cmShowClipboard     = 201;
-     cmFindProcedure     = 206;
-     cmObjects           = 207;
-     cmModules           = 208;
-     cmGlobals           = 209;
-     cmRun               = 210;
-     cmParameters        = 211;
-     cmCompile           = 212;
-     cmMake              = 213;
-     cmBuild             = 214;
-     cmTarget            = 215;
-     cmPrimaryFile       = 216;
-     cmClearPrimary      = 217;
-     cmInformation       = 218;
-{     cmWindowList        = 219; defined in command.pas, too! - Gabor }
-     cmHelpTopicSearch   = 220;
-     cmMsgGotoSource     = 221;
-     cmMsgTrackSource    = 222;
-     cmGotoCursor        = 223;
-     {cmToggleBreakpoint  = 224; never disabled =>2403 }
-     cmAddWatch          = 225;
-     cmTraceInto         = 226;
-     cmStepOver          = 227;
-     cmResetDebugger     = 228;
-     cmContToCursor      = 229;
-     cmOpenGDBWindow     = 230;
-     cmToolsMsgNext      = 231;
-     cmToolsMsgPrev      = 232;
-     cmGrep              = 233;
-     cmCompilerMessages  = 234;
-     cmSymbol            = 235;
-     cmStack             = 236;
-     cmBreakpointList    = 237;
-     cmWatches           = 238;
-     cmUntilReturn       = 239;
-     { WARNING these two are also defined in weditor.pas PM }
-     { and why aren't these defines then removed? Gabor }
-     cmCopyWin           = 240;
-     cmPasteWin          = 241;
-     cmRegisters         = 242;
-
-     cmNotImplemented    = 1000;
-     cmNewFromTemplate   = 1001;
-     cmShowReadme        = 1002;
-
-     cmSearchWindow      = 1500;
-     cmSourceWndClosing  = 1601;
-     cmCalculatorPaste   = 1603;
-     cmMsgClear          = 1604;
-     cmUpdateTools       = 1605;
-{     cmGrep              = 160?;}
-
-     cmAddItem           = 1620;
-     cmEditItem          = 1621;
-     cmDeleteItem        = 1622;
-     cmShowItem          = 1623;
-     cmHideItem          = 1624;
-
-     cmUserScreen        = 1650;
-     cmUserScreenWindow  = 1651;
-     cmEvaluate          = 1652;
-     cmCalculator        = 1653;
-     cmASCIITable        = 1654;
-
-     cmToolsMessages     = 1700;
-     cmToolsBase         = 1800;
-     cmRecentFileBase    = 1850;
-
-     cmCompiler          = 2000;
-     cmMemorySizes       = 2001;
-     cmLinker            = 2002;
-     cmDebugger          = 2003;
-     cmDirectories       = 2004;
-     cmTools             = 2005;
-     cmPreferences       = 2006;
-     cmEditor            = 2007;
-     cmMouse             = 2008;
-     cmStartup           = 2009;
-     cmColors            = 2010;
-     cmOpenINI           = 2011;
-     cmSaveINI           = 2012;
-     cmSaveAsINI         = 2013;
-     cmSwitchesMode      = 2014;
-     cmBrowser           = 2015;
-     cmDesktopOptions    = 2016;
-     cmCodeCompleteOptions=2017;
-     cmCodeTemplateOptions=2018;
-
-     cmHelpContents      = 2100;
-     cmHelpIndex         = 2101;
-     cmHelpPrevTopic     = 2103;
-     cmHelpUsingHelp     = 2104;
-     cmHelpFiles         = 2105;
-     cmAbout             = 2106;
-
-     cmEditorOptions     = 2202;
-     cmBrowserOptions    = 2203;
-
-     cmTrackReference    = 2300;
-     cmGotoReference     = 2301;
-
-     cmEditBreakpoint    = 2400;
-     cmNewBreakpoint     = 2401;
-     cmDeleteBreakpoint  = 2402;
-     cmToggleBreakpoint  = 2403;
-
-     cmDumpUndo          = 2500;
-     cmUndoAll           = 2501;
-     cmRedoAll           = 2502;
-
-     cmDebuggerStopped   = 2600;
-
-     cmSymBrowse         = 2700;
-     cmSymGotoSource     = 2701;
-     cmSymTrackSource    = 2702;
-     cmSymOptions        = 2703;
-
-     { Help constants }
-     hcSourceWindow      = 8000;
-     hcHelpWindow        = 8001;
-     hcClipboardWindow   = 8002;
-     hcCalcWindow        = 8003;
-     hcInfoWindow        = 8004;
-     hcBrowserWindow     = 8005;
-     hcMessagesWindow    = 8006;
-     hcGDBWindow         = 8007;
-     hcBreakpointListWindow = 8008;
-     hcASCIITableWindow  = 8009;
-
-     hcShift             = 10000;
-
-     hcUsingHelp         = 2;
-     hcContents          = 3;
-     hcQuit              = hcShift+cmQuit;
-     hcRedo              = hcShift+cmRedo;
-     hcFind              = hcShift+cmFind;
-     hcReplace           = hcShift+cmReplace;
-     hcSearchAgain       = hcShift+cmSearchAgain;
-     hcGotoLine          = hcShift+cmJumpLine;
-
-     hcUserScreen        = hcShift+cmUserScreen;
-     hcUserScreenWindow  = hcShift+cmUserScreenWindow;
-
-     hcToolsMessages     = hcShift+cmToolsMessages;
-     hcToolsBase         = hcShift+cmToolsBase;
-     hcRecentFileBase    = hcShift+cmRecentFileBase;
-
-     hcCompiler          = hcShift+cmCompiler;
-     hcMemorySizes       = hcShift+cmMemorySizes;
-     hcLinker            = hcShift+cmLinker;
-     hcDebugger          = hcShift+cmDebugger;
-     hcDirectories       = hcShift+cmDirectories;
-     hcTools             = hcShift+cmTools;
-     hcPreferences       = hcShift+cmPreferences;
-     hcEditor            = hcShift+cmEditor;
-     hcMouse             = hcShift+cmMouse;
-     hcStartup           = hcShift+cmStartup;
-     hcColors            = hcShift+cmColors;
-     hcOpenINI           = hcShift+cmOpenINI;
-     hcSaveINI           = hcShift+cmSaveINI;
-     hcSaveAsINI         = hcShift+cmSaveAsINI;
-     hcCalculator        = hcShift+cmCalculator;
-     hcAsciiTable        = hcShift+cmAsciiTable;
-{     hcGrep              = hcShift+cmGrep;}
-     hcSwitchesMode      = hcShift+cmSwitchesMode;
-     hcBrowser           = hcShift+cmBrowser;
-     hcDesktopOptions    = hcShift+cmDesktopOptions;
-     hcCodeCompleteOptions=hcShift+cmCodeCompleteOptions;
-     hcCodeTemplateOptions=hcShift+cmCodeTemplateOptions;
-     hcAbout             = hcShift+cmAbout;
-     hcCompilerMessages  = hcShift+cmCompilerMessages;
-
-     hcSystemMenu        = 9000;
-     hcFileMenu          = 9001;
-     hcEditMenu          = 9002;
-     hcSearchMenu        = 9003;
-     hcRunMenu           = 9004;
-     hcCompileMenu       = 9005;
-     hcDebugMenu         = 9006;
-     hcToolsMenu         = 9007;
-     hcOptionsMenu       = 9008;
-     hcEnvironmentMenu   = 9009;
-     hcWindowMenu        = 9010;
-     hcHelpMenu          = 9011;
-
-     hcFirstCommand      = hcSystemMenu;
-     hcLastCommand       = 65535;
-
-     hcShowClipboard     = hcShift+cmShowClipboard;
-     hcCopyWin           = hcShift+cmCopyWin;
-     hcPasteWin          = hcShift+cmPasteWin;
-
-     hcFindProcedure     = hcShift+cmFindProcedure;
-     hcObjects           = hcShift+cmObjects;
-     hcModules           = hcShift+cmModules;
-     hcGlobals           = hcShift+cmGlobals;
-     hcSymbol            = hcShift+cmSymbol;
-     hcRun               = hcShift+cmRun;
-     hcParameters        = hcShift+cmParameters;
-     hcResetDebugger     = hcShift+cmResetDebugger;
-     hcContToCursor      = hcShift+cmContToCursor;
-     hcUntilReturn       = hcShift+cmUntilReturn;
-     hcOpenGDBWindow     = hcShift+cmOpenGDBWindow;
-     hcToolsMsgNext      = hcShift+cmToolsMsgNext;
-     hcToolsMsgPrev      = hcShift+cmToolsMsgPrev;
-     hcCompile           = hcShift+cmCompile;
-     hcMake              = hcShift+cmMake;
-     hcBuild             = hcShift+cmBuild;
-     hcTarget            = hcShift+cmTarget;
-     hcPrimaryFile       = hcShift+cmPrimaryFile;
-     hcClearPrimary      = hcShift+cmClearPrimary;
-     hcInformation       = hcShift+cmInformation;
-     hcWindowList        = hcShift+cmWindowList;
-     hcNewFromTemplate   = hcShift+cmNewFromTemplate;
-     hcHelpTopicSearch   = hcShift+cmHelpTopicSearch;
-     hcHelpContents      = hcShift+cmHelpContents;
-     hcHelpIndex         = hcShift+cmHelpIndex;
-     hcHelpPrevTopic     = hcShift+cmHelpPrevTopic;
-     hcHelpUsingHelp     = hcShift+cmHelpUsingHelp;
-     hcHelpFiles         = hcShift+cmHelpFiles;
-     hcUpdate            = hcShift+cmUpdate;
-     hcMsgClear          = hcShift+cmMsgClear;
-     hcMsgGotoSource     = hcShift+cmMsgGotoSource;
-     hcMsgTrackSource    = hcShift+cmMsgTrackSource;
-     hcSymBrowse         = hcShift+cmSymBrowse;
-     hcSymGotoSource     = hcShift+cmSymGotoSource;
-     hcSymTrackSource    = hcShift+cmSymTrackSource;
-     hcSymOptions        = hcShift+cmSymOptions;
-     hcGotoCursor        = hcShift+cmGotoCursor;
-     hcNewBreakpoint     = hcShift+cmNewBreakpoint;
-     hcEditBreakpoint    = hcShift+cmEditBreakpoint;
-     hcDeleteBreakpoint  = hcShift+cmDeleteBreakpoint;
-     hcToggleBreakpoint  = hcShift+cmToggleBreakpoint;
-     hcEvaluate          = hcShift+cmEvaluate;
-     hcAddWatch          = hcShift+cmAddWatch;
-     hcWatches           = hcShift+cmWatches;
-     hcGrep              = hcShift+cmGrep;
-     hcStack             = hcShift+cmStack;
-     hcBreakPointList    = hcShift+cmBreakpointList;
-     hcRegisters         = hcShift+cmRegisters;
-
-     hcOpenAtCursor      = hcShift+cmOpenAtCursor;
-     hcBrowseAtCursor    = hcShift+cmBrowseAtCursor;
-     hcEditorOptions     = hcShift+cmEditorOptions;
-     hcBrowserOptions    = hcShift+cmBrowserOptions;
-
-     { History constants }
-     hisChDirDialog      = 2000;
-
-     CIDEHelpDialog      =
-        #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;
-
-     CSourceWindow =
-        #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 ;
-
-     CBrowserWindow =
-        #215#216#217#218#219#220#221#222#223#224#225#226;
-
-     CBrowserListBox =
-        #9#9#10#11#12;
-
-     CBrowserTab =
-        #6#12;
-
-     CBrowserOutline = #9#10#10#11;
-
-     CGDBInputLine   = #9#9#10#11#12;
-
-     CFPClockView = #0#227;
-
-     CFPToolTip     = #228;
-
-     CFPMemo        = #26#26#26#28#26#29#26#26#26#27#26#26#26#26#26#26#26;
-
-     CFPSymbolMemo  = #9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9;
-
-     CHTMLSectionAttrs = #229#230#231#232#233#234;
-
-     CIDEAppColor = CAppColor +
-         { CIDEHelpDialog }
-{128-143}#$70#$7F#$7A#$13#$13#$70#$70#$7F#$7E#$20#$2B#$2F#$78#$2E#$70#$30 + { 1-16}
-{144-159}#$3F#$3E#$1F#$2F#$1A#$20#$72#$31#$31#$30#$2F#$3E#$31#$13#$38#$00 + {17-32}
-{160-163}#$30#$3E#$1E#$70 + { CHelpViewer }                                 {33-36}
-{164-166}#$30#$3F#$3A +     { CHelpFrame }                                  {37-39}
-         { CSourceWindow }
-{167-182}#$17#$1F#$1A#$31#$31#$1E#$71#$1F#$00#$00#$00#$00#$00#$00#$00#$00 + { 1-16}
-{183-198}#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00 + {17-32}
-{199-214}#$1E#$1F#$17#$1F#$1E#$1B#$13#$1A#$1E#$71#$3F#$30#$1C#$13#$1F#$4E + {33-48}
-         { CBrowserWindow }
-{215-226}#$31#$3F#$3A#$31#$31#$31#$71#$1F#$31#$2F#$3E#$3F +
-         { CFPClockView }
-{227-227}#$70 +
-         { CToolTip }
-{228-228}#$20 +
-         { CHTMLSectionAttrs }
-{229-234}#$ff#$3a#$37#$ff#$ff#$ff;
-
-implementation
-
-END.
-{
-  $Log$
-  Revision 1.3  2000-10-31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.5  2000/10/26 00:04:35  pierre
-   + gdb prompt and FPC_BREAK_ERROR stop
-
-  Revision 1.1.2.4  2000/10/18 21:53:26  pierre
-   * several Gabor fixes
-
-  Revision 1.1.2.3  2000/09/18 13:20:54  pierre
-   New bunch of Gabor changes
-
-  Revision 1.2  2000/08/22 09:41:39  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.2  2000/08/16 18:46:14  peter
-   [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
-   [*] Make, Build now possible even in Compiler Messages Window
-   [+] when started in a new dir the IDE now ask whether to create a local
-       config, or to use the one located in the IDE dir
-
-  Revision 1.1.2.1  2000/07/15 20:54:42  pierre
-   * Version increased to 0.9.1
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.42  2000/06/26 07:29:22  pierre
-   * new bunch of Gabor's changes
-
-  Revision 1.41  2000/06/22 09:07:11  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.40  2000/06/16 08:50:40  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.39  2000/05/30 07:18:33  pierre
-   + colors for HTML help by Gabor
-
-  Revision 1.38  2000/05/02 08:42:27  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.37  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.36  2000/04/18 11:42:36  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.35  2000/03/14 14:16:13  pierre
-   + cmDebuggerStopped
-
-  Revision 1.34  2000/02/07 11:51:40  pierre
-   + TFPCodeMemo consts from Gabor
-
-  Revision 1.33  2000/01/25 00:26:36  pierre
-   + Browser info saving
-
-  Revision 1.32  2000/01/08 18:26:20  florian
-    + added a register window, doesn't work yet
-
-  Revision 1.31  2000/01/03 11:38:33  michael
-  Changes from Gabor
-
-  Revision 1.30  1999/11/03 09:39:23  peter
-    * fixed uppercase filenames
-    * savetostream did twice a -1 on the linecount, so the lastline of a
-      file wasn't saved correctly
-
-  Revision 1.29  1999/10/27 12:10:42  pierre
-    + With DebugUndo added 3 menu items
-      "Dump Undo" "Undo All" and "Redo All"
-      for Undo checks
-
-  Revision 1.28  1999/10/14 10:23:44  pierre
-   ClockView Black on Gray by default
-
-  Revision 1.27  1999/09/13 16:24:43  peter
-    + clock
-    * backspace unident like tp7
-
-  Revision 1.26  1999/09/09 16:31:45  pierre
-   * some breakpoint related fixes and Help contexts
-
-  Revision 1.25  1999/09/09 14:15:27  pierre
-   + cmCopyWin,cmPasteWin
-
-  Revision 1.24  1999/08/16 18:25:14  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.23  1999/08/03 20:22:27  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.22  1999/07/12 13:14:14  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.21  1999/07/10 01:24:13  pierre
-   + First implementation of watches window
-
-  Revision 1.20  1999/06/30 23:58:11  pierre
-    + BreakpointsList Window implemented
-      with Edit/New/Delete functions
-    + Individual breakpoint dialog with support for all types
-      ignorecount and conditions
-      (commands are not yet implemented, don't know if this wolud be useful)
-      awatch and rwatch have problems because GDB does not annotate them
-      I fixed v4.16 for this
-
-  Revision 1.19  1999/06/28 19:32:18  peter
-    * fixes from gabor
-
-  Revision 1.18  1999/06/25 00:38:59  pierre
-   +cmSymbol,cmStack,cmBreakpointList
-
-  Revision 1.17  1999/04/07 21:55:44  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.16  1999/03/23 15:11:27  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.15  1999/03/19 16:04:28  peter
-    * new compiler dialog
-
-  Revision 1.14  1999/03/16 12:38:08  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-  Revision 1.13  1999/03/01 15:41:51  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.12  1999/02/22 11:51:34  peter
-    * browser updates from gabor
-
-  Revision 1.11  1999/02/20 15:18:28  peter
-    + ctrl-c capture with confirm dialog
-    + ascii table in the tools menu
-    + heapviewer
-    * empty file fixed
-    * fixed callback routines in fpdebug to have far for tp7
-
-  Revision 1.10  1999/02/11 19:07:19  pierre
-    * GDBWindow redesigned :
-      normal editor apart from
-      that any kbEnter will send the line (for begin to cursor)
-      to GDB command !
-      GDBWindow opened in Debugger Menu
-       still buggy :
-       -echo should not be present if at end of text
-       -GDBWindow becomes First after each step (I don't know why !)
-
-  Revision 1.9  1999/02/08 17:40:00  pierre
-   + cmContToCursor added
-
-  Revision 1.8  1999/02/04 12:23:43  pierre
-    + cmResetDebugger and cmGrep
-    * Avoid StatusStack overflow
-
-  Revision 1.7  1999/01/22 10:24:02  peter
-    * first debugger things
-
-  Revision 1.6  1999/01/21 11:54:12  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.5  1999/01/12 14:29:33  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.4  1999/01/04 11:49:43  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.2  1998/12/28 15:47:43  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.3  1998/12/22 10:39:41  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 3718
ide/text/fpdebug.pas

@@ -1,3718 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998-2000 by Pierre Muller
-
-    Debugger call routines for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit FPDebug;
-interface
-
-uses
-  Objects,Dialogs,Drivers,Views,
-  GDBCon,GDBInt,Menus,
-  WViews,
-  FPViews;
-
-type
-  PDebugController=^TDebugController;
-  TDebugController=object(TGDBController)
-     InvalidSourceLine : boolean;
-
-     { if true the current debugger raw will stay in middle of
-       editor window when debugging PM }
-     CenterDebuggerRow : boolean;
-     LastFileName : string;
-     LastSource   : PView; {PsourceWindow !! }
-     HiddenStepsCount : longint;
-     { no need to switch if using another terminal }
-     NoSwitch : boolean;
-     RunCount : longint;
-     FPCBreakErrorNumber : longint;
-    constructor Init(const exefn:string);
-    destructor  Done;
-    procedure DoSelectSourceline(const fn:string;line:longint);virtual;
-{    procedure DoStartSession;virtual;
-    procedure DoBreakSession;virtual;}
-    procedure DoEndSession(code:longint);virtual;
-    procedure AnnotateError;
-    procedure InsertBreakpoints;
-    procedure RemoveBreakpoints;
-    procedure ReadWatches;
-    procedure ResetBreakpointsValues;
-    procedure DoDebuggerScreen;virtual;
-    procedure DoUserScreen;virtual;
-    procedure Reset;virtual;
-    procedure ResetDebuggerRows;
-    procedure Run;virtual;
-    procedure Continue;virtual;
-    procedure UntilReturn;virtual;
-    procedure CommandBegin(const s:string);virtual;
-    procedure CommandEnd(const s:string);virtual;
-    function  IsRunning : boolean;
-    function  AllowQuit : boolean;virtual;
-    function  GetValue(Const expr : string) : pchar;
-  end;
-
-  BreakpointType = (bt_function,bt_file_line,bt_watch,bt_awatch,bt_rwatch,bt_invalid);
-  BreakpointState = (bs_enabled,bs_disabled,bs_deleted);
-
-  PBreakpointCollection=^TBreakpointCollection;
-
-  PBreakpoint=^TBreakpoint;
-  TBreakpoint=object(TObject)
-     typ  : BreakpointType;
-     state : BreakpointState;
-     owner : PBreakpointCollection;
-     Name : PString;  { either function name or expr to watch }
-     FileName : PString;
-     OldValue,CurrentValue : Pstring;
-     Line : Longint; { only used for bt_file_line type }
-     Conditions : PString; { conditions relative to that breakpoint }
-     IgnoreCount : Longint; { how many counts should be ignored }
-     Commands : pchar; { commands that should be executed on breakpoint }
-     GDBIndex : longint;
-     GDBState : BreakpointState;
-     constructor Init_function(Const AFunc : String);
-     constructor Init_Empty;
-     constructor Init_file_line(AFile : String; ALine : longint);
-     constructor Init_type(atyp : BreakpointType;Const AnExpr : String);
-     constructor Load(var S: TStream);
-     procedure   Store(var S: TStream);
-     procedure  Insert;
-     procedure  Remove;
-     procedure  Enable;
-     procedure  Disable;
-     procedure  UpdateSource;
-     procedure  ResetValues;
-     destructor Done;virtual;
-  end;
-
-  TBreakpointCollection=object(TCollection)
-      function  At(Index: Integer): PBreakpoint;
-      function  GetGDB(index : longint) : PBreakpoint;
-      function  GetType(typ : BreakpointType;Const s : String) : PBreakpoint;
-      function  ToggleFileLine(FileName: String;LineNr : Longint) : boolean;
-      procedure Update;
-      procedure ShowBreakpoints(W : PSourceWindow);
-      procedure ShowAllBreakpoints;
-    end;
-
-    PBreakpointItem = ^TBreakpointItem;
-    TBreakpointItem = object(TObject)
-      Breakpoint : PBreakpoint;
-      constructor Init(ABreakpoint : PBreakpoint);
-      function    GetText(MaxLen: Sw_integer): string; virtual;
-      procedure   Selected; virtual;
-      function    GetModuleName: string; virtual;
-    end;
-
-    PBreakpointsListBox = ^TBreakpointsListBox;
-    TBreakpointsListBox = object(THSListBox)
-      Transparent : boolean;
-      NoSelection : boolean;
-      MaxWidth    : Sw_integer;
-      (* ModuleNames : PStoreCollection; *)
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-      procedure   AddBreakpoint(P: PBreakpointItem); virtual;
-      function    GetText(Item,MaxLen: Sw_Integer): String; virtual;
-      function    GetLocalMenu: PMenu;virtual;
-      procedure   Clear; virtual;
-      procedure   TrackSource; virtual;
-      procedure   EditNew; virtual;
-      procedure   EditCurrent; virtual;
-      procedure   DeleteCurrent; virtual;
-      procedure   ToggleCurrent;
-      procedure   Draw; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      destructor  Done; virtual;
-    end;
-
-    PBreakpointsWindow = ^TBreakpointsWindow;
-    TBreakpointsWindow = object(TDlgWindow)
-      BreakLB : PBreakpointsListBox;
-      constructor Init;
-      procedure   AddBreakpoint(ABreakpoint : PBreakpoint);
-      procedure   ClearBreakpoints;
-      procedure   ReloadBreakpoints;
-      procedure   Close; virtual;
-      procedure   SizeLimits(var Min, Max: TPoint);virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   Update; virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      destructor  Done; virtual;
-    end;
-
-    PBreakpointItemDialog = ^TBreakpointItemDialog;
-
-    TBreakpointItemDialog = object(TCenterDialog)
-      constructor Init(ABreakpoint: PBreakpoint);
-      function    Execute: Word; virtual;
-    private
-      Breakpoint : PBreakpoint;
-      TypeRB   : PRadioButtons;
-      NameIL  : PInputLine;
-      ConditionsIL: PInputLine;
-      LineIL    : PInputLine;
-      IgnoreIL  : PInputLine;
-    end;
-
-    PWatch = ^TWatch;
-    TWatch =  Object(TObject)
-      constructor Init(s : string);
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure rename(s : string);
-      procedure Get_new_value;
-      destructor done;virtual;
-    private
-      expr : pstring;
-      last_value,current_value : pchar;
-    end;
-
-    PWatchesCollection = ^TWatchesCollection;
-    TWatchesCollection = Object(TCollection)
-      constructor Init;
-      procedure Insert(Item: Pointer); virtual;
-      function  At(Index: Integer): PWatch;
-      procedure Update;
-    private
-      MaxW : integer;
-    end;
-
-    PWatchesListBox = ^TWatchesListBox;
-    TWatchesListBox = object(THSListBox)
-      Transparent : boolean;
-      MaxWidth    : Sw_integer;
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-      (* procedure   AddWatch(P: PWatch); virtual; *)
-      procedure   Update(AMaxWidth : integer);
-      function    GetIndentedText(Item,Indent,MaxLen: Sw_Integer): String; virtual;
-      function    GetLocalMenu: PMenu;virtual;
-      (* procedure   Clear; virtual;
-      procedure   TrackSource; virtual;*)
-      procedure   EditNew; virtual;
-      procedure   EditCurrent; virtual;
-      procedure   DeleteCurrent; virtual;
-      (*procedure   ToggleCurrent; *)
-      procedure   Draw; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      destructor  Done; virtual;
-    end;
-
-    PWatchItemDialog = ^TWatchItemDialog;
-
-    TWatchItemDialog = object(TCenterDialog)
-      constructor Init(AWatch: PWatch);
-      function    Execute: Word; virtual;
-    private
-      Watch : PWatch;
-      NameIL  : PInputLine;
-      TextST : PAdvancedStaticText;
-    end;
-
-    PWatchesWindow = ^TWatchesWindow;
-    TWatchesWindow = Object(TDlgWindow)
-      WLB : PWatchesListBox;
-      Constructor Init;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   Update; virtual;
-      destructor  Done; virtual;
-    end;
-
-    PFramesListBox = ^TFramesListBox;
-    TFramesListBox = object(TMessageListBox)
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-      procedure   Update;
-      function    GetLocalMenu: PMenu;virtual;
-      procedure   GotoSource; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      destructor  Done; virtual;
-    end;
-
-    PStackWindow = ^TStackWindow;
-    TStackWindow = Object(TDlgWindow)
-      FLB : PFramesListBox;
-      Constructor Init;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   Update; virtual;
-      destructor  Done; virtual;
-    end;
-
-    {$ifdef TP} dword = longint; {$endif}
-
-    TIntRegs = record
-       eax,ebx,ecx,edx,eip,esi,edi,esp,ebp : dword;
-       cs,ds,es,ss,fs,gs : word;
-       eflags : dword;
-    end;
-
-    PRegistersView = ^TRegistersView;
-    TRegistersView = object(TView)
-      OldReg : TIntRegs;
-      constructor Init(var Bounds: TRect);
-      procedure   Draw;virtual;
-      destructor  Done; virtual;
-    end;
-
-    PRegistersWindow = ^TRegistersWindow;
-    TRegistersWindow = Object(TDlgWindow)
-      RV : PRegistersView;
-      Constructor Init;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   Update; virtual;
-      destructor  Done; virtual;
-    end;
-
-    TFPURegs = record
-    end;
-
-    PFPUView = ^TFPUView;
-    TFPUView = object(TView)
-      OldReg : TFPURegs;
-      constructor Init(var Bounds: TRect);
-      procedure   Draw;virtual;
-      destructor  Done; virtual;
-    end;
-
-    PFPUWindow = ^TFPUWindow;
-    TFPUWindow = Object(TDlgWindow)
-      RV : PFPUView;
-      Constructor Init;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   Update; virtual;
-      destructor  Done; virtual;
-    end;
-
-const
-  StackWindow : PStackWindow = nil;
-  RegistersWindow : PRegistersWindow = nil;
-  FPUWindow : PFPUWindow = nil;
-
-  procedure InitStackWindow;
-  procedure DoneStackWindow;
-
-  procedure InitRegistersWindow;
-  procedure DoneRegistersWindow;
-  function  ActiveBreakpoints : boolean;
-  function  GDBFileName(st : string) : string;
-
-
-const
-     BreakpointTypeStr : Array[BreakpointType] of String[9]
-       = ( 'function','file-line','watch','awatch','rwatch','invalid' );
-     BreakpointStateStr : Array[BreakpointState] of String[8]
-       = ( 'enabled','disabled','invalid' );
-
-     DebuggeeTTY : string = '';
-var
-  Debugger             : PDebugController;
-  BreakpointsCollection : PBreakpointCollection;
-  WatchesCollection    : PwatchesCollection;
-
-procedure InitDebugger;
-procedure DoneDebugger;
-procedure InitGDBWindow;
-procedure DoneGDBWindow;
-procedure InitBreakpoints;
-procedure DoneBreakpoints;
-procedure InitWatches;
-procedure DoneWatches;
-
-procedure RegisterFPDebugViews;
-
-procedure UpdateDebugViews;
-
-implementation
-
-uses
-  Dos,Video,
-  App,Commands,Strings,
-{$ifdef win32}
-  Windebug,
-{$endif win32}
-{$ifdef Unix}
-  Linux,FileCtrl,
-{$endif Unix}
-  Systems,
-  FPString,FPVars,FPUtils,FPConst,FPSwitch,
-  FPIntf,FPCompil,FPIde,FPHelp,
-  Validate,WEditor,WUtils;
-
-const
-  RBreakpointsWindow: TStreamRec = (
-     ObjType: 1701;
-     VmtLink: Ofs(TypeOf(TBreakpointsWindow)^);
-     Load:    @TBreakpointsWindow.Load;
-     Store:   @TBreakpointsWindow.Store
-  );
-
-  RBreakpointsListBox : TStreamRec = (
-     ObjType: 1702;
-     VmtLink: Ofs(TypeOf(TBreakpointsListBox)^);
-     Load:    @TBreakpointsListBox.Load;
-     Store:   @TBreakpointsListBox.Store
-  );
-
-  RWatchesWindow: TStreamRec = (
-     ObjType: 1703;
-     VmtLink: Ofs(TypeOf(TWatchesWindow)^);
-     Load:    @TWatchesWindow.Load;
-     Store:   @TWatchesWindow.Store
-  );
-
-  RWatchesListBox: TStreamRec = (
-     ObjType: 1704;
-     VmtLink: Ofs(TypeOf(TWatchesListBox)^);
-     Load:    @TWatchesListBox.Load;
-     Store:   @TWatchesListBox.Store
-  );
-
-  RStackWindow: TStreamRec = (
-     ObjType: 1705;
-     VmtLink: Ofs(TypeOf(TStackWindow)^);
-     Load:    @TStackWindow.Load;
-     Store:   @TStackWindow.Store
-  );
-
-  RFramesListBox: TStreamRec = (
-     ObjType: 1706;
-     VmtLink: Ofs(TypeOf(TFramesListBox)^);
-     Load:    @TFramesListBox.Load;
-     Store:   @TFramesListBox.Store
-  );
-
-  RBreakpoint: TStreamRec = (
-     ObjType: 1707;
-     VmtLink: Ofs(TypeOf(TBreakpoint)^);
-     Load:    @TBreakpoint.Load;
-     Store:   @TBreakpoint.Store
-  );
-
-  RWatch: TStreamRec = (
-     ObjType: 1708;
-     VmtLink: Ofs(TypeOf(TWatch)^);
-     Load:    @TWatch.Load;
-     Store:   @TWatch.Store
-  );
-
-  RBreakpointCollection: TStreamRec = (
-     ObjType: 1709;
-     VmtLink: Ofs(TypeOf(TBreakpointCollection)^);
-     Load:    @TBreakpointCollection.Load;
-     Store:   @TBreakpointCollection.Store
-  );
-
-  RWatchesCollection: TStreamRec = (
-     ObjType: 1710;
-     VmtLink: Ofs(TypeOf(TWatchesCollection)^);
-     Load:    @TWatchesCollection.Load;
-     Store:   @TWatchesCollection.Store
-  );
-
-  RRegistersWindow: TStreamRec = (
-     ObjType: 1711;
-     VmtLink: Ofs(TypeOf(TRegistersWindow)^);
-     Load:    @TRegistersWindow.Load;
-     Store:   @TRegistersWindow.Store
-  );
-
-  RRegistersView: TStreamRec = (
-     ObjType: 1712;
-     VmtLink: Ofs(TypeOf(TRegistersView)^);
-     Load:    @TRegistersView.Load;
-     Store:   @TRegistersView.Store
-  );
-
-  RFPUWindow: TStreamRec = (
-     ObjType: 1713;
-     VmtLink: Ofs(TypeOf(TFPUWindow)^);
-     Load:    @TFPUWindow.Load;
-     Store:   @TFPUWindow.Store
-  );
-
-  RFPUView: TStreamRec = (
-     ObjType: 1714;
-     VmtLink: Ofs(TypeOf(TFPUView)^);
-     Load:    @TFPUView.Load;
-     Store:   @TFPUView.Store
-  );
-
-{$ifdef TP}
-function HexStr(Value: longint; Len: byte): string;
-begin
-  HexStr:=IntToHex(Value,Len);
-end;
-{$endif}
-
-function  GDBFileName(st : string) : string;
-{$ifndef Unix}
-var i : longint;
-{$endif Unix}
-begin
-{$ifdef Unix}
-  GDBFileName:=st;
-{$else}
-{ should we also use / chars ? }
-  for i:=1 to Length(st) do
-    if st[i]='\' then
-      st[i]:='/';
-{$ifdef win32}
-{ for win32 we should convert e:\ into //e/ PM }
-  if (length(st)>2) and (st[2]=':') and (st[3]='/') then
-    st:='//'+st[1]+copy(st,3,length(st));
-{$endif win32}
-{$ifdef go32v2}
-{ for go32v2 we should convert //e/ back into e:/  PM }
-  if (length(st)>3) and (st[1]='/') and (st[2]='/') and (st[4]='/') then
-    st:=st[3]+':/'+copy(st,5,length(st));
-{$endif go32v2}
-  GDBFileName:=LowerCaseStr(st);
-{$endif}
-end;
-
-{****************************************************************************
-                            TDebugController
-****************************************************************************}
-
-procedure UpdateDebugViews;
-
-  begin
-     DeskTop^.Lock;
-     If assigned(StackWindow) then
-       StackWindow^.Update;
-     If assigned(RegistersWindow) then
-       RegistersWindow^.Update;
-     If assigned(Debugger) then
-       Debugger^.ReadWatches;
-     If assigned(FPUWindow) then
-       FPUWindow^.Update;
-     DeskTop^.UnLock;
-  end;
-
-constructor TDebugController.Init(const exefn:string);
-  var f: string;
-begin
-  inherited Init;
-  CenterDebuggerRow:=IniCenterDebuggerRow;
-  f := GetShortName(GDBFileName(exefn));
-  NoSwitch:=False;
-  LoadFile(f);
-  SetArgs(GetRunParameters);
-  Debugger:=@self;
-  Command('b FPC_BREAK_ERROR');
-  FPCBreakErrorNumber:=stop_breakpoint_number;
-{$ifndef GABOR}
-  switch_to_user:=true;
-{$endif}
-  InsertBreakpoints;
-  ReadWatches;
-end;
-
-procedure TDebugController.InsertBreakpoints;
-  procedure DoInsert(PB : PBreakpoint);
-  begin
-    PB^.Insert;
-  end;
-
-begin
-  BreakpointsCollection^.ForEach(@DoInsert);
-end;
-
-procedure TDebugController.ReadWatches;
-
-  procedure DoRead(PB : PWatch);
-  begin
-    PB^.Get_new_value;
-  end;
-
-begin
-  WatchesCollection^.ForEach(@DoRead);
-  If Assigned(WatchesWindow) then
-    WatchesWindow^.Update;
-end;
-
-
-procedure TDebugController.RemoveBreakpoints;
-  procedure DoDelete(PB : PBreakpoint);
-    begin
-      PB^.Remove;
-    end;
-begin
-   BreakpointsCollection^.ForEach(@DoDelete);
-end;
-
-procedure TDebugController.ResetBreakpointsValues;
-  procedure DoResetVal(PB : PBreakpoint);
-    begin
-      PB^.ResetValues;
-    end;
-begin
-   BreakpointsCollection^.ForEach(@DoResetVal);
-end;
-
-function  ActiveBreakpoints : boolean;
-  var
-    IsActive : boolean;
-
-  procedure TestActive(PB : PBreakpoint);
-    begin
-        If PB^.state=bs_enabled then
-          IsActive:=true;
-    end;
-begin
-   IsActive:=false;
-   If assigned(BreakpointsCollection) then
-     BreakpointsCollection^.ForEach(@TestActive);
-   ActiveBreakpoints:=IsActive;
-end;
-
-
-destructor TDebugController.Done;
-begin
-  { kill the program if running }
-  Reset;
-  RemoveBreakpoints;
-  inherited Done;
-end;
-
-procedure TDebugController.Run;
-begin
-  ResetBreakpointsValues;
-{$ifdef win32}
-  { Run the debugge in another console }
-  if DebuggeeTTY<>'' then
-    Command('set new-console on')
-  else
-    Command('set new-console off');
-  NoSwitch:=DebuggeeTTY<>'';
-{$endif win32}
-{$ifdef Unix}
-  { Run the debuggee in another tty }
-  if DebuggeeTTY <> '' then
-    begin
-      Command('tty '+DebuggeeTTY);
-      NoSwitch:= true;
-    end
-  else
-    begin
-      Command('tty '+TTYName(stdin));
-      NoSwitch := false;
-    end;
-{$endif Unix}
-  { Switch to user screen to get correct handles }
-  UserScreen;
-  inherited Run;
-  DebuggerScreen;
-  IDEApp.SetCmdState([cmResetDebugger,cmUntilReturn],true);
-  UpdateDebugViews;
-end;
-
-
-function TDebugController.IsRunning : boolean;
-begin
-  IsRunning:=debuggee_started;
-end;
-
-procedure TDebugController.Continue;
-begin
-{$ifdef NODEBUG}
-  NoDebugger;
-{$else}
-  if not debuggee_started then
-    Run
-  else
-    inherited Continue;
-  UpdateDebugViews;
-{$endif NODEBUG}
-end;
-
-procedure TDebugController.UntilReturn;
-begin
-  Command('finish');
-  UpdateDebugViews;
-  { We could try to get the return value !
-    Not done yet }
-end;
-
-
-procedure TDebugController.CommandBegin(const s:string);
-begin
-  if assigned(GDBWindow) and (in_command>1) then
-    begin
-      { We should do something special for errors !! }
-      If StrLen(GetError)>0 then
-        GDBWindow^.WriteErrorText(GetError);
-      GDBWindow^.WriteOutputText(GetOutput);
-    end;
-  if assigned(GDBWindow) then
-    GDBWindow^.WriteString(S);
-end;
-
-procedure TDebugController.CommandEnd(const s:string);
-begin
-  if assigned(GDBWindow) and (in_command=0) then
-    begin
-      { We should do something special for errors !! }
-      If StrLen(GetError)>0 then
-        GDBWindow^.WriteErrorText(GetError);
-      GDBWindow^.WriteOutputText(GetOutput);
-      GDBWindow^.Editor^.TextEnd;
-    end;
-end;
-
-function  TDebugController.AllowQuit : boolean;
-begin
-  if ConfirmBox('Really quit editor?',nil,true)=cmOK then
-    begin
-      Message(@IDEApp,evCommand,cmQuit,nil);
-    end
-  else
-    AllowQuit:=false;
-end;
-
-procedure TDebugController.ResetDebuggerRows;
-  procedure ResetDebuggerRow(P: PView); {$ifndef FPC}far;{$endif}
-  begin
-    if assigned(P) and
-       (TypeOf(P^)=TypeOf(TSourceWindow)) then
-       PSourceWindow(P)^.Editor^.SetLineFlagExclusive(lfDebuggerRow,-1);
-  end;
-
-begin
-  Desktop^.ForEach(@ResetDebuggerRow);
-end;
-
-procedure TDebugController.Reset;
-begin
-  inherited Reset;
-  NoSwitch:=false;
-  IDEApp.SetCmdState([cmResetDebugger,cmUntilReturn],false);
-  ResetDebuggerRows;
-end;
-
-procedure TDebugController.AnnotateError;
-var errornb : longint;
-begin
-  if error then
-    begin
-       errornb:=error_num;
-       UpdateDebugViews;
-       ErrorBox(#3'Error within GDB'#13#3'Error code = %d',@errornb);
-    end;
-end;
-
-function TDebugController.GetValue(Const expr : string) : pchar;
-var
-  p,p2,p3 : pchar;
-begin
-  Command('p '+expr);
-  p:=GetOutput;
-  p3:=nil;
-  if assigned(p) and (p[strlen(p)-1]=#10) then
-   begin
-     p3:=p+strlen(p)-1;
-     p3^:=#0;
-   end;
-  if assigned(p) then
-    p2:=strpos(p,'=')
-  else
-    p2:=nil;
-  if assigned(p2) then
-    p:=p2+1;
-  while p^ in [' ',TAB] do
-    inc(p);
-  { get rid of type }
-  if p^ = '(' then
-    p:=strpos(p,')')+1;
-  while p^ in [' ',TAB] do
-    inc(p);
-  if assigned(p) then
-    GetValue:=StrNew(p)
-  else
-    GetValue:=StrNew(GetError);
-  if assigned(p3) then
-    p3^:=#10;
-  got_error:=false;
-end;
-
-procedure TDebugController.DoSelectSourceLine(const fn:string;line:longint);
-var
-  W: PSourceWindow;
-  Found : boolean;
-  PB : PBreakpoint;
-  S : String;
-  BreakIndex : longint;
-begin
-  BreakIndex:=stop_breakpoint_number;
-  Desktop^.Lock;
-  { 0 based line count in Editor }
-  if Line>0 then
-    dec(Line);
-  if (fn=LastFileName) then
-    begin
-      W:=PSourceWindow(LastSource);
-      if assigned(W) then
-        begin
-          W^.Editor^.SetCurPtr(0,Line);
-          W^.Editor^.TrackCursor(CenterDebuggerRow);
-          W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,Line);
-          UpdateDebugViews;
-
-          {if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
-            handled by SelectInDebugSession}
-          W^.SelectInDebugSession;
-          InvalidSourceLine:=false;
-        end
-      else
-        InvalidSourceLine:=true;
-    end
-  else
-    begin
-      if fn='' then
-        W:=nil
-      else
-        W:=TryToOpenFile(nil,fn,0,Line,false);
-      if assigned(W) then
-        begin
-          W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,Line);
-          W^.Editor^.TrackCursor(CenterDebuggerRow);
-          UpdateDebugViews;
-          {if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
-            handled by SelectInDebugSession}
-          W^.SelectInDebugSession;
-          LastSource:=W;
-          InvalidSourceLine:=false;
-        end
-        { only search a file once }
-      else
-       begin
-         Desktop^.UnLock;
-         if fn='' then
-           Found:=false
-         else
-         { it is easier to handle with a * at the end }
-           Found:=IDEApp.OpenSearch(fn+'*');
-         Desktop^.Lock;
-         if not Found then
-           begin
-             InvalidSourceLine:=true;
-             LastSource:=Nil;
-             { Show the stack in that case }
-             InitStackWindow;
-             UpdateDebugViews;
-             StackWindow^.MakeFirst;
-           end
-         else
-           begin
-             { should now be open }
-              W:=TryToOpenFile(nil,fn,0,Line,true);
-              W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,Line);
-              W^.Editor^.TrackCursor(CenterDebuggerRow);
-              UpdateDebugViews;
-              {if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
-                handled by SelectInDebugSession}
-              W^.SelectInDebugSession;
-              LastSource:=W;
-              InvalidSourceLine:=false;
-           end;
-       end;
-    end;
-  LastFileName:=fn;
-  Desktop^.UnLock;
-  if BreakIndex>0 then
-    begin
-      PB:=BreakpointsCollection^.GetGDB(BreakIndex);
-      if (BreakIndex=FPCBreakErrorNumber) then
-        begin
-          { Procedure HandleErrorAddrFrame
-             (Errno : longint;addr,frame : longint);
-             [public,alias:'FPC_BREAK_ERROR']; }
-          {
-          Error:=GetLongintFrom(GetFramePointer+OffsetFirstArg);
-          Addr:=GetPointerFrom(GetFramePointer+OffsetSecondArg);}
-          WarningBox(#3'Run Time Error',nil);
-        end
-      { For watch we should get old and new value !! }
-      else if (Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive)) and
-         (PB^.typ<>bt_file_line) and (PB^.typ<>bt_function) then
-        begin
-           Command('p '+GetStr(PB^.Name));
-           S:=GetPChar(GetOutput);
-           got_error:=false;
-           If Pos('=',S)>0 then
-             S:=Copy(S,Pos('=',S)+1,255);
-           If S[Length(S)]=#10 then
-             Delete(S,Length(S),1);
-           if Assigned(PB^.OldValue) then
-             DisposeStr(PB^.OldValue);
-           PB^.OldValue:=PB^.CurrentValue;
-           PB^.CurrentValue:=NewStr(S);
-           If PB^.typ=bt_function then
-             WarningBox(#3'GDB stopped due to'#13+
-               #3+BreakpointTypeStr[PB^.typ]+' '+GetStr(PB^.Name),nil)
-           else if (GetStr(PB^.OldValue)<>S) then
-             WarningBox(#3'GDB stopped due to'#13+
-               #3+BreakpointTypeStr[PB^.typ]+' '+GetStr(PB^.Name)+#13+
-               #3+'Old value = '+GetStr(PB^.OldValue)+#13+
-               #3+'New value = '+GetStr(PB^.CurrentValue),nil)
-           else
-             WarningBox(#3'GDB stopped due to'#13+
-               #3+BreakpointTypeStr[PB^.typ]+' '+GetStr(PB^.Name)+#13+
-               #3+' value = '+GetStr(PB^.CurrentValue),nil);
-        end;
-    end;
-end;
-
-procedure TDebugController.DoEndSession(code:longint);
-var P :Array[1..2] of longint;
-begin
-   IDEApp.SetCmdState([cmResetDebugger],false);
-   ResetDebuggerRows;
-   LastExitCode:=Code;
-   If HiddenStepsCount=0 then
-     InformationBox(msg_programexitedwithexitcode,@code)
-   else
-     begin
-        P[1]:=code;
-        P[2]:=HiddenStepsCount;
-        WarningBox(msg_programexitedwithcodeandsteps,@P);
-     end;
-end;
-
-
-procedure TDebugController.DoDebuggerScreen;
-begin
-  if NoSwitch then
-    begin
-      PopStatus;
-    end
-  else
-    begin
-      IDEApp.ShowIDEScreen;
-      Message(Application,evBroadcast,cmDebuggerStopped,pointer(RunCount));
-      PopStatus;
-    end;
-{$ifdef win32}
-   ChangeDebuggeeWindowTitleTo(Stopped_State);
-{$endif win32}
-end;
-
-
-procedure TDebugController.DoUserScreen;
-begin
-  Inc(RunCount);
-  if NoSwitch then
-    begin
-{$ifdef Unix}
-      PushStatus(msg_runninginanotherwindow+DebuggeeTTY);
-{$else not Unix}
-      PushStatus(msg_runninginanotherwindow);
-{$endif Unix}
-    end
-  else
-    begin
-      PushStatus(msg_runningprogram);
-      IDEApp.ShowUserScreen;
-    end;
-{$ifdef win32}
-   ChangeDebuggeeWindowTitleTo(Running_State);
-{$endif win32}
-end;
-
-{****************************************************************************
-                                 TBreakpoint
-****************************************************************************}
-
-constructor TBreakpoint.Init_function(Const AFunc : String);
-begin
-  typ:=bt_function;
-  state:=bs_enabled;
-  GDBState:=bs_deleted;
-  Name:=NewStr(AFunc);
-  FileName:=nil;
-  Line:=0;
-  IgnoreCount:=0;
-  Commands:=nil;
-  Conditions:=nil;
-  OldValue:=nil;
-  CurrentValue:=nil;
-end;
-
-constructor TBreakpoint.Init_Empty;
-begin
-  typ:=bt_function;
-  state:=bs_enabled;
-  GDBState:=bs_deleted;
-  Name:=Nil;
-  FileName:=nil;
-  Line:=0;
-  IgnoreCount:=0;
-  Commands:=nil;
-  Conditions:=nil;
-  OldValue:=nil;
-  CurrentValue:=nil;
-end;
-
-constructor TBreakpoint.Init_type(atyp : BreakpointType;Const AnExpr : String);
-begin
-  typ:=atyp;
-  state:=bs_enabled;
-  GDBState:=bs_deleted;
-  Name:=NewStr(AnExpr);
-  IgnoreCount:=0;
-  Commands:=nil;
-  Conditions:=nil;
-  OldValue:=nil;
-  CurrentValue:=nil;
-end;
-
-constructor TBreakpoint.Init_file_line(AFile : String; ALine : longint);
-begin
-  typ:=bt_file_line;
-  state:=bs_enabled;
-  GDBState:=bs_deleted;
-  { d:test.pas:12 does not work !! }
-  { I do not know how to solve this if
-  if (Length(AFile)>1) and (AFile[2]=':') then
-    AFile:=Copy(AFile,3,255);        }
-  FileName:=NewStr(GDBFileName(AFile));
-  Name:=nil;
-  Line:=ALine;
-  IgnoreCount:=0;
-  Commands:=nil;
-  Conditions:=nil;
-  OldValue:=nil;
-  CurrentValue:=nil;
-end;
-
-constructor TBreakpoint.Load(var S: TStream);
-var
-  FName : PString;
-begin
-  S.Read(typ,SizeOf(BreakpointType));
-  S.Read(state,SizeOf(BreakpointState));
-  GDBState:=bs_deleted;
-  case typ of
-    bt_file_line :
-      begin
-        { convert to current target }
-        FName:=S.ReadStr;
-        FileName:=NewStr(GDBFileName(GetStr(FName)));
-        If Assigned(FName) then
-          DisposeStr(FName);
-        S.Read(Line,SizeOf(Line));
-        Name:=nil;
-      end;
-  else
-    begin
-        Name:=S.ReadStr;
-        Line:=0;
-        FileName:=nil;
-    end;
-  end;
-  S.Read(IgnoreCount,SizeOf(IgnoreCount));
-  Commands:=S.StrRead;
-  Conditions:=S.ReadStr;
-  OldValue:=nil;
-  CurrentValue:=nil;
-end;
-
-procedure TBreakpoint.Store(var S: TStream);
-begin
-  S.Write(typ,SizeOf(BreakpointType));
-  S.Write(state,SizeOf(BreakpointState));
-  case typ of
-    bt_file_line :
-      begin
-        S.WriteStr(FileName);
-        S.Write(Line,SizeOf(Line));
-      end;
-  else
-    begin
-        S.WriteStr(Name);
-    end;
-  end;
-  S.Write(IgnoreCount,SizeOf(IgnoreCount));
-  S.StrWrite(Commands);
-  S.WriteStr(Conditions);
-end;
-
-procedure TBreakpoint.Insert;
-begin
-  If not assigned(Debugger) then Exit;
-  Remove;
-  Debugger^.last_breakpoint_number:=0;
-  if (GDBState=bs_deleted) and (state=bs_enabled) then
-    begin
-      if (typ=bt_file_line) and assigned(FileName) then
-        Debugger^.Command('break '+NameAndExtOf(FileName^)+':'+IntToStr(Line))
-      else if (typ=bt_function) and assigned(name) then
-        Debugger^.Command('break '+name^)
-      else if (typ=bt_watch) and assigned(name) then
-        Debugger^.Command('watch '+name^)
-      else if (typ=bt_awatch) and assigned(name) then
-        Debugger^.Command('awatch '+name^)
-      else if (typ=bt_rwatch) and assigned(name) then
-        Debugger^.Command('rwatch '+name^);
-      if Debugger^.last_breakpoint_number<>0 then
-        begin
-          GDBIndex:=Debugger^.last_breakpoint_number;
-          GDBState:=bs_enabled;
-          Debugger^.Command('cond '+IntToStr(GDBIndex)+' '+GetStr(Conditions));
-          If IgnoreCount>0 then
-            Debugger^.Command('ignore '+IntToStr(GDBIndex)+' '+IntToStr(IgnoreCount));
-          If Assigned(Commands) then
-            begin
-              {Commands are not handled yet }
-            end;
-        end
-      else
-      { Here there was a problem !! }
-        begin
-          GDBIndex:=0;
-          if (typ=bt_file_line) and assigned(FileName) then
-            begin
-              ClearFormatParams;
-              AddFormatParamStr(NameAndExtOf(FileName^));
-              AddFormatParamInt(Line);
-              ErrorBox(msg_couldnotsetbreakpointat,@FormatParams);
-            end
-          else
-            begin
-              ClearFormatParams;
-              AddFormatParamStr(BreakpointTypeStr[typ]);
-              AddFormatParamStr(GetStr(Name));
-              ErrorBox(msg_couldnotsetbreakpointtype,@FormatParams);
-            end;
-          state:=bs_disabled;
-        end;
-    end
-  else if (GDBState=bs_disabled) and (state=bs_enabled) then
-    Enable
-  else if (GDBState=bs_enabled) and (state=bs_disabled) then
-    Disable;
-end;
-
-procedure TBreakpoint.Remove;
-begin
-  If not assigned(Debugger) then Exit;
-  if GDBIndex>0 then
-    Debugger^.Command('delete '+IntToStr(GDBIndex));
-  GDBIndex:=0;
-  GDBState:=bs_deleted;
-end;
-
-procedure TBreakpoint.Enable;
-begin
-  If not assigned(Debugger) then Exit;
-  if GDBIndex>0 then
-    Debugger^.Command('enable '+IntToStr(GDBIndex))
-  else
-    Insert;
-  GDBState:=bs_enabled;
-end;
-
-procedure TBreakpoint.Disable;
-begin
-  If not assigned(Debugger) then Exit;
-  if GDBIndex>0 then
-    Debugger^.Command('disable '+IntToStr(GDBIndex));
-  GDBState:=bs_disabled;
-end;
-
-procedure TBreakpoint.ResetValues;
-begin
-  if assigned(OldValue) then
-    DisposeStr(OldValue);
-  OldValue:=nil;
-  if assigned(CurrentValue) then
-    DisposeStr(CurrentValue);
-  CurrentValue:=nil;
-end;
-
-procedure  TBreakpoint.UpdateSource;
-var W: PSourceWindow;
-    b : boolean;
-begin
-  if typ=bt_file_line then
-    begin
-      W:=SearchOnDesktop(GetStr(FileName),false);
-      If assigned(W) then
-        begin
-          if state=bs_enabled then
-            b:=true
-          else
-            b:=false;
-          W^.Editor^.SetLineFlagState(Line-1,lfBreakpoint,b);
-        end;
-    end;
-end;
-
-destructor TBreakpoint.Done;
-begin
-  Remove;
-  ResetValues;
-  if assigned(Name) then
-    DisposeStr(Name);
-  if assigned(FileName) then
-    DisposeStr(FileName);
-  if assigned(Conditions) then
-    DisposeStr(Conditions);
-  if assigned(Commands) then
-    StrDispose(Commands);
-  inherited Done;
-end;
-
-{****************************************************************************
-                        TBreakpointCollection
-****************************************************************************}
-
-function TBreakpointCollection.At(Index: Integer): PBreakpoint;
-begin
-  At:=inherited At(Index);
-end;
-
-procedure TBreakpointCollection.Update;
-begin
-  if assigned(Debugger) then
-    begin
-      Debugger^.RemoveBreakpoints;
-      Debugger^.InsertBreakpoints;
-    end;
-  if assigned(BreakpointsWindow) then
-    BreakpointsWindow^.Update;
-end;
-
-function  TBreakpointCollection.GetGDB(index : longint) : PBreakpoint;
-
-  function IsNum(P : PBreakpoint) : boolean;{$ifndef FPC}far;{$endif}
-  begin
-    IsNum:=P^.GDBIndex=index;
-  end;
-
-begin
-  if index=0 then
-    GetGDB:=nil
-  else
-    GetGDB:=FirstThat(@IsNum);
-end;
-
-procedure TBreakpointCollection.ShowBreakpoints(W : PSourceWindow);
-
-  procedure SetInSource(P : PBreakpoint);{$ifndef FPC}far;{$endif}
-  begin
-    If assigned(P^.FileName) and
-      (GDBFileName(FExpand(P^.FileName^))=GDBFileName(FExpand(W^.Editor^.FileName))) then
-      W^.Editor^.SetLineFlagState(P^.Line-1,lfBreakpoint,P^.state=bs_enabled);
-  end;
-
-begin
-  ForEach(@SetInSource);
-end;
-
-procedure TBreakpointCollection.ShowAllBreakpoints;
-
-  procedure SetInSource(P : PBreakpoint);{$ifndef FPC}far;{$endif}
-    var
-      W : PSourceWindow;
-  begin
-    If assigned(P^.FileName) then
-      begin
-        W:=SearchOnDesktop(P^.FileName^,false);
-        if assigned(W) then
-          W^.Editor^.SetLineFlagState(P^.Line-1,lfBreakpoint,P^.state=bs_enabled);
-      end;
-  end;
-
-begin
-  ForEach(@SetInSource);
-end;
-
-function TBreakpointCollection.GetType(typ : BreakpointType;Const s : String) : PBreakpoint;
-
-  function IsThis(P : PBreakpoint) : boolean;{$ifndef FPC}far;{$endif}
-  begin
-    IsThis:=(P^.typ=typ) and (GetStr(P^.Name)=S);
-  end;
-
-begin
-  GetType:=FirstThat(@IsThis);
-end;
-
-function TBreakpointCollection.ToggleFileLine(FileName: String;LineNr : Longint) : boolean;
-
-var PB : PBreakpoint;
-
-  function IsThere(P : PBreakpoint) : boolean;{$ifndef FPC}far;{$endif}
-  begin
-    IsThere:=(P^.typ=bt_file_line) and (P^.FileName^=FileName) and (P^.Line=LineNr);
-  end;
-begin
-    FileName:=GDBFileName(FileName);
-    PB:=FirstThat(@IsThere);
-    ToggleFileLine:=false;
-    If Assigned(PB) then
-      if PB^.state=bs_disabled then
-        begin
-          PB^.state:=bs_enabled;
-          ToggleFileLine:=true;
-        end
-      else if PB^.state=bs_enabled then
-        PB^.state:=bs_disabled;
-    If not assigned(PB) then
-      begin
-        PB:= New(PBreakpoint,Init_file_line(FileName,LineNr));
-        if assigned(PB) then
-          Begin
-            Insert(PB);
-            ToggleFileLine:=true;
-          End;
-      end;
-    if assigned(PB) then
-      PB^.UpdateSource;
-    Update;
-end;
-
-
-
-{****************************************************************************
-                         TBreakpointItem
-****************************************************************************}
-
-constructor TBreakpointItem.Init(ABreakpoint : PBreakpoint);
-begin
-  inherited Init;
-  Breakpoint:=ABreakpoint;
-end;
-
-function TBreakpointItem.GetText(MaxLen: Sw_integer): string;
-var S: string;
-begin
- with Breakpoint^ do
-   begin
-     S:=BreakpointTypeStr[typ];
-     While Length(S)<10 do
-       S:=S+' ';
-     S:=S+'|';
-     S:=S+BreakpointStateStr[state]+' ';
-     While Length(S)<20 do
-       S:=S+' ';
-     S:=S+'|';
-     if (typ=bt_file_line) then
-       S:=S+NameAndExtOf(GetStr(FileName))+':'+IntToStr(Line)
-         else
-       S:=S+GetStr(name);
-     While Length(S)<40 do
-       S:=S+' ';
-     S:=S+'|';
-     if IgnoreCount>0 then
-       S:=S+IntToStr(IgnoreCount);
-     While Length(S)<49 do
-       S:=S+' ';
-     S:=S+'|';
-     if assigned(Conditions) then
-       S:=S+' '+GetStr(Conditions);
-     if length(S)>MaxLen then S:=copy(S,1,MaxLen-2)+'..';
-     GetText:=S;
-   end;
-end;
-
-procedure TBreakpointItem.Selected;
-begin
-end;
-
-function TBreakpointItem.GetModuleName: string;
-begin
-  if breakpoint^.typ=bt_file_line then
-    GetModuleName:=GetStr(breakpoint^.FileName)
-  else
-    GetModuleName:='';
-end;
-
-{****************************************************************************
-                         TBreakpointsListBox
-****************************************************************************}
-
-constructor TBreakpointsListBox.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-begin
-  inherited Init(Bounds,1,AHScrollBar, AVScrollBar);
-  GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
-  NoSelection:=true;
-end;
-
-function TBreakpointsListBox.GetLocalMenu: PMenu;
-var M: PMenu;
-begin
-  if (Owner<>nil) and (Owner^.GetState(sfModal)) then M:=nil else
-  M:=NewMenu(
-    NewItem(menu_bplocal_gotosource,'',kbNoKey,cmMsgGotoSource,hcMsgGotoSource,
-    NewItem(menu_bplocal_editbreakpoint,'',kbNoKey,cmEditBreakpoint,hcEditBreakpoint,
-    NewItem(menu_bplocal_newbreakpoint,'',kbNoKey,cmNewBreakpoint,hcNewBreakpoint,
-    NewItem(menu_bplocal_deletebreakpoint,'',kbNoKey,cmDeleteBreakpoint,hcDeleteBreakpoint,
-    NewItem(menu_bplocal_togglestate,'',kbNoKey,cmToggleBreakpoint,hcToggleBreakpoint,
-    nil))))));
-  GetLocalMenu:=M;
-end;
-
-procedure TBreakpointsListBox.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-begin
-  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbEnter :
-            Message(@Self,evCommand,cmMsgGotoSource,nil);
-          kbIns :
-            Message(@Self,evCommand,cmNewBreakpoint,nil);
-          kbDel :
-            Message(@Self,evCommand,cmDeleteBreakpoint,nil);
-        else
-          DontClear:=true;
-        end;
-        if not DontClear then
-          ClearEvent(Event);
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmListItemSelected :
-          if Event.InfoPtr=@Self then
-            Message(@Self,evCommand,cmEditBreakpoint,nil);
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmMsgTrackSource :
-            if Range>0 then
-              TrackSource;
-          cmEditBreakpoint :
-              EditCurrent;
-          cmToggleBreakpoint :
-              ToggleCurrent;
-          cmDeleteBreakpoint :
-              DeleteCurrent;
-          cmNewBreakpoint :
-              EditNew;
-          cmMsgClear :
-            Clear;
-          else
-            DontClear:=true;
-        end;
-        if not DontClear then
-          ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure TBreakpointsListBox.AddBreakpoint(P: PBreakpointItem);
-var W : integer;
-begin
-  if List=nil then New(List, Init(20,20));
-  W:=length(P^.GetText(255));
-  if W>MaxWidth then
-  begin
-    MaxWidth:=W;
-    if HScrollBar<>nil then
-       HScrollBar^.SetRange(0,MaxWidth);
-  end;
-  List^.Insert(P);
-  SetRange(List^.Count);
-  if Focused=List^.Count-1-1 then
-     FocusItem(List^.Count-1);
-  P^.Breakpoint^.UpdateSource;
-  DrawView;
-end;
-
-(* function TBreakpointsListBox.AddModuleName(const Name: string): PString;
-var P: PString;
-begin
-  if ModuleNames<>nil then
-    P:=ModuleNames^.Add(Name)
-  else
-    P:=nil;
-  AddModuleName:=P;
-end;  *)
-
-function TBreakpointsListBox.GetText(Item,MaxLen: Sw_Integer): String;
-var P: PBreakpointItem;
-    S: string;
-begin
-  P:=List^.At(Item);
-  S:=P^.GetText(MaxLen);
-  GetText:=copy(S,1,MaxLen);
-end;
-
-procedure TBreakpointsListBox.Clear;
-begin
-  if assigned(List) then
-    Dispose(List, Done);
-  List:=nil;
-  MaxWidth:=0;
-  (* if assigned(ModuleNames) then
-    ModuleNames^.FreeAll; *)
-  SetRange(0); DrawView;
-  Message(Application,evBroadcast,cmClearLineHighlights,@Self);
-end;
-
-procedure TBreakpointsListBox.TrackSource;
-var W: PSourceWindow;
-    P: PBreakpointItem;
-    R: TRect;
-    (* Row,Col: sw_integer; *)
-begin
-  (*Message(Application,evBroadcast,cmClearLineHighlights,@Self);
-  if Range=0 then Exit;*)
-  P:=List^.At(Focused);
-  if P^.GetModuleName='' then Exit;
-  Desktop^.Lock;
-  GetNextEditorBounds(R);
-  R.B.Y:=Owner^.Origin.Y;
-  W:=EditorWindowFile(P^.GetModuleName);
-  if assigned(W) then
-    begin
-      W^.GetExtent(R);
-      R.B.Y:=Owner^.Origin.Y;
-      W^.ChangeBounds(R);
-      W^.Editor^.SetCurPtr(1,P^.Breakpoint^.Line);
-    end
-  else
-    W:=TryToOpenFile(@R,P^.GetModuleName,1,P^.Breakpoint^.Line,true);
-  if W<>nil then
-    begin
-      W^.Select;
-      W^.Editor^.TrackCursor(true);
-      W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P^.Breakpoint^.Line);
-    end;
-  if Assigned(Owner) then
-    Owner^.Select;
-  Desktop^.UnLock;
-end;
-
-procedure TBreakpointsListBox.ToggleCurrent;
-var
-  P: PBreakpointItem;
-begin
-  if Range=0 then Exit;
-  P:=List^.At(Focused);
-  if P=nil then Exit;
-  if P^.Breakpoint^.state=bs_enabled then
-    P^.Breakpoint^.state:=bs_disabled
-  else if P^.Breakpoint^.state=bs_disabled then
-    P^.Breakpoint^.state:=bs_enabled;
-  P^.Breakpoint^.UpdateSource;
-  BreakpointsCollection^.Update;
-end;
-
-procedure TBreakpointsListBox.EditCurrent;
-var
-  P: PBreakpointItem;
-begin
-  if Range=0 then Exit;
-  P:=List^.At(Focused);
-  if P=nil then Exit;
-  Application^.ExecuteDialog(New(PBreakpointItemDialog,Init(P^.Breakpoint)),nil);
-  P^.Breakpoint^.UpdateSource;
-  BreakpointsCollection^.Update;
-end;
-
-procedure TBreakpointsListBox.DeleteCurrent;
-var
-  P: PBreakpointItem;
-begin
-  if Range=0 then Exit;
-  P:=List^.At(Focused);
-  if P=nil then Exit;
-  { delete it form source window }
-  P^.Breakpoint^.state:=bs_disabled;
-  P^.Breakpoint^.UpdateSource;
-  BreakpointsCollection^.free(P^.Breakpoint);
-  List^.free(P);
-  BreakpointsCollection^.Update;
-end;
-
-procedure TBreakpointsListBox.EditNew;
-var
-  P: PBreakpoint;
-begin
-  P:=New(PBreakpoint,Init_Empty);
-  if Application^.ExecuteDialog(New(PBreakpointItemDialog,Init(P)),nil)<>cmCancel then
-    begin
-      P^.UpdateSource;
-      BreakpointsCollection^.Insert(P);
-      BreakpointsCollection^.Update;
-    end
-  else
-    dispose(P,Done);
-end;
-
-procedure TBreakpointsListBox.Draw;
-var
-  I, J, Item: Sw_Integer;
-  NormalColor, SelectedColor, FocusedColor, Color: Word;
-  ColWidth, CurCol, Indent: Integer;
-  B: TDrawBuffer;
-  Text: String;
-  SCOff: Byte;
-  TC: byte;
-procedure MT(var C: word); begin if TC<>0 then C:=(C and $ff0f) or (TC and $f0); end;
-begin
-  if (Owner<>nil) then TC:=ord(Owner^.GetColor(6)) else TC:=0;
-  if State and (sfSelected + sfActive) = (sfSelected + sfActive) then
-  begin
-    NormalColor := GetColor(1);
-    FocusedColor := GetColor(3);
-    SelectedColor := GetColor(4);
-  end else
-  begin
-    NormalColor := GetColor(2);
-    SelectedColor := GetColor(4);
-  end;
-  if Transparent then
-    begin MT(NormalColor); MT(SelectedColor); end;
-  if NoSelection then
-     SelectedColor:=NormalColor;
-  if HScrollBar <> nil then Indent := HScrollBar^.Value
-  else Indent := 0;
-  ColWidth := Size.X div NumCols + 1;
-  for I := 0 to Size.Y - 1 do
-  begin
-    for J := 0 to NumCols-1 do
-    begin
-      Item := J*Size.Y + I + TopItem;
-      CurCol := J*ColWidth;
-      if (State and (sfSelected + sfActive) = (sfSelected + sfActive)) and
-        (Focused = Item) and (Range > 0) then
-      begin
-        Color := FocusedColor;
-        SetCursor(CurCol+1,I);
-        SCOff := 0;
-      end
-      else if (Item < Range) and IsSelected(Item) then
-      begin
-        Color := SelectedColor;
-        SCOff := 2;
-      end
-      else
-      begin
-        Color := NormalColor;
-        SCOff := 4;
-      end;
-      MoveChar(B[CurCol], ' ', Color, ColWidth);
-      if Item < Range then
-      begin
-        Text := GetText(Item, ColWidth + Indent);
-        Text := Copy(Text,Indent,ColWidth);
-        MoveStr(B[CurCol+1], Text, Color);
-        if ShowMarkers then
-        begin
-          WordRec(B[CurCol]).Lo := Byte(SpecialChars[SCOff]);
-          WordRec(B[CurCol+ColWidth-2]).Lo := Byte(SpecialChars[SCOff+1]);
-        end;
-      end;
-      MoveChar(B[CurCol+ColWidth-1], #179, GetColor(5), 1);
-    end;
-    WriteLine(0, I, Size.X, 1, B);
-  end;
-end;
-
-constructor TBreakpointsListBox.Load(var S: TStream);
-begin
-  inherited Load(S);
-end;
-
-procedure TBreakpointsListBox.Store(var S: TStream);
-var OL: PCollection;
-    OldR : integer;
-begin
-  OL:=List;
-  OldR:=Range;
-  Range:=0;
-  New(List, Init(1,1));
-
-  inherited Store(S);
-
-  Dispose(List, Done);
-  Range:=OldR;
-  List:=OL;
-  { ^^^ nasty trick - has anyone a better idea how to avoid storing the
-    collection? Pasting here a modified version of TListBox.Store+
-    TAdvancedListBox.Store isn't a better solution, since by eventually
-    changing the obj-hierarchy you'll always have to modify this, too - BG }
-end;
-
-destructor TBreakpointsListBox.Done;
-begin
-  inherited Done;
-  if List<>nil then Dispose(List, Done);
-  (* if ModuleNames<>nil then Dispose(ModuleNames, Done);*)
-end;
-
-{****************************************************************************
-                         TBreakpointsWindow
-****************************************************************************}
-
-constructor TBreakpointsWindow.Init;
-var R,R2: TRect;
-    HSB,VSB: PScrollBar;
-    ST: PStaticText;
-    S: String;
-    X,X1 : Sw_integer;
-    Btn: PButton;
-begin
-  Desktop^.GetExtent(R); R.A.Y:=R.B.Y-18;
-  inherited Init(R, dialog_breakpointlist, wnNoNumber);
-
-  HelpCtx:=hcBreakpointListWindow;
-
-  GetExtent(R); R.Grow(-1,-1); R.B.Y:=R.A.Y+1;
-  S:=label_breakpointpropheader;
-  New(ST, Init(R,S));
-  ST^.GrowMode:=gfGrowHiX;
-  Insert(ST);
-  GetExtent(R); R.Grow(-1,-1); Inc(R.A.Y,1); R.B.Y:=R.A.Y+1;
-  New(ST, Init(R, CharStr('Ä', MaxViewWidth)));
-  ST^.GrowMode:=gfGrowHiX;
-  Insert(ST);
-  GetExtent(R); R.Grow(-1,-1); Inc(R.A.Y,2);Dec(R.B.Y,5);
-  R2.Copy(R); Inc(R2.B.Y); R2.A.Y:=R2.B.Y-1;
-  New(HSB, Init(R2)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiY+gfGrowHiX; Insert(HSB);
-  R2.Copy(R); Inc(R2.B.X); R2.A.X:=R2.B.X-1;
-  New(VSB, Init(R2)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
-  New(BreakLB, Init(R,HSB,VSB));
-  BreakLB^.GrowMode:=gfGrowHiX+gfGrowHiY;
-  BreakLB^.Transparent:=true;
-  Insert(BreakLB);
-  GetExtent(R);R.Grow(-1,-1);
-  Dec(R.B.Y);
-  R.A.Y:=R.B.Y-2;
-  X:=(R.B.X-R.A.X) div 4;
-  X1:=R.A.X+(X div 2);
-  R.A.X:=X1-3;R.B.X:=X1+7;
-  New(Btn, Init(R, button_Close, cmClose, bfDefault));
-  Btn^.GrowMode:=gfGrowLoY+gfGrowHiY;
-  Insert(Btn);
-  X1:=X1+X;
-  R.A.X:=X1-3;R.B.X:=X1+7;
-  New(Btn, Init(R, button_New, cmNewBreakpoint, bfNormal));
-  Btn^.GrowMode:=gfGrowLoY+gfGrowHiY;
-  Insert(Btn);
-  X1:=X1+X;
-  R.A.X:=X1-3;R.B.X:=X1+7;
-  New(Btn, Init(R, button_Edit, cmEditBreakpoint, bfNormal));
-  Btn^.GrowMode:=gfGrowLoY+gfGrowHiY;
-  Insert(Btn);
-  X1:=X1+X;
-  R.A.X:=X1-3;R.B.X:=X1+7;
-  New(Btn, Init(R, button_Delete, cmDeleteBreakpoint, bfNormal));
-  Btn^.GrowMode:=gfGrowLoY+gfGrowHiY;
-  Insert(Btn);
-  BreakLB^.Select;
-  Update;
-  BreakpointsWindow:=@self;
-end;
-
-constructor TBreakpointsWindow.Load(var S: TStream);
-begin
-  inherited Load(S);
-  GetSubViewPtr(S,BreakLB);
-end;
-
-procedure TBreakpointsWindow.Store(var S: TStream);
-begin
-  inherited Store(S);
-  PutSubViewPtr(S,BreakLB);
-end;
-
-procedure TBreakpointsWindow.AddBreakpoint(ABreakpoint : PBreakpoint);
-begin
-  BreakLB^.AddBreakpoint(New(PBreakpointItem, Init(ABreakpoint)));
-end;
-
-procedure TBreakpointsWindow.ClearBreakpoints;
-begin
-  BreakLB^.Clear;
-  ReDraw;
-end;
-
-procedure TBreakpointsWindow.ReloadBreakpoints;
-  procedure InsertInBreakLB(P : PBreakpoint);
-  begin
-    BreakLB^.AddBreakpoint(New(PBreakpointItem, Init(P)));
-  end;
-begin
-  If not assigned(BreakpointsCollection) then
-    exit;
-  BreakpointsCollection^.ForEach(@InsertInBreakLB);
-  ReDraw;
-end;
-
-procedure TBreakpointsWindow.SizeLimits(var Min, Max: TPoint);
-begin
-  inherited SizeLimits(Min,Max);
-  Min.X:=40; Min.Y:=18;
-end;
-
-procedure TBreakpointsWindow.Close;
-begin
-  Hide;
-end;
-
-procedure TBreakpointsWindow.HandleEvent(var Event: TEvent);
-var DontClear : boolean;
-begin
-  case Event.What of
-    evKeyDown :
-      begin
-        if (Event.KeyCode=kbEnter) or (Event.KeyCode=kbEsc) then
-          begin
-            ClearEvent(Event);
-            Hide;
-          end;
-      end;
-    evCommand :
-      begin
-       DontClear:=False;
-       case Event.Command of
-         cmNewBreakpoint :
-           BreakLB^.EditNew;
-         cmEditBreakpoint :
-           BreakLB^.EditCurrent;
-         cmDeleteBreakpoint :
-           BreakLB^.DeleteCurrent;
-         cmClose :
-           Hide;
-          else
-            DontClear:=true;
-        end;
-        if not DontClear then
-          ClearEvent(Event);
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmUpdate :
-          Update;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure TBreakpointsWindow.Update;
-begin
-  ClearBreakpoints;
-  ReloadBreakpoints;
-end;
-
-destructor TBreakpointsWindow.Done;
-begin
-  inherited Done;
-  BreakpointsWindow:=nil;
-end;
-
-{****************************************************************************
-                         TBreakpointItemDialog
-****************************************************************************}
-
-constructor TBreakpointItemDialog.Init(ABreakpoint: PBreakpoint);
-var R,R2,R3: TRect;
-    Items: PSItem;
-    I : BreakpointType;
-    KeyCount: sw_integer;
-begin
-  KeyCount:=longint(high(BreakpointType));
-
-  R.Assign(0,0,60,Max(3+KeyCount,18));
-  inherited Init(R,dialog_modifynewbreakpoint);
-  Breakpoint:=ABreakpoint;
-
-  GetExtent(R); R.Grow(-3,-2); R3.Copy(R);
-  Inc(R.A.Y); R.B.Y:=R.A.Y+1; R.B.X:=R.A.X+36;
-  New(NameIL, Init(R, 128)); Insert(NameIL);
-  R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, label_breakpoint_name, NameIL)));
-  R.Move(0,3);
-  New(LineIL, Init(R, 128)); Insert(LineIL);
-  LineIL^.SetValidator(New(PRangeValidator, Init(0,MaxInt)));
-  R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, label_breakpoint_line, LineIL)));
-  R.Move(0,3);
-  New(ConditionsIL, Init(R, 128)); Insert(ConditionsIL);
-  R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, label_breakpoint_conditions, ConditionsIL)));
-  R.Move(0,3);
-  New(IgnoreIL, Init(R, 128)); Insert(IgnoreIL);
-  IgnoreIL^.SetValidator(New(PRangeValidator, Init(0,MaxInt)));
-  R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, label_breakpoint_ignorecount, IgnoreIL)));
-
-  R.Copy(R3); Inc(R.A.X,38); R.B.Y:=R.A.Y+KeyCount;
-  Items:=nil;
-  for I:=high(BreakpointType) downto low(BreakpointType) do
-    Items:=NewSItem(BreakpointTypeStr[I], Items);
-  New(TypeRB, Init(R, Items));
-  Insert(TypeRB);
-
-  InsertButtons(@Self);
-
-  NameIL^.Select;
-end;
-
-function TBreakpointItemDialog.Execute: Word;
-var R: word;
-    S1: string;
-    err: word;
-    L: longint;
-begin
-  R:=longint(Breakpoint^.typ);
-  TypeRB^.SetData(R);
-
-  If Breakpoint^.typ=bt_file_line then
-    S1:=GetStr(Breakpoint^.FileName)
-  else
-    S1:=GetStr(Breakpoint^.name);
-  NameIL^.SetData(S1);
-
-  If Breakpoint^.typ=bt_file_line then
-    S1:=IntToStr(Breakpoint^.Line)
-  else
-    S1:='0';
-  LineIL^.SetData(S1);
-
-  S1:=IntToStr(Breakpoint^.IgnoreCount);
-  IgnoreIL^.SetData(S1);
-  S1:=GetStr(Breakpoint^.Conditions);
-  ConditionsIL^.SetData(S1);
-
-  R:=inherited Execute;
-  if R=cmOK then
-  begin
-    TypeRB^.GetData(R);
-    L:=R;
-    Breakpoint^.typ:=BreakpointType(L);
-
-    NameIL^.GetData(S1);
-    If Breakpoint^.typ=bt_file_line then
-      begin
-        If assigned(Breakpoint^.FileName) then
-          DisposeStr(Breakpoint^.FileName);
-        Breakpoint^.FileName:=NewStr(S1);
-      end
-    else
-      begin
-        If assigned(Breakpoint^.Name) then
-          DisposeStr(Breakpoint^.Name);
-        Breakpoint^.name:=NewStr(S1);
-      end;
-    If Breakpoint^.typ=bt_file_line then
-      begin
-        LineIL^.GetData(S1);
-        Val(S1,L,err);
-        Breakpoint^.Line:=L;
-      end;
-    IgnoreIL^.GetData(S1);
-    Val(S1,L,err);
-    Breakpoint^.IgnoreCount:=L;
-
-    ConditionsIL^.GetData(S1);
-    If assigned(Breakpoint^.Conditions) then
-      DisposeStr(Breakpoint^.Conditions);
-    Breakpoint^.Conditions:=NewStr(S1);
-  end;
-  Execute:=R;
-end;
-
-{****************************************************************************
-                         TWatch
-****************************************************************************}
-
-constructor TWatch.Init(s : string);
-  begin
-    expr:=NewStr(s);
-    last_value:=nil;
-    current_value:=nil;
-    Get_new_value;
-  end;
-
-constructor TWatch.Load(var S: TStream);
-  begin
-    expr:=S.ReadStr;
-    last_value:=nil;
-    current_value:=nil;
-    Get_new_value;
-  end;
-
-procedure TWatch.Store(var S: TStream);
-  begin
-    S.WriteStr(expr);
-  end;
-
-procedure TWatch.rename(s : string);
-  begin
-    if assigned(expr) then
-      begin
-        if GetStr(expr)=S then
-          exit;
-        DisposeStr(expr);
-      end;
-    expr:=NewStr(s);
-    if assigned(last_value) then
-      StrDispose(last_value);
-    last_value:=nil;
-    if assigned(current_value) then
-      StrDispose(current_value);
-    current_value:=nil;
-    Get_new_value;
-  end;
-
-procedure TWatch.Get_new_value;
-  var p, q : pchar;
-      i, j, curframe, startframe : longint;
-      s,s2 : string;
-      loop_higher, found, last_removed : boolean;
-
-    function GetValue(var s : string) : boolean;
-      begin
-        Debugger^.command('p '+s);
-        if not Debugger^.Error then
-          begin
-            s:=StrPas(Debugger^.GetOutput);
-            GetValue:=true;
-          end
-        else
-          begin
-            s:=StrPas(Debugger^.GetError);
-            GetValue:=false;
-            { do not open a messagebox for such errors }
-            Debugger^.got_error:=false;
-          end;
-      end;
-
-  begin
-    If not assigned(Debugger) then
-      exit;
-    if assigned(last_value) then
-      strdispose(last_value);
-    last_value:=current_value;
-    s:=GetStr(expr);
-    found:=GetValue(s);
-    Debugger^.got_error:=false;
-    loop_higher:=not found;
-    curframe:=Debugger^.get_current_frame;
-    startframe:=curframe;
-    while loop_higher do
-      begin
-         s:='parent_ebp';
-         if GetValue(s) then
-           begin
-             repeat
-               inc(curframe);
-               if not Debugger^.set_current_frame(curframe) then
-                 loop_higher:=false;
-               s2:='/x $ebp';
-               getValue(s2);
-               j:=pos('=',s2);
-               if j>0 then
-                 s2:=copy(s2,j+1,length(s2));
-               while s2[1] in [' ',TAB] do
-                 delete(s2,1,1);
-               if pos(s2,s)>0 then
-                 loop_higher :=false;
-             until not loop_higher;
-             { try again at that level }
-             s:=GetStr(expr);
-             loop_higher:=not GetValue(s);
-           end
-         else
-           loop_higher:=false;
-      end;
-    s:=GetStr(expr);
-    if GetValue(s) then
-      p:=StrNew(Debugger^.GetOutput)
-    else
-      p:=StrNew(Debugger^.GetError);
-    Debugger^.got_error:=false;
-    { We should try here to find the expr in parent
-      procedure if there are
-      I will implement this as I added a
-      parent_ebp pseudo local var to local procedure
-      in stabs debug info PM }
-    { But there are some pitfalls like
-      locals redefined in other sublocals that call the function }
-
-    Debugger^.set_current_frame(startframe);
-
-    q:=nil;
-    if assigned(p) and (p[0]='$') then
-      q:=StrPos(p,'=');
-    if not assigned(q) then
-      q:=p;
-    if assigned(q) then
-      i:=strlen(q)
-    else
-      i:=0;
-    if (i>0) and (q[i-1]=#10) then
-      begin
-        q[i-1]:=#0;
-        last_removed:=true;
-      end
-    else
-      last_removed:=false;
-    if assigned(q) then
-      current_value:=strnew(q)
-    else
-      current_value:=strnew('');
-    if last_removed then
-      q[i-1]:=#10;
-    strdispose(p);
-  end;
-
-destructor TWatch.Done;
-  begin
-    if assigned(expr) then
-      disposestr(expr);
-    if assigned(last_value) then
-      strdispose(last_value);
-    if assigned(current_value) then
-      strdispose(current_value);
-    inherited done;
-  end;
-
-{****************************************************************************
-                         TWatchesCollection
-****************************************************************************}
-
-      constructor TWatchesCollection.Init;
-        begin
-          inherited Init(10,10);
-        end;
-
-      procedure TWatchesCollection.Insert(Item: Pointer);
-       begin
-         PWatch(Item)^.Get_new_value;
-         Inherited Insert(Item);
-         Update;
-       end;
-
-      procedure TWatchesCollection.Update;
-        var
-         W,W1 : integer;
-         procedure GetMax(P : PWatch);
-           begin
-              if assigned(P^.Current_value) then
-               begin
-                 W1:=StrLen(P^.Current_value)+2+Length(GetStr(P^.expr));
-                 if W1>W then
-                  W:=W1;
-               end;
-           end;
-        begin
-          W:=0;
-          ForEach(@GetMax);
-          MaxW:=W;
-          If assigned(WatchesWindow) then
-            WatchesWindow^.WLB^.Update(MaxW);
-        end;
-
-      function  TWatchesCollection.At(Index: Integer): PWatch;
-        begin
-          At:=Inherited At(Index);
-        end;
-
-{****************************************************************************
-                         TWatchesListBox
-****************************************************************************}
-
-constructor TWatchesListBox.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-  begin
-    inherited Init(Bounds,1,AHScrollBar,AVScrollBar);
-    If assigned(List) then
-      dispose(list,done);
-    List:=WatchesCollection;
-  end;
-
-procedure TWatchesListBox.Update(AMaxWidth : integer);
-var R : TRect;
-begin
-  GetExtent(R);
-  MaxWidth:=AMaxWidth;
-  if HScrollBar<>nil then
-    HScrollBar^.SetRange(0,MaxWidth);
-  if R.B.X-R.A.X>MaxWidth then
-    HScrollBar^.Hide
-  else
-    HScrollBar^.Show;
-  SetRange(List^.Count);
-  if R.B.Y-R.A.Y>Range then
-    VScrollBar^.Hide
-  else
-    VScrollBar^.Show;
-
-  if Focused=List^.Count-1-1 then
-     FocusItem(List^.Count-1);
-  DrawView;
-end;
-
-function    TWatchesListBox.GetIndentedText(Item,Indent,MaxLen: Sw_Integer): String;
-var
-  PW : PWatch;
-  ValOffset : Sw_integer;
-  S : String;
-begin
-  PW:=WatchesCollection^.At(Item);
-  ValOffset:=Length(GetStr(PW^.Expr))+2;
-  if Indent<ValOffset then
-    begin
-      if not assigned(PW^.current_value) then
-        S:=' '+GetStr(PW^.Expr)+' <Unknown value>'
-      else if not assigned(PW^.last_value) or
-        (strcomp(PW^.Last_value,PW^.Current_value)=0) then
-        S:=' '+GetStr(PW^.Expr)+' '+GetPChar(PW^.Current_value)
-      else
-        S:='!'+GetStr(PW^.Expr)+'!'+GetPchar(PW^.Current_value);
-      GetIndentedText:=Copy(S,Indent,MaxLen);
-    end
-  else
-   begin
-      if not assigned(PW^.Current_value) or
-         (StrLen(PW^.Current_value)<Indent-Valoffset) then
-        S:=''
-      else
-        S:=GetStr(@(PW^.Current_Value[Indent-Valoffset]));
-      GetIndentedText:=Copy(S,1,MaxLen);
-   end;
-end;
-
-procedure TWatchesListBox.EditCurrent;
-var
-  P: PWatch;
-begin
-  if Range=0 then Exit;
-  P:=WatchesCollection^.At(Focused);
-  if P=nil then Exit;
-  Application^.ExecuteDialog(New(PWatchItemDialog,Init(P)),nil);
-  WatchesCollection^.Update;
-end;
-
-procedure TWatchesListBox.DeleteCurrent;
-var
-  P: PWatch;
-begin
-  if Range=0 then Exit;
-  P:=WatchesCollection^.At(Focused);
-  if P=nil then Exit;
-  WatchesCollection^.free(P);
-  WatchesCollection^.Update;
-end;
-
-procedure TWatchesListBox.EditNew;
-var
-  P: PWatch;
-begin
-  P:=New(PWatch,Init(''));
-  if Application^.ExecuteDialog(New(PWatchItemDialog,Init(P)),nil)<>cmCancel then
-    begin
-      WatchesCollection^.Insert(P);
-      WatchesCollection^.Update;
-    end
-  else
-    dispose(P,Done);
-end;
-
-procedure   TWatchesListBox.Draw;
-var
-  I, J, Item: Sw_Integer;
-  NormalColor, SelectedColor, FocusedColor, Color: Word;
-  ColWidth, CurCol, Indent: Integer;
-  B: TDrawBuffer;
-  Text: String;
-  SCOff: Byte;
-  TC: byte;
-procedure MT(var C: word); begin if TC<>0 then C:=(C and $ff0f) or (TC and $f0); end;
-begin
-  if (Owner<>nil) then TC:=ord(Owner^.GetColor(6)) else TC:=0;
-  if State and (sfSelected + sfActive) = (sfSelected + sfActive) then
-  begin
-    NormalColor := GetColor(1);
-    FocusedColor := GetColor(3);
-    SelectedColor := GetColor(4);
-  end else
-  begin
-    NormalColor := GetColor(2);
-    SelectedColor := GetColor(4);
-  end;
-  if Transparent then
-    begin MT(NormalColor); MT(SelectedColor); end;
-  (* if NoSelection then
-     SelectedColor:=NormalColor;*)
-  if HScrollBar <> nil then Indent := HScrollBar^.Value
-  else Indent := 0;
-  ColWidth := Size.X div NumCols + 1;
-  for I := 0 to Size.Y - 1 do
-  begin
-    for J := 0 to NumCols-1 do
-    begin
-      Item := J*Size.Y + I + TopItem;
-      CurCol := J*ColWidth;
-      if (State and (sfSelected + sfActive) = (sfSelected + sfActive)) and
-        (Focused = Item) and (Range > 0) then
-      begin
-        Color := FocusedColor;
-        SetCursor(CurCol+1,I);
-        SCOff := 0;
-      end
-      else if (Item < Range) and IsSelected(Item) then
-      begin
-        Color := SelectedColor;
-        SCOff := 2;
-      end
-      else
-      begin
-        Color := NormalColor;
-        SCOff := 4;
-      end;
-      MoveChar(B[CurCol], ' ', Color, ColWidth);
-      if Item < Range then
-      begin
-        (* Text := GetText(Item, ColWidth + Indent);
-        Text := Copy(Text,Indent,ColWidth); *)
-        Text:=GetIndentedText(Item,Indent,ColWidth);
-        MoveStr(B[CurCol+1], Text, Color);
-        if ShowMarkers then
-        begin
-          WordRec(B[CurCol]).Lo := Byte(SpecialChars[SCOff]);
-          WordRec(B[CurCol+ColWidth-2]).Lo := Byte(SpecialChars[SCOff+1]);
-        end;
-      end;
-      MoveChar(B[CurCol+ColWidth-1], #179, GetColor(5), 1);
-    end;
-    WriteLine(0, I, Size.X, 1, B);
-  end;
-end;
-
-function TWatchesListBox.GetLocalMenu: PMenu;
-var M: PMenu;
-begin
-  if (Owner<>nil) and (Owner^.GetState(sfModal)) then M:=nil else
-  M:=NewMenu(
-    NewItem(menu_watchlocal_edit,'',kbNoKey,cmEdit,hcNoContext,
-    NewItem(menu_watchlocal_new,'',kbNoKey,cmNew,hcNoContext,
-    NewItem(menu_watchlocal_delete,'',kbNoKey,cmDelete,hcNoContext,
-    nil))));
-  GetLocalMenu:=M;
-end;
-
-procedure   TWatchesListBox.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-begin
-  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbEnter :
-            Message(@Self,evCommand,cmEdit,nil);
-          kbIns :
-            Message(@Self,evCommand,cmNew,nil);
-          kbDel :
-            Message(@Self,evCommand,cmDelete,nil);
-        else
-          DontClear:=true;
-        end;
-        if not DontClear then
-          ClearEvent(Event);
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmListItemSelected :
-          if Event.InfoPtr=@Self then
-            Message(@Self,evCommand,cmEdit,nil);
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmEdit :
-              EditCurrent;
-          cmDelete :
-              DeleteCurrent;
-          cmNew :
-              EditNew;
-          else
-            DontClear:=true;
-        end;
-        if not DontClear then
-          ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-      constructor TWatchesListBox.Load(var S: TStream);
-        begin
-          inherited Load(S);
-          If assigned(List) then
-            dispose(list,done);
-          List:=WatchesCollection;
-          { we must set Range PM }
-          SetRange(List^.count);
-        end;
-
-      procedure   TWatchesListBox.Store(var S: TStream);
-        var OL: PCollection;
-            OldRange : Sw_integer;
-        begin
-          OL:=List;
-          OldRange:=Range;
-          Range:=0;
-          New(List, Init(1,1));
-          inherited Store(S);
-          Dispose(List, Done);
-          List:=OL;
-          { ^^^ nasty trick - has anyone a better idea how to avoid storing the
-            collection? Pasting here a modified version of TListBox.Store+
-            TAdvancedListBox.Store isn't a better solution, since by eventually
-            changing the obj-hierarchy you'll always have to modify this, too - BG }
-          SetRange(OldRange);
-        end;
-
-      destructor  TWatchesListBox.Done;
-        begin
-          List:=nil;
-          inherited Done;
-        end;
-
-{****************************************************************************
-                         TWatchesWindow
-****************************************************************************}
-
-  Constructor TWatchesWindow.Init;
-    var
-      HSB,VSB: PScrollBar;
-      R,R2 : trect;
-    begin
-      Desktop^.GetExtent(R);
-      R.A.Y:=R.B.Y-7;
-      inherited Init(R, dialog_watches,SearchFreeWindowNo);
-      Palette:=wpCyanWindow;
-      GetExtent(R);
-      HelpCtx:=hcWatches;
-      R.Grow(-1,-1);
-      R2.Copy(R);
-      Inc(R2.B.Y);
-      R2.A.Y:=R2.B.Y-1;
-      New(HSB, Init(R2));
-      HSB^.GrowMode:=gfGrowLoY+gfGrowHiY+gfGrowHiX;
-      Insert(HSB);
-      R2.Copy(R);
-      Inc(R2.B.X);
-      R2.A.X:=R2.B.X-1;
-      New(VSB, Init(R2));
-      VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
-      Insert(VSB);
-      New(WLB,Init(R,HSB,VSB));
-      WLB^.GrowMode:=gfGrowHiX+gfGrowHiY;
-      WLB^.Transparent:=true;
-      Insert(WLB);
-      If assigned(WatchesWindow) then
-        dispose(WatchesWindow,done);
-      WatchesWindow:=@Self;
-      Update;
-    end;
-
-  procedure TWatchesWindow.Update;
-    begin
-      WatchesCollection^.Update;
-      Draw;
-    end;
-
-  constructor TWatchesWindow.Load(var S: TStream);
-    begin
-      inherited Load(S);
-      GetSubViewPtr(S,WLB);
-      If assigned(WatchesWindow) then
-        dispose(WatchesWindow,done);
-      WatchesWindow:=@Self;
-    end;
-
-  procedure TWatchesWindow.Store(var S: TStream);
-    begin
-      inherited Store(S);
-      PutSubViewPtr(S,WLB);
-    end;
-
-  Destructor TWatchesWindow.Done;
-    begin
-      WatchesWindow:=nil;
-      Dispose(WLB,done);
-      inherited done;
-    end;
-
-
-{****************************************************************************
-                         TWatchItemDialog
-****************************************************************************}
-
-constructor TWatchItemDialog.Init(AWatch: PWatch);
-var R,R2: TRect;
-begin
-  R.Assign(0,0,50,10);
-  inherited Init(R,'Edit Watch');
-  Watch:=AWatch;
-
-  GetExtent(R); R.Grow(-3,-2);
-  Inc(R.A.Y); R.B.Y:=R.A.Y+1; R.B.X:=R.A.X+36;
-  New(NameIL, Init(R, 255)); Insert(NameIL);
-  R2.Copy(R); R2.Move(-1,-1);
-  Insert(New(PLabel, Init(R2, label_watch_expressiontowatch, NameIL)));
-  GetExtent(R);
-  R.Grow(-1,-1);
-  R.A.Y:=R.A.Y+3;
-  R.B.X:=R.A.X+36;
-  TextST:=New(PAdvancedStaticText, Init(R, label_watch_values));
-  Insert(TextST);
-
-  InsertButtons(@Self);
-
-  NameIL^.Select;
-end;
-
-function TWatchItemDialog.Execute: Word;
-var R: word;
-    S1,S2: string;
-begin
-  S1:=GetStr(Watch^.expr);
-  NameIL^.SetData(S1);
-
-  if assigned(Watch^.Current_value) then
-    S1:=GetPChar(Watch^.Current_value)
-  else
-    S1:='';
-
-  if assigned(Watch^.Last_value) then
-    S2:=GetPChar(Watch^.Last_value)
-  else
-    S2:='';
-
-  ClearFormatParams;
-  AddFormatParamStr(S1);
-  AddFormatParamStr(S2);
-  if assigned(Watch^.Last_value) and
-     assigned(Watch^.Current_value) and
-     (strcomp(Watch^.Last_value,Watch^.Current_value)=0) then
-    S1:=FormatStrF(msg_watch_currentvalue,FormatParams)
-  else
-    S1:=FormatStrF(msg_watch_currentandpreviousvalue,FormatParams);
-
-  TextST^.SetText(S1);
-
-  R:=inherited Execute;
-  if R=cmOK then
-  begin
-    NameIL^.GetData(S1);
-    Watch^.Rename(S1);
-    If assigned(Debugger) then
-       Debugger^.ReadWatches;
-  end;
-  Execute:=R;
-end;
-
-{****************************************************************************
-                         TRegistersView
-****************************************************************************}
-
-  function GetIntRegs(var rs : TIntRegs) : boolean;
-
-    var
-       p,po : pchar;
-       p1 : pchar;
-       reg,value : string;
-       buffer : array[0..255] of char;
-       v : dword;
-       code : word;
-
-    begin
-       GetIntRegs:=false;
-{$ifndef NODEBUG}
-       Debugger^.Command('info registers');
-       if Debugger^.Error then
-         exit
-       else
-         begin
-            po:=StrNew(Debugger^.GetOutput);
-            p:=po;
-            if assigned(p) then
-              begin
-                 fillchar(rs,sizeof(rs),0);
-                 p1:=strscan(p,' ');
-                 while assigned(p1) do
-                   begin
-                      strlcopy(buffer,p,p1-p);
-                      reg:=strpas(buffer);
-                      p:=strscan(p,'$');
-                      p1:=strscan(p,#9);
-                      strlcopy(buffer,p,p1-p);
-                      value:=strpas(buffer);
-                      val(value,v,code);
-                      if reg='eax' then
-                        rs.eax:=v
-                      else if reg='ebx' then
-                        rs.ebx:=v
-                      else if reg='ecx' then
-                        rs.ecx:=v
-                      else if reg='edx' then
-                        rs.edx:=v
-                      else if reg='eip' then
-                        rs.eip:=v
-                      else if reg='esi' then
-                        rs.esi:=v
-                      else if reg='edi' then
-                        rs.edi:=v
-                      else if reg='esp' then
-                        rs.esp:=v
-                      else if reg='ebp' then
-                        rs.ebp:=v
-                      { under win32 flags are on a register named ps !! PM }
-                      else if (reg='eflags') or (reg='ps') then
-                        rs.eflags:=v
-                      else if reg='cs' then
-                        rs.cs:=v
-                      else if reg='ds' then
-                        rs.ds:=v
-                      else if reg='es' then
-                        rs.es:=v
-                      else if reg='fs' then
-                        rs.fs:=v
-                      else if reg='gs' then
-                        rs.gs:=v
-                      else if reg='ss' then
-                        rs.ss:=v;
-                      p:=strscan(p1,#10);
-                      if assigned(p) then
-                        begin
-                           p1:=strscan(p,' ');
-                           inc(p);
-                        end
-                      else
-                        break;
-                   end;
-                 { free allocated memory }
-                 strdispose(po);
-              end
-            else
-              exit;
-         end;
-       { do not open a messagebox for such errors }
-       Debugger^.got_error:=false;
-       GetIntRegs:=true;
-{$endif}
-    end;
-
-  constructor TRegistersView.Init(var Bounds: TRect);
-
-    begin
-       inherited init(Bounds);
-    end;
-
-  procedure TRegistersView.Draw;
-
-    var
-       rs : tintregs;
-       color :byte;
-
-    procedure SetColor(x,y : longint);
-    begin
-      if x=y then
-        color:=7
-      else
-        color:=8;
-    end;
-
-    begin
-       inherited draw;
-       If not assigned(Debugger) then
-         begin
-            WriteStr(1,0,'<no values available>',7);
-            exit;
-         end;
-       if GetIntRegs(rs) then
-         begin
-            SetColor(rs.eax,OldReg.eax);
-            WriteStr(1,0,'EAX '+HexStr(rs.eax,8),color);
-            SetColor(rs.ebx,OldReg.ebx);
-            WriteStr(1,1,'EBX '+HexStr(rs.ebx,8),color);
-            SetColor(rs.ecx,OldReg.ecx);
-            WriteStr(1,2,'ECX '+HexStr(rs.ecx,8),color);
-            SetColor(rs.edx,OldReg.edx);
-            WriteStr(1,3,'EDX '+HexStr(rs.edx,8),color);
-            SetColor(rs.eip,OldReg.eip);
-            WriteStr(1,4,'EIP '+HexStr(rs.eip,8),color);
-            SetColor(rs.esi,OldReg.esi);
-            WriteStr(1,5,'ESI '+HexStr(rs.esi,8),color);
-            SetColor(rs.edi,OldReg.edi);
-            WriteStr(1,6,'EDI '+HexStr(rs.edi,8),color);
-            SetColor(rs.esp,OldReg.esp);
-            WriteStr(1,7,'ESP '+HexStr(rs.esp,8),color);
-            SetColor(rs.ebp,OldReg.ebp);
-            WriteStr(1,8,'EBP '+HexStr(rs.ebp,8),color);
-            SetColor(rs.cs,OldReg.cs);
-            WriteStr(14,0,'CS '+HexStr(rs.cs,4),color);
-            SetColor(rs.ds,OldReg.ds);
-            WriteStr(14,1,'DS '+HexStr(rs.ds,4),color);
-            SetColor(rs.es,OldReg.es);
-            WriteStr(14,2,'ES '+HexStr(rs.es,4),color);
-            SetColor(rs.fs,OldReg.fs);
-            WriteStr(14,3,'FS '+HexStr(rs.fs,4),color);
-            SetColor(rs.gs,OldReg.gs);
-            WriteStr(14,4,'GS '+HexStr(rs.gs,4),color);
-            SetColor(rs.ss,OldReg.ss);
-            WriteStr(14,5,'SS '+HexStr(rs.ss,4),color);
-            SetColor(rs.eflags and $1,OldReg.eflags and $1);
-            WriteStr(22,0,'c='+chr(byte((rs.eflags and $1)<>0)+48),color);
-            SetColor(rs.eflags and $20,OldReg.eflags and $20);
-            WriteStr(22,1,'z='+chr(byte((rs.eflags and $20)<>0)+48),color);
-            SetColor(rs.eflags and $80,OldReg.eflags and $80);
-            WriteStr(22,2,'s='+chr(byte((rs.eflags and $80)<>0)+48),color);
-            SetColor(rs.eflags and $800,OldReg.eflags and $800);
-            WriteStr(22,3,'o='+chr(byte((rs.eflags and $800)<>0)+48),color);
-            SetColor(rs.eflags and $4,OldReg.eflags and $4);
-            WriteStr(22,4,'p='+chr(byte((rs.eflags and $4)<>0)+48),color);
-            SetColor(rs.eflags and $200,OldReg.eflags and $200);
-            WriteStr(22,5,'i='+chr(byte((rs.eflags and $200)<>0)+48),color);
-            SetColor(rs.eflags and $10,OldReg.eflags and $10);
-            WriteStr(22,6,'a='+chr(byte((rs.eflags and $10)<>0)+48),color);
-            SetColor(rs.eflags and $400,OldReg.eflags and $400);
-            WriteStr(22,7,'d='+chr(byte((rs.eflags and $400)<>0)+48),color);
-            OldReg:=rs;
-         end
-       else
-         WriteStr(0,0,'<debugger error>',7);
-    end;
-
-  destructor TRegistersView.Done;
-
-    begin
-       inherited done;
-    end;
-
-{****************************************************************************
-                         TRegistersWindow
-****************************************************************************}
-
-  constructor TRegistersWindow.Init;
-
-    var
-       R : TRect;
-
-    begin
-       Desktop^.GetExtent(R);
-       R.A.X:=R.B.X-28;
-       R.B.Y:=R.A.Y+11;
-       inherited Init(R,dialog_registers, wnNoNumber);
-       Flags:=wfClose or wfMove;
-       Palette:=wpCyanWindow;
-       HelpCtx:=hcRegisters;
-       R.Assign(1,1,26,10);
-       RV:=new(PRegistersView,init(R));
-       Insert(RV);
-       If assigned(RegistersWindow) then
-         dispose(RegistersWindow,done);
-       RegistersWindow:=@Self;
-       Update;
-    end;
-
-  constructor TRegistersWindow.Load(var S: TStream);
-
-    begin
-       inherited load(S);
-       GetSubViewPtr(S,RV);
-       If assigned(RegistersWindow) then
-         dispose(RegistersWindow,done);
-       RegistersWindow:=@Self;
-    end;
-
-  procedure TRegistersWindow.Store(var S: TStream);
-
-    begin
-       inherited Store(s);
-       PutSubViewPtr(S,RV);
-    end;
-
-  procedure TRegistersWindow.Update;
-
-    begin
-       ReDraw;
-    end;
-
-  destructor TRegistersWindow.Done;
-
-    begin
-       RegistersWindow:=nil;
-       inherited done;
-    end;
-
-{****************************************************************************
-                         TFPUView
-****************************************************************************}
-
-  function GetFPURegs(var rs : TFPURegs) : boolean;
-
-    var
-       p,po : pchar;
-       p1 : pchar;
-    {$ifndef NODEBUG}
-{       reg,value : string;
-       buffer : array[0..255] of char;
-       v : dword;
-       code : word;}
-    {$endif}
-
-    begin
-       GetFPURegs:=false;
-{$ifndef NODEBUG}
-       Debugger^.Command('info registers');
-       if Debugger^.Error then
-         exit
-       else
-         begin
-            po:=StrNew(Debugger^.GetOutput);
-            p:=po;
-            if assigned(p) then
-              begin
-                 fillchar(rs,sizeof(rs),0);
-                 p1:=strscan(p,' ');
-                 while assigned(p1) do
-                   begin
-                   {
-                      strlcopy(buffer,p,p1-p);
-                      reg:=strpas(buffer);
-                      p:=strscan(p,'$');
-                      p1:=strscan(p,#9);
-                      strlcopy(buffer,p,p1-p);
-                      value:=strpas(buffer);
-                      val(value,v,code);
-                      if reg='eax' then
-                        rs.eax:=v
-                      else if reg='ebx' then
-                        rs.ebx:=v
-                      else if reg='ecx' then
-                        rs.ecx:=v
-                      else if reg='edx' then
-                        rs.edx:=v
-                      else if reg='eip' then
-                        rs.eip:=v
-                      else if reg='esi' then
-                        rs.esi:=v
-                      else if reg='edi' then
-                        rs.edi:=v
-                      else if reg='esp' then
-                        rs.esp:=v
-                      else if reg='ebp' then
-                        rs.ebp:=v
-                       under win32 flags are on a register named ps !! PM
-                      else if (reg='eflags') or (reg='ps') then
-                        rs.eflags:=v
-                      else if reg='cs' then
-                        rs.cs:=v
-                      else if reg='ds' then
-                        rs.ds:=v
-                      else if reg='es' then
-                        rs.es:=v
-                      else if reg='fs' then
-                        rs.fs:=v
-                      else if reg='gs' then
-                        rs.gs:=v
-                      else if reg='ss' then
-                        rs.ss:=v;
-                      p:=strscan(p1,#10);
-                      if assigned(p) then
-                        begin
-                           p1:=strscan(p,' ');
-                           inc(p);
-                        end
-                      else
-                        break;
-                   }
-                   end;
-                 { free allocated memory }
-                 strdispose(po);
-              end
-            else
-              exit;
-         end;
-       { do not open a messagebox for such errors }
-       Debugger^.got_error:=false;
-       GetFPURegs:=true;
-{$endif}
-    end;
-
-  constructor TFPUView.Init(var Bounds: TRect);
-
-    begin
-       inherited init(Bounds);
-    end;
-
-  procedure TFPUView.Draw;
-
-    var
-       rs : tfpuregs;
-{       color :byte;
-
-    procedure SetColor(x,y : longint);
-    begin
-      if x=y then
-        color:=7
-      else
-        color:=8;
-    end;}
-
-    begin
-       inherited draw;
-       If not assigned(Debugger) then
-         begin
-            WriteStr(1,0,'<no values available>',7);
-            exit;
-         end;
-       if GetFPURegs(rs) then
-         begin
-         {
-            SetColor(rs.eax,OldReg.eax);
-            WriteStr(1,0,'EAX '+HexStr(rs.eax,8),color);
-            SetColor(rs.ebx,OldReg.ebx);
-            WriteStr(1,1,'EBX '+HexStr(rs.ebx,8),color);
-            SetColor(rs.ecx,OldReg.ecx);
-            WriteStr(1,2,'ECX '+HexStr(rs.ecx,8),color);
-            SetColor(rs.edx,OldReg.edx);
-            WriteStr(1,3,'EDX '+HexStr(rs.edx,8),color);
-            SetColor(rs.eip,OldReg.eip);
-            WriteStr(1,4,'EIP '+HexStr(rs.eip,8),color);
-            SetColor(rs.esi,OldReg.esi);
-            WriteStr(1,5,'ESI '+HexStr(rs.esi,8),color);
-            SetColor(rs.edi,OldReg.edi);
-            WriteStr(1,6,'EDI '+HexStr(rs.edi,8),color);
-            SetColor(rs.esp,OldReg.esp);
-            WriteStr(1,7,'ESP '+HexStr(rs.esp,8),color);
-            SetColor(rs.ebp,OldReg.ebp);
-            WriteStr(1,8,'EBP '+HexStr(rs.ebp,8),color);
-            SetColor(rs.cs,OldReg.cs);
-            WriteStr(14,0,'CS '+HexStr(rs.cs,4),color);
-            SetColor(rs.ds,OldReg.ds);
-            WriteStr(14,1,'DS '+HexStr(rs.ds,4),color);
-            SetColor(rs.es,OldReg.es);
-            WriteStr(14,2,'ES '+HexStr(rs.es,4),color);
-            SetColor(rs.fs,OldReg.fs);
-            WriteStr(14,3,'FS '+HexStr(rs.fs,4),color);
-            SetColor(rs.gs,OldReg.gs);
-            WriteStr(14,4,'GS '+HexStr(rs.gs,4),color);
-            SetColor(rs.ss,OldReg.ss);
-            WriteStr(14,5,'SS '+HexStr(rs.ss,4),color);
-            SetColor(rs.eflags and $1,OldReg.eflags and $1);
-            WriteStr(22,0,'c='+chr(byte((rs.eflags and $1)<>0)+48),color);
-            SetColor(rs.eflags and $20,OldReg.eflags and $20);
-            WriteStr(22,1,'z='+chr(byte((rs.eflags and $20)<>0)+48),color);
-            SetColor(rs.eflags and $80,OldReg.eflags and $80);
-            WriteStr(22,2,'s='+chr(byte((rs.eflags and $80)<>0)+48),color);
-            SetColor(rs.eflags and $800,OldReg.eflags and $800);
-            WriteStr(22,3,'o='+chr(byte((rs.eflags and $800)<>0)+48),color);
-            SetColor(rs.eflags and $4,OldReg.eflags and $4);
-            WriteStr(22,4,'p='+chr(byte((rs.eflags and $4)<>0)+48),color);
-            SetColor(rs.eflags and $200,OldReg.eflags and $200);
-            WriteStr(22,5,'i='+chr(byte((rs.eflags and $200)<>0)+48),color);
-            SetColor(rs.eflags and $10,OldReg.eflags and $10);
-            WriteStr(22,6,'a='+chr(byte((rs.eflags and $10)<>0)+48),color);
-            SetColor(rs.eflags and $400,OldReg.eflags and $400);
-            WriteStr(22,7,'d='+chr(byte((rs.eflags and $400)<>0)+48),color);
-            OldReg:=rs;
-         }
-         end
-       else
-         WriteStr(0,0,'<debugger error>',7);
-    end;
-
-  destructor TFPUView.Done;
-
-    begin
-       inherited done;
-    end;
-
-{****************************************************************************
-                         TFPUWindow
-****************************************************************************}
-
-  constructor TFPUWindow.Init;
-
-    var
-       R : TRect;
-
-    begin
-       Desktop^.GetExtent(R);
-       R.A.X:=R.B.X-28;
-       R.B.Y:=R.A.Y+11;
-       inherited Init(R,dialog_fpu, wnNoNumber);
-       Flags:=wfClose or wfMove;
-       Palette:=wpCyanWindow;
-       HelpCtx:=hcRegisters;
-       R.Assign(1,1,26,10);
-       RV:=new(PFPUView,init(R));
-       Insert(RV);
-       If assigned(FPUWindow) then
-         dispose(FPUWindow,done);
-       FPUWindow:=@Self;
-       Update;
-    end;
-
-  constructor TFPUWindow.Load(var S: TStream);
-
-    begin
-       inherited load(S);
-       GetSubViewPtr(S,RV);
-       If assigned(FPUWindow) then
-         dispose(FPUWindow,done);
-       FPUWindow:=@Self;
-    end;
-
-  procedure TFPUWindow.Store(var S: TStream);
-
-    begin
-       inherited Store(s);
-       PutSubViewPtr(S,RV);
-    end;
-
-  procedure TFPUWindow.Update;
-
-    begin
-       ReDraw;
-    end;
-
-  destructor TFPUWindow.Done;
-
-    begin
-       FPUWindow:=nil;
-       inherited done;
-    end;
-
-{****************************************************************************
-                         TStackWindow
-****************************************************************************}
-
-  constructor TFramesListBox.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-    begin
-      Inherited Init(Bounds,AHScrollBar,AVScrollBar);
-    end;
-
-  procedure TFramesListBox.Update;
-
-    var i : longint;
-        W : PSourceWindow;
-
-    begin
-      { call backtrace command }
-      If not assigned(Debugger) then
-        exit;
-    {$ifndef NODEBUG}
-      DeskTop^.Lock;
-      Clear;
-      { forget all old frames }
-      Debugger^.clear_frames;
-
-      Debugger^.Command('backtrace');
-      { generate list }
-      { all is in tframeentry }
-      for i:=0 to Debugger^.frame_count-1 do
-        begin
-          with Debugger^.frames[i]^ do
-            begin
-              if assigned(file_name) then
-                AddItem(new(PMessageItem,init(0,GetPChar(function_name)+GetPChar(args),
-                  AddModuleName(GetPChar(file_name)),line_number,1)))
-              else
-                AddItem(new(PMessageItem,init(0,HexStr(address,8)+' '+GetPChar(function_name)+GetPChar(args),
-                  AddModuleName(''),line_number,1)));
-              W:=SearchOnDesktop(GetPChar(file_name),false);
-              { First reset all Debugger rows }
-              If assigned(W) then
-                W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,-1);
-            end;
-        end;
-      { Now set all Debugger rows }
-      for i:=0 to Debugger^.frame_count-1 do
-        begin
-          with Debugger^.frames[i]^ do
-            begin
-              W:=SearchOnDesktop(GetPChar(file_name),false);
-              If assigned(W) then
-                begin
-                  If W^.Editor^.DebuggerRow=-1 then
-                    W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,line_number-1);
-                end;
-            end;
-        end;
-      if List^.Count > 0 then
-        FocusItem(0);
-      DeskTop^.Unlock;
-     {$endif}
-    end;
-
-  function TFramesListBox.GetLocalMenu: PMenu;
-    begin
-      GetLocalMenu:=Inherited GetLocalMenu;
-    end;
-
-  procedure TFramesListBox.GotoSource;
-    begin
-      { select frame for watches }
-      If not assigned(Debugger) then
-        exit;
-    {$ifndef NODEBUG}
-      Debugger^.Command('f '+IntToStr(Focused));
-      { for local vars }
-      Debugger^.ReadWatches;
-   {$endif}
-      { goto source }
-      inherited GotoSource;
-    end;
-
-  procedure   TFramesListBox.HandleEvent(var Event: TEvent);
-    begin
-      inherited HandleEvent(Event);
-    end;
-
-  destructor  TFramesListBox.Done;
-    begin
-      Inherited Done;
-    end;
-
-  Constructor TStackWindow.Init;
-    var
-      HSB,VSB: PScrollBar;
-      R,R2 : trect;
-    begin
-      Desktop^.GetExtent(R);
-      R.A.Y:=R.B.Y-5;
-      inherited Init(R, dialog_callstack, wnNoNumber);
-      Palette:=wpCyanWindow;
-      GetExtent(R);
-      HelpCtx:=hcStack;
-      R.Grow(-1,-1);
-      R2.Copy(R);
-      Inc(R2.B.Y);
-      R2.A.Y:=R2.B.Y-1;
-      New(HSB, Init(R2));
-      HSB^.GrowMode:=gfGrowLoY+gfGrowHiY+gfGrowHiX;
-      Insert(HSB);
-      R2.Copy(R);
-      Inc(R2.B.X);
-      R2.A.X:=R2.B.X-1;
-      New(VSB, Init(R2));
-      VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
-      Insert(VSB);
-      New(FLB,Init(R,HSB,VSB));
-      FLB^.GrowMode:=gfGrowHiX+gfGrowHiY;
-      Insert(FLB);
-      If assigned(StackWindow) then
-        dispose(StackWindow,done);
-      StackWindow:=@Self;
-      Update;
-    end;
-
-  procedure TStackWindow.Update;
-    begin
-      FLB^.Update;
-      DrawView;
-    end;
-
-  constructor TStackWindow.Load(var S: TStream);
-    begin
-      inherited Load(S);
-      GetSubViewPtr(S,FLB);
-      If assigned(StackWindow) then
-        dispose(StackWindow,done);
-      StackWindow:=@Self;
-    end;
-
-  procedure TStackWindow.Store(var S: TStream);
-    begin
-      inherited Store(S);
-      PutSubViewPtr(S,FLB);
-    end;
-
-  Destructor TStackWindow.Done;
-    begin
-      StackWindow:=nil;
-      Dispose(FLB,done);
-      inherited done;
-    end;
-
-{****************************************************************************
-                         Init/Final
-****************************************************************************}
-
-procedure InitDebugger;
-{$ifdef DEBUG}
-var s : string;
-    i,p : longint;
-{$endif DEBUG}
-var
-   NeedRecompileExe : boolean;
-   cm : longint;
-begin
-{$ifdef DEBUG}
-  Assign(gdb_file,GDBOutFileName);
-  {$I-}
-  Rewrite(gdb_file);
-  if InOutRes<>0 then
-    begin
-      s:=GDBOutFileName;
-      p:=pos('.',s);
-      if p>1 then
-       for i:=0 to 9 do
-         begin
-           s:=copy(s,1,p-2)+chr(i+ord('0'))+copy(s,p,length(s));
-           InOutRes:=0;
-           Assign(gdb_file,s);
-           rewrite(gdb_file);
-           if InOutRes=0 then
-             break;
-         end;
-    end;
-  if IOResult=0 then
-    Use_gdb_file:=true;
-  {$I+}
-{$endif}
-
-  NeedRecompileExe:=false;
-  if TargetSwitches^.GetCurrSelParam<>source_os.shortname then
-    begin
-     ClearFormatParams;
-     AddFormatParamStr(TargetSwitches^.GetCurrSelParam);
-     AddFormatParamStr(source_os.shortname);
-     cm:=ConfirmBox(msg_cantdebugchangetargetto,@FormatParams,true);
-     if cm=cmCancel then
-       Exit;
-     if cm=cmYes then
-       begin
-         { force recompilation }
-         PrevMainFile:='';
-         NeedRecompileExe:=true;
-         TargetSwitches^.SetCurrSelParam(source_os.shortname);
-         If DebugInfoSwitches^.GetCurrSelParam='-' then
-           DebugInfoSwitches^.SetCurrSelParam('l');
-       end;
-    end;
-  if not NeedRecompileExe then
-    NeedRecompileExe:=(not ExistsFile(ExeFile)) or (CompilationPhase<>cpDone) or
-     (PrevMainFile<>MainFile) or NeedRecompile(false);
-  if Not NeedRecompileExe and Not MainHasDebugInfo then
-    begin
-     ClearFormatParams;
-     cm:=ConfirmBox(msg_compiledwithoutdebuginforecompile,nil,true);
-     if cm=cmCancel then
-       Exit;
-     if cm=cmYes then
-       begin
-         { force recompilation }
-         PrevMainFile:='';
-         NeedRecompileExe:=true;
-         DebugInfoSwitches^.SetCurrSelParam('l');
-       end;
-    end;
-  if NeedRecompileExe then
-    DoCompile(cRun);
-  if CompilationPhase<>cpDone then
-    Exit;
-  if (EXEFile='') then
-   begin
-     ErrorBox(msg_nothingtodebug,nil);
-     Exit;
-   end;
-{$ifdef DEBUG}
-  PushStatus(msg_startingdebugger);
-{$endif DEBUG}
-{ init debugcontroller }
-  if assigned(Debugger) then
-   dispose(Debugger,Done);
-  new(Debugger,Init(ExeFile));
-{$ifdef GDBWINDOW}
-  InitGDBWindow;
-{$endif def GDBWINDOW}
-{$ifdef DEBUG}
-  PopStatus;
-{$endif DEBUG}
-end;
-
-
-procedure DoneDebugger;
-begin
-{$ifdef DEBUG}
-  { PushStatus('Closing debugger');
-    No its called after App.Done !! }
-{$endif}
-  if assigned(Debugger) then
-   dispose(Debugger,Done);
-  Debugger:=nil;
-{$ifdef DEBUG}
-  If Use_gdb_file then
-    Close(GDB_file);
-  Use_gdb_file:=false;
-  {PopStatus;}
-{$endif DEBUG}
-  {DoneGDBWindow;}
-end;
-
-procedure InitGDBWindow;
-var
-  R : TRect;
-begin
-  if GDBWindow=nil then
-    begin
-      DeskTop^.GetExtent(R);
-      new(GDBWindow,init(R));
-      DeskTop^.Insert(GDBWindow);
-    end;
-end;
-
-procedure DoneGDBWindow;
-begin
-  if assigned(GDBWindow) then
-    begin
-      DeskTop^.Delete(GDBWindow);
-      GDBWindow:=nil;
-    end;
-end;
-
-procedure InitStackWindow;
-begin
-  if StackWindow=nil then
-    begin
-      new(StackWindow,init);
-      DeskTop^.Insert(StackWindow);
-    end;
-end;
-
-procedure DoneStackWindow;
-begin
-  if assigned(StackWindow) then
-    begin
-      DeskTop^.Delete(StackWindow);
-      StackWindow:=nil;
-    end;
-end;
-
-procedure InitRegistersWindow;
-begin
-  if RegistersWindow=nil then
-    begin
-      new(RegistersWindow,init);
-      DeskTop^.Insert(RegistersWindow);
-    end;
-end;
-
-procedure DoneRegistersWindow;
-begin
-  if assigned(RegistersWindow) then
-    begin
-      DeskTop^.Delete(RegistersWindow);
-      RegistersWindow:=nil;
-    end;
-end;
-
-procedure InitBreakpoints;
-begin
-  New(BreakpointsCollection,init(10,10));
-end;
-
-procedure DoneBreakpoints;
-begin
-  Dispose(BreakpointsCollection,Done);
-  BreakpointsCollection:=nil;
-end;
-
-procedure InitWatches;
-begin
-  New(WatchesCollection,init);
-end;
-
-procedure DoneWatches;
-begin
-  Dispose(WatchesCollection,Done);
-  WatchesCollection:=nil;
-end;
-
-procedure RegisterFPDebugViews;
-begin
-  RegisterType(RWatchesWindow);
-  RegisterType(RBreakpointsWindow);
-  RegisterType(RWatchesListBox);
-  RegisterType(RBreakpointsListBox);
-  RegisterType(RStackWindow);
-  RegisterType(RFramesListBox);
-  RegisterType(RBreakpoint);
-  RegisterType(RWatch);
-  RegisterType(RBreakpointCollection);
-  RegisterType(RWatchesCollection);
-  RegisterType(RRegistersWindow);
-  RegisterType(RRegistersView);
-  RegisterType(RFPUWindow);
-  RegisterType(RFPUView);
-end;
-
-end.
-
-{
-  $Log$
-  Revision 1.6  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.10  2000/11/14 17:40:42  pierre
-   + External linking now optional
-
-  Revision 1.1.2.9  2000/11/14 09:23:55  marco
-   * Second batch
-
-  Revision 1.5  2000/11/13 17:37:41  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.8  2000/11/13 16:59:08  pierre
-   * some function in double removed from fputils unit
-
-  Revision 1.4  2000/10/31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.7  2000/10/31 07:47:54  pierre
-   * start to support FPC_BREAK_ERROR
-
-  Revision 1.1.2.6  2000/10/26 00:04:35  pierre
-   + gdb prompt and FPC_BREAK_ERROR stop
-
-  Revision 1.1.2.5  2000/10/09 19:48:15  pierre
-   * wrong commit corrected
-
-  Revision 1.1.2.4  2000/10/09 16:28:24  pierre
-   * several linux enhancements
-
-  Revision 1.3  2000/10/06 22:58:59  pierre
-   * fixes for linux GDB tty command (merged)
-
-  Revision 1.1.2.3  2000/10/06 22:52:34  pierre
-   * fixes for linux GDB tty command
-
-  Revision 1.2  2000/08/22 09:41:39  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.1  2000/07/18 05:50:22  michael
-  + Merged Gabors fixes
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.63  2000/06/22 09:07:11  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.62  2000/06/11 07:01:32  peter
-    * give watches window also a number
-    * leave watches window in the bottom when cascading windows
-
-  Revision 1.61  2000/05/02 08:42:27  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.60  2000/04/18 21:45:35  pierre
-   * Red line for breakpoint was off by one line
-
-  Revision 1.59  2000/04/18 11:42:36  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.58  2000/03/21 23:32:38  pierre
-   adapted to wcedit addition by Gabor
-
-  Revision 1.57  2000/03/14 14:22:30  pierre
-   + generate cmDebuggerStopped broadcast
-
-  Revision 1.56  2000/03/08 16:57:01  pierre
-    * Wrong highlighted line while debugging fixed
-    + Check if exe has debugging info
-
-  Revision 1.55  2000/03/07 21:52:54  pierre
-   + TDebugController.GetValue
-
-  Revision 1.54  2000/03/06 11:34:25  pierre
-   + windebug unit for Window Title change when debugging
-
-  Revision 1.53  2000/02/07 12:51:32  pierre
-   * typo fix
-
-  Revision 1.52  2000/02/07 11:50:30  pierre
-   Gabor changes for TP
-
-  Revision 1.51  2000/02/06 23:43:57  pierre
-   * breakpoint path problems fixes
-
-  Revision 1.50  2000/02/05 01:27:58  pierre
-    * bug with Toggle Break fixed, hopefully
-    + search for local vars in parent procs avoiding
-      wrong results (see test.pas source)
-
-  Revision 1.49  2000/02/04 23:18:05  pierre
-   * no pushstatus in DoneDebugger because its called after App.done
-
-  Revision 1.48  2000/02/04 14:34:46  pierre
-  readme.txt
-
-  Revision 1.47  2000/02/04 00:10:58  pierre
-   * Breakpoint line in Source Window better handled
-
-  Revision 1.46  2000/02/01 10:59:58  pierre
-   * allow FP to debug itself
-
-  Revision 1.45  2000/01/28 22:38:21  pierre
-   * CrtlF9 starts debugger if there are active breakpoints
-
-  Revision 1.44  2000/01/27 22:30:38  florian
-    * start of FPU window
-    * current executed line color has a higher priority then a breakpoint now
-
-  Revision 1.43  2000/01/20 00:31:53  pierre
-   * uses ShortName of exe to start GDB
-
-  Revision 1.42  2000/01/10 17:49:40  pierre
-   * Get RegisterView to Update correctly
-   * Write in white changed regs (keeping a copy of previous values)
-
-  Revision 1.41  2000/01/10 16:20:50  florian
-    * working register window
-
-  Revision 1.40  2000/01/10 13:20:57  pierre
-   + debug only possible on source target
-
-  Revision 1.39  2000/01/10 00:25:06  pierre
-   * RegisterWindow problem fixed
-
-  Revision 1.38  2000/01/09 21:05:51  florian
-    * some fixes for register view
-
-  Revision 1.37  2000/01/08 18:26:20  florian
-    + added a register window, doesn't work yet
-
-  Revision 1.36  1999/12/20 14:23:16  pierre
-    * MyApp renamed IDEApp
-    * TDebugController.ResetDebuggerRows added to
-      get resetting of debugger rows
-
-  Revision 1.35  1999/11/24 14:03:16  pierre
-   + Executing... in status line if in another window
-
-  Revision 1.34  1999/11/10 17:19:58  pierre
-   + Other window for Debuggee code
-
-  Revision 1.33  1999/10/25 16:39:03  pierre
-   + GetPChar to avoid nil pointer problems
-
-  Revision 1.32  1999/09/16 14:34:57  pierre
-    + TBreakpoint and TWatch registering
-    + WatchesCollection and BreakpointsCollection stored in desk file
-    * Syntax highlighting was broken
-
-  Revision 1.31  1999/09/13 16:24:43  peter
-    + clock
-    * backspace unident like tp7
-
-  Revision 1.30  1999/09/09 16:36:30  pierre
-   * Breakpoint storage problem corrected
-
-  Revision 1.29  1999/09/09 16:31:45  pierre
-   * some breakpoint related fixes and Help contexts
-
-  Revision 1.28  1999/09/09 14:20:05  pierre
-   + Stack Window
-
-  Revision 1.27  1999/08/24 22:04:33  pierre
-    + TCodeEditor.SetDebuggerRow
-      works like SetHighlightRow but is only disposed by a SetDebuggerRow(-1)
-      so the current stop point in debugging is not lost if
-      we move the cursor
-
-  Revision 1.26  1999/08/22 22:26:48  pierre
-   + Registration of Breakpoint/Watches windows
-
-  Revision 1.25  1999/08/16 18:25:15  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.24  1999/08/03 20:22:28  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.23  1999/07/28 23:11:17  peter
-    * fixes from gabor
-
-  Revision 1.22  1999/07/12 13:14:15  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.21  1999/07/11 00:35:14  pierre
-   * fix problems for wrong watches
-
-  Revision 1.20  1999/07/10 01:24:14  pierre
-   + First implementation of watches window
-
-  Revision 1.19  1999/06/30 23:58:12  pierre
-    + BreakpointsList Window implemented
-      with Edit/New/Delete functions
-    + Individual breakpoint dialog with support for all types
-      ignorecount and conditions
-      (commands are not yet implemented, don't know if this wolud be useful)
-      awatch and rwatch have problems because GDB does not annotate them
-      I fixed v4.16 for this
-
-  Revision 1.18  1999/03/16 00:44:42  peter
-    * forgotten in last commit :(
-
-  Revision 1.17  1999/03/02 13:48:28  peter
-    * fixed far problem is fpdebug
-    * tile/cascading with message window
-    * grep fixes
-
-  Revision 1.16  1999/03/01 15:41:52  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.15  1999/02/20 15:18:29  peter
-    + ctrl-c capture with confirm dialog
-    + ascii table in the tools menu
-    + heapviewer
-    * empty file fixed
-    * fixed callback routines in fpdebug to have far for tp7
-
-  Revision 1.14  1999/02/16 12:47:36  pierre
-   * GDBWindow does not popup on F7 or F8 anymore
-
-  Revision 1.13  1999/02/16 10:43:54  peter
-    * use -dGDB for the compiler
-    * only use gdb_file when -dDEBUG is used
-    * profiler switch is now a toggle instead of radiobutton
-
-  Revision 1.12  1999/02/11 19:07:20  pierre
-    * GDBWindow redesigned :
-      normal editor apart from
-      that any kbEnter will send the line (for begin to cursor)
-      to GDB command !
-      GDBWindow opened in Debugger Menu
-       still buggy :
-       -echo should not be present if at end of text
-       -GDBWindow becomes First after each step (I don't know why !)
-
-  Revision 1.11  1999/02/11 13:10:03  pierre
-   + GDBWindow only with -dGDBWindow for now : still buggy !!
-
-  Revision 1.10  1999/02/10 09:55:07  pierre
-    + added OldValue and CurrentValue field for watchpoints
-    + InitBreakpoints and DoneBreakpoints
-    + MessageBox if GDB stops bacause of a watchpoint !
-
-  Revision 1.9  1999/02/08 17:43:43  pierre
-    * RestDebugger or multiple running of debugged program now works
-    + added DoContToCursor(F4)
-    * Breakpoints are now inserted correctly (was mainlyy a problem
-      of directories)
-
-  Revision 1.8  1999/02/05 17:21:52  pierre
-    Invalid_line renamed InvalidSourceLine
-
-  Revision 1.7  1999/02/05 13:08:41  pierre
-   + new breakpoint types added
-
-  Revision 1.6  1999/02/05 12:11:53  pierre
-    + SourceDir that stores directories for sources that the
-      compiler should not know about
-      Automatically asked for addition when a new file that
-      needed filedialog to be found is in an unknown directory
-      Stored and retrieved from INIFile
-    + Breakpoints conditions added to INIFile
-    * Breakpoints insterted and removed at debin and end of debug session
-
-  Revision 1.5  1999/02/04 17:54:22  pierre
-   + several commands added
-
-  Revision 1.4  1999/02/04 13:32:02  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.3  1999/02/02 16:41:38  peter
-    + automatic .pas/.pp adding by opening of file
-    * better debuggerscreen changes
-
-  Revision 1.2  1999/01/22 18:14:09  pierre
-   * adaptd to changes in gdbint and gdbcon for  to /
-
-  Revision 1.1  1999/01/22 10:24:03  peter
-    * first debugger things
-
-}

+ 0 - 950
ide/text/fpdesk.pas

@@ -1,950 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Desktop loading/saving routines
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit FPDesk;
-
-interface
-
-const
-     DesktopVersion     = $0008; { <- if you change any Load&Store methods,
-                                      default object properties (Options,State)
-                                      then you should also change this }
-     ResDesktopFlags    = 'FLAGS';
-     ResVideo           = 'VIDEOMODE';
-     ResHistory         = 'HISTORY';
-     ResClipboard       = 'CLIPBOARD';
-     ResWatches         = 'WATCHES';
-     ResBreakpoints     = 'BREAKPOINTS';
-     ResDesktop         = 'DESKTOP';
-     ResSymbols         = 'SYMBOLS';
-     ResCodeComplete    = 'CODECOMPLETE';
-     ResCodeTemplates   = 'CODETEMPLATES';
-
-procedure InitDesktopFile;
-function  LoadDesktop: boolean;
-function  SaveDesktop: boolean;
-procedure DoneDesktopFile;
-function  WriteSymbolsFile(const filename : string): boolean;
-function  ReadSymbolsFile(const filename : string): boolean;
-
-implementation
-
-uses Dos,
-     Objects,Drivers,Video,
-     Views,App,HistList,BrowCol,
-     WUtils,WResourc,WViews,WEditor,
-{$ifndef NODEBUG}
-     fpdebug,
-{$endif ndef NODEBUG}
-     FPConst,FPVars,FPString,FPUtils,FPViews,FPHelp,
-     FPCodCmp,FPCodTmp;
-
-type
-     TWindowInfo = packed record
-       HelpCtx   : word;
-       Bounds    : TRect;
-       Visible   : boolean;
-       ExtraDataSize : word;
-       TitleLen  : word;
-       Title     : packed record end;
-     end;
-
-procedure InitDesktopFile;
-begin
-  if DesktopLocation=dlCurrentDir then
-    DesktopPath:=FExpand(DesktopName)
-  else
-    DesktopPath:=FExpand(DirOf(IniFileName)+DesktopName);
-end;
-
-procedure DoneDesktopFile;
-begin
-end;
-
-function ReadHistory(F: PResourceFile): boolean;
-var S: PMemoryStream;
-    OK: boolean;
-begin
-  PushStatus(msg_readinghistory);
-  New(S, Init(32*1024,4096));
-  OK:=F^.ReadResourceEntryToStream(resHistory,langDefault,S^);
-  S^.Seek(0);
-  if OK then
-    LoadHistory(S^);
-  Dispose(S, Done);
-  if OK=false then
-    ErrorBox(msg_errorloadinghistory,nil);
-  PopStatus;
-  ReadHistory:=OK;
-end;
-
-function WriteHistory(F: PResourceFile): boolean;
-var S: PMemoryStream;
-    OK: boolean;
-begin
-  PushStatus(msg_storinghistory);
-
-  New(S, Init(10*1024,4096));
-  StoreHistory(S^);
-  S^.Seek(0);
-  F^.CreateResource(resHistory,rcBinary,0);
-  OK:=F^.AddResourceEntryFromStream(resHistory,langDefault,0,S^,S^.GetSize);
-  Dispose(S, Done);
-  if OK=false then
-    ErrorBox(msg_errorstoringhistory,nil);
-  PopStatus;
-  WriteHistory:=OK;
-end;
-
-(*function ReadClipboard(F: PResourceFile): boolean;
-begin
-  ReadClipboard:=true;
-end;
-
-function WriteClipboard(F: PResourceFile): boolean;
-var S: PMemoryStream;
-begin
-  if Assigned(Clipboard) then
-  begin
-    PushStatus('Storing clipboard content...');
-
-    New(S, Init(10*1024,4096));
-    Clipboard^.SaveToStream(S^);
-    S^.Seek(0);
-    F^.CreateResource(resClipboard,rcBinary,0);
-    F^.AddResourceEntryFromStream(resClipboard,langDefault,0,S^,S^.GetSize);
-    Dispose(S, Done);
-    PopStatus;
-  end;
-  WriteClipboard:=true;
-end;*)
-
-function ReadWatches(F: PResourceFile): boolean;
-{$ifndef NODEBUG}
-var S: PMemoryStream;
-    OK: boolean;
-    OWC : PWatchesCollection;
-{$endif}
-begin
-{$ifndef NODEBUG}
-  PushStatus(msg_readingwatches);
-  New(S, Init(32*1024,4096));
-  OK:=F^.ReadResourceEntryToStream(resWatches,langDefault,S^);
-  S^.Seek(0);
-  if OK then
-    begin
-      OWC:=WatchesCollection;
-      WatchesCollection:=PWatchesCollection(S^.Get);
-      OK:=(S^.Status=stOK);
-      if OK and assigned(OWC) and assigned(WatchesCollection) then
-        Dispose(OWC,Done)
-      else if assigned(OWC) then
-        WatchesCollection:=OWC;
-    end;
-  if OK=false then
-    ErrorBox(msg_errorloadingwatches,nil);
-  ReadWatches:=OK;
-  Dispose(S, Done);
-  PopStatus;
-{$else NODEBUG}
-  ReadWatches:=true;
-{$endif NODEBUG}
-end;
-
-function WriteWatches(F: PResourceFile): boolean;
-var
-  S : PMemoryStream;
-  OK : boolean;
-begin
-{$ifndef NODEBUG}
-  if not assigned(WatchesCollection) then
-{$endif NODEBUG}
-    WriteWatches:=true
-{$ifndef NODEBUG}
-  else
-    begin
-      PushStatus(msg_storingwatches);
-      New(S, Init(30*1024,4096));
-      S^.Put(WatchesCollection);
-      S^.Seek(0);
-      F^.CreateResource(resWatches,rcBinary,0);
-      OK:=F^.AddResourceEntryFromStream(resWatches,langDefault,0,S^,S^.GetSize);
-      Dispose(S, Done);
-      if OK=false then
-        ErrorBox(msg_errorstoringwatches,nil);
-      PopStatus;
-      WriteWatches:=OK;
-    end;
-{$endif NODEBUG}
-end;
-
-function ReadBreakpoints(F: PResourceFile): boolean;
-{$ifndef NODEBUG}
-var S: PMemoryStream;
-    OK: boolean;
-    OBC : PBreakpointCollection;
-{$endif}
-begin
-{$ifndef NODEBUG}
-  PushStatus(msg_readingbreakpoints);
-  New(S, Init(32*1024,4096));
-  OK:=F^.ReadResourceEntryToStream(resBreakpoints,langDefault,S^);
-  S^.Seek(0);
-  if OK then
-    begin
-      OBC:=BreakpointsCollection;
-      BreakpointsCollection:=PBreakpointCollection(S^.get);
-      OK:=(S^.Status=stOK);
-
-      If OK and assigned(OBC) and assigned(BreakpointsCollection) then
-        Begin
-          Dispose(OBC,Done);
-          BreakpointsCollection^.ShowAllBreakpoints;
-        end
-      else if assigned(OBC) then
-        BreakpointsCollection:=OBC;
-    end;
-  if OK=false then
-    ErrorBox(msg_errorloadingbreakpoints,nil);
-  ReadBreakpoints:=OK;
-  Dispose(S, Done);
-  PopStatus;
-{$else NODEBUG}
-  ReadBreakpoints:=true;
-{$endif NODEBUG}
-end;
-
-function WriteBreakpoints(F: PResourceFile): boolean;
-var
-  S : PMemoryStream;
-  OK : boolean;
-begin
-{$ifndef NODEBUG}
-  if not assigned(BreakpointsCollection) then
-{$endif NODEBUG}
-    WriteBreakPoints:=true
-{$ifndef NODEBUG}
-  else
-    begin
-      PushStatus(msg_storingbreakpoints);
-      New(S, Init(30*1024,4096));
-      BreakpointsCollection^.Store(S^);
-      S^.Seek(0);
-      F^.CreateResource(resBreakpoints,rcBinary,0);
-      OK:=F^.AddResourceEntryFromStream(resBreakpoints,langDefault,0,S^,S^.GetSize);
-      Dispose(S, Done);
-      if OK=false then
-        ErrorBox(msg_errorstoringbreakpoints,nil);
-      WriteBreakPoints:=OK;
-      PopStatus;
-    end;
-{$endif NODEBUG}
-end;
-
-function ReadOpenWindows(F: PResourceFile): boolean;
-var S: PMemoryStream;
-    OK: boolean;
-    W: word;
-    WI: TWindowInfo;
-    Title: string;
-    XDataOfs: word;
-    XData: array[0..1024] of byte;
-procedure GetData(var B; Size: word);
-begin
-  Move(XData[XDataOfs],B,Size);
-  Inc(XDataOfs,Size);
-end;
-procedure ProcessWindowInfo;
-var W: PWindow;
-    SW: PSourceWindow absolute W;
-    St: string;
-    TP,TP2: TPoint;
-    L: longint;
-    R: TRect;
-begin
-  XDataOfs:=0;
-  W:=SearchWindow(Title);
-  case WI.HelpCtx of
-    hcSourceWindow :
-      begin
-        GetData(St[0],1);
-        GetData(St[1],ord(St[0]));
-        W:=ITryToOpenFile(@WI.Bounds,St,0,0,false,false,true);
-        if Assigned(W)=false then
-          begin
-            ClearFormatParams;
-            AddFormatParamStr(St);
-            ErrorBox(msg_cantopenfile,@FormatParams);
-          end
-        else
-        begin
-          GetData(L,sizeof(L)); SW^.Editor^.SetFlags(L);
-          GetData(TP,sizeof(TP)); GetData(TP2,sizeof(TP2));
-          SW^.Editor^.SetSelection(TP,TP2);
-          GetData(TP,sizeof(TP)); SW^.Editor^.SetCurPtr(TP.X,TP.Y);
-          GetData(TP,sizeof(TP)); SW^.Editor^.ScrollTo(TP.X,TP.Y);
-        end;
-      end;
-  end;
-  if W=nil then Exit;
-  W^.GetBounds(R);
-  if (R.A.X<>WI.Bounds.A.X) or (R.A.Y<>WI.Bounds.A.Y) then
-    R.Move(WI.Bounds.A.X-R.A.X,WI.Bounds.A.Y-R.A.Y);
-  if (W^.Flags and wfGrow)<>0 then
-    begin
-      R.B.X:=R.A.X+(WI.Bounds.B.X-WI.Bounds.A.X);
-      R.B.Y:=R.A.Y+(WI.Bounds.B.Y-WI.Bounds.A.Y);
-    end;
-  W^.Locate(R);
-  if W^.GetState(sfVisible)<>WI.Visible then
-    if WI.Visible then
-      W^.Show
-    else
-      W^.Hide;
-end;
-begin
-  PushStatus(msg_readingdesktopcontents);
-  New(S, Init(32*1024,4096));
-  OK:=F^.ReadResourceEntryToStream(resDesktop,langDefault,S^);
-  S^.Seek(0);
-  if OK then
-  begin
-    S^.Read(W,SizeOf(W));
-    OK:=(W=DesktopVersion);
-    if OK=false then
-      ErrorBox(msg_invaliddesktopversionlayoutlost,nil);
-  end;
-  if OK then
-    begin
-      XDataOfs:=0;
-      repeat
-        S^.Read(WI,sizeof(WI));
-        if S^.Status=stOK then
-        begin
-          Title[0]:=chr(WI.TitleLen);
-          S^.Read(Title[1],WI.TitleLen);
-          if WI.ExtraDataSize>0 then
-          S^.Read(XData,WI.ExtraDataSize);
-          ProcessWindowInfo;
-        end;
-      until S^.Status<>stOK;
-(*      TempDesk:=PFPDesktop(S^.Get);
-      OK:=Assigned(TempDesk);
-      if OK then
-        begin
-          Dispose(Desktop, Done);
-          Desktop:=TempDesk;
-
-          with Desktop^ do
-          begin
-            GetSubViewPtr(S^,CompilerMessageWindow);
-            GetSubViewPtr(S^,CompilerStatusDialog);
-            GetSubViewPtr(S^,ClipboardWindow);
-            if Assigned(ClipboardWindow) then Clipboard:=ClipboardWindow^.Editor;
-            GetSubViewPtr(S^,CalcWindow);
-            GetSubViewPtr(S^,ProgramInfoWindow);
-            GetSubViewPtr(S^,GDBWindow);
-            GetSubViewPtr(S^,BreakpointsWindow);
-            GetSubViewPtr(S^,WatchesWindow);
-            GetSubViewPtr(S^,UserScreenWindow);
-            GetSubViewPtr(S^,ASCIIChart);
-            GetSubViewPtr(S^,MessagesWindow); LastToolMessageFocused:=nil;
-          end;
-          Application^.GetExtent(R);
-          Inc(R.A.Y);Dec(R.B.Y);
-          DeskTop^.Locate(R);
-          Application^.Insert(Desktop);
-          Desktop^.ReDraw;
-          Message(Application,evBroadcast,cmUpdate,nil);
-        end;*)
-      if OK=false then
-        ErrorBox(msg_errorloadingdesktop,nil);
-    end;
-  Dispose(S, Done);
-  PopStatus;
-  ReadOpenWindows:=OK;
-end;
-
-function WriteOpenWindows(F: PResourceFile): boolean;
-var S: PMemoryStream;
-procedure CollectInfo(P: PView); {$ifndef FPC}far;{$endif}
-var W: PWindow;
-    SW: PSourceWindow absolute W;
-    WI: TWindowInfo;
-    Title: string;
-    XDataOfs: word;
-    XData: array[0..1024] of byte;
-    St: string;
-    TP: TPoint;
-    L: longint;
-procedure AddData(const B; Size: word);
-begin
-  Move(B,XData[XDataOfs],Size);
-  Inc(XDataOfs,Size);
-end;
-begin
-  XDataOfs:=0;
-  W:=nil;
-  if (P^.HelpCtx=hcSourceWindow) or
-     (P^.HelpCtx=hcHelpWindow) or
-     (P^.HelpCtx=hcClipboardWindow) or
-     (P^.HelpCtx=hcCalcWindow) or
-     (P^.HelpCtx=hcInfoWindow) or
-     (P^.HelpCtx=hcBrowserWindow) or
-     (P^.HelpCtx=hcMessagesWindow) or
-     (P^.HelpCtx=hcGDBWindow) or
-     (P^.HelpCtx=hcBreakpointListWindow) or
-     (P^.HelpCtx=hcASCIITableWindow)
-   then
-     W:=PWindow(P);
-
-  if Assigned(W) and (P^.HelpCtx=hcSourceWindow) then
-    if SW^.Editor^.FileName='' then
-      W:=nil;
-
-  if W=nil then Exit;
-  FillChar(WI,sizeof(WI),0);
-  Title:=W^.GetTitle(255);
-  WI.HelpCtx:=W^.HelpCtx;
-  W^.GetBounds(WI.Bounds);
-  WI.Visible:=W^.GetState(sfVisible);
-
-  case WI.HelpCtx of
-    hcSourceWindow :
-      begin
-        St:=SW^.Editor^.FileName; AddData(St,length(St)+1);
-        L:=SW^.Editor^.GetFlags; AddData(L,sizeof(L));
-        TP:=SW^.Editor^.SelStart; AddData(TP,sizeof(TP));
-        TP:=SW^.Editor^.SelEnd; AddData(TP,sizeof(TP));
-        TP:=SW^.Editor^.CurPos; AddData(TP,sizeof(TP));
-        TP:=SW^.Editor^.Delta; AddData(TP,sizeof(TP));
-      end;
-  end;
-
-  WI.TitleLen:=length(Title);
-  WI.ExtraDataSize:=XDataOfs;
-  S^.Write(WI,sizeof(WI));
-  S^.Write(Title[1],WI.TitleLen);
-  if WI.ExtraDataSize>0 then
-    S^.Write(XData,WI.ExtraDataSize);
-end;
-var W: word;
-    OK: boolean;
-    PV: PView;
-begin
-  PushStatus(msg_storingdesktopcontents);
-
-  New(S, Init(30*1024,4096));
-  OK:=Assigned(S);
-  if OK then
-  begin
-    W:=DesktopVersion;
-    S^.Write(W,SizeOf(W));
-{    S^.Put(Desktop);
-    with Desktop^ do
-    begin
-      PutSubViewPtr(S^,CompilerMessageWindow);
-      PutSubViewPtr(S^,CompilerStatusDialog);
-      PutSubViewPtr(S^,ClipboardWindow);
-      PutSubViewPtr(S^,CalcWindow);
-      PutSubViewPtr(S^,ProgramInfoWindow);
-      PutSubViewPtr(S^,GDBWindow);
-      PutSubViewPtr(S^,BreakpointsWindow);
-      PutSubViewPtr(S^,WatchesWindow);
-      PutSubViewPtr(S^,UserScreenWindow);
-      PutSubViewPtr(S^,ASCIIChart);
-      PutSubViewPtr(S^,MessagesWindow);
-    end;}
-{    PV:=Application^.Last;
-    while PV<>nil do
-    begin
-      CollectInfo(PV);
-      PV:=PV^.PrevView;
-    end;}
-    PV:=Desktop^.Last;
-    while PV<>nil do
-    begin
-      CollectInfo(PV);
-      PV:=PV^.PrevView;
-    end;
-    OK:=(S^.Status=stOK);
-    if OK then
-    begin
-      S^.Seek(0);
-      OK:=F^.CreateResource(resDesktop,rcBinary,0);
-      OK:=OK and F^.AddResourceEntryFromStream(resDesktop,langDefault,0,S^,S^.GetSize);
-    end;
-    Dispose(S, Done);
-  end;
-  if OK=false then
-    ErrorBox(msg_errorstoringdesktop,nil);
-  PopStatus;
-  WriteOpenWindows:=OK;
-end;
-
-function WriteFlags(F: PResourceFile): boolean;
-var
-    OK: boolean;
-begin
-  F^.CreateResource(resDesktopFlags,rcBinary,0);
-  OK:=F^.AddResourceEntry(resDesktopFlags,langDefault,0,DesktopFileFlags,
-    SizeOf(DesktopFileFlags));
-  if OK=false then
-    ErrorBox(msg_errorwritingflags,nil);
-  WriteFlags:=OK;
-end;
-
-function ReadCodeComplete(F: PResourceFile): boolean;
-var S: PMemoryStream;
-    OK: boolean;
-begin
-  PushStatus(msg_readingcodecompletewordlist);
-  New(S, Init(1024,1024));
-  OK:=F^.ReadResourceEntryToStream(resCodeComplete,langDefault,S^);
-  S^.Seek(0);
-  if OK then
-    OK:=LoadCodeComplete(S^);
-  Dispose(S, Done);
-  if OK=false then
-    ErrorBox(msg_errorloadingcodecompletewordlist,nil);
-  PopStatus;
-  ReadCodeComplete:=OK;
-end;
-
-function WriteCodeComplete(F: PResourceFile): boolean;
-var OK: boolean;
-    S: PMemoryStream;
-begin
-  PushStatus(msg_storingcodecompletewordlist);
-  New(S, Init(1024,1024));
-  OK:=StoreCodeComplete(S^);
-  if OK then
-  begin
-    S^.Seek(0);
-    F^.CreateResource(resCodeComplete,rcBinary,0);
-    OK:=F^.AddResourceEntryFromStream(resCodeComplete,langDefault,0,S^,S^.GetSize);
-  end;
-  Dispose(S, Done);
-  if OK=false then
-    ErrorBox(msg_errorstoringcodecompletewordlist,nil);
-  PopStatus;
-  WriteCodeComplete:=OK;
-end;
-
-function ReadCodeTemplates(F: PResourceFile): boolean;
-var S: PMemoryStream;
-    OK: boolean;
-begin
-  PushStatus(msg_readingcodetemplates);
-  New(S, Init(1024,4096));
-  OK:=F^.ReadResourceEntryToStream(resCodeTemplates,langDefault,S^);
-  S^.Seek(0);
-  if OK then
-    OK:=LoadCodeTemplates(S^);
-  Dispose(S, Done);
-  if OK=false then
-    ErrorBox(msg_errorloadingcodetemplates,nil);
-  PopStatus;
-  ReadCodeTemplates:=OK;
-end;
-
-function WriteCodeTemplates(F: PResourceFile): boolean;
-var OK: boolean;
-    S: PMemoryStream;
-begin
-  PushStatus(msg_storingcodetemplates);
-  New(S, Init(1024,4096));
-  OK:=StoreCodeTemplates(S^);
-  if OK then
-  begin
-    S^.Seek(0);
-    F^.CreateResource(resCodeTemplates,rcBinary,0);
-    OK:=F^.AddResourceEntryFromStream(resCodeTemplates,langDefault,0,S^,S^.GetSize);
-  end;
-  Dispose(S, Done);
-  if OK=false then
-    ErrorBox(msg_errorstoringcodetemplates,nil);
-  PopStatus;
-  WriteCodeTemplates:=OK;
-end;
-
-function ReadFlags(F: PResourceFile): boolean;
-var
-  size : sw_word;
-    OK: boolean;
-begin
-  OK:=F^.ReadResourceEntry(resDesktopFlags,langDefault,DesktopFileFlags,
-    size);
-  if OK=false then
-    ErrorBox(msg_errorreadingflags,nil);
-  ReadFlags:=OK;
-end;
-
-function WriteVideoMode(F: PResourceFile): boolean;
-var
-    OK: boolean;
-begin
-  F^.CreateResource(resVideo,rcBinary,0);
-  OK:=F^.AddResourceEntry(resVideo,langDefault,0,ScreenMode,
-    SizeOf(TVideoMode));
-  if OK=false then
-    ErrorBox(msg_errorstoringvideomode,nil);
-  WriteVideoMode:=OK;
-end;
-
-function ReadVideoMode(F: PResourceFile;var NewScreenMode : TVideoMode): boolean;
-var
-  size : sw_word;
-  OK,test : boolean;
-begin
-  size:=SizeOf(TVideoMode);
-  test:=F^.ReadResourceEntry(resVideo,langDefault,NewScreenMode,
-    size);
-  if not test then
-    NewScreenMode:=ScreenMode;
-  OK:=test and (size = SizeOf(TVideoMode));
-  if OK=false then
-    ErrorBox(msg_errorreadingvideomode,nil);
-  ReadVideoMode:=OK;
-end;
-
-function ReadSymbols(F: PResourceFile): boolean;
-var S: PMemoryStream;
-    OK: boolean;
-    R: PResource;
-begin
-  { if no symbols stored ... no problems }
-  R:=F^.FindResource(resSymbols);
-  if not Assigned(R) then
-    exit;
-  PushStatus(msg_readingsymbolinformation);
-  New(S, Init(32*1024,4096));
-  OK:=F^.ReadResourceEntryToStream(resSymbols,langDefault,S^);
-  S^.Seek(0);
-  if OK then
-    OK:=LoadBrowserCol(S);
-  Dispose(S, Done);
-  if OK=false then
-    ErrorBox(msg_errorloadingsymbolinformation,nil);
-  PopStatus;
-  ReadSymbols:=OK;
-end;
-
-function WriteSymbols(F: PResourceFile): boolean;
-var S: PMemoryStream;
-    OK: boolean;
-begin
-  OK:=Assigned(Modules);
-
-  if OK then
-  begin
-    PushStatus(msg_storingsymbolinformation);
-
-    New(S, Init(200*1024,4096));
-    OK:=Assigned(S);
-    if OK then
-      OK:=StoreBrowserCol(S);
-    if OK then
-      begin
-        S^.Seek(0);
-        F^.CreateResource(resSymbols,rcBinary,0);
-        OK:=F^.AddResourceEntryFromStream(resSymbols,langDefault,0,S^,S^.GetSize);
-      end;
-    Dispose(S, Done);
-    if OK=false then
-      ErrorBox(msg_errorstoringsymbolinformation,nil);
-    PopStatus;
-  end;
-  WriteSymbols:=OK;
-end;
-
-function LoadDesktop: boolean;
-var OK,VOK: boolean;
-    F: PResourceFile;
-    VM : TVideoMode;
-begin
-  PushStatus(msg_readingdesktopfile);
-  New(F, LoadFile(DesktopPath));
-
-  OK:=false;
-
-  if Assigned(F) then
-  begin
-    OK:=ReadFlags(F);
-    VOK:=ReadVideoMode(F,VM);
-    if VOK and ((VM.Col<>ScreenMode.Col) or
-       (VM.Row<>ScreenMode.Row) or (VM.Color<>ScreenMode.Color)) then
-      begin
-        if Assigned(Application) then
-          Application^.SetScreenVideoMode(VM);
-      end;
-    if ((DesktopFileFlags and dfHistoryLists)<>0) then
-      OK:=OK and ReadHistory(F);
-    if ((DesktopFileFlags and dfWatches)<>0) then
-      OK:=OK and ReadWatches(F);
-    if ((DesktopFileFlags and dfBreakpoints)<>0) then
-      OK:=OK and ReadBreakpoints(F);
-    if ((DesktopFileFlags and dfOpenWindows)<>0) then
-      OK:=OK and ReadOpenWindows(F);
-    { no errors if no browser info available PM }
-    if ((DesktopFileFlags and dfSymbolInformation)<>0) then
-      OK:=OK and ReadSymbols(F);
-    if ((DesktopFileFlags and dfCodeCompleteWords)<>0) then
-      OK:=OK and ReadCodeComplete(F);
-    if ((DesktopFileFlags and dfCodeTemplates)<>0) then
-      OK:=OK and ReadCodeTemplates(F);
-    Dispose(F, Done);
-  end;
-
-  PopStatus;
-  LoadDesktop:=OK;
-end;
-
-function SaveDesktop: boolean;
-var OK: boolean;
-    F: PResourceFile;
-    TempPath: string;
-begin
-  TempPath:=DirOf(DesktopPath)+DesktopTempName;
-  PushStatus(msg_writingdesktopfile);
-  New(F, CreateFile(TempPath));
-
-  if Assigned(Clipboard) then
-    if (DesktopFileFlags and dfClipboardContent)<>0 then
-      Clipboard^.SetFlags(Clipboard^.GetFlags or efStoreContent)
-    else
-      Clipboard^.SetFlags(Clipboard^.GetFlags and not efStoreContent);
-  OK:=false;
-
-  if Assigned(F) then
-    begin
-      OK:=WriteFlags(F);
-      OK:=OK and WriteVideoMode(F);
-      if ((DesktopFileFlags and dfHistoryLists)<>0) then
-        OK:=OK and WriteHistory(F);
-      if ((DesktopFileFlags and dfWatches)<>0) then
-        OK:=OK and WriteWatches(F);
-      if ((DesktopFileFlags and dfBreakpoints)<>0) then
-        OK:=OK and WriteBreakpoints(F);
-      if ((DesktopFileFlags and dfOpenWindows)<>0) then
-        OK:=OK and WriteOpenWindows(F);
-      { no errors if no browser info available PM }
-      if ((DesktopFileFlags and dfSymbolInformation)<>0) then
-        OK:=OK and (WriteSymbols(F) or not Assigned(Modules));
-      if ((DesktopFileFlags and dfCodeCompleteWords)<>0) then
-        OK:=OK and WriteCodeComplete(F);
-      if ((DesktopFileFlags and dfCodeTemplates)<>0) then
-        OK:=OK and WriteCodeTemplates(F);
-      Dispose(F, Done);
-    end;
-  if OK then
-    begin
-      if ExistsFile(DesktopPath) then
-        OK:=EraseFile(DesktopPath);
-      OK:=OK and RenameFile(TempPath,DesktopPath);
-      if OK=false then
-        ErrorBox(msg_failedtoreplacedesktopfile,nil);
-    end;
-  PopStatus;
-  SaveDesktop:=OK;
-end;
-
-function  WriteSymbolsFile(const filename : string): boolean;
-var OK: boolean;
-    F: PResourceFile;
-begin
-  WriteSymbolsFile:=false;
-  If not assigned(Modules) then
-    exit;
-  New(F, CreateFile(FileName));
-  OK:=Assigned(F);
-  if OK and ((DesktopFileFlags and dfSymbolInformation)<>0) then
-    OK:=OK and WriteSymbols(F);
-  if assigned(F) then
-    Dispose(F,Done);
-  WriteSymbolsFile:=OK;
-end;
-
-function  ReadSymbolsFile(const FileName : string): boolean;
-var OK: boolean;
-    F: PResourceFile;
-begin
-  ReadSymbolsFile:=false;
-  { Don't read again !! }
-  If assigned(Modules) then
-    exit;
-  New(F, LoadFile(FileName));
-  OK:=Assigned(F);
-  if OK and ((DesktopFileFlags and dfSymbolInformation)<>0) then
-      OK:=OK and ReadSymbols(F);
-  if assigned(F) then
-    Dispose(F,Done);
-  ReadSymbolsFile:=OK;
-end;
-
-END.
-{
-  $Log$
-  Revision 1.3  2000-10-31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.3  2000/10/18 21:53:26  pierre
-   * several Gabor fixes
-
-  Revision 1.1.2.2  2000/09/18 13:20:54  pierre
-   New bunch of Gabor changes
-
-  Revision 1.2  2000/08/22 09:41:39  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.1  2000/07/20 11:02:15  michael
-  + Fixes from gabor. See fixes.txt
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.29  2000/06/22 09:07:12  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.28  2000/05/02 08:42:27  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.27  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.26  2000/04/18 11:42:36  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.25  2000/03/21 23:32:05  pierre
-   adapted to wcedit addition by Gabor
-
-  Revision 1.24  2000/03/20 19:19:46  pierre
-   * LFN support in streams
-
-  Revision 1.23  2000/03/13 20:36:52  pierre
-   * Breakpoints saved and loaded before sources
-
-  Revision 1.22  2000/02/07 12:03:48  pierre
-   Last commit is from Gabor's changes!
-
-  Revision 1.21  2000/02/07 11:55:27  pierre
-   + Code Complete and Template saving from Gabor
-
-  Revision 1.20  2000/02/04 00:12:57  pierre
-   * Breakpoint are marked in source at desktop loading
-
-  Revision 1.19  2000/01/25 00:26:36  pierre
-   + Browser info saving
-
-  Revision 1.18  2000/01/03 11:38:33  michael
-  Changes from Gabor
-
-  Revision 1.17  1999/12/20 00:30:56  pierre
-   * problem with VideoMode storing solved
-
-  Revision 1.16  1999/12/10 13:02:05  pierre
-  + VideoMode save/restore
-
-  Revision 1.15  1999/11/26 17:09:51  pierre
-   * Force Desktop into Screen
-
-  Revision 1.14  1999/11/25 00:25:43  pierre
-   * add Status when loading/saving files
-
-  Revision 1.13  1999/09/20 15:37:59  pierre
-   * ReadOpenWindows and ReadSymobls was missing, still does not work correctly :(
-
-  Revision 1.12  1999/09/17 16:41:10  pierre
-   * other stream error for Watches/Breakpoints corrected
-
-  Revision 1.11  1999/09/17 16:28:58  pierre
-   * ResWatches in WriteBreakpoints typo !
-
-  Revision 1.10  1999/09/16 14:34:58  pierre
-    + TBreakpoint and TWatch registering
-    + WatchesCollection and BreakpointsCollection stored in desk file
-    * Syntax highlighting was broken
-
-  Revision 1.9  1999/09/07 09:23:00  pierre
-   * no errors if no browser info available
-
-  Revision 1.8  1999/08/16 18:25:16  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.7  1999/08/03 20:22:30  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.5  1999/06/30 23:58:13  pierre
-    + BreakpointsList Window implemented
-      with Edit/New/Delete functions
-    + Individual breakpoint dialog with support for all types
-      ignorecount and conditions
-      (commands are not yet implemented, don't know if this wolud be useful)
-      awatch and rwatch have problems because GDB does not annotate them
-      I fixed v4.16 for this
-
-  Revision 1.4  1999/04/15 08:58:05  peter
-    * syntax highlight fixes
-    * browser updates
-
-  Revision 1.3  1999/04/07 21:55:45  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.2  1999/03/23 16:16:39  peter
-    * linux fixes
-
-  Revision 1.1  1999/03/23 15:11:28  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-}

+ 0 - 757
ide/text/fphelp.pas

@@ -1,757 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Help routines for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit FPHelp;
-
-interface
-
-uses
-  Drivers,HelpCtx,
-  WHelp,WHlpView,WHTML,
-{$ifdef EDITORS}
-  Editors,
-{$else}
-  WEditor,WCEdit,
-{$endif}
-  WViews,WHTMLScn,
-  FPViews;
-
-type
-    PIDEStatusLine = ^TIDEStatusLine;
-    TIDEStatusLine = object(TAdvancedStatusLine)
-      function  Hint(AHelpCtx: Word): String; virtual;
-      procedure HandleEvent(var Event: TEvent); virtual;
-    end;
-
-    PFPHTMLFileLinkScanner = ^TFPHTMLFileLinkScanner;
-    TFPHTMLFileLinkScanner = object(THTMLFileLinkScanner)
-       function    CheckURL(const URL: string): boolean; virtual;
-       function    CheckText(const Text: string): boolean; virtual;
-       procedure   ProcessDoc(Doc: PHTMLLinkScanFile); virtual;
-    end;
-
-procedure Help(FileID, Context: THelpCtx; Modal: boolean);
-procedure HelpIndex(Keyword: string);
-procedure HelpTopicSearch(Editor: PEditor);
-procedure HelpTopic(const S: string);
-procedure CloseHelpWindows;
-
-procedure InitHelpSystem;
-procedure DoneHelpSystem;
-
-procedure InitHelpFiles;
-procedure DoneHelpFiles;
-
-procedure PushStatus(S: string);
-procedure SetStatus(S: string);
-procedure ClearStatus;
-procedure PopStatus;
-
-const
-      HelpWindow     : PFPHelpWindow = nil;
-      HelpInited     : boolean = false;
-
-implementation
-
-uses Objects,Views,App,MsgBox,Commands,
-     WUtils,WHTMLHlp,WNGHelp,WOS2Help,
-     FPString,FPConst,FPVars,FPUtils;
-
-const
-    MaxStatusLevel = {$ifdef FPC}10{$else}1{$endif};
-
-var StatusStack : array[0..MaxStatusLevel] of string[MaxViewWidth];
-
-const
-      StatusStackPtr  : integer = 0;
-
-procedure TIDEStatusLine.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-        cmUpdate : Update;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TIDEStatusLine.Hint(AHelpCtx: Word): String;
-var S: string;
-begin
-  case AHelpCtx of
-    hcNoContext     : S:='';
-
-    hcDragging      : S:='';
-
-    hcSourceWindow  : S:='';
-    hcHelpWindow    : S:='';
-    hcCalcWindow    : S:='';
-    hcInfoWindow    : S:='';
-    hcClipboardWindow:S:='';
-    hcBrowserWindow : S:='';
-    hcMessagesWindow: S:='';
-    hcASCIITableWindow: S:='';
-    hcGDBWindow     : S:=hint_rawgdbwindow;
-    hcBreakpointListWindow : S:=hint_allbreakpoints;
-
-    hcSystemMenu    : S:=hint_systemmenu;
-    hcUpdate        : S:=hint_update;
-    hcAbout         : S:=hint_about;
-
-    hcFileMenu      : S:=hint_filemenu;
-    hcNew           : S:=hint_filenew;
-    hcNewFromTemplate:S:=hint_filenewfromtemplate;
-    hcOpen          : S:=hint_fileopen;
-    hcSave          : S:=hint_filesave;
-    hcSaveAs        : S:=hint_filesaveas;
-    hcSaveAll       : S:=hint_filesaveall;
-    hcChangeDir     : S:=hint_changedir;
-    hcDOSShell      : S:=hint_dosshell;
-    hcQuit          : S:=hint_exit;
-    hcRecentFileBase..hcRecentFileBase+10
-                    : S:=hint_openrecentfile;
-
-    hcEditMenu      : S:=hint_editmenu;
-    hcUndo          : S:=hint_editundo;
-    hcRedo          : S:=hint_editredo;
-    hcCut           : S:=hint_editcut;
-    hcCopy          : S:=hint_editcopy;
-    hcPaste         : S:=hint_editpaste;
-    hcCopyWin       : S:=hint_editcopywin;
-    hcPasteWin      : S:=hint_editpastewin;
-    hcClear         : S:=hint_editclear;
-    hcShowClipboard : S:=hint_showclipboard;
-
-    hcSearchMenu    : S:=hint_searchmenu;
-    hcFind          : S:=hint_searchfind;
-    hcReplace       : S:=hint_searchreplace;
-    hcSearchAgain   : S:=hint_searchagain;
-    hcGotoLine      : S:=hint_gotoline;
-    hcObjects       : S:=hint_objects;
-    hcModules       : S:=hint_modules;
-    hcGlobals       : S:=hint_globals;
-    hcSymbol        : S:=hint_symbol;
-    hcRunMenu       : S:=hint_runmenu;
-    hcRun           : S:=hint_run;
-    hcParameters    : S:=hint_runparameters;
-    hcResetDebugger : S:=hint_resetprogram;
-    hcContToCursor  : S:=hint_rununtilcursor;
-    hcUntilReturn   : S:=hint_rununtilreturn;
-    hcUserScreen    : S:=hint_userscreen;
-
-    hcCompileMenu   : S:=hint_compilemenu;
-    hcCompile       : S:=hint_compile;
-    hcMake          : S:=hint_make;
-    hcBuild         : S:=hint_build;
-    hcTarget        : S:=hint_target;
-    hcPrimaryFile   : S:=hint_primaryfile;
-    hcClearPrimary  : S:=hint_clearprimaryfile;
-    hcInformation   : S:=hint_information;
-    hcCompilerMessages:S:=hint_showmessages;
-
-    hcDebugMenu     : S:=hint_debugmenu;
-    hcToggleBreakpoint : S:=hint_togglebreakpoint;
-    hcNewBreakpoint    : S:=hint_createnewbreakpoint;
-    hcEditBreakpoint   : S:=hint_editbreakpoint;
-    hcDeleteBreakpoint : S:=hint_deletebreakpoint;
-    hcOpenGDBWindow : S:=hint_opengdbwindow;
-    hcAddWatch      : S:=hint_addwatch;
-    hcWatches       : S:=hint_watches;
-    hcStack         : S:=hint_callstack;
-    hcBreakpointList : S:=hint_editbreakpoints;
-    hcToolsMenu     : S:=hint_toolsmenu;
-    hcCalculator    : S:=hint_calculator;
-    hcGrep          : S:=hint_grep;
-    hcMsgGotoSource : S:=hint_gotosource;
-    hcRegisters     : S:=hint_registers;
-
-    hcToolsMessages : S:=hint_messageswindow;
-    hcToolsBase..
-    hcToolsBase+MaxToolCount
-                    : S:=hint_usertool;
-    hcASCIITable    : S:=hint_asciitable;
-
-    hcOptionsMenu   : S:=hint_optionsmenu;
-    hcSwitchesMode  : S:=hint_switchesmode;
-    hcCompiler      : S:=hint_compiler;
-    hcMemorySizes   : S:=hint_memorysizes;
-    hcLinker        : S:=hint_linkeroptions;
-    hcDebugger      : S:=hint_debugoptions;
-    hcDirectories   : S:=hint_directories;
-    hcBrowser       : S:=hint_browser;
-    hcTools         : S:=hint_tools;
-
-    hcEnvironmentMenu:S:=hint_environmentmenu;
-    hcPreferences   : S:=hint_preferences;
-    hcEditor        : S:=hint_editoroptions;
-    hcCodeCompleteOptions:S:=hint_codecomplete;
-    hcCodeTemplateOptions:S:=hint_codetemplates;
-    hcMouse         : S:=hint_mouseoptions;
-    hcDesktopOptions: S:=hint_desktopoptions;
-    hcStartup       : S:=hint_startup;
-    hcColors        : S:=hint_colors;
-    hcOpenINI       : S:=hint_openini;
-    hcSaveINI       : S:=hint_saveini;
-    hcSaveAsINI     : S:=hint_saveasini;
-
-    hcWindowMenu    : S:=hint_windowmenu;
-    hcTile          : S:=hint_tile;
-    hcCascade       : S:=hint_cascade;
-    hcCloseAll      : S:=hint_closeall;
-    hcResize        : S:=hint_resize;
-    hcZoom          : S:=hint_zoom;
-    hcNext          : S:=hint_next;
-    hcPrev          : S:=hint_prev;
-    hcClose         : S:=hint_closewindow;
-    hcWindowList    : S:=hint_windowlist;
-    hcUserScreenWindow:S:=hint_userscreenwindow;
-
-    hcHelpMenu      : S:=hint_helpmenu;
-    hcHelpContents  : S:=hint_helpcontents;
-    hcHelpIndex     : S:=hint_helpindex;
-    hcHelpTopicSearch:S:=hint_helptopicsearch;
-    hcHelpPrevTopic : S:=hint_helpprevtopic;
-    hcHelpUsingHelp : S:=hint_helphowtouse;
-    hcHelpFiles     : S:=hint_helpfiles;
-
-    hcOpenAtCursor  : S:=hint_openatcursor;
-    hcBrowseAtCursor: S:=hint_browseatcursor;
-    hcEditorOptions : S:=hint_editoroptionscur;
-  else S:='???';
-  end;
-  Hint:=S;
-end;
-
-procedure TFPHTMLFileLinkScanner.ProcessDoc(Doc: PHTMLLinkScanFile);
-begin
-  PushStatus(FormatStrStr(msg_indexingfile,Doc^.GetDocumentURL));
-  inherited ProcessDoc(Doc);
-  PopStatus;
-end;
-
-function TFPHTMLFileLinkScanner.CheckURL(const URL: string): boolean;
-var OK: boolean;
-const HTTPPrefix = 'http:';
-      FTPPrefix  = 'ftp:';
-begin
-  OK:=inherited CheckURL(URL);
-  if OK then OK:=DirAndNameOf(URL)<>'';
-  if OK then OK:=CompareText(copy(ExtOf(URL),1,4),'.HTM')=0;
-  if OK then OK:=CompareText(copy(URL,1,length(HTTPPrefix)),HTTPPrefix)<>0;
-  if OK then OK:=CompareText(copy(URL,1,length(FTPPrefix)),FTPPrefix)<>0;
-  CheckURL:=OK;
-end;
-
-function TFPHTMLFileLinkScanner.CheckText(const Text: string): boolean;
-var OK: boolean;
-    S: string;
-begin
-  S:=Trim(Text);
-  OK:=(S<>'') and (copy(S,1,1)<>'[');
-  CheckText:=OK;
-end;
-
-procedure InitHelpSystem;
-
-  procedure AddOAFile(HelpFile: string);
-  begin
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile+' ('+SmartPath(HelpFile)+')');{$ENDIF}
-    if HelpFacility^.AddOAHelpFile(HelpFile)=false then
-      ErrorBox(FormatStrStr(msg_failedtoloadhelpfile,HelpFile),nil);
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile);{$ENDIF}
-  end;
-
-  procedure AddHTMLFile(TOCEntry,HelpFile: string);
-  begin
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile+' ('+SmartPath(HelpFile)+')');{$ENDIF}
-    if HelpFacility^.AddHTMLHelpFile(HelpFile, TOCEntry)=false then
-      ErrorBox(FormatStrStr(msg_failedtoloadhelpfile,HelpFile),nil);
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile);{$ENDIF}
-  end;
-
-  procedure AddNGFile(HelpFile: string);
-  begin
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile+' ('+SmartPath(HelpFile)+')');{$ENDIF}
-    if HelpFacility^.AddNGHelpFile(HelpFile)=false then
-      ErrorBox(FormatStrStr(msg_failedtoloadhelpfile,HelpFile),nil);
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile);{$ENDIF}
-  end;
-
-  procedure AddOS2File(HelpFile: string);
-  begin
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile+' ('+SmartPath(HelpFile)+')');{$ENDIF}
-    if HelpFacility^.AddOS2HelpFile(HelpFile)=false then
-      ErrorBox(FormatStrStr(msg_failedtoloadhelpfile,HelpFile),nil);
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile);{$ENDIF}
-  end;
-
-  procedure AddWinHelpFile(HelpFile: string);
-  begin
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile+' ('+SmartPath(HelpFile)+')');{$ENDIF}
-    if HelpFacility^.AddWinHelpFile(HelpFile)=false then
-      ErrorBox(FormatStrStr(msg_failedtoloadhelpfile,HelpFile),nil);
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile);{$ENDIF}
-  end;
-
-  procedure AddHTMLIndexFile(HelpFile: string);
-  begin
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile+' ('+SmartPath(HelpFile)+')');{$ENDIF}
-    if HelpFacility^.AddHTMLIndexHelpFile(HelpFile)=false then
-      ErrorBox(FormatStrStr(msg_failedtoloadhelpfile,HelpFile),nil);
-    {$IFDEF DEBUG}SetStatus(msg_LoadingHelpFile);{$ENDIF}
-  end;
-
-var I,P: sw_integer;
-    S: string;
-    TopicTitle: string;
-begin
-  New(HelpFacility, Init);
-  PushStatus(msg_LoadingHelpFiles);
-  for I:=0 to HelpFiles^.Count-1 do
-    begin
-      S:=HelpFiles^.At(I)^; TopicTitle:='';
-      P:=Pos('|',S);
-      if P>0 then
-        begin TopicTitle:=copy(S,P+1,High(S)); S:=copy(S,1,P-1); end;
-      if TopicTitle='' then TopicTitle:=S;
-      if copy(UpcaseStr(ExtOf(S)),1,length(HTMLExt))=UpcaseStr(HTMLExt) then { this recognizes both .htm and .html }
-          AddHTMLFile(TopicTitle,S) else
-      if UpcaseStr(ExtOf(S))=UpcaseStr(HTMLIndexExt) then
-          AddHTMLIndexFile(S) else
-      if UpcaseStr(ExtOf(S))=UpcaseStr(NGExt) then
-          AddNGFile(S) else
-      if UpcaseStr(ExtOf(S))=UpcaseStr(INFExt) then
-          AddOS2File(S) else
-      if UpcaseStr(ExtOf(S))=UpcaseStr(WinHelpExt) then
-          AddWinHelpFile(S) else
-        AddOAFile(S);
-    end;
-  PopStatus;
-end;
-
-procedure CheckHelpSystem;
-begin
-  if HelpInited then Exit;
-  InitHelpSystem;
-  HelpInited:=true;
-end;
-
-procedure DoneHelpSystem;
-begin
-  if assigned(HelpFacility) then
-    begin
-      Dispose(HelpFacility, Done);
-      HelpFacility:=nil;
-    end;
-  HelpInited:=false;
-end;
-
-procedure HelpCreateWindow;
-var R: TRect;
-begin
-  CheckHelpSystem;
-  if HelpWindow=nil then
-  begin
-     Desktop^.GetExtent(R); R.Grow(-15,-3); Dec(R.A.Y);
-     New(HelpWindow, Init(R, dialog_help, 0, 0, SearchFreeWindowNo));
-     if HelpWindow<>nil then
-     begin
-       HelpWindow^.Hide;
-       Desktop^.Insert(HelpWindow);
-     end;
-  end;
-end;
-
-procedure Help(FileID, Context: THelpCtx; Modal: boolean);
-begin
-  if Modal then
-     begin MessageBox(msg_modalhelpnotimplemented,nil,mfInformation+mfInsertInApp+mfOKButton); Exit; end;
-  HelpCreateWindow;
-  with HelpWindow^ do
-  begin
-    HelpWindow^.ShowTopic(0,Context);
-    if GetState(sfVisible)=false then Show;
-    MakeFirst;
-  end;
-  Message(Application,evCommand,cmUpdate,nil);
-end;
-
-procedure HelpTopicSearch(Editor: PEditor);
-var S: string;
-begin
-  if Editor=nil then S:='' else
-  S:=GetEditorCurWord(Editor,[]);
-  HelpTopic(S);
-end;
-
-procedure HelpTopic(const S: string);
-var FileID: word;
-    Ctx   : THelpCtx;
-var Found: boolean;
-begin
-  CheckHelpSystem;
-  PushStatus(msg_LocatingTopic);
-  Found:=HelpFacility^.TopicSearch(S,FileID,Ctx);
-  PopStatus;
-  if Found then
-     Help(FileID,Ctx,false)
-  else
-     HelpIndex(S);
-end;
-
-procedure HelpIndex(Keyword: string);
-begin
-  HelpCreateWindow;
-  with HelpWindow^ do
-  begin
-    PushStatus(msg_BuildingHelpIndex);
-    HelpWindow^.ShowIndex;
-    if Keyword<>'' then
-       HelpWindow^.HelpView^.Lookup(Keyword);
-    PopStatus;
-    if GetState(sfVisible)=false then Show;
-    MakeFirst;
-  end;
-  Message(Application,evCommand,cmUpdate,nil);
-end;
-
-procedure PushStatus(S: string);
-begin
-  if StatusLine=nil then
-    Exit;
-  If StatusStackPtr<=MaxStatusLevel then
-    StatusStack[StatusStackPtr]:=PAdvancedStatusLine(StatusLine)^.GetStatusText
-  else
-    StatusStack[MaxStatusLevel]:=PAdvancedStatusLine(StatusLine)^.GetStatusText;
-  SetStatus(S);
-  Inc(StatusStackPtr);
-end;
-
-procedure PopStatus;
-begin
-  if StatusLine=nil then
-    Exit;
-  Dec(StatusStackPtr);
-  If StatusStackPtr<=MaxStatusLevel then
-    SetStatus(StatusStack[StatusStackPtr])
-  else
-    SetStatus(StatusStack[MaxStatusLevel]);
-end;
-
-procedure SetStatus(S: string);
-begin
-  if StatusLine=nil then
-    Exit;
-  PAdvancedStatusLine(StatusLine)^.SetStatusText(S);
-end;
-
-procedure ClearStatus;
-begin
-  PAdvancedStatusLine(StatusLine)^.ClearStatusText;
-end;
-
-function FPHTMLGetSectionColor(Section: THTMLSection; var Color: byte): boolean;
-var OK: boolean;
-    S: string;
-begin
-  Color:=0;
-  OK:=(ord(Section) in [1..length(CHTMLSectionAttrs)]);
-  if OK then
-  begin
-    S:=#0;
-    S:=copy(CHTMLSectionAttrs,ord(Section),1);
-    if Assigned(Application)=false then Color:=0 else
-    Color:=Application^.GetColor(ord(S[1]));
-    if (Color and $0f) = ((Color and $f0) shr 4) then { same color ? }
-      OK:=false;
-  end;
-  FPHTMLGetSectionColor:=OK;
-end;
-
-function FPNGGetAttrColor(Attr: char; var Color: byte): boolean;
-var OK: boolean;
-begin
-  OK:=false;
-  case Attr of
-    'A' : OK:=FPHTMLGetSectionColor(hsHeading1,Color);
-    'B' : OK:=FPHTMLGetSectionColor(hsHeading2,Color);
-    'b' : OK:=FPHTMLGetSectionColor(hsHeading5,Color);
-    'U' : OK:=FPHTMLGetSectionColor(hsHeading3,Color);
-    'N' : OK:=FPHTMLGetSectionColor(hsHeading4,Color);
-  {$ifdef DEBUGMSG}
-  else ErrorBox('Unknown attr encountered : "'+Attr+'"',nil);
-  {$endif}
-  end;
-  FPNGGetAttrColor:=OK;
-end;
-
-function FPINFGetAttrColor(TextStyle, TextColor: byte; var Color: byte): boolean;
-var OK: boolean;
-begin
-  OK:=false;
-  case TextColor of
-    1 : OK:=FPHTMLGetSectionColor(hsHeading1,Color);
-    2 : OK:=FPHTMLGetSectionColor(hsHeading2,Color);
-    3 : OK:=FPHTMLGetSectionColor(hsHeading3,Color);
-  end;
-  FPINFGetAttrColor:=OK;
-end;
-
-procedure InitHelpFiles;
-begin
-  HTMLGetSectionColor:={$ifdef FPC}@{$endif}FPHTMLGetSectionColor;
-  NGGetAttrColor:={$ifdef FPC}@{$endif}FPNGGetAttrColor;
-  INFGetAttrColor:={$ifdef FPC}@{$endif}FPINFGetAttrColor;
-  New(HelpFiles, Init(10,10));
-end;
-
-procedure DoneHelpFiles;
-begin
-  if assigned(HelpFiles) then
-    Dispose(HelpFiles, Done);
-end;
-
-procedure CloseHelpWindows;
-procedure CloseIfHelpWindow(P: PView); {$ifndef FPC}far;{$endif}
-begin
-  if P^.HelpCtx=hcHelpWindow then
-    begin
-      Message(P,evCommand,cmClose,nil);
-      Dispose(P, Done); { help windows are only hidden on close so we've
-                          to destroy them manually }
-    end;
-end;
-begin
-  Desktop^.ForEach(@CloseIfHelpWindow);
-end;
-
-END.
-{
-  $Log$
-  Revision 1.3  2000-10-31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.2  2000/09/18 13:20:54  pierre
-   New bunch of Gabor changes
-
-  Revision 1.2  2000/08/22 09:41:39  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.1  2000/08/15 03:40:53  peter
-   [*] no more fatal exits when the IDE can't find the error file (containing
-       the redirected assembler/linker output) after compilation
-   [*] hidden windows are now added always at the end of the Window List
-   [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
-   [*] selection was incorrectly adjusted when typing in overwrite mode
-   [*] the line wasn't expanded when it's end was reached in overw. mode
-   [*] the IDE now tries to locate source files also in the user specified
-       unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
-   [*] 'Open at cursor' is now aware of the extension (if specified)
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.35  2000/06/26 07:29:23  pierre
-   * new bunch of Gabor's changes
-
-  Revision 1.34  2000/06/22 09:07:12  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.33  2000/06/16 08:50:40  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.32  2000/05/30 07:18:33  pierre
-   + colors for HTML help by Gabor
-
-  Revision 1.31  2000/05/29 10:44:56  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.30  2000/05/02 08:42:27  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.29  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.28  2000/03/21 23:31:14  pierre
-   adapted to wcedit addition by Gabor
-
-  Revision 1.27  2000/02/07 11:58:01  pierre
-   Gabor's code inserted
-
-  Revision 1.26  2000/01/08 18:26:20  florian
-    + added a register window, doesn't work yet
-
-  Revision 1.25  2000/01/05 17:25:26  pierre
-   * typo error corrected
-
-  Revision 1.24  2000/01/03 11:38:33  michael
-  Changes from Gabor
-
-  Revision 1.23  1999/09/09 16:31:45  pierre
-   * some breakpoint related fixes and Help contexts
-
-  Revision 1.22  1999/09/09 14:15:27  pierre
-   + cmCopyWin,cmPasteWin
-
-  Revision 1.21  1999/08/16 18:25:17  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.20  1999/08/03 20:22:31  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.19  1999/07/12 13:14:17  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.18  1999/07/10 01:24:16  pierre
-   + First implementation of watches window
-
-  Revision 1.17  1999/06/30 23:58:14  pierre
-    + BreakpointsList Window implemented
-      with Edit/New/Delete functions
-    + Individual breakpoint dialog with support for all types
-      ignorecount and conditions
-      (commands are not yet implemented, don't know if this wolud be useful)
-      awatch and rwatch have problems because GDB does not annotate them
-      I fixed v4.16 for this
-
-  Revision 1.16  1999/06/28 19:32:19  peter
-    * fixes from gabor
-
-  Revision 1.15  1999/06/25 00:39:58  pierre
-   help for cmSymbol,cmAddWatch,cmStack and cmBreakpoint list
-
-  Revision 1.14  1999/04/07 21:55:46  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.13  1999/03/23 15:11:28  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.12  1999/03/16 12:38:09  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-  Revision 1.11  1999/03/01 15:41:53  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.10  1999/02/22 11:51:35  peter
-    * browser updates from gabor
-
-  Revision 1.9  1999/02/19 18:43:45  peter
-    + open dialog supports mask list
-
-  Revision 1.8  1999/02/11 19:07:21  pierre
-    * GDBWindow redesigned :
-      normal editor apart from
-      that any kbEnter will send the line (for begin to cursor)
-      to GDB command !
-      GDBWindow opened in Debugger Menu
-       still buggy :
-       -echo should not be present if at end of text
-       -GDBWindow becomes First after each step (I don't know why !)
-
-  Revision 1.7  1999/02/08 17:40:01  pierre
-   + cmContToCursor added
-
-  Revision 1.6  1999/02/08 10:37:43  peter
-    + html helpviewer
-
-  Revision 1.5  1999/02/04 12:23:44  pierre
-    + cmResetDebugger and cmGrep
-    * Avoid StatusStack overflow
-
-  Revision 1.4  1999/01/21 11:54:13  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.3  1999/01/04 11:49:44  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.2  1998/12/28 15:47:44  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.3  1998/12/22 10:39:42  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 1508
ide/text/fpide.pas

@@ -1,1508 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Main IDEApp object
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit fpide;
-interface
-
-{$i globdir.inc}
-
-uses
-  Objects,Drivers,Views,App,Gadgets,MsgBox,
-  {$ifdef EDITORS}Editors,{$else}WEditor,WCEdit,{$endif}
-  Comphook,Browcol,
-  WHTMLScn,
-  FPViews,FPSymbol,fpstring;
-
-type
-    TExecType = (exNormal,exNoSwap,exDosShell);
-
-    TIDEApp = object(TApplication)
-      constructor Init;
-      procedure   InitDesktop; virtual;
-      procedure   InitMenuBar; virtual;
-      procedure   InitStatusLine; virtual;
-      procedure   Open(FileName: string);
-      function    OpenSearch(FileName: string) : boolean;
-      function    AskSaveAll: boolean;
-      function    SaveAll: boolean;
-      function    AutoSave: boolean;
-      procedure   Idle; virtual;
-      procedure   Update;
-      procedure   UpdateMode;
-      procedure   UpdateTarget;
-      procedure   GetEvent(var Event: TEvent); virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   GetTileRect(var R: TRect); virtual;
-      function    GetPalette: PPalette; virtual;
-      procedure   DosShell; {virtual;}
-      procedure   ShowReadme;
-      destructor  Done; virtual;
-      procedure   ShowUserScreen;
-      procedure   ShowIDEScreen;
-      function    IsClosing : boolean;
-    private
-      procedure NewEditor;
-      procedure NewFromTemplate;
-      procedure OpenRecentFile(RecentIndex: integer);
-      procedure ChangeDir;
-      procedure ShowClipboard;
-      procedure FindProcedure;
-      procedure Objects;
-      procedure Modules;
-      procedure Globals;
-      procedure SearchSymbol;
-      procedure Parameters;
-      procedure DoStepOver;
-      procedure DoTraceInto;
-      procedure DoRun;
-      procedure DoResetDebugger;
-      procedure DoContToCursor;
-      procedure DoContUntilReturn;
-      procedure Target;
-      procedure DoCompilerMessages;
-      procedure DoPrimaryFile;
-      procedure DoClearPrimary;
-      procedure DoUserScreenWindow;
-      procedure DoCloseUserScreenWindow;
-      procedure DoUserScreen;
-      procedure DoOpenGDBWindow;
-      procedure DoToggleBreak;
-      procedure DoShowCallStack;
-      procedure DoShowBreakpointList;
-      procedure DoShowWatches;
-      procedure DoAddWatch;
-      procedure DoShowRegisters;
-
-      procedure DoInformation;
-      procedure Messages;
-      procedure Calculator;
-      procedure DoAsciiTable;
-      procedure ExecuteTool(Idx: integer);
-      procedure SetSwitchesMode;
-      procedure DoCompilerSwitch;
-      procedure MemorySizes;
-      procedure DoLinkerSwitch;
-      procedure DoDebuggerSwitch;
-      procedure Directories;
-      procedure Tools;
-      procedure DoGrep;
-      procedure Preferences;
-      procedure EditorOptions(Editor: PEditor);
-      procedure CodeComplete;
-      procedure CodeTemplates;
-      procedure BrowserOptions(Browser: PBrowserWindow);
-      procedure DesktopOptions;
-      procedure Mouse;
-      procedure StartUp;
-      procedure Colors;
-      procedure OpenINI;
-      procedure SaveINI;
-      procedure SaveAsINI;
-      procedure CloseAll;
-      procedure WindowList;
-      procedure HelpContents;
-      procedure HelpHelpIndex;
-      procedure HelpTopicSearch;
-      procedure HelpPrevTopic;
-      procedure HelpUsingHelp;
-      procedure HelpFiles;
-      procedure About;
-    public
-      procedure SourceWindowClosed;
-    private
-      SaveCancelled: boolean;
-      InsideDone : boolean;
-      LastEvent: longint;
-      function  DoExecute(ProgramPath, Params, InFile, OutFile: string; ExecType: TExecType): boolean;
-      procedure AddRecentFile(AFileName: string; CurX, CurY: integer);
-      function  SearchRecentFile(AFileName: string): integer;
-      procedure RemoveRecentFile(Index: integer);
-      procedure CurDirChanged;
-      procedure UpdatePrimaryFile;
-      procedure UpdateINIFile;
-      procedure UpdateRecentFileList;
-      procedure UpdateTools;
-    end;
-
-procedure PutEvent(TargetView: PView; E: TEvent);
-procedure PutCommand(TargetView: PView; What, Command: Word; InfoPtr: Pointer);
-
-var
-  IDEApp: TIDEApp;
-
-implementation
-
-uses
-{$ifdef Unix}
-  linux,
-{$endif}
-{$ifdef HasSignal}
-  fpcatch,
-{$endif HasSignal}
-{$ifdef WinClipSupported}
-  WinClip,
-{$endif WinClipSupported}
-  Video,Mouse,Keyboard,
-  Dos,Memory,Menus,Dialogs,StdDlg,ColorSel,Commands,HelpCtx,
-  Systems,
-  WUtils,WHlpView,WViews,WHTMLHlp,
-  FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompil,FPHelp,
-  FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
-  FPDesk,FPCodCmp,FPCodTmp;
-
-type
-   TTargetedEvent = record
-     Target: PView;
-     Event: TEvent;
-   end;
-
-const
-     TargetedEventHead   : integer = 0;
-     TargetedEventTail   : integer = 0;
-var
-     TargetedEvents      : array[0..10] of TTargetedEvent;
-
-function IncTargetedEventPtr(I: integer): integer;
-begin
-  Inc(I);
-  if I>High(TargetedEvents) then I:=Low(TargetedEvents);
-  IncTargetedEventPtr:=I;
-end;
-
-procedure PutEvent(TargetView: PView; E: TEvent);
-begin
-  if IncTargetedEventPtr(TargetedEventHead)=TargetedEventTail then Exit;
-  with TargetedEvents[TargetedEventHead] do
-  begin
-    Target:=TargetView;
-    Event:=E;
-  end;
-  TargetedEventHead:=IncTargetedEventPtr(TargetedEventHead);
-end;
-
-procedure PutCommand(TargetView: PView; What, Command: Word; InfoPtr: Pointer);
-var E: TEvent;
-begin
-  FillChar(E,Sizeof(E),0);
-  E.What:=What;
-  E.Command:=Command;
-  E.InfoPtr:=InfoPtr;
-  PutEvent(TargetView,E);
-end;
-
-function GetTargetedEvent(var P: PView; var E: TEvent): boolean;
-var OK: boolean;
-begin
-  OK:=TargetedEventHead<>TargetedEventTail;
-  if OK then
-  begin
-    with TargetedEvents[TargetedEventTail] do
-    begin
-      P:=Target;
-      E:=Event;
-    end;
-    TargetedEventTail:=IncTargetedEventPtr(TargetedEventTail);
-  end;
-  GetTargetedEvent:=OK;
-end;
-
-function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
-begin
-  IDEUseSyntaxHighlight:=(Editor^.FileName='') or MatchesFileList(NameAndExtOf(Editor^.FileName),HighlightExts);
-end;
-
-function IDEUseTabsPattern(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
-begin
-  { the commented code lead all new files
-    to become with TAB use enabled which is wrong in my opinion PM }
-  IDEUseTabsPattern:={(Editor^.FileName='') or }MatchesFileList(NameAndExtOf(Editor^.FileName),TabsPattern);
-end;
-
-constructor TIDEApp.Init;
-var R: TRect;
-begin
-  {$ifndef EDITORS}
-{$ifdef TP}
-  UseSyntaxHighlight:=IDEUseSyntaxHighlight;
-  UseTabsPattern:=IDEUseTabsPattern;
-{$else TP}
-  UseSyntaxHighlight:=@IDEUseSyntaxHighlight;
-  UseTabsPattern:=@IDEUseTabsPattern;
-{$endif TP}
-  {$endif}
-  inherited Init;
-  InitAdvMsgBox;
-  InsideDone:=false;
-  MenuBar^.GetBounds(R); R.A.X:=R.B.X-8;
-  New(ClockView, Init(R));
-  ClockView^.GrowMode:=gfGrowLoX+gfGrowHiX;
-  Application^.Insert(ClockView);
-  New(ClipboardWindow, Init);
-  Desktop^.Insert(ClipboardWindow);
-  New(CalcWindow, Init); CalcWindow^.Hide;
-  Desktop^.Insert(CalcWindow);
-{$ifndef OLDCOMP}
-  New(CompilerMessageWindow, Init);
-  CompilerMessageWindow^.Hide;
-  Desktop^.Insert(CompilerMessageWindow);
-{$else}
-  New(ProgramInfoWindow, Init);
-  ProgramInfoWindow^.Hide;
-  Desktop^.Insert(ProgramInfoWindow);
-{$endif}
-  Message(@Self,evBroadcast,cmUpdate,nil);
-  CurDirChanged;
-  { heap viewer }
-  GetExtent(R); Dec(R.B.X); R.A.X:=R.B.X-9; R.A.Y:=R.B.Y-1;
-  New(HeapView, InitKb(R));
-  if (StartupOptions and soHeapMonitor)=0 then HeapView^.Hide;
-  Insert(HeapView);
-  Drivers.ShowMouse;
-end;
-
-procedure TIDEApp.InitDesktop;
-var
-  R: TRect;
-begin
-  GetExtent(R);
-  Inc(R.A.Y);
-  Dec(R.B.Y);
-  Desktop:=New(PFPDesktop, Init(R));
-end;
-
-procedure TIDEApp.InitMenuBar;
-var R: TRect;
-    WinPMI : PMenuItem;
-begin
-  GetExtent(R); R.B.Y:=R.A.Y+1;
-  WinPMI:=nil;
-{$ifdef WinClipSupported}
-  if WinClipboardSupported then
-    WinPMI:=NewLine(
-      NewItem(menu_edit_copywin,'', kbNoKey, cmCopyWin, hcCopyWin,
-      NewItem(menu_edit_pastewin,'', kbNoKey, cmPasteWin, hcPasteWin,
-      nil)));
-{$endif WinClipSupported}
-  MenuBar:=New(PAdvancedMenuBar, Init(R, NewMenu(
-    NewSubMenu(menu_file,hcFileMenu, NewMenu(
-      NewItem(menu_file_new,'',kbNoKey,cmNew,hcNew,
-      NewItem(menu_file_template,'',kbNoKey,cmNewFromTemplate,hcNewFromTemplate,
-      NewItem(menu_file_open,menu_key_file_open,kbF3,cmOpen,hcOpen,
-      NewItem(menu_file_save,menu_key_file_save,kbF2,cmSave,hcSave,
-      NewItem(menu_file_saveas,'',kbNoKey,cmSaveAs,hcSaveAs,
-      NewItem(menu_file_saveall,'',kbNoKey,cmSaveAll,hcSaveAll,
-      NewLine(
-      NewItem(menu_file_changedir,'',kbNoKey,cmChangeDir,hcChangeDir,
-      NewItem(menu_file_dosshell,'',kbNoKey,cmDOSShell,hcDOSShell,
-      NewItem(menu_file_exit,menu_key_file_exit,kbNoKey,cmQuit,hcQuit,
-      nil))))))))))),
-    NewSubMenu(menu_edit,hcEditMenu, NewMenu(
-      NewItem(menu_edit_undo,menu_key_edit_undo, kbAltBack, cmUndo, hcUndo,
-      NewItem(menu_edit_redo,'', kbNoKey, cmRedo, hcRedo,
-{$ifdef DebugUndo}
-      NewItem('~D~ump Undo','', kbNoKey, cmDumpUndo, hcUndo,
-      NewItem('U~n~do All','', kbNoKey, cmUndoAll, hcUndo,
-      NewItem('R~e~do All','', kbNoKey, cmRedoAll, hcRedo,
-{$endif DebugUndo}
-      NewLine(
-      NewItem(menu_edit_cut,menu_key_edit_cut, kbShiftDel, cmCut, hcCut,
-      NewItem(menu_edit_copy,menu_key_edit_copy, kbCtrlIns, cmCopy, hcCut,
-      NewItem(menu_edit_paste,menu_key_edit_paste, kbShiftIns, cmPaste, hcPaste,
-      NewItem(menu_edit_clear,menu_key_edit_clear, kbCtrlDel, cmClear, hcClear,
-      NewLine(
-      NewItem(menu_edit_showclipboard,'', kbNoKey, cmShowClipboard, hcShowClipboard,
-      WinPMI))))))
-{$ifdef DebugUndo}))){$endif DebugUndo}
-      )))),
-    NewSubMenu(menu_search,hcSearchMenu, NewMenu(
-      NewItem(menu_search_find,'', kbNoKey, cmFind, hcFind,
-      NewItem(menu_search_replace,'', kbNoKey, cmReplace, hcReplace,
-      NewItem(menu_search_searchagain,'', kbNoKey, cmSearchAgain, hcSearchAgain,
-      NewLine(
-      NewItem(menu_search_jumpline,'', kbNoKey, cmJumpLine, hcGotoLine,
-      NewItem(menu_search_findproc,'', kbNoKey, cmFindProcedure, hcFindProcedure,
-      NewLine(
-      NewItem(menu_search_objects,'', kbNoKey, cmObjects, hcObjects,
-      NewItem(menu_search_modules,'', kbNoKey, cmModules, hcModules,
-      NewItem(menu_search_globals,'', kbNoKey, cmGlobals, hcGlobals,
-      NewLine(
-      NewItem(menu_search_symbol,'', kbNoKey, cmSymbol, hcSymbol,
-      nil))))))))))))),
-    NewSubMenu(menu_run,hcRunMenu, NewMenu(
-      NewItem(menu_run_run,menu_key_run_run, kbCtrlF9, cmRun, hcRun,
-      NewItem(menu_run_stepover,menu_key_run_stepover, kbF8, cmStepOver, hcRun,
-      NewItem(menu_run_traceinto,menu_key_run_traceinto, kbF7, cmTraceInto, hcRun,
-      NewItem(menu_run_conttocursor,menu_key_run_conttocursor, kbF4, cmContToCursor, hcContToCursor,
-      NewItem(menu_run_untilreturn,'', kbNoKey,cmUntilReturn,hcUntilReturn,
-      NewItem(menu_run_parameters,'', kbNoKey, cmParameters, hcParameters,
-      NewItem(menu_run_resetdebugger,menu_key_run_resetdebugger, kbCtrlF2, cmResetDebugger, hcResetDebugger,
-      nil)))))))),
-    NewSubMenu(menu_compile,hcCompileMenu, NewMenu(
-      NewItem(menu_compile_compile,menu_key_compile_compile, kbAltF9, cmCompile, hcCompile,
-      NewItem(menu_compile_make,menu_key_compile_make, kbF9, cmMake, hcMake,
-      NewItem(menu_compile_build,'', kbNoKey, cmBuild, hcBuild,
-      NewLine(
-      NewItem(menu_compile_target,'', kbNoKey, cmTarget, hcTarget,
-      NewItem(menu_compile_primaryfile,'', kbNoKey, cmPrimaryFile, hcPrimaryFile,
-      NewItem(menu_compile_clearprimaryfile,'', kbNoKey, cmClearPrimary, hcClearPrimary,
-      NewLine(
-      NewItem(menu_compile_information,'', kbNoKey, cmInformation, hcInformation,
-      NewItem(menu_compile_compilermessages,menu_key_compile_compilermessages, kbF12, cmCompilerMessages, hcCompilerMessages,
-      nil))))))))))),
-    NewSubMenu(menu_debug, hcDebugMenu, NewMenu(
-      NewItem(menu_debug_output,'', kbNoKey, cmUserScreenWindow, hcUserScreenWindow,
-      NewItem(menu_debug_userscreen,menu_key_debug_userscreen, kbAltF5, cmUserScreen, hcUserScreen,
-      NewItem(menu_debug_breakpoint,menu_key_debug_breakpoint, kbCtrlF8, cmToggleBreakpoint, hcToggleBreakpoint,
-      NewItem(menu_debug_callstack,menu_key_debug_callstack, kbCtrlF3, cmStack, hcStack,
-      NewItem(menu_debug_registers,'', kbNoKey, cmRegisters, hcRegisters,
-      NewItem(menu_debug_addwatch,menu_key_debug_addwatch, kbCtrlF7, cmAddWatch, hcAddWatch,
-      NewItem(menu_debug_watches,'', kbNoKey, cmWatches, hcWatches,
-      NewItem(menu_debug_breakpointlist,'', kbNoKey, cmBreakpointList, hcBreakpointList,
-      NewLine(
-      NewItem(menu_debug_gdbwindow,'', kbNoKey, cmOpenGDBWindow, hcOpenGDBWindow,
-      nil))))))))))),
-    NewSubMenu(menu_tools, hcToolsMenu, NewMenu(
-      NewItem(menu_tools_messages,menu_key_tools_messages, kbF11, cmToolsMessages, hcToolsMessages,
-      NewItem(menu_tools_msgnext,menu_key_tools_msgnext, kbAltF8, cmToolsMsgNext, hcToolsMsgNext,
-      NewItem(menu_tools_msgprev,menu_key_tools_msgprev, kbAltF7, cmToolsMsgPrev, hcToolsMsgPrev,
-      NewLine(
-      NewItem(menu_tools_grep,menu_key_tools_grep, kbShiftF2, cmGrep, hcGrep,
-      NewItem(menu_tools_calculator, '', kbNoKey, cmCalculator, hcCalculator,
-      NewItem(menu_tools_asciitable, '', kbNoKey, cmAsciiTable, hcAsciiTable,
-      nil)))))))),
-    NewSubMenu(menu_options, hcOptionsMenu, NewMenu(
-      NewItem(menu_options_mode,'', kbNoKey, cmSwitchesMode, hcSwitchesMode,
-      NewItem(menu_options_compiler,'', kbNoKey, cmCompiler, hcCompiler,
-      NewItem(menu_options_memory,'', kbNoKey, cmMemorySizes, hcMemorySizes,
-      NewItem(menu_options_linker,'', kbNoKey, cmLinker, hcLinker,
-      NewItem(menu_options_debugger,'', kbNoKey, cmDebugger, hcDebugger,
-      NewItem(menu_options_directories,'', kbNoKey, cmDirectories, hcDirectories,
-      NewItem(menu_options_browser,'',kbNoKey, cmBrowser, hcBrowser,
-      NewItem(menu_options_tools,'', kbNoKey, cmTools, hcTools,
-      NewLine(
-      NewSubMenu(menu_options_env, hcEnvironmentMenu, NewMenu(
-        NewItem(menu_options_env_preferences,'', kbNoKey, cmPreferences, hcPreferences,
-        NewItem(menu_options_env_editor,'', kbNoKey, cmEditor, hcEditor,
-        NewItem(menu_options_env_codecomplete,'', kbNoKey, cmCodeCompleteOptions, hcCodeCompleteOptions,
-        NewItem(menu_options_env_codetemplates,'', kbNoKey, cmCodeTemplateOptions, hcCodeTemplateOptions,
-        NewItem(menu_options_env_desktop,'', kbNoKey, cmDesktopOptions, hcDesktopOptions,
-        NewItem(menu_options_env_mouse,'', kbNoKey, cmMouse, hcMouse,
-        NewItem(menu_options_env_startup,'', kbNoKey, cmStartup, hcStartup,
-        NewItem(menu_options_env_colors,'', kbNoKey, cmColors, hcColors,
-        nil))))))))),
-      NewLine(
-      NewItem(menu_options_open,'', kbNoKey, cmOpenINI, hcOpenINI,
-      NewItem(menu_options_save,'', kbNoKey, cmSaveINI, hcSaveINI,
-      NewItem(menu_options_saveas,'', kbNoKey, cmSaveAsINI, hcSaveAsINI,
-      nil))))))))))))))),
-    NewSubMenu(menu_window, hcWindowMenu, NewMenu(
-      NewItem(menu_window_tile,'', kbNoKey, cmTile, hcTile,
-      NewItem(menu_window_cascade,'', kbNoKey, cmCascade, hcCascade,
-      NewItem(menu_window_closeall,'', kbNoKey, cmCloseAll, hcCloseAll,
-      NewLine(
-      NewItem(menu_window_resize,menu_key_window_resize, kbCtrlF5, cmResize, hcResize,
-      NewItem(menu_window_zoom,menu_key_window_zoom, kbF5, cmZoom, hcZoom,
-      NewItem(menu_window_next,menu_key_window_next, kbF6, cmNext, hcNext,
-      NewItem(menu_window_previous,menu_key_window_previous, kbShiftF6, cmPrev, hcPrev,
-      NewItem(menu_window_hide,menu_key_window_hide, kbCtrlF6, cmHide, hcHide,
-      NewItem(menu_window_close,menu_key_window_close, kbAltF3, cmClose, hcClose,
-      NewLine(
-      NewItem(menu_window_list,menu_key_window_list, kbAlt0, cmWindowList, hcWindowList,
-      NewItem(menu_window_update,'', kbNoKey, cmUpdate, hcUpdate,
-      nil)))))))))))))),
-    NewSubMenu(menu_help, hcHelpMenu, NewMenu(
-      NewItem(menu_help_contents,'', kbNoKey, cmHelpContents, hcHelpContents,
-      NewItem(menu_help_index,menu_key_help_helpindex, kbShiftF1, cmHelpIndex, hcHelpIndex,
-      NewItem(menu_help_topicsearch,menu_key_help_topicsearch, kbCtrlF1, cmHelpTopicSearch, hcHelpTopicSearch,
-      NewItem(menu_help_prevtopic,menu_key_help_prevtopic, kbAltF1, cmHelpPrevTopic, hcHelpPrevTopic,
-      NewItem(menu_help_using,'',kbNoKey, cmHelpUsingHelp, hcHelpUsingHelp,
-      NewItem(menu_help_files,'',kbNoKey, cmHelpFiles, hcHelpFiles,
-      NewLine(
-      NewItem(menu_help_about,'',kbNoKey, cmAbout, hcAbout,
-      nil))))))))),
-    nil)))))))))))));
-  DisableCommands(EditorCmds+SourceCmds+CompileCmds);
-  Update;
-end;
-
-procedure TIDEApp.InitStatusLine;
-var
-  R: TRect;
-begin
-  GetExtent(R);
-  R.A.Y := R.B.Y - 1;
-  StatusLine:=New(PIDEStatusLine, Init(R,
-    NewStatusDef(hcDragging, hcDragging,
-      NewStatusKey(status_help, kbF1, cmHelp,
-      StdStatusKeys(
-      NewStatusKey('~'#24#25#26#27+'~ Move', kbNoKey, 65535,
-      NewStatusKey('~Shift+'#24#25#26#27+'~ Size', kbNoKey, 65535,
-      NewStatusKey('~'#17+'ÄÙ~ Done', kbNoKey, 65535,
-      NewStatusKey('~Esc~ Cancel', kbNoKey, 65535,
-      nil)))))),
-    NewStatusDef(hcFirstCommand, hcLastCommand,
-      NewStatusKey(status_help, kbF1, cmHelp,
-      StdStatusKeys(
-      nil)),
-    NewStatusDef(hcHelpWindow, hcHelpWindow,
-      NewStatusKey(status_help_on_help, kbF1, cmHelpUsingHelp,
-      NewStatusKey(status_help_previoustopic, kbAltF1, cmHelpPrevTopic,
-      NewStatusKey(status_help_index, kbShiftF1, cmHelpIndex,
-      NewStatusKey(status_help_close, kbEsc, cmClose,
-      StdStatusKeys(
-      nil))))),
-    NewStatusDef(hcSourceWindow, hcSourceWindow,
-      NewStatusKey(status_help, kbF1, cmHelp,
-      NewStatusKey(status_save, kbF2, cmSave,
-      NewStatusKey(status_open, kbF3, cmOpen,
-      NewStatusKey(status_compile, kbAltF9, cmCompile,
-      NewStatusKey(status_make, kbF9, cmMake,
-      NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
-      StdStatusKeys(
-      nil))))))),
-    NewStatusDef(hcASCIITableWindow, hcASCIITableWindow,
-      NewStatusKey(status_help, kbF1, cmHelp,
-      NewStatusKey(status_transferchar, kbCtrlEnter, cmTransfer,
-      StdStatusKeys(
-      nil))),
-    NewStatusDef(hcMessagesWindow, hcMessagesWindow,
-      NewStatusKey(status_help, kbF1, cmHelp,
-      NewStatusKey(status_msggotosource, kbEnter, cmMsgGotoSource,
-      NewStatusKey(status_msgtracksource, kbNoKey, cmMsgTrackSource,
-      NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
-      NewStatusKey('', kbEsc, cmClose,
-      StdStatusKeys(
-      nil)))))),
-    NewStatusDef(hcCalcWindow, hcCalcWindow,
-      NewStatusKey(status_help, kbF1, cmHelp,
-      NewStatusKey(status_close, kbEsc, cmClose,
-      NewStatusKey(status_calculatorpaste, kbCtrlEnter, cmCalculatorPaste,
-      StdStatusKeys(
-      nil)))),
-    NewStatusDef(0, $FFFF,
-      NewStatusKey(status_help, kbF1, cmHelp,
-      NewStatusKey(status_open, kbF3, cmOpen,
-      NewStatusKey(status_compile, kbAltF9, cmCompile,
-      NewStatusKey(status_make, kbF9, cmMake,
-      NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
-      StdStatusKeys(
-      nil)))))),
-    nil))))))))));
-end;
-
-procedure TIDEApp.Idle;
-begin
-  inherited Idle;
-  Message(Application,evIdle,0,nil);
-  GiveUpTimeSlice;
-end;
-
-procedure TIDEApp.GetEvent(var Event: TEvent);
-var P: PView;
-begin
-  { first of all dispatch queued targeted events }
-  while GetTargetedEvent(P,Event) do
-    P^.HandleEvent(Event);
-  inherited GetEvent(Event);
-  if Event.What<>evNothing then
-    LastEvent:=GetDosTicks
-  else
-    begin
-      if abs(GetDosTicks-LastEvent)>SleepTimeOut then
-        GiveUpTimeSlice;
-    end;
-end;
-
-procedure TIDEApp.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-    TempS: string;
-    ForceDlg: boolean;
-{$ifdef HasSignal}
-    CtrlCCatched : boolean;
-{$endif HasSignal}
-begin
-{$ifdef HasSignal}
-  if (Event.What=evKeyDown) and (Event.keyCode=kbCtrlC) and
-     (CtrlCPressed) then
-    begin
-      CtrlCCatched:=true;
-{$ifdef DEBUG}
-      Writeln(stderr,'One CtrlC caught');
-{$endif DEBUG}
-    end
-  else
-    CtrlCCatched:=false;
-{$endif HasSignal}
-  case Event.What of
-       evKeyDown :
-         begin
-           DontClear:=true;
-           { just for debugging purposes }
-         end;
-       evCommand :
-         begin
-           DontClear:=false;
-           case Event.Command of
-             cmUpdate        : Message(Application,evBroadcast,cmUpdate,nil);
-           { -- File menu -- }
-             cmNew           : NewEditor;
-             cmNewFromTemplate: NewFromTemplate;
-             cmOpen          : begin
-                                 ForceDlg:=false;
-                                 if (OpenFileName<>'') and
-                                    ((DirOf(OpenFileName)='') or (Pos(ListSeparator,OpenFileName)<>0)) then
-                                   begin
-                                     TempS:=LocateSourceFile(OpenFileName,false);
-                                     if TempS='' then
-                                       ForceDlg:=true
-                                     else
-                                       OpenFileName:=TempS;
-                                   end;
-                                 if ForceDlg then
-                                   OpenSearch(OpenFileName)
-                                 else
-                                   Open(OpenFileName);
-                                 OpenFileName:='';
-                               end;
-             cmSaveAll       : SaveAll;
-             cmChangeDir     : ChangeDir;
-             cmDOSShell      : DOSShell;
-             cmRecentFileBase..
-             cmRecentFileBase+10
-                             : OpenRecentFile(Event.Command-cmRecentFileBase);
-           { -- Edit menu -- }
-             cmShowClipboard : ShowClipboard;
-           { -- Search menu -- }
-             cmFindProcedure : FindProcedure;
-             cmObjects       : Objects;
-             cmModules       : Modules;
-             cmGlobals       : Globals;
-             cmSymbol        : SearchSymbol;
-           { -- Run menu -- }
-             cmParameters    : Parameters;
-             cmStepOver      : DoStepOver;
-             cmTraceInto     : DoTraceInto;
-             cmRun           : DoRun;
-             cmResetDebugger : DoResetDebugger;
-             cmContToCursor  : DoContToCursor;
-             cmUntilReturn   : DoContUntilReturn;
-           { -- Compile menu -- }
-             cmCompile       : DoCompile(cCompile);
-             cmBuild         : DoCompile(cBuild);
-             cmMake          : DoCompile(cMake);
-             cmTarget        : Target;
-             cmPrimaryFile   : DoPrimaryFile;
-             cmClearPrimary  : DoClearPrimary;
-             cmInformation   : DoInformation;
-             cmCompilerMessages : DoCompilerMessages;
-           { -- Debug menu -- }
-             cmUserScreen    : DoUserScreen;
-             cmToggleBreakpoint : DoToggleBreak;
-             cmStack         : DoShowCallStack;
-             cmBreakpointList : DoShowBreakpointList;
-             cmWatches       :  DoShowWatches;
-             cmAddWatch      :  DoAddWatch;
-             cmOpenGDBWindow : DoOpenGDBWindow;
-             cmRegisters     : DoShowRegisters;
-           { -- Options menu -- }
-             cmSwitchesMode  : SetSwitchesMode;
-             cmCompiler      : DoCompilerSwitch;
-             cmMemorySizes   : MemorySizes;
-             cmLinker        : DoLinkerSwitch;
-             cmDebugger      : DoDebuggerSwitch;
-             cmDirectories   : Directories;
-             cmTools         : Tools;
-             cmPreferences   : Preferences;
-             cmEditor        : EditorOptions(nil);
-             cmEditorOptions : EditorOptions(Event.InfoPtr);
-             cmCodeTemplateOptions: CodeTemplates;
-             cmCodeCompleteOptions: CodeComplete;
-             cmBrowser       : BrowserOptions(nil);
-             cmBrowserOptions : BrowserOptions(Event.InfoPtr);
-             cmMouse         : Mouse;
-             cmStartup       : StartUp;
-             cmDesktopOptions: DesktopOptions;
-             cmColors        : Colors;
-             cmOpenINI       : OpenINI;
-             cmSaveINI       : SaveINI;
-             cmSaveAsINI     : SaveAsINI;
-           { -- Tools menu -- }
-             cmToolsMessages : Messages;
-             cmCalculator    : Calculator;
-             cmAsciiTable    : DoAsciiTable;
-             cmGrep          : DoGrep;
-             cmToolsBase+1..
-             cmToolsBase+MaxToolCount
-                             : ExecuteTool(Event.Command-cmToolsBase);
-           { -- Window menu -- }
-             cmCloseAll      : CloseAll;
-             cmWindowList    : WindowList;
-             cmUserScreenWindow: DoUserScreenWindow;
-           { -- Help menu -- }
-             cmHelpContents  : HelpContents;
-             cmHelpIndex     : HelpHelpIndex;
-{             cmHelpTopicSearch: HelpTopicSearch;}
-             cmHelpPrevTopic : HelpPrevTopic;
-             cmHelpUsingHelp : HelpUsingHelp;
-             cmHelpFiles     : HelpFiles;
-             cmAbout         : About;
-             cmShowReadme    : ShowReadme;
-           else DontClear:=true;
-           end;
-           if DontClear=false then ClearEvent(Event);
-         end;
-       evBroadcast :
-         case Event.Command of
-           cmSaveCancelled :
-             SaveCancelled:=true;
-           cmUpdateTools :
-             UpdateTools;
-           cmCommandSetChanged :
-             UpdateMenu(MenuBar^.Menu);
-           cmUpdate              :
-             Update;
-           cmSourceWndClosing :
-             begin
-               with PSourceWindow(Event.InfoPtr)^ do
-                 if Editor^.FileName<>'' then
-                   AddRecentFile(Editor^.FileName,Editor^.CurPos.X,Editor^.CurPos.Y);
-               {$ifndef NODEBUG}
-               if assigned(Debugger) and (PView(Event.InfoPtr)=Debugger^.LastSource) then
-                 Debugger^.LastSource:=nil;
-               {$endif}
-             end;
-
-         end;
-  end;
-  inherited HandleEvent(Event);
-{$ifdef HasSignal}
-  { Reset flag if CrtlC was handled }
-  if CtrlCCatched and (Event.What=evNothing) then
-    begin
-      CtrlCPressed:=false;
-{$ifdef DEBUG}
-      Writeln(stderr,'One CtrlC handled');
-{$endif DEBUG}
-    end;
-{$endif HasSignal}
-end;
-
-
-procedure TIDEApp.GetTileRect(var R: TRect);
-begin
-  Desktop^.GetExtent(R);
-{ Leave the compiler messages window in the bottom }
-  if assigned(CompilerMessageWindow) and (CompilerMessageWindow^.GetState(sfVisible)) then
-   R.B.Y:=Min(CompilerMessageWindow^.Origin.Y,R.B.Y);
-{ Leave the messages window in the bottom }
-  if assigned(MessagesWindow) and (MessagesWindow^.GetState(sfVisible)) then
-   R.B.Y:=Min(MessagesWindow^.Origin.Y,R.B.Y);
-{ Leave the watch window in the bottom }
-  if assigned(WatchesWindow) and (WatchesWindow^.GetState(sfVisible)) then
-   R.B.Y:=Min(WatchesWindow^.Origin.Y,R.B.Y);
-end;
-
-
-{****************************************************************************
-                                 Switch Screens
-****************************************************************************}
-
-procedure TIDEApp.ShowUserScreen;
-begin
-{$ifdef Unix}
-  { We need to get the IDE screen's contents from the API's video buffer (JM) }
-  if assigned(userscreen) then
-    userscreen^.capture;
-{$endif Unix}
-  DoneSysError;
-  DoneEvents;
-  DoneKeyboard;
-  If UseMouse then
-    DoneMouse
-  else
-    ButtonCount:=0;
-{$ifndef go32v2}
-  DoneScreen; { this is available in FV app.pas (PFV) }
-{$endif go32v2}
-  DoneDosMem;
-
-  if Assigned(UserScreen) then
-    UserScreen^.SwitchTo;
-end;
-
-
-procedure TIDEApp.ShowIDEScreen;
-begin
-{$ifndef Unix}
-  { the video has to be initialized already for linux (JM) }
-  if Assigned(UserScreen) then
-    UserScreen^.SwitchBack;
-{$endif Unix}
-  InitDosMem;
-{$ifndef go32v2}
-  InitScreen;
-{$endif go32v2}
-  InitKeyboard;
-  If UseMouse then
-    InitMouse
-  else
-    ButtonCount:=0;
-  InitEvents;
-  InitSysError;
-  CurDirChanged;
-  Message(Application,evBroadcast,cmUpdate,nil);
-{$ifdef Unix}
-  if Assigned(UserScreen) then
-    UserScreen^.SwitchBack;
-{$endif Unix}
-{$ifndef go32v2}
-  UpdateScreen(true);
-{$endif go32v2}
-end;
-
-function TIDEApp.AutoSave: boolean;
-var IOK,SOK,DOK: boolean;
-begin
-  IOK:=true; SOK:=true; DOK:=true;
-  if (AutoSaveOptions and asEnvironment)<>0 then
-    begin
-      IOK:=WriteINIFile;
-      if IOK=false then
-        ErrorBox(error_saving_cfg_file,nil);
-    end;
-  if (AutoSaveOptions and asEditorFiles)<>0 then { was a typo here ("=0") - Gabor }
-      SOK:=SaveAll;
-  if (AutoSaveOptions and asDesktop)<>0 then
-    begin
-      { destory all help & browser windows - we don't want to store them }
-      { UserScreenWindow is also not registered PM }
-      DoCloseUserScreenWindow;
-      CloseHelpWindows;
-      CloseAllBrowsers;
-      DOK:=SaveDesktop;
-      if DOK=false then
-        ErrorBox(error_saving_dsk_file,nil);
-    end;
-  AutoSave:=IOK and SOK and DOK;
-end;
-
-function TIDEApp.DoExecute(ProgramPath, Params, InFile,OutFile: string; ExecType: TExecType): boolean;
-var CanRun: boolean;
-{$ifndef Unix}
-    PosExe: sw_integer;
-{$endif Unix}
-begin
-  SaveCancelled:=false;
-  CanRun:=AutoSave;
-  if (CanRun=false) and (SaveCancelled=false) then
-    CanRun:=true; { do not care about .DSK or .INI saving problems - just like TP }
-  if CanRun then
-  begin
-    if UserScreen=nil then
-     begin
-       ErrorBox(error_user_screen_not_avail,nil);
-       Exit;
-     end;
-
-    if ExecType<>exNoSwap then
-      ShowUserScreen;
-
-    if ExecType=exDosShell then
-      WriteShellMsg;
-
-     { DO NOT use COMSPEC for exe files as the
-      ExitCode is lost in those cases PM }
-
-{$ifndef Unix}
-    posexe:=Pos('.EXE',UpCaseStr(ProgramPath));
-    { if programpath was three char long => bug }
-    if (posexe>0) and (posexe=Length(ProgramPath)-3) then
-      begin
-{$endif Unix}
-        if (InFile='') and (OutFile='') then
-          DosExecute(ProgramPath,Params)
-        else
-          ExecuteRedir(ProgramPath,Params,InFile,OutFile,'stderr');
-{$ifndef Unix}
-      end
-    else if (InFile='') and (OutFile='') then
-      DosExecute(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params)
-    else
-      ExecuteRedir(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params,InFile,OutFile,'stderr');
-{$endif Unix}
-
-{$ifdef Unix}
-    if (DebuggeeTTY='') and (OutFile='') then
-      begin
-        Write(' Press any key to return to IDE');
-        InitKeyBoard;
-        Keyboard.GetKeyEvent;
-        while (Keyboard.PollKeyEvent<>0) do
-         Keyboard.GetKeyEvent;
-        DoneKeyboard;
-      end;
-{$endif}
-    if ExecType<>exNoSwap then
-      ShowIDEScreen;
-  end;
-  DoExecute:=CanRun;
-end;
-
-
-procedure TIDEApp.Update;
-begin
-  SetCmdState([cmSaveAll],IsThereAnyEditor);
-  SetCmdState([cmCloseAll,cmWindowList],IsThereAnyWindow);
-  SetCmdState([cmTile,cmCascade],IsThereAnyVisibleWindow);
-  SetCmdState([cmFindProcedure,cmObjects,cmModules,cmGlobals,cmSymbol{,cmInformation}],IsSymbolInfoAvailable);
-{$ifndef NODEBUG}
-  SetCmdState([cmResetDebugger,cmUntilReturn],assigned(debugger) and debugger^.debuggee_started);
-{$endif}
-  SetCmdState([cmToolsMsgNext,cmToolsMsgPrev],MessagesWindow<>nil);
-  UpdateTools;
-  UpdateRecentFileList;
-  UpdatePrimaryFile;
-  UpdateINIFile;
-  Message(Application,evBroadcast,cmCommandSetChanged,nil);
-end;
-
-procedure TIDEApp.SourceWindowClosed;
-begin
-  if not IsClosing then
-    Update;
-end;
-
-procedure TIDEApp.CurDirChanged;
-begin
-  Message(Application,evBroadcast,cmUpdateTitle,nil);
-  UpdatePrimaryFile;
-  UpdateINIFile;
-  UpdateMenu(MenuBar^.Menu);
-end;
-
-
-procedure TIDEApp.UpdatePrimaryFile;
-begin
-  SetMenuItemParam(SearchMenuItem(MenuBar^.Menu,cmPrimaryFile),SmartPath(PrimaryFile));
-  SetCmdState([cmClearPrimary],PrimaryFile<>'');
-  if PrimaryFile<>'' then
-     SetCmdState(CompileCmds,true);
-  UpdateMenu(MenuBar^.Menu);
-  Message(ProgramInfoWindow,evBroadcast,cmUpdate,nil);
-end;
-
-procedure TIDEApp.UpdateINIFile;
-begin
-  SetMenuItemParam(SearchMenuItem(MenuBar^.Menu,cmSaveINI),SmartPath(IniFileName));
-end;
-
-procedure TIDEApp.UpdateRecentFileList;
-var P: PMenuItem;
-    {ID,}I: word;
-    FileMenu: PMenuItem;
-begin
-{  ID:=cmRecentFileBase;}
-  FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
-  repeat
-{    Inc(ID);
-    P:=SearchMenuItem(FileMenu^.SubMenu,ID);
-    if FileMenu^.SubMenu^.Default=P then
-      FileMenu^.SubMenu^.Default:=FileMenu^.SubMenu^.Items;
-    if P<>nil then RemoveMenuItem(FileMenu^.SubMenu,P);}
-    P:=GetMenuItemBefore(FileMenu^.SubMenu,nil);
-    if (P<>nil) then
-    begin
-      if (cmRecentFileBase<P^.Command) and (P^.Command<=cmRecentFileBase+MaxRecentFileCount) then
-        begin
-          RemoveMenuItem(FileMenu^.SubMenu,P);
-          if FileMenu^.SubMenu^.Default=P then
-            FileMenu^.SubMenu^.Default:=FileMenu^.SubMenu^.Items;
-        end
-      else
-        P:=nil;
-    end;
-  until P=nil;
-  P:=GetMenuItemBefore(FileMenu^.SubMenu,nil);
-  if (P<>nil) and IsSeparator(P) then
-     RemoveMenuItem(FileMenu^.SubMenu,P);
-
-  if RecentFileCount>0 then
-     AppendMenuItem(FileMenu^.SubMenu,NewLine(nil));
-  for I:=1 to RecentFileCount do
-  begin
-    P:=NewItem('~'+IntToStr(I)+'~ '+ShrinkPath(SmartPath(RecentFiles[I].FileName),27),' ',
-        kbNoKey,cmRecentFileBase+I,hcRecentFileBase+I,nil);
-    AppendMenuItem(FileMenu^.SubMenu,P);
-  end;
-end;
-
-procedure TIDEApp.UpdateTools;
-var P: PMenuItem;
-{    ID,}I: word;
-    ToolsMenu: PMenuItem;
-    S1,S2,S3: string;
-    W: word;
-begin
-{  ID:=cmToolsBase;}
-  ToolsMenu:=SearchSubMenu(MenuBar^.Menu,menuTools);
-  repeat
-    P:=GetMenuItemBefore(ToolsMenu^.SubMenu,nil);
-    if (P<>nil) then
-    begin
-      if (cmToolsBase<P^.Command) and (P^.Command<=cmToolsBase+MaxToolCount) then
-        begin
-          RemoveMenuItem(ToolsMenu^.SubMenu,P);
-          if ToolsMenu^.SubMenu^.Default=P then
-            ToolsMenu^.SubMenu^.Default:=ToolsMenu^.SubMenu^.Items;
-        end
-      else
-        P:=nil;
-    end;
-  until P=nil;
-  P:=GetMenuItemBefore(ToolsMenu^.SubMenu,nil);
-  if (P<>nil) and IsSeparator(P) then
-     RemoveMenuItem(ToolsMenu^.SubMenu,P);
-
-  if GetToolCount>0 then
-     AppendMenuItem(ToolsMenu^.SubMenu,NewLine(nil));
-  for I:=1 to GetToolCount do
-  begin
-    GetToolParams(I-1,S1,S2,S3,W);
-    P:=NewItem(S1,KillTilde(GetHotKeyName(W)),W,cmToolsBase+I,hcToolsBase+I,nil);
-    AppendMenuItem(ToolsMenu^.SubMenu,P);
-  end;
-end;
-
-procedure TIDEApp.DosShell;
-var
-  s : string;
-begin
-{$ifdef Unix}
-  s:=GetEnv('SHELL');
-  if s='' then
-    if ExistsFile('bin/sh') then
-      s:='bin/sh';
-{$else}
-  s:=GetEnv('COMSPEC');
-  if s='' then
-    if ExistsFile('c:\command.com') then
-      s:='c:\command.com'
-    else
-      begin
-        s:='command.com';
-        if Not LocateExeFile(s) then
-          s:='';
-      end;
-{$endif}
-  if s='' then
-    ErrorBox(msg_errorexecutingshell,nil)
-  else
-    DoExecute(s, '', '', '', exDosShell);
-end;
-
-procedure TIDEApp.ShowReadme;
-var R,R2: TRect;
-    D: PCenterDialog;
-    M: PFPMemo;
-    VSB: PScrollBar;
-    S: PBufStream;
-begin
-  New(S, Init(ReadmeName, stOpenRead, 4096));
-  if S^.Status=stOK then
-  begin
-    R.Assign(0,0,63,18);
-    New(D, Init(R, 'Free Pascal IDE'));
-    with D^ do
-    begin
-      GetExtent(R);
-      R.Grow(-2,-2); Inc(R.B.Y);
-      R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
-      New(VSB, Init(R2)); VSB^.GrowMode:=0; Insert(VSB);
-      New(M, Init(R,nil,VSB,nil));
-      M^.LoadFromStream(S);
-      M^.ReadOnly:=true;
-      Insert(M);
-    end;
-    InsertOK(D);
-    ExecuteDialog(D,nil);
-  end;
-  Dispose(S, Done);
-end;
-
-{$I FPMFILE.INC}
-
-{$I FPMEDIT.INC}
-
-{$I FPMSRCH.INC}
-
-{$I FPMRUN.INC}
-
-{$I FPMCOMP.INC}
-
-{$I FPMDEBUG.INC}
-
-{$I FPMTOOLS.INC}
-
-{$I FPMOPTS.INC}
-
-{$I FPMWND.INC}
-
-{$I FPMHELP.INC}
-
-procedure TIDEApp.AddRecentFile(AFileName: string; CurX, CurY: integer);
-begin
-  if SearchRecentFile(AFileName)<>-1 then Exit;
-  if RecentFileCount>0 then
-   Move(RecentFiles[1],RecentFiles[2],SizeOf(RecentFiles[1])*Min(RecentFileCount,High(RecentFiles)-1));
-  if RecentFileCount<High(RecentFiles) then Inc(RecentFileCount);
-  with RecentFiles[1] do
-  begin
-    FileName:=AFileName;
-    LastPos.X:=CurX; LastPos.Y:=CurY;
-  end;
-  UpdateRecentFileList;
-end;
-
-function TIDEApp.SearchRecentFile(AFileName: string): integer;
-var Idx,I: integer;
-begin
-  Idx:=-1;
-  for I:=1 to RecentFileCount do
-    if UpcaseStr(AFileName)=UpcaseStr(RecentFiles[I].FileName) then
-      begin Idx:=I; Break; end;
-  SearchRecentFile:=Idx;
-end;
-
-procedure TIDEApp.RemoveRecentFile(Index: integer);
-begin
-  if Index<RecentFileCount then
-     Move(RecentFiles[Index+1],RecentFiles[Index],SizeOf(RecentFiles[1])*(RecentFileCount-Index));
-  Dec(RecentFileCount);
-end;
-
-function TIDEApp.GetPalette: PPalette;
-var P: string;
-begin
-  P:=AppPalette;
-  GetPalette:=@P;
-end;
-
-function TIDEApp.IsClosing: Boolean;
-begin
-  IsClosing:=InsideDone;
-end;
-
-destructor TIDEApp.Done;
-begin
-  InsideDone:=true;
-  inherited Done;
-  RemoveBrowsersCollection;
-  DoneHelpSystem;
-end;
-
-END.
-{
-  $Log$
-  Revision 1.5  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.12  2000/11/14 09:23:55  marco
-   * Second batch
-
-  Revision 1.4  2000/10/31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.11  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.1.2.10  2000/10/09 16:28:25  pierre
-   * several linux enhancements
-
-  Revision 1.1.2.9  2000/10/04 13:30:50  pierre
-   * DosShell for linux
-
-  Revision 1.3  2000/09/22 15:24:04  jonas
-    * Linux now also uses the DosExecute and ExecuteRedir procedures
-      (merged from fixes branch)
-
-  Revision 1.1.2.8  2000/09/22 15:19:04  jonas
-    * Linux now also uses the DosExecute and ExecuteRedir procedures
-
-  Revision 1.2  2000/08/22 09:41:39  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.7  2000/08/21 12:10:19  jonas
-    * fixed errors in my previous commit, it now works properly
-
-  Revision 1.1.2.5  2000/08/16 18:46:14  peter
-   [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
-   [*] Make, Build now possible even in Compiler Messages Window
-   [+] when started in a new dir the IDE now ask whether to create a local
-       config, or to use the one located in the IDE dir
-
-  Revision 1.1.2.4  2000/08/15 03:40:53  peter
-   [*] no more fatal exits when the IDE can't find the error file (containing
-       the redirected assembler/linker output) after compilation
-   [*] hidden windows are now added always at the end of the Window List
-   [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
-   [*] selection was incorrectly adjusted when typing in overwrite mode
-   [*] the line wasn't expanded when it's end was reached in overw. mode
-   [*] the IDE now tries to locate source files also in the user specified
-       unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
-   [*] 'Open at cursor' is now aware of the extension (if specified)
-
-  Revision 1.1.2.3  2000/08/10 07:10:37  michael
-  * 'Auto save editor files' option did the opposite than expected, due
-    to a typo in FPIDE.PAS
-  + saving of source files before compilation is no longer neccessary.
-    When a modified editor file is involved in the compilation, then the
-    IDE saves it's contents to a memory stream and passes this to the
-    compiler (instead of the file on the disk)
-
-  Revision 1.1.2.2  2000/08/04 14:05:18  michael
-  * Fixes from Gabor:
-   [*] the IDE now doesn't disable Compile|Make & Build when all windows
-       are closed, but there's still a primary file set
-       (set bug 1059 to fixed!)
-
-   [*] the IDE didn't read some compiler options correctly back from the
-       FP.CFG file, for ex. the linker options. Now it read everything
-       correctly, and also automatically handles smartlinking option synch-
-       ronization.
-       (set bug 1048 to fixed!)
-
-  Revision 1.1.2.1  2000/07/18 05:50:22  michael
-  + Merged Gabors fixes
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.65  2000/06/22 09:07:12  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.64  2000/06/16 21:19:41  pierre
-   * Use Open instead of OpenSearch if OpenFileName is empty
-
-  Revision 1.63  2000/06/16 08:50:40  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.62  2000/06/11 07:01:33  peter
-    * give watches window also a number
-    * leave watches window in the bottom when cascading windows
-
-  Revision 1.61  2000/05/17 09:51:11  pierre
-   Disable/Enable keyboard on UserScreen
-
-  Revision 1.60  2000/05/02 10:20:40  pierre
-   * fix a small problem when deciding to call DosExecute directly
-
-  Revision 1.59  2000/05/02 08:42:27  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.58  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.57  2000/04/18 11:42:37  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.56  2000/03/21 23:30:49  pierre
-   adapted to wcedit addition by Gabor
-
-  Revision 1.55  2000/03/13 20:41:35  pierre
-    + option -S to disable the mouse
-    * adapted to changes in fpusrscr for DOS
-
-  Revision 1.54  2000/03/07 21:57:59  pierre
-    + CtrlC handling
-    + UpdateMode method
-
-  Revision 1.53  2000/03/06 11:31:30  pierre
-    * Do not use COMSPEC to Run files with .EXE suffix
-      because Command.com at least does not return the errorcode
-      of the program called
-
-  Revision 1.52  2000/02/07 12:02:32  pierre
-   Gabor's changes
-
-  Revision 1.51  2000/01/23 21:25:17  florian
-    + start of internationalization support
-
-  Revision 1.50  2000/01/08 18:26:20  florian
-    + added a register window, doesn't work yet
-
-  Revision 1.49  2000/01/05 00:31:50  pierre
-   * avoid new files to use TABS
-
-  Revision 1.48  2000/01/03 11:38:33  michael
-  Changes from Gabor
-
-  Revision 1.47  1999/12/20 14:23:17  pierre
-    * MyApp renamed IDEApp
-    * TDebugController.ResetDebuggerRows added to
-      get resetting of debugger rows
-
-  Revision 1.46  1999/12/17 15:07:01  florian
-    + TIDEApp.Idle does always call GiveUpTimeSlice
-
-  Revision 1.45  1999/12/10 13:02:05  pierre
-  + VideoMode save/restore
-
-  Revision 1.44  1999/11/25 00:26:49  pierre
-   * RecentFiles missed the last char
-
-  Revision 1.43  1999/11/10 17:19:06  pierre
-   * Use DosExecute from Fpredir unit
-
-  Revision 1.42  1999/10/27 12:10:42  pierre
-    + With DebugUndo added 3 menu items
-      "Dump Undo" "Undo All" and "Redo All"
-      for Undo checks
-
-  Revision 1.41  1999/09/22 16:21:41  pierre
-   * Use ShrinkPas for RecentFiles
-
-  Revision 1.40  1999/09/22 13:04:31  pierre
-   + Close UserScreen to avoid store crash
-
-  Revision 1.39  1999/09/21 17:09:00  pierre
-   + Windows clipboard for win32
-
-  Revision 1.38  1999/09/13 16:24:43  peter
-    + clock
-    * backspace unident like tp7
-
-  Revision 1.37  1999/09/13 11:44:00  peter
-    * fixes from gabor, idle event, html fix
-
-  Revision 1.36  1999/09/09 14:15:27  pierre
-   + cmCopyWin,cmPasteWin
-
-  Revision 1.35  1999/08/16 18:25:19  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.34  1999/08/03 20:22:32  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.33  1999/07/12 13:14:18  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.32  1999/07/10 01:24:17  pierre
-   + First implementation of watches window
-
-  Revision 1.31  1999/06/29 22:50:14  peter
-    * more fixes from gabor
-
-  Revision 1.30  1999/06/28 19:32:20  peter
-    * fixes from gabor
-
-  Revision 1.29  1999/06/28 12:40:19  pierre
-   + RemoveBrowsersCollection in TIDEApp.Done
-
-  Revision 1.28  1999/06/25 00:46:33  pierre
-     + UpdateTarget to show current target
-     + SearchSymbol, not scope aware (this will need a PPU change !)
-
-  Revision 1.27  1999/05/22 13:44:30  peter
-    * fixed couple of bugs
-
-  Revision 1.26  1999/04/07 21:55:47  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.25  1999/03/23 15:11:29  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.24  1999/03/19 16:04:29  peter
-    * new compiler dialog
-
-  Revision 1.23  1999/03/16 12:38:10  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-  Revision 1.22  1999/03/12 01:13:57  peter
-    * flag if trytoopen should look for other extensions
-    + browser tab in the tools-compiler
-
-  Revision 1.21  1999/03/02 13:48:29  peter
-    * fixed far problem is fpdebug
-    * tile/cascading with message window
-    * grep fixes
-
-  Revision 1.20  1999/03/01 15:41:54  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.19  1999/02/22 11:51:36  peter
-    * browser updates from gabor
-
-  Revision 1.18  1999/02/22 02:15:13  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.17  1999/02/20 15:18:30  peter
-    + ctrl-c capture with confirm dialog
-    + ascii table in the tools menu
-    + heapviewer
-    * empty file fixed
-    * fixed callback routines in fpdebug to have far for tp7
-
-  Revision 1.16  1999/02/18 13:44:31  peter
-    * search fixed
-    + backward search
-    * help fixes
-    * browser updates
-
-  Revision 1.15  1999/02/16 10:43:55  peter
-    * use -dGDB for the compiler
-    * only use gdb_file when -dDEBUG is used
-    * profiler switch is now a toggle instead of radiobutton
-
-  Revision 1.14  1999/02/11 19:07:22  pierre
-    * GDBWindow redesigned :
-      normal editor apart from
-      that any kbEnter will send the line (for begin to cursor)
-      to GDB command !
-      GDBWindow opened in Debugger Menu
-       still buggy :
-       -echo should not be present if at end of text
-       -GDBWindow becomes First after each step (I don't know why !)
-
-  Revision 1.13  1999/02/10 09:54:11  pierre
-    * cmSourceWindowClosing resets Debugger LastSource field to avoid problems
-
-  Revision 1.12  1999/02/08 17:43:44  pierre
-    * RestDebugger or multiple running of debugged program now works
-    + added DoContToCursor(F4)
-    * Breakpoints are now inserted correctly (was mainlyy a problem
-      of directories)
-
-  Revision 1.11  1999/02/08 10:37:44  peter
-    + html helpviewer
-
-  Revision 1.7  1999/02/04 13:32:03  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.6  1999/02/02 16:41:39  peter
-    + automatic .pas/.pp adding by opening of file
-    * better debuggerscreen changes
-
-  Revision 1.5  1999/01/22 18:13:22  pierre
-   * DoneScreen Removed I did not find any such proc ??
-
-  Revision 1.4  1999/01/22 10:24:03  peter
-    * first debugger things
-
-  Revision 1.3  1999/01/21 11:54:14  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.2  1999/01/14 21:42:20  peter
-    * source tracking from Gabor
-
-  Revision 1.1  1999/01/12 14:29:34  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.4  1999/01/04 11:49:41  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.2  1998/12/28 15:47:40  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.3  1998/12/22 10:39:38  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 773
ide/text/fpini.pas

@@ -1,773 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Write/Read Options to INI File
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit FPIni;
-interface
-
-uses
-  FPUtils;
-
-procedure InitINIFile;
-procedure CheckINIFile;
-function  ReadINIFile: boolean;
-function  WriteINIFile: boolean;
-
-
-implementation
-
-uses
-  Dos,Objects,Drivers,Commands,
-  WConsts,WUtils,WINI,WViews,{$ifndef EDITORS}WEditor,WCEdit{$else}Editors{$endif},
-  {$ifndef NODEBUG}FPDebug,{$endif}FPConst,FPVars,
-  FPIntf,FPTools,FPSwitch,FPString;
-
-const
-  { INI file sections }
-  secFiles       = 'Files';
-  secRun         = 'Run';
-  secCompile     = 'Compile';
-  secColors      = 'Colors';
-  secHelp        = 'Help';
-  secEditor      = 'Editor';
-  secBreakpoint  = 'Breakpoints';
-  secWatches     = 'Watches';
-  secHighlight   = 'Highlight';
-  secMouse       = 'Mouse';
-  secSearch      = 'Search';
-  secTools       = 'Tools';
-  secSourcePath  = 'SourcePath';
-  secPreferences = 'Preferences';
-  secMisc        = 'Misc';
-
-  { INI file tags }
-  ieRecentFile       = 'RecentFile';
-(*  ieOpenFile         = 'OpenFile';
-  ieOpenFileCount    = 'OpenFileCount'; *)
-  ieRunParameters    = 'Parameters';
-  ieDebuggeeRedir    = 'DebugRedirection';
-  iePrimaryFile      = 'PrimaryFile';
-  ieCompileMode      = 'CompileMode';
-  iePalette          = 'Palette';
-  ieHelpFiles        = 'Files';
-  ieDefaultTabSize   = 'DefaultTabSize';
-  ieDefaultEditorFlags='DefaultFlags';
-  ieDefaultSaveExt   = 'DefaultSaveExt';
-  ieOpenExts         = 'OpenExts';
-  ieHighlightExts    = 'Exts';
-  ieTabsPattern      = 'NeedsTabs';
-  ieDoubleClickDelay = 'DoubleDelay';
-  ieReverseButtons   = 'ReverseButtons';
-  ieAltClickAction   = 'AltClickAction';
-  ieCtrlClickAction  = 'CtrlClickAction';
-  ieFindFlags        = 'FindFlags';
-  ieToolName         = 'Title';
-  ieToolProgram      = 'Program';
-  ieToolParams       = 'Params';
-  ieToolHotKey       = 'HotKey';
-  ieBreakpointTyp    = 'Type';
-  ieBreakpointCount  = 'Count';
-  ieBreakpointState  = 'State';
-  ieBreakpointName   = 'Name';
-  ieBreakpointFile   = 'FileName';
-  ieBreakpointLine   = 'LineNumber';
-  ieBreakpointCond   = 'Condition';
-  ieWatchCount       = 'Count';
-  ieWatchName        = 'Watch';
-  ieSourceList       = 'SourceList';
-{  ieVideoMode        = 'VideoMode';}
-  ieAutoSave         = 'AutoSaveFlags';
-  ieMiscOptions      = 'MiscOptions';
-  ieDesktopLocation  = 'DesktopLocation';
-  ieDesktopFlags     = 'DesktopFileFlags';
-  ieCenterDebuggerRow= 'CenterCurrentLineWhileDebugging';
-  ieShowReadme       = 'ShowReadme';
-
-procedure InitINIFile;
-var S: string;
-begin
-  S:=LocateFile(INIFileName);
-  if S<>'' then
-    IniFileName:=S;
-  IniFileName:=FExpand(IniFileName);
-end;
-
-procedure CheckINIFile;
-var IniDir,CurDir: DirStr;
-    INI: PINIFile;
-const Btns : array[1..2] of longstring = (btn_config_copyexisting,btn_config_createnew);
-begin
-  IniDir:=DirOf(IniFileName); CurDir:=GetCurDir;
-  if CompareText(IniDir,CurDir)<>0 then
-   if not ExistsFile(CurDir+DirInfoName) then
-     if ConfirmBox(FormatStrStr(msg_doyouwanttocreatelocalconfigfile,IniDir),nil,false)=cmYes then
-       begin
-         if (not ExistsFile(IniFileName)) or
-            (ChoiceBox(msg_configcopyexistingorcreatenew,nil,
-              Btns,false)=cmUserBtn2) then
-           begin
-             { create new config here }
-             IniFileName:=CurDir+IniName;
-             SwitchesPath:=CurDir+SwitchesName;
-           end
-         else
-           begin
-             { copy config here }
-             if CopyFile(IniFileName,CurDir+IniName)=false then
-               ErrorBox(FormatStrStr(msg_errorwritingfile,CurDir+IniName),nil)
-             else
-               IniFileName:=CurDir+IniName;
-             if CopyFile(SwitchesPath,CurDir+SwitchesName)=false then
-               ErrorBox(FormatStrStr(msg_errorwritingfile,CurDir+SwitchesName),nil)
-             else
-               SwitchesPath:=CurDir+SwitchesName;
-           end;
-       end
-     else
-       begin
-         New(INI, Init(CurDir+DirInfoName));
-         INI^.SetEntry(MainSectionName,'Comment','Do NOT delete this file!!!');
-         if INI^.Update=false then
-           ErrorBox(FormatStrStr(msg_errorwritingfile,INI^.GetFileName),nil);
-         Dispose(INI, Done);
-       end;
-end;
-
-function PaletteToStr(S: string): string;
-var C: string;
-    I: integer;
-begin
-  C:='';
-  for I:=1 to length(S) do
-    begin
-      C:=C+'#$'+IntToHex(ord(S[I]),2);
-    end;
-  PaletteToStr:=C;
-end;
-
-function StrToPalette(S: string): string;
-var I,P,X: integer;
-    C: string;
-    Hex: boolean;
-    OK: boolean;
-begin
-  C:=''; I:=1;
-  OK:=S<>'';
-  while OK and (I<=length(S)) and (S[I]='#') do
-  begin
-    Inc(I); Hex:=false;
-    if S[I]='$' then begin Inc(I); Hex:=true; end;
-    P:=Pos('#',copy(S,I,High(S))); if P>0 then P:=I+P-1 else P:=length(S)+1;
-    if Hex=false then
-      begin
-        X:=StrToInt(copy(S,I,P-I));
-        OK:=(LastStrToIntResult=0) and (0<=X) and (X<=High(S));
-      end
-    else
-      begin
-        X:=HexToInt(copy(S,I,P-I));
-        OK:=(LastHexToIntResult=0) and (0<=X) and (X<=255);
-      end;
-    if OK then C:=C+chr(X);
-    Inc(I,P-I);
-  end;
-  StrToPalette:=C;
-end;
-
-{$ifndef NODEBUG}
-procedure WriteOneWatchEntry(I : Longint;INIFile : PINIFile);
-var
-  PW : PWatch;
-  S  : String;
-begin
-  Str(I,S);
-  PW:=WatchesCollection^.At(I);
-  With PW^ do
-    begin
-      INIFile^.SetEntry(secWatches,ieWatchName+S,GetStr(expr));
-    end;
-end;
-
-procedure WriteOneBreakPointEntry(I : longint;INIFile : PINIFile);
-var PB : PBreakpoint;
-    S : String;
-begin
-  Str(I,S);
-  PB:=BreakpointsCollection^.At(I);
-  If assigned(PB) then
-   With PB^ do
-    Begin
-      INIFile^.SetEntry(secBreakpoint,ieBreakpointTyp+S,BreakpointTypeStr[typ]);
-      INIFile^.SetEntry(secBreakpoint,ieBreakpointState+S,BreakpointStateStr[state]);
-      if typ=bt_file_line then
-        begin
-          INIFile^.SetEntry(secBreakpoint,ieBreakpointFile+S,FileName^);
-          INIFile^.SetIntEntry(secBreakpoint,ieBreakpointLine+S,Line);
-        end
-      else
-        INIFile^.SetEntry(secBreakpoint,ieBreakpointName+S,Name^);
-      if assigned(Conditions) then
-        INIFile^.SetEntry(secBreakpoint,ieBreakpointCond+S,Conditions^);
-    end;
-end;
-
-procedure ReadOneWatchEntry(I : Longint;INIFile : PINIFile);
-var
-  PW : PWatch;
-  S  : String;
-begin
-  Str(I,S);
-  PW:=new(PWatch,Init(INIFile^.GetEntry(secWatches,ieWatchName+S,'')));
-  WatchesCollection^.Insert(PW);
-end;
-
-procedure ReadOneBreakPointEntry(i : longint;INIFile : PINIFile);
-var PB : PBreakpoint;
-    S,S2,SC : string;
-    Line : longint;
-    typ : BreakpointType;
-    state : BreakpointState;
-
-begin
-  Str(I,S2);
-  typ:=bt_invalid;
-  S:=INIFile^.GetEntry(secBreakpoint,ieBreakpointTyp+S2,BreakpointTypeStr[typ]);
-  for typ:=low(BreakpointType) to high(BreakpointType) do
-    If pos(BreakpointTypeStr[typ],S)>0 then break;
-  state:=bs_deleted;
-  S:=INIFile^.GetEntry(secBreakpoint,ieBreakpointState+S2,BreakpointStateStr[state]);
-  for state:=low(BreakpointState) to high(BreakpointState) do
-    If pos(BreakpointStateStr[state],S)>0 then break;
-  case typ of
-     bt_invalid :;
-     bt_file_line :
-       begin
-         S:=INIFile^.GetEntry(secBreakpoint,ieBreakpointFile+S2,'');
-         Line:=INIFile^.GetIntEntry(secBreakpoint,ieBreakpointLine+S2,0);
-       end;
-     else
-       begin
-         S:=INIFile^.GetEntry(secBreakpoint,ieBreakpointName+S2,'');
-       end;
-     end;
-   SC:=INIFile^.GetEntry(secBreakpoint,ieBreakpointCond+S2,'');
-   if (typ=bt_function) and (S<>'') then
-     new(PB,init_function(S))
-   else if (typ=bt_file_line) and (S<>'') then
-     new(PB,init_file_line(S,Line))
-   else
-     new(PB,init_type(typ,S));
-   If assigned(PB) then
-     begin
-       PB^.state:=state;
-       If SC<>'' then
-         PB^.conditions:=NewStr(SC);
-       BreakpointsCollection^.Insert(PB);
-     end;
-end;
-{$endif NODEBUG}
-
-function ReadINIFile: boolean;
-var INIFile: PINIFile;
-    S,PS,S1,S2,S3: string;
-    I,P: integer;
-    BreakPointCount,WatchesCount:longint;
-    OK: boolean;
-    ts : TSwitchMode;
-    W: word;
-begin
-  OK:=ExistsFile(IniFileName);
-  if OK then
- begin
-  New(INIFile, Init(IniFileName));
-  { Files }
-  OpenExts:=INIFile^.GetEntry(secFiles,ieOpenExts,OpenExts);
-  RecentFileCount:=High(RecentFiles);
-  for I:=Low(RecentFiles) to High(RecentFiles) do
-    begin
-      S:=INIFile^.GetEntry(secFiles,ieRecentFile+IntToStr(I),'');
-      if (S='') and (RecentFileCount>I-1) then RecentFileCount:=I-1;
-      with RecentFiles[I] do
-      begin
-        P:=Pos(',',S); if P=0 then P:=length(S)+1;
-        FileName:=copy(S,1,P-1); Delete(S,1,P);
-        P:=Pos(',',S); if P=0 then P:=length(S)+1;
-        LastPos.X:=Max(0,StrToInt(copy(S,1,P-1))); Delete(S,1,P);
-        P:=Pos(',',S); if P=0 then P:=length(S)+1;
-        LastPos.Y:=Max(0,StrToInt(copy(S,1,P-1))); Delete(S,1,P);
-      end;
-    end;
-  { Run }
-  { First read the primary file, which can also set the parameters which can
-    be overruled with the parameter loading }
-  SetPrimaryFile(INIFile^.GetEntry(secCompile,iePrimaryFile,PrimaryFile));
-  SetRunParameters(INIFile^.GetEntry(secRun,ieRunParameters,GetRunParameters));
-{$ifndef GABOR}
-  DebuggeeTTY := INIFile^.GetEntry(secRun,ieDebuggeeRedir,DebuggeeTTY);
-{$endif}
-  { Compile }
-  S:=INIFile^.GetEntry(secCompile,ieCompileMode,'');
-  for ts:=low(TSwitchMode) to high(TSwitchMode) do
-    begin
-      if SwitchesModeStr[ts]=S then
-        SwitchesMode:=ts;
-    end;
-  { Help }
-  S:=INIFile^.GetEntry(secHelp,ieHelpFiles,'');
-  repeat
-    P:=Pos(';',S); if P=0 then P:=length(S)+1;
-    PS:=copy(S,1,P-1);
-    if PS<>'' then HelpFiles^.Insert(NewStr(PS));
-    Delete(S,1,P);
-  until S='';
-  { Editor }
-{$ifndef EDITORS}
-  DefaultTabSize:=INIFile^.GetIntEntry(secEditor,ieDefaultTabSize,DefaultTabSize);
-  DefaultCodeEditorFlags:=INIFile^.GetIntEntry(secEditor,ieDefaultEditorFlags,DefaultCodeEditorFlags);
-  DefaultSaveExt:=INIFile^.GetEntry(secEditor,ieDefaultSaveExt,DefaultSaveExt);
-{$endif}
-  { Highlight }
-  HighlightExts:=INIFile^.GetEntry(secHighlight,ieHighlightExts,HighlightExts);
-  TabsPattern:=INIFile^.GetEntry(secHighlight,ieTabsPattern,TabsPattern);
-  { SourcePath }
-  SourceDirs:=INIFile^.GetEntry(secSourcePath,ieSourceList,SourceDirs);
-  { Mouse }
-  DoubleDelay:=INIFile^.GetIntEntry(secMouse,ieDoubleClickDelay,DoubleDelay);
-  MouseReverse:=boolean(INIFile^.GetIntEntry(secMouse,ieReverseButtons,byte(MouseReverse)));
-  AltMouseAction:=INIFile^.GetIntEntry(secMouse,ieAltClickAction,AltMouseAction);
-  CtrlMouseAction:=INIFile^.GetIntEntry(secMouse,ieCtrlClickAction,CtrlMouseAction);
-  { Search }
-  FindFlags:=INIFile^.GetIntEntry(secSearch,ieFindFlags,FindFlags);
-  { Breakpoints }
-{$ifndef NODEBUG}
-  BreakpointCount:=INIFile^.GetIntEntry(secBreakpoint,ieBreakpointCount,0);
-  for i:=1 to BreakpointCount do
-    ReadOneBreakPointEntry(i-1,INIFile);
-  WatchesCount:=INIFile^.GetIntEntry(secWatches,ieWatchCount,0);
-  for i:=1 to WatchesCount do
-    ReadOneWatchEntry(i-1,INIFile);
-{$endif}
-  { Tools }
-  for I:=1 to MaxToolCount do
-    begin
-      S:=IntToStr(I);
-      S1:=INIFile^.GetEntry(secTools,ieToolName+S,'');
-      if S1='' then Break; { !!! }
-      S2:=INIFile^.GetEntry(secTools,ieToolProgram+S,'');
-      S3:=INIFile^.GetEntry(secTools,ieToolParams+S,'');
-      W:=Max(0,Min(65535,INIFile^.GetIntEntry(secTools,ieToolHotKey+S,0)));
-      AddTool(S1,S2,S3,W);
-    end;
-  { Colors }
-  S:=AppPalette;
-  PS:=StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_1_40',PaletteToStr(copy(S,1,40))));
-  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_41_80',PaletteToStr(copy(S,41,40))));
-  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_81_120',PaletteToStr(copy(S,81,40))));
-  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_121_160',PaletteToStr(copy(S,121,40))));
-  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_161_200',PaletteToStr(copy(S,161,40))));
-  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_201_240',PaletteToStr(copy(S,201,40))));
-  if length(PS)<length(CIDEAppColor) then
-    PS:=PS+copy(CIDEAppColor,length(PS)+1,255);
-  AppPalette:=PS;
-(*  { Open files }
-  for I:=INIFile^.GetIntEntry(secFiles,ieOpenFileCount,0) downto 1 do
-    begin
-      S:=INIFile^.GetEntry(secFiles,ieOpenFile+IntToStr(I),'');
-      if (S='') then
-        break;
-      P:=Pos(',',S); if P=0 then P:=length(S)+1;
-      S1:=copy(S,1,P-1);
-      Delete(S,1,P);
-      P:=Pos(',',S);
-      if P=0 then P:=length(S)+1;
-      X:=Max(0,StrToInt(copy(S,1,P-1)));
-      Delete(S,1,P);
-      P:=Pos(',',S);
-      if P=0 then P:=length(S)+1;
-      Y:=Max(0,StrToInt(copy(S,1,P-1)));
-      Delete(S,1,P);
-      P:=Pos(',',S);
-      if P=0 then P:=length(S)+1;
-      R.A.X:=Max(0,StrToInt(copy(S,1,P-1)));
-      Delete(S,1,P);
-      P:=Pos(',',S);
-      if P=0 then P:=length(S)+1;
-      R.A.Y:=Max(0,StrToInt(copy(S,1,P-1)));
-      Delete(S,1,P);
-      P:=Pos(',',S);
-      if P=0 then P:=length(S)+1;
-      R.B.X:=Max(0,StrToInt(copy(S,1,P-1)));
-      Delete(S,1,P);
-      P:=Pos(',',S);
-      if P=0 then P:=length(S)+1;
-      R.B.Y:=Max(0,StrToInt(copy(S,1,P-1)));
-      if (R.A.X<R.B.X) and (R.A.Y<R.B.Y) then
-        TryToOpenFile(@R,S1,X,Y,false)
-      else
-        TryToOpenFile(nil,S1,X,Y,false);
-      { remove it because otherwise we allways keep old files }
-      INIFile^.DeleteEntry(secFiles,ieOpenFile+IntToStr(I));
-    end;
-*)
-  { Desktop }
-  DesktopFileFlags:=INIFile^.GetIntEntry(secPreferences,ieDesktopFlags,DesktopFileFlags);
-  { Debugger }
-  IniCenterDebuggerRow:=INIFile^.GetIntEntry(secPreferences,ieCenterDebuggerRow,1)<>0;
-  { Preferences }
-  AutoSaveOptions:=INIFile^.GetIntEntry(secPreferences,ieAutoSave,AutoSaveOptions);
-  MiscOptions:=INIFile^.GetIntEntry(secPreferences,ieMiscOptions,MiscOptions);
-  DesktopLocation:=INIFile^.GetIntEntry(secPreferences,ieDesktopLocation,DesktopLocation);
-  { Misc }
-  ShowReadme:=INIFile^.GetIntEntry(secMisc,ieShowReadme,{integer(ShowReadme)}1)<>0;
-  Dispose(INIFile, Done);
- end;
-  ReadINIFile:=OK;
-end;
-
-function WriteINIFile: boolean;
-var INIFile: PINIFile;
-    S: string;
-    S1,S2,S3: string;
-    W: word;
-    BreakPointCount,WatchesCount:longint;
-    I(*,OpenFileCount*): integer;
-    OK: boolean;
-
-procedure ConcatName(P: PString); {$ifndef FPC}far;{$endif}
-begin
-  if (S<>'') then S:=S+';';
-  S:=S+P^;
-end;
-begin
-  New(INIFile, Init(IniFileName));
-  { Files }
-  { avoid keeping old files }
-  INIFile^.DeleteSection(secFiles);
-  INIFile^.SetEntry(secFiles,ieOpenExts,'"'+OpenExts+'"');
-  for I:=1 to High(RecentFiles) do
-    begin
-      if I<=RecentFileCount then
-         with RecentFiles[I] do S:=FileName+','+IntToStr(LastPos.X)+','+IntToStr(LastPos.Y)
-      else
-         S:='';
-      INIFile^.SetEntry(secFiles,ieRecentFile+IntToStr(I),S);
-    end;
-
-(*
-    PW:=FirstEditorWindow;
-    PPW:=PW;
-    I:=1;
-    while assigned(PW) do
-      begin
-        If PW^.HelpCtx=hcSourceWindow then
-          begin
-            With PW^.editor^ do
-              S:=FileName+','+IntToStr(CurPos.X)+','+IntToStr(CurPos.Y);
-            PW^.GetBounds(R);
-            S:=S+','+IntToStr(R.A.X)+','+IntToStr(R.A.Y)+','+
-              IntToStr(R.B.X)+','+IntToStr(R.B.Y);
-            INIFile^.SetEntry(secFiles,ieOpenFile+IntToStr(I),S);
-            Inc(I);
-            OpenFileCount:=I-1;
-          end;
-
-        PW:=PSourceWindow(PW^.next);
-        While assigned(PW) and (PW<>PPW) and (PW^.HelpCtx<>hcSourceWindow) do
-          PW:=PSourceWindow(PW^.next);
-        If PW=PPW then
-          break;
-      end;
-
-  INIFile^.SetIntEntry(secFiles,ieOpenFileCount,OpenFileCount);
-*)
-  { Run }
-  INIFile^.SetEntry(secRun,ieRunParameters,GetRunParameters);
-{$ifndef GABOR}
-  If DebuggeeTTY<>'' then
-    INIFile^.SetEntry(secRun,ieDebuggeeRedir,DebuggeeTTY);
-{$endif}
-  { Compile }
-  INIFile^.SetEntry(secCompile,iePrimaryFile,PrimaryFile);
-  INIFile^.SetEntry(secCompile,ieCompileMode,SwitchesModeStr[SwitchesMode]);
-  { Help }
-  S:='';
-  HelpFiles^.ForEach(@ConcatName);
-  INIFile^.SetEntry(secHelp,ieHelpFiles,'"'+S+'"');
-  { Editor }
-{$ifndef EDITORS}
-  INIFile^.SetIntEntry(secEditor,ieDefaultTabSize,DefaultTabSize);
-  INIFile^.SetIntEntry(secEditor,ieDefaultEditorFlags,DefaultCodeEditorFlags);
-  INIFile^.SetEntry(secEditor,ieDefaultSaveExt,DefaultSaveExt);
-{$endif}
-  { Highlight }
-  INIFile^.SetEntry(secHighlight,ieHighlightExts,'"'+HighlightExts+'"');
-  INIFile^.SetEntry(secHighlight,ieTabsPattern,'"'+TabsPattern+'"');
-  { SourcePath }
-  INIFile^.SetEntry(secSourcePath,ieSourceList,'"'+SourceDirs+'"');
-  { Mouse }
-  INIFile^.SetIntEntry(secMouse,ieDoubleClickDelay,DoubleDelay);
-  INIFile^.SetIntEntry(secMouse,ieReverseButtons,byte(MouseReverse));
-  INIFile^.SetIntEntry(secMouse,ieAltClickAction,AltMouseAction);
-  INIFile^.SetIntEntry(secMouse,ieCtrlClickAction,CtrlMouseAction);
-  { Search }
-  INIFile^.SetIntEntry(secSearch,ieFindFlags,FindFlags);
-  { Breakpoints }
-{$ifndef NODEBUG}
-  BreakPointCount:=BreakpointsCollection^.Count;
-  INIFile^.SetIntEntry(secBreakpoint,ieBreakpointCount,BreakpointCount);
-  for i:=1 to BreakpointCount do
-    WriteOneBreakPointEntry(I-1,INIFile);
-  WatchesCount:=WatchesCollection^.Count;
-  INIFile^.SetIntEntry(secWatches,ieWatchCount,WatchesCount);
-  for i:=1 to WatchesCount do
-    WriteOneWatchEntry(I-1,INIFile);
-{$endif}
-  { Tools }
-  INIFile^.DeleteSection(secTools);
-  for I:=1 to GetToolCount do
-    begin
-      S:=IntToStr(I);
-      GetToolParams(I-1,S1,S2,S3,W);
-      if S1<>'' then S1:='"'+S1+'"';
-      if S2<>'' then S2:='"'+S2+'"';
-      if S3<>'' then S3:='"'+S3+'"';
-      INIFile^.SetEntry(secTools,ieToolName+S,S1);
-      INIFile^.SetEntry(secTools,ieToolProgram+S,S2);
-      INIFile^.SetEntry(secTools,ieToolParams+S,S3);
-      INIFile^.SetIntEntry(secTools,ieToolHotKey+S,W);
-    end;
-  { Colors }
-  if AppPalette<>CIDEAppColor then
-  begin
-    { this has a bug. if a different palette has been read on startup, and
-      then changed back to match the default, this will not update it in the
-      ini file, eg. the original (non-default) will be left unmodified... }
-    S:=AppPalette;
-    INIFile^.SetEntry(secColors,iePalette+'_1_40',PaletteToStr(copy(S,1,40)));
-    INIFile^.SetEntry(secColors,iePalette+'_41_80',PaletteToStr(copy(S,41,40)));
-    INIFile^.SetEntry(secColors,iePalette+'_81_120',PaletteToStr(copy(S,81,40)));
-    INIFile^.SetEntry(secColors,iePalette+'_121_160',PaletteToStr(copy(S,121,40)));
-    INIFile^.SetEntry(secColors,iePalette+'_161_200',PaletteToStr(copy(S,161,40)));
-    INIFile^.SetEntry(secColors,iePalette+'_201_240',PaletteToStr(copy(S,201,40)));
-  end;
-  { Desktop }
-  INIFile^.SetIntEntry(secPreferences,ieDesktopFlags,DesktopFileFlags);
-  INIFile^.SetIntEntry(secPreferences,ieCenterDebuggerRow,byte(IniCenterDebuggerRow));
-  { Preferences }
-  INIFile^.SetIntEntry(secPreferences,ieAutoSave,AutoSaveOptions);
-  INIFile^.SetIntEntry(secPreferences,ieMiscOptions,MiscOptions);
-  INIFile^.SetIntEntry(secPreferences,ieDesktopLocation,DesktopLocation);
-  { Misc }
-  INIFile^.SetIntEntry(secMisc,ieShowReadme,integer(ShowReadme));
-  OK:=INIFile^.Update;
-  Dispose(INIFile, Done);
-  WriteINIFile:=OK;
-end;
-
-end.
-{
-  $Log$
-  Revision 1.6  2000-11-13 17:37:42  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.5  2000/11/13 16:59:09  pierre
-   * some function in double removed from fputils unit
-
-  Revision 1.5  2000/10/31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.4  2000/10/06 23:00:13  pierre
-   * remove comment conflit
-
-  Revision 1.1.2.4  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.3  2000/10/06 22:58:59  pierre
-   * fixes for linux GDB tty command (merged)
-
-  Revision 1.1.2.3  2000/10/06 22:52:35  pierre
-   * fixes for linux GDB tty command
-
-  Revision 1.2  2000/08/22 09:41:39  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.2  2000/08/16 18:46:14  peter
-   [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
-   [*] Make, Build now possible even in Compiler Messages Window
-   [+] when started in a new dir the IDE now ask whether to create a local
-       config, or to use the one located in the IDE dir
-
-  Revision 1.1.2.1  2000/07/20 11:02:15  michael
-  + Fixes from gabor. See fixes.txt
-
-  Revision 1.1  2000/07/13 09:48:34  michael
-  + Initial import
-
-  Revision 1.30  2000/06/22 09:07:12  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.29  2000/06/16 08:50:41  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.28  2000/03/21 23:30:22  pierre
-   adapted to wcedit addition by Gabor
-
-  Revision 1.27  2000/03/13 20:38:02  pierre
-    IniPath removed and IniFileName moved to fpvars unit
-
-  Revision 1.26  2000/02/04 00:08:35  pierre
-   + IniCenterDebuggerRow
-
-  Revision 1.25  1999/11/05 13:47:19  pierre
-   * Breakpoint conditions were not reloaded correctly
-
-  Revision 1.24  1999/09/16 14:34:59  pierre
-    + TBreakpoint and TWatch registering
-    + WatchesCollection and BreakpointsCollection stored in desk file
-    * Syntax highlighting was broken
-
-  Revision 1.23  1999/09/13 16:24:43  peter
-    + clock
-    * backspace unident like tp7
-
-  Revision 1.22  1999/09/07 09:21:54  pierre
-   + Watches saved
-
-  Revision 1.21  1999/08/03 20:22:33  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.20  1999/06/28 12:36:51  pierre
-   * avoid keeping old open file names
-
-  Revision 1.19  1999/04/07 21:55:48  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.18  1999/03/23 15:11:31  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.17  1999/03/12 01:13:58  peter
-    * flag if trytoopen should look for other extensions
-    + browser tab in the tools-compiler
-
-  Revision 1.16  1999/03/08 14:58:09  peter
-    + prompt with dialogs for tools
-
-  Revision 1.15  1999/03/05 17:53:02  pierre
-   + saving and opening of open files on exit
-
-  Revision 1.14  1999/03/01 15:41:55  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.13  1999/02/22 02:15:14  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.12  1999/02/19 18:43:46  peter
-    + open dialog supports mask list
-
-  Revision 1.11  1999/02/10 09:53:14  pierre
-  * better storing of breakpoints
-
-  Revision 1.10  1999/02/05 13:08:42  pierre
-   + new breakpoint types added
-
-  Revision 1.9  1999/02/05 12:11:55  pierre
-    + SourceDir that stores directories for sources that the
-      compiler should not know about
-      Automatically asked for addition when a new file that
-      needed filedialog to be found is in an unknown directory
-      Stored and retrieved from INIFile
-    + Breakpoints conditions added to INIFile
-    * Breakpoints insterted and removed at debin and end of debug session
-
-  Revision 1.8  1999/02/04 17:52:38  pierre
-   * bs_invalid renamed bs_deleted
-
-  Revision 1.7  1999/02/04 17:19:24  peter
-    * linux fixes
-
-  Revision 1.6  1999/02/04 13:32:04  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.5  1999/01/21 11:54:15  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.4  1999/01/04 11:49:45  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.1  1998/12/28 15:47:45  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-}

+ 0 - 288
ide/text/fpintf.pas

@@ -1,288 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Misc routines for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$i globdir.inc}
-
-unit FPIntf;
-interface
-
-{ Run }
-function  GetRunParameters: string;
-procedure SetRunParameters(const Params: string);
-
-{ Compile }
-procedure Compile(const FileName, ConfigFile: string);
-procedure SetPrimaryFile(const fn:string);
-function LinkAfter : boolean;
-
-
-implementation
-
-uses
-  Compiler,
-{$ifndef NODEBUG}
-  FPDebug,
-{$endif NODEBUG}
-  FPRedir,FPVars,
-  FPUtils,FPSwitch,WUtils;
-
-{****************************************************************************
-                                   Run
-****************************************************************************}
-
-var
-  RunParameters : string;
-
-function LinkAfter : boolean;
-begin
-  LinkAfter:=LinkAfterSwitches^.GetBooleanItem(0);
-end;
-
-function GetRunParameters: string;
-begin
-  GetRunParameters:=RunParameters;
-end;
-
-procedure SetRunParameters(const Params: string);
-begin
-  RunParameters:=Params;
-{$ifndef NODEBUG}
-  If assigned(Debugger) then
-    Debugger^.SetArgs(RunParameters);
-{$endif}
-end;
-
-
-{****************************************************************************
-                                   Compile
-****************************************************************************}
-
-procedure Compile(const FileName, ConfigFile: string);
-var
-  cmd : string;
-{$ifdef USE_EXTERNAL_COMPILER}
-  CompilerOut : Text;
-  CompilerOutputLine : longint;
-  V,p,p1,p2,lineNb,ColumnNb : longint;
-  error : word;
-  ModuleName,Line : string;
-  error_in_reading : boolean;
-{$endif USE_EXTERNAL_COMPILER}
-begin
-{$ifndef USE_EXTERNAL_COMPILER}
-  cmd:='-d'+SwitchesModeStr[SwitchesMode];
-  if ConfigFile<>'' then
-    cmd:='['+ConfigFile+'] '+cmd;
-{$else USE_EXTERNAL_COMPILER}
-  cmd:='-n -d'+SwitchesModeStr[SwitchesMode];
-  if ConfigFile<>'' then
-    cmd:='@'+ConfigFile+' '+cmd;
-  if not UseExternalCompiler then
-{$endif USE_EXTERNAL_COMPILER}
-{ Add the switches from the primary file }
-  if PrimaryFileSwitches<>'' then
-    cmd:=cmd+' '+PrimaryFileSwitches;
-  cmd:=cmd+' '+FileName;
-{ call the compiler }
-{$ifdef USE_EXTERNAL_COMPILER}
-  if UseExternalCompiler then
-    begin
-      If not LocateExeFile(ExternalCompilerExe) then
-        begin
-          CompilerMessageWindow^.AddMessage(
-            0,ExternalCompilerExe+' not found','',0,0);
-          exit;
-        end;
-      CompilerMessageWindow^.AddMessage(
-        0,'Running: '+ExternalCompilerExe+' '+cmd,'',0,0);
-      if not ExecuteRedir(ExternalCompilerExe,cmd,'','ppc___.out','ppc___.err') then
-        begin
-          CompilerMessageWindow^.AddMessage(
-            V_error,msg_errorinexternalcompilation,'',0,0);
-          CompilerMessageWindow^.AddMessage(
-            V_error,FormatStrInt(msg_iostatusis,IOStatus),'',0,0);
-          CompilerMessageWindow^.AddMessage(
-            V_error,FormatStrInt(msg_executeresultis,ExecuteResult),'',0,0);
-          if IOStatus<>0 then
-            exit;
-        end;
-      Assign(CompilerOut,'ppc___.out');
-      Reset(CompilerOut);
-      error_in_reading:=false;
-      CompilerOutputLine:=0;
-      While not eof(CompilerOut) do
-        begin
-          readln(CompilerOut,Line);
-          Inc(CompilerOutputLine);
-          p:=pos('(',line);
-          if p>0 then
-            begin
-              ModuleName:=copy(Line,1,p-1);
-              Line:=Copy(Line,p+1,255);
-              p1:=pos(',',Line);
-              val(copy(Line,1,p1-1),lineNb,error);
-              Line:=Copy(Line,p1+1,255);
-              p2:=pos(')',Line);
-              if error=0 then
-                val(copy(Line,1,p2-1),ColumnNb,error);
-              Line:=Copy(Line,p2+1,255);
-              V:=0;
-              { using constants here isn't a good idea, because this won't
-                work with localized versions of the compiler - Gabor }
-              If Pos(' Error:',line)=1 then
-                begin
-                  V:=V_error;
-                  Line:=Copy(Line,8,Length(Line));
-                end
-              else if Pos(' Fatal:',line)=1 then
-                begin
-                  V:=V_fatal;
-                  Line:=Copy(Line,8,Length(Line));
-                end
-              else if Pos(' Hint:',line)=1 then
-                begin
-                  V:=V_hint;
-                  Line:=Copy(Line,7,Length(Line));
-                end
-              else if Pos(' Note:',line)=1 then
-                begin
-                  V:=V_note;
-                  Line:=Copy(Line,7,Length(Line));
-                end;
-              if error=0 then
-                CompilerMessageWindow^.AddMessage(V,Line,ModuleName,LineNb,ColumnNb)
-              else
-                error_in_reading:=true;
-            end
-          else
-            CompilerMessageWindow^.AddMessage(0,Line,'',0,0);
-          ;
-        end;
-      Close(CompilerOut);
-    end
-  else
-{$endif USE_EXTERNAL_COMPILER}
-    Compiler.Compile(cmd);
-end;
-
-
-procedure SetPrimaryFile(const fn:string);
-var
-  t : text;
-begin
-  PrimaryFile:='';
-  PrimaryFileMain:='';
-  PrimaryFileSwitches:='';
-  PrimaryFilePara:='';
-  if UpcaseStr(ExtOf(fn))='.PRI' then
-   begin
-     assign(t,fn);
-     {$I-}
-     reset(t);
-     if ioresult=0 then
-      begin
-        PrimaryFile:=fn;
-        readln(t,PrimaryFileMain);
-        readln(t,PrimaryFileSwitches);
-        readln(t,PrimaryFilePara);
-        close(t);
-      end;
-     {$I+}
-     EatIO;
-   end
-  else
-   begin
-     PrimaryFile:=fn;
-     PrimaryFileMain:=fn;
-   end;
-  if PrimaryFilePara<>'' then
-   SetRunParameters(PrimaryFilePara);
-end;
-
-
-
-end.
-{
-  $Log$
-  Revision 1.3  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.2  2000/11/14 17:40:43  pierre
-   + External linking now optional
-
-  Revision 1.2  2000/11/13 17:37:42  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.1  2000/11/13 16:59:09  pierre
-   * some function in double removed from fputils unit
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.12  2000/06/22 09:07:12  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.11  2000/05/29 10:44:56  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.10  2000/05/02 08:42:27  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.9  2000/03/01 22:37:25  pierre
-   + USE_EXTERNAL_COMPILER
-
-  Revision 1.8  2000/01/03 11:38:34  michael
-  Changes from Gabor
-
-  Revision 1.7  1999/09/16 14:34:59  pierre
-    + TBreakpoint and TWatch registering
-    + WatchesCollection and BreakpointsCollection stored in desk file
-    * Syntax highlighting was broken
-
-  Revision 1.6  1999/06/30 23:58:15  pierre
-    + BreakpointsList Window implemented
-      with Edit/New/Delete functions
-    + Individual breakpoint dialog with support for all types
-      ignorecount and conditions
-      (commands are not yet implemented, don't know if this wolud be useful)
-      awatch and rwatch have problems because GDB does not annotate them
-      I fixed v4.16 for this
-
-  Revision 1.5  1999/06/21 23:38:37  pierre
-   + support for LinkAfter var
-
-  Revision 1.4  1999/03/12 01:12:22  peter
-    * extended primaryfile to load a .pri file
-
-  Revision 1.3  1999/02/05 13:51:41  peter
-    * unit name of FPSwitches -> FPSwitch which is easier to use
-    * some fixes for tp7 compiling
-
-  Revision 1.2  1998/12/28 15:47:45  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.4  1998/12/22 10:39:43  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 180
ide/text/fpmcomp.inc

@@ -1,180 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Compiler menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-procedure TIDEApp.Target;
-var R,R2: TRect;
-    D: PCenterDialog;
-    RB: PRadioButtons;
-    TargetCount,I: integer;
-    LastItem: PSItem;
-    L: longint;
-begin
-  TargetCount:=TargetSwitches^.ItemCount;
-  R.Assign(0,0,36,4+TargetCount);
-  New(D, Init(R, dialog_target));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-3,-1); Inc(R.A.Y);
-    R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y+TargetCount;
-    LastItem:=nil;
-    for I:=TargetCount-1 downto 0 do
-      LastItem:=NewSItem(TargetSwitches^.ItemName(I), LastItem);
-    New(RB, Init(R2, LastItem));
-    L:=ord(TargetSwitches^.GetCurrSel);
-    RB^.SetData(L);
-    Insert(RB);
-    R2.Copy(R);
-    R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, label_target_platform, RB)));
-  end;
-  InsertButtons(D);
-  RB^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-    begin
-       TargetSwitches^.SetCurrSel(RB^.Value);
-       { we allways need to recompile if we change
-         the target OS PM }
-       if L<>RB^.Value then
-         PrevMainFile:='';
-       UpdateTarget;
-    end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.UpdateTarget;
-var TargetMenu : PMenuItem;
-begin
-  TargetMenu:=PAdvancedMenuBar(MenuBar)^.GetMenuItem(cmTarget);
-  if assigned(TargetMenu) then
-    begin
-      If assigned(TargetMenu^.Param) then
-        DisposeStr(TargetMenu^.Param);
-      TargetMenu^.Param:=NewStr(KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)));
-    end;
-end;
-
-procedure TIDEApp.UpdateMode;
-var ModeMenu : PMenuItem;
-begin
-  ModeMenu:=PAdvancedMenuBar(MenuBar)^.GetMenuItem(cmSwitchesMode);
-  if assigned(ModeMenu) then
-    begin
-      If assigned(ModeMenu^.Param) then
-        DisposeStr(ModeMenu^.Param);
-      ModeMenu^.Param:=NewStr(KillTilde(SwitchesModeName[SwitchesMode]));
-    end;
-end;
-
-procedure TIDEApp.DoPrimaryFile;
-var
-  D : PFileDialog;
-  FileName : string;
-begin
-  New(D, Init('*.pri;*.pas',label_primaryfile_primaryfile,'*.pri;*.pas',fdOpenButton,hidPrimaryFile));
-  if Desktop^.ExecView(D)<>cmCancel then
-  begin
-    D^.GetFileName(FileName);
-    SetPrimaryFile(FileName);
-    UpdatePrimaryFile;
-  end;
-end;
-
-
-procedure TIDEApp.DoClearPrimary;
-begin
-  PrimaryFile:='';
-  PrimaryFileMain:='';
-  PrimaryFileSwitches:='';
-  PrimaryFilePara:='';
-  UpdatePrimaryFile;
-end;
-
-
-procedure TIDEApp.DoInformation;
-begin
-  if ProgramInfoWindow=nil then
-    begin
-      New(ProgramInfoWindow, Init);
-      Desktop^.Insert(ProgramInfoWindow);
-    end;
-  with ProgramInfoWindow^ do
-   begin
-     if not GetState(sfVisible) then
-       Show;
-     MakeFirst;
-   end;
-end;
-
-
-procedure TIDEApp.DoCompilerMessages;
-begin
-  if not CompilerMessageWindow^.GetState(sfVisible) then
-   CompilerMessageWindow^.Show;
-  CompilerMessageWindow^.MakeFirst;
-end;
-
-{
-  $Log$
-  Revision 1.2  2000-10-31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.9  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.8  2000/03/07 21:45:33  pierre
-   + TIDEApp.UpdateMode
-
-  Revision 1.7  2000/01/10 14:59:08  pierre
-   * force recompiling if we change target OS
-
-  Revision 1.6  1999/06/25 00:37:56  pierre
-   + UpdateTarget to see current target main in Menu
-
-  Revision 1.5  1999/04/07 21:55:49  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.4  1999/03/19 16:04:30  peter
-    * new compiler dialog
-
-  Revision 1.3  1999/03/12 01:13:59  peter
-    * flag if trytoopen should look for other extensions
-    + browser tab in the tools-compiler
-
-  Revision 1.2  1998/12/28 15:47:46  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.3  1998/12/22 10:39:44  peter
-    + Switches are now written/read
-    + find and replace routines
-
-}

+ 0 - 200
ide/text/fpmdebug.inc

@@ -1,200 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Debug menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-procedure TIDEApp.DoUserScreenWindow;
-begin
-  if UserScreenWindow=nil then
-    begin
-     New(UserScreenWindow, Init(UserScreen, SearchFreeWindowNo));
-     Desktop^.Insert(UserScreenWindow);
-    end;
-  UserScreenWindow^.MakeFirst;
-end;
-
-procedure TIDEApp.DoCloseUserScreenWindow;
-begin
-  if Assigned(UserScreenWindow) then
-    Message(UserScreenWindow,evCommand,cmClose,nil);
-end;
-
-procedure TIDEApp.DoUserScreen;
-begin
-  if UserScreen=nil then
-   begin
-     ErrorBox(msg_userscreennotavailable,nil);
-     Exit;
-   end;
-
-  ShowUserScreen;
-
-  InitKeyBoard;
-  Keyboard.GetKeyEvent;
-  while (Keyboard.PollKeyEvent<>0) do
-   Keyboard.GetKeyEvent;
-  DoneKeyboard;
-
-  ShowIDEScreen;
-end;
-
-procedure TIDEApp.DoShowCallStack;
-begin
-{$ifdef NODEBUG}
-  NoDebugger;
-{$else}
-  If not assigned(StackWindow) then
-    InitStackWindow
-  else
-    StackWindow^.MakeFirst;
-{$endif NODEBUG}
-end;
-
-procedure TIDEApp.DoShowRegisters;
-begin
-{$ifdef NODEBUG}
-  NoDebugger;
-{$else}
-  If not assigned(RegistersWindow) then
-    InitRegistersWindow
-  else
-    RegistersWindow^.MakeFirst;
-{$endif NODEBUG}
-end;
-procedure TIDEApp.DoShowBreakpointList;
-begin
-{$ifdef NODEBUG}
-  NoDebugger;
-{$else}
-  If assigned(BreakpointsWindow) then
-    begin
-      BreakpointsWindow^.Update;
-      BreakpointsWindow^.Show;
-      BreakpointsWindow^.MakeFirst;
-    end
-  else
-    begin
-      New(BreakpointsWindow,Init);
-      Desktop^.Insert(BreakpointsWindow);
-    end;
-{$endif NODEBUG}
-end;
-
-procedure TIDEApp.DoShowWatches;
-begin
-{$ifdef NODEBUG}
-  NoDebugger;
-{$else}
-  If assigned(WatchesWindow) then
-    begin
-      WatchesWindow^.Update;
-      WatchesWindow^.MakeFirst;
-    end
-  else
-    begin
-      New(WatchesWindow,Init);
-      Desktop^.Insert(WatchesWindow);
-    end;
-{$endif NODEBUG}
-end;
-
-procedure TIDEApp.DoAddWatch;
-{$ifdef NODEBUG}
-begin
-  NoDebugger;
-end;
-{$else}
-var
-  P: PWatch;
-  EditorWindow : PSourceWindow;
-  S : string;
-begin
-  EditorWindow:=FirstEditorWindow;
-  If assigned(EditorWindow) then
-    S:=LowerCaseStr(EditorWindow^.Editor^.GetCurrentWord)
-  else
-    S:='';
-  P:=New(PWatch,Init(S));
-  if ExecuteDialog(New(PWatchItemDialog,Init(P)),nil)<>cmCancel then
-    begin
-      WatchesCollection^.Insert(P);
-      WatchesCollection^.Update;
-      { If not assigned(WatchesWindow) then
-        should we only open it the first time ?? PM }
-        DoShowWatches;
-    end
-  else
-    dispose(P,Done);
-end;
-{$endif NODEBUG}
-
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:35  michael
-  + Initial import
-
-  Revision 1.13  2000/05/17 10:17:49  pierre
-   * Reinit the keyboard in ShowUserScreen
-
-  Revision 1.12  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.11  2000/02/04 00:13:59  pierre
-   * AddWatch calls DoShowWatches
-
-  Revision 1.10  2000/01/08 18:26:20  florian
-    + added a register window, doesn't work yet
-
-  Revision 1.9  1999/09/22 16:18:19  pierre
-   + TIDEApp.DoCloseUserScreenWindow
-
-  Revision 1.8  1999/09/09 14:20:05  pierre
-   + Stack Window
-
-  Revision 1.7  1999/07/28 23:11:19  peter
-    * fixes from gabor
-
-  Revision 1.6  1999/07/10 01:24:19  pierre
-   + First implementation of watches window
-
-  Revision 1.5  1999/06/30 23:58:17  pierre
-    + BreakpointsList Window implemented
-      with Edit/New/Delete functions
-    + Individual breakpoint dialog with support for all types
-      ignorecount and conditions
-      (commands are not yet implemented, don't know if this wolud be useful)
-      awatch and rwatch have problems because GDB does not annotate them
-      I fixed v4.16 for this
-
-  Revision 1.4  1999/06/25 00:36:51  pierre
-   + missing Debug menu added (not implemented yet)
-
-  Revision 1.3  1999/02/02 16:41:40  peter
-    + automatic .pas/.pp adding by opening of file
-    * better debuggerscreen changes
-
-  Revision 1.2  1999/01/21 11:54:16  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.1  1998/12/28 15:47:47  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-}

+ 0 - 35
ide/text/fpmedit.inc

@@ -1,35 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Edit menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-procedure TIDEApp.ShowClipboard;
-begin
-  ClipboardWindow^.Show;
-  ClipboardWindow^.Focus;
-end;
-
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:35  michael
-  + Initial import
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.2  1998/12/22 10:39:45  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 341
ide/text/fpmfile.inc

@@ -1,341 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    File menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-procedure TIDEApp.NewEditor;
-begin
-  OpenEditorWindow(nil,'',0,0);
-end;
-
-
-procedure TIDEApp.NewFromTemplate;
-var D: PCenterDialog;
-    R,R2: TRect;
-    SB: PScrollBar;
-    LB: PAdvancedListBox;
-    I: integer;
-    C: PUnsortedStringCollection;
-    TE: PSourceWindow;
-begin
-  if GetTemplateCount=0 then
-     begin InformationBox(msg_notemplatesavailable,nil); Exit; end;
-  New(C, Init(10,10));
-  R.Assign(0,0,40,14);
-  New(D, Init(R, dialog_newfromtemplate));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); Dec(R.B.X,12);
-    R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
-    New(SB, Init(R2)); Insert(SB);
-
-    New(LB, Init(R,1,SB));
-    LB^.Default:=true;
-    for I:=0 to GetTemplateCount-1 do
-      C^.Insert(NewStr(GetTemplateName(I)));
-    LB^.NewList(C);
-    Insert(LB);
-    Dec(R.A.Y); R.B.Y:=R.A.Y+1;
-    Insert(New(PLabel, Init(R, label_availabletemplates, LB)));
-
-    GetExtent(R2); R2.Grow(-2,-3); R2.A.X:=R.B.X+2; R2.B.Y:=R2.A.Y+2;
-    Insert(New(PButton, Init(R2, button_OK, cmOK, bfDefault)));
-    R2.Move(0,2);
-    Insert(New(PButton, Init(R2, button_Cancel, cmCancel, bfNormal)));
-  end;
-  LB^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-  begin
-{    Desktop^.Lock;}
-    TE:=OpenEditorWindow(nil,'',0,0);
-    if TE<>nil then
-    begin
-      StartTemplate(LB^.Focused,TE^.Editor);
-      TE^.Editor^.SetModified(false); { if nothing changes, we don't need to save it }
-(*      TE^.Hide; { we need this trick to get the editor updated }
-      TE^.Show;*)
-    end;
-{    Desktop^.UnLock;}
-  end;
-  Dispose(D, Done);
-  Dispose(C, Done);
-end;
-
-
-procedure TIDEApp.Open(FileName: string);
-var D: PFileDialog;
-    OpenIt: boolean;
-    DriveNumber : byte;
-    StoreDir,StoreDir2 : DirStr;
-begin
-  OpenIt:=FileName<>'';
-  DriveNumber:=0;
-  if not OpenIt then
-   begin
-     GetDir(0,StoreDir);
-     if (Length(FileDir)>1) and (FileDir[2]=':') then
-       begin
-         { does not assume that lowercase are greater then uppercase ! }
-         if (FileDir[1]>='a') and (FileDir[1]<='z') then
-           DriveNumber:=Ord(FileDir[1])-ord('a')+1
-         else
-           DriveNumber:=Ord(FileDir[1])-ord('A')+1;
-         GetDir(DriveNumber,StoreDir2);
-{$ifndef FPC}
-         ChDir(Copy(FileDir,1,2));
-           { sets InOutRes in win32 PM }
-{$endif not FPC}
-       end;
-     if FileDir<>'' then
-       ChDir(TrimEndSlash(FileDir));
-     New(D, Init(OpenExts,dialog_openafile,label_filetoopen,fdOpenButton,hidOpenSourceFile));
-     OpenIt:=Desktop^.ExecView(D)<>cmCancel;
-     { if I go to root under go32v2 and there is no
-       floppy I get a InOutRes = 152
-       get rid of it ! }
-     EatIO;
-     if OpenIt then
-       Begin
-         D^.GetFileName(FileName);
-         OpenExts:=D^.WildCard;
-         FileDir:=DirOf(FExpand(FileName));
-       End;
-     Dispose(D, Done);
-     if DriveNumber<>0 then
-       ChDir(TrimEndSlash(StoreDir2));
-{$ifndef FPC}
-     if (Length(StoreDir)>1) and (StoreDir[2]=':') then
-       ChDir(Copy(StoreDir,1,2));
-{$endif not FPC}
-     ChDir(TrimEndSlash(StoreDir));
-   end;
-  if OpenIt then
-   begin
-     FileName:=FExpand(LocatePasFile(FileName));
-     OpenEditorWindow(nil,FileName,0,0);
-   end;
-end;
-
-function TIDEApp.OpenSearch(FileName: string) : boolean;
-var D: PFileDialog;
-    OpenIt: boolean;
-    P : PString;
-    Dir,S : String;
-begin
-  OpenIt:=False;
-  if not OpenIt then
-   begin
-     ClearFormatParams; AddFormatParamStr(FileName);
-     FormatStr(S,label_lookingfor,FormatParams);
-     New(D, Init(FileName,dialog_openafile,S,fdOpenButton,hidOpenSourceFile));
-     OpenIt:=Desktop^.ExecView(D)<>cmCancel;
-     if OpenIt then
-       Begin
-         D^.GetFileName(FileName);
-       End;
-     Dispose(D, Done);
-   end;
-  if OpenIt then
-   begin
-     FileName:=FExpand(LocatePasFile(FileName));
-     Dir:=DirOf(FileName);
-     P:=@Dir;
-     If Pos(Dir+';',GetSourceDirectories)=0 then
-       if ConfirmBox(msg_confirmsourcediradd,@P,false)=cmYes then
-          SourceDirs:=SourceDirs+';'+Dir;
-
-     OpenEditorWindow(nil,FileName,0,0);
-   end;
-  OpenSearch:=OpenIt;
-end;
-
-
-procedure TIDEApp.OpenRecentFile(RecentIndex: integer);
-begin
-  with RecentFiles[RecentIndex] do
-  if OpenEditorWindow(nil,FileName,LastPos.X,LastPos.Y)<>nil then
-     RemoveRecentFile(RecentIndex);
-end;
-
-function TIDEApp.AskSaveAll: boolean;
-function CanClose(P: PView): boolean; {$ifndef FPC}far;{$endif}
-begin
-  CanClose:=not P^.Valid(cmQuit);
-end;
-begin
-  AskSaveAll:=Desktop^.FirstThat(@CanClose)=nil;
-end;
-
-function TIDEApp.SaveAll: boolean;
-
-  procedure SendSave(P: PView); {$ifndef FPC}far;{$endif}
-  begin
-    Message(P,evCommand,cmSave,nil);
-  end;
-
-begin
-  SaveCancelled:=false;
-  Desktop^.ForEach(@SendSave);
-  SaveAll:=not SaveCancelled;
-end;
-
-
-procedure TIDEApp.ChangeDir;
-begin
-  ExecuteDialog(New(PChDirDialog, Init(cdNormal, hisChDirDialog)),nil);
-  CurDirChanged;
-end;
-
-{
-  $Log$
-  Revision 1.2  2000-10-31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.21  2000/06/16 08:50:41  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.20  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.19  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.18  2000/03/21 23:29:52  pierre
-   + Use TrimEndSlash by Gabor
-
-  Revision 1.17  1999/12/01 16:48:09  pierre
-   * avoid problems after going to root directory
-
-  Revision 1.16  1999/11/30 17:15:32  pierre
-   * avoid chdir('d:') in FPC
-
-  Revision 1.15  1999/10/29 13:47:00  pierre
-   * typo error corrected
-
-  Revision 1.14  1999/10/27 10:44:08  pierre
-   * Avoid ChDir('') gives sometimes DosError 3 !!
-
-  Revision 1.13  1999/08/16 18:25:20  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.12  1999/08/03 20:22:34  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.11  1999/06/25 00:35:54  pierre
-   + uses weditor FileDir var to remember Directory for Open/Save
-
-  Revision 1.10  1999/03/23 15:11:32  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.9  1999/02/19 18:43:47  peter
-    + open dialog supports mask list
-
-  Revision 1.8  1999/02/05 12:11:57  pierre
-    + SourceDir that stores directories for sources that the
-      compiler should not know about
-      Automatically asked for addition when a new file that
-      needed filedialog to be found is in an unknown directory
-      Stored and retrieved from INIFile
-    + Breakpoints conditions added to INIFile
-    * Breakpoints insterted and removed at debin and end of debug session
-
-  Revision 1.7  1999/02/04 13:32:05  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.6  1999/02/02 16:41:41  peter
-    + automatic .pas/.pp adding by opening of file
-    * better debuggerscreen changes
-
-  Revision 1.5  1999/01/21 11:54:17  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.4  1999/01/14 21:42:21  peter
-    * source tracking from Gabor
-
-  Revision 1.3  1999/01/04 11:49:46  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.2  1998/12/28 15:47:47  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.4  1998/12/24 08:27:12  gabor
-    + displaying 'opening source file...' text while reading
-  Revision 1.3  1998/12/22 10:39:46  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 338
ide/text/fpmhelp.inc

@@ -1,338 +0,0 @@
-{
-    $Id$
-    This file is part of the ffff
-    Copyright (c) 1998 by Berczi Gabor
-
-    Help menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-procedure TIDEApp.HelpContents;
-begin
-  HelpTopic('Help_Contents'{0,hcContents,false});
-end;
-
-procedure TIDEApp.HelpHelpIndex;
-begin
-  HelpIndex('');
-end;
-
-procedure TIDEApp.HelpTopicSearch;
-begin
-end;
-
-procedure TIDEApp.HelpPrevTopic;
-begin
-  if HelpWindow=nil then HelpContents else
-  with HelpWindow^ do
-  if GetState(sfVisible) then Message(HelpWindow^.HelpView,evCommand,cmPrevTopic,nil)
-     else begin HelpWindow^.Show; HelpWindow^.MakeFirst; end;
-end;
-
-procedure TIDEApp.HelpUsingHelp;
-begin
-  Help(0,hcUsingHelp,false);
-end;
-
-type
-    PHelpFileListBox = ^THelpFileListBox;
-    THelpFileListBox = object(TListBox)
-      function GetText(Item: sw_Integer; MaxLen: sw_Integer): String; virtual;
-    end;
-
-    PHelpFilesDialog = ^THelpFilesDialog;
-    THelpFilesDialog = object(TCenterDialog)
-      constructor Init;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      destructor  Done; virtual;
-    private
-      LB: PHelpFileListBox;
-      C : PUnsortedStringCollection;
-    end;
-
-function THelpFileListBox.GetText(Item: sw_Integer; MaxLen: sw_Integer): String;
-var S: string;
-    P: integer;
-begin
-  S:=inherited GetText(Item,MaxLen);
-  P:=Pos('|',S);
-  if P>0 then S:=copy(S,P+1,255)+' - '+copy(S,1,P-1);
-  GetText:=copy(S,1,MaxLen);
-end;
-
-constructor THelpFilesDialog.Init;
-var R,R2: TRect;
-    SB: PScrollBar;
-    I: integer;
-begin
-  R.Assign(0,0,round(ScreenWidth*5/8),ScreenHeight-10);
-  inherited Init(R, dialog_helpfiles);
-
-  New(C, Init(20,10));
-
-  GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.B.X:=R.B.X-13;
-  R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
-  New(SB, Init(R2)); Insert(SB);
-  New(LB, Init(R, 1, SB));
-
-  for I:=0 to HelpFiles^.Count-1 do
-    begin
-      C^.Insert(NewStr(HelpFiles^.At(I)^));
-    end;
-
-  LB^.NewList(C);
-  Insert(LB);
-  R2.Copy(R); Dec(R2.A.Y); R2.B.Y:=R2.A.Y+1;
-  Insert(New(PLabel, Init(R2, label_helpfiles_helpfiles, LB)));
-
-  GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.A.X:=R.B.X-13+1; R.B.Y:=R.A.Y+2;
-  Insert(New(PButton, Init(R, button_OK, cmOK, bfDefault)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_New, cmAddItem, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Delete, cmDeleteItem, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Cancel, cmCancel, bfNormal)));
-
-  LB^.Select;
-end;
-
-procedure THelpFilesDialog.HandleEvent(var Event: TEvent);
-var I: integer;
-    D: PFileDialog;
-    FileName: string;
-    Re: word;
-    S: string;
-    LS: PFPHTMLFileLinkScanner;
-    BS: PBufStream;
-begin
-  case Event.What of
-    evKeyDown :
-      case Event.KeyCode of
-        kbIns :
-          begin
-            Message(@Self,evCommand,cmAddItem,nil);
-            ClearEvent(Event);
-          end;
-        kbDel :
-          begin
-            Message(@Self,evCommand,cmDeleteItem,nil);
-            ClearEvent(Event);
-          end;
-      end;
-    evCommand :
-      case Event.Command of
-        cmAddItem :
-          begin
-            S:='';
-            New(D, Init(HelpFileExts,
-              dialog_installhelpfile,
-              label_installhelpfile_filename,
-              fdOpenButton,hidOpenHelpFile));
-            Re:=Desktop^.ExecView(D);
-            if Re<>cmCancel then
-            begin
-              D^.GetFileName(FileName);
-              if UpcaseStr(ExtOf(FileName))=UpcaseStr(HTMLIndexExt) then
-                begin
-                  S:='HTML Index';
-                end
-              else
-              if UpcaseStr(copy(ExtOf(FileName),1,length(HTMLExt)))=UpcaseStr(HTMLExt) then
-              begin
-                Re:=ConfirmBox(msg_createkeywordindexforhelpfile,nil,true);
-                if Re<>cmCancel then
-                if Re=cmNo then
-                  Re:=InputBox(dialog_topictitle,label_topictitle_title,S,40)
-                else
-                  begin
-                    ShowMessage(msg_pleasewaitwhilecreatingindex);
-                    S:='HTML Index';
-                    PushStatus(FormatStrStr(msg_buildingindexfile,FileName));
-                    New(LS, Init(DirOf(FileName)));
-                    LS^.ProcessDocument(FileName,[soSubDocsOnly]);
-                    if LS^.GetDocumentCount=0 then
-                      begin
-                        ErrorBox(FormatStrStr(msg_filedoesnotcontainanylinks,FileName),nil);
-                        Re:=cmCancel;
-                      end
-                    else
-                      begin
-                        FileName:=DirAndNameOf(FileName)+HTMLIndexExt;
-                        if ExistsFile(FileName) then
-                          if ConfirmBox(FormatStrStr(msg_filealreadyexistsoverwrite,FileName),nil,true)<>cmYes then
-                            Re:=cmCancel;
-                        if Re<>cmCancel then
-                        begin
-                          PushStatus(FormatStrStr(msg_storinghtmlindexinfile,FileName));
-                          New(BS, Init(FileName, stCreate, 4096));
-                          if Assigned(BS)=false then
-                            begin
-                              ErrorBox(FormatStrStr(msg_cantcreatefile,FileName),nil);
-                              Re:=cmCancel;
-                            end
-                          else
-                            begin
-                              LS^.StoreDocuments(BS^);
-                              if BS^.Status<>stOK then
-                                begin
-                                  ErrorBox(FormatStrInt(msg_errorstoringindexdata,BS^.Status),nil);
-                                  Re:=cmCancel;
-                                end;
-                              Dispose(BS, Done);
-                            end;
-                          PopStatus;
-                        end;
-                      end;
-                    Dispose(LS, Done);
-                    PopStatus;
-                    HideMessage;
-                  end;
-              end;
-            end;
-            if Re<>cmCancel then
-            begin
-              if S<>'' then FileName:=FileName+'|'+S;
-              LB^.List^.Insert(NewStr(FileName));
-              LB^.SetRange(LB^.List^.Count);
-              ReDraw;
-            end;
-            Dispose(D, Done);
-            ClearEvent(Event);
-          end;
-        cmDeleteItem :
-          if LB^.Range>0 then
-          begin
-            LB^.List^.AtFree(LB^.Focused);
-            LB^.SetRange(LB^.List^.Count);
-            ReDraw;
-            ClearEvent(Event);
-          end;
-        cmOK :
-          begin
-            HelpFiles^.FreeAll;
-            for I:=0 to LB^.List^.Count-1 do
-              HelpFiles^.Insert(NewStr(C^.At(I)^));
-          end;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-destructor THelpFilesDialog.Done;
-begin
-  if C<>nil then begin C^.DeleteAll; Dispose(C, Done); end;
-  inherited Done;
-end;
-
-procedure TIDEApp.HelpFiles;
-begin
-  if Desktop^.ExecView(New(PHelpFilesDialog, Init))=cmOK then
-  begin
-    DoneHelpSystem;
-    Message(Application,evBroadcast,cmHelpFilesChanged,nil);
-    InitHelpSystem;
-  end;
-end;
-
-procedure TIDEApp.About;
-begin
-  ExecuteDialog(New(PFPAboutDialog, Init), nil);
-end;
-
-{
-  $Log$
-  Revision 1.2  2000-10-31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.11  2000/05/29 10:44:57  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.10  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.9  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.8  2000/02/07 08:29:13  michael
-  [*] the fake (!) TOKENS.PAS still contained the typo bug
-       FSplit(,n,d,e) (correctly FSplit(,d,n,e))
-  [*] CodeComplete had a very ugly bug - coordinates were document-relative
-      (instead of being screen-relative)
-  [*] TResourceStream didn't count the size of the resource names when
-      determining the file size and this could lead to the last resources not
-      loaded correctly
-
-
-  [+] Ctrl-Enter in editor now tries to open the file at cursor
-  [+] CodeComplete option added to Options|Environment|Editor
-  [+] user interface for managing CodeComplete implemented
-  [+] user interface for CodeTemplates implemented
-  [+] CodeComplete wordlist and CodeTemplates stored in desktop file
-  [+] help topic size no longer limited to 64KB when compiled with FPC
-
-  Revision 1.7  1999/05/22 13:44:31  peter
-    * fixed couple of bugs
-
-  Revision 1.6  1999/03/01 15:41:56  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.5  1999/02/22 02:15:16  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.4  1999/01/21 11:54:18  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.3  1999/01/12 14:29:34  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.2  1998/12/28 15:47:48  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.2  1998/12/22 10:39:47  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 1454
ide/text/fpmopts.inc

@@ -1,1454 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Options menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-procedure TIDEApp.SetSwitchesMode;
-var R,R2: TRect;
-    D: PCenterDialog;
-    RB: PRadioButtons;
-    i : TSwitchMode;
-    SwitchesCount : integer;
-    LastItem: PSItem;
-    L: longint;
-begin
-  SwitchesCount:=ord(high(TSwitchMode))-ord(low(TSwitchMode))+1;
-  R.Assign(0,0,36,4+SwitchesCount);
-  New(D, Init(R, dialog_switchesmode));
-  with D^ do
-  begin
-    GetExtent(R);
-    R.Grow(-3,-1);
-    Inc(R.A.Y);
-    R2.Copy(R);
-    Inc(R2.A.Y);
-    R2.B.Y:=R2.A.Y+SwitchesCount;
-    LastItem:=nil;
-    for I:=high(TSwitchMode) downto low(TSwitchMode) do
-      LastItem:=NewSItem(SwitchesModeName[I], LastItem);
-    New(RB, Init(R2, LastItem));
-    L:=ord(SwitchesMode);
-    { ^^^ this is necessary, since TRadioButtons.GetData() reads a full
-      longint and by just specifying the SwitchesMode var (only 1 bytes),
-      the three bytes located next to it in the memory will determine the
-      three most significant bytes of the longint. And if they aren't all
-      zero, then we will select some items outside the actual ones... }
-    RB^.SetData(L);
-    Insert(RB);
-    R2.Copy(R);
-    R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, static_switchesmode_switchesmode, RB)));
-  end;
-  InsertButtons(D);
-  RB^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-   SwitchesMode:=TSwitchMode(RB^.Value);
-  Dispose(D, Done);
-  UpdateMode;
-  UpdateTarget;
-end;
-
-procedure TIDEApp.DoCompilerSwitch;
-var R,R2,R3,TabR,TabIR: TRect;
-    D: PCenterDialog;
-    CB1,CB2,CB3,CB4,CB5: PCheckBoxes;
-    RB1,{RB2,}RB3,RB4,RB5,RB6: PRadioButtons;
-    Items: PSItem;
-    IL: PInputLine;
-    Count : integer;
-    I,L: longint;
-    Tab: PTab;
-    Label11,{Label12,}
-    Label21,Label22,Label23,
-    Label31,Label41,
-    Label51,Label52,Label53: PLabel;
-begin
-  R.Assign(0,0,72,18);
-  New(D, Init(R, dialog_compilerswitches));
-  with D^ do
-  begin
-    GetExtent(R);
-    R.Grow(-2,-1);
-    Dec(R.B.Y,2);
-    TabR.Copy(R);
-    TabIR.Copy(R);
-    Inc(TabIR.A.Y,2);
-    TabIR.Grow(0,-1);
-
-    { --- Sheet 1 --- }
-    Count:=SyntaxSwitches^.ItemCount;
-    R.Copy(TabIR);
-    R2.Copy(R);
-{    R2.B.X:=(R2.A.X+(R2.B.X-R2.A.X) div 2)-2;} R2.B.X:=R2.B.X-4;
-    R2.B.Y:=R2.A.Y+((Count+1) div 2);
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(SyntaxSwitches^.ItemName(I), Items);
-    New(CB1, Init(R2, Items));
-    for I:=0 to Count-1 do
-      if SyntaxSwitches^.GetBooleanItem(I) then
-        CB1^.Press(I);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label11, Init(R2, label_compiler_syntaxswitches, CB1));
-
-    { --- Sheet 2 --- }
-    Count:=CodegenSwitches^.ItemCount;
-    R2.Copy(TabIR);
-    R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2-2;
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(CodegenSwitches^.ItemName(I), Items);
-    New(CB3, Init(R2, Items));
-    for I:=0 to Count-1 do
-      if CodegenSwitches^.GetBooleanItem(I) then
-        CB3^.Press(I);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label21, Init(R2, label_compiler_runtimechecks, CB3));
-
-    Count:=OptimizingGoalSwitches^.ItemCount;
-    R2.Copy(TabIR);
-    R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
-    Dec(R2.B.X,4);
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(OptimizingGoalSwitches^.ItemName(I), Items);
-    New(RB3, Init(R2, Items));
-    for I:=0 to Count-1 do
-      if OptimizingGoalSwitches^.GetBooleanItem(I) then
-        RB3^.Press(I);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label22, Init(R2, label_compiler_optimizations, RB3));
-
-    Count:=OptimizationSwitches^.ItemCount;
-    R2.Copy(TabIR);
-    R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
-    Dec(R2.B.X,4);
-    Inc(R2.A.Y, OptimizingGoalSwitches^.ItemCount);
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(OptimizationSwitches^.ItemName(I), Items);
-    New(CB2, Init(R2, Items));
-    for I:=0 to Count-1 do
-      if OptimizationSwitches^.GetBooleanItem(I) then
-        CB2^.Press(I);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-
-    Count:=ProcessorSwitches^.ItemCount;
-    R2.Copy(TabIR);
-    R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2-2;
-    Inc(R2.A.Y,CodegenSwitches^.ItemCount+2);
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(ProcessorSwitches^.ItemName(I), Items);
-    New(RB1, Init(R2, Items));
-    L:=ProcessorSwitches^.GetCurrSel;
-    RB1^.SetData(L);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label23, Init(R2, label_compiler_targetprocessor, RB1));
-
-    { --- Sheet 3 --- }
-    Count:=VerboseSwitches^.ItemCount;
-    R.Copy(TabIR);
-    R2.Copy(R);
-    R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2;
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(VerboseSwitches^.ItemName(I), Items);
-    New(CB4, Init(R2, Items));
-    for I:=0 to Count-1 do
-      if VerboseSwitches^.GetBooleanItem(I) then
-        CB4^.Press(I);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label31, Init(R2, label_compiler_verboseswitches, CB4));
-
-    { --- Sheet 4 --- }
-    Count:=BrowserSwitches^.ItemCount;
-    R.Copy(TabIR);
-    R2.Copy(R);
-    R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2;
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(BrowserSwitches^.ItemName(I), Items);
-    New(RB4, Init(R2, Items));
-    L:=BrowserSwitches^.GetCurrSel;
-    RB4^.SetData(L);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label41, Init(R2, label_compiler_browser, RB4));
-
-    { --- Sheet 5 --- }
-    Count:=AsmReaderSwitches^.ItemCount;
-    R2.Copy(TabIR);
-    R2.B.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
-    Dec(R2.B.X,4);
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(AsmReaderSwitches^.ItemName(I), Items);
-    New(RB5, Init(R2, Items));
-    L:=AsmReaderSwitches^.GetCurrSel;
-    RB5^.SetData(L);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label51, Init(R2, label_compiler_assemblerreader, RB5));
-
-    R2.Copy(TabIR);
-    R2.B.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
-    Dec(R2.B.X,4);
-    R2.A.Y:=R2.A.Y+Count+2;
-    Count:=AsmInfoSwitches^.ItemCount;
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(AsmInfoSwitches^.ItemName(I), Items);
-    New(CB5, Init(R2, Items));
-    for I:=0 to Count-1 do
-      if AsmInfoSwitches^.GetBooleanItem(I) then
-        CB5^.Press(I);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label52, Init(R2, label_compiler_assemblerinfo, CB5));
-
-    Count:=AsmOutputSwitches^.ItemCount;
-    R2.Copy(TabIR);
-    R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
-    Dec(R2.B.X,4);
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(AsmOutputSwitches^.ItemName(I), Items);
-    New(RB6, Init(R2, Items));
-    L:=AsmOutputSwitches^.GetCurrSel;
-    RB6^.SetData(L);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label53, Init(R2, label_compiler_assembleroutput, RB6));
-
-    { create tabs }
-    New(Tab, Init(TabR,
-      NewTabDef(page_compiler_syntax,CB1,
-        NewTabItem(Label11,
-        NewTabItem(CB1,
-        nil)),
-      NewTabDef(page_compiler_codegeneration,CB3,
-        NewTabItem(Label21,
-        NewTabItem(CB3,
-        NewTabItem(Label22,
-        NewTabItem(CB2,
-        NewTabItem(Label23,
-        NewTabItem(RB3,
-        NewTabItem(RB1,
-        nil))))))),
-      NewTabDef(page_compiler_verbose,CB4,
-        NewTabItem(Label31,
-        NewTabItem(CB4,
-        nil)),
-      NewTabDef(page_compiler_browser,RB4,
-        NewTabItem(Label41,
-        NewTabItem(RB4,
-        nil)),
-      NewTabDef(page_compiler_assembler,CB1,
-        NewTabItem(Label51,
-        NewTabItem(RB5,
-        NewTabItem(Label52,
-        NewTabItem(CB5,
-        NewTabItem(Label53,
-        NewTabItem(RB6,
-        nil)))))),
-      nil)))))));
-    Tab^.GrowMode:=0;
-    Insert(Tab);
-
-    { conditionnals }
-    R2.Copy(TabR); R2.A.Y:=R2.B.Y+1; R2.B.Y:=R2.A.Y+1; Dec(R2.B.X,4);
-    New(IL, Init(R2, 128));
-    IL^.Data^:=ConditionalSwitches^.GetStringItem(0);
-    Insert(IL);
-    R3.Copy(R2); R3.A.X:=R2.B.X+1; R3.B.X:=R3.A.X+3;
-    Insert(New(PHistory, Init(R3, IL, hidConditionalDefines)));
-    R2.Move(0,-1);
-    Insert(New(PLabel, Init(R2,ConditionalSwitches^.ItemName(0), IL)));
-  end;
-  InsertButtons(D);
-  if Desktop^.ExecView(D)=cmOK then
-  begin
-    for I:=0 to SyntaxSwitches^.ItemCount-1 do
-      SyntaxSwitches^.SetBooleanItem(I,CB1^.Mark(I));
-    for I:=0 to CodeGenSwitches^.ItemCount-1 do
-      CodegenSwitches^.SetBooleanItem(I,CB3^.Mark(I));
-    for I:=0 to OptimizationSwitches^.ItemCount-1 do
-      OptimizationSwitches^.SetBooleanItem(I,CB2^.Mark(I));
-    for I:=0 to VerboseSwitches^.ItemCount-1 do
-      VerboseSwitches^.SetBooleanItem(I,CB4^.Mark(I));
-    OptimizingGoalSwitches^.SetCurrSel(RB3^.Value);
-    ProcessorSwitches^.SetCurrSel(RB1^.Value);
-    AsmReaderSwitches^.SetCurrSel(RB5^.Value);
-    for I:=0 to AsmInfoSwitches^.ItemCount-1 do
-      AsmInfoSwitches^.SetBooleanItem(I,CB5^.Mark(I));
-    AsmOutputSwitches^.SetCurrSel(RB6^.Value);
-    BrowserSwitches^.SetCurrSel(RB4^.Value);
-    ConditionalSwitches^.SetStringItem(0,IL^.Data^);
-  end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.MemorySizes;
-var R,R2,R3: TRect;
-    D: PCenterDialog;
-    ILs: array[0..10] of PIntegerLine;
-    I: integer;
-begin
-  R.Assign(0,0,40,2+MemorySwitches^.ItemCount*2);
-  New(D, Init(R, dialog_memorysizes));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-3,-1);
-    R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y+1;
-    for I:=0 to MemorySwitches^.ItemCount-1 do
-     begin
-       R3.Copy(R2); R3.A.X:=21; R3.B.X:=R3.A.X+10;
-       New(ILs[I], Init(R3, MinMemSize, MaxMemSize));
-       ILs[I]^.Data^:=IntToStr(MemorySwitches^.GetLongintItem(I));
-       Insert(ILs[I]);
-       R3.Copy(R2); R3.B.X:=21;
-       Insert(New(PLabel, Init(R3, MemorySwitches^.ItemName(I), ILs[I])));
-       R2.Move(0,2);
-     end;
-
-{    R3.Copy(R2); R3.A.X:=21; R3.B.X:=R3.A.X+10;
-    New(IL2, Init(R3, MinHeapSize, MaxHeapSize));
-    IL2^.Data^:=IntToStr(GetHeapSize);
-    Insert(IL2);
-    R3.Copy(R2); R3.B.X:=21;
-    Insert(New(PLabel, Init(R3, 'Local ~h~eap size', IL2)));}
-  end;
-  InsertButtons(D);
-  ILs[0]^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-  begin
-    for I:=0 to MemorySwitches^.ItemCount-1 do
-     begin
-       MemorySwitches^.SetLongintItem(I,StrToInt(ILs[I]^.Data^));
-     end;
-{    SetStackSize(StrToInt(IL1^.Data^));
-    SetHeapSize(StrToInt(IL2^.Data^));}
-  end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.DoLinkerSwitch;
-var R,R2: TRect;
-    D: PCenterDialog;
-    RB2: PRadioButtons;
-    CB : PCheckBoxes;
-    Count,I: longint;
-    Items: PSItem;
-    L: longint;
-begin
-  R.Assign(0,0,66,8);
-  New(D, Init(R, dialog_linker));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-3,-1);
-    Count:=LinkAfterSwitches^.ItemCount;
-    R2.Copy(R);
-    R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2 - 1;
-    Inc(R2.A.Y,1);
-    R2.B.Y:=R2.A.Y+Count;
-    Items:=nil;
-    for I:=Count-1 downto 0 do
-      Items:=NewSItem(LinkAfterSwitches^.ItemName(I), Items);
-    New(CB, Init(R2, Items));
-    for I:=0 to Count-1 do
-      if LinkAfterSwitches^.GetBooleanItem(I) then
-        CB^.Press(I);
-    Insert(CB);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, label_compiler_linkafter, CB)));
-
-    R2.Copy(R); Inc(R2.A.Y);
-    R2.B.Y:=R2.A.Y+LibLinkerSwitches^.ItemCount;
-    R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2+1;
-    Items:=nil;
-    for I:=LibLinkerSwitches^.ItemCount-1 downto 0 do
-      Items:=NewSItem(LibLinkerSwitches^.ItemName(I), Items);
-    New(RB2, Init(R2, Items));
-    L:=LibLinkerSwitches^.GetCurrSel;
-    RB2^.SetData(L);
-    Insert(RB2);
-
-    R2.Copy(R); R2.B.Y:=R2.A.Y+1; R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2+1;
-    Insert(New(PLabel, Init(R2, label_linker_preferredlibtype, RB2)));
-  end;
-  InsertButtons(D);
-  RB2^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-  begin
-{    SetEXEFormat(TEXEFormat(RB1^.Value+1));}
-    LibLinkerSwitches^.SetCurrSel(RB2^.Value);
-    if LibLinkerSwitches^.GetCurrSelParam='X' then
-     if CompareText(TargetSwitches^.GetCurrSelParam,'win32')=0 then
-      if CompareText(AsmOutputSwitches^.GetCurrSelParam,'pecoff')<>0 then
-        if ConfirmBox(
-          FormatStrStr3(msg_xmustbesettoyforz_doyouwanttochangethis,
-           label_compiler_assembleroutput,'pecoff','smartlinking'),nil,false)=cmYes then
-             AsmOutputSwitches^.SetCurrSelParam('pecoff');
-    for I:=0 to LinkAfterSwitches^.ItemCount-1 do
-      LinkAfterSwitches^.SetBooleanItem(I,CB^.Mark(I));
-  end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.DoDebuggerSwitch;
-
-var R,R2,R3: TRect;
-    D: PCenterDialog;
-    RB : PRadioButtons;
-    CB: PCheckBoxes;
-{$ifdef win32}
-    CB2: PCheckBoxes;
-{$endif win32}
-{$ifdef Unix}
-    IL: PInputLine;
-{$endif Unix}
-    IL2: PInputLine;
-    L,I: longint;
-    Items: PSItem;
-const
-{$ifdef win32}
-  OtherFieldLines = 3;
-{$else not win32}
-{$ifdef Unix}
-  OtherFieldLines = 3;
-{$else not Unix}
-  OtherFieldLines = 0;
-{$endif Unix}
-{$endif win32}
-begin
-  R.Assign(0,0,60,2+DebugInfoSwitches^.ItemCount+2
-      +ProfileInfoSwitches^.ItemCount+2+2+1+OtherFieldLines);
-  New(D, Init(R, dialog_debugger));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-3,-1);
-    R2.Copy(R); Inc(R2.A.Y,2); R2.B.Y:=R2.A.Y+DebugInfoSwitches^.ItemCount;
-    Items:=nil;
-    for I:=DebugInfoSwitches^.ItemCount-1 downto 0 do
-      Items:=NewSItem(DebugInfoSwitches^.ItemName(I), Items);
-    New(RB, Init(R2, Items));
-    L:=DebugInfoSwitches^.GetCurrSel;
-    RB^.SetData(L);
-    Insert(RB);
-    R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, label_debugger_debuginfo, RB)));
-
-    R2.Copy(R); Inc(R2.A.Y,2+DebugInfoSwitches^.ItemCount+2); R2.B.Y:=R2.A.Y+ProfileInfoSwitches^.ItemCount;
-    Items:=nil;
-    for I:=ProfileInfoSwitches^.ItemCount-1 downto 0 do
-      Items:=NewSItem(ProfileInfoSwitches^.ItemName(I), Items);
-    New(CB, Init(R2, Items));
-    L:=ProfileInfoSwitches^.GetCurrSel;
-    If L = 1 then L:=3;
-    CB^.SetData(L);
-    Insert(CB);
-    R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, label_debugger_profileswitches, CB)));
-
-    {custom }
-    Inc(R2.A.Y,1+DebugInfoSwitches^.ItemCount+1); R2.B.Y:=R2.A.Y+1;
-    R3.Copy(R2); Dec(R3.B.X,4);
-    New(IL2, Init(R3, 255));
-    IL2^.Data^:=CustomArg[SwitchesMode];
-    Insert(IL2);
-    R3.Copy(R2); R3.A.X:=R3.B.X-3; R3.B.X:=R3.A.X+3;
-    Insert(New(PHistory, Init(R3, IL2, hidCompilerArgs)));
-    R2.Move(0,-1);
-    Insert(New(PLabel, Init(R2,label_debugger_compilerargs, IL2)));
-{$ifdef win32}
-    R2.Move(0,4);
-    New(CB2,Init(R2,NewSItem(label_debugger_useanotherconsole, nil)));
-    Insert(CB2);
-    if DebuggeeTTY<>'' then
-      L:=1
-    else
-      L:=0;
-    CB2^.SetData(L);
-    R2.Move(0,-1);
-    Insert(New(PLabel, Init(R2,label_debugger_redirection, CB2)));
-{$endif win32}
-{$ifdef Unix}
-    R2.Move(0,4);
-    New(IL, Init(R2, 255));
-    IL^.Data^:=DebuggeeTTY;
-    Insert(IL);
-    R2.Move(0,-1);
-    Insert(New(PLabel, Init(R2,label_debugger_useanothertty, IL)));
-{$endif win32}
-  end;
-  InsertButtons(D);
-  RB^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-  begin
-    DebugInfoSwitches^.SetCurrSel(RB^.Value);
-    {Writeln(':',CB^.Value,':');
-    readln;}
-    if CB^.Value = 3 then
-      I := 1
-    else
-      I := 0;
-    ProfileInfoSwitches^.SetCurrSel(I);
-    CustomArg[SwitchesMode]:=IL2^.Data^;
-{$ifdef win32}
-    if CB2^.value<>0 then
-      DebuggeeTTY:='on'
-    else
-      DebuggeeTTY:='';
-{$endif win32}
-{$ifdef Unix}
-    DebuggeeTTY:=IL^.Data^;
-{$endif Unix}
-  end;
-  Dispose(D, Done);
-end;
-
-
-
-procedure TIDEApp.Directories;
-var R,R2: TRect;
-    D: PCenterDialog;
-    IL : array[0..11] of PInputLine;
-    Count,I : integer;
-const
-  LW = 25;
-begin
-  Count:=DirectorySwitches^.ItemCount;
-  R.Assign(0,0,round(ScreenWidth*64/80),2+Count*2);
-  New(D, Init(R, dialog_directories));
-  with D^ do
-  begin
-    GetExtent(R);
-    R.Grow(-2,-2);
-    Dec(R.B.X);
-    R.B.Y:=R.A.Y+1;
-    for i:=Count-1 downto 0 do
-     begin
-       R2.Copy(R);
-       R2.A.X:=LW;
-       New(IL[i], Init(R2, 255));
-       IL[i]^.Data^:=DirectorySwitches^.GetStringItem(i);
-       Insert(IL[i]);
-       R2.Copy(R);
-       R2.B.X:=LW;
-       Insert(New(PLabel, Init(R2, DirectorySwitches^.ItemName(i), IL[i])));
-       R.Move(0,2);
-     end;
-  end;
-  InsertButtons(D);
-  IL[Count-1]^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-   begin
-     for i:=Count-1 downto 0 do
-      DirectorySwitches^.SetStringItem(i,IL[i]^.Data^);
-   end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.Tools;
-begin
-  ExecuteDialog(New(PToolsDialog, Init),nil);
-end;
-
-(*procedure TIDEApp.Preferences;
-var R,R2: TRect;
-    D: PCenterDialog;
-    RB1 : PRadioButtons;
-    CountModes : integer;
-    hp : pvideomodelist;
-    items : PSItem;
-    videomode : tvideomode;
-    i,modevalue : longint;
-
-
-  function ToStr(l : longint) : string;
-
-    var
-       s : string;
-
-    begin
-       str(l,s);
-       ToStr:=s;
-    end;
-
-  const
-     color2str : array[false..true] of string = ('in b/w','in color');
-
-begin
-  GetVideoMode(videomode);
-  CountModes:=0;
-  i:=0;
-  modevalue:=0;
-  R.Assign(0,0,64,18);
-  New(D, Init(R, 'Preferences'));
-  with D^ do
-  begin
-     hp:=video.modes;
-     items:=nil;
-     r2.assign(2,3,24,17);
-     while assigned(hp) do
-       begin
-          items:=NewSItem(ToStr(hp^.col)+'x'+ToStr(hp^.row)+' '+color2str[hp^.color],items);
-          if (hp^.col=videomode.col) and (hp^.row=videomode.row) and
-            (hp^.color=videomode.color) then
-            modevalue:=i;
-          inc(CountModes);
-          { we can't display an infinite number of modes }
-          if CountModes>=r.b.y-r.a.y+1 then
-            break;
-          inc(i);
-          hp:=hp^.next;
-       end;
-     modevalue:=CountModes-modevalue-1;
-     new(rb1,init(r2,items));
-     insert(rb1);
-     rb1^.value:=modevalue;
-
-     r2.move(0,-1);r2.b.y:=r2.a.y+1;
-     insert(new(plabel,init(r2,'~V~ideo mode',rb1)));
-  end;
-  InsertButtons(D);
-  if Desktop^.ExecView(D)=cmOK then
-   begin
-      { change video mode ? }
-      if rb1^.value<>modevalue then
-        begin
-           modevalue:=CountModes-rb1^.value-1;
-           hp:=video.modes;
-           for i:=1 to modevalue do
-             hp:=hp^.next;
-           videomode.col:=hp^.col;
-           videomode.row:=hp^.row;
-           videomode.color:=hp^.color;
-           SetScreenVideoMode(videomode);
-        end;
-   end;
-  Dispose(D, Done);
-end;*)
-
-type
-     PVideoModeCollection = ^TVideoModeCollection;
-     TVideoModeCollection = object(TSortedCollection)
-       function  Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-       procedure FreeItem(Item: Pointer); virtual;
-     end;
-
-function TVideoModeCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-var R: Sw_integer;
-    K1: PVideoModeList absolute Key1;
-    K2: PVideoModeList absolute Key2;
-begin
-  if K1^.Col<K2^.Col then R:=-1 else
-  if K1^.Col>K2^.Col then R:= 1 else
-  if K1^.Row<K2^.Row then R:=-1 else
-  if K1^.Row>K2^.Row then R:= 1 else
-  if (K1^.Color=false) and (K2^.Color=true ) then R:=-1 else
-  if (K1^.Color=true ) and (K2^.Color=false) then R:= 1 else
-  R:=0;
-  Compare:=R;
-end;
-
-procedure TVideoModeCollection.FreeItem(Item: Pointer);
-begin
-  { don't do anything here }
-end;
-
-procedure TIDEApp.Preferences;
-function SearchVideoMode(Col,Row: word; Color: boolean): PVideoModeList;
-var I,P: PVideoModeList;
-begin
-  I:=nil; P:=Video.Modes;
-  while (I=nil) and (P<>nil) do
-    begin
-      if (P^.Col=Col) and (P^.Row=Row) and (P^.Color=Color) then
-        I:=P
-      else
-        P:=P^.Next;
-    end;
-  SearchVideoMode:=I;
-end;
-var R,R2: TRect;
-    D: PCenterDialog;
-    C: PVideoModeCollection;
-    VMLB: PVideoModeListBox;
-    VP: PVideoModeList;
-    VM: TVideoMode;
-    RB1: PPlainRadioButtons;
-    CB1,CB2: PPlainCheckBoxes;
-    CurM: PVideoModeList;
-    CurIdx: integer;
-begin
-  New(C, Init(10,50));
-  VP:=Video.Modes; CurM:=nil;
-  while VP<>nil do
-    begin
-      C^.Insert(VP);
-      if (VP^.Row=ScreenMode.Row) and (VP^.Col=ScreenMode.Col) and
-         (VP^.Color=ScreenMode.Color) then
-       CurM:=VP;
-      VP:=VP^.Next;
-    end;
-  R.Assign(0,0,64,15);
-  New(D, Init(R, dialog_preferences));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-2,-2);
-    R.B.X:=R.A.X+(R.B.X-R.A.X) div 2 - 1;
-
-    R.B.Y:=R.A.Y+3;
-    R2.Copy(R); R2.Grow(-1,-1);
-    New(VMLB, Init(R2, Min(4,C^.Count), C));
-    if CurM=nil then CurIdx:=-1 else
-      CurIdx:=C^.IndexOf(CurM);
-    if CurIdx<>-1 then
-      VMLB^.FocusItem(CurIdx);
-    Insert(New(PGroupView, Init(R, label_preferences_videomode, VMLB)));
-    Insert(VMLB);
-
-    R.Move(0,R.B.Y-R.A.Y{+1}); R.B.Y:=R.A.Y+4;
-    R2.Copy(R); R2.Grow(-1,-1);
-    New(RB1, Init(R2,
-      NewSItem(label_preferences_currentdirectory,
-      NewSItem(label_preferences_configdirectory,
-      nil))));
-    RB1^.Press(DesktopLocation);
-    Insert(New(PGroupView, Init(R, label_preferences_desktopfile, RB1)));
-    Insert(RB1);
-
-    R.Move(0,R.B.Y-R.A.Y{+1}); R.B.Y:=R.A.Y+5;
-    R2.Copy(R); R2.Grow(-1,-1);
-    New(CB1, Init(R2,
-      NewSItem(label_preferences_editorfiles,
-      NewSItem(label_preferences_environment,
-      NewSItem(label_preferences_desktop,
-      nil)))));
-    CB1^.Value:=AutoSaveOptions;
-    Insert(New(PGroupView, Init(R, label_preferences_autosave, CB1)));
-    Insert(CB1);
-
-    GetExtent(R); R.Grow(-2,-2);
-    R.A.X:=R.B.X-(R.B.X-R.A.X) div 2 + 1;
-    R.B.Y:=R.A.Y+7;
-
-    R.Move(0,R.B.Y-R.A.Y{+1}); R.B.Y:=R.A.Y+5;
-    R2.Copy(R); R2.Grow(-1,-1);
-    New(CB2, Init(R2,
-      NewSItem(label_preferences_autotracksource,
-      NewSItem(label_preferences_closeongotosource,
-      NewSItem(label_preferences_changedironopen,
-      nil)))));
-    CB2^.Value:=MiscOptions;
-    Insert(New(PGroupView, Init(R, label_preferences_options, CB2)));
-    Insert(CB2);
-
-  end;
-  InsertButtons(D);
-  if Desktop^.ExecView(D)=cmOK then
-   begin
-     with PVideoModeList(C^.At(VMLB^.Focused))^ do
-      begin
-        VM.Col:=Col;
-        VM.Row:=Row;
-        VM.Color:=Color;
-      end;
-     if (VM.Col<>ScreenMode.Col) or (VM.Row<>ScreenMode.Row) or (VM.Color<>ScreenMode.Color) then
-       SetScreenVideoMode(VM);
-     AutoSaveOptions:=CB1^.Value;
-     MiscOptions:=CB2^.Value;
-     DesktopLocation:=RB1^.Value;
-   end;
-  Dispose(D, Done);
-  Dispose(C, Done);
-end;
-
-procedure TIDEApp.EditorOptions(Editor: PEditor);
-var D: PCenterDialog;
-    R,R2,R3: TRect;
-    CB: PCheckBoxes;
-    IL: PIntegerLine;
-    ExtIL,TabExtIL: PInputLine;
-    TabSize: Integer;
-    EFlags,EFValue: Longint;
-    Title: string;
-begin
-  if Editor=nil then
-    begin
-      TabSize:=DefaultTabSize; EFlags:=DefaultCodeEditorFlags;
-      Title:=dialog_defaulteditoroptions;
-    end
-  else
-    begin
-      TabSize:=Editor^.GetTabSize; EFlags:=Editor^.GetFlags;
-      Title:=dialog_editoroptions;
-    end;
-
-  EFValue:=0;
-  if (EFlags and efBackupFiles       )<>0 then EFValue:=EFValue or (1 shl  0);
-  if (EFlags and efInsertMode        )<>0 then EFValue:=EFValue or (1 shl  1);
-  if (EFlags and efAutoIndent        )<>0 then EFValue:=EFValue or (1 shl  2);
-  if (EFlags and efUseTabCharacters  )<>0 then EFValue:=EFValue or (1 shl  3);
-  if (EFlags and efBackSpaceUnindents)<>0 then EFValue:=EFValue or (1 shl  4);
-  if (EFlags and efPersistentBlocks  )<>0 then EFValue:=EFValue or (1 shl  5);
-  if (EFlags and efSyntaxHighlight   )<>0 then EFValue:=EFValue or (1 shl  6);
-  if (EFlags and efBlockInsCursor    )<>0 then EFValue:=EFValue or (1 shl  7);
-  if (EFlags and efVerticalBlocks    )<>0 then EFValue:=EFValue or (1 shl  8);
-  if (EFlags and efHighlightColumn   )<>0 then EFValue:=EFValue or (1 shl  9);
-  if (EFlags and efHighlightRow      )<>0 then EFValue:=EFValue or (1 shl 10);
-  if (EFlags and efAutoBrackets      )<>0 then EFValue:=EFValue or (1 shl 11);
-  if (EFlags and efKeepTrailingSpaces)<>0 then EFValue:=EFValue or (1 shl 12);
-  if (EFlags and efCodeComplete      )<>0 then EFValue:=EFValue or (1 shl 13);
-  if (EFlags and efFolds             )<>0 then EFValue:=EFValue or (1 shl 14);
-
-  R.Assign(0,0,66,20);
-  New(D, Init(R, Title));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-2,-2); R.B.Y:=R.A.Y+9;
-    R2.Copy(R); Inc(R2.A.Y);
-    New(CB, Init(R2,
-      NewSItem(label_editor_backupfiles,
-      NewSItem(label_editor_insertmode,
-      NewSItem(label_editor_autoindentmode,
-      NewSItem(label_editor_usetabcharacters,
-      NewSItem(label_editor_backspaceunindents,
-      NewSItem(label_editor_persistentblocks,
-      NewSItem(label_editor_syntaxhighlight,
-      NewSItem(label_editor_blockinsertcursor,
-      NewSItem(label_editor_verticalblocks,
-      NewSItem(label_editor_highlightcolumn,
-      NewSItem(label_editor_highlightrow,
-      NewSItem(label_editor_autoclosingbrackets,
-      NewSItem(label_editor_keeptrailingspaces,
-      NewSItem(label_editor_codecomplete,
-      NewSItem(label_editor_folds,
-      nil)))))))))))))))));
-    CB^.Value:=EFValue;
-    Insert(CB);
-    R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, label_editor_editoroptions, CB)));
-
-    R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+1;
-    R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y;
-    R3.Copy(R); Inc(R3.A.X,10); R3.B.X:=R3.A.X+5;
-    New(IL, Init(R3, 0,100));
-    IL^.Data^:=IntToStr(TabSize);
-    Insert(IL);
-    R3.Copy(R); R3.B.X:=R3.A.X+10;
-    Insert(New(PLabel, Init(R3, label_editor_tabsize, IL)));
-
-    R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+2;
-    R2.Copy(R); Inc(R2.A.Y);
-    New(ExtIL, Init(R2, 128));
-    ExtIL^.SetData(HighlightExts);
-    Insert(ExtIL);
-    R2.Move(0,-1);
-    Insert(New(PLabel, Init(R2, label_editor_highlightextensions, ExtIL)));
-
-    R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+2;
-    R2.Copy(R); Inc(R2.A.Y);
-    New(TabExtIL, Init(R2, 128));
-    TabExtIL^.SetData(TabsPattern);
-    Insert(TabExtIL);
-    R2.Move(0,-1);
-    Insert(New(PLabel, Init(R2, label_editor_filepatternsneedingtabs, TabExtIL)));
-  end;
-  InsertButtons(D);
-  CB^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-  begin
-    EFlags:=0;
-    if (CB^.Value and (1 shl  0))<>0 then EFlags:=EFlags or efBackupFiles;
-    if (CB^.Value and (1 shl  1))<>0 then EFlags:=EFlags or efInsertMode;
-    if (CB^.Value and (1 shl  2))<>0 then EFlags:=EFlags or efAutoIndent;
-    if (CB^.Value and (1 shl  3))<>0 then EFlags:=EFlags or efUseTabCharacters;
-    if (CB^.Value and (1 shl  4))<>0 then EFlags:=EFlags or efBackSpaceUnindents;
-    if (CB^.Value and (1 shl  5))<>0 then EFlags:=EFlags or efPersistentBlocks;
-    if (CB^.Value and (1 shl  6))<>0 then EFlags:=EFlags or efSyntaxHighlight;
-    if (CB^.Value and (1 shl  7))<>0 then EFlags:=EFlags or efBlockInsCursor;
-    if (CB^.Value and (1 shl  8))<>0 then EFlags:=EFlags or efVerticalBlocks;
-    if (CB^.Value and (1 shl  9))<>0 then EFlags:=EFlags or efHighlightColumn;
-    if (CB^.Value and (1 shl 10))<>0 then EFlags:=EFlags or efHighlightRow;
-    if (CB^.Value and (1 shl 11))<>0 then EFlags:=EFlags or efAutoBrackets;
-    if (CB^.Value and (1 shl 12))<>0 then EFlags:=EFlags or efKeepTrailingSpaces;
-    if (CB^.Value and (1 shl 13))<>0 then EFlags:=EFlags or efCodeComplete;
-    if (CB^.Value and (1 shl 14))<>0 then EFlags:=EFlags or efFolds;
-    TabSize:=StrToInt(IL^.Data^);
-    if Editor=nil then
-       begin
-         DefaultTabSize:=TabSize;
-         DefaultCodeEditorFlags:=EFlags;
-       end
-    else
-       begin
-         Editor^.SetTabSize(TabSize);
-         Editor^.SetFlags(EFlags);
-       end;
-    ExtIL^.GetData(HighlightExts);
-    TabExtIL^.GetData(TabsPattern);
-  end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.CodeComplete;
-begin
-  ExecuteDialog(New(PCodeCompleteDialog, Init),nil);
-end;
-
-procedure TIDEApp.CodeTemplates;
-begin
-  ExecuteDialog(New(PCodeTemplatesDialog, Init),nil);
-end;
-
-procedure TIDEApp.BrowserOptions(Browser: PBrowserWindow);
-var D: PCenterDialog;
-    R,R2,R3 : TRect;
-    TitleS: string;
-    CB1,CB2: PCheckBoxes;
-    RB1,RB2: PRadioButtons;
-begin
-  if Browser=nil then
-    TitleS:=dialog_browseroptions
-  else
-    TitleS:=dialog_localbrowseroptions;
-  R.Assign(0,0,56,15);
-  New(D, Init(R, TitleS));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-2,-2);
-    R.B.Y:=R.A.Y+1+3; R2.Copy(R); Inc(R2.A.Y);
-    New(CB1, Init(R2,
-      NewSItem(RExpand(label_browser_labels,21+2),
-      NewSItem(label_browser_constants,
-      NewSItem(label_browser_types,
-      NewSItem(label_browser_variables,
-      NewSItem(label_browser_procedures,
-      NewSItem(label_browser_inherited,
-      nil)))))))
-    );
-    Insert(CB1);
-    R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, label_browser_symbols, CB1)));
-
-    R.Move(0,R.B.Y-R.A.Y+1);
-    R.B.Y:=R.A.Y+1+2; R2.Copy(R);
-    R3.Copy(R2); R3.B.X:=R3.A.X+(R3.B.X-R3.A.X) div 2-1; Inc(R3.A.Y);
-    New(RB1, Init(R3,
-      NewSItem(label_browser_newbrowser,
-      NewSItem(label_browser_currentbrowser,
-      nil)))
-    );
-    Insert(RB1);
-    R3.Move(0,-1); R3.B.Y:=R3.A.Y+1;
-    Insert(New(PLabel, Init(R3, label_browser_subbrowsing, RB1)));
-    R3.Copy(R2); R3.A.X:=R3.B.X-(R3.B.X-R3.A.X) div 2+1; Inc(R3.A.Y);
-    New(RB2, Init(R3,
-      NewSItem(label_browser_scope,
-      NewSItem(label_browser_reference,
-      nil)))
-    );
-    Insert(RB2);
-    R3.Move(0,-1); R3.B.Y:=R3.A.Y+1;
-    Insert(New(PLabel, Init(R3, label_browser_preferredpane, RB2)));
-
-    R.Move(0,R.B.Y-R.A.Y+1);
-    R.B.Y:=R.A.Y+1+1; R2.Copy(R); Inc(R2.A.Y);
-    New(CB2, Init(R2,
-      NewSItem(RExpand(label_browser_qualifiedsymbols,21+2),
-      NewSItem(label_browser_sortsymbols,
-      nil)))
-    );
-    Insert(CB2);
-    R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, label_browser_display, CB2)));
-  end;
-  InsertButtons(D);
-  CB1^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-  begin
-  end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.Startup;
-begin
-  NotImplemented;
-end;
-
-procedure TIDEApp.DesktopOptions;
-var R: TRect;
-    D: PCenterDialog;
-    CB: PCheckBoxes;
-begin
-  R.Assign(0,0,40,12);
-  New(D, Init(R, dialog_desktoppreferences));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.B.Y:=R.A.Y+8;
-    New(CB, Init(R,
-      NewSItem(label_desktop_historylists,
-      NewSItem(label_desktop_clipboard,
-      NewSItem(label_desktop_watches,
-      NewSItem(label_desktop_breakpoints,
-      NewSItem(label_desktop_openwindow,
-      NewSItem(label_desktop_symbolinfo,
-      NewSItem(label_desktop_codecompletewords,
-      NewSItem(label_desktop_codetemplates,
-      nil))))))))));
-    CB^.Value:=DesktopFileFlags;
-    Insert(CB);
-    R.Move(0,-1); R.B.Y:=R.A.Y+1;
-    Insert(New(PLabel, Init(R, label_desktop_preservedacrosssessions, CB)));
-  end;
-  InsertButtons(D);
-  CB^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-    begin
-      DesktopFileFlags:=CB^.Value;
-    end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.Mouse;
-var R,R2: TRect;
-    D: PCenterDialog;
-    SB: PScrollBar;
-    CB: PCheckBoxes;
-    RB1,RB2: PRadioButtons;
-begin
-  R.Assign(0,0,62,15);
-  New(D, Init(R, dialog_mouseoptions));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-3,-2); R.B.Y:=R.A.Y+3;
-    R2.Copy(R); Inc(R2.A.Y,2); R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2 -1;
-    New(SB, Init(R2)); SB^.GrowMode:=0; SB^.Options:=SB^.Options or ofSelectable;
-    SB^.SetParams(DoubleDelay,1,20,1,1);
-    Insert(SB);
-    R2.Move(0,-1);
-    Insert(New(PStaticText, Init(R2, label_mouse_speedbar)));
-    R2.Move(-1,-1);
-    Insert(New(PLabel, Init(R2, label_mouse_doubleclickspeed, SB)));
-
-    R2.Copy(R); Inc(R2.A.Y,2); R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2 +1;
-    New(CB, Init(R2, NewSItem(label_mouse_reversebuttons, nil) ));
-    if MouseReverse then CB^.Press(0);
-    Insert(CB);
-
-    R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+8;
-    R2.Copy(R); Inc(R2.A.Y); R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2 -1;
-    New(RB1, Init(R2,
-      NewSItem(label_mouse_act_nothing,
-      NewSItem(label_mouse_act_topicsearch,
-      NewSItem(label_mouse_act_gotocursor,
-      NewSItem(label_mouse_act_breakpoint,
-      NewSItem(label_mouse_act_evaluate,
-      NewSItem(label_mouse_act_addwatch,
-      NewSItem(label_mouse_act_browsesymbol,
-      nil)))))))));
-    RB1^.Press(CtrlMouseAction);
-    Insert(RB1);
-    R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, label_mouse_crtlrightmousebuttonaction, RB1)));
-
-    R2.Copy(R); Inc(R2.A.Y); R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2 +1;
-    New(RB2, Init(R2,
-      NewSItem(label_mouse_act_nothing,
-      NewSItem(label_mouse_act_topicsearch,
-      NewSItem(label_mouse_act_gotocursor,
-      NewSItem(label_mouse_act_breakpoint,
-      NewSItem(label_mouse_act_evaluate,
-      NewSItem(label_mouse_act_addwatch,
-      NewSItem(label_mouse_act_browsesymbol,
-      nil)))))))));
-    RB2^.Press(AltMouseAction);
-    Insert(RB2);
-    R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2,  label_mouse_altrightmousebuttonaction, RB2)));
-  end;
-  InsertButtons(D);
-  RB1^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-  begin
-    MouseReverse:=CB^.Mark(0);
-    DoubleDelay:=SB^.Value;
-    CtrlMouseAction:=RB1^.Value;
-    AltMouseAction:=RB2^.Value;
-  end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.Colors;
-var D: PColorDialog;
-begin
-  New(D, Init(AppPalette,
-    ColorGroup(label_colors_grp_browser,
-      ColorItem(label_colors_framepassive   , 215,
-      ColorItem(label_colors_frameactive    , 216,
-      ColorItem(label_colors_frameicon      , 217,
-      ColorItem(label_colors_scrollbarpage  , 218,
-      ColorItem(label_colors_scrollbaricons , 219,
-      ColorItem(label_colors_normaltext     , 220,
-      ColorItem(label_colors_selectedtext   , 221,
-      ColorItem(label_colors_activeitem     , 222,
-      ColorItem(label_colors_inactiveitem   , 223,
-      ColorItem(label_colors_focuseditem    , 224,
-      ColorItem(label_colors_selecteditem   , 225,
-      ColorItem(label_colors_divider        , 226,
-      nil)))))))))))),
-    ColorGroup(label_colors_grp_clock,
-      ColorItem(label_colors_clockview      , 227,
-      nil),
-    ColorGroup(label_colors_grp_desktop, DesktopColorItems(nil),
-    ColorGroup(label_colors_grp_dialogs, DialogColorItems(dpGrayDialog,nil),
-    ColorGroup(label_colors_grp_editor,
-      ColorItem(label_colors_framepassive   , 167,
-      ColorItem(label_colors_frameactive    , 168,
-      ColorItem(label_colors_frameicon      , 169,
-      ColorItem(label_colors_scrollbarpage  , 170,
-      ColorItem(label_colors_scrollbaricons , 171,
-      ColorItem(label_colors_normaltext     , 199,
-      ColorItem(label_colors_selectedtext   , 208,
-      ColorItem(label_colors_highlighcolumn , 209,
-      ColorItem(label_colors_highlightrow   , 210,
-      ColorItem(label_colors_errormessages  , 214,
-      nil)))))))))),
-    ColorGroup(label_colors_grp_help,
-      ColorItem(label_colors_framepassive   , 128,
-      ColorItem(label_colors_frameactive    , 129,
-      ColorItem(label_colors_frameicon      , 130,
-      ColorItem(label_colors_scrollbarpage  , 131,
-      ColorItem(label_colors_scrollbaricons , 132,
-      ColorItem(label_colors_helptext       , 160,
-      ColorItem(label_colors_helplinks      , 161,
-      ColorItem(label_colors_selectedlink   , 162,
-      ColorItem(label_colors_selectedtext   , 163,
-      ColorItem(label_colors_html_heading1  , 229,
-      ColorItem(label_colors_html_heading2  , 230,
-      ColorItem(label_colors_html_heading3  , 231,
-      ColorItem(label_colors_html_heading4  , 232,
-      ColorItem(label_colors_html_heading5  , 233,
-      ColorItem(label_colors_html_heading6  , 234,
-      nil))))))))))))))),
-    ColorGroup(label_colors_grp_menus,   MenuColorItems(nil),
-    ColorGroup(label_colors_grp_syntax,
-      ColorItem(label_colors_whitespace      , 200,
-      ColorItem(label_colors_comments        , 201,
-      ColorItem(label_colors_reservedwords   , 202,
-      ColorItem(label_colors_identifiers     , 203,
-      ColorItem(label_colors_strings         , 204,
-      ColorItem(label_colors_numbers         , 205,
-      ColorItem(label_colors_hexnumbers      , 212,
-      ColorItem(label_colors_assembler       , 206,
-      ColorItem(label_colors_symbols         , 207,
-      ColorItem(label_colors_directives      , 211,
-      ColorItem(label_colors_tabs            , 213,
-      nil))))))))))),
-    nil))))))))));
-  if ExecuteDialog(D, @AppPalette)=cmOK then
-    begin
-      DoneMemory;
-      Message(Application,evBroadcast,cmUpdate,nil);
-      ReDraw;
-      UpdateScreen(true);
-    end;
-end;
-
-procedure TIDEApp.OpenINI;
-var D: PFileDialog;
-    FileName: string;
-begin
-  New(D, Init(INIFileName,dialog_openoptions,INIFileName,fdOpenButton,hidOpenIniFile));
-  if Desktop^.ExecView(D)<>cmCancel then
-    begin
-      D^.GetFileName(FileName);
-      if ExistsFile(FileName)=false then ErrorBox(msg_cantopenconfigfile,nil) else
-        begin
-          IniFileName:=FileName;
-          ReadINIFile;
-          Message(Application,evBroadcast,cmUpdate,nil);
-        end;
-    end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.SaveINI;
-begin
-  if WriteINIFile=false then
-    ErrorBox(msg_errorsavingconfigfile,nil);
-end;
-
-procedure TIDEApp.SaveAsINI;
-var D: PFileDialog;
-    FileName: string;
-    CanWrite: boolean;
-begin
-  New(D, Init(INIFileName,dialog_saveoptions,INIFileName,fdOpenButton,hidSaveIniFile));
-  if Desktop^.ExecView(D)<>cmCancel then
-    begin
-      D^.GetFileName(FileName);
-      CanWrite:=(ExistsFile(FileName)=false);
-      if CanWrite=false then
-        CanWrite:=ConfirmBox(FormatStrStr(msg_filealreadyexistsoverwrite,SmartPath(FileName)),nil,false)=cmYes;
-      if CanWrite then
-        begin
-          IniFileName:=FileName;
-          if WriteINIFile=false then
-            ErrorBox(msg_errorsavingconfigfile,nil);
-          Message(Application,evBroadcast,cmUpdate,nil);
-        end;
-    end;
-  Dispose(D, Done);
-end;
-
-{
-  $Log$
-  Revision 1.4  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.6  2000/11/14 17:40:43  pierre
-   + External linking now optional
-
-  Revision 1.1.2.5  2000/11/14 09:40:35  marco
-   * Third batch renamefest
-
-  Revision 1.3  2000/10/31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.4  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.1.2.3  2000/09/18 13:20:54  pierre
-   New bunch of Gabor changes
-
-  Revision 1.2  2000/08/22 09:41:39  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.2  2000/08/04 14:05:18  michael
-  * Fixes from Gabor:
-   [*] the IDE now doesn't disable Compile|Make & Build when all windows
-       are closed, but there's still a primary file set
-       (set bug 1059 to fixed!)
-
-   [*] the IDE didn't read some compiler options correctly back from the
-       FP.CFG file, for ex. the linker options. Now it read everything
-       correctly, and also automatically handles smartlinking option synch-
-       ronization.
-       (set bug 1048 to fixed!)
-
-  Revision 1.1.2.1  2000/07/15 21:02:08  pierre
-   * Target is Mode dependent
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.35  2000/06/16 08:50:41  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.34  2000/05/30 07:18:33  pierre
-   + colors for HTML help by Gabor
-
-  Revision 1.33  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.32  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.31  2000/03/21 23:28:13  pierre
-   adapted to wcedit addition by Gabor
-
-  Revision 1.30  2000/03/13 20:34:07  pierre
-   * IniPath removed
-
-  Revision 1.29  2000/03/07 22:52:50  pierre
-   + Assembler tab in Options|Compiler
-
-  Revision 1.28  2000/02/07 12:02:32  pierre
-   Gabor's changes
-
-  Revision 1.27  1999/11/10 17:18:17  pierre
-   + new console for Win32 or other tty for linux
-
-  Revision 1.26  1999/10/14 10:22:50  pierre
-   + color selection for ClockView
-
-  Revision 1.25  1999/08/16 18:25:21  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.24  1999/03/23 16:16:40  peter
-    * linux fixes
-
-  Revision 1.23  1999/03/23 15:11:33  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.22  1999/03/21 22:51:36  florian
-    + functional screen mode switching added
-
-  Revision 1.21  1999/03/16 12:38:12  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-  Revision 1.20  1999/03/14 22:18:16  florian
-    + options/preferences dialog added, without function yet
-
-  Revision 1.19  1999/03/12 01:14:00  peter
-    * flag if trytoopen should look for other extensions
-    + browser tab in the tools-compiler
-
-  Revision 1.18  1999/03/01 15:41:57  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.17  1999/02/22 11:51:37  peter
-    * browser updates from gabor
-
-  Revision 1.16  1999/02/18 13:44:32  peter
-    * search fixed
-    + backward search
-    * help fixes
-    * browser updates
-
-  Revision 1.15  1999/02/16 17:15:28  pierre
-   * Peter's debug code commented
-
-  Revision 1.14  1999/02/16 10:43:56  peter
-    * use -dGDB for the compiler
-    * only use gdb_file when -dDEBUG is used
-    * profiler switch is now a toggle instead of radiobutton
-
-  Revision 1.13  1999/02/10 09:52:43  pierre
-   * MemorySizeSwitches -> MemorySwitches (were duplicates)
-
-  Revision 1.12  1999/02/08 17:41:34  pierre
-   + CustomArg added to debug dialog
-
-  Revision 1.11  1999/02/08 10:37:45  peter
-    + html helpviewer
-
-  Revision 1.10  1999/02/06 00:07:47  florian
-    * speed/size optimization is now a radio button
-
-  Revision 1.9  1999/02/05 12:11:58  pierre
-    + SourceDir that stores directories for sources that the
-      compiler should not know about
-      Automatically asked for addition when a new file that
-      needed filedialog to be found is in an unknown directory
-      Stored and retrieved from INIFile
-    + Breakpoints conditions added to INIFile
-    * Breakpoints insterted and removed at debin and end of debug session
-
-  Revision 1.8  1999/02/04 13:32:06  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.7  1999/01/22 10:24:04  peter
-    * first debugger things
-
-  Revision 1.6  1999/01/21 11:54:19  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.5  1999/01/12 14:29:35  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.4  1999/01/04 11:49:47  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.2  1998/12/28 15:47:49  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.3  1998/12/22 10:39:48  peter
-    + Switches are now written/read
-    + find and replace routines
-
-}

+ 0 - 477
ide/text/fpmrun.inc

@@ -1,477 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Run menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-
-procedure TIDEApp.DoStepOver;
-begin
-{$ifndef NODEBUG}
-  if not assigned(Debugger) then
-   begin
-     InitDebugger;
-     if not assigned(Debugger) then
-      begin
-        NoDebugger;
-        exit;
-      end;
-   end;
-  if not Debugger^.IsRunning then
-    Debugger^.StartTrace
-  else
-    Debugger^.TraceNext;
-  {While (Debugger^.InvalidSourceLine and
-         Debugger^.IsRunning and
-         not Debugger^.error) do
-    begin
-      Inc(Debugger^.HiddenStepsCount);
-      Debugger^.TraceNext;
-    end;}
-  Debugger^.AnnotateError;
-{$else NODEBUG}
-  NoDebugger;
-{$endif NODEBUG}
-end;
-
-
-procedure TIDEApp.DoTraceInto;
-begin
-{$ifndef NODEBUG}
-  if not assigned(Debugger) then
-   begin
-     InitDebugger;
-     if not assigned(Debugger) then
-      begin
-        NoDebugger;
-        exit;
-      end;
-   end;
-  if not debugger^.IsRunning then
-    Debugger^.StartTrace
-  else
-   Debugger^.TraceStep;
-  { I think we should not try to go deeper !
-    if the source is not found PM }
-  While (Debugger^.InvalidSourceLine and
-         Debugger^.IsRunning and
-         not Debugger^.error) do
-    begin
-      Inc(Debugger^.HiddenStepsCount);
-      Debugger^.TraceNext;
-    end;
-  Debugger^.AnnotateError;
-{$else NODEBUG}
-  NoDebugger;
-{$endif NODEBUG}
-end;
-
-procedure TIDEApp.DoContUntilReturn;
-begin
-{$ifndef NODEBUG}
-  if not assigned(Debugger) then
-   begin
-     InitDebugger;
-     if not assigned(Debugger) then
-      begin
-        NoDebugger;
-        exit;
-      end;
-   end;
-  if not debugger^.IsRunning then
-    Debugger^.Run
-  else
-   Debugger^.UntilReturn;
-  Debugger^.AnnotateError;
-{$else NODEBUG}
-  NoDebugger;
-{$endif NODEBUG}
-end;
-
-procedure TIDEApp.DoRun;
-var
-  RunDirect : boolean;
-begin
-
-{$ifndef NODEBUG}
-  if not assigned(Debugger) or not Debugger^.IsRunning then
-{$endif}
-    begin
-      if (not ExistsFile(ExeFile)) or (CompilationPhase<>cpDone) or
-         NeedRecompile(false) then
-        DoCompile(cRun);
-      if CompilationPhase<>cpDone then
-        Exit;
-      if (EXEFile='') then
-       begin
-         ErrorBox(msg_nothingtorun,nil);
-         Exit;
-       end;
-      if not ExistsFile(ExeFile) then
-        begin
-          MsgParms[1].Ptr:=@EXEFile;
-          ErrorBox(msg_invalidfilename,@MsgParms);
-          Exit;
-        end;
-      RunDirect:=true;
-{$ifndef NODEBUG}
-      { we use debugger if and only if there are active breakpoints
-        AND the target is correct for debugging !! PM }
-      if ActiveBreakpoints and (target_os.shortname=source_os.shortname) then
-        begin
-          if not assigned(Debugger) then
-            InitDebugger;
-          if assigned(Debugger) then
-            begin
-              Debugger^.Run;
-              RunDirect:=false;
-            end;
-        end;
-{$endif ndef NODEBUG}
-      if Not RunDirect then
-        exit;
-      DoExecute(ExeFile,GetRunParameters,'','',exNormal);
-      LastExitCode:=ExecuteResult;
-      If IOStatus<>0 then
-        begin
-          MsgParms[1].Ptr:=@EXEFile;
-          MsgParms[2].long:=IOStatus;
-          InformationBox(msg_programnotrundoserroris,@MsgParms);
-        end
-      else If LastExitCode<>0 then
-        begin
-          MsgParms[1].Ptr:=@EXEFile;
-          MsgParms[2].long:=LastExitCode;
-          InformationBox(msg_programfileexitedwithexitcode,@MsgParms);
-        end;
-    end
-{$ifndef NODEBUG}
-  else
-    Debugger^.Continue
-{$endif}
-  ;
-end;
-
-
-procedure TIDEApp.Parameters;
-var R,R2: TRect;
-    D: PCenterDialog;
-    IL: PInputLine;
-begin
-  R.Assign(0,0,round(ScreenWidth*54/80),4);
-  New(D, Init(R, dialog_programparameters));
-  with D^ do
-  begin
-    GetExtent(R); R.Grow(-2,-1); Inc(R.A.Y); R.B.Y:=R.A.Y+1;
-    R2.Copy(R); R2.A.X:=16; Dec(R2.B.X,4);
-    New(IL, Init(R2, 255));
-    IL^.Data^:=GetRunParameters;
-    Insert(IL);
-    R2.Copy(R); R2.A.X:=R2.B.X-3; R2.B.X:=R2.A.X+3;
-    Insert(New(PHistory, Init(R2, IL, hidRunParameters)));
-    R2.Copy(R); R2.B.X:=16;
-    Insert(New(PLabel, Init(R2, label_parameters_parameter, IL)));
-  end;
-  InsertButtons(D);
-  IL^.Select;
-  if Desktop^.ExecView(D)=cmOK then
-  begin
-    SetRunParameters(IL^.Data^);
-  end;
-  Dispose(D, Done);
-end;
-
-procedure TIDEApp.DoResetDebugger;
-begin
-{$ifndef NODEBUG}
-  if assigned(Debugger) then
-     DoneDebugger;
-  UpdateScreen(true);
-{$else NODEBUG}
-  NoDebugger;
-{$endif NODEBUG}
-end;
-
-procedure TIDEApp.DoContToCursor;
-{$ifndef NODEBUG}
-var
-  W : PSourceWindow;
-  FileName : string;
-  LineNr : longint;
-{$endif}
-begin
-{$ifndef NODEBUG}
-  if (DeskTop^.Current=nil) or
-     (TypeOf(DeskTop^.Current^)<>TypeOf(TSourceWindow)) then
-    Begin
-       ErrorBox(msg_impossibletoreachcursor,nil);
-       Exit;
-    End;
-
-  W:=PSourceWindow(DeskTop^.Current);
-  If assigned(W) then
-    begin
-      FileName:=W^.Editor^.FileName;
-      LineNr:=W^.Editor^.CurPos.Y+1;
-      If not assigned(Debugger) then
-        begin
-          InitDebugger;
-          if not assigned(Debugger) then
-            begin
-              NoDebugger;
-              exit;
-            end;
-        end;
-      Debugger^.Command('tbreak '+GDBFileName(NameAndExtOf(FileName))+':'+IntToStr(LineNr));
-      Debugger^.Continue;
-    end;
-{$else NODEBUG}
-  NoDebugger;
-{$endif NODEBUG}
-end;
-
-procedure TIDEApp.DoOpenGDBWindow;
-begin
-{$ifndef NODEBUG}
-  InitGDBWindow;
-  if not assigned(Debugger) then
-    new(Debugger,Init(ExeFile));
-  If assigned(GDBWindow) then
-    GDBWindow^.MakeFirst;
-{$else NODEBUG}
-  NoDebugger;
-{$endif NODEBUG}
-end;
-
-procedure TIDEApp.DoToggleBreak;
-{$ifndef NODEBUG}
-var
-  W : PSourceWindow;
-  FileName : string;
-{  b : boolean;}
-  LineNr : longint;
-{$endif}
-begin
-{$ifndef NODEBUG}
-  if (DeskTop^.Current=nil) or
-     (TypeOf(DeskTop^.Current^)<>TypeOf(TSourceWindow)) then
-    Begin
-       ErrorBox(msg_impossibletosetbreakpoint,nil);
-       Exit;
-    End;
-
-  W:=PSourceWindow(DeskTop^.Current);
-  If assigned(W) then
-    begin
-      FileName:=W^.Editor^.FileName;
-      LineNr:=W^.Editor^.CurPos.Y+1;
-{      b:=}BreakpointsCollection^.ToggleFileLine(FileName,LineNr);
-      {W^.Editor^.SetLineBreakState(LineNr,b);
-        already done PM }
-    end;
-{$else NODEBUG}
-  NoDebugger;
-{$endif NODEBUG}
-end;
-
-{
-  $Log$
-  Revision 1.3  2000-11-03 16:05:38  pierre
-   * (merged)
-
-  Revision 1.1.2.3  2000/11/03 13:29:59  pierre
-   Start GDB if opening GDB window
-
-  Revision 1.1.2.2  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.1.2.1  2000/10/09 16:28:25  pierre
-   * several linux enhancements
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.32  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.31  2000/04/18 11:42:37  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.30  2000/03/21 23:27:35  pierre
-   Gabor fixes to avoid unused vars
-
-  Revision 1.29  2000/03/08 16:58:12  pierre
-   Uses Debugger^.IsRunning
-
-  Revision 1.28  2000/02/04 00:15:31  pierre
-   * adapted to change in fpdebug unit
-
-  Revision 1.27  2000/02/02 22:48:25  pierre
-    * Use desktop^.current instead of desktop^.first
-    * Avoid stopping at main if debugger started with CrtlF9
-
-  Revision 1.26  2000/01/31 16:02:08  pierre
-   * avoid the Impossible to set breakpoints here
-
-  Revision 1.25  2000/01/28 22:38:21  pierre
-   * CrtlF9 starts debugger if there are active breakpoints
-
-  Revision 1.24  2000/01/10 13:23:28  pierre
-   * Debugger test missing in ContTo
-
-  Revision 1.23  1999/12/10 13:01:01  pierre
-   * do not recompile a program inside Debugging session
-
-  Revision 1.22  1999/11/10 17:17:02  pierre
-   + Information box if exit code <> 0 or DosError
-
-  Revision 1.21  1999/09/16 14:34:59  pierre
-    + TBreakpoint and TWatch registering
-    + WatchesCollection and BreakpointsCollection stored in desk file
-    * Syntax highlighting was broken
-
-  Revision 1.20  1999/09/09 14:11:56  pierre
-   * GDB needs lowercase filenames for tbreak
-
-  Revision 1.19  1999/08/31 16:20:37  pierre
-   * DoContUntilReturn call Step instead of UnitlReturn
-
-  Revision 1.18  1999/08/16 18:25:23  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.17  1999/07/28 23:11:20  peter
-    * fixes from gabor
-
-  Revision 1.16  1999/07/12 13:14:19  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.15  1999/04/07 21:55:50  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.14  1999/03/01 15:41:58  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.13  1999/02/18 13:44:33  peter
-    * search fixed
-    + backward search
-    * help fixes
-    * browser updates
-
-  Revision 1.12  1999/02/11 19:07:24  pierre
-    * GDBWindow redesigned :
-      normal editor apart from
-      that any kbEnter will send the line (for begin to cursor)
-      to GDB command !
-      GDBWindow opened in Debugger Menu
-       still buggy :
-       -echo should not be present if at end of text
-       -GDBWindow becomes First after each step (I don't know why !)
-
-  Revision 1.11  1999/02/10 09:51:59  pierre
-   small cleanup
-
-  Revision 1.10  1999/02/08 17:43:45  pierre
-    * RestDebugger or multiple running of debugged program now works
-    + added DoContToCursor(F4)
-    * Breakpoints are now inserted correctly (was mainlyy a problem
-      of directories)
-
-  Revision 1.9  1999/02/05 17:21:53  pierre
-    Invalid_line renamed InvalidSourceLine
-
-  Revision 1.8  1999/02/04 17:56:17  pierre
-   * Set breakpoint only possible if source window
-
-  Revision 1.7  1999/02/04 13:32:07  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.6  1999/01/22 10:24:05  peter
-    * first debugger things
-
-  Revision 1.5  1999/01/21 11:54:20  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.4  1999/01/14 21:42:22  peter
-    * source tracking from Gabor
-
-  Revision 1.3  1999/01/12 14:29:36  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.2  1999/01/04 11:49:48  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.1  1998/12/28 15:47:50  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-}

+ 0 - 216
ide/text/fpmsrch.inc

@@ -1,216 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Search menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-procedure TIDEApp.FindProcedure;
-begin
-  NotImplemented;
-end;
-
-procedure TIDEApp.Objects;
-begin
-  if ObjectTree=nil then
-     begin ErrorBox(msg_nodebuginfoavailable,nil); Exit; end;
-
-  OpenSymbolBrowser(0,0,label_sym_objects,label_sym_globalscope,nil,nil,nil,nil,ObjectTree,nil);
-end;
-
-procedure TIDEApp.Globals;
-var R: TRect;
-    S: PSortedSymbolCollection;
-    Overflow: boolean;
-    Level : longint;
-
-  procedure InsertInS(P: PSymbol); {$ifndef FPC}far;{$endif}
-
-    procedure InsertItemsInS(P: PSymbolCollection);
-    var I: Sw_integer;
-    begin
-      for I:=0 to P^.Count-1 do
-        InsertInS(P^.At(I));
-    end;
-
-  begin
-    Inc(level);
-    if S^.Count=MaxCollectionSize then
-       begin Overflow:=true; Exit; end;
-    S^.Insert(P);
-    { this is wrong because it inserted args or locals of proc
-      in the globals list !! PM}
-    if (P^.Items<>nil) and (level=1) then
-      InsertItemsInS(P^.Items);
-    Dec(level);
-  end;
-
-begin
-  level:=0;
-  if BrowCol.Modules=nil then
-     begin ErrorBox(msg_nodebuginfoavailable,nil); Exit; end;
-  Overflow:=false;
-  if assigned(GlobalsCollection) then
-    begin
-      GlobalsCollection^.deleteAll;
-      Dispose(GlobalsCollection,done);
-    end;
-  New(S, Init(500,500));
-  GlobalsCollection:=S;
-  BrowCol.Modules^.ForEach(@InsertInS);
-  if Overflow then
-    WarningBox(msg_toomanysymbolscantdisplayall,nil);
-  Desktop^.GetExtent(R); R.A.X:=R.B.X-35;
-  Desktop^.Insert(New(PBrowserWindow, Init(R,
-    FormatStrStr(dialog_browse,label_sym_globals),SearchFreeWindowNo,nil,label_sym_globalscope,'',S,nil,nil,nil)));
-end;
-
-procedure TIDEApp.Modules;
-var
-    S: PSortedSymbolCollection;
-procedure InsertInS(P: PSymbol); {$ifndef FPC}far;{$endif}
-begin
-  S^.Insert(P);
-end;
-begin
-  if BrowCol.Modules=nil then
-     begin ErrorBox(msg_nodebuginfoavailable,nil); Exit; end;
-  if assigned(ModulesCollection) then
-    begin
-      ModulesCollection^.deleteAll;
-      Dispose(ModulesCollection,done);
-    end;
-  New(S, Init(500,500));
-  ModulesCollection:=S;
-  BrowCol.Modules^.ForEach(@InsertInS);
-  OpenSymbolBrowser(0,0,dialog_units,label_sym_globalscope,nil,nil,S,nil,nil,nil);
-end;
-
-function SymbolDialog(S : string) : PDialog;
-var D: PDialog;
-    R,R1,R2: TRect;
-    IL: PInputLine;
-begin
-  R.Assign(0,0,40,8);
-  New(D, Init(R, dialog_browsesymbol));
-  with D^ do
-  begin
-    Options:=Options or ofCentered;
-    GetExtent(R); R.Grow(-3,-2); R.B.Y:=R.A.Y+1;
-    R1.Copy(R);
-    R2.Copy(R); Inc(R2.A.Y);Inc(R2.B.Y);
-    New(IL, Init(R2,255));
-    Insert(IL);
-    IL^.SetData(S);
-    Insert(New(PLabel, Init(R1, label_entersymboltobrowse, IL)));
-    GetExtent(R); R.Grow(-8,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10;
-    Insert(New(PButton, Init(R, button_OK, cmOK, bfDefault)));
-    R.Move(15,0);
-    Insert(New(PButton, Init(R, button_Cancel, cmCancel, bfNormal)));
-  end;
-  IL^.Select;
-  SymbolDialog:=D;
-end;
-
-procedure TIDEApp.SearchSymbol;
-var
-    EditorWindow : PSourceWindow;
-    S : string;
-begin
-  EditorWindow:=FirstEditorWindow;
-  If assigned(EditorWindow) then
-    S:=LowerCaseStr(EditorWindow^.Editor^.GetCurrentWord)
-  else
-    S:='';
-  if ExecuteDialog(SymbolDialog(S),@S)<>cmCancel then
-    OpenOneSymbolBrowser(S);
-end;
-
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:35  michael
-  + Initial import
-
-  Revision 1.13  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.12  2000/03/07 21:57:01  pierre
-   * adapted to change of OpenSymbolBrowser
-
-  Revision 1.11  1999/07/28 23:11:21  peter
-    * fixes from gabor
-
-  Revision 1.10  1999/06/29 12:49:55  pierre
-   * SearchSymbol works
-
-  Revision 1.9  1999/06/28 19:32:22  peter
-    * fixes from gabor
-
-  Revision 1.8  1999/06/28 12:38:19  pierre
-   * Globals(Modules)Collection tracing
-
-  Revision 1.7  1999/06/25 00:34:50  pierre
-   + SearchSymbol function
-
-  Revision 1.6  1999/04/07 21:55:51  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.5  1999/03/01 15:41:59  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.4  1999/02/10 09:51:03  pierre
-   * Adapted to TBrowserWindow changes
-
-  Revision 1.3  1999/02/04 13:32:08  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.2  1999/01/14 21:42:23  peter
-    * source tracking from Gabor
-
-  Revision 1.1  1999/01/12 14:29:37  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.9  1999/01/09 18:00:47  peter
-     Original implementation
-
-}

+ 0 - 448
ide/text/fpmtools.inc

@@ -1,448 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Tools menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-procedure TIDEApp.Messages;
-begin
-  if MessagesWindow=nil then
-    Desktop^.Insert(New(PMessagesWindow, Init))
-  else
-    MessagesWindow^.Focus;
-end;
-
-procedure TIDEApp.DoAsciiTable;
-begin
-  if ASCIIChart=nil then
-    begin
-      New(ASCIIChart, Init);
-      Desktop^.Insert(ASCIIChart);
-    end
-  else
-    ASCIIChart^.Focus;
-end;
-
-
-procedure TIDEApp.Calculator;
-begin
-  with CalcWindow^ do
-  begin
-    if GetState(sfVisible)=false then Show;
-    MakeFirst;
-  end;
-end;
-
-procedure TIDEApp.ExecuteTool(Idx: integer);
-var Title,ProgramPath,Params: string;
-    W: PSourceWindow;
-    ToFocus : sw_integer;
-    Wo: word;
-    Err: integer;
-    CaptureFile: string;
-    ExecMode: TExecType;
-    Executed: boolean;
-begin
-  if (Idx<1) or (Idx>GetToolCount) then Exit;
-  GetToolParams(Idx-1,Title,ProgramPath,Params,Wo);
-  InitToolTempFiles;
-  Err:=ParseToolParams(Params,false);
-  if Err=-1 then
-  begin
-    DoneToolTempFiles;
-    Exit;
-  end;
-  if Err<>0 then
-    begin ErrorBox(msg_errorparsingtoolparams,nil); Exit; end;
-  if CaptureToolTo<>capNone then
-    begin
-      CaptureFile:=ToolCaptureName;
-      ExecMode:=exNoSwap;
-    end
-  else
-    begin
-      CaptureFile:='';
-      ExecMode:=exNormal;
-    end;
-
-  EraseFile(CaptureFile);
-  EraseFile(FilterCaptureName);
-
-  if CaptureToolTo=capMessageWindow then
-    begin
-      AddToolCommand(ProgramPath+' '+Params);
-      ToFocus:=ToolMessages^.count-1;
-    end
-  else
-    ToFocus:=-1;
-  if CaptureToolTo<>capNone then
-    ShowMessage(FormatStrStr(msg_executingtool,KillTilde(Title)));
-
-  Executed:=DoExecute(ProgramPath,Params,'',CaptureFile,ExecMode);
-
-  if CaptureToolTo<>capNone then
-    HideMessage;
-
-  if Executed then
-  if (DosError=0) and (DosExitCode=0) then
-    begin
-      if CaptureToolTo=capEditWindow then
-        begin
-          W:=OpenEditorWindow(nil,'',0,0);
-          if W<>nil then
-            if StartEditor(W^.Editor,CaptureFile)=false then
-              ErrorBox(msg_errorreadingoutput,nil);
-        end
-      else
-      if ToolFilter<>'' then
-        begin
-          ShowMessage(FormatStrStr(msg_executingfilterfor,KillTilde(Title)));
-          DoExecute(ToolFilter,'',CaptureFile,FilterCaptureName,exNoSwap);
-          HideMessage;
-          if (DosError=0) and (DosExitCode=0) then
-            begin
-              if ExistsFile(FilterCaptureName)=false then
-                ErrorBox(msg_cantfindfilteredoutput,nil)
-              else
-                if ProcessMessageFile(FilterCaptureName)=false then
-                  ErrorBox(msg_errorprocessingfilteredoutput,nil);
-            end
-          else
-            if (DosError<>0) then
-              ErrorBox(FormatStrStr(msg_errorexecutingfilter,KillTilde(GetToolName(Idx-1))),nil) else
-            if DosExitCode<>0 then
-              ErrorBox(FormatStrInt(msg_filterexecutionsuccessfulexitcodeis,DosExitCode),nil);
-          UpdateToolMessages;
-          if (ToFocus<>-1) then
-            if Assigned(MessagesWindow) then
-              MessagesWindow^.FocusItem(ToFocus);
-          if DosError=0 then
-            Messages;
-        end;
-    end else
-  if (DosError<>0) then
-    ErrorBox(FormatStrStr(msg_errorexecutingtool,KillTilde(GetToolName(Idx-1))),nil) else
-  if DosExitCode<>0 then
-    ErrorBox(FormatStrInt(msg_toolexecutionsuccessfulexitcodeis,DosExitCode),nil);
-{$ifndef DEBUG}
-  EraseFile(CaptureFile);
-  EraseFile(FilterCaptureName);
-{$endif}
-  DoneToolTempFiles;
-end;
-
-
-procedure TIDEApp.DoGrep;
-Const
-  GrepExeName = 'grep'+ExeExt;
-var
-  PGrepDialog : PCenterDialog;
-  R,R1,R2 : TRect;
-  Control : PView;
-  IL1,IL2 : PInputLine;
-  s : string;
-  p,lineNb,GrepOutputLine : longint;
-  error : word;
-  PosText : longint;
-  showmsg,error_in_reading,FirstMsg : boolean;
-  ToFocus : sw_integer;
-  searchword,
-  GrepExe,GrepArgs,Line,ModuleName : String;
-  GrepOut : text;
-  Params : Array[0..4] of longint;
-begin
-  showmsg:=false;
-  ToFocus:=-1;
-{ Find grep.exe }
-  GrepExe:=GrepExeName;
-  If not LocateExeFile(GrepExe) then
-    Begin
-      ErrorBox(msg_grepprogramnotfound,nil);
-      Exit;
-    End;
-{ Try to load the word from the editor }
-  If not(DeskTop^.Current=nil) and
-     (DeskTop^.Current^.HelpCtx=hcSourceWindow) then
-    Searchword:=PSourceWindow(DeskTop^.Current)^.Editor^.GetCurrentWord
-  else
-    Searchword:='';
-  { Don't use the listseparator in the file list else it's seen as 1 file
-    (at least under linux }
-  s:=highlightexts;
-  ReplaceStr(s,';',' ');
-  { add "" for args with spaces }
-  { WARNING : text must still be entered in usual grep syntax }
-  { -n is always added later because otherwise
-    we don't get the line info PM }
-  GrepArgs:=' -i "$TEXT" '+s;
-{ Dialog }
-  R.Assign(0,0,50,8);
-  new(PGrepDialog,Init(R,dialog_greparguments));
-  with PGrepDialog^ do
-    begin
-      R2.A.Y:=R.A.Y+3;
-      R2.B.Y:=R2.A.Y+1;
-      R2.A.X:=R.A.X+3;
-      R2.B.X:=R.B.X-6;
-      New(IL1, Init(R2, 128));
-      IL1^.Data^:=SearchWord;
-      Insert(IL1);
-      R2.Move(0,-1);
-      Insert(New(PLabel, Init(R2, label_grep_texttofind, IL1)));
-      R1.Assign(R2.B.X, R2.A.Y+1, R2.B.X+3, R2.B.Y+1);
-      Control := New(PHistory, Init(R1, IL1, TextGrepId));
-      Insert(Control);
-
-      R2.Move(0,4);
-      New(IL2, Init(R2, 128));
-      IL2^.Data^:=GrepArgs;
-      Insert(IL2);
-      R2.Move(0,-1);
-      Insert(New(PLabel, Init(R2, label_grep_greparguments, IL2)));
-      R1.Assign(R2.B.X, R2.A.Y+1, R2.B.X+3, R2.B.Y+1);
-      Control := New(PHistory, Init(R1, IL2, GrepArgsId));
-      Insert(Control);
-    end;
-
-    InsertButtons(PGrepDialog);
-    IL1^.Select;
-
-    if Desktop^.ExecView(PGrepDialog)=cmOK then
-    begin
-      SearchWord:=IL1^.Data^;
-      if SearchWord<>'' then
-       begin
-         GrepArgs:=IL2^.Data^;
-         { Remember last used Grep extensions }
-         PosText:=pos('"$TEXT" ',GrepArgs);
-         if PosText>0 then
-           HighlightExts:=Trim(Copy(GrepArgs,PosText+Length('"$TEXT" '),Length(GrepArgs)));
-         { change spaces back into ';' again }
-         ReplaceStr(HighlightExts,' ',';');
-         { Replace search string }
-         ReplaceStr(GrepArgs,'$TEXT',SearchWord);
-         { Linux ? }
-         AddToolCommand(GrepExe+' -n '+GrepArgs);
-         ToFocus:=ToolMessages^.count-1;
-         UpdateToolMessages;
-         if Assigned(MessagesWindow) then
-           MessagesWindow^.FocusItem(ToFocus);
-         showmsg:=true;
-         Messages;
-         PushStatus(FormatStrStr(msg_runninggrepwithargs,GrepArgs));
-         if not ExecuteRedir(GrepExe,'-n '+GrepArgs,'',GrepOutName,GrepErrName) then
-           Begin
-              PopStatus;
-              { 2 as exit code just means that
-                some file vwere not found ! }
-              if (IOStatus<>0) or (ExecuteResult<>2) then
-                begin
-                  Params[0]:=IOStatus;
-                  Params[1]:=ExecuteResult;
-                  WarningBox(msg_errorrunninggrep,@Params);
-                end;
-           End
-         else
-           PopStatus;
-         {$I-}
-         Assign(GrepOut,GrepOutName);
-         Reset(GrepOut);
-         error_in_reading:=false;
-         FirstMsg:=True;
-         GrepOutputLine:=0;
-         While not eof(GrepOut) do
-           begin
-             readln(GrepOut,Line);
-             Inc(GrepOutputLine);
-             p:=pos(':',line);
-             if p>0 then
-               begin
-                 ModuleName:=copy(Line,1,p-1);
-                 Line:=Copy(Line,p+1,255);
-                 p:=pos(':',Line);
-                 val(copy(Line,1,p-1),lineNb,error);
-                 if error=0 then
-                   begin
-                     AddToolMessage(ModuleName,Copy(Line,p+1,255),LineNb,1);
-                     if FirstMsg then
-                       begin
-                         Inc(ToFocus);
-                         FirstMsg:=false;
-                       end;
-                   end
-                 else
-                   error_in_reading:=true;
-               end;
-           end;
-         Close(GrepOut);
-         if not error_in_reading then
-           Erase(GrepOut)
-         else
-           begin
-             ClearFormatParams;
-             AddFormatParamInt(GrepOutputLine);
-             AddFormatParamStr(GrepOutName);
-             WarningBox(msg_errorreadinggrepoutput,@FormatParams);
-           end;
-       { Delete also grep$$.err }
-         if not error_in_reading then
-           begin
-             Assign(GrepOut,GrepErrName);
-             Erase(GrepOut);
-           end;
-         {$I+}
-         EatIO;
-       end;
-    end;
-  Dispose(PGrepDialog, Done);
-  UpdateToolMessages;
-  if (ToFocus<>-1) then
-    if Assigned(MessagesWindow) then
-      MessagesWindow^.FocusItem(ToFocus);
-  if showmsg then
-    Messages;
-end;
-
-
-{
-  $Log$
-  Revision 1.3  2000-11-13 17:37:42  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.2  2000/11/13 16:57:04  pierre
-   * some grep improovements
-
-  Revision 1.2  2000/08/22 09:41:40  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.1  2000/07/20 11:02:15  michael
-  + Fixes from gabor. See fixes.txt
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.21  2000/06/16 08:50:41  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.20  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.19  2000/03/13 20:32:56  pierre
-   + Grep running also in Status line
-
-  Revision 1.18  2000/03/02 22:33:36  pierre
-   * Grep improoved
-
-  Revision 1.17  2000/02/10 00:48:02  pierre
-   * avoid crash for empty string
-
-  Revision 1.16  2000/02/02 22:49:44  pierre
-    * use desktop^.current for current word in grep
-
-  Revision 1.15  1999/10/08 15:25:25  pierre
-   + Grep read check added
-
-  Revision 1.14  1999/09/22 16:17:31  pierre
-   + HistList for Grep
-
-  Revision 1.13  1999/08/03 20:22:35  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.12  1999/07/12 13:14:20  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.11  1999/03/02 13:48:30  peter
-    * fixed far problem is fpdebug
-    * tile/cascading with message window
-    * grep fixes
-
-  Revision 1.10  1999/02/22 12:46:57  peter
-    * small fixes for linux and grep
-
-  Revision 1.9  1999/02/22 11:29:37  pierre
-    + added col info in MessageItem
-    + grep uses HighLightExts and should work for linux
-
-  Revision 1.8  1999/02/22 02:15:17  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.7  1999/02/20 15:18:31  peter
-    + ctrl-c capture with confirm dialog
-    + ascii table in the tools menu
-    + heapviewer
-    * empty file fixed
-    * fixed callback routines in fpdebug to have far for tp7
-
-  Revision 1.6  1999/02/05 13:51:42  peter
-    * unit name of FPSwitches -> FPSwitch which is easier to use
-    * some fixes for tp7 compiling
-
-  Revision 1.5  1999/02/05 12:11:59  pierre
-    + SourceDir that stores directories for sources that the
-      compiler should not know about
-      Automatically asked for addition when a new file that
-      needed filedialog to be found is in an unknown directory
-      Stored and retrieved from INIFile
-    + Breakpoints conditions added to INIFile
-    * Breakpoints insterted and removed at debin and end of debug session
-
-  Revision 1.4  1999/02/04 15:59:08  pierre
-   * grep$$$.out was not closed
-
-  Revision 1.3  1999/02/04 13:32:09  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.2  1999/01/21 11:54:21  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.2  1998/12/22 10:39:49  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 365
ide/text/fpmwnd.inc

@@ -1,365 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Window menu entries
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-procedure TIDEApp.CloseAll;
-
-  procedure SendClose(P: PView); {$ifndef FPC}far;{$endif}
-  begin
-    Message(P,evCommand,cmClose,nil);
-  end;
-
-begin
-  Desktop^.ForEach(@SendClose);
-end;
-
-
-type
-    PWindowListBox = ^TWindowListBox;
-    TWindowListBox = object(TAdvancedListBox)
-      constructor Init(var Bounds: TRect; AScrollBar: PScrollBar);
-      function    GetText(Item,MaxLen: Sw_Integer): String; virtual;
-    end;
-
-    PWindowListDialog = ^TWindowListDialog;
-    TWindowListDialog = object(TCenterDialog)
-      constructor Init;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      destructor  Done; virtual;
-    private
-      LB: PWindowListBox;
-      C : PCollection;
-      BtnShow,BtnHide: PNoUpdateButton;
-      procedure  UpdateList;
-      procedure  UpdateButtons;
-    end;
-
-constructor TWindowListBox.Init(var Bounds: TRect; AScrollBar: PScrollBar);
-begin
-  inherited Init(Bounds,1,AScrollBar);
-end;
-
-function TWindowListBox.GetText(Item,MaxLen: Sw_Integer): String;
-var P: PView;
-    S: string;
-begin
-  P:=List^.At(Item);
-  case P^.HelpCtx of
-    hcSourceWindow : S:=PSourceWindow(P)^.GetTitle(MaxLen);
-    hcInfoWindow   : S:=PProgramInfoWindow(P)^.GetTitle(MaxLen);
-    hcHelpWindow   : S:=PHelpWindow(P)^.GetTitle(MaxLen);
-    hcCalcWindow   : S:=PCalculator(P)^.GetTitle(MaxLen);
-    hcBrowserWindow: S:=PBrowserWindow(P)^.GetTitle(MaxLen);
-    hcMessagesWindow:S:=PMessagesWindow(P)^.GetTitle(MaxLen);
-    hcGDBWindow,
-    hcWatches,
-    hcStack,
-    hcRegisters,
-    hcClipboardWindow,
-    hcASCIITableWindow,
-    hcUserScreenWindow,
-    hcBreakpointListWindow :
-      S:=PWindow(P)^.GetTitle(MaxLen);
-  else S:='???? - '+PWindow(P)^.GetTitle(MaxLen);
-  end;
-  if PWindow(P)^.Number<>0 then
-    S:=S+'('+IntToStr(PWindow(P)^.Number)+')';
-  if P^.GetState(sfVisible) then S:=' '+S else
-    begin
-      S:='*'+S+' - '+msg_windowlist_hidden;
-    end;
-  GetText:=copy(S,1,MaxLen);
-end;
-
-constructor TWindowListDialog.Init;
-var R,R2: TRect;
-    SB: PScrollBar;
-begin
-  R.Assign(0,0,round(ScreenWidth*5/8),15);
-  inherited Init(R, dialog_windowlist);
-
-  New(C, Init(20,10));
-
-  GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.B.X:=R.B.X-13;
-  R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
-  New(SB, Init(R2)); Insert(SB);
-  New(LB, Init(R, SB));
-  LB^.Default:=true;
-  LB^.NewList(C);
-  UpdateList;
-  if C^.Count>=2 then
-   if PWindow(C^.At(1))^.GetState(sfVisible) then
-    LB^.FocusItem(1); { focus the 2nd one }
-  Insert(LB);
-  R2.Copy(R); Dec(R2.A.Y); R2.B.Y:=R2.A.Y+1;
-  Insert(New(PLabel, Init(R2, label_wndlist_windows, LB)));
-
-  GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.A.X:=R.B.X-13+1; R.B.Y:=R.A.Y+2;
-  Insert(New(PButton, Init(R, button_OK, cmOK, bfDefault)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Delete, cmDeleteItem, bfNormal)));
-  R.Move(0,2);
-  New(BtnShow, Init(R, button_Show, cmShowItem, bfNormal));
-  Insert(BtnShow);
-  R.Move(0,2);
-  New(BtnHide, Init(R, button_Hide, cmHideItem, bfNormal));
-  Insert(BtnHide);
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Cancel, cmCancel, bfNormal)));
-
-  LB^.Select;
-  PutCommand(@Self,evBroadcast,cmListFocusChanged,LB);
-end;
-
-procedure TWindowListDialog.UpdateList;
-var VisState: boolean;
-procedure AddIt(P: PView); {$ifndef FPC}far;{$endif}
-begin
-  if (P<>pointer(Desktop^.Background)) and
-     (P^.GetState(sfDisabled)=false) and
-     ((P^.Options and ofSelectable)<>0) and
-     (P^.GetState(sfVisible)=VisState) then
-     C^.Insert(P);
-end;
-begin
-  C^.DeleteAll;
-  VisState:=true; Desktop^.ForEach(@AddIt); { add visible windows to list }
-  VisState:=false; Desktop^.ForEach(@AddIt); { add hidden windows }
-  LB^.SetRange(C^.Count);
-  UpdateButtons;
-  ReDraw;
-end;
-
-procedure TWindowListDialog.UpdateButtons;
-var W: PView;
-begin
-  if LB^.Range>0 then
-    begin
-      W:=LB^.List^.At(LB^.Focused);
-      if Assigned(BtnShow) then
-        BtnShow^.SetState(sfDisabled,W^.GetState(sfVisible));
-      if Assigned(BtnHide) then
-        BtnHide^.SetState(sfDisabled,not W^.GetState(sfVisible));
-    end
-  else
-    begin
-      BtnShow^.SetState(sfDisabled,true);
-      BtnHide^.SetState(sfDisabled,true);
-    end;
-  ReDraw;
-end;
-
-procedure TWindowListDialog.HandleEvent(var Event: TEvent);
-var W: PWindow;
-begin
-  case Event.What of
-    evKeyDown :
-      case Event.KeyCode of
-        kbDel :
-          begin
-            Message(@Self,evCommand,cmDeleteItem,nil);
-            ClearEvent(Event);
-          end;
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmListFocusChanged :
-          if Event.InfoPtr=LB then
-            UpdateButtons;
-      end;
-    evCommand :
-      case Event.Command of
-        cmDeleteItem :
-          if C^.Count>0 then
-          begin
-            Message(C^.At(LB^.Focused),evCommand,cmClose,nil);
-            UpdateList;
-            ClearEvent(Event);
-          end;
-        cmShowItem :
-          if C^.Count>0 then
-          begin
-            PWindow(C^.At(LB^.Focused))^.Show;
-            UpdateList;
-            ClearEvent(Event);
-          end;
-        cmHideItem :
-          if C^.Count>0 then
-          begin
-            PWindow(C^.At(LB^.Focused))^.Hide;
-            UpdateList;
-            ClearEvent(Event);
-          end;
-        cmOK :
-          if C^.Count>0 then
-          begin
-            W:=PWindow(C^.At(LB^.Focused));
-            if W^.GetState(sfVisible)=false then
-              W^.Show;
-            W^.MakeFirst;
-          end;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-destructor TWindowListDialog.Done;
-begin
-  if C<>nil then begin C^.DeleteAll; Dispose(C, Done); end;
-  inherited Done;
-end;
-
-procedure TIDEApp.WindowList;
-var W: PWindowListDialog;
-begin
-  New(W,Init);
-  ExecView(W);
-  Dispose(W,Done);
-  if assigned(Desktop^.Current) then
-    begin
-      Desktop^.Lock;
-      { force correct commands to be enabled }
-      Desktop^.Current^.SetState(sfActive,false);
-      Desktop^.Current^.SetState(sfActive,true);
-      Desktop^.UnLock;
-    end;
-end;
-
-{
-  $Log$
-  Revision 1.3  2000-10-31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.3  2000/10/31 07:44:33  pierre
-   * Window List problem solved in a different way
-
-  Revision 1.1.2.2  2000/10/24 00:21:59  pierre
-   * fix the greyed save after window list box
-
-  Revision 1.2  2000/08/22 09:41:40  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.1  2000/08/15 03:40:53  peter
-   [*] no more fatal exits when the IDE can't find the error file (containing
-       the redirected assembler/linker output) after compilation
-   [*] hidden windows are now added always at the end of the Window List
-   [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
-   [*] selection was incorrectly adjusted when typing in overwrite mode
-   [*] the line wasn't expanded when it's end was reached in overw. mode
-   [*] the IDE now tries to locate source files also in the user specified
-       unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
-   [*] 'Open at cursor' is now aware of the extension (if specified)
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.18  2000/06/16 08:50:41  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.17  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.16  2000/04/18 11:42:37  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.15  2000/03/07 21:51:52  pierre
-   * Reconginze UserScreenWindow
-
-  Revision 1.14  2000/01/28 22:36:46  pierre
-   * avoid unknown type in alt+0 dialog for Ascii Chart and Clipboard
-
-  Revision 1.13  2000/01/10 00:24:18  pierre
-   * register window type added
-
-  Revision 1.12  1999/09/09 14:09:58  pierre
-   + StackWindow is a known window type
-
-  Revision 1.11  1999/07/10 01:24:20  pierre
-   + First implementation of watches window
-
-  Revision 1.10  1999/06/30 23:58:18  pierre
-    + BreakpointsList Window implemented
-      with Edit/New/Delete functions
-    + Individual breakpoint dialog with support for all types
-      ignorecount and conditions
-      (commands are not yet implemented, don't know if this wolud be useful)
-      awatch and rwatch have problems because GDB does not annotate them
-      I fixed v4.16 for this
-
-  Revision 1.9  1999/06/29 22:50:15  peter
-    * more fixes from gabor
-
-  Revision 1.8  1999/06/28 19:32:23  peter
-    * fixes from gabor
-
-  Revision 1.7  1999/03/01 15:42:00  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.6  1999/01/21 11:54:22  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.5  1999/01/12 14:29:37  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.4  1999/01/04 11:49:49  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.3  1998/12/28 15:47:50  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.2  1998/12/23 22:58:19  peter
-    * fixed windowlist for fpc
-
-  Revision 1.1  1998/12/22 14:27:54  peter
-    * moved
-
-  Revision 1.3  1998/12/22 10:39:50  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 844
ide/text/fpredir.pas

@@ -1,844 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Unit to redirect output and error to files
-
-    Adapted from code donated to public domain by Schwartz Gabriel 20/03/1993
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-Unit FPRedir;
-Interface
-
-{$R-}
-{$ifndef Unix}
-  {$S-}
-{$endif}
-
-{$ifdef TP}
-{$define implemented}
-{$endif TP}
-{$ifdef Go32v2}
-{$define implemented}
-{$endif}
-{$ifdef Win32}
-{$define implemented}
-{$endif}
-{$ifdef Unix}
-{$define implemented}
-{$endif}
-
-{ be sure msdos is not set for FPC compiler }
-{$ifdef FPC}
-{$UnDef MsDos}
-{$endif FPC}
-
-Var
-  IOStatus                   : Integer;
-  RedirErrorOut,RedirErrorIn,
-  RedirErrorError            : Integer;
-  ExecuteResult              : Word;
-
-{------------------------------------------------------------------------------}
-procedure InitRedir;
-function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
-procedure DosExecute(ProgName, ComLine : String);
-
-function  ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
-procedure RestoreRedirOut;
-procedure DisableRedirOut;
-procedure EnableRedirOut;
-function  ChangeRedirIn(Const Redir : String) : Boolean;
-procedure RestoreRedirIn;
-procedure DisableRedirIn;
-procedure EnableRedirIn;
-function  ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolean;
-procedure RestoreRedirError;
-procedure DisableRedirError;
-procedure EnableRedirError;
-procedure RedirDisableAll;
-procedure RedirEnableAll;
-
-Implementation
-
-Uses
-{$ifdef go32v2}
-  go32,
-{$endif go32v2}
-{$ifdef win32}
-  windows,
-{$endif win32}
-{$ifdef Unix}
-  linux,
-{$endif Unix}
-  dos;
-
-var
-  FIN,FOUT,FERR     : ^File;
-  RedirChangedOut,
-  RedirChangedIn    : Boolean;
-  RedirChangedError : Boolean;
-  InRedirDisabled,OutRedirDisabled,ErrorRedirDisabled : Boolean;
-
-{*****************************************************************************
-                                     Dos
-*****************************************************************************}
-
-{$ifdef implemented}
-
-{$ifdef TP}
-
-{$ifndef win32}
-const
-  UnusedHandle    = -1;
-  StdInputHandle  = 0;
-  StdOutputHandle = 1;
-  StdErrorHandle  = 2;
-{$endif win32}
-
-Type
-  PtrRec = packed record
-             Ofs, Seg : Word;
-           end;
-
-  PHandles = ^THandles;
-  THandles = Array [Byte] of Byte;
-
-  PWord = ^Word;
-
-Var
-  MinBlockSize : Word;
-  MyBlockSize  : Word;
-  Handles      : PHandles;
-  PrefSeg      : Word;
-  OldHandleOut,OldHandleIn,OldHandleError    : Byte;
-{$endif TP}
-
-var
-  TempHOut, TempHIn,TempHError : longint;
-
-{ For Unix the following functions exist
-Function  Dup(oldfile:longint;var newfile:longint):Boolean;
-Function  Dup2(oldfile,newfile:longint):Boolean;
-Function  fdClose(fd:longint):boolean;
-}
-{$ifdef go32v2}
-
-function dup(fh : longint;var nh : longint) : boolean;
-  var
-    Regs : Registers;
-
-begin
-    Regs.ah:=$45;
-    Regs.bx:=fh;
-    MsDos (Regs);
-    Dup:=true;
-    If (Regs.Flags and fCarry)=0 then
-      nh:=Regs.Ax
-    else
-      Dup:=false;
-end;
-
-function dup2(fh,nh : longint) : boolean;
-  var
-    Regs : Registers;
-
-begin
-    Dup2:=true;
-    If fh=nh then
-      exit;
-    Regs.ah:=$46;
-    Regs.bx:=fh;
-    Regs.cx:=nh;
-    MsDos (Regs);
-    If (Regs.Flags and fCarry)<>0 then
-      Dup2:=false;
-end;
-
-Function FdClose (Handle : Longint) : boolean;
-var Regs: registers;
-begin
-  Regs.Eax := $3e00;
-  Regs.Ebx := Handle;
-  MsDos(Regs);
-  FdClose:=(Regs.Flags and fCarry)=0;
-end;
-
-{$endif def go32v2}
-
-{$ifdef win32}
-Function FdClose (Handle : Longint) : boolean;
-begin
-  { Do we need this ?? }
-  FdClose:=true;
-end;
-{$endif}
-
-{$ifdef TP}
-Function FdClose (Handle : Longint) : boolean;
-begin
-  { if executed as under GO32 this hangs the DOS-prompt }
-  FdClose:=true;
-end;
-
-{$endif}
-
-{$I-}
-function FileExist(const FileName : PathStr) : Boolean;
-var
-  f : file;
-  Attr : word;
-begin
-  Assign(f, FileName);
-  GetFAttr(f, Attr);
-  FileExist := DosError = 0;
-end;
-
-
-{............................................................................}
-
-function ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
-  begin
-    ChangeRedirOut:=False;
-    If Redir = '' then Exit;
-    Assign (FOUT^, Redir);
-    If AppendToFile and FileExist(Redir) then
-      Begin
-      Reset(FOUT^,1);
-      Seek(FOUT^,FileSize(FOUT^));
-      End else Rewrite (FOUT^);
-
-    RedirErrorOut:=IOResult;
-    IOStatus:=RedirErrorOut;
-    If IOStatus <> 0 then Exit;
-{$ifndef FPC}
-    Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
-    OldHandleOut:=Handles^[StdOutputHandle];
-    Handles^[StdOutputHandle]:=Handles^[FileRec (FOUT^).Handle];
-    ChangeRedirOut:=True;
-    OutRedirDisabled:=False;
-{$else}
-{$ifdef win32}
-    if SetStdHandle(Std_Output_Handle,FileRec(FOUT^).Handle) then
-{$else not win32}
-    if dup(StdOutputHandle,TempHOut) and
-       dup2(FileRec(FOUT^).Handle,StdOutputHandle) then
-{$endif not win32}
-      begin
-         ChangeRedirOut:=True;
-         OutRedirDisabled:=False;
-      end;
-{$endif def FPC}
-     RedirChangedOut:=True;
-  end;
-
-function ChangeRedirIn(Const Redir : String) : Boolean;
-  begin
-    ChangeRedirIn:=False;
-    If Redir = '' then Exit;
-    Assign (FIN^, Redir);
-    Reset(FIN^,1);
-
-    RedirErrorIn:=IOResult;
-    IOStatus:=RedirErrorIn;
-    If IOStatus <> 0 then Exit;
-{$ifndef FPC}
-    Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
-    OldHandleIn:=Handles^[StdInputHandle];
-    Handles^[StdInputHandle]:=Handles^[FileRec (FIN^).Handle];
-    ChangeRedirIn:=True;
-    InRedirDisabled:=False;
-{$else}
-{$ifdef win32}
-    if SetStdHandle(Std_Input_Handle,FileRec(FIN^).Handle) then
-{$else not win32}
-    if dup(StdInputHandle,TempHIn) and
-       dup2(FileRec(FIN^).Handle,StdInputHandle) then
-{$endif not win32}
-      begin
-         ChangeRedirIn:=True;
-         InRedirDisabled:=False;
-      end;
-{$endif def FPC}
-     RedirChangedIn:=True;
-  end;
-
-function ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolean;
-  begin
-    ChangeRedirError:=False;
-    If Redir = '' then Exit;
-    Assign (FERR^, Redir);
-    If AppendToFile and FileExist(Redir) then
-      Begin
-      Reset(FERR^,1);
-      Seek(FERR^,FileSize(FERR^));
-      End else Rewrite (FERR^);
-
-    RedirErrorError:=IOResult;
-    IOStatus:=RedirErrorError;
-    If IOStatus <> 0 then Exit;
-{$ifndef FPC}
-    Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
-    OldHandleError:=Handles^[StdErrorHandle];
-    Handles^[StdErrorHandle]:=Handles^[FileRec (FERR^).Handle];
-    ChangeRedirError:=True;
-    ErrorRedirDisabled:=False;
-{$else}
-{$ifdef win32}
-    if SetStdHandle(Std_Error_Handle,FileRec(FERR^).Handle) then
-{$else not win32}
-    if dup(StdErrorHandle,TempHError) and
-       dup2(FileRec(FERR^).Handle,StdErrorHandle) then
-{$endif not win32}
-      begin
-         ChangeRedirError:=True;
-         ErrorRedirDisabled:=False;
-      end;
-{$endif}
-     RedirChangedError:=True;
-  end;
-
-
-{$IfDef MsDos}
-{Set HeapEnd Pointer to Current Used Heapsize}
-Procedure SmallHeap;assembler;
-asm
-                mov     bx,word ptr HeapPtr
-                shr     bx,4
-                inc     bx
-                add     bx,word ptr HeapPtr+2
-                mov     ax,PrefixSeg
-                sub     bx,ax
-                mov     es,ax
-                mov     ah,4ah
-                int     21h
-end;
-
-
-
-{Set HeapEnd Pointer to Full Heapsize}
-Procedure FullHeap;assembler;
-asm
-                mov     bx,word ptr HeapEnd
-                shr     bx,4
-                inc     bx
-                add     bx,word ptr HeapEnd+2
-                mov     ax,PrefixSeg
-                sub     bx,ax
-                mov     es,ax
-                mov     ah,4ah
-                int     21h
-end;
-
-{$EndIf MsDos}
-
-
-  procedure RestoreRedirOut;
-
-  begin
-    If not RedirChangedOut then Exit;
-{$ifndef FPC}
-    Handles^[StdOutputHandle]:=OldHandleOut;
-    OldHandleOut:=StdOutputHandle;
-{$else}
-{$ifdef win32}
-    SetStdHandle(Std_Output_Handle,StdOutputHandle);
-{$else not win32}
-    dup2(TempHOut,StdOutputHandle);
-{$endif not win32}
-{$endif FPC}
-    Close (FOUT^);
-    fdClose(TempHOut);
-    RedirChangedOut:=false;
-  end;
-
-  {............................................................................}
-
-  procedure RestoreRedirIn;
-
-  begin
-    If not RedirChangedIn then Exit;
-{$ifndef FPC}
-    Handles^[StdInputHandle]:=OldHandleIn;
-    OldHandleIn:=StdInputHandle;
-{$else}
-{$ifdef win32}
-    SetStdHandle(Std_Input_Handle,StdInputHandle);
-{$else not win32}
-    dup2(TempHIn,StdInputHandle);
-{$endif not win32}
-{$endif}
-    Close (FIn^);
-    fdClose(TempHIn);
-    RedirChangedIn:=false;
-  end;
-
-  {............................................................................}
-
-  procedure DisableRedirIn;
-
-  begin
-    If not RedirChangedIn then Exit;
-    If InRedirDisabled then Exit;
-{$ifndef FPC}
-    Handles^[StdInputHandle]:=OldHandleIn;
-{$else}
-{$ifdef win32}
-    SetStdHandle(Std_Input_Handle,StdInputHandle);
-{$else not win32}
-    dup2(TempHIn,StdInputHandle);
-{$endif not win32}
-{$endif}
-    InRedirDisabled:=True;
-  end;
-
-  {............................................................................}
-
-  procedure EnableRedirIn;
-
-  begin
-    If not RedirChangedIn then Exit;
-    If not InRedirDisabled then Exit;
-{$ifndef FPC}
-    Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
-    Handles^[StdInputHandle]:=Handles^[FileRec (FIn^).Handle];
-{$else}
-{$ifdef win32}
-    SetStdHandle(Std_Input_Handle,FileRec(FIn^).Handle);
-{$else not win32}
-    dup2(FileRec(FIn^).Handle,StdInputHandle);
-{$endif not win32}
-{$endif}
-    InRedirDisabled:=False;
-  end;
-
-  {............................................................................}
-
-  procedure DisableRedirOut;
-
-  begin
-    If not RedirChangedOut then Exit;
-    If OutRedirDisabled then Exit;
-{$ifndef FPC}
-    Handles^[StdOutputHandle]:=OldHandleOut;
-{$else}
-{$ifdef win32}
-    SetStdHandle(Std_Output_Handle,StdOutputHandle);
-{$else not win32}
-    dup2(TempHOut,StdOutputHandle);
-{$endif not win32}
-{$endif}
-    OutRedirDisabled:=True;
-  end;
-
-  {............................................................................}
-
-  procedure EnableRedirOut;
-
-  begin
-    If not RedirChangedOut then Exit;
-    If not OutRedirDisabled then Exit;
-{$ifndef FPC}
-    Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
-    Handles^[StdOutputHandle]:=Handles^[FileRec (FOut^).Handle];
-{$else}
-{$ifdef win32}
-    SetStdHandle(Std_Output_Handle,FileRec(FOut^).Handle);
-{$else not win32}
-    dup2(FileRec(FOut^).Handle,StdOutputHandle);
-{$endif not win32}
-{$endif}
-    OutRedirDisabled:=False;
-  end;
-
-  {............................................................................}
-
-  procedure RestoreRedirError;
-
-  begin
-    If not RedirChangedError then Exit;
-{$ifndef FPC}
-    Handles^[StdErrorHandle]:=OldHandleError;
-    OldHandleError:=StdErrorHandle;
-{$else}
-{$ifdef win32}
-    SetStdHandle(Std_Error_Handle,StdErrorHandle);
-{$else not win32}
-    dup2(TempHError,StdErrorHandle);
-{$endif not win32}
-{$endif}
-    Close (FERR^);
-    fdClose(TempHError);
-    RedirChangedError:=false;
-  end;
-
-  {............................................................................}
-
-  procedure DisableRedirError;
-
-  begin
-    If not RedirChangedError then Exit;
-    If ErrorRedirDisabled then Exit;
-{$ifndef FPC}
-    Handles^[StdErrorHandle]:=OldHandleError;
-{$else}
-{$ifdef win32}
-    SetStdHandle(Std_Error_Handle,StdErrorHandle);
-{$else not win32}
-    dup2(TempHError,StdErrorHandle);
-{$endif not win32}
-{$endif}
-    ErrorRedirDisabled:=True;
-  end;
-
-  {............................................................................}
-
-  procedure EnableRedirError;
-
-  begin
-    If not RedirChangedError then Exit;
-    If not ErrorRedirDisabled then Exit;
-{$ifndef FPC}
-    Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
-    Handles^[StdErrorHandle]:=Handles^[FileRec (FErr^).Handle];
-{$else}
-{$ifdef win32}
-    SetStdHandle(Std_Error_Handle,FileRec(FErr^).Handle);
-{$else not win32}
-    dup2(FileRec(FERR^).Handle,StdErrorHandle);
-{$endif not win32}
-{$endif}
-    ErrorRedirDisabled:=False;
-  end;
-
-{............................................................................}
-
-function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
-Begin
-  RedirErrorOut:=0; RedirErrorIn:=0; RedirErrorError:=0;
-  ExecuteResult:=0;
-  IOStatus:=0;
-  if RedirStdIn<>'' then
-    ChangeRedirIn(RedirStdIn);
-  if RedirStdOut<>'' then
-    ChangeRedirOut(RedirStdOut,false);
-  if RedirStdErr<>'stderr' then
-    ChangeRedirError(RedirStdErr,false);
-  DosExecute(ProgName,ComLine);
-  RestoreRedirOut;
-  RestoreRedirIn;
-  RestoreRedirError;
-  ExecuteRedir:=(IOStatus=0) and (RedirErrorOut=0) and
-                (RedirErrorIn=0) and (RedirErrorError=0) and
-                (ExecuteResult=0);
-End;
-
-{............................................................................}
-
-procedure RedirDisableAll;
-  begin
-    If RedirChangedIn and not InRedirDisabled then
-      DisableRedirIn;
-    If RedirChangedOut and not OutRedirDisabled then
-      DisableRedirOut;
-    If RedirChangedError and not ErrorRedirDisabled then
-      DisableRedirError;
-  end;
-
-{............................................................................}
-
-procedure RedirEnableAll;
-  begin
-    If RedirChangedIn and InRedirDisabled then
-      EnableRedirIn;
-    If RedirChangedOut and OutRedirDisabled then
-      EnableRedirOut;
-    If RedirChangedError and ErrorRedirDisabled then
-      EnableRedirError;
-  end;
-
-
-procedure InitRedir;
-begin
-{$ifndef FPC}
-  PrefSeg:=PrefixSeg;
-{$endif FPC}
-end;
-
-{$else not  implemented}
-
-
-{*****************************************************************************
-                                 Fake
-*****************************************************************************}
-
-function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
-begin
-  ExecuteRedir:=false;
-end;
-
-function  ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
-begin
-  ChangeRedirOut:=false;
-end;
-
-
-procedure RestoreRedirOut;
-begin
-end;
-
-
-procedure DisableRedirOut;
-begin
-end;
-
-
-procedure EnableRedirOut;
-begin
-end;
-
-
-function  ChangeRedirIn(Const Redir : String) : Boolean;
-begin
-  ChangeRedirIn:=false;
-end;
-
-
-procedure RestoreRedirIn;
-begin
-end;
-
-
-procedure DisableRedirIn;
-begin
-end;
-
-
-procedure EnableRedirIn;
-begin
-end;
-
-
-function  ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolean;
-begin
-  ChangeRedirError:=false;
-end;
-
-
-procedure RestoreRedirError;
-begin
-end;
-
-
-procedure DisableRedirError;
-begin
-end;
-
-
-procedure EnableRedirError;
-begin
-end;
-
-
-procedure RedirDisableAll;
-begin
-end;
-
-
-procedure RedirEnableAll;
-begin
-end;
-
-
-procedure InitRedir;
-begin
-end;
-{$endif not implemented}
-
-
-{............................................................................}
-
-  procedure DosExecute(ProgName, ComLine : String);
-{$ifdef win32}
-    var
-      StoreInherit : BOOL;
-{$endif win32}
-
-  Begin
-{$IfDef MsDos}
-  SmallHeap;
-{$EndIf MsDos}
-    SwapVectors;
-    { Must use shell() for linux for the wildcard expansion (PFV) }
-{$ifdef Unix}
-    IOStatus:=0;
-    ExecuteResult:=Shell(Progname+' '+Comline);
-    { Signal that causes the stop of the shell }
-    IOStatus:=ExecuteResult and $7F;
-    { Exit Code seems to be in the second byte,
-      is this also true for BSD ??
-      $80 bit is a CoreFlag apparently }
-    ExecuteResult:=(ExecuteResult and $ff00) shr 8;
-{$else}
-{$ifdef win32}
-    StoreInherit:=ExecInheritsHandles;
-    ExecInheritsHandles:=true;
-{$endif win32}
-    DosError:=0;
-    Dos.Exec (ProgName, ComLine);
-{$ifdef win32}
-    ExecInheritsHandles:=StoreInherit;
-{$endif win32}
-    IOStatus:=DosError;
-    ExecuteResult:=DosExitCode;
-{$endif}
-    SwapVectors;
-{$IfDef MsDos}
-  Fullheap;
-{$EndIf MsDos}
-  End;
-
-{*****************************************************************************
-                                  Initialize
-*****************************************************************************}
-
-var oldexit : pointer;
-
-procedure RedirExit; {$ifndef FPC}far;{$endif}
-begin
-  exitproc:=oldexit;
-  Dispose(FIn); Dispose(FOut); Dispose(FErr);
-end;
-
-Begin
-  oldexit:=exitproc;
-  exitproc:=@RedirExit;
-  New(FIn); New(FOut); New(FErr);
-End.
-{
-  $Log$
-  Revision 1.3  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.2  2000/11/14 09:40:35  marco
-   * Third batch renamefest
-
-  Revision 1.2  2000/10/31 22:35:54  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/10/04 13:29:59  pierre
-   * Get ExitCode for DosExecute in linux
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.25  2000/05/17 10:19:53  pierre
-   * Reset DosError to zero !
-
-  Revision 1.24  1999/11/10 17:10:59  pierre
-   + DosExecute to interface
-
-  Revision 1.23  1999/09/22 13:03:27  pierre
-   * Win32 ExecInheritsHandles typo problem
-
-  Revision 1.22  1999/09/22 09:03:58  peter
-    * typo fixed for win32
-
-  Revision 1.21  1999/09/21 11:28:22  pierre
-   + Redir for win32
-
-  Revision 1.20  1999/08/05 16:54:36  peter
-    * win32 fixes
-
-  Revision 1.19  1999/08/03 20:22:36  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.17  1999/05/01 23:45:07  pierre
-   * FIn FOut FErr dispsoed at exit
-
-  Revision 1.16  1999/04/29 22:57:09  pierre
-   + added code for temporary disabling of redirection
-
-  Revision 1.15  1999/04/07 21:55:52  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.14  1999/03/20 00:04:49  pierre
-   * handle loss fixed
-
-  Revision 1.13  1999/03/09 01:34:35  peter
-    * linux unit
-
-  Revision 1.12  1999/03/08 14:58:10  peter
-    + prompt with dialogs for tools
-
-  Revision 1.11  1999/03/01 15:42:01  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.10  1999/02/22 12:46:58  peter
-    * small fixes for linux and grep
-
-  Revision 1.9  1999/02/22 11:12:33  pierre
-    * dup and dup2 work for go32v2
-    + also should work for linux (after linux.pp patch)
-
-  Revision 1.8  1999/02/22 02:15:18  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.7  1999/02/20 15:18:32  peter
-    + ctrl-c capture with confirm dialog
-    + ascii table in the tools menu
-    + heapviewer
-    * empty file fixed
-    * fixed callback routines in fpdebug to have far for tp7
-
-  Revision 1.6  1999/02/05 13:51:43  peter
-    * unit name of FPSwitches -> FPSwitch which is easier to use
-    * some fixes for tp7 compiling
-
-}

+ 0 - 1039
ide/text/fpstre.inc

@@ -1,1039 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by Florian Klaempfl & Berczi Gabor
-
-    Strings for menus, dialogs etc
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-const
-      menu_local_gotosource = '~G~oto source';
-      menu_local_tracksource = '~T~rack source';
-      menu_local_options = '~O~ptions...';
-      menu_local_clear = '~C~lear';
-
-      menu_common_contents     = '~C~ontents';
-      menu_common_index        = '~I~ndex';
-      menu_common_topicsearch  = '~T~opic search';
-      menu_common_prevtopic    = '~P~revious topic';
-      menu_common_copy = '~C~opy';
-
-      menu_key_common_helpindex = 'Shift+F1';
-      menu_key_common_topicsearch = 'Ctrl+F1';
-      menu_key_common_prevtopic = 'Alt+F1';
-      menu_key_common_copy = 'Ctrl+Ins';
-
-      { Symbol browser tabs }
-      label_browsertab_scope = 'S';
-      label_browsertab_reference = 'R';
-      label_browsertab_inheritance = 'I';
-      label_browsertab_memory = 'M';
-      label_browsertab_unit = 'U';
-
-{$ifdef USERESSTRINGS}
-    resourcestring
-{$else}
-    const
-{$endif}
-      { menu entries }
-      menu_file              = '~F~ile';
-      menu_file_new          = '~N~ew';
-      menu_file_template     = 'New from ~t~emplate...';
-      menu_file_open         = '~O~pen...';
-      menu_file_save         = '~S~ave';
-      menu_file_saveas       = 'Save ~a~s...';
-      menu_file_saveall      = 'Save a~l~l';
-      menu_file_changedir    = '~C~hange dir...';
-      menu_file_dosshell     = '~D~OS shell';
-      menu_file_exit         = 'E~x~it';
-
-      menu_edit              = '~E~dit';
-      menu_edit_copywin      = 'Cop~y~ to Windows';
-      menu_edit_pastewin     = 'Paste from ~W~indows';
-      menu_edit_undo         = '~U~ndo';
-      menu_edit_redo         = '~R~edo';
-      menu_edit_cut          = 'Cu~t~';
-      menu_edit_copy         = menu_common_copy;
-      menu_edit_paste        = '~P~aste';
-      menu_edit_clear        = 'C~l~ear';
-      menu_edit_showclipboard= '~S~how clipboard';
-
-      menu_search            = '~S~earch';
-      menu_search_find       = '~F~ind...';
-      menu_search_replace    = '~R~eplace...';
-      menu_search_searchagain= '~S~earch again';
-      menu_search_jumpline   = '~G~o to line number...';
-      menu_search_findproc   = 'Find ~p~rocedure...';
-      menu_search_objects    = '~O~bjects';
-      menu_search_modules    = 'Mod~u~les';
-      menu_search_globals    = 'G~l~obals';
-      menu_search_symbol     = 'S~y~mbol...';
-
-      menu_run               = '~R~un';
-      menu_run_run           = '~R~un';
-      menu_run_stepover      = '~S~tep over';
-      menu_run_traceinto     = '~T~race into';
-      menu_run_conttocursor  = '~G~oto Cursor';
-      menu_run_untilreturn   = '~U~ntil return';
-      menu_run_parameters    = 'P~a~rameters...';
-      menu_run_resetdebugger = '~P~rogram reset';
-
-      menu_compile           = '~C~ompile';
-      menu_compile_compile   = '~C~ompile';
-      menu_compile_make      = '~M~ake';
-      menu_compile_build     = '~B~uild';
-      menu_compile_target    = '~T~arget...';
-      menu_compile_primaryfile = '~P~rimary file...';
-      menu_compile_clearprimaryfile = 'C~l~ear primary file';
-      menu_compile_information = '~I~nformation...';
-      menu_compile_compilermessages = 'C~o~mpiler messages';
-
-      menu_debug             = '~D~ebug';
-      menu_debug_output      = '~O~utput';
-      menu_debug_userscreen  = '~U~ser screen';
-      menu_debug_breakpoint  = '~B~reakpoint';
-      menu_debug_callstack   = '~C~all stack';
-      menu_debug_registers   = '~R~egisters';
-      menu_debug_addwatch    = '~A~dd Watch';
-      menu_debug_watches     = '~W~atches';
-      menu_debug_breakpointlist = 'Breakpoint ~L~ist';
-      menu_debug_gdbwindow   = '~G~DB window';
-
-      menu_tools             = '~T~ools';
-      menu_tools_messages    = '~M~essages';
-      menu_tools_msgnext     = 'Goto ~n~ext';
-      menu_tools_msgprev     = 'Goto ~p~revious';
-      menu_tools_grep        = '~G~rep';
-      menu_tools_calculator  = '~C~alculator';
-      menu_tools_asciitable  = 'Ascii ~t~able';
-
-      menu_options           = '~O~ptions';
-      menu_options_mode      = 'Mode~.~..';
-      menu_options_compiler  = '~C~ompiler...';
-      menu_options_memory    = '~M~emory sizes...';
-      menu_options_linker    = '~L~inker...';
-      menu_options_debugger  = 'De~b~ugger...';
-      menu_options_directories = '~D~irectories...';
-      menu_options_browser   = 'Bro~w~ser...';
-      menu_options_tools     = '~T~ools...';
-      menu_options_env       = '~E~nvironment';
-      menu_options_env_preferences = '~P~references...';
-      menu_options_env_editor= '~E~ditor...';
-      menu_options_env_codecomplete = 'Code~C~omplete...';
-      menu_options_env_codetemplates = 'Code~T~emplates...';
-      menu_options_env_desktop = '~D~esktop...';
-      menu_options_env_mouse = '~M~ouse...';
-      menu_options_env_startup = '~S~tartup...';
-      menu_options_env_colors= '~C~olors';
-      menu_options_open      = '~O~pen...';
-      menu_options_save      = '~S~ave';
-      menu_options_saveas    = 'Save ~a~s...';
-
-      menu_window            = '~W~indow';
-      menu_window_tile       = '~T~ile';
-      menu_window_cascade    = 'C~a~scade';
-      menu_window_closeall   = 'Cl~o~se all';
-      menu_window_resize     = '~S~ize/Move';
-      menu_window_zoom       = '~Z~oom';
-      menu_window_next       = '~N~ext';
-      menu_window_previous   = '~P~revious';
-      menu_window_hide       = '~H~ide';
-      menu_window_close      = '~C~lose';
-      menu_window_list       = '~L~ist...';
-      menu_window_update     = '~R~efresh display';
-
-      menu_help              = '~H~elp';
-      menu_help_contents     = menu_common_contents;
-      menu_help_index        = menu_common_index;
-      menu_help_topicsearch  = menu_common_topicsearch;
-      menu_help_prevtopic    = menu_common_prevtopic;
-      menu_help_using        = '~U~sing help';
-      menu_help_files        = '~F~iles...';
-      menu_help_about        = '~A~bout...';
-
-      { Breakpoints window local menu items }
-      menu_bplocal_gotosource  = menu_local_gotosource;
-      menu_bplocal_editbreakpoint = '~E~dit breakpoint';
-      menu_bplocal_newbreakpoint = '~N~ew breakpoint';
-      menu_bplocal_deletebreakpoint = '~D~elete breakpoint';
-      menu_bplocal_togglestate = '~T~oggle state';
-
-      { Watches local menu items }
-      menu_watchlocal_edit = '~E~dit watch';
-      menu_watchlocal_new = '~N~ew watch';
-      menu_watchlocal_delete = '~D~elete watch';
-
-      { Symbol view local menu items }
-      menu_symlocal_browse = '~B~rowse';
-      menu_symlocal_gotosource = menu_local_gotosource;
-      menu_symlocal_tracksource = menu_local_tracksource;
-      menu_symlocal_options = menu_local_options;
-
-      { Source editor local menu items }
-      menu_srclocal_openfileatcursor = 'Open ~f~ile at cursor';
-      menu_srclocal_browseatcursor = '~B~rowse symbol at cursor';
-      menu_srclocal_topicsearch = 'Topic ~s~earch';
-      menu_srclocal_options = menu_local_options;
-
-      { Help viewer local menu items }
-      menu_hlplocal_contents = menu_common_contents;
-      menu_hlplocal_index = menu_common_index;
-      menu_hlplocal_topicsearch = menu_common_topicsearch;
-      menu_hlplocal_prevtopic = menu_common_prevtopic;
-      menu_hlplocal_copy = menu_common_copy;
-
-      { Messages local menu items }
-      menu_msglocal_clear = menu_local_clear;
-      menu_msglocal_gotosource = menu_local_gotosource;
-      menu_msglocal_tracksource = menu_local_tracksource;
-
-      { short cut entries in menu }
-      menu_key_file_open     = 'F3';
-      menu_key_file_save     = 'F2';
-      menu_key_file_exit     = 'Alt+X';
-
-      menu_key_edit_undo     = 'Alt+BkSp';
-      menu_key_edit_cut      = 'Shift+Del';
-      menu_key_edit_copy     = menu_key_common_copy;
-      menu_key_edit_paste    = 'Shift+Ins';
-      menu_key_edit_clear    = 'Ctrl+Del';
-
-      menu_key_run_run       = 'Ctrl+F9';
-      menu_key_run_stepover  = 'F8';
-      menu_key_run_traceinto = 'F7';
-      menu_key_run_conttocursor = 'F4';
-      menu_key_run_resetdebugger = 'Ctrl+F2';
-
-      menu_key_compile_compile = 'Alt+F9';
-      menu_key_compile_make = 'F9';
-      menu_key_compile_compilermessages = 'F12';
-
-      menu_key_debug_userscreen = 'Alt+F5';
-      menu_key_debug_breakpoint = 'Ctrl+F8';
-      menu_key_debug_callstack = 'Ctrl+F3';
-      menu_key_debug_addwatch = 'Ctrl+F7';
-
-      menu_key_tools_messages= 'F11';
-      menu_key_tools_msgnext = 'Alt+F8';
-      menu_key_tools_msgprev = 'Alt+F7';
-      menu_key_tools_grep    = 'Shift+F2';
-
-      menu_key_window_resize = 'Ctrl+F5';
-      menu_key_window_zoom   = 'F5';
-      menu_key_window_next   = 'F6';
-      menu_key_window_previous = 'Shift+F6';
-      menu_key_window_close  = 'Alt+F3';
-      menu_key_window_list   = 'Alt+0';
-      menu_key_window_hide   = 'Ctrl+F6';
-
-      menu_key_help_helpindex= menu_key_common_helpindex;
-      menu_key_help_topicsearch = menu_key_common_topicsearch;
-      menu_key_help_prevtopic= menu_key_common_prevtopic;
-
-      menu_key_hlplocal_index = menu_key_common_helpindex;
-      menu_key_hlplocal_topicsearch = menu_key_common_topicsearch;
-      menu_key_hlplocal_prevtopic = menu_key_common_prevtopic;
-      menu_key_hlplocal_copy = menu_key_common_copy;
-
-      dialog_openafile        = 'Open a file';
-      label_filetoopen        = 'File to ope~n~';
-      label_lookingfor        = 'Looking for %s';
-
-      msg_confirmsourcediradd = 'Directory %s is not in search path for source files. '+
-                                'Should we add it ?';
-
-      dialog_fillintemplateparameter = 'Fill in template parameter';
-
-      dialog_calculator       = 'Calculator';
-
-      msg_quitconfirm         = 'Do You really want to quit?';
-
-      { CodeComplete dialog }
-      dialog_codecomplete     = 'CodeComplete';
-      label_codecomplete_keywords = '~K~eywords';
-
-      dialog_codecomplete_add = 'Add new keyword';
-      label_codecomplete_add_keyword = 'Keyword';
-
-      dialog_codecomplete_edit = 'Edit keyword';
-      label_codecomplete_edit_keyword = 'Keyword';
-
-      { CodeTemplates dialog }
-      dialog_codetemplates_add = 'Add new template';
-      dialog_codetemplates_edit = 'Edit template';
-
-      msg_codecomplete_alreadyinlist = '"%s" is already in the list';
-
-      { File|New from template dialog }
-      msg_notemplatesavailable = 'No templates available.';
-      dialog_newfromtemplate   = 'New from template';
-      label_availabletemplates = 'Available ~t~emplates';
-
-      label_codetemplate_shortcut = '~S~hortcut';
-      label_codetemplate_content = '~T~emplate content';
-      label_codetemplate_templates = '~T~emplates';
-
-      dialog_newtemplate = 'New template';
-      dialog_modifytemplate = 'Modify template';
-      msg_codetemplate_alreadyinlist = 'A template named "%s" is already in the list';
-
-      dialog_compilermessages = 'Compiler Messages';
-
-      dialog_compilingwithmode = 'Compiling  (%s mode)';
-
-      { Breakpoints window }
-      dialog_breakpointlist = 'Breakpoint list';
-      label_breakpointpropheader = ' Type      | State   | Position          | Ignore | Conditions ';
-
-      dialog_modifynewbreakpoint = 'Modify/New Breakpoint';
-      label_breakpoint_name = '~N~ame';
-      label_breakpoint_line = '~L~ine';
-      label_breakpoint_conditions = 'Conditions';
-      label_breakpoint_ignorecount = '~I~gnore count';
-
-      { Watches window }
-      dialog_watches = 'Watches';
-
-      label_watch_expressiontowatch = '~E~xpression to watch';
-      label_watch_values = 'Watch values';
-
-      msg_watch_currentvalue = 'Current value: '+#13+
-                               '%s';
-      msg_watch_currentandpreviousvalue = 'Current value: '+#13+
-                                          '%s'+#13+
-                                          'Previous value: '+#13+
-                                          '%s';
-
-      dialog_registers = 'Register View';
-
-      dialog_fpu = 'FPU View';
-
-      dialog_callstack = 'Call Stack';
-
-      dialog_help = 'Help';
-      msg_modalhelpnotimplemented = 'Sorry, modal help not yet implemented.';
-
-      dialog_browse = 'Browse: %s';
-      dialog_units = 'Units';
-
-      dialog_browsesymbol = 'Browse Symbol';
-      label_entersymboltobrowse = 'Enter S~y~mbol to browse';
-
-      dialog_gdbwindow = 'GDB window';
-
-      dialog_clipboard = 'Clipboard';
-
-      dialog_userscreen = 'User screen';
-
-      dialog_messages = 'Messages';
-
-      dialog_memorysizes = 'Memory sizes';
-
-      dialog_directories = 'Directories';
-
-      dialog_programparameters = 'Program parameters';
-      label_parameters_parameter = '~P~arameter';
-
-      dialog_openoptions = 'Open Options';
-      msg_cantopenconfigfile = 'Can''t open config file.';
-      msg_errorsavingconfigfile = 'Error saving config file.';
-
-      dialog_saveoptions = 'Save Options';
-
-      dialog_preferences = 'Preferences';
-      label_preferences_videomode = 'Video mode';
-      label_preferences_currentdirectory = 'C~u~rrent directory';
-      label_preferences_configdirectory = 'Conf~i~g file directory';
-      label_preferences_desktopfile = 'Desktop file';
-      label_preferences_editorfiles = 'Editor ~f~iles';
-      label_preferences_environment = '~E~nvironment';
-      label_preferences_desktop = '~D~esktop';
-      label_preferences_autosave = 'Auto save';
-      label_preferences_autotracksource = '~A~uto track source';
-      label_preferences_closeongotosource = 'C~l~ose on go to source';
-      label_preferences_changedironopen = 'C~h~ange dir on open';
-      label_preferences_options = 'Options';
-
-      dialog_defaulteditoroptions = 'Default Editor Options';
-      dialog_editoroptions = 'Editor Options';
-      label_editor_backupfiles = 'Create backup ~f~iles';
-      label_editor_insertmode = '~I~nsert mode';
-      label_editor_autoindentmode = '~A~uto indent mode';
-      label_editor_usetabcharacters = '~U~se tab characters';
-      label_editor_backspaceunindents = '~B~ackspace unindents';
-      label_editor_persistentblocks = '~P~ersistent blocks';
-      label_editor_syntaxhighlight = '~S~yntax highlight';
-      label_editor_blockinsertcursor = 'B~l~ock insert cursor';
-      label_editor_verticalblocks = '~V~ertical blocks';
-      label_editor_highlightcolumn = 'Highlight ~c~olumn';
-      label_editor_highlightrow = 'Highlight ~r~ow';
-      label_editor_autoclosingbrackets = 'Aut~o~-closing brackets';
-      label_editor_keeptrailingspaces = '~K~eep trailing spaces';
-      label_editor_codecomplete = 'Co~d~eComplete enabled';
-      label_editor_folds = 'E~n~able folds';
-      label_editor_editoroptions = '~E~ditor options';
-      label_editor_tabsize = '~T~ab size';
-      label_editor_highlightextensions = '~H~ighlight extensions';
-      label_editor_filepatternsneedingtabs = 'File ~p~atterns needing tabs';
-
-      dialog_browseroptions = 'Browser Options';
-      dialog_localbrowseroptions = 'Local Browser Options';
-      label_browser_labels = '~L~abels';
-      label_browser_constants = '~C~onstants';
-      label_browser_types = '~T~ypes';
-      label_browser_variables = '~V~ariables';
-      label_browser_procedures = '~P~rocedures';
-      label_browser_inherited = '~I~nherited';
-      label_browser_symbols = 'Symbols';
-      label_browser_newbrowser = '~N~ew browser';
-      label_browser_currentbrowser = '~R~eplace current';
-      label_browser_subbrowsing = 'Sub-browsing';
-      label_browser_scope = '~S~cope';
-      label_browser_reference = 'R~e~ference';
-      label_browser_preferredpane = 'Preferred pane';
-      label_browser_qualifiedsymbols = '~Q~ualified symbols';
-      label_browser_sortsymbols = 'S~o~rt always';
-      label_browser_display = 'Display';
-
-      dialog_desktoppreferences = 'Desktop Preferences';
-      label_desktop_historylists = '~H~istory lists';
-      label_desktop_clipboard = '~C~lipboard content';
-      label_desktop_watches = '~W~atch expressions';
-      label_desktop_breakpoints = '~B~reakpoints';
-      label_desktop_openwindow = '~O~pen windows';
-      label_desktop_symbolinfo = '~S~ymbol information';
-      label_desktop_codecompletewords = 'Co~d~eComplete wordlist';
-      label_desktop_codetemplates = 'Code~T~emplates';
-      label_desktop_preservedacrosssessions = '~P~reserved across sessions';
-
-      dialog_mouseoptions = 'Mouse Options';
-      label_mouse_speedbar = 'Fast       Medium      Slow';
-      label_mouse_doubleclickspeed = '~M~ouse double click';
-      label_mouse_reversebuttons = '~R~everse mouse buttons';
-      label_mouse_crtlrightmousebuttonaction = 'Ctrl+Right mouse button';
-      label_mouse_altrightmousebuttonaction = 'Alt+Right mouse button';
-      label_mouse_act_nothing = '~N~othing';
-      label_mouse_act_topicsearch = '~T~opic search';
-      label_mouse_act_gotocursor = '~G~o to cursor';
-      label_mouse_act_breakpoint = '~B~reakpoint';
-      label_mouse_act_evaluate = '~E~valuate';
-      label_mouse_act_addwatch = '~A~dd watch';
-      label_mouse_act_browsesymbol = 'Browse ~s~ymbol';
-
-      label_colors_grp_browser = 'Browser';
-      label_colors_framepassive = 'Frame passive';
-      label_colors_frameactive = 'Frame active';
-      label_colors_frameicon = 'Frame icon';
-      label_colors_scrollbarpage = 'Scroll bar page';
-      label_colors_scrollbaricons = 'Scroll bar icons';
-      label_colors_normaltext = 'Normal text';
-      label_colors_selectedtext = 'Selected text';
-      label_colors_activeitem = 'Active item';
-      label_colors_inactiveitem = 'Inactive item';
-      label_colors_focuseditem = 'Focused item';
-      label_colors_selecteditem = 'Selected item';
-      label_colors_divider = 'Divider';
-      label_colors_grp_clock = 'Clock';
-      label_colors_clockview = 'clock view';
-      label_colors_grp_desktop = 'Desktop';
-      label_colors_grp_dialogs = 'Dialogs';
-      label_colors_grp_editor = 'Editor';
-      label_colors_highlighcolumn = 'Highlight column';
-      label_colors_highlightrow = 'Highlight row';
-      label_colors_errormessages = 'Error messages';
-      label_colors_grp_help = 'Help';
-      label_colors_helptext = 'Help text';
-      label_colors_helplinks = 'Help links';
-      label_colors_selectedlink = 'Selected link';
-      label_colors_grp_menus = 'Menus';
-      label_colors_grp_syntax = 'Syntax';
-      label_colors_whitespace = 'Whitespace';
-      label_colors_comments = 'Comments';
-      label_colors_reservedwords = 'Reserved words';
-      label_colors_identifiers = 'Identifiers';
-      label_colors_strings = 'Strings';
-      label_colors_numbers = 'Numbers';
-      label_colors_hexnumbers = 'Hex numbers';
-      label_colors_assembler = 'Assembler';
-      label_colors_symbols = 'Symbols';
-      label_colors_directives = 'Directives';
-      label_colors_tabs = 'Tabs';
-      label_colors_html_heading1 = 'HTML Heading 1';
-      label_colors_html_heading2 = 'HTML Heading 2';
-      label_colors_html_heading3 = 'HTML Heading 3';
-      label_colors_html_heading4 = 'HTML Heading 4';
-      label_colors_html_heading5 = 'HTML Heading 5';
-      label_colors_html_heading6 = 'HTML Heading 6';
-
-      dialog_linker = 'Linker';
-      label_linker_preferredlibtype = 'Preferred library type';
-
-      dialog_debugger = 'Browsing/Debugging/Profiling';
-      label_debugger_debuginfo = 'Debugging information';
-      label_debugger_profileswitches = 'Profiling Switches';
-      label_debugger_compilerargs = '~A~dditional compiler args';
-      label_debugger_useanotherconsole = '~U~se another console';
-      label_debugger_redirection = 'Debuggee ~R~edirection';
-      label_debugger_useanothertty = '~U~se Another tty for Debuggee';
-
-      dialog_helpfiles = 'Install Help Files';
-      label_helpfiles_helpfiles = '~H~elp files';
-
-      dialog_installhelpfile = 'Install a help file';
-      label_installhelpfile_filename = '~H~elp file name';
-
-      msg_createkeywordindexforhelpfile = 'Create keyword index from help file?';
-
-      dialog_topictitle = 'Topic title';
-      label_topictitle_title = 'Title';
-
-      msg_pleasewaitwhilecreatingindex = 'Please wait while creating index...';
-      msg_buildingindexfile = 'Building index file %s';
-      msg_filedoesnotcontainanylinks = '%s doesn''t contain any links, thus it isn''t suitable for indexing.';
-      msg_filealreadyexistsoverwrite = 'File %s already exists. Overwrite?';
-      msg_storinghtmlindexinfile = 'Storing HTML index in %s';
-      msg_errorstoringindexdata = 'Error storing index data (%d)';
-
-      dialog_switchesmode = 'SwitchesMode';
-      static_switchesmode_switchesmode = 'Switches Mode';
-
-      dialog_compilerswitches = 'Compiler Switches';
-      label_compiler_syntaxswitches = 'Syntax Switches';
-      label_compiler_runtimechecks = 'Run-time checks';
-      label_compiler_optimizations = 'Optimizations';
-      label_compiler_targetprocessor = 'Target processor';
-      label_compiler_linkafter = 'Linking stage';
-      label_compiler_verboseswitches = 'Verbose Switches';
-      label_compiler_browser = 'Browser';
-      label_compiler_assemblerreader = 'Assembler reader';
-      label_compiler_assemblerinfo = 'Assembler info';
-      label_compiler_assembleroutput = 'Assembler output';
-      page_compiler_syntax = 'S~y~ntax';
-      page_compiler_codegeneration = 'Code ~g~eneration';
-      page_compiler_verbose = '~V~erbose';
-      page_compiler_browser = '~B~rowser';
-      page_compiler_assembler = '~A~ssembler';
-
-      dialog_target = 'Target';
-      label_target_platform = 'Target platform';
-
-      label_primaryfile_primaryfile = 'Primary file';
-
-      { About window }
-      dialog_about = 'About';
-      label_about_compilerversion = 'Compiler Version';
-      label_about_debugger = 'Debugger';
-
-      { Program info window }
-      dialog_programinformation = 'Program Information';
-      label_proginfo_currentmodule = 'Current module';
-      label_proginfo_lastexitcode = 'Last exit code';
-      label_proginfo_availablememory = 'Available memory';
-
-      { Tools }
-      dialog_tools = 'Tools';
-      label_tools_programtitles = '~P~rogram titles';
-      dialog_modifynewtool = 'Modify/New Tool';
-      label_toolprop_title = '~T~itle';
-      label_toolprop_programpath = 'Program ~p~ath';
-      label_toolprop_commandline = 'Command ~l~ine';
-      msg_errorparsingparametersatpos = ^C'Error parsing parameters line at line position %d.';
-      msg_cantinstallmoretools = ^C'Can''t install more tools...';
-      msg_requiredparametermissingin = 'Required parameter missing in [%s]';
-      msg_requiredpropertymissingin = 'Required property missing in [%s]';
-      msg_unknowntypein = 'Unknown type in [%s]';
-      msg_propertymissingin = '%s property missing in [%s]';
-      msg_invaliditemsin = 'Invalid number of items in [%s]';
-      msg_errorparsingtoolparams = ^C'Error parsing tool params.';
-      msg_executingtool = 'Executing tool %s ...';
-      msg_errorreadingoutput = 'Error reading output.';
-      msg_executingfilterfor = 'Executing filter for %s ...';
-      msg_cantfindfilteredoutput = 'Can''t find filtered output.';
-      msg_errorprocessingfilteredoutput = 'Error processing filtered output.';
-      msg_errorexecutingfilter = 'Error executing filter %s';
-      msg_errorexecutingtool = 'Error executing tool %s';
-      msg_errorexecutingshell = 'Error cannot run shell';
-      msg_filterexecutionsuccessfulexitcodeis = 'Filter execution successful. Exit code = %d';
-      msg_toolexecutionsuccessfulexitcodeis = 'Tool execution successful. Exit code = %d';
-
-      dialog_greparguments = 'Grep arguments';
-      msg_grepprogramnotfound = 'Grep program not found';
-      label_grep_texttofind = '~T~ext to find';
-      label_grep_greparguments = '~G~rep arguments';
-      msg_runninggrepwithargs = 'Running Grep -n %s';
-      msg_errorrunninggrep = #3'Error running Grep'#13#3'DosError = %d'#13#3'Exit code = %d';
-      msg_errorreadinggrepoutput = #3'Error reading Grep output'#13#3'In line %d of %s';
-
-      dialog_windowlist = 'Window List';
-      label_wndlist_windows = '~W~indows';
-
-      msg_windowlist_hidden = 'hidden';
-
-      msg_userscreennotavailable = 'Sorry, user screen not available.';
-
-      { Tools $PROMPT() dialog }
-      dialog_programarguments = 'Program Arguments';
-      label_enterprogramargument = '~E~nter program argument';
-
-      { Debugger confirmations and messages }
-      msg_nodebuginfoavailable = 'No debug info available.';
-      msg_nodebuggersupportavailable = 'No debugger support available.';
-      msg_cantdebugchangetargetto = #3'Sorry, can not debug'#13+
-                                    #3'programs compiled for %s.'#13+
-                                    #3'Change target to %s?';
-      msg_compiledwithoutdebuginforecompile =
-                                 #3'Warning, the program'#13+
-                                 #3'was compiled without'#13+
-                                 #3'debugging info.'#13+
-                                 #3'Recompile it?';
-      msg_nothingtodebug = 'Oooops, nothing to debug.';
-      msg_startingdebugger = 'Starting debugger';
-
-      msg_doyouwanttocreatelocalconfigfile =
-        'The Free Pascal IDE was never started in this directory before. '+
-         'Do you want to create a new config file in this directory? '{#13+
-         '(If you answer with "No", the IDE will use '+
-         'the config file located in "%s")'};
-      msg_configcopyexistingorcreatenew =
-        'Do you want to copy the existing configuration or '+
-        'create a new one from scratch?';
-      btn_config_copyexisting = 'Copy ~e~xisting';
-      btn_config_createnew = ' Create ~n~ew  ';
-
-      { Desktop file messages }
-      msg_readingdesktopfile = 'Reading desktop file...';
-      msg_writingdesktopfile = 'Writing desktop file...';
-      msg_readingdesktopcontents = 'Reading desktop contents...';
-      msg_storingdesktopcontents = 'Storing desktop contents...';
-      msg_readinghistory = 'Reading history...';
-      msg_storinghistory = 'Storing history...';
-      msg_readingwatches = 'Reading watches...';
-      msg_storingwatches = 'Storing watches...';
-      msg_readingbreakpoints = 'Reading breakpoints...';
-      msg_storingbreakpoints = 'Storing breakpoints...';
-      msg_readingcodecompletewordlist = 'Reading CodeComplete wordlist...';
-      msg_storingcodecompletewordlist = 'Writing CodeComplete wordlist...';
-      msg_readingcodetemplates = 'Reading CodeTemplates...';
-      msg_storingcodetemplates = 'Writing CodeTemplates...';
-      msg_readingsymbolinformation = 'Reading symbol information...';
-      msg_storingsymbolinformation = 'Storing symbol information...';
-      msg_failedtoreplacedesktopfile = 'Failed to replace desktop file.';
-      msg_errorloadinghistory = 'Error loading history';
-      msg_errorstoringhistory = 'Error storing history';
-      msg_errorloadingwatches = 'Error loading watches';
-      msg_errorstoringwatches = 'Error storing watches';
-      msg_errorloadingbreakpoints = 'Error loading breakpoints';
-      msg_errorstoringbreakpoints = 'Error storing breakpoints';
-      msg_errorloadingdesktop = 'Error loading desktop';
-      msg_errorstoringdesktop = 'Error storing desktop';
-      msg_errorreadingflags = 'Error loading flags';
-      msg_errorwritingflags = 'Error writing flags';
-      msg_errorreadingvideomode = 'Error reading video mode';
-      msg_errorstoringvideomode = 'Error storing video mode';
-      msg_errorloadingcodetemplates = 'Error loading CodeTemplates';
-      msg_errorstoringcodetemplates = 'Error writing CodeTemplates';
-      msg_errorloadingsymbolinformation = 'Error loading symbol information';
-      msg_errorstoringsymbolinformation = 'Error storing symbol information';
-      msg_errorloadingcodecompletewordlist = 'Error loading CodeComplete wordlist';
-      msg_errorstoringcodecompletewordlist = 'Error writing CodeComplete wordlist';
-      msg_invaliddesktopversionlayoutlost = 'Invalid desktop version. Desktop layout lost.';
-
-      msg_cantopenfile = 'Can''t open %s';
-      msg_cantcreatefile = 'Can''t create %s';
-      msg_cantfindfile = 'Can''t find %s';
-      msg_errorreadingfile = 'Error reading file %s';
-      msg_loadingfile = 'Loading %s';
-      msg_storingfile = 'Storing %s';
-      msg_closingfile = 'Closing %s';
-      msg_invalidfilename = 'Invalid filename %s';
-
-      msg_openingsourcefile = 'Opening source file... (%s)';
-      msg_readingfileineditor = 'Reading %s into editor...';
-
-      label_sym_objects = 'Objects';
-      label_sym_globalscope = 'Global scope';
-      label_sym_globals = 'Globals';
-
-      { Symbol browser meminfo page }
-      msg_sizeinmemory = 'Size in memory';
-      msg_sizeonstack = 'Size on stack';
-
-      msg_usedfirstin = 'Used first in';
-      msg_mainsource = 'Main source';
-      msg_sourcefiles = 'Source files';
-
-      { Help messages }
-      msg_indexingfile = 'Indexing file %s';
-      msg_loadinghelpfiles = 'Loading help files...';
-      msg_loadinghelpfile = 'Loading help file...';
-      msg_buildinghelpindex = 'Building Help Index...';
-      msg_locatingtopic = 'Locating topic...';
-      msg_failedtoloadhelpfile = 'Failed to load help file %s';
-
-      { Browser messages }
-      msg_symbolnotfound = #3'Symbol %s not found';
-      msg_nobrowserinfoavailable = 'No Browser info available';
-      msg_toomanysymbolscantdisplayall= 'Too many symbols. Can''t display all of them.';
-
-      { Status hints during compilation }
-      msg_hint_pressesctocancel = 'Press ESC to cancel';
-      msg_hint_compilesuccessfulpressenter = 'Compile successful: ~Press Enter~';
-      msg_hint_compilefailed = 'Compile failed';
-      msg_hint_compileaborted = 'Compile aborted';
-      msg_hint_pleasewait = 'Please wait...';
-
-      { Compile status dialog texts }
-      msg_compilingfile      = 'Compiling %s';
-      msg_linkingfile        = 'Linking %s';
-      msg_compiledone        = 'Done.';
-      msg_failedtocompile    = 'Failed to compile...';
-      msg_compilationaborted = 'Compilation aborted...';
-
-      msg_nothingtocompile = 'Oooops, nothing to compile.';
-      msg_cantcompileunsavedfile = 'Can''t compile unsaved file.';
-
-      msg_couldnotcreatefile = 'could not create %s';
-      msg_therearemoreerrorsinfile = 'There are more errors in file %s';
-      msg_firstcompilationof = 'First compilation of %s';
-      msg_recompilingbecauseof = 'Recompiling because of %s';
-
-      msg_errorinexternalcompilation = 'Error in external compilation';
-      msg_iostatusis = 'IOStatus = %d';
-      msg_executeresultis = 'ExecuteResult = %d';
-
-      msg_nothingtorun = 'Oooops, nothing to run.';
-
-      msg_impossibletoreachcursor = 'Impossible to reach current cursor';
-      msg_impossibletosetbreakpoint = 'Impossible to set breakpoints here';
-
-      msg_programnotrundoserroris = #3'Program %s'#13#3'not run'#13#3'DosError = %d';
-      msg_programfileexitedwithexitcode = #3'Program %s'#13#3'exited with '#13#3'exitcode = %d';
-
-      msg_automaticallycreateddontedit = 'Automaticly created file, don''t edit.';
-
-      { Compiler options }
-      opt_delphi2extensions = '~D~elphi 2 extensions on';
-      opt_clikeoperators = '~C~-like operators';
-      opt_stopafterfirsterror = 'S~t~op after first error';
-      opt_allowlabelandgoto = 'Allo~w~ LABEL and GOTO';
-      opt_cplusplusstyledinline = 'C++ styled ~i~nline';
-      opt_globalcmacros = 'Global C ~m~acros';
-      opt_tp7compatibility = 'TP/BP ~7~.0 compatibility';
-      opt_delphicompatibility = 'Del~p~hi compatibility';
-      opt_allowstaticinobjects = 'A~l~low STATIC in objects';
-      opt_strictvarstrings = 'Strict ~v~ar-strings';
-      opt_extendedsyntax = 'E~x~tended syntax';
-      opt_allowmmxoperations = 'Allow MMX op~e~rations';
-      { Verbose options }
-      opt_warnings = '~W~arnings';
-      opt_notes = 'N~o~tes';
-      opt_hints = '~H~ints';
-      opt_generalinfo = 'General ~I~nfo';
-      opt_usedtriedinfo = '~U~sed,tried info';
-      opt_all = '~A~ll';
-      opt_showallprocsonerror = 'Show all ~P~rocedures if error';
-      { Checking options }
-      opt_rangechecking = '~R~ange checking';
-      opt_stackchecking = '~S~tack checking';
-      opt_iochecking = '~I~/O checking';
-      opt_overflowchecking = 'Integer ~o~verflow checking';
-      { Code options }
-      opt_generatefastercode = 'Generate ~f~aster code';
-      opt_generatesmallercode = 'Generate s~m~aller code';
-      opt_useregistervariables = 'Use regis~t~er-variables';
-      opt_uncertainoptimizations = '~U~ncertain optimizations';
-      opt_level1optimizations = 'Level ~1~ optimizations';
-      opt_level2optimizations = 'Level ~2~ optimizations';
-      opt_i386486 = 'i~3~86/i486';
-      opt_pentiumandmmx = 'Pentium/PentiumMM~X~ (tm)';
-      opt_pentiumpro = 'P~P~ro/PII/c6x86/K6 (tm)';
-      { Assembler options }
-      opt_directassembler = '~D~irect assembler';
-      opt_attassembler = '~A~T&T style assembler';
-      opt_intelassembler = '~I~ntel style assembler';
-      opt_listsource = '~L~ist source';
-      opt_listregisterallocation = 'list ~r~egister allocation';
-      opt_listtempallocation = 'list ~t~emp allocation';
-      opt_usedefaultas = 'Use ~d~efault output';
-      opt_usegnuas = 'Use ~G~NU as';
-      opt_usenasmcoff = 'Use ~N~ASM coff';
-      opt_usenasmelf = 'Use NASM ~e~lf';
-      opt_usenasmobj = 'Use NASM ~o~bj';
-      opt_usemasm = 'Use ~M~ASM';
-      opt_usetasm = 'Use ~T~ASM';
-      opt_usecoff = 'Use ~c~off';
-      opt_usepecoff = 'Use ~p~ecoff';
-      { Browser options }
-      opt_nobrowser = 'N~o~ browser';
-      opt_globalonlybrowser = 'Only Glob~a~l browser';
-      opt_localglobalbrowser = '~L~ocal and global browser';
-      { Conditional defines }
-      opt_conditionaldefines = 'Conditio~n~al defines';
-      { Memory sizes }
-      opt_stacksize = '~S~tack size';
-      opt_heapsize = '~H~eap size';
-      { Directory options }
-      opt_unitdirectories = '~U~nit directories';
-      opt_includedirectories = '~I~nclude directories';
-      opt_librarydirectories = '~L~ibrary directories';
-      opt_objectdirectories = '~O~bject directories';
-      opt_exeppudirectories = '~E~XE & PPU directories';
-      { Library options }
-      opt_librariesdefault = '~T~arget default';
-      opt_dynamiclibraries = '~D~ynamic libraries';
-      opt_staticlibraries = '~S~tatic libraries';
-      opt_smartlibraries = 'S~m~art libraries';
-      { Symbol info options }
-      opt_stripalldebugsymbols = '~S~trip all debug symbols from executable';
-      opt_gendebugsymbolinfo = 'Generate ~d~ebug symbol information';
-      opt_gensymbolandbacktraceinfo = 'Generate also backtrace ~l~ine information';
-      { Link after options }
-      opt_linkafter = 'Call ~l~inker after';
-      { Profiling options }
-      opt_noprofileinfo = '~N~o profile information';
-      opt_gprofinfo = 'Generate profile code for g~p~rof';
-
-      msg_xmustbesettoyforz_doyouwanttochangethis =
-        '%s must be set to "%s" for %s. '+
-        'Do you want to change this option automatically?';
-
-      { Debugger messages and status hints }
-      msg_programexitedwithcodeandsteps = #3'Program exited with '#13+
-                                          #3'exitcode = %d'#13+
-                                          #3'hidden steps = %d';
-
-      msg_programexitedwithexitcode = #3'Program exited with '#13+
-                                      #3'exitcode = %d';
-
-      msg_runningprogram = 'Running...';
-      msg_runninginanotherwindow = 'Executable running in another window..';
-      msg_couldnotsetbreakpointat = #3'Could not set Breakpoint'#13+
-                                    #3+'%s:%d';
-      msg_couldnotsetbreakpointtype = #3'Could not set Breakpoint'#13+
-                                      #3+'%s %s';
-
-      { standard button texts }
-      button_OK          = 'O~K~';
-      button_Cancel      = 'Cancel';
-      button_New         = '~N~ew';
-      button_Edit        = '~E~dit';
-      button_Delete      = '~D~elete';
-      button_Close       = '~C~lose';
-      button_Show        = '~S~how';
-      button_Hide        = '~H~ide';
-
-      { Compiler message classes }
-      msg_class_normal   = '';
-      msg_class_fatal    = 'Fatal';
-      msg_class_error    = 'Error';
-      msg_class_warning  = 'Warning';
-      msg_class_note     = 'Note';
-      msg_class_hint     = 'Hint';
-      msg_class_macro    = 'Macro';
-      msg_class_procedure= 'Procedure';
-      msg_class_conditional = 'Conditional';
-      msg_class_info     = 'Info';
-      msg_class_status   = 'Status';
-      msg_class_used     = 'Used';
-      msg_class_tried    = 'Tried';
-      msg_class_debug    = 'Debug';
-
-      { status line entries }
-      status_help            = '~F1~ Help';
-      status_help_on_help    = '~F1~ Help on help';
-      status_help_previoustopic = '~Alt+F1~ Previous topic';
-      status_help_index      = '~Shift+F1~ Help index';
-      status_help_close      = '~Esc~ Close help';
-      status_save            = '~F2~ Save';
-      status_open            = '~F3~ Open';
-      status_compile         = '~Alt+F9~ Compile';
-      status_make            = '~F9~ Make';
-      status_localmenu       = '~Alt+F10~ Local menu';
-      status_transferchar    = '~Ctrl+Enter~ Transfer char';
-      status_msggotosource   = '~'+EnterSign+'~ Goto source';
-      status_msgtracksource  = '~Space~ Track source';
-      status_close           = '~Esc~ Close';
-      status_calculatorpaste = '~Ctrl+Enter~ Transfer result';
-
-      { Menu hints }
-      hint_systemmenu        = 'System menu';
-      hint_update            = 'Refresh and redraw display';
-      hint_about             = 'Show version and copyright information';
-      hint_filemenu          = 'File managment commands (Open, New, Save, etc.)';
-      hint_filenew           = 'Create a new file in a new edit window';
-      hint_filenewfromtemplate='Create a new file using a code template';
-      hint_fileopen          = 'Locate and open a file in an edit window';
-      hint_filesave          = 'Save the file in the active edit window';
-      hint_filesaveas        = 'Save the current file under a different name, directory or drive';
-      hint_filesaveall       = 'Save all modified files';
-      hint_changedir         = 'Choose a new default directory';
-      hint_dosshell          = 'Temporarily exit to DOS';
-      hint_exit              = 'Exit the IDE';
-      hint_openrecentfile    = 'Open indicated file in a new editor window';
-      hint_editmenu          = 'Clipboard editing commands';
-      hint_editundo          = 'Undo the previous editor operation';
-      hint_editredo          = 'Redo the previously undone editor operation';
-      hint_editcut           = 'Remove the selected text and put it in the clipboard';
-      hint_editcopy          = 'Copy the selected text in the clipboard';
-      hint_editpaste         = 'Insert selected text from the clipboard at the cursor position';
-      hint_editcopywin       = 'Copy the selected text in windows clipboard';
-      hint_editpastewin      = 'Insert selected text from windows clipboard at the cursor position';
-      hint_editclear         = 'Delete the selected text';
-      hint_showclipboard     = 'Open then clipboard window';
-      hint_searchmenu        = 'Text and symbols search commands';
-      hint_searchfind        = 'Search for text';
-      hint_searchreplace     = 'Search for text and replace it with new text';
-      hint_searchagain       = 'Repeat the last Search or Replace command';
-      hint_gotoline          = 'Move the cursor to a specified line number';
-      hint_objects           = 'Open a browser displaying all objects in the program';
-      hint_modules           = 'Open a browser displaying all modules of the program';
-      hint_globals           = 'Open a browser displaying all global symbols in the program';
-      hint_symbol            = 'Open a browser a current word (not yet scope sensitive)';
-      hint_runmenu           = 'Execution and parameters';
-      hint_run               = 'Run the current program';
-      hint_runparameters     = 'Set command-line parameters passed to program at execution';
-      hint_resetprogram      = 'Reset Program';
-      hint_rununtilcursor    = 'Go on until Cursor position';
-      hint_rununtilreturn    = 'Go on until end of current function';
-      hint_userscreen        = 'Switch to the full-screen user output';
-      hint_compilemenu       = 'Compile, build & make';
-      hint_compile           = 'Compile the current source file';
-      hint_make              = 'Rebuild source file and all other files that have been modified';
-      hint_build             = 'Rebuild program and all available source files';
-      hint_target            = 'Select target platform to compile for';
-      hint_primaryfile       = 'Define then file that is the focus of Make and Build';
-      hint_clearprimaryfile  = 'Clear the file previously set to Primary';
-      hint_information       = 'Show compiler messages and program information';
-      hint_showmessages      = 'Show compiler messages window';
-      hint_debugmenu         = 'Debug Program';
-      hint_togglebreakpoint  = 'Toggles Breakpoint';
-      hint_createnewbreakpoint = 'Create a new breakpoint';
-      hint_editbreakpoint    = 'Edit focused breakpoint';
-      hint_deletebreakpoint  = 'Delete focused breakpoint';
-      hint_opengdbwindow     = 'Open direct window to GDB';
-      hint_addwatch          = 'Add a new expression to watch';
-      hint_watches           = 'Open the Watches Window';
-      hint_callstack         = 'Show call stack';
-      hint_editbreakpoints   = 'Edit breakpoints';
-      hint_toolsmenu         = 'User installed tools';
-      hint_calculator        = 'Show calculator';
-      hint_grep              = 'Run grep';
-      hint_gotosource        = 'Edit source';
-      hint_registers         = 'Open the Registers Window';
-      hint_messageswindow    = 'Open the message window';
-      hint_usertool          = 'User installed tool';
-      hint_asciitable        = 'Show ASCII table';
-      hint_optionsmenu       = 'Setting for compiler, editor, mouse, etc.';
-      hint_switchesmode      = 'Select settings for normal, debug or release version';
-      hint_compiler          = 'Set default compiler directives and conditional defines';
-      hint_memorysizes       = 'Set default stack and heap sizes for generated programs';
-      hint_linkeroptions     = 'Set linker options';
-      hint_debugoptions      = 'Set debug information options';
-      hint_directories       = 'Set paths for units, include, object and generated files';
-      hint_browser           = 'Specify global browser settings';
-      hint_tools             = 'Create or change tools';
-      hint_environmentmenu   = 'Specify environment settins';
-      hint_preferences       = 'Specify desktop settings';
-      hint_editoroptions     = 'Specify default editor settings';
-      hint_codecomplete      = 'Specify CodeComplete keywords';
-      hint_codetemplates     = 'Specify CodeTemplates';
-      hint_mouseoptions      = 'Specify mouse settings';
-      hint_desktopoptions    = 'Specify desktop settings';
-      hint_startup           = 'Permanently change default startup options';
-      hint_colors            = 'Customize IDE colors for windows, menus, editors, etc.';
-      hint_openini           = 'Load a previously saved options file';
-      hint_saveini           = 'Save all the changes made in the options menu';
-      hint_saveasini         = 'Save all the changes made under a different name';
-      hint_windowmenu        = 'Windows managment commands';
-      hint_tile              = 'Arrange windows on desktop by tiling';
-      hint_cascade           = 'Arrange windows on desktop by cascading';
-      hint_closeall          = 'Close all windows on the desktop';
-      hint_resize            = 'Change the size/postion of the active window';
-      hint_zoom              = 'Enlarge or restore the size of the active window';
-      hint_next              = 'Make the next window active';
-      hint_prev              = 'Make the previous window active';
-      hint_closewindow       = 'Close the active window';
-      hint_windowlist        = 'Show a list of all open windows';
-      hint_userscreenwindow  = 'Show contents of user screen in a window';
-      hint_helpmenu          = 'Get online help';
-      hint_helpcontents      = 'Show table of contents for Online Help';
-      hint_helpindex         = 'Show index for Online Help';
-      hint_helptopicsearch   = 'Display help on the word at cursor';
-      hint_helpprevtopic     = 'Redisplay the last-viewed Online Help screen';
-      hint_helphowtouse      = 'How to use Online Help';
-      hint_helpfiles         = 'Install or remove installed help files';
-      hint_openatcursor      = 'Attempt to open the file indicated by the word at cursor';
-      hint_browseatcursor    = 'Attempt to browse the symbol at cursor';
-      hint_editoroptionscur  = 'Specify editor settings';
-      hint_rawgdbwindow      = 'Raw GDB communication window';
-      hint_allbreakpoints    = 'All current breakpoints';
-
-      { error messages }
-      error_saving_cfg_file  = 'Error saving configuration.';
-      error_saving_dsk_file  = 'Error saving desktop file.'#13+
-                               'Desktop layout could not be stored.';
-      error_user_screen_not_avail = 'Sorry, user screen not available.';
-
-{
-  $Log$
-  Revision 1.4  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.7  2000/11/14 17:40:43  pierre
-   + External linking now optional
-
-  Revision 1.3  2000/10/06 22:58:59  pierre
-   * fixes for linux GDB tty command (merged)
-
-  Revision 1.1.2.6  2000/10/06 22:52:36  pierre
-   * fixes for linux GDB tty command
-
-  Revision 1.2  2000/08/22 09:41:40  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.3  2000/08/16 18:46:14  peter
-   [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
-   [*] Make, Build now possible even in Compiler Messages Window
-   [+] when started in a new dir the IDE now ask whether to create a local
-       config, or to use the one located in the IDE dir
-
-  Revision 1.1.2.2  2000/08/04 14:05:18  michael
-  * Fixes from Gabor:
-   [*] the IDE now doesn't disable Compile|Make & Build when all windows
-       are closed, but there's still a primary file set
-       (set bug 1059 to fixed!)
-
-   [*] the IDE didn't read some compiler options correctly back from the
-       FP.CFG file, for ex. the linker options. Now it read everything
-       correctly, and also automatically handles smartlinking option synch-
-       ronization.
-       (set bug 1048 to fixed!)
-
-  Revision 1.1.2.1  2000/07/15 21:16:23  pierre
-   + some new texts
-
-  Revision 1.1  2000/07/13 09:48:35  michael
-  + Initial import
-
-  Revision 1.4  2000/06/16 08:50:41  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.3  2000/05/30 07:18:33  pierre
-   + colors for HTML help by Gabor
-
-  Revision 1.2  2000/05/29 10:44:57  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.1  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-
-}

+ 0 - 1047
ide/text/fpstrh.inc

@@ -1,1047 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by Florian Klaempfl & Berczi Gabor
-
-    Strings for menus, dialogs etc
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-
-const
-      menu_local_gotosource = '~G~oto source';
-      menu_local_tracksource = '~T~rack source';
-      menu_local_options = '~O~ptions...';
-      menu_local_clear = '~C~lear';
-
-      menu_common_copy = '~M~ sol s';
-      menu_common_contents = '~T~artalom';
-      menu_common_index = '~I~ndex';
-      menu_common_topicsearch = 'T‚ma ~k~eres‚se';
-      menu_common_prevtopic = '~E~l‹z‹ t‚ma';
-
-      menu_key_common_helpindex = 'Shift+F1';
-      menu_key_common_topicsearch = 'Ctrl+F1';
-      menu_key_common_prevtopic = 'Alt+F1';
-      menu_key_common_copy = 'Ctrl+Ins';
-
-      { Symbol browser tabs }
-      label_browsertab_scope = 'S';
-      label_browsertab_reference = 'R';
-      label_browsertab_inheritance = 'I';
-      label_browsertab_memory = 'M';
-      label_browsertab_unit = 'U';
-
-{$ifdef USERESSTRINGS}
-    resourcestring
-{$else}
-    const
-{$endif}
-      { menu entries }
-      menu_file              = '~F~ jl';
-      menu_file_new          = 'é~j~';
-      menu_file_template     = 'éj min~t~a alapj n...';
-      menu_file_open         = 'Meg~n~yit s...';
-      menu_file_save         = '~M~ent‚s';
-      menu_file_saveas       = 'Ment‚~s~ m sk‚nt...';
-      menu_file_saveall      = 'Mindent e~l~ment';
-      menu_file_changedir    = 'K”nyvt r~v~ lt s...';
-      menu_file_dosshell     = '~D~OS parancssor';
-      menu_file_exit         = '~K~il‚p‚s';
-
-      menu_edit              = 'S~z~erk.';
-      menu_edit_copywin      = 'M ~s~ol s Windows-b¢l';
-      menu_edit_pastewin     = 'B~e~illeszt‚s ~W~indows-ba';
-      menu_edit_undo         = '~V~isszavon s';
-      menu_edit_redo         = 'M‚~g~is';
-      menu_edit_cut          = '~K~iv g s';
-      menu_edit_copy         = menu_common_copy;
-      menu_edit_paste        = '~B~eilleszt‚s';
-      menu_edit_clear        = '~T~”rl‚se';
-      menu_edit_showclipboard= 'V g¢l~a~p megjelen¡t‚se';
-
-      menu_search            = '~K~eres‚s';
-      menu_search_find       = '~K~eres‚s...';
-      menu_search_replace    = 'C~s~ere...';
-      menu_search_searchagain= '~I~sm‚telt keres‚s';
-      menu_search_jumpline   = 'U~g~r s sorra...';
-      menu_search_findproc   = '~E~lj r s keres‚se...';
-      menu_search_objects    = '~O~bjektumok';
-      menu_search_modules    = 'Mod~u~lok';
-      menu_search_globals    = 'G~l~ob lis azonos¡t¢k';
-      menu_search_symbol     = 'S~z~imb¢lum...';
-
-      menu_run               = 'F~u~t s';
-      menu_run_run           = '~F~uttat s';
-      menu_run_stepover      = 'µ~t~l‚p‚s';
-      menu_run_traceinto     = '~L~‚p‚senk‚nti futtat s';
-      menu_run_conttocursor  = 'Futtat s a ~k~urzorig';
-      menu_run_untilreturn   = 'Futtat s ~v~isszat‚r‚sig';
-      menu_run_parameters    = 'P~a~ram‚terek...';
-      menu_run_resetdebugger = '~P~rogram alap llapotba';
-
-      menu_compile           = 'Fo~r~d¡t s';
-      menu_compile_compile   = '~F~ord¡t s';
-      menu_compile_make      = '~K~‚sz¡t‚s';
-      menu_compile_build     = '�~p~¡t‚s';
-      menu_compile_target    = '~C~‚l...';
-      menu_compile_primaryfile = '~E~ls‹dleges f jl...';
-      menu_compile_clearprimaryfile = 'E~l~s‹dleges f jl t”rl‚se';
-      menu_compile_information = '~I~nform ci¢...';
-      menu_compile_compilermessages = 'F~o~rd¡t si �zenetek';
-
-      menu_debug             = '~D~ebug';
-      menu_debug_output      = '~K~imenet';
-      menu_debug_userscreen  = '~F~elhaszn l¢i k‚perny‹';
-      menu_debug_breakpoint  = '~T~”r‚spont';
-      menu_debug_callstack   = '~H~¡v si verem';
-      menu_debug_registers   = '~R~egiszterek';
-      menu_debug_addwatch    = 'N‚z‹ke hozz ~a~d sa';
-      menu_debug_watches     = '~N~‚z‹k‚k';
-      menu_debug_breakpointlist = 'T”r‚spontok ~l~ist ja';
-      menu_debug_gdbwindow   = '~G~DB ablak';
-
-      menu_tools             = '~E~szk”z';
-      menu_tools_messages    = 'š~z~enetek';
-      menu_tools_msgnext     = 'Ugr s a ~k~”vetkez‹re';
-      menu_tools_msgprev     = 'Ugr s az ~e~l‹z‹re';
-      menu_tools_grep        = '~G~rep';
-      menu_tools_calculator  = '~S~z mol¢g‚p';
-      menu_tools_asciitable  = 'Ascii ~t~ bla';
-
-      menu_options           = '~O~pci¢k';
-      menu_options_mode      = 'M¢d~.~..';
-      menu_options_compiler  = '~F~ord¡t¢...';
-      menu_options_memory    = '~M~em¢ria-m‚retek...';
-      menu_options_linker    = '~L~inker...';
-      menu_options_debugger  = 'De~b~ugger...';
-      menu_options_directories = '~K~”nyvt rak...';
-      menu_options_browser   = '~T~all¢z¢...';
-      menu_options_tools     = '~E~szk”z”k...';
-      menu_options_env       = 'K”~r~nyezet';
-      menu_options_env_preferences = '~B~e ll¡t sok...';
-      menu_options_env_editor= 'S~z~erkeszt‹...';
-      menu_options_env_codecomplete = 'Code~C~omplete...';
-      menu_options_env_codetemplates = 'Code~T~emplates...';
-      menu_options_env_desktop = '~A~sztal...';
-      menu_options_env_mouse = 'E~g~‚r...';
-      menu_options_env_startup = '~I~ndul s...';
-      menu_options_env_colors= 'Sz¡~n~ek';
-      menu_options_open      = 'Megn~y~it s...';
-      menu_options_save      = 'Ment‚~s~';
-      menu_options_saveas    = 'Ment‚s m~ ~sk‚nt...';
-
-      menu_window            = '~A~blak';
-      menu_window_tile       = '~M~ozaikszerû elrendez‚s';
-      menu_window_cascade    = 'µ~t~lapol s';
-      menu_window_closeall   = 'Mindent ~b~ez r';
-      menu_window_resize     = 'M‚~r~etez‚s/Mozgat s';
-      menu_window_zoom       = '~N~agy¡t s';
-      menu_window_next       = '~K~”vetkez‹';
-      menu_window_previous   = '~E~l‹z‹';
-      menu_window_hide       = '~R~ejt‚s';
-      menu_window_close      = 'Be~z~ r s';
-      menu_window_list       = '~L~ista...';
-      menu_window_update     = 'Megjelen¡t‹ ~f~riss¡t‚se';
-
-      menu_help              = '~S~£g¢';
-      menu_help_contents     = menu_common_contents;
-      menu_help_index        = menu_common_index;
-      menu_help_topicsearch  = menu_common_topicsearch;
-      menu_help_prevtopic    = menu_common_prevtopic;
-      menu_help_using        = 'S£g¢ ~h~aszn lata';
-      menu_help_files        = '~F~ jlok...';
-      menu_help_about        = '~N~‚vjegy...';
-
-      { Breakpoints window local menu items }
-      menu_bplocal_gotosource  = menu_local_gotosource;
-      menu_bplocal_editbreakpoint = 'T”r‚spont s~z~erkeszt‚se';
-      menu_bplocal_newbreakpoint = 'é~j~ t”r‚spont';
-      menu_bplocal_deletebreakpoint = 'T”r‚spont ~t~”rl‚se';
-      menu_bplocal_togglestate = 'µllapot ~v~ lt sa';
-
-      { Watches local menu items }
-      menu_watchlocal_edit = 'N‚z‹ke s~z~erkeszt‚se';
-      menu_watchlocal_new = 'é~j~ n‚z‹ke';
-      menu_watchlocal_delete = 'N‚z‹ke ~t~”rl‚se';
-
-      { Symbol view local menu items }
-      menu_symlocal_browse = '~T~alloz s';
-      menu_symlocal_gotosource = menu_local_gotosource;
-      menu_symlocal_tracksource = menu_local_tracksource;
-      menu_symlocal_options = menu_local_options;
-
-      { Source editor local menu items }
-      menu_srclocal_openfileatcursor = 'Kurzor alatti ~f~ jl megnyit sa';
-      menu_srclocal_browseatcursor = 'Kurzor alatt ~s~zimb¢lum tall¢z sa';
-      menu_srclocal_topicsearch = 'T‚ma ~k~eres‚se';
-      menu_srclocal_options = menu_local_options;
-
-      { Help viewer local menu items }
-      menu_hlplocal_contents = menu_common_contents;
-      menu_hlplocal_index = menu_common_index;
-      menu_hlplocal_topicsearch = menu_common_topicsearch;
-      menu_hlplocal_prevtopic = menu_common_prevtopic;
-      menu_hlplocal_copy = menu_common_copy;
-
-      { Messages local menu items }
-      menu_msglocal_clear = menu_local_clear;
-      menu_msglocal_gotosource = menu_local_gotosource;
-      menu_msglocal_tracksource = menu_local_tracksource;
-
-      { short cut entries in menu }
-      menu_key_file_open     = 'F3';
-      menu_key_file_save     = 'F2';
-      menu_key_file_exit     = 'Alt+X';
-
-      menu_key_edit_undo     = 'Alt+BkSp';
-      menu_key_edit_cut      = 'Shift+Del';
-      menu_key_edit_copy     = menu_key_common_copy;
-      menu_key_edit_paste    = 'Shift+Ins';
-      menu_key_edit_clear    = 'Ctrl+Del';
-
-      menu_key_run_run       = 'Ctrl+F9';
-      menu_key_run_stepover  = 'F8';
-      menu_key_run_traceinto = 'F7';
-      menu_key_run_conttocursor = 'F4';
-      menu_key_run_resetdebugger = 'Ctrl+F2';
-
-      menu_key_compile_compile = 'Alt+F9';
-      menu_key_compile_make = 'F9';
-      menu_key_compile_compilermessages = 'F12';
-
-      menu_key_debug_userscreen = 'Alt+F5';
-      menu_key_debug_breakpoint = 'Ctrl+F8';
-      menu_key_debug_callstack = 'Ctrl+F3';
-      menu_key_debug_addwatch = 'Ctrl+F7';
-
-      menu_key_tools_messages= 'F11';
-      menu_key_tools_msgnext = 'Alt+F8';
-      menu_key_tools_msgprev = 'Alt+F7';
-      menu_key_tools_grep    = 'Shift+F2';
-
-      menu_key_window_resize = 'Ctrl+F5';
-      menu_key_window_zoom   = 'F5';
-      menu_key_window_next   = 'F6';
-      menu_key_window_previous = 'Shift+F6';
-      menu_key_window_close  = 'Alt+F3';
-      menu_key_window_list   = 'Alt+0';
-      menu_key_window_hide   = 'Ctrl+F6';
-
-      menu_key_help_helpindex= menu_key_common_helpindex;
-      menu_key_help_topicsearch = menu_key_common_topicsearch;
-      menu_key_help_prevtopic= menu_key_common_prevtopic;
-
-      menu_key_hlplocal_index = menu_key_common_helpindex;
-      menu_key_hlplocal_topicsearch = menu_key_common_topicsearch;
-      menu_key_hlplocal_prevtopic = menu_key_common_prevtopic;
-      menu_key_hlplocal_copy = menu_key_common_copy;
-
-      dialog_openafile        = 'F jl megnyit sa';
-      label_filetoopen        = 'Meg~n~yitand¢ f jl';
-      label_lookingfor        = '%s felkutat sa';
-
-      msg_confirmsourcediradd = 'A %s k”nyvt r nincs a keres‚si £tvonalban. '+
-                                'Hozz adja ?';
-
-      dialog_fillintemplateparameter = 'Minta param‚tereinek megad sa';
-
-      dialog_calculator       = 'Sz mol¢g‚p';
-
-      msg_quitconfirm         = 'Biztosan ki akar l‚pni?';
-
-      { CodeComplete dialog }
-      dialog_codecomplete     = 'CodeComplete';
-      label_codecomplete_keywords = '~K~ulcszavak';
-
-      dialog_codecomplete_add = 'éj kulcssz¢ hozz ad sa';
-      label_codecomplete_add_keyword = 'Kulcssz¢';
-
-      dialog_codecomplete_edit = 'Kulcssz¢ szerkeszt‚se';
-      label_codecomplete_edit_keyword = 'Kulcssz¢';
-
-      { CodeTemplates dialog }
-      dialog_codetemplates_add = 'éj minta hozz ad sa';
-      dialog_codetemplates_edit = 'Minta szerkeszt‚se';
-
-      msg_codecomplete_alreadyinlist = '"%s" m r van a list ban';
-
-      { File|New from template dialog }
-      msg_notemplatesavailable = 'Nincsenek mint k.';
-      dialog_newfromtemplate   = 'éj dokumentum minta alapj n';
-      label_availabletemplates = 'Felhaszn lhat¢ ~m~int k';
-
-      label_codetemplate_shortcut = '~R~”vid¡t‚s';
-      label_codetemplate_content = 'Minta t~a~rtalm';
-      label_codetemplate_templates = '~M~int k';
-
-      dialog_newtemplate = 'éj minta';
-      dialog_modifytemplate = 'Minta szerkeszt‚se';
-      msg_codetemplate_alreadyinlist = '"%s" nevû minta m r van a list ban';
-
-      dialog_compilermessages = 'A ford¡t¢ �zenetei';
-
-      dialog_compilingwithmode = 'Ford¡t s  (%s m¢d)';
-
-      { Breakpoints window }
-      dialog_breakpointlist = 'T”r‚spontok list ja';
-      label_breakpointpropheader = ' T¡pus     | µllapot | Poz¡ci¢           | Ignor. | Felt‚telek ';
-
-      dialog_modifynewbreakpoint = 'T”r‚spont szerkeszt‚se/felv‚tele';
-      label_breakpoint_name = '~N~‚v';
-      label_breakpoint_line = '~S~or';
-      label_breakpoint_conditions = 'Felt‚telek';
-      label_breakpoint_ignorecount = '~I~gnor l sok sz ma';
-
-      { Watches window }
-      dialog_watches = 'N‚z‹k‚k';
-
-      label_watch_expressiontowatch = '~K~ifejez‚s';
-      label_watch_values = 'N‚z‹ke ‚rt‚ke';
-
-      msg_watch_currentvalue = 'Aktu lis ‚rt‚k: '+#13+
-                               '%s';
-      msg_watch_currentandpreviousvalue = 'Aktu lis ‚rt‚k: '+#13+
-                                          '%s'+#13+
-                                          'El‹z‹ ‚rt‚k: '+#13+
-                                          '%s';
-
-      dialog_registers = 'Regiszterek';
-
-      dialog_fpu = 'FPU  llapota';
-
-      dialog_callstack = 'H¡v si verem';
-
-      dialog_help = 'S£g¢';
-      msg_modalhelpnotimplemented = 'A mod lis s£g¢ m‚g nincs implement lva.';
-
-      dialog_browse = 'Tall¢z s: %s';
-      dialog_units = 'Modulok';
-
-      dialog_browsesymbol = 'Szimb¢lum tall¢z sa';
-      label_entersymboltobrowse = 'Tall¢zand¢ ~s~zimb¢lum';
-
-      dialog_gdbwindow = 'GDB ablak';
-
-      dialog_clipboard = 'V g¢lap';
-
-      dialog_userscreen = 'Felhaszn l¢i k‚perny‹';
-
-      dialog_messages = 'šzenetek';
-
-      dialog_memorysizes = 'Mem¢ria-m‚retek';
-
-      dialog_directories = 'K”nyvt rak';
-
-      dialog_programparameters = 'Program param‚terei';
-      label_parameters_parameter = '~P~aram‚terek';
-
-      dialog_openoptions = 'Opci¢k bet”lt‚se';
-      msg_cantopenconfigfile = 'Nem tudom megnyitni a konfigur ci¢s f jlt.';
-      msg_errorsavingconfigfile = 'Hiba a konfigur ci¢s f jl ment‚se k”zben.';
-
-      dialog_saveoptions = 'Opci¢k ment‚se';
-
-      dialog_preferences = 'Be ll¡t sok';
-      label_preferences_videomode = 'Vide¢-m¢d';
-      label_preferences_currentdirectory = 'Akt~u~ lis k”nyvt r';
-      label_preferences_configdirectory = 'Konf~i~g. f jl k”nyvt ra';
-      label_preferences_desktopfile = 'Asztal-f jl';
-      label_preferences_editorfiles = 'Szerkesztett ~f~ jlok';
-      label_preferences_environment = 'K”rny~e~zet';
-      label_preferences_desktop = 'As~z~tal';
-      label_preferences_autosave = 'Automatikus ment‚s';
-      label_preferences_autotracksource = 'Forr s ~a~utom. k”vet‚se';
-      label_preferences_closeongotosource = 'Bez~ ~r s ugr skor';
-      label_preferences_changedironopen = 'K”nyvt r~v~ lt s megyit skor';
-      label_preferences_options = 'Opci¢k';
-
-      dialog_defaulteditoroptions = 'Szerkeszt‹ alap‚rt‚keinek be ll¡t sa';
-      dialog_editoroptions = 'Szerkeszt‹ be ll¡t sa';
-      label_editor_backupfiles = 'Biztons gi ~f~ jlok';
-      label_editor_insertmode = 'Besz£r s~i~ m¢d';
-      label_editor_autoindentmode = '~A~uto-bekezd‚s m¢d';
-      label_editor_usetabcharacters = 'Tab-karakterek has~z~n lata';
-      label_editor_backspaceunindents = '~B~acksp. t”rli a beh£z st';
-      label_editor_persistentblocks = 'Ta~r~t¢s blokkok';
-      label_editor_syntaxhighlight = '~S~zintakszis-kiemel‚s';
-      label_editor_blockinsertcursor = 'B~l~okk alak£ besz£r¢ kurzor';
-      label_editor_verticalblocks = '~F~�gg‹leges blokkok';
-      label_editor_highlightcolumn = 'Oszlop kiemel~‚~se';
-      label_editor_highlightrow = 'So~r~ kiemel‚se';
-      label_editor_autoclosingbrackets = 'Aut~o~matikus z r¢jelez‚se';
-      label_editor_keeptrailingspaces = 'Z r¢ sz”~k~”z”k megtart sa';
-      label_editor_codecomplete = 'Co~d~eComplete enged‚lyezve';
-      label_editor_folds = '"~H~ajtogat s" enged‚lyezve';
-      label_editor_editoroptions = 'Sz~e~rkeszt‹ opci¢k';
-      label_editor_tabsize = '~T~ab m‚rete';
-      label_editor_highlightextensions = 'Kieme~l~‚s a k”vetkez‹ kiterjeszt‚sek eset‚n';
-      label_editor_filepatternsneedingtabs = 'File ~p~atterns needing tabs';
-
-      dialog_browseroptions = 'Tall¢z¢ be ll¡t sai';
-      dialog_localbrowseroptions = 'Helyi tall¢z¢ be ll¡t sai';
-      label_browser_labels = '~C~¡mk‚k';
-      label_browser_constants = '~K~onstansok';
-      label_browser_types = '~T~¡pusok';
-      label_browser_variables = '~V~ ltoz¢k';
-      label_browser_procedures = '~E~lj r sok';
-      label_browser_inherited = '™~r~”kl‚sek';
-      label_browser_symbols = 'Szimb¢lumok';
-      label_browser_newbrowser = 'é~j~ tall¢z¢';
-      label_browser_currentbrowser = 'Aktu lis cse~r~‚je';
-      label_browser_subbrowsing = 'Al-tall¢z s';
-      label_browser_scope = '~H~at¢k”r';
-      label_browser_reference = 'H~i~vatkoz sok';
-      label_browser_preferredpane = 'Alap lap';
-      label_browser_qualifiedsymbols = '~Q~ualified symbols';
-      label_browser_sortsymbols = '~M~indig rendez';
-      label_browser_display = 'Megjelen¡t‚s';
-
-      dialog_desktoppreferences = 'Asztal be ll¡t sai';
-      label_desktop_historylists = '~E~l‹zm‚nyek';
-      label_desktop_clipboard = '~V~ g¢lap tartalma';
-      label_desktop_watches = '~N~‚z‹k‚k';
-      label_desktop_breakpoints = '~T~”r‚spontok';
-      label_desktop_openwindow = 'N~y~itott ablakok';
-      label_desktop_symbolinfo = '~S~zimb¢lum-inform ci¢';
-      label_desktop_codecompletewords = 'Co~d~eComplete sz¢lista';
-      label_desktop_codetemplates = 'Code~T~emplates';
-      label_desktop_preservedacrosssessions = 'Menete~k~ k”z”tt meg‹rz‚sre ker�l';
-
-      dialog_mouseoptions = 'Eg‚r be ll¡t sai';
-      label_mouse_speedbar = 'Gyors     K”zepes     Lass£';
-      label_mouse_doubleclickspeed = '~E~g‚r dupla-kattint sok';
-      label_mouse_reversebuttons = 'Felcser‚lt eg‚~r~gombok';
-      label_mouse_crtlrightmousebuttonaction = 'Ctrl+Jobb eg‚rgomb';
-      label_mouse_altrightmousebuttonaction = 'Alt+Jobb eg‚rgomb';
-      label_mouse_act_nothing = 'S~e~mmi';
-      label_mouse_act_topicsearch = '~T~‚ma keres‚se';
-      label_mouse_act_gotocursor = '~G~o to cursor';
-      label_mouse_act_breakpoint = 'T~”~r‚spont';
-      label_mouse_act_evaluate = '~K~i‚rt‚kel‚s';
-      label_mouse_act_addwatch = 'N‚z‹ke hozz ~a~d sa';
-      label_mouse_act_browsesymbol = '~S~zimb¢lum tall¢z sa';
-
-      label_colors_grp_browser = 'Tall¢z¢';
-      label_colors_framepassive = 'Passz¡v keret';
-      label_colors_frameactive = 'Akt¡v keret';
-      label_colors_frameicon = 'Keret ikon';
-      label_colors_scrollbarpage = 'G”rget‹s v oldal';
-      label_colors_scrollbaricons = 'G”rget‹s v ikon';
-      label_colors_normaltext = 'Norm l sz”veg';
-      label_colors_selectedtext = 'Kiv lasztott sz”veg';
-      label_colors_activeitem = 'Akt¡v elem';
-      label_colors_inactiveitem = 'Inakt¡v elem';
-      label_colors_focuseditem = 'F¢kusz lt elem';
-      label_colors_selecteditem = 'Kiv lasztott elem';
-      label_colors_divider = 'Oszt¢';
-      label_colors_grp_clock = 'àra';
-      label_colors_clockview = 'àra elem';
-      label_colors_grp_desktop = 'Asztal';
-      label_colors_grp_dialogs = 'P rbesz‚dablakok';
-      label_colors_grp_editor = 'Szerkeszt‹';
-      label_colors_highlighcolumn = 'Oszlop kiemel‚se';
-      label_colors_highlightrow = 'Sor kiemel‚se';
-      label_colors_errormessages = 'Hiba�zenetek';
-      label_colors_grp_help = 'S£g¢';
-      label_colors_helptext = 'S£g¢ sz”veg';
-      label_colors_helplinks = 'S£g¢ kapcsok';
-      label_colors_selectedlink = 'Kiv lasztott kapocs';
-      label_colors_grp_menus = 'Men�k';
-      label_colors_grp_syntax = 'Szintakszis';
-      label_colors_whitespace = 'Sz¢k”z';
-      label_colors_comments = 'Megjegyz‚sek';
-      label_colors_reservedwords = 'Fenntartott szavak';
-      label_colors_identifiers = 'Azonos¡t¢k';
-      label_colors_strings = 'Karakterl ncok';
-      label_colors_numbers = 'Sz mok';
-      label_colors_hexnumbers = 'Hexa sz mok';
-      label_colors_assembler = 'Assembler';
-      label_colors_symbols = 'Szimb¢lumok';
-      label_colors_directives = 'Direkt¡v k';
-      label_colors_tabs = 'Tabul torok';
-      label_colors_html_heading1 = 'HTML Heading 1';
-      label_colors_html_heading2 = 'HTML Heading 2';
-      label_colors_html_heading3 = 'HTML Heading 3';
-      label_colors_html_heading4 = 'HTML Heading 4';
-      label_colors_html_heading5 = 'HTML Heading 5';
-      label_colors_html_heading6 = 'HTML Heading 6';
-
-      dialog_linker = 'Linker';
-      label_linker_preferredlibtype = 'Preferr lt k”nyvt r-t¡pus';
-
-      dialog_debugger = 'Tall¢z s/Debugging/Profiling';
-      label_debugger_debuginfo = 'Debugging inform ci¢';
-      label_debugger_profileswitches = 'Profiling kapcsol¢k';
-      label_debugger_compilerargs = 'Tov~ ~bbi ford¡t si kapcsol¢k';
-      label_debugger_useanotherconsole = 'M sik konzol h~a~szn lata';
-      label_debugger_redirection = 'Debuggolt prog.  ti~r~ nyt¡s sa';
-      label_debugger_useanothertty = 'M sik tty h~a~szn lata';
-
-      dialog_helpfiles = 'S£g¢-f jlok telep¡t‚se';
-      label_helpfiles_helpfiles = '~S~£g¢-f jlok';
-
-      dialog_installhelpfile = 'S£g¢-f jl telep¡t‚se';
-      label_installhelpfile_filename = '~S~£g¢-f jl neve';
-
-      msg_createkeywordindexforhelpfile = 'Indexeljem a s£g¢ f jlt?';
-
-      dialog_topictitle = 'T‚ma c¡me';
-      label_topictitle_title = 'C¡m';
-
-      msg_pleasewaitwhilecreatingindex = 'K‚rem v rjon am¡g az index elk‚sz�l...';
-      msg_buildingindexfile = 'A %s index-f jl k‚sz¡t‚se folyamatban';
-      msg_filedoesnotcontainanylinks = 'a %s nem tartalmaz kapcsokat, ¡gy nem alkalmas indexel‚sre.';
-      msg_filealreadyexistsoverwrite = 'A %s f jl m r l‚tezik. Fel�l¡rja?';
-      msg_storinghtmlindexinfile = 'HTML index t rol sa a %s f jlban';
-      msg_errorstoringindexdata = 'Hiba az index adatok t rol sa k”zben (%d)';
-
-      dialog_switchesmode = 'SwitchesMode';
-      static_switchesmode_switchesmode = 'Switches Mode';
-
-      dialog_compilerswitches = 'Ford¡t¢ kapcsol¢k';
-      label_compiler_syntaxswitches = 'Szintaktikai kapcsol¢k';
-      label_compiler_runtimechecks = 'Fut s-idejû ellen‹rz‚sek';
-      label_compiler_optimizations = 'Optimaliz ci¢k';
-      label_compiler_targetprocessor = 'C‚l-processzor';
-      label_compiler_linkafter = 'Linking stage'; { NOT TRANSLATED }
-      label_compiler_verboseswitches = 'Verbose kapcsol¢k';
-      label_compiler_browser = 'Tall¢z¢';
-      label_compiler_assemblerreader = 'Assembler olvas¢';
-      label_compiler_assemblerinfo = 'Assembler inf¢';
-      label_compiler_assembleroutput = 'Assembler kimenet';
-      page_compiler_syntax = 'Sz~i~ntaxis';
-      page_compiler_codegeneration = 'K¢d-~g~ener ci¢';
-      page_compiler_verbose = '~V~erbose';
-      page_compiler_browser = '~T~all¢z¢';
-      page_compiler_assembler = '~A~ssembler';
-
-      dialog_target = 'C‚l';
-      label_target_platform = 'C‚l-platform';
-
-      label_primaryfile_primaryfile = 'Els‹dleges f jl';
-
-      { About window }
-      dialog_about = 'N‚vjegy';
-      label_about_compilerversion = 'Ford¡t¢ verzi¢';
-      label_about_debugger = 'Debugger';
-
-      { Program info window }
-      dialog_programinformation = 'Program inform ci¢';
-      label_proginfo_currentmodule = 'Aktu lis modul';
-      label_proginfo_lastexitcode = 'Utols¢ kil‚p‚si k¢d';
-      label_proginfo_availablememory = 'Szabad mem¢ria';
-
-      { Tools }
-      dialog_tools = 'Eszk”z”k';
-      label_tools_programtitles = '~P~rogram c¡mek';
-      dialog_modifynewtool = 'Eszk”z szerkeszt‚se/felv‚tele';
-      label_toolprop_title = '~C~¡m';
-      label_toolprop_programpath = '~P~rogram el‚r‚si £tja';
-      label_toolprop_commandline = 'Parancs~s~or';
-      msg_errorparsingparametersatpos = ^C'Hiba a param‚terek ‚rtelmez‚se k”zen a %d. karaktern‚l.';
-      msg_cantinstallmoretools = ^C'T”bb eszk”z nem vehet‹ fel...';
-      msg_requiredparametermissingin = 'Egy k”telez‹ param‚ter hi nyzik [%s] szekci¢ban';
-      msg_requiredpropertymissingin = 'Egy k”telez‹ jellemz‹ hi nyzik a [%s] szekci¢ban';
-      msg_unknowntypein = 'Ismeretlen t¡pus a [%s] szekci¢ban';
-      msg_propertymissingin = 'A %s jellemz‹ hi nyzik a [%s] szekci¢b¢l';
-      msg_invaliditemsin = '�rv‚nytelen elemsz m a [%s] szekci¢ban';
-      msg_errorparsingtoolparams = ^C'Hiba a param‚terek ‚rtelmez‚se k”zben.';
-      msg_executingtool = 'A %s eszk”z futtat sa...';
-      msg_errorreadingoutput = 'Hiba a kimenet olvas sa k”zben.';
-      msg_executingfilterfor = 'Szûr‹ futtat sa a %s eszk”zh”z...';
-      msg_cantfindfilteredoutput = 'Nem tal lom a szûr‹ kimenet‚t.';
-      msg_errorprocessingfilteredoutput = 'Hiba a szûrt kimenet feldolgoz sa k”zben.';
-      msg_errorexecutingfilter = 'Hiba a szûr‹ futtat sa k”zben'; {%s}
-      msg_errorexecutingtool = 'Hiba a %s eszk”z futtat sa k”zben';
-      msg_errorexecutingshell = 'Nem tudom futtatni a shell-t';
-
-      msg_filterexecutionsuccessfulexitcodeis = 'Szûr‹ futtat sa sikeres. Kil‚p‚si k¢d = %d';
-      msg_toolexecutionsuccessfulexitcodeis = 'Eszk”z futtat sa sikeres. Kil‚p‚si k¢d = %d';
-
-      dialog_greparguments = 'Grep param‚terei';
-      msg_grepprogramnotfound = 'Nem tal lom a Grep programot';
-      label_grep_texttofind = 'K~e~resend‹ sz”veg';
-      label_grep_greparguments = '~G~rep param‚terei';
-      msg_runninggrepwithargs = '"Grep -n %s" futtat sa';
-      msg_errorrunninggrep = #3'Hiba a Grep futtat sa k”zben'#13#3'DosError = %d'#13#3'Kil‚p‚si k¢d = %d';
-      msg_errorreadinggrepoutput = #3'Hiba Grep kimenet olvas sa'#13#3'k”zben a %d. sorban. (%s)';
-
-      dialog_windowlist = 'Ablakok list ja';
-      label_wndlist_windows = '~A~blakok';
-
-      msg_windowlist_hidden = 'rejtett';
-
-      msg_userscreennotavailable = 'A felhaszn l¢i k‚perny‹ nem el‚rhet‹.';
-
-      { Tools $PROMPT() dialog }
-      dialog_programarguments = 'Program param‚terei';
-      label_enterprogramargument = '’rja b~e~ a program param‚tereit';
-
-      { Debugger confirmations and messages }
-      msg_nodebuginfoavailable = 'Nincs debug inform ci¢.';
-      msg_nodebuggersupportavailable = 'Debugger t mogat s nem el‚rhet‹.';
-      msg_cantdebugchangetargetto = #3'A %s platformra ford¡tott'#13+
-                                    #3'programok nem debuggolhat¢k.'#13+
-                                    #3'A c‚lt ink bb %s-ra v ltoztatja?';
-      msg_compiledwithoutdebuginforecompile =
-                                 #3'Figyelem, a program'#13+
-                                 #3'debug inform ci¢ n‚lk�l'#13+
-                                 #3'lett ford¡tva.'#13+
-                                 #3'éjraford¡tja?';
-      msg_nothingtodebug = 'Hopp , nincs mit debuggolni.';
-      msg_startingdebugger = 'Debugger ind¡t sa';
-
-      msg_doyouwanttocreatelocalconfigfile =
-        'A Free Pascal IDE m‚g sosem lett ind¡tva ebben a k”nyvt rban. '+
-         'L‚tre akar hozni egy £j konfigur ci¢s f jlt itt? '{#13+
-         '(If you answer with "No", the IDE will use '+
-         'the config file located in "%s")'};
-      msg_configcopyexistingorcreatenew =
-        'A m r l‚tez‹ konfigur ci¢t m soljam le, vagy hozzak '+
-        'l‚tre egy teljesen £jat?';
-      btn_config_copyexisting = '~M~ sold le!';
-      btn_config_createnew = '~H~ozd l‚tre!';
-
-      { Desktop file messages }
-      msg_readingdesktopfile = 'Asztal-f jl olvas sa...';
-      msg_writingdesktopfile = 'Asztal-f jl ¡r sa...';
-      msg_readingdesktopcontents = 'Asztal tartalm nak olvas sa...';
-      msg_storingdesktopcontents = 'Asztal tartalm nak ¡r sa...';
-      msg_readinghistory = 'El‹zm‚nyek olvas sa...';
-      msg_storinghistory = 'El‹zm‚nyek t rol sa...';
-      msg_readingwatches = 'N‚z‹k‚k olvas sa...';
-      msg_storingwatches = 'N‚z‹k‚k t rol sa...';
-      msg_readingbreakpoints = 'T”r‚spontok olvas sa...';
-      msg_storingbreakpoints = 'T”r‚spontok t rol sa...';
-      msg_readingcodecompletewordlist = 'CodeComplete sz¢lista olvas sa...';
-      msg_storingcodecompletewordlist = 'CodeComplete sz¢lista t rol sa...';
-      msg_readingcodetemplates = 'CodeTemplate-ek olvas sa...';
-      msg_storingcodetemplates = 'CodeTemplate-ek t rol sa...';
-      msg_readingsymbolinformation = 'Szimb¢lum-inform ci¢ olvas sa...';
-      msg_storingsymbolinformation = 'Szimb¢lum-inform ci¢ t rol sa...';
-      msg_failedtoreplacedesktopfile = 'Nem siker�lt az asztal-f jlt lecser‚lni.';
-      msg_errorloadinghistory = 'Hiba az el‹zm‚nyek bet”lt‚se k”zben';
-      msg_errorstoringhistory = 'Hiba az el‹zm‚nyek t rol sa k”zben';
-      msg_errorloadingwatches = 'Hiba a n‚z‹k‚k bet”lt‚se k”zben';
-      msg_errorstoringwatches = 'Hiba a n‚z‹k‚k t rol sa k”zben';
-      msg_errorloadingbreakpoints = 'Hiba a t”r‚spontok olvas sa k”zben';
-      msg_errorstoringbreakpoints = 'Hiba a t”r‚spontok t rol sa k”zben';
-      msg_errorloadingdesktop = 'Hiba az asztal bet”lt‚se k”zben';
-      msg_errorstoringdesktop = 'Hiba az asztal t rol sa k”zben';
-      msg_errorreadingflags = 'Hiba a flagek bet”lt‚se k”zben';
-      msg_errorwritingflags = 'Hiba a flagek ¡r sa k”zben';
-      msg_errorreadingvideomode = 'Hiba a vide¢-m¢d olvas sa k”zben';
-      msg_errorstoringvideomode = 'Hiba a vide¢-m¢d ¡r sa k”zben';
-      msg_errorloadingcodetemplates = 'Hiba a CodeTemplate-ek olvas sa k”zben';
-      msg_errorstoringcodetemplates = 'Hiba a CodeTemplate-ek ¡r sa k”zben';
-      msg_errorloadingsymbolinformation = 'Hiba a szimb¢lum-inform ci¢ olvas sa k”zben';
-      msg_errorstoringsymbolinformation = 'Hiba a szimb¢lum-inform ci¢ ¡r sa k”zben';
-      msg_errorloadingcodecompletewordlist = 'Hiba a CodeComplete sz¢lista olvas sa k”zben';
-      msg_errorstoringcodecompletewordlist = 'Hiba a CodeComplete sz¢lista ¡r sa k”zben';
-      msg_invaliddesktopversionlayoutlost = '�rv‚nytelen asztal verzi¢. Az asztal tartalma elveszett.';
-
-      msg_cantopenfile = 'Nem tudom megnyitni a %s f jlt';
-      msg_cantcreatefile = 'Nem tudom l‚trehozni a %s f jlt';
-      msg_cantfindfile = 'Nem tal lom a %s f jlt';
-      msg_errorreadingfile = 'Hiba a %s f jl olvas sa k”zben';
-      msg_loadingfile = '%s bet”lt‚se';
-      msg_storingfile = '%s t rol sa';
-      msg_closingfile = '%s bez r sa';
-      msg_invalidfilename = 'A %s ‚rv‚nytelen f jln‚v';
-
-      msg_openingsourcefile = 'Forr sf jl megnyit sa... (%s)';
-      msg_readingfileineditor = '%s beolvas sa a szerkeszt‹be...';
-
-      label_sym_objects = 'Objektumok';
-      label_sym_globalscope = 'Glob lis hat¢k”r';
-      label_sym_globals = 'Glob lis elemek';
-
-      { Symbol browser meminfo page }
-      msg_sizeinmemory = 'M‚ret a mem¢ri ban';
-      msg_sizeonstack = 'M‚ret a vermen';
-
-      msg_usedfirstin = 'El‹sz”r haszn lva';
-      msg_mainsource = 'F‹ forr s';
-      msg_sourcefiles = 'Forr s-f jlok';
-
-      { Help messages }
-      msg_indexingfile = '%s f jl indexel‚se';
-      msg_loadinghelpfiles = 'S£g¢ f jlok bet”lt‚se...';
-      msg_loadinghelpfile = 'S£g¢ f jl bet”lt‚se...';
-      msg_buildinghelpindex = 'S£g¢index k‚sz¡t‚se...';
-      msg_locatingtopic = 'T‚ma bet”lt‚se...';
-      msg_failedtoloadhelpfile = 'Nem siker�lt bet”lteni a %s s£g¢-f jlt';
-
-      { Browser messages }
-      msg_symbolnotfound = #3'Nem tal lom a %s szimb¢lumot';
-      msg_nobrowserinfoavailable = 'Nincs tall¢z si inform ci¢';
-      msg_toomanysymbolscantdisplayall= 'T£l sok szimb¢lum. Nem tudom mindet megjelen¡teni.';
-
-      { Status hints during compilation }
-      msg_hint_pressesctocancel = 'Nyomjon ESC-et a megszak¡t shoz';
-      msg_hint_compilesuccessfulpressenter = 'A ford¡t s sikeres: ~Nyomjon Enter-t~';
-      msg_hint_compilefailed = 'A ford¡t s sikertelen';
-      msg_hint_compileaborted = 'A ford¡t s megszak¡tva';
-      msg_hint_pleasewait = 'K‚rem v rjon...';
-
-      { Compile status dialog texts }
-      msg_compilingfile      = 'Ford¡t s alatt %s';
-      msg_linkingfile        = 'Linkel‚s alatt %s';
-      msg_compiledone        = 'K‚sz.';
-      msg_failedtocompile    = 'Nem siker�lt leford¡tani...';
-      msg_compilationaborted = 'A ford¡t s megszak¡tva...';
-
-      msg_nothingtocompile = 'Hopp , nincs mit ford¡tani.';
-      msg_cantcompileunsavedfile = 'El nem mentett f jlt nem tudok ford¡tani.';
-
-      msg_couldnotcreatefile = 'A %s f jl l‚trehoz sa nem siker�lt';
-      msg_therearemoreerrorsinfile = 'A %s f jlban t”bb hiba is tal lhat¢';
-      msg_firstcompilationof = 'A %s els‹ ford¡t sa';
-      msg_recompilingbecauseof = 'éjraford¡t sa %s miatt';
-
-      msg_errorinexternalcompilation = 'Hiba a k�ls‹ ford¡t s k”zben';
-      msg_iostatusis = 'IOStatus = %d';
-      msg_executeresultis = 'ExecuteResult = %d';
-
-      msg_nothingtorun = 'Hopp , nincs mit futtatni.';
-
-      msg_impossibletoreachcursor = 'A kurzor-poz¡ci¢ra sosem ker�l a vez‚rl‚s';
-      msg_impossibletosetbreakpoint = 'Itt nem helyezhet‹ el t”r‚spont';
-
-      msg_programnotrundoserroris = #3'A %s programot'#13#3'nem siker�lt futtatni'#13#3'DosError = %d';
-      msg_programfileexitedwithexitcode = #3'A %s program'#13#3'kil‚pett '#13#3'exitcode = %d';
-
-      msg_automaticallycreateddontedit = 'Automatikusan l‚trehozott f jl, ne szerkessze!';
-
-      { Compiler options }
-      opt_delphi2extensions = '~D~elphi 2 b‹v¡t‚sek be';
-      opt_clikeoperators = '~C~-szerû oper torok';
-      opt_stopafterfirsterror = 'S~t~op az els‹ hiba ut n';
-      opt_allowlabelandgoto = 'LABEL, GOTO enged‚l~y~ezve';
-      opt_cplusplusstyledinline = 'C++ st~¡~lus£ inline';
-      opt_globalcmacros = 'Glob lis C ~m~akr¢k';
-      opt_tp7compatibility = 'TP/BP ~7~.0 kompatibilit s';
-      opt_delphicompatibility = 'Del~p~hi kompatibilit s';
-      opt_allowstaticinobjects = 'STATIC enged‚~l~yez‚se az objektumokban';
-      opt_strictvarstrings = 'Szigor£an vett ~v~ar-sztringek';
-      opt_extendedsyntax = 'Ki~t~erjesztett szintakszis';
-      opt_allowmmxoperations = 'MMX mûv~e~letek enged‚lyez‚se';
-      { Verbose options }
-      opt_warnings = '~F~igyelmeztet‚sek';
-      opt_notes = 'Meg~j~egyz‚sek';
-      opt_hints = '~T~ippek';
-      opt_generalinfo = 'µltal nos ~i~nf¢';
-      opt_usedtriedinfo = '~H~aszn lt, pr¢b lt inf¢';
-      opt_all = '~M~inden';
-      opt_showallprocsonerror = 'Hiba eset‚n az ~”~sszes elj r s megmutat sa';
-      { Checking options }
-      opt_rangechecking = 'Hat ~r~-ellen‹rz‚s';
-      opt_stackchecking = 'Veremviz~s~g lat';
-      opt_iochecking = '~I~/O ellen‹rz‚s';
-      opt_overflowchecking = 'Eg‚szek t£lcs~o~rdul s-vizsg lata';
-      { Code options }
-      opt_generatefastercode = '~G~yorsabb k¢d gener l sa';
-      opt_generatesmallercode = '~K~isebb k¢d gener l sa';
-      opt_useregistervariables = 'Regisz~t~er-v ltoz¢k haszn lata';
-      opt_uncertainoptimizations = '~B~izonztalan optimiz ci¢k';
-      opt_level1optimizations = '~1~.szintû optimiz ci¢k';
-      opt_level2optimizations = '~2~.szintû optimiz ci¢k';
-      opt_i386486 = 'i~3~86/i486';
-      opt_pentiumandmmx = 'Pentium/PentiumMM~X~ (tm)';
-      opt_pentiumpro = 'P~P~ro/PII/c6x86/K6 (tm)';
-      { Assembler options }
-      opt_directassembler = '~D~irekt assembler';
-      opt_attassembler = '~A~T&T st¡lus£ assembler';
-      opt_intelassembler = '~I~ntel st¡lus£ assembler';
-      opt_listsource = 'Forr s ~l~ist z sa';
-      opt_listregisterallocation = '~r~egister-foglal s list.';
-      opt_listtempallocation = ' ~t~meneti foglal s list.';
-      opt_usedefaultas = '~D~efault kimeneti form tum haszn lata';
-      opt_usegnuas = '~G~NU as haszn lata';
-      opt_usenasmcoff = '~N~ASM coff haszn lata';
-      opt_usenasmelf = 'Use NASM ~e~lf haszn lata';
-      opt_usenasmobj = 'Use NASM ~o~bj haszn lata';
-      opt_usemasm = '~M~ASM haszn lata';
-      opt_usetasm = '~T~ASM haszn lata';
-      opt_usecoff = '~c~off haszn lata';
-      opt_usepecoff = '~p~ecoff haszn lata';
-      { Browser options }
-      opt_nobrowser = 'Nincs tall~¢~z¢';
-      opt_globalonlybrowser = 'Cs~a~k glob lis tall¢z¢';
-      opt_localglobalbrowser = '~L~ok lis ‚s glob lis tall¢z¢';
-      { Conditional defines }
-      opt_conditionaldefines = 'Felt‚teles defi~n~¡ci¢k';
-      { Memory sizes }
-      opt_stacksize = '~V~erem-m‚ret';
-      opt_heapsize = '~H~eap-m‚ret';
-      { Directory options }
-      opt_unitdirectories = '~U~nit k”nyvt rak';
-      opt_includedirectories = '~I~nclude k”nyvt rak';
-      opt_librarydirectories = '~L~ibrary k”nyvt rak';
-      opt_objectdirectories = '~O~bject k”nyvt rak';
-      opt_exeppudirectories = '~E~XE & PPU k”nyvt rak';
-      { Library options }
-      opt_librariesdefault = '~T~arget default'; { NOT TRANSLATED }
-      opt_dynamiclibraries = '~D~inamikus k”nyvt rak';
-      opt_staticlibraries = '~S~tatikus k”nyvt rak';
-      opt_smartlibraries = 'S~m~art libraries'; { NOT TRANSLATED }
-      { Symbol info options }
-      opt_stripalldebugsymbols = 'Debug szimb¢lumok elt vol¡t ~s~a';
-      opt_gendebugsymbolinfo = '~D~ebug szimb¢lum info gener l sa';
-      opt_gensymbolandbacktraceinfo = 'Backtrace sorinfom ci¢ gener ~l~ sa is';
-      { Link after options }
-      opt_linkafter = 'Call ~l~inker after'; { NOT TRANSLATED }
-      { Profiling options }
-      opt_noprofileinfo = '~N~incs profile inform ci¢';
-      opt_gprofinfo = 'Profile inf¢ gener l sa g~p~rof-hoz';
-
-      msg_xmustbesettoyforz_doyouwanttochangethis =
-        'Az %s ‚rt‚k‚t "%s"-re kell  ll¡tani a %s-hez. '+
-        'K¡v nja, hogy ezt a be ll¡t st automatikusan megtegyem?';
-
-
-      { Debugger messages and status hints }
-      msg_programexitedwithcodeandsteps = #3'A program kil‚pett '#13+
-                                          #3'exitcode = %d'#13+
-                                          #3'rejtett l‚p‚sek = %d';
-
-      msg_programexitedwithexitcode = #3'A program kil‚pett '#13+
-                                      #3'exitcode = %d';
-
-      msg_runningprogram = 'Futtat s...';
-      msg_runninginanotherwindow = 'Program futtat sa m sik ablakban...';
-      msg_couldnotsetbreakpointat = #3'Nem siker�lt a t”r‚spont felv‚tele'#13+
-                                    #3+'%s:%d';
-      msg_couldnotsetbreakpointtype = #3'Nem siker�lt a t”r‚spont felv‚tele'#13+
-                                      #3+'%s %s';
-
-      { standard button texts }
-      button_OK          = 'O~K~';
-      button_Cancel      = 'M‚gsem';
-      button_New         = 'é~j~';
-      button_Edit        = 'S~z~erk.';
-      button_Delete      = '~T~”rl‚s';
-      button_Close       = 'Be~z~ r';
-      button_Show        = '~M~utat';
-      button_Hide        = '~R~ejt';
-
-      { Compiler message classes }
-      msg_class_normal   = '';
-      msg_class_fatal    = 'Fat lis';
-      msg_class_error    = 'Hiba';
-      msg_class_warning  = 'Figyelmeztet‚s';
-      msg_class_note     = 'Megjegyz‚s';
-      msg_class_hint     = 'Tipp';
-      msg_class_macro    = 'Makro';
-      msg_class_procedure= 'Elj r s';
-      msg_class_conditional = 'Conditional';
-      msg_class_info     = 'Info';
-      msg_class_status   = 'St tusz';
-      msg_class_used     = 'Haszn lva';
-      msg_class_tried    = 'Pr¢b lva';
-      msg_class_debug    = 'Debug';
-
-      { status line entries }
-      status_help            = '~F1~ S£g¢';
-      status_help_on_help    = '~F1~ Seg¡ts‚g a s£g¢hoz';
-      status_help_previoustopic = '~Alt+F1~ El‹z‹ t‚ma';
-      status_help_index      = '~Shift+F1~ S£g¢ index';
-      status_help_close      = '~Esc~ S£g¢ bez r sa';
-      status_save            = '~F2~ Ment';
-      status_open            = '~F3~ Megnyit';
-      status_compile         = '~Alt+F9~ Ford¡t';
-      status_make            = '~F9~ K‚sz¡t';
-      status_localmenu       = '~Alt+F10~ Helyi men�';
-      status_transferchar    = '~Ctrl+Enter~ Karakter  tvitele';
-      status_msggotosource   = '~'+EnterSign+'~ Ugr s forr sba';
-      status_msgtracksource  = '~Space~ Forr s k”vet‚se';
-      status_close           = '~Esc~ Bez r';
-      status_calculatorpaste = '~Ctrl+Enter~ Eredm‚ny  tvitele';
-
-      { Menu hints }
-      hint_systemmenu        = 'Rendszermen�';
-      hint_update            = 'Kijelz‹ friss¡t‚se ‚s £jrarajzol sa';
-      hint_about             = 'Verzi¢- ‚s copyright inform ci¢k megjelen¡t‚se';
-      hint_filemenu          = 'F jl-kezel‚si parancsok (Megnyit s, éj, Ment‚s, stb.)';
-      hint_filenew           = 'éj f jl l‚trehoz sa egy £j szerkeszt‹-ablakban';
-      hint_filenewfromtemplate='éj f jl l‚trehoz sa minta alapj n';
-      hint_fileopen          = 'F jl felkutat sa ‚s megnyit sa szerkeszt‹-ablakban';
-      hint_filesave          = 'Az akt¡v szerkeszt‹-ablak ment‚se f jlba';
-      hint_filesaveas        = 'Az aktu lis f jl ment‚se m sik n‚ven, k”nyvt rba vagy meghajt¢ra';
-      hint_filesaveall       = 'Minden m¢dos¡tott f jl ment‚se';
-      hint_changedir         = 'éj alap‚rtelmezett k”nyvt r kiv laszt sa';
-      hint_dosshell          = 'µtmeneti kil‚p‚s a DOS-ba';
-      hint_exit              = 'Kil‚p‚s az IDE-b‹l';
-      hint_openrecentfile    = 'Megjel”lt f jlt megnyit sa egy £j szerkeszt‹-ablakban';
-      hint_editmenu          = 'V g¢lap-szerkeszt‹ parancsok';
-      hint_editundo          = 'Utols¢ szerkeszt‚si mûvelet visszavon sa';
-      hint_editredo          = 'Utols¢ vissavont szerkeszt‚si mûvelet £jb¢li elv‚gz‚se';
-      hint_editcut           = 'Kiv lasztott sz”veg elt vol¡t sa ‚s elhelyez‚se a v g¢lapon';
-      hint_editcopy          = 'Kiv lasztott sz”veg m sol sa a v g¢lapra';
-      hint_editpaste         = 'Kiv lasztott sz”veg beilleszt‚se a v g¢lapr¢l';
-      hint_editcopywin       = 'Kiv lasztott sz”veg m sol sa a Windows v g¢lapra';
-      hint_editpastewin      = 'Kiv lasztott sz”veg beilleszt‚se a Windows v g¢lapr¢l';
-      hint_editclear         = 'Kiv lasztott sz”veg t”rl‚se';
-      hint_showclipboard     = 'V g¢lap ablak nak megnyit sa';
-      hint_searchmenu        = 'Sz”veg- ‚s szimb¢lum-keres‹ parancsok';
-      hint_searchfind        = 'Sz”veg keres‚se';
-      hint_searchreplace     = 'Sz”veg keres‚se ‚s cser‚je m sik sz”vegre';
-      hint_searchagain       = 'Repeat the last Search or Replace command';
-      hint_gotoline          = 'Kurzor mozgat sa a megadott sz m£ sorra';
-      hint_objects           = 'A program objektumait tartalmaz¢ tall¢z¢ megjelen¡t‚se';
-      hint_modules           = 'A program moduljait tartalmaz¢ tall¢z¢ megjelen¡t‚se';
-      hint_globals           = 'A program gl¢b lis szimb¢lumait tartalmaz¢ tall¢z¢ megjelen¡t‚se';
-      hint_symbol            = 'Tall¢z¢ megjelen¡t‚se az aktu lis sz¢hoz';
-      hint_runmenu           = 'Futtat s ‚s param‚terek';
-      hint_run               = 'Az aktu lis program futtat sa';
-      hint_runparameters     = 'A programnak futtat skor  tadott parancssori param‚terek megad sa';
-      hint_resetprogram      = 'Program alaphelyzetbe';
-      hint_rununtilcursor    = 'Futtat s a kurzor-poz¡ci¢ig';
-      hint_rununtilreturn    = 'Futtat s az aktu lis elj r s v‚g‚ig';
-      hint_userscreen        = 'µtv lt s a teljes-k‚perny‹s kiementre';
-      hint_compilemenu       = 'Ford¡t s, ‚p¡t‚s & k‚sz¡t‚se';
-      hint_compile           = 'Aktu lis forr sf jl ford¡t sa';
-      hint_make              = 'Forr s ‚s minden m¢dos¡tott f jl £jra‚p¡t‚se';
-      hint_build             = 'A program- ‚s minden el‚rhet‹ forr s-f jl £jra‚p¡t‚se';
-      hint_target            = 'Ford¡t si c‚lplatform kiv laszt sa';
-      hint_primaryfile       = 'A k‚sz¡t‚s ‚s ‚p¡t‚s c‚lf jlj nak megad sa';
-      hint_clearprimaryfile  = 'Az el‹z‹leg megadott els‹dleges f jl t”rl‚se';
-      hint_information       = 'Ford¡t si �zenetek ‚s program-inform ci¢ megjelen¡t‚se';
-      hint_showmessages      = 'Ford¡t si �zenetek ablak megjelen¡t‚se';
-      hint_debugmenu         = 'Program debugol sa';
-      hint_togglebreakpoint  = 'T”r‚spont v lt sa';
-      hint_createnewbreakpoint = 'éj t”r‚spont l‚trehoz sa';
-      hint_editbreakpoint    = 'F¢kusz lt t”r‚spont szerkeszt‚se';
-      hint_deletebreakpoint  = 'F¢kusz lt t”r‚spont t”rl‚se';
-      hint_opengdbwindow     = 'K”zvetlen GDB ablak megnyit sa';
-      hint_addwatch          = 'éj n‚z‹ke-kifejez‚s felv‚tele';
-      hint_watches           = 'N‚z‹k‚k ablak megjelen¡t‚se';
-      hint_callstack         = 'H¡v si verem megjelen¡t‚se';
-      hint_editbreakpoints   = 'T”r‚spontok szerkeszt‚se';
-      hint_toolsmenu         = 'Felhaszn l¢  ltal telep¡tett eszk”z”k';
-      hint_calculator        = 'Sz mol¢g‚p megjelen¡t‚se';
-      hint_grep              = 'Grep futtat sa';
-      hint_gotosource        = 'Forr s szerkeszt‚se';
-      hint_registers         = 'Regiszterek ablak megnyit sa';
-      hint_messageswindow    = 'šzenetek ablak megnyit sa';
-      hint_usertool          = 'Felhaszn l¢  ltal telep¡tett eszk”z';
-      hint_asciitable        = 'Show ASCII table';
-      hint_optionsmenu       = 'Ford¡t¢, szerkeszt‹, eg‚r, stb. be ll¡t sai';
-      hint_switchesmode      = 'Norm l, debug vagy release verzi¢ kiv laszt sa';
-      hint_compiler          = 'Alap‚rtelmezett ford¡t si ‚s felt‚teles direkt¡v k be ll¡t sa';
-      hint_memorysizes       = 'Alap‚rtelmezett verem-‚s heap-m‚ret be ll¡t sa';
-      hint_linkeroptions     = 'Linker opci¢k be ll¡t sa';
-      hint_debugoptions      = 'Debug inform ci¢ opci¢k';
-      hint_directories       = 'El‚r‚si utak be ll¡t sa (unit, include, object f jlokhoz)';
-      hint_browser           = 'Glob lis tall¢z si opci¢k be ll¡t sa';
-      hint_tools             = 'Eszk”z”k felv‚tele vagy m¢dos¡t sa';
-      hint_environmentmenu   = 'K”rnyezeti be ll¡t sok megad sa';
-      hint_preferences       = 'Be ll¡t sok megad sa';
-      hint_editoroptions     = 'Szerkeszt‹ be ll¡t sainak megad sa';
-      hint_codecomplete      = 'CodeComplete kulcsszavak megad sa';
-      hint_codetemplates     = 'CodeTemplate-ek megad sa';
-      hint_mouseoptions      = 'Eg‚r-be ll¡t sok megad sa';
-      hint_desktopoptions    = 'Asztal be ll¡t sainak megad sa';
-      hint_startup           = 'Ind¡t si opci¢k permanens megv ltoztat sa';
-      hint_colors            = 'Az IDE  ltal haszn lt sz¡nek megv ltoztat sa';
-      hint_openini           = 'El‹z‹leg elmentett konfigur ci¢s f jl megnyit sa';
-      hint_saveini           = 'Minden v ltoztat s ment‚se a konfigur ci¢s f jlba';
-      hint_saveasini         = 'V ltoztat sok ment‚se m s n‚ven';
-      hint_windowmenu        = 'Ablak-kezel‹ parancsok';
-      hint_tile              = 'Ablakok mozaikszerû elrendez‚se az asztalon';
-      hint_cascade           = 'Ablakok  tlapolt elrendez‚se az asztalon';
-      hint_closeall          = 'Az asztal ”sszes ablak nak bez r sa';
-      hint_resize            = 'Akt¡v ablak m‚ret‚nek/poz¡ci¢j nak v ltozat sa';
-      hint_zoom              = 'Akt¡v ablak megnagyobb¡t sa vagy m‚ret‚nek vissz ll¡t sa';
-      hint_next              = 'A k”vetkez‹ ablak aktiv l sa';
-      hint_prev              = 'Az el‹z‹ ablak aktiv l sa';
-      hint_closewindow       = 'Akt¡v ablak bez r sa';
-      hint_windowlist        = 'Az ”sszes nyitott ablak list j nak megjelen¡t‚se';
-      hint_userscreenwindow  = 'Felhaszn l¢i k‚perny‹ tartalm nak megjelen¡t‚se ablakban';
-      hint_helpmenu          = 'Seg¡ts‚g k‚r‚se';
-      hint_helpcontents      = 'Online S£g¢ tartlomjegyz‚k‚nek megjelen¡t‚se';
-      hint_helpindex         = 'Online S£g¢ index‚nek megjelen¡t‚se';
-      hint_helptopicsearch   = 'A kurzor alatti sz¢val kapcsolatos s£g¢ megjelen¡t‚se';
-      hint_helpprevtopic     = 'Az utols¢nak megtekintett S£g¢ oldal megjelen¡t‚se';
-      hint_helphowtouse      = 'Az Online S£g¢ haszn lata';
-      hint_helpfiles         = 'S£g¢ f jlok telep¡t‚se ‚s elt vol¡t sa';
-      hint_openatcursor      = 'A kurzor alatti f jl megnyit sa';
-      hint_browseatcursor    = 'A kurzor alatti szimb¢lum tall¢z sa';
-      hint_editoroptionscur  = 'Szerkeszt‹ be ll¡t sainak megad sa';
-      hint_rawgdbwindow      = 'Nyers GDB kommunik ci¢s ablak';
-      hint_allbreakpoints    = '™sszes t”r‚spont';
-
-      { error messages }
-      error_saving_cfg_file  = 'Hiba a konfigur ci¢ ment‚se k”zben.';
-      error_saving_dsk_file  = 'Hiba az asztal f jl t rol sa k”zben.'#13+
-                               'Az asztal tartalma nem ker�lt t rol sra.';
-      error_user_screen_not_avail = 'A felhaszn l¢i k‚perny‹ nem el‚rhet‹.';
-
-{
-  $Log$
-  Revision 1.4  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.7  2000/11/14 17:40:44  pierre
-   + External linking now optional
-
-  Revision 1.3  2000/10/31 22:35:55  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.6  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.1.2.5  2000/10/04 13:30:50  pierre
-   * DosShell for linux
-
-  Revision 1.1.2.4  2000/09/18 13:20:54  pierre
-   New bunch of Gabor changes
-
-  Revision 1.2  2000/08/22 09:41:40  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.3  2000/08/16 18:46:14  peter
-   [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
-   [*] Make, Build now possible even in Compiler Messages Window
-   [+] when started in a new dir the IDE now ask whether to create a local
-       config, or to use the one located in the IDE dir
-
-  Revision 1.1.2.2  2000/08/04 14:05:19  michael
-  * Fixes from Gabor:
-   [*] the IDE now doesn't disable Compile|Make & Build when all windows
-       are closed, but there's still a primary file set
-       (set bug 1059 to fixed!)
-
-   [*] the IDE didn't read some compiler options correctly back from the
-       FP.CFG file, for ex. the linker options. Now it read everything
-       correctly, and also automatically handles smartlinking option synch-
-       ronization.
-       (set bug 1048 to fixed!)
-
-  Revision 1.1.2.1  2000/07/15 21:16:23  pierre
-   + some new texts
-
-  Revision 1.1  2000/07/13 09:48:36  michael
-  + Initial import
-
-  Revision 1.4  2000/06/16 08:50:42  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.3  2000/05/30 07:18:33  pierre
-   + colors for HTML help by Gabor
-
-  Revision 1.2  2000/05/29 10:44:57  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.1  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-
-}

+ 0 - 69
ide/text/fpstring.pas

@@ -1,69 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by Florian Klaempfl
-
-    Strings for menus, dialogs etc
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$i globdir.inc}
-{$ifdef USERESSTRINGS}{$mode objfpc}{$endif}
-unit fpstring;
-
-  interface
-
-    uses
-       fpconst;
-
-{$ifdef LANG_HUN}
-{$i fpstrh.inc}    { Hungarian language file }
-{$else}
- {$ifdef LANG_GER}
- {$i fpstrg.inc}    { German language file }
- {$else}
-   {$i fpstre.inc}  { English language file }
- {$endif}
-{$endif}
-
-  implementation
-
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:36  michael
-  + Initial import
-
-  Revision 1.4  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.3  2000/04/18 11:42:37  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.2  2000/02/07 08:29:13  michael
-  [*] the fake (!) TOKENS.PAS still contained the typo bug
-       FSplit(,n,d,e) (correctly FSplit(,d,n,e))
-  [*] CodeComplete had a very ugly bug - coordinates were document-relative
-      (instead of being screen-relative)
-  [*] TResourceStream didn't count the size of the resource names when
-      determining the file size and this could lead to the last resources not
-      loaded correctly
-
-
-  [+] Ctrl-Enter in editor now tries to open the file at cursor
-  [+] CodeComplete option added to Options|Environment|Editor
-  [+] user interface for managing CodeComplete implemented
-  [+] user interface for CodeTemplates implemented
-  [+] CodeComplete wordlist and CodeTemplates stored in desktop file
-  [+] help topic size no longer limited to 64KB when compiled with FPC
-
-  Revision 1.1  2000/01/23 21:25:17  florian
-    + start of internationalization support
-
-}

+ 0 - 1294
ide/text/fpswitch.pas

@@ -1,1294 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998-2000 by Berczi Gabor
-
-    Compiler switches routines for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit FPSwitch;
-
-interface
-
-uses
-  Objects,
-  Systems,
-  WUtils,
-  FPConst;
-
-const
-     MinMemSize      = 1024;     { min. local heap and stack size }
-     MaxMemSize      = 67107840; { max. local heap and stack size }
-
-type
-    TParamID =
-      (idNone,idAlign,idRangeChecks,idStackChecks,idIOChecks,
-       idOverflowChecks,idAsmDirect,idAsmATT,idAsmIntel,
-       idSymInfNone,idSymInfGlobalOnly,idSymInfGlobalLocal,
-       idStackSize,idHeapSize,idStrictVarStrings,idExtendedSyntax,
-       idMMXOps,idTypedAddress,idPackRecords,idPackEnum,idStackFrames,
-       idReferenceInfo,idDebugInfo,idBoolEval,
-       idLongString,idTypeInfo);
-
-    TSwitchMode = (om_Normal,om_Debug,om_Release);
-
-    TSwitchItemTyp = (ot_Select,ot_Boolean,ot_String,ot_Longint);
-
-    PSwitchItem = ^TSwitchItem;
-    TSwitchItem = object(TObject)
-      Typ       : TSwitchItemTyp;
-      Name      : string[50];
-      Param     : string[10];
-      ParamID   : TParamID;
-      constructor Init(const n,p:string; AID: TParamID);
-      function  NeedParam:boolean;virtual;
-      function  ParamValue:string;virtual;
-      function  ParamValueBool(SM: TSwitchMode):boolean;virtual;
-      function  GetSwitchStr(SM: TSwitchMode): string; virtual;
-      function  GetNumberStr(SM: TSwitchMode): string; virtual;
-      function  GetOptionStr(SM: TSwitchMode): string; virtual;
-      procedure Reset;virtual;
-    end;
-
-    PSelectItem = ^TSelectItem;
-    TSelectItem = object(TSwitchItem)
-      IsDefault : boolean;
-      constructor Init(const n,p:string; AID: TParamID);
-      { Select to avoid anything in config file }
-      constructor InitDefault(const n:string);
-    end;
-
-    PBooleanItem = ^TBooleanItem;
-    TBooleanItem = object(TSwitchItem)
-      IsSet : array[TSwitchMode] of boolean;
-      constructor Init(const n,p:string; AID: TParamID);
-      function  NeedParam:boolean;virtual;
-      procedure Reset;virtual;
-      function  GetSwitchStr(SM: TSwitchMode): string; virtual;
-      function  ParamValueBool(SM: TSwitchMode):boolean;virtual;
-    end;
-
-    PStringItem = ^TStringItem;
-    TStringItem = object(TSwitchItem)
-      Str : array[TSwitchMode] of string;
-      multiple : boolean;
-      constructor Init(const n,p:string;AID: TParamID; mult:boolean);
-      function  NeedParam:boolean;virtual;
-      function  ParamValue:string;virtual;
-      procedure Reset;virtual;
-    end;
-
-    PLongintItem = ^TLongintItem;
-    TLongintItem = object(TSwitchItem)
-      Val : array[TSwitchMode] of longint;
-      constructor Init(const n,p:string; AID: TParamID);
-      function  NeedParam:boolean;virtual;
-      function  ParamValue:string;virtual;
-      function  GetNumberStr(SM: TSwitchMode): string; virtual;
-      procedure Reset;virtual;
-    end;
-
-    PSwitches = ^TSwitches;
-    TSwitches = object
-      constructor Init(ch:char);
-      constructor InitSelect(ch:char);
-      destructor  Done;
-      { general items }
-      function  ItemCount:integer;
-      function  ItemName(index:integer):string;
-      function  ItemParam(index:integer):string;
-      { type specific }
-      procedure AddSelectItem(const name,param:string; AID: TParamID);
-      procedure AddDefaultSelect(const name:string);
-      procedure AddBooleanItem(const name,param:string; AID: TParamID);
-      procedure AddLongintItem(const name,param:string; AID: TParamID);
-      procedure AddStringItem(const name,param:string;AID: TParamID;mult:boolean);
-      function  GetCurrSel:integer;
-      function  GetCurrSelParam : String;
-      function  GetBooleanItem(index:integer):boolean;
-      function  GetLongintItem(index:integer):longint;
-      function  GetStringItem(index:integer):string;
-      procedure SetCurrSel(index:integer);
-      function  SetCurrSelParam(const s : String) : boolean;
-      procedure SetBooleanItem(index:integer;b:boolean);
-      procedure SetLongintItem(index:integer;l:longint);
-      procedure SetStringItem(index:integer;const s:string);
-      { read / write to cfgfile which must be open }
-      procedure WriteItemsCfg;
-      function  ReadItemsCfg(const s:string):boolean;
-    private
-      IsSel  : boolean;
-      Prefix : char;
-      SelNr  : array[TSwitchMode] of integer;
-      Items  : PCollection;
-    end;
-
-const
-    SwitchesMode : TSwitchMode = om_Normal;
-
-    SwitchesModeName : array[TSwitchMode] of string[10]=
-      ('~N~ormal','~D~ebug','~R~elease');
-    SwitchesModeStr : array[TSwitchMode] of string[8]=
-      ('NORMAL','DEBUG','RELEASE');
-    CustomArg : array[TSwitchMode] of string{$ifndef FPC}[128]{$endif}=
-      ('','','');
-
-var
-    LibLinkerSwitches,
-    DebugInfoSwitches,
-    LinkAfterSwitches,
-    ProfileInfoSwitches,
-    {MemorySizeSwitches, doubled !! }
-    SyntaxSwitches,
-    VerboseSwitches,
-    CodegenSwitches,
-    OptimizationSwitches,
-    OptimizingGoalSwitches,
-    ProcessorSwitches,
-    AsmReaderSwitches,
-    AsmInfoSwitches,
-    AsmOutputSwitches,
-    TargetSwitches,
-    ConditionalSwitches,
-    MemorySwitches,
-    BrowserSwitches,
-    DirectorySwitches : PSwitches;
-
-{ write/read the Switches to ppc.cfg file }
-procedure WriteSwitches(const fn:string);
-procedure ReadSwitches(const fn:string);
-
-{ initialize }
-procedure InitSwitches;
-procedure SetDefaultSwitches;
-procedure DoneSwitches;
-function  GetSourceDirectories : string;
-
-procedure GetCompilerOptionLines(C: PUnsortedStringCollection);
-
-implementation
-
-uses
-  Dos,
-  GlobType,
-  FPString,FPVars,FPUtils;
-
-var
-  CfgFile : text;
-
-{*****************************************************************************
-            TSwitchItem
-*****************************************************************************}
-
-constructor TSwitchItem.Init(const n,p:string; AID: TParamID);
-begin
-  Inherited Init;
-  Name:=n;
-  Param:=p;
-  ParamID:=AID;
-end;
-
-
-function TSwitchItem.NeedParam:boolean;
-begin
-  NeedParam:=false;
-end;
-
-
-function TSwitchItem.ParamValue:string;
-begin
-  ParamValue:='';
-end;
-
-function TSwitchItem.ParamValueBool(SM: TSwitchMode):boolean;
-begin
-  Abstract;
-  ParamValueBool:=false;
-end;
-
-function TSwitchItem.GetSwitchStr(SM: TSwitchMode): string;
-begin
-  Abstract;
-  GetSwitchStr:='';
-end;
-
-function TSwitchItem.GetNumberStr(SM: TSwitchMode): string;
-begin
-  Abstract;
-  GetNumberStr:='';
-end;
-
-function TSwitchItem.GetOptionStr(SM: TSwitchMode): string;
-begin
-  Abstract;
-  GetOptionStr:='';
-end;
-
-procedure TSwitchItem.Reset;
-begin
-end;
-
-
-{*****************************************************************************
-            TSelectItem
-*****************************************************************************}
-
-constructor TSelectItem.Init(const n,p:string; AID: TParamID);
-begin
-  Inherited Init(n,p,AID);
-  Typ:=ot_Select;
-  IsDefault:=false;
-end;
-
-constructor TSelectItem.InitDefault(const n:string);
-begin
-  Inherited Init(n,'',idNone);
-  Typ:=ot_Select;
-  IsDefault:=true;
-end;
-
-{*****************************************************************************
-                TBooleanItem
-*****************************************************************************}
-
-constructor TBooleanItem.Init(const n,p:string; AID: TParamID);
-begin
-  Inherited Init(n,p,AID);
-  Typ:=ot_Boolean;
-  Reset;
-end;
-
-
-function TBooleanItem.NeedParam:boolean;
-begin
-  NeedParam:=IsSet[SwitchesMode];
-end;
-
-
-procedure TBooleanItem.Reset;
-begin
-  FillChar(IsSet,sizeof(IsSet),0);
-end;
-
-function TBooleanItem.ParamValueBool(SM: TSwitchMode):boolean;
-begin
-  ParamValueBool:=IsSet[SM];
-end;
-
-function TBooleanItem.GetSwitchStr(SM: TSwitchMode): string;
-begin
-  GetSwitchStr:=BoolToStr(IsSet[SM],'+','-');
-end;
-
-
-{*****************************************************************************
-            TStringItem
-*****************************************************************************}
-
-constructor TStringItem.Init(const n,p:string; AID: TParamID; mult:boolean);
-begin
-  Inherited Init(n,p,AID);
-  Typ:=ot_String;
-  Multiple:=mult;
-  Reset;
-end;
-
-
-function TStringItem.NeedParam:boolean;
-begin
-  NeedParam:=(Str[SwitchesMode]<>'');
-end;
-
-
-function TStringItem.ParamValue:string;
-begin
-  ParamValue:=Str[SwitchesMode];
-end;
-
-
-procedure TStringItem.Reset;
-begin
-  FillChar(Str,sizeof(Str),0);
-end;
-
-
-{*****************************************************************************
-                TLongintItem
-*****************************************************************************}
-
-constructor TLongintItem.Init(const n,p:string; AID: TParamID);
-begin
-  Inherited Init(n,p,AID);
-  Typ:=ot_Longint;
-  Reset;
-end;
-
-
-function TLongintItem.NeedParam:boolean;
-begin
-  NeedParam:=(Val[SwitchesMode]<>0);
-end;
-
-
-function TLongintItem.ParamValue:string;
-var
-  s : string;
-begin
-  Str(Val[SwitchesMode],s);
-  ParamValue:=s;
-end;
-
-procedure TLongintItem.Reset;
-begin
-  FillChar(Val,sizeof(Val),0);
-end;
-
-function TLongintItem.GetNumberStr(SM: TSwitchMode): string;
-begin
-  GetNumberStr:=IntToStr(Val[SM]);
-end;
-
-
-{*****************************************************************************
-               TSwitch
-*****************************************************************************}
-
-constructor TSwitches.Init(ch:char);
-begin
-  new(Items,Init(10,5));
-  Prefix:=ch;
-  FillChar(SelNr,SizeOf(SelNr),#0);
-  IsSel:=false;
-end;
-
-
-constructor TSwitches.InitSelect(ch:char);
-begin
-  new(Items,Init(10,5));
-  Prefix:=ch;
-  FillChar(SelNr,SizeOf(SelNr),#0);
-  IsSel:=true;
-end;
-
-
-destructor  TSwitches.Done;
-begin
-  dispose(Items,Done);
-end;
-
-
-procedure TSwitches.AddSelectItem(const name,param:string; AID: TParamID);
-begin
-  Items^.Insert(New(PSelectItem,Init(name,Param,AID)));
-end;
-
-
-procedure TSwitches.AddDefaultSelect(const name:string);
-begin
-  Items^.Insert(New(PSelectItem,InitDefault(name)));
-end;
-
-
-procedure TSwitches.AddBooleanItem(const name,param:string; AID: TParamID);
-begin
-  Items^.Insert(New(PBooleanItem,Init(name,Param,AID)));
-end;
-
-
-procedure TSwitches.AddLongintItem(const name,param:string; AID: TParamID);
-begin
-  Items^.Insert(New(PLongintItem,Init(name,Param,AID)));
-end;
-
-
-procedure TSwitches.AddStringItem(const name,param:string;AID: TParamID;mult:boolean);
-begin
-  Items^.Insert(New(PStringItem,Init(name,Param,AID,mult)));
-end;
-
-
-function TSwitches.ItemCount:integer;
-begin
-  ItemCount:=Items^.Count;
-end;
-
-
-function TSwitches.ItemName(index:integer):string;
-var
-  P : PSwitchItem;
-begin
-  P:=Items^.At(Index);
-  if assigned(P) then
-   ItemName:=P^.Name
-  else
-   ItemName:='';
-end;
-
-
-function TSwitches.ItemParam(index:integer):string;
-var
-  P : PSwitchItem;
-begin
-  P:=Items^.At(Index);
-  if assigned(P) then
-   ItemParam:='-'+Prefix+P^.Param
-  else
-   ItemParam:='';
-end;
-
-
-function TSwitches.GetBooleanItem(index:integer):boolean;
-var
-  P : PBooleanItem;
-begin
-  P:=Items^.At(Index);
-  if assigned(P) and (P^.Typ=ot_boolean) then
-   GetBooleanItem:=P^.IsSet[SwitchesMode]
-  else
-   GetBooleanItem:=false;
-end;
-
-
-function TSwitches.GetLongintItem(index:integer):longint;
-var
-  P : PLongintItem;
-begin
-  P:=Items^.At(Index);
-  if assigned(P) and (P^.Typ=ot_longint) then
-   GetLongintItem:=P^.Val[SwitchesMode]
-  else
-   GetLongintItem:=0;
-end;
-
-
-function TSwitches.GetStringItem(index:integer):string;
-var
-  P : PStringItem;
-begin
-  P:=Items^.At(Index);
-  if assigned(P) and (P^.Typ=ot_string) then
-   GetStringItem:=P^.Str[SwitchesMode]
-  else
-   GetStringItem:='';
-end;
-
-
-procedure TSwitches.SetBooleanItem(index:integer;b:boolean);
-var
-  P : PBooleanItem;
-begin
-  P:=Items^.At(Index);
-  if assigned(P) and (P^.Typ=ot_boolean) then
-   P^.IsSet[SwitchesMode]:=b;
-end;
-
-
-procedure TSwitches.SetLongintItem(index:integer;l:longint);
-var
-  P : PLongintItem;
-begin
-  P:=Items^.At(Index);
-  if assigned(P) and (P^.Typ=ot_longint) then
-   P^.Val[SwitchesMode]:=l;
-end;
-
-
-procedure TSwitches.SetStringItem(index:integer;const s:string);
-var
-  P : PStringItem;
-begin
-  P:=Items^.At(Index);
-  if assigned(P) and (P^.Typ=ot_string) then
-   P^.Str[SwitchesMode]:=s;
-end;
-
-
-function TSwitches.GetCurrSel:integer;
-begin
-  if IsSel then
-   GetCurrSel:=SelNr[SwitchesMode]
-  else
-   GetCurrSel:=-1;
-end;
-
-
-function  TSwitches.GetCurrSelParam : String;
-begin
-  if IsSel then
-    GetCurrSelParam:=PSwitchItem(Items^.At(SelNr[SwitchesMode]))^.Param
-  else
-    GetCurrSelParam:='';
-end;
-
-procedure TSwitches.SetCurrSel(index:integer);
-begin
-  if IsSel then
-   SelNr[SwitchesMode]:=index;
-end;
-
-function  TSwitches.SetCurrSelParam(const s : String) : boolean;
-  function checkitem(P:PSwitchItem):boolean;{$ifndef FPC}far;{$endif}
-  begin
-    { empty items are not equivalent to others !! }
-    CheckItem:=((S='') and (P^.Param='')) or
-               ((Length(S)>0) and (P^.Param=s));
-  end;
-
-var
-  FoundP : PSwitchItem;
-begin
-  FoundP:=Items^.FirstThat(@CheckItem);
-  if Assigned(FoundP) then
-    begin
-      SetCurrSelParam:=true;
-      SelNr[SwitchesMode]:=Items^.IndexOf(FoundP);
-    end
-  else
-    SetCurrSelParam:=false;
-end;
-
-
-procedure TSwitches.WriteItemsCfg;
-var
-  Pref : char;
-
-  procedure writeitem(P:PSwitchItem);{$ifndef FPC}far;{$endif}
-  var
-    s,s1 : string;
-    i,j : integer;
-  begin
-    if P^.NeedParam then
-     begin
-       if (P^.Typ=ot_string) and (PStringItem(P)^.Multiple) then
-         begin
-           s:=PStringItem(P)^.Str[SwitchesMode];
-           repeat
-             i:=pos(';',s);
-             j:=pos(' ',s);
-             if i=0 then
-              i:=256;
-             if (j>0) and (j<i) then
-               i:=j;
-             s1:=Copy(s,1,i-1);
-             if s1<>'' then
-              writeln(CfgFile,' -'+Pref+P^.Param+s1);
-             Delete(s,1,i);
-           until s='';
-         end
-       else
-         Writeln(CfgFile,' -'+Pref+P^.Param+P^.ParamValue);
-     end;
-  end;
-
-var
-  P : PSelectItem;
-begin
-  Pref:=Prefix;
-  if IsSel then
-    begin
-      P:=Items^.At(SelNr[SwitchesMode]);
-      if not P^.IsDefault then
-        writeln(CfgFile,' '+ItemParam(SelNr[SwitchesMode]));
-    end
-  else
-    Items^.ForEach(@writeitem);
-end;
-
-procedure WriteCustom;
-var
-  s : string;
-  i : longint;
-begin
-  s:=CustomArg[SwitchesMode];
-  While s<>'' do
-    begin
-       i:=pos(' ',s);
-       if i=0 then i:=256;
-       writeln(CfgFile,' '+Copy(s,1,i-1));
-       if i=256 then
-         s:=''
-       else
-         s:=copy(s,i+1,255);
-    end;
-end;
-
-
-function TSwitches.ReadItemsCfg(const s:string):boolean;
-
-  function checkitem(P:PSwitchItem):boolean;{$ifndef FPC}far;{$endif}
-  begin
-    { empty items are not equivalent to others !! }
-    { but -dGDB didn't work because of this PM }
-    CheckItem:=((P^.Param='') and ((S='') or (P^.typ=ot_String))) or
-               ((Length(P^.Param)>0) and (P^.Param=Copy(s,1,length(P^.Param))));
-  end;
-
-var
-  FoundP : PSwitchItem;
-  code : integer;
-begin
-  FoundP:=Items^.FirstThat(@checkitem);
-  if assigned(FoundP) then
-   begin
-     case FoundP^.Typ of
-      ot_Select  : SelNr[SwitchesMode]:=Items^.IndexOf(FoundP);
-      ot_Boolean : PBooleanItem(FoundP)^.IsSet[SwitchesMode]:=true;
-      ot_String  : begin
-           if (PStringItem(FoundP)^.Multiple) and (PStringItem(FoundP)^.Str[SwitchesMode]<>'') then
-            PStringItem(FoundP)^.Str[SwitchesMode]:=PStringItem(FoundP)^.Str[SwitchesMode]+';'+
-              Copy(s,length(FoundP^.Param)+1,255)
-           else
-            PStringItem(FoundP)^.Str[SwitchesMode]:=Copy(s,length(FoundP^.Param)+1,255);
-         end;
-      ot_Longint : Val(Copy(s,length(FoundP^.Param)+1,255),PLongintItem(FoundP)^.Val[SwitchesMode],code);
-     end;
-     ReadItemsCfg:=true;
-   end
-  else
-   ReadItemsCfg:=false;
-end;
-
-
-{*****************************************************************************
-             Read / Write
-*****************************************************************************}
-
-procedure WriteSwitches(const fn:string);
-var
-  OldSwitchesMode : TSwitchMode;
-begin
-{ create the switches }
-  assign(CfgFile,fn);
-  {$I-}
-   rewrite(CfgFile);
-  {$I+}
-  if ioresult<>0 then
-   exit;
-  writeln(CfgFile,'# '+msg_automaticallycreateddontedit);
-  OldSwitchesMode:=SwitchesMode;
-  for SwitchesMode:=low(TSwitchMode) to high(TSwitchMode) do
-   begin
-     Writeln(CfgFile,'#IFDEF '+SwitchesModeStr[SwitchesMode]);
-     TargetSwitches^.WriteItemsCfg;
-     VerboseSwitches^.WriteItemsCfg;
-     SyntaxSwitches^.WriteItemsCfg;
-     CodegenSwitches^.WriteItemsCfg;
-     OptimizationSwitches^.WriteItemsCfg;
-     OptimizingGoalSwitches^.WriteItemsCfg;
-     ProcessorSwitches^.WriteItemsCfg;
-     AsmReaderSwitches^.WriteItemsCfg;
-     AsmInfoSwitches^.WriteItemsCfg;
-     AsmOutputSwitches^.WriteItemsCfg;
-     DirectorySwitches^.WriteItemsCfg;
-     MemorySwitches^.WriteItemsCfg;
-     ConditionalSwitches^.WriteItemsCfg;
-     LibLinkerSwitches^.WriteItemsCfg;
-     DebugInfoSwitches^.WriteItemsCfg;
-     ProfileInfoSwitches^.WriteItemsCfg;
-     LinkAfterSwitches^.WriteItemsCfg;
-     BrowserSwitches^.WriteItemsCfg;
-     {MemorySizeSwitches^.WriteItemsCfg;}
-     WriteCustom;
-     Writeln(CfgFile,'#ENDIF');
-     Writeln(CfgFile,'');
-   end;
-  close(CfgFile);
-  SwitchesMode:=OldSwitchesMode;
-end;
-
-
-procedure ReadSwitches(const fn:string);
-var
-  c : char;
-  s : string;
-  res : boolean;
-  OldSwitchesMode,i : TSwitchMode;
-begin
-  assign(CfgFile,fn);
-  {$I-}
-   reset(CfgFile);
-  {$I+}
-  if ioresult<>0 then
-   begin
-     SetDefaultSwitches;
-     exit;
-   end;
-  OldSwitchesMode:=SwitchesMode;
-  SwitchesMode:=om_Normal;
-  while not eof(CfgFile) do
-   begin
-     readln(CfgFile,s);
-     s:=LTrim(s);
-     if (length(s)>=2) and (s[1]='-') then
-      begin
-      c:=s[2];
-      res:=false;
-      Delete(s,1,2);
-      case c of
-       'a' : res:=AsmInfoSwitches^.ReadItemsCfg(s);
-       'A' : res:=AsmOutputSwitches^.ReadItemsCfg(s);
-       'b' : res:=BrowserSwitches^.ReadItemsCfg(s);
-       'C' : begin
-               res:=CodegenSwitches^.ReadItemsCfg(s);
-               if not res then
-                 res:=MemorySwitches^.ReadItemsCfg(s);
-             end;
-       'd' : res:=ConditionalSwitches^.ReadItemsCfg(s);
-       'F' : res:=DirectorySwitches^.ReadItemsCfg(s);
-       'g' : res:=DebugInfoSwitches^.ReadItemsCfg(s);
-       'O' : begin
-               res:=true;
-               if not OptimizationSwitches^.ReadItemsCfg(s) then
-                 if not ProcessorSwitches^.ReadItemsCfg(s) then
-                   res:=OptimizingGoalSwitches^.ReadItemsCfg(s);
-             end;
-       'p' : res:=ProfileInfoSwitches^.ReadItemsCfg(s);
-       's' : res:=LinkAfterSwitches^.ReadItemsCfg(s);
-       'R' : res:=AsmReaderSwitches^.ReadItemsCfg(s);
-       'S' : res:=SyntaxSwitches^.ReadItemsCfg(s);
-       'T' : res:=TargetSwitches^.ReadItemsCfg(s);
-       'v' : res:=VerboseSwitches^.ReadItemsCfg(s);
-       'X' : res:=LibLinkerSwitches^.ReadItemsCfg(s);
-       end;
-      { keep all others as a string }
-      if not res then
-       CustomArg[SwitchesMode]:=CustomArg[SwitchesMode]+' -'+c+s;
-      end
-     else
-      if (Copy(s,1,7)='#IFDEF ') then
-       begin
-         Delete(s,1,7);
-         for i:=low(TSwitchMode) to high(TSwitchMode) do
-         if s=SwitchesModeStr[i] then
-           begin
-             SwitchesMode:=i;
-             break;
-           end;
-       end
-      else;
-   end;
-  close(CfgFile);
-  SwitchesMode:=OldSwitchesMode;
-end;
-
-
-function  GetSourceDirectories : string;
-var
-  P : PStringItem;
-  S : String;
-  c : char;
-  function checkitem(P:PSwitchItem):boolean;{$ifndef FPC}far;{$endif}
-  begin
-    CheckItem:=(P^.Typ=ot_string) and (P^.Param=c);
-  end;
-begin
-  GetSourceDirectories:='';
-  c:='u';
-  P:=DirectorySwitches^.Items^.FirstThat(@CheckItem);
-  S:='';
-  if assigned(P) then
-    S:=P^.Str[SwitchesMode];
-  c:='i';
-  P:=DirectorySwitches^.Items^.FirstThat(@CheckItem);
-  if assigned(P) then
-    S:=P^.Str[SwitchesMode]+';'+S;
-  if S='' then
-    GetSourceDirectories:=SourceDirs+';'
-  else
-    GetSourceDirectories:=SourceDirs+';'+S+';';
-end;
-
-{*****************************************************************************
-             Initialize
-*****************************************************************************}
-
-procedure InitSwitches;
-
-begin
-  New(SyntaxSwitches,Init('S'));
-  with SyntaxSwitches^ do
-   begin
-     AddBooleanItem(opt_delphi2extensions,'2',idNone);
-     AddBooleanItem(opt_clikeoperators,'c',idNone);
-     AddBooleanItem(opt_stopafterfirsterror,'e',idNone);
-     AddBooleanItem(opt_allowlabelandgoto,'g',idNone);
-     AddBooleanItem(opt_cplusplusstyledinline,'i',idNone);
-     AddBooleanItem(opt_globalcmacros,'m',idNone);
-     AddBooleanItem(opt_tp7compatibility,'o',idNone);
-     AddBooleanItem(opt_delphicompatibility,'d',idNone);
-     AddBooleanItem(opt_allowstaticinobjects,'s',idNone);
-     AddBooleanItem(opt_strictvarstrings,'',idStrictVarStrings);
-     AddBooleanItem(opt_extendedsyntax,'',idExtendedSyntax);
-     AddBooleanItem(opt_allowmmxoperations,'',idMMXOps);
-   end;
-  New(VerboseSwitches,Init('v'));
-  with VerboseSwitches^ do
-   begin
-     AddBooleanItem(opt_warnings,'w',idNone);
-     AddBooleanItem(opt_notes,'n',idNone);
-     AddBooleanItem(opt_hints,'h',idNone);
-     AddBooleanItem(opt_generalinfo,'i',idNone);
-     AddBooleanItem(opt_usedtriedinfo,'ut',idNone);
-     AddBooleanItem(opt_all,'a',idNone);
-     AddBooleanItem(opt_showallprocsonerror,'b',idNone);
-   end;
-  New(CodegenSwitches,Init('C'));
-  with CodegenSwitches^ do
-   begin
-     AddBooleanItem(opt_rangechecking,'r',idRangeChecks);
-     AddBooleanItem(opt_stackchecking,'t',idStackChecks);
-     AddBooleanItem(opt_iochecking,'i',idIOChecks);
-     AddBooleanItem(opt_overflowchecking,'o',idOverflowChecks);
-   end;
-  New(OptimizingGoalSwitches,InitSelect('O'));
-  with OptimizingGoalSwitches^ do
-    begin
-       AddSelectItem(opt_generatefastercode,'G',idNone);
-       AddSelectItem(opt_generatesmallercode,'g',idNone);
-    end;
-  New(OptimizationSwitches,Init('O'));
-  with OptimizationSwitches^ do
-   begin
-     AddBooleanItem(opt_useregistervariables,'r',idNone);
-     AddBooleanItem(opt_uncertainoptimizations,'u',idNone);
-     AddBooleanItem(opt_level1optimizations,'1',idNone);
-     AddBooleanItem(opt_level2optimizations,'2',idNone);
-   end;
-  New(ProcessorSwitches,InitSelect('O'));
-  with ProcessorSwitches^ do
-   begin
-     AddSelectItem(opt_i386486,'p1',idNone);
-     AddSelectItem(opt_pentiumandmmx,'p2',idNone);
-     AddSelectItem(opt_pentiumpro,'p3',idNone);
-   end;
-  New(TargetSwitches,InitSelect('T'));
-  with TargetSwitches^ do
-   begin
-     AddSelectItem('DOS (GO32V~1~)','go32v1',idNone);
-     AddSelectItem('~D~OS (GO32V2)','go32v2',idNone);
-     AddSelectItem('~L~inux','linux',idNone);
-     AddSelectItem('~O~S/2','os2',idNone);
-     AddSelectItem('~W~IN32','win32',idNone);
-   end;
-  New(AsmReaderSwitches,InitSelect('R'));
-  with AsmReaderSwitches^ do
-   begin
-     AddSelectItem(opt_directassembler,'direct',idAsmDirect);
-     AddSelectItem(opt_attassembler,'att',idAsmATT);
-     AddSelectItem(opt_intelassembler,'intel',idAsmIntel);
-   end;
-  New(AsmInfoSwitches,Init('a'));
-  with AsmInfoSwitches^ do
-   begin
-     AddBooleanItem(opt_listsource,'l',idNone);
-     AddBooleanItem(opt_listregisterallocation,'r',idNone);
-     AddBooleanItem(opt_listtempallocation,'t',idNone);
-   end;
-  New(AsmOutputSwitches,InitSelect('A'));
-  with AsmOutputSwitches^ do
-   begin
-     AddDefaultSelect(opt_usedefaultas);
-     AddSelectItem(opt_usegnuas,'as',idNone);
-     AddSelectItem(opt_usenasmcoff,'nasmcoff',idNone);
-     AddSelectItem(opt_usenasmelf,'nasmelf',idNone);
-     AddSelectItem(opt_usenasmobj,'nasmobj',idNone);
-     AddSelectItem(opt_usemasm,'masm',idNone);
-     AddSelectItem(opt_usetasm,'tasm',idNone);
-     AddSelectItem(opt_usecoff,'coff',idNone);
-     AddSelectItem(opt_usepecoff,'pecoff',idNone);
-   end;
-  New(BrowserSwitches,InitSelect('b'));
-  with BrowserSwitches^ do
-   begin
-     AddSelectItem(opt_nobrowser,'-',idSymInfNone);
-     AddSelectItem(opt_globalonlybrowser,'+',idSymInfGlobalOnly);
-     AddSelectItem(opt_localglobalbrowser,'l',idSymInfGlobalLocal);
-   end;
-  New(ConditionalSwitches,Init('d'));
-  with ConditionalSwitches^ do
-   begin
-     AddStringItem(opt_conditionaldefines,'',idNone,true);
-   end;
-  New(MemorySwitches,Init('C'));
-  with MemorySwitches^ do
-   begin
-     AddLongintItem(opt_stacksize,'s',idStackSize);
-     AddLongintItem(opt_heapsize,'h',idHeapSize);
-   end;
-  New(DirectorySwitches,Init('F'));
-  with DirectorySwitches^ do
-   begin
-     AddStringItem(opt_unitdirectories,'u',idNone,true);
-     AddStringItem(opt_includedirectories,'i',idNone,true);
-     AddStringItem(opt_librarydirectories,'l',idNone,true);
-     AddStringItem(opt_objectdirectories,'o',idNone,true);
-     AddStringItem(opt_exeppudirectories,'E',idNone,true);
-   end;
-
-  New(LibLinkerSwitches,InitSelect('X'));
-  with LibLinkerSwitches^ do
-   begin
-     AddDefaultSelect(opt_librariesdefault);
-     AddSelectItem(opt_dynamiclibraries,'D',idNone);
-     AddSelectItem(opt_staticlibraries,'S',idNone);
-     AddSelectItem(opt_smartlibraries,'X',idNone);
-   end;
-  New(DebugInfoSwitches,InitSelect('g'));
-  with DebugInfoSwitches^ do
-   begin
-     AddSelectItem(opt_stripalldebugsymbols,'-',idNone);
-     AddSelectItem(opt_gendebugsymbolinfo,'',idNone);
-     AddSelectItem(opt_gensymbolandbacktraceinfo,'l',idNone);
-     { AddSelectItem('Generate ~d~bx symbol information','d');
-       does not work anyhow (PM) }
-   end;
-  New(LinkAfterSwitches,Init('s'));
-  LinkAfterSwitches^.AddBooleanItem(opt_linkafter,'',idNone);
-  New(ProfileInfoSwitches,InitSelect('p'));
-  with ProfileInfoSwitches^ do
-   begin
-     AddSelectItem(opt_noprofileinfo,'-',idNone);
-     AddSelectItem(opt_gprofinfo,'g',idNone);
-   end;
-  {New(MemorySizeSwitches,Init('C'));
-  with MemorySizeSwitches^ do
-   begin
-     AddLongIntItem('~S~tack size','s');
-     AddLongIntItem('Local ~h~eap size','h');
-   end;}
-  SwitchesPath:=LocateFile(SwitchesName);
-  if SwitchesPath='' then
-    SwitchesPath:=SwitchesName;
-  SwitchesPath:=FExpand(SwitchesPath);
-end;
-
-procedure SetDefaultSwitches;
-var
-   i,OldSwitchesMode : TSwitchMode;
-
-begin
-  { setup some useful defaults }
-  OldSwitchesMode:=SwitchesMode;
-  for i:=low(TSwitchMode) to high(TSwitchMode) do
-    begin
-       SwitchesMode:=i;
-       { default is Pentium }
-       ProcessorSwitches^.SetCurrSel(1);
-       { AT&T reader }
-       AsmReaderSwitches^.SetCurrSel(1);
-       { 128k stack }
-       MemorySwitches^.SetLongintItem(0,65536*2);
-       { 2 MB heap }
-       MemorySwitches^.SetLongintItem(1,1024*1024*2);
-       { goto/lable allowed }
-       SyntaxSwitches^.SetBooleanItem(3,true);
-       case i of
-          om_debug:
-            begin
-               { debugging info on }
-               DebugInfoSwitches^.SetCurrSel(1);
-               { range checking }
-               CodegenSwitches^.SetBooleanItem(0,true);
-               { io checking }
-               CodegenSwitches^.SetBooleanItem(2,true);
-               { overflow checking }
-               CodegenSwitches^.SetBooleanItem(3,true);
-            end;
-          om_normal:
-            begin
-               OptimizationSwitches^.SetBooleanItem(2,true);
-            end;
-          om_release:
-            begin
-               OptimizationSwitches^.SetBooleanItem(2,true);
-               OptimizationSwitches^.SetBooleanItem(3,true);
-            end;
-       end;
-       { set appriopriate default target }
-{$ifdef go32v2}
-       TargetSwitches^.SetCurrSel(1);
-{$endif}
-{$ifdef Linux}
-       TargetSwitches^.SetCurrSel(2);
-{$endif}
-{$ifdef win32}
-       TargetSwitches^.SetCurrSel(4);
-{$endif}
-{$ifdef os2}
-       TargetSwitches^.SetCurrSel(3);
-{$endif}
-    end;
-  SwitchesMode:=OldSwitchesMode;
-end;
-
-procedure DoneSwitches;
-begin
-  dispose(SyntaxSwitches,Done);
-  dispose(VerboseSwitches,Done);
-  dispose(CodegenSwitches,Done);
-  dispose(OptimizationSwitches,Done);
-  dispose(OptimizingGoalSwitches,Done);
-  dispose(ProcessorSwitches,Done);
-  dispose(BrowserSwitches,Done);
-  dispose(TargetSwitches,Done);
-  dispose(AsmReaderSwitches,Done);
-  dispose(ConditionalSwitches,Done);
-  dispose(MemorySwitches,Done);
-  {dispose(MemorySizeSwitches,Done);}
-  dispose(DirectorySwitches,Done);
-  dispose(DebugInfoSwitches,Done);
-  dispose(LibLinkerSwitches,Done);
-  dispose(ProfileInfoSwitches,Done);
-
-end;
-
-procedure GetCompilerOptionLines(C: PUnsortedStringCollection);
-procedure AddLine(const S: string);
-begin
-  C^.Insert(NewStr(S));
-end;
-procedure ConstructSwitchModeDirectives(SM: TSwitchMode; const IfDefSym: string);
-var SwitchParams: PStringCollection;
-    MiscParams  : PStringCollection;
-procedure AddSwitch(const S: string);
-begin
-  SwitchParams^.Insert(NewStr(S));
-end;
-procedure AddParam(const S: string);
-begin
-  MiscParams^.Insert(NewStr(S));
-end;
-procedure EnumSwitches(P: PSwitches);
-procedure HandleSwitch(P: PSwitchItem); {$ifndef FPC}far;{$endif}
-begin
-  case P^.ParamID of
-{    idAlign :}
-    idRangeChecks    : AddSwitch('R'+P^.GetSwitchStr(SM));
-    idStackChecks    : AddSwitch('S'+P^.GetSwitchStr(SM));
-    idIOChecks       : AddSwitch('I'+P^.GetSwitchStr(SM));
-    idOverflowChecks : AddSwitch('Q'+P^.GetSwitchStr(SM));
-{    idAsmDirect      : if P^.GetParamValueBool[SM] then AddParam('ASMMODE DIRECT');
-    idAsmATT         : if P^.GetParamValueBool[SM] then AddParam('ASMMODE ATT');
-    idAsmIntel       : if P^.GetParamValueBool[SM] then AddParam('ASMMODE INTEL');}
-{    idSymInfNone     : ;
-    idSymInfGlobalOnly:;
-    idSymInfGlobalLocal:if P^.ParamValueBool(SM) then AddSwitch('L+');}
-{    idStackSize
-    idHeapSize}
-    idStrictVarStrings: AddSwitch('V'+P^.GetSwitchStr(SM));
-    idExtendedSyntax  : AddSwitch('X'+P^.GetSwitchStr(SM));
-    idMMXOps          : if P^.ParamValueBool(SM) then AddParam('MMX');
-    idTypedAddress    : AddSwitch('T'+P^.GetSwitchStr(SM));
-{    idPackRecords
-    idPackEnum}
-    idStackFrames     : AddSwitch('W'+P^.GetSwitchStr(SM));
-    idReferenceInfo   : AddSwitch('Y'+P^.GetSwitchStr(SM));
-    idDebugInfo       : AddSwitch('D'+P^.GetSwitchStr(SM));
-    idBoolEval        : AddSwitch('B'+P^.GetSwitchStr(SM));
-    idLongString      : AddSwitch('H'+P^.GetSwitchStr(SM));
-    idTypeInfo        : AddSwitch('M'+P^.GetSwitchStr(SM));
-   end;
-end;
-begin
-  P^.Items^.ForEach(@HandleSwitch);
-end;
-var I: integer;
-    S: string;
-begin
-  AddLine('{$IFDEF '+IfDefSym+'}');
-  New(SwitchParams, Init(10,10));
-  New(MiscParams, Init(10,10));
-  EnumSwitches(LibLinkerSwitches);
-  EnumSwitches(DebugInfoSwitches);
-  EnumSwitches(ProfileInfoSwitches);
-  EnumSwitches(SyntaxSwitches);
-  EnumSwitches(VerboseSwitches);
-  EnumSwitches(CodegenSwitches);
-  EnumSwitches(OptimizationSwitches);
-  EnumSwitches(OptimizingGoalSwitches);
-  EnumSwitches(ProcessorSwitches);
-  EnumSwitches(AsmReaderSwitches);
-  EnumSwitches(AsmInfoSwitches);
-  EnumSwitches(AsmOutputSwitches);
-  EnumSwitches(TargetSwitches);
-  EnumSwitches(ConditionalSwitches);
-  EnumSwitches(MemorySwitches);
-  EnumSwitches(BrowserSwitches);
-  EnumSwitches(DirectorySwitches);
-  S:='';
-  for I:=0 to SwitchParams^.Count-1 do
-  begin
-    if I=0 then S:='{$' else S:=S+',';
-    S:=S+PString(SwitchParams^.At(I))^;
-  end;
-  if S<>'' then S:=S+'}';
-  if S<>'' then AddLine('  '+S);
-  for I:=0 to MiscParams^.Count-1 do
-    AddLine('  {$'+PString(MiscParams^.At(I))^+'}');
-  Dispose(SwitchParams, Done); Dispose(MiscParams, Done);
-  AddLine('{$ENDIF '+IfDefSym+'}');
-end;
-var SM: TSwitchMode;
-begin
-  for SM:=Low(TSwitchMode) to High(TSwitchMode) do
-    ConstructSwitchModeDirectives(SM,SwitchesModeStr[SM]);
-end;
-
-
-end.
-{
-  $Log$
-  Revision 1.4  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.6  2000/11/14 17:40:44  pierre
-   + External linking now optional
-
-  Revision 1.1.2.5  2000/11/14 09:40:35  marco
-   * Third batch renamefest
-
-  Revision 1.3  2000/10/31 22:35:55  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.4  2000/10/26 10:17:10  pierre
-   * fix reading of -dGDB switch in cfg file
-
-  Revision 1.2  2000/08/22 09:41:40  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.3  2000/08/04 14:05:19  michael
-  * Fixes from Gabor:
-   [*] the IDE now doesn't disable Compile|Make & Build when all windows
-       are closed, but there's still a primary file set
-       (set bug 1059 to fixed!)
-
-   [*] the IDE didn't read some compiler options correctly back from the
-       FP.CFG file, for ex. the linker options. Now it read everything
-       correctly, and also automatically handles smartlinking option synch-
-       ronization.
-       (set bug 1048 to fixed!)
-
-  Revision 1.1.2.2  2000/07/15 21:38:47  pierre
-   + Add default selection that does not write anything to config file
-   + Add smart link
-
-  Revision 1.1.2.1  2000/07/15 21:30:06  pierre
-  * Wrong commit text
-
-  Revision 1.1  2000/07/13 09:48:36  michael
-  + Initial import
-
-  Revision 1.23  2000/06/22 09:07:12  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.22  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.21  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.20  2000/03/08 16:51:50  pierre
-   + -gl option support
-
-  Revision 1.19  2000/03/07 22:52:50  pierre
-   + Assembler tab in Options|Compiler
-
-  Revision 1.18  2000/03/07 21:17:29  pierre
-   +ASMInfoSwitches AsmOutputSwitches
-
-  Revision 1.17  2000/02/04 14:34:47  pierre
-  readme.txt
-
-  Revision 1.16  2000/02/04 00:05:20  pierre
-   * -Fi must also be used for GetSourceDirectories
-
-  Revision 1.15  2000/01/10 15:52:53  pierre
-    * use default command line switches only if fp.cfg not found
-
-  Revision 1.14  1999/10/14 14:22:23  florian
-    * if no ini file is found the ide uses some useful defaults
-
-  Revision 1.13  1999/04/29 09:36:12  peter
-    * fixed hotkeys with Compiler switches
-    * fixed compiler status dialog
-    * Run shows again the output
-
-  Revision 1.12  1999/03/23 15:11:34  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.11  1999/03/12 01:14:01  peter
-    * flag if trytoopen should look for other extensions
-    + browser tab in the tools-compiler
-
-  Revision 1.10  1999/02/16 12:46:38  pierre
-   * String items can also be separated by spaces
-
-  Revision 1.9  1999/02/10 09:45:55  pierre
-    * MemorySizeSwitches Removed (was duplicate of MemorySwitches !)
-    * Added missing disposes at exit
-
-  Revision 1.8  1999/02/08 17:38:52  pierre
-   + added CustomArg
-
-  Revision 1.7  1999/02/06 00:07:48  florian
-    * speed/size optimization is now a radio button
-
-  Revision 1.6  1999/02/05 13:51:44  peter
-    * unit name of FPSwitches -> FPSwitch which is easier to use
-    * some fixes for tp7 compiling
-
-  Revision 1.5  1999/02/05 12:12:00  pierre
-    + SourceDir that stores directories for sources that the
-      compiler should not know about
-      Automatically asked for addition when a new file that
-      needed filedialog to be found is in an unknown directory
-      Stored and retrieved from INIFile
-    + Breakpoints conditions added to INIFile
-    * Breakpoints insterted and removed at debin and end of debug session
-
-  Revision 1.4  1999/02/04 13:32:10  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.3  1999/01/12 14:29:39  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.2  1999/01/04 11:49:50  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.1  1998/12/28 15:47:52  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-}

+ 0 - 1833
ide/text/fpsymbol.pas

@@ -1,1833 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Symbol browse support routines for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$i globdir.inc}
-unit FPSymbol;
-
-interface
-
-uses Objects,Drivers,Views,Menus,Dialogs,Outline,
-     BrowCol,
-     WViews,
-     FPViews;
-
-const
-      { Browser tab constants }
-      btScope       = 0;
-      btReferences  = 1;
-      btInheritance = 2;
-      btMemInfo     = 3;
-      btUnitInfo    = 4;
-      btBreakWatch  = 7;
-
-type
-    PBrowserWindow = ^TBrowserWindow;
-
-    PGDBValueCollection = ^TGDBValueCollection;
-
-    PGDBValue = ^TGDBValue;
-    TGDBValue = Object(TObject)
-      constructor Init(Const AExpr : String;ASym : PSymbol);
-      procedure GetValue;
-      function  GetText : String;
-      destructor Done;virtual;
-    private
-      expr : Pstring;
-      St   : Pstring;
-      S    : PSymbol;
-      GDBI : longint;
-      end;
-
-    TGDBValueCollection = Object(TCollection)
-      function  At(Index: sw_Integer): PGDBValue;
-      end;
-
-
-    PSymbolView = ^TSymbolView;
-    TSymbolView = object(TLocalMenuListBox)
-      constructor  Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-      procedure    HandleEvent(var Event: TEvent); virtual;
-      procedure    SetState(AState: Word; Enable: Boolean); virtual;
-      function     GotoItem(Item: sw_integer): boolean; virtual;
-      function     TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
-      function     GetPalette: PPalette; virtual;
-      function     GetLocalMenu: PMenu; virtual;
-      procedure    ClearHighlights;
-      procedure    AutoTrackSource; virtual;
-      procedure    Browse; virtual;
-      procedure    GotoSource; virtual;
-      procedure    TrackSource; virtual;
-      procedure    OptionsDlg; virtual;
-    private
-      MyBW         : PBrowserWindow;
-      function     TrackReference(R: PReference; AutoTrack: boolean): boolean; virtual;
-      function     GotoReference(R: PReference): boolean; virtual;
-    end;
-
-    PSymbolScopeView = ^TSymbolScopeView;
-    TSymbolScopeView = object(TSymbolView)
-      constructor Init(var Bounds: TRect; ASymbols: PSymbolCollection; AHScrollBar, AVScrollBar: PScrollBar);
-      destructor  Done; virtual;
-      procedure   SetGDBCol;
-      function    GetText(Item,MaxLen: Sw_Integer): String; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   Draw; virtual;
-      procedure   LookUp(S: string); virtual;
-      function    GotoItem(Item: sw_integer): boolean; virtual;
-      function    TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
-    private
-      Symbols: PSymbolCollection;
-      SymbolsValue : PGDBValueCollection;
-      LookupStr: string;
-    end;
-
-    PSymbolReferenceView = ^TSymbolReferenceView;
-    TSymbolReferenceView = object(TSymbolView)
-      constructor Init(var Bounds: TRect; AReferences: PReferenceCollection; AHScrollBar, AVScrollBar: PScrollBar);
-      destructor  Done; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      function    GetText(Item,MaxLen: Sw_Integer): String; virtual;
-      procedure   SelectItem(Item: Sw_Integer); virtual;
-      function    GotoItem(Item: sw_integer): boolean; virtual;
-      function    TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
-      procedure   Browse; virtual;
-    private
-      References: PReferenceCollection;
-    end;
-
-    PSymbolMemInfoView = ^TSymbolMemInfoView;
-    TSymbolMemInfoView = object(TStaticText)
-      constructor  Init(var Bounds: TRect; AMemInfo: PSymbolMemInfo);
-      destructor  Done; virtual;
-      procedure    GetText(var S: String); virtual;
-      function     GetPalette: PPalette; virtual;
-    private
-      MemInfo: PSymbolMemInfo;
-      MyBW   : PBrowserWindow;
-    end;
-
-    PSymbolMemoView = ^TSymbolMemoView;
-    TSymbolMemoView = object(TFPMemo)
-      function    GetPalette: PPalette; virtual;
-    end;
-
-    PSymbolInheritanceView = ^TSymbolInheritanceView;
-    TSymbolInheritanceView = object(TOutlineViewer)
-      constructor  Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
-      destructor   Done; virtual;
-      function     GetRoot: Pointer; virtual;
-      function     HasChildren(Node: Pointer): Boolean; virtual;
-      function     GetChild(Node: Pointer; I: Integer): Pointer; virtual;
-      function     GetNumChildren(Node: Pointer): Integer; virtual;
-      function     GetText(Node: Pointer): String; virtual;
-      procedure    Adjust(Node: Pointer; Expand: Boolean); virtual;
-      function     IsExpanded(Node: Pointer): Boolean; virtual;
-      procedure    Selected(I: Integer); virtual;
-      procedure    HandleEvent(var Event: TEvent); virtual;
-      function     GetPalette: PPalette; virtual;
-    private
-      Root         : PObjectSymbol;
-      MyBW         : PBrowserWindow;
-    end;
-
-    PBrowserTabItem = ^TBrowserTabItem;
-    TBrowserTabItem = record
-      Sign  : char;
-      Link  : PView;
-      Next  : PBrowserTabItem;
-    end;
-
-    PBrowserTab = ^TBrowserTab;
-    TBrowserTab = object(TView)
-      Items: PBrowserTabItem;
-      constructor Init(var Bounds: TRect; AItems: PBrowserTabItem);
-      function    GetItemCount: sw_integer; virtual;
-      function    GetItem(Index: sw_integer): PBrowserTabItem; virtual;
-      procedure   SetParams(AFlags: word; ACurrent: Sw_integer); virtual;
-      procedure   SelectItem(Index: Sw_integer); virtual;
-      procedure   Draw; virtual;
-      function    GetPalette: PPalette; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      destructor  Done; virtual;
-    private
-      Flags   : word;
-      Current : Sw_integer;
-    end;
-
-    PUnitInfoPanel = ^TUnitInfoPanel;
-    TUnitInfoPanel = object(TPanel)
-      InOwnerCall: boolean;
-      procedure HandleEvent(var Event: TEvent); virtual;
-    end;
-
-    TBrowserWindow = object(TFPWindow)
-      constructor Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
-                    const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
-                    AInheritance: PObjectSymbol; AMemInfo: PSymbolMemInfo);
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   SetState(AState: Word; Enable: Boolean); virtual;
-      procedure   Close; virtual;
-      procedure   SelectTab(BrowserTab: Sw_integer); virtual;
-      function    GetPalette: PPalette; virtual;
-      destructor  Done;virtual;
-    private
-      PageTab       : PBrowserTab;
-      ST            : PStaticText;
-      Sym           : PSymbol;
-      ScopeView     : PSymbolScopeView;
-      ReferenceView : PSymbolReferenceView;
-      InheritanceView: PSymbolInheritanceView;
-      MemInfoView   : PSymbolMemInfoView;
-      UnitInfoText  : PSymbolMemoView;
-      UnitInfoUsed  : PSymbolScopeView;
-      UnitInfoDependent : PSymbolScopeView;
-      UnitInfo      : PUnitInfoPanel;
-      Prefix        : PString;
-      IsValid       : boolean;
-      DebuggerValue : PGDBValue;
-    end;
-
-procedure OpenSymbolBrowser(X,Y: Sw_integer;const Name,Line: string;S : PSymbol;
-            ParentBrowser : PBrowserWindow;
-            Symbols: PSymbolCollection; References: PReferenceCollection;
-            Inheritance: PObjectSymbol; MemInfo: PSymbolMemInfo);
-
-function IsSymbolInfoAvailable: boolean;
-
-procedure OpenOneSymbolBrowser(Name : String);
-
-procedure CloseAllBrowsers;
-
-procedure RemoveBrowsersCollection;
-
-const
-   GlobalsCollection : PSortedCollection = nil;
-   ModulesCollection : PSortedCollection = nil;
-
-implementation
-
-uses Commands,App,
-{$ifdef BROWSERCOL}
-     symconst,
-{$endif BROWSERCOL}
-     WUtils,WEditor,
-     FPConst,FPString,FPUtils,FPVars,{$ifndef FPDEBUG}FPDebug{$endif},FPIDE;
-
-procedure CloseAllBrowsers;
-  procedure SendCloseIfBrowser(P: PView); {$ifndef FPC}far;{$endif}
-  begin
-    if assigned(P) and
-       ((TypeOf(P^)=TypeOf(TBrowserWindow)) or
-       (TypeOf(P^)=TypeOf(TSymbolView)) or
-       (TypeOf(P^)=TypeOf(TSymbolScopeView)) or
-       (TypeOf(P^)=TypeOf(TSymbolReferenceView)) or
-       (TypeOf(P^)=TypeOf(TSymbolMemInfoView)) or
-       (TypeOf(P^)=TypeOf(TSymbolMemoView)) or
-       (TypeOf(P^)=TypeOf(TSymbolInheritanceView))) then
-      Message(P,evCommand,cmClose,nil);
-  end;
-
-begin
-  Desktop^.ForEach(@SendCloseIfBrowser);
-end;
-
-procedure RemoveBrowsersCollection;
-begin
-  if assigned(GlobalsCollection) then
-    begin
-      GlobalsCollection^.deleteAll;
-      Dispose(GlobalsCollection,done);
-      GlobalsCollection:=nil;
-    end;
-  if assigned(ModulesCollection) then
-    begin
-      ModulesCollection^.deleteAll;
-      Dispose(ModulesCollection,done);
-      ModulesCollection:=nil;
-    end;
-end;
-
-function NewBrowserTabItem(ASign: char; ALink: PView; ANext: PBrowserTabItem): PBrowserTabItem;
-var P: PBrowserTabItem;
-begin
-  New(P); FillChar(P^,SizeOf(P^),0);
-  with P^ do begin Sign:=ASign; Link:=ALink; Next:=ANext; end;
-  NewBrowserTabItem:=P;
-end;
-
-procedure DisposeBrowserTabItem(P: PBrowserTabItem);
-begin
-  if P<>nil then Dispose(P);
-end;
-
-procedure DisposeBrowserTabList(P: PBrowserTabItem);
-begin
-  if P<>nil then
-  begin
-    if P^.Next<>nil then DisposeBrowserTabList(P^.Next);
-    DisposeBrowserTabItem(P);
-  end;
-end;
-
-function IsSymbolInfoAvailable: boolean;
-begin
-  IsSymbolInfoAvailable:=BrowCol.Modules<>nil;
-end;
-
-procedure OpenOneSymbolBrowser(Name : String);
-
-var Index : sw_integer;
-    PS,S : PSymbol;
-    Anc : PObjectSymbol;
-    P : Pstring;
-    Symbols: PSymbolCollection;
-
-  function Search(P : PSymbol) : boolean;
-  begin
-    Search:=UpcaseStr(P^.Items^.LookUp(Name,Index))=Name;
-  end;
-
-begin
-   Name:=UpcaseStr(Name);
-   If BrowCol.Modules<>nil then
-     begin
-       PS:=BrowCol.Modules^.FirstThat(@Search);
-       If assigned(PS) then
-         begin
-           S:=PS^.Items^.At(Index);
-           Symbols:=S^.Items;
-           if (not assigned(symbols) or (symbols^.count=0)) and
-              assigned(S^.Ancestor) then
-             Symbols:=S^.Ancestor^.Items;
-           if (S^.Flags and sfObject)=0 then
-             Anc:=nil
-           else if S^.Ancestor=nil then
-             Anc:=ObjectTree
-           else
-             Anc:=SearchObjectForSymbol(S^.Ancestor);
-           OpenSymbolBrowser(0,20,
-                PS^.Items^.At(Index)^.GetName,
-                PS^.Items^.At(Index)^.GetText,
-                PS^.Items^.At(Index),nil,
-                Symbols,PS^.Items^.At(Index)^.References,Anc,PS^.MemInfo);
-         end
-       else
-         begin
-           P:=@Name;
-           ErrorBox(msg_symbolnotfound,@P);
-         end;
-     end
-   else
-     ErrorBox(msg_nobrowserinfoavailable,nil);
-end;
-
-(*procedure ReadBrowseLog(FileName: string);
-var f: text;
-    IOOK,EndOfFile: boolean;
-    Line: string;
-procedure NextLine;
-begin
-  readln(f,Line);
-  EndOfFile:=Eof(f);
-end;
-var Level: integer;
-procedure ProcessSymTable(Indent: integer; Owner: PSymbolCollection);
-var IndentS,S,Source: string;
-    Sym: PSymbol;
-    Ref: PSymbolReference;
-    P: byte;
-    PX: TPoint;
-    PS: PString;
-    PCount: integer;
-    Params: array[0..30] of PString;
-    Typ: tsymtyp;
-    ExitBack: boolean;
-begin
-  Inc(Level);
-  IndentS:=CharStr(' ',Indent); ExitBack:=false;
-  Sym:=nil;
-  repeat
-    if copy(Line,1,length(IndentS))<>IndentS then ExitBack:=true else
-    if copy(Line,Indent+1,3)='***' then
-      { new symbol }
-      begin
-        S:=copy(Line,Indent+1+3,255);
-        P:=Pos('***',S); if P=0 then P:=length(S)+1;
-        S:=Trim(copy(S,1,P-1));
-        if (copy(S,1,1)='_') and (Pos('$$',S)>0) then
-          begin
-            repeat
-              P:=Pos('$$',S);
-              if P>0 then Delete(S,1,P+1);
-            until P=0;
-            P:=Pos('$',S);
-            Delete(S,1,P);
-            PCount:=0;
-            repeat
-              P:=Pos('$',S); if P=0 then P:=length(S)+1;
-              Params[PCount]:=TypeNames^.Add(copy(S,1,P-1));
-              Inc(PCount);
-              Delete(S,1,P);
-            until S='';
-            Sym^.Typ:=procsym;
-            Sym^.SetParams(PCount,@Params);
-          end
-        else
-          New(Sym, Init(S, varsym, 0, nil));
-        Owner^.Insert(Sym);
-        NextLine;
-      end else
-    if copy(Line,Indent+1,3)='---' then
-      { child symtable }
-      begin
-        S:=Trim(copy(Line,Indent+1+12,255));
-        if Level=1 then Typ:=unitsym else
-          Typ:=typesym;
-        if (Sym<>nil) and (Sym^.GetName=S) then
-        else
-          begin
-            New(Sym, Init(S, Typ, 0, nil));
-            Owner^.Insert(Sym);
-          end;
-        Sym^.Typ:=Typ;
-        NextLine;
-        New(Sym^.Items, Init(0,50));
-        ProcessSymTable(Indent+2,Sym^.Items);
-      end else
-{    if Sym<>nil then}
-    if copy(Line,Indent+1,1)=' ' then
-      { reference }
-      begin
-        S:=copy(Line,Indent+1+2,255);
-        P:=Pos('(',S); if P=0 then P:=length(S)+1;
-        Source:=Trim(copy(S,1,P-1)); Delete(S,1,P);
-        P:=Pos(',',S); if P=0 then P:=length(S)+1;
-        PX.Y:=StrToInt(copy(S,1,P-1)); Delete(S,1,P);
-        P:=Pos(')',S); if P=0 then P:=length(S)+1;
-        PX.X:=StrToInt(copy(S,1,P-1)); Delete(S,1,P);
-        PS:=ModuleNames^.Add(Source);
-        New(Ref, Init(PS, PX));
-        if Sym^.References=nil then
-          New(Sym^.References, Init(10,50));
-        Sym^.References^.Insert(Ref);
-      end;
-    if ExitBack=false then
-      NextLine;
-  until EndOfFile or ExitBack;
-  Dec(Level);
-end;
-begin
-  DoneSymbolBrowser;
-  InitSymbolBrowser;
-
-{$I-}
-  Assign(f,FileName);
-  Reset(f);
-  Level:=0;
-  NextLine;
-  while (IOResult=0) and (EndOfFile=false) do
-    ProcessSymTable(0,Modules);
-  Close(f);
-  EatIO;
-{$I+}
-end;*)
-
-
-{****************************************************************************
-                               TGDBValue
-****************************************************************************}
-
-constructor TGDBValue.Init(Const AExpr : String;ASym : PSymbol);
-begin
-  St := nil;
-  S := ASym;
-  Expr:=NewStr(AExpr);
-  GDBI:=-1;
-end;
-
-destructor TGDBValue.Done;
-begin
-  If Assigned(St) then
-    DisposeStr(St);
-  If Assigned(Expr) then
-    DisposeStr(Expr);
-end;
-
-procedure TGDBValue.GetValue;
-begin
-{$ifdef BROWSERCOL}
-{$ifndef NODEBUG}
-  if not assigned(Debugger) then
-    exit;
-  if not Debugger^.IsRunning then
-    exit;
-  if (S^.typ<>varsym) or (GDBI=Debugger^.RunCount) then
-    exit;
-  If Assigned(St) then
-    DisposeStr(St);
-  if assigned(Expr) then
-    begin
-      St:=NewStr(GetPChar(Debugger^.GetValue(Expr^)));
-      GDBI:=Debugger^.RunCount;
-    end;
-{$endif ndef NODEBUG}
-{$endif BROWSERCOL}
-end;
-
-function TGDBValue.GetText : String;
-begin
-  GetValue;
-  if assigned(St) then
-    GetText:=S^.GetText+' = '+GetStr(St)
-  else
-    GetText:=S^.GetText;
-end;
-
-{****************************************************************************
-                               TGDBValueCollection
-****************************************************************************}
-function  TGDBValueCollection.At(Index: sw_Integer): PGDBValue;
-begin
-  At:= Inherited At(Index);
-end;
-{****************************************************************************
-                               TSymbolView
-****************************************************************************}
-
-constructor TSymbolView.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-begin
-  inherited Init(Bounds,1,AVScrollBar);
-  HScrollBar:=AHScrollBar;
-  MyBW:=nil;
-  if assigned(HScrollBar) then
-    HScrollBar^.SetRange(1,80);
-  Options:=Options or (ofSelectable+ofTopSelect);
-  EventMask:=EventMask or evBroadcast;
-end;
-
-procedure TSymbolView.ClearHighlights;
-begin
-  Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
-end;
-
-procedure TSymbolView.AutoTrackSource;
-begin
-  if Range>0 then
-    TrackSource;
-end;
-
-procedure TSymbolView.OptionsDlg;
-begin
-  { Abstract }
-end;
-
-procedure TSymbolView.SetState(AState: Word; Enable: Boolean);
-var OState: longint;
-begin
-  OState:=State;
-  inherited SetState(AState,Enable);
-  if ((OState xor State) and sfFocused)<>0 then
-    if GetState(sfFocused) then
-      begin
-        if (MiscOptions and moAutoTrackSource)<>0 then
-          AutoTrackSource;
-      end
-    else
-      Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
-end;
-
-procedure TSymbolView.Browse;
-begin
-  SelectItem(Focused);
-end;
-
-procedure TSymbolView.GotoSource;
-begin
-  if GotoItem(Focused) then
-    PutCommand(Owner,evCommand,cmClose,nil);
-end;
-
-procedure TSymbolView.TrackSource;
-begin
-  TrackItem(Focused,false);
-end;
-
-procedure TSymbolView.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-begin
-  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbEnter :
-            Browse;
-          kbCtrlEnter :
-            GotoSource;
-          kbSpaceBar :
-            TrackSource;
-          kbRight,kbLeft :
-            if HScrollBar<>nil then
-              HScrollBar^.HandleEvent(Event);
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-    evMouseDown :
-      begin
-        if Event.double then
-          begin
-            Browse;
-            ClearEvent(Event);
-          end;
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmSymBrowse :
-            Browse;
-          cmSymGotoSource :
-            GotoSource;
-          cmSymTrackSource :
-            TrackSource;
-          cmSymOptions :
-            OptionsDlg;
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmListFocusChanged :
-         if Event.InfoPtr=@Self then
-          if (MiscOptions and moAutoTrackSource)<>0 then
-            if GetState(sfFocused) then
-              AutoTrackSource;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TSymbolView.GetPalette: PPalette;
-const
-  P: string[length(CBrowserListBox)] = CBrowserListBox;
-begin
-  GetPalette:=@P;
-end;
-
-function TSymbolView.GetLocalMenu: PMenu;
-begin
-  GetLocalMenu:=NewMenu(
-    NewItem(menu_symlocal_browse,'',kbNoKey,cmSymBrowse,hcSymBrowse,
-    NewItem(menu_symlocal_gotosource,'',kbNoKey,cmSymGotoSource,hcSymGotoSource,
-    NewItem(menu_symlocal_tracksource,'',kbNoKey,cmSymTrackSource,hcSymTrackSource,
-    NewLine(
-    NewItem(menu_symlocal_options,'',kbNoKey,cmSymOptions,hcSymOptions,
-    nil))))));
-end;
-
-function TSymbolView.GotoItem(Item: sw_integer): boolean;
-begin
-  SelectItem(Item);
-  GotoItem:=true;
-end;
-
-function TSymbolView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
-begin
-  SelectItem(Item);
-  TrackItem:=true;
-end;
-
-function LastBrowserWindow: PBrowserWindow;
-var BW: PBrowserWindow;
-procedure IsBW(P: PView); {$ifndef FPC}far;{$endif}
-begin
-  if (P^.HelpCtx=hcBrowserWindow) then
-    BW:=pointer(P);
-end;
-begin
-  BW:=nil;
-  Desktop^.ForEach(@IsBW);
-  LastBrowserWindow:=BW;
-end;
-
-function TSymbolView.TrackReference(R: PReference; AutoTrack: boolean): boolean;
-var W: PSourceWindow;
-    BW: PBrowserWindow;
-    P: TPoint;
-begin
-  ClearHighlights;
-  Desktop^.Lock;
-  P.X:=R^.Position.X-1; P.Y:=R^.Position.Y-1;
-  if AutoTrack then
-    W:=SearchOnDesktop(R^.GetFileName,false)
-  else
-    W:=TryToOpenFile(nil,R^.GetFileName,P.X,P.Y,true);
-  if W<>nil then
-  begin
-    BW:=LastBrowserWindow;
-    if BW=nil then
-      W^.Select
-    else
-      begin
-        Desktop^.Delete(W);
-        Desktop^.InsertBefore(W,BW^.NextView);
-      end;
-    W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P.Y);
-  end;
-  Desktop^.UnLock;
-  if Assigned(W)=false then
-    ErrorBox(FormatStrStr(msg_cantfindfile,R^.GetFileName),nil);
-
-  TrackReference:=W<>nil;
-end;
-
-function TSymbolView.GotoReference(R: PReference): boolean;
-var W: PSourceWindow;
-begin
-  Desktop^.Lock;
-  W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1,true);
-  if Assigned(W) then
-    W^.Select;
-  Desktop^.UnLock;
-  if Assigned(W)=false then
-    ErrorBox(FormatStrStr(msg_cantfindfile,R^.GetFileName),nil);
-  GotoReference:=W<>nil;
-end;
-
-{****************************************************************************
-                               TSymbolScopeView
-****************************************************************************}
-
-constructor TSymbolScopeView.Init(var Bounds: TRect; ASymbols: PSymbolCollection; AHScrollBar, AVScrollBar: PScrollBar);
-begin
-  inherited Init(Bounds,AHScrollBar, AVScrollBar);
-  Symbols:=ASymbols;
-  NewList(ASymbols);
-  New(SymbolsValue,Init(50,50));
-  SetRange(Symbols^.Count);
-end;
-
-destructor TSymbolScopeView.Done;
-begin
-  {if assigned(Symbols) then
-    begin
-       the elements belong to other lists
-       Symbols^.DeleteAll;
-       dispose(Symbols,done);
-    end;}
-  Inherited Done;
-end;
-
-procedure TSymbolScopeView.HandleEvent(var Event: TEvent);
-var OldFocus: sw_integer;
-begin
-  case Event.What of
-    evKeyDown :
-      case Event.KeyCode of
-        kbBack :
-          begin
-            LookUp(copy(LookUpStr,1,length(LookUpStr)-1));
-            ClearEvent(Event);
-          end;
-      else
-        if Event.CharCode in[#33..#255] then
-          begin
-            LookUp(LookUpStr+Event.CharCode);
-            ClearEvent(Event);
-          end;
-      end;
-  end;
-  OldFocus:=Focused;
-  inherited HandleEvent(Event);
-  if OldFocus<>Focused then
-    Lookup('');
-end;
-
-procedure TSymbolScopeView.Draw;
-var DeltaX: sw_integer;
-begin
-  inherited Draw;
-  if Assigned(HScrollBar)=false then DeltaX:=0 else
-    DeltaX:=HScrollBar^.Value-HScrollBar^.Min;
-  SetCursor(2+SymbolTypLen+length(LookUpStr)-DeltaX,Focused-TopItem);
-end;
-
-procedure TSymbolScopeView.LookUp(S: string);
-var Idx,Slength: Sw_integer;
-    NS: string;
-begin
-  NS:=LookUpStr;
-  Slength:=Length(S);
-  if (Symbols=nil) or (S='') then NS:='' else
-    begin
-      S:=Symbols^.LookUp(S,Idx);
-      if Idx<>-1 then
-        begin
-          NS:=S;
-          FocusItem(Idx);
-        end;
-    end;
-  LookUpStr:=Copy(NS,1,Slength);
-  SetState(sfCursorVis,LookUpStr<>'');
-  DrawView;
-end;
-
-function TSymbolScopeView.GotoItem(Item: sw_integer): boolean;
-var S: PSymbol;
-    OK: boolean;
-begin
-  OK:=Range>0;
-  if OK then
-  begin
-    S:=List^.At(Item);
-    OK:=(S^.References<>nil) and (S^.References^.Count>0);
-    if OK then
-      OK:=GotoReference(S^.References^.At(0));
-  end;
-  GotoItem:=OK;
-end;
-
-function TSymbolScopeView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
-var S: PSymbol;
-    OK: boolean;
-begin
-  OK:=Range>0;
-  if OK then
-  begin
-    S:=List^.At(Item);
-    OK:=(S^.References<>nil) and (S^.References^.Count>0);
-    if OK then
-      OK:=TrackReference(S^.References^.At(0),AutoTrack);
-  end;
-  TrackItem:=OK;
-end;
-
-procedure TSymbolScopeView.SetGDBCol;
-var S : PSymbol;
-    I : sw_integer;
-begin
-  if assigned(MyBW) and (SymbolsValue^.Count=0) then
-    begin
-      For i:=0 to Symbols^.Count-1 do
-        begin
-          S:=Symbols^.At(I);
-          SymbolsValue^.Insert(New(PGDBValue,Init(GetStr(MyBW^.Prefix)+S^.GetName,S)));
-        end;
-    end;
-end;
-
-function TSymbolScopeView.GetText(Item,MaxLen: Sw_Integer): String;
-var S1: string;
-    S : PSymbol;
-    SG : PGDBValue;
-begin
-  S:=Symbols^.At(Item);
-  if Assigned(SymbolsValue) and (SymbolsValue^.Count>Item) then
-    SG:=SymbolsValue^.At(Item)
-  else
-    SG:=nil;
-  if assigned(SG) then
-    S1:=SG^.getText
-  else
-    S1:=S^.GetText;
-  GetText:=copy(S1,1,MaxLen);
-end;
-
-
-{****************************************************************************
-                             TSymbolReferenceView
-****************************************************************************}
-
-constructor TSymbolReferenceView.Init(var Bounds: TRect; AReferences: PReferenceCollection;
-              AHScrollBar, AVScrollBar: PScrollBar);
-begin
-  inherited Init(Bounds,AHScrollBar, AVScrollBar);
-  References:=AReferences;
-  NewList(AReferences);
-  SetRange(References^.Count);
-end;
-
-destructor TSymbolReferenceView.Done;
-begin
-  Inherited Done;
-end;
-
-procedure TSymbolReferenceView.HandleEvent(var Event: TEvent);
-var OldFocus: sw_integer;
-{    DontClear: boolean;}
-begin
-  OldFocus:=Focused;
-{  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbEnter :
-            TrackItem(Focused,false);
-          kbCtrlEnter :
-            GotoItem(Focused);
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-  end;}
-  inherited HandleEvent(Event);
-  if OldFocus<>Focused then
-   if (MiscOptions and moAutoTrackSource)=0 then
-    ClearHighlights;
-end;
-
-procedure TSymbolReferenceView.Browse;
-begin
-  { do nothing here }
-end;
-
-function TSymbolReferenceView.GetText(Item,MaxLen: Sw_Integer): String;
-var S: string;
-    P: PReference;
-begin
-  P:=References^.At(Item);
-  S:=P^.GetFileName+'('+IntToStr(P^.Position.Y)+','+IntToStr(P^.Position.X)+')';
-  GetText:=copy(S,1,MaxLen);
-end;
-
-function TSymbolReferenceView.GotoItem(Item: sw_integer): boolean;
-var OK: boolean;
-begin
-  OK:=Range>0;
-  if OK then
-    OK:=GotoReference(List^.At(Item));
-  GotoItem:=OK;
-end;
-
-function TSymbolReferenceView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
-var OK: boolean;
-begin
-  OK:=Range>0;
-  if OK then
-    OK:=TrackReference(List^.At(Item),AutoTrack);
-  TrackItem:=OK;
-end;
-
-procedure TSymbolReferenceView.SelectItem(Item: Sw_Integer);
-begin
-  GotoItem(Item);
-end;
-
-
-constructor TSymbolMemInfoView.Init(var Bounds: TRect; AMemInfo: PSymbolMemInfo);
-begin
-  inherited Init(Bounds,'');
-  Options:=Options or (ofSelectable+ofTopSelect);
-  MemInfo:=AMemInfo;
-  MyBW:=nil;
-end;
-
-destructor TSymbolMemInfoView.Done;
-begin
-{  if assigned(MemInfo) then
-    dispose(MemInfo);}
-  Inherited Done;
-end;
-
-procedure TSymbolMemInfoView.GetText(var S: String);
-function SizeStr(Size: longint): string;
-var S: string[40];
-begin
-  S:=IntToStrL(Size,7);
-  S:=S+' byte';
-  if Size>1 then S:=S+'s';
-  if Size=-1 then
-    SizeStr:='variable'
-  else
-    SizeStr:=S;
-end;
-function AddrStr(Addr: longint): string;
-{ Warning this is endian specific code !! (PM) }
-type TLongint = record LoW,HiW: word; end;
-begin
-  with TLongint(Addr) do
-  AddrStr:='$'+IntToHex(HiW,4)+IntToHex(HiW,4);
-end;
-begin
-  ClearFormatParams;
-  AddFormatParamStr(msg_sizeinmemory);
-  AddFormatParamStr(msg_sizeonstack);
-  S:=
-  FormatStrF(
-   #13+
-{  ' Memory location: '+AddrStr(MemInfo^.Addr)+#13+
-  '   Local address: '+AddrStr(MemInfo^.LocalAddr)+#13+}
-
-  { ??? internal linker ??? }
-
-  '%18s: '+SizeStr(MemInfo^.Size)+#13+
-  '%18s: '+SizeStr(MemInfo^.PushSize)+#13+
-  '',
-  FormatParams);
-end;
-
-function TSymbolMemInfoView.GetPalette: PPalette;
-begin
-  GetPalette:=inherited GetPalette;
-end;
-
-function TSymbolMemoView.GetPalette: PPalette;
-const P: string[length(CFPSymbolMemo)] = CFPSymbolMemo;
-begin
-  GetPalette:=@P;
-end;
-
-{****************************************************************************
-                          TSymbolInheritanceView
-****************************************************************************}
-
-constructor TSymbolInheritanceView.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
-begin
-  inherited Init(Bounds,AHScrollBar,AVScrollBar);
-  Options:=Options or (ofSelectable+ofTopSelect);
-  Root:=ARoot;
-  MyBW:=nil;
-  ExpandAll(GetRoot);
-  Update;
-end;
-
-destructor TSymbolInheritanceView.Done;
-begin
-  { do not dispose,
-    belongs to a symbolcollection (PM)
-  if assigned(Root) then
-    dispose(Root,done); }
-  Inherited Done;
-end;
-
-function TSymbolInheritanceView.GetRoot: Pointer;
-begin
-  GetRoot:=Root;
-end;
-
-function TSymbolInheritanceView.HasChildren(Node: Pointer): Boolean;
-begin
-  HasChildren:=GetNumChildren(Node)>0;
-end;
-
-function TSymbolInheritanceView.GetChild(Node: Pointer; I: Integer): Pointer;
-begin
-  GetChild:=PObjectSymbol(Node)^.GetDescendant(I);
-end;
-
-function TSymbolInheritanceView.GetNumChildren(Node: Pointer): Integer;
-begin
-  GetNumChildren:=PObjectSymbol(Node)^.GetDescendantCount;
-end;
-
-function TSymbolInheritanceView.GetText(Node: Pointer): String;
-begin
-  GetText:=PObjectSymbol(Node)^.GetName;
-end;
-
-procedure TSymbolInheritanceView.Adjust(Node: Pointer; Expand: Boolean);
-begin
-  PObjectSymbol(Node)^.Expanded:=Expand;
-end;
-
-function TSymbolInheritanceView.IsExpanded(Node: Pointer): Boolean;
-begin
-  IsExpanded:=PObjectSymbol(Node)^.Expanded;
-end;
-
-procedure TSymbolInheritanceView.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-begin
-  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbLeft,kbRight,
-          kbCtrlLeft,kbCtrlRight :
-            if Assigned(HScrollBar) then
-              HScrollBar^.HandleEvent(Event)
-            else
-              DontClear:=true;
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TSymbolInheritanceView.GetPalette: PPalette;
-const P: string[length(CBrowserOutline)] = CBrowserOutline;
-begin
-  GetPalette:=@P;
-end;
-
-procedure TSymbolInheritanceView.Selected(I: Integer);
-var P: pointer;
-    S: PSymbol;
-    St : String;
-    Anc: PObjectSymbol;
-begin
-  P:=GetNode(I);
-  if P=nil then Exit;
-
-  S:=PObjectSymbol(P)^.Symbol;
-
-  { this happens for the top objects view (PM) }
-  if S=nil then exit;
-
-  st:=S^.GetName;
-  if S^.Ancestor=nil then
-    Anc:=ObjectTree
-  else
-    Anc:=SearchObjectForSymbol(S^.Ancestor);
-  OpenSymbolBrowser(Origin.X-1,FOC-Delta.Y+1,
-    st,
-    S^.GetText,S,nil,
-    S^.Items,S^.References,Anc,S^.MemInfo);
-end;
-
-
-{****************************************************************************
-                               TBrowserTab
-****************************************************************************}
-
-constructor TBrowserTab.Init(var Bounds: TRect; AItems: PBrowserTabItem);
-begin
-  inherited Init(Bounds);
-  Options:=Options or ofPreProcess;
-  Items:=AItems;
-  SetParams(0,0);
-end;
-
-procedure TBrowserTab.SetParams(AFlags: word; ACurrent: Sw_integer);
-begin
-  Flags:=AFlags;
-  SelectItem(ACurrent);
-end;
-
-procedure TBrowserTab.SelectItem(Index: Sw_integer);
-var P: PBrowserTabItem;
-begin
-  Current:=Index;
-  P:=GetItem(Current);
-  if (P<>nil) and (P^.Link<>nil) then
-    P^.Link^.Focus;
-  DrawView;
-end;
-
-function TBrowserTab.GetItemCount: sw_integer;
-var Count: integer;
-    P: PBrowserTabItem;
-begin
-  Count:=0; P:=Items;
-  while (P<>nil) do
-    begin
-      Inc(Count);
-      P:=P^.Next;
-    end;
-  GetItemCount:=Count;
-end;
-
-function TBrowserTab.GetItem(Index: sw_integer): PBrowserTabItem;
-var Counter: integer;
-    P: PBrowserTabItem;
-begin
-  P:=Items; Counter:=0;
-  while (P<>nil) and (Counter<Index) do
-    begin
-      P:=P^.Next;
-      Inc(Counter);
-    end;
-  GetItem:=P;
-end;
-
-procedure TBrowserTab.Draw;
-var B: TDrawBuffer;
-    SelColor, NormColor, C: word;
-    I,CurX,Count: Sw_integer;
-function Names(Idx: integer): char;
-begin
-  Names:=GetItem(Idx)^.Sign;
-end;
-begin
-  NormColor:=GetColor(1); SelColor:=GetColor(2);
-  MoveChar(B,'Ä',SelColor,Size.X);
-  CurX:=0; Count:=0;
-  for I:=0 to GetItemCount-1 do
-    if (Flags and (1 shl I))<>0 then
-    begin
-      Inc(Count);
-      if Current=I then C:=SelColor
-                   else C:=NormColor;
-      if Count=1 then MoveChar(B[CurX],'´',SelColor,1)
-                 else MoveChar(B[CurX],'³',SelColor,1);
-      MoveCStr(B[CurX+1],' '+Names(I)+' ',C);
-      Inc(CurX,4);
-    end;
-  if Count>0 then
-    MoveChar(B[CurX],'Ã',SelColor,1);
-  WriteLine(0,0,Size.X,Size.Y,B);
-end;
-
-procedure TBrowserTab.HandleEvent(var Event: TEvent);
-var I,Idx: integer;
-    DontClear: boolean;
-    P: TPoint;
-function GetItemForCoord(X: integer): integer;
-var I,CurX,Idx: integer;
-begin
-  CurX:=0; Idx:=-1;
-  for I:=0 to GetItemCount-1 do
-    if (Flags and (1 shl I))<>0 then
-    begin
-      if (CurX+1<=X) and (X<=CurX+3) then
-        begin Idx:=I; Break; end;
-      Inc(CurX,4);
-    end;
-  GetItemForCoord:=Idx;
-end;
-begin
-  case Event.What of
-    evMouseDown :
-      if MouseInView(Event.Where) then
-        begin
-          repeat
-            MakeLocal(Event.Where,P);
-            Idx:=GetItemForCoord(P.X);
-            if Idx<>-1 then
-              SelectItem(Idx);
-          until not MouseEvent(Event, evMouseMove);
-          ClearEvent(Event);
-        end;
-    evKeyDown :
-      begin
-        DontClear:=false; Idx:=-1;
-        for I:=0 to GetItemCount-1 do
-          if GetCtrlCode(GetItem(I)^.Sign)=Event.KeyCode then
-           if (Flags and (1 shl I))<>0 then
-            begin
-              Idx:=I;
-              Break;
-            end;
-        if Idx=-1 then
-          DontClear:=true
-        else
-          SelectItem(Idx);
-        if DontClear=false then ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TBrowserTab.GetPalette: PPalette;
-const P: string[length(CBrowserTab)] = CBrowserTab;
-begin
-  GetPalette:=@P;
-end;
-
-destructor TBrowserTab.Done;
-begin
-  if Items<>nil then DisposeBrowserTabList(Items);
-  inherited Done;
-end;
-
-procedure TUnitInfoPanel.HandleEvent(var Event: TEvent);
-begin
-  if (Event.What=evBroadcast) and (Event.Command=cmListItemSelected) and
-     (InOwnerCall=false) then
-    begin
-      InOwnerCall:=true;
-      if Assigned(Owner) then
-        Owner^.HandleEvent(Event);
-      InOwnerCall:=false;
-    end;
-  inherited HandleEvent(Event);
-end;
-
-constructor TBrowserWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
-             const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
-             AInheritance: PObjectSymbol; AMemInfo: PSymbolMemINfo);
-var R,R2,R3: TRect;
-    HSB,VSB: PScrollBar;
-    CST: PColorStaticText;
-    I: sw_integer;
-function CreateVSB(R: TRect): PScrollBar;
-var R2: TRect;
-    SB: PScrollBar;
-begin
-  R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
-  New(SB, Init(R2)); SB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
-  CreateVSB:=SB;
-end;
-function CreateHSB(R: TRect): PScrollBar;
-var R2: TRect;
-    SB: PScrollBar;
-begin
-  R2.Copy(R); R2.Move(0,1); R2.A.Y:=R2.B.Y-1;
-  New(SB, Init(R2)); SB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
-  CreateHSB:=SB;
-end;
-begin
-  inherited Init(Bounds, FormatStrStr(dialog_browse,ATitle), ANumber);
-  HelpCtx:=hcBrowserWindow;
-  Sym:=ASym;
-  Prefix:=NewStr(APrefix);
-
-  GetExtent(R); R.Grow(-1,-1); R.B.Y:=R.A.Y+1;
-{$ifndef NODEBUG}
-  if {assigned(Debugger) and Debugger^.IsRunning and}
-     assigned(Sym) and (Sym^.typ=varsym) then
-    begin
-      New(DebuggerValue,Init(ATitle,Sym));
-      New(ST, Init(R, ' '+DebuggerValue^.GetText));
-    end
-  else
-{$endif NODEBUG}
-    begin
-      New(ST, Init(R, ' '+AName));
-      DebuggerValue:=nil;
-    end;
-  ST^.GrowMode:=gfGrowHiX;
-  Insert(ST);
-
-  GetExtent(R); R.Grow(-1,-1); Inc(R.A.Y,2);
-  if assigned(ASymbols) and (ASymbols^.Count>0) then
-    begin
-      HSB:=CreateHSB(R); Insert(HSB);
-      VSB:=CreateVSB(R); Insert(VSB);
-      New(ScopeView, Init(R, ASymbols, HSB, VSB));
-      ScopeView^.GrowMode:=gfGrowHiX+gfGrowHiY;
-      Insert(ScopeView);
-      ScopeView^.MyBW:=@Self;
-      ScopeView^.SetGDBCol;
-    end;
-  if assigned(AReferences) and (AReferences^.Count>0) then
-    begin
-      HSB:=CreateHSB(R); Insert(HSB);
-      VSB:=CreateVSB(R); Insert(VSB);
-      New(ReferenceView, Init(R, AReferences, HSB, VSB));
-      ReferenceView^.GrowMode:=gfGrowHiX+gfGrowHiY;
-      Insert(ReferenceView);
-      ReferenceView^.MyBW:=@Self;
-    end;
-  if assigned(AInheritance) then
-    begin
-      HSB:=CreateHSB(R); Insert(HSB);
-      VSB:=CreateVSB(R); Insert(VSB);
-      New(InheritanceView, Init(R, HSB,VSB, AInheritance));
-      InheritanceView^.GrowMode:=gfGrowHiX+gfGrowHiY;
-      Insert(InheritanceView);
-      InheritanceView^.MyBW:=@Self;
-    end;
-  if assigned(AMemInfo) then
-    begin
-      New(MemInfoView, Init(R, AMemInfo));
-      MemInfoView^.GrowMode:=gfGrowHiX+gfGrowHiY;
-      Insert(MemInfoView);
-      MemInfoView^.MyBW:=@Self;
-    end;
-  if Assigned(Asym) and (TypeOf(ASym^)=TypeOf(TModuleSymbol)) then
-  with PModuleSymbol(Sym)^ do
-    begin
-      New(UnitInfo, Init(R));
-      UnitInfo^.GetExtent(R3);
-
-      R2.Copy(R3);
-      R2.B.Y:=R2.A.Y+3;
-      if (Assigned(UsedUnits) or Assigned(DependentUnits))=false then
-        R2.B.Y:=R3.B.Y;
-      {HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }HSB:=nil;
-      VSB:=CreateVSB(R2); UnitInfo^.Insert(VSB);
-      New(UnitInfoText, Init(R2,HSB,VSB, nil));
-      with UnitInfoText^ do
-      begin
-        GrowMode:=gfGrowHiX;
-        if Assigned(LoadedFrom) then
-        begin
-          AddLine(FormatStrStr2('%s : %s',msg_usedfirstin,GetStr(LoadedFrom)));
-          AddLine(FormatStrStr('%s : ',msg_mainsource));
-          AddLine(FormatStrStr('  %s',GetStr(MainSource)));
-          if Assigned(SourceFiles) and (SourceFiles^.Count>1) then
-          begin
-            AddLine(FormatStrStr('%s : ',msg_sourcefiles));
-            for I:=0 to SourceFiles^.Count-1 do
-              AddLine(FormatStrStr('  %s',GetStr(SourceFiles^.At(I))));
-          end;
-        end;
-      end;
-      UnitInfo^.Insert(UnitInfoText);
-
-      if Assigned(UsedUnits) then
-      begin
-        Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+1;
-        New(CST, Init(R2,'´ Used units Ã'+CharStr('Ä',255),ColorIndex(12),false));
-        CST^.GrowMode:=gfGrowHiX;
-        UnitInfo^.Insert(CST);
-
-        Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+4;
-        if Assigned(DependentUnits)=false then R2.B.Y:=R3.B.Y;
-        {HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }HSB:=nil;
-        VSB:=CreateVSB(R2); UnitInfo^.Insert(VSB);
-        New(UnitInfoUsed, Init(R2,UsedUnits,HSB,VSB));
-        UnitInfoUsed^.GrowMode:=gfGrowHiY+gfGrowHiX;
-        UnitInfoUsed^.MyBW:=@Self;
-        UnitInfo^.Insert(UnitInfoUsed);
-      end;
-
-      if Assigned(DependentUnits) then
-      begin
-        Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+1;
-        New(CST, Init(R2,'´ Dependent units Ã'+CharStr('Ä',255),ColorIndex(12),false));
-        CST^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
-        UnitInfo^.Insert(CST);
-
-        Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R3.B.Y;
-        {HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }HSB:=nil;
-        VSB:=CreateVSB(R2); UnitInfo^.Insert(VSB);
-        New(UnitInfoDependent, Init(R2,DependentUnits,HSB,VSB));
-        UnitInfoDependent^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
-        UnitInfoDependent^.MyBW:=@Self;
-        UnitInfo^.Insert(UnitInfoDependent);
-      end;
-
-      if Assigned(UnitInfoText) then
-        UnitInfoText^.Select;
-
-      Insert(UnitInfo);
-    end;
-
-  GetExtent(R); R.Grow(-1,-1); R.Move(0,1); R.B.Y:=R.A.Y+1;
-  New(PageTab, Init(R,
-    NewBrowserTabItem(label_browsertab_scope,ScopeView,
-    NewBrowserTabItem(label_browsertab_reference,ReferenceView,
-    NewBrowserTabItem(label_browsertab_inheritance,InheritanceView,
-    NewBrowserTabItem(label_browsertab_memory,MemInfoView,
-    NewBrowserTabItem(label_browsertab_unit,UnitInfo,
-    nil))
-    )))));
-  PageTab^.GrowMode:=gfGrowHiX;
-  Insert(PageTab);
-
-  if assigned(ScopeView) then
-   SelectTab(btScope)
-  else
-   if assigned(ReferenceView) then
-    SelectTab(btReferences)
-  else
-   if assigned(InheritanceView) then
-    SelectTab(btInheritance);
-end;
-
-destructor  TBrowserWindow.Done;
-begin
-  if assigned(DebuggerValue) then
-    begin
-      Dispose(DebuggerValue,Done);
-      DebuggerValue:=nil;
-    end;
-  inherited Done;
-end;
-
-procedure TBrowserWindow.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-    S: PSymbol;
-    Symbols: PSymbolCollection;
-    Anc: PObjectSymbol;
-    P: TPoint;
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-        cmDebuggerStopped :
-          begin
-            if Assigned(DebuggerValue) and
-               (DebuggerValue^.GDBI<>Event.InfoLong) then
-              begin
-                If Assigned(ST^.Text) then
-                  DisposeStr(ST^.Text);
-                ST^.Text:=NewStr(DebuggerValue^.GetText);
-                ST^.DrawView;
-              end;
-          end;
-        cmSearchWindow :
-          ClearEvent(Event);
-        cmListItemSelected :
-          begin
-            S:=nil;
-            if (Event.InfoPtr=ScopeView) then
-              begin
-                S:=ScopeView^.Symbols^.At(ScopeView^.Focused);
-                MakeGlobal(ScopeView^.Origin,P);
-                Desktop^.MakeLocal(P,P); Inc(P.Y,ScopeView^.Focused-ScopeView^.TopItem);
-                Inc(P.Y);
-              end;
-            if (Event.InfoPtr=UnitInfoUsed) then
-              begin
-                S:=UnitInfoUsed^.Symbols^.At(UnitInfoUsed^.Focused);
-                MakeGlobal(UnitInfoUsed^.Origin,P);
-                Desktop^.MakeLocal(P,P); Inc(P.Y,UnitInfoUsed^.Focused-UnitInfoUsed^.TopItem);
-                Inc(P.Y);
-              end;
-            if (Event.InfoPtr=UnitInfoDependent) then
-              begin
-                S:=UnitInfoDependent^.Symbols^.At(UnitInfoDependent^.Focused);
-                MakeGlobal(UnitInfoDependent^.Origin,P);
-                Desktop^.MakeLocal(P,P); Inc(P.Y,UnitInfoDependent^.Focused-UnitInfoDependent^.TopItem);
-                Inc(P.Y);
-              end;
-            if Assigned(S) then
-              begin
-                if S^.Ancestor=nil then Anc:=nil else
-                  Anc:=SearchObjectForSymbol(S^.Ancestor);
-                Symbols:=S^.Items;
-                if (not assigned(Symbols)  or (symbols^.count=0)) then
-                  if assigned(S^.Ancestor) then
-                    Symbols:=S^.Ancestor^.Items;
-                if (S^.GetReferenceCount>0) or (assigned(Symbols) and (Symbols^.Count>0)) or (Anc<>nil) then
-                 OpenSymbolBrowser(Origin.X-1,P.Y,
-                   S^.GetName,
-                   ScopeView^.GetText(ScopeView^.Focused,255),
-                   S,@self,
-                   Symbols,S^.References,Anc,S^.MemInfo);
-              end;
-            end;
-      end;
-{    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-        cmGotoSymbol :
-          if Event.InfoPtr=ScopeView then
-           if ReferenceView<>nil then
-            if ReferenceView^.Range>0 then
-              ReferenceView^.GotoItem(0);
-        cmTrackSymbol :
-          if Event.InfoPtr=ScopeView then
-            if (ScopeView<>nil) and (ScopeView^.Range>0) then
-              begin
-                S:=ScopeView^.At(ScopeView^.Focused);
-                if (S^.References<>nil) and (S^.References^.Count>0) then
-                  TrackItem(S^.References^.At(0));
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;}
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbEsc :
-            Close;
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure TBrowserWindow.SetState(AState: Word; Enable: Boolean);
-{var OldState: word;}
-begin
-{  OldState:=State;}
-  inherited SetState(AState,Enable);
-{  if ((State xor OldState) and sfActive)<>0 then
-    if GetState(sfActive)=false then
-      Message(Desktop,evBroadcast,cmClearLineHighlights,nil);}
-end;
-
-procedure TBrowserWindow.Close;
-begin
-  inherited Close;
-end;
-
-procedure TBrowserWindow.SelectTab(BrowserTab: Sw_integer);
-var Tabs: Sw_integer;
-{    PB : PBreakpoint;
-    PS :PString;
-    l : longint; }
-begin
-(*  case BrowserTab of
-    btScope :
-      if assigned(ScopeView) then
-        ScopeView^.Select;
-    btReferences :
-      if assigned(ReferenceView) then
-        ReferenceView^.Select;
-    btBreakWatch :
-      begin
-        if Assigned(Sym) then
-          begin
-            if Pos('proc',Sym^.GetText)>0 then
-          { insert function breakpoint }
-            begin
-               { make it visible }
-               PS:=Sym^.Name;
-               l:=Length(PS^);
-               If PS^[l]='*' then
-                 begin
-                   PB:=BreakpointsCollection^.GetType(bt_function,copy(GetStr(PS),1,l-1));
-                   If Assigned(PB) then
-                     BreakpointsCollection^.Delete(PB);
-                   Sym^.Name:=NewStr(copy(GetStr(PS),1,l-1));
-                   DrawView;
-                   DisposeStr(PS);
-                 end
-               else
-                 begin
-                   Sym^.Name:=NewStr(GetStr(PS)+'*');
-                   DrawView;
-                   New(PB,init_function(GetStr(PS)));
-                   DisposeStr(PS);
-                   BreakpointsCollection^.Insert(PB);
-                   BreakpointsCollection^.Update;
-                 end;
-            end
-          else if pos('var',Sym^.GetText)>0 then
-            { insert watch point }
-            begin
-               { make it visible }
-               PS:=Sym^.Name;
-               l:=Length(PS^);
-               If PS^[l]='*' then
-                 begin
-                   PB:=BreakpointsCollection^.GetType(bt_awatch,copy(PS^,1,l-1));
-                   If Assigned(PB) then
-                     BreakpointsCollection^.Delete(PB);
-                   Sym^.Name:=NewStr(copy(PS^,1,l-1));
-                   DrawView;
-                   DisposeStr(PS);
-                 end
-               else
-                 begin
-                   Sym^.Name:=NewStr(GetStr(PS)+'*');
-                   DrawView;
-                   New(PB,init_type(bt_awatch,GetStr(PS)));
-                   DisposeStr(PS);
-                   BreakpointsCollection^.Insert(PB);
-                   BreakpointsCollection^.Update;
-                 end;
-            end;
-        end;
-      end;
-
-  end;*)
-  Tabs:=0;
-  if assigned(ScopeView) then
-    Tabs:=Tabs or (1 shl btScope);
-  if assigned(ReferenceView) then
-    Tabs:=Tabs or (1 shl btReferences);
-  if assigned(InheritanceView) then
-    Tabs:=Tabs or (1 shl btInheritance);
-  if assigned(MemInfoView) then
-    Tabs:=Tabs or (1 shl btMemInfo);
-  if Assigned(Sym) then
-    if (Pos('proc',Sym^.GetText)>0) or (Pos('var',Sym^.GetText)>0) then
-      Tabs:=Tabs or (1 shl btBreakWatch);
-  if assigned(UnitInfo) then
-    Tabs:=Tabs or (1 shl btUnitInfo);
-  if PageTab<>nil then PageTab^.SetParams(Tabs,BrowserTab);
-end;
-
-function TBrowserWindow.GetPalette: PPalette;
-const S: string[length(CBrowserWindow)] = CBrowserWindow;
-begin
-  GetPalette:=@S;
-end;
-
-procedure OpenSymbolBrowser(X,Y: Sw_integer;const Name,Line: string;S : PSymbol;
-            ParentBrowser : PBrowserWindow;
-            Symbols: PSymbolCollection; References: PReferenceCollection;
-            Inheritance: PObjectSymbol; MemInfo: PSymbolMemInfo);
-var R: TRect;
-    PB : PBrowserWindow;
-    St,st2 : string;
-begin
-  if X=0 then X:=Desktop^.Size.X-35;
-  R.A.X:=X; R.A.Y:=Y;
-  R.B.X:=R.A.X+35; R.B.Y:=R.A.Y+15;
-  while (R.B.Y>Desktop^.Size.Y) do R.Move(0,-1);
-  if assigned(ParentBrowser) then
-    begin
-      st:=GetStr(ParentBrowser^.Prefix)+' '+Name;
-    end
-  else
-    st:=Name;
-  st2:=st;
-  if assigned(S) and ((S^.Flags and sfPointer)<>0) then
-    begin
-      st:=st+'^';
-      if assigned(S^.Ancestor) and
-         ((S^.Ancestor^.Flags and sfRecord)<>0) then
-        st:=st+'.';
-    end
-  else if assigned(S) and ((S^.Flags and sfRecord)<>0) then
-    st:=st+'.';
-
-  PB:=New(PBrowserWindow, Init(R,
-    st2,SearchFreeWindowNo,S,Line,st,
-    Symbols,References,Inheritance,MemInfo));
-{$ifndef GABOR}
-  if (S^.typ=varsym) or (assigned(ParentBrowser) and ParentBrowser^.IsValid) then
-     PB^.IsValid:=true;
-{$endif}
-
-  Desktop^.Insert(PB);
-end;
-
-END.
-{
-  $Log$
-  Revision 1.3  2000-11-13 17:37:42  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.2  2000/11/13 16:59:09  pierre
-   * some function in double removed from fputils unit
-
-  Revision 1.2  2000/10/31 22:35:55  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/09/27 21:06:11  pierre
-   * fix GPF in tbrowserwindow.init
-
-  Revision 1.1  2000/07/13 09:48:36  michael
-  + Initial import
-
-  Revision 1.30  2000/07/05 10:19:07  pierre
-   + display 'variable' for open array size
-
-  Revision 1.29  2000/06/22 09:07:12  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.28  2000/06/16 08:50:42  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.27  2000/05/29 10:44:57  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.26  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.25  2000/04/18 11:42:37  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.24  2000/03/21 23:26:55  pierre
-   adapted to wcedit addition
-
-  Revision 1.23  2000/03/15 10:29:03  pierre
-   * TGDBValue object
-
-  Revision 1.22  2000/03/08 16:53:21  pierre
-   * Value of vars in browsers cleaned up
-
-  Revision 1.21  2000/03/07 21:55:16  pierre
-   + Add current value to browser
-
-  Revision 1.20  1999/11/10 00:42:42  pierre
-    * LookUp function now returns the complete name in browcol
-      and fpsymbol only yakes a part of LoopUpStr
-
-  Revision 1.19  1999/09/16 14:34:59  pierre
-    + TBreakpoint and TWatch registering
-    + WatchesCollection and BreakpointsCollection stored in desk file
-    * Syntax highlighting was broken
-
-  Revision 1.18  1999/07/28 23:11:22  peter
-    * fixes from gabor
-
-  Revision 1.17  1999/06/28 12:35:05  pierre
-    + CloseAllBrowsers needed before compilation to avoid problems
-    + ModulesCollection and GlobalsCollection to avoid memory leaks
-
-  Revision 1.16  1999/06/17 23:44:01  pierre
-   * problem with Inheritance list
-
-  Revision 1.15  1999/04/15 08:58:06  peter
-    * syntax highlight fixes
-    * browser updates
-
-  Revision 1.14  1999/04/07 21:55:53  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.13  1999/03/16 00:44:44  peter
-    * forgotten in last commit :(
-
-  Revision 1.12  1999/03/01 15:42:02  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.11  1999/02/22 11:51:38  peter
-    * browser updates from gabor
-
-  Revision 1.9  1999/02/18 13:44:34  peter
-    * search fixed
-    + backward search
-    * help fixes
-    * browser updates
-
-  Revision 1.7  1999/02/16 12:44:20  pierre
-   * DoubleClick works now
-
-  Revision 1.6  1999/02/10 09:44:59  pierre
-    + added B tab for functions and vars for break/watch
-      TBrowserWindow also stores the symbol itself for break/watchpoints
-
-  Revision 1.5  1999/02/04 17:53:47  pierre
-   + OpenOneSymbolBrowser
-
-  Revision 1.4  1999/02/04 13:16:14  pierre
-   + column info added
-
-  Revision 1.3  1999/01/21 11:54:23  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.2  1999/01/14 21:42:24  peter
-    * source tracking from Gabor
-
-  Revision 1.1  1999/01/12 14:29:40  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.0  1999/01/09 11:49:41  gabor
-     Original implementation
-}

+ 0 - 351
ide/text/fptemplt.pas

@@ -1,351 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Template support routines for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit FPTemplt;
-
-interface
-
-uses FPViews;
-
-const
-      tsDate         = '$DATE';
-      tsDateCustom   = '$DATE(';
-      tsTime         = '$TIME';
-      tsPrompt       = '$PROMPT(';
-
-function  GetTemplateCount: integer;
-function  GetTemplateName(Index: integer): string;
-function  StartTemplate(Index: integer; Editor: PSourceEditor): boolean;
-
-procedure InitTemplates;
-procedure DoneTemplates;
-
-implementation
-
-uses
-  Dos,Objects,
-  Commands,MsgBox,
-  WUtils,
-{$ifdef EDITORS}
-  Editors,
-{$else}
-  WEditor,
-{$endif}
-  FPConst,FPVars,FPString,FPUtils;
-
-type
-    PTemplate = ^TTemplate;
-    TTemplate = record
-      Name : PString;
-      Path : PString;
-    end;
-
-    PTemplateCollection = ^TTemplateCollection;
-    TTemplateCollection = object(TSortedCollection)
-      function  At(Index: Integer): PTemplate;
-      procedure FreeItem(Item: Pointer); virtual;
-      function  Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-    end;
-
-const Templates : PTemplateCollection = nil;
-
-function NewTemplate(const Name, Path: string): PTemplate;
-var P: PTemplate;
-begin
-  New(P);
-  FillChar(P^,SizeOf(P^),0);
-  P^.Name:=NewStr(Name);
-  P^.Path:=NewStr(Path);
-  NewTemplate:=P;
-end;
-
-procedure DisposeTemplate(P: PTemplate);
-begin
-  if assigned(P) then
-   begin
-     if assigned(P^.Name) then
-       DisposeStr(P^.Name);
-     if assigned(P^.Path) then
-       DisposeStr(P^.Path);
-     Dispose(P);
-   end;
-end;
-
-function TTemplateCollection.At(Index: Integer): PTemplate;
-begin
-  At:=inherited At(Index);
-end;
-
-procedure TTemplateCollection.FreeItem(Item: Pointer);
-begin
-  if assigned(Item) then
-    DisposeTemplate(Item);
-end;
-
-function TTemplateCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-var R: Sw_integer;
-    K1: PTemplate absolute Key1;
-    K2: PTemplate absolute Key2;
-begin
-  if K1^.Name^<K2^.Name^ then R:=-1 else
-  if K1^.Name^>K2^.Name^ then R:= 1 else
-  R:=0;
-  Compare:=R;
-end;
-
-function GetTemplateCount: integer;
-var Count: integer;
-begin
-  if Templates=nil then Count:=0 else Count:=Templates^.Count;
-  GetTemplateCount:=Count;
-end;
-
-function GetTemplateName(Index: integer): string;
-begin
-  GetTemplateName:=Templates^.At(Index)^.Name^;
-end;
-
-function SearchStr(const InS, SubS: string; var P: sw_integer): boolean;
-begin
-  P:=Pos(SubS,InS);
-  SearchStr:=(P<>0);
-end;
-
-procedure ReplaceStr(var S: string; StartP,Len: sw_integer; const NewS: string);
-begin
-  Delete(S,StartP,Len);
-  Insert(NewS,S,StartP);
-end;
-
-function ReadStringPos(const InS: string; StartP: sw_integer; var Expr: string; var EndPos: sw_integer): sw_integer;
-const Enclosers : string[2] = '''"';
-var OK: boolean;
-    Encloser: char;
-    P: sw_integer;
-begin
-  OK:=false; Expr:=''; P:=StartP; EndPos:=-1;
-  if length(InS)>=P then
-  begin
-    P:=Pos(InS[P],Enclosers);
-    OK:=(P<>0);
-    if OK then
-    begin
-      OK:=false;
-      Encloser:=Enclosers[P];
-      P:=StartP;
-      Inc(P);
-      while (P<=length(InS)) do
-      begin
-        if InS[P]<>Encloser then
-          Expr:=Expr+InS[P]
-        else
-          if (P+1<=length(InS)) and (InS[P+1]=Encloser) then
-            Expr:=Expr+InS[P]
-          else
-            begin
-              OK:=true;
-              Break;
-            end;
-        Inc(P);
-      end;
-      EndPos:=P;
-    end;
-  end;
-  if OK then
-    ReadStringPos:=length(Expr)
-  else
-    ReadStringPos:=-1;
-end;
-
-{function ReadString(const InS: string; StartP: sw_integer; var Expr: string): sw_integer;
-var P: sw_integer;
-begin
-  ReadString:=ReadStringPos(InS,StartP,Expr,P);
-end;}
-
-function ProcessTemplateLine(var S: string): boolean;
-var OK: boolean;
-    P,EndP: sw_integer;
-    Name,Expr: string;
-begin
-  OK:=true;
-  repeat
-    P:=0; Expr:='';
-    if OK and SearchStr(S,tsPrompt,P) then
-      if ReadStringPos(S,P+length(tsPrompt),Name,EndP)>=0 then
-        if copy(S,EndP+1,1)=')' then
-         begin
-           OK:=InputBox(dialog_fillintemplateparameter,Name,Expr,255)=cmOK;
-           if OK then
-             ReplaceStr(S,P,EndP-P+1+1,Expr);
-         end;
-    if OK and SearchStr(S,tsDateCustom,P) then
-      if ReadStringPos(S,P+length(tsDateCustom),Expr,EndP)>=0 then
-        if copy(S,EndP+1,1)=')' then
-           ReplaceStr(S,P,EndP-P+1+1,FormatDateTimeL(Now,Expr));
-    if OK and SearchStr(S,tsDate,P) then
-      ReplaceStr(S,P,length(tsDate),FormatDateTimeL(Now,'yyyy/mm/dd'));
-    if OK and SearchStr(S,tsTime,P) then
-      ReplaceStr(S,P,length(tsTime),FormatDateTimeL(Now,'hh:nn:ss'));
-  until P=0;
-  ProcessTemplateLine:=OK;
-end;
-
-function ProcessTemplate(Editor: PSourceEditor): boolean;
-var OK: boolean;
-    I: sw_integer;
-    S,OrigS: string;
-begin
-  OK:=true;
-  with Editor^ do
-  for I:=0 to GetLineCount-1 do
-  begin
-    S:=GetDisplayText(I); OrigS:=S;
-    OK:=ProcessTemplateLine(S);
-    if OK=false then Break;
-    if S<>OrigS then
-    begin
-      SetDisplayText(I,S);
-      UpdateAttrs(I,attrAll);
-     end;
-  end;
-  ProcessTemplate:=OK;
-end;
-
-function StartTemplate(Index: integer; Editor: PSourceEditor): boolean;
-var
-    T: PTemplate;
-    OK: boolean;
-begin
-  T:=Templates^.At(Index);
-  OK:=StartEditor(Editor,T^.Path^);
-  if OK then
-  begin
-    ProcessTemplate(Editor);
-  end;
-  StartTemplate:=OK;
-end;
-
-
-{*****************************************************************************
-                                 InitTemplates
-*****************************************************************************}
-
-procedure InitTemplates;
-
-  procedure ScanDir(Dir: PathStr);
-  var SR: SearchRec;
-      S: string;
-      PT : PTemplate;
-      i : sw_integer; 
-  begin
-    if copy(Dir,length(Dir),1)<>DirSep then Dir:=Dir+DirSep;
-    FindFirst(Dir+'*'+TemplateExt,AnyFile,SR);
-    while (DosError=0) do
-    begin
-      S:=NameOf(SR.Name);
-      S:=LowerCaseStr(S);
-      S[1]:=Upcase(S[1]);
-      PT:=NewTemplate(S,FExpand(Dir+SR.Name));
-      if not Templates^.Search(PT,i) then
-        Templates^.Insert(PT)
-      else
-        DisposeTemplate(PT);
-      FindNext(SR);
-    end;
-  {$ifdef FPC}
-    FindClose(SR);
-  {$endif def FPC}
-  end;
-
-begin
-  New(Templates, Init(10,10));
-  ScanDir('.');
-  ScanDir(IDEDir);
-end;
-
-
-procedure DoneTemplates;
-begin
-  if assigned(Templates) then
-    begin
-      Dispose(Templates, Done);
-      Templates:=nil;
-    end;
-end;
-
-END.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:36  michael
-  + Initial import
-
-  Revision 1.10  2000/06/22 09:07:12  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.9  2000/05/02 08:42:28  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.8  1999/06/25 00:33:40  pierre
-   * avoid lost memory on duplicate Template Items
-
-  Revision 1.7  1999/03/08 14:58:11  peter
-    + prompt with dialogs for tools
-
-  Revision 1.6  1999/03/01 15:42:03  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.5  1999/02/18 13:44:35  peter
-    * search fixed
-    + backward search
-    * help fixes
-    * browser updates
-
-  Revision 1.4  1999/02/16 17:13:56  pierre
-   + findclose added for FPC
-
-  Revision 1.3  1999/01/21 11:54:24  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.2  1998/12/28 15:47:52  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.2  1998/12/22 10:39:51  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 1672
ide/text/fptools.pas

@@ -1,1672 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Tool support for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$I globdir.inc}
-unit FPTools;
-
-interface
-
-uses Objects,Drivers,Views,Dialogs,Validate,
-     BrowCol,
-     WViews,
-     FPViews;
-
-const
-      MsgFilterSign = 'BI#PIP#OK'#0;
-
-type
-    TCaptureTarget = (capNone,capMessageWindow,capEditWindow);
-
-    PTool = ^TTool;
-    TTool = object(TObject)
-      constructor Init(const ATitle, AProgramPath, ACommandLine: string; AHotKey: word);
-      function    GetTitle: string; virtual;
-      procedure   GetParams(var ATitle, AProgramPath, ACommandLine: string; var AHotKey: word); virtual;
-      procedure   SetParams(const ATitle, AProgramPath, ACommandLine: string; const AHotKey: word); virtual;
-      destructor  Done; virtual;
-    private
-      Title       : PString;
-      ProgramPath : PString;
-      CommandLine : PString;
-      HotKey      : word;
-    end;
-
-    PToolCollection = ^TToolCollection;
-    TToolCollection = object(TCollection)
-      function At(Index: sw_Integer): PTool;
-    end;
-
-    PToolListBox = ^TToolListBox;
-    TToolListBox = object(TAdvancedListBox)
-      function GetText(Item,MaxLen: Sw_Integer): String; virtual;
-    end;
-
-    PToolParamValidator = ^TToolParamValidator;
-    TToolParamValidator = object(TValidator)
-      function  IsValid(const S: string): Boolean; virtual;
-      procedure Error; virtual;
-    private
-      ErrorPos: integer;
-    end;
-
-    PToolItemDialog = ^TToolItemDialog;
-    TToolItemDialog = object(TCenterDialog)
-      constructor Init(ATool: PTool);
-      function    Execute: Word; virtual;
-    private
-      Tool     : PTool;
-      TitleIL  : PInputLine;
-      ProgramIL: PInputLine;
-      ParamIL  : PInputLine;
-      HotKeyRB : PRadioButtons;
-    end;
-
-    PToolsDialog = ^TToolsDialog;
-    TToolsDialog = object(TCenterDialog)
-      constructor Init;
-      function    Execute: Word; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-    private
-      ToolsLB : PToolListBox;
-      procedure Add;
-      procedure Edit;
-      procedure Delete;
-    end;
-
-    PToolMessage = ^TToolMessage;
-    TToolMessage = object(TMessageItem)
-      constructor Init(AModule: PString; ALine: string; ARow, ACol: sw_integer);
-      function    GetText(MaxLen: Sw_integer): string; virtual;
-    end;
-
-    PToolMessageListBox = ^TToolMessageListBox;
-    TToolMessageListBox = object(TMessageListBox)
-      procedure   NewList(AList: PCollection); virtual;
-      procedure   Clear; virtual;
-      procedure   Update; virtual;
-      function    GetPalette: PPalette; virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      destructor  Done; virtual;
-    end;
-
-    PMessagesWindow = ^TMessagesWindow;
-    TMessagesWindow = object(TFPWindow)
-      constructor Init;
-      procedure   Update; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      function    GetPalette: PPalette; virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      destructor  Done; virtual;
-      procedure   FocusItem(i : sw_integer);
-      procedure   SizeLimits(var Min, Max: TPoint); virtual;
-    private
-      MsgLB : PToolMessageListBox;
-    end;
-
-procedure InitTools;
-function  GetToolCount: sw_integer;
-function  GetToolName(Idx: sw_integer): string;
-function  AddTool(Title, ProgramPath, Params: string; HotKey: word): sw_integer;
-procedure GetToolParams(Idx: sw_integer; var Title, ProgramPath, Params: string; var HotKey: word);
-procedure SetToolParams(Idx: sw_integer; Title, ProgramPath, Params: string; HotKey: word);
-procedure DoneTools;
-
-function GetHotKeyName(Key: word): string;
-
-function ParseToolParams(var Params: string; CheckOnly: boolean): integer;
-
-function  ProcessMessageFile(const MsgFileName: string): boolean;
-procedure AddToolCommand(Command: string);
-procedure AddToolMessage(ModuleName, Text: string; Row, Col: longint);
-procedure ClearToolMessages;
-procedure UpdateToolMessages;
-procedure InitToolTempFiles;
-procedure DoneToolTempFiles;
-
-const
-     ToolFilter     : string[{$ifndef GABOR}128{$else}40{$endif}]      = '';
-     CaptureToolTo  : TCaptureTarget   = capNone;
-     ToolMessages   : PCollection      = nil;
-     ToolModuleNames: PStoreCollection = nil;
-     MessagesWindow : PMessagesWindow  = nil;
-     LastToolMessageFocused : PToolMessage = nil;
-
-procedure RegisterFPTools;
-
-implementation
-
-uses Dos,
-     Commands,App,MsgBox,
-     WConsts,WUtils,WINI,WEditor,
-     FPConst,FPString,FPVars,FPUtils;
-
-{$ifndef NOOBJREG}
-const
-  RToolMessageListBox: TStreamRec = (
-     ObjType: 1600;
-     VmtLink: Ofs(TypeOf(TToolMessageListBox)^);
-     Load:    @TToolMessageListBox.Load;
-     Store:   @TToolMessageListBox.Store
-  );
-  RMessagesWindow: TStreamRec = (
-     ObjType: 1601;
-     VmtLink: Ofs(TypeOf(TMessagesWindow)^);
-     Load:    @TMessagesWindow.Load;
-     Store:   @TMessagesWindow.Store
-  );
-{$endif}
-
-type
-    THotKeyDef = record
-      Name     : string[12];
-      KeyCode  : word;
-    end;
-
-const
-     HotKeys : array[0..9] of THotKeyDef =
-      ( (Name : '~U~nassigned' ; KeyCode : kbNoKey   ),
-        (Name : 'Shift+F~2~'   ; KeyCode : kbShiftF2 ),
-        (Name : 'Shift+F~3~'   ; KeyCode : kbShiftF3 ),
-        (Name : 'Shift+F~4~'   ; KeyCode : kbShiftF4 ),
-        (Name : 'Shift+F~5~'   ; KeyCode : kbShiftF5 ),
-        (Name : 'Shift+F~6~'   ; KeyCode : kbShiftF6 ),
-        (Name : 'Shift+F~7~'   ; KeyCode : kbShiftF7 ),
-        (Name : 'Shift+F~8~'   ; KeyCode : kbShiftF8 ),
-        (Name : 'Shift+F~9~'   ; KeyCode : kbShiftF9 ),
-        (Name : 'Shift+F~1~0'  ; KeyCode : kbShiftF10));
-
-     Tools     : PToolCollection = nil;
-     AbortTool : boolean         = false;
-     ToolTempFiles: PUnsortedStringCollection = nil;
-
-function GetHotKeyCount: integer;
-begin
-  GetHotKeyCount:=ord(High(HotKeys))-ord(Low(HotKeys))+1;
-end;
-
-function GetHotKeyNameByIdx(Idx: integer): string;
-begin
-  GetHotKeyNameByIdx:=HotKeys[Idx].Name;
-end;
-
-function HotKeyToIdx(Key: word): integer;
-var Count,I: integer;
-    Found: boolean;
-begin
-  Count:=GetHotKeyCount; Found:=false;
-  I:=0;
-  while (I<Count) and (Found=false) do
-  begin
-    Found:=HotKeys[I].KeyCode=Key;
-    if Found=false then
-    Inc(I);
-  end;
-  if Found=false then I:=-1;
-  HotKeyToIdx:=I;
-end;
-
-function IdxToHotKey(Idx: integer): word;
-var Count: integer;
-    Key: word;
-begin
-  Count:=GetHotKeyCount;
-  if (0<=Idx) and (Idx<Count) then
-    Key:=HotKeys[Idx].KeyCode
-  else
-    Key:=kbNoKey;
-  IdxToHotKey:=Key;
-end;
-
-function GetHotKeyName(Key: word): string;
-var Idx: integer;
-    S: string;
-begin
-  Idx:=HotKeyToIdx(Key);
-  if Idx=0 then S:='' else
-   if Idx=-1 then S:='???' else
-    S:=GetHotKeyNameByIdx(Idx);
-  GetHotKeyName:=S;
-end;
-
-function WriteToolMessagesToFile(FileName: string): boolean;
-var OK: boolean;
-    f: text;
-    M: PToolMessage;
-    I: sw_integer;
-begin
-  I:=0;
-  Assign(f,FileName);
-{$I-}
-  Rewrite(f);
-  OK:=EatIO=0;
-  if Assigned(ToolMessages) then
-  while OK and (I<ToolMessages^.Count) do
-  begin
-    M:=ToolMessages^.At(I);
-    writeln(f,GetStr(M^.Module)+#0+GetStr(M^.Text)+#0+IntToStr(M^.Row)+#0+IntToStr(M^.Col));
-    Inc(I);
-    OK:=EatIO=0;
-  end;
-  Close(f);
-  EatIO;
-{$I+}
-  WriteToolMessagesToFile:=OK;
-end;
-
-constructor TTool.Init(const ATitle, AProgramPath, ACommandLine: string; AHotKey: word);
-begin
-  inherited Init;
-  SetParams(ATitle,AProgramPath,ACommandLine,AHotKey);
-end;
-
-function TTool.GetTitle: string;
-begin
-  GetTitle:=KillTilde(GetStr(Title));
-end;
-
-procedure TTool.GetParams(var ATitle, AProgramPath, ACommandLine: string; var AHotKey: word);
-begin
-  ATitle:=GetStr(Title); AProgramPath:=GetStr(ProgramPath);
-  ACommandLine:=GetStr(CommandLine);
-  AHotKey:=HotKey;
-end;
-
-procedure TTool.SetParams(const ATitle, AProgramPath, ACommandLine: string; const AHotKey: word);
-begin
-  if Title<>nil then DisposeStr(Title); Title:=nil;
-  if ProgramPath<>nil then DisposeStr(ProgramPath); ProgramPath:=nil;
-  if CommandLine<>nil then DisposeStr(CommandLine); CommandLine:=nil;
-  Title:=NewStr(ATitle); ProgramPath:=NewStr(AProgramPath);
-  CommandLine:=NewStr(ACommandLine);
-  HotKey:=AHotKey;
-end;
-
-destructor TTool.Done;
-begin
-  inherited Done;
-  if Title<>nil then DisposeStr(Title);
-  if ProgramPath<>nil then DisposeStr(ProgramPath);
-  if CommandLine<>nil then DisposeStr(CommandLine);
-end;
-
-function TToolCollection.At(Index: sw_Integer): PTool;
-begin
-  At:=inherited At(Index);
-end;
-
-function TToolListBox.GetText(Item,MaxLen: sw_integer): String;
-var S: string;
-    P: PTool;
-begin
-  P:=List^.At(Item);
-  S:=P^.GetTitle;
-  GetText:=copy(S,1,MaxLen);
-end;
-
-procedure InitTools;
-begin
-  if Tools<>nil then DoneTools;
-  New(Tools, Init(10,20));
-end;
-
-function  GetToolCount: sw_integer;
-var Count: integer;
-begin
-  if Tools=nil then Count:=0 else
-    Count:=Tools^.Count;
-  GetToolCount:=Count;
-end;
-
-function GetToolName(Idx: sw_integer): string;
-var S1,S2: string;
-    W: word;
-begin
-  GetToolParams(Idx,S1,S2,S2,W);
-  GetToolName:=KillTilde(S1);
-end;
-
-function AddTool(Title, ProgramPath, Params: string; HotKey: word): sw_integer;
-var P: PTool;
-begin
-  if Tools=nil then InitTools;
-  New(P, Init(Title,ProgramPath,Params,HotKey));
-  Tools^.Insert(P);
-  AddTool:=Tools^.IndexOf(P);
-end;
-
-procedure GetToolParams(Idx: sw_integer; var Title, ProgramPath, Params: string; var HotKey: word);
-var P: PTool;
-begin
-  P:=Tools^.At(Idx);
-  P^.GetParams(Title,ProgramPath,Params,HotKey);
-end;
-
-procedure SetToolParams(Idx: sw_integer; Title, ProgramPath, Params: string; HotKey: word);
-var P: PTool;
-begin
-  P:=Tools^.At(Idx);
-  P^.GetParams(Title,ProgramPath,Params,HotKey);
-end;
-
-procedure DoneTools;
-begin
-  if Tools<>nil then Dispose(Tools, Done); Tools:=nil;
-end;
-
-procedure TToolParamValidator.Error;
-begin
-  MsgParms[1].Long:=ErrorPos;
-  ErrorBox(msg_errorparsingparametersatpos,@MsgParms);
-end;
-
-function TToolParamValidator.IsValid(const S: string): Boolean;
-var P: string;
-begin
-  P:=S;
-  ErrorPos:=ParseToolParams(P,true);
-  IsValid:=ErrorPos=0;
-end;
-
-constructor TToolItemDialog.Init(ATool: PTool);
-var R,R2,R3: TRect;
-    Items: PSItem;
-    I,KeyCount: sw_integer;
-begin
-  KeyCount:=GetHotKeyCount;
-
-  R.Assign(0,0,60,Max(3+KeyCount,12));
-  inherited Init(R,dialog_modifynewtool);
-  Tool:=ATool;
-
-  GetExtent(R); R.Grow(-3,-2); R3.Copy(R);
-  Inc(R.A.Y); R.B.Y:=R.A.Y+1; R.B.X:=R.A.X+36;
-  New(TitleIL, Init(R, 128)); Insert(TitleIL);
-  R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, label_toolprop_title, TitleIL)));
-  R.Move(0,3);
-  New(ProgramIL, Init(R, 128)); Insert(ProgramIL);
-  R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, label_toolprop_programpath, ProgramIL)));
-  R.Move(0,3);
-  New(ParamIL, Init(R, 128)); Insert(ParamIL);
-  ParamIL^.SetValidator(New(PToolParamValidator, Init));
-  R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, label_toolprop_commandline, ParamIL)));
-
-  R.Copy(R3); Inc(R.A.X,38); R.B.Y:=R.A.Y+KeyCount;
-  Items:=nil;
-  for I:=KeyCount-1 downto 0 do
-    Items:=NewSItem(GetHotKeyNameByIdx(I), Items);
-  New(HotKeyRB, Init(R, Items));
-  Insert(HotKeyRB);
-
-  InsertButtons(@Self);
-
-  TitleIL^.Select;
-end;
-
-function TToolItemDialog.Execute: Word;
-var R: word;
-    S1,S2,S3: string;
-    W: word;
-    L: longint;
-begin
-  Tool^.GetParams(S1,S2,S3,W);
-  TitleIL^.SetData(S1); ProgramIL^.SetData(S2); ParamIL^.SetData(S3);
-  L:=HotKeyToIdx(W); if L=-1 then L:=255;
-  HotKeyRB^.SetData(L);
-  R:=inherited Execute;
-  if R=cmOK then
-  begin
-    TitleIL^.GetData(S1); ProgramIL^.GetData(S2); ParamIL^.GetData(S3);
-    HotKeyRB^.GetData(L); W:=IdxToHotKey(L);
-    Tool^.SetParams(S1,S2,S3,W);
-  end;
-  Execute:=R;
-end;
-
-constructor TToolsDialog.Init;
-var R,R2,R3: TRect;
-    SB: PScrollBar;
-begin
-  R.Assign(0,0,46,16);
-  inherited Init(R,dialog_tools);
-
-  GetExtent(R); R.Grow(-3,-2); Inc(R.A.Y); R3.Copy(R); Dec(R.B.X,12);
-  R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
-  New(SB, Init(R2)); Insert(SB);
-  New(ToolsLB, Init(R,1,SB));
-  Insert(ToolsLB);
-  R2.Copy(R); R2.Move(0,-1); R2.B.Y:=R2.A.Y+1; Dec(R2.A.X);
-  Insert(New(PLabel, Init(R2, label_tools_programtitles, ToolsLB)));
-
-  R.Copy(R3); R.A.X:=R.B.X-10; R.B.Y:=R.A.Y+2;
-  Insert(New(PButton, Init(R, button_OK, cmOK, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Edit, cmEditItem, bfDefault)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_New, cmAddItem, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Delete, cmDeleteItem, bfNormal)));
-  R.Move(0,2);
-  Insert(New(PButton, Init(R, button_Cancel, cmCancel, bfNormal)));
-  SelectNext(false);
-end;
-
-procedure TToolsDialog.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-begin
-  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbIns  :
-            Message(@Self,evCommand,cmAddItem,nil);
-          kbDel  :
-            Message(@Self,evCommand,cmDeleteItem,nil);
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmListItemSelected :
-          if Event.InfoPtr=pointer(ToolsLB) then
-            Message(@Self,evCommand,cmEditItem,nil);
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmAddItem    : Add;
-          cmDeleteItem : Delete;
-          cmEditItem   : Edit;
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TToolsDialog.Execute: Word;
-var R: word;
-    C: PToolCollection;
-    I: integer;
-    S1,S2,S3: string;
-    W: word;
-begin
-  New(C, Init(10,20));
-  if Tools<>nil then
-  for I:=0 to Tools^.Count-1 do
-    begin
-      Tools^.At(I)^.GetParams(S1,S2,S3,W);
-      C^.Insert(New(PTool, Init(S1,S2,S3,W)));
-    end;
-  ToolsLB^.NewList(C);
-  R:=inherited Execute;
-  if R=cmOK then
-    begin
-      if Tools<>nil then Dispose(Tools, Done);
-      Tools:=C;
-      Message(Application,evBroadcast,cmUpdateTools,nil);
-    end
-  else
-    Dispose(C, Done);
-  Execute:=R;
-end;
-
-procedure TToolsDialog.Add;
-var P: PTool;
-    IC: boolean;
-    S1,S2,S3: string;
-    W: word;
-begin
-  if ToolsLB^.Range>=MaxToolCount then
-    begin InformationBox(msg_cantinstallmoretools,nil); Exit; end;
-  IC:=ToolsLB^.Range=0;
-  if IC=false then
-    begin
-      P:=ToolsLB^.List^.At(ToolsLB^.Focused);
-      P^.GetParams(S1,S2,S3,W);
-    end
-  else
-    begin
-      S1:=''; S2:=''; S3:=''; W:=0;
-    end;
-  New(P, Init(S1,S2,S3,W));
-  if Application^.ExecuteDialog(New(PToolItemDialog, Init(P)), nil)=cmOK then
-    begin
-      ToolsLB^.List^.Insert(P);
-      ToolsLB^.SetRange(ToolsLB^.List^.Count);
-      ReDraw;
-    end
-  else
-    Dispose(P, Done);
-end;
-
-procedure TToolsDialog.Edit;
-var P: PTool;
-begin
-  if ToolsLB^.Range=0 then Exit;
-  P:=ToolsLB^.List^.At(ToolsLB^.Focused);
-  Application^.ExecuteDialog(New(PToolItemDialog, Init(P)), nil);
-  ReDraw;
-end;
-
-procedure TToolsDialog.Delete;
-begin
-  if ToolsLB^.Range=0 then Exit;
-  ToolsLB^.List^.AtFree(ToolsLB^.Focused);
-  ToolsLB^.SetRange(ToolsLB^.List^.Count);
-  ReDraw;
-end;
-
-(*procedure ReplaceStr(var S: string; const What,NewS: string);
-var I : integer;
-begin
-  repeat
-    I:=Pos(What,S);
-    if I>0 then
-    begin
-      Delete(S,I,length(What));
-      Insert(NewS,S,I);
-    end;
-  until I=0;
-end;
-
-procedure ReplaceStrI(var S: string; What: string; const NewS: string);
-var I : integer;
-    UpcaseS: string;
-begin
-  UpcaseS:=UpcaseStr(S); What:=UpcaseStr(What);
-  repeat
-    I:=Pos(What,UpcaseS);
-    if I>0 then
-    begin
-      Delete(S,I,length(What));
-      Insert(NewS,S,I);
-    end;
-  until I=0;
-end;*)
-
-function GetCoordEntry(F: PINIFile; Section, Entry: string; var P: TPoint): boolean;
-var OK: boolean;
-    S: string;
-    Px: integer;
-begin
-  S:=F^.GetEntry(Section,Entry,'');
-  S:=Trim(S);
-  OK:=(S<>'') and (S[1]='(') and (S[length(S)]=')');
-  if OK then S:=copy(S,2,length(S)-2);
-  Px:=Pos(',',S);
-  OK:=OK and (Px>0);
-  if OK then P.X:=StrToInt(copy(S,1,Px-1));
-  OK:=OK and (LastStrToIntResult=0);
-  if OK then P.Y:=StrToInt(copy(S,Px+1,High(S)));
-  OK:=OK and (LastStrToIntResult=0);
-  GetCoordEntry:=OK;
-end;
-
-function ExecutePromptDialog(const FileName: string; var Params: string): boolean;
-const
-      MaxViews         = 20;
-      MaxViewNameLen   = 40;
-      MaxValueLen      = 80;
-
-      secMain          = 'MAIN';
-      { Main section entries }
-      tmeTitle         = 'TITLE';
-      tmeCommandLine   = 'COMMANDLINE';
-      tmeSize          = 'SIZE';
-      tmeDefaultView   = 'DEFAULT';
-      { View section entries }
-      tieType          = 'TYPE';
-      tieOrigin        = 'ORIGIN';
-      tieSize          = 'SIZE';
-  {*} tieDefault       = 'DEFAULT';
-      tieValue         = 'VALUE';
-      { Additional CheckBox view section entries }
-      tieName          = 'NAME';
-      tieOnParm        = 'ON';
-      tieOffParm       = 'OFF';
-      { Additional CheckBox view section entries }
-      tieItem          = 'ITEM';
-      tieParam         = 'PARAM';
-      { Additional InputLine view section entries }
-      tieMaxLen        = 'MAXLEN';
-      { Additional Label view section entries }
-      tieLink          = 'LINK';
-      tieText          = 'TEXT';
-      { Additional Memo view section entries }
-      tieFileName      = 'FILENAME';
-
-      { View types }
-      vtCheckBox       = 1;
-      vtRadioButton    = 2;
-      vtInputLine      = 3;
-      vtMemo           = 4;
-      vtLabel          = 127;
-
-      vtsCheckBox      = 'CHECKBOX';
-      vtsRadioButton   = 'RADIOBUTTON';
-      vtsInputLine     = 'INPUTLINE';
-      vtsLabel         = 'LABEL';
-      vtsMemo          = 'MEMO';
-
-var Title        : string;
-    DSize        : TPoint;
-    CmdLine      : string;
-    ViewCount    : Sw_integer;
-    ViewNames    : array[0..MaxViews-1] of string[MaxViewNameLen];
-    ViewTypes    : array[0..MaxViews-1] of byte;
-    ViewBounds   : array[0..MaxViews-1] of TRect;
-    ViewPtrs     : array[0..MaxViews-1] of PView;
-    ViewValues   : array[0..MaxViews-1] of string[MaxValueLen];
-    ViewItemCount: array[0..MaxViews-1] of sw_integer;
-
-function BuildPromptDialogInfo(F: PINIFile): boolean;
-var
-  OK: boolean;
-  _IS: PINISection;
-
-  procedure ProcessSection(Sec: PINISection);{$ifndef FPC}far;{$endif}
-  var P1,P2: TPoint;
-      Typ: string;
-      Count: sw_integer;
-  begin
-    if (OK=false) or
-       ( (UpcaseStr(Sec^.GetName)=secMain) or
-         (UpcaseStr(Sec^.GetName)=UpcaseStr(MainSectionName)) ) then
-      Exit;
-
-    ViewItemCount[ViewCount]:=0;
-
-    OK:=(Sec^.SearchEntry(tieType)<>nil) and
-        (Sec^.SearchEntry(tieOrigin)<>nil) and
-        (Sec^.SearchEntry(tieSize)<>nil);
-    if OK=false then
-      begin ErrorBox(FormatStrStr(msg_requiredparametermissingin,Sec^.GetName),nil); Exit; end;
-
-    Typ:=UpcaseStr(Trim(F^.GetEntry(Sec^.GetName,tieType,'')));
-    if Typ=vtsCheckBox    then ViewTypes[ViewCount]:=vtCheckBox    else
-    if Typ=vtsRadioButton then ViewTypes[ViewCount]:=vtRadioButton else
-    if Typ=vtsInputLine   then ViewTypes[ViewCount]:=vtInputLine   else
-    if Typ=vtsLabel       then ViewTypes[ViewCount]:=vtLabel       else
-    if Typ=vtsMemo        then ViewTypes[ViewCount]:=vtMemo        else
-     begin OK:=false; ErrorBox(FormatStrStr(msg_unknowntypein,Sec^.GetName),nil); Exit; end;
-
-    ViewNames[ViewCount]:=Sec^.GetName;
-    GetCoordEntry(F,Sec^.GetName,tieOrigin,P1);
-    GetCoordEntry(F,Sec^.GetName,tieSize,P2);
-    ViewBounds[ViewCount].Assign(P1.X,P1.Y,P1.X+P2.X,P1.Y+P2.Y);
-    ViewValues[ViewCount]:=F^.GetEntry(Sec^.GetName,tieValue,'');
-
-    case ViewTypes[ViewCount] of
-      vtLabel      :
-        begin
-          OK:=OK and (Sec^.SearchEntry(tieLink)<>nil) and
-                     (Sec^.SearchEntry(tieText)<>nil);
-          if OK=false then
-            begin ErrorBox(FormatStrStr(msg_requiredpropertymissingin,Sec^.GetName),nil); Exit; end;
-        end;
-      vtInputLine  : ;
-      vtMemo  : ;
-      vtCheckBox   :
-        begin
-          OK:=OK and (Sec^.SearchEntry(tieName)<>nil);
-          if OK=false then
-            begin ErrorBox(FormatStrStr2(msg_propertymissingin,tieName,Sec^.GetName),nil); Exit; end;
-        end;
-      vtRadioButton:
-        begin
-          Count:=0;
-          while Sec^.SearchEntry(tieItem+IntToStr(Count+1))<>nil do
-            Inc(Count);
-          ViewItemCount[ViewCount]:=Count;
-          OK:=Count>0;
-          if OK=false then
-            begin ErrorBox(FormatStrStr(msg_invaliditemsin,Sec^.GetName),nil); Exit; end;
-        end;
-    end;
-
-    if OK then Inc(ViewCount);
-  end;
-
-begin
-  BuildPromptDialogInfo:=false;
-  _IS:=F^.SearchSection(secMain);
-  OK:=_IS<>nil;
-  if OK then OK:=(_IS^.SearchEntry(tmeTitle)<>nil) and
-                 (_IS^.SearchEntry(tmeSize)<>nil) and
-                 (_IS^.SearchEntry(tmeCommandLine)<>nil);
-  if OK then
-  begin
-    Title:=F^.GetEntry(secMain,tmeTitle,'');
-    OK:=OK and GetCoordEntry(F,secMain,tmeSize,DSize);
-    CmdLine:=F^.GetEntry(secMain,tmeCommandLine,'');
-    OK:=OK and (CmdLine<>'');
-  end;
-  if OK=false then
-    begin ErrorBox(FormatStrStr(msg_requiredpropertymissingin,_IS^.GetName),nil); Exit; end;
-
-  if OK then
-    begin
-      ViewCount:=0;
-      F^.ForEachSection(@ProcessSection);
-    end;
-  BuildPromptDialogInfo:=OK;
-end;
-function SearchViewByName(Name: string): integer;
-var I,Idx: Sw_integer;
-begin
-  Idx:=-1; Name:=UpcaseStr(Name);
-  for I:=0 to ViewCount-1 do
-    if UpcaseStr(ViewNames[I])=Name then
-      begin
-        Idx:=I;
-        Break;
-      end;
-  SearchViewByName:=Idx;
-end;
-function GetParamValueStr(F: PINIFile; Idx: integer): string;
-var S: string;
-    Entry: string[20];
-begin
-  S:='???';
-  case ViewTypes[Idx] of
-    vtLabel     :
-      S:='';
-    vtMemo :
-      begin
-        S:=F^.GetEntry(ViewNames[Idx],tieFileName,'');
-        if S='' then S:=GenTempFileName;
-        ToolTempFiles^.InsertStr(S);
-        if PFPMemo(ViewPtrs[Idx])^.SaveToFile(S)=false then
-          ErrorBox(FormatStrStr(msg_errorsavingfile,S),nil);
-      end;
-    vtInputLine :
-      S:=PInputLine(ViewPtrs[Idx])^.Data^;
-    vtCheckBox  :
-      with PCheckBoxes(ViewPtrs[Idx])^ do
-      begin
-        if Mark(0) then Entry:=tieOnParm else Entry:=tieOffParm;
-        S:=F^.GetEntry(ViewNames[Idx],Entry,'');
-      end;
-    vtRadioButton :
-      with PRadioButtons(ViewPtrs[Idx])^ do
-      begin
-        Entry:=tieParam+IntToStr(Value+1);
-        S:=F^.GetEntry(ViewNames[Idx],Entry,'');
-      end;
-  end;
-  GetParamValueStr:=S;
-end;
-function ExtractPromptDialogParams(F: PINIFile; var Params: string): boolean;
-function ReplacePart(StartP,EndP: integer; const S: string): integer;
-begin
-  Params:=copy(Params,1,StartP-1)+S+copy(Params,EndP+1,255);
-  ReplacePart:=length(S)-(EndP-StartP+1);
-end;
-var OptName: string;
-    OK: boolean;
-    C: char;
-    OptStart: integer;
-    InOpt: boolean;
-    I,Idx: integer;
-    S: string;
-begin
-  Params:=CmdLine;
-  I:=1; InOpt:=false; OK:=true;
-  while OK and (I<=length(Params)) do
-    begin
-      C:=Params[I];
-      if C='%' then
-        begin
-          InOpt:=not InOpt;
-          if InOpt then
-            begin
-              OptName:='';
-              OptStart:=I;
-            end
-          else
-            begin
-              OptName:=UpcaseStr(OptName);
-              Idx:=SearchViewByName(OptName);
-              OK:=Idx<>-1;
-              if OK then
-                begin
-                  S:=GetParamValueStr(F,Idx);
-                  if (S='') and (Params[I+1]=' ') then Inc(I);
-                  I:=I+ReplacePart(OptStart,I,S);
-                end;
-            end;
-        end
-      else
-        if InOpt then
-          OptName:=OptName+C;
-      Inc(I);
-    end;
-  ExtractPromptDialogParams:=OK;
-end;
-function ExecPromptDialog(F: PINIFile): boolean;
-var R: TRect;
-    PromptDialog: PCenterDialog;
-    Re: integer;
-    OK: boolean;
-    I,J,MaxLen: integer;
-    Memo: PFPMemo;
-    IL: PInputLine;
-    CB: PCheckBoxes;
-    RB: PRadioButtons;
-    LV: PLabel;
-    SI: PSItem;
-    S: string;
-    P: PView;
-begin
-  OK:=true;
-  R.Assign(0,0,DSize.X,DSize.Y);
-  New(PromptDialog, Init(R, Title));
-  with PromptDialog^ do
-  begin
-    for I:=0 to ViewCount-1 do
-      begin
-        case ViewTypes[I] of
-          vtLabel :
-            begin
-              S:=F^.GetEntry(ViewNames[I],tieLink,'');
-              J:=SearchViewByName(S);
-              if J=-1 then P:=nil else
-                P:=ViewPtrs[J];
-              S:=F^.GetEntry(ViewNames[I],tieText,'');
-              New(LV, Init(ViewBounds[I], S, P));
-              ViewPtrs[I]:=LV;
-            end;
-          vtInputLine :
-            begin
-              MaxLen:=F^.GetIntEntry(ViewNames[I],tieMaxLen,80);
-              New(IL, Init(ViewBounds[I], MaxLen));
-              IL^.Data^:=ViewValues[I];
-              ViewPtrs[I]:=IL;
-            end;
-          vtMemo :
-            begin
-{              MaxLen:=F^.GetIntEntry(ViewNames[I],tieMaxLen,80);}
-              New(Memo, Init(ViewBounds[I],nil,nil,nil));
-              if ViewValues[I]<>'' then
-                Memo^.AddLine(ViewValues[I]);
-              ViewPtrs[I]:=Memo;
-            end;
-          vtCheckBox :
-            begin
-              New(CB, Init(ViewBounds[I],
-               NewSItem(
-                F^.GetEntry(ViewNames[I],tieName,''),
-                nil)));
-              if StrToInt(ViewValues[I])=1 then
-                CB^.Press(0);
-              ViewPtrs[I]:=CB;
-            end;
-          vtRadioButton :
-            begin
-              SI:=nil;
-              for J:=ViewItemCount[I] downto 1 do
-                SI:=NewSItem(F^.GetEntry(ViewNames[I],tieItem+IntToStr(J),''),SI);
-              New(RB, Init(ViewBounds[I], SI));
-              RB^.Press(StrToInt(ViewValues[I]));
-              ViewPtrs[I]:=RB;
-            end;
-        end;
-        Insert(ViewPtrs[I]);
-      end;
-  end;
-  InsertButtons(PromptDialog);
-  S:=F^.GetEntry(secMain,tmeDefaultView,'');
-  if S<>'' then
-    begin
-      S:=UpcaseStr(S);
-      I:=0;
-      while (I<ViewCount) and (UpcaseStr(ViewNames[I])<>S) do
-        Inc(I);
-      if UpcaseStr(ViewNames[I])=S then
-        ViewPtrs[I]^.Select;
-    end;
-  Re:=Desktop^.ExecView(PromptDialog);
-  OK:=OK and (Re=cmOK);
-  AbortTool:=(Re<>cmOK);
-  if OK then OK:=ExtractPromptDialogParams(F,Params);
-  if PromptDialog<>nil then Dispose(PromptDialog, Done);
-  ExecPromptDialog:=OK;
-end;
-var OK: boolean;
-    F: PINIFile;
-    Fn : string;
-begin
-  Fn:=LocateFile(FileName);
-  if Fn='' then
-   Fn:=FileName;
-  if not ExistsFile(Fn) then
-    ErrorBox('Can''t read '+Fn,nil)
-  else
-    begin
-      New(F, Init(Fn));
-      OK:=F<>nil;
-      if OK then
-        begin
-          OK:=BuildPromptDialogInfo(F);
-          if OK then
-            OK:=ExecPromptDialog(F);
-        end;
-      if F<>nil then Dispose(F, Done);
-    end;
-  ExecutePromptDialog:=OK;
-end;
-
-function ParseToolParams(var Params: string; CheckOnly: boolean): integer;
-var Err: integer;
-    W: PSourceWindow;
-procedure ParseParams(Pass: sw_integer);
-var I: sw_integer;
-function IsAlpha(Ch: char): boolean;
-begin
-  IsAlpha:=(Upcase(Ch) in['A'..'Z','_','$']);
-end;
-function ReplacePart(StartP,EndP: integer; const S: string): integer;
-begin
-  Params:=copy(Params,1,StartP-1)+S+copy(Params,EndP+1,255);
-  ReplacePart:=length(S)-(EndP-StartP+1);
-end;
-function Consume(Ch: char): boolean;
-var OK: boolean;
-begin
-  OK:=Params[I]=Ch;
-  if OK then Inc(I);
-  Consume:=OK;
-end;
-function ReadTill(var S: string; C: char): boolean;
-var Found: boolean;
-begin
-  Found:=false; S:='';
-  while (I<=length(Params)) and (Found=false) do
-    begin
-      Found:=Params[I]=C;
-      if Found=false then
-        begin
-          S:=S+Params[I];
-          Inc(I);
-        end;
-    end;
-  ReadTill:=Found;
-end;
-var C,PrevC: char;
-    WordS: string;
-    LastWordStart: sw_integer;
-    L: longint;
-    S: string;
-    D: DirStr; N: NameStr; E: ExtStr;
-begin
-  I:=1; WordS:=''; LastWordStart:=I; PrevC:=' ';
-  while (I<=length(Params)+1) and (Err=0) do
-  begin
-    if I<=length(Params) then C:=Params[I];
-    if (I<=length(Params)) and IsAlpha(C) then
-     begin
-       if (I=1) or (IsAlpha(PrevC)=false) then
-         begin WordS:=''; LastWordStart:=I; end;
-{       if IsAlpha(C) then ForceConcat:=false;}
-       WordS:=WordS+C;
-     end
-    else
-      begin
-        WordS:=UpcaseStr(Trim(WordS));
-        if WordS<>'' then
-        if (WordS='$CAP') then
-          begin
-            if (Pass=0) then
-              if (Params[I]=' ') and (I<=High(Params)) then Params[I]:='_';
-          end else
-        if (WordS='$CAP_MSG') then
-          begin
-            if (Pass=2) then
-              if Consume('(')=false then Err:=I else
-              if ReadTill(S,')')=false then Err:=I else
-              begin
-                Consume(')');
-                I:=I+ReplacePart(LastWordStart,I-1,'')-1;
-                ToolFilter:=S;
-                CaptureToolTo:=capMessageWindow;
-              end;
-          end else
-        if (WordS='$CAP_EDIT') then
-          begin
-            if (Pass=2) then
-              begin
-                I:=I+ReplacePart(LastWordStart,I-1,'')-1;
-                CaptureToolTo:=capEditWindow;
-              end;
-          end else
-        if (WordS='$COL') then
-          begin
-            if (Pass=1) then
-            begin
-              if W=nil then L:=0 else
-                L:=W^.Editor^.CurPos.X+1;
-              I:=I+ReplacePart(LastWordStart,I-1,IntToStr(L))-1;
-            end;
-          end else
-        if (WordS='$CONFIG') then
-          begin
-            if (Pass=1) then
-              I:=I+ReplacePart(LastWordStart,I-1,IniFileName)-1;
-          end else
-        if (WordS='$DIR') then
-          begin
-            if (Pass=2) then
-              if Consume('(')=false then Err:=I else
-              if ReadTill(S,')')=false then Err:=I else
-              begin
-                Consume(')');
-                FSplit(S,D,N,E);
-                L:=Pos(':',D);if L>0 then Delete(D,1,L);
-                I:=I+ReplacePart(LastWordStart,I-1,D)-1;
-              end;
-          end else
-        if (WordS='$DRIVE') then
-          begin
-            if (Pass=2) then
-              if Consume('(')=false then Err:=I else
-              if ReadTill(S,')')=false then Err:=I else
-              begin
-                Consume(')');
-                FSplit(S,D,N,E);
-                L:=Pos(':',D);
-                D:=copy(D,1,L);
-                I:=I+ReplacePart(LastWordStart,I-1,D)-1;
-              end;
-          end else
-        if (WordS='$EDNAME') then
-          begin
-            if (Pass=1) then
-            begin
-              if W=nil then S:='' else
-                S:=W^.Editor^.FileName;
-              I:=I+ReplacePart(LastWordStart,I-1,S)-1;
-            end;
-          end else
-        if (WordS='$EXENAME') then
-          begin
-            if (Pass=1) then
-              I:=I+ReplacePart(LastWordStart,I-1,EXEFile)-1;
-          end else
-        if (WordS='$EXT') then
-          begin
-            if (Pass=2) then
-              if Consume('(')=false then Err:=I else
-              if ReadTill(S,')')=false then Err:=I else
-              begin
-                Consume(')');
-                FSplit(S,D,N,E); E:=copy(E,2,High(E));
-                I:=I+ReplacePart(LastWordStart,I-1,E)-1;
-              end;
-          end else
-        if (WordS='$LINE') then
-          begin
-            if (Pass=1) then
-            begin
-              if W=nil then L:=0 else
-                L:=W^.Editor^.CurPos.Y+1;
-              I:=I+ReplacePart(LastWordStart,I-1,IntToStr(L))-1;
-            end;
-          end else
-        if (WordS='$NAME') then
-          begin
-            if (Pass=2) then
-              if Consume('(')=false then Err:=I else
-              if ReadTill(S,')')=false then Err:=I else
-              begin
-                Consume(')');
-                FSplit(S,D,N,E);
-                I:=I+ReplacePart(LastWordStart,I-1,N)-1;
-              end;
-          end else
-        if (WordS='$NAMEEXT') then
-          begin
-            if (Pass=2) then
-              if Consume('(')=false then Err:=I else
-              if ReadTill(S,')')=false then Err:=I else
-              begin
-                Consume(')');
-                FSplit(S,D,N,E);
-                I:=I+ReplacePart(LastWordStart,I-1,N+E)-1;
-              end;
-          end else
-        if (WordS='$NOSWAP') then
-          begin
-            if (Pass=1) then
-            begin
-              I:=I+ReplacePart(LastWordStart,I-1,'')-1;
-            end;
-          end else
-        if (WordS='$DRIVE') then
-          begin
-            if (Pass=2) then
-              if Consume('(')=false then Err:=I else
-              if ReadTill(S,')')=false then Err:=I else
-              begin
-                Consume(')');
-                FSplit(S,D,N,E);
-                L:=Pos(':',D); if L=0 then L:=-1;
-                D:=copy(D,1,L+1);
-                I:=I+ReplacePart(LastWordStart,I-1,D)-1;
-              end;
-          end else
-        if (WordS='$PROMPT') then
-          begin
-            if (Pass=3) then
-              if Params[I]='(' then
-                begin
-                  if Consume('(')=false then Err:=I else
-                  if ReadTill(S,')')=false then Err:=I else
-                  begin
-                    Consume(')');
-                    if S='' then Err:=I-1 else
-                      if CheckOnly=false then
-                        if ExecutePromptDialog(S,S)=false then
-                          Err:=I
-                        else
-                          I:=I+ReplacePart(LastWordStart,I-1,S)-1;
-                  end;
-                end
-              else { just prompt for parms }
-                begin
-                  I:=I+ReplacePart(LastWordStart,I-1,'')-1;
-                  if CheckOnly=false then
-                    begin
-                      S:=copy(Params,I+1,High(Params));
-                      if InputBox(dialog_programarguments, label_enterprogramargument,
-                        S,High(Params)-I+1)=cmOK then
-                        begin
-                          ReplacePart(LastWordStart,255,S);
-                          I:=255;
-                        end
-                      else
-                        Err:=-1;
-                    end;
-                end;
-          end else
-        if (WordS='$SAVE') then
-          begin
-            if (Pass=0) then
-              if (Params[I]=' ') and (I<=High(Params)) then Params[I]:='_';
-          end else
-        if (WordS='$SAVE_ALL') then
-          begin
-            if (Pass=2) then
-              begin
-                I:=I+ReplacePart(LastWordStart,I-1,'')-1;
-                Message(Application,evCommand,cmSaveAll,nil);
-              end;
-          end else
-        if (WordS='$SAVE_CUR') then
-          begin
-            if (Pass=2) then
-              begin
-                I:=I+ReplacePart(LastWordStart,I-1,'')-1;
-                Message(W,evCommand,cmSave,nil);
-              end;
-          end else
-        if (WordS='$SAVE_PROMPT') then
-          begin
-            if (Pass=2) then
-              begin
-                I:=I+ReplacePart(LastWordStart,I-1,'')-1;
-                if W<>nil then
-                  if W^.Editor^.SaveAsk(true)=false then
-                    Err:=-1;
-              end;
-          end else
-        if (WordS='$WRITEMSG') then
-          begin
-            if (Pass=2) then
-              if Consume('(')=false then Err:=I else
-              if ReadTill(S,')')=false then Err:=I else
-              begin
-                Consume(')');
-                I:=I+ReplacePart(LastWordStart,I-1,'')-1;
-                if CheckOnly=false then
-                  WriteToolMessagesToFile(S);
-              end;
-          end else
-        if copy(WordS,1,1)='$' then
-          Err:=LastWordStart;
-        WordS:='';
-      end;
-    PrevC:=C;
-    Inc(I);
-  end;
-end;
-var Pass: sw_integer;
-begin
-  AbortTool:=false;
-  CaptureToolTo:=capNone;
-  ToolFilter:='';
-  W:=FirstEditorWindow;
-  Err:=0;
-  for Pass:=0 to 3 do
-    begin
-      ParseParams(Pass);
-      if Err<>0 then Break;
-    end;
-  if AbortTool then Err:=-1;
-  ParseToolParams:=Err;
-end;
-
-function ProcessMessageFile(const MsgFileName: string): boolean;
-var OK,Done: boolean;
-    S: PBufStream;
-    C: char;
-    Sign: array[1..10] of char;
-    InFileName,InReference: boolean;
-    AddChar: boolean;
-    FileName,Line: string;
-    Row,Col: longint;
-procedure AddLine;
-begin
-  Row:=ord(Line[1])+ord(Line[2]) shl 8;
-  Col:=ord(Line[3])+ord(Line[4]) shl 8;
-  AddToolMessage(FileName,copy(Line,5,High(Line)),Row,Col);
-end;
-begin
-  New(S, Init(MsgFileName, stOpenRead, 4096));
-  OK:=(S<>nil) and (S^.Status=stOK);
-  if OK then S^.Read(Sign,SizeOf(Sign));
-  OK:=OK and (Sign=MsgFilterSign);
-  Done:=false; InFileName:=false; InReference:=false;
-  while OK and (Done=false) do
-    begin
-      S^.Read(C,SizeOf(C));
-      OK:=(S^.Status=stOK);
-      AddChar:=false;
-      if OK then
-      case C of
-        #0   : if InFileName then
-                 begin InFileName:=false end else
-               if InReference then
-                 begin
-                   if (length(Line)>4) then
-                     begin
-                       AddLine;
-                       InReference:=false;
-                     end
-                   else
-                     AddChar:=true;
-                 end else
-               begin InFileName:=true; FileName:=''; end;
-        #1   : if InReference then AddChar:=true else
-                 begin InReference:=true; Line:=''; end;
-        #127 : if InReference then AddChar:=true else
-                 Done:=true;
-      else AddChar:=true;
-      end;
-      if AddChar then
-        if InFileName then
-          FileName:=FileName+C else
-        if InReference then
-          Line:=Line+C;
-    end;
-  if S<>nil then Dispose(S, Done);
-  ProcessMessageFile:=OK;
-end;
-
-procedure InitToolTempFiles;
-begin
-  if not Assigned(ToolTempFiles) then
-    New(ToolTempFiles, Init(10,10));
-end;
-
-procedure DoneToolTempFiles;
-procedure DeleteIt(P: PString); {$ifndef FPC}far;{$endif}
-begin
-  DeleteFile(GetStr(P));
-end;
-begin
-  if not Assigned(ToolTempFiles) then Exit;
-  ToolTempFiles^.ForEach(@DeleteIt);
-  Dispose(ToolTempFiles, Done); ToolTempFiles:=nil;
-end;
-
-constructor TToolMessage.Init(AModule: PString; ALine: string; ARow, ACol: sw_integer);
-begin
-  inherited Init(0,ALine,AModule,ARow,ACol);
-end;
-
-function TToolMessage.GetText(MaxLen: Sw_integer): string;
-var S: string;
-begin
-  if Module=nil then
-    S:=GetStr(Text)
-  else
-    S:=NameAndExtOf(GetModuleName)+
-       '('+IntToStr(Row)+'): '+GetStr(Text);
-  GetText:=copy(S,1,MaxLen);
-end;
-
-procedure AddToolCommand(Command: string);
-begin
-  AddToolMessage('',Command,0,0);
-  LastToolMessageFocused:=ToolMessages^.At(ToolMessages^.Count-1);
-end;
-
-procedure AddToolMessage(ModuleName, Text: string; Row, Col: longint);
-var MN: PString;
-begin
-  if ToolMessages=nil then
-    New(ToolMessages, Init(500,1000));
-  if ToolModuleNames=nil then
-    New(ToolModuleNames, Init(50,100));
-  MN:=ToolModuleNames^.Add(ModuleName);
-  ToolMessages^.Insert(New(PToolMessage, Init(MN,Text,Row,Col)));
-end;
-
-procedure ClearToolMessages;
-begin
-  If assigned(ToolMessages) then
-    ToolMessages^.FreeAll;
-  If assigned(ToolModuleNames) then
-    ToolModuleNames^.FreeAll;
-  LastToolMessageFocused:=nil;
-end;
-
-procedure UpdateToolMessages;
-begin
-  if Assigned(MessagesWindow) then
-    MessagesWindow^.Update;
-end;
-
-procedure TToolMessageListBox.Update;
-var P: PMessageItem;
-    Idx: integer;
-begin
-  P:=LastToolMessageFocused;
-  NewList(ToolMessages);
-  if (Range>0) and (P<>nil) then
-    begin
-      Idx:=List^.IndexOf(P);
-      if Idx>=0 then
-        begin
-          FocusItem(Idx);
-          DrawView;
-        end;
-    end;
-  DrawView;
-end;
-
-procedure TToolMessageListBox.NewList(AList: PCollection);
-begin
-  if (List=ToolMessages) or (ToolMessages=nil) then
-    begin List:=nil; SetRange(0); end;
-  inherited NewList(AList);
-end;
-
-procedure TToolMessageListBox.Clear;
-begin
-  ClearToolMessages;
-  Update;
-  Message(Application,evBroadcast,cmClearLineHighlights,@Self);
-end;
-
-function TToolMessageListBox.GetPalette: PPalette;
-const
-  P: string[length(CBrowserListBox)] = CBrowserListBox;
-begin
-  GetPalette:=@P;
-end;
-
-constructor TToolMessageListBox.Load(var S: TStream);
-begin
-  inherited Load(S);
-end;
-
-procedure TToolMessageListBox.Store(var S: TStream);
-var OL: PCollection;
-begin
-  OL:=List;
-  New(List, Init(1,1));
-
-  inherited Store(S);
-
-  Dispose(List, Done);
-  List:=OL;
-end;
-
-destructor TToolMessageListBox.Done;
-begin
-  HScrollBar:=nil; VScrollBar:=nil;
-  if List=ToolMessages then begin List:=nil; SetRange(0); end;
-  inherited Done;
-end;
-
-constructor TMessagesWindow.Init;
-var R: TRect;
-    HSB,VSB: PScrollBar;
-begin
-  Desktop^.GetExtent(R); R.A.Y:=R.B.Y-7;
-  inherited Init(R,dialog_messages,SearchFreeWindowNo);
-  HelpCtx:=hcMessagesWindow;
-
-  HSB:=StandardScrollBar(sbHorizontal+sbHandleKeyboard); Insert(HSB);
-  VSB:=StandardScrollBar(sbVertical+sbHandleKeyboard); Insert(VSB);
-
-  GetExtent(R); R.Grow(-1,-1);
-  New(MsgLB, Init(R, HSB, VSB));
-  Insert(MsgLB);
-
-  Update;
-
-  MessagesWindow:=@Self;
-end;
-
-procedure TMessagesWindow.Update;
-begin
-  MsgLB^.Update;
-end;
-
-procedure TMessagesWindow.FocusItem(i : sw_integer);
-begin
-  MsgLB^.FocusItem(i);
-end;
-
-procedure TMessagesWindow.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-        cmListFocusChanged :
-          if Event.InfoPtr=MsgLB then
-            begin
-              LastToolMessageFocused:=MsgLB^.List^.At(MsgLB^.Focused);
-              Message(Application,evBroadcast,cmClearLineHighlights,@Self);
-            end;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure TMessagesWindow.SizeLimits(var Min, Max: TPoint);
-begin
-  inherited SizeLimits(Min,Max);
-  Min.X:=20;
-  Min.Y:=4;
-end;
-
-function TMessagesWindow.GetPalette: PPalette;
-const S: string[length(CBrowserWindow)] = CBrowserWindow;
-begin
-  GetPalette:=@S;
-end;
-
-constructor TMessagesWindow.Load(var S: TStream);
-begin
-  inherited Load(S);
-
-  GetSubViewPtr(S,MsgLB);
-
-  Update;
-  MessagesWindow:=@Self;
-end;
-
-procedure TMessagesWindow.Store(var S: TStream);
-begin
-  inherited Store(S);
-
-  PutSubViewPtr(S,MsgLB);
-end;
-
-destructor TMessagesWindow.Done;
-begin
-  MessagesWindow:=nil;
-  inherited Done;
-end;
-
-procedure RegisterFPTools;
-begin
-{$ifndef NOOBJREG}
-  RegisterType(RToolMessageListBox);
-  RegisterType(RMessagesWindow);
-{$endif}
-end;
-
-END.
-{
-  $Log$
-  Revision 1.2  2000-08-22 09:41:40  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.1  2000/07/20 11:02:15  michael
-  + Fixes from gabor. See fixes.txt
-
-  Revision 1.1  2000/07/13 09:48:36  michael
-  + Initial import
-
-  Revision 1.20  2000/06/22 09:07:12  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.19  2000/05/02 08:42:29  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.18  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.17  2000/04/18 11:42:37  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.16  2000/03/13 20:31:54  pierre
-   * INIPath removed
-
-  Revision 1.15  2000/02/07 12:00:41  pierre
-   Gabor's changes
-
-  Revision 1.14  1999/10/27 10:43:06  pierre
-   * avoid dispose problems for ToolMessages
-
-  Revision 1.13  1999/08/03 20:22:37  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.12  1999/07/28 23:11:24  peter
-    * fixes from gabor
-
-  Revision 1.11  1999/07/12 13:14:21  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.10  1999/06/28 19:32:24  peter
-    * fixes from gabor
-
-  Revision 1.9  1999/05/22 13:44:32  peter
-    * fixed couple of bugs
-
-  Revision 1.8  1999/04/07 21:55:54  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.7  1999/03/23 15:11:35  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.6  1999/03/16 12:38:14  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-  Revision 1.5  1999/03/08 14:58:12  peter
-    + prompt with dialogs for tools
-
-  Revision 1.4  1999/03/01 15:42:04  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.3  1999/02/22 02:15:19  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.2  1999/02/19 15:43:21  peter
-    * compatibility fixes for FV
-
-  Revision 1.1  1999/01/21 11:54:25  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.0  1999/01/16 10:43:31  gabor
-      Original implementation
-
-}

+ 0 - 764
ide/text/fpusrscr.pas

@@ -1,764 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    User screen support routines
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$i globdir.inc}
-unit FPUsrScr;
-
-interface
-
-uses
-{$ifdef win32}
-  windows,
-{$endif win32}
-  video,Objects;
-
-type
-
-    PScreen = ^TScreen;
-    TScreen = object(TObject)
-      function    GetWidth: integer; virtual;
-      function    GetHeight: integer; virtual;
-      procedure   GetLine(Line: integer; var Text, Attr: string); virtual;
-      procedure   GetCursorPos(var P: TPoint); virtual;
-      procedure   Capture; virtual;
-      procedure   SwitchTo; virtual;
-      procedure   SwitchBack; virtual;
-    end;
-
-{$ifdef DOS}
-    TDOSVideoInfo = record
-      Mode      : word;
-      ScreenSize: word;
-      Page      : byte;
-      Rows,Cols : integer;
-      CurPos    : TPoint;
-      CurShapeT : integer;
-      CurShapeB : integer;
-      StateSize : word;
-      StateBuf  : pointer;
-    end;
-
-    PDOSScreen = ^TDOSScreen;
-    TDOSScreen = object(TScreen)
-      constructor Init;
-      destructor  Done; virtual;
-    public
-      function    GetWidth: integer; virtual;
-      function    GetHeight: integer; virtual;
-      procedure   GetLine(Line: integer; var Text, Attr: string); virtual;
-      procedure   GetCursorPos(var P: TPoint); virtual;
-      procedure   Capture; virtual;
-      procedure   SwitchTo; virtual;
-      procedure   SwitchBack; virtual;
-    private
-      VideoInfo    : TDOSVideoInfo;
-      VBufferSize  : longint;
-      VIDEBufferSize : longint;
-      VBuffer      : PByteArray;
-      VIDEBuffer   : PByteArray;
-      TM           : TDOSVideoInfo;
-      function    GetLineStartOfs(Line: integer): word;
-      procedure   GetBuffer(Size: word);
-      procedure   FreeBuffer;
-      procedure   GetVideoMode(var MI: TDOSVideoInfo);
-      procedure   SetVideoMode(MI: TDOSVideoInfo);
-    end;
-{$endif}
-
-{$ifdef Unix}
-    PLinuxScreen = ^TLinuxScreen;
-    TLinuxScreen = object(TScreen)
-      constructor Init;
-      destructor  Done; virtual;
-    public
-      function    GetWidth: integer; virtual;
-      function    GetHeight: integer; virtual;
-      procedure   GetLine(Line: integer; var Text, Attr: string); virtual;
-      procedure   GetCursorPos(var P: TPoint); virtual;
-      procedure   Capture; virtual;
-      procedure   SwitchTo; virtual;
-      procedure   SwitchBack; virtual;
-    private
-      IDE_screen: pvideobuf;
-      IDE_size : longint;
-    end;
-{$endif}
-
-{$ifdef win32}
-    PWin32Screen = ^TWin32Screen;
-    TWin32Screen = object(TScreen)
-      constructor Init;
-      destructor  Done; virtual;
-    public
-      function    GetWidth: integer; virtual;
-      function    GetHeight: integer; virtual;
-      procedure   GetLine(Line: integer; var Text, Attr: string); virtual;
-      procedure   GetCursorPos(var P: TPoint); virtual;
-      procedure   Capture; virtual;
-      procedure   SwitchTo; virtual;
-      procedure   SwitchBack; virtual;
-    private
-      DosScreenBufferHandle,
-      IDEScreenBufferHandle : THandle;
-      IDEActive : boolean;
-      procedure BufferCopy(src,dest : THandle);
-    end;
-{$endif}
-
-procedure InitUserScreen;
-procedure DoneUserScreen;
-
-const UserScreen : PScreen = nil;
-
-implementation
-
-uses
-  Dos
-(*  {$ifdef TP}
-    {$ifdef DPMI}
-    ,WinAPI
-    {$endif}
-  {$endif}*)
-  {$ifdef FPC}
-    {$ifdef GO32V2}
-    ,Go32
-    {$endif}
-  {$endif}
-  {$ifdef VESA}
-    ,VESA
-  {$endif}
-  ;
-
-function TScreen.GetWidth: integer;
-begin
-  Getwidth:=0;
-  Abstract;
-end;
-
-function TScreen.GetHeight: integer;
-begin
-  Getheight:=0;
-  Abstract;
-end;
-
-procedure TScreen.GetLine(Line: integer; var Text, Attr: string);
-begin
-  Abstract;
-end;
-
-procedure TScreen.GetCursorPos(var P: TPoint);
-begin
-  Abstract;
-end;
-
-procedure TScreen.Capture;
-begin
-  Abstract;
-end;
-
-procedure TScreen.SwitchTo;
-begin
-  Abstract;
-end;
-
-procedure TScreen.SwitchBack;
-begin
-  Abstract;
-end;
-
-
-{****************************************************************************
-                                 TDOSScreen
-****************************************************************************}
-
-{$ifdef DOS}
-
-constructor TDOSScreen.Init;
-begin
-  inherited Init;
-  Capture;
-end;
-
-
-destructor TDOSScreen.Done;
-begin
-  inherited Done;
-  FreeBuffer;
-end;
-
-
-function TDOSScreen.GetWidth: integer;
-begin
-  GetWidth:=VideoInfo.Cols;
-end;
-
-
-function TDOSScreen.GetHeight: integer;
-begin
-  GetHeight:=VideoInfo.Rows;
-end;
-
-
-procedure TDOSScreen.GetLine(Line: integer; var Text, Attr: string);
-var X: integer;
-    W: word;
-begin
-  Text:=''; Attr:='';
-  if Line<GetHeight then
-  begin
-    W:=GetLineStartOfs(Line);
-    for X:=0 to GetWidth-1 do
-     begin
-       Text:=Text+chr(VBuffer^[W+X*2]);
-       Attr:=Attr+chr(VBuffer^[W+X*2+1]);
-     end;
-  end;
-end;
-
-
-procedure TDOSScreen.GetCursorPos(var P: TPoint);
-begin
-  P:=VideoInfo.CurPos;
-end;
-
-
-procedure TDOSScreen.Capture;
-var
-  VSeg,SOfs: word;
-begin
-  GetVideoMode(VideoInfo);
-  GetBuffer(VideoInfo.ScreenSize);
-  if VideoInfo.Mode=7 then
-   VSeg:=SegB000
-  else
-   VSeg:=SegB800;
-  SOfs:=MemW[Seg0040:$4e];
-{$ifdef FPC}
-  DosmemGet(VSeg,SOfs,VBuffer^,VideoInfo.ScreenSize);
-{$else}
-  Move(ptr(VSeg,SOfs)^,VBuffer^,VideoInfo.ScreenSize);
-{$endif}
-end;
-
-procedure TDOSScreen.SwitchTo;
-var
-  VSeg,SOfs: word;
-begin
-  GetVideoMode(TM);
-  { First keep a copy of IDE screen }
-  if VideoInfo.Mode=7 then
-   VSeg:=SegB000
-  else
-   VSeg:=SegB800;
-  SOfs:=MemW[Seg0040:$4e];
-  if not assigned(VIDEBuffer) or (VIDEBufferSize<>TM.ScreenSize) then
-    begin
-      if assigned(VIDEBuffer) then
-        FreeMem(VIDEBuffer,VIDEBufferSize);
-      GetMem(VIDEBuffer,TM.ScreenSize);
-      VIDEBufferSize:=TM.ScreenSize;
-    end;
-{$ifdef FPC}
-  DosmemGet(VSeg,SOfs,VIDEBuffer^,TM.ScreenSize);
-{$else}
-  Move(ptr(VSeg,SOfs)^,VIDEBuffer^,TM.ScreenSize);
-{$endif}
-
-  SetVideoMode(VideoInfo);
-
-  if VideoInfo.Mode=7 then
-    VSeg:=SegB000
-  else
-    VSeg:=SegB800;
-  SOfs:=MemW[Seg0040:$4e];
-{$ifdef FPC}
-  DosmemPut(VSeg,SOfs,VBuffer^,VideoInfo.ScreenSize);
-{$else}
-  Move(VBuffer^,ptr(VSeg,SOfs)^,VideoInfo.ScreenSize);
-{$endif}
-end;
-
-
-procedure TDOSScreen.SwitchBack;
-var
-  VSeg,SOfs: word;
-begin
-  Capture;
-  SetVideoMode(TM);
-  if VideoInfo.Mode=7 then
-   VSeg:=SegB000
-  else
-   VSeg:=SegB800;
-  SOfs:=MemW[Seg0040:$4e];
-  if assigned(VIDEBuffer) then
-{$ifdef FPC}
-    DosmemPut(VSeg,SOfs,VIDEBuffer^,TM.ScreenSize);
-{$else}
-    Move(VIDEBuffer^,ptr(VSeg,SOfs)^,TM.ScreenSize);
-{$endif}
-end;
-
-
-function TDOSScreen.GetLineStartOfs(Line: integer): word;
-begin
-  GetLineStartOfs:=(VideoInfo.Cols*Line)*2;
-end;
-
-
-procedure TDOSScreen.GetBuffer(Size: word);
-begin
-  if (VBuffer<>nil) and (VBufferSize=Size) then Exit;
-  if VBuffer<>nil then FreeBuffer;
-  VBufferSize:=Size;
-  GetMem(VBuffer,VBufferSize);
-end;
-
-
-procedure TDOSScreen.FreeBuffer;
-begin
-  if (VBuffer<>nil) and (VBufferSize>0) then FreeMem(VBuffer,VBufferSize);
-  VBuffer:=nil;
-end;
-
-
-procedure TDOSScreen.GetVideoMode(var MI: TDOSVideoInfo);
-var
-  r: registers;
-{$ifdef TP}
-  P: pointer;
-  Sel: longint;
-(*  {$I realintr.inc} *)
-{$endif}
-begin
-  if (MI.StateSize>0) and (MI.StateBuf<>nil) then
-     begin FreeMem(MI.StateBuf,MI.StateSize); MI.StateBuf:=nil; end;
-
-  MI.ScreenSize:=MemW[Seg0040:$4c];
-  r.ah:=$0f;
-  intr($10,r);
-  MI.Mode:=r.al;
-  MI.Page:=r.bh;
-  MI.Cols:=r.ah;
-{$ifdef VESA}
-  VESAGetMode(MI.Mode);
-{$endif}
-  MI.Rows:=MI.ScreenSize div (MI.Cols*2);
-  if MI.Rows=51 then MI.Rows:=50;
-  r.ah:=$03;
-  r.bh:=MI.Page;
-  intr($10,r);
-  with MI do
-  begin
-    CurPos.X:=r.dl; CurPos.Y:=r.dh;
-    CurShapeT:=r.ch; CurShapeB:=r.cl;
-  end;
-
-(*
-{$ifdef TP}
-  { check VGA functions }
-  MI.StateSize:=0;
-  r.ah:=$1c; r.al:=0; r.cx:=7; intr($10,r);
-  if (r.al=$1c) and ((r.flags and fCarry)=0) and (r.bx>0) then
-  begin
-    MI.StateSize:=r.bx;
-    GetMem(MI.StateBuf,MI.StateSize); FillChar(MI.StateBuf^,MI.StateSize,0);
-    P:=MI.StateBuf;
-{$ifdef DPMI}
-    Sel:=GlobalDosAlloc(MI.StateSize);
-    P:=Ptr(Sel shr 16,0);
-{$endif}
-    r.ah:=$1c; r.al:=1; r.cx:=7;
-    r.es:=PtrRec(P).Seg; r.bx:=PtrRec(P).Ofs;
-    {$ifdef DPMI}realintr($10,r);{$else}intr($10,r);{$endif}
-{$ifdef DPMI}
-    Move(Ptr(Sel and $ffff,0)^,MI.StateBuf^,MI.StateSize);
-    GlobalDosFree(Sel and $ffff);
-{$endif}
-  end;
-{$endif}
-*)
-end;
-
-
-procedure TDOSScreen.SetVideoMode(MI: TDOSVideoInfo);
-var r: registers;
-    CM: TDOSVideoInfo;
-{$ifdef TP}
-    P: pointer;
-    Sel: longint;
-{$I realintr.inc}
-{$endif}
-begin
-  FillChar(CM,sizeof(CM),0);
-  GetVideoMode(CM);
-
-  if (CM.Mode<>MI.Mode) or (CM.Cols<>MI.Cols) or (CM.Rows<>MI.Rows) then
-   begin
-     {$ifdef VESA}
-     if MI.Mode>=$100 then
-       VESASetMode(MI.Mode)
-     else
-     {$endif}
-       begin
-         r.ah:=$00; r.al:=MI.Mode; intr($10,r);
-       end;
-     if (MI.Mode=3) and (MI.Cols=80) and (MI.Rows=50) then
-     begin
-       r.ax:=$1112; r.bx:=$0;
-       intr($10,r);
-     end;
-   end;
-  r.ah:=$05; r.al:=MI.Page; intr($10,r);
-  r.ah:=$02; r.bh:=MI.Page; r.dl:=MI.CurPos.X; r.dh:=MI.CurPos.Y; intr($10,r);
-  r.ah:=$01; r.ch:=MI.CurShapeT; r.cl:=MI.CurShapeB; intr($10,r);
-
-  (*
-{$ifdef TP}
-  if (MI.StateSize>0) and (MI.StateBuf<>nil) then
-  begin
-    P:=MI.StateBuf;
-{$ifdef DPMI}
-    Sel:=GlobalDosAlloc(MI.StateSize);
-    Move(MI.StateBuf^,ptr(Sel and $ffff,0)^,MI.StateSize);
-    P:=Ptr(Sel shr 16,0);
-{$endif}
-    r.ah:=$1c; r.al:=2; r.cx:=7;
-    r.es:=PtrRec(P).Seg; r.bx:=PtrRec(P).Ofs;
-    {$ifdef DPMI}realintr($10,r);{$else}intr($10,r);{$endif}
-{$ifdef DPMI}
-    GlobalDosFree(Sel and $ffff);
-{$endif}
-  end;
-{$endif}
-*)
-end;
-
-{$endif}
-
-
-{****************************************************************************
-                                 TLinuxScreen
-****************************************************************************}
-
-{$ifdef Unix}
-
-constructor TLinuxScreen.Init;
-begin
-  inherited Init;
-  IDE_screen := nil;
-end;
-
-
-destructor TLinuxScreen.Done;
-begin
-  inherited Done;
-end;
-
-
-function TLinuxScreen.GetWidth: integer;
-begin
-  GetWidth:=ScreenWidth;
-end;
-
-
-function TLinuxScreen.GetHeight: integer;
-begin
-  GetHeight:=ScreenHeight;
-end;
-
-
-procedure TLinuxScreen.GetLine(Line: integer; var Text, Attr: string);
-begin
-  Text:='';
-  Attr:='';
-end;
-
-
-procedure TLinuxScreen.GetCursorPos(var P: TPoint);
-begin
-  P.X:=0;
-  P.Y:=0;
-end;
-
-
-procedure TLinuxScreen.Capture;
-begin
-  if assigned(IDE_screen) then
-    dispose(IDE_screen);
-  getmem(IDE_screen,videobufsize);
-  Ide_size:=videobufsize;
-  move(videobuf^,IDE_screen^,videobufsize);
-end;
-
-
-procedure TLinuxScreen.SwitchTo;
-begin
-end;
-
-
-procedure TLinuxScreen.SwitchBack;
-begin
-  if IDE_screen = nil then
-    exit;
-  move(IDE_screen^,videobuf^,videobufsize);
-  freemem(IDE_screen,Ide_size);
-  IDE_screen := nil;
-end;
-
-{$endif}
-
-{****************************************************************************
-                                 TWin32Screen
-****************************************************************************}
-
-{$ifdef win32}
-
-constructor TWin32Screen.Init;
-var
-  SecurityAttr : Security_attributes;
-  BigWin : Coord;
-  res : boolean;
-  Error : dword;
-begin
-  inherited Init;
-  SecurityAttr.nLength:=SizeOf(Security_attributes);
-  SecurityAttr.lpSecurityDescriptor:=nil;
-  SecurityAttr.bInheritHandle:=false;
-  DosScreenBufferHandle:=CreateConsoleScreenBuffer(
-    GENERIC_READ or GENERIC_WRITE,
-    0,SecurityAttr,
-    CONSOLE_TEXTMODE_BUFFER,nil);
-  IDEScreenBufferHandle:=GetStdHandle(STD_OUTPUT_HANDLE);
-{$ifdef win32bigwin}
-  BigWin.X:=80;
-  BigWin.Y:=50;
-  SetConsoleScreenBufferSize(DosScreenBufferHandle,BigWin);
-  SetConsoleScreenBufferSize(IDEScreenBufferHandle,BigWin);
-  BigWin.X:=80;
-  BigWin.Y:=50;
-  { Try to allow to store more info }
-  res:=SetConsoleScreenBufferSize(DosScreenBufferHandle,BigWin);
-  if not res then
-    error:=GetLastError;
-{$endif win32bigwin}
-  Capture;
-  SwitchBack;
-end;
-
-destructor TWin32Screen.Done;
-begin
-  { copy the Dos buffer content into the original ScreenBuffer
-    which remains the startup std_output_handle PM }
-  BufferCopy(DosScreenBufferHandle,IDEScreenBufferHandle);
-  SetConsoleActiveScreenBuffer(IDEScreenBufferHandle);
-  SetStdHandle(Std_Output_Handle,IDEScreenBufferHandle);
-  CloseHandle(DosScreenBufferHandle);
-  inherited Done;
-end;
-
-function TWin32Screen.GetWidth: integer;
-var
-  ConsoleScreenBufferInfo : Console_screen_buffer_info;
-begin
-  GetConsoleScreenBufferInfo(DosScreenBufferHandle,
-    @ConsoleScreenBufferInfo);
-  GetWidth:=ConsoleScreenBufferInfo.dwSize.X;
-  {GetWidth:=ScreenWidth;}
-end;
-
-function TWin32Screen.GetHeight: integer;
-var
-  ConsoleScreenBufferInfo : Console_screen_buffer_info;
-begin
-  GetConsoleScreenBufferInfo(DosScreenBufferHandle,
-    @ConsoleScreenBufferInfo);
-  GetHeight:=ConsoleScreenBufferInfo.dwSize.Y;
-  {GetHeight:=ScreenHeight;}
-end;
-
-
-procedure TWin32Screen.GetLine(Line: integer; var Text, Attr: string);
-type
-  CharInfoArray = Array [0..255] of Char_Info;
-var
-  LineBuf : ^CharInfoArray;
-  BufSize,BufCoord : Coord;
-  i,LineSize : longint;
-  WriteRegion : SMALL_RECT;
-begin
-  GetMem(LineBuf,SizeOf(CharInfoArray));
-  LineSize:=ScreenWidth;
-  If LineSize>256 then
-    LineSize:=256;
-  BufSize.X:=LineSize;
-  BufSize.Y:=1;
-  BufCoord.X:=0;
-  BufCoord.Y:=0;
-  with WriteRegion do
-    begin
-      Top :=Line;
-      Left :=0;
-      Bottom := Line+1;
-      Right := LineSize-1;
-    end;
-  ReadConsoleOutput(DosScreenBufferHandle, PChar_info(LineBuf),
-    BufSize, BufCoord, @WriteRegion);
-  for i:=1 to LineSize do
-    begin
-      Text[i]:=LineBuf^[i-1].AsciiChar;
-      Attr[i]:=char(byte(LineBuf^[i-1].Attributes));
-    end;
-  FreeMem(LineBuf,SizeOf(CharInfoArray));
-  Text[0]:=char(byte(LineSize));
-  Attr[0]:=char(byte(LineSize));
-end;
-
-
-procedure TWin32Screen.GetCursorPos(var P: TPoint);
-var
-  ConsoleScreenBufferInfo : Console_screen_buffer_info;
-begin
-  GetConsoleScreenBufferInfo(DosScreenBufferHandle,
-    @ConsoleScreenBufferInfo);
-  P.X:=ConsoleScreenBufferInfo.dwCursorPosition.X;
-  P.Y:=ConsoleScreenBufferInfo.dwCursorPosition.Y;
-end;
-
-procedure TWin32Screen.BufferCopy(Src, Dest : THandle);
-type
-  CharInfoArray = Array [0..256*255-1] of Char_Info;
-var
-  LineBuf : ^CharInfoArray;
-  BufSize,BufCoord : Coord;
-  LineSize : longint;
-  WriteRegion : SMALL_RECT;
-  ConsoleScreenBufferInfo : Console_screen_buffer_info;
-begin
-  GetMem(LineBuf,SizeOf(CharInfoArray));
-  LineSize:=ScreenWidth;
-  If LineSize>256 then
-    LineSize:=256;
-  BufSize.X:=LineSize;
-  BufSize.Y:=ScreenHeight;
-  BufCoord.X:=0;
-  BufCoord.Y:=0;
-  with WriteRegion do
-    begin
-      Top :=0;
-      Left :=0;
-      Bottom := ScreenHeight-1;
-      Right := LineSize-1;
-    end;
-  ReadConsoleOutput(Src, PChar_info(LineBuf),
-    BufSize, BufCoord, @WriteRegion);
-  WriteConsoleOutput(Dest, PChar_info(LineBuf),
-    BufSize, BufCoord, @WriteRegion);
-  FreeMem(LineBuf,SizeOf(CharInfoArray));
-  GetConsoleScreenBufferInfo(Src,
-    @ConsoleScreenBufferInfo);
-  SetConsoleCursorPosition(Dest, ConsoleScreenBufferInfo.dwCursorPosition);
-end;
-
-procedure TWin32Screen.Capture;
-begin
-  BufferCopy(IDEScreenBufferHandle,DosScreenBufferHandle);
-end;
-
-procedure TWin32Screen.SwitchTo;
-begin
-  SetConsoleActiveScreenBuffer(DosScreenBufferHandle);
-  SetStdHandle(Std_Output_Handle,DosScreenBufferHandle);
-  IDEActive:=false;
-end;
-
-procedure TWin32Screen.SwitchBack;
-begin
-  SetConsoleActiveScreenBuffer(IDEScreenBufferHandle);
-  SetStdHandle(Std_Output_Handle,IDEScreenBufferHandle);
-  IDEActive:=true;
-end;
-
-{$endif}
-
-
-{****************************************************************************
-                                 Initialize
-****************************************************************************}
-
-procedure InitUserScreen;
-begin
-{$ifdef DOS}
-  UserScreen:=New(PDOSScreen, Init);
-{$else}
-  {$ifdef Unix}
-    UserScreen:=New(PLinuxScreen, Init);
-  {$else}
-
-    {$ifdef Win32}
-      UserScreen:=New(PWin32Screen, Init);
-    {$else}
-      UserScreen:=New(PScreen, Init);
-    {$endif Win32}
-  {$endif Unix}
-{$endif Dos}
-end;
-
-
-procedure DoneUserScreen;
-begin
-  if UserScreen<>nil then
-   begin
-     UserScreen^.SwitchTo;
-     Dispose(UserScreen, Done);
-     UserScreen:=nil;
-   end;
-end;
-
-end.
-{
-  $Log$
-  Revision 1.6  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.4  2000/11/14 09:23:56  marco
-   * Second batch
-
-  Revision 1.5  2000/10/31 22:35:55  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.3  2000/10/10 21:24:56  pierre
-   * avoid writing past IDE_screen buffer length
-
-  Revision 1.4  2000/09/18 16:42:56  jonas
-    * for some reason, tlinuxscreen.switchto() contained some saving code
-      while it should've been empty (like in the fixes branch)
-
-  Revision 1.3  2000/08/22 09:41:40  pierre
-   * first big merge from fixes branch
-
-  Revision 1.2  2000/08/21 10:57:01  jonas
-    * IDE screen saving/restoring implemented for Linux (merged from fixes
-      branch)
-
-  Revision 1.1.2.2  2000/08/21 12:10:19  jonas
-    * fixed errors in my previous commit, it now works properly
-
-  Revision 1.1.2.1  2000/08/21 10:51:13  jonas
-    * IDE screen saving/restoring implemented for Linux
-
-  Revision 1.1  2000/07/13 09:48:36  michael
-  + Initial import
-
-}

+ 0 - 626
ide/text/fputils.pas

@@ -1,626 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Utilility routines used by the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit FPUtils;
-
-interface
-
-uses Objects;
-
-const
-{$ifdef Unix}
-  dirsep = '/';
-  listsep = [';',':'];
-  exeext = '';
-  pasext = '.pas';
-  ppext  = '.pp';
-{$else}
-  dirsep = '\';
-  listsep = [';'];
-  exeext = '.exe';
-  pasext = '.pas';
-  ppext  = '.pp';
-{$endif}
-
-function SmartPath(Path: string): string;
-Function FixPath(s:string;allowdot:boolean):string;
-function FixFileName(const s:string):string;
-function MakeExeName(const fn:string):string;
-function Center(const S: string; Len: byte): string;
-function FitStr(const S: string; Len: byte): string;
-function KillTilde(S: string): string;
-function LowercaseStr(const S: string): string;
-function DirOf(const S: string): string;
-function ExtOf(const S: string): string;
-function NameOf(const S: string): string;
-function NameAndExtOf(const S: string): string;
-function StrToExtended(S: string): Extended;
-function Power(const A,B: double): double;
-function MatchesMask(What, Mask: string): boolean;
-function MatchesMaskList(What, MaskList: string): boolean;
-function MatchesFileList(What, FileList: string): boolean;
-function EatIO: integer;
-function RenameFile(const OldFileName,NewFileName: string): boolean;
-function LocateFile(FileList: string): string;
-function LocatePasFile(const FileName:string):string;
-function LocateExeFile(var FileName:string): boolean;
-function EraseFile(FileName: string): boolean;
-function GetStr(const P: PString): string;
-procedure ReplaceStr(var S: string; const What,NewS: string);
-procedure ReplaceStrI(var S: string; What: string; const NewS: string);
-
-const ListSeparator      : char = ';';
-
-implementation
-
-uses Dos,
-     WUtils,
-     FPVars,FPSwitch;
-
-function IntToStr(L: longint): string;
-var S: string;
-begin
-  Str(L,S);
-  IntToStr:=S;
-end;
-
-function IntToStrZ(L: longint; MinLen: byte): string;
-var S: string;
-begin
-  S:=IntToStr(L);
-  if length(S)<MinLen then S:=CharStr('0',MinLen-length(S))+S;
-  IntToStrZ:=S;
-end;
-
-function IntToStrL(L: longint; MinLen: byte): string;
-var S: string;
-begin
-  S:=IntToStr(L);
-  if length(S)<MinLen then S:=CharStr(' ',MinLen-length(S))+S;
-  IntToStrL:=S;
-end;
-
-function SmartPath(Path: string): string;
-var S: string;
-begin
-  GetDir(0,S); if copy(S,length(S),1)<>DirSep then S:=S+DirSep;
-  if (copy(Path,1,length(S))=S) {and (Pos('\',copy(Path,length(S)+1,High(S)))=0)} then
-     system.Delete(Path,1,length(S));
-  SmartPath:=Path;
-end;
-
-
-Function FixPath(s:string;allowdot:boolean):string;
-var
-  i : longint;
-begin
-  for i:=1 to length(s) do
-   if s[i] in ['/','\'] then
-    s[i]:=DirSep;
-  if (length(s)>0) and (s[length(s)]<>DirSep) and
-     (s[length(s)]<>':') then
-   s:=s+DirSep;
-  if (not allowdot) and (s='.'+DirSep) then
-   s:='';
-  FixPath:=s;
-end;
-
-
-function FixFileName(const s:string):string;
-var
-  i      : longint;
-{$ifdef Unix}
-  NoPath : boolean;
-{$endif}
-begin
-  {$ifdef Unix}NoPath:=true;{$endif}
-  for i:=length(s) downto 1 do
-   begin
-     case s[i] of
- {$ifdef Unix}
-  '/','\' : begin
-              FixFileName[i]:='/';
-              NoPath:=false; {Skip lowercasing path: 'X11'<>'x11' }
-            end;
- 'A'..'Z' : if NoPath then
-             FixFileName[i]:=char(byte(s[i])+32)
-            else
-             FixFileName[i]:=s[i];
- {$else}
-      '/' : FixFileName[i]:='\';
- 'A'..'Z' : FixFileName[i]:=char(byte(s[i])+32);
- {$endif}
-     else
-      FixFileName[i]:=s[i];
-     end;
-   end;
-  FixFileName[0]:=s[0];
-end;
-
-
-function MakeExeName(const fn:string):string;
-var
-  d : DirStr;
-  n : NameStr;
-  e : ExtStr;
-begin
-  FSplit(fn,d,n,e);
-  MakeExeName:=d+n+ExeExt;
-end;
-
-
-function Center(const S: string; Len: byte): string;
-begin
-  Center:=LExpand(S+CharStr(' ',Max(0,(Len-length(S)) div 2)),Len);
-end;
-
-function FitStr(const S: string; Len: byte): string;
-begin
-  FitStr:=RExpand(copy(S,1,Len),Len);
-end;
-
-
-function KillTilde(S: string): string;
-var P: longint;
-begin
-  repeat
-    P:=Pos('~',S);
-    if P>0 then
-      Delete(S,P,1);
-  until P=0;
-  KillTilde:=S;
-end;
-
-function LowerCaseStr(const S: string): string;
-var
-  I: Longint;
-begin
-  for I:=1 to length(S) do
-    if S[I] in ['A'..'Z'] then
-      LowerCaseStr[I]:=chr(ord(S[I])+32)
-    else
-      LowerCaseStr[I]:=S[I];
-  LowercaseStr[0]:=S[0];
-end;
-
-function DirOf(const S: string): string;
-var D: DirStr; E: ExtStr; N: NameStr;
-begin
-  FSplit(S,D,N,E);
-  if (D<>'') and (D[Length(D)]<>DirSep) then
-   DirOf:=D+DirSep
-  else
-   DirOf:=D;
-end;
-
-
-function ExtOf(const S: string): string;
-var D: DirStr; E: ExtStr; N: NameStr;
-begin
-  FSplit(S,D,N,E);
-  ExtOf:=E;
-end;
-
-
-function NameOf(const S: string): string;
-var D: DirStr; E: ExtStr; N: NameStr;
-begin
-  FSplit(S,D,N,E);
-  NameOf:=N;
-end;
-
-function NameAndExtOf(const S: string): string;
-var D: DirStr; E: ExtStr; N: NameStr;
-begin
-  FSplit(S,D,N,E);
-  NameAndExtOf:=N+E;
-end;
-
-function StrToExtended(S: string): Extended;
-var R : Extended;
-    C : integer;
-begin
-  Val(S,R,C);
-  StrToExtended:=R;
-end;
-
-function Power(const A,B: double): double;
-begin
-  if A=0 then Power:=0
-         else Power:=exp(B*ln(A));
-end;
-
-function MatchesMask(What, Mask: string): boolean;
-
-  function upper(const s : string) : string;
-  var
-    i  : Sw_integer;
-  begin
-     for i:=1 to length(s) do
-      if s[i] in ['a'..'z'] then
-       upper[i]:=char(byte(s[i])-32)
-      else
-       upper[i]:=s[i];
-     upper[0]:=s[0];
-  end;
-
-  Function CmpStr(const hstr1,hstr2:string):boolean;
-  var
-    found : boolean;
-    i1,i2 : Sw_integer;
-  begin
-    i1:=0;
-    i2:=0;
-    found:=true;
-    while found and (i1<length(hstr1)) and (i2<=length(hstr2)) do
-     begin
-       if found then
-        inc(i2);
-       inc(i1);
-       case hstr1[i1] of
-         '?' :
-           found:=true;
-         '*' :
-           begin
-             found:=true;
-             if (i1=length(hstr1)) then
-              i2:=length(hstr2)
-             else
-              if (i1<length(hstr1)) and (hstr1[i1+1]<>hstr2[i2]) then
-               begin
-                 if i2<length(hstr2) then
-                  dec(i1)
-               end
-             else
-              if i2>1 then
-               dec(i2);
-           end;
-         else
-           found:=(hstr1[i1]=hstr2[i2]) or (hstr2[i2]='?');
-       end;
-     end;
-    if found then
-      found:=(i1>=length(hstr1)) and (i2>=length(hstr2));
-    CmpStr:=found;
-  end;
-
-var
-  D1,D2 : DirStr;
-  N1,N2 : NameStr;
-  E1,E2 : Extstr;
-begin
-{$ifdef Unix}
-  FSplit(What,D1,N1,E1);
-  FSplit(Mask,D2,N2,E2);
-{$else}
-  FSplit(Upper(What),D1,N1,E1);
-  FSplit(Upper(Mask),D2,N2,E2);
-{$endif}
-  MatchesMask:=CmpStr(N2,N1) and CmpStr(E2,E1);
-end;
-
-function MatchesMaskList(What, MaskList: string): boolean;
-var P: integer;
-    Match: boolean;
-begin
-  Match:=false;
-  if What<>'' then
-  repeat
-    P:=Pos(ListSeparator, MaskList);
-    if P=0 then
-      P:=length(MaskList)+1;
-    Match:=MatchesMask(What,copy(MaskList,1,P-1));
-    Delete(MaskList,1,P);
-  until Match or (MaskList='');
-  MatchesMaskList:=Match;
-end;
-
-function MatchesFileList(What, FileList: string): boolean;
-var P: integer;
-    Match: boolean;
-    WD,FD : record D: DirStr; N: NameStr; E: ExtStr; end;
-    F: string;
-begin
-  Match:=false;
-  FSplit(What,WD.D,WD.N,WD.E);
-  if What<>'' then
-  repeat
-    P:=Pos(ListSeparator, FileList);
-    if P=0 then P:=length(FileList)+1;
-    F:=copy(FileList,1,P-1);
-    FSplit(F,FD.D,FD.N,FD.E);
-    Match:=MatchesMask(WD.D+WD.N,FD.D+FD.N) and
-           MatchesMask(WD.E,FD.E);
-    Delete(FileList,1,P);
-  until Match or (FileList='');
-  MatchesFileList:=Match;
-end;
-
-function EatIO: integer;
-begin
-  EatIO:=IOResult;
-end;
-
-function RenameFile(const OldFileName,NewFileName: string): boolean;
-var f: file;
-begin
-  Assign(f,OldFileName);
-  Rename(f,NewFileName);
-  RenameFile:=(EatIO=0);
-end;
-
-function LocateFile(FileList: string): string;
-var FilePath: string;
-function CheckFile(Path,Name: string): boolean;
-var OK: boolean;
-begin
-  Path:=CompleteDir(Path);
-  Path:=Path+Name;
-  OK:=ExistsFile(Path);
-  if OK then FilePath:=Path;
-  CheckFile:=OK;
-end;
-function LocateSingleFile(FileName: string): boolean;
-var OK: boolean;
-begin
-  OK:=CheckFile(FExpand('.'),FileName);
-  if OK=false then OK:=CheckFile(StartupDir,FileName);
-  if OK=false then OK:=CheckFile(IDEDir,FileName);
-  LocateSingleFile:=OK;
-end;
-var P: integer;
-begin
-  FilePath:='';
-  if FileList<>'' then
-  repeat
-    P:=Pos(ListSeparator,FileList); if P=0 then P:=length(FileList)+1;
-    LocateSingleFile(copy(FileList,1,P-1));
-    Delete(FileList,1,P);
-  until (FilePath<>'') or (FileList='');
-  LocateFile:=FilePath;
-end;
-
-function LocatePasFile(const FileName:string):string;
-var
-  s : string;
-begin
-  LocatePasFile:=FileName;
-  if ExistsFile(FileName) or (ExtOf(FileName)<>'') then
-   exit;
-  S:=FileName+PPExt;
-  if ExistsFile(S) then
-   begin
-     LocatePasFile:=S;
-     exit;
-   end;
-  S:=FileName+PasExt;
-  if ExistsFile(S) then
-   begin
-     LocatePasFile:=S;
-     exit;
-   end;
-end;
-
-function LocateExeFile(var FileName:string): boolean;
-var
-  dir,s : string;
-  i : longint;
-begin
-  LocateExeFile:=False;
-  if ExistsFile(FileName) then
-    begin
-      LocateExeFile:=true;
-      Exit;
-    end;
-
-  S:=GetEnv('PATH');
-  While Length(S)>0 do
-    begin
-      i:=1;
-      While (i<=Length(S)) and not (S[i] in ListSep) do
-        Inc(i);
-      Dir:=CompleteDir(Copy(S,1,i-1));
-      if i<Length(S) then
-        Delete(S,1,i)
-      else
-        S:='';
-      if ExistsFile(Dir+FileName) then
-        Begin
-           FileName:=Dir+FileName;
-           LocateExeFile:=true;
-           Exit;
-        End;
-   end;
-end;
-
-function GetStr(const P: PString): string;
-begin
-  if P=nil then GetStr:='' else GetStr:=P^;
-end;
-
-function EraseFile(FileName: string): boolean;
-var f: file;
-begin
-  if FileName='' then Exit;
-  {$I-}
-  Assign(f,FileName);
-  Erase(f);
-  {$I+}
-  EraseFile:=(EatIO=0);
-end;
-
-procedure ReplaceStr(var S: string; const What,NewS: string);
-var I : Sw_integer;
-begin
-  repeat
-    I:=Pos(What,S);
-    if I>0 then
-    begin
-      Delete(S,I,length(What));
-      Insert(NewS,S,I);
-    end;
-  until I=0;
-end;
-
-procedure ReplaceStrI(var S: string; What: string; const NewS: string);
-var I : integer;
-    UpcaseS: string;
-begin
-  UpcaseS:=UpcaseStr(S); What:=UpcaseStr(What);
-  repeat
-    I:=Pos(What,UpcaseS);
-    if I>0 then
-    begin
-      Delete(S,I,length(What));
-      Insert(NewS,S,I);
-    end;
-  until I=0;
-end;
-
-
-END.
-{
-  $Log$
-  Revision 1.5  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.5  2000/11/14 09:23:56  marco
-   * Second batch
-
-  Revision 1.4  2000/11/13 17:37:42  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.4  2000/11/13 16:59:09  pierre
-   * some function in double removed from fputils unit
-
-  Revision 1.3  2000/11/03 16:05:38  pierre
-   * (merged)
-
-  Revision 1.1.2.3  2000/11/03 15:45:57  pierre
-   * fix LTrim for AnsiStrings
-
-  Revision 1.2  2000/08/22 09:41:41  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.2  2000/08/15 03:40:53  peter
-   [*] no more fatal exits when the IDE can't find the error file (containing
-       the redirected assembler/linker output) after compilation
-   [*] hidden windows are now added always at the end of the Window List
-   [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
-   [*] selection was incorrectly adjusted when typing in overwrite mode
-   [*] the line wasn't expanded when it's end was reached in overw. mode
-   [*] the IDE now tries to locate source files also in the user specified
-       unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
-   [*] 'Open at cursor' is now aware of the extension (if specified)
-
-  Revision 1.1.2.1  2000/07/20 11:02:15  michael
-  + Fixes from gabor. See fixes.txt
-
-  Revision 1.1  2000/07/13 09:48:36  michael
-  + Initial import
-
-  Revision 1.16  2000/06/22 09:07:13  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.15  2000/04/18 11:42:37  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.14  2000/01/03 11:38:34  michael
-  Changes from Gabor
-
-  Revision 1.13  1999/04/15 08:58:07  peter
-    * syntax highlight fixes
-    * browser updates
-
-  Revision 1.12  1999/04/07 21:55:55  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.11  1999/03/19 16:04:31  peter
-    * new compiler dialog
-
-  Revision 1.10  1999/03/08 14:58:14  peter
-    + prompt with dialogs for tools
-
-  Revision 1.9  1999/03/01 15:42:06  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.8  1999/02/22 02:15:20  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.7  1999/02/16 17:13:55  pierre
-   + findclose added for FPC
-
-  Revision 1.6  1999/02/05 12:12:01  pierre
-    + SourceDir that stores directories for sources that the
-      compiler should not know about
-      Automatically asked for addition when a new file that
-      needed filedialog to be found is in an unknown directory
-      Stored and retrieved from INIFile
-    + Breakpoints conditions added to INIFile
-    * Breakpoints insterted and removed at debin and end of debug session
-
-  Revision 1.5  1999/02/02 16:41:43  peter
-    + automatic .pas/.pp adding by opening of file
-    * better debuggerscreen changes
-
-  Revision 1.4  1999/01/21 11:54:25  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.3  1999/01/12 14:29:40  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.2  1998/12/28 15:47:53  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.31 1998/12/27 11:25:37  gabor
-    + MatchesMask(), MatchesMaskList() and MatchesFileList() added
-    + NameAndExtOf() added
-  Revision 1.3  1998/12/22 10:39:52  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 294
ide/text/fpvars.pas

@@ -1,294 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Global variables for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$i globdir.inc}
-
-unit FPVars;
-
-interface
-
-uses Objects,Views,App,
-     WUtils,WEditor,
-     FPConst,
-     FPDebug,
-     FPUtils,FPViews,FPCalc;
-
-type
-    TRecentFileEntry = record
-      FileName  : string{$ifdef GABOR}[60]{$endif};
-      LastPos   : TPoint;
-    end;
-
-    TCompPhase = (cpNothing,cpCompiling,cpLinking,
-                  cpAborted,cpFailed,cpDone);
-
-const ClipboardWindow  : PClipboardWindow = nil;
-      CalcWindow       : PCalculator = nil;
-      RecentFileCount  : integer = 0;
-      OpenExts         : string{$ifdef GABOR}[40]{$endif} = '*.pas;*.pp;*.inc';
-      HighlightExts    : string{$ifdef GABOR}[40]{$endif} = '*.pas;*.pp;*.inc';
-      TabsPattern      : string{$ifdef GABOR}[40]{$endif} = 'make*;make*.*';
-      SourceDirs       : string{$ifdef GABOR}[40]{$endif} = '';
-      PrimaryFile      : string{$ifdef GABOR}[60]{$endif} = '';
-      PrimaryFileMain  : string{$ifdef GABOR}[60]{$endif} = '';
-      PrimaryFileSwitches : string{$ifdef GABOR}[80]{$endif} = '';
-      PrimaryFilePara  : string{$ifdef GABOR}[80]{$endif} = '';
-      GDBOutputFile    : string{$ifdef GABOR}[50]{$endif} = GDBOutputFileName;
-      IsEXECompiled    : boolean = false;
-      { LinkAfter        : boolean = true; changed into a function }
-      MainHasDebugInfo : boolean = false;
-      UseMouse         : boolean = true;
-      MainFile         : string{$ifdef GABOR}[60]{$endif} = '';
-      PrevMainFile     : string{$ifdef GABOR}[60]{$endif} = '';
-      EXEFile          : string{$ifdef GABOR}[60]{$endif} = '';
-      CompilationPhase : TCompPhase = cpNothing;
-      ProgramInfoWindow: PProgramInfoWindow = nil;
-      GDBWindow        : PGDBWindow = nil;
-      BreakpointsWindow : PBreakpointsWindow = nil;
-      WatchesWindow    : PWatchesWindow = nil;
-      UserScreenWindow : PScreenWindow = nil;
-      HeapView         : PFPHeapView = nil;
-      ClockView        : PFPClockView = nil;
-      HelpFiles        : WUtils.PUnsortedStringCollection = nil;
-      ShowStatusOnError: boolean = true;
-      StartupDir       : string{$ifdef GABOR}[60]{$endif} = '.'+DirSep;
-      IDEDir           : string{$ifdef GABOR}[60]{$endif} = '.'+DirSep;
-      INIFileName      : string{$ifdef GABOR}[50]{$endif} = ININame;
-      SwitchesPath     : string{$ifdef GABOR}[60]{$endif} = SwitchesName;
-      CtrlMouseAction  : integer = acTopicSearch;
-      AltMouseAction   : integer = acBrowseSymbol;
-      StartupOptions   : longint = 0;
-      LastExitCode     : integer = 0;
-      ASCIIChart       : PFPASCIIChart = nil;
-      BackgroundPath   : string{$ifdef GABOR}[60]{$endif} = BackgroundName;
-      DesktopPath      : string{$ifdef GABOR}[60]{$endif} = DesktopName;
-      DesktopFileFlags : longint = dfHistoryLists+dfOpenWindows+
-                                   dfCodeCompleteWords+dfCodeTemplates;
-      DesktopLocation  : byte    = dlConfigFileDir;
-      AutoSaveOptions  : longint = asEnvironment+asDesktop;
-      MiscOptions      : longint = moChangeDirOnOpen+moCloseOnGotoSource;
-      EditorModified   : boolean = false;
-      IniCenterDebuggerRow : boolean = true;
-      SleepTimeOut     : longint = trunc(10*18.2);
-{$ifdef USE_EXTERNAL_COMPILER}
-      UseExternalCompiler : boolean = true;
-      ExternalCompilerExe : string = 'ppc386'+ExeExt;
-{$endif USE_EXTERNAL_COMPILER}
-      ShowReadme       : boolean = true;
-
-
-      ActionCommands   : array[acFirstAction..acLastAction] of word =
-        (cmHelpTopicSearch,cmGotoCursor,cmToggleBreakpoint,
-         cmEvaluate,cmAddWatch,cmBrowseAtCursor);
-
-      AppPalette       : string = CIDEAppColor;
-
-var   RecentFiles      : array[1..MaxRecentFileCount] of TRecentFileEntry;
-
-implementation
-
-END.
-{
-  $Log$
-  Revision 1.2  2000-11-15 00:14:10  pierre
-   new merge
-
-  Revision 1.1.2.1  2000/11/14 17:40:44  pierre
-   + External linking now optional
-
-  Revision 1.1  2000/07/13 09:48:36  michael
-  + Initial import
-
-  Revision 1.33  2000/06/16 08:50:42  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.32  2000/04/25 08:42:33  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.31  2000/04/18 11:42:37  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.30  2000/03/13 20:35:36  pierre
-    * IniPath replaced by IniFileName
-    + UseMouse variable
-
-  Revision 1.29  2000/03/08 16:50:27  pierre
-   + MainHasDebugInfo boolean var
-
-  Revision 1.28  2000/03/02 22:34:38  pierre
-   + external compiler support
-
-  Revision 1.27  2000/02/07 11:53:11  pierre
-   Gabor changes
-
-  Revision 1.26  2000/02/04 00:08:35  pierre
-   + IniCenterDebuggerRow
-
-  Revision 1.25  1999/09/16 14:34:59  pierre
-    + TBreakpoint and TWatch registering
-    + WatchesCollection and BreakpointsCollection stored in desk file
-    * Syntax highlighting was broken
-
-  Revision 1.24  1999/09/13 16:24:43  peter
-    + clock
-    * backspace unident like tp7
-
-  Revision 1.23  1999/09/13 11:44:00  peter
-    * fixes from gabor, idle event, html fix
-
-  Revision 1.22  1999/08/16 18:25:25  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.21  1999/08/03 20:22:38  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.20  1999/07/28 23:11:25  peter
-    * fixes from gabor
-
-  Revision 1.19  1999/07/10 01:24:21  pierre
-   + First implementation of watches window
-
-  Revision 1.18  1999/06/30 23:58:19  pierre
-    + BreakpointsList Window implemented
-      with Edit/New/Delete functions
-    + Individual breakpoint dialog with support for all types
-      ignorecount and conditions
-      (commands are not yet implemented, don't know if this wolud be useful)
-      awatch and rwatch have problems because GDB does not annotate them
-      I fixed v4.16 for this
-
-  Revision 1.17  1999/06/28 19:32:27  peter
-    * fixes from gabor
-
-  Revision 1.16  1999/06/21 23:37:58  pierre
-   + added LinkAfter var for post linking with -s option
-
-  Revision 1.15  1999/03/23 15:11:36  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.14  1999/03/19 16:04:32  peter
-    * new compiler dialog
-
-  Revision 1.13  1999/03/16 12:38:15  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-  Revision 1.12  1999/03/12 01:14:02  peter
-    * flag if trytoopen should look for other extensions
-    + browser tab in the tools-compiler
-
-  Revision 1.11  1999/03/08 14:58:15  peter
-    + prompt with dialogs for tools
-
-  Revision 1.10  1999/03/01 15:42:07  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.9  1999/02/19 18:43:48  peter
-    + open dialog supports mask list
-
-  Revision 1.8  1999/02/11 13:10:04  pierre
-   + GDBWindow only with -dGDBWindow for now : still buggy !!
-
-  Revision 1.7  1999/02/05 12:07:55  pierre
-    + SourceDirs added
-
-  Revision 1.6  1999/02/04 13:15:40  pierre
-   + TabsPattern added
-
-  Revision 1.5  1999/01/21 11:54:26  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.4  1999/01/12 14:29:41  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.3  1999/01/04 11:49:52  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.1  1998/12/28 15:47:54  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.0  1998/12/23 07:34:40  gabor
-
-}

+ 0 - 3991
ide/text/fpviews.pas

@@ -1,3991 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Views and view-related functions for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit FPViews;
-
-{$i globdir.inc}
-
-interface
-
-uses
-  Dos,Objects,Drivers,Commands,HelpCtx,Views,Menus,Dialogs,App,Gadgets,
-  ASCIITAB,
-{$ifdef EDITORS}
-  Editors,
-{$else}
-  WEditor,WCEdit,
-{$endif}
-  WUtils,WHelp,WHlpView,WViews,WANSI,
-  Comphook,
-  FPConst,FPUsrScr;
-
-type
-{$IFNDEF EDITORS}
-    TEditor = TCodeEditor; PEditor = PCodeEditor;
-{$ENDIF}
-
-    PStoreCollection = ^TStoreCollection;
-    TStoreCollection = object(TStringCollection)
-      function Add(const S: string): PString;
-    end;
-
-    PIntegerLine = ^TIntegerLine;
-    TIntegerLine = object(TInputLine)
-      constructor Init(var Bounds: TRect; AMin, AMax: longint);
-    end;
-
-    PFPHeapView = ^TFPHeapView;
-    TFPHeapView = object(THeapView)
-      constructor Init(var Bounds: TRect);
-      constructor InitKb(var Bounds: TRect);
-      procedure   HandleEvent(var Event: TEvent); virtual;
-    end;
-
-    PFPClockView = ^TFPClockView;
-    TFPClockView = object(TClockView)
-      constructor Init(var Bounds: TRect);
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      function    GetPalette: PPalette; virtual;
-    end;
-
-    TFPWindow = object(TWindow)
-      AutoNumber: boolean;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   SetState(AState: Word; Enable: Boolean); virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   Update; virtual;
-    end;
-
-    PFPHelpViewer = ^TFPHelpViewer;
-    TFPHelpViewer = object(THelpViewer)
-      function    GetLocalMenu: PMenu; virtual;
-      function    GetCommandTarget: PView; virtual;
-    end;
-
-    PFPHelpWindow = ^TFPHelpWindow;
-    TFPHelpWindow = object(THelpWindow)
-      constructor Init(var Bounds: TRect; ATitle: TTitleStr; ASourceFileID: word; AContext: THelpCtx; ANumber: Integer);
-      destructor  Done;virtual;
-      procedure   InitHelpView; virtual;
-      procedure   Show; {virtual;}
-      procedure   Hide; {virtual;}
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      function    GetPalette: PPalette; virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-    end;
-
-    PTextScroller = ^TTextScroller;
-    TTextScroller = object(TStaticText)
-      TopLine: integer;
-      Speed  : integer;
-      Lines  : PUnsortedStringCollection;
-      constructor Init(var Bounds: TRect; ASpeed: integer; AText: PUnsortedStringCollection);
-      function    GetLineCount: integer; virtual;
-      function    GetLine(I: integer): string; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   Update; virtual;
-      procedure   Reset; virtual;
-      procedure   Scroll; virtual;
-      procedure   Draw; virtual;
-      destructor  Done; virtual;
-    private
-      LastTT: longint;
-    end;
-
-    TAlign = (alLeft,alCenter,alRight);
-
-    PFPToolTip = ^TFPToolTip;
-    TFPToolTip = object(TView)
-      constructor Init(var Bounds: TRect; const AText: string; AAlign: TAlign);
-      procedure   Draw; virtual;
-      function    GetText: string;
-      procedure   SetText(const AText: string);
-      function    GetAlign: TAlign;
-      procedure   SetAlign(AAlign: TAlign);
-      function    GetPalette: PPalette; virtual;
-      destructor  Done; virtual;
-    private
-      Text: PString;
-      Align: TAlign;
-    end;
-
-    PSourceEditor = ^TSourceEditor;
-    TSourceEditor = object(TFileEditor)
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-          PScrollBar; AIndicator: PIndicator;const AFileName: string);
-      CompileStamp : longint;
-{$ifndef EDITORS}
-    public
-      CodeCompleteTip: PFPToolTip;
-      { Syntax highlight }
-      function  IsReservedWord(const S: string): boolean; virtual;
-      function  GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
-      function  GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string; virtual;
-      { CodeTemplates }
-      function    TranslateCodeTemplate(const Shortcut: string; ALines: PUnsortedStringCollection): boolean; virtual;
-      { CodeComplete }
-      function    CompleteCodeWord(const WordS: string; var Text: string): boolean; virtual;
-      procedure   SetCodeCompleteWord(const S: string); virtual;
-      procedure   AlignCodeCompleteTip;
-{$endif}
-      procedure   HandleEvent(var Event: TEvent); virtual;
-{$ifdef DebugUndo}
-      procedure   DumpUndo;
-      procedure   UndoAll;
-      procedure   RedoAll;
-{$endif DebugUndo}
-      function    GetLocalMenu: PMenu; virtual;
-      function    GetCommandTarget: PView; virtual;
-      function    CreateLocalMenuView(var Bounds: TRect; M: PMenu): PMenuPopup; virtual;
-      procedure   ModifiedChanged; virtual;
-      procedure   InsertOptions; virtual;
-    end;
-
-    PSourceWindow = ^TSourceWindow;
-    TSourceWindow = object(TFPWindow)
-      Editor    : PSourceEditor;
-      Indicator : PIndicator;
-      constructor Init(var Bounds: TRect; AFileName: string);
-      function    GetTitle(MaxSize: sw_Integer): TTitleStr; virtual;
-      procedure   SetTitle(ATitle: string); virtual;
-      procedure   UpdateTitle; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   SetState(AState: Word; Enable: Boolean); virtual;
-      procedure   SelectInDebugSession;
-      procedure   Update; virtual;
-      procedure   UpdateCommands; virtual;
-      function    GetPalette: PPalette; virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   Close; virtual;
-      destructor  Done; virtual;
-    end;
-
-    PGDBSourceEditor = ^TGDBSourceEditor;
-    TGDBSourceEditor = object(TSourceEditor)
-      function   InsertNewLine : Sw_integer;virtual;
-      function   Valid(Command: Word): Boolean; virtual;
-      procedure  AddLine(const S: string); virtual;
-      procedure  AddErrorLine(const S: string); virtual;
-      { Syntax highlight }
-      function  IsReservedWord(const S: string): boolean; virtual;
-    private
-      Silent,
-      AutoRepeat,
-      IgnoreStringAtEnd : boolean;
-      LastCommand : String;
-      end;
-
-    PGDBWindow = ^TGDBWindow;
-    TGDBWindow = object(TFPWindow)
-      Editor    : PGDBSourceEditor;
-      Indicator : PIndicator;
-      constructor Init(var Bounds: TRect);
-      procedure   WriteText(Buf : pchar;IsError : boolean);
-      procedure   WriteString(Const S : string);
-      procedure   WriteErrorString(Const S : string);
-      procedure   WriteOutputText(Buf : pchar);
-      procedure   WriteErrorText(Buf : pchar);
-      function    GetPalette: PPalette;virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   SetState(AState: Word; Enable: Boolean); virtual;
-      procedure   UpdateCommands; virtual;
-      destructor  Done; virtual;
-    end;
-
-    PClipboardWindow = ^TClipboardWindow;
-    TClipboardWindow = object(TSourceWindow)
-      constructor Init;
-      procedure   Close; virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      destructor  Done; virtual;
-    end;
-
-    PMessageItem = ^TMessageItem;
-    TMessageItem = object(TObject)
-      TClass    : longint;
-      Text      : PString;
-      Module    : PString;
-      Row,Col   : sw_integer;
-      constructor Init(AClass: longint; const AText: string; AModule: PString; ARow, ACol: sw_integer);
-      function    GetText(MaxLen: Sw_integer): string; virtual;
-      procedure   Selected; virtual;
-      function    GetModuleName: string; virtual;
-      destructor  Done; virtual;
-    end;
-
-    PMessageListBox = ^TMessageListBox;
-    TMessageListBox = object(THSListBox)
-      Transparent : boolean;
-      NoSelection : boolean;
-      MaxWidth    : Sw_integer;
-      ModuleNames : PStoreCollection;
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-      procedure   AddItem(P: PMessageItem); virtual;
-      function    AddModuleName(const Name: string): PString; virtual;
-      function    GetText(Item,MaxLen: Sw_Integer): String; virtual;
-      procedure   Clear; virtual;
-      procedure   TrackSource; virtual;
-      procedure   GotoSource; virtual;
-      procedure   Draw; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      function    GetLocalMenu: PMenu; virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      destructor  Done; virtual;
-    end;
-
-{$ifdef OLDCOMP}
-    PCompilerMessage = ^TCompilerMessage;
-    TCompilerMessage = object(TMessageItem)
-      function GetText(MaxLen: Sw_Integer): String; virtual;
-    end;
-{$endif}
-
-    PProgramInfoWindow = ^TProgramInfoWindow;
-    TProgramInfoWindow = object(TDlgWindow)
-      InfoST: PColorStaticText;
-      LogLB : PMessageListBox;
-      constructor Init;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   AddMessage(AClass: longint; Msg, Module: string; Line, Column: longint);
-      procedure   ClearMessages;
-      procedure   SizeLimits(var Min, Max: TPoint); virtual;
-      procedure   Close; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   Update; virtual;
-      destructor  Done; virtual;
-    end;
-
-    PTabItem = ^TTabItem;
-    TTabItem = record
-      Next : PTabItem;
-      View : PView;
-      Dis  : boolean;
-    end;
-
-    PTabDef = ^TTabDef;
-    TTabDef = record
-      Next     : PTabDef;
-      Name     : PString;
-      Items    : PTabItem;
-      DefItem  : PView;
-      ShortCut : char;
-    end;
-
-    PTab = ^TTab;
-    TTab = object(TGroup)
-      TabDefs   : PTabDef;
-      ActiveDef : integer;
-      DefCount  : word;
-      constructor Init(var Bounds: TRect; ATabDef: PTabDef);
-      function    AtTab(Index: integer): PTabDef; virtual;
-      procedure   SelectTab(Index: integer); virtual;
-      function    TabCount: integer;
-      procedure   SelectNextTab(Forwards: boolean);
-      function    Valid(Command: Word): Boolean; virtual;
-      procedure   ChangeBounds(var Bounds: TRect); virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      function    GetPalette: PPalette; virtual;
-      procedure   Draw; virtual;
-      procedure   SetState(AState: Word; Enable: Boolean); virtual;
-      destructor  Done; virtual;
-    private
-      InDraw: boolean;
-    end;
-
-    PScreenView = ^TScreenView;
-    TScreenView = object(TScroller)
-      Screen: PScreen;
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar;
-                    AScreen: PScreen);
-      procedure   Draw; virtual;
-      procedure   Update; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-    end;
-
-    PScreenWindow = ^TScreenWindow;
-    TScreenWindow = object(TFPWindow)
-      ScreenView : PScreenView;
-      constructor Init(AScreen: PScreen; ANumber: integer);
-      destructor  Done; virtual;
-    end;
-
-    PFPAboutDialog = ^TFPAboutDialog;
-    TFPAboutDialog = object(TCenterDialog)
-      constructor Init;
-      procedure   ToggleInfo;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-    private
-      Scroller: PTextScroller;
-      TitleST : PStaticText;
-    end;
-
-    PFPASCIIChart = ^TFPASCIIChart;
-    TFPASCIIChart = object(TASCIIChart)
-      constructor Init;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      destructor  Done; virtual;
-    end;
-
-    PVideoModeListBox = ^TVideoModeListBox;
-    TVideoModeListBox = object(TDropDownListBox)
-      function    GetText(Item: pointer; MaxLen: sw_integer): string; virtual;
-    end;
-
-    PFPDesktop = ^TFPDesktop;
-    TFPDesktop = object(TDesktop)
-      constructor Init(var Bounds: TRect);
-      procedure   InitBackground; virtual;
-      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);
-    end;
-
-    PFPMemo = ^TFPMemo;
-    TFPMemo = object(TCodeEditor)
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-                    PScrollBar; AIndicator: PIndicator);
-      function    IsReservedWord(const S: string): boolean; virtual;
-      function    GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
-      function    GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string; virtual;
-      function    GetPalette: PPalette; virtual;
-    end;
-
-    PFPCodeMemo = ^TFPCodeMemo;
-    TFPCodeMemo = object(TFPMemo)
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-                    PScrollBar; AIndicator: PIndicator);
-      function    IsReservedWord(const S: string): boolean; virtual;
-      function    GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
-      function    GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string; virtual;
-    end;
-
-function  SearchFreeWindowNo: integer;
-
-function IsWindow(P: PView): boolean;
-function IsThereAnyEditor: boolean;
-function IsThereAnyWindow: boolean;
-function IsThereAnyVisibleWindow: boolean;
-function IsThereAnyNumberedWindow: boolean;
-function FirstEditorWindow: PSourceWindow;
-function EditorWindowFile(const Name : String): PSourceWindow;
-
-function  NewTabItem(AView: PView; ANext: PTabItem): PTabItem;
-procedure DisposeTabItem(P: PTabItem);
-function  NewTabDef(AName: string; ADefItem: PView; AItems: PTabItem; ANext: PTabDef): PTabDef;
-procedure DisposeTabDef(P: PTabDef);
-
-function GetEditorCurWord(Editor: PEditor; ValidSpecChars: TCharSet): string;
-procedure InitReservedWords;
-procedure DoneReservedWords;
-function GetReservedWordCount: integer;
-function GetReservedWord(Index: integer): string;
-
-procedure TranslateMouseClick(View: PView; var Event: TEvent);
-
-function GetNextEditorBounds(var Bounds: TRect): boolean;
-function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
-function IOpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer; ShowIt: boolean): PSourceWindow;
-function SearchOnDesktop(FileName : string;tryexts:boolean) : PSourceWindow;
-function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts: boolean): PSourceWindow;
-function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts, ShowIt,
-         ForceNewWindow:boolean): PSourceWindow;
-function LocateSourceFile(const FileName: string; tryexts: boolean): string;
-
-function SearchWindow(const Title: string): PWindow;
-
-function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
-
-{$ifdef VESA}
-procedure InitVESAScreenModes;
-{$endif}
-
-procedure NoDebugger;
-
-const
-      SourceCmds  : TCommandSet =
-        ([cmSave,cmSaveAs,cmCompile,cmHide]);
-      EditorCmds  : TCommandSet =
-        ([cmFind,cmReplace,cmSearchAgain,cmJumpLine,cmHelpTopicSearch]);
-      CompileCmds : TCommandSet =
-        ([cmMake,cmBuild,cmRun]);
-
-      CalcClipboard   : extended = 0;
-
-      OpenFileName    : string{$ifdef GABOR}[50]{$endif} = '';
-      OpenFileLastExt : string[12] = '*.pas';
-      NewEditorOpened : boolean = false;
-
-var  MsgParms : array[1..10] of
-         record
-           case byte of
-             0 : (Ptr : pointer);
-             1 : (Long: longint);
-         end;
-
-procedure RegisterFPViews;
-
-implementation
-
-uses
-  Video,Strings,Keyboard,Validate,
-  globtype,Tokens,Version,
-{$ifndef NODEBUG}
-  gdbint,
-{$endif NODEBUG}
-  {$ifdef VESA}Vesa,{$endif}
-  FPString,FPSwitch,FPSymbol,FPDebug,FPVars,FPUtils,FPCompil,FPHelp,
-  FPTools,FPIDE,FPCodTmp,FPCodCmp;
-
-const
-  RSourceEditor: TStreamRec = (
-     ObjType: 1500;
-     VmtLink: Ofs(TypeOf(TSourceEditor)^);
-     Load:    @TSourceEditor.Load;
-     Store:   @TSourceEditor.Store
-  );
-  RSourceWindow: TStreamRec = (
-     ObjType: 1501;
-     VmtLink: Ofs(TypeOf(TSourceWindow)^);
-     Load:    @TSourceWindow.Load;
-     Store:   @TSourceWindow.Store
-  );
-  RFPHelpViewer: TStreamRec = (
-     ObjType: 1502;
-     VmtLink: Ofs(TypeOf(TFPHelpViewer)^);
-     Load:    @TFPHelpViewer.Load;
-     Store:   @TFPHelpViewer.Store
-  );
-  RFPHelpWindow: TStreamRec = (
-     ObjType: 1503;
-     VmtLink: Ofs(TypeOf(TFPHelpWindow)^);
-     Load:    @TFPHelpWindow.Load;
-     Store:   @TFPHelpWindow.Store
-  );
-  RClipboardWindow: TStreamRec = (
-     ObjType: 1504;
-     VmtLink: Ofs(TypeOf(TClipboardWindow)^);
-     Load:    @TClipboardWindow.Load;
-     Store:   @TClipboardWindow.Store
-  );
-  RMessageListBox: TStreamRec = (
-     ObjType: 1505;
-     VmtLink: Ofs(TypeOf(TMessageListBox)^);
-     Load:    @TMessageListBox.Load;
-     Store:   @TMessageListBox.Store
-  );
-  RFPDesktop: TStreamRec = (
-     ObjType: 1506;
-     VmtLink: Ofs(TypeOf(TFPDesktop)^);
-     Load:    @TFPDesktop.Load;
-     Store:   @TFPDesktop.Store
-  );
-
-  RGDBSourceEditor: TStreamRec = (
-     ObjType: 1507;
-     VmtLink: Ofs(TypeOf(TGDBSourceEditor)^);
-     Load:    @TGDBSourceEditor.Load;
-     Store:   @TGDBSourceEditor.Store
-  );
-  RGDBWindow: TStreamRec = (
-     ObjType: 1508;
-     VmtLink: Ofs(TypeOf(TGDBWindow)^);
-     Load:    @TGDBWindow.Load;
-     Store:   @TGDBWindow.Store
-  );
-  RFPASCIIChart: TStreamRec = (
-     ObjType: 1509;
-     VmtLink: Ofs(TypeOf(TFPASCIIChart)^);
-     Load:    @TFPASCIIChart.Load;
-     Store:   @TFPASCIIChart.Store
-  );
-  RProgramInfoWindow: TStreamRec = (
-     ObjType: 1510;
-     VmtLink: Ofs(TypeOf(TProgramInfoWindow)^);
-     Load:    @TProgramInfoWindow.Load;
-     Store:   @TProgramInfoWindow.Store
-  );
-const
-  NoNameCount    : integer = 0;
-var
-  ReservedWords  : array[1..ReservedWordMaxLen] of PStringCollection;
-
-{****************************************************************************
-                                TStoreCollection
-****************************************************************************}
-
-function TStoreCollection.Add(const S: string): PString;
-var P: PString;
-    Index: Sw_integer;
-begin
-  if S='' then P:=nil else
-  if Search(@S,Index) then P:=At(Index) else
-    begin
-      P:=NewStr(S);
-      Insert(P);
-    end;
-  Add:=P;
-end;
-
-
-function IsThereAnyEditor: boolean;
-function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif}
-begin
-  EditorWindow:=(P^.HelpCtx=hcSourceWindow);
-end;
-begin
-  IsThereAnyEditor:=Desktop^.FirstThat(@EditorWindow)<>nil;
-end;
-
-function IsThereAnyHelpWindow: boolean;
-begin
-  IsThereAnyHelpWindow:=(HelpWindow<>nil) and (HelpWindow^.GetState(sfVisible));
-end;
-
-function IsThereAnyNumberedWindow: boolean;
-var _Is: boolean;
-begin
-  _Is:=Message(Desktop,evBroadcast,cmSearchWindow,nil)<>nil;
-  _Is:=_Is or ( (ClipboardWindow<>nil) and ClipboardWindow^.GetState(sfVisible));
-  IsThereAnyNumberedWindow:=_Is;
-end;
-
-function IsWindow(P: PView): boolean;
-var OK: boolean;
-begin
-  OK:=false;
-  if (P^.HelpCtx=hcSourceWindow) or
-     (P^.HelpCtx=hcHelpWindow) or
-     (P^.HelpCtx=hcClipboardWindow) or
-     (P^.HelpCtx=hcCalcWindow) or
-     (P^.HelpCtx=hcInfoWindow) or
-     (P^.HelpCtx=hcBrowserWindow) or
-     (P^.HelpCtx=hcMessagesWindow) or
-     (P^.HelpCtx=hcGDBWindow) or
-     (P^.HelpCtx=hcBreakpointListWindow) or
-     (P^.HelpCtx=hcASCIITableWindow)
-   then
-     OK:=true;
-   IsWindow:=OK;
-end;
-
-function IsThereAnyWindow: boolean;
-function CheckIt(P: PView): boolean; {$ifndef FPC}far;{$endif}
-begin
-  CheckIt:=IsWindow(P);
-end;
-begin
-  IsThereAnyWindow:=Desktop^.FirstThat(@CheckIt)<>nil;
-end;
-
-function IsThereAnyVisibleWindow: boolean;
-function CheckIt(P: PView): boolean; {$ifndef FPC}far;{$endif}
-begin
-  CheckIt:=IsWindow(P) and P^.GetState(sfVisible);
-end;
-begin
-  IsThereAnyVisibleWindow:=Desktop^.FirstThat(@CheckIt)<>nil;
-end;
-
-function FirstEditorWindow: PSourceWindow;
-function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif}
-begin
-  EditorWindow:=(P^.HelpCtx=hcSourceWindow);
-end;
-begin
-  FirstEditorWindow:=pointer(Desktop^.FirstThat(@EditorWindow));
-end;
-
-function EditorWindowFile(const Name : String): PSourceWindow;
-function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif}
-begin
-  EditorWindow:=(TypeOf(P^)=TypeOf(TSourceWindow)) and
-{$ifdef Unix}
-                 (PSourceWindow(P)^.Editor^.FileName=Name);
-{$else}
-                 (UpcaseStr(PSourceWindow(P)^.Editor^.FileName)=UpcaseStr(Name));
-{$endif Unix}
-end;
-begin
-  EditorWindowFile:=pointer(Desktop^.FirstThat(@EditorWindow));
-end;
-
-function GetEditorCurWord(Editor: PEditor; ValidSpecChars: TCharSet): string;
-var S: string;
-    PS,PE: byte;
-function Trim(S: string): string;
-const TrimChars : set of char = [#0,#9,' ',#255];
-begin
-  while (length(S)>0) and (S[1] in TrimChars) do Delete(S,1,1);
-  while (length(S)>0) and (S[length(S)] in TrimChars) do Delete(S,length(S),1);
-  Trim:=S;
-end;
-const AlphaNum : set of char = ['A'..'Z','0'..'9','_'];
-begin
-  with Editor^ do
-  begin
-{$ifdef EDITORS}
-    S:='';
-{$else}
-    S:=GetDisplayText(CurPos.Y);
-    PS:=CurPos.X; while (PS>0) and (Upcase(S[PS]) in AlphaNum) do Dec(PS);
-    PE:=CurPos.X; while (PE<length(S)) and (Upcase(S[PE+1]) in (AlphaNum+ValidSpecChars)) do Inc(PE);
-    S:=Trim(copy(S,PS+1,PE-PS));
-{$endif}
-  end;
-  GetEditorCurWord:=S;
-end;
-
-
-{*****************************************************************************
-                                   Tab
-*****************************************************************************}
-
-function NewTabItem(AView: PView; ANext: PTabItem): PTabItem;
-var P: PTabItem;
-begin
-  New(P); FillChar(P^,SizeOf(P^),0);
-  P^.Next:=ANext; P^.View:=AView;
-  NewTabItem:=P;
-end;
-
-procedure DisposeTabItem(P: PTabItem);
-begin
-  if P<>nil then
-  begin
-    if P^.View<>nil then Dispose(P^.View, Done);
-    Dispose(P);
-  end;
-end;
-
-function NewTabDef(AName: string; ADefItem: PView; AItems: PTabItem; ANext: PTabDef): PTabDef;
-var P: PTabDef;
-    x: byte;
-begin
-  New(P);
-  P^.Next:=ANext; P^.Name:=NewStr(AName); P^.Items:=AItems;
-  x:=pos('~',AName);
-  if (x<>0) and (x<length(AName)) then P^.ShortCut:=Upcase(AName[x+1])
-                                  else P^.ShortCut:=#0;
-  P^.DefItem:=ADefItem;
-  NewTabDef:=P;
-end;
-
-procedure DisposeTabDef(P: PTabDef);
-var PI,X: PTabItem;
-begin
-  DisposeStr(P^.Name);
-  PI:=P^.Items;
-  while PI<>nil do
-    begin
-      X:=PI^.Next;
-      DisposeTabItem(PI);
-      PI:=X;
-    end;
-  Dispose(P);
-end;
-
-
-{*****************************************************************************
-                               Reserved Words
-*****************************************************************************}
-
-function GetReservedWordCount: integer;
-var
-  Count,I: integer;
-begin
-  Count:=0;
-  for I:=ord(Low(tToken)) to ord(High(tToken)) do
-  with TokenInfo^[TToken(I)] do
-     if (str<>'') and (str[1] in['A'..'Z']) and (keyword=m_all) then
-       Inc(Count);
-  GetReservedWordCount:=Count;
-end;
-
-function GetReservedWord(Index: integer): string;
-var
-  Count,Idx,I: integer;
-  S: string;
-begin
-  Idx:=-1;
-  Count:=-1;
-  I:=ord(Low(tToken));
-  while (I<=ord(High(tToken))) and (Idx=-1) do
-   with TokenInfo^[TToken(I)] do
-    begin
-      if (str<>'') and (str[1] in['A'..'Z']) and (keyword=m_all) then
-        begin
-          Inc(Count);
-          if Count=Index then
-           Idx:=I;
-        end;
-      Inc(I);
-    end;
-  if Idx=-1 then
-    S:=''
-  else
-    S:=TokenInfo^[TToken(Idx)].str;
-  GetReservedWord:=S;
-end;
-
-procedure InitReservedWords;
-var WordS: string;
-    Idx,I: integer;
-begin
-  InitTokens;
-  for I:=Low(ReservedWords) to High(ReservedWords) do
-    New(ReservedWords[I], Init(50,10));
-  for I:=1 to GetReservedWordCount do
-    begin
-      WordS:=GetReservedWord(I-1); Idx:=length(WordS);
-      ReservedWords[Idx]^.Insert(NewStr(WordS));
-    end;
-end;
-
-procedure DoneReservedWords;
-var I: integer;
-begin
-  for I:=Low(ReservedWords) to High(ReservedWords) do
-    if assigned(ReservedWords[I]) then
-      begin
-        dispose(ReservedWords[I],done);
-        ReservedWords[I]:=nil;
-      end;
-  DoneTokens;
-end;
-
-function IsFPReservedWord(S: string): boolean;
-var _Is: boolean;
-    Idx,Item: sw_integer;
-begin
-  Idx:=length(S); _Is:=false;
-  if (Low(ReservedWords)<=Idx) and (Idx<=High(ReservedWords)) and
-     (ReservedWords[Idx]<>nil) and (ReservedWords[Idx]^.Count<>0) then
-    begin
-      S:=UpcaseStr(S);
-      _Is:=ReservedWords[Idx]^.Search(@S,Item);
-    end;
-  IsFPReservedWord:=_Is;
-end;
-
-
-{*****************************************************************************
-                               SearchWindow
-*****************************************************************************}
-
-function SearchWindowWithNo(No: integer): PWindow;
-var P: PSourceWindow;
-begin
-  P:=Message(Desktop,evBroadcast,cmSearchWindow+No,nil);
-  if pointer(P)=pointer(Desktop) then P:=nil;
-  SearchWindowWithNo:=P;
-end;
-
-function SearchWindow(const Title: string): PWindow;
-function Match(P: PView): boolean; {$ifndef FPC}far;{$endif}
-var W: PWindow;
-    OK: boolean;
-begin
-  W:=nil;
-  { we have a crash here because of the TStatusLine
-    that can also have one of these values
-    but is not a Window object PM }
-  if P<>pointer(StatusLine) then
-  if IsWindow(P) then
-    W:=PWindow(P);
-  OK:=(W<>nil);
-  if OK then
-  begin
-    OK:=CompareText(W^.GetTitle(255),Title)=0;
-  end;
-  Match:=OK;
-end;
-var W: PView;
-begin
-  W:=Application^.FirstThat(@Match);
-{    This is wrong because TStatusLine is also considered PM }
-  if not Assigned(W) then W:=Desktop^.FirstThat(@Match);
-  { But why do we need to check all ??
-    Probably because of the ones which were not inserted into
-    Desktop as the Messages view
-
-    Exactly. Some windows are inserted directly in the Application and not
-    in the Desktop. btw. Does TStatusLine.HelpCtx really change? Why?
-    Only GetHelpCtx should return different values depending on the
-    focused view (and it's helpctx), but TStatusLine's HelpCtx field
-    shouldn't change...  Gabor
-
-  if Assigned(W)=false then W:=Desktop^.FirstThat(@Match);}
-  SearchWindow:=PWindow(W);
-end;
-
-function SearchFreeWindowNo: integer;
-var No: integer;
-begin
-  No:=1;
-  while (No<100) and (SearchWindowWithNo(No)<>nil) do
-    Inc(No);
-  if No=100 then No:=0;
-  SearchFreeWindowNo:=No;
-end;
-
-
-{*****************************************************************************
-                              TIntegerLine
- *****************************************************************************}
-
-constructor TIntegerLine.Init(var Bounds: TRect; AMin, AMax: longint);
-begin
-  if inherited Init(Bounds, Bounds.B.X-Bounds.A.X-1)=false then
-    Fail;
-  Validator:=New(PRangeValidator, Init(AMin, AMax));
-end;
-
-
-{*****************************************************************************
-                               SourceEditor
-*****************************************************************************}
-
-{$ifndef EDITORS}
-
-function SearchCoreForFileName(const AFileName: string): PCodeEditorCore;
-var EC: PCodeEditorCore;
-function Check(P: PView): boolean; {$ifndef FPC}far;{$endif}
-var OK: boolean;
-begin
-  OK:=P^.HelpCtx=hcSourceWindow;
-  if OK then
-  with PSourceWindow(P)^ do
-  if CompareText(Editor^.FileName,AFileName)=0 then
-  begin
-    EC:=Editor^.Core;
-  end;
-  Check:=OK;
-end;
-begin
-  EC:=nil;
-  Desktop^.FirstThat(@Check);
-  SearchCoreForFileName:=EC;
-end;
-
-constructor TSourceEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-          PScrollBar; AIndicator: PIndicator;const AFileName: string);
-var EC: PCodeEditorCore;
-begin
-  EC:=SearchCoreForFileName(AFileName);
-  inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,EC,AFileName);
-  SetStoreUndo(true);
-  CompileStamp:=0;
-end;
-
-function TSourceEditor.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
-var Count: integer;
-begin
-  case SpecClass of
-    ssCommentPrefix   : Count:=3;
-    ssCommentSingleLinePrefix   : Count:=1;
-    ssCommentSuffix   : Count:=2;
-    ssStringPrefix    : Count:=1;
-    ssStringSuffix    : Count:=1;
-    ssAsmPrefix       : Count:=1;
-    ssAsmSuffix       : Count:=1;
-    ssDirectivePrefix : Count:=1;
-    ssDirectiveSuffix : Count:=1;
-  end;
-  GetSpecSymbolCount:=Count;
-end;
-
-function TSourceEditor.GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string;
-var S: string[20];
-begin
-  case SpecClass of
-    ssCommentPrefix :
-      case Index of
-        0 : S:='{';
-        1 : S:='(*';
-        2 : S:='//';
-      end;
-    ssCommentSingleLinePrefix :
-      case Index of
-        0 : S:='//';
-      end;
-    ssCommentSuffix :
-      case Index of
-        0 : S:='}';
-        1 : S:='*)';
-      end;
-    ssStringPrefix :
-      S:='''';
-    ssStringSuffix :
-      S:='''';
-    ssAsmPrefix :
-      S:='asm';
-    ssAsmSuffix :
-      S:='end';
-    ssDirectivePrefix :
-      S:='{$';
-    ssDirectiveSuffix :
-      S:='}';
-  end;
-  GetSpecSymbol:=S;
-end;
-
-function TSourceEditor.IsReservedWord(const S: string): boolean;
-begin
-  IsReservedWord:=IsFPReservedWord(S);
-end;
-
-function TSourceEditor.TranslateCodeTemplate(const Shortcut: string; ALines: PUnsortedStringCollection): boolean;
-begin
-  TranslateCodeTemplate:=FPTranslateCodeTemplate(ShortCut,ALines);
-end;
-
-function TSourceEditor.CompleteCodeWord(const WordS: string; var Text: string): boolean;
-begin
-  CompleteCodeWord:=FPCompleteCodeWord(WordS,Text);
-end;
-
-procedure TSourceEditor.SetCodeCompleteWord(const S: string);
-var R: TRect;
-begin
-  inherited SetCodeCompleteWord(S);
-  if S='' then
-    begin
-      if Assigned(CodeCompleteTip) then Dispose(CodeCompleteTip, Done);
-      CodeCompleteTip:=nil;
-    end
-  else
-    begin
-      R.Assign(0,0,20,1);
-      if Assigned(CodeCompleteTip)=false then
-        begin
-          New(CodeCompleteTip, Init(R, S, alCenter));
-          CodeCompleteTip^.Hide;
-          Application^.Insert(CodeCompleteTip);
-        end
-      else
-        CodeCompleteTip^.SetText(S);
-      AlignCodeCompleteTip;
-    end;
-end;
-
-procedure TSourceEditor.AlignCodeCompleteTip;
-var P: TPoint;
-    S: string;
-    R: TRect;
-begin
-  if Assigned(CodeCompleteTip)=false then Exit;
-  S:=CodeCompleteTip^.GetText;
-  P.Y:=CurPos.Y;
-  { determine the center of current word fragment }
-  P.X:=CurPos.X-(length(GetCodeCompleteFrag) div 2);
-  { calculate position for centering the complete word over/below the current }
-  P.X:=P.X-(length(S) div 2);
-
-  P.X:=P.X-Delta.X;
-  P.Y:=P.Y-Delta.Y;
-  MakeGlobal(P,P);
-  if Assigned(CodeCompleteTip^.Owner) then
-    CodeCompleteTip^.Owner^.MakeLocal(P,P);
-
-  { ensure that the tooltip stays in screen }
-  P.X:=Min(Max(0,P.X),ScreenWidth-length(S)-2-1);
-  { align it vertically }
-  if P.Y>round(ScreenHeight*3/4) then
-    Dec(P.Y)
-  else
-    Inc(P.Y);
-  R.Assign(P.X,P.Y,P.X+1+length(S)+1,P.Y+1);
-  CodeCompleteTip^.Locate(R);
-  if CodeCompleteTip^.GetState(sfVisible)=false then
-    CodeCompleteTip^.Show;
-end;
-
-{$endif EDITORS}
-
-procedure TSourceEditor.ModifiedChanged;
-begin
-  inherited ModifiedChanged;
-  if (@Self<>Clipboard) and GetModified then
-    begin
-      { global flags }
-      EditorModified:=true;
-      { reset compile flags as the file is
-      not the same as at the compilation anymore }
-      CompileStamp:=-1;
-    end;
-end;
-
-procedure TSourceEditor.InsertOptions;
-var C: PUnsortedStringCollection;
-    Y: sw_integer;
-    S: string;
-begin
-  Lock;
-  New(C, Init(10,10));
-  GetCompilerOptionLines(C);
-  if C^.Count>0 then
-  begin
-    for Y:=0 to C^.Count-1 do
-    begin
-      S:=C^.At(Y)^;
-      InsertLine(Y,S);
-    end;
-    AdjustSelectionPos(0,0,0,C^.Count);
-    UpdateAttrs(0,attrAll);
-    DrawLines(0);
-    SetModified(true);
-  end;
-  Dispose(C, Done);
-  UnLock;
-end;
-
-function TSourceEditor.GetLocalMenu: PMenu;
-var M: PMenu;
-begin
-  M:=NewMenu(
-    NewItem(menu_edit_cut,menu_key_edit_cut,kbShiftDel,cmCut,hcCut,
-    NewItem(menu_edit_copy,menu_key_edit_copy,kbCtrlIns,cmCopy,hcCopy,
-    NewItem(menu_edit_paste,menu_key_edit_paste,kbShiftIns,cmPaste,hcPaste,
-    NewItem(menu_edit_clear,menu_key_edit_clear,kbCtrlDel,cmClear,hcClear,
-    NewLine(
-    NewItem(menu_srclocal_openfileatcursor,'',kbNoKey,cmOpenAtCursor,hcOpenAtCursor,
-    NewItem(menu_srclocal_browseatcursor,'',kbNoKey,cmBrowseAtCursor,hcBrowseAtCursor,
-    NewItem(menu_srclocal_topicsearch,menu_key_help_topicsearch,kbCtrlF1,cmHelpTopicSearch,hcHelpTopicSearch,
-    NewLine(
-    NewItem(menu_srclocal_options,'',kbNoKey,cmEditorOptions,hcEditorOptions,
-    nil)))))))))));
-  GetLocalMenu:=M;
-end;
-
-function TSourceEditor.GetCommandTarget: PView;
-begin
-  GetCommandTarget:=@Self;
-end;
-
-function TSourceEditor.CreateLocalMenuView(var Bounds: TRect; M: PMenu): PMenuPopup;
-var MV: PAdvancedMenuPopup;
-begin
-  New(MV, Init(Bounds,M));
-  CreateLocalMenuView:=MV;
-end;
-
-{$ifdef DebugUndo}
-procedure TSourceEditor.DumpUndo;
-var
-  i : sw_integer;
-begin
-  ClearToolMessages;
-  AddToolCommand('UndoList Dump');
-  for i:=0 to Core^.UndoList^.count-1 do
-    with Core^.UndoList^.At(i)^ do
-      begin
-       if is_grouped_action then
-         AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
-       else
-         AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.Y+1)+':'+IntToStr(StartPos.X+1)+
-           ' '+IntToStr(EndPos.Y+1)+':'+IntToStr(EndPos.X+1)+' "'+GetStr(Text)+'"',0,0);
-      end;
-  if Core^.RedoList^.count>0 then
-    AddToolCommand('RedoList Dump');
-  for i:=0 to Core^.RedoList^.count-1 do
-    with Core^.RedoList^.At(i)^ do
-      begin
-       if is_grouped_action then
-         AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
-       else
-         AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.Y)+':'+IntToStr(StartPos.X+1)+
-         ' '+IntToStr(EndPos.Y+1)+':'+IntToStr(EndPos.X+1)+' "'+GetStr(Text)+'"',0,0);
-      end;
-  UpdateToolMessages;
-  if Assigned(MessagesWindow) then
-    MessagesWindow^.Focus;
-end;
-
-procedure TSourceEditor.UndoAll;
-begin
-  While Core^.UndoList^.count>0 do
-    Undo;
-end;
-
-procedure TSourceEditor.RedoAll;
-begin
-  While Core^.RedoList^.count>0 do
-    Redo;
-end;
-
-{$endif DebugUndo}
-
-procedure TSourceEditor.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-    S: string;
-begin
-  TranslateMouseClick(@Self,Event);
-  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbCtrlEnter :
-            Message(@Self,evCommand,cmOpenAtCursor,nil);
-        else DontClear:=true;
-        end;
-        if not DontClear then ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-  case Event.What of
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-{$ifdef DebugUndo}
-          cmDumpUndo    : DumpUndo;
-          cmUndoAll     : UndoAll;
-          cmRedoAll     : RedoAll;
-{$endif DebugUndo}
-          cmBrowseAtCursor:
-            begin
-              S:=LowerCaseStr(GetEditorCurWord(@Self,[]));
-              OpenOneSymbolBrowser(S);
-            end;
-          cmOpenAtCursor :
-            begin
-              S:=LowerCaseStr(GetEditorCurWord(@Self,['.']));
-              if Pos('.',S)<>0 then
-                OpenFileName:=S else
-              OpenFileName:=S+'.pp'+ListSeparator+
-                            S+'.pas'+ListSeparator+
-                            S+'.inc';
-              Message(Application,evCommand,cmOpen,nil);
-            end;
-          cmEditorOptions :
-            Message(Application,evCommand,cmEditorOptions,@Self);
-          cmHelp :
-            Message(@Self,evCommand,cmHelpTopicSearch,@Self);
-          cmHelpTopicSearch :
-            HelpTopicSearch(@Self);
-        else DontClear:=true;
-        end;
-        if not DontClear then ClearEvent(Event);
-      end;
-  end;
-end;
-
-constructor TFPHeapView.Init(var Bounds: TRect);
-begin
-  if inherited Init(Bounds)=false then Fail;
-  Options:=Options or gfGrowHiX or gfGrowHiY;
-  EventMask:=EventMask or evIdle;
-  GrowMode:=gfGrowAll;
-end;
-
-constructor TFPHeapView.InitKb(var Bounds: TRect);
-begin
-  if inherited InitKb(Bounds)=false then Fail;
-  Options:=Options or gfGrowHiX or gfGrowHiY;
-  EventMask:=EventMask or evIdle;
-  GrowMode:=gfGrowAll;
-end;
-
-procedure TFPHeapView.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evIdle :
-      Update;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-constructor TFPClockView.Init(var Bounds: TRect);
-begin
-  inherited Init(Bounds);
-  EventMask:=EventMask or evIdle;
-end;
-
-procedure TFPClockView.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evIdle :
-      Update;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TFPClockView.GetPalette: PPalette;
-const P: string[length(CFPClockView)] = CFPClockView;
-begin
-  GetPalette:=@P;
-end;
-
-procedure TFPWindow.SetState(AState: Word; Enable: Boolean);
-begin
-  inherited SetState(AState,Enable);
-  if AutoNumber then
-    if (AState and (sfVisible+sfExposed))<>0 then
-      if GetState(sfVisible+sfExposed) then
-        begin
-          if Number=0 then
-            Number:=SearchFreeWindowNo;
-          ReDraw;
-        end
-      else
-        Number:=0;
-end;
-
-procedure TFPWindow.Update;
-begin
-  ReDraw;
-end;
-
-procedure TFPWindow.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-        cmUpdate :
-          Update;
-        cmSearchWindow+1..cmSearchWindow+99 :
-          if (Event.Command-cmSearchWindow=Number) then
-              ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-
-constructor TFPWindow.Load(var S: TStream);
-begin
-  inherited Load(S);
-  S.Read(AutoNumber,SizeOf(AutoNumber));
-end;
-
-procedure TFPWindow.Store(var S: TStream);
-begin
-  inherited Store(S);
-  S.Write(AutoNumber,SizeOf(AutoNumber));
-end;
-
-function TFPHelpViewer.GetLocalMenu: PMenu;
-var M: PMenu;
-begin
-  M:=NewMenu(
-    NewItem(menu_hlplocal_contents,'',kbNoKey,cmHelpContents,hcHelpContents,
-    NewItem(menu_hlplocal_index,menu_key_hlplocal_index,kbShiftF1,cmHelpIndex,hcHelpIndex,
-    NewItem(menu_hlplocal_topicsearch,menu_key_hlplocal_topicsearch,kbCtrlF1,cmHelpTopicSearch,hcHelpTopicSearch,
-    NewItem(menu_hlplocal_prevtopic,menu_key_hlplocal_prevtopic,kbAltF1,cmHelpPrevTopic,hcHelpPrevTopic,
-    NewLine(
-    NewItem(menu_hlplocal_copy,menu_key_hlplocal_copy,kbCtrlIns,cmCopy,hcCopy,
-    nil)))))));
-  GetLocalMenu:=M;
-end;
-
-function TFPHelpViewer.GetCommandTarget: PView;
-begin
-  GetCommandTarget:=Application;
-end;
-
-constructor TFPHelpWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ASourceFileID: word;
-  AContext: THelpCtx; ANumber: Integer);
-begin
-  inherited Init(Bounds,ATitle,ASourceFileID,AContext,ANumber);
-  HelpCtx:=hcHelpWindow;
-  HideOnClose:=true;
-end;
-
-destructor TFPHelpWindow.Done;
-begin
-  if HelpWindow=@Self then
-    HelpWindow:=nil;
-  Inherited Done;
-end;
-
-procedure TFPHelpWindow.InitHelpView;
-var R: TRect;
-begin
-  GetExtent(R); R.Grow(-1,-1);
-  HelpView:=New(PFPHelpViewer, Init(R, HSB, VSB));
-  HelpView^.GrowMode:=gfGrowHiX+gfGrowHiY;
-end;
-
-procedure TFPHelpWindow.Show;
-begin
-  inherited Show;
-  if GetState(sfVisible) and (Number=0) then
-    begin
-      Number:=SearchFreeWindowNo;
-      ReDraw;
-    end;
-end;
-
-procedure TFPHelpWindow.Hide;
-begin
-  inherited Hide;
-  if GetState(sfVisible)=false then
-    Number:=0;
-end;
-
-procedure TFPHelpWindow.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-        cmUpdate :
-          ReDraw;
-        cmSearchWindow+1..cmSearchWindow+99 :
-          if (Event.Command-cmSearchWindow=Number) then
-              ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TFPHelpWindow.GetPalette: PPalette;
-const P: string[length(CIDEHelpDialog)] = CIDEHelpDialog;
-begin
-  GetPalette:=@P;
-end;
-
-constructor TFPHelpWindow.Load(var S: TStream);
-begin
-  Abstract;
-end;
-
-procedure TFPHelpWindow.Store(var S: TStream);
-begin
-  Abstract;
-end;
-
-constructor TSourceWindow.Init(var Bounds: TRect; AFileName: string);
-var HSB,VSB: PScrollBar;
-    R: TRect;
-    PA : Array[1..2] of pointer;
-    LoadFile: boolean;
-begin
-  inherited Init(Bounds,AFileName,{SearchFreeWindowNo}0);
-  AutoNumber:=true;
-  Options:=Options or ofTileAble;
-  GetExtent(R); R.A.Y:=R.B.Y-1; R.Grow(-1,0); R.A.X:=14;
-  New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
-  GetExtent(R); R.A.X:=R.B.X-1; R.Grow(0,-1);
-  New(VSB, Init(R)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
-  GetExtent(R); R.A.X:=3; R.B.X:=14; R.A.Y:=R.B.Y-1;
-  New(Indicator, Init(R));
-  Indicator^.GrowMode:=gfGrowLoY+gfGrowHiY;
-  Insert(Indicator);
-  GetExtent(R); R.Grow(-1,-1);
-  LoadFile:=AFileName<>'';
-  if not LoadFile then
-     begin SetTitle('noname'+IntToStrZ(NonameCount,2)+'.pas'); Inc(NonameCount); end;
-  New(Editor, Init(R, HSB, VSB, Indicator,AFileName));
-  Editor^.GrowMode:=gfGrowHiX+gfGrowHiY;
-  if LoadFile then
-    begin
-      if Editor^.LoadFile=false then
-        ErrorBox(FormatStrStr(msg_errorreadingfile,AFileName),nil)
-      else if Editor^.GetModified then
-        begin
-          PA[1]:=@AFileName;
-          longint(PA[2]):={Editor^.ChangedLine}-1;
-          EditorDialog(edChangedOnloading,@PA);
-        end;
-   end;
-  Insert(Editor);
-  If assigned(BreakpointsCollection) then
-    BreakpointsCollection^.ShowBreakpoints(@Self);
-  UpdateTitle;
-end;
-
-procedure TSourceWindow.UpdateTitle;
-var Name: string;
-    Count: sw_integer;
-begin
-  if Editor^.FileName<>'' then
-  begin
-    Name:=SmartPath(Editor^.FileName);
-    Count:=Editor^.Core^.GetBindingCount;
-    if Count>1 then
-    begin
-      Name:=Name+':'+IntToStr(Editor^.Core^.GetBindingIndex(Editor)+1);
-    end;
-    SetTitle(Name);
-  end;
-end;
-
-function TSourceWindow.GetTitle(MaxSize: sw_Integer): TTitleStr;
-begin
-  GetTitle:=OptimizePath(inherited GetTitle(255),MaxSize);
-end;
-
-procedure TSourceWindow.SetTitle(ATitle: string);
-begin
-  if Title<>nil then DisposeStr(Title);
-  Title:=NewStr(ATitle);
-  Frame^.DrawView;
-end;
-
-procedure TSourceWindow.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-        cmUpdate :
-          Update;
-        cmUpdateTitle :
-          UpdateTitle;
-        cmSearchWindow :
-          if @Self<>ClipboardWindow then
-            ClearEvent(Event);
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmHide :
-            Hide;
-          cmSave :
-            if Editor^.IsClipboard=false then
-             if (Editor^.FileName='') and Editor^.GetModified then
-              Editor^.SaveAs
-             else
-              Editor^.Save;
-          cmSaveAs :
-            if Editor^.IsClipboard=false then
-              Editor^.SaveAs;
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure TSourceWindow.SetState(AState: Word; Enable: Boolean);
-var OldState: word;
-begin
-  OldState:=State;
-  inherited SetState(AState,Enable);
-  if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
-    UpdateCommands;
-end;
-
-procedure TSourceWindow.UpdateCommands;
-var Active: boolean;
-begin
-  Active:=GetState(sfActive);
-  if Editor^.IsClipboard=false then
-  begin
-    SetCmdState(SourceCmds+CompileCmds,Active);
-    SetCmdState(EditorCmds,Active);
-  end;
-  SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd,Active);
-  Message(Application,evBroadcast,cmCommandSetChanged,nil);
-end;
-
-procedure TSourceWindow.Update;
-begin
-  ReDraw;
-end;
-
-procedure   TSourceWindow.SelectInDebugSession;
-var
-  F,PrevCurrent : PView;
-begin
-  DeskTop^.Lock;
-  PrevCurrent:=Desktop^.Current;
-  F:=PrevCurrent;
-  While assigned(F) and
-    ((F^.HelpCtx = hcGDBWindow) or
-     (F^.HelpCtx = hcWatches) or {hcStack,}
-     (F^.HelpCtx = hcRegisters)) do
-    F:=F^.NextView;
-  if F<>@Self then
-    Select;
-  if PrevCurrent<>F then
-    Begin
-      Desktop^.InsertBefore(@self,F);
-      PrevCurrent^.Select;
-    End;
-  DeskTop^.Unlock;
-end;
-
-
-function TSourceWindow.GetPalette: PPalette;
-const P: string[length(CSourceWindow)] = CSourceWindow;
-begin
-  GetPalette:=@P;
-end;
-
-constructor TSourceWindow.Load(var S: TStream);
-begin
-  Title:=S.ReadStr;
-  PushStatus(FormatStrStr(msg_loadingfile,GetStr(Title)));
-  inherited Load(S);
-  GetSubViewPtr(S,Indicator);
-  GetSubViewPtr(S,Editor);
-  If assigned(BreakpointsCollection) then
-    BreakpointsCollection^.ShowBreakpoints(@Self);
-  PopStatus;
-end;
-
-procedure TSourceWindow.Store(var S: TStream);
-begin
-  S.WriteStr(Title);
-  PushStatus(FormatStrStr(msg_storingfile,GetStr(Title)));
-  inherited Store(S);
-
-  PutSubViewPtr(S,Indicator);
-  PutSubViewPtr(S,Editor);
-  PopStatus;
-end;
-
-procedure TSourceWindow.Close;
-begin
-  inherited Close;
-end;
-
-destructor TSourceWindow.Done;
-begin
-  PushStatus(FormatStrStr(msg_closingfile,GetStr(Title)));
-  if not IDEApp.IsClosing then
-    Message(Application,evBroadcast,cmSourceWndClosing,@Self);
-  inherited Done;
-  IDEApp.SourceWindowClosed;
-{  if not IDEApp.IsClosing then
-    Message(Application,evBroadcast,cmUpdate,@Self);}
-  PopStatus;
-end;
-
-function TGDBSourceEditor.Valid(Command: Word): Boolean;
-var OK: boolean;
-begin
-  OK:=TCodeEditor.Valid(Command);
-  { do NOT ask for save !!
-  if OK and ((Command=cmClose) or (Command=cmQuit)) then
-     if IsClipboard=false then
-    OK:=SaveAsk;  }
-  Valid:=OK;
-end;
-
-procedure  TGDBSourceEditor.AddLine(const S: string);
-begin
-   if Silent or (IgnoreStringAtEnd and (S=LastCommand)) then exit;
-   inherited AddLine(S);
-   LimitsChanged;
-end;
-
-procedure  TGDBSourceEditor.AddErrorLine(const S: string);
-begin
-   if Silent then exit;
-   inherited AddLine(S);
-   { display like breakpoints in red }
-   SetLineFlagState(GetLineCount-1,lfBreakpoint,true);
-   LimitsChanged;
-end;
-
-const
-  GDBReservedCount = 6;
-  GDBReservedLongest = 3;
-  GDBReserved : array[1..GDBReservedCount] of String[GDBReservedLongest] =
-  ('gdb','b','n','s','f','bt');
-
-function IsGDBReservedWord(const S : string) : boolean;
-var
-  i : longint;
-begin
-  for i:=1 to GDBReservedCount do
-    if (S=GDBReserved[i]) then
-      begin
-        IsGDBReservedWord:=true;
-        exit;
-      end;
-  IsGDBReservedWord:=false;
-end;
-
-function TGDBSourceEditor.IsReservedWord(const S: string): boolean;
-begin
-  IsReservedWord:=IsGDBReservedWord(S);
-end;
-
-function TGDBSourceEditor.InsertNewLine: Sw_integer;
-Var
-  S : string;
-  CommandCalled : boolean;
-
-begin
-  if IsReadOnly then begin InsertNewLine:=-1; Exit; end;
-  if CurPos.Y<GetLineCount then S:=GetDisplayText(CurPos.Y) else S:='';
-  s:=Copy(S,1,CurPos.X);
-  CommandCalled:=false;
-  if Pos(GDBPrompt,S)=1 then
-    Delete(S,1,length(GDBPrompt));
-  if assigned(Debugger) then
-    if S<>'' then
-      begin
-        LastCommand:=S;
-        { should be true only if we are at the end ! }
-        IgnoreStringAtEnd:=(CurPos.Y=GetLineCount-1) and
-          (CurPos.X>=length(RTrim(GetDisplayText(GetLineCount-1))));
-        Debugger^.Command(S);
-        CommandCalled:=true;
-        IgnoreStringAtEnd:=false;
-      end
-    else if AutoRepeat and (CurPos.Y=GetLineCount-1) then
-      begin
-        Debugger^.Command(LastCommand);
-        CommandCalled:=true;
-      end;
-  InsertNewLine:=inherited InsertNewLine;
-  If CommandCalled then
-    InsertText(GDBPrompt);
-end;
-
-
-constructor TGDBWindow.Init(var Bounds: TRect);
-var HSB,VSB: PScrollBar;
-    R: TRect;
-begin
-  inherited Init(Bounds,dialog_gdbwindow,0);
-  Options:=Options or ofTileAble;
-  AutoNumber:=true;
-  HelpCtx:=hcGDBWindow;
-  GetExtent(R); R.A.Y:=R.B.Y-1; R.Grow(-1,0); R.A.X:=14;
-  New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
-  GetExtent(R); R.A.X:=R.B.X-1; R.Grow(0,-1);
-  New(VSB, Init(R)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
-  GetExtent(R); R.A.X:=3; R.B.X:=14; R.A.Y:=R.B.Y-1;
-  New(Indicator, Init(R));
-  Indicator^.GrowMode:=gfGrowLoY+gfGrowHiY;
-  Insert(Indicator);
-  GetExtent(R); R.Grow(-1,-1);
-  New(Editor, Init(R, HSB, VSB, nil, GDBOutputFile));
-  Editor^.GrowMode:=gfGrowHiX+gfGrowHiY;
-  Editor^.SetFlags(efInsertMode+efSyntaxHighlight+efNoIndent+efExpandAllTabs);
-  if ExistsFile(GDBOutputFile) then
-    begin
-      if Editor^.LoadFile=false then
-        ErrorBox(FormatStrStr(msg_errorreadingfile,GDBOutputFile),nil);
-    end
-  else
-  { Empty files are buggy !! }
-    Editor^.AddLine('');
-  Insert(Editor);
-  if assigned(Debugger) then
-    Debugger^.Command('set width '+IntToStr(Size.X-1));
-  Editor^.silent:=false;
-  Editor^.AutoRepeat:=true;
-end;
-
-destructor TGDBWindow.Done;
-begin
-  if @Self=GDBWindow then
-    GDBWindow:=nil;
-  inherited Done;
-end;
-
-constructor TGDBWindow.Load(var S: TStream);
-begin
-  inherited Load(S);
-  GetSubViewPtr(S,Indicator);
-  GetSubViewPtr(S,Editor);
-end;
-
-procedure TGDBWindow.Store(var S: TStream);
-begin
-  inherited Store(S);
-  PutSubViewPtr(S,Indicator);
-  PutSubViewPtr(S,Editor);
-end;
-
-function TGDBWindow.GetPalette: PPalette;
-const P: string[length(CSourceWindow)] = CSourceWindow;
-begin
-  GetPalette:=@P;
-end;
-
-procedure TGDBWindow.WriteOutputText(Buf : pchar);
-begin
-  {selected normal color ?}
-  WriteText(Buf,false);
-end;
-
-procedure TGDBWindow.WriteErrorText(Buf : pchar);
-begin
-  {selected normal color ?}
-  WriteText(Buf,true);
-end;
-
-procedure TGDBWindow.WriteString(Const S : string);
-begin
-  Editor^.AddLine(S);
-end;
-
-procedure TGDBWindow.WriteErrorString(Const S : string);
-begin
-  Editor^.AddErrorLine(S);
-end;
-
-procedure TGDBWindow.WriteText(Buf : pchar;IsError : boolean);
-  var p,pe : pchar;
-      s : string;
-begin
-  p:=buf;
-  DeskTop^.Lock;
-  While assigned(p) and (p^<>#0) do
-    begin
-       pe:=strscan(p,#10);
-       if pe<>nil then
-         pe^:=#0;
-       s:=strpas(p);
-       If IsError then
-         Editor^.AddErrorLine(S)
-       else
-         Editor^.AddLine(S);
-       { restore for dispose }
-       if pe<>nil then
-         pe^:=#10;
-       if pe=nil then
-         p:=nil
-       else
-         begin
-           if pe-p > High(s) then
-             p:=p+High(s)-1
-           else
-             begin
-               p:=pe;
-               inc(p);
-             end;
-         end;
-    end;
-  DeskTop^.Unlock;
-  Editor^.Draw;
-end;
-
-procedure TGDBWindow.SetState(AState: Word; Enable: Boolean);
-var OldState: word;
-begin
-  OldState:=State;
-  inherited SetState(AState,Enable);
-  if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
-    UpdateCommands;
-end;
-
-procedure TGDBWindow.UpdateCommands;
-var Active: boolean;
-begin
-  Active:=GetState(sfActive);
-  SetCmdState([cmSaveAs,cmHide],Active);
-  SetCmdState(EditorCmds,Active);
-  SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd,Active);
-  Message(Application,evBroadcast,cmCommandSetChanged,nil);
-end;
-
-
-
-constructor TClipboardWindow.Init;
-var R: TRect;
-    HSB,VSB: PScrollBar;
-begin
-  Desktop^.GetExtent(R);
-  inherited Init(R, '');
-  SetTitle(dialog_clipboard);
-  HelpCtx:=hcClipboardWindow;
-  Number:=wnNoNumber;
-  AutoNumber:=true;
-
-  GetExtent(R); R.A.Y:=R.B.Y-1; R.Grow(-1,0); R.A.X:=14;
-  New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
-  GetExtent(R); R.A.X:=R.B.X-1; R.Grow(0,-1);
-  New(VSB, Init(R)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
-  GetExtent(R); R.A.X:=3; R.B.X:=14; R.A.Y:=R.B.Y-1;
-  New(Indicator, Init(R));
-  Indicator^.GrowMode:=gfGrowLoY+gfGrowHiY;
-  Insert(Indicator);
-  GetExtent(R); R.Grow(-1,-1);
-  New(Editor, Init(R, HSB, VSB, Indicator, ''));
-  Editor^.GrowMode:=gfGrowHiX+gfGrowHiY;
-  Insert(Editor);
-
-  Hide;
-
-  Clipboard:=Editor;
-end;
-
-procedure TClipboardWindow.Close;
-begin
-  Hide;
-end;
-
-constructor TClipboardWindow.Load(var S: TStream);
-begin
-  inherited Load(S);
-
-  Clipboard:=Editor;
-end;
-
-procedure TClipboardWindow.Store(var S: TStream);
-begin
-  inherited Store(S);
-end;
-
-destructor TClipboardWindow.Done;
-begin
-  inherited Done;
-  Clipboard:=nil;
-  ClipboardWindow:=nil;
-end;
-
-
-constructor TMessageListBox.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-begin
-  inherited Init(Bounds,1,AHScrollBar, AVScrollBar);
-  GrowMode:=gfGrowHiX+gfGrowHiY;
-  New(ModuleNames, Init(50,100));
-  NoSelection:=true;
-end;
-
-function TMessageListBox.GetLocalMenu: PMenu;
-var M: PMenu;
-begin
-  if (Owner<>nil) and (Owner^.GetState(sfModal)) then M:=nil else
-  M:=NewMenu(
-    NewItem(menu_msglocal_clear,'',kbNoKey,cmMsgClear,hcMsgClear,
-    NewLine(
-    NewItem(menu_msglocal_gotosource,'',kbNoKey,cmMsgGotoSource,hcMsgGotoSource,
-    NewItem(menu_msglocal_tracksource,'',kbNoKey,cmMsgTrackSource,hcMsgTrackSource,
-    nil)))));
-  GetLocalMenu:=M;
-end;
-
-procedure TMessageListBox.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-begin
-  case Event.What of
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbEnter :
-            Message(@Self,evCommand,cmMsgGotoSource,nil);
-        else
-          DontClear:=true;
-        end;
-        if not DontClear then
-          ClearEvent(Event);
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmListItemSelected :
-          if Event.InfoPtr=@Self then
-            Message(@Self,evCommand,cmMsgTrackSource,nil);
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmMsgGotoSource :
-            if Range>0 then
-              GotoSource;
-          cmMsgTrackSource :
-            if Range>0 then
-              TrackSource;
-          cmMsgClear :
-            Clear;
-          else
-            DontClear:=true;
-        end;
-        if not DontClear then
-          ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure TMessageListBox.AddItem(P: PMessageItem);
-var W : integer;
-begin
-  if List=nil then New(List, Init(500,500));
-  W:=length(P^.GetText(255));
-  if W>MaxWidth then
-  begin
-    MaxWidth:=W;
-    if HScrollBar<>nil then
-       HScrollBar^.SetRange(0,MaxWidth);
-  end;
-  List^.Insert(P);
-  SetRange(List^.Count);
-  if Focused=List^.Count-1-1 then
-     FocusItem(List^.Count-1);
-  DrawView;
-end;
-
-function TMessageListBox.AddModuleName(const Name: string): PString;
-var P: PString;
-begin
-  if ModuleNames<>nil then
-    P:=ModuleNames^.Add(Name)
-  else
-    P:=nil;
-  AddModuleName:=P;
-end;
-
-function TMessageListBox.GetText(Item,MaxLen: Sw_Integer): String;
-var P: PMessageItem;
-    S: string;
-begin
-  P:=List^.At(Item);
-  S:=P^.GetText(MaxLen);
-  GetText:=copy(S,1,MaxLen);
-end;
-
-procedure TMessageListBox.Clear;
-begin
-  if assigned(List) then
-    Dispose(List, Done);
-  List:=nil;
-  MaxWidth:=0;
-  if assigned(ModuleNames) then
-    ModuleNames^.FreeAll;
-  SetRange(0); DrawView;
-  Message(Application,evBroadcast,cmClearLineHighlights,@Self);
-end;
-
-procedure TMessageListBox.TrackSource;
-var W: PSourceWindow;
-    P: PMessageItem;
-    R: TRect;
-    Row,Col: sw_integer;
-begin
-  Message(Application,evBroadcast,cmClearLineHighlights,@Self);
-  if Range=0 then Exit;
-  P:=List^.At(Focused);
-  if P^.Row=0 then Exit;
-  Desktop^.Lock;
-  GetNextEditorBounds(R);
-{$ifdef OLDCOMP}
-  if Assigned(Owner) and (Owner=pointer(ProgramInfoWindow)) then
-{$endif}
-    R.B.Y:=Owner^.Origin.Y;
-  if P^.Row>0 then Row:=P^.Row-1 else Row:=0;
-  if P^.Col>0 then Col:=P^.Col-1 else Col:=0;
-  W:=EditorWindowFile(P^.GetModuleName);
-  if assigned(W) then
-    begin
-      W^.GetExtent(R);
-{$ifdef OLDCOMP}
-      if Assigned(Owner) and (Owner=pointer(ProgramInfoWindow)) then
-{$endif}
-        R.B.Y:=Owner^.Origin.Y;
-      W^.ChangeBounds(R);
-      W^.Editor^.SetCurPtr(Col,Row);
-    end
-  else
-    W:=TryToOpenFile(@R,P^.GetModuleName,Col,Row,true);
-  if W<>nil then
-    begin
-      W^.Select;
-      W^.Editor^.TrackCursor(true);
-      W^.Editor^.SetLineFlagExclusive(lfHighlightRow,Row);
-    end;
-  if Assigned(Owner) then
-    Owner^.Select;
-  Desktop^.UnLock;
-end;
-
-procedure TMessageListBox.GotoSource;
-var W: PSourceWindow;
-    P: PMessageItem;
-    R:TRect;
-    Row,Col: sw_integer;
-begin
-  Message(Application,evBroadcast,cmClearLineHighlights,@Self);
-  if Range=0 then Exit;
-  P:=List^.At(Focused);
-  if P^.Row=0 then Exit;
-  Desktop^.Lock;
-  if P^.Row>0 then Row:=P^.Row-1 else Row:=0;
-  if P^.Col>0 then Col:=P^.Col-1 else Col:=0;
-  W:=TryToOpenFile(nil,P^.GetModuleName,Col,Row,true);
-  if assigned(W) then
-    begin
-      { Message(Owner,evCommand,cmClose,nil);
-        This calls close on StackWindow
-        rendering P invalid
-        so postpone it PM }
-      W^.GetExtent(R);
-      if (P^.TClass<>0) then
-        W^.Editor^.SetErrorMessage(P^.GetText(R.B.X-R.A.X));
-      W^.Select;
-      Message(Owner,evCommand,cmClose,nil);
-    end;
-  Desktop^.UnLock;
-end;
-
-procedure TMessageListBox.Draw;
-var
-  I, J, Item: Sw_Integer;
-  NormalColor, SelectedColor, FocusedColor, Color: Word;
-  ColWidth, CurCol, Indent: Integer;
-  B: TDrawBuffer;
-  Text: String;
-  SCOff: Byte;
-  TC: byte;
-procedure MT(var C: word); begin if TC<>0 then C:=(C and $ff0f) or (TC and $f0); end;
-begin
-  if (Owner<>nil) then TC:=ord(Owner^.GetColor(6)) else TC:=0;
-  if State and (sfSelected + sfActive) = (sfSelected + sfActive) then
-  begin
-    NormalColor := GetColor(1);
-    FocusedColor := GetColor(3);
-    SelectedColor := GetColor(4);
-  end else
-  begin
-    NormalColor := GetColor(2);
-    SelectedColor := GetColor(4);
-  end;
-  if Transparent then
-    begin MT(NormalColor); MT(SelectedColor); end;
-  if NoSelection then
-     SelectedColor:=NormalColor;
-  if HScrollBar <> nil then Indent := HScrollBar^.Value
-  else Indent := 0;
-  ColWidth := Size.X div NumCols + 1;
-  for I := 0 to Size.Y - 1 do
-  begin
-    for J := 0 to NumCols-1 do
-    begin
-      Item := J*Size.Y + I + TopItem;
-      CurCol := J*ColWidth;
-      if (State and (sfSelected + sfActive) = (sfSelected + sfActive)) and
-        (Focused = Item) and (Range > 0) then
-      begin
-        Color := FocusedColor;
-        SetCursor(CurCol+1,I);
-        SCOff := 0;
-      end
-      else if (Item < Range) and IsSelected(Item) then
-      begin
-        Color := SelectedColor;
-        SCOff := 2;
-      end
-      else
-      begin
-        Color := NormalColor;
-        SCOff := 4;
-      end;
-      MoveChar(B[CurCol], ' ', Color, ColWidth);
-      if Item < Range then
-      begin
-        Text := GetText(Item, ColWidth + Indent);
-        Text := Copy(Text,Indent,ColWidth);
-        MoveStr(B[CurCol+1], Text, Color);
-        if ShowMarkers then
-        begin
-          WordRec(B[CurCol]).Lo := Byte(SpecialChars[SCOff]);
-          WordRec(B[CurCol+ColWidth-2]).Lo := Byte(SpecialChars[SCOff+1]);
-        end;
-      end;
-      MoveChar(B[CurCol+ColWidth-1], #179, GetColor(5), 1);
-    end;
-    WriteLine(0, I, Size.X, 1, B);
-  end;
-end;
-
-constructor TMessageListBox.Load(var S: TStream);
-begin
-  inherited Load(S);
-  New(ModuleNames, Init(50,100));
-  NoSelection:=true;
-end;
-
-procedure TMessageListBox.Store(var S: TStream);
-var OL: PCollection;
-    ORV: sw_integer;
-begin
-  OL:=List; ORV:=Range;
-
-  New(List, Init(1,1)); Range:=0;
-
-  inherited Store(S);
-
-  Dispose(List, Done);
-  List:=OL; Range:=ORV;
-  { ^^^ nasty trick - has anyone a better idea how to avoid storing the
-    collection? Pasting here a modified version of TListBox.Store+
-    TAdvancedListBox.Store isn't a better solution, since by eventually
-    changing the obj-hierarchy you'll always have to modify this, too - BG }
-end;
-
-destructor TMessageListBox.Done;
-begin
-  inherited Done;
-  if List<>nil then Dispose(List, Done);
-  if ModuleNames<>nil then Dispose(ModuleNames, Done);
-end;
-
-constructor TMessageItem.Init(AClass: longint; const AText: string; AModule: PString; ARow, ACol: sw_integer);
-begin
-  inherited Init;
-  TClass:=AClass;
-  Text:=NewStr(AText);
-  Module:=AModule;
-  Row:=ARow; Col:=ACol;
-end;
-
-function TMessageItem.GetText(MaxLen: Sw_integer): string;
-var S: string;
-begin
-  if Text=nil then S:='' else S:=Text^;
-  if (Module<>nil) then
-     S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+S;
-  if length(S)>MaxLen then S:=copy(S,1,MaxLen-2)+'..';
-  GetText:=S;
-end;
-
-procedure TMessageItem.Selected;
-begin
-end;
-
-function TMessageItem.GetModuleName: string;
-begin
-  GetModuleName:=GetStr(Module);
-end;
-
-destructor TMessageItem.Done;
-begin
-  inherited Done;
-  if Text<>nil then DisposeStr(Text);
-{  if Module<>nil then DisposeStr(Module);}
-end;
-
-{$ifdef OLDCOMP}
-
-function TCompilerMessage.GetText(MaxLen: Integer): String;
-var ClassS: string[20];
-    S: string;
-begin
-  if TClass=
-    V_Fatal       then ClassS:='Fatal'       else if TClass =
-    V_Error       then ClassS:='Error'       else if TClass =
-    V_Normal      then ClassS:=''            else if TClass =
-    V_Warning     then ClassS:='Warning'     else if TClass =
-    V_Note        then ClassS:='Note'        else if TClass =
-    V_Hint        then ClassS:='Hint'        else if TClass =
-    V_Macro       then ClassS:='Macro'       else if TClass =
-    V_Procedure   then ClassS:='Procedure'   else if TClass =
-    V_Conditional then ClassS:='Conditional' else if TClass =
-    V_Info        then ClassS:='Info'        else if TClass =
-    V_Status      then ClassS:='Status'      else if TClass =
-    V_Used        then ClassS:='Used'        else if TClass =
-    V_Tried       then ClassS:='Tried'       else if TClass =
-    V_Debug       then ClassS:='Debug'
-  else
-   ClassS:='???';
-  if ClassS<>'' then
-   ClassS:=RExpand(ClassS,0)+': ';
-  S:=ClassS;
-  if (Module<>nil) {and (ID<>0)} then
-     S:=S+NameAndExtOf(Module^)+'('+IntToStr(Row)+') ';
-  if Text<>nil then S:=S+Text^;
-  if length(S)>MaxLen then S:=copy(S,1,MaxLen-2)+'..';
-  GetText:=S;
-end;
-
-{$endif}
-
-
-constructor TProgramInfoWindow.Init;
-var R,R2: TRect;
-    HSB,VSB: PScrollBar;
-    ST: PStaticText;
-    C: word;
-const White = 15;
-begin
-  Desktop^.GetExtent(R); R.A.Y:=R.B.Y-13;
-  inherited Init(R, dialog_programinformation, wnNoNumber);
-
-  HelpCtx:=hcInfoWindow;
-
-  GetExtent(R); R.Grow(-1,-1); R.B.Y:=R.A.Y+3;
-  C:=((Desktop^.GetColor(32+6) and $f0) or White)*256+Desktop^.GetColor(32+6);
-  New(InfoST, Init(R,'', C, false)); InfoST^.GrowMode:=gfGrowHiX;
-  Insert(InfoST);
-  GetExtent(R); R.Grow(-1,-1); Inc(R.A.Y,3); R.B.Y:=R.A.Y+1;
-  New(ST, Init(R, CharStr('Ä', MaxViewWidth))); ST^.GrowMode:=gfGrowHiX; Insert(ST);
-  GetExtent(R); R.Grow(-1,-1); Inc(R.A.Y,4);
-  R2.Copy(R); Inc(R2.B.Y); R2.A.Y:=R2.B.Y-1;
-  New(HSB, Init(R2)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiY+gfGrowHiX; Insert(HSB);
-  R2.Copy(R); Inc(R2.B.X); R2.A.X:=R2.B.X-1;
-  New(VSB, Init(R2)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
-  New(LogLB, Init(R,HSB,VSB));
-  LogLB^.GrowMode:=gfGrowHiX+gfGrowHiY;
-  LogLB^.Transparent:=true;
-  Insert(LogLB);
-  Update;
-end;
-
-constructor TProgramInfoWindow.Load(var S : TStream);
-begin
-  inherited Load(S);
-  GetSubViewPtr(S,InfoST);
-  GetSubViewPtr(S,LogLB);
-end;
-
-procedure TProgramInfoWindow.Store(var S : TStream);
-begin
-  inherited Store(S);
-  PutSubViewPtr(S,InfoST);
-  PutSubViewPtr(S,LogLB);
-end;
-
-procedure TProgramInfoWindow.AddMessage(AClass: longint; Msg, Module: string; Line, Column: longint);
-begin
-  if AClass>=V_Info then Line:=0;
-  LogLB^.AddItem(New(PCompilerMessage, Init(AClass, Msg, LogLB^.AddModuleName(Module), Line, Column)));
-end;
-
-procedure TProgramInfoWindow.ClearMessages;
-begin
-  LogLB^.Clear;
-  ReDraw;
-end;
-
-procedure TProgramInfoWindow.SizeLimits(var Min, Max: TPoint);
-begin
-  inherited SizeLimits(Min,Max);
-  Min.X:=30; Min.Y:=9;
-end;
-
-procedure TProgramInfoWindow.Close;
-begin
-  Hide;
-end;
-
-procedure TProgramInfoWindow.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-        cmUpdate :
-          Update;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure TProgramInfoWindow.Update;
-begin
-  ClearFormatParams;
-  AddFormatParamStr(label_proginfo_currentmodule);
-  AddFormatParamStr(MainFile);
-  AddFormatParamStr(label_proginfo_lastexitcode);
-  AddFormatParamInt(LastExitCode);
-  AddFormatParamStr(label_proginfo_availablememory);
-  AddFormatParamInt(MemAvail div 1024);
-  InfoST^.SetText(
-   FormatStrF(
-    {#13+ }
-    '%24s : %s'#13+
-    '%24s : %d'#13+
-    '%24s : %5d'+'K'+#13+
-    '',
-   FormatParams)
-  );
-end;
-
-destructor TProgramInfoWindow.Done;
-begin
-  inherited Done;
-  ProgramInfoWindow:=nil;
-end;
-
-constructor TTab.Init(var Bounds: TRect; ATabDef: PTabDef);
-begin
-  inherited Init(Bounds);
-  Options:=Options or ofSelectable or ofFirstClick or ofPreProcess or ofPostProcess;
-  GrowMode:=gfGrowHiX+gfGrowHiY+gfGrowRel;
-  TabDefs:=ATabDef;
-  ActiveDef:=-1;
-  SelectTab(0);
-  ReDraw;
-end;
-
-function TTab.TabCount: integer;
-var i: integer;
-    P: PTabDef;
-begin
-  I:=0; P:=TabDefs;
-  while (P<>nil) do
-    begin
-      Inc(I);
-      P:=P^.Next;
-    end;
-  TabCount:=I;
-end;
-
-function TTab.AtTab(Index: integer): PTabDef;
-var i: integer;
-    P: PTabDef;
-begin
-  i:=0; P:=TabDefs;
-  while (I<Index) do
-    begin
-      if P=nil then RunError($AA);
-      P:=P^.Next;
-      Inc(i);
-    end;
-  AtTab:=P;
-end;
-
-procedure TTab.SelectTab(Index: integer);
-var P: PTabItem;
-    V: PView;
-begin
-  if ActiveDef<>Index then
-  begin
-    if Owner<>nil then Owner^.Lock;
-    Lock;
-    { --- Update --- }
-    if TabDefs<>nil then
-       begin
-         DefCount:=1;
-         while AtTab(DefCount-1)^.Next<>nil do Inc(DefCount);
-       end
-       else DefCount:=0;
-    if ActiveDef<>-1 then
-    begin
-      P:=AtTab(ActiveDef)^.Items;
-      while P<>nil do
-        begin
-          if P^.View<>nil then Delete(P^.View);
-          P:=P^.Next;
-        end;
-    end;
-    ActiveDef:=Index;
-    P:=AtTab(ActiveDef)^.Items;
-    while P<>nil do
-      begin
-        if P^.View<>nil then Insert(P^.View);
-        P:=P^.Next;
-      end;
-    V:=AtTab(ActiveDef)^.DefItem;
-    if V<>nil then V^.Select;
-    ReDraw;
-    { --- Update --- }
-    UnLock;
-    if Owner<>nil then Owner^.UnLock;
-    DrawView;
-  end;
-end;
-
-procedure TTab.ChangeBounds(var Bounds: TRect);
-var D: TPoint;
-procedure DoCalcChange(P: PView); {$ifndef FPC}far;{$endif}
-var
-  R: TRect;
-begin
-  if P^.Owner=nil then Exit; { it think this is a bug in TV }
-  P^.CalcBounds(R, D);
-  P^.ChangeBounds(R);
-end;
-var
-    P: PTabItem;
-    I: integer;
-begin
-  D.X := Bounds.B.X - Bounds.A.X - Size.X;
-  D.Y := Bounds.B.Y - Bounds.A.Y - Size.Y;
-  inherited ChangeBounds(Bounds);
-  for I:=0 to TabCount-1 do
-  if I<>ActiveDef then
-    begin
-      P:=AtTab(I)^.Items;
-      while P<>nil do
-        begin
-          if P^.View<>nil then DoCalcChange(P^.View);
-          P:=P^.Next;
-        end;
-    end;
-end;
-
-procedure TTab.SelectNextTab(Forwards: boolean);
-var Index: integer;
-begin
-  Index:=ActiveDef;
-  if Index=-1 then Exit;
-  if Forwards then Inc(Index) else Dec(Index);
-  if Index<0 then Index:=DefCount-1 else
-  if Index>DefCount-1 then Index:=0;
-  SelectTab(Index);
-end;
-
-procedure TTab.HandleEvent(var Event: TEvent);
-var Index : integer;
-    I     : integer;
-    X     : integer;
-    Len   : byte;
-    P     : TPoint;
-    V     : PView;
-    CallOrig: boolean;
-    LastV : PView;
-    FirstV: PView;
-function FirstSelectable: PView;
-var
-    FV : PView;
-begin
-  FV := First;
-  while (FV<>nil) and ((FV^.Options and ofSelectable)=0) and (FV<>Last) do
-        FV:=FV^.Next;
-  if FV<>nil then
-    if (FV^.Options and ofSelectable)=0 then FV:=nil;
-  FirstSelectable:=FV;
-end;
-function LastSelectable: PView;
-var
-    LV : PView;
-begin
-  LV := Last;
-  while (LV<>nil) and ((LV^.Options and ofSelectable)=0) and (LV<>First) do
-        LV:=LV^.Prev;
-  if LV<>nil then
-    if (LV^.Options and ofSelectable)=0 then LV:=nil;
-  LastSelectable:=LV;
-end;
-begin
-  if (Event.What and evMouseDown)<>0 then
-     begin
-       MakeLocal(Event.Where,P);
-       if P.Y<3 then
-          begin
-            Index:=-1; X:=1;
-            for i:=0 to DefCount-1 do
-                begin
-                  Len:=CStrLen(AtTab(i)^.Name^);
-                  if (P.X>=X) and (P.X<=X+Len+1) then Index:=i;
-                  X:=X+Len+3;
-                end;
-            if Index<>-1 then
-               SelectTab(Index);
-          end;
-     end;
-  if Event.What=evKeyDown then
-     begin
-       Index:=-1;
-       case Event.KeyCode of
-            kbCtrlTab :
-              begin
-                SelectNextTab((Event.KeyShift and kbShift)=0);
-                ClearEvent(Event);
-              end;
-            kbTab,kbShiftTab  :
-              if GetState(sfSelected) then
-                 begin
-                   if Current<>nil then
-                   begin
-                   LastV:=LastSelectable; FirstV:=FirstSelectable;
-                   if ((Current=LastV) or (Current=PLabel(LastV)^.Link)) and (Event.KeyCode=kbShiftTab) then
-                      begin
-                        if Owner<>nil then Owner^.SelectNext(true);
-                      end else
-                   if ((Current=FirstV) or (Current=PLabel(FirstV)^.Link)) and (Event.KeyCode=kbTab) then
-                      begin
-                        Lock;
-                        if Owner<>nil then Owner^.SelectNext(false);
-                        UnLock;
-                      end else
-                   SelectNext(Event.KeyCode=kbShiftTab);
-                   ClearEvent(Event);
-                   end;
-                 end;
-       else
-       for I:=0 to DefCount-1 do
-           begin
-             if Upcase(GetAltChar(Event.KeyCode))=AtTab(I)^.ShortCut
-                then begin
-                       Index:=I;
-                       ClearEvent(Event);
-                       Break;
-                     end;
-           end;
-       end;
-       if Index<>-1 then
-          begin
-            Select;
-            SelectTab(Index);
-            V:=AtTab(ActiveDef)^.DefItem;
-            if V<>nil then V^.Focus;
-          end;
-     end;
-  CallOrig:=true;
-  if Event.What=evKeyDown then
-     begin
-     if ((Owner<>nil) and (Owner^.Phase=phPostProcess) and (GetAltChar(Event.KeyCode)<>#0)) or GetState(sfFocused)
-        then
-        else CallOrig:=false;
-     end;
-  if CallOrig then inherited HandleEvent(Event);
-end;
-
-function TTab.GetPalette: PPalette;
-begin
-  GetPalette:=nil;
-end;
-
-procedure TTab.Draw;
-var B     : TDrawBuffer;
-    i     : integer;
-    C1,C2,C3,C : word;
-    HeaderLen  : integer;
-    X,X2       : integer;
-    Name       : PString;
-    ActiveKPos : integer;
-    ActiveVPos : integer;
-    FC   : char;
-    ClipR      : TRect;
-procedure SWriteBuf(X,Y,W,H: integer; var Buf);
-var i: integer;
-begin
-  if Y+H>Size.Y then H:=Size.Y-Y;
-  if X+W>Size.X then W:=Size.X-X;
-  if Buffer=nil then WriteBuf(X,Y,W,H,Buf)
-                else for i:=1 to H do
-                         Move(Buf,Buffer^[X+(Y+i-1)*Size.X],W*2);
-end;
-procedure ClearBuf;
-begin
-  MoveChar(B,' ',C1,Size.X);
-end;
-begin
-  if InDraw then Exit;
-  InDraw:=true;
-  { - Start of TGroup.Draw - }
-  if Buffer = nil then
-  begin
-    GetBuffer;
-  end;
-  { - Start of TGroup.Draw - }
-
-  C1:=GetColor(1); C2:=(GetColor(7) and $f0 or $08)+GetColor(9)*256; C3:=GetColor(8)+GetColor({9}8)*256;
-  HeaderLen:=0; for i:=0 to DefCount-1 do HeaderLen:=HeaderLen+CStrLen(AtTab(i)^.Name^)+3; Dec(HeaderLen);
-  if HeaderLen>Size.X-2 then HeaderLen:=Size.X-2;
-
-  { --- 1. sor --- }
-  ClearBuf; MoveChar(B[0],'³',C1,1); MoveChar(B[HeaderLen+1],'³',C1,1);
-  X:=1;
-  for i:=0 to DefCount-1 do
-      begin
-        Name:=AtTab(i)^.Name; X2:=CStrLen(Name^);
-        if i=ActiveDef
-           then begin
-                  ActiveKPos:=X-1;
-                  ActiveVPos:=X+X2+2;
-                  if GetState(sfFocused) then C:=C3 else C:=C2;
-                end
-           else C:=C2;
-        MoveCStr(B[X],' '+Name^+' ',C); X:=X+X2+3;
-        MoveChar(B[X-1],'³',C1,1);
-      end;
-  SWriteBuf(0,1,Size.X,1,B);
-
-  { --- 0. sor --- }
-  ClearBuf; MoveChar(B[0],'Ú',C1,1);
-  X:=1;
-  for i:=0 to DefCount-1 do
-      begin
-        if I<ActiveDef then FC:='Ú'
-                       else FC:='¿';
-        X2:=CStrLen(AtTab(i)^.Name^)+2;
-        MoveChar(B[X+X2],{'Â'}FC,C1,1);
-        if i=DefCount-1 then X2:=X2+1;
-        if X2>0 then
-        MoveChar(B[X],'Ä',C1,X2);
-        X:=X+X2+1;
-      end;
-  MoveChar(B[HeaderLen+1],'¿',C1,1);
-  MoveChar(B[ActiveKPos],'Ú',C1,1); MoveChar(B[ActiveVPos],'¿',C1,1);
-  SWriteBuf(0,0,Size.X,1,B);
-
-  { --- 2. sor --- }
-  MoveChar(B[1],'Ä',C1,Max(HeaderLen,0)); MoveChar(B[HeaderLen+2],'Ä',C1,Max(Size.X-HeaderLen-3,0));
-  MoveChar(B[Size.X-1],'¿',C1,1);
-  MoveChar(B[ActiveKPos],'Ù',C1,1);
-  if ActiveDef=0 then MoveChar(B[0],'³',C1,1)
-                 else MoveChar(B[0],{'Ã'}'Ú',C1,1);
-  MoveChar(B[HeaderLen+1],'Ä'{'Á'},C1,1); MoveChar(B[ActiveVPos],'À',C1,1);
-  MoveChar(B[ActiveKPos+1],' ',C1,Max(ActiveVPos-ActiveKPos-1,0));
-  SWriteBuf(0,2,Size.X,1,B);
-
-  { --- marad‚k sor --- }
-  ClearBuf; MoveChar(B[0],'³',C1,1); MoveChar(B[Size.X-1],'³',C1,1);
-  SWriteBuf(0,3,Size.X,Size.Y-4,B);
-
-  { --- Size.X . sor --- }
-  MoveChar(B[0],'À',C1,1); MoveChar(B[1],'Ä',C1,Max(Size.X-2,0)); MoveChar(B[Size.X-1],'Ù',C1,1);
-  SWriteBuf(0,Size.Y-1,Size.X,1,B);
-
-  { - End of TGroup.Draw - }
-  if Buffer <> nil then
-  begin
-    Lock;
-    Redraw;
-    UnLock;
-  end;
-  if Buffer <> nil then WriteBuf(0, 0, Size.X, Size.Y, Buffer^) else
-  begin
-    GetClipRect(ClipR);
-    Redraw;
-    GetExtent(ClipR);
-  end;
-  { - End of TGroup.Draw - }
-  InDraw:=false;
-end;
-
-function TTab.Valid(Command: Word): Boolean;
-var PT : PTabDef;
-    PI : PTabItem;
-    OK : boolean;
-begin
-  OK:=true;
-  PT:=TabDefs;
-  while (PT<>nil) and (OK=true) do
-        begin
-          PI:=PT^.Items;
-          while (PI<>nil) and (OK=true) do
-                begin
-                  if PI^.View<>nil then OK:=OK and PI^.View^.Valid(Command);
-                  PI:=PI^.Next;
-                end;
-          PT:=PT^.Next;
-        end;
-  Valid:=OK;
-end;
-
-procedure TTab.SetState(AState: Word; Enable: Boolean);
-begin
-  inherited SetState(AState,Enable);
-  if (AState and sfFocused)<>0 then DrawView;
-end;
-
-destructor TTab.Done;
-var P,X: PTabDef;
-procedure DeleteViews(P: PView); {$ifndef FPC}far;{$endif}
-begin
-  if P<>nil then Delete(P);
-end;
-begin
-  ForEach(@DeleteViews);
-  inherited Done;
-  P:=TabDefs;
-  while P<>nil do
-        begin
-          X:=P^.Next;
-          DisposeTabDef(P);
-          P:=X;
-        end;
-end;
-
-constructor TScreenView.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar;
-              AScreen: PScreen);
-begin
-  inherited Init(Bounds,AHScrollBar,AVScrollBar);
-  Screen:=AScreen;
-  if Screen=nil then
-   Fail;
-  SetState(sfCursorVis,true);
-  Update;
-end;
-
-procedure TScreenView.Update;
-begin
-  SetLimit(UserScreen^.GetWidth,UserScreen^.GetHeight);
-  DrawView;
-end;
-
-procedure TScreenView.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-        cmUpdate  : Update;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure TScreenView.Draw;
-var B: TDrawBuffer;
-    X,Y: integer;
-    Text,Attr: string;
-    P: TPoint;
-begin
-  Screen^.GetCursorPos(P);
-  for Y:=Delta.Y to Delta.Y+Size.Y-1 do
-  begin
-    if Y<Screen^.GetHeight then
-      Screen^.GetLine(Y,Text,Attr)
-    else
-       begin Text:=''; Attr:=''; end;
-    Text:=copy(Text,Delta.X+1,255); Attr:=copy(Attr,Delta.X+1,255);
-    MoveChar(B,' ',0,Size.X);
-    for X:=1 to length(Text) do
-      MoveChar(B[X-1],Text[X],ord(Attr[X]),1);
-    WriteLine(0,Y-Delta.Y,Size.X,1,B);
-  end;
-  SetCursor(P.X-Delta.X,P.Y-Delta.Y);
-end;
-
-constructor TScreenWindow.Init(AScreen: PScreen; ANumber: integer);
-var R: TRect;
-    VSB,HSB: PScrollBar;
-begin
-  Desktop^.GetExtent(R);
-  inherited Init(R, dialog_userscreen, ANumber);
-  Options:=Options or ofTileAble;
-  GetExtent(R); R.Grow(-1,-1); R.Move(1,0); R.A.X:=R.B.X-1;
-  New(VSB, Init(R)); VSB^.Options:=VSB^.Options or ofPostProcess;
-  VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
-  GetExtent(R); R.Grow(-1,-1); R.Move(0,1); R.A.Y:=R.B.Y-1;
-  New(HSB, Init(R)); HSB^.Options:=HSB^.Options or ofPostProcess;
-  HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
-  GetExtent(R); R.Grow(-1,-1);
-  New(ScreenView, Init(R, HSB, VSB, AScreen));
-  ScreenView^.GrowMode:=gfGrowHiX+gfGrowHiY;
-  Insert(ScreenView);
-  UserScreenWindow:=@Self;
-end;
-
-destructor TScreenWindow.Done;
-begin
-  inherited Done;
-  UserScreenWindow:=nil;
-end;
-
-const InTranslate : boolean = false;
-
-procedure TranslateMouseClick(View: PView; var Event: TEvent);
-procedure TranslateAction(Action: integer);
-var E: TEvent;
-begin
-  if Action<>acNone then
-  begin
-    E:=Event;
-    E.What:=evMouseDown; E.Buttons:=mbLeftButton;
-    View^.HandleEvent(E);
-    Event.What:=evCommand;
-    Event.Command:=ActionCommands[Action];
-  end;
-end;
-begin
-  if InTranslate then Exit;
-  InTranslate:=true;
-  case Event.What of
-    evMouseDown :
-      if (GetShiftState and kbAlt)<>0 then
-        TranslateAction(AltMouseAction) else
-      if (GetShiftState and kbCtrl)<>0 then
-        TranslateAction(CtrlMouseAction);
-  end;
-  InTranslate:=false;
-end;
-
-function GetNextEditorBounds(var Bounds: TRect): boolean;
-var P: PView;
-begin
-  P:=Desktop^.Current;
-  while P<>nil do
-  begin
-    if P^.HelpCtx=hcSourceWindow then Break;
-    P:=P^.NextView;
-    if P=Desktop^.Current then
-      begin
-        P:=nil;
-        break;
-      end;
-  end;
-  if P=nil then Desktop^.GetExtent(Bounds) else
-     begin
-       P^.GetBounds(Bounds);
-       Inc(Bounds.A.X); Inc(Bounds.A.Y);
-     end;
-  GetNextEditorBounds:=P<>nil;
-end;
-
-function IOpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer; ShowIt: boolean): PSourceWindow;
-var R: TRect;
-    W: PSourceWindow;
-begin
-  if Assigned(Bounds) then R.Copy(Bounds^) else
-    GetNextEditorBounds(R);
-  PushStatus(FormatStrStr(msg_openingsourcefile,SmartPath(FileName)));
-  New(W, Init(R, FileName));
-  if ShowIt=false then
-    W^.Hide;
-  if W<>nil then
-  begin
-    if (CurX<>0) or (CurY<>0) then
-       with W^.Editor^ do
-       begin
-         SetCurPtr(CurX,CurY);
-         TrackCursor(true);
-       end;
-    W^.HelpCtx:=hcSourceWindow;
-    Desktop^.Insert(W);
-    Message(Application,evBroadcast,cmUpdate,nil);
-  end;
-  PopStatus;
-  IOpenEditorWindow:=W;
-end;
-
-function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
-begin
-  OpenEditorWindow:=IOpenEditorWindow(Bounds,FileName,CurX,CurY,true);
-end;
-
-function SearchOnDesktop(FileName : string;tryexts:boolean) : PSourceWindow;
-var
-    D,DS : DirStr;
-    N,NS : NameStr;
-    E,ES : ExtStr;
-    SName : string;
-
-function IsSearchedFile(W : PSourceWindow) : boolean;
-  var Found: boolean;
-  begin
-    Found:=false;
-    if (W<>nil) and (W^.HelpCtx=hcSourceWindow) then
-      begin
-        if (D='') then
-          SName:=NameAndExtOf(PSourceWindow(W)^.Editor^.FileName)
-        else
-          SName:=PSourceWindow(W)^.Editor^.FileName;
-        FSplit(SName,DS,NS,ES);
-        SName:=UpcaseStr(NS+ES);
-
-        if (E<>'') or (not tryexts) then
-          begin
-            if D<>'' then
-              Found:=UpCaseStr(DS)+SName=UpcaseStr(D+N+E)
-            else
-              Found:=SName=UpcaseStr(N+E);
-          end
-        else
-          begin
-            Found:=SName=UpcaseStr(N+'.pp');
-            if Found=false then
-              Found:=SName=UpcaseStr(N+'.pas');
-          end;
-      end;
-    IsSearchedFile:=found;
-  end;
-function IsSearchedSource(P: PView) : boolean; {$ifndef FPC}far;{$endif}
-begin
-  if assigned(P) and
-     (TypeOf(P^)=TypeOf(TSourceWindow)) then
-       IsSearchedSource:=IsSearchedFile(PSourceWindow(P))
-     else
-       IsSearchedSource:=false;
-end;
-
-begin
-  FSplit(FileName,D,N,E);
-  SearchOnDesktop:=PSourceWindow(Desktop^.FirstThat(@IsSearchedSource));
-end;
-
-function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean): PSourceWindow;
-begin
-  TryToOpenFile:=ITryToOpenFile(Bounds,FileName,CurX,CurY,tryexts,true,false);
-end;
-
-function LocateSingleSourceFile(const FileName: string; tryexts: boolean): string;
-var D : DirStr;
-    N : NameStr;
-    E : ExtStr;
-
-  function CheckDir(NewDir: DirStr; NewName: NameStr; NewExt: ExtStr): boolean;
-  var OK: boolean;
-  begin
-    NewDir:=CompleteDir(NewDir);
-    OK:=ExistsFile(NewDir+NewName+NewExt);
-    if OK then begin D:=NewDir; N:=NewName; E:=NewExt; end;
-    CheckDir:=OK;
-  end;
-
-  function CheckExt(NewExt: ExtStr): boolean;
-  var OK: boolean;
-  begin
-    OK:=false;
-    if D<>'' then OK:=CheckDir(D,N,NewExt) else
-      if CheckDir('.'+DirSep,N,NewExt) then OK:=true;
-    CheckExt:=OK;
-  end;
-
-  function TryToLocateIn(const DD : dirstr): boolean;
-  var Found: boolean;
-  begin
-    D:=CompleteDir(DD);
-    Found:=true;
-    if (E<>'') or (not tryexts) then
-     Found:=CheckExt(E)
-    else
-     if CheckExt('.pp') then
-      Found:=true
-    else
-     if CheckExt('.pas') then
-      Found:=true
-    else
-     if CheckExt('.inc') then
-      Found:=true
-    { try also without extension if no other exist }
-    else
-     if CheckExt('') then
-      Found:=true
-    else
-      Found:=false;
-    TryToLocateIn:=Found;
-  end;
-var Path,DrStr: string;
-    Found: boolean;
-begin
-  FSplit(FileName,D,N,E);
-  Found:=CheckDir(D,N,E);
-  if not found then
-    Found:=TryToLocateIn('.');
-  DrStr:=GetSourceDirectories;
-  if not Found then
-   While pos(ListSeparator,DrStr)>0 do
-    Begin
-      Found:=TryToLocateIn(Copy(DrStr,1,pos(ListSeparator,DrStr)-1));
-      if Found then
-        break;
-      DrStr:=Copy(DrStr,pos(ListSeparator,DrStr)+1,High(DrStr));
-    End;
-  if Found then Path:=FExpand(D+N+E) else Path:='';
-  LocateSingleSourceFile:=Path;
-end;
-
-function LocateSourceFile(const FileName: string; tryexts: boolean): string;
-var P: integer;
-    FN,S: string;
-    FFN: string;
-begin
-  FN:=FileName;
-  repeat
-    P:=Pos(ListSeparator,FN); if P=0 then P:=length(FN)+1;
-    S:=copy(FN,1,P-1); Delete(FN,1,P);
-    FFN:=LocateSingleSourceFile(S,tryexts);
-  until (FFN<>'') or (FN='');
-  LocateSourceFile:=FFN;
-end;
-
-function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean;
-         ShowIt,ForceNewWindow: boolean): PSourceWindow;
-var
-  W : PSourceWindow;
-  DrStr: string;
-begin
-  W:=nil;
-  if ForceNewWindow then
-    W:=nil
-  else
-    W:=SearchOnDesktop(FileName,tryexts);
-  if W<>nil then
-    begin
-      NewEditorOpened:=false;
-{      if assigned(Bounds) then
-        W^.ChangeBounds(Bounds^);}
-      W^.Editor^.SetCurPtr(CurX,CurY);
-    end
-  else
-    begin
-      DrStr:=LocateSourceFile(FileName,tryexts);
-      if DrStr<>'' then
-        W:=IOpenEditorWindow(Bounds,DrStr,CurX,CurY,ShowIt);
-      NewEditorOpened:=W<>nil;
-      if assigned(W) then
-        W^.Editor^.SetCurPtr(CurX,CurY);
-    end;
-  ITryToOpenFile:=W;
-end;
-
-function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
-var OK: boolean;
-    E: PFileEditor;
-    R: TRect;
-begin
-  R.Assign(0,0,0,0);
-  New(E, Init(R,nil,nil,nil,nil,FileName));
-  OK:=E<>nil;
-  if OK then
-  begin
-    PushStatus(FormatStrStr(msg_readingfileineditor,FileName));
-    OK:=E^.LoadFile;
-    PopStatus;
-   end;
-  if OK then
-    begin
-      Editor^.Lock;
-      E^.SelectAll(true);
-      Editor^.InsertFrom(E);
-      Editor^.SetCurPtr(0,0);
-      Editor^.SelectAll(false);
-      Editor^.UnLock;
-      Dispose(E, Done);
-    end;
-  StartEditor:=OK;
-end;
-
-constructor TTextScroller.Init(var Bounds: TRect; ASpeed: integer; AText: PUnsortedStringCollection);
-begin
-  inherited Init(Bounds,'');
-  EventMask:=EventMask or evIdle;
-  Speed:=ASpeed; Lines:=AText;
-end;
-
-function TTextScroller.GetLineCount: integer;
-var Count: integer;
-begin
-  if Lines=nil then Count:=0 else
-    Count:=Lines^.Count;
-  GetLineCount:=Count;
-end;
-
-function TTextScroller.GetLine(I: integer): string;
-var S: string;
-begin
-  if I<Lines^.Count then
-    S:=GetStr(Lines^.At(I))
-  else
-    S:='';
-  GetLine:=S;
-end;
-
-procedure TTextScroller.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evIdle :
-      Update;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure TTextScroller.Update;
-begin
-  if abs(GetDosTicks-LastTT)<Speed then Exit;
-  Scroll;
-  LastTT:=GetDosTicks;
-end;
-
-procedure TTextScroller.Reset;
-begin
-  TopLine:=0;
-  LastTT:=GetDosTicks;
-  DrawView;
-end;
-
-procedure TTextScroller.Scroll;
-begin
-  Inc(TopLine);
-  if TopLine>=GetLineCount then
-    Reset;
-  DrawView;
-end;
-
-procedure TTextScroller.Draw;
-var B: TDrawBuffer;
-    C: word;
-    Count,Y: integer;
-    S: string;
-begin
-  C:=GetColor(1);
-  Count:=GetLineCount;
-  for Y:=0 to Size.Y-1 do
-    begin
-      if Count=0 then S:='' else
-        S:=GetLine((TopLine+Y) mod Count);
-      if copy(S,1,1)=^C then
-        S:=CharStr(' ',Max(0,(Size.X-(length(S)-1)) div 2))+copy(S,2,255);
-      MoveChar(B,' ',C,Size.X);
-      MoveStr(B,S,C);
-      WriteLine(0,Y,Size.X,1,B);
-    end;
-end;
-
-destructor TTextScroller.Done;
-begin
-  inherited Done;
-  if Lines<>nil then Dispose(Lines, Done);
-end;
-
-constructor TFPAboutDialog.Init;
-var R,R2: TRect;
-    C: PUnsortedStringCollection;
-    I: integer;
-    OSStr: string;
-procedure AddLine(S: string);
-begin
-  C^.Insert(NewStr(S));
-end;
-begin
-  OSStr:='';
-{$ifdef go32v2}
-  OSStr:='Dos';
-{$endif}
-{$ifdef tp}
-  OSStr:='Dos';
-{$endif}
-{$ifdef linux}
-  OSStr:='Linux';
-{$endif}
-{$ifdef win32}
-  OSStr:='Win32';
-{$endif}
-{$ifdef os2}
-  OSStr:='OS/2';
-{$endif}
-{$ifdef FreeBSD}
-  OSStr:='FreeBSD';
-{$endif}
-  R.Assign(0,0,38,14{$ifdef NODEBUG}-1{$endif});
-  inherited Init(R, dialog_about);
-
-  GetExtent(R); R.Grow(-3,-2);
-  R2.Copy(R); R2.B.Y:=R2.A.Y+1;
-  Insert(New(PStaticText, Init(R2, ^C'FreePascal IDE for '+OSStr)));
-  R2.Move(0,1);
-  Insert(New(PStaticText, Init(R2, ^C'Version '+VersionStr
-    {$ifdef FPC}+' '+{$i %date%}{$endif}
-    )));
-  R2.Move(0,1);
-  Insert(New(PStaticText, Init(R2, FormatStrStr2(^C'(%s %s)',label_about_compilerversion,Version_String))));
-{$ifndef NODEBUG}
-  if pos('Fake',GDBVersion)=0 then
-    begin
-      R2.Move(0,1);
-      Insert(New(PStaticText, Init(R2, FormatStrStr2(^C'(%s %s)',label_about_debugger,GDBVersion))));
-      R2.Move(0,1);
-    end
-  else
-{$endif NODEBUG}
-    R2.Move(0,2);
-  Insert(New(PStaticText, Init(R2, ^C'Copyright (C) 1998-2000 by')));
-  R2.Move(0,2);
-  Insert(New(PStaticText, Init(R2, ^C'B‚rczi G bor')));
-  R2.Move(0,1);
-  Insert(New(PStaticText, Init(R2, ^C'Pierre Muller')));
-  R2.Move(0,1);
-  Insert(New(PStaticText, Init(R2, ^C'and')));
-  R2.Move(0,1);
-  Insert(New(PStaticText, Init(R2, ^C'Peter Vreman')));
-  New(C, Init(50,10));
-  for I:=1 to 7 do
-  AddLine('');
-  AddLine(^C'< Original concept >');
-  AddLine(^C'Borland International, Inc.');
-  AddLine('');
-  AddLine(^C'< Compiler development >');
-  AddLine(^C'Carl-Eric Codere');
-  AddLine(^C'Daniel Mantione');
-  AddLine(^C'Florian Kl„mpfl');
-  AddLine(^C'Jonas Maebe');
-  AddLine(^C'Mich„el Van Canneyt');
-  AddLine(^C'Peter Vreman');
-  AddLine(^C'Pierre Muller');
-  AddLine('');
-  AddLine(^C'< IDE development >');
-  AddLine(^C'B‚rczi G bor');
-  AddLine(^C'Peter Vreman');
-  AddLine(^C'Pierre Muller');
-  AddLine('');
-
-  GetExtent(R);
-  R.Grow(-1,-1); Inc(R.A.Y,3);
-  New(Scroller, Init(R, 10, C));
-  Scroller^.Hide;
-  Insert(Scroller);
-  R.Move(0,-1); R.B.Y:=R.A.Y+1;
-  New(TitleST, Init(R, ^C'Team'));
-  TitleST^.Hide;
-  Insert(TitleST);
-
-  InsertOK(@Self);
-end;
-
-procedure TFPAboutDialog.ToggleInfo;
-begin
-  if Scroller=nil then Exit;
-  if Scroller^.GetState(sfVisible) then
-    begin
-      Scroller^.Hide;
-      TitleST^.Hide;
-    end
-  else
-    begin
-      Scroller^.Reset;
-      Scroller^.Show;
-      TitleST^.Show;
-    end;
-end;
-
-procedure TFPAboutDialog.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evKeyDown :
-      case Event.KeyCode of
-        kbAltI : { just like in BP }
-          begin
-            ToggleInfo;
-            ClearEvent(Event);
-          end;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-constructor TFPASCIIChart.Init;
-begin
-  inherited Init;
-  HelpCtx:=hcASCIITableWindow;
-  Number:=SearchFreeWindowNo;
-  ASCIIChart:=@Self;
-end;
-
-procedure TFPASCIIChart.Store(var S: TStream);
-begin
-  inherited Store(S);
-end;
-
-constructor TFPASCIIChart.Load(var S: TStream);
-begin
-  inherited Load(S);
-end;
-
-procedure TFPASCIIChart.HandleEvent(var Event: TEvent);
-var W: PSourceWindow;
-begin
-  case Event.What of
-    evKeyDown :
-      case Event.KeyCode of
-        kbEsc :
-          begin
-            Close;
-            ClearEvent(Event);
-          end;
-      end;
-    evCommand :
-      case Event.Command of
-        cmTransfer :
-          begin
-            W:=FirstEditorWindow;
-            if Assigned(W) and Assigned(Report) then
-              Message(W,evCommand,cmAddChar,pointer(ord(Report^.AsciiChar)));
-            ClearEvent(Event);
-          end;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-destructor TFPASCIIChart.Done;
-begin
-  ASCIIChart:=nil;
-  inherited Done;
-end;
-
-function TVideoModeListBox.GetText(Item: pointer; MaxLen: sw_integer): string;
-var P: PVideoModeList;
-    S: string;
-begin
-  P:=Item;
-  S:=IntToStr(P^.Col)+'x'+IntToStr(P^.Row)+' ';
-  if P^.Color then
-    S:=S+'color'
-  else
-    S:=S+'mono';
-  GetText:=copy(S,1,MaxLen);
-end;
-
-constructor TFPDesktop.Init(var Bounds: TRect);
-begin
-  inherited Init(Bounds);
-end;
-
-procedure TFPDesktop.InitBackground;
-var AV: PANSIBackground;
-    FileName: string;
-    R: TRect;
-begin
-  AV:=nil;
-  FileName:=LocateFile(BackgroundPath);
-  if FileName<>'' then
-  begin
-    GetExtent(R);
-    New(AV, Init(R));
-    AV^.GrowMode:=gfGrowHiX+gfGrowHiY;
-    if AV^.LoadFile(FileName)=false then
-    begin
-      Dispose(AV, Done); AV:=nil;
-    end;
-    if Assigned(AV) then
-      Insert(AV);
-  end;
-  Background:=AV;
-  if Assigned(Background)=false then
-    inherited InitBackground;
-end;
-
-constructor TFPDesktop.Load(var S: TStream);
-begin
-  inherited Load(S);
-end;
-
-procedure TFPDesktop.Store(var S: TStream);
-begin
-  inherited Store(S);
-end;
-
-constructor TFPToolTip.Init(var Bounds: TRect; const AText: string; AAlign: TAlign);
-begin
-  inherited Init(Bounds);
-  SetAlign(AAlign);
-  SetText(AText);
-end;
-
-procedure TFPToolTip.Draw;
-var C: word;
-procedure DrawLine(Y: integer; S: string);
-var B: TDrawBuffer;
-begin
-  S:=copy(S,1,Size.X-2);
-  case Align of
-    alLeft   : S:=' '+S;
-    alRight  : S:=LExpand(' '+S,Size.X);
-    alCenter : S:=Center(S,Size.X);
-  end;
-  MoveChar(B,' ',C,Size.X);
-  MoveStr(B,S,C);
-  WriteLine(0,Y,Size.X,1,B);
-end;
-var S: string;
-    Y: integer;
-begin
-  C:=GetColor(1);
-  S:=GetText;
-  for Y:=0 to Size.Y-1 do
-    DrawLine(Y,S);
-end;
-
-function TFPToolTip.GetText: string;
-begin
-  GetText:=GetStr(Text);
-end;
-
-procedure TFPToolTip.SetText(const AText: string);
-begin
-  if AText<>GetText then
-  begin
-    if Assigned(Text) then DisposeStr(Text);
-    Text:=NewStr(AText);
-    DrawView;
-  end;
-end;
-
-function TFPToolTip.GetAlign: TAlign;
-begin
-  GetAlign:=Align;
-end;
-
-procedure TFPToolTip.SetAlign(AAlign: TAlign);
-begin
-  if AAlign<>Align then
-  begin
-    Align:=AAlign;
-    DrawView;
-  end;
-end;
-
-destructor TFPToolTip.Done;
-begin
-  if Assigned(Text) then DisposeStr(Text); Text:=nil;
-  inherited Done;
-end;
-
-function TFPToolTip.GetPalette: PPalette;
-const S: string[length(CFPToolTip)] = CFPToolTip;
-begin
-  GetPalette:=@S;
-end;
-
-constructor TFPMemo.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-          PScrollBar; AIndicator: PIndicator);
-begin
-  inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,nil);
-  SetFlags(Flags and not (efPersistentBlocks) or efSyntaxHighlight);
-end;
-
-function TFPMemo.GetPalette: PPalette;
-const P: string[length(CFPMemo)] = CFPMemo;
-begin
-  GetPalette:=@P;
-end;
-
-function TFPMemo.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
-begin
-  GetSpecSymbolCount:=0;
-end;
-
-function TFPMemo.GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string;
-begin
-  Abstract;
-  GetSpecSymbol:='';
-end;
-
-function TFPMemo.IsReservedWord(const S: string): boolean;
-begin
-  IsReservedWord:=false;
-end;
-
-constructor TFPCodeMemo.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-          PScrollBar; AIndicator: PIndicator);
-begin
-  inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator);
-end;
-
-function TFPCodeMemo.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
-var Count: integer;
-begin
-  case SpecClass of
-    ssCommentPrefix   : Count:=3;
-    ssCommentSingleLinePrefix   : Count:=1;
-    ssCommentSuffix   : Count:=2;
-    ssStringPrefix    : Count:=1;
-    ssStringSuffix    : Count:=1;
-    ssAsmPrefix       : Count:=1;
-    ssAsmSuffix       : Count:=1;
-    ssDirectivePrefix : Count:=1;
-    ssDirectiveSuffix : Count:=1;
-  end;
-  GetSpecSymbolCount:=Count;
-end;
-
-function TFPCodeMemo.GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string;
-var S: string[20];
-begin
-  case SpecClass of
-    ssCommentPrefix :
-      case Index of
-        0 : S:='{';
-        1 : S:='(*';
-        2 : S:='//';
-      end;
-    ssCommentSingleLinePrefix :
-      case Index of
-        0 : S:='//';
-      end;
-    ssCommentSuffix :
-      case Index of
-        0 : S:='}';
-        1 : S:='*)';
-      end;
-    ssStringPrefix :
-      S:='''';
-    ssStringSuffix :
-      S:='''';
-    ssAsmPrefix :
-      S:='asm';
-    ssAsmSuffix :
-      S:='end';
-    ssDirectivePrefix :
-      S:='{$';
-    ssDirectiveSuffix :
-      S:='}';
-  end;
-  GetSpecSymbol:=S;
-end;
-
-function TFPCodeMemo.IsReservedWord(const S: string): boolean;
-begin
-  IsReservedWord:=IsFPReservedWord(S);
-end;
-
-
-{$ifdef VESA}
-function VESASetVideoModeProc(const VideoMode: TVideoMode; Params: Longint): Boolean; {$ifndef FPC}far;{$endif}
-begin
-  VESASetVideoModeProc:=VESASetMode(Params);
-end;
-
-procedure InitVESAScreenModes;
-var ML: TVESAModeList;
-    MI: TVESAModeInfoBlock;
-    I: integer;
-begin
-  if VESAInit=false then Exit;
-  if VESAGetModeList(ML)=false then Exit;
-  for I:=1 to ML.Count do
-    begin
-      if VESAGetModeInfo(ML.Modes[I],MI) then
-      with MI do
-        if (Attributes and vesa_vma_GraphicsMode)=0 then
-          RegisterVideoMode(XResolution,YResolution,
-            (Attributes and vesa_vma_ColorMode)<>0,{$ifdef FPC}@{$endif}VESASetVideoModeProc,ML.Modes[I]);
-    end;
-end;
-{$endif}
-
-procedure NoDebugger;
-begin
-  InformationBox(msg_nodebuggersupportavailable,nil);
-end;
-
-procedure RegisterFPViews;
-begin
-  RegisterType(RSourceEditor);
-  RegisterType(RSourceWindow);
-  RegisterType(RFPHelpViewer);
-  RegisterType(RFPHelpWindow);
-  RegisterType(RClipboardWindow);
-  RegisterType(RMessageListBox);
-  RegisterType(RFPDesktop);
-  RegisterType(RGDBSourceEditor);
-  RegisterType(RGDBWindow);
-  RegisterType(RFPASCIIChart);
-  RegisterType(RProgramInfoWindow);
-end;
-
-
-END.
-{
-  $Log$
-  Revision 1.5  2000-11-15 00:14:11  pierre
-   new merge
-
-  Revision 1.1.2.14  2000/11/14 09:08:49  marco
-   * First batch IDE renamefest
-
-  Revision 1.4  2000/11/13 17:37:42  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.13  2000/11/06 16:55:48  pierre
-   * fix failure to recompile when file changed
-
-  Revision 1.3  2000/10/31 22:35:55  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.12  2000/10/31 07:54:24  pierre
-   enhance GDB Window
-
-  Revision 1.1.2.11  2000/10/26 00:04:36  pierre
-   + gdb prompt and FPC_BREAK_ERROR stop
-
-  Revision 1.1.2.10  2000/10/24 00:21:59  pierre
-   * fix the greyed save after window list box
-
-  Revision 1.1.2.9  2000/10/20 13:29:29  pierre
-   * fix bug 1184, only keyowrd for all mode are highlighted
-
-  Revision 1.1.2.8  2000/10/20 09:55:00  pierre
-   * fix GetEditorCurWord if tabs present
-
-  Revision 1.1.2.7  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.2  2000/08/22 09:41:41  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.6  2000/08/21 21:23:27  pierre
-   * fix loading problem for sources in other dirs
-
-  Revision 1.1.2.5  2000/08/15 03:40:54  peter
-   [*] no more fatal exits when the IDE can't find the error file (containing
-       the redirected assembler/linker output) after compilation
-   [*] hidden windows are now added always at the end of the Window List
-   [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
-   [*] selection was incorrectly adjusted when typing in overwrite mode
-   [*] the line wasn't expanded when it's end was reached in overw. mode
-   [*] the IDE now tries to locate source files also in the user specified
-       unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
-   [*] 'Open at cursor' is now aware of the extension (if specified)
-
-  Revision 1.1.2.4  2000/08/04 14:05:19  michael
-  * Fixes from Gabor:
-   [*] the IDE now doesn't disable Compile|Make & Build when all windows
-       are closed, but there's still a primary file set
-       (set bug 1059 to fixed!)
-
-   [*] the IDE didn't read some compiler options correctly back from the
-       FP.CFG file, for ex. the linker options. Now it read everything
-       correctly, and also automatically handles smartlinking option synch-
-       ronization.
-       (set bug 1048 to fixed!)
-
-  Revision 1.1.2.3  2000/07/20 11:02:15  michael
-  + Fixes from gabor. See fixes.txt
-
-  Revision 1.1.2.2  2000/07/15 21:35:32  pierre
-   * Avoid asking twice for Unsaved New File at exit
-   * Load files without extensions at startup
-
-  Revision 1.1.2.1  2000/07/15 21:30:06  pierre
-  * Wrong commit text
-
-  Revision 1.1  2000/07/13 09:48:36  michael
-  + Initial import
-
-  Revision 1.73  2000/06/22 09:07:13  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.72  2000/06/16 08:50:42  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.71  2000/05/29 10:44:57  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.70  2000/05/16 21:50:53  pierre
-   * avoid to typecast the status line to a TWindow
-
-  Revision 1.69  2000/05/02 08:42:29  pierre
-   * new set of Gabor changes: see fixes.txt
-
-  Revision 1.68  2000/04/25 08:42:34  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.67  2000/04/18 11:42:37  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.66  2000/03/23 22:22:25  pierre
-   * file loading problem fixed
-
-  Revision 1.65  2000/03/21 23:25:16  pierre
-   adapted to wcedit addition
-
-  Revision 1.64  2000/03/14 13:59:41  pierre
-   + add a warning if Changed on loading
-
-  Revision 1.63  2000/03/13 20:39:25  pierre
-    * one more try to get the menu update to work correctly
-    * breakpoint in red at loading
-
-  Revision 1.62  2000/03/07 21:50:38  pierre
-   * UpdateCommands changed again, still not correct :(
-
-  Revision 1.61  2000/03/01 22:32:48  pierre
-   * hopfully the bug on wrong Menu config fixed
-
-  Revision 1.60  2000/02/07 23:40:38  pierre
-   * avoid closing the StackWindow too early
-
-  Revision 1.59  2000/02/07 10:36:43  michael
-  + Something went wrong when unzipping
-
-  Revision 1.58  2000/02/06 23:42:47  pierre
-   + Use ErrorLine on GotoSource
-
-  Revision 1.57  2000/02/04 00:03:30  pierre
-   + SelectInDebugSession lets CPU and watches in front
-
-  Revision 1.56  2000/02/02 22:51:49  pierre
-   * use desktop^.current for GetNextEditorBounds
-
-  Revision 1.55  2000/02/01 10:58:41  pierre
-   * avoid Search sometimes disabled for Editor Windows
-
-  Revision 1.54  2000/01/10 14:59:50  pierre
-   * TProgramInfo was not registered
-
-  Revision 1.53  2000/01/07 14:02:52  pierre
-    + date string added
-
-  Revision 1.52  2000/01/03 11:38:34  michael
-  Changes from Gabor
-
-  Revision 1.51  1999/12/20 14:23:17  pierre
-    * MyApp renamed IDEApp
-    * TDebugController.ResetDebuggerRows added to
-      get resetting of debugger rows
-
-  Revision 1.50  1999/12/16 16:55:52  pierre
-   * fix of web bug 756
-
-  Revision 1.49  1999/11/25 00:25:43  pierre
-   * add Status when loading/saving files
-
-  Revision 1.48  1999/11/22 16:02:12  pierre
-   * TryToOpenFile failed tofind a sourcewindow if it has no number
-
-  Revision 1.47  1999/11/18 13:39:24  pierre
-   * Better info for Undo debugging
-
-  Revision 1.46  1999/11/10 00:44:12  pierre
-   * Grouped Undo action signaled in 'Dump Undo'
-
-  Revision 1.45  1999/10/29 14:50:07  pierre
-   * About dialog changes
-
-  Revision 1.44  1999/10/27 12:10:42  pierre
-    + With DebugUndo added 3 menu items
-      "Dump Undo" "Undo All" and "Redo All"
-      for Undo checks
-
-  Revision 1.43  1999/10/25 16:55:13  pierre
-   * adapted to a small weditor change
-
-  Revision 1.42  1999/09/16 14:34:59  pierre
-    + TBreakpoint and TWatch registering
-    + WatchesCollection and BreakpointsCollection stored in desk file
-    * Syntax highlighting was broken
-
-  Revision 1.41  1999/09/13 16:24:43  peter
-    + clock
-    * backspace unident like tp7
-
-  Revision 1.40  1999/09/09 16:30:37  pierre
-   * ModuleNames was not created in TMessageListBox.Load
-
-  Revision 1.39  1999/09/03 12:54:07  pierre
-    * adapted to modified tokens unit
-    * TryToOpen works better
-
-  Revision 1.38  1999/08/31 16:18:33  pierre
-   + TGDBWindow.Load and Store + Registration
-
-  Revision 1.37  1999/08/16 18:25:26  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.36  1999/08/03 20:22:39  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.35  1999/07/12 13:14:22  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.34  1999/06/30 23:58:20  pierre
-    + BreakpointsList Window implemented
-      with Edit/New/Delete functions
-    + Individual breakpoint dialog with support for all types
-      ignorecount and conditions
-      (commands are not yet implemented, don't know if this wolud be useful)
-      awatch and rwatch have problems because GDB does not annotate them
-      I fixed v4.16 for this
-
-  Revision 1.33  1999/06/28 19:32:28  peter
-    * fixes from gabor
-
-  Revision 1.32  1999/06/21 23:37:08  pierre
-   * VESASetVideoModeProc return value was not set
-
-  Revision 1.31  1999/06/02 11:19:13  pierre
-   * @ is now required for FPC for procedure address passing in functions
-
-  Revision 1.30  1999/05/22 13:44:33  peter
-    * fixed couple of bugs
-
-  Revision 1.29  1999/04/15 08:58:08  peter
-    * syntax highlight fixes
-    * browser updates
-
-  Revision 1.28  1999/04/07 21:55:56  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.27  1999/04/01 10:27:06  pierre
-   + file(line) in start of message added
-
-  Revision 1.26  1999/03/23 16:16:41  peter
-    * linux fixes
-
-  Revision 1.25  1999/03/23 15:11:37  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.24  1999/03/21 22:51:37  florian
-    + functional screen mode switching added
-
-  Revision 1.23  1999/03/19 16:04:33  peter
-    * new compiler dialog
-
-  Revision 1.22  1999/03/16 00:44:45  peter
-    * forgotten in last commit :(
-
-  Revision 1.21  1999/03/08 14:58:16  peter
-    + prompt with dialogs for tools
-
-  Revision 1.20  1999/03/01 15:42:08  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.19  1999/02/22 11:51:39  peter
-    * browser updates from gabor
-
-  Revision 1.18  1999/02/22 11:29:38  pierre
-    + added col info in MessageItem
-    + grep uses HighLightExts and should work for linux
-
-  Revision 1.17  1999/02/22 02:15:22  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.16  1999/02/19 18:43:49  peter
-    + open dialog supports mask list
-
-  Revision 1.15  1999/02/17 15:04:02  pierre
-   + file(line) added in TProgramInfo message list
-
-  Revision 1.14  1999/02/16 12:45:18  pierre
-   * GDBWindow size and grow corrected
-
-  Revision 1.13  1999/02/15 09:36:06  pierre
-    * // comment ends at end of line !
-      GDB window changed !
-      now all is in a normal text editor, but pressing
-      Enter key will send part of line before cursor to GDB !
-
-  Revision 1.12  1999/02/11 19:07:25  pierre
-    * GDBWindow redesigned :
-      normal editor apart from
-      that any kbEnter will send the line (for begin to cursor)
-      to GDB command !
-      GDBWindow opened in Debugger Menu
-       still buggy :
-       -echo should not be present if at end of text
-       -GDBWindow becomes First after each step (I don't know why !)
-
-  Revision 1.11  1999/02/11 13:08:39  pierre
-   + TGDBWindow : direct gdb input/output
-
-  Revision 1.10  1999/02/10 09:42:52  pierre
-    + DoneReservedWords to avoid memory leaks
-    * TMessageItem Module field was not disposed
-
-  Revision 1.9  1999/02/05 12:12:02  pierre
-    + SourceDir that stores directories for sources that the
-      compiler should not know about
-      Automatically asked for addition when a new file that
-      needed filedialog to be found is in an unknown directory
-      Stored and retrieved from INIFile
-    + Breakpoints conditions added to INIFile
-    * Breakpoints insterted and removed at debin and end of debug session
-
-  Revision 1.8  1999/02/04 17:45:23  pierre
-    + BrowserAtCursor started
-    * bug in TryToOpenFile removed
-
-  Revision 1.7  1999/02/04 13:32:11  pierre
-    * Several things added (I cannot commit them independently !)
-    + added TBreakpoint and TBreakpointCollection
-    + added cmResetDebugger,cmGrep,CmToggleBreakpoint
-    + Breakpoint list in INIFile
-    * Select items now also depend of SwitchMode
-    * Reading of option '-g' was not possible !
-    + added search for -Fu args pathes in TryToOpen
-    + added code for automatic opening of FileDialog
-      if source not found
-
-  Revision 1.6  1999/01/21 11:54:27  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.5  1999/01/14 21:42:25  peter
-    * source tracking from Gabor
-
-  Revision 1.4  1999/01/12 14:29:42  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.3  1999/01/04 11:49:53  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.2  1998/12/28 15:47:54  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.4  1998/12/22 10:39:53  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 125
ide/text/globdir.inc

@@ -1,125 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1999 by Berczi Gabor
-
-    Conditional defines logic for the IDE
-
-    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.
-
- **********************************************************************}
-
-{ --- Special OS settings --- }
-{$ifdef TP}
-  {$define SUPPORTVESA}
-  {$define TPUNIXLF}
-  {$define WinClipSupported}
-
-  {$C FIXED PRELOAD PERMANENT}
-  {
-    Without defining this I got almost always SEGMENT NOT PRESENT (exc 11)
-    on exiting the IDE, when run on under NT4.0... Strange a bit, not?
-    (Actually the fault occours in TDOSScreen.GetVideoMode() at the
-     BIOS call, but I just can't figure out why....)
-  }
-{$endif}
-
-{$ifdef Go32V2}
-  {$define SUPPORTVESA}
-  {$define SUPPORTREDIR}
-  {$define WinClipSupported}
-  {$define HasSignal}
-{$endif}
-
-{$ifdef Linux}
-  {$undef SUPPORTVESA}
-  {$define SUPPORTREDIR}
-  {$undef WinClipSupported}
-  {$define HasSignal}
-{$endif}
-
-
-{$ifdef FreeBSD}
-  {$undef SUPPORTVESA}
-  {$define SUPPORTREDIR}
-  {$undef WinClipSupported}
-  {$define HasSignal}
-{$endif}
-
-
-{$ifdef Win32}
-  {$undef SUPPORTVESA}
-  {$define SUPPORTREDIR}
-  {$define WinClipSupported}
-  {$define HasSignal}
-{$endif}
-
-{ --- Exclude debugger support --- }
-{.$DEFINE NODEBUG}
-
-{ --- Include VESA support --- }
-{$ifdef SUPPORTVESA}
-  {$ifndef FV20}
-    {$define VESA}
-  {$endif}
-{$endif}
-
-{$ifdef SUPPORTREDIR}
-  {$ifndef debug}
-    {$define redircompiler}
-  {$endif}
-  {$ifdef GDB_V418}
-    {define redircompiler}
-  {$endif GDB_V418}
-{$endif}
-
-{ ----------- define DOS for DOS targets ---------- }
-{$ifdef GO32V2}{$define DOS}{$endif}
-{$ifdef TP}{$define DOS}{$endif}
-
-{ include Undo/Redo code from Visa Harvey }
-{ let everybody try it out  PM }
-{ undo should be a bit improved - it does work only with "normal" keystrokes.
-  neither the block, nor any shortcut operations (like Ctrl-T - delete word)
-  do work... Gabor
-  Partially solved at least PM }
-{$define Undo}
-{$ifdef DEBUG}
-  {$define DebugUndo}
-  { Use this to incorporate a call to
-    external compiler.
-    Parsing of compiler output is done,
-    but there is no browser in that case!! PM }
-  { $ define USE_EXTERNAL_COMPILER}
-  {$define EXEDEBUG}
-{$endif DEBUG}
-
-{$ifdef FPC}
-  {$define USERESSTRINGS}
-{$endif}
-
-{$define TEST_PARTIAL_SYNTAX}
-{ $ undef UNDO}
-{ $ undef DEBUGUNDO}
-
-{$define BROWSERCOL}
-
-{$ifdef SUPPORTVESA}
-  {$define VESA}
-{$endif}
-
-{$ifdef GABOR}
-  {.$define NOOBJREG}
-  {$define NODEBUG}
-  {$define DEBUG}
-  {$undef EXEDEBUG}
-  {$undef USERESSTRINGS}
-  {.$define LANG_HUN}
-  {$undef WinClipSupported}
-{$endif}
-
-{$ifdef NOWINCLIP}
-  {$undef WINCLIPSUPPORTED}
-{$endif}

+ 0 - 33
ide/text/gplprog.pt

@@ -1,33 +0,0 @@
-{
-    $Id$DATE $TIME peter Exp $
-    This file is part of $PROMPT('This file is part of')
-    Copyright (c) $DATE('yyyy') by $PROMPT('Your name')
-
-    $PROMPT('Description of file')
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-program $PROMPT('program');
-
-uses $PROMPT('uses');
-
-BEGIN
-END.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:36  michael
-  + Initial import
-
-  Revision 1.4  2000/06/07 06:17:14  pierre
-   * New templates from Gabor
-
-  Revision 1.1  1999/02/19 15:37:26  peter
-    + init
-
-}

+ 0 - 43
ide/text/gplunit.pt

@@ -1,43 +0,0 @@
-{
-    $Id$DATE $TIME peter Exp $
-    This file is part of $PROMPT('This file is part of')
-    Copyright (c) $DATE('yyyy') by $PROMPT('Your name')
-
-    $PROMPT('Description of file')
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit $PROMPT('unit');
-
-interface
-
-uses $PROMPT('uses');
-
-const
-
-type
-
-var
-
-implementation
-
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:36  michael
-  + Initial import
-
-  Revision 1.4  2000/06/07 06:17:14  pierre
-   * New templates from Gabor
-
-  Revision 1.1  1999/02/19 15:37:26  peter
-    + init
-
-}
-

+ 0 - 59
ide/text/grep.tdf

@@ -1,59 +0,0 @@
-[Main]
-Title="GNU Grep"
-Size=(56,9)
-CommandLine="-n %l% %v% %i% %w% %searchstr% %filemask%"
-Default="searchstr"
-
-[searchstr]
-Type=InputLine
-Origin=(2,2)
-Size=(52,1)
-
-[label1]
-Type=Label
-Origin=(2,1)
-Size=(52,1)
-Text="~T~ext to find"
-Link="searchstr"
-
-[filemask]
-Type=InputLine
-Origin=(2,4)
-Size=(22,1)
-Value="*.pas *.pp *.inc"
-
-[label2]
-Type=Label
-Origin=(2,3)
-Size=(22,1)
-Text="File ~m~ask"
-Link="filemask"
-
-[i]
-Type=CheckBox
-Name="~C~ase sensitive"
-Origin=(2,6)
-Size=(25,1)
-Default=On
-On="-i"
-
-[v]
-Type=CheckBox
-Name="~N~on-matching lines"
-Origin=(2,7)
-Size=(25,1)
-On="-v"
-
-[l]
-Type=CheckBox
-Name="~F~ile names only"
-Origin=(29,6)
-Size=(25,1)
-On="-l"
-
-[w]
-Type=CheckBox
-Name="Whole ~w~ords only"
-Origin=(29,7)
-Size=(25,1)
-On="-w"

+ 0 - 2
ide/text/maketp.bat

@@ -1,2 +0,0 @@
-@echo off
-bpc fp -dTP -U..\fake\gdb -U..\fake\compiler

+ 0 - 737
ide/text/pmode.pas

@@ -1,737 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Sockets Interface
-    Copyright (c) 1999 by Berczi Gabor
-
-    Support routines for DPMI programs
-
-    See the file COPYING.FCL, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$ifdef VER70}{$define TP}{$endif}
-unit PMode;
-
-interface
-
-uses Dos;
-
-type
-    MemPtr = object
-      Ofs,Seg: word;
-      Size   : word;
-    {$ifdef DPMI}
-      Sel    : word;
-    {$endif}
-      function  DosPtr: pointer;
-      function  DataPtr: pointer;
-      function  DosSeg: word;
-      function  DosOfs: word;
-      procedure MoveDataTo(const Src; DSize: word);
-      procedure MoveDataFrom(DSize: word; var Dest);
-      procedure Clear;
-    private
-      function DataSeg: word;
-      function DataOfs: word;
-    end;
-
-    PtrRec = packed record
-      Ofs,Seg: word;
-    end;
-
-    registers32 = packed record     { DPMI call structure }
-      EDI     : LongInt;
-      ESI     : LongInt;
-      EBP     : LongInt;
-      Reserved: LongInt;
-      EBX     : LongInt;
-      EDX     : LongInt;
-      ECX     : LongInt;
-      EAX     : LongInt;
-      Flags   : Word;
-      ES      : Word;
-      DS      : Word;
-      FS      : Word;
-      GS      : Word;
-      IP      : Word;
-      CS      : Word;
-      SP      : Word;
-      SS      : Word;
-    end;
-
-    pregisters = ^registers;
-
-function  GetDosMem(var M: MemPtr; Size: word): boolean;
-procedure FreeDosMem(var M: MemPtr);
-procedure realintr(IntNo: byte; var r: registers);
-{procedure realintr32(IntNo: byte; var r: registers32);}
-procedure realcall(Proc: pointer; var r: registers);
-function  MoveDosToPM(DosPtr: pointer; PMPtr: pointer; Size: word): boolean;
-function  MovePMToDos(PMPtr: pointer; DosPtr: pointer; Size: word): boolean;
-procedure realGetIntVec(IntNo: byte; var P: pointer);
-function  allocrmcallback(PMAddr: pointer; RealRegs: pregisters): pointer;
-procedure freermcallback(RealCallAddr: pointer);
-
-function MakePtr(ASeg,AOfs: word): pointer;
-
-implementation
-
-{$ifdef TP}
-{$ifdef DPMI}uses WinAPI;{$endif}
-
-{$IFDEF DPMI}
-const
-    DPMI_INTR      = $31;
-
-type
-    TDPMIRegisters = {$ifdef TP}Registers32{$else}TRegisters32{$endif};
-
-  var
-    DPMIRegs: TDPMIRegisters;
-{$ENDIF DPMI}
-
-procedure realintr(IntNo: byte; var r: registers);
-{$ifdef DPMI}
-var Regs: Registers;
-begin
-  FillChar(DPMIRegs, SizeOf(TDPMIRegisters), 0);
-  DPMIRegs.EAX := r.ax;
-  DPMIRegs.EBX := r.bx;
-  DPMIRegs.ECX := r.cx;
-  DPMIRegs.EDX := r.dx;
-  DPMIRegs.EDI := r.di;
-  DPMIRegs.ESI := r.si;
-  DPMIRegs.EBP := r.bp;
-  DPMIRegs.DS := r.ds;
-  DPMIRegs.ES := r.es;
-  DPMIRegs.Flags := r.flags;
-  Regs.AX := $0300;
-  Regs.BL := IntNo;
-  Regs.BH := 0;
-  Regs.CX := 0;
-  Regs.ES := Seg(DPMIRegs);
-  Regs.DI := Ofs(DPMIRegs);
-  Intr(DPMI_INTR, Regs);
-  r.ax := DPMIRegs.EAX;
-  r.bx := DPMIRegs.EBX;
-  r.cx := DPMIRegs.ECX;
-  r.dx := DPMIRegs.EDX;
-  r.di := DPMIRegs.EDI;
-  r.si := DPMIRegs.ESI;
-  r.bp := DPMIRegs.EBP;
-  r.ds := DPMIRegs.DS;
-  r.es := DPMIRegs.ES;
-  r.Flags := DPMIRegs.Flags;
-end;
-{$else}
-begin
-  intr(IntNo,r);
-end;
-{$endif}
-
-(*procedure realintr32(IntNo: byte; var r: registers32);
-{$ifdef DPMI}
-var Regs: Registers;
-begin
-  FillChar(DPMIRegs, SizeOf(TDPMIRegisters), 0);
-  DPMIRegs:=r;
-
-  Regs.AX := $0300;
-  Regs.BL := IntNo;
-  Regs.BH := 0;
-  Regs.CX := 0;
-  Regs.ES := Seg(DPMIRegs);
-  Regs.DI := Ofs(DPMIRegs);
-  Intr(DPMI_INTR, Regs);
-  r:=DPMIRegs;
-end;
-{$else}
-begin
-  { not implemented }
-  Halt(99);
-end;
-{$endif}
-*)
-
-{$ifndef DPMI}
-const DummyIntRedir: boolean = false;
-      CallAddr: pointer = nil;
-      DummyInt = $ef;
-procedure CallInt; assembler;
-asm
-  push  ax
-  push  ds
-
-  mov   ax, seg CallAddr
-  mov   ds, ax
-  mov   ax, ds:CallAddr.word[0]
-  mov   cs:@JmpAddr.word[0], ax
-  mov   ax, ds:CallAddr.word[2]
-  mov   cs:@JmpAddr.word[2], ax
-
-  pop   ds
-  pop   ax
-
-  sti
-
-  db    $9a
-@JmpAddr:
-  dw    0,0
-  jmp   @over
-@regax: dw  0
-@over:
-  mov  word ptr cs:@regax, ax
-  push bx
-  pushf
-  pop  ax
-  mov  bx, sp
-  mov  word ptr ss:[bx+6], ax
-  pop  bx
-  mov  ax, word ptr cs:@regax
-
-  iret
-end;
-{$endif}
-
-procedure realcall(Proc: pointer; var r: registers);
-{$ifdef DPMI}
-var Regs: Registers;
-begin
-  FillChar(DPMIRegs, SizeOf(TDPMIRegisters), 0);
-  DPMIRegs.EAX := r.ax;
-  DPMIRegs.EBX := r.bx;
-  DPMIRegs.ECX := r.cx;
-  DPMIRegs.EDX := r.dx;
-  DPMIRegs.EDI := r.di;
-  DPMIRegs.ESI := r.si;
-  DPMIRegs.EBP := r.bp;
-  DPMIRegs.DS := r.ds;
-  DPMIRegs.ES := r.es;
-  DPMIRegs.Flags := r.flags;
-  DPMIRegs.CS := PtrRec(Proc).Seg;
-  DPMIRegs.IP := PtrRec(Proc).Ofs;
-  DPMIRegs.SS :=0; DPMIRegs.SP:=0;
-  Regs.AX := $0301;
-  Regs.BH := 0;
-  Regs.CX := 0;
-  Regs.ES := Seg(DPMIRegs);
-  Regs.DI := Ofs(DPMIRegs);
-  Intr(DPMI_INTR, Regs);
-  r.ax := DPMIRegs.EAX and $ffff;
-  r.bx := DPMIRegs.EBX and $ffff;
-  r.cx := DPMIRegs.ECX and $ffff;
-  r.dx := DPMIRegs.EDX and $ffff;
-  r.di := DPMIRegs.EDI and $ffff;
-  r.si := DPMIRegs.ESI and $ffff;
-  r.bp := DPMIRegs.EBP and $ffff;
-  r.ds := DPMIRegs.DS;
-  r.es := DPMIRegs.ES;
-  r.Flags := DPMIRegs.Flags and $ffff;
-end;
-{$else}
-(*begin
-  asm
-    push ds
-    push bp
-
-    mov  ax, Proc.word[2]
-    mov  bx, Proc.word[0]
-    mov  cs:@Call+1.word, bx
-    mov  cs:@Call+3.word, ax
-
-    lds  si, r
-    mov  @rptr.word[2], ds
-    mov  @rptr.word[0], si
-
-    lodsw
-    push ax { -> ax }
-    lodsw
-    mov  bx, ax
-    lodsw
-    mov  cx, ax
-    lodsw
-    mov  dx, ax
-    lodsw
-    mov  bp, ax
-    lodsw
-    push ax { -> si }
-    lodsw
-    mov  di, ax
-    lodsw
-    push ax { -> ds }
-    lodsw
-    mov  es, ax
-    lodsw
-    push ax { -> flags }
-    popf
-
-    pop  si
-    pop  ds
-    pop  ax
-
-@Call:
-    db   9ah
-    dd   0
-
-    jmp  @skipover
-@rptr: dd  0
-@skipover:
-
-    pushf
-    push es
-    push di
-
-    mov  es, @rptr.word[2]
-    mov  di, @rptr.word[0]
-    stosw
-    mov  ax, bx
-    stosw
-    mov  ax, cx
-    stosw
-    mov  ax, dx
-    stosw
-    mov  ax, bp
-    stosw
-    mov  ax, si
-    stosw
-    pop  ax { <- di }
-    stosw
-    mov  ax, ds
-    stosw
-    pop  ax { <- es }
-    stosw
-    pop  ax { <- flags }
-    stosw
-
-    pop  bp
-    pop  ds
-  end;
-end;
-*)
-begin
-  if DummyIntRedir=false then
-    begin
-      SetIntVec(DummyInt,@CallInt);
-      DummyIntRedir:=true;
-    end;
-  CallAddr:=Proc;
-  dos.intr(DummyInt,r);
-end;
-
-{$endif}
-
-(*const ActiveBlocks: word = 0;*)
-
-function GetDosMem(var M: MemPtr; Size: word): boolean;
-var P: pointer;
-    L: longint;
-begin
-  M.Size:=Size;
-{$ifndef DPMI}
-  GetMem(P,Size);
-  M.Seg:=PtrRec(P).Seg; M.Ofs:=PtrRec(P).Ofs;
-{$else}
-  L:=GlobalDosAlloc(Size);
-  M.Seg:=(L shr 16); M.Ofs:=0;
-  M.Sel:=(L and $ffff);
-{$endif}
-  if M.Seg<>0 then M.Clear;
-  GetDosMem:=M.Seg<>0;
-(*  Inc(ActiveBlocks);
-  write('|DMC:',ActiveBlocks,'-S:',M.Sel,'-S:',M.Seg);*)
-end;
-
-procedure FreeDosMem(var M: MemPtr);
-begin
-  if M.Size=0 then Exit;
-{$ifndef DPMI}
-  if M.Seg<>0 then
-  FreeMem(Ptr(M.Seg,M.Ofs),M.Size);
-{$else}
-  if M.Sel<>0 then
-   if GlobalDosFree(M.Sel)<>0 then
-    writeln('!!!Failed to deallocate Dos block!!!');
-{$endif}
-
-  FillChar(M,SizeOf(M),0);
-end;
-
-{$ifdef DPMI}
-function GetSelectorForSeg(Seg: word): word;
-var Sel: word;
-    r: registers;
-begin
-  r.ax:=$0002; r.bx:=Seg;
-  intr(DPMI_Intr,r);
-  if (r.flags and fCarry)=0 then
-    Sel:=r.ax
-  else
-    Sel:=0;
-  GetSelectorForSeg:=Sel;
-end;
-{$endif}
-
-function MoveDosToPM(DosPtr: pointer; PMPtr: pointer; Size: word): boolean;
-{$ifndef DPMI}
-begin
-  Move(DosPtr^,PMPtr^,Size);
-  MoveDosToPM:=true;
-end;
-{$else}
-var Sel: word;
-    OK,DisposeSel: boolean;
-begin
-  Sel:=GetSelectorForSeg(PtrRec(DosPtr).Seg);
-  OK:=Sel<>0; DisposeSel:=false;
-  if OK=false then
-    begin
-      Sel:=AllocSelector(0);
-      OK:=Sel<>0;
-      if OK then
-        begin
-          SetSelectorLimit(Sel,PtrRec(DosPtr).Ofs+Size);
-          OK:=SetSelectorBase(Sel,PtrRec(DosPtr).Seg shl 4)=Sel;
-        end;
-      if OK then DisposeSel:=true;
-    end;
-  if OK then
-    begin
-      Move(ptr(Sel,PtrRec(DosPtr).Ofs)^,PMPtr^,Size);
-      if DisposeSel then FreeSelector(Sel);
-    end;
-  MoveDosToPM:=OK;
-end;
-{$endif}
-
-function MovePMToDos(PMPtr: pointer; DosPtr: pointer; Size: word): boolean;
-{$ifndef DPMI}
-begin
-  Move(PMPtr^,DosPtr^,Size);
-  MovePMToDos:=true;
-end;
-{$else}
-var Sel: word;
-    OK,DisposeSel: boolean;
-begin
-  Sel:=GetSelectorForSeg(PtrRec(DosPtr).Seg);
-  OK:=Sel<>0; DisposeSel:=false;
-  if OK=false then
-    begin
-      Sel:=AllocSelector(0);
-      OK:=Sel<>0;
-      if OK then
-        begin
-          SetSelectorLimit(Sel,PtrRec(DosPtr).Ofs+Size);
-          OK:=SetSelectorBase(Sel,PtrRec(DosPtr).Seg shl 4)=Sel;
-        end;
-      if OK then DisposeSel:=true;
-    end;
-  if OK then
-    begin
-      Move(PMPtr^,ptr(Sel,PtrRec(DosPtr).Ofs)^,Size);
-      if DisposeSel then FreeSelector(Sel);
-    end;
-  MovePMToDos:=OK;
-end;
-{$endif}
-
-procedure realGetIntVec(IntNo: byte; var P: pointer);
-{$ifndef DPMI}
-begin
-  GetIntVec(IntNo,P);
-end;
-{$else}
-var r: registers;
-begin
-  r.ax:=$200; r.bl:=IntNo;
-  intr(DPMI_Intr,r);
-  P:=Ptr(r.cx,r.dx);
-end;
-{$endif}
-
-procedure MemPtr.MoveDataTo(const Src; DSize: word);
-begin
-  if DSize>Size then
-    RunError(216);
-  Move(Src,Ptr(DataSeg,DataOfs)^,DSize);
-end;
-
-procedure MemPtr.MoveDataFrom(DSize: word; var Dest);
-begin
-  if DSize>Size then
-    RunError(216);
-  Move(Ptr(DataSeg,DataOfs)^,Dest,DSize);
-end;
-
-procedure MemPtr.Clear;
-begin
-  FillChar(Ptr(DataSeg,DataOfs)^,Size,0);
-end;
-
-procedure RealAbstract;
-begin
-  writeln('Abstract call in real mode...');
-  RunError(255);
-end;
-
-function  allocrmcallback(PMAddr: pointer; RealRegs: pregisters): pointer;
-{$ifdef DPMI}
-var r: registers;
-    P: pointer;
-begin
-  r.ax:=$0303;
-  r.ds:=PtrRec(PMAddr).Seg; r.si:=PtrRec(PMAddr).Ofs;
-  r.es:=PtrRec(RealRegs).Seg; r.di:=PtrRec(RealRegs).Ofs;
-  intr(DPMI_Intr,r);
-  if (r.flags and fCarry)=0 then
-    P:=MakePtr(r.cx,r.dx)
-  else
-    P:=nil;
-  allocrmcallback:=P;
-end;
-{$else}
-begin
-  RealAbstract;
-end;
-{$endif}
-
-procedure freermcallback(RealCallAddr: pointer);
-{$ifdef DPMI}
-var r: registers;
-begin
-  r.ax:=$0304;
-  r.cx:=PtrRec(RealCallAddr).Seg; r.dx:=PtrRec(RealCallAddr).Seg;
-  intr(DPMI_Intr,r);
-end;
-{$else}
-begin
-  RealAbstract;
-end;
-{$endif}
-
-{$endif TP}
-
-{$ifdef GO32V2}
-
-{ --------------------- GO32 --------------------- }
-
-uses go32;
-
-function  GetDosMem(var M: MemPtr; Size: word): boolean;
-var L: longint;
-begin
-  M.Size:=Size;
-  L:=global_dos_alloc(Size);
-  M.Seg:=(L shr 16); M.Ofs:=0;
-  M.Sel:=(L and $ffff);
-  GetDosMem:=M.Seg<>0;
-end;
-
-procedure FreeDosMem(var M: MemPtr);
-begin
-  if M.Size=0 then Exit;
-  if M.Sel<>0 then
-  if global_dos_free(M.Sel)=false then
-    writeln('!!!Failed to deallocate Dos block!!!');
-  FillChar(M,SizeOf(M),0);
-end;
-
-procedure realintr(IntNo: byte; var r: registers);
-var rr: trealregs;
-begin
-  rr.realeax:=r.ax;
-  rr.realebx:=r.bx;
-  rr.realecx:=r.cx;
-  rr.realedx:=r.dx;
-  rr.realesi:=r.si;
-  rr.realedi:=r.di;
-  rr.reales:=r.es;
-  rr.realds:=r.ds;
-  go32.realintr(IntNo,rr);
-  r.ax:=rr.realeax and $ffff;
-  r.bx:=rr.realebx and $ffff;
-  r.cx:=rr.realecx and $ffff;
-  r.dx:=rr.realedx and $ffff;
-  r.si:=rr.realesi and $ffff;
-  r.di:=rr.realedi and $ffff;
-  r.es:=rr.reales and $ffff;
-  r.ds:=rr.realds and $ffff;
-end;
-
-function dorealcall(var regs : trealregs) : boolean;
-begin
-  regs.realsp:=0;
-  regs.realss:=0;
-  asm
-    movw  $0x0,%bx
-    xorl  %ecx,%ecx
-    movl  regs,%edi
-    { es is always equal ds }
-    movl  $0x301,%eax
-    int   $0x31
-    setnc %al
-    movb  %al,__RESULT
-  end;
-end;
-
-
-procedure realcall(Proc: pointer; var r: registers);
-var rr: trealregs;
-begin
-  rr.realeax:=r.ax;
-  rr.realebx:=r.bx;
-  rr.realecx:=r.cx;
-  rr.realedx:=r.dx;
-  rr.realesi:=r.si;
-  rr.realedi:=r.di;
-  rr.reales:=r.es;
-  rr.realds:=r.ds;
-  rr.flags:=r.flags;
-  rr.CS:=PtrRec(Proc).Seg;
-  rr.IP:=PtrRec(Proc).Ofs;
-
-  rr.realss:=0; rr.realsp:=0;
-
-  dorealcall(rr);
-
-  r.ax:=rr.realeax and $ffff;
-  r.bx:=rr.realebx and $ffff;
-  r.cx:=rr.realecx and $ffff;
-  r.dx:=rr.realedx and $ffff;
-  r.si:=rr.realesi and $ffff;
-  r.di:=rr.realedi and $ffff;
-  r.es:=rr.reales and $ffff;
-  r.ds:=rr.realds and $ffff;
-  r.flags:=rr.Flags and $ffff;
-end;
-
-function MoveDosToPM(DosPtr: pointer; PMPtr: pointer; Size: word): boolean;
-begin
-  dosmemget(PtrRec(DosPtr).Seg,PtrRec(DosPtr).Ofs,PMPtr^,Size);
-  MoveDosToPM:=true;
-end;
-
-function MovePMToDos(PMPtr, DosPtr: pointer; Size: word): boolean;
-begin
-  dosmemput(PtrRec(DosPtr).Seg,PtrRec(DosPtr).Ofs,PMPtr^,Size);
-  MovePMToDos:=true;
-end;
-
-procedure realGetIntVec(IntNo: byte; var P: pointer);
-var si: tseginfo;
-begin
-  get_rm_interrupt(IntNo,si);
-  PtrRec(P).Seg:=si.segment; PtrRec(P).Ofs:=longint(si.offset);
-end;
-
-procedure MemPtr.MoveDataTo(const Src; DSize: word);
-begin
-  dpmi_dosmemput(DosSeg,DosOfs,Src,DSize);
-end;
-
-procedure MemPtr.MoveDataFrom(DSize: word; var Dest);
-begin
-  dpmi_dosmemget(DosSeg,DosOfs,Dest,DSize);
-end;
-
-procedure MemPtr.Clear;
-begin
-  dpmi_dosmemfillchar(DosSeg,DosOfs,Size,#0);
-end;
-
-
-function  allocrmcallback(PMAddr: pointer; RealRegs: pregisters): pointer;
-var s: tseginfo;
-    P: pointer;
-begin
-  if get_rm_callback(PMAddr,RealRegs^,s) then
-    P:=MakePtr(s.segment,longint(s.offset))
-  else
-    P:=nil;
-  allocrmcallback:=P;
-end;
-
-procedure freermcallback(RealCallAddr: pointer);
-var s: tseginfo;
-begin
-  s.segment:=PtrRec(RealCallAddr).seg;
-  s.offset:=Pointer(Longint(PtrRec(RealCallAddr).ofs));
-  free_rm_callback(s);
-end;
-
-{$endif GO32V2}
-
-{ ---------------------- COMMON ---------------------- }
-
-function MemPtr.DosPtr: pointer;
-begin
-  DosPtr:=MakePtr(Seg,Ofs);
-end;
-
-function MemPtr.DataPtr: pointer;
-begin
-  DataPtr:=MakePtr(DataSeg,DataOfs);
-end;
-
-function MemPtr.DataSeg: word;
-begin
-{$ifndef DPMI}
-  DataSeg:=Seg;
-{$else}
-  DataSeg:=Sel;
-{$endif}
-end;
-
-function MemPtr.DataOfs: word;
-begin
-{$ifndef DPMI}
-  DataOfs:=Ofs;
-{$else}
-  DataOfs:=0;
-{$endif}
-end;
-
-function MemPtr.DosSeg: word;
-begin
-  DosSeg:=Seg;
-end;
-
-function MemPtr.DosOfs: word;
-begin
-  DosOfs:=Ofs;
-end;
-
-function MakePtr(ASeg, AOfs: word): pointer;
-var P: pointer;
-begin
-  with PtrRec(P) do
-  begin
-    Seg:=ASeg; Ofs:=AOfs;
-  end;
-  MakePtr:=P;
-end;
-
-END.
-{
-  $Log$
-  Revision 1.2  2000-11-13 19:32:31  peter
-    * fixed ptr() to pointer() typecase
-
-  Revision 1.1  2000/07/13 09:48:36  michael
-  + Initial import
-
-  Revision 1.2  2000/06/22 09:07:13  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.1  2000/04/20 08:47:39  pierre
-   + new files from Gabor
-
-
-  Revision 1.0  1999/07/07 09:46:55  gabor
-     Original implementation
-
-}

+ 0 - 6
ide/text/program.pt

@@ -1,6 +0,0 @@
-program $PROMPT('program');
-
-uses $PROMPT('uses');
-
-BEGIN
-END.

+ 0 - 109
ide/text/readme.ide

@@ -1,109 +0,0 @@
-             Welcome to the Free Pascal IDE!
-            ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
-
- Please take the time to read this file to avoid most
- common installation problems, and to get the most out of
- this software!
-
-  General information Ü
- ßßßßßßßßßßßßßßßßßßßßßß
- First of all: note that the IDE is currently still in
- beta state! That means that some functions may not work,
- or may not work as expected. We do our best to fix all
- bugs and make the IDE reliable and stable, however, you
- may still encounter some problems using it.
- Therefore you should be careful using untested functions,
- and make regularly backup copies of your source files!
- If you encounter any problems using the IDE, then please
- report it to the authors by sending an e-mail to
- "[email protected]" or by entering it in the bugs
- database at "http://www.freepascal.org". (Note, that we
- can't fix bugs we don't have any knowledge of, or can't
- reproduce, so, it's in your own interest to report bugs
- as fast and precisely as possible.)
-
- You should be also careful with hotkeys and shortcuts!
- The IDE is designed to be compatible with the BP IDE as
- much as possible, however, the platform differences and
- some improvements may break that compatibility at some
- points, which may result in slightly or totally different
- behaviour than expected. Therefore, you should first
- experiment with the IDE some time before using for
- serious purposes, and read all available docs before
- reporting a "bug"!
-
-  Version conflicts Ü
- ßßßßßßßßßßßßßßßßßßßß
- IDE snapshots are created on a regular basis. That means,
- that the IDE and it's embedded compiler are always the
- most up-to-date versions.
- Unless you've installed the IDE from a full distribution,
- you'll have to install the latest compiler and RTL
- binaries to avoid version conflicts and get the IDE
- working. You can do this by downloading the latest binary
- snapshots from "http://www.freepascal.org" and copying
- it's contents directly over your existing installation.
- (You can also install these files in separate directories
- and set up the IDE to search for them at that place.
- However, this may result in different behaviour and
- incompatibilities between of the command-line based and
- the embedded compiler.)
- When installing a new snapshot you should make sure you
- back up your existing installation! This is not a
- neccessary step for the IDE to function, however, it may
- proove very helpful, when the newly installed snapshot
- contains a new bug or is incompatible in some aspects
- with your previous one.
-
-  Configuration Ü
- ßßßßßßßßßßßßßßßß
- Once you have installed the IDE, it requires two
- configuration changes before it can compile. This is due
- to the fact that the IDE includes its own compiler; it
- does not use ppc386.exe and thus it also does not use the
- configuration in the file ppc386.cfg.
-
- Select Target from the Compile menu and then check the
- correct default target (this is Go32V2 for DOS).
- Next, choose Directories in the Otions menu and in the
- line "Unit directories" enter the path to your copy of
- the RTL directory, usually c:\pp\rtl\go32v2. If you have
- done everything correct and it still doesn't work, you
- may have grabbed a snapshot that has a bug; in this case
- try again one or two days later or ask for help on one of
- the mailing lists (see later!).
-
-  Documentation Ü
- ßßßßßßßßßßßßßßßß
- Although the IDE itself has no kind of "native"
- documentation or help, it is capable of reading HTML,
- Turbo Pascal (TPH), and Norton Guide (NG) format files.
- That means, that you can use both the FPC documentation
- (included in your distribution, or downloadable from the
- Free Pascal HP) and/or the help files of your Turbo or
- Borland Pascal (from version 5.5 thru 7.0) installation.
- You can install help files of all types in the on-line
- help system by going to Help menu, selecting Files and
- adding them to the list.
-
-  More information Ü
- ßßßßßßßßßßßßßßßßßßß
- If you need more informations you can:
-  þ read the FAQ and the documentation
-  þ join one or more of the 4 mailing lists
-
- For the FAQ, for the on-line version of the docs,
- and for information on joining the mailing lists go to
- the Free Pascal homepage at http://www.freepascal.org.
-
- Well, I think, this should be enough info for the start.
- Thanks for taking time reading this file, and please
- don't forget to report any bugs or problems you encounter
- using the IDE as soon as possible. Also feel free to
- write us, if you have any comments, suggestions, ideas,
- etc. regarding the compiler and/or the IDE!
-
- Have as much fun using the IDE, as we had creating it! ;)
-
-                  The Free Pascal IDE Development Team
-

+ 0 - 11
ide/text/readme.txt

@@ -1,11 +0,0 @@
-  This is still a beta version of the IDE
-
-This file is just a log of important changes
-starting 1999/10/29
-
-
-1999/10/29 :
-  Undo/Redo stuff added to normal compilation
-  this is still buggy !!!
-  Any use of Copy/Cut/Paste or Clear will generate wrong Undo
-  We will t

+ 0 - 67
ide/text/realintr.inc

@@ -1,67 +0,0 @@
-{$IFDEF DPMI}
-const
-    DPMI_INTR      = $31;
-
-type
-    TDPMIRegisters = record     { DPMI call structure }
-      EDI     : LongInt;
-      ESI     : LongInt;
-      EBP     : LongInt;
-      Reserved: LongInt;
-      EBX     : LongInt;
-      EDX     : LongInt;
-      ECX     : LongInt;
-      EAX     : LongInt;
-      Flags   : Word;
-      ES      : Word;
-      DS      : Word;
-      FS      : Word;
-      GS      : Word;
-      IP      : Word;
-      CS      : Word;
-      SP      : Word;
-      SS      : Word;
-    end;
-
-  var
-    DPMIRegs: TDPMIRegisters;
-
-  procedure realintr(IntNo: byte; var r: registers);
-  var Regs: Registers;
-  begin
-    FillChar(DPMIRegs, SizeOf(TDPMIRegisters), 0);
-    DPMIRegs.EAX := r.ax;
-    DPMIRegs.EBX := r.bx;
-    DPMIRegs.ECX := r.cx;
-    DPMIRegs.EDX := r.dx;
-    DPMIRegs.EDI := r.di;
-    DPMIRegs.ESI := r.si;
-    DPMIRegs.EBP := r.bp;
-    DPMIRegs.DS := r.ds;
-    DPMIRegs.ES := r.es;
-    { --- }
-    DPMIRegs.FS := 0;
-    DPMIRegs.GS := 0;
-    DPMIRegs.SS := 0;
-    DPMIRegs.SP := 0;
-    { --- }
-    DPMIRegs.Flags := r.flags;
-    Regs.AX := $0300;
-    Regs.BL := IntNo;
-    Regs.BH := 0;
-    Regs.CX := 0;
-    Regs.ES := Seg(DPMIRegs);
-    Regs.DI := Ofs(DPMIRegs);
-    Intr(DPMI_INTR, Regs);
-    r.ax := DPMIRegs.EAX;
-    r.bx := DPMIRegs.EBX;
-    r.cx := DPMIRegs.ECX;
-    r.dx := DPMIRegs.EDX;
-    r.di := DPMIRegs.EDI;
-    r.si := DPMIRegs.ESI;
-    r.bp := DPMIRegs.EBP;
-    r.ds := DPMIRegs.DS;
-    r.es := DPMIRegs.ES;
-    r.Flags := DPMIRegs.Flags;
-  end;
-{$ENDIF}

+ 0 - 161
ide/text/test.pas

@@ -1,161 +0,0 @@
-{$mode objfpc}
-{$R-}
-
-program TestProgram;
-uses
-{$ifdef go32v2}
-  dpmiexcp,
-{$endif}
-    test1, Test2;
-
-const A =  1234;
-      C =  #1#2#3#4;
-      ConstBool1 = true;
-      ConstBool2 = boolean(5);
-      ConstChar = 'A';
-      ConstSet = ['A'..'Z'];
-      ConstSet2 = [15..254];
-      ConstFloat = 3.1415;
-
-{$i empty.inc}
-
-type
-      PObj = ^TObj;
-      TObj = object
-        constructor Init;
-        function    Func: boolean;
-        procedure   Proc; virtual;
-        destructor  Done; virtual;
-      private
-        Z: integer;
-      end;
-
-      TObj2 = object(TObj)
-        procedure Proc; virtual;
-      end;
-
-      TObj3  = object(TObj)
-      end;
-
-      TObj32 = object(TObj3)
-      end;
-
-      TObj4 = object(TObj)
-      end;
-
-      TClass = class
-        constructor Create;
-      end;
-
-      TClass2 = class(TClass)
-      end;
-
-      EnumTyp = (enum1,enum2,enum3);
-      ArrayTyp = array[1..10] of EnumTyp;
-      ProcTyp = function(A: word; var B: longint; const C: EnumTyp): real;
-      SetTyp = set of EnumTyp;
-
-const
-      ConstOrd = enum1;
-
-var Hello : word;
-    X: PRecord;
-    Bool: boolean;
-    T : TRecord;
-    Str20 : string[20];
-    Str255: string;
-    ArrayW: array[2..45] of word;
-    ArrayVar: ArrayTyp;
-    EnumVar: (enumElem1,enumElem2,enumElem3);
-    EnumVar2: EnumTyp;
-    FileVar: file;
-    FileVarR: file of TRecord;
-    FileVarW: file of word;
-    ProcVar: procedure;
-    ProcVarD: function(X: real): boolean;
-    ProcVarI: ProcTyp;
-    SetVarD: set of char;
-    SetVarI: SetTyp;
-    Float1: real;
-    Float2: double;
-    Float3: comp;
-    Float4: extended;
-    Pointer1: pointer;
-    Pointer2: PObj;
-    ClassVar1: TClass;
-    ClassVar2: TClass2;
-    Obj1: TObj;
-    Obj2: TObj2;
-
-constructor TObj.Init;
-begin
-  Z:=1;
-end;
-
-function TObj.Func: boolean;
-begin
-  Func:=true;
-end;
-
-procedure TObj.Proc;
-begin
-  if Func=false then Halt;
-end;
-
-destructor TObj.Done;
-begin
-end;
-
-procedure TObj2.Proc;
-begin
-  Z:=4;
-end;
-
-constructor TClass.Create;
-begin
-end;
-
-function Func1(x,z : word; var y : boolean; const r: TRecord): shortint;
-
-var loc : string;
-
-  procedure test_local(c,f : longint);
-   var
-      int_loc : longint;
-   begin
-      Writeln('dummy for browser');
-   end;
-
-  procedure indirect_call;
-   var
-     loc : longint;
-   begin
-     loc:=1;
-     test_local(5,7);
-   end;
-begin
-  loc:='This is a string';
-  if Hello=0 then X:=0 else X:=1;
-  test_local(0,2);
-  indirect_call;
-  Func1:=X;
-end;
-
-var i : longint;
-
-BEGIN
-  X:=nil;
-  writeln('Hello world!');
-  Writeln('ParamCount = ',ParamCount);
-  For i:=0 to paramcount do
-   writeln('Paramstr(',i,') = '+Paramstr(i));
-  writeln(IsOdd(3));
-  writeln(Func1(5,5,Bool,T));
-  new(X);
-  new(X^.next);
-  X^.next^.next:=X;
-  dispose(X);
- { for i:=1 to 99 do
-    Writeln('Line ',i); }
-  Halt(4);
-END.

+ 0 - 9
ide/text/test1.pas

@@ -1,9 +0,0 @@
-unit test1;
-
-{ dummy unit for test of dbx stabs info PM }
-
-interface
-
-implementation
-
-end.

+ 0 - 32
ide/text/test2.pas

@@ -1,32 +0,0 @@
-{$L+}
-unit Test2;
-
-interface
-
-type
-     PRecord = ^TRecord;
-     TRecord = record
-       Field1: longint;
-       Next  : PRecord;
-     end;
-
-function IsOdd(X: integer): boolean;
-
-var 
-  TEST2_X : real;
-
-implementation
-
-function IsOdd(X: integer): boolean;
-var Z: byte;
-begin
-  Z:=0;
-  X:=Z*X*Test8087;
-  IsOdd:=(X mod 2)=1;
-end;
-
-procedure static;
-begin
-end;
-
-END.

+ 0 - 88
ide/text/tpgrep.tdf

@@ -1,88 +0,0 @@
-[Main]
-Title="Turbo Grep"
-Size=(56,10)
-CommandLine="%r% %l% %v% %i% %d% %w% %o% %searchstr% %filemask%"
-Default="searchstr"
-
-[searchstr]
-Type=InputLine
-Origin=(2,2)
-Size=(52,1)
-
-[label1]
-Type=Label
-Origin=(2,1)
-Size=(52,1)
-Text="~T~ext to find"
-Link="searchstr"
-
-[filemask]
-Type=InputLine
-Origin=(2,4)
-Size=(22,1)
-Value="*.pas"
-
-[label2]
-Type=Label
-Origin=(2,3)
-Size=(22,1)
-Text="File ~m~ask"
-Link="filemask"
-
-[d]
-Type=CheckBox
-Origin=(26,4)
-Size=(28,1)
-Name="Search ~s~ubdirectories"
-On="-d+"
-;Off="-d-"
-
-[r]
-Type=CheckBox
-Name="~R~egular expression"
-Origin=(2,6)
-Size=(25,1)
-On="-r+"
-;Off="-r-"
-Value=1
-
-[v]
-Type=CheckBox
-Name="~N~on-matching lines"
-Origin=(2,7)
-Size=(25,1)
-On="-v+"
-;Off="-v-"
-
-[o]
-Type=CheckBox
-Name="~U~NIX output format"
-Origin=(2,8)
-Size=(25,1)
-On="-o+"
-;Off="-o-"
-
-[l]
-Type=CheckBox
-Name="~F~ile names only"
-Origin=(29,6)
-Size=(25,1)
-On="-l+"
-;Off="-l-"
-
-[i]
-Type=CheckBox
-Name="~C~ase sensitive"
-Origin=(29,7)
-Size=(25,1)
-On="-i-"
-Off="-i+"
-
-[w]
-Type=CheckBox
-Name="Whole ~w~ords only"
-Origin=(29,8)
-Size=(25,1)
-On="-w+"
-;Off="-w-"
-

+ 0 - 15
ide/text/unit.pt

@@ -1,15 +0,0 @@
-unit $PROMPT('unit');
-
-interface
-
-uses $PROMPT('uses');
-
-const
-
-type
-
-var
-
-implementation
-
-end.

+ 0 - 101
ide/text/utils/grep2msg.pas

@@ -1,101 +0,0 @@
-{************************************************}
-{                                                }
-{   Grep message filter example                  }
-{   Copyright (c) 1992 by Borland International  }
-{                                                }
-{************************************************}
-
-program Grep2Msg;
-
-{ Message filters read input from the target program (in this case, GREP)
-  by way of StdIn (by using Read or ReadLn), filter the input, then write
-  output back to StdOut (using Write or WriteLn). The IDE takes care of
-  redirecting the transfer program's output to the filter program, as well
-  as redirecting the filter program's output back to the IDE itself.
-}
-
-{$I-,S-}
-
-var
-  LineNo, E: Word;
-  P1,P2: integer;
-  Line: String;
-  InputBuffer: array[0..4095] of Char;
-  OutputBuffer: array[0..4095] of Char;
-
-
-{ The first data passed back to the IDE by a message filter must always
-  be the string 'BI#PIP#OK', followed by a null terminator.
-}
-procedure WriteHeader;
-begin
-  Write('BI#PIP#OK'#0);
-end;
-
-{ The beginning of a new file is marked by a #0, the file's name, terminated
-  by a #0 character.
-}
-procedure WriteNewFile(const FileName: String);
-begin
-  Write(#0, FileName, #0);
-end;
-
-{ Each message line begins with a #1, followed the line number (in low/high
-  order), followed by the column number (in low/high order), then the
-  message text itself, terminated with a #0 character.
-}
-procedure WriteMessage(Line, Col: Word; const Message: String);
-begin
-  Write(#1, Chr(Lo(Line)), Chr(Hi(Line)), Chr(Lo(Col)), Chr(Hi(Col)),
-    Message, #0);
-end;
-
-{ The end of the input stream is marked by a #127 character }
-procedure WriteEnd;
-begin
-  Write(#127);
-end;
-
-function TrimLeft(S:String): String;
-var
-  i: Integer;
-  n: String;
-begin
-  i := 1;
-  while (i <= Length(s)) and (s[i] = #32) do Inc(i);
-  if i <= Length(s) then
-  begin
-    Move(s[i], n[1], Length(s) - i + 1);
-    n[0] := Char(Length(s) - i + 1);
-  end
-  else n[0] := #0;
-  TrimLeft := n;
-end;
-
-const LastFileName: string = '';
-
-begin
-  SetTextBuf(Input, InputBuffer);
-  SetTextBuf(Output, OutputBuffer);
-  WriteHeader;
-  while not Eof do
-  begin
-    ReadLn(Line);
-    if Line <> '' then
-    begin
-      P1:=Pos(':',Line);
-      if copy(Line, 1, P1)<>LastFileName then
-        begin
-          LastFileName:=copy(Line,1,P1-1);
-          WriteNewFile(LastFileName);
-        end;
-      P2:=Pos(':',copy(Line,P1+1,255));
-      if P2>0 then
-      begin
-        Val(Copy(Line, P1+1, P2-1), LineNo, E);
-        if E = 0 then WriteMessage(LineNo, 1, TrimLeft(Copy(Line, P1+1+P2, 132)));
-      end;
-    end;
-  end;
-  WriteEnd;
-end.

+ 0 - 208
ide/text/utils/tphc.pas

@@ -1,208 +0,0 @@
-{
- !!! Someone please fix DRIVERS.PAS, so it doesn't clears the screen on exit
-     when we didn't use any of it's functions, just had it in 'uses'
-
-     Then we can delete GetDosTicks() from WHelp...
-}
-
-uses Objects,WUtils,WHelp,WTPHWriter;
-
-const
-     SrcExt          = '.txt';
-     HelpExt         = '.fph';
-     TokenPrefix     = '.';
-     CommentPrefix   = ';';
-     TokenIndex      = 'INDEX';
-     TokenTopic      = 'TOPIC';
-     TokenCode       = 'CODE';
-
-     FirstTempTopic  = 1000000;
-
-     CR              = #$0D;
-     LF              = #$0A;
-
-type
-     THCIndexEntry = record
-       Tag      : PString;
-       TopicName: PString;
-     end;
-
-     THCTopic = record
-       Name     : PString;
-       Topic    : PTopic;
-     end;
-
-     PHCIndexEntryCollection = ^THCIndexEntryCollection;
-     THCIndexEntryCollection = object(T
-
-var SrcName, DestName: string;
-    HelpFile        : THelpFileWriter;
-
-procedure Print(const S: string);
-begin
-  writeln(S);
-end;
-
-procedure Abort; forward;
-
-procedure Help;
-begin
-  Print('Syntax : TPHC <helpsource>[.TXT] <helpfile>[.FPH]');
-  Abort;
-end;
-
-procedure Fatal(const S: string);
-begin
-  Print('Fatal: '+S);
-  Abort;
-end;
-
-procedure Warning(const S: string);
-begin
-  Print('Warning: '+S);
-end;
-
-procedure ProcessParams;
-begin
-  if (ParamCount<1) or (ParamCount>2) then Help;
-  SrcName:=ParamStr(1);
-  if ExtOf(SrcName)='' then SrcName:=SrcName+SrcExt;
-  if ParamCount=1 then
-    DestName:=DirAndNameOf(SrcName)+HelpExt
-  else
-    begin
-      DestName:=ParamStr(2);
-      if ExtOf(DestName)='' then DestName:=DestName+HelpExt;
-    end;
-end;
-
-procedure Compile(SrcS, DestS: PStream);
-var CurLine: string;
-    CurLineNo: longint;
-    CurTopic : PTopic;
-    HelpFile: PHelpFileWriter;
-    InCode: boolean;
-    NextTempTopic: longint;
-procedure AddLine(const S: string);
-begin
-  if CurTopic<>nil then
-    HelpFile^.AddLineToTopic(CurTopic,S);
-end;
-procedure ProcessToken(S: string);
-var P: byte;
-    Token: string;
-    TopicName: string;
-    TopicContext: THelpCtx;
-    Text: string;
-begin
-  S:=Trim(S);
-  P:=Pos(' ',S); if P=0 then P:=length(S)+1;
-  Token:=UpcaseStr(copy(S,1,P-1)); Delete(S,1,P); S:=Trim(S);
-  if Token=TokenIndex then
-    begin
-      if InCode then AddLine(hscCode);
-      if copy(S,1,1)<>'{' then
-        Fatal('"{" expected at line '+IntToStr(CurLineNo));
-      if copy(S,length(S),1)<>'}' then
-        Fatal('"}" expected at line '+IntToStr(CurLineNo));
-      S:=copy(S,2,length(S)-2);
-      P:=Pos(':',S); if P=0 then P:=length(S)+1;
-      Text:=copy(S,1,!!
-    end else
-  if Token=TokenTopic then
-    begin
-      if InCode then AddLine(hscCode);
-      P:=Pos(' ',S); if P=0 then P:=length(S)+1;
-      TopicName:=UpcaseStr(copy(S,1,P-1)); Delete(S,1,P); S:=Trim(S);
-      if TopicName='' then
-        Fatal('Topic name missing at line '+IntToStr(CurLineNo));
-      if S='' then
-        TopicContext:=0
-      else
-        if copy(S,1,1)<>'=' then
-          begin
-            Fatal('"=" expected at line '+IntToStr(CurLineNo));
-            TopicContext:=0;
-          end
-        else
-          begin
-            S:=Trim(copy(S,2,255));
-            TopicContext:=StrToInt(S);
-            if LastStrToIntResult<>0 then
-              Fatal('Error interpreting context number at line '+IntToStr(CurLineNo));
-          end;
-      if TopicContext=0 then
-        begin
-          TopicContext:=NextTempTopic;
-          Inc(NextTempTopic);
-        end;
-      CurTopic:=HelpFile^.CreateTopic(TopicContext);
-    end else
-  if Token=TokenCode then
-    begin
-      AddLine(hscCode);
-      InCode:=not InCode;
-    end else
-  Warning('Uknown token "'+Token+'" encountered at line '+IntToStr(CurLineNo));
-end;
-procedure ProcessLine(const S: string);
-begin
-  AddLine(S);
-end;
-function ReadNextLine: boolean;
-var C: char;
-begin
-  Inc(CurLineNo);
-  CurLine:='';
-  repeat
-    SrcS^.Read(C,1);
-    if (C in[CR,LF])=false then
-      CurLine:=CurLine+C;
-  until (C=LF) or (SrcS^.Status<>stOK);
-  ReadNextLine:=(SrcS^.Status=stOK);
-end;
-var OK: boolean;
-begin
-  New(HelpFile, InitStream(DestS,0));
-  CurTopic:=nil; CurLineNo:=0;
-  NextTempTopic:=FirstTempTopic;
-  InCode:=false;
-  repeat
-    OK:=ReadNextLine;
-    if OK then
-    if copy(CurLine,1,length(CommentPrefix))=CommentPrefix then
-      { comment }
-    else
-    if copy(CurLine,1,length(TokenPrefix))=TokenPrefix then
-      ProcessToken(copy(CurLine,2,255))
-    else
-    { normal help-text }
-    begin
-      ProcessLine(CurLine);
-    end;
-  until OK=false;
-  if HelpFile^.WriteFile=false then
-    Fatal('Error writing help file.');
-  Dispose(HelpFile, Done);
-end;
-
-const SrcS  : PBufStream = nil;
-      DestS : PBufStream = nil;
-
-procedure Abort;
-begin
-  if SrcS<>nil then Dispose(SrcS, Done); SrcS:=nil;
-  if DestS<>nil then Dispose(DestS, Done); DestS:=nil;
-end;
-
-BEGIN
-  Print('þ Help Compiler  Version 0.9  Copyright (c) 1999 by B‚rczi G bor');
-  ProcessParams;
-  New(SrcS, Init(SrcName, stOpenRead, 4096));
-  if (SrcS=nil) or (SrcS^.Status<>stOK) then
-    Fatal('Error opening source file.');
-  New(DestS, Init(DestName, stCreate, 4096));
-  if (DestS=nil) or (DestS^.Status<>stOK) then
-    Fatal('Error creating destination file.');
-  Compile(SrcS,DestS);
-END.

+ 0 - 296
ide/text/vesa.pas

@@ -1,296 +0,0 @@
-{
-    $Id$
-    This file is part of the PinGUI - Platform Independent GUI Project
-    Copyright (c) 1999 by Berczi Gabor
-
-    VESA support routines
-
-    See the file COPYING.GUI, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit VESA;
-
-interface
-
-uses
-  Dos,
-  Objects,Strings,WUtils;
-
-const
-     { Video Mode Attributes mask constants }
-     vesa_vma_CanBeSetInCurrentConfig = $0001;
-     vesa_vma_OptionalBlockPresent    = $0002;
-     vesa_vma_BIOSSupport             = $0004;
-     vesa_vma_ColorMode               = $0008; { else mono }
-     vesa_vma_GraphicsMode            = $0010; { else text }
-     { -- VBE 2.0 --- }
-     vesa_vma_VGACompatibleMode       = $0020;
-     vesa_vma_VGACompWindowedAvail    = $0040;
-     vesa_vma_LinearFrameBufferAvail  = $0080;
-
-     { Windows Attributes mask constants }
-     vesa_wa_Present                  = $0001;
-     vesa_wa_Readable                 = $0002;
-     vesa_wa_Writeable                = $0004;
-
-     { Memory Model value constants }
-     vesa_mm_Text                     = $0000;
-     vesa_mm_CGAGraphics              = $0001;
-     vesa_mm_HerculesGraphics         = $0002;
-     vesa_mm_4planePlanar             = $0003;
-     vesa_mm_PackedPixel              = $0004;
-     vesa_mm_NonChain4_256color       = $0005;
-     vesa_mm_DirectColor              = $0006;
-     vesa_mm_YUV                      = $0007;
-
-     { Memory Window value constants }
-     vesa_mw_WindowA                  = $0000;
-     vesa_mw_WindowB                  = $0001;
-
-type
-     {$ifdef FPC}tregisters=registers;{$endif}
-     {$ifdef TP}tregisters=registers;{$endif}
-
-     PtrRec16 = record
-       Ofs,Seg: word;
-     end;
-
-     TVESAInfoBlock = record
-       Signature    : longint; {  'VESA' }
-       Version      : word;
-       OEMString    : PString;
-       Capabilities : longint;
-       VideoModeList: PWordArray;
-       TotalMemory  : word; { in 64KB blocks }
-       Fill         : array[1..236] of byte;
-       VBE2Fill     : array[1..256] of byte;
-     end;
-
-     TVESAModeInfoBlock = record
-       Attributes      : word;
-       WinAAttrs       : byte;
-       WinBAttrs       : byte;
-       Granularity     : word;
-       Size            : word;
-       ASegment        : word;
-       BSegment        : word;
-       FuncPtr         : pointer;
-       BytesPerLine    : word;
-     { optional }
-       XResolution     : word;
-       YResolution     : word;
-       XCharSize       : byte;
-       YCharSize       : byte;
-       NumberOfPlanes  : byte;
-       BitsPerPixel    : byte;
-       NumberOfBanks   : byte;
-       MemoryModel     : byte;
-       BankSize        : byte;
-       NumberOfImagePages: byte;
-       Reserved        : byte;
-     { direct color fields }
-       RedMaskSize     : byte;
-       RedFieldPosition: byte;
-       GreenMaskSize   : byte;
-       GreenFieldPosition: byte;
-       BlueMaskSize    : byte;
-       BlueFieldPosition: byte;
-       ReservedMaskSize: byte;
-       ReservedPosition: byte;
-       DirectColorModeInfo: byte;
-      { --- VBE 2.0 optional --- }
-       LinearFrameAddr : longint;
-       OffScreenAddr   : longint;
-       OffScreenSize   : word;
-       Reserved2       : array[1..216-(4+4+2)] of byte;
-     end;
-
-     TVESAModeList = record
-       Count        : word;
-       Modes        : array[1..256] of word;
-     end;
-
-function VESAInit: boolean;
-function VESAGetInfo(var B: TVESAInfoBlock): boolean;
-function VESAGetModeInfo(Mode: word; var B: TVESAModeInfoBlock): boolean;
-function VESAGetModeList(var B: TVESAModeList): boolean;
-function VESASearchMode(XRes,YRes,BPX: word; LFB: boolean; var Mode: word; var ModeInfo: TVESAModeInfoBlock): boolean;
-function VESAGetOemString: string;
-function VESASetMode(Mode: word): boolean;
-function VESAGetMode(var Mode: word): boolean;
-function VESASelectMemoryWindow(Window: byte; Position: word): boolean;
-function VESAReturnMemoryWindow(Window: byte; var Position: word): boolean;
-
-implementation
-
-uses pmode;
-
-function VESAGetInfo(var B: TVESAInfoBlock): boolean;
-var r: registers;
-    OK: boolean;
-    M: MemPtr;
-begin
-  StrToMem('VBE2',B.Signature);
-  GetDosMem(M,SizeOf(B));
-  M.MoveDataTo(B,sizeof(B));
-  r.ah:=$4f; r.al:=0;
-  r.es:=M.DosSeg; r.di:=M.DosOfs;
-  realintr($10,r);
-  M.MoveDataFrom(sizeof(B),B);
-  FreeDosMem(M);
-  OK:=(r.ax=$004f){ and (MemToStr(B.Signature,4)='VESA')};
-  VESAGetInfo:=OK;
-end;
-
-function VESAGetModeList(var B: TVESAModeList): boolean;
-var OK: boolean;
-    VI: TVESAInfoBlock;
-begin
-  FillChar(B,SizeOf(B),0);
-  OK:=VESAGetInfo(VI);
-  if OK then
-  begin
-    OK:=MoveDosToPM(VI.VideoModeList,@B.Modes,sizeof(B.Modes));
-    if OK then
-      while (B.Modes[B.Count+1]<>$ffff) and (B.Count<High(B.Modes)) do
-            Inc(B.Count);
-  end;
-  VESAGetModeList:=OK;
-end;
-
-function VESASearchMode(XRes,YRes,BPX: word; LFB: boolean; var Mode: word; var ModeInfo: TVESAModeInfoBlock): boolean;
-var B: TVESAModeList;
-    OK: boolean;
-    I: integer;
-    MI: TVESAModeInfoBlock;
-begin
-  OK:=VESAGetModeList(B);
-  I:=1; Mode:=0;
-  repeat
-    OK:=VESAGetModeInfo(B.Modes[I],MI);
-    if OK and (MI.XResolution=XRes) and (MI.YResolution=YRes) and
-       (MI.BitsPerPixel=BPX) and
-       ((LFB=false) or ((MI.Attributes and vesa_vma_LinearFrameBufferAvail)<>0)) then
-      begin Mode:=B.Modes[I]; ModeInfo:=MI; end;
-    Inc(I);
-  until (OK=false) or (I>=B.Count) or (Mode<>0);
-  OK:=Mode<>0;
-  VESASearchMode:=OK;
-end;
-
-function VESAGetOemString: string;
-var OK: boolean;
-    VI: TVESAInfoBlock;
-    S: array[0..256] of char;
-begin
-  FillChar(S,SizeOf(S),0);
-  OK:=VESAGetInfo(VI);
-  if OK then
-    OK:=MoveDosToPM(VI.OemString,@S,sizeof(S));
-  VESAGetOemString:=StrPas(@S);
-end;
-
-function VESAGetModeInfo(Mode: word; var B: TVESAModeInfoBlock): boolean;
-var r : registers;
-    M : MemPtr;
-    OK: boolean;
-begin
-  r.ah:=$4f; r.al:=$01; r.cx:=Mode;
-  GetDosMem(M,sizeof(B));
-  r.es:=M.DosSeg; r.di:=M.DosOfs; {r.ds:=r.es;}
-  realintr($10,r);
-  M.MoveDataFrom(sizeof(B),B);
-  FreeDosMem(M);
-  OK:=(r.ax=$004f);
-  VESAGetModeInfo:=OK;
-end;
-
-function VESASetMode(Mode: word): boolean;
-var r: registers;
-    OK: boolean;
-begin
-  r.ah:=$4f; r.al:=$02; r.bx:=Mode;
-  dos.intr($10,r);
-  OK:=(r.ax=$004f);
-  VESASetMode:=OK;
-end;
-
-function VESAGetMode(var Mode: word): boolean;
-var r : registers;
-    OK: boolean;
-begin
-  r.ah:=$4f; r.al:=$03;
-  dos.intr($10,r);
-  OK:=(r.ax=$004f);
-  if OK then Mode:=r.bx;
-  VESAGetMode:=OK;
-end;
-
-function VESASelectMemoryWindow(Window: byte; Position: word): boolean;
-var r : registers;
-    OK : boolean;
-begin
-  r.ah:=$4f; r.al:=$05; r.bh:=0; r.bl:=Window; r.dx:=Position;
-  dos.intr($10,r);
-  OK:=(r.ax=$004f);
-  VESASelectMemoryWindow:=OK;
-end;
-
-function VESAReturnMemoryWindow(Window: byte; var Position: word): boolean;
-var r  : registers;
-    OK : boolean;
-begin
-  r.ah:=$4f; r.al:=$05; r.bh:=1; r.bl:=Window;
-  dos.intr($10,r);
-  OK:=(r.ax=$004f);
-  if OK then Position:=r.dx;
-  VESAReturnMemoryWindow:=OK;
-end;
-
-function VESAInit: boolean;
-var OK: boolean;
-    VI: TVESAInfoBlock;
-begin
-  OK:=VESAGetInfo(VI);
-  VESAInit:=OK;
-end;
-
-BEGIN
-END.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:36  michael
-  + Initial import
-
-  Revision 1.8  2000/06/22 09:07:13  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.7  2000/03/21 23:22:37  pierre
-   Gabor fixes to avoid unused vars
-
-  Revision 1.6  2000/01/03 11:38:35  michael
-  Changes from Gabor
-
-  Revision 1.4  1999/04/07 21:55:58  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.3  1999/04/01 10:04:18  pierre
-   * uses typo errror fixed
-
-  Revision 1.2  1999/03/26 19:09:44  peter
-    * fixed for go32v2
-
-  Revision 1.1  1999/03/23 15:11:39  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-}

+ 0 - 1044
ide/text/wansi.pas

@@ -1,1044 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1996-2000 by Berczi Gabor
-
-    ANSI support
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{.$DEFINE DEBUG}
-unit WANSI;
-
-interface
-
-uses Objects,Drivers,
-{$ifdef WITH_CRT}
-     Crt,
-{$endif WITH_CRT}
-     Dos,Views,App;
-
-const
-{$ifndef WITH_CRT}
-{ Foreground and background color constants }
-  Black         = 0;
-  Blue          = 1;
-  Green         = 2;
-  Cyan          = 3;
-  Red           = 4;
-  Magenta       = 5;
-  Brown         = 6;
-  LightGray     = 7;
-
-{ Foreground color constants }
-  DarkGray      = 8;
-  LightBlue     = 9;
-  LightGreen    = 10;
-  LightCyan     = 11;
-  LightRed      = 12;
-  LightMagenta  = 13;
-  Yellow        = 14;
-  White         = 15;
-
-{ Add-in for blinking }
-  Blink         = 128;
-{$endif not WITH_CRT}
-
-      ANSIMaxParamLen     = 30; { max ANSI escape sequence length }
-      ANSICurPosStackSize = 20; { max number of cursor positions stored at the same time }
-
-      Esc = #27;
-
-      MaxVideoLine = 65520 div (2*MaxViewWidth); { maximum number of lines that fit in 64K }
-
-      { BoundCheck constants }
-      bc_MinX    = 1;
-      bc_MinY    = 2;
-      bc_MaxX    = 4;
-      bc_MaxY    = 8;
-      bc_X       = bc_MinX or bc_MaxX;
-      bc_Y       = bc_MinY or bc_MaxY;
-      bc_Min     = bc_MinX or bc_MinY;
-      bc_Max     = bc_MaxX or bc_MaxY;
-      bc_All     = bc_X or bc_Y;
-
-type
-     TANSIParam = string[ANSIMaxParamLen];
-
-     PHookProc = ^THookProc;
-     THookProc = procedure (S: string);
-
-     PConsoleObject = ^TConsoleObject;
-     TConsoleObject = object(TObject)
-       CurPos   : TPoint;
-       Size     : TPoint;
-       TextAttr : byte;
-       BoldOn   : boolean;
-       BlinkOn  : boolean;
-       BoundChecks: byte;
-       LineWrapping: boolean;
-       ReplyHook   : PHookProc;
-       KeyHook     : PHookProc;
-       WriteHook   : PHookProc;
-       constructor Init(AReplyHook, AKeyHook, AWriteHook: PHookProc);
-       procedure   Home; virtual;
-       procedure   ClrScr; virtual;
-       procedure   FillScreen(B: byte); virtual;
-       procedure   ClrEol; virtual;
-       procedure   GotoXY(X,Y: integer); virtual;
-       procedure   Write(S: string); virtual;
-       procedure   WriteLn(S: string); virtual;
-       procedure   WriteChar(C: char); virtual;
-       procedure   DelLine(LineCount: integer); virtual;
-       procedure   InsLine(LineCount: integer); virtual;
-       procedure   HighVideo; virtual;
-       procedure   BlinkVideo; virtual;
-       procedure   NoBlinkVideo; virtual;
-       procedure   NormVideo; virtual;
-       procedure   LowVideo; virtual;
-       procedure   TextBackground(Color: byte); virtual;
-       procedure   TextColor(Color: byte); virtual;
-       function    WhereX: integer; virtual;
-       function    WhereY: integer; virtual;
-       procedure   CursorOn; virtual;
-       procedure   CursorOff; virtual;
-       procedure   UpdateCursor; virtual;
-       { --- Hook procedures --- }
-       procedure   Reply(S: string); virtual;
-       procedure   PutKey(S: string); virtual;
-       destructor  Done; virtual;
-       private
-       procedure   ProcessChar(C: char); virtual;
-     end;
-
-     PANSIConsole = ^TANSIConsole;
-     TANSIConsole = object(TConsoleObject)
-       ANSIParam          : TANSIParam;
-       ANSILevel          : byte;
-       ANSICurPosStack    : array[1..ANSICurPosStackSize] of TPoint;
-       ANSICurPosStackPtr : byte;
-       constructor Init(AReplyHook, AKeyHook, AWriteHook: PHookProc);
-       procedure   ProcessChar(C: char); virtual;
-       function    GetANSIParam: integer; virtual;
-       { --- ANSI functions --- }
-       procedure   PushCurPos; virtual;
-       procedure   PopCurPos; virtual;
-       procedure   CursorUp(LineCount: integer); virtual;
-       procedure   CursorDown(LineCount: integer); virtual;
-       procedure   CursorForward(CharCount: integer); virtual;
-       procedure   CursorBack(CharCount: integer); virtual;
-       procedure   SetAttr(Color: integer); virtual;
-     end;
-
-{$ifdef WITH_CRT}
-     PCrtConsole = ^TCrtConsole;
-     TCrtConsole = object(TANSIConsole)
-       constructor Init(AReplyHook, AKeyHook, AWriteHook: PHookProc);
-       procedure   CursorOn; virtual;
-       procedure   CursorOff; virtual;
-       procedure   ClrScr; virtual;
-       procedure   ClrEol; virtual;
-       procedure   WriteChar(C: char); virtual;
-       procedure   DelLine(LineCount: integer); virtual;
-       procedure   InsLine(LineCount: integer); virtual;
-       procedure   UpdateCursor; virtual;
-       procedure   TextBackground(Color: byte); virtual;
-       procedure   TextColor(Color: byte); virtual;
-     end;
-{$endif WITH_CRT}
-
-     PANSIView = ^TANSIView;
-
-     PANSIViewConsole = ^TANSIViewConsole;
-     TANSIViewConsole = object(TANSIConsole)
-       Owner : PANSIView;
-       constructor Init(AOwner: PANSIView);
-       procedure   CursorOn; virtual;
-       procedure   CursorOff; virtual;
-       procedure   ClrScr; virtual;
-       procedure   ClrEol; virtual;
-       procedure   WriteChar(C: char); virtual;
-       procedure   DelLine(LineCount: integer); virtual;
-       procedure   InsLine(LineCount: integer); virtual;
-       procedure   UpdateCursor; virtual;
-       procedure   GotoXY(X,Y: integer); virtual;
-     end;
-
-     TVideoBuf = array[0..MaxViewWidth*MaxVideoLine] of word;
-
-     TANSIView = object(TScroller)
-       Console : PANSIViewConsole;
-       Buffer  : TVideoBuf;
-       LockCount : word;
-       constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:PScrollBar);
-       function    LoadFile(const FileName: string): boolean;
-       procedure   Draw; virtual;
-       destructor  Done; virtual;
-       procedure   Write(S: string); virtual;
-       procedure   WriteLn(S: string); virtual;
-       procedure   Lock; virtual;
-       procedure   UnLock; virtual;
-       procedure   ChangeBounds(var Bounds: TRect); virtual;
-       procedure   HandleEvent(var Event: TEvent); virtual;
-       private
-     end;
-
-     PANSIBackground = ^TANSIBackground;
-
-     PANSIBackgroundConsole = ^TANSIBackgroundConsole;
-     TANSIBackgroundConsole = object(TANSIConsole)
-       Owner : PANSIBackground;
-       constructor Init(AOwner: PANSIBackground);
-       procedure   CursorOn; virtual;
-       procedure   CursorOff; virtual;
-       procedure   ClrScr; virtual;
-       procedure   ClrEol; virtual;
-       procedure   WriteChar(C: char); virtual;
-       procedure   DelLine(LineCount: integer); virtual;
-       procedure   InsLine(LineCount: integer); virtual;
-       procedure   UpdateCursor; virtual;
-       procedure   GotoXY(X,Y: integer); virtual;
-     end;
-
-     TANSIBackground = object(TBackground)
-       Console : PANSIBackgroundConsole;
-       Buffer  : TVideoBuf;
-       LockCount : word;
-       constructor Init(var Bounds: TRect);
-       function    LoadFile(const FileName: string): boolean;
-       procedure   Draw; virtual;
-       destructor  Done; virtual;
-       procedure   Write(S: string); virtual;
-       procedure   WriteLn(S: string); virtual;
-       procedure   Lock; virtual;
-       procedure   UnLock; virtual;
-       procedure   ChangeBounds(var Bounds: TRect); virtual;
-       procedure   HandleEvent(var Event: TEvent); virtual;
-       private
-     end;
-
-implementation
-
-uses WUtils;
-
-constructor TConsoleObject.Init(AReplyHook, AKeyHook, AWriteHook: PHookProc);
-begin
-  inherited Init;
-  ReplyHook:=AReplyHook; KeyHook:=AKeyHook; WriteHook:=AWriteHook;
-  BoundChecks:=bc_All; LineWrapping:=true;
-  TextColor(LightGray); TextBackground(Black);
-  NormVideo;
-  ClrScr;
-end;
-
-procedure TConsoleObject.Home;
-begin
-  GotoXY(1,1);
-end;
-
-procedure TConsoleObject.ClrScr;
-begin
-  Abstract;
-end;
-
-procedure TConsoleObject.FillScreen(B: byte);
-var X,Y: integer;
-    S  : string;
-begin
-  GotoXY(1,1);
-  for Y:=1 to Size.Y do
-      begin
-        S:='';
-        for X:=1 to Size.X do S:=S+chr(B);
-        WriteLn(S);
-      end;
-end;
-
-procedure TConsoleObject.ClrEol;
-begin
-  Abstract;
-end;
-
-procedure TConsoleObject.GotoXY(X,Y: integer);
-begin
-  if (BoundChecks and bc_MinX)<>0 then X:=Max(X,1);
-  if (BoundChecks and bc_MaxX)<>0 then
-     if LineWrapping then while (X>Size.X) and (Size.X<>0)
-                                do begin
-                                     Inc(Y);
-                                     X:=X-Size.X;
-                                   end
-                     else X:=Min(X,Size.X);
-  if (BoundChecks and bc_MinY)<>0 then Y:=Max(Y,1);
-  if (BoundChecks and bc_MaxY)<>0 then Y:=Min(Y,Size.Y);
-  CurPos.X:=X; CurPos.Y:=Y;
-  UpdateCursor;
-end;
-
-procedure TConsoleObject.ProcessChar(C: char);
-begin
-  WriteChar(C);
-end;
-
-procedure TConsoleObject.WriteChar(C: char);
-begin
-  Abstract;
-end;
-
-procedure TConsoleObject.Write(S: string); {assembler;
-asm
-  push   ds
-  lds    si, S
-  lodsb
-  xor    ah, ah
-  mov    cx, ax
-@loop:
-  or     cx, cx
-  je     @exitloop
-  lodsb
-  pop    ds
-  push   ax
-  call   ProcessChar
-  push   ds
-  dec    cx
-  jmp    @loop
-@exitloop:
-  pop    ds
-end;}
-var Len: byte;
-    I  : byte;
-begin
-  Len:=length(S);
-  for I:=1 to Len do ProcessChar(S[I]);
-end;
-
-procedure TConsoleObject.WriteLn(S: string);
-begin
-  Write(S+#10);
-end;
-
-procedure TConsoleObject.DelLine(LineCount: integer);
-begin
-  Abstract;
-end;
-
-procedure TConsoleObject.InsLine(LineCount: integer);
-begin
-  Abstract;
-end;
-
-procedure TConsoleObject.NormVideo;
-begin
-  BoldOn:=false; BlinkOn:=false;
-  TextColor(LightGray);
-  TextBackground(Black);
-end;
-
-procedure TConsoleObject.BlinkVideo;
-begin
-  BlinkOn:=true;
-  TextBackground(TextAttr shr 4);
-end;
-
-procedure TConsoleObject.NoBlinkVideo;
-begin
-  BlinkOn:=false;
-  TextBackground(TextAttr shr 4);
-end;
-
-procedure TConsoleObject.HighVideo;
-begin
-  BoldOn:=true;
-  TextColor(TextAttr);
-end;
-
-procedure TConsoleObject.LowVideo;
-begin
-  BoldOn:=false;
-  TextColor(TextAttr);
-end;
-
-procedure TConsoleObject.TextBackground(Color: byte);
-begin
-  if BlinkOn=false then TextAttr:=TextAttr and $7f;
-  TextAttr:=(TextAttr and $0f) or (Color shl 4) or byte(BlinkOn)*$80;
-end;
-
-procedure TConsoleObject.TextColor(Color: byte);
-begin
-  if BoldOn=false then TextAttr:=TextAttr and not $08;
-  TextAttr:=((TextAttr and $f0) or (Color and $0f) or byte(BoldOn)*$08);
-end;
-
-function TConsoleObject.WhereX: integer;
-begin
-  WhereX:=CurPos.X;
-end;
-
-function TConsoleObject.WhereY: integer;
-begin
-  WhereY:=CurPos.Y;
-end;
-
-procedure TConsoleObject.CursorOn;
-begin
-  Abstract;
-end;
-
-procedure TConsoleObject.CursorOff;
-begin
-  Abstract;
-end;
-
-procedure TConsoleObject.UpdateCursor;
-begin
-  Abstract;
-end;
-
-procedure TConsoleObject.Reply(S: string);
-begin
-  if ReplyHook<>nil then ReplyHook^(S);
-end;
-
-procedure TConsoleObject.PutKey(S: string);
-begin
-  if KeyHook<>nil then KeyHook^(S);
-end;
-
-destructor TConsoleObject.Done;
-begin
-  inherited Done;
-end;
-
-{$ifdef WITH_CRT}
-constructor TCrtConsole.Init(AReplyHook, AKeyHook, AWriteHook: PHookProc);
-begin
-  inherited Init(AReplyHook, AKeyHook, AWriteHook);
-  Size.X:=Lo(Crt.WindMax); Size.Y:=Hi(Crt.WindMax);
-end;
-
-procedure TCrtConsole.CursorOn;
-begin
-end;
-
-procedure TCrtConsole.CursorOff;
-begin
-end;
-
-procedure TCrtConsole.ClrScr;
-begin
-  Crt.ClrScr;
-  GotoXY(Crt.WhereX,Crt.WhereY);
-end;
-
-procedure TCrtConsole.ClrEol;
-begin
-  Crt.ClrEol;
-  GotoXY(Crt.WhereX,Crt.WhereY);
-end;
-
-procedure TCrtConsole.WriteChar(C: char);
-{var OK: boolean;}
-begin
-{  OK:=((C>=#32) and (WhereX<Size.X)) or (C<#32);
-  if OK then
-  begin}
-  System.Write(C);
-  GotoXY(Crt.WhereX,Crt.WhereY);
-{  end
-  else Inc(CurPos.X);}
-end;
-
-procedure TCrtConsole.DelLine(LineCount: integer);
-var I: integer;
-begin
-  for I:=1 to LineCount do Crt.DelLine;
-end;
-
-procedure TCrtConsole.InsLine(LineCount: integer);
-var I: integer;
-begin
-  for I:=1 to LineCount do Crt.InsLine;
-end;
-
-procedure TCrtConsole.UpdateCursor;
-begin
-  Crt.GotoXY(CurPos.X,CurPos.Y);
-end;
-
-procedure TCrtConsole.TextBackground(Color: byte);
-begin
-  inherited TextBackground(Color);
-  Crt.TextAttr:=TextAttr;
-end;
-
-procedure TCrtConsole.TextColor(Color: byte);
-begin
-  inherited TextColor(Color);
-  Crt.TextAttr:=TextAttr;
-end;
-{$endif WITH_CRT}
-
-constructor TANSIConsole.Init(AReplyHook, AKeyHook, AWriteHook: PHookProc);
-begin
-  inherited Init(AReplyHook, AKeyHook, AWriteHook);
-  BoundChecks:=bc_MaxX;
-  ANSIParam:=''; ANSILevel:=0; ANSICurPosStackPtr:=0;
-end;
-
-procedure TANSIConsole.ProcessChar(C: char);
-var SkipThis : boolean;
-    ANSIDone : boolean;
-    X,Y,Z    : integer;
-begin
-  SkipThis:=false;
-  if C=Esc then begin ANSILevel:=1; SkipThis:=true; end else
-  if (ANSILevel=1) then
-     begin
-       ANSILevel:=0;
-       case C of
-            '[' : begin ANSILevel:=2; SkipThis:=true; end;
-       end;
-     end;
-  if SkipThis=false then
-  if (ANSILevel=2)
-     then begin
-            ANSIDone:=true;
-            case C of
-                 'H','f' : if ANSIParam='' then GotoXY(1,1) else
-                           begin
-                             X:=WhereX; Y:=WhereY;
-                             Z:=Pos(';',ANSIParam);
-                             if Z=0
-                                then Y:=GetANSIParam
-                                else if Z=1 then X:=GetANSIParam
-                                            else begin Y:=GetANSIParam; X:=GetANSIParam; end;
-                             GotoXY(X,Y);
-                           end;
-                 'A'     : if ANSIParam='' then CursorUp(1)
-                                           else CursorUp(GetANSIParam);
-                 'B'     : if ANSIParam='' then CursorDown(1)
-                                           else CursorDown(GetANSIParam);
-                 'C'     : if ANSIParam='' then CursorForward(1)
-                                           else CursorForward(GetANSIParam);
-                 'D'     : if ANSIParam='' then CursorBack(1)
-                                           else CursorBack(GetANSIParam);
-                 's'     : if ANSIParam='' then PushCurPos;
-                 'u'     : if ANSIParam='' then PopCurPos;
-                 'J'     : if ANSIParam='2' then begin ANSIParam:=''; ClrScr; end
-                                            else FillScreen(GetANSIParam);
-                 'K'     : if ANSIParam='' then ClrEol;
-                 'L'     : if ANSIParam='' then InsLine(1)
-                                           else InsLine(GetANSIParam);
-                 'M'     : if ANSIParam='' then DelLine(1)
-                                           else DelLine(GetANSIParam);
-                 'm'     : while ANSIParam<>'' do SetAttr(GetANSIParam);
-            else begin ANSIParam:=ANSIParam+C; ANSIDone:=false; end;
-            end;
-            if ANSIDone then
-               begin
-{$IFDEF DEBUG}
-                 if ANSIParam<>'' then RunError(240);
-{$ENDIF}
-                 ANSIParam:=''; ANSILevel:=0;
-               end;
-          end
-     else begin
-            WriteChar(C);
-            if C=#10 then WriteChar(#13);
-          end;
-end;
-
-function TANSIConsole.GetANSIParam: integer;
-var P: byte;
-    I,C: integer;
-begin
-  P:=Pos(';',ANSIParam);
-  if P=0 then P:=length(ANSIParam)+1;
-  Val(copy(ANSIParam,1,P-1),I,C);
-  if C<>0 then I:=0;
-  Delete(ANSIParam,1,P);
-  GetANSIParam:=I;
-end;
-procedure TANSIConsole.CursorUp(LineCount: integer);
-begin
-  GotoXY(WhereX,WhereY-LineCount);
-end;
-
-procedure TANSIConsole.CursorDown(LineCount: integer);
-begin
-  GotoXY(WhereX,WhereY+LineCount);
-end;
-
-procedure TANSIConsole.CursorForward(CharCount: integer);
-var X, Y: integer;
-begin
-  X:=WhereX; Y:=WhereY;
-  X:=X+CharCount;
-  while (X>Size.X) do
-        begin Inc(Y); Dec(X,Size.X); end;
-  GotoXY(X,Y);
-end;
-
-procedure TANSIConsole.CursorBack(CharCount: integer);
-var X, Y: integer;
-begin
-  X:=WhereX; Y:=WhereY;
-  X:=X-CharCount;
-  while (X<1) do begin Dec(Y); Inc(X,Size.X); end;
-  GotoXY(X,Y);
-end;
-
-procedure TANSIConsole.PushCurPos;
-begin
-  if ANSICurPosStackPtr=ANSICurPosStackSize then Exit;
-  Inc(ANSICurPosStackPtr);
-  ANSICurPosStack[ANSICurPosStackPtr].X:=WhereX;
-  ANSICurPosStack[ANSICurPosStackPtr].Y:=WhereY;
-end;
-
-procedure TANSIConsole.PopCurPos;
-begin
-  if ANSICurPosStackPtr=0 then Exit;
-  GotoXY(ANSICurPosStack[ANSICurPosStackPtr].X,ANSICurPosStack[ANSICurPosStackPtr].Y);
-  Dec(ANSICurPosStackPtr);
-end;
-
-procedure TANSIConsole.SetAttr(Color: integer);
-const ColorTab : array[0..7] of byte =
-      (Black,Red,Green,Brown,Blue,Magenta,Cyan,LightGray);
-begin
-  case Color of
-    0      : NormVideo;
-    1      : HighVideo;
-    5      : BlinkVideo;
-    7,27   : TextAttr:=(TextAttr shl 4) or (TextAttr shr 4);
-    8      : TextColor(TextAttr shr 4);
-    21,22  : LowVideo;
-    25     : NoBlinkVideo;
-    30..37 : TextColor(ColorTab[Color-30]);
-    40..47 : TextBackground(ColorTab[Color-40]);
-(*  else {$IFDEF DEBUG}begin system.writeln('Unknown attr : ',Color); Halt; end{$ENDIF};*)
-  end;
-end;
-
-constructor TANSIViewConsole.Init(AOwner: PANSIView);
-begin
-  if AOwner=nil then Fail;
-  inherited Init(nil,nil,nil);
-  Owner:=AOwner;
-  Size:=Owner^.Size;
-end;
-
-procedure TANSIViewConsole.CursorOn;
-begin
-  Owner^.ShowCursor;
-end;
-
-procedure TANSIViewConsole.CursorOff;
-begin
-  Owner^.HideCursor;
-end;
-
-procedure TANSIViewConsole.ClrScr;
-var X,Y: word;
-    Pos: longint;
-begin
-  GotoXY(1,1);
-  if Owner<>nil then
-  for X:=0 to MaxViewWidth-1 do for Y:=0 to Size.Y-1 do
-      begin
-        Pos:=(Owner^.Delta.Y*MaxViewWidth)+X+Y*MaxViewWidth;
-        Owner^.Buffer[Pos]:=32+256*word(TextAttr);
-      end;
-end;
-
-procedure TANSIViewConsole.ClrEol;
-var X,Y: word;
-    Pos: longint;
-begin
-  if Owner<>nil then
-  begin
-    Y:=CurPos.Y;
-    for X:=CurPos.X to MaxViewWidth-1 do
-        begin
-          Pos:=(Owner^.Delta.Y*MaxViewWidth)+X+Y*MaxViewWidth;
-          Owner^.Buffer[Pos]:=32+256*word(TextAttr);
-        end;
-  end;
-end;
-
-procedure TANSIViewConsole.WriteChar(C: char);
-var Pos: longint;
-begin
-  case C of
-       #8 : begin
-              CursorBack(1);
-              Pos:=(CurPos.Y-1)*MaxViewWidth+(WhereX-1);
-              Owner^.Buffer[Pos]:=ord(' ')+256*word(TextAttr);
-            end;
-       #0..#7,#9,
-       #11..#12,
-       #14..#31,
-       #32..#255
-            : begin
-                Pos:=(CurPos.Y-1)*MaxViewWidth+(WhereX-1);
-                Owner^.Buffer[Pos]:=ord(C)+256*word(TextAttr);
-                GotoXY(WhereX+1,WhereY);
-              end;
-       #10  :
-              GotoXY(WhereX,WhereY+1);
-       #13  :
-              GotoXY(1,WhereY);
-  else {$IFDEF DEBUG}RunError(241){$ENDIF};
-  end;
-end;
-
-procedure TANSIViewConsole.DelLine(LineCount: integer);
-begin
-  Abstract;
-end;
-
-procedure TANSIViewConsole.InsLine(LineCount: integer);
-begin
-  Abstract;
-end;
-
-procedure TANSIViewConsole.UpdateCursor;
-begin
-  if Owner<>nil then
-  if Owner^.LockCount=0 then Owner^.SetCursor(WhereX-1,WhereY-1);
-end;
-
-procedure TANSIViewConsole.GotoXY(X,Y: integer);
-var W: word;
-begin
-  if Owner<>nil then
-  while Y>MaxVideoLine do
-  begin
-    Move(Owner^.Buffer[MaxViewWidth],Owner^.Buffer,SizeOf(Owner^.Buffer)-(MaxViewWidth*2));
-    W:=(MaxViewWidth*MaxVideoLine)-1-(MaxViewWidth);
-    FillChar(Owner^.Buffer[W],MaxViewWidth*2,0);
-    Dec(Y);
-  end;
-  inherited GotoXY(X,Y);
-end;
-
-constructor TANSIView.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-    PScrollBar);
-begin
-  inherited Init(Bounds,AHScrollBar,AVScrollBar);
-  LockCount:=0; Options:=Options or ofTopSelect;
-  GrowMode:=gfGrowHiX or gfGrowHiY;
-  SetLimit({MaxViewWidth}80,MaxVideoLine);
-  New(Console, Init(@Self));
-  Console^.Size.X:=80; Console^.Size.Y:=25;
-  Console^.ClrScr;
-  Console^.CursorOn;
-end;
-
-function TANSIView.LoadFile(const FileName: string): boolean;
-var S: PBufStream;
-    OK: boolean;
-    B: array[0..1023] of char;
-    I,FragSize: integer;
-begin
-{$I-}
-  New(S, Init(FileName, stOpenRead, 4096));
-  OK:=Assigned(S);
-  while OK and (S^.Status=stOK) do
-  begin
-    FragSize:=Min(Sizeof(B),S^.GetSize-S^.GetPos);
-    if FragSize=0 then Break;
-    S^.Read(B,FragSize);
-    OK:=(S^.Status=stOK);
-    if OK then
-      for I:=0 to FragSize-1 do
-        self.Write(B[I]);
-  end;
-  if Assigned(S) then Dispose(S, Done); S:=nil;
-{$I+}
-  LoadFile:=OK;
-end;
-
-procedure TANSIView.Draw;
-var I: integer;
-    Pos: longint;
-    X,Y: integer;
-begin
-  if LockCount<>0 then Exit;
-  for I:=0 to Size.Y-1 do
-  begin
-    Pos:=Delta.X+(Delta.Y+I)*MaxViewWidth;
-    WriteLine(0,I,Size.X,1,Buffer[Pos]);
-  end;
-  if Console=nil then Exit;
-  X:=Console^.WhereX-Delta.X; Y:=Console^.WhereY-Delta.Y;
-  if (X<0) or (Y<0) or (X>Size.X-1) or (Y>Size.X-1)
-     then HideCursor
-     else begin
-            ShowCursor;
-            SetCursor(X-1,Y-1);
-          end;
-end;
-
-procedure TANSIView.Write(S: string);
-begin
-  Console^.Write(S);
-  DrawView;
-end;
-
-procedure TANSIView.WriteLn(S: string);
-begin
-  Console^.WriteLn(S);
-  DrawView;
-end;
-
-procedure TANSIView.Lock;
-begin
-  Inc(LockCount);
-end;
-
-procedure TANSIView.UnLock;
-begin
-  Dec(LockCount);
-  if LockCount=0 then DrawView;
-end;
-
-procedure TANSIView.ChangeBounds(var Bounds: TRect);
-begin
-  inherited ChangeBounds(Bounds);
-{  Console^.Size.X:=Size.X; Console^.Size.Y:=Size.Y;}
-end;
-
-procedure TANSIView.HandleEvent(var Event: TEvent);
-begin
-  inherited HandleEvent(Event);
-{  if Event.What=evKeyDown then
-     begin
-       if VScrollBar<>nil then VScrollBar^.HandleEvent(Event);
-       if HScrollBar<>nil then HScrollBar^.HandleEvent(Event);
-     end;}
-end;
-
-destructor TANSIView.Done;
-begin
-  Dispose(Console, Done);
-  inherited Done;
-end;
-
-constructor TANSIBackgroundConsole.Init(AOwner: PANSIBackground);
-begin
-  if AOwner=nil then Fail;
-  inherited Init(nil,nil,nil);
-  Owner:=AOwner;
-  Size:=Owner^.Size;
-end;
-
-procedure TANSIBackgroundConsole.CursorOn;
-begin
-  Owner^.ShowCursor;
-end;
-
-procedure TANSIBackgroundConsole.CursorOff;
-begin
-  Owner^.HideCursor;
-end;
-
-procedure TANSIBackgroundConsole.ClrScr;
-var X,Y: word;
-    Pos: longint;
-begin
-  GotoXY(1,1);
-  if Owner<>nil then
-  for X:=0 to MaxViewWidth-1 do
-    for Y:=0 to Size.Y-1 do
-      begin
-        Pos:=X+Y*MaxViewWidth;
-        Owner^.Buffer[Pos]:=32+256*word(TextAttr);
-      end;
-end;
-
-procedure TANSIBackgroundConsole.ClrEol;
-var X,Y: word;
-    Pos: longint;
-begin
-  if Owner<>nil then
-  begin
-    Y:=CurPos.Y;
-    for X:=CurPos.X to MaxViewWidth-1 do
-        begin
-          Pos:=X+Y*MaxViewWidth;
-          Owner^.Buffer[Pos]:=32+256*word(TextAttr);
-        end;
-  end;
-end;
-
-procedure TANSIBackgroundConsole.WriteChar(C: char);
-var Pos: longint;
-begin
-  case C of
-       #8 : begin
-              CursorBack(1);
-              Pos:=(CurPos.Y-1)*MaxViewWidth+(WhereX-1);
-              Owner^.Buffer[Pos]:=ord(' ')+256*word(TextAttr);
-            end;
-       #0..#7,#9,
-       #11..#12,
-       #14..#31,
-       #32..#255
-            : begin
-                Pos:=(CurPos.Y-1)*MaxViewWidth+(WhereX-1);
-                Owner^.Buffer[Pos]:=ord(C)+256*word(TextAttr);
-                GotoXY(WhereX+1,WhereY);
-              end;
-       #10  :
-              GotoXY(WhereX,WhereY+1);
-       #13  :
-              GotoXY(1,WhereY);
-  else {$IFDEF DEBUG}RunError(241){$ENDIF};
-  end;
-end;
-
-procedure TANSIBackgroundConsole.DelLine(LineCount: integer);
-begin
-  Abstract;
-end;
-
-procedure TANSIBackgroundConsole.InsLine(LineCount: integer);
-begin
-  Abstract;
-end;
-
-procedure TANSIBackgroundConsole.UpdateCursor;
-begin
-  if Owner<>nil then
-  if Owner^.LockCount=0 then Owner^.SetCursor(WhereX-1,WhereY-1);
-end;
-
-procedure TANSIBackgroundConsole.GotoXY(X,Y: integer);
-var W: word;
-begin
-  if Owner<>nil then
-  while Y>MaxVideoLine do
-  begin
-    Move(Owner^.Buffer[MaxViewWidth],Owner^.Buffer,SizeOf(Owner^.Buffer)-(MaxViewWidth*2));
-    W:=(MaxViewWidth*MaxVideoLine)-1-(MaxViewWidth);
-    FillChar(Owner^.Buffer[W],MaxViewWidth*2,0);
-    Dec(Y);
-  end;
-  inherited GotoXY(X,Y);
-end;
-
-constructor TANSIBackground.Init(var Bounds: TRect);
-begin
-  inherited Init(Bounds,' ');
-  LockCount:=0;
-  GrowMode:=gfGrowHiX or gfGrowHiY;
-  New(Console, Init(@Self));
-  Console^.Size.X:=132; Console^.Size.Y:=50;
-  Console^.ClrScr;
-  Console^.CursorOn;
-end;
-
-function TANSIBackground.LoadFile(const FileName: string): boolean;
-var S: PBufStream;
-    OK: boolean;
-    B: array[0..1023] of char;
-    I,FragSize: integer;
-begin
-{$I-}
-  New(S, Init(FileName, stOpenRead, 4096));
-  OK:=Assigned(S);
-  while OK and (S^.Status=stOK) do
-  begin
-    FragSize:=Min(Sizeof(B),S^.GetSize-S^.GetPos);
-    if FragSize=0 then Break;
-    S^.Read(B,FragSize);
-    OK:=(S^.Status=stOK);
-    if OK then
-      for I:=0 to FragSize-1 do
-        self.Write(B[I]);
-  end;
-  if Assigned(S) then Dispose(S, Done); S:=nil;
-{$I+}
-  LoadFile:=OK;
-end;
-
-procedure TANSIBackground.Draw;
-var I: integer;
-    Pos: longint;
-    X,Y: integer;
-begin
-  if LockCount<>0 then Exit;
-  for I:=0 to Size.Y-1 do
-  begin
-    Pos:=I*MaxViewWidth;
-    WriteLine(0,I,Size.X,1,Buffer[Pos]);
-  end;
-  if Console=nil then Exit;
-  X:=Console^.WhereX; Y:=Console^.WhereY;
-  if (X<0) or (Y<0) or (X>Size.X-1) or (Y>Size.X-1)
-     then HideCursor
-     else begin
-            ShowCursor;
-            SetCursor(X-1,Y-1);
-          end;
-end;
-
-procedure TANSIBackground.Write(S: string);
-begin
-  Console^.Write(S);
-  DrawView;
-end;
-
-procedure TANSIBackground.WriteLn(S: string);
-begin
-  Console^.WriteLn(S);
-  DrawView;
-end;
-
-procedure TANSIBackground.Lock;
-begin
-  Inc(LockCount);
-end;
-
-procedure TANSIBackground.UnLock;
-begin
-  Dec(LockCount);
-  if LockCount=0 then DrawView;
-end;
-
-procedure TANSIBackground.ChangeBounds(var Bounds: TRect);
-begin
-  inherited ChangeBounds(Bounds);
-{  Console^.Size.X:=Size.X; Console^.Size.Y:=Size.Y;}
-end;
-
-procedure TANSIBackground.HandleEvent(var Event: TEvent);
-begin
-  inherited HandleEvent(Event);
-{  if Event.What=evKeyDown then
-     begin
-       if VScrollBar<>nil then VScrollBar^.HandleEvent(Event);
-       if HScrollBar<>nil then HScrollBar^.HandleEvent(Event);
-     end;}
-end;
-
-destructor TANSIBackground.Done;
-begin
-  Dispose(Console, Done);
-  inherited Done;
-end;
-
-END.
-{
- $Log $
-
-}

+ 0 - 1858
ide/text/wcedit.pas

@@ -1,1858 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998-2000 by Berczi Gabor
-
-    Code editor template objects
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$i globdir.inc}
-unit WCEdit;
-
-interface
-
-uses Objects,Drivers,Views,
-     { necessary for ExistsFile }FPUtils,
-     WUtils,WEditor;
-
-type
-    PIndicator = ^TIndicator;
-    TIndicator = object(TView)
-      Location: TPoint;
-      Modified : Boolean;
-{$ifdef debug}
-      StoreUndo : Boolean;
-      SyntaxComplete : boolean;
-      UseTabs : Boolean;
-{$endif debug}
-      constructor Init(var Bounds: TRect);
-      procedure   Draw; virtual;
-      function    GetPalette: PPalette; virtual;
-      procedure   SetState(AState: Word; Enable: Boolean); virtual;
-      procedure   SetValue(ALocation: TPoint; AModified: Boolean);
-    end;
-
-    PLine = ^TLine;
-    TLine = object(TCustomLine)
-    public { internal use only! }
-      Text        : PString;
-      EditorInfos : PEditorLineInfoCollection;
-      Flags       : longint;
-      Owner       : PCustomCodeEditorCore;
-      procedure AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor); virtual;
-      procedure RemoveEditorInfo(AEditor: PCustomCodeEditor); virtual;
-    public
-      constructor Init(AOwner: PCustomCodeEditorCore; const AText: string; AFlags: longint);
-      function    GetText: string; virtual;
-      procedure   SetText(const AText: string); virtual;
-      function    GetEditorInfo(Editor: PCustomCodeEditor): PEditorLineInfo; virtual;
-      function    GetFlags: longint; virtual;
-      procedure   SetFlags(AFlags: longint); virtual;
-      destructor  Done; virtual;
-    end;
-
-    PCodeEditorCore = ^TCodeEditorCore;
-    TCodeEditorCore = object(TCustomCodeEditorCore)
-    {$ifdef TP}public{$else}protected{$endif}
-      Lines      : PLineCollection;
-      CanUndo    : Boolean;
-      StoreUndo  : boolean;
-      Modified   : Boolean;
-      ReadOnly   : Boolean;
-      TabSize    : integer;
-    {$ifdef UNDO}public{$endif}
-      UndoList   : PEditorActionCollection;
-      RedoList   : PEditorActionCollection;
-    public
-      constructor Init;
-      destructor  Done; virtual;
-    public
-      function    GetModified: boolean; virtual;
-      procedure   SetModified(AModified: boolean); virtual;
-      function    GetTabSize: integer; virtual;
-      procedure   SetTabSize(ATabSize: integer); virtual;
-      function    GetStoreUndo: boolean; virtual;
-      procedure   SetStoreUndo(AStore: boolean); virtual;
-      function    GetSyntaxCompleted: boolean; virtual;
-      procedure   SetSyntaxCompleted(SC : boolean); virtual;
-      function    GetLastSyntaxedLine: sw_integer; virtual;
-      procedure   SetLastSyntaxedLine(ALine: sw_integer); virtual;
-    public
-      { Storage }
-    {$ifdef TP}public{$else}protected{$endif}
-      { Text & info storage abstraction }
-      procedure   ISetLineFlagState(Binding: PEditorBinding; LineNo: sw_integer; Flag: longint; ASet: boolean); virtual;
-      procedure   IGetDisplayTextFormat(Binding: PEditorBinding; LineNo: sw_integer;var DT,DF:string); virtual;
-      function    IGetLineFormat(Binding: PEditorBinding; LineNo: sw_integer): string; virtual;
-      procedure   ISetLineFormat(Binding: PEditorBinding; LineNo: sw_integer;const S: string); virtual;
-    public
-      { Text & info storage abstraction }
-      function    GetLineCount: sw_integer; virtual;
-      function    GetLine(LineNo: sw_integer): PCustomLine; virtual;
-      function    GetLineText(LineNo: sw_integer): string; virtual;
-      procedure   SetDisplayText(I: sw_integer;const S: string); virtual;
-      function    GetDisplayText(I: sw_integer): string; virtual;
-      procedure   SetLineText(I: sw_integer;const S: string); virtual;
-      procedure   DeleteAllLines; virtual;
-      procedure   DeleteLine(I: sw_integer); virtual;
-      function    InsertLine(LineNo: sw_integer; const S: string): PCustomLine; virtual;
-      procedure   AddLine(const S: string); virtual;
-      procedure   GetContent(ALines: PUnsortedStringCollection); virtual;
-      procedure   SetContent(ALines: PUnsortedStringCollection); virtual;
-   public
-     { Undo info storage }
-      procedure   AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string); virtual;
-      procedure   AddGroupedAction(AAction : byte); virtual;
-      procedure   CloseGroupedAction(AAction : byte); virtual;
-      function    GetUndoActionCount: sw_integer; virtual;
-      function    GetRedoActionCount: sw_integer; virtual;
-    private
-      procedure LinesInsert(Idx: sw_integer; Line: PLine);
-    end;
-
-    PCodeEditor = ^TCodeEditor;
-    TCodeEditor = object(TCustomCodeEditor)
-      Core       : PCodeEditorCore;
-      Flags      : longint;
-      Indicator  : PIndicator;
-      HighlightRow: sw_integer;
-      DebuggerRow: sw_integer;
-      CodeCompleteFrag: PString;
-      CodeCompleteWord: PString;
-      ReadOnly   : boolean;
-      CompleteState: TCompleteState;
-      ErrorMessage: PString;
-      IndicatorDrawCalled  : boolean;
-      Folds      : PFoldCollection;
-      MaxFoldLevel: sw_integer;
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-          PScrollBar; AIndicator: PIndicator; ACore: PCodeEditorCore);
-    public
-      procedure   DrawIndicator; virtual;
-    public
-      function    GetFlags: longint; virtual;
-      procedure   SetFlags(AFlags: longint); virtual;
-      function    GetModified: boolean; virtual;
-      procedure   SetModified(AModified: boolean); virtual;
-      function    GetStoreUndo: boolean; virtual;
-      procedure   SetStoreUndo(AStore: boolean); virtual;
-      function    GetSyntaxCompleted: boolean; virtual;
-      procedure   SetSyntaxCompleted(SC : boolean); virtual;
-      function    GetLastSyntaxedLine: sw_integer; virtual;
-      procedure   SetLastSyntaxedLine(ALine: sw_integer); virtual;
-      function    GetTabSize: integer; virtual;
-      procedure   SetTabSize(ATabSize: integer); virtual;
-      function    IsReadOnly: boolean; virtual;
-    public
-      procedure   UpdateIndicator; virtual;
-      procedure   ModifiedChanged; virtual;
-      procedure   PositionChanged; virtual;
-      procedure   LimitsChanged; virtual;
-      function    IsClipboard: Boolean; virtual;
-      function    LoadFromStream(Stream: PStream): boolean; virtual;
-      function    SaveToStream(Stream: PStream): boolean; virtual;
-      function    SaveAreaToStream(Stream: PStream; StartP,EndP: TPoint): boolean;virtual;
-      destructor  Done; virtual;
-    public
-{      ChangedLine : sw_integer;}
-      { Text & info storage abstraction }
-      function    GetLineCount: sw_integer; virtual;
-      function    GetLine(LineNo: sw_integer): PCustomLine; virtual;
-      function    CharIdxToLinePos(Line,CharIdx: sw_integer): sw_integer; virtual;
-      function    LinePosToCharIdx(Line,X: sw_integer): sw_integer; virtual;
-      function    GetLineText(I: sw_integer): string; virtual;
-      procedure   SetDisplayText(I: sw_integer;const S: string); virtual;
-      function    GetDisplayText(I: sw_integer): string; virtual;
-      procedure   SetLineText(I: sw_integer;const S: string); virtual;
-      procedure   GetDisplayTextFormat(I: sw_integer;var DT,DF:string); virtual;
-      function    GetLineFormat(I: sw_integer): string; virtual;
-      procedure   SetLineFormat(I: sw_integer;const S: string); virtual;
-      procedure   DeleteAllLines; virtual;
-      procedure   DeleteLine(I: sw_integer); virtual;
-      function    InsertLine(LineNo: sw_integer; const S: string): PCustomLine; virtual;
-      procedure   AddLine(const S: string); virtual;
-      function    GetErrorMessage: string; virtual;
-      procedure   SetErrorMessage(const S: string); virtual;
-      procedure   GetContent(ALines: PUnsortedStringCollection); virtual;
-      procedure   SetContent(ALines: PUnsortedStringCollection); virtual;
-      procedure   Lock; virtual;
-      procedure   UnLock; virtual;
-    public
-     { CodeComplete support }
-      function    GetCodeCompleteWord: string; virtual;
-      procedure   SetCodeCompleteWord(const S: string); virtual;
-      function    GetCodeCompleteFrag: string; virtual;
-      procedure   SetCodeCompleteFrag(const S: string); virtual;
-      function    GetCompleteState: TCompleteState; virtual;
-      procedure   SetCompleteState(AState: TCompleteState); virtual;
-   public
-      { Syntax highlight }
-   {a}function    UpdateAttrs(FromLine: sw_integer; Attrs: byte): sw_integer; virtual;
-   {a}function    UpdateAttrsRange(FromLine, ToLine: sw_integer; Attrs: byte): sw_integer; virtual;
-   public
-     { Undo info storage }
-      procedure   AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string); virtual;
-      procedure   AddGroupedAction(AAction : byte); virtual;
-      procedure   CloseGroupedAction(AAction : byte); virtual;
-      function    GetUndoActionCount: sw_integer; virtual;
-      function    GetRedoActionCount: sw_integer; virtual;
-      procedure   JumpToLastCursorPos; virtual;
-      procedure   Undo; virtual;
-      procedure   Redo; virtual;
-     { Fold support }
-      function    GetMaxFoldLevel: sw_integer; virtual;
-      function    GetFoldCount: sw_integer; virtual;
-      function    GetFold(Index: sw_integer): PFold; virtual;
-      procedure   RegisterFold(AFold: PFold); virtual;
-      procedure   UnRegisterFold(AFold: PFold); virtual;
-    end;
-
-    PFileEditor = ^TFileEditor;
-    TFileEditor = object(TCodeEditor)
-      FileName: string;
-      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-          PScrollBar; AIndicator: PIndicator; ACore: PCodeEditorCore; const AFileName: string);
-      function    Save: Boolean; virtual;
-      function    SaveAs: Boolean; virtual;
-      function    SaveAsk(Force: boolean): Boolean; virtual;
-      function    LoadFile: boolean; virtual;
-      function    SaveFile: boolean; virtual;
-      function    Valid(Command: Word): Boolean; virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      function    ShouldSave: boolean; virtual;
-      function    IsChangedOnDisk : boolean;
-    public
-      procedure   BindingsChanged; virtual;
-    private
-      OnDiskLoadTime : longint;
-    end;
-
-function DefUseSyntaxHighlight(Editor: PFileEditor): boolean;
-function DefUseTabsPattern(Editor: PFileEditor): boolean;
-
-const
-     DefaultCodeEditorFlags : longint =
-       efBackupFiles+efInsertMode+efAutoIndent+efPersistentBlocks+
-       {efUseTabCharacters+}efBackSpaceUnindents+efSyntaxHighlight+
-       efExpandAllTabs+efCodeComplete{+efFolds};
-     DefaultTabSize     : integer = 8;
-     UseSyntaxHighlight : function(Editor: PFileEditor): boolean = DefUseSyntaxHighlight;
-     UseTabsPattern     : function(Editor: PFileEditor): boolean = DefUseTabsPattern;
-
-procedure RegisterWCEdit;
-
-implementation
-
-uses Dos,
-     Commands,App,WViews;
-
-{$ifndef NOOBJREG}
-const
-  RIndicator: TStreamRec = (
-     ObjType: 1100;
-     VmtLink: Ofs(TypeOf(TIndicator)^);
-     Load:    @TIndicator.Load;
-     Store:   @TIndicator.Store
-  );
-  RCodeEditor: TStreamRec = (
-     ObjType: 1101;
-     VmtLink: Ofs(TypeOf(TCodeEditor)^);
-     Load:    @TCodeEditor.Load;
-     Store:   @TCodeEditor.Store
-  );
-  RFileEditor: TStreamRec = (
-     ObjType: 1102;
-     VmtLink: Ofs(TypeOf(TFileEditor)^);
-     Load:    @TFileEditor.Load;
-     Store:   @TFileEditor.Store
-  );
-{$endif}
-
-constructor TLine.Init(AOwner: PCustomCodeEditorCore; const AText: string; AFlags: longint);
-begin
-  inherited Init(AText,AFlags);
-  New(EditorInfos, Init(10,10));
-  Owner:=AOwner;
-end;
-
-procedure TLine.AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor);
-begin
-  EditorInfos^.AtInsert(Index,New(PEditorLineInfo, Init(AEditor)));
-end;
-
-procedure TLine.RemoveEditorInfo(AEditor: PCustomCodeEditor);
-var E: PEditorLineInfo;
-begin
-  E:=GetEditorInfo(AEditor);
-  EditorInfos^.Free(E);
-end;
-
-function TLine.GetText: string;
-begin
-  GetText:=GetStr(Text);
-end;
-
-procedure TLine.SetText(const AText: string);
-begin
-  SetStr(Text,AText);
-end;
-
-function TLine.GetEditorInfo(Editor: PCustomCodeEditor): PEditorLineInfo;
-function Match(P: PEditorLineInfo): boolean; {$ifdef TP}far;{$endif}
-begin
-  Match:=P^.Editor=Editor;
-end;
-begin
-  GetEditorInfo:=EditorInfos^.FirstThat(@Match);
-end;
-
-function TLine.GetFlags: longint;
-begin
-  GetFlags:=Flags;
-end;
-
-procedure TLine.SetFlags(AFlags: longint);
-begin
-  Flags:=AFlags;
-  if Assigned(Owner) then
-    Owner^.ContentsChanged;
-end;
-
-destructor TLine.Done;
-begin
-  if Assigned(Text) then DisposeStr(Text); Text:=nil;
-  if Assigned(EditorInfos) then Dispose(EditorInfos, Done); EditorInfos:=nil;
-  inherited Done;
-end;
-
-constructor TCodeEditorCore.Init;
-begin
-  inherited Init;
-{$ifndef Undo}
-  StoreUndo:=false;
-{$else Undo}
-  StoreUndo:=true;
-{$endif def Undo}
-  new(UndoList,init(500,1000));
-  new(RedoList,init(500,1000));
-  New(Lines, Init(500,1000));
-  TabSize:=DefaultTabSize;
-end;
-
-function TCodeEditorCore.GetLineCount: sw_integer;
-begin
-  GetLineCount:=Lines^.Count;
-end;
-
-function TCodeEditorCore.GetLine(LineNo: sw_integer): PCustomLine;
-begin
-  GetLine:=Lines^.At(LineNo);
-end;
-
-function TCodeEditorCore.GetModified: boolean;
-begin
-  GetModified:=Modified;
-end;
-
-procedure TCodeEditorCore.SetModified(AModified: boolean);
-begin
-  if AModified<>Modified then
-  begin
-    Modified:=AModified;
-    ModifiedChanged;
-  end;
-end;
-
-function TCodeEditorCore.GetStoreUndo: boolean;
-begin
-  GetStoreUndo:=StoreUndo;
-end;
-
-procedure TCodeEditorCore.SetStoreUndo(AStore: boolean);
-begin
-  if StoreUndo<>AStore then
-  begin
-    StoreUndo:=AStore;
-    StoreUndoChanged;
-  end;
-end;
-
-function TCodeEditorCore.GetSyntaxCompleted: boolean;
-begin
-{$ifdef TEST_PARTIAL_SYNTAX}
-  GetSyntaxCompleted:=SyntaxComplete;
-{$else}
-  GetSyntaxCompleted:=true;
-{$endif}
-end;
-
-procedure TCodeEditorCore.SetSyntaxCompleted(SC: boolean);
-begin
-{$ifdef TEST_PARTIAL_SYNTAX}
-  if SC<>SyntaxComplete then
-    begin
-      SyntaxComplete:=SC;
-    end;
-{$endif}
-end;
-function TCodeEditorCore.GetLastSyntaxedLine: sw_integer;
-begin
-  GetLastSyntaxedLine:=LastSyntaxedLine;
-end;
-
-procedure TCodeEditorCore.SetLastSyntaxedLine(ALine: sw_integer);
-begin
-  LastSyntaxedLine:=ALine;
-end;
-
-
-procedure TCodeEditorCore.ISetLineFlagState(Binding: PEditorBinding; LineNo: sw_integer; Flag: longint; ASet: boolean);
-var P: PCustomLine;
-begin
-  if LineNo<GetLineCount then
-  begin
-    P:=GetLine(LineNo);
-    if assigned(P) then
-      P^.SetFlagState(Flag,ASet);
-  end;
-end;
-
-procedure TCodeEditorCore.GetContent(ALines: PUnsortedStringCollection);
-procedure AddIt(P: PCustomLine); {$ifndef FPC}far;{$endif}
-begin
-  if Assigned(P) then
-    ALines^.Insert(NewStr(P^.GetText));
-end;
-begin
-  if Assigned(Lines) then
-    Lines^.ForEach(@AddIt);
-end;
-
-procedure TCodeEditorCore.SetContent(ALines: PUnsortedStringCollection);
-procedure AddIt(P: PString); {$ifndef FPC}far;{$endif}
-begin
-  AddLine(GetStr(P));
-end;
-begin
-  DeleteAllLines;
-  if Assigned(ALines) then
-    ALines^.ForEach(@AddIt);
-  LimitsChanged;
-end;
-
-function TCodeEditorCore.GetTabSize: integer;
-begin
-  GetTabSize:=TabSize;
-end;
-
-procedure TCodeEditorCore.SetTabSize(ATabSize: integer);
-begin
-  if ATabSize<>TabSize then
-  begin
-    TabSize:=ATabSize;
-    TabSizeChanged;
-  end;
-end;
-
-function TCodeEditorCore.GetLineText(LineNo: sw_integer): string;
-var
-  L : PCustomLine;
-begin
-  GetLineText:='';
-  if LineNo<Lines^.Count then
-   begin
-     L:=Lines^.At(LineNo);
-     GetLineText:=L^.GetText;
-   end;
-end;
-
-procedure TCodeEditorCore.LinesInsert(Idx: sw_integer; Line: PLine);
-var I: sw_integer;
-procedure RegLine(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  Line^.AddEditorInfo(I,P^.Editor);
-  Inc(I);
-end;
-begin
-  if Idx=-1 then Idx:=Lines^.Count;
-  I:=0;
-  Bindings^.ForEach(@RegLine);
-  Lines^.AtInsert(Idx,Line);
-end;
-
-procedure TCodeEditorCore.SetLineText(I: sw_integer;const S: string);
-var
-  L : PCustomLine;
-  AddCount : Sw_Integer;
-begin
-  AddCount:=0;
-  while (Lines^.Count<I+1) do
-   begin
-     LinesInsert(-1,New(PLine, Init(@Self,'',0)));
-     Inc(AddCount);
-   end;
-  if AddCount>0 then
-   LimitsChanged;
-  L:=Lines^.At(I);
-  L^.SetText(S);
-  ContentsChanged;
-end;
-
-function TCodeEditorCore.GetDisplayText(I: sw_integer): string;
-begin
-  GetDisplayText:=ExtractTabs(GetLineText(I),GetTabSize);
-end;
-
-procedure TCodeEditorCore.SetDisplayText(I: sw_integer;const S: string);
-begin
-  { I disagree here
-    I don't want the editor to change the position of the tabs
-    in my makefiles !! PM
-  if FlagSet(efUseTabCharacters) and (TabSize>0) then
-   SetLineText(I,CompressUsingTabs(S,TabSize))
-  else                  }
-  { ... then you better make this optional - Gabor }
-   SetLineText(I,S);
-end;
-
-procedure TCodeEditorCore.IGetDisplayTextFormat(Binding: PEditorBinding; LineNo: sw_integer;var DT,DF:string);
-var
-  L : PCustomLine;
-  P,PAdd : SW_Integer;
-begin
-  DF:='';
-  DT:='';
-  if (0<=LineNo) and (LineNo<GetLineCount) then
-   begin
-     L:=GetLine(LineNo);
-     if not assigned(L) then
-       exit;
-     DF:=IGetLineFormat(Binding,LineNo);
-     DT:=L^.GetText;
-     p:=0;
-     while p<length(DT) do
-      begin
-        inc(p);
-        if DT[p]=#9 then
-         begin
-           PAdd:=TabSize-((p-1) mod TabSize);
-           if DF<>'' then
-            DF:=copy(DF,1,P-1)+CharStr(DF[p],PAdd)+copy(DF,P+1,High(DF));
-           DT:=copy(DT,1,P-1)+CharStr(' ',PAdd)+copy(DT,P+1,High(DF));
-           inc(P,PAdd-1);
-         end;
-      end;
-   end;
-end;
-
-function TCodeEditorCore.IGetLineFormat(Binding: PEditorBinding; LineNo: sw_integer): string;
-var P: PCustomLine;
-    LI: PEditorLineInfo;
-    S: string;
-begin
-  if (0<=LineNo) and (LineNo<GetLineCount) then
-    P:=GetLine(LineNo)
-  else
-    P:=nil;
-  if P=nil then LI:=nil else
-    LI:=P^.GetEditorInfo(Binding^.Editor);
-  if LI=nil then S:='' else S:=LI^.GetFormat;
-  IGetLineFormat:=S;
-end;
-
-procedure TCodeEditorCore.ISetLineFormat(Binding: PEditorBinding; LineNo: sw_integer;const S: string);
-var P: PCustomLine;
-    LI: PEditorLineInfo;
-begin
-  if (LineNo<GetLineCount) then
-  begin
-    P:=GetLine(LineNo);
-    if P=nil then LI:=nil else LI:=P^.GetEditorInfo(Binding^.Editor);
-    if Assigned(LI) then LI^.SetFormat(S);
-  end;
-end;
-
-procedure TCodeEditorCore.DeleteAllLines;
-begin
-  if Assigned(Lines) then
-    Lines^.FreeAll;
-end;
-
-procedure TCodeEditorCore.DeleteLine(I: sw_integer);
-var
- CP : Tpoint;
-begin
-  if I<Lines^.Count then
-    begin
-      if StoreUndo then
-        begin
-          CP.X:=0;CP.Y:=I;
-          AddAction(eaDeleteLine,CP,CP,GetLineText(I));
-       end;
-      Lines^.AtFree(I);
-    end;
-end;
-
-function TCodeEditorCore.InsertLine(LineNo: sw_integer; const S: string): PCustomLine;
-var L: PLine;
-begin
-  L:=New(PLine, Init(@Self,S,0));
-  LinesInsert(LineNo, L);
-  InsertLine:=L;
-end;
-
-procedure TCodeEditorCore.AddLine(const S: string);
-begin
-  LinesInsert(-1,New(PLine, Init(@Self,S,0)));
-end;
-
-procedure TCodeEditorCore.AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string);
-{$ifdef Undo}
-var
-  ActionIntegrated : boolean;
-  pa : PEditorAction;
-  S : String;
-{$endif Undo}
-begin
-{$ifdef Undo}
-  if (UndoList=nil) or (not StoreUndo) then Exit;
-  ActionIntegrated:=false;
-  if UndoList^.count>0 then
-    begin
-      pa:=UndoList^.At(UndoList^.count-1);
-      if (pa^.action=AAction) and
-         (pa^.EndPos.X=AStartPos.X) and
-         (pa^.EndPos.Y=AStartPos.Y) and
-         { do not group InsertLine and DeleteLine !! }
-         ((AAction=eaMoveCursor) or
-          (AAction=eaInsertText) or
-          (AAction=eaDeleteText))
-         then
-        begin
-          pa^.EndPos:=AEndPos;
-          S:=GetStr(pa^.text);
-          if S<>'' then
-           DisposeStr(pa^.text);
-          if (AAction=eaDeleteText) and
-             (AStartPos.X>AEndPos.X) then
-            pa^.text:=NewStr(AText+S)
-          else
-            pa^.text:=NewStr(S+AText);
-          ActionIntegrated:=true;
-        end;
-    end;
-  if not ActionIntegrated then
-    begin
-      UndoList^.Insert(New(PEditorAction,Init(AAction,AStartPos,AEndPos,AText)));
-      if assigned(UndoList^.CurrentGroupedAction) then
-        Inc(UndoList^.CurrentGroupedAction^.actionCount);
-      UpdateUndoRedo(cmUndo,AAction);
-    end;
-  if UndoList^.count>0 then
-  begin
-    UpdateUndoRedo(cmRedo,0);
-    RedoList^.FreeAll;
-  end;
-{$endif Undo}
-end;
-
-procedure TCodeEditorCore.AddGroupedAction(AAction : byte);
-begin
-{$ifdef Undo}
-  if Assigned(UndoList^.CurrentGroupedAction) then
-    inc(UndoList^.GroupLevel)
-  else
-    begin
-      UndoList^.CurrentGroupedAction:=New(PEditorAction,Init_group(AAction));
-      UndoList^.GroupLevel:=1;
-    end;
-{$endif Undo}
-end;
-
-procedure TCodeEditorCore.CloseGroupedAction(AAction : byte);
-begin
-{$ifdef Undo}
-  dec(UndoList^.GroupLevel);
-  if UndoList^.GroupLevel=0 then
-    begin
-      UndoList^.Insert(UndoList^.CurrentGroupedAction);
-      UndoList^.CurrentGroupedAction:=nil;
-      UpdateUndoRedo(cmUndo,AAction);
-    end;
-{$endif Undo}
-end;
-
-function TCodeEditorCore.GetUndoActionCount: sw_integer;
-begin
-  GetUndoActionCount:=UndoList^.Count;
-end;
-
-function TCodeEditorCore.GetRedoActionCount: sw_integer;
-begin
-  GetRedoActionCount:=RedoList^.Count;
-end;
-
-destructor TCodeEditorCore.Done;
-begin
-  inherited Done;
-  if Assigned(Lines) then Dispose(Lines, Done); Lines:=nil;
-  if Assigned(RedoList) then Dispose(RedoList, Done); RedoList:=nil;
-  if Assigned(UndoList) then Dispose(UndoList, Done); UndoList:=nil;
-end;
-
-constructor TIndicator.Init(var Bounds: TRect);
-begin
-  inherited Init(Bounds);
-  GrowMode := gfGrowLoY + gfGrowHiY;
-end;
-
-procedure TIndicator.Draw;
-var
-  Color: Byte;
-  Frame: Char;
-  L: array[0..1] of Longint;
-  S: String[15];
-  B: TDrawBuffer;
-begin
-  if (State and sfDragging = 0) and (State and sfActive <> 0) then
-   begin
-     Color := GetColor(1);
-     Frame := #205;
-   end
-  else
-   begin
-     if (State and sfDragging)<>0 then
-      Color := GetColor(2)
-     else
-      Color := GetColor(3);
-     Frame := #196;
-   end;
-  MoveChar(B, Frame, Color, Size.X);
-  if State and sfActive<>0 then
-   begin
-     if Modified then
-       WordRec (B[0]).Lo := ord('*');
-{$ifdef debug}
-     if StoreUndo then
-       WordRec (B[1]).Lo := ord('S');
-     if SyntaxComplete then
-       WordRec(B[2]).lo := ord('C');
-     if UseTabs then
-       WordRec(B[3]).lo := ord('T');
-{$endif debug}
-     L[0] := Location.Y + 1;
-     L[1] := Location.X + 1;
-     FormatStr(S, '%d:%d ', L);
-     MoveStr(B[8 - Pos(':', S)], S, Color);
-   end;
-  WriteBuf(0, 0, Size.X, 1, B);
-end;
-
-function TIndicator.GetPalette: PPalette;
-const
-  P: string[Length(CIndicator)] = CIndicator;
-begin
-  GetPalette := @P;
-end;
-
-procedure TIndicator.SetState(AState: Word; Enable: Boolean);
-begin
-  inherited SetState(AState, Enable);
-  if (AState = sfDragging) or (AState=sfActive) then
-   DrawView;
-end;
-
-procedure TIndicator.SetValue(ALocation: TPoint; AModified: Boolean);
-begin
-  if (Location.X<>ALocation.X) or
-     (Location.Y<>ALocation.Y) or
-     (Modified <> AModified) then
-  begin
-    Location := ALocation;
-    Modified := AModified;
-    DrawView;
-  end;
-end;
-
-{constructor TIndicator.Load(var S: TStream);
-begin
-  inherited Load(S);
-  S.Read(Location,SizeOf(Location));
-  S.Read(Modified,SizeOf(Modified));
-end;
-
-procedure TIndicator.Store(var S: TStream);
-begin
-  inherited Store(S);
-  S.Write(Location,SizeOf(Location));
-  S.Write(Modified,SizeOf(Modified));
-end;}
-
-{*****************************************************************************
-                TCodeEditor
-*****************************************************************************}
-
-constructor TCodeEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-          PScrollBar; AIndicator: PIndicator; ACore: PCodeEditorCore);
-begin
-  inherited Init(Bounds,AHScrollBar,AVScrollBar);
-  New(Folds, Init(100,100));
-  if ACore=nil then ACore:=New(PCodeEditorCore, Init);
-  Core:=ACore;
-  Core^.BindEditor(@Self);
-  SetState(sfCursorVis,true);
-  SetFlags(DefaultCodeEditorFlags);
-  SetCurPtr(0,0);
-  Indicator:=AIndicator;
-  UpdateIndicator;
-  LimitsChanged;
-end;
-
-function TCodeEditor.GetFlags: longint;
-begin
-  GetFlags:=Flags;
-end;
-
-procedure TCodeEditor.SetFlags(AFlags: longint);
-var OFlags: longint;
-begin
-  if AFlags<>Flags then
-  begin
-    OFlags:=Flags;
-    Flags:=AFlags;
-    FlagsChanged(OFlags);
-  end;
-end;
-
-function TCodeEditor.GetModified: boolean;
-begin
-  GetModified:=Core^.GetModified;
-end;
-
-procedure TCodeEditor.SetModified(AModified: boolean);
-begin
-  Core^.SetModified(AModified);
-end;
-
-function TCodeEditor.GetStoreUndo: boolean;
-begin
-  GetStoreUndo:=Core^.GetStoreUndo;
-end;
-
-procedure TCodeEditor.SetStoreUndo(AStore: boolean);
-begin
-  Core^.SetStoreUndo(AStore);
-end;
-
-function TCodeEditor.GetSyntaxCompleted: boolean;
-begin
-  GetSyntaxCompleted:=Core^.GetSyntaxCompleted;
-end;
-
-procedure TCodeEditor.SetSyntaxCompleted(SC : boolean);
-begin
-  Core^.SetSyntaxCompleted(SC);
-end;
-
-function TCodeEditor.GetLastSyntaxedLine: sw_integer;
-begin
-  GetLastSyntaxedLine:=Core^.GetLastSyntaxedLine;
-end;
-
-procedure TCodeEditor.SetLastSyntaxedLine(ALine: sw_integer);
-begin
-  Core^.SetLastSyntaxedLine(ALine);
-end;
-
-function TCodeEditor.GetTabSize: integer;
-begin
-  GetTabSize:=Core^.GetTabSize;
-end;
-
-procedure TCodeEditor.SetTabSize(ATabSize: integer);
-begin
-  Core^.SetTabSize(ATabSize);
-end;
-
-function TCodeEditor.IsReadOnly: boolean;
-begin
-  IsReadOnly:=ReadOnly or (Core^.ReadOnly);
-end;
-
-function TCodeEditor.IsClipboard: Boolean;
-begin
-  IsClipboard:=Core^.IsClipboard;
-end;
-
-function TCodeEditor.GetErrorMessage: string;
-begin
-  GetErrorMessage:=GetStr(ErrorMessage);
-end;
-
-procedure TCodeEditor.SetErrorMessage(const S: string);
-begin
-  SetStr(ErrorMessage,S);
-  DrawView;
-end;
-
-function TCodeEditor.GetLineCount: sw_integer;
-begin
-  GetLineCount:=Core^.GetLineCount;
-end;
-
-function TCodeEditor.GetLine(LineNo: sw_integer): PCustomLine;
-begin
-  GetLine:=Core^.GetLine(LineNo);
-end;
-
-function TCodeEditor.CharIdxToLinePos(Line,CharIdx: sw_integer): sw_integer;
-begin
-  CharIdxToLinePos:=Core^.CharIdxToLinePos(Line,CharIdx);
-end;
-
-function TCodeEditor.LinePosToCharIdx(Line,X: sw_integer): sw_integer;
-begin
-  LinePosToCharIdx:=Core^.LinePosToCharIdx(Line,X);
-end;
-
-function TCodeEditor.GetLineText(I: sw_integer): string;
-begin
-  GetLineText:=Core^.GetLineText(I);
-end;
-
-procedure TCodeEditor.SetDisplayText(I: sw_integer;const S: string);
-begin
-  Core^.SetDisplayText(I,S);
-end;
-
-function TCodeEditor.GetDisplayText(I: sw_integer): string;
-begin
-  GetDisplayText:=Core^.GetDisplayText(I);
-end;
-
-procedure TCodeEditor.SetLineText(I: sw_integer;const S: string);
-begin
-  Core^.SetLineText(I,S);
-end;
-
-procedure TCodeEditor.GetDisplayTextFormat(I: sw_integer;var DT,DF:string);
-begin
-  Core^.GetDisplayTextFormat(@Self,I,DT,DF);
-end;
-
-function TCodeEditor.GetLineFormat(I: sw_integer): string;
-begin
-  GetLineFormat:=Core^.GetLineFormat(@Self,I);
-end;
-
-procedure TCodeEditor.SetLineFormat(I: sw_integer;const S: string);
-begin
-  Core^.SetLineFormat(@Self,I,S);
-end;
-
-procedure TCodeEditor.DeleteAllLines;
-begin
-  Core^.DeleteAllLines;
-end;
-
-procedure TCodeEditor.DeleteLine(I: sw_integer);
-begin
-  Core^.DeleteLine(I);
-end;
-
-function TCodeEditor.InsertLine(LineNo: sw_integer; const S: string): PCustomLine;
-begin
-  InsertLine:=Core^.InsertLine(LineNo,S);
-end;
-
-procedure TCodeEditor.AddLine(const S: string);
-begin
-  Core^.AddLine(S);
-end;
-
-function TCodeEditor.GetMaxFoldLevel: sw_integer;
-begin
-  GetMaxFoldLevel:=MaxFoldLevel;
-end;
-
-procedure TCodeEditor.RegisterFold(AFold: PFold);
-var L: sw_integer;
-begin
-  if Assigned(Folds) then
-  begin
-    Folds^.Insert(AFold);
-    L:=AFold^.GetLevel+1;
-    if L>MaxFoldLevel then MaxFoldLevel:=L;
-  end;
-end;
-
-procedure TCodeEditor.UnRegisterFold(AFold: PFold);
-begin
-  if Assigned(Folds) then
-  begin
-    Folds^.Delete(AFold);
-    if Folds^.Count=0 then
-      MaxFoldLevel:=0
-    else
-      MaxFoldLevel:=inherited GetMaxFoldLevel+1;
-  end;
-end;
-
-function TCodeEditor.GetFoldCount: sw_integer;
-begin
-  GetFoldCount:=Folds^.Count;
-end;
-
-function TCodeEditor.GetFold(Index: sw_integer): PFold;
-begin
-  GetFold:=Folds^.At(Index);
-end;
-
-{function TCodeEditor.GetLineTextPos(Line,X: integer): integer;
-var
-  S: string;
-  rx,i : Sw_integer;
-begin
-  S:=GetLineText(Line);
-  i:=0; rx:=0;
-  while (RX<X) and (i<Length(s)) do
-   begin
-     inc(i);
-     inc(rx);
-     if s[i]=#9 then
-      inc(rx,TabSize-(rx mod tabsize));
-   end;
-  if RX<X then Inc(I,X-RX);
-  GetLineTextPos:=i;
-end;
-
-function TCodeEditor.GetDisplayTextPos(Line,X: integer): integer;
-var
-  S: string;
-  L: PCustomLine;
-  rx,i : Sw_integer;
-begin
-  S:='';
-  if Line<Lines^.Count then
-   begin
-     L:=Lines^.At(Line);
-     if assigned(L^.Text) then
-      S:=L^.Text^;
-   end;
-  i:=0;
-  rx:=0;
-  while (i<X) and (i<Length(s)) do
-   begin
-     inc(i);
-     inc(rx);
-     if s[i]=#9 then
-      inc(rx,TabSize-(rx mod tabsize));
-   end;
-  GetDisplayTextPos:=rx;
-end;}
-
-procedure TCodeEditor.GetContent(ALines: PUnsortedStringCollection);
-begin
-  Core^.GetContent(ALines);
-end;
-
-procedure TCodeEditor.SetContent(ALines: PUnsortedStringCollection);
-begin
-  Lock;
-  TextStart; HideSelect;
-  Core^.SetContent(ALines);
-  LimitsChanged;
-  if IsFlagSet(efSyntaxHighlight) then
-    Core^.UpdateAttrsRange(0,Min(Delta.Y+Size.Y,GetLineCount-1),
-      attrAll
-{$ifndef TEST_PARTIAL_SYNTAX}
-      +attrForceFull
-{$endif TEST_PARTIAL_SYNTAX}
-      );
-  TextStart;
-  UnLock;
-end;
-
-function TCodeEditor.GetCodeCompleteFrag: string;
-begin
-  GetCodeCompleteFrag:=GetStr(CodeCompleteFrag);
-end;
-
-procedure TCodeEditor.SetCodeCompleteFrag(const S: string);
-begin
-  SetStr(CodeCompleteFrag,S);
-end;
-
-function TCodeEditor.GetCompleteState: TCompleteState;
-begin
-  GetCompleteState:=CompleteState;
-end;
-
-procedure TCodeEditor.SetCompleteState(AState: TCompleteState);
-begin
-  if AState<>CompleteState then
-  begin
-    CompleteState:=AState;
-    if CompleteState<>csOffering then
-      ClearCodeCompleteWord;
-  end;
-end;
-
-function TCodeEditor.GetCodeCompleteWord: string;
-begin
-  GetCodeCompleteWord:=GetStr(CodeCompleteWord);
-end;
-
-procedure TCodeEditor.SetCodeCompleteWord(const S: string);
-begin
-  if Assigned(CodeCompleteWord) then DisposeStr(CodeCompleteWord);
-  CodeCompleteWord:=NewStr(S);
-  inherited SetCodeCompleteWord(S);
-end;
-
-procedure TCodeEditor.DrawIndicator;
-begin
-  if Assigned(Indicator) then
-    Indicator^.DrawView;
-end;
-
-procedure TCodeEditor.Lock;
-begin
-  inherited Lock;
-  Core^.Lock(@Self);
-end;
-
-procedure TCodeEditor.UnLock;
-begin
-  Core^.UnLock(@Self);
-  inherited UnLock;
-  If IndicatorDrawCalled then
-    begin
-      DrawIndicator;
-      IndicatorDrawCalled:=false;
-    end;
-end;
-
-procedure TCodeEditor.UpdateIndicator;
-begin
-  if Indicator<>nil then
-  begin
-    Indicator^.Location:=CurPos;
-    Indicator^.Modified:=GetModified;
-{$ifdef debug}
-    Indicator^.StoreUndo:=GetStoreUndo;
-{$ifdef TEST_PARTIAL_SYNTAX}
-    Indicator^.SyntaxComplete:=GetSyntaxCompleted and IsFlagSet(efSyntaxHighlight);
-{$endif TEST_PARTIAL_SYNTAX}
-    Indicator^.UseTabs:=IsFlagSet(efUseTabCharacters);
-{$endif debug}
-    if lockflag>0 then
-      IndicatorDrawCalled:=true
-    else
-      Indicator^.DrawView;
-  end;
-end;
-
-procedure TCodeEditor.LimitsChanged;
-begin
-  Core^.LimitsChanged;
-end;
-
-procedure TCodeEditor.ModifiedChanged;
-begin
-  UpdateIndicator;
-end;
-
-procedure TCodeEditor.PositionChanged;
-begin
-  UpdateIndicator;
-end;
-
-procedure TCodeEditor.JumpToLastCursorPos;
-{$ifdef Undo}
-var
-  pa : PEditorAction;
-{$endif Undo}
-begin
-{$ifdef Undo}
-  if (Core^.UndoList^.count>0) and (Core^.RedoList^.count=0) then
-    begin
-      { Or should we just call Undo ?? PM }
-      pa:=Core^.UndoList^.At(Core^.UndoList^.count-1);
-      if (pa^.action=eaMoveCursor) then
-        SetCurPtr(pa^.StartPos.X,pa^.StartPos.Y);
-    end;
-{$else not Undo}
-  NotImplemented;
-{$endif Undo}
-end;
-
-procedure TCodeEditor.Undo;
-{$ifdef Undo}
-var
-  Temp,Idx,Last,Count : Longint;
-  Is_grouped,Had_efNoIndent : boolean;
-  MaxY,MinY : sw_integer;
-
-  procedure SetMinMax(y : sw_integer);
-    begin
-      if MinY=-1 then
-        MinY:=Y;
-      if Y<MinY then
-        MinY:=Y;
-      if MaxY=-1 then
-        MaxY:=Y;
-      if Y>MaxY then
-        MaxY:=Y;
-    end;
-{$endif Undo}
-begin
-{$ifdef Undo}
-  Core^.SetStoreUndo(False);
-  Lock;
-  MinY:=-1;
-  MaxY:=-1;
-  if Core^.UndoList^.count > 0 then
-  begin
-    Last:=Core^.UndoList^.count-1;
-    if Core^.UndoList^.At(Last)^.Is_grouped_action then
-      begin
-        Count:=Core^.UndoList^.At(Last)^.ActionCount;
-        Dec(Last);
-        Is_grouped:=true;
-      end
-    else
-      begin
-        Count:=1;
-        Is_grouped:=false;
-      end;
-    for Idx:=Last downto Last-Count+1 do
-      with Core^.UndoList^.At(Idx)^ do
-        begin
-          case action of
-            eaMoveCursor :
-              begin
-                { move cursor back to original position }
-                SetCurPtr(startpos.x,startpos.y);
-              end;
-            eaInsertText :
-              begin
-                SetCurPtr(StartPos.X,StartPos.Y);
-                if assigned(text) then
-                  for Temp := 1 to length(Text^) do
-                    DelChar;
-                SetMinMax(StartPos.Y);
-              end;
-            eaDeleteText :
-              begin
-                { reinsert deleted text }
-                SetCurPtr(EndPos.X,EndPos.Y);
-                if assigned(text) then
-                  for Temp := 1 to length(Text^) do
-                    AddChar(Text^[Temp]);
-                SetMinMax(EndPos.Y);
-                SetCurPtr(StartPos.X,StartPos.Y);
-              end;
-            eaInsertLine :
-              begin
-                SetCurPtr(EndPos.X,EndPos.Y);
-                SetDisplayText(EndPos.Y,Copy(GetDisplayText(EndPos.Y),EndPos.X+1,255));
-                SetMinMax(EndPos.Y);
-                BackSpace;
-                SetCurPtr(StartPos.X,StartPos.Y);
-                SetMinMax(StartPos.Y);
-              end;
-            eaDeleteLine :
-              begin
-                SetCurPtr(EndPos.X,EndPos.Y);
-                SetMinMax(EndPos.Y);
-                Had_efNoIndent:=(GetFlags and efNoIndent)<>0;
-                SetFlags(GetFlags or efNoIndent);
-                InsertNewLine;
-                if not Had_efNoIndent then
-                  SetFlags(GetFlags and not efNoIndent);
-                {DelEnd; wrong for eaCut at least }
-                SetCurPtr(StartPos.X,StartPos.Y);
-                SetLineText(StartPos.Y,Copy(GetDisplayText(StartPos.Y),1,StartPos.X)+GetStr(Text));
-                SetMinMax(StartPos.Y);
-              end;
-            eaSelectionChanged :
-              begin
-                { move cursor to end of last set selection }
-              end;
-          else
-            { what the 'ell's an undefined action doing round 'ere mate! }
-            ;
-          end; { once this lot is done paste into redo and modify to suit needs }
-          { move item to redo stack }
-          Core^.RedoList^.Insert(Core^.UndoList^.At(Idx));
-          UpdateUndoRedo(cmRedo,Core^.UndoList^.At(Idx)^.Action);
-          Core^.UndoList^.atDelete(Idx);
-          If Idx>0 then
-            UpdateUndoRedo(cmUndo,Core^.UndoList^.At(Idx-1)^.Action)
-          else
-            UpdateUndoRedo(cmUndo,0);
-        end;{Idx loop for grouped actions }
-      if is_grouped then
-        begin
-          Idx:=Core^.UndoList^.Count-1;
-          Core^.RedoList^.Insert(Core^.UndoList^.At(Idx));
-          UpdateUndoRedo(cmRedo,Core^.UndoList^.At(Idx)^.Action);
-          Core^.UndoList^.atDelete(Idx);
-          If Idx>0 then
-            UpdateUndoRedo(cmUndo,Core^.UndoList^.At(Idx-1)^.Action)
-          else
-            UpdateUndoRedo(cmUndo,0);
-        end;
-      if Core^.UndoList^.count=0 then
-        SetCmdState(UndoCmd,false);
-      SetCmdState(RedoCmd,true);
-      Message(Application,evBroadcast,cmCommandSetChanged,nil);
-      if MinY<>-1 then
-        UpdateAttrsRange(MinY,MaxY,attrAll);
-      DrawView;
-    end;
-  Core^.SetStoreUndo(True);
-  Unlock;
-{$else}
-  NotImplemented; Exit;
-{$endif Undo}
-end;
-
-procedure TCodeEditor.Redo;
-{$ifdef Undo}
-var
-  Temp,Idx,Last,Count : Longint;
-  Is_grouped,Had_efNoIndent : boolean;
-{$endif Undo}
-begin
-{$ifdef Undo}
-  Core^.SetStoreUndo(False);
-  Lock;
-  if Core^.RedoList^.count <> 0 then
-   begin
-    Last:=Core^.RedoList^.count-1;
-    if Core^.RedoList^.At(Last)^.Is_grouped_action then
-      begin
-        Count:=Core^.RedoList^.At(Last)^.ActionCount;
-        Dec(Last);
-        Is_grouped:=true;
-      end
-    else
-      begin
-        Count:=1;
-        Is_grouped:=false;
-      end;
-    for Idx:=Last downto Last-Count+1 do
-    with Core^.RedoList^.At(Idx)^ do
-    begin
-      case action of
-        eaMoveCursor :
-          begin
-            { move cursor back to original position }
-            SetCurPtr(EndPos.X,EndPos.Y);
-          end;
-        eaInsertText :
-          begin
-            SetCurPtr(startpos.x,startpos.y);
-            InsertText(GetStr(Text));
-          end;
-        eaDeleteText :
-          begin
-            SetCurPtr(EndPos.X,EndPos.Y);
-            for Temp := 1 to length(GetStr(Text)) do
-              DelChar;
-          end;
-        eaInsertLine :
-          begin
-            SetCurPtr(StartPos.X,StartPos.Y);
-            Had_efNoIndent:=(GetFlags and efNoIndent)<>0;
-            SetFlags(GetFlags or efNoIndent);
-            InsertNewLine;
-            if not Had_efNoIndent then
-              SetFlags(GetFlags and not efNoIndent);
-            SetCurPtr(0,StartPos.Y+1);
-            InsertText(GetStr(Text));
-            SetCurPtr(EndPos.X,EndPos.Y);
-          end;
-        eaDeleteLine :
-          begin
-            SetCurPtr(StartPos.X,StartPos.Y);
-            DeleteLine(StartPos.Y);
-            SetCurPtr(EndPos.X,EndPos.Y);
-            if EndPos.Y=StartPos.Y-1 then
-            SetDisplayText(EndPos.Y,RExpand(
-              copy(GetDisplayText(EndPos.Y),1,EndPos.X),EndPos.X)
-              +GetStr(Text));
-            SetCurPtr(EndPos.X,EndPos.Y);
-          end;
-        eaSelectionChanged :
-          begin
-            { move cursor to end of last set test selection }
-          end;
-      else
-        { what the 'ell's an undefined action doing round 'ere mate! }
-        ;
-      end; { once this lot is done paste back into undo and modify to suit needs }
-    { move item to undo stack }
-      Core^.UndoList^.Insert(Core^.RedoList^.At(Idx));
-      UpdateUndoRedo(cmUndo,Core^.RedoList^.At(Idx)^.Action);
-      If Idx>0 then
-        UpdateUndoRedo(cmRedo,Core^.RedoList^.At(Idx-1)^.Action)
-      else
-        UpdateUndoRedo(cmRedo,0);
-      Core^.RedoList^.atDelete(Idx);
-      end;{ Idx loop for grouped action }
-      If is_grouped then
-        begin
-          Idx:=Core^.RedoList^.count-1;
-          Core^.UndoList^.Insert(Core^.RedoList^.At(Idx));
-          UpdateUndoRedo(cmUndo,Core^.RedoList^.At(Idx)^.Action);
-          If Idx>0 then
-            UpdateUndoRedo(cmRedo,Core^.RedoList^.At(Idx-1)^.Action)
-          else
-            UpdateUndoRedo(cmRedo,0);
-          Core^.RedoList^.atDelete(Idx);
-        end;
-      if Core^.RedoList^.count=0 then
-        SetCmdState(RedoCmd,false);
-      SetCmdState(UndoCmd,true);
-      DrawView;
-      Message(Application,evBroadcast,cmCommandSetChanged,nil);
-    end;
-  Core^.SetStoreUndo(True);
-  Unlock;
-{$else}
-  NotImplemented; Exit;
-{$endif Undo}
-end;
-
-(*constructor TCodeEditor.Load(var S: TStream);
-var TS: PSubStream;
-    TSize: longint;
-begin
-  inherited Load(S);
-
-  New(UndoList,init(500,1000));
-  New(RedoList,init(500,1000));
-
-  New(Lines, Init(500,1000));
-  { we have always need at least 1 line }
-  LinesInsert(New(PLine, Init('',0)));
-
-  GetPeerViewPtr(S,Indicator);
-  S.Read(Flags,SizeOf(Flags));
-  S.Read(TabSize,SizeOf(TabSize));
-
-  if IsFlagSet(efStoreContent) then
-    begin
-      S.Read(TSize,SizeOf(TSize));
-      New(TS, Init(@S,S.GetPos,TSize));
-{$ifdef TEST_PARTIAL_SYNTAX}
-      Core^.SearchBinding(Editor)^.SyntaxComplete:=false;
-      { Idle necessary }
-      EventMask:=EventMask or evIdle;
-{$endif TEST_PARTIAL_SYNTAX}
-      LoadFromStream(TS);
-      Dispose(TS, Done);
-    end;
-
-  S.Read(SelStart,SizeOf(SelStart));
-  S.Read(SelEnd,SizeOf(SelEnd));
-  S.Read(Highlight,SizeOf(Highlight));
-  S.Read(CurPos,SizeOf(CurPos));
-  S.Read(StoreUndo,SizeOf(StoreUndo));
-  S.Read(IsReadOnly,SizeOf(IsReadOnly));
-  S.Read(NoSelect,SizeOf(NoSelect));
-  S.Read(HighlightRow,SizeOf(HighlightRow));
-  SetDebuggerRow(-1);
-
-  LimitsChanged;
-  SelectionChanged; HighlightChanged;
-  UpdateIndicator;
-end;
-
-procedure TCodeEditor.Store(var S: TStream);
-var {NS: TNulStream;}
-    TSizePos,TSize,EndPos: longint;
-begin
-  inherited Store(S);
-
-  PutPeerViewPtr(S,Indicator);
-  S.Write(Flags,SizeOf(Flags));
-  S.Write(TabSize,SizeOf(TabSize));
-
-  if IsFlagSet(efStoreContent) then
-    begin
-      { NS.Init;
-      SaveToStream(@NS);
-      TSize:=NS.GetSize;
-      NS.Done;
-        This is waste of time PM
-        use Seek instead !! }
-      { yep. and this won't work for serial streams. - Gabor }
-      TSize:=0;
-      TSizePos:=S.GetPos;
-      S.Write(TSize,SizeOf(TSize));
-      SaveToStream(@S);
-      EndPos:=S.GetPos;
-      TSize:=EndPos-TSizePos-SizeOf(TSize);
-      S.Seek(TSizePos);
-      S.Write(TSize,SizeOf(TSize));
-      S.Seek(EndPos);
-    end;
-
-  S.Write(SelStart,SizeOf(SelStart));
-  S.Write(SelEnd,SizeOf(SelEnd));
-  S.Write(Highlight,SizeOf(Highlight));
-  S.Write(CurPos,SizeOf(CurPos));
-  S.Write(StoreUndo,SizeOf(StoreUndo));
-  S.Write(IsReadOnly,SizeOf(IsReadOnly));
-  S.Write(NoSelect,SizeOf(NoSelect));
-  S.Write(HighlightRow,SizeOf(HighlightRow));
-end;*)
-
-function TCodeEditor.LoadFromStream(Stream: PStream): boolean;
-var OK: boolean;
-begin
-  OK:=Core^.LoadFromStream(@Self,Stream);
-  if IsFlagSet(efSyntaxHighlight) then
-    UpdateAttrsRange(0,Min(Delta.Y+Size.Y,GetLineCount-1),
-      attrAll
-{$ifndef TEST_PARTIAL_SYNTAX}
-      +attrForceFull
-{$endif TEST_PARTIAL_SYNTAX}
-      );
-  TextStart;
-  LoadFromStream:=OK;
-end;
-
-function TCodeEditor.SaveToStream(Stream: PStream): boolean;
-begin
-  SaveToStream:=Core^.SaveToStream(@Self,Stream);
-end;
-
-function TCodeEditor.SaveAreaToStream(Stream: PStream; StartP,EndP: TPoint): boolean;
-begin
-  SaveAreaToStream:=Core^.SaveAreaToStream(@Self,Stream,StartP,EndP);
-end;
-
-function TCodeEditor.UpdateAttrs(FromLine: sw_integer; Attrs: byte): sw_integer;
-begin
-  UpdateAttrs:=Core^.UpdateAttrs(FromLine,Attrs);
-end;
-
-function TCodeEditor.UpdateAttrsRange(FromLine, ToLine: sw_integer; Attrs: byte): sw_integer;
-begin
-  UpdateAttrsRange:=Core^.UpdateAttrsRange(FromLine,ToLine,Attrs);
-end;
-
-procedure TCodeEditor.AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string);
-begin
-  Core^.AddAction(AAction,AStartPos,AEndPos,AText);
-end;
-
-procedure TCodeEditor.AddGroupedAction(AAction : byte);
-begin
-  Core^.AddGroupedAction(AAction);
-end;
-
-procedure TCodeEditor.CloseGroupedAction(AAction : byte);
-begin
-  Core^.CloseGroupedAction(AAction);
-end;
-
-function TCodeEditor.GetUndoActionCount: sw_integer;
-begin
-  GetUndoActionCount:=Core^.GetUndoActionCount;
-end;
-
-function TCodeEditor.GetRedoActionCount: sw_integer;
-begin
-  GetRedoActionCount:=Core^.GetRedoActionCount;
-end;
-
-destructor TCodeEditor.Done;
-begin
-  inherited Done;
-  if Assigned(Core) then
-  begin
-    Core^.UnBindEditor(@Self);
-    if Core^.CanDispose then
-      Dispose(Core, Done);
-  end;
-  Core:=nil;
-  if Assigned(CodeCompleteFrag) then
-    DisposeStr(CodeCompleteFrag);
-  if Assigned(CodeCompleteWord) then
-    DisposeStr(CodeCompleteWord);
-  if Assigned(Folds) then Dispose(Folds, Done); Folds:=nil;
-end;
-
-constructor TFileEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-       PScrollBar; AIndicator: PIndicator;ACore: PCodeEditorCore; const AFileName: string);
-begin
-  inherited Init(Bounds,AHScrollBAr,AVScrollBAr,AIndicator,ACore);
-  FileName:=AFileName;
-  UpdateIndicator;
-  Message(@Self,evBroadcast,cmFileNameChanged,@Self);
-  OnDiskLoadTime:=-1;
-end;
-
-function TFileEditor.LoadFile: boolean;
-var OK: boolean;
-    PA : Array[1..2] of pointer;
-begin
-  OK:=LoadFromFile(FileName);
-  if GetModified then
-    begin
-      PA[1]:=@FileName;
-      longint(PA[2]):=Core^.GetChangedLine;
-      EditorDialog(edChangedOnloading,@PA);
-    end;
-  OnDiskLoadTime:=GetFileTime(FileName);
-  LoadFile:=OK;
-end;
-
-function TFileEditor.IsChangedOnDisk : boolean;
-begin
-  IsChangedOnDisk:=(OnDiskLoadTime<>GetFileTime(FileName)) and (OnDiskLoadTime<>-1);
-end;
-
-function TFileEditor.SaveFile: boolean;
-var OK: boolean;
-    BAKName: string;
-    f: text;
-begin
-  If IsChangedOnDisk then
-    begin
-      if EditorDialog(edFileOnDiskChanged, @FileName) <> cmYes then
-        begin
-          SaveFile:=false;
-          exit;
-        end;
-    end;
-{$I-}
-  if IsFlagSet(efBackupFiles) and ExistsFile(FileName) then
-  begin
-     BAKName:=DirAndNameOf(FileName)+'.bak';
-     Assign(f,BAKName);
-     Erase(f);
-     EatIO;
-     Assign(f,FileName);
-     Rename(F,BAKName);
-     EatIO;
-  end;
-{$I+}
-  OK:=SaveToFile(FileName);
-  if OK then
-    SetModified(false)
-  { Restore the original }
-  else if IsFlagSet(efBackupFiles) and ExistsFile(BakName) then
-    begin
-{$I-}
-     Assign(f,BakName);
-     Rename(F,FileName);
-     EatIO;
-{$I+}
-    end;
-  { don't forget to update the OnDiskLoadTime value }
-  if OK then
-    OnDiskLoadTime:=GetFileTime(FileName);
-  if not OK then
-    EditorDialog(edSaveError,@FileName);
-  SaveFile:=OK;
-end;
-
-function TFileEditor.ShouldSave: boolean;
-begin
-  ShouldSave:=GetModified{ or (FileName='')};
-end;
-
-function TFileEditor.Save: Boolean;
-begin
-  if ShouldSave=false then begin Save:=true; Exit; end;
-  if FileName = '' then Save := SaveAs else Save := SaveFile;
-end;
-
-function TFileEditor.SaveAs: Boolean;
-begin
-  SaveAs := False;
-  if EditorDialog(edSaveAs, @FileName) <> cmCancel then
-  begin
-    FileName := FExpand(FileName);
-    Message(Owner, evBroadcast, cmUpdateTitle, @Self);
-    { if we rename the file the OnDiskLoadTime is wrong so we reset it }
-    OnDiskLoadTime:=-1;
-    SaveAs := SaveFile;
-    if IsClipboard then FileName := '';
-    Message(Application,evBroadcast,cmFileNameChanged,@Self);
-  end;
-end;
-
-function TFileEditor.SaveAsk(Force: boolean): boolean;
-var OK: boolean;
-    D: Sw_integer;
-begin
-  OK:=GetModified=false;
-  if Force=false then
-    if (OK=false) and (Core^.GetBindingCount>1) then
-      OK:=true;
-  if OK=false then
-  begin
-    if FileName = '' then D := edSaveUntitled else D := edSaveModify;
-    case EditorDialog(D, @FileName) of
-      cmYes    : OK := Save;
-      cmNo     : begin SetModified(False); OK:=true; end;
-      cmCancel : begin
-                   OK := False;
-                   Message(Application,evBroadcast,cmSaveCancelled,@Self);
-                 end;
-    end;
-  end;
-  SaveAsk:=OK;
-end;
-
-procedure TFileEditor.BindingsChanged;
-begin
-  Message(Application,evBroadcast,cmUpdateTitle,@Self);
-end;
-
-procedure TFileEditor.HandleEvent(var Event: TEvent);
-var SH,B: boolean;
-begin
-  case Event.What of
-    evBroadcast :
-      case Event.Command of
-   cmFileNameChanged :
-     if (Event.InfoPtr=nil) or (Event.InfoPtr=@Self) then
-     begin
-       B:=IsFlagSet(efSyntaxHighlight);
-       SH:=UseSyntaxHighlight(@Self);
-       if SH<>B then
-         if SH then
-           SetFlags(Flags or efSyntaxHighlight)
-         else
-           SetFlags(Flags and not efSyntaxHighlight);
-       if UseTabsPattern(@Self) then
-         SetFlags(Flags or efUseTabCharacters);
-     end;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-function TFileEditor.Valid(Command: Word): Boolean;
-var OK: boolean;
-begin
-  OK:=inherited Valid(Command);
-  if OK and ((Command=cmClose) or (Command=cmQuit)) then
-    if IsClipboard=false then
-      OK:=SaveAsk(Command=cmQuit);
-  Valid:=OK;
-end;
-
-(* constructor TFileEditor.Load(var S: TStream);
-var P: PString;
-    SSP,SEP,CP,DP: TPoint;
-    HR: TRect;
-    PA : Array[1..2] of pointer;
-    HoldUndo : boolean;
-begin
-  inherited Load(S);
-  HoldUndo:=GetStoreUndo;
-  SetStoreUndo(False);
-  P:=S.ReadStr;
-  FileName:=GetStr(P);
-  if P<>nil then DisposeStr(P);
-
-  UpdateIndicator;
-{  Message(@Self,evBroadcast,cmFileNameChanged,@Self);}
-
-  SSP:=SelStart; SEP:=SelEnd;
-  CP:=CurPos;
-  HR:=Highlight;
-  DP:=Delta;
-
-  if FileName<>'' then
-    LoadFile;
-
-{  if GetModified then
-    begin
-      PA[1]:=@FileName;
-      longint(PA[2]):=ChangedLine;
-      EditorDialog(edChangedOnloading,@PA);
-    end;}
-
-  SetHighlight(HR.A,HR.B);
-  SetSelection(SSP,SEP);
-  SetCurPtr(CP.X,CP.Y);
-  ScrollTo(DP.X,DP.Y);
-  SetModified(false);
-
-  LimitsChanged;
-  SetStoreUndo(HoldUndo);
-end;
-
-procedure TFileEditor.Store(var S: TStream);
-begin
-  inherited Store(S);
-  S.WriteStr(@FileName);
-end;
-*)
-
-function DefUseSyntaxHighlight(Editor: PFileEditor): boolean;
-begin
-  DefUseSyntaxHighlight:=Editor^.IsFlagSet(efSyntaxHighlight);
-end;
-
-function DefUseTabsPattern(Editor: PFileEditor): boolean;
-begin
-  DefUseTabsPattern:=Editor^.IsFlagSet(efUseTabCharacters);
-end;
-
-procedure RegisterWCEdit;
-begin
-{$ifndef NOOBJREG}
-  RegisterType(RIndicator);
-  RegisterType(RCodeEditor);
-  RegisterType(RFileEditor);
-{$endif}
-end;
-
-
-END.
-{
- $Log$
- Revision 1.5  2000-11-15 00:14:11  pierre
-  new merge
-
- Revision 1.1.2.7  2000/11/14 23:41:32  pierre
-  * fix for bug 1234
-
- Revision 1.4  2000/11/03 16:05:38  pierre
-  * (merged)
-
- Revision 1.1.2.6  2000/11/03 15:49:26  pierre
-  * more Undo fixes
-
- Revision 1.1.2.5  2000/11/03 13:31:33  pierre
-  + more Undo stuff and smarter indent/unindent
-
- Revision 1.3  2000/10/31 22:35:55  pierre
-  * New big merge from fixes branch
-
- Revision 1.1.2.4  2000/10/24 23:06:30  pierre
-  * some Undo/redo fixes
-
- Revision 1.1.2.3  2000/09/18 13:20:55  pierre
-  New bunch of Gabor changes
-
-}

+ 0 - 41
ide/text/wconsts.pas

@@ -1,41 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by B‚rczi G bor
-
-    Strings for common utilities
-
-    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.
-
- **********************************************************************}
-{$i globdir.inc}
-unit wconsts;
-
-  interface
-
-  uses Dos;
-
-{$ifdef LANG_HUN}
-{$i wconstsh.inc}    { Hungarian language file }
-{$else}
- {$ifdef LANG_GER}
- {$i wconstsg.inc}    { German language file }
- {$else}
-   {$i wconstse.inc}  { English language file }
- {$endif}
-{$endif}
-
-  implementation
-
-end.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:37  michael
-  + Initial import
-
-  Revision 1.1  2000/06/16 09:30:01  pierre
-   * new files from Gabor
-
-}

+ 0 - 119
ide/text/wconstse.inc

@@ -1,119 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by Berczi Gabor
-
-    Strings for utilities
-
-    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.
-
- **********************************************************************}
-
-{$undef USERESSTRINGS} { this doesn't compile under FP!!! why? }
-
-{$ifdef USERESSTRINGS}
-    resourcestring
-{$else}
-    const
-{$endif}
-
-    btn_OK = 'O~K';
-    btn_Cancel = 'Cancel';
-
-    dialog_find = 'Find';
-    label_find_options = 'Options';
-    label_find_texttofind = '~T~ext to find';
-    label_find_casesensitive = '~C~ase sensitive';
-    label_find_wholewordsonly = '~W~hole words only';
-    label_find_direction = 'Direction';
-    label_find_forward = 'Forwar~d~';
-    label_find_backward = '~B~ackward';
-    label_find_scope = 'Scope';
-    label_find_global = '~G~lobal';
-    label_find_selectedtext = '~S~elected text';
-    label_find_origin = 'Origin';
-    label_find_fromcursor = '~F~rom cursor';
-    label_find_entirescope = '~E~ntire scope';
-
-    dialog_replace = 'Replace';
-    label_replace_texttofind = label_find_texttofind;
-    label_replace_newtext = '    ~N~ew text';
-    label_replace_options = label_find_options;
-    label_replace_casesensitive = label_find_casesensitive;
-    label_replace_wholewordsonly = label_find_wholewordsonly;
-    label_replace_promptonreplace = '~P~rompt on replace';
-    label_replace_direction = label_find_direction;
-    label_replace_forward = label_find_forward;
-    label_replace_backward = label_find_backward;
-    label_replace_scope = label_find_scope;
-    label_replace_global = label_find_global;
-    label_replace_selectedtext = label_find_selectedtext;
-    label_replace_origin = label_find_origin;
-    label_replace_fromcursor = label_find_fromcursor;
-    label_replace_entirescope = label_find_entirescope;
-    btn_replace_changeall = 'Change ~a~ll';
-
-    dialog_gotoline = 'Goto line';
-    label_gotoline_linenumber = 'Enter new line ~n~umber';
-
-    msg_invalidmarkindex = 'Invalid mark index (%d)';
-    msg_marknotset = 'Mark %d not set.';
-
-    msg_foldboundsarenotvalid = 'Fold bounds are not valid';
-
-    msg_notenoughmemoryforthisoperation = 'Not enough memory for this operation.';
-    msg_errorreadingfile = 'Error reading file %s.';
-    msg_errorwritingfile = 'Error writing file %s.';
-    msg_errorsavingfile = 'Error saving file %s.';
-    msg_errorcreatingfile = 'Error creating file %s.';
-    msg_filehasbeenmodifiedsave = '%s has been modified. Save?';
-    msg_saveuntitledfile = 'Save untitled file?';
-    msg_filehadtoolonglines = #3'File %s had too long lines'#13+
-                              #3'first such line is %d';
-    msg_filewasmodified = #3'File %s '#13+
-                          #3'was modified by another program.'#13+
-                          #3'Overwrite new version?';
-
-    dialog_savefileas = 'Save File As';
-    dialog_writeblocktofile = 'Write Block to File';
-    dialog_readblockfromfile = 'Read Block from File';
-
-    label_name = '~N~ame';
-
-    msg_searchstringnotfound = 'Search string not found.';
-    msg_replacethisoccourence = 'Replace this occurence?';
-    msg_fileexistsoverwrite = 'File %s already exists. Overwrite?';
-
-    { Help system }
-
-    msg_nohelpfilesinstalled = 'No help files installed.';
-    msg_helpindex = 'Help index';
-    msg_nohelpavailabelforthistopic = 'No help available for this topic.';
-    msg_pagenotavailable = 'Page not available';
-    msg_cantaccessurl = 'Sorry, can''t access the URL: %s ...';
-
-    { WUtils }
-    msg_bugcheckfailed = 'Bug check failed: %s'#13+
-                         'Please report to author!';
-    msg_functionnotimplemented = #3'This function is not'#13+
-                                 #3+'yet implemented...'#13+
-                                 #3+'Sorry';
-
-{
-  $Log$
-  Revision 1.2  2000-10-31 22:35:55  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/09/18 13:20:55  pierre
-   New bunch of Gabor changes
-
-  Revision 1.1  2000/07/13 09:48:37  michael
-  + Initial import
-
-  Revision 1.1  2000/06/16 09:30:01  pierre
-   * new files from Gabor
-
-
-}

+ 0 - 119
ide/text/wconstsh.inc

@@ -1,119 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by Berczi Gabor
-
-    Strings for utilities
-
-    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.
-
- **********************************************************************}
-
-{$undef USERESSTRINGS} { this doesn't compile under FP!!! why? }
-
-{$ifdef USERESSTRINGS}
-    resourcestring
-{$else}
-    const
-{$endif}
-
-    btn_OK = 'O~K~';
-    btn_Cancel = 'M‚gsem';
-
-    dialog_find = 'Keres‚s';
-    label_find_options = 'Opci¢k';
-    label_find_texttofind = '~K~eresend‹';
-    label_find_casesensitive = 'K~i~s-/nagybet‹k k�l”n';
-    label_find_wholewordsonly = 'Csak teljes sza~v~akat';
-    label_find_direction = 'Ir ny';
-    label_find_forward = 'El‹re (~d~)';
-    label_find_backward = 'Visszafel‚ (~b~)';
-    label_find_scope = 'Szk¢p';
-    label_find_global = 'Teljes sz”ve~g~';
-    label_find_selectedtext = 'Kiv la~s~ztott sz”veg';
-    label_find_origin = 'Kiindul si pont';
-    label_find_fromcursor = 'A kur~z~ort¢l';
-    label_find_entirescope = 'T~e~ljes szk¢p';
-
-    dialog_replace = 'Csere';
-    label_replace_texttofind = label_find_texttofind;
-    label_replace_newtext = '   ~é~j sz”veg';
-    label_replace_options = label_find_options;
-    label_replace_casesensitive = label_find_casesensitive;
-    label_replace_wholewordsonly = label_find_wholewordsonly;
-    label_replace_promptonreplace = '~P~rompt on replace';
-    label_replace_direction = label_find_direction;
-    label_replace_forward = label_find_forward;
-    label_replace_backward = label_find_backward;
-    label_replace_scope = label_find_scope;
-    label_replace_global = label_find_global;
-    label_replace_selectedtext = label_find_selectedtext;
-    label_replace_origin = label_find_origin;
-    label_replace_fromcursor = label_find_fromcursor;
-    label_replace_entirescope = label_find_entirescope;
-    btn_replace_changeall = '~A~z ”sszeset';
-
-    dialog_gotoline = 'Ugr s sorra';
-    label_gotoline_linenumber = 'Az £j sor s~z~ ma';
-
-    msg_invalidmarkindex = '�rv‚nytelen pont index (%d)';
-    msg_marknotset = 'A %d. pont nincs be ll¡tva.';
-
-    msg_foldboundsarenotvalid = 'A hajt s hat rai nem ‚rv‚nyesek';
-
-    msg_notenoughmemoryforthisoperation = 'Nincs el‚g mem¢ria a m‹velet elv‚gz‚s‚hez.';
-    msg_errorreadingfile = 'Hiba a  %s f jl olvas sa k”zben.';
-    msg_errorwritingfile = 'Hiba a  %s f jl ¡r sa k”zben.';
-    msg_errorsavingfile = 'Hiba a %s f jl ment‚se k”zben.';
-    msg_errorcreatingfile = 'Hiba a %s f jl l‚trehoz sa k”zben.';
-    msg_filehasbeenmodifiedsave = 'A %s m¢dosult. Menti?';
-    msg_saveuntitledfile = 'Elmenti a c¡m n‚lk�li f jlt?';
-    msg_filehadtoolonglines = #3'A %s f jlnak t£l hossz£'#13+
-                              #3'sora(i) voltak. Az els‹ a %d';
-    msg_filewasmodified = #3'A %s f jlt'#13+
-                          #3'egy m sik program m¢dos¡totta.'#13+
-                          #3'Fel�l¡rja az £jabb verzi¢t?';
-
-    dialog_savefileas = 'F jl ment‚se m s n‚ven';
-    dialog_writeblocktofile = 'Blokk ki¡r sa f jlba';
-    dialog_readblockfromfile = 'Blokk beolvas sa f jlb¢l';
-
-    label_name = '~N~‚v';
-
-    msg_searchstringnotfound = 'A keresett karaktersor nem tal lhat¢.';
-    msg_replacethisoccourence = 'Lecser‚ljem ezt az el‹fordul st?';
-    msg_fileexistsoverwrite = 'A %s f jl m r l‚tezik. Fel�l¡rja?';
-
-    { Help system }
-
-    msg_nohelpfilesinstalled = 'Nincsenek s£g¢-f jlok telep¡tve.';
-    msg_helpindex = 'S£g¢ index';
-    msg_nohelpavailabelforthistopic = 'Ehhez a t‚m hoz nem tartozik s£g¢.';
-    msg_pagenotavailable = 'Az oldal nem el‚rhet‹';
-    msg_cantaccessurl = 'Sajnos nem tudom megnyitni a %s URL-t...';
-
-    { WUtils }
-    msg_bugcheckfailed = 'Bels‹ hiba: %s'#13+
-                         'K‚rem, jelezze a szerz‹nek!';
-    msg_functionnotimplemented = #3'Ez a funkci¢ m‚g'#13+
-                                 #3+'nincs kidolgozva...'#13+
-                                 #3+'';
-
-{
-  $Log$
-  Revision 1.2  2000-10-31 22:35:55  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/09/18 13:20:55  pierre
-   New bunch of Gabor changes
-
-  Revision 1.1  2000/07/13 09:48:37  michael
-  + Initial import
-
-  Revision 1.1  2000/06/16 09:30:01  pierre
-   * new files from Gabor
-
-
-}

+ 0 - 7087
ide/text/weditor.pas

@@ -1,7087 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Code editor template objects
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$I globdir.inc}
-{$ifdef TP}{$L-}{$endif}
-unit WEditor;
-
-interface
-{tes}
-uses
-  Dos,Objects,Drivers,Views,Menus,Commands,
-  WUtils;
-
-const
-      cmFileNameChanged      = 51234;
-      cmASCIIChar            = 51235;
-      cmClearLineHighlights  = 51236;
-      cmSaveCancelled        = 51237;
-      cmBreakLine            = 51238;
-      cmSelStart             = 51239;
-      cmSelEnd               = 51240;
-      cmLastCursorPos        = 51241;
-      cmIndentBlock          = 51242;
-      cmUnIndentBlock        = 51243;
-      cmSelectLine           = 51244;
-      cmWriteBlock           = 51245;
-      cmReadBlock            = 51246;
-      cmPrintBlock           = 51247;
-      cmResetDebuggerRow     = 51248;
-      cmAddChar              = 51249;
-      cmExpandCodeTemplate   = 51250;
-      cmUpperCase            = 51251;
-      cmLowerCase            = 51252;
-      cmWindowStart          = 51253;
-      cmWindowEnd            = 51254;
-      cmFindMatchingDelimiter= 51255;
-      cmFindMatchingDelimiterBack=51256;
-      cmActivateMenu         = 51257;
-      cmWordLowerCase        = 51258;
-      cmWordUpperCase        = 51259;
-      cmOpenAtCursor         = 51260;
-      cmBrowseAtCursor       = 51261;
-      cmInsertOptions        = 51262;
-      cmToggleCase           = 51263;
-      cmCreateFold           = 51264;
-      cmToggleFold           = 51265;
-      cmCollapseFold         = 51266;
-      cmExpandFold           = 51267;
-
-      EditorTextBufSize = {$ifdef FPC}32768{$else} 4096{$endif};
-      MaxLineLength     = 255;
-      MaxLineCount      = {$ifdef FPC}2000000{$else}16380{$endif};
-
-      CodeCompleteMinLen = 4; { minimum length of text to try to complete }
-
-      efBackupFiles         = $00000001;
-      efInsertMode          = $00000002;
-      efAutoIndent          = $00000004;
-      efUseTabCharacters    = $00000008;
-      efBackSpaceUnindents  = $00000010;
-      efPersistentBlocks    = $00000020;
-      efSyntaxHighlight     = $00000040;
-      efBlockInsCursor      = $00000080;
-      efVerticalBlocks      = $00000100;
-      efHighlightColumn     = $00000200;
-      efHighlightRow        = $00000400;
-      efAutoBrackets        = $00000800;
-      efExpandAllTabs       = $00001000;
-      efKeepTrailingSpaces  = $00002000;
-      efCodeComplete        = $00004000;
-      efFolds               = $00008000;
-      efNoIndent            = $00010000;
-      efStoreContent        = $80000000;
-
-      attrAsm       = 1;
-      attrComment   = 2;
-      attrForceFull = 128;
-      attrAll       = attrAsm+attrComment;
-
-      edOutOfMemory   = 0;
-      edReadError     = 1;
-      edWriteError    = 2;
-      edCreateError   = 3;
-      edSaveModify    = 4;
-      edSaveUntitled  = 5;
-      edSaveAs        = 6;
-      edFind          = 7;
-      edSearchFailed  = 8;
-      edReplace       = 9;
-      edReplacePrompt = 10;
-      edTooManyLines  = 11;
-      edGotoLine      = 12;
-      edReplaceFile   = 13;
-      edWriteBlock    = 14;
-      edReadBlock     = 15;
-      edFileOnDiskChanged = 16;
-      edChangedOnloading = 17;
-      edSaveError     = 18;
-
-      ffmOptions      = $0007; ffsOptions     = 0;
-      ffmDirection    = $0008; ffsDirection   = 3;
-      ffmScope        = $0010; ffsScope       = 4;
-      ffmOrigin       = $0020; ffsOrigin      = 5;
-      ffDoReplace     = $0040;
-      ffReplaceAll    = $0080;
-
-
-      ffCaseSensitive    = $0001;
-      ffWholeWordsOnly   = $0002;
-      ffPromptOnReplace  = $0004;
-
-      ffForward          = $0000;
-      ffBackward         = $0008;
-
-      ffGlobal           = $0000;
-      ffSelectedText     = $0010;
-
-      ffFromCursor       = $0000;
-      ffEntireScope      = $0020;
-
-      coTextColor         = 0;
-      coWhiteSpaceColor   = 1;
-      coCommentColor      = 2;
-      coReservedWordColor = 3;
-      coIdentifierColor   = 4;
-      coStringColor       = 5;
-      coNumberColor       = 6;
-      coAssemblerColor    = 7;
-      coSymbolColor       = 8;
-      coDirectiveColor    = 9;
-      coHexNumberColor    = 10;
-      coTabColor          = 11;
-      coBreakColor        = 12;
-      coFirstColor        = 0;
-      coLastColor         = coBreakColor;
-
-      lfBreakpoint        = $0001;
-      lfHighlightRow      = $0002;
-      lfDebuggerRow       = $0004;
-
-      eaMoveCursor        = 1;
-      eaInsertLine        = 2;
-      eaInsertText        = 3;
-      eaDeleteLine        = 4;
-      eaDeleteText        = 5;
-      eaSelectionChanged  = 6;
-      eaCut               = 7;
-      eaPaste             = 8;
-      eaPasteWin          = 9;
-      eaDelChar           = 10;
-      eaClear             = 11;
-      eaCopyBlock         = 12;
-      eaMoveBlock         = 13;
-      eaDelBlock          = 14;
-      eaReadBlock         = 15;
-      eaIndentBlock       = 16;
-      eaUnindentBlock     = 17;
-      eaDummy             = 18;
-      LastAction          = eaDummy;
-
-      ActionString : array [0..LastAction-1] of string[13] =
-        ('','Move','InsLine','InsText','DelLine','DelText',
-         'SelChange','Cut','Paste','PasteWin','DelChar','Clear',
-         'CopyBlock','MoveBlock','DelBlock',
-         'ReadBlock','IndentBlock','UnindentBlock');
-
-      CIndicator    = #2#3#1;
-      CEditor       = #33#34#35#36#37#38#39#40#41#42#43#44#45#46#47#48#49;
-
-      TAB      = #9;
-      FindStrSize = 79;
-
-type
-    PCustomCodeEditor = ^TCustomCodeEditor;
-    PEditorLineInfo = ^TEditorLineInfo;
-    PFoldCollection = ^TFoldCollection;
-
-    PFold = ^TFold;
-    TFold = object(TObject)
-      constructor Init(AEditor: PCustomCodeEditor; AParentFold: PFold; ACollapsed: boolean);
-      procedure   AddReference(P: PObject);
-      procedure   RemoveReference(P: PObject);
-      procedure   AddLineReference(Line: PEditorLineInfo);
-      procedure   RemoveLineReference(Line: PEditorLineInfo);
-      procedure   AddChildReference(Fold: PFold);
-      procedure   RemoveChildReference(Fold: PFold);
-      function    CanDispose: boolean;
-      function    IsCollapsed: boolean;
-      function    IsParent(AFold: PFold): boolean;
-      function    GetLineCount: sw_integer;
-      procedure   Collapse(ACollapse: boolean);
-      procedure   Changed;
-      function    GetLevel: sw_integer;
-      destructor  Done; virtual;
-    public
-      ParentFold: PFold;
-      Collapsed_: boolean;
-      ReferenceCount: sw_integer;
-      Editor: PCustomCodeEditor;
-      LineCount_: sw_integer;
-      Childs: PFoldCollection;
-    end;
-
-    TFoldCollection = object(TCollection)
-      function At(Index: sw_Integer): PFold;
-    end;
-
-    TEditorLineInfo = object(TObject)
-      Editor: PCustomCodeEditor;
-      Format : PString;
-      BeginsWithAsm,
-      EndsWithAsm   : boolean;
-      BeginsWithComment,
-      EndsInSingleLineComment,
-      EndsWithComment : boolean;
-      BeginsWithDirective,
-      EndsWithDirective : boolean;
-      BeginCommentType,EndCommentType : byte;
-      Fold: PFold;
-      constructor Init(AEditor: PCustomCodeEditor);
-      destructor  Done; virtual;
-      function    GetFormat: string;
-      procedure   SetFormat(const AFormat: string);
-      procedure   SetFold(AFold: PFold);
-      { Syntax information is now generated separately for each editor instance.
-        This is not neccessary for a one-language IDE, but this unit contains
-        a _generic_ editor object, which should be (and is) as flexible as
-        possible.
-        The overhead caused by generating the same syntax info for ex.
-        twice isn't so much...   - Gabor }
-    end;
-
-    PEditorLineInfoCollection = ^TEditorLineInfoCollection;
-    TEditorLineInfoCollection = object(TCollection)
-      function At(Index: sw_Integer): PEditorLineInfo;
-    end;
-
-    PCustomLine = ^TCustomLine;
-    TCustomLine = object(TObject)
-      constructor Init(const AText: string; AFlags: longint);
-   {a}function    GetText: string; virtual;
-   {a}procedure   SetText(const AText: string); virtual;
-   {a}function    GetEditorInfo(Editor: PCustomCodeEditor): PEditorLineInfo; virtual;
-   {a}function    GetFlags: longint; virtual;
-   {a}procedure   SetFlags(AFlags: longint); virtual;
-      function    IsFlagSet(AFlag: longint): boolean;
-      procedure   SetFlagState(AFlag: longint; ASet: boolean);
-      destructor  Done; virtual;
-    public { internal use only! }
-   {a}procedure AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor); virtual;
-   {a}procedure RemoveEditorInfo(AEditor: PCustomCodeEditor); virtual;
-    end;
-
-    PLineCollection = ^TLineCollection;
-    TLineCollection = object(TCollection)
-      function  At(Index: sw_Integer): PCustomLine;
-    end;
-
-{$ifdef Undo}
-    PEditorAction = ^TEditorAction;
-    TEditorAction = object(TObject)
-      StartPos  : TPoint;
-      EndPos    : TPoint;
-      Text      : PString;
-      ActionCount : longint;
-      Action    : byte;
-      TimeStamp : longint; { this is needed to keep track of line number &
-                             position changes (for ex. for symbol browser)
-                             the line&pos references (eg. symbol info) should
-                             also contain such a timestamp. this will enable
-                             to determine which changes have been made since
-                             storage of the information and thus calculate
-                             the (probably) changed line & position information,
-                             so, we can still jump to the right position in the
-                             editor even when it is heavily modified - Gabor }
-      constructor init(act:byte; StartP,EndP:TPoint;Txt:String);
-      constructor init_group(act:byte);
-      function is_grouped_action : boolean;
-      destructor done; virtual;
-    end;
-
-    PEditorActionCollection = ^TEditorActionCollection;
-    TEditorActionCollection = object(TCollection)
-      CurrentGroupedAction : PEditorAction;
-      GroupLevel           : longint;
-      function At(Idx : sw_integer) : PEditorAction;
-    end;
-{$else}
-    PEditorAction = ^TEditorAction;
-    TEditorAction = packed record
-      StartPos  : TPoint;
-      EndPos    : TPoint;
-      Text      : PString;
-      ActionCount : longint;
-      Action    : byte;
-      TimeStamp : longint; { see above! }
-    end;
-
-    PEditorActionCollection = ^TEditorActionCollection;
-    TEditorActionCollection = object(TCollection)
-      function At(Idx : sw_integer) : PEditorAction;
-      procedure FreeItem(Item: Pointer); virtual;
-    end;
-{$endif Undo}
-
-    TSpecSymbolClass =
-      (ssCommentPrefix,ssCommentSingleLinePrefix,ssCommentSuffix,ssStringPrefix,ssStringSuffix,
-       ssDirectivePrefix,ssDirectiveSuffix,ssAsmPrefix,ssAsmSuffix);
-
-    TEditorBookMark = record
-      Valid  : boolean;
-      Pos    : TPoint;
-    end;
-
-    TCompleteState = (csInactive,csOffering,csDenied);
-
-    PEditorBinding = ^TEditorBinding;
-
-    PEditorBindingCollection = ^TEditorBindingCollection;
-    TEditorBindingCollection = object(TCollection)
-      function At(Index: sw_Integer): PEditorBinding;
-    end;
-
-    TEditorBinding = object(TObject)
-      Editor : PCustomCodeEditor;
-      constructor Init(AEditor: PCustomCodeEditor);
-      destructor  Done; virtual;
-    end;
-
-    PCustomCodeEditorCore = ^TCustomCodeEditorCore;
-    TCustomCodeEditorCore = object(TObject)
-    {$ifdef TP}public{$else}protected{$endif}
-      Bindings    : PEditorBindingCollection;
-      LockFlag    : sw_integer;
-      ChangedLine : sw_integer;
-      ContentsChangedCalled : boolean;
-      LimitsChangedCalled : boolean;
-      ModifiedChangedCalled : boolean;
-      TabSizeChangedCalled : boolean;
-      StoreUndoChangedCalled : boolean;
-{$ifdef TEST_PARTIAL_SYNTAX}
-      LastSyntaxedLine : sw_integer;
-      SyntaxComplete   : boolean;
-{$endif TEST_PARTIAL_SYNTAX}
-    public
-      constructor Init;
-      procedure   BindEditor(AEditor: PCustomCodeEditor);
-      procedure   UnBindEditor(AEditor: PCustomCodeEditor);
-      function    IsEditorBound(AEditor: PCustomCodeEditor): boolean;
-      function    GetBindingCount: sw_integer;
-      function    GetBindingIndex(AEditor: PCustomCodeEditor): sw_integer;
-      function    SearchBinding(AEditor: PCustomCodeEditor): PEditorBinding;
-      function    CanDispose: boolean;
-      destructor  Done; virtual;
-    public
-   {a}function    GetModified: boolean; virtual;
-      function    GetChangedLine: sw_integer;
-   {a}procedure   SetModified(AModified: boolean); virtual;
-   {a}function    GetStoreUndo: boolean; virtual;
-   {a}procedure   SetStoreUndo(AStore: boolean); virtual;
-   {a}function    GetSyntaxCompleted: boolean; virtual;
-   {a}procedure   SetSyntaxCompleted(SC: boolean); virtual;
-   {a}function    GetTabSize: integer; virtual;
-   {a}procedure   SetTabSize(ATabSize: integer); virtual;
-      function    IsClipboard: Boolean;
-    public
-      { Notifications }
-      procedure   BindingsChanged;
-      procedure   ContentsChanged;
-      procedure   LimitsChanged;
-      procedure   ModifiedChanged;
-      procedure   TabSizeChanged;
-      procedure   StoreUndoChanged;
-   {a}procedure   DoContentsChanged; virtual;
-   {a}procedure   DoLimitsChanged; virtual;
-   {a}procedure   DoModifiedChanged; virtual;
-   {a}procedure   DoTabSizeChanged; virtual;
-   {a}procedure   DoStoreUndoChanged; virtual;
-   {a}procedure   DoSyntaxStateChanged; virtual;
-      function    GetLastVisibleLine : sw_integer;
-    public
-      { Storage }
-      function    LoadFromStream(Editor: PCustomCodeEditor; Stream: PStream): boolean; virtual;
-      function    SaveToStream(Editor: PCustomCodeEditor; Stream: PStream): boolean; virtual;
-      function    SaveAreaToStream(Editor: PCustomCodeEditor; Stream: PStream; StartP,EndP: TPoint): boolean; virtual;
-    {$ifdef TP}public{$else}protected{$endif}
-      { Text & info storage abstraction }
-   {a}procedure   ISetLineFlagState(Binding: PEditorBinding; LineNo: sw_integer; Flag: longint; ASet: boolean); virtual;
-   {a}procedure   IGetDisplayTextFormat(Binding: PEditorBinding; LineNo: sw_integer;var DT,DF:string); virtual;
-   {a}function    IGetLineFormat(Binding: PEditorBinding; LineNo: sw_integer): string; virtual;
-   {a}procedure   ISetLineFormat(Binding: PEditorBinding; LineNo: sw_integer;const S: string); virtual;
-    public
-      { Text & info storage abstraction }
-      function    CharIdxToLinePos(Line,CharIdx: sw_integer): sw_integer;
-      function    LinePosToCharIdx(Line,X: sw_integer): sw_integer;
-   {a}function    GetLineCount: sw_integer; virtual;
-   {a}function    GetLine(LineNo: sw_integer): PCustomLine; virtual;
-   {a}function    GetLineText(LineNo: sw_integer): string; virtual;
-   {a}procedure   SetDisplayText(I: sw_integer;const S: string); virtual;
-   {a}function    GetDisplayText(I: sw_integer): string; virtual;
-   {a}procedure   SetLineText(I: sw_integer;const S: string); virtual;
-      procedure   GetDisplayTextFormat(Editor: PCustomCodeEditor; I: sw_integer;var DT,DF:string); virtual;
-      function    GetLineFormat(Editor: PCustomCodeEditor; I: sw_integer): string; virtual;
-      procedure   SetLineFormat(Editor: PCustomCodeEditor; I: sw_integer;const S: string); virtual;
-   {a}procedure   DeleteAllLines; virtual;
-   {a}procedure   DeleteLine(I: sw_integer); virtual;
-   {a}function    InsertLine(LineNo: sw_integer; const S: string): PCustomLine; virtual;
-   {a}procedure   AddLine(const S: string); virtual;
-   {a}procedure   GetContent(ALines: PUnsortedStringCollection); virtual;
-   {a}procedure   SetContent(ALines: PUnsortedStringCollection); virtual;
-   public
-      procedure   Lock(AEditor: PCustomCodeEditor);
-      procedure   UnLock(AEditor: PCustomCodeEditor);
-      function    Locked: boolean;
-   public
-      { Syntax highlight }
-      function    UpdateAttrs(FromLine: sw_integer; Attrs: byte): sw_integer; virtual;
-      function    UpdateAttrsRange(FromLine, ToLine: sw_integer; Attrs: byte): sw_integer; virtual;
-      function    DoUpdateAttrs(Editor: PCustomCodeEditor; FromLine: sw_integer; Attrs: byte): sw_integer; virtual;
-      function    DoUpdateAttrsRange(Editor: PCustomCodeEditor; FromLine, ToLine: sw_integer;
-                  Attrs: byte): sw_integer; virtual;
-   public
-     { Undo info storage }
-   {a}procedure   AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string); virtual;
-   {a}procedure   AddGroupedAction(AAction : byte); virtual;
-   {a}procedure   CloseGroupedAction(AAction : byte); virtual;
-   {a}function    GetUndoActionCount: sw_integer; virtual;
-   {a}function    GetRedoActionCount: sw_integer; virtual;
-      procedure   UpdateUndoRedo(cm : word; action : byte);virtual;
-    end;
-
-    TCaseAction = (caToLowerCase,caToUpperCase,caToggleCase);
-
-    TCustomCodeEditor = object(TScroller)
-      SelStart   : TPoint;
-      SelEnd     : TPoint;
-      Highlight  : TRect;
-      CurPos     : TPoint;
-      LockFlag   : integer;
-      NoSelect   : Boolean;
-      AlwaysShowScrollBars: boolean;
-   public
-{      constructor Load(var S: TStream);
-      procedure   Store(var S: TStream);}
-      procedure   ConvertEvent(var Event: TEvent); virtual;
-      procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   SetState(AState: Word; Enable: Boolean); virtual;
-      procedure   LocalMenu(P: TPoint); virtual;
-      function    GetLocalMenu: PMenu; virtual;
-      function    GetCommandTarget: PView; virtual;
-      function    CreateLocalMenuView(var Bounds: TRect; M: PMenu): PMenuPopup; virtual;
-      function    GetPalette: PPalette; virtual;
-    public
-      procedure   Draw; virtual;
-      procedure   DrawCursor; virtual;
-      procedure   DrawIndicator; virtual;
-    public
-   {a}function    GetFlags: longint; virtual;
-   {a}procedure   SetFlags(AFlags: longint); virtual;
-   {a}function    GetModified: boolean; virtual;
-   {a}procedure   SetModified(AModified: boolean); virtual;
-   {a}function    GetStoreUndo: boolean; virtual;
-   {a}procedure   SetStoreUndo(AStore: boolean); virtual;
-   {a}function    GetSyntaxCompleted: boolean; virtual;
-   {a}procedure   SetSyntaxCompleted(SC: boolean); virtual;
-   {a}function    GetLastSyntaxedLine: sw_integer; virtual;
-   {a}procedure   SetLastSyntaxedLine(ALine: sw_integer); virtual;
-      function    IsFlagSet(AFlag: longint): boolean;
-      function    GetReservedColCount: sw_integer; virtual;
-   {a}function    GetTabSize: integer; virtual;
-   {a}procedure   SetTabSize(ATabSize: integer); virtual;
-   {a}function    IsReadOnly: boolean; virtual;
-   {a}function    IsClipboard: Boolean; virtual;
-   {a}function    GetInsertMode: boolean; virtual;
-   {a}procedure   SetInsertMode(InsertMode: boolean); virtual;
-      procedure   SetCurPtr(X,Y: sw_integer); virtual;
-      procedure   GetSelectionArea(var StartP,EndP: TPoint); virtual;
-      procedure   SetSelection(A, B: TPoint); virtual;
-      procedure   SetHighlight(A, B: TPoint); virtual;
-      procedure   ChangeCaseArea(StartP,EndP: TPoint; CaseAction: TCaseAction); virtual;
-      procedure   SetLineFlagState(LineNo: sw_integer; Flags: longint; ASet: boolean);
-      procedure   SetLineFlagExclusive(Flags: longint; LineNo: sw_integer);
-      procedure   Update; virtual;
-      procedure   ScrollTo(X, Y: sw_Integer);
-      procedure   TrackCursor(Center: boolean); virtual;
-      procedure   Lock; virtual;
-      procedure   UnLock; virtual;
-    public
-      { Text & info storage abstraction }
-   {a}function    GetLineCount: sw_integer; virtual;
-   {a}function    GetLine(LineNo: sw_integer): PCustomLine; virtual;
-   {a}function    CharIdxToLinePos(Line,CharIdx: sw_integer): sw_integer; virtual;
-   {a}function    LinePosToCharIdx(Line,X: sw_integer): sw_integer; virtual;
-   {a}function    GetLineText(I: sw_integer): string; virtual;
-   {a}procedure   SetDisplayText(I: sw_integer;const S: string); virtual;
-   {a}function    GetDisplayText(I: sw_integer): string; virtual;
-   {a}procedure   SetLineText(I: sw_integer;const S: string); virtual;
-   {a}procedure   GetDisplayTextFormat(I: sw_integer;var DT,DF:string); virtual;
-   {a}function    GetLineFormat(I: sw_integer): string; virtual;
-   {a}procedure   SetLineFormat(I: sw_integer;const S: string); virtual;
-   {a}procedure   DeleteAllLines; virtual;
-   {a}procedure   DeleteLine(I: sw_integer); virtual;
-   {a}function    InsertLine(LineNo: sw_integer; const S: string): PCustomLine; virtual;
-   {a}procedure   AddLine(const S: string); virtual;
-   {a}function    GetErrorMessage: string; virtual;
-   {a}procedure   SetErrorMessage(const S: string); virtual;
-   {a}procedure   AdjustSelection(DeltaX, DeltaY: sw_integer);
-   {a}procedure   AdjustSelectionPos(CurPosX, CurPosY: sw_integer; DeltaX, DeltaY: sw_integer);
-   {a}procedure   GetContent(ALines: PUnsortedStringCollection); virtual;
-   {a}procedure   SetContent(ALines: PUnsortedStringCollection); virtual;
-   {a}function    LoadFromStream(Stream: PStream): boolean; virtual;
-   {a}function    SaveToStream(Stream: PStream): boolean; virtual;
-   {a}function    SaveAreaToStream(Stream: PStream; StartP,EndP: TPoint): boolean;virtual;
-      function    LoadFromFile(const AFileName: string): boolean; virtual;
-      function    SaveToFile(const AFileName: string): boolean; virtual;
-    public
-   {a}function    InsertFrom(Editor: PCustomCodeEditor): Boolean; virtual;
-   {a}function    InsertText(const S: string): Boolean; virtual;
-    public
-      procedure   FlagsChanged(OldFlags: longint); virtual;
-   {a}procedure   BindingsChanged; virtual;
-      procedure   ContentsChanged; virtual;
-      procedure   LimitsChanged; virtual;
-      procedure   ModifiedChanged; virtual;
-      procedure   PositionChanged; virtual;
-      procedure   TabSizeChanged; virtual;
-      procedure   SyntaxStateChanged; virtual;
-      procedure   StoreUndoChanged; virtual;
-      procedure   SelectionChanged; virtual;
-      procedure   HighlightChanged; virtual;
-   {a}procedure   DoLimitsChanged; virtual;
-    public
-     { Syntax highlight support }
-   {a}function    GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
-   {a}function    GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string; virtual;
-   {a}function    IsReservedWord(const S: string): boolean; virtual;
-    public
-     { CodeTemplate support }
-   {a}function    TranslateCodeTemplate(const Shortcut: string; ALines: PUnsortedStringCollection): boolean; virtual;
-     { CodeComplete support }
-   {a}function    CompleteCodeWord(const WordS: string; var Text: string): boolean; virtual;
-   {a}function    GetCodeCompleteWord: string; virtual;
-   {a}procedure   SetCodeCompleteWord(const S: string); virtual;
-   {a}function    GetCodeCompleteFrag: string; virtual;
-   {a}procedure   SetCodeCompleteFrag(const S: string); virtual;
-      function    GetCompleteState: TCompleteState; virtual;
-      procedure   SetCompleteState(AState: TCompleteState); virtual;
-      procedure   ClearCodeCompleteWord; virtual;
-     { Fold support }
-      function    GetMaxFoldLevel: sw_integer; virtual;
-      function    GetFoldStringWidth: sw_integer; virtual;
-      procedure   GetFoldStrings(EditorLine: sw_integer; var Prefix, Suffix: openstring); virtual;
-   {a}function    GetFoldCount: sw_integer; virtual;
-   {a}function    GetFold(Index: sw_integer): PFold; virtual;
-   {a}procedure   RegisterFold(AFold: PFold); virtual;
-   {a}procedure   UnRegisterFold(AFold: PFold); virtual;
-      function    ViewToEditorLine(ViewLine: sw_integer): sw_integer;
-      function    EditorToViewLine(EditorLine: sw_integer): sw_integer;
-      procedure   ViewToEditorPoint(P: TPoint; var NP: TPoint);
-      procedure   EditorToViewPoint(P: TPoint; var NP: TPoint);
-     { Fold support }
-      function    CreateFold(StartY,EndY: sw_integer; Collapsed: boolean): boolean; virtual;
-      procedure   FoldChanged(Fold: PFold); virtual;
-      procedure   RemoveAllFolds; virtual;
-   public
-      { Syntax highlight }
-   {a}function    UpdateAttrs(FromLine: sw_integer; Attrs: byte): sw_integer; virtual;
-   {a}function    UpdateAttrsRange(FromLine, ToLine: sw_integer; Attrs: byte): sw_integer; virtual;
-    public
-     { Undo info storage }
-   {a}procedure   AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string); virtual;
-   {a}procedure   AddGroupedAction(AAction : byte); virtual;
-   {a}procedure   CloseGroupedAction(AAction : byte); virtual;
-   {a}function    GetUndoActionCount: sw_integer; virtual;
-   {a}function    GetRedoActionCount: sw_integer; virtual;
-    {$ifdef TP}public{$else}protected{$endif}
-      LastLocalCmd: word;
-      KeyState    : Integer;
-      Bookmarks   : array[0..9] of TEditorBookmark;
-      DrawCalled,
-      DrawCursorCalled: boolean;
-      CurEvent    : PEvent;
-      procedure   DrawLines(FirstLine: sw_integer);
-      function    Overwrite: boolean;
-      function    IsModal: boolean;
-      procedure   CheckSels;
-      procedure   CodeCompleteCheck;
-      procedure   CodeCompleteApply;
-      procedure   CodeCompleteCancel;
-      procedure   UpdateUndoRedo(cm : word; action : byte);
-      procedure   HideHighlight;
-      function    ShouldExtend: boolean;
-      function    ValidBlock: boolean;
-      function    GetLineFold(EditorLine: sw_integer): PFold;
-      function    IsLineVisible(EditorLine: sw_integer): boolean; virtual;
-      function    NextVisibleLine(StartLine: sw_integer; Down: boolean): sw_integer;
-    public
-      { Editor primitives }
-      procedure   SelectAll(Enable: boolean); virtual;
-    public
-      { Editor commands }
-      SearchRunCount: integer;
-      InASCIIMode: boolean;
-      procedure Indent; virtual;
-      procedure CharLeft; virtual;
-      procedure CharRight; virtual;
-      procedure WordLeft; virtual;
-      procedure WordRight; virtual;
-      procedure LineStart; virtual;
-      procedure LineEnd; virtual;
-      procedure LineUp; virtual;
-      procedure LineDown; virtual;
-      procedure PageUp; virtual;
-      procedure PageDown; virtual;
-      procedure TextStart; virtual;
-      procedure TextEnd; virtual;
-      procedure WindowStart; virtual;
-      procedure WindowEnd; virtual;
-      procedure JumpSelStart; virtual;
-      procedure JumpSelEnd; virtual;
-      procedure JumpMark(MarkIdx: integer); virtual;
-      procedure DefineMark(MarkIdx: integer); virtual;
-      procedure JumpToLastCursorPos; virtual;
-      procedure FindMatchingDelimiter(ScanForward: boolean); virtual;
-      procedure CreateFoldFromBlock; virtual;
-      procedure ToggleFold; virtual;
-      procedure CollapseFold; virtual;
-      procedure ExpandFold; virtual;
-      procedure UpperCase; virtual;
-      procedure LowerCase; virtual;
-      procedure WordLowerCase; virtual;
-      procedure WordUpperCase; virtual;
-      procedure InsertOptions; virtual;
-      procedure ToggleCase; virtual;
-      function  InsertNewLine: Sw_integer; virtual;
-      procedure BreakLine; virtual;
-      procedure BackSpace; virtual;
-      procedure DelChar; virtual;
-      procedure DelWord; virtual;
-      procedure DelStart; virtual;
-      procedure DelEnd; virtual;
-      procedure DelLine; virtual;
-      procedure InsMode; virtual;
-      procedure StartSelect; virtual;
-      procedure EndSelect; virtual;
-      procedure DelSelect; virtual;
-      procedure HideSelect; virtual;
-      procedure CopyBlock; virtual;
-      procedure MoveBlock; virtual;
-      procedure IndentBlock; virtual;
-      procedure UnindentBlock; virtual;
-      procedure SelectWord; virtual;
-      procedure SelectLine; virtual;
-      procedure WriteBlock; virtual;
-      procedure ReadBlock; virtual;
-      procedure PrintBlock; virtual;
-      procedure ExpandCodeTemplate; virtual;
-      procedure AddChar(C: char); virtual;
-{$ifdef WinClipSupported}
-      function  ClipCopyWin: Boolean; virtual;
-      function  ClipPasteWin: Boolean; virtual;
-{$endif WinClipSupported}
-      function  ClipCopy: Boolean; virtual;
-      procedure ClipCut; virtual;
-      procedure ClipPaste; virtual;
-      function  GetCurrentWord : string;
-      function  GetCurrentWordArea(var StartP,EndP: TPoint): boolean;
-      procedure Undo; virtual;
-      procedure Redo; virtual;
-      procedure Find; virtual;
-      procedure Replace; virtual;
-      procedure DoSearchReplace; virtual;
-      procedure GotoLine; virtual;
-    end;
-
-    TCodeEditorDialog = function(Dialog: Integer; Info: Pointer): Word;
-
-const
-     EOL : String[2] = {$ifdef Unix}#10;{$else}#13#10;{$endif}
-
-     cmCopyWin = 240;
-     cmPasteWin = 241;
-
-     { History ID }
-     FileId        = 101;
-     TextFindId    = 105;
-     TextReplaceID = 106;
-     GotoID        = 107;
-     TextGrepId    = 108;
-     GrepArgsId    = 109;
-
-     { used for ShiftDel and ShiftIns to avoid
-       GetShiftState to be considered for extending
-       selection (PM) }
-     DontConsiderShiftState: boolean  = false;
-
-     ToClipCmds         : TCommandSet = ([cmCut,cmCopy,cmCopyWin]);
-     FromClipCmds       : TCommandSet = ([cmPaste]);
-     FromWinClipCmds    : TCommandSet = ([cmPasteWin]);
-     NulClipCmds        : TCommandSet = ([cmClear]);
-     UndoCmd            : TCommandSet = ([cmUndo]);
-     RedoCmd            : TCommandSet = ([cmRedo]);
-
-function ExtractTabs(S: string; TabSize: Sw_integer): string;
-
-function StdEditorDialog(Dialog: Integer; Info: Pointer): word;
-
-const
-     DefaultSaveExt     : string[12] = '.pas';
-     FileDir            : DirStr = '';
-
-     EditorDialog       : TCodeEditorDialog = StdEditorDialog;
-     Clipboard          : PCustomCodeEditor = nil;
-     FindStr            : String[FindStrSize] = '';
-     ReplaceStr         : String[FindStrSize] = '';
-     FindFlags          : word = ffPromptOnReplace;
-     WhiteSpaceChars    : set of char = [#0,#32,#255];
-     TabChars           : set of char = [#9];
-     HashChars          : set of char = ['#'];
-     AlphaChars         : set of char = ['A'..'Z','a'..'z','_'];
-     NumberChars        : set of char = ['0'..'9'];
-     RealNumberChars    : set of char = ['E','e','.'{,'+','-'}];
-
-procedure RegisterWEditor;
-
-implementation
-
-uses
-  MsgBox,Dialogs,App,StdDlg,Validate,
-{$ifdef WinClipSupported}
-  Strings,WinClip,
-{$endif WinClipSupported}
-  WConsts,WViews,WCEdit;
-
-type
-     TFindDialogRec = packed record
-       Find     : String[FindStrSize];
-       Options  : Word{longint};
-       { checkboxes need 32  bits PM  }
-       { reverted to word in dialogs.TCluster for TP compatibility (PM) }
-       { anyhow its complete nonsense : you can only have 16 fields
-         but use a longint to store it !! }
-       Direction: word;{ and tcluster has word size }
-       Scope    : word;
-       Origin   : word;
-     end;
-
-     TReplaceDialogRec = packed record
-       Find     : String[FindStrSize];
-       Replace  : String[FindStrSize];
-       Options  : Word{longint};
-       Direction: word;
-       Scope    : word;
-       Origin   : word;
-     end;
-
-     TGotoLineDialogRec = packed record
-       LineNo  : string[5];
-       Lines   : sw_integer;
-     end;
-
-const
-     kbShift = kbLeftShift+kbRightShift;
-
-const
-  FirstKeyCount = 46;
-  FirstKeys: array[0..FirstKeyCount * 2] of Word = (FirstKeyCount,
-    Ord(^A), cmWordLeft, Ord(^B), cmJumpLine, Ord(^C), cmPageDown,
-    Ord(^D), cmCharRight, Ord(^E), cmLineUp,
-    Ord(^F), cmWordRight, Ord(^G), cmDelChar,
-    Ord(^H), cmBackSpace, Ord(^J), cmExpandCodeTemplate,
-    Ord(^K), $FF02, Ord(^L), cmSearchAgain,
-    Ord(^M), cmNewLine, Ord(^N), cmBreakLine,
-    Ord(^O), $FF03,
-    Ord(^P), cmASCIIChar, Ord(^Q), $FF01,
-    Ord(^R), cmPageUp, Ord(^S), cmCharLeft,
-    Ord(^T), cmDelWord, Ord(^U), cmUndo,
-    Ord(^V), cmInsMode, Ord(^X), cmLineDown,
-    Ord(^Y), cmDelLine, kbLeft, cmCharLeft,
-    kbRight, cmCharRight, kbCtrlLeft, cmWordLeft,
-    kbCtrlRight, cmWordRight, kbHome, cmLineStart,
-    kbCtrlHome, cmWindowStart, kbCtrlEnd, cmWindowEnd,
-    kbEnd, cmLineEnd, kbUp, cmLineUp,
-    kbDown, cmLineDown, kbPgUp, cmPageUp,
-    kbPgDn, cmPageDown, kbCtrlPgUp, cmTextStart,
-    kbCtrlPgDn, cmTextEnd, kbIns, cmInsMode,
-    kbDel, cmDelChar, kbShiftIns, cmPaste,
-    kbShiftDel, cmCut, kbCtrlIns, cmCopy,
-    kbCtrlDel, cmClear,
-    kbCtrlGrayMul, cmToggleFold, kbCtrlGrayMinus, cmCollapseFold, kbCtrlGrayPlus, cmExpandFold);
-  QuickKeyCount = 29;
-  QuickKeys: array[0..QuickKeyCount * 2] of Word = (QuickKeyCount,
-    Ord('A'), cmReplace, Ord('C'), cmTextEnd,
-    Ord('D'), cmLineEnd, Ord('F'), cmFind,
-    Ord('H'), cmDelStart, Ord('R'), cmTextStart,
-    Ord('S'), cmLineStart, Ord('Y'), cmDelEnd,
-    Ord('G'), cmJumpLine, Ord('A'), cmReplace,
-    Ord('B'), cmSelStart, Ord('K'), cmSelEnd,
-    Ord('P'), cmLastCursorPos,
-    Ord('E'), cmWindowStart, Ord('T'), cmWindowStart,
-    Ord('U'), cmWindowEnd, Ord('X'), cmWindowEnd,
-    Ord('['), cmFindMatchingDelimiter, Ord(']'), cmFindMatchingDelimiterBack,
-    Ord('0'), cmJumpMark0, Ord('1'), cmJumpMark1, Ord('2'), cmJumpMark2,
-    Ord('3'), cmJumpMark3, Ord('4'), cmJumpMark4, Ord('5'), cmJumpMark5,
-    Ord('6'), cmJumpMark6, Ord('7'), cmJumpMark7, Ord('8'), cmJumpMark8,
-    Ord('9'), cmJumpMark9);
-  BlockKeyCount = 30;
-  BlockKeys: array[0..BlockKeyCount * 2] of Word = (BlockKeyCount,
-    Ord('B'), cmStartSelect, Ord('C'), cmCopyBlock,
-    Ord('H'), cmHideSelect, Ord('K'), cmEndSelect,
-    Ord('Y'), cmDelSelect, Ord('V'), cmMoveBlock,
-    Ord('I'), cmIndentBlock, Ord('U'), cmUnindentBlock,
-    Ord('T'), cmSelectWord, Ord('L'), cmSelectLine,
-    Ord('W'), cmWriteBlock, Ord('R'), cmReadBlock,
-    Ord('P'), cmPrintBlock,
-    Ord('N'), cmUpperCase, Ord('O'), cmLowerCase,
-    Ord('D'), cmActivateMenu,
-    Ord('E'), cmWordLowerCase, Ord('F'), cmWordUpperCase,
-    Ord('S'), cmSave, Ord('A'), cmCreateFold,
-    Ord('0'), cmSetMark0, Ord('1'), cmSetMark1, Ord('2'), cmSetMark2,
-    Ord('3'), cmSetMark3, Ord('4'), cmSetMark4, Ord('5'), cmSetMark5,
-    Ord('6'), cmSetMark6, Ord('7'), cmSetMark7, Ord('8'), cmSetMark8,
-    Ord('9'), cmSetMark9);
-  MiscKeyCount = 6;
-  MiscKeys: array[0..MiscKeyCount * 2] of Word = (MiscKeyCount,
-    Ord('A'), cmOpenAtCursor, Ord('B'), cmBrowseAtCursor,
-    Ord('G'), cmJumpLine, Ord('O'), cmInsertOptions,
-    Ord('U'), cmToggleCase, Ord('L'), cmSelectLine);
-  KeyMap: array[0..3] of Pointer = (@FirstKeys, @QuickKeys, @BlockKeys, @MiscKeys);
-
-function ScanKeyMap(KeyMap: Pointer; KeyCode: Word): Word;
-type
-  pword = ^word;
-var
-  p : pword;
-  count : sw_word;
-begin
-  p:=keymap;
-  count:=p^;
-  inc(p);
-  while (count>0) do
-   begin
-     if (lo(p^)=lo(keycode)) and
-        ((hi(p^)=0) or (hi(p^)=hi(keycode))) then
-      begin
-        inc(p);
-        scankeymap:=p^;
-        Exit;
-      end;
-     inc(p,2);
-     dec(count);
-   end;
-  scankeymap:=0;
-end;
-
-function IsWordSeparator(C: char): boolean;
-begin
-  IsWordSeparator:=C in[' ',#0,#255,':','=','''','"','.',',','/',';','$','#','(',')','<','>','^','*','+','-','?','&','[',']'];
-end;
-
-{function IsSpace(C: char): boolean;
-begin
-  IsSpace:=C in[' ',#0,#255];
-end;}
-
-function LTrim(S: string): string;
-begin
-  while (length(S)>0) and (S[1] in [#0,TAB,#32]) do
-    Delete(S,1,1);
-  LTrim:=S;
-end;
-
-{ TAB are not same as spaces if UseTabs is set PM }
-function RTrim(S: string;cut_tabs : boolean): string;
-begin
-  while (length(S)>0) and
-    ((S[length(S)] in [#0,#32]) or
-    ((S[Length(S)]=TAB) and cut_tabs)) do
-    Delete(S,length(S),1);
-  RTrim:=S;
-end;
-
-function Trim(S: string): string;
-begin
-  Trim:=RTrim(LTrim(S),true);
-end;
-
-function EatIO: integer;
-begin
-  EatIO:=IOResult;
-end;
-
-function ExistsFile(const FileName: string): boolean;
-var f: file;
-    Exists: boolean;
-begin
-  if FileName='' then Exists:=false else
- begin
-  {$I-}
-  Assign(f,FileName);
-  Reset(f,1);
-  Exists:=EatIO=0;
-  Close(f);
-  EatIO;
-  {$I+}
- end;
-  ExistsFile:=Exists;
-end;
-
-function StrToInt(const S: string): longint;
-var L: longint;
-    C: integer;
-begin
-  Val(S,L,C); if C<>0 then L:=-1;
-  StrToInt:=L;
-end;
-
-function RExpand(const S: string; MinLen: byte): string;
-begin
-  if length(S)<MinLen then
-   RExpand:=S+CharStr(' ',MinLen-length(S))
-  else
-   RExpand:=S;
-end;
-
-function upper(const s : string) : string;
-var
-  i  : Sw_word;
-begin
-  for i:=1 to length(s) do
-   if s[i] in ['a'..'z'] then
-    upper[i]:=char(byte(s[i])-32)
-   else
-    upper[i]:=s[i];
-  upper[0]:=s[0];
-end;
-
-type TPosOfs = {$ifdef TP}longint{$endif}{$ifdef FPC}comp{$endif};
-
-function PosToOfs(const X,Y: sw_integer): TPosOfs;
-type TPosRec = record LoI, HiI: sw_integer; end;
-var C: TPosRec;
-begin
-  C.LoI:=X; C.HiI:=Y;
-  PosToOfs:=TPosOfs(C);
-end;
-
-function PosToOfsP(const P: TPoint): TPosOfs;
-begin
-  PosToOfsP:=PosToOfs(P.X,P.Y);
-end;
-
-function PointOfs(P: TPoint): TPosOfs;
-begin
-  PointOfs:={longint(P.Y)*MaxLineLength+P.X}PosToOfsP(P);
-end;
-
-{$ifndef Undo}
-function NewEditorAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string): PEditorAction;
-var P: PEditorAction;
-begin
-  New(P); FillChar(P^,SizeOf(P^),0);
-  with P^ do
-  begin
-    Action:=AAction;
-    StartPos:=AStartPos; EndPos:=AEndPos;
-    Text:=NewStr(AText);
-  end;
-  NewEditorAction:=P;
-end;
-
-procedure DisposeEditorAction(P: PEditorAction);
-begin
-  if P<>nil then
-  begin
-    if P^.Text<>nil then DisposeStr(P^.Text); P^.Text:=nil;
-    Dispose(P);
-  end;
-end;
-{$endif ndef Undo}
-
-function ExtractTabs(S: string; TabSize: Sw_integer): string;
-var
-  P,PAdd: Sw_Word;
-begin
-  p:=0;
-  while p<length(s) do
-   begin
-     inc(p);
-     if s[p]=TAB then
-      begin
-        PAdd:=TabSize-((p-1) mod TabSize);
-        s:=copy(S,1,P-1)+CharStr(' ',PAdd)+copy(S,P+1,High(s));
-        inc(P,PAdd-1);
-      end;
-   end;
-  ExtractTabs:=S;
-end;
-
-{function CompressUsingTabs(S: string; TabSize: byte): string;
-var TabS: string;
-    P: byte;
-begin
-  TabS:=CharStr(' ',TabSize);
-  repeat
-    P:=Pos(TabS,S);
-    if P>0 then
-      S:=copy(S,1,P-1)+TAB+copy(S,P+TabSize,High(S));
-  until P=0;
-  CompressUsingTabs:=S;
-end;}
-
-
-{*****************************************************************************
-                           Forward/Backward Scanning
-*****************************************************************************}
-
-Const
-{$ifndef FPC}
-  MaxBufLength   = $7f00;
-  NotFoundValue  = -1;
-{$else}
-  MaxBufLength   = $7fffff00;
-  NotFoundValue  = -1;
-{$endif}
-
-Type
-  Btable = Array[0..255] of Byte;
-Procedure BMFMakeTable(const s:string; Var t : Btable);
-Var
-  x : sw_integer;
-begin
-  FillChar(t,sizeof(t),length(s));
-  For x := length(s) downto 1 do
-   if (t[ord(s[x])] = length(s)) then
-    t[ord(s[x])] := length(s) - x;
-end;
-
-
-function BMFScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): Sw_Integer;
-Var
-  buffer : Array[0..MaxBufLength-1] of Byte Absolute block;
-  s2     : String;
-  len,
-  numb   : Sw_Word;
-  found  : Boolean;
-begin
-  len:=length(str);
-  if len>size then
-   begin
-     BMFScan := NotFoundValue;
-     exit;
-   end;
-  s2[0]:=chr(len);       { sets the length to that of the search String }
-  found:=False;
-  numb:=pred(len);
-  While (not found) and (numb<size) do
-   begin
-     { partial match }
-     if buffer[numb] = ord(str[len]) then
-      begin
-        { less partial! }
-        if buffer[numb-pred(len)] = ord(str[1]) then
-         begin
-           move(buffer[numb-pred(len)],s2[1],len);
-           if (str=s2) then
-            begin
-              found:=true;
-              break;
-            end;
-         end;
-        inc(numb);
-     end
-    else
-     inc(numb,Bt[buffer[numb]]);
-  end;
-  if not found then
-    BMFScan := NotFoundValue
-  else
-    BMFScan := numb - pred(len);
-end;
-
-
-function BMFIScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): Sw_Integer;
-Var
-  buffer : Array[0..MaxBufLength-1] of Char Absolute block;
-  len,
-  numb,
-  x      : Sw_Word;
-  found  : Boolean;
-  p      : pchar;
-  c      : char;
-begin
-  len:=length(str);
-  if (len=0) or (len>size) then
-   begin
-     BMFIScan := NotFoundValue;
-     exit;
-   end;
-  found:=False;
-  numb:=pred(len);
-  While (not found) and (numb<size) do
-   begin
-     { partial match }
-     c:=buffer[numb];
-     if c in ['a'..'z'] then
-      c:=chr(ord(c)-32);
-     if (c=str[len]) then
-      begin
-        { less partial! }
-        p:=@buffer[numb-pred(len)];
-        x:=1;
-        while (x<=len) do
-         begin
-           if not(((p^ in ['a'..'z']) and (chr(ord(p^)-32)=str[x])) or
-             (p^=str[x])) then
-            break;
-           inc(p);
-           inc(x);
-         end;
-        if (x>len) then
-         begin
-           found:=true;
-           break;
-         end;
-        inc(numb);
-      end
-     else
-      inc(numb,Bt[ord(c)]);
-   end;
-  if not found then
-    BMFIScan := NotFoundValue
-  else
-    BMFIScan := numb - pred(len);
-end;
-
-
-Procedure BMBMakeTable(const s:string; Var t : Btable);
-Var
-  x : sw_integer;
-begin
-  FillChar(t,sizeof(t),length(s));
-  For x := 1 to length(s)do
-   if (t[ord(s[x])] = length(s)) then
-    t[ord(s[x])] := x-1;
-end;
-
-
-function BMBScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): Sw_Integer;
-Var
-  buffer : Array[0..MaxBufLength-1] of Byte Absolute block;
-  s2     : String;
-  len,
-  numb   : Sw_integer;
-  found  : Boolean;
-begin
-  len:=length(str);
-  if len>size then
-   begin
-     BMBScan := NotFoundValue;
-     exit;
-   end;
-  s2[0]:=chr(len);       { sets the length to that of the search String }
-  found:=False;
-  numb:=size-pred(len);
-  While (not found) and (numb>0) do
-   begin
-     { partial match }
-     if buffer[numb] = ord(str[1]) then
-      begin
-        { less partial! }
-        if buffer[numb+pred(len)] = ord(str[len]) then
-         begin
-           move(buffer[numb],s2[1],len);
-           if (str=s2) then
-            begin
-              found:=true;
-              break;
-            end;
-         end;
-        dec(numb);
-     end
-    else
-     dec(numb,Bt[buffer[numb]]);
-  end;
-  if not found then
-    BMBScan := NotFoundValue
-  else
-    BMBScan := numb;
-end;
-
-
-function BMBIScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): Sw_Integer;
-Var
-  buffer : Array[0..MaxBufLength-1] of Char Absolute block;
-  len,
-  numb,
-  x      : Sw_integer;
-  found  : Boolean;
-  p      : pchar;
-  c      : char;
-begin
-  len:=length(str);
-  if (len=0) or (len>size) then
-   begin
-     BMBIScan := NotFoundValue;
-     exit;
-   end;
-  found:=False;
-  numb:=size-len;
-  While (not found) and (numb>0) do
-   begin
-     { partial match }
-     c:=buffer[numb];
-     if c in ['a'..'z'] then
-      c:=chr(ord(c)-32);
-     if (c=str[1]) then
-      begin
-        { less partial! }
-        p:=@buffer[numb];
-        x:=1;
-        while (x<=len) do
-         begin
-           if not(((p^ in ['a'..'z']) and (chr(ord(p^)-32)=str[x])) or
-             (p^=str[x])) then
-            break;
-           inc(p);
-           inc(x);
-         end;
-        if (x>len) then
-         begin
-           found:=true;
-           break;
-         end;
-        dec(numb);
-      end
-     else
-      dec(numb,Bt[ord(c)]);
-   end;
-  if not found then
-    BMBIScan := NotFoundValue
-  else
-    BMBIScan := numb;
-end;
-
-
-{*****************************************************************************
-                            PLine,TLineCollection
-*****************************************************************************}
-
-constructor TCustomLine.Init(const AText: string; AFlags: longint);
-begin
-  inherited Init;
-  SetText(AText);
-end;
-
-function TCustomLine.GetText: string;
-begin
-  Abstract; GetText:='';
-end;
-
-procedure TCustomLine.SetText(const AText: string);
-begin
-  Abstract;
-end;
-
-function TCustomLine.GetEditorInfo(Editor: PCustomCodeEditor): PEditorLineInfo;
-begin
-  Abstract;
-  GetEditorInfo:=nil;
-end;
-
-function TCustomLine.GetFlags: longint;
-begin
-  Abstract;
-  GetFlags:=0;
-end;
-
-procedure TCustomLine.SetFlags(AFlags: longint);
-begin
-  Abstract;
-end;
-
-function TCustomLine.IsFlagSet(AFlag: longint): boolean;
-begin
-  IsFlagSet:=(GetFlags and AFlag)=AFlag;
-end;
-
-procedure TCustomLine.SetFlagState(AFlag: longint; ASet: boolean);
-var N,O: longint;
-begin
-  O:=GetFlags; N:=O;
-  if ASet then
-    N:=N or AFlag
-  else
-    N:=N and (not AFlag);
-  if N<>O then
-    SetFlags(N);
-end;
-
-procedure TCustomLine.AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor);
-begin
-  { Abstract }
-end;
-
-procedure TCustomLine.RemoveEditorInfo(AEditor: PCustomCodeEditor);
-begin
-  { Abstract }
-end;
-
-destructor TCustomLine.Done;
-begin
-  inherited Done;
-end;
-
-function TLineCollection.At(Index: sw_Integer): PCustomLine;
-begin
-  At:=inherited At(Index);
-end;
-
-constructor TFold.Init(AEditor: PCustomCodeEditor; AParentFold: PFold; ACollapsed: boolean);
-begin
-  inherited Init;
-  New(Childs, Init(10,10));
-  Editor:=AEditor;
-  ParentFold:=AParentFold;
-  if Assigned(ParentFold) then
-    ParentFold^.AddChildReference(@Self);
-  Collapsed_:=ACollapsed;
-  if Assigned(AEditor) then
-    Editor^.RegisterFold(@Self);
-end;
-
-procedure TFold.AddReference(P: PObject);
-begin
-  Inc(ReferenceCount);
-end;
-
-procedure TFold.RemoveReference(P: PObject);
-begin
-  Dec(ReferenceCount);
-  if CanDispose then
-    Free;
-end;
-
-procedure TFold.AddLineReference(Line: PEditorLineInfo);
-begin
-  Inc(LineCount_);
-  AddReference(Line);
-end;
-
-procedure TFold.RemoveLineReference(Line: PEditorLineInfo);
-begin
-  Dec(LineCount_);
-  RemoveReference(Line);
-end;
-
-procedure TFold.AddChildReference(Fold: PFold);
-begin
-  Childs^.Insert(Fold);
-  AddReference(Fold);
-end;
-
-procedure TFold.RemoveChildReference(Fold: PFold);
-begin
-  Childs^.Delete(Fold);
-  RemoveReference(Fold);
-end;
-
-function TFold.CanDispose: boolean;
-begin
-  CanDispose:=ReferenceCount<=0;
-end;
-
-function TFold.IsCollapsed: boolean;
-var C: boolean;
-begin
-  C:=Collapsed_;
-  if Assigned(ParentFold) then C:=C or ParentFold^.IsCollapsed;
-  IsCollapsed:=C;
-end;
-
-function TFold.IsParent(AFold: PFold): boolean;
-var P: boolean;
-begin
-  P:=(ParentFold=AFold);
-  if Assigned(ParentFold) then P:=P or ParentFold^.IsParent(AFold);
-  IsParent:=P;
-end;
-
-function TFold.GetLineCount: sw_integer;
-var Count: sw_integer;
-procedure AddIt(P: PFold); {$ifndef FPC}far;{$endif}
-begin
-  Inc(Count,P^.GetLineCount);
-end;
-begin
-  Count:=LineCount_;
-  if assigned(Childs) then Childs^.ForEach(@AddIt);
-  GetLineCount:=Count;
-end;
-
-procedure TFold.Collapse(ACollapse: boolean);
-begin
-  if ACollapse<>Collapsed_ then
-  begin
-    Collapsed_:=ACollapse;
-    if (not Collapsed_) and Assigned(ParentFold) then
-      ParentFold^.Collapse(false);
-    Changed;
-  end;
-end;
-
-procedure TFold.Changed;
-begin
-  if Assigned(Editor) then
-    Editor^.FoldChanged(@Self);
-end;
-
-function TFold.GetLevel: sw_integer;
-var Level: sw_integer;
-begin
-  Level:=0;
-  if Assigned(ParentFold) then
-    Inc(Level,1+ParentFold^.GetLevel);
-  GetLevel:=Level;
-end;
-
-destructor TFold.Done;
-begin
-  if Assigned(ParentFold) then
-    ParentFold^.RemoveChildReference(@Self);
-  if Assigned(Editor) then
-    Editor^.UnRegisterFold(@Self);
-  Childs^.DeleteAll; Dispose(Childs, Done);
-  inherited Done;
-end;
-
-function TFoldCollection.At(Index: sw_Integer): PFold;
-begin
-  At:=inherited At(Index);
-end;
-
-constructor TEditorLineInfo.Init(AEditor: PCustomCodeEditor);
-begin
-  inherited Init;
-  Editor:=AEditor;
-end;
-
-function TEditorLineInfo.GetFormat: string;
-begin
-  GetFormat:=GetStr(Format);
-end;
-
-procedure TEditorLineInfo.SetFormat(const AFormat: string);
-begin
-  SetStr(Format,AFormat);
-end;
-
-procedure TEditorLineInfo.SetFold(AFold: PFold);
-begin
-  if Assigned(Fold) then
-    Fold^.RemoveLineReference(@Self);
-  Fold:=AFold;
-  if Assigned(Fold) then
-    Fold^.AddLineReference(@Self);
-end;
-
-destructor TEditorLineInfo.Done;
-begin
-  if Format<>nil then DisposeStr(Format); Format:=nil;
-  SetFold(nil);
-  inherited Done;
-end;
-
-function TEditorLineInfoCollection.At(Index: sw_Integer): PEditorLineInfo;
-begin
-  At:=inherited At(Index);
-end;
-
-function TEditorBindingCollection.At(Index: sw_Integer): PEditorBinding;
-begin
-  At:=inherited At(Index);
-end;
-
-constructor TEditorBinding.Init(AEditor: PCustomCodeEditor);
-begin
-  inherited Init;
-  Editor:=AEditor;
-end;
-
-destructor TEditorBinding.Done;
-begin
-  inherited Done;
-end;
-
-constructor TCustomCodeEditorCore.Init;
-begin
-  inherited Init;
-  New(Bindings, Init(10,10));
-end;
-
-procedure TCustomCodeEditorCore.BindEditor(AEditor: PCustomCodeEditor);
-var B: PEditorBinding;
-    Count,I,Idx: sw_integer;
-    L: PCustomLine;
-begin
-  if Assigned(AEditor)=false then Exit;
-
-  New(B, Init(AEditor));
-  Bindings^.Insert(B);
-  Idx:=Bindings^.IndexOf(B);
-  Count:=GetLineCount;
-  for I:=0 to Count-1 do
-  begin
-    L:=GetLine(I);
-    if Assigned(L) then
-      L^.AddEditorInfo(Idx,AEditor);
-  end;
-
-  BindingsChanged;
-end;
-
-procedure TCustomCodeEditorCore.UnBindEditor(AEditor: PCustomCodeEditor);
-var B: PEditorBinding;
-    Count,I: sw_integer;
-    L: PCustomLine;
-begin
-  B:=SearchBinding(AEditor);
-  if Assigned(B) then
-  begin
-    Count:=GetLineCount;
-    for I:=0 to Count-1 do
-    begin
-      L:=GetLine(I);
-      if Assigned(L) then
-        L^.RemoveEditorInfo(AEditor);
-    end;
-    Bindings^.Free(B);
-
-    BindingsChanged;
-  end;
-end;
-
-function TCustomCodeEditorCore.IsEditorBound(AEditor: PCustomCodeEditor): boolean;
-begin
-  IsEditorBound:=SearchBinding(AEditor)<>nil;
-end;
-
-function TCustomCodeEditorCore.GetBindingCount: sw_integer;
-begin
-  GetBindingCount:=Bindings^.Count;
-end;
-
-function TCustomCodeEditorCore.GetBindingIndex(AEditor: PCustomCodeEditor): sw_integer;
-var B: PEditorBinding;
-begin
-  B:=SearchBinding(AEditor);
-  GetBindingIndex:=Bindings^.IndexOf(B);
-end;
-
-function TCustomCodeEditorCore.SearchBinding(AEditor: PCustomCodeEditor): PEditorBinding;
-function SearchEditor(P: PEditorBinding): boolean; {$ifndef FPC}far;{$endif}
-begin
-  SearchEditor:=P^.Editor=AEditor;
-end;
-begin
-  SearchBinding:=Bindings^.FirstThat(@SearchEditor);
-end;
-
-function TCustomCodeEditorCore.CanDispose: boolean;
-begin
-  CanDispose:=Assigned(Bindings) and (Bindings^.Count=0);
-end;
-
-function TCustomCodeEditorCore.GetModified: boolean;
-begin
-  Abstract;
-  GetModified:=true;
-end;
-function TCustomCodeEditorCore.GetChangedLine: sw_integer;
-begin
-  GetChangedLine:=ChangedLine;
-end;
-
-procedure TCustomCodeEditorCore.SetModified(AModified: boolean);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditorCore.GetStoreUndo: boolean;
-begin
-  Abstract;
-  GetStoreUndo:=false;
-end;
-
-procedure TCustomCodeEditorCore.SetStoreUndo(AStore: boolean);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditorCore.GetSyntaxCompleted: boolean;
-begin
-  Abstract;
-  GetSyntaxCompleted:=true;
-end;
-
-procedure TCustomCodeEditorCore.SetSyntaxCompleted(SC : boolean);
-begin
-  Abstract;
-end;
-
-
-function TCustomCodeEditorCore.IsClipboard: Boolean;
-function IsClip(P: PEditorBinding): boolean; {$ifndef FPC}far;{$endif}
-begin
-  IsClip:=(P^.Editor=Clipboard);
-end;
-begin
-  IsClipBoard:=Bindings^.FirstThat(@IsClip)<>nil;
-end;
-
-function TCustomCodeEditorCore.GetTabSize: integer;
-begin
-  Abstract;
-  GetTabSize:=0;
-end;
-
-procedure TCustomCodeEditorCore.SetTabSize(ATabSize: integer);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditorCore.LimitsChanged;
-begin
-  if Locked then
-    LimitsChangedCalled:=true
-  else
-    DoLimitsChanged;
-end;
-
-procedure TCustomCodeEditorCore.ContentsChanged;
-begin
-  if Locked then
-    ContentsChangedCalled:=true
-  else
-    DoContentsChanged;
-end;
-
-procedure TCustomCodeEditorCore.ModifiedChanged;
-begin
-  if Locked then
-    ModifiedChangedCalled:=true
-  else
-    DoModifiedChanged;
-end;
-
-procedure TCustomCodeEditorCore.TabSizeChanged;
-begin
-  if Locked then
-    TabSizeChangedCalled:=true
-  else
-    DoTabSizeChanged;
-end;
-
-procedure TCustomCodeEditorCore.StoreUndoChanged;
-begin
-  if Locked then
-    StoreUndoChangedCalled:=true
-  else
-    DoStoreUndoChanged;
-end;
-
-
-procedure TCustomCodeEditorCore.BindingsChanged;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  P^.Editor^.BindingsChanged;
-end;
-begin
-  Bindings^.ForEach(@CallIt);
-end;
-
-procedure TCustomCodeEditorCore.DoLimitsChanged;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  P^.Editor^.DoLimitsChanged;
-end;
-begin
-  Bindings^.ForEach(@CallIt);
-end;
-
-procedure TCustomCodeEditorCore.DoContentsChanged;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  P^.Editor^.ContentsChanged;
-end;
-begin
-  Bindings^.ForEach(@CallIt);
-end;
-
-procedure TCustomCodeEditorCore.DoModifiedChanged;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  P^.Editor^.ModifiedChanged;
-end;
-begin
-  Bindings^.ForEach(@CallIt);
-end;
-
-procedure TCustomCodeEditorCore.DoTabSizeChanged;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  P^.Editor^.TabSizeChanged;
-end;
-begin
-  Bindings^.ForEach(@CallIt);
-end;
-
-procedure TCustomCodeEditorCore.UpdateUndoRedo(cm : word; action : byte);
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  if (P^.Editor^.State and sfActive)<>0 then
-    begin
-      P^.Editor^.UpdateUndoRedo(cm,action);
-    if cm=cmUndo then
-      begin
-        P^.Editor^.SetCmdState(UndoCmd,true);
-        P^.Editor^.SetCmdState(RedoCmd,false);
-        Message(Application,evBroadcast,cmCommandSetChanged,nil);
-      end;
-    end;
-end;
-begin
-  Bindings^.ForEach(@CallIt);
-end;
-
-
-procedure TCustomCodeEditorCore.DoStoreUndoChanged;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  P^.Editor^.StoreUndoChanged;
-end;
-begin
-  Bindings^.ForEach(@CallIt);
-end;
-procedure   TCustomCodeEditorCore.DoSyntaxStateChanged;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  P^.Editor^.SyntaxStateChanged;
-end;
-begin
-  Bindings^.ForEach(@CallIt);
-end;
-
-function TCustomCodeEditorCore.GetLastVisibleLine : sw_integer;
-var
-  y : sw_integer;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-begin
-  if y < P^.Editor^.Delta.Y+P^.Editor^.Size.Y then
-    y:=P^.Editor^.Delta.Y+P^.Editor^.Size.Y;
-end;
-begin
-  y:=0;
-  Bindings^.ForEach(@CallIt);
-  GetLastVisibleLine:=y;
-end;
-
-function TCustomCodeEditorCore.SaveToStream(Editor: PCustomCodeEditor; Stream: PStream): boolean;
-var A,B: TPoint;
-begin
-  A.Y:=0; A.X:=0;
-  B.Y:=GetLineCount-1;
-  if GetLineCount>0 then
-    B.X:=length(GetDisplayText(B.Y))
-  else
-    B.X:=0;
-  SaveToStream:=SaveAreaToStream(Editor,Stream,A,B);
-end;
-
-procedure TCustomCodeEditorCore.ISetLineFlagState(Binding: PEditorBinding; LineNo: sw_integer; Flag: longint; ASet: boolean);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditorCore.IGetDisplayTextFormat(Binding: PEditorBinding; LineNo: sw_integer;var DT,DF:string);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditorCore.IGetLineFormat(Binding: PEditorBinding; LineNo: sw_integer): string;
-begin
-  Abstract;
-  IGetLineFormat:='';
-end;
-
-procedure TCustomCodeEditorCore.ISetLineFormat(Binding: PEditorBinding; LineNo: sw_integer;const S: string);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditorCore.CharIdxToLinePos(Line,CharIdx: sw_integer): sw_integer;
-var S: string;
-    TabSize,CP,RX: sw_integer;
-begin
-  S:=GetLineText(Line);
-  TabSize:=GetTabSize;
-  CP:=1; RX:=0;
-  while {(CP<=length(S)) and }(CP<=CharIdx) do
-   begin
-     if (CP<=length(S)) and (S[CP]=TAB) then
-       Inc(RX,GetTabSize-(RX mod TabSize))
-     else
-       Inc(RX);
-     Inc(CP);
-   end;
-  CharIdxToLinePos:=RX-1;
-end;
-
-function TCustomCodeEditorCore.LinePosToCharIdx(Line,X: sw_integer): sw_integer;
-var S: string;
-    TabSize,CP,RX: sw_integer;
-begin
-  TabSize:=GetTabSize;
-  S:=GetLineText(Line);
-  if S='' then
-    CP:=0
-  else
-    begin
-     CP:=0; RX:=0;
-     while (RX<=X) and (CP<=length(S)) do
-      begin
-        Inc(CP);
-        if S[CP]=TAB then
-          Inc(RX,TabSize-(RX mod TabSize))
-        else
-          Inc(RX);
-      end;
-    end;
-  LinePosToCharIdx:=CP;
-end;
-
-function TCustomCodeEditorCore.GetLineCount: sw_integer;
-begin
-  Abstract;
-  GetLineCount:=0;
-end;
-
-function TCustomCodeEditorCore.GetLine(LineNo: sw_integer): PCustomLine;
-begin
-  Abstract;
-  GetLine:=nil;
-end;
-
-function TCustomCodeEditorCore.GetLineText(LineNo: sw_integer): string;
-begin
-  Abstract;
-  GetLineText:='';
-end;
-
-procedure TCustomCodeEditorCore.SetDisplayText(I: sw_integer;const S: string);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditorCore.GetDisplayText(I: sw_integer): string;
-begin
-  Abstract;
-  GetDisplayText:='';
-end;
-
-procedure TCustomCodeEditorCore.SetLineText(I: sw_integer;const S: string);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditorCore.GetDisplayTextFormat(Editor: PCustomCodeEditor; I: sw_integer;var DT,DF:string);
-begin
-  IGetDisplayTextFormat(SearchBinding(Editor),I,DT,DF);
-end;
-
-function TCustomCodeEditorCore.GetLineFormat(Editor: PCustomCodeEditor; I: sw_integer): string;
-begin
-  GetLineFormat:=IGetLineFormat(SearchBinding(Editor),I);
-end;
-
-procedure TCustomCodeEditorCore.SetLineFormat(Editor: PCustomCodeEditor; I: sw_integer; const S: string);
-begin
-  ISetLineFormat(SearchBinding(Editor),I,S);
-end;
-
-procedure TCustomCodeEditorCore.DeleteAllLines;
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditorCore.DeleteLine(I: sw_integer);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditorCore.InsertLine(LineNo: sw_integer; const S: string): PCustomLine;
-begin
-  Abstract;
-  InsertLine:=nil; { eliminate compiler warning }
-end;
-
-procedure TCustomCodeEditorCore.AddLine(const S: string);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditorCore.GetContent(ALines: PUnsortedStringCollection);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditorCore.SetContent(ALines: PUnsortedStringCollection);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditorCore.Locked: boolean;
-begin
-  Locked:=LockFlag>0;
-end;
-
-procedure TCustomCodeEditorCore.Lock(AEditor: PCustomCodeEditor);
-begin
-  Inc(LockFlag);
-end;
-
-procedure TCustomCodeEditorCore.UnLock(AEditor: PCustomCodeEditor);
-begin
-{$ifdef DEBUG}
-  if LockFlag=0 then
-    Bug('negative lockflag',nil)
-  else
-{$endif DEBUG}
-    Dec(LockFlag);
-  if (LockFlag>0) then
-    Exit;
-
-  if LimitsChangedCalled then
-    begin
-      DoLimitsChanged;
-      LimitsChangedCalled:=false;
-    end;
-
-  if ModifiedChangedCalled then
-    begin
-      DoModifiedChanged;
-      ModifiedChangedCalled:=false;
-    end;
-
-  if TabSizeChangedCalled then
-    begin
-      DoTabSizeChanged;
-      TabSizeChangedCalled:=false;
-    end;
-
-  if StoreUndoChangedCalled then
-    begin
-      DoStoreUndoChanged;
-      StoreUndoChangedCalled:=false;
-    end;
-
-  if ContentsChangedCalled then
-    begin
-      DoContentsChanged;
-      ContentsChangedCalled:=false;
-    end;
-
-end;
-
-function TCustomCodeEditorCore.UpdateAttrs(FromLine: sw_integer; Attrs: byte): sw_integer;
-var MinLine: sw_integer;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-var I: sw_integer;
-begin
-  I:=DoUpdateAttrs(P^.Editor,FromLine,Attrs);
-  if (I<MinLine) or (MinLine=-1) then MinLine:=I;
-end;
-begin
-  MinLine:=-1;
-  Bindings^.ForEach(@CallIt);
-  UpdateAttrs:=MinLine;
-end;
-
-function TCustomCodeEditorCore.UpdateAttrsRange(FromLine, ToLine: sw_integer; Attrs: byte): sw_integer;
-var MinLine: sw_integer;
-procedure CallIt(P: PEditorBinding); {$ifndef FPC}far;{$endif}
-var I: sw_integer;
-begin
-  I:=DoUpdateAttrsRange(P^.Editor,FromLine,ToLine,Attrs);
-  if (I<MinLine) or (MinLine=-1) then MinLine:=I;
-end;
-begin
-  MinLine:=-1;
-  Bindings^.ForEach(@CallIt);
-  UpdateAttrsRange:=MinLine;
-end;
-
-function TCustomCodeEditorCore.DoUpdateAttrs(Editor: PCustomCodeEditor; FromLine: sw_integer; Attrs: byte): sw_integer;
-type
-    TCharClass = (ccWhiteSpace,ccTab,ccAlpha,ccNumber,ccRealNumber,ccHash,ccSymbol);
-var
-  SymbolIndex: Sw_integer;
-  CurrentCommentType : Byte;
-  FirstCC,LastCC: TCharClass;
-  InAsm,InComment,InSingleLineComment,InDirective,InString: boolean;
-  X,ClassStart: Sw_integer;
-  SymbolConcat: string;
-  LineText,Format: string;
-
-  function MatchSymbol(const What, S: string): boolean;
-  var Match: boolean;
-  begin
-    Match:=false;
-    if length(What)>=length(S) then
-      if copy(What,1+length(What)-length(S),length(S))=S then
-    Match:=true;
-    MatchSymbol:=Match;
-  end;
-
-  var MatchedSymbol: boolean;
-      MatchingSymbol: string;
-  type TPartialType = (pmNone,pmLeft,pmRight,pmAny);
-  function MatchesAnySpecSymbol(What: string; SClass: TSpecSymbolClass; PartialMatch: TPartialType;
-           CaseInsensitive: boolean): boolean;
-  var S: string;
-      I: Sw_integer;
-      Match,Found: boolean;
-  begin
-    Found:=false;
-    if CaseInsensitive then
-      What:=UpcaseStr(What);
-    if What<>'' then
-    for I:=1 to Editor^.GetSpecSymbolCount(SClass) do
-    begin
-      SymbolIndex:=I;
-      S:=Editor^.GetSpecSymbol(SClass,I-1);
-      if (length(What)<length(S)) or
-         ((PartialMatch=pmNone) and (length(S)<>length(What)))
-          then
-        Match:=false
-      else
-        begin
-          if CaseInsensitive then
-            S:=UpcaseStr(S);
-          case PartialMatch of
-            pmNone : Match:=What=S;
-            pmRight:
-              Match:=copy(What,length(What)-length(S)+1,length(S))=S;
-          else Match:=MatchSymbol(What,S);
-          end;
-        end;
-      if Match then
-      begin
-        MatchingSymbol:=S; Found:=true; Break;
-      end;
-    end;
-    MatchedSymbol:=MatchedSymbol or Found;
-    MatchesAnySpecSymbol:=Found;
-  end;
-
-  function IsCommentPrefix: boolean;
-  begin
-    IsCommentPrefix:=MatchesAnySpecSymbol(SymbolConcat,ssCommentPrefix,pmLeft,false);
-  end;
-
-  function IsSingleLineCommentPrefix: boolean;
-  begin
-    IsSingleLineCommentPrefix:=MatchesAnySpecSymbol(SymbolConcat,ssCommentSingleLinePrefix,pmLeft,false);
-  end;
-
-  function IsCommentSuffix: boolean;
-  begin
-    IsCommentSuffix:=(MatchesAnySpecSymbol(SymbolConcat,ssCommentSuffix,pmRight,false))
-      and (CurrentCommentType=SymbolIndex);
-  end;
-
-  function IsStringPrefix: boolean;
-  begin
-    IsStringPrefix:=MatchesAnySpecSymbol(SymbolConcat,ssStringPrefix,pmLeft,false);
-  end;
-
-  function IsStringSuffix: boolean;
-  begin
-    IsStringSuffix:=MatchesAnySpecSymbol(SymbolConcat,ssStringSuffix,pmRight,false);
-  end;
-
-  function IsDirectivePrefix: boolean;
-  begin
-    IsDirectivePrefix:=MatchesAnySpecSymbol(SymbolConcat,ssDirectivePrefix,pmLeft,false);
-  end;
-
-  function IsDirectiveSuffix: boolean;
-  begin
-    IsDirectiveSuffix:=MatchesAnySpecSymbol(SymbolConcat,ssDirectiveSuffix,pmRight,false);
-  end;
-
-  function IsAsmPrefix(const WordS: string): boolean;
-  begin
-    IsAsmPrefix:=MatchesAnySpecSymbol(WordS,ssAsmPrefix,pmNone,true);
-  end;
-
-  function IsAsmSuffix(const WordS: string): boolean;
-  begin
-    IsAsmSuffix:=MatchesAnySpecSymbol(WordS,ssAsmSuffix,pmNone,true);
-  end;
-
-  function GetCharClass(C: char): TCharClass;
-  var CC: TCharClass;
-  begin
-    if C in WhiteSpaceChars then CC:=ccWhiteSpace else
-    if C in TabChars then CC:=ccTab else
-    if C in HashChars then CC:=ccHash else
-    if C in AlphaChars then CC:=ccAlpha else
-    if C in NumberChars then CC:=ccNumber else
-    if (LastCC=ccNumber) and (C in RealNumberChars) then
-      begin
-        if (C='.') then
-          begin
-            if (LineText[X+1]='.') then
-              cc:=ccSymbol
-            else
-              CC:=ccRealNumber
-          end
-        else
-          cc:=ccrealnumber;
-      end else
-    CC:=ccSymbol;
-    GetCharClass:=CC;
-  end;
-
-  procedure FormatWord(SClass: TCharClass; StartX:Sw_integer;EndX: Sw_integer);
-  var
-      C: byte;
-      WordS: string;
-  begin
-    C:=0;
-    WordS:=copy(LineText,StartX,EndX-StartX+1);
-    if IsAsmSuffix(WordS) and (InAsm=true) and (InComment=false) and
-       (InString=false) and (InDirective=false) then InAsm:=false;
-    if InDirective then C:=coDirectiveColor else
-    if InComment then C:=coCommentColor else
-    if InString then C:=coStringColor else
-    if InAsm then C:=coAssemblerColor else
-    case SClass of
-      ccWhiteSpace : C:=coWhiteSpaceColor;
-      ccTab : C:=coTabColor;
-      ccNumber :
-        if copy(WordS,1,1)='$' then
-          C:=coHexNumberColor
-        else
-          C:=coNumberColor;
-      ccHash :
-        C:=coStringColor;
-      ccSymbol :
-        C:=coSymbolColor;
-      ccAlpha :
-        begin
-          if Editor^.IsReservedWord(WordS) then
-            C:=coReservedWordColor
-          else
-            C:=coIdentifierColor;
-        end;
-    end;
-    if EndX+1>=StartX then
-      FillChar(Format[StartX],EndX+1-StartX,C);
-    if IsAsmPrefix(WordS) and (InString=false) and
-       (InAsm=false) and (InComment=false) and (InDirective=false) then
-      InAsm:=true;
-  end;
-
-  procedure ProcessChar(C: char);
-  var CC: TCharClass;
-      EX: Sw_integer;
-  begin
-    CC:=GetCharClass(C);
-    if ClassStart=X then
-      FirstCC:=CC;
-    if ( (CC<>LastCC) and
-        (
-         ((FirstCC=ccNumber) and (CC<>ccRealNumber)) or
-        (((CC<>ccAlpha) or (LastCC<>ccNumber) ) and
-          ( (CC<>ccNumber) or (LastCC<>ccAlpha) ) and
-          ( (CC<>ccNumber) or (LastCC<>ccHash) ) and
-          ( (CC<>ccRealNumber) or (LastCC<>ccNumber))
-         ))) or
-
-       (X>length(LineText)) or (CC=ccSymbol) then
-    begin
-      MatchedSymbol:=false;
-      EX:=X-1;
-      if (CC=ccSymbol) then
-       begin
-         if length(SymbolConcat)>=High(SymbolConcat) then
-           Delete(SymbolConcat,1,1);
-         SymbolConcat:=SymbolConcat+C;
-       end;
-      case CC of
-        ccSymbol :
-          if IsCommentSuffix and (InComment) then
-             Inc(EX) else
-          if IsStringSuffix and (InString) then
-             Inc(EX) else
-          if IsDirectiveSuffix and (InDirective) then
-             Inc(EX);
-      end;
-      if (C='$') and (MatchedSymbol=false) and (IsDirectivePrefix=false) then
-        CC:=ccNumber;
-      if CC<>ccSymbol then SymbolConcat:='';
-      FormatWord(LastCC,ClassStart,EX);
-      ClassStart:=EX+1;
-      case CC of
-        ccAlpha  : ;
-        ccNumber :
-          if (LastCC<>ccAlpha) then;
-        ccSymbol :
-            if IsDirectivePrefix and (InComment=true) and (CurrentCommentType=1) and
-               (InDirective=false) then
-               begin InDirective:=true; InComment:=false; Dec(ClassStart,length(MatchingSymbol)-1); end else
-            if IsDirectiveSuffix and (InComment=false) and (InDirective=true) then
-               InDirective:=false else
-            if IsCommentPrefix and (InComment=false) and (InString=false) then
-              begin
-                InComment:=true;
-                CurrentCommentType:=SymbolIndex;
-                InSingleLineComment:=IsSingleLineCommentPrefix;
-                {InString:=false; }
-                Dec(ClassStart,length(MatchingSymbol)-1);
-              end
-            else
-           if IsCommentSuffix and (InComment) then
-             begin InComment:=false; InString:=false; end else
-           if IsStringPrefix and (InComment=false) and (InString=false) then
-             begin InString:=true; Dec(ClassStart,length(MatchingSymbol)-1); end else
-           if IsStringSuffix and (InComment=false) and (InString=true) then
-             InString:=false;
-      end;
-      if MatchedSymbol and (InComment=false) then
-        SymbolConcat:='';
-      LastCC:=CC;
-    end;
-  end;
-
-var CurLine: Sw_integer;
-    Line,NextLine,PrevLine{,OldLine}: PCustomLine;
-    PrevLI,LI,NextLI: PEditorLineInfo;
-begin
-  if (not Editor^.IsFlagSet(efSyntaxHighlight)) or (FromLine>=GetLineCount) then
-  begin
-    SetLineFormat(Editor,FromLine,'');
-    DoUpdateAttrs:=GetLineCount;
-{$ifdef TEST_PARTIAL_SYNTAX}
-    LastSyntaxedLine:=GetLineCount;
-    if not SyntaxComplete then
-      begin
-        SyntaxComplete:=true;
-        DoSyntaxStateChanged;
-      end;
-(*    { no Idle necessary }
-    EventMask:=EventMask and not evIdle;*)
-{$endif TEST_PARTIAL_SYNTAX}
-    Editor^.SyntaxStateChanged;
-    Exit;
-  end;
-{$ifdef TEST_PARTIAL_SYNTAX}
-  If Editor^.IsFlagSet(efSyntaxHighlight) and (LastSyntaxedLine<FromLine)
-     and (FromLine<GetLineCount) then
-    CurLine:=LastSyntaxedLine
-  else
-{$endif TEST_PARTIAL_SYNTAX}
-    CurLine:=FromLine;
-  if CurLine>0 then
-    PrevLine:=GetLine(CurLine-1)
-  else
-    PrevLine:=nil;
-  repeat
-    Line:=GetLine(CurLine);
-    if Assigned(PrevLine) then PrevLI:=PrevLine^.GetEditorInfo(Editor) else PrevLI:=nil;
-    if Assigned(Line) then LI:=Line^.GetEditorInfo(Editor) else LI:=nil;
-    InSingleLineComment:=false;
-    if PrevLI<>nil then
-     begin
-       InAsm:=PrevLI^.EndsWithAsm;
-       InComment:=PrevLI^.EndsWithComment and not PrevLI^.EndsInSingleLineComment;
-       CurrentCommentType:=PrevLI^.EndCommentType;
-       InDirective:=PrevLI^.EndsWithDirective;
-     end
-    else
-     begin
-       InAsm:=false;
-       InComment:=false;
-       CurrentCommentType:=0;
-       InDirective:=false;
-     end;
-{    OldLine:=Line;}
-    LI^.BeginsWithAsm:=InAsm;
-    LI^.BeginsWithComment:=InComment;
-    LI^.BeginsWithDirective:=InDirective;
-    LI^.BeginCommentType:=CurrentCommentType;
-    LineText:=GetLineText(CurLine);
-    Format:=CharStr(chr(coTextColor),length(LineText));
-    LastCC:=ccWhiteSpace;
-    ClassStart:=1;
-    SymbolConcat:='';
-    InString:=false;
-    if LineText<>'' then
-     begin
-       for X:=1 to length(LineText) do
-         ProcessChar(LineText[X]);
-       Inc(X);
-       ProcessChar(' ');
-     end;
-    SetLineFormat(Editor,CurLine,Format);
-    LI^.EndsWithAsm:=InAsm;
-    LI^.EndsWithComment:=InComment;
-    LI^.EndsInSingleLineComment:=InSingleLineComment;
-    LI^.EndCommentType:=CurrentCommentType;
-    LI^.EndsWithDirective:=InDirective;
-    Inc(CurLine);
-    if CurLine>=GetLineCount then
-     Break;
-    NextLine:=GetLine(CurLine);
-    if Assigned(NextLine) then NextLI:=NextLine^.GetEditorInfo(Editor) else NextLI:=nil;
-    if ((Attrs and attrForceFull)=0) then
-      if (*  Why should we go
-         (InAsm=false) and (NextLI^.BeginsWithAsm=false) and
-         (InComment=false) and (NextLI^.BeginsWithComment=false) and
-         (InDirective=false) and (NextLI^.BeginsWithDirective=false) and
-{          OldLine = Line so this is nonsense}
-         (PrevLI^.EndsWithComment=LI^.EndsWithComment) and
-         (PrevLI^.EndsWithAsm=LI^.EndsWithAsm) and
-         (PrevLI^.EndsWithDirective=LI^.EndsWithDirective) and *)
-{$ifdef TEST_PARTIAL_SYNTAX}
-         (CurLine>FromLine) and
-{$endif TEST_PARTIAL_SYNTAX}
-         (NextLI^.BeginsWithAsm=LI^.EndsWithAsm) and
-         (NextLI^.BeginsWithComment=LI^.EndsWithComment) and
-         (NextLI^.BeginsWithDirective=LI^.EndsWithDirective) and
-         (NextLI^.BeginCommentType=LI^.EndCommentType) and
-         (NextLI^.Format<>nil) then
-       Break;
-{$ifdef TEST_PARTIAL_SYNTAX}
-    if (CurLine<GetLineCount) and
-       (CurLine>FromLine) and
-       ((Attrs and attrForceFull)=0) and
-       (CurLine>GetLastVisibleLine) then
-      begin
-        If SyntaxComplete then
-          begin
-            SyntaxComplete:=false;
-            DoSyntaxStateChanged;
-          end;
-        LastSyntaxedLine:=CurLine-1;
-        break;
-      end;
-{$endif TEST_PARTIAL_SYNTAX}
-    PrevLine:=Line;
-  until false;
-  DoUpdateAttrs:=CurLine;
-{$ifdef TEST_PARTIAL_SYNTAX}
-  If LastSyntaxedLine<CurLine-1 then
-    LastSyntaxedLine:=CurLine-1;
-  if CurLine=GetLineCount then
-    begin
-      SyntaxComplete:=true;
-      DoSyntaxStateChanged;
-    end;
-{$endif TEST_PARTIAL_SYNTAX}
-end;
-
-function TCustomCodeEditorCore.DoUpdateAttrsRange(Editor: PCustomCodeEditor; FromLine, ToLine: sw_integer;
-         Attrs: byte): sw_integer;
-var Line: Sw_integer;
-begin
-  Lock(Editor);
-  Line:=FromLine;
-  repeat
-    Line:=DoUpdateAttrs(Editor,Line,Attrs);
-  until (Line>=GetLineCount) or (Line>ToLine);
-  DoUpdateAttrsRange:=Line;
-  Unlock(Editor);
-end;
-
-procedure TCustomCodeEditorCore.AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditorCore.AddGroupedAction(AAction : byte);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditorCore.CloseGroupedAction(AAction : byte);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditorCore.GetUndoActionCount: sw_integer;
-begin
-  Abstract;
-  GetUndoActionCount:=0;
-end;
-
-function TCustomCodeEditorCore.GetRedoActionCount: sw_integer;
-begin
-  Abstract;
-  GetRedoActionCount:=0;
-end;
-
-destructor TCustomCodeEditorCore.Done;
-begin
-{$ifdef DEBUG}
-  if Bindings^.Count>0 then
-    ErrorBox('Internal error: there are still '+IntToStr(Bindings^.Count)+' editors '+
-      'registered at TCodeEditorCode.Done!!!',nil);
-{$endif}
-  if Assigned(Bindings) then Dispose(Bindings, Done); Bindings:=nil;
-  inherited Done;
-end;
-
-procedure TCustomCodeEditor.Lock;
-begin
-  Inc(LockFlag);
-end;
-
-procedure TCustomCodeEditor.UnLock;
-begin
-{$ifdef DEBUG}
-  if lockflag=0 then
-    Bug('negative lockflag',nil)
-  else
-{$endif DEBUG}
-    Dec(LockFlag);
-  if (LockFlag>0) then
-    Exit;
-
-  if DrawCalled then
-    DrawView;
-
-  If DrawCursorCalled then
-    Begin
-      DrawCursor;
-      DrawCursorCalled:=false;
-    End;
-end;
-
-procedure TCustomCodeEditor.DrawIndicator;
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.AdjustSelectionPos(CurPosX, CurPosY: sw_integer; DeltaX, DeltaY: sw_integer);
-var CP: TPoint;
-begin
-  if ValidBlock=false then Exit;
-
-  CP.X:=CurPosX; CP.Y:=CurPosY;
-  if (PosToOfsP(SelStart)<=PosToOfsP(CP)) and (PosToOfsP(CP)<PosToOfsP(SelEnd)) then
-    begin
-      { CurPos is IN selection }
-      Inc(SelEnd.Y,DeltaY);
-      if (CP.Y=SelEnd.Y) and
-         ((SelStart.Y<>SelEnd.Y) or (SelStart.X<=CP.X)) and
-         (CP.X<=SelEnd.X) then
-       Inc(SelEnd.X,DeltaX);
-      SelectionChanged;
-    end
-  else
-  if (PosToOfsP(CP)<=PosToOfsP(SelStart)) then
-    begin
-      { CurPos is BEFORE selection }
-      if (CP.Y=SelStart.Y) and (CP.Y=SelEnd.Y) and (DeltaY<0) then
-        begin
-          SelStart:=CurPos; SelEnd:=CurPos;
-        end
-      else
-      if (CP.Y=SelStart.Y) then
-        begin
-          if CP.X<SelStart.X then
-            Inc(SelStart.X,DeltaX);
-        end;
-{      else}
-        begin
-          Inc(SelStart.Y,DeltaY);
-          Inc(SelEnd.Y,DeltaY);
-        end;
-      if SelEnd.Y=CurPos.Y then Inc(SelEnd.X,DeltaX);
-      SelectionChanged;
-    end
-  else
-    begin
-      { CurPos is AFTER selection }
-      { actually we don't have to do anything here }
-    end;
-end;
-
-function TCustomCodeEditor.GetFlags: longint;
-begin
-  { Abstract }
-  GetFlags:=0;
-end;
-
-procedure TCustomCodeEditor.SetFlags(AFlags: longint);
-begin
-  { Abstract }
-end;
-
-function TCustomCodeEditor.GetModified: boolean;
-begin
-  { Abstract }
-  GetModified:=true;
-end;
-
-procedure TCustomCodeEditor.SetModified(AModified: boolean);
-begin
-  { Abstract }
-end;
-
-function TCustomCodeEditor.GetStoreUndo: boolean;
-begin
-  { Abstract }
-  GetStoreUndo:=false;
-end;
-
-procedure TCustomCodeEditor.SetStoreUndo(AStore: boolean);
-begin
-  { Abstract }
-end;
-
-function TCustomCodeEditor.GetSyntaxCompleted: boolean;
-begin
-  { Abstract }
-  GetSyntaxCompleted:=true;
-end;
-
-procedure TCustomCodeEditor.SetSyntaxCompleted(SC : boolean);
-begin
-  { Abstract }
-end;
-
-function  TCustomCodeEditor.GetLastSyntaxedLine: sw_integer;
-begin
-  Abstract;
-  GetLastSyntaxedLine:=0;
-end;
-
-procedure   TCustomCodeEditor.SetLastSyntaxedLine(ALine: sw_integer);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditor.IsFlagSet(AFlag: longint): boolean;
-begin
-  IsFlagSet:=(GetFlags and AFlag)=AFlag;
-end;
-
-function TCustomCodeEditor.GetTabSize: integer;
-begin
-  { Abstract }
-  GetTabSize:=5;
-end;
-
-procedure TCustomCodeEditor.SetTabSize(ATabSize: integer);
-begin
-  { Abstract }
-end;
-
-function TCustomCodeEditor.IsReadOnly: boolean;
-begin
-  { Abstract }
-  IsReadOnly:=false;
-end;
-
-function TCustomCodeEditor.IsClipboard: Boolean;
-begin
-  { Abstract }
-  IsClipboard:=false;
-end;
-
-function TCustomCodeEditor.GetLineCount: sw_integer;
-begin
-  Abstract;
-  GetLineCount:=0;
-end;
-
-function TCustomCodeEditor.GetLine(LineNo: sw_integer): PCustomLine;
-begin
-  Abstract;
-  GetLine:=nil;
-end;
-
-function TCustomCodeEditor.CharIdxToLinePos(Line,CharIdx: sw_integer): sw_integer;
-begin
-  Abstract;
-  CharIdxToLinePos:=0;
-end;
-
-function TCustomCodeEditor.LinePosToCharIdx(Line,X: sw_integer): sw_integer;
-begin
-  Abstract;
-  LinePosToCharIdx:=0;
-end;
-
-function TCustomCodeEditor.GetLineText(I: sw_integer): string;
-begin
-  Abstract;
-  GetLineText:='';
-end;
-
-procedure TCustomCodeEditor.SetDisplayText(I: sw_integer;const S: string);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditor.GetDisplayText(I: sw_integer): string;
-begin
-  Abstract;
-  GetDisplayText:='';
-end;
-
-procedure TCustomCodeEditor.SetLineText(I: sw_integer;const S: string);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditor.GetDisplayTextFormat(I: sw_integer;var DT,DF:string);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditor.GetLineFormat(I: sw_integer): string;
-begin
-  { Abstract }
-  GetLineFormat:='';
-end;
-
-procedure TCustomCodeEditor.SetLineFormat(I: sw_integer;const S: string);
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.DeleteAllLines;
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditor.DeleteLine(I: sw_integer);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditor.InsertLine(LineNo: sw_integer; const S: string): PCustomLine;
-begin
-  Abstract;
-  InsertLine:=nil; { eliminate compiler warning }
-end;
-
-procedure TCustomCodeEditor.AddLine(const S: string);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditor.GetErrorMessage: string;
-begin
-  Abstract;
-  GetErrorMessage:='';
-end;
-
-procedure TCustomCodeEditor.SetErrorMessage(const S: string);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditor.GetContent(ALines: PUnsortedStringCollection);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditor.SetContent(ALines: PUnsortedStringCollection);
-begin
-  Abstract;
-end;
-
-function TCustomCodeEditor.LoadFromStream(Stream: PStream): boolean;
-begin
-  Abstract;
-  LoadFromStream:=false;
-end;
-
-function TCustomCodeEditor.SaveToStream(Stream: PStream): boolean;
-var A,B: TPoint;
-begin
-  A.Y:=0; A.X:=0;
-  B.Y:=GetLineCount-1;
-  if GetLineCount>0 then
-    B.X:=length(GetDisplayText(B.Y))
-  else
-    B.X:=0;
-  SaveToStream:=SaveAreaToStream(Stream,A,B);
-end;
-
-function TCustomCodeEditor.SaveAreaToStream(Stream: PStream; StartP,EndP: TPoint): boolean;
-begin
-  Abstract;
-  SaveAreaToStream:=false;
-end;
-
-function TCustomCodeEditor.LoadFromFile(const AFileName: string): boolean;
-var S: PBufStream;
-    OK: boolean;
-begin
-  New(S, Init(AFileName,stOpenRead,EditorTextBufSize));
-  OK:=Assigned(S);
-{$ifdef TEST_PARTIAL_SYNTAX}
-  SetSyntaxCompleted(false);
-  { Idle necessary }
-  EventMask:=EventMask or evIdle;
-{$endif TEST_PARTIAL_SYNTAX}
-  if OK then OK:=LoadFromStream(S);
-  if Assigned(S) then Dispose(S, Done);
-  LoadFromFile:=OK;
-end;
-
-function TCustomCodeEditor.SaveToFile(const AFileName: string): boolean;
-var OK: boolean;
-    S: PBufStream;
-begin
-  New(S, Init(AFileName,stCreate,EditorTextBufSize));
-  OK:=Assigned(S) and (S^.Status=stOK);
-  if OK then OK:=SaveToStream(S);
-  if Assigned(S) then Dispose(S, Done);
-  SaveToFile:=OK;
-end;
-
-
-function TCustomCodeEditor.InsertFrom(Editor: PCustomCodeEditor): Boolean;
-var OK: boolean;
-    LineDelta,LineCount: Sw_integer;
-    StartPos,DestPos,BPos,EPos: TPoint;
-    LineStartX,LineEndX: Sw_integer;
-    S,OrigS,AfterS: string;
-    VerticalBlock: boolean;
-    SEnd: TPoint;
-begin
-  if Editor^.IsFlagSet(efVerticalBlocks) then
-    begin
-      NotImplemented;
-      Exit;
-    end;
-  Lock;
-
-  { every data in the clipboard gets a new line }
-  if (Clipboard=@Self) and (CurPos.X>0) then
-    InsertNewLine;
-
-  OK:=(Editor^.SelStart.X<>Editor^.SelEnd.X) or (Editor^.SelStart.Y<>Editor^.SelEnd.Y);
-  if OK then
-  begin
-    StartPos:=CurPos; DestPos:=CurPos;
-    EPos:=CurPos;
-    VerticalBlock:=Editor^.IsFlagSet(efVerticalBlocks);
-    LineDelta:=0; LineCount:=(Editor^.SelEnd.Y-Editor^.SelStart.Y)+1;
-    OK:=GetLineCount<MaxLineCount;
-    OrigS:=GetDisplayText(DestPos.Y);
-    AfterS:=Copy(OrigS,DestPos.X+1,High(OrigS));
-    BPos:=CurPos;
-    while OK and (LineDelta<LineCount) do
-    begin
-      if (LineDelta>0) and (VerticalBlock=false) then
-        begin
-          InsertLine(DestPos.Y,'');
-          EPOS.X:=0;EPos.Y:=DestPos.Y;
-          AddAction(eaInsertLine,BPos,EPos,'');
-          LimitsChanged;
-        end;
-
-      if (LineDelta=0) or VerticalBlock then
-        LineStartX:=Editor^.SelStart.X
-      else
-        LineStartX:=0;
-
-      if (LineDelta=LineCount-1) or VerticalBlock then
-        LineEndX:=Editor^.SelEnd.X-1
-      else
-        LineEndX:=High(S);
-
-      if LineEndX<LineStartX then
-        S:=''
-      else if VerticalBlock then
-        S:=RExpand(copy(Editor^.GetLineText(Editor^.SelStart.Y+LineDelta),LineStartX+1,LineEndX-LineStartX+1),
-                   Min(LineEndX-LineStartX+1,High(S)))
-      else
-        S:=copy(Editor^.GetLineText(Editor^.SelStart.Y+LineDelta),LineStartX+1,LineEndX-LineStartX+1);
-      if VerticalBlock=false then
-        begin
-          If LineDelta>0 then
-            OrigS:='';
-          if LineDelta=LineCount-1 then
-            begin
-              SetLineText(DestPos.Y,RExpand(copy(OrigS,1,DestPos.X),DestPos.X)+S+AfterS);
-              BPos.X:=DestPos.X;BPos.Y:=DestPos.Y;
-              EPOS.X:=DestPos.X+Length(S);EPos.Y:=DestPos.Y;
-              AddAction(eaInsertText,BPos,EPos,S);
-            end
-          else
-            begin
-              SetLineText(DestPos.Y,RExpand(copy(OrigS,1,DestPos.X),DestPos.X)+S);
-              BPos.X:=DestPos.X;BPos.Y:=DestPos.Y;
-              EPOS.X:=DestPos.X+Length(S);EPos.Y:=DestPos.Y;
-              AddAction(eaInsertText,BPos,EPos,S);
-            end;
-          BPos.X:=EPos.X;
-          if LineDelta=LineCount-1 then
-            begin
-              SEnd.Y:=DestPos.Y;
-              SEnd.X:=DestPos.X+length(S);
-            end
-          else
-           begin
-             Inc(DestPos.Y);
-             DestPos.X:=0;
-           end;
-        end
-      else { if VerticalBlock=false then .. else }
-        begin
-          { this is not yet implemented !! PM }
-          S:=RExpand(S,LineEndX-LineStartX+1);
-        end;
-      Inc(LineDelta);
-      OK:=GetLineCount<MaxLineCount;
-    end;
-    if OK=false then EditorDialog(edTooManyLines,nil);
-    { mainly to force eaMove insertion }
-    if not IsClipboard then
-      SetCurPtr(EPos.X,EPos.Y);
-    SetCurPtr(StartPos.X,StartPos.Y);
-    UpdateAttrs(StartPos.Y,attrAll);
-    SetModified(true);
-    LimitsChanged;
-    SetSelection(CurPos,SEnd);
-    if IsClipboard then
-     begin
-       Inc(DestPos.X,length(S));
-       SetCurPtr(DestPos.X,DestPos.Y);
-     end;
-    DrawView;
-  end;
-  UnLock;
-  InsertFrom:=OK;
-end;
-
-function TCustomCodeEditor.InsertText(const S: string): Boolean;
-var I: sw_integer;
-    OldPos: TPoint;
-    HoldUndo : boolean;
-begin
-  Lock;
-  OldPos:=CurPos;
-  HoldUndo:=GetStoreUndo;
-  SetStoreUndo(false);
-  for I:=1 to length(S) do
-    AddChar(S[I]);
-  InsertText:=true;
-  SetStoreUndo(HoldUndo);
-  AddAction(eaInsertText,OldPos,CurPos,S);
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.ModifiedChanged;
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.PositionChanged;
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.TabSizeChanged;
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.SyntaxStateChanged;
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.StoreUndoChanged;
-begin
-  { Abstract }
-end;
-
-function TCustomCodeEditor.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
-begin
-  { Abstract }
-  GetSpecSymbolCount:=0;
-end;
-
-function TCustomCodeEditor.GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string;
-begin
-  Abstract;
-  GetSpecSymbol:='';
-end;
-
-function TCustomCodeEditor.IsReservedWord(const S: string): boolean;
-begin
-  { Abstract }
-  IsReservedWord:=false;
-end;
-
-function TCustomCodeEditor.TranslateCodeTemplate(const Shortcut: string; ALines: PUnsortedStringCollection): boolean;
-begin
-  { Abstract }
-  TranslateCodeTemplate:=false;
-end;
-
-function TCustomCodeEditor.CompleteCodeWord(const WordS: string; var Text: string): boolean;
-begin
-  { Abstract }
-  Text:='';
-  CompleteCodeWord:=false;
-end;
-
-function TCustomCodeEditor.GetCodeCompleteWord: string;
-begin
-  { Abstract }
-  GetCodeCompleteWord:='';
-end;
-
-function TCustomCodeEditor.CreateFold(StartY,EndY: sw_integer; Collapsed: boolean): boolean;
-var F,ParentF: PFold;
-    L: PCustomLine;
-    EI: PEditorLineInfo;
-    Y: sw_integer;
-    OK: boolean;
-begin
-  OK:=true;
-  Lock;
-  for Y:=StartY to EndY do
-  begin
-    L:=GetLine(Y);
-    if assigned(L) then
-      EI:=L^.GetEditorInfo(@Self)
-    else
-      begin
-        CreateFold:=False;
-        exit;
-      end;
-    if Y=StartY then
-      ParentF:=EI^.Fold
-    else
-      OK:=OK and (EI^.Fold=ParentF);
-    if not OK then
-      Break;
-  end;
-  if OK then
-  begin
-    New(F, Init(@Self,ParentF,Collapsed));
-    for Y:=StartY to EndY do
-      GetLine(Y)^.GetEditorInfo(@Self)^.SetFold(F);
-    DrawView;
-  end;
-  UnLock;
-  CreateFold:=OK;
-end;
-
-procedure TCustomCodeEditor.FoldChanged(Fold: PFold);
-var F: PFold;
-    I: sw_integer;
-begin
-  for I:=0 to GetFoldCount-1 do
-  begin
-    F:=GetFold(I);
-    if F^.ParentFold=Fold then
-      FoldChanged(F);
-  end;
-  if Fold^.IsCollapsed then
-  begin
-    F:=GetLineFold(CurPos.Y); I:=CurPos.Y;
-    if F=Fold then
-    begin
-     while GetLineFold(I-1)=Fold do
-       Dec(I);
-     if I<>CurPos.Y then
-       SetCurPtr(CurPos.X,I);
-    end;
-  end;
-  DrawView;
-end;
-
-procedure TCustomCodeEditor.RemoveAllFolds;
-var I: sw_integer;
-    L: PCustomLine;
-begin
-
-  for I:=0 to GetLineCount-1 do
-    begin
-      L:=GetLine(I);
-      if not assigned(L) then exit;
-      with L^ do
-        with GetEditorInfo(@Self)^ do
-          SetFold(nil);
-    end;
-  DrawView;
-end;
-
-procedure TCustomCodeEditor.AdjustSelection(DeltaX, DeltaY: sw_integer);
-begin
-  AdjustSelectionPos(CurPos.X,CurPos.Y,DeltaX,DeltaY);
-end;
-
-procedure TCustomCodeEditor.TrackCursor(Center: boolean);
-var D,CP: TPoint;
-begin
-  D:=Delta;
-  EditorToViewPoint(D,D); EditorToViewPoint(CurPos,CP);
-  if CP.Y<Delta.Y then D.Y:=CP.Y else
-   if CP.Y>Delta.Y+Size.Y-1 then D.Y:=CP.Y-Size.Y+1;
-  if CP.X<Delta.X then D.X:=CP.X else
-   if CP.X>Delta.X+Size.X-1 then D.X:=CP.X-Size.X+1;
-  if {((Delta.X<>D.X) or (Delta.Y<>D.Y)) and }Center then
-  begin
-     { loose centering for debugger PM }
-     while (CP.Y-D.Y)<(Size.Y div 3) do Dec(D.Y);
-     while (CP.Y-D.Y)>2*(Size.Y div 3) do Inc(D.Y);
-  end;
-  ViewToEditorPoint(D,D);
-  if (Delta.X<>D.X) or (Delta.Y<>D.Y) then
-    ScrollTo(D.X,D.Y);
-  DrawCursor;
-end;
-
-procedure TCustomCodeEditor.ScrollTo(X, Y: sw_Integer);
-begin
-  inherited ScrollTo(X,Y);
-  if (HScrollBar=nil) or (VScrollBar=nil) then
-     begin Delta.X:=X; Delta.Y:=Y; end;
-  DrawView;
-end;
-
-function TCustomCodeEditor.IsModal: boolean;
-var IsM: boolean;
-begin
-  IsM:=GetState(sfModal);
-  if Assigned(Owner) then
-    IsM:=IsM or Owner^.GetState(sfModal);
-  IsModal:=IsM;
-end;
-
-procedure TCustomCodeEditor.FlagsChanged(OldFlags: longint);
-var I: sw_integer;
-begin
-  Lock;
-  if ((OldFlags xor GetFlags) and efCodeComplete)<>0 then
-    ClearCodeCompleteWord;
-  SetInsertMode(IsFlagSet(efInsertMode));
-  if ((OldFlags xor GetFlags) and efFolds)<>0 then
-    if not IsFlagSet(efFolds) then
-      RemoveAllFolds;
-  if IsFlagSet(efSyntaxHighlight) then
-    UpdateAttrs(0,attrAll) else
-  for I:=0 to GetLineCount-1 do
-    SetLineFormat(I,'');
-  DrawView;
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.LimitsChanged;
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditor.DoLimitsChanged;
-begin
-  SetLimit(MaxLineLength+1,EditorToViewLine(GetLineCount));
-end;
-
-procedure TCustomCodeEditor.BindingsChanged;
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.ContentsChanged;
-begin
-  DrawView;
-end;
-
-procedure TCustomCodeEditor.ConvertEvent(var Event: TEvent);
-var
-  Key: Word;
-begin
-  if Event.What = evKeyDown then
-  begin
-    if (Event.KeyShift and kbShift <> 0) and
-      (Event.ScanCode >= $47) and (Event.ScanCode <= $51) then
-      Event.CharCode := #0;
-    Key := Event.KeyCode;
-    if KeyState <> 0 then
-    begin
-      if (Lo(Key) >= $01) and (Lo(Key) <= $1A) then Inc(Key, $40);
-      if (Lo(Key) >= $61) and (Lo(Key) <= $7A) then Dec(Key, $20);
-    end;
-    Key := ScanKeyMap(KeyMap[KeyState], Key);
-    if (KeyState<>0) and (Key=0) then
-      ClearEvent(Event); { eat second key if unrecognized after ^Q or ^K }
-    KeyState := 0;
-    if Key <> 0 then
-      if Hi(Key) = $FF then
-        begin
-          KeyState := Lo(Key);
-          ClearEvent(Event);
-        end
-      else
-        begin
-          Event.What := evCommand;
-          Event.Command := Key;
-        end;
-  end;
-end;
-
-procedure TCustomCodeEditor.SetLineFlagState(LineNo: sw_integer; Flags: longint; ASet: boolean);
-var L: PCustomLine;
-begin
-  L:=GetLine(LineNo);
-  if Assigned(L) then
-    with L^ do
-      if ASet then
-        SetFlags(GetFlags or Flags)
-      else
-        SetFlags(GetFlags and not Flags);
-end;
-
-procedure TCustomCodeEditor.SetLineFlagExclusive(Flags: longint; LineNo: sw_integer);
-var I,Count: sw_integer;
-    L: PCustomLine;
-begin
-  Lock;
-  Count:=GetLineCount;
-  for I:=0 to Count-1 do
-  begin
-    L:=GetLine(I);
-    if not assigned(L) then exit;
-    if I=LineNo then
-      L^.SetFlags(L^.GetFlags or Flags)
-    else
-      L^.SetFlags(L^.GetFlags and (not Flags));
-  end;
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.HandleEvent(var Event: TEvent);
-var DontClear : boolean;
-
-  procedure CheckScrollBar(P: PScrollBar; var D: Sw_Integer);
-  begin
-    if (Event.InfoPtr = P) and (P^.Value <> D) then
-    begin
-      D := P^.Value;
-      DrawView;
-    end;
-  end;
-
-  procedure GetMousePos(var P: TPoint);
-  begin
-    MakeLocal(Event.Where,P);
-    Inc(P.X,Delta.X); Inc(P.Y,Delta.Y);
-    Dec(P.X,GetReservedColCount);
-  end;
-type TCCAction = (ccCheck,ccClear,ccDontCare);
-var
-  StartP,P: TPoint;
-  E: TEvent;
-  OldEvent : PEvent;
-  CCAction: TCCAction;
-begin
-  CCAction:=ccClear;
-  E:=Event;
-  OldEvent:=CurEvent;
-  if (E.What and (evMouse or evKeyboard))<>0 then
-    CurEvent:=@E;
-  if (InASCIIMode=false) or (Event.What<>evKeyDown) then
-   if (Event.What<>evKeyDown) or (Event.KeyCode<>kbEnter) or (IsReadOnly=false) then
-   if (Event.What<>evKeyDown) or
-      ((Event.KeyCode<>kbEnter) and (Event.KeyCode<>kbEsc)) or
-      (GetCompleteState<>csOffering) then
-    ConvertEvent(Event);
-  case Event.What of
-    evMouseDown :
-      if MouseInView(Event.Where) then
-       if (Event.Buttons=mbRightButton) then
-         begin
-           MakeLocal(Event.Where,P); Inc(P.X); Inc(P.Y);
-           LocalMenu(P);
-           ClearEvent(Event);
-         end else
-       if Event.Buttons=mbLeftButton then
-        begin
-          GetMousePos(P);
-          StartP:=P;
-          SetCurPtr(P.X,P.Y);
-          repeat
-            GetMousePos(P);
-            if PointOfs(P)<PointOfs(StartP)
-               then SetSelection(P,StartP)
-               else SetSelection(StartP,P);
-            SetCurPtr(P.X,P.Y);
-            DrawView;
-          until not MouseEvent(Event, evMouseMove+evMouseAuto);
-          DrawView;
-        end;
-    evKeyDown :
-      begin
-        { Scancode is almost never zero PM }
-        { this is supposed to enable entering of ASCII chars below 32,
-          which are normally interpreted as control chars. So, when you enter
-          Alt+24 (on the numeric pad) then this will normally move the cursor
-          one line down, but if you do it in ASCII mode (also after Ctrl+B)
-          then this will insert the ASCII #24 char (upper arrow) in the
-          source code. - Gabor }
-        if InASCIIMode {and (Event.CharCode<>0)} then
-          begin
-            AddChar(Event.CharCode);
-            if (GetCompleteState<>csDenied) or (Event.CharCode=#32) then
-              CCAction:=ccCheck
-            else
-              CCAction:=ccClear;
-          end
-        else
-          begin
-           DontClear:=false;
-           case Event.KeyCode of
-             kbAltF10 :
-               Message(@Self,evCommand,cmLocalMenu,@Self);
-             kbEnter  :
-               if IsReadOnly then
-                 DontClear:=true else
-               if GetCompleteState=csOffering then
-                 CodeCompleteApply
-               else
-                 Message(@Self,evCommand,cmNewLine,nil);
-             kbEsc :
-               if GetCompleteState=csOffering then
-                 CodeCompleteCancel else
-                if IsModal then
-                  DontClear:=true;
-           else
-            case Event.CharCode of
-             #9,#32..#255 :
-               if (Event.CharCode=#9) and IsModal then
-                 DontClear:=true
-               else
-                 begin
-                   NoSelect:=true;
-                   AddChar(Event.CharCode);
-                   NoSelect:=false;
-                   if (GetCompleteState<>csDenied) or (Event.CharCode=#32) then
-                     CCAction:=ccCheck
-                   else
-                     CCAction:=ccClear;
-                 end;
-            else
-              DontClear:=true;
-            end; { case Event.CharCode .. }
-           end; { case Event.KeyCode .. }
-            if not DontClear then
-             ClearEvent(Event);
-          end;
-        InASCIIMode:=false;
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmASCIIChar   : InASCIIMode:=not InASCIIMode;
-          cmAddChar     : AddChar(chr(longint(Event.InfoPtr)));
-          cmCharLeft    : CharLeft;
-          cmCharRight   : CharRight;
-          cmWordLeft    : WordLeft;
-          cmWordRight   : WordRight;
-          cmLineStart   : LineStart;
-          cmLineEnd     : LineEnd;
-          cmLineUp      : LineUp;
-          cmLineDown    : LineDown;
-          cmPageUp      : PageUp;
-          cmPageDown    : PageDown;
-          cmTextStart   : TextStart;
-          cmTextEnd     : TextEnd;
-          cmWindowStart : WindowStart;
-          cmWindowEnd   : WindowEnd;
-          cmNewLine     : begin
-                            InsertNewLine;
-                            TrackCursor(false);
-                          end;
-          cmBreakLine   : BreakLine;
-          cmBackSpace   : BackSpace;
-          cmDelChar     : DelChar;
-          cmDelWord     : DelWord;
-          cmDelStart    : DelStart;
-          cmDelEnd      : DelEnd;
-          cmDelLine     : DelLine;
-          cmInsMode     : InsMode;
-          cmStartSelect : StartSelect;
-          cmHideSelect  : HideSelect;
-          cmUpdateTitle : ;
-          cmEndSelect   : EndSelect;
-          cmDelSelect   : DelSelect;
-          cmCopyBlock   : CopyBlock;
-          cmMoveBlock   : MoveBlock;
-          cmIndentBlock   : IndentBlock;
-          cmUnindentBlock : UnindentBlock;
-          cmSelStart    : JumpSelStart;
-          cmSelEnd      : JumpSelEnd;
-          cmLastCursorPos : JumpToLastCursorPos;
-          cmFindMatchingDelimiter : FindMatchingDelimiter(true);
-          cmFindMatchingDelimiterBack : FindMatchingDelimiter(false);
-          cmUpperCase     : UpperCase;
-          cmLowerCase     : LowerCase;
-          cmWordLowerCase : WordLowerCase;
-          cmWordUpperCase : WordUpperCase;
-          cmInsertOptions : InsertOptions;
-          cmToggleCase    : ToggleCase;
-          cmCreateFold    : CreateFoldFromBlock;
-          cmToggleFold    : ToggleFold;
-          cmExpandFold    : ExpandFold;
-          cmCollapseFold  : CollapseFold;
-          cmJumpMark0..cmJumpMark9 : JumpMark(Event.Command-cmJumpMark0);
-          cmSetMark0..cmSetMark9 : DefineMark(Event.Command-cmSetMark0);
-          cmSelectWord  : SelectWord;
-          cmSelectLine  : SelectLine;
-          cmWriteBlock  : WriteBlock;
-          cmReadBlock   : ReadBlock;
-          cmPrintBlock  : PrintBlock;
-        { ------ }
-          cmFind        : Find;
-          cmReplace     : Replace;
-          cmSearchAgain : DoSearchReplace;
-          cmJumpLine    : GotoLine;
-        { ------ }
-          cmCut         : ClipCut;
-          cmCopy        : ClipCopy;
-          cmPaste       : ClipPaste;
-{$ifdef WinClipSupported}
-          cmCopyWin     : ClipCopyWin;
-          cmPasteWin    : ClipPasteWin;
-{$endif WinClipSupported}
-          cmUndo        : Undo;
-          cmRedo        : Redo;
-          cmClear       : DelSelect;
-          cmExpandCodeTemplate: ExpandCodeTemplate;
-          cmLocalMenu :
-            begin
-              P:=CurPos; Inc(P.X); Inc(P.Y);
-              LocalMenu(P);
-            end;
-          cmActivateMenu :
-            Message(Application,evCommand,cmMenu,nil);
-        else
-          begin
-            DontClear:=true;
-            CCAction:=ccDontCare;
-          end;
-        end;
-        if DontClear=false then
-          ClearEvent(Event);
-      end;
-{$ifdef TEST_PARTIAL_SYNTAX}
-    evIdle :
-      begin
-        CCAction:=ccDontCare;
-        { Complete syntax by 20 lines increment }
-        { could already be quite lengthy on slow systems }
-        if not GetSyntaxCompleted then
-          UpdateAttrsRange(GetLastSyntaxedLine,GetLastSyntaxedLine+20,AttrAll);
-      end;
-{$endif TEST_PARTIAL_SYNTAX}
-    evBroadcast :
-      begin
-        CCAction:=ccDontCare;
-        case Event.Command of
-          cmUpdate :
-            Update;
-          cmClearLineHighlights :
-            SetLineFlagExclusive(lfHighlightRow,-1);
-          cmResetDebuggerRow :
-            SetLineFlagExclusive(lfDebuggerRow,-1);
-          cmScrollBarChanged:
-            if (Event.InfoPtr = HScrollBar) or
-               (Event.InfoPtr = VScrollBar) then
-              begin
-                CheckScrollBar(HScrollBar, Delta.X);
-                CheckScrollBar(VScrollBar, Delta.Y);
-              end;
-        end;
-      end;
-  else CCAction:=ccDontCare;
-  end;
-  inherited HandleEvent(Event);
-  CurEvent:=OldEvent;
-  case CCAction of
-    ccCheck : CodeCompleteCheck;
-    ccClear : ClearCodeCompleteWord;
-  end;
-end;
-
-procedure TCustomCodeEditor.UpdateUndoRedo(cm : word; action : byte);
-var UndoMenu : PMenuItem;
-begin
-  UndoMenu:=PAdvancedMenuBar(MenuBar)^.GetMenuItem(cm);
-  if assigned(UndoMenu) then
-    begin
-      If assigned(UndoMenu^.Param) then
-        DisposeStr(UndoMenu^.Param);
-      if action<lastaction then
-        UndoMenu^.Param:=NewStr(ActionString[action]);
-    end;
-end;
-
-
-procedure TCustomCodeEditor.Update;
-begin
-  Lock;
-  LimitsChanged;
-  SelectionChanged; HighlightChanged;
-  UnLock;
-end;
-
-function TCustomCodeEditor.GetLocalMenu: PMenu;
-begin
-  GetLocalMenu:=nil;
-end;
-
-function TCustomCodeEditor.GetCommandTarget: PView;
-begin
-  GetCommandTarget:=@Self;
-end;
-
-function TCustomCodeEditor.CreateLocalMenuView(var Bounds: TRect; M: PMenu): PMenuPopup;
-var MV: PMenuPopup;
-begin
-  New(MV, Init(Bounds, M));
-  CreateLocalMenuView:=MV;
-end;
-
-procedure TCustomCodeEditor.LocalMenu(P: TPoint);
-var M: PMenu;
-    MV: PMenuPopUp;
-    R: TRect;
-    Re: word;
-begin
-  M:=GetLocalMenu;
-  if M=nil then Exit;
-  if LastLocalCmd<>0 then
-     M^.Default:=SearchMenuItem(M,LastLocalCmd);
-  Desktop^.GetExtent(R);
-  MakeGlobal(P,R.A); {Desktop^.MakeLocal(R.A,R.A);}
-  MV:=CreateLocalMenuView(R,M);
-  Re:=Application^.ExecView(MV);
-  if M^.Default=nil then LastLocalCmd:=0
-     else LastLocalCmd:=M^.Default^.Command;
-  Dispose(MV, Done);
-  if Re<>0 then
-    Message(GetCommandTarget,evCommand,Re,@Self);
-end;
-
-function TCustomCodeEditor.GetReservedColCount: sw_integer;
-var LSX: sw_integer;
-begin
-  if IsFlagSet(efFolds) then LSX:=GetFoldStringWidth else LSX:=0;
-  GetReservedColCount:=LSX;
-end;
-
-procedure TCustomCodeEditor.Draw;
-function GetEIFold(EI: PEditorLineInfo): PFold;
-begin
-  if Assigned(EI) then GetEIFold:=EI^.Fold else GetEIFold:=nil;
-end;
-var SelectColor,
-    HighlightColColor,
-    HighlightRowColor,
-    ErrorMessageColor  : word;
-    B: TDrawBuffer;
-    I,X,Y,AX,AY,MaxX,LSX: sw_integer;
-    PX: TPoint;
-    LineCount: sw_integer;
-    Line,PrevLine: PCustomLine;
-    LineText,Format: string;
-    isBreak : boolean;
-    C: char;
-    FreeFormat: array[0..MaxLineLength] of boolean;
-    Color: word;
-    ColorTab: array[coFirstColor..coLastColor] of word;
-    ErrorLine: integer;
-    ErrorMsg: string[MaxViewWidth];
-function CombineColors(Orig,Modifier: byte): byte;
-var Color: byte;
-begin
-  if (Modifier and $0f)=0 then
-    Color:=(Orig and $0f) or (Modifier and $f0)
-  else
-    Color:=(Orig and $f0) or (Modifier and $0f);
-  { do not allow invisible }
-  { use white as foreground in this case }
-  if (Color and $f) = ((Color div $10) and $7) then
-    Color:=(Color and $F0) or $F;
-  CombineColors:=Color;
-end;
-var PrevEI,EI: PEditorLineInfo;
-    FoldPrefix,FoldSuffix: string;
-{    SkipLine: boolean;}
-{    FoldStartLine: sw_integer;}
-begin
-  if LockFlag>0 then
-    begin
-      DrawCalled:=true;
-      Exit;
-    end;
-  DrawCalled:=false;
-
-  ErrorMsg:=copy(GetErrorMessage,1,MaxViewWidth);
-  if ErrorMsg='' then ErrorLine:=-1 else
-  if (CurPos.Y-Delta.Y)<(Size.Y div 2) then ErrorLine:=Size.Y-1
-     else ErrorLine:=0;
-  LineCount:=GetLineCount;
-  ColorTab[coTextColor]:=GetColor(1);
-  ColorTab[coWhiteSpaceColor]:=GetColor(2);
-  ColorTab[coCommentColor]:=GetColor(3);
-  ColorTab[coReservedWordColor]:=GetColor(4);
-  ColorTab[coIdentifierColor]:=GetColor(5);
-  ColorTab[coStringColor]:=GetColor(6);
-  ColorTab[coNumberColor]:=GetColor(7);
-  ColorTab[coAssemblerColor]:=GetColor(8);
-  ColorTab[coSymbolColor]:=GetColor(9);
-  ColorTab[coDirectiveColor]:=GetColor(13);
-  ColorTab[coHexNumberColor]:=GetColor(14);
-  ColorTab[coTabColor]:=GetColor(15);
-  { break same as error }
-  ColorTab[coBreakColor]:=GetColor(16);
-  SelectColor:=GetColor(10);
-  HighlightColColor:=GetColor(11);
-  HighlightRowColor:=GetColor(12);
-  ErrorMessageColor:=GetColor(16);
-{$ifdef TEST_PARTIAL_SYNTAX}
-  If GetLastSyntaxedLine<Delta.Y+Size.Y then
-    UpdateAttrsRange(GetLastSyntaxedLine,Delta.Y+Size.Y,AttrAll);
-{$endif TEST_PARTIAL_SYNTAX}
-  LSX:=GetReservedColCount;
-  PrevLine:=nil; PrevEI:=nil; {FoldStartLine:=-1;}
-  Y:=0; AY:=Delta.Y;
-  for Y:=0 to Size.Y-1 do
-  begin
-    if Y=ErrorLine then
-      begin
-        MoveChar(B,' ',ErrorMessageColor,Size.X);
-        MoveStr(B,ErrorMsg,ErrorMessageColor);
-        WriteLine(0,Y,Size.X,1,B);
-      end
-    else
-      begin
-        AY:=ViewToEditorLine(Delta.Y+Y);
-        if (0<=AY) and (AY<LineCount) then
-          begin
-            Line:=GetLine(AY);
-            if assigned(Line) then
-              begin
-                IsBreak:=Line^.IsFlagSet(lfBreakpoint);
-                EI:=Line^.GetEditorInfo(@Self);
-              end
-            else
-              begin
-                IsBreak:=false;
-                EI:=nil;
-              end;
-          end
-        else
-          begin
-            Line:=nil;
-            IsBreak:=false;
-            EI:=nil;
-          end;
-
-        begin
-          Color:=ColorTab[coTextColor];
-          FillChar(FreeFormat,SizeOf(FreeFormat),1);
-          MoveChar(B,' ',Color,Size.X);
-          GetDisplayTextFormat(AY,LineText,Format);
-
-      {    if FlagSet(efSyntaxHighlight) then MaxX:=length(LineText)+1
-             else }MaxX:=Size.X+Delta.X;
-          for X:=1 to Min(MaxX,High(LineText)) do
-          begin
-            AX:=Delta.X+X-1;
-            if X<=length(LineText) then C:=LineText[X] else C:=' ';
-
-            PX.X:=AX-Delta.X; PX.Y:=AY;
-            if (Highlight.A.X<>Highlight.B.X) or (Highlight.A.Y<>Highlight.B.Y) then
-             { there's a highlight }
-              begin
-                if (PointOfs(Highlight.A)<=PointOfs(PX)) and (PointOfs(PX)<PointOfs(Highlight.B)) then
-                  begin
-                    Color:=SelectColor;
-                    FreeFormat[X]:=false;
-                  end;
-              end
-            else
-             { no highlight }
-              begin
-                if IsFlagSet(efVerticalBlocks) then
-                  begin
-                    if (SelStart.X<=AX) and (AX<=SelEnd.X) and
-                       (SelStart.Y<=AY) and (AY<=SelEnd.Y) then
-                      begin
-                        Color:=SelectColor; FreeFormat[X]:=false;
-                      end;
-                  end
-                else
-                  if PointOfs(SelStart)<>PointOfs(SelEnd) then
-                   if (PointOfs(SelStart)<=PointOfs(PX)) and (PointOfs(PX)<PointOfs(SelEnd)) then
-                    begin
-                      Color:=SelectColor; FreeFormat[X]:=false;
-                    end;
-              end; { no highlight }
-            if FreeFormat[X] then
-             if X<=length(Format) then
-               {Color:=ColorTab[ord(Format[X])] else Color:=ColorTab[coTextColor];
-                 this give BoundsCheckError with -Cr quite often PM }
-               Color:=ColorTab[ord(Format[X]) mod (coLastColor + 1)] else Color:=ColorTab[coTextColor];
-
-            if IsFlagSet(efHighlightRow) and
-               (PX.Y=CurPos.Y) then
-              begin
-                Color:=CombineColors(Color,HighlightRowColor);
-                FreeFormat[X]:=false;
-              end;
-            if IsFlagSet(efHighlightColumn) and (PX.X=CurPos.X) then
-              begin
-                Color:=CombineColors(Color,HighlightColColor);
-                FreeFormat[X]:=false;
-              end;
-
-            if Assigned(Line) and Line^.IsFlagSet(lfHighlightRow) then
-              begin
-                Color:=CombineColors(Color,HighlightRowColor);
-                FreeFormat[X]:=false;
-              end;
-            if isbreak then
-              begin
-                Color:=ColorTab[coBreakColor];
-                FreeFormat[X]:=false;
-              end;
-            if Assigned(Line) and Line^.isFlagSet(lfDebuggerRow) then
-              begin
-                Color:=CombineColors(Color,HighlightRowColor);
-                FreeFormat[X]:=false;
-              end;
-
-            if (0<=LSX+X-1-Delta.X) and (LSX+X-1-Delta.X<MaxViewWidth) then
-              MoveChar(B[LSX+X-1-Delta.X],C,Color,1);
-          end; { for X:=1 to ... }
-          if IsFlagSet(efFolds) then
-          begin
-            GetFoldStrings(AY,FoldPrefix,FoldSuffix);
-            MoveStr(B[0],FoldPrefix,ColorTab[coTextColor]);
-            if FoldSuffix<>'' then
-              MoveStr(B[Size.X-1-length(FoldSuffix)],FoldSuffix,ColorTab[coTextColor]);
-          end;
-          WriteLine(0,Y,Size.X,1,B);
-        end; { if not SkipLine ... }
-      end; { not errorline }
-    PrevEI:=EI; PrevLine:=Line;
-  end; { while (Y<Size.Y) ... }
-  DrawCursor;
-end;
-
-procedure TCustomCodeEditor.DrawCursor;
-var LSX: sw_integer;
-begin
-  if lockflag>0 then
-    DrawCursorCalled:=true
-  else
-    SetCursor(GetReservedColCount+CurPos.X-Delta.X,EditorToViewLine(CurPos.Y)-Delta.Y);
-  SetState(sfCursorIns,Overwrite);
-end;
-
-function TCustomCodeEditor.Overwrite: boolean;
-begin
-  Overwrite:=not IsFlagSet(efInsertMode);
-end;
-
-procedure TCustomCodeEditor.SetCodeCompleteWord(const S: string);
-begin
-  if S<>'' then
-    SetCompleteState(csOffering)
-  else
-    SetCompleteState(csInactive);
-end;
-
-procedure TCustomCodeEditor.ClearCodeCompleteWord;
-begin
-  SetCodeCompleteWord('');
-  SetCompleteState(csInactive);
-end;
-
-function TCustomCodeEditor.GetCompleteState: TCompleteState;
-begin
-  { Abstract }
-  GetCompleteState:=csInactive;
-end;
-
-procedure TCustomCodeEditor.SetCompleteState(AState: TCompleteState);
-begin
-  { Abstract }
-end;
-
-function TCustomCodeEditor.UpdateAttrs(FromLine: sw_integer; Attrs: byte): sw_integer;
-begin
-  Abstract;
-  UpdateAttrs:=-1;
-end;
-
-function TCustomCodeEditor.UpdateAttrsRange(FromLine, ToLine: sw_integer; Attrs: byte): sw_integer;
-begin
-  Abstract;
-  UpdateAttrsRange:=-1;
-end;
-
-procedure TCustomCodeEditor.AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string);
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.AddGroupedAction(AAction : byte);
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.CloseGroupedAction(AAction : byte);
-begin
-  { Abstract }
-end;
-
-function TCustomCodeEditor.GetUndoActionCount: sw_integer;
-begin
-  { Abstract }
-  GetUndoActionCount:=0;
-end;
-
-function TCustomCodeEditor.GetRedoActionCount: sw_integer;
-begin
-  { Abstract }
-  GetRedoActionCount:=0;
-end;
-
-function TCustomCodeEditor.GetMaxFoldLevel: sw_integer;
-var Max,L,I: sw_integer;
-begin
-  Max:=0;
-  for I:=0 to GetFoldCount-1 do
-  begin
-    L:=GetFold(I)^.GetLevel;
-    if L>Max then Max:=L;
-  end;
-  GetMaxFoldLevel:=Max;
-end;
-
-function TCustomCodeEditor.GetFoldStringWidth: sw_integer;
-begin
-  GetFoldStringWidth:=GetMaxFoldLevel;
-end;
-
-procedure TCustomCodeEditor.GetFoldStrings(EditorLine: sw_integer; var Prefix, Suffix: openstring);
-var F: PFold;
-    C: char;
-begin
-  Prefix:=CharStr(' ',GetFoldStringWidth); Suffix:='';
-  F:=GetLineFold(EditorLine);
-  if Assigned(F) then
-  begin
-    if F^.Collapsed_ then C:=#27 else C:=#26;
-    Prefix[1+F^.GetLevel]:=C;
-    if F^.Collapsed_ then
-      Suffix:='('+IntToStr(F^.GetLineCount)+')';
-  end;
-end;
-
-function TCustomCodeEditor.GetFoldCount: sw_integer;
-begin
-  GetFoldCount:=0;
-end;
-
-function TCustomCodeEditor.GetFold(Index: sw_integer): PFold;
-begin
-  GetFold:=nil;
-end;
-
-procedure TCustomCodeEditor.RegisterFold(AFold: PFold);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditor.UnRegisterFold(AFold: PFold);
-begin
-  Abstract;
-end;
-
-procedure TCustomCodeEditor.Indent;
-var S, PreS: string;
-    Shift: integer;
-begin
-  S:=GetLineText(CurPos.Y);
-  if CurPos.Y>0 then
-    PreS:=RTrim(GetLineText(CurPos.Y-1),not IsFlagSet(efUseTabCharacters))
-  else
-    PreS:='';
-  if CurPos.X>=length(PreS) then
-    Shift:=GetTabSize
-  else
-    begin
-      Shift:=1;
-      while (CurPos.X+Shift<length(PreS)) and (PreS[CurPos.X+Shift]<>' ') do
-       Inc(Shift);
-    end;
-  SetLineText(CurPos.Y,RExpand(copy(S,1,CurPos.X+1),CurPos.X+1)+CharStr(' ',Shift)+copy(S,CurPos.X+2,High(S)));
-  SetCurPtr(CurPos.X+Shift,CurPos.Y);
-  UpdateAttrs(CurPos.Y,attrAll);
-  DrawLines(CurPos.Y);
-  SetModified(true);
-end;
-
-procedure TCustomCodeEditor.CharLeft;
-begin
-  if CurPos.X=0 then Exit;
-
-  SetCurPtr(CurPos.X-1,CurPos.Y);
-end;
-
-procedure TCustomCodeEditor.CharRight;
-begin
-  if CurPos.X>=MaxLineLength then
-    Exit;
-  SetCurPtr(CurPos.X+1,CurPos.Y);
-end;
-
-procedure TCustomCodeEditor.WordLeft;
-var X, Y: sw_integer;
-    Line: string;
-    GotIt,FoundNonSeparator: boolean;
-begin
-  X:=CurPos.X;
-  Y:=CurPos.Y;
-  GotIt:=false;
-  FoundNonSeparator:=false;
-  while (Y>=0) do
-   begin
-     if Y=CurPos.Y then
-      begin
-   X:=length(GetDisplayText(Y));
-   if CurPos.X<X then
-     X:=CurPos.X; Dec(X);
-   if (X=-1) then
-     begin
-       Dec(Y);
-       if Y>=0 then
-        X:=length(GetDisplayText(Y));
-       Break;
-     end;
-      end
-     else
-      X:=length(GetDisplayText(Y))-1;
-     Line:=GetDisplayText(Y);
-     while (X>=0) and (GotIt=false) do
-      begin
-   if FoundNonSeparator then
-    begin
-      if IsWordSeparator(Line[X+1]) then
-       begin
-         Inc(X);
-         GotIt:=true;
-         Break;
-       end;
-    end
-   else
-    if not IsWordSeparator(Line[X+1]) then
-     FoundNonSeparator:=true;
-   Dec(X);
-   if (X=0) and (IsWordSeparator(Line[1])=false) then
-    begin
-      GotIt:=true;
-      Break;
-    end;
-      end;
-     if GotIt then
-      Break;
-     X:=0;
-     Dec(Y);
-     if Y>=0 then
-      begin
-   X:=length(GetDisplayText(Y));
-   Break;
-      end;
-   end;
-  if Y<0 then Y:=0; if X<0 then X:=0;
-  SetCurPtr(X,Y);
-end;
-
-procedure TCustomCodeEditor.WordRight;
-var X, Y: sw_integer;
-    Line: string;
-    GotIt: boolean;
-begin
-  X:=CurPos.X; Y:=CurPos.Y; GotIt:=false;
-  while (Y<GetLineCount) do
-  begin
-    if Y=CurPos.Y then
-       begin
-    X:=CurPos.X; Inc(X);
-    if (X>length(GetDisplayText(Y))-1) then
-       begin Inc(Y); X:=0; end;
-       end else X:=0;
-    Line:=GetDisplayText(Y);
-    while (X<=length(Line)+1) and (GotIt=false) and (Line<>'') do
-    begin
-      if X=length(Line)+1 then begin GotIt:=true; Dec(X); Break end;
-      if IsWordSeparator(Line[X]) then
-    begin
-      while (Y<GetLineCount) and
-       (X<=length(Line)) and (IsWordSeparator(Line[X])) do
-       begin
-         Inc(X);
-         if X>=length(Line) then
-            begin GotIt:=true; Dec(X); Break; end;
-       end;
-      if (GotIt=false) and (X<length(Line)) then
-      begin
-        Dec(X);
-        GotIt:=true;
-        Break;
-      end;
-    end;
-      Inc(X);
-    end;
-    if GotIt then Break;
-    X:=0;
-    Inc(Y);
-    if (Y<GetLineCount) then
-    begin
-      Line:=GetDisplayText(Y);
-      if (Line<>'') and (IsWordSeparator(Line[1])=false) then Break;
-    end;
-  end;
-  if Y=GetLineCount then Y:=GetLineCount-1;
-  SetCurPtr(X,Y);
-end;
-
-procedure TCustomCodeEditor.LineStart;
-begin
-  SetCurPtr(0,CurPos.Y);
-end;
-
-procedure TCustomCodeEditor.LineEnd;
-var
-  s : string;
-  i : longint;
-begin
-  if CurPos.Y<GetLineCount then
-    begin
-      s:=GetDisplayText(CurPos.Y);
-      i:=length(s);
-      while (i>0) and (s[i]=' ') do
-        dec(i);
-      SetCurPtr(i,CurPos.Y);
-    end
-  else
-    SetCurPtr(0,CurPos.Y);
-end;
-
-function TCustomCodeEditor.NextVisibleLine(StartLine: sw_integer; Down: boolean): sw_integer;
-var Count,NL: sw_integer;
-begin
-  if Down then
-    begin
-      Count:=GetLineCount;
-      NL:=StartLine;
-      while (NL<Count-1) and not IsLineVisible(NL) do
-        Inc(NL);
-      if NL>=Count then
-        NL:=-1;
-    end
-  else
-    begin
-      NL:=StartLine;
-      while (NL>0) and not IsLineVisible(NL) do
-        Dec(NL);
-    end;
-  if not IsLineVisible(NL) then
-    NL:=-1;
-  NextVisibleLine:=NL;
-end;
-
-procedure TCustomCodeEditor.LineUp;
-var NL: sw_integer;
-begin
-  NL:=NextVisibleLine(CurPos.Y-1,false);
-  if NL<>-1 then
-    SetCurPtr(CurPos.X,NL);
-end;
-
-procedure TCustomCodeEditor.LineDown;
-var NL: sw_integer;
-begin
-  NL:=NextVisibleLine(CurPos.Y+1,true);
-  if NL<>-1 then
-    SetCurPtr(CurPos.X,NL);
-end;
-
-procedure TCustomCodeEditor.PageUp;
-var NL: sw_integer;
-begin
-  ScrollTo(Delta.X,Max(Delta.Y-Size.Y,0));
-  NL:=Max(CurPos.Y-(Size.Y),0);
-  if not IsLineVisible(NL) then
-    NL:=NextVisibleLine(NL,false);
-  if NL>=0 then
-    SetCurPtr(CurPos.X,Max(0,NL));
-end;
-
-procedure TCustomCodeEditor.PageDown;
-var NL: sw_integer;
-begin
-  ScrollTo(Delta.X,Min(Delta.Y+Size.Y,GetLineCount-1));
-  NL:=Min(CurPos.Y+(Size.Y{-1}),GetLineCount-1);
-  if not IsLineVisible(NL) then
-    NL:=NextVisibleLine(NL,true);
-  if NL>=0 then
-    SetCurPtr(CurPos.X,Min(GetLineCount-1,NL));
-end;
-
-procedure TCustomCodeEditor.TextStart;
-begin
-  SetCurPtr(0,0);
-end;
-
-procedure TCustomCodeEditor.TextEnd;
-var s : string;
-    i : longint;
-begin
-  s:=GetDisplayText(GetLineCount-1);
-  i:=length(s);
-  while (i>0) and (s[i]=' ') do
-    dec(i);
-  SetCurPtr(i,GetLineCount-1);
-end;
-
-procedure TCustomCodeEditor.WindowStart;
-begin
-  SetCurPtr(CurPos.X,Delta.Y);
-end;
-
-procedure TCustomCodeEditor.WindowEnd;
-begin
-  SetCurPtr(CurPos.X,Delta.Y+Size.Y-1);
-end;
-
-procedure TCustomCodeEditor.JumpSelStart;
-begin
-  if ValidBlock then
-    SetCurPtr(SelStart.X,SelStart.Y);
-end;
-
-procedure TCustomCodeEditor.JumpSelEnd;
-begin
-  if ValidBlock then
-  SetCurPtr(SelEnd.X,SelEnd.Y);
-end;
-
-procedure TCustomCodeEditor.JumpMark(MarkIdx: integer);
-begin
-  if (MarkIdx<Low(Bookmarks)) or (MarkIdx>High(Bookmarks)) then
-    begin ErrorBox(FormatStrInt(msg_invalidmarkindex,MarkIdx),nil); Exit; end;
-
-  with Bookmarks[MarkIdx] do
-  if Valid=false then
-    InformationBox(FormatStrInt(msg_marknotset,MarkIdx),nil)
-  else
-    SetCurPtr(Pos.X,Pos.Y);
-end;
-
-procedure TCustomCodeEditor.DefineMark(MarkIdx: integer);
-begin
-  if (MarkIdx<Low(Bookmarks)) or (MarkIdx>High(Bookmarks)) then
-    begin
-      ErrorBox(FormatStrInt(msg_invalidmarkindex,MarkIdx),nil);
-      Exit;
-    end;
-  with Bookmarks[MarkIdx] do
-   begin
-     Pos:=CurPos;
-     Valid:=true;
-   end;
-end;
-
-procedure TCustomCodeEditor.JumpToLastCursorPos;
-begin
-  NotImplemented;
-end;
-
-procedure TCustomCodeEditor.UpperCase;
-var StartP,EndP: TPoint;
-begin
-  if ValidBlock=false then Exit;
-  GetSelectionArea(StartP,EndP);
-  ChangeCaseArea(StartP,EndP,caToUpperCase);
-end;
-
-procedure TCustomCodeEditor.LowerCase;
-var StartP,EndP: TPoint;
-begin
-  if ValidBlock=false then Exit;
-  GetSelectionArea(StartP,EndP);
-  ChangeCaseArea(StartP,EndP,caToLowerCase);
-end;
-
-procedure TCustomCodeEditor.ToggleCase;
-var StartP,EndP: TPoint;
-begin
-  if ValidBlock=false then Exit;
-  GetSelectionArea(StartP,EndP);
-  ChangeCaseArea(StartP,EndP,caToggleCase);
-end;
-
-procedure TCustomCodeEditor.WordLowerCase;
-var StartP,EndP: TPoint;
-begin
-  if GetCurrentWordArea(StartP,EndP)=false then Exit;
-  ChangeCaseArea(StartP,EndP,caToLowerCase);
-end;
-
-procedure TCustomCodeEditor.WordUpperCase;
-var StartP,EndP: TPoint;
-begin
-  if GetCurrentWordArea(StartP,EndP)=false then Exit;
-  ChangeCaseArea(StartP,EndP,caToUpperCase);
-end;
-
-procedure TCustomCodeEditor.CreateFoldFromBlock;
-var StartY,EndY: sw_integer;
-begin
-  if not IsFlagSet(efFolds) then Exit;
-  if not ValidBlock then Exit;
-  StartY:=SelStart.Y; EndY:=SelEnd.Y;
-  if SelEnd.X=0 then Dec(EndY);
-  if CreateFold(StartY,EndY,false)=false then
-    ErrorBox(msg_foldboundsarenotvalid,nil);
-end;
-
-procedure TCustomCodeEditor.ToggleFold;
-var F: PFold;
-begin
-  if not IsFlagSet(efFolds) then Exit;
-  F:=GetLineFold(CurPos.Y);
-  if Assigned(F) then
-    F^.Collapse(not F^.Collapsed_);
-end;
-
-procedure TCustomCodeEditor.ExpandFold;
-var F: PFold;
-begin
-  if not IsFlagSet(efFolds) then Exit;
-  F:=GetLineFold(CurPos.Y);
-  if Assigned(F) then
-    F^.Collapse(false);
-end;
-
-procedure TCustomCodeEditor.CollapseFold;
-var F: PFold;
-begin
-  if not IsFlagSet(efFolds) then Exit;
-  F:=GetLineFold(CurPos.Y);
-  if Assigned(F) then
-    F^.Collapse(true);
-end;
-
-procedure TCustomCodeEditor.ChangeCaseArea(StartP,EndP: TPoint; CaseAction: TCaseAction);
-var Y,X: sw_integer;
-    X1,X2: sw_integer;
-    S: string;
-    C: char;
-begin
-  Lock;
-  for Y:=StartP.Y to EndP.Y do
-  begin
-    S:=GetDisplayText(Y);
-    { Pierre, please implement undo here! Gabor }
-    X1:=0; X2:=length(S)-1;
-    if Y=StartP.Y then X1:=StartP.X;
-    if Y=EndP.Y then X2:=EndP.X;
-    for X:=X1 to X2 do
-    begin
-      C:=S[X+1];
-      case CaseAction of
-        caToLowerCase : C:=LowCase(C);
-        caToUpperCase : C:=UpCase(C);
-        caToggleCase  : if C in['a'..'z'] then
-                          C:=Upcase(C)
-                        else
-                          C:=LowCase(C);
-       end;
-      S[X+1]:=C;
-    end;
-    SetDisplayText(Y,S);
-  end;
-  UpdateAttrsRange(StartP.Y,EndP.Y,attrAll);
-  DrawLines(CurPos.Y);
-  SetModified(true);
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.InsertOptions;
-begin
-  { Abstract }
-  NotImplemented;
-end;
-
-function TCustomCodeEditor.GetLineFold(EditorLine: sw_integer): PFold;
-var L: PCustomLine;
-    LI: PEditorLineInfo;
-    F: PFold;
-begin
-  F:=nil;
-  if IsFlagSet(efFolds) then
-  if (0<=EditorLine) and (EditorLine<GetLineCount) then
-  begin
-    L:=GetLine(EditorLine);
-    if Assigned(L) then
-      LI:=L^.GetEditorInfo(@Self)
-    else
-      LI:=nil;
-    if Assigned(LI) then
-      F:=LI^.Fold;
-  end;
-  GetLineFold:=F;
-end;
-
-function TCustomCodeEditor.IsLineVisible(EditorLine: sw_integer): boolean;
-var V: boolean;
-    F,PrevF: PFold;
-    FoldHeadline: boolean;
-begin
-  V:=true;
-  if IsFlagSet(efFolds) then
-    begin
-      F:=GetLineFold(EditorLine);
-      if Assigned(F) then
-      begin
-        PrevF:=GetLineFold(EditorLine-1);
-        FoldHeadline:=false;
-        if (PrevF<>F) and ((PrevF=nil) or (not PrevF^.IsParent(F))) then
-          FoldHeadline:=true;
-        if FoldHeadline then
-          begin
-            if Assigned(F^.ParentFold) and (F^.ParentFold^.IsCollapsed) then
-              V:=false;
-          end
-        else
-          if F^.IsCollapsed then
-            V:=false;
-      end;
-    end;
-  IsLineVisible:=V;
-end;
-
-function TCustomCodeEditor.ViewToEditorLine(ViewLine: sw_integer): sw_integer;
-var I,Line,Count: sw_integer;
-begin
-  if not IsFlagSet(efFolds) then
-    Line:=ViewLine
-  else
-    begin
-      Count:=GetLineCount;
-      I:=0; Line:=-1;
-      while (Line<ViewLine) and (I<Count) do
-      begin
-        if IsLineVisible(I) then
-          Inc(Line);
-        Inc(I);
-      end;
-      if Line<>ViewLine then
-        Line:=-1
-      else
-        Line:=I-1;
-    end;
-  ViewToEditorLine:=Line;
-end;
-
-function TCustomCodeEditor.EditorToViewLine(EditorLine: sw_integer): sw_integer;
-var I,Line: sw_integer;
-    F: PFold;
-begin
-  if not IsFlagSet(efFolds) then
-    Line:=EditorLine
-  else
-    begin
-      Line:=-1;
-      for I:=0 to EditorLine do
-        if IsLineVisible(I) then
-          Inc(Line);
-    end;
-  EditorToViewLine:=Line;
-end;
-
-procedure TCustomCodeEditor.ViewToEditorPoint(P: TPoint; var NP: TPoint);
-begin
-  NP.X:=P.X-GetReservedColCount;
-  NP.Y:=ViewToEditorLine(P.Y);
-end;
-
-procedure TCustomCodeEditor.EditorToViewPoint(P: TPoint; var NP: TPoint);
-begin
-  NP.X:=P.X+GetReservedColCount;
-  NP.Y:=EditorToViewLine(P.Y);
-end;
-
-procedure TCustomCodeEditor.FindMatchingDelimiter(ScanForward: boolean);
-const OpenSymbols  : string[6] = '[{(<''"';
-      CloseSymbols : string[6] = ']})>''"';
-var SymIdx: integer;
-    LineText,LineAttr: string;
-    CurChar: char;
-    X,Y: sw_integer;
-    LineCount: sw_integer;
-    JumpPos: TPoint;
-    BracketLevel: integer;
-begin
-  JumpPos.X:=-1; JumpPos.Y:=-1;
-  LineText:=GetDisplayText(CurPos.Y);
-  LineText:=copy(LineText,CurPos.X+1,1);
-  if LineText='' then Exit;
-  CurChar:=LineText[1];
-  Y:=CurPos.Y; X:=CurPos.X; LineCount:=0;
-  BracketLevel:=1;
-  if ScanForward then
-    begin
-      SymIdx:=Pos(CurChar,OpenSymbols);
-      if SymIdx=0 then Exit;
-      repeat
-        Inc(LineCount);
-        GetDisplayTextFormat(Y,LineText,LineAttr);
-        if LineCount<>1 then X:=-1;
-        repeat
-          Inc(X);
-          if X<length(LineText) then
-           if copy(LineAttr,X+1,1)<>chr(attrComment) then
-             if (LineText[X+1]=CloseSymbols[SymIdx]) and (BracketLevel=1) then
-               begin
-                 JumpPos.X:=X; JumpPos.Y:=Y;
-               end
-             else
-               if LineText[X+1]=OpenSymbols[SymIdx] then
-                 Inc(BracketLevel)
-               else
-               if LineText[X+1]=CloseSymbols[SymIdx] then
-                 if BracketLevel>1 then
-                   Dec(BracketLevel);
-        until (X>=length(LineText)) or (JumpPos.X<>-1);
-        Inc(Y);
-      until (Y>=GetLineCount) or (JumpPos.X<>-1);
-    end
-  else
-    begin
-      SymIdx:=Pos(CurChar,CloseSymbols);
-      if SymIdx=0 then Exit;
-      repeat
-        Inc(LineCount);
-        GetDisplayTextFormat(Y,LineText,LineAttr);
-        if LineCount<>1 then X:=length(LineText);
-        repeat
-          Dec(X);
-          if X>0 then
-           if copy(LineAttr,X+1,1)<>chr(attrComment) then
-             if (LineText[X+1]=OpenSymbols[SymIdx]) and (BracketLevel=1) then
-               begin
-                 JumpPos.X:=X; JumpPos.Y:=Y;
-               end
-             else
-               if LineText[X+1]=CloseSymbols[SymIdx] then
-                 Inc(BracketLevel)
-               else
-               if LineText[X+1]=OpenSymbols[SymIdx] then
-                 if BracketLevel>1 then
-                   Dec(BracketLevel);
-        until (X<0) or (JumpPos.X<>-1);
-        Dec(Y);
-      until (Y<0) or (JumpPos.X<>-1);
-    end;
-  if JumpPos.X<>-1 then
-  begin
-    SetCurPtr(JumpPos.X,JumpPos.Y);
-    TrackCursor(true);
-  end;
-end;
-
-function TCustomCodeEditor.InsertNewLine: Sw_integer;
-var i,Ind: Sw_integer;
-    S,IndentStr: string;
-procedure CalcIndent(LineOver: Sw_integer);
-begin
-  if (LineOver<0) or (LineOver>GetLineCount) or ((GetFlags and efNoIndent)<>0) then
-    Ind:=0 else
-  begin
-    repeat
-      IndentStr:=GetDisplayText(LineOver);
-      Dec(LineOver);
-    until (LineOver<0) or (IndentStr<>'');
-    Ind:=0;
-    while (Ind<length(IndentStr)) and (IndentStr[Ind+1]=' ') do
-     Inc(Ind);
-  end;
-  IndentStr:=CharStr(' ',Ind);
-end;
-var {SelBack: sw_integer;}
-    SCP: TPoint;
-    HoldUndo : Boolean;
-    L,NewL: PCustomLine;
-    EI,NewEI: PEditorLineInfo;
-begin
-  if IsReadOnly then begin InsertNewLine:=-1; Exit; end;
-  Lock;
-  SCP:=CurPos;
-  HoldUndo:=GetStoreUndo;
-  SetStoreUndo(false);
-  if CurPos.Y<GetLineCount then S:=GetLineText(CurPos.Y) else S:='';
-  if Overwrite=false then
-  begin
-    if CurPos.Y<GetLineCount then
-      begin
-        L:=GetLine(CurPos.Y);
-        if not assigned(L) then
-          EI:=nil
-        else
-          EI:=L^.GetEditorInfo(@Self);
-      end
-    else
-      EI:=nil;
-{    SelBack:=0;}
-    if GetLineCount>0 then
-    begin
-      S:=GetDisplayText(CurPos.Y);
-{      SelBack:=length(S)-SelEnd.X;}
-      SetDisplayText(CurPos.Y,RTrim(S,not IsFlagSet(efUseTabCharacters)));
-    end;
-    SetDisplayText(CurPos.Y,copy(S,1,CurPos.X-1+1));
-    CalcIndent(CurPos.Y);
-    S:=copy(S,CurPos.X+1,High(S));
-    i:=1;
-    while (i<=length(s)) and (i<=length(IndentStr)) and (s[i]=' ') do
-      inc(i);
-    if i>1 then
-      Delete(IndentStr,1,i-1);
-    NewL:=InsertLine(CurPos.Y+1,IndentStr+S);
-    LimitsChanged;
-(*    if PointOfs(SelStart)<>PointOfs(SelEnd) then { !!! check it - it's buggy !!! }
-      begin SelEnd.Y:=CurPos.Y+1; SelEnd.X:=length(GetLineText(CurPos.Y+1))-SelBack; end;*)
-    UpdateAttrs(CurPos.Y,attrAll);
-    SetCurPtr(Ind,CurPos.Y+1);
-    NewEI:=NewL^.GetEditorInfo(@Self);
-    if Assigned(EI) and Assigned(NewEI) then
-    begin
-      NewEI^.SetFold(EI^.Fold);
-      if Assigned(EI^.Fold) then
-        if EI^.Fold^.IsCollapsed then
-          EI^.Fold^.Collapse(false);
-    end;
-{$ifdef Undo}
-     SetStoreUndo(HoldUndo);
-     Addaction(eaInsertLine,SCP,CurPos,IndentStr);
-     SetStoreUndo(false);
-{$endif Undo}
-    AdjustSelection(CurPos.X-SCP.X,CurPos.Y-SCP.Y);
-  end else
-  begin
-    CalcIndent(CurPos.Y);
-    if CurPos.Y=GetLineCount-1 then
-    begin
-      AddLine(IndentStr);
-      AdjustSelection(0,1);
-      LimitsChanged;
-{$ifdef Undo}
-      SetStoreUndo(HoldUndo);
-      UpdateAttrs(CurPos.Y,attrAll);
-      SetCurPtr(Ind,CurPos.Y+1);
-      Addaction(eaInsertLine,SCP,CurPos,IndentStr);
-      SetStoreUndo(false);
-{$endif Undo}
-    end
-    else
-    begin
-      UpdateAttrs(CurPos.Y,attrAll);
-      SetStoreUndo(HoldUndo);
-      SetCurPtr(Ind,CurPos.Y+1);
-      SetStoreUndo(false);
-    end;
-  end;
-  DrawLines(CurPos.Y);
-  SetStoreUndo(HoldUndo);
-  SetModified(true);
-  Unlock;
-end;
-
-procedure TCustomCodeEditor.BreakLine;
-begin
-  NotImplemented; Exit;
-end;
-
-procedure TCustomCodeEditor.BackSpace;
-var S,PreS: string;
-    OI,CI,CP,Y,TX: Sw_integer;
-    SCP,SC1 : TPoint;
-    HoldUndo : Boolean;
-begin
-  if IsReadOnly then Exit;
-  Lock;
-  SCP:=CurPos;
-  HoldUndo:=GetStoreUndo;
-  SetStoreUndo(false);
-  if CurPos.X=0 then
-   begin
-     if CurPos.Y>0 then
-      begin
-        S:=GetLineText(CurPos.Y-1);
-        SetLineText(CurPos.Y-1,S+GetLineText(CurPos.Y));
-        SC1.X:=Length(S);SC1.Y:=CurPOS.Y-1;
-        SetStoreUndo(HoldUndo);
-        AddAction(eaDeleteLine,SCP,SC1,GetLineText(CurPos.Y));
-        SetStoreUndo(false);
-        DeleteLine(CurPos.Y);
-        LimitsChanged;
-        SetCurPtr(length(S),CurPos.Y-1);
-      end;
-   end
-  else
-   begin
-     S:=GetDisplayText(CurPos.Y);
-     CP:=CurPos.X-1;
-     if IsFlagSet(efBackspaceUnindents) then
-      if Trim(copy(S,1,CP+1))='' then
-      begin
-        Y:=CurPos.Y;
-        while (Y>0) do
-          begin
-            Dec(Y);
-            PreS:=GetDisplayText(Y);
-            if Trim(copy(PreS,1,CP+1))<>'' then Break;
-          end;
-        if Y<0 then PreS:='';
-{        while (CP>0) and
-              ( (CP>length(S))    or (S[CP]=' ')     ) and
-              ( (CP>length(PreS)) or (PreS[CP]<>' ') ) do
-          Dec(CP);}
-        TX:=0;
-        while (TX<length(PreS)) and (PreS[TX+1]=' ') do
-          Inc(TX);
-        if TX<CP then CP:=TX;
-      end;
-     S:=GetLineText(CurPos.Y);
-     OI:=LinePosToCharIdx(CurPos.Y,CurPos.X);
-     CI:=LinePosToCharIdx(CurPos.Y,CP);
-     SetLineText(CurPos.Y,copy(S,1,CI-1)+copy(S,OI,High(S)));
-     SetCurPtr(CP,CurPos.Y);
-{$ifdef Undo}
-     SetStoreUndo(HoldUndo);
-     Addaction(eaDeleteText,SCP,CurPos,Copy(S,CI,OI-CI));
-     SetStoreUndo(false);
-{$endif Undo}
-   end;
-  UpdateAttrs(CurPos.Y,attrAll);
-  AdjustSelection(CurPos.X-SCP.X,CurPos.Y-SCP.Y);
-  DrawLines(CurPos.Y);
-  SetStoreUndo(HoldUndo);
-  SetModified(true);
-  Unlock;
-end;
-
-procedure TCustomCodeEditor.DelChar;
-var S: string;
-    SDX,SDY,CI : sw_integer;
-    HoldUndo : boolean;
-    SCP : TPoint;
-begin
-  if IsReadOnly then Exit;
-  Lock;
-  HoldUndo:=GetStoreUndo;
-  SetStoreUndo(false);
-  S:=GetLineText(CurPos.Y);
-  if CurPos.X>=length(S) then
-   begin
-     if CurPos.Y<GetLineCount-1 then
-      begin
-        SetLineText(CurPos.Y,S+CharStr(' ',CurPOS.X-Length(S))+GetLineText(CurPos.Y+1));
-        SetStoreUndo(HoldUndo);
-        SCP.X:=0;SCP.Y:=CurPos.Y+1;
-        AddGroupedAction(eaDelChar);
-        AddAction(eaMoveCursor,CurPos,SCP,'');
-        AddAction(eaDeleteLine,SCP,CurPos,GetLineText(CurPos.Y+1));
-        CloseGroupedAction(eaDelChar);
-        SetStoreUndo(false);
-        DeleteLine(CurPos.Y+1);
-        LimitsChanged;
-        SDX:=0; SDY:=-1;
-       end;
-   end
-  else
-   begin
-     { Problem if S[CurPos.X+1]=TAB !! PM }
-     CI:=LinePosToCharIdx(CurPos.Y,CurPos.X);
-     if S[CI]=TAB then
-       begin
-         S:=Copy(S,1,CI-1)+CharStr(' ',GetTabSize-1)+Copy(S,CI+1,High(S));
-{$ifdef Undo}
-         SetStoreUndo(HoldUndo);
-         Addaction(eaDeleteText,CurPos,CurPos,' ');
-         SetStoreUndo(false);
-{$endif Undo}
-       end
-     else
-       begin
-{$ifdef Undo}
-         SetStoreUndo(HoldUndo);
-         Addaction(eaDeleteText,CurPos,CurPos,S[CI]);
-         SetStoreUndo(false);
-{$endif Undo}
-         Delete(S,CI,1);
-       end;
-     SetLineText(CurPos.Y,S);
-     SDX:=-1; SDY:=0;
-   end;
-  SetCurPtr(CurPos.X,CurPos.Y);
-  UpdateAttrs(CurPos.Y,attrAll);
-  AdjustSelection(SDX,SDY);
-  DrawLines(CurPos.Y);
-  SetStoreUndo(HoldUndo);
-  SetModified(true);
-  Unlock;
-end;
-
-procedure TCustomCodeEditor.DelWord;
-var
-  SP,EP : TPoint;
-  SelSize : sw_integer;
-begin
-  if IsReadOnly then Exit;
-  Lock;
-  SP:=SelStart;
-  EP:=SelEnd;
-  SelectWord;
-  SelSize:=SelEnd.X-SelStart.X;
-  DelSelect;
-  SetSelection(SP,EP);
-  AdjustSelectionPos(CurPos.X,CurPos.Y,SelSize,0);
-  SetModified(true);
-  Unlock;
-end;
-
-procedure TCustomCodeEditor.DelStart;
-var S: string;
-begin
-  if IsReadOnly then Exit;
-  Lock;
-  S:=GetLineText(CurPos.Y);
-  if (S<>'') and (CurPos.X<>0) then
-  begin
-    SetLineText(CurPos.Y,copy(S,LinePosToCharIdx(CurPos.Y,CurPos.X),High(S)));
-    SetCurPtr(0,CurPos.Y);
-    UpdateAttrs(CurPos.Y,attrAll);
-    DrawLines(CurPos.Y);
-    SetModified(true);
-  end;
-  Unlock;
-end;
-
-procedure TCustomCodeEditor.DelEnd;
-var S: string;
-begin
-  if IsReadOnly then Exit;
-  Lock;
-  S:=GetLineText(CurPos.Y);
-  if (S<>'') and (CurPos.X<>length(S)) then
-  begin
-    SetLineText(CurPos.Y,copy(S,1,LinePosToCharIdx(CurPos.Y,CurPos.X)-1));
-    SetCurPtr(CurPos.X,CurPos.Y);
-    UpdateAttrs(CurPos.Y,attrAll);
-    DrawLines(CurPos.Y);
-    SetModified(true);
-  end;
-  Unlock;
-end;
-
-procedure TCustomCodeEditor.DelLine;
-var
-  HoldUndo : boolean;
-  SP : TPoint;
-  S : String;
-begin
-  if IsReadOnly then Exit;
-  Lock;
-  if GetLineCount>0 then
-  begin
-    SP:=CurPos;
-    S:=GetLineText(CurPos.Y);
-    HoldUndo:=GetStoreUndo;
-    SetStoreUndo(false);
-    DeleteLine(CurPos.Y);
-    LimitsChanged;
-    AdjustSelection(0,-1);
-    SetCurPtr(0,CurPos.Y);
-    UpdateAttrs(Max(0,CurPos.Y-1),attrAll);
-    DrawLines(CurPos.Y);
-    SetStoreUndo(HoldUndo);
-    AddAction(eaDeleteLine,SP,CurPos,S);
-    SetModified(true);
-  end;
-  Unlock;
-end;
-
-procedure TCustomCodeEditor.InsMode;
-begin
-  SetInsertMode(Overwrite);
-end;
-
-function TCustomCodeEditor.GetCurrentWordArea(var StartP,EndP: TPoint): boolean;
-const WordChars = ['A'..'Z','a'..'z','0'..'9','_'];
-var P : TPoint;
-    S : String;
-    StartPos,EndPos : byte;
-    OK: boolean;
-begin
-  P:=CurPos;
-  S:=GetLineText(P.Y);
-  StartPos:=P.X+1;
-  EndPos:=StartPos;
-  OK:=(S[StartPos] in WordChars);
-  if OK then
-    begin
-       While (StartPos>0) and (S[StartPos-1] in WordChars) do
-         Dec(StartPos);
-       While (EndPos<Length(S)) and (S[EndPos+1] in WordChars) do
-         Inc(EndPos);
-       StartP.X:=StartPos-1; StartP.Y:=CurPos.Y;
-       EndP.X:=EndPos-1; EndP.Y:=CurPos.Y;
-    end;
-  GetCurrentWordArea:=OK;
-end;
-
-function  TCustomCodeEditor.GetCurrentWord : string;
-var S: string;
-    StartP,EndP: TPoint;
-begin
-  if GetCurrentWordArea(StartP,EndP)=false then
-    S:=''
-  else
-    begin
-      S:=GetLineText(StartP.Y);
-      S:=copy(S,StartP.X+1,EndP.X-StartP.X+1);
-    end;
-  GetCurrentWord:=S;
-end;
-
-procedure TCustomCodeEditor.StartSelect;
-var P1,P2: TPoint;
-begin
-  if ValidBlock=false then
-    begin
-{      SetSelection(SelStart,Limit);}
-      P1:=CurPos; P1.X:=0; P2:=CurPos; {P2.X:=length(GetLineText(P2.Y))+1;}
-      SetSelection(P1,P2);
-    end
-  else
-    SetSelection(CurPos,SelEnd);
-  if PointOfs(SelEnd)<PointOfs(SelStart) then
-     SetSelection(SelStart,SelStart);
-  CheckSels;
-  DrawView;
-end;
-
-procedure TCustomCodeEditor.EndSelect;
-var P: TPoint;
-    LS: sw_integer;
-begin
-  P:=CurPos;
-{  P.X:=Min(SelEnd.X,length(GetLineText(SelEnd.Y)));}
-  LS:=length(GetLineText(SelEnd.Y));
-  if LS<P.X then P.X:=LS;
-  CheckSels;
-  SetSelection(SelStart,P);
-  DrawView;
-end;
-
-procedure TCustomCodeEditor.DelSelect;
-var LineDelta, LineCount, CurLine: Sw_integer;
-    StartX,EndX,LastX: Sw_integer;
-    S: string;
-    SPos : TPoint;
-begin
-  if IsReadOnly or (ValidBlock=false) then Exit;
-
-  Lock;
-  AddGroupedAction(eaDelBlock);
-  LineCount:=(SelEnd.Y-SelStart.Y)+1;
-  LineDelta:=0; LastX:=CurPos.X;
-  CurLine:=SelStart.Y;
-  { single line : easy }
-  if LineCount=1 then
-    begin
-      S:=GetDisplayText(CurLine);
-      StartX:=SelStart.X;
-      EndX:=SelEnd.X;
-      SetDisplayText(CurLine,RExpand(copy(S,1,StartX),StartX)
-        +copy(S,EndX+1,High(S)));
-      if GetStoreUndo then
-        begin
-          SPos.X:=StartX;
-          SPos.Y:=CurLine;
-          AddAction(eaDeleteText,SPos,SPos,Copy(S,StartX+1,EndX-StartX));
-        end;
-      Inc(CurLine);
-      LastX:=SelStart.X;
-    end
-  { several lines : a bit less easy }
-  else
-    begin
-      S:=GetDisplayText(CurLine);
-      StartX:=SelStart.X;
-      EndX:=SelEnd.X;
-      SetDisplayText(CurLine,RExpand(copy(S,1,StartX),StartX)
-        +copy(GetDisplayText(CurLine+LineCount-1),EndX+1,High(S)));
-      if GetStoreUndo then
-        begin
-          SPos.X:=StartX;
-          SPos.Y:=CurLine;
-          AddAction(eaDeleteText,SPos,SPos,Copy(S,StartX+1,High(S)));
-          S:=GetDisplayText(CurLine+LineCount-1);
-        end;
-      Inc(CurLine);
-      Inc(LineDelta);
-      LastX:=SelStart.X;
-      while (LineDelta<LineCount) do
-        begin
-        { delete the complete line }
-          DeleteLine(CurLine);
-          Inc(LineDelta);
-        end;
-      if GetStoreUndo then
-        begin
-          AddAction(eaInsertText,SPos,SPos,Copy(S,EndX+1,High(S)));
-        end;
-    end;
-  HideSelect;
-  SetCurPtr(LastX,CurLine-1);
-  UpdateAttrs(CurPos.Y,attrAll);
-  DrawLines(CurPos.Y);
-  SetModified(true);
-  CloseGroupedAction(eaDelBlock);
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.HideSelect;
-begin
-  SetSelection(CurPos,CurPos);
-  DrawLines(Delta.Y);
-end;
-
-procedure TCustomCodeEditor.CopyBlock;
-var Temp: PCodeEditor;
-    R: TRect;
-begin
-  if IsReadOnly or (ValidBlock=false) then Exit;
-
-  Lock;
-  GetExtent(R);
-  AddGroupedAction(eaCopyBlock);
-  New(Temp, Init(R, nil, nil, nil,nil));
-  Temp^.InsertFrom(@Self);
-(*  Temp^.SelectAll(true);
-  { this selects one line too much because
-    we have a empty line at creation to avoid
-    negative line problems so we need to decrease SelEnd.Y }
-  Dec(Temp^.SelEnd.Y);*)
-
-
-  InsertFrom(Temp);
-  Dispose(Temp, Done);
-  CloseGroupedAction(eaCopyBlock);
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.MoveBlock;
-var Temp: PCodeEditor;
-    R: TRect;
-    OldPos: TPoint;
-begin
-  if IsReadOnly then Exit;
-  if (SelStart.X=SelEnd.X) and (SelStart.Y=SelEnd.Y) then Exit;
-  Lock;
-  AddGroupedAction(eaMoveBlock);
-  GetExtent(R);
-  New(Temp, Init(R, nil, nil, nil,nil));
-  Temp^.InsertFrom(@Self);
-  OldPos:=CurPos;
-  if CurPos.Y>SelStart.Y then
-    Dec(OldPos.Y,Temp^.GetLineCount-1);
-  DelSelect;
-  SetCurPtr(OldPos.X,OldPos.Y);
-  InsertFrom(Temp);
-  Dispose(Temp, Done);
-  CloseGroupedAction(eaMoveBlock);
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.IndentBlock;
-var
-  ey,i,indlen : Sw_integer;
-  S,Ind : String;
-  Pos : Tpoint;
-begin
-  if IsReadOnly then Exit;
-  if (SelStart.X=SelEnd.X) and (SelStart.Y=SelEnd.Y) then Exit;
-  Lock;
-  AddGroupedAction(eaIndentBlock);
-  ey:=selend.y;
-  if selend.x=0 then
-   dec(ey);
-  S:='';
-  { If AutoIndent try to align first line to
-    last line before selection }
-  { DISABLED created problems PM
-  if IsFlagSet(efAutoIndent) and (SelStart.Y>0) then
-    begin
-      i:=SelStart.Y-1;
-      while (S='') and (i>=0) do
-        begin
-          S:=GetDisplayText(i);
-          dec(i);
-        end;
-      if (S='') or (S[1]<>' ') then
-        Ind:=' '
-      else
-        begin
-          i:=1;
-          while (i<=Length(S)) and (S[i]=' ') do
-           inc(i);
-          indlen:=i;
-          S:=GetDisplayText(SelStart.Y);
-          i:=1;
-          while (i<=Length(S)) and (S[i]=' ') do
-            inc(i);
-          indlen:=indlen-i;
-          if indlen<=0 then
-            indlen:=1;
-          Ind:=CharStr(' ',indlen);
-        end;
-    end
-  else }
-   Ind:=' ';
-  for i:=selstart.y to ey do
-   begin
-     S:=GetLineText(i);
-     SetLineText(i,Ind+S);
-     Pos.X:=0;Pos.Y:=i;
-     AddAction(eaInsertText,Pos,Pos,Ind);
-   end;
-  SetCurPtr(CurPos.X,CurPos.Y);
-  { must be added manually here PM }
-  AddAction(eaMoveCursor,Pos,CurPos,'');
-  UpdateAttrsRange(SelStart.Y,SelEnd.Y,attrAll);
-  DrawLines(CurPos.Y);
-  SetModified(true);
-  CloseGroupedAction(eaIndentBlock);
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.UnindentBlock;
-var
-  ey,i,j,k,indlen : Sw_integer;
-  S : String;
-  Pos : TPoint;
-begin
-  if IsReadOnly then Exit;
-  if (SelStart.X=SelEnd.X) and (SelStart.Y=SelEnd.Y) then Exit;
-  Lock;
-  AddGroupedAction(eaUnindentBlock);
-  ey:=selend.y;
-  if selend.x=0 then
-   dec(ey);
-  { If AutoIndent try to align first line to
-    last line before selection }
-  { Disabled created problems
-  if IsFlagSet(efAutoIndent) and (SelStart.Y>0) then
-    begin
-      S:=GetDisplayText(SelStart.Y);
-      i:=1;
-      while (i<=Length(S)) and (S[i]=' ') do
-        inc(i);
-      indlen:=i-1;
-      i:=SelStart.Y-1;
-      S:='';
-      while (S='') and (i>=0) do
-        begin
-          if Trim(Copy(GetDisplayText(i),1,indlen))='' then
-            S:=''
-          else
-            S:=GetDisplayText(i);
-          dec(i);
-        end;
-      if (S='') then
-        Indlen:=1
-      else
-        begin
-          i:=1;
-          while (i<=Length(S)) and (S[i]=' ') do
-           inc(i);
-          indlen:=indlen-i+1;
-          if indlen<=0 then
-            indlen:=1;
-        end;
-    end
-  else }
-   Indlen:=1;
-  for i:=selstart.y to ey do
-   begin
-     S:=GetLineText(i);
-     k:=0;
-     for j:=1 to indlen do
-       if (length(s)>1) and (S[1]=' ') then
-         begin
-           Delete(s,1,1);
-           inc(k);
-         end;
-     SetLineText(i,S);
-     if k>0 then
-       begin
-         Pos.Y:=i;
-         Pos.X:=0;
-         AddAction(eaDeleteText,Pos,Pos,CharStr(' ',k));
-       end;
-   end;
-  SetCurPtr(CurPos.X,CurPos.Y);
-  UpdateAttrsRange(SelStart.Y,SelEnd.Y,attrAll);
-  DrawLines(CurPos.Y);
-  SetModified(true);
-  CloseGroupedAction(eaUnindentBlock);
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.SelectWord;
-const WordChars = ['A'..'Z','a'..'z','0'..'9','_'];
-var S : String;
-    StartPos,EndPos : byte;
-    A,B: TPoint;
-begin
-  A:=CurPos;
-  B:=CurPos;
-  S:=GetLineText(A.Y);
-  StartPos:=A.X+1;
-  EndPos:=StartPos;
-  if not (S[StartPos] in WordChars) then
-    exit
-  else
-    begin
-       While (StartPos>0) and (S[StartPos-1] in WordChars) do
-         Dec(StartPos);
-       While (EndPos<Length(S)) and (S[EndPos+1] in WordChars) do
-         Inc(EndPos);
-       A.X:=StartPos-1;
-       B.X:=EndPos;
-       SetSelection(A,B);
-    end;
-end;
-
-procedure TCustomCodeEditor.SelectLine;
-var A,B: TPoint;
-begin
-  if CurPos.Y<GetLineCount then
-    begin
-      A.Y:=CurPos.Y; A.X:=0;
-      B.Y:=CurPos.Y+1; B.X:=0;
-      SetSelection(A,B);
-    end;
-end;
-
-procedure TCustomCodeEditor.WriteBlock;
-var FileName: string;
-    S: PBufStream;
-begin
-  if ValidBlock=false then Exit;
-
-  FileName:='';
-  if EditorDialog(edWriteBlock, @FileName) <> cmCancel then
-  begin
-    FileName := FExpand(FileName);
-
-    New(S, Init(FileName, stCreate, 4096));
-    if (S=nil) or (S^.Status<>stOK) then
-      EditorDialog(edCreateError,@FileName)
-    else
-      if SaveAreaToStream(S,SelStart,SelEnd)=false then
-        EditorDialog(edWriteError,@FileName);
-    if Assigned(S) then Dispose(S, Done);
-  end;
-end;
-
-procedure TCustomCodeEditor.ReadBlock;
-var FileName: string;
-    S: PBufStream;
-    E: PCodeEditor;
-    R: TRect;
-begin
-  if IsReadOnly then Exit;
-  FileName:='';
-  if EditorDialog(edReadBlock, @FileName) <> cmCancel then
-  begin
-    FileName := FExpand(FileName);
-
-    New(S, Init(FileName, stOpenRead, 4096));
-    if (S=nil) or (S^.Status<>stOK) then
-      EditorDialog(edReadError,@FileName)
-    else
-      begin
-        R.Assign(0,0,0,0);
-        New(E, Init(R,nil,nil,nil,nil));
-        AddGroupedAction(eaReadBlock);
-        if E^.LoadFromStream(S)=false then
-          EditorDialog(edReadError,@FileName)
-        else
-          begin
-            E^.SelectAll(true);
-            Self.InsertFrom(E);
-          end;
-        CloseGroupedAction(eaReadBlock);
-        Dispose(E, Done);
-      end;
-    if Assigned(S) then Dispose(S, Done);
-  end;
-end;
-
-procedure TCustomCodeEditor.PrintBlock;
-begin
-  NotImplemented; Exit;
-end;
-
-procedure TCustomCodeEditor.ExpandCodeTemplate;
-var Line,ShortCut: string;
-    X,Y,I,LineIndent: sw_integer;
-    CodeLines: PUnsortedStringCollection;
-    CanJump: boolean;
-begin
-  {
-    The usage of editing primitives in this routine make it pretty slow, but
-    its speed is still acceptable and they make the implementation of Undo
-    much easier... - Gabor
-  }
-  if IsReadOnly then Exit;
-
-  Lock;
-
-  Line:=GetDisplayText(CurPos.Y);
-  X:=CurPos.X; ShortCut:='';
-  if X<=length(Line) then
-  while (X>0) and (Line[X] in (NumberChars+AlphaChars)) do
-  begin
-    ShortCut:=Line[X]+ShortCut;
-    Dec(X);
-  end;
-
-  if ShortCut<>'' then
-  begin
-    New(CodeLines, Init(10,10));
-    if TranslateCodeTemplate(ShortCut,CodeLines) then
-    begin
-      LineIndent:=X;
-      SetCurPtr(X,CurPos.Y);
-      for I:=1 to length(ShortCut) do
-        DelChar;
-      for Y:=0 to CodeLines^.Count-1 do
-      begin
-        CanJump:=false;
-        if Y>0 then
-          begin
-             CanJump:=Trim(GetLineText(CurPos.Y))='';
-             if CanJump=false then
-               begin
-                 for X:=1 to LineIndent do  { indent template lines to align }
-                   AddChar(' ');            { them to the first line         }
-               end
-             else
-              SetCurPtr(CurPos.X+LineIndent,CurPos.Y);
-          end;
-        Line:=CodeLines^.At(Y)^;
-        for X:=1 to length(Line) do
-          AddChar(Line[X]);
-        if Y<CodeLines^.Count-1 then
-          begin
-            InsertNewLine;               { line break }
-            if CanJump=false then
-              begin
-                while CurPos.X>0 do       { unindent }
-                begin
-                  SetCurPtr(CurPos.X-1,CurPos.Y);
-                  DelChar;
-                end;
-              end
-            else
-              SetCurPtr(0,CurPos.Y);
-          end;
-      end;
-    end;
-    Dispose(CodeLines, Done);
-  end;
-
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.AddChar(C: char);
-const OpenBrackets  : string[10] = '[({';
-      CloseBrackets : string[10] = '])}';
-var S,SC,TabS: string;
-    BI: byte;
-    CI,TabStart,LocTabSize : Sw_integer;
-    SP: TPoint;
-    HoldUndo : boolean;
-begin
-  if IsReadOnly then Exit;
-
-  Lock;
-  SP:=CurPos;
-  HoldUndo:=GetStoreUndo;
-  SetStoreUndo(false);
-  if (C<>TAB) or IsFlagSet(efUseTabCharacters) then
-    SC:=C
-  else
-    begin
-      LocTabSize:=GetTabSize - (CurPos.X mod GetTabSize);
-      if (CurPos.Y<=1) or not IsFlagSet(efAutoIndent) then
-        SC:=CharStr(' ',LocTabSize)
-      else
-        begin
-          S:=GetLineText(CurPos.Y-1);
-          BI:=CurPos.X+1;
-          while (BI<=Length(S)) and (S[BI]=' ') do
-            inc(BI);
-          if (BI=CurPos.X+1) or (BI>Length(S)) then
-            SC:=CharStr(' ',LocTabSize)
-          else
-            SC:=CharStr(' ',BI-CurPos.X-1);
-        end;
-    end;
-  S:=GetLineText(CurPos.Y);
-  if CharIdxToLinePos(CurPos.Y,length(S))<CurPos.X then
-    begin
-      S:=S+CharStr(' ',CurPos.X-CharIdxToLinePos(CurPos.Y,length(S)){-1});
-      SetLineText(CurPos.Y,S);
-    end;
-  CI:=LinePosToCharIdx(CurPos.Y,CurPos.X);
-  if (CI>0) and (S[CI]=TAB) then
-    begin
-      if CI=1 then
-        TabStart:=0
-      else
-        TabStart:=CharIdxToLinePos(CurPos.Y,CI-1)+1;
-      if SC=Tab then TabS:=Tab else
-        TabS:=CharStr(' ',CurPos.X-TabStart);
-      SetLineText(CurPos.Y,copy(S,1,CI-1)+TabS+SC+copy(S,CI+1,High(S)));
-      SetCurPtr(CharIdxToLinePos(CurPos.Y,CI+length(TabS)+length(SC)),CurPos.Y);
-    end
-  else
-    begin
-      if Overwrite and (CI<=length(S)) then
-        SetLineText(CurPos.Y,copy(S,1,CI-1)+SC+copy(S,CI+length(SC),High(S)))
-      else
-        SetLineText(CurPos.Y,copy(S,1,CI-1)+SC+copy(S,CI,High(S)));
-      SetCurPtr(CharIdxToLinePos(CurPos.Y,CI+length(SC)),CurPos.Y);
-    end;
-{$ifdef Undo}
- { must be before CloseBrackets !! }
-  SetStoreUndo(HoldUndo);
-  Addaction(eaInsertText,SP,CurPos,C);
-  SetStoreUndo(false);
-{$endif Undo}
-  if IsFlagSet(efAutoBrackets) then
-    begin
-      BI:=Pos(C,OpenBrackets);
-      if (BI>0) then
-        begin
-          SetStoreUndo(HoldUndo);
-          AddChar(CloseBrackets[BI]);
-          SetStoreUndo(false);
-          SetCurPtr(CurPos.X-1,CurPos.Y);
-        end;
-    end;
-  UpdateAttrs(CurPos.Y,attrAll);
-  if GetInsertMode then
-    AdjustSelection(CurPos.X-SP.X,CurPos.Y-SP.Y);
-  DrawLines(CurPos.Y);
-  SetStoreUndo(HoldUndo);
-  SetModified(true);
-  UnLock;
-end;
-
-{$ifdef WinClipSupported}
-function TCustomCodeEditor.ClipPasteWin: Boolean;
-var OK: boolean;
-    l,i : longint;
-    p,p10,p2,p13 : pchar;
-    s : string;
-    BPos,EPos,StorePos : TPoint;
-    first : boolean;
-begin
-  Lock;
-  OK:=WinClipboardSupported;
-  if OK then
-    begin
-      first:=true;
-      StorePos:=CurPos;
-      i:=CurPos.Y;
-      l:=GetTextWinClipboardSize;
-      if l=0 then
-        OK:=false
-      else
-        OK:=GetTextWinClipBoardData(p,l);
-      if OK then
-        begin
-          AddGroupedAction(eaPasteWin);
-          p2:=p;
-          p13:=strpos(p,#13);
-          p10:=strpos(p,#10);
-          while assigned(p10) do
-            begin
-              if p13+1=p10 then
-                p13[0]:=#0
-              else
-                p10[0]:=#0;
-              s:=strpas(p2);
-              if first then
-                begin
-                  { we need to cut the line in two
-                    if not at end of line PM }
-                  InsertNewLine;
-                  SetCurPtr(StorePos.X,StorePos.Y);
-                  InsertText(s);
-                  first:=false;
-                end
-              else
-                begin
-                  Inc(i);
-                  InsertLine(i,s);
-                  BPos.X:=0;BPos.Y:=i;
-                  EPOS.X:=Length(s);EPos.Y:=i;
-                  AddAction(eaInsertLine,BPos,EPos,S);
-                end;
-              if p13+1=p10 then
-                p13[0]:=#13
-              else
-                p10[0]:=#10;
-              p2:=@p10[1];
-              p13:=strpos(p2,#13);
-              p10:=strpos(p2,#10);
-            end;
-          if strlen(p2)>0 then
-            begin
-              s:=strpas(p2);
-              if not first then
-                SetCurPtr(0,i+1);
-              InsertText(s);
-            end;
-          SetCurPtr(StorePos.X,StorePos.Y);
-          SetModified(true);
-          UpdateAttrs(StorePos.Y,attrAll);
-          CloseGroupedAction(eaPasteWin);
-          Update;
-          { we must free the allocated memory }
-          freemem(p,l);
-        end;
-    end;
-  ClipPasteWin:=OK;
-  UnLock;
-end;
-
-function TCustomCodeEditor.ClipCopyWin: Boolean;
-var OK: boolean;
-    p,p2 : pchar;
-    s : string;
-    i,str_begin,str_end,NumLines,PcLength : longint;
-begin
-  NumLines:=SelEnd.Y-SelStart.Y;
-  if (NumLines>0) or (SelEnd.X>SelStart.X) then
-    Inc(NumLines);
-  if NumLines=0 then
-    exit;
-  Lock;
-  { First calculate needed size }
-  { for newlines first + 1 for terminal #0 }
-  PcLength:=Length(EOL)*(NumLines-1)+1;
-
-  { overestimated but can not be that big PM }
-  for i:=SelStart.Y to SelEnd.Y do
-    PCLength:=PCLength+Length(GetLineText(i));
-  getmem(p,PCLength);
-  i:=SelStart.Y;
-  s:=GetLineText(i);
-  str_begin:=LinePosToCharIdx(i,SelStart.X);
-  if SelEnd.Y>SelStart.Y then
-    str_end:=High(S)
-  else
-    str_end:=LinePosToCharIdx(i,SelEnd.X)-1;
-  s:=copy(s,str_begin,str_end-str_begin+1);
-  strpcopy(p,s);
-  p2:=strend(p);
-  inc(i);
-  while i<SelEnd.Y do
-    begin
-      strpcopy(p2,EOL+GetLineText(i));
-      p2:=strend(p2);
-      Inc(i);
-    end;
-  if SelEnd.Y>SelStart.Y then
-    begin
-      s:=copy(GetLineText(i),1,LinePosToCharIdx(i,SelEnd.X)-1);
-      strpcopy(p2,EOL+s);
-    end;
-  OK:=WinClipboardSupported;
-  if OK then
-    begin
-      OK:=SetTextWinClipBoardData(p,strlen(p));
-    end;
-  ClipCopyWin:=OK;
-  Freemem(p,PCLength);
-  UnLock;
-end;
-{$endif WinClipSupported}
-
-function TCustomCodeEditor.ClipCopy: Boolean;
-var OK: boolean;
-begin
-  Lock;
-  {AddGroupedAction(eaCopy);
-   can we undo a copy ??
-   maybe as an Undo Paste in Clipboard !! }
-  OK:=Clipboard<>nil;
-  if OK then OK:=Clipboard^.InsertFrom(@Self);
-  ClipCopy:=OK;
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.ClipCut;
-begin
-  if IsReadOnly then Exit;
-  Lock;
-  AddGroupedAction(eaCut);
-  DontConsiderShiftState:=true;
-  if Clipboard<>nil then
-   if Clipboard^.InsertFrom(@Self) then
-    begin
-      if not IsClipBoard then
-       DelSelect;
-      SetModified(true);
-    end;
-  CloseGroupedAction(eaCut);
-  UnLock;
-  DontConsiderShiftState:=false;
-end;
-
-procedure TCustomCodeEditor.ClipPaste;
-begin
-  if IsReadOnly then Exit;
-  DontConsiderShiftState:=true;
-  Lock;
-  AddGroupedAction(eaPaste);
-  if Clipboard<>nil then
-   begin
-     InsertFrom(Clipboard);
-     SetModified(true);
-   end;
-  CloseGroupedAction(eaPaste);
-  UnLock;
-  DontConsiderShiftState:=false;
-end;
-
-procedure TCustomCodeEditor.Undo;
-begin
-  NotImplemented; Exit;
-end;
-
-procedure TCustomCodeEditor.Redo;
-begin
-  NotImplemented; Exit;
-end;
-
-procedure TCustomCodeEditor.GotoLine;
-var
-  GotoRec: TGotoLineDialogRec;
-begin
-  with GotoRec do
-  begin
-    LineNo:='1';
-    Lines:=GetLineCount;
-    if EditorDialog(edGotoLine, @GotoRec) <> cmCancel then
-    begin
-      SetCurPtr(0,StrToInt(LineNo)-1);
-      TrackCursor(true);
-    end;
-  end;
-end;
-
-procedure TCustomCodeEditor.Find;
-var
-  FindRec: TFindDialogRec;
-  DoConf: boolean;
-begin
-  with FindRec do
-  begin
-    Find := FindStr;
-    if GetCurrentWord<>'' then
-      Find:=GetCurrentWord;
-    Options := (FindFlags and ffmOptions) shr ffsOptions;
-    Direction := (FindFlags and ffmDirection) shr ffsDirection;
-    Scope := (FindFlags and ffmScope) shr ffsScope;
-    Origin := (FindFlags and ffmOrigin) shr ffsOrigin;
-    DoConf:= (FindFlags and ffPromptOnReplace)<>0;
-    if EditorDialog(edFind, @FindRec) <> cmCancel then
-    begin
-      FindStr := Find;
-      FindFlags := (Options shl ffsOptions) or (Direction shl ffsDirection) or
-         (Scope shl ffsScope) or (Origin shl ffsOrigin);
-      FindFlags := FindFlags and not ffDoReplace;
-      if DoConf then
-   FindFlags := (FindFlags or ffPromptOnReplace);
-      SearchRunCount:=0;
-      DoSearchReplace;
-    end;
-  end;
-end;
-
-procedure TCustomCodeEditor.Replace;
-var
-  ReplaceRec: TReplaceDialogRec;
-  Re: word;
-begin
-  if IsReadOnly then Exit;
-  with ReplaceRec do
-  begin
-    Find := FindStr;
-    if GetCurrentWord<>'' then
-      Find:=GetCurrentWord;
-    Replace := ReplaceStr;
-    Options := (FindFlags and ffmOptions) shr ffsOptions;
-    Direction := (FindFlags and ffmDirection) shr ffsDirection;
-    Scope := (FindFlags and ffmScope) shr ffsScope;
-    Origin := (FindFlags and ffmOrigin) shr ffsOrigin;
-    Re:=EditorDialog(edReplace, @ReplaceRec);
-    if Re <> cmCancel then
-    begin
-      FindStr := Find;
-      ReplaceStr := Replace;
-      FindFlags := (Options shl ffsOptions) or (Direction shl ffsDirection) or
-         (Scope shl ffsScope) or (Origin shl ffsOrigin);
-      FindFlags := FindFlags or ffDoReplace;
-      if Re = cmYes then
-        FindFlags := FindFlags or ffReplaceAll;
-      SearchRunCount:=0;
-      DoSearchReplace;
-    end;
-  end;
-end;
-
-procedure TCustomCodeEditor.DoSearchReplace;
-var S: string;
-    DX,DY,P,Y,X: sw_integer;
-    Count: sw_integer;
-    Found,CanExit: boolean;
-    SForward,DoReplace,DoReplaceAll: boolean;
-    LeftOK,RightOK: boolean;
-    FoundCount: sw_integer;
-    A,B: TPoint;
-    AreaStart,AreaEnd: TPoint;
-    CanReplace,Confirm: boolean;
-    Re: word;
-    IFindStr : string;
-    BT : BTable;
-
-  function ContainsText(const SubS:string;var S: string; Start: Sw_word): Sw_integer;
-  var
-    P: Sw_Integer;
-  begin
-    if Start<=0 then
-     P:=0
-    else
-     begin
-       if SForward then
-        begin
-          if Start>length(s) then
-           P:=0
-          else if FindFlags and ffCaseSensitive<>0 then
-           P:=BMFScan(S[Start],length(s)+1-Start,FindStr,Bt)+1
-          else
-           P:=BMFIScan(S[Start],length(s)+1-Start,IFindStr,Bt)+1;
-          if P>0 then
-           Inc(P,Start-1);
-        end
-       else
-        begin
-          if start>length(s) then
-           start:=length(s);
-          if FindFlags and ffCaseSensitive<>0 then
-           P:=BMBScan(S[1],Start,FindStr,Bt)+1
-          else
-           P:=BMBIScan(S[1],Start,IFindStr,Bt)+1;
-        end;
-     end;
-    ContainsText:=P;
-  end;
-
-  function InArea(X,Y: sw_integer): boolean;
-  begin
-    InArea:=((AreaStart.Y=Y) and (AreaStart.X<=X)) or
-       ((AreaStart.Y<Y) and (Y<AreaEnd.Y)) or
-       ((AreaEnd.Y=Y) and (X<=AreaEnd.X));
-  end;
-var CurDY: sw_integer;
-begin
-  Inc(SearchRunCount);
-
-  SForward:=(FindFlags and ffmDirection)=ffForward;
-  DoReplace:=(FindFlags and ffDoReplace)<>0;
-  Confirm:=(FindFlags and ffPromptOnReplace)<>0;
-  DoReplaceAll:=(FindFlags and ffReplaceAll)<>0;
-  Count:=GetLineCount; FoundCount:=0;
-
-  if SForward then
-    DY:=1
-  else
-    DY:=-1;
-  DX:=DY;
-
-  if (FindFlags and ffmScope)=ffGlobal then
-   begin
-     AreaStart.X:=0;
-     AreaStart.Y:=0;
-     AreaEnd.X:=length(GetDisplayText(Count-1));
-     AreaEnd.Y:=Count-1;
-   end
-  else
-   begin
-     AreaStart:=SelStart;
-     AreaEnd:=SelEnd;
-   end;
-
-  X:=CurPos.X-DX;
-  Y:=CurPos.Y;;
-  if SearchRunCount=1 then
-    if (FindFlags and ffmOrigin)=ffEntireScope then
-      if SForward then
-        begin
-          X:=AreaStart.X-1;
-          Y:=AreaStart.Y;
-        end
-       else
-        begin
-          X:=AreaEnd.X+1;
-          Y:=AreaEnd.Y;
-        end;
-
-  if FindFlags and ffCaseSensitive<>0 then
-   begin
-     if SForward then
-      BMFMakeTable(FindStr,bt)
-     else
-      BMBMakeTable(FindStr,bt);
-   end
-  else
-   begin
-     IFindStr:=Upper(FindStr);
-     if SForward then
-      BMFMakeTable(IFindStr,bt)
-     else
-      BMBMakeTable(IFindStr,bt);
-   end;
-
-  inc(X,DX);
-  CanExit:=false;
-  if (DoReplace=false) or ((Confirm=false) and (Owner<>nil)) then
-    Owner^.Lock;
-  if InArea(X,Y) then
-  repeat
-    CurDY:=DY;
-    S:=GetDisplayText(Y);
-    P:=ContainsText(FindStr,S,X+1);
-    Found:=P<>0;
-    if Found then
-      begin
-        A.X:=P-1;
-        A.Y:=Y;
-        B.Y:=Y;
-        B.X:=A.X+length(FindStr);
-      end;
-    Found:=Found and InArea(A.X,A.Y);
-
-    if Found and ((FindFlags and ffWholeWordsOnly)<>0) then
-     begin
-       LeftOK:=(A.X<=0) or (not( (S[A.X] in AlphaChars) or (S[A.X] in NumberChars) ));
-       RightOK:=(B.X>=length(S)) or (not( (S[B.X+1] in AlphaChars) or (S[B.X+1] in NumberChars) ));
-       Found:=LeftOK and RightOK;
-       if Found=false then
-         begin
-           CurDY:=0;
-           X:=B.X+1;
-         end;
-     end;
-
-    if Found then
-      Inc(FoundCount);
-
-    if Found then
-      begin
-        Lock;
-        if SForward then
-         SetCurPtr(B.X,B.Y)
-        else
-         SetCurPtr(A.X,A.Y);
-        TrackCursor(true);
-        SetHighlight(A,B);
-        UnLock;
-        CurDY:=0;
-        if (DoReplace=false) then
-          begin
-            CanExit:=true;
-            If SForward then
-              begin
-                X:=B.X;
-                Y:=B.Y;
-              end
-            else
-              begin
-                X:=A.X;
-                Y:=A.Y;
-              end;
-          end
-        else
-          begin
-            if Confirm=false then CanReplace:=true else
-              begin
-                Re:=EditorDialog(edReplacePrompt,@CurPos);
-                case Re of
-                  cmYes :
-                    CanReplace:=true;
-                  cmNo :
-                    CanReplace:=false;
-                  else {cmCancel}
-                    begin
-                      CanReplace:=false;
-                      CanExit:=true;
-                    end;
-                end;
-              end;
-            if CanReplace then
-              begin
-                Lock;
-                SetSelection(A,B);
-                DelSelect;
-                InsertText(ReplaceStr);
-                if SForward then
-                  begin
-                    X:=CurPos.X;
-                    Y:=CurPos.Y;
-                  end
-                else
-                  begin
-                    X:=A.X;
-                    Y:=A.Y;
-                  end;
-                UnLock;
-              end
-            else
-              begin
-                If SForward then
-                  begin
-                    X:=B.X;
-                    Y:=B.Y;
-                  end
-                else
-                  begin
-                    X:=A.X;
-                    Y:=A.Y;
-                  end;
-              end;
-            if (DoReplaceAll=false) then
-              CanExit:=true;
-          end;
-      end;
-
-    if (CanExit=false) and (CurDY<>0) then
-      begin
-        inc(Y,CurDY);
-        if SForward then
-          X:=0
-        else
-          X:=254;
-        CanExit:=(Y>=Count) or (Y<0);
-      end;
-    if not CanExit then
-      CanExit:=not InArea(X,Y);
-  until CanExit;
-  if (FoundCount=0) or (DoReplace) then
-    SetHighlight(CurPos,CurPos);
-  if (DoReplace=false) or ((Confirm=false) and (Owner<>nil)) then
-    Owner^.UnLock;
-  {if (DoReplace=false) or (Confirm=false) then
-    UnLock;}
-  if (FoundCount=0) then
-    EditorDialog(edSearchFailed,nil);
-  if (FindFlags and ffmScope)=ffSelectedText then
-    { restore selection PM }
-    begin
-      SetSelection(AreaStart,AreaEnd);
-    end;
-end;
-
-function TCustomCodeEditor.GetInsertMode: boolean;
-begin
-  GetInsertMode:=(GetFlags and efInsertMode)<>0;
-end;
-
-procedure TCustomCodeEditor.SetInsertMode(InsertMode: boolean);
-begin
-  if InsertMode then
-    SetFlags(GetFlags or efInsertMode)
-  else
-    SetFlags(GetFlags and (not efInsertMode));
-  DrawCursor;
-end;
-
-{ there is a problem with ShiftDel here
-  because GetShitState tells to extend the
-  selection which gives wrong results (PM) }
-
-function TCustomCodeEditor.ShouldExtend: boolean;
-var ShiftInEvent: boolean;
-begin
-  ShiftInEvent:=false;
-  if Assigned(CurEvent) then
-    if CurEvent^.What=evKeyDown then
-      ShiftInEvent:=((CurEvent^.KeyShift and kbShift)<>0);
-  ShouldExtend:=ShiftInEvent and
-    not DontConsiderShiftState;
-end;
-
-procedure TCustomCodeEditor.SetCurPtr(X,Y: sw_integer);
-var OldPos{,OldSEnd,OldSStart}: TPoint;
-    Extended: boolean;
-    F: PFold;
-begin
-  Lock;
-  X:=Max(0,Min(MaxLineLength+1,X));
-  Y:=Max(0,Min(GetLineCount-1,Y));
-  OldPos:=CurPos;
-{  OldSEnd:=SelEnd;
-  OldSStart:=SelStart;}
-  CurPos.X:=X;
-  CurPos.Y:=Y;
-  TrackCursor(false);
-  if not IsLineVisible(CurPos.Y) then
-  begin
-    F:=GetLineFold(CurPos.Y);
-    if Assigned(F) then
-      F^.Collapse(false);
-  end;
-  if (NoSelect=false) and (ShouldExtend) then
-  begin
-    CheckSels;
-    Extended:=false;
-    if PointOfs(OldPos)=PointOfs(SelStart) then
-      begin SetSelection(CurPos,SelEnd); Extended:=true; end;
-    CheckSels;
-    if Extended=false then
-     if PointOfs(OldPos)=PointOfs(SelEnd) then
-       begin
-         if ValidBlock=false then
-           SetSelection(CurPos,CurPos);
-         SetSelection(SelStart,CurPos); Extended:=true;
-       end;
-    CheckSels;
-    if (Extended=false) then
-       if PointOfs(OldPos)<=PointOfs(CurPos)
-     then begin SetSelection(OldPos,CurPos); Extended:=true; end
-     else begin SetSelection(CurPos,OldPos); Extended:=true; end;
-    DrawView;
-  end else
-   if not IsFlagSet(efPersistentBlocks) then
-      begin HideSelect; DrawView; end;
-{  if PointOfs(SelStart)=PointOfs(SelEnd) then
-     SetSelection(CurPos,CurPos);}
-  if (GetFlags and (efHighlightColumn+efHighlightRow))<>0 then
-     DrawView;
-  if ((CurPos.X<>OldPos.X) or (CurPos.Y<>OldPos.Y)) and
-     ((Highlight.A.X<>HighLight.B.X) or (Highlight.A.Y<>HighLight.B.Y)) then
-     HideHighlight;
-  if (OldPos.Y<>CurPos.Y) and (0<=OldPos.Y) and (OldPos.Y<GetLineCount) then
-     SetLineText(OldPos.Y,RTrim(GetLineText(OldPos.Y),not IsFlagSet(efUseTabCharacters)));
-  if ((CurPos.X<>OldPos.X) or (CurPos.Y<>OldPos.Y)) and (GetErrorMessage<>'') then
-    SetErrorMessage('');
-{  if ((CurPos.X<>OldPos.X) or (CurPos.Y<>OldPos.Y)) and (HighlightRow<>-1) then
-    SetHighlightRow(-1);}
-  if ((CurPos.X<>OldPos.X) or (CurPos.Y<>OldPos.Y)) then
-    AddAction(eaMoveCursor,OldPos,CurPos,'');
-  if ((CurPos.X<>OldPos.X) or (CurPos.Y<>OldPos.Y)) then
-    PositionChanged;{UpdateIndicator;}
-  UnLock;
-end;
-
-procedure TCustomCodeEditor.CheckSels;
-begin
-  if (SelStart.Y>SelEnd.Y) or
-     ( (SelStart.Y=SelEnd.Y) and (SelStart.X>SelEnd.X) ) then
-       SetSelection(SelEnd,SelStart);
-end;
-
-procedure TCustomCodeEditor.CodeCompleteApply;
-var S: string;
-    I: integer;
-begin
-  Lock;
-
-  { here should be some kind or "mark" or "break" inserted in the Undo
-    information, so activating it "undoes" only the completition first and
-    doesn't delete the complete word at once... - Gabor }
-
-  S:=GetCodeCompleteFrag;
-  SetCurPtr(CurPos.X-length(S),CurPos.Y);
-  for I:=1 to length(S) do
-    DelChar;
-  S:=GetCodeCompleteWord;
-  for I:=1 to length(S) do
-    AddChar(S[I]);
-
-  UnLock;
-  SetCompleteState(csInactive);
-end;
-
-procedure TCustomCodeEditor.CodeCompleteCancel;
-begin
-  SetCompleteState(csDenied);
-end;
-
-procedure TCustomCodeEditor.CodeCompleteCheck;
-var Line: string;
-    X: sw_integer;
-    CurWord,NewWord: string;
-begin
-  SetCodeCompleteFrag('');
-  if (not IsFlagSet(efCodeComplete)) or (IsReadOnly=true) then Exit;
-
-  Lock;
-
-  Line:=GetDisplayText(CurPos.Y);
-  X:=CurPos.X; CurWord:='';
-  if X<=length(Line) then
-  while (X>0) and (Line[X] in (NumberChars+AlphaChars)) do
-  begin
-    CurWord:=Line[X]+CurWord;
-    Dec(X);
-  end;
-
-  if (length(CurWord)>=CodeCompleteMinLen) and CompleteCodeWord(CurWord,NewWord) then
-    begin
-      SetCodeCompleteFrag(CurWord);
-      SetCodeCompleteWord(NewWord);
-    end
-  else
-    ClearCodeCompleteWord;
-
-  UnLock;
-end;
-
-function TCustomCodeEditor.GetCodeCompleteFrag: string;
-begin
-  { Abstract }
-  GetCodeCompleteFrag:='';
-end;
-
-procedure TCustomCodeEditor.SetCodeCompleteFrag(const S: string);
-begin
-  { Abstract }
-end;
-
-procedure TCustomCodeEditor.DrawLines(FirstLine: sw_integer);
-begin
-  if FirstLine>=(Delta.Y+Size.Y) then Exit; { falls outside of the screen }
-  DrawView;
-end;
-
-procedure TCustomCodeEditor.HideHighlight;
-begin
-  SetHighlight(CurPos,CurPos);
-end;
-
-procedure TCustomCodeEditor.GetSelectionArea(var StartP,EndP: TPoint);
-begin
-  StartP:=SelStart; EndP:=SelEnd;
-  if EndP.X=0 then
-    begin
-      Dec(EndP.Y);
-      EndP.X:=length(GetDisplayText(EndP.Y))-1;
-    end
-  else
-   Dec(EndP.X);
-end;
-
-function TCustomCodeEditor.ValidBlock: boolean;
-begin
-  ValidBlock:=(SelStart.X<>SelEnd.X) or (SelStart.Y<>SelEnd.Y);
-end;
-
-procedure TCustomCodeEditor.SetSelection(A, B: TPoint);
-var WV: boolean;
-    OS,OE: TPoint;
-begin
-  WV:=ValidBlock;
-  OS:=SelStart; OE:=SelEnd;
-  SelStart:=A; SelEnd:=B;
-  if (WV=false) and (ValidBlock=false) then { do nothing } else
-    if (OS.X<>SelStart.X) or (OS.Y<>SelStart.Y) or
-       (OE.X<>SelEnd.X) or (OE.Y<>SelEnd.Y) then
-     SelectionChanged;
-end;
-
-procedure TCustomCodeEditor.SetHighlight(A, B: TPoint);
-begin
-  Highlight.A:=A; Highlight.B:=B;
-  HighlightChanged;
-end;
-
-{procedure TCustomCodeEditor.SetHighlightRow(Row: sw_integer);
-begin
-  HighlightRow:=Row;
-  DrawView;
-end;}
-
-{procedure TCodeEditor.SetDebuggerRow(Row: sw_integer);
-begin
-  DebuggerRow:=Row;
-  DrawView;
-end;}
-
-procedure TCustomCodeEditor.SelectAll(Enable: boolean);
-var A,B: TPoint;
-begin
-  if (Enable=false) or (GetLineCount=0) then
-     begin A:=CurPos; B:=CurPos end
-  else
-     begin
-       A.X:=0; A.Y:=0;
-{       B.Y:=GetLineCount-1;
-       B.X:=length(GetLineText(B.Y));}
-       B.Y:=GetLineCount; B.X:=0;
-     end;
-  SetSelection(A,B);
-  DrawView;
-end;
-
-procedure TCustomCodeEditor.SelectionChanged;
-var Enable,CanPaste: boolean;
-begin
-  if GetLineCount=0 then
-    begin
-      SelStart.X:=0; SelStart.Y:=0; SelEnd:=SelStart;
-    end
-  else
-    if SelEnd.Y>GetLineCount-1 then
-     if (SelEnd.Y<>GetLineCount) or (SelEnd.X<>0) then
-      begin
-        SelEnd.Y:=GetLineCount-1;
-        SelEnd.X:=length(GetDisplayText(SelEnd.Y));
-      end;
-
-  Enable:=((SelStart.X<>SelEnd.X) or (SelStart.Y<>SelEnd.Y)) and (Clipboard<>nil);
-  SetCmdState(ToClipCmds,Enable and (Clipboard<>@Self));
-  SetCmdState(NulClipCmds,Enable);
-  CanPaste:=(Clipboard<>nil) and ((Clipboard^.SelStart.X<>Clipboard^.SelEnd.X) or
-       (Clipboard^.SelStart.Y<>Clipboard^.SelEnd.Y));
-  SetCmdState(FromClipCmds,CanPaste  and (Clipboard<>@Self));
-{$ifdef WinClipSupported}
-  SetCmdState(FromWinClipCmds,GetTextWinClipboardSize>0);
-{$endif WinClipSupported}
-  SetCmdState(UndoCmd,(GetUndoActionCount>0));
-  SetCmdState(RedoCmd,(GetRedoActionCount>0));
-  Message(Application,evBroadcast,cmCommandSetChanged,nil);
-  DrawView;
-end;
-
-procedure TCustomCodeEditor.HighlightChanged;
-begin
-  DrawView;
-end;
-
-procedure TCustomCodeEditor.SetState(AState: Word; Enable: Boolean);
-  procedure ShowSBar(SBar: PScrollBar);
-  begin
-    if Assigned(SBar) and (SBar^.GetState(sfVisible)=false) then
-        SBar^.Show;
-  end;
-begin
-  inherited SetState(AState,Enable);
-
-  if AlwaysShowScrollBars then
-   begin
-     ShowSBar(HScrollBar);
-     ShowSBar(VScrollBar);
-   end;
-
-  if (AState and (sfActive+sfSelected+sfFocused))<>0 then
-    begin
-      SelectionChanged;
-      if ((State and sfFocused)=0) and (GetCompleteState=csOffering) then
-        ClearCodeCompleteWord;
-    end;
-end;
-
-function TCustomCodeEditor.GetPalette: PPalette;
-const P: string[length(CEditor)] = CEditor;
-begin
-  GetPalette:=@P;
-end;
-
-function TCustomCodeEditorCore.LoadFromStream(Editor: PCustomCodeEditor; Stream: PStream): boolean;
-var S: string;
-    AllLinesComplete,LineComplete,hasCR,OK: boolean;
-begin
-  DeleteAllLines;
-  ChangedLine:=-1;
-  AllLinesComplete:=true;
-  OK:=(Stream^.Status=stOK);
-  if eofstream(Stream) then
-   AddLine('')
-  else
-   begin
-     while OK and (eofstream(Stream)=false) and (GetLineCount<MaxLineCount) do
-       begin
-         ReadlnFromStream(Stream,S,LineComplete,hasCR);
-         AllLinesComplete:=AllLinesComplete and LineComplete;
-         OK:=OK and (Stream^.Status=stOK);
-         if OK then AddLine(S);
-         if not LineComplete and (ChangedLine=-1) then
-           ChangedLine:=GetLineCount;
-       end;
-     { Do not remove the final newline if it exists PM }
-     if hasCR then
-       AddLine('');
-    end;
-  LimitsChanged;
-  if not AllLinesComplete then
-    SetModified(true);
-  if (GetLineCount=MaxLineCount) and not eofstream(stream) then
-    EditorDialog(edTooManyLines,nil);
-  LoadFromStream:=OK;
-end;
-
-function TCustomCodeEditorCore.SaveAreaToStream(Editor: PCustomCodeEditor; Stream: PStream; StartP,EndP: TPoint): boolean;
-var S: string;
-    OK: boolean;
-    Line: Sw_integer;
-begin
-  if EndP.X=0 then
-    begin
-      if EndP.Y>0 then
-        begin
-          EndP.X:=length(GetDisplayText(EndP.Y));
-        end
-      else
-        EndP.X:=0;
-    end
-  else
-    Dec(EndP.X);
-  OK:=(Stream^.Status=stOK); Line:=StartP.Y;
-  while OK and (Line<=EndP.Y) and (Line<GetLineCount) do
-  begin
-    S:=GetLineText(Line);
-    { Remove all traling spaces PM }
-    if not Editor^.IsFlagSet(efKeepTrailingSpaces) then
-      While (Length(S)>0) and (S[Length(S)]=' ') do
-       Dec(S[0]);
-    { if FlagSet(efUseTabCharacters) then
-      S:=CompressUsingTabs(S,TabSize);
-      }
-    if Line=EndP.Y then S:=copy(S,1,LinePosToCharIdx(Line,EndP.X));
-    if Line=StartP.Y then S:=copy(S,LinePosToCharIdx(Line,StartP.X),High(S));
-    Stream^.Write(S[1],length(S));
-    if Line<EndP.Y then
-      Stream^.Write(EOL[1],length(EOL));
-    Inc(Line);
-    OK:=OK and (Stream^.Status=stOK);
-  end;
-  SaveAreaToStream:=OK;
-end;
-
-{$ifdef Undo}
-
-constructor TEditorAction.init(act:byte; StartP,EndP:TPoint;Txt:String);
-begin
-  Action:=act;
-  StartPos:=StartP;
-  EndPos:=EndP;
-  Text:=NewStr(txt);
-  ActionCount:=0;
-end;
-
-constructor TEditorAction.init_group(act:byte);
-begin
-  Action:=act;
-  ActionCount:=0;
-end;
-
-function TEditorAction.Is_grouped_action : boolean;
-begin
-  Is_grouped_action:=Action in [eaCut,eaPaste,eaPasteWin,eaClear,
-                                eaCopyBlock,eaMoveBlock,eaDelBlock,
-                                eaIndentBlock,eaUnindentBlock,eaReadBlock];
-end;
-
-destructor TEditorAction.done;
-begin
-  DisposeStr(Text);
-end;
-
-{$else}
-procedure TEditorActionCollection.FreeItem(Item: Pointer);
-begin
-  if assigned(Item) then
-    freemem(Item,Sizeof(TEditorAction));
-end;
-{$endif Undo}
-
-function TEditorActionCollection.At(Idx : sw_integer) : PEditorAction;
-begin
-  At:=PEditorAction(Inherited At(Idx));
-end;
-
-function CreateFindDialog: PDialog;
-var R,R1,R2: TRect;
-    D: PDialog;
-    IL1: PInputLine;
-    Control : PView;
-    CB1: PCheckBoxes;
-    RB1,RB2,RB3: PRadioButtons;
-begin
-  R.Assign(0,0,56,15);
-  New(D, Init(R, dialog_find));
-  with D^ do
-  begin
-    Options:=Options or ofCentered;
-    GetExtent(R); R.Grow(-3,-2);
-    R1.Copy(R); R1.B.X:=17; R1.B.Y:=R1.A.Y+1;
-    R2.Copy(R); R2.B.X:=R2.B.X-3;R2.A.X:=17; R2.B.Y:=R2.A.Y+1;
-    New(IL1, Init(R2, FindStrSize));
-    IL1^.Data^:=FindStr;
-    Insert(IL1);
-    Insert(New(PLabel, Init(R1, label_find_texttofind, IL1)));
-    R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
-    Control := New(PHistory, Init(R1, IL1, TextFindId));
-    Insert(Control);
-
-    R1.Copy(R); Inc(R1.A.Y,2); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
-    R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
-    New(CB1, Init(R2,
-      NewSItem(label_find_casesensitive,
-      NewSItem(label_find_wholewordsonly,
-      nil))));
-    Insert(CB1);
-    Insert(New(PLabel, Init(R1, label_find_options, CB1)));
-
-    R1.Copy(R); Inc(R1.A.Y,2); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
-    R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
-    New(RB1, Init(R2,
-      NewSItem(label_find_forward,
-      NewSItem(label_find_backward,
-      nil))));
-    Insert(RB1);
-    Insert(New(PLabel, Init(R1, label_find_direction, RB1)));
-
-    R1.Copy(R); Inc(R1.A.Y,6); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
-    R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
-    New(RB2, Init(R2,
-      NewSItem(label_find_global,
-      NewSItem(label_find_selectedtext,
-      nil))));
-    Insert(RB2);
-    Insert(New(PLabel, Init(R1, label_find_scope, RB2)));
-
-    R1.Copy(R); Inc(R1.A.Y,6); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
-    R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
-    New(RB3, Init(R2,
-      NewSItem(label_find_fromcursor,
-      NewSItem(label_find_entirescope,
-      nil))));
-    Insert(RB3);
-    Insert(New(PLabel, Init(R1, label_find_origin, RB3)));
-
-    GetExtent(R); R.Grow(-13,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10;
-    Insert(New(PButton, Init(R, btn_OK, cmOK, bfDefault)));
-    R.Move(19,0);
-    Insert(New(PButton, Init(R, btn_Cancel, cmCancel, bfNormal)));
-  end;
-  IL1^.Select;
-  CreateFindDialog := D;
-end;
-
-function CreateReplaceDialog: PDialog;
-var R,R1,R2: TRect;
-    D: PDialog;
-    Control : PView;
-    IL1,IL2: PInputLine;
-    CB1: PCheckBoxes;
-    RB1,RB2,RB3: PRadioButtons;
-begin
-  R.Assign(0,0,56,18);
-  New(D, Init(R, dialog_replace));
-  with D^ do
-  begin
-    Options:=Options or ofCentered;
-    GetExtent(R); R.Grow(-3,-2);
-    R1.Copy(R); R1.B.X:=17; R1.B.Y:=R1.A.Y+1;
-    R2.Copy(R); R2.B.X:=R2.B.X-3;R2.A.X:=17; R2.B.Y:=R2.A.Y+1;
-    New(IL1, Init(R2, FindStrSize));
-    IL1^.Data^:=FindStr;
-    Insert(IL1);
-    Insert(New(PLabel, Init(R1, label_replace_texttofind, IL1)));
-    R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
-    Control := New(PHistory, Init(R1, IL1, TextFindId));
-    Insert(Control);
-
-    R1.Copy(R); R1.Move(0,2); R1.B.X:=17; R1.B.Y:=R1.A.Y+1;
-    R2.Copy(R); R2.Move(0,2);R2.B.X:=R2.B.X-3;
-    R2.A.X:=17; R2.B.Y:=R2.A.Y+1;
-    New(IL2, Init(R2, FindStrSize));
-    IL2^.Data^:=ReplaceStr;
-    Insert(IL2);
-    Insert(New(PLabel, Init(R1, label_replace_newtext, IL2)));
-    R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
-    Control := New(PHistory, Init(R1, IL2, TextReplaceId));
-    Insert(Control);
-
-    R1.Copy(R); Inc(R1.A.Y,4); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
-    R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+3;
-    New(CB1, Init(R2,
-      NewSItem(label_replace_casesensitive,
-      NewSItem(label_replace_wholewordsonly,
-      NewSItem(label_replace_promptonreplace,
-      nil)))));
-    Insert(CB1);
-    Insert(New(PLabel, Init(R1, label_replace_options, CB1)));
-
-    R1.Copy(R); Inc(R1.A.Y,4); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
-    R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
-    New(RB1, Init(R2,
-      NewSItem(label_replace_forward,
-      NewSItem(label_replace_backward,
-      nil))));
-    Insert(RB1);
-    Insert(New(PLabel, Init(R1, label_replace_direction, RB1)));
-
-    R1.Copy(R); Inc(R1.A.Y,9); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
-    R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
-    New(RB2, Init(R2,
-      NewSItem(label_replace_global,
-      NewSItem(label_replace_selectedtext,
-      nil))));
-    Insert(RB2);
-    Insert(New(PLabel, Init(R1, label_replace_scope, RB2)));
-
-    R1.Copy(R); Inc(R1.A.Y,9); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
-    R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
-    New(RB3, Init(R2,
-      NewSItem(label_replace_fromcursor,
-      NewSItem(label_replace_entirescope,
-      nil))));
-    Insert(RB3);
-    Insert(New(PLabel, Init(R1, label_replace_origin, RB3)));
-
-    GetExtent(R); R.Grow(-13,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10; R.Move(-10,0);
-    Insert(New(PButton, Init(R, btn_OK, cmOK, bfDefault)));
-    R.Move(11,0); R.B.X:=R.A.X+14;
-    Insert(New(PButton, Init(R, btn_replace_changeall, cmYes, bfNormal)));
-    R.Move(15,0); R.B.X:=R.A.X+10;
-    Insert(New(PButton, Init(R, btn_Cancel, cmCancel, bfNormal)));
-  end;
-  IL1^.Select;
-  CreateReplaceDialog := D;
-end;
-
-function CreateGotoLineDialog(Info: pointer): PDialog;
-var D: PDialog;
-    R,R1,R2: TRect;
-    Control : PView;
-    IL: PInputLine;
-begin
-  R.Assign(0,0,40,7);
-  New(D, Init(R, dialog_gotoline));
-  with D^ do
-  begin
-    Options:=Options or ofCentered;
-    GetExtent(R); R.Grow(-3,-2); R.B.Y:=R.A.Y+1;
-    R1.Copy(R); R1.B.X:=27; R2.Copy(R);
-    R2.B.X:=R2.B.X-3;R2.A.X:=27;
-    New(IL, Init(R2,5));
-    with TGotoLineDialogRec(Info^) do
-    IL^.SetValidator(New(PRangeValidator, Init(1, Lines)));
-    Insert(IL);
-    Insert(New(PLabel, Init(R1, label_gotoline_linenumber, IL)));
-    R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
-    Control := New(PHistory, Init(R1, IL, GotoId));
-    Insert(Control);
-
-    GetExtent(R); R.Grow(-8,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10;
-    Insert(New(PButton, Init(R, btn_OK, cmOK, bfDefault)));
-    R.Move(15,0);
-    Insert(New(PButton, Init(R, btn_Cancel, cmCancel, bfNormal)));
-  end;
-  IL^.Select;
-  CreateGotoLineDialog:=D;
-end;
-
-function StdEditorDialog(Dialog: Integer; Info: Pointer): Word;
-var
-  R: TRect;
-  T: TPoint;
-  Re: word;
-  Name: string;
-  DriveNumber : byte;
-  StoreDir,StoreDir2 : DirStr;
-  Title,DefExt: string;
-  AskOW: boolean;
-begin
-  case Dialog of
-    edOutOfMemory:
-      StdEditorDialog := MessageBox(msg_notenoughmemoryforthisoperation,
-   nil, mfInsertInApp+ mfError + mfOkButton);
-    edReadError:
-      StdEditorDialog := MessageBox(msg_errorreadingfile,
-   @Info, mfInsertInApp+ mfError + mfOkButton);
-    edWriteError:
-      StdEditorDialog := MessageBox(msg_errorwritingfile,
-   @Info, mfInsertInApp+ mfError + mfOkButton);
-    edSaveError:
-      StdEditorDialog := MessageBox(msg_errorsavingfile,
-   @Info, mfInsertInApp+ mfError + mfOkButton);
-    edCreateError:
-      StdEditorDialog := MessageBox(msg_errorcreatingfile,
-   @Info, mfInsertInApp+ mfError + mfOkButton);
-    edSaveModify:
-      StdEditorDialog := MessageBox(msg_filehasbeenmodifiedsave,
-   @Info, mfInsertInApp+ mfInformation + mfYesNoCancel);
-    edSaveUntitled:
-      StdEditorDialog := MessageBox(msg_saveuntitledfile,
-   nil, mfInsertInApp+ mfInformation + mfYesNoCancel);
-    edChangedOnloading:
-      StdEditorDialog := MessageBox(msg_filehadtoolonglines,
-   Info, mfInsertInApp+ mfOKButton + mfInformation);
-    edFileOnDiskChanged:
-      StdEditorDialog := MessageBox(msg_filewasmodified,
-   @info, mfInsertInApp+ mfInformation + mfYesNoCancel);
-    edSaveAs,edWriteBlock,edReadBlock:
-      begin
-        Name:=PString(Info)^;
-        GetDir(0,StoreDir);
-        DriveNumber:=0;
-        if (Length(FileDir)>1) and (FileDir[2]=':') then
-          begin
-            { does not assume that lowercase are greater then uppercase ! }
-            if (FileDir[1]>='a') and (FileDir[1]<='z') then
-              DriveNumber:=Ord(FileDir[1])-ord('a')+1
-            else
-              DriveNumber:=Ord(FileDir[1])-ord('A')+1;
-            GetDir(DriveNumber,StoreDir2);
-{$ifndef FPC}
-            ChDir(Copy(FileDir,1,2));
-            { this sets InOutRes in win32 PM }
-            { is this bad? What about an EatIO? Gabor }
-{$endif not FPC}
-          end;
-        if FileDir<>'' then
-          ChDir(TrimEndSlash(FileDir));
-        case Dialog of
-          edSaveAs     :
-            begin
-              Title:=dialog_savefileas;
-              DefExt:='*'+DefaultSaveExt;
-            end;
-          edWriteBlock :
-            begin
-              Title:=dialog_writeblocktofile;
-              DefExt:='';
-            end;
-          edReadBlock  :
-            begin
-              Title:=dialog_readblockfromfile;
-              DefExt:='';
-            end;
-        else begin Title:='???'; DefExt:=''; end;
-        end;
-        Re:=Application^.ExecuteDialog(New(PFileDialog, Init(DefExt,
-          Title, label_name, fdOkButton, FileId)), @Name);
-        case Dialog of
-          edSaveAs     :
-            begin
-              if ExtOf(Name)='' then
-                Name:=Name+DefaultSaveExt;
-              AskOW:=(Name<>PString(Info)^);
-            end;
-          edWriteBlock :
-            begin
-              if ExtOf(Name)='' then
-                Name:=Name+DefaultSaveExt;
-              AskOW:=true;
-            end;
-          edReadBlock  : AskOW:=false;
-        else AskOW:=true;
-        end;
-        if (Re<>cmCancel) and AskOW then
-          begin
-            FileDir:=DirOf(FExpand(Name));
-            if ExistsFile(Name) then
-              if EditorDialog(edReplaceFile,@Name)<>cmYes then
-                Re:=cmCancel;
-          end;
-        if DriveNumber<>0 then
-          ChDir(StoreDir2);
-{$ifndef FPC}
-        if (Length(StoreDir)>1) and (StoreDir[2]=':') then
-          ChDir(Copy(StoreDir,1,2));
-{$endif not FPC}
-        if StoreDir<>'' then
-          ChDir(TrimEndSlash(StoreDir));
-
-        if Re<>cmCancel then
-          PString(Info)^:=Name;
-        StdEditorDialog := Re;
-      end;
-    edGotoLine:
-      StdEditorDialog :=
-   Application^.ExecuteDialog(CreateGotoLineDialog(Info), Info);
-    edFind:
-      StdEditorDialog :=
-   Application^.ExecuteDialog(CreateFindDialog, Info);
-    edSearchFailed:
-      StdEditorDialog := MessageBox(msg_searchstringnotfound,
-   nil, mfInsertInApp+ mfError + mfOkButton);
-    edReplace:
-      StdEditorDialog :=
-   Application^.ExecuteDialog(CreateReplaceDialog, Info);
-    edReplacePrompt:
-      begin
-   { Avoid placing the dialog on the same line as the cursor }
-   R.Assign(0, 1, 40, 8);
-   R.Move((Desktop^.Size.X - R.B.X) div 2, 0);
-   Desktop^.MakeGlobal(R.B, T);
-   Inc(T.Y);
-   if PPoint(Info)^.Y <= T.Y then
-     R.Move(0, Desktop^.Size.Y - R.B.Y - 2);
-   StdEditorDialog := MessageBoxRect(R, msg_replacethisoccourence,
-     nil, mfInsertInApp+ mfYesNoCancel + mfInformation);
-      end;
-    edReplaceFile :
-      StdEditorDialog :=
-   MessageBox(msg_fileexistsoverwrite,@Info,mfInsertInApp+mfConfirmation+
-     mfYesButton+mfNoButton);
-  end;
-end;
-
-procedure RegisterWEditor;
-begin
-{$ifndef NOOBJREG}
-{$endif}
-end;
-
-END.
-{
-  $Log$
-  Revision 1.6  2000-11-15 00:14:11  pierre
-   new merge
-
-  Revision 1.1.2.17  2000/11/14 23:41:32  pierre
-   * fix for bug 1234
-
-  Revision 1.1.2.16  2000/11/14 09:08:50  marco
-   * First batch IDE renamefest
-
-  Revision 1.5  2000/11/13 17:37:42  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.15  2000/11/13 16:55:09  pierre
-   * multi space indent disabled
-
-  Revision 1.1.2.14  2000/11/06 17:19:58  pierre
-   * avoid eating of last carriage return
-
-  Revision 1.4  2000/11/03 16:05:38  pierre
-   * (merged)
-
-  Revision 1.1.2.13  2000/11/03 15:49:26  pierre
-   * more Undo fixes
-
-  Revision 1.1.2.12  2000/11/03 13:31:33  pierre
-   + more Undo stuff and smarter indent/unindent
-
-  Revision 1.3  2000/10/31 22:35:55  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.11  2000/10/31 08:12:45  pierre
-   * fix for bug 1161
-
-  Revision 1.1.2.10  2000/10/31 07:50:02  pierre
-   + efNoIndent to avoid any indentation
-
-  Revision 1.1.2.9  2000/10/26 00:02:40  pierre
-   * Undo improovments
-
-  Revision 1.1.2.8  2000/10/24 23:06:30  pierre
-   * some Undo/redo fixes
-
-  Revision 1.1.2.7  2000/10/20 13:40:34  pierre
-   * avoid crash if paste win clipboard on empty editor
-
-  Revision 1.1.2.6  2000/09/19 19:54:09  pierre
-   * fix for bug 1141 by Gabor
-
-  Revision 1.1.2.5  2000/09/18 13:20:55  pierre
-   New bunch of Gabor changes
-
-  Revision 1.2  2000/08/22 09:41:41  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.4  2000/08/15 03:40:54  peter
-   [*] no more fatal exits when the IDE can't find the error file (containing
-       the redirected assembler/linker output) after compilation
-   [*] hidden windows are now added always at the end of the Window List
-   [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
-   [*] selection was incorrectly adjusted when typing in overwrite mode
-   [*] the line wasn't expanded when it's end was reached in overw. mode
-   [*] the IDE now tries to locate source files also in the user specified
-       unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
-   [*] 'Open at cursor' is now aware of the extension (if specified)
-
-  Revision 1.1.2.3  2000/07/20 11:02:16  michael
-  + Fixes from gabor. See fixes.txt
-
-  Revision 1.1.2.2  2000/07/18 05:50:22  michael
-  + Merged Gabors fixes
-
-  Revision 1.1.2.1  2000/07/15 21:30:06  pierre
-   * Do not consider ASM inside a string as a assembler statement start
-   * Add .pas extension to edWriteBlock if no extension is choosen
-
-  Revision 1.1  2000/07/13 09:48:37  michael
-  + Initial import
-
-  Revision 1.95  2000/06/22 09:07:13  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.94  2000/06/16 21:17:39  pierre
-   + TCustoCodeEditorCore.GetChangedLine
-
-  Revision 1.93  2000/06/16 08:50:43  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.92  2000/06/15 20:29:45  pierre
-   * avoid RTE 211 on Ctrl K W
-
-  Revision 1.91  2000/05/29 10:44:58  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.90  2000/05/17 11:58:26  pierre
-   * remove openbrace because of multiple comment level problem
-
-  Revision 1.89  2000/05/17 09:44:46  pierre
-   * fix the $ifdef inside a comment problem
-
-  Revision 1.88  2000/04/25 08:42:34  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.87  2000/04/18 11:42:38  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.86  2000/03/23 21:36:19  pierre
-   * get correct position in indicator again
-
-  Revision 1.85  2000/03/21 23:17:47  pierre
-    + Gabor patch to add support for multiple windows
-      of same file
-      weditor has been splitted into weditor and wcedit units
-
-  Revision 1.84  2000/03/20 19:19:44  pierre
-   * LFN support in streams
-
-  Revision 1.83  2000/03/14 13:38:03  pierre
-   * max number of line changed and warning added
-
-  Revision 1.82  2000/03/02 22:33:36  pierre
-   * Grep improoved
-
-  Revision 1.81  2000/02/09 12:56:54  pierre
-   * fix for DelChar past end of line
-
-  Revision 1.80  2000/02/07 12:11:15  pierre
-   Gabors changes
-
-  Revision 1.79  2000/02/05 14:50:59  florian
-    * applied fix from Gabor regarding the limited line length of the clipboard
-
-  Revision 1.78  2000/01/28 22:20:04  pierre
-   * Test_partial_syntax released
-
-  Revision 1.77  2000/01/27 22:30:38  florian
-    * start of FPU window
-    * current executed line color has a higher priority then a breakpoint now
-
-  Revision 1.76  2000/01/25 00:12:23  pierre
-   * fix for Backspace Undo
-
-  Revision 1.75  2000/01/14 15:36:42  pierre
-   + GetShortFileName used for tcodeeditor file opening
-
-  Revision 1.74  2000/01/10 23:20:04  pierre
-   * problem with Paste solved
-
-  Revision 1.73  2000/01/10 13:25:46  pierre
-   + first partial syntax test
-
-  Revision 1.72  2000/01/07 00:19:30  pierre
-    * forgot CommentLineType check to see if we need to update format
-      on next line
-    * some changes for TEST_PARTIAL_SYNTAX still does notwork :(
-
-  Revision 1.71  2000/01/06 17:47:26  pierre
-   * avoid to resyntax whole source in unnecessary cases
-
-  Revision 1.70  2000/01/05 17:35:50  pierre
-    + Warning box if a line is cut at reading of file
-      this is done to avoid loosing completely long lines
-    * several TAB related changes
-      in particular do not remove or recombine TABs in makefiles
-    * fixes for ^KR and ^KW (the was an extra LF at end of
-      written block of disk and an error for starting X position
-      in SaveAreaToStream)
-
-  Revision 1.69  2000/01/05 00:37:34  pierre
-    * ^KC fix
-    *  better Tab handling
-
-  Revision 1.68  2000/01/04 12:33:08  pierre
-    * reinserted version 1.66 lost changes
-    + CtrlT Undo works now !
-
-  Revision 1.67  2000/01/03 11:38:35  michael
-  Changes from Gabor
-
-  Revision 1.65  1999/12/08 16:02:46  pierre
-   * fix for bugs 746,748 and 750
-
-  Revision 1.64  1999/12/01 17:25:00  pierre
-   + check if file on disk was changed since load before overwriting
-
-  Revision 1.63  1999/11/22 17:34:08  pierre
-   * fix for form bug 634
-
-  Revision 1.62  1999/11/18 13:42:06  pierre
-   * Some more Undo stuff
-
-  Revision 1.61  1999/11/10 00:45:30  pierre
-   + groupd action started, not yet working
-
-  Revision 1.60  1999/11/05 13:49:13  pierre
-   * WinPaste depends on avalaible Clipboard data
-
-  Revision 1.59  1999/11/03 09:39:23  peter
-    * fixed uppercase filenames
-    * savetostream did twice a -1 on the linecount, so the lastline of a
-      file wasn't saved correctly
-
-  Revision 1.58  1999/10/28 15:14:22  pierre
-   * get it to compile with debug conditional
-
-  Revision 1.56  1999/10/27 13:32:58  pierre
-   * some more Undo Fixes
-
-  Revision 1.55  1999/10/27 10:46:19  pierre
-   * More Undo/Redo stuff
-
-  Revision 1.54  1999/10/25 16:49:05  pierre
-    + Undo/Redo by Visa Harvey (great thanks) inserted
-      (with some modifications)
-      Moves work correctly
-      Text insertion/deletion are still buggy !
-    * LinePosToCharIndex and reverse function changed to get more
-      sensible results, dependant code adapted
-    * several bug fixes
-
-  Revision 1.53  1999/10/14 10:21:48  pierre
-   * more tabs related problems fiwes
-
-  Revision 1.52  1999/10/12 23:35:18  pierre
-    + DelStart and SelectWord implemented
-    * AddChar(tab) now reacts correctly if efAutoIndent is set
-
-  Revision 1.51  1999/10/08 15:24:50  pierre
-   * InsertFrom bug (end of line wasdiscarded)
-
-  Revision 1.50  1999/09/28 23:44:13  pierre
-   * text insertion in middle of line was buggy
-
-  Revision 1.49  1999/09/23 16:33:30  pierre
-    * ^B^A now prints out the ascii 1 char
-    * In SearchReplace Several occurence of a pattern in the same line
-      should now be found correctly
-
-  Revision 1.48  1999/09/22 16:16:26  pierre
-   + added HistLists for several dialogs
-
-  Revision 1.47  1999/09/21 17:08:59  pierre
-   + Windows clipboard for win32
-
-  Revision 1.46  1999/09/13 16:24:44  peter
-    + clock
-    * backspace unident like tp7
-
-  Revision 1.45  1999/09/09 12:05:33  pierre
-    + Copy/Paste to Windows Clipboard
-    + efLeaveTrailingSpaces added to editor flags
-      (if not set then spaces at the end of a line are
-      removed on writing the file)
-
-  Revision 1.44  1999/08/27 15:07:44  pierre
-   + cmResetDebuggerRow
-
-  Revision 1.43  1999/08/24 22:04:35  pierre
-    + TCodeEditor.SetDebuggerRow
-      works like SetHighlightRow but is only disposed by a SetDebuggerRow(-1)
-      so the current stop point in debugging is not lost if
-      we move the cursor
-
-  Revision 1.42  1999/08/22 22:20:30  pierre
-   * selection extension bug removed, via oldEvent pointer in TCodeEditor.HandleEvent
-
-  Revision 1.41  1999/08/16 18:25:28  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.40  1999/08/03 20:22:42  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.39  1999/07/28 23:11:26  peter
-    * fixes from gabor
-
-  Revision 1.38  1999/07/12 13:14:24  pierre
-    * LineEnd bug corrected, now goes end of text even if selected
-    + Until Return for debugger
-    + Code for Quit inside GDB Window
-
-  Revision 1.37  1999/06/29 22:50:16  peter
-    * more fixes from gabor
-
-  Revision 1.36  1999/06/29 08:51:34  pierre
-   * lockflag problems fixed
-
-  Revision 1.35  1999/06/28 19:32:32  peter
-    * fixes from gabor
-
-  Revision 1.34  1999/06/28 15:58:07  pierre
-   * ShiftDel problem solved
-
-  Revision 1.33  1999/06/25 00:31:51  pierre
-   + FileDir remembers the last directory for Open and Save
-
-  Revision 1.32  1999/06/21 23:36:12  pierre
-   * Size for Cluster is word (TP compatibility)
-
-  Revision 1.31  1999/05/22 13:44:35  peter
-    * fixed couple of bugs
-
-  Revision 1.30  1999/04/15 08:58:10  peter
-    * syntax highlight fixes
-    * browser updates
-
-  Revision 1.29  1999/04/07 21:55:59  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.28  1999/03/23 15:11:39  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.27  1999/03/08 14:58:17  peter
-    + prompt with dialogs for tools
-
-  Revision 1.26  1999/03/07 22:58:57  pierre
-   * FindRec needs longint for CheckBoxes
-
-  Revision 1.25  1999/03/05 17:39:39  pierre
-   * Actions item freeing
-
-  Revision 1.24  1999/03/03 16:45:07  pierre
-   * Actions were not dispose in TCodeEditor.Done
-
-  Revision 1.23  1999/03/01 15:42:10  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.22  1999/02/22 02:15:25  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.21  1999/02/20 15:18:33  peter
-    + ctrl-c capture with confirm dialog
-    + ascii table in the tools menu
-    + heapviewer
-    * empty file fixed
-    * fixed callback routines in fpdebug to have far for tp7
-
-  Revision 1.20  1999/02/18 17:27:57  pierre
-   * find/replace dialogs need packed records !!
-
-  Revision 1.19  1999/02/18 13:44:36  peter
-    * search fixed
-    + backward search
-    * help fixes
-    * browser updates
-
-  Revision 1.18  1999/02/15 15:12:25  pierre
-   + TLine remembers Comment type
-
-  Revision 1.17  1999/02/15 09:32:58  pierre
-   * single line comment // fix : comments intermix still wrong !!
-
-  Revision 1.16  1999/02/11 19:07:26  pierre
-    * GDBWindow redesigned :
-      normal editor apart from
-      that any kbEnter will send the line (for begin to cursor)
-      to GDB command !
-      GDBWindow opened in Debugger Menu
-       still buggy :
-       -echo should not be present if at end of text
-       -GDBWindow becomes First after each step (I don't know why !)
-
-  Revision 1.15  1999/02/09 09:29:59  pierre
-   * avoid invisible characters in CombineColors
-
-  Revision 1.14  1999/02/05 13:51:45  peter
-    * unit name of FPSwitches -> FPSwitch which is easier to use
-    * some fixes for tp7 compiling
-
-  Revision 1.13  1999/02/05 13:22:43  pierre
-   * bug that caused crash for empty files
-
-  Revision 1.12  1999/02/05 12:04:56  pierre
-   + 'loose' centering for debugger
-
-  Revision 1.11  1999/02/04 17:19:26  peter
-    * linux fixes
-
-  Revision 1.10  1999/02/04 10:13:00  pierre
-    + GetCurrentWord (used in Find/Replace)
-    + DefUseTabsPattern (pattern forcing tabs to be kept)
-      used for all makefiles !!
-
-  Revision 1.9  1999/01/29 10:34:33  peter
-    + needobjdir,needlibdir
-
-  Revision 1.8  1999/01/21 11:54:31  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.7  1999/01/14 21:41:17  peter
-    * use * as modified indicator
-    * fixed syntax highlighting
-
-  Revision 1.6  1999/01/12 14:29:44  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.5  1999/01/07 15:02:40  peter
-    * better tab support
-
-  Revision 1.4  1999/01/04 11:49:55  peter
-   * 'Use tab characters' now works correctly
-   + Syntax highlight now acts on File|Save As...
-   + Added a new class to syntax highlight: 'hex numbers'.
-   * There was something very wrong with the palette managment. Now fixed.
-   + Added output directory (-FE<xxx>) support to 'Directories' dialog...
-   * Fixed some possible bugs in Running/Compiling, and the compilation/run
-     process revised
-
-  Revision 1.2  1998/12/28 15:47:55  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.4  1998/12/27 12:01:23  gabor
-    * efXXXX constants revised for BP compatibility
-    * fixed column and row highlighting (needs to rewrite default palette in the INI)
-
-  Revision 1.3  1998/12/22 10:39:54  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 1457
ide/text/whelp.pas

@@ -1,1457 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Help support & Borland OA .HLP reader objects and routines
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$R-}
-unit WHelp;
-
-interface
-
-uses
-{$ifdef Win32}
-   { placed here to avoid TRect to be found in windows unit
-     for win32 target whereas its found in objects unit for other targets PM }
-     windows,
-{$endif Win32}
-     Objects,
-     WUtils;
-
-const
-      MinFormatVersion  = $04; { was $34 }
-
-      TP55FormatVersion = $04;
-      TP70FormatVersion = $34;
-
-      Signature      = '$*$* &&&&$*$'#0;
-      ncRawChar      = $F;
-      ncRepChar      = $E;
-
-      oa_rtFileHeader   = Byte ($0);
-      oa_rtContext      = Byte ($1);
-      oa_rtText         = Byte ($2);
-      oa_rtKeyWord      = Byte ($3);
-      oa_rtIndex        = Byte ($4);
-      oa_rtCompression  = Byte ($5);
-      oa_rtIndexTags    = Byte ($6);
-
-      ctNone         = $00;
-      ctNibble       = $02;
-
-      hscLineBreak   = #0;
-      hscLink        = #2;
-      hscLineStart   = #3;
-      hscCode        = #5;
-      hscCenter      = #10;
-      hscRight       = #11;
-      hscNamedMark   = #12;
-      hscTextAttr    = #13;
-      hscTextColor   = #14;
-      hscNormText    = #15;
-
-type
-      FileStamp      = array [0..32] of char; {+ null terminator + $1A }
-      FileSignature  = array [0..12] of char; {+ null terminator }
-
-      THelpCtx = longint;
-
-      THLPVersion = packed record
-        FormatVersion : byte;
-        TextVersion   : byte;
-      end;
-
-      THLPRecordHeader = packed record
-        RecType       : byte; {TPRecType}
-        RecLength     : word;
-      end;
-
-      THLPContextPos = packed record
-        LoW: word;
-        HiB: byte;
-      end;
-
-      THLPContexts = packed record
-        ContextCount : word;
-        Contexts     : array[0..0] of THLPContextPos;
-      end;
-
-      THLPFileHeader = packed record
-        Options         : word;
-        MainIndexScreen : word;
-        MaxScreenSize   : word;
-        Height          : byte;
-        Width           : byte;
-        LeftMargin      : byte;
-      end;
-
-      THLPCompression = packed record
-        CompType      : byte;
-        CharTable     : array [0..13] of byte;
-      end;
-
-      THLPIndexDescriptor = packed record
-        LengthCode    : byte;
-        UniqueChars   : array [0..0] of byte;
-        Context       : word;
-      end;
-
-      THLPIndexTable = packed record
-        IndexCount    : word;
-        Entries       : record end;
-      end;
-
-      THLPKeywordDescriptor = packed record
-        KwContext     : word;
-      end;
-
-      THLPKeyWordRecord = packed record
-        UpContext     : word;
-        DownContext   : word;
-        KeyWordCount  : word;
-        Keywords      : array[0..0] of THLPKeywordDescriptor;
-      end;
-
-      THLPKeywordDescriptor55 = packed record
-        PosY          : byte;
-        StartX        : byte;
-        EndX          : byte;
-        Dunno         : array[0..1] of word;
-        KwContext     : word;
-      end;
-
-      THLPKeyWordRecord55 = packed record
-        UpContext     : word;
-        DownContext   : word;
-        KeyWordCount  : byte;
-        Keywords      : array[0..0] of THLPKeywordDescriptor55;
-      end;
-
-      TRecord = packed record
-        SClass   : word;
-        Size     : word;
-        Data     : pointer;
-      end;
-
-      PIndexEntry = ^TIndexEntry;
-      TIndexEntry = packed record
-        Tag        : PString;
-        HelpCtx    : THelpCtx;
-        FileID     : word;
-      end;
-
-      PKeywordDescriptor = ^TKeywordDescriptor;
-      TKeywordDescriptor = packed record
-        FileID     : word;
-        Context    : THelpCtx;
-      end;
-
-      PKeywordDescriptors = ^TKeywordDescriptors;
-      TKeywordDescriptors = array[0..MaxBytes div sizeof(TKeywordDescriptor)-1] of TKeywordDescriptor;
-
-      PTopic = ^TTopic;
-      TTopic = object
-        HelpCtx       : THelpCtx;
-        FileOfs       : longint;
-        TextSize      : sw_word;
-        Text          : PByteArray;
-        LinkCount     : sw_word;
-        Links         : PKeywordDescriptors;
-        LastAccess    : longint;
-        FileID        : word;
-        Param         : PString;
-        StartNamedMark: integer;
-        NamedMarks    : PUnsortedStringCollection;
-        ExtData       : pointer;
-        ExtDataSize   : longint;
-        function LinkSize: sw_word;
-        function GetNamedMarkIndex(const MarkName: string): sw_integer;
-      end;
-
-      PTopicCollection = ^TTopicCollection;
-      TTopicCollection = object(TSortedCollection)
-        function   At(Index: sw_Integer): PTopic;
-        procedure  FreeItem(Item: Pointer); virtual;
-        function   Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-        function   SearchTopic(AHelpCtx: THelpCtx): PTopic;
-      end;
-
-      PIndexEntryCollection = ^TIndexEntryCollection;
-      TIndexEntryCollection = object(TSortedCollection)
-        function   At(Index: Sw_Integer): PIndexEntry;
-        procedure  FreeItem(Item: Pointer); virtual;
-        function   Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-      end;
-
-      PUnsortedIndexEntryCollection = ^TUnsortedIndexEntryCollection;
-      TUnsortedIndexEntryCollection = object(TCollection)
-        function   At(Index: Sw_Integer): PIndexEntry;
-        procedure  FreeItem(Item: Pointer); virtual;
-      end;
-
-      PHelpFile = ^THelpFile;
-      THelpFile = object(TObject)
-        ID           : word;
-        Topics       : PTopicCollection;
-        IndexEntries : PUnsortedIndexEntryCollection;
-        constructor Init(AID: word);
-        function    LoadTopic(HelpCtx: THelpCtx): PTopic; virtual;
-        procedure   AddTopic(HelpCtx: THelpCtx; Pos: longint; const Param: string;
-                    ExtData: pointer; ExtDataSize: longint);
-        procedure   AddIndexEntry(const Text: string; AHelpCtx: THelpCtx);
-        destructor  Done; virtual;
-      public
-        function    LoadIndex: boolean; virtual;
-        function    SearchTopic(HelpCtx: THelpCtx): PTopic; virtual;
-        function    ReadTopic(T: PTopic): boolean; virtual;
-      private
-        procedure MaintainTopicCache;
-      end;
-
-      POAHelpFile = ^TOAHelpFile;
-      TOAHelpFile = object(THelpFile)
-        Version      : THLPVersion;
-        Header       : THLPFileHeader;
-        Compression  : THLPCompression;
-        constructor Init(AFileName: string; AID: word);
-        destructor  Done; virtual;
-      public
-        function    LoadIndex: boolean; virtual;
-        function    ReadTopic(T: PTopic): boolean; virtual;
-      public { protected }
-        F: PStream;
-        TopicsRead     : boolean;
-        IndexTableRead : boolean;
-        CompressionRead: boolean;
-        IndexTagsRead  : boolean;
-        IndexTagsPos   : longint;
-        IndexTablePos  : longint;
-        function  ReadHeader: boolean;
-        function  ReadTopics: boolean;
-        function  ReadIndexTable: boolean;
-        function  ReadCompression: boolean;
-        function  ReadIndexTags: boolean;
-        function  ReadRecord(var R: TRecord; ReadData: boolean): boolean;
-      end;
-
-      PHelpFileCollection = PCollection;
-
-      PHelpFacility = ^THelpFacility;
-      THelpFacility = object(TObject)
-        HelpFiles: PHelpFileCollection;
-        IndexTabSize: sw_integer;
-        constructor Init;
-        function    AddOAHelpFile(const FileName: string): boolean;
-        function    AddHTMLHelpFile(const FileName, TOCEntry: string): boolean;
-        function    AddNGHelpFile(const FileName: string): boolean;
-        function    AddOS2HelpFile(const FileName: string): boolean;
-        function    AddWinHelpFile(const FileName: string): boolean;
-        function    AddHTMLIndexHelpFile(const FileName: string): boolean;
-        function    LoadTopic(SourceFileID: word; Context: THelpCtx): PTopic; virtual;
-        function    TopicSearch(Keyword: string; var FileID: word; var Context: THelpCtx): boolean; virtual;
-        function    BuildIndexTopic: PTopic; virtual;
-        destructor  Done; virtual;
-      private
-        LastID: word;
-        function  SearchFile(ID: byte): PHelpFile;
-        function  SearchTopicInHelpFile(F: PHelpFile; Context: THelpCtx): PTopic;
-        function  SearchTopicOwner(SourceFileID: word; Context: THelpCtx): PHelpFile;
-        function  AddFile(H: PHelpFile): boolean;
-      end;
-
-const TopicCacheSize    : sw_integer = 10;
-      HelpStreamBufSize : sw_integer = 4096;
-      HelpFacility      : PHelpFacility = nil;
-      MaxHelpTopicSize  : sw_word = {$ifdef FPC}3*65520{$else}65520{$endif};
-
-function  NewTopic(FileID: byte; HelpCtx: THelpCtx; Pos: longint; Param: string;
-          ExtData: pointer; ExtDataSize: longint): PTopic;
-procedure DisposeTopic(P: PTopic);
-
-procedure RenderTopic(Lines: PUnsortedStringCollection; T: PTopic);
-procedure BuildTopic(Lines: PUnsortedStringCollection; T: PTopic);
-procedure AddLinkToTopic(T: PTopic; AFileID: word; ACtx: THelpCtx);
-
-function  NewIndexEntry(Tag: string; FileID: word; HelpCtx: THelpCtx): PIndexEntry;
-procedure DisposeIndexEntry(P: PIndexEntry);
-
-procedure DisposeRecord(var R: TRecord);
-
-implementation
-
-uses
-{$ifdef Unix}
-  linux,
-{$endif Unix}
-{$IFDEF OS2}
-  DosCalls,
-{$ENDIF OS2}
-  WConsts,WHTMLHlp,WNGHelp,WWinHelp,WOS2Help;
-
-
-Function GetDosTicks:longint; { returns ticks at 18.2 Hz, just like DOS }
-{$IFDEF OS2}
-  const
-    QSV_MS_COUNT = 14;
-  var
-    L: longint;
-  begin
-    DosQuerySysInfo (QSV_MS_COUNT, QSV_MS_COUNT, L, 4);
-    GetDosTicks := L div 55;
-  end;
-{$ENDIF}
-{$IFDEF Unix}
-  var
-    tv : TimeVal;
-    tz : TimeZone;
-  begin
-    GetTimeOfDay(tv); {Timezone no longer used?}
-    GetDosTicks:=((tv.Sec mod 86400) div 60)*1092+((tv.Sec mod 60)*1000000+tv.USec) div 54945;
-  end;
-{$endif Unix}
-{$ifdef Win32}
-  begin
-    GetDosTicks:=(Windows.GetTickCount*5484) div 100;
-  end;
-{$endif Win32}
-{$ifdef go32v2}
-  begin
-    GetDosTicks:=MemL[$40:$6c];
-  end;
-{$endif go32v2}
-{$ifdef TP}
-  begin
-    GetDosTicks:=MemL[$40:$6c];
-  end;
-{$endif go32v2}
-
-procedure DisposeRecord(var R: TRecord);
-begin
-  with R do
-  if (Size>0) and (Data<>nil) then FreeMem(Data, Size);
-  FillChar(R, SizeOf(R), 0);
-end;
-
-function NewTopic(FileID: byte; HelpCtx: THelpCtx; Pos: longint; Param: string;
-         ExtData: pointer; ExtDataSize: longint): PTopic;
-var P: PTopic;
-begin
-  New(P); FillChar(P^,SizeOf(P^), 0);
-  P^.HelpCtx:=HelpCtx; P^.FileOfs:=Pos; P^.FileID:=FileID;
-  P^.Param:=NewStr(Param);
-  if Assigned(ExtData) and (ExtDataSize>0) then
-  begin
-    P^.ExtDataSize:=ExtDataSize;
-    GetMem(P^.ExtData,ExtDataSize);
-    Move(ExtData^,P^.ExtData^,ExtDataSize);
-  end;
-  New(P^.NamedMarks, Init(100,100));
-  NewTopic:=P;
-end;
-
-procedure DisposeTopic(P: PTopic);
-begin
-  if P<>nil then
-  begin
-    if (P^.TextSize>0) and (P^.Text<>nil) then
-       FreeMem(P^.Text,P^.TextSize);
-    P^.Text:=nil;
-    if (P^.LinkCount>0) and (P^.Links<>nil) then
-       FreeMem(P^.Links,P^.LinkSize);
-    P^.Links:=nil;
-    if P^.Param<>nil then DisposeStr(P^.Param); P^.Param:=nil;
-    if Assigned(P^.ExtData) then
-      FreeMem(P^.ExtData{$ifndef FPC},P^.ExtDataSize{$endif});
-    if Assigned(P^.NamedMarks) then Dispose(P^.NamedMarks, Done); P^.NamedMarks:=nil;
-    Dispose(P);
-  end;
-end;
-
-function CloneTopic(T: PTopic): PTopic;
-var NT: PTopic;
-procedure CloneMark(P: PString); {$ifndef FPC}far;{$endif}
-begin
-  NT^.NamedMarks^.InsertStr(GetStr(P));
-end;
-begin
-  New(NT); Move(T^,NT^,SizeOf(NT^));
-  if NT^.Text<>nil then
-     begin GetMem(NT^.Text,NT^.TextSize); Move(T^.Text^,NT^.Text^,NT^.TextSize); end;
-  if NT^.Links<>nil then
-     begin GetMem(NT^.Links,NT^.LinkSize); Move(T^.Links^,NT^.Links^,NT^.LinkSize); end;
-  if NT^.Param<>nil then
-     NT^.Param:=NewStr(T^.Param^);
-  if Assigned(T^.NamedMarks) then
-  begin
-    New(NT^.NamedMarks, Init(T^.NamedMarks^.Count,10));
-    T^.NamedMarks^.ForEach(@CloneMark);
-  end;
-  NT^.ExtDataSize:=T^.ExtDataSize;
-  if Assigned(T^.ExtData) and (T^.ExtDataSize>0) then
-  begin
-    GetMem(NT^.ExtData,NT^.ExtDataSize);
-    Move(T^.ExtData^,NT^.ExtData^,NT^.ExtDataSize);
-  end;
-  CloneTopic:=NT;
-end;
-
-procedure RenderTopic(Lines: PUnsortedStringCollection; T: PTopic);
-var Size,CurPtr,I,MSize: sw_word;
-    S: string;
-begin
-  CurPtr:=0;
-  for I:=0 to Lines^.Count-1 do
-  begin
-    S:=GetStr(Lines^.At(I));
-    Size:=length(S)+1;
-    Inc(CurPtr,Size);
-  end;
-  Size:=CurPtr;
-  T^.TextSize:=Size; GetMem(T^.Text,T^.TextSize);
-  CurPtr:=0;
-  for I:=0 to Lines^.Count-1 do
-  begin
-    S:=GetStr(Lines^.At(I)); Size:=length(S); MSize:=Size;
-    if CurPtr+Size>=T^.TextSize then
-      MSize:=T^.TextSize-CurPtr;
-    Move(S[1],PByteArray(T^.Text)^[CurPtr],MSize);
-    if MSize<>Size then
-      Break;
-    Inc(CurPtr,Size);
-    PByteArray(T^.Text)^[CurPtr]:=ord(hscLineBreak);
-    Inc(CurPtr);
-    if CurPtr>=T^.TextSize then Break;
-  end;
-end;
-
-procedure BuildTopic(Lines: PUnsortedStringCollection; T: PTopic);
-var Size,CurPtr,MSize: sw_word;
-    I: sw_integer;
-    S: string;
-begin
-  CurPtr:=0;
-  for I:=0 to Lines^.Count-1 do
-  begin
-    S:=GetStr(Lines^.At(I));
-    Size:=length(S);
-    Inc(CurPtr,Size);
-  end;
-  Size:=CurPtr;
-  T^.TextSize:=Size; GetMem(T^.Text,T^.TextSize);
-  CurPtr:=0;
-  for I:=0 to Lines^.Count-1 do
-  begin
-    S:=GetStr(Lines^.At(I)); Size:=length(S); MSize:=Size;
-    if Size>0 then
-    begin
-      if CurPtr+Size>=T^.TextSize then
-        MSize:=T^.TextSize-CurPtr;
-      Move(S[1],PByteArray(T^.Text)^[CurPtr],MSize);
-      if MSize<>Size then
-        Break;
-      Inc(CurPtr,Size);
-    end;
-    if CurPtr>=T^.TextSize then Break;
-  end;
-end;
-
-procedure AddLinkToTopic(T: PTopic; AFileID: word; ACtx: THelpCtx);
-var NewSize: word;
-    NewPtr: pointer;
-begin
-  NewSize:=longint(T^.LinkCount+1)*sizeof(T^.Links^[0]);
-  GetMem(NewPtr,NewSize);
-  if Assigned(T^.Links) then
-  begin
-    Move(T^.Links^,NewPtr^,T^.LinkSize);
-    FreeMem(T^.Links,T^.LinkSize);
-  end;
-  T^.Links:=NewPtr;
-  with T^.Links^[T^.LinkCount] do
-  begin
-    FileID:=AFileID;
-    Context:=ACtx;
-  end;
-  Inc(T^.LinkCount);
-end;
-
-function NewIndexEntry(Tag: string; FileID: word; HelpCtx: THelpCtx): PIndexEntry;
-var P: PIndexEntry;
-begin
-  New(P); FillChar(P^,SizeOf(P^), 0);
-  P^.Tag:=NewStr(Tag); P^.FileID:=FileID; P^.HelpCtx:=HelpCtx;
-  NewIndexEntry:=P;
-end;
-
-procedure DisposeIndexEntry(P: PIndexEntry);
-begin
-  if P<>nil then
-  begin
-    if P^.Tag<>nil then DisposeStr(P^.Tag);
-    Dispose(P);
-  end;
-end;
-
-function TTopic.LinkSize: sw_word;
-begin
-  LinkSize:=LinkCount*SizeOf(Links^[0]);
-end;
-
-function TTopic.GetNamedMarkIndex(const MarkName: string): sw_integer;
-var I,Index: sw_integer;
-begin
-  Index:=-1;
-  if Assigned(NamedMarks) then
-  for I:=0 to NamedMarks^.Count-1 do
-    if CompareText(GetStr(NamedMarks^.At(I)),MarkName)=0 then
-     begin
-       Index:=I;
-       Break;
-     end;
-  GetNamedMarkIndex:=Index;
-end;
-
-function TTopicCollection.At(Index: sw_Integer): PTopic;
-begin
-  At:=inherited At(Index);
-end;
-
-procedure TTopicCollection.FreeItem(Item: Pointer);
-begin
-  if Item<>nil then DisposeTopic(Item);
-end;
-
-function TTopicCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-var K1: PTopic absolute Key1;
-    K2: PTopic absolute Key2;
-    R: Sw_integer;
-begin
-  if K1^.HelpCtx<K2^.HelpCtx then R:=-1 else
-  if K1^.HelpCtx>K2^.HelpCtx then R:= 1 else
-  R:=0;
-  Compare:=R;
-end;
-
-function TTopicCollection.SearchTopic(AHelpCtx: THelpCtx): PTopic;
-var T: TTopic;
-    P: PTopic;
-    Index: sw_integer;
-begin
-  T.HelpCtx:=AHelpCtx;
-  if Search(@T,Index) then
-    P:=At(Index)
-  else
-    P:=nil;
-  SearchTopic:=P;
-end;
-
-function TIndexEntryCollection.At(Index: Sw_Integer): PIndexEntry;
-begin
-  At:=inherited At(Index);
-end;
-
-procedure TIndexEntryCollection.FreeItem(Item: Pointer);
-begin
-  if Item<>nil then DisposeIndexEntry(Item);
-end;
-
-function TUnsortedIndexEntryCollection.At(Index: Sw_Integer): PIndexEntry;
-begin
-  At:=inherited At(Index);
-end;
-
-procedure TUnsortedIndexEntryCollection.FreeItem(Item: Pointer);
-begin
-  if Item<>nil then DisposeIndexEntry(Item);
-end;
-
-function TIndexEntryCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-var K1: PIndexEntry absolute Key1;
-    K2: PIndexEntry absolute Key2;
-    R: Sw_integer;
-    S1,S2: string;
-begin
-  S1:=UpcaseStr(K1^.Tag^); S2:=UpcaseStr(K2^.Tag^);
-  if S1<S2 then R:=-1 else
-  if S1>S2 then R:=1 else
-  if K1^.FileID<K2^.FileID then R:=-1 else
-  if K1^.FileID>K2^.FileID then R:= 1 else
-  R:=0;
-  Compare:=R;
-end;
-
-constructor THelpFile.Init(AID: word);
-begin
-  inherited Init;
-  ID:=AID;
-  New(Topics, Init(2000,1000));
-  New(IndexEntries, Init(2000,1000));
-end;
-
-procedure THelpFile.AddTopic(HelpCtx: THelpCtx; Pos: longint; const Param: string; ExtData: pointer; ExtDataSize: longint);
-begin
-  Topics^.Insert(NewTopic(ID,HelpCtx,Pos,Param,ExtData,ExtDataSize));
-end;
-
-procedure THelpFile.AddIndexEntry(const Text: string; AHelpCtx: THelpCtx);
-begin
-  IndexEntries^.Insert(NewIndexEntry(Text,ID,AHelpCtx));
-end;
-
-function THelpFile.LoadTopic(HelpCtx: THelpCtx): PTopic;
-var T: PTopic;
-begin
-  T:=SearchTopic(HelpCtx);
-  if (T<>nil) then
-   if T^.Text=nil then
-     begin
-       MaintainTopicCache;
-       if ReadTopic(T)=false then
-           T:=nil;
-       if (T<>nil) and (T^.Text=nil) then T:=nil;
-     end;
-  if T<>nil then
-     begin T^.LastAccess:=GetDosTicks; T:=CloneTopic(T); end;
-  LoadTopic:=T;
-end;
-
-function THelpFile.LoadIndex: boolean;
-begin
-  Abstract;
-  LoadIndex:=false; { remove warning }
-end;
-
-function THelpFile.SearchTopic(HelpCtx: THelpCtx): PTopic;
-var T: PTopic;
-begin
-  T:=Topics^.SearchTopic(HelpCtx);
-  SearchTopic:=T;
-end;
-
-function THelpFile.ReadTopic(T: PTopic): boolean;
-begin
-  Abstract;
-  ReadTopic:=false; { remove warning }
-end;
-
-procedure THelpFile.MaintainTopicCache;
-var Count: sw_integer;
-    MinLRU: longint;
-procedure CountThem(P: PTopic); {$ifndef FPC}far;{$endif}
-begin if (P^.Text<>nil) or (P^.Links<>nil) then Inc(Count); end;
-procedure SearchLRU(P: PTopic); {$ifndef FPC}far;{$endif}
-begin if P^.LastAccess<MinLRU then begin MinLRU:=P^.LastAccess; end; end;
-var P: PTopic;
-begin
-  Count:=0; Topics^.ForEach(@CountThem);
-  if (Count>=TopicCacheSize) then
-  begin
-    MinLRU:=MaxLongint; P:=nil; Topics^.ForEach(@SearchLRU);
-    if P<>nil then
-    begin
-      FreeMem(P^.Text,P^.TextSize); P^.TextSize:=0; P^.Text:=nil;
-      FreeMem(P^.Links,P^.LinkSize); P^.LinkCount:=0; P^.Links:=nil;
-    end;
-  end;
-end;
-
-destructor THelpFile.Done;
-begin
-  if Topics<>nil then Dispose(Topics, Done);
-  if IndexEntries<>nil then Dispose(IndexEntries, Done);
-  inherited Done;
-end;
-
-constructor TOAHelpFile.Init(AFileName: string; AID: word);
-var OK: boolean;
-    FS,L: longint;
-    R: TRecord;
-begin
-  if inherited Init(AID)=false then Fail;
-  F:=New(PFastBufStream, Init(AFileName, stOpenRead, HelpStreamBufSize));
-  OK:=F<>nil;
-  if OK then OK:=(F^.Status=stOK);
-  if OK then
-    begin
-      FS:=F^.GetSize;
-      OK:=ReadHeader;
-    end;
-  while OK do
-  begin
-    L:=F^.GetPos;
-    if (L>=FS) then Break;
-    OK:=ReadRecord(R,false);
-    if (OK=false) or (R.SClass=0) or (R.Size=0) then Break;
-    case R.SClass of
-      oa_rtContext     : begin F^.Seek(L); OK:=ReadTopics; end;
-      oa_rtText        : {Skip};
-      oa_rtKeyword     : {Skip};
-      oa_rtIndex       : begin IndexTablePos:=L; {OK:=ReadIndexTable; }end;
-      oa_rtCompression : begin F^.Seek(L); OK:=ReadCompression; end;
-      oa_rtIndexTags   : begin IndexTagsPos:=L; {OK:=ReadIndexTags; }end;
-    else
-     begin
-     {$ifdef DEBUGMSG}
-       ClearFormatParams;
-       AddFormatParamInt(R.SClass);
-       AddFormatParamInt(L);
-       AddFormatParamInt(R.Size);
-       ErrorBox('Uknown help record tag %x encountered, '+
-                'offset %x, size %d',@FormatParams);
-     {$else}
-       {Skip};
-     {$endif}
-     end;
-    end;
-    if OK then
-       begin Inc(L, SizeOf(THLPRecordHeader)); Inc(L, R.Size); F^.Seek(L); OK:=(F^.Status=stOK); end
-  end;
-  OK:=OK and (TopicsRead=true);
-  if OK=false then Fail;
-end;
-
-function TOAHelpFile.LoadIndex: boolean;
-begin
-  LoadIndex:=ReadIndexTable;
-end;
-
-function TOAHelpFile.ReadHeader: boolean;
-var S: string;
-    P: longint;
-    R: TRecord;
-    OK: boolean;
-begin
-  F^.Seek(0);
-  F^.Read(S[1],128); S[0]:=#255;
-  OK:=(F^.Status=stOK); P:=Pos(Signature,S);
-  OK:=OK and (P>0);
-  if OK then
-  begin
-    F^.Seek(P+length(Signature)-1);
-    F^.Read(Version,SizeOf(Version));
-    OK:=(F^.Status=stOK) and (Version.FormatVersion>=MinFormatVersion);
-    if OK then
-    begin
-      OK:=ReadRecord(R,true);
-      OK:=OK and (R.SClass=oa_rtFileHeader) and (R.Size=SizeOf(Header));
-      if OK then Move(R.Data^,Header,SizeOf(Header));
-      DisposeRecord(R);
-    end;
-  end;
-  ReadHeader:=OK;
-end;
-
-function TOAHelpFile.ReadTopics: boolean;
-var OK: boolean;
-    R: TRecord;
-    L,I: longint;
-function GetCtxPos(C: THLPContextPos): longint;
-begin
-  GetCtxPos:=longint(C.HiB) shl 16 + C.LoW;
-end;
-begin
-  OK:=ReadRecord(R, true);
-  if OK then
-  with THLPContexts(R.Data^) do
-  for I:=1 to longint(ContextCount)-1 do
-  begin
-    if Topics^.Count=MaxCollectionSize then Break;
-    L:=GetCtxPos(Contexts[I]);
-    if (L and $800000)<>0 then L:=not L;
-    if (L=-1) and (Header.MainIndexScreen>0) then
-       L:=GetCtxPos(Contexts[Header.MainIndexScreen]);
-    if (L>0) then
-      AddTopic(I,L,'',nil,0);
-  end;
-  DisposeRecord(R);
-  TopicsRead:=OK;
-  ReadTopics:=OK;
-end;
-
-function TOAHelpFile.ReadIndexTable: boolean;
-var OK: boolean;
-    R: TRecord;
-    I: longint;
-    LastTag,S: string;
-    CurPtr: sw_word;
-    HelpCtx: THelpCtx;
-    LenCode,CopyCnt,AddLen: byte;
-type pword = ^word;
-begin
-  if IndexTableRead then OK:=true else
- begin
-  LastTag:=''; CurPtr:=0;
-  OK:=(IndexTablePos<>0);
-  if OK then begin F^.Seek(IndexTablePos); OK:=F^.Status=stOK; end;
-  if OK then OK:=ReadRecord(R, true);
-  if OK then
-  with THLPIndexTable(R.Data^) do
-  for I:=0 to IndexCount-1 do
-  begin
-    LenCode:=PByteArray(@Entries)^[CurPtr];
-    AddLen:=LenCode and $1f; CopyCnt:=LenCode shr 5;
-    S[0]:=chr(AddLen); Move(PByteArray(@Entries)^[CurPtr+1],S[1],AddLen);
-    LastTag:=copy(LastTag,1,CopyCnt)+S;
-    HelpCtx:=PWord(@PByteArray(@Entries)^[CurPtr+1+AddLen])^;
-    AddIndexEntry(LastTag,HelpCtx);
-    Inc(CurPtr,1+AddLen+2);
-  end;
-  DisposeRecord(R);
-  IndexTableRead:=OK;
- end;
-  ReadIndexTable:=OK;
-end;
-
-function TOAHelpFile.ReadCompression: boolean;
-var OK: boolean;
-    R: TRecord;
-begin
-  OK:=ReadRecord(R, true);
-  OK:=OK and (R.Size=SizeOf(THLPCompression));
-  if OK then Move(R.Data^,Compression,SizeOf(Compression));
-  DisposeRecord(R);
-  CompressionRead:=OK;
-  ReadCompression:=OK;
-end;
-
-function TOAHelpFile.ReadIndexTags: boolean;
-var OK: boolean;
-begin
-  OK:={ReadRecord(R, true)}true;
-  IndexTagsRead:=OK;
-  ReadIndexTags:=OK;
-end;
-
-function TOAHelpFile.ReadRecord(var R: TRecord; ReadData: boolean): boolean;
-var OK: boolean;
-    H: THLPRecordHeader;
-begin
-  FillChar(R, SizeOf(R), 0);
-  F^.Read(H,SizeOf(H));
-  OK:=F^.Status=stOK;
-  if OK then
-  begin
-    R.SClass:=H.RecType; R.Size:=H.RecLength;
-    if (R.Size>0) and ReadData then
-    begin
-      GetMem(R.Data,R.Size);
-      F^.Read(R.Data^,R.Size);
-      OK:=F^.Status=stOK;
-    end;
-    if OK=false then DisposeRecord(R);
-  end;
-  ReadRecord:=OK;
-end;
-
-function TOAHelpFile.ReadTopic(T: PTopic): boolean;
-var SrcPtr,DestPtr,TopicSize: sw_word;
-    NewR: TRecord;
-    LinkPosCount: integer;
-    LinkPos: array[1..50] of TRect;
-function IsLinkPosStart(X,Y: integer): boolean;
-var OK: boolean;
-    I: integer;
-begin
-  OK:=false;
-  for I:=1 to LinkPosCount do
-    with LinkPos[I] do
-      if (A.X=X) and (A.Y=Y) then
-        begin
-          OK:=true;
-          Break;
-        end;
-  IsLinkPosStart:=OK;
-end;
-function IsLinkPosEnd(X,Y: integer): boolean;
-var OK: boolean;
-    I: integer;
-begin
-  OK:=false;
-  for I:=1 to LinkPosCount do
-    with LinkPos[I] do
-      if (B.X=X) and (B.Y=Y) then
-        begin
-          OK:=true;
-          Break;
-        end;
-  IsLinkPosEnd:=OK;
-end;
-function ExtractTextRec(var R: TRecord): boolean;
-function GetNextNibble: byte;
-var B,N: byte;
-begin
-  B:=PByteArray(R.Data)^[SrcPtr div 2];
-  N:=( B and ($0f shl (4*(SrcPtr mod 2))) ) shr (4*(SrcPtr mod 2));
-  Inc(SrcPtr);
-  GetNextNibble:=N;
-end;
-procedure RealAddChar(C: char);
-begin
-  if Assigned(NewR.Data) then
-    PByteArray(NewR.Data)^[DestPtr]:=ord(C);
-  Inc(DestPtr);
-end;
-var CurX,CurY: integer;
-    InLink: boolean;
-procedure AddChar(C: char);
-begin
-  if IsLinkPosStart(CurX+2,CurY) then
-    begin
-      RealAddChar(hscLink);
-      InLink:=true;
-    end
-  else
-    if (C=hscLineBreak) and (InLink) then
-      begin
-        RealAddChar(hscLink);
-        InLink:=false;
-      end;
-  RealAddChar(C);
-  if IsLinkPosEnd(CurX+2,CurY) then
-    begin
-      RealAddChar(hscLink);
-      InLink:=false;
-    end;
-  if C<>hscLineBreak then
-    Inc(CurX)
-  else
-    begin
-      CurX:=0;
-      Inc(CurY);
-    end;
-end;
-var OK: boolean;
-    C: char;
-    P: pointer;
-function GetNextChar: char;
-var C: char;
-    I,N,Cnt: byte;
-begin
-  N:=GetNextNibble;
-  case N of
-    $00       : C:=#0;
-    $01..$0D  : C:=chr(Compression.CharTable[N]);
-    ncRawChar : begin
-                  I:=GetNextNibble;
-                  C:=chr(I+GetNextNibble shl 4);
-                end;
-    ncRepChar : begin
-                  Cnt:=2+GetNextNibble;
-                  C:=GetNextChar{$ifdef FPC}(){$endif};
-                  for I:=1 to Cnt-1 do AddChar(C);
-                end;
-  end;
-  GetNextChar:=C;
-end;
-begin
-  OK:=Compression.CompType in[ctNone,ctNibble];
-  if OK then
-  case Compression.CompType of
-       ctNone   : ;
-       ctNibble :
-         begin
-           CurX:=0; CurY:=0; InLink:=false;
-           NewR.SClass:=0;
-           NewR.Size:=0;
-           NewR.Data:=nil;
-           SrcPtr:=0; DestPtr:=0;
-           while SrcPtr<(R.Size*2) do
-           begin
-             C:=GetNextChar;
-             AddChar(C);
-           end;
-           if InLink then AddChar(hscLineBreak);
-           TopicSize:=DestPtr;
-
-           CurX:=0; CurY:=0; InLink:=false;
-           NewR.SClass:=R.SClass;
-           NewR.Size:=Min(MaxHelpTopicSize,TopicSize);
-           GetMem(NewR.Data, NewR.Size);
-           SrcPtr:=0; DestPtr:=0;
-           while SrcPtr<(R.Size*2) do
-           begin
-             C:=GetNextChar;
-             AddChar(C);
-           end;
-           if InLink then AddChar(hscLineBreak);
-           DisposeRecord(R); R:=NewR;
-           if (R.Size>DestPtr) then
-           begin
-             P:=R.Data; GetMem(R.Data,DestPtr);
-             Move(P^,R.Data^,DestPtr); FreeMem(P,R.Size); R.Size:=DestPtr;
-           end;
-         end;
-  else OK:=false;
-  end;
-  ExtractTextRec:=OK;
-end;
-var OK: boolean;
-    TextR,KeyWR: TRecord;
-    I: sw_word;
-begin
-  OK:=T<>nil;
-  if OK and (T^.Text=nil) then
-  begin
-    LinkPosCount:=0; FillChar(LinkPos,Sizeof(LinkPos),0);
-    FillChar(TextR,SizeOf(TextR),0); FillChar(KeyWR,SizeOf(KeyWR),0);
-    F^.Seek(T^.FileOfs); OK:=F^.Status=stOK;
-    if OK then OK:=ReadRecord(TextR,true);
-    OK:=OK and (TextR.SClass=oa_rtText);
-    if OK then OK:=ReadRecord(KeyWR,true);
-    OK:=OK and (KeyWR.SClass=oa_rtKeyword);
-
-    if OK then
-    begin
-      case Version.FormatVersion of
-        TP55FormatVersion :
-           with THLPKeywordRecord55(KeyWR.Data^) do
-           begin
-             T^.LinkCount:=KeywordCount;
-             GetMem(T^.Links,T^.LinkSize);
-             if T^.LinkCount>0 then
-             for I:=0 to T^.LinkCount-1 do
-             with Keywords[I] do
-             begin
-               T^.Links^[I].Context:=KwContext;
-               T^.Links^[I].FileID:=ID;
-               Inc(LinkPosCount);
-               with LinkPos[LinkPosCount] do
-               begin
-                 A.Y:=PosY-1; B.Y:=PosY-1;
-                 A.X:=StartX-1; B.X:=EndX-1;
-               end;
-             end;
-           end;
-      else
-           with THLPKeywordRecord(KeyWR.Data^) do
-           begin
-             T^.LinkCount:=KeywordCount;
-             GetMem(T^.Links,T^.LinkSize);
-             if KeywordCount>0 then
-             for I:=0 to KeywordCount-1 do
-             begin
-               T^.Links^[I].Context:=Keywords[I].KwContext;
-               T^.Links^[I].FileID:=ID;
-             end;
-           end;
-      end;
-    end;
-
-    if OK then OK:=ExtractTextRec(TextR);
-    if OK then
-      if TextR.Size>0 then
-      begin
-        T^.Text:=TextR.Data; T^.TextSize:=TextR.Size;
-        TextR.Data:=nil; TextR.Size:=0;
-      end;
-
-    DisposeRecord(TextR); DisposeRecord(KeyWR);
-  end;
-  ReadTopic:=OK;
-end;
-
-destructor TOAHelpFile.Done;
-begin
-  if F<>nil then Dispose(F, Done);
-  inherited Done;
-end;
-
-constructor THelpFacility.Init;
-begin
-  inherited Init;
-  New(HelpFiles, Init(10,10));
-  IndexTabSize:=40;
-end;
-
-
-function THelpFacility.AddOAHelpFile(const FileName: string): boolean;
-var H: PHelpFile;
-begin
-  H:=New(POAHelpFile, Init(FileName, LastID+1));
-  AddOAHelpFile:=AddFile(H);
-end;
-
-function THelpFacility.AddHTMLHelpFile(const FileName, TOCEntry: string): boolean;
-var H: PHelpFile;
-begin
-  H:=New(PHTMLHelpFile, Init(FileName, LastID+1, TOCEntry));
-  AddHTMLHelpFile:=AddFile(H);;
-end;
-
-function THelpFacility.AddNGHelpFile(const FileName: string): boolean;
-var H: PHelpFile;
-begin
-  H:=New(PNGHelpFile, Init(FileName, LastID+1));
-  AddNGHelpFile:=AddFile(H);;
-end;
-
-function THelpFacility.AddOS2HelpFile(const FileName: string): boolean;
-var H: PHelpFile;
-begin
-  H:=New(POS2HelpFile, Init(FileName, LastID+1));
-  AddOS2HelpFile:=AddFile(H);;
-end;
-
-function THelpFacility.AddWinHelpFile(const FileName: string): boolean;
-var H: PHelpFile;
-begin
-  H:=New(PWinHelpFile, Init(FileName, LastID+1));
-  AddWinHelpFile:=AddFile(H);;
-end;
-
-function THelpFacility.AddHTMLIndexHelpFile(const FileName: string): boolean;
-var H: PHelpFile;
-begin
-  H:=New(PHTMLIndexHelpFile, Init(FileName, LastID+1));
-  AddHTMLIndexHelpFile:=AddFile(H);;
-end;
-
-function THelpFacility.AddFile(H: PHelpFile): boolean;
-begin
-  if H<>nil then
-    begin
-      HelpFiles^.Insert(H);
-      Inc(LastID);
-    end;
-  AddFile:=H<>nil;
-end;
-
-function THelpFacility.SearchTopicOwner(SourceFileID: word; Context: THelpCtx): PHelpFile;
-var P: PTopic;
-    HelpFile: PHelpFile;
-function Search(F: PHelpFile): boolean; {$ifndef FPC}far;{$endif}
-begin
-  P:=SearchTopicInHelpFile(F,Context); if P<>nil then HelpFile:=F;
-  Search:=P<>nil;
-end;
-begin
-  HelpFile:=nil;
-  if SourceFileID=0 then P:=nil else
-     begin
-       HelpFile:=SearchFile(SourceFileID);
-       P:=SearchTopicInHelpFile(HelpFile,Context);
-     end;
-  if P=nil then HelpFiles^.FirstThat(@Search);
-  if P=nil then HelpFile:=nil;
-  SearchTopicOwner:=HelpFile;
-end;
-
-function THelpFacility.LoadTopic(SourceFileID: word; Context: THelpCtx): PTopic;
-var P: PTopic;
-    H: PHelpFile;
-begin
-  if (SourceFileID=0) and (Context=0) then
-     P:=BuildIndexTopic else
-  begin
-    H:=SearchTopicOwner(SourceFileID,Context);
-    if (H=nil) then P:=nil else
-       P:=H^.LoadTopic(Context);
-  end;
-  LoadTopic:=P;
-end;
-
-function THelpFacility.TopicSearch(Keyword: string; var FileID: word; var Context: THelpCtx): boolean;
-function ScanHelpFile(H: PHelpFile): boolean; {$ifndef FPC}far;{$endif}
-function Search(P: PIndexEntry): boolean; {$ifndef FPC}far;{$endif}
-begin
-  Search:=copy(UpcaseStr(P^.Tag^),1,length(Keyword))=Keyword;
-end;
-var P: PIndexEntry;
-begin
-  H^.LoadIndex;
-  P:=H^.IndexEntries^.FirstThat(@Search);
-  if P<>nil then begin FileID:=H^.ID; Context:=P^.HelpCtx; end;
-  ScanHelpFile:=P<>nil;
-end;
-begin
-  Keyword:=UpcaseStr(Keyword);
-  TopicSearch:=HelpFiles^.FirstThat(@ScanHelpFile)<>nil;
-end;
-
-function THelpFacility.BuildIndexTopic: PTopic;
-var T: PTopic;
-    Keywords: PIndexEntryCollection;
-    Lines: PUnsortedStringCollection;
-procedure InsertKeywordsOfFile(H: PHelpFile); {$ifndef FPC}far;{$endif}
-function InsertKeywords(P: PIndexEntry): boolean; {$ifndef FPC}far;{$endif}
-begin
-  Keywords^.Insert(P);
-  InsertKeywords:=Keywords^.Count>=MaxCollectionSize;
-end;
-begin
-  H^.LoadIndex;
-  if Keywords^.Count<MaxCollectionSize then
-  H^.IndexEntries^.FirstThat(@InsertKeywords);
-end;
-procedure AddLine(S: string);
-begin
-  if S='' then S:=' ';
-  Lines^.Insert(NewStr(S));
-end;
-var Line: string;
-procedure FlushLine;
-begin
-  if Line<>'' then AddLine(Line); Line:='';
-end;
-var KWCount,NLFlag: sw_integer;
-    LastFirstChar: char;
-procedure NewSection(FirstChar: char);
-begin
-  if FirstChar<=#64 then FirstChar:=#32;
-  FlushLine;
-  AddLine('');
-  AddLine(FirstChar);
-  AddLine('');
-  LastFirstChar:=FirstChar;
-  NLFlag:=0;
-end;
-function FormatAlias(Alias: string): string;
-var StartP,EndP: sw_integer;
-begin
-  repeat
-    StartP:=Pos('  ',Alias);
-    if StartP>0 then
-    begin
-      EndP:=StartP;
-      while (EndP+1<=length(Alias)) and (Alias[EndP+1]=' ') do Inc(EndP);
-      Alias:=copy(Alias,1,StartP-1)+' | '+copy(Alias,EndP+1,High(Alias));
-    end;
-  until StartP=0;
-  if Assigned(HelpFacility) then
-    if length(Alias)>IndexTabSize-4 then
-      Alias:=Trim(copy(Alias,1,IndexTabSize-4-2))+'..';
-  FormatAlias:=Alias;
-end;
-procedure AddKeyword(KWS: string);
-begin
-  Inc(KWCount); if KWCount=1 then NLFlag:=0;
-  if (KWCount=1) or
-     ( (Upcase(KWS[1])<>LastFirstChar) and ( (LastFirstChar>#64) or (KWS[1]>#64) ) ) then
-     NewSection(Upcase(KWS[1]));
-
-  KWS:=FormatAlias(KWS);
-
-  if (NLFlag mod 2)=0
-     then Line:=' '+#2+KWS+#2
-     else begin
-            Line:=RExpand(Line,IndexTabSize)+#2+KWS+#2;
-            FlushLine;
-          end;
-  Inc(NLFlag);
-end;
-var KW: PIndexEntry;
-    I: sw_integer;
-begin
-  New(Keywords, Init(5000,5000));
-  HelpFiles^.ForEach(@InsertKeywordsOfFile);
-  New(Lines, Init((Keywords^.Count div 2)+100,1000));
-  T:=NewTopic(0,0,0,'',nil,0);
-  if HelpFiles^.Count=0 then
-    begin
-      AddLine('');
-      AddLine(' '+msg_nohelpfilesinstalled)
-    end else
-  begin
-    AddLine(' '+msg_helpindex);
-    KWCount:=0; Line:='';
-    T^.LinkCount:=Min(Keywords^.Count,MaxBytes div sizeof(T^.Links^[0])-1);
-    GetMem(T^.Links,T^.LinkSize);
-
-    for I:=0 to T^.LinkCount-1 do
-    begin
-      KW:=Keywords^.At(I);
-      AddKeyword(KW^.Tag^);
-      T^.Links^[I].Context:=longint(KW^.HelpCtx);
-      T^.Links^[I].FileID:=KW^.FileID;
-    end;
-    FlushLine;
-    AddLine('');
-  end;
-  RenderTopic(Lines,T);
-  Dispose(Lines, Done);
-  Keywords^.DeleteAll; Dispose(Keywords, Done);
-  BuildIndexTopic:=T;
-end;
-
-function THelpFacility.SearchFile(ID: byte): PHelpFile;
-function Match(P: PHelpFile): boolean; {$ifndef FPC}far;{$endif}
-begin
-  Match:=(P^.ID=ID);
-end;
-begin
-  SearchFile:=HelpFiles^.FirstThat(@Match);
-end;
-
-function THelpFacility.SearchTopicInHelpFile(F: PHelpFile; Context: THelpCtx): PTopic;
-var P: PTopic;
-begin
-  if F=nil then P:=nil else
-  P:=F^.SearchTopic(Context);
-  SearchTopicInHelpFile:=P;
-end;
-
-destructor THelpFacility.Done;
-begin
-  inherited Done;
-  Dispose(HelpFiles, Done);
-end;
-
-END.
-{
-  $Log$
-  Revision 1.5  2000-11-15 00:14:11  pierre
-   new merge
-
-  Revision 1.1.2.3  2000/11/14 09:08:51  marco
-   * First batch IDE renamefest
-
-  Revision 1.4  2000/11/13 17:37:43  pierre
-   merges from fixes branch
-
-  Revision 1.1.2.2  2000/11/12 19:48:20  hajny
-    * OS/2 implementation of GetDosTicks added
-
-  Revision 1.3  2000/11/11 23:05:31  hajny
-
-  Revision 1.2  2000/10/31 22:35:56  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/09/18 13:20:56  pierre
-   New bunch of Gabor changes
-
-  Revision 1.1  2000/07/13 09:48:37  michael
-  + Initial import
-
-  Revision 1.26  2000/07/03 08:54:54  pierre
-   * Some enhancements for WinHelp support by G	abor
-
-  Revision 1.25  2000/06/26 07:29:23  pierre
-   * new bunch of Gabor's changes
-
-  Revision 1.24  2000/06/22 09:07:14  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.23  2000/06/16 08:50:44  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.22  2000/05/31 20:42:02  pierre
-   * fixthe TRect problem by 'using' windows before objects
-
-  Revision 1.21  2000/05/30 07:18:33  pierre
-   + colors for HTML help by Gabor
-
-  Revision 1.20  2000/05/29 10:44:59  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.19  2000/04/25 08:42:35  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.18  2000/04/18 11:42:38  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.17  2000/02/07 11:47:25  pierre
-   * Remove 64Kb limitation for FPC by Gabor
-
-  Revision 1.16  2000/01/03 14:59:03  marco
-   * Fixed Linux code that got time of day. Removed Timezone parameter
-
-  Revision 1.15  1999/08/16 18:25:29  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.14  1999/07/18 16:26:42  florian
-    * IDE compiles with for Win32 and basic things are working
-
-  Revision 1.13  1999/04/13 10:47:51  daniel
-  * Fixed for Linux
-
-  Revision 1.12  1999/04/07 21:56:00  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.11  1999/03/16 12:38:16  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-  Revision 1.10  1999/03/08 14:58:19  peter
-    + prompt with dialogs for tools
-
-  Revision 1.9  1999/03/03 16:44:05  pierre
-   * TPH reader fix from Peter
-
-  Revision 1.8  1999/03/01 15:42:11  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.6  1999/02/20 15:18:35  peter
-    + ctrl-c capture with confirm dialog
-    + ascii table in the tools menu
-    + heapviewer
-    * empty file fixed
-    * fixed callback routines in fpdebug to have far for tp7
-
-  Revision 1.5  1999/02/19 15:43:22  peter
-    * compatibility fixes for FV
-
-  Revision 1.4  1999/02/18 13:44:37  peter
-    * search fixed
-    + backward search
-    * help fixes
-    * browser updates
-
-  Revision 1.3  1999/02/08 10:37:46  peter
-    + html helpviewer
-
-  Revision 1.2  1998/12/28 15:47:56  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.4  1998/12/22 10:39:55  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 1449
ide/text/whlpview.pas

@@ -1,1449 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Help display objects
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit WHlpView;
-
-interface
-
-uses
-  Objects,Drivers,Commands,Views,
-{$ifdef EDITORS}
-  Editors,
-{$else}
-  WEditor,WCEdit,
-{$endif}
-  WUtils,WHelp;
-
-{$IFNDEF EDITORS}
-type
-    TEditor = TCodeEditor; PEditor = PCodeEditor;
-{$ENDIF}
-
-const
-     cmPrevTopic         = 90;
-     HistorySize         = 30;
-
-     CHelpViewer         = #33#34#35#36;
-     CHelpFrame          = #37#37#38#38#39;
-
-     cmHelpFilesChanged  = 57340;
-
-type
-      PHelpLink = ^THelpLink;
-      THelpLink = record
-        Bounds   : TRect;
-        FileID   : longint;
-        Context  : THelpCtx;
-      end;
-
-      PHelpColorArea = ^THelpColorArea;
-      THelpColorArea = record
-        Color    : byte;
-        Bounds   : TRect;
-        AttrMask : byte;
-      end;
-
-      PHelpKeyword = ^THelpKeyword;
-      THelpKeyword = record
-        KWord    : PString;
-        Index    : sw_integer;
-      end;
-
-      PLinkCollection = ^TLinkCollection;
-      TLinkCollection = object(TCollection)
-        procedure FreeItem(Item: Pointer); virtual;
-      end;
-
-      PColorAreaCollection = ^TColorAreaCollection;
-      TColorAreaCollection = object(TCollection)
-        procedure FreeItem(Item: Pointer); virtual;
-      end;
-
-      PKeywordCollection = ^TKeywordCollection;
-      TKeywordCollection = object({TSorted}TCollection)
-        function  At(Index: sw_Integer): PHelpKeyword;
-        procedure FreeItem(Item: Pointer); virtual;
-        function  Compare(Key1, Key2: Pointer): sw_Integer; virtual;
-      end;
-
-{      TSearchRelation = (srEqual,srGreater,srLess,srGreatEqu,srLessEqu);
-
-      PAdvancedStringCollection = ^TAdvancedStringCollection;
-      TAdvancedStringCollection = object(TStringCollection)
-        function SearchItem(Key: pointer; Rel: TSearchRelation; var Index: integer): boolean; virtual;
-      end;}
-
-      PNamedMark = ^TNamedMark;
-      TNamedMark = object(TObject)
-        constructor Init(const AName: string; AX, AY: integer);
-        function    GetName: string;
-        destructor  Done; virtual;
-      private
-        Name: PString;
-        Pos: TPoint;
-      end;
-
-      PNamedMarkCollection = ^TNamedMarkCollection;
-      TNamedMarkCollection = object(TSortedCollection)
-        function At(Index: sw_Integer): PNamedMark;
-        function Compare(Key1, Key2: Pointer): sw_Integer; virtual;
-        function SearchMark(const Name: string): PNamedMark;
-        function GetMarkPos(const Name: string; var P: TPoint): boolean;
-        procedure Add(const Name: string; P: TPoint);
-      end;
-
-      PHelpTopic = ^THelpTopic;
-      THelpTopic = object(TObject)
-        Topic: PTopic;
-        Lines: PUnsortedStringCollection;
-        Links: PLinkCollection;
-        NamedMarks: PNamedMarkCollection;
-        ColorAreas: PColorAreaCollection;
-      public
-        constructor Init(ATopic: PTopic);
-        procedure   SetParams(AMargin, AWidth: sw_integer); virtual;
-        function    GetLineCount: sw_integer; virtual;
-        function    GetLineText(Line: sw_integer): string; virtual;
-        function    GetLinkCount: sw_integer; virtual;
-        procedure   GetLinkBounds(Index: sw_integer; var R: TRect); virtual;
-        function    GetLinkFileID(Index: sw_integer): word; virtual;
-        function    GetLinkContext(Index: sw_integer): THelpCtx; virtual;
-        function    GetColorAreaCount: sw_integer; virtual;
-        procedure   GetColorAreaBounds(Index: sw_integer; var R: TRect); virtual;
-        function    GetColorAreaColor(Index: sw_integer): word; virtual;
-        function    GetColorAreaMask(Index: sw_integer): word; virtual;
-        destructor  Done; virtual;
-      private
-        Width,Margin: sw_integer;
-{        StockItem: boolean;}
-        procedure  ReBuild;
-      end;
-
-      THelpHistoryEntry = record
-        Context_     : THelpCtx;
-        Delta_       : TPoint;
-        CurPos_      : TPoint;
-        CurLink_     : sw_integer;
-        FileID_      : word;
-      end;
-
-      PHelpViewer = ^THelpViewer;
-      THelpViewer = object(TEditor)
-        Margin: sw_integer;
-        HelpTopic: PHelpTopic;
-        CurLink: sw_integer;
-        constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-        procedure   ChangeBounds(var Bounds: TRect); virtual;
-        procedure   Draw; virtual;
-        procedure   HandleEvent(var Event: TEvent); virtual;
-        procedure   SetCurPtr(X,Y: sw_integer); virtual;
-        function    GetLineCount: sw_integer; virtual;
-        function    GetLine(LineNo: sw_integer): PCustomLine; virtual;
-        function    GetLineText(Line: sw_integer): string; virtual;
-        function    GetDisplayText(I: sw_integer): string; virtual;
-        function    GetLinkCount: sw_integer; virtual;
-        procedure   GetLinkBounds(Index: sw_integer; var R: TRect); virtual;
-        function    GetLinkFileID(Index: sw_integer): word; virtual;
-        function    GetLinkContext(Index: sw_integer): THelpCtx; virtual;
-        function    GetLinkText(Index: sw_integer): string; virtual;
-        function    GetColorAreaCount: sw_integer; virtual;
-        procedure   GetColorAreaBounds(Index: sw_integer; var R: TRect); virtual;
-        function    GetColorAreaColor(Index: sw_integer): word; virtual;
-        function    GetColorAreaMask(Index: sw_integer): word; virtual;
-        procedure   SelectNextLink(ANext: boolean); virtual;
-        procedure   SwitchToIndex; virtual;
-        procedure   SwitchToTopic(SourceFileID: word; Context: THelpCtx); virtual;
-        procedure   SetTopic(Topic: PTopic); virtual;
-        procedure   SetCurLink(Link: sw_integer); virtual;
-        procedure   SelectLink(Index: sw_integer); virtual;
-        procedure   PrevTopic; virtual;
-        procedure   RenderTopic; virtual;
-        procedure   Lookup(S: string); virtual;
-        function    GetPalette: PPalette; virtual;
-        constructor Load(var S: TStream);
-        procedure   Store(var S: TStream);
-        destructor  Done; virtual;
-      private
-        History    : array[0..HistorySize] of THelpHistoryEntry;
-        HistoryPtr : integer;
-        WordList   : PKeywordCollection;
-        Lookupword : string;
-        InLookUp   : boolean;
-        IndexTopic : PTopic;
-        IndexHelpTopic: PHelpTopic;
-        function    LinkContainsPoint(var R: TRect; var P: TPoint): boolean;
-        procedure   ISwitchToTopic(SourceFileID: word; Context: THelpCtx; RecordInHistory: boolean);
-        procedure   ISwitchToTopicPtr(P: PTopic; RecordInHistory: boolean);
-        procedure   BuildTopicWordList;
-      end;
-
-      PHelpFrame = ^THelpFrame;
-      THelpFrame = object(TFrame)
-        function GetPalette: PPalette; virtual;
-      end;
-
-      PHelpWindow = ^THelpWindow;
-      THelpWindow = object(TWindow)
-        HSB,VSB : PScrollBar;
-        HelpView: PHelpViewer;
-        HideOnClose: boolean;
-        constructor Init(var Bounds: TRect; ATitle: TTitleStr; ASourceFileID: word; AContext: THelpCtx; ANumber: Integer);
-        procedure   InitFrame; virtual;
-        procedure   InitScrollBars; virtual;
-        procedure   InitHelpView; virtual;
-        procedure   ShowIndex; virtual;
-        procedure   ShowTopic(SourceFileID: word; Context: THelpCtx); virtual;
-        procedure   HandleEvent(var Event: TEvent); virtual;
-        procedure   Close; virtual;
-        function    GetPalette: PPalette; virtual; { needs to be overriden }
-      end;
-
-implementation
-
-uses
-  Video,
-  WConsts;
-
-const CommentColor = Blue;
-
-function NewLink(FileID: longint; Topic: THelpCtx; StartP, EndP: TPoint): PHelpLink;
-var P: PHelpLink;
-begin
-  New(P); FillChar(P^, SizeOf(P^), 0);
-  P^.FileID:=FileID;
-  P^.Context:=Topic; P^.Bounds.A:=StartP; P^.Bounds.B:=EndP;
-  NewLink:=P;
-end;
-
-procedure DisposeLink(P: PHelpLink);
-begin
-  if P<>nil then Dispose(P);
-end;
-
-function NewColorArea(Color, AttrMask: byte; StartP, EndP: TPoint): PHelpColorArea;
-var P: PHelpColorArea;
-begin
-  New(P); FillChar(P^, SizeOf(P^), 0);
-  P^.Color:=Color; P^.AttrMask:=AttrMask;
-  P^.Bounds.A:=StartP; P^.Bounds.B:=EndP;
-  NewColorArea:=P;
-end;
-
-procedure DisposeColorArea(P: PHelpColorArea);
-begin
-  if P<>nil then Dispose(P);
-end;
-
-function NewKeyword(Index: sw_integer; KWord: string): PHelpKeyword;
-var P: PHelpKeyword;
-begin
-  New(P); FillChar(P^, SizeOf(P^), 0);
-  P^.Index:=Index; P^.KWord:=NewStr(KWord);
-  NewKeyword:=P;
-end;
-
-procedure DisposeKeyword(P: PHelpKeyword);
-begin
-  if P<>nil then
-  begin
-    if P^.KWord<>nil then DisposeStr(P^.KWord);
-    Dispose(P);
-  end;
-end;
-
-procedure TLinkCollection.FreeItem(Item: Pointer);
-begin
-  if Item<>nil then DisposeLink(Item);
-end;
-
-procedure TColorAreaCollection.FreeItem(Item: Pointer);
-begin
-  if Item<>nil then DisposeColorArea(Item);
-end;
-
-function TKeywordCollection.At(Index: sw_Integer): PHelpKeyword;
-begin
-  At:=inherited At(Index);
-end;
-
-procedure TKeywordCollection.FreeItem(Item: Pointer);
-begin
-  if Item<>nil then DisposeKeyword(Item);
-end;
-
-function TKeywordCollection.Compare(Key1, Key2: Pointer): sw_Integer;
-var R: sw_integer;
-    K1: PHelpKeyword absolute Key1;
-    K2: PHelpKeyword absolute Key2;
-    S1,S2: string;
-begin
-  S1:=UpcaseStr(K1^.KWord^); S2:=UpcaseStr(K2^.KWord^);
-  if S1<S2 then R:=-1 else
-  if S1>S2 then R:=1 else
-  R:=0;
-  Compare:=R;
-end;
-
-{function TAdvancedStringCollection.SearchItem(Key: pointer; Rel: TSearchRelation; var Index: sw_integer): boolean;
-var
-  L, H, I, C: sw_Integer;
-const resSmaller = -1; resEqual = 0; resGreater = 1;
-begin
-  Index:=-1;
-  case Rel of
-    srEqual  :
-      while (L <= H) and (Index=-1) do
-      begin
-        I := (L + H) shr 1;
-        C := Compare(KeyOf(Items^[I]), Key);
-        if C = resSmaller then L := I + 1 else
-        begin
-          H := I - 1;
-          if C = resEqual then
-          begin
-            if not Duplicates then L := I;
-            Index := L;
-          end;
-        end;
-      end;
-    srGreater  :
-      begin
-      end;
-    srLess     :
-      ;
-    srGreatEqu :
-      ;
-    srLessEqu  :
-      ;
-  else Exit;
-  end;
-  Search:=Index<>-1;
-end;}
-
-constructor TNamedMark.Init(const AName: string; AX, AY: integer);
-begin
-  inherited Init;
-  Name:=NewStr(AName);
-  Pos.X:=AX; Pos.Y:=AY;
-end;
-
-function TNamedMark.GetName: string;
-begin
-  GetName:=GetStr(Name);
-end;
-
-destructor TNamedMark.Done;
-begin
-  if Assigned(Name) then DisposeStr(Name); Name:=nil;
-  inherited Done;
-end;
-
-function TNamedMarkCollection.At(Index: sw_Integer): PNamedMark;
-begin
-  At:=inherited At(Index);
-end;
-
-function TNamedMarkCollection.Compare(Key1, Key2: Pointer): sw_Integer;
-var K1: PNamedMark absolute Key1;
-    K2: PNamedMark absolute Key2;
-    R: integer;
-    N1,N2: string;
-begin
-  N1:=UpcaseStr(K1^.GetName); N2:=UpcaseStr(K2^.GetName);
-  if N1<N2 then R:=-1 else
-  if N1>N2 then R:= 1 else
-  R:=0;
-  Compare:=R;
-end;
-
-function TNamedMarkCollection.SearchMark(const Name: string): PNamedMark;
-var M,P: PNamedMark;
-    I: sw_integer;
-begin
-  New(M, Init(Name,0,0));
-  if Search(M,I)=false then P:=nil else
-    P:=At(I);
-  Dispose(M, Done);
-  SearchMark:=P;
-end;
-
-function TNamedMarkCollection.GetMarkPos(const Name: string; var P: TPoint): boolean;
-var M: PNamedMark;
-begin
-  M:=SearchMark(Name);
-  if Assigned(M) then
-    P:=M^.Pos;
-  GetMarkPos:=Assigned(M);
-end;
-
-procedure TNamedMarkCollection.Add(const Name: string; P: TPoint);
-begin
-  Insert(New(PNamedMark, Init(Name, P.X, P.Y)));
-end;
-
-constructor THelpTopic.Init(ATopic: PTopic);
-begin
-  inherited Init;
-  Topic:=ATopic;
-  New(Lines, Init(100,100)); New(Links, Init(50,50)); New(ColorAreas, Init(50,50));
-  New(NamedMarks, Init(10,10));
-end;
-
-procedure THelpTopic.SetParams(AMargin, AWidth: sw_integer);
-begin
-  if Width<>AWidth then
-  begin
-    Width:=AWidth; Margin:=AMargin;
-    ReBuild;
-  end;
-end;
-
-procedure THelpTopic.ReBuild;
-var TextPos,LinkNo,NamedMarkNo: sw_word;
-    Line,CurWord: string;
-    C: char;
-    InLink,InCodeArea,InColorArea: boolean;
-    LinkStart,LinkEnd,CodeAreaStart,CodeAreaEnd: TPoint;
-    ColorAreaStart,ColorAreaEnd: TPoint;
-    ColorAreaType: (atText,atFull);
-    CurPos: TPoint;
-    ZeroLevel: sw_integer;
-    LineStart,NextLineStart: sw_integer;
-    LineAlign : (laLeft,laCenter,laRight);
-    FirstLink,LastLink: sw_integer;
-    AreaColor: word;
-    NextByte: (nbNormal,nbAreaColor);
-procedure ClearLine;
-begin
-  Line:='';
-end;
-procedure AddWord(TheWord: string); forward;
-procedure NextLine;
-var P: sw_integer;
-    I,Delta: sw_integer;
-begin
-  Line:=CharStr(' ',Margin)+Line;
-  repeat
-    P:=Pos(#255,Line);
-    if P>0 then Line[P]:=#32;
-  until P=0;
-  while copy(Line,length(Line),1)=' ' do Delete(Line,length(Line),1);
-  Delta:=0;
-  if Line<>'' then
-  case LineAlign of
-    laLeft    : ;
-    laCenter  : if Margin+length(Line)+Margin<Width then
-                  begin
-                    Delta:=(Width-(Margin+length(Line)+Margin)) div 2;
-                    Line:=CharStr(' ',Delta)+Line;
-                  end;
-    laRight   : if Margin+length(Line)+Margin<Width then
-                  begin
-                    Delta:=Width-(Margin+length(Line)+Margin);
-                    Line:=CharStr(' ',Delta)+Line;
-                  end;
-  end;
-  if (Delta>0) and (FirstLink<>LastLink) then
-  for I:=FirstLink to LastLink-1 do
-    with PHelpLink(Links^.At(I))^ do
-      Bounds.Move(Delta,0);
-  if Line='' then Line:=' ';
-  Lines^.Insert(NewStr(Line));
-  ClearLine;
-  LineStart:=NextLineStart;
-  CurPos.X:=Margin+LineStart; Line:=CharStr(#255,LineStart); Inc(CurPos.Y);
-  if InLink then LinkStart:=CurPos;
-  FirstLink:=LastLink;
-end;
-procedure FlushLine;
-var W: string;
-begin
-  if CurWord<>'' then begin W:=CurWord; CurWord:=''; AddWord(W); end;
-  NextLine;
-end;
-procedure AddWord(TheWord: string);
-var W: string;
-begin
-  W:=TheWord;
-  while (length(W)>0) and (W[length(W)] in [' ',#255]) do
-     Delete(W,length(W),1);
-  if (copy(Line+TheWord,1,1)<>' ') then
-    if (Line<>'') and (Margin+length(Line)+length(W)+Margin>Width) then
-       NextLine;
-  Line:=Line+TheWord;
-  CurPos.X:=Margin+length(Line);
-end;
-procedure CheckZeroLevel;
-begin
-  if ZeroLevel<>0 then
-     begin
-       if CurWord<>'' then AddWord(CurWord+' ');
-       CurWord:='';
-       ZeroLevel:=0;
-     end;
-end;
-procedure EndColorArea;
-var Mask: word;
-begin
-  if ColorAreaType=atText then Mask:=$f0 else Mask:=$00;
-  if CurWord<>'' then AddWord(CurWord); CurWord:='';
-  ColorAreaEnd:=CurPos; Dec(ColorAreaEnd.X);
-  ColorAreas^.Insert(NewColorArea(AreaColor,Mask,ColorAreaStart,ColorAreaEnd));
-  InColorArea:=false; AreaColor:=0;
-end;
-begin
-  Lines^.FreeAll; Links^.FreeAll; NamedMarks^.FreeAll; ColorAreas^.FreeAll;
-  if Topic=nil then Lines^.Insert(NewStr(msg_nohelpavailabelforthistopic)) else
-  begin
-    LineStart:=0; NextLineStart:=0;
-    TextPos:=0; ClearLine; CurWord:=''; Line:='';
-    CurPos.X:=Margin+LineStart; CurPos.Y:=0; LinkNo:=0;
-    NamedMarkNo:=0;
-    InLink:=false; InCodeArea:=false; InColorArea:=false; ZeroLevel:=0;
-    LineAlign:=laLeft;
-    FirstLink:=0; LastLink:=0; NextByte:=nbNormal;
-    while (TextPos<Topic^.TextSize) do
-    begin
-      C:=chr(PByteArray(Topic^.Text)^[TextPos]);
-      case NextByte of
-        nbAreaColor :
-          begin
-            AreaColor:=ord(C);
-            NextByte:=nbNormal;
-          end;
-        nbNormal :
-          begin
-            case C of
-              hscLineBreak :
-                  {if ZeroLevel=0 then ZeroLevel:=1 else
-                      begin FlushLine; FlushLine; ZeroLevel:=0; end;}
-                   if InLink then CurWord:=CurWord+' ' else
-                     begin
-                       NextLineStart:=0;
-                       FlushLine;
-                       LineStart:=0;
-                       LineAlign:=laLeft;
-                     end;
-              #1 : Break;
-              hscLink :
-                   begin
-                     CheckZeroLevel;
-                     if InLink=false then
-                        begin LinkStart:=CurPos; InLink:=true; end else
-                      begin
-                        if CurWord<>'' then AddWord(CurWord); CurWord:='';
-                        LinkEnd:=CurPos; Dec(LinkEnd.X);
-                        if Topic^.Links<>nil then
-                          begin
-                            Inc(LastLink);
-                            if LinkNo<Topic^.LinkCount then
-                            Links^.Insert(NewLink(Topic^.Links^[LinkNo].FileID,
-                              Topic^.Links^[LinkNo].Context,LinkStart,LinkEnd));
-                            Inc(LinkNo);
-                          end;
-                        InLink:=false;
-                      end;
-                    end;
-              hscLineStart :
-                   begin
-                     NextLineStart:=length(Line)+length(CurWord);
-      {               LineStart:=LineStart+(NextLineStart-LineStart);}
-                   end;
-              hscCode :
-                   begin
-                     if InCodeArea=false then
-                        CodeAreaStart:=CurPos else
-                      begin
-                        if CurWord<>'' then AddWord(CurWord); CurWord:='';
-                        CodeAreaEnd:=CurPos; Dec(CodeAreaEnd.X);
-                        ColorAreas^.Insert(NewColorArea(CommentColor,$f0,CodeAreaStart,CodeAreaEnd));
-                      end;
-                     InCodeArea:=not InCodeArea;
-                   end;
-              hscCenter :
-                   LineAlign:=laCenter;
-              hscRight  :
-                   LineAlign:=laCenter;
-              hscNamedMark :
-                   begin
-                     if NamedMarkNo<Topic^.NamedMarks^.Count then
-                       NamedMarks^.Add(GetStr(Topic^.NamedMarks^.At(NamedMarkNo)),CurPos);
-                     Inc(NamedMarkNo);
-                   end;
-              hscTextAttr,hscTextColor :
-                   begin
-                     if InColorArea then
-                       EndColorArea;
-                     if C=hscTextAttr then
-                       ColorAreaType:=atFull
-                     else
-                       ColorAreaType:=atText;
-                     NextByte:=nbAreaColor;
-                     ColorAreaStart:=CurPos;
-                     InColorArea:=true;
-                   end;
-              hscNormText :
-                   begin
-                     if InColorArea then
-                       EndColorArea;
-                   end;
-              #32: if InLink then CurWord:=CurWord+C else
-                      begin CheckZeroLevel; AddWord(CurWord+C); CurWord:=''; end;
-            else begin CheckZeroLevel; CurWord:=CurWord+C; end;
-            end;
-          end;
-      end;
-      CurPos.X:=Margin+length(Line)+length(CurWord);
-      Inc(TextPos);
-    end;
-    if (Line<>'') or (CurWord<>'') then FlushLine;
-  end;
-end;
-
-function THelpTopic.GetLineCount: sw_integer;
-begin
-  GetLineCount:=Lines^.Count;
-end;
-
-function THelpTopic.GetLineText(Line: sw_integer): string;
-var S: string;
-begin
-  if Line<GetLineCount then S:=PString(Lines^.At(Line))^ else S:='';
-  GetLineText:=S;
-end;
-
-function THelpTopic.GetLinkCount: sw_integer;
-begin
-  GetLinkCount:=Links^.Count;
-end;
-
-procedure THelpTopic.GetLinkBounds(Index: sw_integer; var R: TRect);
-var P: PHelpLink;
-begin
-  P:=Links^.At(Index);
-  R:=P^.Bounds;
-end;
-
-function THelpTopic.GetLinkFileID(Index: sw_integer): word;
-var P: PHelpLink;
-begin
-  P:=Links^.At(Index);
-  GetLinkFileID:=P^.FileID;
-end;
-
-function THelpTopic.GetLinkContext(Index: sw_integer): THelpCtx;
-var P: PHelpLink;
-begin
-  P:=Links^.At(Index);
-  GetLinkContext:=P^.Context;
-end;
-
-function THelpTopic.GetColorAreaCount: sw_integer;
-begin
-  GetColorAreaCount:=ColorAreas^.Count;
-end;
-
-procedure THelpTopic.GetColorAreaBounds(Index: sw_integer; var R: TRect);
-var P: PHelpColorArea;
-begin
-  P:=ColorAreas^.At(Index);
-  R:=P^.Bounds;
-end;
-
-function THelpTopic.GetColorAreaColor(Index: sw_integer): word;
-var P: PHelpColorArea;
-begin
-  P:=ColorAreas^.At(Index);
-  GetColorAreaColor:=P^.Color;
-end;
-
-function THelpTopic.GetColorAreaMask(Index: sw_integer): word;
-var P: PHelpColorArea;
-begin
-  P:=ColorAreas^.At(Index);
-  GetColorAreaMask:=P^.AttrMask;
-end;
-
-destructor THelpTopic.Done;
-begin
-  inherited Done;
-  Dispose(Lines, Done); Dispose(Links, Done); Dispose(ColorAreas, Done);
-  Dispose(NamedMarks, Done);
-  if (Topic<>nil) then DisposeTopic(Topic);
-end;
-
-constructor THelpViewer.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
-begin
-  inherited Init(Bounds, AHScrollBar, AVScrollBar, nil, nil);
-  Flags:=efInsertMode; ReadOnly:=true;
-  New(WordList, Init(50,50));
-  Margin:=1; CurLink:=-1;
-end;
-
-procedure THelpViewer.ChangeBounds(var Bounds: TRect);
-begin
-  if Owner<>nil then Owner^.Lock;
-  inherited ChangeBounds(Bounds);
-  if (HelpTopic<>nil) and (HelpTopic^.Topic<>nil) and
-     (HelpTopic^.Topic^.FileID<>0) then RenderTopic;
-  if Owner<>nil then Owner^.UnLock;
-end;
-
-procedure THelpViewer.RenderTopic;
-begin
-  if HelpTopic<>nil then
-    HelpTopic^.SetParams(Margin,Size.X);
-{$ifndef EDITORS}
-  SetLimit(255,GetLineCount);
-{$endif}
-  DrawView;
-end;
-
-function THelpViewer.LinkContainsPoint(var R: TRect; var P: TPoint): boolean;
-var OK: boolean;
-begin
-  if (R.A.Y=R.B.Y) then
-    OK:= (P.Y=R.A.Y) and (R.A.X<=P.X) and (P.X<=R.B.X) else
-    OK:=
-    ( (R.A.Y=P.Y) and (R.A.X<=P.X) ) or
-    ( (R.A.Y<P.Y) and (P.Y<R.B.Y)  ) or
-    ( (R.B.Y=P.Y) and (P.X<=R.B.X) );
-  LinkContainsPoint:=OK;
-end;
-
-procedure THelpViewer.SetCurPtr(X,Y: sw_integer);
-var OldCurLink,I: sw_integer;
-    OldPos,P: TPoint;
-    R: TRect;
-begin
-  OldPos:=CurPos;
-  OldCurLink:=CurLink;
-  inherited SetCurPtr(X,Y);
-  CurLink:=-1;
-  P:=CurPos;
-  for I:=0 to GetLinkCount-1 do
-  begin
-    GetLinkBounds(I,R);
-    if LinkContainsPoint(R,P) then
-       begin CurLink:=I; Break; end;
-  end;
-  if OldCurLink<>CurLink then DrawView;
-  if ((OldPos.X<>CurPos.X) or (OldPos.Y<>CurPos.Y)) and (InLookup=false) then
-     Lookup('');
-end;
-
-function THelpViewer.GetLineCount: sw_integer;
-var Count: sw_integer;
-begin
-  if HelpTopic=nil then Count:=0 else Count:=HelpTopic^.GetLineCount;
-  GetLineCount:=Count;
-end;
-
-function THelpViewer.GetLine(LineNo: sw_integer): PCustomLine;
-begin
-  {Abstract; used in wcedit unit ! }
-  GetLine:=nil;
-end;
-function THelpViewer.GetDisplayText(I: sw_integer): string;
-begin
-  GetDisplayText:=ExtractTabs(GetLineText(I),DefaultTabSize);
-end;
-
-function THelpViewer.GetLineText(Line: sw_integer): string;
-var S: string;
-begin
-  if HelpTopic=nil then S:='' else S:=HelpTopic^.GetLineText(Line);
-  GetLineText:=S;
-end;
-
-function THelpViewer.GetLinkCount: sw_integer;
-var Count: sw_integer;
-begin
-  if HelpTopic=nil then Count:=0 else Count:=HelpTopic^.GetLinkCount;
-  GetLinkCount:=Count;
-end;
-
-procedure THelpViewer.GetLinkBounds(Index: sw_integer; var R: TRect);
-begin
-  HelpTopic^.GetLinkBounds(Index,R);
-end;
-
-function THelpViewer.GetLinkFileID(Index: sw_integer): word;
-begin
-  GetLinkFileID:=HelpTopic^.GetLinkFileID(Index);
-end;
-
-function THelpViewer.GetLinkContext(Index: sw_integer): THelpCtx;
-begin
-  GetLinkContext:=HelpTopic^.GetLinkContext(Index);
-end;
-
-function THelpViewer.GetLinkText(Index: sw_integer): string;
-var S: string;
-    R: TRect;
-    Y,StartX,EndX: sw_integer;
-begin
-  S:=''; GetLinkBounds(Index,R);
-  Y:=R.A.Y;
-  while (Y<=R.B.Y) do
-  begin
-    if Y=R.A.Y then StartX:=R.A.X else StartX:=Margin;
-    if Y=R.B.Y then EndX:=R.B.X else EndX:=High(S);
-    S:=S+copy(GetLineText(Y),StartX+1,EndX-StartX+1);
-    Inc(Y);
-  end;
-  GetLinkText:=S;
-end;
-
-function THelpViewer.GetColorAreaCount: sw_integer;
-var Count: sw_integer;
-begin
-  if HelpTopic=nil then Count:=0 else Count:=HelpTopic^.GetColorAreaCount;
-  GetColorAreaCount:=Count;
-end;
-
-procedure THelpViewer.GetColorAreaBounds(Index: sw_integer; var R: TRect);
-begin
-  HelpTopic^.GetColorAreaBounds(Index,R);
-end;
-
-function THelpViewer.GetColorAreaColor(Index: sw_integer): word;
-begin
-  GetColorAreaColor:=HelpTopic^.GetColorAreaColor(Index);
-end;
-
-function THelpViewer.GetColorAreaMask(Index: sw_integer): word;
-begin
-  GetColorAreaMask:=HelpTopic^.GetColorAreaMask(Index);
-end;
-
-procedure THelpViewer.SelectNextLink(ANext: boolean);
-var I,Link: sw_integer;
-    R: TRect;
-begin
-  if HelpTopic=nil then Exit;
-  Link:=CurLink;
-  if Link<>-1 then
-  begin
-    if ANext then
-       begin Inc(Link); if Link>=GetLinkCount then Link:=0; end else
-       begin Dec(Link); if Link=-1 then Link:=GetLinkCount-1; end;
-  end else
-  for I:=0 to GetLinkCount-1 do
-  begin
-    GetLinkBounds(I,R);
-    if (R.A.Y>CurPos.Y) or
-       (R.A.Y=CurPos.Y) and (R.A.X>CurPos.X) then
-       begin Link:=I; Break; end;
-  end;
-  if (Link=-1) and (GetLinkCount>0) then
-     if ANext then Link:=0
-              else Link:=GetLinkCount-1;
-  SetCurLink(Link);
-end;
-
-procedure THelpViewer.SetCurLink(Link: sw_integer);
-var R: TRect;
-begin
-  if Link<>-1 then
-  begin
-    GetLinkBounds(Link,R);
-    SetCurPtr(R.A.X,R.A.Y);
-    TrackCursor(true);
-  end;
-end;
-
-procedure THelpViewer.SwitchToIndex;
-begin
-  if IndexTopic=nil then
-     IndexTopic:=HelpFacility^.BuildIndexTopic;
-  ISwitchToTopicPtr(IndexTopic,true);
-end;
-
-procedure THelpViewer.SwitchToTopic(SourceFileID: word; Context: THelpCtx);
-begin
-  ISwitchToTopic(SourceFileID,Context,true);
-end;
-
-procedure THelpViewer.ISwitchToTopic(SourceFileID: word; Context: THelpCtx; RecordInHistory: boolean);
-var P: PTopic;
-begin
-  if HelpFacility=nil then P:=nil else
-    if (SourceFileID=0) and (Context=0) and (HelpTopic<>nil) then
-       P:=IndexTopic else
-     P:=HelpFacility^.LoadTopic(SourceFileID, Context);
-  ISwitchToTopicPtr(P,RecordInHistory);
-end;
-
-procedure THelpViewer.ISwitchToTopicPtr(P: PTopic; RecordInHistory: boolean);
-var HistoryFull: boolean;
-begin
-  if (P<>nil) and RecordInHistory and (HelpTopic<>nil) then
-  begin
-    HistoryFull:=HistoryPtr>=HistorySize;
-    if HistoryFull then
-       Move(History[1],History[0],SizeOf(History)-SizeOf(History[0]));
-    with History[HistoryPtr] do
-    begin
-      {SourceTopic_:=SourceTopic; }Context_:=HelpTopic^.Topic^.HelpCtx;
-      FileID_:=HelpTopic^.Topic^.FileID;
-      Delta_:=Delta; CurPos_:=CurPos; CurLink_:=CurLink;
-    end;
-    if HistoryFull=false then Inc(HistoryPtr);
-  end;
-
-  if Owner<>nil then Owner^.Lock;
-  SetTopic(P);
-  DrawView;
-  if Owner<>nil then Owner^.UnLock;
-end;
-
-procedure THelpViewer.PrevTopic;
-begin
-  if HistoryPtr>0 then
-  begin
-    if Owner<>nil then Owner^.Lock;
-    Dec(HistoryPtr);
-    with History[HistoryPtr] do
-    begin
-      ISwitchToTopic(FileID_,Context_,false);
-      ScrollTo(Delta_.X,Delta_.Y);
-      SetCurPtr(CurPos_.X,CurPos_.Y);
-      TrackCursor(false);
-      if CurLink<>CurLink_ then SetCurLink(CurLink_);
-    end;
-    DrawView;
-    if Owner<>nil then Owner^.UnLock;
-  end;
-end;
-
-procedure THelpViewer.SetTopic(Topic: PTopic);
-var Bookmark: string;
-    P: TPoint;
-begin
-  CurLink:=-1;
-  if (HelpTopic=nil) or (Topic<>HelpTopic^.Topic) then
- begin
-  if (HelpTopic<>nil) and (HelpTopic<>IndexHelpTopic) then
-     Dispose(HelpTopic, Done);
-  HelpTopic:=nil;
-  if Topic<>nil then
-     begin
-       if (Topic=IndexTopic) and (IndexHelpTopic<>nil) then
-          HelpTopic:=IndexHelpTopic else
-       New(HelpTopic, Init(Topic));
-       if Topic=IndexTopic then
-          IndexHelpTopic:=HelpTopic;
-     end;
- end;
-  if Owner<>nil then Owner^.Lock;
-  SetCurPtr(0,0); TrackCursor(false);
-  RenderTopic;
-  BuildTopicWordList;
-  Lookup('');
-  if Assigned(Topic) then
-  if Topic^.StartNamedMark>0 then
-   if Topic^.NamedMarks^.Count>=Topic^.StartNamedMark then
-    begin
-      Bookmark:=GetStr(Topic^.NamedMarks^.At(Topic^.StartNamedMark-1));
-      if HelpTopic^.NamedMarks^.GetMarkPos(Bookmark,P) then
-      begin
-        SetCurPtr(P.X,P.Y);
-        ScrollTo(0,Max(0,P.Y-1));
-      end;
-    end;
-  SetSelection(CurPos,CurPos);
-  DrawView;
-  if Owner<>nil then Owner^.UnLock;
-end;
-
-procedure THelpViewer.BuildTopicWordList;
-var I: sw_integer;
-begin
-  WordList^.FreeAll;
-  for I:=0 to GetLinkCount-1 do
-    WordList^.Insert(NewKeyword(I,Trim(GetLinkText(I))));
-end;
-
-procedure THelpViewer.Lookup(S: string);
-var Index, I: Sw_integer;
-    W: string;
-    OldLookup: string;
-    R: TRect;
-    P: PHelpKeyword;
-begin
-  InLookup:=true;
-  OldLookup:=LookupWord;
-  S:=UpcaseStr(S);
-  Index:=-1;
-  I:=0; {J:=0;
-  while (J<GetLinkCount) do
-    begin
-      GetLinkBounds(J,R);
-      if (R.A.Y<CurPos.Y) or ((R.A.Y=CurPos.Y) and (R.B.X<CurPos.X))
-         then Inc(J) else
-           begin I:=J; Break; end;
-    end;}
-  if S='' then LookupWord:='' else
-  begin
-    while (Index=-1) and (I<WordList^.Count) do
-      begin
-        P:=WordList^.At(I);
-        if P^.KWord<>nil then
-          begin
-            W:=UpcaseStr(Trim(P^.KWord^));
-            if copy(W,1,length(S))=S then Index:=I;
-          end;
-{        if W>S then Break else}
-        Inc(I);
-      end;
-    if Index<>-1 then
-    begin
-      W:=Trim(WordList^.At(Index)^.KWord^);
-      LookupWord:=copy(W,1,length(S));
-    end;
-  end;
-
-  if LookupWord<>OldLookup then
-  begin
-    if Index=-1 then SetCurLink(CurLink) else
-    begin
-      if Owner<>nil then Owner^.Lock;
-      P:=WordList^.At(Index);
-      S:=GetLinkText(P^.Index);
-      I:=Pos(LookupWord,S); if I=0 then I:=1;
-      GetLinkBounds(P^.Index,R);
-      SetCurPtr(R.A.X+(I-1)+length(Lookupword),R.A.Y);
-      CurLink:=P^.Index; DrawView;
-      TrackCursor(true);
-      if Owner<>nil then Owner^.UnLock;
-    end;
-  end;
-  InLookup:=false;
-end;
-
-procedure THelpViewer.SelectLink(Index: sw_integer);
-var ID: word;
-    Ctx: THelpCtx;
-begin
-  if Index=-1 then Exit;
-  if HelpTopic=nil then begin ID:=0; Ctx:=0; end else
-     begin
-       ID:=GetLinkFileID(Index);
-       Ctx:=GetLinkContext(Index);
-     end;
-  SwitchToTopic(ID,Ctx);
-end;
-
-procedure THelpViewer.HandleEvent(var Event: TEvent);
-var DontClear: boolean;
-procedure GetMousePos(var P: TPoint);
-begin
-  MakeLocal(Event.Where,P);
-  Inc(P.X,Delta.X); Inc(P.Y,Delta.Y);
-end;
-begin
-  case Event.What of
-    evMouseDown :
-      if MouseInView(Event.Where) then
-      if (Event.Buttons=mbLeftButton) and (Event.Double) then
-      begin
-        inherited HandleEvent(Event);
-        if CurLink<>-1 then
-           SelectLink(CurLink);
-      end;
-    evBroadcast :
-      case Event.Command of
-        cmHelpFilesChanged :
-          begin
-            if HelpTopic=IndexHelpTopic then HelpTopic:=nil;
-            IndexTopic:=nil;
-            if IndexHelpTopic<>nil then Dispose(IndexHelpTopic, Done);
-            IndexHelpTopic:=nil;
-          end;
-      end;
-    evCommand :
-      begin
-        DontClear:=false;
-        case Event.Command of
-          cmPrevTopic :
-            PrevTopic;
-        else DontClear:=true;
-        end;
-        if DontClear=false then ClearEvent(Event);
-      end;
-    evKeyDown :
-      begin
-        DontClear:=false;
-        case Event.KeyCode of
-          kbTab :
-            SelectNextLink(true);
-          kbShiftTab :
-            begin NoSelect:=true; SelectNextLink(false); NoSelect:=false; end;
-          kbEnter :
-            if CurLink<>-1 then
-              SelectLink(CurLink);
-        else
-          case Event.CharCode of
-             #32..#255 :
-               begin NoSelect:=true; Lookup(LookupWord+Event.CharCode); NoSelect:=false; end;
-          else DontClear:=true;
-          end;
-        end;
-        TrackCursor(false);
-        if DontClear=false then ClearEvent(Event);
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure THelpViewer.Draw;
-var NormalColor, LinkColor,
-    SelectColor, SelectionColor: word;
-    B: TDrawBuffer;
-    DX,DY,X,Y,I,MinX,MaxX,ScreenX: sw_integer;
-    LastLinkDrawn,LastColorAreaDrawn: sw_integer;
-    S: string;
-    R: TRect;
-{$ifndef EDITORS}
-    SelR : TRect;
-{$endif}
-    C,Mask: word;
-    CurP: TPoint;
-    ANDSB,ORSB: word;
-begin
-  if LockFlag>0 then
-    begin
-      DrawCalled:=true;
-      Exit;
-    end;
-  DrawCalled:=false;
-
-
-  NormalColor:=GetColor(1); LinkColor:=GetColor(2);
-  SelectColor:=GetColor(3); SelectionColor:=GetColor(4);
-{$ifndef EDITORS}
-  SelR.A:=SelStart; SelR.B:=SelEnd;
-{$endif}
-  LastLinkDrawn:=0; LastColorAreaDrawn:=0;
-  for DY:=0 to Size.Y-1 do
-  begin
-    Y:=Delta.Y+DY;
-    MoveChar(B,' ',NormalColor,Size.X);
-    if Y<GetLineCount then
-    begin
-      S:=copy(GetLineText(Y),Delta.X+1,High(S));
-      S:=copy(S,1,MaxViewWidth);
-      MoveStr(B,S,NormalColor);
-
-      for I:=LastColorAreaDrawn to GetColorAreaCount-1 do
-      begin
-        GetColorAreaBounds(I,R);
-        if R.A.Y>Y then Break;
-        LastColorAreaDrawn:=I;
-        if Y=R.B.Y then MaxX:=R.B.X else MaxX:=(length(S)-1);
-        if Y=R.A.Y then MinX:=R.A.X else MinX:=0;
-        if (R.A.Y<=Y) and (Y<=R.B.Y) then
-        begin
-          C:=GetColorAreaColor(I);
-          Mask:=GetColorAreaMask(I);
-          for DX:=MinX to MaxX do
-          begin
-            X:=DX;
-            ScreenX:=X-(Delta.X);
-            if (ScreenX>0) and (ScreenX<=High(B)) then
-            begin
-{              CurP.X:=X; CurP.Y:=Y;
-              if LinkAreaContainsPoint(R,CurP) then}
-(*              B[ScreenX]:=(B[ScreenX] and $f0ff) or (C shl 8);*)
-              ANDSB:=(Mask shl 8)+$ff;
-              ORSB:=(C shl 8);
-              B[ScreenX]:=(B[ScreenX] and ANDSB) or ORSB;
-            end;
-          end;
-        end;
-      end;
-
-      for I:=LastLinkDrawn to GetLinkCount-1 do
-      begin
-        GetLinkBounds(I,R);
-        if R.A.Y>Y then Break;
-        LastLinkDrawn:=I;
-        if Y=R.B.Y then MaxX:=R.B.X else MaxX:=(length(S)-1);
-        if Y=R.A.Y then MinX:=R.A.X else MinX:=0;
-        if (R.A.Y<=Y) and (Y<=R.B.Y) then
-          for DX:=MinX to MaxX do
-          begin
-            X:=DX;
-            ScreenX:=X-(Delta.X);
-            if (ScreenX>=0) and (ScreenX<=High(B)) then
-            begin
-              CurP.X:=X; CurP.Y:=Y;
-              if LinkContainsPoint(R,CurP) then
-                if I=CurLink then C:=SelectColor else C:=LinkColor;
-              B[ScreenX]:=(B[ScreenX] and $ff) or (C shl 8);
-            end;
-          end;
-      end;
-
-{$ifndef EDITORS}
-      if ((SelR.A.X<>SelR.B.X) or (SelR.A.Y<>SelR.B.Y)) and (SelR.A.Y<=Y) and (Y<=SelR.B.Y) then
-      begin
-        if Y=SelR.A.Y then MinX:=SelR.A.X else MinX:=0;
-        if Y=SelR.B.Y then MaxX:=SelR.B.X-1 else MaxX:=High(string);
-        for DX:=MinX to MaxX do
-        begin
-          X:=DX;
-          ScreenX:=X-(Delta.X);
-          if (ScreenX>=0) and (ScreenX<High(B)) then
-            B[ScreenX]:=(B[ScreenX] and $0fff) or ((SelectionColor and $f0) shl 8);
-        end;
-      end;
-{$endif}
-
-    end;
-    WriteLine(0,DY,Size.X,1,B);
-  end;
-  DrawCursor;
-end;
-
-function THelpViewer.GetPalette: PPalette;
-const P: string[length(CHelpViewer)] = CHelpViewer;
-begin
-  GetPalette:=@P;
-end;
-
-constructor THelpViewer.Load(var S: TStream);
-begin
-  inherited Load(S);
-end;
-
-procedure THelpViewer.Store(var S: TStream);
-begin
-  inherited Store(S);
-end;
-
-destructor THelpViewer.Done;
-begin
-  inherited Done;
-  if assigned(WordList) then
-    Dispose(WordList, Done);
-end;
-
-function THelpFrame.GetPalette: PPalette;
-const P: string[length(CHelpFrame)] = CHelpFrame;
-begin
-  GetPalette:=@P;
-end;
-
-constructor THelpWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ASourceFileID: word; AContext: THelpCtx; ANumber: Integer);
-begin
-  inherited Init(Bounds, ATitle, ANumber);
-  InitScrollBars;
-  if Assigned(HSB) then Insert(HSB);
-  if Assigned(VSB) then Insert(VSB);
-  InitHelpView;
-  if Assigned(HelpView) then
-  begin
-    if (ASourceFileID<>0) or (AContext<>0) then
-       ShowTopic(ASourceFileID, AContext);
-    Insert(HelpView);
-  end;
-end;
-
-procedure THelpWindow.InitScrollBars;
-var R: TRect;
-begin
-  GetExtent(R); R.Grow(0,-1); R.A.X:=R.B.X-1;
-  New(VSB, Init(R)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
-  GetExtent(R); R.Grow(-1,0); R.A.Y:=R.B.Y-1;
-  New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
-end;
-
-procedure THelpWindow.InitHelpView;
-var R: TRect;
-begin
-  GetExtent(R); R.Grow(-1,-1);
-  New(HelpView, Init(R, HSB, VSB));
-  HelpView^.GrowMode:=gfGrowHiX+gfGrowHiY;
-end;
-
-procedure THelpWindow.InitFrame;
-var R: TRect;
-begin
-  GetExtent(R);
-  Frame:=New(PHelpFrame, Init(R));
-end;
-
-procedure THelpWindow.ShowIndex;
-begin
-  HelpView^.SwitchToIndex;
-end;
-
-procedure THelpWindow.ShowTopic(SourceFileID: word; Context: THelpCtx);
-begin
-  HelpView^.SwitchToTopic(SourceFileID, Context);
-end;
-
-procedure THelpWindow.HandleEvent(var Event: TEvent);
-begin
-  case Event.What of
-    evKeyDown :
-      case Event.KeyCode of
-        kbEsc :
-          begin
-            Event.What:=evCommand; Event.Command:=cmClose;
-          end;
-      end;
-  end;
-  inherited HandleEvent(Event);
-end;
-
-procedure THelpWindow.Close;
-begin
-  if HideOnClose then Hide else inherited Close;
-end;
-
-function THelpWindow.GetPalette: PPalette;
-begin
-  GetPalette:=nil;
-end;
-
-END.
-{
-  $Log$
-  Revision 1.2  2000-11-15 00:14:11  pierre
-   new merge
-
-  Revision 1.1.2.1  2000/11/14 23:41:33  pierre
-   * fix for bug 1234
-
-  Revision 1.1  2000/07/13 09:48:37  michael
-  + Initial import
-
-  Revision 1.18  2000/06/22 09:07:14  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.17  2000/06/16 08:50:45  pierre
-   + new bunch of Gabor's changes
-
-  Revision 1.16  2000/05/30 07:18:33  pierre
-   + colors for HTML help by Gabor
-
-  Revision 1.15  2000/05/29 10:45:00  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.14  2000/04/25 08:42:35  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.13  2000/04/18 11:42:39  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.12  2000/03/21 23:21:38  pierre
-   adapted to wcedit addition
-
-  Revision 1.11  2000/02/07 08:29:13  michael
-  [*] the fake (!) TOKENS.PAS still contained the typo bug
-       FSplit(,n,d,e) (correctly FSplit(,d,n,e))
-  [*] CodeComplete had a very ugly bug - coordinates were document-relative
-      (instead of being screen-relative)
-  [*] TResourceStream didn't count the size of the resource names when
-      determining the file size and this could lead to the last resources not
-      loaded correctly
-
-
-  [+] Ctrl-Enter in editor now tries to open the file at cursor
-  [+] CodeComplete option added to Options|Environment|Editor
-  [+] user interface for managing CodeComplete implemented
-  [+] user interface for CodeTemplates implemented
-  [+] CodeComplete wordlist and CodeTemplates stored in desktop file
-  [+] help topic size no longer limited to 64KB when compiled with FPC
-
-  Revision 1.10  1999/08/16 18:25:31  peter
-    * Adjusting the selection when the editor didn't contain any line.
-    * Reserved word recognition redesigned, but this didn't affect the overall
-      syntax highlight speed remarkably (at least not on my Amd-K6/350).
-      The syntax scanner loop is a bit slow but the main problem is the
-      recognition of special symbols. Switching off symbol processing boosts
-      the performance up to ca. 200%...
-    * The editor didn't allow copying (for ex to clipboard) of a single character
-    * 'File|Save as' caused permanently run-time error 3. Not any more now...
-    * Compiler Messages window (actually the whole desktop) did not act on any
-      keypress when compilation failed and thus the window remained visible
-    + Message windows are now closed upon pressing Esc
-    + At 'Run' the IDE checks whether any sources are modified, and recompiles
-      only when neccessary
-    + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
-    + LineSelect (Ctrl+K+L) implemented
-    * The IDE had problems closing help windows before saving the desktop
-
-  Revision 1.9  1999/06/28 19:32:35  peter
-    * fixes from gabor
-
-  Revision 1.8  1999/04/07 21:56:02  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.7  1999/03/08 14:58:20  peter
-    + prompt with dialogs for tools
-
-  Revision 1.6  1999/03/01 15:42:13  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.5  1999/02/18 13:44:38  peter
-    * search fixed
-    + backward search
-    * help fixes
-    * browser updates
-
-  Revision 1.4  1999/02/08 10:37:47  peter
-    + html helpviewer
-
-  Revision 1.3  1999/01/21 11:54:32  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.2  1998/12/28 15:47:57  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.31 1998/12/27 12:07:30  gabor
-    * changed THelpViewer.Init to reflect changes in WEDITOR
-  Revision 1.3  1998/12/22 10:39:56  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 735
ide/text/whtml.pas

@@ -1,735 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit WHTML;
-
-{$I globdir.inc}
-
-interface
-
-uses Objects;
-
-type
-    PTextFile = ^TTextFile;
-    TTextFile = object(TObject)
-      function GetLine(Idx: sw_integer; var S: string): boolean; virtual;
-    end;
-
-    PMemoryTextFile = ^TMemoryTextFile;
-    TMemoryTextFile = object(TTextFile)
-      constructor Init;
-      procedure   AddLine(const S: string); virtual;
-      function    GetLine(Idx: sw_integer; var S: string): boolean; virtual;
-      destructor  Done; virtual;
-    private
-      Lines : PUnsortedStrCollection;
-    end;
-
-    PDOSTextFile = ^TDOSTextFile;
-    TDOSTextFile = object(TMemoryTextFile)
-      constructor Init(AFileName: string);
-    end;
-
-    PSGMLParser = ^TSGMLParser;
-    TSGMLParser = object(TObject)
-      constructor Init;
-      function    Process(HTMLFile: PTextFile): boolean; virtual;
-      function    ProcessLine(LineText: string): boolean; virtual;
-      destructor  Done; virtual;
-    public
-      Line,LinePos: sw_integer;
-      procedure   DocSoftBreak; virtual;
-      function    DocAddTextChar(C: char): boolean; virtual;
-      procedure   DocAddText(S: string); virtual;
-      procedure   DocProcessTag(Tag: string); virtual;
-      procedure   DocProcessComment(Comment: string); virtual;
-      function    DocDecodeNamedEntity(Name: string; var Entity: string): boolean; virtual;
-    private
-      CurTag: string;
-      InTag,InComment,InString: boolean;
-    end;
-
-    PHTMLParser = ^THTMLParser;
-    THTMLParser = object(TSGMLParser)
-      procedure   DocSoftBreak; virtual;
-      function    DocAddTextChar(C: char): boolean; virtual;
-      procedure   DocProcessTag(Tag: string); virtual;
-      function    DocGetTagParam(Name: string; var Value: string): boolean; virtual;
-      procedure   DocProcessComment(Comment: string); virtual;
-      function    DocDecodeNamedEntity(Name: string; var E: string): boolean; virtual;
-    public
-      TagName,TagParams: string;
-      procedure   DocUnknownTag; virtual;
-      procedure   DocTYPE; virtual;
-      procedure   DocHTML(Entered: boolean); virtual;
-      procedure   DocHEAD(Entered: boolean); virtual;
-      procedure   DocMETA; virtual;
-      procedure   DocTITLE(Entered: boolean); virtual;
-      procedure   DocBODY(Entered: boolean); virtual;
-      procedure   DocAnchor(Entered: boolean); virtual;
-      procedure   DocHeading(Level: integer; Entered: boolean); virtual;
-      procedure   DocParagraph(Entered: boolean); virtual;
-      procedure   DocBreak; virtual;
-      procedure   DocImage; virtual;
-      procedure   DocBold(Entered: boolean); virtual;
-      procedure   DocCite(Entered: boolean); virtual;
-      procedure   DocCode(Entered: boolean); virtual;
-      procedure   DocEmphasized(Entered: boolean); virtual;
-      procedure   DocItalic(Entered: boolean); virtual;
-      procedure   DocKbd(Entered: boolean); virtual;
-      procedure   DocPreformatted(Entered: boolean); virtual;
-      procedure   DocSample(Entered: boolean); virtual;
-      procedure   DocStrong(Entered: boolean); virtual;
-      procedure   DocTeleType(Entered: boolean); virtual;
-      procedure   DocVariable(Entered: boolean); virtual;
-      procedure   DocList(Entered: boolean); virtual;
-      procedure   DocOrderedList(Entered: boolean); virtual;
-      procedure   DocListItem; virtual;
-      procedure   DocDefList(Entered: boolean); virtual;
-      procedure   DocDefTerm; virtual;
-      procedure   DocDefExp; virtual;
-      procedure   DocTable(Entered: boolean); virtual;
-      procedure   DocTableRow(Entered: boolean); virtual;
-      procedure   DocTableHeaderItem(Entered: boolean); virtual;
-      procedure   DocTableItem(Entered: boolean); virtual;
-      procedure   DocHorizontalRuler; virtual;
-    end;
-
-implementation
-
-uses WUtils;
-
-function TTextFile.GetLine(Idx: sw_integer; var S: string): boolean;
-begin
-  Abstract;
-  GetLine:=false;
-end;
-
-constructor TMemoryTextFile.Init;
-begin
-  inherited Init;
-  New(Lines, Init(500,500));
-end;
-
-procedure TMemoryTextFile.AddLine(const S: string);
-begin
-  Lines^.Insert(NewStr(S));
-end;
-
-function TMemoryTextFile.GetLine(Idx: sw_integer; var S: string): boolean;
-var OK: boolean;
-    PS: PString;
-begin
-  OK:=(Lines<>nil) and (Idx<Lines^.Count);
-  if OK then
-    begin
-      PS:=Lines^.At(Idx);
-      if PS=nil then S:='' else S:=PS^;
-    end;
-  GetLine:=OK;
-end;
-
-destructor TMemoryTextFile.Done;
-begin
-  inherited Done;
-  if Lines<>nil then Dispose(Lines, Done); Lines:=nil;
-end;
-
-constructor TDOSTextFile.Init(AFileName: string);
-(*{$ifdef TPUNIXLF}
-  procedure readln(var t:text;var s:string);
-  var
-    c : char;
-    i : longint;
-  begin
-    c:=#0;
-    i:=0;
-    while (not eof(t)) and (c<>#10) and (i<255) do
-     begin
-       read(t,c);
-       if (i<255) and (c<>#10) then
-   begin
-     inc(i);
-     s[i]:=c;
-   end;
-     end;
-    if (i>0) and (s[i]=#13) then
-       dec(i);
-    s[0]:=chr(i);
-   end;
-{$endif}*)
-var f: text;
-    S: string;
-begin
-  inherited Init;
-  if AFileName='' then Fail;
-{$I-}
-  Assign(f,AFileName);
-  Reset(f);
-  if IOResult<>0 then Fail;
-  New(Lines, Init(500,2000));
-  while (Eof(f)=false) and (IOResult=0) do
-    begin
-      readln(f,S); { this is the one in WUTILS.PAS }
-      AddLine(S);
-    end;
-  Close(f);
-{$I+}
-end;
-
-constructor TSGMLParser.Init;
-begin
-  inherited Init;
-end;
-
-function TSGMLParser.Process(HTMLFile: PTextFile): boolean;
-var S: string;
-    OK,LineOK: boolean;
-begin
-  if HTMLFile=nil then Exit;
-  InTag:=false; InComment:=false; InString:=false; CurTag:='';
-  Line:=0; OK:=true;
-  repeat
-    LineOK:=HTMLFile^.GetLine(Line,S);
-    if LineOK then
-      begin
-        OK:=ProcessLine(S);
-        Inc(Line);
-      end;
-  until (LineOK=false) or (OK=false);
-  Process:=OK;
-end;
-
-function TSGMLParser.ProcessLine(LineText: string): boolean;
-var OK: boolean;
-    C: char;
-    NewInString: boolean;
-    OldInComment: boolean;
-    WasThereAnyText: boolean;
-    Pos2: integer;
-    Name,Entity: string;
-    LiteralCode: boolean;
-    LiteralStart,LiteralEnd,P: integer;
-const TabSize : integer = 8;
-      Tab = #9;
-begin
-  WasThereAnyText:=false;
-  OK:=true; LinePos:=1;
-  LiteralStart:=0; LiteralEnd:=0;
-  repeat
-    P:=Pos(TAB,LineText);
-    if P>0 then
-      LineText:=copy(LineText,1,P-1)+CharStr(' ',TabSize)+copy(LineText,P+1,255);
-  until P=0;
-  while (LinePos<=length(LineText)) and OK do
-    begin
-      LiteralCode:=false;
-      NewInString:=InString; OldInComment:=InComment;
-      C:=LineText[LinePos];
-
-      LiteralCode:=(LiteralStart<=LinePos) and (LinePos<=LiteralEnd);
-
-      if (LiteralCode=false) and (C='&') then
-        begin
-          LiteralStart:=0; LiteralEnd:=0;
-          Name:=''; Pos2:=LinePos+1;
-          while (Pos2<=length(LineText)) and (LineText[Pos2]<>';') do
-            begin
-              Name:=Name+LineText[Pos2];
-              Inc(Pos2);
-            end;
-          Inc(Pos2);
-          if DocDecodeNamedEntity(Name,Entity) then
-            begin
-              LineText:=copy(LineText,1,LinePos-1)+Entity+copy(LineText,Pos2,255);
-              LiteralStart:=LinePos; LiteralEnd:=LiteralStart+length(Entity)-1;
-              C:=LineText[LinePos];
-            end;
-        end;
-
-      LiteralCode:=(LiteralStart<=LinePos) and (LinePos<=LiteralEnd);
-
-      if (LiteralCode=false) and (C='"') and (InTag=true) and (InString=false) then
-        NewInString:=true;
-      if (LiteralCode=false) and (C='<') and (InTag=false) then
-        InTag:=true;
-
-      if InTag then CurTag:=CurTag+C else
-        WasThereAnyText:=DocAddTextChar(C);
-      if (LiteralCode=false) and InTag and (InString=false) and (CurTag='<!--') then
-        InComment:=true;
-      if (LiteralCode=false) and InTag and InComment and (InString=false) and (length(CurTag)>=3) and
-         (copy(CurTag,length(CurTag)-2,3)='-->') then
-           InComment:=false;
-
-      if (LiteralCode=false) and (C='"') and (InTag=true) and (InString=true) then
-        NewInString:=false;
-      if (LiteralCode=false) and (C='>') and (InTag=true) then
-        begin
-          InTag:=false;
-          if OldInComment then
-            DocProcessComment(CurTag)
-          else
-            DocProcessTag(CurTag);
-          CurTag:='';
-        end;
-
-      InString:=NewInString;
-      Inc(LinePos);
-
-    end;
-  if WasThereAnyText then DocSoftBreak;
-  ProcessLine:=true;
-end;
-
-procedure TSGMLParser.DocSoftBreak;
-begin
-  Abstract;
-end;
-
-function TSGMLParser.DocAddTextChar(C: char): boolean;
-begin
-  Abstract;
-  DocAddTextChar:=false;
-end;
-
-procedure TSGMLParser.DocAddText(S: string);
-var I: sw_integer;
-begin
-  for I:=1 to length(S) do
-    DocAddTextChar(S[I]);
-end;
-
-function TSGMLParser.DocDecodeNamedEntity(Name: string; var Entity: string): boolean;
-begin
-  DocDecodeNamedEntity:=false;
-end;
-
-procedure TSGMLParser.DocProcessTag(Tag: string);
-begin
-  Abstract;
-end;
-
-procedure TSGMLParser.DocProcessComment(Comment: string);
-begin
-  Abstract;
-end;
-
-destructor TSGMLParser.Done;
-begin
-  inherited Done;
-end;
-
-procedure THTMLParser.DocSoftBreak;
-begin
-end;
-
-function THTMLParser.DocAddTextChar(C: char): boolean;
-begin
-  { Abstract }
-  DocAddTextChar:=false;
-end;
-
-function THTMLParser.DocDecodeNamedEntity(Name: string; var E: string): boolean;
-var Found: boolean;
-    Code: integer;
-    CC: integer;
-begin
-  Found:=true; Code:=-1;
-  Name:=LowCaseStr(Name);
-  if copy(Name,1,1)='#' then
-    begin
-      Val(copy(Name,2,255),Code,CC);
-      if CC<>0 then Code:=-1;
-    end;
-  if               (Name='lt')     then E:='<'   else { less-than sign                }
-  if               (Name='gt')     then E:='>'   else { greater-than sign              }
-  if               (Name='amp')    then E:='&'   else { ampersand                     }
-  if               (Name='quot')   then E:='"'   else { double quote sign             }
-  if (Code=160) or (Name='nbsp')   then E:=#255  else { no-break space                }
-  if (Code=161) or (Name='iexcl')  then E:='­'   else { inverted excalamation mark    }
-  if (Code=162) or (Name='cent')   then E:='›'   else { cent sign                     }
-  if (Code=163) or (Name='pound')  then E:='œ'   else { pound sterling sign           }
-  if (Code=164) or (Name='curren') then E:='$'   else { general currency sign         }
-  if (Code=165) or (Name='yen')    then E:='�'   else { yen sign                      }
-  if (Code=166) or (Name='brvbar') then E:='|'   else { broken vertical bar           }
-(*  if (Code=167) or (Name='sect')   then E:=#255  else { section sign                  }*)
-(*  if (Code=168) or (Name='uml')    then E:=#255  else { umlaut  (dieresis)            }*)
-  if (Code=169) or (Name='copy')   then E:='(C)' else { copyright sign                }
-(*  if (Code=170) or (Name='ordf')   then E:=#255  else { ordinal indicator, feminine   }*)
-  if (Code=171) or (Name='laquo')  then E:='"'   else { angle quotation mark -left    }
-  if (Code=172) or (Name='not')    then E:='!'   else { not sign                      }
-  if (Code=173) or (Name='shy')    then E:='-'   else { soft hypen                    }
-  if (Code=174) or (Name='reg')    then E:='(R)' else { registered sign               }
-(*  if (Code=175) or (Name='macr')   then E:='?'   else { macron                        }*)
-  if (Code=176) or (Name='deg')    then E:='ø'   else { degree sign                   }
-  if (Code=177) or (Name='plusmn') then E:='ñ'   else { plus-or-minus sign            }
-  if (Code=178) or (Name='sup2')   then E:='ý'   else { superscript 2                 }
-  if (Code=179) or (Name='sup3')   then E:='^3'  else { superscript 3                 }
-  if (Code=180) or (Name='acute')  then E:=''''  else { acute accent                  }
-  if (Code=181) or (Name='micro')  then E:='æ'   else { micro sign                    }
-(*  if (Code=182) or (Name='para')   then E:='?'   else { paragraph sign                }*)
-  if (Code=183) or (Name='middot') then E:='ù'   else { middle dot                    }
-(*  if (Code=184) or (Name='cedil')  then E:='?'   else { cedilla                       }*)
-  if (Code=185) or (Name='sup1')   then E:='^1'  else { superscript 1                 }
-(*  if (Code=186) or (Name='ordm')   then E:='?'   else { ordinal indicator, masculine  }*)
-  if (Code=187) or (Name='raquo')  then E:='"'   else { angle quoatation mark -right  }
-  if (Code=188) or (Name='frac14') then E:='¬'   else { fraction one-quarter          }
-  if (Code=189) or (Name='frac12') then E:='«'   else { fraction one-half             }
-  if (Code=190) or (Name='frac34') then E:='3/4' else { fraction three-quarters       }
-  if (Code=191) or (Name='iquest') then E:='¨'   else { inverted question mark        }
-  if (Code=192) or (Name='Agrave') then E:='A'   else { capital A, grave accent       }
-  if (Code=193) or (Name='Aacute') then E:='A'   else { capital A, acute accent       }
-  if (Code=194) or (Name='Acirc')  then E:='A'   else { capital A, circumflex accent  }
-  if (Code=195) or (Name='Atilde') then E:='A'   else { capital A, tilde accent       }
-  if (Code=196) or (Name='Auml')   then E:='Ž'   else { capital A, dieresis or umlaut }
-  if (Code=197) or (Name='Aring')  then E:='�'   else { capital A, ring               }
-  if (Code=198) or (Name='AElig')  then E:='AE'  else { capital AE diphthong          }
-(*  if (Code=199) or (Name='Ccedil') then E:='?'   else { capital C, cedilla            }*)
-  if (Code=200) or (Name='Egrave') then E:='�'   else { capital E, grave accent       }
-  if (Code=201) or (Name='Eacute') then E:='�'   else { capital E, acute accent       }
-  if (Code=202) or (Name='Ecirc')  then E:='E'   else { capital E, circumflex accent  }
-  if (Code=203) or (Name='Euml')   then E:='E'   else { capital E, dieresis or umlaut }
-  if (Code=204) or (Name='Igrave') then E:='I'   else { capital I, grave accent       }
-  if (Code=205) or (Name='Iacute') then E:='I'   else { capital I, acute accent       }
-  if (Code=206) or (Name='Icirc')  then E:='I'   else { capital I, circumflex accent  }
-  if (Code=207) or (Name='Iuml')   then E:='I'   else { capital I, dieresis or umlaut }
-(*  if (Code=208) or (Name='ETH')    then E:='?'   else { capital Eth, Icelandic        }*)
-  if (Code=209) or (Name='Ntidle') then E:='¥'   else { capital N, tilde              }
-  if (Code=210) or (Name='Ograve') then E:='O'   else { capital O, grave accent       }
-  if (Code=211) or (Name='Oacute') then E:='O'   else { capital O, acute accent       }
-  if (Code=212) or (Name='Ocirc')  then E:='O'   else { capital O, circumflex accent  }
-  if (Code=213) or (Name='Otilde') then E:='O'   else { capital O, tilde              }
-  if (Code=214) or (Name='Ouml')   then E:='™'   else { capital O, dieresis or umlaut }
-  if (Code=215) or (Name='times')  then E:='*'   else { multiply sign                 }
-  if (Code=216) or (Name='Oslash') then E:='O'   else { capital O, slash              }
-  if (Code=217) or (Name='Ugrave') then E:='U'   else { capital U, grave accent       }
-  if (Code=218) or (Name='Uacute') then E:='U'   else { capital U, acute accent       }
-  if (Code=219) or (Name='Ucirc')  then E:='U'   else { capital U, circumflex accent  }
-  if (Code=220) or (Name='Uuml')   then E:='š'   else { capital U, dieresis or umlaut }
-  if (Code=221) or (Name='Yacute') then E:='Y'   else { capital Y, acute accent       }
-(*  if (Code=222) or (Name='THORN')  then E:='?'   else { capital THORN, Icelandic      }*)
-  if (Code=223) or (Name='szlig')  then E:='á'   else { small sharp S, German         }
-  if (Code=224) or (Name='agrave') then E:='…'   else { small a, grave accent         }
-  if (Code=225) or (Name='aacute') then E:=' '   else { small a, acute accent         }
-  if (Code=226) or (Name='acirc')  then E:='ƒ'   else { small a, circumflex accent    }
-  if (Code=227) or (Name='atilde') then E:='ƒ'   else { small a, tilde                }
-  if (Code=228) or (Name='auml')   then E:='„'   else { small a, dieresis or umlaut   }
-  if (Code=229) or (Name='aring')  then E:='†'   else { small a, ring                 }
-  if (Code=230) or (Name='aelig')  then E:='ae'  else { small ae, diphthong           }
-(*  if (Code=231) or (Name='ccedil') then E:='?'   else { small c, cedilla              }*)
-  if (Code=232) or (Name='egrave') then E:='Š'   else { small e, grave accent         }
-  if (Code=233) or (Name='eacute') then E:='‚'   else { small e, acute accent         }
-  if (Code=234) or (Name='ecirc')  then E:='ˆ'   else { small e, circumflex accent    }
-  if (Code=235) or (Name='euml')   then E:='‰'   else { small e, dieresis or umlaut   }
-  if (Code=236) or (Name='igrave') then E:='�'   else { small i, grave accent         }
-  if (Code=237) or (Name='iacute') then E:='¡'   else { small i, acute accent         }
-  if (Code=238) or (Name='icirc')  then E:='Œ'   else { small i, circumflex accent    }
-  if (Code=239) or (Name='iuml')   then E:='‹'   else { small i, dieresis or umlaut   }
-(*  if (Code=240) or (Name='eth')    then E:='?'   else { small eth, Icelandic          }*)
-  if (Code=241) or (Name='ntilde') then E:='¤'   else { small n, tilde                }
-  if (Code=242) or (Name='ograve') then E:='•'   else { small o, grave accent         }
-  if (Code=243) or (Name='oacute') then E:='¢'   else { small o, acute accent         }
-  if (Code=244) or (Name='ocirc')  then E:='“'   else { small o, circumflex accent    }
-  if (Code=245) or (Name='otilde') then E:='“'   else { small o, tilde                }
-  if (Code=246) or (Name='ouml')   then E:='”'   else { small o, dieresis or umlaut   }
-  if (Code=247) or (Name='divide') then E:='/'   else { divide sign                   }
-  if (Code=248) or (Name='oslash') then E:='"'   else { small o, slash                }
-  if (Code=249) or (Name='ugrave') then E:='—'   else { small u, grave accent         }
-  if (Code=250) or (Name='uacute') then E:='£'   else { small u, acute accent         }
-  if (Code=251) or (Name='ucirc')  then E:='–'   else { small u, circumflex accent    }
-  if (Code=252) or (Name='uuml')   then E:='�'   else { small u, dieresis or umlaut   }
-  if (Code=253) or (Name='yacute') then E:='y'   else { small y, acute accent         }
-(*  if (Code=254) or (Name='thorn')  then E:='?'   else { small thorn, Icelandic        }*)
-  if (Code=255) or (Name='yuml')   then E:='y'   else { small y, dieresis or umlaut   }
-  Found:=false;
-  DocDecodeNamedEntity:=Found;
-end;
-
-procedure THTMLParser.DocProcessTag(Tag: string);
-var UTagName,ETagName: string[30];
-    P: byte;
-    NotEndTag: boolean;
-begin
-  if copy(Tag,1,1)='<' then Delete(Tag,1,1);
-  if copy(Tag,length(Tag),1)='>' then Delete(Tag,length(Tag),1);
-  Tag:=Trim(Tag);
-  P:=Pos(' ',Tag); if P=0 then P:=length(Tag)+1;
-  TagName:=copy(Tag,1,P-1); TagParams:=copy(Tag,P+1,255);
-  UTagName:=UpcaseStr(TagName);
-  NotEndTag:=copy(TagName,1,1)<>'/';
-  if NotEndTag then ETagName:=UTagName else ETagName:=copy(UTagName,2,255);
-
-  if (UTagName='!DOCTYPE') then DocTYPE else
-  { Section tags }
-  if (ETagName='HTML') then DocHTML(NotEndTag) else
-  if (ETagName='HEAD') then DocHEAD(NotEndTag) else
-  if (ETagName='TITLE') then DocTITLE(NotEndTag) else
-  if (ETagName='BODY') then DocBODY(NotEndTag) else
-  { Anchor tags }
-  if (ETagName='A') then DocAnchor(NotEndTag) else
-  { Direct formatting directives }
-  if (ETagName='H1') then DocHeading(1,NotEndTag) else
-  if (ETagName='H2') then DocHeading(2,NotEndTag) else
-  if (ETagName='H3') then DocHeading(3,NotEndTag) else
-  if (ETagName='H4') then DocHeading(4,NotEndTag) else
-  if (ETagName='H5') then DocHeading(5,NotEndTag) else
-  if (ETagName='H6') then DocHeading(6,NotEndTag) else
-  if (ETagName='P') then DocParagraph(NotEndTag) else
-  if (ETagName='BR') then DocBreak else
-  if (ETagName='B') then DocBold(NotEndTag) else
-  if (ETagName='CITE') then DocCite(NotEndTag) else
-  if (ETagName='CODE') then DocCode(NotEndTag) else
-  if (ETagName='EM') then DocEmphasized(NotEndTag) else
-  if (ETagName='I') then DocItalic(NotEndTag) else
-  if (ETagName='KBD') then DocKbd(NotEndTag) else
-  if (ETagName='PRE') then DocPreformatted(NotEndTag) else
-  if (ETagName='SAMP') then DocSample(NotEndTag) else
-  if (ETagName='STRONG') then DocStrong(NotEndTag) else
-  if (ETagName='TT') then DocTeleType(NotEndTag) else
-  if (ETagName='VAR') then DocVariable(NotEndTag) else
-  { Unordered & ordered lists }
-  if (ETagName='UL') then DocList(NotEndTag) else
-  if (ETagName='OL') then DocOrderedList(NotEndTag) else
-  if (UTagName='LI') then DocListItem else
-  { Definition list }
-  if (ETagName='DL') then DocDefList(NotEndTag) else
-  if (UTagName='DT') then DocDefTerm else
-  if (UTagName='DD') then DocDefExp else
-  { Table }
-  if (ETagName='TABLE') then DocTable(NotEndTag) else
-  if (UTagName='TR') then DocTableRow(NotEndTag) else
-  if (UTagName='TH') then DocTableHeaderItem(NotEndTag) else
-  if (UTagName='TD') then DocTableItem(NotEndTag) else
-  { Misc. tags }
-  if (UTagName='META') then DocMETA else
-  if (UTagName='IMG') then DocImage else
-  if (UTagName='HR') then DocHorizontalRuler else
-  DocUnknownTag;
-end;
-
-function THTMLParser.DocGetTagParam(Name: string; var Value: string): boolean;
-var Found: boolean;
-    S: string;
-    ParamName,ParamValue: string;
-    InStr: boolean;
-    I: sw_integer;
-begin
-  Found:=false; Name:=UpcaseStr(Name);
-  S:=TagParams;
-  repeat
-    InStr:=false;
-    ParamName:=''; ParamValue:='';
-    S:=Trim(S); I:=1;
-    while (I<=length(S)) and (S[I]<>'=') do
-      begin
-        ParamName:=ParamName+S[I];
-        Inc(I);
-      end;
-    ParamName:=Trim(ParamName);
-    if S[I]='=' then
-    begin
-      Inc(I); InStr:=false;
-      while (I<=length(S)) and (S[I]=' ') do
-        Inc(I);
-      if (I<=length(S)) and (S[I]='"') then
-        begin
-          InStr:=true;
-          Inc(I);
-        end;
-      while (I<=length(S)) and ((InStr=true) or (S[I]<>' ')) do
-        begin
-          if S[I]='"' then
-            begin
-              InStr:=not InStr;
-              if InStr=false then Break;
-            end
-          else
-            ParamValue:=ParamValue+S[I];
-          Inc(I);
-        end;
-    end;
-    Found:=(Name=UpcaseStr(ParamName));
-    if Found then Value:=ParamValue;
-    Delete(S,1,I);
-  until Found or (S='');
-  DocGetTagParam:=Found;
-end;
-
-procedure THTMLParser.DocProcessComment(Comment: string);
-begin
-end;
-
-procedure THTMLParser.DocUnknownTag;
-begin
-end;
-
-procedure THTMLParser.DocTYPE;
-begin
-end;
-
-procedure THTMLParser.DocHTML(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocHEAD(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocMETA;
-begin
-end;
-
-procedure THTMLParser.DocTITLE(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocBODY(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocAnchor(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocHeading(Level: integer; Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocParagraph(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocBreak;
-begin
-end;
-
-procedure THTMLParser.DocImage;
-begin
-end;
-
-procedure THTMLParser.DocBold(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocCite(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocCode(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocEmphasized(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocItalic(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocKbd(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocPreformatted(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocSample(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocStrong(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocTeleType(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocVariable(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocList(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocOrderedList(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocListItem;
-begin
-end;
-
-procedure THTMLParser.DocDefList(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocDefTerm;
-begin
-end;
-
-procedure THTMLParser.DocDefExp;
-begin
-end;
-
-procedure THTMLParser.DocTable(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocTableRow(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocTableHeaderItem(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocTableItem(Entered: boolean);
-begin
-end;
-
-procedure THTMLParser.DocHorizontalRuler;
-begin
-end;
-
-
-
-END.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:37  michael
-  + Initial import
-
-  Revision 1.7  2000/06/22 09:07:15  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.6  2000/04/25 08:42:35  pierre
-   * New Gabor changes : see fixes.txt
-
-  Revision 1.5  2000/03/21 23:20:47  pierre
-   suppress some warnings by Gabor
-
-  Revision 1.4  1999/04/07 21:56:03  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.3  1999/03/01 15:51:42  peter
-    + Log
-
-}

+ 0 - 773
ide/text/whtmlhlp.pas

@@ -1,773 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1999-2000 by Berczi Gabor
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit WHTMLHlp;
-
-interface
-
-uses Objects,WHTML,WHelp;
-
-const
-     ListIndent = 2;
-     DefIndent  = 4;
-
-     MaxTopicLinks = 5000; { maximum number of links on a single HTML page }
-
-type
-    THTMLSection = (hsNone,hsHeading1,hsHeading2,hsHeading3,hsHeading4,hsHeading5,hsHeading6);
-
-    PTopicLinkCollection = ^TTopicLinkCollection;
-    TTopicLinkCollection = object(TStringCollection)
-      procedure   Insert(Item: Pointer); virtual;
-      function    At(Index: sw_Integer): PString;
-      function    AddItem(Item: string): integer;
-    end;
-
-    TParagraphAlign = (paLeft,paCenter,paRight);
-
-    PHTMLTopicRenderer = ^THTMLTopicRenderer;
-    THTMLTopicRenderer = object(THTMLParser)
-      function  BuildTopic(P: PTopic; AURL: string; HTMLFile: PTextFile; ATopicLinks: PTopicLinkCollection): boolean;
-    public
-      function  DocAddTextChar(C: char): boolean; virtual;
-      procedure DocSoftBreak; virtual;
-      procedure DocTYPE; virtual;
-      procedure DocHTML(Entered: boolean); virtual;
-      procedure DocHEAD(Entered: boolean); virtual;
-      procedure DocMETA; virtual;
-      procedure DocTITLE(Entered: boolean); virtual;
-      procedure DocBODY(Entered: boolean); virtual;
-      procedure DocAnchor(Entered: boolean); virtual;
-      procedure DocHeading(Level: integer; Entered: boolean); virtual;
-      procedure DocParagraph(Entered: boolean); virtual;
-      procedure DocBreak; virtual;
-      procedure DocImage; virtual;
-      procedure DocBold(Entered: boolean); virtual;
-      procedure DocCite(Entered: boolean); virtual;
-      procedure DocCode(Entered: boolean); virtual;
-      procedure DocEmphasized(Entered: boolean); virtual;
-      procedure DocItalic(Entered: boolean); virtual;
-      procedure DocKbd(Entered: boolean); virtual;
-      procedure DocPreformatted(Entered: boolean); virtual;
-      procedure DocSample(Entered: boolean); virtual;
-      procedure DocStrong(Entered: boolean); virtual;
-      procedure DocTeleType(Entered: boolean); virtual;
-      procedure DocVariable(Entered: boolean); virtual;
-      procedure DocList(Entered: boolean); virtual;
-      procedure DocOrderedList(Entered: boolean); virtual;
-      procedure DocListItem; virtual;
-      procedure DocDefList(Entered: boolean); virtual;
-      procedure DocDefTerm; virtual;
-      procedure DocDefExp; virtual;
-      procedure DocTable(Entered: boolean); virtual;
-      procedure DocTableRow(Entered: boolean); virtual;
-      procedure DocTableItem(Entered: boolean); virtual;
-      procedure DocHorizontalRuler; virtual;
-    public
-      function  GetSectionColor(Section: THTMLSection; var Color: byte): boolean; virtual;
-    private
-      URL: string;
-      Topic: PTopic;
-      TopicLinks: PTopicLinkCollection;
-      TextPtr: sw_word;
-      InTitle: boolean;
-      InBody: boolean;
-      InAnchor: boolean;
-      InParagraph: boolean;
-      InPreformatted: boolean;
-      TopicTitle: string;
-      Indent: integer;
-      AnyCharsInLine: boolean;
-      CurHeadLevel: integer;
-      PAlign: TParagraphAlign;
-      LinkIndexes: array[0..MaxTopicLinks] of sw_integer;
-      LinkPtr: sw_integer;
-      LastTextChar: char;
-{      Anchor: TAnchor;}
-      procedure AddText(S: string);
-      procedure AddChar(C: char);
-    end;
-
-    PCustomHTMLHelpFile = ^TCustomHTMLHelpFile;
-    TCustomHTMLHelpFile = object(THelpFile)
-      constructor Init(AID: word);
-      destructor  Done; virtual;
-    public
-      function    SearchTopic(HelpCtx: THelpCtx): PTopic; virtual;
-      function    ReadTopic(T: PTopic): boolean; virtual;
-    private
-      Renderer: PHTMLTopicRenderer;
-      DefaultFileName: string;
-      CurFileName: string;
-      TopicLinks: PTopicLinkCollection;
-    end;
-
-    PHTMLHelpFile = ^THTMLHelpFile;
-    THTMLHelpFile = object(TCustomHTMLHelpFile)
-      constructor Init(AFileName: string; AID: word; ATOCEntry: string);
-    public
-      function    LoadIndex: boolean; virtual;
-    private
-      TOCEntry: string;
-    end;
-
-    PHTMLIndexHelpFile = ^THTMLIndexHelpFile;
-    THTMLIndexHelpFile = object(TCustomHTMLHelpFile)
-      constructor Init(AFileName: string; AID: word);
-      function    LoadIndex: boolean; virtual;
-    private
-      IndexFileName: string;
-    end;
-
-    THTMLGetSectionColorProc = function(Section: THTMLSection; var Color: byte): boolean;
-
-function DefHTMLGetSectionColor(Section: THTMLSection; var Color: byte): boolean;
-
-const HTMLGetSectionColor : THTMLGetSectionColorProc = DefHTMLGetSectionColor;
-
-implementation
-
-uses WConsts,WUtils,WViews,WHTMLScn;
-
-function DefHTMLGetSectionColor(Section: THTMLSection; var Color: byte): boolean;
-begin
-  Color:=0;
-  DefHTMLGetSectionColor:=false;
-end;
-
-function EncodeHTMLCtx(FileID: integer; LinkNo: word): longint;
-var Ctx: longint;
-begin
-  Ctx:=(longint(FileID) shl 16)+LinkNo;
-  EncodeHTMLCtx:=Ctx;
-end;
-
-procedure DecodeHTMLCtx(Ctx: longint; var FileID: word; var LinkNo: word);
-begin
-  if (Ctx shr 16)=0 then
-    begin
-      FileID:=$ffff; LinkNo:=0;
-    end
-  else
-    begin
-      FileID:=Ctx shr 16; LinkNo:=Ctx and $ffff;
-    end;
-end;
-
-function CharStr(C: char; Count: byte): string;
-var S: string;
-begin
-  S[0]:=chr(Count);
-  if Count>0 then FillChar(S[1],Count,C);
-  CharStr:=S;
-end;
-
-procedure TTopicLinkCollection.Insert(Item: Pointer);
-begin
-  AtInsert(Count,Item);
-end;
-
-function TTopicLinkCollection.At(Index: sw_Integer): PString;
-begin
-  At:=inherited At(Index);
-end;
-
-function TTopicLinkCollection.AddItem(Item: string): integer;
-var Idx: sw_integer;
-begin
-  if Item='' then Idx:=-1 else
-  if Search(@Item,Idx)=false then
-    begin
-      AtInsert(Count,NewStr(Item));
-      Idx:=Count-1;
-    end;
-  AddItem:=Idx;
-end;
-
-function THTMLTopicRenderer.DocAddTextChar(C: char): boolean;
-var Added: boolean;
-begin
-  Added:=false;
-  if InTitle then
-    begin
-      TopicTitle:=TopicTitle+C;
-      Added:=true;
-    end
-  else
-  if InBody then
-    begin
-      if (InPreFormatted) or (C<>#32) or (LastTextChar<>C) then
-      if (C<>#32) or (AnyCharsInLine=true) or (InPreFormatted=true) then
-        begin
-          AddChar(C);
-          LastTextChar:=C;
-          Added:=true;
-        end;
-    end;
-  DocAddTextChar:=Added;
-end;
-
-procedure THTMLTopicRenderer.DocSoftBreak;
-begin
-  if InPreformatted then DocBreak else
-  if AnyCharsInLine then
-    begin
-      AddChar(' ');
-      LastTextChar:=' ';
-    end;
-end;
-
-procedure THTMLTopicRenderer.DocTYPE;
-begin
-end;
-
-procedure THTMLTopicRenderer.DocHTML(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocHEAD(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocMETA;
-begin
-end;
-
-procedure THTMLTopicRenderer.DocTITLE(Entered: boolean);
-begin
-  if Entered then
-    begin
-      TopicTitle:='';
-    end
-  else
-    begin
-      { render topic title here }
-      if TopicTitle<>'' then
-        begin
-          AddText('  '+TopicTitle+' Ü'); DocBreak;
-          AddText(' '+CharStr('ß',length(TopicTitle)+3)); DocBreak;
-        end;
-    end;
-  InTitle:=Entered;
-end;
-
-procedure THTMLTopicRenderer.DocBODY(Entered: boolean);
-begin
-  InBody:=Entered;
-end;
-
-procedure THTMLTopicRenderer.DocAnchor(Entered: boolean);
-var HRef,Name: string;
-begin
-  if Entered and InAnchor then DocAnchor(false);
-  if Entered then
-    begin
-      if DocGetTagParam('HREF',HRef)=false then HRef:='';
-      if DocGetTagParam('NAME',Name)=false then Name:='';
-      if Name<>'' then
-        begin
-          Topic^.NamedMarks^.InsertStr(Name);
-          AddChar(hscNamedMark);
-        end;
-      if (HRef<>'') then
-          begin
-            InAnchor:=true;
-            AddChar(hscLink);
-            if LinkPtr<MaxTopicLinks then
-            begin
-              HRef:=CompleteURL(URL,HRef);
-              LinkIndexes[LinkPtr]:=TopicLinks^.AddItem(HRef);
-              Inc(LinkPtr);
-            end;
-          end;
-    end
-  else
-    begin
-      if InAnchor=true then AddChar(hscLink);
-      InAnchor:=false;
-    end;
-end;
-
-procedure DecodeAlign(Align: string; var PAlign: TParagraphAlign);
-begin
-  Align:=UpcaseStr(Align);
-  if Align='LEFT' then PAlign:=paLeft else
-  if Align='CENTER' then PAlign:=paCenter else
-  if Align='RIGHT' then PAlign:=paRight;
-end;
-
-procedure THTMLTopicRenderer.DocHeading(Level: integer; Entered: boolean);
-var Align: string;
-    C: byte;
-    SC: THTMLSection;
-begin
-  if Entered then
-    begin
-      DocBreak;
-      CurHeadLevel:=Level;
-      PAlign:=paLeft;
-      if DocGetTagParam('ALIGN',Align) then
-        DecodeAlign(Align,PAlign);
-      SC:=hsNone;
-      case Level of
-        1: SC:=hsHeading1;
-        2: SC:=hsHeading2;
-        3: SC:=hsHeading3;
-        4: SC:=hsHeading4;
-        5: SC:=hsHeading5;
-        6: SC:=hsHeading6;
-      end;
-      if GetSectionColor(SC,C) then
-        AddText(hscTextAttr+chr(C));
-    end
-  else
-    begin
-      AddChar(hscNormText);
-      CurHeadLevel:=0;
-      DocBreak;
-    end;
-end;
-
-procedure THTMLTopicRenderer.DocParagraph(Entered: boolean);
-var Align: string;
-begin
-  if Entered and InParagraph then DocParagraph(false);
-  if Entered then
-    begin
-      if AnyCharsInLine then DocBreak;
-      if DocGetTagParam('ALIGN',Align) then
-        DecodeAlign(Align,PAlign);
-    end
-  else
-    begin
-{      if AnyCharsInLine then }DocBreak;
-      PAlign:=paLeft;
-    end;
-  InParagraph:=Entered;
-end;
-
-procedure THTMLTopicRenderer.DocBreak;
-begin
-  if (CurHeadLevel=1) or (PAlign=paCenter) then
-    AddChar(hscCenter);
-  if (PAlign=paRight) then
-    AddChar(hscRight);
-  AddChar(hscLineBreak);
-  if Indent>0 then
-  AddText(CharStr(#255,Indent)+hscLineStart);
-  AnyCharsInLine:=false;
-end;
-
-procedure THTMLTopicRenderer.DocImage;
-var Alt: string;
-begin
-  if DocGetTagParam('ALT',Alt)=false then Alt:='IMG';
-  if Alt<>'' then
-    begin
-      AddText('['+Alt+']');
-    end;
-end;
-
-procedure THTMLTopicRenderer.DocBold(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocCite(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocCode(Entered: boolean);
-begin
-  if AnyCharsInLine then DocBreak;
-  AddText(hscCode);
-  DocBreak;
-end;
-
-procedure THTMLTopicRenderer.DocEmphasized(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocItalic(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocKbd(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocPreformatted(Entered: boolean);
-begin
-  if AnyCharsInLine then DocBreak;
-  AddText(hscCode);
-  DocBreak;
-  InPreformatted:=Entered;
-end;
-
-procedure THTMLTopicRenderer.DocSample(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocStrong(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocTeleType(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocVariable(Entered: boolean);
-begin
-end;
-
-procedure THTMLTopicRenderer.DocList(Entered: boolean);
-begin
-  if Entered then
-    begin
-      Inc(Indent,ListIndent);
-      DocBreak;
-    end
-  else
-    begin
-      Dec(Indent,ListIndent);
-      if AnyCharsInLine then DocBreak;
-    end;
-end;
-
-procedure THTMLTopicRenderer.DocOrderedList(Entered: boolean);
-begin
-  DocList(Entered);
-end;
-
-procedure THTMLTopicRenderer.DocListItem;
-begin
-  if AnyCharsInLine then
-    DocBreak;
-  AddText('þ'+hscLineStart);
-end;
-
-procedure THTMLTopicRenderer.DocDefList(Entered: boolean);
-begin
-  if Entered then
-    begin
-{      if LastChar<>hscLineBreak then DocBreak;}
-    end
-  else
-    begin
-      if AnyCharsInLine then DocBreak;
-    end;
-end;
-
-procedure THTMLTopicRenderer.DocDefTerm;
-begin
-  DocBreak;
-end;
-
-procedure THTMLTopicRenderer.DocDefExp;
-begin
-  Inc(Indent,DefIndent);
-  DocBreak;
-  Dec(Indent,DefIndent);
-end;
-
-procedure THTMLTopicRenderer.DocTable(Entered: boolean);
-begin
-  if AnyCharsInLine then
-    DocBreak;
-  if Entered then
-    DocBreak;
-end;
-
-procedure THTMLTopicRenderer.DocTableRow(Entered: boolean);
-begin
-  if AnyCharsInLine then
-    DocBreak;
-end;
-
-procedure THTMLTopicRenderer.DocTableItem(Entered: boolean);
-begin
-  if Entered then
-    AddText(' - ');
-end;
-
-procedure THTMLTopicRenderer.DocHorizontalRuler;
-var OAlign: TParagraphAlign;
-begin
-  OAlign:=PAlign;
-  if AnyCharsInLine then DocBreak;
-  PAlign:=paCenter;
-  DocAddText(' '+CharStr('Ä',60)+' ');
-  DocBreak;
-  PAlign:=OAlign;
-end;
-
-procedure THTMLTopicRenderer.AddChar(C: char);
-begin
-  if (Topic=nil) or (TextPtr=MaxBytes) then Exit;
-  Topic^.Text^[TextPtr]:=ord(C);
-  Inc(TextPtr);
-  if (C>#15) and ((C<>' ') or (InPreFormatted=true)) then
-    AnyCharsInLine:=true;
-end;
-
-procedure THTMLTopicRenderer.AddText(S: string);
-var I: sw_integer;
-begin
-  for I:=1 to length(S) do
-    AddChar(S[I]);
-end;
-
-function THTMLTopicRenderer.GetSectionColor(Section: THTMLSection; var Color: byte): boolean;
-begin
-  GetSectionColor:=HTMLGetSectionColor(Section,Color);
-end;
-
-function THTMLTopicRenderer.BuildTopic(P: PTopic; AURL: string; HTMLFile: PTextFile;
-           ATopicLinks: PTopicLinkCollection): boolean;
-var OK: boolean;
-    TP: pointer;
-    I: sw_integer;
-begin
-  URL:=AURL;
-  Topic:=P; TopicLinks:=ATopicLinks;
-  OK:=Assigned(Topic) and Assigned(HTMLFile) and Assigned(TopicLinks);
-  if OK then
-    begin
-      if (Topic^.TextSize<>0) and Assigned(Topic^.Text) then
-        begin
-          FreeMem(Topic^.Text,Topic^.TextSize);
-          Topic^.TextSize:=0; Topic^.Text:=nil;
-        end;
-      Topic^.TextSize:=MaxHelpTopicSize;
-      GetMem(Topic^.Text,Topic^.TextSize);
-
-      TopicTitle:='';
-      InTitle:=false; InBody:={false}true; InAnchor:=false;
-      InParagraph:=false; InPreformatted:=false;
-      Indent:=0; CurHeadLevel:=0;
-      PAlign:=paLeft;
-      TextPtr:=0; LinkPtr:=0;
-      AnyCharsInLine:=false;
-      LastTextChar:=#0;
-      OK:=Process(HTMLFile);
-
-      if OK then
-        begin
-          { --- topic links --- }
-          if (Topic^.Links<>nil) and (Topic^.LinkSize>0) then
-            begin
-              FreeMem(Topic^.Links,Topic^.LinkSize);
-              Topic^.Links:=nil; Topic^.LinkCount:=0;
-            end;
-          Topic^.LinkCount:=LinkPtr{TopicLinks^.Count}; { <- eeeeeek! }
-          GetMem(Topic^.Links,Topic^.LinkSize);
-          if Topic^.LinkCount>0 then { FP causes numeric RTE 215 without this }
-          for I:=0 to Min(Topic^.LinkCount-1,High(LinkIndexes)-1) do
-            begin
-              Topic^.Links^[I].FileID:=Topic^.FileID;
-              Topic^.Links^[I].Context:=EncodeHTMLCtx(Topic^.FileID,LinkIndexes[I]+1);
-            end;
-          { --- topic text --- }
-          GetMem(TP,TextPtr);
-          Move(Topic^.Text^,TP^,TextPtr);
-          FreeMem(Topic^.Text,Topic^.TextSize);
-          Topic^.Text:=TP; Topic^.TextSize:=TextPtr;
-        end
-      else
-        begin
-          DisposeTopic(Topic);
-          Topic:=nil;
-        end;
-    end;
-  BuildTopic:=OK;
-end;
-
-constructor TCustomHTMLHelpFile.Init(AID: word);
-begin
-  inherited Init(AID);
-  New(Renderer, Init);
-  New(TopicLinks, Init(50,500));
-end;
-
-function TCustomHTMLHelpFile.SearchTopic(HelpCtx: THelpCtx): PTopic;
-function MatchCtx(P: PTopic): boolean; {$ifndef FPC}far;{$endif}
-begin
-  MatchCtx:=P^.HelpCtx=HelpCtx;
-end;
-var FileID,LinkNo: word;
-    P: PTopic;
-    FName: string;
-begin
-  DecodeHTMLCtx(HelpCtx,FileID,LinkNo);
-  if (HelpCtx<>0) and (FileID<>ID) then P:=nil else
-  if (FileID=ID) and (LinkNo>TopicLinks^.Count) then P:=nil else
-    begin
-      P:=Topics^.FirstThat(@MatchCtx);
-      if P=nil then
-        begin
-          if LinkNo=0 then
-            FName:=DefaultFileName
-          else
-            FName:=TopicLinks^.At(LinkNo-1)^;
-          P:=NewTopic(ID,HelpCtx,0,FName,nil,0);
-          Topics^.Insert(P);
-        end;
-    end;
-  SearchTopic:=P;
-end;
-
-function TCustomHTMLHelpFile.ReadTopic(T: PTopic): boolean;
-var OK: boolean;
-    HTMLFile: PMemoryTextFile;
-    Name: string;
-    Link,Bookmark: string;
-    P: sw_integer;
-begin
-  Bookmark:='';
-  OK:=T<>nil;
-  if OK then
-    begin
-      if T^.HelpCtx=0 then Name:=DefaultFileName else
-        begin
-          Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
-          Link:=FormatPath(Link);
-          P:=Pos('#',Link);
-          if P>0 then
-          begin
-            Bookmark:=copy(Link,P+1,length(Link));
-            Link:=copy(Link,1,P-1);
-          end;
-{          if CurFileName='' then Name:=Link else
-          Name:=CompletePath(CurFileName,Link);}
-          Name:=Link;
-        end;
-      HTMLFile:=New(PDOSTextFile, Init(Name));
-      if HTMLFile=nil then
-        begin
-          New(HTMLFile, Init);
-          HTMLFile^.AddLine('<HEAD><TITLE>'+msg_pagenotavailable+'</TITLE></HEAD>');
-          HTMLFile^.AddLine(
-            '<BODY>'+
-            FormatStrStr(msg_cantaccessurl,Name)+'<br><br>'+
-            '</BODY>');
-        end;
-      OK:=Renderer^.BuildTopic(T,Name,HTMLFile,TopicLinks);
-      if OK then CurFileName:=Name;
-      if HTMLFile<>nil then Dispose(HTMLFile, Done);
-      if BookMark='' then
-        T^.StartNamedMark:=0
-      else
-        T^.StartNamedMark:=T^.GetNamedMarkIndex(BookMark)+1;
-    end;
-  ReadTopic:=OK;
-end;
-
-destructor TCustomHTMLHelpFile.Done;
-begin
-  inherited Done;
-  if Renderer<>nil then Dispose(Renderer, Done);
-  if TopicLinks<>nil then Dispose(TopicLinks, Done);
-end;
-
-constructor THTMLHelpFile.Init(AFileName: string; AID: word; ATOCEntry: string);
-begin
-  if inherited Init(AID)=false then Fail;
-  DefaultFileName:=AFileName; TOCEntry:=ATOCEntry;
-  if DefaultFileName='' then
-  begin
-    Done;
-    Fail;
-  end;
-end;
-
-function THTMLHelpFile.LoadIndex: boolean;
-begin
-  IndexEntries^.Insert(NewIndexEntry(TOCEntry,ID,0));
-  LoadIndex:=true;
-end;
-
-constructor THTMLIndexHelpFile.Init(AFileName: string; AID: word);
-begin
-  inherited Init(AID);
-  IndexFileName:=AFileName;
-end;
-
-function THTMLIndexHelpFile.LoadIndex: boolean;
-function FormatAlias(Alias: string): string;
-begin
-  if Assigned(HelpFacility) then
-    if length(Alias)>HelpFacility^.IndexTabSize-4 then
-      Alias:=Trim(copy(Alias,1,HelpFacility^.IndexTabSize-4-2))+'..';
-  FormatAlias:=Alias;
-end;
-(*procedure AddDoc(P: PHTMLLinkScanDocument); {$ifndef FPC}far;{$endif}
-var I: sw_integer;
-    TLI: THelpCtx;
-begin
-  for I:=1 to P^.GetAliasCount do
-  begin
-    TLI:=TopicLinks^.AddItem(P^.GetName);
-    TLI:=EncodeHTMLCtx(ID,TLI+1);
-    IndexEntries^.Insert(NewIndexEntry(FormatAlias(P^.GetAlias(I-1)),ID,TLI));
-  end;
-end;*)
-var S: PBufStream;
-    LS: PHTMLLinkScanner;
-    OK: boolean;
-    TLI: THelpCtx;
-    I,J: sw_integer;
-begin
-  New(S, Init(IndexFileName,stOpenRead,4096));
-  OK:=Assigned(S);
-  if OK then
-  begin
-    New(LS, LoadDocuments(S^));
-    OK:=Assigned(LS);
-    if OK then
-    begin
-      LS^.SetBaseDir(DirOf(IndexFileName));
-      for I:=0 to LS^.GetDocumentCount-1 do
-       for J:=0 to LS^.GetDocumentAliasCount(I)-1 do
-        begin
-          TLI:=TopicLinks^.AddItem(LS^.GetDocumentURL(I));
-          TLI:=EncodeHTMLCtx(ID,TLI+1);
-          IndexEntries^.Insert(NewIndexEntry(FormatAlias(LS^.GetDocumentAlias(I,J)),ID,TLI));
-        end;
-      Dispose(LS, Done);
-    end;
-    Dispose(S, Done);
-  end;
-  LoadIndex:=OK;
-end;
-
-END.
-{
-  $Log$
-  Revision 1.2  2000-10-31 22:35:56  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.2  2000/10/18 21:53:27  pierre
-   * several Gabor fixes
-
-  Revision 1.1.2.1  2000/09/18 13:20:56  pierre
-   New bunch of Gabor changes
-
-  Revision 1.1  2000/07/13 09:48:37  michael
-  + Initial import
-
-  Revision 1.15  2000/06/22 09:07:15  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.14  2000/06/16 08:50:45  pierre
-   + new bunch of Gabor's changes
-
-}

+ 0 - 554
ide/text/whtmlscn.pas

@@ -1,554 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by Berczi Gabor
-
-    HTML scanner objects
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit WHTMLScn;
-
-interface
-
-uses Objects,
-     WHTML;
-
-const
-     HTMLIndexMagicNo = ord('H')+ord('H') shl 8+ord('I') shl 16+ord('X') shl 24;
-     HTMLIndexVersion = 1;
-
-type
-     PHTMLLinkScanner = ^THTMLLinkScanner;
-
-     TCustomHTMLLinkScanner = object(THTMLParser)
-       function    DocAddTextChar(C: char): boolean; virtual;
-       procedure   DocAnchor(Entered: boolean); virtual;
-     public
-    {a}function    CheckURL(const URL: string): boolean; virtual;
-    {a}function    CheckText(const Text: string): boolean; virtual;
-    {a}procedure   AddLink(const LinkText, LinkURL: string); virtual;
-    {a}function    GetDocumentBaseURL: string; virtual;
-     private
-       CurLinkText: string;
-       CurURL: string;
-       InAnchor: boolean;
-     end;
-
-     PHTMLLinkScanDocument = ^THTMLLinkScanDocument;
-     THTMLLinkScanDocument = object(TObject)
-       constructor Init(const ADocName: string);
-       function    GetName: string;
-       function    GetAliasCount: sw_integer;
-       function    GetAlias(Index: sw_integer): string;
-       procedure   AddAlias(const Alias: string);
-       constructor Load(var S: TStream);
-       procedure   Store(var S: TStream);
-       destructor  Done; virtual;
-     private
-       DocName: PString;
-       Aliases: PStringCollection;
-     end;
-
-     PHTMLLinkScanDocumentCollection = ^THTMLLinkScanDocumentCollection;
-     THTMLLinkScanDocumentCollection = object(TSortedCollection)
-       constructor Init(AScanner: PHTMLLinkScanner; ALimit, ADelta: Integer);
-       function    Compare(Key1, Key2: Pointer): sw_Integer; virtual;
-       function    At(Index: sw_Integer): PHTMLLinkScanDocument;
-       function    SearchDocument(const DocName: string): PHTMLLinkScanDocument;
-     private
-       Scanner: PHTMLLinkScanner;
-     end;
-
-     THTMLLinkScanner = object(TCustomHTMLLinkScanner)
-       constructor Init(const ABaseDir: string);
-       procedure   SetBaseDir(const ABaseDir: string);
-       function    GetDocumentCount: sw_integer;
-       function    GetDocumentURL(DocIndex: sw_integer): string;
-       function    GetDocumentAliasCount(DocIndex: sw_integer): sw_integer;
-       function    GetDocumentAlias(DocIndex, AliasIndex: sw_integer): string;
-       constructor LoadDocuments(var S: TStream);
-       procedure   StoreDocuments(var S: TStream);
-       destructor  Done; virtual;
-     public
-       procedure   AddLink(const LinkText, LinkURL: string); virtual;
-     private
-       Documents: PHTMLLinkScanDocumentCollection;
-       BaseDir: PString;
-       function    ExpandChildURL(const S: string): string;
-       function    NormalizeChildURL(const S: string): string;
-     end;
-
-     THTMLLinkScanState = (ssScheduled,ssProcessing,ssScanned);
-
-     PHTMLLinkScanFile = ^THTMLLinkScanFile;
-     THTMLLinkScanFile = object(TObject)
-       constructor Init(const ADocumentURL: string);
-       function    GetDocumentURL: string;
-       destructor  Done; virtual;
-     private
-       DocumentURL  : PString;
-     public
-       State        : THTMLLinkScanState;
-     end;
-
-     PHTMLLinkScanFileCollection = ^THTMLLinkScanFileCollection;
-     THTMLLinkScanFileCollection = object(TSortedCollection)
-       function At(Index: sw_Integer): PHTMLLinkScanFile;
-       function Compare(Key1, Key2: Pointer): sw_Integer; virtual;
-       function SearchFile(const DocURL: string): PHTMLLinkScanFile;
-       function FindFileWithState(AState: THTMLLinkScanState): PHTMLLinkScanFile;
-     end;
-
-     THTMLLinkScanOption = (soSubDocsOnly);
-     THTMLLinkScanOptions = set of THTMLLinkScanOption;
-
-     THTMLFileLinkScanner = object(THTMLLinkScanner)
-       constructor Init(const ABaseDir: string);
-       procedure   ProcessDocument(const DocumentURL: string; AOptions: THTMLLinkScanOptions);
-       destructor  Done; virtual;
-     public
-       function    GetDocumentBaseURL: string; virtual;
-       procedure   AddLink(const LinkText, LinkURL: string); virtual;
-       function    CheckURL(const URL: string): boolean; virtual;
-     private
-       Options: THTMLLinkScanOptions;
-       BaseURL: string;
-       CurBaseURL: string;
-       DocumentFiles: PHTMLLinkScanFileCollection;
-       procedure   ScheduleDoc(const DocumentURL: string);
-     public
-       procedure   ProcessDoc(Doc: PHTMLLinkScanFile); virtual;
-     end;
-
-procedure RegisterWHTMLScan;
-
-implementation
-
-uses WUtils;
-
-const
-  RHTMLLinkScanDocument: TStreamRec = (
-     ObjType: 19500;
-     VmtLink: Ofs(TypeOf(THTMLLinkScanDocument)^);
-     Load:    @THTMLLinkScanDocument.Load;
-     Store:   @THTMLLinkScanDocument.Store
-  );
-
-function TCustomHTMLLinkScanner.DocAddTextChar(C: char): boolean;
-var Added: boolean;
-begin
-  Added:=false;
-  if InAnchor then
-  begin
-    CurLinkText:=CurLinkText+C;
-    Added:=true;
-  end;
-  DocAddTextChar:=Added;
-end;
-
-procedure TCustomHTMLLinkScanner.DocAnchor(Entered: boolean);
-begin
-  if Entered then
-    begin
-      CurLinkText:='';
-      if DocGetTagParam('HREF',CurURL)=false then CurURL:='';
-      CurURL:=Trim(CurURL);
-      CurURL:=CompleteURL(GetDocumentBaseURL,CurURL);
-    end
-  else
-    begin
-      CurLinkText:=Trim(CurLinkText);
-      if CheckURL(CurURL) and CheckText(CurLinkText) then
-        AddLink(CurLinkText,CurURL);
-    end;
-  InAnchor:=Entered;
-end;
-
-function TCustomHTMLLinkScanner.GetDocumentBaseURL: string;
-begin
-  { Abstract }
-  GetDocumentBaseURL:='';
-end;
-
-function TCustomHTMLLinkScanner.CheckURL(const URL: string): boolean;
-begin
-  { Abstract }
-  CheckURL:=true;
-end;
-
-function TCustomHTMLLinkScanner.CheckText(const Text: string): boolean;
-begin
-  { Abstract }
-  CheckText:=true;
-end;
-
-procedure TCustomHTMLLinkScanner.AddLink(const LinkText, LinkURL: string);
-begin
-  { Abstract }
-end;
-
-constructor THTMLLinkScanDocument.Init(const ADocName: string);
-begin
-  inherited Init;
-  SetStr(DocName,ADocName);
-  New(Aliases, Init(10,10));
-end;
-
-function THTMLLinkScanDocument.GetName: string;
-begin
-  GetName:=GetStr(DocName);
-end;
-
-function THTMLLinkScanDocument.GetAliasCount: sw_integer;
-begin
-  GetAliasCount:=Aliases^.Count;
-end;
-
-function THTMLLinkScanDocument.GetAlias(Index: sw_integer): string;
-begin
-  GetAlias:=GetStr(Aliases^.At(Index));
-end;
-
-procedure THTMLLinkScanDocument.AddAlias(const Alias: string);
-begin
-  Aliases^.Insert(NewStr(Alias));
-end;
-
-constructor THTMLLinkScanDocument.Load(var S: TStream);
-begin
-  inherited Init;
-  DocName:=S.ReadStr;
-  New(Aliases, Load(S));
-end;
-
-procedure THTMLLinkScanDocument.Store(var S: TStream);
-begin
-  S.WriteStr(DocName);
-  Aliases^.Store(S);
-end;
-
-destructor THTMLLinkScanDocument.Done;
-begin
-  inherited Done;
-  if Assigned(Aliases) then Dispose(Aliases, Done); Aliases:=nil;
-  if Assigned(DocName) then DisposeStr(DocName); DocName:=nil;
-end;
-
-constructor THTMLLinkScanDocumentCollection.Init(AScanner: PHTMLLinkScanner; ALimit, ADelta: Integer);
-begin
-  inherited Init(ALimit,ADelta);
-  Scanner:=AScanner;
-end;
-
-function THTMLLinkScanDocumentCollection.Compare(Key1, Key2: Pointer): sw_Integer;
-var R: sw_integer;
-    K1: PHTMLLinkScanDocument absolute Key1;
-    K2: PHTMLLinkScanDocument absolute Key2;
-    S1,S2: string;
-begin
-  S1:=K1^.GetName; S2:=K2^.GetName;
-  if Assigned(Scanner) then
-   begin S1:=Scanner^.ExpandChildURL(S1); S2:=Scanner^.ExpandChildURL(S2); end;
-  S1:=UpcaseStr(S1); S2:=UpcaseStr(S2);
-  if S1<S2 then R:=-1 else
-  if S1>S2 then R:= 1 else
-  R:=0;
-  Compare:=R;
-end;
-
-function THTMLLinkScanDocumentCollection.At(Index: sw_Integer): PHTMLLinkScanDocument;
-begin
-  At:=inherited At(Index);
-end;
-
-function THTMLLinkScanDocumentCollection.SearchDocument(const DocName: string): PHTMLLinkScanDocument;
-var D,P: PHTMLLinkScanDocument;
-    Index: sw_integer;
-begin
-  New(D, Init(DocName));
-  if Search(D, Index)=false then P:=nil else
-    P:=At(Index);
-  Dispose(D, Done);
-  SearchDocument:=P;
-end;
-
-constructor THTMLLinkScanner.Init(const ABaseDir: string);
-begin
-  inherited Init;
-  New(Documents, Init(@Self,50,100));
-  SetBaseDir(ABaseDir);
-end;
-
-procedure THTMLLinkScanner.SetBaseDir(const ABaseDir: string);
-begin
-  if Assigned(BaseDir) then DisposeStr(BaseDir);
-  BaseDir:=NewStr(CompleteDir(ABaseDir));
-end;
-
-function THTMLLinkScanner.GetDocumentCount: sw_integer;
-begin
-  GetDocumentCount:=Documents^.Count;
-end;
-
-function THTMLLinkScanner.ExpandChildURL(const S: string): string;
-begin
-  ExpandChildURL:=CompleteURL(GetStr(BaseDir),S);
-end;
-
-function THTMLLinkScanner.NormalizeChildURL(const S: string): string;
-var URL: string;
-begin
-  URL:=S;
-  if GetStr(BaseDir)<>'' then
-   if copy(UpcaseStr(S),1,length(GetStr(BaseDir)))=UpcaseStr(GetStr(BaseDir)) then
-     URL:=copy(S,length(GetStr(BaseDir))+1,length(S));
-  NormalizeChildURL:=URL;
-end;
-
-function THTMLLinkScanner.GetDocumentURL(DocIndex: sw_integer): string;
-begin
-  GetDocumentURL:=ExpandChildURL(Documents^.At(DocIndex)^.GetName);
-end;
-
-function THTMLLinkScanner.GetDocumentAliasCount(DocIndex: sw_integer): sw_integer;
-begin
-  GetDocumentAliasCount:=Documents^.At(DocIndex)^.GetAliasCount;
-end;
-
-function THTMLLinkScanner.GetDocumentAlias(DocIndex, AliasIndex: sw_integer): string;
-begin
-  GetDocumentAlias:=Documents^.At(DocIndex)^.GetAlias(AliasIndex);
-end;
-
-procedure THTMLLinkScanner.AddLink(const LinkText, LinkURL: string);
-var D: PHTMLLinkScanDocument;
-begin
-  D:=Documents^.SearchDocument(LinkURL);
-  if D=nil then
-  begin
-    New(D, Init(NormalizeChildURL(LinkURL)));
-    Documents^.Insert(D);
-  end;
-  D^.AddAlias(LinkText);
-end;
-
-constructor THTMLLinkScanner.LoadDocuments(var S: TStream);
-var P,L: longint;
-    OK: boolean;
-    PS: PString;
-begin
-  OK:=false;
-  P:=S.GetPos;
-  S.Read(L,sizeof(L));
-  if (S.Status=stOK) and (L=HTMLIndexMagicNo) then
-  begin
-    S.Read(L,sizeof(L));
-    OK:=(S.Status=stOK);
-  end;
-  if not OK then
-    begin
-      S.Reset;
-      S.Seek(P);
-    end
-  else
-    BaseDir:=S.ReadStr;
-  New(Documents, Load(S));
-  if not Assigned(Documents) then
-    Fail;
-end;
-
-procedure THTMLLinkScanner.StoreDocuments(var S: TStream);
-var L: longint;
-begin
-  L:=HTMLIndexMagicNo;
-  S.Write(L,sizeof(L));
-  L:=HTMLIndexVersion;
-  S.Write(L,sizeof(L));
-  S.WriteStr(BaseDir);
-  Documents^.Store(S);
-end;
-
-destructor THTMLLinkScanner.Done;
-begin
-  inherited Done;
-  if Assigned(Documents) then Dispose(Documents, Done); Documents:=nil;
-  if Assigned(BaseDir) then DisposeStr(BaseDir); BaseDir:=nil;
-end;
-
-constructor THTMLLinkScanFile.Init(const ADocumentURL: string);
-begin
-  inherited Init;
-  SetStr(DocumentURL,ADocumentURL);
-end;
-
-function THTMLLinkScanFile.GetDocumentURL: string;
-begin
-  GetDocumentURL:=GetStr(DocumentURL);
-end;
-
-destructor THTMLLinkScanFile.Done;
-begin
-  inherited Done;
-  if Assigned(DocumentURL) then DisposeStr(DocumentURL); DocumentURL:=nil;
-end;
-
-function THTMLLinkScanFileCollection.At(Index: sw_Integer): PHTMLLinkScanFile;
-begin
-  At:=inherited At(Index);
-end;
-
-function THTMLLinkScanFileCollection.Compare(Key1, Key2: Pointer): sw_Integer;
-var R: integer;
-    K1: PHTMLLinkScanFile absolute Key1;
-    K2: PHTMLLinkScanFile absolute Key2;
-    S1,S2: string;
-begin
-  S1:=UpcaseStr(K1^.GetDocumentURL); S2:=UpcaseStr(K2^.GetDocumentURL);
-  if S1<S2 then R:=-1 else
-  if S1>S2 then R:= 1 else
-  R:=0;
-  Compare:=R;
-end;
-
-function THTMLLinkScanFileCollection.SearchFile(const DocURL: string): PHTMLLinkScanFile;
-var P,D: PHTMLLinkScanFile;
-    Index: sw_integer;
-begin
-  New(D, Init(DocURL));
-  if Search(D,Index)=false then P:=nil else
-    P:=At(Index);
-  Dispose(D, Done);
-  SearchFile:=P;
-end;
-
-function THTMLLinkScanFileCollection.FindFileWithState(AState: THTMLLinkScanState): PHTMLLinkScanFile;
-var I: sw_integer;
-    P,D: PHTMLLinkScanFile;
-begin
-  P:=nil;
-  for I:=0 to Count-1 do
-  begin
-    D:=At(I);
-    if D^.State=AState then
-      begin
-        P:=D;
-        Break;
-      end;
-  end;
-  FindFileWithState:=P;
-end;
-
-constructor THTMLFileLinkScanner.Init(const ABaseDir: string);
-begin
-  inherited Init(ABaseDir);
-  New(DocumentFiles, Init(50,100));
-end;
-
-procedure THTMLFileLinkScanner.ProcessDocument(const DocumentURL: string; AOptions: THTMLLinkScanOptions);
-var P: PHTMLLinkScanFile;
-begin
-  CurBaseURL:=''; Options:=AOptions;
-  ScheduleDoc(DocumentURL);
-  repeat
-    P:=DocumentFiles^.FindFileWithState(ssScheduled);
-    if Assigned(P) then
-      ProcessDoc(P);
-  until P=nil;
-end;
-
-function THTMLFileLinkScanner.GetDocumentBaseURL: string;
-begin
-  GetDocumentBaseURL:=CurBaseURL;
-end;
-
-function THTMLFileLinkScanner.CheckURL(const URL: string): boolean;
-var OK: boolean;
-begin
-  if soSubDocsOnly in Options then
-    OK:=UpcaseStr(copy(URL,1,length(BaseURL)))=UpcaseStr(BaseURL)
-  else
-    OK:=true;
-  CheckURL:=OK;
-end;
-
-procedure THTMLFileLinkScanner.AddLink(const LinkText, LinkURL: string);
-var D: PHTMLLinkScanFile;
-    P: sw_integer;
-    DocURL: string;
-begin
-  P:=Pos('#',LinkURL);
-  if P=0 then DocURL:=LinkURL else DocURL:=copy(LinkURL,1,P-1);
-  D:=DocumentFiles^.SearchFile(DocURL);
-  if Assigned(D)=false then
-      ScheduleDoc(DocURL);
-  inherited AddLink(LinkText,LinkURL);
-end;
-
-procedure THTMLFileLinkScanner.ProcessDoc(Doc: PHTMLLinkScanFile);
-var F: PDOSTextFile;
-begin
-  if Assigned(Doc)=false then Exit;
-
-  Doc^.State:=ssProcessing;
-  New(F, Init(Doc^.GetDocumentURL));
-  if Assigned(F) then
-  begin
-    CurBaseURL:=CompleteURL(Doc^.GetDocumentURL,'');
-    Process(F);
-    Dispose(F, Done);
-  end;
-  Doc^.State:=ssScanned;
-end;
-
-procedure THTMLFileLinkScanner.ScheduleDoc(const DocumentURL: string);
-var D: PHTMLLinkScanFile;
-begin
-  New(D, Init(DocumentURL));
-  D^.State:=ssScheduled;
-  DocumentFiles^.Insert(D);
-end;
-
-destructor THTMLFileLinkScanner.Done;
-begin
-  inherited Done;
-  if Assigned(DocumentFiles) then Dispose(DocumentFiles, Done); DocumentFiles:=nil;
-end;
-
-procedure RegisterWHTMLScan;
-begin
-  RegisterType(RHTMLLinkScanDocument);
-end;
-
-
-END.
-{
-  $Log$
-  Revision 1.2  2000-10-31 22:35:56  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/10/18 21:53:28  pierre
-   * several Gabor fixes
-
-  Revision 1.1  2000/07/13 09:48:37  michael
-  + Initial import
-
-  Revision 1.7  2000/06/22 09:07:15  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.6  2000/05/29 11:09:14  pierre
-   + New bunch of Gabor's changes: see fixes.txt
-
-  Revision 1.5  2000/05/17 08:49:16  pierre
-   readded
-
-  Revision 1.1  2000/04/25 08:42:32  pierre
-   * New Gabor changes : see fixes.txt
-
-}

+ 0 - 257
ide/text/winclip.pas

@@ -1,257 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1999 by Pierre Muller
-
-    Connection with Windows Clipboard
-    based on Ralph Brown Interrupt List
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$i globdir.inc}
-unit WinClip;
-
-interface
-
-{$ifdef WinClipSupported}
-
-function WinClipboardSupported : boolean;
-function OpenWinClipboard : boolean;
-function EmptyWinClipboard : boolean;
-function GetTextWinClipboardSize : longint;
-function GetTextWinClipBoardData(var p : pchar;var l : longint) : boolean;
-function SetTextWinClipBoardData(p : pchar;l : longint) : boolean;
-{$endif WinClipSupported}
-
-implementation
-
-{$ifdef WinClipSupported}
-{$ifdef DOS}
-  uses
-    pmode,
-{$ifdef go32v2}
-    {go32   sorry Gabor, but its still not compiling without that ! }
-    {now it works. btw. you don't have to sorry - just to tell me... ;)) Gabor }
-{$endif go32v2}
-    dos;
-{$endif DOS}
-
-{$ifdef win32}
-  uses
-    strings,windows;
-{$endif win32}
-
-{$ifdef DOS}
-function WinClipboardSupported : boolean;
-var
-  r : registers;
-begin
-  r.ax:=$1700;
-  RealIntr($2F,r);
-  WinClipboardSupported:=(r.ax<>$1700);
-end;
-
-function OpenWinClipboard : boolean;
-var
-  r : Registers;
-begin
-  r.ax:=$1701;
-  RealIntr($2F,r);
-  OpenWinClipboard:=(r.ax<>0);
-end;
-
-function EmptyWinClipboard : boolean;
-var
-  r : Registers;
-begin
-  r.ax:=$1702;
-  RealIntr($2F,r);
-  EmptyWinClipboard:=(r.ax<>0);
-end;
-
-function CloseWinClipboard : boolean;
-var
-  r : Registers;
-begin
-  r.ax:=$1708;
-  RealIntr($2F,r);
-  CloseWinClipboard:=(r.ax<>0);
-end;
-
-function InternGetDataSize : longint;
-var
-  r : Registers;
-begin
-  r.ax:=$1704;
-  r.dx:=7 {OEM Text rather then 1 : Text };
-  RealIntr($2F,r);
-  InternGetDataSize:=(r.dx shl 16) + r.ax;
-end;
-{$endif DOS}
-
-{$ifdef win32}
-function WinClipboardSupported : boolean;
-begin
-  WinClipboardSupported:=true;
-end;
-
-function OpenWinClipboard : boolean;
-begin
-  OpenWinClipboard:=OpenClipboard(0);
-end;
-
-function EmptyWinClipboard : boolean;
-begin
-  EmptyWinClipboard:=EmptyClipboard;
-end;
-
-function CloseWinClipboard : boolean;
-begin
-  CloseWinClipboard:=CloseClipboard;
-end;
-
-function InternGetDataSize : longint;
-var HC : Handle;
-begin
-  HC:=GetClipBoardData(CF_OEMTEXT);
-  if HC<>0 then
-    begin
-      InternGetDataSize:=strlen(pchar(GlobalLock(HC)));
-      GlobalUnlock(HC);
-    end
-  else
-    InternGetDataSize:=0;
-end;
-{$endif win32}
-
-
-function GetTextWinClipboardSize : longint;
-begin
-  OpenWinClipboard;
-  GetTextWinClipboardSize:=InternGetDataSize;
-  CloseWinClipboard;
-end;
-
-function GetTextWinClipBoardData(var p : pchar;var l : longint) : boolean;
-var
-{$ifdef DOS}
-  r : Registers;
-  M : MemPtr;
-{$endif DOS}
-{$ifdef win32}
-  h : HGlobal;
-  pp : pchar;
-{$endif win32}
-begin
-  p:=nil;
-  GetTextWinClipBoardData:=False;
-  if not OpenWinClipBoard then
-    exit;
-{$ifdef DOS}
-  l:=InternGetDataSize;
-  if (l=0) or (l>65520) then
-    begin
-      l:=0;
-      CloseWinClipBoard;
-      exit;
-    end;
-  GetMem(p,l);
-  GetDosMem(M,l);
-  r.ax:=$1705;
-  r.dx:=7{ OEM Text rather then 1 : Text };
-  r.es:=M.DosSeg;
-  r.bx:=M.DosOfs;
-  RealIntr($2F,r);
-  GetTextWinClipBoardData:=(r.ax<>0);
-{$endif DOS}
-{$ifdef win32}
-  h:=GetClipboardData(CF_OEMTEXT);
-  if h<>0 then
-    begin
-      pp:=pchar(GlobalLock(h));
-      l:=strlen(pp)+1;
-      getmem(p,l);
-      move(pp^,p^,l);
-      GlobalUnlock(h);
-    end;
-  GetTextWinClipBoardData:=h<>0;
-{$endif win32}
-  CloseWinClipBoard;
-{$ifdef DOS}
-  M.MoveDataFrom(l,P^);
-  FreeDosMem(M);
-{$endif DOS}
-end;
-
-function SetTextWinClipBoardData(p : pchar;l : longint) : boolean;
-var
-{$ifdef DOS}
-  r : Registers;
-  M : MemPtr;
-{$endif DOS}
-{$ifdef win32}
-  h : HGlobal;
-  pp : pchar;
-{$endif win32}
-begin
-  SetTextWinClipBoardData:=False;
-  if (l=0) or (l>65520) then
-    exit;
-  if not OpenWinClipBoard then
-    exit;
-  EmptyWinClipBoard;
-{$ifdef DOS}
-  GetDosMem(M,l);
-  M.MoveDataTo(P^,l);
-  r.ax:=$1703;
-  r.dx:=7{ OEM Text rather then 1 : Text };
-  r.es:=M.DosSeg;
-  r.bx:=M.DosOfs;
-  r.si:=l shr 16;
-  r.cx:=l and $ffff;
-  RealIntr($2F,r);
-  SetTextWinClipBoardData:=(r.ax<>0);
-  FreeDosMem(M);
-{$endif DOS}
-{$ifdef win32}
-  h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l);
-  pp:=pchar(GlobalLock(h));
-  move(p^,pp^,l);
-  GlobalUnlock(h);
-  SetTextWinClipBoardData:=(SetClipboardData(CF_OEMTEXT,h)=h);
-{$endif win32}
-  CloseWinClipBoard;
-end;
-
-{$endif WinClipSupported}
-end.
-
-{
- $Log$
- Revision 1.1  2000-07-13 09:48:37  michael
- + Initial import
-
- Revision 1.7  2000/06/16 08:50:45  pierre
-  + new bunch of Gabor's changes
-
- Revision 1.6  2000/04/25 08:42:35  pierre
-  * New Gabor changes : see fixes.txt
-
- Revision 1.5  2000/04/18 11:42:39  pierre
-  lot of Gabor changes : see fixes.txt
-
- Revision 1.4  1999/11/05 13:46:26  pierre
-   * Use CF_OEMTEXT under win32 and dx=7 under go32v2 to obtain
-     OEM to ANSI conversion
-   * GetClipboardDataSize for Win32
-
- Revision 1.3  1999/10/14 14:22:23  florian
-   * if no ini file is found the ide uses some useful defaults
-
-}

+ 0 - 73
ide/text/windebug.pas

@@ -1,73 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by Pierre Muller
-
-    Win32 specific debugger routines for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-Unit windebug;
-
-interface
-
-  type
-    DebuggeeState = (Running_State,Stopped_State);
-
-  procedure  ChangeDebuggeeWindowTitleTo(State : DebuggeeState);
-
-implementation
-
-uses
-  gdbint,
-  strings,
-  windows;
-
- function GetWindowHandle(H : HWND; state : LPARAM) : WINBOOL;stdcall;
-   var pTitle, pEnd, pNewTitle : pchar;
-       len : longint;
-   begin
-     GetWindowHandle:=true;
-     GetMem(pTitle,256);
-     { we want all windows !! }
-     if GetWindowThreadProcessId(H,nil)=inferior_pid then
-       begin
-         len:=GetWindowText(H,pTitle,256);
-         if DebuggeeState(State) = Stopped_State then
-           begin
-             GetMem(pNewTitle,len+50);
-             pEnd:=strpos(pTitle,'... running under FP debugger');
-             if assigned(pEnd) then
-               pEnd^:=#0;
-             strcopy(pNewTitle,pTitle);
-             strcat(pNewTitle,'... stopped by FP debugger');
-             SetWindowText(H,pNewTitle);
-             FreeMem(pNewTitle,len+50);
-           end
-         else if DebuggeeState(State) = Running_State then
-           begin
-             GetMem(pNewTitle,len+50);
-             pEnd:=strpos(pTitle,'... stopped by FP debugger');
-             if assigned(pEnd) then
-               pEnd^:=#0;
-             strcopy(pNewTitle,pTitle);
-             strcat(pNewTitle,'... running under FP debugger');
-             SetWindowText(H,pNewTitle);
-             FreeMem(pNewTitle,len+50);
-           end;
-       end;
-     FreeMem(pTitle,256);
-   end;
-
- procedure  ChangeDebuggeeWindowTitleTo(State : DebuggeeState);
-   begin
-     EnumWindows(EnumWindowsProc(@GetWindowHandle),longint(State));
-   end;
-
-end.

+ 0 - 572
ide/text/wini.pas

@@ -1,572 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by B‚rczi G bor
-
-    Reading and writing .INI files
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit WINI;
-
-interface
-
-uses Objects;
-
-type
-
-    PINIEntry = ^TINIEntry;
-    TINIEntry = object(TObject)
-      constructor Init(const ALine: string);
-      function    GetText: string;
-      function    GetTag: string;
-      function    GetComment: string;
-      function    GetValue: string;
-      procedure   SetValue(const S: string);
-      destructor  Done; virtual;
-    private
-      Tag      : PString;
-      Value    : PString;
-      Comment  : PString;
-      Text     : PString;
-      Modified : boolean;
-      procedure Split;
-    end;
-
-    PINISection = ^TINISection;
-    TINISection = object(TObject)
-      constructor Init(const AName: string);
-      function    GetName: string;
-      function    AddEntry(const S: string): PINIEntry;
-      function    SearchEntry(Tag: string): PINIEntry; virtual;
-      procedure   DeleteEntry(Tag: string);
-      procedure   ForEachEntry(EnumProc: pointer); virtual;
-      destructor  Done; virtual;
-    private
-      Name     : PString;
-      Entries  : PCollection;
-    end;
-
-    PINIFile = ^TINIFile;
-    TINIFile = object(TObject)
-      MakeNullEntries: boolean;
-      constructor Init(const AFileName: string);
-      function    GetFileName: string;
-      function    Read: boolean; virtual;
-      function    Update: boolean; virtual;
-      function    IsModified: boolean; virtual;
-      function    SearchSection(Section: string): PINISection; virtual;
-      function    SearchEntry(const Section, Tag: string): PINIEntry; virtual;
-      procedure   ForEachSection(EnumProc: pointer); virtual;
-      procedure   ForEachEntry(const Section: string; EnumProc: pointer); virtual;
-      function    GetEntry(const Section, Tag, Default: string): string; virtual;
-      procedure   SetEntry(const Section, Tag, Value: string); virtual;
-      function    GetIntEntry(const Section, Tag: string; Default: longint): longint; virtual;
-      procedure   SetIntEntry(const Section, Tag: string; Value: longint); virtual;
-      procedure   DeleteSection(const Section: string); virtual;
-      procedure   DeleteEntry(const Section, Tag: string);
-      destructor  Done; virtual;
-    private
-{      ReadOnly: boolean;}
-      Sections: PCollection;
-      FileName: PString;
-    end;
-
-const MainSectionName : string[40] = 'MainSection';
-      CommentChar     : char = ';';
-      ValidStrDelimiters: set of char = ['''','"'];
-
-implementation
-
-uses
-  CallSpec,
-  WUtils;
-
-constructor TINIEntry.Init(const ALine: string);
-begin
-  inherited Init;
-  Text:=NewStr(ALine);
-  Split;
-end;
-
-
-function TINIEntry.GetText: string;
-var S,CoS: string;
-begin
-  if Text=nil then
-    begin
-      CoS:=GetComment;
-      S:=GetTag+'='+GetValue;
-      if Trim(S)='=' then S:=CoS else
-        if CoS<>'' then S:=S+' '+CommentChar+' '+CoS;
-    end
-    else S:=Text^;
-  GetText:=S;
-end;
-
-
-function TINIEntry.GetTag: string;
-begin
-  GetTag:=GetStr(Tag);
-end;
-
-
-function TINIEntry.GetComment: string;
-begin
-  GetComment:=GetStr(Comment);
-end;
-
-
-function TINIEntry.GetValue: string;
-begin
-  GetValue:=GetStr(Value);
-end;
-
-
-procedure TINIEntry.SetValue(const S: string);
-begin
-  if GetValue<>S then
-  begin
-    if Text<>nil then DisposeStr(Text); Text:=nil;
-    if Value<>nil then DisposeStr(Value);
-    Value:=NewStr(S);
-    Modified:=true;
-  end;
-end;
-
-
-procedure TINIEntry.Split;
-var S,ValueS: string;
-    P,P2,StartP: byte;
-    C: char;
-    InString: boolean;
-    Delimiter: char;
-begin
-  S:=GetText; Delimiter:=#0;
-  P:=Pos('=',S); P2:=Pos(CommentChar,S);
-  if (P2<>0) and (P2<P) then P:=0;
-  if P<>0 then
-    begin
-      Tag:=NewStr(copy(S,1,P-1));
-      P2:=P+1; InString:=false; ValueS:='';
-      StartP:=P2;
-      while (P2<=length(S)) do
-        begin
-          C:=S[P2];
-          if (P2=StartP) and (C in ValidStrDelimiters) then begin Delimiter:=C; InString:=true; end else
-          if C=Delimiter then InString:=not InString else
-          if (C=CommentChar) and (InString=false) then Break else
-          ValueS:=ValueS+C;
-          Inc(P2);
-        end;
-      Value:=NewStr(Trim(ValueS));
-      Comment:=NewStr(copy(S,P2+1,High(S)));
-    end else
-    begin
-      Tag:=nil;
-      Value:=nil;
-      Comment:=NewStr(S);
-    end;
-end;
-
-
-destructor TINIEntry.Done;
-begin
-  inherited Done;
-  if Text<>nil then DisposeStr(Text);
-  if Tag<>nil then DisposeStr(Tag);
-  if Value<>nil then DisposeStr(Value);
-  if Comment<>nil then DisposeStr(Comment);
-end;
-
-
-constructor TINISection.Init(const AName: string);
-begin
-  inherited Init;
-  Name:=NewStr(AName);
-  New(Entries, Init(50,500));
-end;
-
-
-function TINISection.GetName: string;
-begin
-  GetName:=GetStr(Name);
-end;
-
-function TINISection.AddEntry(const S: string): PINIEntry;
-var E: PINIEntry;
-begin
-  New(E, Init(S));
-  Entries^.Insert(E);
-  AddEntry:=E;
-end;
-
-procedure TINIFile.ForEachSection(EnumProc: pointer);
-var I: Sw_integer;
-   S: PINISection;
-begin
-  for I:=0 to Sections^.Count-1 do
-    begin
-      S:=Sections^.At(I);
-      CallPointerLocal(EnumProc,PreviousFramePointer,S);
-    end;
-end;
-
-procedure TINISection.ForEachEntry(EnumProc: pointer);
-var I: integer;
-    E: PINIEntry;
-begin
-  for I:=0 to Entries^.Count-1 do
-    begin
-      E:=Entries^.At(I);
-      CallPointerLocal(EnumProc,PreviousFramePointer,E);
-    end;
-end;
-
-function TINISection.SearchEntry(Tag: string): PINIEntry;
-function MatchingEntry(E: PINIEntry): boolean; {$ifndef FPC}far;{$endif}
-begin
-  MatchingEntry:=UpcaseStr(E^.GetTag)=Tag;
-end;
-begin
-  Tag:=UpcaseStr(Tag);
-  SearchEntry:=Entries^.FirstThat(@MatchingEntry);
-end;
-
-procedure TINISection.DeleteEntry(Tag: string);
-var
-  P : PIniEntry;
-begin
-  P:=SearchEntry(Tag);
-  if assigned(P) then
-    Entries^.Free(P);
-end;
-
-destructor TINISection.Done;
-begin
-  inherited Done;
-  if Name<>nil then DisposeStr(Name);
-  Dispose(Entries, Done);
-end;
-
-
-constructor TINIFile.Init(const AFileName: string);
-begin
-  inherited Init;
-  FileName:=NewStr(AFileName);
-  New(Sections, Init(50,50));
-  Read;
-end;
-
-function TINIFile.GetFileName: string;
-begin
-  GetFileName:=GetStr(FileName);
-end;
-
-function TINIFile.Read: boolean;
-var f: text;
-    OK: boolean;
-    S,TS: string;
-    P: PINISection;
-    I: integer;
-begin
-  New(P, Init(MainSectionName));
-  Sections^.Insert(P);
-  Assign(f,FileName^);
-{$I-}
-  Reset(f);
-  OK:=EatIO=0;
-  while OK and (Eof(f)=false) do
-    begin
-      readln(f,S);
-      TS:=Trim(S);
-      OK:=EatIO=0;
-      if OK then
-      if TS<>'' then
-      if copy(TS,1,1)='[' then
-      begin
-        I:=Pos(']',TS); if I=0 then I:=length(TS)+1;
-        New(P, Init(copy(TS,2,I-2)));
-        Sections^.Insert(P);
-      end else
-      begin
-        P^.AddEntry(S);
-      end;
-    end;
-  Close(f);
-  EatIO;
-{$I+}
-  Read:=true;
-end;
-
-function TINIFile.IsModified: boolean;
-
-  function SectionModified(P: PINISection): boolean; {$ifndef FPC}far;{$endif}
-
-    function EntryModified(E: PINIEntry): boolean; {$ifndef FPC}far;{$endif}
-    begin
-      EntryModified:=E^.Modified;
-    end;
-
-  begin
-    SectionModified:=(P^.Entries^.FirstThat(@EntryModified)<>nil);
-  end;
-
-begin
-  IsModified:=(Sections^.FirstThat(@SectionModified)<>nil);
-end;
-
-
-function TINIFile.Update: boolean;
-var f: text;
-    OK: boolean;
-    P: PINISection;
-    E: PINIEntry;
-    I,J: integer;
-begin
-  Assign(f,FileName^);
-{$I-}
-  Rewrite(f);
-  OK:=EatIO=0;
-  if OK then
-  for I:=0 to Sections^.Count-1 do
-    begin
-      P:=Sections^.At(I);
-      if I<>0 then writeln(f,'['+P^.GetName+']');
-      for J:=0 to P^.Entries^.Count-1 do
-        begin
-          E:=P^.Entries^.At(J);
-          writeln(f,E^.GetText);
-          OK:=EatIO=0;
-          if OK=false then Break;
-        end;
-      if OK and ((I>0) or (P^.Entries^.Count>0)) and (I<Sections^.Count-1) then
-        writeln(f,'');
-      OK:=OK and (EatIO=0);
-      if OK=false then Break;
-    end;
-  Close(f);
-  EatIO;
-{$I+}
-  if OK then
-    for I:=0 to Sections^.Count-1 do
-      begin
-        P:=Sections^.At(I);
-        for J:=0 to P^.Entries^.Count-1 do
-          begin
-            E:=P^.Entries^.At(J);
-            E^.Modified:=false;
-          end;
-      end;
-  Update:=OK;
-end;
-
-function TINIFile.SearchSection(Section: string): PINISection;
-function MatchingSection(P: PINISection): boolean; {$ifndef FPC}far;{$endif}
-var SN: string;
-    M: boolean;
-begin
-  SN:=UpcaseStr(P^.GetName);
-  M:=SN=Section;
-  MatchingSection:=M;
-end;
-begin
-  Section:=UpcaseStr(Section);
-  SearchSection:=Sections^.FirstThat(@MatchingSection);
-end;
-
-function TINIFile.SearchEntry(const Section, Tag: string): PINIEntry;
-var P: PINISection;
-    E: PINIEntry;
-begin
-  P:=SearchSection(Section);
-  if P=nil then E:=nil else
-    E:=P^.SearchEntry(Tag);
-  SearchEntry:=E;
-end;
-
-procedure TINIFile.ForEachEntry(const Section: string; EnumProc: pointer);
-var P: PINISection;
-    E: PINIEntry;
-    I: integer;
-begin
-  P:=SearchSection(Section);
-  if P<>nil then
-    for I:=0 to P^.Entries^.Count-1 do
-      begin
-        E:=P^.Entries^.At(I);
-      {$ifdef FPC}
-        CallPointerMethodLocal(EnumProc,CurrentFramePointer,@Self,E);
-      {$else}
-        asm
-          push E.word[2]
-          push E.word[0]
-          push word ptr [bp]
-          call EnumProc
-        end;
-      {$endif}
-      end;
-end;
-
-function TINIFile.GetEntry(const Section, Tag, Default: string): string;
-var E: PINIEntry;
-    S: string;
-begin
-  E:=SearchEntry(Section,Tag);
-  if E=nil then S:=Default else
-    S:=E^.GetValue;
-  GetEntry:=S;
-end;
-
-procedure TINIFile.SetEntry(const Section, Tag, Value: string);
-var E: PINIEntry;
-    P: PINISection;
-begin
-  E:=SearchEntry(Section,Tag);
-  if E=nil then
-   if (MakeNullEntries=true) or (Value<>'') then
-    begin
-      P:=SearchSection(Section);
-      if P=nil then
-        begin
-          New(P, Init(Section));
-          Sections^.Insert(P);
-        end;
-      E:=P^.AddEntry(Tag+'='+Value);
-      E^.Modified:=true;
-    end;
-  if E<>nil then
-    E^.SetValue(Value);
-end;
-
-function TINIFile.GetIntEntry(const Section, Tag: string; Default: longint): longint;
-var L: longint;
-begin
-  L:=StrToInt(GetEntry(Section,Tag,IntToStr(Default)));
-  if LastStrToIntResult<>0 then L:=Default;
-  GetIntEntry:=L;
-end;
-
-procedure TINIFile.SetIntEntry(const Section, Tag: string; Value: longint);
-begin
-  SetEntry(Section,Tag,IntToStr(Value));
-end;
-
-procedure TINIFile.DeleteSection(const Section: string);
-var P: PINISection;
-begin
-  P:=SearchSection(Section);
-  if P<>nil then
-    Sections^.Free(P);
-end;
-
-procedure TINIFile.DeleteEntry(const Section, Tag: string);
-var P: PINISection;
-begin
-  P:=SearchSection(Section);
-  if P<>nil then
-    P^.DeleteEntry(Tag);
-end;
-
-destructor TINIFile.Done;
-begin
-  if IsModified then
-    Update;
-  inherited Done;
-  if FileName<>nil then
-    DisposeStr(FileName);
-  Dispose(Sections, Done);
-end;
-
-
-END.
-{
-  $Log$
-  Revision 1.2  2000-08-22 09:41:41  pierre
-   * first big merge from fixes branch
-
-  Revision 1.1.2.3  2000/08/16 18:46:15  peter
-   [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
-   [*] Make, Build now possible even in Compiler Messages Window
-   [+] when started in a new dir the IDE now ask whether to create a local
-       config, or to use the one located in the IDE dir
-
-  Revision 1.1.2.2  2000/08/15 03:40:55  peter
-   [*] no more fatal exits when the IDE can't find the error file (containing
-       the redirected assembler/linker output) after compilation
-   [*] hidden windows are now added always at the end of the Window List
-   [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
-   [*] selection was incorrectly adjusted when typing in overwrite mode
-   [*] the line wasn't expanded when it's end was reached in overw. mode
-   [*] the IDE now tries to locate source files also in the user specified
-       unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
-   [*] 'Open at cursor' is now aware of the extension (if specified)
-
-  Revision 1.1.2.1  2000/07/20 11:02:16  michael
-  + Fixes from gabor. See fixes.txt
-
-  Revision 1.1  2000/07/13 09:48:37  michael
-  + Initial import
-
-  Revision 1.10  2000/06/22 09:07:15  pierre
-   * Gabor changes: see fixes.txt
-
-  Revision 1.9  2000/04/18 11:42:39  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.8  1999/03/08 14:58:21  peter
-    + prompt with dialogs for tools
-
-  Revision 1.7  1999/03/05 17:53:03  pierre
-   + saving and opening of open files on exit
-
-  Revision 1.6  1999/03/01 15:42:15  peter
-    + Added dummy entries for functions not yet implemented
-    * MenuBar didn't update itself automatically on command-set changes
-    * Fixed Debugging/Profiling options dialog
-    * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
- set
-    * efBackSpaceUnindents works correctly
-    + 'Messages' window implemented
-    + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
-    + Added TP message-filter support (for ex. you can call GREP thru
-      GREP2MSG and view the result in the messages window - just like in TP)
-    * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
-      so topic search didn't work...
-    * In FPHELP.PAS there were still context-variables defined as word instead
-      of THelpCtx
-    * StdStatusKeys() was missing from the statusdef for help windows
-    + Topic-title for index-table can be specified when adding a HTML-files
-
-  Revision 1.5  1999/02/22 02:15:26  peter
-    + default extension for save in the editor
-    + Separate Text to Find for the grep dialog
-    * fixed redir crash with tp7
-
-  Revision 1.4  1999/02/10 09:14:57  pierre
-   * Value was not disposed before overwrite in TINIEntry.SetValue
-
-  Revision 1.3  1999/01/21 11:54:33  peter
-    + tools menu
-    + speedsearch in symbolbrowser
-    * working run command
-
-  Revision 1.2  1998/12/28 15:47:58  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-  Revision 1.1  1998/12/22 10:39:57  peter
-    + options are now written/read
-    + find and replace routines
-
-}

+ 0 - 529
ide/text/wnghelp.pas

@@ -1,529 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by Berczi Gabor
-
-    Help support for Norton Guide (.NG) files
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$R-}
-unit WNGHelp;
-
-interface
-
-uses Objects,
-     WUtils,WHelp;
-
-const
-      NGFileSignature = 'NG';
-      NGXORByte       = $1a;
-
-      NGMinRecordSize = $1a;
-
-      ng_rtContainer    = Byte ($0);
-      ng_rtTopic        = Byte ($1);
-
-type
-      TNGFileHeader = packed record
-        Signature     : array[1..2] of char;
-        Unknown       : word;
-        Version       : word;
-        MenuCount     : word;
-        GuideName     : array[8..47] of char;
-        Credits       : array[48..377] of char;
-      end;
-
-      TNGRecordHeader = packed record
-        RecType      : word;
-        RecLength    : word;
-      end;
-
-      TNGContainerItem = packed record
-        EntryNameOfs  : word; { relative in record }
-        SubItemsOfs   : longint; { file offset to a new record header }
-      end;
-
-      PNGContainerRecord = ^TNGContainerRecord;
-      TNGContainerRecord = packed record
-        ItemCount     : word;
-        Unknown       : word;
-        IndexInParent : integer;
-        ParentOfs     : longint;
-        MenuNo        : integer;{ belongs to menu # }
-        MenuItemNo    : integer;{ belongs to menu item # }
-        Unknown2      : array[18..25] of byte;
-        Items         : array[0..0] of TNGContainerItem;
-      end;
-
-      TNGTopicRecord = packed record
-        NumberOfLines : word;
-        SeeAlsoOfs    : word;
-        IndexInParent : integer;
-        ParentOfs     : longint;
-        MenuNo        : integer;{ belongs to menu # }
-        MenuItemNo    : integer;{ belongs to menu item # }
-        PrevTopicOfs  : longint;
-        NextTopicOfs  : longint;
-        TopicLines    : record end;
-        { array of TNGSeeAlsoRec }
-      end;
-
-      PNGSeeAlsoRec = ^TNGSeeAlsoRec;
-      TNGSeeAlsoRec = packed record
-        EntryCount    : word;
-        Entries       : record end;
-        { array of LinkedRecOfs  : longint; }
-        { array of LinkNames : ASCIIZ; }
-      end;
-
-      PContainerItemRec = ^TContainerItemRec;
-      TContainerItemRec = record
-        Name     : string;
-        FilePos  : longint;
-        Container: PNGContainerRecord;
-      end;
-
-      PLinkRec = ^TLinkRec;
-      TLinkRec = record
-        Name     : string;
-        FilePos  : longint;
-      end;
-
-      PNGHelpFile = ^TNGHelpFile;
-      TNGHelpFile = object(THelpFile)
-        constructor Init(AFileName: string; AID: word);
-        destructor  Done; virtual;
-      public
-        function    LoadIndex: boolean; virtual;
-        function    ReadTopic(T: PTopic): boolean; virtual;
-      private
-        F: PStream;
-        Header: TNGFileHeader;
-        FirstRecordPos: longint;
-        IndexLoaded: boolean;
-{        NextHelpCtx: longint;}
-        function ReadHeader: boolean;
-        function ReadContainer(EnumProc: pointer): boolean;
-        function ReadTopicRec(LineEnumProc: pointer; LinkEnumProc: pointer): boolean;
-        function ReadRecord(var R: TRecord; ReadData: boolean): boolean;
-      end;
-
-    TNGGetAttrColorProc = function(Attr: char; var Color: byte): boolean;
-
-function DefNGGetAttrColor(Attr: char; var Color: byte): boolean;
-
-const NGGetAttrColor : TNGGetAttrColorProc = DefNGGetAttrColor;
-
-implementation
-
-uses CallSpec;
-
-function DefNGGetAttrColor(Attr: char; var Color: byte): boolean;
-begin
-  DefNGGetAttrColor:=false;
-end;
-
-function NGDecompressStr(const S: string): string;
-var NS: string;
-    I: sw_integer;
-begin
-  NS:='';
-  I:=1;
-  while (I<=length(S)) do
-  begin
-    if S[I]=#255 then
-      begin
-        NS:=NS+CharStr(' ',ord(S[I+1]));
-        Inc(I);
-      end
-    else
-      NS:=NS+S[I];
-    Inc(I);
-  end;
-  NGDecompressStr:=NS;
-end;
-
-function TranslateStr(const S: string): string;
-var NS: string;
-    I: sw_integer;
-    InHiLite: boolean;
-    Color: byte;
-begin
-  NS:=''; InHiLite:=false;
-  I:=1;
-  while (I<=length(S)) do
-  begin
-    case S[I] of
-      '^'  : begin
-               Inc(I);
-               case S[I] of
-                 '^' : NS:=NS+'^';
-                 'A'..'Z',
-                 'a'..'z' :
-                       begin
-                         if InHiLite then
-                           NS:=NS+hscNormText
-                         else
-                           if NGGetAttrColor(S[I],Color) then
-                             NS:=NS+hscTextColor+chr(Color);
-                         InHiLite:=not InHiLite;
-                       end;
-               else
-                 NS:=NS;
-               end;
-             end;
-    else NS:=NS+S[I];
-    end;
-    Inc(I);
-  end;
-  if InHiLite then NS:=NS+hscNormText;
-  TranslateStr:=NS;
-end;
-
-procedure TranslateLines(P: PUnsortedStringCollection);
-var S: string;
-    I: sw_integer;
-begin
-  for I:=0 to P^.Count-1 do
-  begin
-    S:=GetStr(P^.At(I));
-    P^.AtFree(I);
-    P^.AtInsert(I,NewStr(TranslateStr(S)));
-  end;
-end;
-
-constructor TNGHelpFile.Init(AFileName: string; AID: word);
-var OK: boolean;
-begin
-  if inherited Init(AID)=false then Fail;
-  F:=New(PFastBufStream, Init(AFileName, stOpenRead, HelpStreamBufSize));
-  OK:=F<>nil;
-  if OK then OK:=(F^.Status=stOK);
-  if OK then
-    begin
-      OK:=ReadHeader;
-      if OK then
-        FirstRecordPos:=F^.GetPos;
-    end;
-  if OK=false then
-  begin
-    Done;
-    Fail;
-  end;
-end;
-
-function TNGHelpFile.ReadHeader: boolean;
-var OK: boolean;
-begin
-  F^.Read(Header,sizeof(Header));
-  OK:=(F^.Status=stOK);
-  OK:=OK and (Header.Signature=NGFileSignature);
-  ReadHeader:=OK;
-end;
-
-function TNGHelpFile.ReadContainer(EnumProc: pointer): boolean;
-var OK: boolean;
-    R: TRecord;
-    I: longint;
-    P: pointer;
-    CIR: TContainerItemRec;
-begin
-  OK:=ReadRecord(R, true);
-  if OK then
-  with TNGContainerRecord(R.Data^) do
-  begin
-    I:=0;
-    while (I<ItemCount) do
-    with Items[I] do
-    begin
-      P:=@(PByteArray(R.Data)^[NGMinRecordSize-sizeof(TNGRecordHeader)+EntryNameOfs]);
-      FillChar(CIR,sizeof(CIR),0);
-      with CIR do
-      begin
-        Container:=R.Data;
-        Name:=NGDecompressStr(StrPas(P));
-        FilePos:=SubItemsOfs;
-      end;
-      CallPointerLocal(EnumProc,PreviousFramePointer,@CIR);
-      Inc(I);
-    end;
-  end;
-  DisposeRecord(R);
-  ReadContainer:=OK;
-end;
-
-function TNGHelpFile.ReadTopicRec(LineEnumProc, LinkEnumProc: pointer): boolean;
-var OK: boolean;
-    R: TRecord;
-    I: sw_integer;
-    LineP: pointer;
-    S: string;
-    ParamS: string;
-    NextLinkOfsPtr,NextLinkNamePtr: pointer;
-    SeeAlso: PNGSeeAlsoRec;
-    LR: TLinkRec;
-begin
-  OK:=ReadRecord(R, true);
-  if OK then
-  with TNGTopicRecord(R.Data^) do
-  begin
-    LineP:=@TopicLines;
-    if Assigned(LineEnumProc) then
-    for I:=1 to NumberOfLines do
-    begin
-      S:=StrPas(LineP);
-      ParamS:=NGDecompressStr(S);
-      CallPointerLocal(LineEnumProc,PreviousFramePointer,@ParamS);
-      Inc(longint(LineP),length(S)+1);
-    end;
-    if Assigned(LinkEnumProc) and (SeeAlsoOfs>0) then
-    begin
-      SeeAlso:=@PByteArray(R.Data)^[NGMinRecordSize-sizeof(TNGRecordHeader)+SeeAlsoOfs];
-      NextLinkOfsPtr:=@SeeAlso^.Entries;
-      NextLinkNamePtr:=@PByteArray(NextLinkOfsPtr)^[SeeAlso^.EntryCount*4];
-      for I:=1 to SeeAlso^.EntryCount do
-      begin
-        FillChar(LR,sizeof(LR),0);
-        S:=StrPas(NextLinkNamePtr);
-        LR.Name:=S;
-        Move(NextLinkOfsPtr^,LR.FilePos,4);
-        CallPointerLocal(LinkEnumProc,PreviousFramePointer,@LR);
-        Inc(longint(NextLinkNamePtr),length(S)+1);
-        Inc(longint(NextLinkOfsPtr),4);
-      end;
-    end;
-  end;
-  DisposeRecord(R);
-  ReadTopicRec:=OK;
-end;
-
-function TNGHelpFile.ReadRecord(var R: TRecord; ReadData: boolean): boolean;
-var OK: boolean;
-    H: TNGRecordHeader;
-    I: sw_integer;
-begin
-  FillChar(R, SizeOf(R), 0);
-  F^.Read(H,SizeOf(H));
-  OK:=F^.Status=stOK;
-  if OK then
-    for I:=0 to SizeOf(H)-1 do
-      PByteArray(@H)^[I]:=PByteArray(@H)^[I] xor NGXORByte;
-  if OK then
-  begin
-    R.SClass:=H.RecType; R.Size:=H.RecLength+(NGMinRecordSize-sizeof(TNGRecordHeader));
-    if (R.Size>0) and ReadData then
-    begin
-      GetMem(R.Data,R.Size);
-      F^.Read(R.Data^,R.Size);
-      if R.Size>0 then
-      for I:=0 to R.Size-1 do
-        PByteArray(R.Data)^[I]:=PByteArray(R.Data)^[I] xor NGXORByte;
-      OK:=F^.Status=stOK;
-    end;
-    if OK=false then DisposeRecord(R);
-  end;
-  ReadRecord:=OK;
-end;
-
-function TNGHelpFile.LoadIndex: boolean;
-{function FormatAlias(Alias: string): string;
-var StartP,EndP: sw_integer;
-begin
-  repeat
-    StartP:=Pos('  ',Alias);
-    if StartP>0 then
-    begin
-      EndP:=StartP;
-      while (EndP+1<=length(Alias)) and (Alias[EndP+1]=' ') do Inc(EndP);
-      Alias:=copy(Alias,1,StartP-1)+' | '+copy(Alias,EndP+1,High(Alias));
-    end;
-  until StartP=0;
-  if Assigned(HelpFacility) then
-    if length(Alias)>HelpFacility^.IndexTabSize-4 then
-      Alias:=Trim(copy(Alias,1,HelpFacility^.IndexTabSize-4-2))+'..';
-  FormatAlias:=Alias;
-end;}
-procedure AddToIndex(P: PContainerItemRec); {$ifndef FPC}far;{$endif}
-var S: string;
-begin
-  S:=Trim(P^.Name);
-  S:=TranslateStr(S);
-  S:=Trim({FormatAlias}(S));
-  if (S<>'') and (P^.FilePos<>-1) then
-    begin
-{      Inc(NextHelpCtx);}
-      AddIndexEntry(S,P^.FilePos);
-      AddTopic(P^.FilePos,P^.FilePos,'',nil,0);
-    end;
-end;
-var OK: boolean;
-    FS: longint;
-    R: TRecord;
-    L: longint;
-begin
-  if IndexLoaded then OK:=true else
-  begin
-    FS:=F^.GetSize;
-    OK:=FirstRecordPos<>0;
-
-    while OK do
-    begin
-      L:=F^.GetPos;
-      if (L>=FS) then Break;
-      OK:=ReadRecord(R,false);
-      if (OK=false) then Break;
-      case R.SClass of
-        ng_rtContainer : begin F^.Seek(L); OK:=ReadContainer(@AddToIndex); end;
-        ng_rtTopic     : ;
-      else
-       begin
-       {$ifdef DEBUGMSG}
-         ClearFormatParams;
-         AddFormatParamInt(R.SClass);
-         AddFormatParamInt(L);
-         AddFormatParamInt(R.Size);
-         ErrorBox('Uknown help record tag %x encountered, '+
-                  'offset %x, size %d',@FormatParams);
-       {$else}
-         {Skip};
-       {$endif}
-       end;
-      end;
-      if OK then
-         begin
-           Inc(L, sizeof(TNGRecordHeader)+R.Size); F^.Seek(L);
-           OK:=(F^.Status=stOK);
-         end;
-    end;
-    IndexLoaded:=OK;
-  end;
-  LoadIndex:=OK;
-end;
-
-function TNGHelpFile.ReadTopic(T: PTopic): boolean;
-function ExtractStr(var Buf; BufSize: word): string;
-var S: string;
-    I,Size: integer;
-    StartP,EndP: sw_integer;
-begin
-  S:='';
-  Size:=BufSize;
-  while (PByteArray(@Buf)^[Size-1]=0) and (Size>0) do
-    Dec(Size);
-  S:=MemToStr(Buf,Size);
-
-  S:=NGDecompressStr(S);
-
-  for I:=1 to length(S) do
-    if S[I]=#0 then S[I]:=#32;
-
-  { kill long spaces }
-  repeat
-    StartP:=Pos('  ',S);
-    if StartP>0 then
-    begin
-      EndP:=StartP;
-      while (EndP+1<=length(S)) and (S[EndP+1]=' ') do Inc(EndP);
-      S:=copy(S,1,StartP-1)+hscLineBreak+copy(S,EndP+1,High(S));
-    end;
-  until StartP=0;
-
-  S:=Trim(S);
-
-  ExtractStr:=S;
-end;
-var Lines: PUnsortedStringCollection;
-procedure AddLine(const S: string);
-begin
-  Lines^.InsertStr(S);
-end;
-procedure AddToTopic(P: PContainerItemRec); {$ifndef FPC}far;{$endif}
-begin
-  AddLine(hscLink+Trim(P^.Name)+hscLink);
-  AddLinkToTopic(T,ID,P^.FilePos);
-end;
-procedure AddTopicLine(P: PString); {$ifndef FPC}far;{$endif}
-begin
-  AddLine(' '+GetStr(P));
-end;
-var LinkCount: sw_integer;
-procedure AddLink(P: PLinkRec); {$ifndef FPC}far;{$endif}
-begin
-  Inc(LinkCount);
-  if LinkCount=1 then
-  begin
-    AddLine('');
-    AddLine(' See also :');
-  end;
-  AddLine('  '+hscLink+Trim(P^.Name)+hscLink);
-  AddLinkToTopic(T,ID,P^.FilePos);
-end;
-var OK: boolean;
-    R: TRecord;
-begin
-  LinkCount:=0;
-  New(Lines, Init(100,100));
-  F^.Seek(T^.FileOfs); OK:=F^.Status=stOK;
-  if OK then OK:=ReadRecord(R,false);
-  case R.SClass of
-      ng_rtContainer :
-        begin
-          F^.Seek(T^.FileOfs);
-          AddLine('');
-          OK:=ReadContainer(@AddToTopic);
-          RenderTopic(Lines,T);
-        end;
-      ng_rtTopic     :
-        begin
-          F^.Seek(T^.FileOfs);
-          AddLine('');
-          OK:=ReadTopicRec(@AddTopicLine,@AddLink);
-          TranslateLines(Lines);
-          AddLine('');
-          { include copyright info }
-{          AddLine(CharStr('Ä',80));
-          AddLine(ExtractStr(Header.GuideName,sizeof(Header.GuideName)));
-          AddLine(ExtractStr(Header.Credits,sizeof(Header.Credits)));}
-          RenderTopic(Lines,T);
-        end;
-  else OK:=false;
-  end;
-  Dispose(Lines, Done);
-  ReadTopic:=OK;
-end;
-
-destructor TNGHelpFile.Done;
-begin
-  if Assigned(F) then Dispose(F, Done); F:=nil;
-  inherited Done;
-end;
-
-END.
-{
-  $Log$
-  Revision 1.2  2000-10-31 22:35:56  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/09/18 13:20:56  pierre
-   New bunch of Gabor changes
-
-  Revision 1.1  2000/07/13 09:48:37  michael
-  + Initial import
-
-  Revision 1.3  2000/07/03 08:54:54  pierre
-   * Some enhancements for WinHelp support by G	abor
-
-  Revision 1.2  2000/06/26 07:29:23  pierre
-   * new bunch of Gabor's changes
-
-  Revision 1.1  2000/06/22 09:07:15  pierre
-   * Gabor changes: see fixes.txt
-
-}

+ 0 - 611
ide/text/wos2help.pas

@@ -1,611 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 2000 by Berczi Gabor
-
-    Help support for OS/2 (.INF) help files
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-{$R-}
-unit WOS2Help;
-
-interface
-
-uses Objects,
-     WUtils,WHelp;
-
-const
-      INFFileSignature = 'HS';
-
-      { TOCEntry flags }
-      inf_tef_HasChildren    = $80; { following nodes are a higher level }
-      inf_tef_Hidden         = $40; { this entry doesn't appear in VIEW.EXE's presentation of the toc }
-      inf_tef_Extended       = $20; { extended entry format }
-      inf_tef_LevelMask      = $0f;
-
-type
-      TINFFileHeader = packed record
-        Signature   : array[1..2] of char;{ ID magic word (5348h = "HS")                 }
-        Unknown1    : byte;      { unknown purpose, could be third letter of ID }
-        Flags       : byte;      { probably a flag word...                      }
-                                 {  bit 0: set if INF style file                }
-                                 {  bit 4: set if HLP style file                }
-                                 { patching this byte allows reading HLP files  }
-                                 { using the VIEW command, while help files     }
-                                 { seem to work with INF settings here as well. }
-        HeaderSize  : word;      { total size of header                         }
-        Unknown2    : word;      { unknown purpose                              }
-        NumTOC      : word;      { 16 bit number of entries in the tocarray     }
-        TOCStrTabOfs: longint;   { 32 bit file offset of the start of the       }
-                                 { strings for the table-of-contents            }
-        TOCStrTabSize: longint;  { number of bytes in file occupied by the      }
-                                 { table-of-contents strings                    }
-        TOCArrayOfs : longint;   { 32 bit file offset of the start of tocarray  }
-        NumResPanels: word;      { number of panels with ressource numbers      }
-        ResTabOfs   : longint;   { 32 bit file offset of ressource number table }
-        NumNames    : word;      { number of panels with textual name           }
-        NameTabOfs  : longint;   { 32 bit file offset to panel name table       }
-        NumIndexes  : word;      { number of index entries                      }
-        IndexTabOfs : longint;   { 32 bit file offset to index table            }
-        IndexTabSize: longint;   { size of index table                          }
-        Unknown3: array[1..10] of byte; { unknown purpose                       }
-        SearchTabOfs: longint;   { 32 bit file offset of full text search table }
-        SearchTabSize:longint;   { size of full text search table               }
-        NumSlots    : word;      { number of "slots"                            }
-        SlotTabOfs  : longint;   { file offset of the slots array               }
-        DictSize    : longint;   { number of bytes occupied by the "dictionary" }
-        NumDictEntries: word;    { number of entries in the dictionary          }
-        DictOfs     : longint;   { file offset of the start of the dictionary   }
-        ImageOfs    : longint;   { file offset of image data                    }
-        Unknown4    : byte;      { unknown purpose                              }
-        NLSTabOfs   : longint;   { 32 bit file offset of NLS table              }
-        NLSTabSize  : longint;   { size of NLS table                            }
-        ExtBlockOfs : longint;   { 32 bit file offset of extended data block    }
-        Unknown5: array[1..12] of byte;{ unknown purpose                        }
-        Title       : array[1..48] of char;{ ASCII title of database            }
-      end;
-
-      PINFTOCArray = ^TINFTOCArray;
-      TINFTOCArray = packed array[0..16382] of longint;
-
-      PINFSlotArray = ^TINFSlotArray;
-      TINFSlotArray = packed array[0..32766] of word;
-
-      PSlotArray = ^TSlotArray;
-      TSlotArray = packed array[0..16382] of longint;
-
-      TINFTOCEntry = packed record
-        Size     : byte; { length of the entry including this byte    }
-        Flags    : byte; { flag byte, description folows (MSB first)  }
-        NumSlots : byte; { number of "slots" occupied by the text for }
-                         { this toc entry                             }
-        Slots    : record end;
-      end;
-
-      TINFTopicHeader = packed record
-        Stuff        : byte;      { ??                                   }
-        LocalDictPos : longint;   { file offset of the local dictionary  }
-        NumLocalDict : byte;      { number of entries in the local dict  }
-        TextSize     : word;      { number of bytes in the text          }
-        Text         : record end;{ encoded text of the article          }
-      end;
-
-      TINFEscHeader = packed record
-        EscLen : byte;  { length of the sequence (including esclen but excluding FF) }
-        EscCode: byte;  { which escape function }
-      end;
-
-      POS2HelpFile = ^TOS2HelpFile;
-      TOS2HelpFile = object(THelpFile)
-        constructor Init(AFileName: string; AID: word);
-        destructor  Done; virtual;
-      public
-        function    LoadIndex: boolean; virtual;
-        function    ReadTopic(T: PTopic): boolean; virtual;
-      private
-        F: PStream;
-        Header: TINFFileHeader;
-        Dictionary: PUnsortedStringCollection;
-        Slots: PSlotArray;
-        SlotsSize: longint;
-        function ReadHeader: boolean;
-        function ReadSlots: boolean;
-        function ReadDictionary: boolean;
-        function ReadTOC: boolean;
-        function ReadTopicRec(FileOfs: longint; Topic: PTopic; Lines: PUnsortedStringCollection): boolean;
-      end;
-
-      TINFGetAttrColorProc = function(TextStyle, TextColor: byte; var Color: byte): boolean;
-
-function DefINFGetAttrColor(TextStyle, TextColor: byte; var Color: byte): boolean;
-
-const INFGetAttrColor : TINFGetAttrColorProc = DefINFGetAttrColor;
-
-implementation
-
-uses CallSpec;
-
-function DefINFGetAttrColor(TextStyle, TextColor: byte; var Color: byte): boolean;
-{
-          style;    // 1,2,3: same as :hp#.
-                    // 4,5,6: same as :hp5,6,7.
-                    // 0 returns to plain text
-          color;   // 1,2,3: same as :hp4,8,9.
-                   // 0: default color
-
-          :hp4 text is light blue
-          :hp8 text is red
-          :hp9 text is magenta
-
-          :hp1 is italic font
-          :hp2 is bold font
-          :hp3 is bold italic font
-          :hp5 is normal underlined font
-          :hp6 is italic underlined font
-          :hp7 is bold underlined font
-}
-begin
-  DefINFGetAttrColor:=false;
-end;
-
-function KillNonASCII(S: string): string;
-var I: sw_integer;
-begin
-  for I:=1 to length(S) do
-    if S[I]<#32 then
-      S[I]:='.';
-  KillNonASCII:=S;
-end;
-
-function ContainsNonASCIIChar(const S: string): boolean;
-var I: sw_integer;
-begin
-  ContainsNonASCIIChar:=false;
-  for I:=1 to length(S) do
-    if S[I]<#32 then
-      begin
-        ContainsNonASCIIChar:=true;
-        Break;
-      end;
-end;
-
-constructor TOS2HelpFile.Init(AFileName: string; AID: word);
-var OK: boolean;
-begin
-  if inherited Init(AID)=false then Fail;
-  New(Dictionary, Init(100,1000));
-  F:=New(PFastBufStream, Init(AFileName, stOpenRead, HelpStreamBufSize));
-  OK:=F<>nil;
-  if OK then OK:=(F^.Status=stOK);
-  if OK then OK:=ReadHeader;
-  if OK=false then
-  begin
-    Done;
-    Fail;
-  end;
-end;
-
-function TOS2HelpFile.ReadHeader: boolean;
-var OK: boolean;
-begin
-  F^.Read(Header,sizeof(Header));
-  OK:=(F^.Status=stOK);
-  OK:=OK and (Header.Signature=INFFileSignature);
-  ReadHeader:=OK;
-end;
-
-function TOS2HelpFile.LoadIndex: boolean;
-var OK: boolean;
-begin
-  OK:=ReadDictionary;
-  if OK then OK:=ReadSlots;
-  if OK then OK:=ReadTOC;
-  LoadIndex:=OK;
-end;
-
-function TOS2HelpFile.ReadDictionary: boolean;
-var OK: boolean;
-    I: longint;
-    C: array[0..255] of char;
-    B: byte;
-begin
-  F^.Seek(Header.DictOfs);
-  OK:=(F^.Status=stOK);
-  I:=0;
-  while OK and (I<Header.NumDictEntries) do
-  begin
-    FillChar(C,sizeof(C),0);
-    F^.Read(B,sizeof(B)); F^.Read(C,B-1);
-    OK:=(F^.Status=stOK);
-    if OK then
-      Dictionary^.InsertStr(StrPas(@C));
-    Inc(I);
-  end;
-  ReadDictionary:=OK;
-end;
-
-function TOS2HelpFile.ReadSlots: boolean;
-var OK: boolean;
-begin
-  SlotsSize:=Header.NumSlots*sizeof(Slots^[0]);
-  GetMem(Slots,SlotsSize);
-  F^.Seek(Header.SlotTabOfs);
-  OK:=(F^.Status=stOK);
-  if OK then
-  begin
-    F^.Read(Slots^,SlotsSize);
-    OK:=(F^.Status=stOK);
-  end;
-  ReadSlots:=OK;
-end;
-
-function TOS2HelpFile.ReadTOC: boolean;
-var OK: boolean;
-    I,J,L,Count: longint;
-    TE: TINFTOCEntry;
-    W: word;
-    C: array[0..255] of char;
-    StartOfs: longint;
-    S: string;
-    SubSlots: PWordArray;
-    SubSlotsSize: longint;
-    TOC: PINFTOCArray;
-    TOCSize: longint;
-begin
-  F^.Seek(Header.TOCArrayOfs); TOCSize:=Header.TOCStrTabSize;
-  OK:=(F^.Status=stOK);
-  if OK then
-  begin
-    GetMem(TOC,TOCSize);
-    F^.Read(TOC^,TOCSize);
-    OK:=(F^.Status=stOK);
-    I:=0;
-    while OK and (I<Header.NumTOC) do
-    begin
-      F^.Seek(TOC^[I]);
-      OK:=(F^.Status=stOK);
-      if OK then
-      begin
-        StartOfs:=F^.GetPos;
-        F^.Read(TE,sizeof(TE));
-        OK:=(F^.Status=stOK);
-      end;
-      if OK and ((TE.Flags and inf_tef_Extended)<>0) then
-      begin
-        F^.Read(W,sizeof(W));
-        Count:=0;
-        if (W and 1)<>0 then Inc(Count,5);
-        if (W and 2)<>0 then Inc(Count,5);
-        if (W and 4)<>0 then Inc(Count,2);
-        if (W and 8)<>0 then Inc(Count,2);
-        F^.Seek(F^.GetPos+Count);
-        OK:=(F^.Status=stOK);
-      end;
-      if OK then
-      begin
-        SubSlotsSize:=sizeof(SubSlots^[0])*TE.NumSlots;
-        GetMem(SubSlots,SubSlotsSize);
-        F^.Read(SubSlots^,SubSlotsSize);
-        FillChar(C,sizeof(C),0);
-        F^.Read(C,Max(0,TE.Size-(F^.GetPos-StartOfs)));
-        OK:=(F^.Status=stOK);
-        if OK then
-        begin
-          S:=StrPas(@C);
-          AddTopic(I,StartOfs,S,SubSlots,SubSlotsSize);
-          if (S<>'') and (not ContainsNonASCIIChar(S)) then
-           AddIndexEntry(S,I);
- {         !}
-        end;
-        FreeMem(SubSlots,SubSlotsSize);
-      end;
-      Inc(I);
-    end;
-    FreeMem(TOC,TOCSize); TOC:=nil;
-  end;
-  ReadTOC:=OK;
-end;
-
-function TOS2HelpFile.ReadTopicRec(FileOfs: longint; Topic: PTopic; Lines: PUnsortedStringCollection): boolean;
-var Line: string;
-    LastTextChar: char;
-    CharsInLine: sw_integer;
-    LeftMargin,RightMargin: byte;
-    TextStyle,TextColor: byte;
-    InMonospace: boolean;
-    Align: (alLeft,alRight,alCenter);
-    LineNo: longint;
-procedure FlushLine;
-begin
-  if Line<>'' then Lines^.InsertStr(Line);
-  Line:='';
-end;
-procedure AddChar(C: char);
-begin
-  if length(Line)>=255 then FlushLine;
-  Line:=Line+C;
-end;
-procedure AddString(const S: string);
-var I: sw_integer;
-begin
-  for I:=1 to length(S) do
-    AddChar(S[I]);
-end;
-procedure AddTextChar(C: char);
-begin
-  if (C=hscLineBreak) then
-  begin
-    case Align of
-      alRight : AddChar(hscRight);
-      alCenter: AddChar(hscCenter);
-    end;
-  end;
-  if (CharsInLine=0) and (C<>hscLineBreak) then
-  begin
-    if (LeftMargin>0) then
-      begin
-        AddString(CharStr(#255,LeftMargin)+hscLineStart);
-        Inc(CharsInLine,LeftMargin);
-      end else
-    if InMonospace then
-      begin
-        AddChar(' ');
-        Inc(CharsInLine);
-      end;
-  end;
-  AddChar(C);
-  LastTextChar:=C;
-  if C=hscLineBreak then
-    begin
-      CharsInLine:=0;
-      Inc(LineNo);
-    end
-  else
-    Inc(CharsInLine);
-end;
-procedure AddText(const S: string);
-var I: sw_integer;
-begin
-  for I:=1 to length(S) do
-    AddTextChar(S[I]);
-end;
-var H: TINFTopicHeader;
-    Text: PByteArray;
-    TextOfs: longint;
-    Dict: PWordArray;
-    Spacing: boolean;
-function NextByte: byte;
-var B: byte;
-begin
-  NextByte:=Text^[TextOfs];
-  Inc(TextOfs);
-end;
-procedure ReadBytes(DataPtr: pointer; NumBytes: sw_integer);
-var I: sw_integer;
-begin
-  for I:=1 to NumBytes do
-    if Assigned(DataPtr) then
-      PByteArray(DataPtr)^[I-1]:=NextByte
-    else
-      NextByte;
-end;
-procedure AddWord(LocalIndex: word);
-begin
-  AddText(GetStr(Dictionary^.At(Dict^[LocalIndex])));
-  if Spacing and not InMonospace then AddTextChar(' ');
-end;
-var
-    DictSize,EscStartOfs: longint;
-    OK: boolean;
-    EH: TINFEscHeader;
-    B,Color: byte;
-    W: word;
-    CurLinkCtx: longint;
-    InTempMargin: boolean;
-begin
-  F^.Reset;
-  F^.Seek(FileOfs);
-  OK:=(F^.Status=stOK);
-  if OK then
-  begin
-    F^.Read(H,sizeof(H));
-    OK:=(F^.Status=stOK);
-  end;
-  if OK then
-  begin
-    LineNo:=0;
-    Line:=''; LeftMargin:=0; RightMargin:=0; LastTextChar:=hscLineBreak;
-    CharsInLine:=0; TextStyle:=0; TextColor:=0; Align:=alLeft;
-    CurLinkCtx:=-1; InMonospace:=false;
-    DictSize:=H.NumLocalDict*sizeof(Dict^[0]);
-    GetMem(Text,H.TextSize);
-    GetMem(Dict,DictSize);
-    F^.Read(Text^,H.TextSize);
-    F^.Seek(H.LocalDictPos);
-    F^.Read(Dict^,DictSize);
-    OK:=(F^.Status=stOK);
-
-    TextOfs:=0; Spacing:=true;
-    while OK and (TextOfs<H.TextSize) do
-    begin
-      B:=NextByte;
-      if (B<H.NumLocalDict) then
-      begin
-        AddWord(B);
-      end else
-      case B of
-        $fa : begin
-                if (LineNo>0) then
-                  AddTextChar(hscLineBreak);
-                if InTempMargin then
-                  LeftMargin:=0;
-                AddTextChar(hscLineBreak);
-                Spacing:=true;
-              end;
-        $fb : { ??? };
-        $fc : Spacing:=not Spacing;
-        $fd : begin
-                AddTextChar(hscLineBreak);
-                Spacing:=true;
-              end;
-        $fe : AddChar(' ');
-        $ff : begin
-                EscStartOfs:=TextOfs;
-                ReadBytes(@EH,sizeof(EH));
-                case EH.EscCode of
-                  $02,$11,$12 :
-                    begin
-                      { set left margin }
-                      if EH.EscCode=$11 then
-                        AddTextChar(hscLineBreak);
-                      LeftMargin:=NextByte;
-                    end;
-                  $03 :
-                    RightMargin:=NextByte;
-                  $04 :
-                    begin
-                      TextStyle:=NextByte;
-                      if (TextStyle=0) or (not INFGetAttrColor(TextStyle,TextColor,Color)) then
-                        AddChar(hscNormText)
-                      else
-                        AddText(hscTextColor+chr(Color));
-                    end;
-                  $05 :
-                    begin
-                      W:=word(NextByte)*256+NextByte;
-                      AddChar(hscLink);
-                      CurLinkCtx:=W;
-                    end;
-                  $08 :
-                    if CurLinkCtx<>-1 then
-                    begin
-                      AddChar(hscLink);
-                      AddLinkToTopic(Topic,ID,CurLinkCtx);
-                    end;
-                  $0b :
-                    begin
-                      if CharsInLine>0 then
-                        AddTextChar(hscLineBreak);
-                      AddTextChar(hscLineBreak);
-                      AddChar(hscCode);
-                      InMonospace:=true;
-                    end;
-                  $0c :
-                    begin
-                      AddChar(hscCode);
-                      InMonospace:=false;
-                    end;
-                  $0d :
-                    begin
-                      TextColor:=NextByte;
-                      if (TextColor=0) or (not INFGetAttrColor(TextStyle,TextColor,Color)) then
-                        AddChar(hscNormText)
-                      else
-                        AddText(hscTextColor+chr(Color));
-                    end;
-                  $0e :
-                    begin
-                      AddText(hscLineBreak+'[img]'+hscLineBreak);
-                    end;
-                  $1a :
-                    begin
-                      if CharsInLine>0 then AddText(hscLineBreak);
-                      case NextByte of
-                        1 : Align:=alLeft;
-                        2 : Align:=alRight;
-                        4 : Align:=alCenter;
-                      end;
-                      Spacing:=false;
-                    end;
-                  $1b :
-                    begin
-                      Spacing:=true;
-                    end;
-                  $1c :
-                    begin
-                      LeftMargin:=CharsInLine;
-                      InTempMargin:=true;
-                    end;
-                end;
-                TextOfs:=EscStartOfs+EH.EscLen;
-              end;
-      end;
-    end;
-    if CharsInLine>0 then
-      AddTextChar(hscLineBreak);
-    AddTextChar(hscLineBreak);
-    FlushLine;
-
-    FreeMem(Dict,DictSize);
-    FreeMem(Text,H.TextSize);
-  end;
-  F^.Reset;
-  ReadTopicRec:=OK;
-end;
-
-function TOS2HelpFile.ReadTopic(T: PTopic): boolean;
-var OK: boolean;
-    I,NumSlots,Idx: sw_integer;
-    TopicOfs: longint;
-    L: PUnsortedStringCollection;
-    Title: string;
-begin
-  OK:=false;
-  NumSlots:=T^.ExtDataSize div 2; { extdata is array of word }
-  New(L, Init(100,100));
-  Title:=GetStr(T^.Param);
-  if Title<>'' then
-  begin
-    L^.InsertStr('  '+Title+' Ü'+hscLineBreak);
-    L^.InsertStr(' '+CharStr('ß',length(Title)+3)+hscLineBreak);
-  end;
-  if 0<T^.HelpCtx then
-  begin
-    L^.InsertStr(hscLink+'[previous topic]'+hscLink+'  ');
-    AddLinkToTopic(T,ID,T^.HelpCtx-1);
-  end;
-  if T^.HelpCtx<Header.NumTOC then
-  begin
-    L^.InsertStr(hscLink+'[next topic]'+hscLink);
-    AddLinkToTopic(T,ID,T^.HelpCtx+1);
-  end;
-  L^.InsertStr(hscLineBreak);
-  for I:=0 to NumSlots-1 do
-  begin
-    Idx:=PWordArray(T^.ExtData)^[I];
-    TopicOfs:=Slots^[Idx];
-    OK:=ReadTopicRec(TopicOfs,T,L);
-    if not OK then
-      Break;
-  end;
-  if OK then BuildTopic(L,T);
-  Dispose(L, Done);
-  ReadTopic:=OK;
-end;
-
-destructor TOS2HelpFile.Done;
-begin
-  if Assigned(Slots) then FreeMem(Slots, SlotsSize); Slots:=nil;
-  if Assigned(Dictionary) then Dispose(Dictionary, Done); Dictionary:=nil;
-  if Assigned(F) then Dispose(F, Done); F:=nil;
-  inherited Done;
-end;
-
-END.
-{
-  $Log$
-  Revision 1.2  2000-10-31 22:35:56  pierre
-   * New big merge from fixes branch
-
-  Revision 1.1.2.1  2000/09/18 19:50:37  pierre
-   New file from Gabor
-
-
-}

+ 0 - 876
ide/text/wresourc.pas

@@ -1,876 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Resource File support objects and routines
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    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.
-
- **********************************************************************}
-unit WResourc;
-
-interface
-
-uses Objects;
-
-const
-      TPDataBlockSignature   = ord('F')+ord('B')*256;
-      ResourceBlockSignature = ord('R')+ord('D')*256;
-
-      langDefault       = 0;
-
-      rcBinary          = 1;
-
-type
-     TResourceEntryHeader = packed record
-       ID     : longint;
-       LangID : longint;
-       Flags  : longint;
-       DataOfs: longint;
-       DataLen: longint;
-     end;
-
-     TResourceHeader = packed record
-       _Class     : longint;
-       Flags      : longint;
-       NameLen    : word;
-       EntryCount : word;
-     end;
-
-     TResourceFileHeader = packed record
-       Signature  : word;
-       InfoType   : word;
-       InfoSize   : longint;
-     { ---- }
-       TableOfs   : longint;
-     end;
-
-     PResourceEntry = ^TResourceEntry;
-     TResourceEntry = object(TObject)
-       constructor Init(AID, ALangID, AFlags, ADataLen: longint);
-     private
-       ID      : longint;
-       LangID  : longint;
-       Flags   : longint;
-       DataOfs : longint;
-       DataLen : longint;
-       procedure   BuildHeader(var Header : TResourceEntryHeader);
-     end;
-
-     PResourceEntryCollection = ^TResourceEntryCollection;
-     TResourceEntryCollection = object(TSortedCollection)
-       function  At(Index: Sw_Integer): PResourceEntry;
-       function  Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-       function  SearchEntryForLang(ALangID: longint): PResourceEntry;
-     end;
-
-     PGlobalResourceEntryCollection = ^TGlobalResourceEntryCollection;
-     TGlobalResourceEntryCollection = object(TSortedCollection)
-       function  At(Index: Sw_Integer): PResourceEntry;
-       function  Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-     end;
-
-     PResource = ^TResource;
-     TResource = object(TObject)
-       constructor Init(const AName: string; AClass, AFlags: longint);
-       function    GetName: string; virtual;
-       function    FirstThatEntry(Func: pointer): PResourceEntry; virtual;
-       procedure   ForEachEntry(Func: pointer); virtual;
-       destructor  Done; virtual;
-     private
-       Name   : PString;
-       _Class : longint;
-       Flags  : longint;
-       Items  : PResourceEntryCollection;
-       procedure   BuildHeader(var Header : TResourceHeader);
-     end;
-
-     TResourceCollection = object(TSortedCollection)
-       function  At(Index: Sw_Integer): PResource;
-       function  Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
-       function  SearchResourceByName(const AName: string): PResource;
-     end;
-     PResourceCollection = ^TResourceCollection;
-
-     TResourceFile = object(TObject)
-       constructor Init(var RS: TStream; ALoad: boolean);
-       constructor Create(var RS: TStream);
-       constructor Load(var RS: TStream);
-       constructor CreateFile(AFileName: string);
-       constructor LoadFile(AFileName: string);
-       function    FirstThatResource(Func: pointer): PResource; virtual;
-       procedure   ForEachResource(Func: pointer); virtual;
-       procedure   ForEachResourceEntry(Func: pointer); virtual;
-       function    CreateResource(const Name: string; AClass, AFlags: longint): boolean; virtual;
-       function    AddResourceEntry(const ResName: string; ALangID, AFlags: longint; var Data;
-                   ADataSize: sw_integer): boolean; virtual;
-       function    AddResourceEntryFromStream(const ResName: string; ALangID, AFlags: longint;
-                   var Source: TStream; ADataSize: longint): boolean; virtual;
-       function    DeleteResourceEntry(const ResName: string; ALangID: longint): boolean; virtual;
-       function    DeleteResource(const ResName: string): boolean; virtual;
-       function    ReadResourceEntry(const ResName: string; ALangID: longint; var Buf; var BufSize: sw_word): boolean;
-       function    ReadResourceEntryToStream(const ResName: string; ALangID: longint; var DestS: TStream): boolean;
-       procedure   Flush; virtual;
-       destructor  Done; virtual;
-     public
-       BaseOfs: longint;
-       function    FindResource(const ResName: string): PResource;
-       function    FindResourceEntry(const ResName: string; ALangID: longint): PResourceEntry;
-     private
-       S         : PStream;
-       MyStream  : boolean;
-       Resources : PResourceCollection;
-       Entries   : PGlobalResourceEntryCollection;
-       Header    : TResourceFileHeader;
-       Modified  : boolean;
-       procedure  UpdateBlockDatas;
-       function   GetNextEntryID: longint;
-       function   GetTotalSize(IncludeHeaders: boolean): longint;
-       function   CalcSizes(IncludeHeaders, UpdatePosData: boolean): longint;
-       procedure  AddResEntryPtr(P: PResource; E: PResourceEntry);
-       procedure  RemoveResEntryPtr(P: PResource; E: PResourceEntry);
-       function   DeleteArea(AreaStart, AreaSize, TotalSize: longint): boolean;
-       procedure  BuildFileHeader;
-       procedure  WriteHeader;
-       procedure  WriteResourceTable;
-     end;
-     PResourceFile = ^TResourceFile;
-
-implementation
-
-uses  CallSpec,
-      WUtils;
-
-function TResourceEntryCollection.At(Index: Sw_Integer): PResourceEntry;
-begin
-  At:=inherited At(Index);
-end;
-
-function TResourceEntryCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-var K1: PResourceEntry absolute Key1;
-    K2: PResourceEntry absolute Key2;
-    Re: Sw_integer;
-begin
-  if K1^.LangID<K2^.LangID then Re:=-1 else
-  if K1^.LangID>K2^.LangID then Re:= 1 else
-  Re:=0;
-  Compare:=Re;
-end;
-
-function TResourceEntryCollection.SearchEntryForLang(ALangID: longint): PResourceEntry;
-var P: PResourceEntry;
-    E: TResourceEntry;
-    Index: sw_integer;
-begin
-  E.LangID:=ALangID;
-  if Search(@E,Index)=false then P:=nil else
-    P:=At(Index);
-  SearchEntryForLang:=P;
-end;
-
-function TGlobalResourceEntryCollection.At(Index: Sw_Integer): PResourceEntry;
-begin
-  At:=inherited At(Index);
-end;
-
-function TGlobalResourceEntryCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-var K1: PResourceEntry absolute Key1;
-    K2: PResourceEntry absolute Key2;
-    Re: Sw_integer;
-begin
-  if K1^.ID<K2^.ID then Re:=-1 else
-  if K1^.ID>K2^.ID then Re:= 1 else
-  Re:=0;
-  Compare:=Re;
-end;
-
-constructor TResourceEntry.Init(AID, ALangID, AFlags, ADataLen: longint);
-begin
-  inherited Init;
-  ID:=AID;
-  LangID:=ALangID; Flags:=AFlags; DataLen:=ADataLen;
-end;
-
-procedure TResourceEntry.BuildHeader(var Header : TResourceEntryHeader);
-begin
-  FillChar(Header,SizeOf(Header),0);
-  Header.ID:=ID;
-  Header.LangID:=LangID;
-  Header.Flags:=Flags;
-  Header.DataLen:=DataLen;
-  Header.DataOfs:=DataOfs;
-end;
-
-constructor TResource.Init(const AName: string; AClass, AFlags: longint);
-begin
-  inherited Init;
-  Name:=NewStr(AName);
-  _Class:=AClass;
-  Flags:=AFlags;
-  New(Items, Init(10,50));
-end;
-
-function TResource.GetName: string;
-begin
-  GetName:=GetStr(Name);
-end;
-
-function TResource.FirstThatEntry(Func: pointer): PResourceEntry;
-var EP,P: PResourceEntry;
-    I: sw_integer;
-begin
-  P:=nil;
-  for I:=0 to Items^.Count-1 do
-    begin
-      EP:=Items^.At(I);
-      if Byte(Longint(CallPointerMethodLocal(Func,PreviousFramePointer,@Self,EP)))<>0 then
-        begin
-          P := EP;
-          Break;
-        end;
-    end;
-  FirstThatEntry:=P;
-end;
-
-procedure TResource.ForEachEntry(Func: pointer);
-var RP: PResourceEntry;
-    I: sw_integer;
-begin
-  for I:=0 to Items^.Count-1 do
-    begin
-      RP:=Items^.At(I);
-      CallPointerMethodLocal(Func,PreviousFramePointer,@Self,RP);
-    end;
-end;
-
-procedure TResource.BuildHeader(var Header : TResourceHeader);
-begin
-  FillChar(Header,SizeOf(Header),0);
-  Header._Class:=_Class;
-  Header.Flags:=Flags;
-  Header.NameLen:=length(GetName);
-  Header.EntryCount:=Items^.Count;
-end;
-
-destructor TResource.Done;
-begin
-  inherited Done;
-  if Name<>nil then DisposeStr(Name); Name:=nil;
-  if Items<>nil then Dispose(Items, Done); Items:=nil;
-end;
-
-function TResourceCollection.At(Index: Sw_Integer): PResource;
-begin
-  At:=inherited At(Index);
-end;
-
-function TResourceCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
-var K1: PResource absolute Key1;
-    K2: PResource absolute Key2;
-    N1,N2: string;
-    Re: Sw_integer;
-begin
-  N1:=UpcaseStr(K1^.GetName); N2:=UpcaseStr(K2^.GetName);
-  if N1<N2 then Re:=-1 else
-  if N1>N2 then Re:= 1 else
-  Re:=0;
-  Compare:=Re;
-end;
-
-function TResourceCollection.SearchResourceByName(const AName: string): PResource;
-var P,R: PResource;
-    Index: sw_integer;
-begin
-  New(R, Init(AName,0,0));
-  if Search(R,Index)=false then P:=nil else
-    P:=At(Index);
-  Dispose(R, Done);
-  SearchResourceByName:=P;
-end;
-
-constructor TResourceFile.Create(var RS: TStream);
-begin
-  if Init(RS,false)=false then
-    Fail;
-end;
-
-constructor TResourceFile.Load(var RS: TStream);
-begin
-  if Init(RS,true)=false then
-    Fail;
-end;
-
-constructor TResourceFile.Init(var RS: TStream; ALoad: boolean);
-var OK: boolean;
-    RH: TResourceHeader;
-    REH: TResourceEntryHeader;
-    EndPos,I: longint;
-    P: PResource;
-    E: PResourceEntry;
-    St: string;
-begin
-  inherited Init;
-  S:=@RS;
-  New(Resources, Init(100, 1000));
-  New(Entries, Init(500,2000));
-  OK:=true;
-  if ALoad=false then
-    Modified:=true
-  else
-    begin
-      S^.Reset;
-      BaseOfs:=S^.GetPos;
-      S^.Read(Header,SizeOf(Header));
-      OK:=(S^.Status=stOK) and
-          (Header.Signature=TPDataBlockSignature) and
-          (Header.InfoType=ResourceBlockSignature);
-      if OK then begin S^.Seek(BaseOfs+Header.TableOfs); OK:=S^.Status=stOK; end;
-      EndPos:=BaseOfs+Header.InfoSize;
-      if OK then
-        while OK and (S^.GetPos<EndPos) do
-          begin
-            S^.Read(RH,SizeOf(RH)); OK:=(S^.Status=stOK);
-            if OK then begin St[0]:=chr(RH.NameLen); S^.Read(St[1],RH.NameLen); OK:=(S^.Status=stOK); end;
-            if OK then
-              begin
-                New(P, Init(St,RH._Class,RH.Flags));
-                Resources^.Insert(P);
-              end;
-            I:=0;
-            while OK and (I<RH.EntryCount) do
-              begin
-                S^.Read(REH,SizeOf(REH)); OK:=(S^.Status=stOK);
-                if OK then
-                  begin
-                    New(E, Init(REH.ID,REH.LangID,REH.Flags,REH.DataLen));
-                    AddResEntryPtr(P,E);
-                  end;
-                if OK then Inc(I);
-              end;
-            if OK then UpdateBlockDatas;
-          end;
-    end;
-  if OK=false then
-    begin
-      Done;
-      Fail;
-    end;
-end;
-
-function TResourceFile.FirstThatResource(Func: pointer): PResource;
-var RP,P: PResource;
-    I: sw_integer;
-begin
-  P:=nil;
-  for I:=0 to Resources^.Count-1 do
-    begin
-      RP:=Resources^.At(I);
-      if Byte(Longint(CallPointerMethodLocal(Func,PreviousFramePointer,@Self,RP)))<>0 then
-        begin
-          P := RP;
-          Break;
-        end;
-    end;
-  FirstThatResource:=P;
-end;
-
-procedure TResourceFile.ForEachResource(Func: pointer);
-var RP: PResource;
-    I: sw_integer;
-begin
-  for I:=0 to Resources^.Count-1 do
-    begin
-      RP:=Resources^.At(I);
-      CallPointerMethodLocal(Func,PreviousFramePointer,@Self,RP);
-    end;
-end;
-
-procedure TResourceFile.ForEachResourceEntry(Func: pointer);
-var E: PResourceEntry;
-    I: sw_integer;
-begin
-  for I:=0 to Entries^.Count-1 do
-    begin
-      E:=Entries^.At(I);
-      CallPointerMethodLocal(Func,PreviousFramePointer,@Self,E);
-    end;
-end;
-
-function TResourceFile.CreateResource(const Name: string; AClass, AFlags: longint): boolean;
-var OK: boolean;
-    P: PResource;
-begin
-  OK:=FindResource(Name)=nil;
-  if OK then
-    begin
-      New(P, Init(Name,AClass,AFlags));
-      Resources^.Insert(P);
-      Modified:=true;
-    end;
-  CreateResource:=OK;
-end;
-
-function TResourceFile.AddResourceEntry(const ResName: string; ALangID, AFlags: longint; var Data;
-           ADataSize: sw_integer): boolean;
-const BlockSize = 4096;
-var OK: boolean;
-    P: PResource;
-    E: PResourceEntry;
-    RemSize,CurOfs,FragSize: longint;
-begin
-  P:=FindResource(ResName);
-  OK:=P<>nil;
-  if OK then
-    OK:=(P^.Items^.SearchEntryForLang(ALangID)=nil);
-  if OK then
-    begin
-      New(E, Init(GetNextEntryID,ALangID, AFlags, ADataSize));
-      AddResEntryPtr(P,E);
-      UpdateBlockDatas;
-      RemSize:=ADataSize; CurOfs:=0;
-      S^.Reset;
-      S^.Seek(BaseOfs+E^.DataOfs);
-      while (RemSize>0) do
-      begin
-        FragSize:=Min(RemSize,BlockSize);
-        S^.Write(PByteArray(@Data)^[CurOfs],FragSize);
-        Dec(RemSize,FragSize); Inc(CurOfs,FragSize);
-      end;
-      Modified:=true;
-    end;
-  AddResourceEntry:=OK;
-end;
-
-function TResourceFile.AddResourceEntryFromStream(const ResName: string; ALangID, AFlags: longint;
-           var Source: TStream; ADataSize: longint): boolean;
-const BufSize = 4096;
-var OK: boolean;
-    P: PResource;
-    E: PResourceEntry;
-    RemSize,FragSize: longint;
-    Buf: pointer;
-begin
-  P:=FindResource(ResName);
-  OK:=P<>nil;
-  if OK then
-    OK:=(P^.Items^.SearchEntryForLang(ALangID)=nil);
-  if OK then
-    begin
-      New(E, Init(GetNextEntryID, ALangID, AFlags, ADataSize));
-      AddResEntryPtr(P,E);
-      UpdateBlockDatas;
-      GetMem(Buf,BufSize);
-      RemSize:=ADataSize;
-      S^.Reset;
-      S^.Seek(BaseOfs+E^.DataOfs);
-      while (RemSize>0) do
-      begin
-        FragSize:=Min(RemSize,BufSize);
-        Source.Read(Buf^,FragSize);
-        S^.Write(Buf^,FragSize);
-        Dec(RemSize,FragSize);
-      end;
-      FreeMem(Buf,BufSize);
-      Modified:=true;
-    end;
-  AddResourceEntryFromStream:=OK;
-end;
-
-function TResourceFile.DeleteResourceEntry(const ResName: string; ALangID: longint): boolean;
-var E: PResourceEntry;
-    P: PResource;
-    OK: boolean;
-begin
-  P:=FindResource(ResName);
-  OK:=P<>nil;
-  if OK then E:=P^.Items^.SearchEntryForLang(ALangID);
-  OK:=OK and (E<>nil);
-  if OK then
-    begin
-      OK:=DeleteArea(E^.DataOfs,E^.DataLen,GetTotalSize(false));
-      if OK then begin RemoveResEntryPtr(P,E); Dispose(E, Done); end;
-      Modified:=true;
-    end;
-  DeleteResourceEntry:=OK;
-end;
-
-function TResourceFile.DeleteResource(const ResName: string): boolean;
-var P: PResource;
-    E: PResourceEntry;
-    OK: boolean;
-begin
-  P:=FindResource(ResName);
-  OK:=P<>nil;
-  if P<>nil then
-  begin
-    while OK and (P^.Items^.Count>0) do
-      begin
-        E:=P^.Items^.At(P^.Items^.Count-1);
-        OK:=OK and DeleteResourceEntry(ResName,E^.LangID);
-      end;
-    Modified:=true;
-  end;
-  if OK then Resources^.Free(P);
-  DeleteResource:=OK;
-end;
-
-function TResourceFile.ReadResourceEntry(const ResName: string; ALangID: longint; var Buf; var BufSize: sw_word): boolean;
-var E: PResourceEntry;
-    P: PResource;
-    OK: boolean;
-    CurOfs,CurFrag: sw_word;
-    TempBuf: pointer;
-const TempBufSize = 4096;
-begin
-  P:=FindResource(ResName);
-  OK:=P<>nil;
-  if OK then E:=P^.Items^.SearchEntryForLang(ALangID);
-  OK:=OK and (E<>nil);
-  OK:=OK and (E^.DataLen<=BufSize);
-  if OK then
-    begin
-      GetMem(TempBuf,TempBufSize);
-      S^.Reset;
-      S^.Seek(BaseOfs+E^.DataOfs);
-      OK:=(S^.Status=stOK);
-      CurOfs:=0;
-
-      while OK and (CurOfs<E^.DataLen) do
-      begin
-        CurFrag:=Min(E^.DataLen-CurOfs,TempBufSize);
-        S^.Read(TempBuf^,CurFrag);
-        OK:=OK and (S^.Status=stOK);
-        if OK then
-          Move(TempBuf^,PByteArray(@Buf)^[CurOfs],CurFrag);
-        Inc(CurOfs,CurFrag);
-      end;
-
-      FreeMem(TempBuf,TempBufSize);
-    end;
-  ReadResourceEntry:=OK;
-end;
-
-function TResourceFile.ReadResourceEntryToStream(const ResName: string; ALangID: longint; var DestS: TStream): boolean;
-var E: PResourceEntry;
-    P: PResource;
-    OK: boolean;
-    CurOfs,CurFrag: sw_word;
-    TempBuf: pointer;
-const TempBufSize = 4096;
-begin
-  P:=FindResource(ResName);
-  OK:=P<>nil;
-  if OK then E:=P^.Items^.SearchEntryForLang(ALangID);
-  OK:=OK and (E<>nil);
-  if OK then
-    begin
-      GetMem(TempBuf,TempBufSize);
-      S^.Reset;
-      S^.Seek(BaseOfs+E^.DataOfs);
-      OK:=(S^.Status=stOK);
-      CurOfs:=0;
-      { this results sometimes in endless loops
-      when the resource are changed PM }
-      if E^.DataLen<0 then
-        OK:=false;
-      while OK and (CurOfs<E^.DataLen) do
-      begin
-        CurFrag:=Min(E^.DataLen-CurOfs,TempBufSize);
-        S^.Read(TempBuf^,CurFrag);
-        OK:=OK and (S^.Status=stOK);
-        if OK then
-          DestS.Write(TempBuf^,CurFrag);
-        OK:=OK and (DestS.Status=stOK);
-        Inc(CurOfs,CurFrag);
-      end;
-
-      FreeMem(TempBuf,TempBufSize);
-    end;
-  ReadResourceEntryToStream:=OK;
-end;
-
-function TResourceFile.FindResource(const ResName: string): PResource;
-begin
-  FindResource:=Resources^.SearchResourceByName(ResName);
-end;
-
-function TResourceFile.FindResourceEntry(const ResName: string; ALangID: longint): PResourceEntry;
-var P: PResource;
-    E: PResourceEntry;
-begin
-  E:=nil;
-  P:=FindResource(ResName);
-  if P<>nil then
-    E:=P^.Items^.SearchEntryForLang(ALangID);
-  FindResourceEntry:=E;
-end;
-
-procedure TResourceFile.Flush;
-begin
-  if Modified=false then Exit;
-  BuildFileHeader;
-  S^.Seek(BaseOfs);
-  WriteHeader;
-  S^.Seek(BaseOfs+Header.TableOfs);
-  WriteResourceTable;
-  S^.Truncate;
-  Modified:=false;
-end;
-
-procedure TResourceFile.BuildFileHeader;
-begin
-  FillChar(Header,SizeOf(Header),0);
-  with Header do
-  begin
-    Signature:=TPDataBlockSignature;
-    InfoType:=ResourceBlockSignature;
-    InfoSize:=GetTotalSize(true);
-    TableOfs:=GetTotalSize(false);
-  end;
-end;
-
-procedure TResourceFile.WriteHeader;
-begin
-  S^.Write(Header,SizeOf(Header));
-end;
-
-procedure TResourceFile.WriteResourceTable;
-var RH: TResourceHeader;
-    REH: TResourceEntryHeader;
-procedure WriteResource(P: PResource); {$ifndef FPC}far;{$endif}
-procedure WriteResourceEntry(P: PResourceEntry); {$ifndef FPC}far;{$endif}
-begin
-  P^.BuildHeader(REH);
-  S^.Write(REH,SizeOf(REH));
-end;
-var N: string;
-begin
-  if P^.Items^.Count=0 then Exit; { do not store resources with no entries }
-  P^.BuildHeader(RH);
-  S^.Write(RH,SizeOf(RH));
-  N:=P^.GetName;
-  S^.Write(N[1],length(N));
-  P^.ForEachEntry(@WriteResourceEntry);
-end;
-begin
-  ForEachResource(@WriteResource);
-end;
-
-procedure TResourceFile.UpdateBlockDatas;
-begin
-  CalcSizes(false,true);
-end;
-
-function TResourceFile.GetTotalSize(IncludeHeaders: boolean): longint;
-begin
-  GetTotalSize:=CalcSizes(IncludeHeaders,false);
-end;
-
-function TResourceFile.CalcSizes(IncludeHeaders, UpdatePosData: boolean): longint;
-var RH  : TResourceHeader;
-    REH : TResourceEntryHeader;
-    Size: longint;
-    NamesSize: longint;
-procedure AddResourceEntrySize(P: PResourceEntry); {$ifndef FPC}far;{$endif}
-begin
-  if UpdatePosData then P^.DataOfs:=Size;
-  P^.BuildHeader(REH);
-  Inc(Size,REH.DataLen);
-end;
-procedure AddResourceSize(P: PResource); {$ifndef FPC}far;{$endif}
-var RH: TResourceHeader;
-begin
-  P^.BuildHeader(RH);
-  Inc(NamesSize,RH.NameLen);
-end;
-begin
-  Size:=0; NamesSize:=0;
-  Inc(Size,SizeOf(Header)); { this is on start so we always include it }
-  ForEachResourceEntry(@AddResourceEntrySize);
-  if IncludeHeaders then
-    begin
-      ForEachResource(@AddResourceSize);
-      Inc(Size,SizeOf(RH)*Resources^.Count);
-      Inc(Size,SizeOf(REH)*Entries^.Count);
-      Inc(Size,NamesSize);
-    end;
-  CalcSizes:=Size;
-end;
-
-function TResourceFile.DeleteArea(AreaStart, AreaSize, TotalSize: longint): boolean;
-const BufSize = 4096;
-var RemSize,FragSize,CurOfs: longint;
-    Buf: pointer;
-    OK: boolean;
-begin
-  GetMem(Buf,BufSize);
-  RemSize:=TotalSize-(AreaStart+AreaSize); CurOfs:=0;
-  OK:=RemSize>=0;
-  while (RemSize>0) do
-    begin
-      FragSize:=Min(RemSize,BufSize);
-      S^.Seek(BaseOfs+AreaStart+AreaSize+CurOfs);
-      S^.Read(Buf^,BufSize);
-      OK:=OK and (S^.Status=stOK);
-      if OK then
-      begin
-        S^.Seek(BaseOfs+AreaStart+CurOfs);
-        S^.Write(Buf^,BufSize);
-        OK:=OK and (S^.Status=stOK);
-      end;
-      Inc(CurOfs,FragSize); Dec(RemSize,FragSize);
-    end;
-  FreeMem(Buf,BufSize);
-  DeleteArea:=OK;
-end;
-
-procedure TResourceFile.AddResEntryPtr(P: PResource; E: PResourceEntry);
-begin
-  if (P=nil) or (E=nil) then Exit;
-  P^.Items^.Insert(E);
-  Entries^.Insert(E);
-end;
-
-procedure TResourceFile.RemoveResEntryPtr(P: PResource; E: PResourceEntry);
-begin
-  if (P=nil) or (E=nil) then Exit;
-  Entries^.Delete(E);
-  P^.Items^.Delete(E);
-end;
-
-function TResourceFile.GetNextEntryID: longint;
-var ID: longint;
-begin
-  if Entries^.Count=0 then ID:=1 else
-    ID:=Entries^.At(Entries^.Count-1)^.ID+1;
-  GetNextEntryID:=ID;
-end;
-
-destructor TResourceFile.Done;
-begin
-  Flush;
-  inherited Done;
-{  if assigned(S) then dispose(S,Done); S:=nil;}
-  if Resources<>nil then Dispose(Resources, Done); Resources:=nil;
-  if Entries<>nil then
-    begin Entries^.DeleteAll; Dispose(Entries, Done); Entries:=nil; end;
-  if MyStream and Assigned(S) then
-    Dispose(S, Done);
-end;
-
-constructor TResourceFile.CreateFile(AFileName: string);
-var B: PFastBufStream;
-begin
-  New(B, Init(AFileName, stCreate, 4096));
-  if (B<>nil) and (B^.Status<>stOK) then
-    begin Dispose(B, Done); B:=nil; end;
-  if B=nil then Fail;
-  if Create(B^)=false then
-    Begin
-      Dispose(B,Done);
-      Fail;
-    End;
-  MyStream:=true;
-end;
-
-constructor TResourceFile.LoadFile(AFileName: string);
-var B: PFastBufStream;
-begin
-  New(B, Init(AFileName, stOpen, 4096));
-  if (B<>nil) and (B^.Status<>stOK) then
-    begin Dispose(B, Done); B:=nil; end;
-  if B=nil then Fail;
-  if Load(B^)=false then
-    Begin
-      Dispose(B,Done);
-      Fail;
-    End;
-  MyStream:=true;
-end;
-
-END.
-{
-  $Log$
-  Revision 1.1  2000-07-13 09:48:37  michael
-  + Initial import
-
-  Revision 1.11  2000/07/03 08:54:54  pierre
-   * Some enhancements for WinHelp support by G	abor
-
-  Revision 1.10  2000/05/16 21:48:13  pierre
-   * dispose of PBufStream before Fail in TResourceFile.LoadFile and CreateFile
-
-  Revision 1.9  2000/04/18 11:42:39  pierre
-   lot of Gabor changes : see fixes.txt
-
-  Revision 1.8  2000/02/07 08:29:14  michael
-  [*] the fake (!) TOKENS.PAS still contained the typo bug
-       FSplit(,n,d,e) (correctly FSplit(,d,n,e))
-  [*] CodeComplete had a very ugly bug - coordinates were document-relative
-      (instead of being screen-relative)
-  [*] TResourceStream didn't count the size of the resource names when
-      determining the file size and this could lead to the last resources not
-      loaded correctly
-
-
-  [+] Ctrl-Enter in editor now tries to open the file at cursor
-  [+] CodeComplete option added to Options|Environment|Editor
-  [+] user interface for managing CodeComplete implemented
-  [+] user interface for CodeTemplates implemented
-  [+] CodeComplete wordlist and CodeTemplates stored in desktop file
-  [+] help topic size no longer limited to 64KB when compiled with FPC
-
-  Revision 1.7  1999/09/07 09:26:26  pierre
-   * E^.DataLen=-1 sets OK to false in TResourceFile.ReadSourceEntryToStream
-
-  Revision 1.6  1999/08/03 20:22:44  peter
-    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
-    + Desktop saving should work now
-       - History saved
-       - Clipboard content saved
-       - Desktop saved
-       - Symbol info saved
-    * syntax-highlight bug fixed, which compared special keywords case sensitive
-      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
-    * with 'whole words only' set, the editor didn't found occourences of the
-      searched text, if the text appeared previously in the same line, but didn't
-      satisfied the 'whole-word' condition
-    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
-      (ie. the beginning of the selection)
-    * when started typing in a new line, but not at the start (X=0) of it,
-      the editor inserted the text one character more to left as it should...
-    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
-    * Shift shouldn't cause so much trouble in TCodeEditor now...
-    * Syntax highlight had problems recognizing a special symbol if it was
-      prefixed by another symbol character in the source text
-    * Auto-save also occours at Dos shell, Tool execution, etc. now...
-
-  Revision 1.5  1999/06/17 23:45:21  pierre
-   * dipsoe of S field in TResourceFile destructor
-
-  Revision 1.4  1999/04/07 21:56:05  peter
-    + object support for browser
-    * html help fixes
-    * more desktop saving things
-    * NODEBUG directive to exclude debugger
-
-  Revision 1.3  1999/03/23 16:16:43  peter
-    * linux fixes
-
-  Revision 1.2  1999/03/23 15:11:40  peter
-    * desktop saving things
-    * vesa mode
-    * preferences dialog
-
-  Revision 1.1  1999/03/16 12:38:18  peter
-    * tools macro fixes
-    + tph writer
-    + first things for resource files
-
-}

Some files were not shown because too many files changed in this diff