diff options
Diffstat (limited to 'packages/morphunits')
25 files changed, 23871 insertions, 0 deletions
diff --git a/packages/morphunits/Makefile b/packages/morphunits/Makefile new file mode 100644 index 0000000000..de98eaf9cb --- /dev/null +++ b/packages/morphunits/Makefile @@ -0,0 +1,2407 @@ +# +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213] +# +default: all +MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos +BSDs = freebsd netbsd openbsd darwin dragonfly +UNIXs = linux $(BSDs) solaris qnx haiku aix +LIMIT83fs = go32v2 os2 emx watcom msdos +OSNeedsComspecToRunBatch = go32v2 watcom +FORCE: +.PHONY: FORCE +override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH))) +ifneq ($(findstring darwin,$(OSTYPE)),) +inUnix=1 #darwin +SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH))) +else +ifeq ($(findstring ;,$(PATH)),) +inUnix=1 +SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH))) +else +SEARCHPATH:=$(subst ;, ,$(PATH)) +endif +endif +SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE)))) +PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH)))) +ifeq ($(PWD),) +PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH)))) +ifeq ($(PWD),) +$(error You need the GNU utils package to use this Makefile) +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 cygdrive,$(PATH)),) +inCygWin=1 +endif +endif +ifdef inUnix +SRCBATCHEXT=.sh +else +ifdef inOS2 +SRCBATCHEXT=.cmd +else +SRCBATCHEXT=.bat +endif +endif +ifdef COMSPEC +ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),) +ifndef RUNBATCH +RUNBATCH=$(COMSPEC) /C +endif +endif +endif +ifdef inUnix +PATHSEP=/ +else +PATHSEP:=$(subst /,\,/) +ifdef inCygWin +PATHSEP=/ +endif +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 +ifdef inOS2 +ifndef ECHO +ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO=echo +else +ECHO:=$(firstword $(ECHO)) +endif +else +ECHO:=$(firstword $(ECHO)) +endif +endif +export ECHO +endif +override DEFAULT_FPCDIR=../.. +ifndef FPC +ifdef PP +FPC=$(PP) +endif +endif +ifndef FPC +FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH)))) +ifneq ($(FPCPROG),) +FPCPROG:=$(firstword $(FPCPROG)) +ifneq ($(CPU_TARGET),) +FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB) +else +FPC:=$(shell $(FPCPROG) -PB) +endif +ifneq ($(findstring Error,$(FPC)),) +override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH))))) +else +ifeq ($(strip $(wildcard $(FPC))),) +FPC:=$(firstword $(FPCPROG)) +endif +endif +else +override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH))))) +endif +endif +override FPC:=$(subst $(SRCEXEEXT),,$(FPC)) +override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT) +FOUNDFPC:=$(strip $(wildcard $(FPC))) +ifeq ($(FOUNDFPC),) +FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH)))) +ifeq ($(FOUNDFPC),) +$(error Compiler $(FPC) not found) +endif +endif +ifndef FPC_COMPILERINFO +FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO) +endif +ifndef FPC_VERSION +FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO)) +endif +export FPC FPC_VERSION FPC_COMPILERINFO +unexport CHECKDEPEND ALLDEPENDENCIES +ifndef CPU_TARGET +ifdef CPU_TARGET_DEFAULT +CPU_TARGET=$(CPU_TARGET_DEFAULT) +endif +endif +ifndef OS_TARGET +ifdef OS_TARGET_DEFAULT +OS_TARGET=$(OS_TARGET_DEFAULT) +endif +endif +ifndef CPU_SOURCE +CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO)) +endif +ifndef CPU_TARGET +CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO)) +endif +ifndef OS_SOURCE +OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO)) +endif +ifndef OS_TARGET +OS_TARGET:=$(word 5,$(FPC_COMPILERINFO)) +endif +FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) +FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) +ifeq ($(CPU_TARGET),armeb) +ARCH=arm +override FPCOPT+=-Cb +else +ifeq ($(CPU_TARGET),armel) +ARCH=arm +override FPCOPT+=-CaEABI +else +ARCH=$(CPU_TARGET) +endif +endif +ifeq ($(FULL_TARGET),arm-embedded) +ifeq ($(SUBARCH),) +$(error When compiling for arm-embedded, a sub-architecture (e.g. SUBARCH=armv4t or SUBARCH=armv7m) must be defined) +endif +override FPCOPT+=-Cp$(SUBARCH) +endif +ifeq ($(FULL_TARGET),mipsel-embedded) +ifeq ($(SUBARCH),) +$(error When compiling for mipsel-embedded, a sub-architecture (e.g. SUBARCH=pic32mx) must be defined) +endif +override FPCOPT+=-Cp$(SUBARCH) +endif +ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),) +TARGETSUFFIX=$(OS_TARGET) +SOURCESUFFIX=$(OS_SOURCE) +else +ifneq ($(findstring $(OS_TARGET),$(LIMIT83fs)),) +TARGETSUFFIX=$(OS_TARGET) +else +TARGETSUFFIX=$(FULL_TARGET) +endif +SOURCESUFFIX=$(FULL_SOURCE) +endif +ifneq ($(FULL_TARGET),$(FULL_SOURCE)) +CROSSCOMPILE=1 +endif +ifeq ($(findstring makefile,$(MAKECMDGOALS)),) +ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),) +$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first) +endif +endif +ifneq ($(findstring $(OS_TARGET),$(BSDs)),) +BSDhier=1 +endif +ifeq ($(OS_TARGET),linux) +linuxHier=1 +endif +ifndef CROSSCOMPILE +BUILDFULLNATIVE=1 +export BUILDFULLNATIVE +endif +ifdef BUILDFULLNATIVE +BUILDNATIVE=1 +export BUILDNATIVE +endif +export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE +ifdef FPCDIR +override FPCDIR:=$(subst \,/,$(FPCDIR)) +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR=wrong +endif +else +override FPCDIR=wrong +endif +ifdef DEFAULT_FPCDIR +ifeq ($(FPCDIR),wrong) +override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR)) +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl 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:=$(BASEDIR) +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR=c:/pp +endif +endif +endif +endif +endif +ifndef CROSSBINDIR +CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX)) +endif +ifneq ($(findstring $(OS_TARGET),darwin iphonesim),) +ifeq ($(OS_SOURCE),darwin) +DARWIN2DARWIN=1 +endif +endif +ifndef BINUTILSPREFIX +ifndef CROSSBINDIR +ifdef CROSSCOMPILE +ifneq ($(OS_TARGET),msdos) +ifndef DARWIN2DARWIN +ifneq ($(CPU_TARGET),jvm) +BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)- +ifeq ($(OS_TARGET),android) +ifeq ($(CPU_TARGET),arm) +BINUTILSPREFIX=arm-linux-androideabi- +else +ifeq ($(CPU_TARGET),i386) +BINUTILSPREFIX=i686-linux-android- +else +ifeq ($(CPU_TARGET),mipsel) +BINUTILSPREFIX=mipsel-linux-android- +endif +endif +endif +endif +endif +endif +else +BINUTILSPREFIX=$(OS_TARGET)- +endif +endif +endif +endif +UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX)) +ifeq ($(UNITSDIR),) +UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET)) +endif +PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) +ifndef FPCFPMAKE +ifdef CROSSCOMPILE +ifeq ($(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR)))),) +FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH)))) +ifneq ($(FPCPROG),) +FPCPROG:=$(firstword $(FPCPROG)) +FPCFPMAKE:=$(shell $(FPCPROG) -PB) +ifeq ($(strip $(wildcard $(FPCFPMAKE))),) +FPCFPMAKE:=$(firstword $(FPCPROG)) +endif +else +override FPCFPMAKE=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH))))) +endif +else +FPCFPMAKE=$(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR)))) +FPMAKE_SKIP_CONFIG=-n +export FPCFPMAKE +export FPMAKE_SKIP_CONFIG +endif +else +FPMAKE_SKIP_CONFIG=-n +FPCFPMAKE=$(FPC) +endif +endif +override PACKAGE_NAME=morphunits +override PACKAGE_VERSION=3.1.1 +FPMAKE_BIN_CLEAN=$(wildcard ./fpmake$(SRCEXEEXT)) +ifdef OS_TARGET +FPC_TARGETOPT+=--os=$(OS_TARGET) +endif +ifdef CPU_TARGET +FPC_TARGETOPT+=--cpu=$(CPU_TARGET) +endif +LOCALFPMAKE=./fpmake$(SRCEXEEXT) +override INSTALL_FPCPACKAGE=y +ifdef REQUIRE_UNITSDIR +override UNITSDIR+=$(REQUIRE_UNITSDIR) +endif +ifdef REQUIRE_PACKAGESDIR +override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR) +endif +ifdef ZIPINSTALL +ifneq ($(findstring $(OS_TARGET),$(UNIXs)),) +UNIXHier=1 +endif +else +ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),) +UNIXHier=1 +endif +endif +ifndef INSTALL_PREFIX +ifdef PREFIX +INSTALL_PREFIX=$(PREFIX) +endif +endif +ifndef INSTALL_PREFIX +ifdef UNIXHier +INSTALL_PREFIX=/usr/local +else +ifdef INSTALL_FPCPACKAGE +INSTALL_BASEDIR:=/pp +else +INSTALL_BASEDIR:=/$(PACKAGE_NAME) +endif +endif +endif +export INSTALL_PREFIX +ifdef INSTALL_FPCSUBDIR +export INSTALL_FPCSUBDIR +endif +ifndef DIST_DESTDIR +DIST_DESTDIR:=$(BASEDIR) +endif +export DIST_DESTDIR +ifndef COMPILER_UNITTARGETDIR +ifdef PACKAGEDIR_MAIN +COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX) +else +COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX) +endif +endif +ifndef COMPILER_TARGETDIR +COMPILER_TARGETDIR=. +endif +ifndef INSTALL_BASEDIR +ifdef UNIXHier +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 UNIXHier +INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin +else +INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin +ifdef INSTALL_FPCPACKAGE +ifdef CROSSCOMPILE +ifdef CROSSINSTALL +INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX) +else +INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX) +endif +else +INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX) +endif +endif +endif +endif +ifndef INSTALL_UNITDIR +INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX) +ifdef INSTALL_FPCPACKAGE +ifdef PACKAGE_NAME +INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME) +endif +endif +endif +ifndef INSTALL_LIBDIR +ifdef UNIXHier +INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib +else +INSTALL_LIBDIR:=$(INSTALL_UNITDIR) +endif +endif +ifndef INSTALL_SOURCEDIR +ifdef UNIXHier +ifdef BSDhier +SRCPREFIXDIR=share/src +else +ifdef linuxHier +SRCPREFIXDIR=share/src +else +SRCPREFIXDIR=src +endif +endif +ifdef INSTALL_FPCPACKAGE +ifdef INSTALL_FPCSUBDIR +INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME) +else +INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME) +endif +else +INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +endif +else +ifdef INSTALL_FPCPACKAGE +ifdef INSTALL_FPCSUBDIR +INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME) +else +INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME) +endif +else +INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source +endif +endif +endif +ifndef INSTALL_DOCDIR +ifdef UNIXHier +ifdef BSDhier +DOCPREFIXDIR=share/doc +else +ifdef linuxHier +DOCPREFIXDIR=share/doc +else +DOCPREFIXDIR=doc +endif +endif +ifdef INSTALL_FPCPACKAGE +INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME) +else +INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(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 UNIXHier +ifdef INSTALL_FPCPACKAGE +ifdef BSDhier +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME) +else +ifdef linuxHier +INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples +else +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME) +endif +endif +else +ifdef BSDhier +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +else +ifdef linuxHier +INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +else +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +endif +endif +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 +ifndef INSTALL_SHAREDDIR +INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib +endif +ifdef CROSSCOMPILE +ifndef CROSSBINDIR +CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX)) +ifeq ($(CROSSBINDIR),) +CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE)) +endif +endif +else +CROSSBINDIR= +endif +BATCHEXT=.bat +LOADEREXT=.as +EXEEXT=.exe +PPLEXT=.ppl +PPUEXT=.ppu +OEXT=.o +ASMEXT=.s +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.so +SHAREDLIBPREFIX=libfp +STATICLIBPREFIX=libp +IMPORTLIBPREFIX=libimp +RSTEXT=.rst +EXEDBGEXT=.dbg +ifeq ($(OS_TARGET),go32v1) +STATICLIBPREFIX= +SHORTSUFFIX=v1 +endif +ifeq ($(OS_TARGET),go32v2) +STATICLIBPREFIX= +SHORTSUFFIX=dos +IMPORTLIBPREFIX= +endif +ifeq ($(OS_TARGET),watcom) +STATICLIBPREFIX= +OEXT=.obj +ASMEXT=.asm +SHAREDLIBEXT=.dll +SHORTSUFFIX=wat +IMPORTLIBPREFIX= +endif +ifneq ($(CPU_TARGET),jvm) +ifeq ($(OS_TARGET),android) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=lnx +endif +endif +ifeq ($(OS_TARGET),linux) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=lnx +endif +ifeq ($(OS_TARGET),dragonfly) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=df +endif +ifeq ($(OS_TARGET),freebsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=fbs +endif +ifeq ($(OS_TARGET),netbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=nbs +endif +ifeq ($(OS_TARGET),openbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=obs +endif +ifeq ($(OS_TARGET),win32) +SHAREDLIBEXT=.dll +SHORTSUFFIX=w32 +endif +ifeq ($(OS_TARGET),os2) +BATCHEXT=.cmd +AOUTEXT=.out +STATICLIBPREFIX= +SHAREDLIBEXT=.dll +SHORTSUFFIX=os2 +ECHO=echo +IMPORTLIBPREFIX= +endif +ifeq ($(OS_TARGET),emx) +BATCHEXT=.cmd +AOUTEXT=.out +STATICLIBPREFIX= +SHAREDLIBEXT=.dll +SHORTSUFFIX=emx +ECHO=echo +IMPORTLIBPREFIX= +endif +ifeq ($(OS_TARGET),amiga) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=amg +endif +ifeq ($(OS_TARGET),aros) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=aros +endif +ifeq ($(OS_TARGET),morphos) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=mos +endif +ifeq ($(OS_TARGET),atari) +EXEEXT=.ttp +SHORTSUFFIX=ata +endif +ifeq ($(OS_TARGET),beos) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=be +endif +ifeq ($(OS_TARGET),haiku) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=hai +endif +ifeq ($(OS_TARGET),solaris) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=sun +endif +ifeq ($(OS_TARGET),qnx) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=qnx +endif +ifeq ($(OS_TARGET),netware) +EXEEXT=.nlm +STATICLIBPREFIX= +SHORTSUFFIX=nw +IMPORTLIBPREFIX=imp +endif +ifeq ($(OS_TARGET),netwlibc) +EXEEXT=.nlm +STATICLIBPREFIX= +SHORTSUFFIX=nwl +IMPORTLIBPREFIX=imp +endif +ifeq ($(OS_TARGET),macos) +BATCHEXT= +EXEEXT= +DEBUGSYMEXT=.xcoff +SHORTSUFFIX=mac +IMPORTLIBPREFIX=imp +endif +ifneq ($(findstring $(OS_TARGET),darwin iphonesim),) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=dwn +EXEDBGEXT=.dSYM +endif +ifeq ($(OS_TARGET),gba) +EXEEXT=.gba +SHAREDLIBEXT=.so +SHORTSUFFIX=gba +endif +ifeq ($(OS_TARGET),symbian) +SHAREDLIBEXT=.dll +SHORTSUFFIX=symbian +endif +ifeq ($(OS_TARGET),NativeNT) +SHAREDLIBEXT=.dll +SHORTSUFFIX=nativent +endif +ifeq ($(OS_TARGET),wii) +EXEEXT=.dol +SHAREDLIBEXT=.so +SHORTSUFFIX=wii +endif +ifeq ($(OS_TARGET),aix) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=aix +endif +ifeq ($(OS_TARGET),java) +OEXT=.class +ASMEXT=.j +SHAREDLIBEXT=.jar +SHORTSUFFIX=java +endif +ifeq ($(CPU_TARGET),jvm) +ifeq ($(OS_TARGET),android) +OEXT=.class +ASMEXT=.j +SHAREDLIBEXT=.jar +SHORTSUFFIX=android +endif +endif +ifeq ($(OS_TARGET),msdos) +STATICLIBPREFIX= +STATICLIBEXT=.a +SHORTSUFFIX=d16 +endif +ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),) +FPCMADE=fpcmade.$(SHORTSUFFIX) +ZIPSUFFIX=$(SHORTSUFFIX) +ZIPCROSSPREFIX= +ZIPSOURCESUFFIX=src +ZIPEXAMPLESUFFIX=exm +else +FPCMADE=fpcmade.$(TARGETSUFFIX) +ZIPSOURCESUFFIX=.source +ZIPEXAMPLESUFFIX=.examples +ifdef CROSSCOMPILE +ZIPSUFFIX=.$(SOURCESUFFIX) +ZIPCROSSPREFIX=$(TARGETSUFFIX)- +else +ZIPSUFFIX=.$(TARGETSUFFIX) +ZIPCROSSPREFIX= +endif +endif +ifndef ECHO +ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO= __missing_command_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= __missing_command_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= __missing_command_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= __missing_command_CPPROG +else +CPPROG:=$(firstword $(CPPROG)) +endif +endif +export CPPROG +ifndef RMPROG +RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(RMPROG),) +RMPROG= __missing_command_RMPROG +else +RMPROG:=$(firstword $(RMPROG)) +endif +endif +export RMPROG +ifndef MVPROG +MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(MVPROG),) +MVPROG= __missing_command_MVPROG +else +MVPROG:=$(firstword $(MVPROG)) +endif +endif +export MVPROG +ifndef MKDIRPROG +MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(MKDIRPROG),) +MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(MKDIRPROG),) +MKDIRPROG= __missing_command_MKDIRPROG +else +MKDIRPROG:=$(firstword $(MKDIRPROG)) +endif +else +MKDIRPROG:=$(firstword $(MKDIRPROG)) +endif +endif +export MKDIRPROG +ifndef ECHOREDIR +ifndef inUnix +ECHOREDIR=echo +else +ECHOREDIR=$(ECHO) +endif +endif +ifndef COPY +COPY:=$(CPPROG) -fp +endif +ifndef COPYTREE +COPYTREE:=$(CPPROG) -Rfp +endif +ifndef MKDIRTREE +MKDIRTREE:=$(MKDIRPROG) -p +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= __missing_command_PPUMOVE +else +PPUMOVE:=$(firstword $(PPUMOVE)) +endif +endif +export PPUMOVE +ifndef FPCMAKE +FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(FPCMAKE),) +FPCMAKE= __missing_command_FPCMAKE +else +FPCMAKE:=$(firstword $(FPCMAKE)) +endif +endif +export FPCMAKE +ifndef ZIPPROG +ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ZIPPROG),) +ZIPPROG= __missing_command_ZIPPROG +else +ZIPPROG:=$(firstword $(ZIPPROG)) +endif +endif +export ZIPPROG +ifndef TARPROG +TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(TARPROG),) +TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(TARPROG),) +TARPROG= __missing_command_TARPROG +else +TARPROG:=$(firstword $(TARPROG)) +endif +else +TARPROG:=$(firstword $(TARPROG)) +endif +endif +export TARPROG +ASNAME=$(BINUTILSPREFIX)as +LDNAME=$(BINUTILSPREFIX)ld +ARNAME=$(BINUTILSPREFIX)ar +RCNAME=$(BINUTILSPREFIX)rc +NASMNAME=$(BINUTILSPREFIX)nasm +ifndef ASPROG +ifdef CROSSBINDIR +ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT) +else +ASPROG=$(ASNAME) +endif +endif +ifndef LDPROG +ifdef CROSSBINDIR +LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT) +else +LDPROG=$(LDNAME) +endif +endif +ifndef RCPROG +ifdef CROSSBINDIR +RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT) +else +RCPROG=$(RCNAME) +endif +endif +ifndef ARPROG +ifdef CROSSBINDIR +ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT) +else +ARPROG=$(ARNAME) +endif +endif +ifndef NASMPROG +ifdef CROSSBINDIR +NASMPROG=$(CROSSBINDIR)/$(NASMNAME)$(SRCEXEEXT) +else +NASMPROG=$(NASMNAME) +endif +endif +AS=$(ASPROG) +LD=$(LDPROG) +RC=$(RCPROG) +AR=$(ARPROG) +NASM=$(NASMPROG) +ifdef inUnix +PPAS=./ppas$(SRCBATCHEXT) +else +PPAS=ppas$(SRCBATCHEXT) +endif +ifdef inUnix +LDCONFIG=ldconfig +else +LDCONFIG= +endif +ifdef DATE +DATESTR:=$(shell $(DATE) +%Y%m%d) +else +DATESTR= +endif +ZIPOPT=-9 +ZIPEXT=.zip +ifeq ($(USETAR),bz2) +TAROPT=vj +TAREXT=.tar.bz2 +else +TAROPT=vz +TAREXT=.tar.gz +endif +override REQUIRE_PACKAGES=rtl fpmkunit +ifeq ($(FULL_TARGET),i386-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-go32v2) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-win32) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-os2) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-beos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-haiku) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-solaris) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-qnx) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-netware) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-openbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-wdosx) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-emx) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-watcom) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-wince) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-symbian) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-nativent) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-iphonesim) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-android) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i386-aros) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),m68k-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),m68k-amiga) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),m68k-atari) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),m68k-palmos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),m68k-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc-macos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc-wii) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc-aix) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),sparc-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),sparc-solaris) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),sparc-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),x86_64-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),x86_64-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),x86_64-solaris) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),x86_64-openbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),x86_64-win64) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),arm-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),arm-palmos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),arm-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),arm-wince) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),arm-gba) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),arm-nds) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),arm-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),arm-symbian) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),arm-android) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),powerpc64-aix) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),avr-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),armeb-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),armeb-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),mips-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),mipsel-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),mipsel-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),mipsel-android) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),jvm-java) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),jvm-android) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifeq ($(FULL_TARGET),i8086-msdos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif +ifdef REQUIRE_PACKAGES_RTL +PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_RTL),) +ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),) +UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX) +else +UNITDIR_RTL=$(PACKAGEDIR_RTL) +endif +ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_RTL=$(PACKAGEDIR_RTL)/units/$(SOURCESUFFIX) +else +ifneq ($(wildcard $(PACKAGEDIR_RTL)/units_bs/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_RTL=$(PACKAGEDIR_RTL)/units_bs/$(SOURCESUFFIX) +else +UNITDIR_FPMAKE_RTL=$(PACKAGEDIR_RTL) +endif +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_RTL)/$(OS_TARGET)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_RTL)/$(OS_TARGET) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(OS_TARGET)/$(FPCMADE) +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 +ifdef UNITDIR_FPMAKE_RTL +override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_RTL) +endif +endif +ifdef REQUIRE_PACKAGES_PASZLIB +PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_PASZLIB),) +ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/units/$(TARGETSUFFIX)),) +UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/units/$(TARGETSUFFIX) +else +UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB) +endif +ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/units/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_PASZLIB=$(PACKAGEDIR_PASZLIB)/units/$(SOURCESUFFIX) +else +ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/units_bs/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_PASZLIB=$(PACKAGEDIR_PASZLIB)/units_bs/$(SOURCESUFFIX) +else +UNITDIR_FPMAKE_PASZLIB=$(PACKAGEDIR_PASZLIB) +endif +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_PASZLIB)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_PASZLIB) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE) +endif +else +PACKAGEDIR_PASZLIB= +UNITDIR_PASZLIB:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_PASZLIB),) +UNITDIR_PASZLIB:=$(firstword $(UNITDIR_PASZLIB)) +else +UNITDIR_PASZLIB= +endif +endif +ifdef UNITDIR_PASZLIB +override COMPILER_UNITDIR+=$(UNITDIR_PASZLIB) +endif +ifdef UNITDIR_FPMAKE_PASZLIB +override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_PASZLIB) +endif +endif +ifdef REQUIRE_PACKAGES_FCL-PROCESS +PACKAGEDIR_FCL-PROCESS:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl-process/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_FCL-PROCESS),) +ifneq ($(wildcard $(PACKAGEDIR_FCL-PROCESS)/units/$(TARGETSUFFIX)),) +UNITDIR_FCL-PROCESS=$(PACKAGEDIR_FCL-PROCESS)/units/$(TARGETSUFFIX) +else +UNITDIR_FCL-PROCESS=$(PACKAGEDIR_FCL-PROCESS) +endif +ifneq ($(wildcard $(PACKAGEDIR_FCL-PROCESS)/units/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_FCL-PROCESS=$(PACKAGEDIR_FCL-PROCESS)/units/$(SOURCESUFFIX) +else +ifneq ($(wildcard $(PACKAGEDIR_FCL-PROCESS)/units_bs/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_FCL-PROCESS=$(PACKAGEDIR_FCL-PROCESS)/units_bs/$(SOURCESUFFIX) +else +UNITDIR_FPMAKE_FCL-PROCESS=$(PACKAGEDIR_FCL-PROCESS) +endif +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_FCL-PROCESS)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_FCL-PROCESS) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_FCL-PROCESS)/$(FPCMADE) +endif +else +PACKAGEDIR_FCL-PROCESS= +UNITDIR_FCL-PROCESS:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fcl-process/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_FCL-PROCESS),) +UNITDIR_FCL-PROCESS:=$(firstword $(UNITDIR_FCL-PROCESS)) +else +UNITDIR_FCL-PROCESS= +endif +endif +ifdef UNITDIR_FCL-PROCESS +override COMPILER_UNITDIR+=$(UNITDIR_FCL-PROCESS) +endif +ifdef UNITDIR_FPMAKE_FCL-PROCESS +override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_FCL-PROCESS) +endif +endif +ifdef REQUIRE_PACKAGES_HASH +PACKAGEDIR_HASH:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /hash/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_HASH),) +ifneq ($(wildcard $(PACKAGEDIR_HASH)/units/$(TARGETSUFFIX)),) +UNITDIR_HASH=$(PACKAGEDIR_HASH)/units/$(TARGETSUFFIX) +else +UNITDIR_HASH=$(PACKAGEDIR_HASH) +endif +ifneq ($(wildcard $(PACKAGEDIR_HASH)/units/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_HASH=$(PACKAGEDIR_HASH)/units/$(SOURCESUFFIX) +else +ifneq ($(wildcard $(PACKAGEDIR_HASH)/units_bs/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_HASH=$(PACKAGEDIR_HASH)/units_bs/$(SOURCESUFFIX) +else +UNITDIR_FPMAKE_HASH=$(PACKAGEDIR_HASH) +endif +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_HASH)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_HASH) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_HASH)/$(FPCMADE) +endif +else +PACKAGEDIR_HASH= +UNITDIR_HASH:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /hash/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_HASH),) +UNITDIR_HASH:=$(firstword $(UNITDIR_HASH)) +else +UNITDIR_HASH= +endif +endif +ifdef UNITDIR_HASH +override COMPILER_UNITDIR+=$(UNITDIR_HASH) +endif +ifdef UNITDIR_FPMAKE_HASH +override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_HASH) +endif +endif +ifdef REQUIRE_PACKAGES_LIBTAR +PACKAGEDIR_LIBTAR:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /libtar/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_LIBTAR),) +ifneq ($(wildcard $(PACKAGEDIR_LIBTAR)/units/$(TARGETSUFFIX)),) +UNITDIR_LIBTAR=$(PACKAGEDIR_LIBTAR)/units/$(TARGETSUFFIX) +else +UNITDIR_LIBTAR=$(PACKAGEDIR_LIBTAR) +endif +ifneq ($(wildcard $(PACKAGEDIR_LIBTAR)/units/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_LIBTAR=$(PACKAGEDIR_LIBTAR)/units/$(SOURCESUFFIX) +else +ifneq ($(wildcard $(PACKAGEDIR_LIBTAR)/units_bs/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_LIBTAR=$(PACKAGEDIR_LIBTAR)/units_bs/$(SOURCESUFFIX) +else +UNITDIR_FPMAKE_LIBTAR=$(PACKAGEDIR_LIBTAR) +endif +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_LIBTAR)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_LIBTAR) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_LIBTAR)/$(FPCMADE) +endif +else +PACKAGEDIR_LIBTAR= +UNITDIR_LIBTAR:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /libtar/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_LIBTAR),) +UNITDIR_LIBTAR:=$(firstword $(UNITDIR_LIBTAR)) +else +UNITDIR_LIBTAR= +endif +endif +ifdef UNITDIR_LIBTAR +override COMPILER_UNITDIR+=$(UNITDIR_LIBTAR) +endif +ifdef UNITDIR_FPMAKE_LIBTAR +override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_LIBTAR) +endif +endif +ifdef REQUIRE_PACKAGES_FPMKUNIT +PACKAGEDIR_FPMKUNIT:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fpmkunit/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_FPMKUNIT),) +ifneq ($(wildcard $(PACKAGEDIR_FPMKUNIT)/units/$(TARGETSUFFIX)),) +UNITDIR_FPMKUNIT=$(PACKAGEDIR_FPMKUNIT)/units/$(TARGETSUFFIX) +else +UNITDIR_FPMKUNIT=$(PACKAGEDIR_FPMKUNIT) +endif +ifneq ($(wildcard $(PACKAGEDIR_FPMKUNIT)/units/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_FPMKUNIT=$(PACKAGEDIR_FPMKUNIT)/units/$(SOURCESUFFIX) +else +ifneq ($(wildcard $(PACKAGEDIR_FPMKUNIT)/units_bs/$(SOURCESUFFIX)),) +UNITDIR_FPMAKE_FPMKUNIT=$(PACKAGEDIR_FPMKUNIT)/units_bs/$(SOURCESUFFIX) +else +UNITDIR_FPMAKE_FPMKUNIT=$(PACKAGEDIR_FPMKUNIT) +endif +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_FPMKUNIT)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_FPMKUNIT) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_FPMKUNIT)/$(FPCMADE) +endif +else +PACKAGEDIR_FPMKUNIT= +UNITDIR_FPMKUNIT:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fpmkunit/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_FPMKUNIT),) +UNITDIR_FPMKUNIT:=$(firstword $(UNITDIR_FPMKUNIT)) +else +UNITDIR_FPMKUNIT= +endif +endif +ifdef UNITDIR_FPMKUNIT +override COMPILER_UNITDIR+=$(UNITDIR_FPMKUNIT) +endif +ifdef UNITDIR_FPMAKE_FPMKUNIT +override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_FPMKUNIT) +endif +endif +ifndef NOCPUDEF +override FPCOPTDEF=$(ARCH) +endif +ifneq ($(OS_TARGET),$(OS_SOURCE)) +override FPCOPT+=-T$(OS_TARGET) +endif +ifneq ($(CPU_TARGET),$(CPU_SOURCE)) +override FPCOPT+=-P$(ARCH) +endif +ifeq ($(OS_SOURCE),openbsd) +override FPCOPT+=-FD$(NEW_BINUTILS_PATH) +override FPCMAKEOPT+=-FD$(NEW_BINUTILS_PATH) +endif +ifndef CROSSBOOTSTRAP +ifneq ($(BINUTILSPREFIX),) +override FPCOPT+=-XP$(BINUTILSPREFIX) +endif +ifneq ($(BINUTILSPREFIX),) +override FPCOPT+=-Xr$(RLINKPATH) +endif +endif +ifndef CROSSCOMPILE +ifneq ($(BINUTILSPREFIX),) +override FPCMAKEOPT+=-XP$(BINUTILSPREFIX) +endif +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 +ifneq ($(findstring 2.0.,$(FPC_VERSION)),) +ifeq ($(CPU_TARGET),i386) +FPCCPUOPT:=-OG2p3 +endif +ifeq ($(CPU_TARGET),powerpc) +FPCCPUOPT:=-O1r +endif +else +FPCCPUOPT:=-O2 +endif +override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n +override FPCOPTDEF+=RELEASE +endif +ifdef STRIP +override FPCOPT+=-Xs +endif +ifdef OPTIMIZE +override FPCOPT+=-O2 +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 CROSSBINDIR +override FPCOPT+=-FD$(CROSSBINDIR) +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_UNITTARGETDIR)/ +endif +else +ifdef COMPILER_TARGETDIR +override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR) +override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX) +endif +endif +ifdef CREATESHARED +override FPCOPT+=-Cg +endif +ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),) +ifeq ($(CPU_TARGET),x86_64) +override FPCOPT+=-Cg +endif +endif +ifdef LINKSHARED +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 AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) +override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) +ifneq ($(AFULL_TARGET),$(AFULL_SOURCE)) +override ACROSSCOMPILE=1 +endif +ifdef ACROSSCOMPILE +override FPCOPT+=$(CROSSOPT) +endif +override COMPILER:=$(strip $(FPC) $(FPCOPT)) +ifneq (,$(findstring -sh ,$(COMPILER))) +UseEXECPPAS=1 +endif +ifneq (,$(findstring -s ,$(COMPILER))) +ifeq ($(FULL_SOURCE),$(FULL_TARGET)) +UseEXECPPAS=1 +endif +endif +ifneq ($(UseEXECPPAS),1) +EXECPPAS= +else +ifdef RUNBATCH +EXECPPAS:=@$(RUNBATCH) $(PPAS) +else +EXECPPAS:=@$(PPAS) +endif +endif +ifdef TARGET_RSTS +override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS)) +override CLEANRSTFILES+=$(RSTFILES) +endif +.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall +ifdef INSTALL_UNITS +override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS)) +endif +ifdef INSTALL_BUILDUNIT +override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES)) +endif +ifdef INSTALLPPUFILES +override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) +ifneq ($(UNITTARGETDIRPREFIX),) +override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES))) +override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES)))) +endif +override INSTALL_CREATEPACKAGEFPC=1 +endif +ifdef INSTALLEXEFILES +ifneq ($(TARGETDIRPREFIX),) +override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES))) +endif +endif +fpc_install: all $(INSTALLTARGET) +ifdef INSTALLEXEFILES + $(MKDIR) $(INSTALL_BINDIR) + $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR) +endif +ifdef INSTALL_CREATEPACKAGEFPC +ifdef FPCMAKE +ifdef PACKAGE_VERSION +ifneq ($(wildcard Makefile.fpc),) + $(FPCMAKE) -p -T$(CPU_TARGET)-$(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_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=$(PACKAGE_NAME) +endif +endif +ifndef FULLZIPNAME +FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX) +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$(SRCBATCHEXT)) +else +ZIPPATHSEP=/ +endif +ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR)) +ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR)) +ifdef USETAR +ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT) +ZIPCMD_ZIP:=$(TARPROG) c$(TAROPT)f $(ZIPDESTFILE) * +else +ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT) +ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) * +endif +fpc_zipinstall: + $(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1 + $(MKDIR) $(DIST_DESTDIR) + $(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 +ifdef RUNBATCH + $(RUNBATCH) $(ZIPWRAPPER) +else + $(ZIPWRAPPER) +endif +endif + $(DEL) $(ZIPWRAPPER) +else + $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE) +endif + $(DELTREE) $(PACKDIR) +fpc_zipsourceinstall: + $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX) +fpc_zipexampleinstall: +ifdef HASEXAMPLES + $(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX) +endif +fpc_zipdistinstall: + $(MAKE) fpc_zipinstall ZIPTARGET=distinstall +.PHONY: fpc_clean fpc_cleanall fpc_distclean +ifdef EXEFILES +override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES)) +override CLEANEXEDBGFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEDBGFILES)) +endif +ifdef CLEAN_PROGRAMS +override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS))) +override CLEANEXEDBGFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEDBGEXT), $(CLEAN_PROGRAMS))) +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))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) +ifdef DEBUGSYMEXT +override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES)) +endif +override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES)) +override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES))) +endif +fpc_clean: $(CLEANTARGET) +ifdef CLEANEXEFILES + -$(DEL) $(CLEANEXEFILES) +endif +ifdef CLEANEXEDBGFILES + -$(DELTREE) $(CLEANEXEDBGFILES) +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) script.res link.res $(FPCEXTFILE) $(REDIRFILE) + -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT) +fpc_cleanall: $(CLEANTARGET) +ifdef CLEANEXEFILES + -$(DEL) $(CLEANEXEFILES) +endif +ifdef COMPILER_UNITTARGETDIR +ifdef CLEANPPUFILES + -$(DEL) $(CLEANPPUFILES) +endif +ifneq ($(CLEANPPULINKFILES),) + -$(DEL) $(CLEANPPULINKFILES) +endif +ifdef CLEANRSTFILES + -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES)) +endif +endif +ifdef CLEAN_FILES + -$(DEL) $(CLEAN_FILES) +endif + -$(DELTREE) units + -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT) +ifneq ($(PPUEXT),.ppu) + -$(DEL) *.o *.ppu *.a +endif + -$(DELTREE) *$(SMARTEXT) + -$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE) + -$(DEL) *_ppas$(BATCHEXT) +ifdef AOUTEXT + -$(DEL) *$(AOUTEXT) +endif +ifdef DEBUGSYMEXT + -$(DEL) *$(DEBUGSYMEXT) +endif +fpc_distclean: cleanall +.PHONY: fpc_baseinfo +override INFORULES+=fpc_baseinfo +fpc_baseinfo: + @$(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) Full Source.. $(FULL_SOURCE) + @$(ECHO) Full Target.. $(FULL_TARGET) + @$(ECHO) SourceSuffix. $(SOURCESUFFIX) + @$(ECHO) TargetSuffix. $(TARGETSUFFIX) + @$(ECHO) FPC fpmake... $(FPCFPMAKE) + @$(ECHO) + @$(ECHO) == Directory info == + @$(ECHO) + @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES) + @$(ECHO) + @$(ECHO) Basedir......... $(BASEDIR) + @$(ECHO) FPCDir.......... $(FPCDIR) + @$(ECHO) CrossBinDir..... $(CROSSBINDIR) + @$(ECHO) UnitsDir........ $(UNITSDIR) + @$(ECHO) PackagesDir..... $(PACKAGESDIR) + @$(ECHO) + @$(ECHO) GCC library..... $(GCCLIBDIR) + @$(ECHO) Other library... $(OTHERLIBDIR) + @$(ECHO) + @$(ECHO) == Tools info == + @$(ECHO) + @$(ECHO) As........ $(AS) + @$(ECHO) Ld........ $(LD) + @$(ECHO) Ar........ $(AR) + @$(ECHO) Rc........ $(RC) + @$(ECHO) + @$(ECHO) Mv........ $(MVPROG) + @$(ECHO) Cp........ $(CPPROG) + @$(ECHO) Rm........ $(RMPROG) + @$(ECHO) GInstall.. $(GINSTALL) + @$(ECHO) Echo...... $(ECHO) + @$(ECHO) Shell..... $(SHELL) + @$(ECHO) Date...... $(DATE) + @$(ECHO) FPCMake... $(FPCMAKE) + @$(ECHO) PPUMove... $(PPUMOVE) + @$(ECHO) Zip....... $(ZIPPROG) + @$(ECHO) + @$(ECHO) == Object info == + @$(ECHO) + @$(ECHO) Target Loaders........ $(TARGET_LOADERS) + @$(ECHO) Target Units.......... $(TARGET_UNITS) + @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS) + @$(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) ZipName.............. $(ZIPNAME) + @$(ECHO) ZipPrefix............ $(ZIPPREFIX) + @$(ECHO) ZipCrossPrefix....... $(ZIPCROSSPREFIX) + @$(ECHO) ZipSuffix............ $(ZIPSUFFIX) + @$(ECHO) FullZipName.......... $(FULLZIPNAME) + @$(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) +.PHONY: fpc_info +fpc_info: $(INFORULES) +.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \ + fpc_makefile_dirs +fpc_makefile: + $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc +fpc_makefile_sub1: +ifdef TARGET_DIRS + $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS)) +endif +ifdef TARGET_EXAMPLEDIRS + $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS)) +endif +fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS)) +fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2 +fpc_makefiles: fpc_makefile fpc_makefile_dirs +units: +examples: +shared: +sourceinstall: fpc_sourceinstall +exampleinstall: fpc_exampleinstall +zipexampleinstall: fpc_zipexampleinstall +info: fpc_info +makefiles: fpc_makefiles +.PHONY: units examples shared sourceinstall exampleinstall zipexampleinstall info makefiles +ifneq ($(wildcard fpcmake.loc),) +include fpcmake.loc +endif +override FPCOPT:=$(filter-out -FU%,$(FPCOPT)) +override FPCOPT:=$(filter-out -FE%,$(FPCOPT)) +ifdef FPMAKEOPT +FPMAKE_OPT+=$(FPMAKEOPT) +endif +FPMAKE_OPT+=--localunitdir=../.. +FPMAKE_OPT+=--globalunitdir=.. +FPMAKE_OPT+=$(FPC_TARGETOPT) +FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT)) +FPMAKE_OPT+=--compiler=$(FPC) +FPMAKE_OPT+=-bu +.NOTPARALLEL: +fpmake$(SRCEXEEXT): fpmake.pp + $(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT) +all: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) compile $(FPMAKE_OPT) +smart: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX +release: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE +debug: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG +ifeq ($(FPMAKE_BIN_CLEAN),) +clean: +else +clean: + $(FPMAKE_BIN_CLEAN) clean $(FPMAKE_OPT) +endif +ifeq ($(FPMAKE_BIN_CLEAN),) +distclean: $(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall +else +distclean: +ifdef inUnix + { $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT); if [ $$? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; $(DEL) $(FPMAKE_BIN_CLEAN); $(MAKE) fpc_cleanall; }; fi; } +else + $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT) +endif + -$(DEL) $(LOCALFPMAKE) +endif +cleanall: distclean +install: fpmake$(SRCEXEEXT) +ifdef UNIXHier + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) +else + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) +endif +distinstall: fpmake$(SRCEXEEXT) +ifdef UNIXHier + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0 +else + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0 +endif +zipinstall: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) +zipdistinstall: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie -fsp 0 +zipsourceinstall: fpmake$(SRCEXEEXT) +ifdef UNIXHier + $(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=share/src/fpc-\$$\(PACKAGEVERSION\)/$(INSTALL_FPCSUBDIR)/\$$\(PACKAGEDIRECTORY\) +else + $(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=source\\$(INSTALL_FPCSUBDIR)\\\$$\(PACKAGEDIRECTORY\) +endif diff --git a/packages/morphunits/Makefile.fpc b/packages/morphunits/Makefile.fpc new file mode 100644 index 0000000000..1bd179aa13 --- /dev/null +++ b/packages/morphunits/Makefile.fpc @@ -0,0 +1,100 @@ +# +# Makefile.fpc for running fpmake +# + +[package] +name=morphunits +version=3.1.1 + +[require] +packages=rtl fpmkunit + +[install] +fpcpackage=y + +[default] +fpcdir=../.. + +[prerules] +FPMAKE_BIN_CLEAN=$(wildcard ./fpmake$(SRCEXEEXT)) +ifdef OS_TARGET +FPC_TARGETOPT+=--os=$(OS_TARGET) +endif +ifdef CPU_TARGET +FPC_TARGETOPT+=--cpu=$(CPU_TARGET) +endif +LOCALFPMAKE=./fpmake$(SRCEXEEXT) + +[rules] +# Do not pass the Makefile's unit and binary target locations. fpmake uses it's own. +override FPCOPT:=$(filter-out -FU%,$(FPCOPT)) +override FPCOPT:=$(filter-out -FE%,$(FPCOPT)) +# Compose general fpmake-parameters +ifdef FPMAKEOPT +FPMAKE_OPT+=$(FPMAKEOPT) +endif +FPMAKE_OPT+=--localunitdir=../.. +FPMAKE_OPT+=--globalunitdir=.. +FPMAKE_OPT+=$(FPC_TARGETOPT) +FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT)) +FPMAKE_OPT+=--compiler=$(FPC) +FPMAKE_OPT+=-bu +.NOTPARALLEL: + +fpmake$(SRCEXEEXT): fpmake.pp + $(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT) +all: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) compile $(FPMAKE_OPT) +smart: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX +release: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE +debug: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG +# If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will +# most often fail because the dependencies are cleared. +# In case of a clean, simply do nothing +ifeq ($(FPMAKE_BIN_CLEAN),) +clean: +else +clean: + $(FPMAKE_BIN_CLEAN) clean $(FPMAKE_OPT) +endif +# In case of a distclean, perform an 'old'-style distclean. This to avoid problems +# when the package is compiled using fpcmake prior to running this clean using fpmake +ifeq ($(FPMAKE_BIN_CLEAN),) +distclean: $(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall +else +distclean: +ifdef inUnix + { $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT); if [ $$? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; $(DEL) $(FPMAKE_BIN_CLEAN); $(MAKE) fpc_cleanall; }; fi; } +else + $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT) +endif + -$(DEL) $(LOCALFPMAKE) +endif +cleanall: distclean +install: fpmake$(SRCEXEEXT) +ifdef UNIXHier + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) +else + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) +endif +# distinstall also installs the example-sources and omits the location of the source- +# files from the fpunits.cfg files. +distinstall: fpmake$(SRCEXEEXT) +ifdef UNIXHier + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0 +else + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0 +endif +zipinstall: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) +zipdistinstall: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie -fsp 0 +zipsourceinstall: fpmake$(SRCEXEEXT) +ifdef UNIXHier + $(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=share/src/fpc-\$$\(PACKAGEVERSION\)/$(INSTALL_FPCSUBDIR)/\$$\(PACKAGEDIRECTORY\) +else + $(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=source\\$(INSTALL_FPCSUBDIR)\\\$$\(PACKAGEDIRECTORY\) +endif diff --git a/packages/morphunits/Makefile.fpc.fpcmake b/packages/morphunits/Makefile.fpc.fpcmake new file mode 100644 index 0000000000..62a9cc4c4d --- /dev/null +++ b/packages/morphunits/Makefile.fpc.fpcmake @@ -0,0 +1,25 @@ +# +# Makefile.fpc for Free Pascal MorphOS units Bindings +# + +[package] +name=morphunits +version=3.1.1 + +[target] +units= aboxlib agraphics ahi amigados asl clipboard datatypes exec get9 \ + hardware inputevent intuition keymap kvm layers mui muihelper timer \ + tinygl utility iffparse + +[compiler] +includedir=src +sourcedir=src + +[install] +fpcpackage=y + +[default] +fpcdir=../.. + +[rules] +.NOTPARALLEL: diff --git a/packages/morphunits/fpmake.pp b/packages/morphunits/fpmake.pp new file mode 100644 index 0000000000..00323d3e20 --- /dev/null +++ b/packages/morphunits/fpmake.pp @@ -0,0 +1,60 @@ +{$ifndef ALLPACKAGES} +{$mode objfpc}{$H+} +program fpmake; + +uses fpmkunit; + +Var + P : TPackage; + T : TTarget; +begin + With Installer do + begin +{$endif ALLPACKAGES} + + P:=AddPackage('morphunits'); +{$ifdef ALLPACKAGES} + P.Directory:=ADirectory; +{$endif ALLPACKAGES} + P.Version:='3.1.1'; + + P.Author := 'Karoly Balogh'; + P.License := 'LGPL with modification'; + P.HomepageURL := 'www.freepascal.org'; + P.Email := ''; + P.Description := 'A set of units for MorphOS. PowerPC only'; + P.NeedLibC:= false; + + P.CPUs:=[powerpc]; + P.OSes:=[MorphOS]; + + P.SourcePath.Add('src'); + P.IncludePath.Add('src'); + + T:=P.Targets.AddUnit('exec.pas'); + T:=P.Targets.AddUnit('timer.pas'); + T:=P.Targets.AddUnit('utility.pas'); + T:=P.Targets.AddUnit('intuition.pas'); + T:=P.Targets.AddUnit('agraphics.pas'); + T:=P.Targets.AddUnit('amigalib.pas'); + T:=P.Targets.AddUnit('hardware.pas'); + T:=P.Targets.AddUnit('amigados.pas'); + T:=P.Targets.AddUnit('clipboard.pas'); + T:=P.Targets.AddUnit('iffparse.pas'); + T:=P.Targets.AddUnit('datatypes.pas'); + T:=P.Targets.AddUnit('keymap.pas'); + T:=P.Targets.AddUnit('asl.pas'); + T:=P.Targets.AddUnit('layers.pas'); + T:=P.Targets.AddUnit('inputevent.pas'); + T:=P.Targets.AddUnit('mui.pas'); + T:=P.Targets.AddUnit('muihelper.pas'); + T:=P.Targets.AddUnit('ahi.pas'); + T:=P.Targets.AddUnit('kvm.pas'); + T:=P.Targets.AddUnit('get9.pas'); + T:=P.Targets.AddUnit('tinygl.pas'); + +{$ifndef ALLPACKAGES} + Run; + end; +end. +{$endif ALLPACKAGES} diff --git a/packages/morphunits/src/agraphics.pas b/packages/morphunits/src/agraphics.pas new file mode 100644 index 0000000000..69cfb6d461 --- /dev/null +++ b/packages/morphunits/src/agraphics.pas @@ -0,0 +1,2836 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + graphics.library interface unit for MorphOS/PowerPC + + Based on work of Nils Sjoholm member of the Amiga RTL + development team. + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} +{$PACKRECORDS 2} + +unit agraphics; + +interface + +uses exec, hardware, utility; + +const + BITSET = $8000; + BITCLR = 0; + +type + pRectangle = ^tRectangle; + tRectangle = record + MinX,MinY : Word; + MaxX,MaxY : Word; + end; + + pRect32 = ^tRect32; + tRect32 = record + MinX,MinY : Longint; + MaxX,MaxY : Longint; + end; + + pPoint = ^tPoint; + tPoint = record + x,y : Word; + end; + + PLANEPTR = Pointer; + + pBitMap = ^tBitMap; + tBitMap = record + BytesPerRow : Word; + Rows : Word; + Flags : Byte; + Depth : Byte; + pad : Word; + Planes : Array [0..7] of PLANEPTR; + end; +{* flags for AllocBitMap, etc. *} +const + BMB_CLEAR = 0; + BMB_DISPLAYABLE = 1; + BMB_INTERLEAVED = 2; + BMB_STANDARD = 3; + BMB_MINPLANES = 4; + + BMF_CLEAR = (1 shl BMB_CLEAR); + BMF_DISPLAYABLE = (1 shl BMB_DISPLAYABLE); + BMF_INTERLEAVED = (1 shl BMB_INTERLEAVED); + BMF_STANDARD = (1 shl BMB_STANDARD); + BMF_MINPLANES = (1 shl BMB_MINPLANES); + +{* the following are for GetBitMapAttr() *} + BMA_HEIGHT = 0; + BMA_DEPTH = 4; + BMA_WIDTH = 8; + BMA_FLAGS = 12; + + +{ structures used by and constructed by windowlib.a } +{ understood by rom software } +type + pClipRect = ^tClipRect; + tClipRect = record + Next : pClipRect; { roms used to find next ClipRect } + prev : pClipRect; { ignored by roms, used by windowlib } + lobs : Pointer; { ignored by roms, used by windowlib (LayerPtr)} + BitMap : pBitMap; + bounds : tRectangle; { set up by windowlib, used by roms } + _p1, + _p2 : Pointer; { system reserved } + reserved : Longint; { system use } + Flags : Longint; { only exists in layer allocation } + end; + + pLayer = ^tLayer; + tLayer = record + front, + back : pLayer; { ignored by roms } + ClipRect : pClipRect; { read by roms to find first cliprect } + rp : Pointer; { (RastPortPtr) ignored by roms, I hope } + bounds : tRectangle; { ignored by roms } + reserved : Array [0..3] of Byte; + priority : Word; { system use only } + Flags : Word; { obscured ?, Virtual BitMap? } + SuperBitMap : pBitMap; + SuperClipRect : pClipRect; { super bitmap cliprects if + VBitMap != 0} + { else damage cliprect list for refresh } + Window : Pointer; { reserved for user interface use } + Scroll_X, + Scroll_Y : Word; + cr, + cr2, + crnew : pClipRect; { used by dedice } + SuperSaveClipRects : pClipRect; { preallocated cr's } + cliprects : pClipRect; { system use during refresh } + LayerInfo : Pointer; { points to head of the list } + Lock : tSignalSemaphore; + BackFill : pHook; + reserved1 : Cardinal; + ClipRegion : Pointer; + saveClipRects : Pointer; { used to back out when in trouble} + Width, + Height : smallint; + reserved2 : Array [0..17] of Byte; + { this must stay here } + DamageList : Pointer; { list of rectangles to refresh + through } + end; + +const + +{ internal cliprect flags } + + CR_NEEDS_NO_CONCEALED_RASTERS = 1; + CR_NEEDS_NO_LAYERBLIT_DAMAGE = 2; + + +{ defines for code values for getcode } + + ISLESSX = 1; + ISLESSY = 2; + ISGRTRX = 4; + ISGRTRY = 8; + + +{------ Font Styles ------------------------------------------------} + + FS_NORMAL = 0; { normal text (no style bits set) } + FSB_EXTENDED = 3; { extended face (wider than normal) } + FSF_EXTENDED = 8; + FSB_ITALIC = 2; { italic (slanted 1:2 right) } + FSF_ITALIC = 4; + FSB_BOLD = 1; { bold face text (ORed w/ shifted) } + FSF_BOLD = 2; + FSB_UNDERLINED = 0; { underlined (under baseline) } + FSF_UNDERLINED = 1; + + FSB_COLORFONT = 6; { this uses ColorTextFont structure } + FSF_COLORFONT = $40; + FSB_TAGGED = 7; { the TextAttr is really an TTextAttr, } + FSF_TAGGED = $80; + + +{------ Font Flags -------------------------------------------------} + FPB_ROMFONT = 0; { font is in rom } + FPF_ROMFONT = 1; + FPB_DISKFONT = 1; { font is from diskfont.library } + FPF_DISKFONT = 2; + FPB_REVPATH = 2; { designed path is reversed (e.g. left) } + FPF_REVPATH = 4; + FPB_TALLDOT = 3; { designed for hires non-interlaced } + FPF_TALLDOT = 8; + FPB_WIDEDOT = 4; { designed for lores interlaced } + FPF_WIDEDOT = 16; + FPB_PROPORTIONAL = 5; { character sizes can vary from nominal } + FPF_PROPORTIONAL = 32; + FPB_DESIGNED = 6; { size is "designed", not constructed } + FPF_DESIGNED = 64; + FPB_REMOVED = 7; { the font has been removed } + FPF_REMOVED = 128; + +{***** TextAttr node, matches text attributes in RastPort *********} + +type + + pTextAttr = ^tTextAttr; + tTextAttr = record + ta_Name : PChar; { name of the font } + ta_YSize : Word; { height of the font } + ta_Style : Byte; { intrinsic font style } + ta_Flags : Byte; { font preferences and flags } + end; + + pTTextAttr = ^tTTextAttr; + tTTextAttr = record + tta_Name : PChar; { name of the font } + tta_YSize : Word; { height of the font } + tta_Style : Byte; { intrinsic font style } + tta_Flags : Byte; { font preferences AND flags } + tta_Tags : pTagItem; { extended attributes } + end; + +{***** Text Tags **************************************************} +CONST + TA_DeviceDPI = (1+TAG_USER); { Tag value is Point union: } + { Hi Longint XDPI, Lo Longint YDPI } + + MAXFONTMATCHWEIGHT = 32767; { perfect match from WeighTAMatch } + + + +{***** TextFonts node *********************************************} +Type + + pTextFont = ^tTextFont; + tTextFont = record + tf_Message : tMessage; { reply message for font removal } + { font name in LN \ used in this } + tf_YSize : Word; { font height | order to best } + tf_Style : Byte; { font style | match a font } + tf_Flags : Byte; { preferences and flags / request. } + tf_XSize : Word; { nominal font width } + tf_Baseline : Word; { distance from the top of char to baseline } + tf_BoldSmear : Word; { smear to affect a bold enhancement } + + tf_Accessors : Word; { access count } + + tf_LoChar : Byte; { the first character described here } + tf_HiChar : Byte; { the last character described here } + tf_CharData : Pointer; { the bit character data } + + tf_Modulo : Word; { the row modulo for the strike font data } + tf_CharLoc : Pointer; { ptr to location data for the strike font } + { 2 words: bit offset then size } + tf_CharSpace : Pointer; { ptr to words of proportional spacing data } + tf_CharKern : Pointer; { ptr to words of kerning data } + end; + + +{----- tfe_Flags0 (partial definition) ----------------------------} +CONST + TE0B_NOREMFONT = 0; { disallow RemFont for this font } + TE0F_NOREMFONT = $01; + +Type + + pTextFontExtension = ^tTextFontExtension; + tTextFontExtension = record { this structure is read-only } + tfe_MatchWord : Word; { a magic cookie for the extension } + tfe_Flags0 : Byte; { (system private flags) } + tfe_Flags1 : Byte; { (system private flags) } + tfe_BackPtr : pTextFont; { validation of compilation } + tfe_OrigReplyPort : pMsgPort; { original value in tf_Extension } + tfe_Tags : pTagItem; { Text Tags for the font } + tfe_OFontPatchS, { (system private use) } + tfe_OFontPatchK : Pointer; { (system private use) } + { this space is reserved for future expansion } + END; + +{***** ColorTextFont node *****************************************} +{----- ctf_Flags --------------------------------------------------} +CONST + CT_COLORMASK = $000F; { mask to get to following color styles } + CT_COLORFONT = $0001; { color map contains designer's colors } + CT_GREYFONT = $0002; { color map describes even-stepped } + { brightnesses from low to high } + CT_ANTIALIAS = $0004; { zero background thru fully saturated char } + + CTB_MAPCOLOR = 0; { map ctf_FgColor to the rp_FgPen IF it's } + CTF_MAPCOLOR = $0001; { is a valid color within ctf_Low..ctf_High } + +{----- ColorFontColors --------------------------------------------} +Type + pColorFontColors = ^tColorFontColors; + tColorFontColors = record + cfc_Reserved, { *must* be zero } + cfc_Count : Word; { number of entries in cfc_ColorTable } + cfc_ColorTable : Pointer; { 4 bit per component color map packed xRGB } + END; + +{----- ColorTextFont ----------------------------------------------} + + pColorTextFont = ^tColorTextFont; + tColorTextFont = record + ctf_TF : tTextFont; + ctf_Flags : Word; { extended flags } + ctf_Depth, { number of bit planes } + ctf_FgColor, { color that is remapped to FgPen } + ctf_Low, { lowest color represented here } + ctf_High, { highest color represented here } + ctf_PlanePick, { PlanePick ala Images } + ctf_PlaneOnOff : Byte; { PlaneOnOff ala Images } + ctf_ColorFontColors : pColorFontColors; { colors for font } + ctf_CharData : Array[0..7] of Pointer; {pointers to bit planes ala tf_CharData } + END; + +{***** TextExtent node ********************************************} + + pTextExtent = ^tTextExtent; + tTextExtent = record + te_Width, { same as TextLength } + te_Height : Word; { same as tf_YSize } + te_Extent : tRectangle; { relative to CP } + END; + + +const + + COPPER_MOVE = 0; { pseude opcode for move #XXXX,dir } + COPPER_WAIT = 1; { pseudo opcode for wait y,x } + CPRNXTBUF = 2; { continue processing with next buffer } + CPR_NT_LOF = $8000; { copper instruction only for Longint frames } + CPR_NT_SHT = $4000; { copper instruction only for long frames } + CPR_NT_SYS = $2000; { copper user instruction only } +type + +{ Note: The combination VWaitAddr and HWaitAddr replace a three way + union in C. The three possibilities are: + + nxtList : CopListPtr; or + + VWaitPos : Longint; + HWaitPos : Longint; or + + DestAddr : Longint; + DestData : Longint; +} + + pCopIns = ^tCopIns; + tCopIns = record + OpCode : smallint; { 0 = move, 1 = wait } + VWaitAddr : smallint; { vertical or horizontal wait position } + HWaitData : smallint; { destination Pointer or data to send } + end; + +{ structure of cprlist that points to list that hardware actually executes } + + pcprlist = ^tcprlist; + tcprlist = record + Next : pcprlist; + start : psmallint; { start of copper list } + MaxCount : smallint; { number of long instructions } + end; + + pCopList = ^tCopList; + tCopList = record + Next : pCopList; { next block for this copper list } + CopList : pCopList; { system use } + ViewPort : Pointer; { system use } + CopIns : pCopIns; { start of this block } + CopPtr : pCopIns; { intermediate ptr } + CopLStart : psmallint; { mrgcop fills this in for Long Frame} + CopSStart : psmallint; { mrgcop fills this in for Longint Frame} + Count : smallint; { intermediate counter } + MaxCount : smallint; { max # of copins for this block } + DyOffset : smallint; { offset this copper list vertical waits } + SLRepeat : Word; + Flags : Word; + end; + + pUCopList = ^tUCopList; + tUCopList = record + Next : pUCopList; + FirstCopList : pCopList; { head node of this copper list } + CopList : pCopList; { node in use } + end; + + pcopinit = ^tcopinit; + tcopinit = record + vsync_hblank : array [0..1] of word; + diagstrt : Array [0..11] of word; + fm0 : array [0..1] of word; + diwstart : array [0..9] of word; + bplcon2 : array [0..1] of word; + sprfix : array [0..(2*8)] of word; + sprstrtup : Array [0..(2*8*2)] of Word; + wait14 : array [0..1] of word; + norm_hblank : array [0..1] of word; + jump : array [0..1] of word; + wait_forever : array [0..5] of word; + sprstop : Array [0..7] of Word; + end; + + + + pAreaInfo = ^tAreaInfo; + tAreaInfo = record + VctrTbl : Pointer; { ptr to start of vector table } + VctrPtr : Pointer; { ptr to current vertex } + FlagTbl : Pointer; { ptr to start of vector flag table } + FlagPtr : Pointer; { ptrs to areafill flags } + Count : smallint; { number of vertices in list } + MaxCount : smallint; { AreaMove/Draw will not allow Count>MaxCount} + FirstX, + FirstY : smallint; { first point for this polygon } + end; + + pTmpRas = ^tTmpRas; + tTmpRas = record + RasPtr : Pointer; + Size : Longint; + end; + +{ unoptimized for 32bit alignment of pointers } + + pGelsInfo = ^tGelsInfo; + tGelsInfo = record + sprRsrvd : Shortint; { flag of which sprites to reserve from + vsprite system } + Flags : Byte; { system use } + gelHead, + gelTail : Pointer; { (VSpritePtr) dummy vSprites for list management} + + { pointer to array of 8 WORDS for sprite available lines } + + nextLine : Pointer; + + { pointer to array of 8 pointers for color-last-assigned to vSprites } + + lastColor : Pointer; + collHandler : Pointer; { (collTablePtr) Pointeres of collision routines } + leftmost, + rightmost, + topmost, + bottommost : smallint; + firstBlissObj, + lastBlissObj : Pointer; { system use only } + end; + + pRastPort = ^tRastPort; + tRastPort = record + Layer : pLayer; { LayerPtr } + BitMap : pBitMap; { BitMapPtr } + ArePointern : Pointer; { ptr to areafill pattern } + TmpRas : pTmpRas; + AreaInfo : pAreaInfo; + GelsInfo : pGelsInfo; + Mask : Byte; { write mask for this raster } + FgPen : Shortint; { foreground pen for this raster } + BgPen : Shortint; { background pen } + AOlPen : Shortint; { areafill outline pen } + DrawMode : Shortint; { drawing mode for fill, lines, and text } + AreaPtSz : Shortint; { 2^n words for areafill pattern } + linpatcnt : Shortint; { current line drawing pattern preshift } + dummy : Shortint; + Flags : Word; { miscellaneous control bits } + LinePtrn : Word; { 16 bits for textured lines } + cp_x, + cp_y : smallint; { current pen position } + minterms : Array [0..7] of Byte; + PenWidth : smallint; + PenHeight : smallint; + Font : pTextFont; { (TextFontPtr) current font Pointer } + AlgoStyle : Byte; { the algorithmically generated style } + TxFlags : Byte; { text specific flags } + TxHeight : Word; { text height } + TxWidth : Word; { text nominal width } + TxBaseline : Word; { text baseline } + TxSpacing : smallint; { text spacing (per character) } + RP_User : Pointer; + longreserved : Array [0..1] of Cardinal; + wordreserved : Array [0..6] of Word; { used to be a node } + reserved : Array [0..7] of Byte; { for future use } + end; + +const + +{ drawing modes } + + JAM1 = 0; { jam 1 color into raster } + JAM2 = 1; { jam 2 colors into raster } + COMPLEMENT = 2; { XOR bits into raster } + INVERSVID = 4; { inverse video for drawing modes } + +{ these are the flag bits for RastPort flags } + + FRST_DOT = $01; { draw the first dot of this line ? } + ONE_DOT = $02; { use one dot mode for drawing lines } + DBUFFER = $04; { flag set when RastPorts are double-buffered } + + { only used for bobs } + + AREAOUTLINE = $08; { used by areafiller } + NOCROSSFILL = $20; { areafills have no crossovers } + +{ there is only one style of clipping: raster clipping } +{ this preserves the continuity of jaggies regardless of clip window } +{ When drawing into a RastPort, if the ptr to ClipRect is nil then there } +{ is no clipping done, this is dangerous but useful for speed } + + +Const + CleanUp = $40; + CleanMe = CleanUp; + + BltClearWait = 1; { Waits for blit to finish } + BltClearXY = 2; { Use Row/Bytes per row method } + + { Useful minterms } + + StraightCopy = $C0; { Vanilla copy } + InvertAndCopy = $30; { Invert the source before copy } + InvertDest = $50; { Forget source, invert dest } + + + { mode coercion definitions } + +const +{ These flags are passed (in combination) to CoerceMode() to determine the + * type of coercion required. + } + +{ Ensure that the mode coerced to can display just as many colours as the + * ViewPort being coerced. + } + PRESERVE_COLORS = 1; + +{ Ensure that the mode coerced to is not interlaced. } + AVOID_FLICKER = 2; + +{ Coercion should ignore monitor compatibility issues. } + IGNORE_MCOMPAT = 4; + + + BIDTAG_COERCE = 1; { Private } + +const + +{ VSprite flags } +{ user-set VSprite flags: } + + SUSERFLAGS = $00FF; { mask of all user-settable VSprite-flags } + VSPRITE_f = $0001; { set if VSprite, clear if Bob } + { VSPRITE had to be changed for name conflict } + SAVEBACK = $0002; { set if background is to be saved/restored } + OVERLAY = $0004; { set to mask image of Bob onto background } + MUSTDRAW = $0008; { set if VSprite absolutely must be drawn } + +{ system-set VSprite flags: } + + BACKSAVED = $0100; { this Bob's background has been saved } + BOBUPDATE = $0200; { temporary flag, useless to outside world } + GELGONE = $0400; { set if gel is completely clipped (offscreen) } + VSOVERFLOW = $0800; { VSprite overflow (if MUSTDRAW set we draw!) } + +{ Bob flags } +{ these are the user flag bits } + + BUSERFLAGS = $00FF; { mask of all user-settable Bob-flags } + SAVEBOB = $0001; { set to not erase Bob } + BOBISCOMP = $0002; { set to identify Bob as AnimComp } + +{ these are the system flag bits } + + BWAITING = $0100; { set while Bob is waiting on 'after' } + BDRAWN = $0200; { set when Bob is drawn this DrawG pass} + BOBSAWAY = $0400; { set to initiate removal of Bob } + BOBNIX = $0800; { set when Bob is completely removed } + SAVEPRESERVE = $1000; { for back-restore during double-buffer} + OUTSTEP = $2000; { for double-clearing if double-buffer } + +{ defines for the animation procedures } + + ANFRACSIZE = 6; + ANIMHALF = $0020; + RINGTRIGGER = $0001; + + +{ UserStuff definitions + * the user can define these to be a single variable or a sub-structure + * if undefined by the user, the system turns these into innocuous variables + * see the manual for a thorough definition of the UserStuff definitions + * + } + +type + + VUserStuff = smallint; { Sprite user stuff } + BUserStuff = smallint; { Bob user stuff } + AUserStuff = smallint; { AnimOb user stuff } + +{********************** GEL STRUCTURES **********************************} + + pVSprite = ^tVSprite; + tVSprite = record + +{ --------------------- SYSTEM VARIABLES ------------------------------- } +{ GEL linked list forward/backward pointers sorted by y,x value } + + NextVSprite : pVSprite; + PrevVSprite : pVSprite; + +{ GEL draw list constructed in the order the Bobs are actually drawn, then + * list is copied to clear list + * must be here in VSprite for system boundary detection + } + + DrawPath : pVSprite; { pointer of overlay drawing } + ClearPath : pVSprite; { pointer for overlay clearing } + +{ the VSprite positions are defined in (y,x) order to make sorting + * sorting easier, since (y,x) as a long Longint + } + + OldY, OldX : smallint; { previous position } + +{ --------------------- COMMON VARIABLES --------------------------------- } + + Flags : smallint; { VSprite flags } + + +{ --------------------- USER VARIABLES ----------------------------------- } +{ the VSprite positions are defined in (y,x) order to make sorting + * sorting easier, since (y,x) as a long Longint + } + + Y, X : smallint; { screen position } + + Height : smallint; + Width : smallint; { number of words per row of image data } + Depth : smallint; { number of planes of data } + + MeMask : smallint; { which types can collide with this VSprite} + HitMask : smallint; { which types this VSprite can collide with} + + ImageData : Pointer; { pointer to VSprite image } + +{ borderLine is the one-dimensional logical OR of all + * the VSprite bits, used for fast collision detection of edge + } + + BorderLine : Pointer; { logical OR of all VSprite bits } + CollMask : Pointer; { similar to above except this is a matrix } + +{ pointer to this VSprite's color definitions (not used by Bobs) } + + SprColors : Pointer; + + VSBob : Pointer; { (BobPtr) points home if this VSprite + is part of a Bob } + +{ planePick flag: set bit selects a plane from image, clear bit selects + * use of shadow mask for that plane + * OnOff flag: if using shadow mask to fill plane, this bit (corresponding + * to bit in planePick) describes whether to fill with 0's or 1's + * There are two uses for these flags: + * - if this is the VSprite of a Bob, these flags describe how the Bob + * is to be drawn into memory + * - if this is a simple VSprite and the user intends on setting the + * MUSTDRAW flag of the VSprite, these flags must be set too to describe + * which color registers the user wants for the image + } + + PlanePick : Shortint; + PlaneOnOff : Shortint; + + VUserExt : VUserStuff; { user definable: see note above } + end; + + + + +{ dBufPacket defines the values needed to be saved across buffer to buffer + * when in double-buffer mode + } + + pDBufPacket = ^tDBufPacket; + tDBufPacket = record + BufY, + BufX : Word; { save other buffers screen coordinates } + BufPath : pVSprite; { carry the draw path over the gap } + +{ these pointers must be filled in by the user } +{ pointer to other buffer's background save buffer } + + BufBuffer : Pointer; + end; + + + + + + pBob = ^tBob; + tBob = record +{ blitter-objects } + +{ --------------------- SYSTEM VARIABLES --------------------------------- } + +{ --------------------- COMMON VARIABLES --------------------------------- } + + Flags : smallint; { general purpose flags (see definitions below) } + +{ --------------------- USER VARIABLES ----------------------------------- } + + SaveBuffer : Pointer; { pointer to the buffer for background save } + +{ used by Bobs for "cookie-cutting" and multi-plane masking } + + ImageShadow : Pointer; + +{ pointer to BOBs for sequenced drawing of Bobs + * for correct overlaying of multiple component animations + } + Before : pBob; { draw this Bob before Bob pointed to by before } + After : pBob; { draw this Bob after Bob pointed to by after } + + BobVSprite : pVSprite; { this Bob's VSprite definition } + + BobComp : Pointer; { (AnimCompPtr) pointer to this Bob's AnimComp def } + + DBuffer : Pointer; { pointer to this Bob's dBuf packet } + + BUserExt : BUserStuff; { Bob user extension } + end; + + pAnimComp = ^tAnimComp; + tAnimComp = record + +{ --------------------- SYSTEM VARIABLES --------------------------------- } + +{ --------------------- COMMON VARIABLES --------------------------------- } + + Flags : smallint; { AnimComp flags for system & user } + +{ timer defines how long to keep this component active: + * if set non-zero, timer decrements to zero then switches to nextSeq + * if set to zero, AnimComp never switches + } + + Timer : smallint; + +{ --------------------- USER VARIABLES ----------------------------------- } +{ initial value for timer when the AnimComp is activated by the system } + + TimeSet : smallint; + +{ pointer to next and previous components of animation object } + + NextComp : pAnimComp; + PrevComp : pAnimComp; + +{ pointer to component component definition of next image in sequence } + + NextSeq : pAnimComp; + PrevSeq : pAnimComp; + + AnimCRoutine : Pointer; { Pointer of special animation procedure } + + YTrans : smallint; { initial y translation (if this is a component) } + XTrans : smallint; { initial x translation (if this is a component) } + + HeadOb : Pointer; { AnimObPtr } + + AnimBob : pBob; + end; + + pAnimOb = ^tAnimOb; + tAnimOb = record + +{ --------------------- SYSTEM VARIABLES --------------------------------- } + + NextOb, + PrevOb : pAnimOb; + +{ number of calls to Animate this AnimOb has endured } + + Clock : Longint; + + AnOldY, + AnOldX : smallint; { old y,x coordinates } + +{ --------------------- COMMON VARIABLES --------------------------------- } + + AnY, + AnX : smallint; { y,x coordinates of the AnimOb } + +{ --------------------- USER VARIABLES ----------------------------------- } + + YVel, + XVel : smallint; { velocities of this object } + YAccel, + XAccel : smallint; { accelerations of this object } + + RingYTrans, + RingXTrans : smallint; { ring translation values } + + AnimORoutine : Pointer; { Pointer of special animation + procedure } + + HeadComp : pAnimComp; { pointer to first component } + + AUserExt : AUserStuff; { AnimOb user extension } + end; + + ppAnimOb = ^pAnimOb; + + +{ ************************************************************************ } + +const + + B2NORM = 0; + B2SWAP = 1; + B2BOBBER = 2; + +{ ************************************************************************ } + +type + +{ a structure to contain the 16 collision procedure addresses } + + collTable = Array [0..15] of Pointer; + pcollTable = ^collTable; + +const + +{ These bit descriptors are used by the GEL collide routines. + * These bits are set in the hitMask and meMask variables of + * a GEL to describe whether or not these types of collisions + * can affect the GEL. BNDRY_HIT is described further below; + * this bit is permanently assigned as the boundary-hit flag. + * The other bit GEL_HIT is meant only as a default to cover + * any GEL hitting any other; the user may redefine this bit. + } + + BORDERHIT = 0; + +{ These bit descriptors are used by the GEL boundry hit routines. + * When the user's boundry-hit routine is called (via the argument + * set by a call to SetCollision) the first argument passed to + * the user's routine is the Pointer of the GEL involved in the + * boundry-hit, and the second argument has the appropriate bit(s) + * set to describe which boundry was surpassed + } + + TOPHIT = 1; + BOTTOMHIT = 2; + LEFTHIT = 4; + RIGHTHIT = 8; + +Type + pExtendedNode = ^tExtendedNode; + tExtendedNode = record + xln_Succ, + xln_Pred : pNode; + xln_Type : Byte; + xln_Pri : Shortint; + xln_Name : PChar; + xln_Subsystem : Byte; + xln_Subtype : Byte; + xln_Library : Longint; + xln_Init : Pointer; + END; + +CONST + SS_GRAPHICS = $02; + + VIEW_EXTRA_TYPE = 1; + VIEWPORT_EXTRA_TYPE = 2; + SPECIAL_MONITOR_TYPE = 3; + MONITOR_SPEC_TYPE = 4; + +type + +{ structure used by AddTOFTask } + + pIsrvstr = ^tIsrvstr; + tIsrvstr = record + is_Node : tNode; + Iptr : pIsrvstr; { passed to srvr by os } + code : Pointer; + ccode : Pointer; + Carg : Pointer; + end; + +Type + pAnalogSignalInterval = ^tAnalogSignalInterval; + tAnalogSignalInterval = record + asi_Start, + asi_Stop : Word; + END; + + pSpecialMonitor = ^tSpecialMonitor; + tSpecialMonitor = record + spm_Node : tExtendedNode; + spm_Flags : Word; + do_monitor, + reserved1, + reserved2, + reserved3 : Pointer; + hblank, + vblank, + hsync, + vsync : tAnalogSignalInterval; + END; + + + pMonitorSpec = ^tMonitorSpec; + tMonitorSpec = record + ms_Node : tExtendedNode; + ms_Flags : Word; + ratioh, + ratiov : Longint; + total_rows, + total_colorclocks, + DeniseMaxDisplayColumn, + BeamCon0, + min_row : Word; + ms_Special : pSpecialMonitor; + ms_OpenCount : Word; + ms_transform, + ms_translate, + ms_scale : Pointer; + ms_xoffset, + ms_yoffset : Word; + ms_LegalView : tRectangle; + ms_maxoscan, { maximum legal overscan } + ms_videoscan : Pointer; { video display overscan } + DeniseMinDisplayColumn : Word; + DisplayCompatible : Cardinal; + DisplayInfoDataBase : tList; + DisplayInfoDataBaseSemaphore : tSignalSemaphore; + ms_MrgCop, + ms_LoadView, + ms_KillView : Longint; + END; + +const + TO_MONITOR = 0; + FROM_MONITOR = 1; + STANDARD_XOFFSET = 9; + STANDARD_YOFFSET = 0; + + MSB_REQUEST_NTSC = 0; + MSB_REQUEST_PAL = 1; + MSB_REQUEST_SPECIAL = 2; + MSB_REQUEST_A2024 = 3; + MSB_DOUBLE_SPRITES = 4; + MSF_REQUEST_NTSC = 1; + MSF_REQUEST_PAL = 2; + MSF_REQUEST_SPECIAL = 4; + MSF_REQUEST_A2024 = 8; + MSF_DOUBLE_SPRITES = 16; + + +{ obsolete, v37 compatible definitions follow } + REQUEST_NTSC = 1; + REQUEST_PAL = 2; + REQUEST_SPECIAL = 4; + REQUEST_A2024 = 8; + + DEFAULT_MONITOR_NAME : PChar = 'default.monitor'; + NTSC_MONITOR_NAME : PChar = 'ntsc.monitor'; + PAL_MONITOR_NAME : PChar = 'pal.monitor'; + STANDARD_MONITOR_MASK = ( REQUEST_NTSC OR REQUEST_PAL ) ; + + STANDARD_NTSC_ROWS = 262; + STANDARD_PAL_ROWS = 312; + STANDARD_COLORCLOCKS = 226; + STANDARD_DENISE_MAX = 455; + STANDARD_DENISE_MIN = 93 ; + STANDARD_NTSC_BEAMCON = $0000; + STANDARD_PAL_BEAMCON = DISPLAYPAL ; + + SPECIAL_BEAMCON = ( VARVBLANK OR LOLDIS OR VARVSYNC OR VARHSYNC OR VARBEAM OR CSBLANK OR VSYNCTRUE); + + MIN_NTSC_ROW = 21 ; + MIN_PAL_ROW = 29 ; + STANDARD_VIEW_X = $81 ; + STANDARD_VIEW_Y = $2C ; + STANDARD_HBSTRT = $06 ; + STANDARD_HSSTRT = $0B ; + STANDARD_HSSTOP = $1C ; + STANDARD_HBSTOP = $2C ; + STANDARD_VBSTRT = $0122; + STANDARD_VSSTRT = $02A6; + STANDARD_VSSTOP = $03AA; + STANDARD_VBSTOP = $1066; + + VGA_COLORCLOCKS = (STANDARD_COLORCLOCKS/2); + VGA_TOTAL_ROWS = (STANDARD_NTSC_ROWS*2); + VGA_DENISE_MIN = 59 ; + MIN_VGA_ROW = 29 ; + VGA_HBSTRT = $08 ; + VGA_HSSTRT = $0E ; + VGA_HSSTOP = $1C ; + VGA_HBSTOP = $1E ; + VGA_VBSTRT = $0000; + VGA_VSSTRT = $0153; + VGA_VSSTOP = $0235; + VGA_VBSTOP = $0CCD; + + VGA_MONITOR_NAME : PChar = 'vga.monitor'; + +{ NOTE: VGA70 definitions are obsolete - a VGA70 monitor has never been + * implemented. + } + VGA70_COLORCLOCKS = (STANDARD_COLORCLOCKS/2) ; + VGA70_TOTAL_ROWS = 449; + VGA70_DENISE_MIN = 59; + MIN_VGA70_ROW = 35 ; + VGA70_HBSTRT = $08 ; + VGA70_HSSTRT = $0E ; + VGA70_HSSTOP = $1C ; + VGA70_HBSTOP = $1E ; + VGA70_VBSTRT = $0000; + VGA70_VSSTRT = $02A6; + VGA70_VSSTOP = $0388; + VGA70_VBSTOP = $0F73; + + VGA70_BEAMCON = (SPECIAL_BEAMCON XOR VSYNCTRUE); + VGA70_MONITOR_NAME : PChar = 'vga70.monitor'; + + BROADCAST_HBSTRT = $01 ; + BROADCAST_HSSTRT = $06 ; + BROADCAST_HSSTOP = $17 ; + BROADCAST_HBSTOP = $27 ; + BROADCAST_VBSTRT = $0000; + BROADCAST_VSSTRT = $02A6; + BROADCAST_VSSTOP = $054C; + BROADCAST_VBSTOP = $1C40; + BROADCAST_BEAMCON = ( LOLDIS OR CSBLANK ); + RATIO_FIXEDPART = 4; + RATIO_UNITY = 16; + + + +Type + pRasInfo = ^tRasInfo; + tRasInfo = record { used by callers to and InitDspC() } + Next : pRasInfo; { used for dualpf } + BitMap : pBitMap; + RxOffset, + RyOffset : smallint; { scroll offsets in this BitMap } + end; + + + pView = ^tView; + tView = record + ViewPort : Pointer; { ViewPortPtr } + LOFCprList : pcprlist; { used for interlaced and noninterlaced } + SHFCprList : pcprlist; { only used during interlace } + DyOffset, + DxOffset : smallint; { for complete View positioning } + { offsets are +- adjustments to standard #s } + Modes : WORD; { such as INTERLACE, GENLOC } + end; + +{ these structures are obtained via GfxNew } +{ and disposed by GfxFree } +Type + pViewExtra = ^tViewExtra; + tViewExtra = record + n : tExtendedNode; + View : pView; { backwards link } { view in C-Includes } + Monitor : pMonitorSpec; { monitors for this view } + TopLine : Word; + END; + + + pViewPort = ^tViewPort; + tViewPort = record + Next : pViewPort; + ColorMap : Pointer; { table of colors for this viewport } { ColorMapPtr } + { if this is nil, MakeVPort assumes default values } + DspIns : pCopList; { user by MakeView() } + SprIns : pCopList; { used by sprite stuff } + ClrIns : pCopList; { used by sprite stuff } + UCopIns : pUCopList; { User copper list } + DWidth, + DHeight : smallint; + DxOffset, + DyOffset : smallint; + Modes : Word; + SpritePriorities : Byte; { used by makevp } + reserved : Byte; + RasInfo : pRasInfo; + end; + + +{ this structure is obtained via GfxNew } +{ and disposed by GfxFree } + + pViewPortExtra = ^tViewPortExtra; + tViewPortExtra = record + n : tExtendedNode; + ViewPort : pViewPort; { backwards link } { ViewPort in C-Includes } + DisplayClip : tRectangle; { makevp display clipping information } + { These are added for V39 } + VecTable : Pointer; { Private } + DriverData : Array[0..1] of Pointer; + Flags : WORD; + Origin : Array[0..1] of tPoint; { First visible point relative to the DClip. + * One for each possible playfield. + } + cop1ptr, { private } + cop2ptr : Cardinal; { private } + END; + + + pColorMap = ^tColorMap; + tColorMap = record + Flags : Byte; + CType : Byte; { This is "Type" in C includes } + Count : Word; + ColorTable : Pointer; + cm_vpe : pViewPortExtra; + LowColorBits : Pointer; + TransparencyPlane, + SpriteResolution, + SpriteResDefault, + AuxFlags : Byte; + cm_vp : pViewPort; { ViewPortPtr } + NormalDisplayInfo, + CoerceDisplayInfo : Pointer; + cm_batch_items : pTagItem; + VPModeID : Cardinal; + PalExtra : Pointer; + SpriteBase_Even, + SpriteBase_Odd, + Bp_0_base, + Bp_1_base : Word; + end; + +{ if Type == 0 then ColorMap is V1.2/V1.3 compatible } +{ if Type != 0 then ColorMap is V36 compatible } +{ the system will never create other than V39 type colormaps when running V39 } + +CONST + COLORMAP_TYPE_V1_2 = $00; + COLORMAP_TYPE_V1_4 = $01; + COLORMAP_TYPE_V36 = COLORMAP_TYPE_V1_4; { use this definition } + COLORMAP_TYPE_V39 = $02; + + +{ Flags variable } + COLORMAP_TRANSPARENCY = $01; + COLORPLANE_TRANSPARENCY = $02; + BORDER_BLANKING = $04; + BORDER_NOTRANSPARENCY = $08; + VIDEOCONTROL_BATCH = $10; + USER_COPPER_CLIP = $20; + + +CONST + EXTEND_VSTRUCT = $1000; { unused bit in Modes field of View } + + +{ defines used for Modes in IVPargs } + +CONST + GENLOCK_VIDEO = $0002; + LACE = $0004; + SUPERHIRES = $0020; + PFBA = $0040; + EXTRA_HALFBRITE= $0080; + GENLOCK_AUDIO = $0100; + DUALPF = $0400; + HAM = $0800; + EXTENDED_MODE = $1000; + VP_HIDE = $2000; + SPRITES = $4000; + HIRES = $8000; + + VPF_A2024 = $40; + VPF_AGNUS = $20; + VPF_TENHZ = $20; + + BORDERSPRITES = $40; + + CMF_CMTRANS = 0; + CMF_CPTRANS = 1; + CMF_BRDRBLNK = 2; + CMF_BRDNTRAN = 3; + CMF_BRDRSPRT = 6; + + SPRITERESN_ECS = 0; +{ ^140ns, except in 35ns viewport, where it is 70ns. } + SPRITERESN_140NS = 1; + SPRITERESN_70NS = 2; + SPRITERESN_35NS = 3; + SPRITERESN_DEFAULT = -1; + +{ AuxFlags : } + CMAB_FULLPALETTE = 0; + CMAF_FULLPALETTE = 1; + CMAB_NO_INTERMED_UPDATE = 1; + CMAF_NO_INTERMED_UPDATE = 2; + CMAB_NO_COLOR_LOAD = 2; + CMAF_NO_COLOR_LOAD = 4; + CMAB_DUALPF_DISABLE = 3; + CMAF_DUALPF_DISABLE = 8; + +Type + pPaletteExtra = ^tPaletteExtra; + tPaletteExtra = record { structure may be extended so watch out! } + pe_Semaphore : tSignalSemaphore; { shared semaphore for arbitration } + pe_FirstFree, { *private* } + pe_NFree, { number of free colors } + pe_FirstShared, { *private* } + pe_NShared : WORD; { *private* } + pe_RefCnt : Pointer; { *private* } + pe_AllocList : Pointer; { *private* } + pe_ViewPort : pViewPort; { back pointer to viewport } + pe_SharableColors : WORD; { the number of sharable colors. } + end; +{ flags values for ObtainPen } +Const + PENB_EXCLUSIVE = 0; + PENB_NO_SETCOLOR = 1; + + PENF_EXCLUSIVE = 1; + PENF_NO_SETCOLOR = 2; + +{ obsolete names for PENF_xxx flags: } + + PEN_EXCLUSIVE = PENF_EXCLUSIVE; + PEN_NO_SETCOLOR = PENF_NO_SETCOLOR; + +{ precision values for ObtainBestPen : } + + PRECISION_EXACT = -1; + PRECISION_IMAGE = 0; + PRECISION_ICON = 16; + PRECISION_GUI = 32; + + +{ tags for ObtainBestPen: } + OBP_Precision = $84000000; + OBP_FailIfBad = $84000001; + +{ From V39, MakeVPort() will return an error if there is not enough memory, + * or the requested mode cannot be opened with the requested depth with the + * given bitmap (for higher bandwidth alignments). + } + + MVP_OK = 0; { you want to see this one } + MVP_NO_MEM = 1; { insufficient memory for intermediate workspace } + MVP_NO_VPE = 2; { ViewPort does not have a ViewPortExtra, and + * insufficient memory to allocate a temporary one. + } + MVP_NO_DSPINS = 3; { insufficient memory for intermidiate copper + * instructions. + } + MVP_NO_DISPLAY = 4; { BitMap data is misaligned for this viewport's + * mode and depth - see AllocBitMap(). + } + MVP_OFF_BOTTOM = 5; { PRIVATE - you will never see this. } + +{ From V39, MrgCop() will return an error if there is not enough memory, + * or for some reason MrgCop() did not need to make any copper lists. + } + + MCOP_OK = 0; { you want to see this one } + MCOP_NO_MEM = 1; { insufficient memory to allocate the system + * copper lists. + } + MCOP_NOP = 2; { MrgCop() did not merge any copper lists + * (eg, no ViewPorts in the list, or all marked as + * hidden). + } +Type + pDBufInfo = ^tDBufInfo; + tDBufInfo = record + dbi_Link1 : Pointer; + dbi_Count1 : Cardinal; + dbi_SafeMessage : tMessage; { replied to when safe to write to old bitmap } + dbi_UserData1 : Pointer; { first user data } + + dbi_Link2 : Pointer; + dbi_Count2 : Cardinal; + dbi_DispMessage : tMessage; { replied to when new bitmap has been displayed at least + once } + dbi_UserData2 : Pointer; { second user data } + dbi_MatchLong : Cardinal; + dbi_CopPtr1, + dbi_CopPtr2, + dbi_CopPtr3 : Pointer; + dbi_BeamPos1, + dbi_BeamPos2 : WORD; + end; + + + + { include define file for graphics display mode IDs. } + + +const + + INVALID_ID = NOT 0; + +{ With all the new modes that are available under V38 and V39, it is highly + * recommended that you use either the asl.library screenmode requester, + * and/or the V39 graphics.library function BestModeIDA(). + * + * DO NOT interpret the any of the bits in the ModeID for its meaning. For + * example, do not interpret bit 3 ($4) as meaning the ModeID is interlaced. + * Instead, use GetDisplayInfoData() with DTAG_DISP, and examine the DIPF_... + * flags to determine a ModeID's characteristics. The only exception to + * this rule is that bit 7 ($80) will always mean the ModeID is + * ExtraHalfBright, and bit 11 ($800) will always mean the ModeID is HAM. + } + +{ normal identifiers } + + MONITOR_ID_MASK = $FFFF1000; + + DEFAULT_MONITOR_ID = $00000000; + NTSC_MONITOR_ID = $00011000; + PAL_MONITOR_ID = $00021000; + +{ the following 22 composite keys are for Modes on the default Monitor. + * NTSC & PAL "flavors" of these particular keys may be made by or'ing + * the NTSC or PAL MONITOR_ID with the desired MODE_KEY... + * + * For example, to specifically open a PAL HAM interlaced ViewPort + * (or intuition screen), you would use the modeid of + * (PAL_MONITOR_ID OR HAMLACE_KEY) + } + + LORES_KEY = $00000000; + HIRES_KEY = $00008000; + SUPER_KEY = $00008020; + HAM_KEY = $00000800; + LORESLACE_KEY = $00000004; + HIRESLACE_KEY = $00008004; + SUPERLACE_KEY = $00008024; + HAMLACE_KEY = $00000804; + LORESDPF_KEY = $00000400; + HIRESDPF_KEY = $00008400; + SUPERDPF_KEY = $00008420; + LORESLACEDPF_KEY = $00000404; + HIRESLACEDPF_KEY = $00008404; + SUPERLACEDPF_KEY = $00008424; + LORESDPF2_KEY = $00000440; + HIRESDPF2_KEY = $00008440; + SUPERDPF2_KEY = $00008460; + LORESLACEDPF2_KEY = $00000444; + HIRESLACEDPF2_KEY = $00008444; + SUPERLACEDPF2_KEY = $00008464; + EXTRAHALFBRITE_KEY = $00000080; + EXTRAHALFBRITELACE_KEY = $00000084; +{ New for AA ChipSet (V39) } + HIRESHAM_KEY = $00008800; + SUPERHAM_KEY = $00008820; + HIRESEHB_KEY = $00008080; + SUPEREHB_KEY = $000080a0; + HIRESHAMLACE_KEY = $00008804; + SUPERHAMLACE_KEY = $00008824; + HIRESEHBLACE_KEY = $00008084; + SUPEREHBLACE_KEY = $000080a4; +{ Added for V40 - may be useful modes for some games or animations. } + LORESSDBL_KEY = $00000008; + LORESHAMSDBL_KEY = $00000808; + LORESEHBSDBL_KEY = $00000088; + HIRESHAMSDBL_KEY = $00008808; + + +{ VGA identifiers } + + VGA_MONITOR_ID = $00031000; + + VGAEXTRALORES_KEY = $00031004; + VGALORES_KEY = $00039004; + VGAPRODUCT_KEY = $00039024; + VGAHAM_KEY = $00031804; + VGAEXTRALORESLACE_KEY = $00031005; + VGALORESLACE_KEY = $00039005; + VGAPRODUCTLACE_KEY = $00039025; + VGAHAMLACE_KEY = $00031805; + VGAEXTRALORESDPF_KEY = $00031404; + VGALORESDPF_KEY = $00039404; + VGAPRODUCTDPF_KEY = $00039424; + VGAEXTRALORESLACEDPF_KEY = $00031405; + VGALORESLACEDPF_KEY = $00039405; + VGAPRODUCTLACEDPF_KEY = $00039425; + VGAEXTRALORESDPF2_KEY = $00031444; + VGALORESDPF2_KEY = $00039444; + VGAPRODUCTDPF2_KEY = $00039464; + VGAEXTRALORESLACEDPF2_KEY = $00031445; + VGALORESLACEDPF2_KEY = $00039445; + VGAPRODUCTLACEDPF2_KEY = $00039465; + VGAEXTRAHALFBRITE_KEY = $00031084; + VGAEXTRAHALFBRITELACE_KEY = $00031085; +{ New for AA ChipSet (V39) } + VGAPRODUCTHAM_KEY = $00039824; + VGALORESHAM_KEY = $00039804; + VGAEXTRALORESHAM_KEY = VGAHAM_KEY; + VGAPRODUCTHAMLACE_KEY = $00039825; + VGALORESHAMLACE_KEY = $00039805; + VGAEXTRALORESHAMLACE_KEY = VGAHAMLACE_KEY; + VGAEXTRALORESEHB_KEY = VGAEXTRAHALFBRITE_KEY; + VGAEXTRALORESEHBLACE_KEY = VGAEXTRAHALFBRITELACE_KEY; + VGALORESEHB_KEY = $00039084; + VGALORESEHBLACE_KEY = $00039085; + VGAEHB_KEY = $000390a4; + VGAEHBLACE_KEY = $000390a5; +{ These ModeIDs are the scandoubled equivalents of the above, with the + * exception of the DualPlayfield modes, as AA does not allow for scandoubling + * dualplayfield. + } + VGAEXTRALORESDBL_KEY = $00031000; + VGALORESDBL_KEY = $00039000; + VGAPRODUCTDBL_KEY = $00039020; + VGAEXTRALORESHAMDBL_KEY = $00031800; + VGALORESHAMDBL_KEY = $00039800; + VGAPRODUCTHAMDBL_KEY = $00039820; + VGAEXTRALORESEHBDBL_KEY = $00031080; + VGALORESEHBDBL_KEY = $00039080; + VGAPRODUCTEHBDBL_KEY = $000390a0; + +{ a2024 identifiers } + + A2024_MONITOR_ID = $00041000; + + A2024TENHERTZ_KEY = $00041000; + A2024FIFTEENHERTZ_KEY = $00049000; + +{ prototype identifiers (private) } + + PROTO_MONITOR_ID = $00051000; + + +{ These monitors and modes were added for the V38 release. } + + EURO72_MONITOR_ID = $00061000; + + EURO72EXTRALORES_KEY = $00061004; + EURO72LORES_KEY = $00069004; + EURO72PRODUCT_KEY = $00069024; + EURO72HAM_KEY = $00061804; + EURO72EXTRALORESLACE_KEY = $00061005; + EURO72LORESLACE_KEY = $00069005; + EURO72PRODUCTLACE_KEY = $00069025; + EURO72HAMLACE_KEY = $00061805; + EURO72EXTRALORESDPF_KEY = $00061404; + EURO72LORESDPF_KEY = $00069404; + EURO72PRODUCTDPF_KEY = $00069424; + EURO72EXTRALORESLACEDPF_KEY = $00061405; + EURO72LORESLACEDPF_KEY = $00069405; + EURO72PRODUCTLACEDPF_KEY = $00069425; + EURO72EXTRALORESDPF2_KEY = $00061444; + EURO72LORESDPF2_KEY = $00069444; + EURO72PRODUCTDPF2_KEY = $00069464; + EURO72EXTRALORESLACEDPF2_KEY = $00061445; + EURO72LORESLACEDPF2_KEY = $00069445; + EURO72PRODUCTLACEDPF2_KEY = $00069465; + EURO72EXTRAHALFBRITE_KEY = $00061084; + EURO72EXTRAHALFBRITELACE_KEY = $00061085; +{ New AA modes (V39) } + EURO72PRODUCTHAM_KEY = $00069824; + EURO72PRODUCTHAMLACE_KEY = $00069825; + EURO72LORESHAM_KEY = $00069804; + EURO72LORESHAMLACE_KEY = $00069805; + EURO72EXTRALORESHAM_KEY = EURO72HAM_KEY; + EURO72EXTRALORESHAMLACE_KEY = EURO72HAMLACE_KEY ; + EURO72EXTRALORESEHB_KEY = EURO72EXTRAHALFBRITE_KEY; + EURO72EXTRALORESEHBLACE_KEY = EURO72EXTRAHALFBRITELACE_KEY; + EURO72LORESEHB_KEY = $00069084; + EURO72LORESEHBLACE_KEY = $00069085; + EURO72EHB_KEY = $000690a4; + EURO72EHBLACE_KEY = $000690a5; +{ These ModeIDs are the scandoubled equivalents of the above, with the + * exception of the DualPlayfield modes, as AA does not allow for scandoubling + * dualplayfield. + } + EURO72EXTRALORESDBL_KEY = $00061000; + EURO72LORESDBL_KEY = $00069000; + EURO72PRODUCTDBL_KEY = $00069020; + EURO72EXTRALORESHAMDBL_KEY = $00061800; + EURO72LORESHAMDBL_KEY = $00069800; + EURO72PRODUCTHAMDBL_KEY = $00069820; + EURO72EXTRALORESEHBDBL_KEY = $00061080; + EURO72LORESEHBDBL_KEY = $00069080; + EURO72PRODUCTEHBDBL_KEY = $000690a0; + + + EURO36_MONITOR_ID = $00071000; + +{ Euro36 modeids can be ORed with the default modeids a la NTSC and PAL. + * For example, Euro36 SuperHires is + * (EURO36_MONITOR_ID OR SUPER_KEY) + } + + SUPER72_MONITOR_ID = $00081000; + +{ Super72 modeids can be ORed with the default modeids a la NTSC and PAL. + * For example, Super72 SuperHiresLace (80$600) is + * (SUPER72_MONITOR_ID OR SUPERLACE_KEY). + * The following scandoubled Modes are the exception: + } + SUPER72LORESDBL_KEY = $00081008; + SUPER72HIRESDBL_KEY = $00089008; + SUPER72SUPERDBL_KEY = $00089028; + SUPER72LORESHAMDBL_KEY = $00081808; + SUPER72HIRESHAMDBL_KEY = $00089808; + SUPER72SUPERHAMDBL_KEY = $00089828; + SUPER72LORESEHBDBL_KEY = $00081088; + SUPER72HIRESEHBDBL_KEY = $00089088; + SUPER72SUPEREHBDBL_KEY = $000890a8; + + +{ These monitors and modes were added for the V39 release. } + + DBLNTSC_MONITOR_ID = $00091000; + + DBLNTSCLORES_KEY = $00091000; + DBLNTSCLORESFF_KEY = $00091004; + DBLNTSCLORESHAM_KEY = $00091800; + DBLNTSCLORESHAMFF_KEY = $00091804; + DBLNTSCLORESEHB_KEY = $00091080; + DBLNTSCLORESEHBFF_KEY = $00091084; + DBLNTSCLORESLACE_KEY = $00091005; + DBLNTSCLORESHAMLACE_KEY = $00091805; + DBLNTSCLORESEHBLACE_KEY = $00091085; + DBLNTSCLORESDPF_KEY = $00091400; + DBLNTSCLORESDPFFF_KEY = $00091404; + DBLNTSCLORESDPFLACE_KEY = $00091405; + DBLNTSCLORESDPF2_KEY = $00091440; + DBLNTSCLORESDPF2FF_KEY = $00091444; + DBLNTSCLORESDPF2LACE_KEY = $00091445; + DBLNTSCHIRES_KEY = $00099000; + DBLNTSCHIRESFF_KEY = $00099004; + DBLNTSCHIRESHAM_KEY = $00099800; + DBLNTSCHIRESHAMFF_KEY = $00099804; + DBLNTSCHIRESLACE_KEY = $00099005; + DBLNTSCHIRESHAMLACE_KEY = $00099805; + DBLNTSCHIRESEHB_KEY = $00099080; + DBLNTSCHIRESEHBFF_KEY = $00099084; + DBLNTSCHIRESEHBLACE_KEY = $00099085; + DBLNTSCHIRESDPF_KEY = $00099400; + DBLNTSCHIRESDPFFF_KEY = $00099404; + DBLNTSCHIRESDPFLACE_KEY = $00099405; + DBLNTSCHIRESDPF2_KEY = $00099440; + DBLNTSCHIRESDPF2FF_KEY = $00099444; + DBLNTSCHIRESDPF2LACE_KEY = $00099445; + DBLNTSCEXTRALORES_KEY = $00091200; + DBLNTSCEXTRALORESHAM_KEY = $00091a00; + DBLNTSCEXTRALORESEHB_KEY = $00091280; + DBLNTSCEXTRALORESDPF_KEY = $00091600; + DBLNTSCEXTRALORESDPF2_KEY = $00091640; + DBLNTSCEXTRALORESFF_KEY = $00091204; + DBLNTSCEXTRALORESHAMFF_KEY = $00091a04; + DBLNTSCEXTRALORESEHBFF_KEY = $00091284; + DBLNTSCEXTRALORESDPFFF_KEY = $00091604; + DBLNTSCEXTRALORESDPF2FF_KEY = $00091644; + DBLNTSCEXTRALORESLACE_KEY = $00091205; + DBLNTSCEXTRALORESHAMLACE_KEY = $00091a05; + DBLNTSCEXTRALORESEHBLACE_KEY = $00091285; + DBLNTSCEXTRALORESDPFLACE_KEY = $00091605; + DBLNTSCEXTRALORESDPF2LACE_KEY = $00091645; + + DBLPAL_MONITOR_ID = $000a1000; + + DBLPALLORES_KEY = $000a1000; + DBLPALLORESFF_KEY = $000a1004; + DBLPALLORESHAM_KEY = $000a1800; + DBLPALLORESHAMFF_KEY = $000a1804; + DBLPALLORESEHB_KEY = $000a1080; + DBLPALLORESEHBFF_KEY = $000a1084; + DBLPALLORESLACE_KEY = $000a1005; + DBLPALLORESHAMLACE_KEY = $000a1805; + DBLPALLORESEHBLACE_KEY = $000a1085; + DBLPALLORESDPF_KEY = $000a1400; + DBLPALLORESDPFFF_KEY = $000a1404; + DBLPALLORESDPFLACE_KEY = $000a1405; + DBLPALLORESDPF2_KEY = $000a1440; + DBLPALLORESDPF2FF_KEY = $000a1444; + DBLPALLORESDPF2LACE_KEY = $000a1445; + DBLPALHIRES_KEY = $000a9000; + DBLPALHIRESFF_KEY = $000a9004; + DBLPALHIRESHAM_KEY = $000a9800; + DBLPALHIRESHAMFF_KEY = $000a9804; + DBLPALHIRESLACE_KEY = $000a9005; + DBLPALHIRESHAMLACE_KEY = $000a9805; + DBLPALHIRESEHB_KEY = $000a9080; + DBLPALHIRESEHBFF_KEY = $000a9084; + DBLPALHIRESEHBLACE_KEY = $000a9085; + DBLPALHIRESDPF_KEY = $000a9400; + DBLPALHIRESDPFFF_KEY = $000a9404; + DBLPALHIRESDPFLACE_KEY = $000a9405; + DBLPALHIRESDPF2_KEY = $000a9440; + DBLPALHIRESDPF2FF_KEY = $000a9444; + DBLPALHIRESDPF2LACE_KEY = $000a9445; + DBLPALEXTRALORES_KEY = $000a1200; + DBLPALEXTRALORESHAM_KEY = $000a1a00; + DBLPALEXTRALORESEHB_KEY = $000a1280; + DBLPALEXTRALORESDPF_KEY = $000a1600; + DBLPALEXTRALORESDPF2_KEY = $000a1640; + DBLPALEXTRALORESFF_KEY = $000a1204; + DBLPALEXTRALORESHAMFF_KEY = $000a1a04; + DBLPALEXTRALORESEHBFF_KEY = $000a1284; + DBLPALEXTRALORESDPFFF_KEY = $000a1604; + DBLPALEXTRALORESDPF2FF_KEY = $000a1644; + DBLPALEXTRALORESLACE_KEY = $000a1205; + DBLPALEXTRALORESHAMLACE_KEY = $000a1a05; + DBLPALEXTRALORESEHBLACE_KEY = $000a1285; + DBLPALEXTRALORESDPFLACE_KEY = $000a1605; + DBLPALEXTRALORESDPF2LACE_KEY = $000a1645; + + +{ Use these tags for passing to BestModeID() (V39) } + + SPECIAL_FLAGS = $100E; + { Original: + SPECIAL_FLAGS = DIPF_IS_DUALPF OR DIPF_IS_PF2PRI OR DIPF_IS_HAM OR DIPF_IS_EXTRAHALFBRITE; + ( Mu?te aufgrund eines Fehler in PCQ ge?ndert werden ) + } + + + BIDTAG_DIPFMustHave = $80000001; { mask of the DIPF_ flags the ModeID must have } + { Default - NULL } + BIDTAG_DIPFMustNotHave = $80000002; { mask of the DIPF_ flags the ModeID must not have } + { Default - SPECIAL_FLAGS } + BIDTAG_ViewPort = $80000003; { ViewPort for which a ModeID is sought. } + { Default - NULL } + BIDTAG_NominalWidth = $80000004; { \ together make the aspect ratio and } + BIDTAG_NominalHeight = $80000005; { / override the vp->Width/Height. } + { Default - SourceID NominalDimensionInfo, + * or vp->DWidth/Height, or (640 * 200), + * in that preferred order. + } + BIDTAG_DesiredWidth = $80000006; { \ Nominal Width and Height of the } + BIDTAG_DesiredHeight = $80000007; { / returned ModeID. } + { Default - same as Nominal } + BIDTAG_Depth = $80000008; { ModeID must support this depth. } + { Default - vp->RasInfo->BitMap->Depth or 1 } + BIDTAG_MonitorID = $80000009; { ModeID must use this monitor. } + { Default - use best monitor available } + BIDTAG_SourceID = $8000000a; { instead of a ViewPort. } + { Default - VPModeID(vp) if BIDTAG_ViewPort is + * specified, else leave the DIPFMustHave and + * DIPFMustNotHave values untouched. + } + BIDTAG_RedBits = $8000000b; { \ } + BIDTAG_BlueBits = $8000000c; { > Match up from the database } + BIDTAG_GreenBits = $8000000d; { / } + { Default - 4 } + BIDTAG_GfxPrivate = $8000000e; { Private } + + +const + +{ bplcon0 defines } + + MODE_640 = $8000; + PLNCNTMSK = $7; { how many bit planes? } + { 0 = none, 1->6 = 1->6, 7 = reserved } + PLNCNTSHFT = 12; { bits to shift for bplcon0 } + PF2PRI = $40; { bplcon2 bit } + COLORON = $0200; { disable color burst } + DBLPF = $400; + HOLDNMODIFY = $800; + INTERLACE = 4; { interlace mode for 400 } + +{ bplcon1 defines } + + PFA_FINE_SCROLL = $F; + PFB_FINE_SCROLL_SHIFT = 4; + PF_FINE_SCROLL_MASK = $F; + +{ display window start and stop defines } + + DIW_HORIZ_POS = $7F; { horizontal start/stop } + DIW_VRTCL_POS = $1FF; { vertical start/stop } + DIW_VRTCL_POS_SHIFT = $7; + +{ Data fetch start/stop horizontal position } + + DFTCH_MASK = $FF; + +{ vposr bits } + + VPOSRLOF = $8000; + + { include define file for displayinfo database } + +{ the "public" handle to a DisplayInfoRecord } +Type + + DisplayInfoHandle = Pointer; + +{ datachunk type identifiers } + +CONST + DTAG_DISP = $80000000; + DTAG_DIMS = $80001000; + DTAG_MNTR = $80002000; + DTAG_NAME = $80003000; + DTAG_VEC = $80004000; { internal use only } + +Type + + pQueryHeader = ^tQueryHeader; + tQueryHeader = record + tructID, { datachunk type identifier } + DisplayID, { copy of display record key } + SkipID, { TAG_SKIP -- see tagitems.h } + Length : Cardinal; { length of local data in double-longwords } + END; + + pDisplayInfo = ^tDisplayInfo; + tDisplayInfo = record + Header : tQueryHeader; + NotAvailable : Word; { IF NULL available, else see defines } + PropertyFlags : Cardinal; { Properties of this mode see defines } + Resolution : tPoint; { ticks-per-pixel X/Y } + PixelSpeed : Word; { aproximation in nanoseconds } + NumStdSprites : Word; { number of standard amiga sprites } + PaletteRange : Word; { distinguishable shades available } + SpriteResolution : tPoint; { std sprite ticks-per-pixel X/Y } + pad : Array[0..3] of Byte; + RedBits : Byte; + GreenBits : Byte; + BlueBits : Byte; + pad2 : array [0..4] of Byte; + reserved : Array[0..1] of Cardinal; { terminator } + END; + +{ availability } + +CONST + DI_AVAIL_NOCHIPS =$0001; + DI_AVAIL_NOMONITOR =$0002; + DI_AVAIL_NOTWITHGENLOCK =$0004; + +{ mode properties } + + DIPF_IS_LACE = $00000001; + DIPF_IS_DUALPF = $00000002; + DIPF_IS_PF2PRI = $00000004; + DIPF_IS_HAM = $00000008; + + DIPF_IS_ECS = $00000010; { note: ECS modes (SHIRES, VGA, AND ** + PRODUCTIVITY) do not support ** + attached sprites. ** + } + DIPF_IS_AA = $00010000; { AA modes - may only be available + ** if machine has correct memory + ** type to support required + ** bandwidth - check availability. + ** (V39) + } + DIPF_IS_PAL = $00000020; + DIPF_IS_SPRITES = $00000040; + DIPF_IS_GENLOCK = $00000080; + + DIPF_IS_WB = $00000100; + DIPF_IS_DRAGGABLE = $00000200; + DIPF_IS_PANELLED = $00000400; + DIPF_IS_BEAMSYNC = $00000800; + + DIPF_IS_EXTRAHALFBRITE = $00001000; + +{ The following DIPF_IS_... flags are new for V39 } + DIPF_IS_SPRITES_ATT = $00002000; { supports attached sprites } + DIPF_IS_SPRITES_CHNG_RES = $00004000; { supports variable sprite resolution } + DIPF_IS_SPRITES_BORDER = $00008000; { sprite can be displayed in the border } + DIPF_IS_SCANDBL = $00020000; { scan doubled } + DIPF_IS_SPRITES_CHNG_BASE = $00040000; + { can change the sprite base colour } + DIPF_IS_SPRITES_CHNG_PRI = $00080000; + { can change the sprite priority + ** with respect to the playfield(s). + } + DIPF_IS_DBUFFER = $00100000; { can support double buffering } + DIPF_IS_PROGBEAM = $00200000; { is a programmed beam-sync mode } + DIPF_IS_FOREIGN = $80000000; { this mode is not native to the Amiga } + +Type + pDimensionInfo =^tDimensionInfo; + tDimensionInfo = record + Header : tQueryHeader; + MaxDepth, { log2( max number of colors ) } + MinRasterWidth, { minimum width in pixels } + MinRasterHeight, { minimum height in pixels } + MaxRasterWidth, { maximum width in pixels } + MaxRasterHeight : Word; { maximum height in pixels } + Nominal, { "standard" dimensions } + MaxOScan, { fixed, hardware dependant } + VideoOScan, { fixed, hardware dependant } + TxtOScan, { editable via preferences } + StdOScan : tRectangle; { editable via preferences } + pad : Array[0..13] of Byte; + reserved : Array[0..1] of Longint; { terminator } + END; + + pMonitorInfo = ^tMonitorInfo; + tMonitorInfo = record + Header : tQueryHeader; + Mspc : pMonitorSpec; { pointer to monitor specification } + ViewPosition, { editable via preferences } + ViewResolution : tPoint; { standard monitor ticks-per-pixel } + ViewPositionRange : tRectangle; { fixed, hardware dependant } + TotalRows, { display height in scanlines } + TotalColorClocks, { scanline width in 280 ns units } + MinRow : Word; { absolute minimum active scanline } + Compatibility : smallint; { how this coexists with others } + pad : Array[0..31] of Byte; + MouseTicks : tPoint; + DefaultViewPosition : tPoint; + PreferredModeID : Cardinal; + reserved : Array[0..1] of Cardinal; { terminator } + END; + +{ monitor compatibility } + +CONST + MCOMPAT_MIXED = 0; { can share display with other MCOMPAT_MIXED } + MCOMPAT_SELF = 1; { can share only within same monitor } + MCOMPAT_NOBODY= -1; { only one viewport at a time } + + DISPLAYNAMELEN = 32; + +Type + pNameInfo = ^tNameInfo; + tNameInfo = record + Header : tQueryHeader; + Name : Array[0..DISPLAYNAMELEN-1] of Char; + reserved : Array[0..1] of Cardinal; { terminator } + END; + + +{****************************************************************************} + +{ The following VecInfo structure is PRIVATE, for our use only + * Touch these, and burn! (V39) + } +Type + pVecInfo = ^tVecInfo; + tVecInfo = record + Header : tQueryHeader; + Vec : Pointer; + Data : Pointer; + vi_Type : WORD; { Type in C Includes } + pad : Array[0..2] of WORD; + reserved : Array[0..1] of Cardinal; + end; + + +CONST + VTAG_END_CM = $00000000; + VTAG_CHROMAKEY_CLR = $80000000; + VTAG_CHROMAKEY_SET = $80000001; + VTAG_BITPLANEKEY_CLR = $80000002; + VTAG_BITPLANEKEY_SET = $80000003; + VTAG_BORDERBLANK_CLR = $80000004; + VTAG_BORDERBLANK_SET = $80000005; + VTAG_BORDERNOTRANS_CLR = $80000006; + VTAG_BORDERNOTRANS_SET = $80000007; + VTAG_CHROMA_PEN_CLR = $80000008; + VTAG_CHROMA_PEN_SET = $80000009; + VTAG_CHROMA_PLANE_SET = $8000000A; + VTAG_ATTACH_CM_SET = $8000000B; + VTAG_NEXTBUF_CM = $8000000C; + VTAG_BATCH_CM_CLR = $8000000D; + VTAG_BATCH_CM_SET = $8000000E; + VTAG_NORMAL_DISP_GET = $8000000F; + VTAG_NORMAL_DISP_SET = $80000010; + VTAG_COERCE_DISP_GET = $80000011; + VTAG_COERCE_DISP_SET = $80000012; + VTAG_VIEWPORTEXTRA_GET = $80000013; + VTAG_VIEWPORTEXTRA_SET = $80000014; + VTAG_CHROMAKEY_GET = $80000015; + VTAG_BITPLANEKEY_GET = $80000016; + VTAG_BORDERBLANK_GET = $80000017; + VTAG_BORDERNOTRANS_GET = $80000018; + VTAG_CHROMA_PEN_GET = $80000019; + VTAG_CHROMA_PLANE_GET = $8000001A; + VTAG_ATTACH_CM_GET = $8000001B; + VTAG_BATCH_CM_GET = $8000001C; + VTAG_BATCH_ITEMS_GET = $8000001D; + VTAG_BATCH_ITEMS_SET = $8000001E; + VTAG_BATCH_ITEMS_ADD = $8000001F; + VTAG_VPMODEID_GET = $80000020; + VTAG_VPMODEID_SET = $80000021; + VTAG_VPMODEID_CLR = $80000022; + VTAG_USERCLIP_GET = $80000023; + VTAG_USERCLIP_SET = $80000024; + VTAG_USERCLIP_CLR = $80000025; +{ The following tags are V39 specific. They will be ignored (returing error -3) by + earlier versions } + VTAG_PF1_BASE_GET = $80000026; + VTAG_PF2_BASE_GET = $80000027; + VTAG_SPEVEN_BASE_GET = $80000028; + VTAG_SPODD_BASE_GET = $80000029; + VTAG_PF1_BASE_SET = $8000002a; + VTAG_PF2_BASE_SET = $8000002b; + VTAG_SPEVEN_BASE_SET = $8000002c; + VTAG_SPODD_BASE_SET = $8000002d; + VTAG_BORDERSPRITE_GET = $8000002e; + VTAG_BORDERSPRITE_SET = $8000002f; + VTAG_BORDERSPRITE_CLR = $80000030; + VTAG_SPRITERESN_SET = $80000031; + VTAG_SPRITERESN_GET = $80000032; + VTAG_PF1_TO_SPRITEPRI_SET = $80000033; + VTAG_PF1_TO_SPRITEPRI_GET = $80000034; + VTAG_PF2_TO_SPRITEPRI_SET = $80000035; + VTAG_PF2_TO_SPRITEPRI_GET = $80000036; + VTAG_IMMEDIATE = $80000037; + VTAG_FULLPALETTE_SET = $80000038; + VTAG_FULLPALETTE_GET = $80000039; + VTAG_FULLPALETTE_CLR = $8000003A; + VTAG_DEFSPRITERESN_SET = $8000003B; + VTAG_DEFSPRITERESN_GET = $8000003C; + +{ all the following tags follow the new, rational standard for videocontrol tags: + * VC_xxx,state set the state of attribute 'xxx' to value 'state' + * VC_xxx_QUERY,&var get the state of attribute 'xxx' and store it into the longword + * pointed to by &var. + * + * The following are new for V40: + } + + VC_IntermediateCLUpdate = $80000080; + { default=true. When set graphics will update the intermediate copper + * lists on color changes, etc. When false, it won't, and will be faster. + } + VC_IntermediateCLUpdate_Query = $80000081; + + VC_NoColorPaletteLoad = $80000082; + { default = false. When set, graphics will only load color 0 + * for this ViewPort, and so the ViewPort's colors will come + * from the previous ViewPort's. + * + * NB - Using this tag and VTAG_FULLPALETTE_SET together is undefined. + } + VC_NoColorPaletteLoad_Query = $80000083; + + VC_DUALPF_Disable = $80000084; + { default = false. When this flag is set, the dual-pf bit + in Dual-Playfield screens will be turned off. Even bitplanes + will still come from the first BitMap and odd bitplanes + from the second BitMap, and both R[xy]Offsets will be + considered. This can be used (with appropriate palette + selection) for cross-fades between differently scrolling + images. + When this flag is turned on, colors will be loaded for + the viewport as if it were a single viewport of depth + depth1+depth2 } + VC_DUALPF_Disable_Query = $80000085; + + +const + + SPRITE_ATTACHED = $80; + +type + + pSimpleSprite = ^tSimpleSprite; + tSimpleSprite = record + posctldata : Pointer; + height : Word; + x,y : Word; { current position } + num : Word; + end; + + pExtSprite = ^tExtSprite; + tExtSprite = record + es_SimpleSprite : tSimpleSprite; { conventional simple sprite structure } + es_wordwidth : WORD; { graphics use only, subject to change } + es_flags : WORD; { graphics use only, subject to change } + end; + +const +{ tags for AllocSpriteData() } + SPRITEA_Width = $81000000; + SPRITEA_XReplication = $81000002; + SPRITEA_YReplication = $81000004; + SPRITEA_OutputHeight = $81000006; + SPRITEA_Attached = $81000008; + SPRITEA_OldDataFormat = $8100000a; { MUST pass in outputheight if using this tag } + +{ tags for GetExtSprite() } + GSTAG_SPRITE_NUM = $82000020; + GSTAG_ATTACHED = $82000022; + GSTAG_SOFTSPRITE = $82000024; + +{ tags valid for either GetExtSprite or ChangeExtSprite } + GSTAG_SCANDOUBLED = $83000000; { request "NTSC-Like" height if possible. } + + +Type + pBitScaleArgs = ^tBitScaleArgs; + tBitScaleArgs = record + bsa_SrcX, bsa_SrcY, { source origin } + bsa_SrcWidth, bsa_SrcHeight, { source size } + bsa_XSrcFactor, bsa_YSrcFactor, { scale factor denominators } + bsa_DestX, bsa_DestY, { destination origin } + bsa_DestWidth, bsa_DestHeight, { destination size result } + bsa_XDestFactor, bsa_YDestFactor : Word; { scale factor numerators } + bsa_SrcBitMap, { source BitMap } + bsa_DestBitMap : pBitMap; { destination BitMap } + bsa_Flags : Cardinal; { reserved. Must be zero! } + bsa_XDDA, bsa_YDDA : Word; { reserved } + bsa_Reserved1, + bsa_Reserved2 : Longint; + END; + + { tag definitions for GetRPAttr, SetRPAttr } + +const + RPTAG_Font = $80000000; { get/set font } + RPTAG_APen = $80000002; { get/set apen } + RPTAG_BPen = $80000003; { get/set bpen } + RPTAG_DrMd = $80000004; { get/set draw mode } + RPTAG_OutlinePen = $80000005; { get/set outline pen. corrected case. } + RPTAG_WriteMask = $80000006; { get/set WriteMask } + RPTAG_MaxPen = $80000007; { get/set maxpen } + + RPTAG_DrawBounds = $80000008; { get only rastport draw bounds. pass &rect } + + + + +TYPE + + pRegionRectangle = ^tRegionRectangle; + tRegionRectangle = record + Next, Prev : pRegionRectangle; + bounds : tRectangle; + END; + + pRegion = ^tRegion; + tRegion = record + bounds : tRectangle; + RegionRectangle : pRegionRectangle; + END; + +type + + pGfxBase = ^tGfxBase; + tGfxBase = record + LibNode : tLibrary; + ActiView : pView; { ViewPtr } + copinit : pcopinit; { (copinitptr) ptr to copper start up list } + cia : Pointer; { for 8520 resource use } + blitter : Pointer; { for future blitter resource use } + LOFlist : Pointer; + SHFlist : Pointer; + blthd, + blttl : pbltnode; + bsblthd, + bsblttl : pbltnode; { Previous four are (bltnodeptr) } + vbsrv, + timsrv, + bltsrv : tInterrupt; + TextFonts : tList; + DefaultFont : pTextFont; { TextFontPtr } + Modes : Word; { copy of current first bplcon0 } + VBlank : Shortint; + Debug : Shortint; + BeamSync : smallint; + system_bplcon0 : smallint; { it is ored into each bplcon0 for display } + SpriteReserved : Byte; + bytereserved : Byte; + Flags : Word; + BlitLock : smallint; + BlitNest : smallint; + + BlitWaitQ : tList; + BlitOwner : pTask; { TaskPtr } + TOF_WaitQ : tList; + DisplayFlags : Word; { NTSC PAL GENLOC etc} + + { Display flags are determined at power on } + + SimpleSprites : Pointer; { SimpleSpritePtr ptr } + MaxDisplayRow : Word; { hardware stuff, do not use } + MaxDisplayColumn : Word; { hardware stuff, do not use } + NormalDisplayRows : Word; + NormalDisplayColumns : Word; + + { the following are for standard non interlace, 1/2 wb width } + + NormalDPMX : Word; { Dots per meter on display } + NormalDPMY : Word; { Dots per meter on display } + LastChanceMemory : pSignalSemaphore; { SignalSemaphorePtr } + LCMptr : Pointer; + MicrosPerLine : Word; { 256 time usec/line } + MinDisplayColumn : Word; + ChipRevBits0 : Byte; + MemType : Byte; + crb_reserved : Array[0..3] of Byte; + monitor_id : Word; { normally null } + hedley : Array[0..7] of Cardinal; + hedley_sprites : Array[0..7] of Cardinal; { sprite ptrs for intuition mouse } + hedley_sprites1 : Array[0..7] of Cardinal; { sprite ptrs for intuition mouse } + hedley_count : smallint; + hedley_flags : Word; + hedley_tmp : smallint; + hash_table : Pointer; + current_tot_rows : Word; + current_tot_cclks : Word; + hedley_hint : Byte; + hedley_hint2 : Byte; + nreserved : Array[0..3] of Cardinal; + a2024_sync_raster : Pointer; + control_delta_pal : Word; + control_delta_ntsc : Word; + current_monitor : pMonitorSpec; + MonitorList : tList; + default_monitor : pMonitorSpec; + MonitorListSemaphore : pSignalSemaphore; + DisplayInfoDataBase : Pointer; + TopLine : Word; + ActiViewCprSemaphore : pSignalSemaphore; + UtilityBase : Pointer; { for hook AND tag utilities } + ExecBase : Pointer; { to link with rom.lib } + bwshifts : Pointer; + StrtFetchMasks, + StopFetchMasks, + Overrun, + RealStops : Pointer; + SpriteWidth, { current width (in words) of sprites } + SpriteFMode : WORD; { current sprite fmode bits } + SoftSprites, { bit mask of size change knowledgeable sprites } + arraywidth : Shortint; + DefaultSpriteWidth : WORD; { what width intuition wants } + SprMoveDisable : Shortint; + WantChips, + BoardMemType, + Bugs : Byte; + gb_LayersBase : Pointer; + ColorMask : Cardinal; + IVector, + IData : Pointer; + SpecialCounter : Cardinal; { special for double buffering } + DBList : Pointer; + MonitorFlags : WORD; + ScanDoubledSprites, + BP3Bits : Byte; + MonitorVBlank : tAnalogSignalInterval; + natural_monitor : pMonitorSpec; + ProgData : Pointer; + ExtSprites : Byte; + pad3 : Byte; + GfxFlags : WORD; + VBCounter : Cardinal; + HashTableSemaphore : pSignalSemaphore; + HWEmul : Array[0..8] of Pointer; + end; + +const + + NTSC = 1; + GENLOC = 2; + PAL = 4; + TODA_SAFE = 8; + + BLITMSG_FAULT = 4; + +{ bits defs for ChipRevBits } + GFXB_BIG_BLITS = 0 ; + GFXB_HR_AGNUS = 0 ; + GFXB_HR_DENISE = 1 ; + GFXB_AA_ALICE = 2 ; + GFXB_AA_LISA = 3 ; + GFXB_AA_MLISA = 4 ; { internal use only. } + + GFXF_BIG_BLITS = 1 ; + GFXF_HR_AGNUS = 1 ; + GFXF_HR_DENISE = 2 ; + GFXF_AA_ALICE = 4 ; + GFXF_AA_LISA = 8 ; + GFXF_AA_MLISA = 16; { internal use only } + +{ Pass ONE of these to SetChipRev() } + SETCHIPREV_A = GFXF_HR_AGNUS; + SETCHIPREV_ECS = (GFXF_HR_AGNUS OR GFXF_HR_DENISE); + SETCHIPREV_AA = (GFXF_AA_ALICE OR GFXF_AA_LISA OR SETCHIPREV_ECS); + SETCHIPREV_BEST= $ffffffff; + +{ memory type } + BUS_16 = 0; + NML_CAS = 0; + BUS_32 = 1; + DBL_CAS = 2; + BANDWIDTH_1X = (BUS_16 OR NML_CAS); + BANDWIDTH_2XNML= BUS_32; + BANDWIDTH_2XDBL= DBL_CAS; + BANDWIDTH_4X = (BUS_32 OR DBL_CAS); + +{ GfxFlags (private) } + NEW_DATABASE = 1; + + GRAPHICSNAME : PChar = 'graphics.library'; + + +var + GfxBase : Pointer; + + +function BltBitMap(srcBitMap : pBitMap location 'a0'; xSrc : LongInt location 'd0'; ySrc : LongInt location 'd1'; destBitMap : pBitMap location 'a1'; xDest : LongInt location 'd2'; yDest : LongInt location 'd3'; xSize : LongInt location 'd4'; ySize : LongInt location 'd5'; minterm : CARDINAL location 'd6'; mask : CARDINAL location 'd7'; tempA : pCHAR location 'a2') : LongInt; +SysCall GfxBase 030; + +procedure BltTemplate(source : pCHAR location 'a0'; xSrc : LongInt location 'd0'; srcMod : LongInt location 'd1'; destRP : pRastPort location 'a1'; xDest : LongInt location 'd2'; yDest : LongInt location 'd3'; xSize : LongInt location 'd4'; ySize : LongInt location 'd5'); +SysCall GfxBase 036; + +procedure ClearEOL(rp : pRastPort location 'a1'); +SysCall GfxBase 042; + +procedure ClearScreen(rp : pRastPort location 'a1'); +SysCall GfxBase 048; + +function TextLength(rp : pRastPort location 'a1'; string1 : pSHORTINT location 'a0'; count : CARDINAL location 'd0') : INTEGER; +SysCall GfxBase 054; + +function Text(rp : pRastPort location 'a1'; string1: pSHORTINT location 'a0'; count : CARDINAL location 'd0') : LongInt; +SysCall GfxBase 060; + +function SetFont(rp : pRastPort location 'a1'; textFont : pTextFont location 'a0') : LongInt; +SysCall GfxBase 066; + +function OpenFont(textAttr : pTextAttr location 'a0') : pTextFont; +SysCall GfxBase 072; + +procedure CloseFont(textFont : pTextFont location 'a1'); +SysCall GfxBase 078; + +function AskSoftStyle(rp : pRastPort location 'a1') : CARDINAL; +SysCall GfxBase 084; + +function SetSoftStyle(rp : pRastPort location 'a1'; style : CARDINAL location 'd0'; enable : CARDINAL location 'd1') : CARDINAL; +SysCall GfxBase 090; + +procedure AddBob(bob : pBob location 'a0'; rp : pRastPort location 'a1'); +SysCall GfxBase 096; + +procedure AddVSprite(vSprite : pVSprite location 'a0'; rp : pRastPort location 'a1'); +SysCall GfxBase 102; + +procedure DoCollision(rp : pRastPort location 'a1'); +SysCall GfxBase 108; + +procedure DrawGList(rp : pRastPort location 'a1'; vp : pViewPort location 'a0'); +SysCall GfxBase 114; + +procedure InitGels(head : pVSprite location 'a0'; tail : pVSprite location 'a1'; gelsInfo : pGelsInfo location 'a2'); +SysCall GfxBase 120; + +procedure InitMasks(vSprite : pVSprite location 'a0'); +SysCall GfxBase 126; + +procedure RemIBob(bob : pBob location 'a0'; rp : pRastPort location 'a1'; vp : pViewPort location 'a2'); +SysCall GfxBase 132; + +procedure RemVSprite(vSprite : pVSprite location 'a0'); +SysCall GfxBase 138; + +procedure SortGList(rp : pRastPort location 'a1'); +SysCall GfxBase 150; + +procedure AddAnimOb(anOb : pAnimOb location 'a0'; anKey : ppAnimOb location 'a1'; rp : pRastPort location 'a2'); +SysCall GfxBase 156; + +procedure Animate(anKey : ppAnimOb location 'a0'; rp : pRastPort location 'a1'); +SysCall GfxBase 162; + +function GetGBuffers(anOb : pAnimOb location 'a0'; rp : pRastPort location 'a1'; flag : LongInt location 'd0') : LongBool; +SysCall GfxBase 168; + +procedure InitGMasks(anOb : pAnimOb location 'a0'); +SysCall GfxBase 174; + +procedure DrawEllipse(rp : pRastPort location 'a1'; xCenter : LongInt location 'd0'; yCenter : LongInt location 'd1'; a : LongInt location 'd2'; b : LongInt location 'd3'); +SysCall GfxBase 180; + +function AreaEllipse(rp : pRastPort location 'a1'; xCenter : LongInt location 'd0'; yCenter : LongInt location 'd1'; a : LongInt location 'd2'; b : LongInt location 'd3') : LongInt; +SysCall GfxBase 186; + +procedure LoadRGB4(vp : pViewPort location 'a0'; VAR colors : Integer location 'a1'; count : LongInt location 'd0'); +SysCall GfxBase 192; + +procedure InitRastPort(rp : pRastPort location 'a1'); +SysCall GfxBase 198; + +procedure InitVPort(vp : pViewPort location 'a0'); +SysCall GfxBase 204; + +function MrgCop(view : pView location 'a1') : CARDINAL; +SysCall GfxBase 210; + +function MakeVPort(view : pView location 'a0'; vp : pViewPort location 'a1') : CARDINAL; +SysCall GfxBase 216; + +procedure LoadView(view : pView location 'a1'); +SysCall GfxBase 222; + +procedure WaitBlit; +SysCall GfxBase 228; + +procedure SetRast(rp : pRastPort location 'a1'; pen : CARDINAL location 'd0'); +SysCall GfxBase 234; + +procedure gfxMove(rp : pRastPort location 'a1'; x : LongInt location 'd0'; y : LongInt location 'd1'); +SysCall GfxBase 240; + +procedure Draw(rp : pRastPort location 'a1'; x : LongInt location 'd0'; y : LongInt location 'd1'); +SysCall GfxBase 246; + +function AreaMove(rp : pRastPort location 'a1'; x : LongInt location 'd0'; y : LongInt location 'd1') : LongInt; +SysCall GfxBase 252; + +function AreaDraw(rp : pRastPort location 'a1'; x : LongInt location 'd0'; y : LongInt location 'd1') : LongInt; +SysCall GfxBase 258; + +function AreaEnd(rp : pRastPort location 'a1') : LongInt; +SysCall GfxBase 264; + +procedure WaitTOF; +SysCall GfxBase 270; + +procedure QBlit(blit : pbltnode location 'a1'); +SysCall GfxBase 276; + +procedure InitArea(areaInfo : pAreaInfo location 'a0'; vectorBuffer : POINTER location 'a1'; maxVectors : LongInt location 'd0'); +SysCall GfxBase 282; + +procedure SetRGB4(vp : pViewPort location 'a0'; index : LongInt location 'd0'; red : CARDINAL location 'd1'; green : CARDINAL location 'd2'; blue : CARDINAL location 'd3'); +SysCall GfxBase 288; + +procedure QBSBlit(blit : pbltnode location 'a1'); +SysCall GfxBase 294; + +procedure BltClear(memBlock : pCHAR location 'a1'; byteCount : CARDINAL location 'd0'; flags : CARDINAL location 'd1'); +SysCall GfxBase 300; + +procedure RectFill(rp : pRastPort location 'a1'; xMin : LongInt location 'd0'; yMin : LongInt location 'd1'; xMax : LongInt location 'd2'; yMax : LongInt location 'd3'); +SysCall GfxBase 306; + +procedure BltPattern(rp : pRastPort location 'a1'; mask : pCHAR location 'a0'; xMin : LongInt location 'd0'; yMin : LongInt location 'd1'; xMax : LongInt location 'd2'; yMax : LongInt location 'd3'; maskBPR : CARDINAL location 'd4'); +SysCall GfxBase 312; + +function ReadPixel(rp : pRastPort location 'a1'; x : LongInt location 'd0'; y : LongInt location 'd1') : CARDINAL; +SysCall GfxBase 318; + +function WritePixel(rp : pRastPort location 'a1'; x : LongInt location 'd0'; y : LongInt location 'd1') : LongInt; +SysCall GfxBase 324; + +function Flood(rp : pRastPort location 'a1'; mode : CARDINAL location 'd2'; x : LongInt location 'd0'; y : LongInt location 'd1') : LongBool; +SysCall GfxBase 330; + +procedure PolyDraw(rp : pRastPort location 'a1'; count : LongInt location 'd0'; VAR polyTable : INTEGER location 'a0'); +SysCall GfxBase 336; + +procedure SetAPen(rp : pRastPort location 'a1'; pen : CARDINAL location 'd0'); +SysCall GfxBase 342; + +procedure SetBPen(rp : pRastPort location 'a1'; pen : CARDINAL location 'd0'); +SysCall GfxBase 348; + +procedure SetDrMd(rp : pRastPort location 'a1'; drawMode : CARDINAL location 'd0'); +SysCall GfxBase 354; + +procedure InitView(view : pView location 'a1'); +SysCall GfxBase 360; + +procedure CBump(copList : pUCopList location 'a1'); +SysCall GfxBase 366; + +procedure CMove(copList : pUCopList location 'a1'; destination : POINTER location 'd0'; data : LongInt location 'd1'); +SysCall GfxBase 372; + +procedure CWait(copList : pUCopList location 'a1'; v : LongInt location 'd0'; h : LongInt location 'd1'); +SysCall GfxBase 378; + +function VBeamPos : LongInt; +SysCall GfxBase 384; + +procedure InitBitMap(bitMap : pBitMap location 'a0'; depth : LongInt location 'd0'; width : LongInt location 'd1'; height : LongInt location 'd2'); +SysCall GfxBase 390; + +procedure ScrollRaster(rp : pRastPort location 'a1'; dx : LongInt location 'd0'; dy : LongInt location 'd1'; xMin : LongInt location 'd2'; yMin : LongInt location 'd3'; xMax : LongInt location 'd4'; yMax : LongInt location 'd5'); +SysCall GfxBase 396; + +procedure WaitBOVP(vp : pViewPort location 'a0'); +SysCall GfxBase 402; + +function GetSprite(sprite : pSimpleSprite location 'a0'; num : LongInt location 'd0') : INTEGER; +SysCall GfxBase 408; + +procedure FreeSprite(num : LongInt location 'd0'); +SysCall GfxBase 414; + +procedure ChangeSprite(vp : pViewPort location 'a0'; sprite : pSimpleSprite location 'a1'; VAR newData : Integer location 'a2'); +SysCall GfxBase 420; + +procedure MoveSprite(vp : pViewPort location 'a0'; sprite : pSimpleSprite location 'a1'; x : LongInt location 'd0'; y : LongInt location 'd1'); +SysCall GfxBase 426; + +procedure LockLayerRom(layer : pLayer location 'a5'); +SysCall GfxBase 432; + +procedure UnlockLayerRom(layer : pLayer location 'a5'); +SysCall GfxBase 438; + +procedure SyncSBitMap(layer : pLayer location 'a0'); +SysCall GfxBase 444; + +procedure CopySBitMap(layer : pLayer location 'a0'); +SysCall GfxBase 450; + +procedure OwnBlitter; +SysCall GfxBase 456; + +procedure DisownBlitter; +SysCall GfxBase 462; + +function InitTmpRas(tmpRas : pTmpRas location 'a0'; buffer : pCHAR location 'a1'; size : LongInt location 'd0') : pTmpRas; +SysCall GfxBase 468; + +procedure AskFont(rp : pRastPort location 'a1'; textAttr : pTextAttr location 'a0'); +SysCall GfxBase 474; + +procedure AddFont(textFont : pTextFont location 'a1'); +SysCall GfxBase 480; + +procedure RemFont(textFont : pTextFont location 'a1'); +SysCall GfxBase 486; + +function AllocRaster(width : CARDINAL location 'd0'; height : CARDINAL location 'd1') : pCHAR; +SysCall GfxBase 492; + +procedure FreeRaster(p : pCHAR location 'a0'; width : CARDINAL location 'd0'; height : CARDINAL location 'd1'); +SysCall GfxBase 498; + +procedure AndRectRegion(region : pRegion location 'a0'; rectangle : pRectangle location 'a1'); +SysCall GfxBase 504; + +function OrRectRegion(region : pRegion location 'a0'; rectangle : pRectangle location 'a1') : LongBool; +SysCall GfxBase 510; + +function NewRegion : pRegion; +SysCall GfxBase 516; + +function ClearRectRegion(region : pRegion location 'a0'; rectangle : pRectangle location 'a1') : LongBool; +SysCall GfxBase 522; + +procedure ClearRegion(region : pRegion location 'a0'); +SysCall GfxBase 528; + +procedure DisposeRegion(region : pRegion location 'a0'); +SysCall GfxBase 534; + +procedure FreeVPortCopLists(vp : pViewPort location 'a0'); +SysCall GfxBase 540; + +procedure FreeCopList(copList : pCopList location 'a0'); +SysCall GfxBase 546; + +procedure ClipBlit(srcRP : pRastPort location 'a0'; xSrc : LongInt location 'd0'; ySrc : LongInt location 'd1'; destRP : pRastPort location 'a1'; xDest : LongInt location 'd2'; yDest : LongInt location 'd3'; xSize : LongInt location 'd4'; ySize : LongInt location 'd5'; minterm : CARDINAL location 'd6'); +SysCall GfxBase 552; + +function XorRectRegion(region : pRegion location 'a0'; rectangle : pRectangle location 'a1') : LongBool; +SysCall GfxBase 558; + +procedure FreeCprList(cprList : pcprlist location 'a0'); +SysCall GfxBase 564; + +function GetColorMap(entries : LongInt location 'd0') : pColorMap; +SysCall GfxBase 570; + +procedure FreeColorMap(colorMap : pColorMap location 'a0'); +SysCall GfxBase 576; + +function GetRGB4(colorMap : pColorMap location 'a0'; entry : LongInt location 'd0') : CARDINAL; +SysCall GfxBase 582; + +procedure ScrollVPort(vp : pViewPort location 'a0'); +SysCall GfxBase 588; + +function UCopperListInit(uCopList : pUCopList location 'a0'; n : LongInt location 'd0') : pCopList; +SysCall GfxBase 594; + +procedure FreeGBuffers(anOb : pAnimOb location 'a0'; rp : pRastPort location 'a1'; flag : LongInt location 'd0'); +SysCall GfxBase 600; + +procedure BltBitMapRastPort(srcBitMap : pBitMap location 'a0'; xSrc : LongInt location 'd0'; ySrc : LongInt location 'd1'; destRP : pRastPort location 'a1'; xDest : LongInt location 'd2'; yDest : LongInt location 'd3'; xSize : LongInt location 'd4'; ySize : LongInt location 'd5'; minterm : CARDINAL location 'd6'); +SysCall GfxBase 606; + +function OrRegionRegion(srcRegion : pRegion location 'a0'; destRegion : pRegion location 'a1') : LongBool; +SysCall GfxBase 612; + +function XorRegionRegion(srcRegion : pRegion location 'a0'; destRegion : pRegion location 'a1') : LongBool; +SysCall GfxBase 618; + +function AndRegionRegion(srcRegion : pRegion location 'a0'; destRegion : pRegion location 'a1') : LongBool; +SysCall GfxBase 624; + +procedure SetRGB4CM(colorMap : pColorMap location 'a0'; index : LongInt location 'd0'; red : CARDINAL location 'd1'; green : CARDINAL location 'd2'; blue : CARDINAL location 'd3'); +SysCall GfxBase 630; + +procedure BltMaskBitMapRastPort(srcBitMap : pBitMap location 'a0'; xSrc : LongInt location 'd0'; ySrc : LongInt location 'd1'; destRP : pRastPort location 'a1'; xDest : LongInt location 'd2'; yDest : LongInt location 'd3'; xSize : LongInt location 'd4'; ySize : LongInt location 'd5'; minterm : CARDINAL location 'd6'; bltMask : pCHAR location 'a2'); +SysCall GfxBase 636; + +function AttemptLockLayerRom(layer : pLayer location 'a5') : LongBool; +SysCall GfxBase 654; + +function GfxNew(gfxNodeType : CARDINAL location 'd0') : POINTER; +SysCall GfxBase 660; + +procedure GfxFree(gfxNodePtr : POINTER location 'a0'); +SysCall GfxBase 666; + +procedure GfxAssociate(associateNode : POINTER location 'a0'; gfxNodePtr : POINTER location 'a1'); +SysCall GfxBase 672; + +procedure BitMapScale(bitScaleArgs : pBitScaleArgs location 'a0'); +SysCall GfxBase 678; + +function ScalerDiv(factor : CARDINAL location 'd0'; numerator : CARDINAL location 'd1'; denominator : CARDINAL location 'd2') : Integer; +SysCall GfxBase 684; + +function TextExtent(rp : pRastPort location 'a1'; string1: pSHORTINT location 'a0'; count : LongInt location 'd0'; textExtent : pTextExtent location 'a2') : INTEGER; +SysCall GfxBase 690; + +function TextFit(rp : pRastPort location 'a1'; string1: pSHORTINT location 'a0'; strLen : CARDINAL location 'd0'; textExtent : pTextExtent location 'a2'; constrainingExtent : pTextExtent location 'a3'; strDirection : LongInt location 'd1'; constrainingBitWidth : CARDINAL location 'd2'; constrainingBitHeight : CARDINAL location 'd3') : CARDINAL; +SysCall GfxBase 696; + +function GfxLookUp(associateNode : POINTER location 'a0') : POINTER; +SysCall GfxBase 702; + +function VideoControl(colorMap : pColorMap location 'a0'; tagarray : pTagItem location 'a1') : LongBool; +SysCall GfxBase 708; + +function OpenMonitor(monitorName : pSHORTINT location 'a1'; displayID : CARDINAL location 'd0') : pMonitorSpec; +SysCall GfxBase 714; + +function CloseMonitor(monitorSpec : pMonitorSpec location 'a0') : LongBool; +SysCall GfxBase 720; + +function FindDisplayInfo(displayID : CARDINAL location 'd0') : POINTER; +SysCall GfxBase 726; + +function NextDisplayInfo(displayID : CARDINAL location 'd0') : CARDINAL; +SysCall GfxBase 732; + +function GetDisplayInfoData(handle : POINTER location 'a0'; buf : POINTER location 'a1'; size : CARDINAL location 'd0'; tagID : CARDINAL location 'd1'; displayID : CARDINAL location 'd2') : CARDINAL; +SysCall GfxBase 756; + +procedure FontExtent(font : pTextFont location 'a0'; fontExtent : pTextExtent location 'a1'); +SysCall GfxBase 762; + +function ReadPixelLine8(rp : pRastPort location 'a0'; xstart : CARDINAL location 'd0'; ystart : CARDINAL location 'd1'; width : CARDINAL location 'd2'; array1 : pCHAR location 'a2'; tempRP : pRastPort location 'a1') : LongInt; +SysCall GfxBase 768; + +function WritePixelLine8(rp : pRastPort location 'a0'; xstart : CARDINAL location 'd0'; ystart : CARDINAL location 'd1'; width : CARDINAL location 'd2'; array1 : pCHAR location 'a2'; tempRP : pRastPort location 'a1') : LongInt; +SysCall GfxBase 774; + +function ReadPixelArray8(rp : pRastPort location 'a0'; xstart : CARDINAL location 'd0'; ystart : CARDINAL location 'd1'; xstop : CARDINAL location 'd2'; ystop : CARDINAL location 'd3'; array1: pCHAR location 'a2'; temprp : pRastPort location 'a1') : LongInt; +SysCall GfxBase 780; + +function WritePixelArray8(rp : pRastPort location 'a0'; xstart : CARDINAL location 'd0'; ystart : CARDINAL location 'd1'; xstop : CARDINAL location 'd2'; ystop : CARDINAL location 'd3'; array1: pCHAR location 'a2'; temprp : pRastPort location 'a1') : LongInt; +SysCall GfxBase 786; + +function GetVPModeID(vp : pViewPort location 'a0') : LongInt; +SysCall GfxBase 792; + +function ModeNotAvailable(modeID : CARDINAL location 'd0') : LongInt; +SysCall GfxBase 798; + +function WeighTAMatch(reqTextAttr : pTTextAttr location 'a0'; targetTextAttr : pTextAttr location 'a1'; targetTags : pTagItem location 'a2') : INTEGER; +SysCall GfxBase 804; + +procedure EraseRect(rp : pRastPort location 'a1'; xMin : LongInt location 'd0'; yMin : LongInt location 'd1'; xMax : LongInt location 'd2'; yMax : LongInt location 'd3'); +SysCall GfxBase 810; + +function ExtendFont(font : pTextFont location 'a0'; fontTags : pTagItem location 'a1') : CARDINAL; +SysCall GfxBase 816; + +procedure StripFont(font : pTextFont location 'a0'); +SysCall GfxBase 822; + +function CalcIVG(v : pView location 'a0'; vp : pViewPort location 'a1') : Integer; +SysCall GfxBase 828; + +function AttachPalExtra(cm : pColorMap location 'a0'; vp : pViewPort location 'a1') : LongInt; +SysCall GfxBase 834; + +function ObtainBestPenA(cm : pColorMap location 'a0'; r : CARDINAL location 'd1'; g : CARDINAL location 'd2'; b : CARDINAL location 'd3'; tags : pTagItem location 'a1') : LongInt; +SysCall GfxBase 840; + +procedure SetRGB32(vp : pViewPort location 'a0'; n : CARDINAL location 'd0'; r : CARDINAL location 'd1'; g : CARDINAL location 'd2'; b : CARDINAL location 'd3'); +SysCall GfxBase 852; + +function GetAPen(rp : pRastPort location 'a0') : CARDINAL; +SysCall GfxBase 858; + +function GetBPen(rp : pRastPort location 'a0') : CARDINAL; +SysCall GfxBase 864; + +function GetDrMd(rp : pRastPort location 'a0') : CARDINAL; +SysCall GfxBase 870; + +function GetOutlinePen(rp : pRastPort location 'a0') : CARDINAL; +SysCall GfxBase 876; + +procedure LoadRGB32(vp : pViewPort location 'a0'; VAR table : CARDINAL location 'a1'); +SysCall GfxBase 882; + +function SetChipRev(want : CARDINAL location 'd0') : CARDINAL; +SysCall GfxBase 888; + +procedure SetABPenDrMd(rp : pRastPort location 'a1'; apen : CARDINAL location 'd0'; bpen : CARDINAL location 'd1'; drawmode : CARDINAL location 'd2'); +SysCall GfxBase 894; + +procedure GetRGB32(cm : pColorMap location 'a0'; firstcolor : CARDINAL location 'd0'; ncolors : CARDINAL location 'd1'; VAR table : CARDINAL location 'a1'); +SysCall GfxBase 900; + +function AllocBitMap(sizex : CARDINAL location 'd0'; sizey : CARDINAL location 'd1'; depth : CARDINAL location 'd2'; flags : CARDINAL location 'd3'; friend_bitmap : pBitMap location 'a0') : pBitMap; +SysCall GfxBase 918; + +procedure FreeBitMap(bm : pBitMap location 'a0'); +SysCall GfxBase 924; + +function GetExtSpriteA(ss : pExtSprite location 'a2'; tags : pTagItem location 'a1') : LongInt; +SysCall GfxBase 930; + +function CoerceMode(vp : pViewPort location 'a0'; monitorid : CARDINAL location 'd0'; flags : CARDINAL location 'd1') : CARDINAL; +SysCall GfxBase 936; + +procedure ChangeVPBitMap(vp : pViewPort location 'a0'; bm : pBitMap location 'a1'; db : pDBufInfo location 'a2'); +SysCall GfxBase 942; + +procedure ReleasePen(cm : pColorMap location 'a0'; n : CARDINAL location 'd0'); +SysCall GfxBase 948; + +function ObtainPen(cm : pColorMap location 'a0'; n : longint location 'd0'; r : CARDINAL location 'd1'; g : CARDINAL location 'd2'; b : CARDINAL location 'd3'; f : LongInt location 'd4') : CARDINAL; +SysCall GfxBase 954; + +function GetBitMapAttr(bm : pBitMap location 'a0'; attrnum : CARDINAL location 'd1') : CARDINAL; +SysCall GfxBase 960; + +function AllocDBufInfo(vp : pViewPort location 'a0') : pDBufInfo; +SysCall GfxBase 966; + +procedure FreeDBufInfo(dbi : pDBufInfo location 'a1'); +SysCall GfxBase 972; + +function SetOutlinePen(rp : pRastPort location 'a0'; pen : CARDINAL location 'd0') : CARDINAL; +SysCall GfxBase 978; + +function SetWriteMask(rp : pRastPort location 'a0'; msk : CARDINAL location 'd0') : CARDINAL; +SysCall GfxBase 984; + +procedure SetMaxPen(rp : pRastPort location 'a0'; maxpen : CARDINAL location 'd0'); +SysCall GfxBase 990; + +procedure SetRGB32CM(cm : pColorMap location 'a0'; n : CARDINAL location 'd0'; r : CARDINAL location 'd1'; g : CARDINAL location 'd2'; b : CARDINAL location 'd3'); +SysCall GfxBase 996; + +procedure ScrollRasterBF(rp : pRastPort location 'a1'; dx : LongInt location 'd0'; dy : LongInt location 'd1'; xMin : LongInt location 'd2'; yMin : LongInt location 'd3'; xMax : LongInt location 'd4'; yMax : LongInt location 'd5'); +SysCall GfxBase 1002; + +function FindColor(cm : pColorMap location 'a3'; r : CARDINAL location 'd1'; g : CARDINAL location 'd2'; b : CARDINAL location 'd3'; maxcolor : LongInt location 'd4') : LongInt; +SysCall GfxBase 1008; + +function AllocSpriteDataA(bm : pBitMap location 'a2'; tags : pTagItem location 'a1') : pExtSprite; +SysCall GfxBase 1020; + +function ChangeExtSpriteA(vp : pViewPort location 'a0'; oldsprite : pExtSprite location 'a1'; newsprite : pExtSprite location 'a2'; tags : pTagItem location 'a3') : LongInt; +SysCall GfxBase 1026; + +procedure FreeSpriteData(sp : pExtSprite location 'a2'); +SysCall GfxBase 1032; + +procedure SetRPAttrsA(rp : pRastPort location 'a0'; tags : pTagItem location 'a1'); +SysCall GfxBase 1038; + +procedure GetRPAttrsA(rp : pRastPort location 'a0'; tags : pTagItem location 'a1'); +SysCall GfxBase 1044; + +function BestModeIDA(tags : pTagItem location 'a0') : CARDINAL; +SysCall GfxBase 1050; + +procedure WriteChunkyPixels(rp : pRastPort location 'a0'; xstart : CARDINAL location 'd0'; ystart : CARDINAL location 'd1'; xstop : CARDINAL location 'd2'; ystop : CARDINAL location 'd3'; array1: pCHAR location 'a2'; bytesperrow : LongInt location 'd4'); +SysCall GfxBase 1056; + +function OpenFontTagList(textattr : pTextAttr location 'a0'; tags : pTagItem location 'a1') : pTextFont; +SysCall GfxBase 1062; + + +{ gfxmacros } +procedure BNDRYOFF (w: pRastPort); +procedure InitAnimate (animkey: ppAnimOb); +procedure SetAfPt(w: pRastPort;p: Pointer; n: Byte); +procedure SetDrPt(w: pRastPort;p: Word); +procedure SetOPen(w: pRastPort;c: Byte); +procedure SetWrMsk(w: pRastPort; m: Byte); + +procedure SafeSetOutlinePen(w : pRastPort; c : byte); +procedure SafeSetWriteMask( w : pRastPort ; m : smallint ) ; + +procedure OFF_DISPLAY (cust: pCustom); +procedure ON_DISPLAY (cust: pCustom); +procedure OFF_SPRITE (cust: pCustom); +procedure ON_SPRITE (cust: pCustom); +procedure OFF_VBLANK (cust: pCustom); +procedure ON_VBLANK (cust: pCustom); + +{ unit/library initialization } +function InitGraphicsLibrary : boolean; + + + +implementation + + +procedure BNDRYOFF (w: pRastPort); +begin + with w^ do Flags := Flags And (Not AREAOUTLINE); +end; + +procedure InitAnimate (animkey: ppAnimOb); +begin + animkey^ := NIL; +end; + +procedure SetAfPt(w: pRastPort;p: Pointer; n: Byte); +begin + with w^ do begin + ArePointern := p; + AreaPtSz := n; + end; +end; + +procedure SetDrPt(w: pRastPort;p: Word); +begin + with w^ do begin + LinePtrn := p; + Flags := Flags or FRST_doT; + linpatcnt := 15; + end; +end; + +procedure SetOPen(w: pRastPort;c: Byte); +begin + with w^ do begin + AOlPen := c; + Flags := Flags or AREAOUTLINE; + end; +end; + +{ This function is fine, but For OS39 the SetWriteMask() gfx function + should be prefered because it SHOULD operate with gfx boards as well. + At least I hope it does.... } +procedure SetWrMsk(w: pRastPort; m: Byte); +begin + w^.Mask := m; +end; + +procedure SafeSetOutlinePen(w : pRastPort; c : byte); +begin + IF pGfxBase(GfxBase)^.LibNode.Lib_Version < 39 THEN begin + w^.AOlPen := c; + w^.Flags := w^.Flags or AREAOUTLINE; + end ELSE begin + c := SetOutlinePen(w,c); + end; +end; + +procedure SafeSetWriteMask( w : pRastPort ; m : smallint ) ; + VAR x : smallint ; +begin + IF pGfxBase(GfxBase)^.LibNode.Lib_Version < 39 THEN w^.Mask := BYTE(m) + ELSE x := SetWriteMask( w, m ); +end; + +procedure OFF_DISPLAY (cust: pCustom); +begin + cust^.dmacon := BITCLR or DMAF_RASTER; +end; + +procedure ON_DISPLAY (cust: pCustom); +begin + cust^.dmacon := BITSET or DMAF_RASTER; +end; + +procedure OFF_SPRITE (cust: pCustom); +begin + cust^.dmacon := BITCLR or DMAF_SPRITE; +end; + +procedure ON_SPRITE (cust: pCustom); +begin + cust^.dmacon := BITSET or DMAF_SPRITE; +end; + +procedure OFF_VBLANK (cust: pCustom); +begin + cust^.intena := BITCLR or INTF_VERTB; +end; + +procedure ON_VBLANK (cust: pCustom); +begin + cust^.intena := BITSET or INTF_VERTB; +end; + + +const + { Change VERSION and LIBVERSION to proper values } + VERSION : string[2] = '50'; + LIBVERSION : longword = 50; + +var + graphics_exit : Pointer; + +procedure CloseGraphicsLibrary; +begin + ExitProc := graphics_exit; + if GfxBase <> nil then begin + CloseLibrary(GfxBase); + GfxBase := nil; + end; +end; + +function InitGraphicsLibrary : boolean; +begin + GfxBase := nil; + GfxBase := OpenLibrary(GRAPHICSNAME,LIBVERSION); + if GfxBase <> nil then begin + graphics_exit := ExitProc; + ExitProc := @CloseGraphicsLibrary; + InitGraphicsLibrary:=True; + end else begin + InitGraphicsLibrary:=False; + end; +end; + +end. diff --git a/packages/morphunits/src/ahi.pas b/packages/morphunits/src/ahi.pas new file mode 100644 index 0000000000..ed9ed9c5e1 --- /dev/null +++ b/packages/morphunits/src/ahi.pas @@ -0,0 +1,630 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2005 Karoly Balogh for Genesi S.a.r.l. + + ahi.library interface unit for MorphOS/PowerPC + + Based on work of Nils Sjoholm member of the Amiga RTL + development team. + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + +**********************************************************************} + +{$PACKRECORDS 2} +unit AHI; + +interface + +uses exec, utility; + +var + AHIBase: PLibrary; + + type + + PFixed = ^Fixed; + Fixed = LONGINT; + { A fixed-point value, 16 bits + to the left of the point and + 16 bits to the right } + + type + + Psposition = ^sposition; + sposition = Fixed; + + { AHIAudioCtrl } + { Lots of private data follows! } + PAHIAudioCtrl = ^tAHIAudioCtrl; + tAHIAudioCtrl = record + ahiac_UserData : Pointer; + end; + + { AHISoundMessage } + PAHISoundMessage = ^tAHISoundMessage; + tAHISoundMessage = record + ahism_Channel : Word; + end; + + { AHIRecordMessage } + PAHIRecordMessage = ^tAHIRecordMessage; + tAHIRecordMessage = record + ahirm_Type : Cardinal; { Format of buffer (object) } + ahirm_Buffer : Pointer; { Pointer to the sample array } + ahirm_Length : Cardinal; { Number of sample frames in buffer } + end; + + { AHISampleInfo } + PAHISampleInfo = ^tAHISampleInfo; + tAHISampleInfo = record + ahisi_Type : Cardinal; { Format of samples } + ahisi_Address : Pointer; { Address to array of samples } + ahisi_Length : Cardinal; { Number of samples in array } + end; + + { AHIAudioModeRequester } + PAHIAudioModeRequester = ^tAHIAudioModeRequester; + tAHIAudioModeRequester = record + ahiam_AudioID : Cardinal; { Selected audio mode } + ahiam_MixFreq : Cardinal; { Selected mixing/sampling frequency } + ahiam_LeftEdge : WORD; { Coordinates of requester on exit } + ahiam_TopEdge : WORD; + ahiam_Width : WORD; + ahiam_Height : WORD; + ahiam_InfoOpened : Boolean; { Info window opened on exit? } + ahiam_InfoLeftEdge : WORD; { Last coordinates of Info window } + ahiam_InfoTopEdge : WORD; + ahiam_InfoWidth : WORD; + ahiam_InfoHeight : WORD; + ahiam_UserData : Pointer; { You can store your own data here } + { Lots of private data follows! } + end; + + { AHIEffMasterVolume } + PAHIEffMasterVolume = ^tAHIEffMasterVolume; + tAHIEffMasterVolume = record + ahie_Effect : Cardinal; { Set to AHIET_MASTERVOLUME } + ahiemv_Volume : Fixed; { See autodocs for range! } + end; + + { AHIEffOutputBuffer } + PAHIEffOutputBuffer = ^tAHIEffOutputBuffer; + tAHIEffOutputBuffer = record + ahie_Effect : Cardinal; { Set to AHIET_OUTPUTBUFFER } + ahieob_Func : PHook; + { These fields are filled by AHI } + ahieob_Type : Cardinal; { Format of buffer } + ahieob_Buffer : Pointer; { Pointer to the sample array } + ahieob_Length : Cardinal; { Number of sample frames in buffer } + end; + + { AHIEffDSPMask (V4) } + PAHIEffDSPMask = ^tAHIEffDSPMask; + tAHIEffDSPMask = record + ahie_Effect : Cardinal; { Set to AHIET_DSPMASK } + ahiedm_Channels : Word; { Number of elements in array } + ahiedm_Mask : array[0..0] of Byte; { Here follows the array } + end; + + + const + AHIEDM_WET = 0; + AHIEDM_DRY = 1; + { AHIEffDSPEcho (V4) } + type + PAHIDSPEcho = ^tAHIDSPEcho; + tAHIDSPEcho = record + ahie_Effect : Cardinal; { Set to AHIET_DSPECHO } + ahiede_Delay : Cardinal; { In samples } + ahiede_Feedback : Fixed; + ahiede_Mix : Fixed; + ahiede_Cross : Fixed; + end; + + { AHIEffChannelInfo (V4) } + PAHIEffChannelInfo = ^tAHIEffChannelInfo; + tAHIEffChannelInfo = record + ahie_Effect : Cardinal; { Set to AHIET_CHANNELINFO } + ahieci_Func : PHook; + ahieci_Channels : Word; + ahieci_Pad : Word; + { The rest is filled by AHI } + ahieci_Offset : array[0..0] of Cardinal; { The array follows } + end; + + { TAGS } + + const + AHI_TagBase = TAG_USER; + AHI_TagBaseR = AHI_TagBase or $8000; + { AHI_AllocAudioA tags } + { Desired audio mode } + AHIA_AudioID = AHI_TagBase + 1; + { Suggested mixing frequency } + AHIA_MixFreq = AHI_TagBase + 2; + { Suggested number of channels } + AHIA_Channels = AHI_TagBase + 3; + { Number of sounds to use } + AHIA_Sounds = AHI_TagBase + 4; + { End-of-Sound Hook } + AHIA_SoundFunc = AHI_TagBase + 5; + { Player Hook } + AHIA_PlayerFunc = AHI_TagBase + 6; + { Frequency for player Hook (Fixed) } + AHIA_PlayerFreq = AHI_TagBase + 7; + { Minimum Frequency for player Hook } + AHIA_MinPlayerFreq = AHI_TagBase + 8; + { Maximum Frequency for player Hook } + AHIA_MaxPlayerFreq = AHI_TagBase + 9; + { Sample recording Hook } + AHIA_RecordFunc = AHI_TagBase + 10; + { What to put in ahiac_UserData } + AHIA_UserData = AHI_TagBase + 11; + { AHI_PlayA tags (V4) } + { All command tags should be... } + AHIP_BeginChannel = AHI_TagBase + 40; + { ... enclosed by these tags. } + AHIP_EndChannel = AHI_TagBase + 41; + AHIP_Freq = AHI_TagBase + 50; + AHIP_Vol = AHI_TagBase + 51; + AHIP_Pan = AHI_TagBase + 52; + AHIP_Sound = AHI_TagBase + 53; + AHIP_Offset = AHI_TagBase + 54; + AHIP_Length = AHI_TagBase + 55; + AHIP_LoopFreq = AHI_TagBase + 60; + AHIP_LoopVol = AHI_TagBase + 61; + AHIP_LoopPan = AHI_TagBase + 62; + AHIP_LoopSound = AHI_TagBase + 63; + AHIP_LoopOffset = AHI_TagBase + 64; + AHIP_LoopLength = AHI_TagBase + 65; + { AHI_ControlAudioA tags } + { Booleanean } + AHIC_Play = AHI_TagBase + 80; + { Booleanean } + AHIC_Record = AHI_TagBase + 81; + AHIC_MonitorVolume = AHI_TagBase + 82; + { ti_Data is pointer to Fixed (LONG) } + AHIC_MonitorVolume_Query = AHI_TagBase + 83; + { ti_Data is pointer to Cardinal } + AHIC_MixFreq_Query = AHI_TagBase + 84; + { --- New for V2, they will be ignored by V1 --- } + AHIC_InputGain = AHI_TagBase + 85; + { ti_Data is pointer to Fixed (LONG) } + AHIC_InputGain_Query = AHI_TagBase + 86; + AHIC_OutputVolume = AHI_TagBase + 87; + { ti_Data is pointer to Fixed (LONG) } + AHIC_OutputVolume_Query = AHI_TagBase + 88; + AHIC_Input = AHI_TagBase + 89; + { ti_Data is pointer to Cardinal } + AHIC_Input_Query = AHI_TagBase + 90; + AHIC_Output = AHI_TagBase + 91; + { ti_Data is pointer to Cardinal } + AHIC_Output_Query = AHI_TagBase + 92; + { AHI_GetAudioAttrsA tags } + AHIDB_AudioID = AHI_TagBase + 100; + { Pointer to name of driver } + AHIDB_Driver = AHI_TagBaseR + 101; + { Private! } + AHIDB_Flags = AHI_TagBase + 102; + { Booleanean } + AHIDB_Volume = AHI_TagBase + 103; + { Booleanean } + AHIDB_Panning = AHI_TagBase + 104; + { Booleanean } + AHIDB_Stereo = AHI_TagBase + 105; + { Booleanean } + AHIDB_HiFi = AHI_TagBase + 106; + { Booleanean } + AHIDB_PingPong = AHI_TagBase + 107; + { Private! } + AHIDB_MultTable = AHI_TagBase + 108; + { Pointer to name of this mode } + AHIDB_Name = AHI_TagBaseR + 109; + { Output bits } + AHIDB_Bits = AHI_TagBase + 110; + { Max supported channels } + AHIDB_MaxChannels = AHI_TagBase + 111; + { Min mixing freq. supported } + AHIDB_MinMixFreq = AHI_TagBase + 112; + { Max mixing freq. supported } + AHIDB_MaxMixFreq = AHI_TagBase + 113; + { Booleanean } + AHIDB_Record = AHI_TagBase + 114; + AHIDB_Frequencies = AHI_TagBase + 115; + { ti_Data is frequency index } + AHIDB_FrequencyArg = AHI_TagBase + 116; + AHIDB_Frequency = AHI_TagBase + 117; + { Pointer to driver author name } + AHIDB_Author = AHI_TagBase + 118; + { Pointer to driver copyright notice } + AHIDB_Copyright = AHI_TagBase + 119; + { Pointer to driver version string } + AHIDB_Version = AHI_TagBase + 120; + { Pointer to driver annotation text } + AHIDB_Annotation = AHI_TagBase + 121; + { Specifies the string buffer size } + AHIDB_BufferLen = AHI_TagBase + 122; + { ti_Data is frequency! } + AHIDB_IndexArg = AHI_TagBase + 123; + AHIDB_Index = AHI_TagBase + 124; + { Booleanean } + AHIDB_Realtime = AHI_TagBase + 125; + { It's sample frames } + AHIDB_MaxPlaySamples = AHI_TagBase + 126; + { It's sample frames } + AHIDB_MaxRecordSamples = AHI_TagBase + 127; + { Booleanean } + AHIDB_FullDuplex = AHI_TagBase + 129; + { --- New for V2, they will be ignored by V1 --- } + AHIDB_MinMonitorVolume = AHI_TagBase + 130; + AHIDB_MaxMonitorVolume = AHI_TagBase + 131; + AHIDB_MinInputGain = AHI_TagBase + 132; + AHIDB_MaxInputGain = AHI_TagBase + 133; + AHIDB_MinOutputVolume = AHI_TagBase + 134; + AHIDB_MaxOutputVolume = AHI_TagBase + 135; + AHIDB_Inputs = AHI_TagBase + 136; + { ti_Data is input index } + AHIDB_InputArg = AHI_TagBase + 137; + AHIDB_Input = AHI_TagBase + 138; + AHIDB_Outputs = AHI_TagBase + 139; + { ti_Data is input index } + AHIDB_OutputArg = AHI_TagBase + 140; + AHIDB_Output = AHI_TagBase + 141; + { --- New for V4, they will be ignored by V2 and earlier --- } + { Private! } + AHIDB_Data = AHI_TagBaseR + 142; + { AHI_BestAudioIDA tags } + { --- New for V4, they will be ignored by V2 and earlier --- } + AHIB_Dizzy = AHI_TagBase + 190; + { AHI_AudioRequestA tags } + { Window control } + { Parent window } + AHIR_Window = AHI_TagBase + 200; + { Screen to open on if no window } + AHIR_Screen = AHI_TagBase + 201; + { Name of public screen } + AHIR_PubScreenName = AHI_TagBase + 202; + { Allocate private IDCMP? } + AHIR_PrivateIDCMP = AHI_TagBase + 203; + { Function to handle IntuiMessages } + AHIR_IntuiMsgFunc = AHI_TagBase + 204; + { Block input in AHIR_Window? } + AHIR_SleepWindow = AHI_TagBase + 205; + { What to put in ahiam_UserData } + AHIR_UserData = AHI_TagBase + 206; + { Text display } + { Text font to use for gadget text } + AHIR_TextAttr = AHI_TagBase + 220; + { Locale to use for text } + AHIR_Locale = AHI_TagBase + 221; + { Title of requester } + AHIR_TitleText = AHI_TagBase + 222; + { Positive gadget text } + AHIR_PositiveText = AHI_TagBase + 223; + { Negative gadget text } + AHIR_NegativeText = AHI_TagBase + 224; + { Initial settings } + { Initial requester coordinates } + AHIR_InitialLeftEdge = AHI_TagBase + 240; + AHIR_InitialTopEdge = AHI_TagBase + 241; + { Initial requester dimensions } + AHIR_InitialWidth = AHI_TagBase + 242; + AHIR_InitialHeight = AHI_TagBase + 243; + { Initial audio mode id } + AHIR_InitialAudioID = AHI_TagBase + 244; + { Initial mixing/sampling frequency } + AHIR_InitialMixFreq = AHI_TagBase + 245; + { Info window initially opened? } + AHIR_InitialInfoOpened = AHI_TagBase + 246; + { Initial Info window coords. } + AHIR_InitialInfoLeftEdge = AHI_TagBase + 247; + AHIR_InitialInfoTopEdge = AHI_TagBase + 248; + { Not used! } + AHIR_InitialInfoWidth = AHI_TagBase + 249; + { Not used! } + AHIR_InitialInfoHeight = AHI_TagBase + 250; + { Options } + { Allow selection of mixing frequency? } + AHIR_DoMixFreq = AHI_TagBase + 260; + { Allow selection of default mode? (V4) } + AHIR_DoDefaultMode = AHI_TagBase + 261; + { Filtering } + { Pointer to filter taglist } + AHIR_FilterTags = AHI_TagBase + 270; + { Function to filter mode id's } + AHIR_FilterFunc = AHI_TagBase + 271; + { DEFS } + AHINAME : PChar = 'ahi.device'; + { Invalid Audio ID } + AHI_INVALID_ID = not (0); + { Only for AHI_AllocAudioA()! } + AHI_DEFAULT_ID = $00000000; + { Special sample render Audio ID } + AHI_LOOPBACK_ID = $00000001; + { Only for AHI_AllocAudioA()! } + AHI_DEFAULT_FREQ = 0; + { Special frequency for AHI_SetFreq() } + AHI_MIXFREQ = not (0); + { Turns a channel off } + AHI_NOSOUND = $ffff; + { Set#? Flags } + AHISF_IMM = 1 shl 0; + AHISB_IMM = 0; + { Effect Types } + { OR with effect to disable } + AHIET_CANCEL = 1 shl 31; + AHIET_MASTERVOLUME = 1; + AHIET_OUTPUTBUFFER = 2; + { --- New for V4 --- } + AHIET_DSPMASK = 3; + AHIET_DSPECHO = 4; + AHIET_CHANNELINFO = 5; + { Sound Types } + { Private } + AHIST_NOTYPE = not (0); + { 8 or 16 bit sample } + AHIST_SAMPLE = 0; + { Dynamic sample } + AHIST_DYNAMICSAMPLE = 1; + { The input from your sampler } + AHIST_INPUT = 1 shl 29; + { Private } + AHIST_BW = 1 shl 30; + { Sample types } + { Note that only AHIST_M8S, AHIST_S8S, AHIST_M16S and AHIST_S16S + are supported by AHI_LoadSound(). } + { Mono, 8 bit signed (BYTE) } + AHIST_M8S = 0; + { Mono, 16 bit signed (WORD) } + AHIST_M16S = 1; + { Stereo, 8 bit signed (2×BYTE) } + AHIST_S8S = 2; + { Stereo, 16 bit signed (2×WORD) } + AHIST_S16S = 3; + { Mono, 32 bit signed (LONG) } + AHIST_M32S = 8; + { Stereo, 32 bit signed (2×LONG) } + AHIST_S32S = 10; + { OBSOLETE! } + AHIST_M8U = 4; + { Error codes } + { No error } + AHIE_OK = 0; + { Out of memory } + AHIE_NOMEM = 1; + { Unknown sound type } + AHIE_BADSOUNDTYPE = 2; + { Unknown/unsupported sample type } + AHIE_BADSAMPLETYPE = 3; + { User-triggered abortion } + AHIE_ABORTED = 4; + { Error, but unknown } + AHIE_UNKNOWN = 5; + { CMD_WRITE/CMD_READ failure } + AHIE_HALFDUPLEX = 6; + { DEVICE INTERFACE DEFINITIONS FOLLOWS } + { Device units } + AHI_DEFAULT_UNIT = 0; + AHI_NO_UNIT = 255; + { The preference file } + ID_AHIU = $41484955; + ID_AHIG = $41484947; + + + type + PAHIUnitPrefs = ^tAHIUnitPrefs; + tAHIUnitPrefs = record + ahiup_Unit : Byte; + ahiup_Pad : Byte; + ahiup_Channels : Word; + ahiup_AudioMode : Cardinal; + ahiup_Frequency : Cardinal; + ahiup_MonitorVolume : Fixed; + ahiup_InputGain : Fixed; + ahiup_OutputVolume : Fixed; + ahiup_Input : Cardinal; + ahiup_Output : Cardinal; + end; + + + + PAHIGlobalPrefs = ^tAHIGlobalPrefs; + tAHIGlobalPrefs = record + ahigp_DebugLevel : Word; { Range: 0-3 (for None, Low,} + ahigp_DisableSurround : Boolean; { High and All) } + ahigp_DisableEcho : Boolean; + ahigp_FastEcho : Boolean; + ahigp_MaxCPU : Fixed; + ahigp_ClipMasterVolume : Boolean; + end; + + { Debug levels } + + const + AHI_DEBUG_NONE = 0; + AHI_DEBUG_LOW = 1; + AHI_DEBUG_HIGH = 2; + AHI_DEBUG_ALL = 3; + + { AHIRequest } + type + PAHIRequest = ^tAHIRequest; + tAHIRequest = record + ahir_Std : tIOStdReq; { Standard IO request } + ahir_Version : Word; { Needed version } + { --- New for V4, they will be ignored by V2 and earlier --- } + ahir_Pad1 : Word; + ahir_Private : array[0..1] of Cardinal; { Hands off! } + ahir_Type : Cardinal; { Sample format } + ahir_Frequency : Cardinal; { Sample/Record frequency } + ahir_Volume : Fixed; { Sample volume } + ahir_Position : Fixed; { Stereo position } + ahir_Link : PAHIRequest; { For double buffering } + end; + + { Flags for OpenDevice() } + + const + AHIDF_NOMODESCAN = 1 shl 0; + AHIDB_NOMODESCAN = 0; + + +function AHI_AllocAudioA(tagList : pTagItem location 'a1') : pAHIAudioCtrl; +SysCall AHIBase 042; + +procedure AHI_FreeAudio(AudioCtrl : pAHIAudioCtrl location 'a2'); +SysCall AHIBase 048; + +procedure AHI_KillAudio; +SysCall AHIBase 054; + +function AHI_ControlAudioA(AudioCtrl : pAHIAudioCtrl location 'a2'; tagList : pTagItem location 'a1') : Cardinal; +SysCall AHIBase 060; + +procedure AHI_SetVol(Channel : Word location 'd0'; Volume : LongInt location 'd1'; Pan : LongInt location 'd2'; AudioCtrl : pAHIAudioCtrl location 'a2'; Flags : Cardinal location 'd3'); +SysCall AHIBase 066; + +procedure AHI_SetFreq(Channel : Word location 'd0'; Freq : Cardinal location 'd1'; AudioCtrl : pAHIAudioCtrl location 'a2'; Flags : Cardinal location 'd2'); +SysCall AHIBase 072; + +procedure AHI_SetSound(Channel : Word location 'd0'; Sound : Word location 'd1'; Offset : Cardinal location 'd2'; Length : LongInt location 'd3'; AudioCtrl : pAHIAudioCtrl location 'a2'; Flags : Cardinal location 'd4'); +SysCall AHIBase 078; + +function AHI_SetEffect(Effect : Pointer location 'a0'; AudioCtrl : pAHIAudioCtrl location 'a2') : Cardinal; +SysCall AHIBase 084; + +function AHI_LoadSound(Sound : Word location 'd0'; SType : Cardinal location 'd1'; Info : Pointer location 'a0'; AudioCtrl : pAHIAudioCtrl location 'a2') : Cardinal; +SysCall AHIBase 090; + +procedure AHI_UnloadSound(Sound : Word location 'd0'; Audioctrl : pAHIAudioCtrl location 'a2'); +SysCall AHIBase 096; + +function AHI_NextAudioID(Last_ID : Cardinal location 'd0') : Cardinal; +SysCall AHIBase 102; + +function AHI_GetAudioAttrsA(ID : Cardinal location 'd0'; Audioctrl : pAHIAudioCtrl location 'a2'; tagList : pTagItem location 'a1') : LongBool; +SysCall AHIBase 108; + +function AHI_BestAudioIDA(tagList : pTagItem location 'a1') : Cardinal; +SysCall AHIBase 114; + +function AHI_AllocAudioRequestA(tagList : pTagItem location 'a0') : pAHIAudioModeRequester; +SysCall AHIBase 120; + +function AHI_AudioRequestA(Requester : pAHIAudioModeRequester location 'a0'; tagList : pTagItem location 'a1') : LongBool; +SysCall AHIBase 126; + +procedure AHI_FreeAudioRequest(Requester : pAHIAudioModeRequester location 'a0'); +SysCall AHIBase 132; + +procedure AHI_PlayA(Audioctrl : pAHIAudioCtrl location 'a2'; tagList : pTagItem location 'a1'); +SysCall AHIBase 138; + +function AHI_SampleFrameSize(SampleType : Cardinal location 'd0') : Cardinal; +SysCall AHIBase 144; + +function AHI_AddAudioMode(a0arg : pTagItem location 'a0') : Cardinal; +SysCall AHIBase 150; + +function AHI_RemoveAudioMode(d0arg : Cardinal location 'd0') : Cardinal; +SysCall AHIBase 156; + +function AHI_LoadModeFile(a0arg : PChar location 'a0') : Cardinal; +SysCall AHIBase 162; + + +{ + Functions and procedures with tags +} +function AHI_AllocAudio(tagList : array of DWord): pAHIAudioCtrl; +function AHI_ControlAudio(AudioCtrl : pAHIAudioCtrl; tagList : array Of DWord) : Cardinal; +function AHI_GetAudioAttrs(ID : CARDINAL; Audioctrl : pAHIAudioCtrl; taglist : array of DWord) : Boolean; +function AHI_BestAudioID(taglist : array of DWord) : Cardinal; +function AHI_AllocAudioRequest(taglist : array of DWord) : pAHIAudioModeRequester; +function AHI_AudioRequest(Requester : pAHIAudioModeRequester; taglist : array of DWord) : Boolean; +procedure AHI_Play(Audioctrl : pAHIAudioCtrl; taglist : array of DWord); + +function InitAHILibrary : boolean; + + +implementation + + +function AHI_AllocAudio(tagList : array of DWord): pAHIAudioCtrl; +begin + AHI_AllocAudio:=AHI_AllocAudioA(@taglist); +end; + +function AHI_AllocAudioRequest(taglist : array of DWord) : pAHIAudioModeRequester; +begin + AHI_AllocAudioRequest:=AHI_AllocAudioRequestA(@taglist); +end; + +function AHI_AudioRequest(Requester : pAHIAudioModeRequester; taglist : array of DWord) : Boolean; +begin + AHI_AudioRequest:=AHI_AudioRequestA(Requester,@taglist); +end; + +function AHI_BestAudioID(taglist : array of DWord) : longword; +begin + AHI_BestAudioID:=AHI_BestAudioIDA(@taglist); +end; + +function AHI_ControlAudio(AudioCtrl : pAHIAudioCtrl; taglist : array of DWord) : longword; +begin + AHI_ControlAudio:=AHI_ControlAudioA(AudioCtrl,@taglist); +end; + +function AHI_GetAudioAttrs(ID : longword; Audioctrl : pAHIAudioCtrl; taglist : array of DWord) : Boolean; +begin + AHI_GetAudioAttrs:=AHI_GetAudioAttrsA(ID,Audioctrl,@taglist); +end; + +procedure AHI_Play(Audioctrl : pAHIAudioCtrl; taglist : array of DWord); +begin + AHI_PlayA(Audioctrl,@taglist); +end; + + +const + { Change VERSION and LIBVERSION to proper values } + + VERSION : string[2] = '0'; + LIBVERSION : longword = 0; + +var + ahi_exit : Pointer; + +procedure CloseAHILibrary; +begin + ExitProc := ahi_exit; + if AHIBase <> nil then begin + CloseLibrary(PLibrary(AHIBase)); + AHIBase := nil; + end; +end; + +function InitAHILibrary : boolean; +begin + AHIBase := nil; + AHIBase := OpenLibrary(AHINAME,LIBVERSION); + if AHIBase <> nil then begin + ahi_exit := ExitProc; + ExitProc := @CloseAhiLibrary; + InitAhiLibrary:=True; + end else begin + InitAhiLibrary:=False; + end; +end; + +end. (* UNIT AHI *) + diff --git a/packages/morphunits/src/amigados.pas b/packages/morphunits/src/amigados.pas new file mode 100644 index 0000000000..96fb8ddedd --- /dev/null +++ b/packages/morphunits/src/amigados.pas @@ -0,0 +1,2164 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + dos.library interface unit for MorphOS/PowerPC + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} +{$INLINE ON} +{$PACKRECORDS 2} + +unit AmigaDOS; + +interface + +uses Exec, Timer; + +var + DosBase: Pointer; + + +{ * dos global definitions (V50) + ********************************************************************* + * } + + +const + DOSNAME = 'dos.library'; + +const + DOSTRUE = -1; + DOSFALSE = 0; + +const + MODE_OLDFILE = 1005; + MODE_NEWFILE = 1006; + MODE_READWRITE = 1004; + +const + OFFSET_BEGINNING = -1; + OFFSET_CURRENT = 0; + OFFSET_END = 1; + OFFSET_BEGINING = OFFSET_BEGINNING; { * Typo fix * } + +const + BITSPERBYTE = 8; + BYTESPERLONG = 4; + BITSPERLONG = 32; + _MAXINT = $7FFFFFFF; + _MININT = $80000000; + +const + SHARED_LOCK = -2; + ACCESS_READ = -2; + EXCLUSIVE_LOCK = -1; + ACCESS_WRITE = -1; + + +type + PDateStamp = ^TDateStamp; + TDateStamp = packed record + ds_Days : LongInt; + ds_Minute: LongInt; + ds_Tick : LongInt; + end; + +const + TICKS_PER_SECOND = 50; + + +type + PFileInfoBlock = ^TFileInfoBlock; + TFileInfoBlock = packed record + fib_DiskKey : LongInt; + fib_DirEntryType: LongInt; + fib_FileName : Array[0..107] Of Char; + fib_Protection : LongInt; + fib_EntryType : LongInt; + fib_Size : LongInt; + fib_NumBlocks : LongInt; + fib_Date : TDateStamp; + fib_Comment : Array[0..79] Of Char; + + fib_OwnerUID : Word; + fib_OwnerGID : Word; + + fib_Reserved : Array[0..31] Of Char; + end; + +const + FIBB_OTR_READ = 15; + FIBB_OTR_WRITE = 14; + FIBB_OTR_EXECUTE = 13; + FIBB_OTR_DELETE = 12; + FIBB_GRP_READ = 11; + FIBB_GRP_WRITE = 10; + FIBB_GRP_EXECUTE = 9; + FIBB_GRP_DELETE = 8; + + FIBB_SCRIPT = 6; + FIBB_PURE = 5; + FIBB_ARCHIVE = 4; + FIBB_READ = 3; + FIBB_WRITE = 2; + FIBB_EXECUTE = 1; + FIBB_DELETE = 0; + +const + FIBF_OTR_READ = (1 Shl FIBB_OTR_READ); + FIBF_OTR_WRITE = (1 Shl FIBB_OTR_WRITE); + FIBF_OTR_EXECUTE = (1 Shl FIBB_OTR_EXECUTE); + FIBF_OTR_DELETE = (1 Shl FIBB_OTR_DELETE); + FIBF_GRP_READ = (1 Shl FIBB_GRP_READ); + FIBF_GRP_WRITE = (1 Shl FIBB_GRP_WRITE); + FIBF_GRP_EXECUTE = (1 Shl FIBB_GRP_EXECUTE); + FIBF_GRP_DELETE = (1 Shl FIBB_GRP_DELETE); + + FIBF_SCRIPT = (1 Shl FIBB_SCRIPT); + FIBF_PURE = (1 Shl FIBB_PURE); + FIBF_ARCHIVE = (1 Shl FIBB_ARCHIVE); + FIBF_READ = (1 Shl FIBB_READ); + FIBF_WRITE = (1 Shl FIBB_WRITE); + FIBF_EXECUTE = (1 Shl FIBB_EXECUTE); + FIBF_DELETE = (1 Shl FIBB_DELETE); + +const + FAULT_MAX = 82; + + +type + BPTR = LongInt; + BSTR = LongInt; + +type + PInfoData = ^TInfoData; + TInfoData = packed record + id_NumSoftErrors: LongInt; + id_UnitNumber : LongInt; + id_DiskState : LongInt; + id_NumBlocks : LongInt; + id_NumBlocksUsed: LongInt; + id_BytesPerBlock: LongInt; + id_DiskType : LongInt; + id_VolumeNode : LongInt; {BPTR} + id_InUse : LongInt; + end; + + +const + ID_WRITE_PROTECTED = 80; + ID_VALIDATING = 81; + ID_VALIDATED = 82; + + ID_NO_DISK_PRESENT = -1; + ID_UNREADABLE_DISK = $42414400; + ID_DOS_DISK = $444F5300; + ID_FFS_DISK = $444F5301; + ID_INTER_DOS_DISK = $444F5302; + ID_INTER_FFS_DISK = $444F5303; + ID_FASTDIR_DOS_DISK = $444F5304; + ID_FASTDIR_FFS_DISK = $444F5305; + ID_LNFS_DOS_DISK = $444F5306; + ID_LNFS_FFS_DISK = $444F5307; + ID_NOT_REALLY_DOS = $4E444F53; + ID_KICKSTART_DISK = $4B49434B; + ID_MSDOS_DISK = $4d534400; + +const + ERROR_NO_FREE_STORE = 103; + ERROR_TASK_TABLE_FULL = 105; + ERROR_BAD_TEMPLATE = 114; + ERROR_BAD_NUMBER = 115; + ERROR_REQUIRED_ARG_MISSING = 116; + ERROR_KEY_NEEDS_ARG = 117; + ERROR_TOO_MANY_ARGS = 118; + ERROR_UNMATCHED_QUOTES = 119; + ERROR_LINE_TOO_LONG = 120; + ERROR_FILE_NOT_OBJECT = 121; + ERROR_INVALID_RESIDENT_LIBRARY = 122; + ERROR_NO_DEFAULT_DIR = 201; + ERROR_OBJECT_IN_USE = 202; + ERROR_OBJECT_EXISTS = 203; + ERROR_DIR_NOT_FOUND = 204; + ERROR_OBJECT_NOT_FOUND = 205; + ERROR_BAD_STREAM_NAME = 206; + ERROR_OBJECT_TOO_LARGE = 207; + ERROR_ACTION_NOT_KNOWN = 209; + ERROR_INVALID_COMPONENT_NAME = 210; + ERROR_INVALID_LOCK = 211; + ERROR_OBJECT_WRONG_TYPE = 212; + ERROR_DISK_NOT_VALIDATED = 213; + ERROR_DISK_WRITE_PROTECTED = 214; + ERROR_RENAME_ACROSS_DEVICES = 215; + ERROR_DIRECTORY_NOT_EMPTY = 216; + ERROR_TOO_MANY_LEVELS = 217; + ERROR_DEVICE_NOT_MOUNTED = 218; + ERROR_SEEK_ERROR = 219; + ERROR_COMMENT_TOO_BIG = 220; + ERROR_DISK_FULL = 221; + ERROR_DELETE_PROTECTED = 222; + ERROR_WRITE_PROTECTED = 223; + ERROR_READ_PROTECTED = 224; + ERROR_NOT_A_DOS_DISK = 225; + ERROR_NO_DISK = 226; + ERROR_NO_MORE_ENTRIES = 232; + + ERROR_IS_SOFT_LINK = 233; + ERROR_OBJECT_LINKED = 234; + ERROR_BAD_HUNK = 235; + ERROR_NOT_IMPLEMENTED = 236; + ERROR_RECORD_NOT_LOCKED = 240; + ERROR_LOCK_COLLISION = 241; + ERROR_LOCK_TIMEOUT = 242; + ERROR_UNLOCK_ERROR = 243; + +const + RETURN_OK = 0; + RETURN_WARN = 5; + RETURN_ERROR = 10; + RETURN_FAIL = 20; + +const + SIGBREAKB_CTRL_C = 12; + SIGBREAKB_CTRL_D = 13; + SIGBREAKB_CTRL_E = 14; + SIGBREAKB_CTRL_F = 15; + + SIGBREAKF_CTRL_C = (1 Shl SIGBREAKB_CTRL_C); + SIGBREAKF_CTRL_D = (1 Shl SIGBREAKB_CTRL_D); + SIGBREAKF_CTRL_E = (1 Shl SIGBREAKB_CTRL_E); + SIGBREAKF_CTRL_F = (1 Shl SIGBREAKB_CTRL_F); + +const + LOCK_DIFFERENT = -1; + LOCK_SAME = 0; + LOCK_SAME_VOLUME = 1; + LOCK_SAME_HANDLER = LOCK_SAME_VOLUME; + +const + CHANGE_LOCK = 0; + CHANGE_FH = 1; + +const + LINK_HARD = 0; + LINK_SOFT = 1; + +const + ITEM_EQUAL = -2; + ITEM_ERROR = -1; + ITEM_NOTHING = 0; + ITEM_UNQUOTED = 1; + ITEM_QUOTED = 2; + +const + DOS_FILEHANDLE = 0; + DOS_EXALLCONTROL = 1; + DOS_FIB = 2; + DOS_STDPKT = 3; + DOS_CLI = 4; + DOS_RDARGS = 5; + + + +{ * dos date/time definitions + ********************************************************************* + * } + + +type + { * Required to avoid conflict with default types * } + _PDateTime = ^_TDateTime; + _TDateTime = packed record + dat_Stamp : TDateStamp; + dat_Format : Byte; + dat_Flags : Byte; + dat_StrDay : Pointer; + dat_StrDate: Pointer; + dat_StrTime: Pointer; + end; + +const + LEN_DATSTRING = 16; + +const + DTB_SUBST = 0; + DTF_SUBST = (1 Shl DTB_SUBST); + DTB_FUTURE = 1; + DTF_FUTURE = (1 Shl DTB_FUTURE); + +const + FORMAT_DOS = 0; + FORMAT_INT = 1; + FORMAT_USA = 2; + FORMAT_CDN = 3; + FORMAT_MAX = FORMAT_CDN; + FORMAT_DEF = 4; + + + +{ * dos extended structures definitions + ********************************************************************* + * } + + +type + PProcess = ^TProcess; + TProcess = packed record + pr_Task : TTask; + pr_MsgPort : TMsgPort; + pr_Pad : Word; + pr_SegList : DWord; { BPTR } + pr_StackSize : LongInt; { 68k stacksize! } + pr_GlobVec : Pointer; + pr_TaskNum : LongInt; + pr_StackBase : DWord; { BPTR } + pr_Result2 : LongInt; + pr_CurrentDir : DWord; { BPTR } + pr_CIS : DWord; { BPTR } + pr_COS : DWord; { BPTR } + pr_ConsoleTask : Pointer; + pr_FileSystemTask: Pointer; + pr_CLI : DWord; { BPTR } + pr_ReturnAddr : Pointer; + pr_PktWait : Pointer; + pr_WindowPtr : Pointer; + pr_HomeDir : DWord; { BPTR } + pr_Flags : LongInt; + pr_ExitCode : Pointer; { Procedure } + pr_ExitData : LongInt; + pr_Arguments : PChar; + pr_LocalVars : TMinList; + pr_ShellPrivate : DWord; + pr_CES : DWord; { BPTR } + end; + +const + PRB_FREESEGLIST = 0; + PRF_FREESEGLIST = (1 Shl PRB_FREESEGLIST); + + PRB_FREECURRDIR = 1; + PRF_FREECURRDIR = (1 Shl PRB_FREECURRDIR); + + PRB_FREECLI = 2; + PRF_FREECLI = (1 Shl PRB_FREECLI); + + PRB_CLOSEINPUT = 3; + PRF_CLOSEINPUT = (1 Shl PRB_CLOSEINPUT); + + PRB_CLOSEOUTPUT = 4; + PRF_CLOSEOUTPUT = (1 Shl PRB_CLOSEOUTPUT); + + PRB_FREEARGS = 5; + PRF_FREEARGS = (1 Shl PRB_FREEARGS); + + +type + PFileHandle = ^TFileHandle; + TFileHandle = packed record + fh_Flags : DWord; + fh_Interactive: LongInt; + fh_Type : PMsgPort; + fh_Buf : LongInt; + fh_Pos : LongInt; + fh_End : LongInt; + fh_Func1 : LongInt; + fh_Func2 : LongInt; + fh_Func3 : LongInt; + fh_Arg1 : LongInt; + fh_Arg2 : LongInt; + { *** V50 MorphOS *** } + fh_BufSize : LongInt; + fh_OrigBuf : LongInt; + end; + +type + PDOSPacket = ^TDOSPacket; + TDOSPacket = packed record + dp_Link: PMessage; + dp_Port: PMsgPort; + case Byte of + 0 : ( dp_Action : Longint; + dp_Status : Longint; + dp_Status2: Longint; + dp_BufAddr: Longint; + ); + 1 : ( dp_Type: Longint; + dp_Res1: Longint; + dp_Res2: Longint; + dp_Arg1: Longint; + dp_Arg2: Longint; + dp_Arg3: Longint; + dp_Arg4: Longint; + dp_Arg5: Longint; + dp_Arg6: Longint; + dp_Arg7: Longint; + ); + end; + +type + PStandardPacket = ^TStandardPacket; + TStandardPacket = packed record + sp_Msg: TMessage; + sp_Pkt: TDOSPacket; + end; + + +const + ACTION_NIL = 0; + ACTION_STARTUP = 0; + ACTION_GET_BLOCK = 2; { *** OBSOLETE *** } + ACTION_SET_MAP = 4; + ACTION_DIE = 5; + ACTION_EVENT = 6; + ACTION_CURRENT_VOLUME = 7; + ACTION_LOCATE_OBJECT = 8; + ACTION_RENAME_DISK = 9; + ACTION_WRITE = 'W'; + ACTION_READ = 'R'; + ACTION_FREE_LOCK = 15; + ACTION_DELETE_OBJECT = 16; + ACTION_RENAME_OBJECT = 17; + ACTION_MORE_CACHE = 18; + ACTION_COPY_DIR = 19; + ACTION_WAIT_CHAR = 20; + ACTION_SET_PROTECT = 21; + ACTION_CREATE_DIR = 22; + ACTION_EXAMINE_OBJECT = 23; + ACTION_EXAMINE_NEXT = 24; + ACTION_DISK_INFO = 25; + ACTION_INFO = 26; + ACTION_FLUSH = 27; + ACTION_SET_COMMENT = 28; + ACTION_PARENT = 29; + ACTION_TIMER = 30; + ACTION_INHIBIT = 31; + ACTION_DISK_TYPE = 32; + ACTION_DISK_CHANGE = 33; + ACTION_SET_DATE = 34; + + ACTION_SAME_LOCK = 40; + + ACTION_SCREEN_MODE = 994; + + ACTION_CHANGE_SIGNAL = 995; + + ACTION_READ_RETURN = 1001; + ACTION_WRITE_RETURN = 1002; + ACTION_SEEK = 1008; + ACTION_FINDUPDATE = 1004; + ACTION_FINDINPUT = 1005; + ACTION_FINDOUTPUT = 1006; + ACTION_END = 1007; + + ACTION_FORMAT = 1020; + ACTION_MAKE_LINK = 1021; + + ACTION_SET_FILE_SIZE = 1022; + ACTION_WRITE_PROTECT = 1023; + + ACTION_READ_LINK = 1024; + ACTION_FH_FROM_LOCK = 1026; + ACTION_IS_FILESYSTEM = 1027; + ACTION_CHANGE_MODE = 1028; + + ACTION_COPY_DIR_FH = 1030; + ACTION_PARENT_FH = 1031; + ACTION_EXAMINE_ALL = 1033; + ACTION_EXAMINE_FH = 1034; + + ACTION_EXAMINE_ALL_END = 1035; + ACTION_SET_OWNER = 1036; + + ACTION_LOCK_RECORD = 2008; + ACTION_FREE_RECORD = 2009; + + ACTION_ADD_NOTIFY = 4097; + ACTION_REMOVE_NOTIFY = 4098; + + ACTION_SERIALIZE_DISK = 4200; + + ACTION_GET_DISK_FSSM = 4201; + ACTION_FREE_DISK_FSSM = 4202; + + +type + PErrorString = ^TErrorString; + TErrorString = packed record + estr_Nums: Pointer; { ^LongInt } + estr_Byte: Pointer; { ^Byte } + end; + +type + PRootNode = ^TRootNode; + TRootNode = packed record + rn_TaskArray : DWord; { BPTR } + rn_ConsoleSegment : DWord; { BPTR } + rn_Time : TDateStamp; + rn_RestartSeg : LongInt; + rn_Info : DWord; { BPTR } + rn_FileHandlerSegment: DWord; { BPTR } + rn_CliList : TMinList; + rn_BootProc : PMsgPort; + rn_ShellSegment : DWord; { BPTR } + rn_Flags : LongInt; + end; + +type + PDOSLibrary = ^TDOSLibrary; + TDOSLibrary = packed record + dl_Lib : TLibrary; + dl_Root : PRootNode; + dl_GU : Pointer; + dl_A2 : LongInt; + dl_A5 : LongInt; + dl_A6 : LongInt; + dl_Errors : PErrorString; + dl_TimeReq : PTimeRequest; + dl_UtilityBase : PLibrary; + dl_IntuitionBase: PLibrary; + end; + + +const + RNB_WILDSTAR = 24; + RNF_WILDSTAR = (1 Shl RNB_WILDSTAR); + + RNB_PRIVATE1 = 1; + RNF_PRIVATE1 = (1 Shl RNB_PRIVATE1); + + +type + PCliProcList = ^TCliProcList; + TCliProcList = packed record + cpl_Node : TMinNode; + cpl_First: LongInt; + cpl_Array: Array[0..0] Of PMsgPort; + end; + +type + PDOSInfo = ^TDOSInfo; + TDOSInfo = packed record + case Byte of + 0 : ( di_ResList: DWord; { BPTR } + ); + 1 : ( di_McName : DWord; { BPTR } + di_DevInfo : DWord; { BPTR } + di_Devices : DWord; { BPTR } + di_Handlers : DWord; { BPTR } + di_NetHand : Pointer; + di_DevLock : TSignalSemaphore; + di_EntryLock : TSignalSemaphore; + di_DeleteLock: TSignalSemaphore; + ); + end; + +type + PSegment = ^TSegment; + TSegment = packed record + seg_Next : DWord; { BPTR } + seg_UC : LongInt; + seg_Seg : DWord; { BPTR } + seg_Name : Array[0..3] Of Byte; + { * seg_Name continues * } + end; + + +const + CMD_SYSTEM = -1; + CMD_INTERNAL = -2; + CMD_NOTLOADED = -998; + CMD_DISABLED = -999; + + +type + PCommandLineInterface = ^TCommandLineInterface; + TCommandLineInterface = packed record + cli_Result2 : LongInt; + cli_SetName : DWord; { BSTR } + cli_CommandDir : DWord; { BPTR } + cli_ReturnCode : LongInt; + cli_CommandName : DWord; { BSTR } + cli_FailLevel : LongInt; + cli_Prompt : DWord; { BSTR } + cli_StandardInput : DWord; { BPTR } + cli_CurrentInput : DWord; { BPTR } + cli_CommandFile : DWord; { BSTR } + cli_Interactive : LongInt; + cli_Background : LongInt; + cli_CurrentOutput : DWord; { BPTR } + cli_DefaultStack : LongInt; + cli_StandardOutput: DWord; { BPTR } + cli_Module : DWord; { BPTR } + end; + +type + PDeviceList = ^TDeviceList; + TDeviceList = packed record + dl_Next : DWord; { BPTR } + dl_Type : LongInt; + dl_Task : PMsgPort; + dl_Lock : DWord; { BPTR } + dl_VolumeDate: TDateStamp; + dl_LockList : DWord; { BPTR } + dl_DiskType : LongInt; + dl_unused : LongInt; + dl_Name : DWord; { BSTR } + end; + +type + PDevInfo = ^TDevInfo; + TDevInfo = packed record + dvi_Next : DWord; { BPTR } + dvi_Type : LongInt; + dvi_Task : Pointer; + dvi_Lock : DWord; { BPTR } + dvi_Handler : DWord; { BSTR } + dvi_StackSize: LongInt; + dvi_Priority : LongInt; + dvi_Startup : LongInt; + dvi_SegList : DWord; { BPTR } + dvi_GlobVec : DWord; { BPTR } + dvi_Name : DWord; { BSTR } + end; + +type + PAssignList = ^TAssignList; + TAssignList = packed record + al_Next: PAssignList; + al_Lock: DWord; { BPTR } + end; + +type + PDOSList = ^TDOSList; + TDOSList = packed record + dol_Next: DWord; { BPTR } + dol_Type: LongInt; + dol_Task: PMsgPort; + dol_Lock: DWord; { BPTR } + case Byte of + 0: ( dol_handler : record + dol_Handler : DWord; { BSTR } + dol_StackSize: LongInt; + dol_Priority : LongInt; + dol_Startup : DWord; + dol_SegList : DWord; { BPTR } + dol_GlobVec : DWord; { BPTR } + end; + ); + 1: ( dol_volume : record + dol_VolumeDate: TDateStamp; + dol_LockList : DWord; { BPTR } + dol_DiskType : LongInt; + end; + ); + 2: ( dol_assign : record + dol_AssignName: PChar; + dol_List : PAssignList; + end; + ); + 3: ( dol_Misc: array[0..23] of Byte; + dol_Name: DWord; { BPTR } + ); + end; + + +const + DLT_DEVICE = 0; + DLT_DIRECTORY = 1; + DLT_VOLUME = 2; + DLT_LATE = 3; + DLT_NONBINDING = 4; + DLT_PRIVATE = -1; + + +type + PDevProc = ^TDevProc; + TDevProc = packed record + dvp_Port : PMsgPort; + dvp_Lock : DWord; { BPTR } + dvp_Flags : DWord; + dvp_DevNode: PDOSList; + end; + + +const + DVPB_UNLOCK = 0; + DVPF_UNLOCK = (1 Shl DVPB_UNLOCK); + + DVPB_ASSIGN = 1; + DVPF_ASSIGN = (1 Shl DVPB_ASSIGN); + +const + LDB_READ = 0; + LDF_READ = (1 Shl LDB_READ); + + LDB_WRITE = 1; + LDF_WRITE = (1 Shl LDB_WRITE); + + LDB_DEVICES = 2; + LDF_DEVICES = (1 Shl LDB_DEVICES); + + LDB_VOLUMES = 3; + LDF_VOLUMES = (1 Shl LDB_VOLUMES); + + LDB_ASSIGNS = 4; + LDF_ASSIGNS = (1 Shl LDB_ASSIGNS); + + LDB_ENTRY = 5; + LDF_ENTRY = (1 Shl LDB_ENTRY); + + LDB_DELETE = 6; + LDF_DELETE = (1 Shl LDB_DELETE); + + LDF_ALL = (LDF_DEVICES Or LDF_VOLUMES Or LDF_ASSIGNS); + + +type + PFileLock = ^TFileLock; + TFileLock = packed record + fl_Link : DWord; { BPTR } + fl_Key : LongInt; + fl_Access: LongInt; + fl_Task : PMsgPort; + fl_Volume: DWord; { BPTR } + end; + + +const + REPORT_STREAM = 0; + REPORT_TASK = 1; + REPORT_LOCK = 2; + REPORT_VOLUME = 3; + REPORT_INSERT = 4; + +const + ABORT_DISK_ERROR = 296; + ABORT_BUSY = 288; + +const + RUN_EXECUTE = -1; + RUN_SYSTEM = -2; + RUN_SYSTEM_ASYNCH = -3; + +const + ST_ROOT = 1; + ST_USERDIR = 2; + ST_SOFTLINK = 3; + ST_LINKDIR = 4; + ST_FILE = -3; + ST_LINKFILE = -4; + ST_PIPEFILE = -5; + + + +{ * dos asl definitions + ********************************************************************* + * } + + +type + PAChain = ^TAChain; + TAChain = packed record + an_Child : PAChain; + an_Parent: PAChain; + an_Lock : DWord; { BPTR } + an_Info : TFileInfoBlock; + an_Flags : ShortInt; + an_String: Array[0..0] Of Char; + { * an_String continues * } + end; + +type + PAnchorPath = ^TAnchorPath; + TAnchorPath = packed record + case Byte of + 0 : ( ap_First: PAChain; + ap_Last : PAChain; + ); + 1 : ( ap_Base : PAChain; + ap_Current : PAChain; + ap_BreakBits : LongInt; + ap_FoundBreak: LongInt; + ap_Flags : ShortInt; + ap_Reserved : ShortInt; + ap_Strlen : SmallInt; + ap_Info : TFileInfoBlock; + ap_Buf : Array[0..0] of Char; + { * an_Buf continues * } + ); + end; + + +const + APB_DOWILD = 0; + APF_DOWILD = (1 Shl APB_DOWILD); + + APB_ITSWILD = 1; + APF_ITSWILD = (1 Shl APB_ITSWILD); + + APB_DODIR = 2; + APF_DODIR = (1 Shl APB_DODIR); + + APB_DIDDIR = 3; + APF_DIDDIR = (1 Shl APB_DIDDIR); + + APB_NOMEMERR = 4; + APF_NOMEMERR = (1 Shl APB_NOMEMERR); + + APB_DODOT = 5; + APF_DODOT = (1 Shl APB_DODOT); + + APB_DirChanged = 6; + APF_DirChanged = (1 Shl APB_DirChanged); + + APB_FollowHLinks = 7; + APF_FollowHLinks = (1 Shl APB_FollowHLinks); + +const + APSB_EXTENDED = 15; + APSF_EXTENDED = (1 Shl APSB_EXTENDED); + + APEB_DoMultiAssigns = 0; + APEF_DoMultiAssigns = (1 Shl APEB_DoMultiAssigns); + + APEB_FutureExtension = 7; + APEF_FutureExtension = (1 Shl APEB_FutureExtension); + +const + DDB_PatternBit = 0; + DDF_PatternBit = (1 Shl DDB_PatternBit); + + DDB_ExaminedBit = 1; + DDF_ExaminedBit = (1 Shl DDB_ExaminedBit); + + DDB_Completed = 2; + DDF_Completed = (1 Shl DDB_Completed); + + DDB_AllBit = 3; + DDF_AllBit = (1 Shl DDB_AllBit); + + DDB_Single = 4; + DDF_Single = (1 Shl DDB_Single); + +const + P_ANY = $80; + P_SINGLE = $81; + P_ORSTART = $82; + P_ORNEXT = $83; + P_OREND = $84; + P_NOT = $85; + P_NOTEND = $86; + P_NOTCLASS = $87; + P_CLASS = $88; + P_REPBEG = $89; + P_REPEND = $8A; + P_STOP = $8B; + +const + COMPLEX_BIT = 1; + EXAMINE_BIT = 2; + +const + ERROR_BUFFER_OVERFLOW = 303; + ERROR_BREAK = 304; + ERROR_NOT_EXECUTABLE = 305; + + + +{ * dos hunk definitions + ********************************************************************* + * } + + +const + HUNK_UNIT = 999; + HUNK_NAME = 1000; + HUNK_CODE = 1001; + HUNK_DATA = 1002; + HUNK_BSS = 1003; + + HUNK_RELOC32 = 1004; + HUNK_ABSRELOC32 = HUNK_RELOC32; + + HUNK_RELOC16 = 1005; + HUNK_RELRELOC16 = HUNK_RELOC16; + + HUNK_RELOC8 = 1006; + HUNK_RELRELOC8 = HUNK_RELOC8; + + HUNK_EXT = 1007; + HUNK_SYMBOL = 1008; + HUNK_DEBUG = 1009; + HUNK_END = 1010; + HUNK_HEADER = 1011; + + HUNK_OVERLAY = 1013; + HUNK_BREAK = 1014; + + HUNK_DREL32 = 1015; + HUNK_DREL16 = 1016; + HUNK_DREL8 = 1017; + + HUNK_LIB = 1018; + HUNK_INDEX = 1019; + + HUNK_RELOC32SHORT = 1020; + + HUNK_RELRELOC32 = 1021; + HUNK_ABSRELOC16 = 1022; + +const + HUNKB_ADVISORY = 29; + HUNKB_CHIP = 30; + HUNKB_FAST = 31; + + HUNKF_ADVISORY = (1 Shl HUNKB_ADVISORY); + HUNKF_CHIP = (1 Shl HUNKB_CHIP); + HUNKF_FAST = (1 Shl HUNKB_FAST); + +const + EXT_SYMB = 0; + EXT_DEF = 1; + EXT_ABS = 2; + EXT_RES = 3; + + EXT_REF32 = 129; + EXT_ABSREF32 = EXT_REF32; + + EXT_COMMON = 130; + EXT_ABSCOMMON = EXT_COMMON; + + EXT_REF16 = 131; + EXT_RELREF16 = EXT_REF16; + + EXT_REF8 = 132; + EXT_RELREF8 = EXT_REF8; + + EXT_DEXT32 = 133; + EXT_DEXT16 = 134; + EXT_DEXT8 = 135; + + EXT_RELREF32 = 136; + EXT_RELCOMMON = 137; + + EXT_ABSREF16 = 138; + + EXT_ABSREF8 = 139; + + + +{ * dos ExAll definitions + ********************************************************************* + * } + + +const + ED_NAME = 1; + ED_TYPE = 2; + ED_SIZE = 3; + ED_PROTECTION = 4; + ED_DATE = 5; + ED_COMMENT = 6; + ED_OWNER = 7; + + +type + PExAllData = ^TExAllData; + TExAllData = packed record + ed_Next : PExAllData; + ed_Name : PChar; + ed_Type : LongInt; + ed_Size : Cardinal; + ed_Prot : Cardinal; + ed_Days : Cardinal; + ed_Mins : Cardinal; + ed_Ticks : Cardinal; + ed_Comment : PChar; + ed_OwnerUID: Word; + ed_OwnerGID: Word; + end; + +type + PExAllControl = ^TExAllControl; + TexAllControl = packed record + eac_Entries : Cardinal; + eac_LastKey : Cardinal; + eac_MatchString: PChar; + eac_MatchFunc : PHook; + + end; + + + +{ * dos record definitions + ********************************************************************* + * } + + +const + REC_EXCLUSIVE = 0; + REC_EXCLUSIVE_IMMED = 1; + REC_SHARED = 2; + REC_SHARED_IMMED = 3; + + +type + PRecordLock = ^TRecordLock; + TRecordLock = packed record + rec_FH : LongInt; + rec_Offset: Cardinal; + rec_Length: Cardinal; + rec_Mode : Cardinal; + end; + + + +{ * dos tag definitions (V50) + ********************************************************************* + * } + + +const + SYS_Dummy = (TAG_USER + 32); + SYS_Input = (SYS_Dummy + 1); + SYS_Output = (SYS_Dummy + 2); + SYS_Asynch = (SYS_Dummy + 3); + SYS_UserShell = (SYS_Dummy + 4); + SYS_CustomShell = (SYS_Dummy + 5); + + { *** V50 *** } + SYS_FilterTags = (SYS_Dummy + 6); { * filters the tags passed down to CreateNewProc(), default: TRUE * } + +const + NP_Dummy = (TAG_USER + 1000); + NP_Seglist = (NP_Dummy + 1); + NP_FreeSeglist = (NP_Dummy + 2); + NP_Entry = (NP_Dummy + 3); + NP_Input = (NP_Dummy + 4); + NP_Output = (NP_Dummy + 5); + NP_CloseInput = (NP_Dummy + 6); + NP_CloseOutput = (NP_Dummy + 7); + NP_Error = (NP_Dummy + 8); + NP_CloseError = (NP_Dummy + 9); + NP_CurrentDir = (NP_Dummy + 10); + NP_StackSize = (NP_Dummy + 11); + NP_Name = (NP_Dummy + 12); + NP_Priority = (NP_Dummy + 13); + NP_ConsoleTask = (NP_Dummy + 14); + NP_WindowPtr = (NP_Dummy + 15); + NP_HomeDir = (NP_Dummy + 16); + NP_CopyVars = (NP_Dummy + 17); + NP_Cli = (NP_Dummy + 18); + NP_Path = (NP_Dummy + 19); + NP_CommandName = (NP_Dummy + 20); + NP_Arguments = (NP_Dummy + 21); + + NP_NotifyOnDeath = (NP_Dummy + 22); + NP_Synchronous = (NP_Dummy + 23); + NP_ExitCode = (NP_Dummy + 24); + NP_ExitData = (NP_Dummy + 25); + + { *** V50 *** } + NP_SeglistArray = (NP_Dummy + 26); + NP_UserData = (NP_Dummy + 27); + NP_StartupMsg = (NP_Dummy + 28); { * PMessage, ReplyMsg'd at exit * } + NP_TaskMsgPort = (NP_Dummy + 29); { * ^PMsgPort, create MsgPort, automagic delete * } + + NP_CodeType = (NP_Dummy + 100); + NP_PPC_Arg1 = (NP_Dummy + 101); + NP_PPC_Arg2 = (NP_Dummy + 102); + NP_PPC_Arg3 = (NP_Dummy + 103); + NP_PPC_Arg4 = (NP_Dummy + 104); + NP_PPC_Arg5 = (NP_Dummy + 105); + NP_PPC_Arg6 = (NP_Dummy + 106); + NP_PPC_Arg7 = (NP_Dummy + 107); + NP_PPC_Arg8 = (NP_Dummy + 108); + NP_PPCStackSize = (NP_Dummy + 109); + +const + ADO_Dummy = (TAG_USER + 2000); + ADO_FH_Mode = (ADO_Dummy + 1); + + ADO_DirLen = (ADO_Dummy + 2); + ADO_CommNameLen = (ADO_Dummy + 3); + ADO_CommFileLen = (ADO_Dummy + 4); + ADO_PromptLen = (ADO_Dummy + 5); + + { *** V50 *** } + ADDS_Dummy = (TAG_USER + 3000); + ADDS_Name = (ADDS_Dummy + 1); { * Segment name * } + ADDS_Seglist = (ADDS_Dummy + 2); { * Seglist for this segment * } + ADDS_Filename = (ADDS_Dummy + 3); { * Name of the file to load when needed. Ignored if Seglist is given. * } + ADDS_Type = (ADDS_Dummy + 4); { * Segment type * } + +const + FNDS_Dummy = (TAG_USER + 3100); + FNDS_Name = (FNDS_Dummy + 1); { * Segment name * } + FNDS_From = (FNDS_Dummy + 2); { * Segment to start from * } + FNDS_System = (FNDS_Dummy + 3); { * Look for a system segment ? * } + FNDS_Load = (FNDS_Dummy + 4); { * Load the seglist if needed ? (Default: TRUE) * } + + + +{ * dos stdio definitions + ********************************************************************* + * } + + +const + BUF_LINE = 0; + BUF_FULL = 1; + BUF_NONE = 2; + +const + ENDSTREAMCH = -1; + + + +{ * dos env-var definitions + ********************************************************************* + * } + + +type + PLocalVar = ^TLocalVar; + TLocalVar = packed record + lv_Node : TNode; + lv_Flags: Word; + lv_Value: PChar; + lv_Len : Cardinal; + end; + + +const + LV_VAR = 0; + LV_ALIAS = 1; + +const + LVB_IGNORE = 7; + LVF_IGNORE = (1 Shl LVB_IGNORE); + + GVB_GLOBAL_ONLY = 8; + GVF_GLOBAL_ONLY = (1 Shl GVB_GLOBAL_ONLY); + + GVB_LOCAL_ONLY = 9; + GVF_LOCAL_ONLY = (1 Shl GVB_LOCAL_ONLY); + + GVB_BINARY_VAR = 10; + GVF_BINARY_VAR = (1 Shl GVB_BINARY_VAR); + + GVB_DONT_NULL_TERM = 11; + GVF_DONT_NULL_TERM = (1 Shl GVB_DONT_NULL_TERM); + + GVB_SAVE_VAR = 12; + GVF_SAVE_VAR = (1 Shl GVB_SAVE_VAR); + + + +{ * dos ReadArgs definitions + ********************************************************************* + * } + + +type + PCSource = ^TCSource; + TCSource = packed record + CS_Buffer: PChar; + CS_Length: LongInt; + CS_CurChr: LongInt; + end; + +type + PRDArgs = ^TRDArgs; + TRDArgs = packed record + RDA_Source : TCSource; + RDA_DAList : LongInt; + RDA_Buffer : PChar; + RDA_BufSiz : LongInt; + RDA_ExtHelp: PChar; + RDA_Flags : LongInt; + end; + + +const + RDAB_STDIN = 0; + RDAF_STDIN = (1 Shl RDAB_STDIN); + + RDAB_NOALLOC = 1; + RDAF_NOALLOC = (1 Shl RDAB_NOALLOC); + + RDAB_NOPROMPT = 2; + RDAF_NOPROMPT = (1 Shl RDAB_NOPROMPT); + +const + MAX_TEMPLATE_ITEMS = 100; + MAX_MULTIARGS = 128; + + + +{ * dos filehandler definitions + ********************************************************************* + * } + + +type + PDosEnvec = ^TDosEnvec; + TDosEnvec = packed record + de_TableSize : Cardinal; + de_SizeBlock : Cardinal; + de_SecOrg : Cardinal; + de_Surfaces : Cardinal; + de_SectorPerBlock: Cardinal; + de_BlocksPerTrack: Cardinal; + de_Reserved : Cardinal; + de_PreAlloc : Cardinal; + de_Interleave : Cardinal; + de_LowCyl : Cardinal; + de_HighCyl : Cardinal; + de_NumBuffers : Cardinal; + de_BufMemType : Cardinal; + de_MaxTransfer : Cardinal; + de_Mask : Cardinal; + de_BootPri : LongInt; + de_DosType : Cardinal; + de_Baud : Cardinal; + de_Control : Cardinal; + de_BootBlocks : Cardinal; + end; + + +const + DE_TABLESIZE = 0; + DE_SIZEBLOCK = 1; + DE_SECORG = 2; + DE_NUMHEADS = 3; + DE_SECSPERBLK = 4; + DE_BLKSPERTRACK = 5; + DE_RESERVEDBLKS = 6; + DE_PREFAC = 7; + DE_INTERLEAVE = 8; + DE_LOWCYL = 9; + DE_UPPERCYL = 10; + DE_NUMBUFFERS = 11; + DE_MEMBUFTYPE = 12; + DE_BUFMEMTYPE = 12; + DE_MAXTRANSFER = 13; + DE_MASK = 14; + DE_BOOTPRI = 15; + DE_DOSTYPE = 16; + DE_BAUD = 17; + DE_CONTROL = 18; + DE_BOOTBLOCKS = 19; + + +type + PFileSysStartupMsg = ^TFileSysStartupMsg; + TFileSysStartupMsg = packed record + fssm_Unit : Cardinal; + fssm_Device : LongInt; + fssm_Environ: LongInt; + fssm_Flags : Cardinal; + end; + +type + PDeviceNode = ^TDeviceNode; + TDeviceNode = packed record + dn_Next : LongInt; + dn_Type : Cardinal; + dn_Task : PMsgPort; + dn_Lock : LongInt; + dn_Handler : LongInt; + dn_StackSize: Cardinal; + dn_Priority : LongInt; + dn_Startup : LongInt; + dn_SegList : LongInt; + dn_GlobalVec: LongInt; + dn_Name : LongInt; + end; + + + +{ * dos notification definitions + ********************************************************************* + * } + + +const + NOTIFY_CLASS = $40000000; + NOTIFY_CODE = $1234; + + +type + PNotifyRequest = ^TNotifyRequest; + TNotifyRequest = packed record + nr_Name : PChar; + nr_FullName: PChar; + nr_UserData: Cardinal; + nr_Flags : Cardinal; + nr_stuff : record + case Byte of + 0 : ( nr_Msg : record + nr_Port: PMsgPort; + end ); + 1 : ( nr_Signal : record + nr_Task : PTask; + nr_SignalNum: Byte; + nr_pad : Array[0..2] Of Byte; + end ); + end; + nr_Reserved: Array[0..3] Of Cardinal; + nr_MsgCount: Cardinal; + nr_Handler : PMsgPort; + end; + +type + PNotifyMessage = ^TNotifyMessage; + TNotifyMessage = packed record + nm_ExecMessage: TMessage; + nm_Class : Cardinal; + nm_Code : Word; + nm_NReq : PNotifyRequest; + nm_DoNotTouch : Cardinal; + nm_DoNotTouch2: Cardinal; + end; + + +const + NRB_SEND_MESSAGE = 0; + NRB_SEND_SIGNAL = 1; + NRB_WAIT_REPLY = 3; + NRB_NOTIFY_INITIAL = 4; + + NRB_MAGIC = 31; + +const + NRF_SEND_MESSAGE = (1 Shl NRB_SEND_MESSAGE); + NRF_SEND_SIGNAL = (1 Shl NRB_SEND_SIGNAL); + NRF_WAIT_REPLY = (1 Shl NRB_WAIT_REPLY); + NRF_NOTIFY_INITIAL = (1 Shl NRB_NOTIFY_INITIAL); + + NRF_MAGIC = (1 Shl NRB_MAGIC); + +const + NR_HANDLER_FLAGS = $ffff0000; + + + +{ * dos.library segtracker include + ********************************************************************* + * } + + +const + SEG_SEM = 'SegTracker'; + + +type + PSegSem = ^TSegSem; + TSegSem = packed record + seg_Semaphore: TSignalSemaphore; + seg_Find : Procedure; { Name = seg_Find(REG(a0, ULONG Address), REG(a1, ULONG *SegNum), REG(a2, ULONG *Offset)) } + seg_List : TMinList; + end; + +type + PSegArray = ^TSegArray; + TSegArray = packed record + seg_Address: Cardinal; + seg_Size : Cardinal; + end; + +type + PSegNode = ^TSegNode; + TSegNode = packed record + seg_Node : TMinNode; + seg_Name : PChar; + seg_Array: Array[0..0] Of TSegArray; + end; + + +{.$include doslibd.inc} +{.$include doslibf.inc} + +{ dos.library functions } + +function Open(fname : PChar location 'd1'; + accessMode: LongInt location 'd2'): LongInt; +SysCall MOS_DOSBase 30; + +function dosClose(fileh: LongInt location 'd1'): LongBool; +SysCall MOS_DOSBase 36; + +function dosRead(fileh : LongInt location 'd1'; + buffer: Pointer location 'd2'; + length: LongInt location 'd3'): LongInt; +SysCall MOS_DOSBase 42; + +function dosWrite(fileh : LongInt location 'd1'; + buffer: Pointer location 'd2'; + length: LongInt location 'd3'): LongInt; +SysCall MOS_DOSBase 48; + +function dosInput: LongInt; +SysCall MOS_DOSBase 54; + +function dosOutput: LongInt; +SysCall MOS_DOSBase 60; + +function dosSeek(fileh : LongInt location 'd1'; + position: LongInt location 'd2'; + posmode : LongInt location 'd3'): LongInt; +SysCall MOS_DOSBase 66; + +function dosDeleteFile(fname: PChar location 'd1'): LongBool; +SysCall MOS_DOSBase 72; + +function dosRename(oldName: PChar location 'd1'; + newName: PChar location 'd2'): LongInt; +SysCall MOS_DOSBase 78; + +function Lock(lname : PChar location 'd1'; + accessMode: LongInt location 'd2'): LongInt; +SysCall MOS_DOSBase 84; + +procedure Unlock(lock: LongInt location 'd1'); +SysCall MOS_DOSBase 90; + +function DupLock(lock: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 096; + +function Examine(lock : LongInt location 'd1'; + fileInfoBlock: PFileInfoBlock location 'd2'): LongInt; +SysCall MOS_DOSBase 102; + +function ExNext(lock : LongInt location 'd1'; + fileInfoBlock: PFileInfoBlock location 'd2'): LongInt; +SysCall MOS_DOSBase 108; + +function Info(lock : LongInt location 'd1'; + parameterBlock: PInfoData location 'd2'): LongInt; +SysCall MOS_DOSBase 114; + +function dosCreateDir(dname: PChar location 'd1'): LongInt; +SysCall MOS_DOSBase 120; + +function CurrentDir(lock: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 126; + +function IoErr: LongInt; +SysCall MOS_DOSBase 132; + +function CreateProc(name : PChar location 'd1'; + pri : LongInt location 'd2'; + segList : LongInt location 'd3'; + stackSize: LongInt location 'd4'): PMsgPort; +SysCall MOS_DOSBase 138; + +procedure dosExit(returnCode: LongInt location 'd1'); +SysCall MOS_DOSBase 144; + +function LoadSeg(name: PChar location 'd1'): LongInt; +SysCall MOS_DOSBase 150; + +procedure UnLoadSeg(seglist: LongInt location 'd1'); +SysCall MOS_DOSBase 156; + +function DeviceProc(name: PChar location 'd1'): PMsgPort; +SysCall MOS_DOSBase 174; + +function SetComment(name : PChar location 'd1'; + comment: PChar location 'd2'): LongBool; +SysCall MOS_DOSBase 180; + +function SetProtection(name: PChar location 'd1'; + mask: LongInt location 'd2'): LongInt; +SysCall MOS_DOSBase 186; + +function DateStamp(date: PDateStamp location 'd1'): PDateStamp; +SysCall MOS_DOSBase 192; + +procedure DOSDelay(timeout: LongInt location 'd1'); +SysCall MOS_DOSBase 198; + +function WaitForChar(file1 : LongInt location 'd1'; + timeout: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 204; + +function ParentDir(lock: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 210; + +function IsInteractive(file1: LongInt location 'd1'): LongBool; +SysCall MOS_DOSBase 216; + +function Execute(string1: PChar location 'd1'; + file1 : LongInt location 'd2'; + file2 : LongInt location 'd3'): LongBool; +SysCall MOS_DOSBase 222; + +function AllocDosObject(type1: Cardinal location 'd1'; + tags : PTagItem location 'd2'): Pointer; +SysCall MOS_DOSBase 228; + +function AllocDosObjectTagList(type1: Cardinal location 'd1'; + tags : PTagItem location 'd2'): Pointer; +SysCall MOS_DOSBase 228; + +procedure FreeDosObject(type1: Cardinal location 'd1'; + ptr : Pointer location 'd2'); +SysCall MOS_DOSBase 234; + +function DoPkt(port : PMsgPort location 'd1'; + action: LongInt location 'd2'; + arg1 : LongInt location 'd3'; + arg2 : LongInt location 'd4'; + arg3 : LongInt location 'd5'; + arg4 : LongInt location 'd6'; + arg5 : LongInt location 'd7'): LongInt; +SysCall MOS_DOSBase 240; + +function DoPkt0(port : PMsgPort location 'd1'; + action: LongInt location 'd2'): LongInt; +SysCall MOS_DOSBase 240; + +function DoPkt1(port : PMsgPort location 'd1'; + action: LongInt location 'd2'; + arg1 : LongInt location 'd3'): LongInt; +SysCall MOS_DOSBase 240; + +function DoPkt2(port : PMsgPort location 'd1'; + action: LongInt location 'd2'; + arg1 : LongInt location 'd3'; + arg2 : LongInt location 'd4'): LongInt; +SysCall MOS_DOSBase 240; + +function DoPkt3(port : PMsgPort location 'd1'; + action: LongInt location 'd2'; + arg1 : LongInt location 'd3'; + arg2 : LongInt location 'd4'; + arg3 : LongInt location 'd5'): LongInt; +SysCall MOS_DOSBase 240; + +function DoPkt4(port : PMsgPort location 'd1'; + action: LongInt location 'd2'; + arg1 : LongInt location 'd3'; + arg2 : LongInt location 'd4'; + arg3 : LongInt location 'd5'; + arg4 : LongInt location 'd6'): LongInt; +SysCall MOS_DOSBase 240; + +procedure SendPkt(dp : PDosPacket location 'd1'; + port : PMsgPort location 'd2'; + replyport: PMsgPort location 'd3'); +SysCall MOS_DOSBase 246; + +function WaitPkt: PDosPacket; +SysCall MOS_DOSBase 252; + +procedure ReplyPkt(dp : PDosPacket location 'd1'; + res1: LongInt location 'd2'; + res2: LongInt location 'd3'); +SysCall MOS_DOSBase 258; + +procedure AbortPkt(port: PMsgPort location 'd1'; + pkt : PDosPacket location 'd2'); +SysCall MOS_DOSBase 264; + +function LockRecord(fh : LongInt location 'd1'; + offset : Cardinal location 'd2'; + length : Cardinal location 'd3'; + mode : Cardinal location 'd4'; + timeout: Cardinal location 'd5'): LongBool; +SysCall MOS_DOSBase 270; + +function LockRecords(recArray: PRecordLock location 'd1'; + timeout : Cardinal location 'd2'): LongBool; +SysCall MOS_DOSBase 276; + +function UnLockRecord(fh : LongInt location 'd1'; + offset: Cardinal location 'd2'; + length: Cardinal location 'd3'): LongBool; +SysCall MOS_DOSBase 282; + +function UnLockRecords(recArray: PRecordLock location 'd1'): LongBool; +SysCall MOS_DOSBase 288; + +function SelectInput(fh: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 294; + +function SelectOutput(fh: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 300; + +function FGetC(fh: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 306; + +function FPutC(fh: LongInt location 'd1'; + ch: LongInt location 'd2'): LongInt; +SysCall MOS_DOSBase 312; + +function UnGetC(fh : LongInt location 'd1'; + character: LongInt location 'd2'): LongInt; +SysCall MOS_DOSBase 318; + +function FRead(fh : LongInt location 'd1'; + block : Pointer location 'd2'; + blocklen: Cardinal location 'd3'; + number : Cardinal location 'd4'): LongInt; +SysCall MOS_DOSBase 324; + +function FWrite(fh : LongInt location 'd1'; + block : Pointer location 'd2'; + blocklen: Cardinal location 'd3'; + number : Cardinal location 'd4'): LongInt; +SysCall MOS_DOSBase 330; + +function FGets(fh : LongInt location 'd1'; + buf : PChar location 'd2'; + buflen: Cardinal location 'd3'): PChar; +SysCall MOS_DOSBase 336; + +function FPuts(fh : LongInt location 'd1'; + str: PChar location 'd2'): LongInt; +SysCall MOS_DOSBase 342; + +procedure VFWritef(fh : LongInt location 'd1'; + format : PChar location 'd2'; + argarray: Pointer location 'd3'); +SysCall MOS_DOSBase 348; + +function VFPrintf(fh : LongInt location 'd1'; + format : PChar location 'd2'; + argarray: Pointer location 'd3'): LongInt; +SysCall MOS_DOSBase 354; + +function dosFlush(fh: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 360; + +function SetVBuf(fh : LongInt location 'd1'; + buff : PChar location 'd2'; + type1: LongInt location 'd3'; + size : LongInt location 'd4'): LongInt; +SysCall MOS_DOSBase 366; + +function DupLockFromFH(fh: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 372; + +function OpenFromLock(lock: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 378; + +function ParentOfFH(fh: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 384; + +function ExamineFH(fh : LongInt location 'd1'; + fib: PFileInfoBlock location 'd2'): LongBool; +SysCall MOS_DOSBase 390; + +function SetFileDate(name: PChar location 'd1'; + date: PDateStamp location 'd2'): LongBool; +SysCall MOS_DOSBase 396; + +function NameFromLock(lock : LongInt location 'd1'; + buffer: PChar location 'd2'; + len : LongInt location 'd3'): LongBool; +SysCall MOS_DOSBase 402; + +function NameFromFH(fh : LongInt location 'd1'; + buffer: PChar location 'd2'; + len : LongInt location 'd3'): LongBool; +SysCall MOS_DOSBase 408; + +function SplitName(name : PChar location 'd1'; + separator: Cardinal location 'd2'; + buf : PChar location 'd3'; + oldpos : LongInt location 'd4'; + size : LongInt location 'd5'): SmallInt; +SysCall MOS_DOSBase 414; + +function SameLock(lock1: LongInt location 'd1'; + lock2: LongInt location 'd2'): LongInt; +SysCall MOS_DOSBase 420; + +function SetMode(fh : LongInt location 'd1'; + mode: LongInt location 'd2'): LongInt; +SysCall MOS_DOSBase 426; + +function ExAll(lock : LongInt location 'd1'; + buffer : PExAllData location 'd2'; + size : LongInt location 'd3'; + data : LongInt location 'd4'; + control: PExAllControl location 'd5'): LongBool; +SysCall MOS_DOSBase 432; + +function ReadLink(port : PMsgPort location 'd1'; + lock : LongInt location 'd2'; + path : PChar location 'd3'; + buffer: PChar location 'd4'; + size : Cardinal location 'd5'): LongBool; +SysCall MOS_DOSBase 438; + +function MakeLink(name: PChar location 'd1'; + dest: LongInt location 'd2'; + soft: LongInt location 'd3'): LongBool; +SysCall MOS_DOSBase 444; + +function ChangeMode(type1 : LongInt location 'd1'; + fh : LongInt location 'd2'; + newmode: LongInt location 'd3'): LongBool; +SysCall MOS_DOSBase 450; + +function SetFileSize(fh : LongInt location 'd1'; + pos : LongInt location 'd2'; + mode: LongInt location 'd3'): LongInt; +SysCall MOS_DOSBase 456; + +function SetIoErr(result: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 462; + +function Fault(code : LongInt location 'd1'; + header: PChar location 'd2'; + buffer: PChar location 'd3'; + len : LongInt location 'd4'): LongBool; +SysCall MOS_DOSBase 468; + +function PrintFault(code : LongInt location 'd1'; + header: PChar location 'd2'): LongBool; +SysCall MOS_DOSBase 474; + +function ErrorReport(code : LongInt location 'd1'; + type1 : LongInt location 'd2'; + arg1 : Cardinal location 'd3'; + device: PMsgPort location 'd4'): LongBool; +SysCall MOS_DOSBase 480; + +function Cli: PCommandLineInterface; +SysCall MOS_DOSBase 492; + +function CreateNewProc(tags: PTagItem location 'd1'): PProcess; +SysCall MOS_DOSBase 498; + +function CreateNewProcTagList(tags: PTagItem location 'd1'): PProcess; +SysCall MOS_DOSBase 498; + +function RunCommand(seg : LongInt location 'd1'; + stack : LongInt location 'd2'; + paramptr: PChar location 'd3'; + paramlen: LongInt location 'd4'): LongInt; +SysCall MOS_DOSBase 504; + +function GetConsoleTask: PMsgPort; +SysCall MOS_DOSBase 510; + +function SetConsoleTask(task: PMsgPort location 'd1'): PMsgPort; +SysCall MOS_DOSBase 516; + +function GetFileSysTask: PMsgPort; +SysCall MOS_DOSBase 522; + +function SetFileSysTask(task: PMsgPort location 'd1'): PMsgPort; +SysCall MOS_DOSBase 528; + +function GetArgStr: PChar; +SysCall MOS_DOSBase 534; + +function SetArgStr(str: PChar location 'd1'): LongBool; +SysCall MOS_DOSBase 540; + +function FindCliProc(num: Cardinal location 'd1'): PProcess; +SysCall MOS_DOSBase 546; + +function MaxCli: Cardinal; +SysCall MOS_DOSBase 552; + +function SetCurrentDirName(name: PChar location 'd1'): LongBool; +SysCall MOS_DOSBase 558; + +function GetCurrentDirName(buf: PChar location 'd1'; + len: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 564; + +function SetProgramName(name: PChar location 'd1'): LongBool; +SysCall MOS_DOSBase 570; + +function GetProgramName(buf: PChar location 'd1'; + len: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 576; + +function SetPrompt(name: PChar location 'd1'): LongBool; +SysCall MOS_DOSBase 582; + +function GetPrompt(buf: PChar location 'd1'; + len: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 588; + +function SetProgramDir(lock: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 594; + +function GetProgramDir: LongInt; +SysCall MOS_DOSBase 600; + +function SystemTagList(command: PChar location 'd1'; + tags : PTagItem location 'd2'): LongInt; +SysCall MOS_DOSBase 606; + +function dosSystem(command: PChar location 'd1'; + tags : PTagItem location 'd2'): LongInt; +SysCall MOS_DOSBase 606; + +function AssignLock(name: PChar location 'd1'; + lock: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 612; + +function AssignLate(name: PChar location 'd1'; + path: PChar location 'd2'): LongBool; +SysCall MOS_DOSBase 618; + +function AssignPath(name: PChar location 'd1'; + path: PChar location 'd2'): LongBool; +SysCall MOS_DOSBase 624; + +function AssignAdd(name: PChar location 'd1'; + lock: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 630; + +function RemAssignList(name: PChar location 'd1'; + lock: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 636; + +function GetDeviceProc(name: PChar location 'd1'; + dp : PDevProc location 'd2'): PDevProc; +SysCall MOS_DOSBase 642; + +procedure FreeDeviceProc(dp: PDevProc location 'd1'); +SysCall MOS_DOSBase 648; + +function LockDosList(flags: Cardinal location 'd1'): PDosList; +SysCall MOS_DOSBase 654; + +procedure UnLockDosList(flags: Cardinal location 'd1'); +SysCall MOS_DOSBase 660; + +function AttemptLockDosList(flags: Cardinal location 'd1'): PDosList; +SysCall MOS_DOSBase 666; + +function RemDosEntry(dlist: PDosList location 'd1'): LongBool; +SysCall MOS_DOSBase 672; + +function AddDosEntry(dlist: PDosList location 'd1'): LongInt; +SysCall MOS_DOSBase 678; + +function FindDosEntry(dlist: PDosList location 'd1'; + name : PChar location 'd2'; + flags: Cardinal location 'd3'): PDosList; +SysCall MOS_DOSBase 684; + +function NextDosEntry(dlist: PDosList location 'd1'; + flags: Cardinal location 'd2'): PDosList; +SysCall MOS_DOSBase 690; + +function MakeDosEntry(name : PChar location 'd1'; + type1: LongInt location 'd2'): PDosList; +SysCall MOS_DOSBase 696; + +procedure FreeDosEntry(dlist: PDosList location 'd1'); +SysCall MOS_DOSBase 702; + +function IsFileSystem(name: PChar location 'd1'): LongBool; +SysCall MOS_DOSBase 708; + +function Format(filesystem: PChar location 'd1'; + volumename: PChar location 'd2'; + dostype : Cardinal location 'd3'): LongBool; +SysCall MOS_DOSBase 714; + +function Relabel(drive : PChar location 'd1'; + newname: PChar location 'd2'): LongBool; +SysCall MOS_DOSBase 720; + +function Inhibit(name : PChar location 'd1'; + onoff: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 726; + +function AddBuffers(name : PChar location 'd1'; + number: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 732; + +function CompareDates(date1: PDateStamp location 'd1'; + date2: PDateStamp location 'd2'): LongInt; +SysCall MOS_DOSBase 738; + +function DateToStr(datetime: _PDateTime location 'd1'): LongBool; +SysCall MOS_DOSBase 744; + +function StrToDate(datetime: _PDateTime location 'd1'): LongBool; +SysCall MOS_DOSBase 750; + +function InternalLoadSeg(fh : LongInt location 'd0'; + table : LongInt location 'a0'; + var funcarray: LongInt location 'a1'; + var stack : LongInt location 'a2'): LongInt; +SysCall MOS_DOSBase 756; + +function NewLoadSeg(file1: PChar location 'd1'; + tags : PTagItem location 'd2'): LongInt; +SysCall MOS_DOSBase 768; + +function NewLoadSegTagList(file1: PChar location 'd1'; + tags : PTagItem location 'd2'): LongInt; +SysCall MOS_DOSBase 768; + +function AddSegment(name : PChar location 'd1'; + seg : LongInt location 'd2'; + system: LongInt location 'd3'): LongBool; +SysCall MOS_DOSBase 774; + +function FindSegment(name : PChar location 'd1'; + seg : PSegment location 'd2'; + system: LongInt location 'd3'): PSegment; +SysCall MOS_DOSBase 780; + +function RemSegment(seg: PSegment location 'd1'): LongBool; +SysCall MOS_DOSBase 786; + +function CheckSignal(mask: LongInt location 'd1'): LongInt; +SysCall MOS_DOSBase 792; + +function ReadArgs(arg_template: PChar location 'd1'; + var array1 : LongInt location 'd2'; + args : PRDArgs location 'd3'): PRDArgs; +SysCall MOS_DOSBase 798; + +function FindArg(keyword : PChar location 'd1'; + arg_template: PChar location 'd2'): LongInt; +SysCall MOS_DOSBase 804; + +function ReadItem(name : PChar location 'd1'; + maxchars: LongInt location 'd2'; + cSource : PCSource location 'd3'): LongInt; +SysCall MOS_DOSBase 810; + +function StrToLong(string1 : PChar location 'd1'; + var value: LongInt location 'd2'): LongInt; +SysCall MOS_DOSBase 816; + +function MatchFirst(pat : PChar location 'd1'; + anchor: PAnchorPath location 'd2'): LongInt; +SysCall MOS_DOSBase 822; + +function MatchNext(anchor: PAnchorPath location 'd1'): LongInt; +SysCall MOS_DOSBase 828; + +procedure MatchEnd(anchor: PAnchorPath location 'd1'); +SysCall MOS_DOSBase 834; + +function ParsePattern(pat : PChar location 'd1'; + buf : PChar location 'd2'; + buflen: LongInt location 'd3'): LongInt; +SysCall MOS_DOSBase 840; + +function MatchPattern(pat: PChar location 'd1'; + str: PChar location 'd2'): LongBool; +SysCall MOS_DOSBase 846; + +procedure FreeArgs(args: pRDArgs location 'd1'); +SysCall MOS_DOSBase 858; + +function FilePart(path: PChar location 'd1'): PChar; +SysCall MOS_DOSBase 870; + +function PathPart(path: PChar location 'd1'): PChar; +SysCall MOS_DOSBase 876; + +function AddPart(dirname: PChar location 'd1'; + filename: PChar location 'd2'; + size : Cardinal location 'd3'): LongBool; +SysCall MOS_DOSBase 882; + +function StartNotify(notify: PNotifyRequest location 'd1'): LongBool; +SysCall MOS_DOSBase 888; + +procedure EndNotify(notify: PNotifyRequest location 'd1'); +SysCall MOS_DOSBase 894; + +function SetVar(name : PChar location 'd1'; + buffer: PChar location 'd2'; + size : LongInt location 'd3'; + flags : LongInt location 'd4'): LongBool; +SysCall MOS_DOSBase 900; + +function GetVar(name : PChar location 'd1'; + buffer: PChar location 'd2'; + size : LongInt location 'd3'; + flags : LongInt location 'd4'): LongInt; +SysCall MOS_DOSBase 906; + +function DeleteVar(name : PChar location 'd1'; + flags: Cardinal location 'd2'): LongBool; +SysCall MOS_DOSBase 912; + +function FindVar(name : PChar location 'd1'; + type1: Cardinal location 'd2'): PLocalVar; +SysCall MOS_DOSBase 918; + +function CliInitNewcli(dp: PDosPacket location 'a0'): LongInt; +SysCall MOS_DOSBase 930; + +function CliInitRun(dp: PDosPacket location 'a0'): LongInt; +SysCall MOS_DOSBase 936; + +function WriteChars(buf : PChar location 'd1'; + buflen: Cardinal location 'd2'): LongInt; +SysCall MOS_DOSBase 942; + +function PutStr(str: PChar location 'd1'): LongInt; +SysCall MOS_DOSBase 948; + +function VPrintf(format : PChar location 'd1'; + argarray: Pointer location 'd2'): LongInt; +SysCall MOS_DOSBase 954; + +function ParsePatternNoCase(pat : PChar location 'd1'; + buf : PChar location 'd2'; + buflen: LongInt location 'd3'): LongInt; +SysCall MOS_DOSBase 966; + +function MatchPatternNoCase(pat: PChar location 'd1'; + str: PChar location 'd2'): LongBool; +SysCall MOS_DOSBase 972; + +function SameDevice(lock1: LongInt location 'd1'; + lock2: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 984; + +procedure ExAllEnd(lock : LongInt location 'd1'; + buffer : PExAllData location 'd2'; + size : LongInt location 'd3'; + data : LongInt location 'd4'; + control: PExAllControl location 'd5'); +SysCall MOS_DOSBase 990; + +function SetOwner(name : PChar location 'd1'; + owner_info: LongInt location 'd2'): LongBool; +SysCall MOS_DOSBase 996; + +function AddSegmentTagList(tags: PTagItem location 'a0'): LongInt; +SysCall MOS_DOSBase 1002; + +function FindSegmentTagList(tags: PTagItem location 'a0'): PSegment; +SysCall MOS_DOSBase 1008; + + + + + +{ * dos global definitions (V50) + ********************************************************************* + * } + +function BADDR(x: LongInt): Pointer; Inline; +function MKBADDR(x: Pointer): LongInt; Inline; + + +{ * dos stdio definitions + ********************************************************************* + * } + +function ReadChar: LongInt; Inline; +function WriteChar(ch: Char): LongInt; Inline; +function UnReadChar(ch: Char): LongInt; Inline; +function ReadChars(buf: Pointer; num: LongInt): LongInt; Inline; +function dosReadLn(buf: PChar; num: LongInt): PChar; Inline; +function WriteStr(str: PChar): LongInt; Inline; +procedure VWritef(format: PChar; argv: Pointer); Inline; + + +{ * calls with tags workarounds (should be removed later) + ********************************************************************* + * } + +function CreateNewProcTags(tags: array of dword): PProcess; Inline; + + + +implementation + + +{ * dos stdio definitions + ********************************************************************* + * } + +function ReadChar: LongInt; Inline; +begin + ReadChar:=FGetC(dosInput); +end; + +function WriteChar(ch: Char): LongInt; Inline; +begin + WriteChar:=FPutC(dosOutput,Byte(ch)); +end; + +function UnReadChar(ch: Char): LongInt; Inline; +begin + UnReadChar:=UnGetC(dosInput,Byte(ch)); +end; + +function ReadChars(buf: Pointer; num: LongInt): LongInt; Inline; +begin + ReadChars:=FRead(dosInput,buf,1,num); +end; + +function dosReadLn(buf: PChar; num: LongInt): PChar; Inline; +begin + dosReadLn:=FGets(dosInput,buf,num); +end; + +function WriteStr(str: PChar): LongInt; Inline; +begin + WriteStr:=FPuts(dosOutput,str); +end; + +procedure VWritef(format: PChar; argv: Pointer); Inline; +begin + VFWritef(dosOutput,format,argv); +end; + + + +{ * dos global definitions (V50) + ********************************************************************* + * } + + +function BADDR(x: LongInt): Pointer; Inline; +begin + BADDR:=Pointer(x Shl 2); +end; + +function MKBADDR(x: Pointer): LongInt; Inline; +begin + MKBADDR:=LongInt(PtrUInt(x)) Shr 2; +end; + + + +{ * calls with tags workarounds (should be removed later) + ********************************************************************* + * } + +function CreateNewProcTags(tags: array of DWord): PProcess; Inline; +begin + CreateNewProcTags:=CreateNewProc(@tags); +end; + + +begin + DosBase:=MOS_DOSBase; +end. diff --git a/packages/morphunits/src/amigalib.pas b/packages/morphunits/src/amigalib.pas new file mode 100644 index 0000000000..968a956d8e --- /dev/null +++ b/packages/morphunits/src/amigalib.pas @@ -0,0 +1,114 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2005 Karoly Balogh + + abox.lib implementation for MorphOS/PowerPC + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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 amigalib; + +interface + +function DoMethod(obj : longword; msg : array of LongWord): longword; +function DoMethod(obj : pointer; msg : array of LongWord): longword; inline; +function DoMethodA(obj : longword; msg1 : Pointer): longword; assembler; + +function DoSuperMethod(class_: longword; obj : longword; msg : array of LongWord): longword; +function DoSuperMethodA(class_: longword; obj : longword; msg1 : Pointer): longword; assembler; +function DoSuperMethodA(class_: pointer; obj : pointer; msg1 : Pointer): longword; inline; + +function DoSuperNew(class_: pointer; obj: pointer; tags: array of LongWord): longword; + +// This procedure is used to pop dispatcher args from emulstruc +procedure DISPATCHERARG(var cl; var obj; var msg); assembler; + +implementation + +uses intuition; + +function DoMethodA(obj : longword; msg1 : Pointer): longword; assembler; +asm + mflr r31 + + lwz r9,-4(r3) + stw r9,32(r2) + stw r4,36(r2) + stw r3,40(r2) + + lwz r11,104(r2) + lwz r3,8(r9) + mtlr r11 + blrl + + mtlr r31 +end ['R31']; + +function DoMethod(obj : longword; msg : array of LongWord): longword; +begin + DoMethod:=DoMethodA(obj, @msg); +end; + +function DoMethod(obj : pointer; msg : array of LongWord): longword; inline; +begin + DoMethod:=DoMethodA(DWord(obj), @msg); +end; + +function DoSuperMethodA(class_: longword; obj : longword; msg1 : Pointer): longword; assembler; +asm + mflr r31 + + lwz r9,24(r3) + stw r9,32(r2) + stw r5,36(r2) + stw r4,40(r2) + + lwz r11,104(r2) + lwz r3,8(r9) + mtlr r11 + blrl + + mtlr r31 +end ['R31']; + +function DoSuperMethodA(class_: pointer; obj : pointer; msg1 : Pointer): longword; inline; +begin + DoSuperMethodA:=DoSuperMethodA(DWord(class_),DWord(obj),msg1); +end; + +function DoSuperMethod(class_: longword; obj : longword; msg : array of LongWord): longword; +begin + DoSuperMethod:=DoSuperMethodA(class_, obj, @msg); +end; + +function DoSuperNew(class_: pointer; obj: pointer; tags: array of LongWord): longword; +var opSet: topSet; +begin + opSet.MethodID := OM_NEW; + opSet.ops_AttrList := @tags; + opSet.ops_GInfo := nil; + DoSuperNew:=DoSuperMethodA(class_,obj,@opset); +end; + +// This procedure is used to pop dispatcher args from emulstruc +procedure DISPATCHERARG(var cl; var obj; var msg); assembler; +asm + lwz r6,32(r2) // REG_a0 + stw r6,(r3) // cl + lwz r6,40(r2) // REG_a2 + stw r6,(r4) // obj + lwz r6,36(r2) // REG_a1 + stw r6,(r5) // msg +end; + +end. diff --git a/packages/morphunits/src/asl.pas b/packages/morphunits/src/asl.pas new file mode 100644 index 0000000000..2c9f4a24c4 --- /dev/null +++ b/packages/morphunits/src/asl.pas @@ -0,0 +1,610 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2005 Karoly Balogh for Genesi S.a.r.l. + + asl.library interface unit for MorphOS/PowerPC + + Based on work of Nils Sjoholm member of the Amiga RTL + development team. + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} + +{$PACKRECORDS 2} +unit asl; + +interface + +uses exec, utility, {workbench,} agraphics; + + +{************************************************************************} + +const + ASLNAME : PChar = 'asl.library'; + ASL_TB = TAG_USER+$80000; + +{************************************************************************} + +{ Types of requesters known to ASL, used as arguments to AllocAslRequest() } + ASL_FileRequest = 0; + ASL_FontRequest = 1; + ASL_ScreenModeRequest = 2; + + +{**************************************************************************** + * + * ASL File Requester data structures and constants + * + * This structure must only be allocated by asl.library amd is READ-ONLY! + * Control of the various fields is provided via tags when the requester + * is created with AllocAslRequest() and when it is displayed via + * AslRequest() + } + +type + pFileRequester = ^tFileRequester; + tFileRequester = record + rf_Reserved0 : Array[0..3] Of Byte; + rf_File : PChar; { Filename pointer } + rf_Dir : PChar; { Directory name pointer } + rf_Reserved1 : Array[0..9] Of Byte; + rf_LeftEdge : smallint; + rf_TopEdge : smallint; { Preferred window pos } + rf_Width : smallint; + rf_Height : smallint; { Preferred window size } + rf_Reserved2 : Array[0..1] Of Byte; + rf_NumArgs : LongInt; { A-la WB Args, FOR multiselects } +{$WARNING FIX ME!!! Needs workbench unit} +{ rf_ArgList : pWBArgList;} + rf_ArgList : Pointer; + rf_UserData : Pointer; { Applihandle (you may write!!) } + rf_Reserved3 : Array[0..7] Of Byte; + rf_Pat : PChar; { Pattern match pointer } + END; { note - more reserved fields follow } + + +{ File requester tag values, used by AllocAslRequest() and AslRequest() } + +const +{ Window control } + ASLFR_Window = ASL_TB+2 ; { Parent window } + ASLFR_Screen = ASL_TB+40; { Screen to open on if no window } + ASLFR_PubScreenName = ASL_TB+41; { Name of public screen } + ASLFR_PrivateIDCMP = ASL_TB+42; { Allocate private IDCMP? } + ASLFR_IntuiMsgFunc = ASL_TB+70; { Function to handle IntuiMessages } + ASLFR_SleepWindow = ASL_TB+43; { Block input in ASLFR_Window? } + ASLFR_UserData = ASL_TB+52; { What to put in fr_UserData } + ASLFR_PopToFront = ASL_TB+131; { Make the requester window visible } + ASLFR_Activate = ASL_TB+132; { Activate the requester window when } + +{ Text display } + ASLFR_TextAttr = ASL_TB+51; { Text font to use for gadget text } + ASLFR_Locale = ASL_TB+50; { Locale ASL should use for text } + ASLFR_TitleText = ASL_TB+1 ; { Title of requester } + ASLFR_PositiveText = ASL_TB+18; { Positive gadget text } + ASLFR_NegativeText = ASL_TB+19; { Negative gadget text } + +{ Initial settings } + ASLFR_InitialLeftEdge= ASL_TB+3 ; { Initial requester coordinates } + ASLFR_InitialTopEdge = ASL_TB+4 ; + ASLFR_InitialWidth = ASL_TB+5 ; { Initial requester dimensions } + ASLFR_InitialHeight = ASL_TB+6 ; + ASLFR_InitialFile = ASL_TB+8 ; { Initial contents of File gadget } + ASLFR_InitialDrawer = ASL_TB+9 ; { Initial contents of Drawer gadg. } + ASLFR_InitialPattern = ASL_TB+10; { Initial contents of Pattern gadg.} + ASLFR_InitialShowVolumes = ASL_TB+130; { Initially, show the volume list (V44) } + +{ Options } + ASLFR_Flags1 = ASL_TB+20; { Option flags } + ASLFR_Flags2 = ASL_TB+22; { Additional option flags } + ASLFR_DoSaveMode = ASL_TB+44; { Being used for saving? } + ASLFR_DoMultiSelect = ASL_TB+45; { Do multi-select? } + ASLFR_DoPatterns = ASL_TB+46; { Display a Pattern gadget? } + +{ Filtering } + ASLFR_DrawersOnly = ASL_TB+47; { Don't display files? } + ASLFR_FilterFunc = ASL_TB+49; { Function to filter files } + ASLFR_RejectIcons = ASL_TB+60; { Display .info files? } + ASLFR_RejectPattern = ASL_TB+61; { Don't display files matching pat } + ASLFR_AcceptPattern = ASL_TB+62; { Accept only files matching pat } + ASLFR_FilterDrawers = ASL_TB+63; { Also filter drawers with patterns} + ASLFR_HookFunc = ASL_TB+7 ; { Combined callback function } + +{ Sorting } + ASLFR_SetSortBy = ASL_TB+124; { Sort criteria (name, date, size) } + ASLFR_GetSortBy = ASL_TB+125; + ASLFR_SetSortDrawers = ASL_TB+126; { Placement of drawers in the list } + ASLFR_GetSortDrawers = ASL_TB+127; + ASLFR_SetSortOrder = ASL_TB+128; { Order (ascending or descending) } + ASLFR_GetSortOrder = ASL_TB+129; + + +{ Flag bits for the ASLFR_Flags1 tag } + FRB_FILTERFUNC = 7; + FRB_INTUIFUNC = 6; + FRB_DOSAVEMODE = 5; + FRB_PRIVATEIDCMP = 4; + FRB_DOMULTISELECT = 3; + FRB_DOPATTERNS = 0; + + FRF_FILTERFUNC = 128; + FRF_INTUIFUNC = 64; + FRF_DOSAVEMODE = 32; + FRF_PRIVATEIDCMP = 16; + FRF_DOMULTISELECT = 8; + FRF_DOPATTERNS = 1; + +{ Flag bits for the ASLFR_Flags2 tag } + FRB_DRAWERSONLY = 0; + FRB_FILTERDRAWERS = 1; + FRB_REJECTICONS = 2; + + FRF_DRAWERSONLY = 1; + FRF_FILTERDRAWERS = 2; + FRF_REJECTICONS = 4; + +{ Sort criteria for the ASLFR_SetSortBy/ASLFR_GetSortBy tags } + ASLFRSORTBY_Name = 0; + ASLFRSORTBY_Date = 1; + ASLFRSORTBY_Size = 2; + +{ Drawer placement for the ASLFR_SetSortDrawers/ASLFR_GetSortDrawers tags } + ASLFRSORTDRAWERS_First = 0; + ASLFRSORTDRAWERS_Mix = 1; + ASLFRSORTDRAWERS_Last = 2; + +{ Sort order for the ASLFR_SetSortOrder/ASLFR_GetSortOrder tags } + ASLFRSORTORDER_Ascend = 0; + ASLFRSORTORDER_Descend = 1; + +{**************************************************************************** + * + * ASL Font Requester data structures and constants + * + * This structure must only be allocated by asl.library amd is READ-ONLY! + * Control of the various fields is provided via tags when the requester + * is created with AllocAslRequest() and when it is displayed via + * AslRequest() + } + +type + pFontRequester = ^tFontRequester; + tFontRequester = record + fo_Reserved0 : Array[0..7] Of Byte; + fo_Attr : tTextAttr; { Returned TextAttr } + fo_FrontPen : Byte; { Returned front pen } + fo_BackPen : Byte; { Returned back pen } + fo_DrawMode : Byte; { Returned drawing mode } + fo_Reserved1 : Byte; + fo_UserData : Pointer; { You can store your own data here } + fo_LeftEdge : smallint; { Coordinates Of requester on Exit } + fo_TopEdge : smallint; + fo_Width : smallint; + fo_Height : smallint; + fo_TAttr : tTTextAttr; { Returned TTextAttr } + end; + + +{ Font requester tag values, used by AllocAslRequest() AND AslRequest() } + +const +{ Window control } + ASLFO_Window = ASL_TB+2 ; { Parent window } + ASLFO_Screen = ASL_TB+40; { Screen to open on if no window } + ASLFO_PubScreenName = ASL_TB+41; { Name of public screen } + ASLFO_PrivateIDCMP = ASL_TB+42; { Allocate private IDCMP? } + ASLFO_IntuiMsgFunc = ASL_TB+70; { Function to handle IntuiMessages } + ASLFO_SleepWindow = ASL_TB+43; { Block input in ASLFO_Window? } + ASLFO_UserData = ASL_TB+52; { What to put in fo_UserData } + ASLFO_PopToFront = ASL_TB+131; { Make the requester window visible + * when it opens (V44) + } + ASLFO_Activate = ASL_TB+132; { Activate the requester window when + * it opens (V45). + } +{ Text display } + ASLFO_TextAttr = ASL_TB+51; { Text font to use for gadget text } + ASLFO_Locale = ASL_TB+50; { Locale ASL should use for text } + ASLFO_TitleText = ASL_TB+1 ; { Title of requester } + ASLFO_PositiveText = ASL_TB+18; { Positive gadget text } + ASLFO_NegativeText = ASL_TB+19; { Negative gadget text } + +{ Initial settings } + ASLFO_InitialLeftEdge= ASL_TB+3 ; { Initial requester coordinates } + ASLFO_InitialTopEdge = ASL_TB+4 ; + ASLFO_InitialWidth = ASL_TB+5 ; { Initial requester dimensions } + ASLFO_InitialHeight = ASL_TB+6 ; + ASLFO_InitialName = ASL_TB+10; { Initial contents of Name gadget } + ASLFO_InitialSize = ASL_TB+11; { Initial contents of Size gadget } + ASLFO_InitialStyle = ASL_TB+12; { Initial font style } + ASLFO_InitialFlags = ASL_TB+13; { Initial font flags for TextAttr } + ASLFO_InitialFrontPen= ASL_TB+14; { Initial front pen } + ASLFO_InitialBackPen = ASL_TB+15; { Initial back pen } + ASLFO_InitialDrawMode= ASL_TB+59; { Initial draw mode } + +{ Options } + ASLFO_Flags = ASL_TB+20; { Option flags } + ASLFO_DoFrontPen = ASL_TB+44; { Display Front color selector? } + ASLFO_DoBackPen = ASL_TB+45; { Display Back color selector? } + ASLFO_DoStyle = ASL_TB+46; { Display Style checkboxes? } + ASLFO_DoDrawMode = ASL_TB+47; { Display DrawMode cycle gadget? } + ASLFO_SampleText = ASL_TB+133; { Text to display in font sample area (V45) } + +{ Filtering } + ASLFO_FixedWidthOnly = ASL_TB+48; { Only allow fixed-width fonts? } + ASLFO_MinHeight = ASL_TB+16; { Minimum font height to display } + ASLFO_MaxHeight = ASL_TB+17; { Maximum font height to display } + ASLFO_FilterFunc = ASL_TB+49; { Function to filter fonts } + ASLFO_HookFunc = ASL_TB+7 ; { Combined callback function } + ASLFO_MaxFrontPen = ASL_TB+66; { Max # of colors in front palette } + ASLFO_MaxBackPen = ASL_TB+67; { Max # of colors in back palette } + +{ Custom additions } + ASLFO_ModeList = ASL_TB+21; { Substitute list for drawmodes } + ASLFO_FrontPens = ASL_TB+64; { Color table for front pen palette} + ASLFO_BackPens = ASL_TB+65; { Color table for back pen palette } + +{ Flag bits for ASLFO_Flags tag } + FOB_DOFRONTPEN = 0; + FOB_DOBACKPEN = 1; + FOB_DOSTYLE = 2; + FOB_DODRAWMODE = 3; + FOB_FIXEDWIDTHONLY= 4; + FOB_PRIVATEIDCMP = 5; + FOB_INTUIFUNC = 6; + FOB_FILTERFUNC = 7; + + FOF_DOFRONTPEN = 1; + FOF_DOBACKPEN = 2; + FOF_DOSTYLE = 4; + FOF_DODRAWMODE = 8; + FOF_FIXEDWIDTHONLY = 16; + FOF_PRIVATEIDCMP = 32; + FOF_INTUIFUNC = 64; + FOF_FILTERFUNC = 128; + +{**************************************************************************** + * + * ASL Screen Mode Requester data structures and constants + * + * This structure must only be allocated by asl.library and is READ-ONLY! + * Control of the various fields is provided via tags when the requester + * is created with AllocAslRequest() and when it is displayed via + * AslRequest() + } + +Type + pScreenModeRequester = ^tScreenModeRequester; + tScreenModeRequester = record + sm_DisplayID : Cardinal; { Display mode ID } + sm_DisplayWidth : Cardinal; { Width Of display IN pixels } + sm_DisplayHeight : Cardinal; { Height Of display IN pixels } + sm_DisplayDepth : word; { Number OF bit-planes OF display } + sm_OverscanType : word; { TYPE OF overscan OF display } + sm_AutoScroll : Boolean; { Display should auto-scroll? } + + sm_BitMapWidth : Cardinal; { Used TO create your own BitMap } + sm_BitMapHeight : Cardinal; + + sm_LeftEdge : smallint; { Coordinates OF requester on Exit } + sm_TopEdge : smallint; + sm_Width : smallint; + sm_Height : smallint; + + sm_InfoOpened : Boolean; { Info window opened on exit? } + sm_InfoLeftEdge : smallint; { Last coordinates OF Info window } + sm_InfoTopEdge : smallint; + sm_InfoWidth : smallint; + sm_InfoHeight : smallint; + + sm_UserData : Pointer; { You can store your own data here } + END; + + +{ An Exec list of custom modes can be added to the list of available modes. + * The DimensionInfo structure must be completely initialized, including the + * Header. See <graphics/displayinfo.h>. Custom mode ID's must be in the range + * $FFFF0000..$FFFFFFFF. Regular properties which apply to your custom modes + * can be added in the dn_PropertyFlags field. Custom properties are not + * allowed. + } + pDisplayMode = ^tDisplayMode; + tDisplayMode = record + dm_Node : tNode; { see ln_Name } + dm_DimensionInfo : tDimensionInfo; { mode description } + dm_PropertyFlags : Cardinal; { applicable properties } + end; + + +{ ScreenMode requester tag values, used by AllocAslRequest() and AslRequest() } +const +{ Window control } + ASLSM_Window = ASL_TB+2 ; { Parent window } + ASLSM_Screen = ASL_TB+40; { Screen to open on if no window } + ASLSM_PubScreenName = ASL_TB+41; { Name of public screen } + ASLSM_PrivateIDCMP = ASL_TB+42; { Allocate private IDCMP? } + ASLSM_IntuiMsgFunc = ASL_TB+70; { Function to handle IntuiMessages } + ASLSM_SleepWindow = ASL_TB+43; { Block input in ASLSM_Window? } + ASLSM_UserData = ASL_TB+52; { What to put in sm_UserData } + ASLSM_PopToFront = ASL_TB+131; { Make the requester window visible + * when it opens (V44) + } + ASLSM_Activate = ASL_TB+132; { Activate the requester window when + * it opens (V45). + } + +{ Text display } + ASLSM_TextAttr = ASL_TB+51; { Text font to use for gadget text } + ASLSM_Locale = ASL_TB+50; { Locale ASL should use for text } + ASLSM_TitleText = ASL_TB+1 ; { Title of requester } + ASLSM_PositiveText = ASL_TB+18; { Positive gadget text } + ASLSM_NegativeText = ASL_TB+19; { Negative gadget text } + +{ Initial settings } + ASLSM_InitialLeftEdge = ASL_TB+3 ; { Initial requester coordinates } + ASLSM_InitialTopEdge = ASL_TB+4 ; + ASLSM_InitialWidth = ASL_TB+5 ; { Initial requester dimensions } + ASLSM_InitialHeight = ASL_TB+6 ; + ASLSM_InitialDisplayID = ASL_TB+100; { Initial display mode id } + ASLSM_InitialDisplayWidth = ASL_TB+101; { Initial display width } + ASLSM_InitialDisplayHeight = ASL_TB+102; { Initial display height } + ASLSM_InitialDisplayDepth = ASL_TB+103; { Initial display depth } + ASLSM_InitialOverscanType = ASL_TB+104; { Initial type of overscan } + ASLSM_InitialAutoScroll = ASL_TB+105; { Initial autoscroll setting } + ASLSM_InitialInfoOpened = ASL_TB+106; { Info wndw initially opened? } + ASLSM_InitialInfoLeftEdge = ASL_TB+107; { Initial Info window coords. } + ASLSM_InitialInfoTopEdge = ASL_TB+108; + +{ Options } + ASLSM_DoWidth = ASL_TB+109; { Display Width gadget? } + ASLSM_DoHeight = ASL_TB+110; { Display Height gadget? } + ASLSM_DoDepth = ASL_TB+111; { Display Depth gadget? } + ASLSM_DoOverscanType = ASL_TB+112; { Display Overscan Type gadget? } + ASLSM_DoAutoScroll = ASL_TB+113; { Display AutoScroll gadget? } + +{ Filtering } + ASLSM_PropertyFlags = ASL_TB+114; { Must have these Property flags } + ASLSM_PropertyMask = ASL_TB+115; { Only these should be looked at } + ASLSM_MinWidth = ASL_TB+116; { Minimum display width to allow } + ASLSM_MaxWidth = ASL_TB+117; { Maximum display width to allow } + ASLSM_MinHeight = ASL_TB+118; { Minimum display height to allow } + ASLSM_MaxHeight = ASL_TB+119; { Maximum display height to allow } + ASLSM_MinDepth = ASL_TB+120; { Minimum display depth } + ASLSM_MaxDepth = ASL_TB+121; { Maximum display depth } + ASLSM_FilterFunc = ASL_TB+122; { Function to filter mode id's } + +{ Custom additions } + ASLSM_CustomSMList = ASL_TB+123; { Exec list of struct DisplayMode } + +{***************************************************************************} + + ASL_LAST_TAG = ASL_TB+133; + +{***************************************************************************} + +{ This defines the rendezvous data for setting and querying asl.library's + * defaults for the window size and the file requester sort order. The name + * of the semaphore is given below; it exists only with asl.library V45 and + * IPrefs V45 and beyond. + } + ASL_SEMAPHORE_NAME : Pchar = 'asl.library'; + + type + PAslSemaphore = ^tAslSemaphore; + tAslSemaphore = record + as_Semaphore : tSignalSemaphore; + as_Version : Word; { Must be >= 45 } + as_Size : Cardinal; { Size of this data structure. } + as_SortBy : Byte; { File requester defaults; name, date or size } + as_SortDrawers : Byte; { File requester defaults; first, mix or last } + as_SortOrder : Byte; { File requester defaults; ascending or descending } + as_SizePosition : Byte; { See below } + as_RelativeLeft : WORD; { Window position offset } + as_RelativeTop : WORD; + as_RelativeWidth : Byte; { Window size factor; this is + * a percentage of the parent + * window/screen width. + } + as_RelativeHeight : Byte; + end; + +const +{ Default position of the ASL window. } + ASLPOS_DefaultPosition = 0; { Position is calculated according to the builtin rules. } + ASLPOS_CenterWindow = 1; { Centred within the bounds of the parent window. } + ASLPOS_CenterScreen = 2; { Centred within the bounds of the parent screen. } + ASLPOS_WindowPosition = 3; { Relative to the top left corner of the parent window, + * using the offset values provided in the + * as_RelativeLeft/as_RelativeTop members. + } + ASLPOS_ScreenPosition = 4; { Relative to the top left corner of the parent screen, + * using the offset values provided in the + * as_RelativeLeft/as_RelativeTop members. + } + ASLPOS_CenterMouse = 5; { Directly below the mouse pointer. } + ASLPOS_MASK = $0F; + +{ Default size of the ASL window. } + ASLSIZE_DefaultSize = (0 shl 4); { Size is calculated according to the builtin rules. } + ASLSIZE_RelativeSize = (1 shl 4); { Size is relative to the size of the parent + * window or screen, using the values provided in + * the as_RelativeWidth/as_RelativeHeight members. + * The as_RelativeWidth/as_RelativeHeight values are + * taken as percentage, i.e. a value of "50" stands for + * 50% of the width/height of the parent window/screen. + } + ASLSIZE_MASK = $30; + +{ Other options. } + ASLOPTION_ASLOverrides = (1 shl 6); { ASL determines placement and size of requester + * windows; application's choice is ignored. + } + + +{**************************************************************************** + * + * Obsolete ASL definitions, here for source code compatibility only. + * Please do NOT use in new code. + * + * define ASL_V38_NAMES_ONLY to remove these older names + } +{$define ASL_V38_NAMES_ONLY} +{$ifndef ASL_V38_NAMES_ONLY} +const + ASL_Dummy = (TAG_USER + $80000); + ASL_Hail = ASL_Dummy+1 ; + ASL_Window = ASL_Dummy+2 ; + ASL_LeftEdge = ASL_Dummy+3 ; + ASL_TopEdge = ASL_Dummy+4 ; + ASL_Width = ASL_Dummy+5 ; + ASL_Height = ASL_Dummy+6 ; + ASL_HookFunc = ASL_Dummy+7 ; + ASL_File = ASL_Dummy+8 ; + ASL_Dir = ASL_Dummy+9 ; + ASL_FontName = ASL_Dummy+10; + ASL_FontHeight = ASL_Dummy+11; + ASL_FontStyles = ASL_Dummy+12; + ASL_FontFlags = ASL_Dummy+13; + ASL_FrontPen = ASL_Dummy+14; + ASL_BackPen = ASL_Dummy+15; + ASL_MinHeight = ASL_Dummy+16; + ASL_MaxHeight = ASL_Dummy+17; + ASL_OKText = ASL_Dummy+18; + ASL_CancelText = ASL_Dummy+19; + ASL_FuncFlags = ASL_Dummy+20; + ASL_ModeList = ASL_Dummy+21; + ASL_ExtFlags1 = ASL_Dummy+22; + ASL_Pattern = ASL_FontName; +{ remember what I said up there? Do not use these anymore! } + FILB_DOWILDFUNC = 7; + FILB_DOMSGFUNC = 6; + FILB_SAVE = 5; + FILB_NEWIDCMP = 4; + FILB_MULTISELECT = 3; + FILB_PATGAD = 0; + FILF_DOWILDFUNC = 128; + FILF_DOMSGFUNC = 64; + FILF_SAVE = 32; + FILF_NEWIDCMP = 16; + FILF_MULTISELECT = 8; + FILF_PATGAD = 1; + FIL1B_NOFILES = 0; + FIL1B_MATCHDIRS = 1; + FIL1F_NOFILES = 1; + FIL1F_MATCHDIRS = 2; + FONB_FRONTCOLOR = 0; + FONB_BACKCOLOR = 1; + FONB_STYLES = 2; + FONB_DRAWMODE = 3; + FONB_FIXEDWIDTH = 4; + FONB_NEWIDCMP = 5; + FONB_DOMSGFUNC = 6; + FONB_DOWILDFUNC = 7; + FONF_FRONTCOLOR = 1; + FONF_BACKCOLOR = 2; + FONF_STYLES = 4; + FONF_DRAWMODE = 8; + FONF_FIXEDWIDTH = 16; + FONF_NEWIDCMP = 32; + FONF_DOMSGFUNC = 64; + FONF_DOWILDFUNC = 128; +{$endif ASL_V38_NAMES_ONLY} + + +var + AslBase : pLibrary; + +function AllocFileRequest : pFileRequester; +SysCall AslBase 030; + +procedure FreeFileRequest(fileReq : pFileRequester location 'a0'); +SysCall AslBase 036; + +function RequestFile(fileReq : pFileRequester location 'a0'): LongBool; +SysCall AslBase 042; + +function AllocAslRequest(reqType: Cardinal location 'd0'; + tagList: pTagItem location 'a0'): Pointer; +SysCall AslBase 048; + +procedure FreeAslRequest(requester: Pointer location 'a0'); +SysCall AslBase 054; + +function AslRequest(requester: Pointer location 'a0'; + tagList : pTagItem location 'a1'): LongBool; +SysCall AslBase 060; + +procedure AbortAslRequest(requester: Pointer location 'a0'); +SysCall AslBase 078; + +procedure ActivateAslRequest(requester : Pointer location 'a0'); +SysCall AslBase 084; + +function AllocAslRequestTags(reqType: Cardinal; + tagList: array of DWord): Pointer; Inline; +function AslRequestTags(requester: Pointer; + tagList : array of DWord): LongBool; Inline; + +function InitAslLibrary : boolean; + + +implementation + + +function AllocAslRequestTags(reqType: Cardinal; + tagList: array of DWord): Pointer; Inline; +begin + AllocAslRequestTags:=AllocAslRequest(reqType,@tagList); +end; + +function AslRequestTags(requester: Pointer; + tagList : array of DWord): LongBool; Inline; +begin + AslRequestTags:=AslRequest(requester,@tagList); +end; + + +const + { Change VERSION and LIBVERSION to proper values } + + VERSION : string[2] = '0'; + LIBVERSION : longword = 0; + +var + asl_exit: Pointer; + +procedure CloseAslLibrary; +begin + ExitProc := asl_exit; + if AslBase <> nil then begin + CloseLibrary(PLibrary(AslBase)); + AslBase := nil; + end; +end; + +function InitAslLibrary : boolean; +begin + AslBase := nil; + AslBase := OpenLibrary(ASLNAME,LIBVERSION); + if AslBase <> nil then begin + asl_exit := ExitProc; + ExitProc := @CloseAslLibrary; + InitAslLibrary:=True; + end else begin + InitAslLibrary:=False; + end; +end; + + +end. (* UNIT ASL *) + diff --git a/packages/morphunits/src/clipboard.pas b/packages/morphunits/src/clipboard.pas new file mode 100644 index 0000000000..7069320f0c --- /dev/null +++ b/packages/morphunits/src/clipboard.pas @@ -0,0 +1,84 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + clipboard.device interface unit for MorphOS/PowerPC + + Based on work of Nils Sjoholm member of the Amiga RTL + development team. + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} +{$PACKRECORDS 2} + +unit clipboard; + +interface + +uses exec; + +const + CBD_POST = CMD_NONSTD + 0; + CBD_CURRENTREADID = CMD_NONSTD + 1; + CBD_CURRENTWRITEID = CMD_NONSTD + 2; + CBD_CHANGEHOOK = CMD_NONSTD + 3; + + CBERR_OBSOLETEID = 1; + +type + + pClipboardUnitPartial = ^tClipboardUnitPartial; + tClipboardUnitPartial = record + cu_Node : tNode; { list of units } + cu_UnitNum : DWord; { unit number for this unit } + { the remaining unit data is private to the device } + end; + + + pIOClipReq = ^tIOClipReq; + tIOClipReq = record + io_Message : tMessage; + io_Device : pDevice; { device node pointer } + io_Unit : pClipboardUnitPartial; { unit (driver private) } + io_Command : Word; { device command } + io_Flags : Byte; { including QUICK and SATISFY } + io_Error : Shortint; { error or warning num } + io_Actual : DWord; { number of bytes transferred } + io_Length : DWord; { number of bytes requested } + io_Data : PChar; { either clip stream or post port } + io_Offset : DWord; { offset in clip stream } + io_ClipID : Longint; { ordinal clip identifier } + end; + +const + PRIMARY_CLIP = 0; { primary clip unit } + +type + + pSatisfyMsg = ^tSatisfyMsg; + tSatisfyMsg = record + sm_Msg : tMessage; { the length will be 6 } + sm_Unit : Word; { which clip unit this is } + sm_ClipID : Longint; { the clip identifier of the post } + end; + + pClipHookMsg = ^tClipHookMsg; + tClipHookMsg = record + chm_Type : DWord; { zero for this structure format } + chm_ChangeCmd, { command that caused this hook invocation: } + { either CMD_UPDATE OR CBD_POST } + chm_ClipID : Longint; { the clip identifier of the new data } + END; + +implementation + +end. diff --git a/packages/morphunits/src/datatypes.pas b/packages/morphunits/src/datatypes.pas new file mode 100644 index 0000000000..58ac85e53f --- /dev/null +++ b/packages/morphunits/src/datatypes.pas @@ -0,0 +1,1475 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2005 Karoly Balogh + + datatypes.library interface unit for MorphOS/PowerPC + + Based on work of Nils Sjoholm member of the Amiga RTL + development team. + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} +{$INLINE ON} +{$PACKRECORDS 2} +unit datatypes; + +interface + +uses exec, amigados, intuition, utility, + agraphics{, iffparse, amigaprinter, prtbase}; + +const +{***************************************************************************} + + ID_DTYP = 1146378576; + +{***************************************************************************} + + ID_DTHD = 1146374212; + +Type + pDataTypeHeader = ^tDataTypeHeader; + tDataTypeHeader = record + dth_Name, { Descriptive name of the data type } + dth_BaseName, { Base name of the data type } + dth_Pattern : PChar; { Match pattern for file name. } + dth_Mask : Pointer; { Comparision mask } + dth_GroupID, { Group that the DataType is in } + dth_ID : longword; { ID for DataType (same as IFF FORM type) } + dth_MaskLen, { Length of comparision mask } + dth_Pad : smallint; { Unused at present (must be 0) } + dth_Flags, { Flags } + dth_Priority : WORD; { Priority } + end; + +const + DTHSIZE = 32; + +{***************************************************************************} + +{ Basic type } + DTF_TYPE_MASK = $000F; + DTF_BINARY = $0000; + DTF_ASCII = $0001; + DTF_IFF = $0002; + DTF_MISC = $0003; + +{ Set if case is important } + DTF_CASE = $0010; + +{ Reserved for system use } + DTF_SYSTEM1 = $1000; + +{**************************************************************************** + * + * GROUP ID and ID + * + * This is used for filtering out objects that you don't want. For + * example, you could make a filter for the ASL file requester so + * that it only showed the files that were pictures, or even to + * narrow it down to only show files that were ILBM pictures. + * + * Note that the Group ID's are in lower case, and always the first + * four characters of the word. + * + * For ID's; If it is an IFF file, then the ID is the same as the + * FORM type. If it isn't an IFF file, then the ID would be the + * first four characters of name for the file type. + * + ****************************************************************************} + +{ System file, such as; directory, executable, library, device, font, etc. } + GID_SYSTEM = 1937339252; + +{ Formatted or unformatted text } + GID_TEXT = 1952807028; + +{ Formatted text with graphics or other DataTypes } + GID_DOCUMENT = 1685021557; + +{ Sound } + GID_SOUND = 1936684398; + +{ Musical instruments used for musical scores } + GID_INSTRUMENT = 1768846196; + +{ Musical score } + GID_MUSIC = 1836413801; + +{ Still picture } + GID_PICTURE = 1885954932; + +{ Animated picture } + GID_ANIMATION = 1634625901; + +{ Animation with audio track } + GID_MOVIE = 1836021353; + +{***************************************************************************} + +{ A code chunk contains an embedded executable that can be loaded + * with InternalLoadSeg. } + ID_CODE = 1146372932; + +Type +{ DataTypes comparision hook context (Read-Only). This is the + * argument that is passed to a custom comparision routine. } + + pDTHookContext = ^tDTHookContext; + tDTHookContext = record + { Libraries that are already opened for your use } + dthc_SysBase, + dthc_DOSBase, + dthc_IFFParseBase, + dthc_UtilityBase : pLibrary; + + { File context } + dthc_Lock : longword; { Lock on the file } + dthc_FIB : pFileInfoBlock; { Pointer to a FileInfoBlock } + dthc_FileHandle : longword; { Pointer to the file handle (may be NULL) } +{$WARNING FIX ME!!! IFF handle type} +// dthc_IFF : pIFFHandle; { Pointer to an IFFHandle (may be NULL) } + dthc_IFF : Pointer; { Pointer to an IFFHandle (may be NULL) } + dthc_Buffer : PChar; { Buffer } + dthc_BufferLength : longword; { Length of the buffer } + end; + +{***************************************************************************} + +const + ID_TOOL = 1146377292; + +Type + pTool = ^tTool; + tTool = record + tn_Which, { Which tool is this } + tn_Flags : WORD; { Flags } + tn_Program : PChar; { Application to use } + end; + +const + TSIZE = 8; + +{ defines for tn_Which } + TW_INFO = 1; + TW_BROWSE = 2; + TW_EDIT = 3; + TW_PRINT = 4; + TW_MAIL = 5; + +{ defines for tn_Flags } + TF_LAUNCH_MASK = $000F; + TF_SHELL = $0001; + TF_WORKBENCH = $0002; + TF_RX = $0003; + +{***************************************************************************} + + ID_TAGS = 1146377287; + +{***************************************************************************} + +Type + pDataType = ^tDataType; + tDataType = record + dtn_Node1, { Reserved for system use } + dtn_Node2 : tNode; { Reserved for system use } + dtn_Header : pDataTypeHeader; { Pointer to the DataTypeHeader } + dtn_ToolList: tList; { List of tool nodes } + dtn_FunctionName : PChar; { Name of comparision routine } + dtn_AttrList : pTagItem; { Object creation tags } + dtn_Length : longword; { Length of the memory block } + end; + +{***************************************************************************} + + pToolNode = ^tToolNode; + tToolNode = Record + tn_Node : tNode; { Embedded node } + tn_Tool : tTool; { Embedded tool } + tn_Length : longword; { Length of the memory block } + end; + +{***************************************************************************} + +const + ID_NAME = 1312902469; + +{***************************************************************************} + +{ text ID's } + DTERROR_UNKNOWN_DATATYPE = 2000; + DTERROR_COULDNT_SAVE = 2001; + DTERROR_COULDNT_OPEN = 2002; + DTERROR_COULDNT_SEND_MESSAGE = 2003; + +{ new for V40 } + DTERROR_COULDNT_OPEN_CLIPBOARD = 2004; + DTERROR_Reserved = 2005; + DTERROR_UNKNOWN_COMPRESSION = 2006; + DTERROR_NOT_ENOUGH_DATA = 2007; + DTERROR_INVALID_DATA = 2008; + +{ New for V44 } + DTERROR_NOT_AVAILABLE = 2009; + +{ Offset for types } + DTMSG_TYPE_OFFSET = 2100; + +{***************************************************************************} + + DATATYPESCLASS : Pchar = 'datatypesclass'; + +{***************************************************************************} + + DTA_Dummy = (TAG_USER+$1000); + +{ Generic attributes } + DTA_TextAttr = (DTA_Dummy+10); + { (struct TextAttr ) Pointer to the default TextAttr to use for + * the text within the object. } + + DTA_TopVert = (DTA_Dummy+11); + { (LONG) Current top vertical unit } + + DTA_VisibleVert = (DTA_Dummy+12); + { (LONG) Number of visible vertical units } + + DTA_TotalVert = (DTA_Dummy+13); + { (LONG) Total number of vertical units } + + DTA_VertUnit = (DTA_Dummy+14); + { (LONG) Number of pixels per vertical unit } + + DTA_TopHoriz = (DTA_Dummy+15); + { (LONG) Current top horizontal unit } + + DTA_VisibleHoriz = (DTA_Dummy+16); + { (LONG) Number of visible horizontal units } + + DTA_TotalHoriz = (DTA_Dummy+17); + { (LONG) Total number of horizontal units } + + DTA_HorizUnit = (DTA_Dummy+18); + { (LONG) Number of pixels per horizontal unit } + + DTA_NodeName = (DTA_Dummy+19); + { (UBYTE ) Name of the current element within the object. } + + DTA_Title = (DTA_Dummy+20); + { (UBYTE ) Title of the object. } + + DTA_TriggerMethods = (DTA_Dummy+21); + { (struct DTMethod ) Pointer to a NULL terminated array of + * supported trigger methods. } + + DTA_Data = (DTA_Dummy+22); + { (Pointer) Object specific data. } + + DTA_TextFont = (DTA_Dummy+23); + { (struct TextFont ) Default font to use for text within the + * object. } + + DTA_Methods = (DTA_Dummy+24); + { (longword ) Pointer to a ~0 terminated array of supported + * methods. } + + DTA_PrinterStatus = (DTA_Dummy+25); + { (LONG) Printer error message. Error numbers are defined in + * <devices/printer.h> } + + DTA_PrinterProc = (DTA_Dummy+26); + { PRIVATE (struct Process ) Pointer to the print process. } + + DTA_LayoutProc = (DTA_Dummy+27); + { PRIVATE (struct Process ) Pointer to the layout process. } + + DTA_Busy = (DTA_Dummy+28); + { Used to turn the applications' busy pointer off and on } + + DTA_Sync = (DTA_Dummy+29); + { Used to indicate that new information has been loaded into + * an object. This is for models that cache the DTA_TopVert- + * like tags } + + DTA_BaseName = (DTA_Dummy+30); + { The base name of the class } + + DTA_GroupID = (DTA_Dummy+31); + { Group that the object must belong in } + + DTA_ErrorLevel = (DTA_Dummy+32); + { Error level } + + DTA_ErrorNumber = (DTA_Dummy+33); + { datatypes.library error number } + + DTA_ErrorString = (DTA_Dummy+34); + { Argument for datatypes.library error } + + DTA_Conductor = (DTA_Dummy+35); + { New for V40. (UBYTE ) specifies the name of the + * realtime.library conductor. Defaults to "Main". } + + DTA_ControlPanel = (DTA_Dummy+36); + { New for V40. (BOOL) Indicate whether a control panel should be + * embedded within the object (in the animation datatype, for + * example). Defaults to TRUE. } + + DTA_Immediate = (DTA_Dummy+37); + { New for V40. (BOOL) Indicate whether the object should + * immediately begin playing. Defaults to FALSE. } + + DTA_Repeat = (DTA_Dummy+38); + { New for V40. (BOOL) Indicate that the object should repeat + * playing. Defaults to FALSE. } + + { New for V44. Address of a DTST_MEMORY source type + * object (Pointer). + } + DTA_SourceAddress = (DTA_Dummy+39); + + { New for V44. Size of a DTST_MEMORY source type + * object (longword). + } + DTA_SourceSize = (DTA_Dummy+40); + + { Reserved tag; DO NOT USE (V44) } + DTA_Reserved = (DTA_Dummy+41); + +{ DTObject attributes } + DTA_Name = (DTA_Dummy+100); + DTA_SourceType = (DTA_Dummy+101); + DTA_Handle = (DTA_Dummy+102); + DTA_DataType = (DTA_Dummy+103); + DTA_Domain = (DTA_Dummy+104); + +{ DON'T USE THE FOLLOWING FOUR TAGS. USE THE CORRESPONDING TAGS IN + * <intuition/gadgetclass.h> } + DTA_Left = (DTA_Dummy+105); + DTA_Top = (DTA_Dummy+106); + DTA_Width = (DTA_Dummy+107); + DTA_Height = (DTA_Dummy+108); + + DTA_ObjName = (DTA_Dummy+109); + DTA_ObjAuthor = (DTA_Dummy+110); + DTA_ObjAnnotation = (DTA_Dummy+111); + DTA_ObjCopyright = (DTA_Dummy+112); + DTA_ObjVersion = (DTA_Dummy+113); + DTA_ObjectID = (DTA_Dummy+114); + DTA_UserData = (DTA_Dummy+115); + DTA_FrameInfo = (DTA_Dummy+116); + +{ DON'T USE THE FOLLOWING FOUR TAGS. USE THE CORRESPONDING TAGS IN + * <intuition/gadgetclass.h> } + DTA_RelRight = (DTA_Dummy+117); + DTA_RelBottom = (DTA_Dummy+118); + DTA_RelWidth = (DTA_Dummy+119); + DTA_RelHeight = (DTA_Dummy+120); + + DTA_SelectDomain = (DTA_Dummy+121); + DTA_TotalPVert = (DTA_Dummy+122); + DTA_TotalPHoriz = (DTA_Dummy+123); + DTA_NominalVert = (DTA_Dummy+124); + DTA_NominalHoriz = (DTA_Dummy+125); + +{ Printing attributes } + DTA_DestCols = (DTA_Dummy+400); + { (LONG) Destination X width } + + DTA_DestRows = (DTA_Dummy+401); + { (LONG) Destination Y height } + + DTA_Special = (DTA_Dummy+402); + { (UWORD) Option flags } + + DTA_RastPort = (DTA_Dummy+403); + { (struct RastPort ) RastPort to use when printing. (V40) } + + DTA_ARexxPortName = (DTA_Dummy+404); + { (PChar) Pointer to base name for ARexx port (V40) } + + +{***************************************************************************} + + DTST_RAM = 1; + DTST_FILE = 2; + DTST_CLIPBOARD = 3; + DTST_HOTLINK = 4; + DTST_MEMORY = 5; { New for V44 } + +{***************************************************************************} + +{ Attached to the Gadget.SpecialInfo field of the gadget. Don't access directly, + * use the Get/Set calls instead. + } +Type + + pDTSpecialInfo = ^tDTSpecialInfo; + tDTSpecialInfo = record + si_Lock : tSignalSemaphore; { Locked while in DoAsyncLayout() } + si_Flags, + + si_TopVert, { Top row (in units) } + si_VisVert, { Number of visible rows (in units) } + si_TotVert, { Total number of rows (in units) } + si_OTopVert, { Previous top (in units) } + si_VertUnit, { Number of pixels in vertical unit } + + si_TopHoriz, { Top column (in units) } + si_VisHoriz, { Number of visible columns (in units) } + si_TotHoriz, { Total number of columns (in units) } + si_OTopHoriz, { Previous top (in units) } + si_HorizUnit : Longint; { Number of pixels in horizontal unit } + end; + + +const +{ Object is in layout processing } + DTSIF_LAYOUT = 1; + +{ Object needs to be layed out } + DTSIF_NEWSIZE = 2; + + DTSIF_DRAGGING = 4; + DTSIF_DRAGSELECT = 8; + + DTSIF_HIGHLIGHT = 16; + +{ Object is being printed } + DTSIF_PRINTING = 32; + +{ Object is in layout process } + DTSIF_LAYOUTPROC = 64; + +{***************************************************************************} + +Type + pDTMethod = ^tDTMethod; + tDTMethod = record + dtm_Label, + dtm_Command : PChar; + dtm_Method : longword; + end; + +{***************************************************************************} + +Const + DTM_Dummy = ($600); + +{ Inquire what environment an object requires } + DTM_FRAMEBOX = ($601); + +{ Same as GM_LAYOUT except guaranteed to be on a process already } + DTM_PROCLAYOUT = ($602); + +{ Layout that is occurring on a process } + DTM_ASYNCLAYOUT = ($603); + +{ When a RemoveDTObject() is called } + DTM_REMOVEDTOBJECT = ($604); + + DTM_SELECT = ($605); + DTM_CLEARSELECTED = ($606); + + DTM_COPY = ($607); + DTM_PRINT = ($608); + DTM_ABORTPRINT = ($609); + + DTM_NEWMEMBER = ($610); + DTM_DISPOSEMEMBER = ($611); + + DTM_GOTO = ($630); + DTM_TRIGGER = ($631); + + DTM_OBTAINDRAWINFO = ($640); + DTM_DRAW = ($641); + DTM_RELEASEDRAWINFO = ($642); + + DTM_WRITE = ($650); + +{ Used to ask the object about itself } +type + pFrameInfo = ^tFrameInfo; + tFrameInfo = record + fri_PropertyFlags : longword; + fri_Resolution : tPoint; + fri_RedBits : BYTE; + fri_GreenBits : BYTE; + fri_BlueBits : BYTE; + fri_Dimensions : record + Width : longword; + Height : longword; + Depth : longword; + end; + fri_Screen : pScreen; + fri_ColorMap : pColorMap; + fri_Flags : longword; + end; + + +CONST + + FIF_SCALABLE = $1; + FIF_SCROLLABLE = $2; + FIF_REMAPPABLE = $4; + +{ DTM_REMOVEDTOBJECT, DTM_CLEARSELECTED, DTM_COPY, DTM_ABORTPRINT } +Type + + pdtGeneral = ^tdtGeneral; + tdtGeneral = record + MethodID : longword; + dtg_GInfo : pGadgetInfo; + end; + +{ DTM_SELECT } + pdtSelect = ^tdtSelect; + tdtSelect = record + MethodID : longword; + dts_GInfo : pGadgetInfo; + dts_Select : tRectangle; + end; + +{ DTM_FRAMEBOX } + + pdtFrameBox = ^tdtFrameBox; + tdtFrameBox = record + MethodID : longword; + dtf_GInfo : pGadgetInfo; + dtf_ContentsInfo, { Input } + dtf_FrameInfo : pFrameInfo; { Output } + dtf_SizeFrameInfo, + dtf_FrameFlags : longword; + end; + +{ DTM_GOTO } + pdtGoto = ^tdtGoto; + tdtGoto = record + MethodID : longword; + dtg_GInfo : pGadgetInfo; + dtg_NodeName : PChar; { Node to goto } + dtg_AttrList : pTagItem; { Additional attributes } + end; + +{ DTM_TRIGGER } + + pdtTrigger = ^tdtTrigger; + tdtTrigger = record + MethodID : longword; + dtt_GInfo : pGadgetInfo; + dtt_Function : longword; + dtt_Data : Pointer; + end; + +const + STM_PAUSE = 1 ; + STM_PLAY = 2 ; + STM_CONTENTS = 3 ; + STM_INDEX = 4 ; + STM_RETRACE = 5 ; + STM_BROWSE_PREV = 6 ; + STM_BROWSE_NEXT = 7 ; + + STM_NEXT_FIELD = 8 ; + STM_PREV_FIELD = 9 ; + STM_ACTIVATE_FIELD = 10; + + STM_COMMAND = 11; + +{ New for V40 } + STM_REWIND = 12; + STM_FASTFORWARD = 13; + STM_STOP = 14; + STM_RESUME = 15; + STM_LOCATE = 16; + +Type +{ Printer IO request } + pprinterIO = ^tprinterIO; + tprinterIO = record + ios : tIOStdReq; +{$WARNING FIX ME!!! TPrinterIO} +{ + iodrp : tIODRPReq; + iopc : tIOPrtCmdReq; +} + end; +{ DTM_PRINT } + + pdtPrint = ^tdtPrint; + tdtPrint = record + MethodID : longword; + dtp_GInfo : pGadgetInfo; + dtp_PIO : pprinterIO; + dtp_AttrList : pTagItem; + end; + + +{ DTM_DRAW } + pdtDraw = ^tdtDraw; + tdtDraw = record + MethodID : longword; + dtd_RPort : pRastPort; + dtd_Left, + dtd_Top, + dtd_Width, + dtd_Height, + dtd_TopHoriz, + dtd_TopVert : Longint; + dtd_AttrList : pTagItem; { Additional attributes } + end; + +{ DTM_WRITE } + pdtWrite = ^tdtWrite; + tdtWrite = record + MethodID : longword; + dtw_GInfo : pGadgetInfo; { Gadget information } + dtw_FileHandle : longword; { File handle to write to } + dtw_Mode : longword; + dtw_AttrList : pTagItem; { Additional attributes } + end; + +const +{ Save data as IFF data } + DTWM_IFF = 0; + +{ Save data as local data format } + DTWM_RAW = 1; + +{***************************************************************************} + + PICTUREDTCLASS : PChar = 'picture.datatype'; + +{***************************************************************************} + +{ Picture attributes } + PDTA_ModeID = (DTA_Dummy + 200); + { Mode ID of the picture } + + PDTA_BitMapHeader = (DTA_Dummy + 201); + + PDTA_BitMap = (DTA_Dummy + 202); + { Pointer to a class-allocated bitmap, that will end + * up being freed by picture.class when DisposeDTObject() + * is called } +{ Picture colour table (struct ColorRegister *) } + PDTA_ColorRegisters = (DTA_Dummy + 203); + +{ Color table to use with SetRGB32CM() (longword *) } + PDTA_CRegs = (DTA_Dummy + 204); + +{ Color table; this table is initialized during the layout + * process and will contain the colours the picture will use + * after remapping. If no remapping takes place, these colours + * will match those in the PDTA_CRegs table (longword *). + } + PDTA_GRegs = (DTA_Dummy + 205); + +{ Shared pen table; this table is initialized during the layout + * process while the picture is being remapped (UBYTE *). + } + PDTA_ColorTable = (DTA_Dummy + 206); + +{ Shared pen table; in most places this table will be identical to + * the PDTA_ColorTable table. Some of the colours in this table might + * match the original colour palette a little better than the colours + * picked for the other table. The picture.datatype uses the two tables + * during remapping, alternating for each pixel (UBYTE *). + } + PDTA_ColorTable2 = (DTA_Dummy + 207); + +{ OBSOLETE; DO NOT USE } + PDTA_Allocated = (DTA_Dummy + 208); + +{ Number of colors used by the picture. (UWORD) } + PDTA_NumColors = (DTA_Dummy + 209); + +{ Number of colors allocated by the picture (UWORD) } + PDTA_NumAlloc = (DTA_Dummy + 210); + + PDTA_Remap = (DTA_Dummy + 211); + { Boolean : Remap picture (defaults to TRUE) } + + PDTA_Screen = (DTA_Dummy + 212); + { Screen to remap to } + + PDTA_FreeSourceBitMap = (DTA_Dummy + 213); + { Boolean : Free the source bitmap after remapping } + + PDTA_Grab = (DTA_Dummy + 214); + { Pointer to a Point structure } + + PDTA_DestBitMap = (DTA_Dummy + 215); + { Pointer to the destination (remapped) bitmap } + + PDTA_ClassBitMap = (DTA_Dummy + 216); + { Pointer to class-allocated bitmap, that will end + * up being freed by the class after DisposeDTObject() + * is called } + + PDTA_NumSparse = (DTA_Dummy + 217); + { (UWORD) Number of colors used for sparse remapping } + + PDTA_SparseTable = (DTA_Dummy + 218); + { (UBYTE *) Pointer to a table of pen numbers indicating + * which colors should be used when remapping the image. + * This array must contain as many entries as there + * are colors specified with PDTA_NumSparse } + + { Index number of the picture to load (longword). (V44) } + PDTA_WhichPicture = (DTA_Dummy + 219); + +{ Get the number of pictures stored in the file (longword *). (V44) } + PDTA_GetNumPictures = (DTA_Dummy + 220); + +{ Maximum number of colours to use for dithering (longword). (V44) } + PDTA_MaxDitherPens = (DTA_Dummy + 221); + +{ Quality of the dithering algorithm to be used during colour + * quantization (longword). (V44) + } + PDTA_DitherQuality = (DTA_Dummy + 222); + +{ Pointer to the allocated pen table (UBYTE *). (V44) } + PDTA_AllocatedPens = (DTA_Dummy + 223); + +{ Quality for scaling. (V45) } + PDTA_ScaleQuality = (DTA_Dummy + 224); + +{***************************************************************************} + +{ When querying the number of pictures stored in a file, the + * following value denotes "the number of pictures is unknown". + } + PDTANUMPICTURES_Unknown = (0); + +{***************************************************************************} + +{ V43 extensions (attributes) } + +{ Set the sub datatype interface mode (LONG); see "Interface modes" below } + PDTA_SourceMode = (DTA_Dummy + 250); + +{ Set the app datatype interface mode (LONG); see "Interface modes" below } + PDTA_DestMode = (DTA_Dummy + 251); + +{ Allocates the resulting bitmap as a friend bitmap (BOOL) } + PDTA_UseFriendBitMap = (DTA_Dummy + 255); + +{ NULL or mask plane for use with BltMaskBitMapRastPort() (PLANEPTR) } + PDTA_MaskPlane = (DTA_Dummy + 258); + + PDTA_Displayable = (DTA_Dummy + 259); { * defaults to TRUE * } + + +{***************************************************************************} + +{ Interface modes } + PMODE_V42 = (0); { Compatibility mode } + PMODE_V43 = (1); { Extended mode } + +{***************************************************************************} + +{ V43 extensions (methods) } + + PDTM_Dummy = (DTM_Dummy + $60); + +{ Transfer pixel data to the picture object in the specified format } + PDTM_WRITEPIXELARRAY = (PDTM_Dummy + 0); + +{ Transfer pixel data from the picture object in the specified format } + PDTM_READPIXELARRAY = (PDTM_Dummy + 1); + +{***************************************************************************} + +{ * Pixel formats * } + + PBPAFMT_RGB = 0; + PBPAFMT_RGBA = 1; + PBPAFMT_ARGB = 2; + PBPAFMT_LUT8 = 3; + PBPAFMT_GREY8 = 4; + + +{ Masking techniques } + mskNone = 0; + mskHasMask = 1; + mskHasTransparentColor = 2; + mskLasso = 3; + mskHasAlpha = 4; + +{ Compression techniques } + cmpNone = 0; + cmpByteRun1 = 1; + cmpByteRun2 = 2; + +Type +{ Bitmap header (BMHD) structure } + pBitMapHeader = ^tBitMapHeader; + tBitMapHeader = record + bmh_Width, { Width in pixels } + bmh_Height : Word; { Height in pixels } + bmh_Left, { Left position } + bmh_Top : smallint; { Top position } + bmh_Depth, { Number of planes } + bmh_Masking, { Masking type } + bmh_Compression, { Compression type } + bmh_Pad : Byte; + bmh_Transparent : WORD; { Transparent color } + bmh_XAspect, + bmh_YAspect : Byte; + bmh_PageWidth, + bmh_PageHeight : smallint; + end; + +{***************************************************************************} + +{ Color register structure } + pColorRegister = ^tColorRegister; + tColorRegister = record + red, green, blue : Byte; + end; + +{***************************************************************************} + +const +{ IFF types that may be in pictures } + ID_ILBM = 1229734477; + ID_BMHD = 1112361028; + ID_BODY = 1112491097; + ID_CMAP = 1129136464; + ID_CRNG = 1129467463; + ID_GRAB = 1196572994; + ID_SPRT = 1397772884; + ID_DEST = 1145394004; + ID_CAMG = 1128353095; + +{***************************************************************************} + + SOUNDDTCLASS : PChar = 'sound.datatype'; + +{***************************************************************************} + +{ Sound attributes } + SDTA_Dummy = (DTA_Dummy + 500); + SDTA_VoiceHeader = (SDTA_Dummy + 1); + SDTA_Sample = (SDTA_Dummy + 2); + { (UBYTE *) Sample data } + + SDTA_SampleLength = (SDTA_Dummy + 3); + { (longword) Length of the sample data in UBYTEs } + + SDTA_Period = (SDTA_Dummy + 4); + { (UWORD) Period } + + SDTA_Volume = (SDTA_Dummy + 5); + { (UWORD) Volume. Range from 0 to 64 } + + SDTA_Cycles = (SDTA_Dummy + 6); + +{ The following tags are new for V40 } + SDTA_SignalTask = (SDTA_Dummy + 7); + { (struct Task *) Task to signal when sound is complete or + next buffer needed. } + +{ (longword) Signal mask to use on completion or 0 to disable + * + * NOTE: Due to a bug in sound.datatype V40 SDTA_SignalBit + * was actually implemented as a signal mask as opposed + * to a bit number. The documentation now reflects + * this. If you intend to use a signal bit number + * instead of the mask, use the new V44 tag + * SDTA_SignalBitNumber below. + *} + SDTA_SignalBit = (SDTA_Dummy + 8); + SDTA_SignalBitMask = SDTA_SignalBit; + { (BYTE) Signal bit to use on completion or -1 to disable } + + SDTA_Continuous = (SDTA_Dummy + 9); + { (longword) Playing a continuous stream of data. Defaults to + FALSE. } + +{ The following tags are new for V44 } + +{ (BYTE) Signal bit to use on completion or -1 to disable } + SDTA_SignalBitNumber = (SDTA_Dummy + 10); + +{ (UWORD) Samples per second } + SDTA_SamplesPerSec = (SDTA_Dummy + 11); + +{ (struct timeval *) Sample replay period } + SDTA_ReplayPeriod = (SDTA_Dummy + 12); + +{ (BYTE *) Sample data } + SDTA_LeftSample = (SDTA_Dummy + 13); + SDTA_RightSample = (SDTA_Dummy + 14); + +{ (BYTE) Stereo panning } + SDTA_Pan = (SDTA_Dummy + 15); + +{ (BOOL) FreeVec() all sample data upon OM_DISPOSE. } + SDTA_FreeSampleData = (SDTA_Dummy + 16); + +{ (BOOL) Wait for the current sample to be played back before + * switching to the new sample data. + } + SDTA_SyncSampleChange = (SDTA_Dummy + 17); + +{***************************************************************************} + + CMP_NONE = 0; + CMP_FIBDELTA = 1; + +Type + pVoiceHeader = ^tVoiceHeader; + tVoiceHeader = record + vh_OneShotHiSamples, + vh_RepeatHiSamples, + vh_SamplesPerHiCycle : longword; + vh_SamplesPerSec : WORD; + vh_Octaves, + vh_Compression : Byte; + vh_Volume : longword; + end; + +{***************************************************************************} + +const + +{ Channel allocation } + SAMPLETYPE_Left = (2); + SAMPLETYPE_Right = (4); + SAMPLETYPE_Stereo = (6); + +{ IFF types } + ID_8SVX = 944985688; + ID_VHDR = 1447576658; + ID_CHAN = $4348414E; + +{***************************************************************************} + +{ ***************************************************************************} + + TEXTDTCLASS : PChar = 'text.datatype'; + +{ ***************************************************************************} + +{ Text attributes } + TDTA_Buffer = (DTA_Dummy + 300); + TDTA_BufferLen = (DTA_Dummy + 301); + TDTA_LineList = (DTA_Dummy + 302); + TDTA_WordSelect = (DTA_Dummy + 303); + TDTA_WordDelim = (DTA_Dummy + 304); + TDTA_WordWrap = (DTA_Dummy + 305); + { Boolean. Should the text be word wrapped. Defaults to false. } + +{ ***************************************************************************} + +Type +{ There is one Line structure for every line of text in our document. } + pLine = ^tLine; + tLine = record + ln_Link : tMinNode; { to link the lines together } + ln_Text : PChar; { pointer to the text for this line } + ln_TextLen : longword; { the character length of the text for this line } + ln_XOffset, { where in the line the text starts } + ln_YOffset, { line the text is on } + ln_Width, { Width of line in pixels } + ln_Height, { Height of line in pixels } + ln_Flags : WORD; { info on the line } + ln_FgPen, { foreground pen } + ln_BgPen : Shortint; { background pen } + ln_Style : longword; { Font style } + ln_Data : Pointer; { Link data... } + end; + +{ ***************************************************************************} + +const +{ Line.ln_Flags } + +{ Line Feed } + LNF_LF = 1; + +{ Segment is a link } + LNF_LINK = 2; + +{ ln_Data is a pointer to an DataTypes object } + LNF_OBJECT = 4; + +{ Object is selected } + LNF_SELECTED = 8; + +{ ***************************************************************************} + +{ IFF types that may be text } + ID_FTXT = 1179932756; + ID_CHRS = 1128813139; + +{ ***************************************************************************} + + ANIMATIONDTCLASS : PChar = 'animation.datatype'; + +{ ***************************************************************************} + +{ Animation attributes } + ADTA_Dummy = (DTA_Dummy + 600); + ADTA_ModeID = PDTA_ModeID ; + ADTA_KeyFrame = PDTA_BitMap ; + { (struct BitMap *) Key frame (first frame) bitmap } + + ADTA_ColorRegisters = PDTA_ColorRegisters; + ADTA_CRegs = PDTA_CRegs ; + ADTA_GRegs = PDTA_GRegs ; + ADTA_ColorTable = PDTA_ColorTable ; + ADTA_ColorTable2 = PDTA_ColorTable2 ; + ADTA_Allocated = PDTA_Allocated ; + ADTA_NumColors = PDTA_NumColors ; + ADTA_NumAlloc = PDTA_NumAlloc ; + + ADTA_Remap = PDTA_Remap; + { (BOOL) : Remap animation (defaults to TRUE) } + + ADTA_Screen = PDTA_Screen; + { (struct Screen *) Screen to remap to } + + ADTA_NumSparse = PDTA_NumSparse; + { (UWORD) Number of colors used for sparse remapping } + + ADTA_SparseTable = PDTA_SparseTable; + { (UBYTE *) Pointer to a table of pen numbers indicating + * which colors should be used when remapping the image. + * This array must contain as many entries as there + * are colors specified with ADTA_NumSparse } + + ADTA_Width = (ADTA_Dummy + 1); + ADTA_Height = (ADTA_Dummy + 2); + ADTA_Depth = (ADTA_Dummy + 3); + ADTA_Frames = (ADTA_Dummy + 4); + { (longword) Number of frames in the animation } + + ADTA_Frame = (ADTA_Dummy + 5); + { (longword) Current frame } + + ADTA_FramesPerSecond = (ADTA_Dummy + 6); + { (longword) Frames per second } + + ADTA_FrameIncrement = (ADTA_Dummy + 7); + { (LONG) Amount to change frame by when fast forwarding or + * rewinding. Defaults to 10. } + + ADTA_PreloadFrameCount = (ADTA_Dummy + 8); { (V44) } +{ Sound attributes } + ADTA_Sample = SDTA_Sample ; + ADTA_SampleLength = SDTA_SampleLength; + ADTA_Period = SDTA_Period ; + ADTA_Volume = SDTA_Volume ; + ADTA_Cycles = SDTA_Cycles ; + + ADTA_LeftSample = SDTA_LeftSample; { (V44) } + ADTA_RightSample = SDTA_RightSample; { (V44) } + ADTA_SamplesPerSec = SDTA_SamplesPerSec; { (V44) } + +{ ***************************************************************************} + + ID_ANIM = 1095649613; + ID_ANHD = 1095649348; + ID_DLTA = 1145852993; + +{ ***************************************************************************} + +{ Required ANHD structure describes an ANIM frame } +Type + pAnimHeader = ^tAnimHeader; + tAnimHeader = record + ah_Operation : Byte; { The compression method: + 0 set directly (normal ILBM BODY), + 1 XOR ILBM mode, + 2 Long Delta mode, + 3 Short Delta mode, + 4 Generalized short/long Delta mode, + 5 Byte Vertical Delta mode + 6 Stereo op 5 (third party) + 74 (ascii 'J') reserved for Eric Graham's + compression technique (details to be + released later). } + + ah_Mask : Byte; { (XOR mode only - plane mask where each + bit is set =1 if there is data and =0 + if not.) } + + ah_Width, { (XOR mode only - width and height of the } + ah_Height, { area represented by the BODY to eliminate } + { unnecessary un-changed data) } + + + ah_Left, { (XOR mode only - position of rectangular } + ah_Top : WORD; { area representd by the BODY) } + + + ah_AbsTime, { Timing for a frame relative to the time + the first frame was displayed, in + jiffies (1/60 sec) } + + ah_RelTime : longword; { Timing for frame relative to time + previous frame was displayed - in + jiffies (1/60 sec) } + + ah_Interleave, { Indicates how may frames back this data is to + modify. 0 defaults to indicate two frames back + (for double buffering). n indicates n frames back. + The main intent here is to allow values + of 1 for special applications where + frame data would modify the immediately + previous frame. } + + ah_Pad0 : Byte; { Pad byte, not used at present. } + + ah_Flags : longword; { 32 option bits used by options=4 and 5. + At present only 6 are identified, but the + rest are set =0 so they can be used to + implement future ideas. These are defined + for option 4 only at this point. It is + recommended that all bits be set =0 for + option 5 and that any bit settings + used in the future (such as for XOR mode) + be compatible with the option 4 + bit settings. Player code should check + undefined bits in options 4 and 5 to assure + they are zero. + + The six bits for current use are: + + bit # set =0 set =1 + =============================================== + 0 short data long data + 1 set XOR + 2 separate info one info list + for each plane for all planes + 3 not RLC RLC (run length coded) + 4 horizontal vertical + 5 short info offsets long info offsets + } + + ah_Pad : Array[0..15] of Byte; { This is a pad for future use for future + compression modes. } + end; + +{ ***************************************************************************} + +const + ADTM_Dummy = ($700); + + ADTM_LOADFRAME = ($701); + { Used to load a frame of the animation } + + ADTM_UNLOADFRAME = ($702); + { Used to unload a frame of the animation } + + ADTM_START = ($703); + { Used to start the animation } + + ADTM_PAUSE = ($704); + { Used to pause the animation (don't reset the timer) } + + ADTM_STOP = ($705); + { Used to stop the animation } + + ADTM_LOCATE = ($706); + { Used to locate a frame in the animation (as set by a slider...) } + + { Used to load a new format frame of the animation (V44) } + ADTM_LOADNEWFORMATFRAME = ($707); + + { Used to unload a new format frame of the animation (V44) } + ADTM_UNLOADNEWFORMATFRAME = ($708); +{ ***************************************************************************} + +{ ADTM_LOADFRAME, ADTM_UNLOADFRAME } +Type + padtFrame = ^tadtFrame; + tadtFrame = record + MethodID, + alf_TimeStamp, { Timestamp of frame to load } + + { The following fields are filled in by the ADTM_LOADFRAME method, } + { and are read-only for any other methods. } + + alf_Frame, { Frame number } + alf_Duration : longword; { Duration of frame } + + alf_BitMap : pBitMap; { Loaded BitMap } + alf_CMap : pColorMap; { Colormap, if changed } + + alf_Sample : Pointer; { Sound data } + alf_SampleLength, + alf_Period : longword; + + alf_UserData : Pointer; { Used by load frame for extra data } + end; + + { ADTM_LOADNEWFORMATFRAME, ADTM_UNLOADNEWFORMATFRAME } + + PadtNewFormatFrame = ^tadtNewFormatFrame; + tadtNewFormatFrame = record + MethodID : longword; + alf_TimeStamp : longword; { Timestamp of frame to load } + { The following fields are filled in by the ADTM_NEWLOADFRAME method, } + { and are read-only for any other methods. } + alf_Frame : longword; { Frame number } + alf_Duration : longword; { Duration of frame } + alf_BitMap : PBitMap; { Loaded BitMap } + alf_CMap : PColorMap; { Colormap, if changed } + alf_Sample : PBYTE; + alf_SampleLength : longword; { Sound data } + alf_Period : longword; + alf_UserData : Pointer; { Used by load frame for extra data } + alf_Size : longword; { Size of this data structure (in bytes) } + alf_LeftSample : PBYTE; { Sound for left channel, or NULL if none } + alf_RightSample : PBYTE; { Sound for right channel, or NULL if none } + alf_SamplesPerSec : longword; { Replay speed; if > 0, this overrides alf_Period } + end; + + +{ ADTM_START, ADTM_PAUSE, ADTM_STOP, ADTM_LOCATE } + padtStart = ^tadtStart; + tadtStart = record + MethodID, + asa_Frame : longword; { Frame # to start at } + end; + +{ *************************************************************************** } + +var + DataTypesBase : PLibrary; + +const + DATATYPESNAME : PChar = 'datatypes.library'; + + +function ObtainDataTypeA(type_ : CARDINAL location 'd0'; handle : POINTER location 'a0'; attrs : pTagItem location 'a1') : pDataType; +SysCall DataTypesBase 036; + +function ObtainDataType(type_ : CARDINAL; handle : POINTER; attrs : array of LongWord) : pDataType; Inline; + +procedure ReleaseDataType(dt : pDataType location 'a0'); +SysCall DataTypesBase 042; + +function NewDTObjectA(name : PChar location 'd0'; attrs : pTagItem location 'a0') : CARDINAL; +SysCall DataTypesBase 048; + +function NewDTObject(name : PChar; attrs : array of LongWord) : CARDINAL; Inline; + +procedure DisposeDTObject(o : CARDINAL location 'a0'); +SysCall DataTypesBase 054; + +function SetDTAttrsA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; attrs : pTagItem location 'a3') : CARDINAL; +SysCall DataTypesBase 060; + +function SetDTAttrs(o : CARDINAL; win : pWindow; req : pRequester; attrs : array of LongWord) : CARDINAL; Inline; + +function GetDTAttrsA(o : CARDINAL location 'a0'; attrs : pTagItem location 'a2') : CARDINAL; +SysCall DataTypesBase 066; + +function GetDTAttrs(o : CARDINAL; attrs : array of LongWord) : CARDINAL; Inline; + +function AddDTObject(win : pWindow location 'a0'; req : pRequester location 'a1'; o : CARDINAL location 'a2'; pos : LongInt location 'd0') : LongInt; +SysCall DataTypesBase 072; + +procedure RefreshDTObjectA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; attrs : pTagItem location 'a3'); +SysCall DataTypesBase 078; + +procedure RefreshDTObject(o : CARDINAL; win : pWindow; req : pRequester; attrs : array of LongWord); Inline; + +function DoAsyncLayout(o : CARDINAL location 'a0'; gpl : pgpLayout location 'a1') : CARDINAL; +SysCall DataTypesBase 084; + +function DoDTMethodA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; msg : pLongInt location 'a3') : CARDINAL; +SysCall DataTypesBase 090; + +function DoDTMethod(o : CARDINAL; win : pWindow; req : pRequester; msg : array of LongInt) : CARDINAL; Inline; + +function RemoveDTObject(win : pWindow location 'a0'; o : CARDINAL location 'a1') : LongInt; +SysCall DataTypesBase 096; + +function GetDTMethods(o : CARDINAL location 'a0') : pCARDINAL; +SysCall DataTypesBase 102; + +function GetDTTriggerMethods(o : CARDINAL location 'a0') : pDTMethod; +SysCall DataTypesBase 108; + +function PrintDTObjectA(o : CARDINAL location 'a0'; w : pWindow location 'a1'; r : pRequester location 'a2'; msg : pdtPrint location 'a3') : CARDINAL; +SysCall DataTypesBase 114; + +function ObtainDTDrawInfoA(o : CARDINAL location 'a0'; attrs : pTagItem location 'a1') : POINTER; +SysCall DataTypesBase 120; + +function ObtainDTDrawInfo(o : CARDINAL; attrs : array of LongWord) : POINTER; Inline; + +function DrawDTObjectA(rp : pRastPort location 'a0'; o : CARDINAL location 'a1'; x : LongInt location 'd0'; y : LongInt location 'd1'; w : LongInt location 'd2'; h : LongInt location 'd3'; th : LongInt location 'd4'; tv : LongInt location 'd5'; attrs : pTagItem location 'a2') : LongInt; +SysCall DataTypesBase 126; + +function DrawDTObject(rp : pRastPort; o : CARDINAL; x : LongInt; y : LongInt; w : LongInt; h : LongInt; th : LongInt; tv : LongInt; attrs : array of LongWord) : LongInt; Inline; + +procedure ReleaseDTDrawInfo(o : CARDINAL location 'a0'; handle : POINTER location 'a1'); +SysCall DataTypesBase 132; + +function GetDTString(id : CARDINAL location 'd0') : pSHORTINT; +SysCall DataTypesBase 138; + +procedure LockDataType(dt : pDataType location 'a0'); +SysCall DataTypesBase 240; + +function FindToolNodeA(tl : pList location 'a0'; attrs : pTagItem location 'a1') : pToolNode; +SysCall DataTypesBase 246; + +function FindToolNode(tl : pList; attrs : array of LongWord) : pToolNode; Inline; + +function LaunchToolA(t : pTool location 'a0'; project : pSHORTINT location 'a1'; attrs : pTagItem location 'a2') : CARDINAL; +SysCall DataTypesBase 252; + +function LaunchTool(t : pTool; project : pSHORTINT; attrs : array of LongWord) : CARDINAL; Inline; + +function FindMethod(methods : CARDINAL location 'a0'; id : CARDINAL location 'a1') : pCARDINAL; +SysCall DataTypesBase 258; + +function FindTriggerMethod(triggermethods : pDTMethod location 'a0'; command : pSHORTINT location 'a1'; method : CARDINAL location 'd0') : pDTMethod; +SysCall DataTypesBase 264; + +function CopyDTMethods(src : CARDINAL location 'a0'; include : CARDINAL location 'a1'; exclude : CARDINAL location 'a2') : pCARDINAL; +SysCall DataTypesBase 270; + +function CopyDTTriggerMethods(src : pDTMethod location 'a0'; include : pDTMethod location 'a1'; exclude : pDTMethod location 'a2') : pDTMethod; +SysCall DataTypesBase 276; + +procedure FreeDTMethods(m : POINTER location 'a0'); +SysCall DataTypesBase 282; + +function GetDTTriggerMethodDataFlags(triggermethod : CARDINAL location 'd0') : CARDINAL; +SysCall DataTypesBase 288; + +function SaveDTObjectA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; file_ : PChar location 'a3'; mode : CARDINAL location 'd0'; saveicon : BOOLEAN location 'd1'; attrs : pTagItem location 'a4') : CARDINAL; +SysCall DataTypesBase 294; + +function SaveDTObject(o : CARDINAL; win : pWindow; req : pRequester; file_ : PChar; mode : CARDINAL; saveicon : BOOLEAN; attrs : array of LongWord) : CARDINAL; Inline; + +function StartDragSelect(o : CARDINAL location 'a0') : CARDINAL; +SysCall DataTypesBase 300; + +function DoDTDomainA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; rport : pRastPort location 'a3'; which : CARDINAL location 'd0'; domain : pIBox location 'a4'; attrs : pTagItem location 'a5') : CARDINAL; +SysCall DataTypesBase 306; + +function DoDTDomain(o : CARDINAL; win : pWindow; req : pRequester; rport : pRastPort; which : CARDINAL; domain : pIBox; attrs : array of LongWord) : CARDINAL; Inline; + + + +function InitDatatypesLibrary : boolean; + + +implementation + + +function ObtainDataType(type_ : CARDINAL; handle : POINTER; attrs : array of LongWord) : pDataType; Inline; +begin + ObtainDataType:=ObtainDataTypeA(type_, handle, @attrs); +end; + +function NewDTObject(name : PChar; attrs : array of LongWord) : CARDINAL; Inline; +begin + NewDTObject:=NewDTObjectA(name, @attrs); +end; + +function SetDTAttrs(o : CARDINAL; win : pWindow; req : pRequester; attrs : array of LongWord) : CARDINAL; Inline; +begin + SetDTAttrs:=SetDTAttrsA(o, win, req, @attrs); +end; + +function GetDTAttrs(o : CARDINAL; attrs : array of LongWord) : CARDINAL; Inline; +begin + GetDTAttrs:=GetDTAttrsA(o, @attrs); +end; + +function DoDTMethod(o : CARDINAL; win : pWindow; req : pRequester; msg : array of LongInt) : CARDINAL; Inline; +begin + DoDTMethod:=DoDTMethodA(o, win, req, @msg); +end; + +procedure RefreshDTObject(o : CARDINAL; win : pWindow; req : pRequester; attrs : array of LongWord); Inline; +begin + RefreshDTObjectA(o, win, req, @attrs); +end; + +function ObtainDTDrawInfo(o : CARDINAL; attrs : array of LongWord) : POINTER; Inline; +begin + ObtainDTDrawInfo:=ObtainDTDrawInfoA(o, @attrs); +end; + +function DrawDTObject(rp : pRastPort; o : CARDINAL; x : LongInt; y : LongInt; w : LongInt; h : LongInt; th : LongInt; tv : LongInt; attrs : array of LongWord) : LongInt; Inline; +begin + DrawDTObject:=DrawDTObjectA(rp, o, x, y, w, h, th, tv, @attrs); +end; + +function FindToolNode(tl : pList; attrs : array of LongWord) : pToolNode; Inline; +begin + FindToolNode:=FindToolNodeA(tl, @attrs); +end; + +function LaunchTool(t : pTool; project : pSHORTINT; attrs : array of LongWord) : CARDINAL; Inline; +begin + LaunchTool:=LaunchToolA(t, project, @attrs); +end; + +function SaveDTObject(o : CARDINAL; win : pWindow; req : pRequester; file_ : PChar; mode : CARDINAL; saveicon : BOOLEAN; attrs : array of LongWord) : CARDINAL; Inline; +begin + SaveDTObject:=SaveDTObjectA(o, win, req, file_, mode, saveicon, @attrs); +end; + +function DoDTDomain(o : CARDINAL; win : pWindow; req : pRequester; rport : pRastPort; which : CARDINAL; domain : pIBox; attrs : array of LongWord) : CARDINAL; Inline; +begin + DoDTDomain:=DoDTDomainA(o, win, req, rport, which, domain, @attrs); +end; + + +const + { Change VERSION and LIBVERSION to proper values } + VERSION : string[2] = '50'; + LIBVERSION : longword = 50; + +var + datatypes_exit : Pointer; + + +procedure CloseDatatypesLibrary; +begin + ExitProc := datatypes_exit; + if DatatypesBase <> nil then begin + CloseLibrary(PLibrary(DatatypesBase)); + DatatypesBase := nil; + end; +end; + +function InitDatatypesLibrary : boolean; +begin + DatatypesBase := nil; + DatatypesBase := OpenLibrary(DATATYPESNAME,LIBVERSION); + if DatatypesBase <> nil then begin + datatypes_exit := ExitProc; + ExitProc := @CloseDatatypesLibrary; + InitDatatypesLibrary:=True; + end else begin + InitDatatypesLibrary:=False; + end; +end; + + +end. { UNIT DATATYPES } diff --git a/packages/morphunits/src/exec.pas b/packages/morphunits/src/exec.pas new file mode 100644 index 0000000000..dcf91eeb30 --- /dev/null +++ b/packages/morphunits/src/exec.pas @@ -0,0 +1,2377 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + exec.library interface unit for MorphOS/PowerPC + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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 exec; + +interface + +var + ExecBase: Pointer; + +{.$include execd.inc} +{.$include execf.inc} + +{ * emulinterface consts from MorphOS SDK * } + +const + TRAP_MASK = $00ff; + TRAP_AREA_START = $ff00; { * $ff00 .. $ffff area * } + TRAP_LIB = $ff00; + TRAP_LIB_QUICK = $ff01; + TRAP_LIBNR = $ff05; + TRAP_LIBNR_QUICK = $ff06; + TRAP_ISYNC = $ff0f; + TRAP_SYNC = $ff10; + TRAP_EIEIO = $ff11; + TRAP_LIBSR = $ff12; + TRAP_LIBSRNR = $ff13; + TRAP_LIBD0_D1 = $ff14; + TRAP_LIBRESTORE = $ff15; + TRAP_LIBD0D1SR = $ff17; + TRAP_LIBD0D1A0A1SR = $ff18; + +const + EMULTAG_NAME = $0; { * Gives back a Name Ptr * } + EMULTAG_VERSION = $1; { * Gives back a Version * } + EMULTAG_REVISION = $2; { * Gives back a Revision * } + EMULTAG_OPCODETABLE = $3; { * Gives back the 16 Bit Opcodetable Ptr or NULL * } + EMULTAG_TYPE = $4; { * Gives back the emulation type * } + EMULTAG_EMULHANDLE = $5; { * Gives back the EmulHandle Ptr * } + EMULTAG_EMULHANDLESIZE = $6; { * Gives back the EmulHandle Size * } + EMULTAG_SUPERHANDLE = $7; { * Gives back the SuperHandle Ptr * } + EMULTAG_SUPERHANDLESIZE = $8; { * Gives back the SuperHandle Size * } + +{ * emulinterface structures from MorphOS SDK * } + +type + PEmulLibEntry = ^TEmulLibEntry; + TEmulLibEntry = packed record + Trap : Word; + Extension: Word; { * MUST be set to 0 if you create it by hand * } + Func : Pointer; + end; + + +{ * "dummy" definitions from utility, which we can't include here because it + * would create a circular dependency (KB) } +type + PTagItem = Pointer; + PHook = Pointer; + + +{ * exec node definitions (V50) + ********************************************************************* + * } + + +type + PNode = ^TNode; + TNode = packed record + ln_Succ: PNode; + ln_Pred: PNode; + ln_Type: Byte; + ln_Pri : ShortInt; + ln_Name: PChar; + end; + +type + PMinNode = ^TMinNode; + TMinNode = packed record + mln_Succ: PMinNode; + mln_Pred: PMinNode; + end; + + +const + NT_UNKNOWN = 0; + NT_TASK = 1; + NT_INTERRUPT = 2; + NT_DEVICE = 3; + NT_MSGPORT = 4; + NT_MESSAGE = 5; + NT_FREEMSG = 6; + NT_REPLYMSG = 7; + NT_RESOURCE = 8; + NT_LIBRARY = 9; + NT_MEMORY = 10; + NT_SOFTINT = 11; + NT_FONT = 12; + NT_PROCESS = 13; + NT_SEMAPHORE = 14; + NT_SIGNALSEM = 15; + NT_BOOTNODE = 16; + NT_KICKMEM = 17; + NT_GRAPHICS = 18; + NT_DEATHMESSAGE = 19; + NT_USER = 254; + NT_EXTENDED = 255; + + + +{ * exec list definitions (V50) + ********************************************************************* + * } + + +type + PList = ^TList; + TList = packed record + lh_Head : PNode; + lh_Tail : PNode; + lh_TailPred: PNode; + lh_Type : Byte; + lh_pad : Byte; + end; + +type + PMinList = ^TMinList; + TMinList = packed record + mlh_Head : PMinNode; + mlh_Tail : PMinNode; + mlh_TailPred: PMinNode; + end; + + + +{ * exec alert definitions (V50) + ********************************************************************* + * } + + +const + ACPU_BusErr = $80000002; + ACPU_AddressErr = $80000003; + ACPU_InstErr = $80000004; + ACPU_DivZero = $80000005; + ACPU_CHK = $80000006; + ACPU_TRAPV = $80000007; + ACPU_PrivErr = $80000008; + ACPU_Trace = $80000009; + ACPU_LineA = $8000000A; + ACPU_LineF = $8000000B; + ACPU_Format = $8000000E; + ACPU_Spurious = $80000018; + ACPU_AutoVec1 = $80000019; + ACPU_AutoVec2 = $8000001A; + ACPU_AutoVec3 = $8000001B; + ACPU_AutoVec4 = $8000001C; + ACPU_AutoVec5 = $8000001D; + ACPU_AutoVec6 = $8000001E; + ACPU_AutoVec7 = $8000001F; + + AT_DeadEnd = $80000000; + AT_Recovery = $00000000; + + AG_NoMemory = $00010000; + AG_MakeLib = $00020000; + AG_OpenLib = $00030000; + AG_OpenDev = $00040000; + AG_OpenRes = $00050000; + AG_IOError = $00060000; + AG_NoSignal = $00070000; + AG_BadParm = $00080000; + AG_CloseLib = $00090000; + AG_CloseDev = $000A0000; + AG_ProcCreate = $000B0000; + AG_MsgPortNotEmpty = $000C0000 { * V50 * }; + + AO_ExecLib = $00008001; + AO_GraphicsLib = $00008002; + AO_LayersLib = $00008003; + AO_Intuition = $00008004; + AO_MathLib = $00008005; + AO_DOSLib = $00008007; + AO_RAMLib = $00008008; + AO_IconLib = $00008009; + AO_ExpansionLib = $0000800A; + AO_DiskfontLib = $0000800B; + AO_UtilityLib = $0000800C; + AO_KeyMapLib = $0000800D; + + AO_AudioDev = $00008010; + AO_ConsoleDev = $00008011; + AO_GamePortDev = $00008012; + AO_KeyboardDev = $00008013; + AO_TrackDiskDev = $00008014; + AO_TimerDev = $00008015; + + AO_CIARsrc = $00008020; + AO_DiskRsrc = $00008021; + AO_MiscRsrc = $00008022; + + AO_BootStrap = $00008030; + AO_Workbench = $00008031; + AO_DiskCopy = $00008032; + AO_GadTools = $00008033; + AO_Unknown = $00008035; + + + { * + * exec.library + * } +const + AN_ExecLib = $01000000; + AN_ExcptVect = $01000001; + AN_BaseChkSum = $01000002; + AN_LibChkSum = $01000003; + + AN_MemCorrupt = $81000005; + AN_IntrMem = $81000006; + AN_InitAPtr = $01000007; + AN_SemCorrupt = $01000008; + + AN_FreeTwice = $01000009; + AN_BogusExcpt = $8100000A; + AN_IOUsedTwice = $0100000B; + AN_MemoryInsane = $0100000C; + + AN_IOAfterClose = $0100000D; + AN_StackProbe = $0100000E; + AN_BadFreeAddr = $0100000F; + AN_BadSemaphore = $01000010; + + { * + * graphics.library + * } +const + AN_GraphicsLib = $02000000; + AN_GfxNoMem = $82010000; + AN_GfxNoMemMspc = $82010001; + AN_LongFrame = $82010006; + AN_ShortFrame = $82010007; + AN_TextTmpRas = $02010009; + AN_BltBitMap = $8201000A; + AN_RegionMemory = $8201000B; + AN_MakeVPort = $82010030; + AN_GfxNewError = $0200000C; + AN_GfxFreeError = $0200000D; + + AN_GfxNoLCM = $82011234; + + AN_ObsoleteFont = $02000401; + + { * + * layers.library + * } +const + AN_LayersLib = $03000000; + AN_LayersNoMem = $83010000; + + { * + * intuition.library + * } +const + AN_Intuition = $04000000; + AN_GadgetType = $84000001; + AN_BadGadget = $04000001; + AN_CreatePort = $84010002; + AN_ItemAlloc = $04010003; + AN_SubAlloc = $04010004; + AN_PlaneAlloc = $84010005; + AN_ItemBoxTop = $84000006; + AN_OpenScreen = $84010007; + AN_OpenScrnRast = $84010008; + AN_SysScrnType = $84000009; + AN_AddSWGadget = $8401000A; + AN_OpenWindow = $8401000B; + AN_BadState = $8400000C; + AN_BadMessage = $8400000D; + AN_WeirdEcho = $8400000E; + AN_NoConsole = $8400000F; + AN_NoISem = $04000010; + AN_ISemOrder = $04000011; + + { * + * math.library + * } +const + AN_MathLib = $05000000; + + { * + * dos.library + * } +const + AN_DOSLib = $07000000; + AN_StartMem = $07010001; + AN_EndTask = $07000002; + AN_QPktFail = $07000003; + AN_AsyncPkt = $07000004; + AN_FreeVec = $07000005; + AN_DiskBlkSeq = $07000006; + AN_BitMap = $07000007; + AN_KeyFree = $07000008; + AN_BadChkSum = $07000009; + AN_DiskError = $0700000A; + AN_KeyRange = $0700000B; + AN_BadOverlay = $0700000C; + AN_BadInitFunc = $0700000D; + AN_FileReclosed = $0700000E; + + { * + * ramlib.library + * } +const + AN_RAMLib = $08000000; + AN_BadSegList = $08000001; + + { * + * icon.library + * } +const + AN_IconLib = $09000000; + + { * + * expansion.library + * } +const + AN_ExpansionLib = $0A000000; + AN_BadExpansionFree = $0A000001; + + { * + * diskfont.library + * } +const + AN_DiskfontLib = $0B000000; + + { * + * audio.device + * } +const + AN_AudioDev = $10000000; + + { * + * console.device + * } +const + AN_ConsoleDev = $11000000; + AN_NoWindow = $11000001; + + { * + * gameport.device + * } +const + AN_GamePortDev = $12000000; + + { * + * keyboard.device + * } +const + AN_KeyboardDev = $13000000; + + { * + * trackdisk.device + * } +const + AN_TrackDiskDev = $14000000; + AN_TDCalibSeek = $14000001; + AN_TDDelay = $14000002; + + { * + * timer.device + * } +const + AN_TimerDev = $15000000; + AN_TMBadReq = $15000001; + AN_TMBadSupply = $15000002; + + { * + * cia.resource + * } +const + AN_CIARsrc = $20000000; + + { * + * disk.resource + * } +const + AN_DiskRsrc = $21000000; + AN_DRHasDisk = $21000001; + AN_DRIntNoAct = $21000002; + + { * + * misc.resource + * } +const + AN_MiscRsrc = $22000000; + + { * + * bootstrap + * } +const + AN_BootStrap = $30000000; + AN_BootError = $30000001; + + { * + * Workbench + * } +const + AN_Workbench = $31000000; + AN_NoFonts = $B1000001; + AN_WBBadStartupMsg1 = $31000001; + AN_WBBadStartupMsg2 = $31000002; + AN_WBBadIOMsg = $31000003; + AN_WBReLayoutToolMenu = $B1010009; + + { * + * DiskCopy + * } +const + AN_DiskCopy = $32000000; + + { * + * toolkit for Intuition + * } +const + AN_GadTools = $33000000; + + { * + * System utility library + * } +const + AN_UtilityLib = $34000000; + + { * + * For use by any application that needs it + * } +const + AN_Unknown = $35000000; + + + +{ * exec error definitions (V50) + ********************************************************************* + * } + + +const + IOERR_OPENFAIL = (-1); + IOERR_ABORTED = (-2); + IOERR_NOCMD = (-3); + IOERR_BADLENGTH = (-4); + IOERR_BADADDRESS = (-5); + IOERR_UNITBUSY = (-6); + IOERR_SELFTEST = (-7); + IOERR_NOMEMORY = (-8); + + + +{ * exec resident definitions (V50) + ********************************************************************* + * } + + +type + PResident = ^TResident; + TResident = packed record + rt_MatchWord: Word; + rt_MatchTag : PResident; + rt_EndSkip : Pointer; + rt_Flags : Byte; + rt_Version : Byte; + rt_Type : Byte; + rt_Pri : Byte; + rt_Name : PChar; + rt_IdString : PChar; + rt_Init : Pointer; + { * Only valid when RTF_EXTENDED is set + * } + rt_Revision : Word; { * Revision Entry * } + rt_Tags : Pointer; + end; + + +const + RTC_MATCHWORD = $4AFC; + + RTF_AUTOINIT = (1 Shl 7); + RTF_EXTENDED = (1 Shl 6); { * structure extension is valid * } + { * rt_Init points to a PPC function which must be defined as + * + * struct Library* LIB_Init(struct Library *MyLibBase, + * BPTR SegList, + * struct ExecBase *SysBase) + * } + RTF_PPC = (1 Shl 3); + RTF_AFTERDOS = (1 Shl 2); + RTF_SINGLETASK = (1 Shl 1); + RTF_COLDSTART = (1 Shl 0); + + RTW_NEVER = 0; + RTW_COLDSTART = 1; + + + +{ * exec memory definitions (V50) + ********************************************************************* + * } + + +type + PMemChunk = ^TMemChunk; + TMemChunk = packed record + nc_Next : PMemChunk; + nc_Bytes: DWord; + end; + +type + PMemHeader = ^TMemHeader; + TMemHeader = packed record + mh_Node : TNode; + mh_Attributes: Word; + mh_First : PMemChunk; + mh_Lower : Pointer; + mh_Upper : Pointer; + mh_Free : DWord; + end; + +type + PMemEntry = ^TMemEntry; + TMemEntry = packed record + me_Un: packed record + case Byte of + 0 : (meu_Regs: DWord); + 1 : (meu_Addr: Pointer) + end; + me_Length: DWord; + end; + +type + PMemList = ^TMemList; + TMemList = packed record + ml_Node : TNode; + ml_NumEntries: Word; + ml_ME : PMemEntry; + end; + + +const + MEMF_ANY = 0; + MEMF_PUBLIC = (1 Shl 0); + MEMF_CHIP = (1 Shl 1); + MEMF_FAST = (1 Shl 2); + MEMF_LOCAL = (1 Shl 8); + MEMF_24BITDMA = (1 Shl 9); + MEMF_KICK = (1 Shl 10); + MEMF_SWAP = (1 Shl 11); { * Memory that can be swapped out to disk * } + + MEMF_CLEAR = (1 Shl 16); + MEMF_LARGEST = (1 Shl 17); + MEMF_REVERSE = (1 Shl 18); + MEMF_TOTAL = (1 Shl 19); + MEMF_SEM_PROTECTED = (1 Shl 20); { * Pools: semaphore protection * } + MEMF_NO_EXPUNGE = (1 Shl 31); + + MEM_BLOCKSIZE = 8; + MEM_BLOCKMASK = (MEM_BLOCKSIZE - 1); + + +type + PMemHandlerData = ^TMemHandlerData; + TMemHandlerData = packed record + memh_RequestSize : DWord; + memh_RequestFlags: DWord; + memh_Flags : DWord; + end; + + +const + MEMHF_RECYCLE = (1 Shl 0); + + MEM_DID_NOTHING = 0; + MEM_ALL_DONE = -1; + MEM_TRY_AGAIN = 1; + + + +{ * exec port definitions (V50) + ********************************************************************* + * } + + +type + PMsgPort = ^TMsgPort; + TMsgPort = packed record + mp_Node : TNode; + mp_Flags : Byte; + mp_SigBit : Byte; + mp_SigTask: Pointer; + mp_MsgList: TList; + end; + + +const + PF_ACTION = 3; + PA_SIGNAL = 0; + PA_SOFTINT = 1; + PA_IGNORE = 2; + + +type + PMessage = ^TMessage; + TMessage = packed record + mn_Node : TNode; + mn_ReplyPort: PMsgPort; + mn_Length : Word; + end; + + + +{ * exec task definitions (V50) + ********************************************************************* + * } + + +type + PTask = ^TTask; + TTask = packed record + tc_Node : TNode; + tc_Flags : Byte; + tc_State : Byte; + tc_IDNestCnt: ShortInt; + tc_TDNestCnt: ShortInt; + tc_SigAlloc : DWord; + tc_SigWait : DWord; + tc_SigRecvd : DWord; + tc_SigExcept: DWord; + {$IF 0} + tc_TrapAlloc: Word; + tc_TrapAble : Word; + {$ELSE} + tc_ETask: Pointer; + {$ENDIF} + tc_ExceptData: Pointer; + tc_ExceptCode: Pointer; + tc_TrapData : Pointer; + tc_TrapCode : Pointer; + tc_SPReg : Pointer; + tc_SPLower : Pointer; + tc_SPUpper : Pointer; + tc_Switch : Pointer; { *** OBSOLETE *** } + tc_Launch : Pointer; { *** OBSOLETE *** } + tc_MemEntry : TList; + tc_UserData : Pointer; + end; + + +const + TB_PROCTIME = 0; + TB_ETASK = 3; + TB_STACKCHK = 4; + TB_EXCEPT = 5; + TB_SWITCH = 6; + TB_LAUNCH = 7; + + TF_PROCTIME = (1 Shl TB_PROCTIME); + TF_ETASK = (1 Shl TB_ETASK); + TF_STACKCHK = (1 Shl TB_STACKCHK); + TF_EXCEPT = (1 Shl TB_EXCEPT); + TF_SWITCH = (1 Shl TB_SWITCH); + TF_LAUNCH = (1 Shl TB_LAUNCH); + + TS_INVALID = 0; + TS_ADDED = 1; + TS_RUN = 2; + TS_READY = 3; + TS_WAIT = 4; + TS_EXCEPT = 5; + TS_REMOVED = 6; + + SIGB_ABORT = 0; + SIGB_CHILD = 1; + SIGB_BLIT = 4; + SIGB_SINGLE = 4; + SIGB_INTUITION = 5; + SIGB_NET = 7; + SIGB_DOS = 8; + + SIGF_ABORT = (1 Shl SIGB_ABORT); + SIGF_CHILD = (1 Shl SIGB_CHILD); + SIGF_BLIT = (1 Shl SIGB_BLIT); + SIGF_SINGLE = (1 Shl SIGB_SINGLE); + SIGF_INTUITION = (1 Shl SIGB_INTUITION); + SIGF_NET = (1 Shl SIGB_NET); + SIGF_DOS = (1 Shl SIGB_DOS); + + +type + PTaskTrapMessage = ^TTaskTrapMessage; + TTaskTrapMessage = packed record + Message: TMessage; { * Message Header * } + Task : TTask; { * connected Task * } + Version: DWord; { * version of the structure * } + TType : DWord; { * Exception Type * } + DAR : DWord; { * Exception Address Register * } + DSISR : DWord; { * Exception DSISR Reg * } + + { * This is undiscovered land... + * never assume a size of this structure + * } + end; + + +const + VERSION_TASKTRAPMESSAGE = $0; + + +type + PETask = ^TETask; + TETask = packed record + Message : TMessage; + Parent : PTask; + UniqueID : DWord; + Children : TMinList; + TrapAlloc: Word; + TrapAble : Word; + Result1 : DWord; + Result2 : Pointer; + MsgPort : TMsgPort; + + { * Don't touch!!!!!!!!!..there'll be an interface + * sooner than later. + * New Entries...most of the above entries + * are only their for structure compatability. + * They have no meaning as the OS never supported + * them. + * } + + { * A Task Pool for the task. + * } + MemPool: Pointer; + + { * PPC's Stack Lower Ptr + * The initial stack is allocated through + * AllocVec, so a FreeVec(ETask^.PPCSPLower); + * would work. + * If you use PPCStackSwap you must allocate + * your stack block with AllocVec(); + * } + PPCSPLower: Pointer; + + { * PPC's Stack Upper Ptr + * } + PPCSPUpper : Pointer; + PPCRegFrame: Pointer; + PPCLibData : Pointer; + + { * On a PPC exception this msgport + * is sent an exception msg... + * the task is stopped until somebody + * wakes it up again. + * (asynchron exception interface) + * If this Port is NULL the message is + * sent to SysBase->ex_PPCTrapMsgPort. + * } + PPCTrapMsgPort: PMsgPort; + PPCTrapMessage: PTaskTrapMessage; + + { * This is undiscovered land... + * never assume a size of this structure + * } + end; + + +type + PTaskInitExtension = ^TTaskInitExtension; + TTaskInitExtension = packed record + { * Must be filled with TRAP_PPCTASK + * } + Trap : Word; + Extension: Word; { * Must be set to 0 * } + Tags : Pointer; + end; + +{ * This is normally in utility headers, but in Pascal that would + * cause a circular dependency, so have it duplicated here... (KB) } +const + TAG_USER = 1 Shl 31; + +const + TASKTAG_DUMMY = (TAG_USER + $100000); + + { * Ptr to an ULONG Errorfield where a better error description + * can be stored. + * } + TASKTAG_ERROR = (TASKTAG_DUMMY + $0); + + { * Code type + * can be stored. + * } + TASKTAG_CODETYPE = (TASKTAG_DUMMY + $1); + + { * Start PC + * code must be of TASKTAG_CODETYPE + * } + TASKTAG_PC = (TASKTAG_DUMMY + $2); + + { * Final PC + * code must be of TASKTAG_CODETYPE + * } + TASKTAG_FINALPC = (TASKTAG_DUMMY + $3); + + { * Stacksize...Default 8192 + * } + TASKTAG_STACKSIZE = (TASKTAG_DUMMY + $4); + + { * Std Stacksize... + * Default(use the stack defined by tc_SPLower..tc_SPUpper) + * } + TASKTAG_STACKSIZE_M68K = (TASKTAG_DUMMY + $5); + + { * specify task name, name is copied + * } + TASKTAG_NAME = (TASKTAG_DUMMY + $6); + + { * tc_UserData + * } + TASKTAG_USERDATA = (TASKTAG_DUMMY + $7); + + { * Task priority + * } + TASKTAG_PRI = (TASKTAG_DUMMY + $8); + + { * Pool's Puddlesize + * } + TASKTAG_POOLPUDDLE = (TASKTAG_DUMMY + $9); + + { * Pool's ThreshSize + * } + TASKTAG_POOLTHRESH = (TASKTAG_DUMMY + $a); + + { * PPC First Argument..gpr3 + * } + TASKTAG_PPC_ARG1 = (TASKTAG_DUMMY + $10); + + { * PPC First Argument..gpr4 + * } + TASKTAG_PPC_ARG2 = (TASKTAG_DUMMY + $11); + + { * PPC First Argument..gpr5 + * } + TASKTAG_PPC_ARG3 = (TASKTAG_DUMMY + $12); + + { * PPC First Argument..gpr6 + * } + TASKTAG_PPC_ARG4 = (TASKTAG_DUMMY + $13); + + { * PPC First Argument..gpr7 + * } + TASKTAG_PPC_ARG5 = (TASKTAG_DUMMY + $14); + + { * PPC First Argument..gpr8 + * } + TASKTAG_PPC_ARG6 = (TASKTAG_DUMMY + $15); + + { * PPC First Argument..gpr9 + * } + TASKTAG_PPC_ARG7 = (TASKTAG_DUMMY + $16); + + { * PPC First Argument..gpr10 + * } + TASKTAG_PPC_ARG8 = (TASKTAG_DUMMY + $17); + + { * + * Startup message to be passed to task/process, ReplyMsg'd at RemTask() + * ti_Data: struct Message * + * } + TASKTAG_STARTUPMSG = (TASKTAG_DUMMY + $18); + + { * + * Create internal MsgPort for task/process, deleted at RemTask() + * ti_Data: struct MsgPort **, can be NULL + * } + TASKTAG_TASKMSGPORT = (TASKTAG_DUMMY + $19); + + +const + CODETYPE_M68K = $0; + { * + * System V4 ABI + * } + CODETYPE_PPC = $1; + +const + TASKERROR_OK = 0; + TASKERROR_NOMEMORY = 1; + + + { * + * Stack swap structure as passed to StackSwap() and PPCStackSwap() + * } +type + PStackSwapStruct = ^TStackSwapStruct; + TStackSwapStruct = packed record + stk_Lower : Pointer; { * Lowest byte of stack * } + stk_Upper : Pointer; { * Upper end of stack (size + Lowert) * } + stk_Pointer: Pointer; { * Stack pointer at switch point * } + end; + +type + PPPCStackSwapArgs = ^TPPCStackSwapArgs; + TPPCStackSwapArgs = packed record + Args: Array[0..7] Of DWord; { * The C register arguments from gpr3..gpr11 * } + end; + + + { * + * NewGetTaskAttrsA(), NewSetTaskAttrsA() tags + * } +const + TASKINFOTYPE_ALLTASK = $0; + TASKINFOTYPE_NAME = $1; + TASKINFOTYPE_PRI = $2; + TASKINFOTYPE_TYPE = $3; + TASKINFOTYPE_STATE = $4; + TASKINFOTYPE_FLAGS = $5; + TASKINFOTYPE_SIGALLOC = $6; + TASKINFOTYPE_SIGWAIT = $7; + TASKINFOTYPE_SIGRECVD = $8; + TASKINFOTYPE_SIGEXCEPT = $9; + TASKINFOTYPE_EXCEPTDATA = $a; + TASKINFOTYPE_EXCEPTCODE = $b; + TASKINFOTYPE_TRAPDATA = $c; + TASKINFOTYPE_TRAPCODE = $d; + TASKINFOTYPE_STACKSIZE_M68K = $e; + TASKINFOTYPE_STACKSIZE = $f; + TASKINFOTYPE_USEDSTACKSIZE_M68K = $10; + TASKINFOTYPE_USEDSTACKSIZE = $11; + TASKINFOTYPE_TRAPMSGPORT = $12; + TASKINFOTYPE_STARTUPMSG = $13; + TASKINFOTYPE_TASKMSGPORT = $14; + TASKINFOTYPE_POOLPTR = $15; + TASKINFOTYPE_POOLMEMFLAGS = $16; + TASKINFOTYPE_POOLPUDDLESIZE = $17; + TASKINFOTYPE_POOLTHRESHSIZE = $18; + + { * + * Task Scheduler statistics (exec 50.42) + * } + TASKINFOTYPE_NICE = $19; + TASKINFOTYPE_AGETICKS = $1a; + TASKINFOTYPE_CPUTIME = $1b; + TASKINFOTYPE_LASTSECCPUTIME = $1c; + TASKINFOTYPE_RECENTCPUTIME = $1d; + TASKINFOTYPE_VOLUNTARYCSW = $1e; + TASKINFOTYPE_INVOLUNTARYCSW = $1f; + TASKINFOTYPE_LASTSECVOLUNTARYCSW = $20; + TASKINFOTYPE_LASTSECINVOLUNTARYCSW = $21; + { * Added in exec 50.45 * } + TASKINFOTYPE_LAUNCHTIMETICKS = $22; + TASKINFOTYPE_LAUNCHTIMETICKS1978 = $23; + TASKINFOTYPE_PID = $24; + + TASKINFOTYPE_68K_NEWFRAME = $50; + + TASKINFOTYPE_PPC_SRR0 = $100; + TASKINFOTYPE_PPC_SRR1 = $101; + TASKINFOTYPE_PPC_LR = $102; + TASKINFOTYPE_PPC_CTR = $103; + TASKINFOTYPE_PPC_CR = $104; + TASKINFOTYPE_PPC_XER = $105; + TASKINFOTYPE_PPC_GPR = $106; + TASKINFOTYPE_PPC_FPR = $107; + TASKINFOTYPE_PPC_FPSCR = $108; + TASKINFOTYPE_PPC_VSCR = $109; + TASKINFOTYPE_PPC_VMX = $10a; + TASKINFOTYPE_PPC_VSAVE = $10b; + TASKINFOTYPE_PPC_FRAME = $10c; + TASKINFOTYPE_PPC_FRAMESIZE = $10d; + TASKINFOTYPE_PPC_NEWFRAME = $10e; + + TASKINFOTAG_DUMMY = (TAG_USER + $110000); + { * Used with TASKINFOTYPE_ALLTASK + * } + TASKINFOTAG_HOOK = (TASKINFOTAG_DUMMY + $0); + { * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX + * to define the copy area + * } + TASKINFOTAG_REGSTART = (TASKINFOTAG_DUMMY + $1); + { * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX + * to define the copy area + * } + TASKINFOTAG_REGCOUNT = (TASKINFOTAG_DUMMY + $2); + + + { * + * NewSetTaskAttrsA(..,@TaskFrame68k,sizeof(TTaskFrame68k),TASKINFOTYPE_68K_NEWFRAME,...); + * } +type + PTaskFrame68k = ^TTaskFrame68k; + TTaskFrame68k = packed record + PC: Pointer; + SR: Word; + Xn: Array[0..14] Of LongInt; + end; + + + { * + * Don't depend on these + * } +const + DEFAULT_PPCSTACKSIZE = 32768; + DEFAULT_M68KSTACKSIZE = 2048; + DEFAULT_TASKPUDDLESIZE = 4096; + DEFAULT_TASKTHRESHSIZE = 4096; + + +{ * exec interrupt definitions (V50) + ********************************************************************* + * } + + +type + PInterrupt = ^TInterrupt; + TInterrupt = packed record + is_Node: TNode; + is_Data: Pointer; + is_Code: Pointer; + end; + +type + PIntVector = ^TIntVector; + TIntVector = packed record + iv_Data: Pointer; + iv_Code: Pointer; + iv_Node: PNode; + end; + +type + PSoftIntList = ^TSoftIntList; + TSoftIntList = packed record + sh_List: TList; + sh_Pad : Word; + end; + + +const + SIH_PRIMASK = $f0; + + INTB_NMI = 15; + INTF_NMI = (1 Shl INTB_NMI); + + + +{ * exec semaphore definitions (V50) + ********************************************************************* + * } + + + { * + * Shouldn't be available public.. + * } +type + PSemaphoreRequest = ^TSemaphoreRequest; + TSemaphoreRequest = packed record + sr_Link : TMinNode; + sr_Waiter: PTask; + end; + +type + PSignalSemaphore = ^TSignalSemaphore; + TSignalSemaphore = packed record + ss_Link : TNode; + ss_NestCount : SmallInt; + ss_WaitQueue : TMinList; + ss_MultipleLink: TSemaphoreRequest; + ss_Owner : PTask; + ss_QueueCount : SmallInt; + end; + +type + PSemaphoreMessage = ^TSemaphoreMessage; + TSemaphoreMessage = packed record + ssm_Message : TMessage; + ssm_Semaphore: PSignalSemaphore; + end; + + +const + SM_SHARED = 1; + SM_EXCLUSIVE = 0; + + + +{ * exec machine definitions (V50) + ********************************************************************* + * } + + +const + MACHINE_M68k = $0; + MACHINE_PPC = $1; + MACHINE_NO = $ffffffff; + + + +{ * exec library definitions (V50) + ********************************************************************* + * } + + +const + LIB_VECTSIZE = 6; + LIB_RESERVED = 4; + LIB_BASE = (-LIB_VECTSIZE); + LIB_USERDEF = (LIB_BASE - (LIB_RESERVED * LIB_VECTSIZE)); + LIB_NONSTD = (LIB_USERDEF); + + LIB_OPEN = -6; + LIB_CLOSE = -12; + LIB_EXPUNGE = -18; + LIB_EXTFUNC = -24; + LIB_GETQUERYATTR = -24; { * LIBF_QUERY * } + + +type + PLibrary = ^TLibrary; + TLibrary = packed record + lib_Node : TNode; + lib_Flags : Byte; + lib_pad : Byte; + lib_MegSize : Word; + lib_PosSize : Word; + lib_Version : Word; + lib_Revision: Word; + lib_IdString: PChar; + lib_Sum : DWord; + lib_OpenCnt : Word; + end; + + +const + LIBF_SUMMING = (1 Shl 0); + LIBF_CHANGED = (1 Shl 1); + LIBF_SUMUSED = (1 Shl 2); + LIBF_DELEXP = (1 Shl 3); + { * + * private + * } + LIBF_RAMLIB = (1 Shl 4); + { * + * Needs to be set if the GetQueryAttr function is legal + * } + LIBF_QUERYINFO = (1 Shl 5); + { * + * The remaining bits are reserved and aren`t allowed to be touched + * } + + + { * NewSetFunction extensions + * } +const + SETFUNCTAG_Dummy = (TAG_USER +$01000000); + + { * Set the machine type of the function + * Default is 68k + * } + SETFUNCTAG_MACHINE = (SETFUNCTAG_Dummy + $1); + + { * Function type specifier + * } + SETFUNCTAG_TYPE = (SETFUNCTAG_Dummy + $2); + + { * ID String + * } + SETFUNCTAG_IDNAME = (SETFUNCTAG_Dummy + $3); + + { * + * Set to TRUE if the replaced function will never be used + * again. + * } + SETFUNCTAG_DELETE = (SETFUNCTAG_Dummy + $4); + + + { * See emul/emulinterface.h for more informations + * } + + { * Save Emulation PPC Registers + * Call Function + * Restore Emulation PPC Registers + * REG_D0 = Result + * } +const + SETFUNCTYPE_NORMAL = 0; + { * Call Function + * Must use the global register settings of the emulation + * REG_D0 = Result + * } + SETFUNCTYPE_QUICK = 1; + { * Save Emulation PPC Registers + * Call Function + * Restore Emulation PPC Registers + * No Result + * Needed to replace functions like + * forbid,obtainsemaphores which are + * defined as trashing no registers + * } + SETFUNCTYPE_NORMALNR = 2; + { * Call Function + * Must use the global register settings of the emulation + * No Result + * Needed to replace functions like + * forbid,obtainsemaphores which are + * defined as trashing no registers + * } + SETFUNCTYPE_QUICKNR = 3; + SETFUNCTYPE_NORMALSR = 4; + SETFUNCTYPE_NORMALSRNR = 5; + SETFUNCTYPE_NORMALD0_D1 = 6; + SETFUNCTYPE_NORMALRESTORE = 7; + SETFUNCTYPE_SYSTEMV = 8; + SETFUNCTYPE_NORMALD0D1SR = 9; + SETFUNCTYPE_NORMALD0D1A0A1SR = 10; + + + { * CreateLibrary extensions + * } + LIBTAG_BASE = (TAG_USER + $01000100); + + { * + * Function/Vector Array + * } + LIBTAG_FUNCTIONINIT = (LIBTAG_BASE+$0); + { * + * Struct Init + * } + LIBTAG_STRUCTINIT = (LIBTAG_BASE+$1); + { * + * Library Init + * } + LIBTAG_LIBRARYINIT = (LIBTAG_BASE+$2); + { * + * Init Code Type + * } + LIBTAG_MACHINE = (LIBTAG_BASE+$3); + { * + * Library Base Size + * } + LIBTAG_BASESIZE = (LIBTAG_BASE+$4); + { * + * SegList Ptr + * } + LIBTAG_SEGLIST = (LIBTAG_BASE+$5); + { * + * Library Priority + * } + LIBTAG_PRI = (LIBTAG_BASE+$6); + { * + * Library Type..Library,Device,Resource,whatever + * } + LIBTAG_TYPE = (LIBTAG_BASE+$7); + { * + * Library Version + * (UWORD) + * } + LIBTAG_VERSION = (LIBTAG_BASE+$8); + { * + * Library Flags + * } + LIBTAG_FLAGS = (LIBTAG_BASE+$9); + { * + * Library Name + * } + LIBTAG_NAME = (LIBTAG_BASE+$a); + { * + * Library IDString + * } + LIBTAG_IDSTRING = (LIBTAG_BASE+$b); + { * + * AddDevice(),AddLibrary(),AddResource().. + * depends on LibNode.ln_Type field which + * can be set by some Init function, Struct Scripts + * or LIBTAG_TYPE. + * If you set LIBTAG_PUBLIC the library + * is added to the right system list. + * } + LIBTAG_PUBLIC = (LIBTAG_BASE+$c); + { * + * Library Revision + * (UWORD) + * } + LIBTAG_REVISION = (LIBTAG_BASE+$d); + { * + * Library QueryInfo Flag + * (Boolean) + * } + LIBTAG_QUERYINFO = (LIBTAG_BASE+$e); + + { * Private + * don`t touch...floating design + * } +type + PFuncEntry = ^TFuncEntry; + TFuncEntry = packed record + EmulLibEntry : TEmulLibEntry; + OldFunction : Pointer; { * Needed for bookkeeping * } + end; + + PFuncOldEntry = ^TFuncOldEntry; + TFuncOldEntry = packed record + Command : Word; + FuncEntry: PFuncEntry; + end; + + + { * + * EmulLibEntry.Extension + * } +const + FUNCENTRYEXTF_LIBRARY = $1; { * Entry created by the OS * } + + { * + * Functionarray first ULONG ID defines the format + * of the functionarray for MakeFunctions()/MakeLibrary(). + * + * If there`s not such id the functionarray is a + * 32Bit 68k function ptr array. + * (ULONG) $ffffffff stops it + * } + + { * 68k 16bit relative functionarray ptrs + * (UWORD) $ffff stops it + * } + + FUNCARRAY_16BIT_OLD = $ffffffff; + + { * PPC 32bit functionarray ptrs + * (ULONG) $ffff stops it + * } + FUNCARRAY_32BIT_NATIVE = $fffefffe; + + { * Starts a functionarray block. + * This way it`s possible to mix 68k and PPC + * function definitions. + * BASE: + * FUNCTIONARRAY_BEGIN + * FUNCARRAY_32BIT_NATIVE + * FUNC0 + * FUNC1 + * . + * FUNCn + * $ffffffff + * FUNCn+1 (No ID->32Bit 68k) + * FUNCn+2 + * . + * FUNCm + * $ffffffff + * FUNCARRAY_16BIT_OLD + * FUNCm+1-BASE + * FUNCm+2-BASE + * . + * FUNCo-BASE + * $ffff + * FUNCTIONARRAY_END + * } + + FUNCARRAY_BEGIN = $fffdfffd; + + { * Ends a functionarray block. + * } + FUNCARRAY_END = $fffcfffc; + + { * PPC 32bit Quick functionarray ptrs. + * These functions must comply to the emulation's + * register layout which is defined inside the + * emul/emulregs.h. That means the register layout + * MUST also be valid during interrupts/task switches. + * You can't just destroy A7(r31), SR or PC. + * + * You shouldn't use this for any normal code + * as there's no real reason to do so. If you + * really think you need to use it please ask + * us first on the dev mailinglist. + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_QUICK_NATIVE = $fffbfffb; + + { * PPC 32bit QuickNR(No Result) functionarray ptrs + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_QUICKNR_NATIVE = $fffafffa; + + { * PPC 32bit no result functionarray ptrs + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_NR_NATIVE = $fff9fff9; + + { * PPC 32bit SR functionarray ptrs + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_SR_NATIVE = $fff8fff8; + + { * PPC 32bit SR(no result) functionarray ptrs + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_SRNR_NATIVE = $fff7fff7; + + { * PPC 32bit D0_D1 functionarray ptrs + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_D0D1_NATIVE = $fff6fff6; + + { * PPC 32bit Restore1 functionarray ptrs + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_RESTORE_NATIVE = $fff5fff5; + + { * PPC 32bit SystemV ABI entry + * these function entries DON'T comply + * to the amiga register modell REG_D0-A6 + * but comply to the PPC SystemV ABI so + * you can directly use PPC C Argument + * parsing. That way you're also not limited + * with the register count. + * Such library functions can't be used + * by 68k emulation, so you can only use + * them for new code. + * As we allow these new functions to be + * used with old functions we keep the + * 6 bytes function entry steps in the library. + * Layout is + * + * CODE_JMP, &FuncEntry ; Old Entry + * CODE_ILLEGAL, Function ; SystemV ABI Entry + * + * + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_SYSTEMV = $fff4fff4; + + { * PPC 32bit D0D1SR functionarray ptrs + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_D0D1SR_NATIVE = $fff3fff3; + + { * PPC 32bit D0D1A0A1SR functionarray ptrs + * (ULONG) $ffffffff stops it + * } + FUNCARRAY_32BIT_D0D1A0A1SR_NATIVE = $fff2fff2; + + + +{ * exec device definitions (V50) + ********************************************************************* + * } + + +type + PDevice = ^TDevice; + TDevice = packed record + dd_Library: TLibrary; + end; + +type + PUnit = ^TUnit; + TUnit = packed record + unit_MsgPort: TMsgPort; + unit_flags : Byte; + unit_pad : Byte; + unit_OpenCnt: Word; + end; + + +const + UNITF_ACTIVE = (1 Shl 0); + UNITF_INTASK = (1 Shl 1); + + + +{ * exec io definitions (V50) + ********************************************************************* + * } + + +type + PIORequest = ^TIORequest; + TIORequest = packed record + io_Message: TMessage; + io_Device : PDevice; + io_Unit : PUnit; + io_Command: Word; + io_Flags : Byte; + io_Error : ShortInt; + end; + +type + PIOStdReq = ^TIOStdReq; + TIOStdReq = packed record + io_Message: TMessage; + io_Device : PDevice; + io_Unit : PUnit; + io_Command: Word; + io_Flags : Byte; + io_Error : ShortInt; + io_Actual : DWord; + io_Length : DWord; + io_Data : Pointer; + io_Offset : DWord; + end; + + +const + DEV_BEGINIO = -30; + DEV_ABORTIO = -36; + + IOB_QUICK = 0; + IOF_QUICK = (1 Shl IOB_QUICK); + + CMD_INVALID = 0; + CMD_RESET = 1; + CMD_READ = 2; + CMD_WRITE = 3; + CMD_UPDATE = 4; + CMD_CLEAR = 5; + CMD_STOP = 6; + CMD_START = 7; + CMD_FLUSH = 8; + CMD_NONSTD = 9; + + + +{ * exec include (V50) + ********************************************************************* + * } + + +type + PExecBase = ^TExecBase; + TExecBase = packed record + LIbNode : TLibrary; + SoftVer : Word; + LowMemChkSum: SmallInt; + ChkBase : DWord; + ColdCapture : Pointer; + CoolCapture : Pointer; + WarmCapture : Pointer; + SysStkUpper : Pointer; + SysStkLower : Pointer; + MaxLocMem : DWord; + DebugEntry : Pointer; + DebugData : Pointer; + AlertData : Pointer; + MaxExtMem : Pointer; + ChkSum : Word; + IntVects : Array[0..15] Of TIntVector; + ThisTask : PTask; + IdleCount : DWord; + DispCount : DWord; + Quantum : Word; + Elapsed : Word; + SysFlags : Word; + IDNestCnt : ShortInt; + TDNestCnt : ShortInt; + AttnFlags : Word; + AttnResched : Word; + ResModules : Pointer; + + TaskTrapCode : Pointer; + TaskExceptCode: Pointer; + TaskExitCode : Pointer; + TaskSigAlloc : DWord; + TaskTrapAlloc : Word; + + MemList : TList; + ResourceList: TList; + DeviceList : TList; + IntrList : TList; + LibList : TList; + PortList : TList; + TaskReady : TList; + TaskWait : TList; + SoftInts : Array[0..5] Of TSoftIntList; + LastAlert : Array[0..3] Of LongInt; + + VBlankFrequency : Byte; + PowerSupplyFrequency: Byte; + SemaphoreList : TList; + KickMemPtr : Pointer; + KickTagPtr : Pointer; + KickCheckSum : Pointer; + ex_Pad0 : Word; + ex_LaunchPoint : DWord; + ex_RamLibPrivate : Pointer; + ex_EClockFrequency : DWord; + ex_CacheControl : DWord; + ex_TaskID : DWord; + + { * New ABox Emulation Entries + * } + ex_EmulHandleSize : DWord; { * PPC EmulHandleSize..*private* * } + ex_PPCTrapMsgPort : PMsgPort; { * PPC ABox Exception MsgPort..*private* * } + ex_Reserved1 : Array[0..2] Of DWord; + ex_MMULock : Pointer; + ex_PatchPool : Pointer; { * PatchPool Ptr needed by SetFunction..*private* * } + ex_PPCTaskExitCode : Pointer; { * PPC Task exit function * } + ex_DebugFlags : DWord; { * Exec Debug Flags..*private* * } + + ex_MemHandlers : TMinList; + ex_MemHandler : Pointer; + end; + + + { * + * Outdated 68k cpu informations + * + * } +const + AFB_68010 = 0; + AFB_68020 = 1; + AFB_68030 = 2; + AFB_68040 = 3; + AFB_68881 = 4; + AFB_68882 = 5; + AFB_FPU40 = 6; + AFB_68060 = 7; + AFB_PRIVATE = 15; + + AFF_68010 = (1 Shl AFB_68010); + AFF_68020 = (1 Shl AFB_68020); + AFF_68030 = (1 Shl AFB_68030); + AFF_68040 = (1 Shl AFB_68040); + AFF_68881 = (1 Shl AFB_68881); + AFF_68882 = (1 Shl AFB_68882); + AFF_FPU40 = (1 Shl AFB_FPU40); + AFF_68060 = (1 Shl AFB_68060); + AFF_PRIVATE = (1 Shl AFB_PRIVATE); + + { * + * Outdated 68k cache functionality + * Mostly without function. + * } +const + CACRF_EnableI = (1 Shl 0); + CACRF_FreezeI = (1 Shl 1); + CACRF_ClearI = (1 Shl 3); + CACRF_IBE = (1 Shl 4); + CACRF_EnableD = (1 Shl 8); + CACRF_FreezeD = (1 Shl 9); + CACRF_ClearD = (1 Shl 11); + CACRF_DBE = (1 Shl 12); + CACRF_WriteAllocate = (1 Shl 13); + CACRF_EnableE = (1 Shl 30); + CACRF_CopyBack = (1 Shl 31); + + DMA_Continue = (1 Shl 1); + DMA_NoModify = (1 Shl 2); + DMA_ReadFromRAM = (1 Shl 3); + + SB_SAR = 15; + SB_TQE = 14; + SB_SINT = 13; + + SF_SAR = (1 Shl SB_SAR); + SF_TQE = (1 Shl SB_TQE); + SF_SINT = (1 Shl SB_SINT); + + + { ****** Debug Flags...(don`t depend on them) ********** } +const + EXECDEBUGF_INITRESIDENT = $1; + EXECDEBUGF_INITCODE = $2; + EXECDEBUGF_FINDRESIDENT = $4; + + EXECDEBUGF_CREATELIBRARY = $10; + EXECDEBUGF_SETFUNCTION = $20; + EXECDEBUGF_NEWSETFUNCTION = $40; + EXECDEBUGF_CHIPRAM = $80; + + EXECDEBUGF_ADDTASK = $100; + EXECDEBUGF_REMTASK = $200; + EXECDEBUGF_GETTASKATTR = $400; + EXECDEBUGF_SETTASKATTR = $800; + + EXECDEBUGF_EXCEPTHANDLER = $1000; + EXECDEBUGF_ADDDOSNODE = $2000; + EXECDEBUGF_PCI = $4000; + EXECDEBUGF_RAMLIB = $8000; + + EXECDEBUGF_NOLOGSERVER = $10000; + EXECDEBUGF_NOLOGWINDOW = $20000; + + { * + * "env:MorphOS/LogPath" contains the logfile path, + * If not specified it`s using "ram:.morphoslog" + * } + EXECDEBUGF_LOGFILE = $40000; + EXECDEBUGF_LOGKPRINTF = $80000; + + { * Memory Tracking Flags + * } + EXECDEBUGF_PERMMEMTRACK = $100000; + EXECDEBUGF_MEMTRACK = $200000; + + { * CyberGuardPPC Flags + * } + EXECDEBUGF_CYBERGUARDDEADLY = $400000; + + { * PPCLib Flags + * } + EXECDEBUGF_LOADSEG = $01000000; + EXECDEBUGF_UNLOADSEG = $02000000; + EXECDEBUGF_PPCSTART = $04000000; + + { * UserFlags + * } + + { * + * Enables debug output for cybergraphx + * } +const + EXECDEBUGF_CGXDEBUG = $08000000; + + { * + * Should be used to control user LibInit/DevInit Debug output + * } + EXECDEBUGF_INIT = $40000000; + + { * + * Should be used to control logging + * } + EXECDEBUGF_LOG = $80000000; + + { * + * Execbase list IDs + * } + EXECLIST_DEVICE = 0; + EXECLIST_INTERRUPT = 1; + EXECLIST_LIBRARY = 2; + EXECLIST_MEMHANDLER = 3; + EXECLIST_MEMHEADER = 4; + EXECLIST_PORT = 5; + EXECLIST_RESOURCE = 6; + EXECLIST_SEMAPHORE = 7; + EXECLIST_TASK = 8; + + + { * + * Execnotify hook message + * } +type + PExecNotifyMessage = ^TExecNotifyMessage; + TExecNotifyMessage = packed record + MType : DWord; + Flags : DWord; + Extra : DWord; + Extension: Pointer; + end; + + +const + EXECNOTIFYF_REMOVE = (1 Shl 0); { * if clear, is ADD * } + EXECNOTIFYF_POST = (1 Shl 1); { * if clear, is PRE * } + + + { * + * AddExecNodeTagList tags + * } +const + SAL_Dummy = (TAG_USER + 1000); + SAL_Type = (SAL_Dummy + 1); + SAL_Priority = (SAL_Dummy + 2); + SAL_Name = (SAL_Dummy + 3); + + +function Supervisor(userFunction: Pointer location 'a5'): Cardinal; +SysCall MOS_ExecBase 030; + +procedure InitCode(startClass: Cardinal location 'd0'; + version : Cardinal location 'd1'); +SysCall MOS_ExecBase 072; + +procedure InitStruct(initTable: Pointer location 'a1'; + memory : Pointer location 'a2'; + size : Cardinal location 'd0'); +SysCall MOS_ExecBase 078; + +function MakeLibrary(funcInit : Pointer location 'a0'; + structInit: Pointer location 'a1'; + libInit : Pointer location 'a2'; + dataSize : Cardinal location 'd0'; + segList : Cardinal location 'd1'): PLibrary; +SysCall MOS_ExecBase 084; + +procedure MakeFunctions(target : Pointer location 'a0'; + functionArray: Pointer location 'a1'; + funcDispBase : Pointer location 'a2'); +SysCall MOS_ExecBase 090; + +function FindResident(name: PChar location 'a1'): PResident; +SysCall MOS_ExecBase 096; + +function InitResident(resident: PResident location 'a1'; + segList : Cardinal location 'd1'): Pointer; +SysCall MOS_ExecBase 102; + +procedure Alert(alertNum: Cardinal location 'd7'); +SysCall MOS_ExecBase 108; + +procedure Debug(flags: Cardinal location 'd0'); +SysCall MOS_ExecBase 114; + +procedure Disable; +SysCall MOS_ExecBase 120; + +procedure Enable; +SysCall MOS_ExecBase 126; + +procedure Forbid; +SysCall MOS_ExecBase 132; + +procedure Permit; +SysCall MOS_ExecBase 138; + +function SetSR(newSR: Cardinal location 'd0'; + mask : Cardinal location 'd1'): Cardinal; +SysCall MOS_ExecBase 144; + +function SuperState : Pointer; +SysCall MOS_ExecBase 150; + +procedure UserState(sysStack: Pointer location 'd0'); +SysCall MOS_ExecBase 156; + +function SetIntVector(intNumber: LongInt location 'd0'; + interrupt: PInterrupt location 'a1'): PInterrupt; +SysCall MOS_ExecBase 162; + +procedure AddIntServer(intNumber: LongInt location 'd0'; + interrupt: PInterrupt location 'a1'); +SysCall MOS_ExecBase 168; + +procedure RemIntServer(intNumber: LongInt location 'd0'; + interrupt: PInterrupt location 'a1'); +SysCall MOS_ExecBase 174; + +procedure Cause(interrupt: PInterrupt location 'a1'); +SysCall MOS_ExecBase 180; + +function Allocate(freeList: PMemHeader location 'a0'; + byteSize: Cardinal location 'd0'): Pointer; +SysCall MOS_ExecBase 186; + +procedure Deallocate(freeList : PMemHeader location 'a0'; + memoryBlock: Pointer location 'a1'; + byteSize : Cardinal location 'd0'); +SysCall MOS_ExecBase 192; + +{ * Name changed to avoid conflict with heap manager... * } +function execAllocMem(byteSize : Cardinal location 'd0'; + requirements: Cardinal location 'd1'): Pointer; +SysCall MOS_ExecBase 198; + +function AllocAbs(byteSize: Cardinal location 'd0'; + location: Pointer location 'a1'): Pointer; +SysCall MOS_ExecBase 204; + +{ * Name changed to avoid conflict with heap manager... * } +procedure execFreeMem(memoryBlock: Pointer location 'a1'; + byteSize : Cardinal location 'd0'); +SysCall MOS_ExecBase 210; + +function AvailMem(requirements: Cardinal location 'd1'): Cardinal; +SysCall MOS_ExecBase 216; + +function AllocEntry(entry: PMemList location 'a0'): PMemList; +SysCall MOS_ExecBase 222; + +procedure FreeEntry(entry: PMemList location 'a0'); +SysCall MOS_ExecBase 228; + +{ * Name changed to avoid conflict with other System unit call... * } +procedure execInsert(list: PList location 'a0'; + node: PNode location 'a1'; + pred: PNode location 'a2'); +SysCall MOS_ExecBase 234; + +procedure AddHead(list: PList location 'a0'; + node: PNode location 'a1'); +SysCall MOS_ExecBase 240; + +procedure AddTail(list: PList location 'a0'; + node: PNode location 'a1'); +SysCall MOS_ExecBase 246; + +procedure Remove(node: PNode location 'a1'); +SysCall MOS_ExecBase 252; + +function RemHead(list: PList location 'a0'): PNode; +SysCall MOS_ExecBase 258; + +function RemTail(list: PList location 'a0'): PNode; +SysCall MOS_ExecBase 264; + +procedure Enqueue(list: PList location 'a0'; + node: PNode location 'a1'); +SysCall MOS_ExecBase 270; + +function FindName(list: PList location 'a0'; + name: PChar location 'a1'): PNode; +SysCall MOS_ExecBase 276; + +function AddTask(task : PTask location 'a1'; + initPC : Pointer location 'a2'; + finalPC: Pointer location 'a3'): Pointer; +SysCall MOS_ExecBase 282; + +procedure RemTask(task: PTask location 'a1'); +SysCall MOS_ExecBase 288; + +function FindTask(name: PChar location 'a1'): PTask; +SysCall MOS_ExecBase 294; + +function SetTaskPri(task : PTask location 'a1'; + priority: LongInt location 'd0'): ShortInt; +SysCall MOS_ExecBase 300; + +function SetSignal(newSignals: Cardinal location 'd0'; + signalSet : Cardinal location 'd1'): Cardinal; +SysCall MOS_ExecBase 306; + +function SetExcept(newSignals: Cardinal location 'd0'; + signalSet : Cardinal location 'd1'): Cardinal; +SysCall MOS_ExecBase 312; + +function Wait(signalSet: Cardinal location 'd0'): Cardinal; +SysCall MOS_ExecBase 318; + +procedure Signal(task : PTask location 'a1'; + signalSet: Cardinal location 'd0'); +SysCall MOS_ExecBase 324; + +function AllocSignal(signalNum: LongInt location 'd0'): ShortInt; +SysCall MOS_ExecBase 330; + +procedure FreeSignal(signalNum: LongInt location 'd0'); +SysCall MOS_ExecBase 336; + +function AllocTrap(trapNum: LongInt location 'd0'): LongInt; +SysCall MOS_ExecBase 342; + +procedure FreeTrap(trapNum: LongInt location 'd0'); +SysCall MOS_ExecBase 348; + +procedure AddPort(port: PMsgPort location 'a1'); +SysCall MOS_ExecBase 354; + +procedure RemPort(port: PMsgPort location 'a1'); +SysCall MOS_ExecBase 360; + +procedure PutMsg(port : PMsgPort location 'a0'; + message: PMessage location 'a1'); +SysCall MOS_ExecBase 366; + +function GetMsg(port: PMsgPort location 'a0'): PMessage; +SysCall MOS_ExecBase 372; + +procedure ReplyMsg(message : PMessage location 'a1'); +SysCall MOS_ExecBase 378; + +function WaitPort(port: PMsgPort location 'a0'): PMessage; +SysCall MOS_ExecBase 384; + +function FindPort(name: PChar location 'a1'): PMsgPort; +SysCall MOS_ExecBase 390; + +procedure AddLibrary(libHandle: PLibrary location 'a1'); +SysCall MOS_ExecBase 396; + +procedure RemLibrary(libHandle: PLibrary location 'a1'); +SysCall MOS_ExecBase 402; + +function OldOpenLibrary(libName: PChar location 'a1'): PLibrary; +SysCall MOS_ExecBase 408; + +procedure CloseLibrary(libHandle: PLibrary location 'a1'); +SysCall MOS_ExecBase 414; + +function SetFunction(libHandle : PLibrary location 'a1'; + funcOffset : LongInt location 'a0'; + newFunction: Pointer location 'd0'): Pointer; +SysCall MOS_ExecBase 420; + +procedure SumLibrary(libHandle: PLibrary location 'a1'); +SysCall MOS_ExecBase 426; + +procedure AddDevice(device: PDevice location 'a1'); +SysCall MOS_ExecBase 432; + +procedure RemDevice(device: PDevice location 'a1'); +SysCall MOS_ExecBase 438; + +function OpenDevice(devName : PChar location 'a0'; + numunit : Cardinal location 'd0'; + ioRequest: pIORequest location 'a1'; + flags : Cardinal location 'd1'): ShortInt; +SysCall MOS_ExecBase 444; + +procedure CloseDevice(ioRequest: PIORequest location 'a1'); +SysCall MOS_ExecBase 450; + +function DoIO(ioRequest: PIORequest location 'a1'): ShortInt; +SysCall MOS_ExecBase 456; + +procedure SendIO(ioRequest: PIORequest location 'a1'); +SysCall MOS_ExecBase 462; + +function CheckIO(ioRequest: PIORequest location 'a1'): PIORequest; +SysCall MOS_ExecBase 468; + +function WaitIO(ioRequest: PIORequest location 'a1'): ShortInt; +SysCall MOS_ExecBase 474; + +procedure AbortIO(ioRequest: PIORequest location 'a1'); +SysCall MOS_ExecBase 480; + +procedure AddResource(resource: Pointer location 'a1'); +SysCall MOS_ExecBase 486; + +procedure RemResource(resource: Pointer location 'a1'); +SysCall MOS_ExecBase 492; + +function OpenResource(resName: PChar location 'a1'): Pointer; +SysCall MOS_ExecBase 498; + +procedure RawIOInit; +SysCall MOS_ExecBase 504; + +function RawMayGetChar: Char; +SysCall MOS_ExecBase 510; + +procedure RawPutChar(d0arg: Char location 'd0'); +SysCall MOS_ExecBase 516; + +function RawDoFmt(formatString: PChar location 'a0'; + dataStream : Pointer location 'a1'; + putChProc : Pointer location 'a2'; + putChData : Pointer location 'a3'): Pointer; +SysCall MOS_ExecBase 522; + +function GetCC: Cardinal; +SysCall MOS_ExecBase 528; + +function TypeOfMem(address: Pointer location 'a1'): Cardinal; +SysCall MOS_ExecBase 534; + +function Procure(sigSem: PSignalSemaphore location 'a0'; + bidMsg: PSemaphoreMessage location 'a1'): Cardinal; +SysCall MOS_ExecBase 540; + +procedure Vacate(sigSem: PSignalSemaphore location 'a0'; + bidMsg: PSemaphoreMessage location 'a1'); +SysCall MOS_ExecBase 546; + +function OpenLibrary(libname: PChar location 'a1'; + libver : Cardinal location 'd0'): Pointer; +SysCall MOS_ExecBase 552; + +procedure InitSemaphore(sigSem: PSignalSemaphore location 'a0'); +SysCall MOS_ExecBase 558; + +procedure ObtainSemaphore(sigSem: PSignalSemaphore location 'a0'); +SysCall MOS_ExecBase 564; + +procedure ReleaseSemaphore(sigSem: PSignalSemaphore location 'a0'); +SysCall MOS_ExecBase 570; + +function AttemptSemaphore(sigSem: PSignalSemaphore location 'a0'): Cardinal; +SysCall MOS_ExecBase 576; + +procedure ObtainSemaphoreList(sigSem: PList location 'a0'); +SysCall MOS_ExecBase 582; + +procedure ReleaseSemaphoreList(sigSem: PList location 'a0'); +SysCall MOS_ExecBase 588; + +function FindSemaphore(sigSem: PChar location 'a1'): PSignalSemaphore; +SysCall MOS_ExecBase 594; + +procedure AddSemaphore(sigSem: PSignalSemaphore location 'a1'); +SysCall MOS_ExecBase 600; + +procedure RemSemaphore(sigSem: PSignalSemaphore location 'a1'); +SysCall MOS_ExecBase 606; + +function SumKickData: Cardinal; +SysCall MOS_ExecBase 612; + +procedure AddMemList(size : Cardinal location 'd0'; + attributes: Cardinal location 'd1'; + pri : LongInt location 'd2'; + base : Pointer location 'a0'; + name : PChar location 'a1'); +SysCall MOS_ExecBase 618; + +procedure CopyMem(source: Pointer location 'a0'; + dest : Pointer location 'a1'; + size : Cardinal location 'd0'); +SysCall MOS_ExecBase 624; + +procedure CopyMemQuick(source: Pointer location 'a0'; + dest : Pointer location 'a1'; + size : Cardinal location 'd0'); +SysCall MOS_ExecBase 630; + +procedure CacheClearU; +SysCall MOS_ExecBase 636; + +procedure CacheClearE(address: Pointer location 'a0'; + length : Cardinal location 'd0'; + caches : Cardinal location 'd1'); +SysCall MOS_ExecBase 642; + +function CacheControl(cacheBits: Cardinal location 'd0'; + cacheMask: Cardinal location 'd1'): Cardinal; +SysCall MOS_ExecBase 648; + +function CreateIORequest(port: PMsgPort location 'a0'; + size: Cardinal location 'd0'): Pointer; +SysCall MOS_ExecBase 654; + +procedure DeleteIORequest(iorequest: Pointer location 'a0'); +SysCall MOS_ExecBase 660; + +function CreateMsgPort: PMsgPort; +SysCall MOS_ExecBase 666; + +procedure DeleteMsgPort(port: PMsgPort location 'a0'); +SysCall MOS_ExecBase 672; + +procedure ObtainSemaphoreShared(sigSem: PSignalSemaphore location 'a0'); +SysCall MOS_ExecBase 678; + +function AllocVec(byteSize : Cardinal location 'd0'; + requirements: Cardinal location 'd1'): Pointer; +SysCall MOS_ExecBase 684; + +procedure FreeVec(memoryBlock: Pointer location 'a1'); +SysCall MOS_ExecBase 690; + +function CreatePool(requirements: Cardinal location 'd0'; + puddleSize : Cardinal location 'd1'; + threshSize : Cardinal location 'd2'): Pointer; +SysCall MOS_ExecBase 696; + +procedure DeletePool(poolHeader: Pointer location 'a0'); +SysCall MOS_ExecBase 702; + +function AllocPooled(poolHeader: Pointer location 'a0'; + memSize : Cardinal location 'd0'): Pointer; +SysCall MOS_ExecBase 708; + +function FreePooled(poolHeader: Pointer location 'a0'; + memory : Pointer location 'a1'; + memSize : Cardinal location 'd0'): Pointer; +SysCall MOS_ExecBase 714; + +function AttemptSemaphoreShared(sigSem: pSignalSemaphore location 'a0'): Cardinal; +SysCall MOS_ExecBase 720; + +procedure ColdReboot; +SysCall MOS_ExecBase 726; + +procedure StackSwap(newStack: PStackSwapStruct location 'a0'); +SysCall MOS_ExecBase 732; + +function NewGetTaskAttrsA(Task : PTask location 'a0'; + Data : Pointer location 'a1'; + DataSize: Cardinal location 'd0'; + TType : Cardinal location 'd1'; + Tags : PTagItem location 'a2'): Cardinal; +SysCall MOS_ExecBase 738; + +function NewSetTaskAttrsA(Task : PTask location 'a0'; + Data : Pointer location 'a1'; + DataSize: Cardinal location 'd0'; + TType : Cardinal location 'd1'; + Tags : PTagItem location 'a2'): Cardinal; +SysCall MOS_ExecBase 744; + +function CachePreDMA(address : Pointer location 'a0'; + var length: Cardinal location 'a1'; + flags : Cardinal location 'd0'): Pointer; +SysCall MOS_ExecBase 762; + +procedure CachePostDMA(address : Pointer location 'a0'; + var length: Cardinal location 'a1'; + flags : Cardinal location 'd0'); +SysCall MOS_ExecBase 768; + +procedure AddMemHandler(memhand: PInterrupt location 'a1'); +SysCall MOS_ExecBase 774; + +procedure RemMemHandler(memhand: PInterrupt location 'a1'); +SysCall MOS_ExecBase 780; + +function ObtainQuickVector(interruptCode: Pointer location 'a0'): Cardinal; +SysCall MOS_ExecBase 786; + +function NewSetFunction(libHandle : PLibrary location 'a0'; + newfunction: Pointer location 'a1'; + offset : LongInt location 'd0'; + tags : PTagItem location 'a2'): Pointer; +SysCall MOS_ExecBase 792; + +function NewCreateLibrary(tags: PTagItem location 'a0'): PLibrary; +SysCall MOS_ExecBase 798; + +function NewPPCStackSwap(newStack : PStackSwapStruct location 'a0'; + sfunction: Pointer location 'a1'; + args : PPPCStackSwapArgs location 'a2'): Cardinal; +SysCall MOS_ExecBase 804; + +function TaggedOpenLibrary(d0arg: LongInt location 'd0'): Pointer; +SysCall MOS_ExecBase 810; + +function ReadGayle: Cardinal; +SysCall MOS_ExecBase 816; + +function VNewRawDoFmt(FmtString: PChar; + PutChProc: Pointer; + PutChData: PChar; + args : PChar): PChar; +SysCall BaseSysV MOS_ExecBase 822; + +procedure CacheFlushDataArea(Address: Pointer location 'a0'; + Size : Cardinal location 'd0'); +SysCall MOS_ExecBase 828; + +procedure CacheInvalidInstArea(Address: Pointer location 'a0'; + Size : Cardinal location 'd0'); +SysCall MOS_ExecBase 834; + +procedure CacheInvalidDataArea(Address: Pointer location 'a0'; + Size : Cardinal location 'd0'); +SysCall MOS_ExecBase 840; + +procedure CacheFlushDataInstArea(Address: Pointer location 'a0'; + Size : Cardinal location 'd0'); +SysCall MOS_ExecBase 846; + +procedure CacheTrashCacheArea(Address: Pointer location 'a0'; + Size : Cardinal location 'd0'); +SysCall MOS_ExecBase 852; + +function AllocTaskPooled(Size: Cardinal location 'd0'): Pointer; +SysCall MOS_ExecBase 858; + +procedure FreeTaskPooled(Address: Pointer location 'a1'; + Size : Cardinal location 'd0'); +SysCall MOS_ExecBase 864; + +function AllocVecTaskPooled(Size: Cardinal location 'd0'): Pointer; +SysCall MOS_ExecBase 870; + +procedure FreeVecTaskPooled(Address: Pointer location 'a1'); +SysCall MOS_ExecBase 876; + +procedure FlushPool(poolHeader: Pointer location 'a0'); +SysCall MOS_ExecBase 882; + +procedure FlushTaskPool; +SysCall MOS_ExecBase 888; + +function AllocVecPooled(poolHeader: Pointer location 'a0'; + memSize : Cardinal location 'd0'): Pointer; +SysCall MOS_ExecBase 894; + +function NewGetSystemAttrsA(Data : Pointer location 'a0'; + DataSize: Cardinal location 'd0'; + TType : Cardinal location 'd1'; + Tags : PTagItem location 'a1'): Cardinal; +SysCall MOS_ExecBase 906; + +function NewSetSystemAttrsA(Data : Pointer location 'a0'; + DataSize: Cardinal location 'd0'; + TType : Cardinal location 'd1'; + Tags : PTagItem location 'a1'): Cardinal; +SysCall MOS_ExecBase 912; + +function NewCreateTaskA(Tags: PTagItem location 'a0'): PTask; +SysCall MOS_ExecBase 918; + +function AllocateAligned(memHeader : pMemHeader; + byteSize : Cardinal; + alignSize : Cardinal; + alignOffset: Cardinal): Pointer; +SysCall BaseSysV MOS_ExecBase 930; + +function AllocMemAligned(byteSize : Cardinal; + attributes : Cardinal; + alignSize : Cardinal; + alignOffset: Cardinal): Pointer; +SysCall BaseSysV MOS_ExecBase 936; + +function AllocVecAligned(byteSize : Cardinal; + attributes : Cardinal; + alignSize : Cardinal; + alignOffset: Cardinal): Pointer; +SysCall BaseSysV MOS_ExecBase 942; + +procedure AddExecNotify(hook: PHook); +SysCall BaseSysV MOS_ExecBase 948; + +procedure RemExecNotify(hook: PHook); +SysCall BaseSysV MOS_ExecBase 954; + +function FindExecNode(ttype: Cardinal location 'd0'; + name : PChar location 'a0'): PNode; +SysCall MOS_ExecBase 960; + +function AddExecNodeA(innode : Pointer location 'a0'; + TagItems: PTagItem location 'a1'): Pointer; +SysCall MOS_ExecBase 966; + +function AllocVecDMA(byteSize : Cardinal location 'd0'; + requirements: Cardinal location 'd1'): Pointer; +SysCall MOS_ExecBase 972; + +procedure FreeVecDMA(memoryBlock: Pointer location 'a1'); +SysCall MOS_ExecBase 978; + +function AllocPooledAligned(poolHeader : Pointer; + byteSize : Cardinal; + alignSize : Cardinal; + alignOffset: Cardinal): Pointer; +SysCall BaseSysV MOS_ExecBase 984; + +function AddResident(resident: pResident location 'd0'): LongInt; +SysCall BaseSysV MOS_ExecBase 990; + +function FindTaskByPID(processID: Cardinal): PTask; +SysCall BaseSysV MOS_ExecBase 996; + +function NewGetTaskAttrs(Task : PTask; + Data : Pointer; + DataSize: Cardinal; + TType : Cardinal; + Tags : array of DWord): Cardinal; Inline; + +implementation + +function NewGetTaskAttrs(Task : PTask; + Data : Pointer; + DataSize: Cardinal; + TType : Cardinal; + Tags : array of DWord): Cardinal; Inline; +begin + NewGetTaskAttrs:=NewGetTaskAttrsA(Task,Data,DataSize,TType,@Tags); +end; + + +begin + ExecBase:=MOS_ExecBase; +end. diff --git a/packages/morphunits/src/get9.pas b/packages/morphunits/src/get9.pas new file mode 100644 index 0000000000..d4a471e02f --- /dev/null +++ b/packages/morphunits/src/get9.pas @@ -0,0 +1,66 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh + + get9.library interface unit for MorphOS/PowerPC + + Free Pascal MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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 get9; + +interface + +uses exec; + +var + Get9Base: Pointer; + +const + GET9NAME : PChar = 'get9.library'; + +procedure DNetCheck(force: boolean); +SysCall BaseSysV Get9Base 28; + +function InitGet9Library : boolean; + +implementation + +var + Get9_exit : Pointer; + +const + LIBVERSION=1; + +procedure CloseGet9Library; +begin + ExitProc := Get9_exit; + if Get9Base <> nil then begin + CloseLibrary(PLibrary(Get9Base)); + Get9Base := nil; + end; +end; + +function InitGet9Library : boolean; +begin + Get9Base := nil; + Get9Base := OpenLibrary(GET9NAME,LIBVERSION); + if Get9Base <> nil then begin + Get9_exit := ExitProc; + ExitProc := @CloseGet9Library; + InitGet9Library:=True; + end else begin + InitGet9Library:=False; + end; +end; + +begin +end. diff --git a/packages/morphunits/src/hardware.pas b/packages/morphunits/src/hardware.pas new file mode 100644 index 0000000000..67b9e80328 --- /dev/null +++ b/packages/morphunits/src/hardware.pas @@ -0,0 +1,582 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + Hardware definitions unit for MorphOS/PowerPC + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} + +{$PACKRECORDS 2} +unit hardware; + +interface + +uses exec; + + + +{ * adkcon bit defines + * Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved. + * } + +const + ADKB_SETCLR = 15; + ADKB_PRECOMP1 = 14; + ADKB_PRECOMP0 = 13; + ADKB_MFMPREC = 12; + ADKB_UARTBRK = 11; + ADKB_WORDSYNC = 10; + ADKB_MSBSYNC = 9; + ADKB_FAST = 8; + ADKB_USE3PN = 7; + ADKB_USE2P3 = 6; + ADKB_USE1P2 = 5; + ADKB_USE0P1 = 4; + ADKB_USE3VN = 3; + ADKB_USE2V3 = 2; + ADKB_USE1V2 = 1; + ADKB_USE0V1 = 0; + +const + ADKF_SETCLR = (1 Shl ADKB_SETCLR); + ADKF_PRECOMP1 = (1 Shl ADKB_PRECOMP1); + ADKF_PRECOMP0 = (1 Shl ADKB_PRECOMP0); + ADKF_MFMPREC = (1 Shl ADKB_MFMPREC); + ADKF_UARTBRK = (1 Shl ADKB_UARTBRK); + ADKF_WORDSYNC = (1 Shl ADKB_WORDSYNC); + ADKF_MSBSYNC = (1 Shl ADKB_MSBSYNC); + ADKF_FAST = (1 Shl ADKB_FAST); + ADKF_USE3PN = (1 Shl ADKB_USE3PN); + ADKF_USE2P3 = (1 Shl ADKB_USE2P3); + ADKF_USE1P2 = (1 Shl ADKB_USE1P2); + ADKF_USE0P1 = (1 Shl ADKB_USE0P1); + ADKF_USE3VN = (1 Shl ADKB_USE3VN); + ADKF_USE2V3 = (1 Shl ADKB_USE2V3); + ADKF_USE1V2 = (1 Shl ADKB_USE1V2); + ADKF_USE0V1 = (1 Shl ADKB_USE0V1); + +const + ADKF_PRE000NS = 0; + ADKF_PRE140NS = (ADKF_PRECOMP0); + ADKF_PRE280NS = (ADKF_PRECOMP1); + ADKF_PRE560NS = (ADKF_PRECOMP0 or ADKF_PRECOMP1); + + + +{ * blitter defines + * Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved. + * } + +const + HSIZEBITS = 6; + VSIZEBITS = (16 - HSIZEBITS); + HSIZEMASK = $3F; + VSIZEMASK = $3FF; + +{$IFNDEF NO_BIG_BLITS} + MINBYTESPERROW = 128; + MAXBYTESPERROW = 4096; +{$ELSE} + MAXBYTESPERROW = 128; +{$ENDIF} + +const + ABC = $80; + ABNC = $40; + ANBC = $20; + ANBNC = $10; + NABC = $8; + NABNC = $4; + NANBC = $2; + NANBNC = $1; + +const + A_OR_B = (ABC or ANBC or NABC or ABNC or ANBNC or NABNC); + A_OR_C = (ABC or NABC or ABNC or ANBC or NANBC or ANBNC); + A_XOR_C = (NABC or ABNC or NANBC or ANBNC); + A_TO_D = (ABC or ANBC or ABNC or ANBNC); + +const + BC0B_DEST = 8; + BC0B_SRCC = 9; + BC0B_SRCB = 10; + BC0B_SRCA = 11; + BC0F_DEST = (1 Shl BC0B_DEST); + BC0F_SRCC = (1 Shl BC0B_SRCC); + BC0F_SRCB = (1 Shl BC0B_SRCB); + BC0F_SRCA = (1 Shl BC0B_SRCA); + + BC1F_DESC = 2; + + DEST = BC0F_DEST; + SRCC = BC0F_SRCC; + SRCB = BC0F_SRCB; + SRCA = BC0F_SRCA; + + ASHIFTSHIFT = 12; + BSHIFTSHIFT = 12; + +const + LINEMODE = $1; + FILL_OR = $8; + FILL_XOR = $10; + FILL_CARRYIN = $4; + ONEDOT = $2; + OVFLAG = $20; + SIGNFLAG = $40; + BLITREVERSE = $2; + + SUD = $10; + SUL = $8; + AUL = $4; + + OCTANT8 = 24; + OCTANT7 = 4; + OCTANT6 = 12; + OCTANT5 = 28; + OCTANT4 = 20; + OCTANT3 = 8; + OCTANT2 = 0; + OCTANT1 = 16; + +type + Pbltnode = ^Tbltnode; + Tbltnode = record + n : Pbltnode; + _function: Pointer; + stat : Byte; + blitsize : SmallInt; + beamsync : SmallInt; + cleanup : Pointer; + end; + +const + CLEANUP = $40; + CLEANME = CLEANUP; + + + +{ * byteswap routines + * Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved. + * } +{$WARNING Byteswap macros not yet converted!} + + + +{ * cia registers and bits + * Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved. + * } + + +type + PCIA = ^TCIA; + TCIA = record + ciapra : Byte; + pad0 : Array[0..254] of Byte; + ciaprb : Byte; + pad1 : array[0..254] of Byte; + ciaddra : Byte; + pad2 : array[0..254] of Byte; + ciaddrb : Byte; + pad3 : array[0..254] of Byte; + ciatalo : Byte; + pad4 : array[0..254] of Byte; + ciatahi : Byte; + pad5 : array[0..254] of Byte; + ciatblo : Byte; + pad6 : array[0..254] of Byte; + ciatbhi : Byte; + pad7 : array[0..254] of Byte; + ciatodlow: Byte; + pad8 : array[0..254] of Byte; + ciatodmid: Byte; + pad9 : array[0..254] of Byte; + ciatodhi : Byte; + pad10 : array[0..254] of Byte; + unusedreg: Byte; + pad11 : array[0..254] of Byte; + ciasdr : Byte; + pad12 : array[0..254] of Byte; + ciaicr : Byte; + pad13 : array[0..254] of Byte; + ciacra : Byte; + pad14 : array[0..254] of Byte; + ciacrb : Byte; + end; + +const + CIAICRB_TA = 0; + CIAICRB_TB = 1; + CIAICRB_ALRM = 2; + CIAICRB_SP = 3; + CIAICRB_FLG = 4; + CIAICRB_IR = 7; + CIAICRB_SETCLR = 7; + + CIAICRF_TA = (1 Shl CIAICRB_TA); + CIAICRF_TB = (1 Shl CIAICRB_TB); + CIAICRF_ALRM = (1 Shl CIAICRB_ALRM); + CIAICRF_SP = (1 Shl CIAICRB_SP); + CIAICRF_FLG = (1 Shl CIAICRB_FLG); + CIAICRF_IR = (1 Shl CIAICRB_IR); + CIAICRF_SETCLR = (1 Shl CIAICRB_SETCLR); + +const + CIACRAB_START = 0; + CIACRAB_PBON = 1; + CIACRAB_OUTMODE = 2; + CIACRAB_RUNMODE = 3; + CIACRAB_LOAD = 4; + CIACRAB_INMODE = 5; + CIACRAB_SPMODE = 6; + CIACRAB_TODIN = 7; + + CIACRAF_START = (1 Shl CIACRAB_START); + CIACRAF_PBON = (1 Shl CIACRAB_PBON); + CIACRAF_OUTMODE = (1 Shl CIACRAB_OUTMODE); + CIACRAF_RUNMODE = (1 Shl CIACRAB_RUNMODE); + CIACRAF_LOAD = (1 Shl CIACRAB_LOAD); + CIACRAF_INMODE = (1 Shl CIACRAB_INMODE); + CIACRAF_SPMODE = (1 Shl CIACRAB_SPMODE); + CIACRAF_TODIN = (1 Shl CIACRAB_TODIN); + +const + CIACRBB_START = 0; + CIACRBB_PBON = 1; + CIACRBB_OUTMODE = 2; + CIACRBB_RUNMODE = 3; + CIACRBB_LOAD = 4; + CIACRBB_INMODE0 = 5; + CIACRBB_INMODE1 = 6; + CIACRBB_ALARM = 7; + + CIACRBF_START = (1 Shl CIACRBB_START); + CIACRBF_PBON = (1 Shl CIACRBB_PBON); + CIACRBF_OUTMODE = (1 Shl CIACRBB_OUTMODE); + CIACRBF_RUNMODE = (1 Shl CIACRBB_RUNMODE); + CIACRBF_LOAD = (1 Shl CIACRBB_LOAD); + CIACRBF_INMODE0 = (1 Shl CIACRBB_INMODE0); + CIACRBF_INMODE1 = (1 Shl CIACRBB_INMODE1); + CIACRBF_ALARM = (1 Shl CIACRBB_ALARM); + +const + CIACRBF_IN_PHI2 = 0; + CIACRBF_IN_CNT = (CIACRBF_INMODE0); + CIACRBF_IN_TA = (CIACRBF_INMODE1); + CIACRBF_IN_CNT_TA = (CIACRBF_INMODE0 or CIACRBF_INMODE1); + +const + CIAB_GAMEPORT1 = (7); + CIAB_GAMEPORT0 = (6); + CIAB_DSKRDY = (5); + CIAB_DSKTRACK0 = (4); + CIAB_DSKPROT = (3); + CIAB_DSKCHANGE = (2); + CIAB_LED = (1); + CIAB_OVERLAY = (0); + + CIAF_GAMEPORT1 = (1 Shl CIAB_GAMEPORT1); + CIAF_GAMEPORT0 = (1 Shl CIAB_GAMEPORT0); + CIAF_DSKRDY = (1 Shl CIAB_DSKRDY); + CIAF_DSKTRACK0 = (1 Shl CIAB_DSKTRACK0); + CIAF_DSKPROT = (1 Shl CIAB_DSKPROT); + CIAF_DSKCHANGE = (1 Shl CIAB_DSKCHANGE); + CIAF_LED = (1 Shl CIAB_LED); + CIAF_OVERLAY = (1 Shl CIAB_OVERLAY); + +const + CIAB_COMDTR = (7); + CIAB_COMRTS = (6); + CIAB_COMCD = (5); + CIAB_COMCTS = (4); + CIAB_COMDSR = (3); + CIAB_PRTRSEL = (2); + CIAB_PRTRPOUT = (1); + CIAB_PRTRBUSY = (0); + + CIAF_COMDTR = (1 Shl CIAB_COMDTR); + CIAF_COMRTS = (1 Shl CIAB_COMRTS); + CIAF_COMCD = (1 Shl CIAB_COMCD); + CIAF_COMCTS = (1 Shl CIAB_COMCTS); + CIAF_COMDSR = (1 Shl CIAB_COMDSR); + CIAF_PRTRSEL = (1 Shl CIAB_PRTRSEL); + CIAF_PRTRPOUT = (1 Shl CIAB_PRTRPOUT); + CIAF_PRTRBUSY = (1 Shl CIAB_PRTRBUSY); + +const + CIAB_DSKMOTOR = (7); + CIAB_DSKSEL3 = (6); + CIAB_DSKSEL2 = (5); + CIAB_DSKSEL1 = (4); + CIAB_DSKSEL0 = (3); + CIAB_DSKSIDE = (2); + CIAB_DSKDIREC = (1); + CIAB_DSKSTEP = (0); + + CIAF_DSKMOTOR = (1 Shl CIAB_DSKMOTOR); + CIAF_DSKSEL3 = (1 Shl CIAB_DSKSEL3); + CIAF_DSKSEL2 = (1 Shl CIAB_DSKSEL2); + CIAF_DSKSEL1 = (1 Shl CIAB_DSKSEL1); + CIAF_DSKSEL0 = (1 Shl CIAB_DSKSEL0); + CIAF_DSKSIDE = (1 Shl CIAB_DSKSIDE); + CIAF_DSKDIREC = (1 Shl CIAB_DSKDIREC); + CIAF_DSKSTEP = (1 Shl CIAB_DSKSTEP); + + + +{ * custom-chip registers and bits + * Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved. + * } + +type + PAudChannel = ^TAudChannel; + TAudChannel = record + ac_ptr: Pointer; + ac_len: Word; + ac_per: Word; + ac_vol: Word; + ac_dat: Word; + ac_pad: array[0..1] of Word; + end; + + PSpriteDef = ^TSpriteDef; + TSpriteDef = record + pos : Word; + ctl : Word; + dataa: Word; + datab: Word; + end; + + PCustom = ^TCustom; + TCustom = record + bltddat : Word; + dmaconr : Word; + vposr : Word; + vhposr : Word; + dskdatr : Word; + joy0dat : Word; + joy1dat : Word; + clxdat : Word; + adkconr : Word; + pot0dat : Word; + pot1dat : Word; + potinp : Word; + serdatr : Word; + dskbytr : Word; + intenar : Word; + intreqr : Word; + dskpt : Pointer; + dsklen : Word; + dskdat : Word; + refptr : Word; + vposw : Word; + vhposw : Word; + copcon : Word; + serdat : Word; + serper : Word; + potgo : Word; + joytest : Word; + strequ : Word; + strvbl : Word; + strhor : Word; + strlong : Word; + bltcon0 : Word; + bltcon1 : Word; + bltafwm : Word; + bltalwm : Word; + bltcpt : Pointer; + bltbpt : Pointer; + bltapt : Pointer; + bltdpt : Pointer; + bltsize : Word; + pad2d : Byte; + bltcon0l: Byte; + bltsizv : Word; + bltsizh : Word; + bltcmod : Word; + bltbmod : Word; + bltamod : Word; + bltdmod : Word; + pad34 : array[0..3] of Word; + bltcdat : Word; + bltbdat : Word; + bltadat : Word; + pad3b : array[0..2] of Word; + deniseid: Word; + dsksync : Word; + cop1lc : Longint; + cop2lc : Longint; + copjmp1 : Word; + copjmp2 : Word; + copins : Word; + diwstrt : Word; + diwstop : Word; + ddfstrt : Word; + ddfstop : Word; + dmacon : Word; + clxcon : Word; + intena : Word; + intreq : Word; + adkcon : Word; + aud : array[0..3] of TAudChannel; + bplpt : array[0..7] of Pointer; + bplcon0 : Word; + bplcon1 : Word; + bplcon2 : Word; + bplcon3 : Word; + bpl1mod : Word; + bpl2mod : Word; + bplcon4 : Word; + clxcon2 : Word; + bpldat : array[0..7] of Word; + sprpt : array[0..7] of Pointer; + spr : array[0..7] of TSpriteDef; + color : array[0..31] of Word; + htotal : Word; + hsstop : Word; + hbstrt : Word; + hbstop : Word; + vtotal : Word; + vsstop : Word; + vbstrt : Word; + vbstop : Word; + sprhstrt: Word; + sprhstop: Word; + bplhstrt: Word; + bplhstop: Word; + hhposw : Word; + hhposr : Word; + beamcon0: Word; + hsstrt : Word; + vsstrt : Word; + hcenter : Word; + diwhigh : Word; + padf3 : array[0..10] of Word; + fmode : Word; + end; + + +const + VARVBLANK = $1000; + LOLDIS = $0800; + CSCBLANKEN = $0400; + VARVSYNC = $0200; + VARHSYNC = $0100; + VARBEAM = $0080; + DISPLAYDUAL = $0040; + DISPLAYPAL = $0020; + VARCSYNC = $0010; + CSBLANK = $0008; + CSYNCTRUE = $0004; + VSYNCTRUE = $0002; + HSYNCTRUE = $0001; + + USE_BPLCON3 = 1; + + BPLCON2_ZDCTEN = (1 Shl 10); + BPLCON2_ZDBPEN = (1 Shl 11); + BPLCON2_ZDBPSEL0 = (1 Shl 12); + BPLCON2_ZDBPSEL1 = (1 Shl 13); + BPLCON2_ZDBPSEL2 = (1 Shl 14); + + BPLCON3_EXTBLNKEN = (1 Shl 0); + BPLCON3_EXTBLKZD = (1 Shl 1); + BPLCON3_ZDCLKEN = (1 Shl 2); + BPLCON3_BRDNTRAN = (1 Shl 4); + BPLCON3_BRDNBLNK = (1 Shl 5); + + + +{ * dma bits + * Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved. + * } + +const + DMAB_AUD0 = 0; + DMAB_AUD1 = 1; + DMAB_AUD2 = 2; + DMAB_AUD3 = 3; + DMAB_DISK = 4; + DMAB_SPRITE = 5; + DMAB_BLITTER = 6; + DMAB_COPPER = 7; + DMAB_RASTER = 8; + DMAB_MASTER = 9; + DMAB_BLITHOG = 10; + DMAB_BLTNZERO = 13; + DMAB_BLTDONE = 14; + DMAB_SETCLR = 15; + + DMAF_AUD0 = (1 Shl DMAB_AUD0); + DMAF_AUD1 = (1 Shl DMAB_AUD1); + DMAF_AUD2 = (1 Shl DMAB_AUD2); + DMAF_AUD3 = (1 Shl DMAB_AUD3); + DMAF_DISK = (1 Shl DMAB_DISK); + DMAF_SPRITE = (1 Shl DMAB_SPRITE); + DMAF_BLITTER = (1 Shl DMAB_BLITTER); + DMAF_COPPER = (1 Shl DMAB_COPPER); + DMAF_RASTER = (1 Shl DMAB_RASTER); + DMAF_MASTER = (1 Shl DMAB_MASTER); + DMAF_BLITHOG = (1 Shl DMAB_BLITHOG); + DMAF_BLTNZERO = (1 Shl DMAB_BLTNZERO); + DMAF_BLTDONE = (1 Shl DMAB_BLTDONE); + DMAF_SETCLR = (1 Shl DMAB_SETCLR); + +const + DMAF_AUDIO = (DMAF_AUD0 or DMAF_AUD1 or DMAF_AUD2 or DMAF_AUD3); + DMAF_ALL = (DMAF_AUD0 or DMAF_AUD1 or DMAF_AUD2 or DMAF_AUD3 or DMAF_DISK or DMAF_SPRITE or DMAF_BLITTER or DMAF_COPPER or DMAF_RASTER); + + + +{ * interrupt bits + * Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved. + * } + +const + INTB_SETCLR = (15); + INTB_INTEN = (14); + INTB_EXTER = (13); + INTB_DSKSYNC = (12); + INTB_RBF = (11); + INTB_AUD3 = (10); + INTB_AUD2 = (9); + INTB_AUD1 = (8); + INTB_AUD0 = (7); + INTB_BLIT = (6); + INTB_VERTB = (5); + INTB_COPER = (4); + INTB_PORTS = (3); + INTB_SOFTINT = (2); + INTB_DSKBLK = (1); + INTB_TBE = (0); + + INTF_SETCLR = (1 Shl INTB_SETCLR); + INTF_INTEN = (1 Shl INTB_INTEN); + INTF_EXTER = (1 Shl INTB_EXTER); + INTF_DSKSYNC = (1 Shl INTB_DSKSYNC); + INTF_RBF = (1 Shl INTB_RBF); + INTF_AUD3 = (1 Shl INTB_AUD3); + INTF_AUD2 = (1 Shl INTB_AUD2); + INTF_AUD1 = (1 Shl INTB_AUD1); + INTF_AUD0 = (1 Shl INTB_AUD0); + INTF_BLIT = (1 Shl INTB_BLIT); + INTF_VERTB = (1 Shl INTB_VERTB); + INTF_COPER = (1 Shl INTB_COPER); + INTF_PORTS = (1 Shl INTB_PORTS); + INTF_SOFTINT = (1 Shl INTB_SOFTINT); + INTF_DSKBLK = (1 Shl INTB_DSKBLK); + INTF_TBE = (1 Shl INTB_TBE); + +implementation + +end. diff --git a/packages/morphunits/src/iffparse.pas b/packages/morphunits/src/iffparse.pas new file mode 100644 index 0000000000..cc769fdddd --- /dev/null +++ b/packages/morphunits/src/iffparse.pas @@ -0,0 +1,319 @@ +{ + This file is part of the Free Pascal run time library. + + iffparse.library interface unit, MorphOS version + + Copyright (c) 1998-2003 by Nils Sjoholm + member of the Amiga RTL development team. + + MorphOS adaptation + Copyright (c) 2014 by Karoly Balogh + member of the Free Pascal development team + + 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. + + **********************************************************************} +{$PACKRECORDS 2} + +unit iffparse; + +INTERFACE + +uses exec, clipboard, utility; + + +const + + IFFPARSENAME : PChar = 'iffparse.library'; + +{ + * Struct associated with an active IFF stream. + * "iff_Stream" is a value used by the client's read/write/seek functions - + * it will not be accessed by the library itself and can have any value + * (could even be a pointer or a BPTR). + } +Type + pIFFHandle = ^tIFFHandle; + tIFFHandle = record + iff_Stream, + iff_Flags : DWord; + iff_Depth : LONGINT; { Depth of context stack. } + { There are private fields hiding here. } + END; + +{ + * Bit masks for "iff_Flags" field. + } +CONST + IFFF_READ = 0; { read mode - default } + IFFF_WRITE = 1; { write mode } + IFFF_RWBITS = (IFFF_READ + IFFF_WRITE); { read/write bits } + IFFF_FSEEK = 2; { forward seek only } + IFFF_RSEEK = 4; { random seek } + IFFF_RESERVED = $FFFF0000; { Don't touch these bits. } + +{ + * When the library calls your stream handler, you'll be passed a pointer + * to this structure as the "message packet". + } +Type + pIFFStreamCmd = ^tIFFStreamCmd; + tIFFStreamCmd = record + sc_Command : Longint; { Operation to be performed (IFFCMD_) } + sc_Buf : Pointer; { Pointer to data buffer } + sc_NBytes : Longint; { Number of bytes to be affected } + END; +{ + * A node associated with a context on the iff_Stack. Each node + * represents a chunk, the stack representing the current nesting + * of chunks in the open IFF file. Each context node has associated + * local context items in the (private) LocalItems list. The ID, type, + * size and scan values describe the chunk associated with this node. + } + pContextNode = ^tContextNode; + tContextNode = record + cn_Node : tMinNode; + cn_ID, + cn_Type, + cn_Size, { Size of this chunk } + cn_Scan : Longint; { # of bytes read/written so far } + { There are private fields hiding here. } + END; + +{ + * Local context items live in the ContextNode's. Each class is identified + * by its lci_Ident code and has a (private) purge vector for when the + * parent context node is popped. + } + pLocalContextItem = ^tLocalContextItem; + tLocalContextItem = record + lci_Node : tMinNode; + lci_ID, + lci_Type, + lci_Ident : DWord; + { There are private fields hiding here. } + END; + +{ + * StoredProperty: a local context item containing the data stored + * from a previously encountered property chunk. + } + pStoredProperty = ^tStoredProperty; + tStoredProperty = Record + sp_Size : Longint; + sp_Data : Pointer; + END; + +{ + * Collection Item: the actual node in the collection list at which + * client will look. The next pointers cross context boundaries so + * that the complete list is accessable. + } + pCollectionItem = ^tCollectionItem; + tCollectionItem = record + ci_Next : pCollectionItem; + ci_Size : Longint; + ci_Data : Pointer; + END; + +{ + * Structure returned by OpenClipboard(). You may do CMD_POSTs and such + * using this structure. However, once you call OpenIFF(), you may not + * do any more of your own I/O to the clipboard until you call CloseIFF(). + } + pClipboardHandle = ^tClipBoardHandle; + tClipboardHandle = record + cbh_Req : tIOClipReq; + cbh_CBport, + cbh_SatisfyPort : tMsgPort; + END; + +{ + * IFF return codes. Most functions return either zero for success or + * one of these codes. The exceptions are the read/write functions which + * return positive values for number of bytes or records read or written, + * or a negative error code. Some of these codes are not errors per sae, + * but valid conditions such as EOF or EOC (End of Chunk). + } +CONST + IFFERR_EOF = -1 ; { Reached logical END of file } + IFFERR_EOC = -2 ; { About to leave context } + IFFERR_NOSCOPE = -3 ; { No valid scope for property } + IFFERR_NOMEM = -4 ; { Internal memory alloc failed} + IFFERR_READ = -5 ; { Stream read error } + IFFERR_WRITE = -6 ; { Stream write error } + IFFERR_SEEK = -7 ; { Stream seek error } + IFFERR_MANGLED = -8 ; { Data in file is corrupt } + IFFERR_SYNTAX = -9 ; { IFF syntax error } + IFFERR_NOTIFF = -10; { Not an IFF file } + IFFERR_NOHOOK = -11; { No call-back hook provided } + IFF_RETURN2CLIENT = -12; { Client handler normal return} + +{ + MAKE_ID(a,b,c,d) \ + ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d)) + } +{ + * Universal IFF identifiers. + } + ID_FORM = 1179603533; + ID_LIST = 1279873876; + ID_CAT = 1128354848; + ID_PROP = 1347571536; + ID_NULL = 538976288; + +{ + * Ident codes for universally recognized local context items. + } + IFFLCI_PROP = 1886547824; + IFFLCI_COLLECTION = 1668246636; + IFFLCI_ENTRYHANDLER = 1701734500; + IFFLCI_EXITHANDLER = 1702389860; + + +{ + * Control modes for ParseIFF() function. + } + IFFPARSE_SCAN = 0; + IFFPARSE_STEP = 1; + IFFPARSE_RAWSTEP = 2; + +{ + * Control modes for StoreLocalItem(). + } + IFFSLI_ROOT = 1; { Store in default context } + IFFSLI_TOP = 2; { Store in current context } + IFFSLI_PROP = 3; { Store in topmost FORM OR LIST } + +{ + * "Flag" for writing functions. If you pass this value in as a size + * to PushChunk() when writing a file, the parser will figure out the + * size of the chunk for you. (Chunk sizes >= 2**31 are forbidden by the + * IFF specification, so this works.) + } + IFFSIZE_UNKNOWN = -1; + +{ + * Possible call-back command values. (Using 0 as the value for IFFCMD_INIT + * was, in retrospect, probably a bad idea.) + } + IFFCMD_INIT = 0; { Prepare the stream for a session } + IFFCMD_CLEANUP = 1; { Terminate stream session } + IFFCMD_READ = 2; { Read bytes from stream } + IFFCMD_WRITE = 3; { Write bytes to stream } + IFFCMD_SEEK = 4; { Seek on stream } + IFFCMD_ENTRY = 5; { You just entered a new context } + IFFCMD_EXIT = 6; { You're about to leave a context } + IFFCMD_PURGELCI= 7; { Purge a LocalContextItem } + +{ Backward compatibility. Don't use these in new code. } + IFFSCC_INIT = IFFCMD_INIT; + IFFSCC_CLEANUP = IFFCMD_CLEANUP; + IFFSCC_READ = IFFCMD_READ; + IFFSCC_WRITE = IFFCMD_WRITE; + IFFSCC_SEEK = IFFCMD_SEEK; + +{ Seek modes for SeekChunkBytes and SeekChunkRecords } + IFFOFFSET_BEGINNING = 0; + IFFOFFSET_END = 1; + IFFOFFSET_CURRENT = 2; + +VAR IFFParseBase : pLibrary; + +FUNCTION AllocIFF : pIFFHandle; syscall IFFParseBase 030; +FUNCTION AllocLocalItem(typ : LONGINT location 'd0'; id : LONGINT location 'd1'; ident : LONGINT location 'd2'; dataSize : LONGINT location 'd3') : pLocalContextItem; syscall IFFParseBase 186; +PROCEDURE CloseClipboard(clipHandle : pClipboardHandle location 'a0'); syscall IFFParseBase 252; +PROCEDURE CloseIFF(iff : pIFFHandle location 'a0'); syscall IFFParseBase 048; +FUNCTION CollectionChunk(iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 138; +FUNCTION CollectionChunks(iff : pIFFHandle location 'a0'; const propArray : pLONGINT location 'a1'; numPairs : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 144; +FUNCTION CurrentChunk(const iff : pIFFHandle location 'a0') : pContextNode; syscall IFFParseBase 174; +FUNCTION EntryHandler(iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1'; position : LONGINT location 'd2'; handler : pHook location 'a1'; obj : POINTER location 'a2') : LONGINT; syscall IFFParseBase 102; +FUNCTION ExitHandler(iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1'; position : LONGINT location 'd2'; handler : pHook location 'a1'; obj : POINTER location 'a2') : LONGINT; syscall IFFParseBase 108; +FUNCTION FindCollection(const iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1') : pCollectionItem; syscall IFFParseBase 162; +FUNCTION FindLocalItem(const iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1'; ident : LONGINT location 'd2') : pLocalContextItem; syscall IFFParseBase 210; +FUNCTION FindProp(const iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1') : pStoredProperty; syscall IFFParseBase 156; +FUNCTION FindPropContext(const iff : pIFFHandle location 'a0') : pContextNode; syscall IFFParseBase 168; +PROCEDURE FreeIFF(iff : pIFFHandle location 'a0'); syscall IFFParseBase 054; +PROCEDURE FreeLocalItem(localItem : pLocalContextItem location 'a0'); syscall IFFParseBase 204; +FUNCTION GoodID(id : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 258; +FUNCTION GoodType(typ : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 264; +FUNCTION IDtoStr(id : LONGINT location 'd0'; buf : pCHAR location 'a0') : pCHAR; syscall IFFParseBase 270; +PROCEDURE InitIFF(iff : pIFFHandle location 'a0'; flags : LONGINT location 'd0'; const streamHook : pHook location 'a1'); syscall IFFParseBase 228; +PROCEDURE InitIFFasClip(iff : pIFFHandle location 'a0'); syscall IFFParseBase 240; +PROCEDURE InitIFFasDOS(iff : pIFFHandle location 'a0'); syscall IFFParseBase 234; +FUNCTION LocalItemData(const localItem : pLocalContextItem location 'a0') : POINTER; syscall IFFParseBase 192; +FUNCTION OpenClipboard(unitNumber : LONGINT location 'd0') : pClipboardHandle; syscall IFFParseBase 246; +FUNCTION OpenIFF(iff : pIFFHandle location 'a0'; rwMode : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 036; +FUNCTION ParentChunk(const contextNode : pContextNode location 'a0') : pContextNode; syscall IFFParseBase 180; +FUNCTION ParseIFF(iff : pIFFHandle location 'a0'; control : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 042; +FUNCTION PopChunk(iff : pIFFHandle location 'a0') : LONGINT; syscall IFFParseBase 090; +FUNCTION PropChunk(iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 114; +FUNCTION PropChunks(iff : pIFFHandle location 'a0'; const propArray : pLONGINT location 'a1'; numPairs : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 120; +FUNCTION PushChunk(iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1'; size : LONGINT location 'd2') : LONGINT; syscall IFFParseBase 084; +FUNCTION ReadChunkBytes(iff : pIFFHandle location 'a0'; buf : POINTER location 'a1'; numBytes : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 060; +FUNCTION ReadChunkRecords(iff : pIFFHandle location 'a0'; buf : POINTER location 'a1'; bytesPerRecord : LONGINT location 'd0'; numRecords : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 072; +PROCEDURE SetLocalItemPurge(localItem : pLocalContextItem location 'a0'; const purgeHook : pHook location 'a1'); syscall IFFParseBase 198; +FUNCTION StopChunk(iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 126; +FUNCTION StopChunks(iff : pIFFHandle location 'a0'; const propArray : pLONGINT location 'a1'; numPairs : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 132; +FUNCTION StopOnExit(iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 150; +PROCEDURE StoreItemInContext(iff : pIFFHandle location 'a0'; localItem : pLocalContextItem location 'a1'; contextNode : pContextNode location 'a2'); syscall IFFParseBase 222; +FUNCTION StoreLocalItem(iff : pIFFHandle location 'a0'; localItem : pLocalContextItem location 'a1'; position : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 216; +FUNCTION WriteChunkBytes(iff : pIFFHandle location 'a0'; const buf : POINTER location 'a1'; numBytes : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 066; +FUNCTION WriteChunkRecords(iff : pIFFHandle location 'a0'; const buf : POINTER location 'a1'; bytesPerRecord : LONGINT location 'd0'; numRecords : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 078; + +{ MorphOS specific } +FUNCTION SeekChunkBytes(iff : pIFFHandle location 'a0'; numBytes : LONGINT location 'd0'; mode : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 276; +FUNCTION SeekChunkRecords(iff : pIFFHandle location 'a0'; bytesPerRecord : LONGINT location 'd0'; numRecords : LONGINT location 'd1'; mode : LONGINT location 'd2') : LONGINT; syscall IFFParseBase 282; + +Function Make_ID(str : String) : LONGINT; +function InitIFFPARSELibrary: boolean; + + +IMPLEMENTATION + + +function Make_ID(str : String) : LONGINT; +begin + Make_ID := (LONGINT(Ord(Str[1])) shl 24) or + (LONGINT(Ord(Str[2])) shl 16 ) or + (LONGINT(Ord(Str[3])) shl 8 ) or + (LONGINT(Ord(Str[4]))); +end; + +const + { Change VERSION and LIBVERSION to proper values } + + VERSION : string[2] = '0'; + LIBVERSION : longword = 0; + +var + iffparse_exit : Pointer; + +procedure CloseIFFParseLibrary; +begin + ExitProc := iffparse_exit; + if IFFParseBase <> nil then begin + CloseLibrary(IFFParseBase); + IFFParseBase := nil; + end; +end; + +function InitIFFParseLibrary: boolean; +begin + IFFParseBase := nil; + IFFParseBase := OpenLibrary(IFFPARSENAME,LIBVERSION); + if IFFParseBase <> nil then begin + iffparse_exit := ExitProc; + ExitProc := @CloseIFFParseLibrary; + InitIFFParseLibrary := true; + end else begin + InitIFFParseLibrary := false; + end; +end; + +END. (* UNIT IFFPARSE *) diff --git a/packages/morphunits/src/inputevent.pas b/packages/morphunits/src/inputevent.pas new file mode 100644 index 0000000000..f908fd0717 --- /dev/null +++ b/packages/morphunits/src/inputevent.pas @@ -0,0 +1,212 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + input.device event definitions unit for MorphOS/PowerPC + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} + +{$PACKRECORDS 2} +unit inputevent; + +interface + +uses exec, utility, timer; + + +{ * input.device event definitions + * Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved. + * } + +const + IECLASS_NULL = $00; + IECLASS_RAWKEY = $01; + IECLASS_RAWMOUSE = $02; + IECLASS_EVENT = $03; + IECLASS_POINTERPOS = $04; + IECLASS_TIMER = $06; + IECLASS_GADGETDOWN = $07; + IECLASS_GADGETUP = $08; + IECLASS_REQUESTER = $09; + IECLASS_MENULIST = $0A; + IECLASS_CLOSEWINDOW = $0B; + IECLASS_SIZEWINDOW = $0C; + IECLASS_REFRESHWINDOW = $0D; + IECLASS_NEWPREFS = $0E; + IECLASS_DISKREMOVED = $0F; + IECLASS_DISKINSERTED = $10; + IECLASS_ACTIVEWINDOW = $11; + IECLASS_INACTIVEWINDOW = $12; + IECLASS_NEWPOINTERPOS = $13; + IECLASS_MENUHELP = $14; + IECLASS_CHANGEWINDOW = $15; + +{$ifndef IECLASS_NEWMOUSE} + const + IECLASS_NEWMOUSE = $16; +{$endif} + + +const + IECLASS_MAX = $16; + IESUBCLASS_COMPATIBLE = $00; + IESUBCLASS_PIXEL = $01; + IESUBCLASS_TABLET = $02; + IESUBCLASS_NEWTABLET = $03; + +type + PIEPointerPixel = ^TIEPointerPixel; + TIEPointerPixel = record + iepp_Screen : Pointer; + iepp_Position : record + X : Integer; + Y : Integer; + end; + end; + + PIEPointerTablet = ^TIEPointerTablet; + TIEPointerTablet = record + iept_Range : record + X : Word; + Y : Word; + end; + iept_Value : record + X : Word; + Y : Word; + end; + iept_Pressure : Integer; + end; + + PIENewTablet = ^TIENewTablet; + TIENewTablet = record + ient_CallBack : PHook; + ient_ScaledX : Word; + ient_ScaledY : Word; + ient_ScaledXFraction : Word; + ient_ScaledYFraction : Word; + ient_TabletX : DWord; + ient_TabletY : DWord; + ient_RangeX : DWord; + ient_RangeY : DWord; + ient_TagList : PTagItem; + end; + + +const + IECODE_UP_PREFIX = $80; + IECODE_KEY_CODE_FIRST = $00; + IECODE_KEY_CODE_LAST = $77; + IECODE_COMM_CODE_FIRST = $78; + IECODE_COMM_CODE_LAST = $7F; + IECODE_C0_FIRST = $00; + IECODE_C0_LAST = $1F; + IECODE_ASCII_FIRST = $20; + IECODE_ASCII_LAST = $7E; + IECODE_ASCII_DEL = $7F; + IECODE_C1_FIRST = $80; + IECODE_C1_LAST = $9F; + IECODE_LATIN1_FIRST = $A0; + IECODE_LATIN1_LAST = $FF; + IECODE_LBUTTON = $68; + IECODE_RBUTTON = $69; + IECODE_MBUTTON = $6A; + IECODE_NOBUTTON = $FF; + IECODE_NEWACTIVE = $01; + IECODE_NEWSIZE = $02; + IECODE_REFRESH = $03; + IECODE_REQSET = $01; + IECODE_REQCLEAR = $00; + IEQUALIFIER_LSHIFT = $0001; + IEQUALIFIER_RSHIFT = $0002; + IEQUALIFIER_CAPSLOCK = $0004; + IEQUALIFIER_CONTROL = $0008; + IEQUALIFIER_LALT = $0010; + IEQUALIFIER_RALT = $0020; + IEQUALIFIER_LCOMMAND = $0040; + IEQUALIFIER_RCOMMAND = $0080; + IEQUALIFIER_NUMERICPAD = $0100; + IEQUALIFIER_REPEAT = $0200; + IEQUALIFIER_INTERRUPT = $0400; + IEQUALIFIER_MULTIBROADCAST = $0800; + IEQUALIFIER_MIDBUTTON = $1000; + IEQUALIFIER_RBUTTON = $2000; + IEQUALIFIER_LEFTBUTTON = $4000; + IEQUALIFIER_RELATIVEMOUSE = $8000; + IEQUALIFIERB_LSHIFT = 0; + IEQUALIFIERB_RSHIFT = 1; + IEQUALIFIERB_CAPSLOCK = 2; + IEQUALIFIERB_CONTROL = 3; + IEQUALIFIERB_LALT = 4; + IEQUALIFIERB_RALT = 5; + IEQUALIFIERB_LCOMMAND = 6; + IEQUALIFIERB_RCOMMAND = 7; + IEQUALIFIERB_NUMERICPAD = 8; + IEQUALIFIERB_REPEAT = 9; + IEQUALIFIERB_INTERRUPT = 10; + IEQUALIFIERB_MULTIBROADCAST = 11; + IEQUALIFIERB_MIDBUTTON = 12; + IEQUALIFIERB_RBUTTON = 13; + IEQUALIFIERB_LEFTBUTTON = 14; + IEQUALIFIERB_RELATIVEMOUSE = 15; + +{ * NewMouse events. } +{$ifndef NM_WHEEL_UP} + const + NM_WHEEL_UP = $7a; +{$endif} +{$ifndef NM_WHEEL_DOWN} + const + NM_WHEEL_DOWN = $7b; +{$endif} +{$ifndef NM_WHEEL_LEFT} + const + NM_WHEEL_LEFT = $7c; +{$endif} +{$ifndef NM_WHEEL_RIGHT} + const + NM_WHEEL_RIGHT = $7d; +{$endif} +{$ifndef NM_BUTTON_FOURTH} + const + NM_BUTTON_FOURTH = $7e; +{$endif} + +type + PInputEvent = ^TInputEvent; + TInputEvent = record + ie_NextEvent : PInputEvent; + ie_Class : Byte; + ie_SubClass : Byte; + ie_Code : Word; + ie_Qualifier : Word; + ie_position : record + case longint of + 0 : ( ie_xy : record + ie_x : Integer; + ie_y : Integer; + end ); + 1 : ( ie_addr : Pointer ); + 2 : ( ie_dead : record + ie_prev1DownCode : Byte; + ie_prev1DownQual : Byte; + ie_prev2DownCode : Byte; + ie_prev2DownQual : Byte; + end ); + end; + ie_TimeStamp : TTimeval; + end; + + +implementation + +end. diff --git a/packages/morphunits/src/intuition.pas b/packages/morphunits/src/intuition.pas new file mode 100644 index 0000000000..e6e4491935 --- /dev/null +++ b/packages/morphunits/src/intuition.pas @@ -0,0 +1,4697 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + intuition.library interface unit for MorphOS/PowerPC + + Based on work of Nils Sjoholm member of the Amiga RTL + development team. + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} +{$PACKRECORDS 2} + +unit intuition; + +interface + +uses + exec, agraphics, utility, inputevent, timer, layers; + + +{ + * NOTE: intuition/iobsolete.h is included at the END of this file! + } + +{ ======================================================================== } +{ === IntuiText ========================================================== } +{ ================================= ======================================= } +{ IntuiText is a series of strings that start with a screen location + * (always relative to the upper-left corner of something) and then the + * text of the string. The text is null-terminated. + } +Type + pIntuiText = ^tIntuiText; + tIntuiText = record + FrontPen, + BackPen : Byte; { the pen numbers for the rendering } + DrawMode : Byte; { the mode for rendering the text } + LeftEdge : smallint; { relative start location for the text } + TopEdge : smallint; { relative start location for the text } + ITextFont : pTextAttr; { if NULL, you accept the default } + IText : PChar; { pointer to null-terminated text } + NextText : pIntuiText; { continuation to TxWrite another text } + end; + + + +{ ======================================================================== } +{ === Border ============================================================= } +{ ======================================================================== } +{ Data type Border, used for drawing a series of lines which is intended for + * use as a border drawing, but which may, in fact, be used to render any + * arbitrary vector shape. + * The routine DrawBorder sets up the RastPort with the appropriate + * variables, then does a Move to the first coordinate, then does Draws + * to the subsequent coordinates. + * After all the Draws are done, if NextBorder is non-zero we call DrawBorder + * recursively + } +Type + pBorder = ^tBorder; + tBorder = record + LeftEdge, + TopEdge : smallint; { initial offsets from the origin } + FrontPen, + BackPen : Byte; { pens numbers for rendering } + DrawMode : Byte; { mode for rendering } + Count : Shortint; { number of XY pairs } + XY : Pointer; { vector coordinate pairs rel to LeftTop} + NextBorder : pBorder; { pointer to any other Border too } + end; + +{ ======================================================================== } +{ === MenuItem =========================================================== } +{ ======================================================================== } + +Type + + pMenuItem = ^tMenuItem; + tMenuItem = record + NextItem : pMenuItem; { pointer to next in chained list } + LeftEdge, + TopEdge : smallint; { position of the select box } + Width, + Height : smallint; { dimensions of the select box } + Flags : Word; { see the defines below } + + MutualExclude : Longint; { set bits mean this item excludes that } + + ItemFill : Pointer; { points to Image, IntuiText, or NULL } + + { when this item is pointed to by the cursor and the items highlight + * mode HIGHIMAGE is selected, this alternate image will be displayed + } + + SelectFill : Pointer; { points to Image, IntuiText, or NULL } + + Command : Char; { only if appliprog sets the COMMSEQ flag } + + SubItem : pMenuItem; { if non-zero, DrawMenu shows "->" } + + { The NextSelect field represents the menu number of next selected + * item (when user has drag-selected several items) + } + + NextSelect : Word; + end; + + +Const + +{ FLAGS SET BY THE APPLIPROG } + CHECKIT = $0001; { whether to check this item if selected } + ITEMTEXT = $0002; { set if textual, clear if graphical item } + COMMSEQ = $0004; { set if there's an command sequence } + MENUTOGGLE = $0008; { set to toggle the check of a menu item } + ITEMENABLED = $0010; { set if this item is enabled } + +{ these are the SPECIAL HIGHLIGHT FLAG state meanings } + HIGHFLAGS = $00C0; { see definitions below for these bits } + HIGHIMAGE = $0000; { use the user's "select image" } + HIGHCOMP = $0040; { highlight by complementing the selectbox } + HIGHBOX = $0080; { highlight by "boxing" the selectbox } + HIGHNONE = $00C0; { don't highlight } + +{ FLAGS SET BY BOTH APPLIPROG AND INTUITION } + CHECKED = $0100; { if CHECKIT, then set this when selected } + +{ FLAGS SET BY INTUITION } + ISDRAWN = $1000; { this item's subs are currently drawn } + HIGHITEM = $2000; { this item is currently highlighted } + MENUTOGGLED = $4000; { this item was already toggled } + + +{ ======================================================================== } +{ === Menu =============================================================== } +{ ======================================================================== } +Type + + pMenu = ^tMenu; + tMenu = record + NextMenu : pMenu; { same level } + LeftEdge, + TopEdge : smallint; { position of the select box } + Width, + Height : smallint; { dimensions of the select box } + Flags : Word; { see flag definitions below } + MenuName : PChar; { text for this Menu Header } + FirstItem : pMenuItem; { pointer to first in chain } + + { these mysteriously-named variables are for internal use only } + + JazzX, + JazzY, + BeatX, + BeatY : smallint; + end; + +CONST +{ FLAGS SET BY BOTH THE APPLIPROG AND INTUITION } + MENUENABLED = $0001; { whether or not this menu is enabled } + +{ FLAGS SET BY INTUITION } + MIDRAWN = $0100; { this menu's items are currently drawn } + + + + +{ ======================================================================== } +{ === Gadget ============================================================= } +{ ======================================================================== } + +Type + + pGadget = ^tGadget; + tGadget = record + NextGadget : pGadget; { next gadget in the list } + + LeftEdge, + TopEdge : smallint; { "hit box" of gadget } + Width, + Height : smallint; { "hit box" of gadget } + + Flags : Word; { see below for list of defines } + + Activation : Word; { see below for list of defines } + + GadgetType : Word; { see below for defines } + + { appliprog can specify that the Gadget be rendered as either as Border + * or an Image. This variable points to which (or equals NULL if there's + * nothing to be rendered about this Gadget) + } + + GadgetRender : Pointer; + + { appliprog can specify "highlighted" imagery rather than algorithmic + * this can point to either Border or Image data + } + + SelectRender : Pointer; + + GadgetText : pIntuiText; { text for this gadget } + + { by using the MutualExclude word, the appliprog can describe + * which gadgets mutually-exclude which other ones. The bits + * in MutualExclude correspond to the gadgets in object containing + * the gadget list. If this gadget is selected and a bit is set + * in this gadget's MutualExclude and the gadget corresponding to + * that bit is currently selected (e.g. bit 2 set and gadget 2 + * is currently selected) that gadget must be unselected. + * Intuition does the visual unselecting (with checkmarks) and + * leaves it up to the program to unselect internally + } + + MutualExclude : Longint; { set bits mean this gadget excludes that gadget } + + { pointer to a structure of special data required by Proportional, + * String and Longint Gadgets + } + + SpecialInfo : Pointer; + + GadgetID : Word; { user-definable ID field } + UserData : Pointer; { ptr to general purpose User data (ignored by In) } + end; + + pExtGadget = ^tExtGadget; + tExtGadget = record + { The first fields match struct Gadget exactly } + NextGadget : pExtGadget; { Matches struct Gadget } + LeftEdge, TopEdge, { Matches struct Gadget } + Width, Height : smallint; { Matches struct Gadget } + Flags, { Matches struct Gadget } + Activation, { Matches struct Gadget } + GadgetType : WORD; { Matches struct Gadget } + GadgetRender, { Matches struct Gadget } + SelectRender : Pointer; { Matches struct Gadget } + GadgetText : pIntuiText; { Matches struct Gadget } + MutualExclude : Longint; { Matches struct Gadget } + SpecialInfo : Pointer; { Matches struct Gadget } + GadgetID : WORD; { Matches struct Gadget } + UserData : Pointer; { Matches struct Gadget } + + { These fields only exist under V39 and only if GFLG_EXTENDED is set } + MoreFlags : Cardinal; { see GMORE_ flags below } + BoundsLeftEdge, { Bounding extent for gadget, valid } + BoundsTopEdge, { only if GMORE_BOUNDS is set. The } + BoundsWidth, { GFLG_RELxxx flags affect these } + BoundsHeight : smallint; { coordinates as well. } + end; + + +CONST +{ --- Gadget.Flags values --- } +{ combinations in these bits describe the highlight technique to be used } + GFLG_GADGHIGHBITS = $0003; + GFLG_GADGHCOMP = $0000; { Complement the select box } + GFLG_GADGHBOX = $0001; { Draw a box around the image } + GFLG_GADGHIMAGE = $0002; { Blast in this alternate image } + GFLG_GADGHNONE = $0003; { don't highlight } + + GFLG_GADGIMAGE = $0004; { set IF GadgetRender AND SelectRender + * point to an Image structure, clear + * if they point to Border structures + } + +{ combinations in these next two bits specify to which corner the gadget's + * Left & Top coordinates are relative. If relative to Top/Left, + * these are "normal" coordinates (everything is relative to something in + * this universe). + * + * Gadget positions and dimensions are relative to the window or + * requester which contains the gadget + } + GFLG_RELBOTTOM = $0008; { vert. pos. is relative to bottom edge } + GFLG_RELRIGHT = $0010; { horiz. pos. is relative to right edge } + GFLG_RELWIDTH = $0020; { width is relative to req/window } + GFLG_RELHEIGHT = $0040; { height is relative to req/window } + +{ New for V39: GFLG_RELSPECIAL allows custom gadget implementors to + * make gadgets whose position and size depend in an arbitrary way + * on their window's dimensions. The GM_LAYOUT method will be invoked + * for such a gadget (or any other GREL_xxx gadget) at suitable times, + * such as when the window opens or the window's size changes. + } + GFLG_RELSPECIAL = $4000; { custom gadget has special relativity. + * Gadget box values are absolutes, but + * can be changed via the GM_LAYOUT method. + } + + GFLG_SELECTED = $0080; { you may initialize AND look at this } + +{ the GFLG_DISABLED flag is initialized by you and later set by Intuition + * according to your calls to On/OffGadget(). It specifies whether or not + * this Gadget is currently disabled from being selected + } + GFLG_DISABLED = $0100; + +{ These flags specify the type of text field that Gadget.GadgetText + * points to. In all normal (pre-V36) gadgets which you initialize + * this field should always be zero. Some types of gadget objects + * created from classes will use these fields to keep track of + * types of labels/contents that different from IntuiText, but are + * stashed in GadgetText. + } + + GFLG_LABELMASK = $3000; + GFLG_LABELITEXT = $0000; { GadgetText points to IntuiText } + GFLG_LABELSTRING = $1000; { GadgetText points to (UBYTE *) } + GFLG_LABELIMAGE = $2000; { GadgetText points to Image (object) } + +{ New for V37: GFLG_TABCYCLE } + GFLG_TABCYCLE = $0200; { (string OR custom) gadget participates in + * cycling activation with Tab or Shift-Tab + } +{ New for V37: GFLG_STRINGEXTEND. We discovered that V34 doesn't properly + * ignore the value we had chosen for the Gadget->Activation flag + * GACT_STRINGEXTEND. NEVER SET THAT FLAG WHEN RUNNING UNDER V34. + * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is + * safe under V34, and equivalent to GACT_STRINGEXTEND under V37. + * (Note that the two flags are not numerically equal) + } + GFLG_STRINGEXTEND = $0400; { this String Gadget has StringExtend } + +{ New for V39: GFLG_IMAGEDISABLE. This flag is automatically set if + * the custom image of this gadget knows how to do disabled rendering + * (more specifically, if its IA_SupportsDisable attribute is TRUE). + * Intuition uses this to defer the ghosting to the image-class, + * instead of doing it itself (the old compatible way). + * Do not set this flag yourself - Intuition will do it for you. + } + + GFLG_IMAGEDISABLE = $0800; { Gadget's image knows how to do disabled + * rendering + } + +{ New for V39: If set, this bit means that the Gadget is actually + * a struct ExtGadget, with new fields and flags. All V39 boopsi + * gadgets are ExtGadgets. Never ever attempt to read the extended + * fields of a gadget if this flag is not set. + } + GFLG_EXTENDED = $8000; { Gadget is extended } + +{ --- Gadget.Activation flag values --- } +{ Set GACT_RELVERIFY if you want to verify that the pointer was still over + * the gadget when the select button was released. Will cause + * an IDCMP_GADGETUP message to be sent if so. + } + GACT_RELVERIFY = $0001; + +{ the flag GACT_IMMEDIATE, when set, informs the caller that the gadget + * was activated when it was activated. This flag works in conjunction with + * the GACT_RELVERIFY flag + } + GACT_IMMEDIATE = $0002; + +{ the flag GACT_ENDGADGET, when set, tells the system that this gadget, + * when selected, causes the Requester to be ended. Requesters + * that are ended are erased and unlinked from the system. + } + GACT_ENDGADGET = $0004; + +{ the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive + * reports on mouse movements while this gadget is active. + * You probably want to set the GACT_IMMEDIATE flag when using + * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of + * learning why Intuition is suddenly sending you a stream of mouse + * movement events. If you don't set GACT_RELVERIFY, you'll get at + * least one Mouse Position event. + } + GACT_FOLLOWMOUSE = $0008; + +{ if any of the BORDER flags are set in a Gadget that's included in the + * Gadget list when a Window is opened, the corresponding Border will + * be adjusted to make room for the Gadget + } + GACT_RIGHTBORDER = $0010; + GACT_LEFTBORDER = $0020; + GACT_TOPBORDER = $0040; + GACT_BOTTOMBORDER= $0080; + GACT_BORDERSNIFF = $8000; { neither set nor rely on this bit } + + GACT_TOGGLESELECT= $0100; { this bit for toggle-select mode } + GACT_BOOLEXTEND = $2000; { this Boolean Gadget has a BoolInfo } + +{ should properly be in StringInfo, but aren't } + GACT_STRINGLEFT = $0000; { NOTE WELL: that this has value zero } + GACT_STRINGCENTER= $0200; + GACT_STRINGRIGHT = $0400; + GACT_LONGINT = $0800; { this String Gadget is for Long Ints } + GACT_ALTKEYMAP = $1000; { this String has an alternate keymap } + GACT_STRINGEXTEND= $2000; { this String Gadget has StringExtend } + { NOTE: NEVER SET GACT_STRINGEXTEND IF YOU + * ARE RUNNING ON LESS THAN V36! SEE + * GFLG_STRINGEXTEND (ABOVE) INSTEAD + } + + GACT_ACTIVEGADGET = $4000; { this gadget is "active". This flag + * is maintained by Intuition, and you + * cannot count on its value persisting + * while you do something on your program's + * task. It can only be trusted by + * people implementing custom gadgets + } + +{ note $8000 is used above (GACT_BORDERSNIFF); + * all Activation flags defined } + +{ --- GADGET TYPES ------------------------------------------------------- } +{ These are the Gadget Type definitions for the variable GadgetType + * gadget number type MUST start from one. NO TYPES OF ZERO ALLOWED. + * first comes the mask for Gadget flags reserved for Gadget typing + } + GTYP_GADGETTYPE = $FC00; { all Gadget Global Type flags (padded) } + GTYP_SYSGADGET = $8000; { 1 = Allocated by the system, 0 = by app. } + GTYP_SCRGADGET = $4000; { 1 = ScreenGadget, 0 = WindowGadget } + GTYP_GZZGADGET = $2000; { 1 = for WFLG_GIMMEZEROZERO borders } + GTYP_REQGADGET = $1000; { 1 = this is a Requester Gadget } +{ system gadgets } + GTYP_SIZING = $0010; + GTYP_WDRAGGING = $0020; + GTYP_SDRAGGING = $0030; + GTYP_WUPFRONT = $0040; + GTYP_SUPFRONT = $0050; + GTYP_WDOWNBACK = $0060; + GTYP_SDOWNBACK = $0070; + GTYP_CLOSE = $0080; +{ application gadgets } + GTYP_BOOLGADGET = $0001; + GTYP_GADGET0002 = $0002; + GTYP_PROPGADGET = $0003; + GTYP_STRGADGET = $0004; + GTYP_CUSTOMGADGET = $0005; + + +{* GTYP_GTYPEMASK is a mask you can apply to tell what class + * of gadget this is. The possible classes follow. + *} + GTYP_GTYPEMASK = $0007; + +{ This bit in GadgetType is reserved for undocumented internal use + * by the Gadget Toolkit, and cannot be used nor relied on by + * applications: $0100; + } + +{ New for V39. Gadgets which have the GFLG_EXTENDED flag set are + * actually ExtGadgets, which have more flags. The GMORE_xxx + * identifiers describe those flags. For GMORE_SCROLLRASTER, see + * important information in the ScrollWindowRaster() autodoc. + * NB: GMORE_SCROLLRASTER must be set before the gadget is + * added to a window. + } + GMORE_BOUNDS = $00000001; { ExtGadget has valid Bounds } + GMORE_GADGETHELP = $00000002; { This gadget responds to gadget help } + GMORE_SCROLLRASTER = $00000004; { This (custom) gadget uses ScrollRaster } + +{ ======================================================================== } +{ === BoolInfo======================================================= } +{ ======================================================================== } +{ This is the special data needed by an Extended Boolean Gadget + * Typically this structure will be pointed to by the Gadget field SpecialInfo + } +Type + pBoolInfo = ^tBoolInfo; + tBoolInfo = record + Flags : Word; { defined below } + Mask : Pointer; { bit mask for highlighting and selecting + * mask must follow the same rules as an Image + * plane. It's width and height are determined + * by the width and height of the gadget's + * select box. (i.e. Gadget.Width and .Height). + } + Reserved : Cardinal; { set to 0 } + end; + +Const + +{ set BoolInfo.Flags to this flag bit. + * in the future, additional bits might mean more stuff hanging + * off of BoolInfo.Reserved. +} + BOOLMASK = $0001; { extension is for masked gadget } + +{ ======================================================================== } +{ === PropInfo =========================================================== } +{ ======================================================================== } +{ this is the special data required by the proportional Gadget + * typically, this data will be pointed to by the Gadget variable SpecialInfo + } + +Type + + pPropInfo = ^tPropInfo; + tPropInfo = record + Flags : Word; { general purpose flag bits (see defines below) } + + { You initialize the Pot variables before the Gadget is added to + * the system. Then you can look here for the current settings + * any time, even while User is playing with this Gadget. To + * adjust these after the Gadget is added to the System, use + * ModifyProp(); The Pots are the actual proportional settings, + * where a value of zero means zero and a value of MAXPOT means + * that the Gadget is set to its maximum setting. + } + + HorizPot : WORD; { 16-bit FixedPoint horizontal quantity percentage } + VertPot : WORD; { 16-bit FixedPoint vertical quantity percentage } + + { the 16-bit FixedPoint Body variables describe what percentage of + * the entire body of stuff referred to by this Gadget is actually + * shown at one time. This is used with the AUTOKNOB routines, + * to adjust the size of the AUTOKNOB according to how much of + * the data can be seen. This is also used to decide how far + * to advance the Pots when User hits the Container of the Gadget. + * For instance, if you were controlling the display of a 5-line + * Window of text with this Gadget, and there was a total of 15 + * lines that could be displayed, you would set the VertBody value to + * (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3. + * Therefore, the AUTOKNOB would fill 1/3 of the container, and + * if User hits the Cotainer outside of the knob, the pot would + * advance 1/3 (plus or minus) If there's no body to show, or + * the total amount of displayable info is less than the display area, + * set the Body variables to the MAX. To adjust these after the + * Gadget is added to the System, use ModifyProp(); + } + + HorizBody : Word; { horizontal Body } + VertBody : Word; { vertical Body } + + { these are the variables that Intuition sets and maintains } + + CWidth : Word; { Container width (with any relativity absoluted) } + CHeight : Word; { Container height (with any relativity absoluted) } + HPotRes, + VPotRes : Word; { pot increments } + LeftBorder : Word; { Container borders } + TopBorder : Word; { Container borders } + end; + +CONST +{ --- FLAG BITS ---------------------------------------------------------- } + AUTOKNOB = $0001; { this flag sez: gimme that old auto-knob } +{ NOTE: if you do not use an AUTOKNOB for a proportional gadget, + * you are currently limited to using a single Image of your own + * design: Intuition won't handle a linked list of images as + * a proportional gadget knob. + } + + FREEHORIZ = $0002; { IF set, the knob can move horizontally } + FREEVERT = $0004; { IF set, the knob can move vertically } + PROPBORDERLESS = $0008; { IF set, no border will be rendered } + KNOBHIT = $0100; { set when this Knob is hit } + PROPNEWLOOK = $0010; { set this IF you want to get the new + * V36 look + } + + KNOBHMIN = 6; { minimum horizontal size of the Knob } + KNOBVMIN = 4; { minimum vertical size of the Knob } + MAXBODY = $FFFF; { maximum body value } + MAXPOT = $FFFF; { maximum pot value } + +{ ======================================================================== } +{ === StringInfo ========================================================= } +{ ======================================================================== } +{ this is the special data required by the string Gadget + * typically, this data will be pointed to by the Gadget variable SpecialInfo + } + +Type + + pStringInfo = ^tStringInfo; + tStringInfo = record + { you initialize these variables, and then Intuition maintains them } + Buffer : PChar; { the buffer containing the start and final string } + UndoBuffer : PChar; { optional buffer for undoing current entry } + BufferPos : smallint; { character position in Buffer } + MaxChars : smallint; { max number of chars in Buffer (including NULL) } + DispPos : smallint; { Buffer position of first displayed character } + + { Intuition initializes and maintains these variables for you } + + UndoPos : smallint; { character position in the undo buffer } + NumChars : smallint; { number of characters currently in Buffer } + DispCount : smallint; { number of whole characters visible in Container } + CLeft, + CTop : smallint; { topleft offset of the container } + + { you can initialize this variable before the gadget is submitted to + * Intuition, and then examine it later to discover what Longint + * the user has entered (if the user never plays with the gadget, + * the value will be unchanged from your initial setting) + } + Extension : Pointer; + _LongInt : Longint; + + { If you want this Gadget to use your own Console keymapping, you + * set the ALTKEYMAP bit in the Activation flags of the Gadget, and then + * set this variable to point to your keymap. If you don't set the + * ALTKEYMAP, you'll get the standard ASCII keymapping. + } + + AltKeyMap : Pointer; + end; + + +{ ======================================================================== } +{ === Requester ========================================================== } +{ ======================================================================== } + +Type + + pRequester = ^tRequester; + tRequester = record + { the ClipRect and BitMap and used for rendering the requester } + OlderRequest : pRequester; + LeftEdge, + TopEdge : smallint; { dimensions of the entire box } + Width, + Height : smallint; { dimensions of the entire box } + RelLeft, + RelTop : smallint; { for Pointer relativity offsets } + + ReqGadget : pGadget; { pointer to a list of Gadgets } + ReqBorder : pBorder; { the box's border } + ReqText : pIntuiText; { the box's text } + Flags : Word; { see definitions below } + + { pen number for back-plane fill before draws } + + BackFill : Byte; + + { Layer in place of clip rect } + + ReqLayer : pLayer; + + ReqPad1 : Array [0..31] of Byte; + + { If the BitMap plane pointers are non-zero, this tells the system + * that the image comes pre-drawn (if the appliprog wants to define + * it's own box, in any shape or size it wants!); this is OK by + * Intuition as long as there's a good correspondence between + * the image and the specified Gadgets + } + + ImageBMap : pBitMap; { points to the BitMap of PREDRAWN imagery } + RWindow : Pointer; { added. points back to Window } + ReqImage : Pointer; + ReqPad2 : Array [0..31] of Shortint; + end; + + +Const + +{ FLAGS SET BY THE APPLIPROG } + POINTREL = $0001; { if POINTREL set, TopLeft is relative to pointer} + PREDRAWN = $0002; { if ReqBMap points to predrawn Requester imagery } + NOISYREQ = $0004; { if you don't want requester to filter input } + + SIMPLEREQ = $0010; + { to use SIMPLEREFRESH layer (recommended) } + + { New for V36 } + USEREQIMAGE = $0020; + { render linked list ReqImage after BackFill + * but before gadgets and text + } + NOREQBACKFILL = $0040; + { don't bother filling requester with Requester.BackFill pen } + + +{ FLAGS SET BY INTUITION } + REQOFFWINDOW = $1000; { part of one of the Gadgets was offwindow } + REQACTIVE = $2000; { this requester is active } + SYSREQUEST = $4000; { this requester caused by system } + DEFERREFRESH = $8000; { this Requester stops a Refresh broadcast } + + + + +{ ======================================================================== } +{ === Image ============================================================== } +{ ======================================================================== } +{ This is a brief image structure for very simple transfers of + * image data to a RastPort + } + +Type + pImage = ^tImage; + tImage = record + LeftEdge : smallint; { starting offset relative to some origin } + TopEdge : smallint; { starting offsets relative to some origin } + Width : smallint; { pixel size (though data is word-aligned) } + Height, + Depth : smallint; { pixel sizes } + ImageData : Pointer; { pointer to the actual word-aligned bits } + + { the PlanePick and PlaneOnOff variables work much the same way as the + * equivalent GELS Bob variables. It's a space-saving + * mechanism for image data. Rather than defining the image data + * for every plane of the RastPort, you need define data only + * for the planes that are not entirely zero or one. As you + * define your Imagery, you will often find that most of the planes + * ARE just as color selectors. For instance, if you're designing + * a two-color Gadget to use colors two and three, and the Gadget + * will reside in a five-plane display, bit plane zero of your + * imagery would be all ones, bit plane one would have data that + * describes the imagery, and bit planes two through four would be + * all zeroes. Using these flags allows you to avoid wasting all + * that memory in this way: first, you specify which planes you + * want your data to appear in using the PlanePick variable. For + * each bit set in the variable, the next "plane" of your image + * data is blitted to the display. For each bit clear in this + * variable, the corresponding bit in PlaneOnOff is examined. + * If that bit is clear, a "plane" of zeroes will be used. + * If the bit is set, ones will go out instead. So, for our example: + * Gadget.PlanePick = $02; + * Gadget.PlaneOnOff = $01; + * Note that this also allows for generic Gadgets, like the + * System Gadgets, which will work in any number of bit planes. + * Note also that if you want an Image that is only a filled + * rectangle, you can get this by setting PlanePick to zero + * (pick no planes of data) and set PlaneOnOff to describe the pen + * color of the rectangle. + } + + PlanePick, + PlaneOnOff : Byte; + + { if the NextImage variable is not NULL, Intuition presumes that + * it points to another Image structure with another Image to be + * rendered + } + + NextImage : pImage; + end; + + +{ New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass + * of the IECLASS_NEWPOINTERPOS event. The ie_EventAddress of such + * an event points to a TabletData structure (see below). + * + * The TabletData structure contains certain elements including a taglist. + * The taglist can be used for special tablet parameters. A tablet driver + * should include only those tag-items the tablet supports. An application + * can listen for any tag-items that interest it. Note: an application + * must set the WA_TabletMessages attribute to TRUE to receive this + * extended information in its IntuiMessages. + * + * The definitions given here MUST be followed. Pay careful attention + * to normalization and the interpretation of signs. + * + * TABLETA_TabletZ: the current value of the tablet in the Z direction. + * This unsigned value should typically be in the natural units of the + * tablet. You should also provide TABLETA_RangeZ. + * + * TABLETA_RangeZ: the maximum value of the tablet in the Z direction. + * Normally specified along with TABLETA_TabletZ, this allows the + * application to scale the actual Z value across its range. + * + * TABLETA_AngleX: the angle of rotation or tilt about the X-axis. This + * number should be normalized to fill a signed long Longint. Positive + * values imply a clockwise rotation about the X-axis when viewing + * from +X towards the origin. + * + * TABLETA_AngleY: the angle of rotation or tilt about the Y-axis. This + * number should be normalized to fill a signed long Longint. Positive + * values imply a clockwise rotation about the Y-axis when viewing + * from +Y towards the origin. + * + * TABLETA_AngleZ: the angle of rotation or tilt about the Z axis. This + * number should be normalized to fill a signed long Longint. Positive + * values imply a clockwise rotation about the Z-axis when viewing + * from +Z towards the origin. + * + * Note: a stylus that supports tilt should use the TABLETA_AngleX + * and TABLETA_AngleY attributes. Tilting the stylus so the tip + * points towards increasing or decreasing X is actually a rotation + * around the Y-axis. Thus, if the stylus tip points towards + * positive X, then that tilt is represented as a negative + * TABLETA_AngleY. Likewise, if the stylus tip points towards + * positive Y, that tilt is represented by positive TABLETA_AngleX. + * + * TABLETA_Pressure: the pressure reading of the stylus. The pressure + * should be normalized to fill a signed long Longint. Typical devices + * won't generate negative pressure, but the possibility is not precluded. + * The pressure threshold which is considered to cause a button-click is + * expected to be set in a Preferences program supplied by the tablet + * vendor. The tablet driver would send IECODE_LBUTTON-type events as + * the pressure crossed that threshold. + * + * TABLETA_ButtonBits: ti_Data is a long Longint whose bits are to + * be interpreted at the state of the first 32 buttons of the tablet. + * + * TABLETA_InProximity: ti_Data is a boolean. For tablets that support + * proximity, they should send the (TABLETA_InProximity,FALSE) tag item + * when the stylus is out of proximity. One possible use we can forsee + * is a mouse-blanking commodity which keys off this to blank the + * mouse. When this tag is absent, the stylus is assumed to be + * in proximity. + * + * TABLETA_ResolutionX: ti_Data is an unsigned long Longint which + * is the x-axis resolution in dots per inch. + * + * TABLETA_ResolutionY: ti_Data is an unsigned long Longint which + * is the y-axis resolution in dots per inch. + } + +const + TABLETA_Dummy = (TAG_USER + $3A000) ; + TABLETA_TabletZ = (TABLETA_Dummy + $01); + TABLETA_RangeZ = (TABLETA_Dummy + $02); + TABLETA_AngleX = (TABLETA_Dummy + $03); + TABLETA_AngleY = (TABLETA_Dummy + $04); + TABLETA_AngleZ = (TABLETA_Dummy + $05); + TABLETA_Pressure = (TABLETA_Dummy + $06); + TABLETA_ButtonBits = (TABLETA_Dummy + $07); + TABLETA_InProximity = (TABLETA_Dummy + $08); + TABLETA_ResolutionX = (TABLETA_Dummy + $09); + TABLETA_ResolutionY = (TABLETA_Dummy + $0A); + +{ If your window sets WA_TabletMessages to TRUE, then it will receive + * extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData + * field points at a TabletData structure. This structure contains + * additional information about the input event. + } + +Type + pTabletData = ^tTabletData; + tTabletData = record + { Sub-pixel position of tablet, in screen coordinates, + * scaled to fill a UWORD fraction: + } + td_XFraction, td_YFraction : WORD; + + { Current tablet coordinates along each axis: } + td_TabletX, td_TabletY : Cardinal; + + { Tablet range along each axis. For example, if td_TabletX + * can take values 0-999, td_RangeX should be 1000. + } + td_RangeX, td_RangeY : Cardinal; + + { Pointer to tag-list of additional tablet attributes. + * See <intuition/intuition.h> for the tag values. + } + td_TagList : pTagItem; + end; + +{ If a tablet driver supplies a hook for ient_CallBack, it will be + * invoked in the standard hook manner. A0 will point to the Hook + * itself, A2 will point to the InputEvent that was sent, and + * A1 will point to a TabletHookData structure. The InputEvent's + * ie_EventAddress field points at the IENewTablet structure that + * the driver supplied. + * + * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver + * should scale the ient_TabletX and ient_TabletY fields and store the + * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and + * ient_ScaledYFraction. + * + * The tablet hook must currently return NULL. This is the only + * acceptable return-value under V39. + } + + pTabletHookData = ^tTabletHookData; + tTabletHookData = record + { Pointer to the active screen: + * Note: if there are no open screens, thd_Screen will be NULL. + * thd_Width and thd_Height will then describe an NTSC 64$400 + * screen. Please scale accordingly. + } + thd_Screen : Pointer; + + { The width and height (measured in pixels of the active screen) + * that your are to scale to: + } + thd_Width, + thd_Height : Cardinal; + + { Non-zero if the screen or something about the screen + * changed since the last time you were invoked: + } + thd_ScreenChanged : Longint; + end; + + +{ ======================================================================== } +{ === IntuiMessage ======================================================= } +{ ======================================================================== } + +Type + + pIntuiMessage = ^tIntuiMessage; + tIntuiMessage = record + ExecMessage : tMessage; + + { the Class bits correspond directly with the IDCMP Flags, except for the + * special bit LONELYMESSAGE (defined below) + } + + IClass : Cardinal; + + { the Code field is for special values like MENU number } + + Code : Word; + + { the Qualifier field is a copy of the current InputEvent's Qualifier } + + Qualifier : Word; + + { IAddress contains particular addresses for Intuition functions, like + * the pointer to the Gadget or the Screen + } + + IAddress : Pointer; + + { when getting mouse movement reports, any event you get will have the + * the mouse coordinates in these variables. the coordinates are relative + * to the upper-left corner of your Window (GIMMEZEROZERO notwithstanding) + } + + MouseX, + MouseY : smallint; + + { the time values are copies of the current system clock time. Micros + * are in units of microseconds, Seconds in seconds. + } + + Seconds, + Micros : Cardinal; + + { the IDCMPWindow variable will always have the Pointer of the Window of + * this IDCMP + } + + IDCMPWindow : Pointer; + + { system-use variable } + + SpecialLink : pIntuiMessage; + end; + +{ New for V39: + * All IntuiMessages are now slightly extended. The ExtIntuiMessage + * structure has an additional field for tablet data, which is usually + * NULL. If a tablet driver which is sending IESUBCLASS_NEWTABLET + * events is installed in the system, windows with the WA_TabletMessages + * property set will find that eim_TabletData points to the TabletData + * structure. Applications must first check that this field is non-NULL; + * it will be NULL for certain kinds of message, including mouse activity + * generated from other than the tablet (i.e. the keyboard equivalents + * or the mouse itself). + * + * NEVER EVER examine any extended fields when running under pre-V39! + * + * NOTE: This structure is subject to grow in the future. Making + * assumptions about its size is A BAD IDEA. + } + + pExtIntuiMessage = ^tExtIntuiMessage; + tExtIntuiMessage = record + eim_IntuiMessage : tIntuiMessage; + eim_TabletData : pTabletData; + end; + + +CONST + +{ --- IDCMP Classes ------------------------------------------------------ } +{ Please refer to the Autodoc for OpenWindow() and to the Rom Kernel + * Manual for full details on the IDCMP classes. + } + IDCMP_SIZEVERIFY = $00000001; + IDCMP_NEWSIZE = $00000002; + IDCMP_REFRESHWINDOW = $00000004; + IDCMP_MOUSEBUTTONS = $00000008; + IDCMP_MOUSEMOVE = $00000010; + IDCMP_GADGETDOWN = $00000020; + IDCMP_GADGETUP = $00000040; + IDCMP_REQSET = $00000080; + IDCMP_MENUPICK = $00000100; + IDCMP_CLOSEWINDOW = $00000200; + IDCMP_RAWKEY = $00000400; + IDCMP_REQVERIFY = $00000800; + IDCMP_REQCLEAR = $00001000; + IDCMP_MENUVERIFY = $00002000; + IDCMP_NEWPREFS = $00004000; + IDCMP_DISKINSERTED = $00008000; + IDCMP_DISKREMOVED = $00010000; + IDCMP_WBENCHMESSAGE = $00020000; { System use only } + IDCMP_ACTIVEWINDOW = $00040000; + IDCMP_INACTIVEWINDOW = $00080000; + IDCMP_DELTAMOVE = $00100000; + IDCMP_VANILLAKEY = $00200000; + IDCMP_INTUITICKS = $00400000; +{ for notifications from "boopsi" gadgets } + IDCMP_IDCMPUPDATE = $00800000; { new for V36 } +{ for getting help key report during menu session } + IDCMP_MENUHELP = $01000000; { new for V36 } +{ for notification of any move/size/zoom/change window } + IDCMP_CHANGEWINDOW = $02000000; { new for V36 } + IDCMP_GADGETHELP = $04000000; { new for V39 } + +{ NOTEZ-BIEN: $80000000 is reserved for internal use } + +{ the IDCMP Flags do not use this special bit, which is cleared when + * Intuition sends its special message to the Task, and set when Intuition + * gets its Message back from the Task. Therefore, I can check here to + * find out fast whether or not this Message is available for me to send + } + IDCMP_LONELYMESSAGE = $80000000; + + +{ --- IDCMP Codes -------------------------------------------------------- } +{ This group of codes is for the IDCMP_CHANGEWINDOW message } + CWCODE_MOVESIZE = $0000; { Window was moved and/or sized } + CWCODE_DEPTH = $0001; { Window was depth-arranged (new for V39) } + +{ This group of codes is for the IDCMP_MENUVERIFY function } + MENUHOT = $0001; { IntuiWants verification OR MENUCANCEL } + MENUCANCEL = $0002; { HOT Reply of this cancels Menu operation } + MENUWAITING = $0003; { Intuition simply wants a ReplyMsg() ASAP } + +{ These are internal tokens to represent state of verification attempts + * shown here as a clue. + } + OKOK = MENUHOT; { guy didn't care } + OKABORT = $0004; { window rendered question moot } + OKCANCEL = MENUCANCEL; { window sent cancel reply } + +{ This group of codes is for the IDCMP_WBENCHMESSAGE messages } + WBENCHOPEN = $0001; + WBENCHCLOSE = $0002; + + +{ A data structure common in V36 Intuition processing } +Type + pIBox = ^tIBox; + tIBox = record + Left, + Top, + Width, + Height : smallint; + END; + + +{ ======================================================================== } +{ === Window ============================================================= } +{ ======================================================================== } + +Type + + pWindow = ^tWindow; + tWindow = record + NextWindow : pWindow; { for the linked list in a screen } + + LeftEdge, + TopEdge : smallint; { screen dimensions of window } + Width, + Height : smallint; { screen dimensions of window } + + MouseY, + MouseX : smallint; { relative to upper-left of window } + + MinWidth, + MinHeight : smallint; { minimum sizes } + MaxWidth, + MaxHeight : smallint; { maximum sizes } + + Flags : Cardinal; { see below for defines } + + MenuStrip : pMenu; { the strip of Menu headers } + + Title : PChar; { the title text for this window } + + FirstRequest : pRequester; { all active Requesters } + + DMRequest : pRequester; { double-click Requester } + + ReqCount : smallint; { count of reqs blocking Window } + + WScreen : Pointer; { this Window's Screen } + RPort : pRastPort; { this Window's very own RastPort } + + { the border variables describe the window border. If you specify + * GIMMEZEROZERO when you open the window, then the upper-left of the + * ClipRect for this window will be upper-left of the BitMap (with correct + * offsets when in SuperBitMap mode; you MUST select GIMMEZEROZERO when + * using SuperBitMap). If you don't specify ZeroZero, then you save + * memory (no allocation of RastPort, Layer, ClipRect and associated + * Bitmaps), but you also must offset all your writes by BorderTop, + * BorderLeft and do your own mini-clipping to prevent writing over the + * system gadgets + } + + BorderLeft, + BorderTop, + BorderRight, + BorderBottom : Shortint; + BorderRPort : pRastPort; + + + { You supply a linked-list of Gadgets for your Window. + * This list DOES NOT include system gadgets. You get the standard + * window system gadgets by setting flag-bits in the variable Flags (see + * the bit definitions below) + } + + FirstGadget : pGadget; + + { these are for opening/closing the windows } + + Parent, + Descendant : pWindow; + + { sprite data information for your own Pointer + * set these AFTER you Open the Window by calling SetPointer() + } + + _Pointer : Pointer; { sprite data } + PtrHeight : Shortint; { sprite height (not including sprite padding) } + PtrWidth : Shortint; { sprite width (must be less than or equal to 16) } + XOffset, + YOffset : Shortint; { sprite offsets } + + { the IDCMP Flags and User's and Intuition's Message Ports } + IDCMPFlags : Cardinal; { User-selected flags } + UserPort, + WindowPort : pMsgPort; + MessageKey : pIntuiMessage; + + DetailPen, + BlockPen : Byte; { for bar/border/gadget rendering } + + { the CheckMark is a pointer to the imagery that will be used when + * rendering MenuItems of this Window that want to be checkmarked + * if this is equal to NULL, you'll get the default imagery + } + + CheckMark : pImage; + + ScreenTitle : PChar; { if non-null, Screen title when Window is active } + + { These variables have the mouse coordinates relative to the + * inner-Window of GIMMEZEROZERO Windows. This is compared with the + * MouseX and MouseY variables, which contain the mouse coordinates + * relative to the upper-left corner of the Window, GIMMEZEROZERO + * notwithstanding + } + + GZZMouseX : smallint; + GZZMouseY : smallint; + + { these variables contain the width and height of the inner-Window of + * GIMMEZEROZERO Windows + } + + GZZWidth : smallint; + GZZHeight : smallint; + + ExtData : Pointer; + + UserData : Pointer; { general-purpose pointer to User data extension } + + {* jimm: NEW: 11/18/85: this pointer keeps a duplicate of what + * Window.RPort->Layer is _supposed_ to be pointing at + } + + WLayer : pLayer; + + { jimm: NEW 1.2: need to keep track of the font that + * OpenWindow opened, in case user SetFont's into RastPort + } + + IFont : pTextFont; + {* (V36) another flag word (the Flags field is used up). + * At present, all flag values are system private. + * Until further notice, you may not change nor use this field. + *} + MoreFlags : Cardinal; + + {**** Data beyond this point are Intuition Private. DO NOT USE ****} + + end; + +CONST +{ --- Flags requested at OpenWindow() time by the application --------- } + WFLG_SIZEGADGET = $00000001; { include sizing system-gadget? } + WFLG_DRAGBAR = $00000002; { include dragging system-gadget? } + WFLG_DEPTHGADGET = $00000004; { include depth arrangement gadget? } + WFLG_CLOSEGADGET = $00000008; { include close-box system-gadget? } + + WFLG_SIZEBRIGHT = $00000010; { size gadget uses right border } + WFLG_SIZEBBOTTOM = $00000020; { size gadget uses bottom border } + +{ --- refresh modes ------------------------------------------------------ } +{ combinations of the WFLG_REFRESHBITS select the refresh type } + WFLG_REFRESHBITS = $000000C0; + WFLG_SMART_REFRESH = $00000000; + WFLG_SIMPLE_REFRESH= $00000040; + WFLG_SUPER_BITMAP = $00000080; + WFLG_OTHER_REFRESH = $000000C0; + + WFLG_BACKDROP = $00000100; { this is a backdrop window } + + WFLG_REPORTMOUSE = $00000200; { to hear about every mouse move } + + WFLG_GIMMEZEROZERO = $00000400; { a GimmeZeroZero window } + + WFLG_BORDERLESS = $00000800; { to get a Window sans border } + + WFLG_ACTIVATE = $00001000; { when Window opens, it's Active } + + +{ --- Other User Flags --------------------------------------------------- } + WFLG_RMBTRAP = $00010000; { Catch RMB events for your own } + WFLG_NOCAREREFRESH = $00020000; { not to be bothered with REFRESH } + +{ - V36 new Flags which the programmer may specify in NewWindow.Flags } + WFLG_NW_EXTENDED = $00040000; { extension data provided } + { see struct ExtNewWindow } + +{ - V39 new Flags which the programmer may specify in NewWindow.Flags } + WFLG_NEWLOOKMENUS = $00200000; { window has NewLook menus } + +{ These flags are set only by Intuition. YOU MAY NOT SET THEM YOURSELF! } + WFLG_WINDOWACTIVE = $00002000; { this window is the active one } + WFLG_INREQUEST = $00004000; { this window is in request mode } + WFLG_MENUSTATE = $00008000; { Window is active with Menus on } + WFLG_WINDOWREFRESH = $01000000; { Window is currently refreshing } + WFLG_WBENCHWINDOW = $02000000; { WorkBench tool ONLY Window } + WFLG_WINDOWTICKED = $04000000; { only one timer tick at a time } + +{ --- V36 Flags to be set only by Intuition ------------------------- } + WFLG_VISITOR = $08000000; { visitor window } + WFLG_ZOOMED = $10000000; { identifies "zoom state" } + WFLG_HASZOOM = $20000000; { windowhas a zoom gadget } + +{ --- Other Window Values ---------------------------------------------- } + DEFAULTMOUSEQUEUE = (5); { no more mouse messages } + +{ --- see struct IntuiMessage for the IDCMP Flag definitions ------------- } + + +{ ======================================================================== } +{ === NewWindow ========================================================== } +{ ======================================================================== } + +Type + + pNewWindow = ^tNewWindow; + tNewWindow = record + LeftEdge, + TopEdge : smallint; { screen dimensions of window } + Width, + Height : smallint; { screen dimensions of window } + + DetailPen, + BlockPen : Byte; { for bar/border/gadget rendering } + + IDCMPFlags : Cardinal; { User-selected IDCMP flags } + + Flags : Cardinal; { see Window struct for defines } + + { You supply a linked-list of Gadgets for your Window. + * This list DOES NOT include system Gadgets. You get the standard + * system Window Gadgets by setting flag-bits in the variable Flags (see + * the bit definitions under the Window structure definition) + } + + FirstGadget : pGadget; + + { the CheckMark is a pointer to the imagery that will be used when + * rendering MenuItems of this Window that want to be checkmarked + * if this is equal to NULL, you'll get the default imagery + } + + CheckMark : pImage; + + Title : PChar; { the title text for this window } + + { the Screen pointer is used only if you've defined a CUSTOMSCREEN and + * want this Window to open in it. If so, you pass the Pointer of the + * Custom Screen structure in this variable. Otherwise, this variable + * is ignored and doesn't have to be initialized. + } + + Screen : Pointer; + + { SUPER_BITMAP Window? If so, put the Pointer of your BitMap structure + * in this variable. If not, this variable is ignored and doesn't have + * to be initialized + } + + BitMap : pBitMap; + + { the values describe the minimum and maximum sizes of your Windows. + * these matter only if you've chosen the WINDOWSIZING Gadget option, + * which means that you want to let the User to change the size of + * this Window. You describe the minimum and maximum sizes that the + * Window can grow by setting these variables. You can initialize + * any one these to zero, which will mean that you want to duplicate + * the setting for that dimension (if MinWidth == 0, MinWidth will be + * set to the opening Width of the Window). + * You can change these settings later using SetWindowLimits(). + * If you haven't asked for a SIZING Gadget, you don't have to + * initialize any of these variables. + } + + MinWidth, + MinHeight : smallint; { minimums } + MaxWidth, + MaxHeight : smallint; { maximums } + + { the type variable describes the Screen in which you want this Window to + * open. The type value can either be CUSTOMSCREEN or one of the + * system standard Screen Types such as WBENCHSCREEN. See the + * type definitions under the Screen structure + } + + WType : Word; { is "Type" in C includes } + end; + + +{ The following structure is the future NewWindow. Compatibility + * issues require that the size of NewWindow not change. + * Data in the common part (NewWindow) indicates the the extension + * fields are being used. + * NOTE WELL: This structure may be subject to future extension. + * Writing code depending on its size is not allowed. + } + pExtNewWindow = ^tExtNewWindow; + tExtNewWindow = record + LeftEdge, TopEdge : smallint; + Width, Height : smallint; + + DetailPen, BlockPen : Byte; + IDCMPFlags : Cardinal; + Flags : Cardinal; + FirstGadget : pGadget; + + CheckMark : pImage; + + Title : PChar; + WScreen : Pointer; + WBitMap : pBitMap; + + MinWidth, MinHeight : smallint; + MaxWidth, MaxHeight : Word; + + { the type variable describes the Screen in which you want this Window to + * open. The type value can either be CUSTOMSCREEN or one of the + * system standard Screen Types such as WBENCHSCREEN. See the + * type definitions under the Screen structure. + * A new possible value for this field is PUBLICSCREEN, which + * defines the window as a 'visitor' window. See below for + * additional information provided. + } + WType : Word; + + { ------------------------------------------------------- * + * extensions for V36 + * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then + * this field is assumed to point to an array ( or chain of arrays) + * of TagItem structures. See also ExtNewScreen for another + * use of TagItems to pass optional data. + * + * see below for tag values and the corresponding data. + } + Extension : pTagItem; + END; + +{ + * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow. + * They are values in a TagItem array passed as extension/replacement + * values for the data in NewWindow. OpenWindowTagList() can actually + * work well with a NULL NewWindow pointer. + } +CONST + WA_Dummy = (TAG_USER + 99); { $80000063 } + +{ these tags simply override NewWindow parameters } + WA_Left = (WA_Dummy + $01); + WA_Top = (WA_Dummy + $02); + WA_Width = (WA_Dummy + $03); + WA_Height = (WA_Dummy + $04); + WA_DetailPen = (WA_Dummy + $05); + WA_BlockPen = (WA_Dummy + $06); + WA_IDCMP = (WA_Dummy + $07); + { "bulk" initialization of NewWindow.Flags } + WA_Flags = (WA_Dummy + $08); + WA_Gadgets = (WA_Dummy + $09); + WA_Checkmark = (WA_Dummy + $0A); + WA_Title = (WA_Dummy + $0B); + { means you don't have to call SetWindowTitles + * after you open your window + } + WA_ScreenTitle = (WA_Dummy + $0C); + WA_CustomScreen = (WA_Dummy + $0D); + WA_SuperBitMap = (WA_Dummy + $0E); + { also implies WFLG_SUPER_BITMAP property } + WA_MinWidth = (WA_Dummy + $0F); + WA_MinHeight = (WA_Dummy + $10); + WA_MaxWidth = (WA_Dummy + $11); + WA_MaxHeight = (WA_Dummy + $12); + +{ The following are specifications for new features } + + WA_InnerWidth = (WA_Dummy + $13); + WA_InnerHeight = (WA_Dummy + $14); + { You can specify the dimensions of the interior + * region of your window, independent of what + * the border widths will be. You probably want + * to also specify WA_AutoAdjust to allow + * Intuition to move your window or even + * shrink it so that it is completely on screen. + } + + WA_PubScreenName = (WA_Dummy + $15); + { declares that you want the window to open as + * a visitor on the public screen whose name is + * pointed to by (UBYTE *) ti_Data + } + WA_PubScreen = (WA_Dummy + $16); + { open as a visitor window on the public screen + * whose Pointer is in (struct Screen *) ti_Data. + * To ensure that this screen remains open, you + * should either be the screen's owner, have a + * window open on the screen, or use LockPubScreen(). + } + WA_PubScreenFallBack = (WA_Dummy + $17); + { A Boolean, specifies whether a visitor window + * should "fall back" to the default public screen + * (or Workbench) if the named public screen isn't + * available + } + WA_WindowName = (WA_Dummy + $18); + { not implemented } + WA_Colors = (WA_Dummy + $19); + { a ColorSpec array for colors to be set + * when this window is active. This is not + * implemented, and may not be, since the default + * values to restore would be hard to track. + * We'd like to at least support per-window colors + * for the mouse pointer sprite. + } + WA_Zoom = (WA_Dummy + $1A); + { ti_Data points to an array of four WORD's, + * the initial Left/Top/Width/Height values of + * the "alternate" zoom position/dimensions. + * It also specifies that you want a Zoom gadget + * for your window, whether or not you have a + * sizing gadget. + } + WA_MouseQueue = (WA_Dummy + $1B); + { ti_Data contains initial value for the mouse + * message backlog limit for this window. + } + WA_BackFill = (WA_Dummy + $1C); + { unimplemented at present: provides a "backfill + * hook" for your window's layer. + } + WA_RptQueue = (WA_Dummy + $1D); + { initial value of repeat key backlog limit } + + { These Boolean tag items are alternatives to the NewWindow.Flags + * boolean flags with similar names. + } + WA_SizeGadget = (WA_Dummy + $1E); + WA_DragBar = (WA_Dummy + $1F); + WA_DepthGadget = (WA_Dummy + $20); + WA_CloseGadget = (WA_Dummy + $21); + WA_Backdrop = (WA_Dummy + $22); + WA_ReportMouse = (WA_Dummy + $23); + WA_NoCareRefresh = (WA_Dummy + $24); + WA_Borderless = (WA_Dummy + $25); + WA_Activate = (WA_Dummy + $26); + WA_RMBTrap = (WA_Dummy + $27); + WA_WBenchWindow = (WA_Dummy + $28); { PRIVATE!! } + WA_SimpleRefresh = (WA_Dummy + $29); + { only specify if TRUE } + WA_SmartRefresh = (WA_Dummy + $2A); + { only specify if TRUE } + WA_SizeBRight = (WA_Dummy + $2B); + WA_SizeBBottom = (WA_Dummy + $2C); + + { New Boolean properties } + WA_AutoAdjust = (WA_Dummy + $2D); + { shift or squeeze the window's position and + * dimensions to fit it on screen. + } + + WA_GimmeZeroZero = (WA_Dummy + $2E); + { equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO } + +{ New for V37: WA_MenuHelp (ignored by V36) } + WA_MenuHelp = (WA_Dummy + $2F); + { Enables IDCMP_MENUHELP: Pressing HELP during menus + * will return IDCMP_MENUHELP message. + } + +{ New for V39: (ignored by V37 and earlier) } + WA_NewLookMenus = (WA_Dummy + $30); + { Set to TRUE if you want NewLook menus } + WA_AmigaKey = (WA_Dummy + $31); + { Pointer to image for Amiga-key equiv in menus } + WA_NotifyDepth = (WA_Dummy + $32); + { Requests IDCMP_CHANGEWINDOW message when + * window is depth arranged + * (imsg->Code = CWCODE_DEPTH) + } + +{ WA_Dummy + $33 is obsolete } + + WA_Pointer = (WA_Dummy + $34); + { Allows you to specify a custom pointer + * for your window. ti_Data points to a + * pointer object you obtained via + * "pointerclass". NULL signifies the + * default pointer. + * This tag may be passed to OpenWindowTags() + * or SetWindowPointer(). + } + + WA_BusyPointer = (WA_Dummy + $35); + { ti_Data is boolean. Set to TRUE to + * request the standard busy pointer. + * This tag may be passed to OpenWindowTags() + * or SetWindowPointer(). + } + + WA_PointerDelay = (WA_Dummy + $36); + { ti_Data is boolean. Set to TRUE to + * request that the changing of the + * pointer be slightly delayed. The change + * will be called off if you call NewSetPointer() + * before the delay expires. This allows + * you to post a busy-pointer even if you think + * the busy-time may be very Word, without + * fear of a flashing pointer. + * This tag may be passed to OpenWindowTags() + * or SetWindowPointer(). + } + + WA_TabletMessages = (WA_Dummy + $37); + { ti_Data is a boolean. Set to TRUE to + * request that tablet information be included + * in IntuiMessages sent to your window. + * Requires that something (i.e. a tablet driver) + * feed IESUBCLASS_NEWTABLET InputEvents into + * the system. For a pointer to the TabletData, + * examine the ExtIntuiMessage->eim_TabletData + * field. It is UNSAFE to check this field + * when running on pre-V39 systems. It's always + * safe to check this field under V39 and up, + * though it may be NULL. + } + + WA_HelpGroup = (WA_Dummy + $38); + { When the active window has gadget help enabled, + * other windows of the same HelpGroup number + * will also get GadgetHelp. This allows GadgetHelp + * to work for multi-windowed applications. + * Use GetGroupID() to get an ID number. Pass + * this number as ti_Data to all your windows. + * See also the HelpControl() function. + } + + WA_HelpGroupWindow = (WA_Dummy + $39); + { When the active window has gadget help enabled, + * other windows of the same HelpGroup will also get + * GadgetHelp. This allows GadgetHelp to work + * for multi-windowed applications. As an alternative + * to WA_HelpGroup, you can pass a pointer to any + * other window of the same group to join its help + * group. Defaults to NULL, which has no effect. + * See also the HelpControl() function. + } + + +{ HelpControl() flags: + * + * HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more + * windows. + } + + HC_GADGETHELP = 1; + + +{ ======================================================================== } +{ === Remember =========================================================== } +{ ======================================================================== } +{ this structure is used for remembering what memory has been allocated to + * date by a given routine, so that a premature abort or systematic exit + * can deallocate memory cleanly, easily, and completely + } + +Type + + pRemember = ^tRemember; + tRemember = record + NextRemember : pRemember; + RememberSize : Cardinal; + Memory : Pointer; + end; + + +{ === Color Spec ====================================================== } +{ How to tell Intuition about RGB values for a color table entry. } + + pColorSpec = ^tColorSpec; + tColorSpec = record + ColorIndex : smallint; { -1 terminates an array of ColorSpec } + Red : Word; { only the _bottom_ 4 bits recognized } + Green : Word; { only the _bottom_ 4 bits recognized } + Blue : Word; { only the _bottom_ 4 bits recognized } + END; + +{ === Easy Requester Specification ======================================= } +{ see also autodocs for EasyRequest and BuildEasyRequest } +{ NOTE: This structure may grow in size in the future } + + pEasyStruct = ^tEasyStruct; + tEasyStruct = record + es_StructSize : Cardinal; { should be sizeof (struct EasyStruct )} + es_Flags : Cardinal; { should be 0 for now } + es_Title : PChar; { title of requester window } + es_TextFormat : PChar; { 'printf' style formatting string } + es_GadgetFormat : PChar; { 'printf' style formatting string } + END; + + + +{ ======================================================================== } +{ === Miscellaneous ====================================================== } +{ ======================================================================== } +CONST +{ = MENU STUFF =========================================================== } + NOMENU = $001F; + NOITEM = $003F; + NOSUB = $001F; + MENUNULL = -1; + + +{ = =RJ='s peculiarities ================================================= } + +{ these defines are for the COMMSEQ and CHECKIT menu stuff. If CHECKIT, + * I'll use a generic Width (for all resolutions) for the CheckMark. + * If COMMSEQ, likewise I'll use this generic stuff + } + + CHECKWIDTH = 19; + COMMWIDTH = 27; + LOWCHECKWIDTH = 13; + LOWCOMMWIDTH = 16; + +{ these are the AlertNumber defines. if you are calling DisplayAlert() + * the AlertNumber you supply must have the ALERT_TYPE bits set to one + * of these patterns + } + + ALERT_TYPE = $80000000; + RECOVERY_ALERT = $00000000; { the system can recover from this } + DEADEND_ALERT = $80000000; { no recovery possible, this is it } + + +{ When you're defining IntuiText for the Positive and Negative Gadgets + * created by a call to AutoRequest(), these defines will get you + * reasonable-looking text. The only field without a define is the IText + * field; you decide what text goes with the Gadget + } + + AUTOFRONTPEN = 0; + AUTOBACKPEN = 1; + AUTODRAWMODE = JAM2; + AUTOLEFTEDGE = 6; + AUTOTOPEDGE = 3; + +{ - + AUTOITEXTFONT = Nil; + AUTONEXTTEXT = Nil; +- } + + +{ --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- } + + + SELECTUP = IECODE_LBUTTON + IECODE_UP_PREFIX; + SELECTDOWN = IECODE_LBUTTON; + MENUUP = IECODE_RBUTTON + IECODE_UP_PREFIX; + MENUDOWN = IECODE_RBUTTON; + ALTLEFT = IEQUALIFIER_LALT; + ALTRIGHT = IEQUALIFIER_RALT; + AMIGALEFT = IEQUALIFIER_LCOMMAND; + AMIGARIGHT = IEQUALIFIER_RCOMMAND; + AMIGAKEYS = AMIGALEFT + AMIGARIGHT; + + CURSORUP = $4C; + CURSORLEFT = $4F; + CURSORRIGHT = $4E; + CURSORDOWN = $4D; + KEYCODE_Q = $10; + KEYCODE_X = $32; + KEYCODE_N = $36; + KEYCODE_M = $37; + KEYCODE_V = $34; + KEYCODE_B = $35; + KEYCODE_LESS = $38; + KEYCODE_GREATER = $39; + +{ these are the display modes for which we have corresponding parameter + * settings in the config arrays + } +CONST + DMODECOUNT = $0002; { how many modes there are } + HIRESPICK = $0000; + LOWRESPICK = $0001; + + EVENTMAX = 10; { size of event array } + +{ these are the system Gadget defines } + RESCOUNT = 2; + HIRESGADGET = 0; + LOWRESGADGET = 1; + + GADGETCOUNT = 8; + UPFRONTGADGET = 0; + DOWNBACKGADGET = 1; + SIZEGADGET = 2; + CLOSEGADGET = 3; + DRAGGADGET = 4; + SUPFRONTGADGET = 5; + SDOWNBACKGADGET= 6; + SDRAGGADGET = 7; + + +{ ======================================================================== } +{ === DrawInfo ========================================================= } +{ ======================================================================== } + +{ This is a packet of information for graphics rendering. It originates + * with a Screen, and is gotten using GetScreenDrawInfo( screen ); + } + +{ If you find dri_Version >= DRI_VERSION, you know this structure + * has at least the fields defined in this version of the include file + } +CONST + RI_VERSION = (1); { obsolete, will be removed } + DRI_VERSION = (1); + +Type + + pDrawInfo = ^tDrawInfo; + tDrawInfo = record + dri_Version : Word; { will be DRI_VERSION } + dri_NumPens : Word; { guaranteed to be >= numDrIPens } + dri_Pens : Pointer; { pointer to pen array } + + dri_Font : pTextFont; { screen default font } + dri_Depth : Word; { (initial) depth of screen bitmap } + + dri_Resolution : record { from DisplayInfo database for initial display mode } + x : word; + y : word; + end; + + dri_Flags : Cardinal; { defined below } +{ New for V39: dri_CheckMark, dri_AmigaKey. } + dri_CheckMark : pImage; { ImagePtr } { pointer to scaled checkmark image + * Will be NULL if DRI_VERSION < 2 + } + dri_AmigaKey : pImage; { ImagePtr } { pointer to scaled Amiga-key image + * Will be NULL if DRI_VERSION < 2 + } + + dri_Reserved : Array[0..4] of Cardinal; { avoid recompilation ;^) } + END; + +CONST + DRIF_NEWLOOK = $00000001; { specified SA_Pens, full treatment } + +{ rendering pen number indexes into DrawInfo.dri_Pens[] } + DETAILPEN = ($0000); { compatible Intuition rendering pens } + BLOCKPEN = ($0001); { compatible Intuition rendering pens } + TEXTPEN = ($0002); { text on background } + SHINEPEN = ($0003); { bright edge on 3D objects } + SHADOWPEN = ($0004); { dark edge on 3D objects } + FILLPEN = ($0005); { active-window/selected-gadget fill } + FILLTEXTPEN = ($0006); { text over FILLPEN } + BACKGROUNDPEN = ($0007); { always color 0 } + HIGHLIGHTTEXTPEN = ($0008); { special color text, on background } +{ New for V39, only present if DRI_VERSION >= 2: } + BARDETAILPEN = ($0009); { text/detail in screen-bar/menus } + BARBLOCKPEN = ($000A); { screen-bar/menus fill } + BARTRIMPEN = ($000B); { trim under screen-bar } + + NUMDRIPENS = ($0009); + +{ New for V39: It is sometimes useful to specify that a pen value + * is to be the complement of color zero to three. The "magic" numbers + * serve that purpose: + } + PEN_C3 = $FEFC; { Complement of color 3 } + PEN_C2 = $FEFD; { Complement of color 2 } + PEN_C1 = $FEFE; { Complement of color 1 } + PEN_C0 = $FEFF; { Complement of color 0 } + +{ ======================================================================== } +{ === Screen ============================================================= } +{ ======================================================================== } + +Type + + pScreen = ^tScreen; + tScreen = record + NextScreen : pScreen; { linked list of screens } + FirstWindow : pWindow; { linked list Screen's Windows } + + LeftEdge, + TopEdge : smallint; { parameters of the screen } + Width, + Height : smallint; { parameters of the screen } + + MouseY, + MouseX : smallint; { position relative to upper-left } + + Flags : Word; { see definitions below } + + Title : PChar; { null-terminated Title text } + DefaultTitle : PChar; { for Windows without ScreenTitle } + + { Bar sizes for this Screen and all Window's in this Screen } + BarHeight, + BarVBorder, + BarHBorder, + MenuVBorder, + MenuHBorder : Shortint; + WBorTop, + WBorLeft, + WBorRight, + WBorBottom : Shortint; + + Font : pTextAttr; { this screen's default font } + + { the display data structures for this Screen (note the prefix S)} + ViewPort : tViewPort; { describing the Screen's display } + RastPort : tRastPort; { describing Screen rendering } + BitMap : tBitMap; { extra copy of RastPort BitMap } + LayerInfo : tLayer_Info; { each screen gets a LayerInfo } + + { You supply a linked-list of Gadgets for your Screen. + * This list DOES NOT include system Gadgets. You get the standard + * system Screen Gadgets by default + } + + FirstGadget : pGadget; + + DetailPen, + BlockPen : Byte; { for bar/border/gadget rendering } + + { the following variable(s) are maintained by Intuition to support the + * DisplayBeep() color flashing technique + } + SaveColor0 : Word; + + { This layer is for the Screen and Menu bars } + BarLayer : pLayer; + + ExtData : Pointer; + UserData : Pointer; + { general-purpose pointer to User data extension } + {**** Data below this point are SYSTEM PRIVATE ****} + + end; + +Const + +{ The screen flags have the suffix "_f" added to avoid conflicts with + routine names. } + +{ --- FLAGS SET BY INTUITION --------------------------------------------- } +{ The SCREENTYPE bits are reserved for describing various Screen types + * available under Intuition. + } + SCREENTYPE_F = $000F; { all the screens types available } +{ --- the definitions for the Screen Type ------------------------------- } + WBENCHSCREEN_F = $0001; { Ta Da! The Workbench } + PUBLICSCREEN_F = $0002; { Public shared (custom) screen } + CUSTOMSCREEN_F = $000F; { for that special look } + + SHOWTITLE_F = $0010; { this gets set by a call to ShowTitle() } + + BEEPING_F = $0020; { set when Screen is beeping } + + CUSTOMBITMAP_F = $0040; { if you are supplying your own BitMap } + + SCREENBEHIND_F = $0080; { if you want your screen to open behind + * already open screens + } + SCREENQUIET_F = $0100; { if you do not want Intuition to render + * into your screen (gadgets, title) } + SCREENHIRES = $0200; { do no use lowres gadgets (private) } + + NS_EXTENDED = $1000; { ExtNewScreen.Extension is valid } + { V36 applications can use OpenScreenTagList() instead of NS_EXTENDED } + +{ New for V39: } + PENSHARED = $0400; { Screen opener set (SA_SharePens,TRUE) } + + + AUTOSCROLL = $4000; { screen is to autoscoll } + + STDSCREENHEIGHT = -1; { supply in NewScreen.Height } + STDSCREENWIDTH = -1; { supply in NewScreen.Width } + + + +{ + * Screen attribute tag ID's. These are used in the ti_Tag field of + * TagItem arrays passed to OpenScreenTagList() (or in the + * ExtNewScreen.Extension field). + } + +{ Screen attribute tags. Please use these versions, not those in + * iobsolete.h. + } +CONST + SA_Dummy = (TAG_USER + 32); +{ + * these items specify items equivalent to fields in NewScreen + } + SA_Left = (SA_Dummy + $0001); + SA_Top = (SA_Dummy + $0002); + SA_Width = (SA_Dummy + $0003); + SA_Height = (SA_Dummy + $0004); + { traditional screen positions and dimensions } + SA_Depth = (SA_Dummy + $0005); + { screen bitmap depth } + SA_DetailPen= (SA_Dummy + $0006); + { serves as default for windows, too } + SA_BlockPen = (SA_Dummy + $0007); + SA_Title = (SA_Dummy + $0008); + { default screen title } + SA_Colors = (SA_Dummy + $0009); + { ti_Data is an array of struct ColorSpec, + * terminated by ColorIndex = -1. Specifies + * initial screen palette colors. + } + SA_ErrorCode= (SA_Dummy + $000A); + { ti_Data points to LONG error code (values below)} + SA_Font = (SA_Dummy + $000B); + { equiv. to NewScreen.Font } + SA_SysFont = (SA_Dummy + $000C); + { Selects one of the preferences system fonts: + * 0 - old DefaultFont, fixed-width + * 1 - WB Screen preferred font + } + SA_Type = (SA_Dummy + $000D); + { equiv. to NewScreen.Type } + SA_BitMap = (SA_Dummy + $000E); + { ti_Data is pointer to custom BitMap. This + * implies type of CUSTOMBITMAP + } + SA_PubName = (SA_Dummy + $000F); + { presence of this tag means that the screen + * is to be a public screen. Please specify + * BEFORE the two tags below + } + SA_PubSig = (SA_Dummy + $0010); + SA_PubTask = (SA_Dummy + $0011); + { Task ID and signal for being notified that + * the last window has closed on a public screen. + } + SA_DisplayID= (SA_Dummy + $0012); + { ti_Data is new extended display ID from + * <graphics/displayinfo.h>. + } + SA_DClip = (SA_Dummy + $0013); + { ti_Data points to a rectangle which defines + * screen display clip region + } + SA_Overscan = (SA_Dummy + $0014); + { was S_STDDCLIP. Set to one of the OSCAN_ + * specifiers below to get a system standard + * overscan region for your display clip, + * screen dimensions (unless otherwise specified), + * and automatically centered position (partial + * support only so far). + * If you use this, you shouldn't specify + * SA_DClip. SA_Overscan is for "standard" + * overscan dimensions, SA_DClip is for + * your custom numeric specifications. + } + SA_Obsolete1= (SA_Dummy + $0015); + { obsolete S_MONITORNAME } + +{* booleans *} + SA_ShowTitle = (SA_Dummy + $0016); + { boolean equivalent to flag SHOWTITLE } + SA_Behind = (SA_Dummy + $0017); + { boolean equivalent to flag SCREENBEHIND } + SA_Quiet = (SA_Dummy + $0018); + { boolean equivalent to flag SCREENQUIET } + SA_AutoScroll = (SA_Dummy + $0019); + { boolean equivalent to flag AUTOSCROLL } + SA_Pens = (SA_Dummy + $001A); + { pointer to ~0 terminated UWORD array, as + * found in struct DrawInfo + } + SA_FullPalette= (SA_Dummy + $001B); + { boolean: initialize color table to entire + * preferences palette (32 for V36), rather + * than compatible pens 0-3, 17-19, with + * remaining palette as returned by GetColorMap() + } + + SA_ColorMapEntries = (SA_Dummy + $001C); + { New for V39: + * Allows you to override the number of entries + * in the ColorMap for your screen. Intuition + * normally allocates (1<<depth) or 32, whichever + * is more, but you may require even more if you + * use certain V39 graphics.library features + * (eg. palette-banking). + } + + SA_Parent = (SA_Dummy + $001D); + { New for V39: + * ti_Data is a pointer to a "parent" screen to + * attach this one to. Attached screens slide + * and depth-arrange together. + } + + SA_Draggable = (SA_Dummy + $001E); + { New for V39: + * Boolean tag allowing non-draggable screens. + * Do not use without good reason! + * (Defaults to TRUE). + } + + SA_Exclusive = (SA_Dummy + $001F); + { New for V39: + * Boolean tag allowing screens that won't share + * the display. Use sparingly! Starting with 3.01, + * attached screens may be SA_Exclusive. Setting + * SA_Exclusive for each screen will produce an + * exclusive family. (Defaults to FALSE). + } + + SA_SharePens = (SA_Dummy + $0020); + { New for V39: + * For those pens in the screen's DrawInfo->dri_Pens, + * Intuition obtains them in shared mode (see + * graphics.library/ObtainPen()). For compatibility, + * Intuition obtains the other pens of a public + * screen as PEN_EXCLUSIVE. Screens that wish to + * manage the pens themselves should generally set + * this tag to TRUE. This instructs Intuition to + * leave the other pens unallocated. + } + + SA_BackFill = (SA_Dummy + $0021); + { New for V39: + * provides a "backfill hook" for your screen's + * Layer_Info. + * See layers.library/InstallLayerInfoHook() + } + + SA_Interleaved = (SA_Dummy + $0022); + { New for V39: + * Boolean tag requesting that the bitmap + * allocated for you be interleaved. + * (Defaults to FALSE). + } + + SA_Colors32 = (SA_Dummy + $0023); + { New for V39: + * Tag to set the screen's initial palette colors + * at 32 bits-per-gun. ti_Data is a pointer + * to a table to be passed to the + * graphics.library/LoadRGB32() function. + * This format supports both runs of color + * registers and sparse registers. See the + * autodoc for that function for full details. + * Any color set here has precedence over + * the same register set by SA_Colors. + } + + SA_VideoControl = (SA_Dummy + $0024); + { New for V39: + * ti_Data is a pointer to a taglist that Intuition + * will pass to graphics.library/VideoControl(), + * upon opening the screen. + } + + SA_FrontChild = (SA_Dummy + $0025); + { New for V39: + * ti_Data is a pointer to an already open screen + * that is to be the child of the screen being + * opened. The child screen will be moved to the + * front of its family. + } + + SA_BackChild = (SA_Dummy + $0026); + { New for V39: + * ti_Data is a pointer to an already open screen + * that is to be the child of the screen being + * opened. The child screen will be moved to the + * back of its family. + } + + SA_LikeWorkbench = (SA_Dummy + $0027); + { New for V39: + * Set ti_Data to 1 to request a screen which + * is just like the Workbench. This gives + * you the same screen mode, depth, size, + * colors, etc., as the Workbench screen. + } + + SA_Reserved = (SA_Dummy + $0028); + { Reserved for private Intuition use } + + SA_MinimizeISG = (SA_Dummy + $0029); + { New for V40: + * For compatibility, Intuition always ensures + * that the inter-screen gap is at least three + * non-interlaced lines. If your application + * would look best with the smallest possible + * inter-screen gap, set ti_Data to TRUE. + * If you use the new graphics VideoControl() + * VC_NoColorPaletteLoad tag for your screen's + * ViewPort, you should also set this tag. + } + + +{ this is an obsolete tag included only for compatibility with V35 + * interim release for the A2024 and Viking monitors + } + NSTAG_EXT_VPMODE = (TAG_USER + 1); + + +{ OpenScreen error codes, which are returned in the (optional) LONG + * pointed to by ti_Data for the SA_ErrorCode tag item + } + OSERR_NOMONITOR = (1); { named monitor spec not available } + OSERR_NOCHIPS = (2); { you need newer custom chips } + OSERR_NOMEM = (3); { couldn't get normal memory } + OSERR_NOCHIPMEM = (4); { couldn't get chipmem } + OSERR_PUBNOTUNIQUE= (5); { public screen name already used } + OSERR_UNKNOWNMODE = (6); { don't recognize mode asked for } + +{ ======================================================================== } +{ === NewScreen ========================================================== } +{ ======================================================================== } + +Type + + pNewScreen = ^tNewScreen; + tNewScreen = record + LeftEdge, + TopEdge, + Width, + Height, + Depth : smallint; { screen dimensions } + + DetailPen, + BlockPen : Byte; { for bar/border/gadget rendering } + + ViewModes : Word; { the Modes for the ViewPort (and View) } + + SType : Word; { the Screen type (see defines above) } + + Font : pTextAttr; { this Screen's default text attributes } + + DefaultTitle : PChar; { the default title for this Screen } + + Gadgets : pGadget; { your own Gadgets for this Screen } + + { if you are opening a CUSTOMSCREEN and already have a BitMap + * that you want used for your Screen, you set the flags CUSTOMBITMAP in + * the Type field and you set this variable to point to your BitMap + * structure. The structure will be copied into your Screen structure, + * after which you may discard your own BitMap if you want + } + + CustomBitMap : pBitMap; + end; + + +type + + pExtNewScreen = ^tExtNewScreen; + tExtNewScreen = record + LeftEdge, TopEdge, Width, Height, Depth : smallint; + DetailPen, BlockPen : Byte; + ViewModes : Word; + ens_Type : Word; { Type in C-Includes } + Font : pTextAttr; + DefaultTitle : PChar; + Gadgets : pGadget; + CustomBitMap : pBitMap; + Extension : pTagItem; + END; + + +CONST +{ === Overscan Types === } + OSCAN_TEXT = (1); { entirely visible } + OSCAN_STANDARD = (2); { just past edges } + OSCAN_MAX = (3); { as much as possible } + OSCAN_VIDEO = (4); { even more than is possible } + + +{ === Public Shared Screen Node === } + +{ This is the representative of a public shared screen. + * This is an internal data structure, but some functions may + * present a copy of it to the calling application. In that case, + * be aware that the screen pointer of the structure can NOT be + * used safely, since there is no guarantee that the referenced + * screen will remain open and a valid data structure. + * + * Never change one of these. + } + +Type + pPubScreenNode = ^tPubScreenNode; + tPubScreenNode = record + psn_Node : tNode; { ln_Name is screen name } + psn_Screen : pScreen; + psn_Flags : Word; { below } + psn_Size : smallint; { includes name buffer } + psn_VisitorCount : smallint; { how many visitor windows } + psn_SigTask : pTask; { who to signal when visitors gone } + psn_SigBit : Byte; { which signal } + END; + +CONST + PSNF_PRIVATE = ($0001); + + MAXPUBSCREENNAME = (139); { names no longer, please } + +{ pub screen modes } + SHANGHAI = $0001; { put workbench windows on pub screen } + POPPUBSCREEN = $0002; { pop pub screen to front when visitor opens } + +{ New for V39: Intuition has new screen depth-arrangement and movement + * functions called ScreenDepth() and ScreenPosition() respectively. + * These functions permit the old behavior of ScreenToFront(), + * ScreenToBack(), and MoveScreen(). ScreenDepth() also allows + * independent depth control of attached screens. ScreenPosition() + * optionally allows positioning screens even though they were opened + * (SA_Draggable,FALSE). + } + +{ For ScreenDepth(), specify one of SDEPTH_TOFRONT or SDEPTH_TOBACK, + * and optionally also SDEPTH_INFAMILY. + * + * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify + * SDEPTH_INFAMILY. Commodities, "input helper" programs, + * or any other program that did not open a screen should never + * use that flag. (Note that this is a style-behavior + * requirement; there is no technical requirement that the + * task calling this function need be the task which opened + * the screen). + } + + SDEPTH_TOFRONT = (0); { Bring screen to front } + SDEPTH_TOBACK = (1); { Send screen to back } + SDEPTH_INFAMILY = (2); { Move an attached screen with + * respect to other screens of + * its family + } + +{ Here's an obsolete name equivalent to SDEPTH_INFAMILY: } + SDEPTH_CHILDONLY = SDEPTH_INFAMILY; + + +{ For ScreenPosition(), specify one of SPOS_RELATIVE, SPOS_ABSOLUTE, + * or SPOS_MAKEVISIBLE to describe the kind of screen positioning you + * wish to perform: + * + * SPOS_RELATIVE: The x1 and y1 parameters to ScreenPosition() describe + * the offset in coordinates you wish to move the screen by. + * SPOS_ABSOLUTE: The x1 and y1 parameters to ScreenPosition() describe + * the absolute coordinates you wish to move the screen to. + * SPOS_MAKEVISIBLE: (x1,y1)-(x2,y2) describes a rectangle on the + * screen which you would like autoscrolled into view. + * + * You may additionally set SPOS_FORCEDRAG along with any of the + * above. Set this if you wish to reposition an (SA_Draggable,FALSE) + * screen that you opened. + * + * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify + * SPOS_FORCEDRAG. Commodities, "input helper" programs, + * or any other program that did not open a screen should never + * use that flag. + } + + SPOS_RELATIVE = (0); { Coordinates are relative } + + SPOS_ABSOLUTE = (1); { Coordinates are expressed as + * absolutes, not relatives. + } + + SPOS_MAKEVISIBLE = (2); { Coordinates describe a box on + * the screen you wish to be + * made visible by autoscrolling + } + + SPOS_FORCEDRAG = (4); { Move non-draggable screen } + +{ New for V39: Intuition supports double-buffering in screens, + * with friendly interaction with menus and certain gadgets. + * For each buffer, you need to get one of these structures + * from the AllocScreenBuffer() call. Never allocate your + * own ScreenBuffer structures! + * + * The sb_DBufInfo field is for your use. See the graphics.library + * AllocDBufInfo() autodoc for details. + } +Type + + pScreenBuffer = ^tScreenBuffer; + tScreenBuffer = record + sb_BitMap : pBitMap; { BitMap of this buffer } + sb_DBufInfo : pDBufInfo; { DBufInfo for this buffer } + end; + +const +{ These are the flags that may be passed to AllocScreenBuffer(). + } + SB_SCREEN_BITMAP = 1; + SB_COPY_BITMAP = 2; + + +{ ======================================================================== } +{ === Preferences ======================================================== } +{ ======================================================================== } + +Const + +{ these are the definitions for the printer configurations } + FILENAME_SIZE = 30; { Filename size } + + POINTERSIZE = (1 + 16 + 1) * 2; { Size of Pointer data buffer } + +{ These defines are for the default font size. These actually describe the + * height of the defaults fonts. The default font type is the topaz + * font, which is a fixed width font that can be used in either + * eighty-column or sixty-column mode. The Preferences structure reflects + * which is currently selected by the value found in the variable FontSize, + * which may have either of the values defined below. These values actually + * are used to select the height of the default font. By changing the + * height, the resolution of the font changes as well. + } + TOPAZ_EIGHTY = 8; + TOPAZ_SIXTY = 9; + +Type + + pPreferences = ^tPreferences; + tPreferences = record + { the default font height } + FontHeight : Shortint; { height for system default font } + + { constant describing what's hooked up to the port } + PrinterPort : Byte; { printer port connection } + + { the baud rate of the port } + BaudRate : Word; { baud rate for the serial port } + + { various timing rates } + KeyRptSpeed : ttimeval; { repeat speed for keyboard } + KeyRptDelay : ttimeval; { Delay before keys repeat } + DoubleClick : ttimeval; { Interval allowed between clicks } + + { Intuition Pointer data } + PointerMatrix : Array [0..POINTERSIZE-1] of Word; + { Definition of pointer sprite } + XOffset : Shortint; { X-Offset for active 'bit' } + YOffset : Shortint; { Y-Offset for active 'bit' } + color17 : Word; {*********************************} + color18 : Word; { Colours for sprite pointer } + color19 : Word; {*********************************} + PointerTicks : Word; { Sensitivity of the pointer } + + { Workbench Screen colors } + color0 : Word; {*********************************} + color1 : Word; { Standard default colours } + color2 : Word; { Used in the Workbench } + color3 : Word; {*********************************} + + { positioning data for the Intuition View } + ViewXOffset : Shortint; { Offset for top lefthand corner } + ViewYOffset : Shortint; { X and Y dimensions } + ViewInitX, + ViewInitY : smallint; { View initial offset values } + + EnableCLI : Boolean; { CLI availability switch } + + { printer configurations } + PrinterType : Word; { printer type } + PrinterFilename : Array [0..FILENAME_SIZE-1] of Char; + { file for printer } + + { print format and quality configurations } + PrintPitch : Word; { print pitch } + PrintQuality : Word; { print quality } + PrintSpacing : Word; { number of lines per inch } + PrintLeftMargin : Word; { left margin in characters } + PrintRightMargin : Word; { right margin in characters } + PrintImage : Word; { positive or negative } + PrintAspect : Word; { horizontal or vertical } + PrintShade : Word; { b&w, half-tone, or color } + PrintThreshold : smallint; { darkness ctrl for b/w dumps } + + { print paper descriptors } + PaperSize : Word; { paper size } + PaperLength : Word; { paper length in number of lines } + PaperType : Word; { continuous or single sheet } + + { Serial device settings: These are six nibble-fields in three bytes } + { (these look a little strange so the defaults will map out to zero) } + SerRWBits : Byte; + { upper nibble = (8-number of read bits) } + { lower nibble = (8-number of write bits) } + SerStopBuf : Byte; + { upper nibble = (number of stop bits - 1) } + { lower nibble = (table value for BufSize) } + SerParShk : Byte; + { upper nibble = (value for Parity setting) } + { lower nibble = (value for Handshake mode) } + LaceWB : Byte; { if workbench is to be interlaced } + + WorkName : Array [0..FILENAME_SIZE-1] of Char; + { temp file for printer } + + RowSizeChange : Shortint; + ColumnSizeChange : Shortint; + + PrintFlags : Word; { user preference flags } + PrintMaxWidth : Word; { max width of printed picture in 10ths/inch } + PrintMaxHeight : Word; { max height of printed picture in 10ths/inch } + PrintDensity : Byte; { print density } + PrintXOffset : Byte; { offset of printed picture in 10ths/inch } + + wb_Width : Word; { override default workbench width } + wb_Height : Word; { override default workbench height } + wb_Depth : Byte; { override default workbench depth } + + ext_size : Byte; { extension information -- do not touch! } + { extension size in blocks of 64 bytes } + end; + +Const + +{ Workbench Interlace (use one bit) } + LACEWB = $01; + LW_RESERVED = 1; { internal use only } + +{ PrinterPort } + PARALLEL_PRINTER = $00; + SERIAL_PRINTER = $01; + +{ BaudRate } + BAUD_110 = $00; + BAUD_300 = $01; + BAUD_1200 = $02; + BAUD_2400 = $03; + BAUD_4800 = $04; + BAUD_9600 = $05; + BAUD_19200 = $06; + BAUD_MIDI = $07; + +{ PaperType } + FANFOLD_PT = $00; + SINGLE_PT = $80; + +{ PrintPitch } + PICA = $000; + ELITE = $400; + FINE = $800; + +{ PrintQuality } + DRAFT = $000; + LETTER = $100; + +{ PrintSpacing } + SIX_LPI = $000; + EIGHT_LPI = $200; + +{ Print Image } + IMAGE_POSITIVE = $00; + IMAGE_NEGATIVE = $01; + +{ PrintAspect } + ASPECT_HORIZ = $00; + ASPECT_VERT = $01; + +{ PrintShade } + SHADE_BW = $00; + SHADE_GREYSCALE = $01; + SHADE_COLOR = $02; + +{ PaperSize } + US_LETTER = $00; + US_LEGAL = $10; + N_TRACTOR = $20; + W_TRACTOR = $30; + CUSTOM_PAPER = $40; + +{ New PaperSizes for V36: } + EURO_A0 = $50; { European size A0: 841 x 1189 } + EURO_A1 = $60; { European size A1: 594 x 841 } + EURO_A2 = $70; { European size A2: 420 x 594 } + EURO_A3 = $80; { European size A3: 297 x 420 } + EURO_A4 = $90; { European size A4: 210 x 297 } + EURO_A5 = $A0; { European size A5: 148 x 210 } + EURO_A6 = $B0; { European size A6: 105 x 148 } + EURO_A7 = $C0; { European size A7: 74 x 105 } + EURO_A8 = $D0; { European size A8: 52 x 74 } + +{ PrinterType } + CUSTOM_NAME = $00; + ALPHA_P_101 = $01; + BROTHER_15XL = $02; + CBM_MPS1000 = $03; + DIAB_630 = $04; + DIAB_ADV_D25 = $05; + DIAB_C_150 = $06; + EPSON = $07; + EPSON_JX_80 = $08; + OKIMATE_20 = $09; + QUME_LP_20 = $0A; +{ new printer entries, 3 October 1985 } + HP_LASERJET = $0B; + HP_LASERJET_PLUS = $0C; + +{ Serial Input Buffer Sizes } + SBUF_512 = $00; + SBUF_1024 = $01; + SBUF_2048 = $02; + SBUF_4096 = $03; + SBUF_8000 = $04; + SBUF_16000 = $05; + +{ Serial Bit Masks } + SREAD_BITS = $F0; { for SerRWBits } + SWRITE_BITS = $0F; + + SSTOP_BITS = $F0; { for SerStopBuf } + SBUFSIZE_BITS = $0F; + + SPARITY_BITS = $F0; { for SerParShk } + SHSHAKE_BITS = $0F; + +{ Serial Parity (upper nibble, after being shifted by + * macro SPARNUM() ) + } + SPARITY_NONE = 0; + SPARITY_EVEN = 1; + SPARITY_ODD = 2; + +{ Serial Handshake Mode (lower nibble, after masking using + * macro SHANKNUM() ) + } + SHSHAKE_XON = 0; + SHSHAKE_RTS = 1; + SHSHAKE_NONE = 2; + +{ new defines for PrintFlags } + + CORRECT_RED = $0001; { color correct red shades } + CORRECT_GREEN = $0002; { color correct green shades } + CORRECT_BLUE = $0004; { color correct blue shades } + + CENTER_IMAGE = $0008; { center image on paper } + + IGNORE_DIMENSIONS = $0000; { ignore max width/height settings } + BOUNDED_DIMENSIONS = $0010; { use max width/height as boundaries } + ABSOLUTE_DIMENSIONS = $0020; { use max width/height as absolutes } + PIXEL_DIMENSIONS = $0040; { use max width/height as prt pixels } + MULTIPLY_DIMENSIONS = $0080; { use max width/height as multipliers } + + INTEGER_SCALING = $0100; { force integer scaling } + + ORDERED_DITHERING = $0000; { ordered dithering } + HALFTONE_DITHERING = $0200; { halftone dithering } + FLOYD_DITHERING = $0400; { Floyd-Steinberg dithering } + + ANTI_ALIAS = $0800; { anti-alias image } + GREY_SCALE2 = $1000; { for use with hi-res monitor } + +{ masks used for checking bits } + + CORRECT_RGB_MASK = CORRECT_RED + CORRECT_GREEN + CORRECT_BLUE; + DIMENSIONS_MASK = BOUNDED_DIMENSIONS + ABSOLUTE_DIMENSIONS + + PIXEL_DIMENSIONS + MULTIPLY_DIMENSIONS; + DITHERING_MASK = HALFTONE_DITHERING + FLOYD_DITHERING; + + + + + + +{ ======================================================================== } +{ === IntuitionBase ====================================================== } +{ ======================================================================== } +{ + * Be sure to protect yourself against someone modifying these data as + * you look at them. This is done by calling: + * + * lock = LockIBase(0), which returns an Integer. When done call + * UnlockIBase(lock) where lock is what LockIBase() returned. + } + +Type + + pIntuitionBase = ^tIntuitionBase; + tIntuitionBase = record +{ IntuitionBase should never be directly modified by programs } +{ even a little bit, guys/gals; do you hear me? } + + LibNode : tLibrary; + + ViewLord : tView; + + ActiveWindow : pWindow; + ActiveScreen : pScreen; + + { the FirstScreen variable points to the frontmost Screen. Screens are + * then maintained in a front to back order using Screen.NextScreen + } + + FirstScreen : pScreen; { for linked list of all screens } + + Flags : Cardinal; { see definitions below } + MouseY, + MouseX : smallint; { mouse position relative to View } + + Seconds : Cardinal; { timestamp of most current input event } + Micros : Cardinal; { timestamp of most current input event } + + { I told you this was private. + * The data beyond this point has changed, is changing, and + * will continue to change. + } + + end; + + +{ + * Package of information passed to custom and 'boopsi' + * gadget 'hook' functions. This structure is READ ONLY. + } +Type + + pGadgetInfo = ^tGadgetInfo; + tGadgetInfo = record + gi_Screen : pScreen; { ScreenPtr } + gi_Window : pWindow; { null for screen gadgets } { WindowPtr } + gi_Requester : pRequester; { null IF not GTYP_REQGADGET } { RequesterPtr } + + { rendering information: + * don't use these without cloning/locking. + * Official way is to call ObtainRPort() + } + gi_RastPort : pRastPort; { RastPortPtr } + gi_Layer : pLayer; { LayerPtr } + + { copy of dimensions of screen/window/g00/req(/group) + * that gadget resides in. Left/Top of this box is + * offset from window mouse coordinates to gadget coordinates + * screen gadgets: 0,0 (from screen coords) + * window gadgets (no g00): 0,0 + * GTYP_GZZGADGETs (borderlayer): 0,0 + * GZZ innerlayer gadget: borderleft, bordertop + * Requester gadgets: reqleft, reqtop + } + gi_Domain : tIBox; + + gi_Pens : record + DetailPen : Byte; + BlockPen : Byte; + end; + + { the Detail and Block pens in gi_DrInfo->dri_Pens[] are + * for the screen. Use the above for window-sensitive + * colors. + } + gi_DrInfo : pDrawInfo; { DrawInfoPtr } + + { reserved space: this structure is extensible + * anyway, but using these saves some recompilation + } + gi_Reserved : Array[0..5] of Cardinal; + END; + +{** system private data structure for now **} +{ prop gadget extra info } + + pPGX = ^tPGX; + tPGX = record + pgx_Container : tIBox; + pgx_NewKnob : tIBox; + END; + +{ this casts MutualExclude for easy assignment of a hook + * pointer to the unused MutualExclude field of a custom gadget + } + +{** User visible handles on objects, classes, messages **} +Type + Object_ = Cardinal; + pObject_ = ^Object_; + ClassID = ^Byte; + +{ + you can use this type to point to a 'generic' message, + * in the object-oriented programming parlance. Based on + * the value of 'MethodID', you dispatch to processing + * for the various message types. The meaningful parameter + * packet structure definitions are defined below. + +typedef struct + Cardinal MethodID; + method-specific data follows, some examples below + *Msg; } + + pMsg = ^tMsg; + tMsg = record + MethodID : Cardinal; + end; + +{ + * Class id strings for Intuition classes. + * There's no real reason to use the uppercase constants + * over the lowercase strings, but this makes a good place + * to list the names of the built-in classes. + } +CONST + ROOTCLASS : PChar = 'rootclass' ; { classusr.h } + IMAGECLASS : PChar = 'imageclass' ; { imageclass.h } + FRAMEICLASS : PChar = 'frameiclass' ; + SYSICLASS : PChar = 'sysiclass' ; + FILLRECTCLASS : PChar = 'fillrectclass'; + GADGETCLASS : PChar = 'gadgetclass' ; { gadgetclass.h } + PROPGCLASS : PChar = 'propgclass' ; + STRGCLASS : PChar = 'strgclass' ; + BUTTONGCLASS : PChar = 'buttongclass' ; + FRBUTTONCLASS : PChar = 'frbuttonclass'; + GROUPGCLASS : PChar = 'groupgclass' ; + ICCLASS : PChar = 'icclass' ; { icclass.h } + MODELCLASS : PChar = 'modelclass' ; + ITEXTICLASS : PChar = 'itexticlass' ; + POINTERCLASS : PChar = 'pointerclass' ; { pointerclass.h } + + +{ Dispatched method ID's + * NOTE: Applications should use Intuition entry points, not direct + * DoMethod() calls, for NewObject, DisposeObject, SetAttrs, + * SetGadgetAttrs, and GetAttr. + } + + OM_Dummy = ($100); + OM_NEW = ($101); { 'object' parameter is 'true class' } + OM_DISPOSE = ($102); { delete self (no parameters) } + OM_SET = ($103); { set attributes (in tag list) } + OM_GET = ($104); { return single attribute value } + OM_ADDTAIL = ($105); { add self to a List (let root do it) } + OM_REMOVE = ($106); { remove self from list } + OM_NOTIFY = ($107); { send to self: notify dependents } + OM_UPDATE = ($108); { notification message from somebody } + OM_ADDMEMBER = ($109); { used by various classes with lists } + OM_REMMEMBER = ($10A); { used by various classes with lists } + +{ Parameter 'Messages' passed to methods } + +{ OM_NEW and OM_SET } +Type + popSet = ^topSet; + topSet = record + MethodID : Cardinal; + ops_AttrList : pTagItem; { new attributes } + ops_GInfo : pGadgetInfo; { always there for gadgets, + * when SetGadgetAttrs() is used, + * but will be NULL for OM_NEW + } + END; + +{ OM_NOTIFY, and OM_UPDATE } + + popUpdate = ^topUpdate; + topUpdate = record + MethodID : Cardinal; + opu_AttrList : pTagItem; { new attributes } + opu_GInfo : pGadgetInfo; { non-NULL when SetGadgetAttrs OR + * notification resulting from gadget + * input occurs. + } + opu_Flags : Cardinal; { defined below } + END; + +{ this flag means that the update message is being issued from + * something like an active gadget, a la GACT_FOLLOWMOUSE. When + * the gadget goes inactive, it will issue a final update + * message with this bit cleared. Examples of use are for + * GACT_FOLLOWMOUSE equivalents for propgadclass, and repeat strobes + * for buttons. + } +CONST + OPUF_INTERIM = 1; + +{ OM_GET } +Type + + popGet = ^topGet; + topGet = record + MethodID, + opg_AttrID : Cardinal; + opg_Storage : Pointer; { may be other types, but 'int' + * types are all Cardinal + } + END; + +{ OM_ADDTAIL } + + popAddTail = ^topAddTail; + topAddTail = record + MethodID : Cardinal; + opat_List : pList; + END; + +{ OM_ADDMEMBER, OM_REMMEMBER } +Type + + popMember = ^topMember; + topMember = record + MethodID : Cardinal; + opam_Object : pObject_; + END; + + + +{*****************************************} +{** 'White box' access to struct IClass **} +{*****************************************} + +{ This structure is READ-ONLY, and allocated only by Intuition } +TYPE + + pIClass = ^tIClass; + tIClass = record + cl_Dispatcher : tHook; + cl_Reserved : Cardinal; { must be 0 } + cl_Super : pIClass; + cl_ID : ClassID; + + { where within an object is the instance data for this class? } + cl_InstOffset : Word; + cl_InstSize : Word; + + cl_UserData : Cardinal; { per-class data of your choice } + cl_SubclassCount : Cardinal; + { how many direct subclasses? } + cl_ObjectCount : Cardinal; + { how many objects created of this class? } + cl_Flags : Cardinal; + END; + +CONST + CLF_INLIST = $00000001; { class is in public class list } + + + +{************************************************} +{** 'White box' access to struct _Object **} +{************************************************} + +{ + * We have this, the instance data of the root class, PRECEDING + * the 'object'. This is so that Gadget objects are Gadget pointers, + * and so on. If this structure grows, it will always have o_Class + * at the end, so the macro OCLASS(o) will always have the same + * offset back from the pointer returned from NewObject(). + * + * This data structure is subject to change. Do not use the o_Node + * embedded structure. + } +Type + p_Object = ^t_Object; + t_Object = record + o_Node : tMinNode; + o_Class : pIClass; + END; + +{ BOOPSI class libraries should use this structure as the base for their + * library data. This allows developers to obtain the class pointer for + * performing object-less inquiries. } + + + PClassLibrary = ^tClassLibrary; + tClassLibrary = record + cl_Lib : tLibrary; { Embedded library } + cl_Pad : Word; { Align the structure } + cl_Class : PIClass; { Class pointer } + end; + +{ + * NOTE: <intuition/iobsolete.h> is included at the END of this file! + } + +{ Gadget Class attributes } +CONST + GA_Dummy = (TAG_USER +$30000); + + { (LONG) Left edge of the gadget relative to the left edge of + * the window } + GA_Left = (GA_Dummy + $0001); + + { (LONG) Left edge of the gadget relative to the right edge of + * the window } + GA_RelRight = (GA_Dummy + $0002); + + { (LONG) Top edge of the gadget relative to the top edge of + * the window } + GA_Top = (GA_Dummy + $0003); + + { (LONG) Top edge of the gadget relative to the bottom edge + * of the window } + GA_RelBottom = (GA_Dummy + $0004); + + { (LONG) Width of the gadget } + GA_Width = (GA_Dummy + $0005); + + { (LONG) Width of the gadget relative to the width of the + * window } + GA_RelWidth = (GA_Dummy + $0006); + + { (LONG) Height of the gadget } + GA_Height = (GA_Dummy + $0007); + + { (LONG) Height of the gadget relative to the height of + * the window } + GA_RelHeight = (GA_Dummy + $0008); + + { (PChar) Gadget imagry is NULL terminated string } + GA_Text = (GA_Dummy + $0009); { ti_Data is (UBYTE *) } + + { (struct Image *) Gadget imagry is an image } + GA_Image = (GA_Dummy + $000A); + + { (struct Border *) Gadget imagry is a border } + GA_Border = (GA_Dummy + $000B); + + { (struct Image *) Selected gadget imagry } + GA_SelectRender = (GA_Dummy + $000C); + + { (UWORD) One of GFLG_GADGHNONE, GFLG_GADGHBOX, GFLG_GADGHCOMP, + * or GFLG_GADGHIMAGE } + GA_Highlight = (GA_Dummy + $000D); + + { (BOOL) Indicate whether gadget is disabled or not. + * Defaults to FALSE. } + GA_Disabled = (GA_Dummy + $000E); + + { (BOOL) Indicate whether the gadget is for + * WFLG_GIMMEZEROZERO window borders or not. Defaults + * to FALSE. } + GA_GZZGadget = (GA_Dummy + $000F); + + { (UWORD) Gadget ID assigned by the application } + GA_ID = (GA_Dummy + $0010); + + { (APTR) Application specific data } + GA_UserData = (GA_Dummy + $0011); + + { (APTR) Gadget specific data } + GA_SpecialInfo = (GA_Dummy + $0012); + + { (BOOL) Indicate whether the gadget is selected or not. + * Defaults to FALSE } + GA_Selected = (GA_Dummy + $0013); + + { (BOOL) When set tells the system that when this gadget + * is selected causes the requester that it is in to be + * ended. Defaults to FALSE. } + GA_EndGadget = (GA_Dummy + $0014); + + { (BOOL) When set indicates that the gadget is to + * notify the application when it becomes active. Defaults + * to FALSE. } + GA_Immediate = (GA_Dummy + $0015); + + { (BOOL) When set indicates that the application wants to + * verify that the pointer was still over the gadget when + * the select button is released. Defaults to FALSE. } + GA_RelVerify = (GA_Dummy + $0016); + + { (BOOL) When set indicates that the application wants to + * be notified of mouse movements while the gadget is active. + * It is recommmended that GA_Immediate and GA_RelVerify are + * also used so that the active gadget can be tracked by the + * application. Defaults to FALSE. } + GA_FollowMouse = (GA_Dummy + $0017); + + { (BOOL) Indicate whether the gadget is in the right border + * or not. Defaults to FALSE. } + GA_RightBorder = (GA_Dummy + $0018); + + { (BOOL) Indicate whether the gadget is in the left border + * or not. Defaults to FALSE. } + GA_LeftBorder = (GA_Dummy + $0019); + + { (BOOL) Indicate whether the gadget is in the top border + * or not. Defaults to FALSE. } + GA_TopBorder = (GA_Dummy + $001A); + + { (BOOL) Indicate whether the gadget is in the bottom border + * or not. Defaults to FALSE. } + GA_BottomBorder = (GA_Dummy + $001B); + + { (BOOL) Indicate whether the gadget is toggle-selected + * or not. Defaults to FALSE. } + GA_ToggleSelect = (GA_Dummy + $001C); + + { (BOOL) Reserved for system use to indicate that the + * gadget belongs to the system. Defaults to FALSE. } + GA_SysGadget = (GA_Dummy + $001D); + + { (UWORD) Reserved for system use to indicate the + * gadget type. } + GA_SysGType = (GA_Dummy + $001E); + + { (struct Gadget *) Previous gadget in the linked list. + * NOTE: This attribute CANNOT be used to link new gadgets + * into the gadget list of an open window or requester. + * You must use AddGList(). } + GA_Previous = (GA_Dummy + $001F); + + { (struct Gadget *) Next gadget in the linked list. } + GA_Next = (GA_Dummy + $0020); + + { (struct DrawInfo *) Some gadgets need a DrawInfo at creation time } + GA_DrawInfo = (GA_Dummy + $0021); + + { You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage } + { (struct IntuiText *) Label is an IntuiText. } + GA_IntuiText = (GA_Dummy + $0022); + + { (Object *) Label is an image object. } + GA_LabelImage = (GA_Dummy + $0023); + + { New for V37: + * Boolean indicates that this gadget is to participate in + * cycling activation with Tab or Shift-Tab. + } + GA_TabCycle = (GA_Dummy + $0024); + + { New for V39: + * Boolean indicates that this gadget sends gadget-help + } + GA_GadgetHelp = (GA_Dummy + $0025); + + { New for V39: + * ti_Data is a pointer to an IBox structure which is + * to be copied into the extended gadget's bounds. + } + GA_Bounds = (GA_Dummy + $0026); + + { New for V39: + * Boolean indicates that this gadget has the "special relativity" + * property, which is useful for certain fancy relativity + * operations through the GM_LAYOUT method. + } + GA_RelSpecial = (GA_Dummy + $0027); + + + GA_TextAttr = GA_Dummy + 40; + { (struct TextAttr ) Indicate the font to use for the gadget. + New for V42. } + + GA_ReadOnly = GA_Dummy + 41; + { (BOOL) Indicate that the gadget is read-only (non-selectable). + Defaults to FALSE. New for V42. } + + GA_Underscore = GA_Dummy + 42; + { (UBYTE) Underscore/escape character for keyboard shortcuts. + Defaults to '_' . New for V44. } + + GA_ActivateKey = GA_Dummy + 43; + { (PChar) Set/Get the gadgets shortcut/activation key(s) + Defaults to NULL. New for V44. } + + GA_BackFill = GA_Dummy + 44; + { (struct Hook ) Backfill pattern hook. + Defaults to NULL. New for V44. } + + GA_GadgetHelpText = GA_Dummy + 45; + { (PChar) RESERVERD/PRIVATE DO NOT USE + Defaults to NULL. New for V44. } + + GA_UserInput = GA_Dummy + 46; + { (BOOL) Notification tag indicates this notification is from the activite + gadget receiving user input - an attempt to make IDCMPUPDATE more efficient. + Defaults to FALSE. New for V44. } +{ PROPGCLASS attributes } + + PGA_Dummy = (TAG_USER + $31000); + PGA_Freedom = (PGA_Dummy + $0001); + { only one of FREEVERT or FREEHORIZ } + PGA_Borderless = (PGA_Dummy + $0002); + PGA_HorizPot = (PGA_Dummy + $0003); + PGA_HorizBody = (PGA_Dummy + $0004); + PGA_VertPot = (PGA_Dummy + $0005); + PGA_VertBody = (PGA_Dummy + $0006); + PGA_Total = (PGA_Dummy + $0007); + PGA_Visible = (PGA_Dummy + $0008); + PGA_Top = (PGA_Dummy + $0009); +{ New for V37: } + PGA_NewLook = (PGA_Dummy + $000A); + +{ STRGCLASS attributes } + + STRINGA_Dummy = (TAG_USER +$32000); + STRINGA_MaxChars = (STRINGA_Dummy + $0001); + STRINGA_Buffer = (STRINGA_Dummy + $0002); + STRINGA_UndoBuffer = (STRINGA_Dummy + $0003); + STRINGA_WorkBuffer = (STRINGA_Dummy + $0004); + STRINGA_BufferPos = (STRINGA_Dummy + $0005); + STRINGA_DispPos = (STRINGA_Dummy + $0006); + STRINGA_AltKeyMap = (STRINGA_Dummy + $0007); + STRINGA_Font = (STRINGA_Dummy + $0008); + STRINGA_Pens = (STRINGA_Dummy + $0009); + STRINGA_ActivePens = (STRINGA_Dummy + $000A); + STRINGA_EditHook = (STRINGA_Dummy + $000B); + STRINGA_EditModes = (STRINGA_Dummy + $000C); + +{ booleans } + STRINGA_ReplaceMode = (STRINGA_Dummy + $000D); + STRINGA_FixedFieldMode = (STRINGA_Dummy + $000E); + STRINGA_NoFilterMode = (STRINGA_Dummy + $000F); + + STRINGA_Justification = (STRINGA_Dummy + $0010); + { GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT } + STRINGA_LongVal = (STRINGA_Dummy + $0011); + STRINGA_TextVal = (STRINGA_Dummy + $0012); + + STRINGA_ExitHelp = (STRINGA_Dummy + $0013); + { STRINGA_ExitHelp is new for V37, and ignored by V36. + * Set this if you want the gadget to exit when Help is + * pressed. Look for a code of $5F, the rawkey code for Help + } + + SG_DEFAULTMAXCHARS = (128); + +{ Gadget Layout related attributes } + + LAYOUTA_Dummy = (TAG_USER + $38000); + LAYOUTA_LayoutObj = (LAYOUTA_Dummy + $0001); + LAYOUTA_Spacing = (LAYOUTA_Dummy + $0002); + LAYOUTA_Orientation = (LAYOUTA_Dummy + $0003); + + LAYOUTA_ChildMaxWidth = LAYOUTA_Dummy + $0004; + { (BOOL) Child objects are of equal width. Should default to TRUE for + gadgets with a horizontal orientation. New for V42. } + + LAYOUTA_ChildMaxHeight = LAYOUTA_Dummy + $0005; + { (BOOL) Child objects are of equal height. Should default to TRUE for + gadgets with a vertical orientation. New for V42. } + +{ orientation values } + LORIENT_NONE = 0; + LORIENT_HORIZ = 1; + LORIENT_VERT = 2; + + +{ Gadget Method ID's } + + GM_Dummy = (-1); { not used for anything } + GM_HITTEST = (0); { return GMR_GADGETHIT IF you are clicked on + * (whether or not you are disabled). + } + GM_RENDER = (1); { draw yourself, in the appropriate state } + GM_GOACTIVE = (2); { you are now going to be fed input } + GM_HANDLEINPUT = (3); { handle that input } + GM_GOINACTIVE = (4); { whether or not by choice, you are done } + GM_HELPTEST = (5); { Will you send gadget help if the mouse is + * at the specified coordinates? See below + * for possible GMR_ values. + } + GM_LAYOUT = (6); { re-evaluate your size based on the GadgetInfo + * Domain. Do NOT re-render yourself yet, you + * will be called when it is time... + } + +{ Parameter "Messages" passed to gadget class methods } + +{ GM_HITTEST } +type + + pgpHitTest = ^tgpHitTest; + tgpHitTest = record + MethodID : Cardinal; + gpht_GInfo : pGadgetInfo; + gpht_Mouse : record + x : smallint; + y : smallint; + end; + END; + +const +{ For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit, + * otherwise return zero. + * + * For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit. + * Typically, return GMR_HELPHIT if you were hit. + * It is possible to pass a UWORD to the application via the Code field + * of the IDCMP_GADGETHELP message. Return GMR_HELPCODE or'd with + * the UWORD-sized result you wish to return. + * + * GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should + * mean "nothing particular" to the application. + } + + GMR_GADGETHIT = ($00000004); { GM_HITTEST hit } + + GMR_NOHELPHIT = ($00000000); { GM_HELPTEST didn't hit } + GMR_HELPHIT = ($FFFFFFFF); { GM_HELPTEST hit, return code = ~0 } + GMR_HELPCODE = ($00010000); { GM_HELPTEST hit, return low word as code } + + +{ GM_RENDER } +Type + pgpRender = ^tgpRender; + tgpRender = record + MethodID : Cardinal; + gpr_GInfo : pGadgetInfo; { gadget context } + gpr_RPort : pRastPort; { all ready for use } + gpr_Redraw : Longint; { might be a "highlight pass" } + END; + +{ values of gpr_Redraw } +CONST + GREDRAW_UPDATE = (2); { incremental update, e.g. prop slider } + GREDRAW_REDRAW = (1); { redraw gadget } + GREDRAW_TOGGLE = (0); { toggle highlight, IF applicable } + +{ GM_GOACTIVE, GM_HANDLEINPUT } +Type + + pgpInput = ^tgpInput; + tgpInput = record + MethodID : Cardinal; + gpi_GInfo : pGadgetInfo; + gpi_IEvent : pInputEvent; + gpi_Termination : Pointer; + gpi_Mouse : record + x : smallint; + y : smallint; + end; + {* (V39) Pointer to TabletData structure, if this event originated + * from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if + * not. + * + * DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39! + * IT WILL BE INVALID! + *} + gpi_TabletData : pTabletData; + END; + +{ GM_HANDLEINPUT and GM_GOACTIVE return code flags } +{ return GMR_MEACTIVE (0) alone if you want more input. + * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally + * GMR_VERIFY. + } +CONST + GMR_MEACTIVE = (0); + GMR_NOREUSE = (2); + GMR_REUSE = (4); + GMR_VERIFY = (8); { you MUST set cgp_Termination } + +{ New for V37: + * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE, + * which instructs Intuition to activate the next or previous gadget + * that has GFLG_TABCYCLE set. + } + GMR_NEXTACTIVE = (16); + GMR_PREVACTIVE = (32); + +{ GM_GOINACTIVE } +Type + + pgpGoInactive = ^tgpGoInactive; + tgpGoInactive = record + MethodID : Cardinal; + gpgi_GInfo : pGadgetInfo; + + { V37 field only! DO NOT attempt to read under V36! } + gpgi_Abort : Cardinal; { gpgi_Abort=1 IF gadget was aborted + * by Intuition and 0 if gadget went + * inactive at its own request + } + END; + +{* New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when + * the gadget is added to the window (or when the window opens, if + * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets + * list), or when the window is resized. Your gadget can set the + * GA_RelSpecial property to get GM_LAYOUT events without Intuition + * changing the interpretation of your gadget select box. This + * allows for completely arbitrary resizing/repositioning based on + * window size. + *} +{* GM_LAYOUT *} +Type + + pgpLayout = ^tgpLayout; + tgpLayout = record + MethodID : Cardinal; + gpl_GInfo : pGadgetInfo; + gpl_Initial : Cardinal; {* non-zero if this method was invoked + * during AddGList() or OpenWindow() + * time. zero if this method was invoked + * during window resizing. + *} + end; + +{***************************************************************************} + +{ The GM_DOMAIN method is used to obtain the sizing requirements of an + * object for a class before ever creating an object. } + +{ GM_DOMAIN } + + PgpDomain = ^tgpDomain; + tgpDomain = record + MethodID : Cardinal; + gpd_GInfo : PGadgetInfo; + gpd_RPort : PRastPort; { RastPort to layout for } + gpd_Which : LongInt; + gpd_Domain : tIBox; { Resulting domain } + gpd_Attrs : PTagItem; { Additional attributes } + end; + + + const + GDOMAIN_MINIMUM = 0; + { Minimum size } + + GDOMAIN_NOMINAL = 1; + { Nominal size } + + GDOMAIN_MAXIMUM = 2; + { Maximum size } + +{***************************************************************************} + +{ The GM_KEYTEST method is used to determin if a key press matches an + * object's activation key(s). } + +{ GM_KEYTEST send this message. + } + + type + PgpKeyTest = ^tgpKeyTest; + tgpKeyTest = record + MethodID : Cardinal; + gpkt_GInfo : PGadgetInfo; + gpkt_IMsg : PIntuiMessage; { The IntuiMessage that triggered this } + gpkt_VanillaKey : Cardinal; + end; + +{***************************************************************************} + +{ The GM_KEYGOACTIVE method is called to "simulate" a gadget going down. + * A gadget should render itself in a selected state when receiving + * this message. If the class supports this method, it must return + * GMR_KEYACTIVE. + * + * If a gadget returns zero for this method, it will subsequently be + * activated via ActivateGadget() with a NULL IEvent. + } + + PgpKeyInput = ^tgpKeyInput; + tgpKeyInput = record + MethodID : Cardinal; { GM_KEYGOACTIVE } + gpk_GInfo : PGadgetInfo; + gpk_IEvent : PInputEvent; + gpk_Termination : ^LongInt; + end; + + + const + GMR_KEYACTIVE = 1 shl 4; + + { you MUST set gpk_Termination } + GMR_KEYVERIFY = 1 shl 5; + +{ The GM_KEYGOINACTIVE method is called to simulate the gadget release. + * Upon receiving this message, the gadget should do everything a + * normal gadget release would do. + } + + type + PgpKeyGoInactive = ^tgpKeyGoInactive; + tgpKeyGoInactive = record + MethodID : Cardinal; + gpki_GInfo : PGadgetInfo; + gpki_Abort : Cardinal; + end; + +CONST + ICM_Dummy = ($0401); { used for nothing } + ICM_SETLOOP = ($0402); { set/increment loop counter } + ICM_CLEARLOOP = ($0403); { clear/decrement loop counter } + ICM_CHECKLOOP = ($0404); { set/increment loop } + +{ no parameters for ICM_SETLOOP, ICM_CLEARLOOP, ICM_CHECKLOOP } + +{ interconnection attributes used by icclass, modelclass, and gadgetclass } + ICA_Dummy = (TAG_USER+$40000); + ICA_TARGET = (ICA_Dummy + 1); + { interconnection target } + ICA_MAP = (ICA_Dummy + 2); + { interconnection map tagitem list } + ICSPECIAL_CODE = (ICA_Dummy + 3); + { a "pseudo-attribute", see below. } + +{ Normally, the value for ICA_TARGET is some object pointer, + * but if you specify the special value ICTARGET_IDCMP, notification + * will be send as an IDCMP_IDCMPUPDATE message to the appropriate window's + * IDCMP port. See the definition of IDCMP_IDCMPUPDATE. + * + * When you specify ICTARGET_IDCMP for ICA_TARGET, the map you + * specify will be applied to derive the attribute list that is + * sent with the IDCMP_IDCMPUPDATE message. If you specify a map list + * which results in the attribute tag id ICSPECIAL_CODE, the + * lower sixteen bits of the corresponding ti_Data value will + * be copied into the Code field of the IDCMP_IDCMPUPDATE IntuiMessage. + } + ICTARGET_IDCMP = (NOT 0); + + +CONST + CUSTOMIMAGEDEPTH = (-1); +{ if image.Depth is this, it's a new Image class object } + + +{****************************************************} +CONST + IA_Dummy = (TAG_USER + $20000); + IA_Left = (IA_Dummy + $01); + IA_Top = (IA_Dummy + $02); + IA_Width = (IA_Dummy + $03); + IA_Height = (IA_Dummy + $04); + IA_FGPen = (IA_Dummy + $05); + { IA_FGPen also means "PlanePick" } + IA_BGPen = (IA_Dummy + $06); + { IA_BGPen also means "PlaneOnOff" } + IA_Data = (IA_Dummy + $07); + { bitplanes, for classic image, + * other image classes may use it for other things + } + IA_LineWidth = (IA_Dummy + $08); + IA_Pens = (IA_Dummy + $0E); + { pointer to UWORD pens[], + * ala DrawInfo.Pens, MUST be + * terminated by ~0. Some classes can + * choose to have this, or SYSIA_DrawInfo, + * or both. + } + IA_Resolution = (IA_Dummy + $0F); + { packed uwords for x/y resolution into a longword + * ala DrawInfo.Resolution + } + +{*** see class documentation to learn which ****} +{*** classes recognize these ****} + IA_APattern = (IA_Dummy + $10); + IA_APatSize = (IA_Dummy + $11); + IA_Mode = (IA_Dummy + $12); + IA_Font = (IA_Dummy + $13); + IA_Outline = (IA_Dummy + $14); + IA_Recessed = (IA_Dummy + $15); + IA_DoubleEmboss = (IA_Dummy + $16); + IA_EdgesOnly = (IA_Dummy + $17); + +{*** "sysiclass" attributes ****} + SYSIA_Size = (IA_Dummy + $0B); + { 's below } + SYSIA_Depth = (IA_Dummy + $0C); + { this is unused by Intuition. SYSIA_DrawInfo + * is used instead for V36 + } + SYSIA_Which = (IA_Dummy + $0D); + { see 's below } + SYSIA_DrawInfo = (IA_Dummy + $18); + { pass to sysiclass, please } + +{**** obsolete: don't use these, use IA_Pens ****} + SYSIA_Pens = IA_Pens; + IA_ShadowPen = (IA_Dummy + $09); + IA_HighlightPen = (IA_Dummy + $0A); + +{ New for V39: } + SYSIA_ReferenceFont = (IA_Dummy + $19); + { Font to use as reference for scaling + * certain sysiclass images + } + IA_SupportsDisable = (IA_Dummy + $1a); + { By default, Intuition ghosts gadgets itself, + * instead of relying on IDS_DISABLED or + * IDS_SELECTEDDISABLED. An imageclass that + * supports these states should return this attribute + * as TRUE. You cannot set or clear this attribute, + * however. + } + + IA_FrameType = (IA_Dummy + $1b); + { Starting with V39, FrameIClass recognizes + * several standard types of frame. Use one + * of the FRAME_ specifiers below. Defaults + * to FRAME_DEFAULT. + } + + IA_Underscore = IA_Dummy + $1c; + { V44, Indicate underscore keyboard shortcut for image labels. + (UBYTE) Defaults to '_' + } + + IA_Scalable = IA_Dummy + $1d; + { V44, Attribute indicates this image is allowed + to/can scale its rendering. + (BOOL) Defaults to FALSE. + } + + IA_ActivateKey = IA_Dummy + $1e; + { V44, Used to get an underscored label shortcut. + Useful for labels attached to string gadgets. + (UBYTE) Defaults to NULL. + } + + IA_Screen = IA_Dummy + $1f; + { V44 Screen pointer, may be useful/required by certain classes. + (struct Screen ) + } + + IA_Precision = IA_Dummy + $20; + { V44 Precision value, typically pen precision but may be + used for similar custom purposes. + (Cardinal) + } + +{* next attribute: (IA_Dummy + $1c) *} + +{***********************************************} + +{ data values for SYSIA_Size } + SYSISIZE_MEDRES = (0); + SYSISIZE_LOWRES = (1); + SYSISIZE_HIRES = (2); + +{ + * SYSIA_Which tag data values: + * Specifies which system gadget you want an image for. + * Some numbers correspond to internal Intuition s + } + DEPTHIMAGE = ($00); + ZOOMIMAGE = ($01); + SIZEIMAGE = ($02); + CLOSEIMAGE = ($03); + SDEPTHIMAGE = ($05); { screen depth gadget } + LEFTIMAGE = ($0A); + UPIMAGE = ($0B); + RIGHTIMAGE = ($0C); + DOWNIMAGE = ($0D); + CHECKIMAGE = ($0E); + MXIMAGE = ($0F); { mutual exclude "button" } +{* New for V39: *} + MENUCHECK = ($10); { Menu checkmark image } + AMIGAKEY = ($11); { Menu Amiga-key image } + +{ Data values for IA_FrameType (recognized by FrameIClass) + * + * FRAME_DEFAULT: The standard V37-type frame, which has + * thin edges. + * FRAME_BUTTON: Standard button gadget frames, having thicker + * sides and nicely edged corners. + * FRAME_RIDGE: A ridge such as used by standard string gadgets. + * You can recess the ridge to get a groove image. + * FRAME_ICONDROPBOX: A broad ridge which is the standard imagery + * for areas in AppWindows where icons may be dropped. + } + + FRAME_DEFAULT = 0; + FRAME_BUTTON = 1; + FRAME_RIDGE = 2; + FRAME_ICONDROPBOX = 3; + +{ image message id's } + IM_DRAW = $202; { draw yourself, with "state" } + IM_HITTEST = $203; { return TRUE IF click hits image } + IM_ERASE = $204; { erase yourself } + IM_MOVE = $205; { draw new AND erase old, smoothly } + + IM_DRAWFRAME= $206; { draw with specified dimensions } + IM_FRAMEBOX = $207; { get recommended frame around some box} + IM_HITFRAME = $208; { hittest with dimensions } + IM_ERASEFRAME= $209; { hittest with dimensions } + IM_DOMAINFRAME = $20A;{ query image for its domain info (V44) } + +{ image draw states or styles, for IM_DRAW } + IDS_NORMAL = (0); + IDS_SELECTED = (1); { for selected gadgets } + IDS_DISABLED = (2); { for disabled gadgets } + IDS_BUSY = (3); { for future functionality } + IDS_INDETERMINATE = (4); { for future functionality } + IDS_INACTIVENORMAL = (5); { normal, in inactive window border } + IDS_INACTIVESELECTED= (6); { selected, in inactive border } + IDS_INACTIVEDISABLED= (7); { disabled, in inactive border } + IDS_SELECTEDDISABLED = 8; { disabled and selected } + +{ oops, please forgive spelling error by jimm } + IDS_INDETERMINANT = IDS_INDETERMINATE; + +{ IM_FRAMEBOX } +Type + + pimpFrameBox = ^timpFrameBox; + timpFrameBox = record + MethodID : Cardinal; + imp_ContentsBox : pIBox; { input: relative box of contents } + imp_FrameBox : pIBox; { output: rel. box of encl frame } + imp_DrInfo : pDrawInfo; + imp_FrameFlags : Cardinal; + END; + +CONST + FRAMEF_SPECIFY = (1); { Make do with the dimensions of FrameBox + * provided. + } + +{ IM_DRAW, IM_DRAWFRAME } +Type + + pimpDraw = ^timpDraw; + timpDraw = record + MethodID : Cardinal; + imp_RPort : pRastPort; + imp_Offset : record + x : Word; + y : Word; + end; + imp_State : Cardinal; + imp_DrInfo : pDrawInfo; + + { these parameters only valid for IM_DRAWFRAME } + imp_Dimensions : record + Width : Word; + Height : Word; + end; + END; + +{ IM_ERASE, IM_ERASEFRAME } +{ NOTE: This is a subset of impDraw } + + pimpErase = ^timpErase; + timpErase = record + MethodID : Cardinal; + imp_RPort : pRastPort; + imp_Offset : record + x : Word; + y : Word; + end; + + { these parameters only valid for IM_ERASEFRAME } + imp_Dimensions : record + Width : Word; + Height : Word; + end; + END; + +{ IM_HITTEST, IM_HITFRAME } + + pimpHitTest = ^timpHitTest; + timpHitTest = record + MethodID : Cardinal; + imp_Point : record + x : Word; + y : Word; + end; + + { these parameters only valid for IM_HITFRAME } + imp_Dimensions : record + Width : Word; + Height : Word; + end; + END; + + +{ The IM_DOMAINFRAME method is used to obtain the sizing + * requirements of an image object within a layout group. + } + +{ IM_DOMAINFRAME } + PimpDomainFrame = ^timpDomainFrame; + timpDomainFrame = record + MethodID : Cardinal; + imp_DrInfo : PDrawInfo; + imp_RPort : PRastPort; + imp_Which : LongInt; + imp_Domain : tIBox; + imp_Attrs : PTagItem; + end; + + { Accepted vales for imp_Which. + } + + const + IDOMAIN_MINIMUM = 0; + IDOMAIN_NOMINAL = 1; + IDOMAIN_MAXIMUM = 2; + + { ** 'boopsi' pointer class interface } + +const +{ The following tags are recognized at NewObject() time by + * pointerclass: + * + * POINTERA_BitMap (struct BitMap *) - Pointer to bitmap to + * get pointer imagery from. Bitplane data need not be + * in chip RAM. + * POINTERA_XOffset (LONG) - X-offset of the pointer hotspot. + * POINTERA_YOffset (LONG) - Y-offset of the pointer hotspot. + * POINTERA_WordWidth (Cardinal) - designed width of the pointer in words + * POINTERA_XResolution (Cardinal) - one of the POINTERXRESN_ flags below + * POINTERA_YResolution (Cardinal) - one of the POINTERYRESN_ flags below + * + } + + POINTERA_Dummy = (TAG_USER + $39000); + + POINTERA_BitMap = (POINTERA_Dummy + $01); + POINTERA_XOffset = (POINTERA_Dummy + $02); + POINTERA_YOffset = (POINTERA_Dummy + $03); + POINTERA_WordWidth = (POINTERA_Dummy + $04); + POINTERA_XResolution = (POINTERA_Dummy + $05); + POINTERA_YResolution = (POINTERA_Dummy + $06); + +{ These are the choices for the POINTERA_XResolution attribute which + * will determine what resolution pixels are used for this pointer. + * + * POINTERXRESN_DEFAULT (ECS-compatible pointer width) + * = 70 ns if SUPERHIRES-type mode, 140 ns if not + * + * POINTERXRESN_SCREENRES + * = Same as pixel speed of screen + * + * POINTERXRESN_LORES (pointer always in lores-like pixels) + * = 140 ns in 15kHz modes, 70 ns in 31kHz modes + * + * POINTERXRESN_HIRES (pointer always in hires-like pixels) + * = 70 ns in 15kHz modes, 35 ns in 31kHz modes + * + * POINTERXRESN_140NS (pointer always in 140 ns pixels) + * = 140 ns always + * + * POINTERXRESN_70NS (pointer always in 70 ns pixels) + * = 70 ns always + * + * POINTERXRESN_35NS (pointer always in 35 ns pixels) + * = 35 ns always + } + + POINTERXRESN_DEFAULT = 0; + POINTERXRESN_140NS = 1; + POINTERXRESN_70NS = 2; + POINTERXRESN_35NS = 3; + + POINTERXRESN_SCREENRES = 4; + POINTERXRESN_LORES = 5; + POINTERXRESN_HIRES = 6; + +{ These are the choices for the POINTERA_YResolution attribute which + * will determine what vertical resolution is used for this pointer. + * + * POINTERYRESN_DEFAULT + * = In 15 kHz modes, the pointer resolution will be the same + * as a non-interlaced screen. In 31 kHz modes, the pointer + * will be doubled vertically. This means there will be about + * 200-256 pointer lines per screen. + * + * POINTERYRESN_HIGH + * POINTERYRESN_HIGHASPECT + * = Where the hardware/software supports it, the pointer resolution + * will be high. This means there will be about 400-480 pointer + * lines per screen. POINTERYRESN_HIGHASPECT also means that + * when the pointer comes out double-height due to hardware/software + * restrictions, its width would be doubled as well, if possible + * (to preserve aspect). + * + * POINTERYRESN_SCREENRES + * POINTERYRESN_SCREENRESASPECT + * = Will attempt to match the vertical resolution of the pointer + * to the screen's vertical resolution. POINTERYRESN_SCREENASPECT also + * means that when the pointer comes out double-height due to + * hardware/software restrictions, its width would be doubled as well, + * if possible (to preserve aspect). + * + } + + POINTERYRESN_DEFAULT = 0; + POINTERYRESN_HIGH = 2; + POINTERYRESN_HIGHASPECT = 3; + POINTERYRESN_SCREENRES = 4; + POINTERYRESN_SCREENRESASPECT = 5; + +{ Compatibility note: + * + * The AA chipset supports variable sprite width and resolution, but + * the setting of width and resolution is global for all sprites. + * When no other sprites are in use, Intuition controls the sprite + * width and sprite resolution for correctness based on pointerclass + * attributes specified by the creator of the pointer. Intuition + * controls sprite resolution with the VTAG_DEFSPRITERESN_SET tag + * to VideoControl(). Applications can override this on a per-viewport + * basis with the VTAG_SPRITERESN_SET tag to VideoControl(). + * + * If an application uses a sprite other than the pointer sprite, + * Intuition will automatically regenerate the pointer sprite's image in + * a compatible width. This might involve BitMap scaling of the imagery + * you supply. + * + * If any sprites other than the pointer sprite were obtained with the + * old GetSprite() call, Intuition assumes that the owner of those + * sprites is unaware of sprite resolution, hence Intuition will set the + * default sprite resolution (VTAG_DEFSPRITERESN_SET) to ECS-compatible, + * instead of as requested by the various pointerclass attributes. + * + * No resolution fallback occurs when applications use ExtSprites. + * Such applications are expected to use VTAG_SPRITERESN_SET tag if + * necessary. + * + * NB: Under release V39, only sprite width compatibility is implemented. + * Sprite resolution compatibility was added for V40. + } + + +Type + + pStringExtend = ^tStringExtend; + tStringExtend = record + { display specifications } + Font : pTextFont; { must be an open Font (not TextAttr) } + Pens : Array[0..1] of Byte; { color of text/backgroun } + ActivePens : Array[0..1] of Byte; { colors when gadget is active } + + { edit specifications } + InitialModes : Cardinal; { initial mode flags, below } + EditHook : pHook; { IF non-NULL, must supply WorkBuffer } + WorkBuffer : PChar; { must be as large as StringInfo.Buffer} + + Reserved : Array[0..3] of Cardinal; { set to 0 } + END; + + pSGWork = ^tSGWork; + tSGWork = record + { set up when gadget is first activated } + Gad : pGadget; { the contestant itself } { Gadget in C-Includes } + StrInfo : pStringInfo; { easy access to sinfo } { StrInfo in C-Includes } + WorkBuffer : PChar; { intuition's planned result } + PrevBuffer : PChar; { what was there before } + Modes : Cardinal; { current mode } + + { modified for each input event } + IEvent : pInputEvent; { actual event: do not change } + Code : Word; { character code, IF one byte } + BufferPos : smallint; { cursor position } + NumChars : smallint; + Actions : Cardinal; { what Intuition will do } + LongInt_ : Longint; { temp storage for longint } + + GInfo : pGadgetInfo; { see cghooks.h } { GadgetInfo in C-Includes } + EditOp : Word; { from constants below } + END; + +{ SGWork.EditOp - + * These values indicate what basic type of operation the global + * editing hook has performed on the string before your gadget's custom + * editing hook gets called. You do not have to be concerned with the + * value your custom hook leaves in the EditOp field, only if you + * write a global editing hook. + * + * For most of these general edit operations, you'll want to compare + * the BufferPos and NumChars of the StringInfo (before global editing) + * and SGWork (after global editing). + } + +CONST + EO_NOOP = ($0001); + { did nothing } + EO_DELBACKWARD= ($0002); + { deleted some chars (maybe 0). } + EO_DELFORWARD = ($0003); + { deleted some characters under and in front of the cursor } + EO_MOVECURSOR = ($0004); + { moved the cursor } + EO_ENTER = ($0005); + { "enter" or "return" key, terminate } + EO_RESET = ($0006); + { current Intuition-style undo } + EO_REPLACECHAR= ($0007); + { replaced one character and (maybe) advanced cursor } + EO_INSERTCHAR = ($0008); + { inserted one char into string or added one at end } + EO_BADFORMAT = ($0009); + { didn't like the text data, e.g., Bad LONGINT } + EO_BIGCHANGE = ($000A); { unused by Intuition } + { complete or major change to the text, e.g. new string } + EO_UNDO = ($000B); { unused by Intuition } + { some other style of undo } + EO_CLEAR = ($000C); + { clear the string } + EO_SPECIAL = ($000D); { unused by Intuition } + { some operation that doesn't fit into the categories here } + + +{ Mode Flags definitions (ONLY first group allowed as InitialModes) } + SGM_REPLACE = (1); { replace mode } +{ please initialize StringInfo with in-range value of BufferPos + * if you are using SGM_REPLACE mode. + } + + SGM_FIXEDFIELD = (2); { fixed length buffer } + { always set SGM_REPLACE, too } + SGM_NOFILTER = (4); { don't filter control chars } + +{ SGM_EXITHELP is new for V37, and ignored by V36: } + SGM_EXITHELP = (128); { exit with code = $5F IF HELP hit } + + +{ These Mode Flags are for internal use only } + SGM_NOCHANGE = (8); { no edit changes yet } + SGM_NOWORKB = (16); { Buffer == PrevBuffer } + SGM_CONTROL = (32); { control char escape mode } + SGM_LONGINT = (64); { an intuition longint gadget } + +{ String Gadget Action Flags (put in SGWork.Actions by EditHook) } + SGA_USE = ($1); { use contents of SGWork } + SGA_END = ($2); { terminate gadget, code in Code field } + SGA_BEEP = ($4); { flash the screen for the user } + SGA_REUSE = ($8); { reuse input event } + SGA_REDISPLAY = ($10); { gadget visuals changed } + +{ New for V37: } + SGA_NEXTACTIVE = ($20); { Make next possible gadget active. } + SGA_PREVACTIVE = ($40); { Make previous possible gadget active.} + +{ function id for only existing custom string gadget edit hook } + + SGH_KEY = (1); { process editing keystroke } + SGH_CLICK = (2); { process mouse click cursor position } + +{ Here's a brief summary of how the custom string gadget edit hook works: + * You provide a hook in StringInfo.Extension.EditHook. + * The hook is called in the standard way with the 'object' + * a pointer to SGWork, and the 'message' a pointer to a command + * block, starting either with (longword) SGH_KEY, SGH_CLICK, + * or something new. + * + * You return 0 if you don't understand the command (SGH_KEY is + * required and assumed). Return non-zero if you implement the + * command. + * + * SGH_KEY: + * There are no parameters following the command longword. + * + * Intuition will put its idea of proper values in the SGWork + * before calling you, and if you leave SGA_USE set in the + * SGWork.Actions field, Intuition will use the values + * found in SGWork fields WorkBuffer, NumChars, BufferPos, + * and LongInt, copying the WorkBuffer back to the StringInfo + * Buffer. + * + * NOTE WELL: You may NOT change other SGWork fields. + * + * If you clear SGA_USE, the string gadget will be unchanged. + * + * If you set SGA_END, Intuition will terminate the activation + * of the string gadget. If you also set SGA_REUSE, Intuition + * will reuse the input event after it deactivates your gadget. + * + * In this case, Intuition will put the value found in SGWork.Code + * into the IntuiMessage.Code field of the IDCMP_GADGETUP message it + * sends to the application. + * + * If you set SGA_BEEP, Intuition will call DisplayBeep(); use + * this if the user has typed in error, or buffer is full. + * + * Set SGA_REDISPLAY if the changes to the gadget warrant a + * gadget redisplay. Note: cursor movement requires a redisplay. + * + * Starting in V37, you may set SGA_PREVACTIVE or SGA_NEXTACTIVE + * when you set SGA_END. This tells Intuition that you want + * the next or previous gadget with GFLG_TABCYCLE to be activated. + * + * SGH_CLICK: + * This hook command is called when Intuition wants to position + * the cursor in response to a mouse click in the string gadget. + * + * Again, here are no parameters following the command longword. + * + * This time, Intuition has already calculated the mouse position + * character cell and put it in SGWork.BufferPos. The previous + * BufferPos value remains in the SGWork.StringInfo.BufferPos. + * + * Intuition will again use the SGWork fields listed above for + * SGH_KEY. One restriction is that you are NOT allowed to set + * SGA_END or SGA_REUSE for this command. Intuition will not + * stand for a gadget which goes inactive when you click in it. + * + * You should always leave the SGA_REDISPLAY flag set, since Intuition + * uses this processing when activating a string gadget. + } + +const + INTUITIONNAME : PChar = 'intuition.library'; + +var + intuitionbase : PIntuitionBase; + + +procedure OpenIntuition; +SysCall IntuitionBase 030; + +procedure Intuition(iEvent : pInputEvent location 'a0'); +SysCall IntuitionBase 036; + +function AddGadget(window : pWindow location 'a0'; gadget : pGadget location 'a1'; position : CARDINAL location 'd0') : Word; +SysCall IntuitionBase 042; + +function ClearDMRequest(window : pWindow location 'a0') : LongBool; +SysCall IntuitionBase 048; + +procedure ClearMenuStrip(window : pWindow location 'a0'); +SysCall IntuitionBase 054; + +procedure ClearPointer(window : pWindow location 'a0'); +SysCall IntuitionBase 060; + +function CloseScreen(screen : pScreen location 'a0') : LongBool; +SysCall IntuitionBase 066; + +procedure CloseWindow(window : pWindow location 'a0'); +SysCall IntuitionBase 072; + +function CloseWorkBench : LongInt; +SysCall IntuitionBase 078; + +procedure CurrentTime(VAR seconds : CARDINAL location 'a0'; VAR micros : CARDINAL location 'a1'); +SysCall IntuitionBase 084; + +function DisplayAlert(alertNumber : CARDINAL location 'd0'; string1 : PChar location 'a0'; height : CARDINAL location 'd1') : LongBool; +SysCall IntuitionBase 090; + +procedure DisplayBeep(screen : pScreen location 'a0'); +SysCall IntuitionBase 096; + +function DoubleClick(sSeconds : CARDINAL location 'd0'; sMicros : CARDINAL location 'd1'; cSeconds : CARDINAL location 'd2'; cMicros : CARDINAL location 'd3') : LongBool; +SysCall IntuitionBase 102; + +procedure DrawBorder(rp : pRastPort location 'a0'; border : pBorder location 'a1'; leftOffset : LongInt location 'd0'; topOffset : LongInt location 'd1'); +SysCall IntuitionBase 108; + +procedure DrawImage(rp : pRastPort location 'a0'; image : pImage location 'a1'; leftOffset : LongInt location 'd0'; topOffset : LongInt location 'd1'); +SysCall IntuitionBase 114; + +procedure EndRequest(requester : pRequester location 'a0'; window : pWindow location 'a1'); +SysCall IntuitionBase 120; + +function GetDefPrefs(preferences : pPreferences location 'a0'; size : LongInt location 'd0') : pPreferences; +SysCall IntuitionBase 126; + +function GetPrefs(preferences : pPreferences location 'a0'; size : LongInt location 'd0') : pPreferences; +SysCall IntuitionBase 132; + +procedure InitRequester(requester : pRequester location 'a0'); +SysCall IntuitionBase 138; + +function ItemAddress(menuStrip : pMenu location 'a0'; menuNumber : CARDINAL location 'd0') : pMenuItem; +SysCall IntuitionBase 144; + +function ModifyIDCMP(window : pWindow location 'a0'; flags : CARDINAL location 'd0') : LongBool; +SysCall IntuitionBase 150; + +procedure ModifyProp(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'; flags : CARDINAL location 'd0'; horizPot : CARDINAL location 'd1'; vertPot : CARDINAL location 'd2'; horizBody : CARDINAL location 'd3'; vertBody : CARDINAL location 'd4'); +SysCall IntuitionBase 156; + +procedure MoveScreen(screen : pScreen location 'a0'; dx : LongInt location 'd0'; dy : LongInt location 'd1'); +SysCall IntuitionBase 162; + +procedure MoveWindow(window : pWindow location 'a0'; dx : LongInt location 'd0'; dy : LongInt location 'd1'); +SysCall IntuitionBase 168; + +procedure OffGadget(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'); +SysCall IntuitionBase 174; + +procedure OffMenu(window : pWindow location 'a0'; menuNumber : CARDINAL location 'd0'); +SysCall IntuitionBase 180; + +procedure OnGadget(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'); +SysCall IntuitionBase 186; + +procedure OnMenu(window : pWindow location 'a0'; menuNumber : CARDINAL location 'd0'); +SysCall IntuitionBase 192; + +function OpenScreen(newScreen : pNewScreen location 'a0') : pScreen; +SysCall IntuitionBase 198; + +function OpenWindow(newWindow : pNewWindow location 'a0') : pWindow; +SysCall IntuitionBase 204; + +function OpenWorkBench : CARDINAL; +SysCall IntuitionBase 210; + +procedure PrintIText(rp : pRastPort location 'a0'; iText : pIntuiText location 'a1'; left : LongInt location 'd0'; top : LongInt location 'd1'); +SysCall IntuitionBase 216; + +procedure RefreshGadgets(gadgets : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'); +SysCall IntuitionBase 222; + +function RemoveGadget(window : pWindow location 'a0'; gadget : pGadget location 'a1') : Word; +SysCall IntuitionBase 228; + +procedure ReportMouse(flag : LongInt location 'd0'; window : pWindow location 'a0'); +SysCall IntuitionBase 234; + +function Request(requester : pRequester location 'a0'; window : pWindow location 'a1') : LongBool; +SysCall IntuitionBase 240; + +procedure ScreenToBack(screen : pScreen location 'a0'); +SysCall IntuitionBase 246; + +procedure ScreenToFront(screen : pScreen location 'a0'); +SysCall IntuitionBase 252; + +function SetDMRequest(window : pWindow location 'a0'; requester : pRequester location 'a1') : LongBool; +SysCall IntuitionBase 258; + +function SetMenuStrip(window : pWindow location 'a0'; menu : pMenu location 'a1') : LongBool; +SysCall IntuitionBase 264; + +procedure SetPointer(window : pWindow location 'a0'; VAR pointer : Word location 'a1'; height : LongInt location 'd0'; width : LongInt location 'd1'; xOffset : LongInt location 'd2'; yOffset : LongInt location 'd3'); +SysCall IntuitionBase 270; + +procedure SetWindowTitles(window : pWindow location 'a0'; windowTitle : PChar location 'a1'; screenTitle : PChar location 'a2'); +SysCall IntuitionBase 276; + +procedure ShowTitle(screen : pScreen location 'a0'; showIt : LongInt location 'd0'); +SysCall IntuitionBase 282; + +procedure SizeWindow(window : pWindow location 'a0'; dx : LongInt location 'd0'; dy : LongInt location 'd1'); +SysCall IntuitionBase 288; + +function ViewAddress : pView; +SysCall IntuitionBase 294; + +function ViewPortAddress(window : pWindow location 'a0') : pViewPort; +SysCall IntuitionBase 300; + +procedure WindowToBack(window : pWindow location 'a0'); +SysCall IntuitionBase 306; + +procedure WindowToFront(window : pWindow location 'a0'); +SysCall IntuitionBase 312; + +function WindowLimits(window : pWindow location 'a0'; widthMin : LongInt location 'd0'; heightMin : LongInt location 'd1'; widthMax : CARDINAL location 'd2'; heightMax : CARDINAL location 'd3') : LongBool; +SysCall IntuitionBase 318; + +function SetPrefs(preferences : pPreferences location 'a0'; size : LongInt location 'd0'; inform : LongInt location 'd1') : pPreferences; +SysCall IntuitionBase 324; + +function IntuiTextLength(iText : pIntuiText location 'a0') : LongInt; +SysCall IntuitionBase 330; + +function WBenchToBack : LongBool; +SysCall IntuitionBase 336; + +function WBenchToFront : LongBool; +SysCall IntuitionBase 342; + +function AutoRequest(window : pWindow location 'a0'; body : pIntuiText location 'a1'; posText : pIntuiText location 'a2'; negText : pIntuiText location 'a3'; pFlag : CARDINAL location 'd0'; nFlag : CARDINAL location 'd1'; width : CARDINAL location 'd2'; height : CARDINAL location 'd3') : LongBool; +SysCall IntuitionBase 348; + +procedure BeginRefresh(window : pWindow location 'a0'); +SysCall IntuitionBase 354; + +function BuildSysRequest(window : pWindow location 'a0'; body : pIntuiText location 'a1'; posText : pIntuiText location 'a2'; negText : pIntuiText location 'a3'; flags : CARDINAL location 'd0'; width : CARDINAL location 'd1'; height : CARDINAL location 'd2') : pWindow; +SysCall IntuitionBase 360; + +procedure EndRefresh(window : pWindow location 'a0'; complete : LongBool location 'd0'); +SysCall IntuitionBase 366; + +procedure FreeSysRequest(window : pWindow location 'a0'); +SysCall IntuitionBase 372; + +function MakeScreen(screen : pScreen location 'a0') : LongInt; +SysCall IntuitionBase 378; + +function RemakeDisplay : LongInt; +SysCall IntuitionBase 384; + +function RethinkDisplay : LongInt; +SysCall IntuitionBase 390; + +function AllocRemember(var rememberKey : pRemember location 'a0'; size : CARDINAL location 'd0'; flags : CARDINAL location 'd1') : POINTER; +SysCall IntuitionBase 396; + +procedure FreeRemember(var rememberKey : pRemember location 'a0'; reallyForget : LongInt location 'd0'); +SysCall IntuitionBase 408; + +function LockIBase(dontknow : CARDINAL location 'd0') : CARDINAL; +SysCall IntuitionBase 414; + +procedure UnlockIBase(ibLock : CARDINAL location 'a0'); +SysCall IntuitionBase 420; + +function GetScreenData(buffer : POINTER location 'a0'; size : CARDINAL location 'd0'; type1 : CARDINAL location 'd1'; screen : pScreen location 'a1') : LongInt; +SysCall IntuitionBase 426; + +procedure RefreshGList(gadgets : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'; numGad : LongInt location 'd0'); +SysCall IntuitionBase 432; + +function AddGList(window : pWindow location 'a0'; gadget : pGadget location 'a1'; position : CARDINAL location 'd0'; numGad : LongInt location 'd1'; requester : pRequester location 'a2') : Word; +SysCall IntuitionBase 438; + +function RemoveGList(remPtr : pWindow location 'a0'; gadget : pGadget location 'a1'; numGad : LongInt location 'd0') : Word; +SysCall IntuitionBase 444; + +procedure ActivateWindow(window : pWindow location 'a0'); +SysCall IntuitionBase 450; + +procedure RefreshWindowFrame(window : pWindow location 'a0'); +SysCall IntuitionBase 456; + +function ActivateGadget(gadgets : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2') : LongBool; +SysCall IntuitionBase 462; + +procedure NewModifyProp(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'; flags : CARDINAL location 'd0'; horizPot : CARDINAL location 'd1'; vertPot : CARDINAL location 'd2'; horizBody : CARDINAL location 'd3'; vertBody : CARDINAL location 'd4'; numGad : LongInt location 'd5'); +SysCall IntuitionBase 468; + +function QueryOverscan(displayID : CARDINAL location 'a0'; rect : pRectangle location 'a1'; oScanType : LongInt location 'd0') : LongInt; +SysCall IntuitionBase 474; + +procedure MoveWindowInFrontOf(window : pWindow location 'a0'; behindWindow : pWindow location 'a1'); +SysCall IntuitionBase 480; + +procedure ChangeWindowBox(window : pWindow location 'a0'; left : LongInt location 'd0'; top : LongInt location 'd1'; width : LongInt location 'd2'; height : LongInt location 'd3'); +SysCall IntuitionBase 486; + +function SetEditHook(hook : pHook location 'a0') : pHook; +SysCall IntuitionBase 492; + +function SetMouseQueue(window : pWindow location 'a0'; queueLength : CARDINAL location 'd0') : LongInt; +SysCall IntuitionBase 498; + +procedure ZipWindow(window : pWindow location 'a0'); +SysCall IntuitionBase 504; + +function LockPubScreen(name : PChar location 'a0') : pScreen; +SysCall IntuitionBase 510; + +procedure UnlockPubScreen(name : PChar location 'a0'; screen : pScreen location 'a1'); +SysCall IntuitionBase 516; + +function LockPubScreenList : pList; +SysCall IntuitionBase 522; + +procedure UnlockPubScreenList; +SysCall IntuitionBase 528; + +function NextPubScreen(screen : pScreen location 'a0'; namebuf : PChar location 'a1') : PChar; +SysCall IntuitionBase 534; + +procedure SetDefaultPubScreen(name : PChar location 'a0'); +SysCall IntuitionBase 540; + +function SetPubScreenModes(modes : CARDINAL location 'd0') : Word; +SysCall IntuitionBase 546; + +function PubScreenStatus(screen : pScreen location 'a0'; statusFlags : CARDINAL location 'd0') : Word; +SysCall IntuitionBase 552; + +function ObtainGIRPort(gInfo : pGadgetInfo location 'a0') : pRastPort; +SysCall IntuitionBase 558; + +procedure ReleaseGIRPort(rp : pRastPort location 'a0'); +SysCall IntuitionBase 564; + +procedure GadgetMouse(gadget : pGadget location 'a0'; gInfo : pGadgetInfo location 'a1'; VAR mousePoint : INTEGER location 'a2'); +SysCall IntuitionBase 570; + +procedure GetDefaultPubScreen(nameBuffer : PChar location 'a0'); +SysCall IntuitionBase 582; + +function EasyRequestArgs(window : pWindow location 'a0'; easyStruct : pEasyStruct location 'a1'; idcmpPtr : Pointer location 'a2'; args : POINTER location 'a3') : LongInt; +SysCall IntuitionBase 588; + +function BuildEasyRequestArgs(window : pWindow location 'a0'; easyStruct : pEasyStruct location 'a1'; idcmp : CARDINAL location 'd0'; args : POINTER location 'a3') : pWindow; +SysCall IntuitionBase 594; + +function SysReqHandler(window : pWindow location 'a0'; VAR idcmpPtr : CARDINAL location 'a1'; waitInput : LongInt location 'd0') : LongInt; +SysCall IntuitionBase 600; + +function OpenWindowTagList(newWindow : pNewWindow location 'a0'; tagList : pTagItem location 'a1') : pWindow; +SysCall IntuitionBase 606; + +function OpenWindowTags(newWindow : pNewWindow; tagList : array of DWord) : pWindow; Inline; + +function OpenScreenTagList(newScreen : pNewScreen location 'a0'; tagList : pTagItem location 'a1') : pScreen; +SysCall IntuitionBase 612; + +function OpenScreenTags(newScreen : pNewScreen; tagList : array of DWord) : pScreen; Inline; + +procedure DrawImageState(rp : pRastPort location 'a0'; image : pImage location 'a1'; leftOffset : LongInt location 'd0'; topOffset : LongInt location 'd1'; state : CARDINAL location 'd2'; drawInfo : pDrawInfo location 'a2'); +SysCall IntuitionBase 618; + +function PointInImage(point : CARDINAL location 'd0'; image : pImage location 'a0') : LongBool; +SysCall IntuitionBase 624; + +procedure EraseImage(rp : pRastPort location 'a0'; image : pImage location 'a1'; leftOffset : LongInt location 'd0'; topOffset : LongInt location 'd1'); +SysCall IntuitionBase 630; + +function NewObjectA(classPtr : pIClass location 'a0'; classID : PChar location 'a1'; tagList : pTagItem location 'a2') : POINTER; +SysCall IntuitionBase 636; + +function NewObject(classPtr : pIClass; classID : PChar; tags: array of LongWord) : POINTER; + +procedure DisposeObject(object1 : POINTER location 'a0'); +SysCall IntuitionBase 642; + +function SetAttrsA(object1 : POINTER location 'a0'; tagList : pTagItem location 'a1') : CARDINAL; +SysCall IntuitionBase 648; + +function GetAttr(attrID : CARDINAL location 'd0'; object1 : POINTER location 'a0'; VAR storagePtr : CARDINAL location 'a1') : CARDINAL; +SysCall IntuitionBase 654; + +function SetGadgetAttrsA(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'; tagList : pTagItem location 'a3') : CARDINAL; +SysCall IntuitionBase 660; + +function NextObject(objectPtrPtr : POINTER location 'a0') : POINTER; +SysCall IntuitionBase 666; + +function MakeClass(classID : PChar location 'a0'; superClassID : PChar location 'a1'; superClassPtr : pIClass location 'a2'; instanceSize : CARDINAL location 'd0'; flags : CARDINAL location 'd1') : pIClass; +SysCall IntuitionBase 678; + +procedure AddClass(classPtr : pIClass location 'a0'); +SysCall IntuitionBase 684; + +function GetScreenDrawInfo(screen : pScreen location 'a0') : pDrawInfo; +SysCall IntuitionBase 690; + +procedure FreeScreenDrawInfo(screen : pScreen location 'a0'; drawInfo : pDrawInfo location 'a1'); +SysCall IntuitionBase 696; + +function ResetMenuStrip(window : pWindow location 'a0'; menu : pMenu location 'a1') : LongBool; +SysCall IntuitionBase 702; + +procedure RemoveClass(classPtr : pIClass location 'a0'); +SysCall IntuitionBase 708; + +function FreeClass(classPtr : pIClass location 'a0') : LongBool; +SysCall IntuitionBase 714; + +function AllocScreenBuffer(sc : pScreen location 'a0'; bm : pBitMap location 'a1'; flags : CARDINAL location 'd0') : pScreenBuffer; +SysCall IntuitionBase 768; + +procedure FreeScreenBuffer(sc : pScreen location 'a0'; sb : pScreenBuffer location 'a1'); +SysCall IntuitionBase 774; + +function ChangeScreenBuffer(sc : pScreen location 'a0'; sb : pScreenBuffer location 'a1') : CARDINAL; +SysCall IntuitionBase 780; + +procedure ScreenDepth(screen : pScreen location 'a0'; flags : CARDINAL location 'd0'; reserved : POINTER location 'a1'); +SysCall IntuitionBase 786; + +procedure ScreenPosition(screen : pScreen location 'a0'; flags : CARDINAL location 'd0'; x1 : LongInt location 'd1'; y1 : LongInt location 'd2'; x2 : LongInt location 'd3'; y2 : LongInt location 'd4'); +SysCall IntuitionBase 792; + +procedure ScrollWindowRaster(win : pWindow location 'a1'; dx : LongInt location 'd0'; dy : LongInt location 'd1'; xMin : LongInt location 'd2'; yMin : LongInt location 'd3'; xMax : LongInt location 'd4'; yMax : LongInt location 'd5'); +SysCall IntuitionBase 798; + +procedure LendMenus(fromwindow : pWindow location 'a0'; towindow : pWindow location 'a1'); +SysCall IntuitionBase 804; + +function DoGadgetMethodA(gad : pGadget location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; message : pLongInt location 'a3') : CARDINAL; +SysCall IntuitionBase 810; + +procedure SetWindowPointerA(win : pWindow location 'a0'; taglist : pTagItem location 'a1'); +SysCall IntuitionBase 816; + +function TimedDisplayAlert(alertNumber : CARDINAL location 'd0'; string1 : PChar location 'a0'; height : CARDINAL location 'd1'; time : CARDINAL location 'a1') : LongBool; +SysCall IntuitionBase 822; + +procedure HelpControl(win : pWindow location 'a0'; flags : CARDINAL location 'd0'); +SysCall IntuitionBase 828; + +procedure ShowWindow(win : pWindow location 'a0'); +SysCall IntuitionBase 840; + +procedure HideWindow(win : pWindow location 'a0'); +SysCall IntuitionBase 846; + +function GetSkinInfoAttrA(drawinfo : pDrawInfo location 'a0'; attr : CARDINAL location 'd0'; taglist : pTagItem location 'a1') : CARDINAL; +SysCall IntuitionBase 918; + +function GetDrawInfoAttr(drawinfo : pDrawInfo location 'a0'; attr : CARDINAL location 'd0'; VAR errorPtr : CARDINAL location 'a1') : CARDINAL; +SysCall IntuitionBase 936; + +procedure WindowAction(window : pWindow location 'a0'; action : CARDINAL location 'd0'; tags : pTagItem location 'a1'); +SysCall IntuitionBase 942; + +function TransparencyControl(window : pWindow location 'a0'; method : CARDINAL location 'd0'; tags : pTagItem location 'a1') : LongBool; +SysCall IntuitionBase 948; + +procedure ScrollWindowRasterNoFill(win : pWindow location 'a1'; dx : LongInt location 'd0'; dy : LongInt location 'd1'; xMin : LongInt location 'd2'; yMin : LongInt location 'd3'; xMax : LongInt location 'd4'; yMax : LongInt location 'd5'); +SysCall IntuitionBase 954; + + +{ Intuition macros } +function INST_DATA (cl: pIClass; o: p_Object): Pointer; +function SIZEOF_INSTANCE (cl: pIClass): Longint; +function BASEOBJECT (o: p_Object): Pointer; +function _OBJ(o: p_Object): p_Object; +function __OBJECT (o: Pointer): p_Object; +function OCLASS (o: Pointer): pIClass; +function SHIFTITEM (n: smallint): word; +function SHIFTMENU (n: smallint): word; +function SHIFTSUB (n: smallint): word; +function FULLMENUNUM (menu, item, sub: smallint): word; +function IM_BGPEN (im: pImage): byte; +function IM_BOX (im: pImage): pIBox; +function IM_FGPEN (im: pImage): byte; +function GADGET_BOX (g: pGadget): pIBox; +function CUSTOM_HOOK (gadget: pGadget): pHook; +function ITEMNUM( n : Word): Word; +function MENUNUM( n : Word): Word; +function SUBNUM( n : Word): Word; + +{ +FUNCTION DisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal) : BOOLEAN; +FUNCTION LockPubScreen(name : string) : pScreen; +FUNCTION MakeClass(classID : string;superClassID : pCHAR;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass; +FUNCTION MakeClass(classID : pCHAR;superClassID : string;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass; +FUNCTION MakeClass(classID : string;superClassID : string;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass; +FUNCTION NewObjectA(classPtr : pIClass;classID : string;tagList : pTagItem) : POINTER; +PROCEDURE SetDefaultPubScreen(name : string); +PROCEDURE SetWindowTitles(window : pWindow;windowTitle : string;screenTitle : pCHAR); +PROCEDURE SetWindowTitles(window : pWindow;windowTitle : pCHAR;screenTitle : string); +PROCEDURE SetWindowTitles(window : pWindow;windowTitle : string;screenTitle : string); +FUNCTION TimedDisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal; time : Cardinal) : BOOLEAN; +PROCEDURE UnlockPubScreen(name : string; screen : pScreen); +} + +{ Helper calls } +function InitIntuitionLibrary : boolean; + + +implementation + +{$WARNING Ugly workaround, this still needs support in the compiler} +function OpenScreenTags(newScreen : pNewScreen; tagList : array of DWord) : pScreen; Inline; +begin + OpenScreenTags:=OpenScreenTagList(newScreen,@tagList); +end; + +function OpenWindowTags(newWindow : pNewWindow; tagList : array of DWord) : pWindow; Inline; +begin + OpenWindowTags:=OpenWindowTagList(newWindow,@tagList); +end; + +function NewObject(classPtr : pIClass; classID : PChar; tags: array of LongWord) : POINTER; inline; +begin + NewObject:=NewObjectA(classPtr, classID, @tags); +end; + + +function INST_DATA (cl: pIClass; o: p_Object): Pointer; +begin + INST_DATA := Pointer(Longint(o) + cl^.cl_InstOffset); +end; + +function SIZEOF_INSTANCE (cl: pIClass): Longint; +begin + SIZEOF_INSTANCE := cl^.cl_InstOffset + cl^.cl_InstSize + sizeof(t_Object); +end; + +function BASEOBJECT (o: p_Object): Pointer; +begin + BASEOBJECT := Pointer(Longint(o) + sizeof(t_Object)); +end; + +function _OBJ(o: p_Object): p_Object; +begin + _OBJ := p_Object(o); +END; + +function __OBJECT (o: Pointer): p_Object; +begin + __OBJECT := p_Object(Longint(o) - sizeof(t_Object)) +end; + +function OCLASS (o: Pointer): pIClass; +var + obj: p_Object; +begin + obj := p_Object(Longint(o) - sizeof(t_Object)); + OCLASS := obj^.o_Class; +end; + +function SHIFTITEM (n: smallint): word; +begin + SHIFTITEM := (n and $3f) shl 5 +end; + +function SHIFTMENU (n: smallint): word; +begin + SHIFTMENU := n and $1f +end; + +function SHIFTSUB (n: smallint): word; +begin + SHIFTSUB := (n and $1f) shl 11 +end; + +function FULLMENUNUM (menu, item, sub: smallint): word; +begin + FULLMENUNUM := ((sub and $1f) shl 11) or + ((item and $3f) shl 5) or + (menu and $1f) +end; + + +{ The next functons _BGPEN AND _FGPEN aren't a full replacement of the + C macros because the C preprocessor makes it possible to set the + A/BPen values of the image class objects as well. This can't work + in pascal, of course! } + +function IM_BGPEN (im: pImage): byte; +begin + IM_BGPEN := im^.PlaneOnOff; +end; + +function IM_BOX (im: pImage): pIBox; +begin + IM_BOX := pIBox(@im^.LeftEdge); +END; + +function IM_FGPEN (im: pImage): byte; +begin + IM_FGPEN := im^.PlanePick; +end; + +function GADGET_BOX (g: pGadget): pIBox; +begin + GADGET_BOX := pIBox(@g^.LeftEdge); +end; + +function CUSTOM_HOOK (gadget: pGadget): pHook; +begin + CUSTOM_HOOK := pHook(gadget^.MutualExclude); +end; + +function ITEMNUM( n : Word): Word; +begin + ITEMNUM := (n shr 5) and $3F +end; + +function MENUNUM( n : Word): Word; +begin + MENUNUM := n and $1f +end; + +function SUBNUM( n : Word): Word; +begin + SUBNUM := (n shr 11) and $1f +end; + +{ +FUNCTION DisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal) : BOOLEAN; +begin + DisplayAlert := DisplayAlert(alertNumber,pas2c(string_),height); +end; + +FUNCTION LockPubScreen(name : string) : pScreen; +begin + LockPubScreen := LockPubScreen(pas2c(name)); +end; + +FUNCTION MakeClass(classID : string;superClassID : pCHAR;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass; +begin + MakeClass := MakeClass(pas2c(classID),superClassID,superClassPtr,instanceSize,flags); +end; + +FUNCTION MakeClass(classID : pCHAR;superClassID : string;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass; +begin + MakeClass := MakeClass(classID,pas2c(superClassID),superClassPtr,instanceSize,flags); +end; + +FUNCTION MakeClass(classID : string;superClassID : string;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass; +begin + MakeClass := MakeClass(pas2c(classID),pas2c(superClassID),superClassPtr,instanceSize,flags); +end; + +FUNCTION NewObjectA(classPtr : pIClass;classID : string;tagList : pTagItem) : POINTER; +begin + NewObjectA := NewObjectA(classPtr,pas2c(classID),taglist); +end; + +PROCEDURE SetDefaultPubScreen(name : string); +begin + SetDefaultPubScreen(pas2c(name)); +end; + +PROCEDURE SetWindowTitles(window : pWindow;windowTitle : string;screenTitle : pCHAR); +begin + SetWindowTitles(window,pas2c(windowTitle),screenTitle); +end; + +PROCEDURE SetWindowTitles(window : pWindow;windowTitle : pCHAR;screenTitle : string); +begin + SetWindowTitles(window,windowTitle,pas2c(screenTitle)); +end; + +PROCEDURE SetWindowTitles(window : pWindow;windowTitle : string;screenTitle : string); +begin + SetWindowTitles(window,pas2c(windowTitle),pas2c(screenTitle)); +end; + +FUNCTION TimedDisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal; time : Cardinal) : BOOLEAN; +begin + TimedDisplayAlert := TimedDisplayAlert(alertNumber,pas2c(string_),height,time); +end; + +PROCEDURE UnlockPubScreen(name : string; screen : pScreen); +begin + UnlockPubScreen(pas2c(name),screen); +end; +} + + +const + { Change VERSION and LIBVERSION to proper values } + VERSION : string[2] = '50'; + LIBVERSION : longword = 50; + +var + intuition_exit : Pointer; + +procedure CloseIntuitionLibrary; +begin + ExitProc := intuition_exit; + if IntuitionBase <> nil then begin + CloseLibrary(PLibrary(IntuitionBase)); + IntuitionBase := nil; + end; +end; + +function InitIntuitionLibrary : boolean; +begin + IntuitionBase := nil; + IntuitionBase := OpenLibrary(INTUITIONNAME,LIBVERSION); + if IntuitionBase <> nil then begin + intuition_exit := ExitProc; + ExitProc := @CloseIntuitionLibrary; + InitIntuitionLibrary:=True; + end else begin + InitIntuitionLibrary:=False; + end; +end; + + +end. (* UNIT INTUITION *) + diff --git a/packages/morphunits/src/keymap.pas b/packages/morphunits/src/keymap.pas new file mode 100644 index 0000000000..16b73809e4 --- /dev/null +++ b/packages/morphunits/src/keymap.pas @@ -0,0 +1,141 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2007 by Karoly Balogh + + keymap.library interface unit for MorphOS/PowerPC + Based on the Commodore Amiga/68k port by Nils Sjoholm + + 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. + + **********************************************************************} +{$PACKRECORDS 2} +unit keymap; + +INTERFACE + +uses exec, inputevent; + +Type + + pKeyMap = ^tKeyMap; + tKeyMap = record + km_LoKeyMapTypes : Pointer; + km_LoKeyMap : Pointer; + km_LoCapsable : Pointer; + km_LoRepeatable : Pointer; + km_HiKeyMapTypes : Pointer; + km_HiKeyMap : Pointer; + km_HiCapsable : Pointer; + km_HiRepeatable : Pointer; + end; + + + pKeymapNode = ^tKeyMapNode; + tKeyMapNode = record + kn_Node : tNode; { including name of keymap } + kn_KeyMap : tKeyMap; + end; + +{ the structure of keymap.resource } + + pKeyMapResource = ^tKeyMapResource; + tKeyMapResource = record + kr_Node : tNode; + kr_List : tList; { a list of KeyMapNodes } + end; + + +Const + +{ Key Map Types } + + KC_NOQUAL = 0; + KC_VANILLA = 7; { note that SHIFT+ALT+CTRL is VANILLA } + KCB_SHIFT = 0; + KCF_SHIFT = $01; + KCB_ALT = 1; + KCF_ALT = $02; + KCB_CONTROL = 2; + KCF_CONTROL = $04; + KCB_DOWNUP = 3; + KCF_DOWNUP = $08; + + KCB_DEAD = 5; { may be dead or modified by dead key: } + KCF_DEAD = $20; { use dead prefix bytes } + + KCB_STRING = 6; + KCF_STRING = $40; + + KCB_NOP = 7; + KCF_NOP = $80; + + +{ Dead Prefix Bytes } + + DPB_MOD = 0; + DPF_MOD = $01; + DPB_DEAD = 3; + DPF_DEAD = $08; + + DP_2DINDEXMASK = $0f; { mask for index for 1st of two dead keys } + DP_2DFACSHIFT = 4; { shift for factor for 1st of two dead keys } + +var + KeymapBase : pLibrary; + +const + KEYMAPNAME : PChar = 'keymap.library'; + +procedure SetKeyMapDefault(CONST keyMap : pKeyMap location 'a0'); +SysCall KeymapBase 030; + +function AskKeyMapDefault : pKeyMap; +SysCall KeymapBase 036; + +function MapRawKey(CONST event : pInputEvent location 'a0'; buffer : pSHORTINT location 'a1'; length : longint location 'd1'; CONST keyMap : pKeyMap location 'a2') : INTEGER; +SysCall KeymapBase 042; + +function MapANSI(CONST strg : pSHORTINT location 'a0'; count : longint location 'd0'; buffer : pSHORTINT location 'a1'; length : longint location 'd1'; CONST keyMap : pKeyMap location 'a2') : longint; +SysCall KeymapBase 048; + +{ Helper calls } +function InitKeymapLibrary : boolean; + +implementation + +const + { Change VERSION and LIBVERSION to proper values } + VERSION : string[2] = '50'; + LIBVERSION : longword = 50; + +var + keymap_exit : Pointer; + +procedure CloseKeymapLibrary; +begin + ExitProc := keymap_exit; + if KeymapBase <> nil then begin + CloseLibrary(PLibrary(KeymapBase)); + KeymapBase := nil; + end; +end; + +function InitKeymapLibrary : boolean; +begin + KeymapBase := nil; + KeymapBase := OpenLibrary(KEYMAPNAME,LIBVERSION); + if KeymapBase <> nil then begin + keymap_exit := ExitProc; + ExitProc := @CloseKeymapLibrary; + InitKeymapLibrary:=True; + end else begin + InitKeymapLibrary:=False; + end; +end; + +end. diff --git a/packages/morphunits/src/kvm.pas b/packages/morphunits/src/kvm.pas new file mode 100644 index 0000000000..8cd471ca7d --- /dev/null +++ b/packages/morphunits/src/kvm.pas @@ -0,0 +1,78 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2006 Karoly Balogh + member of the Free Pascal Development Team + + Keyboard/Video/Mouse helper unit for Amiga/MorphOS + + 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 kvm; + +interface + +uses + exec, intuition, agraphics; + + +function initKVM: boolean; +procedure doneKVM; + + + +implementation + + +var + kvmWindow: PWindow; + +const + DEFAULT_WINWIDTH = 80; + DEFAULT_WINHEIGHT = 25; + +const + CHAR_XSIZE = 8; + CHAR_YSIZE = 16; + + + + +function initKVM: boolean; +begin + initKVM:=false; + kvmWindow:=OpenWindowTags(nil, [ + WA_Left,50, + WA_Top, 50, + WA_InnerWidth, DEFAULT_WINWIDTH *CHAR_XSIZE, + WA_InnerHeight,DEFAULT_WINHEIGHT*CHAR_YSIZE, + WA_IDCMP, IDCMP_VANILLAKEY or IDCMP_RAWKEY, + WA_Title,DWord(PChar('Free Pascal Video Output')), + WA_Flags,(WFLG_GIMMEZEROZERO or + WFLG_SMART_REFRESH or + WFLG_NOCAREREFRESH or + WFLG_ACTIVATE or + WFLG_DRAGBAR or + WFLG_DEPTHGADGET) + ]); + + if kvmWindow<>nil then initKVM:=true; +end; + + +procedure doneKVM; +begin + if kvmWindow <> nil then CloseWindow(kvmWindow); +end; + + +begin + InitGraphicsLibrary; + InitIntuitionLibrary; +end. diff --git a/packages/morphunits/src/layers.pas b/packages/morphunits/src/layers.pas new file mode 100644 index 0000000000..0082e07fe2 --- /dev/null +++ b/packages/morphunits/src/layers.pas @@ -0,0 +1,231 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + layers.library interface unit for MorphOS/PowerPC + + Based on work of Nils Sjoholm member of the Amiga RTL + development team. + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} + +{$PACKRECORDS 2} +unit layers; + +interface + +uses exec, agraphics, utility; + +const + LAYERSIMPLE = 1; + LAYERSMART = 2; + LAYERSUPER = 4; + LAYERUPDATING = $10; + LAYERBACKDROP = $40; + LAYERREFRESH = $80; + LAYER_CLIPRECTS_LOST = $100; { during BeginUpdate } + { or during layerop } + { this happens if out of memory } + LMN_REGION = -1; + +type + pLayer_Info = ^tLayer_Info; + tLayer_Info = packed record + top_layer : pLayer; + check_lp : pLayer; { !! Private !! } + obs : pClipRect; + FreeClipRects : pClipRect; { !! Private !! } + PrivateReserve1, { !! Private !! } + PrivateReserve2 : Longint; { !! Private !! } + Lock : tSignalSemaphore; { !! Private !! } + gs_Head : tMinList; { !! Private !! } + PrivateReserve3 : smallint; { !! Private !! } + PrivateReserve4 : Pointer; { !! Private !! } + Flags : WORD; + fatten_count : Shortint; { !! Private !! } + LockLayersCount : Shortint; { !! Private !! } + PrivateReserve5 : smallint; { !! Private !! } + BlankHook, { !! Private !! } + LayerInfo_extra : Pointer; { !! Private !! } + end; + +const + NEWLAYERINFO_CALLED = 1; + +{ + * LAYERS_NOBACKFILL is the value needed to get no backfill hook + * LAYERS_BACKFILL is the value needed to get the default backfill hook + } + LAYERS_NOBACKFILL = 1; + LAYERS_BACKFILL = 0; + + LAYERSNAME : PChar = 'layers.library'; + +var + LayersBase : PLibrary; + +procedure InitLayers(li : pLayer_Info location 'a0'); +SysCall LayersBase 030; + +function CreateUpfrontLayer(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LongInt location 'd0'; y0 : LongInt location 'd1'; x1 : LongInt location 'd2'; y1 : LongInt location 'd3'; flags : LongInt location 'd4'; bm2 : pBitMap location 'a2') : pLayer; +SysCall LayersBase 036; + +function CreateBehindLayer(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LongInt location 'd0'; y0 : LongInt location 'd1'; x1 : LongInt location 'd2'; y1 : LongInt location 'd3'; flags : LongInt location 'd4'; bm2 : pBitMap location 'a2') : pLayer; +SysCall LayersBase 042; + +function UpfrontLayer(dummy : LongInt location 'a0'; layer : pLayer location 'a1') : LongInt; +SysCall LayersBase 048; + +function BehindLayer(dummy : LongInt location 'a0'; layer : pLayer location 'a1') : LongInt; +SysCall LayersBase 054; + +function MoveLayer(dummy : LongInt location 'a0'; layer : pLayer location 'a1'; dx : LongInt location 'd0'; dy : LongInt location 'd1') : LongInt; +SysCall LayersBase 060; + +function SizeLayer(dummy : LongInt location 'a0'; layer : pLayer location 'a1'; dx : LongInt location 'd0'; dy : LongInt location 'd1') : LongInt; +SysCall LayersBase 066; + +procedure ScrollLayer(dummy : LongInt location 'a0'; layer : pLayer location 'a1'; dx : LongInt location 'd0'; dy : LongInt location 'd1'); +SysCall LayersBase 072; + +function BeginUpdate(l : pLayer location 'a0') : LongInt; +SysCall LayersBase 078; + +procedure EndUpdate(layer : pLayer location 'a0'; flag : CARDINAL location 'd0'); +SysCall LayersBase 084; + +function DeleteLayer(dummy : LongInt location 'a0'; layer : pLayer location 'a1') : LongInt; +SysCall LayersBase 090; + +procedure LockLayer(dummy : LongInt location 'a0'; layer : pLayer location 'a1'); +SysCall LayersBase 096; + +procedure UnlockLayer(layer : pLayer location 'a0'); +SysCall LayersBase 102; + +procedure LockLayers(li : pLayer_Info location 'a0'); +SysCall LayersBase 108; + +procedure UnlockLayers(li : pLayer_Info location 'a0'); +SysCall LayersBase 114; + +procedure LockLayerInfo(li : pLayer_Info location 'a0'); +SysCall LayersBase 120; + +procedure SwapBitsRastPortClipRect(rp : pRastPort location 'a0'; cr : pClipRect location 'a1'); +SysCall LayersBase 126; + +function WhichLayer(li : pLayer_Info location 'a0'; x : LongInt location 'd0'; y : LongInt location 'd1') : pLayer; +SysCall LayersBase 132; + +procedure UnlockLayerInfo(li : pLayer_Info location 'a0'); +SysCall LayersBase 138; + +function NewLayerInfo : pLayer_Info; +SysCall LayersBase 144; + +procedure DisposeLayerInfo(li : pLayer_Info location 'a0'); +SysCall LayersBase 150; + +function FattenLayerInfo(li : pLayer_Info location 'a0') : LongInt; +SysCall LayersBase 156; + +procedure ThinLayerInfo(li : pLayer_Info location 'a0'); +SysCall LayersBase 162; + +function MoveLayerInFrontOf(layer_to_move : pLayer location 'a0'; other_layer : pLayer location 'a1') : LongInt; +SysCall LayersBase 168; + +function InstallClipRegion(layer : pLayer location 'a0'; CONST region : pRegion location 'a1') : pRegion; +SysCall LayersBase 174; + +function MoveSizeLayer(layer : pLayer location 'a0'; dx : LongInt location 'd0'; dy : LongInt location 'd1'; dw : LongInt location 'd2'; dh : LongInt location 'd3') : LongInt; +SysCall LayersBase 180; + +function CreateUpfrontHookLayer(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LongInt location 'd0'; y0 : LongInt location 'd1'; x1 : LongInt location 'd2'; y1 : LongInt location 'd3'; flags : LongInt location 'd4'; hook : pHook location 'a3'; bm2 : pBitMap location 'a2') : pLayer; +SysCall LayersBase 186; + +function CreateBehindHookLayer(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LongInt location 'd0'; y0 : LongInt location 'd1'; x1 : LongInt location 'd2'; y1 : LongInt location 'd3'; flags : LongInt location 'd4'; hook : pHook location 'a3'; bm2 : pBitMap location 'a2') : pLayer; +SysCall LayersBase 192; + +function InstallLayerHook(layer : pLayer location 'a0'; hook : pHook location 'a1') : pHook; +SysCall LayersBase 198; + +function InstallLayerInfoHook(li : pLayer_Info location 'a0'; CONST hook : pHook location 'a1') : pHook; +SysCall LayersBase 204; + +procedure SortLayerCR(layer : pLayer location 'a0'; dx : LongInt location 'd0'; dy : LongInt location 'd1'); +SysCall LayersBase 210; + +procedure DoHookClipRects(hook : pHook location 'a0'; rport : pRastPort location 'a1'; CONST rect : pRectangle location 'a2'); +SysCall LayersBase 216; + +function InstallTransparentRegion(l : pLayer location 'a0'; r : pRegion location 'a1') : pRegion; +SysCall LayersBase 222; + +function InstallTransparentRegionHook(l : pLayer location 'a0'; h : pHook location 'a1') : pHook; +SysCall LayersBase 228; + +function CreateUpfrontLayerTagList(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LongInt location 'd0'; y0 : LongInt location 'd1'; x1 : LongInt location 'd2'; y1 : LongInt location 'd3'; flags : LongInt location 'd4'; taglist : pTagItem location 'a2') : pLayer; +SysCall LayersBase 234; + +function CreateBehindLayerTagList(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LongInt location 'd0'; y0 : LongInt location 'd1'; x1 : LongInt location 'd2'; y1 : LongInt location 'd3'; flags : LongInt location 'd4'; taglist : pTagItem location 'a2') : pLayer; +SysCall LayersBase 240; + +{ + Functions and procedures with array of const go here +} +{ +function CreateUpfrontLayerTags(li : pLayer_Info; bm : pBitMap; x0 : LongInt; y0 : LongInt; x1 : LongInt; y1 : LongInt; flags : LongInt; const taglist : Array Of Const) : pLayer; +function CreateBehindLayerTags(li : pLayer_Info; bm : pBitMap; x0 : LongInt; y0 : LongInt; x1 : LongInt; y1 : LongInt; flags : LongInt; const taglist : Array Of Const) : pLayer; +} + + +{ Helper func } +function InitLayersLibrary : boolean; + + +implementation + +const + { Change VERSION and LIBVERSION to proper values } + VERSION : string[2] = '50'; + LIBVERSION : longword = 50; + +var + layers_exit : Pointer; + +procedure CloseLayersLibrary; +begin + ExitProc := layers_exit; + if LayersBase <> nil then begin + CloseLibrary(LayersBase); + LayersBase := nil; + end; +end; + +function InitLayersLibrary : boolean; +begin + LayersBase := nil; + LayersBase := OpenLibrary(LAYERSNAME,LIBVERSION); + if LayersBase <> nil then begin + layers_exit := ExitProc; + ExitProc := @CloseLayersLibrary; + InitLayersLibrary:=True; + end else begin + InitLayersLibrary:=False; + end; +end; + + +end. diff --git a/packages/morphunits/src/mui.pas b/packages/morphunits/src/mui.pas new file mode 100644 index 0000000000..ffa590c1f8 --- /dev/null +++ b/packages/morphunits/src/mui.pas @@ -0,0 +1,3848 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2005 Karoly Balogh + + muimaster.library interface unit for MorphOS/PowerPC + + Based on work of Nils Sjoholm member of the Amiga RTL + development team. + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} +{$mode objfpc} +{$packrecords 2} +{$inline on} +unit mui; + +interface + + { + + MUI - MagicUserInterface + (c) 1993-1997 Stefan Stuntz + + Main Header File + + + Class Tree + + + rootclass (BOOPSI's base class) + +--Notify (implements notification mechanism) + ! +--Family (handles multiple children) + ! ! +--Menustrip (describes a complete menu strip) + ! ! +--Menu (describes a single menu) + ! ! \--Menuitem (describes a single menu item) + ! +--Application (main class for all applications) + ! +--Window (main class for all windows) + ! ! \--Aboutmui (About window of MUI preferences) + ! +--Area (base class for all GUI elements) + ! +--Rectangle (spacing object) + ! +--Balance (balancing separator bar) + ! +--Image (image display) + ! +--Bitmap (draws bitmaps) + ! ! \--Bodychunk (makes bitmap from ILBM body chunk) + ! +--Text (text display) + ! +--Gadget (base class for intuition gadgets) + ! ! +--String (string gadget) + ! ! +--Boopsi (interface to BOOPSI gadgets) + ! ! \--Prop (proportional gadget) + ! +--Gauge (fule gauge) + ! +--Scale (percentage scale) + ! +--Colorfield (field with changeable color) + ! +--List (line-oriented list) + ! ! +--Floattext (special list with floating text) + ! ! +--Volumelist (special list with volumes) + ! ! +--Scrmodelist (special list with screen modes) + ! ! \--Dirlist (special list with files) + ! +--Numeric (base class for slider gadgets) + ! ! +--Knob (turning knob) + ! ! +--Levelmeter (level display) + ! ! +--Numericbutton (space saving popup slider) + ! ! \--Slider (traditional slider) + ! +--Framedisplay (private) + ! ! \--Popframe (private) + ! +--Imagedisplay (private) + ! ! \--Popimage (private) + ! +--Pendisplay (displays a pen specification) + ! ! \--Poppen (popup button to adjust a pen spec) + ! +--Group (groups other GUI elements) + ! +--Mccprefs (private) + ! +--Register (handles page groups with titles) + ! ! \--Penadjust (group to adjust a pen) + ! +--Settingsgroup (private) + ! +--Settings (private) + ! +--Frameadjust (private) + ! +--Imageadjust (private) + ! +--Virtgroup (handles virtual groups) + ! +--Scrollgroup (virtual groups with scrollbars) + ! +--Scrollbar (traditional scrollbar) + ! +--Listview (listview) + ! +--Radio (radio button) + ! +--Cycle (cycle gadget) + ! +--Coloradjust (several gadgets to adjust a color) + ! +--Palette (complete palette gadget) + ! +--Popstring (base class for popup objects) + ! +--Popobject (popup aynthing in a separate window) + ! ! +--Poplist (popup a simple listview) + ! ! \--Popscreen (popup a list of public screens) + ! \--Popasl (popup an asl requester) + +--Semaphore (semaphore equipped objects) + +--Applist (private) + +--Dataspace (handles general purpose data spaces) + \--Configdata (private) + + + General Header File Information + + + All macro and structure definitions follow these rules: + + Name Meaning + + MUIC_<class> Name of a class + MUIM_<class>_<method> Method + MUIP_<class>_<method> Methods parameter structure + MUIV_<class>_<method>_<x> Special method value + MUIA_<class>_<attrib> Attribute + MUIV_<class>_<attrib>_<x> Special attribute value + MUIE_<error> Error return code from MUI_Error() + MUII_<name> Standard MUI image + MUIX_<code> Control codes for text strings + MUIO_<name> Object type for MUI_MakeObject() + + MUIA_... attribute definitions are followed by a comment + consisting of the three possible letters I, S and G. + I: it's possible to specify this attribute at object creation time. + S: it's possible to change this attribute with SetAttrs(). + G: it's possible to get this attribute with GetAttr(). + + Items marked with "Custom Class" are for use in custom classes only! + } + +uses exec, intuition,utility,agraphics{,iffparse}; +{$WARNING IffParse required, look for FIX ME!!!} + +var + MUIMasterBase : pLibrary; + +const + MUIMASTER_NAME : PChar = 'muimaster.library'; + MUIMASTER_VMIN = 11; + MUIMASTER_VLATEST = 19; + +const + MUI_TRUE = 1; + MUI_FALSE = 0; + +const + MUI_END = TAG_DONE; // this can be used instead of C End + + { + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + Warning, some of the macros in this header file work only with + muimaster.library V11 and above. If you recompile your programs, + be sure to open muimaster.library with MUIMASTER_VMIN as version number. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + } + + { + Config items for MUIM_GetConfigItem + } + MUICFG_PublicScreen = 36; + { + Black box specification structures for images, pens, frames + } + + type + plongword = ^longword; + + tMUI_PenSpec = record + buf : array[0..31] of char; + end; + pMUI_PenSpec = ^tMUI_PenSpec; + + { + Public Screen Stuff + } + { + NOTE: This stuff is only included to allow compilation of the supplied + public screen manager for educational purposes. Everything + here is subject to change without notice and I guarantee to + do that just for fun! + More info can be found in the screen manager source file. + } + + const + PSD_INITIAL_NAME : PChar = '(unnamed)'; + PSD_INITIAL_TITLE : PChar = 'MUI Public Screen'; + + + + const + PSD_NAME_FRONTMOST : PChar = '«Frontmost»'; + PSD_FILENAME_SAVE : PChar = 'envarc:mui/PublicScreens.iff'; + PSD_FILENAME_USE : PChar = 'env:mui/PublicScreens.iff'; + PSD_MAXLEN_NAME = 32; + PSD_MAXLEN_TITLE = 128; + PSD_MAXLEN_FONT = 48; + PSD_MAXLEN_BACKGROUND = 256; + PSD_NUMCOLS = 8; + PSD_MAXSYSPENS = 20; + PSD_NUMSYSPENS = 12; + PSD_MAXMUIPENS = 10; + PSD_NUMMUIPENS = 8; + + type + tMUI_RGBcolor = record + red : LongWord; + green : LongWord; + blue : LongWord; + end; + + pMUI_RGBColor = ^tMUI_RGBColor; + + tMUI_PubScreenDesc = record + Version : LongInt; + Name : array[0..(PSD_MAXLEN_NAME)-1] of char; + Title : array[0..(PSD_MAXLEN_TITLE)-1] of char; + Font : array[0..(PSD_MAXLEN_FONT)-1] of char; + Background : array[0..(PSD_MAXLEN_BACKGROUND)-1] of char; + DisplayID : LongWord; + DisplayWidth : WORD; + DisplayHeight : WORD; + DisplayDepth : BYTE; + OverscanType : BYTE; + AutoScroll : BYTE; + NoDrag : BYTE; + Exclusive : BYTE; + Interleaved : BYTE; + SysDefault : BYTE; + Behind : BYTE; + AutoClose : BYTE; + CloseGadget : BYTE; + DummyWasForeign : BYTE; + SystemPens : array[0..(PSD_MAXSYSPENS)-1] of BYTE; + Reserved : array[0..((1 + (7 * 4)) - PSD_MAXSYSPENS)-1] of BYTE; + Palette : array[0..(PSD_NUMCOLS)-1] of tMUI_RGBcolor; + rsvd : array[0..(PSD_MAXSYSPENS - PSD_NUMCOLS)-1] of tMUI_RGBcolor; + rsvd2 : array[0..(PSD_MAXMUIPENS)-1] of tMUI_PenSpec; + Changed : LongInt; + UserData : Pointer; + end; + pMUI_PubScreenDesc = ^tMUI_PubScreenDesc; + + tMUIS_InfoClient = record + node : tMinNode; + task : PTask; + sigbit : LongWord; + end; + pMUIS_InfoClient = ^tMUIS_InfoClient; + + + +{ ** Object Types for MUI_MakeObject() } +{ ************************************************************************* } + +const + MUIO_Label = 1; { PChar label, LongWord flags } + MUIO_Button = 2; { PChar label } + MUIO_Checkmark = 3; { PChar label } + MUIO_Cycle = 4; { PChar label, PChar entries } + MUIO_Radio = 5; { PChar label, PChar entries } + MUIO_Slider = 6; { PChar label, LongInt min, LongInt max } + MUIO_String = 7; { PChar label, LongInt maxlen } + MUIO_PopButton = 8; { PChar imagespec } + MUIO_HSpace = 9; { LongInt space } + MUIO_VSpace = 10; { LongInt space } + MUIO_HBar = 11; { LongInt space } + MUIO_VBar = 12; { LongInt space } + MUIO_MenustripNM = 13; { struct NewMenu nm, LongWord flags } + MUIO_Menuitem = 14; { PChar label, PChar shortcut, LongWord flags, LongWord data } + MUIO_BarTitle = 15; { PChar label } + MUIO_NumericButton = 16; { PChar label, LongInt min, LongInt max, PChar format } + + MUIO_Menuitem_CopyStrings = 1 shl 30; + + MUIO_Label_SingleFrame = 1 shl 8; + MUIO_Label_DoubleFrame = 1 shl 9; + MUIO_Label_LeftAligned = 1 shl 10; + MUIO_Label_Centered = 1 shl 11; + MUIO_Label_FreeVert = 1 shl 12; + + MUIO_MenustripNM_CommandKeyCheck = 1 shl 0; { check for "localized" menu items such as "O\0Open" } + + + +{ ** ARexx Interface } +{ ************************************************************************* } + +type + tMUI_Command = record + mc_Name : Pchar; + mc_Template : Pchar; + mc_Parameters : LongInt; + mc_Hook : PHook; + mc_Reserved : array[0..4] of LongInt; + end; + pMUI_Command = ^tMUI_Command; + +const + MC_TEMPLATE_ID = -1; { MC_TEMPLATE_ID : PCHar = not(0); } + MUI_RXERR_BADDEFINITION = -1; + MUI_RXERR_OUTOFMEMORY = -2; + MUI_RXERR_UNKNOWNCOMMAND = -3; + MUI_RXERR_BADSYNTAX = -4; + + + +{ ** Return values for MUI_Error() } +{ ************************************************************************* } + +const + MUIE_OK = 0; + MUIE_OutOfMemory = 1; + MUIE_OutOfGfxMemory = 2; + MUIE_InvalidWindowObject = 3; + MUIE_MissingLibrary = 4; + MUIE_NoARexx = 5; + MUIE_SingleTask = 6; + + + +{ ** Standard MUI Images & Backgrounds } +{ ************************************************************************* } + +const + MUII_WindowBack = 0; { These images are configured } + MUII_RequesterBack = 1; { with the preferences program. } + MUII_ButtonBack = 2; + MUII_ListBack = 3; + MUII_TextBack = 4; + MUII_PropBack = 5; + MUII_PopupBack = 6; + MUII_SelectedBack = 7; + MUII_ListCursor = 8; + MUII_ListSelect = 9; + MUII_ListSelCur = 10; + MUII_ArrowUp = 11; + MUII_ArrowDown = 12; + MUII_ArrowLeft = 13; + MUII_ArrowRight = 14; + MUII_CheckMark = 15; + MUII_RadioButton = 16; + MUII_Cycle = 17; + MUII_PopUp = 18; + MUII_PopFile = 19; + MUII_PopDrawer = 20; + MUII_PropKnob = 21; + MUII_Drawer = 22; + MUII_HardDisk = 23; + MUII_Disk = 24; + MUII_Chip = 25; + MUII_Volume = 26; + MUII_RegisterBack = 27; + MUII_Network = 28; + MUII_Assign = 29; + MUII_TapePlay = 30; + MUII_TapePlayBack = 31; + MUII_TapePause = 32; + MUII_TapeStop = 33; + MUII_TapeRecord = 34; + MUII_GroupBack = 35; + MUII_SliderBack = 36; + MUII_SliderKnob = 37; + MUII_TapeUp = 38; + MUII_TapeDown = 39; + MUII_PageBack = 40; + MUII_ReadListBack = 41; + MUII_PopFont = 42; + MUII_ImageButtonBack = 43; + MUII_ImageSelectedBack = 44; + MUII_GaugeFull = 45; + MUII_GaugeEmpty = 46; + MUII_Menudisplay = 47; + MUII_PullOpen = 48; + MUII_StringBack = 49; + MUII_StringActiveBack = 50; + MUII_Count = 51; + + MUII_BACKGROUND = 128; { These are direct color } + MUII_SHADOW = 129; { combinations and are not } + MUII_SHINE = 130; { affected by users prefs. } + MUII_FILL = 131; + MUII_SHADOWBACK = 132; { Generally, you should } + MUII_SHADOWFILL = 133; { avoid using them. Better } + MUII_SHADOWSHINE = 134; { use one of the customized } + MUII_FILLBACK = 135; { images above. } + MUII_FILLSHINE = 136; + MUII_SHINEBACK = 137; + MUII_FILLBACK2 = 138; + MUII_HSHINEBACK = 139; + MUII_HSHADOWBACK = 140; + MUII_HSHINESHINE = 141; + MUII_HSHADOWSHADOW = 142; + MUII_MARKSHINE = 143; + MUII_MARKHALFSHINE = 144; + MUII_MARKBACKGROUND = 145; + MUII_BARBLOCK = 146; + MUII_BARDETAIL = 147; + MUII_LASTPAT = 147; + + + +{ ** Special values for some methods } +{ ************************************************************************* } + +const + MUIV_TriggerValue = $49893131; + MUIV_NotTriggerValue = $49893133; + MUIV_EveryTime = $49893131; + + MUIV_Notify_Self = 1; + MUIV_Notify_Window = 2; + MUIV_Notify_Application = 3; + MUIV_Notify_Parent = 4; + MUIV_Notify_ParentParent = 5; + MUIV_Notify_ParentParentParent = 6; + +const + MUIV_Application_ReturnID_Quit = -1; + + MUIV_List_Insert_Top = 0; + MUIV_List_Insert_Active = -1; + MUIV_List_Insert_Sorted = -2; + MUIV_List_Insert_Bottom = -3; + + MUIV_List_Remove_First = 0; + MUIV_List_Remove_Active = -1; + MUIV_List_Remove_Last = -2; + MUIV_List_Remove_Selected = -3; + + MUIV_List_Select_Off = 0; + MUIV_List_Select_On = 1; + MUIV_List_Select_Toggle = 2; + MUIV_List_Select_Ask = 3; + + MUIV_List_GetEntry_Active = -1; + MUIV_List_EditEntry_Active = -1; + MUIV_List_Select_Active = -1; + MUIV_List_Select_All = -2; + + MUIV_List_Redraw_Active = -1; + MUIV_List_Redraw_All = -2; + + MUIV_List_Move_Top = 0; + MUIV_List_Move_Active = -1; + MUIV_List_Move_Bottom = -2; + MUIV_List_Move_Next = -3; { only valid for second parameter } + MUIV_List_Move_Previous = -4; { only valid for second parameter } + + MUIV_List_Exchange_Top = 0; + MUIV_List_Exchange_Active = -1; + MUIV_List_Exchange_Bottom = -2; + MUIV_List_Exchange_Next = -3; { only valid for second parameter } + MUIV_List_Exchange_Previous = -4; { only valid for second parameter } + + MUIV_List_Jump_Top = 0; + MUIV_List_Jump_Active = -1; + MUIV_List_Jump_Bottom = -2; + MUIV_List_Jump_Up = -4; + MUIV_List_Jump_Down = -3; + + MUIV_List_NextSelected_Start = -1; + MUIV_List_NextSelected_End = -1; + + MUIV_DragQuery_Refuse = 0; + MUIV_DragQuery_Accept = 1; + + MUIV_DragReport_Abort = 0; + MUIV_DragReport_Continue = 1; + MUIV_DragReport_Lock = 2; + MUIV_DragReport_Refresh = 3; + + MUIV_CreateBubble_DontHidePointer = (1<<0); + + MUIV_Application_OCW_ScreenPage = (1<<1); { show just the screen page of the config window } + + MUIV_ContextMenuBuild_Default = $ffffffff; + +{ FIX ME!!! #define MUIV_PushMethod_Delay(millis) MIN(0x0ffffff0,(((ULONG)millis)<<8)) } + + MUIV_Family_GetChild_First = 0; + MUIV_Family_GetChild_Last = -1; + MUIV_Family_GetChild_Next = -2; + MUIV_Family_GetChild_Previous = -3; + MUIV_Family_GetChild_Iterate = -4; + + MUIV_Group_GetChild_First = MUIV_Family_GetChild_First; + MUIV_Group_GetChild_Last = MUIV_Family_GetChild_Last; + MUIV_Group_GetChild_Next = MUIV_Family_GetChild_Next; + MUIV_Group_GetChild_Previous = MUIV_Family_GetChild_Previous; + MUIV_Group_GetChild_Iterate = MUIV_Family_GetChild_Iterate; + + + +{ ** Control codes for text strings } +{ ************************************************************************* } + +const + MUIX_R = #27+'r'; { right justified } + MUIX_C = #27+'c'; { centered } + MUIX_L = #27+'l'; { left justified } + + MUIX_N = #27+'n'; { normal } + MUIX_B = #27+'b'; { bold } + MUIX_I = #27+'i'; { italic } + MUIX_U = #27+'u'; { underlined } + + MUIX_PT = #27+'2'; { text pen } + MUIX_PH = #27+'8'; { highlight text pen } + + + +{ ** Parameter structures for some classes } +{ ************************************************************************* } + +{$WARNING Clean this mess... } + + type + tMUI_Palette_Entry = record + mpe_ID : LongInt; + mpe_Red : LongWord; + mpe_Green : LongWord; + mpe_Blue : LongWord; + mpe_Group : LongInt; + end; + pMUI_Palette_Entry = ^tMUI_Palette_Entry; + + const + MUIV_Palette_Entry_End = (-1); + { } + { Application Input Handler } + { } + { see below } + + type + tMUI_InputHandlerNode = record + ihn_Node : tMinNode; + ihn_Object : pObject_; + ihn_stuff : record + case longint of + 0 : ( ihn_sigs : LongWord ); + 1 : ( ihn_timer : record + ihn_millis : WORD; + ihn_current : WORD; + end ); + end; + ihn_Flags : LongWord; + ihn_Method : LongWord; + end; + pMUI_InputHandlerNode = ^tMUI_InputHandlerNode; + + const + { ihn_Signals = ihn_stuff.ihn_sigs; + ihn_Millis = ihn_stuff.(ihn_timer.ihn_millis); + ihn_Current = ihn_stuff.(ihn_timer.ihn_current); } + { Flags for ihn_Flags } + { set ihn_Ticks to number of 1/100 sec ticks you want to be triggered } + MUIIHNF_TIMER = 1 shl 0; + { } + { Window Event Handler } + { } + { don't touch! } + { event handlers are inserted according to their priority. } + { certain flags, see below for definitions. } + { object which should receive MUIM_HandleEvent. } + { if !=NULL, MUIM_HandleEvent is invoked on exactly this class with CoerceMethod(). } + { one or more IDCMP flags this handler should react on. } + + type + tMUI_EventHandlerNode = record + ehn_Node : tMinNode; + ehn_Reserved : BYTE; + ehn_Priority : BYTE; + ehn_Flags : WORD; + ehn_Object : pObject_; + ehn_Class : PIClass; + ehn_Events : LongWord; + end; + pMUI_EventHandlerNode = ^tMUI_EventHandlerNode; + { flags for ehn_Flags } + + const + MUI_EHF_ALWAYSKEYS = 1 shl 0; + { other values reserved for future use } + { return values for MUIM_HandleEvent (bit-masked, all other bits must be 0) } + { stop MUI from calling other handlers } + MUI_EventHandlerRC_Eat = 1 shl 0; + { } + { List Position Test } + { } + { number of entry, -1 if mouse not over valid entry } + { numer of column, -1 if no valid column } + { see below } + { x offset of mouse click relative to column start } + { y offset of mouse click from center of line + (negative values mean click was above center, + positive values mean click was below center) } + + type + tMUI_List_TestPos_Result = record + entry : LongInt; + column : WORD; + flags : WORD; + xoffset : WORD; + yoffset : WORD; + end; + pMUI_List_TestPos_Result = ^tMUI_List_TestPos_Result; + + const + MUI_LPR_ABOVE = 1 shl 0; + MUI_LPR_BELOW = 1 shl 1; + MUI_LPR_LEFT = 1 shl 2; + MUI_LPR_RIGHT = 1 shl 3; + + { + + For Boopsi Image Implementors Only: + + If MUI is using a boopsi image object, it will send a special method + immediately after object creation. This method has a parameter structure + where the boopsi can fill in its minimum and maximum size and learn if + its used in a horizontal or vertical context. + + The boopsi image must use the method id (MUIM_BoopsiQuery) as return + value. That's how MUI sees that the method is implemented. + + Note: MUI does not depend on this method. If the boopsi image doesn't + implement it, minimum size will be 0 and maximum size unlimited. + + } + { this is send to the boopsi and } + + const + MUIM_BoopsiQuery = $80427157; + { must be used as return value } + { parameter structure } + { always MUIM_BoopsiQuery } + { obsolete, use mbq_RenderInfo } + { read only, see below } + { write only, fill in min width } + { write only, fill in min height } + { write only, fill in max width } + { write only, fill in max height } + { write only, fill in def width } + { write only, fill in def height } + { read only, display context } + { may grow in future ... } + + type + tMUI_RenderInfo = record + mri_WindowObject : pObject_; + mri_Screen : PScreen; + mri_DrawInfo : PDrawInfo; + mri_Pens : ^WORD; + mri_Window : PWindow; + mri_RastPort : PRastPort; + mri_Flags : LongWord; + end; + pMUI_RenderInfo = ^tMUI_RenderInfo; + + type + tMUI_BoopsiQuery = record + mbq_MethodID : LongWord; + mbq_Screen : PScreen; + mbq_Flags : LongWord; + mbq_MinWidth : LongInt; + mbq_MinHeight : LongInt; + mbq_MaxWidth : LongInt; + mbq_MaxHeight : LongInt; + mbq_DefWidth : LongInt; + mbq_DefHeight : LongInt; + mbq_RenderInfo : PMUI_RenderInfo; + end; + pMUI_BoopsiQuery = ^tMUI_BoopsiQuery; + { old structure name } + + + MUIP_BoopsiQuery = tMUI_BoopsiQuery; + + const + { object used in a horizontal } + MBQF_HORIZ = 1 shl 0; + { context (else vertical) } + { use this for unlimited MaxWidth/Height } + MBQ_MUI_MAXMAX = 10000; + + + +{ ** Notify } +{ ************************************************************************* } + +const + MUIC_Notify : PChar = 'Notify.mui'; + +{ ** Methods ** } +const + MUIM_CallHook = $8042b96b; { V4 } + MUIM_Export = $80420f1c; { V12 } + MUIM_FindUData = $8042c196; { V8 } + MUIM_GetConfigItem = $80423edb; { V11 } + MUIM_GetUData = $8042ed0c; { V8 } + MUIM_Import = $8042d012; { V12 } + MUIM_KillNotify = $8042d240; { V4 } + MUIM_KillNotifyObj = $8042b145; { V16 } + MUIM_MultiSet = $8042d356; { V7 } + MUIM_NoNotifySet = $8042216f; { V9 } + MUIM_Notify = $8042c9cb; { V4 } + MUIM_Set = $8042549a; { V4 } + MUIM_SetAsString = $80422590; { V4 } + MUIM_SetUData = $8042c920; { V8 } + MUIM_SetUDataOnce = $8042ca19; { V11 } + MUIM_WriteLong = $80428d86; { V6 } + MUIM_WriteString = $80424bf4; { V6 } + +type + tMUIP_CallHook = record { ... } + MethodID : LongWord; + Hook : PHook; + param1 : LongWord; + end; + pMUIP_CallHook = ^tMUIP_CallHook; + + tMUIP_Export = record + MethodID : LongWord; + dataspace : pObject_; + end; + pMUIP_Export = ^tMUIP_Export; + + tMUIP_FindUData = record + MethodID : LongWord; + udata : LongWord; + end; + pMUIP_FindUData = ^tMUIP_FindUData; + + tMUIP_GetConfigItem = record + MethodID : LongWord; + id : LongWord; + storage : PLongWord; + end; + pMUIP_GetConfigItem = ^tMUIP_GetConfigItem; + + tMUIP_GetUData = record + MethodID : LongWord; + udata : LongWord; + attr : LongWord; + storage : PLongWord; + end; + pMUIP_GetUData = ^tMUIP_GetUData; + + tMUIP_Import = record + MethodID : LongWord; + dataspace : pObject_; + end; + pMUIP_Import = ^tMUIP_Import; + + tMUIP_KillNotify = record + MethodID : LongWord; + TrigAttr : LongWord; + end; + pMUIP_KillNotify = ^tMUIP_KillNotify; + + tMUIP_KillNotifyObj = record + MethodID : LongWord; + TrigAttr : LongWord; + dest : pObject_; + end; + pMUIP_KillNotifyObj = ^tMUIP_KillNotifyObj; + + tMUIP_MultiSet = record { ... } + MethodID : LongWord; + attr : LongWord; + val : LongWord; + obj : Pointer; + end; + pMUIP_MultiSet = ^tMUIP_MultiSet; + + tMUIP_NoNotifySet = record { ... } + MethodID : LongWord; + attr : LongWord; + format : Pchar; + val : LongWord; + end; + pMUIP_NoNotifySet = ^tMUIP_NoNotifySet; + + tMUIP_Notify = record { ... } + MethodID : LongWord; + TrigAttr : LongWord; + TrigVal : LongWord; + DestObj : Pointer; + FollowParams : LongWord; + end; + pMUIP_Notify = ^tMUIP_Notify; + + tMUIP_Set = record + MethodID : LongWord; + attr : LongWord; + val : LongWord; + end; + pMUIP_Set = ^tMUIP_Set; + + tMUIP_SetAsString = record { ... } + MethodID : LongWord; + attr : LongWord; + format : Pchar; + val : LongWord; + end; + pMUIP_SetAsString = ^tMUIP_SetAsString; + + tMUIP_SetUData = record + MethodID : LongWord; + udata : LongWord; + attr : LongWord; + val : LongWord; + end; + pMUIP_SetUData = ^tMUIP_SetUData; + + tMUIP_SetUDataOnce = record + MethodID : LongWord; + udata : LongWord; + attr : LongWord; + val : LongWord; + end; + pMUIP_SetUDataOnce = ^tMUIP_SetUDataOnce; + + tMUIP_WriteLong = record + MethodID : LongWord; + val : LongWord; + memory : PLongWord; + end; + pMUIP_WriteLong = ^tMUIP_WriteLong; + + tMUIP_WriteString = record + MethodID : LongWord; + str : Pchar; + memory : Pchar; + end; + pMUIP_WriteString = ^tMUIP_WriteString; + +{ ** Attributes ** } +const + MUIA_ApplicationObject = $8042d3ee; { V4 ..g Object } + MUIA_AppMessage = $80421955; { V5 ..g struct AppMessage } + MUIA_HelpLine = $8042a825; { V4 isg LongInt } + MUIA_HelpNode = $80420b85; { V4 isg PChar } + MUIA_NoNotify = $804237f9; { V7 .s. BOOL } + MUIA_NoNotifyMethod = $80420a74; { V20 .s. LongWord } + MUIA_ObjectID = $8042d76e; { V11 isg LongWord } + MUIA_Parent = $8042e35f; { V11 ..g Object } + MUIA_Revision = $80427eaa; { V4 ..g LongInt } + MUIA_UserData = $80420313; { V4 isg LongWord } + MUIA_Version = $80422301; { V4 ..g LongInt } + + + +{ ** Family } +{ ************************************************************************* } + +const + MUIC_Family : PChar = 'Family.mui'; + +{ ** Methods ** } +const + MUIM_Family_AddHead = $8042e200; { V8 } + MUIM_Family_AddTail = $8042d752; { V8 } + MUIM_Family_Insert = $80424d34; { V8 } + MUIM_Family_Remove = $8042f8a9; { V8 } + MUIM_Family_Sort = $80421c49; { V8 } + MUIM_Family_Transfer = $8042c14a; { V8 } + +type + tMUIP_Family_AddHead = record + MethodID : LongWord; + obj : pObject_; + end; + pMUIP_Family_AddHead = ^tMUIP_Family_AddHead; + + tMUIP_Family_AddTail = record + MethodID : LongWord; + obj : pObject_; + end; + pMUIP_Family_AddTail = ^tMUIP_Family_AddTail; + + tMUIP_Family_Insert = record + MethodID : LongWord; + obj : pObject_; + pred : pObject_; + end; + pMUIP_Family_Insert = ^tMUIP_Family_Insert; + + tMUIP_Family_Remove = record + MethodID : LongWord; + obj : pObject_; + end; + pMUIP_Family_Remove = ^tMUIP_Family_Remove; + + tMUIP_Family_Sort = record + MethodID : LongWord; + obj : array[0..0] of pObject_; + end; + pMUIP_Family_Sort = ^tMUIP_Family_Sort; + + tMUIP_Family_Transfer = record + MethodID : LongWord; + family : pObject_; + end; + pMUIP_Family_Transfer = ^tMUIP_Family_Transfer; + +{ ** Attributes ** } +const + MUIA_Family_Child = $8042c696; { V8 i.. Object } + MUIA_Family_List = $80424b9e; { V8 ..g struct MinList } + + + +{ ** Menustrip } +{ ************************************************************************* } + +const + MUIC_Menustrip : PChar = 'Menustrip.mui'; + +{ ** Methods ** } +const + MUIM_Menustrip_ExitChange = $8042ce4d; { V20 } + MUIM_Menustrip_InitChange = $8042dcd9; { V20 } + +type + tMUIP_Menustrip_ExitChange = record + MethodID : LongWord; + end; + pMUIP_Menustrip_ExitChange = ^tMUIP_Menustrip_ExitChange; + + tMUIP_Menustrip_InitChange = record + MethodID : LongWord; + end; + pMUIP_Menustrip_InitChange = ^tMUIP_Menustrip_InitChange; + +{ ** Attributes ** } +const + MUIA_Menustrip_Enabled = $8042815b; { V8 isg BOOL } + + + +{ ** Menu } +{ ************************************************************************* } + +const + MUIC_Menu : PChar = 'Menu.mui'; + +{ ** Attributes ** } +const + MUIA_Menu_Enabled = $8042ed48; { V8 isg BOOL } + MUIA_Menu_Title = $8042a0e3; { V8 isg PChar } + + + +{ ** Menuitem } +{ ************************************************************************* } + +const + MUIC_Menuitem : PChar = 'Menuitem.mui'; + +{ ** Methods ** } + +{ ** Attributes ** } +const + MUIA_Menuitem_Checked = $8042562a; { V8 isg BOOL } + MUIA_Menuitem_Checkit = $80425ace; { V8 isg BOOL } + MUIA_Menuitem_CommandString = $8042b9cc; { V16 isg BOOL } + MUIA_Menuitem_Enabled = $8042ae0f; { V8 isg BOOL } + MUIA_Menuitem_Exclude = $80420bc6; { V8 isg LongInt } + MUIA_Menuitem_Shortcut = $80422030; { V8 isg PChar } + MUIA_Menuitem_Title = $804218be; { V8 isg PChar } + MUIA_Menuitem_Toggle = $80424d5c; { V8 isg BOOL } + MUIA_Menuitem_Trigger = $80426f32; { V8 ..g struct MenuItem } + +const + MUIV_Menuitem_Shortcut_Check = -(1); + + + +{ ** Application } +{ ************************************************************************* } + +const + MUIC_Application : PChar = 'Application.mui'; + +{ ** Methods ** } +const + MUIM_Application_AboutMUI = $8042d21d; { V14 } + MUIM_Application_AddInputHandler = $8042f099; { V11 } + MUIM_Application_BuildSettingsPanel = $8042b58f; { V20 } + MUIM_Application_CheckRefresh = $80424d68; { V11 } + MUIM_Application_DefaultConfigItem = $8042d934; { V20 } + MUIM_Application_InputBuffered = $80427e59; { V4 } + MUIM_Application_Load = $8042f90d; { V4 } + MUIM_Application_NewInput = $80423ba6; { V11 } + MUIM_Application_OpenConfigWindow = $804299ba; { V11 } + MUIM_Application_PushMethod = $80429ef8; { V4 } + MUIM_Application_RemInputHandler = $8042e7af; { V11 } + MUIM_Application_ReturnID = $804276ef; { V4 } + MUIM_Application_Save = $804227ef; { V4 } + MUIM_Application_SetConfigItem = $80424a80; { V11 } + MUIM_Application_ShowHelp = $80426479; { V4 } + +type + tMUIP_Application_AboutMUI = record + MethodID : LongWord; + refwindow : pObject_; + end; + pMUIP_Application_AboutMUI = ^tMUIP_Application_AboutMUI; + + tMUIP_Application_AddInputHandler = record + MethodID : LongWord; + ihnode : PMUI_InputHandlerNode; + end; + pMUIP_Application_AddInputHandler = ^tMUIP_Application_AddInputHandler; + + tMUIP_Application_BuildSettingsPanel = record + MethodID : LongWord; + number: LongWord; + end; + pMUIP_Application_BuildSettingsPanel = ^tMUIP_Application_BuildSettingsPanel; + + tMUIP_Application_CheckRefresh = record + MethodID : LongWord; + end; + pMUIP_Application_CheckRefresh = ^tMUIP_Application_CheckRefresh; + + tMUIP_Application_DefaultConfigItem = record + MethodID : LongWord; + cfgid : LongWord; + end; + pMUIP_Application_DefaultConfigItem = ^tMUIP_Application_DefaultConfigItem; + + tMUIP_Application_GetMenuCheck = record + MethodID : LongWord; + MenuID : LongWord; + end; + pMUIP_Application_GetMenuCheck = ^tMUIP_Application_GetMenuCheck; + + tMUIP_Application_GetMenuState = record + MethodID : LongWord; + MenuID : LongWord; + end; + pMUIP_Application_GetMenuState = ^tMUIP_Application_GetMenuState; + + tMUIP_Application_Input = record + MethodID : LongWord; + signal : PLongWord; + end; + pMUIP_Application_Input = ^tMUIP_Application_Input; + + tMUIP_Application_InputBuffered = record + MethodID : LongWord; + end; + pMUIP_Application_InputBuffered = ^tMUIP_Application_InputBuffered; + + tMUIP_Application_Load = record + MethodID : LongWord; + name : PChar; + end; + + tMUIP_Application_NewInput = record + MethodID : LongWord; + signal : PLongWord; + end; + pMUIP_Application_NewInput = ^tMUIP_Application_NewInput; + + tMUIP_Application_OpenConfigWindow = record + MethodID : LongWord; + flags : LongWord; + end; + pMUIP_Application_OpenConfigWindow = ^tMUIP_Application_OpenConfigWindow; + + tMUIP_Application_PushMethod = record { ... } + MethodID : LongWord; + dest : pObject_; + count : LongInt; + end; + pMUIP_Application_PushMethod = ^tMUIP_Application_PushMethod; + + tMUIP_Application_RemInputHandler = record + MethodID : LongWord; + ihnode : PMUI_InputHandlerNode; + end; + pMUIP_Application_RemInputHandler = ^tMUIP_Application_RemInputHandler; + + tMUIP_Application_ReturnID = record + MethodID : LongWord; + retid : LongWord; + end; + pMUIP_Application_ReturnID = ^tMUIP_Application_ReturnID; + + tMUIP_Application_Save = record + MethodID : LongWord; + name : PChar; + end; + + tMUIP_Application_SetConfigItem = record + MethodID : LongWord; + item : LongWord; + data : Pointer; + end; + pMUIP_Application_SetConfigItem = ^tMUIP_Application_SetConfigItem; + + tMUIP_Application_SetMenuCheck = record + MethodID : LongWord; + MenuID : LongWord; + stat : LongInt; + end; + pMUIP_Application_SetMenuCheck = ^tMUIP_Application_SetMenuCheck; + + tMUIP_Application_SetMenuState = record + MethodID : LongWord; + MenuID : LongWord; + stat : LongInt; + end; + pMUIP_Application_SetMenuState = ^tMUIP_Application_SetMenuState; + + tMUIP_Application_ShowHelp = record + MethodID : LongWord; + window : pObject_; + name : Pchar; + node : Pchar; + line : LongInt; + end; + pMUIP_Application_ShowHelp = ^tMUIP_Application_ShowHelp; + +{ ** Attributes ** } +const + MUIA_Application_Active = $804260ab; { V4 isg BOOL } + MUIA_Application_Author = $80424842; { V4 i.g PChar } + MUIA_Application_Base = $8042e07a; { V4 i.g PChar } + MUIA_Application_Broker = $8042dbce; { V4 ..g Broker } + MUIA_Application_BrokerHook = $80428f4b; { V4 isg struct Hook } + MUIA_Application_BrokerPort = $8042e0ad; { V6 ..g struct MsgPort } + MUIA_Application_BrokerPri = $8042c8d0; { V6 i.g LongInt } + MUIA_Application_Commands = $80428648; { V4 isg struct MUI_Command } + MUIA_Application_Copyright = $8042ef4d; { V4 i.g PChar } + MUIA_Application_Description = $80421fc6; { V4 i.g PChar } + MUIA_Application_DiskObject = $804235cb; { V4 isg struct DiskObject } + MUIA_Application_DoubleStart = $80423bc6; { V4 ..g BOOL } + MUIA_Application_DropObject = $80421266; { V5 is. Object } + MUIA_Application_ForceQuit = $804257df; { V8 ..g BOOL } + MUIA_Application_HelpFile = $804293f4; { V8 isg PChar } + MUIA_Application_Iconified = $8042a07f; { V4 .sg BOOL } + MUIA_Application_MenuAction = $80428961; { V4 ..g LongWord } + MUIA_Application_MenuHelp = $8042540b; { V4 ..g LongWord } + MUIA_Application_Menustrip = $804252d9; { V8 i.. Object } + MUIA_Application_RexxHook = $80427c42; { V7 isg struct Hook } + MUIA_Application_RexxMsg = $8042fd88; { V4 ..g struct RxMsg } + MUIA_Application_RexxString = $8042d711; { V4 .s. PChar } + MUIA_Application_SingleTask = $8042a2c8; { V4 i.. BOOL } + MUIA_Application_Sleep = $80425711; { V4 .s. BOOL } + MUIA_Application_Title = $804281b8; { V4 i.g PChar } + MUIA_Application_UseCommodities = $80425ee5; { V10 i.. BOOL } + MUIA_Application_UsedClasses = $8042e9a7; { V20 isg STRPTR * } + MUIA_Application_UseRexx = $80422387; { V10 i.. BOOL } + MUIA_Application_Version = $8042b33f; { V4 i.g PChar } + MUIA_Application_Window = $8042bfe0; { V4 i.. Object } + MUIA_Application_WindowList = $80429abe; { V13 ..g struct List } + + + +{ ** Window } +{ ************************************************************************* } + +const + MUIC_Window : PChar = 'Window.mui'; + +const + MUIM_Window_AddEventHandler = $804203b7; { V16 } + MUIM_Window_Cleanup = $8042ab26; { V18 } + MUIM_Window_RemEventHandler = $8042679e; { V16 } + MUIM_Window_ScreenToBack = $8042913d; { V4 } + MUIM_Window_ScreenToFront = $804227a4; { V4 } + MUIM_Window_Setup = $8042c34c; { V18 } + MUIM_Window_Snapshot = $8042945e; { V11 } + MUIM_Window_ToBack = $8042152e; { V4 } + MUIM_Window_ToFront = $8042554f; { V4 } + +type + tMUIP_Window_AddEventHandler = record + MethodID : LongWord; + ehnode : PMUI_EventHandlerNode; + end; + pMUIP_Window_AddEventHandler = ^tMUIP_Window_AddEventHandler; + + tMUIP_Window_Cleanup = record + MethodID : LongWord; + end; + pMUIP_Window_Cleanup = ^tMUIP_Window_Cleanup; + + tMUIP_Window_GetMenuCheck = record + MethodID : LongWord; + MenuID : LongWord; + end; + pMUIP_Window_GetMenuCheck = ^tMUIP_Window_GetMenuCheck; + + tMUIP_Window_GetMenuState = record + MethodID : LongWord; + MenuID : LongWord; + end; + pMUIP_Window_GetMenuState = ^tMUIP_Window_GetMenuState; + + tMUIP_Window_RemEventHandler = record + MethodID : LongWord; + ehnode : PMUI_EventHandlerNode; + end; + pMUIP_Window_RemEventHandler = ^tMUIP_Window_RemEventHandler; + + tMUIP_Window_ScreenToBack = record + MethodID : LongWord; + end; + pMUIP_Window_ScreenToBack = ^tMUIP_Window_ScreenToBack; + + tMUIP_Window_ScreenToFront = record + MethodID : LongWord; + end; + pMUIP_Window_ScreenToFront = ^tMUIP_Window_ScreenToFront; + + tMUIP_Window_SetCycleChain = record + MethodID : LongWord; + obj : array[0..0] of pObject_; + end; + pMUIP_Window_SetCycleChain = ^tMUIP_Window_SetCycleChain; + + tMUIP_Window_SetMenuCheck = record + MethodID : LongWord; + MenuID : LongWord; + stat : LongInt; + end; + pMUIP_Window_SetMenuCheck = ^tMUIP_Window_SetMenuCheck; + + tMUIP_Window_SetMenuState = record + MethodID : LongWord; + MenuID : LongWord; + stat : LongInt; + end; + pMUIP_Window_SetMenuState = ^tMUIP_Window_SetMenuState; + + tMUIP_Window_Setup = record + MethodID : LongWord; + end; + pMUIP_Window_Setup = ^tMUIP_Window_Setup; + + tMUIP_Window_Snapshot = record + MethodID : LongWord; + flags : LongInt; + end; + pMUIP_Window_Snapshot = ^tMUIP_Window_Snapshot; + + tMUIP_Window_ToBack = record + MethodID : LongWord; + end; + pMUIP_Window_ToBack = ^tMUIP_Window_ToBack; + + tMUIP_Window_ToFront = record + MethodID : LongWord; + end; + pMUIP_Window_ToFront = ^tMUIP_Window_ToFront; + +{ ** Attributes ** } +const + MUIA_Window_Activate = $80428d2f; { V4 isg BOOL } + MUIA_Window_ActiveObject = $80427925; { V4 .sg Object } + MUIA_Window_AltHeight = $8042cce3; { V4 i.g LongInt } + MUIA_Window_AltLeftEdge = $80422d65; { V4 i.g LongInt } + MUIA_Window_AltTopEdge = $8042e99b; { V4 i.g LongInt } + MUIA_Window_AltWidth = $804260f4; { V4 i.g LongInt } + MUIA_Window_AppWindow = $804280cf; { V5 i.. BOOL } + MUIA_Window_Backdrop = $8042c0bb; { V4 i.. BOOL } + MUIA_Window_Borderless = $80429b79; { V4 i.. BOOL } + MUIA_Window_CloseGadget = $8042a110; { V4 i.. BOOL } + MUIA_Window_CloseRequest = $8042e86e; { V4 ..g BOOL } + MUIA_Window_DefaultObject = $804294d7; { V4 isg Object } + MUIA_Window_DepthGadget = $80421923; { V4 i.. BOOL } + MUIA_Window_DragBar = $8042045d; { V4 i.. BOOL } + MUIA_Window_FancyDrawing = $8042bd0e; { V8 isg BOOL } + MUIA_Window_Height = $80425846; { V4 i.g LongInt } + MUIA_Window_ID = $804201bd; { V4 isg LongWord } + MUIA_Window_InputEvent = $804247d8; { V4 ..g struct InputEvent } + MUIA_Window_IsSubWindow = $8042b5aa; { V4 isg BOOL } + MUIA_Window_LeftEdge = $80426c65; { V4 i.g LongInt } + MUIA_Window_MenuAction = $80427521; { V8 isg LongWord } + MUIA_Window_Menustrip = $8042855e; { V8 i.g Object } + MUIA_Window_MouseObject = $8042bf9b; { V10 ..g Object } + MUIA_Window_NeedsMouseObject = $8042372a; { V10 i.. BOOL } + MUIA_Window_NoMenus = $80429df5; { V4 is. BOOL } + MUIA_Window_Open = $80428aa0; { V4 .sg BOOL } + MUIA_Window_PublicScreen = $804278e4; { V6 isg PChar } + MUIA_Window_RefWindow = $804201f4; { V4 is. Object } + MUIA_Window_RootObject = $8042cba5; { V4 isg Object } + MUIA_Window_Screen = $8042df4f; { V4 isg struct Screen } + MUIA_Window_ScreenTitle = $804234b0; { V5 isg PChar } + MUIA_Window_SizeGadget = $8042e33d; { V4 i.. BOOL } + MUIA_Window_SizeRight = $80424780; { V4 i.. BOOL } + MUIA_Window_Sleep = $8042e7db; { V4 .sg BOOL } + MUIA_Window_Title = $8042ad3d; { V4 isg PChar } + MUIA_Window_TopEdge = $80427c66; { V4 i.g LongInt } + MUIA_Window_UseBottomBorderScroller = $80424e79; { V13 isg BOOL } + MUIA_Window_UseLeftBorderScroller = $8042433e; { V13 isg BOOL } + MUIA_Window_UseRightBorderScroller = $8042c05e; { V13 isg BOOL } + MUIA_Window_Width = $8042dcae; { V4 i.g LongInt } + MUIA_Window_Window = $80426a42; { V4 ..g struct Window } + +const + MUIV_Window_ActiveObject_None = 0; + MUIV_Window_ActiveObject_Next = -1; + MUIV_Window_ActiveObject_Prev = -2; + MUIV_Window_ActiveObject_Left = -3; + MUIV_Window_ActiveObject_Right = -4; + MUIV_Window_ActiveObject_Up = -5; + MUIV_Window_ActiveObject_Down = -6; + +{ FIX ME!!! #define MUIV_Window_AltHeight_MinMax(p) (0-(p)) } +{ FIX ME!!! #define MUIV_Window_AltHeight_Visible(p) (-100-(p)) } +{ FIX ME!!! #define MUIV_Window_AltHeight_Screen(p) (-200-(p)) } + MUIV_Window_AltHeight_Scaled = -(1000); + MUIV_Window_AltLeftEdge_Centered = -(1); + MUIV_Window_AltLeftEdge_Moused = -(2); + MUIV_Window_AltLeftEdge_NoChange = -(1000); + MUIV_Window_AltTopEdge_Centered = -(1); + MUIV_Window_AltTopEdge_Moused = -(2); +{ FIX ME!!! #define MUIV_Window_AltTopEdge_Delta(p) (-3-(p)) } + MUIV_Window_AltTopEdge_NoChange = -(1000); +{ FIX ME!!! #define MUIV_Window_AltWidth_MinMax(p) (0-(p)) } +{ FIX ME!!! #define MUIV_Window_AltWidth_Visible(p) (-100-(p)) } +{ FIX ME!!! #define MUIV_Window_AltWidth_Screen(p) (-200-(p)) } + MUIV_Window_AltWidth_Scaled = -(1000); +{ FIX ME!!! #define MUIV_Window_Height_MinMax(p) (0-(p)) } +{ FIX ME!!! #define MUIV_Window_Height_Visible(p) (-100-(p)) } +{ FIX ME!!! #define MUIV_Window_Height_Screen(p) (-200-(p)) } + MUIV_Window_Height_Scaled = -(1000); + MUIV_Window_Height_Default = -(1001); + MUIV_Window_LeftEdge_Centered = -(1); + MUIV_Window_LeftEdge_Moused = -(2); +{ FIX ME!!! #define MUIV_Window_LeftEdge_Right(n) (-1000-(n)) } + MUIV_Window_TopEdge_Centered = -(1); + MUIV_Window_TopEdge_Moused = -(2); +{ FIX ME!!! #define MUIV_Window_TopEdge_Delta(p) (-3-(p)) } +{ FIX ME!!! #define MUIV_Window_TopEdge_Bottom(n) (-1000-(n)) } +{ FIX ME!!! #define MUIV_Window_Width_MinMax(p) (0-(p)) } +{ FIX ME!!! #define MUIV_Window_Width_Visible(p) (-100-(p)) } +{ FIX ME!!! #define MUIV_Window_Width_Screen(p) (-200-(p)) } + MUIV_Window_Width_Scaled = -(1000); + MUIV_Window_Width_Default = -(1001); + + + +{ ** Aboutmui } +{ ************************************************************************* } + +const + MUIC_Aboutmui : PChar = 'Aboutmui.mui'; + +{ ** Methods ** } + +{ ** Attributes ** } +const + MUIA_Aboutmui_Application = $80422523; { V11 i.. Object } + + + +{ ** Area } +{ ************************************************************************* } + +const + MUIC_Area : PChar = 'Area.mui'; + +{ ** Methods ** } +const + MUIM_AskMinMax = $80423874; { Custom Class } { V4 } + MUIM_Cleanup = $8042d985; { Custom Class } { V4 } + MUIM_ContextMenuAdd = $8042df9e; { V20 } + MUIM_ContextMenuBuild = $80429d2e; { V11 } + MUIM_ContextMenuChoice = $80420f0e; { V11 } + MUIM_CreateBubble = $80421c41; { V18 } + MUIM_CreateShortHelp = $80428e93; { V11 } + MUIM_DeleteBubble = $804211af; { V18 } + MUIM_DeleteShortHelp = $8042d35a; { V11 } + MUIM_DoDrag = $804216bb; { V20 } + MUIM_DragBegin = $8042c03a; { V11 } + MUIM_DragDrop = $8042c555; { V11 } + MUIM_DragFinish = $804251f0; { V11 } + MUIM_DragQuery = $80420261; { V11 } + MUIM_DragReport = $8042edad; { V11 } + MUIM_Draw = $80426f3f; { Custom Class } { V4 } + MUIM_DrawBackground = $804238ca; { V11 } + MUIM_HandleEvent = $80426d66; { Custom Class } { V16 } + MUIM_HandleInput = $80422a1a; { Custom Class } { V4 } + MUIM_Hide = $8042f20f; { Custom Class } { V4 } + MUIM_Setup = $80428354; { Custom Class } { V4 } + MUIM_Show = $8042cc84; { Custom Class } { V4 } + MUIM_UpdateConfig = $8042b0a9; { V20 } + +type + { MUI_MinMax structure holds information about minimum, maximum + and default dimensions of an object. } + tMUI_MinMax = record + MinWidth : shortint; + MinHeight : shortint; + MaxWidth : shortint; + MaxHeight : shortint; + DefWidth : shortint; + DefHeight : shortint; + end; + pMUI_MinMax = ^tMUI_MinMax; + + tMUIP_AskMinMax = record { Custom Class } + MethodID : LongWord; + MinMaxInfo : PMUI_MinMax; + end; + pMUIP_AskMinMax = ^tMUIP_AskMinMax; + + tMUIP_Cleanup = record { Custom Class } + MethodID : LongWord; + end; + pMUIP_Cleanup = ^tMUIP_Cleanup; + + tMUIP_ContextMenuAdd = record + MethodID : LongWord; + menustrip : pObject_; + mx : LongInt; + my : LongInt; + mxp : pLongInt; + myp : pLongInt; + end; + pMUIP_ContextMenuAdd = ^tMUIP_ContextMenuAdd; + + tMUIP_ContextMenuBuild = record + MethodID : LongWord; + mx : LongInt; + my : LongInt; + end; + pMUIP_ContextMenuBuild = ^tMUIP_ContextMenuBuild; + + tMUIP_ContextMenuChoice = record + MethodID : LongWord; + item : pObject_; + end; + pMUIP_ContextMenuChoice = ^tMUIP_ContextMenuChoice; + + tMUIP_CreateBubble = record + MethodID : LongWord; + x : LongInt; + y : LongInt; + txt : PChar; + flags : LongWord; + end; + pMUIP_CreateBubble = ^tMUIP_CreateBubble; + + tMUIP_CreateShortHelp = record + MethodID : LongWord; + mx : LongInt; + my : LongInt; + end; + pMUIP_CreateShortHelp = ^tMUIP_CreateShortHelp; + + tMUIP_DeleteBubble = record + MethodID : LongWord; + bubble : Pointer; + end; + pMUIP_DeleteBubble = ^tMUIP_DeleteBubble; + + tMUIP_DeleteShortHelp = record + MethodID : LongWord; + help : PChar; + end; + pMUIP_DeleteShortHelp = ^tMUIP_DeleteShortHelp; + + tMUIP_DoDrag = record + MethodID : LongWord; + touchx : LongInt; + touchy : LongInt; + flags : LongWord; + end; + pMUIP_DoDrag = ^tMUIP_DoDrag; + + tMUIP_DragBegin = record + MethodID : LongWord; + obj : pObject_; + end; + pMUIP_DragBegin = ^tMUIP_DragBegin; + + tMUIP_DragDrop = record + MethodID : LongWord; + obj : pObject_; + x : LongInt; + y : LongInt; + end; + pMUIP_DragDrop = ^tMUIP_DragDrop; + + tMUIP_DragFinish = record + MethodID : LongWord; + obj : pObject_; + end; + pMUIP_DragFinish = ^tMUIP_DragFinish; + + tMUIP_DragQuery = record + MethodID : LongWord; + obj : pObject_; + end; + pMUIP_DragQuery = ^tMUIP_DragQuery; + + tMUIP_DragReport = record + MethodID : LongWord; + obj : pObject_; + x : LongInt; + y : LongInt; + update : LongInt; + end; + pMUIP_DragReport = ^tMUIP_DragReport; + + tMUIP_Draw = record { Custom Class } + MethodID : LongWord; + flags : LongWord; + end; + pMUIP_Draw = ^tMUIP_Draw; + + tMUIP_DrawBackground = record + MethodID : LongWord; + left : LongInt; + top : LongInt; + width : LongInt; + height : LongInt; + xoffset : LongInt; + yoffset : LongInt; + flags : LongInt; + end; + pMUIP_DrawBackground = ^tMUIP_DrawBackground; + + tMUIP_HandleEvent = record { Custom Class } + MethodID : LongWord; + imsg : PIntuiMessage; + muikey : LongInt; + end; + pMUIP_HandleEvent = ^tMUIP_HandleEvent; + + tMUIP_HandleInput = record { Custom Class } + MethodID : LongWord; + imsg : PIntuiMessage; + muikey : LongInt; + end; + pMUIP_HandleInput = ^tMUIP_HandleInput; + + tMUIP_Hide = record { Custom Class } + MethodID : LongWord; + end; + pMUIP_Hide = ^tMUIP_Hide; + + tMUIP_Setup = record { Custom Class } + MethodID : LongWord; + RenderInfo : PMUI_RenderInfo; + end; + pMUIP_Setup = ^tMUIP_Setup; + + tMUIP_Show = record { Custom Class } + MethodID : LongWord; + end; + pMUIP_Show = ^tMUIP_Show; + + tMUIP_UpdateConfig = record + MethodID : LongWord; + cfgid : LongWord; + redrawcount : LongInt; + redrawobj : array[0..63] of pObject_; + redrawflags : array[0..63] of byte; + end; + pMUIP_UpdateConfig = ^tMUIP_UpdateConfig; + +{ ** Attributes ** } +const + MUIA_Background = $8042545b; { V4 is. LongInt } + MUIA_BottomEdge = $8042e552; { V4 ..g LongInt } + MUIA_ContextMenu = $8042b704; { V11 isg Object } + MUIA_ContextMenuTrigger = $8042a2c1; { V11 ..g Object } + MUIA_ControlChar = $8042120b; { V4 isg char } + MUIA_CycleChain = $80421ce7; { V11 isg LongInt } + MUIA_Disabled = $80423661; { V4 isg BOOL } + MUIA_DoubleBuffer = $8042a9c7; { V20 isg BOOL } + MUIA_Draggable = $80420b6e; { V11 isg BOOL } + MUIA_Dropable = $8042fbce; { V11 isg BOOL } + MUIA_FillArea = $804294a3; { V4 is. BOOL } + MUIA_FixHeight = $8042a92b; { V4 i.. LongInt } + MUIA_FixHeightTxt = $804276f2; { V4 i.. PChar } + MUIA_FixWidth = $8042a3f1; { V4 i.. LongInt } + MUIA_FixWidthTxt = $8042d044; { V4 i.. PChar } + MUIA_Font = $8042be50; { V4 i.g struct TextFont } + MUIA_Frame = $8042ac64; { V4 i.. LongInt } + MUIA_FrameDynamic = $804223c9; { V20 isg BOOL } + MUIA_FramePhantomHoriz = $8042ed76; { V4 i.. BOOL } + MUIA_FrameTitle = $8042d1c7; { V4 i.. PChar } + MUIA_FrameVisible = $80426498; { V20 isg BOOL } + MUIA_Height = $80423237; { V4 ..g LongInt } + MUIA_HorizDisappear = $80429615; { V11 isg LongInt } + MUIA_HorizWeight = $80426db9; { V4 isg ShortInt } + MUIA_InnerBottom = $8042f2c0; { V4 i.g LongInt } + MUIA_InnerLeft = $804228f8; { V4 i.g LongInt } + MUIA_InnerRight = $804297ff; { V4 i.g LongInt } + MUIA_InnerTop = $80421eb6; { V4 i.g LongInt } + MUIA_InputMode = $8042fb04; { V4 i.. LongInt } + MUIA_LeftEdge = $8042bec6; { V4 ..g LongInt } + MUIA_MaxHeight = $804293e4; { V11 i.. LongInt } + MUIA_MaxWidth = $8042f112; { V11 i.. LongInt } + MUIA_Pressed = $80423535; { V4 ..g BOOL } + MUIA_RightEdge = $8042ba82; { V4 ..g LongInt } + MUIA_Selected = $8042654b; { V4 isg BOOL } + MUIA_ShortHelp = $80428fe3; { V11 isg PChar } + MUIA_ShowMe = $80429ba8; { V4 isg BOOL } + MUIA_ShowSelState = $8042caac; { V4 i.. BOOL } + MUIA_Timer = $80426435; { V4 ..g LongInt } + MUIA_TopEdge = $8042509b; { V4 ..g LongInt } + MUIA_VertDisappear = $8042d12f; { V11 isg LongInt } + MUIA_VertWeight = $804298d0; { V4 isg WORD } + MUIA_Weight = $80421d1f; { V4 i.. WORD } + MUIA_Width = $8042b59c; { V4 ..g LongInt } + MUIA_Window = $80421591; { V4 ..g struct Window } + MUIA_WindowObject = $8042669e; { V4 ..g Object } + +const + MUIV_Font_Inherit = 0; + MUIV_Font_Normal = -1; + MUIV_Font_List = -2; + MUIV_Font_Tiny = -3; + MUIV_Font_Fixed = -4; + MUIV_Font_Title = -5; + MUIV_Font_Big = -6; + MUIV_Font_Button = -7; + MUIV_Font_Slider = -8; + MUIV_Font_Gauge = -9; + MUIV_Font_Menudisplay = -10; + MUIV_Frame_None = 0; + MUIV_Frame_Button = 1; + MUIV_Frame_ImageButton = 2; + MUIV_Frame_Text = 3; + MUIV_Frame_String = 4; + MUIV_Frame_ReadList = 5; + MUIV_Frame_InputList = 6; + MUIV_Frame_Prop = 7; + MUIV_Frame_Gauge = 8; + MUIV_Frame_Group = 9; + MUIV_Frame_PopUp = 10; + MUIV_Frame_Virtual = 11; + MUIV_Frame_Slider = 12; + MUIV_Frame_SliderKnob = 13; + MUIV_Frame_GaugeInner = 14; + MUIV_Frame_Menudisplay = 15; + MUIV_Frame_MenudisplayMenu = 16; + MUIV_Frame_PropKnob = 17; + MUIV_Frame_Window = 18; + MUIV_Frame_Requester = 19; + MUIV_Frame_Page = 20; + MUIV_Frame_Register = 21; + MUIV_Frame_Count = 22; + MUIV_InputMode_None = 0; + MUIV_InputMode_RelVerify = 1; + MUIV_InputMode_Immediate = 2; + MUIV_InputMode_Toggle = 3; + + + +{ ** Dtpic } +{ ************************************************************************* } + +const + MUIC_Dtpic : PChar = 'Dtpic.mui'; + +{ ** Methods ** } + +{ ** Attributes ** } +const + MUIA_Dtpic_Name = $80423d72; { V18 isg STRPTR } + + + +{ ** Rectangle } +{ ************************************************************************* } + +const + MUIC_Rectangle : PChar = 'Rectangle.mui'; + +{ ** Attributes ** } +const + MUIA_Rectangle_BarTitle = $80426689; { V11 i.g PChar } + MUIA_Rectangle_HBar = $8042c943; { V7 i.g BOOL } + MUIA_Rectangle_VBar = $80422204; { V7 i.g BOOL } + + + +{ ** Balance } +{ ************************************************************************* } + +const + MUIC_Balance : PChar = 'Balance.mui'; + +{ ** Attributes ** } +const + MUIA_Balance_Quiet = $80427486; { V20 i.. LONG } + + + +{ ** Image } +{ ************************************************************************* } + +const + MUIC_Image : PChar = 'Image.mui'; + +{ ** Attributes ** } + +const + MUIA_Image_FontMatch = $8042815d; { V4 i.. BOOL } + MUIA_Image_FontMatchHeight = $80429f26; { V4 i.. BOOL } + MUIA_Image_FontMatchWidth = $804239bf; { V4 i.. BOOL } + MUIA_Image_FreeHoriz = $8042da84; { V4 i.. BOOL } + MUIA_Image_FreeVert = $8042ea28; { V4 i.. BOOL } + MUIA_Image_OldImage = $80424f3d; { V4 i.. struct Image } + MUIA_Image_Spec = $804233d5; { V4 i.. char } + MUIA_Image_State = $8042a3ad; { V4 is. LongInt } + + + +{ ** Menubar } +{ ************************************************************************* } + +const + MUIC_Menubar : PChar = 'Menubar.mui'; + + + +{ ** Bitmap } +{ ************************************************************************* } + +const + MUIC_Bitmap : PChar = 'Bitmap.mui'; + +{ ** Attributes ** } +const + MUIA_Bitmap_Alpha = $80423e71; { V20 isg ULONG } + MUIA_Bitmap_Bitmap = $804279bd; { V8 isg struct BitMap } + MUIA_Bitmap_Height = $80421560; { V8 isg LongInt } + MUIA_Bitmap_MappingTable = $8042e23d; { V8 isg UBYTE } + MUIA_Bitmap_Precision = $80420c74; { V11 isg LongInt } + MUIA_Bitmap_RemappedBitmap = $80423a47; { V11 ..g struct BitMap } + MUIA_Bitmap_SourceColors = $80425360; { V8 isg LongWord } + MUIA_Bitmap_Transparent = $80422805; { V8 isg LongInt } + MUIA_Bitmap_UseFriend = $804239d8; { V11 i.. BOOL } + MUIA_Bitmap_Width = $8042eb3a; { V8 isg LongInt } + + + +{ ** Bodychunk } +{ ************************************************************************* } + +const + MUIC_Bodychunk : PChar = 'Bodychunk.mui'; + +{ ** Attributes ** } +const + MUIA_Bodychunk_Body = $8042ca67; { V8 isg UBYTE } + MUIA_Bodychunk_Compression = $8042de5f; { V8 isg UBYTE } + MUIA_Bodychunk_Depth = $8042c392; { V8 isg LongInt } + MUIA_Bodychunk_Masking = $80423b0e; { V8 isg UBYTE } + + + +{ ** Text } +{ ************************************************************************* } + +const + MUIC_Text : PChar = 'Text.mui'; + +{ ** Attributes ** } +const + MUIA_Text_Contents = $8042f8dc; { V4 isg PChar } + MUIA_Text_ControlChar = $8042e6d0; { V20 isg char } + MUIA_Text_Copy = $80427727; { V20 isg BOOL } + MUIA_Text_HiChar = $804218ff; { V4 i.. char } + MUIA_Text_PreParse = $8042566d; { V4 isg PChar } + MUIA_Text_SetMax = $80424d0a; { V4 i.. BOOL } + MUIA_Text_SetMin = $80424e10; { V4 i.. BOOL } + MUIA_Text_SetVMax = $80420d8b; { V11 i.. BOOL } + MUIA_Text_Shorten = $80428bbd; { V20 isg LONG } + MUIA_Text_Shortened = $80425a86; { V20 ..g BOOL } + +const + MUIV_Text_Shorten_Nothing = 0; + MUIV_Text_Shorten_Cutoff = 1; + MUIV_Text_Shorten_Hide = 2; + + + +{ ** Gadget } +{ ************************************************************************* } + +const + MUIC_Gadget : PChar = 'Gadget.mui'; + +{ ** Attributes ** } +const + MUIA_Gadget_Gadget = $8042ec1a; { V11 ..g struct Gadget } + + + +{ ** String } +{ ************************************************************************* } + +const + MUIC_String : PChar = 'String.mui'; + +{ ** Methods ** } + +{ ** Attributes ** } +const + MUIA_String_Accept = $8042e3e1; { V4 isg PChar } + MUIA_String_Acknowledge = $8042026c; { V4 ..g PChar } + MUIA_String_AdvanceOnCR = $804226de; { V11 isg BOOL } + MUIA_String_AttachedList = $80420fd2; { V4 isg Object } + MUIA_String_BufferPos = $80428b6c; { V4 .sg LongInt } + MUIA_String_Contents = $80428ffd; { V4 isg PChar } + MUIA_String_DisplayPos = $8042ccbf; { V4 .sg LongInt } + MUIA_String_EditHook = $80424c33; { V7 isg struct Hook } + MUIA_String_Format = $80427484; { V4 i.g LongInt } + MUIA_String_Integer = $80426e8a; { V4 isg LongWord } + MUIA_String_LonelyEditHook = $80421569; { V11 isg BOOL } + MUIA_String_MaxLen = $80424984; { V4 i.g LongInt } + MUIA_String_Reject = $8042179c; { V4 isg PChar } + MUIA_String_Secret = $80428769; { V4 i.g BOOL } + +const + MUIV_String_Format_Left = 0; + MUIV_String_Format_Center = 1; + MUIV_String_Format_Right = 2; + + + +{ ** Boopsi } +{ ************************************************************************* } + +const + MUIC_Boopsi : PChar = 'Boopsi.mui'; + +{ ** Attributes ** } +const + MUIA_Boopsi_Class = $80426999; { V4 isg struct IClass } + MUIA_Boopsi_ClassID = $8042bfa3; { V4 isg char } + MUIA_Boopsi_MaxHeight = $8042757f; { V4 isg LongWord } + MUIA_Boopsi_MaxWidth = $8042bcb1; { V4 isg LongWord } + MUIA_Boopsi_MinHeight = $80422c93; { V4 isg LongWord } + MUIA_Boopsi_MinWidth = $80428fb2; { V4 isg LongWord } + MUIA_Boopsi_Object = $80420178; { V4 ..g Object } + MUIA_Boopsi_Remember = $8042f4bd; { V4 i.. LongWord } + MUIA_Boopsi_Smart = $8042b8d7; { V9 i.. BOOL } + MUIA_Boopsi_TagDrawInfo = $8042bae7; { V4 isg LongWord } + MUIA_Boopsi_TagScreen = $8042bc71; { V4 isg LongWord } + MUIA_Boopsi_TagWindow = $8042e11d; { V4 isg LongWord } + + + +{ ** Prop } +{ ************************************************************************* } + +const + MUIC_Prop : PChar = 'Prop.mui'; + +{ ** Methods ** } +const + MUIM_Prop_Decrease = $80420dd1; { V16 } + MUIM_Prop_Increase = $8042cac0; { V16 } + +type + tMUIP_Prop_Decrease = record + MethodID : LongWord; + amount : LongInt; + end; + pMUIP_Prop_Decrease = ^tMUIP_Prop_Decrease; + + tMUIP_Prop_Increase = record + MethodID : LongWord; + amount : LongInt; + end; + pMUIP_Prop_Increase = ^tMUIP_Prop_Increase; + +{ ** Attributes ** } +const + MUIA_Prop_Entries = $8042fbdb; { V4 isg LongInt } + MUIA_Prop_First = $8042d4b2; { V4 isg LongInt } + MUIA_Prop_Horiz = $8042f4f3; { V4 i.g BOOL } + MUIA_Prop_Slider = $80429c3a; { V4 isg BOOL } + MUIA_Prop_UseWinBorder = $8042deee; { V13 i.. LongInt } + MUIA_Prop_Visible = $8042fea6; { V4 isg LongInt } + +const + MUIV_Prop_UseWinBorder_None = 0; + MUIV_Prop_UseWinBorder_Left = 1; + MUIV_Prop_UseWinBorder_Right = 2; + MUIV_Prop_UseWinBorder_Bottom = 3; + + + +{ ** Gauge } +{ ************************************************************************* } + +const + MUIC_Gauge : PChar = 'Gauge.mui'; + +{ ** Attributes ** } +const + MUIA_Gauge_Current = $8042f0dd; { V4 isg LongInt } + MUIA_Gauge_Divide = $8042d8df; { V4 isg BOOL } + MUIA_Gauge_Horiz = $804232dd; { V4 i.. BOOL } + MUIA_Gauge_InfoRate = $804253c8; { V4 isg LONG } + MUIA_Gauge_InfoText = $8042bf15; { V7 isg PChar } + MUIA_Gauge_Max = $8042bcdb; { V4 isg LongInt } + + + +{ ** Scale } +{ ************************************************************************* } + +const + MUIC_Scale : PChar = 'Scale.mui'; + +{ ** Attributes ** } +const + MUIA_Scale_Horiz = $8042919a; { V4 isg BOOL } + + + +{ ** Colorfield } +{ ************************************************************************* } + +const + MUIC_Colorfield : PChar = 'Colorfield.mui'; + +{ ** Attributes ** } +const + MUIA_Colorfield_Blue = $8042d3b0; { V4 isg LongWord } + MUIA_Colorfield_Green = $80424466; { V4 isg LongWord } + MUIA_Colorfield_Pen = $8042713a; { V4 ..g LongWord } + MUIA_Colorfield_Red = $804279f6; { V4 isg LongWord } + MUIA_Colorfield_RGB = $8042677a; { V4 isg LongWord } + + + +{ ** List } +{ ************************************************************************* } + +const + MUIC_List : PChar = 'List.mui'; + + { Methods } + { V4 } + + const + MUIM_List_Clear = $8042ad89; + { V11 } + MUIM_List_CreateImage = $80429804; + { V11 } + MUIM_List_DeleteImage = $80420f58; + { V4 } + MUIM_List_Exchange = $8042468c; + { V4 } + MUIM_List_GetEntry = $804280ec; + { V4 } + MUIM_List_Insert = $80426c87; + { V7 } + MUIM_List_InsertSingle = $804254d5; + { V4 } + MUIM_List_Jump = $8042baab; + { V9 } + MUIM_List_Move = $804253c2; + { V6 } + MUIM_List_NextSelected = $80425f17; + { V4 } + MUIM_List_Redraw = $80427993; + { V4 } + MUIM_List_Remove = $8042647e; + { V4 } + MUIM_List_Select = $804252d8; + { V4 } + MUIM_List_Sort = $80422275; + { V11 } + MUIM_List_TestPos = $80425f48; + + type + tMUIP_List_Clear = record + MethodID : LongWord; + end; + pMUIP_List_Clear = ^tMUIP_List_Clear; + + tMUIP_List_CreateImage = record + MethodID : LongWord; + obj : pObject_; + flags : LongWord; + end; + pMUIP_List_CreateImage = ^tMUIP_List_CreateImage; + + tMUIP_List_DeleteImage = record + MethodID : LongWord; + listimg : Pointer; + end; + pMUIP_List_DeleteImage = ^tMUIP_List_DeleteImage; + + tMUIP_List_Exchange = record + MethodID : LongWord; + pos1 : LongInt; + pos2 : LongInt; + end; + pMUIP_List_Exchange = ^tMUIP_List_Exchange; + + tMUIP_List_GetEntry = record + MethodID : LongWord; + pos : LongInt; + entry : PPointer; + end; + pMUIP_List_GetEntry = ^tMUIP_List_GetEntry; + + tMUIP_List_Insert = record + MethodID : LongWord; + entries : PPointer; + count : LongInt; + pos : LongInt; + end; + pMUIP_List_Insert = ^tMUIP_List_Insert; + + tMUIP_List_InsertSingle = record + MethodID : LongWord; + entry : Pointer; + pos : LongInt; + end; + pMUIP_List_InsertSingle = ^tMUIP_List_InsertSingle; + + tMUIP_List_Jump = record + MethodID : LongWord; + pos : LongInt; + end; + pMUIP_List_Jump = ^tMUIP_List_Jump; + + tMUIP_List_Move = record + MethodID : LongWord; + from : LongInt; + too : LongInt; + end; + pMUIP_List_Move = ^tMUIP_List_Move; + + tMUIP_List_NextSelected = record + MethodID : LongWord; + pos : PLongInt; + end; + pMUIP_List_NextSelected = ^tMUIP_List_NextSelected; + + tMUIP_List_Redraw = record + MethodID : LongWord; + pos : LongInt; + end; + pMUIP_List_Redraw = ^tMUIP_List_Redraw; + + tMUIP_List_Remove = record + MethodID : LongWord; + pos : LongInt; + end; + pMUIP_List_Remove = ^tMUIP_List_Remove; + + tMUIP_List_Select = record + MethodID : LongWord; + pos : LongInt; + seltype : LongInt; + state : PLongInt; + end; + pMUIP_List_Select = ^tMUIP_List_Select; + + tMUIP_List_Sort = record + MethodID : LongWord; + end; + pMUIP_List_Sort = ^tMUIP_List_Sort; + + tMUIP_List_TestPos = record + MethodID : LongWord; + x : LongInt; + y : LongInt; + res : PMUI_List_TestPos_Result; + end; + pMUIP_List_TestPos = ^tMUIP_List_TestPos; + + { Attributes } + { V4 isg LongInt } + + const + MUIA_List_Active = $8042391c; + { V4 i.. BOOL } + MUIA_List_AdjustHeight = $8042850d; + { V4 i.. BOOL } + MUIA_List_AdjustWidth = $8042354a; + { V11 isg BOOL } + MUIA_List_AutoVisible = $8042a445; + { V4 is. struct Hook } + MUIA_List_CompareHook = $80425c14; + { V4 is. struct Hook } + MUIA_List_ConstructHook = $8042894f; + { V4 is. struct Hook } + MUIA_List_DestructHook = $804297ce; + { V4 is. struct Hook } + MUIA_List_DisplayHook = $8042b4d5; + { V11 isg BOOL } + MUIA_List_DragSortable = $80426099; + { V11 ..g LongInt } + MUIA_List_DropMark = $8042aba6; + { V4 ..g LongInt } + MUIA_List_Entries = $80421654; + { V4 ..g LongInt } + MUIA_List_First = $804238d4; + { V4 isg PChar } + MUIA_List_Format = $80423c0a; + { V9 ..g LongInt } + MUIA_List_InsertPosition = $8042d0cd; + { V4 i.. LongInt } + MUIA_List_MinLineHeight = $8042d1c3; + { V4 is. struct Hook } + MUIA_List_MultiTestHook = $8042c2c6; + { V13 i.. Pointer } + MUIA_List_Pool = $80423431; + { V13 i.. LongWord } + MUIA_List_PoolPuddleSize = $8042a4eb; + { V13 i.. LongWord } + MUIA_List_PoolThreshSize = $8042c48c; + { V4 .s. BOOL } + MUIA_List_Quiet = $8042d8c7; + { V11 isg BOOL } + MUIA_List_ShowDropMarks = $8042c6f3; + { V4 i.. Pointer } + MUIA_List_SourceArray = $8042c0a0; + { V6 isg char } + MUIA_List_Title = $80423e66; + { V4 ..g LongInt } + MUIA_List_Visible = $8042191f; + MUIV_List_Active_Off = -(1); + MUIV_List_Active_Top = -(2); + MUIV_List_Active_Bottom = -(3); + MUIV_List_Active_Up = -(4); + MUIV_List_Active_Down = -(5); + MUIV_List_Active_PageUp = -(6); + MUIV_List_Active_PageDown = -(7); + MUIV_List_ConstructHook_String = -(1); + MUIV_List_CopyHook_String = -(1); + MUIV_List_CursorType_None = 0; + MUIV_List_CursorType_Bar = 1; + MUIV_List_CursorType_Rect = 2; + MUIV_List_DestructHook_String = -(1); + { } + { Floattext } + { } + + + const + MUIC_Floattext : PChar = 'Floattext.mui'; + + { Attributes } + { V4 isg BOOL } + + const + MUIA_Floattext_Justify = $8042dc03; + { V4 is. PChar } + MUIA_Floattext_SkipChars = $80425c7d; + { V4 is. LongInt } + MUIA_Floattext_TabSize = $80427d17; + { V4 isg PChar } + MUIA_Floattext_Text = $8042d16a; + { } + { Volumelist } + { } + + + const + MUIC_Volumelist : PChar = 'Volumelist.mui'; + + { } + { Scrmodelist } + { } + + const + MUIC_Scrmodelist : PChar = 'Scrmodelist.mui'; + + { Attributes } + { } + { Dirlist } + { } + + + const + MUIC_Dirlist : PChar = 'Dirlist.mui'; + + { Methods } + { V4 } + + const + MUIM_Dirlist_ReRead = $80422d71; + + type + MUIP_Dirlist_ReRead = record + MethodID : LongWord; + end; + + { Attributes } + { V4 is. PChar } + + const + MUIA_Dirlist_AcceptPattern = $8042760a; + { V4 isg PChar } + MUIA_Dirlist_Directory = $8042ea41; + { V4 is. BOOL } + MUIA_Dirlist_DrawersOnly = $8042b379; + { V4 is. BOOL } + MUIA_Dirlist_FilesOnly = $8042896a; + { V4 is. BOOL } + MUIA_Dirlist_FilterDrawers = $80424ad2; + { V4 is. struct Hook } + MUIA_Dirlist_FilterHook = $8042ae19; + { V6 is. BOOL } + MUIA_Dirlist_MultiSelDirs = $80428653; + { V4 ..g LongInt } + MUIA_Dirlist_NumBytes = $80429e26; + { V4 ..g LongInt } + MUIA_Dirlist_NumDrawers = $80429cb8; + { V4 ..g LongInt } + MUIA_Dirlist_NumFiles = $8042a6f0; + { V4 ..g PChar } + MUIA_Dirlist_Path = $80426176; + { V4 is. BOOL } + MUIA_Dirlist_RejectIcons = $80424808; + { V4 is. PChar } + MUIA_Dirlist_RejectPattern = $804259c7; + { V4 is. LongInt } + MUIA_Dirlist_SortDirs = $8042bbb9; + { V4 is. BOOL } + MUIA_Dirlist_SortHighLow = $80421896; + { V4 is. LongInt } + MUIA_Dirlist_SortType = $804228bc; + { V4 ..g LongInt } + MUIA_Dirlist_Status = $804240de; + MUIV_Dirlist_SortDirs_First = 0; + MUIV_Dirlist_SortDirs_Last = 1; + MUIV_Dirlist_SortDirs_Mix = 2; + MUIV_Dirlist_SortType_Name = 0; + MUIV_Dirlist_SortType_Date = 1; + MUIV_Dirlist_SortType_Size = 2; + MUIV_Dirlist_Status_Invalid = 0; + MUIV_Dirlist_Status_Reading = 1; + MUIV_Dirlist_Status_Valid = 2; + { } + { Numeric } + { } + + const + MUIC_Numeric : PChar = 'Numeric.mui'; + + { Methods } + { V11 } + + const + MUIM_Numeric_Decrease = $804243a7; + { V11 } + MUIM_Numeric_Increase = $80426ecd; + { V11 } + MUIM_Numeric_ScaleToValue = $8042032c; + { V11 } + MUIM_Numeric_SetDefault = $8042ab0a; + { V11 } + MUIM_Numeric_Stringify = $80424891; + { V11 } + MUIM_Numeric_ValueToScale = $80423e4f; + + type + tMUIP_Numeric_Decrease = record + MethodID : LongWord; + amount : LongInt; + end; + pMUIP_Numeric_Decrease = ^tMUIP_Numeric_Decrease; + + tMUIP_Numeric_Increase = record + MethodID : LongWord; + amount : LongInt; + end; + pMUIP_Numeric_Increase = ^tMUIP_Numeric_Increase; + + tMUIP_Numeric_ScaleToValue = record + MethodID : LongWord; + scalemin : LongInt; + scalemax : LongInt; + scale : LongInt; + end; + pMUIP_Numeric_ScaleToValue = ^tMUIP_Numeric_ScaleToValue; + + tMUIP_Numeric_SetDefault = record + MethodID : LongWord; + end; + pMUIP_Numeric_SetDefault = ^tMUIP_Numeric_SetDefault; + + tMUIP_Numeric_Stringify = record + MethodID : LongWord; + value : LongInt; + end; + pMUIP_Numeric_Stringify = ^tMUIP_Numeric_Stringify; + + tMUIP_Numeric_ValueToScale = record + MethodID : LongWord; + scalemin : LongInt; + scalemax : LongInt; + end; + pMUIP_Numeric_ValueToScale = ^tMUIP_Numeric_ValueToScale; + + { Attributes } + { V11 isg BOOL } + + const + MUIA_Numeric_CheckAllSizes = $80421594; + { V11 isg LongInt } + MUIA_Numeric_Default = $804263e8; + { V11 isg PChar } + MUIA_Numeric_Format = $804263e9; + { V11 isg LongInt } + MUIA_Numeric_Max = $8042d78a; + { V11 isg LongInt } + MUIA_Numeric_Min = $8042e404; + { V11 isg BOOL } + MUIA_Numeric_Reverse = $8042f2a0; + { V11 isg BOOL } + MUIA_Numeric_RevLeftRight = $804294a7; + { V11 isg BOOL } + MUIA_Numeric_RevUpDown = $804252dd; + { V11 isg LongInt } + MUIA_Numeric_Value = $8042ae3a; + { } + { Knob } + { } + + + const + MUIC_Knob : PChar = 'Knob.mui'; + + { } + { Levelmeter } + { } + + + const + MUIC_Levelmeter : PChar = 'Levelmeter.mui'; + + { Attributes } + { V11 isg PChar } + + const + MUIA_Levelmeter_Label = $80420dd5; + { } + { Numericbutton } + { } + + + const + MUIC_Numericbutton : PChar = 'Numericbutton.mui'; + + { } + { Slider } + { } + + + const + MUIC_Slider : PChar = 'Slider.mui'; + + { Attributes } + { V11 isg BOOL } + + const + MUIA_Slider_Horiz = $8042fad1; + + { V6 i.. BOOL } + + const + MUIA_Slider_Quiet = $80420b26; + + { } + { Framedisplay } + { } + + + const + MUIC_Framedisplay : PChar = 'Framedisplay.mui'; + + { Attributes } + { } + { Popframe } + { } + + + const + MUIC_Popframe : PChar = 'Popframe.mui'; + + { } + { Imagedisplay } + { } + + const + MUIC_Imagedisplay : PChar = 'Imagedisplay.mui'; + + { Attributes } + { } + { Popimage } + { } + + + const + MUIC_Popimage : PChar = 'Popimage.mui'; + + { } + { Pendisplay } + { } + + + const + MUIC_Pendisplay : PChar = 'Pendisplay.mui'; + + { Methods } + { V13 } + + const + MUIM_Pendisplay_SetColormap = $80426c80; + { V13 } + MUIM_Pendisplay_SetMUIPen = $8042039d; + { V13 } + MUIM_Pendisplay_SetRGB = $8042c131; + + type + MUIP_Pendisplay_SetColormap = record + MethodID : LongWord; + colormap : LongInt; + end; + + MUIP_Pendisplay_SetMUIPen = record + MethodID : LongWord; + muipen : LongInt; + end; + + MUIP_Pendisplay_SetRGB = record + MethodID : LongWord; + red : LongWord; + green : LongWord; + blue : LongWord; + end; + + { Attributes } + { V13 ..g Object } + + const + MUIA_Pendisplay_Pen = $8042a748; + { V13 isg Object } + MUIA_Pendisplay_Reference = $8042dc24; + { V11 isg struct MUI_RGBcolor } + MUIA_Pendisplay_RGBcolor = $8042a1a9; + { V11 isg struct MUI_PenSpec } + MUIA_Pendisplay_Spec = $8042a204; + { } + { Poppen } + { } + + + const + MUIC_Poppen : PChar = 'Poppen.mui'; + + { } + { Group } + { } + + + const + MUIC_Group : PChar = 'Group.mui'; + + { Methods } + { V11 } + + const + MUIM_Group_ExitChange = $8042d1cc; + { V11 } + MUIM_Group_InitChange = $80420887; + { V4 } + MUIM_Group_Sort = $80427417; + + type + tMUIP_Group_ExitChange = record + MethodID : LongWord; + end; + pMUIP_Group_ExitChange = ^tMUIP_Group_ExitChange; + + tMUIP_Group_InitChange = record + MethodID : LongWord; + end; + pMUIP_Group_InitChange = ^tMUIP_Group_InitChange; + + tMUIP_Group_Sort = record + MethodID : LongWord; + obj : array[0..0] of pObject_; + end; + pMUIP_Group_Sort = ^tMUIP_Group_Sort; + + { Attributes } + { V5 isg LongInt } + + const + MUIA_Group_ActivePage = $80424199; + { V4 i.. Object } + MUIA_Group_Child = $804226e6; + { V4 ..g struct List } + MUIA_Group_ChildList = $80424748; + { V4 is. LongInt } + MUIA_Group_Columns = $8042f416; + { V4 i.. BOOL } + MUIA_Group_Horiz = $8042536b; + { V4 isg LongInt } + MUIA_Group_HorizSpacing = $8042c651; + { V11 i.. struct Hook } + MUIA_Group_LayoutHook = $8042c3b2; + { V5 i.. BOOL } + MUIA_Group_PageMode = $80421a5f; + { V4 is. LongInt } + MUIA_Group_Rows = $8042b68f; + { V4 i.. BOOL } + MUIA_Group_SameHeight = $8042037e; + { V4 i.. BOOL } + MUIA_Group_SameSize = $80420860; + { V4 i.. BOOL } + MUIA_Group_SameWidth = $8042b3ec; + { V4 is. LongInt } + MUIA_Group_Spacing = $8042866d; + { V4 isg LongInt } + MUIA_Group_VertSpacing = $8042e1bf; + MUIV_Group_ActivePage_First = 0; + MUIV_Group_ActivePage_Last = -(1); + MUIV_Group_ActivePage_Prev = -(2); + MUIV_Group_ActivePage_Next = -(3); + MUIV_Group_ActivePage_Advance = -(4); + { } + { Mccprefs } + { } + + + const + MUIC_Mccprefs : PChar = 'Mccprefs.mui'; + + { } + { Register } + { } + + const + MUIC_Register : PChar = 'Register.mui'; + + { Attributes } + { V7 i.g BOOL } + + const + MUIA_Register_Frame = $8042349b; + { V7 i.g PChar } + MUIA_Register_Titles = $804297ec; + { } + { Penadjust } + { } + + + const + MUIC_Penadjust : PChar= 'Penadjust.mui'; + + { Methods } + { Attributes } + { V11 i.. BOOL } + + const + MUIA_Penadjust_PSIMode = $80421cbb; + { } + { Settingsgroup } + { } + + + const + MUIC_Settingsgroup : PChar = 'Settingsgroup.mui'; + + { Methods } + { V11 } + + const + MUIM_Settingsgroup_ConfigToGadgets = $80427043; + { V11 } + MUIM_Settingsgroup_GadgetsToConfig = $80425242; + + type + tMUIP_Settingsgroup_ConfigToGadgets = record + MethodID : LongWord; + configdata : pObject_; + end; + pMUIP_Settingsgroup_ConfigToGadgets = ^tMUIP_Settingsgroup_ConfigToGadgets; + + tMUIP_Settingsgroup_GadgetsToConfig = record + MethodID : LongWord; + configdata : pObject_; + end; + pMUIP_Settingsgroup_GadgetsToConfig = ^tMUIP_Settingsgroup_GadgetsToConfig; + + { Attributes } + { } + { Settings } + { } + + const + MUIC_Settings : PChar = 'Settings.mui'; + + { Methods } + { Attributes } + { } + { Frameadjust } + { } + + + const + MUIC_Frameadjust : PChar = 'Frameadjust.mui'; + + { Methods } + { Attributes } + { } + { Imageadjust } + { } + + + const + MUIC_Imageadjust : PChar = 'Imageadjust.mui'; + + { Methods } + { Attributes } + + const + MUIV_Imageadjust_Type_All = 0; + MUIV_Imageadjust_Type_Image = 1; + MUIV_Imageadjust_Type_Background = 2; + MUIV_Imageadjust_Type_Pen = 3; + { } + { Virtgroup } + { } + + + const + MUIC_Virtgroup : PChar = 'Virtgroup.mui'; + + { Methods } + { Attributes } + { V6 ..g LongInt } + + const + MUIA_Virtgroup_Height = $80423038; + { V11 i.. BOOL } + MUIA_Virtgroup_Input = $80427f7e; + { V6 isg LongInt } + MUIA_Virtgroup_Left = $80429371; + { V6 isg LongInt } + MUIA_Virtgroup_Top = $80425200; + { V6 ..g LongInt } + MUIA_Virtgroup_Width = $80427c49; + { } + { Scrollgroup } + { } + + + const + MUIC_Scrollgroup : PChar = 'Scrollgroup.mui'; + + { Methods } + { Attributes } + { V4 i.g Object } + + const + MUIA_Scrollgroup_Contents = $80421261; + { V9 i.. BOOL } + MUIA_Scrollgroup_FreeHoriz = $804292f3; + { V9 i.. BOOL } + MUIA_Scrollgroup_FreeVert = $804224f2; + { V16 ..g Object } + MUIA_Scrollgroup_HorizBar = $8042b63d; + { V13 i.. BOOL } + MUIA_Scrollgroup_UseWinBorder = $804284c1; + { V16 ..g Object } + MUIA_Scrollgroup_VertBar = $8042cdc0; + { } + { Scrollbar } + { } + + + const + MUIC_Scrollbar : PChar = 'Scrollbar.mui'; + + { Attributes } + { V11 i.. LongInt } + + const + MUIA_Scrollbar_Type = $8042fb6b; + MUIV_Scrollbar_Type_Default = 0; + MUIV_Scrollbar_Type_Bottom = 1; + MUIV_Scrollbar_Type_Top = 2; + MUIV_Scrollbar_Type_Sym = 3; + { } + { Listview } + { } + + + const + MUIC_Listview : PChar = 'Listview.mui'; + + { Attributes } + { V7 ..g LongInt } + + const + MUIA_Listview_ClickColumn = $8042d1b3; + { V7 isg LongInt } + MUIA_Listview_DefClickColumn = $8042b296; + { V4 i.g BOOL } + MUIA_Listview_DoubleClick = $80424635; + { V11 isg LongInt } + MUIA_Listview_DragType = $80425cd3; + { V4 i.. BOOL } + MUIA_Listview_Input = $8042682d; + { V4 i.g Object } + MUIA_Listview_List = $8042bcce; + { V7 i.. LongInt } + MUIA_Listview_MultiSelect = $80427e08; + { V10 i.. BOOL } + MUIA_Listview_ScrollerPos = $8042b1b4; + { V4 ..g BOOL } + MUIA_Listview_SelectChange = $8042178f; + MUIV_Listview_DragType_None = 0; + MUIV_Listview_DragType_Immediate = 1; + MUIV_Listview_MultiSelect_None = 0; + MUIV_Listview_MultiSelect_Default = 1; + MUIV_Listview_MultiSelect_Shifted = 2; + MUIV_Listview_MultiSelect_Always = 3; + MUIV_Listview_ScrollerPos_Default = 0; + MUIV_Listview_ScrollerPos_Left = 1; + MUIV_Listview_ScrollerPos_Right = 2; + MUIV_Listview_ScrollerPos_None = 3; + { } + { Radio } + { } + + + const + MUIC_Radio : PChar = 'Radio.mui'; + + { Attributes } + { V4 isg LongInt } + + const + MUIA_Radio_Active = $80429b41; + { V4 i.. PChar } + MUIA_Radio_Entries = $8042b6a1; + { } + { Cycle } + { } + + + const + MUIC_Cycle : PChar = 'Cycle.mui'; + + { Attributes } + { V4 isg LongInt } + + const + MUIA_Cycle_Active = $80421788; + { V4 i.. PChar } + MUIA_Cycle_Entries = $80420629; + MUIV_Cycle_Active_Next = -(1); + MUIV_Cycle_Active_Prev = -(2); + { } + { Coloradjust } + { } + + + const + MUIC_Coloradjust : PChar = 'Coloradjust.mui'; + + { Methods } + { Attributes } + { V4 isg LongWord } + + const + MUIA_Coloradjust_Blue = $8042b8a3; + { V4 isg LongWord } + MUIA_Coloradjust_Green = $804285ab; + { V4 isg LongWord } + MUIA_Coloradjust_ModeID = $8042ec59; + { V4 isg LongWord } + MUIA_Coloradjust_Red = $80420eaa; + { V4 isg LongWord } + MUIA_Coloradjust_RGB = $8042f899; + { } + { Palette } + { } + + + const + MUIC_Palette : PChar = 'Palette.mui'; + + { Attributes } + { V6 i.g struct MUI_Palette_Entry } + + const + MUIA_Palette_Entries = $8042a3d8; + { V6 isg BOOL } + MUIA_Palette_Groupable = $80423e67; + { V6 isg char } + MUIA_Palette_Names = $8042c3a2; + { } + { Popstring } + { } + + + const + MUIC_Popstring : PChar = 'Popstring.mui'; + + { Methods } + { V7 } + + const + MUIM_Popstring_Close = $8042dc52; + { V7 } + MUIM_Popstring_Open = $804258ba; + + type + tMUIP_Popstring_Close = record + MethodID : LongWord; + result : LongInt; + end; + pMUIP_Popstring_Close = ^tMUIP_Popstring_Close; + + tMUIP_Popstring_Open = record + MethodID : LongWord; + end; + pMUIP_Popstring_Open = ^tMUIP_Popstring_Open; + + { Attributes } + { V7 i.g Object } + + const + MUIA_Popstring_Button = $8042d0b9; + { V7 isg struct Hook } + MUIA_Popstring_CloseHook = $804256bf; + { V7 isg struct Hook } + MUIA_Popstring_OpenHook = $80429d00; + { V7 i.g Object } + MUIA_Popstring_String = $804239ea; + { V7 isg BOOL } + MUIA_Popstring_Toggle = $80422b7a; + { } + { Popobject } + { } + + + const + MUIC_Popobject : PChar = 'Popobject.mui'; + + { Attributes } + { V7 isg BOOL } + + const + MUIA_Popobject_Follow = $80424cb5; + { V7 isg BOOL } + MUIA_Popobject_Light = $8042a5a3; + { V7 i.g Object } + MUIA_Popobject_Object = $804293e3; + { V7 isg struct Hook } + MUIA_Popobject_ObjStrHook = $8042db44; + { V7 isg struct Hook } + MUIA_Popobject_StrObjHook = $8042fbe1; + { V7 isg BOOL } + MUIA_Popobject_Volatile = $804252ec; + { V9 isg struct Hook } + MUIA_Popobject_WindowHook = $8042f194; + { } + { Poplist } + { } + + + const + MUIC_Poplist : PChar = 'Poplist.mui'; + + { Attributes } + { V8 i.. char } + + const + MUIA_Poplist_Array = $8042084c; + { } + { Popscreen } + { } + + + const + MUIC_Popscreen : PChar = 'Popscreen.mui'; + + { Attributes } + { } + { Popasl } + { } + + const + MUIC_Popasl : PChar = 'Popasl.mui'; + + { Attributes } + { V7 ..g BOOL } + + const + MUIA_Popasl_Active = $80421b37; + { V7 isg struct Hook } + MUIA_Popasl_StartHook = $8042b703; + { V7 isg struct Hook } + MUIA_Popasl_StopHook = $8042d8d2; + { V7 i.g LongWord } + MUIA_Popasl_Type = $8042df3d; + { } + { Semaphore } + { } + + + const + MUIC_Semaphore : PChar = 'Semaphore.mui'; + + { Methods } + { V11 } + + const + MUIM_Semaphore_Attempt = $80426ce2; + { V11 } + MUIM_Semaphore_AttemptShared = $80422551; + { V11 } + MUIM_Semaphore_Obtain = $804276f0; + { V11 } + MUIM_Semaphore_ObtainShared = $8042ea02; + { V11 } + MUIM_Semaphore_Release = $80421f2d; + + type + tMUIP_Semaphore_Attempt = record + MethodID : LongWord; + end; + pMUIP_Semaphore_Attempt = ^tMUIP_Semaphore_Attempt; + + tMUIP_Semaphore_AttemptShared = record + MethodID : LongWord; + end; + pMUIP_Semaphore_AttemptShared = ^tMUIP_Semaphore_AttemptShared; + + tMUIP_Semaphore_Obtain = record + MethodID : LongWord; + end; + pMUIP_Semaphore_Obtain = ^tMUIP_Semaphore_Obtain; + + tMUIP_Semaphore_ObtainShared = record + MethodID : LongWord; + end; + pMUIP_Semaphore_ObtainShared = ^tMUIP_Semaphore_ObtainShared; + + tMUIP_Semaphore_Release = record + MethodID : LongWord; + end; + pMUIP_Semaphore_Release = ^tMUIP_Semaphore_Release; + + { } + { Applist } + { } + + const + MUIC_Applist : PChar = 'Applist.mui'; + { Methods } + { } + { Cclist } + { } + + + const + MUIC_Cclist : PChar = 'Cclist.mui'; + + { Methods } + { } + { Dataspace } + { } + + + const + MUIC_Dataspace : PChar = 'Dataspace.mui'; + + { Methods } + { V11 } + + const + MUIM_Dataspace_Add = $80423366; + { V11 } + MUIM_Dataspace_Clear = $8042b6c9; + { V11 } + MUIM_Dataspace_Find = $8042832c; + { V11 } + MUIM_Dataspace_Merge = $80423e2b; + { V11 } + MUIM_Dataspace_ReadIFF = $80420dfb; + { V11 } + MUIM_Dataspace_Remove = $8042dce1; + { V11 } + MUIM_Dataspace_WriteIFF = $80425e8e; + + type + tMUIP_Dataspace_Add = record + MethodID : LongWord; + data : Pointer; + len : LongInt; + id : LongWord; + end; + pMUIP_Dataspace_Add = ^tMUIP_Dataspace_Add; + + tMUIP_Dataspace_Clear = record + MethodID : LongWord; + end; + pMUIP_Dataspace_Clear = ^tMUIP_Dataspace_Clear; + + tMUIP_Dataspace_Find = record + MethodID : LongWord; + id : LongWord; + end; + pMUIP_Dataspace_Find = ^tMUIP_Dataspace_Find; + + tMUIP_Dataspace_Merge = record + MethodID : LongWord; + dataspace : pObject_; + end; + pMUIP_Dataspace_Merge = ^tMUIP_Dataspace_Merge; + + tMUIP_Dataspace_ReadIFF = record + MethodID : LongWord; + handle : Pointer; // PIFFHandle; FIX ME!! + end; + pMUIP_Dataspace_ReadIFF = ^tMUIP_Dataspace_ReadIFF; + + tMUIP_Dataspace_Remove = record + MethodID : LongWord; + id : LongWord; + end; + pMUIP_Dataspace_Remove = ^tMUIP_Dataspace_Remove; + + tMUIP_Dataspace_WriteIFF = record + MethodID : LongWord; + handle : Pointer; // PIFFHandle; FIX ME!!! + type_ : LongWord; + id : LongWord; + end; + pMUIP_Dataspace_WriteIFF = ^tMUIP_Dataspace_WriteIFF; + + { Attributes } + { V11 i.. Pointer } + + const + MUIA_Dataspace_Pool = $80424cf9; + { } + { Configdata } + { } + + + const + MUIC_Configdata : PChar = 'Configdata.mui'; + + { Methods } + { Attributes } + + { } + { End of automatic header file creation } + { } + { + Structures and Macros for creating custom classes. + } + { + GENERAL NOTES: + + - Everything described in this header file is only valid within + MUI classes. You may never use any of these things out of + a class, e.g. in a traditional MUI application. + + - Except when otherwise stated, all structures are strictly read only. + } + { Global information for every object } + { ... private data follows ... } + + type + tMUI_GlobalInfo = record + priv0 : LongWord; + mgi_ApplicationObject : pObject_; + end; + pMUI_GlobalInfo = ^tMUI_GlobalInfo; + + { Instance data of notify class } + tMUI_NotifyData = record + mnd_GlobalInfo : PMUI_GlobalInfo; + mnd_UserData : LongWord; + mnd_ObjectID : LongWord; + priv1 : LongWord; + priv2 : LongWord; + priv3 : LongWord; + priv4 : LongWord; + end; + pMUI_NotifyData = ^tMUI_NotifyData; + + + { use this if a dimension is not limited. } + + const + MUI_MAXMAX = 10000; + { Hook message for custom layout } + { type of message (see defines below) } + { list of this groups children, traverse with NextObject() } + { results for MUILM_MINMAX } + { size (and result) for MUILM_LAYOUT } + + type + tMUI_LayoutMsg = record + lm_Type : LongWord; + lm_Children : PMinList; + lm_MinMax : tMUI_MinMax; + lm_Layout : record + Width : LongInt; + Height : LongInt; + priv5 : LongWord; + priv6 : LongWord; + end; + end; + pMUI_LayoutMsg = ^tMUI_LayoutMsg; + + { MUI wants you to calc your min & max sizes } + + const + MUILM_MINMAX = 1; + { MUI wants you to layout your children } + MUILM_LAYOUT = 2; + { return this if your hook doesn't implement lm_Type } + MUILM_UNKNOWN = -(1); + { (partial) instance data of area class } + { RenderInfo for this object } + { Font } + { min/max/default sizes } + { position and dimension } + { frame & innerspacing left offset } + { frame & innerspacing top offset } + { frame & innerspacing add. width } + { frame & innerspacing add. height } + { see definitions below } + { ... private data follows ... } + + type + tMUI_AreaData = record + mad_RenderInfo : PMUI_RenderInfo; + priv7 : LongWord; + mad_Font : PTextFont; + mad_MinMax : tMUI_MinMax; + mad_Box : tIBox; + mad_addleft : BYTE; + mad_addtop : BYTE; + mad_subwidth : BYTE; + mad_subheight : BYTE; + mad_Flags : LongWord; + end; + pMUI_AreaData = ^tMUI_AreaData; + + { Definitions for mad_Flags, other flags are private } + { completely redraw yourself } + + const + MADF_DRAWOBJECT = 1 shl 0; + { only update yourself } + MADF_DRAWUPDATE = 1 shl 1; + { MUI's draw pens } + MPEN_SHINE = 0; + MPEN_HALFSHINE = 1; + MPEN_BACKGROUND = 2; + MPEN_HALFSHADOW = 3; + MPEN_SHADOW = 4; + MPEN_TEXT = 5; + MPEN_FILL = 6; + MPEN_MARK = 7; + MPEN_COUNT = 8; + { Mask for pens from MUI_ObtainPen() } + MUIPEN_MASK = $0000ffff; + + + { Information on display environment } + { valid between MUIM_Setup/MUIM_Cleanup } + { valid between MUIM_Setup/MUIM_Cleanup } + { valid between MUIM_Setup/MUIM_Cleanup } + { valid between MUIM_Setup/MUIM_Cleanup } + { valid between MUIM_Show/MUIM_Hide } + { valid between MUIM_Show/MUIM_Hide } + { valid between MUIM_Setup/MUIM_Cleanup } + { ... private data follows ... } + + + + { + If mri_Flags & MUIMRI_RECTFILL, RectFill() is quicker + than Move()/Draw() for horizontal or vertical lines. + on the current display. + } + + const + MUIMRI_RECTFILL = 1 shl 0; + { + If mri_Flags & MUIMRI_TRUECOLOR, display environment is a + cybergraphics emulated hicolor or true color display. + } + MUIMRI_TRUECOLOR = 1 shl 1; + { + If mri_Flags & MUIMRI_THINFRAMES, MUI uses thin frames + (1:1) apsect ratio instead of standard 2:1 frames. + } + MUIMRI_THINFRAMES = 1 shl 2; + { + If mri_Flags & MUIMRI_REFRESHMODE, MUI is currently + refreshing a WFLG_SIMPLEREFRESH window and is between + a BeginRefresh()/EndRefresh() pair. + } + MUIMRI_REFRESHMODE = 1 shl 3; + { the following macros can be used to get pointers to an objects + GlobalInfo and RenderInfo structures. } + + type + t__dummyXFC2__ = record + mnd : tMUI_NotifyData; + mad : tMUI_AreaData; + end; + p__dummyXFC2__ = ^t__dummyXFC2__; + + const + MUIKEY_RELEASE = -2; + MUIKEY_NONE = -1; + MUIKEY_PRESS = 0; + MUIKEY_TOGGLE = 1; + MUIKEY_UP = 2; + MUIKEY_DOWN = 3; + MUIKEY_PAGEUP = 4; + MUIKEY_PAGEDOWN = 5; + MUIKEY_TOP = 6; + MUIKEY_BOTTOM = 7; + MUIKEY_LEFT = 8; + MUIKEY_RIGHT = 9; + MUIKEY_WORDLEFT = 10; + MUIKEY_WORDRIGHT = 11; + MUIKEY_LINESTART = 12; + MUIKEY_LINEEND = 13; + MUIKEY_GADGET_NEXT = 14; + MUIKEY_GADGET_PREV = 15; + MUIKEY_GADGET_OFF = 16; + MUIKEY_WINDOW_CLOSE = 17; + MUIKEY_WINDOW_NEXT = 18; + MUIKEY_WINDOW_PREV = 19; + MUIKEY_HELP = 20; + MUIKEY_POPUP = 21; + MUIKEY_COUNT = 22; + + MUIKEYF_PRESS = 1 shl MUIKEY_PRESS; + MUIKEYF_TOGGLE = 1 shl MUIKEY_TOGGLE; + MUIKEYF_UP = 1 shl MUIKEY_UP; + MUIKEYF_DOWN = 1 shl MUIKEY_DOWN; + MUIKEYF_PAGEUP = 1 shl MUIKEY_PAGEUP; + MUIKEYF_PAGEDOWN = 1 shl MUIKEY_PAGEDOWN; + MUIKEYF_TOP = 1 shl MUIKEY_TOP; + MUIKEYF_BOTTOM = 1 shl MUIKEY_BOTTOM; + MUIKEYF_LEFT = 1 shl MUIKEY_LEFT; + MUIKEYF_RIGHT = 1 shl MUIKEY_RIGHT; + MUIKEYF_WORDLEFT = 1 shl MUIKEY_WORDLEFT; + MUIKEYF_WORDRIGHT = 1 shl MUIKEY_WORDRIGHT; + MUIKEYF_LINESTART = 1 shl MUIKEY_LINESTART; + MUIKEYF_LINEEND = 1 shl MUIKEY_LINEEND; + MUIKEYF_GADGET_NEXT = 1 shl MUIKEY_GADGET_NEXT; + MUIKEYF_GADGET_PREV = 1 shl MUIKEY_GADGET_PREV; + MUIKEYF_GADGET_OFF = 1 shl MUIKEY_GADGET_OFF; + MUIKEYF_WINDOW_CLOSE = 1 shl MUIKEY_WINDOW_CLOSE; + MUIKEYF_WINDOW_NEXT = 1 shl MUIKEY_WINDOW_NEXT; + MUIKEYF_WINDOW_PREV = 1 shl MUIKEY_WINDOW_PREV; + MUIKEYF_HELP = 1 shl MUIKEY_HELP; + MUIKEYF_POPUP = 1 shl MUIKEY_POPUP; + + { MUI_CustomClass returned by MUI_CreateCustomClass() } + { use for whatever you want } + { MUI has opened these libraries } + { for you automatically. You can } + { use them or decide to open } + { your libraries yourself. } + { pointer to super class } + { pointer to the new class } + { ... private data follows ... } + + type + tMUI_CustomClass = record + mcc_UserData : Pointer; + mcc_UtilityBase : PLibrary; + mcc_DOSBase : PLibrary; + mcc_GfxBase : PLibrary; + mcc_IntuitionBase : PLibrary; + mcc_Super : PIClass; + mcc_Class : PIClass; + end; + pMUI_CustomClass = ^tMUI_CustomClass; + +function MUI_NewObjectA(class_ : pChar location 'a0'; tags : pTagItem location 'a1') : pObject_; +syscall legacy MUIMasterBase 30; + +procedure MUI_DisposeObject(obj : pObject_ location 'a0'); +syscall legacy MUIMasterBase 36; + +function MUI_RequestA(app : POINTER location 'd0'; + win : POINTER location 'd1'; + flags : LongWord location 'd2'; + title : pChar location 'a0'; + gadgets : pChar location 'a1'; + format : pChar location 'a2'; + params : POINTER location 'a3') : longint; +syscall legacy MUIMasterBase 42; + +function MUI_AllocAslRequest(typ : LongWord location 'd0'; tags : pTagItem location 'a0') : POINTER; +syscall legacy MUIMasterBase 48; + +function MUI_AslRequest(req : POINTER location 'a0'; tags : pTagItem location 'a1') : BOOLEAN; +syscall legacy MUIMasterBase 54; + +procedure MUI_FreeAslRequest(req : POINTER location 'a0'); +syscall legacy MUIMasterBase 60; + +function MUI_Error : LONGINT; +syscall legacy MUIMasterBase 66; + +function MUI_SetError(errnum : LONGINT location 'd0') : LONGINT; +syscall legacy MUIMasterBase 72; + +function MUI_GetClass(name : pChar location 'a0') : pIClass; +syscall legacy MUIMasterBase 78; + +procedure MUI_FreeClass(cl : pIClass location 'a0'); +syscall legacy MUIMasterBase 84; + +procedure MUI_RequestIDCMP(obj : pObject_ location 'a0'; flags : LongWord location 'd0'); +syscall legacy MUIMasterBase 90; + +procedure MUI_RejectIDCMP(obj : pObject_ location 'a0'; flags : LongWord location 'd0'); +syscall legacy MUIMasterBase 96; + +procedure MUI_Redraw(obj : pObject_ location 'a0'; flags : LongWord location 'd0'); +syscall legacy MUIMasterBase 102; + +function MUI_CreateCustomClass(base : pLibrary location 'a0'; + supername : pChar location 'a1'; + supermcc : pMUI_CustomClass location 'a2'; + datasize : LONGINT location 'd0'; + dispatcher : POINTER location 'a3') : pMUI_CustomClass; +syscall legacy MUIMasterBase 108; + +function MUI_DeleteCustomClass(mcc : pMUI_CustomClass location 'a0') : BOOLEAN; +syscall legacy MUIMasterBase 114; + +function MUI_MakeObjectA(typ: LONGINT location 'd0'; params : pLongWord location 'a0') : pLongWord; +syscall legacy MUIMasterBase 120; + +function MUI_Layout(obj : pObject_ location 'a0'; + l : LONGINT location 'd0'; + t : LONGINT location 'd1'; + w : LONGINT location 'd2'; + h : LONGINT location 'd3'; + flags : LongWord location 'd4') : BOOLEAN; +syscall legacy MUIMasterBase 126; + + +function MUI_ObtainPen(mri : pMUI_RenderInfo location 'a0'; + spec : pMUI_PenSpec location 'a1'; + flags : LongWord location 'd0') : LONGINT; +syscall legacy MUIMasterBase 156; + +procedure MUI_ReleasePen(mri : pMUI_RenderInfo location 'a0'; + pen : LONGINT location 'd0'); +syscall legacy MUIMasterBase 162; + +function MUI_AddClipping(mri : pMUI_RenderInfo location 'a0'; + l : smallint location 'd0'; + t : smallint location 'd1'; + w : smallint location 'd2'; + h : smallint location 'd3') : POINTER; +syscall legacy MUIMasterBase 168; + +procedure MUI_RemoveClipping(mri : pMUI_RenderInfo location 'a0'; + h : POINTER location 'a1'); +syscall legacy MUIMasterBase 174; + +function MUI_AddClipRegion(mri : pMUI_RenderInfo location 'a0'; region : pRegion location 'a1') : POINTER; +syscall legacy MUIMasterBase 180; + +procedure MUI_RemoveClipRegion(mri : pMUI_RenderInfo location 'a0'; region : POINTER location 'a1'); +syscall legacy MUIMasterBase 186; + +function MUI_BeginRefresh(mri : pMUI_RenderInfo location 'a0'; flags : LongWord location 'd0') : BOOLEAN; +syscall legacy MUIMasterBase 192; + +procedure MUI_EndRefresh(mri : pMUI_RenderInfo location 'a0'; flags : LongWord location 'd0'); +syscall legacy MUIMasterBase 198; + + +(* +** some procedures to get some information about our object +*) + +function MUINotifyData(obj : Pointer) : pMUI_NotifyData; +function MUIAreaData(obj : Pointer) : pMUI_AreaData; +function MUIGlobalInfo(obj : Pointer) : pMUI_GlobalInfo; +function MUIUserData(obj : Pointer) : Pointer ; +function MUIRenderInfo(obj : Pointer) : pMUI_RenderInfo; +function MUIPen(pen : longint): longint; +(* +** some more specialized functions to retain information about special +** object-data like rastport, window, etc. +** +** NOTE: These macros may only be used in custom classes and are +** only valid if your class is inbetween the specified methods! +*) + +function OBJ_App(obj : Pointer) : pObject_; inline; (* valid between MUIM_Setup/Cleanup *) +function OBJ_Win(obj : Pointer) : pObject_; inline; (* valid between MUIM_Setup/Cleanup *) +function OBJ_Dri(obj : Pointer) : pDrawInfo; inline; (* valid between MUIM_Setup/Cleanup *) +function OBJ_Screen(obj : Pointer) : pScreen; inline; (* valid between MUIM_Setup/Cleanup *) +function OBJ_Pens(obj : Pointer) : pWord; inline; (* valid between MUIM_Setup/Cleanup *) +function OBJ_Window(obj : Pointer) : pWindow; inline; (* valid between MUIM_Show/Hide *) +function OBJ_Rp(obj : Pointer) : pRastPort; inline; (* valid between MUIM_Show/Hide *) +function OBJ_Left(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_Top(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_Width(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_Height(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_Right(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_Bottom(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_AddLeft(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_AddTop(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_SubWidth(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_SubHeight(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_MLeft(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_MTop(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_MWidth(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_MHeight(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_MRight(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_MBottom(obj : Pointer) : smallint; inline; (* valid during MUIM_Draw *) +function OBJ_Font(obj : Pointer) : pTextFont; inline; (* valid between MUIM_Setup/Cleanup *) +function OBJ_MinWidth(obj : Pointer) : LongWord; inline; (* valid between MUIM_Show/Hide *) +function OBJ_MinHeight(obj : Pointer) : LongWord; inline; (* valid between MUIM_Show/Hide *) +function OBJ_MaxWidth(obj : Pointer) : LongWord; inline; (* valid between MUIM_Show/Hide *) +function OBJ_MaxHeight(obj : Pointer) : LongWord; inline; (* valid between MUIM_Show/Hide *) +function OBJ_DefWidth(obj : Pointer) : LongWord; inline; (* valid between MUIM_Show/Hide *) +function OBJ_DefHeight(obj : Pointer) : LongWord; inline; (* valid between MUIM_Show/Hide *) +function OBJ_Flags(obj : Pointer) : LongWord; inline; + +function OBJ_Between(a,x,b : smallint): boolean; inline; +function OBJ_IsInObject(x,y : smallint; obj : pObject_): boolean; inline; + +function MUIV_Window_AltHeight_MinMax(p : longint) : longint; inline; +function MUIV_Window_AltHeight_Visible(p : longint) : longint; inline; +function MUIV_Window_AltHeight_Screen(p : longint) : longint; inline; +function MUIV_Window_AltTopEdge_Delta(p : longint) : longint; inline; +function MUIV_Window_AltWidth_MinMax(p : longint) : longint; inline; +function MUIV_Window_AltWidth_Visible(p : longint) : longint; inline; +function MUIV_Window_AltWidth_Screen(p : longint) : longint; inline; +function MUIV_Window_Height_MinMax(p : longint) : longint; inline; +function MUIV_Window_Height_Visible(p : longint) : longint; inline; +function MUIV_Window_Height_Screen(p : longint) : longint; inline; +function MUIV_Window_TopEdge_Delta(p : longint) : longint; inline; +function MUIV_Window_Width_MinMax(p : longint) : longint; inline; +function MUIV_Window_Width_Visible(p : longint) : longint; inline; +function MUIV_Window_Width_Screen(p : longint) : longint; inline; + + +function MAKE_ID(a,b,c,d : char): longword; inline; +function MUIget(obj: pObject_; attr: longword; store: longword): longword; inline; +function MUIset(obj: pObject_; attr: longword; value: longword): longword; inline; + +{ + Functions and procedures with array of longword go here +} +function MUI_AllocAslRequestTags(_type : longword; tags : array Of LongWord) : POINTER; +function MUI_AslRequestTags(req : POINTER; tags : array Of LongWord) : BOOLEAN; +function MUI_MakeObject(_type : LONGINT; params : array of LongWord) : pLongWord; inline; +function MUI_NewObject(a0arg : pCHAR; tags : array of LongWord) : pLongWord; inline; +function MUI_Request(app : POINTER; win : POINTER; flags : longword; title : pCHAR; gadgets : pCHAR; format : pCHAR; params : array of LongWord) : LONGINT; + + +function InitMUIMasterLibrary : boolean; + +implementation + + +function MUINotifyData(obj : Pointer) : pMUI_NotifyData; +begin + MUINotifyData := pMUI_NotifyData(@p__dummyXFC2__(obj)^.mnd); +end; + +function MUIAreaData(obj : Pointer) : pMUI_AreaData; +begin + MUIAreaData := pMUI_AreaData(@p__dummyXFC2__(obj)^.mad); +end; + +function MUIGlobalInfo(obj : Pointer) : pMUI_GlobalInfo; +begin + MUIGlobalInfo := pMUI_GlobalInfo(p__dummyXFC2__(obj)^.mnd.mnd_GlobalInfo); +end; + +function MUIUserData(obj : Pointer) : Pointer ; +begin + MUIUserData := Pointer(p__dummyXFC2__(obj)^.mnd.mnd_GlobalInfo); +end; + +function MUIRenderInfo(obj : Pointer) : pMUI_RenderInfo; +begin + MUIRenderInfo := pMUI_RenderInfo(p__dummyXFC2__(obj)^.mad.mad_RenderInfo); +end; + +function MUIPen(pen : longint): longint; +begin + MUIPen := longint(pen*MUIPEN_Mask); +end; + +function OBJ_App(obj : Pointer) : pObject_; (* valid between MUIM_Setup/Cleanup *) +begin + OBJ_App := pMUI_GlobalInfo(obj)^.mgi_ApplicationObject; +end; + +function OBJ_Win(obj : Pointer) : pObject_; (* valid between MUIM_Setup/Cleanup *) +begin + OBJ_Win := pMUI_RenderInfo(obj)^.mri_WindowObject; +end; + +function OBJ_Dri(obj : Pointer) : pDrawInfo; (* valid between MUIM_Setup/Cleanup *) +begin + OBJ_Dri := pMUI_RenderInfo(obj)^.mri_DrawInfo; +end; + +function OBJ_Screen(obj : Pointer) : pScreen; (* valid between MUIM_Setup/Cleanup *) +begin + OBJ_Screen := pMUI_RenderInfo(obj)^.mri_Screen; +end; + +function OBJ_Pens(obj : Pointer) : pWord; (* valid between MUIM_Setup/Cleanup *) +begin + OBJ_Pens := pMUI_RenderInfo(obj)^.mri_Pens; +end; + +function OBJ_Window(obj : Pointer) : pWindow; (* valid between MUIM_Show/Hide *) +begin + OBJ_Window := PMUI_RenderInfo(obj)^.mri_Window; +end; + +function OBJ_Rp(obj : Pointer) : pRastPort; (* valid between MUIM_Show/Hide *) +begin + OBJ_Rp := pMUI_RenderInfo(obj)^.mri_RastPort; +end; + +function OBJ_Left(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_Left := pMUI_AreaData(obj)^.mad_Box.Left; +end; + +function OBJ_Top(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_Top := pMUI_AreaData(obj)^.mad_Box.Top; +end; + +function OBJ_Width(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_Width := pMUI_AreaData(obj)^.mad_Box.Width; +end; + +function OBJ_Height(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_Height := pMUI_AreaData(obj)^.mad_Box.Height; +end; + +function OBJ_Right(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_Right := OBJ_Left(obj) + OBJ_Width(obj) -1; +end; + +function OBJ_Bottom(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_Bottom := OBJ_Top(obj) + OBJ_Height(obj) -1; +end; + +function OBJ_AddLeft(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_AddLeft := pMUI_AreaData(obj)^.mad_AddLeft; +end; + +function OBJ_AddTop(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_AddTop := pMUI_AreaData(obj)^.mad_AddTop; +end; + +function OBJ_SubWidth(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_SubWidth := pMUI_AreaData(obj)^.mad_SubWidth; +end; + +function OBJ_SubHeight(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_SubHeight := pMUI_AreaData(obj)^.mad_SubHeight; +end; + +function OBJ_MLeft(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_MLeft := OBJ_Left(obj) + OBJ_AddLeft(obj); +end; + +function OBJ_MTop(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_MTop := OBJ_Top(obj) + OBJ_AddTop(obj); +end; + +function OBJ_MWidth(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_MWidth := OBJ_Width(obj) -OBJ_SubWidth(obj); +end; + +function OBJ_MHeight(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_MHeight := OBJ_Height(obj) - OBJ_SubHeight(obj); +end; + +function OBJ_MRight(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_MRight := OBJ_MLeft(obj) + OBJ_MWidth(obj) -1; +end; + +function OBJ_MBottom(obj : Pointer) : smallint; (* valid during MUIM_Draw *) +begin + OBJ_MBottom := OBJ_MTop(obj) + OBJ_MHeight(obj) -1; +end; + +function OBJ_Font(obj : Pointer) : pTextFont; (* valid between MUIM_Setup/Cleanup *) +begin + OBJ_Font := pMUI_AreaData(obj)^.mad_Font; +end; + +function OBJ_MinWidth(obj : Pointer) : LongWord; (* valid between MUIM_Show/Hide *) +begin + OBJ_MinWidth := pMUI_AreaData(obj)^.mad_MinMax.MinWidth; +end; + +function OBJ_MinHeight(obj : Pointer) : LongWord; (* valid between MUIM_Show/Hide *) +begin + OBJ_MinHeight := pMUI_AreaData(obj)^.mad_MinMax.MinHeight; +end; + +function OBJ_MaxWidth(obj : Pointer) : LongWord; (* valid between MUIM_Show/Hide *) +begin + OBJ_maxWidth := pMUI_AreaData(obj)^.mad_MinMax.MaxWidth; +end; + +function OBJ_MaxHeight(obj : Pointer) : LongWord; (* valid between MUIM_Show/Hide *) +begin + OBJ_maxHeight := pMUI_AreaData(obj)^.mad_MinMax.MaxHeight; +end; + +function OBJ_DefWidth(obj : Pointer) : LongWord; (* valid between MUIM_Show/Hide *) +begin + OBJ_DefWidth := pMUI_AreaData(obj)^.mad_MinMax.DefWidth; +end; + +function OBJ_DefHeight(obj : Pointer) : LongWord; (* valid between MUIM_Show/Hide *) +begin + OBJ_DefHeight := pMUI_AreaData(obj)^.mad_MinMax.DefHeight; +end; + +function OBJ_Flags(obj : Pointer) : LongWord; +begin + OBJ_Flags := pMUI_AreaData(obj)^.mad_Flags; +end; + +(* +** 2 useful procedures for testing if some coordinates are inside your object +** (converted from the ones in class3.c. So look there how to use... ) +*) + +function OBJ_Between(a,x,b : smallint): boolean; +begin + OBJ_Between := ((x>=a) and (x<=b)); +end; + +function OBJ_IsInObject(x,y : smallint; obj : pObject_): boolean; +begin + OBJ_IsInObject := (OBJ_Between(OBJ_MLeft(obj),x,OBJ_MRight(obj)) + and OBJ_Between(OBJ_MTop(obj),y,OBJ_MBottom(obj))); +end; + +function MUIV_Window_AltHeight_MinMax(p : longint) : longint; +begin + MUIV_Window_AltHeight_MinMax := (0 - p); +end; + +function MUIV_Window_AltHeight_Visible(p : longint) : longint; +begin + MUIV_Window_AltHeight_Visible := (-100 - (p)); +end; + +function MUIV_Window_AltHeight_Screen(p : longint) : longint; +begin + MUIV_Window_AltHeight_Screen := (-200 - (p)); +end; + +function MUIV_Window_AltTopEdge_Delta(p : longint) : longint; +begin + MUIV_Window_AltTopEdge_Delta := (-3 - (p)); +end; + +function MUIV_Window_AltWidth_MinMax(p : longint) : longint; +begin + MUIV_Window_AltWidth_MinMax := 0 - p; +end; + +function MUIV_Window_AltWidth_Visible(p : longint) : longint; +begin + MUIV_Window_AltWidth_Visible := (-100 - (p)); +end; + +function MUIV_Window_AltWidth_Screen(p : longint) : longint; +begin + MUIV_Window_AltWidth_Screen := (-200 - (p)); +end; + +function MUIV_Window_Height_MinMax(p : longint) : longint; +begin + MUIV_Window_Height_MinMax := 0 - p; +end; + +function MUIV_Window_Height_Visible(p : longint) : longint; +begin + MUIV_Window_Height_Visible := (-100 - (p)); +end; + +function MUIV_Window_Height_Screen(p : longint) : longint; +begin + MUIV_Window_Height_Screen := (-200 - (p)); +end; + +function MUIV_Window_TopEdge_Delta(p : longint) : longint; +begin + MUIV_Window_TopEdge_Delta := (-3 - (p)); +end; + +function MUIV_Window_Width_MinMax(p : longint) : longint; +begin + MUIV_Window_Width_MinMax := 0 - p; +end; + +function MUIV_Window_Width_Visible(p : longint) : longint; +begin + MUIV_Window_Width_Visible := (-100 - (p)); +end; + +function MUIV_Window_Width_Screen(p : longint) : longint; +begin + MUIV_Window_Width_Screen := (-200 - (p)); +end; + + +{ + Functions and procedures with array of longword go here +} +function MUI_AllocAslRequestTags(_type : longword; tags : array of LongWord) : POINTER; +begin + MUI_AllocAslRequestTags := MUI_AllocAslRequest(_type , @tags); +end; + +function MUI_AslRequestTags(req : POINTER; tags : array of LongWord) : BOOLEAN; +begin + MUI_AslRequestTags := MUI_AslRequest(req , @tags); +end; + +function MUI_MakeObject(_type : LONGINT; params : array of LongWord) : pLongWord; inline; +begin + MUI_MakeObject := MUI_MakeObjectA(_type , @params); +end; + +function MUI_NewObject(a0arg : PChar; tags : array of LongWord) : pLongWord; inline; +begin + MUI_NewObject := MUI_NewObjectA(a0arg, @tags); +end; + +function MUI_Request(app : POINTER; win : POINTER; flags : longword; title : pCHAR; gadgets : pCHAR; format : pCHAR; params : array of LongWord) : LONGINT; +begin + MUI_Request := MUI_RequestA(app , win , flags , title , gadgets , format , @params); +end; + +function MAKE_ID(a,b,c,d : char): longword; +begin + MAKE_ID:=(byte(a) shl 24)+(byte(b) shl 16)+(byte(c) shl 8)+byte(d); +end; + +//#define get(obj,attr,store) GetAttr(attr,obj,(ULONG *)store) +function MUIget(obj: pObject_; attr: longword; store: longword): longword; +begin + MUIget:=GetAttr(attr,obj,store); +end; + +//#define set(obj,attr,value) SetAttrs(obj,attr,value,TAG_DONE) +function MUIset(obj: pObject_; attr: longword; value: longword): longword; +var args: array[0..2] of longword; +begin + args[0]:=attr; + args[1]:=value; + args[2]:=TAG_DONE; + MUIset:=SetAttrsA(obj,@args); +end; + + +const + { Change VERSION and LIBVERSION to proper values } + VERSION : string[2] = '19'; + LIBVERSION : longword = MUIMASTER_VMIN; + +var + muimaster_exit : Pointer; + +procedure CloseMUIMasterLibrary; +begin + ExitProc := muimaster_exit; + if MUIMasterBase <> nil then begin + CloseLibrary(MUIMasterBase); + MUIMasterBase := nil; + end; +end; + +function InitMUIMasterLibrary : boolean; +begin + MUIMasterBase := nil; + MUIMasterBase := OpenLibrary(MUIMASTER_NAME,LIBVERSION); + if MUIMasterBase <> nil then begin + muimaster_exit := ExitProc; + ExitProc := @CloseMUIMasterLibrary; + InitMUIMasterLibrary:=True; + end else begin + InitMUIMasterLibrary:=False; + end; +end; + +end. diff --git a/packages/morphunits/src/muihelper.pas b/packages/morphunits/src/muihelper.pas new file mode 100644 index 0000000000..8c85f567e5 --- /dev/null +++ b/packages/morphunits/src/muihelper.pas @@ -0,0 +1,268 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2005 Karoly Balogh + + MUI helper functions for MorphOS/PowerPC + + Based on work of Nils Sjoholm member of the Amiga RTL + development team. + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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 muihelper; + +interface + +uses intuition, mui, amigados, utility; + + +const + NoFrame = MUIV_Frame_None; + ButtonFrame = MUIV_Frame_Button; + ImageButtonFrame = MUIV_Frame_ImageButton; + TextFrame = MUIV_Frame_Text; + StringFrame = MUIV_Frame_String; + ReadListFrame = MUIV_Frame_ReadList; + InputListFrame = MUIV_Frame_InputList; + PropFrame = MUIV_Frame_Prop; + SliderFrame = MUIV_Frame_Slider; + GaugeFrame = MUIV_Frame_Gauge; + VirtualFrame = MUIV_Frame_Virtual; + GroupFrame = MUIV_Frame_Group; + +const + Child = MUIA_Group_Child; + SubWindow = MUIA_Application_Window; + WindowContents = MUIA_Window_RootObject; + + +// Creates a MUI application +function MH_Application(tags: array of LongWord): pObject_; +function MH_Application(var app; tags: array of LongWord): pObject_; + +// Creates a MUI window +function MH_Window(tags: array of LongWord): pObject_; +function MH_Window(var win; tags: array of LongWord): pObject_; + +// Creates a MUI button +function MH_MakeButton(blabel: pchar): pObject_; +function MH_MakeButton(var button; blabel: pchar): pObject_; + +// Creates a MUI HBar +function MH_MakeHBar(space: longword): pObject_; +function MH_MakeHBar(var hbar; space: longword): pObject_; + +// Creates MUI V/HGroup +function MH_VGroup(tags: array of LongWord): pObject_; +function MH_VGroup(frame: longword; tags: array of LongWord): pObject_; +function MH_VGroup(title: PChar; tags: array of LongWord): pObject_; +function MH_HGroup(tags: array of LongWord): pObject_; +function MH_HGroup(frame: longword; tags: array of LongWord): pObject_; +function MH_HGroup(title: PChar; tags: array of LongWord): pObject_; + +// Creates MUI Col/RowGroup +function MH_ColGroup(cols: longword; tags: array of LongWord): pObject_; +function MH_ColGroup(cols: longword; frame: longword; tags: array of LongWord): pObject_; +function MH_ColGroup(cols: longword; title: PChar; tags: array of LongWord): pObject_; +function MH_RowGroup(rows: longword; tags: array of LongWord): pObject_; +function MH_RowGroup(rows: longword; frame: longword; tags: array of LongWord): pObject_; +function MH_RowGroup(rows: longword; title: PChar; tags: array of LongWord): pObject_; + + +// Creates a MUI Text area +function MH_Text(contents: PChar): pObject_; +function MH_Text(contents: PChar; tags: array of LongWord): pObject_; +function MH_Text(var text_; contents: PChar): pObject_; +function MH_Text(var text_; contents: PChar; tags: array of LongWord): pObject_; + + +implementation + + +// Creates a MUI application +// ************************************************************************ +function MH_Application(tags: array of LongWord): pObject_; +begin + MH_Application:=MUI_NewObject(MUIC_Application, tags); +end; + +function MH_Application(var app; tags: array of LongWord): pObject_; +begin + pObject_(app):=MUI_NewObject(MUIC_Application, tags); + MH_Application:=pObject_(app); +end; + + +// Creates a MUI window +// ************************************************************************ +function MH_Window(tags: array of LongWord): pObject_; +begin + MH_Window:=MUI_NewObject(MUIC_Window, tags); +end; + +function MH_Window(var win; tags: array of LongWord): pObject_; +begin + pObject_(win):=MUI_NewObject(MUIC_Window, tags); + MH_Window:=pObject_(win); +end; + + +// Creates a MUI button +// ************************************************************************ +function MH_MakeButton(blabel: pchar): pObject_; +begin + MH_MakeButton:=MUI_MakeObject(MUIO_Button, [DWord(blabel)]); +end; + +function MH_MakeButton(var button; blabel: pchar): pObject_; +begin + pObject_(button):=MUI_MakeObject(MUIO_Button, [DWord(blabel)]); + MH_MakeButton:=pObject_(button); +end; + + +// Creates a MUI HBar +// ************************************************************************ +function MH_MakeHBar(space: longword): pObject_; +begin + MH_MakeHBar:=MUI_MakeObject(MUIO_HBar, [space]); +end; + +function MH_MakeHBar(var hbar; space: longword): pObject_; +begin + pObject_(hbar):=MUI_MakeObject(MUIO_HBar, [space]); + MH_MakeHBar:=pObject_(hbar); +end; + + +// Creates a MUI VGroup +// ************************************************************************ +function MH_VGroup(tags: array of LongWord): pObject_; +begin + MH_VGroup:=MUI_NewObject(MUIC_Group, tags); +end; + +function MH_VGroup(frame: longword; tags: array of LongWord): pObject_; +begin + MH_VGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Frame, frame, TAG_MORE, DWord(@tags) ] ); +end; + +function MH_VGroup(title: PChar; tags: array of LongWord): pObject_; +begin + MH_VGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Frame, MUIV_Frame_Group, + MUIA_FrameTitle, longword(title), + MUIA_Background, MUII_GroupBack, + TAG_MORE, DWord(@tags) ]); +end; + + +// Creates a MUI HGroup +// ************************************************************************ +function MH_HGroup(tags: array of LongWord): pObject_; +begin + MH_HGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Group_Horiz, MUI_TRUE, TAG_MORE, DWord(@tags) ]); +end; + +function MH_HGroup(frame: longword; tags: array of LongWord): pObject_; +begin + MH_HGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Group_Horiz, MUI_TRUE, + MUIA_Frame, frame, + TAG_MORE, DWord(@tags) ] ); +end; + +function MH_HGroup(title: PChar; tags: array of LongWord): pObject_; +begin + MH_HGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Group_Horiz, MUI_TRUE, + MUIA_Frame, MUIV_Frame_Group, + MUIA_FrameTitle, longword(title), + MUIA_Background, MUII_GroupBack, + TAG_MORE, DWord(@tags) ]); +end; + + +// Creates MUI ColGroup +// ************************************************************************ +function MH_ColGroup(cols: longword; tags: array of LongWord): pObject_; +begin + MH_ColGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Group_Columns, cols, TAG_MORE, DWord(@tags) ]); +end; + +function MH_ColGroup(cols: longword; frame: longword; tags: array of LongWord): pObject_; +begin + MH_ColGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Group_Columns, cols, + MUIA_Frame, frame, + TAG_MORE, DWord(@tags) ]); +end; + +function MH_ColGroup(cols: longword; title: PChar; tags: array of LongWord): pObject_; +begin + MH_ColGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Group_Columns, cols, + MUIA_Frame, MUIV_Frame_Group, + MUIA_FrameTitle, longword(title), + MUIA_Background, MUII_GroupBack, + TAG_MORE, DWord(@tags) ]); +end; + + +// Creates MUI RowGroup +// ************************************************************************ +function MH_RowGroup(rows: longword; tags: array of LongWord): pObject_; +begin + MH_RowGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Group_Rows, rows, TAG_MORE, DWord(@tags) ]); +end; + +function MH_RowGroup(rows: longword; frame: longword; tags: array of LongWord): pObject_; +begin + MH_RowGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Group_Rows, rows, + MUIA_Frame, frame, + TAG_MORE, DWord(@tags) ]); +end; + +function MH_RowGroup(rows: longword; title: PChar; tags: array of LongWord): pObject_; +begin + MH_RowGroup:=MUI_NewObject(MUIC_Group, [ MUIA_Group_Rows, rows, + MUIA_Frame, MUIV_Frame_Group, + MUIA_FrameTitle, longword(title), + MUIA_Background, MUII_GroupBack, + TAG_MORE, DWord(@tags) ]); +end; + + +// Creates a MUI text area +// ************************************************************************ +function MH_Text(contents: PChar): pObject_; +begin + MH_Text:=MUI_NewObject(MUIC_Text,[ MUIA_Text_Contents, DWord(contents), TAG_DONE ]); +end; + +function MH_Text(contents: PChar; tags: array of LongWord): pObject_; +begin + MH_Text:=MUI_NewObject(MUIC_Text,[ MUIA_Text_Contents, DWord(contents), + TAG_MORE, DWord(@tags) ]); +end; + +function MH_Text(var text_; contents: PChar): pObject_; +begin + pObject_(text_):=MUI_NewObject(MUIC_Text,[ MUIA_Text_Contents, DWord(contents), TAG_DONE ]); + MH_Text:=pObject_(text_); +end; + +function MH_Text(var text_; contents: PChar; tags: array of LongWord): pObject_; +begin + pObject_(text_):=MUI_NewObject(MUIC_Text,[ MUIA_Text_Contents, DWord(contents), + TAG_MORE, DWord(@tags) ]); + MH_Text:=pObject_(text_); +end; + + +end. diff --git a/packages/morphunits/src/timer.pas b/packages/morphunits/src/timer.pas new file mode 100644 index 0000000000..f7846b6237 --- /dev/null +++ b/packages/morphunits/src/timer.pas @@ -0,0 +1,101 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + timer.device interface unit for MorphOS/PowerPC + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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 timer; + +interface + +uses + exec; + +var + TimerBase : Pointer; + + +{ * timer.device definitions (V50) + ********************************************************************* + * } + + +const + UNIT_MICROHZ = 0; + UNIT_VBLANK = 1; + UNIT_ECLOCK = 2; + UNIT_WAITUNTIL = 3; + UNIT_WAITECLOCK = 4; + { *** V50 *** } + UNIT_CPUCLOCK = 5; + UNIT_WAITCPUCLOCK = 6; + +const + TIMERNAME = 'timer.device'; + + +type + PTimeVal = ^TTimeVal; + TTimeVal = packed record + tv_secs : DWord; + tv_micro: DWord; + end; + +type + PEClockVal = ^TEClockVal; + TEClockVal = packed record + ev_hi: DWord; + ev_lo: DWord; + end; + +type + PTimeRequest = ^TTimeRequest; + TTimeRequest = packed record + tr_node: TIORequest; + tr_time: TTimeVal; + end; + + +const + TR_ADDREQUEST = (CMD_NONSTD); + TR_GETSYSTIME = (CMD_NONSTD + 1); + TR_SETSYSTIME = (CMD_NONSTD + 2); + + +procedure AddTime(Dest : PTimeVal location 'a0'; + Source: PTimeVal location 'a1'); +SysCall TimerBase 42; + +procedure SubTime(Dest : PTimeVal location 'a0'; + Source: PTimeVal location 'a1'); +SysCall TimerBase 48; + +function CmpTime(Dest : PTimeVal location 'a0'; + Source: PTimeVal location 'a1'): LongInt; +SysCall TimerBase 54; + +function ReadEClock(Dest: PTimeVal location 'a0'): DWord; +SysCall TimerBase 60; + +procedure GetSysTime(Dest: PTimeVal location 'a0'); +SysCall TimerBase 66; + +{.$include timerd.inc} +{.$include timerf.inc} + +implementation + +begin +end. diff --git a/packages/morphunits/src/tinygl.pas b/packages/morphunits/src/tinygl.pas new file mode 100644 index 0000000000..9f236c9412 --- /dev/null +++ b/packages/morphunits/src/tinygl.pas @@ -0,0 +1,80 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2005 by Karoly Balogh + + TinyGL/OpenGL initialization unit for MorphOS/PowerPC + + Thanks to Michal 'kiero' Wozniak and Mark 'bigfoot' Olsen + for their help. + + 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. + + **********************************************************************} + +{$MODE FPC} { fsck Delphi mode } +{$INLINE ON} +unit tinygl; + +interface + +uses + exec; + +const + TINYGLNAME : PChar = 'tinygl.library'; + +var + TinyGLBase: Pointer; + tglContext: Pointer; + +function InitTinyGLLibrary : boolean; + +implementation + +function _GLInit: Pointer; +syscall sysvbase TinyGLBase 640; + +procedure _GLClose(gcl: pointer); +syscall sysvbase TinyGLBase 646; + +const + { Change VERSION and LIBVERSION to proper values } + VERSION : string[2] = '50'; + LIBVERSION : longword = 50; + +var + tinygl_exit : Pointer; + +procedure CloseTinyGLLibrary; +begin + ExitProc := tinygl_exit; + if TinyGLBase <> nil then begin + if tglContext <> nil then begin + _GLClose(tglContext); + tglContext := nil; + end; + CloseLibrary(PLibrary(TinyGLBase)); + TinyGLBase := nil; + end; +end; + +function InitTinyGLLibrary : boolean; +begin + TinyGLBase := nil; + TinyGLBase := OpenLibrary(TINYGLNAME,LIBVERSION); + if TinyGLBase <> nil then begin + tinygl_exit := ExitProc; + ExitProc := @CloseTinyGLLibrary; + tglContext := _GLInit; + InitTinyGLLibrary := True; + end else begin + InitTinyGLLibrary := False; + end; +end; + +end. diff --git a/packages/morphunits/src/utility.pas b/packages/morphunits/src/utility.pas new file mode 100644 index 0000000000..30f38747bd --- /dev/null +++ b/packages/morphunits/src/utility.pas @@ -0,0 +1,366 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> + + utility.library interface unit for MorphOS/PowerPC + + MorphOS port was done on a free Pegasos II/G4 machine + provided by Genesi S.a.r.l. <www.genesi.lu> + + 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. + + **********************************************************************} +{$inline on} +unit utility; + +interface + +uses + exec; + +var + UtilityBase: Pointer; + + +{ * utility.library date defines + ********************************************************************* + * } + + +type + PClockData = ^TClockData; + TClockData = packed record + sec : Word; + min : Word; + hour : Word; + mday : Word; + month: Word; + year : Word; + wday : Word; + end; + + + +{ * utility.library tagitem defines + ********************************************************************* + * } + + +type + Tag = Cardinal; + +type + PPTagItem = ^PTagItem; + PTagItem = ^TTagItem; + TTagItem = packed record + ti_Tag : Tag; + ti_Data: Cardinal; + end; + + +const + TAG_DONE = 0; + TAG_END = 0; + TAG_IGNORE = 1; + TAG_MORE = 2; + TAG_SKIP = 3; + +const + TAG_USER = 1 Shl 31; + +const + TAGFILTER_AND = 0; + TAGFILTER_NOT = 1; + +const + MAP_REMOVE_NOT_FOUND = 0; + MAP_KEEP_NOT_FOUND = 1; + + + +{ * utility.library namespace defines + ********************************************************************* + * } + + +type + PNamedObject = ^TNamedObject; + TNamedObject = packed record + no_Object: Pointer; + end; + + +const + ANO_NameSpace = 4000; + ANO_UserSpace = 4001; + ANO_Priority = 4002; + ANO_Flags = 4003; + + NSB_NODUPS = 0; + NSB_CASE = 1; + + NSF_NODUPS = 1 Shl NSB_NODUPS; + NSF_CASE = 1 Shl NSB_CASE; + + + +{ * utility.library pack attributes and macros + ********************************************************************* + * } + + +const + PSTB_SIGNED = 31; + PSTB_UNPACK = 30; + PSTB_PACK = 29; + PSTB_EXISTS = 26; + + PSTF_SIGNED = (1 Shl PSTB_SIGNED); + PSTF_UNPACK = (1 Shl PSTB_UNPACK); + PSTF_PACK = (1 Shl PSTB_PACK); + PSTF_EXISTS = (1 Shl PSTB_EXISTS); + +const + PKCTRL_PACKUNPACK = $00000000; + PKCTRL_PACKONLY = $40000000; + PKCTRL_UNPACKONLY = $20000000; + + PKCTRL_BYTE = $80000000; + PKCTRL_WORD = $88000000; + PKCTRL_LONG = $90000000; + + PKCTRL_UBYTE = $00000000; + PKCTRL_UWORD = $08000000; + PKCTRL_ULONG = $10000000; + + PKCTRL_BIT = $18000000; + PKCTRL_FLIPBIT = $98000000; + +{$WARNING FIX ME!!! Some macros to convert} +{ + PK_BITNUM1(flg) ((flg) == 0x01 ? 0 : (flg) == 0x02 ? 1 : (flg) == 0x04 ? 2 : (flg) == 0x08 ? 3 : (flg) == 0x10 ? 4 : (flg) == 0x20 ? 5 : (flg) == 0x40 ? 6 : 7) + PK_BITNUM2(flg) ((flg < 0x100 ? PK_BITNUM1(flg) : 8 + PK_BITNUM1(flg >> 8))) + PK_BITNUM(flg) ((flg < 0x10000 ? PK_BITNUM2(flg) : 16 + PK_BITNUM2(flg >> 16))) + PK_WORDOFFSET(flg) ((flg) < 0x100 ? 1 : 0) + PK_LONGOFFSET(flg) ((flg) < 0x100 ? 3 : (flg) < 0x10000 ? 2 : (flg) < 0x1000000 ? 1 : 0) + PK_CALCOFFSET(type,field) ((ULONG)(&((struct type *)0)->field)) + + + PACK_STARTTABLE(tagbase) (tagbase) + PACK_NEWOFFSET(tagbase) (-1L),(tagbase) + PACK_ENDTABLE 0 + PACK_ENTRY(tagbase,tag,type,field,control) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field)) + PACK_BYTEBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field) | (PK_BITNUM(flags) << 13L)) + PACK_WORDBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_WORDOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L)) + PACK_LONGBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_LONGOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L)) +} + +{ * utility.library include + ********************************************************************* + * } + + +const + UtilityName = 'utility.library'; + + +type + PUtilityBase = ^TUtilityName; + TUtilityName = packed record + ub_LibNode : TLibrary; + ub_Language: Byte; + ub_Reserved: Byte; + end; + + + +{ * utility.library hook defines + ********************************************************************* + * } + + +type + PHook = ^THook; + THook = packed record + h_MinNode : TMinNode; + h_Entry : Cardinal; + h_SubEntry: Cardinal; + h_Data : Pointer; + end; + + +function FindTagItem(tagVal : Cardinal location 'd0'; + tagList: PTagItem location 'a0'): PTagItem; +SysCall MOS_UtilityBase 030; + +function GetTagData(tagValue : Cardinal location 'd0'; + defaultVal: Cardinal location 'd1'; + tagList : PTagItem location 'a0'): Cardinal; +SysCall MOS_UtilityBase 036; + +function PackBoolTags(initialFlags: Cardinal location 'd0'; + tagList : PTagItem location 'a0'; + boolMap : PTagItem location 'a1'): Cardinal; +SysCall MOS_UtilityBase 042; + +function NextTagItem(tagListPtr: pPTagItem location 'a0'): PTagItem; +SysCall MOS_UtilityBase 048; + +procedure FilterTagChanges(changeList : PTagItem location 'a0'; + originalList: PTagItem location 'a1'; + apply : Cardinal location 'd0'); +SysCall MOS_UtilityBase 054; + +procedure MapTags(tagList: PTagItem location 'a0'; + mapList: PTagItem location 'a1'; + mapType: Cardinal location 'd0'); +SysCall MOS_UtilityBase 060; + +function AllocateTagItems(numTags: Cardinal location 'd0'): PTagItem; +SysCall MOS_UtilityBase 066; + +function CloneTagItems(tagList: PTagItem location 'a0'): PTagItem; +SysCall MOS_UtilityBase 072; + +procedure FreeTagItems(tagList: PTagItem location 'a0'); +SysCall MOS_UtilityBase 078; + +procedure RefreshTagItemClones(clone : PTagItem location 'a0'; + original: PTagItem location 'a1'); +SysCall MOS_UtilityBase 084; + +function TagInArray(tagValue : Cardinal location 'd0'; + var tagArray: Cardinal location 'a0'): LongBool; +SysCall MOS_UtilityBase 090; + +function FilterTagItems(tagList : PTagItem location 'a0'; + var filterArray: Cardinal location 'a1'; + logic : Cardinal location 'd0'): Cardinal; +SysCall MOS_UtilityBase 096; + +function CallHookPkt(hook : PHook location 'a0'; + hobject : Pointer location 'a2'; + paramPacket: Pointer location 'a1'): Cardinal; +SysCall MOS_UtilityBase 102; + +procedure Amiga2Date(seconds: Cardinal location 'd0'; + result : PClockData location 'a0'); +SysCall MOS_UtilityBase 120; + +function Date2Amiga(date: PClockData location 'a0'): Cardinal; +SysCall MOS_UtilityBase 126; + +function CheckDate(date: PClockData location 'a0'): Cardinal; +SysCall MOS_UtilityBase 132; + +function SMult32(arg1: LongInt location 'd0'; + arg2: LongInt location 'd1'): LongInt; +SysCall MOS_UtilityBase 138; + +function UMult32(arg1: Cardinal location 'd0'; + arg2: Cardinal location 'd1'): Cardinal; +SysCall MOS_UtilityBase 144; + +function SDivMod32(dividend: LongInt location 'd0'; + divisor: LongInt location 'd1'): LongInt; +SysCall MOS_UtilityBase 150; + +function UDivMod32(dividend: Cardinal location 'd0'; + divisor : Cardinal location 'd1'): Cardinal; +SysCall MOS_UtilityBase 156; + +function Stricmp(string1: PChar location 'a0'; + string2: PChar location 'a1'): LongInt; +SysCall MOS_UtilityBase 162; + +function Strnicmp(string1: PChar location 'a0'; + string2: PChar location 'a1'; + length : LongInt location 'd0'): LongInt; +SysCall MOS_UtilityBase 168; + +function ToUpper(character: Cardinal location 'd0'): Char; +SysCall MOS_UtilityBase 174; + +function ToLower(character: Cardinal location 'd0'): Char; +SysCall MOS_UtilityBase 180; + +procedure ApplyTagChanges(list : PTagItem location 'a0'; + changeList: PTagItem location 'a1'); +SysCall MOS_UtilityBase 186; + +function SMult64(arg1: LongInt location 'd0'; + arg2: LongInt location 'd1'): LongInt; +SysCall MOS_UtilityBase 198; + +function UMult64(arg1: Cardinal location 'd0'; + arg2: Cardinal location 'd1'): Cardinal; +SysCall MOS_UtilityBase 204; + +function PackStructureTags(pack : Pointer location 'a0'; + var packTable: Cardinal location 'a1'; + tagList : PTagItem location 'a2'): Cardinal; +SysCall MOS_UtilityBase 210; + +function UnpackStructureTags(pack : Pointer location 'a0'; + var packTable: Cardinal location 'a1'; + tagList : PTagItem location 'a2'): Cardinal; +SysCall MOS_UtilityBase 216; + +function AddNamedObject(nameSpace: PNamedObject location 'a0'; + nobject : PNamedObject location 'a1'): LongBool; +SysCall MOS_UtilityBase 222; + +function AllocNamedObjectA(name : PChar location 'a0'; + tagList: PTagItem location 'a1'): PNamedObject; +SysCall MOS_UtilityBase 228; + +function AttemptRemNamedObject(nobject: PNamedObject location 'a0'): LongInt; +SysCall MOS_UtilityBase 234; + +function FindNamedObject(nameSpace : PNamedObject location 'a0'; + name : PChar location 'a1'; + lastObject: PNamedObject location 'a2'): PNamedObject; +SysCall MOS_UtilityBase 240; + +procedure FreeNamedObject(nobject: PNamedObject location 'a0'); +SysCall MOS_UtilityBase 246; + +function NamedObjectName(nobject: PNamedObject location 'a0'): PChar; +SysCall MOS_UtilityBase 252; + +procedure ReleaseNamedObject(nobject: pNamedObject location 'a0'); +SysCall MOS_UtilityBase 258; + +procedure RemNamedObject(nobject: PNamedObject location 'a0'; + message: PMessage location 'a1'); +SysCall MOS_UtilityBase 264; + +function GetUniqueID: Cardinal; +SysCall MOS_UtilityBase 270; + + +function TAG_(value: pointer): longword; inline; +function TAG_(value: pchar): longword; inline; + + +implementation + +function TAG_(value: pointer): longword; inline; +begin + TAG_:=longword(value); +end; + +function TAG_(value: pchar): longword; inline; +begin + TAG_:=longword(value); +end; + + +begin + UtilityBase:=MOS_UtilityBase; +end. |